/* ══════════════════════════════════════════════════════════════════════════
   Sistema de diseño — staff app (fase 1; paleta Vapor «Opción D», nov-2026)

   Una sola hoja para toda la app. Antes cada una de las 48 plantillas
   redefinía su paleta en un <style> propio (45 :root, 77 colores hex
   distintos), así que un cambio de color eran 45 cambios y nunca quedaban
   iguales.

   Reglas:
   - Las páginas nuevas extienden `_base.html` y NO definen :root ni colores
     hex: usan estos tokens. `tests/test_design_system.py` lo comprueba.
   - Los nombres viejos (--bg, --bg-card, --text, --muted, --accent, --green,
     --red, --yellow, --border…) se conservan para que `_nav.html` funcione
     igual dentro de las páginas nuevas. Verde, ámbar, rojo y gris están
     oscurecidos respecto a la paleta vieja: los anteriores no llegaban a
     contraste AA sobre blanco.
   - El color de marca del tenant entra por `--brand` (inline en <html>);
     `--accent` se deriva de él.
   - El color significa algo: verde = en meta, ámbar = bajo el ritmo,
     rojo = requiere acción. Nada se colorea por decoración.
   ══════════════════════════════════════════════════════════════════════════ */

@font-face {
  font-family: "Manrope"; font-style: normal; font-display: swap; font-weight: 200 800;
  src: url("fonts/manrope-latin-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC,
                 U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
                 U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Manrope"; font-style: normal; font-display: swap; font-weight: 200 800;
  src: url("fonts/manrope-latin-ext-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF,
                 U+1E00-1E9F, U+20A0-20AB, U+20AD-20C0, U+A720-A7FF;
}

/* Tokens de la «Opción D» (nov-2026): la paleta de Vapor. Morado de marca
   #4B1A78 (entra como --brand desde brand(request); éste es el respaldo),
   barra superior morado oscuro, acento amarillo para lo que pide atención en
   la barra, superficies lavanda y texto morado casi negro. Manrope sigue
   auto-alojada. Verde/ámbar/rojo de TEXTO oscurecidos para llegar a AA. */
:root {
  --brand: #4B1A78;
  /* Controles nativos (casillas, select, fechas, scroll) en el tema que toca. */
  color-scheme: light;

  /* superficies (lavanda) */
  --bg: #FAF8FC;
  --bg-card: #FFFFFF;
  --bg-input: #FFFFFF;
  --bg-row: #F3EDF9;
  --bg-sunken: #EBE3F4;
  --border: #E8E0F0;
  --border-in: #D9CDE6;

  /* texto */
  --text: #1F1630;
  --muted: #6B5F7D;
  --sub: #6B5F7D;

  /* marca: se oscurece en claro para que el texto blanco alcance AA. */
  --accent: color-mix(in srgb, var(--brand) 88%, #000);
  --accent-h: color-mix(in srgb, var(--brand) 86%, #000);
  --accent-soft: color-mix(in srgb, var(--brand) 10%, transparent);
  --on-accent: #FFFFFF;

  /* acento amarillo de Vapor: contadores, foco en la barra, lo que pide un toque */
  --accent-2: #F4B400;
  --on-accent-2: #1F1630;
  --accent-2-soft: color-mix(in srgb, var(--accent-2) 18%, transparent);

  /* barra superior oscura */
  --topbar-bg: #2D1450;
  --on-topbar: #FFFFFF;
  --topbar-muted: #CBB8E3;
  --topbar-hover: rgba(255, 255, 255, .08);
  --topbar-active: rgba(255, 255, 255, .16);
  --topbar-line: rgba(255, 255, 255, .12);

  /* estado */
  --green: #15803D;
  --green-soft: #DCFCE7;
  --yellow: #A16207;
  --yellow-soft: #FEF9C3;
  --red: #DC2626;
  --red-soft: #FEE2E2;
  --amber: #B45309;
  --orange: #C2410C;
  --blue: #2563EB;
  --blue-soft: #DBEAFE;
  /* Texto sobre los fondos suaves de estado: --red/--blue no llegan a 4.5:1
     sobre su -soft en claro (3.95 y 4.24), y van con texto de 11–12px. */
  --red-on-soft: #B91C1C;
  --blue-on-soft: #1D4ED8;
  --orange-soft: #FFEDD5;
  --indigo: #4F46E5;
  --bg-section: var(--bg-row);

  /* espacio (pasos de 4) */
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 20px; --s6: 24px; --s8: 32px;

  /* radios */
  --r-sm: 8px; --r-md: 10px; --r-lg: 16px; --r-xl: 20px; --r-pill: 999px;

  /* tipografía */
  --font: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, monospace;
  --t-xs: .75rem; --t-sm: .875rem; --t-md: 1rem; --t-lg: 1.25rem; --t-xl: 1.75rem;

  --shadow: none;
  --shadow-pop: 0 12px 32px rgba(31, 22, 48, .14);
  --shadow-sm: 0 1px 3px rgba(31, 22, 48, .12);
  /* Velo detrás de un cajón, hoja o diálogo. */
  --scrim: rgba(15, 9, 25, .5);
  --tap: 44px;
  /* Ya no hay barra inferior: la navegación vive arriba (ver shell.css). */
  --nav-h: 0px;
  --side-w: 248px;
}

/* Oscuro: la misma paleta de noche. El morado de marca no se lee sobre fondo
   oscuro, así que el acento se aclara y el texto sobre él pasa a oscuro. */
html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #140D1F;
  --bg-card: #1E1530;
  --bg-input: #181026;
  --bg-row: #261B3B;
  --bg-sunken: #2F2347;
  --border: #33264A;
  --border-in: #4A3B66;
  --text: #F5F0FB;
  --muted: #C9BDDA;
  --sub: #A99CC0;
  --accent: color-mix(in srgb, var(--brand) 45%, #fff);
  --accent-h: color-mix(in srgb, var(--brand) 38%, #fff);
  --accent-soft: color-mix(in srgb, var(--brand) 30%, transparent);
  --on-accent: #1F1630;
  --topbar-bg: #0F0919;
  --topbar-muted: #A99CC0;
  --green: #4ADE80;
  --green-soft: rgba(74, 222, 128, .14);
  --yellow: #FACC15;
  --yellow-soft: rgba(250, 204, 21, .14);
  --red: #F87171;
  --red-soft: rgba(248, 113, 113, .14);
  --amber: #FBBF24;
  --orange: #FB923C;
  --orange-soft: rgba(251, 146, 60, .14);
  --blue: #60A5FA;
  --blue-soft: rgba(96, 165, 250, .14);
  --red-on-soft: #F87171;
  --blue-on-soft: #60A5FA;
  --scrim: rgba(5, 2, 10, .62);
  --shadow: none;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font);
  font-size: var(--t-md);
  line-height: 1.45;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px) + var(--s4));
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); }
img, svg { display: block; }
button, input, select, textarea { font: inherit; color: inherit; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: var(--r-sm); }

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

/* ─── Iconos (sprite /static/icons.svg) ───────────────────────────────────── */
.icon { width: 20px; height: 20px; flex-shrink: 0; stroke: currentColor; fill: none;
        stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; display: inline-block; }
.icon-sm { width: 16px; height: 16px; }
.icon-lg { width: 28px; height: 28px; }

/* ─── Layout ──────────────────────────────────────────────────────────────── */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: var(--s3);
  padding: var(--s3) var(--s4);
  padding-top: calc(var(--s3) + env(safe-area-inset-top, 0px));
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  min-height: 64px;
}
.topbar-brand { display: flex; align-items: center; gap: var(--s2); min-width: 0; flex: 1; }
.topbar-brand img { width: 28px; height: 28px; border-radius: var(--r-sm); object-fit: cover; }
.topbar-title { font-size: var(--t-md); font-weight: 800; letter-spacing: -.01em; color: var(--text);
                white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-sub { font-size: var(--t-xs); color: var(--muted); }

.page { max-width: 640px; margin: 0 auto; padding: var(--s5) var(--s4); }
.page-wide { max-width: 1080px; }

.page-head { margin-bottom: var(--s5); }
.page-head h1 { font-size: 1.5rem; font-weight: 700; line-height: 1.25; letter-spacing: -.01em; }
.page-head p { color: var(--muted); font-size: var(--t-sm); margin-top: var(--s1); }

.stack { display: flex; flex-direction: column; gap: var(--s3); }
.row { display: flex; align-items: center; gap: var(--s3); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s3); }
.spacer { flex: 1; }

