/*
 * App de staff — hoja de estilos única.
 * Componentes (usar estas clases en las páginas, sin estilos nuevos salvo que haga falta):
 *   Layout:     .stack (columna con separación) .row (fila que envuelve) .grid-2 .grid-3 .spacer .right
 *   Tarjetas:   .card .card-head (h2 + acciones) .card-sub .card-link (tarjeta que es un enlace)
 *   Títulos:    .page-head (h1 + .muted + acciones) .section-title
 *   Texto:      .muted .small .big .mono .strong .ok-text .warn-text .crit-text
 *   Botones:    .btn .btn-primary .btn-danger .btn-ghost .btn-sm .btn-block .btn-big (fichar)
 *   Etiquetas:  .badge .badge-ok .badge-warn .badge-crit .badge-info .badge-muted  (o la función badge())
 *   Mensajes:   .flash .flash-ok .flash-err .flash-info .flash-warn  (los pinta el layout)  .note-box .note-warn
 *   Imprimir:   .print-only (solo sale al imprimir)  .no-print
 *   Formularios: .field (label + control + .hint + .field-error) .field-inline .form-actions
 *               .choice-group > label.choice > input[type=radio]  (botones grandes para elegir)
 *   Sí/No:      .yn (fila de un punto)  > .yn-label  > .yn-opts > label.yn-si / label.yn-no > input[type=radio]
 *               .yn-note (textarea que aparece al marcar No)   .yn-rooms (una fila .yn-room por sala)
 *   Listas:     .list > .list-item (.list-main + .list-side)
 *   Tablas:     .table-wrap > table.table   (td.num para números)
 *   KPIs:       .kpis > .kpi (.kpi-value + .kpi-label)
 *   Estado:     .status-hero (.is-in / .is-out) .dot .dot-ok .dot-warn .dot-crit
 *   Vacío:      .empty
 *   Progreso:   .progress > .progress-bar   (style="--p: 40%")
 *   Pestañas:   .tabs > a (.is-active)
 */

:root {
  --bg: #f4f5f7;
  --surface: #ffffff;
  --surface-2: #f0f2f5;
  --text: #15191e;
  --muted: #5d6673;
  --border: #dde1e7;
  --accent: #5b4cf0;
  --accent-ink: #ffffff;
  --accent-soft: #ecebfe;
  --ok: #16834a;
  --ok-soft: #e3f5ea;
  --warn: #b35c00;
  --warn-soft: #fdf0de;
  --crit: #c62828;
  --crit-soft: #fde7e7;
  --info: #1f6fb2;
  --info-soft: #e3f0fb;
  --shadow: 0 1px 2px rgba(16, 20, 24, .06), 0 4px 16px rgba(16, 20, 24, .05);
  --radius: 14px;
  --radius-sm: 10px;
  --tabbar-h: 64px;
  --topbar-h: 61px; /* avatar 34px + .2rem×2 + padding .6rem×2 + borde; sin la zona segura de arriba */
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1116;
    --surface: #171b22;
    --surface-2: #1f242d;
    --text: #e9edf2;
    --muted: #98a2b0;
    --border: #2b313b;
    --accent: #8b7fff;
    --accent-ink: #0e1116;
    --accent-soft: #262245;
    --ok: #4cc883;
    --ok-soft: #13301f;
    --warn: #f0a24b;
    --warn-soft: #36260f;
    --crit: #ff6b6b;
    --crit-soft: #3a1717;
    --info: #64aef0;
    --info-soft: #132a3e;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 20px rgba(0, 0, 0, .25);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
/* Los saltos a #ancla (p. ej. tras guardar en Ajustes) no dejan el bloque debajo de la barra fija de arriba */
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--topbar-h) + env(safe-area-inset-top) + .5rem); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.25; margin: 0; }
h1 { font-size: 1.5rem; font-weight: 750; letter-spacing: -.01em; }
h2 { font-size: 1.1rem; font-weight: 700; }
h3 { font-size: 1rem; font-weight: 650; }
p { margin: 0; }
hr { border: 0; border-top: 1px solid var(--border); margin: 1rem 0; }
.ico { width: 20px; height: 20px; flex: none; }

