/* ==========================================================================
   Examprep Design System
   Tokens, layout primitives, components and application chrome.
   ========================================================================== */

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("../fonts/inter-latin.65850a373e25.woff2") format("woff2");
}

@font-face {
  font-family: "Plus Jakarta Sans";
  font-style: normal;
  font-weight: 500 800;
  font-display: swap;
  src: url("../fonts/jakarta-latin.52d04440a9fa.woff2") format("woff2");
}

:root {
  color-scheme: light;
  --font-sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-display: "Plus Jakarta Sans", "Inter", ui-sans-serif, system-ui, sans-serif;

  --primary: #5145e5;
  --primary-hover: #4338ca;
  --primary-active: #3730a3;
  --primary-soft: rgba(81, 69, 229, 0.09);
  --primary-softer: rgba(81, 69, 229, 0.05);
  --primary-text: #5145e5;
  --secondary: #2563eb;
  --secondary-soft: rgba(37, 99, 235, 0.09);
  --accent: #06b6d4;
  --accent-soft: rgba(6, 182, 212, 0.12);
  --success: #16a34a;
  --success-strong: #15803d;
  --success-soft: rgba(22, 163, 74, 0.1);
  --warning: #f59e0b;
  --warning-strong: #b45309;
  --warning-soft: rgba(245, 158, 11, 0.12);
  --danger: #dc2626;
  --danger-strong: #b91c1c;
  --danger-soft: rgba(220, 38, 38, 0.09);

  --bg: #f8fafc;
  --bg-soft: #f1f5f9;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --surface-3: #f1f5f9;
  --surface-elevated: #ffffff;
  --overlay: rgba(15, 23, 42, 0.55);
  --border: #e2e8f0;
  --border-strong: #cbd5e1;
  --text: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --text-subtle: #94a3b8;
  --text-inverse: #ffffff;

  --sidebar-bg: #ffffff;
  --topbar-bg: rgba(248, 250, 252, 0.82);
  --footer-bg: #0b1120;
  --footer-text: #cbd5e1;
  --glass: rgba(255, 255, 255, 0.74);

  --gradient-primary: linear-gradient(135deg, #5145e5 0%, #2563eb 100%);
  --gradient-accent: linear-gradient(135deg, #06b6d4 0%, #2563eb 100%);
  --gradient-soft: linear-gradient(180deg, rgba(81, 69, 229, 0.06), rgba(81, 69, 229, 0));

  --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.05);
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 12px 28px -12px rgba(15, 23, 42, 0.18), 0 2px 6px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 28px 60px -24px rgba(15, 23, 42, 0.26), 0 4px 12px rgba(15, 23, 42, 0.05);
  --shadow-primary: 0 14px 30px -12px rgba(81, 69, 229, 0.5);
  --ring: 0 0 0 4px rgba(81, 69, 229, 0.16);

  --radius-xs: 5px;
  --radius-sm: 7px;
  --radius: 9px;
  --radius-md: 10px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-full: 999px;

  --sidebar-w: 272px;
  --topbar-h: 72px;
  --container: 1200px;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --transition: 180ms var(--ease);
}

[data-theme="dark"] {
  color-scheme: dark;
  --primary: #7c74ff;
  --primary-hover: #928bff;
  --primary-active: #6d64f2;
  --primary-soft: rgba(124, 116, 255, 0.14);
  --primary-softer: rgba(124, 116, 255, 0.07);
  --primary-text: #a29cff;
  --secondary: #60a5fa;
  --secondary-soft: rgba(96, 165, 250, 0.14);
  --accent: #22d3ee;
  --accent-soft: rgba(34, 211, 238, 0.12);
  --success: #34d399;
  --success-strong: #6ee7b7;
  --success-soft: rgba(52, 211, 153, 0.12);
  --warning: #fbbf24;
  --warning-strong: #fcd34d;
  --warning-soft: rgba(251, 191, 36, 0.12);
  --danger: #f87171;
  --danger-strong: #fca5a5;
  --danger-soft: rgba(248, 113, 113, 0.12);

  --bg: #0b1120;
  --bg-soft: #0e1628;
  --surface: #151f32;
  --surface-2: #1a263c;
  --surface-3: #223049;
  --surface-elevated: #1a263c;
  --overlay: rgba(2, 6, 23, 0.72);
  --border: #243149;
  --border-strong: #33425e;
  --text: #e8eef8;
  --text-secondary: #c3cede;
  --text-muted: #94a3b8;
  --text-subtle: #73829b;
  --text-inverse: #0b1120;

  --sidebar-bg: #101a2c;
  --topbar-bg: rgba(11, 17, 32, 0.8);
  --footer-bg: #070c17;
  --footer-text: #94a3b8;
  --glass: rgba(21, 31, 50, 0.72);
  --gradient-soft: linear-gradient(180deg, rgba(124, 116, 255, 0.08), rgba(124, 116, 255, 0));

  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.35), 0 1px 2px rgba(0, 0, 0, 0.25);
  --shadow-md: 0 14px 32px -16px rgba(0, 0, 0, 0.6), 0 2px 6px rgba(0, 0, 0, 0.25);
  --shadow-lg: 0 30px 70px -28px rgba(0, 0, 0, 0.7), 0 4px 14px rgba(0, 0, 0, 0.28);
  --shadow-primary: 0 14px 34px -14px rgba(124, 116, 255, 0.55);
  --ring: 0 0 0 4px rgba(124, 116, 255, 0.22);
}

/* ---------- Reset & base ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

* {
  margin: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

img,
svg,
video {
  display: block;
  max-width: 100%;
}

img {
  height: auto;
}

input,
button,
textarea,
select {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  background: none;
  border: 0;
}

a {
  color: var(--primary-text);
  text-decoration: none;
  transition: color var(--transition);
}

a:hover {
  color: var(--primary-hover);
}

ul,
ol {
  padding: 0;
  list-style: none;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--text);
  text-wrap: balance;
}

h1 {
  font-size: clamp(2rem, 4vw, 3rem);
  letter-spacing: -0.035em;
}

h2 {
  font-size: clamp(1.5rem, 2.6vw, 2.1rem);
  letter-spacing: -0.03em;
}

h3 {
  font-size: 1.25rem;
}

h4 {
  font-size: 1.05rem;
}

p {
  color: var(--text-secondary);
}

strong {
  font-weight: 650;
}

hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 24px 0;
}

::selection {
  background: rgba(81, 69, 229, 0.22);
  color: var(--text);
}

:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

:focus:not(:focus-visible) {
  outline: none;
}

[hidden] {
  display: none !important;
}

/* ---------- Utilities ---------- */
.container {
  width: min(100% - 40px, var(--container));
  margin-inline: auto;
}

.container-wide {
  width: min(100% - 40px, 1420px);
  margin-inline: auto;
}

.container-narrow {
  width: min(100% - 40px, 780px);
  margin-inline: auto;
}

.stack > * + * {
  margin-top: var(--stack-gap, 16px);
}

.cluster {
  display: flex;
  flex-wrap: wrap;
  gap: var(--cluster-gap, 12px);
  align-items: center;
}

.between {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.grid {
  display: grid;
  gap: var(--grid-gap, 20px);
}

.grid-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.text-center {
  text-align: center;
}

.text-muted {
  color: var(--text-muted);
}

.text-success {
  color: var(--success);
}

.text-danger {
  color: var(--danger);
}

.text-warning {
  color: var(--warning-strong);
}

.text-primary {
  color: var(--primary-text);
}

.text-xs {
  font-size: 0.75rem;
}

.text-sm {
  font-size: 0.8375rem;
}

.text-lg {
  font-size: 1.075rem;
}

.font-display {
  font-family: var(--font-display);
}

.fw-600 {
  font-weight: 600;
}

.fw-700 {
  font-weight: 700;
}

.mt-0 { margin-top: 0 !important; }
.mt-1 { margin-top: 6px !important; }
.mt-2 { margin-top: 12px !important; }
.mt-3 { margin-top: 18px !important; }
.mt-4 { margin-top: 24px !important; }
.mt-5 { margin-top: 36px !important; }
.mb-0 { margin-bottom: 0 !important; }
.mb-1 { margin-bottom: 6px !important; }
.mb-2 { margin-bottom: 12px !important; }
.mb-3 { margin-bottom: 18px !important; }
.mb-4 { margin-bottom: 24px !important; }
.mb-5 { margin-bottom: 36px !important; }
.w-full { width: 100%; }
.nowrap { white-space: nowrap; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  top: -100px;
  left: 16px;
  z-index: 200;
  padding: 12px 18px;
  border-radius: var(--radius-sm);
  background: var(--primary);
  color: #fff;
  font-weight: 600;
}

.skip-link:focus {
  top: 16px;
  color: #fff;
}

/* ---------- Icons ---------- */
.icon {
  width: 20px;
  height: 20px;
  stroke-width: 1.9;
  flex: none;
}

[data-lucide] {
  width: 20px;
  height: 20px;
  stroke-width: 1.9;
}

.icon-sm [data-lucide],
[data-lucide].icon-sm {
  width: 16px;
  height: 16px;
}

.icon-lg [data-lucide],
[data-lucide].icon-lg {
  width: 24px;
  height: 24px;
}

/* ---------- Eyebrow / section headings ---------- */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--primary-text);
}

.eyebrow::before {
  content: "";
  width: 18px;
  height: 2px;
  border-radius: 2px;
  background: var(--primary);
}