/* ─── Tarjeta ─────────────────────────────────────────────────────────────── */
.card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: var(--s4); box-shadow: var(--shadow);
}
.card + .card { margin-top: var(--s3); }
.card-title { font-size: var(--t-md); font-weight: 700; color: var(--text); margin-bottom: var(--s4);
              display: flex; align-items: center; gap: var(--s2); }
.card-title .icon { color: var(--muted); }
.card-title .spacer + a { text-transform: none; letter-spacing: 0; font-weight: 600; text-decoration: none; }
.card-link { display: block; text-decoration: none; color: inherit; }
.card-link:hover { border-color: var(--accent); }

.section-title { font-size: var(--t-md); font-weight: 700; color: var(--text); margin: var(--s6) 0 var(--s3); }

/* ─── KPI: un número por tarjeta ──────────────────────────────────────────── */
.kpi { display: flex; flex-direction: column; gap: 2px; }
.kpi-value { font-size: var(--t-xl); font-weight: 700; line-height: 1.1;
             font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.kpi-label { font-size: var(--t-xs); color: var(--muted); }
.kpi-delta { font-size: var(--t-xs); font-weight: 650; }
/* KPI del kit: ícono en círculo arriba, número grande, etiqueta y variación en píldora */
.kpi-icon { width: 40px; height: 40px; border-radius: var(--r-pill); display: grid; place-items: center;
            background: var(--bg-row); border: 1px solid var(--border); color: var(--text); margin-bottom: var(--s3); }
.kpi-row { display: flex; align-items: center; gap: var(--s2); flex-wrap: wrap; }
.delta { display: inline-flex; align-items: center; gap: 2px; padding: 2px 8px; border-radius: var(--r-sm);
         font-size: var(--t-xs); font-weight: 600; background: var(--green-soft); color: var(--green); }
.delta.is-down { background: var(--red-soft); color: var(--red); }
.is-good { color: var(--green); }
.is-warn { color: var(--yellow); }
.is-bad { color: var(--red); }

/* ─── Anillo de progreso (SVG, ver macro en _ui.html) ─────────────────────── */
.ring { position: relative; width: 132px; height: 132px; flex-shrink: 0; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring-track { stroke: var(--bg-sunken); }
.ring-fill { stroke: var(--accent); stroke-linecap: round;
             transition: stroke-dashoffset .6s cubic-bezier(.32,.72,0,1); }
.ring.is-good .ring-fill { stroke: var(--green); }
.ring.is-warn .ring-fill { stroke: var(--yellow); }
.ring-label { position: absolute; inset: 0; display: flex; flex-direction: column;
              align-items: center; justify-content: center; text-align: center; }
.ring-label strong { font-size: 1.75rem; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.ring-label span { font-size: var(--t-xs); color: var(--muted); margin-top: 2px; }

/* ─── Barra de meta ───────────────────────────────────────────────────────── */
.bar { height: 8px; background: var(--bg-sunken); border-radius: var(--r-pill); overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--accent); border-radius: inherit;
           transition: width .6s cubic-bezier(.32,.72,0,1); }
.bar.is-good > i { background: var(--green); }
.bar.is-warn > i { background: var(--yellow); }
.bar.is-bad > i { background: var(--red); }

/* ─── Chips de estado ─────────────────────────────────────────────────────── */
.chip { display: inline-flex; align-items: center; gap: var(--s1); padding: 2px 10px;
        border-radius: var(--r-pill); font-size: var(--t-xs); font-weight: 650;
        border: 1px solid transparent; white-space: nowrap; }
.chip-neutral { background: var(--bg-row); color: var(--muted); border-color: var(--border); }
.chip-good { background: var(--green-soft); color: var(--green); }
.chip-warn { background: var(--yellow-soft); color: var(--yellow); }
.chip-bad { background: var(--red-soft); color: var(--red-on-soft); }
.chip-brand { background: var(--accent-soft); color: var(--accent); }
/* Estados no concluyentes (parcial, sin sesión POS): ni bien ni mal todavía. */
.chip-info { background: var(--blue-soft); color: var(--blue-on-soft); }
.chip-orange { background: var(--orange-soft); color: var(--orange); }

/* ─── Listas y filas ──────────────────────────────────────────────────────── */
.list { display: flex; flex-direction: column; }
.list-item { display: flex; align-items: center; gap: var(--s3); padding: var(--s3) 0;
             border-bottom: 1px solid var(--border); text-decoration: none; color: inherit;
             min-height: var(--tap); }
.list-item:last-child { border-bottom: none; }
.list-main { flex: 1; min-width: 0; }
.list-title { font-size: var(--t-sm); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-sub { font-size: var(--t-xs); color: var(--muted); margin-top: 2px; }
.list-end { text-align: right; font-variant-numeric: tabular-nums; }

/* Ranking */
.rank { width: 28px; height: 28px; border-radius: var(--r-pill); display: grid; place-items: center;
        font-size: var(--t-xs); font-weight: 800; background: var(--bg-row); color: var(--muted); flex-shrink: 0; }
.rank-1 { background: var(--accent); color: var(--on-accent); }
.rank-2, .rank-3 { background: var(--accent-soft); color: var(--accent); }
.list-item.is-me { background: var(--accent-soft); margin: 0 calc(var(--s3) * -1);
                   padding-left: var(--s3); padding-right: var(--s3); border-radius: var(--r-md); }

/* ─── Botones ─────────────────────────────────────────────────────────────── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--s2);
       min-height: var(--tap); padding: 0 var(--s5); border-radius: var(--r-md);
       font-size: var(--t-sm); font-weight: 600; text-decoration: none; cursor: pointer;
       border: 1px solid var(--border-in); background: var(--bg-card); color: var(--text);
       transition: background .15s, border-color .15s; }
.btn:hover { border-color: var(--accent); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: var(--accent-h); border-color: var(--accent-h); }
.btn-danger { color: var(--red); border-color: color-mix(in srgb, var(--red) 40%, transparent); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--accent); }
.btn-block { width: 100%; }
.btn-sm { min-height: 32px; padding: 0 var(--s3); font-size: var(--t-xs); }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

/* ─── Formularios ─────────────────────────────────────────────────────────── */
.field { display: flex; flex-direction: column; gap: var(--s1); margin-bottom: var(--s4); }
.field label { font-size: var(--t-xs); font-weight: 650; color: var(--muted); }
.field .hint { font-size: var(--t-xs); color: var(--sub); }
/* <label class="field">Texto <input></label>: el texto es la etiqueta. */
label.field { font-size: var(--t-xs); font-weight: 650; color: var(--muted); }
label.field .input, label.field .select { font-weight: 400; color: var(--text); }
label.field .small { font-weight: 400; }
fieldset.field { border: 0; padding: 0; margin: 0 0 var(--s4); min-width: 0; }
fieldset.field legend { font-size: var(--t-xs); font-weight: 650; color: var(--muted); padding: 0; margin-bottom: var(--s2); }
.check { display: flex; align-items: center; gap: var(--s2); padding: var(--s1) 0; font-size: var(--t-sm); color: var(--text); font-weight: 400; }
.check input { width: 18px; height: 18px; flex-shrink: 0; accent-color: var(--accent); }
.list-title.wrap { white-space: normal; overflow: visible; }
.input, .select, .textarea {
  width: 100%; min-height: var(--tap); padding: var(--s2) var(--s3);
  background: var(--bg-input); border: 1px solid var(--border-in); border-radius: var(--r-md);
  font-size: var(--t-md); /* 16px: iOS no hace zoom al enfocar */
}
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft); }
.textarea { min-height: 96px; resize: vertical; }

/* ─── Tabla (admin) ───────────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--bg-card); }
.table { width: 100%; border-collapse: collapse; font-size: var(--t-sm); }
.table th { text-align: left; font-size: var(--t-xs); font-weight: 600; color: var(--muted);
            padding: var(--s3) var(--s4); border-bottom: 1px solid var(--border); background: var(--bg-row); white-space: nowrap; }
.table td { padding: var(--s3) var(--s4); border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: none; }
.num { text-align: right; font-variant-numeric: tabular-nums; }

/* ─── Avisos, toast y estados ─────────────────────────────────────────────── */
.notice { display: flex; gap: var(--s3); align-items: flex-start; padding: var(--s3) var(--s4);
          border-radius: var(--r-md); font-size: var(--t-sm); border: 1px solid var(--border);
          background: var(--bg-card); margin-bottom: var(--s3); }
.notice-good { background: var(--green-soft); border-color: transparent; }
.notice-warn { background: var(--yellow-soft); border-color: transparent; }
.notice-bad { background: var(--red-soft); border-color: transparent; }
.notice-brand { background: var(--accent-soft); border-color: transparent; }

.toast { position: fixed; left: 50%; bottom: calc(var(--nav-h) + var(--s4) + env(safe-area-inset-bottom, 0px));
         transform: translateX(-50%); z-index: 300; background: var(--text); color: var(--bg);
         padding: var(--s3) var(--s5); border-radius: var(--r-pill); font-size: var(--t-sm);
         font-weight: 600; box-shadow: 0 8px 24px rgba(0,0,0,.18); animation: toastIn .2s ease; }
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 8px); } }

