/* ===========================================================================
   EDS estación · hoja de estilos (mismo diseño que la central eds.alasapi.com)
   ---------------------------------------------------------------------------
   - Los tokens, el armazón (barra lateral azul noche + área clara), las
     tarjetas, las tablas, los botones, los campos y las insignias están
     portados de la hoja real de la central (docs/diseno-ui/central/
     central-index.css). Quien pase de una a otra ve el mismo producto.
   - Lo que cambia por ser ESTACIÓN, y por qué:
       · base de 16 px y controles de 44/48 px: se opera en tablet, de pie y
         con sol; la central se usa sentado en un PC.
       · grises un punto más oscuros (--muted, encabezados de tabla, borde de
         campo) para cumplir WCAG AA sobre el fondo claro.
       · en pantalla angosta la barra lateral baja y se vuelve barra inferior
         con blancos grandes, en vez del cajón lateral de la central.
       · componentes que la central no tiene: caras, display del surtidor,
         teclado del PIN, panel de autorización.
   - Sin fuentes, imágenes externas ni CDN: la estación puede estar sin
     internet. Fuente del sistema. El escudo se sirve desde /static/img.
   - Chrome/Edge/WebView 84 o más nuevo (flex gap). No usa :has, color-mix,
     container queries ni anidamiento. Sin estilos en línea: la CSP es
     style-src 'self'. Solo tema claro: al sol se lee mejor.
   =========================================================================== */

/* 1. Tokens ---------------------------------------------------------------- */
:root {
  /* Neutros (paleta de la central) */
  --bg: #f4f7fb;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --surface-3: #edf1f5;
  --line: #dfe6ef;
  --line-2: #c8d5e5;
  --line-field: #8494ab;    /* 3,1:1 sobre blanco (WCAG 1.4.11); la central usa #c8d5e5 */
  /* Borde de los controles que NO tienen relleno (botón blanco, tecla del PIN,
     ficha de usuario): ahí el borde es lo único que dibuja el control, así que
     necesita 3:1 (WCAG 1.4.11). El #c8d5e5 de la central da 1,4:1 y al sol el
     botón desaparece. Mismo tono, un punto más oscuro. */
  --line-ctl: #8494ab;      /* 3,09:1 sobre blanco */
  --line-ctl-bad: #c4817c;  /* 3,10:1 sobre blanco; el #ebcbc8 de la central da 1,6:1 */
  --ink: #132238;
  --ink-2: #35485e;
  --muted: #5d6c81;         /* el #68778c de la central, un punto más oscuro: 5,0:1 sobre --bg */
  --th-ink: #5f7186;        /* encabezado de tabla sobre --surface-2: 4,8:1 */
  --placeholder: #66758a;

  /* Azul principal */
  --brand-rgb: 18, 104, 232;
  --brand: #1268e8;
  --brand-dark: #0a4fb9;
  --brand-ink: #ffffff;
  --brand-text: #0a4fb9;
  --brand-soft: #eaf3ff;
  --brand-soft-2: #d7e7ff;
  --brand-line: rgba(18, 104, 232, .45);
  --brand-grad: linear-gradient(180deg, #1974ec, #1268e8);
  --focus-ring: 0 0 0 3px rgba(18, 104, 232, .28);

  /* Marca */
  --navy: #071d37;
  --navy-deep: #041426;
  --navy-2: #0f2e53;
  --navy-text: #c7d8eb;
  --gold: #c79528;
  --blue: #3578b9;

  /* Semánticos (tomados de la central; todos >= 4,9:1 sobre su fondo suave) */
  --ok: #087451;   --ok-bg: #e7f7ef;   --ok-line: #ccecdc;
  --warn: #8b640b; --warn-bg: #fff6dc; --warn-line: #f2dfac;
  --bad: #b23731;  --bad-bg: #fff0ef;  --bad-line: #f3d5d2;
  --info: #286684; --info-bg: #eaf3f8; --info-line: #d3e7f0;

  /* Estados de cara (Gilbarco). Banda de color + ícono + texto: nunca color solo. */
  --st-idle: #e4eaf1;  --st-idle-ink: #22324a; --st-idle-dot: #7a8aa0;
  /* Ámbar con tinta casi negra (6,1:1): el blanco sobre ámbar no pasa AA. */
  --st-call: #d98c05;  --st-call-ink: #2a1c00; --st-call-soft: #fff6dc; --st-call-text: #8b640b;
  --st-busy: #0e7c3a;  --st-busy-ink: #ffffff; --st-busy-soft: #e7f7ef; --st-busy-text: #087451;
  --st-done: #6b3fc0;  --st-done-ink: #ffffff; --st-done-soft: #f1ebfa; --st-done-text: #5f438b;
  --st-fail: #b23731;  --st-fail-ink: #ffffff; --st-fail-soft: #fff0ef; --st-fail-text: #9b2b26;

  /* Display del surtidor */
  --lcd-bg: #061425;
  --lcd-edge: #1c3354;
  --lcd-ink: #f3f7fb;
  --lcd-dim: #8ea6c2;

  /* Placa colombiana */
  --plate-bg: #ffd21f;
  --plate-ink: #111111;

  /* Tipografía */
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", Consolas, "Roboto Mono", "Liberation Mono", monospace;
  --fs-xs: 12px;
  --fs-sm: 14px;
  --fs-md: 16px;
  --fs-lg: 18px;
  --fs-xl: 21px;
  --fs-2xl: 28px;
  --fs-kpi: 30px;
  --fs-lcd: 38px;

  /* Espacio, radios, sombras (radios y sombras de la central) */
  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px; --sp-5: 24px; --sp-6: 32px; --sp-7: 48px;
  --r-1: 6px; --r-2: 9px; --r-3: 13px; --r-pill: 999px;
  --sh-1: 0 1px 2px rgba(7, 29, 55, .04), 0 2px 8px rgba(7, 29, 55, .04);
  --sh-2: 0 1px 2px rgba(7, 29, 55, .05), 0 6px 18px rgba(7, 29, 55, .06);
  --sh-3: 0 24px 64px rgba(5, 27, 52, .2);

  /* Medidas */
  --touch: 44px;
  --sidebar-w: 268px;
  --topbar-h: 64px;
  --page-max: 1600px;
}

/* Tablets y pantallas táctiles: texto un punto más grande y todo a 48 px */
@media (pointer: coarse) {
  :root { --fs-md: 17px; --fs-sm: 15px; --touch: 48px; }
}

/* 2. Base ------------------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; }
html { min-width: 320px; background: var(--bg); -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-width: 320px; min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font: 400 var(--fs-md)/1.45 var(--font);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
h1, h2, h3 { line-height: 1.2; color: var(--ink); }
h1 { font-size: var(--fs-2xl); font-weight: 720; letter-spacing: -.025em; margin: 0 0 var(--sp-4); color: #10243d; }
h2 { font-size: var(--fs-xl); font-weight: 700; margin: var(--sp-6) 0 var(--sp-3); color: #172b44; }
h3 { font-size: var(--fs-lg); font-weight: 700; margin: var(--sp-4) 0 var(--sp-2); }
p { margin: 0 0 var(--sp-3); }
ul { margin: 0 0 var(--sp-3); padding-left: 1.3em; }
li + li { margin-top: 6px; }
a { color: var(--brand-text); text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }
code, .mono { font-family: var(--mono); font-size: .92em; }
strong { font-weight: 700; }
hr { border: 0; border-top: 1px solid var(--line); margin: var(--sp-5) 0; }
pre { margin: 0; padding: var(--sp-3); white-space: pre-wrap; word-break: break-all; font-family: var(--mono); }
button, input, select, textarea { font: inherit; }

a:focus, button:focus, summary:focus, input:focus, select:focus, textarea:focus { outline: 3px solid var(--brand); outline-offset: 2px; }
a:focus:not(:focus-visible), button:focus:not(:focus-visible), summary:focus:not(:focus-visible) { outline: none; }

.muted { color: var(--muted); }
.small { font-size: var(--fs-sm); }
.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; }
.tabular { font-variant-numeric: tabular-nums; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.eyebrow { display: block; color: var(--brand-text); font-size: var(--fs-xs); font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
.eyebrow.light { color: #75bdff; }

svg.i {
  width: 20px; height: 20px; flex: none; vertical-align: -4px;
  fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
svg.i.lg { width: 24px; height: 24px; }
svg.i.xl { width: 32px; height: 32px; }
svg.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--st-idle-dot); flex: none; }
.dot.ok { background: var(--st-busy); }
.dot.warn { background: var(--st-call); }
.dot.bad { background: var(--st-fail); }

/* 3. Armazón: barra lateral azul noche + área clara con barra superior ------
   Es la misma estructura de la central: .shell -> .sidebar + el contenido. */
.shell { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); min-height: 100vh; }
body.plain .shell { grid-template-columns: minmax(0, 1fr); }
.canvas { display: flex; flex-direction: column; min-width: 0; }