.section {
  padding: clamp(56px, 8vw, 96px) 0;
}

.section-head {
  max-width: 680px;
  margin-bottom: clamp(28px, 4vw, 48px);
}

.section-head.center {
  margin-inline: auto;
  text-align: center;
}

.section-head.center .eyebrow::before {
  display: none;
}

.section-head h2 {
  margin: 14px 0 12px;
}

.section-head p {
  font-size: 1.02rem;
  color: var(--text-muted);
  max-width: 60ch;
}

.section-head.center p {
  margin-inline: auto;
}

.eyebrow-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* ---------- Buttons ---------- */
.btn {
  --btn-bg: var(--surface);
  --btn-color: var(--text);
  --btn-border: var(--border);
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 18px;
  border: 1px solid var(--btn-border);
  border-radius: var(--radius-sm);
  background: var(--btn-bg);
  color: var(--btn-color);
  font-family: var(--font-sans);
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  text-decoration: none;
  transition: transform var(--transition), box-shadow var(--transition),
    background var(--transition), border-color var(--transition), color var(--transition);
  user-select: none;
}

.btn:hover {
  transform: translateY(-1px);
  color: var(--btn-color);
}

.btn:active {
  transform: translateY(0);
}

.btn:disabled,
.btn.is-disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-primary {
  --btn-bg: var(--primary);
  --btn-color: #fff;
  --btn-border: transparent;
  box-shadow: var(--shadow-xs);
}

.btn-primary:hover {
  --btn-bg: var(--primary-hover);
  box-shadow: var(--shadow-primary);
}

.btn-secondary {
  --btn-bg: var(--surface);
  --btn-color: var(--text);
  --btn-border: var(--border);
  box-shadow: var(--shadow-xs);
}

.btn-secondary:hover {
  --btn-border: var(--border-strong);
  --btn-bg: var(--surface-2);
}

.btn-ghost {
  --btn-bg: transparent;
  --btn-color: var(--text-secondary);
  --btn-border: transparent;
}

.btn-ghost:hover {
  --btn-bg: var(--surface-3);
  --btn-color: var(--text);
}

.btn-soft {
  --btn-bg: var(--primary-soft);
  --btn-color: var(--primary-text);
  --btn-border: transparent;
}

.btn-soft:hover {
  --btn-bg: rgba(81, 69, 229, 0.16);
}

.btn-danger {
  --btn-bg: var(--danger);
  --btn-color: #fff;
  --btn-border: transparent;
}

.btn-danger:hover {
  --btn-bg: var(--danger-strong);
}

.btn-success {
  --btn-bg: var(--success);
  --btn-color: #fff;
  --btn-border: transparent;
}

.btn-success:hover {
  --btn-bg: var(--success-strong);
}

.btn-outline {
  --btn-bg: transparent;
  --btn-color: var(--text);
  --btn-border: var(--border-strong);
}

.btn-outline:hover {
  --btn-border: var(--primary);
  --btn-color: var(--primary-text);
  --btn-bg: var(--primary-softer);
}

.btn-white {
  --btn-bg: #fff;
  --btn-color: #241c9e;
  --btn-border: transparent;
}

.btn-white:hover {
  --btn-bg: #f5f5ff;
}

.btn-lg {
  min-height: 52px;
  padding: 14px 24px;
  font-size: 0.95rem;
  border-radius: var(--radius);
}

.btn-sm {
  min-height: 34px;
  padding: 6px 12px;
  font-size: 0.78rem;
  border-radius: var(--radius-xs);
  gap: 6px;
}

.btn-sm [data-lucide] {
  width: 15px;
  height: 15px;
}

.btn-icon {
  width: 42px;
  min-height: 42px;
  padding: 0;
  border-radius: var(--radius-sm);
}

.btn-icon.btn-sm {
  width: 34px;
  min-height: 34px;
}

.btn-block {
  width: 100%;
}

.btn.is-loading {
  color: transparent !important;
  pointer-events: none;
}

.btn.is-loading::after {
  content: "";
  position: absolute;
  inset: 0;
  margin: auto;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  animation: spin 0.7s linear infinite;
}

.btn-secondary.is-loading::after,
.btn-ghost.is-loading::after,
.btn-outline.is-loading::after {
  border-color: var(--border-strong);
  border-top-color: var(--primary);
}

.btn-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--primary-text);
  font-size: 0.85rem;
  font-weight: 600;
  background: none;
  padding: 0;
}

.btn-link:hover {
  gap: 10px;
}

.btn-link [data-lucide] {
  width: 16px;
  height: 16px;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ---------- Badges, chips & pills ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 9px;
  border-radius: var(--radius-full);
  font-size: 0.71rem;
  font-weight: 650;
  line-height: 1.4;
  white-space: nowrap;
  background: var(--surface-3);
  color: var(--text-secondary);
  border: 1px solid transparent;
}

.badge [data-lucide] {
  width: 12px;
  height: 12px;
}

.badge-primary {
  background: var(--primary-soft);
  color: var(--primary-text);
}

.badge-success {
  background: var(--success-soft);
  color: var(--success-strong);
}

.badge-warning {
  background: var(--warning-soft);
  color: var(--warning-strong);
}

.badge-danger {
  background: var(--danger-soft);
  color: var(--danger-strong);
}

.badge-accent {
  background: var(--accent-soft);
  color: var(--accent);
}

.badge-neutral {
  background: var(--surface-3);
  color: var(--text-muted);
}

[data-theme="dark"] .badge-success { color: var(--success); }
[data-theme="dark"] .badge-warning { color: var(--warning); }
[data-theme="dark"] .badge-danger { color: var(--danger); }
[data-theme="dark"] .badge-accent { color: var(--accent); }

.dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  flex: none;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  font-size: 0.76rem;
  font-weight: 550;
  color: var(--text-secondary);
  white-space: nowrap;
}

.chip .dot {
  background: var(--primary);
}

.chip-muted {
  background: var(--surface-3);
  color: var(--text-muted);
}

.pill-count {
  display: inline-grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: var(--radius-full);
  background: var(--surface-3);
  color: var(--text-muted);
  font-size: 0.68rem;
  font-weight: 700;
}

/* ---------- Cards ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
}

.card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 24px 0;
}

.card-body {
  padding: 24px;
}

.card-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.card-title {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.015em;
}

.card-subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 3px;
}

.card-hover {
  transition: transform var(--transition), box-shadow var(--transition),
    border-color var(--transition);
}

.card-hover:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-strong);
}

.panel {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
}

.callout {
  display: flex;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-left: 3px solid var(--primary);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.callout [data-lucide] {
  color: var(--primary);
  flex: none;
  margin-top: 1px;
}

.callout-warning {
  border-left-color: var(--warning);
  background: var(--warning-soft);
}

.callout-warning [data-lucide] {
  color: var(--warning-strong);
}

.callout-danger {
  border-left-color: var(--danger);
  background: var(--danger-soft);
}

.callout-danger [data-lucide] {
  color: var(--danger);
}

.callout-success {
  border-left-color: var(--success);
  background: var(--success-soft);
}

.callout-success [data-lucide] {
  color: var(--success);
}

/* ---------- Forms ---------- */
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.form-group {
  margin-bottom: 18px;
}

.form-grid > .form-group {
  margin-bottom: 0;
}

.form-group.full {
  grid-column: 1 / -1;
}

.form-label {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 7px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
}

.form-label .required {
  color: var(--danger);
}

.form-control,
.form-select,
textarea.form-control {
  width: 100%;
  min-height: 46px;
  padding: 11px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-size: 0.9rem;
  line-height: 1.45;
  transition: border-color var(--transition), box-shadow var(--transition),
    background var(--transition);
  appearance: none;
}

.form-control::placeholder {
  color: var(--text-subtle);
}

.form-control:hover,
.form-select:hover {
  border-color: var(--border-strong);
}

.form-control:focus,
.form-select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: var(--ring);
}

.form-select {
  padding-right: 40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 16px;
}

[data-theme="dark"] .form-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
}

textarea.form-control {
  min-height: 110px;
  resize: vertical;
}

.form-control[type="file"] {
  padding: 9px 12px;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.form-control[type="file"]::file-selector-button {
  margin-right: 12px;
  padding: 7px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  background: var(--surface-2);
  color: var(--text);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
}

.form-hint,
.form-help {
  margin-top: 6px;
  font-size: 0.76rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.form-error {
  margin-top: 6px;
  font-size: 0.76rem;
  font-weight: 500;
  color: var(--danger);
  display: flex;
  align-items: flex-start;
  gap: 5px;
}

.form-error::before {
  content: "!";
  display: inline-grid;
  place-items: center;
  width: 14px;
  height: 14px;
  flex: none;
  border-radius: 50%;
  background: var(--danger-soft);
  color: var(--danger);
  font-size: 0.65rem;
  font-weight: 800;
  margin-top: 1px;
}

.form-control.has-error,
.form-select.has-error {
  border-color: var(--danger);
  background: var(--danger-soft);
}

.field-errors {
  margin-top: 6px;
  padding: 0;
  list-style: none;
  color: var(--danger);
  font-size: 0.76rem;
}

.form-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  font-size: 0.84rem;
  color: var(--text-secondary);
}

.form-check input[type="checkbox"],
.form-check input[type="radio"] {
  width: 18px;
  height: 18px;
  margin-top: 1px;
  flex: none;
  accent-color: var(--primary);
  cursor: pointer;
}

.form-check a {
  font-weight: 600;
}

.form-row-inline {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.input-icon-wrap {
  position: relative;
}

.input-icon-wrap [data-lucide] {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--text-subtle);
  pointer-events: none;
}

.input-icon-wrap .form-control {
  padding-left: 42px;
}

.password-wrap {
  position: relative;
}

.password-wrap .form-control {
  padding-right: 46px;
}

.password-toggle {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: var(--radius-xs);
  color: var(--text-muted);
}

.password-toggle:hover {
  background: var(--surface-3);
  color: var(--text);
}

.form-section-title {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding-bottom: 10px;
  margin: 8px 0 18px;
  border-bottom: 1px solid var(--border);
}

.form-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
  padding-top: 20px;
  margin-top: 8px;
  border-top: 1px solid var(--border);
}