.empty { text-align: center; padding: var(--s8) var(--s4); color: var(--muted); font-size: var(--t-sm); }
.empty .icon { margin: 0 auto var(--s3); width: 32px; height: 32px; color: var(--sub); }

.skeleton { background: linear-gradient(90deg, var(--bg-row) 25%, var(--bg-sunken) 50%, var(--bg-row) 75%);
            background-size: 200% 100%; animation: shimmer 1.2s infinite; border-radius: var(--r-sm);
            min-height: 1em; }
@keyframes shimmer { to { background-position: -200% 0; } }

.muted { color: var(--muted); }
.small { font-size: var(--t-xs); }
.strong { font-weight: 700; }
.tabular { font-variant-numeric: tabular-nums; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ─── Segmentado (semana / mes) ───────────────────────────────────────────── */
.segmented { display: inline-flex; background: var(--bg-sunken); border-radius: var(--r-md); padding: 3px; gap: 2px; }
.segmented a, .segmented button { padding: 6px var(--s4); border-radius: calc(var(--r-md) - 3px); border: none;
  min-height: var(--tap); display: inline-flex; align-items: center; justify-content: center;
  background: transparent; font-size: var(--t-xs); font-weight: 650; color: var(--muted); text-decoration: none; cursor: pointer; }
.segmented .on { background: var(--bg-card); color: var(--text); box-shadow: var(--shadow); }

/* Premium operativa: jerarquía, densidad y estados compartidos. */
.skip-link { position: fixed; top: 8px; left: 8px; z-index: 1000; padding: 12px 16px;
  background: var(--text); color: var(--bg); border-radius: var(--r-md); transform: translateY(-160%); }
.skip-link:focus { transform: translateY(0); }
.page-head { display: flex; flex-direction: column; gap: 6px; margin-bottom: var(--s6); }
.page-head h1 { font-size: clamp(1.65rem, 3vw, 2.2rem); letter-spacing: -.045em; line-height: 1.12; }
.page-head p { max-width: 68ch; line-height: 1.6; }
.eyebrow { color: var(--accent) !important; font-size: var(--t-xs); font-weight: 750; letter-spacing: .02em; }
.kpi-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s3); }
.kpi-grid .card, .kpi-grid .kpi { min-width: 0; margin: 0; }
.filter-bar { display: flex; flex-wrap: wrap; align-items: end; gap: var(--s3); padding: var(--s4);
  margin-bottom: var(--s4); background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--r-lg); }