/* ---------- Estructura ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  min-height: calc(var(--topbar-h) + env(safe-area-inset-top));
  display: flex; align-items: center; gap: 1rem;
  padding: .6rem 1rem; padding-top: calc(.6rem + env(safe-area-inset-top));
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: .5rem; font-weight: 750; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.brand:hover { text-decoration: none; }
.brand-dot { width: 12px; height: 12px; border-radius: 4px; background: var(--accent); flex: none; }
.topnav { display: none; gap: .25rem; margin-left: 1rem; }
.topnav a { display: flex; align-items: center; gap: .4rem; padding: .45rem .75rem; border-radius: 999px; color: var(--muted); font-weight: 600; font-size: .95rem; }
.topnav a:hover { background: var(--surface-2); text-decoration: none; color: var(--text); }
.topnav a.is-active { background: var(--accent-soft); color: var(--accent); }
.topnav .ico { width: 18px; height: 18px; }

.usermenu { margin-left: auto; position: relative; }
.usermenu summary { list-style: none; display: flex; align-items: center; gap: .5rem; cursor: pointer; padding: .2rem; border-radius: 999px; }
.usermenu summary::-webkit-details-marker { display: none; }
.usermenu-name { display: none; font-weight: 600; font-size: .95rem; }
.avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: var(--accent-ink); font-weight: 750; }
.usermenu-pop { position: absolute; right: 0; top: calc(100% + .4rem); min-width: 230px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: .4rem; display: grid; }
.usermenu-head { display: grid; padding: .5rem .7rem .6rem; border-bottom: 1px solid var(--border); margin-bottom: .3rem; }
.usermenu-pop a, .usermenu-pop button { display: flex; align-items: center; gap: .55rem; padding: .6rem .7rem; border-radius: var(--radius-sm); color: var(--text); background: none; border: 0; font: inherit; text-align: left; cursor: pointer; width: 100%; }
.usermenu-pop a:hover, .usermenu-pop button:hover { background: var(--surface-2); text-decoration: none; }
.usermenu-pop form { margin: 0; }

.main { max-width: 980px; margin: 0 auto; padding: 1rem 1rem calc(var(--tabbar-h) + 1.5rem + env(safe-area-inset-bottom)); display: grid; gap: 1rem; }
.no-user .main { padding-bottom: 2rem; }

.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: flex; justify-content: space-around;
  background: var(--surface); border-top: 1px solid var(--border);
  padding-bottom: env(safe-area-inset-bottom);
  height: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
}
.tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: var(--muted); font-size: .72rem; font-weight: 600; }
.tabbar a:hover { text-decoration: none; }
.tabbar a.is-active { color: var(--accent); }
.tabbar .ico { width: 24px; height: 24px; }
.tabbar a.tab-avisar .ico { color: var(--crit); }

@media (min-width: 820px) {
  .topnav { display: flex; }
  .usermenu-name { display: inline; }
  .tabbar { display: none; }
  .main { padding: 1.5rem 1.5rem 3rem; }
}

/* ---------- Utilidades ---------- */
.stack { display: grid; gap: .75rem; }
.stack-lg { display: grid; gap: 1.25rem; }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.spacer { flex: 1; }
.right { margin-left: auto; }
.grid-2, .grid-3 { display: grid; gap: 1rem; }
@media (min-width: 700px) { .grid-2 { grid-template-columns: 1fr 1fr; } .grid-3 { grid-template-columns: repeat(3, 1fr); } }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.big { font-size: 1.25rem; }
.mono { font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }
.strong { font-weight: 700; }
.ok-text { color: var(--ok); }
.warn-text { color: var(--warn); }
.crit-text { color: var(--crit); }
.hidden { display: none !important; }
.nowrap { white-space: nowrap; }