/* Custom file/avatar upload */
.avatar-upload {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}

.avatar-upload__preview {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--primary-soft);
  border: 2px solid var(--surface);
  box-shadow: var(--shadow-sm);
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--primary-text);
  font-size: 1.4rem;
  flex: none;
}

.avatar-upload__preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ---------- Avatars ---------- */
.avatar {
  --avatar-size: 40px;
  width: var(--avatar-size);
  height: var(--avatar-size);
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  flex: none;
  overflow: hidden;
  background: var(--primary-soft);
  color: var(--primary-text);
  font-weight: 700;
  font-size: calc(var(--avatar-size) * 0.34);
  border: 1px solid var(--border);
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar-sm {
  --avatar-size: 32px;
}

.avatar-lg {
  --avatar-size: 56px;
}

.avatar-xl {
  --avatar-size: 84px;
}

.avatar-gradient {
  background: var(--gradient-primary);
  color: #fff;
  border-color: transparent;
}

/* ---------- Progress ---------- */
.progress {
  height: 8px;
  width: 100%;
  border-radius: var(--radius-full);
  background: var(--surface-3);
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  border-radius: inherit;
  background: var(--gradient-primary);
  transition: width 0.5s var(--ease);
}

.progress-bar.success { background: var(--success); }
.progress-bar.warning { background: var(--warning); }
.progress-bar.danger { background: var(--danger); }

.progress-sm { height: 5px; }
.progress-lg { height: 12px; }

.progress-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.progress-meta strong {
  color: var(--text);
  font-weight: 600;
}

/* ---------- Alerts & toasts ---------- */
.alert {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 18px;
}

.alert [data-lucide] {
  flex: none;
  margin-top: 1px;
}

.alert-success { border-color: rgba(22, 163, 74, 0.28); background: var(--success-soft); }
.alert-success [data-lucide] { color: var(--success); }
.alert-error { border-color: rgba(220, 38, 38, 0.28); background: var(--danger-soft); }
.alert-error [data-lucide] { color: var(--danger); }
.alert-warning { border-color: rgba(245, 158, 11, 0.3); background: var(--warning-soft); }
.alert-warning [data-lucide] { color: var(--warning-strong); }
.alert-info { border-color: rgba(37, 99, 235, 0.24); background: var(--secondary-soft); }
.alert-info [data-lucide] { color: var(--secondary); }

.alert strong {
  display: block;
  color: var(--text);
  font-weight: 650;
  margin-bottom: 2px;
}

.toast-stack {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: min(380px, calc(100vw - 32px));
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 14px 15px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface-elevated);
  box-shadow: var(--shadow-lg);
  font-size: 0.84rem;
  animation: toast-in 0.35s var(--ease) both;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.toast.is-leaving {
  opacity: 0;
  transform: translateY(8px);
}

.toast__icon {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  flex: none;
  background: var(--surface-3);
  color: var(--text-muted);
}

.toast--success .toast__icon { background: var(--success-soft); color: var(--success); }
.toast--error .toast__icon { background: var(--danger-soft); color: var(--danger); }
.toast--warning .toast__icon { background: var(--warning-soft); color: var(--warning-strong); }
.toast--info .toast__icon { background: var(--secondary-soft); color: var(--secondary); }

.toast__body {
  flex: 1;
  min-width: 0;
  color: var(--text-secondary);
  padding-top: 1px;
}

.toast__body strong {
  display: block;
  color: var(--text);
  font-weight: 650;
}

.toast__close {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  color: var(--text-subtle);
  flex: none;
}

.toast__close:hover {
  background: var(--surface-3);
  color: var(--text);
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
  }
}

/* ---------- Modals ---------- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 400;
  display: grid;
  place-items: center;
  padding: 20px;
  background: var(--overlay);
  backdrop-filter: blur(3px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.modal.is-open {
  opacity: 1;
  visibility: visible;
}

.modal__dialog {
  width: min(100%, 480px);
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  transform: translateY(12px) scale(0.98);
  transition: transform 0.25s var(--ease);
}

.modal.is-open .modal__dialog {
  transform: translateY(0) scale(1);
}

.modal__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 24px 24px 0;
}

.modal__title {
  font-size: 1.1rem;
  font-weight: 700;
}

.modal__body {
  padding: 14px 24px 22px;
  color: var(--text-secondary);
  font-size: 0.88rem;
}

.modal__footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 0 24px 24px;
  flex-wrap: wrap;
}

.modal__close {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: var(--radius-xs);
  color: var(--text-muted);
  flex: none;
}

.modal__close:hover {
  background: var(--surface-3);
  color: var(--text);
}

.modal--wide .modal__dialog {
  width: min(100%, 720px);
}

body.modal-open {
  overflow: hidden;
}

/* ---------- Dropdowns ---------- */
.dropdown {
  position: relative;
}

.dropdown__menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 120;
  width: 260px;
  padding: 6px;
  background: var(--surface-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity 0.16s ease, transform 0.16s ease, visibility 0.16s;
}

.dropdown.is-open .dropdown__menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown__menu--wide {
  width: 360px;
}

.dropdown__item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 11px;
  border-radius: var(--radius-xs);
  color: var(--text-secondary);
  font-size: 0.84rem;
  font-weight: 500;
  text-align: left;
  transition: background var(--transition), color var(--transition);
}

.dropdown__item:hover {
  background: var(--surface-2);
  color: var(--text);
}

.dropdown__item [data-lucide] {
  width: 17px;
  height: 17px;
  color: var(--text-muted);
}

.dropdown__item--danger {
  color: var(--danger);
}

.dropdown__item--danger [data-lucide] {
  color: var(--danger);
}

.dropdown__divider {
  height: 1px;
  margin: 6px 4px;
  background: var(--border);
}

.dropdown__header {
  padding: 10px 12px 8px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--text-subtle);
}

.dropdown__foot {
  border-top: 1px solid var(--border);
  margin-top: 6px;
  padding: 7px 4px 2px;
}

/* ---------- Tables ---------- */
.table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  -webkit-overflow-scrolling: touch;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.84rem;
  min-width: 620px;
}

.table thead th {
  padding: 12px 16px;
  text-align: left;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.table tbody td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  color: var(--text-secondary);
}

.table tbody tr:last-child td {
  border-bottom: 0;
}

.table tbody tr {
  transition: background var(--transition);
}

.table tbody tr:hover {
  background: var(--surface-2);
}

.table strong {
  color: var(--text);
  font-weight: 600;
}

.table .cell-actions {
  text-align: right;
  white-space: nowrap;
}

.table--compact tbody td,
.table--compact thead th {
  padding: 10px 12px;
}

.table-empty {
  padding: 48px 24px;
  text-align: center;
  color: var(--text-muted);
}

/* ---------- Pagination & breadcrumb ---------- */
.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 24px;
}

.pagination__pages {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}

.pagination__link {
  min-width: 36px;
  height: 36px;
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  background: var(--surface);
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 600;
}

.pagination__link:hover {
  border-color: var(--primary);
  color: var(--primary-text);
}

.pagination__link.is-active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.pagination__link.is-disabled {
  opacity: 0.45;
  pointer-events: none;
}

.pagination__info {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
  font-size: 0.76rem;
  color: var(--text-muted);
  margin-bottom: 14px;
}

.breadcrumb a {
  color: var(--text-muted);
}

.breadcrumb a:hover {
  color: var(--primary-text);
}

.breadcrumb [data-lucide] {
  width: 13px;
  height: 13px;
  color: var(--text-subtle);
}

.breadcrumb__current {
  color: var(--text-secondary);
  font-weight: 550;
}

/* ---------- Page header & tabs ---------- */
.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 26px;
}

.page-head__title {
  font-size: clamp(1.4rem, 2.2vw, 1.8rem);
  letter-spacing: -0.03em;
  margin-bottom: 5px;
}

.page-head__sub {
  font-size: 0.86rem;
  color: var(--text-muted);
  max-width: 65ch;
}

.page-head__actions {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
}

.page-section {
  margin-bottom: 30px;
}

.section-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.section-label h2,
.section-label h3 {
  font-size: 1.02rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.section-label a {
  font-size: 0.78rem;
  font-weight: 600;
}

.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 22px;
  overflow-x: auto;
  scrollbar-width: none;
}

.tabs::-webkit-scrollbar {
  display: none;
}

.tab {
  padding: 11px 14px;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  font-size: 0.84rem;
  font-weight: 600;
  white-space: nowrap;
  margin-bottom: -1px;
}

.tab:hover {
  color: var(--text);
}

.tab.is-active {
  color: var(--primary-text);
  border-bottom-color: var(--primary);
}

/* ---------- Empty state / skeleton / spinner ---------- */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 56px 24px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-lg);
  background: var(--surface-2);
}