.filter-bar .field { flex: 1 1 160px; margin: 0; }
.stale-data { display: flex; gap: var(--s2); align-items: center; padding: var(--s3) var(--s4);
  color: var(--yellow); background: var(--yellow-soft); border-radius: var(--r-md); font-size: var(--t-sm); }
.stale-data[hidden] { display: none; }
.operation-progress { position: sticky; bottom: calc(var(--nav-h) + var(--s3)); z-index: 15;
  display: flex; align-items: center; gap: var(--s4); padding: var(--s4); background: var(--bg-card);
  border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-pop); }
.operation-progress progress { flex: 1; accent-color: var(--accent); }
.action-summary { align-self: start; }
/* El reset `* { margin: 0 }` le quitaba al <dialog> modal el `margin: auto` con que
   el navegador lo centra: las ventanas salían pegadas arriba a la izquierda. */
dialog { margin: auto; color: var(--text); background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--r-xl); box-shadow: var(--shadow-pop); padding: 0; }
dialog::backdrop { background: var(--scrim); }
.search-dialog { width: min(620px, calc(100% - 32px)); max-height: min(680px, 80vh); margin-top: 12vh; }
.search-head { display: flex; align-items: center; gap: var(--s3); padding: var(--s4); border-bottom: 1px solid var(--border); }
.search-head input { flex: 1; min-width: 0; min-height: var(--tap); border: 0; outline: 0; background: transparent; font: inherit; }
/* El campo vive sin borde, pero el foco de teclado se ve: anillo sólido. */
.search-head input:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: var(--r-sm); }
.search-results { overflow-y: auto; padding: var(--s2); max-height: 55vh; }
.search-results a { display: flex; align-items: center; gap: var(--s3); padding: var(--s3); min-height: var(--tap);
  color: var(--text); border-radius: var(--r-md); text-decoration: none; }
.search-results a:hover, .search-results a:focus-visible { background: var(--bg-row); }
.search-results small { margin-left: auto; color: var(--muted); }
.card { border-color: color-mix(in srgb, var(--border) 82%, transparent); }
.btn, .input, .select, .textarea { transition: border-color .16s ease, background .16s ease, box-shadow .16s ease, transform .16s ease; }
.btn:active { transform: translateY(1px); }
@media (min-width: 760px) { .kpi-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

/* Reglas generales que antes vivían junto a las clases de las pantallas viejas
   (.header, .container, .row-card, .heat, .cell…). Esas clases se quitaron
   cuando la última pantalla pasó a _base.html (nov-2026). */
.kpi { border-radius: var(--r-lg); }
.kpi-value { font-variant-numeric: tabular-nums; letter-spacing: -.04em; }
input, select, textarea { accent-color: var(--accent); }
button { min-height: var(--tap); }
@media (min-width: 1024px) { .kpi { padding: 16px 12px; text-align: left; } }
/* Foco visible con color SÓLIDO: el anillo al 35 % daba ~2:1 contra el fondo,
   por debajo del 3:1 que pide WCAG para un indicador de foco. */
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

@media (min-width: 900px) {
  .page { padding-top: var(--s6); }
}
@media (min-width: 1024px) {
  /* El kit usa el ancho: contenido a la izquierda, junto a la barra lateral. */
  .page { max-width: 1040px; margin: 0; padding: var(--s8) var(--s8) var(--s6); }
  .page-wide { max-width: 1240px; }
  /* El logo ya está en la barra lateral: sin acciones propias, la barra de
     arriba sobra en escritorio. */
  .topbar-brand { display: none; }
  .topbar:not(:has(> :not(.topbar-brand))) { display: none; }
}

/* ══════════════════════════════════════════════════════════════════════════
   Opción D (nov-2026): bandeja de pendientes, columna de estado e inicio del
   vendedor. Componentes compartidos: cualquier pantalla migrada los usa.
   ══════════════════════════════════════════════════════════════════════════ */

/* Contenido + columna derecha de estado (se apila en el teléfono). */
.layout-split { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s5); align-items: start; }
@media (min-width: 1100px) { .layout-split { grid-template-columns: minmax(0, 1fr) 320px; } }
.side-col { display: flex; flex-direction: column; gap: var(--s3); }
.side-col .card + .card { margin-top: 0; }

