/* =========================================================
   PM-SP 2026 — Painel de Estudos
   Design tokens: dark / navy / charcoal / gold
   Inspired by Notion, Linear, GitHub Projects, BI dashboards
   ========================================================= */

:root {
  /* ---- Color tokens ---- */
  --bg-app: #0a0d12;
  --bg-sidebar: #0d1117;
  --bg-card: #11151c;
  --bg-card-hover: #151a23;
  --bg-elevated: #1a2030;
  --bg-input: #0d1117;

  --border: #232938;
  --border-soft: #1a1f2b;

  --navy: #16223f;
  --navy-bright: #24365f;

  --gold: #d4af37;
  --gold-bright: #f0cf6a;
  --gold-dim: rgba(212, 175, 55, 0.16);

  --text-primary: #e9ebf0;
  --text-secondary: #9aa3b5;
  --text-tertiary: #5d6478;

  --success: #3ddc84;
  --success-dim: rgba(61, 220, 132, 0.14);
  --warning: #f2b94b;
  --warning-dim: rgba(242, 185, 75, 0.14);
  --danger: #e5484d;
  --danger-dim: rgba(229, 72, 77, 0.14);
  --info: #5b9bf2;
  --info-dim: rgba(91, 155, 242, 0.14);

  /* ---- Type ---- */
  --font-display: "Space Grotesk", "Inter", ui-sans-serif, system-ui, -apple-system, sans-serif;
  --font-body: "Inter", ui-sans-serif, system-ui, -apple-system, sans-serif;
  --font-mono: "JetBrains Mono", "SFMono-Regular", Consolas, monospace;

  /* ---- Layout ---- */
  --sidebar-w: 248px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --shadow-card: 0 1px 0 rgba(0,0,0,0.4), 0 8px 24px -12px rgba(0,0,0,0.6);
}

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

body {
  background: var(--bg-app);
  background-image:
    radial-gradient(circle at 12% 0%, rgba(212,175,55,0.05), transparent 40%),
    radial-gradient(circle at 100% 100%, rgba(36,54,95,0.18), transparent 45%);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0;
  color: var(--text-primary);
}

a { color: var(--gold); text-decoration: none; }
button { font-family: var(--font-body); }

::selection { background: var(--gold-dim); }

/* Scrollbar */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: var(--navy-bright); }

/* Focus visibility */
:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
  border-radius: 4px;
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

/* =========================================================
   APP SHELL
   ========================================================= */

.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 100vh;
}

/* ---- Sidebar ---- */
.sidebar {
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-soft);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 40;
  overflow: hidden;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 18px 16px;
  border-bottom: 1px solid var(--border-soft);
}

.sidebar-brand .crest {
  width: 34px; height: 34px;
  border-radius: var(--radius-sm);
  background: linear-gradient(155deg, var(--navy) 0%, #0c1426 100%);
  border: 1px solid var(--gold-dim);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--gold);
  font-size: 13px;
  flex-shrink: 0;
}

.sidebar-brand .brand-text { line-height: 1.2; min-width: 0; }
.sidebar-brand .brand-text strong {
  font-family: var(--font-display);
  font-size: 14.5px;
  color: var(--text-primary);
  display: block;
}
.sidebar-brand .brand-text span {
  font-size: 11px;
  color: var(--gold);
  font-family: var(--font-mono);
  letter-spacing: 0.04em;
}

