/* ============================================================
   Excel de cero a Ninja v1.0.0 · sistema visual
   Sin dependencias externas. Tema claro/oscuro y responsive.
   ============================================================ */

:root {
  color-scheme: light;
  --bg: #f3f6f1;
  --bg-soft: #eaf0e8;
  --surface: #ffffff;
  --surface-2: #f8faf7;
  --surface-3: #eef3ec;
  --ink: #17251f;
  --ink-soft: #34463d;
  --muted: #68766f;
  --line: #dde6dc;
  --line-strong: #c9d6c8;
  --brand: #14573f;
  --brand-2: #1a7a58;
  --brand-soft: #e1f1e8;
  --brand-ink: #0c3c2b;
  --gold: #b1843c;
  --gold-soft: #f6edda;
  --danger: #b43f3f;
  --danger-soft: #fbe9e8;
  --warning: #a56a15;
  --warning-soft: #fbf1dd;
  --success: #1d7a50;
  --success-soft: #e4f4ea;
  --info: #2e6481;
  --info-soft: #e6f0f6;
  --shadow-sm: 0 1px 2px rgba(21, 48, 35, .05), 0 8px 24px rgba(21, 48, 35, .05);
  --shadow-md: 0 18px 50px rgba(18, 48, 33, .10);
  --shadow-lg: 0 28px 80px rgba(18, 48, 33, .16);
  --radius-sm: 9px;
  --radius: 15px;
  --radius-lg: 24px;
  --sidebar: 262px;
  --topbar: 74px;
  --font: "Segoe UI", "Inter", "Helvetica Neue", Arial, sans-serif;
  --mono: "Cascadia Code", "Consolas", "SFMono-Regular", Menlo, monospace;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0f1914;
  --bg-soft: #14231c;
  --surface: #17271f;
  --surface-2: #1b2d24;
  --surface-3: #21362c;
  --ink: #ebf2ed;
  --ink-soft: #c9d8d0;
  --muted: #94a69d;
  --line: #2a4035;
  --line-strong: #365143;
  --brand: #3cae82;
  --brand-2: #52c797;
  --brand-soft: #1d3c2e;
  --brand-ink: #d9f5e7;
  --gold: #d6b26e;
  --gold-soft: #3a3120;
  --danger: #ee8a84;
  --danger-soft: #3a2322;
  --warning: #e1b45f;
  --warning-soft: #382f1e;
  --success: #62d29a;
  --success-soft: #1b3528;
  --info: #8ac5e3;
  --info-soft: #1b303b;
  --shadow-sm: 0 8px 24px rgba(0, 0, 0, .22);
  --shadow-md: 0 18px 50px rgba(0, 0, 0, .30);
  --shadow-lg: 0 28px 80px rgba(0, 0, 0, .40);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(1100px 500px at 95% -10%, rgba(193, 219, 201, .30), transparent 60%),
    radial-gradient(900px 500px at -10% 20%, rgba(218, 228, 209, .35), transparent 55%),
    var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
html[data-theme="dark"] body {
  background:
    radial-gradient(1100px 500px at 95% -10%, rgba(32, 87, 64, .30), transparent 60%),
    radial-gradient(900px 500px at -10% 20%, rgba(30, 65, 49, .24), transparent 55%),
    var(--bg);
}
a { color: var(--brand-2); text-decoration: none; }
a:hover { color: var(--brand); }
img, svg { max-width: 100%; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--brand-2) 45%, transparent); outline-offset: 2px; }
::selection { background: var(--brand); color: #fff; }

h1, h2, h3, h4, h5 {
  margin: 0 0 .45em;
  color: var(--ink);
  line-height: 1.18;
  letter-spacing: -.025em;
  font-weight: 760;
}
h1 { font-size: clamp(2rem, 3vw, 3rem); }
h2 { font-size: clamp(1.4rem, 2vw, 1.85rem); }
h3 { font-size: 1.16rem; }
h4 { font-size: 1rem; }
p { margin: 0 0 1rem; }
ul, ol { margin: 0 0 1rem; padding-left: 1.25rem; }
li { margin-bottom: .3rem; }
small { font-size: .82rem; }
hr { border: 0; border-top: 1px solid var(--line); margin: 1.5rem 0; }
code, kbd, pre { font-family: var(--mono); }
code {
  background: var(--surface-3);
  border: 1px solid color-mix(in srgb, var(--line) 60%, transparent);
  border-radius: 6px;
  padding: .12em .38em;
  font-size: .89em;
}
pre {
  margin: 0;
  background: #12241b;
  color: #d9f1e4;
  border-radius: var(--radius-sm);
  padding: 1rem 1.15rem;
  overflow: auto;
  font-size: .85rem;
  line-height: 1.65;
}
pre code { background: none; border: 0; padding: 0; color: inherit; font-size: inherit; }
.icon { flex: 0 0 auto; vertical-align: -.16em; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: 12px; top: -70px; z-index: 999; background: var(--brand); color: #fff; padding: .7rem 1.1rem; border-radius: 0 0 10px 10px; transition: top .2s; }
.skip-link:focus { top: 0; color: #fff; }

/* ------------------------------- Layout ------------------------------- */
.app-shell { min-height: 100vh; }
.topbar {
  position: fixed;
  z-index: 50;
  inset: 0 0 auto 0;
  height: var(--topbar);
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0 1.4rem 0 1.6rem;
  background: color-mix(in srgb, var(--surface) 86%, transparent);
  backdrop-filter: blur(16px) saturate(1.2);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: .8rem; color: var(--ink); min-width: 0; }
.brand:hover { color: var(--ink); }
.brand-mark {
  width: 42px; height: 42px; flex: 0 0 auto;
  display: grid; place-items: center;
  border-radius: 12px;
  background: linear-gradient(145deg, var(--brand), var(--brand-2));
  color: #fff;
  box-shadow: 0 8px 20px color-mix(in srgb, var(--brand) 28%, transparent);
}
.brand-mark svg { width: 24px; height: 24px; }
.brand-copy { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.brand-copy strong { font-size: 1.05rem; letter-spacing: -.02em; white-space: nowrap; }
.brand-copy small { color: var(--muted); font-size: .7rem; letter-spacing: .07em; text-transform: uppercase; white-space: nowrap; }
.topbar-spacer { flex: 1; }
.topbar-actions { display: flex; align-items: center; gap: .55rem; }
.icon-btn {
  width: 40px; height: 40px;
  display: inline-grid; place-items: center;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-soft);
  border-radius: 11px;
  transition: background .18s, border-color .18s, color .18s, transform .18s;
}
.icon-btn:hover { background: var(--surface-3); border-color: var(--line-strong); color: var(--ink); }
.icon-btn:active { transform: scale(.96); }
[data-theme-toggle] .icon-sun { display: none; }
[data-theme-toggle] .icon-moon { display: block; }
html[data-theme="dark"] [data-theme-toggle] .icon-sun { display: block; }
html[data-theme="dark"] [data-theme-toggle] .icon-moon { display: none; }
.nav-toggle { display: none; }
.role-pill {
  display: inline-flex; align-items: center; gap: .45rem;
  height: 32px; padding: 0 .8rem;
  border-radius: 99px;
  background: var(--brand-soft);
  color: var(--brand-ink);
  font-size: .74rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
}
.role-pill.admin { background: var(--gold-soft); color: var(--gold); }
.role-pill.guest { background: var(--surface-3); color: var(--muted); }

.user-menu { position: relative; }
.user-btn {
  display: flex; align-items: center; gap: .65rem;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 13px; padding: .35rem .6rem .35rem .4rem;
  color: var(--ink); transition: border-color .18s, background .18s;
}
.user-btn:hover { border-color: var(--line-strong); background: var(--surface-2); }
.avatar {
  width: 34px; height: 34px; display: grid; place-items: center;
  border-radius: 10px;
  background: linear-gradient(140deg, var(--brand-soft), color-mix(in srgb, var(--brand-soft) 45%, var(--gold-soft)));
  color: var(--brand); font-size: .78rem; font-weight: 800; letter-spacing: .03em;
}
.user-copy { display: none; flex-direction: column; line-height: 1.15; text-align: left; }
.user-copy strong { font-size: .84rem; max-width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-copy small { color: var(--muted); font-size: .7rem; }
@media (min-width: 720px) { .user-copy { display: flex; } }
.dropdown {
  position: absolute; right: 0; top: calc(100% + .55rem);
  width: 248px; padding: .45rem;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: var(--shadow-md);
  opacity: 0; transform: translateY(-6px); pointer-events: none;
  transition: opacity .16s, transform .16s;
  z-index: 70;
}
.dropdown.is-open { opacity: 1; transform: translateY(0); pointer-events: auto; }
.dropdown-head { padding: .7rem .75rem .6rem; border-bottom: 1px solid var(--line); margin-bottom: .35rem; }
.dropdown-head strong { display: block; font-size: .9rem; }
.dropdown-head small { color: var(--muted); font-size: .76rem; }
.dropdown-item {
  display: flex; align-items: center; gap: .65rem;
  width: 100%; padding: .58rem .65rem; border: 0; background: none;
  border-radius: 8px; color: var(--ink-soft); font-size: .88rem; text-align: left;
}
.dropdown-item:hover { background: var(--surface-3); color: var(--ink); }
.dropdown-item.danger { color: var(--danger); }
.dropdown-sep { border-top: 1px solid var(--line); margin: .35rem 0; }
.dropdown form { margin: 0; }

.sidebar {
  position: fixed; z-index: 40;
  top: var(--topbar); bottom: 0; left: 0;
  width: var(--sidebar);
  display: flex; flex-direction: column;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(14px);
  border-right: 1px solid var(--line);
}
.sidebar-scroll { flex: 1; overflow-y: auto; padding: 1.2rem .95rem 1rem; }
.nav-group + .nav-group { margin-top: 1.35rem; }
.nav-label {
  padding: 0 .8rem .45rem;
  color: var(--muted);
  font-size: .67rem; font-weight: 800; letter-spacing: .13em; text-transform: uppercase;
}
.nav-link {
  position: relative;
  display: flex; align-items: center; gap: .72rem;
  padding: .62rem .8rem;
  border-radius: 10px;
  color: var(--ink-soft);
  font-size: .89rem; font-weight: 560;
  transition: background .16s, color .16s;
}
.nav-link:hover { background: var(--surface-3); color: var(--ink); }
.nav-link.is-active {
  background: var(--brand-soft);
  color: var(--brand-ink);
  font-weight: 700;
}
.nav-link.is-active::before {
  content: ""; position: absolute; left: -0.95rem; top: 20%; bottom: 20%;
  width: 3px; border-radius: 0 3px 3px 0; background: var(--brand-2);
}
.nav-link .icon { color: currentColor; opacity: .85; }
.sidebar-card {
  margin: 1.15rem .35rem .2rem;
  padding: .95rem 1rem;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: linear-gradient(150deg, var(--surface-2), var(--surface));
}
.sidebar-card .eyebrow { font-size: .64rem; }
.sidebar-card strong { display: block; font-size: .88rem; margin: .35rem 0 .2rem; }
.sidebar-card p { font-size: .76rem; color: var(--muted); margin: 0; line-height: 1.5; }
.sidebar-card .progress { margin-top: .7rem; }
.sidebar-footer {
  border-top: 1px solid var(--line);
  padding: .85rem 1.15rem;
  display: flex; align-items: center; gap: .45rem;
  color: var(--muted); font-size: .7rem;
}
.sidebar-backdrop { display: none; }

.main {
  padding: calc(var(--topbar) + 2rem) clamp(1.1rem, 3vw, 2.6rem) 2rem calc(var(--sidebar) + clamp(1.1rem, 3vw, 2.6rem));
  min-height: 100vh;
}
.page { max-width: 1220px; margin: 0 auto; }
.page.narrow { max-width: 880px; }
.app-footer {
  max-width: 1220px; margin: 1.5rem auto 0;
  padding: 1.25rem .25rem 0;
  border-top: 1px solid var(--line);
  display: flex; flex-wrap: wrap; gap: .5rem 1rem; align-items: center;
  color: var(--muted); font-size: .76rem;
}
.app-footer .spacer { flex: 1; }

/* ------------------------------ Typography ------------------------------ */
.eyebrow {
  display: inline-flex; align-items: center; gap: .45rem;
  color: var(--gold);
  font-size: .7rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase;
}
.lead { font-size: 1.06rem; color: var(--ink-soft); line-height: 1.7; }
.muted { color: var(--muted); }
.text-center { text-align: center; }
.text-right { text-align: right; }
.nowrap { white-space: nowrap; }
.strong { font-weight: 750; }
.font-mono { font-family: var(--mono); }
.small { font-size: .82rem; }
.tiny { font-size: .72rem; }
.mb-0 { margin-bottom: 0 !important; }
.mt-1 { margin-top: .35rem; }
.mt-2 { margin-top: .8rem; }
.mt-3 { margin-top: 1.25rem; }
.mt-4 { margin-top: 1.8rem; }
.mt-5 { margin-top: 2.5rem; }
.mb-2 { margin-bottom: .8rem; }
.mb-3 { margin-bottom: 1.25rem; }
.mb-4 { margin-bottom: 1.8rem; }
.my-4 { margin-top: 1.8rem; margin-bottom: 1.8rem; }

.breadcrumbs {
  display: flex; align-items: center; flex-wrap: wrap; gap: .35rem;
  margin-bottom: 1.1rem;
  color: var(--muted); font-size: .78rem;
}
.breadcrumbs a { color: var(--muted); }
.breadcrumbs a:hover { color: var(--brand); }
.breadcrumbs .sep { opacity: .55; }
.breadcrumbs .current { color: var(--ink-soft); font-weight: 650; }

.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 1rem; margin-bottom: 1.5rem; }
.page-head-copy { flex: 1 1 420px; }
.page-head h1 { margin-bottom: .35rem; }
.page-head p { color: var(--muted); margin: 0; max-width: 760px; }
.page-head-actions { display: flex; flex-wrap: wrap; gap: .55rem; }

.section { margin-top: 2.15rem; }
.section-head { display: flex; flex-wrap: wrap; align-items: flex-end; gap: .8rem; margin-bottom: 1rem; }
.section-head > div { flex: 1 1 360px; }
.section-head h2 { margin-bottom: .2rem; }
.section-head p { color: var(--muted); margin: 0; font-size: .88rem; }

/* ------------------------------- Buttons ------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  min-height: 42px; padding: .58rem 1.05rem;
  border-radius: 10px;
  border: 1px solid transparent;
  font-size: .88rem; font-weight: 700;
  text-decoration: none; white-space: nowrap;
  transition: background .17s, border-color .17s, color .17s, transform .12s, box-shadow .17s;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:disabled, .btn.is-disabled { opacity: .55; pointer-events: none; }
.btn-primary {
  background: linear-gradient(145deg, var(--brand), color-mix(in srgb, var(--brand) 75%, #000 8%));
  color: #fff;
  box-shadow: 0 8px 22px color-mix(in srgb, var(--brand) 28%, transparent);
}
.btn-primary:hover { color: #fff; background: linear-gradient(145deg, var(--brand-2), var(--brand)); }
.btn-outline { background: transparent; border-color: var(--line-strong); color: var(--ink-soft); }
.btn-outline:hover { background: var(--surface-3); color: var(--ink); border-color: var(--brand); }
.btn-ghost { background: transparent; color: var(--ink-soft); }
.btn-ghost:hover { background: var(--surface-3); color: var(--ink); }
.btn-soft { background: var(--brand-soft); color: var(--brand-ink); }
.btn-soft:hover { background: color-mix(in srgb, var(--brand-soft) 82%, var(--brand) 18%); color: var(--brand-ink); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { color: #fff; filter: brightness(.94); }
.btn-light { background: #fff; color: var(--brand-ink); box-shadow: var(--shadow-sm); }
.btn-light:hover { color: var(--brand-ink); background: #f7fbf8; }
.btn-sm { min-height: 34px; padding: .34rem .72rem; font-size: .78rem; border-radius: 8px; }
.btn-lg { min-height: 50px; padding: .75rem 1.4rem; font-size: .96rem; border-radius: 12px; }
.btn-block { width: 100%; }
.btn.is-loading { position: relative; color: transparent !important; }
.btn.is-loading::after {
  content: ""; position: absolute; width: 18px; height: 18px;
  border: 2px solid rgba(255, 255, 255, .35); border-top-color: #fff;
  border-radius: 50%; animation: spin .7s linear infinite;
}
.btn-outline.is-loading::after, .btn-ghost.is-loading::after { border-color: color-mix(in srgb, var(--ink) 25%, transparent); border-top-color: var(--ink); }
@keyframes spin { to { transform: rotate(360deg); } }

.btn-row { display: flex; flex-wrap: wrap; gap: .55rem; align-items: center; }

/* -------------------------------- Cards -------------------------------- */
.card {
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.card-pad { padding: clamp(1.1rem, 2vw, 1.6rem); }
.card-flush { padding: 0; overflow: hidden; }
.card-header {
  display: flex; flex-wrap: wrap; align-items: center; gap: .8rem;
  padding: 1.1rem 1.3rem;
  border-bottom: 1px solid var(--line);
}
.card-header h3, .card-header h2 { margin: 0; }
.card-header .spacer { flex: 1; }
.card-body { padding: 1.3rem; }
.panel {
  padding: 1.15rem 1.25rem;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 13px;
}
.panel.accent { background: linear-gradient(145deg, var(--brand-soft), var(--surface)); border-color: color-mix(in srgb, var(--brand) 20%, var(--line)); }
.panel.gold { background: linear-gradient(145deg, var(--gold-soft), var(--surface)); border-color: color-mix(in srgb, var(--gold) 30%, var(--line)); }
.panel h4 { display: flex; align-items: center; gap: .45rem; margin-bottom: .5rem; }
.panel p:last-child, .panel ul:last-child { margin-bottom: 0; }
.divider { height: 1px; background: var(--line); margin: 1.2rem 0; }
.grid { display: grid; gap: 1.1rem; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-auto { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: .65rem; }
.stack { display: flex; flex-direction: column; gap: 1rem; }
.spacer { flex: 1; }

/* -------------------------------- Badges -------------------------------- */
.badge {
  display: inline-flex; align-items: center; gap: .35rem;
  min-height: 24px; padding: .18rem .6rem;
  border-radius: 99px;
  background: var(--surface-3); color: var(--muted);
  font-size: .7rem; font-weight: 750; letter-spacing: .02em;
  white-space: nowrap;
}
.badge .icon { opacity: .8; }
.badge-success { background: var(--success-soft); color: var(--success); }
.badge-danger { background: var(--danger-soft); color: var(--danger); }
.badge-warning { background: var(--warning-soft); color: var(--warning); }
.badge-accent { background: var(--brand-soft); color: var(--brand-ink); }
.badge-info { background: var(--info-soft); color: var(--info); }
.badge-gold { background: var(--gold-soft); color: var(--gold); }
.badge-outline { background: transparent; border: 1px solid var(--line-strong); color: var(--muted); }
.badge-lg { min-height: 30px; padding: .3rem .85rem; font-size: .78rem; }
.chip {
  display: inline-flex; align-items: center; gap: .35rem;
  padding: .25rem .6rem; border: 1px solid var(--line); border-radius: 7px;
  background: var(--surface); color: var(--ink-soft); font-size: .73rem;
}
.chips { display: flex; flex-wrap: wrap; gap: .4rem; }

/* ------------------------------- Progress ------------------------------- */
.progress {
  height: 8px; border-radius: 99px; background: var(--surface-3);
  overflow: hidden; position: relative;
}
.progress > span {
  display: block; height: 100%; border-radius: 99px;
  background: linear-gradient(90deg, var(--brand), var(--brand-2));
  transition: width .5s ease;
}
.progress.thin { height: 5px; }
.progress.gold > span { background: linear-gradient(90deg, var(--gold), #d9b878); }
.progress.is-complete > span { background: linear-gradient(90deg, #13724e, #35b281); }
.progress-meta { display: flex; justify-content: space-between; gap: .5rem; margin-bottom: .35rem; font-size: .73rem; color: var(--muted); }
.progress-meta strong { color: var(--ink-soft); }

/* -------------------------------- Stats --------------------------------- */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(165px, 1fr)); gap: 1rem; }
.stat-card {
  padding: 1.15rem 1.2rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.stat-top { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.stat-icon {
  width: 38px; height: 38px; display: grid; place-items: center;
  border-radius: 10px; background: var(--brand-soft); color: var(--brand);
}
.stat-card.gold .stat-icon { background: var(--gold-soft); color: var(--gold); }
.stat-value { font-size: 1.85rem; font-weight: 800; letter-spacing: -.04em; line-height: 1.1; margin-top: .75rem; }
.stat-label { color: var(--muted); font-size: .77rem; font-weight: 600; }
.stat-note { color: var(--muted); font-size: .7rem; margin-top: .25rem; }

/* -------------------------------- Hero ---------------------------------- */
.hero {
  position: relative; overflow: hidden;
  padding: clamp(1.6rem, 4vw, 3.2rem);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(700px 380px at 100% 0%, rgba(80, 187, 140, .22), transparent 60%),
    linear-gradient(135deg, #0f3c2d 0%, #155a41 55%, #19745a 100%);
  color: #eef8f1;
  box-shadow: var(--shadow-lg);
}
.hero::after {
  content: ""; position: absolute; inset: auto -60px -140px auto;
  width: 420px; height: 420px; border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .13);
  box-shadow: 0 0 0 60px rgba(255, 255, 255, .035), 0 0 0 120px rgba(255, 255, 255, .02);
  pointer-events: none;
}
.hero .eyebrow { color: #d8ba7c; }
.hero h1 { color: #fff; font-size: clamp(2.15rem, 4.7vw, 3.75rem); letter-spacing: -.045em; max-width: 800px; margin: .65rem 0 1rem; }
.hero p { color: rgba(235, 248, 240, .8); max-width: 660px; font-size: 1.03rem; line-height: 1.7; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .65rem; margin-top: 1.5rem; position: relative; z-index: 1; }
.hero-stats { display: flex; flex-wrap: wrap; gap: 1.5rem 2.3rem; margin-top: 2.2rem; padding-top: 1.3rem; border-top: 1px solid rgba(255, 255, 255, .15); position: relative; z-index: 1; }
.hero-stat strong { display: block; font-size: 1.35rem; color: #fff; letter-spacing: -.03em; }
.hero-stat span { color: rgba(235, 248, 240, .65); font-size: .72rem; text-transform: uppercase; letter-spacing: .07em; }
.hero-art {
  position: absolute; right: 4%; top: 14%; width: 265px; height: 230px;
  transform: rotate(-6deg); opacity: .9; pointer-events: none;
}
.hero-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; padding: 14px; border: 1px solid rgba(255, 255, 255, .18); border-radius: 14px; background: rgba(255, 255, 255, .06); }
.hero-grid span { height: 32px; border-radius: 5px; background: rgba(255, 255, 255, .08); }
.hero-grid span:nth-child(3n) { background: rgba(216, 186, 124, .28); }
.hero-grid span:nth-child(5n) { background: rgba(112, 218, 168, .24); }
@media (max-width: 1180px) { .hero-art { display: none; } }

/* ------------------------------ Modules -------------------------------- */
.module-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1rem; }
.module-card {
  display: flex; flex-direction: column;
  padding: 1.25rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: transform .18s, border-color .18s, box-shadow .18s;
  color: inherit;
}
.module-card:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--brand) 40%, var(--line)); box-shadow: var(--shadow-md); color: inherit; }
.module-top { display: flex; align-items: flex-start; gap: .8rem; justify-content: space-between; }
.module-num {
  width: 42px; height: 42px; flex: 0 0 auto;
  display: grid; place-items: center;
  border-radius: 11px;
  background: var(--brand-soft); color: var(--brand);
  font-size: .84rem; font-weight: 850; letter-spacing: -.03em;
}
.module-card:nth-child(4n+2) .module-num { background: var(--gold-soft); color: var(--gold); }
.module-card:nth-child(4n+3) .module-num { background: var(--info-soft); color: var(--info); }
.module-card:nth-child(4n+4) .module-num { background: var(--surface-3); color: var(--ink-soft); }
.module-card h3 { margin: .8rem 0 .3rem; font-size: 1.02rem; }
.module-card p { color: var(--muted); font-size: .81rem; line-height: 1.55; margin: 0 0 .85rem; flex: 1; }
.module-meta { display: flex; flex-wrap: wrap; gap: .55rem; color: var(--muted); font-size: .7rem; margin-bottom: .7rem; }
.module-meta span { display: inline-flex; align-items: center; gap: .3rem; }
.module-card .progress { margin-top: .2rem; }
.module-card .progress-meta { font-size: .68rem; }
.module-foot { display: flex; align-items: center; gap: .4rem; margin-top: .9rem; color: var(--brand-2); font-size: .77rem; font-weight: 750; }

/* -------------------------------- Forms --------------------------------- */
.form-field { margin-bottom: 1rem; }
.form-field > label { display: block; margin-bottom: .35rem; font-size: .8rem; font-weight: 700; color: var(--ink-soft); }
.input, .select, .textarea {
  width: 100%; min-height: 44px; padding: .6rem .8rem;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  color: var(--ink);
  transition: border-color .17s, box-shadow .17s, background .17s;
}
.textarea { min-height: 140px; resize: vertical; line-height: 1.6; }
.input:focus, .select:focus, .textarea:focus {
  outline: none; border-color: var(--brand-2);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand-2) 16%, transparent);
}
.input.is-invalid, .select.is-invalid, .textarea.is-invalid { border-color: var(--danger); }
.input::placeholder, .textarea::placeholder { color: color-mix(in srgb, var(--muted) 70%, transparent); }
.field-error { min-height: 1em; margin-top: .28rem; color: var(--danger); font-size: .75rem; }
.form-hint { color: var(--muted); font-size: .74rem; margin-top: .3rem; }
.form-alert {
  padding: .75rem .9rem;
  border-radius: 9px;
  background: var(--danger-soft); color: var(--danger);
  font-size: .82rem; margin-bottom: 1rem;
  border: 1px solid color-mix(in srgb, var(--danger) 25%, transparent);
}
.form-actions { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; margin-top: 1.2rem; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .9rem; }
.form-grid .full { grid-column: 1 / -1; }
.check { display: flex; align-items: flex-start; gap: .55rem; color: var(--ink-soft); font-size: .84rem; }
.check input { margin-top: .2rem; accent-color: var(--brand); }

.auth-shell {
  display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr);
  max-width: 1040px; margin: 1.5rem auto;
  border-radius: var(--radius-lg); overflow: hidden;
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-lg);
}
.auth-aside {
  padding: clamp(2rem, 4vw, 3.3rem);
  background:
    radial-gradient(500px 300px at 100% 100%, rgba(90, 195, 146, .22), transparent 65%),
    linear-gradient(150deg, #0f3c2d, #155f45);
  color: #eaf7ef;
  display: flex; flex-direction: column; justify-content: space-between;
}
.auth-aside h2 { color: #fff; font-size: 2rem; letter-spacing: -.04em; margin-top: .6rem; }
.auth-aside p { color: rgba(233, 247, 238, .72); font-size: .9rem; }
.auth-aside .eyebrow { color: #d8ba7c; }
.auth-list { display: flex; flex-direction: column; gap: .7rem; margin-top: 1.4rem; }
.auth-list-item { display: flex; gap: .7rem; align-items: flex-start; font-size: .82rem; color: rgba(233, 247, 238, .8); }
.auth-list-item .icon { color: #84d6ae; margin-top: .12rem; }
.auth-main { padding: clamp(1.5rem, 3.5vw, 3rem); }
.auth-main h1 { font-size: 1.75rem; margin-bottom: .35rem; }
.auth-main .lead { font-size: .9rem; margin-bottom: 1.6rem; }
.auth-switch { margin-top: 1.3rem; padding-top: 1.1rem; border-top: 1px solid var(--line); color: var(--muted); font-size: .82rem; }
.auth-switch a { font-weight: 700; }
.demo-note { margin-top: 1rem; padding: .7rem .85rem; border-radius: 9px; background: var(--surface-2); border: 1px dashed var(--line-strong); font-size: .75rem; color: var(--muted); }

/* ------------------------------- Tables --------------------------------- */
.table-scroll { width: 100%; overflow-x: auto; border-radius: 12px; border: 1px solid var(--line); }
.data-table { width: 100%; border-collapse: collapse; background: var(--surface); font-size: .82rem; min-width: 620px; }
.data-table.compact { min-width: 0; }
.data-table.compact th, .data-table.compact td { padding: .6rem .5rem; font-size: .75rem; }
.data-table th, .data-table td { padding: .7rem .8rem; text-align: left; vertical-align: middle; border-bottom: 1px solid var(--line); }
.data-table th {
  background: var(--surface-2); color: var(--muted);
  font-size: .69rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase;
}
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover { background: color-mix(in srgb, var(--surface-2) 75%, transparent); }
.data-table .center { text-align: center; }
.data-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.data-table .name-cell { font-weight: 700; color: var(--ink); }
.data-table .sub { display: block; color: var(--muted); font-size: .72rem; font-weight: 400; }
.row-ok td { background: color-mix(in srgb, var(--success-soft) 35%, transparent); }
.row-bad td { background: color-mix(in srgb, var(--danger-soft) 35%, transparent); }
.check-mark { font-weight: 900; }
.check-mark.ok { color: var(--success); }
.check-mark.bad { color: var(--danger); }
.table-actions { display: flex; flex-wrap: wrap; gap: .35rem; }
.table-empty { padding: 2rem; text-align: center; color: var(--muted); }

/* ------------------------------ Flashcards ------------------------------- */
.feature-card { padding: 1.3rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.feature-icon { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 11px; background: var(--brand-soft); color: var(--brand); margin-bottom: .9rem; }
.feature-card h3 { font-size: 1rem; margin-bottom: .35rem; }
.feature-card p { color: var(--muted); font-size: .82rem; margin: 0; line-height: 1.6; }
.feature-card.gold .feature-icon { background: var(--gold-soft); color: var(--gold); }
.feature-card.info .feature-icon { background: var(--info-soft); color: var(--info); }

.role-card { display: flex; gap: .9rem; padding: 1.15rem; background: var(--surface); border: 1px solid var(--line); border-radius: 13px; }
.role-card .role-icon { width: 36px; height: 36px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 9px; background: var(--surface-3); color: var(--ink-soft); }
.role-card strong { display: block; font-size: .88rem; }
.role-card p { margin: .15rem 0 0; color: var(--muted); font-size: .78rem; line-height: 1.55; }
.role-card.is-current { border-color: color-mix(in srgb, var(--brand) 45%, var(--line)); background: linear-gradient(145deg, var(--brand-soft), var(--surface)); }

/* -------------------------------- Course -------------------------------- */
.course-head { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(280px, .65fr); gap: 1.2rem; align-items: start; }
.course-hero { padding: clamp(1.4rem, 3vw, 2.2rem); border-radius: var(--radius-lg); background: linear-gradient(140deg, var(--brand-soft), var(--surface)); border: 1px solid color-mix(in srgb, var(--brand) 18%, var(--line)); }
.course-hero h1 { font-size: clamp(1.9rem, 3vw, 2.6rem); margin: .45rem 0 .5rem; }
.course-hero p { color: var(--ink-soft); max-width: 680px; margin-bottom: 0; }
.course-stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: .8rem; }
.course-stat { padding: 1rem; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.course-stat strong { display: block; font-size: 1.25rem; letter-spacing: -.03em; }
.course-stat span { color: var(--muted); font-size: .72rem; }
.detail-hero { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(260px, .55fr); gap: 1.2rem; align-items: start; }
.objectives { display: flex; flex-direction: column; gap: .55rem; margin: .9rem 0 0; padding: 0; list-style: none; }
.objectives li { display: flex; gap: .55rem; color: var(--ink-soft); font-size: .84rem; }
.objectives .icon { color: var(--brand-2); margin-top: .15rem; }
.lesson-list { display: flex; flex-direction: column; gap: .55rem; }
.lesson-row {
  display: flex; align-items: center; gap: .8rem;
  padding: .8rem .9rem;
  border: 1px solid var(--line); border-radius: 11px;
  background: var(--surface);
  color: inherit;
  transition: border-color .17s, background .17s;
}
.lesson-row:hover { border-color: var(--brand); background: var(--surface-2); color: inherit; }
.lesson-index { width: 30px; height: 30px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 8px; background: var(--surface-3); color: var(--muted); font-size: .72rem; font-weight: 800; }
.lesson-row.is-done .lesson-index { background: var(--success-soft); color: var(--success); }
.lesson-row h4 { margin: 0; font-size: .88rem; }
.lesson-row small { color: var(--muted); font-size: .72rem; }
.lesson-row .spacer { flex: 1; }
.activity-card {
  display: flex; flex-wrap: wrap; align-items: center; gap: .85rem;
  padding: .9rem 1rem;
  background: var(--surface); border: 1px solid var(--line); border-radius: 11px;
}
.activity-icon { width: 36px; height: 36px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 9px; background: var(--brand-soft); color: var(--brand); }
.activity-card.review .activity-icon { background: var(--gold-soft); color: var(--gold); }
.activity-card h4 { margin: 0 0 .1rem; font-size: .88rem; }
.activity-card small { color: var(--muted); font-size: .72rem; }
.activity-card .spacer { flex: 1; }
.activity-status { display: flex; align-items: center; gap: .45rem; }

/* -------------------------------- Lesson -------------------------------- */
.lesson-layout { display: grid; grid-template-columns: minmax(0, 1fr) 270px; gap: 1.4rem; align-items: start; }
.lesson-article { padding: clamp(1.3rem, 2.5vw, 2.2rem); }
.lesson-head { padding-bottom: 1.1rem; border-bottom: 1px solid var(--line); margin-bottom: 1.4rem; }
.lesson-head h1 { font-size: clamp(1.7rem, 2.6vw, 2.35rem); margin: .4rem 0 .55rem; }
.lesson-head .meta { display: flex; flex-wrap: wrap; gap: .45rem; }
.lesson-aside { position: sticky; top: calc(var(--topbar) + 1.2rem); display: flex; flex-direction: column; gap: .9rem; }
.lesson-aside-card { padding: 1rem; }
.lesson-aside-card h4 { font-size: .82rem; margin-bottom: .6rem; }
.aside-lessons { display: flex; flex-direction: column; gap: .25rem; }
.aside-lesson { display: flex; gap: .5rem; align-items: flex-start; padding: .45rem .5rem; border-radius: 7px; color: var(--ink-soft); font-size: .78rem; }
.aside-lesson:hover { background: var(--surface-3); color: var(--ink); }
.aside-lesson.is-current { background: var(--brand-soft); color: var(--brand-ink); font-weight: 700; }
.aside-lesson .dot { width: 7px; height: 7px; flex: 0 0 auto; margin-top: .4rem; border-radius: 50%; background: var(--line-strong); }
.aside-lesson.is-done .dot { background: var(--success); }
.aside-lesson.is-current .dot { background: var(--brand); }
.lesson-nav { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .7rem; margin-top: 2rem; padding-top: 1.2rem; border-top: 1px solid var(--line); }
.complete-box { display: flex; flex-wrap: wrap; align-items: center; gap: .8rem; margin-top: 1.3rem; padding: 1rem; border-radius: 12px; background: var(--surface-2); border: 1px dashed var(--line-strong); }
.complete-box p { margin: 0; flex: 1 1 260px; font-size: .8rem; color: var(--muted); }
.btn.is-done { background: var(--success-soft); color: var(--success); border-color: transparent; }

/* Bloques de contenido */
.blocks { color: var(--ink-soft); font-size: .94rem; line-height: 1.78; }
.blocks h3 { margin: 1.6rem 0 .6rem; font-size: 1.1rem; color: var(--ink); }
.blocks p { margin-bottom: 1rem; }
.blocks ul, .blocks ol { margin-bottom: 1.1rem; }
.blocks li { margin-bottom: .35rem; }
.compare-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; margin: 1.1rem 0; }
.compare-col { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.compare-col header { padding: .5rem .75rem; font-size: .73rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; background: var(--success-soft); color: var(--success); }
.compare-col.bad header { background: var(--danger-soft); color: var(--danger); }
.compare-col ul { margin: 0; padding: .7rem .9rem .7rem 1.6rem; font-size: .8rem; }
.formula-block { margin: 1.1rem 0; border: 1px solid var(--line); border-radius: 11px; overflow: hidden; background: var(--surface); }
.formula-block header { display: flex; align-items: center; gap: .4rem; padding: .5rem .8rem; background: var(--surface-2); border-bottom: 1px solid var(--line); font-size: .72rem; font-weight: 750; color: var(--muted); }
.formula-block .formula-code { padding: .8rem .9rem; font-family: var(--mono); font-size: .86rem; color: var(--brand-ink); background: var(--brand-soft); overflow-x: auto; }
.formula-block .formula-explain { padding: .7rem .9rem; font-size: .79rem; color: var(--muted); border-top: 1px solid var(--line); }
.formula-result { display: inline-flex; align-items: center; gap: .3rem; margin-left: .4rem; padding: .08rem .4rem; border-radius: 5px; background: var(--surface); border: 1px solid var(--line); font-size: .72rem; color: var(--ink-soft); }
.callout { display: flex; gap: .7rem; padding: .9rem 1rem; margin: 1.1rem 0; border-radius: 10px; background: var(--info-soft); border-left: 4px solid var(--info); font-size: .83rem; color: var(--ink-soft); }
.callout.tip { background: var(--success-soft); border-left-color: var(--success); }
.callout.warn { background: var(--warning-soft); border-left-color: var(--warning); }
.callout strong { display: block; font-size: .78rem; margin-bottom: .15rem; }
.callout .icon { flex: 0 0 auto; margin-top: .1rem; color: currentColor; }
.content-table { width: 100%; border-collapse: collapse; margin: 1.1rem 0; font-size: .8rem; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; display: block; overflow-x: auto; }
.content-table table { width: 100%; border-collapse: collapse; min-width: 480px; }
.content-table th, .content-table td { padding: .55rem .65rem; border-bottom: 1px solid var(--line); text-align: left; }
.content-table th { background: var(--surface-2); font-size: .7rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.content-table tr:last-child td { border-bottom: 0; }

/* ------------------------------- Exercise ------------------------------- */
.exercise-head { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 1rem; margin-bottom: 1.2rem; }
.exercise-head h1 { font-size: clamp(1.7rem, 2.7vw, 2.4rem); margin: .4rem 0 .4rem; }
.exercise-meta { display: flex; flex-wrap: wrap; gap: .45rem; }
.exercise-shell { padding: clamp(1.2rem, 2.5vw, 2rem); }
.prompt { font-size: .95rem; color: var(--ink-soft); line-height: 1.7; margin-bottom: .8rem; }
.hint { margin: 1rem 0; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); }
.hint summary { padding: .65rem .9rem; cursor: pointer; font-size: .8rem; font-weight: 700; color: var(--ink-soft); }
.hint div { padding: 0 .9rem .8rem; color: var(--muted); font-size: .8rem; }
.sheet-wrap { margin: 1rem 0; overflow-x: auto; border: 1px solid var(--line); border-radius: 11px; background: var(--surface); }
.sheet { width: 100%; border-collapse: collapse; font-size: .78rem; min-width: 520px; font-variant-numeric: tabular-nums; }
.sheet th, .sheet td { border: 1px solid var(--line); padding: .45rem .6rem; text-align: left; }
.sheet thead th { background: var(--surface-2); color: var(--muted); font-size: .68rem; font-weight: 700; text-align: center; }
.sheet thead tr:nth-child(2) th { text-align: left; color: var(--ink-soft); font-size: .72rem; }
.sheet .corner { width: 38px; background: var(--surface-3); }
.sheet .row-num { width: 38px; background: var(--surface-2); color: var(--muted); text-align: center; font-size: .68rem; }
.sheet td.num { text-align: right; }
.sheet .answer-cell { background: color-mix(in srgb, var(--gold-soft) 55%, var(--surface)); min-width: 120px; }
.sheet .preview-value { color: var(--muted); }
.cell-input { width: 100%; min-width: 90px; border: 0; background: transparent; padding: .1rem .15rem; color: var(--ink); font-variant-numeric: tabular-nums; }
.cell-input:focus { outline: 2px solid var(--brand-2); border-radius: 4px; background: var(--surface); }
.formula-lab { margin-top: 1.1rem; }
.formula-bar { display: flex; align-items: stretch; border: 1px solid var(--line-strong); border-radius: 10px; overflow: hidden; background: var(--surface); }
.formula-bar .fx { display: grid; place-items: center; width: 46px; flex: 0 0 auto; background: var(--surface-2); border-right: 1px solid var(--line); font-family: Georgia, serif; font-style: italic; font-weight: 700; color: var(--brand); }
.formula-bar input { flex: 1; min-width: 0; border: 0; padding: .75rem .8rem; font-family: var(--mono); font-size: .88rem; background: transparent; color: var(--ink); }
.formula-bar input:focus { outline: none; box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--brand-2) 30%, transparent); }
.formula-bar input:disabled, .cell-input:disabled, .code-editor:disabled { background: var(--surface-2); color: var(--muted); cursor: not-allowed; }
.quiz-option input:disabled, .checklist-item input:disabled { cursor: not-allowed; }
.quiz-option:has(input:disabled) { opacity: .75; cursor: default; }
.formula-status { display: flex; align-items: center; gap: .4rem; margin-top: .4rem; color: var(--muted); font-size: .73rem; }
.support-block { margin: 1rem 0; }
.support-head { display: flex; align-items: center; justify-content: space-between; gap: .6rem; margin-bottom: .45rem; font-size: .78rem; }
.quiz-list { display: flex; flex-direction: column; gap: 1.1rem; margin-top: 1rem; }
.quiz-question { border: 1px solid var(--line); border-radius: 11px; padding: 1rem; background: var(--surface); }
.quiz-question h4 { font-size: .88rem; line-height: 1.55; margin-bottom: .7rem; }
.quiz-options { display: flex; flex-direction: column; gap: .45rem; }
.quiz-option { display: flex; align-items: center; gap: .6rem; padding: .55rem .65rem; border: 1px solid var(--line); border-radius: 8px; font-size: .82rem; cursor: pointer; transition: background .15s, border-color .15s; }
.quiz-option:hover { background: var(--surface-2); border-color: var(--line-strong); }
.quiz-option.selected { background: var(--brand-soft); border-color: color-mix(in srgb, var(--brand) 45%, var(--line)); }
.quiz-option input { accent-color: var(--brand); }
.opt-mark { width: 24px; height: 24px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 6px; background: var(--surface-3); color: var(--muted); font-size: .68rem; font-weight: 800; }
.quiz-option.selected .opt-mark { background: var(--brand); color: #fff; }
.order-list { display: flex; flex-direction: column; gap: .45rem; margin-top: 1rem; }
.order-item { display: flex; align-items: center; gap: .6rem; padding: .55rem .7rem; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); font-size: .82rem; }
.order-index { width: 24px; height: 24px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 6px; background: var(--brand-soft); color: var(--brand); font-size: .7rem; font-weight: 800; }
.order-text { flex: 1; }
.order-actions { display: flex; gap: .2rem; }
.order-actions button { width: 26px; height: 26px; display: grid; place-items: center; border: 1px solid var(--line); background: var(--surface); border-radius: 6px; color: var(--ink-soft); }
.order-actions button:disabled { opacity: .35; }
.order-actions button:hover:not(:disabled) { border-color: var(--brand); }
.checklist { display: flex; flex-direction: column; gap: .45rem; margin-top: 1rem; }
.checklist-item { display: flex; align-items: flex-start; gap: .6rem; padding: .6rem .7rem; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); font-size: .82rem; cursor: pointer; }
.checklist-item:hover { background: var(--surface-2); }
.checklist-item input { margin-top: .18rem; accent-color: var(--brand); }
.code-lab { margin-top: 1rem; }
.code-editor-wrap { border: 1px solid var(--line-strong); border-radius: 10px; overflow: hidden; }
.code-editor-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: .45rem .7rem; background: var(--surface-2); border-bottom: 1px solid var(--line); color: var(--muted); font-size: .7rem; }
.code-editor-head .dots { display: flex; gap: .25rem; }
.code-editor-head .dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--line-strong); }
.code-editor-head .dots i:first-child { background: #d26b5f; }
.code-editor-head .dots i:nth-child(2) { background: #d4a64b; }
.code-editor-head .dots i:nth-child(3) { background: #66a96f; }
.code-editor { width: 100%; min-height: 220px; border: 0; background: #12241b; color: #d8f0e2; padding: .9rem; font-family: var(--mono); font-size: .82rem; line-height: 1.65; resize: vertical; }
.match-list { display: flex; flex-direction: column; gap: .5rem; margin-top: 1rem; }
.match-row { display: grid; grid-template-columns: 1fr 24px 1.1fr; align-items: center; gap: .5rem; padding: .5rem; border: 1px solid var(--line); border-radius: 9px; }
.match-row.selected { border-color: var(--brand); background: var(--brand-soft); }
.match-left { font-size: .8rem; }
.match-arrow { color: var(--muted); text-align: center; }
.match-row .select { min-height: 36px; font-size: .78rem; }
.exercise-foot { display: flex; flex-wrap: wrap; align-items: center; gap: .7rem; margin-top: 1.4rem; padding-top: 1.2rem; border-top: 1px solid var(--line); }
.exercise-foot .spacer { flex: 1; }
.save-status { color: var(--muted); font-size: .74rem; }

/* Feedback */
.feedback-panel { margin-top: 1.4rem; padding: 1.2rem; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); }
.feedback-panel.is-passed { border-color: color-mix(in srgb, var(--success) 40%, var(--line)); box-shadow: inset 0 3px 0 var(--success); }
.feedback-panel.is-failed { border-color: color-mix(in srgb, var(--danger) 35%, var(--line)); box-shadow: inset 0 3px 0 var(--danger); }
.feedback-head { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem; margin-bottom: 1rem; }
.feedback-head h2 { font-size: 1.35rem; margin: .35rem 0 .2rem; }
.feedback-head p { margin: 0; color: var(--muted); font-size: .8rem; }
.score-orb { width: 86px; height: 86px; flex: 0 0 auto; border-radius: 50%; display: grid; place-items: center; align-content: center; border: 5px solid var(--line); background: var(--surface-2); color: var(--ink); }
.score-orb strong { font-size: 1.55rem; line-height: 1; letter-spacing: -.04em; }
.score-orb span { font-size: .62rem; color: var(--muted); }
.score-orb.excellent { border-color: var(--success); color: var(--success); }
.score-orb.good { border-color: var(--brand-2); color: var(--brand-2); }
.score-orb.warn { border-color: var(--danger); color: var(--danger); }
.xp-note { color: var(--gold) !important; font-weight: 700; }
.feedback-explain { padding: .7rem .85rem; border-radius: 9px; background: var(--surface-2); color: var(--ink-soft); font-size: .82rem; }
.explanations { display: flex; flex-direction: column; gap: .4rem; margin-top: .8rem; }
.quiz-explain { font-size: .78rem; color: var(--muted); padding: .5rem .7rem; background: var(--surface-2); border-radius: 7px; }
.solution-box { margin-top: 1rem; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; }
.solution-head { padding: .45rem .75rem; background: var(--surface-2); color: var(--muted); font-size: .7rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; }
.solution-box pre { border-radius: 0; }
.feedback-actions { display: flex; flex-wrap: wrap; gap: .55rem; margin-top: 1rem; }

/* ------------------------------ Evaluations ----------------------------- */
.eval-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); gap: 1rem; }
.eval-card { display: flex; flex-direction: column; padding: 1.3rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.eval-card.is-submitted { border-top: 4px solid var(--success); }
.eval-card.is-progress { border-top: 4px solid var(--warning); }
.eval-card h3 { margin: .55rem 0 .25rem; font-size: 1.05rem; }
.eval-card .desc { color: var(--muted); font-size: .8rem; line-height: 1.55; flex: 1; margin-bottom: .9rem; }
.eval-meta { display: flex; flex-wrap: wrap; gap: .4rem; margin: .65rem 0; }
.eval-foot { display: flex; align-items: center; gap: .6rem; margin-top: .9rem; padding-top: .9rem; border-top: 1px solid var(--line); }
.eval-foot .spacer { flex: 1; }
.eval-hero { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(260px, .6fr); gap: 1.2rem; align-items: start; }
.eval-hero-main { padding: clamp(1.4rem, 3vw, 2.3rem); border-radius: var(--radius-lg); background: linear-gradient(145deg, var(--brand-soft), var(--surface)); border: 1px solid color-mix(in srgb, var(--brand) 18%, var(--line)); }
.eval-hero-main h1 { font-size: clamp(1.9rem, 3vw, 2.6rem); margin: .5rem 0; }
.eval-hero-side { display: flex; flex-direction: column; gap: .8rem; }
.eval-timer-card { padding: 1.2rem; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); }
.timer { font-family: var(--mono); font-size: 2rem; font-weight: 800; letter-spacing: .02em; color: var(--ink); }
.timer.is-urgent { color: var(--danger); animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: .55; } }
.run-layout { display: grid; grid-template-columns: minmax(0, 1fr) 250px; gap: 1.3rem; align-items: start; }
.run-side { position: sticky; top: calc(var(--topbar) + 1rem); display: flex; flex-direction: column; gap: .8rem; }
.run-side-card { padding: 1rem; }
.run-side-card h4 { font-size: .8rem; margin-bottom: .45rem; }
.run-side-card p { font-size: .75rem; color: var(--muted); margin: 0 0 .5rem; }
.evaluation-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: .7rem; padding: .8rem 1rem; background: var(--surface); border: 1px solid var(--line); border-radius: 11px; margin-bottom: 1rem; position: sticky; top: calc(var(--topbar) + .6rem); z-index: 10; box-shadow: var(--shadow-sm); }
.evaluation-toolbar .spacer { flex: 1; }
.autosave-status { font-size: .72rem; color: var(--muted); display: inline-flex; align-items: center; gap: .35rem; }
.autosave-status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--line-strong); }
.autosave-status.ok::before { background: var(--success); }
.autosave-status.dirty::before { background: var(--warning); }
.autosave-status.error::before { background: var(--danger); }
.question-card { padding: 1.15rem 1.2rem; margin-bottom: 1rem; background: var(--surface); border: 1px solid var(--line); border-radius: 13px; box-shadow: var(--shadow-sm); }
.question-head { display: flex; align-items: center; justify-content: space-between; gap: .6rem; margin-bottom: .7rem; }
.question-num { color: var(--muted); font-size: .69rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.question-card h3 { font-size: .96rem; line-height: 1.5; margin-bottom: .6rem; }
.filter-chips { display: flex; flex-wrap: wrap; gap: .35rem; margin-bottom: .8rem; }
.filter-chips button { border: 1px solid var(--line); background: var(--surface); border-radius: 99px; padding: .25rem .65rem; font-size: .7rem; color: var(--muted); }
.filter-chips button.is-active { background: var(--brand); border-color: var(--brand); color: #fff; }

/* ------------------------------ Dashboard ------------------------------- */
.dash-hero { display: flex; flex-wrap: wrap; align-items: center; gap: 1.4rem; padding: clamp(1.3rem, 2.5vw, 2rem); border-radius: var(--radius-lg); background: linear-gradient(145deg, #10402f, #166247); color: #edf8f1; box-shadow: var(--shadow-md); }
.dash-hero h1 { color: #fff; font-size: clamp(1.7rem, 2.6vw, 2.35rem); margin: .2rem 0 .4rem; }
.dash-hero p { color: rgba(237, 248, 241, .75); margin: 0; font-size: .88rem; }
.dash-hero .spacer { flex: 1; }
.xp-badge { display: inline-flex; align-items: center; gap: .45rem; padding: .45rem .8rem; border-radius: 99px; background: rgba(255, 255, 255, .12); color: #fff; font-size: .75rem; font-weight: 700; border: 1px solid rgba(255, 255, 255, .15); }
.level-badge { display: inline-flex; align-items: center; gap: .4rem; padding: .4rem .75rem; border-radius: 99px; background: rgba(216, 186, 124, .18); border: 1px solid rgba(216, 186, 124, .35); color: #f0d9a8; font-size: .72rem; }
.dash-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(280px, .5fr); gap: 1.2rem; align-items: start; }
.dash-main, .dash-side { display: flex; flex-direction: column; gap: 1.1rem; }
.continue-card { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem; padding: 1.2rem; border-radius: var(--radius); background: linear-gradient(145deg, var(--gold-soft), var(--surface)); border: 1px solid color-mix(in srgb, var(--gold) 25%, var(--line)); }
.continue-card .icon-wrap { width: 46px; height: 46px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 12px; background: var(--gold); color: #fff; }
.continue-card h3 { margin: 0 0 .15rem; font-size: 1rem; }
.continue-card p { margin: 0; color: var(--muted); font-size: .78rem; }
.continue-card .spacer { flex: 1 1 120px; }
.progress-ring { --value: 0; --size: 112px; width: var(--size); height: var(--size); border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--brand-2) calc(var(--value) * 1%), var(--surface-3) 0); flex: 0 0 auto; }
.progress-ring-inner { width: calc(var(--size) - 20px); height: calc(var(--size) - 20px); border-radius: 50%; background: var(--surface); display: grid; place-items: center; align-content: center; color: var(--ink); }
.progress-ring strong { font-size: 1.7rem; letter-spacing: -.05em; line-height: 1; color: var(--ink); }
.progress-ring span { color: var(--muted); font-size: .65rem; }
.ring-row { display: flex; align-items: center; gap: 1.1rem; }
.ring-copy { flex: 1; }
.ring-copy h3 { margin: 0 0 .2rem; }
.ring-copy p { color: var(--muted); font-size: .78rem; margin: 0; }
.attempt-list { display: flex; flex-direction: column; }
.attempt-row { display: flex; align-items: center; gap: .7rem; padding: .65rem 0; border-bottom: 1px solid var(--line); font-size: .8rem; }
.attempt-row:last-child { border-bottom: 0; }
.attempt-row .spacer { flex: 1; }
.attempt-score { font-weight: 800; font-size: .8rem; color: var(--ink); }
.module-progress-list { display: flex; flex-direction: column; gap: .65rem; }
.module-progress-item { display: flex; align-items: center; gap: .7rem; }
.module-progress-item .module-num { width: 30px; height: 30px; border-radius: 8px; font-size: .7rem; }
.module-progress-copy { flex: 1; min-width: 0; }
.module-progress-copy strong { display: block; font-size: .77rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.module-progress-copy .progress { margin-top: .25rem; }
.module-progress-value { font-size: .7rem; color: var(--muted); min-width: 34px; text-align: right; }

/* ------------------------------ Certificate ----------------------------- */
.certificate-preview {
  position: relative; overflow: hidden;
  padding: clamp(1.4rem, 4vw, 2.8rem);
  border-radius: 10px;
  background: #fbf9f2;
  border: 10px solid #12402f;
  outline: 2px solid #b8903f;
  outline-offset: -16px;
  color: #1d2b24;
  box-shadow: var(--shadow-lg);
  text-align: center;
}
.certificate-preview::before, .certificate-preview::after {
  content: ""; position: absolute; width: 190px; height: 190px; border: 1px solid rgba(184, 144, 63, .35); border-radius: 50%; pointer-events: none;
}
.certificate-preview::before { left: -90px; bottom: -100px; }
.certificate-preview::after { right: -90px; top: -100px; }
.cert-brand { color: #12402f; font-size: .66rem; letter-spacing: .22em; font-weight: 800; text-transform: uppercase; }
.cert-title { margin: .7rem 0 .15rem; color: #12402f; font-size: clamp(2rem, 4vw, 3.2rem); letter-spacing: .08em; font-weight: 850; }
.cert-subtitle { color: #b8903f; font-size: .72rem; letter-spacing: .3em; font-weight: 800; text-transform: uppercase; }
.cert-label { margin-top: 1.4rem; color: #68766f; font-size: .78rem; font-style: italic; }
.cert-name { margin: .25rem 0 .2rem; color: #16261e; font-size: clamp(1.55rem, 3vw, 2.3rem); font-weight: 800; letter-spacing: -.02em; }
.cert-line { width: 230px; max-width: 70%; height: 1px; background: #b8903f; margin: .65rem auto 1rem; }
.cert-course { color: #12402f; font-size: clamp(.95rem, 1.8vw, 1.25rem); font-weight: 750; }
.cert-summary { color: #68766f; font-size: .72rem; margin-top: .3rem; }
.cert-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: .7rem; max-width: 620px; margin: 1.7rem auto 1.4rem; }
.cert-box { padding: .65rem .4rem; border: 1px solid rgba(184, 144, 63, .45); background: rgba(255, 255, 255, .5); border-radius: 6px; }
.cert-box span { display: block; color: #7a7b67; font-size: .58rem; letter-spacing: .1em; font-weight: 800; text-transform: uppercase; }
.cert-box strong { display: block; color: #12402f; font-size: .88rem; margin-top: .25rem; }
.cert-foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem; max-width: 660px; margin: 1.7rem auto 0; text-align: left; }
.cert-sign { min-width: 160px; }
.cert-sign .line { width: 160px; height: 1px; background: #12402f; margin-bottom: .4rem; }
.cert-sign strong { display: block; color: #16261e; font-size: .72rem; }
.cert-sign span { color: #7a7b67; font-size: .65rem; }
.cert-verify { text-align: center; margin-top: 1.4rem; color: #7a7b67; font-size: .62rem; }
.requirement-list { display: flex; flex-direction: column; gap: .65rem; }
.requirement { display: flex; align-items: center; gap: .7rem; padding: .7rem .8rem; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); }
.requirement .status-dot { width: 24px; height: 24px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 50%; background: var(--surface-3); color: var(--muted); font-size: .7rem; font-weight: 900; }
.requirement.met .status-dot { background: var(--success-soft); color: var(--success); }
.requirement.met { border-color: color-mix(in srgb, var(--success) 32%, var(--line)); }
.requirement-copy { flex: 1; }
.requirement-copy strong { display: block; font-size: .8rem; }
.requirement-copy span { color: var(--muted); font-size: .7rem; }
.requirement-value { font-size: .76rem; font-weight: 750; }

/* -------------------------------- Admin --------------------------------- */
.admin-hero { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem; margin-bottom: 1.3rem; }
.admin-hero h1 { margin: 0 0 .2rem; }
.admin-hero p { color: var(--muted); margin: 0; font-size: .86rem; }
.admin-actions { display: flex; flex-wrap: wrap; gap: .45rem; }
.search-bar { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; margin-bottom: 1rem; }
.search-bar .input { max-width: 360px; }
.admin-detail-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(290px, .6fr); gap: 1.2rem; align-items: start; }
.admin-side { display: flex; flex-direction: column; gap: 1rem; }
.learner-summary { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem; }
.learner-summary .avatar { width: 54px; height: 54px; border-radius: 14px; font-size: 1rem; }
.learner-summary h2 { margin: 0 0 .15rem; }
.learner-summary p { margin: 0; color: var(--muted); font-size: .8rem; }
.mini-stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: .6rem; }
.mini-stat { padding: .7rem .8rem; border: 1px solid var(--line); border-radius: 9px; background: var(--surface-2); }
.mini-stat strong { display: block; font-size: 1.15rem; letter-spacing: -.03em; }
.mini-stat span { color: var(--muted); font-size: .68rem; }
.module-status-card { border: 1px solid var(--line); border-radius: 11px; padding: .9rem 1rem; background: var(--surface); }
.module-status-head { display: flex; align-items: center; gap: .6rem; }
.module-status-head h4 { margin: 0; font-size: .85rem; }
.module-status-head .spacer { flex: 1; }
.module-status-list { margin-top: .65rem; display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: .35rem .8rem; }
.status-line { display: flex; align-items: center; gap: .45rem; font-size: .74rem; color: var(--muted); }
.status-line .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--line-strong); flex: 0 0 auto; }
.status-line.ok .dot { background: var(--success); }
.status-line.ok { color: var(--ink-soft); }
.status-line.current .dot { background: var(--brand); }

/* ------------------------------- Alerts --------------------------------- */
.flash {
  display: flex; align-items: flex-start; gap: .6rem;
  padding: .75rem 1rem; margin-bottom: 1rem;
  border-radius: 10px; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink-soft); font-size: .82rem;
}
.flash .icon { flex: 0 0 auto; margin-top: .08rem; }
.flash-success { background: var(--success-soft); border-color: color-mix(in srgb, var(--success) 28%, transparent); color: var(--success); }
.flash-error { background: var(--danger-soft); border-color: color-mix(in srgb, var(--danger) 28%, transparent); color: var(--danger); }
.flash-warning { background: var(--warning-soft); border-color: color-mix(in srgb, var(--warning) 28%, transparent); color: var(--warning); }
.flash-info { background: var(--info-soft); border-color: color-mix(in srgb, var(--info) 28%, transparent); color: var(--info); }
.empty-state { text-align: center; padding: 2.6rem 1.5rem; border: 1px dashed var(--line-strong); border-radius: var(--radius); background: var(--surface-2); }
.empty-state .empty-icon { width: 54px; height: 54px; display: grid; place-items: center; border-radius: 14px; background: var(--surface-3); color: var(--muted); margin: 0 auto .8rem; }
.empty-state h3 { margin-bottom: .25rem; }
.empty-state p { color: var(--muted); font-size: .84rem; margin: 0 0 .9rem; }

/* ------------------------- Toast & Modal ------------------------------- */
.toast-root { position: fixed; z-index: 200; right: 1.1rem; bottom: 1.1rem; display: flex; flex-direction: column; gap: .55rem; max-width: min(380px, calc(100vw - 2rem)); }
.toast { display: flex; align-items: flex-start; gap: .55rem; padding: .7rem .8rem; background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--brand); border-radius: 9px; box-shadow: var(--shadow-md); color: var(--ink-soft); font-size: .8rem; opacity: 0; transform: translateY(8px); transition: opacity .2s, transform .2s; }
.toast.is-visible { opacity: 1; transform: translateY(0); }
.toast-success { border-left-color: var(--success); }
.toast-error { border-left-color: var(--danger); }
.toast-warning { border-left-color: var(--warning); }
.toast-dot { width: 8px; height: 8px; flex: 0 0 auto; border-radius: 50%; background: var(--brand); margin-top: .35rem; }
.toast-success .toast-dot { background: var(--success); }
.toast-error .toast-dot { background: var(--danger); }
.toast-warning .toast-dot { background: var(--warning); }
.toast-close { margin-left: auto; border: 0; background: none; color: var(--muted); font-size: 1rem; line-height: 1; padding: 0 .15rem; }
.modal-backdrop { position: fixed; inset: 0; z-index: 210; display: grid; place-items: center; background: rgba(8, 25, 17, .55); backdrop-filter: blur(3px); opacity: 0; transition: opacity .18s; padding: 1.2rem; }
.modal-backdrop.is-open { opacity: 1; }
.modal-dialog { width: min(480px, 100%); background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-lg); padding: 1.5rem; transform: translateY(8px) scale(.98); transition: transform .18s; }
.modal-backdrop.is-open .modal-dialog { transform: translateY(0) scale(1); }
.modal-icon { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 11px; background: var(--warning-soft); color: var(--warning); font-weight: 900; font-size: 1.1rem; margin-bottom: .85rem; }
.modal-icon.danger { background: var(--danger-soft); color: var(--danger); }
.modal-dialog h3 { font-size: 1.12rem; margin-bottom: .35rem; }
.modal-dialog p { color: var(--muted); font-size: .84rem; line-height: 1.6; margin-bottom: 1.2rem; }
.modal-actions { display: flex; justify-content: flex-end; gap: .55rem; }

/* -------------------------------- Footer -------------------------------- */
.site-footer { max-width: 1220px; margin: 2rem auto 0; padding: 1.2rem .2rem 0; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; align-items: center; gap: .6rem 1rem; color: var(--muted); font-size: .75rem; }
.site-footer .dot { width: 4px; height: 4px; border-radius: 50%; background: var(--line-strong); }
.site-footer .spacer { flex: 1; }

/* ------------------------------- Responsive ----------------------------- */
@media (max-width: 1180px) {
  .course-head, .detail-hero, .eval-hero, .dash-grid, .admin-detail-grid { grid-template-columns: 1fr; }
  .lesson-layout { grid-template-columns: 1fr; }
  .lesson-aside { position: static; }
  .run-layout { grid-template-columns: 1fr; }
  .run-side { position: static; }
  .auth-shell { grid-template-columns: 1fr; max-width: 620px; }
  .auth-aside { padding: 1.6rem; }
  .auth-aside h2 { font-size: 1.55rem; }
}
@media (max-width: 1024px) {
  :root { --sidebar: 280px; }
  .nav-toggle { display: inline-grid; }
  .sidebar { transform: translateX(-105%); transition: transform .22s ease; box-shadow: var(--shadow-lg); background: var(--surface); }
  .nav-open .sidebar { transform: translateX(0); }
  .sidebar-backdrop { display: block; position: fixed; inset: var(--topbar) 0 0 0; background: rgba(8, 25, 17, .4); opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 35; }
  .nav-open .sidebar-backdrop { opacity: 1; pointer-events: auto; }
  .main { padding: calc(var(--topbar) + 1.4rem) 1.2rem 1.5rem; }
  .topbar { padding: 0 1rem; }
  .topbar .brand-copy small { display: none; }
}
@media (max-width: 760px) {
  .hide-mobile { display: none !important; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .compare-grid { grid-template-columns: 1fr; }
  .cert-grid { grid-template-columns: 1fr 1fr; }
  .cert-foot { justify-content: center; text-align: center; }
  .cert-sign .line { margin-left: auto; margin-right: auto; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .course-stats { grid-template-columns: repeat(2, 1fr); }
  .hero { padding: 1.4rem; }
  .hero-stats { gap: 1rem 1.5rem; }
  .hero-stat strong { font-size: 1.1rem; }
  .data-table { min-width: 560px; }
  .topbar-actions .role-pill { display: none; }
  .page-head { align-items: flex-start; }
  .lesson-head h1 { font-size: 1.55rem; }
  .lesson-aside .aside-lessons { max-height: 220px; overflow: auto; }
  .exercise-shell { padding: 1rem; }
  .evaluation-toolbar { top: calc(var(--topbar) + .35rem); }
  .question-card { padding: .95rem; }
  .match-row { grid-template-columns: 1fr; }
  .match-arrow { display: none; }
  .modal-actions { flex-direction: column-reverse; }
  .modal-actions .btn { width: 100%; }
}
@media (max-width: 520px) {
  .stat-grid, .course-stats { grid-template-columns: 1fr; }
  .cert-grid { grid-template-columns: 1fr; }
  .auth-main, .auth-aside { padding: 1.25rem; }
  .hero-actions .btn { width: 100%; }
  .page-head-actions .btn { flex: 1; }
  .topbar { gap: .45rem; }
  .brand-copy strong { font-size: .95rem; }
  .user-btn { padding-right: .4rem; }
  .topbar-actions { gap: .35rem; }
  .icon-btn { width: 37px; height: 37px; }
}

@media print {
  .topbar, .sidebar, .site-footer, .no-print, .toast-root { display: none !important; }
  .main { padding: 0; }
  .certificate-preview { box-shadow: none; border-width: 6px; outline-offset: -10px; }
  body { background: #fff; }
}
