/* =============================================================================
   Academia · Sistema de diseño
   Personalización: los colores de marca y el radio llegan de /theme.css
   (Admin → Apariencia). Para cambios a mano, edita solo los tokens de :root.
   ============================================================================= */
:root {
  --brand: #E2001A;           /* sobrescrito por /theme.css */
  --accent: #4A5560;          /* sobrescrito por /theme.css */
  --radius: 14px;
  --radius-sm: 7px;

  --brand-hover: color-mix(in srgb, var(--brand) 85%, #000);
  --brand-soft: color-mix(in srgb, var(--brand) 9%, var(--surface));
  --brand-ink: #fff;

  --bg: #F5F6F8;
  --surface: #FFFFFF;
  --surface-2: #F0F2F5;
  --line: #E4E7EB;
  --text: #1F2933;
  --text-2: #5B6670;
  --muted: #8A949E;
  --ok: #138A4A;   --ok-soft: color-mix(in srgb, var(--ok) 12%, var(--surface));
  --warn: #B86E00; --warn-soft: color-mix(in srgb, var(--warn) 13%, var(--surface));
  --err: #C8102E;  --err-soft: color-mix(in srgb, var(--err) 11%, var(--surface));
  --info: #2364AA; --info-soft: color-mix(in srgb, var(--info) 11%, var(--surface));
  --shadow: 0 1px 2px rgba(16,24,40,.05), 0 1px 3px rgba(16,24,40,.06);
  --shadow-lg: 0 10px 30px -10px rgba(16,24,40,.18);
  --sidebar-w: 248px;
  --font: "Inter", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  --mono: "JetBrains Mono", "Cascadia Mono", Consolas, monospace;
  color-scheme: light;
}

/* Modo oscuro: forzado (data-theme=dark) o automático según el sistema */
:root[data-theme="dark"] { color-scheme: dark; }
:root[data-theme="dark"], :root[data-theme="dark"] body {
  --bg: #0F1318; --surface: #161B22; --surface-2: #1D232C; --line: #2A313B;
  --text: #E6EAF0; --text-2: #A7B0BB; --muted: #7D8794;
  --shadow: 0 1px 2px rgba(0,0,0,.4); --shadow-lg: 0 12px 30px -10px rgba(0,0,0,.6);
  --ok: #3FB27F; --warn: #E0A43A; --err: #FF6B7D; --info: #6CA8F0;
}
@media (prefers-color-scheme: dark) {
  :root[data-theme="auto"] { color-scheme: dark; }
  :root[data-theme="auto"], :root[data-theme="auto"] body {
    --bg: #0F1318; --surface: #161B22; --surface-2: #1D232C; --line: #2A313B;
    --text: #E6EAF0; --text-2: #A7B0BB; --muted: #7D8794;
    --shadow: 0 1px 2px rgba(0,0,0,.4); --shadow-lg: 0 12px 30px -10px rgba(0,0,0,.6);
    --ok: #3FB27F; --warn: #E0A43A; --err: #FF6B7D; --info: #6CA8F0;
  }
}
.logo-dark { display: none; }
:root[data-theme="dark"] .logo-light { display: none; }
:root[data-theme="dark"] .logo-dark { display: block; }
@media (prefers-color-scheme: dark) {
  :root[data-theme="auto"] .logo-light { display: none; }
  :root[data-theme="auto"] .logo-dark { display: block; }
}

/* ---------------------------------------------------------------- base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 15px/1.55 var(--font); background: var(--bg); color: var(--text); -webkit-font-smoothing: antialiased; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.6rem; line-height: 1.2; margin: 0; letter-spacing: -.02em; font-weight: 700; }
h2 { font-size: 1.05rem; margin: 0 0 .9rem; font-weight: 650; letter-spacing: -.01em; }
h3 { font-size: 1rem; margin: 0; font-weight: 650; }
p { margin: 0 0 .8rem; }
code, .mono { font-family: var(--mono); font-size: .86em; }
code { background: var(--surface-2); padding: .1em .4em; border-radius: 5px; }
small, .small { font-size: .84rem; }
.muted { color: var(--text-2); }
.i { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.i.lg { width: 22px; height: 22px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 6px; }

/* -------------------------------------------------- layout: personal */
.app { display: grid; grid-template-columns: var(--sidebar-w) 1fr; min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: .3rem;
  padding: 1.1rem .9rem; background: var(--surface); border-right: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: .7rem; padding: .3rem .5rem 1.1rem; color: var(--text) !important; text-decoration: none !important; }
.brand img { height: 38px; width: auto; }
.brand b { display: block; font-size: .98rem; line-height: 1.2; }
.brand small { display: block; color: var(--text-2); font-size: .74rem; }
.nav-label { font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: .9rem .7rem .3rem; }
.nav-item { display: flex; align-items: center; gap: .7rem; padding: .55rem .7rem; border-radius: var(--radius-sm);
  color: var(--text-2); font-weight: 550; text-decoration: none !important; transition: background .12s, color .12s; }
.nav-item:hover { background: var(--surface-2); color: var(--text); }
.nav-item.on { background: var(--brand-soft); color: var(--brand); }
.sidebar .me { margin-top: auto; border-top: 1px solid var(--line); padding-top: .9rem; display: flex; align-items: center; gap: .6rem; }
.avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: var(--brand-soft); color: var(--brand); font-weight: 700; font-size: .85rem; text-transform: uppercase; }
.me .who { flex: 1; min-width: 0; line-height: 1.25; }
.me .who b { display: block; font-size: .88rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me .who small { color: var(--text-2); }
.main { min-width: 0; padding: 1.8rem 2.2rem 3rem; }
.main > .inner { max-width: 1180px; margin: 0 auto; }
.mobile-bar { display: none; }

/* -------------------------------------------------- layout: alumno */
.top { position: sticky; top: 0; z-index: 5; background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--line); }
.top .inner { max-width: 1040px; margin: 0 auto; padding: .65rem 1.4rem; display: flex; align-items: center; gap: 1rem; }
.top .brand { padding: 0; }
.top .spacer { flex: 1; }
.student { max-width: 1040px; margin: 0 auto; padding: 2rem 1.4rem 3rem; }

