/* ═══════════════════════════════════════════════
   مركز الاختبارات — app.css
   تصميم موحد لكل الصفحات
   Dark Luxury: أسود عميق + ذهبي دافئ
   ═══════════════════════════════════════════════ */

/* ── المتغيرات ── */
:root {
  --ink:      #090F17;
  --ink2:     #0F1923;
  --ink3:     #162030;
  --ink4:     #1D2A3A;
  --surface:  #243344;
  --surface2: #2C3D52;

  --border:   rgba(255,255,255,.07);
  --border2:  rgba(255,255,255,.13);

  --gold:     #C9A84C;
  --gold2:    #E8C76A;
  --gold-l:   rgba(201,168,76,.15);
  --gold-l2:  rgba(201,168,76,.07);

  --teal:     #2DD4BF;
  --teal-l:   rgba(45,212,191,.12);
  --rose:     #FB7185;
  --rose-l:   rgba(251,113,133,.12);
  --sky:      #38BDF8;
  --sky-l:    rgba(56,189,248,.12);
  --green:    #4ADE80;
  --green-l:  rgba(74,222,128,.12);

  --text:     #EDF2F7;
  --text2:    #8FA3B8;
  --text3:    #4A6070;

  --r:        10px;
  --r-sm:     7px;
  --r-lg:     16px;
  --r-xl:     22px;
  --shadow:   0 4px 20px rgba(0,0,0,.4);
  --shadow-lg:0 16px 56px rgba(0,0,0,.6);
  --tr:       all .18s ease;

  --f:        'Tajawal', sans-serif;
  --fh:       'Cairo', sans-serif;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing:border-box; margin:0; padding:0; }
html { font-size:16px; scroll-behavior:smooth; }
body { font-family:var(--f); background:var(--ink); color:var(--text); line-height:1.65; direction:rtl; min-height:100vh; }
a    { color:var(--gold); text-decoration:none; transition:var(--tr); }
a:hover { color:var(--gold2); }
h1,h2,h3,h4 { font-family:var(--fh); line-height:1.25; }
img  { max-width:100%; display:block; }
::-webkit-scrollbar { width:5px; }
::-webkit-scrollbar-track { background:var(--ink2); }
::-webkit-scrollbar-thumb { background:var(--surface); border-radius:3px; }

/* ════════════════════════════════════════
   NAVBAR
════════════════════════════════════════ */
.navbar {
  position:fixed; top:0; left:0; right:0; z-index:900;
  height:68px; padding:0 40px;
  display:flex; align-items:center; justify-content:space-between;
  background:rgba(9,15,23,.9); backdrop-filter:blur(20px);
  border-bottom:1px solid var(--border);
  transition:var(--tr);
}
.navbar.scrolled { background:rgba(9,15,23,.98); box-shadow:0 4px 28px rgba(0,0,0,.5); }

