/* ============================================
   Pioneersgz - Premium Design System
   Light theme | Arabic RTL | Luxury feel
   ============================================ */

:root {
  /* Brand Palette - Royal Gold & Deep Indigo */
  --bg: #f7f5ef;
  --bg-soft: #fdfcf8;
  --surface: #ffffff;
  --surface-2: #f3f0e6;
  --ink: #1a1733;
  --ink-soft: #4a4666;
  --muted: #8b8aa0;
  --line: #e6e2d3;
  --line-soft: #efece0;

  --primary: #1a1733;          /* Deep Indigo */
  --primary-2: #2d2856;
  --gold: #c9a96a;             /* Royal Gold */
  --gold-2: #b8945a;
  --gold-soft: #f4ead4;
  --accent: #6b5fcf;
  --success: #16a34a;
  --success-soft: #dcfce7;
  --danger: #dc2626;
  --danger-soft: #fee2e2;
  --warning: #d97706;
  --warning-soft: #fef3c7;
  --info: #0ea5e9;
  --info-soft: #e0f2fe;

  --shadow-sm: 0 1px 2px rgba(26,23,51,.04), 0 1px 3px rgba(26,23,51,.04);
  --shadow: 0 4px 12px rgba(26,23,51,.06), 0 2px 4px rgba(26,23,51,.04);
  --shadow-lg: 0 20px 40px -12px rgba(26,23,51,.12), 0 8px 16px rgba(26,23,51,.06);
  --shadow-gold: 0 8px 24px rgba(201,169,106,.25);

  --grad-gold: linear-gradient(135deg, #d4b67a 0%, #c9a96a 50%, #a8864a 100%);
  --grad-ink: linear-gradient(135deg, #1a1733 0%, #2d2856 100%);
  --grad-soft: linear-gradient(135deg, #fdfcf8 0%, #f3f0e6 100%);

  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;

  --font: 'Tajawal', 'Cairo', system-ui, sans-serif;
  --font-display: 'Playfair Display', 'Tajawal', serif;
  --font-en: 'Inter', system-ui, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  direction: rtl;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, select, textarea { font-family: inherit; }
img {max-width: 100%;display: block;border-radius: 20%;border: 1px solid #c4a365;}

/* ===== Decorative bg ===== */
.bg-decor {
  position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden;
}
.bg-decor::before, .bg-decor::after {
  content: ''; position: absolute; border-radius: 50%;
  filter: blur(80px); opacity: .4;
}
.bg-decor::before {
  width: 500px; height: 500px;
  background: radial-gradient(circle, #f4ead4 0%, transparent 70%);
  top: -150px; right: -150px;
}
.bg-decor::after {
  width: 400px; height: 400px;
  background: radial-gradient(circle, #e8e2f5 0%, transparent 70%);
  bottom: -100px; left: -100px;
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 22px; border-radius: var(--radius-sm);
  font-weight: 600; font-size: 14.5px;
  transition: all .25s cubic-bezier(.4,0,.2,1);
  white-space: nowrap; user-select: none;
}
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: var(--grad-ink); color: #fff;
  box-shadow: 0 4px 14px rgba(26,23,51,.25);
}
.btn-primary:hover { box-shadow: 0 8px 22px rgba(26,23,51,.35); transform: translateY(-1px); }
.btn-gold {
  background: var(--grad-gold); color: #fff;
  box-shadow: var(--shadow-gold);
}
.btn-gold:hover { box-shadow: 0 12px 30px rgba(201,169,106,.4); transform: translateY(-1px); }
.btn-outline {
  background: var(--surface); border: 1.5px solid var(--line); color: var(--ink);
}
.btn-outline:hover { border-color: var(--gold); color: var(--gold-2); }
.btn-ghost { background: transparent; color: var(--ink-soft); }
.btn-ghost:hover { background: var(--surface-2); color: var(--ink); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #b91c1c; }
.btn-success { background: var(--success); color: #fff; }
.btn-icon {
  width: 38px; height: 38px; padding: 0; border-radius: 10px;
  background: var(--surface-2); color: var(--ink-soft);
}
.btn-icon:hover { background: var(--ink); color: #fff; }
.btn-sm { padding: 7px 14px; font-size: 13px; }
.btn-lg { padding: 14px 28px; font-size: 15.5px; }
.btn-block { width: 100%; }

/* ===== Forms ===== */
.field { margin-bottom: 18px; }
.field label {
  display: block; margin-bottom: 8px;
  font-weight: 600; font-size: 14px; color: var(--ink);
}
.input, .select, .textarea {
  width: 100%; padding: 12px 16px;
  background: var(--surface); border: 1.5px solid var(--line);
  border-radius: var(--radius-sm); font-size: 15px;
  color: var(--ink); transition: all .2s;
}
.input:focus, .select:focus, .textarea:focus {
  outline: none; border-color: var(--gold);
  box-shadow: 0 0 0 4px rgba(201,169,106,.15);
}
.input::placeholder { color: var(--muted); }
.textarea { resize: vertical; min-height: 100px; }
.field-hint { font-size: 12.5px; color: var(--muted); margin-top: 6px; }
.field-error { font-size: 12.5px; color: var(--danger); margin-top: 6px; display: none; }
.field.has-error .input { border-color: var(--danger); }
.field.has-error .field-error { display: block; }

/* ===== Card ===== */
.card {
  background: var(--surface); border: 1px solid var(--line-soft);
  border-radius: var(--radius); padding: 24px;
  box-shadow: var(--shadow-sm);
}
.card-lg { padding: 32px; border-radius: var(--radius-lg); }
.card-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px; padding-bottom: 16px;
  border-bottom: 1px solid var(--line-soft);
}
.card-title { font-size: 18px; font-weight: 700; }

/* ===== Badges ===== */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 11px; border-radius: 999px;
  font-size: 12.5px; font-weight: 600;
}
.badge-success { background: var(--success-soft); color: var(--success); }
.badge-danger { background: var(--danger-soft); color: var(--danger); }
.badge-warning { background: var(--warning-soft); color: var(--warning); }
.badge-info { background: var(--info-soft); color: var(--info); }
.badge-gold { background: var(--gold-soft); color: var(--gold-2); }
.badge-ink { background: var(--ink); color: #fff; }

/* ===== Auth Pages ===== */
.auth-shell {
  min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr;
}
.auth-side {
  position: relative; overflow: hidden;
  background: var(--grad-ink); color: #fff;
  padding: 60px; display: flex; flex-direction: column; justify-content: space-between;
}
.auth-side::before {
  content: ''; position: absolute; top: -100px; right: -100px;
  width: 400px; height: 400px; border-radius: 50%;
  background: radial-gradient(circle, rgba(201,169,106,.3), transparent 70%);
}
.auth-side::after {
  content: ''; position: absolute; bottom: -150px; left: -150px;
  width: 500px; height: 500px; border-radius: 50%;
  background: radial-gradient(circle, rgba(107,95,207,.2), transparent 70%);
}
.auth-brand { display: flex; align-items: center; gap: 12px; position: relative; z-index: 1; }
.auth-brand-mark {
  width: 48px; height: 48px; border-radius: 12px;
  background: var(--grad-gold); display: grid; place-items: center;
  font-weight: 800; font-size: 20px; color: #fff;
  box-shadow: var(--shadow-gold);
}
.auth-brand-name { font-size: 22px; font-weight: 800; letter-spacing: -.5px; }
.auth-hero { position: relative; z-index: 1; }
.auth-hero h1 {
  font-family: var(--font-display); font-size: 44px;
  line-height: 1.2; margin-bottom: 18px; font-weight: 700;
}
.auth-hero h1 span { color: var(--gold); font-style: italic; }
.auth-hero p { font-size: 16px; color: rgba(255,255,255,.75); max-width: 420px; line-height: 1.8; }
.auth-quote { position: relative; z-index: 1; padding-right: 18px; border-right: 3px solid var(--gold); }
.auth-quote p { font-size: 14.5px; color: rgba(255,255,255,.85); margin-bottom: 8px; font-style: italic; }
.auth-quote span { font-size: 13px; color: var(--gold); font-weight: 600; }

.auth-main {
  display: flex; align-items: center; justify-content: center;
  padding: 40px; background: var(--bg);
}
.auth-card { width: 100%; max-width: 440px; }
.auth-title {
  font-family: var(--font-display); font-size: 32px; font-weight: 700;
  margin-bottom: 8px;
}
.auth-subtitle { color: var(--ink-soft); margin-bottom: 32px; font-size: 15px; }
.auth-foot { text-align: center; margin-top: 24px; font-size: 14px; color: var(--ink-soft); }
.auth-foot a { color: var(--gold-2); font-weight: 600; }
.auth-foot a:hover { text-decoration: underline; }

@media (max-width: 900px) {
  .auth-shell { grid-template-columns: 1fr; }
  .auth-side { display: none; }
}

/* ===== App Shell (Dashboard) ===== */
.app {
  display: grid; grid-template-columns: 280px 1fr; min-height: 100vh;
}
.sidebar {
  background: var(--surface); border-left: 1px solid var(--line-soft);
  padding: 24px 18px; position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.sidebar-brand {
  display: flex; align-items: center; gap: 12px; padding: 8px 10px;
  margin-bottom: 28px;
}
.sidebar-brand-mark {
  width: 50px;
  height: 50px;
  border-radius: 11px;
  background: var(--grad-gold);
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 800;
  font-size: 17px;
  box-shadow: var(--shadow-gold);
}
.sidebar-brand-name { font-size: 18px; font-weight: 800; }
.sidebar-brand-sub { font-size: 11.5px; color: var(--muted); margin-top: -2px; }

.nav-label {
  font-size: 11px; font-weight: 700; color: var(--muted);
  letter-spacing: 1px; padding: 0 12px; margin: 18px 0 8px;
  text-transform: uppercase;
}
.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 14px; border-radius: 10px; margin-bottom: 3px;
  color: var(--ink-soft); font-weight: 600; font-size: 14.5px;
  transition: all .2s; cursor: pointer; position: relative;
}
.nav-item:hover { background: var(--surface-2); color: var(--ink); }
.nav-item.active {
  background: var(--grad-ink); color: #fff;
  box-shadow: 0 4px 12px rgba(26,23,51,.2);
}
.nav-item.active::before {
  content: ''; position: absolute; right: -18px; top: 50%; transform: translateY(-50%);
  width: 4px; height: 22px; background: var(--gold); border-radius: 2px;
}
.nav-item svg { width: 19px; height: 19px; flex-shrink: 0; }
.nav-item .badge { margin-right: auto; padding: 2px 8px; font-size: 11px; }

.main { padding: 28px 36px; min-width: 0; }
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 28px; gap: 16px;
}
.page-title { font-family: var(--font-display); font-size: 30px; font-weight: 700; }
.page-sub { color: var(--ink-soft); font-size: 14.5px; margin-top: 2px; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }

.user-chip {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 14px 6px 6px; background: var(--surface);
  border: 1px solid var(--line); border-radius: 999px;
}
.user-chip-avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--grad-gold); color: #fff;
  display: grid; place-items: center; font-weight: 700; font-size: 14px;
}
.user-chip-info { line-height: 1.2; }
.user-chip-name { font-size: 13.5px; font-weight: 700; }
.user-chip-role { font-size: 11.5px; color: var(--muted); }

/* ===== Stats grid ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 28px;
}
.stat-card {
    background: var(--surface);
    border: 1px solid var(--line-soft);
    border-radius: var(--radius);
    padding: 18px 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: all .25s;
    overflow: hidden;
}
.stat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.stat-icon {
    width: 46px; height: 46px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    flex-shrink: 0;
    font-size: 18px;
}
.stat-icon.gold    { background: var(--gold-soft);           color: var(--gold-2); }
.stat-icon.ink     { background: rgba(26,23,51,.08);         color: var(--primary); }
.stat-icon.success { background: var(--success-soft);        color: var(--success); }
.stat-icon.info    { background: var(--info-soft);           color: var(--info); }
.stat-body { display: flex; flex-direction: column; gap: 2px; }
.stat-label { font-size: 13px; color: var(--ink-soft); }
.stat-value { font-size: 22px; font-weight: 800; letter-spacing: -.5px; line-height: 1.2; }
.stat-trend { font-size: 12px; display: flex; align-items: center; gap: 4px; margin-top: 2px; }
.stat-trend.up   { color: var(--success); }
.stat-trend.down { color: var(--danger); }

.stat-label,.stat-trend.up { font-size: 13px; font-weight: 700; }
/* ===== Tables ===== */
.table-wrap { overflow-x: auto; border-radius: var(--radius); }
.table {
  width: 100%; border-collapse: collapse;
  background: var(--surface); border-radius: var(--radius); overflow: hidden;
  border: 1px solid var(--line-soft);
}
.table th, .table td {
  padding: 14px 18px; text-align: right;
  border-bottom: 1px solid var(--line-soft);
  font-size: 14px;
}
.table th {
  background: var(--surface-2); color: var(--ink-soft);
  font-weight: 700; font-size: 13px;
  white-space: nowrap;
}
.table tbody tr { transition: background .15s; }
.table tbody tr:hover { background: var(--bg-soft); }
.table tbody tr:last-child td { border-bottom: none; }
.table .actions { display: flex; gap: 6px; }
.table .actions .btn-icon { width: 32px; height: 32px; }

.table-toolbar {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 16px; flex-wrap: wrap;
}
.search-input {
  flex: 1; min-width: 220px; max-width: 340px;
  padding: 10px 16px 10px 40px; background: var(--surface);
  border: 1px solid var(--line); border-radius: 10px;
  font-size: 14px; position: relative;
}
.search-wrap { position: relative; flex: 1; max-width: 340px; }
.search-wrap svg {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  width: 17px; height: 17px; color: var(--muted);
}
.search-wrap input {
  width: 100%; padding: 10px 16px 10px 38px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px;
  font-size: 14px; transition: all .2s;
}
.search-wrap input:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(201,169,106,.15); }

/* ===== Tabs ===== */
.tabs {
  display: flex; gap: 4px; padding: 5px; background: var(--surface-2);
  border-radius: 12px; margin-bottom: 20px; width: fit-content;
}
.tab {
  padding: 9px 18px; border-radius: 9px;
  font-size: 14px; font-weight: 600; color: var(--ink-soft);
  transition: all .2s;
}
.tab:hover { color: var(--ink); }
.tab.active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }

/* ===== Modal ===== */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(26,23,51,.5);
  backdrop-filter: blur(4px); z-index: 100;
  display: none; align-items: center; justify-content: center; padding: 20px;
  animation: fadeIn .2s ease;
}
.modal-overlay.show { display: flex; }
.modal {
  background: var(--surface); border-radius: var(--radius-lg);
  width: 100%; max-width: 560px; max-height: 90vh;
  overflow-y: auto; padding: 28px;
  box-shadow: var(--shadow-lg);
  animation: slideUp .3s ease;
}
.modal-lg { max-width: 800px; }
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px; padding-bottom: 16px;
  border-bottom: 1px solid var(--line-soft);
}
.modal-title { font-size: 20px; font-weight: 700; font-family: var(--font-display); }
.modal-close {
  width: 34px; height: 34px; border-radius: 10px;
  background: var(--surface-2); display: grid; place-items: center;
  color: var(--ink-soft);
}
.modal-close:hover { background: var(--ink); color: #fff; }
.modal-foot {
  display: flex; gap: 10px; justify-content: flex-start;
  margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--line-soft);
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ===== Toasts ===== */
.toast-wrap {
  position: fixed; top: 24px; left: 24px; z-index: 200;
  display: flex; flex-direction: column; gap: 10px;
}
.toast {
  min-width: 280px; padding: 14px 18px; border-radius: 12px;
  background: var(--surface); border: 1px solid var(--line);
  box-shadow: var(--shadow-lg);
  display: flex; align-items: center; gap: 12px;
  animation: slideIn .25s ease;
}
.toast.success { border-right: 4px solid var(--success); }
.toast.error { border-right: 4px solid var(--danger); }
.toast.info { border-right: 4px solid var(--info); }
.toast-icon {
  width: 32px; height: 32px; border-radius: 8px;
  display: grid; place-items: center; flex-shrink: 0;
}
.toast.success .toast-icon { background: var(--success-soft); color: var(--success); }
.toast.error .toast-icon { background: var(--danger-soft); color: var(--danger); }
.toast.info .toast-icon { background: var(--info-soft); color: var(--info); }
.toast-msg { font-size: 14px; font-weight: 600; }

@keyframes slideIn {
  from { opacity: 0; transform: translateX(-20px); }
  to { opacity: 1; transform: translateX(0); }
}

/* ===== Empty state ===== */
.empty {
  text-align: center; padding: 60px 20px; color: var(--muted);
}
.empty-icon {
  width: 72px; height: 72px; margin: 0 auto 16px;
  border-radius: 20px; background: var(--surface-2);
  display: grid; place-items: center; color: var(--gold);
}
.empty-title { font-size: 17px; font-weight: 700; color: var(--ink); margin-bottom: 6px; }
.empty-text { font-size: 14px; }

/* ===== Quiz UI (English LTR for exams) ===== */
.quiz-app {
  min-height: 100vh; background: var(--bg);
  direction: ltr; font-family: var(--font-en);
}
.quiz-header {
  background: var(--grad-ink); color: #fff; padding: 18px 32px;
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 10; box-shadow: var(--shadow);
}
.quiz-header-left { display: flex; align-items: center; gap: 16px; }
.quiz-title { font-size: 18px; font-weight: 700; }
.quiz-timer {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 16px; background: rgba(255,255,255,.1);
  border: 1px solid rgba(201,169,106,.4);
  border-radius: 999px; font-weight: 700; font-size: 15px;
  font-variant-numeric: tabular-nums;
}
.quiz-timer.warn { background: rgba(220,38,38,.2); border-color: var(--danger); animation: pulse 1.2s infinite; }
@keyframes pulse { 50% { opacity: .7; } }
.quiz-progress {
  height: 4px; background: rgba(255,255,255,.15); width: 100%;
}
.quiz-progress-bar {
  height: 100%; background: var(--grad-gold); transition: width .3s;
}

.quiz-body {
  max-width: 1100px; margin: 0 auto; padding: 32px;
  display: grid; grid-template-columns: 1fr 280px; gap: 28px;
}
.quiz-question-card {
  background: var(--surface); border-radius: var(--radius-lg);
  padding: 36px; border: 1px solid var(--line-soft);
  box-shadow: var(--shadow);
}
.quiz-q-num {
  display: inline-block; padding: 5px 14px;
  background: var(--gold-soft); color: var(--gold-2);
  border-radius: 999px; font-size: 13px; font-weight: 700;
  margin-bottom: 18px;
}
.quiz-q-text {
  font-size: 21px; font-weight: 600; line-height: 1.6;
  margin-bottom: 28px; color: var(--ink);
}
.quiz-options { display: flex; flex-direction: column; gap: 12px; }
.quiz-option {
  display: flex; align-items: center; gap: 14px;
  padding: 16px 20px; border: 2px solid var(--line);
  border-radius: var(--radius); background: var(--surface);
  cursor: pointer; transition: all .2s;
  font-size: 15.5px; font-weight: 500;
}
.quiz-option:hover { border-color: var(--gold); background: var(--bg-soft); }
.quiz-option.selected { border-color: var(--primary); background: rgba(26,23,51,.04); }
.quiz-option.correct { border-color: var(--success); background: var(--success-soft); color: #14532d; }
.quiz-option.wrong { border-color: var(--danger); background: var(--danger-soft); color: #7f1d1d; }
.quiz-option.disabled { pointer-events: none; opacity: .85; }
.quiz-opt-letter {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--surface-2); display: grid; place-items: center;
  font-weight: 700; flex-shrink: 0;
}
.quiz-option.selected .quiz-opt-letter { background: var(--primary); color: #fff; }
.quiz-option.correct .quiz-opt-letter { background: var(--success); color: #fff; }
.quiz-option.wrong .quiz-opt-letter { background: var(--danger); color: #fff; }

.quiz-nav {
  display: flex; justify-content: space-between; gap: 12px; margin-top: 28px;
}

.quiz-side {
  background: var(--surface); border-radius: var(--radius-lg);
  padding: 22px; border: 1px solid var(--line-soft);
  height: fit-content; position: sticky; top: 92px;
}
.quiz-side h3 { font-size: 14px; font-weight: 700; margin-bottom: 14px; color: var(--ink-soft); }
.quiz-grid {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px;
}
.quiz-grid-btn {
  aspect-ratio: 1; border-radius: 9px; border: 1.5px solid var(--line);
  background: var(--surface); font-weight: 700; font-size: 13.5px;
  display: grid; place-items: center; cursor: pointer; transition: all .15s;
}
.quiz-grid-btn:hover { border-color: var(--gold); }
.quiz-grid-btn.current { background: var(--primary); color: #fff; border-color: var(--primary); }
.quiz-grid-btn.answered { background: var(--gold-soft); border-color: var(--gold); color: var(--gold-2); }
.quiz-grid-btn.answered.current { background: var(--primary); color: #fff; }

.quiz-legend { margin-top: 16px; display: flex; flex-direction: column; gap: 8px; font-size: 12.5px; }
.quiz-legend span { display: flex; align-items: center; gap: 8px; color: var(--ink-soft); }
.quiz-legend i {
  width: 14px; height: 14px; border-radius: 4px; display: inline-block;
}

@media (max-width: 900px) {
  .quiz-body { grid-template-columns: 1fr; }
  .quiz-side { position: static; }
}

/* ===== Quiz Result ===== */
.result-shell {
  min-height: 100vh; display: grid; place-items: center;
  padding: 40px 20px; direction: rtl;
}
.result-card {
  background: var(--surface); border-radius: var(--radius-xl);
  padding: 48px; max-width: 560px; width: 100%; text-align: center;
  box-shadow: var(--shadow-lg); border: 1px solid var(--line-soft);
}
.result-circle {
  width: 160px; height: 160px; border-radius: 50%; margin: 0 auto 24px;
  display: grid; place-items: center; position: relative;
  background: conic-gradient(var(--gold) calc(var(--p) * 1%), var(--surface-2) 0);
}
.result-circle::before {
  content: ''; position: absolute; inset: 14px; border-radius: 50%;
  background: var(--surface);
}
.result-circle span { position: relative; font-size: 36px; font-weight: 800; font-family: var(--font-display); }
.result-title { font-family: var(--font-display); font-size: 28px; font-weight: 700; margin-bottom: 10px; }
.result-text { color: var(--ink-soft); margin-bottom: 28px; }
.result-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 28px; }
.result-stat { padding: 16px 10px; background: var(--bg-soft); border-radius: 12px; }
.result-stat-label { font-size: 12.5px; color: var(--ink-soft); margin-bottom: 4px; }
.result-stat-value { font-size: 20px; font-weight: 800; }
.result-actions { display: flex; gap: 10px; justify-content: center; }

/* ===== Student card list ===== */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}
.q-card {
    background: var(--surface);
    border: 1px solid var(--line-soft);
    border-radius: var(--radius);
    padding: 16px 18px;
    transition: all .25s;
    position: relative;
    overflow: hidden;
}
.q-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: var(--gold); }
.q-card-top {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 12px;
}
.q-card-icon {
    width: 42px; height: 42px;
    border-radius: 10px;
    background: var(--gold-soft);
    color: var(--gold-2);
    display: grid;
    place-items: center;
    flex-shrink: 0;
    font-size: 17px;
}
.q-card-title { font-size: 15px; font-weight: 700; margin-bottom: 2px; }
.q-card-meta { display: flex; gap: 10px; color: var(--ink-soft); font-size: 12.5px; flex-wrap: wrap; }
.q-card-meta span { display: flex; align-items: center; gap: 4px; }
.q-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 12px; }

/* ===== Profile ===== */
.profile-head {
  background: var(--grad-ink); color: #fff;
  border-radius: var(--radius-lg); padding: 36px;
  display: flex; align-items: center; gap: 24px;
  margin-bottom: 24px; position: relative; overflow: hidden;
}
.profile-head::before {
  content: ''; position: absolute; right: -80px; top: -80px;
  width: 300px; height: 300px; border-radius: 50%;
  background: radial-gradient(circle, rgba(201,169,106,.25), transparent 70%);
}
.profile-avatar {
  width: 96px; height: 96px; border-radius: 50%;
  background: var(--grad-gold); display: grid; place-items: center;
  font-size: 32px; font-weight: 800; color: #fff;
  border: 4px solid rgba(255,255,255,.15); position: relative; z-index: 1;
  flex-shrink: 0;
}
.profile-info { position: relative; z-index: 1; }
.profile-name { font-family: var(--font-display); font-size: 28px; font-weight: 700; margin-bottom: 6px; }
.profile-meta { color: rgba(255,255,255,.75); font-size: 14.5px; }
.profile-meta b { color: var(--gold); font-weight: 600; }

/* ===== Mobile ===== */
@media (max-width: 1024px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
  .app { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; right: -300px; width: 280px; z-index: 50;
    transition: right .3s ease; box-shadow: var(--shadow-lg);
  }
  .sidebar.open { right: 0; }
  .main { padding: 18px; }
  .page-title { font-size: 22px; }
  .stats-grid { grid-template-columns: 1fr; }
  .auth-main { padding: 24px 18px; }
  .auth-hero h1 { font-size: 32px; }
  .quiz-body { padding: 18px; }
  .quiz-question-card { padding: 22px; }
  .quiz-q-text { font-size: 17px; }
}

.mobile-toggle {
  display: none; width: 40px; height: 40px;
  border-radius: 10px; background: var(--surface);
  border: 1px solid var(--line); align-items: center; justify-content: center;
}
@media (max-width: 768px) { .mobile-toggle { display: inline-flex; } }

/* ===== Misc helpers ===== */
.flex { display: flex; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.gap-2 { gap: 8px; } .gap-3 { gap: 12px; } .gap-4 { gap: 16px; }
.mb-2 { margin-bottom: 8px; } .mb-3 { margin-bottom: 12px; } .mb-4 { margin-bottom: 16px; } .mb-6 { margin-bottom: 24px; }
.mt-2 { margin-top: 8px; } .mt-4 { margin-top: 16px; }
.text-muted { color: var(--ink-soft); }
.text-sm { font-size: 13px; }
.text-lg { font-size: 17px; }
.fw-700 { font-weight: 700; }
.text-center { text-align: center; }
.hidden { display: none !important; }
.divider { height: 1px; background: var(--line-soft); margin: 18px 0; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 600px) { .grid-2 { grid-template-columns: 1fr; } }

/* Code/scrollbar */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--line); border-radius: 5px; }
::-webkit-scrollbar-thumb:hover { background: var(--muted); }

.swal2-confirm {
    outline: none !important;
    border: none !important;
}

.swal2-confirm:focus {
    outline: none !important;
    box-shadow: none !important;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.45);
    z-index: 199;
}
.sidebar-overlay.active { display: block; }
.sidebar { z-index: 200; }