/* ==========================================================
   Easylearn Student Portal — design system
   Dark ("night") is the default theme. Light is opt-in via
   <html data-theme="light">, toggled by portal.js.
   ========================================================== */

:root {
  --bg: #0D0B1E;
  --surface: #16142C;
  --surface-2: #201D3B;
  --surface-3: #2A2650;
  --text: #ECEAF8;
  --muted: #A4A1C4;
  --border: #2B2850;
  --accent: #4F46E5;
  --accent-hover: #5B53F0;
  --accent-text: #B4B0FD;
  --accent-soft: rgba(139, 132, 248, 0.18);
  --green-bg: rgba(34, 197, 94, 0.15);   --green: #86EFAC;  --on-green: #0D0B1E;
  --amber-bg: rgba(245, 158, 11, 0.15);  --amber: #FCD34D;
  --blue-bg: rgba(59, 130, 246, 0.16);   --blue: #93C5FD;
  --red-bg: rgba(239, 68, 68, 0.15);     --red: #FCA5A5;
  --shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
  --radius: 16px;
  --radius-sm: 12px;
  --font: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  color-scheme: dark;
}

html[data-theme="light"] {
  --bg: #F5F7FB;
  --surface: #FFFFFF;
  --surface-2: #F1F4F9;
  --surface-3: #E7EBF3;
  --text: #0F172A;
  --muted: #556075;
  --border: #E3E8F0;
  --accent-text: #4F46E5;
  --accent-soft: rgba(79, 70, 229, 0.10);
  --green-bg: #DCFCE7;  --green: #15803D;  --on-green: #FFFFFF;
  --amber-bg: #FEF3C7;  --amber: #92400E;
  --blue-bg: #DBEAFE;   --blue: #1E40AF;
  --red-bg: #FEE2E2;    --red: #991B1B;
  --shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent-text); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }
svg { flex-shrink: 0; }
h1, h2, h3, h4 { margin: 0; letter-spacing: -0.02em; line-height: 1.2; }
p { margin: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.mt-0 { margin-top: 0; }
.hidden { display: none !important; }

/* ---------- App shell ---------- */
.app { min-height: 100vh; display: flex; }
.sidebar {
  width: 272px; flex-shrink: 0;
  display: flex; flex-direction: column; gap: 24px;
  padding: 24px 16px;
  background: var(--surface);
  border-right: 1px solid var(--border);
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.brand { display: flex; align-items: center; gap: 12px; padding: 4px 12px; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 42px; height: 42px; border-radius: 12px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--accent); color: #fff; overflow: hidden;
}
.brand-mark img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.brand-mark .logo-fallback { display: none; }
.brand-mark.no-logo .logo-fallback { display: block; }
.brand-name { font-weight: 800; font-size: 18px; letter-spacing: -0.02em; display: block; }
.brand-sub { font-size: 12px; color: var(--muted); display: block; }

.nav { display: flex; flex-direction: column; gap: 20px; }
.nav-group { display: flex; flex-direction: column; gap: 4px; }
.nav-title {
  font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--muted); padding: 0 12px 6px;
}
.nav-link {
  display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 0 12px;
  border-radius: 10px; font-weight: 600; color: var(--muted);
  transition: background .15s, color .15s;
}
.nav-link:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.nav-link.active { background: var(--accent-soft); color: var(--accent-text); }
.nav-link span.label { flex: 1; }
.count {
  min-width: 24px; height: 22px; padding: 0 7px; border-radius: 999px;
  font-size: 12px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center;
  background: var(--surface-2); color: var(--muted);
}
.count.accent { background: var(--accent); color: #fff; }
.count.amber { background: var(--amber-bg); color: var(--amber); }
.count.green { background: var(--green-bg); color: var(--green); }
.count.red { background: var(--red-bg); color: var(--red); }
.sidebar-foot { margin-top: auto; display: flex; flex-direction: column; gap: 12px; }
.help-card { padding: 16px; border-radius: 14px; background: var(--surface-2); display: flex; flex-direction: column; gap: 8px; }
.help-card strong { display: flex; align-items: center; gap: 8px; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 16px;
  padding: 18px 32px; background: var(--surface); border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 20;
}
.topbar-title { flex: 1 1 200px; display: flex; flex-direction: column; gap: 2px; }
.crumbs { font-size: 13px; color: var(--muted); }
.crumbs a { color: var(--muted); }
.topbar h1 { font-size: 22px; font-weight: 800; }
.top-actions { display: flex; align-items: center; gap: 8px; }
.icon-btn {
  width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
}
.icon-btn:hover { background: var(--surface-2); }
.menu-btn { display: none; }
.user-chip {
  display: flex; align-items: center; gap: 10px; padding: 4px 12px 4px 4px;
  border-radius: 12px; border: 1px solid var(--border); color: var(--text);
}
.user-chip:hover { text-decoration: none; background: var(--surface-2); }
.avatar {
  width: 36px; height: 36px; border-radius: 10px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 14px; background: var(--accent-soft); color: var(--accent-text);
}
.avatar.lg { width: 64px; height: 64px; border-radius: 18px; font-size: 22px; }
.user-chip .name { font-weight: 700; font-size: 14px; display: block; line-height: 1.2; }
.user-chip .id { font-size: 12px; color: var(--muted); display: block; }
.theme-toggle .ic-sun { display: none; }
html:not([data-theme="light"]) .theme-toggle .ic-sun { display: block; }
html:not([data-theme="light"]) .theme-toggle .ic-moon { display: none; }

.page { padding: 32px; width: 100%; max-width: 1240px; display: flex; flex-direction: column; gap: 24px; }
.footer { margin-top: auto; padding: 20px 32px; font-size: 13px; color: var(--muted); border-top: 1px solid var(--border); display: flex; flex-wrap: wrap; gap: 8px; justify-content: space-between; }
.footer a { color: var(--muted); }

.overlay { display: none; }

/* ---------- Cards & layout helpers ---------- */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px;
  display: flex; flex-direction: column; gap: 16px;
}
.card-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.card-head h2, .card-head h3 { font-size: 18px; font-weight: 800; }
.card-head .sub { font-size: 13px; color: var(--muted); }
.card-title { display: flex; align-items: center; gap: 12px; }
.row { display: flex; flex-wrap: wrap; gap: 24px; }
.row > .grow-3 { flex: 3 1 420px; min-width: 0; }
.row > .grow-2 { flex: 2 1 300px; min-width: 0; }
.row > .grow-1 { flex: 1 1 260px; min-width: 0; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.stack { display: flex; flex-direction: column; gap: 12px; }
.inline { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.between { justify-content: space-between; }

.icon-tile {
  width: 44px; height: 44px; border-radius: 12px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--accent-soft); color: var(--accent-text);
}
.icon-tile.green { background: var(--green-bg); color: var(--green); }
.icon-tile.amber { background: var(--amber-bg); color: var(--amber); }
.icon-tile.blue { background: var(--blue-bg); color: var(--blue); }
.icon-tile.red { background: var(--red-bg); color: var(--red); }

.pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px;
  border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap;
  background: var(--accent-soft); color: var(--accent-text);
}
.pill .dot { width: 8px; height: 8px; border-radius: 999px; background: currentColor; }
.pill.green { background: var(--green-bg); color: var(--green); }
.pill.amber { background: var(--amber-bg); color: var(--amber); }
.pill.blue { background: var(--blue-bg); color: var(--blue); }
.pill.red { background: var(--red-bg); color: var(--red); }
.pill.grey { background: var(--surface-2); color: var(--muted); }
.pill.lg { padding: 6px 12px; font-size: 13px; }

/* Hero */
.hero {
  position: relative; overflow: hidden;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 24px;
  padding: 32px; border-radius: 20px; background: var(--accent); color: #fff;
}
.hero::before, .hero::after { content: ""; position: absolute; border-radius: 999px; pointer-events: none; }
.hero::before { right: -60px; top: -80px; width: 280px; height: 280px; border: 40px solid rgba(255,255,255,.08); }
.hero::after { right: 140px; bottom: -110px; width: 200px; height: 200px; background: rgba(255,255,255,.06); }
.hero > * { position: relative; z-index: 1; }
.hero-body { flex: 1 1 380px; display: flex; flex-direction: column; gap: 12px; }
.hero h2 { font-size: 32px; font-weight: 800; letter-spacing: -0.03em; line-height: 1.15; }
.hero p { max-width: 560px; font-size: 16px; color: rgba(255,255,255,.88); }
.hero-tag {
  display: inline-flex; align-self: flex-start; align-items: center; gap: 8px;
  padding: 6px 12px; border-radius: 999px; background: rgba(255,255,255,.16);
  font-size: 13px; font-weight: 600;
}
.hero-art {
  width: 148px; height: 148px; border-radius: 36px; background: rgba(255,255,255,.14);
  display: flex; align-items: center; justify-content: center;
}

