/* ==========================================================================
   e-Learning AI Club Malang — Design System
   Identitas: violet #7456ff · coral #ff7358 · ink #11111d · cream #f8f4ec
   ========================================================================== */

:root {
  --ink: #11111d;
  --ink-2: #1d1b2e;
  --ink-3: #2a2740;
  --muted: #6f6b83;
  --muted-2: #938fa5;
  --line: rgba(17, 17, 29, .10);
  --line-strong: rgba(17, 17, 29, .18);
  --paper: #fffdf8;
  --paper-2: #ffffff;
  --cream: #f6f2ea;
  --canvas: #f4f1fa;
  --violet: #7456ff;
  --violet-600: #5f3fe8;
  --violet-soft: rgba(116, 86, 255, .10);
  --violet-soft-2: rgba(116, 86, 255, .18);
  --coral: #ff7358;
  --coral-soft: rgba(255, 115, 88, .12);
  --emerald: #17a673;
  --emerald-soft: rgba(23, 166, 115, .12);
  --amber: #e2960a;
  --amber-soft: rgba(226, 150, 10, .14);
  --rose: #e0435c;
  --rose-soft: rgba(224, 67, 92, .12);
  --sky: #2f7fe0;
  --sky-soft: rgba(47, 127, 224, .12);
  --cyan: #16a5b5;
  --indigo: #5751d8;
  --orange: #e2762a;

  --radius-xs: 8px;
  --radius-sm: 12px;
  --radius: 16px;
  --radius-lg: 22px;
  --radius-xl: 30px;

  --shadow-xs: 0 1px 2px rgba(24, 18, 48, .06);
  --shadow-sm: 0 2px 8px rgba(24, 18, 48, .07);
  --shadow: 0 10px 30px rgba(30, 20, 70, .09);
  --shadow-lg: 0 24px 70px rgba(35, 24, 65, .16);

  --font: "Inter", "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;

  --sidebar-w: 268px;
  --topbar-h: 68px;
  --ease: cubic-bezier(.22, .8, .2, 1);
}

[data-theme="dark"] {
  --ink: #f3f1fb;
  --ink-2: #e4e1f4;
  --ink-3: #cfcbe4;
  --muted: #9b97b1;
  --muted-2: #7c7893;
  --line: rgba(255, 255, 255, .10);
  --line-strong: rgba(255, 255, 255, .18);
  --paper: #14131f;
  --paper-2: #1a1829;
  --cream: #0f0e19;
  --canvas: #0c0b14;
  --violet-soft: rgba(116, 86, 255, .16);
  --violet-soft-2: rgba(116, 86, 255, .26);
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow-sm: 0 2px 10px rgba(0, 0, 0, .35);
  --shadow: 0 12px 34px rgba(0, 0, 0, .42);
  --shadow-lg: 0 28px 80px rgba(0, 0, 0, .55);
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--canvas);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-feature-settings: "cv02", "cv03", "cv04", "ss01";
}

img, svg { max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; }

h1, h2, h3, h4 {
  margin: 0 0 .35em;
  font-weight: 700;
  letter-spacing: -.02em;
  line-height: 1.22;
  color: var(--ink);
}
h1 { font-size: clamp(1.6rem, 1.2rem + 1.6vw, 2.3rem); }
h2 { font-size: 1.32rem; }
h3 { font-size: 1.08rem; }
h4 { font-size: .98rem; }
p { margin: 0 0 1em; }

.muted { color: var(--muted); }
.small { font-size: .83rem; }
.tiny { font-size: .76rem; }
.strong { font-weight: 650; }
.center { text-align: center; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.tnum { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--mono); font-size: .85em; }
.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;
}
.stack { display: flex; flex-direction: column; gap: 10px; }
.row { display: flex; gap: 10px; align-items: center; }
.row-between { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.wrap { flex-wrap: wrap; }
.grow { flex: 1 1 auto; min-width: 0; }
.hide { display: none !important; }

/* ---------------------------------- Layout --------------------------------- */
.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 18px 14px;
  background: var(--paper);
  border-right: 1px solid var(--line);
  overflow-y: auto;
  scrollbar-width: thin;
  z-index: 40;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 6px 8px 14px;
}
.brand-mark {
  width: 42px; height: 42px;
  flex: 0 0 42px;
  border-radius: 13px;
  display: grid; place-items: center;
  background: linear-gradient(140deg, var(--violet), var(--indigo) 60%, var(--coral));
  color: #fff;
  font-weight: 800;
  font-size: .95rem;
  letter-spacing: -.02em;
  box-shadow: 0 10px 24px rgba(116, 86, 255, .3);
}
.brand-text { min-width: 0; }
.brand-text b { display: block; font-size: .95rem; letter-spacing: -.01em; line-height: 1.25; }
.brand-text span { display: block; font-size: .74rem; color: var(--muted); letter-spacing: .06em; text-transform: uppercase; font-weight: 600; }