/* Etiqueta de tipo: qué clase de cosa es (Descuadre, Inventario…). */
.tag { display: inline-flex; align-items: center; gap: var(--s1); padding: 2px 8px; border-radius: var(--r-sm);
  font-size: 11px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase;
  background: var(--bg-row); color: var(--muted); }
.tag-bad { background: var(--red-soft); color: var(--red-on-soft); }
.tag-warn { background: var(--yellow-soft); color: var(--yellow); }
.tag-brand { background: var(--accent-soft); color: var(--accent); }
.tag-good { background: var(--green-soft); color: var(--green); }

/* Bandeja: una tarjeta = una cosa que pide a alguien, con UN botón. */
.inbox { display: flex; flex-direction: column; gap: var(--s3); list-style: none; padding: 0; }
.inbox-card { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s2); padding: var(--s4);
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--r-lg);
  border-left: 4px solid var(--border-in); }
.inbox-card.inbox-bad { border-left-color: var(--red); }
.inbox-card.inbox-warn { border-left-color: var(--accent-2); }
.inbox-meta { display: flex; align-items: center; gap: var(--s2); flex-wrap: wrap; font-size: var(--t-xs); color: var(--muted); }
.inbox-title { font-size: var(--t-md); font-weight: 750; line-height: 1.3; }
.inbox-detail { font-size: var(--t-sm); color: var(--muted); line-height: 1.45; }
.inbox-action { justify-self: start; }
@media (min-width: 700px) {
  .inbox-card { grid-template-columns: minmax(0, 1fr) auto; align-items: center; column-gap: var(--s4); }
  .inbox-card > .inbox-action { grid-column: 2; grid-row: 1 / span 3; justify-self: end; }
}

/* Filas de estado compactas (columna derecha). */
.status-list { list-style: none; padding: 0; margin: 0; }
.status-row { display: flex; align-items: center; gap: var(--s3); padding: var(--s2) 0;
  border-bottom: 1px solid var(--border); min-height: var(--tap); }
.status-row:last-child { border-bottom: 0; }
.status-dot { width: 10px; height: 10px; border-radius: var(--r-pill); background: var(--border-in); flex-shrink: 0; }
.status-dot.is-good { background: var(--green); }
.status-dot.is-warn { background: var(--amber); }  /* el amarillo de marca da 1.85:1 sobre blanco */
.status-dot.is-bad { background: var(--red); }
.status-dot.is-orange { background: var(--orange); }
.status-dot.is-info { background: var(--blue); }
.status-dot.is-brand { background: var(--accent); }

/* Inicio del vendedor. */
.hello { margin-bottom: var(--s5); }
.hello h1 { font-size: clamp(1.5rem, 5vw, 2rem); letter-spacing: -.035em; line-height: 1.15; }
.hello p { color: var(--muted); font-size: var(--t-sm); margin-top: var(--s1); }
.big-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(100px, 1fr)); gap: var(--s3); margin-bottom: var(--s5); }
.big-action { display: flex; flex-direction: column; justify-content: space-between; gap: var(--s3);
  min-height: 104px; padding: var(--s4); border-radius: var(--r-lg); text-decoration: none;
  background: var(--bg-card); color: var(--text); border: 1px solid var(--border);
  font-weight: 800; font-size: var(--t-sm); line-height: 1.2; }
@media (min-width: 600px) { .big-action { font-size: var(--t-md); min-height: 120px; } }
.big-action .icon { width: 28px; height: 28px; color: var(--accent); }
.big-action:hover { border-color: var(--accent); }
.big-action-primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.big-action-primary .icon { color: var(--accent-2); }
.big-action-primary:hover { background: var(--accent-h); }

.tasks { list-style: none; padding: 0; margin: 0; }
.task { display: flex; align-items: center; gap: var(--s3); padding: var(--s3) 0; border-bottom: 1px solid var(--border); }
.task:last-child { border-bottom: 0; }
.task-check { width: 26px; height: 26px; border-radius: var(--r-pill); border: 2px solid var(--border-in);
  display: grid; place-items: center; flex-shrink: 0; color: var(--on-accent); }
.task-check .icon { width: 16px; height: 16px; }
.task.is-done .task-check { background: var(--green); border-color: var(--green); }
.task.is-info .task-check { border-style: dashed; }
.task.is-done .task-label { color: var(--muted); text-decoration: line-through; }
.task-body { flex: 1; min-width: 0; }
.task-label { font-size: var(--t-sm); font-weight: 700; }
.task-detail { font-size: var(--t-xs); color: var(--muted); margin-top: 2px; }
.task-detail.is-warn { color: var(--yellow); }
.task-detail.is-bad { color: var(--red); }
.progress-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s3); margin-bottom: var(--s2); }
/* En una rejilla las tarjetas no se separan con margen: lo hace el gap. */
.grid-2 > .card, .layout-split .card { margin-top: 0; }
/* …pero dos tarjetas apiladas en una misma columna del split sí se separan
   (si la columna es un .stack, manda su gap: ver la regla de .stack más abajo). */
.layout-split > * > .card + .card { margin-top: var(--s3); }

/* ══════════════════════════════════════════════════════════════════════════
   Componentes compartidos que pidieron las pantallas migradas (integración
   del rediseño, nov-2026). Antes vivían repetidos en el bloque head de cada
   pantalla con su prefijo (cie-, cc-, ep-, gar-, inv-, acc-, erp-…).
   ══════════════════════════════════════════════════════════════════════════ */