.empty-state__icon {
  width: 62px;
  height: 62px;
  border-radius: 20px;
  display: grid;
  place-items: center;
  background: var(--primary-soft);
  color: var(--primary-text);
  margin-bottom: 16px;
}

.empty-state__icon [data-lucide] {
  width: 28px;
  height: 28px;
}

.empty-state h3 {
  font-size: 1.02rem;
  margin-bottom: 6px;
}

.empty-state p {
  font-size: 0.85rem;
  color: var(--text-muted);
  max-width: 46ch;
  margin-bottom: 18px;
}

.skeleton {
  position: relative;
  overflow: hidden;
  background: var(--surface-3);
  border-radius: var(--radius-xs);
}

.skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.28), transparent);
  animation: shimmer 1.4s infinite;
}

[data-theme="dark"] .skeleton::after {
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.06), transparent);
}

.skeleton-text {
  height: 12px;
  margin-bottom: 8px;
}

.skeleton-text.w-75 { width: 75%; }
.skeleton-text.w-50 { width: 50%; }

@keyframes shimmer {
  100% {
    transform: translateX(100%);
  }
}

.skeleton-card {
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
}

.loading-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: var(--glass);
  backdrop-filter: blur(2px);
  z-index: 5;
  border-radius: inherit;
}

/* ---------- Public header & footer ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 90;
  background: var(--glass);
  backdrop-filter: blur(16px) saturate(160%);
  border-bottom: 1px solid transparent;
  transition: border-color var(--transition), box-shadow var(--transition),
    background var(--transition);
}

.site-header.is-scrolled {
  border-bottom-color: var(--border);
  box-shadow: var(--shadow-xs);
}

.site-header__inner {
  display: flex;
  align-items: center;
  gap: 26px;
  height: 72px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-family: var(--font-display);
  font-size: 1.06rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  flex: none;
}

.brand:hover {
  color: var(--text);
}

.brand__mark {
  width: 36px;
  height: 36px;
  border-radius: 11px;
  background: var(--gradient-primary);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 1.02rem;
  font-weight: 800;
  letter-spacing: -0.05em;
  box-shadow: var(--shadow-primary);
  position: relative;
  overflow: hidden;
}

.brand__mark::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 70% 15%, rgba(255, 255, 255, 0.35), transparent 55%);
}

.brand__text small {
  display: block;
  font-family: var(--font-sans);
  font-size: 0.56rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-subtle);
  line-height: 1.2;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-left: 8px;
}

.site-nav a {
  padding: 8px 11px;
  border-radius: var(--radius-xs);
  color: var(--text-secondary);
  font-size: 0.84rem;
  font-weight: 550;
  transition: background var(--transition), color var(--transition);
}

.site-nav a:hover,
.site-nav a.is-active {
  background: var(--surface-3);
  color: var(--text);
}

.site-header__actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

.theme-toggle {
  position: relative;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-secondary);
  transition: background var(--transition), border-color var(--transition),
    color var(--transition);
}

.theme-toggle:hover {
  background: var(--surface-2);
  border-color: var(--border-strong);
  color: var(--text);
}

.theme-toggle [data-lucide] {
  width: 18px;
  height: 18px;
}

.theme-toggle .icon-moon {
  display: none;
}

[data-theme="dark"] .theme-toggle .icon-sun {
  display: none;
}

[data-theme="dark"] .theme-toggle .icon-moon {
  display: block;
}

.theme-toggle--plain {
  border-color: transparent;
  background: transparent;
}

.mobile-toggle {
  display: none;
  width: 40px;
  height: 40px;
  place-items: center;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
}

.mobile-menu {
  position: fixed;
  inset: 72px 0 0;
  z-index: 89;
  background: var(--bg);
  padding: 22px;
  overflow-y: auto;
  transform: translateX(100%);
  transition: transform 0.28s var(--ease);
  visibility: hidden;
}

.mobile-menu.is-open {
  transform: translateX(0);
  visibility: visible;
}

.mobile-menu nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 22px;
}

.mobile-menu nav a {
  padding: 13px 14px;
  border-radius: var(--radius-sm);
  color: var(--text);
  font-weight: 600;
  font-size: 0.95rem;
}

.mobile-menu nav a:hover {
  background: var(--surface);
}

.mobile-menu__actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.site-footer {
  background: var(--footer-bg);
  color: var(--footer-text);
  padding: 64px 0 28px;
  margin-top: auto;
}

.site-footer h4 {
  color: #fff;
  font-family: var(--font-sans);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 16px;
}

.site-footer .brand {
  color: #fff;
  margin-bottom: 16px;
}

.site-footer .brand small {
  color: rgba(255, 255, 255, 0.5);
}

.site-footer__grid {
  display: grid;
  grid-template-columns: 1.7fr repeat(3, 1fr);
  gap: 40px;
}

.site-footer__about p {
  color: rgba(226, 232, 240, 0.72);
  font-size: 0.85rem;
  max-width: 34ch;
  margin-bottom: 18px;
}

.site-footer__links {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.site-footer__links a {
  color: var(--footer-text);
  font-size: 0.84rem;
  opacity: 0.82;
}

.site-footer__links a:hover {
  color: #fff;
  opacity: 1;
}

.site-footer__bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 48px;
  padding-top: 22px;
  border-top: 1px solid rgba(255, 255, 255, 0.09);
  font-size: 0.76rem;
  color: rgba(148, 163, 184, 0.9);
}

.site-footer__social {
  display: flex;
  gap: 8px;
}

.site-footer__social a {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #cbd5e1;
}

.site-footer__social a:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.site-footer__social [data-lucide] {
  width: 16px;
  height: 16px;
}

.newsletter {
  display: flex;
  gap: 8px;
  margin-top: 16px;
  max-width: 360px;
}

.newsletter .form-control {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.12);
  color: #fff;
  min-height: 42px;
}

.newsletter .form-control::placeholder {
  color: rgba(226, 232, 240, 0.45);
}

.newsletter .btn {
  flex: none;
}

.promo-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 9px 44px 9px 20px;
  background: var(--gradient-primary);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 500;
  position: relative;
  z-index: 91;
}

.promo-banner a {
  color: #fff;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.promo-banner__close {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: rgba(255, 255, 255, 0.8);
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 6px;
}

.promo-banner__close:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
}

/* ---------- Auth layout ---------- */
.auth-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  background: var(--bg);
}

.auth-aside {
  position: relative;
  overflow: hidden;
  padding: clamp(32px, 5vw, 64px);
  background: linear-gradient(150deg, #2d27a8 0%, #5145e5 42%, #2563eb 100%);
  color: #fff;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 100vh;
}

.auth-aside::before,
.auth-aside::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}

.auth-aside::before {
  width: 520px;
  height: 520px;
  right: -220px;
  top: -160px;
  background: radial-gradient(circle, rgba(6, 182, 212, 0.5), transparent 65%);
}

.auth-aside::after {
  width: 420px;
  height: 420px;
  left: -160px;
  bottom: -180px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.16), transparent 65%);
}

.auth-aside__content {
  position: relative;
  z-index: 1;
}

.auth-aside .brand {
  color: #fff;
}

.auth-aside .brand small {
  color: rgba(255, 255, 255, 0.58);
}

.auth-aside h1 {
  font-size: clamp(2rem, 3.2vw, 3rem);
  color: #fff;
  line-height: 1.12;
  margin: 36px 0 18px;
  max-width: 15ch;
}

.auth-aside p {
  color: rgba(255, 255, 255, 0.78);
  max-width: 42ch;
  font-size: 0.94rem;
}

.auth-feature-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 32px;
}

.auth-feature-list li {
  display: flex;
  align-items: center;
  gap: 12px;
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.86rem;
}

.auth-feature-list__icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.14);
  flex: none;
}

.auth-feature-list__icon [data-lucide] {
  width: 17px;
  height: 17px;
}

.auth-aside__foot {
  position: relative;
  z-index: 1;
  font-size: 0.76rem;
  color: rgba(255, 255, 255, 0.5);
}

.auth-main {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding: 28px clamp(20px, 5vw, 56px);
}

.auth-main__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.auth-main__top .brand {
  display: none;
}

.auth-card {
  width: min(100%, 440px);
  margin: auto;
  padding: 20px 0;
}

.auth-card h2 {
  font-size: clamp(1.55rem, 2.4vw, 2rem);
  margin-bottom: 8px;
}

.auth-card__sub {
  color: var(--text-muted);
  font-size: 0.88rem;
  margin-bottom: 28px;
}

.auth-card__foot {
  margin-top: 24px;
  text-align: center;
  font-size: 0.84rem;
  color: var(--text-muted);
}

.auth-card .form-control {
  min-height: 48px;
}

.auth-links {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 20px;
  font-size: 0.8rem;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 22px 0;
  color: var(--text-subtle);
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

.auth-note {
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--primary-softer);
  border: 1px solid var(--border);
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.55;
}

/* ---------- App shell ---------- */
.app-shell {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 80;
  width: var(--sidebar-w);
  display: flex;
  flex-direction: column;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border);
  transition: transform 0.28s var(--ease);
}

.sidebar__head {
  display: flex;
  align-items: center;
  min-height: var(--topbar-h);
  padding: 0 20px;
  border-bottom: 1px solid var(--border);
}

.sidebar__body {
  flex: 1;
  overflow-y: auto;
  padding: 18px 12px 20px;
  scrollbar-width: thin;
}

