/* ═══════════════════════════════════════════════
   ExamVerse — Shared components (nav, footer,
   modal, toast, palette, tables chrome, tabs)
   ═══════════════════════════════════════════════ */

/* ── app nav (practice portal) ── */
.appnav { position: sticky; top: 5px; z-index: 100; padding: 10px 0; transition: all 0.3s; }
.appnav.scrolled { background: var(--navbg); backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
.appnav .container { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.logo { font-family: 'Poppins'; font-size: 1.25rem; font-weight: 800; color: var(--ink); text-decoration: none; letter-spacing: -0.5px; white-space: nowrap; }
.logo > span:first-child { color: var(--saffron); }
.logo .dev { display: none; }
.nav-links { display: flex; align-items: center; gap: 4px; list-style: none; }
.nav-links a.nl {
  color: var(--ink2); text-decoration: none; font-size: 0.86rem; font-weight: 600;
  padding: 8px 13px; border-radius: 10px; transition: all 0.2s; white-space: nowrap;
}
.nav-links a.nl:hover { color: var(--ink); background: rgba(240, 140, 0, 0.07); }
.nav-links a.nl.active { color: var(--saffron); background: rgba(240, 140, 0, 0.1); font-weight: 700; }
.nav-actions { display: flex; align-items: center; gap: 10px; }
.avatar-chip { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; color: var(--ink); font-weight: 700; font-size: 0.84rem; padding: 5px 12px 5px 5px; border-radius: 100px; border: 1.5px solid var(--line); background: var(--card); transition: border-color 0.2s; }
.avatar-chip:hover { border-color: var(--saffron); }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: linear-gradient(135deg, var(--saffron), var(--chili)); color: #fff; display: flex; align-items: center; justify-content: center; font-family: 'Poppins'; font-weight: 800; font-size: 0.8rem; }
.theme-btn { background: var(--card); border: 1.5px solid var(--line); border-radius: 10px; width: 38px; height: 38px; font-size: 1rem; cursor: pointer; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; transition: transform 0.2s, border-color 0.2s; }
.theme-btn:hover { transform: translateY(-1px); border-color: var(--saffron); }
.mob-toggle { display: none; background: none; border: none; color: var(--ink); font-size: 1.5rem; cursor: pointer; line-height: 1; }
@media (max-width: 920px) {
  .nav-links { display: none; flex-direction: column; align-items: stretch; gap: 4px; position: absolute; top: 54px; right: 16px; min-width: 230px; background: var(--card); border: 1.5px solid var(--line); border-radius: 16px; padding: 12px; box-shadow: var(--shadow); }
  .nav-links.open { display: flex; animation: up 0.25s ease-out; }
  .mob-toggle { display: block; }
}
@keyframes up { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }

/* ── minimal live-portal header ── */
.livehdr { position: sticky; top: 5px; z-index: 100; background: var(--navbg); backdrop-filter: blur(14px); border-bottom: 1.5px solid var(--line); padding: 13px 0; }
.livehdr .container { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.livehdr .lh-brand { font-family: 'Poppins'; font-weight: 800; font-size: 0.95rem; letter-spacing: 1.5px; text-transform: uppercase; color: var(--ink2); display: flex; align-items: center; gap: 9px; }
.livehdr .lh-brand b { color: var(--chili); }
.livehdr .lh-exam { font-weight: 700; font-size: 0.88rem; color: var(--ink); }

/* ── admin nav ── */
.admin-shell { display: grid; grid-template-columns: 232px 1fr; min-height: calc(100vh - 5px); }
.admin-side { border-right: 1.5px solid var(--line); background: var(--paper2); padding: 26px 16px; position: sticky; top: 5px; height: calc(100vh - 5px); overflow-y: auto; }
.admin-side .logo { display: block; margin-bottom: 6px; }
.admin-side .side-tag { font-size: 0.62rem; font-weight: 800; letter-spacing: 2px; text-transform: uppercase; color: var(--chakra); margin-bottom: 26px; padding-left: 10px; }
.side-links { list-style: none; display: flex; flex-direction: column; gap: 3px; }
.side-links a { display: flex; align-items: center; gap: 11px; padding: 10px 12px; border-radius: 11px; color: var(--ink2); text-decoration: none; font-size: 0.88rem; font-weight: 600; transition: all 0.2s; }
.side-links a:hover { background: rgba(240, 140, 0, 0.07); color: var(--ink); }
.side-links a.active { background: rgba(240, 140, 0, 0.12); color: var(--saffron); font-weight: 700; }
.side-links a .ic { width: 20px; text-align: center; }
.admin-main { padding: 30px 30px 60px; min-width: 0; }
@media (max-width: 860px) {
  .admin-shell { grid-template-columns: 1fr; }
  .admin-side { position: static; height: auto; border-right: none; border-bottom: 1.5px solid var(--line); padding: 16px; }
  .side-links { flex-direction: row; overflow-x: auto; flex-wrap: nowrap; }
  .side-links a { white-space: nowrap; padding: 8px 11px; }
  .admin-side .side-tag { display: none; }
  .admin-main { padding: 22px 16px 50px; }
}

/* ── footer ── */
footer.appftr { padding: 30px 0; border-top: 1.5px solid var(--line); position: relative; z-index: 2; background: var(--paper2); margin-top: 60px; }
footer.appftr .ftr { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
footer.appftr .ftr-l { font-size: 0.8rem; color: var(--ink3); font-weight: 600; }
footer.appftr ul { display: flex; gap: 20px; list-style: none; flex-wrap: wrap; }
footer.appftr a { font-size: 0.8rem; color: var(--ink3); text-decoration: none; font-weight: 600; }
footer.appftr a:hover { color: var(--ink); }
@media (max-width: 640px) { footer.appftr .ftr { flex-direction: column; text-align: center; } }

/* ── modal ── */
.modal-veil { position: fixed; inset: 0; z-index: 200; background: rgba(20, 14, 8, 0.55); backdrop-filter: blur(4px); display: flex; align-items: center; justify-content: center; padding: 20px; animation: veil 0.2s ease-out; }
@keyframes veil { from { opacity: 0; } }
.modal { background: var(--card); border: 1.5px solid var(--line); border-radius: 20px; box-shadow: var(--shadow); max-width: 520px; width: 100%; max-height: 88vh; overflow-y: auto; padding: 26px; animation: up 0.28s var(--ease-out); }
.modal.wide { max-width: 860px; }
.modal h3 { font-family: 'Poppins'; font-size: 1.15rem; font-weight: 800; margin-bottom: 8px; }
.modal .m-body { font-size: 0.9rem; color: var(--ink2); line-height: 1.65; }
.modal .m-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; flex-wrap: wrap; }

/* ── toast ── */
.toast-zone { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); z-index: 300; display: flex; flex-direction: column; gap: 9px; align-items: center; pointer-events: none; width: min(480px, calc(100vw - 32px)); }
.toast { background: var(--ink); color: var(--paper); padding: 12px 20px; border-radius: 12px; font-size: 0.86rem; font-weight: 600; box-shadow: var(--shadow); animation: up 0.3s var(--ease-out); display: flex; align-items: center; gap: 9px; }
.toast.ok { background: var(--green); color: #fff; }
.toast.warn { background: #b76400; color: #fff; }
.toast.err { background: var(--chili); color: #fff; }

/* ── skeletons ── */
.sk { position: relative; overflow: hidden; background: rgba(43, 33, 24, 0.07); border-radius: 10px; }
body[data-theme="dark"] .sk { background: rgba(235, 220, 195, 0.08); }
.sk::after { content: ''; position: absolute; inset: 0; transform: translateX(-100%); background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.25), transparent); animation: shimmer 1.4s infinite; }
@keyframes shimmer { to { transform: translateX(100%); } }
.sk-line { height: 13px; margin-bottom: 10px; }
.sk-card { height: 150px; border-radius: 18px; }

/* ── empty state ── */
.empty { text-align: center; padding: 52px 24px; border: 2px dashed var(--line); border-radius: var(--r-xl); background: var(--card); }
.empty .e-ic { font-size: 2.4rem; margin-bottom: 12px; }
.empty h3 { font-family: 'Poppins'; font-size: 1.1rem; font-weight: 700; margin-bottom: 6px; }
.empty p { font-size: 0.88rem; color: var(--ink2); max-width: 420px; margin: 0 auto 18px; line-height: 1.6; }

/* ── filter pills ── */
.pills { display: flex; gap: 8px; flex-wrap: wrap; }
.pill-btn { padding: 8px 17px; border-radius: 100px; border: 1.5px solid var(--line); background: var(--card); color: var(--ink2); font-size: 0.83rem; font-weight: 700; cursor: pointer; transition: all 0.2s; white-space: nowrap; }
.pill-btn:hover { border-color: var(--saffron); color: var(--saffron); }
.pill-btn.on { background: var(--saffron); border-color: var(--saffron); color: #fff; box-shadow: 0 4px 14px rgba(240, 140, 0, 0.3); }

/* ── tabs (underline style) ── */
.tabs { display: flex; gap: 4px; border-bottom: 2px solid var(--line); overflow-x: auto; }
.tab-btn { padding: 11px 18px; border: none; background: none; cursor: pointer; font-size: 0.88rem; font-weight: 700; color: var(--ink2); border-bottom: 3px solid transparent; margin-bottom: -2px; transition: all 0.2s; white-space: nowrap; font-family: inherit; }
.tab-btn:hover { color: var(--ink); }
.tab-btn.on { color: var(--saffron); border-bottom-color: var(--saffron); }

/* ── week selector ── */
.week-sel { display: inline-flex; align-items: center; gap: 12px; background: var(--card); border: 1.5px solid var(--line); border-radius: 100px; padding: 6px 8px; box-shadow: var(--shadow-sm); }
.week-sel button { background: var(--paper2); border: none; width: 34px; height: 34px; border-radius: 50%; cursor: pointer; font-size: 1rem; color: var(--ink2); transition: all 0.2s; }
.week-sel button:hover:not(:disabled) { background: var(--saffron); color: #fff; }
.week-sel button:disabled { opacity: 0.35; cursor: not-allowed; }
.week-sel .wk { font-family: 'Poppins'; font-weight: 700; font-size: 0.86rem; min-width: 150px; text-align: center; }

/* ── pagination ── */
.pager { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 20px; }
.pager .pg-info { font-size: 0.82rem; color: var(--ink2); font-weight: 600; }

/* ── key/value meta rows ── */
.kv { display: grid; grid-template-columns: auto 1fr; gap: 7px 16px; font-size: 0.88rem; }
.kv dt { color: var(--ink3); font-weight: 600; }
.kv dd { color: var(--ink); font-weight: 600; text-align: right; }

/* ── generic page head ── */
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin: 30px 0 22px; }

/* ── beta feedback button ── */
.ev-fb-btn { position: fixed; left: 16px; bottom: calc(16px + env(safe-area-inset-bottom)); z-index: 180; background: var(--card); border: 1.5px solid var(--line); border-radius: 100px; padding: 9px 16px; font-weight: 700; font-size: 0.8rem; color: var(--ink2); cursor: pointer; box-shadow: var(--shadow-sm); transition: all 0.2s; font-family: inherit; }
.ev-fb-btn:hover { border-color: var(--saffron); color: var(--saffron); transform: translateY(-2px); box-shadow: var(--shadow); }
@media (max-width: 640px) { .ev-fb-btn { padding: 8px 13px; font-size: 0.74rem; } }
/* v0.13: feedback pill sits bottom-right, clear of left-aligned content; exam pages hide it */
.ev-fb-btn { left: auto; right: calc(16px + env(safe-area-inset-right)); }
.livebadge { display: inline-flex; align-items: center; gap: 7px; background: rgba(201, 79, 61, 0.1); color: var(--chili); border: 1.5px solid rgba(201, 79, 61, 0.35); border-radius: 100px; padding: 5px 12px; font-size: 0.68rem; font-weight: 800; letter-spacing: 1.4px; text-transform: uppercase; white-space: nowrap; }
.livebadge .ld { width: 8px; height: 8px; border-radius: 50%; background: var(--chili); animation: pulseDot 1.6s infinite; }
@keyframes pulseDot { 0%, 100% { box-shadow: 0 0 0 0 rgba(201, 79, 61, 0.45); } 50% { box-shadow: 0 0 0 6px rgba(201, 79, 61, 0); } }
@media print { .ev-fb-btn { display: none !important; } }
.page-head .ph-l { min-width: 0; }