.nav-section {
  padding: 14px 10px 6px;
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted-2);
}
.nav-link {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 11px;
  border-radius: var(--radius-sm);
  color: var(--ink-2);
  font-weight: 550;
  font-size: .9rem;
  transition: background .18s var(--ease), color .18s var(--ease), transform .18s var(--ease);
}
.nav-link:hover { background: var(--violet-soft); color: var(--violet-600); }
[data-theme="dark"] .nav-link:hover { color: #cfc4ff; }
.nav-link.is-active {
  background: linear-gradient(120deg, var(--violet), var(--violet-600));
  color: #fff;
  box-shadow: 0 10px 22px rgba(116, 86, 255, .28);
}
.nav-link.is-active .icon { opacity: 1; }
.nav-link .icon { flex: 0 0 auto; opacity: .78; }
.nav-link.is-active .icon { opacity: 1; }
.nav-badge {
  margin-left: auto;
  font-size: .68rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--violet-soft-2);
  color: var(--violet-600);
}
.nav-link.is-active .nav-badge { background: rgba(255, 255, 255, .25); color: #fff; }

.sidebar-foot {
  margin-top: auto;
  padding: 12px 10px 4px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.who {
  display: flex; align-items: center; gap: 10px;
  padding: 8px;
  border-radius: var(--radius-sm);
  background: var(--cream);
}
[data-theme="dark"] .who { background: var(--paper-2); }
.who b { display: block; font-size: .86rem; line-height: 1.3; }
.who span { display: block; font-size: .74rem; color: var(--muted); }

.main { min-width: 0; display: flex; flex-direction: column; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  min-height: var(--topbar-h);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px clamp(14px, 2.4vw, 30px);
  background: color-mix(in srgb, var(--canvas) 84%, transparent);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.topbar h1 { font-size: 1.16rem; margin: 0; }
.crumb { font-size: .75rem; color: var(--muted); letter-spacing: .02em; }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }

.content {
  padding: clamp(16px, 2.4vw, 30px);
  display: flex;
  flex-direction: column;
  gap: 20px;
  flex: 1 1 auto;
}
.foot {
  padding: 18px clamp(14px, 2.4vw, 30px) 26px;
  color: var(--muted);
  font-size: .78rem;
  border-top: 1px solid var(--line);
  display: flex; gap: 10px; flex-wrap: wrap; justify-content: space-between;
}

/* ---------------------------------- Buttons -------------------------------- */
.btn {
  --btn-bg: var(--paper-2);
  --btn-fg: var(--ink);
  --btn-line: var(--line-strong);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 12px;
  border: 1px solid var(--btn-line);
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-weight: 600;
  font-size: .87rem;
  letter-spacing: -.005em;
  cursor: pointer;
  transition: transform .16s var(--ease), box-shadow .16s var(--ease), background .16s var(--ease), border-color .16s var(--ease), opacity .16s;
  white-space: nowrap;
  line-height: 1.3;
  text-align: center;
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.btn:active { transform: translateY(0); }
.btn .icon { flex: 0 0 auto; }
.btn-primary {
  --btn-bg: linear-gradient(120deg, var(--violet), var(--violet-600));
  --btn-fg: #fff;
  --btn-line: transparent;
  box-shadow: 0 10px 24px rgba(116, 86, 255, .28);
}
.btn-primary:hover { box-shadow: 0 14px 30px rgba(116, 86, 255, .34); }
.btn-ink { --btn-bg: var(--ink); --btn-fg: #fff; --btn-line: transparent; }
[data-theme="dark"] .btn-ink { --btn-bg: #2b2840; --btn-fg: #fff; }
.btn-coral { --btn-bg: linear-gradient(120deg, var(--coral), #ff5c3d); --btn-fg: #fff; --btn-line: transparent; }
.btn-ghost { --btn-bg: transparent; --btn-line: var(--line-strong); }
.btn-soft { --btn-bg: var(--violet-soft); --btn-fg: var(--violet-600); --btn-line: transparent; }
[data-theme="dark"] .btn-soft { --btn-fg: #cfc4ff; }
.btn-danger { --btn-bg: var(--rose-soft); --btn-fg: var(--rose); --btn-line: transparent; }
.btn-danger:hover { --btn-bg: var(--rose); --btn-fg: #fff; }
.btn-success { --btn-bg: var(--emerald-soft); --btn-fg: var(--emerald); --btn-line: transparent; }
.btn-sm { padding: 7px 11px; font-size: .8rem; border-radius: 10px; gap: 6px; }
.btn-xs { padding: 5px 9px; font-size: .74rem; border-radius: 9px; gap: 5px; }
.btn-lg { padding: 13px 22px; font-size: .95rem; border-radius: 14px; }
.btn-block { width: 100%; }
.btn-icon { padding: 9px; border-radius: 11px; }
.btn:disabled, .btn[disabled] { opacity: .5; cursor: not-allowed; transform: none; box-shadow: none; }
.btn-group { display: inline-flex; gap: 8px; flex-wrap: wrap; }

/* ----------------------------------- Cards --------------------------------- */
.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
  overflow: hidden;
}
.card-head {
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.card-head h2, .card-head h3 { margin: 0; }
.card-head .sub { font-size: .8rem; color: var(--muted); margin-top: 2px; }
.card-head-actions { margin-left: auto; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.card-body { padding: 20px; }
.card-body.tight { padding: 14px 16px; }
.card-body.flush { padding: 0; }
.card-foot {
  padding: 14px 20px;
  border-top: 1px solid var(--line);
  background: color-mix(in srgb, var(--cream) 55%, transparent);
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
}
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.split { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 1080px) { .split { grid-template-columns: minmax(0, 1fr); } }

.section-title {
  display: flex; align-items: center; gap: 10px;
  font-size: .78rem; font-weight: 700; letter-spacing: .1em;
  text-transform: uppercase; color: var(--muted-2);
  margin: 4px 0 -4px;
}
.section-title:after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* ---------------------------------- Stats ---------------------------------- */
.stat {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 17px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
  overflow: hidden;
  transition: transform .18s var(--ease), box-shadow .18s var(--ease);
}
.stat:hover { transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.stat-top { display: flex; align-items: center; gap: 10px; }
.stat-ico {
  width: 34px; height: 34px; border-radius: 10px;
  display: grid; place-items: center;
  background: var(--violet-soft); color: var(--violet-600);
  flex: 0 0 34px;
}
.stat-label { font-size: .76rem; font-weight: 650; color: var(--muted); letter-spacing: .04em; text-transform: uppercase; }
.stat-value { font-size: 1.7rem; font-weight: 750; letter-spacing: -.03em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat-value small { font-size: .8rem; font-weight: 600; color: var(--muted); letter-spacing: 0; }
.stat-note { font-size: .78rem; color: var(--muted); }
.stat.is-violet .stat-ico { background: var(--violet-soft); color: var(--violet-600); }
.stat.is-emerald .stat-ico { background: var(--emerald-soft); color: var(--emerald); }
.stat.is-amber .stat-ico { background: var(--amber-soft); color: var(--amber); }
.stat.is-rose .stat-ico { background: var(--rose-soft); color: var(--rose); }
.stat.is-sky .stat-ico { background: var(--sky-soft); color: var(--sky); }
.stat.is-coral .stat-ico { background: var(--coral-soft); color: var(--coral); }

/* ---------------------------------- Badges --------------------------------- */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: .73rem;
  font-weight: 650;
  letter-spacing: .01em;
  background: var(--cream);
  color: var(--ink-2);
  border: 1px solid transparent;
  white-space: nowrap;
}
[data-theme="dark"] .badge { background: var(--paper-2); }
.badge-success { background: var(--emerald-soft); color: var(--emerald); }
.badge-warning { background: var(--amber-soft); color: #a86c00; }
[data-theme="dark"] .badge-warning { color: #f0b23c; }
.badge-danger { background: var(--rose-soft); color: var(--rose); }
.badge-info { background: var(--sky-soft); color: var(--sky); }
.badge-violet { background: var(--violet-soft); color: var(--violet-600); }
[data-theme="dark"] .badge-violet { color: #c0b2ff; }
.badge-ink { background: var(--ink); color: #fff; }
[data-theme="dark"] .badge-ink { background: #2b2840; }
.badge-coral { background: var(--coral-soft); color: #d1442a; }
[data-theme="dark"] .badge-coral { color: #ff9c87; }
.badge-emerald { background: var(--emerald-soft); color: var(--emerald); }
.badge-sky { background: var(--sky-soft); color: var(--sky); }
.badge-amber { background: var(--amber-soft); color: #a86c00; }
.badge-rose { background: var(--rose-soft); color: var(--rose); }
.badge-cyan { background: rgba(22,165,181,.13); color: var(--cyan); }
.badge-indigo { background: rgba(87,81,216,.13); color: var(--indigo); }
.badge-orange { background: rgba(226,118,42,.13); color: var(--orange); }
.badge-neutral { background: var(--cream); color: var(--muted); }
[data-theme="dark"] .badge-neutral { background: var(--paper-2); }

.chip {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  font-size: .8rem; font-weight: 550;
  background: var(--paper-2);
  cursor: pointer;
  transition: all .16s var(--ease);
}
.chip:hover { border-color: var(--violet); color: var(--violet-600); }
.chip.is-active { background: var(--violet); border-color: var(--violet); color: #fff; }

/* ---------------------------------- Forms ---------------------------------- */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 15px; }
.label { font-size: .83rem; font-weight: 650; color: var(--ink-2); display: flex; align-items: center; gap: 6px; }
.label .req { color: var(--coral); }
.hint { font-size: .76rem; color: var(--muted); }
.error-text { font-size: .77rem; color: var(--rose); font-weight: 550; }

.input, .select, .textarea {
  width: 100%;
  padding: 10px 13px;
  border-radius: 12px;
  border: 1px solid var(--line-strong);
  background: var(--paper-2);
  color: var(--ink);
  font-family: inherit;
  font-size: .9rem;
  transition: border-color .16s var(--ease), box-shadow .16s var(--ease), background .16s;
  -webkit-appearance: none;
  appearance: none;
}
[data-theme="dark"] .input, [data-theme="dark"] .select, [data-theme="dark"] .textarea { background: #1c1a2b; }
.input::placeholder, .textarea::placeholder { color: var(--muted-2); }
.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--violet);
  box-shadow: 0 0 0 4px var(--violet-soft);
}
.input.is-invalid, .select.is-invalid, .textarea.is-invalid { border-color: var(--rose); }
.textarea { min-height: 96px; resize: vertical; line-height: 1.55; }
.select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%236f6b83' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m4 6 4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}
.input-group { display: flex; }
.input-group .input { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.input-group .btn { border-top-left-radius: 0; border-bottom-left-radius: 0; margin-left: -1px; }

.search {
  position: relative;
  display: flex;
  align-items: center;
  min-width: 200px;
}
.search .icon { position: absolute; left: 11px; color: var(--muted-2); pointer-events: none; }
.search .input { padding-left: 36px; }

.check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: var(--paper-2);
  cursor: pointer;
  transition: border-color .16s var(--ease), background .16s var(--ease);
  font-size: .87rem;
}
[data-theme="dark"] .check { background: #1c1a2b; }
.check:hover { border-color: var(--violet); }
.check input[type="checkbox"], .check input[type="radio"] {
  width: 18px; height: 18px; margin: 2px 0 0;
  accent-color: var(--violet);
  flex: 0 0 18px;
  cursor: pointer;
}
.check b { display: block; font-weight: 620; font-size: .87rem; }
.check small { display: block; color: var(--muted); font-size: .77rem; line-height: 1.45; }
.check.is-checked { border-color: var(--violet); background: var(--violet-soft); }

.form-grid { display: grid; gap: 0 16px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.form-actions {
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
  padding-top: 6px; margin-top: 6px; border-top: 1px solid var(--line);
}

/* ---------------------------------- Tables --------------------------------- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.data { width: 100%; border-collapse: collapse; font-size: .86rem; }
table.data th, table.data td { padding: 11px 14px; text-align: left; vertical-align: middle; }
table.data thead th {
  font-size: .72rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase;
  color: var(--muted); background: color-mix(in srgb, var(--cream) 70%, transparent);
  border-bottom: 1px solid var(--line); white-space: nowrap; position: sticky; top: 0; z-index: 1;
}
[data-theme="dark"] table.data thead th { background: var(--paper-2); }
table.data tbody tr { border-bottom: 1px solid var(--line); transition: background .14s; }
table.data tbody tr:last-child { border-bottom: 0; }
table.data tbody tr:hover { background: var(--violet-soft); }
table.data td.num, table.data th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.data td.actions { text-align: right; white-space: nowrap; }
.cell-main { font-weight: 600; color: var(--ink); }
.cell-sub { font-size: .76rem; color: var(--muted); }
.cell-person { display: flex; align-items: center; gap: 10px; min-width: 180px; }

/* --------------------------------- Avatars --------------------------------- */
.avatar {
  width: var(--avatar-size, 44px); height: var(--avatar-size, 44px);
  flex: 0 0 var(--avatar-size, 44px);
  border-radius: 50%;
  display: grid; place-items: center;
  font-weight: 700; font-size: calc(var(--avatar-size, 44px) * .34);
  letter-spacing: -.01em;
  color: hsl(var(--avatar-hue, 258) 70% 32%);
  background: hsl(var(--avatar-hue, 258) 85% 92%);
  border: 1px solid hsl(var(--avatar-hue, 258) 60% 86%);
  overflow: hidden;
}
[data-theme="dark"] .avatar {
  color: hsl(var(--avatar-hue, 258) 85% 84%);
  background: hsl(var(--avatar-hue, 258) 45% 22%);
  border-color: hsl(var(--avatar-hue, 258) 40% 30%);
}
.avatar-violet { color: #fff; background: linear-gradient(135deg, var(--violet), var(--indigo)); border-color: transparent; }
.avatar-ink { color: #fff; background: linear-gradient(135deg, var(--ink-3), var(--ink)); border-color: transparent; }
.avatar-emerald { color: #fff; background: linear-gradient(135deg, #25c08b, var(--emerald)); border-color: transparent; }
.avatar-coral { color: #fff; background: linear-gradient(135deg, #ff9b7f, var(--coral)); border-color: transparent; }
.avatar-sky { color: #fff; background: linear-gradient(135deg, #58a4f5, var(--sky)); border-color: transparent; }

/* -------------------------------- Progress --------------------------------- */
.bar { height: 8px; border-radius: 999px; background: var(--line); overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--violet), var(--coral)); transition: width .5s var(--ease); }
.bar.emerald > i { background: linear-gradient(90deg, #35d39a, var(--emerald)); }
.bar.amber > i { background: linear-gradient(90deg, #f5b73f, var(--amber)); }
.bar.rose > i { background: linear-gradient(90deg, #f4708a, var(--rose)); }
.bar.sky > i { background: linear-gradient(90deg, #66aaf0, var(--sky)); }

.ring { position: relative; display: grid; place-items: center; }
.ring svg { transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 9; stroke-linecap: round; }
.ring .ring-track { stroke: var(--line); }
.ring .ring-value { stroke: url(#ringGrad); transition: stroke-dashoffset .8s var(--ease); }
.ring-label { position: absolute; text-align: center; line-height: 1.1; }
.ring-label b { display: block; font-size: 1.35rem; font-weight: 750; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.ring-label span { font-size: .7rem; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; font-weight: 650; }

/* ---------------------------------- Tabs ----------------------------------- */
.tabs { display: flex; gap: 6px; padding: 5px; background: var(--cream); border-radius: 14px; overflow-x: auto; }
[data-theme="dark"] .tabs { background: var(--paper-2); }
.tab {
  flex: 1 1 auto;
  padding: 9px 16px;
  border-radius: 10px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-weight: 640;
  font-size: .87rem;
  cursor: pointer;
  white-space: nowrap;
  transition: all .18s var(--ease);
  text-align: center;
  text-decoration: none;
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
}
.tab:hover { color: var(--ink); }
.tab.is-active { background: var(--paper-2); color: var(--violet-600); box-shadow: var(--shadow-xs); }
[data-theme="dark"] .tab.is-active { background: var(--ink-3); color: #cfc4ff; }

/* ------------------------------- Flash/toast ------------------------------- */
.flash-stack { display: flex; flex-direction: column; gap: 10px; }
.flash {
  display: flex; align-items: flex-start; gap: 11px;
  padding: 12px 15px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-size: .87rem;
  animation: fadeUp .4s var(--ease) both;
}
.flash b { font-weight: 650; }
.flash .icon { flex: 0 0 auto; margin-top: 1px; }
.flash-success { background: var(--emerald-soft); border-color: rgba(23,166,115,.28); color: #0f7d56; }
[data-theme="dark"] .flash-success { color: #4fe0aa; }
.flash-error { background: var(--rose-soft); border-color: rgba(224,67,92,.28); color: #b92c43; }
[data-theme="dark"] .flash-error { color: #ff8ba0; }
.flash-warning { background: var(--amber-soft); border-color: rgba(226,150,10,.3); color: #96620a; }
[data-theme="dark"] .flash-warning { color: #f5c365; }
.flash-info { background: var(--sky-soft); border-color: rgba(47,127,224,.26); color: #2568b6; }
[data-theme="dark"] .flash-info { color: #7cb8f5; }

/* ---------------------------------- Empty ---------------------------------- */
.empty {
  text-align: center;
  padding: 44px 22px;
  color: var(--muted);
  display: flex; flex-direction: column; align-items: center; gap: 8px;
}
.empty-ico {
  width: 56px; height: 56px; border-radius: 18px;
  display: grid; place-items: center;
  background: var(--violet-soft); color: var(--violet-600);
  margin-bottom: 6px;
}
.empty b { color: var(--ink); font-size: 1rem; }
.empty p { margin: 0; max-width: 42ch; font-size: .87rem; }

/* -------------------------------- Pagination ------------------------------- */
.pager { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: space-between; padding: 14px 18px; border-top: 1px solid var(--line); }
.pager-info { font-size: .8rem; color: var(--muted); }
.pager-list { display: flex; gap: 5px; align-items: center; }
.pager-link {
  min-width: 34px; height: 34px;
  display: inline-grid; place-items: center;
  padding: 0 9px;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  font-size: .83rem; font-weight: 600;
  color: var(--ink-2);
  background: var(--paper-2);
  transition: all .15s var(--ease);
}
.pager-link:hover { border-color: var(--violet); color: var(--violet-600); }
.pager-link.is-current { background: var(--violet); border-color: var(--violet); color: #fff; }
.pager-link.is-dots { border-color: transparent; background: transparent; color: var(--muted); }

/* ---------------------------------- Modal ---------------------------------- */
dialog.modal {
  border: 0;
  padding: 0;
  border-radius: var(--radius-lg);
  max-width: min(640px, calc(100vw - 28px));
  width: 100%;
  background: var(--paper);
  color: var(--ink);
  box-shadow: var(--shadow-lg);
}
dialog.modal::backdrop { background: rgba(15, 12, 30, .55); backdrop-filter: blur(3px); }
dialog.modal .modal-head { padding: 18px 20px 14px; border-bottom: 1px solid var(--line); }
dialog.modal .modal-head h3 { margin: 0; }
dialog.modal .modal-body { padding: 20px; max-height: min(70vh, 620px); overflow-y: auto; }
dialog.modal .modal-foot { padding: 14px 20px; border-top: 1px solid var(--line); display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }
dialog.modal.wide { max-width: min(920px, calc(100vw - 28px)); }

/* -------------------------------- Definition ------------------------------- */
.deflist { display: grid; grid-template-columns: minmax(120px, 34%) 1fr; gap: 0; }
.deflist dt { padding: 10px 14px; font-size: .8rem; color: var(--muted); font-weight: 600; border-bottom: 1px solid var(--line); }
.deflist dd { padding: 10px 14px; margin: 0; font-size: .88rem; border-bottom: 1px solid var(--line); }
.deflist dt:nth-last-of-type(1), .deflist dd:nth-last-of-type(1) { border-bottom: 0; }

/* -------------------------------- Level ladder ----------------------------- */
.ladder { display: flex; flex-direction: column; gap: 12px; }
.ladder-item {
  display: flex; gap: 14px; align-items: flex-start;
  padding: 15px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--paper-2);
  position: relative;
  transition: transform .18s var(--ease), box-shadow .18s var(--ease);
}
[data-theme="dark"] .ladder-item { background: var(--paper); }
.ladder-item:hover { transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.ladder-item.is-active { border-color: var(--violet); background: var(--violet-soft); box-shadow: 0 10px 26px rgba(116,86,255,.16); }
.ladder-marker {
  width: 44px; height: 44px; flex: 0 0 44px;
  border-radius: 14px;
  display: grid; place-items: center;
  font-weight: 750; font-size: .95rem;
  background: var(--cream); color: var(--muted);
  border: 1px solid var(--line);
}
[data-theme="dark"] .ladder-marker { background: var(--ink-3); }
.ladder-item.is-done .ladder-marker { background: linear-gradient(135deg, var(--emerald), #0f8f63); color: #fff; border-color: transparent; }
.ladder-item.is-active .ladder-marker { background: linear-gradient(135deg, var(--violet), var(--violet-600)); color: #fff; border-color: transparent; box-shadow: 0 8px 20px rgba(116,86,255,.3); }
.ladder-body { flex: 1; min-width: 0; }
.ladder-body b { display: block; font-size: .96rem; letter-spacing: -.01em; }
.ladder-body .desc { font-size: .82rem; color: var(--muted); margin-top: 2px; }
.ladder-meta { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 9px; align-items: center; }

/* ------------------------------ Exam runner ------------------------------- */
body.exam-mode { background: var(--cream); }
[data-theme="dark"] body.exam-mode { background: var(--canvas); }
.exam-shell { max-width: 880px; margin: 0 auto; padding: 18px clamp(12px, 3vw, 22px) 120px; }
.exam-top {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 12px 16px;
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  backdrop-filter: blur(12px);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  margin-bottom: 16px;
}
.exam-title { min-width: 0; }
.exam-title b { display: block; font-size: .95rem; letter-spacing: -.01em; }
.exam-title span { font-size: .76rem; color: var(--muted); }
.timer {
  margin-left: auto;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px;
  border-radius: 12px;
  background: var(--ink);
  color: #fff;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: .02em;
  font-size: .92rem;
}
.timer.is-warning { background: linear-gradient(120deg, var(--amber), #c97f05); }
.timer.is-danger { background: linear-gradient(120deg, var(--rose), #b8243c); animation: pulse 1.6s infinite; }
.timer .icon { opacity: .85; }

.q-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: clamp(18px, 3vw, 26px);
  box-shadow: var(--shadow-sm);
  animation: fadeUp .4s var(--ease) both;
}
.q-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.q-no {
  width: 34px; height: 34px; border-radius: 11px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--violet), var(--violet-600));
  color: #fff; font-weight: 700; font-size: .88rem;
  flex: 0 0 34px;
}
.q-text { font-size: clamp(1rem, .95rem + .3vw, 1.14rem); font-weight: 600; letter-spacing: -.01em; line-height: 1.55; margin: 0 0 18px; }
.q-options { display: flex; flex-direction: column; gap: 10px; }
.q-option {
  display: flex; gap: 13px; align-items: flex-start;
  padding: 14px 16px;
  border-radius: var(--radius);
  border: 1.5px solid var(--line-strong);
  background: var(--paper-2);
  cursor: pointer;
  transition: all .16s var(--ease);
  font-size: .94rem;
  line-height: 1.5;
}
[data-theme="dark"] .q-option { background: var(--paper); }
.q-option:hover { border-color: var(--violet); transform: translateX(2px); }
.q-option input { position: absolute; opacity: 0; pointer-events: none; }
.q-option .letter {
  width: 30px; height: 30px; flex: 0 0 30px;
  border-radius: 9px;
  display: grid; place-items: center;
  background: var(--cream); color: var(--muted);
  font-weight: 700; font-size: .84rem;
  border: 1px solid var(--line);
  transition: all .16s var(--ease);
}
[data-theme="dark"] .q-option .letter { background: var(--ink-3); }
.q-option.is-selected { border-color: var(--violet); background: var(--violet-soft); box-shadow: 0 8px 22px rgba(116,86,255,.14); }
.q-option.is-selected .letter { background: linear-gradient(135deg, var(--violet), var(--violet-600)); color: #fff; border-color: transparent; }
.q-option.is-correct { border-color: var(--emerald); background: var(--emerald-soft); }
.q-option.is-correct .letter { background: var(--emerald); color: #fff; border-color: transparent; }
.q-option.is-wrong { border-color: var(--rose); background: var(--rose-soft); }
.q-option.is-wrong .letter { background: var(--rose); color: #fff; border-color: transparent; }

.q-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); }

.q-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 25;
  padding: 12px clamp(12px, 3vw, 22px);
  background: color-mix(in srgb, var(--paper) 94%, transparent);
  backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
}
.q-nav-inner { max-width: 880px; margin: 0 auto; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.q-dots { display: flex; gap: 6px; flex-wrap: wrap; flex: 1; min-width: 0; }
.q-dot {
  width: 32px; height: 32px;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  background: var(--paper-2);
  color: var(--muted);
  font-size: .78rem; font-weight: 650;
  cursor: pointer;
  display: grid; place-items: center;
  transition: all .15s var(--ease);
  position: relative;
}
[data-theme="dark"] .q-dot { background: var(--paper); }
.q-dot:hover { border-color: var(--violet); }
.q-dot.is-answered { background: var(--emerald-soft); border-color: rgba(23,166,115,.4); color: var(--emerald); }
.q-dot.is-current { background: var(--violet); border-color: var(--violet); color: #fff; box-shadow: 0 6px 16px rgba(116,86,255,.32); }
.q-legend { display: flex; gap: 12px; flex-wrap: wrap; font-size: .74rem; color: var(--muted); align-items: center; }
.q-legend i { width: 9px; height: 9px; border-radius: 3px; display: inline-block; margin-right: 5px; vertical-align: middle; }

/* --------------------------------- Landing --------------------------------- */
.landing {
  min-height: 100vh;
  background:
    radial-gradient(900px 520px at 12% -8%, rgba(116,86,255,.16), transparent 62%),
    radial-gradient(760px 480px at 96% 6%, rgba(255,115,88,.14), transparent 60%),
    var(--paper);
  position: relative;
  overflow-x: hidden;
}
.landing:before {
  content: "";
  position: fixed; inset: 0;
  pointer-events: none;
  opacity: .5;
  background-image: radial-gradient(rgba(17,17,29,.11) .6px, transparent .6px);
  background-size: 9px 9px;
  mask-image: linear-gradient(180deg, #000, transparent 72%);
}
[data-theme="dark"] .landing:before { background-image: radial-gradient(rgba(255,255,255,.11) .6px, transparent .6px); }
.landing-wrap { width: min(100% - 34px, 1080px); margin: 0 auto; padding: 22px 0 60px; position: relative; }
.landing-nav { display: flex; align-items: center; gap: 14px; margin-bottom: 34px; }
.landing-nav .actions { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: 30px; align-items: center; }
@media (max-width: 900px) { .hero-grid { grid-template-columns: minmax(0, 1fr); } }
.hero-copy h1 { font-size: clamp(2rem, 1.3rem + 3.4vw, 3.3rem); letter-spacing: -.035em; line-height: 1.06; margin-bottom: 16px; }
.hero-copy .lead { font-size: clamp(1rem, .95rem + .3vw, 1.14rem); color: var(--muted); max-width: 52ch; }
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; margin: 24px 0 22px; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 6px 14px 6px 10px;
  border-radius: 999px;
  background: var(--paper-2);
  border: 1px solid var(--line-strong);
  font-size: .78rem; font-weight: 620; letter-spacing: .01em;
  margin-bottom: 20px;
  box-shadow: var(--shadow-xs);
}
.eyebrow .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--emerald); box-shadow: 0 0 0 4px var(--emerald-soft); }
.hero-stats { display: flex; gap: 26px; flex-wrap: wrap; margin-top: 8px; }
.hero-stat b { display: block; font-size: 1.5rem; font-weight: 750; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.hero-stat span { font-size: .78rem; color: var(--muted); }

.hero-panel {
  background: var(--ink);
  color: #fff;
  border-radius: var(--radius-xl);
  padding: 26px;
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: hidden;
}
.hero-panel:before {
  content: ""; position: absolute; width: 280px; height: 280px; right: -120px; top: -130px;
  border-radius: 50%; background: var(--violet); filter: blur(6px); opacity: .55;
}
.hero-panel:after {
  content: ""; position: absolute; width: 180px; height: 180px; left: -70px; bottom: -90px;
  border-radius: 50%; background: var(--coral); filter: blur(10px); opacity: .38;
}
.hero-panel > * { position: relative; }
.hero-panel h3 { color: #fff; margin-bottom: 4px; }
.hero-panel .muted { color: rgba(255,255,255,.66); }
.hero-panel .ladder-item { background: rgba(255,255,255,.07); border-color: rgba(255,255,255,.14); color: #fff; }
.hero-panel .ladder-item.is-active { background: rgba(116,86,255,.28); border-color: rgba(150,126,255,.5); }
.hero-panel .ladder-marker { background: rgba(255,255,255,.12); color: #fff; border-color: rgba(255,255,255,.18); }

.feature-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); margin-top: 18px; }
.feature {
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 20px;
  transition: transform .2s var(--ease), box-shadow .2s var(--ease);
}
[data-theme="dark"] .feature { background: var(--paper); }
.feature:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.feature .ico {
  width: 42px; height: 42px; border-radius: 13px;
  display: grid; place-items: center;
  background: var(--violet-soft); color: var(--violet-600);
  margin-bottom: 13px;
}
.feature h3 { font-size: 1rem; margin-bottom: 6px; }
.feature p { font-size: .87rem; color: var(--muted); margin: 0; }

/* ----------------------------------- Auth ---------------------------------- */
.auth-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  background: var(--paper);
}
@media (max-width: 940px) { .auth-page { grid-template-columns: minmax(0, 1fr); } .auth-aside { display: none; } }
.auth-aside {
  background:
    radial-gradient(560px 420px at 20% 10%, rgba(116,86,255,.4), transparent 62%),
    radial-gradient(460px 380px at 90% 80%, rgba(255,115,88,.32), transparent 60%),
    var(--ink);
  color: #fff;
  padding: 44px clamp(24px, 4vw, 54px);
  display: flex; flex-direction: column; justify-content: space-between;
  position: relative; overflow: hidden;
}
.auth-aside h2 { color: #fff; font-size: 1.7rem; letter-spacing: -.03em; }
.auth-aside p { color: rgba(255,255,255,.75); font-size: .92rem; }
.auth-aside .ladder-item { background: rgba(255,255,255,.07); border-color: rgba(255,255,255,.13); color: #fff; }
.auth-aside .ladder-item.is-active { background: rgba(116,86,255,.26); }
.auth-aside .ladder-marker { background: rgba(255,255,255,.12); color: #fff; border-color: rgba(255,255,255,.16); }
.auth-main { display: grid; place-items: center; padding: 32px clamp(18px, 4vw, 44px); }
.auth-card { width: min(100%, 440px); }
.auth-card h1 { font-size: 1.55rem; margin-bottom: 6px; }
.auth-card .sub { color: var(--muted); font-size: .9rem; margin-bottom: 22px; }
.auth-tabs { margin-bottom: 20px; }
.auth-foot { margin-top: 22px; font-size: .8rem; color: var(--muted); text-align: center; }

/* --------------------------------- Timeline -------------------------------- */
.timeline { display: flex; flex-direction: column; gap: 2px; position: relative; padding-left: 22px; }
.timeline:before { content: ""; position: absolute; left: 7px; top: 6px; bottom: 6px; width: 2px; background: var(--line); }
.timeline-item { position: relative; padding: 9px 0; }
.timeline-item:before {
  content: ""; position: absolute; left: -19px; top: 15px;
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--paper); border: 2px solid var(--violet-soft-2);
}
.timeline-item.is-done:before { background: var(--emerald); border-color: var(--emerald-soft); }
.timeline-item b { font-size: .88rem; font-weight: 620; display: block; }
.timeline-item span { font-size: .76rem; color: var(--muted); }

/* --------------------------------- Bar chart ------------------------------- */
.chart { display: flex; align-items: flex-end; gap: 6px; height: 150px; padding-top: 8px; }
.chart-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 0; }
.chart-bar {
  width: 100%; max-width: 38px;
  border-radius: 8px 8px 4px 4px;
  background: linear-gradient(180deg, var(--violet), var(--violet-600));
  min-height: 3px;
  position: relative;
  transition: height .6s var(--ease), filter .16s;
}
.chart-bar:hover { filter: brightness(1.12); }
.chart-bar.is-empty { background: var(--line); }
.chart-label { font-size: .68rem; color: var(--muted-2); white-space: nowrap; }
.chart-value { font-size: .68rem; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }

/* --------------------------------- Misc ----------------------------------- */
.kbd {
  font-family: var(--mono);
  font-size: .78rem;
  padding: 3px 7px;
  border-radius: 7px;
  background: var(--cream);
  border: 1px solid var(--line-strong);
  border-bottom-width: 2px;
}
[data-theme="dark"] .kbd { background: var(--ink-3); }
.toast-host { position: fixed; right: 18px; bottom: 18px; z-index: 90; display: flex; flex-direction: column; gap: 10px; max-width: min(360px, calc(100vw - 36px)); }
.toast {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 13px 15px;
  border-radius: var(--radius-sm);
  background: var(--ink);
  color: #fff;
  font-size: .86rem;
  box-shadow: var(--shadow-lg);
  animation: slideIn .3s var(--ease) both;
}
.toast.is-success { background: linear-gradient(120deg, #12a06f, #0c8159); }
.toast.is-error { background: linear-gradient(120deg, #d93b55, #b32440); }
.toast.is-info { background: linear-gradient(120deg, var(--violet), var(--violet-600)); }
.toast.is-out { animation: slideOut .25s var(--ease) both; }

.mobile-only { display: none; }
.hamburger { display: none; }
@media (max-width: 1024px) {
  .app-shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar {
    position: fixed; inset: 0 auto 0 0; width: min(300px, 86vw);
    transform: translateX(-102%);
    transition: transform .28s var(--ease);
    box-shadow: var(--shadow-lg);
    border-right: 0;
  }
  body.nav-open .sidebar { transform: none; }
  body.nav-open:after {
    content: ""; position: fixed; inset: 0; z-index: 35;
    background: rgba(12, 10, 24, .5);
    backdrop-filter: blur(2px);
  }
  .hamburger { display: inline-flex; }
  .mobile-only { display: block; }
  .content { padding-bottom: 40px; }
}
@media (max-width: 640px) {
  body { font-size: 14.5px; }
  .card-body { padding: 16px; }
  .card-head { padding: 14px 16px; }
  .deflist { grid-template-columns: minmax(0, 1fr); }
  .deflist dt { border-bottom: 0; padding-bottom: 0; }
  .deflist dd { padding-top: 4px; }
  .stat-value { font-size: 1.45rem; }
  .hero-stats { gap: 18px; }
  .q-dot { width: 29px; height: 29px; font-size: .72rem; }
  .toast-host { right: 12px; left: 12px; bottom: 12px; max-width: none; }
}

/* -------------------------------- Error page ------------------------------- */
.error-page { min-height: 100vh; display: grid; place-items: center; padding: 30px 18px; background: var(--canvas); }
.error-card {
  max-width: 560px; width: 100%; text-align: center;
  background: var(--paper); border: 1px solid var(--line);
  border-radius: var(--radius-xl); padding: 40px 28px;
  box-shadow: var(--shadow);
}
.error-code { font-size: 3.6rem; font-weight: 800; letter-spacing: -.05em; background: linear-gradient(120deg, var(--violet), var(--coral)); -webkit-background-clip: text; background-clip: text; color: transparent; line-height: 1; }
.error-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 22px; }
.error-trace {
  text-align: left; font-family: var(--mono); font-size: .74rem;
  background: var(--cream); border: 1px solid var(--line); border-radius: 12px;
  padding: 14px; max-height: 320px; overflow: auto; white-space: pre-wrap; word-break: break-word;
  margin-top: 18px;
}

/* --------------------------------- Print ---------------------------------- */
@media print {
  .sidebar, .topbar, .no-print, .q-nav { display: none !important; }
  .app-shell { grid-template-columns: minmax(0, 1fr); }
  body, .landing { background: #fff; }
  .card { box-shadow: none; border-color: #ddd; break-inside: avoid; }
}

/* ------------------------------ Progress bar ------------------------------ */
.progress {
  height: 10px;
  border-radius: 999px;
  background: var(--cream);
  border: 1px solid var(--line);
  overflow: hidden;
}
[data-theme="dark"] .progress { background: var(--ink-3); }
.progress > span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(120deg, var(--violet), var(--coral));
  transition: width .35s var(--ease);
}

/* -------------------------------- Animation ------------------------------- */
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes slideIn { from { opacity: 0; transform: translateX(22px); } to { opacity: 1; transform: none; } }
@keyframes slideOut { to { opacity: 0; transform: translateX(22px); } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .72; } }
@media (prefers-reduced-motion: reduce) {
  *, *:before, *:after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* ==========================================================================
   GEN-Z LAYER 2.0 — nuansa modern, playful, tetap rapi & aksesibel
   Dipakai di landing, halaman daftar, login, dan dashboard siswa.
   ========================================================================== */

:root {
  --gz-violet: #7c5cff;
  --gz-pink: #ff4d8d;
  --gz-lime: #b8f24a;
  --gz-cyan: #33e1d0;
  --gz-amber: #ffb545;
  --gz-ink: #0c0b18;
  --gz-r: 20px;
  --gz-r-lg: 30px;
  --gz-r-xl: 40px;
  --gz-glow: 0 18px 48px rgba(124, 92, 255, .34);
  --gz-glow-pink: 0 18px 48px rgba(255, 77, 141, .30);
  --gz-glass: rgba(255, 255, 255, .72);
  --gz-glass-line: rgba(255, 255, 255, .55);
}

[data-theme="dark"] {
  --gz-glass: rgba(22, 20, 38, .66);
  --gz-glass-line: rgba(255, 255, 255, .10);
}

/* ------------------------- Latar aurora / mesh --------------------------- */
.gz-aurora { position: relative; isolation: isolate; overflow: hidden; }
.gz-aurora::before,
.gz-aurora::after {
  content: ""; position: absolute; z-index: -1; border-radius: 50%;
  filter: blur(70px); opacity: .5; pointer-events: none;
}
.gz-aurora::before {
  width: 46rem; height: 46rem; top: -22rem; right: -14rem;
  background: radial-gradient(circle at 40% 40%, var(--gz-violet), transparent 62%);
  animation: gzDrift 22s ease-in-out infinite alternate;
}
.gz-aurora::after {
  width: 34rem; height: 34rem; bottom: -16rem; left: -12rem;
  background: radial-gradient(circle at 60% 60%, var(--gz-pink), transparent 64%);
  animation: gzDrift 26s ease-in-out infinite alternate-reverse;
}
[data-theme="dark"] .gz-aurora::before,
[data-theme="dark"] .gz-aurora::after { opacity: .34; }
@keyframes gzDrift {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to   { transform: translate3d(-3rem, 2.5rem, 0) scale(1.13); }
}

/* ------------------------------- Navigasi -------------------------------- */
.gz-nav {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 12px 18px; margin: 14px auto 0; max-width: 1120px;
  border-radius: 999px;
  background: var(--gz-glass);
  border: 1px solid var(--gz-glass-line);
  backdrop-filter: blur(16px) saturate(160%);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  box-shadow: var(--shadow);
}
.gz-nav .gz-links { display: flex; gap: 4px; flex-wrap: wrap; }
.gz-nav .gz-link {
  padding: 8px 14px; border-radius: 999px; font-size: .87rem; font-weight: 600;
  color: var(--muted); text-decoration: none; transition: .2s var(--ease);
}
.gz-nav .gz-link:hover, .gz-nav .gz-link.is-on { color: var(--ink); background: var(--violet-soft); }

/* --------------------------------- Tombol -------------------------------- */
.gz-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 13px 22px; border-radius: 999px; border: 1px solid transparent;
  font: inherit; font-weight: 700; font-size: .93rem; cursor: pointer;
  text-decoration: none; transition: transform .18s var(--ease), box-shadow .18s var(--ease), background .18s var(--ease);
}
.gz-btn:hover { transform: translateY(-2px); }
.gz-btn:active { transform: translateY(0); }
.gz-btn-primary {
  background: linear-gradient(120deg, var(--gz-violet), var(--gz-pink) 92%);
  color: #fff; box-shadow: var(--gz-glow);
}
.gz-btn-primary:hover { box-shadow: 0 22px 58px rgba(124, 92, 255, .46); }
.gz-btn-lime { background: var(--gz-lime); color: #16260a; box-shadow: 0 16px 40px rgba(184, 242, 74, .38); }
.gz-btn-ghost {
  background: var(--gz-glass); color: var(--ink);
  border-color: var(--gz-glass-line); backdrop-filter: blur(12px);
}
.gz-btn-lg { padding: 16px 30px; font-size: 1rem; }
.gz-btn-block { width: 100%; }

/* --------------------------------- Chip ---------------------------------- */
.gz-chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 15px; border-radius: 999px; font-size: .8rem; font-weight: 650;
  background: var(--gz-glass); border: 1px solid var(--gz-glass-line); color: var(--ink);
  backdrop-filter: blur(10px);
}
.gz-chip .gz-dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--gz-lime);
  box-shadow: 0 0 0 4px rgba(184, 242, 74, .26); animation: gzPulse 2.2s infinite;
}
@keyframes gzPulse { 0%, 100% { opacity: 1; } 50% { opacity: .45; } }
.gz-chip-row { display: flex; gap: 8px; flex-wrap: wrap; }

/* --------------------------------- Hero ---------------------------------- */
.gz-hero {
  max-width: 1120px; margin: 0 auto; padding: 46px 18px 12px;
  display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(0, .92fr);
  gap: 34px; align-items: center;
}
.gz-display {
  font-size: clamp(2.15rem, 5.4vw, 3.6rem); line-height: 1.03;
  letter-spacing: -.035em; font-weight: 800; margin: 18px 0 16px; color: var(--ink);
}
.gz-display .gz-grad {
  background: linear-gradient(105deg, var(--gz-violet), var(--gz-pink) 46%, var(--gz-amber));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.gz-display .gz-mark {
  background: linear-gradient(105deg, var(--gz-cyan), var(--gz-violet));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.gz-lead { font-size: 1.03rem; line-height: 1.68; color: var(--muted); max-width: 34rem; margin: 0 0 26px; }
.gz-cta-row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }

.gz-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 34px; max-width: 30rem; }
.gz-stat {
  padding: 16px 18px; border-radius: var(--gz-r);
  background: var(--gz-glass); border: 1px solid var(--gz-glass-line);
  backdrop-filter: blur(12px);
}
.gz-stat b { display: block; font-size: 1.72rem; font-weight: 800; letter-spacing: -.03em; color: var(--ink); }
.gz-stat span { font-size: .75rem; color: var(--muted); font-weight: 600; }

/* ------------------------------ Panel kaca ------------------------------- */
.gz-panel {
  padding: 24px; border-radius: var(--gz-r-lg);
  background: var(--gz-glass); border: 1px solid var(--gz-glass-line);
  backdrop-filter: blur(18px) saturate(150%);
  box-shadow: var(--shadow-lg);
}
.gz-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.gz-panel-head h3 { margin: 0; font-size: 1.02rem; }

/* -------------------------- Kartu level (playful) ------------------------ */
.gz-levels { max-width: 1120px; margin: 46px auto 0; padding: 0 18px; }
.gz-level-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(228px, 1fr)); gap: 16px; margin-top: 20px; }
.gz-level {
  position: relative; padding: 22px; border-radius: var(--gz-r-lg);
  background: var(--paper-2); border: 1px solid var(--line);
  box-shadow: var(--shadow-sm); overflow: hidden;
  transition: transform .22s var(--ease), box-shadow .22s var(--ease), border-color .22s var(--ease);
}
.gz-level:hover { transform: translateY(-5px); box-shadow: var(--shadow-lg); border-color: var(--violet-soft-2); }
.gz-level::after {
  content: ""; position: absolute; inset: auto -30% -60% auto; width: 12rem; height: 12rem;
  border-radius: 50%; opacity: .16; background: var(--gz-accent, var(--gz-violet)); filter: blur(10px);
}
.gz-level .gz-lv-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.gz-level .gz-lv-no {
  display: grid; place-items: center; width: 44px; height: 44px; border-radius: 15px;
  font-weight: 800; font-size: 1.05rem; color: #fff;
  background: linear-gradient(140deg, var(--gz-accent, var(--gz-violet)), rgba(0, 0, 0, .28));
}
.gz-level h3 { margin: 16px 0 6px; font-size: 1.04rem; }
.gz-level p { margin: 0; font-size: .84rem; color: var(--muted); line-height: 1.6; }
.gz-level .gz-lv-tag {
  display: inline-flex; margin-top: 14px; padding: 5px 12px; border-radius: 999px;
  font-size: .74rem; font-weight: 700; color: var(--ink);
  background: color-mix(in srgb, var(--gz-accent, var(--gz-violet)) 16%, transparent);
}
.gz-level.is-locked { opacity: .62; }

/* --------------------------- Langkah / timeline -------------------------- */
.gz-steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; margin-top: 20px; counter-reset: gzstep; }
.gz-step {
  position: relative; padding: 24px 22px 22px; border-radius: var(--gz-r-lg);
  background: var(--paper-2); border: 1px solid var(--line); box-shadow: var(--shadow-sm);
}
.gz-step::before {
  counter-increment: gzstep; content: counter(gzstep);
  position: absolute; top: -14px; left: 22px;
  width: 34px; height: 34px; border-radius: 12px; display: grid; place-items: center;
  font-weight: 800; font-size: .95rem; color: #fff;
  background: linear-gradient(135deg, var(--gz-violet), var(--gz-pink));
  box-shadow: 0 10px 24px rgba(124, 92, 255, .34);
}
.gz-step h3 { margin: 12px 0 6px; font-size: .98rem; }
.gz-step p { margin: 0; font-size: .84rem; color: var(--muted); line-height: 1.62; }
.gz-step .gz-ico {
  display: inline-grid; place-items: center; width: 40px; height: 40px; margin-top: 16px;
  border-radius: 14px; background: var(--violet-soft); color: var(--violet);
}

/* ------------------------------- Marquee --------------------------------- */
.gz-marquee {
  margin: 34px auto 0; max-width: 1120px; overflow: hidden; position: relative;
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}
.gz-marquee-track { display: flex; gap: 10px; width: max-content; animation: gzScroll 34s linear infinite; }
.gz-marquee:hover .gz-marquee-track { animation-play-state: paused; }
@keyframes gzScroll { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* --------------------------------- CTA ----------------------------------- */
.gz-cta {
  max-width: 1120px; margin: 48px auto 0; padding: 40px 30px; border-radius: var(--gz-r-xl);
  background: linear-gradient(125deg, #14122a, #2b1b4d 46%, #4a1e46);
  color: #fff; text-align: center; position: relative; overflow: hidden;
}
.gz-cta::after {
  content: ""; position: absolute; inset: -40% -10% auto auto; width: 26rem; height: 26rem;
  border-radius: 50%; background: radial-gradient(circle, rgba(255, 77, 141, .5), transparent 66%);
}
.gz-cta h2 { margin: 0 0 10px; font-size: clamp(1.5rem, 3.4vw, 2.1rem); letter-spacing: -.02em; }
.gz-cta p { margin: 0 auto 24px; max-width: 34rem; color: rgba(255, 255, 255, .78); }
.gz-cta .gz-cta-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; position: relative; z-index: 1; }

/* ------------------------------ Form peserta ----------------------------- */
.gz-form-page {
  min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  background: var(--canvas);
}
.gz-form-side {
  padding: 44px 40px; color: #fff;
  background: linear-gradient(160deg, #1a1038, #3b1b57 52%, #5a1f4a);
  display: flex; flex-direction: column; justify-content: space-between; gap: 26px; position: relative; overflow: hidden;
}
.gz-form-side::after {
  content: ""; position: absolute; inset: auto -20% -30% auto; width: 24rem; height: 24rem;
  border-radius: 50%; background: radial-gradient(circle, rgba(124, 92, 255, .55), transparent 66%);
}
.gz-form-side h2 { font-size: clamp(1.5rem, 3vw, 2.05rem); line-height: 1.15; margin: 0 0 12px; letter-spacing: -.02em; }
.gz-form-side p { color: rgba(255, 255, 255, .74); line-height: 1.7; margin: 0; max-width: 30rem; }
.gz-form-side .gz-side-list { display: grid; gap: 12px; margin-top: 24px; position: relative; z-index: 1; }
.gz-form-side .gz-side-item { display: flex; gap: 12px; align-items: flex-start; font-size: .88rem; color: rgba(255, 255, 255, .86); }
.gz-form-side .gz-side-item .gz-ico {
  flex: 0 0 auto; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 12px;
  background: rgba(255, 255, 255, .12); color: #fff;
}
.gz-form-main { display: grid; place-items: center; padding: 40px 22px; }
.gz-form-card {
  width: 100%; max-width: 460px; padding: 30px; border-radius: var(--gz-r-lg);
  background: var(--paper-2); border: 1px solid var(--line); box-shadow: var(--shadow-lg);
}
.gz-form-card h1 { margin: 0 0 6px; font-size: 1.5rem; letter-spacing: -.02em; }
.gz-form-card .gz-sub { margin: 0 0 22px; color: var(--muted); font-size: .9rem; line-height: 1.6; }

.gz-field { display: flex; flex-direction: column; gap: 7px; margin-bottom: 15px; }
.gz-label { font-size: .85rem; font-weight: 700; color: var(--ink-2); display: flex; align-items: center; gap: 6px; }
.gz-label .req { color: var(--gz-pink); }
.gz-input {
  width: 100%; padding: 13px 15px; border-radius: 14px; font: inherit; font-size: .95rem;
  border: 1.5px solid var(--line-strong); background: var(--paper);
  color: var(--ink); transition: .18s var(--ease);
}
.gz-input:focus { outline: none; border-color: var(--gz-violet); box-shadow: 0 0 0 4px var(--violet-soft); background: var(--paper-2); }
.gz-input.is-invalid { border-color: var(--rose); }
.gz-input-group { display: flex; align-items: stretch; }
.gz-input-group .gz-prefix {
  display: grid; place-items: center; padding: 0 14px; border-radius: 14px 0 0 14px;
  border: 1.5px solid var(--line-strong); border-right: 0;
  background: var(--cream); font-weight: 700; font-size: .9rem; color: var(--muted);
}
.gz-input-group .gz-input { border-radius: 0 14px 14px 0; }
.gz-hint { font-size: .77rem; color: var(--muted); line-height: 1.5; }
.gz-error { font-size: .78rem; color: var(--rose); font-weight: 600; }

/* --------------------------- Kartu ujian siswa --------------------------- */
.gz-exam-card {
  position: relative; padding: 22px; border-radius: var(--gz-r-lg);
  background: var(--paper-2); border: 1px solid var(--line); box-shadow: var(--shadow-sm);
  display: flex; flex-direction: column; gap: 14px; overflow: hidden;
  transition: transform .2s var(--ease), box-shadow .2s var(--ease);
}
.gz-exam-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.gz-exam-card::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 4px;
  background: linear-gradient(90deg, var(--gz-accent, var(--gz-violet)), var(--gz-pink));
}
.gz-exam-card h3 { margin: 0; font-size: 1.06rem; line-height: 1.35; }
.gz-exam-meta { display: flex; gap: 8px; flex-wrap: wrap; }
.gz-exam-foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

/* --------------------------- Bottom nav (mobile) ------------------------- */
.gz-bottomnav {
  position: fixed; inset: auto 0 0 0; z-index: 45; display: none;
  padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
  background: var(--gz-glass); border-top: 1px solid var(--gz-glass-line);
  backdrop-filter: blur(18px) saturate(160%);
}

/* ------------------------------- Utilitas -------------------------------- */
.gz-center { text-align: center; }
.gz-gap-sm { display: grid; gap: 10px; }
.gz-tag-lime { background: rgba(184, 242, 74, .24); color: #3f5a08; }
[data-theme="dark"] .gz-tag-lime { color: var(--gz-lime); }
.gz-sec-title { font-size: clamp(1.35rem, 3vw, 1.9rem); letter-spacing: -.025em; margin: 0; }
.gz-sec-sub { color: var(--muted); margin: 10px 0 0; max-width: 36rem; line-height: 1.66; }
.gz-wrap { max-width: 1120px; margin: 0 auto; padding: 0 18px; }

/* ------------------------------- Responsif ------------------------------- */
@media (max-width: 900px) {
  .gz-hero { grid-template-columns: minmax(0, 1fr); padding-top: 30px; }
  .gz-form-page { grid-template-columns: minmax(0, 1fr); }
  .gz-form-side { padding: 32px 22px; }
  .gz-nav { border-radius: 26px; }
  .gz-bottomnav { display: flex; justify-content: space-around; }
  body.has-bottomnav { padding-bottom: 74px; }
}
@media (max-width: 560px) {
  .gz-display { font-size: clamp(1.95rem, 8.4vw, 2.6rem); }
  .gz-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .gz-stat { padding: 12px 12px; }
  .gz-stat b { font-size: 1.34rem; }
  .gz-cta { padding: 30px 20px; border-radius: 30px; }
  .gz-form-card { padding: 24px 20px; }
}

/* --------------------------------------------------------------------------
   PROGRES LIVE — indikator pantauan pengerjaan ujian
   Dipakai di halaman /admin/progres.
   -------------------------------------------------------------------------- */
.live-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .14);
  border: 1px solid rgba(255, 255, 255, .22);
  color: #fff;
  font-size: .86rem;
  font-weight: 600;
  white-space: nowrap;
}
.live-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #3ddc97;
  box-shadow: 0 0 0 0 rgba(61, 220, 151, .6);
  animation: livePulse 2s infinite;
}
@keyframes livePulse {
  0%   { box-shadow: 0 0 0 0 rgba(61, 220, 151, .55); }
  70%  { box-shadow: 0 0 0 9px rgba(61, 220, 151, 0); }
  100% { box-shadow: 0 0 0 0 rgba(61, 220, 151, 0); }
}
@media (prefers-reduced-motion: reduce) {
  .live-dot { animation: none; }
}
.progress > span.is-warn { background: linear-gradient(120deg, var(--amber), var(--coral)); }
.table td .progress { min-width: 120px; }