/* Utilidades: lo que el JS oculta con classList.toggle('hidden') o [hidden]. */
.hidden, [hidden] { display: none !important; }
/* .card + .card suma su margen al gap de .stack: dentro de una pila manda el gap. */
.stack > .card + .card { margin-top: 0; }

/* Botones que faltaban: verde de aprobar y rojo sólido para lo irreversible. */
.btn-success { background: var(--green); border-color: var(--green); color: var(--on-accent); }
.btn-success:hover { border-color: var(--green); filter: brightness(1.06); }
.btn-danger-solid { background: var(--red); border-color: var(--red); color: var(--on-accent); }
.btn-danger-solid:hover { border-color: var(--red); filter: brightness(1.06); }
/* Compacto pero táctil: texto chico, alto de dedo (para el vendedor). */
.btn-compact { min-height: var(--tap); padding: 0 var(--s3); font-size: var(--t-xs); }

/* Segmentado con altura táctil, a todo el ancho. */
.segmented-lg { display: flex; width: 100%; }
.segmented-lg a, .segmented-lg button { flex: 1; min-height: var(--tap); font-size: var(--t-sm);
  display: inline-flex; align-items: center; justify-content: center; }

/* Chips de filtro (píldoras con enlace o botón y estado .on / aria-pressed). */
.filter-chips { display: flex; flex-wrap: wrap; gap: var(--s2); }
.filter-chip { display: inline-flex; align-items: center; gap: var(--s1); min-height: var(--tap); padding: 0 var(--s4);
  border-radius: var(--r-pill); border: 1px solid var(--border-in); background: var(--bg-card); color: var(--muted);
  font-size: var(--t-xs); font-weight: 650; text-decoration: none; cursor: pointer; white-space: nowrap; font-family: inherit; }
.filter-chip:hover { border-color: var(--accent); color: var(--text); }
.filter-chip.on, .filter-chip[aria-pressed="true"], .filter-chip[aria-current="true"],
.filter-chip[aria-current="page"] { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }

/* Clave / valor: <dl class="kv"><div class="kv-row"><dt>…</dt><dd>…</dd></div></dl>
   (también vale .k / .v en un div). Etiqueta a la izquierda, valor a la derecha. */
.kv { margin: 0; }
.kv-row { display: flex; justify-content: space-between; align-items: baseline; gap: var(--s3);
  padding: var(--s2) 0; border-bottom: 1px dashed var(--border); font-size: var(--t-sm); }
.kv-row:last-child { border-bottom: 0; }
.kv-row > dt, .kv-row > .k { color: var(--muted); flex: 0 1 auto; min-width: 0; }
.kv-row > dd, .kv-row > .v { margin: 0; font-weight: 650; text-align: right; overflow-wrap: anywhere;
  font-variant-numeric: tabular-nums; min-width: 0; }
/* Dos columnas fijas: la etiqueta ocupa 38 % y el valor va a la izquierda. */
.kv-cols .kv-row > dt, .kv-cols .kv-row > .k, .kv-row.kv-cols > dt, .kv-row.kv-cols > .k { flex: 0 0 38%; }
.kv-cols .kv-row > dd, .kv-cols .kv-row > .v, .kv-row.kv-cols > dd, .kv-row.kv-cols > .v { flex: 1; text-align: left; }

/* Zona para subir fotos: <label class="upload"> con el input file oculto. */
.upload { position: relative; display: flex; align-items: center; gap: var(--s3); min-height: var(--tap);
  padding: var(--s3) var(--s4); border: 1px dashed var(--border-in); border-radius: var(--r-md);
  background: var(--bg-input); cursor: pointer; font-size: var(--t-sm); font-weight: 600; color: var(--text); }
.upload:hover { border-color: var(--accent); }
.upload:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.upload .icon { color: var(--accent); }
.upload small { display: block; font-weight: 400; color: var(--muted); font-size: var(--t-xs); }
.upload input[type="file"] { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; }
.upload-files { display: flex; flex-wrap: wrap; gap: var(--s1); margin-top: var(--s2); list-style: none; padding: 0; }
.upload-files:empty { display: none; }
/* Un input file suelto con la clase .input. */
.input[type="file"] { padding: var(--s2); font-size: var(--t-sm); cursor: pointer; }

/* Fila de monto: etiqueta a la izquierda y $ + número alineado a la derecha. */
.money-rows { display: flex; flex-direction: column; }
.money-row { display: flex; align-items: center; gap: var(--s3); padding: var(--s2) 0; border-bottom: 1px solid var(--border); }
.money-row:last-child { border-bottom: 0; }
.money-row > label { flex: 1; min-width: 0; font-size: var(--t-sm); font-weight: 600; color: var(--text); }
.money-row > label span { font-weight: 400; color: var(--muted); font-size: var(--t-xs); }
.money { display: flex; align-items: stretch; width: 140px; flex-shrink: 0; }
.money > span { display: grid; place-items: center; padding: 0 var(--s3); font-weight: 700; color: var(--accent);
  background: var(--bg-sunken); border: 1px solid var(--border-in); border-right: 0; border-radius: var(--r-md) 0 0 var(--r-md); }
.money .input { border-radius: 0 var(--r-md) var(--r-md) 0; text-align: right; font-variant-numeric: tabular-nums; min-width: 0; }

/* Stepper de cantidad: − valor + (botones redondos de 44px). */
.stepper { display: flex; align-items: center; gap: var(--s1); flex-shrink: 0; }
.stepper-btn { width: var(--tap); height: var(--tap); border-radius: var(--r-pill); border: 1px solid var(--border-in);
  background: var(--bg-input); color: var(--text); font-size: var(--t-lg); line-height: 1;
  display: grid; place-items: center; cursor: pointer; padding: 0; }
.stepper-btn:hover { border-color: var(--accent); color: var(--accent); }
.stepper-val { min-width: 32px; text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; }