/* ------------------------------------------------------- page header */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.page-head .sub { color: var(--text-2); margin: .35rem 0 0; }
.crumb { display: inline-flex; align-items: center; gap: .3rem; color: var(--text-2); font-size: .86rem; margin-bottom: .5rem; }
.toolbar { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.toolbar form { margin: 0; }

/* -------------------------------------------------------- superficies */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.3rem 1.4rem; box-shadow: var(--shadow); }
.card + .card, .card + .section, .section + .card { margin-top: 1.1rem; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.card-head h2 { margin: 0; }
.section { margin-top: 1.8rem; }
.grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); }
.grid-2 { display: grid; gap: 1.1rem; grid-template-columns: 1fr 1fr; }
.stack > * + * { margin-top: .8rem; }

/* ------------------------------------------------------------ KPIs */
.kpis { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); margin-bottom: 1.6rem; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.15rem; box-shadow: var(--shadow); display: flex; gap: .9rem; align-items: center; }
.kpi .ic { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); flex: none; }
.kpi b { display: block; font-size: 1.55rem; line-height: 1.1; letter-spacing: -.02em; }
.kpi span { color: var(--text-2); font-size: .82rem; }
.kpi.ok .ic { background: var(--ok-soft); color: var(--ok); }
.kpi.warn .ic { background: var(--warn-soft); color: var(--warn); }
.kpi.err .ic { background: var(--err-soft); color: var(--err); }

