/* ── CSS Variables ──────────────────────────────────────────────── */
:root {
  --bg:         #0f0f0f;
  --surface:    #1a1a1a;
  --surface2:   #222222;
  --sidebar-bg: #141414;
  --border:     #2a2a2a;
  --input:      #252525;
  --text:       #f0f0f0;
  --muted:      #888;
  --orange:     #f97316;
  --orange-dim: rgba(249,115,22,.15);
  --green:      #22c55e;
  --green-dim:  rgba(34,197,94,.15);
  --blue:       #3b82f6;
  --blue-dim:   rgba(59,130,246,.15);
  --red:        #ef4444;
  --red-dim:    rgba(239,68,68,.15);
  --purple:     #5865f2;
  --sidebar-w:  240px;
  --r:          8px;
  --rl:         12px;
}

/* ── Theme: Hell (Light) ─────────────────────────────────────────── */
[data-theme="hell"] {
  --bg:         #f0f4f8;
  --surface:    #ffffff;
  --surface2:   #f5f7fa;
  --sidebar-bg: #e8ecf0;
  --border:     #d1d9e2;
  --input:      #edf0f5;
  --text:       #111827;
  --muted:      #6b7280;
  --orange-dim: rgba(249,115,22,.1);
  --green-dim:  rgba(34,197,94,.1);
  --blue-dim:   rgba(59,130,246,.1);
  --red-dim:    rgba(239,68,68,.1);
}
[data-theme="hell"] .data-tbl tr:hover td { background: rgba(0,0,0,.025); }
[data-theme="hell"] .leaflet-container    { background: #c8d4de !important; }
[data-theme="hell"] .modal-overlay        { background: rgba(0,0,0,.4); }
[data-theme="hell"] .toast                { box-shadow: 0 4px 16px rgba(0,0,0,.1); }

/* ── Theme: Modern (Deep Blue) ───────────────────────────────────── */
[data-theme="modern"] {
  --bg:         #050a14;
  --surface:    #0b1628;
  --surface2:   #101f38;
  --sidebar-bg: #030810;
  --border:     #163055;
  --input:      #091426;
  --text:       #c8d8ea;
  --muted:      #5b7a99;
  --orange:     #38bdf8;
  --orange-dim: rgba(56,189,248,.14);
  --green-dim:  rgba(34,197,94,.11);
  --blue-dim:   rgba(99,102,241,.14);
  --red-dim:    rgba(239,68,68,.11);
}
[data-theme="modern"] .leaflet-container          { background: #030810 !important; }
[data-theme="modern"] .btn-primary                { color: #050a14; }
[data-theme="modern"] .quiz-score-big.quiz-passed { color: #4ade80; }

/* ── Theme: Alt (Klassisch / Warm) ──────────────────────────────── */
[data-theme="alt"] {
  --bg:         #180e04;
  --surface:    #231508;
  --surface2:   #2f1d0b;
  --sidebar-bg: #130a02;
  --border:     #3d2910;
  --input:      #271808;
  --text:       #e8d0a0;
  --muted:      #9a7545;
  --orange:     #d97706;
  --orange-dim: rgba(217,119,6,.14);
  --green-dim:  rgba(34,197,94,.1);
  --blue-dim:   rgba(59,130,246,.1);
  --red-dim:    rgba(239,68,68,.1);
}
[data-theme="alt"] body                 { font-family: 'Georgia', 'Times New Roman', serif; }
[data-theme="alt"] .leaflet-container  { background: #130a02 !important; }
[data-theme="alt"] .login-logo         { font-family: 'Georgia', serif; }

/* ── Theme: Grün (Forest) ────────────────────────────────────────── */
[data-theme="gruen"] {
  --bg:         #040d06;
  --surface:    #081a0c;
  --surface2:   #0d2412;
  --sidebar-bg: #030b05;
  --border:     #163d1e;
  --input:      #071509;
  --text:       #c8e8cc;
  --muted:      #5a8a62;
  --orange:     #4ade80;
  --orange-dim: rgba(74,222,128,.14);
  --green-dim:  rgba(74,222,128,.14);
  --blue-dim:   rgba(34,197,170,.12);
  --red-dim:    rgba(239,68,68,.11);
}
[data-theme="gruen"] .leaflet-container          { background: #030b05 !important; }
[data-theme="gruen"] .btn-primary                { color: #040d06; }
[data-theme="gruen"] .quiz-score-big.quiz-passed { color: #4ade80; }

/* ── Theme: Lila (Twilight) ──────────────────────────────────────── */
[data-theme="lila"] {
  --bg:         #0d0815;
  --surface:    #160d26;
  --surface2:   #1e1235;
  --sidebar-bg: #090512;
  --border:     #2e1854;
  --input:      #120a20;
  --text:       #e0d4f8;
  --muted:      #7a5fa8;
  --orange:     #a855f7;
  --orange-dim: rgba(168,85,247,.15);
  --green-dim:  rgba(34,197,94,.1);
  --blue-dim:   rgba(168,85,247,.15);
  --red-dim:    rgba(239,68,68,.11);
}
[data-theme="lila"] .leaflet-container          { background: #090512 !important; }
[data-theme="lila"] .btn-primary                { color: #0d0815; }
[data-theme="lila"] .quiz-score-big.quiz-passed { color: #c084fc; }

/* ── Theme Switcher (floating, bottom-right) ─────────────────────── */
.theme-switcher-float {
  position: fixed;
  bottom: 1.25rem;
  right: 1.25rem;
  z-index: 200;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--rl);
  padding: .45rem .65rem .5rem;
  display: flex;
  align-items: center;
  gap: .55rem;
  box-shadow: 0 4px 20px rgba(0,0,0,.35);
}
.theme-switcher-label {
  font-size: .62rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .1em;
  color: var(--muted);
  white-space: nowrap;
}
.theme-dots { display: flex; gap: .4rem; align-items: center; }
.theme-dot {
  width: 20px; height: 20px; border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer; flex-shrink: 0;
  transition: transform .15s, box-shadow .15s;
  padding: 0;
}
.theme-dot:hover  { transform: scale(1.2); }
.theme-dot.active { box-shadow: 0 0 0 2px var(--orange); }

/* ── Reset & Base ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { text-decoration: none; color: inherit; }
button { cursor: pointer; font-family: inherit; }
input, select, textarea { font-family: inherit; }
.hidden { display: none !important; }

/* ── Scrollbar ───────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--muted); }

/* ══════════════════════════════════════════════════════════════════
   LOGIN SCREEN
══════════════════════════════════════════════════════════════════ */
.login-screen {
  position: fixed; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg);
  z-index: 9999;
}
.login-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--rl);
  padding: 2.5rem 2rem;
  width: 100%; max-width: 400px;
  text-align: center;
}
.login-logo {
  width: 64px; height: 64px; border-radius: 50%;
  background: var(--orange);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem; font-weight: 800; color: #fff;
  margin: 0 auto 1.25rem;
}
.login-card h2 { font-size: 1.3rem; font-weight: 700; margin-bottom: .5rem; }
.login-card p  { font-size: .85rem; color: var(--muted); margin-bottom: 1.75rem; line-height: 1.6; }
.login-error {
  margin-top: 1rem;
  background: var(--red-dim);
  border: 1px solid rgba(239,68,68,.3);
  color: var(--red);
  border-radius: var(--r);
  padding: .65rem .9rem;
  font-size: .83rem;
  text-align: left;
}

/* Discord button */
.btn-discord {
  display: inline-flex; align-items: center; justify-content: center; gap: .6rem;
  background: var(--purple);
  color: #fff;
  border: none;
  border-radius: var(--r);
  padding: .75rem 1.75rem;
  font-size: .93rem; font-weight: 600;
  transition: filter .15s, transform .1s;
  width: 100%;
}
.btn-discord:hover  { filter: brightness(1.12); }
.btn-discord:active { transform: scale(.98); }

/* ══════════════════════════════════════════════════════════════════
   APP LAYOUT
══════════════════════════════════════════════════════════════════ */
.app {
  display: flex;
  height: 100vh;
}

/* ── Sidebar ─────────────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  overflow-y: auto;
}
.sidebar-header {
  padding: 1.25rem 1.1rem .75rem;
  border-bottom: 1px solid var(--border);
}
.sidebar-label {
  font-size: .7rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .1em;
  color: var(--muted);
}
.sidebar-nav {
  flex: 1;
  padding: .75rem .65rem;
  display: flex; flex-direction: column; gap: .2rem;
}
.sidebar-bottom {
  padding: .65rem .65rem 1rem;
  border-top: 1px solid var(--border);
  display: flex; flex-direction: column; gap: .2rem;
}
.nav-item {
  display: flex; align-items: center; gap: .75rem;
  padding: .6rem .85rem;
  border-radius: var(--r);
  color: var(--muted);
  font-size: .87rem; font-weight: 500;
  transition: background .15s, color .15s;
  cursor: pointer;
}
.nav-item i { width: 18px; text-align: center; font-size: .95rem; flex-shrink: 0; }
.nav-item:hover { background: var(--surface2); color: var(--text); }
.nav-item.active { background: var(--orange-dim); color: var(--orange); font-weight: 600; }

/* ── Main Wrapper ────────────────────────────────────────────────── */
.main-wrapper {
  flex: 1; min-width: 0;
  display: flex; flex-direction: column;
  overflow: hidden;
}
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  flex-shrink: 0;
}
.topbar h1 { font-size: 1.1rem; font-weight: 700; }
.topbar p  { font-size: .78rem; color: var(--muted); margin-top: .05rem; }
#pageContent {
  flex: 1;
  overflow-y: auto;
  padding: 1.25rem 1.5rem;
}

/* ── User Widget ─────────────────────────────────────────────────── */
.user-widget { display: flex; align-items: center; gap: .65rem; }
.u-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--orange);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: .78rem; flex-shrink: 0;
  overflow: hidden;
}
.u-info  { line-height: 1.25; }
.u-name  { font-size: .87rem; font-weight: 600; }
.u-role  { font-size: .72rem; color: var(--muted); }
.icon-btn {
  width: 30px; height: 30px; border-radius: 50%;
  background: transparent; border: 1px solid var(--border);
  color: var(--muted); font-size: .8rem;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s, color .15s;
}
.icon-btn:hover { background: var(--surface2); color: var(--text); }

/* ══════════════════════════════════════════════════════════════════
   LOADER
══════════════════════════════════════════════════════════════════ */
.loader-wrap {
  display: flex; align-items: center; justify-content: center;
  padding: 4rem;
}
.loader {
  width: 36px; height: 36px;
  border: 3px solid var(--border);
  border-top-color: var(--orange);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ══════════════════════════════════════════════════════════════════
   TOAST
══════════════════════════════════════════════════════════════════ */
.toast-container {
  position: fixed; bottom: 1.5rem; right: 1.5rem;
  display: flex; flex-direction: column; gap: .5rem;
  z-index: 10000;
}
.toast {
  display: flex; align-items: center; gap: .65rem;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: .7rem 1rem;
  font-size: .85rem; font-weight: 500;
  box-shadow: 0 4px 16px rgba(0,0,0,.4);
  animation: toast-in .2s ease;
}
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.toast.ok  { border-color: rgba(34,197,94,.3);  color: var(--green);  }
.toast.err { border-color: rgba(239,68,68,.3);  color: var(--red);    }

/* ══════════════════════════════════════════════════════════════════
   MODAL
══════════════════════════════════════════════════════════════════ */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.65);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000;
  padding: 1rem;
}
.modal-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--rl);
  width: 100%; max-width: 520px;
  max-height: 90vh; overflow-y: auto;
  padding: 1.5rem;
  animation: modal-in .15s ease;
}
@keyframes modal-in { from { opacity: 0; transform: scale(.97); } to { opacity: 1; transform: none; } }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .3; } }
.gta-map-img { image-rendering: auto; image-rendering: -webkit-optimize-contrast; }
.leaflet-container { background: #1a1a2e; }
.map-outer { border-radius: var(--rl); overflow: hidden; }
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 1.25rem;
}
.modal-title { font-size: 1rem; font-weight: 700; }
.modal-close {
  background: transparent; border: none;
  color: var(--muted); font-size: 1rem; padding: .25rem .4rem;
  border-radius: var(--r); transition: color .15s;
}
.modal-close:hover { color: var(--text); }
.modal-footer {
  display: flex; justify-content: flex-end; gap: .65rem;
  margin-top: 1.25rem; padding-top: 1rem;
  border-top: 1px solid var(--border);
}