.sidebar__nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sidebar__section {
  padding: 18px 12px 7px;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--text-subtle);
}

.sidebar__link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.845rem;
  font-weight: 540;
  transition: background var(--transition), color var(--transition);
}

.sidebar__link [data-lucide] {
  width: 19px;
  height: 19px;
  color: var(--text-muted);
  transition: color var(--transition);
}

.sidebar__link:hover {
  background: var(--surface-2);
  color: var(--text);
}

.sidebar__link.is-active {
  background: var(--primary-soft);
  color: var(--primary-text);
  font-weight: 650;
}

.sidebar__link.is-active [data-lucide] {
  color: var(--primary-text);
}

.sidebar__link.is-active::before {
  content: "";
  position: absolute;
  left: -12px;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 20px;
  border-radius: 0 4px 4px 0;
  background: var(--primary);
}

.sidebar__badge {
  margin-left: auto;
}

.sidebar__foot {
  padding: 14px;
  border-top: 1px solid var(--border);
}

.sidebar-profile {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  border: 1px solid var(--border);
}

.sidebar-profile__meta {
  min-width: 0;
  flex: 1;
}

.sidebar-profile__name {
  font-size: 0.8rem;
  font-weight: 650;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-profile__exam {
  font-size: 0.68rem;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-profile [data-lucide] {
  width: 16px;
  height: 16px;
  color: var(--text-subtle);
}

.sidebar__overlay {
  display: none;
}

.main-wrap {
  flex: 1;
  min-width: 0;
  margin-left: var(--sidebar-w);
  display: flex;
  flex-direction: column;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 70;
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 clamp(16px, 3vw, 34px);
  background: var(--topbar-bg);
  backdrop-filter: blur(16px) saturate(150%);
  border-bottom: 1px solid var(--border);
}

.topbar__menu {
  display: none;
  width: 40px;
  height: 40px;
  place-items: center;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
}

.topbar__menu:hover {
  background: var(--surface-3);
}

.topbar__crumb {
  min-width: 0;
}

.topbar__crumb-title {
  font-family: var(--font-display);
  font-size: 0.96rem;
  font-weight: 700;
  letter-spacing: -0.015em;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar__crumb-sub {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.topbar__spacer {
  flex: 1;
}

.topbar__actions {
  display: flex;
  align-items: center;
  gap: 7px;
}

.topbar__icon-btn {
  position: relative;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  color: var(--text-secondary);
}

.topbar__icon-btn:hover {
  background: var(--surface-3);
  color: var(--text);
}

.topbar__icon-btn [data-lucide] {
  width: 19px;
  height: 19px;
}

.notification-badge {
  position: absolute;
  top: 5px;
  right: 4px;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  display: grid;
  place-items: center;
  border-radius: var(--radius-full);
  background: var(--danger);
  color: #fff;
  font-size: 0.58rem;
  font-weight: 700;
  border: 2px solid var(--topbar-bg);
}

.topbar-avatar {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 4px 8px 4px 4px;
  border-radius: var(--radius-full);
  border: 1px solid transparent;
  margin-left: 4px;
}

.topbar-avatar:hover {
  background: var(--surface-3);
}

.topbar-avatar__name {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text);
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-main {
  flex: 1;
  padding: 28px clamp(16px, 3vw, 36px) 72px;
  width: 100%;
  max-width: 1500px;
  margin: 0 auto;
}

.mobile-bottom-nav {
  display: none;
}

/* Notification dropdown */
.notification-item {
  display: flex;
  gap: 11px;
  padding: 11px 12px;
  border-radius: var(--radius-xs);
  transition: background var(--transition);
}

.notification-item:hover {
  background: var(--surface-2);
}

.notification-item__icon {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  background: var(--primary-soft);
  color: var(--primary-text);
  flex: none;
}

.notification-item__icon [data-lucide] {
  width: 16px;
  height: 16px;
}

.notification-item__body {
  min-width: 0;
  flex: 1;
}

.notification-item__title {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.4;
}

.notification-item__time {
  font-size: 0.68rem;
  color: var(--text-subtle);
  margin-top: 2px;
}

.notification-item.is-unread {
  background: var(--primary-softer);
}

.notification-item.is-unread .notification-item__title::after {
  content: "";
  display: inline-block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--primary);
  margin-left: 6px;
  vertical-align: middle;
}

/* ---------- Dashboard ---------- */
.welcome {
  position: relative;
  overflow: hidden;
  padding: clamp(22px, 3vw, 32px);
  border-radius: var(--radius-xl);
  background: var(--gradient-primary);
  color: #fff;
  margin-bottom: 26px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}

.welcome::before {
  content: "";
  position: absolute;
  width: 340px;
  height: 340px;
  border-radius: 50%;
  right: -80px;
  top: -160px;
  background: radial-gradient(circle, rgba(6, 182, 212, 0.42), transparent 65%);
}

.welcome::after {
  content: "";
  position: absolute;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  right: 180px;
  bottom: -200px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.14), transparent 65%);
}

.welcome__main {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 18px;
  min-width: 0;
}

.welcome__avatar {
  --avatar-size: 64px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  font-size: 1.3rem;
}

.welcome h1 {
  color: #fff;
  font-size: clamp(1.35rem, 2.4vw, 1.8rem);
  margin-bottom: 4px;
}

.welcome p {
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.86rem;
  max-width: 56ch;
}

.welcome__actions {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.welcome__countdown {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.welcome__countdown strong {
  font-family: var(--font-display);
  font-size: 1.3rem;
  line-height: 1;
  color: #fff;
}

.welcome__countdown span {
  font-size: 0.68rem;
  color: rgba(255, 255, 255, 0.72);
  display: block;
}

.welcome .btn-white {
  color: #2d27a8;
}

.welcome .btn-outline {
  --btn-color: #fff;
  --btn-border: rgba(255, 255, 255, 0.35);
  --btn-bg: rgba(255, 255, 255, 0.08);
}

.welcome .btn-outline:hover {
  --btn-bg: rgba(255, 255, 255, 0.16);
  --btn-color: #fff;
  --btn-border: rgba(255, 255, 255, 0.5);
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 17px;
  transition: border-color var(--transition), transform var(--transition),
    box-shadow var(--transition);
}

.stat-card:hover {
  border-color: var(--border-strong);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.stat-card__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 13px;
}

.stat-card__icon {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  background: var(--primary-soft);
  color: var(--primary-text);
}

.stat-card__icon [data-lucide] {
  width: 17px;
  height: 17px;
}

.stat-card__icon.green { background: var(--success-soft); color: var(--success); }
.stat-card__icon.amber { background: var(--warning-soft); color: var(--warning-strong); }
.stat-card__icon.blue { background: var(--secondary-soft); color: var(--secondary); }
.stat-card__icon.cyan { background: var(--accent-soft); color: var(--accent); }
.stat-card__icon.rose { background: var(--danger-soft); color: var(--danger); }

.stat-card__value {
  font-family: var(--font-display);
  font-size: 1.55rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
  color: var(--text);
}

.stat-card__label {
  font-size: 0.73rem;
  color: var(--text-muted);
  margin-top: 3px;
  display: flex;
  align-items: center;
  gap: 5px;
}

.stat-card__trend {
  font-size: 0.65rem;
  font-weight: 650;
  color: var(--success);
}

/* Dashboard grid */
.dash-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.dash-main,
.dash-side {
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-width: 0;
}

.chart-card .card-body {
  padding-top: 16px;
}

.chart-wrap {
  position: relative;
  height: 260px;
}

.chart-wrap--sm {
  height: 200px;
}

.chart-wrap--lg {
  height: 310px;
}

.chart-legend {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 12px;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.chart-legend__item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.chart-legend__swatch {
  width: 9px;
  height: 9px;
  border-radius: 3px;
  background: var(--primary);
}

.continue-card {
  display: flex;
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-2);
  transition: border-color var(--transition), background var(--transition);
}

.continue-card:hover {
  border-color: var(--primary);
  background: var(--primary-softer);
}

.continue-card__icon {
  width: 42px;
  height: 42px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  background: var(--primary-soft);
  color: var(--primary-text);
  flex: none;
}

.continue-card__body {
  flex: 1;
  min-width: 0;
}

.continue-card h4 {
  font-family: var(--font-sans);
  font-size: 0.84rem;
  font-weight: 650;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.continue-card p {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.continue-card .progress {
  margin-top: 9px;
}

.quick-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.quick-action {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 13px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text-secondary);
  font-size: 0.77rem;
  font-weight: 600;
  transition: border-color var(--transition), background var(--transition),
    transform var(--transition), color var(--transition);
}

.quick-action:hover {
  border-color: var(--primary);
  background: var(--primary-softer);
  color: var(--primary-text);
  transform: translateY(-2px);
}

.quick-action [data-lucide] {
  width: 18px;
  height: 18px;
  color: var(--primary-text);
}

.activity-list {
  display: flex;
  flex-direction: column;
}

.activity-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 0;
  border-bottom: 1px solid var(--border);
}

.activity-item:first-child {
  padding-top: 0;
}

.activity-item:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.activity-item__icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  flex: none;
  background: var(--surface-3);
  color: var(--text-muted);
}

.activity-item__icon [data-lucide] {
  width: 16px;
  height: 16px;
}

.activity-item__body {
  flex: 1;
  min-width: 0;
}

.activity-item__title {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.activity-item__meta {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 1px;
}

.activity-item__score {
  font-family: var(--font-display);
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text);
  flex: none;
}

.streak-card {
  position: relative;
  overflow: hidden;
  background: linear-gradient(145deg, var(--surface) 0%, var(--primary-softer) 100%);
}

.streak-card__flame {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: var(--warning-soft);
  color: var(--warning-strong);
  margin-bottom: 12px;
}

.streak-card__flame [data-lucide] {
  width: 24px;
  height: 24px;
}

.streak-days {
  display: flex;
  gap: 6px;
  margin-top: 14px;
}

.streak-day {
  flex: 1;
  height: 34px;
  border-radius: 7px;
  background: var(--surface-3);
  display: grid;
  place-items: center;
  font-size: 0.6rem;
  font-weight: 650;
  color: var(--text-subtle);
}

.streak-day.is-done {
  background: var(--warning-soft);
  color: var(--warning-strong);
}

.streak-day.is-today {
  outline: 2px solid var(--warning);
  outline-offset: 1px;
}

/* ---------- Exam & subject cards ---------- */
.exam-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 18px;
}

.exam-grid--three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

@media (max-width: 1100px) {
  .exam-grid--three {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 768px) {
  .exam-grid--three {
    grid-template-columns: 1fr;
  }
}

.exam-card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 22px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: transform var(--transition), box-shadow var(--transition),
    border-color var(--transition);
}

.exam-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: var(--exam-color, var(--primary));
  opacity: 0.9;
}