.sidebar-countdown {
  margin: 14px 14px 6px;
  padding: 12px 12px;
  border-radius: var(--radius-md);
  background: linear-gradient(155deg, var(--navy) 0%, #0c1426 100%);
  border: 1px solid var(--border);
}
.sidebar-countdown .row { display: flex; justify-content: space-between; align-items: baseline; padding: 3px 0; }
.sidebar-countdown .row .lbl { font-size: 10.5px; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.05em; }
.sidebar-countdown .row .val { font-family: var(--font-mono); font-weight: 600; color: var(--gold-bright); font-size: 13px; }

.sidebar-nav { flex: 1; min-height: 0; overflow-y: auto; padding: 10px 10px; }
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 11px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
  margin-bottom: 1px;
  transition: background 0.12s, color 0.12s;
  user-select: none;
}
.nav-item .ic { width: 17px; height: 17px; flex-shrink: 0; opacity: 0.85; }
.nav-item:hover { background: var(--bg-card-hover); color: var(--text-primary); }
.nav-item.active {
  background: var(--gold-dim);
  color: var(--gold-bright);
  border-color: rgba(212,175,55,0.25);
}
.nav-item.active .ic { opacity: 1; }

.sidebar-footer {
  padding: 12px 10px 16px;
  border-top: 1px solid var(--border-soft);
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex-shrink: 0;
}
.sidebar-footer form { width: 100%; margin: 0; }
.sidebar-footer .btn-block { width: 100%; }
.sidebar-logout-form { margin-top: 4px; }

/* ---- Main ---- */
.main {
  min-width: 0;
  padding: 26px 32px 60px;
}

.view-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 22px;
}
.view-header h1 { font-size: 22px; }
.view-header .sub { color: var(--text-secondary); font-size: 13px; margin-top: 4px; }
.view-eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 6px;
  display: block;
}

.view { display: none; }
.view.active { display: block; animation: fadeIn 0.18s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }

/* =========================================================
   GRID / CARDS
   ========================================================= */

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  box-shadow: var(--shadow-card);
}

.stat-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.stat-card .stat-top { display: flex; align-items: center; justify-content: space-between; }
.stat-card .stat-label {
  font-size: 11.5px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.stat-card .stat-icon {
  width: 28px; height: 28px;
  border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
  background: var(--gold-dim);
  color: var(--gold);
  flex-shrink: 0;
}
.stat-card .stat-icon svg { width: 15px; height: 15px; }
.stat-card .stat-value {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text-primary);
}
.stat-card .stat-value .unit { font-size: 13px; font-weight: 500; color: var(--text-secondary); margin-left: 3px; }
.stat-card .stat-foot { font-size: 11.5px; color: var(--text-tertiary); }
.stat-card .stat-foot.up { color: var(--success); }
.stat-card .stat-foot.down { color: var(--danger); }

.card-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
@media (max-width: 980px) { .card-row { grid-template-columns: 1fr; } }