/* ══════════════════════════════════════════════════════════════════
   BUTTONS
══════════════════════════════════════════════════════════════════ */
.btn {
  display: inline-flex; align-items: center; gap: .45rem;
  padding: .6rem 1.1rem;
  border: 1px solid transparent;
  border-radius: var(--r);
  font-size: .85rem; font-weight: 600;
  transition: filter .15s, transform .1s;
  white-space: nowrap;
}
.btn:active { transform: scale(.97); }
.btn-primary {
  background: var(--orange); color: #fff;
  border-color: var(--orange);
}
.btn-primary:hover { filter: brightness(1.1); }
.btn-ghost {
  background: var(--surface2); color: var(--text);
  border-color: var(--border);
}
.btn-ghost:hover { background: var(--border); }
.btn-danger {
  background: var(--red-dim); color: var(--red);
  border-color: rgba(239,68,68,.3);
}
.btn-danger:hover { background: rgba(239,68,68,.25); }
.btn-success {
  background: var(--green-dim); color: var(--green);
  border-color: rgba(34,197,94,.3);
}
.btn-success:hover { background: rgba(34,197,94,.25); }
.btn-sm { padding: .35rem .7rem; font-size: .78rem; }

/* ══════════════════════════════════════════════════════════════════
   BADGES
══════════════════════════════════════════════════════════════════ */
.badge {
  display: inline-flex; align-items: center; gap: .3rem;
  padding: .2rem .6rem;
  border-radius: 999px;
  font-size: .73rem; font-weight: 600;
}
.badge-g { background: var(--green-dim);  color: var(--green);  }
.badge-r { background: var(--red-dim);    color: var(--red);    }
.badge-o { background: var(--orange-dim); color: var(--orange); }
.badge-b { background: var(--blue-dim);   color: var(--blue);   }
.badge-m { background: var(--surface2);   color: var(--muted);  border: 1px solid var(--border); }