.exam-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-md);
}

.exam-card__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.exam-logo {
  width: 54px;
  height: 54px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  flex: none;
  overflow: hidden;
  background: color-mix(in srgb, var(--exam-color, #5145e5) 13%, var(--surface));
  color: var(--exam-color, var(--primary));
  border: 1px solid color-mix(in srgb, var(--exam-color, #5145e5) 18%, transparent);
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: -0.04em;
}

.exam-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 7px;
}

.exam-logo [data-lucide] {
  width: 24px;
  height: 24px;
}

.exam-logo--lg {
  width: 72px;
  height: 72px;
  border-radius: 14px;
  font-size: 1.3rem;
}

.exam-logo--sm {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  font-size: 0.8rem;
}

.exam-card__title {
  font-size: 1.02rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 3px;
}

.exam-card__desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.5em;
}

.exam-card__meta {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin: 14px 0;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  font-size: 0.73rem;
  color: var(--text-muted);
}

.exam-card__meta span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.exam-card__meta [data-lucide] {
  width: 14px;
  height: 14px;
  color: var(--text-subtle);
}

.exam-card__foot {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.subject-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
}

.subject-card {
  display: flex;
  gap: 13px;
  align-items: flex-start;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  transition: transform var(--transition), border-color var(--transition),
    box-shadow var(--transition);
}

.subject-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-sm);
}