.card-title {
  font-family: var(--font-display);
  font-size: 14.5px;
  font-weight: 600;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.card-title .hint { font-size: 11.5px; color: var(--text-tertiary); font-weight: 400; font-family: var(--font-body); }

/* =========================================================
   PROGRESS BARS
   ========================================================= */

.progress-track {
  width: 100%;
  height: 10px;
  background: var(--bg-elevated);
  border-radius: 99px;
  overflow: hidden;
  border: 1px solid var(--border-soft);
}
.progress-fill {
  height: 100%;
  border-radius: 99px;
  transition: width 0.5s cubic-bezier(.2,.8,.2,1);
  background: var(--danger);
}
.progress-fill.lvl-red { background: linear-gradient(90deg, #c83b40, var(--danger)); }
.progress-fill.lvl-yellow { background: linear-gradient(90deg, #d99e2e, var(--warning)); }
.progress-fill.lvl-green { background: linear-gradient(90deg, #2bb673, var(--success)); }

.progress-meta { display: flex; justify-content: space-between; margin-top: 8px; font-size: 12px; color: var(--text-secondary); }
.progress-meta .pct { font-family: var(--font-mono); font-weight: 600; color: var(--text-primary); }

.progress-hero {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  margin-bottom: 22px;
}
.progress-hero .ph-top { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 14px; flex-wrap: wrap; gap: 10px;}
.progress-hero .ph-num { font-family: var(--font-display); font-size: 34px; font-weight: 700; }
.progress-hero .ph-num.red { color: var(--danger); }
.progress-hero .ph-num.yellow { color: var(--warning); }
.progress-hero .ph-num.green { color: var(--success); }
.progress-hero .progress-track { height: 14px; }

/* mini bar used inside subject rows / table cells */
.mini-bar-wrap { display: flex; align-items: center; gap: 8px; }
.mini-bar { flex: 1; height: 7px; background: var(--bg-elevated); border-radius: 99px; overflow: hidden; border: 1px solid var(--border-soft); }
.mini-bar-fill { height: 100%; border-radius: 99px; }

/* =========================================================
   BUTTONS / FORMS
   ========================================================= */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text-primary);
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s, transform 0.05s;
  white-space: nowrap;
}
.btn:hover {
  background: var(--danger-dim);
  border-color: rgba(229, 72, 77, 0.55);
  color: #ff8f93;
}
.btn:active { transform: translateY(1px); }
.btn svg { width: 14px; height: 14px; }

.btn-primary {
  background: linear-gradient(155deg, var(--gold-bright), var(--gold));
  color: #1a1304;
  border-color: var(--gold);
}
.btn-primary:hover {
  background: linear-gradient(155deg, #ff6b70, var(--danger));
  border-color: var(--danger);
  color: #fff;
  filter: none;
}

.btn-ghost { background: transparent; border-color: transparent; color: var(--text-secondary); }
.btn-ghost:hover {
  background: var(--danger-dim);
  color: #ff8f93;
  border-color: transparent;
}

.btn-danger { color: var(--danger); border-color: rgba(229,72,77,0.3); background: var(--danger-dim); }
.btn-danger:hover { background: rgba(229,72,77,0.35); border-color: var(--danger); color: #ffb0b3; }

.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-block { width: 100%; justify-content: center; }

.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

label.field-label {
  display: block;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

input, select, textarea {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  padding: 9px 11px;
  font-size: 13.5px;
  font-family: var(--font-body);
}
input:focus, select:focus, textarea:focus { border-color: var(--gold); outline: none; }
input[type="checkbox"] { width: 17px; height: 17px; accent-color: var(--gold); cursor: pointer; }

.field { margin-bottom: 13px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 560px) { .field-row { grid-template-columns: 1fr; } }

/* =========================================================
   TABLE
   ========================================================= */

.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius-md); }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
thead th {
  text-align: left;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-secondary);
  padding: 10px 14px;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
tbody td { padding: 10px 14px; border-bottom: 1px solid var(--border-soft); white-space: nowrap; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: var(--bg-card-hover); }
.table-wrap.scroll-y { max-height: 420px; overflow-y: auto; }

.empty-row td { text-align: center; color: var(--text-tertiary); padding: 28px; }

/* =========================================================
   BADGES / TAGS / PILLS
   ========================================================= */

.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 99px;
  font-size: 11.5px;
  font-weight: 600;
  font-family: var(--font-mono);
}
.pill-green { background: var(--success-dim); color: var(--success); }
.pill-yellow { background: var(--warning-dim); color: var(--warning); }
.pill-red { background: var(--danger-dim); color: var(--danger); }
.pill-info { background: var(--info-dim); color: var(--info); }
.pill-gold { background: var(--gold-dim); color: var(--gold-bright); }

/* =========================================================
   CRONOGRAMA
   ========================================================= */

.schedule-filters { display: flex; gap: 6px; margin-bottom: 16px; }
.filter-chip {
  padding: 6px 13px;
  border-radius: 99px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-secondary);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
}
.filter-chip.active { background: var(--gold-dim); color: var(--gold-bright); border-color: rgba(212,175,55,0.3); }

.day-list { display: flex; flex-direction: column; gap: 7px; }
.day-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.day-row:hover { border-color: var(--navy-bright); }
.day-row.done { border-left: 3px solid var(--success); }
.day-row.today { border-color: var(--gold); }
.day-row .dr-date { font-family: var(--font-mono); font-size: 13px; width: 150px; flex-shrink: 0; color: var(--text-primary); }
.day-row .dr-date .wk { color: var(--text-tertiary); font-size: 11px; margin-left: 6px; }
.day-row .dr-stats { display: flex; gap: 16px; flex: 1; color: var(--text-secondary); font-size: 12.5px; flex-wrap: wrap; }
.day-row .dr-stats b { color: var(--text-primary); font-family: var(--font-mono); }
.day-row .dr-note { color: var(--text-tertiary); font-size: 12px; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* =========================================================
   MODAL
   ========================================================= */

.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(5,7,10,0.7);
  backdrop-filter: blur(2px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 20px;
}
.modal-overlay.open { display: flex; }
.modal-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 460px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 22px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}
.modal-box.wide { max-width: 600px; }
.modal-box.quiz-modal {
  max-width: 760px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding-bottom: 18px;
}
.modal-box.quiz-modal .modal-head,
.modal-box.quiz-modal .modal-foot { flex-shrink: 0; }
.modal-box.quiz-modal .modal-foot { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border-soft); }
.quiz-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding-right: 4px;
  scrollbar-gutter: stable;
}
.modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.modal-head h3 { font-size: 16px; }
.modal-close { background: none; border: none; color: var(--text-secondary); cursor: pointer; font-size: 18px; line-height: 1; padding: 2px 6px; border-radius: 6px; }
.modal-close:hover { background: var(--bg-card-hover); color: var(--text-primary); }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }

/* =========================================================
   SUBJECT CARDS
   ========================================================= */

.subject-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); gap: 14px; }
.subject-card { display: flex; flex-direction: column; gap: 10px; }
.subject-card .sc-head { display: flex; justify-content: space-between; align-items: center; }
.subject-card .sc-name { font-family: var(--font-display); font-weight: 600; font-size: 15px; }
.subject-card .sc-nums { display: flex; justify-content: space-between; font-size: 12px; color: var(--text-secondary); }
.subject-card .sc-nums b { color: var(--text-primary); font-family: var(--font-mono); }