/* ---------- Tarjetas y cabeceras ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem; box-shadow: var(--shadow); display: grid; gap: .75rem; min-width: 0; }
.card-head { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.card-head > :last-child:not(:first-child) { margin-left: auto; }
.card-sub { color: var(--muted); font-size: .9rem; }
a.card-link { color: inherit; display: grid; transition: border-color .15s, transform .15s; }
a.card-link:hover { text-decoration: none; border-color: var(--accent); }
a.card-link:active { transform: scale(.99); }
.page-head { display: flex; align-items: flex-end; gap: .75rem; flex-wrap: wrap; }
.page-head > div:first-child { display: grid; gap: .2rem; }
.page-head .actions { margin-left: auto; display: flex; gap: .5rem; flex-wrap: wrap; }
.section-title { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; margin-top: .5rem; }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  min-height: 44px; padding: .55rem 1rem; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  font: inherit; font-weight: 650; cursor: pointer; text-decoration: none; line-height: 1.2;
  -webkit-tap-highlight-color: transparent;
}
.btn:hover { text-decoration: none; background: var(--surface-2); }
.btn:active { transform: scale(.98); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; transform: none; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: color-mix(in srgb, var(--accent) 88%, #000); }
.btn-danger { background: var(--crit); border-color: var(--crit); color: #fff; }
.btn-danger:hover { background: color-mix(in srgb, var(--crit) 88%, #000); }
.btn-ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn-ok:hover { background: color-mix(in srgb, var(--ok) 88%, #000); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--accent); }
.btn-ghost:hover { background: var(--accent-soft); }
.btn-sm { min-height: 34px; padding: .3rem .7rem; font-size: .9rem; }
.btn-block { width: 100%; }
.btn-big { min-height: 72px; font-size: 1.25rem; border-radius: var(--radius); width: 100%; }
.btn-big .ico { width: 28px; height: 28px; }

/* ---------- Etiquetas y avisos ---------- */
.badge { display: inline-flex; align-items: center; gap: .3rem; padding: .15rem .55rem; border-radius: 999px; font-size: .78rem; font-weight: 700; white-space: nowrap; background: var(--surface-2); color: var(--muted); }
.badge-ok { background: var(--ok-soft); color: var(--ok); }
.badge-warn { background: var(--warn-soft); color: var(--warn); }
.badge-crit { background: var(--crit-soft); color: var(--crit); }
.badge-info { background: var(--info-soft); color: var(--info); }
.badge-accent { background: var(--accent-soft); color: var(--accent); }

.flash { padding: .75rem 1rem; border-radius: var(--radius-sm); font-weight: 600; border: 1px solid transparent; }
.flash-ok { background: var(--ok-soft); color: var(--ok); border-color: color-mix(in srgb, var(--ok) 25%, transparent); }
.flash-err { background: var(--crit-soft); color: var(--crit); border-color: color-mix(in srgb, var(--crit) 25%, transparent); }
.flash-info { background: var(--info-soft); color: var(--info); border-color: color-mix(in srgb, var(--info) 25%, transparent); }
.flash-warn { background: var(--warn-soft); color: var(--warn); border-color: color-mix(in srgb, var(--warn) 25%, transparent); }
.note-box { padding: .75rem 1rem; border-radius: var(--radius-sm); background: var(--surface-2); color: var(--text); font-size: .95rem; }
.note-warn { background: var(--warn-soft); color: var(--warn); }
.note-crit { background: var(--crit-soft); color: var(--crit); }

.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; background: var(--muted); flex: none; }
.dot-ok { background: var(--ok); box-shadow: 0 0 0 4px var(--ok-soft); }
.dot-warn { background: var(--warn); box-shadow: 0 0 0 4px var(--warn-soft); }
.dot-crit { background: var(--crit); box-shadow: 0 0 0 4px var(--crit-soft); }

