/* A Bordo — control de alumnos a bordo. Mobile-first. */
:root {
  --bg: #F6F3EC;
  --surface: #FFFFFF;
  --surface-2: #EFEBE1;
  --ink: #16202B;
  --ink-2: #4A5563;
  --ink-3: #7A8491;
  --line: #E0DACB;
  --brand: #F4B400;        /* amarillo bus escolar */
  --brand-ink: #1B1405;
  --navy: #17263A;
  --ok: #1E7A4C;
  --ok-bg: #DDF1E5;
  --no: #B3261E;
  --no-bg: #FBE3E0;
  --warn: #8A5A00;
  --warn-bg: #FFF1CC;
  --info: #1F5FA8;
  --info-bg: #E2ECF8;
  --wa: #128C4B;
  --radius: 16px;
  --radius-s: 10px;
  --shadow: 0 1px 2px rgba(22, 32, 43, .06), 0 4px 14px rgba(22, 32, 43, .06);
  --font: 'Atkinson Hyperlegible', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --display: 'Bricolage Grotesque', var(--font);
  --tabbar-h: 64px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0F151C; --surface: #18212B; --surface-2: #212C38; --ink: #EEF1F4; --ink-2: #B7C0CA; --ink-3: #8B96A2;
    --line: #2B3744; --navy: #0B121A; --ok: #5BD08F; --ok-bg: #173526; --no: #FF8A80; --no-bg: #3A1D1B;
    --warn: #FFC94D; --warn-bg: #3A2E10; --info: #8AB8F0; --info-bg: #1A2B40; --wa: #3DD27F;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 4px 14px rgba(0,0,0,.25);
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--font); font-size: 16px; line-height: 1.45; color: var(--ink); background: var(--bg);
  -webkit-font-smoothing: antialiased; min-height: 100dvh;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--display); line-height: 1.15; margin: 0; letter-spacing: -.01em; }
h1 { font-size: 1.5rem; font-weight: 700; }
h2 { font-size: 1.15rem; font-weight: 700; }
h3 { font-size: 1rem; font-weight: 700; }
.muted { color: var(--ink-2); }
.small { font-size: .875rem; }
.xs { font-size: .78rem; }
.tnum { font-variant-numeric: tabular-nums; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 3px solid var(--info); outline-offset: 2px; border-radius: 6px; }