/* ------------------------------------------------------- tarjetas lab */
.lab-card { position: relative; display: flex; flex-direction: column; gap: .7rem; padding: 1.25rem; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); color: inherit; text-decoration: none !important;
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s; }
a.lab-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); border-color: color-mix(in srgb, var(--brand) 35%, var(--line)); }
.lab-card .top-row { display: flex; align-items: center; justify-content: space-between; gap: .6rem; }
.lab-card .ic { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); }
.lab-card p { color: var(--text-2); margin: 0; font-size: .9rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.lab-card .foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: .5rem; color: var(--text-2); font-size: .84rem; }
.lab-card .go { display: inline-flex; align-items: center; gap: .3rem; color: var(--brand); font-weight: 600; }
.progress { height: 6px; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
.progress > i { display: block; height: 100%; background: var(--ok); border-radius: 99px; }

/* ----------------------------------------------------------- chips */
.chip { display: inline-flex; align-items: center; gap: .4rem; padding: .18rem .62rem; border-radius: 99px; font-size: .78rem; font-weight: 600;
  background: var(--surface-2); color: var(--text-2); white-space: nowrap; }
.chip::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; opacity: .85; }
.chip.plain::before { display: none; }
.st-activo, .st-running, .lab-publicado, .chip.ok { background: var(--ok-soft); color: var(--ok); }
.st-caido, .st-error, .st-exited, .chip.err { background: var(--err-soft); color: var(--err); }
.st-en-cola, .st-desplegando, .st-pendiente, .chip.warn { background: var(--warn-soft); color: var(--warn); }
.st-en-cola::before, .st-desplegando::before { animation: pulse 1.2s infinite; }
.chip.info { background: var(--info-soft); color: var(--info); }
.role { font-size: .72rem; font-weight: 700; padding: .12rem .5rem; border-radius: 6px; background: var(--surface-2); color: var(--text-2); }
.role-admin { background: var(--brand); color: var(--brand-ink); }
.role-profesor { background: var(--accent); color: #fff; }
@keyframes pulse { 50% { opacity: .25; } }

/* ---------------------------------------------------------- botones */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .45rem; height: 38px; padding: 0 1rem; border-radius: var(--radius-sm);
  border: 1px solid transparent; background: var(--brand); color: var(--brand-ink); font: 600 .9rem var(--font); cursor: pointer;
  text-decoration: none !important; transition: background .12s, border-color .12s, color .12s; white-space: nowrap; }
.btn:hover { background: var(--brand-hover); }
.btn.secondary { background: var(--surface); color: var(--text); border-color: var(--line); }
.btn.secondary:hover { border-color: color-mix(in srgb, var(--brand) 45%, var(--line)); color: var(--brand); }
.btn.ghost { background: transparent; color: var(--text-2); }
.btn.ghost:hover { background: var(--surface-2); color: var(--text); }
.btn.danger { background: transparent; color: var(--err); border-color: color-mix(in srgb, var(--err) 30%, var(--line)); }
.btn.danger:hover { background: var(--err-soft); }
.btn.sm { height: 32px; padding: 0 .75rem; font-size: .83rem; }
.btn.icon { width: 36px; padding: 0; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
button.link { background: none; border: 0; padding: 0; color: var(--text-2); cursor: pointer; display: grid; place-items: center; }
button.link:hover { color: var(--brand); }

/* ---------------------------------------------------------- formularios */
.field { display: block; margin-bottom: 1rem; }
.field > span { display: block; font-weight: 600; font-size: .86rem; margin-bottom: .35rem; }
.field .hint { display: block; color: var(--text-2); font-size: .8rem; margin-top: .3rem; font-weight: 400; }
input:not([type=checkbox]):not([type=radio]):not([type=color]):not([type=file]), select, textarea {
  width: 100%; height: 40px; padding: 0 .8rem; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface);
  color: var(--text); font: inherit; transition: border-color .12s, box-shadow .12s; }
