/* ==========================================================================
   Levelora 2 — design system (shared + professional shell)
   ========================================================================== */

:root {
  --font-display: "Outfit", "Segoe UI", system-ui, sans-serif;
  --font-body: "Atkinson Hyperlegible", "Segoe UI", system-ui, sans-serif;
  --font-game: "Fredoka", "Outfit", "Segoe UI", sans-serif;

  --ink-950: #0b0b26;
  --ink-900: #121236;
  --ink-800: #1b1a4a;
  --ink-700: #2b2a63;
  --text: #1b1e3a;
  --text-2: #3b4060;
  --muted: #646a87;
  --faint: #9aa0b9;
  --bg: #f4f5fb;
  --surface: #ffffff;
  --surface-2: #f8f8fd;
  --surface-3: #f1f2f9;
  --line: #e5e7f1;
  --line-2: #eef0f7;

  --brand: #6a45f5;
  --brand-600: #5b35e6;
  --brand-700: #4a27c4;
  --brand-50: #f4f1ff;
  --brand-100: #ebe5ff;
  --brand-200: #d7ccff;
  --brand-grad: linear-gradient(135deg, #8b5cf6 0%, #6a45f5 55%, #5b35e6 100%);
  --pink: #ec4899;
  --gold: #f5b100;

  --radius-xs: 8px;
  --radius-sm: 10px;
  --radius: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;

  --shadow-xs: 0 1px 2px rgba(18, 18, 54, .06);
  --shadow: 0 1px 2px rgba(18, 18, 54, .04), 0 6px 20px rgba(18, 18, 54, .06);
  --shadow-md: 0 2px 6px rgba(18, 18, 54, .05), 0 16px 40px rgba(18, 18, 54, .09);
  --shadow-lg: 0 30px 70px rgba(18, 18, 54, .18);
  --ring-focus: 0 0 0 3px rgba(106, 69, 245, .35);

  --side-w: 264px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --spring: cubic-bezier(.34, 1.56, .64, 1);
}

/* ---------- tones: every component reads --tone, --tone-bg, --tone-ink ---------- */
.tone-violet { --tone: #6a45f5; --tone-bg: #f1edff; --tone-ink: #4a27c4; --tone-2: #a78bfa; }
.tone-green { --tone: #16a34a; --tone-bg: #e7f7ed; --tone-ink: #166534; --tone-2: #4ade80; }
.tone-amber { --tone: #e58a00; --tone-bg: #fff3dc; --tone-ink: #92400e; --tone-2: #fbbf24; }
.tone-rose { --tone: #e11d48; --tone-bg: #ffe8ee; --tone-ink: #9f1239; --tone-2: #fb7185; }
.tone-sky { --tone: #0284c7; --tone-bg: #e3f3fd; --tone-ink: #075985; --tone-2: #38bdf8; }
.tone-teal { --tone: #0d9488; --tone-bg: #dff5f2; --tone-ink: #115e59; --tone-2: #2dd4bf; }
.tone-indigo { --tone: #4f46e5; --tone-bg: #eaeaff; --tone-ink: #3730a3; --tone-2: #818cf8; }
.tone-slate { --tone: #64748b; --tone-bg: #f0f2f6; --tone-ink: #334155; --tone-2: #94a3b8; }
.tone-gold { --tone: #d99a00; --tone-bg: #fff6d8; --tone-ink: #854d0e; --tone-2: #fcd34d; }
.tone-pink { --tone: #db2777; --tone-bg: #fde7f3; --tone-ink: #9d174d; --tone-2: #f472b6; }

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  color: var(--text);
  background: var(--bg);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
img, svg { max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { font-family: var(--font-display); letter-spacing: -.02em; color: var(--ink-900); margin: 0; line-height: 1.15; }
h1 { font-size: clamp(1.7rem, 2.4vw, 2.2rem); font-weight: 700; }
h2 { font-size: 1.12rem; font-weight: 650; }
h3 { font-size: 1rem; font-weight: 650; }
p { margin: 0 0 .75em; }
a { color: var(--brand-600); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: none; box-shadow: var(--ring-focus); border-radius: 6px; }
.ico { width: 1.15em; height: 1.15em; flex: none; vertical-align: -0.2em; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 12px; top: -48px; background: #fff; padding: 8px 12px; z-index: 100; border-radius: 8px; }
.skip:focus { top: 12px; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: .86rem; }
.tiny { font-size: .76rem; }
.strong { font-weight: 700; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.center { text-align: center; }
.mt-0 { margin-top: 0 !important; } .mt-1 { margin-top: 6px; } .mt-2 { margin-top: 12px; } .mt-3 { margin-top: 20px; } .mt-4 { margin-top: 32px; }
.mb-0 { margin-bottom: 0 !important; } .mb-1 { margin-bottom: 6px; } .mb-2 { margin-bottom: 12px; } .mb-3 { margin-bottom: 20px; }
.row { display: flex; gap: 12px; align-items: center; }
.row-wrap { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row-between { display: flex; gap: 12px; align-items: center; justify-content: space-between; }
.stack { display: grid; gap: 14px; }
.stack-sm { display: grid; gap: 8px; }
.grow { flex: 1; min-width: 0; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 6px; margin: 0 0 6px;
  font-family: var(--font-display); font-weight: 700; font-size: .74rem; letter-spacing: .09em; text-transform: uppercase;
  color: var(--brand-600);
}
.divider { height: 1px; background: var(--line); margin: 16px 0; border: 0; }

/* ---------- grid ---------- */
.grid { display: grid; gap: 20px; }
.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.cols-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.cols-main { grid-template-columns: minmax(0, 1fr) 360px; align-items: start; }
.cols-wide { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); align-items: start; }
.span-2 { grid-column: span 2; }
.span-all { grid-column: 1 / -1; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 40px; padding: 9px 16px; border-radius: 12px; border: 1px solid transparent;
  font-family: var(--font-display); font-weight: 650; font-size: .93rem; line-height: 1.1;
  cursor: pointer; text-decoration: none !important; white-space: nowrap;
  transition: transform .15s var(--ease), box-shadow .15s var(--ease), background .15s, border-color .15s, color .15s;
}
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn.is-disabled { opacity: .55; cursor: not-allowed; transform: none; }
.btn-primary { background: var(--brand-grad); color: #fff; box-shadow: 0 6px 16px rgba(106, 69, 245, .32); }
.btn-primary:hover { box-shadow: 0 10px 24px rgba(106, 69, 245, .42); }
.btn-soft { background: var(--brand-50); color: var(--brand-700); }
.btn-soft:hover { background: var(--brand-100); }
.btn-ghost { background: #fff; color: var(--text); border-color: var(--line); box-shadow: var(--shadow-xs); }
.btn-ghost:hover { border-color: var(--brand-200); color: var(--brand-700); }
.btn-plain { background: transparent; color: var(--text-2); }
.btn-plain:hover { background: var(--surface-3); }
.btn-danger { background: #fff; color: #be123c; border-color: #fecdd3; }
.btn-danger:hover { background: #fff1f2; }
.btn-success { background: linear-gradient(135deg, #22c55e, #16a34a); color: #fff; box-shadow: 0 6px 16px rgba(22, 163, 74, .3); }
.btn-dark { background: var(--ink-900); color: #fff; }
.btn-sm { min-height: 32px; padding: 6px 11px; font-size: .84rem; border-radius: 10px; }
.btn-xs { min-height: 26px; padding: 4px 9px; font-size: .78rem; border-radius: 8px; gap: 5px; }
.btn-lg { min-height: 50px; padding: 12px 22px; font-size: 1.02rem; border-radius: 14px; }
.btn-block { width: 100%; }
.btn-icon { width: 40px; padding: 0; }
.btn-icon.btn-sm { width: 32px; }
.btn .ico { width: 1.1em; height: 1.1em; }
.link-btn { background: none; border: 0; padding: 0; color: var(--brand-600); font-weight: 700; cursor: pointer; display: inline-flex; gap: 6px; align-items: center; }
.link-btn:hover { text-decoration: underline; }
form.inline { display: inline; margin: 0; }

/* ---------- pills, badges, chips ---------- */
.pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px; border-radius: 999px; font-size: .76rem; font-weight: 700; line-height: 1.4;
  font-family: var(--font-display); letter-spacing: .01em;
  background: var(--tone-bg, var(--surface-3)); color: var(--tone-ink, var(--text-2));
}
.pill .ico { width: 12px; height: 12px; }
.pill-outline { background: #fff; border: 1px solid var(--line); color: var(--text-2); }
.count {
  display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px;
  background: var(--pink); color: #fff; font-size: .72rem; font-weight: 800; font-family: var(--font-display);
}
.chip-ico {
  display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; flex: none;
  background: var(--tone-bg, var(--brand-50)); color: var(--tone, var(--brand));
}
.chip-ico .ico { width: 20px; height: 20px; }
.chip-ico.lg { width: 48px; height: 48px; border-radius: 14px; }
.chip-ico.lg .ico { width: 24px; height: 24px; }
.chip-ico.sm { width: 30px; height: 30px; border-radius: 9px; }
.chip-ico.sm .ico { width: 16px; height: 16px; }
.code-tag {
  display: inline-block; padding: 2px 7px; border-radius: 6px; background: var(--surface-3); color: var(--text-2);
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: .74rem; font-weight: 600; letter-spacing: .02em;
}
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--tone, var(--faint)); flex: none; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 0 rgba(34, 197, 94, .6); animation: livePulse 1.8s infinite; display: inline-block; }
@keyframes livePulse { 0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, .55); } 70% { box-shadow: 0 0 0 9px rgba(34, 197, 94, 0); } 100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); } }

/* ---------- stars ---------- */
.stars { display: inline-flex; gap: 1px; }
.stars i { color: #d7dae6; display: inline-flex; }
.stars i.on { color: #fbbf24; filter: drop-shadow(0 1px 0 rgba(180, 120, 0, .35)); }
.stars .ico { width: 14px; height: 14px; }

/* ---------- meters & rings ---------- */
.meter { display: block; height: 8px; border-radius: 99px; background: var(--surface-3); overflow: hidden; position: relative; }
.meter > span {
  display: block; height: 100%; border-radius: inherit;
  background: linear-gradient(90deg, var(--tone-2, #a78bfa), var(--tone, var(--brand)));
  transition: width .6s var(--ease);
}
.meter.thick { height: 12px; }
.meter.thin { height: 5px; }
.ring { position: relative; width: var(--size, 120px); height: var(--size, 120px); flex: none; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring-track { fill: none; stroke: var(--surface-3); stroke-width: 9; }
.ring-bar { fill: none; stroke: var(--tone, var(--brand)); stroke-width: 9; stroke-linecap: round; transition: stroke-dashoffset 1s var(--ease); }
.ring-label { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; line-height: 1.05; }
.ring-label strong { font-family: var(--font-display); font-size: calc(var(--size, 120px) * .24); font-weight: 750; color: var(--ink-900); letter-spacing: -.03em; }
.ring-label small { color: var(--muted); font-size: .72rem; margin-top: 3px; font-weight: 600; }

/* ---------- avatar ---------- */
.av { display: inline-grid; place-items: center; border-radius: 50%; overflow: hidden; flex: none; position: relative; background: var(--surface-3); }
.av svg { width: 100%; height: 100%; display: block; }
.av-xs { width: 26px; height: 26px; }
.av-sm { width: 34px; height: 34px; }
.av-md { width: 44px; height: 44px; }
.av-lg { width: 60px; height: 60px; }
.av-xl { width: 88px; height: 88px; }
.av-xxl { width: 140px; height: 140px; }
.av-initials { color: #fff; font-family: var(--font-display); font-weight: 700; background: hsl(var(--hue, 262) 62% 54%); font-size: .9em; }
.av-ring { box-shadow: 0 0 0 3px #fff, 0 0 0 5px var(--tone, var(--brand)); }
.av-stack { display: inline-flex; }
.av-stack .av { box-shadow: 0 0 0 2px #fff; margin-left: -8px; }
.av-stack .av:first-child { margin-left: 0; }

/* ---------- cards ---------- */
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg);
  box-shadow: var(--shadow); padding: 20px; min-width: 0;
}
.card + .card { margin-top: 0; }
.card.flush { padding: 0; overflow: hidden; }
.card.tinted { background: linear-gradient(180deg, var(--brand-50), #fff 60%); border-color: var(--brand-100); }
.card.dark { background: linear-gradient(145deg, #1d1a55, #121236); color: #e7e8fb; border-color: transparent; }
.card.dark h2, .card.dark h3 { color: #fff; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.card-head h2 { display: flex; align-items: center; gap: 10px; }
.card-head .sub { color: var(--muted); font-size: .85rem; font-weight: 400; font-family: var(--font-body); }
.card-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line-2); }
.section-title { display: flex; align-items: center; justify-content: space-between; margin: 28px 0 14px; }
.section-title h2 { font-size: 1.2rem; }

/* ---------- stat tiles ---------- */
.stat { display: flex; align-items: center; gap: 14px; min-width: 0; }
.stat .val { font-family: var(--font-display); font-weight: 750; font-size: 1.65rem; color: var(--ink-900); letter-spacing: -.03em; line-height: 1; }
.stat .lbl { color: var(--muted); font-size: .84rem; margin-top: 4px; }
.stat-card { padding: 18px 18px; }
.delta { display: inline-flex; align-items: center; gap: 3px; font-size: .78rem; font-weight: 700; font-family: var(--font-display); padding: 2px 7px; border-radius: 99px; }
.delta.up { color: #15803d; background: #e7f7ed; }
.delta.down { color: #be123c; background: #ffe8ee; }
.delta.flat { color: var(--muted); background: var(--surface-3); }
.delta .ico { width: 12px; height: 12px; }
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }

/* ---------- lists ---------- */
.list { list-style: none; margin: 0; padding: 0; }
.list > li { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line-2); }
.list > li:last-child { border-bottom: 0; }
.list .meta { color: var(--muted); font-size: .84rem; }
.bars { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.bars li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 10px; align-items: center; }
.bars li .meter { grid-column: 1 / -1; }
.bars .name { font-weight: 600; display: flex; align-items: center; gap: 8px; min-width: 0; }
.bars .num { font-family: var(--font-display); font-weight: 700; font-size: .9rem; }
.feed { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.feed li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 9px 10px; border-radius: 12px; }
.feed li:hover { background: var(--surface-2); }
.feed time { color: var(--faint); font-size: .78rem; white-space: nowrap; }
.feed .msg { font-size: .9rem; }
.feed .msg b { font-weight: 700; }
.feed.new li:first-child { animation: feedIn .5s var(--ease); }
@keyframes feedIn { from { background: var(--brand-50); transform: translateY(-4px); opacity: .3; } }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; border-radius: var(--radius); }
.table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: .92rem; }
.table th {
  text-align: left; font-family: var(--font-display); font-weight: 650; font-size: .76rem; letter-spacing: .05em; text-transform: uppercase;
  color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--line); background: var(--surface-2); white-space: nowrap;
}
.table td { padding: 12px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: #fbfbff; }
.table .person { display: flex; align-items: center; gap: 10px; font-weight: 650; }

/* ---------- heatmap ---------- */
.heat { border-collapse: separate; border-spacing: 4px; width: 100%; }
.heat th { font-family: var(--font-display); font-size: .74rem; font-weight: 650; color: var(--muted); text-align: left; padding: 2px 4px; }
.heat th.skill { writing-mode: vertical-rl; transform: rotate(180deg); white-space: nowrap; height: 132px; vertical-align: bottom; text-align: left; }
.heat td.cell {
  width: 38px; height: 34px; border-radius: 8px; text-align: center; font-family: var(--font-display); font-weight: 700; font-size: .74rem;
  color: rgba(255, 255, 255, .95); position: relative; cursor: default;
}
.heat td.who { white-space: nowrap; padding-right: 8px; }
.h-none { background: #eef0f6; color: var(--faint) !important; }
.h-0 { background: #fb7185; } .h-1 { background: #fb923c; } .h-2 { background: #fbbf24; color: #5b3b00 !important; }
.h-3 { background: #a3e635; color: #234000 !important; } .h-4 { background: #34d399; } .h-5 { background: #10b981; } .h-6 { background: #7c3aed; }
.heat-legend { display: flex; gap: 10px; flex-wrap: wrap; font-size: .76rem; color: var(--muted); align-items: center; }
.heat-legend i { display: inline-block; width: 12px; height: 12px; border-radius: 4px; vertical-align: -2px; margin-right: 4px; }

/* ---------- forms ---------- */
.field { display: grid; gap: 6px; }
.field > span, .label { font-family: var(--font-display); font-weight: 600; font-size: .86rem; color: var(--text-2); }
.field small { color: var(--muted); font-size: .8rem; }
.input, .field input:not([type="checkbox"]):not([type="radio"]), .field select, .field textarea, .select, textarea.input {
  width: 100%; min-height: 42px; border: 1px solid var(--line); border-radius: 11px; background: #fff;
  padding: 9px 12px; transition: border-color .15s, box-shadow .15s;
}
.field textarea, textarea.input { min-height: 96px; resize: vertical; line-height: 1.5; }
.input:focus, .field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--brand); box-shadow: var(--ring-focus); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }
.check { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; }
.check input { margin-top: 3px; accent-color: var(--brand); width: 17px; height: 17px; }
.switch { position: relative; display: inline-flex; align-items: center; gap: 12px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch .track { width: 44px; height: 26px; border-radius: 99px; background: #d7dae6; position: relative; transition: background .2s; flex: none; }
.switch .track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .25s var(--spring); }
.switch input:checked + .track { background: var(--brand); }
.switch input:checked + .track::after { transform: translateX(18px); }
.switch input:focus-visible + .track { box-shadow: var(--ring-focus); }
.seg { display: inline-flex; padding: 4px; background: var(--surface-3); border-radius: 12px; gap: 2px; }
.seg a, .seg button, .seg label { border: 0; background: transparent; padding: 7px 13px; border-radius: 9px; font-family: var(--font-display); font-weight: 600; font-size: .86rem; color: var(--muted); cursor: pointer; text-decoration: none !important; display: inline-flex; gap: 6px; align-items: center; }
.seg .is-on, .seg input:checked + span { background: #fff; color: var(--ink-900); box-shadow: var(--shadow-xs); }
.seg input { display: none; }

/* ---------- tabs ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 20px; overflow-x: auto; }
.tabs a, .tabs button {
  display: inline-flex; gap: 8px; align-items: center; padding: 11px 14px; border: 0; background: none; cursor: pointer;
  color: var(--muted); font-family: var(--font-display); font-weight: 600; font-size: .92rem; border-bottom: 2px solid transparent; margin-bottom: -1px;
  text-decoration: none !important; white-space: nowrap;
}
.tabs a:hover { color: var(--ink-900); }
.tabs .is-on { color: var(--brand-600); border-bottom-color: var(--brand); }

/* ---------- banners & notices ---------- */
.banner {
  display: flex; gap: 12px; align-items: flex-start; padding: 13px 16px; border-radius: 14px;
  background: var(--tone-bg, var(--brand-50)); color: var(--tone-ink, var(--brand-700)); margin-bottom: 18px; font-size: .94rem;
  border: 1px solid color-mix(in srgb, var(--tone, var(--brand)) 18%, transparent);
}
.banner .ico { width: 20px; height: 20px; margin-top: 1px; }
.banner strong { font-family: var(--font-display); }
.empty { text-align: center; padding: 36px 20px; color: var(--muted); }
.empty .chip-ico { margin: 0 auto 12px; }
.empty h3 { color: var(--ink-900); margin-bottom: 4px; }
.callout { border-radius: 16px; padding: 14px 16px; background: var(--surface-2); border: 1px dashed var(--line); }
.evidence { font-size: .8rem; color: var(--muted); display: flex; gap: 6px; align-items: center; }
.evidence .ico { width: 13px; height: 13px; }
.ai-tag { display: inline-flex; gap: 5px; align-items: center; padding: 2px 8px; border-radius: 99px; background: linear-gradient(135deg, #f3e8ff, #e0e7ff); color: #5b21b6; font-size: .72rem; font-weight: 700; font-family: var(--font-display); }
.ai-tag .ico { width: 12px; height: 12px; }

/* ---------- toasts & modal ---------- */
.toasts { position: fixed; right: 20px; bottom: 20px; display: grid; gap: 10px; z-index: 200; width: min(380px, calc(100vw - 40px)); }
.toast {
  display: flex; gap: 12px; align-items: flex-start; background: var(--ink-900); color: #eef0ff; border-radius: 16px; padding: 13px 15px;
  box-shadow: var(--shadow-lg); animation: toastIn .4s var(--spring); font-size: .92rem;
}
.toast .ico { width: 20px; height: 20px; color: #a78bfa; margin-top: 1px; }
.toast.out { animation: toastOut .3s var(--ease) forwards; }
@keyframes toastIn { from { transform: translateY(16px) scale(.96); opacity: 0; } }
@keyframes toastOut { to { transform: translateY(10px); opacity: 0; } }
.modal { position: fixed; inset: 0; z-index: 300; display: grid; place-items: center; padding: 20px; background: rgba(12, 12, 40, .55); backdrop-filter: blur(4px); animation: fadeIn .2s; }
.modal[hidden] { display: none; }
.modal-card { background: #fff; border-radius: 24px; padding: 26px; width: min(560px, 100%); max-height: calc(100vh - 40px); overflow: auto; box-shadow: var(--shadow-lg); animation: popIn .35s var(--spring); }
.modal-card.wide { width: min(860px, 100%); }
.modal-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 14px; }
@keyframes fadeIn { from { opacity: 0; } }
@keyframes popIn { from { transform: scale(.94) translateY(10px); opacity: 0; } }

/* ---------- dropdown ---------- */
.menu { position: relative; }
.menu > summary { list-style: none; cursor: pointer; }
.menu > summary::-webkit-details-marker { display: none; }
.menu-pop { position: absolute; right: 0; top: calc(100% + 8px); min-width: 230px; background: #fff; border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-md); padding: 8px; z-index: 50; }
.menu-pop a, .menu-pop button { display: flex; gap: 10px; align-items: center; width: 100%; padding: 9px 10px; border-radius: 10px; color: var(--text); background: none; border: 0; cursor: pointer; text-align: left; font-size: .92rem; text-decoration: none !important; }
.menu-pop a:hover, .menu-pop button:hover { background: var(--surface-3); }

/* ==========================================================================
   Professional shell (tutor, parent, centre, platform)
   ========================================================================== */
.app { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); min-height: 100vh; }
.side {
  position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; gap: 18px;
  padding: 22px 14px 16px; color: #c9cbea;
  background: radial-gradient(120% 60% at 0% 0%, #2a2378 0%, transparent 60%), linear-gradient(180deg, #17154a 0%, #0f0e31 100%);
}
.brand { display: flex; align-items: center; gap: 11px; color: inherit; text-decoration: none !important; }
.brand .logo-mark { width: 38px; height: 38px; flex: none; filter: drop-shadow(0 6px 14px rgba(139, 92, 246, .45)); }
.brand strong { display: block; font-family: var(--font-display); font-weight: 750; font-size: 1.32rem; color: #fff; letter-spacing: -.02em; line-height: 1; }
.brand small { display: block; color: #a6a8d6; font-size: .72rem; margin-top: 3px; }
.side-label { font-family: var(--font-display); font-size: .68rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: #7f82b8; padding: 0 12px; margin: 8px 0 2px; }
.side-nav { display: grid; gap: 3px; }
.side-nav a {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; color: #c9cbea; font-weight: 600; font-family: var(--font-display); font-size: .95rem;
  text-decoration: none !important; transition: background .15s, color .15s;
}
.side-nav a .ico { width: 19px; height: 19px; opacity: .85; }
.side-nav a:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.side-nav a.is-on { background: linear-gradient(135deg, #8b5cf6, #6a45f5); color: #fff; box-shadow: 0 10px 24px rgba(106, 69, 245, .38); }
.side-nav a.is-on .ico { opacity: 1; }
.side-nav a .count { margin-left: auto; }
.side-card { margin-top: auto; background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .08); border-radius: 16px; padding: 12px; display: flex; gap: 10px; align-items: center; }
.side-card strong { display: block; color: #fff; font-family: var(--font-display); font-size: .92rem; }
.side-card small { color: #a6a8d6; font-size: .76rem; }
.side-card .btn-icon { margin-left: auto; color: #c9cbea; background: transparent; border: 0; min-height: 34px; width: 34px; }
.side-card .btn-icon:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.side-toggle { display: none; }
.main { min-width: 0; }
.topbar {
  position: sticky; top: 0; z-index: 40; display: flex; align-items: center; gap: 14px; padding: 14px 32px;
  background: rgba(244, 245, 251, .82); backdrop-filter: saturate(1.4) blur(12px);
}
.topbar .crumbs { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: .88rem; font-family: var(--font-display); font-weight: 600; min-width: 0; }
.topbar .crumbs a { color: var(--muted); }
.topbar .crumbs .ico { width: 14px; height: 14px; }
.topbar .spacer { flex: 1; }
.icon-btn { position: relative; display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: #fff; border: 1px solid var(--line); color: var(--text-2); cursor: pointer; }
.icon-btn:hover { color: var(--brand-600); border-color: var(--brand-200); }
.icon-btn .count { position: absolute; top: -6px; right: -6px; transform: scale(.9); }
.page { padding: 4px 32px 56px; max-width: 1560px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; margin: 6px 0 24px; flex-wrap: wrap; }
.page-head p { color: var(--muted); margin: 6px 0 0; }
.page-head .actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

/* ---------- marketing / auth ---------- */
.market { min-height: 100vh; background: radial-gradient(1100px 520px at 85% -10%, #e5ddff 0%, transparent 60%), radial-gradient(800px 400px at -10% 20%, #ffe4f3 0%, transparent 55%), var(--bg); }
.market-nav { width: min(1200px, calc(100% - 40px)); margin: 0 auto; display: flex; align-items: center; justify-content: space-between; padding: 22px 0; }
.market-nav .brand strong { color: var(--ink-900); }
.market-nav .brand small { color: var(--muted); }
.market-nav nav { display: flex; gap: 22px; align-items: center; }
.market-nav nav a { color: var(--text-2); font-family: var(--font-display); font-weight: 600; }
.wrap { width: min(1200px, calc(100% - 40px)); margin: 0 auto; }
.hero { display: grid; grid-template-columns: 1.05fr .95fr; gap: 48px; align-items: center; padding: 30px 0 70px; }
.hero h1 { font-size: clamp(2.4rem, 4.6vw, 3.9rem); line-height: 1.02; letter-spacing: -.035em; }
.hero h1 em { font-style: normal; background: linear-gradient(120deg, #7c3aed, #db2777); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lede { font-size: 1.18rem; color: var(--text-2); max-width: 54ch; margin: 18px 0 26px; }
.auth { display: grid; grid-template-columns: minmax(0, 440px) minmax(0, 1fr); gap: 28px; width: min(1180px, calc(100% - 40px)); margin: 10px auto 60px; align-items: start; }
.auth-card { background: #fff; border-radius: 28px; padding: 32px; box-shadow: var(--shadow-md); border: 1px solid var(--line); }
.demo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.demo-btn { display: flex; gap: 12px; align-items: center; width: 100%; padding: 10px 12px; border-radius: 14px; border: 1px solid var(--line); background: #fff; cursor: pointer; text-align: left; transition: border-color .15s, transform .15s, box-shadow .15s; }
.demo-btn:hover { border-color: var(--brand-200); box-shadow: var(--shadow); transform: translateY(-1px); }
.demo-btn strong { display: block; font-family: var(--font-display); font-size: .94rem; }
.demo-btn small { color: var(--muted); }

/* ---------- responsive ---------- */
@media (max-width: 1280px) {
  .cols-main { grid-template-columns: minmax(0, 1fr) 320px; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1100px) {
  .cols-3, .cols-4, .cols-5 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cols-main, .cols-wide { grid-template-columns: minmax(0, 1fr); }
  .hero, .auth { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .side { position: fixed; inset: 0 auto 0 0; width: 280px; z-index: 90; transform: translateX(-102%); transition: transform .3s var(--ease); }
  body.nav-open .side { transform: none; box-shadow: var(--shadow-lg); }
  .side-toggle { display: inline-grid; }
  .topbar, .page { padding-left: 16px; padding-right: 16px; }
  .cols-2, .cols-3, .cols-4, .cols-5, .form-grid, .kpis { grid-template-columns: minmax(0, 1fr); }
  .span-2 { grid-column: auto; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}
.reduce-motion *, .reduce-motion *::before, .reduce-motion *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
.large-text { font-size: 18.5px; }
.readable { letter-spacing: .02em; word-spacing: .08em; line-height: 1.7; }
@media print {
  .side, .topbar, .no-print { display: none !important; }
  .app { display: block; }
  .card { box-shadow: none; break-inside: avoid; }
  body { background: #fff; }
}