/* ---------- Estructura ---------- */
.app { max-width: 720px; margin: 0 auto; min-height: 100dvh; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20; background: var(--navy); color: #fff;
  padding: 10px 16px; padding-top: calc(10px + env(safe-area-inset-top, 0px));
  display: flex; align-items: center; gap: 12px; min-height: 56px;
  box-shadow: 0 0 0 100vmax var(--navy); clip-path: inset(0 -100vmax);
}
.topbar .brand { display: flex; align-items: center; gap: 10px; text-decoration: none; min-width: 0; }
.topbar .brand svg { flex: none; }
.topbar .brand b { font-family: var(--display); font-size: 1.1rem; letter-spacing: -.01em; }
.topbar .brand span { font-size: .78rem; opacity: .75; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .back { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; margin-left: -8px; border-radius: 12px; color: #fff; text-decoration: none; flex: none; }
.topbar .back:active { background: rgba(255,255,255,.12); }
.topbar .ttl { min-width: 0; flex: 1; }
.topbar .ttl b { display: block; font-family: var(--display); font-size: 1.05rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .ttl span { display: block; font-size: .8rem; opacity: .8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
main { flex: 1; padding: 16px 16px calc(var(--tabbar-h) + 24px + var(--safe-b)); }
main.has-action { padding-bottom: calc(var(--tabbar-h) + 96px + var(--safe-b)); }
main.no-tabs { padding-bottom: calc(24px + var(--safe-b)); }
main.no-tabs.has-action { padding-bottom: calc(100px + var(--safe-b)); }

.tabbar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 30; background: var(--surface); border-top: 1px solid var(--line);
  display: flex; justify-content: center; padding-bottom: var(--safe-b);
}
.tabbar nav { display: flex; width: 100%; max-width: 720px; }
.tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; height: var(--tabbar-h); text-decoration: none; color: var(--ink-3); font-size: .75rem; font-weight: 700; }
.tabbar a[aria-current="page"] { color: var(--ink); }
.tabbar a[aria-current="page"] svg { color: var(--brand); }
@media (prefers-color-scheme: light) { .tabbar a[aria-current="page"] svg { color: #C78F00; } }

.actionbar {
  position: fixed; left: 0; right: 0; bottom: calc(var(--tabbar-h) + var(--safe-b)); z-index: 25;
  background: linear-gradient(to top, var(--bg) 70%, transparent); padding: 12px 16px 12px;
}
.actionbar.bottom { bottom: 0; padding-bottom: calc(12px + var(--safe-b)); }
.actionbar .inner { max-width: 688px; margin: 0 auto; display: flex; gap: 10px; }
.actionbar .inner > * { flex: 1; }

/* ---------- Componentes ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.card + .card, .stack > * + * { margin-top: 12px; }
.section-title { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin: 24px 0 10px; }
.section-title:first-child { margin-top: 4px; }
.section-title h2 { font-size: 1.05rem; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 10px 18px;
  border-radius: 14px; border: 1px solid transparent; font-weight: 700; font-size: 1rem; cursor: pointer; text-decoration: none;
  background: var(--surface-2); color: var(--ink); transition: transform .08s ease, background .15s ease; -webkit-tap-highlight-color: transparent;
  text-align: center; line-height: 1.2;
}
.btn:active { transform: scale(.98); }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .45; cursor: not-allowed; transform: none; }
.btn-primary { background: var(--brand); color: var(--brand-ink); }
.btn-dark { background: var(--navy); color: #fff; }
@media (prefers-color-scheme: dark) { .btn-dark { background: #2E4561; } }
.btn-ok { background: var(--ok); color: #fff; }
.btn-no { background: var(--no-bg); color: var(--no); border-color: color-mix(in srgb, var(--no) 30%, transparent); }
.btn-wa { background: var(--wa); color: #fff; }
.btn-ghost { background: transparent; border-color: var(--line); }
.btn-danger { background: var(--no); color: #fff; }
.btn-sm { min-height: 40px; padding: 6px 12px; font-size: .9rem; border-radius: 11px; }
.btn-block { width: 100%; }
.btn-link { background: none; border: 0; padding: 8px 4px; min-height: 44px; color: var(--info); font-weight: 700; cursor: pointer; }
@media (prefers-color-scheme: dark) { .btn-primary { color: #1B1405; } }

.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: .8rem; font-weight: 700; background: var(--surface-2); color: var(--ink-2); white-space: nowrap; }
.chip.ok { background: var(--ok-bg); color: var(--ok); }
.chip.no { background: var(--no-bg); color: var(--no); }
.chip.warn { background: var(--warn-bg); color: var(--warn); }
.chip.info { background: var(--info-bg); color: var(--info); }
.chip.brand { background: var(--brand); color: var(--brand-ink); }
.chip .dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }

.banner { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; background: var(--warn-bg); color: var(--warn); font-size: .92rem; margin-bottom: 12px; }
.banner.no { background: var(--no-bg); color: var(--no); }
.banner.info { background: var(--info-bg); color: var(--info); }
.banner.ok { background: var(--ok-bg); color: var(--ok); }
.banner svg { flex: none; margin-top: 1px; }
.banner b { display: block; }
.storage-banner { position: sticky; top: 0; z-index: 40; margin: 0; border-radius: 0; background: var(--no); color: #fff; }

/* Estadísticas */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.stat { background: var(--surface-2); border-radius: 12px; padding: 10px 8px; text-align: center; min-width: 0; }
.stat b { display: block; font-family: var(--display); font-size: 1.45rem; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat span { display: block; font-size: .78rem; color: var(--ink-2); font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat.onboard { background: var(--brand); color: var(--brand-ink); }
.stat.onboard span { color: var(--brand-ink); opacity: .8; }
.stat.ok b { color: var(--ok); }
.stat.no b { color: var(--no); }

/* Inicio */
.datebar { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; }
.datebar .date-main { flex: 1; min-width: 0; position: relative; }
.datebar .date-main label { display: block; font-family: var(--display); font-size: 1.25rem; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.datebar .date-main span { display: block; font-size: .82rem; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.datebar input[type="date"] { position: absolute; inset: 0; opacity: 0; width: 100%; cursor: pointer; }
.icon-btn { width: 44px; height: 44px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--line); background: var(--surface); cursor: pointer; flex: none; color: var(--ink); text-decoration: none; }

.svc { display: block; text-decoration: none; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 14px 12px; box-shadow: var(--shadow); position: relative; }
.svc + .svc { margin-top: 10px; }
.svc .row1 { display: flex; align-items: center; gap: 10px; justify-content: space-between; }
.svc h3 { font-size: 1rem; min-width: 0; }
.svc .meta { font-size: .85rem; color: var(--ink-2); margin-top: 2px; }
.svc .row2 { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.svc .bar { height: 6px; border-radius: 6px; background: var(--surface-2); margin-top: 12px; overflow: hidden; display: flex; }
.svc .bar i { display: block; height: 100%; }
.dir-tag { display: inline-flex; align-items: center; gap: 4px; font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-2); }
.school-group { margin-top: 20px; }
.school-group:first-of-type { margin-top: 0; }
.school-group > header { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.school-group > header i { width: 10px; height: 28px; border-radius: 4px; flex: none; }
.school-group > header div { min-width: 0; }
.school-group > header b { display: block; font-family: var(--display); }
.school-group > header span { display: block; font-size: .82rem; color: var(--ink-2); }
.seg { display: grid; grid-template-columns: 1fr 1fr; background: var(--surface-2); border-radius: 12px; padding: 4px; gap: 4px; margin-bottom: 14px; }
.seg.three { grid-template-columns: repeat(3, 1fr); }
.seg a, .seg button { display: flex; align-items: center; justify-content: center; min-height: 44px; border-radius: 9px; text-decoration: none; font-weight: 700; font-size: .92rem; color: var(--ink-2); border: 0; background: transparent; cursor: pointer; padding: 4px 6px; text-align: center; }
.seg [aria-current="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }

/* Recorrido */
.route-head { background: var(--navy); color: #fff; margin: -16px -16px 16px; padding: 4px 16px 18px; box-shadow: 0 0 0 100vmax var(--navy); clip-path: inset(0 -100vmax); }
.route-head .grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 16px; margin-top: 12px; }
.route-head .grid div { min-width: 0; }
.route-head .grid span { display: block; font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; opacity: .7; font-weight: 700; }
.route-head .grid b { display: block; font-size: .95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.route-head .dir { display: inline-flex; align-items: center; gap: 8px; background: var(--brand); color: var(--brand-ink); font-weight: 700; padding: 6px 12px; border-radius: 999px; font-size: .9rem; }
.route-head .dir.closed { background: rgba(255,255,255,.16); color: #fff; }
.route-head .stats { margin-top: 16px; }
.route-head .stat { background: rgba(255,255,255,.1); }
.route-head .stat span { color: rgba(255,255,255,.75); }
.route-head .stat.onboard { background: var(--brand); color: var(--brand-ink); }
.route-head .stat.onboard span { color: var(--brand-ink); }

.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline li { position: relative; padding-left: 34px; }
.timeline li::before { content: ''; position: absolute; left: 12px; top: 0; bottom: 0; width: 2px; background: var(--line); }
.timeline li:first-child::before { top: 26px; }
.timeline li:last-child::before { bottom: calc(100% - 26px); }
.timeline .node { position: absolute; left: 4px; top: 18px; width: 18px; height: 18px; border-radius: 50%; background: var(--surface); border: 3px solid var(--line); z-index: 1; }
.timeline li.done .node { background: var(--ok); border-color: var(--ok); }
.timeline li.next .node { background: var(--brand); border-color: var(--brand); box-shadow: 0 0 0 5px color-mix(in srgb, var(--brand) 30%, transparent); }
.timeline li.school .node { border-radius: 5px; background: var(--navy); border-color: var(--navy); }
@media (prefers-color-scheme: dark) { .timeline li.school .node { background: #fff; border-color: #fff; } }
.stoprow { display: flex; align-items: center; gap: 12px; padding: 12px 12px; margin-bottom: 8px; text-decoration: none; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; min-height: 64px; }
.timeline li.next .stoprow { border-color: var(--brand); border-width: 2px; }
.stoprow .time { font-variant-numeric: tabular-nums; font-weight: 700; font-size: .95rem; width: 44px; flex: none; }
.stoprow .info { flex: 1; min-width: 0; }
.stoprow .info b { display: block; font-size: .98rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stoprow .info span strong { color: var(--ink); }
.stoprow .info span { display: block; font-size: .8rem; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stoprow .count { flex: none; text-align: right; font-variant-numeric: tabular-nums; }
.stoprow .count b { font-variant-numeric: tabular-nums; }
.stoprow .chev { flex: none; color: var(--ink-3); }

/* Parada */
.stop-head { display: flex; gap: 12px; align-items: center; margin-bottom: 14px; }
.stop-head .num { width: 48px; height: 48px; border-radius: 14px; background: var(--brand); color: var(--brand-ink); font-family: var(--display); font-weight: 800; font-size: 1.3rem; display: flex; align-items: center; justify-content: center; flex: none; }
.stop-head .num.school { background: var(--navy); color: #fff; }
.stop-head div { min-width: 0; }
.stop-head h1 { font-size: 1.2rem; }
.student { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow); }
.student + .student { margin-top: 10px; }
.student.is-up { border-color: color-mix(in srgb, var(--ok) 55%, var(--line)); }
.student.is-no { border-color: color-mix(in srgb, var(--no) 45%, var(--line)); }
.student.is-down { opacity: .92; }
.student .who { display: flex; gap: 12px; align-items: center; }
.student .who .av { border-radius: 14px; flex: none; }
.student .who div { min-width: 0; flex: 1; }
.student .who b { display: block; font-size: 1.05rem; line-height: 1.25; }
.student .who span { display: block; font-size: .83rem; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.student .acts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.student .acts.one { grid-template-columns: 1fr; }
.student .acts .btn { min-height: 54px; font-size: 1.05rem; }
.student .status { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.student .notice { margin-top: 10px; background: var(--surface-2); border-radius: 12px; padding: 10px 12px; }
.student .notice p { margin: 0 0 8px; font-size: .9rem; white-space: pre-line; }
.student .notice .row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.student .notice .row .btn { flex: 1; min-width: 150px; }
.student .extra { display: flex; justify-content: flex-end; gap: 4px; margin-top: 4px; }

/* Listas */
.list { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.list > * { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-top: 1px solid var(--line); text-decoration: none; min-height: 56px; }
.list > *:first-child { border-top: 0; }
.list .grow { flex: 1; min-width: 0; }
.list .grow b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list .grow span { display: block; font-size: .83rem; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list .grow span.wrap { white-space: normal; }
.list .av { border-radius: 12px; flex: none; }
a.list-link:active, .list > a:active { background: var(--surface-2); }

.days { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.days .dh { font-size: .72rem; text-align: center; color: var(--ink-3); font-weight: 700; text-transform: uppercase; }
.day { border-radius: 10px; background: var(--surface-2); padding: 6px 4px; text-align: center; min-height: 56px; font-size: .78rem; }
.day b { display: block; font-size: .9rem; }
.day .pair { display: flex; justify-content: center; gap: 3px; margin-top: 4px; }
.day .pair i { width: 12px; height: 12px; border-radius: 4px; background: var(--line); }
.day .pair i.ok { background: var(--ok); }
.day .pair i.no { background: var(--no); }
.day .pair i.rt { background: var(--info); }
.day.off { background: transparent; border: 1px dashed var(--line); color: var(--ink-3); }
.day.today { outline: 2px solid var(--brand); }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: .8rem; color: var(--ink-2); margin-top: 10px; }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 4px; vertical-align: -1px; margin-right: 5px; }

.inc { border-left: 4px solid var(--warn); padding: 10px 12px; background: var(--surface); border-radius: 0 12px 12px 0; }
.inc + .inc { margin-top: 8px; }
.inc.cierre_bloqueado { border-color: var(--no); }
.inc.correccion { border-color: var(--info); }
.inc.nota { border-color: var(--ink-3); }
.inc.reapertura { border-color: var(--ink); }
.inc .h { display: flex; justify-content: space-between; gap: 8px; font-size: .78rem; font-weight: 700; color: var(--ink-2); text-transform: uppercase; letter-spacing: .03em; }
.inc p { margin: 4px 0 0; font-size: .92rem; }

/* Formularios */
.field { display: block; margin-bottom: 14px; }
.field > span { display: block; font-weight: 700; font-size: .9rem; margin-bottom: 6px; }
.field small { display: block; color: var(--ink-2); font-size: .8rem; margin-top: 4px; }
.input, select.input, textarea.input {
  width: 100%; min-height: 48px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); font-size: 16px;
}
textarea.input { min-height: 88px; resize: vertical; }
.input:focus { outline: 3px solid color-mix(in srgb, var(--info) 45%, transparent); border-color: var(--info); }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.search { position: relative; margin-bottom: 12px; }
.search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--ink-3); pointer-events: none; }
.search .input { padding-left: 40px; }
.err { color: var(--no); font-size: .88rem; font-weight: 700; margin: 6px 0 12px; }

.admin-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.admin-tile { display: flex; flex-direction: column; gap: 8px; padding: 14px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); text-decoration: none; min-height: 96px; box-shadow: var(--shadow); }
.admin-tile svg { color: var(--ink-2); }
.admin-tile b { font-size: 1rem; }
.admin-tile span { font-size: .82rem; color: var(--ink-2); }
.stop-edit { display: grid; grid-template-columns: 32px 1fr; gap: 10px; align-items: start; padding: 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.stop-edit + .stop-edit { margin-top: 8px; }
.stop-edit .n { width: 32px; height: 32px; border-radius: 10px; background: var(--brand); color: var(--brand-ink); display: flex; align-items: center; justify-content: center; font-weight: 800; }
.stop-edit .ctrls { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }

/* Vacío */
.empty { text-align: center; padding: 40px 16px; }
.empty .ill { width: 140px; height: 110px; margin: 0 auto 16px; display: block; }
.empty h2 { font-size: 1.3rem; margin-bottom: 8px; }
.empty p { color: var(--ink-2); max-width: 36ch; margin: 0 auto 20px; }
.empty .btns { display: flex; flex-direction: column; gap: 10px; max-width: 320px; margin: 0 auto; }

/* Cierre */
.close-hero { text-align: center; padding: 22px 16px; }
.close-hero .big { font-family: var(--display); font-size: 3.2rem; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.close-hero.ok .big { color: var(--ok); }
.close-hero.no .big { color: var(--no); }
.check { display: flex; gap: 10px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
.check:first-child { border-top: 0; }
.check .ico { width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex: none; }
.check .ico.ok { background: var(--ok-bg); color: var(--ok); }
.check .ico.no { background: var(--no-bg); color: var(--no); }
.check .ico.warn { background: var(--warn-bg); color: var(--warn); }
.check div { flex: 1; min-width: 0; }

/* Toast y diálogo */
.toast { position: fixed; left: 50%; bottom: calc(var(--tabbar-h) + 100px + var(--safe-b)); transform: translateX(-50%) translateY(20px); background: var(--ink); color: var(--bg); padding: 12px 16px; border-radius: 12px; font-weight: 700; font-size: .92rem; opacity: 0; pointer-events: none; transition: all .2s ease; z-index: 60; max-width: calc(100% - 32px); text-align: center; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
dialog { border: 0; border-radius: 20px; padding: 0; width: min(92vw, 440px); max-height: 85dvh; overflow: auto; background: var(--surface); color: var(--ink); box-shadow: 0 20px 60px rgba(0,0,0,.3); }
dialog::backdrop { background: rgba(10, 16, 24, .55); }
dialog .dlg { padding: 20px; }
dialog .dlg h2 { margin-bottom: 8px; }
dialog .dlg p { color: var(--ink-2); margin: 0 0 16px; }
dialog .dlg .btns { display: flex; gap: 10px; flex-wrap: wrap; }
dialog .dlg .btns > * { flex: 1; min-width: 120px; }

.login { max-width: 380px; margin: 24px auto; }
.login .lock { width: 64px; height: 64px; border-radius: 18px; background: var(--brand); color: var(--brand-ink); display: flex; align-items: center; justify-content: center; margin: 0 auto 16px; }

@media (min-width: 560px) {
  main { padding-left: 24px; padding-right: 24px; }
  .route-head { margin-left: -24px; margin-right: -24px; padding-left: 24px; padding-right: 24px; }
  .route-head .grid { grid-template-columns: repeat(4, 1fr); }
  .admin-grid { grid-template-columns: repeat(3, 1fr); }
  .days { gap: 8px; }
}
@media (max-width: 359px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .student .acts .btn { font-size: .95rem; padding: 8px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