/* Selector de opción grande: tarjetas seleccionables (.sel o aria-pressed). */
.choice-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: var(--s2); }
.choice { min-height: var(--tap); text-align: left; cursor: pointer; font: inherit; color: var(--text);
  padding: var(--s3) var(--s4); border: 2px solid var(--border-in); border-radius: var(--r-md); background: var(--bg-input); }
.choice:hover { border-color: var(--accent); }
.choice b { display: block; font-size: var(--t-sm); margin-bottom: 2px; }
.choice span { display: block; font-size: var(--t-xs); color: var(--muted); line-height: 1.45; }
.choice.sel, .choice.on, .choice[aria-pressed="true"], .choice:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.choice.sel b, .choice.on b, .choice[aria-pressed="true"] b, .choice:has(input:checked) b { color: var(--accent); }
.choice:focus-visible, .choice:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Pastillas tipo radio usables con teclado: <label class="pill-radio"><input
   type="radio" class="visually-hidden"> Texto</label>. */
.pill-radios { display: flex; gap: var(--s2); flex-wrap: wrap; }
.pill-radio { display: inline-flex; align-items: center; gap: var(--s2); min-height: var(--tap); cursor: pointer;
  padding: 0 var(--s4); border: 1px solid var(--border-in); border-radius: var(--r-pill); background: var(--bg-card);
  font-size: var(--t-sm); font-weight: 650; color: var(--text); }
.pill-radio:hover { border-color: var(--accent); }
.pill-radio.selected, .pill-radio.on, .pill-radio:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.pill-radio:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Casilla en tarjeta: label con fondo, borde y una línea de ayuda debajo. */
.check-card { display: flex; align-items: flex-start; gap: var(--s2); padding: var(--s3); min-height: var(--tap);
  margin-bottom: var(--s3); border: 1px solid var(--border); border-radius: var(--r-md); background: var(--bg-row);
  font-size: var(--t-sm); color: var(--text); font-weight: 400; line-height: 1.45; cursor: pointer; }
.check-card input { width: 18px; height: 18px; margin-top: 2px; flex-shrink: 0; accent-color: var(--accent); }
.check-card .hint { display: block; color: var(--muted); font-size: var(--t-xs); font-weight: 400; margin-top: 2px; }

/* Interruptor: <label class="switch"><input type="checkbox"><span class="switch-slider"></span></label>
   El checkbox real cubre todo el control (44px) y conserva el foco. */
.switch { position: relative; display: inline-flex; align-items: center; justify-content: center;
  min-width: var(--tap); min-height: var(--tap); flex-shrink: 0; }
.switch input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.switch-slider { position: relative; width: 46px; height: 26px; border-radius: var(--r-pill);
  background: var(--border-in); transition: background .2s; pointer-events: none; }
.switch-slider::before { content: ""; position: absolute; left: 3px; top: 3px; width: 20px; height: 20px;
  border-radius: var(--r-pill); background: var(--bg-card); transition: transform .2s; }
.switch input:checked + .switch-slider { background: var(--accent); }
.switch input:checked + .switch-slider::before { transform: translateX(20px); }
.switch input:focus-visible + .switch-slider { outline: 2px solid var(--accent); outline-offset: 2px; }
.switch input:disabled { cursor: not-allowed; }
.switch input:disabled + .switch-slider { opacity: .5; }

/* Cabecera de tabla que ordena: un botón dentro del th. */
.table-sort { background: none; border: 0; padding: 0 var(--s1); min-height: var(--tap); font: inherit;
  color: inherit; cursor: pointer; display: inline-flex; align-items: center; gap: 2px; white-space: nowrap; }
.table-sort:hover, .table-sort .sort-ind { color: var(--accent); }
.table-sort:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: var(--r-sm); }

/* Tabla que en el teléfono se vuelve tarjetas: cada td lleva data-label. */
@media (max-width: 720px) {
  .table-stack thead { display: none; }
  .table-stack, .table-stack tbody, .table-stack tr { display: block; }
  .table-stack tr { padding: var(--s2) var(--s4); border-bottom: 1px solid var(--border); }
  .table-stack tr:last-child { border-bottom: 0; }
  .table-stack td { display: flex; justify-content: space-between; align-items: center; gap: var(--s2);
    padding: var(--s2) 0; border-bottom: 0; text-align: right; }
  .table-stack td::before { content: attr(data-label); font-size: var(--t-xs); color: var(--muted); font-weight: 650;
    text-align: left; flex-shrink: 0; }
}

/* Diálogo con formulario: <dialog class="dialog"><div class="dialog-body">…
   <div class="dialog-actions">botones</div></div></dialog>. */
.dialog { width: min(640px, calc(100% - 32px)); max-height: 88vh; }
.dialog-body { padding: var(--s5); overflow-y: auto; }
.dialog-body h2 { font-size: var(--t-lg); margin-bottom: var(--s3); display: flex; gap: var(--s2); align-items: center; }
.dialog-actions { display: flex; gap: var(--s2); flex-wrap: wrap; margin-top: var(--s4); }
.dialog-actions .btn { flex: 1; }

/* Visor de foto ampliada en un <dialog class="lightbox">. */
.lightbox { max-width: 95vw; max-height: 95vh; padding: var(--s2); }
.lightbox img { display: block; max-width: calc(95vw - var(--s6)); max-height: calc(95vh - 80px);
  object-fit: contain; border-radius: var(--r-md); margin: 0 auto; }
.lightbox-bar { display: flex; justify-content: flex-end; gap: var(--s2); margin-bottom: var(--s2); }
.lightbox-close { min-width: var(--tap); }

/* Tarjeta de bandeja con un formulario de varios controles (no UN botón):
   una sola columna también en escritorio. */
.inbox-card.inbox-stack { grid-template-columns: minmax(0, 1fr); }

/* Mapa de calor: celda de estado de 26px dentro de un enlace táctil de 44px,
   con el color del estado del cierre, y su leyenda. Un estado sin regla sale
   transparente —igual que «no hubo cierre»—: tests/test_template_admin_heatmap.py
   recorre el vocabulario de app/storehealth.py contra estas reglas. */