/* =========================================================
   GAUGE (Painel de Aprovação)
   ========================================================= */

.gauge-wrap { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.gauge-score { font-family: var(--font-display); font-size: 38px; font-weight: 700; margin-top: -42px; }
.gauge-label { font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.04em; text-transform: uppercase; }

/* =========================================================
   ACHIEVEMENTS
   ========================================================= */

.badge-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.badge {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px 12px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.badge.locked { opacity: 0.38; filter: grayscale(0.6); }
.badge .badge-icon {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--gold-dim);
  display: flex; align-items: center; justify-content: center;
  color: var(--gold);
  font-family: var(--font-display); font-weight: 700; font-size: 15px;
  border: 1px solid rgba(212,175,55,0.3);
}
.badge .badge-name { font-size: 12px; font-weight: 600; line-height: 1.3; }
.badge .badge-desc { font-size: 10.5px; color: var(--text-tertiary); }

/* =========================================================
   TOAST
   ========================================================= */

.toast-stack { position: fixed; bottom: 20px; right: 20px; z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; }
.toast {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-left: 3px solid var(--gold);
  border-radius: var(--radius-sm);
  padding: 11px 16px;
  font-size: 13px;
  box-shadow: var(--shadow-card);
  animation: toastIn 0.25s ease;
  max-width: 320px;
}
@keyframes toastIn { from { opacity: 0; transform: translateX(12px); } to { opacity: 1; transform: translateX(0); } }
.toast.achievement { border-left-color: var(--success); }

/* =========================================================
   PROJECTION NARRATIVE
   ========================================================= */

.narrative-box {
  background: var(--navy);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-primary);
}
.narrative-box .nb-tag { color: var(--gold); margin-right: 6px; }

/* =========================================================
   QUIZ / CADERNO DE QUESTÕES
   ========================================================= */

.quiz-toolbar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 12px;
  position: sticky;
  top: 0;
  z-index: 2;
  padding-bottom: 4px;
  background: linear-gradient(var(--bg-card) 75%, transparent);
}