/* ---------- Formularios ---------- */
.field { display: grid; gap: .35rem; min-width: 0; }
.field > label, .field > .label { font-weight: 650; font-size: .95rem; }
.field .hint { color: var(--muted); font-size: .85rem; }
.field-error { color: var(--crit); font-size: .88rem; font-weight: 600; }
.field-inline { display: flex; gap: .5rem; align-items: end; flex-wrap: wrap; }
.field-inline > .field { flex: 1 1 160px; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=datetime-local], input[type=month], input[type=time], input[type=search], select, textarea {
  width: 100%; min-height: 44px; padding: .55rem .75rem;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text); font: inherit; font-size: 16px;
}
textarea { min-height: 90px; resize: vertical; }
input:focus, select:focus, textarea:focus, .btn:focus-visible, a:focus-visible, summary:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 45%, transparent); outline-offset: 1px; border-color: var(--accent); }
input[type=checkbox] { width: 20px; height: 20px; accent-color: var(--accent); }
.check { display: flex; align-items: center; gap: .55rem; font-weight: 500; cursor: pointer; }
.form-actions { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.is-invalid { border-color: var(--crit) !important; }

.choice-group { display: grid; gap: .5rem; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
.choice { position: relative; display: flex; align-items: center; gap: .55rem; padding: .8rem .9rem; border: 2px solid var(--border); border-radius: var(--radius-sm); cursor: pointer; font-weight: 650; background: var(--surface); }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.choice:has(input:focus-visible) { outline: 3px solid color-mix(in srgb, var(--accent) 45%, transparent); }
.choice.tone-info:has(input:checked) { border-color: var(--info); background: var(--info-soft); color: var(--info); }
.choice.tone-warn:has(input:checked) { border-color: var(--warn); background: var(--warn-soft); color: var(--warn); }
.choice.tone-crit:has(input:checked) { border-color: var(--crit); background: var(--crit-soft); color: var(--crit); }

/* ---------- Sí / No de checklist ---------- */
.yn { display: grid; gap: .5rem; padding: .85rem 0; border-top: 1px solid var(--border); }
.yn:first-of-type { border-top: 0; }
.yn-label { font-weight: 600; display: flex; gap: .4rem; align-items: baseline; flex-wrap: wrap; }
.yn-label .badge { font-size: .7rem; }
.yn-opts { display: flex; gap: .5rem; }
.yn-opts label { flex: 1; display: flex; align-items: center; justify-content: center; gap: .35rem; min-height: 46px; border: 2px solid var(--border); border-radius: var(--radius-sm); font-weight: 700; cursor: pointer; user-select: none; background: var(--surface); -webkit-tap-highlight-color: transparent; }
.yn-opts input { position: absolute; opacity: 0; pointer-events: none; }
.yn-opts label:has(input:focus-visible) { outline: 3px solid color-mix(in srgb, var(--accent) 45%, transparent); }
.yn-opts label.yn-si:has(input:checked) { border-color: var(--ok); background: var(--ok-soft); color: var(--ok); }
.yn-opts label.yn-no:has(input:checked) { border-color: var(--crit); background: var(--crit-soft); color: var(--crit); }
.yn-note { display: none; }
.yn:has(input[value="no"]:checked) .yn-note, .yn.show-note .yn-note { display: grid; }
.yn-rooms { display: grid; gap: .45rem; }
.yn-room { display: grid; grid-template-columns: 4.5rem 1fr; align-items: center; gap: .5rem; }
.yn-room > span { font-weight: 650; color: var(--muted); font-size: .9rem; }
.yn.has-error .yn-opts label { border-color: color-mix(in srgb, var(--crit) 55%, var(--border)); }
@media (min-width: 700px) {
  .yn { grid-template-columns: 1fr 260px; align-items: center; column-gap: 1rem; }
  .yn .yn-note, .yn .field-error, .yn .hint { grid-column: 1 / -1; }
  .yn.yn-wide { grid-template-columns: 1fr; }
}

/* ---------- Casillas de checklist (sin marcar = error) ---------- */
.ck { display: flex; align-items: flex-start; gap: .75rem; padding: .8rem .2rem; border-top: 1px solid var(--border); cursor: pointer; -webkit-tap-highlight-color: transparent; user-select: none; }
.card-head + .ck, .card-head + .ck-group { border-top: 0; }
.ck input, .ck-chip input { position: absolute; opacity: 0; pointer-events: none; width: 1px; height: 1px; }
.ck-box { flex: none; width: 30px; height: 30px; border-radius: 9px; border: 2px solid var(--border); display: grid; place-items: center; background: var(--surface); color: transparent; transition: background .12s, border-color .12s; }
.ck-box .ico { width: 20px; height: 20px; stroke-width: 3; }
.ck-text { display: grid; gap: .15rem; font-weight: 600; padding-top: .2rem; }
.ck-help { font-weight: 400; }
.ck:has(input:checked) .ck-box { background: var(--ok); border-color: var(--ok); color: #fff; }
.ck:has(input:checked) .ck-text { color: var(--muted); }
.ck:has(input:focus-visible) .ck-box { outline: 3px solid color-mix(in srgb, var(--accent) 45%, transparent); }
.ck.is-missing .ck-box, .ck-group.is-missing .ck-chip:not(:has(input:checked)) { border-color: var(--warn); background: var(--warn-soft); }
.ck-group { display: grid; gap: .55rem; padding: .85rem .2rem; border-top: 1px solid var(--border); }
.ck-chips { display: grid; grid-template-columns: repeat(6, 1fr); gap: .4rem; }
.ck-chip { display: flex; align-items: center; justify-content: center; min-height: 44px; border: 2px solid var(--border); border-radius: var(--radius-sm); font-weight: 700; cursor: pointer; user-select: none; background: var(--surface); -webkit-tap-highlight-color: transparent; position: relative; }
.ck-chip:has(input:checked) { background: var(--ok); border-color: var(--ok); color: #fff; }
.ck-chip:has(input:focus-visible) { outline: 3px solid color-mix(in srgb, var(--accent) 45%, transparent); }

/* ---------- Diálogo de confirmación ---------- */
dialog.confirm { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); color: var(--text); padding: 1.1rem; width: min(440px, calc(100vw - 2rem)); max-height: calc(100vh - 3rem); box-shadow: var(--shadow); }
dialog.confirm::backdrop { background: rgba(0, 0, 0, .55); }
dialog.confirm h2 { margin-bottom: .4rem; }
dialog.confirm ul { margin: .6rem 0 1rem; padding-left: 1.1rem; display: grid; gap: .3rem; max-height: 45vh; overflow-y: auto; }
dialog.confirm li { color: var(--warn); font-weight: 600; }
dialog.confirm li span { color: var(--muted); font-weight: 500; }
dialog.confirm .form-actions { justify-content: flex-end; }

/* ---------- Listas ---------- */
.list { display: grid; }
.list-item { display: flex; gap: .75rem; align-items: center; padding: .75rem 0; border-top: 1px solid var(--border); color: inherit; }
.list-item:first-child { border-top: 0; padding-top: 0; }
.list-item:last-child { padding-bottom: 0; }
a.list-item:hover { text-decoration: none; }
a.list-item:hover .list-main strong { color: var(--accent); }
.list-main { flex: 1; min-width: 0; display: grid; gap: .1rem; }
.list-main > * { overflow-wrap: anywhere; }
.list-side { display: flex; align-items: center; gap: .5rem; flex: none; text-align: right; }

/* ---------- Tablas ---------- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 -1rem; padding: 0 1rem; }
.table { width: 100%; border-collapse: collapse; font-size: .93rem; }
.table th { text-align: left; font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 700; padding: .5rem .6rem; border-bottom: 1px solid var(--border); white-space: nowrap; }
.table td { padding: .6rem; border-bottom: 1px solid var(--border); vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.table td.num, .table th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table tr.is-voided td { color: var(--muted); text-decoration: line-through; }
.table tfoot td { font-weight: 750; border-top: 2px solid var(--border); }

/* ---------- KPIs ---------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: .75rem; }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: .85rem 1rem; display: grid; gap: .15rem; box-shadow: var(--shadow); color: inherit; }
a.kpi:hover { text-decoration: none; border-color: var(--accent); }
.kpi-value { font-size: 1.6rem; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1.1; }
.kpi-label { color: var(--muted); font-size: .85rem; font-weight: 600; }
.kpi.tone-warn .kpi-value { color: var(--warn); }
.kpi.tone-crit .kpi-value { color: var(--crit); }
.kpi.tone-ok .kpi-value { color: var(--ok); }

/* ---------- Fichaje ---------- */
.status-hero { border-radius: var(--radius); padding: 1.25rem; display: grid; gap: .9rem; border: 1px solid var(--border); background: var(--surface); box-shadow: var(--shadow); }
.status-hero.is-in { background: linear-gradient(160deg, var(--ok-soft), var(--surface) 70%); border-color: color-mix(in srgb, var(--ok) 35%, var(--border)); }
.status-hero.is-out { background: linear-gradient(160deg, var(--surface-2), var(--surface) 70%); }
.status-hero .clock { font-size: 2.6rem; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; line-height: 1; }
.status-hero .state { display: flex; align-items: center; gap: .55rem; font-weight: 700; }

/* ---------- Progreso, pestañas, vacío ---------- */
.progress { height: 8px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.progress-bar { height: 100%; width: var(--p, 0%); background: var(--accent); border-radius: inherit; transition: width .2s; }
.sticky-progress { position: sticky; top: calc(var(--topbar-h) + env(safe-area-inset-top)); z-index: 10; background: var(--bg); padding: .5rem 0; display: grid; gap: .35rem; }
.tabs { display: flex; gap: .35rem; overflow-x: auto; padding-bottom: .1rem; }
.tabs a { padding: .45rem .85rem; border-radius: 999px; border: 1px solid var(--border); color: var(--muted); font-weight: 650; white-space: nowrap; font-size: .92rem; background: var(--surface); }
.tabs a:hover { text-decoration: none; color: var(--text); }
.tabs a.is-active { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.empty { text-align: center; color: var(--muted); padding: 1.5rem .5rem; }
.empty-state { text-align: center; justify-items: center; padding: 2rem 1rem; }

/* ---------- Login ---------- */
.auth-wrap { min-height: 80vh; display: grid; place-items: center; }
.auth-card { width: 100%; max-width: 400px; }
.auth-brand { display: flex; align-items: center; gap: .6rem; font-weight: 800; font-size: 1.2rem; justify-content: center; margin-bottom: .5rem; }
.auth-brand .brand-dot { width: 18px; height: 18px; border-radius: 6px; }

/* ---------- Detalle ---------- */
dl.details { display: grid; grid-template-columns: max-content 1fr; gap: .4rem 1rem; margin: 0; }
dl.details dt { color: var(--muted); font-weight: 600; }
dl.details dd { margin: 0; overflow-wrap: anywhere; }
.pre { white-space: pre-wrap; overflow-wrap: anywhere; }

.print-only { display: none; }
@media print {
  .print-only { display: block; }
  .topbar, .tabbar, .no-print, .flash { display: none !important; }
  body { background: #fff; color: #000; }
  .main { padding: 0; max-width: none; }
  .card { box-shadow: none; border: 0; padding: 0; }
  .table-wrap { overflow: visible; margin: 0; padding: 0; }
}