/* ══════════════════════════════════════════════════════════════════
   CARD
══════════════════════════════════════════════════════════════════ */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--rl);
  padding: 1.1rem 1.2rem;
}
.card-head {
  display: flex; align-items: center; gap: .85rem;
  margin-bottom: 1rem;
}
.card-head-icon {
  width: 36px; height: 36px; border-radius: var(--r);
  display: flex; align-items: center; justify-content: center;
  font-size: .9rem; flex-shrink: 0;
}
.card-head-icon.orange { background: var(--orange-dim); color: var(--orange); }
.card-head-icon.green  { background: var(--green-dim);  color: var(--green);  }
.card-head-icon.blue   { background: var(--blue-dim);   color: var(--blue);   }
.card-title { font-size: .93rem; font-weight: 700; }
.card-sub   { font-size: .75rem; color: var(--muted); margin-top: .1rem; }

/* ══════════════════════════════════════════════════════════════════
   FORMS
══════════════════════════════════════════════════════════════════ */
.form-group { margin-bottom: .9rem; }
.form-group label {
  display: block;
  font-size: .78rem; font-weight: 600;
  color: var(--muted);
  text-transform: uppercase; letter-spacing: .06em;
  margin-bottom: .4rem;
}
.form-control {
  width: 100%;
  background: var(--input);
  border: 1px solid var(--border);
  border-radius: var(--r);
  color: var(--text);
  padding: .6rem .85rem;
  font-size: .87rem;
  transition: border-color .15s;
}
.form-control:focus { outline: none; border-color: var(--orange); }
.form-control option { background: var(--input); }
textarea.form-control { resize: vertical; min-height: 80px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }

/* ══════════════════════════════════════════════════════════════════
   PAGE HEADER
══════════════════════════════════════════════════════════════════ */
.pg-header {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: .75rem;
  margin-bottom: 1.25rem;
}
.pg-header-left h2 { font-size: 1.05rem; font-weight: 700; }
.pg-header-left p  { font-size: .78rem; color: var(--muted); margin-top: .15rem; }

/* ══════════════════════════════════════════════════════════════════
   SEARCH BAR
══════════════════════════════════════════════════════════════════ */
.search-bar {
  display: flex; align-items: center; gap: .5rem;
  background: var(--input);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: .45rem .8rem;
}
.search-bar i { color: var(--muted); font-size: .85rem; flex-shrink: 0; }
.search-bar input {
  background: transparent; border: none;
  color: var(--text); font-size: .85rem;
  outline: none; width: 200px;
}

/* ══════════════════════════════════════════════════════════════════
   TABLE
══════════════════════════════════════════════════════════════════ */
.tbl-wrap { overflow-x: auto; }
.data-tbl {
  width: 100%; border-collapse: collapse;
  font-size: .85rem;
}
.data-tbl th {
  text-align: left;
  font-size: .72rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .07em;
  color: var(--muted);
  padding: .6rem .75rem;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.data-tbl td {
  padding: .75rem .75rem;
  border-bottom: 1px solid var(--border);
  color: var(--muted);
  vertical-align: middle;
}
.data-tbl tr:last-child td { border-bottom: none; }
.data-tbl tr:hover td { background: rgba(255,255,255,.02); }

/* ══════════════════════════════════════════════════════════════════
   EMPTY STATE
══════════════════════════════════════════════════════════════════ */
.empty {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center;
  padding: 2.5rem 1rem;
  color: var(--muted);
  gap: .65rem;
}
.empty i { font-size: 2rem; opacity: .4; }
.empty p { font-size: .85rem; }

/* ══════════════════════════════════════════════════════════════════
   DASHBOARD
══════════════════════════════════════════════════════════════════ */

/* EoW Banner */
.eow-banner {
  background: linear-gradient(135deg, rgba(249,115,22,.12) 0%, rgba(249,115,22,.04) 100%);
  border: 1px solid rgba(249,115,22,.25);
  border-radius: var(--rl);
  padding: 1.1rem 1.3rem;
  display: flex; align-items: center; gap: 1rem;
  margin-bottom: 1.1rem;
}
.eow-av {
  width: 52px; height: 52px; border-radius: 50%;
  background: var(--orange);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 1.15rem; color: #fff;
  flex-shrink: 0; overflow: hidden;
  border: 2px solid rgba(249,115,22,.4);
}
.eow-info { flex: 1; }
.eow-label { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: var(--orange); margin-bottom: .15rem; }
.eow-name  { font-size: 1.1rem; font-weight: 700; }
.eow-ml { flex-shrink: 0; }

/* Stats Row */
.stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: .85rem;
  margin-bottom: 1rem;
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--rl);
  padding: 1rem 1.1rem;
  display: flex; align-items: center; justify-content: space-between;
  gap: .75rem;
}
.stat-info { flex: 1; }
.stat-lbl { font-size: .75rem; color: var(--muted); margin-bottom: .25rem; }
.stat-val { font-size: 1.6rem; font-weight: 800; color: var(--text); line-height: 1; }
.stat-val.g { color: var(--green);  }
.stat-val.r { color: var(--red);    }
.stat-val.o { color: var(--orange); }
.stat-val.b { color: var(--blue);   }
.stat-ico {
  width: 42px; height: 42px; border-radius: var(--rl);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem; flex-shrink: 0;
}
.stat-ico.o { background: var(--orange-dim); color: var(--orange); }
.stat-ico.g { background: var(--green-dim);  color: var(--green);  }
.stat-ico.r { background: var(--red-dim);    color: var(--red);    }
.stat-ico.b { background: var(--blue-dim);   color: var(--blue);   }