.sidebar {
  position: -webkit-sticky; position: sticky; top: 0; z-index: 30;
  display: flex; flex-direction: column;
  height: 100vh; padding: 22px 14px 14px; overflow: hidden;
  color: var(--navy-text); font-size: 15px;
  background:
    radial-gradient(circle at 12% 1%, rgba(18, 104, 232, .22), transparent 30%),
    linear-gradient(165deg, var(--navy) 0%, var(--navy-deep) 100%);
}
.sidebar > * { flex: none; }
.sidebar .brand { display: flex; flex-direction: column; align-items: center; gap: 1px; margin: 0 0 14px; text-decoration: none; text-align: center; }
.sidebar .brand img { display: block; width: 132px; max-width: 100%; height: auto; object-fit: contain; }
.sidebar .brand-sub { width: 100%; margin: -2px 0 0; color: #9ab1ca; font-size: 12px; letter-spacing: .025em; }

.station-chip {
  display: flex; align-items: center; gap: 10px; margin-bottom: 16px; padding: 10px 11px;
  color: inherit; background: rgba(255, 255, 255, .055);
  border: 1px solid rgba(255, 255, 255, .095); border-radius: 11px; text-decoration: none;
  transition: background .16s ease, border-color .16s ease;
}
.station-chip:hover { background: rgba(18, 104, 232, .18); border-color: rgba(117, 189, 255, .28); }
.station-chip .status-dot { flex: 0 0 auto; width: 8px; height: 8px; background: #32d296; border-radius: 50%; box-shadow: 0 0 0 4px rgba(50, 210, 150, .12); }
.station-chip .status-dot.is-off { background: #f0a73c; box-shadow: 0 0 0 4px rgba(240, 167, 60, .14); }
.station-chip > div { display: flex; flex: 1; flex-direction: column; min-width: 0; }
.station-chip strong { overflow: hidden; color: #f1f7f4; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.station-chip span:not(.status-dot) { margin-top: 2px; color: #8ea7c0; font-size: 12px; }
.station-chip > svg.i { width: 17px; height: 17px; color: #6f88a4; }

.nav-caption { display: block; margin: 12px 10px 6px; color: #718ba7; font-size: 11px; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
.nav-caption:first-child { margin-top: 0; }
/* Solo la lista de secciones se desplaza: la marca queda arriba y la ficha del
   usuario abajo, aunque el administrador vea las doce secciones. */
.nav-groups { display: flex; flex: 1 1 auto; flex-direction: column; min-height: 0; overflow-y: auto; }
.side-nav { display: flex; flex-direction: column; gap: 3px; }
.nav-link {
  display: flex; align-items: center; gap: 12px; min-height: 42px; padding: 8px 11px;
  color: var(--navy-text); border: 1px solid transparent; border-radius: 10px;
  font-size: 15px; font-weight: 600; text-decoration: none;
  transition: color .16s ease, background .16s ease;
}
.nav-link svg.i { flex: 0 0 auto; width: 19px; height: 19px; color: #829ab4; }
.nav-link .nav-text { display: flex; flex: 1; align-items: center; gap: 8px; min-width: 0; }
.nav-link:hover { color: #fff; background: rgba(255, 255, 255, .06); }
.nav-link.on { color: #fff; background: linear-gradient(90deg, rgba(18, 104, 232, .32), rgba(18, 104, 232, .14)); border-color: rgba(117, 189, 255, .18); }
.nav-link.on svg.i { color: #75bdff; }

.privacy-note {
  display: flex; align-items: flex-start; gap: 9px; margin: 14px 2px 10px; padding: 10px;
  color: #93abc4; background: rgba(255, 255, 255, .035); border-radius: 9px; font-size: 12px; line-height: 1.5;
}
/* Pantallas bajas (1280x800 o una tablet acostada): la barra lateral suelta lo
   prescindible y se aprieta, para que al administrador le quepan las doce secciones. */
@media (max-height: 880px) { .privacy-note { display: none; } }
@media (max-height: 860px) {
  .sidebar { padding-top: 16px; }
  .sidebar .brand img { width: 104px; }
  .sidebar .brand-sub { display: none; }
  .station-chip { margin-bottom: 12px; }
  .nav-caption { margin: 9px 10px 5px; }
  .nav-link { min-height: 38px; padding: 6px 11px; }
}
.privacy-note svg.i { flex: none; width: 17px; height: 17px; margin-top: 1px; color: #69afff; }

.user-card {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; align-items: center; gap: 6px;
  padding: 13px 4px 2px; border-top: 1px solid rgba(255, 255, 255, .09);
}
.user-card form.inline { display: flex; margin: 0; }
.user-copy { display: flex; flex-direction: column; min-width: 0; }
.user-copy strong { overflow: hidden; color: #f4f8f6; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.user-copy span { margin-top: 2px; color: #93abc4; font-size: 12px; }
.icon-btn {
  display: grid; place-items: center; width: 38px; height: 38px; padding: 0;
  color: var(--muted); background: transparent; border: 0; border-radius: 8px; cursor: pointer; text-decoration: none;
}
.icon-btn:hover { color: var(--brand-text); background: var(--brand-soft); }
.icon-btn svg.i { width: 18px; height: 18px; }
.sidebar-action { color: #93abc4; }
.sidebar-action:hover { color: #fff; background: rgba(255, 255, 255, .10); }

/* Barra superior del área clara: título de la pantalla y estado en vivo */
.topbar {
  position: -webkit-sticky; position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3);
  min-height: var(--topbar-h); padding: 9px clamp(16px, 2.6vw, 40px);
  background: var(--surface); border-bottom: 1px solid var(--line);
}
.topbar-left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.topbar-brand { display: none; place-items: center; flex: none; width: 46px; height: 40px; padding: 4px; background: var(--navy); border-radius: 10px; }
.topbar-brand img { display: block; width: 100%; height: auto; }
.topbar-brand.on-plain { display: grid; }
.topbar-title { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.topbar-title .topbar-station { color: var(--muted); font-size: var(--fs-xs); font-weight: 650; letter-spacing: .06em; text-transform: uppercase; }
.topbar-title strong { overflow: hidden; color: var(--ink); font-size: var(--fs-md); font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.topbar-status { display: flex; align-items: center; gap: var(--sp-2); min-width: 0; }

.shift-pill, .sync {
  display: inline-flex; align-items: center; gap: 7px; min-height: 34px; padding: 0 12px;
  border: 1px solid var(--line-2); border-radius: var(--r-pill);
  background: var(--surface); color: var(--ink-2);
  font-size: var(--fs-sm); font-weight: 650; white-space: nowrap; text-decoration: none;
}
a.shift-pill:hover { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-text); }
.shift-pill.is-open { color: var(--ok); background: var(--ok-bg); border-color: var(--ok-line); }
.shift-pill.is-open .dot { background: #1aab77; }
.shift-pill.is-closing, .shift-pill.is-none { color: var(--warn); background: var(--warn-bg); border-color: var(--warn-line); }
.shift-pill.is-closing .dot, .shift-pill.is-none .dot { background: #daa527; }
.shift-who, .sync-label { font-weight: 550; }
.sync.is-online { color: var(--ok); background: var(--ok-bg); border-color: var(--ok-line); }
.sync.is-offline { color: var(--warn); background: var(--warn-bg); border-color: var(--warn-line); }
.sync svg.i { width: 17px; height: 17px; }
.clock {
  display: inline-flex; align-items: center; gap: 7px; min-height: 34px; padding: 0 12px;
  border-radius: var(--r-pill); background: var(--surface-3); color: var(--ink-2);
  font-size: var(--fs-sm); font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap;
}
.clock .live-dot { margin: 0; }

.avatar {
  display: flex; align-items: center; justify-content: center; flex: none;
  width: 34px; height: 34px; border-radius: 10px;
  background: var(--brand-soft); color: var(--brand-text);
  border: 1px solid #c9def9; font-size: 13px; font-weight: 800; letter-spacing: .02em;
}
.sidebar .avatar { color: #d8efff; background: rgba(18, 104, 232, .24); border-color: rgba(117, 189, 255, .22); }

.count {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 21px; height: 21px; padding: 0 7px; margin-left: 2px;
  border-radius: var(--r-pill); background: var(--st-fail); color: #ffffff;
  font-size: 12px; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums;
}
.count.soft { background: var(--st-call); color: var(--st-call-ink); }
.count.muted { background: var(--surface-3); color: var(--ink-2); }
.nav-link .count { margin-left: auto; }

main.content {
  width: 100%; max-width: var(--page-max); min-width: 0; margin: 0 auto;
  padding: 28px clamp(18px, 3vw, 48px) 56px;
}
main.content > h1:first-child { margin-top: 0; }
main.content.narrow { max-width: 900px; }

/* 4. Encabezado de página, migas y títulos de sección ---------------------- */
.page-head {
  display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between;
  gap: var(--sp-3) var(--sp-5); margin-bottom: var(--sp-5); min-height: 50px;
}
.page-head > div:first-child { flex: 1 1 360px; min-width: 0; }
.page-head > div:first-child:not(.person) { display: flex; flex-direction: column; gap: 4px; }
.page-head h1 { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin: 0; }
.page-head h1 .chip { font-size: 13px; min-height: 28px; }
.page-head .tabs { margin: 0; }
.page-sub { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; max-width: 86ch; margin: 0; color: var(--muted); font-size: var(--fs-sm); line-height: 1.5; }
.page-sub strong { color: var(--ink-2); }
.page-intro { max-width: 78ch; margin: -8px 0 var(--sp-5); color: var(--muted); }
.page-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); }
.page-actions .btn { margin: 0; }
a.crumb {
  display: inline-flex; align-items: center; gap: 4px; min-height: 34px; margin-bottom: var(--sp-1);
  color: var(--muted); font-weight: 650; font-size: var(--fs-sm); text-decoration: none;
}
a.crumb svg.i { width: 18px; height: 18px; }
a.crumb:hover { color: var(--brand-text); }
.section-title {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px;
  margin: var(--sp-6) 0 var(--sp-3); font-size: var(--fs-lg); color: #172b44;
}
.section-title .muted, .section-title .small { font-size: var(--fs-sm); font-weight: 500; }
.section-title > .muted:not(.count), .section-title > .small, .section-title > .tabs { margin-left: auto; }
div.section-title { align-items: center; }
.section-title > h2 { margin: 0; font-size: var(--fs-lg); }
.section-title .tabs { margin: 0; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: #1aab77; box-shadow: 0 0 0 0 rgba(26, 171, 119, .5); animation: livepulse 2s infinite; flex: none; }
@keyframes livepulse { 0% { box-shadow: 0 0 0 0 rgba(26, 171, 119, .45); } 70% { box-shadow: 0 0 0 7px rgba(26, 171, 119, 0); } 100% { box-shadow: 0 0 0 0 rgba(26, 171, 119, 0); } }

/* 5. Avisos: banner, flash, alarma en línea -------------------------------- */
.banner { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 10px var(--sp-5); font-weight: 650; font-size: var(--fs-sm); }
.banner.offline, .banner.warn { background: var(--warn-bg); color: var(--warn); border-bottom: 1px solid var(--warn-line); }
/* Acceso desde fuera de la estación (§8.6): se avisa siempre, para que nadie crea que está en la isla. */
.banner.remote { background: var(--info-bg); color: var(--info); border-bottom: 1px solid var(--info-line); }
.banner a { color: inherit; text-decoration: underline; }
.banner svg.i { flex: none; }
/* Falta la contraseña obligatoria: el candado de la barra lateral lo dice sin depender del color. */
.icon-btn.needs-attention { position: relative; }
.icon-btn.needs-attention::after {
  content: ""; position: absolute; top: 5px; right: 5px; width: 9px; height: 9px;
  background: var(--st-call); border: 1.5px solid var(--navy); border-radius: 50%;
}

.flash {
  display: flex; align-items: flex-start; gap: 10px; margin: 0 0 var(--sp-4); padding: 11px 13px;
  border: 1px solid transparent; border-radius: var(--r-2); font-weight: 600; line-height: 1.45;
}
.flash svg.i { flex: none; margin-top: 1px; }
.flash.ok { background: var(--ok-bg); color: var(--ok); border-color: var(--ok-line); }
.flash.error { background: var(--bad-bg); color: var(--bad); border-color: var(--bad-line); }
.flash.info { background: var(--info-bg); color: var(--info); border-color: var(--info-line); }
.flash.warn { background: var(--warn-bg); color: var(--warn); border-color: var(--warn-line); }
.flash a { color: inherit; }
/* Los avisos tras una acción (role="status", los pone base.html) llevan su ícono por CSS:
   el texto va solo dentro del div. El ícono cambia de forma con el tipo, no solo de color. */
.flash[role="status"]::before {
  content: ""; flex: none; width: 20px; height: 20px; margin-top: 1px;
  background-repeat: no-repeat; background-position: center; background-size: 20px;
}
.flash.ok[role="status"]::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23087451' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='m8 12.5 2.8 2.8L16.5 9.5'/%3E%3C/svg%3E"); }
.flash.error[role="status"]::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23b23731' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M8 3h8l5 5v8l-5 5H8l-5-5V8z'/%3E%3Cpath d='M12 8v5M12 16.5v.3'/%3E%3C/svg%3E"); }
.flash.info[role="status"]::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23286684' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 11v5.5M12 7.8v.2'/%3E%3C/svg%3E"); }
.flash.warn[role="status"]::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238b640b' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10.3 4.2 2.4 18a2 2 0 0 0 1.7 3h15.8a2 2 0 0 0 1.7-3L13.7 4.2a2 2 0 0 0-3.4 0z'/%3E%3Cpath d='M12 9v4.5M12 17.2v.3'/%3E%3C/svg%3E"); }

.alarm {
  display: flex; align-items: flex-start; gap: 8px; margin-top: var(--sp-2); padding: 9px 12px;
  border-radius: var(--r-2); font-size: var(--fs-sm); font-weight: 650;
}
.alarm svg.i { width: 18px; height: 18px; flex: none; margin-top: 1px; }
span.alarm { display: inline-flex; margin: 0; padding: 3px 10px; border-radius: var(--r-pill); white-space: nowrap; }
.alarm.sev-critica { background: var(--bad-bg); color: var(--bad); border: 1px solid var(--bad-line); }
.alarm.sev-advertencia { background: var(--warn-bg); color: var(--warn); border: 1px solid var(--warn-line); }
.alarm.sev-info { background: var(--info-bg); color: var(--info); border: 1px solid var(--info-line); }

/* 6. Insignias (chips), placa y modo --------------------------------------- */
.chip {
  display: inline-flex; align-items: center; gap: 6px; min-height: 25px; padding: 3px 9px;
  border: 1px solid transparent; border-radius: var(--r-pill);
  background: var(--surface-3); color: var(--ink-2);
  font-size: 12.5px; font-weight: 750; line-height: 1.1; white-space: nowrap; vertical-align: middle; text-decoration: none;
}
.chip svg.i { width: 15px; height: 15px; vertical-align: -3px; }
.chip .dot { width: 7px; height: 7px; }
.chip.ok { background: var(--ok-bg); color: var(--ok); }
.chip.ok .dot { background: #1aab77; }
.chip.warn { background: var(--warn-bg); color: var(--warn); }
.chip.warn .dot { background: #daa527; }
.chip.bad { background: var(--bad-bg); color: var(--bad); }
.chip.bad .dot { background: var(--bad); }
.chip.info { background: var(--info-bg); color: var(--info); }
.chip.outline { background: transparent; border-color: var(--line-2); color: var(--muted); }
.chip.mode { min-height: 28px; padding: 4px 11px; background: #eef2f7; color: #37618d; border-color: #dbe4ee; }
.chip.mode.is-auto { background: var(--surface); color: var(--muted); border-color: var(--line-2); }
.chip.mode.is-off { background: var(--warn-bg); color: var(--warn); border-color: var(--warn-line); }
a.chip:hover { text-decoration: underline; }

.plate {
  display: inline-block; padding: 1px 8px; border: 1.5px solid #1a1a1a; border-radius: var(--r-1);
  background: var(--plate-bg); color: var(--plate-ink);
  font-family: var(--mono); font-size: 1em; font-weight: 700; letter-spacing: .06em; line-height: 1.3;
  white-space: nowrap; vertical-align: 1px;
}
.rom { font-family: var(--mono); font-size: .92em; letter-spacing: .02em; word-break: break-all; color: #59697d; }

/* 7. Tarjetas y rejillas --------------------------------------------------- */
.card {
  margin: 0 0 var(--sp-4); padding: 18px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-3); box-shadow: var(--sh-1);
}
.card > h2:first-child, .card > h3:first-child, .card > .card-head:first-child { margin-top: 0; }
.card > :last-child { margin-bottom: 0; }
.card h2 { font-size: var(--fs-lg); margin: var(--sp-5) 0 var(--sp-3); }
.card.warn { background: #fffdf6; border-color: var(--warn-line); }
.card.bad { background: #fffbfa; border-color: var(--bad-line); }
.card.brandy { border-top: 3px solid var(--brand); padding-top: 16px; }
.card-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: var(--sp-2) var(--sp-4); margin-bottom: var(--sp-4); }
.card-head h2 { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: 0; }
.card-head .sub { margin: 4px 0 0; color: var(--muted); font-size: var(--fs-sm); }
.card-title { display: flex; align-items: center; gap: 12px; margin: 0 0 var(--sp-3); }
.card-title h2, .card-title h3, .card .card-title h2 { margin: 0; }
.card-head .card-title { margin: 0; }
.card-title strong { font-size: var(--fs-lg); }
.card-title .ico {
  display: grid; place-items: center; width: 40px; height: 40px; flex: none;
  border-radius: 11px; background: var(--brand-soft); color: var(--brand);
}
.card.warn .card-title .ico { background: #fff4d9; color: #9b7116; }
.card.bad .card-title .ico { background: var(--bad-bg); color: var(--bad); }
.hint, form.stack .hint { margin: 6px 0 0; font-size: var(--fs-sm); color: var(--muted); line-height: 1.5; }

.row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2) var(--sp-3); margin-bottom: var(--sp-4); }
.row > form { margin: 0; }
.row .btn { margin: 0; }
.row input[type=text], .row input[type=search], .row select { width: auto; flex: 1 1 240px; }
.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: var(--sp-4); align-items: start; margin-bottom: var(--sp-4); }
.cols > * { min-width: 0; margin: 0; }
.split { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: var(--sp-4); align-items: start; margin-bottom: var(--sp-4); }
.split > * { min-width: 0; margin: 0; }
@media (max-width: 1100px) { .split { grid-template-columns: 1fr; } }

/* 8. Botones ---------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  min-height: var(--touch); padding: 8px 16px;
  border: 1px solid var(--brand); border-radius: var(--r-2);
  background: var(--brand-grad); color: var(--brand-ink);
  box-shadow: 0 2px 4px rgba(10, 79, 185, .14);
  font: inherit; font-size: var(--fs-sm); font-weight: 700; line-height: 1.2;
  text-align: center; text-decoration: none; cursor: pointer; user-select: none; white-space: nowrap;
  transition: background .15s ease, border-color .15s ease;
}
.btn:hover { background: var(--brand-dark); border-color: var(--brand-dark); }
.btn:active { box-shadow: inset 0 0 0 100px rgba(0, 0, 0, .12); }
.btn.secondary { background: var(--surface); color: #315d91; border-color: var(--line-ctl); box-shadow: none; }
.btn.secondary:hover { color: var(--brand-text); background: var(--brand-soft); border-color: #a8c9f5; }
.btn.secondary svg.i { color: var(--brand); }
.btn.quiet { background: transparent; border-color: transparent; color: var(--brand-text); box-shadow: none; }
.btn.quiet:hover { background: var(--brand-soft); border-color: transparent; color: var(--brand-text); }
.btn.danger { background: var(--surface); color: var(--bad); border-color: var(--line-ctl-bad); box-shadow: none; }
.btn.danger:hover { background: var(--bad-bg); border-color: #a8544e; color: var(--bad); }
.btn.danger.secondary { background: var(--surface); color: var(--bad); border-color: var(--line-ctl-bad); }
/* «Cerrar turno» y demás acciones grandes de riesgo: a 54 px de alto el borde
   fino se pierde. Un filete abajo las dibuja como botón sin llegar al rojo lleno. */
.btn.big.danger { border-bottom-width: 3px; }
.btn.big { display: flex; width: 100%; min-height: 54px; margin-top: var(--sp-4); font-size: var(--fs-md); }
.btn.small { min-height: 36px; padding: 5px 11px; font-size: 13px; gap: 6px; }
.btn.small svg.i { width: 16px; height: 16px; }
.btn.ghost { background: var(--surface); color: #315d91; border-color: var(--line-ctl); box-shadow: none; }
.btn.ghost:hover { color: var(--brand-text); background: var(--brand-soft); border-color: #a8c9f5; }
.btn.block { width: 100%; }
.btn small { display: block; font-weight: 500; font-size: var(--fs-sm); }
.btn[disabled], .btn.is-disabled { opacity: .5; cursor: not-allowed; box-shadow: none; }
form.inline { display: inline; margin: 0; }
.actions { display: flex; justify-content: flex-end; gap: 9px; padding-top: 5px; }

/* htmx: indicador y botón ocupado */
.htmx-indicator { opacity: 0; transition: opacity .2s; }
.htmx-request .htmx-indicator, .htmx-request.htmx-indicator { opacity: 1; }
.btn.htmx-request, .htmx-request .btn[type=submit], .btn.is-loading { pointer-events: none; opacity: .85; }
.btn.htmx-request::after, .htmx-request .btn[type=submit]::after, .btn.is-loading::after {
  content: ""; width: 16px; height: 16px; border-radius: 50%;
  border: 2.5px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* 9. Formularios ------------------------------------------------------------ */
form.stack label { display: block; margin: var(--sp-4) 0 6px; font-size: var(--fs-sm); font-weight: 650; color: #53677e; }
form.stack > h3:first-child, form.stack > h2:first-child { margin-top: 0; }
form.stack .btn { margin-top: var(--sp-4); }
input[type=text], input[type=password], input[type=number], input[type=search], input[type=tel],
input[type=datetime-local], input[type=date], select, textarea {
  width: 100%; min-width: 0; min-height: var(--touch); padding: 9px 12px;
  border: 1px solid var(--line-field); border-radius: var(--r-2);
  background: var(--surface); color: var(--ink);
  font: inherit; font-size: var(--fs-md);
  transition: border-color .15s ease, box-shadow .15s ease;
}
textarea { min-height: 90px; line-height: 1.45; resize: vertical; }
input:hover, select:hover, textarea:hover { border-color: var(--muted); }
input:focus, select:focus, textarea:focus, input.is-focus { outline: none; border-color: #3985ed; box-shadow: var(--focus-ring); }
input::placeholder, textarea::placeholder { color: var(--placeholder); opacity: 1; }
input:read-only { color: #66788e; background: #f3f6fa; }
input[aria-invalid=true], select[aria-invalid=true], .is-invalid { border-color: var(--bad); }
.field-error { display: flex; gap: 6px; margin: 6px 0 0; color: var(--bad); font-size: var(--fs-sm); font-weight: 700; }
.field-error svg.i { width: 18px; height: 18px; margin-top: 1px; }
select {
  -webkit-appearance: none; appearance: none; padding-right: 40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%235d6c81' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 11px center; background-size: 20px;
}
.check, form.stack label.check {
  display: flex; align-items: center; gap: 12px; min-height: var(--touch); margin: var(--sp-2) 0;
  font-size: var(--fs-md); font-weight: 600; color: var(--ink); cursor: pointer;
}
.check input { width: 22px; height: 22px; margin: 0; flex: none; accent-color: var(--brand); }
.check input:disabled + * { opacity: .5; }
.field { margin-bottom: var(--sp-3); }
.radio-cards { display: grid; gap: var(--sp-2); }
.radio-cards label.check, form.stack .radio-cards label.check {
  margin: 0; padding: 10px 14px; border: 1px solid var(--line-field); border-radius: var(--r-2); background: var(--surface);
}
.radio-cards label.check:hover { border-color: var(--brand); background: var(--brand-soft); }
.radio-cards .cell-sub { display: block; color: var(--muted); font-size: var(--fs-sm); font-weight: 500; }
.radio-cards:empty { display: none; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 0 var(--sp-4); align-items: start; }
.form-grid > * { min-width: 0; }
.fieldset-label { display: block; margin: var(--sp-4) 0 6px; font-size: var(--fs-sm); font-weight: 650; color: #53677e; }

/* Selector segmentado (radios) y pestañas */
.seg, .tabs {
  display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px;
  background: var(--surface-3); border-radius: 11px;
}
.tabs { margin: 0 0 var(--sp-4); }
.seg-opt, form.stack label.seg-opt { position: relative; display: block; margin: 0; font-size: var(--fs-sm); }
.seg-opt input { position: absolute; top: 0; left: 0; width: 1px; height: 1px; opacity: 0; }
.seg-opt span, .tab {
  display: inline-flex; align-items: center; gap: 8px; min-height: 38px; padding: 0 15px;
  border-radius: 8px; color: var(--ink-2); font-size: var(--fs-sm); font-weight: 700; text-decoration: none; white-space: nowrap; cursor: pointer;
}
.seg-opt span:hover, .tab:hover { background: rgba(255, 255, 255, .7); color: var(--ink); }
.seg-opt input:checked + span, .tab.on {
  background: var(--surface); color: var(--brand-text); box-shadow: 0 1px 2px rgba(7, 29, 55, .1), 0 0 0 1px var(--line);
}
.seg-opt input:focus + span { outline: 3px solid var(--brand); outline-offset: 1px; }
.seg-opt input:disabled + span { opacity: .45; cursor: not-allowed; }
.tab .count { margin-left: 0; }
.seg.block { display: flex; }
.seg.block .seg-opt { flex: 1 1 0; }
.seg.block .seg-opt span { justify-content: center; width: 100%; }

/* Plegables (acciones poco frecuentes, ayuda) */
details.fold { border-top: 1px solid var(--line); }
details.fold > summary {
  display: flex; align-items: center; justify-content: space-between; gap: var(--sp-2);
  min-height: var(--touch); font-weight: 700; cursor: pointer; list-style: none;
}
details.fold > summary::-webkit-details-marker { display: none; }
details.fold > summary::after {
  content: ""; flex: none; width: 9px; height: 9px; margin-right: 6px;
  border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg);
}
details.fold[open] > summary::after { transform: rotate(-135deg); }
details.fold > summary .summary-text { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
details.fold > .fold-body { padding-bottom: var(--sp-4); }
details.fold > .fold-body > form.stack > label:first-of-type { margin-top: var(--sp-2); }

/* 10. Tablas ---------------------------------------------------------------- */
.table-wrap {
  overflow-x: auto; -webkit-overflow-scrolling: touch; margin-bottom: var(--sp-4);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-3); box-shadow: var(--sh-1);
}
table.list { width: 100%; border-collapse: separate; border-spacing: 0; }
table.list th {
  padding: 11px 13px; background: var(--surface-2); border-bottom: 1px solid var(--line);
  color: var(--th-ink); font-size: var(--fs-xs); font-weight: 800; letter-spacing: .07em; text-transform: uppercase;
  text-align: left; white-space: nowrap;
}
table.list td { padding: 11px 13px; border-bottom: 1px solid #e6ebf1; color: var(--ink-2); font-size: var(--fs-sm); vertical-align: middle; }
table.list tbody tr { transition: background .12s ease; }
table.list tbody tr:last-child td { border-bottom: 0; }
table.list tbody tr:hover td { background: #f9fbfd; }
table.list th.num, table.list td.num { text-align: right; }
/* La columna de acciones se encoge a su contenido: SIN ancho declarado. Con
   «width: 1%» (o 1px) Chrome no le respeta el mínimo del botón y este se sale
   sobre la columna de al lado; sin ancho, el reparto automático le da su mínimo
   y el sobrante se va a las columnas de texto. */
table.list td.actions, table.list th:last-child:empty { text-align: right; white-space: nowrap; }
table.list td.actions .btn { margin: 0; }
table.list td.actions form { display: inline; margin: 0; }
table.list td.actions .cell-wrap { display: block; min-width: 160px; max-width: 300px; white-space: normal; text-align: left; }
/* Lecturas sin registrar: ocho columnas y encabezados largos. Los rótulos se parten
   en dos renglones y el ROM va entero, así la tabla no se sale de la tarjeta. */
table.list.unregistered th { white-space: normal; }
table.list.unregistered .rom { white-space: nowrap; word-break: normal; }
table.list td.actions .actions-row { display: inline-flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 5px; }
table.list td a { font-weight: 650; }
table.list tr.total td { background: var(--surface-2); border-top: 2px solid var(--ink-2); font-weight: 700; }
table.list tr.attention td { background: #fffdf3; }
table.list tr.attention td:first-child { box-shadow: inset 3px 0 0 #daa527; }
table.list tr.row-form td { background: var(--surface-2); }
table.list .cell-sub { display: block; margin-top: 2px; color: var(--muted); font-size: var(--fs-xs); font-weight: 400; }
table.list .strong { font-weight: 700; color: #203650; }
table.list td.empty-cell { padding: 0; }
table.list td.small { font-size: var(--fs-sm); }
table.list input { min-width: 110px; }
/* 168 px: «Según la placa» más la flecha. Con 150 el rótulo salía cortado. */
table.list select { min-width: 168px; }
.pos { color: var(--warn); font-weight: 700; }
.neg { color: var(--bad); font-weight: 700; }
.zero { color: var(--ok); font-weight: 700; }

table.kv { width: 100%; border-collapse: collapse; }
table.kv th {
  width: 40%; padding: 10px 12px 10px 0; text-align: left; vertical-align: top;
  color: var(--muted); font-size: var(--fs-sm); font-weight: 600;
}
table.kv td { padding: 10px 0; vertical-align: top; }
table.kv tr + tr th, table.kv tr + tr td { border-top: 1px solid var(--line); }
table.kv td.num { text-align: left; }
table.kv td.num strong { font-size: var(--fs-lg); }

/* Tabla que se apila en teléfono: necesita data-label en cada td */
@media (max-width: 600px) {
  table.list.stack-sm thead { display: none; }
  table.list.stack-sm, table.list.stack-sm tbody, table.list.stack-sm tr, table.list.stack-sm td { display: block; width: 100%; }
  table.list.stack-sm tr { position: relative; padding: 8px 0; border-bottom: 1px solid var(--line); }
  /* La etiqueta va a la izquierda en posición absoluta: así una celda con varios hijos
     (enlace + .cell-sub, varios chips) se apila a la derecha en vez de repartirse. */
  table.list.stack-sm td { position: relative; min-height: 34px; padding: 6px 14px 6px 40%; border: 0; text-align: right; white-space: normal; }
  table.list.stack-sm td::before {
    content: attr(data-label); position: absolute; top: 7px; left: 14px; max-width: 36%;
    color: var(--muted); font-size: var(--fs-sm); font-weight: 600; text-align: left;
  }
  table.list.stack-sm td.actions { width: 100%; padding-left: 14px; }
  table.list.stack-sm tr.attention { background: #fffdf3; box-shadow: inset 3px 0 0 #daa527; }
  table.list.stack-sm tr.attention td { background: transparent; box-shadow: none; }
  table.list.stack-sm td.hide-sm, .hide-sm { display: none; }
}

/* 11. Pantallas ------------------------------------------------------------ */

/* 11.1 Caras */
.island { margin-bottom: var(--sp-6); }
.island-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--sp-2) var(--sp-4); margin-bottom: var(--sp-3); }
.island h2 { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; margin: 0 0 var(--sp-3); font-size: var(--fs-xl); }
.island-head h2 { margin: 0; }
.island h2 .sub { color: var(--muted); font-size: var(--fs-sm); font-weight: 500; }
.island-tags { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.faces { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: var(--sp-4); }

.face {
  display: flex; flex-direction: column; min-width: 0;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-3);
  box-shadow: var(--sh-1); overflow: hidden;
}
.face-head {
  display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3);
  min-height: 52px; padding: 8px var(--sp-4);
  background: var(--st-idle); color: var(--st-idle-ink);
}
.face-no { font-size: var(--fs-lg); font-weight: 800; letter-spacing: -.01em; white-space: nowrap; }
/* El estado se lee desde lejos: mayúsculas, con ícono, nunca solo color */
.state {
  display: inline-flex; align-items: center; gap: 8px; min-width: 0;
  font-size: var(--fs-sm); font-weight: 800; letter-spacing: .07em; text-transform: uppercase; white-space: nowrap;
}
.face-body { display: flex; flex-direction: column; gap: var(--sp-3); flex: 1; padding: var(--sp-4); }
.face.st-call { border-color: var(--st-call); }
.face.st-busy { border-color: var(--st-busy); }
.face.st-done { border-color: var(--st-done); }
.face.st-bad { border-color: var(--st-fail); }
.face.st-warn { border-color: var(--bad-line); }
.face.st-call .face-head { background: var(--st-call); color: var(--st-call-ink); }
.face.st-busy .face-head { background: var(--st-busy); color: var(--st-busy-ink); }
.face.st-done .face-head { background: var(--st-done); color: var(--st-done-ink); }
.face.st-bad .face-head { background: var(--st-fail); color: var(--st-fail-ink); }
.face.st-warn .face-head { background: var(--st-fail-soft); color: var(--st-fail-text); }
.face.st-call .state svg.i { animation: blink 1.6s ease-in-out infinite; }
@keyframes blink { 50% { opacity: .35; } }

/* Display del surtidor: pesos, galones y precio, como en el Gilbarco */
.display {
  min-height: 132px; padding: 4px 14px;
  background: var(--lcd-bg); border: 1px solid var(--lcd-edge); border-radius: var(--r-2);
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, .35); color: var(--lcd-ink);
}
.display-row { display: flex; align-items: baseline; justify-content: space-between; gap: var(--sp-3); padding: 6px 0; }
.display-row + .display-row { border-top: 1px solid var(--lcd-edge); }
.display-label { color: var(--lcd-dim); font-size: var(--fs-xs); font-weight: 700; letter-spacing: .1em; text-transform: uppercase; white-space: nowrap; }
.display-value {
  color: var(--lcd-ink); font-size: var(--fs-lcd); font-weight: 700; line-height: 1.05;
  font-variant-numeric: tabular-nums; letter-spacing: -.01em; white-space: nowrap;
}
.display-row.sub { flex-wrap: wrap; padding: 5px 0 6px; }
.display-row.sub .display-value { margin-left: auto; font-size: var(--fs-md); font-weight: 600; color: var(--lcd-dim); letter-spacing: 0; }
.display.is-idle .display-value { color: #b7c7da; }
.display.is-off {
  display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 6px;
  background-color: var(--lcd-bg);
  background-image: repeating-linear-gradient(135deg, rgba(255, 255, 255, .045) 0 10px, transparent 10px 20px);
  color: var(--lcd-dim); font-weight: 700; letter-spacing: .12em; text-transform: uppercase; font-size: var(--fs-sm); text-align: center;
}
.display.is-off svg.i { width: 28px; height: 28px; color: #ff8a80; }
.display.is-blank { display: flex; align-items: center; justify-content: center; color: var(--lcd-dim); font-size: var(--fs-sm); font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }

.face-callout {
  display: flex; flex-direction: column; justify-content: center; gap: 6px; min-height: 132px;
  padding: var(--sp-4); border: 2px dashed var(--st-call); border-radius: var(--r-2);
  background: var(--st-call-soft); color: var(--ink);
}
.face-callout strong { display: flex; align-items: center; gap: 10px; font-size: var(--fs-lg); line-height: 1.25; color: var(--st-call-text); }
.face-callout strong svg.i { width: 26px; height: 26px; flex: none; }
.face-callout .reader { font-weight: 800; letter-spacing: .02em; white-space: nowrap; }
.face-callout .small { color: var(--ink-2); }
.face-callout .btn { align-self: flex-start; margin-top: 4px; }

.face-meta { display: grid; gap: 8px; margin: 0; font-size: var(--fs-sm); }
.face-meta > div { display: flex; align-items: baseline; gap: 10px; min-width: 0; }
.face-meta dt { flex: none; width: 58px; color: var(--muted); font-weight: 650; }
.face-meta dd { margin: 0; min-width: 0; color: var(--ink-2); }
.face .alarm { margin-top: 0; }

/* Escritorio ancho: display a la izquierda y datos a la derecha, así las 4 caras caben en 1280 x 800 */
@media (min-width: 1200px) {
  .face-body {
    display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); grid-template-rows: auto auto 1fr;
    grid-auto-flow: row dense; column-gap: var(--sp-4); row-gap: var(--sp-3); align-items: start;
  }
  .face-body > .display, .face-body > .face-callout { grid-column: 1; grid-row: 1 / -1; }
  /* La alarma de la cara va a la derecha, sobre los datos: la tarjeta no crece y las 4 caras caben */
  .face-body > :not(.display):not(.face-callout) { grid-column: 2; }
  .face-body .display-row:not(.sub) { display: block; padding: 5px 0 2px; }
  .face-body .display-row:not(.sub) .display-label { display: block; }
  .face-body .display-row:not(.sub) .display-value { display: block; text-align: right; }
  .face-body .face-meta > div { flex-direction: column; gap: 0; }
  .face-body .face-meta dt { width: auto; font-size: var(--fs-xs); letter-spacing: .06em; text-transform: uppercase; }
  .face-callout strong { font-size: var(--fs-md); }
  .island { margin-bottom: var(--sp-5); }
}
/* "En vivo · 14:32:18": va DENTRO del contenedor sondeado (si no, la hora no cambia nunca) */
.live-note { display: flex; align-items: center; gap: 8px; margin: 0; color: var(--muted); font-size: var(--fs-sm); font-variant-numeric: tabular-nums; }

/* Datos congelados: el sondeo htmx falló o no respondió (static/ui.js pone .is-stale en el contenedor) */
.stale-note { display: none; }
.is-stale > .stale-note { display: flex; }
.is-stale > :not(.stale-note) { opacity: .5; filter: grayscale(.8); }

/* 11.2 Llaves y autorización */
.cols.wide { grid-template-columns: repeat(auto-fit, minmax(420px, 1fr)); }
@media (max-width: 480px) { .cols.wide { grid-template-columns: 1fr; } }
.disp-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: start; gap: var(--sp-2) var(--sp-4); margin-bottom: var(--sp-4); }
.disp-head h2 { margin: 0; }
.disp-head .sub { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin: 4px 0 0; color: var(--muted); font-size: var(--fs-sm); }
.disp-mode { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; text-align: right; }
.disp-mode .small { color: var(--muted); max-width: 260px; }
.mode-badge {
  display: inline-flex; align-items: center; gap: 8px; min-height: 34px; padding: 0 13px;
  border: 1px solid #dbe4ee; border-radius: var(--r-pill);
  background: #eef2f7; color: #37618d; font-size: var(--fs-sm); font-weight: 750; white-space: nowrap;
}
.mode-badge svg.i { width: 18px; height: 18px; }
.mode-badge.is-auto { background: var(--surface); color: var(--muted); border-color: var(--line-2); }
.mode-badge.is-off { background: var(--warn-bg); color: var(--warn); border-color: var(--warn-line); }
.disp-status { display: grid; gap: var(--sp-3); }
.disp-modebar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; }
.disp-status > .live-note { justify-content: flex-end; }
.disp-status .kv-list > div:first-child { border-top: 1px solid var(--line); }
.disp-status > .alarm { margin: 0; }

.grant { padding: var(--sp-4); border: 1px solid var(--warn-line); border-radius: var(--r-2); background: var(--warn-bg); }
.grant-top { display: flex; align-items: baseline; justify-content: space-between; gap: var(--sp-2); }
.grant-top .eyebrow { color: var(--warn); }
.grant-ttl { color: var(--warn); font-size: var(--fs-sm); font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.grant-ttl strong { font-size: var(--fs-xl); }
.grant-main { margin: 2px 0 10px; font-size: var(--fs-lg); font-weight: 700; }
.grant .small { margin: 8px 0 0; color: var(--ink-2); }
.grant.is-none { background: var(--surface-2); border-style: dashed; border-color: var(--line-2); }
.grant.is-none .eyebrow { color: var(--muted); }
.grant.is-none .grant-main { color: var(--ink-2); font-size: var(--fs-md); font-weight: 600; margin-bottom: 0; }

progress.bar {
  -webkit-appearance: none; appearance: none; display: block; width: 100%; height: 8px;
  border: 0; border-radius: var(--r-pill); background: rgba(7, 29, 55, .10); color: var(--brand); overflow: hidden;
}
progress.bar::-webkit-progress-bar { background: rgba(7, 29, 55, .10); border-radius: var(--r-pill); }
progress.bar::-webkit-progress-value { background: var(--brand); border-radius: var(--r-pill); }
progress.bar::-moz-progress-bar { background: var(--brand); border-radius: var(--r-pill); }
progress.bar.warn::-webkit-progress-value { background: #daa527; }
progress.bar.warn::-moz-progress-bar { background: #daa527; }
progress.bar.ok::-webkit-progress-value { background: #1aab77; }
progress.bar.ok::-moz-progress-bar { background: #1aab77; }

.mini-faces { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: var(--sp-2); }
.mini-face {
  display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; column-gap: 10px; row-gap: 0;
  min-height: 54px; padding: 8px 12px;
  border: 1px solid var(--line); border-radius: var(--r-2); background: var(--surface-2);
}
.mini-face .dot { width: 11px; height: 11px; }
.mini-face svg.i { width: 18px; height: 18px; }
.mini-no { font-weight: 800; white-space: nowrap; font-size: var(--fs-sm); }
.mini-state { grid-column: 2; font-size: var(--fs-sm); font-weight: 700; line-height: 1.25; }
.mini-since { grid-column: 2; font-size: var(--fs-xs); color: var(--muted); font-variant-numeric: tabular-nums; }
.mini-face.st-idle .dot { background: var(--st-idle-dot); }
.mini-face.st-idle .mini-state { color: var(--muted); }
.mini-face.st-busy .dot { background: var(--st-busy); }
.mini-face.st-busy .mini-state { color: var(--st-busy-text); }
.mini-face.st-done .dot { background: var(--st-done); }
.mini-face.st-done .mini-state { color: var(--st-done-text); }
.mini-face.st-call { background: var(--st-call-soft); border-color: var(--warn-line); }
.mini-face.st-call .dot { background: var(--st-call); }
.mini-face.st-call .mini-state { color: var(--st-call-text); }
.mini-face.st-bad, .mini-face.st-warn { background: var(--st-fail-soft); border-color: var(--bad-line); }
.mini-face.st-bad .dot, .mini-face.st-warn .dot { background: var(--st-fail); }
.mini-face.st-bad .mini-state, .mini-face.st-warn .mini-state { color: var(--st-fail-text); }

.kv-list { display: grid; gap: 0; margin: 0; }
.kv-list > div { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.kv-list dt { flex: none; width: 128px; color: var(--muted); font-size: var(--fs-sm); font-weight: 650; }
.kv-list dd { flex: 1 1 200px; margin: 0; min-width: 0; color: var(--ink-2); }
.disp-actions { margin-top: var(--sp-4); }
.disp-actions form.stack { margin: 0; }
.disp-actions > form.stack { padding-top: var(--sp-4); border-top: 1px solid var(--line); }
.disp-actions > form.stack h3 { margin-top: 0; }
.disp-actions .note { display: flex; gap: 8px; margin: 0; padding: 12px 0; color: var(--muted); font-size: var(--fs-sm); border-top: 1px solid var(--line); }
.disp-actions .note svg.i { flex: none; margin-top: 1px; }

details.card.fold { padding: 0 18px; }
details.card.fold > summary { min-height: 54px; }
details.card.fold > .fold-body > :last-child { margin-bottom: 0; }

/* 11.3 Ventas: resumen y barra de filtros */
.sumbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2) var(--sp-5);
  margin-bottom: var(--sp-4); padding: 13px 18px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-3); box-shadow: var(--sh-1);
  font-variant-numeric: tabular-nums;
}
.sumbar > span { display: flex; align-items: baseline; gap: 6px; }
.sumbar b { color: #15283f; font-size: var(--fs-lg); font-weight: 720; letter-spacing: -.025em; }
.sumbar .spacer { flex: 1 1 auto; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--sp-3); margin-bottom: var(--sp-3); }
.toolbar .tabs { margin: 0; }
.page-actions.tabs { gap: 4px; }

/* 11.4 Turno y cuadre */
.kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; margin-bottom: var(--sp-5); }
@media (min-width: 1200px) { .kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 480px) { .kpis { grid-template-columns: 1fr; } }
.kpis.three { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.kpi {
  display: flex; flex-direction: column; gap: 5px; min-width: 0; padding: 17px 19px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-3); box-shadow: var(--sh-1);
}
a.kpi { color: inherit; text-decoration: none; transition: border-color .12s ease, box-shadow .12s ease; }
a.kpi:hover { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand), var(--sh-1); }
.kpi-label { color: var(--muted); font-size: var(--fs-xs); font-weight: 700; letter-spacing: .07em; text-transform: uppercase; }
.kpi-value { color: #15283f; font-size: var(--fs-kpi); font-weight: 720; line-height: 1.1; letter-spacing: -.035em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.kpi-value.text { font-size: var(--fs-lg); letter-spacing: -.01em; white-space: normal; }
.kpi-value small { font-size: var(--fs-md); font-weight: 600; color: var(--muted); letter-spacing: 0; }
.kpi-note { font-size: var(--fs-sm); color: var(--muted); }
.kpi.warn { background: var(--warn-bg); border-color: var(--warn-line); }
.kpi.warn .kpi-value, .kpi.warn .kpi-label { color: var(--warn); }
.kpi.bad { background: var(--bad-bg); border-color: var(--bad-line); }
.kpi.bad .kpi-value, .kpi.bad .kpi-label { color: var(--bad); }
.kpi.ok .kpi-value { color: var(--ok); }
.kpi.hero { background: var(--navy); border-color: var(--navy); color: #ffffff; box-shadow: inset 0 3px 0 var(--gold), var(--sh-1); }
.kpi.hero .kpi-value { color: #ffffff; }
.kpi.hero .kpi-label, .kpi.hero .kpi-note, .kpi.hero .kpi-value small { color: var(--navy-text); }

.price-now { margin: 2px 0 var(--sp-3); color: #15283f; font-size: 42px; font-weight: 720; line-height: 1.1; letter-spacing: -.035em; font-variant-numeric: tabular-nums; }
.price-now small { margin-left: 4px; font-size: var(--fs-lg); font-weight: 600; color: var(--muted); letter-spacing: 0; }

.bars { display: grid; gap: var(--sp-3); margin: 0; padding: 0; list-style: none; }
.bars li { margin: 0; }
.bars-top { display: flex; justify-content: space-between; gap: var(--sp-2); margin-bottom: 6px; font-size: var(--fs-sm); font-variant-numeric: tabular-nums; }
.calc { display: grid; margin: 0; }
.calc > div { display: flex; justify-content: space-between; align-items: baseline; gap: var(--sp-3); padding: 9px 0; font-variant-numeric: tabular-nums; }
.calc > div + div { border-top: 1px solid var(--line); }
.calc dt { color: var(--ink-2); font-size: var(--fs-sm); }
.calc dd { margin: 0; font-weight: 650; white-space: nowrap; }
.calc .calc-note dt, .calc .calc-note dd { color: var(--muted); font-size: var(--fs-sm); font-weight: 500; }
.calc > .calc-total { border-top: 2px solid var(--ink) !important; padding-top: 12px; }
.calc > .calc-total dt { font-weight: 700; color: var(--ink); font-size: var(--fs-md); }
.calc > .calc-total dd { font-size: var(--fs-xl); font-weight: 750; letter-spacing: -.025em; }
.todo { margin: 0; padding: 0; list-style: none; }
.todo li { display: flex; align-items: flex-start; gap: 10px; margin: 0; padding: 8px 0; font-size: var(--fs-sm); }
.todo li + li { border-top: 1px solid var(--warn-line); }
.todo svg.i { color: #9b7116; margin-top: 1px; flex: none; }
.card.pending { display: flex; flex-wrap: wrap; align-items: flex-start; gap: var(--sp-2) var(--sp-5); padding: var(--sp-3) 18px; }
.card.pending h2 { display: flex; align-items: center; gap: 8px; margin: 8px 0; font-size: var(--fs-md); color: var(--warn); }
.card.pending .todo { flex: 1 1 420px; }
.shift-hero { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: var(--sp-3) var(--sp-5); }
.shift-hero h2 { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: 0; font-size: var(--fs-xl); }
.shift-facts { display: flex; flex-wrap: wrap; gap: 9px 24px; margin: 11px 0 0; padding: 11px 13px; background: var(--surface-2); border-radius: var(--r-2); }
.shift-facts > div { display: flex; flex-direction: column; gap: 3px; }
.shift-facts dt { color: var(--muted); font-size: var(--fs-xs); font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.shift-facts dd { margin: 0; font-size: var(--fs-sm); font-weight: 650; }
@media (max-width: 700px) { .shift-hero { grid-template-columns: 1fr; } }

/* 11.5 Alarmas */
.alarm-list {
  margin: 0 0 var(--sp-4); padding: 0; list-style: none; overflow: hidden;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-3); box-shadow: var(--sh-1);
}
.alarm-item {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: var(--sp-4);
  margin: 0; padding: 14px 18px;
}
.alarm-item + .alarm-item { border-top: 1px solid #e6ebf1; margin-top: 0; }
.alarm-sev { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 11px; flex: none; }
.alarm-item.sev-critica .alarm-sev { background: var(--bad-bg); color: var(--bad); }
.alarm-item.sev-advertencia .alarm-sev { background: var(--warn-bg); color: #9b7116; }
.alarm-item.sev-info .alarm-sev { background: var(--info-bg); color: var(--info); }
.alarm-title { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; font-size: var(--fs-sm); font-weight: 700; color: var(--ink); }
.alarm-code { font-family: var(--mono); font-size: 12px; font-weight: 600; color: var(--muted); letter-spacing: .02em; }
.alarm-meta { margin-top: 3px; color: var(--muted); font-size: var(--fs-sm); }
.alarm-side { display: flex; align-items: center; gap: var(--sp-3); }
.alarm-side form { margin: 0; }
.alarm-item.is-acked { background: var(--surface-2); }
.alarm-item.is-acked .alarm-title { color: var(--muted); }

/* 11.6 Ingreso y configuración inicial: la pantalla partida de la central ----
   Izquierda: panel azul noche con el escudo y el titular. Derecha: la tarjeta
   blanca del formulario. Lo de la estación (fichas de usuario y teclado del
   PIN) va dentro de esa tarjeta, con los mismos campos y botones. */
/* El reparto es el de la central (.92fr / 1.08fr = 46 % / 54 %). Por debajo de
   1366 px el panel derecho se ensancha, porque la estación mete ahí las fichas
   de usuario y el teclado del PIN, que la central no tiene. */
.login-page { display: grid; grid-template-columns: minmax(340px, .92fr) minmax(460px, 1.08fr); min-height: 100vh; background: #fff; }
.login-story {
  position: relative; display: flex; flex-direction: column; justify-content: space-between;
  min-height: 100vh; padding: clamp(28px, 4vw, 60px); overflow: hidden; color: #fff;
  background:
    radial-gradient(circle at 75% 20%, rgba(18, 104, 232, .34), transparent 34%),
    radial-gradient(circle at 12% 90%, rgba(199, 149, 40, .11), transparent 28%),
    linear-gradient(150deg, #0a315b 0%, #041426 72%);
}
.login-story::after {
  content: ''; position: absolute; right: -170px; bottom: -180px; width: 520px; height: 520px;
  border: 1px solid rgba(255, 255, 255, .055); border-radius: 50%;
  box-shadow: 0 0 0 75px rgba(255, 255, 255, .018), 0 0 0 150px rgba(255, 255, 255, .012);
}
.login-wordmark { position: relative; z-index: 1; display: flex; align-items: center; }
.login-wordmark img { display: block; width: 168px; height: auto; }
.story-copy { position: relative; z-index: 1; max-width: 560px; }
/* Mismo tamaño en pantalla que el titular de la central: allá la raíz es de
   14 px y usa clamp(2.5rem, 4.7vw, 4.5rem); aquí la raíz es de 16 px. */
.story-copy h1 { max-width: 540px; margin: 12px 0 16px; color: #fff; font-size: clamp(2.2rem, 4.7vw, 3.95rem); font-weight: 720; line-height: 1.04; letter-spacing: -.055em; }
.story-copy p { max-width: 480px; color: #b8cde3; font-size: var(--fs-md); line-height: 1.7; }
.private-label { position: relative; z-index: 1; display: flex; align-items: flex-start; gap: 9px; color: #9bb5cf; font-size: var(--fs-sm); line-height: 1.5; }
.private-label svg.i { color: #75bdff; flex: none; }

.login-panel { display: grid; place-items: center; padding: 32px; background: linear-gradient(155deg, #fff 0%, #f4f8fd 100%); }
.login-card { display: flex; flex-direction: column; gap: var(--sp-4); width: 100%; max-width: 700px; }
.login-card.slim { max-width: 460px; }
.login-heading { display: flex; flex-direction: column; gap: 5px; margin-bottom: 2px; }
.login-heading h1 { margin: 3px 0 0; font-size: 2rem; letter-spacing: -.04em; }
.login-heading p { margin: 4px 0 0; color: var(--muted); line-height: 1.5; }
.login-lock { display: grid; place-items: center; width: 44px; height: 44px; margin-bottom: 6px; color: var(--brand); background: var(--brand-soft); border-radius: 12px; }
.login-mobile-brand { display: none; }
.login-form { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(250px, .75fr); gap: var(--sp-5); align-items: start; }
.login-help { margin: 0; color: var(--muted); font-size: var(--fs-sm); line-height: 1.5; text-align: center; }
.local-portal-link {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; align-self: center;
  min-height: 38px; padding: 5px 10px; color: var(--brand-text); border-radius: 8px;
  font-size: var(--fs-sm); font-weight: 700; text-decoration: none;
}
.local-portal-link:hover { background: var(--brand-soft); }
.local-portal-link svg.i:last-child { width: 15px; height: 15px; }

.step { margin-bottom: var(--sp-4); }
.step:last-child { margin-bottom: 0; }
.step-label { display: flex; align-items: center; gap: 10px; margin: 0 0 var(--sp-3); font-size: var(--fs-sm); font-weight: 750; color: #53677e; }
.step-no {
  display: grid; place-items: center; flex: none; width: 24px; height: 24px;
  border-radius: 8px; background: var(--brand-soft); color: var(--brand-text);
  border: 1px solid #c9def9; font-size: 12px; font-weight: 800;
}
.user-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(196px, 1fr)); gap: var(--sp-2); }
.user-tile { position: relative; display: block; margin: 0; }
.user-tile input { position: absolute; top: 0; left: 0; width: 1px; height: 1px; opacity: 0; }
.user-tile .tile {
  position: relative; display: flex; align-items: center; gap: 11px; min-height: 58px; padding: 9px 36px 9px 11px;
  border: 1px solid var(--line-ctl); border-radius: 11px; background: var(--surface); cursor: pointer;
  transition: border-color .15s ease, background .15s ease;
}
.user-tile .tile:hover { border-color: #a8c9f5; background: var(--brand-soft); }
.user-tile .avatar { background: var(--surface-3); color: var(--ink-2); border-color: var(--line-2); }
.user-tile input:checked + .tile { border-color: var(--brand); background: var(--brand-soft); box-shadow: inset 0 0 0 1px var(--brand); }
.user-tile input:checked + .tile .avatar { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
/* Marca de elegido: no depende solo del color del borde */
.user-tile input:checked + .tile::after {
  content: ""; position: absolute; top: 50%; right: 17px; width: 7px; height: 14px; margin-top: -9px;
  border-right: 3px solid var(--brand-text); border-bottom: 3px solid var(--brand-text); transform: rotate(45deg);
}
.user-tile input:focus + .tile { outline: 3px solid var(--brand); outline-offset: 2px; }
.tile-name { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; font-weight: 700; font-size: var(--fs-sm); }
.tile-name small { color: var(--muted); font-weight: 500; font-size: var(--fs-xs); }
.pin-side { display: flex; flex-direction: column; }
input.pin-field {
  height: 58px; text-align: center; font-family: var(--mono); font-size: 28px; letter-spacing: .45em;
  background: var(--surface-2);
}
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-2); margin-top: var(--sp-3); }
/* Teclas con borde inferior más grueso: se ven como teclas aun con reflejo de sol */
.key {
  display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 58px;
  border: 1px solid var(--line-ctl); border-bottom-width: 3px; border-radius: var(--r-2); background: var(--surface);
  color: var(--ink); font: inherit; font-size: 24px; font-weight: 700; font-variant-numeric: tabular-nums; cursor: pointer;
}
.key:hover { background: var(--brand-soft); border-color: #a8c9f5; }
.key:active { background: var(--surface-3); border-bottom-width: 1px; }
.key.fn { background: var(--surface-2); color: var(--ink-2); font-size: var(--fs-md); }
.key.go { background: var(--brand-grad); border-color: var(--brand); color: var(--brand-ink); font-size: var(--fs-md); box-shadow: 0 2px 4px rgba(10, 79, 185, .14); }
.key.go:hover { background: var(--brand-dark); border-color: var(--brand-dark); }

/* Ingreso desde fuera de la estación (§8.6): contraseña en vez de teclado del PIN. */
.remote-side { gap: var(--sp-2); }
.remote-side input[type=password] { margin-bottom: var(--sp-2); }
.remote-side .btn { margin-top: 0; }

/* Cambiar PIN: tarjeta angosta centrada. Formularios de una columna: ancho de lectura cómodo. */
.narrow-card { max-width: 560px; margin: 0 auto; }
.form-card { max-width: 760px; }

/* 11.7 Usuarios, personas, estado vacío, llaves ambiguas y maestros */
.person { display: flex; align-items: center; gap: 10px; min-width: 0; }
.person .avatar { width: 32px; height: 32px; border-radius: 9px; }
.person-name { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.person-name strong { color: #203650; white-space: nowrap; }
.person-name small { color: var(--muted); font-size: var(--fs-xs); white-space: nowrap; }
.avatar.xl { width: 52px; height: 52px; border-radius: 15px; font-size: 19px; background: var(--navy); color: #ffffff; border-color: var(--navy); box-shadow: 0 8px 22px rgba(3, 20, 41, .18); }
.page-head .person { gap: var(--sp-4); }
.role { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-sm); font-weight: 650; }
.role svg.i { width: 17px; height: 17px; color: var(--muted); }
.role.admin { color: #5f438b; }
.role.admin svg.i { color: #5f438b; }
.stack-chips { display: flex; flex-wrap: wrap; gap: 4px 6px; }

/* Estado vacío */
.empty { display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 34px 18px; text-align: center; color: var(--muted); }
.empty svg.i { width: 36px; height: 36px; stroke-width: 1.5; color: var(--line-2); }
.empty strong { color: #52615b; font-size: var(--fs-md); }
.empty .btn { margin-top: var(--sp-3); }
.card > .empty { padding: 26px 18px; }
.empty.ok svg.i { color: #1aab77; }

/* Llaves ambiguas (islero) */
.choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: var(--sp-3); }
.choices form { margin: 0; }
.choices .btn { flex-direction: column; width: 100%; min-height: 80px; margin: 0; font-size: var(--fs-md); }

/* Búsqueda principal de maestros */
.master-search { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--sp-3); }
.master-search .grow { flex: 1 1 320px; margin: 0; font-size: var(--fs-sm); font-weight: 650; color: #53677e; }
.master-search .btn { margin: 0; }
.master-search .grow > select { margin-top: 6px; }
.search-field { position: relative; display: block; margin-top: 6px; }
.search-field > svg.i { position: absolute; top: 50%; left: 12px; z-index: 1; width: 18px; height: 18px; color: var(--muted); transform: translateY(-50%); }
.search-field > input { padding-left: 40px; }

/* Alta de llave: espera del toque */
.touch-wait { display: flex; align-items: center; gap: var(--sp-4); }
.touch-wait .pulse-ring {
  display: grid; place-items: center; flex: none; width: 60px; height: 60px;
  border-radius: 50%; background: var(--st-call); color: var(--st-call-ink); animation: ring 1.8s ease-out infinite;
}
.touch-wait .pulse-ring svg.i { width: 28px; height: 28px; }
.touch-wait h2, .card .touch-wait h2 { margin: 0 0 4px; }
.touch-wait p { margin: 0; }
@keyframes ring { 0% { box-shadow: 0 0 0 0 rgba(217, 140, 5, .5); } 80% { box-shadow: 0 0 0 16px rgba(217, 140, 5, 0); } 100% { box-shadow: 0 0 0 0 rgba(217, 140, 5, 0); } }

/* Páginas de error */
.error-card { max-width: 620px; margin: var(--sp-6) auto; text-align: center; }
.error-card .error-ico {
  display: grid; place-items: center; width: 64px; height: 64px; margin: 0 auto var(--sp-4);
  border-radius: 18px; background: var(--bad-bg); color: var(--bad);
}
.error-card .error-ico svg.i { width: 32px; height: 32px; }
.error-card h1 { margin-bottom: var(--sp-3); }
.error-card .flash { justify-content: center; text-align: left; }
.error-card .btn { margin-top: var(--sp-2); }

/* 12. Responsive ------------------------------------------------------------
   <= 1000 px (tablet): la barra lateral baja y se vuelve barra INFERIOR, con
   blancos grandes para el dedo. Es lo único que cambia frente a la central,
   que ahí abre un cajón lateral: el islero trabaja de pie y con una mano. */
/* Ingreso y configuración inicial: de mayor a menor, que la última gana.
   De 1366 px para abajo el panel del formulario se lleva más ancho: si no, las
   fichas de usuario caen a una sola columna y el ingreso obliga a desplazar. */
@media (max-width: 1366px) {
  .login-page { grid-template-columns: minmax(280px, .8fr) minmax(440px, 1.2fr); }
  .login-card { max-width: 760px; }
}
@media (max-width: 1199px) {
  .shift-who, .hide-md { display: none; }
}
@media (max-width: 1100px) {
  .login-page { grid-template-columns: minmax(260px, .76fr) minmax(420px, 1.24fr); }
}
@media (max-width: 1080px) {
  .login-form { grid-template-columns: minmax(0, 1fr); }
  .login-card { max-width: 480px; }
  .pin-side { max-width: 340px; }
}
@media (max-width: 1000px) {
  .shell { display: block; padding-bottom: 78px; }
  .sidebar {
    position: fixed; inset: auto 0 0 0; z-index: 40;
    flex-direction: row; align-items: center; gap: 4px;
    height: auto; padding: 8px 10px; overflow-x: auto; overflow-y: hidden;
    box-shadow: 0 -4px 18px rgba(4, 20, 38, .22);
  }
  .sidebar .brand, .privacy-note, .nav-caption { display: none; }
  .station-chip { flex: none; margin: 0 6px 0 0; padding: 8px 10px; }
  .station-chip span:not(.status-dot), .station-chip > svg.i { display: none; }
  .nav-groups { flex: none; flex-direction: row; gap: 4px; min-height: 0; overflow: visible; }
  .side-nav { flex-direction: row; gap: 4px; }
  .nav-link {
    flex: none; flex-direction: column; justify-content: center; gap: 3px;
    min-width: 76px; min-height: 60px; padding: 7px 10px; font-size: 12.5px; text-align: center;
  }
  .nav-link .nav-text { flex: none; justify-content: center; gap: 4px; }
  .nav-link .count { margin-left: 0; }
  .user-card { flex: none; grid-template-columns: auto auto auto; gap: 4px; margin-left: 6px; padding: 0 0 0 8px; border-top: 0; border-left: 1px solid rgba(255, 255, 255, .12); }
  .user-copy { display: none; }
  .icon-btn { width: 44px; height: 44px; }
  .topbar-brand { display: grid; }
  main.content { padding: 22px 16px 32px; }
  /* Con doce secciones la barra inferior no cabe en 800 px y hay que arrastrarla.
     Este velo en el borde derecho es la única pista de que hay más: sin él el
     último renglón queda cortado y parece un defecto. No tapa el toque. */
  body.app .shell::after {
    content: ""; position: fixed; right: 0; bottom: 0; z-index: 41;
    width: 30px; height: 76px; pointer-events: none;
    background: linear-gradient(90deg, rgba(4, 20, 38, 0), var(--navy-deep) 80%);
  }
  /* Tablet: blancos de dedo aunque el equipo diga «pointer: fine» (un kiosco
     Windows con mouse conectado lo dice, y ahí se toca la pantalla igual). */
  .btn, .btn.small, .tab, .seg-opt span, a.crumb, .icon-btn { min-height: 48px; }
  .btn.small { padding: 5px 13px; }
  .btn.big { min-height: 60px; }
  .key { min-height: 64px; }
  .icon-btn { width: 48px; height: 48px; }
  input[type=text], input[type=password], input[type=number], input[type=search], input[type=tel],
  input[type=datetime-local], input[type=date], select { min-height: 48px; }
  .check, form.stack label.check { min-height: 48px; }
}
@media (max-width: 980px) {
  .login-page { grid-template-columns: 1fr; }
  .login-story { display: none; }
  .login-panel { min-height: 100vh; padding: 24px 18px 40px; }
  .login-card, .login-card.slim { max-width: 460px; }
  .pin-side { max-width: none; }
  .login-mobile-brand { display: flex; align-items: center; justify-content: center; width: 116px; min-height: 78px; margin-bottom: 14px; padding: 8px; background: var(--navy); border-radius: 12px; }
  .login-mobile-brand img { display: block; width: 96px; height: auto; }
}
@media (max-width: 860px) {
  .topbar { flex-wrap: wrap; min-height: 0; padding: 8px 16px; }
  .topbar-status { width: 100%; overflow-x: auto; }
  table.list th, table.list td { padding-left: 10px; padding-right: 10px; }
}
@media (max-width: 700px) {
  :root { --fs-2xl: 24px; --fs-lcd: 34px; --fs-kpi: 26px; }
  .faces { grid-template-columns: 1fr; }
  .alarm-item { grid-template-columns: auto minmax(0, 1fr); padding: 14px; }
  .alarm-side { grid-column: 2; }
  .kv-list dt { width: 100%; }
  .disp-mode { align-items: flex-start; text-align: left; }
  .user-tiles { grid-template-columns: 1fr; }
  table.kv th { width: 45%; }
  .page-head { align-items: stretch; flex-direction: column; }
}
@media (pointer: coarse) {
  .btn.small, .tab, .seg-opt span, .nav-link, a.crumb, .icon-btn { min-height: var(--touch); }
  .btn.small { padding: 5px 13px; }
  .icon-btn { width: var(--touch); }
  .key { min-height: 64px; }
  .btn.big { min-height: 60px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition: none !important; }
}

/* 13. Impresión ------------------------------------------------------------- */
@media print {
  .sidebar, .topbar, .banner, form, .btn, .page-actions, .tabs, .pager { display: none !important; }
  body, .shell { display: block; background: #ffffff; }
  main.content { padding: 0; }
  .card, .table-wrap, .kpi { box-shadow: none; break-inside: avoid; }
  .kpi.hero { background: #ffffff; color: #000000; border-color: #000000; box-shadow: none; }
  .kpi.hero .kpi-label, .kpi.hero .kpi-note, .kpi.hero .kpi-value { color: #000000; }
}

/* 14. Oficina (§16): paginación y barras de filtros ------------------------- */
/* Lo único que las pantallas de maestros, turnos, cartera y reportes no
   encontraron ya hecho arriba. Todo lo demás (tarjetas, tablas, pestañas,
   campos, insignias, KPI) es el mismo de la central, sin tocar. */
.pager {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: var(--sp-2) var(--sp-4); margin: 0 0 var(--sp-4);
}
.pager-nav { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); }
.pager-nav .btn { margin: 0; }
/* Barra de filtros: como .master-search, pero con varios campos angostos. */
.filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--sp-3); }
.filters > label {
  flex: 0 1 180px; margin: 0; font-size: var(--fs-sm); font-weight: 650; color: #53677e;
}
.filters > label.grow { flex: 1 1 300px; }
.filters > label > input, .filters > label > select, .filters > label > .search-field { margin-top: 6px; }
.filters .btn { margin: 0; }
.filters .spacer { flex: 1 1 auto; }

/* Con Turnos, Cartera y Reportes el administrador ve 15 renglones en la barra lateral, y en una
   pantalla de 900 px de alto (el portátil de la oficina) ya no caben sin desplazarla. Se adelanta a
   1000 px el MISMO apretado que la hoja ya hacía a 860/880 px; por encima de eso no cambia nada. */
@media (max-height: 1000px) {
  .privacy-note { display: none; }
  .sidebar { padding-top: 16px; }
  .sidebar .brand img { width: 104px; }
  .sidebar .brand-sub { display: none; }
  .station-chip { margin-bottom: 12px; }
  .nav-caption { margin: 7px 10px 4px; }
  .side-nav { gap: 2px; }
  .nav-link { min-height: 36px; padding: 5px 11px; }
}
/* Y en 800/768 px de alto (el portátil de 1366x768 y la captura de escritorio) los 15 renglones del
   administrador siguen sin caber ni con lo de arriba: «Equipos» quedaba partido y «Usuarios» solo
   aparecía arrastrando una lista que no parece arrastrable. Se aprieta un punto más, y SOLO con ratón
   (``pointer: fine``): en una tablet acostada el renglón se queda en los 36 px de arriba, que ya es el
   mínimo cómodo para el dedo. */
@media (max-height: 860px) and (pointer: fine) {
  .sidebar { padding-top: 12px; }
  .sidebar .brand img { width: 88px; }
  .sidebar .brand { margin-bottom: 10px; }
  .station-chip { margin-bottom: 8px; }
  .nav-caption { margin: 5px 10px 3px; }
  .nav-link { min-height: 32px; padding: 3px 11px; }
}

/* 15. Caras con aspecto de surtidor (§ docs/diseno-ui/surtidor) --------------
   Encargo de Harry: la pantalla Caras deja de ser tarjetas y se ve como el
   surtidor real (cuerpo azul, marco gris, placa con el número, LCD gris
   verdoso con tres renglones rotulados y dígitos de siete segmentos, manguera
   y pistola), con el display en verde mientras despacha.
   - Todo lo nuevo lleva prefijo .sur- (y .sl-/.sg dentro de los dibujos), así
     no choca con nada de arriba. Lo demás (chip, alarm, btn, face-meta, plate)
     se reutiliza tal cual.
   - El dibujo es SVG en línea: dos capas superpuestas sobre .sur-machine.
     · .sur-art  -> la máquina y el contenido del LCD. Se repinta en cada
       sondeo de htmx (cada 2 s), por eso NO lleva animación.
     · .sur-live -> aro, halo, manguera y pistola. Va con hx-preserve, htmx la
       conserva entre sondeos y la animación de "despachando" no se reinicia.
       Su marcado es idéntico en todos los estados: lo que cambia es esta hoja,
       que cuelga de la clase de estado de la tarjeta (.st-busy, .st-call...).
   - El color nunca va solo: el estado sale con ícono + texto en la columna de
     datos y escrito en la banda de la máquina.
   =========================================================================== */
.faces { grid-template-columns: repeat(auto-fit, minmax(400px, 1fr)); }

.sur {
  /* Tonos del surtidor real. Se redefinen por estado más abajo. */
  --sur-steel: #ccd4dd; --sur-steel-hi: #e8edf2; --sur-steel-dark: #9aa6b4;
  --sur-blue: #16307e; --sur-blue-dark: #0c1a4d; --sur-blue-edge: #3355b8;
  --sur-lcd: #b3c3ac; --sur-lcd-frame: #67715f;
  --sur-seg: #22301c; --sur-seg-off: rgba(34, 48, 28, .13);
  --sur-lcd-ink: rgba(34, 48, 28, .88); /* rótulos del LCD; con .78 quedaban en 4,6:1, al filo de AA */
  --sur-ring: var(--line-2); --sur-ring-w: 2.5;
  --sur-banner: rgba(255, 255, 255, .13); --sur-banner-ink: #d9e5ff;
  --sur-state: var(--st-idle-ink);
  display: grid; grid-template-columns: minmax(160px, 230px) minmax(0, 1fr);
  gap: var(--sp-4); align-items: start; min-width: 0;
  padding: 10px var(--sp-4) var(--sp-3);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-3);
  box-shadow: var(--sh-1);
}
/* Libre: el display se atenúa (la última venta queda visible, como en el surtidor) */
.sur.st-idle {
  --sur-state: #33455c; --sur-lcd: #aab9a4; --sur-seg: #333f2c; --sur-seg-off: rgba(51, 63, 44, .12);
  --sur-lcd-ink: rgba(34, 48, 28, .92); /* con .78 los rótulos quedaban en 4,4:1 (AA pide 4,5) */
}
.sur.st-call {
  --sur-ring: var(--st-call); --sur-ring-w: 4; --sur-state: var(--st-call-text);
  --sur-banner: #d98c05; --sur-banner-ink: #2a1c00;
  border-color: var(--st-call);
}
.sur.st-busy {
  /* Despachando: el LCD se enciende en verde. Se tiene que ver desde lejos. */
  --sur-lcd: #29dd80; --sur-lcd-frame: #0b5a33;
  --sur-seg: #042c17; --sur-seg-off: rgba(4, 44, 23, .16); --sur-lcd-ink: rgba(4, 44, 23, .8);
  --sur-ring: var(--st-busy); --sur-ring-w: 4.5; --sur-state: var(--st-busy-text);
  --sur-banner: #0e7c3a; --sur-banner-ink: #ffffff;
  border-color: var(--st-busy);
}
.sur.st-done {
  --sur-lcd: #dcecff; --sur-lcd-frame: #46557a;
  --sur-seg: #1b2742; --sur-seg-off: rgba(27, 39, 66, .14); --sur-lcd-ink: rgba(27, 39, 66, .75);
  --sur-ring: var(--st-done); --sur-ring-w: 4; --sur-state: var(--st-done-text);
  --sur-banner: #6b3fc0; --sur-banner-ink: #ffffff;
  border-color: var(--st-done);
}
/* Sin comunicación: pantalla rayada y apagada. Los demás estados raros (no autorizada,
   detenida, desconocido) mantienen el display legible, pero con el marco rojo. */
.sur.st-bad, .sur.st-warn {
  --sur-ring: var(--st-fail); --sur-ring-w: 4; --sur-state: var(--st-fail-text);
  --sur-banner: #b23731; --sur-banner-ink: #ffffff;
  border-color: var(--st-fail);
}
.sur.st-bad {
  --sur-lcd: #454b52; --sur-lcd-frame: #2b3037;
  --sur-seg: #6d747c; --sur-seg-off: rgba(255, 255, 255, .06);
  --sur-lcd-ink: rgba(255, 255, 255, .78); /* con .6 los rótulos quedaban en 4,5:1 justo */
}

/* 15.1 El dibujo ------------------------------------------------------------ */
.sur-machine { position: relative; width: 100%; max-width: 230px; margin: 0 auto; }
.sur-art, .sur-live-art { display: block; width: 100%; height: auto; overflow: visible; }
.sur-live { position: absolute; top: 0; right: 0; bottom: 0; left: 0; pointer-events: none; }
.sur-live-art { height: 100%; }

.sur-shadow { fill: rgba(7, 29, 55, .12); }
.sur-steel { fill: var(--sur-steel); }
.sur-steel-hi { fill: var(--sur-steel-hi); }
.sur-steel-dark { fill: var(--sur-steel-dark); }
.sur-cab { fill: var(--sur-blue); }
.sur-cab-dark { fill: var(--sur-blue-dark); }
.sur-cab-edge { fill: var(--sur-blue-edge); }
.sur-vent { stroke: rgba(255, 255, 255, .18); stroke-width: 2; fill: none; }
/* Cuna de la pistola: hueco claro, para que el pico oscuro se vea contra el azul */
.sur-boot { fill: rgba(255, 255, 255, .12); stroke: rgba(0, 0, 0, .35); stroke-width: 1.5; }
.sur-brand { font: 800 14px/1 var(--font); letter-spacing: 1.2px; fill: #23364f; }
.sur-door-tx { font: 700 12px/1 var(--font); letter-spacing: .6px; fill: rgba(255, 255, 255, .5); text-anchor: end; }
.sur-plate { fill: #ffffff; stroke: #9aa6b4; stroke-width: 1; }
.sur-plate-cap { font: 700 10px/1 var(--font); letter-spacing: 1px; fill: #5d6c81; }
.sur-plate-no { font: 800 30px/1 var(--font); fill: #111111; text-anchor: end; }

.sur-lcd-frame { fill: var(--sur-lcd-frame); }
.sur-lcd-screen { fill: var(--sur-lcd); }
.sur-lcd-line { stroke: rgba(0, 0, 0, .12); stroke-width: 1; fill: none; }
.sur-lcd-hatch { stroke: rgba(255, 255, 255, .12); stroke-width: 3; fill: none; display: none; }
.sur.st-bad .sur-lcd-hatch { display: block; }
/* Rótulos del display. El largo ("PRECIO POR GALÓN") va en cuerpo menor en vez de
   comprimido: comprimido se volvía una mancha. El pie no lleva opacidad encima de
   la tinta translúcida (bajaba el contraste por debajo de AA). */
.sur-lbl, .sur-lbl-sm { font: 700 8.5px/1 var(--font); letter-spacing: .2px; fill: var(--sur-lcd-ink); }
.sur-lbl-sm { font-size: 7.4px; letter-spacing: .1px; }
.sur-cap { font: 600 8.5px/1 var(--font); letter-spacing: .2px; fill: var(--sur-lcd-ink); }
.sur-banner { fill: var(--sur-banner); }
.sur-banner-tx { font: 800 13px/1 var(--font); letter-spacing: 1.3px; fill: var(--sur-banner-ink); text-anchor: middle; }
/* Siete segmentos: los apagados quedan a la vista, como en el LCD de verdad. */
.sur-art .sg { fill: var(--sur-seg-off); }
.sur-art .sg.on { fill: var(--sur-seg); }

/* 15.2 Capa viva: aro de estado, manguera, pistola y animación -------------- */
.sl-ring { fill: none; stroke: var(--sur-ring); stroke-width: var(--sur-ring-w); }
.sl-halo { fill: none; stroke: var(--st-busy); stroke-width: 9; opacity: 0; }
.sl-scan { fill: rgba(255, 255, 255, .85); opacity: 0; }
.sl-hose { fill: none; stroke: #16181c; stroke-width: 9; stroke-linecap: round; }
.sl-flow { fill: none; stroke: #4be79a; stroke-width: 4; stroke-linecap: round; stroke-dasharray: 9 26; opacity: 0; }
.sl-nz-neck, .sl-nz-spout { fill: #23272e; }
.sl-nz-body { fill: #f2b719; stroke: #b5850a; stroke-width: 1.5; }
.sl-nz-trigger { fill: none; stroke: #2b3038; stroke-width: 4; stroke-linecap: round; }
.sl-nozzle { transform-origin: 97px 248px; transition: transform .35s ease-out; }
/* Pistola descolgada: esperando llave y despachando */
.sur.st-call .sl-nozzle, .sur.st-busy .sl-nozzle { transform: translate(-11px, 20px) rotate(-13deg); }
.sur.st-busy .sl-halo { opacity: 1; animation: sur-breathe 2.2s ease-in-out infinite; }
.sur.st-busy .sl-scan { opacity: 1; animation: sur-scan 1.9s ease-in-out infinite alternate; }
.sur.st-busy .sl-flow { opacity: 1; animation: sur-flow .9s linear infinite; }
.sur.st-busy .sl-nozzle { animation: sur-sway 2.6s ease-in-out infinite; }
/* La manguera NO se mueve: giraba sobre su boca mientras la pistola se mecía aparte, así
   que la punta se despegaba de la pistola; y repintar una curva de 9 px de grueso en cada
   cuadro es lo más caro del dibujo (la pantalla corre en un PC modesto y en tabletas).
   El movimiento de la manguera lo da el combustible que corre por dentro (.sl-flow). */
.sur.st-call .sl-ring { animation: sur-ring 1.6s ease-in-out infinite; }
@keyframes sur-breathe { 0%, 100% { opacity: .22; } 50% { opacity: .85; } }
@keyframes sur-scan { from { transform: translateX(0); } to { transform: translateX(124px); } }
@keyframes sur-flow { to { stroke-dashoffset: -35; } }
@keyframes sur-sway {
  0%, 100% { transform: translate(-11px, 20px) rotate(-13deg); }
  50% { transform: translate(-13px, 22px) rotate(-10deg); }
}
@keyframes sur-ring { 50% { stroke-opacity: .35; } }
/* Sin movimiento: el verde y el aro se quedan, pero quietos (§WCAG 2.3.3). El § 12 ya
   deja toda animación en .01 ms; aquí se apagan de frente las de esta pantalla para que
   no dependan de esa regla y no haya ni el parpadeo de la primera vuelta. */
@media (prefers-reduced-motion: reduce) {
  .sur .sl-halo, .sur .sl-ring, .sur .sl-nozzle, .sur .sur-state svg.i { animation: none; }
  .sur.st-busy .sl-halo { opacity: .6; }
  .sur .sl-scan, .sur .sl-flow { display: none; }
}

/* 15.3 Columna de datos ---------------------------------------------------- */
.sur-info { display: flex; flex-direction: column; gap: var(--sp-3); min-width: 0; padding-top: var(--sp-2); }
.sur-state {
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin: 0;
  color: var(--sur-state); font-size: var(--fs-xl); font-weight: 800; line-height: 1.1;
}
.sur-state svg.i { flex: none; width: 26px; height: 26px; }
.sur-state-tx { text-transform: uppercase; letter-spacing: .04em; }
.sur-since { color: var(--muted); font-size: var(--fs-sm); font-weight: 600; letter-spacing: 0; text-transform: none; }
.sur.st-call .sur-state svg.i { animation: blink 1.6s ease-in-out infinite; }
.sur-note {
  display: flex; align-items: flex-start; gap: 8px; margin: 0;
  color: var(--ink-2); font-size: var(--fs-sm);
}
.sur-note svg.i { flex: none; width: 18px; height: 18px; margin-top: 1px; color: var(--muted); }
.sur-note.ok { color: var(--ok); }
.sur-note.ok svg.i { color: var(--ok); }
.sur-note.bad { color: var(--bad); }
.sur-note.bad svg.i { color: var(--bad); }
.sur-info .face-meta { margin-top: auto; }
.sur-info .face-callout { min-height: 0; }
.sur-info .alarm { margin: 0; }

/* 15.4 Tamaños: tablet 800x1280 y PC 1280x800 / 1440x900 -------------------- */
@media (min-width: 1500px) {
  .sur { grid-template-columns: minmax(190px, 300px) minmax(0, 1fr); }
  .sur-machine { max-width: 300px; }
}
/* PC de 1280/1366: dos caras por fila, surtidor un poco menor para que quepan los datos.
   El estado baja un punto de cuerpo: a 1280 "ESPERANDO LLAVE" se partía en dos renglones
   y empujaba todo lo de abajo. */
@media (min-width: 861px) and (max-width: 1400px) {
  .sur { grid-template-columns: minmax(140px, 202px) minmax(0, 1fr); }
  .sur-machine { max-width: 202px; }
  .sur-state { font-size: var(--fs-md); }
  .sur-state svg.i { width: 21px; height: 21px; }
}
/* Tablet vertical: una cara por fila, y el surtidor más grande (se mira de pie) */
@media (max-width: 860px) {
  .faces { grid-template-columns: minmax(0, 1fr); }
  .sur { grid-template-columns: minmax(180px, 320px) minmax(0, 1fr); }
  .sur-machine { max-width: 320px; }
}
@media (max-width: 520px) {
  .sur { grid-template-columns: minmax(0, 1fr); }
  .sur-machine { max-width: 210px; }
  .sur-info { padding-top: 0; }
}
/* Tablet: blancos de 48 px sin mover el texto de sitio */
@media (pointer: coarse) {
  .sur-info .face-meta a, .sur-info .sur-note a {
    display: inline-block; padding: 12px 6px; margin: -12px -6px;
  }
  .sur-info a.chip { min-height: var(--touch); }
}