.subject-card__icon {
  width: 40px;
  height: 40px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  flex: none;
  background: color-mix(in srgb, var(--subject-color, #5145e5) 11%, var(--surface));
  color: var(--subject-color, var(--primary));
}

.subject-card__icon [data-lucide] {
  width: 19px;
  height: 19px;
}

.subject-card__name {
  font-size: 0.86rem;
  font-weight: 650;
  color: var(--text);
}

.subject-card__meta {
  font-size: 0.71rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.category-card {
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  transition: transform var(--transition), box-shadow var(--transition);
}

.category-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.category-card__icon {
  width: 44px;
  height: 44px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  background: var(--primary-soft);
  color: var(--primary-text);
  margin-bottom: 14px;
}

.category-card h3 {
  font-size: 0.95rem;
  margin-bottom: 5px;
}

.category-card p {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.category-card__count {
  margin-top: 12px;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--primary-text);
}

/* ---------- Wizard / selection ---------- */
.wizard-shell {
  max-width: 1040px;
  margin: 0 auto;
}

.wizard-steps {
  display: flex;
  align-items: center;
  gap: 0;
  margin-bottom: 30px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.wizard-step {
  display: flex;
  align-items: center;
  gap: 9px;
  flex: none;
}

.wizard-step__num {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 0.72rem;
  font-weight: 700;
  background: var(--surface-3);
  color: var(--text-muted);
  border: 1px solid var(--border);
  transition: all var(--transition);
}

.wizard-step__label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
}

.wizard-step.is-active .wizard-step__num {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  box-shadow: var(--shadow-primary);
}

.wizard-step.is-active .wizard-step__label {
  color: var(--text);
}

.wizard-step.is-done .wizard-step__num {
  background: var(--success-soft);
  border-color: var(--success);
  color: var(--success);
}

.wizard-step__line {
  width: clamp(24px, 5vw, 56px);
  height: 1px;
  background: var(--border);
  margin: 0 10px;
  flex: none;
}

.select-card {
  position: relative;
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 17px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition),
    transform var(--transition), box-shadow var(--transition);
}

.select-card:hover {
  border-color: var(--border-strong);
  transform: translateY(-1px);
}

.select-card.is-selected {
  border-color: var(--primary);
  background: var(--primary-softer);
  box-shadow: 0 0 0 3px var(--primary-soft);
}

.select-card.is-disabled {
  opacity: 0.55;
  pointer-events: none;
}

.select-card input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.select-card__check {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1.5px solid var(--border-strong);
  flex: none;
  margin-top: 1px;
  display: grid;
  place-items: center;
  color: transparent;
  transition: all var(--transition);
}

.select-card__check [data-lucide] {
  width: 12px;
  height: 12px;
  stroke-width: 3;
}

.select-card.is-selected .select-card__check {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.select-card--square .select-card__check {
  border-radius: 6px;
}

.select-card__body {
  flex: 1;
  min-width: 0;
}

.select-card__title {
  font-size: 0.86rem;
  font-weight: 650;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}

.select-card__meta {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.selection-bar {
  position: sticky;
  bottom: 16px;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  padding: 13px 16px;
  margin-top: 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--glass);
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow-lg);
}

.selection-bar__count {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.selection-bar__count strong {
  font-family: var(--font-display);
  font-size: 1.15rem;
  color: var(--text);
}

.selection-bar__actions {
  margin-left: auto;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.selected-subjects {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.selected-subject {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 8px 5px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  background: var(--surface);
  font-size: 0.76rem;
  font-weight: 550;
  color: var(--text-secondary);
}

.selected-subject button {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--text-subtle);
}

.selected-subject button:hover {
  background: var(--danger-soft);
  color: var(--danger);
}

.selected-subject button [data-lucide] {
  width: 12px;
  height: 12px;
}

/* ---------- Results / review ---------- */
.result-hero {
  display: flex;
  align-items: center;
  gap: 28px;
  flex-wrap: wrap;
  padding: 26px;
  border-radius: var(--radius-xl);
  border: 1px solid var(--border);
  background: linear-gradient(140deg, var(--surface) 0%, var(--primary-softer) 100%);
}

.score-ring {
  --score: 0;
  --ring-size: 130px;
  width: var(--ring-size);
  height: var(--ring-size);
  border-radius: 50%;
  flex: none;
  display: grid;
  place-items: center;
  background: conic-gradient(var(--primary) calc(var(--score) * 1%), var(--surface-3) 0);
  position: relative;
}

.score-ring::before {
  content: "";
  position: absolute;
  inset: 9px;
  border-radius: 50%;
  background: var(--surface);
}

.score-ring__value {
  position: relative;
  z-index: 1;
  text-align: center;
}

.score-ring__value strong {
  display: block;
  font-family: var(--font-display);
  font-size: 1.8rem;
  letter-spacing: -0.04em;
  line-height: 1;
}

.score-ring__value span {
  font-size: 0.65rem;
  color: var(--text-muted);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.result-hero__meta h1 {
  font-size: clamp(1.35rem, 2.4vw, 1.85rem);
  margin-bottom: 7px;
}

.result-metrics {
  display: flex;
  gap: 26px;
  flex-wrap: wrap;
  margin-top: 16px;
}

.result-metric strong {
  display: block;
  font-family: var(--font-display);
  font-size: 1.2rem;
  letter-spacing: -0.02em;
  color: var(--text);
}

.result-metric span {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-weight: 550;
}

.subject-breakdown {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.subject-breakdown__row {
  display: grid;
  grid-template-columns: minmax(110px, 160px) 1fr auto;
  gap: 14px;
  align-items: center;
}

.subject-breakdown__name {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.subject-breakdown__score {
  font-size: 0.78rem;
  font-weight: 650;
  color: var(--text);
  min-width: 46px;
  text-align: right;
}

.review-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.review-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  overflow: hidden;
}

.review-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 14px 18px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  font-size: 0.75rem;
  color: var(--text-muted);
}

.review-card__body {
  padding: 18px;
}

.review-card__stem {
  font-size: 0.9rem;
  line-height: 1.65;
  color: var(--text);
  margin-bottom: 14px;
}

.review-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.review-option {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.84rem;
  color: var(--text-secondary);
}

.review-option__label {
  width: 24px;
  height: 24px;
  border-radius: 7px;
  background: var(--surface-3);
  display: grid;
  place-items: center;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-muted);
  flex: none;
}

.review-option.is-correct {
  border-color: var(--success);
  background: var(--success-soft);
}

.review-option.is-correct .review-option__label {
  background: var(--success);
  color: #fff;
}

.review-option.is-wrong {
  border-color: var(--danger);
  background: var(--danger-soft);
}

.review-option.is-wrong .review-option__label {
  background: var(--danger);
  color: #fff;
}

.review-option.is-selected {
  box-shadow: 0 0 0 2px var(--primary-soft);
}

.review-option__tag {
  margin-left: auto;
  font-size: 0.66rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  flex: none;
}

.review-explanation {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--secondary-soft);
  border-left: 3px solid var(--secondary);
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.review-explanation strong {
  color: var(--text);
}

.question-passage {
  padding: 14px 16px;
  margin-bottom: 16px;
  background: var(--surface-2);
  border-left: 3px solid var(--primary);
  border-radius: var(--radius-sm);
  font-size: 0.84rem;
  line-height: 1.7;
  color: var(--text-secondary);
}

.question-passage h4 {
  font-size: 0.85rem;
  margin-bottom: 6px;
}

.question-image {
  max-width: 100%;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  margin: 12px 0;
}

.question-table {
  width: 100%;
  border-collapse: collapse;
  margin: 12px 0;
  font-size: 0.8rem;
}

.question-table th,
.question-table td {
  border: 1px solid var(--border);
  padding: 7px 10px;
  text-align: left;
}

.question-table th {
  background: var(--surface-2);
  font-weight: 650;
  color: var(--text);
}

.demo-flag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 7px;
  border-radius: var(--radius-full);
  background: var(--warning-soft);
  color: var(--warning-strong);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

[data-theme="dark"] .demo-flag {
  color: var(--warning);
}

/* ---------- Planner ---------- */
.week-strip {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 22px;
}

.week-day {
  padding: 11px 6px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  text-align: center;
  transition: border-color var(--transition), background var(--transition);
}

.week-day:hover {
  border-color: var(--border-strong);
}

.week-day.is-today {
  border-color: var(--primary);
  background: var(--primary-softer);
}

.week-day__name {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.week-day__num {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
}

.week-day__dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--primary);
  margin: 3px auto 0;
}

.week-day__dot.is-empty {
  background: transparent;
}

.plan-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.schedule-item {
  display: flex;
  gap: 12px;
  padding: 13px 0;
  border-bottom: 1px solid var(--border);
}

.schedule-item:last-child {
  border-bottom: 0;
}

.schedule-item__time {
  width: 58px;
  flex: none;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--primary-text);
  padding-top: 2px;
}

.schedule-item__body {
  flex: 1;
  min-width: 0;
}

.schedule-item__title {
  font-size: 0.83rem;
  font-weight: 600;
  color: var(--text);
}

.schedule-item__meta {
  font-size: 0.71rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.schedule-item.is-done .schedule-item__title {
  text-decoration: line-through;
  color: var(--text-muted);
}

.check-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 0;
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.check-row input {
  width: 17px;
  height: 17px;
  accent-color: var(--success);
}

/* ---------- Notifications / bookmarks ---------- */
.list-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.list-row {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  transition: border-color var(--transition), background var(--transition);
}

.list-row:hover {
  border-color: var(--border-strong);
}

.list-row.is-unread {
  background: var(--primary-softer);
  border-color: color-mix(in srgb, var(--primary) 22%, var(--border));
}

.list-row__icon {
  width: 40px;
  height: 40px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  flex: none;
  background: var(--primary-soft);
  color: var(--primary-text);
}

.list-row__icon [data-lucide] {
  width: 18px;
  height: 18px;
}

.list-row__body {
  flex: 1;
  min-width: 0;
}

.list-row__title {
  font-size: 0.87rem;
  font-weight: 650;
  color: var(--text);
  margin-bottom: 2px;
}

.list-row__text {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.55;
}

.list-row__meta {
  font-size: 0.68rem;
  color: var(--text-subtle);
  margin-top: 5px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

/* ---------- FAQ accordion ---------- */
.faq-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.faq-item {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
}

.faq-question {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  padding: 17px 20px;
  text-align: left;
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 600;
  font-family: var(--font-sans);
}

.faq-question [data-lucide] {
  width: 18px;
  height: 18px;
  color: var(--text-muted);
  transition: transform var(--transition);
  flex: none;
}

.faq-item.is-open .faq-question [data-lucide] {
  transform: rotate(45deg);
}

.faq-answer {
  display: none;
  padding: 0 20px 18px;
  font-size: 0.84rem;
  line-height: 1.7;
  color: var(--text-muted);
  max-width: 80ch;
}

.faq-item.is-open .faq-answer {
  display: block;
}

/* ---------- Countdown / misc ---------- */
.meta-row {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  font-size: 0.76rem;
  color: var(--text-muted);
}

.meta-row span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.meta-row [data-lucide] {
  width: 14px;
  height: 14px;
}

.divider-y {
  width: 1px;
  align-self: stretch;
  background: var(--border);
}

.kbd {
  padding: 2px 6px;
  border: 1px solid var(--border-strong);
  border-bottom-width: 2px;
  border-radius: 5px;
  font-family: var(--font-sans);
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--surface-2);
}

.marquee-note {
  font-size: 0.72rem;
  color: var(--text-subtle);
  display: flex;
  align-items: center;
  gap: 5px;
}

/* ---------- Profile / settings ---------- */
.profile-grid {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.profile-card {
  text-align: center;
  padding: 26px 20px;
}

.profile-card__name {
  font-size: 1.06rem;
  font-weight: 700;
  margin-top: 14px;
}

.profile-card__meta {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.profile-card__stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  margin-top: 20px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.profile-stat {
  padding: 12px 6px;
  background: var(--surface);
}

.profile-stat strong {
  display: block;
  font-family: var(--font-display);
  font-size: 1rem;
  color: var(--text);
}

.profile-stat span {
  font-size: 0.62rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
}

.settings-tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  border-radius: var(--radius-sm);
  background: var(--surface-3);
  margin-bottom: 18px;
  overflow-x: auto;
}

.settings-tab {
  flex: 1;
  padding: 8px 12px;
  border-radius: var(--radius-xs);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  text-align: center;
  white-space: nowrap;
}

.settings-tab.is-active {
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-xs);
}

.theme-options {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.theme-option {
  position: relative;
  padding: 13px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  text-align: left;
  cursor: pointer;
  background: var(--surface);
}

.theme-option:hover {
  border-color: var(--border-strong);
}

.theme-option:focus-within {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.theme-option.is-selected {
  border-color: var(--primary);
  background: var(--primary-softer);
}

.theme-option__preview {
  display: block;
  height: 46px;
  border-radius: 7px;
  margin-bottom: 9px;
  border: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}

.theme-option__preview.light {
  background: #f8fafc;
}

.theme-option__preview.dark {
  background: #0b1120;
}

.theme-option__preview.system {
  background: linear-gradient(105deg, #f8fafc 49%, #0b1120 50%);
}

.theme-option__label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.theme-option input {
  position: absolute;
  opacity: 0;
}

/* ---------- Custom admin / management ---------- */
.manage-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 26px;
}

.manage-stat {
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.manage-stat__label {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 550;
  display: flex;
  align-items: center;
  gap: 6px;
}

.manage-stat__value {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
  margin-top: 6px;
  letter-spacing: -0.03em;
}

.manage-stat__sub {
  font-size: 0.68rem;
  color: var(--text-subtle);
  margin-top: 3px;
}

.filter-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 12px;
  margin-bottom: 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.filter-bar .form-control,
.filter-bar .form-select {
  width: auto;
  min-width: 140px;
  min-height: 38px;
  padding: 7px 12px;
  font-size: 0.8rem;
}

.filter-bar .form-select {
  padding-right: 34px;
}

.filter-search {
  position: relative;
  flex: 1;
  min-width: 180px;
}

.filter-search [data-lucide] {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  width: 15px;
  height: 15px;
  color: var(--text-subtle);
}

.filter-search .form-control {
  padding-left: 34px;
  width: 100%;
}

.inline-actions {
  display: flex;
  gap: 4px;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.question-stem {
  font-size: 1rem;
  line-height: 1.7;
  color: var(--text);
}

.detail-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.detail-item dt {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-subtle);
  margin-bottom: 3px;
}

.detail-item dd {
  font-size: 0.86rem;
  color: var(--text);
}

/* ---------- Error pages ---------- */
.error-page {
  min-height: calc(100vh - 72px);
  display: grid;
  place-items: center;
  padding: 48px 20px;
  text-align: center;
}

.error-code {
  font-family: var(--font-display);
  font-size: clamp(4.5rem, 14vw, 8rem);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.06em;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin-bottom: 8px;
}

.error-page h1 {
  font-size: 1.6rem;
  margin-bottom: 10px;
}

.error-page p {
  max-width: 48ch;
  margin: 0 auto 24px;
  color: var(--text-muted);
}

/* ---------- Charts ---------- */
.chart-empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--text-muted);
  font-size: 0.82rem;
  text-align: center;
  padding: 20px;
}

/* ---------- Responsive ---------- */
@media (max-width: 1280px) {
  .stat-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .site-nav a {
    padding: 8px 8px;
    font-size: 0.8rem;
  }
}

@media (max-width: 1100px) {
  .sidebar {
    transform: translateX(-100%);
    box-shadow: var(--shadow-lg);
  }

  .sidebar.is-open {
    transform: translateX(0);
  }

  .sidebar__overlay {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 75;
    background: var(--overlay);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s;
  }

  .sidebar__overlay.is-open {
    opacity: 1;
    visibility: visible;
  }

  .main-wrap {
    margin-left: 0;
  }

  .topbar__menu {
    display: grid;
  }

  .dash-grid {
    grid-template-columns: 1fr;
  }

  .dash-side {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
  }

  .plan-grid {
    grid-template-columns: 1fr;
  }

  .site-footer__grid {
    grid-template-columns: 1.4fr repeat(2, 1fr);
  }
}

@media (max-width: 960px) {
  .site-nav {
    display: none;
  }

  .mobile-toggle {
    display: grid;
  }

  .site-header__actions .btn-secondary,
  .site-header__actions .btn-primary {
    display: none;
  }

  .auth-shell {
    grid-template-columns: 1fr;
  }

  .auth-aside {
    display: none;
  }

  .auth-main__top .brand {
    display: inline-flex;
  }

  .auth-card {
    margin-block: auto;
  }

  .stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .profile-grid {
    grid-template-columns: 1fr;
  }

  .manage-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .site-footer__grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 768px) {
  body {
    font-size: 14.5px;
  }

  .container,
  .container-wide,
  .container-narrow {
    width: min(100% - 32px, var(--container));
  }

  .app-main {
    padding: 20px 16px 92px;
  }

  .topbar {
    padding: 0 14px;
  }

  .topbar__crumb-sub {
    display: none;
  }

  .topbar-avatar__name {
    display: none;
  }

  .topbar__cta {
    display: none;
  }

  .topbar-avatar {
    padding: 3px;
  }

  .welcome {
    padding: 20px;
  }

  .welcome__main {
    align-items: flex-start;
  }

  .welcome__avatar {
    --avatar-size: 48px;
  }

  .dash-side {
    display: flex;
  }

  .quick-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .detail-list {
    grid-template-columns: 1fr;
  }

  .page-head {
    align-items: flex-start;
  }

  .page-head__actions {
    width: 100%;
  }

  .selection-bar {
    bottom: 78px;
  }

  .selection-bar__actions {
    width: 100%;
    margin-left: 0;
  }

  .selection-bar__actions .btn {
    flex: 1;
  }

  .result-hero {
    gap: 20px;
    padding: 20px;
  }

  .result-metrics {
    gap: 18px;
  }

  .subject-breakdown__row {
    grid-template-columns: minmax(90px, 1fr) 1.2fr auto;
    gap: 10px;
  }

  .site-footer {
    padding: 48px 0 22px;
  }

  .site-footer__grid {
    grid-template-columns: 1fr 1fr;
    gap: 28px;
  }

  .site-footer__about {
    grid-column: 1 / -1;
  }

  .newsletter {
    flex-direction: column;
  }

  .theme-options {
    grid-template-columns: 1fr;
  }

  .mobile-bottom-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 60;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    background: var(--glass);
    backdrop-filter: blur(16px);
    border-top: 1px solid var(--border);
    padding: 7px 4px calc(7px + env(safe-area-inset-bottom));
  }

  .mobile-bottom-nav a {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 5px 2px;
    border-radius: var(--radius-xs);
    color: var(--text-muted);
    font-size: 0.6rem;
    font-weight: 600;
    text-align: center;
  }

  .mobile-bottom-nav a.is-active {
    color: var(--primary-text);
    background: var(--primary-softer);
  }

  .mobile-bottom-nav [data-lucide] {
    width: 19px;
    height: 19px;
  }

  .modal__dialog {
    width: 100%;
  }

  .toast-stack {
    left: 16px;
    right: 16px;
    bottom: 86px;
    width: auto;
  }

  .exam-grid,
  .subject-grid {
    grid-template-columns: 1fr;
  }

  .table {
    min-width: 560px;
  }

  .week-strip {
    grid-template-columns: repeat(7, minmax(38px, 1fr));
    gap: 4px;
    overflow-x: auto;
  }

  .week-day {
    padding: 8px 2px;
  }

  .week-day__num {
    font-size: 0.95rem;
  }

  .week-day__name {
    font-size: 0.52rem;
  }

  .settings-tab {
    padding: 7px 10px;
    font-size: 0.74rem;
  }
}

@media (max-width: 480px) {
  .stat-grid {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  .stat-card {
    padding: 14px;
  }

  .stat-card__value {
    font-size: 1.3rem;
  }

  .welcome__actions {
    width: 100%;
  }

  .welcome__actions .btn {
    flex: 1;
  }

  .welcome__countdown {
    width: 100%;
  }

  .site-footer__grid {
    grid-template-columns: 1fr;
  }

  .manage-stats {
    grid-template-columns: 1fr;
  }

  .quick-grid {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

@media print {
  .sidebar,
  .topbar,
  .mobile-bottom-nav,
  .site-header,
  .site-footer,
  .no-print {
    display: none !important;
  }

  .main-wrap {
    margin-left: 0;
  }

  body {
    background: #fff;
    color: #000;
  }
}


/* Responsive utility grids used across the student workspace. */
@media (max-width: 1024px) {
  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 768px) {
  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
  }
}


/* ---------- Review & confirmation panel ---------- */
.confirm-card .card-body {
  padding: 22px 24px;
}

.confirm-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

.confirm-bar__profile {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.confirm-bar__actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.verification-note {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 14px 16px;
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-left: 3px solid var(--warning);
  border-radius: var(--radius-sm);
  background: var(--warning-soft);
  color: var(--text-secondary);
  line-height: 1.6;
}

.verification-note > [data-lucide] {
  width: 18px;
  height: 18px;
  flex: none;
  margin-top: 2px;
  color: var(--warning-strong);
}

.verification-note__body {
  min-width: 0;
  flex: 1;
}

.verification-note__head {
  margin: 0;
  font-size: 0.82rem;
}

.verification-note__head strong {
  color: var(--text);
}

.verification-note__link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 7px;
  color: var(--primary-text);
  font-size: 0.76rem;
  font-weight: 650;
  text-decoration: none;
}

.verification-note__link:hover {
  text-decoration: underline;
}

.verification-note__link [data-lucide] {
  width: 12px;
  height: 12px;
}

.verification-note__text {
  margin: 7px 0 0;
  font-size: 0.76rem;
  color: var(--text-muted);
}

@media (max-width: 640px) {
  .confirm-bar {
    align-items: flex-start;
  }

  .confirm-bar__actions {
    width: 100%;
  }

  .confirm-bar__actions .btn {
    flex: 1;
    justify-content: center;
  }

  .verification-note {
    padding: 13px 14px;
  }
}


/* ---------- Review start-now CTA ---------- */
.start-now-card {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(240px, 0.7fr);
  gap: 28px;
  overflow: hidden;
  padding: clamp(24px, 3.5vw, 38px);
  border-radius: var(--radius-xl);
  background:
    radial-gradient(circle at 88% 12%, rgba(255, 255, 255, 0.22), transparent 32%),
    linear-gradient(135deg, #4f46e5 0%, #6d5ce7 52%, #7c3aed 100%);
  color: #fff;
  box-shadow: 0 20px 48px -24px rgba(79, 70, 229, 0.8);
}

.start-now-card__main {
  position: relative;
  z-index: 1;
  min-width: 0;
}

.start-now-card__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
  font-size: 0.7rem;
  font-weight: 750;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.75);
}

.start-now-card__eyebrow [data-lucide] {
  width: 14px;
  height: 14px;
}

.start-now-card h2 {
  margin: 0;
  color: #fff;
  font-size: clamp(1.45rem, 3vw, 2rem);
  letter-spacing: -0.035em;
}

.start-now-card__main > p {
  max-width: 58ch;
  margin-top: 8px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.88rem;
  line-height: 1.6;
}

.start-now-form {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 20px;
  padding: 13px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.11);
}

.start-now-form__field {
  flex: 1;
  min-width: 170px;
}

.start-now-form__field label {
  display: block;
  margin-bottom: 6px;
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.72rem;
  font-weight: 650;
}

.start-now-form__input {
  display: flex;
  align-items: center;
  gap: 8px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.75rem;
}

.start-now-form__input .form-control {
  width: 92px;
  min-height: 44px;
  border-color: transparent;
  background: #fff;
  color: #1f1b4d;
  -webkit-text-fill-color: #1f1b4d;
  caret-color: #1f1b4d;
  font-weight: 700;
}

.start-now-form__input .form-control:focus {
  border-color: var(--primary);
  box-shadow: var(--ring);
}

.start-now-form .btn {
  white-space: nowrap;
}

.start-now-card__help {
  margin: 12px 0 0;
  color: rgba(255, 255, 255, 0.64);
  font-size: 0.72rem;
}

.start-now-card__side {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 14px;
  padding-left: 28px;
  border-left: 1px solid rgba(255, 255, 255, 0.18);
}

.start-now-card__fact {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.13);
}

.start-now-card__fact strong {
  color: #fff;
  font-family: var(--font-display);
  font-size: 1.3rem;
  letter-spacing: -0.04em;
}

.start-now-card__fact span {
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.72rem;
  text-align: right;
}

.start-now-card__note {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  color: rgba(255, 255, 255, 0.66);
  font-size: 0.7rem;
  line-height: 1.5;
}

.start-now-card__note [data-lucide] {
  flex: none;
  width: 14px;
  height: 14px;
  margin-top: 1px;
}

@media (max-width: 900px) {
  .start-now-card {
    grid-template-columns: 1fr;
    gap: 22px;
  }

  .start-now-card__side {
    padding: 20px 0 0;
    border-top: 1px solid rgba(255, 255, 255, 0.18);
    border-left: 0;
  }
}

@media (max-width: 640px) {
  .start-now-form {
    align-items: stretch;
  }

  .start-now-form .btn {
    width: 100%;
    justify-content: center;
  }
}