.quiz-question {
  margin-bottom: 14px;
  padding: 16px;
}

.quiz-question:last-child { margin-bottom: 0; }

.quiz-meta {
  font-size: 11px;
  color: var(--text-tertiary);
  margin-bottom: 8px;
  line-height: 1.4;
}

.quiz-stem {
  font-size: 14px;
  line-height: 1.55;
  margin-bottom: 12px;
  color: var(--text-primary);
}

.quiz-stem-num {
  font-family: var(--font-mono);
  color: var(--gold-bright);
  margin-right: 4px;
}

.quiz-alts {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.quiz-alt {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-items: start;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-input);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.quiz-alt:hover:not(.is-locked) {
  border-color: var(--navy-bright);
  background: var(--bg-card-hover);
}

.quiz-alt.is-selected {
  border-color: var(--gold);
  background: var(--gold-dim);
  box-shadow: 0 0 0 1px rgba(212, 175, 55, 0.25);
}

.quiz-alt.is-correct {
  border-color: var(--success);
  background: var(--success-dim);
  cursor: default;
}

.quiz-alt.is-wrong {
  border-color: var(--danger);
  background: var(--danger-dim);
  cursor: default;
}

.quiz-alt.is-muted {
  opacity: 0.55;
  cursor: default;
}

.quiz-alt.is-locked { cursor: default; }

.quiz-alt-input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

.quiz-alt-letter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  color: var(--text-secondary);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  flex-shrink: 0;
}

.quiz-alt.is-selected .quiz-alt-letter {
  color: var(--gold-bright);
  border-color: rgba(212, 175, 55, 0.45);
  background: rgba(212, 175, 55, 0.12);
}

.quiz-alt.is-correct .quiz-alt-letter {
  color: var(--success);
  border-color: rgba(61, 220, 132, 0.45);
  background: rgba(61, 220, 132, 0.12);
}

.quiz-alt.is-wrong .quiz-alt-letter {
  color: var(--danger);
  border-color: rgba(229, 72, 77, 0.45);
  background: rgba(229, 72, 77, 0.12);
}

.quiz-alt-text {
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--text-primary);
  padding-top: 2px;
  word-break: break-word;
}

.quiz-actions {
  margin-top: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.quiz-explanation {
  margin-top: 12px;
  font-size: 12.5px;
  line-height: 1.55;
}

.quiz-ai-btn { margin-top: 8px; }

@media (max-width: 560px) {
  .modal-box.quiz-modal { max-width: 100%; }
  .quiz-question { padding: 14px 12px; }
  .quiz-alt { padding: 9px 10px; gap: 8px; }
  .quiz-alt-letter { width: 24px; height: 24px; font-size: 10px; }
  .quiz-alt-text { font-size: 13px; }
}

/* =========================================================
   CHARTS
   ========================================================= */

.chart-card { padding-bottom: 8px; }
.chart-box { position: relative; height: 260px; }
.chart-box.short { height: 200px; }

/* =========================================================
   RESPONSIVE
   ========================================================= */

.hamburger {
  display: none;
  position: fixed;
  top: 14px; left: 14px;
  z-index: 60;
  width: 38px; height: 38px;
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text-primary);
  align-items: center;
  justify-content: center;
}

@media (max-width: 880px) {
  .app-shell { grid-template-columns: 1fr; }
  .hamburger { display: flex; }
  .sidebar {
    position: fixed;
    left: 0; top: 0;
    transform: translateX(-100%);
    transition: transform 0.2s ease;
    width: min(82vw, 280px);
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar-scrim {
    display: none;
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 39;
  }
  .sidebar-scrim.open { display: block; }
  .main { padding: 70px 16px 60px; }
  .view-header h1 { font-size: 19px; }
  .stat-card .stat-value { font-size: 22px; }
}

@media (max-width: 560px) {
  .day-row { flex-wrap: wrap; }
  .day-row .dr-date { width: auto; }
  .modal-box { padding: 16px; }
}