/* Stat cards */
.stat { padding: 20px; gap: 16px; transition: transform .15s, box-shadow .15s; }
.stat:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.stat-label { font-size: 13px; font-weight: 600; color: var(--muted); }
.stat-value { font-size: 30px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.1; }

/* Progress timeline */
.timeline { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.timeline li { display: flex; gap: 16px; }
.tl-rail { display: flex; flex-direction: column; align-items: center; }
.tl-dot {
  width: 36px; height: 36px; border-radius: 999px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface-2); color: var(--muted);
}
.tl-line { width: 2px; flex: 1; min-height: 20px; background: var(--border); }
.timeline li:last-child .tl-line { display: none; }
.tl-body { display: flex; flex-direction: column; gap: 2px; padding: 6px 0 20px; }
.tl-body strong { font-weight: 700; }
.tl-body span { font-size: 13px; color: var(--muted); }
.timeline .done .tl-dot { background: var(--green); color: var(--on-green); }
.timeline .done .tl-line { background: var(--green); }
.timeline .current .tl-dot { background: var(--amber-bg); color: var(--amber); border: 2px solid var(--amber); }
.timeline .failed .tl-dot { background: var(--red-bg); color: var(--red); border: 2px solid var(--red); }
.timeline .todo .tl-body strong { color: var(--muted); }