textarea { height: auto; padding: .65rem .8rem; resize: vertical; }
textarea.mono { font: .85rem/1.55 var(--mono); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 18%, transparent); }
.row { display: flex; gap: .6rem; flex-wrap: wrap; align-items: flex-end; }
.row > .field { flex: 1; min-width: 160px; margin: 0; }
.row > input, .row > select { flex: 1; min-width: 150px; width: auto; }
.check { display: flex; gap: .65rem; align-items: flex-start; padding: .55rem 0; cursor: pointer; }
.check input { width: 18px; height: 18px; margin-top: .15rem; accent-color: var(--brand); }
.check small { display: block; color: var(--text-2); }
.searchbox { position: relative; }
.searchbox .i { position: absolute; left: .7rem; top: 11px; color: var(--muted); }
.searchbox input { padding-left: 2.2rem !important; }

/* Zona de subida */
.drop { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .5rem; text-align: center;
  padding: 2.2rem 1rem; border: 2px dashed var(--line); border-radius: var(--radius); background: var(--surface-2); color: var(--text-2);
  cursor: pointer; transition: border-color .15s, background .15s; }
.drop:hover, .drop.over { border-color: var(--brand); background: var(--brand-soft); color: var(--text); }
.drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.drop .ic { width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; background: var(--surface); color: var(--brand); box-shadow: var(--shadow); }
.drop b { color: var(--text); }
.drop .file-name { font-weight: 600; color: var(--brand); }

/* Pasos */
.steps { display: flex; gap: .4rem; margin-bottom: 1.4rem; flex-wrap: wrap; }
.step { display: flex; align-items: center; gap: .5rem; padding: .4rem .85rem .4rem .45rem; border-radius: 99px; background: var(--surface); border: 1px solid var(--line); color: var(--muted); font-size: .85rem; font-weight: 600; }
.step i { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); font-style: normal; font-size: .78rem; }
.step.on { color: var(--text); border-color: color-mix(in srgb, var(--brand) 40%, var(--line)); }
.step.on i { background: var(--brand); color: var(--brand-ink); }
.step.done { color: var(--ok); }
.step.done i { background: var(--ok-soft); color: var(--ok); }

/* -------------------------------------------------------------- tablas */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
table.t { width: 100%; border-collapse: collapse; font-size: .9rem; }
.t th { text-align: left; font-weight: 600; font-size: .76rem; text-transform: uppercase; letter-spacing: .05em; color: var(--text-2);
  padding: .75rem 1rem; background: var(--surface-2); border-bottom: 1px solid var(--line); white-space: nowrap; }
.t td { padding: .7rem 1rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
.t tr:last-child td { border-bottom: 0; }
.t tbody tr:hover td { background: color-mix(in srgb, var(--surface-2) 55%, transparent); }
.t td.actions { text-align: right; white-space: nowrap; }
.t td.actions > * { display: inline-flex; vertical-align: middle; margin-left: .35rem; }
.t td.actions > *:first-child { margin-left: 0; }
.t div.actions { display: flex; gap: .35rem; justify-content: flex-end; flex-wrap: wrap; }
.t .actions form { margin: 0; }
.t .num { text-align: right; font-variant-numeric: tabular-nums; }
.t tr.lv-warning td:first-child { box-shadow: inset 3px 0 var(--warn); }
.t tr.lv-error td:first-child, .t tr.lv-critical td:first-child { box-shadow: inset 3px 0 var(--err); }
.t tr.row-error td { background: var(--err-soft); }
.cell-user b { display: block; font-weight: 600; }
.cell-user small { color: var(--text-2); }

/* Filtros tipo pestaña */
.tabs { display: flex; gap: .3rem; flex-wrap: wrap; margin-bottom: 1rem; }
.tab { padding: .38rem .8rem; border-radius: 99px; color: var(--text-2); font-weight: 600; font-size: .85rem; text-decoration: none !important; }
.tab:hover { background: var(--surface-2); color: var(--text); }
.tab.on { background: var(--text); color: var(--surface); }
.tab .n { opacity: .6; margin-left: .2rem; }

/* --------------------------------------------------------------- avisos */
.flash { display: flex; gap: .7rem; align-items: flex-start; padding: .8rem 1rem; border-radius: var(--radius-sm); margin-bottom: 1rem;
  background: var(--ok-soft); color: var(--text); border: 1px solid color-mix(in srgb, var(--ok) 25%, transparent); animation: in .25s ease; }
.flash .i { color: var(--ok); margin-top: .1rem; }
.flash-error { background: var(--err-soft); border-color: color-mix(in srgb, var(--err) 25%, transparent); }
.flash-error .i { color: var(--err); }
.flash-warn { background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn) 25%, transparent); }
.flash-warn .i { color: var(--warn); }
.flash .close { margin-left: auto; }
@keyframes in { from { opacity: 0; transform: translateY(-4px); } }