/* Time Row */
.time-row {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: .85rem; margin-bottom: 1rem;
}
.time-card {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--rl);
  padding: .85rem 1rem;
  text-align: center;
}
.time-lbl { font-size: .75rem; color: var(--muted); margin-bottom: .3rem; }
.time-val { font-size: 1.55rem; font-weight: 800; color: var(--orange); }

/* Last Exam Card */
.last-exam-card { margin-bottom: 1rem; }
.last-exam-body {
  display: flex; align-items: center; gap: 1.25rem;
  margin-top: .85rem;
  padding: .85rem;
  background: var(--input);
  border-radius: var(--r);
}
.last-exam-person {
  display: flex; align-items: center; gap: .85rem; flex: 1;
}
.last-exam-icon {
  width: 44px; height: 44px; border-radius: var(--r);
  background: var(--blue-dim); color: var(--blue);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.05rem; flex-shrink: 0;
}
.last-exam-arrow {
  color: var(--muted); font-size: 1rem; flex-shrink: 0;
  padding: 0 .5rem;
}

/* Dash Bottom */
.dash-bottom {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 1rem; margin-top: 1rem;
}

/* Leaderboard */
.lb-item {
  display: flex; align-items: center; gap: .75rem;
  padding: .55rem 0;
  border-bottom: 1px solid var(--border);
}
.lb-item:last-child { border-bottom: none; }
.rank-badge {
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--orange); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: .7rem; font-weight: 800; flex-shrink: 0;
}
.rank-badge.r2 { background: #94a3b8; }
.rank-badge.r3 { background: #c07b4a; }
.lb-name  { font-size: .87rem; font-weight: 600; }
.lb-sub   { font-size: .73rem; color: var(--muted); }
.lb-score {
  display: flex; align-items: center; gap: .35rem;
  font-size: .85rem; font-weight: 700; color: var(--orange);
  margin-left: auto; flex-shrink: 0;
}
.lb-score i { font-size: .75rem; }

/* Recent Exams */
.re-item {
  display: flex; align-items: center; gap: .75rem;
  padding: .6rem 0;
  border-bottom: 1px solid var(--border);
}
.re-item:last-child { border-bottom: none; }
.re-ico {
  width: 28px; height: 28px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: .75rem; flex-shrink: 0;
}
.re-ico.pass { background: var(--green-dim); color: var(--green); }
.re-ico.fail { background: var(--red-dim);   color: var(--red);   }
.re-info { flex: 1; min-width: 0; }
.re-name { font-size: .87rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.re-meta { font-size: .73rem; color: var(--muted); display: flex; align-items: center; gap: .3rem; flex-wrap: wrap; }
.sep { display: inline-block; width: 3px; height: 3px; background: var(--border); border-radius: 50%; }
.re-time { font-size: .73rem; color: var(--muted); flex-shrink: 0; white-space: nowrap; }

/* ══════════════════════════════════════════════════════════════════
   ACTIVITY
══════════════════════════════════════════════════════════════════ */
.act-item {
  display: flex; align-items: flex-start; gap: .85rem;
  padding: .7rem .75rem;
  border-bottom: 1px solid var(--border);
}
.act-item:last-child { border-bottom: none; }
.act-dot {
  width: 9px; height: 9px; border-radius: 50%;
  flex-shrink: 0; margin-top: .35rem;
}
.act-dot.g { background: var(--green);  }
.act-dot.r { background: var(--red);    }
.act-dot.o { background: var(--orange); }
.act-text  { flex: 1; font-size: .85rem; line-height: 1.5; }
.act-time  { font-size: .73rem; color: var(--muted); flex-shrink: 0; white-space: nowrap; }

/* ══════════════════════════════════════════════════════════════════
   EOW PAGE
══════════════════════════════════════════════════════════════════ */
.eow-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 1rem; align-items: start;
}
.vote-item {
  display: flex; align-items: center; gap: .75rem;
  padding: .65rem .85rem;
  border-radius: var(--r);
  border: 1px solid var(--border);
  margin-bottom: .45rem;
  cursor: pointer;
  transition: background .15s, border-color .15s;
}
.vote-item:hover { background: var(--input); }
.vote-item.voted     { border-color: rgba(249,115,22,.4); background: var(--orange-dim); cursor: default; }
.vote-item.self-item { opacity: .5; cursor: default; }
.vote-item.self-item:hover { background: transparent; }
.vote-name  { font-size: .87rem; font-weight: 600; }
.vote-count { font-size: .73rem; color: var(--muted); }
.history-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: .6rem 0;
  border-bottom: 1px solid var(--border);
}
.history-item:last-child { border-bottom: none; }

/* ══════════════════════════════════════════════════════════════════
   EXAMS
══════════════════════════════════════════════════════════════════ */
.exam-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: .9rem;
}
.exam-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--rl);
  padding: 1.1rem;
  display: flex; flex-direction: column; gap: .65rem;
  transition: border-color .15s;
}
.exam-card:hover { border-color: rgba(249,115,22,.35); }
.exam-icon {
  width: 44px; height: 44px; border-radius: var(--r);
  background: var(--orange-dim); color: var(--orange);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.15rem;
}
.exam-name    { font-size: .95rem; font-weight: 700; }
.exam-desc    { font-size: .78rem; color: var(--muted); }
.exam-q-count { font-size: .75rem; color: var(--blue); }
.exam-btns    { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: auto; }

