/* ==========================================================
   Intendencia P11 — sistema visual
   Paleta tomada del Manual Corporativo UdeG 2022 (colores oficiales):
     Pantone 533 C  #202945  azul marino (primario)
     Pantone 7621 C #B12028  rojo (acento, alertas)
     Pantone 7495 C #8F993E  verde olivo (completado)
     Pantone 1345 C #FDCF85  dorado claro (realce)
   Tipografía: Montserrat (sustituto web de Gotham, la complementaria
   oficial) y Cinzel (sustituto web de Trajan, usada en titulares).
   ========================================================== */

:root {
  --navy: #202945;
  --navy-700: #182039;
  --navy-900: #10162a;
  --red: #B12028;
  --olive: #8F993E;
  --gold: #FDCF85;
  --gold-deep: #A48200;

  --bg: #F3F4F7;
  --surface: #FFFFFF;
  --surface-2: #F7F8FA;
  --text: #1A1F33;
  --muted: #5B6275;
  --border: #DDE1EA;
  --primary: var(--navy);
  --on-primary: #FFFFFF;
  --accent: var(--red);
  --success: #6E7730;
  --success-bg: #EEF0DD;
  --warn: #7A5C00;
  --warn-bg: #FFF1D6;
  --danger: #A01C24;
  --danger-bg: #FBE5E6;
  --info-bg: #E6E9F2;
  --ring: rgba(32, 41, 69, .28);
  --shadow: 0 1px 2px rgba(16, 22, 42, .06), 0 4px 16px rgba(16, 22, 42, .06);

  --radius: 14px;
  --radius-sm: 10px;
  --font: "Montserrat", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  --font-display: "Cinzel", "Times New Roman", Georgia, serif;
  --tabbar-h: 64px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0E1324;
    --surface: #171E35;
    --surface-2: #1D2541;
    --text: #EDEFF6;
    --muted: #A2A9BF;
    --border: #2B3554;
    --primary: var(--gold);
    --on-primary: var(--navy);
    --accent: #E4555D;
    --success: #BCC66A;
    --success-bg: #2A3020;
    --warn: #FFD796;
    --warn-bg: #3A3020;
    --danger: #FF8A90;
    --danger-bg: #3A1E25;
    --info-bg: #222B48;
    --ring: rgba(253, 207, 133, .35);
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 20px rgba(0, 0, 0, .25);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0E1324; --surface: #171E35; --surface-2: #1D2541; --text: #EDEFF6; --muted: #A2A9BF;
  --border: #2B3554; --primary: var(--gold); --on-primary: var(--navy); --accent: #E4555D;
  --success: #BCC66A; --success-bg: #2A3020; --warn: #FFD796; --warn-bg: #3A3020;
  --danger: #FF8A90; --danger-bg: #3A1E25; --info-bg: #222B48; --ring: rgba(253, 207, 133, .35);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: var(--font); font-size: 15px; line-height: 1.45;
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
}
h1, h2, h3, h4 { margin: 0; line-height: 1.2; }
p { margin: 0; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
svg.i { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; flex: none; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- App bar ---------- */
.appbar {
  position: sticky; top: 0; z-index: 30;
  background: var(--navy); color: #fff;
  padding: calc(env(safe-area-inset-top) + 10px) 16px 10px;
  display: flex; align-items: center; gap: 12px;
  border-bottom: 3px solid var(--gold);
}
.appbar .back { background: none; border: 0; color: #fff; padding: 6px; margin-left: -6px; border-radius: 10px; display: flex; cursor: pointer; }
.brand { display: flex; flex-direction: column; min-width: 0; flex: 1; text-decoration: none; }
.brand-name { font-family: var(--font-display); font-weight: 700; letter-spacing: .08em; font-size: 15px; white-space: nowrap; }
.brand-sub { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--gold); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.appbar .me { display: flex; align-items: center; gap: 8px; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.14); color: #fff; border-radius: 999px; padding: 4px 10px 4px 4px; cursor: pointer; text-decoration: none; font-size: 13px; font-weight: 600; }
.appbar .me .avatar { width: 28px; height: 28px; font-size: 11px; }

/* ---------- Tab bar ---------- */
.tabbar {
  position: fixed; inset: auto 0 0 0; z-index: 30;
  background: var(--surface); border-top: 1px solid var(--border);
  display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
  padding-bottom: env(safe-area-inset-bottom);
}
.tab {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  height: var(--tabbar-h); text-decoration: none; color: var(--muted); font-size: 11px; font-weight: 600;
  position: relative;
}
.tab[aria-current="page"] { color: var(--primary); }
.tab[aria-current="page"]::before { content: ""; position: absolute; top: 0; left: 28%; right: 28%; height: 3px; border-radius: 0 0 3px 3px; background: var(--red); }
.tab .badge { position: absolute; top: 8px; left: calc(50% + 6px); }
.tab.scan .bubble { width: 48px; height: 48px; border-radius: 16px; background: var(--navy); color: var(--gold); display: grid; place-items: center; margin-top: -18px; box-shadow: 0 6px 16px rgba(32,41,69,.35); border: 3px solid var(--surface); }
.tab.scan .bubble svg { width: 24px; height: 24px; }

.view { padding: 16px 16px calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 24px); max-width: 760px; margin: 0 auto; outline: none; }
.view.wide { max-width: 1180px; }
.view.bare { padding: 0; max-width: none; }

@media (min-width: 960px) {
  .tabbar {
    inset: 0 auto 0 0; width: 232px; grid-auto-flow: row; grid-auto-rows: min-content;
    border-top: 0; border-right: 1px solid var(--border); padding: 86px 12px 12px; gap: 2px;
  }
  .tab { flex-direction: row; justify-content: flex-start; height: 44px; padding: 0 14px; gap: 12px; font-size: 14px; border-radius: 10px; }
  .tab[aria-current="page"] { background: var(--info-bg); }
  .tab[aria-current="page"]::before { top: 10px; bottom: 10px; left: 0; right: auto; width: 3px; height: auto; border-radius: 0 3px 3px 0; }
  .tab .badge { position: static; margin-left: auto; }
  .tab.scan .bubble { width: auto; height: auto; margin: 0; background: none; color: inherit; box-shadow: none; border: 0; border-radius: 0; }
  .tab.scan .bubble svg { width: 20px; height: 20px; }
  .appbar { padding-left: 24px; z-index: 40; }
  body.has-tabs .view { margin-left: max(248px, calc((100vw - 760px) / 2 + 116px)); margin-right: auto; padding-top: 24px; }
  body.has-tabs .view.wide { margin-left: 248px; padding-right: 32px; }
}

/* Pestañas que solo van en la barra lateral (computadora) */
.tab.desk, .tab .lbl-d, .tab-sep { display: none; }
.tab.sub-cur { color: var(--primary); }
.tab.sub-cur::before { content: ""; position: absolute; top: 0; left: 28%; right: 28%; height: 3px; border-radius: 0 0 3px 3px; background: var(--red); }
@media (min-width: 960px) {
  .tab.desk { display: flex; }
  .tab .lbl-m { display: none; }
  .tab .lbl-d { display: inline; }
  .tab.sub-cur:not([aria-current]) { color: var(--muted); }
  .tab.sub-cur:not([aria-current])::before { display: none; }
  .tab-sep { display: block; font-size: 10px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); padding: 16px 14px 6px; }
}

/* ---------- Typography helpers ---------- */
.eyebrow { font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.title { font-size: 22px; font-weight: 700; letter-spacing: -.01em; }
.display { font-family: var(--font-display); font-weight: 700; letter-spacing: .04em; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.xs { font-size: 12px; }
.strong { font-weight: 700; }
.mono { font-variant-numeric: tabular-nums; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin: 4px 0 16px; flex-wrap: wrap; }
.page-head .title { margin-top: 2px; }
.section-title { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 24px 0 10px; }
.section-title h3 { font-size: 13px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.rule { height: 3px; width: 44px; border-radius: 3px; background: linear-gradient(90deg, var(--gold) 0 50%, var(--red) 50% 100%); margin: 8px 0 0; }

/* ---------- Cards & lists ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.card.pad { padding: 16px; }
.card + .card { margin-top: 12px; }
.stack { display: grid; gap: 12px; }
.row { display: flex; align-items: center; gap: 12px; }
.row.top { align-items: flex-start; }
.spacer { flex: 1; }
.grow { flex: 1; min-width: 0; }
.wrap { flex-wrap: wrap; }
.ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.list { list-style: none; margin: 0; padding: 0; }
.list > li { border-top: 1px solid var(--border); }
.list > li:first-child { border-top: 0; }
.item { display: flex; align-items: center; gap: 12px; padding: 14px 16px; text-decoration: none; color: inherit; width: 100%; background: none; border: 0; text-align: left; cursor: pointer; }
.item:active { background: var(--surface-2); }
.item .chev { color: var(--muted); }
.item-title { font-weight: 600; }
.item-sub { font-size: 13px; color: var(--muted); }

.hero {
  background: var(--navy); color: #fff; border-radius: 18px; padding: 18px;
  position: relative; overflow: hidden; border: 0;
}
.hero::after {
  content: "11"; position: absolute; right: -10px; bottom: -46px; font-family: var(--font-display);
  font-size: 150px; font-weight: 700; color: rgba(253, 207, 133, .08); line-height: 1; pointer-events: none;
}
.hero .eyebrow { color: var(--gold); }
.hero .muted { color: rgba(255,255,255,.72); }
.hero-title { font-size: 24px; font-weight: 700; margin: 4px 0 2px; }
.hero .chips { margin-top: 12px; }

.time-col { width: 62px; flex: none; font-variant-numeric: tabular-nums; font-weight: 700; font-size: 14px; line-height: 1.15; }
.time-col span { display: block; color: var(--muted); font-weight: 500; font-size: 12px; }
.plan-item { border-left: 4px solid var(--border); }
.plan-item.s-terminada { border-left-color: var(--olive); }
.plan-item.s-encurso { border-left-color: var(--gold-deep); }
.plan-item.s-atrasada, .plan-item.s-noatendida, .plan-item.s-ausente { border-left-color: var(--red); }
.tarea-item { border-left: 4px solid var(--border); }
.tarea-item.t-vencida { border-left-color: var(--red); }
.tarea-item.t-hoy { border-left-color: var(--gold-deep); }
.tarea-item.t-hecha { border-left-color: var(--olive); }
button.chip { border: 0; cursor: pointer; font-family: inherit; }
button.chip.ghost { border: 1px solid var(--border); }
button.chip:hover { border-color: var(--primary); color: var(--text); }
.plan-item.s-cancelada, .plan-item.s-reasignada { opacity: .6; }
.plan-item.s-cancelada .item-title, .plan-item.s-reasignada .item-title { text-decoration: line-through; }

/* ---------- Chips, badges, avatar ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 9px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--info-bg); color: var(--text); white-space: nowrap; }
.chip svg.i { width: 14px; height: 14px; }
.chip.ok { background: var(--success-bg); color: var(--success); }
.chip.warn { background: var(--warn-bg); color: var(--warn); }
.chip.bad { background: var(--danger-bg); color: var(--danger); }
.chip.gold { background: var(--gold); color: var(--navy); }
.chip.ghost { background: transparent; border: 1px solid var(--border); color: var(--muted); }
.hero .chip { background: rgba(255,255,255,.12); color: #fff; }
.hero .chip.gold { background: var(--gold); color: var(--navy); }
.badge { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--red); color: #fff; font-size: 11px; font-weight: 700; display: inline-grid; place-items: center; }
.avatar { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 14px; flex: none; color: var(--navy); background: var(--gold); }
.avatar.c1 { background: #DCE0EC; } .avatar.c2 { background: #E9EDCF; } .avatar.c3 { background: #F6D9DA; } .avatar.c4 { background: #FDE6BF; } .avatar.c5 { background: #D8E7EA; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; background: var(--muted); }
.dot.live { background: var(--olive); box-shadow: 0 0 0 4px rgba(143,153,62,.2); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; padding: 0 16px; border-radius: 12px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); font-weight: 600; font-size: 14px;
  cursor: pointer; text-decoration: none; white-space: nowrap; transition: transform .06s, filter .15s;
}
.btn:active { transform: scale(.98); }
.btn:focus-visible, .item:focus-visible, .tab:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid var(--ring); outline-offset: 2px; }
.btn.primary { background: var(--primary); color: var(--on-primary); border-color: transparent; }
.btn.navy { background: var(--navy); color: #fff; border-color: transparent; }
.btn.gold { background: var(--gold); color: var(--navy); border-color: transparent; }
.btn.danger { background: var(--red); color: #fff; border-color: transparent; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--primary); }
.btn.sm { height: 34px; padding: 0 12px; font-size: 13px; border-radius: 10px; }
.btn.lg { height: 56px; font-size: 16px; border-radius: 14px; }
.btn.block { width: 100%; }
.btn.icon { width: 40px; padding: 0; }
.btn[disabled] { opacity: .5; pointer-events: none; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- Forms ---------- */
.field { display: grid; gap: 6px; }
.field > span, .label { font-size: 13px; font-weight: 600; color: var(--muted); }
.input, select.input, textarea.input {
  width: 100%; height: 46px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--border);
  background: var(--surface); font-size: 16px;
}
textarea.input { height: auto; min-height: 84px; padding: 12px 14px; resize: vertical; }
.form { display: grid; gap: 14px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.days { display: flex; gap: 6px; flex-wrap: wrap; }
.days label { position: relative; }
.days input { position: absolute; opacity: 0; inset: 0; }
.days span { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--border); font-weight: 700; font-size: 13px; cursor: pointer; background: var(--surface); }
.days input:checked + span { background: var(--navy); color: #fff; border-color: var(--navy); }
.days input:focus-visible + span { outline: 3px solid var(--ring); }
.check { display: flex; align-items: center; gap: 12px; padding: 12px 16px; cursor: pointer; }
.check input { width: 22px; height: 22px; accent-color: var(--olive); flex: none; }
.check input:checked + span { color: var(--muted); text-decoration: line-through; }
.switch { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; cursor: pointer; }
.switch input { appearance: none; width: 46px; height: 28px; border-radius: 14px; background: var(--border); position: relative; flex: none; cursor: pointer; transition: background .15s; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.switch input:checked { background: var(--olive); }
.switch input:checked::after { transform: translateX(18px); }

.seg { display: inline-flex; background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: none; height: 34px; padding: 0 12px; border-radius: 9px; font-weight: 600; font-size: 13px; color: var(--muted); cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }

.datebar { display: flex; align-items: center; gap: 8px; }
.datebar .input { width: auto; flex: 1; min-width: 0; }

/* ---------- KPIs & progress ---------- */
.kpis { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
@media (min-width: 720px) { .kpis { grid-template-columns: repeat(4, 1fr); } }
.kpi { padding: 14px; }
.kpi .v { font-size: 28px; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.1; margin-top: 4px; }
.kpi .v small { font-size: 15px; color: var(--muted); font-weight: 600; }
.kpi.alert .v { color: var(--danger); }
.progress { height: 8px; background: var(--surface-2); border-radius: 4px; overflow: hidden; border: 1px solid var(--border); }
.progress > i { display: block; height: 100%; background: var(--olive); border-radius: 4px; }
.hero .progress { background: rgba(255,255,255,.12); border-color: transparent; }
.hero .progress > i { background: var(--gold); }

.cols { display: grid; gap: 16px; }
@media (min-width: 1000px) { .cols.two { grid-template-columns: 1.25fr 1fr; align-items: start; } }

/* ---------- Week grid ---------- */
.week { overflow-x: auto; }
.week table { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 560px; }
.week th, .week td { padding: 10px 8px; border-top: 1px solid var(--border); text-align: center; }
.week th { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); border-top: 0; }
.week td:first-child, .week th:first-child { text-align: left; padding-left: 16px; }
.week td button { border: 0; background: var(--info-bg); border-radius: 8px; padding: 4px 8px; font-weight: 700; cursor: pointer; font-variant-numeric: tabular-nums; min-width: 40px; }
.week td button.zero { background: transparent; color: var(--muted); font-weight: 500; }
.week td.today, .week th.today { background: rgba(253, 207, 133, .14); }
.week td button.aus { background: var(--danger-bg); color: var(--danger); font-size: 11px; }

/* ---------- Horarios ---------- */
.hgrid table { min-width: 900px; table-layout: fixed; }
.hgrid th:first-child { width: 190px; }
.hgrid td { padding: 6px 4px; vertical-align: middle; }
.hgrid td:first-child { padding-left: 12px; }
.hgrid tr.grp td { background: var(--surface-2); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; font-weight: 700; color: var(--muted); padding: 7px 16px; text-align: left; }
.hgrid tr.cov td { background: var(--surface-2); padding: 8px 4px; }
.hcell { width: 100%; min-height: 50px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); padding: 6px 4px; display: grid; gap: 1px; align-content: center; cursor: pointer; font-size: 12px; text-align: center; color: var(--text); }
.hcell b { font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; letter-spacing: -.01em; }
.hcell small { white-space: nowrap; }
.hcell small { font-size: 11px; color: var(--muted); }
.hcell.on { background: var(--info-bg); border-color: transparent; }
.hcell.extra { background: var(--warn-bg); color: var(--warn); border-color: transparent; }
.hcell.aus { background: var(--danger-bg); color: var(--danger); border-color: transparent; }
.hcell.aus small, .hcell.extra small { color: inherit; opacity: .85; }
.hcell.off { color: var(--muted); background: transparent; border-style: dashed; }
.hcell:hover { outline: 2px solid var(--ring); }
.person-cell { display: flex; align-items: center; gap: 10px; background: none; border: 0; cursor: pointer; text-align: left; padding: 0; color: inherit; }
.person-cell .avatar { width: 34px; height: 34px; font-size: 12px; }

/* ---------- Tablas de reporte ---------- */
.tbl-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 720px; }
.tbl th { text-align: left; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); padding: 12px 12px 8px; white-space: nowrap; }
.tbl td { padding: 10px 12px; border-top: 1px solid var(--border); vertical-align: middle; font-variant-numeric: tabular-nums; }
.tbl .num { text-align: right; }
.tbl .avatar { width: 30px; height: 30px; font-size: 11px; }
.meter { display: flex; align-items: center; gap: 8px; min-width: 150px; }
.meter .progress { flex: 1; }
.progress > i.mid { background: var(--gold-deep); }
.progress > i.low { background: var(--red); }

/* ---------- Scanner ---------- */
.scanner { position: relative; background: #000; border-radius: 18px; overflow: hidden; aspect-ratio: 3 / 4; max-height: 62vh; width: 100%; }
.scanner video { width: 100%; height: 100%; object-fit: cover; display: block; }
.scan-frame { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; }
.scan-frame::before { content: ""; width: 62%; aspect-ratio: 1; border-radius: 18px; box-shadow: 0 0 0 9999px rgba(16,22,42,.5); border: 3px solid var(--gold); }
.scan-line { position: absolute; left: 22%; right: 22%; height: 2px; background: var(--red); top: 30%; animation: scan 2.2s ease-in-out infinite alternate; box-shadow: 0 0 12px var(--red); }
@keyframes scan { to { top: 68%; } }
.scan-msg { position: absolute; inset: 0; display: grid; place-items: center; color: #fff; text-align: center; padding: 24px; background: var(--navy-900); }

/* ---------- Photos ---------- */
.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; }
.thumb { position: relative; aspect-ratio: 1; border-radius: 10px; overflow: hidden; background: var(--surface-2); border: 1px solid var(--border); cursor: zoom-in; padding: 0; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb .del { position: absolute; top: 4px; right: 4px; width: 26px; height: 26px; border-radius: 50%; border: 0; background: rgba(16,22,42,.7); color: #fff; display: grid; place-items: center; cursor: pointer; }
.thumb .del svg { width: 14px; height: 14px; }
.add-photo { aspect-ratio: 1; border-radius: 10px; border: 2px dashed var(--border); display: grid; place-items: center; align-content: center; gap: 4px; color: var(--muted); font-size: 12px; font-weight: 600; cursor: pointer; background: transparent; }
.add-photo input { display: none; }
.lightbox img { max-width: 100%; max-height: 75vh; display: block; margin: 0 auto; border-radius: 10px; }

/* ---------- Empty, banner, timer ---------- */
.empty { text-align: center; padding: 32px 16px; color: var(--muted); }
.empty svg.i { width: 36px; height: 36px; margin-bottom: 8px; color: var(--border); }
.banner { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; background: var(--warn-bg); color: var(--warn); font-size: 14px; }
.banner.info { background: var(--info-bg); color: var(--text); }
.banner.bad { background: var(--danger-bg); color: var(--danger); }
.banner.ok { background: var(--success-bg); color: var(--success); }
.timer { font-size: 34px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.live-card { border: 2px solid var(--gold); background: linear-gradient(180deg, rgba(253,207,133,.16), var(--surface) 60%); }

/* ---------- Login ---------- */
.login { min-height: 100dvh; display: grid; grid-template-rows: auto 1fr; background: var(--bg); }
.login-top {
  background: var(--navy); color: #fff; padding: calc(env(safe-area-inset-top) + 48px) 24px 72px; position: relative; overflow: hidden;
  border-bottom: 4px solid var(--gold);
}
.login-top::after { content: "11"; position: absolute; right: -24px; bottom: -70px; font-family: var(--font-display); font-weight: 700; font-size: 240px; color: rgba(253,207,133,.07); line-height: 1; }
.login-top .brand-name { font-size: 26px; white-space: normal; }
.login-top .brand-sub { font-size: 12px; margin-top: 6px; white-space: normal; }
.login-top p { color: rgba(255,255,255,.75); margin-top: 14px; max-width: 34ch; font-size: 14px; }
.login-body { padding: 0 16px 32px; margin-top: -44px; position: relative; z-index: 1; max-width: 460px; width: 100%; justify-self: center; }
.pin { letter-spacing: .5em; font-size: 22px; font-weight: 700; text-align: center; }
.demo-users { display: grid; gap: 8px; margin-top: 10px; }
.footnote { text-align: center; font-size: 12px; color: var(--muted); margin-top: 20px; }

/* ---------- Dialog ---------- */
dialog.modal {
  border: 0; padding: 0; border-radius: 20px; width: min(560px, calc(100vw - 24px)); max-height: calc(100dvh - 32px);
  background: var(--surface); color: var(--text); box-shadow: 0 20px 60px rgba(0,0,0,.35);
}
dialog.modal::backdrop { background: rgba(16, 22, 42, .55); }
.modal-head { display: flex; align-items: center; gap: 8px; padding: 16px 16px 12px 20px; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--surface); z-index: 1; }
.modal-head h2 { font-size: 17px; flex: 1; }
.modal-body { padding: 16px 20px; }
.modal-foot { display: flex; gap: 8px; justify-content: flex-end; padding: 12px 20px 18px; border-top: 1px solid var(--border); position: sticky; bottom: 0; background: var(--surface); }
@media (max-width: 600px) {
  dialog.modal { width: 100vw; max-width: 100vw; margin: auto 0 0; border-radius: 20px 20px 0 0; max-height: 92dvh; }
  .modal-foot { padding-bottom: calc(18px + env(safe-area-inset-bottom)); }
  .modal-foot .btn { flex: 1; }
}

/* ---------- Toasts ---------- */
.toasts { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 14px); z-index: 100; display: grid; gap: 8px; width: min(420px, calc(100vw - 32px)); pointer-events: none; }
.toast { background: var(--navy); color: #fff; padding: 12px 16px; border-radius: 12px; font-weight: 600; font-size: 14px; box-shadow: 0 8px 24px rgba(0,0,0,.25); display: flex; gap: 10px; align-items: center; animation: toast-in .2s ease-out; border-left: 4px solid var(--gold); }
.toast.ok { border-left-color: var(--olive); }
.toast.bad { border-left-color: var(--red); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

/* ---------- QR sheet ---------- */
.qr-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
.qr-card { background: #fff; color: #202945; border: 1px solid #DDE1EA; border-radius: 16px; overflow: hidden; text-align: center; break-inside: avoid; page-break-inside: avoid; }
.qr-card .qh { background: #202945; color: #fff; padding: 10px 12px; border-bottom: 3px solid #FDCF85; }
.qr-card .qh b { font-family: var(--font-display); letter-spacing: .1em; font-size: 13px; display: block; }
.qr-card .qh small { color: #FDCF85; font-size: 9px; letter-spacing: .18em; text-transform: uppercase; font-weight: 700; }
.qr-card svg.qr { width: 72%; height: auto; margin: 14px auto 6px; display: block; }
.qr-card .code { font-size: 26px; font-weight: 700; letter-spacing: .06em; }
.qr-card .name { font-size: 13px; font-weight: 600; padding: 2px 12px 0; }
.qr-card .hint { font-size: 10px; color: #5B6275; padding: 8px 14px 14px; }

@media print {
  @page { margin: 12mm; }
  body { background: #fff; }
  .appbar, .tabbar, .no-print, .toasts { display: none !important; }
  .card { box-shadow: none; }
  .tbl { min-width: 0; font-size: 11px; }
  .view { padding: 0 !important; margin: 0 !important; max-width: none !important; }
  .qr-grid { grid-template-columns: repeat(2, 1fr); gap: 10mm; }
  .qr-card { border: 1.5px solid #202945; }
}

@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