.heat-link { display: inline-grid; place-items: center; width: var(--tap); height: var(--tap);
  border-radius: var(--r-md); text-decoration: none; }
.heat-link:hover { background: var(--bg-row); }
.heat-cell { display: block; width: 26px; height: 26px; border-radius: var(--r-sm); border: 1px solid transparent; }
.heat-cell.ok, .heat-cell.warning { background: var(--green); }
/* El anillo marca «esto lo tocó una persona». */
.heat-cell.approved { background: var(--green); box-shadow: inset 0 0 0 2px var(--bg-card); }
.heat-cell.discrepancy, .heat-cell.error { background: var(--red); }
.heat-cell.flagged { background: var(--red); box-shadow: inset 0 0 0 2px var(--bg-card); }
.heat-cell.sin_verificar { background: var(--orange); }
.heat-cell.parcial { background: var(--blue); }
.heat-cell.no_odoo_session { background: var(--indigo); }
.heat-cell.pending { background: var(--amber); }
.heat-cell.missing { background: transparent; border: 1px dashed var(--border-in); }
.heat-cell.missing_sales { background: var(--yellow-soft); border: 1px dashed var(--amber); }
/* Horarios de atención: ese día la tienda no debía cierre (cerrada por horario,
   o el ERP dice que no abrió). Gris lleno: no es un hueco «sin enviar». */
.heat-cell.cerrado, .heat-cell.no_abrio { background: repeating-linear-gradient(135deg, var(--bg-sunken) 0 4px, var(--border) 4px 6px); border: 1px solid var(--border-in); }
.heat-legend { display: flex; flex-wrap: wrap; gap: var(--s3); margin-top: var(--s3); padding-top: var(--s3);
  border-top: 1px solid var(--border); font-size: var(--t-xs); color: var(--muted); }
.heat-legend span { display: inline-flex; align-items: center; gap: var(--s1); }
.heat-swatch { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.heat-swatch.is-good { background: var(--green); }
.heat-swatch.is-bad { background: var(--red); }
.heat-swatch.is-orange { background: var(--orange); }
.heat-swatch.is-info { background: var(--blue); }
.heat-swatch.is-missing { border: 1px dashed var(--border-in); }
.heat-swatch.is-sales { background: var(--yellow-soft); border: 1px dashed var(--amber); }
.heat-swatch.is-closed { background: repeating-linear-gradient(135deg, var(--bg-sunken) 0 2px, var(--border) 2px 3px); border: 1px solid var(--border-in); }

/* Cabecera con un control a la derecha del título (segmented, botón):
   <div class="page-head page-head-row"><div>eyebrow + h1 + p</div><control></div>.
   En el teléfono el control baja debajo del título (flex-wrap). */
.page-head-row { flex-direction: row; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: var(--s3); }
.page-head-row > div { min-width: 0; }

/* Rejilla de formulario: dos o más columnas de campos en escritorio y una sola
   a 390px (.grid-2 no colapsa). Cada hijo suele ser un label.field. */
.form-grid { display: grid; gap: 0 var(--s3); grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr)); }

/* <ul class="list"> / <ol class="list">: sin viñetas ni sangría del navegador. */
ul.list, ol.list { list-style: none; margin: 0; padding: 0; }

/* Miniatura de 44px al inicio de un list-item (foto de evidencia), o su
   marcador cuando no hay foto: <a class="list-thumb"><img …></a> · <span class="list-thumb list-thumb-empty">icono</span>. */
.list-thumb { display: block; flex-shrink: 0; width: var(--tap); height: var(--tap); border-radius: var(--r-sm); overflow: hidden; }
.list-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.list-thumb-empty { display: grid; place-items: center; background: var(--bg-sunken); color: var(--muted); }

/* ── Teléfono web (CRM fase 3): barra flotante de la llamada ────────────────
   La pinta `_telefono.html` (macro barra) y la mueve `static/telefono.js`.
   Abajo y a lo ancho en el teléfono, tarjeta flotante a la derecha en
   escritorio. `data-tone` = good | warn | bad colorea el punto de estado. */
.callbar { position: fixed; z-index: 250; left: var(--s3); right: var(--s3);
  bottom: calc(var(--nav-h) + var(--s3) + env(safe-area-inset-bottom, 0px));
  background: var(--bg-card); color: var(--text); border: 1px solid var(--border);
  border-radius: var(--r-lg); box-shadow: var(--shadow-pop); padding: var(--s3); }
.callbar[hidden] { display: none; }
@media (min-width: 720px) { .callbar { left: auto; width: 420px; } }
body.has-callbar { padding-bottom: calc(var(--nav-h) + 140px + env(safe-area-inset-bottom, 0px)); }
.callbar-row { display: flex; align-items: center; gap: var(--s3); flex-wrap: wrap; }
.callbar-dot { width: 12px; height: 12px; border-radius: var(--r-pill); background: var(--muted); flex-shrink: 0; }
.callbar[data-tone="good"] .callbar-dot { background: var(--green); }
.callbar[data-tone="warn"] .callbar-dot { background: var(--amber); }
.callbar[data-tone="bad"] .callbar-dot { background: var(--red); }
.callbar-text { display: flex; flex-direction: column; min-width: 0; flex: 1 1 140px; }
.callbar-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.callbar-state { font-size: var(--t-sm); color: var(--muted); font-variant-numeric: tabular-nums; }
.callbar[data-tone="bad"] .callbar-state { color: var(--red); }
.callbar-actions { display: flex; flex-wrap: wrap; gap: var(--s2); }
.callbar-pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s2); margin-top: var(--s3); }
.callbar-pad[hidden] { display: none; }
.callbar-pad .btn { min-height: var(--tap); font-variant-numeric: tabular-nums; }
.callbar-off { display: flex; align-items: flex-start; gap: var(--s2); margin-top: var(--s2); }