/* Quick action rows */
.action-row {
  display: flex; align-items: center; gap: 14px; padding: 14px;
  border-radius: 14px; border: 1px solid var(--border); color: var(--text);
  transition: transform .15s, box-shadow .15s, background .15s;
}
.action-row:hover { text-decoration: none; background: var(--surface-2); transform: translateY(-1px); }
.action-row .txt { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.action-row .txt strong { font-weight: 700; }
.action-row .txt span { font-size: 13px; color: var(--muted); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 18px; border-radius: 12px;
  font: inherit; font-size: 14px; font-weight: 700; cursor: pointer;
  border: 1px solid transparent; text-decoration: none; white-space: nowrap;
  transition: background .15s, border-color .15s, transform .1s;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-secondary { background: var(--surface-2); color: var(--text); border-color: var(--border); }
.btn-secondary:hover { background: var(--surface-3); }
.btn-ghost { background: transparent; color: var(--muted); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.btn-success { background: #16A34A; color: #fff; }
.btn-success:hover { background: #15803D; }
.btn-danger { background: transparent; color: var(--red); border-color: var(--red-bg); }
.btn-white { background: #fff; color: var(--accent); }
.btn-outline-white { background: transparent; color: #fff; border-color: rgba(255,255,255,.4); }
.btn-block { width: 100%; }
.btn-sm { min-height: 36px; padding: 0 12px; font-size: 13px; border-radius: 10px; }
.btn[disabled], .btn.disabled { opacity: .55; pointer-events: none; }

/* ---------- Forms ---------- */
.form-grid { display: grid; gap: 16px 20px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.form-grid .span-all { grid-column: 1 / -1; }
.field, .form-group { display: flex; flex-direction: column; gap: 6px; margin: 0 0 4px; }
.field label, .form-group label, .label { font-size: 13px; font-weight: 600; color: var(--text); }
.field .hint { font-size: 12px; color: var(--muted); }
.req { color: var(--red); margin-left: 2px; }
.input, .form-control, select.custom-select {
  width: 100%; min-height: 46px; padding: 10px 14px;
  border-radius: 12px; border: 1px solid var(--border);
  background: var(--bg); color: var(--text);
  font: inherit; font-size: 14px; outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.input::placeholder, .form-control::placeholder { color: var(--muted); opacity: .8; }
.input:focus, .form-control:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.input[readonly] { background: var(--surface-2); color: var(--muted); }
select.input, select.form-control {
  appearance: none; -webkit-appearance: none; 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='%23A4A1C4' 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;
}
.is-invalid { border-color: var(--red) !important; box-shadow: 0 0 0 3px var(--red-bg) !important; }
.input-icon { position: relative; }
.input-icon svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.input-icon .input { padding-left: 44px; }
.input-icon .reveal {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  width: 36px; height: 36px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.input-icon .reveal svg { position: static; transform: none; }

/* Choice cards (radio) */
.choices { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.choice { position: relative; display: block; cursor: pointer; }
.choice input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.choice .choice-box {
  display: flex; gap: 12px; align-items: flex-start; padding: 16px;
  border-radius: 14px; border: 1px solid var(--border); background: var(--bg);
  transition: border-color .15s, background .15s;
}
.choice .choice-box strong { display: block; }
.choice .choice-box span.muted { font-size: 13px; }
.choice input:checked + .choice-box { border-color: var(--accent); background: var(--accent-soft); }
.choice input:focus-visible + .choice-box { box-shadow: 0 0 0 3px var(--accent-soft); }

/* File drop */
.file-drop {
  position: relative; display: flex; align-items: center; gap: 14px;
  padding: 16px; border-radius: 14px; border: 1.5px dashed var(--border);
  background: var(--bg); cursor: pointer; transition: border-color .15s, background .15s;
}
.file-drop:hover, .file-drop.dragover { border-color: var(--accent); background: var(--accent-soft); }
.file-drop input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.file-drop .txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.file-drop .txt strong { font-size: 14px; }
.file-drop .txt span { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-drop.has-file { border-style: solid; border-color: var(--green); }
.file-drop.has-file .icon-tile { background: var(--green-bg); color: var(--green); }

/* Section within forms */
.section-title { display: flex; align-items: center; gap: 12px; }
.section-title h3 { font-size: 17px; font-weight: 800; }
.section-title p { font-size: 13px; color: var(--muted); }
.divider { height: 1px; background: var(--border); border: 0; margin: 4px 0; }

/* ---------- Alerts / toasts ---------- */
.alert {
  display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px;
  border-radius: 14px; background: var(--blue-bg); color: var(--text); font-size: 14px;
}
.alert svg { color: var(--blue); margin-top: 1px; }
.alert.amber { background: var(--amber-bg); } .alert.amber svg { color: var(--amber); }
.alert.red { background: var(--red-bg); } .alert.red svg { color: var(--red); }
.alert.green { background: var(--green-bg); } .alert.green svg { color: var(--green); }
.toast-wrap { position: fixed; right: 20px; bottom: 20px; z-index: 100; display: flex; flex-direction: column; gap: 10px; max-width: min(380px, calc(100vw - 40px)); }
.toast {
  display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: 14px;
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow);
  animation: toast-in .25s ease-out;
}
.toast svg { color: var(--accent-text); }
.toast button { margin-left: auto; background: none; border: 0; color: var(--muted); cursor: pointer; padding: 0; }
@keyframes toast-in { from { transform: translateY(12px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 12px; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th {
  padding: 12px 16px; text-align: left; background: var(--surface-2);
  font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); white-space: nowrap;
}
.table td { padding: 14px 16px; border-top: 1px solid var(--border); vertical-align: middle; }
.table tr:hover td { background: rgba(255,255,255,.015); }
.table .input, .table select.input { min-height: 42px; }
.table.form-table td { padding: 8px 10px; }
.table.form-table th { padding: 10px; }
.empty {
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px;
  padding: 40px 20px; color: var(--muted);
}
.empty .icon-tile { width: 56px; height: 56px; border-radius: 16px; }
.empty strong { color: var(--text); font-size: 16px; }

/* Definition list (details) */
.dl { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.dl > div { padding: 14px 16px; border-bottom: 1px solid var(--border); border-right: 1px solid var(--border); display: flex; flex-direction: column; gap: 2px; margin: 0 -1px -1px 0; }
.dl dt { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.dl dd { margin: 0; font-weight: 600; word-break: break-word; }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: 4px; overflow-x: auto; padding: 4px; border-radius: 14px; background: var(--surface-2); scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab {
  display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 14px;
  border-radius: 10px; border: 0; background: transparent; color: var(--muted);
  font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; white-space: nowrap;
}
.tab:hover { color: var(--text); }
.tab[aria-selected="true"] { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.tab .count { height: 20px; min-width: 20px; font-size: 11px; }
.tab-panel[hidden] { display: none; }

.doc-frame { width: 100%; height: 640px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); }
.doc-head { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; }

/* ---------- Wizard ---------- */
.wizard-shell { min-height: 100vh; display: flex; flex-direction: column; }
.wizard-top {
  display: flex; align-items: center; gap: 16px; padding: 16px 32px;
  background: var(--surface); border-bottom: 1px solid var(--border);
}
.wizard-top .spacer { flex: 1; }
.wizard-main { width: 100%; max-width: 1040px; margin: 0 auto; padding: 32px 24px 64px; display: flex; flex-direction: column; gap: 24px; }
.wizard-intro { display: flex; flex-direction: column; gap: 6px; }
.wizard-intro h1 { font-size: 28px; font-weight: 800; }
.wizard-intro p { color: var(--muted); }

.stepper { list-style: none; margin: 0; padding: 0; display: flex; gap: 8px; counter-reset: step; }
.stepper li { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.stepper .bar { height: 6px; border-radius: 999px; background: var(--surface-2); }
.stepper .meta { display: flex; align-items: center; gap: 10px; }
.stepper .num {
  width: 28px; height: 28px; border-radius: 999px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 800; background: var(--surface-2); color: var(--muted);
}
.stepper .txt { display: flex; flex-direction: column; min-width: 0; }
.stepper .txt strong { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stepper .txt span { font-size: 12px; color: var(--muted); }
.stepper .done .bar { background: var(--green); }
.stepper .done .num { background: var(--green); color: var(--on-green); }
.stepper .current .bar { background: var(--accent); }
.stepper .current .num { background: var(--accent); color: #fff; }
.stepper .todo .txt strong { color: var(--muted); }

.sub-steps { display: flex; gap: 8px; flex-wrap: wrap; }
.sub-step {
  display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px;
  background: var(--surface-2); color: var(--muted); font-size: 13px; font-weight: 600; border: 0; font-family: inherit; cursor: pointer;
}
.sub-step.active { background: var(--accent-soft); color: var(--accent-text); }
.sub-step.complete { color: var(--green); }
.panel[hidden] { display: none; }
.wizard-nav {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding-top: 8px;
}
.wizard-nav .spacer { flex: 1; }

/* ---------- Auth pages ---------- */
.auth { min-height: 100vh; display: flex; flex-wrap: wrap; }
.auth-aside {
  flex: 1 1 440px; position: relative; overflow: hidden;
  padding: 48px; display: flex; flex-direction: column; gap: 32px; justify-content: space-between;
  background: var(--accent); color: #fff;
}
.auth-aside::before { content: ""; position: absolute; right: -120px; top: -120px; width: 420px; height: 420px; border-radius: 999px; border: 60px solid rgba(255,255,255,.07); }
.auth-aside::after { content: ""; position: absolute; left: -80px; bottom: -140px; width: 320px; height: 320px; border-radius: 999px; background: rgba(255,255,255,.06); }
.auth-aside > * { position: relative; z-index: 1; }
.auth-aside h1 { font-size: 40px; font-weight: 800; letter-spacing: -0.03em; line-height: 1.1; max-width: 480px; }
.auth-aside p.lead { font-size: 17px; color: rgba(255,255,255,.88); max-width: 460px; margin-top: 14px; }
.auth-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; max-width: 460px; }
.auth-steps li { display: flex; gap: 14px; align-items: flex-start; }
.auth-steps .n {
  width: 32px; height: 32px; border-radius: 10px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,.16); font-weight: 800; font-size: 14px;
}
.auth-steps strong { display: block; }
.auth-steps span { font-size: 14px; color: rgba(255,255,255,.82); }
.auth-brand { display: flex; align-items: center; gap: 12px; }
.auth-brand .brand-mark { background: rgba(255,255,255,.16); width: 48px; height: 48px; }
.auth-brand .brand-name { font-size: 20px; color: #fff; }
.auth-brand .brand-sub { color: rgba(255,255,255,.8); }
.auth-main { flex: 1 1 480px; display: flex; align-items: center; justify-content: center; padding: 48px 24px; position: relative; }
.auth-card { width: 100%; max-width: 440px; display: flex; flex-direction: column; gap: 22px; }
.auth-card h2 { font-size: 28px; font-weight: 800; }
.auth-card .sub { color: var(--muted); margin-top: 6px; }
.auth-switch {
  display: grid; grid-template-columns: 1fr 1fr; padding: 4px; border-radius: 14px; background: var(--surface-2);
}
.auth-switch a { text-align: center; padding: 10px; border-radius: 10px; font-weight: 700; font-size: 14px; color: var(--muted); }
.auth-switch a:hover { text-decoration: none; color: var(--text); }
.auth-switch a.on { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgba(0,0,0,.25); }
.auth-theme { position: absolute; top: 20px; right: 20px; }
details.manual { border: 1px solid rgba(255,255,255,.25); border-radius: 14px; padding: 14px 16px; max-width: 460px; }
details.manual summary { cursor: pointer; font-weight: 700; display: flex; align-items: center; gap: 10px; list-style: none; }
details.manual summary::-webkit-details-marker { display: none; }
details.manual[open] summary { margin-bottom: 10px; }
details.manual p { font-size: 14px; color: rgba(255,255,255,.88); margin-bottom: 8px; }

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .sidebar {
    position: fixed; left: 0; top: 0; bottom: 0; z-index: 60;
    transform: translateX(-100%); transition: transform .2s ease; box-shadow: var(--shadow);
  }
  body.nav-open .sidebar { transform: none; }
  body.nav-open .overlay { display: block; position: fixed; inset: 0; z-index: 50; background: rgba(0,0,0,.5); }
  .menu-btn { display: inline-flex; }
  .topbar { padding: 14px 16px; }
  .page { padding: 20px 16px; }
  .user-chip .txt { display: none; }
  .user-chip { padding: 4px; }
}
@media (max-width: 720px) {
  .hero { padding: 24px; }
  .hero h2 { font-size: 26px; }
  .hero-art { display: none; }
  .stepper .txt span { display: none; }
  .stepper .txt strong { font-size: 12px; }
  .wizard-top { padding: 12px 16px; gap: 10px; }
  .wizard-top .pill, .wizard-top .brand-sub { display: none; }
  .wizard-main { padding: 20px 16px 48px; }
  .auth-aside { padding: 32px 24px; }
  .auth-aside h1 { font-size: 30px; }
  .auth-aside .auth-steps, .auth-aside details { display: none; }
  .doc-frame { height: 460px; }
  .card { padding: 18px; }
}
@media (max-width: 520px) {
  .stepper .txt { display: none; }
}
@media print {
  .sidebar, .topbar, .footer, .no-print { display: none !important; }
  body { background: #fff; color: #000; }
}

/* ---------- Results entry rows ---------- */
.subject-head, .subject-row {
  display: grid; gap: 10px; align-items: center;
  grid-template-columns: minmax(180px, 2fr) 120px 140px 110px minmax(150px, 1.3fr);
}
.subject-head { padding: 0 4px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.subject-row { padding: 10px; border-radius: 14px; background: var(--bg); border: 1px solid var(--border); }
.subject-row .tag { display: flex; align-items: center; gap: 10px; font-weight: 700; }
.subject-row .input { min-height: 42px; }
.subject-rows { display: flex; flex-direction: column; gap: 10px; }
.subject-row.hidden { display: none; }
.subject-row label.sr-only + .input { margin: 0; }
.work-row { display: grid; gap: 10px; align-items: center; grid-template-columns: minmax(180px, 2fr) minmax(160px, 1fr) minmax(220px, 1.4fr); padding: 10px; border-radius: 14px; background: var(--bg); border: 1px solid var(--border); }
.work-row .file-drop { padding: 8px 10px; }
.work-row .file-drop .icon-tile { width: 32px; height: 32px; border-radius: 10px; }
.work-row .file-drop .btn { display: none; }
.tert-row { display: grid; gap: 10px; align-items: center; grid-template-columns: 150px minmax(180px, 2fr) 120px minmax(200px, 1.4fr); padding: 10px; border-radius: 14px; background: var(--bg); border: 1px solid var(--border); }
.tert-row.hidden { display: none; }
.tert-row .file-drop { padding: 8px 10px; }
.tert-row .file-drop .icon-tile { width: 32px; height: 32px; border-radius: 10px; }
.tert-row .file-drop .btn { display: none; }
@media (max-width: 860px) {
  .subject-head { display: none; }
  .subject-row { grid-template-columns: 1fr 1fr; }
  .subject-row > :first-child { grid-column: 1 / -1; }
  .work-row, .tert-row { grid-template-columns: 1fr; }
}
a.sub-step:hover { text-decoration: none; color: var(--text); }
html { scroll-behavior: smooth; scroll-padding-top: 100px; }

.table td .inline { flex-wrap: nowrap; white-space: nowrap; }