.nav-logo {
  display:flex; align-items:center; gap:11px;
  font-family:var(--fh); font-size:1.1rem; font-weight:800; color:var(--text);
  text-decoration:none;
}
.nav-logo .lm {
  width:40px; height:40px; border-radius:11px; flex-shrink:0;
  background:linear-gradient(135deg,var(--gold),#8B6214);
  display:flex; align-items:center; justify-content:center; font-size:18px;
  box-shadow:0 4px 14px rgba(201,168,76,.3);
}
.nav-logo span { color:var(--gold); }

.nav-mid { display:flex; gap:4px; }
.nav-btn {
  padding:7px 15px; border-radius:var(--r-sm);
  border:none; background:transparent; color:var(--text2);
  font-family:var(--f); font-size:.87rem; font-weight:500;
  cursor:pointer; transition:var(--tr); text-decoration:none;
  display:inline-flex; align-items:center; gap:6px;
}
.nav-btn:hover  { background:rgba(255,255,255,.06); color:var(--text); }
.nav-btn.active { background:var(--gold-l); color:var(--gold); }

.nav-right { display:flex; align-items:center; gap:10px; }

/* User pill (logged in) */
.nav-user {
  display:flex; align-items:center; gap:9px; cursor:pointer;
  padding:5px 13px 5px 5px;
  background:var(--ink3); border:1px solid var(--border2);
  border-radius:30px; transition:var(--tr);
  text-decoration:none;
}
.nav-user:hover { border-color:var(--gold); }
.nav-user-av {
  width:32px; height:32px; border-radius:50%; overflow:hidden;
  background:var(--surface); border:2px solid var(--gold-l);
  display:flex; align-items:center; justify-content:center; font-size:14px; flex-shrink:0;
}
.nav-user-av img { width:100%; height:100%; object-fit:cover; }
.nav-user-name { font-size:.84rem; font-weight:600; color:var(--text); }

/* ════════════════════════════════════════
   BUTTONS
════════════════════════════════════════ */
.btn {
  display:inline-flex; align-items:center; justify-content:center; gap:7px;
  padding:10px 22px; border-radius:var(--r-sm);
  font-family:var(--f); font-size:.88rem; font-weight:700;
  cursor:pointer; border:1px solid transparent; transition:var(--tr);
  text-decoration:none; white-space:nowrap; line-height:1;
}
.btn-gold {
  background:linear-gradient(135deg,var(--gold),#8B6214);
  color:#09130A; border-color:var(--gold);
  box-shadow:0 3px 14px rgba(201,168,76,.3);
}
.btn-gold:hover  { transform:translateY(-1px); box-shadow:0 6px 22px rgba(201,168,76,.45); color:#09130A; }
.btn-outline     { background:transparent; border-color:var(--border2); color:var(--text2); }
.btn-outline:hover { border-color:var(--gold); color:var(--gold); background:var(--gold-l2); }
.btn-ghost       { background:var(--ink3); border-color:var(--border); color:var(--text2); }
.btn-ghost:hover { background:var(--ink4); color:var(--text); }
.btn-danger      { background:var(--rose-l); border-color:rgba(251,113,133,.3); color:var(--rose); }
.btn-danger:hover{ background:var(--rose); color:#fff; }
.btn-sm  { padding:7px 14px; font-size:.81rem; }
.btn-lg  { padding:13px 30px; font-size:.98rem; }
.btn-xl  { padding:15px 36px; font-size:1.05rem; }
.btn-full{ width:100%; justify-content:center; }
.btn:disabled { opacity:.4; cursor:not-allowed; transform:none !important; }

/* ════════════════════════════════════════
   FORMS
════════════════════════════════════════ */
.fg { margin-bottom:16px; }
.fg label {
  display:block; font-size:.76rem; font-weight:700; color:var(--text2);
  text-transform:uppercase; letter-spacing:.05em; margin-bottom:7px;
}
.fg input, .fg select, .fg textarea {
  width:100%; padding:11px 14px;
  background:var(--ink3); border:1px solid var(--border2);
  border-radius:var(--r-sm); color:var(--text);
  font-family:var(--f); font-size:.92rem; direction:rtl;
  transition:var(--tr);
}
.fg input:focus, .fg select:focus, .fg textarea:focus {
  outline:none; border-color:var(--gold);
  box-shadow:0 0 0 3px rgba(201,168,76,.18); background:var(--ink2);
}
.fg input::placeholder, .fg textarea::placeholder { color:var(--text3); }
.fg textarea { resize:vertical; min-height:88px; }
.fg .hint    { font-size:.75rem; color:var(--text3); margin-top:5px; }
.fg .err     { font-size:.75rem; color:var(--rose);  margin-top:5px; }
.row-2 { display:grid; grid-template-columns:1fr 1fr; gap:14px; }
.row-3 { display:grid; grid-template-columns:1fr 1fr 1fr; gap:14px; }

/* ════════════════════════════════════════
   CARD
════════════════════════════════════════ */
.card {
  background:var(--ink2); border:1px solid var(--border);
  border-radius:var(--r-lg); overflow:hidden;
}
.card-head {
  padding:15px 20px; border-bottom:1px solid var(--border);
  display:flex; align-items:center; justify-content:space-between;
}
.card-title { font-family:var(--fh); font-size:.94rem; font-weight:700; }
.card-body  { padding:20px; }

/* ════════════════════════════════════════
   TABLE
════════════════════════════════════════ */
.tbl-wrap { overflow-x:auto; }
table { width:100%; border-collapse:collapse; font-size:.86rem; }
thead th {
  background:var(--ink3); padding:11px 15px; text-align:right;
  font-size:.74rem; font-weight:700; color:var(--text2);
  text-transform:uppercase; letter-spacing:.05em;
  border-bottom:2px solid var(--border); white-space:nowrap;
}
tbody td   { padding:12px 15px; border-bottom:1px solid var(--border); vertical-align:middle; }
tbody tr:last-child td { border-bottom:none; }
tbody tr:hover { background:rgba(255,255,255,.02); }

/* ════════════════════════════════════════
   BADGE
════════════════════════════════════════ */
.badge {
  display:inline-flex; align-items:center; gap:4px;
  padding:3px 9px; border-radius:20px;
  font-size:.72rem; font-weight:700; letter-spacing:.02em;
}
.bg-green { background:var(--green-l); color:var(--green);  border:1px solid rgba(74,222,128,.2); }
.bg-rose  { background:var(--rose-l);  color:var(--rose);   border:1px solid rgba(251,113,133,.2); }
.bg-gold  { background:var(--gold-l);  color:var(--gold);   border:1px solid rgba(201,168,76,.2); }
.bg-sky   { background:var(--sky-l);   color:var(--sky);    border:1px solid rgba(56,189,248,.2); }
.bg-teal  { background:var(--teal-l);  color:var(--teal);   border:1px solid rgba(45,212,191,.2); }
.bg-gray  { background:var(--ink4);    color:var(--text2);  border:1px solid var(--border); }

/* ════════════════════════════════════════
   MODAL
════════════════════════════════════════ */
.modal-mask {
  position:fixed; inset:0; z-index:1000;
  background:rgba(0,0,0,.75); backdrop-filter:blur(8px);
  display:flex; align-items:center; justify-content:center;
  padding:20px; animation:fadeIn .15s ease;
}
.modal {
  background:var(--ink2); border:1px solid var(--border2);
  border-radius:var(--r-xl); width:100%; max-width:520px;
  max-height:92vh; overflow-y:auto;
  box-shadow:var(--shadow-lg); animation:slideUp .25s ease;
}
.modal-lg  { max-width:720px; }
.modal-xl  { max-width:920px; }
.modal-head {
  padding:18px 22px; border-bottom:1px solid var(--border);
  display:flex; align-items:center; justify-content:space-between;
  position:sticky; top:0; background:var(--ink2); z-index:1;
}
.modal-title { font-family:var(--fh); font-size:1.05rem; font-weight:700; }
.modal-close {
  width:30px; height:30px; border-radius:50%;
  border:1px solid var(--border); background:var(--ink3);
  cursor:pointer; color:var(--text2); font-size:14px;
  display:flex; align-items:center; justify-content:center; transition:var(--tr);
}
.modal-close:hover { background:var(--rose); color:#fff; border-color:var(--rose); }
.modal-body { padding:22px; }
.modal-foot {
  padding:14px 22px; border-top:1px solid var(--border);
  display:flex; gap:10px; justify-content:flex-end;
  position:sticky; bottom:0; background:var(--ink2);
}

/* ════════════════════════════════════════
   ALERT / TOAST
════════════════════════════════════════ */
.alert {
  padding:11px 15px; border-radius:var(--r-sm); font-size:.87rem; margin-bottom:14px;
}
.alert-err  { background:var(--rose-l);  border:1px solid rgba(251,113,133,.25); color:var(--rose); }
.alert-ok   { background:var(--teal-l);  border:1px solid rgba(45,212,191,.25);  color:var(--teal); }
.alert-warn { background:var(--gold-l);  border:1px solid rgba(201,168,76,.25);  color:var(--gold); }
.alert-info { background:var(--sky-l);   border:1px solid rgba(56,189,248,.25);  color:var(--sky); }

#toasts {
  position:fixed; bottom:22px; left:22px; z-index:9999;
  display:flex; flex-direction:column; gap:8px; pointer-events:none;
}
.toast {
  background:var(--ink3); color:var(--text); border:1px solid var(--border2);
  padding:12px 18px; border-radius:var(--r-sm); font-size:.86rem;
  min-width:240px; max-width:340px; box-shadow:var(--shadow);
  animation:slideInL .22s ease; pointer-events:all; direction:rtl;
}
.toast.ok   { border-right:3px solid var(--teal); }
.toast.err  { border-right:3px solid var(--rose); }
.toast.warn { border-right:3px solid var(--gold); }
.toast.info { border-right:3px solid var(--sky);  }

/* ════════════════════════════════════════
   LOADING SPINNER
════════════════════════════════════════ */
.spin {
  width:28px; height:28px; border:3px solid var(--border2);
  border-top-color:var(--gold); border-radius:50%;
  animation:spin .7s linear infinite; margin:32px auto;
}
.spin-sm { width:18px; height:18px; margin:0; border-width:2px; }

#page-loader {
  position:fixed; inset:0; z-index:9999;
  background:rgba(9,15,23,.9); backdrop-filter:blur(4px);
  display:flex; align-items:center; justify-content:center; flex-direction:column; gap:14px;
}
#page-loader .spin { margin:0; width:36px; height:36px; }
#page-loader p { font-size:.87rem; color:var(--text2); }

/* ════════════════════════════════════════
   HERO (الصفحة الرئيسية)
════════════════════════════════════════ */
.hero {
  min-height:100vh; padding:120px 20px 80px;
  display:flex; flex-direction:column; align-items:center; justify-content:center;
  text-align:center; position:relative; overflow:hidden;
}
.hero-bg {
  position:absolute; inset:0; z-index:0;
  background:
    radial-gradient(ellipse 80% 55% at 50% -5%,  rgba(201,168,76,.13) 0%, transparent 65%),
    radial-gradient(ellipse 45% 45% at 5%  70%,  rgba(45,212,191,.07) 0%, transparent 55%),
    radial-gradient(ellipse 40% 50% at 95% 80%,  rgba(251,113,133,.06) 0%, transparent 50%);
}
.hero-grid {
  position:absolute; inset:0; z-index:0;
  background-image:
    linear-gradient(rgba(255,255,255,.022) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.022) 1px, transparent 1px);
  background-size:56px 56px;
  mask-image:radial-gradient(ellipse 85% 85% at 50% 50%, black 20%, transparent 100%);
}
.hero-content { position:relative; z-index:1; max-width:740px; animation:heroIn .8s ease both; }

.hero-tag {
  display:inline-flex; align-items:center; gap:8px;
  background:var(--gold-l2); border:1px solid rgba(201,168,76,.22);
  border-radius:20px; padding:6px 18px;
  font-size:.78rem; color:var(--gold); font-weight:700;
  letter-spacing:.06em; text-transform:uppercase; margin-bottom:26px;
}
.hero-tag .dot { width:6px; height:6px; border-radius:50%; background:var(--gold); animation:pulse 2s infinite; }

.hero h1 {
  font-size:clamp(2.2rem, 5vw, 3.8rem); font-weight:900; color:var(--text); margin-bottom:18px;
}
.hero h1 em {
  font-style:normal;
  background:linear-gradient(135deg,var(--gold),var(--gold2));
  -webkit-background-clip:text; -webkit-text-fill-color:transparent; background-clip:text;
}
.hero p { font-size:1rem; color:var(--text2); max-width:500px; margin:0 auto 34px; line-height:1.8; }
.hero-btns { display:flex; gap:12px; justify-content:center; flex-wrap:wrap; margin-bottom:60px; }

.hero-stats {
  display:flex; gap:36px; justify-content:center; flex-wrap:wrap;
  padding-top:44px; border-top:1px solid var(--border);
}
.hs-val { font-family:var(--fh); font-size:1.9rem; font-weight:900; color:var(--gold); line-height:1; }
.hs-lbl { font-size:.78rem; color:var(--text2); margin-top:4px; }

/* ════════════════════════════════════════
   SEARCH + FILTERS
════════════════════════════════════════ */
.search-wrap {
  display:flex; align-items:center; gap:10px;
  background:var(--ink3); border:1px solid var(--border2);
  border-radius:var(--r-lg); padding:5px 5px 5px 18px;
  max-width:640px; margin:0 auto 32px;
  transition:var(--tr);
}
.search-wrap:focus-within { border-color:var(--gold); box-shadow:0 0 0 3px rgba(201,168,76,.13); }
.search-wrap input {
  flex:1; background:transparent; border:none; color:var(--text);
  font-family:var(--f); font-size:.93rem; direction:rtl;
}
.search-wrap input:focus { outline:none; }
.search-wrap input::placeholder { color:var(--text3); }

.cat-row { display:flex; gap:7px; flex-wrap:wrap; justify-content:center; margin-bottom:40px; }
.cat-pill {
  display:inline-flex; align-items:center; gap:5px;
  padding:7px 16px; border-radius:20px; cursor:pointer;
  background:var(--ink3); border:1px solid var(--border);
  color:var(--text2); font-size:.82rem; font-weight:600; transition:var(--tr);
}
.cat-pill:hover { border-color:var(--border2); color:var(--text); }
.cat-pill.on    { background:var(--gold-l); border-color:rgba(201,168,76,.35); color:var(--gold); }
.cat-pill .cn   { background:var(--ink4); border-radius:10px; padding:1px 7px; font-size:.7rem; color:var(--text3); }
.cat-pill.on .cn{ background:rgba(201,168,76,.2); color:var(--gold); }

/* ════════════════════════════════════════
   EXAM CARDS
════════════════════════════════════════ */
.exams-grid {
  display:grid; grid-template-columns:repeat(auto-fill, minmax(300px,1fr)); gap:20px;
}
.ec {
  background:var(--ink3); border:1px solid var(--border);
  border-radius:var(--r-lg); overflow:hidden;
  display:flex; flex-direction:column; transition:var(--tr);
  animation:cardIn .45s ease both;
}
.ec:hover { transform:translateY(-3px); border-color:rgba(201,168,76,.28); box-shadow:0 18px 50px rgba(0,0,0,.4); }
.ec::before {
  content:''; display:block; height:3px;
  background:linear-gradient(90deg,var(--ec-c1,var(--gold)),var(--ec-c2,var(--teal)));
}
.ec-body   { padding:20px; flex:1; display:flex; flex-direction:column; }
.ec-top    { display:flex; align-items:flex-start; justify-content:space-between; margin-bottom:12px; gap:8px; }
.ec-icon   { width:44px; height:44px; border-radius:11px; display:flex; align-items:center; justify-content:center; font-size:21px; background:var(--gold-l2); flex-shrink:0; }
.ec-cat    { font-size:.71rem; font-weight:700; color:var(--gold); background:var(--gold-l2); border:1px solid rgba(201,168,76,.18); border-radius:20px; padding:3px 9px; white-space:nowrap; }
.ec-title  { font-family:var(--fh); font-size:.97rem; font-weight:800; margin-bottom:6px; line-height:1.35; }
.ec-desc   { font-size:.82rem; color:var(--text2); line-height:1.65; flex:1; margin-bottom:14px; }
.ec-meta   { display:grid; grid-template-columns:repeat(3,1fr); gap:5px; margin-bottom:13px; }
.ec-mi     { background:var(--ink4); border-radius:7px; padding:8px 5px; text-align:center; border:1px solid var(--border); }
.ec-mv     { font-family:var(--fh); font-size:.98rem; font-weight:800; }
.ec-ml     { font-size:.65rem; color:var(--text3); margin-top:1px; text-transform:uppercase; letter-spacing:.03em; }
.ec-bar-wrap { margin-bottom:14px; }
.ec-bar-row  { display:flex; justify-content:space-between; font-size:.76rem; margin-bottom:4px; }
.ec-bar-lbl  { color:var(--text2); }
.ec-bar-val  { font-weight:700; color:var(--teal); }
.ec-bar      { height:4px; background:var(--surface); border-radius:2px; overflow:hidden; }
.ec-bar-fill { height:100%; border-radius:2px; background:linear-gradient(90deg,var(--teal),var(--sky)); }
.ec-foot     { padding:0 20px 20px; }

/* ════════════════════════════════════════
   AUTH MODAL
════════════════════════════════════════ */
.auth-box {
  background:var(--ink2); border:1px solid var(--border2);
  border-radius:var(--r-xl); width:100%; max-width:450px;
  max-height:94vh; overflow-y:auto;
  box-shadow:var(--shadow-lg); animation:slideUp .28s ease;
}
.auth-top {
  padding:26px 26px 0;
  display:flex; align-items:flex-start; justify-content:space-between;
}
.auth-logo { display:flex; align-items:center; gap:9px; margin-bottom:4px; }
.auth-logo .am { width:34px; height:34px; border-radius:9px; background:linear-gradient(135deg,var(--gold),#8B6214); display:flex; align-items:center; justify-content:center; font-size:15px; }
.auth-logo span { font-family:var(--fh); font-weight:800; color:var(--gold); }
.auth-title { font-family:var(--fh); font-size:1.25rem; font-weight:800; margin-bottom:4px; }
.auth-sub   { font-size:.82rem; color:var(--text2); }
.auth-body  { padding:22px 26px 26px; }
.auth-tabs  { display:flex; background:var(--ink3); border-radius:var(--r-sm); padding:3px; gap:3px; margin-bottom:22px; }
.auth-tab   { flex:1; padding:8px; border-radius:var(--r-sm); border:none; background:transparent; color:var(--text2); font-family:var(--f); font-size:.87rem; font-weight:600; cursor:pointer; transition:var(--tr); }
.auth-tab.on{ background:var(--ink2); color:var(--text); box-shadow:0 2px 8px rgba(0,0,0,.3); }
.pass-bars  { display:flex; gap:3px; margin-top:7px; }
.pb         { flex:1; height:3px; border-radius:2px; background:var(--surface2); transition:background .3s; }
.pb.weak    { background:var(--rose); }
.pb.mid     { background:var(--gold); }
.pb.strong  { background:var(--teal); }
.check-row  { display:flex; align-items:center; justify-content:space-between; margin-bottom:18px; }
.check-lbl  { display:flex; align-items:center; gap:7px; font-size:.84rem; color:var(--text2); cursor:pointer; }
.check-lbl input { width:14px; height:14px; accent-color:var(--gold); }
.forgot     { font-size:.81rem; color:var(--gold); cursor:pointer; }
.forgot:hover { color:var(--gold2); }
.auth-sw    { text-align:center; font-size:.83rem; color:var(--text2); margin-top:16px; }
.auth-sw a  { color:var(--gold); cursor:pointer; font-weight:600; }

/* ════════════════════════════════════════
   DASHBOARD SHELL
════════════════════════════════════════ */
.dash {
  min-height:100vh; background:var(--ink);
  display:flex; flex-direction:column;
}
.dash-bar {
  position:sticky; top:0; z-index:100;
  background:rgba(9,15,23,.92); backdrop-filter:blur(16px);
  border-bottom:1px solid var(--border);
  height:66px; padding:0 28px;
  display:flex; align-items:center; justify-content:space-between;
}
.dash-logo { display:flex; align-items:center; gap:9px; text-decoration:none; }
.dash-logo .dm { width:36px; height:36px; border-radius:9px; background:linear-gradient(135deg,var(--gold),#8B6214); display:flex; align-items:center; justify-content:center; font-size:16px; }
.dash-logo span { font-family:var(--fh); font-size:.95rem; font-weight:800; color:var(--gold); }
.dash-nav-links { display:flex; gap:3px; }
.dash-user-area { display:flex; align-items:center; gap:8px; }
.dash-av {
  width:36px; height:36px; border-radius:50%; overflow:hidden;
  background:var(--surface); border:2px solid var(--gold-l);
  display:flex; align-items:center; justify-content:center; font-size:15px; flex-shrink:0;
}
.dash-av img { width:100%; height:100%; object-fit:cover; }
.dash-uname { font-size:.84rem; font-weight:600; color:var(--text); }
.dash-body  { flex:1; padding:30px 28px; max-width:1180px; width:100%; margin:0 auto; }

/* Welcome banner */
.welcome {
  background:linear-gradient(135deg,var(--ink3),var(--ink4));
  border:1px solid var(--border2); border-radius:var(--r-xl);
  padding:28px 32px; margin-bottom:28px;
  display:flex; align-items:center; justify-content:space-between; gap:20px;
  position:relative; overflow:hidden;
}
.welcome::before {
  content:''; position:absolute; top:-50px; left:-50px;
  width:180px; height:180px; border-radius:50%;
  background:radial-gradient(circle,rgba(201,168,76,.1),transparent 70%);
}
.w-greet { font-size:.8rem; color:var(--gold); font-weight:700; text-transform:uppercase; letter-spacing:.07em; margin-bottom:5px; }
.w-name  { font-family:var(--fh); font-size:1.5rem; font-weight:900; margin-bottom:5px; }
.w-sub   { font-size:.83rem; color:var(--text2); }
.w-av    { width:72px; height:72px; border-radius:50%; overflow:hidden; background:var(--surface2); border:3px solid var(--gold-l); display:flex; align-items:center; justify-content:center; font-size:30px; flex-shrink:0; }
.w-av img { width:100%; height:100%; object-fit:cover; }

/* Stats tiles */
.stats-row { display:grid; grid-template-columns:repeat(auto-fit,minmax(180px,1fr)); gap:14px; margin-bottom:28px; }
.stat-tile {
  background:var(--ink2); border:1px solid var(--border); border-radius:var(--r-lg);
  padding:20px; display:flex; align-items:center; gap:14px; transition:var(--tr);
}
.stat-tile:hover { border-color:var(--border2); transform:translateY(-2px); }
.st-ico  { width:48px; height:48px; border-radius:13px; display:flex; align-items:center; justify-content:center; font-size:22px; flex-shrink:0; }
.st-val  { font-family:var(--fh); font-size:1.7rem; font-weight:900; line-height:1; }
.st-lbl  { font-size:.76rem; color:var(--text2); margin-top:3px; }

/* Section card */
.sc {
  background:var(--ink2); border:1px solid var(--border); border-radius:var(--r-lg);
  overflow:hidden; margin-bottom:20px;
}
.sc-head {
  padding:14px 20px; border-bottom:1px solid var(--border);
  display:flex; align-items:center; justify-content:space-between;
}
.sc-title { font-family:var(--fh); font-size:.9rem; font-weight:700; }

/* Activity row */
.act-row {
  display:flex; align-items:center; gap:13px; padding:12px 20px;
  border-bottom:1px solid var(--border); transition:var(--tr);
}
.act-row:last-child { border-bottom:none; }
.act-row:hover { background:rgba(255,255,255,.02); }
.act-ico { width:36px; height:36px; border-radius:9px; background:var(--ink4); display:flex; align-items:center; justify-content:center; font-size:16px; flex-shrink:0; }

/* ════════════════════════════════════════
   ADMIN SIDEBAR
════════════════════════════════════════ */
.admin-shell { display:flex; min-height:100vh; }
.sidebar {
  width:252px; flex-shrink:0;
  background:var(--ink2); border-left:1px solid var(--border);
  position:fixed; top:0; right:0; bottom:0; z-index:200;
  display:flex; flex-direction:column; overflow-y:auto;
  transition:transform .3s ease;
}
.sb-brand {
  padding:22px 18px 16px; border-bottom:1px solid var(--border);
  display:flex; align-items:center; gap:10px;
}
.sb-mark { width:38px; height:38px; border-radius:10px; background:linear-gradient(135deg,var(--gold),#8B6214); display:flex; align-items:center; justify-content:center; font-size:17px; flex-shrink:0; }
.sb-name { font-family:var(--fh); font-size:.95rem; font-weight:800; color:var(--gold); }
.sb-sub  { font-size:.7rem; color:var(--text2); }

.sb-user { padding:13px 18px; border-bottom:1px solid var(--border); display:flex; align-items:center; gap:9px; }
.sb-av { width:36px; height:36px; border-radius:50%; overflow:hidden; background:var(--surface); border:2px solid var(--gold-l); display:flex; align-items:center; justify-content:center; font-size:14px; flex-shrink:0; }
.sb-av img { width:100%; height:100%; object-fit:cover; }
.sb-uname  { font-size:.85rem; font-weight:600; color:var(--text); }
.sb-urole  { font-size:.71rem; color:var(--text2); }

.sb-nav    { padding:10px 9px; flex:1; }
.sb-section{ font-size:.67rem; font-weight:700; color:var(--text3); text-transform:uppercase; letter-spacing:.1em; padding:10px 10px 5px; }
.sb-link {
  display:flex; align-items:center; gap:9px; padding:9px 11px;
  border-radius:var(--r-sm); color:var(--text2); font-size:.87rem;
  font-weight:500; cursor:pointer; transition:var(--tr); margin-bottom:2px;
  text-decoration:none; border:1px solid transparent;
}
.sb-link:hover  { background:var(--ink3); color:var(--text); }
.sb-link.on     { background:var(--gold-l); color:var(--gold); border-color:rgba(201,168,76,.2); }
.sb-link .si    { font-size:16px; width:20px; text-align:center; flex-shrink:0; }
.sb-foot        { padding:12px 9px; border-top:1px solid var(--border); }

.admin-main { flex:1; margin-right:252px; display:flex; flex-direction:column; }
.admin-bar  {
  background:var(--ink2); border-bottom:1px solid var(--border);
  padding:14px 26px;
  display:flex; align-items:center; justify-content:space-between;
  position:sticky; top:0; z-index:100;
}
.admin-bar-title { font-family:var(--fh); font-size:1.1rem; font-weight:700; }
.admin-page { padding:26px; flex:1; }

/* ════════════════════════════════════════
   IMAGE UPLOAD (questions)
════════════════════════════════════════ */
.img-zone {
  border:2px dashed var(--border2); border-radius:var(--r);
  padding:24px; text-align:center; cursor:pointer;
  transition:var(--tr); background:var(--ink3); position:relative;
}
.img-zone:hover, .img-zone.over { border-color:var(--gold); background:var(--gold-l2); }
.img-zone input { position:absolute; inset:0; opacity:0; cursor:pointer; }
.img-zone .zi   { font-size:1.8rem; margin-bottom:7px; opacity:.5; }
.img-zone .zt   { font-size:.82rem; color:var(--text2); }
.img-preview    { max-height:150px; border-radius:var(--r-sm); margin:10px auto 0; border:1px solid var(--border); }

/* Choices editor */
.choices-list { display:flex; flex-direction:column; gap:8px; }
.choice-item {
  display:flex; align-items:center; gap:9px;
  background:var(--ink3); border:1px solid var(--border); border-radius:var(--r-sm); padding:9px 12px; transition:var(--tr);
}
.choice-item.correct { border-color:var(--gold); background:var(--gold-l2); }
.choice-lbl {
  width:30px; height:30px; border-radius:50%; flex-shrink:0;
  background:var(--surface); border:2px solid var(--border2);
  display:flex; align-items:center; justify-content:center; font-weight:700; font-size:.83rem; color:var(--text2); transition:var(--tr);
}
.choice-item.correct .choice-lbl { background:var(--gold); border-color:var(--gold); color:#090F15; }
.choice-inp  { flex:1; background:transparent; border:none; color:var(--text); font-family:var(--f); font-size:.9rem; }
.choice-inp:focus { outline:none; }
.choice-inp::placeholder { color:var(--text3); }
.choice-radio { width:17px; height:17px; accent-color:var(--gold); cursor:pointer; flex-shrink:0; }
.choice-del   { background:none; border:none; cursor:pointer; color:var(--text3); font-size:15px; transition:var(--tr); }
.choice-del:hover { color:var(--rose); }

/* Draw rows (exam config) */
.draw-row {
  display:grid; grid-template-columns:1fr auto auto; align-items:center; gap:12px;
  background:var(--ink3); border:1px solid var(--border); border-radius:var(--r-sm); padding:11px 14px; margin-bottom:7px;
}
.draw-row .dr-name { font-weight:600; font-size:.89rem; }
.draw-row .dr-avail{ font-size:.76rem; color:var(--text2); margin-top:2px; }
.draw-row input[type=number] { width:68px; padding:7px 9px; text-align:center; background:var(--surface); border:1px solid var(--border2); border-radius:var(--r-sm); color:var(--text); font-family:var(--f); font-size:.87rem; }
.draw-pct { min-width:48px; text-align:center; background:var(--gold-l); color:var(--gold); border-radius:20px; padding:3px 9px; font-size:.77rem; font-weight:700; }

/* ════════════════════════════════════════
   EXAM INTERFACE
════════════════════════════════════════ */
.exam-shell { display:flex; min-height:100vh; background:var(--ink); }
.exam-side {
  width:280px; flex-shrink:0;
  background:var(--ink2); border-left:1px solid var(--border);
  position:fixed; top:0; right:0; bottom:0; z-index:200;
  display:flex; flex-direction:column; overflow-y:auto;
}
.exam-side-top { padding:16px; background:var(--ink3); border-bottom:1px solid var(--border); }
.timer-lbl { font-size:.68rem; color:var(--text2); text-transform:uppercase; letter-spacing:.07em; text-align:center; margin-bottom:3px; }
.timer-val { font-family:var(--fh); font-size:2.1rem; font-weight:900; color:var(--gold); letter-spacing:3px; text-align:center; transition:color .3s; }
.timer-val.warn  { color:var(--gold); animation:pulse 1s infinite; }
.timer-val.alarm { color:var(--rose); animation:pulse .6s infinite; }
.exam-user { background:var(--surface); border:1px solid var(--border); border-radius:var(--r-sm); padding:9px 11px; display:flex; align-items:center; gap:9px; margin-top:12px; }
.exam-u-av { width:34px; height:34px; border-radius:50%; background:var(--surface2); display:flex; align-items:center; justify-content:center; font-size:14px; color:var(--text2); flex-shrink:0; overflow:hidden; }
.exam-u-av img { width:100%; height:100%; object-fit:cover; }
.exam-uname { font-weight:600; font-size:.82rem; color:var(--text); }
.exam-uid   { font-size:.71rem; color:var(--text2); }

.exam-qstats { display:grid; grid-template-columns:1fr 1fr; gap:5px; padding:12px 14px; border-bottom:1px solid var(--border); }
.qs-tile { background:var(--ink3); border-radius:var(--r-sm); padding:8px 6px; text-align:center; border:1px solid var(--border); }
.qs-val  { font-family:var(--fh); font-size:1.1rem; font-weight:800; line-height:1; }
.qs-lbl  { font-size:.63rem; color:var(--text2); margin-top:2px; text-transform:uppercase; letter-spacing:.04em; }
.qs-tile.done .qs-val { color:var(--teal); }
.qs-tile.left .qs-val { color:var(--rose); }
.qs-tile.flag .qs-val { color:var(--gold); }
.qs-tile.all  .qs-val { color:var(--sky);  }

.q-grid-area { padding:12px 14px; flex:1; }
.q-grid-lbl  { font-size:.66rem; color:var(--text3); text-transform:uppercase; letter-spacing:.07em; margin-bottom:7px; }
.q-grid      { display:grid; grid-template-columns:repeat(6,1fr); gap:4px; }
.qd {
  aspect-ratio:1; border-radius:6px; border:1px solid var(--border);
  background:var(--surface); color:var(--text2);
  font-family:var(--fh); font-size:.71rem; font-weight:700; cursor:pointer; transition:var(--tr);
  display:flex; align-items:center; justify-content:center; position:relative;
}
.qd:hover  { border-color:var(--sky); color:var(--sky); transform:scale(1.07); }
.qd.cur    { background:var(--sky); border-color:var(--sky); color:#fff; }
.qd.done   { background:var(--teal); border-color:var(--teal); color:#fff; }
.qd.flagged{ border-color:var(--gold); }
.qd.flagged::after { content:''; position:absolute; top:2px; left:2px; width:5px; height:5px; background:var(--gold); border-radius:50%; }

.exam-side-foot { padding:11px 13px; border-top:1px solid var(--border); display:flex; flex-direction:column; gap:6px; }
.esf-btn { width:100%; padding:9px; border-radius:var(--r-sm); border:1px solid var(--border); background:var(--surface); color:var(--text2); font-family:var(--f); font-size:.83rem; font-weight:600; cursor:pointer; transition:var(--tr); }
.esf-btn:hover { background:var(--surface2); color:var(--text); }
.esf-btn.red   { background:var(--rose-l); border-color:rgba(251,113,133,.3); color:var(--rose); }
.esf-btn.red:hover { background:var(--rose); color:#fff; }

.exam-main  { flex:1; margin-right:280px; display:flex; flex-direction:column; }
.exam-topbar{ background:var(--ink2); border-bottom:1px solid var(--border); padding:10px 22px; display:flex; align-items:center; justify-content:space-between; }
.font-btns  { display:flex; gap:4px; }
.fb { padding:5px 11px; border:1px solid var(--border); border-radius:5px; background:var(--ink3); cursor:pointer; font-family:var(--f); font-weight:700; color:var(--text2); font-size:.79rem; transition:var(--tr); }
.fb:hover { border-color:var(--gold); color:var(--gold); }
.exam-content { flex:1; padding:26px; max-width:860px; }

.q-card { background:var(--ink2); border:1px solid var(--border); border-radius:var(--r-lg); overflow:hidden; margin-bottom:16px; }
.q-card-head { padding:12px 20px; background:var(--ink3); border-bottom:1px solid var(--border); display:flex; align-items:center; justify-content:space-between; }
.q-num       { font-size:.79rem; color:var(--text2); font-weight:700; }
.q-img-wrap  { padding:16px 20px; border-bottom:1px solid var(--border); text-align:center; }
.q-img-wrap img { max-height:250px; border-radius:var(--r-sm); margin:0 auto; border:1px solid var(--border); }
.q-text      { padding:20px; font-size:1rem; line-height:1.85; font-weight:500; border-bottom:1px solid var(--border); }
.q-choices   { padding:16px 20px; display:flex; flex-direction:column; gap:8px; }
.qc {
  display:flex; align-items:center; gap:13px; padding:12px 16px;
  border:1px solid var(--border); border-radius:var(--r-sm);
  cursor:pointer; transition:var(--tr); background:var(--ink3);
}
.qc:hover  { border-color:var(--sky); background:var(--sky-l); }
.qc.sel    { border-color:var(--gold); background:var(--gold-l2); }
.qc-lbl    { width:32px; height:32px; border-radius:50%; background:var(--surface); border:2px solid var(--border2); display:flex; align-items:center; justify-content:center; font-weight:700; font-size:.83rem; color:var(--text2); flex-shrink:0; transition:var(--tr); }
.qc.sel .qc-lbl { background:var(--gold); border-color:var(--gold); color:#090F15; }
.qc-text   { flex:1; font-size:.93rem; line-height:1.6; }

.exam-nav { background:var(--ink2); border-top:1px solid var(--border); padding:12px 22px; display:flex; align-items:center; justify-content:space-between; position:sticky; bottom:0; z-index:10; }
.flag-lbl { display:flex; align-items:center; gap:7px; color:var(--text2); font-size:.86rem; cursor:pointer; }
.flag-lbl input { width:15px; height:15px; accent-color:var(--gold); }

/* ════════════════════════════════════════
   RESULT PAGE
════════════════════════════════════════ */
.result-hero { background:linear-gradient(135deg,var(--ink3),var(--ink4)); border:1px solid var(--gold-l); border-radius:var(--r-xl); padding:34px; text-align:center; margin-bottom:22px; }
.result-pct  { font-family:var(--fh); font-size:4.2rem; font-weight:900; color:var(--gold); line-height:1; margin:12px 0; }
.result-chips{ display:flex; gap:10px; justify-content:center; flex-wrap:wrap; margin-top:18px; }
.r-chip { background:rgba(255,255,255,.08); border:1px solid rgba(255,255,255,.13); border-radius:9px; padding:11px 18px; text-align:center; min-width:100px; }
.r-chip-v { font-family:var(--fh); font-size:1.45rem; font-weight:800; color:#fff; }
.r-chip-l { font-size:.74rem; color:rgba(255,255,255,.6); margin-top:2px; }

/* Progress bar */
.pbar { height:5px; background:var(--surface); border-radius:3px; overflow:hidden; margin-top:6px; }
.pbar-fill { height:100%; border-radius:3px; background:linear-gradient(90deg,var(--gold),var(--teal)); transition:width .7s ease; }

/* ════════════════════════════════════════
   PROFILE
════════════════════════════════════════ */
.profile-grid { display:grid; grid-template-columns:260px 1fr; gap:22px; }
.profile-card { background:var(--ink2); border:1px solid var(--border); border-radius:var(--r-lg); padding:26px; text-align:center; height:fit-content; }
.profile-av-wrap { position:relative; display:inline-block; margin-bottom:14px; }
.profile-av { width:96px; height:96px; border-radius:50%; overflow:hidden; background:var(--surface2); border:3px solid var(--gold-l); display:flex; align-items:center; justify-content:center; font-size:40px; margin:0 auto; }
.profile-av img { width:100%; height:100%; object-fit:cover; }
.profile-av-btn { position:absolute; bottom:3px; left:3px; width:26px; height:26px; border-radius:50%; background:var(--gold); border:2px solid var(--ink2); display:flex; align-items:center; justify-content:center; font-size:12px; cursor:pointer; color:#090F15; transition:var(--tr); }
.profile-av-btn:hover { background:var(--gold2); transform:scale(1.1); }

/* ════════════════════════════════════════
   FEATURES
════════════════════════════════════════ */
.feats-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(230px,1fr)); gap:18px; }
.feat { background:var(--ink3); border:1px solid var(--border); border-radius:var(--r-lg); padding:26px; transition:var(--tr); }
.feat:hover { border-color:var(--border2); transform:translateY(-2px); }
.feat-ico { width:50px; height:50px; border-radius:13px; display:flex; align-items:center; justify-content:center; font-size:22px; margin-bottom:16px; }
.feat-title { font-family:var(--fh); font-size:.95rem; font-weight:700; margin-bottom:7px; }
.feat-desc  { font-size:.81rem; color:var(--text2); line-height:1.7; }

/* Site footer */
.site-footer { background:var(--ink2); border-top:1px solid var(--border); padding:36px 0 20px; text-align:center; }
.sf-logo { display:flex; align-items:center; gap:9px; justify-content:center; margin-bottom:12px; }
.sf-logo .fm { width:34px; height:34px; border-radius:9px; background:linear-gradient(135deg,var(--gold),#8B6214); display:flex; align-items:center; justify-content:center; font-size:15px; }
.sf-logo span { font-family:var(--fh); font-size:.97rem; font-weight:800; color:var(--gold); }
.sf-copy { font-size:.76rem; color:var(--text3); }

/* ════════════════════════════════════════
   UTILITIES
════════════════════════════════════════ */
.mt1{margin-top:8px} .mt2{margin-top:16px} .mt3{margin-top:24px} .mt4{margin-top:32px}
.mb1{margin-bottom:8px} .mb2{margin-bottom:16px} .mb3{margin-bottom:24px}
.text-c{text-align:center} .text-muted{color:var(--text2)} .text-sm{font-size:.82rem}
.text-g{color:var(--teal)} .text-r{color:var(--rose)} .text-gold{color:var(--gold)}
.fw7{font-weight:700} .fw8{font-weight:800} .fw9{font-weight:900}
.flex{display:flex} .items-c{align-items:center} .justify-b{justify-content:space-between}
.gap1{gap:8px} .gap2{gap:16px} .w100{width:100%}
.sep{border:none;border-top:1px solid var(--border);margin:18px 0}
.empty { text-align:center; padding:70px 20px; color:var(--text2); }
.empty .ei { font-size:3rem; margin-bottom:14px; opacity:.45; }
.empty .et { font-family:var(--fh); font-size:1.05rem; color:var(--text2); margin-bottom:8px; }

/* ════════════════════════════════════════
   ANIMATIONS
════════════════════════════════════════ */
@keyframes heroIn  { from{opacity:0;transform:translateY(28px)} to{opacity:1;transform:none} }
@keyframes cardIn  { from{opacity:0;transform:translateY(14px)} to{opacity:1;transform:none} }
@keyframes fadeIn  { from{opacity:0} to{opacity:1} }
@keyframes slideUp { from{opacity:0;transform:translateY(22px)} to{opacity:1;transform:none} }
@keyframes slideInL{ from{opacity:0;transform:translateX(-14px)} to{opacity:1;transform:none} }
@keyframes spin    { to{transform:rotate(360deg)} }
@keyframes pulse   { 0%,100%{opacity:1} 50%{opacity:.4} }

/* ════════════════════════════════════════
   RESPONSIVE
════════════════════════════════════════ */
@media(max-width:1024px){
  .sidebar,.exam-side{transform:translateX(100%)}
  .sidebar.open,.exam-side.open{transform:none}
  .admin-main,.exam-main{margin-right:0}
  .admin-page{padding:18px}
  .nav-mid{display:none}
}
@media(max-width:768px){
  .navbar{padding:0 18px}
  .profile-grid{grid-template-columns:1fr}
  .stats-row{grid-template-columns:1fr 1fr}
  .dash-body{padding:18px 14px}
  .welcome{flex-direction:column;text-align:center}
  .row-2,.row-3{grid-template-columns:1fr}
  .q-grid{grid-template-columns:repeat(5,1fr)}
  .hero h1{font-size:1.9rem}
}