.empty { text-align: center; padding: 3rem 1rem; color: var(--text-2); }
.empty .ic { width: 64px; height: 64px; margin: 0 auto 1rem; border-radius: 18px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); }
.empty .ic .i { width: 30px; height: 30px; }
.empty h3 { color: var(--text); margin-bottom: .3rem; }

.status-list { list-style: none; padding: 0; margin: 0; }
.status-list li { display: flex; align-items: center; justify-content: space-between; padding: .6rem 0; border-bottom: 1px solid var(--line); }
.status-list li:last-child { border-bottom: 0; }
.feed { list-style: none; margin: 0; padding: 0; }
.feed li { display: flex; gap: .7rem; padding: .6rem 0; border-bottom: 1px solid var(--line); font-size: .88rem; }
.feed li:last-child { border-bottom: 0; }
.feed .dot { width: 8px; height: 8px; border-radius: 50%; margin-top: .45rem; background: var(--muted); flex: none; }
.feed .dot.warning { background: var(--warn); } .feed .dot.error, .feed .dot.critical { background: var(--err); }
.feed time { color: var(--muted); font-size: .8rem; display: block; }

/* ----------------------------------------------------------------- login */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1.05fr 1fr; }
.auth-side { position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between; padding: 3rem;
  background: linear-gradient(150deg, var(--brand), color-mix(in srgb, var(--brand) 55%, #2a0008)); color: #fff; }
.auth-side::after { content: ""; position: absolute; right: -120px; bottom: -120px; width: 420px; height: 420px; border-radius: 50%;
  background: rgba(255,255,255,.08); box-shadow: 0 0 0 70px rgba(255,255,255,.04); }
.auth-side h1 { font-size: 2.2rem; max-width: 420px; }
.auth-side p { opacity: .85; max-width: 420px; }
.auth-side .mark { width: 64px; height: 64px; border-radius: 16px; background: #fff; padding: 6px; }
.auth-main { display: grid; place-items: center; padding: 2rem; background: var(--surface); }
.auth-box { width: 100%; max-width: 360px; }
.auth-box .logos { height: 96px; margin: 0 auto 1.8rem; display: flex; justify-content: center; }
.auth-box .logos img { height: 96px; }

/* ------------------------------------------------------------ consola */
.nodes { display: grid; gap: .8rem; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); margin-bottom: 1.2rem; }
.node { display: flex; gap: .8rem; align-items: center; padding: .9rem 1rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.node .ic { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: var(--surface-2); color: var(--text-2); flex: none; }
.node .meta { flex: 1; min-width: 0; line-height: 1.3; }
.node .meta b { display: block; }
.node .meta small { color: var(--text-2); font-family: var(--mono); font-size: .76rem; }
.node form { margin: 0; }
.console { border-radius: var(--radius); overflow: hidden; border: 1px solid #262C35; box-shadow: var(--shadow-lg); background: #0D1117; }
.console-bar { display: flex; align-items: center; gap: .5rem; padding: .55rem .7rem; background: #161B22; border-bottom: 1px solid #262C35; flex-wrap: wrap; }
.console-bar .dots { display: flex; gap: 6px; margin-right: .5rem; }
.console-bar .dots i { width: 11px; height: 11px; border-radius: 50%; background: #3A414B; }
.console-bar .dots i:first-child { background: var(--brand); }
.pill { border: 0; background: transparent; color: #8B949E; font: 600 .8rem var(--mono); padding: .3rem .7rem; border-radius: 7px; cursor: pointer; }
.pill:hover { color: #E6EDF3; background: #21262D; }
.pill.on { color: #fff; background: #30363D; }
.console-bar .note { margin-left: auto; color: #6E7681; font-size: .75rem; }
.term { margin: 0; min-height: 300px; max-height: 52vh; overflow: auto; padding: 1rem 1.1rem; color: #E6EDF3; font: .86rem/1.55 var(--mono); white-space: pre-wrap; word-break: break-word; }
.term .c { color: #7EE787; } .term .e { color: #FF7B72; } .term .m { color: #6E7681; }
.cmdline { display: flex; gap: .6rem; align-items: center; padding: .55rem .8rem; border-top: 1px solid #262C35; background: #0D1117; }
.cmdline label { color: #7EE787; font: .86rem var(--mono); white-space: nowrap; }
.cmdline input { flex: 1; height: 34px !important; background: transparent !important; border: 0 !important; box-shadow: none !important; color: #E6EDF3 !important; font: .9rem var(--mono) !important; padding: 0 !important; }

/* --------------------------------------------------------- apariencia */
.swatches { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: .5rem; }
.swatch { width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--surface); box-shadow: 0 0 0 1px var(--line); cursor: pointer; padding: 0; }
.color-row { display: flex; gap: .6rem; align-items: center; }
.color-row input[type=color] { width: 44px; height: 40px; padding: 2px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); cursor: pointer; }
.seg { display: inline-flex; padding: 3px; background: var(--surface-2); border-radius: 10px; gap: 2px; flex-wrap: wrap; }
.seg label { position: relative; }
.seg input { position: absolute; opacity: 0; }
.seg span { display: block; padding: .4rem .85rem; border-radius: 8px; font-weight: 600; font-size: .85rem; color: var(--text-2); cursor: pointer; }
.seg input:checked + span { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.preview { border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem; background: var(--bg); }

details.card summary { cursor: pointer; font-weight: 600; }
details pre { white-space: pre-wrap; margin: .8rem 0 0; }
.foot-note { text-align: center; color: var(--muted); font-size: .78rem; margin-top: 2.5rem; }

/* ------------------------------------------------------------ responsive */
@media (max-width: 980px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: fixed; z-index: 20; left: 0; top: 0; width: var(--sidebar-w); transform: translateX(-100%); transition: transform .2s ease; box-shadow: var(--shadow-lg); }
  .sidebar.open { transform: none; }
  .mobile-bar { display: flex; align-items: center; gap: .7rem; position: sticky; top: 0; z-index: 10; padding: .6rem 1rem;
    background: var(--surface); border-bottom: 1px solid var(--line); }
  .mobile-bar img { height: 30px; }
  .main { padding: 1.3rem 1rem 2.5rem; }
  .grid-2 { grid-template-columns: 1fr; }
  .auth { grid-template-columns: 1fr; }
  .auth-side { display: none; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
.mt { margin-top: .75rem; }
.led { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: .4rem; vertical-align: middle; background: var(--muted); }
.led.on { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-soft); }
.led.off { background: var(--err); }
.nowrap { white-space: nowrap; }
@media (max-width: 640px) {
  .top .brand small, .hide-sm { display: none; }
  .top .brand b { white-space: nowrap; }
  .top .inner { padding: .55rem 1rem; gap: .4rem; }
  .student { padding: 1.4rem 1rem 2.5rem; }
  .kpis { grid-template-columns: 1fr 1fr; gap: .7rem; }
  .kpi { flex-direction: column; align-items: flex-start; gap: .5rem; padding: .85rem; }
  .kpi .ic { width: 36px; height: 36px; }
  .page-head .toolbar { width: 100%; }
  .page-head .toolbar .btn, .page-head .toolbar form { flex: 1; }
  .page-head .toolbar form .btn { width: 100%; }
  h1 { font-size: 1.4rem; }
}

[hidden] { display: none !important; }