/* Quiz */
.quiz-wrap { padding: .25rem 0; }
.quiz-progress {
  height: 4px; background: var(--border); border-radius: 2px;
  margin-bottom: 1rem; overflow: hidden;
}
.quiz-progress-bar {
  height: 100%; background: var(--orange);
  border-radius: 2px; transition: width .3s ease;
}
.quiz-counter { font-size: .75rem; color: var(--muted); margin-bottom: .75rem; }
.quiz-q {
  font-size: .95rem; font-weight: 600; line-height: 1.55;
  margin-bottom: 1rem;
}
.quiz-option {
  display: flex; align-items: center; gap: .75rem;
  padding: .7rem .9rem;
  border: 1px solid var(--border);
  border-radius: var(--r);
  margin-bottom: .45rem;
  cursor: pointer;
  font-size: .87rem;
  transition: background .12s, border-color .12s;
}
.quiz-option:hover    { background: var(--input); }
.quiz-option.selected { border-color: var(--orange); background: var(--orange-dim); }
.opt-letter {
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--surface2); color: var(--muted);
  display: flex; align-items: center; justify-content: center;
  font-size: .75rem; font-weight: 700; flex-shrink: 0;
}
.quiz-option.selected .opt-letter { background: var(--orange); color: #fff; }
.quiz-option.correct-answer { border-color: rgba(34,197,94,.4); background: rgba(34,197,94,.06); }
.quiz-option.correct-answer .opt-letter { background: #22c55e; color: #fff; }
.quiz-result { text-align: center; padding: 1.5rem 0; }
.quiz-score-big {
  font-size: 3rem; font-weight: 900; line-height: 1;
}
.quiz-passed { color: var(--green); }
.quiz-failed { color: var(--red);   }
.ko-badge { display:flex; align-items:center; gap:.5rem; background:rgba(239,68,68,.15);
  border:1px solid rgba(239,68,68,.5); border-radius:var(--r); padding:.65rem .85rem;
  margin-bottom:.75rem; font-size:.85rem; color:#ef4444; font-weight:700;
  box-shadow:0 0 12px rgba(239,68,68,.15); }
.quiz-wrap.ko-mode { border:1px solid rgba(239,68,68,.35); border-radius:var(--r);
  padding:.75rem; background:rgba(239,68,68,.04); }
.ko-mode .quiz-q { border-left:3px solid #ef4444; padding-left:.75rem; }
.ko-mode .quiz-option:hover { border-color:rgba(239,68,68,.5) !important; }
.ko-mode .quiz-option.selected { border-color:#ef4444 !important; background:rgba(239,68,68,.12) !important; }
.ko-mode .quiz-option.selected .opt-letter { background:#ef4444; color:#fff; }

/* ══════════════════════════════════════════════════════════════════
   MAP — Leaflet GTA V
══════════════════════════════════════════════════════════════════ */
.map-outer {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--rl);
  overflow: hidden;
  margin-bottom: 1rem;
}

/* Leaflet container dark overrides */
.leaflet-container {
  background: #0a0a0a !important;
  font-family: 'Inter', sans-serif !important;
}
.leaflet-control-zoom a {
  background: var(--surface2) !important;
  color: var(--text) !important;
  border-color: var(--border) !important;
}
.leaflet-control-zoom a:hover {
  background: var(--border) !important;
}
.leaflet-popup-content-wrapper {
  background: var(--surface) !important;
  color: var(--text) !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--r) !important;
  box-shadow: 0 4px 20px rgba(0,0,0,.5) !important;
}
.leaflet-popup-tip {
  background: var(--surface) !important;
}
.gta-map-img {
  image-rendering: auto;
}

/* ══════════════════════════════════════════════════════════════════
   FACTIONS
══════════════════════════════════════════════════════════════════ */
.swatch {
  display: inline-block;
  width: 16px; height: 16px; border-radius: 4px;
  border: 1px solid var(--border);
  flex-shrink: 0;
}

/* ══════════════════════════════════════════════════════════════════
   ADMIN
══════════════════════════════════════════════════════════════════ */
.admin-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 1rem; align-items: start;
}

/* ══════════════════════════════════════════════════════════════════
   PROFILE
══════════════════════════════════════════════════════════════════ */
.profile-header {
  display: flex; align-items: center; gap: 1rem;
  margin-bottom: 1.25rem;
}
.profile-av {
  width: 64px; height: 64px; border-radius: 50%;
  background: var(--orange);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem; font-weight: 800;
  flex-shrink: 0;
}
.profile-name { font-size: 1.05rem; font-weight: 700; }
.profile-role { font-size: .78rem; color: var(--muted); margin-top: .2rem; }
.profile-stats {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: .65rem; margin-bottom: 1rem;
}
.pstat {
  background: var(--input);
  border-radius: var(--r);
  padding: .65rem;
  text-align: center;
}
.pstat-val { font-size: 1.2rem; font-weight: 800; margin-bottom: .2rem; }
.pstat-lbl { font-size: .7rem; color: var(--muted); }
.divider {
  height: 1px; background: var(--border);
  margin: .85rem 0;
}

/* ══════════════════════════════════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════════════════════════════════ */
@media (max-width: 900px) {
  :root { --sidebar-w: 200px; }
  .stats-row { grid-template-columns: repeat(2, 1fr); }
  .dash-bottom, .admin-grid, .eow-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  :root { --sidebar-w: 0px; }
  .sidebar { display: none; }
  .stats-row { grid-template-columns: 1fr 1fr; }
  .time-row  { grid-template-columns: 1fr 1fr 1fr; }
  #pageContent { padding: 1rem; }
  .topbar { padding: .75rem 1rem; }
  .last-exam-body { flex-direction: column; align-items: flex-start; }
  .last-exam-arrow { transform: rotate(90deg); align-self: center; }
  .form-row { grid-template-columns: 1fr; }
}
