/* Tema del CRM de MoDik: tokens medidos en modik.net (docs/ESTILO-modik.md) sobre los componentes del original.
 *
 * - Oscuro por default (el único de modik.net); `[data-theme="light"]` es un claro derivado aparte, con el naranja
 *   sólo como relleno (como texto sobre blanco no pasa AA) y `--accent-text` oscurecido para texto.
 * - Dos familias separadas (ESTILO, regla 6):
 *     interfaz  → --naranja/--grad (acción y selección), --ok, --bad, --ambar (pendiente o aviso);
 *     dato      → --dato-<grupo> y --dato-s1..s4 (series de gráficas). Dicen a qué grupo pertenece un conductor y
 *                 nunca se usan para botones ni estados de interfaz.
 *   El grupo «naranja» lleva un tono coral distinto del naranja de marca y siempre va con su etiqueta (plan §1,
 *   Decisión 2).
 * - Fuente system-ui (modik.net no carga fuentes web). Nada de CDN.
 */

:root {
  /* tokens de modik.net, tal cual */
  --bg: #080b0f; --bg-2: #0d1117;
  --panel: #12181f; --panel-2: #171f29; --panel-3: #1e2834;
  --line: #233040; --line-2: #2e3e52;
  --ink: #f2f5f8; --ink-2: #a9b6c3; --ink-3: #7f8c9a;
  --naranja: #ff6a13; --naranja-2: #ff9a3c; --ambar: #ffc36b;
  --ok: #3ddc85; --bad: #ff5d5d;
  /* el degradado de marca es relleno y se queda igual en los dos temas: --ambar es de interfaz y el claro lo oscurece */
  --ambar-marca: #ffc36b;
  --grad: linear-gradient(100deg, var(--naranja) 0%, var(--naranja-2) 55%, var(--ambar-marca) 100%);
  --grad-texto: var(--grad);                   /* degradado para TEXTO (títulos, cifras de KPI) */
  --radio: 18px;
  --sombra: 0 20px 60px rgba(0, 0, 0, .45);
  /* derivados para la interfaz */
  --accent: var(--naranja);
  --accent-hover: #ff7d33;
  --accent-ink: #1c0e02;                       /* texto sobre --grad / --naranja */
  --accent-soft: rgba(255, 106, 19, .14);
  --accent-line: rgba(255, 154, 60, .42);
  --accent-text: var(--naranja-2);
  --halo: 0 10px 30px rgba(255, 106, 19, .35);
  --sup-1: rgba(255, 255, 255, .03);
  --sup-2: rgba(255, 255, 255, .06);
  --wa: #25b862; --wa-ink: #04180c;
  --shadow-1: 0 1px 0 rgba(255, 255, 255, .02) inset, 0 1px 2px rgba(0, 0, 0, .35);
  --shadow: var(--sombra);
  /* colores de DATO (grupos y estatus de seguimiento), del original oscuro; «naranja» en coral */
  --dato-verde: #34c27a; --dato-amarillo: #f0c03a; --dato-naranja: #ef8a6b;
  --dato-azul: #5c9cf2; --dato-gris: #9ca1ab; --dato-rojo: #f26666;
  --dato-s1: #4f93ea; --dato-s2: #e07a4f; --dato-s3: #23b07e; --dato-s4: #d39a1c;
  --f-body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --f-mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --r: 16px; --r-md: 12px; --r-sm: 10px; --side: 236px;
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #f4f5f7; --bg-2: #eceef2;
  --panel: #ffffff; --panel-2: #f2f4f7; --panel-3: #e8ebf0;
  --line: #e2e6ec; --line-2: #cfd6df;
  --ink: #11161c; --ink-2: #47525e; --ink-3: #66717d;
  --ok: #178a4f; --bad: #c62f2f; --ambar: #a66700;
  --accent-hover: #f05d08;
  --accent-soft: #fff0e6;
  --accent-line: rgba(232, 94, 8, .45);
  --accent-text: #b04600;                      /* AA sobre blanco */
  --grad-texto: linear-gradient(100deg, #c94f00 0%, #b04600 100%);   /* 4.5:1 o más sobre blanco */
  --halo: 0 8px 22px rgba(255, 106, 19, .28);
  --sup-1: rgba(17, 22, 28, .02);
  --sup-2: rgba(17, 22, 28, .05);
  --wa: #1fa855; --wa-ink: #ffffff;
  --shadow-1: 0 1px 2px rgba(17, 22, 28, .06), 0 2px 8px rgba(17, 22, 28, .05);
  --shadow: 0 16px 48px rgba(17, 22, 28, .18);
  --dato-verde: #12a15a; --dato-amarillo: #d9a200; --dato-naranja: #d9694a;
  --dato-azul: #2f7ce0; --dato-gris: #868b95; --dato-rojo: #e23c3c;
  --dato-s1: #2a78d6; --dato-s2: #d4602f; --dato-s3: #1a9e6f; --dato-s4: #c48a00;
  color-scheme: light;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
.mobile-only { display: none !important; }
html, body { background: var(--bg); margin: 0; padding: 0; min-height: 100%; }
body { color: var(--ink); font: 14.5px/1.45 var(--f-body); -webkit-font-smoothing: antialiased; }
b, strong, th { font-weight: 700; }
h1, h2 { font-weight: 900; }
h3 { font-weight: 800; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
a { color: var(--accent-text); }
.num { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--f-mono); font-size: 13px; }
.muted { color: var(--ink-3); }
.eyebrow { display: inline-flex; align-items: center; gap: 10px; text-transform: uppercase; letter-spacing: .18em; font-size: 11.5px; font-weight: 800; color: var(--ink-2); }
.eyebrow::before, .eyebrow::after { content: ""; width: 18px; height: 2px; border-radius: 2px; background: var(--naranja); }

/* ---------- login ---------- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; position: relative; overflow: hidden;
  background:
    radial-gradient(60vmax 50vmax at 100% 0%, rgba(255, 106, 19, .16), transparent 60%),
    radial-gradient(50vmax 40vmax at 0% 100%, rgba(255, 154, 60, .10), transparent 60%),
    linear-gradient(var(--sup-1) 1px, transparent 1px) 0 0 / 44px 44px,
    linear-gradient(90deg, var(--sup-1) 1px, transparent 1px) 0 0 / 44px 44px,
    var(--bg); }
.login-card { width: min(420px, 100%); background: var(--panel); border: 1px solid var(--line); border-radius: var(--radio); padding: 28px 24px; box-shadow: var(--sombra); display: flex; flex-direction: column; gap: 18px; }
.login-card .logo { width: 210px; max-width: 70%; height: auto; display: block; }
.login-card h1 { margin: 0; font-size: clamp(1.6rem, 6vw, 2rem); line-height: 1.08; letter-spacing: -.02em; }
.login-card h1 em { font-style: normal; background: var(--grad-texto); -webkit-background-clip: text; background-clip: text; color: transparent; }
.login-card form { display: flex; flex-direction: column; gap: 12px; }
.login-err { color: var(--bad); font-size: 13.5px; min-height: 1.2em; }
.sello { display: inline-flex; align-items: center; gap: 10px; align-self: flex-start; padding: 6px 14px 6px 6px; border-radius: 999px; border: 1px solid var(--accent-line); background: var(--sup-1); }
.sello i { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--grad); color: var(--accent-ink); font-style: normal; font-weight: 900; box-shadow: 0 0 0 3px var(--bg), 0 0 0 4px var(--accent-line); }
.sello span { display: flex; flex-direction: column; line-height: 1.15; font-weight: 800; font-size: 13px; }
.sello small { font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--accent-text); font-weight: 800; }

/* ---------- marco de la app ---------- */
.app { display: grid; grid-template-columns: var(--side) minmax(0, 1fr); min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; background: var(--bg-2); border-right: 1px solid var(--line); display: flex; flex-direction: column; gap: 18px; padding: 20px 14px 16px; }
.brand { display: flex; flex-direction: column; gap: 8px; padding: 2px 6px; min-width: 0; }
.brand .logo { width: 150px; max-width: 100%; height: auto; display: block; }
.brand .mark { display: none; width: 40px; height: 40px; border-radius: 12px; }
.brand-txt { min-width: 0; display: flex; flex-direction: column; }
.brand-txt b { font-size: 14.5px; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brand-txt span { font-size: 12px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tabs { display: flex; flex-direction: column; gap: 4px; }
.tab { all: unset; box-sizing: border-box; cursor: pointer; display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--r-md); color: var(--ink-2); font-size: 14.5px; font-weight: 600; position: relative; transition: background .15s, color .15s; }
.tab .ti { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--sup-2); color: var(--ink-2); flex: none; border: 1px solid transparent; transition: background .15s, color .15s; }
.tab:hover { background: var(--sup-2); color: var(--ink); }
.tab[aria-selected="true"] { background: var(--accent-soft); color: var(--ink); font-weight: 800; }
.tab[aria-selected="true"] .ti { background: var(--grad); color: var(--accent-ink); }
.tab:focus-visible { outline: 2px solid var(--accent); }
.tab .tl { flex: 1; min-width: 0; }
.tab .badge { margin-left: auto; }
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 8px; padding: 12px; border-radius: var(--r-md); background: var(--panel); border: 1px solid var(--line); font-size: 12.5px; color: var(--ink-2); }
.side-foot b { color: var(--ink); font-size: 13.5px; }
.side-foot .row { display: flex; gap: 6px; flex-wrap: wrap; }
.badge { display: inline-block; min-width: 20px; padding: 0 6px; border-radius: 999px; background: var(--bad); color: #fff; font-size: 11.5px; line-height: 20px; text-align: center; font-weight: 800; }
.badge.soft { background: var(--panel-3); color: var(--ink-2); }

.content { min-width: 0; display: flex; flex-direction: column; }
.top { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--bg) 86%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.top-row, main { padding-left: 28px; padding-right: 28px; }
.top-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding-block: 16px 12px; }
.page-title { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.page-title h1 { margin: 0; font-size: 26px; line-height: 1.1; letter-spacing: -.02em; text-wrap: balance; }
.page-title span { color: var(--ink-3); font-size: 13px; }
.report-chip { display: inline-flex; gap: 6px; align-items: center; border-radius: 999px; padding: 7px 14px; font-size: 13px; color: var(--ink-2); background: var(--sup-1); border: 1px solid var(--accent-line); }
.report-chip b { color: var(--ink); }
/* sin tope de ancho: la tabla de Conductores usa toda la pantalla (Fer, 31-oct: en el ultrawide salía cortada) */
main { padding-block: 18px 72px; width: 100%; }
h2 { font-size: 19px; line-height: 1.2; margin: 0; letter-spacing: -.01em; }
h3 { font-size: 15px; line-height: 1.3; margin: 0; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 4px 0 14px; }

/* ---------- botones ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 1px solid var(--line-2); background: var(--sup-1); border-radius: 999px; padding: 8px 16px; font-size: 14px; font-weight: 800; text-decoration: none; color: var(--ink); white-space: nowrap; transition: background .15s, border-color .15s, transform .1s, box-shadow .15s; }
.btn:hover { background: var(--sup-2); border-color: var(--accent-line); }
.btn:active { transform: scale(.98); }
.btn.primary { background: var(--grad); border-color: transparent; color: var(--accent-ink); box-shadow: var(--halo); }
.btn.primary:hover { filter: brightness(1.05); }
.btn.wa { background: var(--wa); border-color: transparent; color: var(--wa-ink); }
.btn.wa:hover { filter: brightness(1.06); }
.btn.ghost { border-color: transparent; background: transparent; color: var(--ink-2); }
.btn.ghost:hover { background: var(--sup-2); color: var(--ink); }
.btn.sm { padding: 5px 12px; font-size: 13px; }
.btn.danger { color: var(--bad); }
.btn:disabled, .btn[disabled] { opacity: .45; cursor: not-allowed; }
.icon { width: 16px; height: 16px; flex: none; }

/* ---------- estatus ---------- */
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex: none; background: var(--c, var(--dato-gris)); }
.pill { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; padding: 3px 11px 3px 8px; border-radius: 999px; font-size: 12.5px; font-weight: 600; line-height: 1.3;
  background: color-mix(in srgb, var(--c) 16%, var(--panel)); color: var(--ink); border: 1px solid color-mix(in srgb, var(--c) 32%, transparent); }
.pill .dot { width: 8px; height: 8px; }
.pill span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.g-verde { --c: var(--dato-verde); } .g-amarillo { --c: var(--dato-amarillo); } .g-naranja { --c: var(--dato-naranja); }
.g-azul { --c: var(--dato-azul); } .g-gris { --c: var(--dato-gris); } .g-rojo { --c: var(--dato-rojo); }
.estado-chip { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 999px; border: 1px solid var(--accent-line); color: var(--accent-text); font-size: 11px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }

/* ---------- filtros ---------- */
.filters { display: flex; flex-direction: column; gap: 12px; margin-bottom: 14px; }
.chips { display: grid; grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); gap: 10px; }
.chip { all: unset; box-sizing: border-box; cursor: pointer; display: grid; grid-template-columns: auto 1fr; grid-template-areas: "dot n" "lbl lbl"; align-items: center; gap: 6px 8px;
  padding: 12px 14px; border-radius: var(--r-md); background: var(--panel); border: 1px solid var(--line); transition: border-color .15s, transform .1s, background .15s; }
.chip:hover { transform: translateY(-1px); border-color: var(--line-2); }
.chip:focus-visible { outline: 2px solid var(--accent); }
.chip .dot { grid-area: dot; width: 12px; height: 12px; }
.chip .n { grid-area: n; justify-self: end; font-size: 22px; line-height: 1; font-weight: 900; font-variant-numeric: tabular-nums; color: var(--ink); }
.chip .cl { grid-area: lbl; font-size: 13px; line-height: 1.25; color: var(--ink-2); font-weight: 600; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.chip.all .dot { background: var(--ink); }
/* la selección es interfaz (naranja de marca); el punto conserva el color de dato del grupo */
.chip[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.chip[aria-pressed="true"] .cl { color: var(--ink); font-weight: 800; }
.chip.alert .cl { color: var(--bad); font-weight: 700; }
.chip.alert { background: color-mix(in srgb, var(--bad) 7%, var(--panel)); border-color: color-mix(in srgb, var(--bad) 35%, transparent); }
.chip.alert .dot { background: var(--bad); }
.filter-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field > span { font-size: 12px; color: var(--ink-3); font-weight: 600; }
.input, select.input, textarea.input { border: 1px solid var(--line-2); background-color: var(--bg-2); border-radius: var(--r-sm); padding: 9px 12px; min-width: 0; width: 100%; outline: none; transition: border-color .15s, box-shadow .15s; }
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
select.input { appearance: none; -webkit-appearance: none; padding-right: 34px; background-image: linear-gradient(45deg, transparent 50%, var(--ink-3) 50%), linear-gradient(135deg, var(--ink-3) 50%, transparent 50%); background-position: calc(100% - 18px) 52%, calc(100% - 13px) 52%; background-size: 5px 5px; background-repeat: no-repeat; }
.filter-row select.input { border-radius: 999px; width: auto; max-width: 100%; }
textarea.input { resize: vertical; min-height: 84px; line-height: 1.45; }
.input:disabled { opacity: .6; cursor: not-allowed; }
.search { flex: 1 1 260px; min-width: 0; position: relative; display: block; }
.search .input { padding-left: 38px; border-radius: 999px; }
.search svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--ink-3); }
.field-err { color: var(--bad); font-size: 12.5px; }
.lb-row > .field-err[data-campo] { flex-basis: 100%; }
[aria-invalid="true"] { border-color: var(--bad); }
.chip-x { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent-text); }

/* ---------- tabla de conductores ---------- */
.card { background: var(--panel); border-radius: var(--r); border: 1px solid var(--line); }
.table-wrap { overflow: auto; max-height: calc(100vh - 330px); min-height: 220px; border-radius: var(--r) var(--r) 0 0; }
/* barra de desplazamiento visible sobre el tema oscuro y el claro, para cuando la tabla no cabe (pantallas angostas) */
.table-wrap { scrollbar-width: auto; scrollbar-color: var(--ink-3) var(--bg-2); }
table.drivers { border-collapse: separate; border-spacing: 0; width: 100%; min-width: 1000px; }
/* 10 px a los lados (antes 14): con las barras de desplazamiento reales, a 1920 de ancho faltaban 26 px para Seguimiento */
table.drivers th, table.drivers td { padding: 12px 10px; height: 48px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; vertical-align: middle; }
table.drivers th { position: sticky; top: 0; z-index: 2; background: var(--panel); font-size: 12px; color: var(--ink-3); font-weight: 800; letter-spacing: .04em; text-transform: uppercase; height: 42px; }
table.drivers th button { all: unset; cursor: pointer; display: inline-flex; gap: 4px; align-items: center; }
table.drivers th button:hover { color: var(--ink); }
table.drivers th[aria-sort] { color: var(--accent-text); }
table.drivers th[aria-sort="ascending"] button::after { content: "↑"; } table.drivers th[aria-sort="descending"] button::after { content: "↓"; }
table.drivers td:first-child, table.drivers th:first-child { position: sticky; left: 0; z-index: 1; background: var(--panel); box-shadow: 1px 0 0 var(--line); }
table.drivers th:first-child { z-index: 3; }
table.drivers tbody tr { cursor: pointer; }
table.drivers tbody tr:hover td { background: var(--panel-2); }
table.drivers td .pill { max-width: 250px; }
.who { display: flex; align-items: center; gap: 10px; max-width: 290px; }
.who .nm { font-weight: 700; overflow: hidden; text-overflow: ellipsis; }
.who .stripe { width: 8px; height: 8px; border-radius: 50%; background: var(--c); flex: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 22%, transparent); }
td.r, th.r { text-align: right; }
.tel { display: inline-flex; gap: 6px; align-items: center; }
.empty { padding: 40px 16px; text-align: center; color: var(--ink-3); }
.list-foot { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; padding: 10px 14px; font-size: 12.5px; color: var(--ink-3); }
.follow { display: inline-flex; gap: 6px; align-items: center; font-size: 13px; color: var(--ink-2); }
.follow .late { color: var(--bad); font-weight: 700; }

/* ---------- ficha (drawer) ---------- */
.scrim { position: fixed; inset: 0; background: rgba(3, 5, 8, .6); z-index: 40; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(600px, 100%); background: var(--bg); z-index: 41; box-shadow: var(--shadow); display: flex; flex-direction: column; border-left: 1px solid var(--line); overflow-y: auto; }
.drawer-head { background: var(--panel); padding: 18px 20px 16px; display: flex; flex-direction: column; gap: 10px; border-bottom: 1px solid var(--line); position: relative; }
.drawer-head .row1 { display: flex; gap: 10px; align-items: flex-start; }
.drawer-head h2 { font-size: 23px; flex: 1; min-width: 0; text-wrap: balance; }
.drawer-body { padding: 16px 20px 40px; display: flex; flex-direction: column; gap: 14px; }
.ids { display: flex; gap: 6px 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--ink-2); align-items: center; }
.ids .copy { all: unset; cursor: pointer; font-family: var(--f-mono); font-size: 12.5px; padding: 2px 8px; border-radius: 6px; background: var(--sup-2); border: 1px solid var(--line); }
.ids .copy:hover { border-color: var(--accent-line); }
.since { font-size: 13px; color: var(--ink-2); }
.since b { color: var(--ink); }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.quick { display: grid; grid-template-columns: repeat(auto-fit, minmax(70px, 1fr)); gap: 6px; }
.qbtn { all: unset; box-sizing: border-box; cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 12px 6px; border-radius: var(--r-md); background: var(--sup-1); border: 1px solid var(--line); color: var(--ink); font-size: 12.5px; font-weight: 700; text-align: center; transition: border-color .15s, transform .1s; min-width: 0; }
.qbtn:hover { border-color: var(--accent-line); }
.qbtn:active { transform: scale(.97); }
.qbtn:focus-visible { outline: 2px solid var(--accent); }
.qbtn .qi { width: 34px; height: 34px; border-radius: 12px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-text); border: 1px solid var(--accent-line); }
.qbtn.wa .qi { background: var(--wa); color: var(--wa-ink); border-color: transparent; }
.qbtn[aria-disabled="true"] { opacity: .45; cursor: not-allowed; }
.box { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.kv { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 128px), 1fr)); gap: 12px 14px; margin: 0; }
.kv div { min-width: 0; }
.kv dt { font-size: 12px; color: var(--ink-3); }
.kv dd { margin: 2px 0 0; font-weight: 600; overflow-wrap: anywhere; }
.docs { display: flex; flex-wrap: wrap; gap: 6px; }
.doc { font-size: 12.5px; padding: 4px 10px; border-radius: 999px; background: var(--sup-2); display: inline-flex; gap: 5px; align-items: center; border: 1px solid var(--line); }
.doc.ok { background: color-mix(in srgb, var(--ok) 12%, var(--panel)); border-color: color-mix(in srgb, var(--ok) 30%, transparent); }
.doc.bad { background: color-mix(in srgb, var(--bad) 12%, var(--panel)); border-color: color-mix(in srgb, var(--bad) 30%, transparent); }
.doc.none { color: var(--ink-3); background: transparent; }
.seg { display: inline-flex; padding: 4px; gap: 4px; border-radius: 999px; background: var(--sup-2); border: 1px solid var(--line); flex-wrap: wrap; }
.seg button { border: 0; background: transparent; padding: 6px 14px; border-radius: 999px; font-size: 13px; font-weight: 700; color: var(--ink-2); }
.seg button:hover { color: var(--ink); }
.seg button[aria-pressed="true"] { background: var(--grad); color: var(--accent-ink); }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr)); gap: 10px; }
.timeline { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.timeline li { display: grid; grid-template-columns: 32px 1fr; gap: 10px; padding: 12px 0; border-top: 1px solid var(--line); }
.timeline li:first-child { border-top: 0; }
.t-ico { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: var(--sup-2); color: var(--ink-2); flex: none; }
.t-ico.llamada { color: var(--dato-s1); } .t-ico.cita { color: var(--accent-text); } .t-ico.recordatorio { color: var(--ambar); } .t-ico.whatsapp { color: var(--wa); }
.t-meta { font-size: 12.5px; color: var(--ink-3); display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.t-text { white-space: pre-wrap; overflow-wrap: anywhere; margin-top: 2px; }
.tag { font-size: 12px; padding: 2px 9px; border-radius: 999px; background: var(--sup-2); color: var(--ink-2); border: 1px solid var(--line); }
.tag.done { color: var(--ok); background: color-mix(in srgb, var(--ok) 10%, var(--panel)); border-color: color-mix(in srgb, var(--ok) 28%, transparent); }
.tag.late { color: var(--bad); background: color-mix(in srgb, var(--bad) 10%, var(--panel)); border-color: color-mix(in srgb, var(--bad) 28%, transparent); }
.tag.now { color: var(--ok); }
.banner { background: var(--accent-soft); border: 1px solid var(--accent-line); border-radius: var(--r); padding: 12px 16px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; justify-content: space-between; }
.banner.warn { background: color-mix(in srgb, var(--ambar) 12%, var(--panel)); border-color: color-mix(in srgb, var(--ambar) 40%, transparent); }
.banner.bad { background: color-mix(in srgb, var(--bad) 10%, var(--panel)); border-color: color-mix(in srgb, var(--bad) 35%, transparent); }
.seg-status { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; font-size: 13px; }
select.input.seg-sel { width: auto; border-radius: 999px; font-weight: 700; border-color: var(--c); background-color: color-mix(in srgb, var(--c) 12%, var(--panel)); }
select.input.seg-sel.sm { padding: 4px 30px 4px 11px; font-size: 12.5px; background-position: calc(100% - 16px) 52%, calc(100% - 11px) 52%; }
.cita-box { background: var(--accent-soft); border: 1px solid var(--accent-line); border-radius: var(--r-sm); padding: 10px; }

/* ---------- agenda ---------- */
.agenda-v { display: flex; flex-direction: column; gap: 14px; }
.ag-top { display: flex; flex-direction: column; gap: 14px; }
.today-alert { border-radius: var(--r); padding: 18px; display: flex; flex-direction: column; gap: 14px; border: 1px solid var(--line); background: var(--panel); }
.today-alert.late-box { background: color-mix(in srgb, var(--bad) 8%, var(--panel)); border-color: color-mix(in srgb, var(--bad) 35%, transparent); box-shadow: inset 4px 0 0 var(--bad); }
.today-alert.today-box { background: color-mix(in srgb, var(--ok) 7%, var(--panel)); border-color: color-mix(in srgb, var(--ok) 32%, transparent); box-shadow: inset 4px 0 0 var(--ok); }
.ta-head { display: flex; gap: 14px; align-items: center; }
.ta-ico { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; background: var(--sup-2); flex: none; }
.late-box .ta-ico { color: var(--bad); background: color-mix(in srgb, var(--bad) 15%, var(--panel)); }
.today-box .ta-ico { color: var(--ok); background: color-mix(in srgb, var(--ok) 15%, var(--panel)); }
.ta-title { font-size: 21px; font-weight: 900; line-height: 1.15; }
.late-box .ta-title { color: color-mix(in srgb, var(--bad) 80%, var(--ink)); }
.today-box .ta-title { color: color-mix(in srgb, var(--ok) 80%, var(--ink)); }
.ta-sub { font-size: 13.5px; color: var(--ink-2); }
.ta-list, .tm-list, .day-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 290px), 1fr)); gap: 10px; }
.today-ok { display: flex; gap: 12px; align-items: center; background: color-mix(in srgb, var(--ok) 7%, var(--panel)); border: 1px solid color-mix(in srgb, var(--ok) 25%, transparent); border-radius: var(--r); padding: 14px 16px; }
.today-ok .ta-ico { width: 40px; height: 40px; color: var(--ok); }
.tomorrow { background: color-mix(in srgb, var(--ambar) 6%, var(--panel)); border: 1px solid color-mix(in srgb, var(--ambar) 25%, transparent); border-radius: var(--r); padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; box-shadow: inset 4px 0 0 var(--ambar); }
.tm-head { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.tm-head b { font-size: 16px; }
.tm-ico { color: var(--ambar); display: inline-flex; }
.a-item { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-md); padding: 12px 14px; display: flex; flex-direction: column; gap: 7px; }
.a-item.late { box-shadow: inset 3px 0 0 var(--bad); }
.a-item.is-today { box-shadow: inset 3px 0 0 var(--ok); }
.a-item.future { box-shadow: inset 3px 0 0 var(--ambar); }
.a-item.is-done { opacity: .6; }
.a-item.compact { padding: 8px 10px; gap: 4px; }
.a-item.compact .a-who { font-size: 13.5px; }
.a-top { display: flex; gap: 8px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.a-who { all: unset; cursor: pointer; font-weight: 800; font-size: 15px; }
.a-who:hover { color: var(--accent-text); }
.t-text.clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 12.5px; color: var(--ink-2); }
.cal { gap: 14px; }
.cal-ctrl { display: flex; gap: 10px 16px; align-items: center; flex-wrap: wrap; }
.cal-label { font-size: 16px; }
.cal-label::first-letter { text-transform: uppercase; }
.cal-stats { display: flex; gap: 6px 14px; flex-wrap: wrap; margin-left: auto; font-size: 13px; color: var(--ink-3); }
.cal-stats b { color: var(--ink); }
.icon-btn { padding: 6px 8px; }
.cal-empty { padding: 28px; text-align: center; color: var(--ink-3); background: var(--sup-1); border: 1px dashed var(--line-2); border-radius: var(--r-md); }
.week-wrap { overflow-x: auto; }
.week-grid { display: grid; grid-template-columns: repeat(7, minmax(130px, 1fr)); gap: 8px; min-width: 940px; }
.day-col { background: var(--sup-1); border: 1px solid var(--line); border-radius: var(--r-md); padding: 8px; display: flex; flex-direction: column; gap: 6px; min-height: 160px; }
.day-col.is-today { border-color: var(--ok); background: color-mix(in srgb, var(--ok) 6%, var(--panel)); }
.day-col.is-tomorrow { border-color: color-mix(in srgb, var(--ambar) 60%, transparent); }
.day-col.is-past { background: color-mix(in srgb, var(--bad) 3%, var(--panel)); }
.day-head { all: unset; cursor: pointer; display: flex; gap: 6px; align-items: baseline; padding: 2px 4px 4px; text-transform: capitalize; color: var(--ink-2); font-size: 12.5px; }
.day-head b { font-size: 18px; color: var(--ink); font-weight: 900; }
.day-head em { font-style: normal; margin-left: auto; font-size: 11px; padding: 1px 7px; border-radius: 999px; font-weight: 800; }
.day-col.is-today .day-head em { background: color-mix(in srgb, var(--ok) 18%, var(--panel)); color: var(--ok); }
.day-col.is-tomorrow .day-head em { background: color-mix(in srgb, var(--ambar) 18%, var(--panel)); color: var(--ambar); }
.day-none { text-align: center; padding: 8px 0; }
.month { display: flex; flex-direction: column; gap: 6px; }
.m-head, .m-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.m-head span { font-size: 12px; color: var(--ink-3); text-align: center; font-weight: 700; }
.m-cell { all: unset; box-sizing: border-box; cursor: pointer; min-height: 84px; border-radius: var(--r-sm); background: var(--sup-1); border: 1px solid var(--line); padding: 6px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.m-cell:hover { border-color: var(--accent-line); }
.m-cell.out { opacity: .4; }
.m-cell.is-today { border-color: var(--ok); background: color-mix(in srgb, var(--ok) 6%, var(--panel)); }
.m-cell.is-tomorrow { border-color: color-mix(in srgb, var(--ambar) 60%, transparent); }
.m-cell.has-late .m-num { color: var(--bad); }
.m-num { font-size: 14px; font-weight: 800; }
.m-tag { font-size: 11px; padding: 1px 6px; border-radius: 999px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.m-tag.past { background: color-mix(in srgb, var(--bad) 12%, var(--panel)); color: color-mix(in srgb, var(--bad) 85%, var(--ink)); }
.m-tag.now { background: color-mix(in srgb, var(--ok) 12%, var(--panel)); color: color-mix(in srgb, var(--ok) 85%, var(--ink)); }
.m-tag.fut { background: color-mix(in srgb, var(--ambar) 12%, var(--panel)); color: color-mix(in srgb, var(--ambar) 85%, var(--ink)); }

/* ---------- resultados ---------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); gap: 12px; margin-bottom: 14px; }
.kpi { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 16px 18px; display: flex; flex-direction: column; gap: 8px; }
.kpi .lbl { font-size: 12px; color: var(--ink-2); font-weight: 800; letter-spacing: .06em; text-transform: uppercase; display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.kpi .big { font-size: 34px; line-height: 1; font-weight: 900; letter-spacing: -.01em; font-variant-numeric: tabular-nums; background: var(--grad-texto); -webkit-background-clip: text; background-clip: text; color: transparent; }
.kpi .big small { font-size: 14px; color: var(--ink-3); margin-left: 4px; font-weight: 600; letter-spacing: 0; -webkit-text-fill-color: var(--ink-3); }
.meter { height: 8px; border-radius: 4px; background: var(--sup-2); overflow: hidden; }
.meter i { display: block; height: 100%; border-radius: 4px; background: var(--c, var(--accent)); }
.kpi .foot { font-size: 12.5px; color: var(--ink-3); }
.kpi.click { cursor: pointer; transition: transform .1s, border-color .15s; }
.kpi.click:hover { transform: translateY(-2px); border-color: var(--accent); }
.kpi-more { display: inline-flex; align-items: center; gap: 2px; font-size: 11.5px; color: var(--accent-text); white-space: nowrap; text-transform: none; letter-spacing: 0; }
.kpi.sem { box-shadow: inset 0 3px 0 var(--sem); }
.sem-badge { display: inline-flex; align-items: center; gap: 6px; align-self: flex-start; font-size: 12.5px; font-weight: 700; padding: 3px 10px 3px 8px; border-radius: 999px; background: color-mix(in srgb, var(--sem) 18%, var(--panel)); color: var(--ink); }
.charts { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); gap: 14px; }
.chart-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 16px 18px; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.chart-card.full { grid-column: 1 / -1; }
.chart-card .note { font-size: 12.5px; color: var(--ink-3); margin-top: -4px; }
.chart { position: relative; min-height: 200px; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart text { fill: var(--ink-3); font: 11.5px var(--f-body); }
.chart .grid line { stroke: var(--line); }
.legend { display: flex; gap: 12px; flex-wrap: wrap; font-size: 12.5px; color: var(--ink-2); }
.legend span { display: inline-flex; gap: 6px; align-items: center; }
.legend i { width: 10px; height: 10px; border-radius: 3px; background: var(--c); }
.tip { position: absolute; pointer-events: none; background: var(--panel-2); border: 1px solid var(--line-2); border-radius: var(--r-sm); box-shadow: var(--shadow); padding: 7px 10px; font-size: 12.5px; z-index: 5; white-space: nowrap; }
.tip .h { color: var(--ink-3); margin-bottom: 2px; }
.hbars { display: flex; flex-direction: column; gap: 9px; }
.hbar { display: grid; grid-template-columns: minmax(90px, 38%) 1fr auto; gap: 10px; align-items: center; font-size: 13.5px; border-radius: 8px; }
.hbar.click { cursor: pointer; padding: 3px 6px; margin: -3px -6px; }
.hbar.click:hover { background: var(--sup-2); }
.hbar .lab { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-2); }
.hbar .track { height: 14px; background: var(--sup-2); border-radius: 7px; overflow: hidden; display: flex; gap: 2px; }
.hbar .track i { display: block; height: 100%; background: var(--c, var(--dato-s1)); border-radius: 0 7px 7px 0; min-width: 3px; }
.hbar .val { font-variant-numeric: tabular-nums; font-weight: 800; font-size: 13px; min-width: 3ch; text-align: right; }
.mini-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.mini-table th, .mini-table td { padding: 9px 8px; border-bottom: 1px solid var(--line); text-align: left; }
.mini-table th { font-size: 11.5px; color: var(--ink-3); font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.mini-table tr.click { cursor: pointer; } .mini-table tr.click:hover td { background: var(--panel-2); }
.mini-table.ejec th { white-space: normal; min-width: 70px; line-height: 1.25; vertical-align: bottom; }
.mini-table.ejec td { white-space: nowrap; }
.mini-table td.r, .mini-table th.r { text-align: right; }
.overflow { overflow-x: auto; }
.overflow.alto { max-height: 480px; overflow-y: auto; }
.overflow.alto thead th { position: sticky; top: 0; background: var(--panel); z-index: 1; }
.toggle-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
/* casilla con su texto al lado: el texto se parte en renglones, no se va debajo de la casilla */
.check { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; cursor: pointer; }
.check input { flex: none; width: 18px; height: 18px; margin: 0; accent-color: var(--accent); }
.check > span { flex: 1; min-width: 0; padding-top: 1px; }
.res-head { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.wk-badge { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.wk-big { font-size: 26px; font-weight: 900; line-height: 1; padding: 6px 12px; border-radius: 10px; background: var(--grad); color: var(--accent-ink); box-shadow: var(--halo); }
.week-pick { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-3); min-width: 0; max-width: 100%; }
.week-pick select.input { border-radius: 999px; width: auto; max-width: 100%; font-weight: 700; color: var(--ink); }
.avatar { width: 24px; height: 24px; border-radius: 8px; display: inline-grid; place-items: center; background: var(--accent-soft); color: var(--accent-text); flex: none; }
.inbar { display: inline-flex; align-items: center; gap: 8px; min-width: 150px; width: 100%; }
.inbar i { display: block; height: 10px; border-radius: 5px; background: var(--grad); min-width: 2px; }
.inbar b { font-size: 13px; }
.prog { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.prog-track { height: 10px; border-radius: 5px; background: var(--sup-2); overflow: hidden; }
.prog-track i { display: block; height: 100%; border-radius: 5px; }
.prog-txt { font-size: 12.5px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.prog.sm .prog-track { height: 8px; }
.prog.sm .prog-txt { font-size: 12px; }
.mini-prog { display: inline-block; width: 46px; height: 6px; border-radius: 3px; background: var(--sup-2); overflow: hidden; flex: none; }
.mini-prog i { display: block; height: 100%; }
.inc-board { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 420px), 1fr)); gap: 12px; }
.inc-panel { background: var(--sup-1); border: 1px solid var(--line); border-radius: var(--r-md); padding: 14px; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.inc-top { display: flex; flex-direction: column; gap: 4px; }
.inc-top-row { all: unset; box-sizing: border-box; cursor: pointer; display: grid; grid-template-columns: minmax(0, 150px) minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 6px 8px; border-radius: 8px; background: var(--panel); border: 1px solid transparent; }
.inc-top-row:hover { border-color: var(--line-2); }
.inc-top-row .nm { font-weight: 700; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-ico { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-text); flex: none; border: 1px solid var(--accent-line); }
.lb-ico.sm { width: 30px; height: 30px; border-radius: 9px; }
.lb-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.inc-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: 12px; }
.inc-card { background: var(--sup-1); border: 1px solid var(--line); border-radius: var(--r-md); padding: 14px; display: flex; flex-direction: column; gap: 8px; }
.inc-card.off { opacity: .65; }
.inc-stats { display: flex; gap: 6px 16px; flex-wrap: wrap; font-size: 13px; color: var(--ink-3); }
.inc-stats b { color: var(--ink); font-size: 16px; font-weight: 900; }
.inc-row { background: var(--sup-1); border: 1px solid var(--line); border-radius: var(--r-md); padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; }
.conds { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.cond-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; width: 100%; }
.cond-row select.input { width: auto; flex: 1 1 200px; }
.check-list { max-height: 46vh; overflow: auto; border-radius: var(--r-md); background: var(--panel); border: 1px solid var(--line); }
.check-row { display: flex; gap: 10px; align-items: center; padding: 8px 12px; border-bottom: 1px solid var(--line); flex-wrap: wrap; cursor: pointer; }
.check-row.head { position: sticky; top: 0; background: var(--panel-2); z-index: 1; font-weight: 700; }
.check-row .nm { font-weight: 700; min-width: 160px; }
.check-row input, #ie-abierto { width: 18px; height: 18px; accent-color: var(--accent); }

/* ---------- plantillas ---------- */
.tpl-layout { display: grid; grid-template-columns: minmax(0, 320px) minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 980px) { .tpl-layout { grid-template-columns: 1fr; } }
.tpl-list { display: flex; flex-direction: column; gap: 8px; }
.tpl-item { all: unset; box-sizing: border-box; cursor: pointer; display: flex; flex-direction: column; gap: 6px; padding: 12px 14px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-md); transition: border-color .15s, transform .1s; }
.tpl-item:hover { transform: translateY(-1px); border-color: var(--line-2); }
.tpl-item:focus-visible { outline: 2px solid var(--accent); }
.tpl-item[aria-current="true"] { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.tpl-item .t { font-weight: 800; } .tpl-item .p { font-size: 12.5px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vars { display: flex; gap: 6px; flex-wrap: wrap; }
.var { border: 1px solid var(--accent-line); background: var(--accent-soft); color: var(--accent-text); border-radius: 999px; padding: 4px 11px; font-size: 12.5px; font-weight: 700; }
.var:hover { background: var(--grad); color: var(--accent-ink); border-color: transparent; }
.phone-prev { background: color-mix(in srgb, var(--wa) 8%, var(--bg-2)); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; }
.bubble { max-width: 92%; margin-left: auto; background: color-mix(in srgb, var(--wa) 22%, var(--panel)); border-radius: 14px 14px 4px 14px; padding: 10px 12px; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14px; }
.bubble .miss { background: color-mix(in srgb, var(--bad) 26%, transparent); border-radius: 4px; padding: 0 3px; }
.firma-box { margin-bottom: 14px; }
.firma-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 320px); gap: 16px; align-items: center; }
@media (max-width: 820px) { .firma-grid { grid-template-columns: 1fr; } }
.tpl-chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.chips-lbl { width: 100%; font-size: 11.5px; color: var(--ink-3); margin-top: 2px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.tpl-chip { border: 1px solid var(--line-2); border-radius: 999px; padding: 6px 13px; font-size: 13px; font-weight: 700; background: var(--sup-1); color: var(--ink); display: inline-flex; gap: 6px; align-items: center; }
.tpl-chip:hover { border-color: var(--accent-line); }
.tpl-chip[aria-pressed="true"] { background: var(--wa); color: var(--wa-ink); border-color: transparent; }
.fav-tag { font-size: 10.5px; padding: 1px 6px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-text); }
.tpl-chip[aria-pressed="true"] .fav-tag { background: rgba(255, 255, 255, .25); color: inherit; }
.btn.wa-big { padding: 11px 20px; font-size: 15px; }
#wa-log { width: 18px; height: 18px; accent-color: var(--wa); }

/* ---------- reportes y ajustes ---------- */
.drop { border: 2px dashed var(--line-2); border-radius: var(--r); padding: 30px 16px; text-align: center; background: var(--sup-1); display: flex; flex-direction: column; gap: 8px; align-items: center; cursor: pointer; transition: border-color .15s, background .15s; }
.drop:hover, .drop.over { border-color: var(--accent); background: var(--accent-soft); }
.drop input { display: none; }
.preview-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 140px), 1fr)); gap: 10px; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 12px; }
.stat b { display: block; font-size: 24px; font-weight: 900; }
.stat span { font-size: 12.5px; color: var(--ink-3); }
.help ol { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }
.help code, code.k { font-family: var(--f-mono); font-size: 12.5px; background: var(--sup-2); padding: 1px 6px; border-radius: 5px; }
.two { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); gap: 14px; align-items: start; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.exec-list { display: flex; flex-direction: column; gap: 8px; }
.exec-row { display: grid; grid-template-columns: 24px minmax(90px, 170px) minmax(0, 1fr) auto; gap: 10px; align-items: center; }
.exec-acc { font-size: 13px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 560px) { .exec-row { grid-template-columns: 24px 1fr auto; } .exec-acc { display: none; } }
.conf-card { background: var(--sup-1); border: 1px solid var(--line); border-radius: var(--r-md); padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.conf-card.pend { box-shadow: inset 3px 0 0 var(--ambar); }
.secreto { font-family: var(--f-mono); font-size: 13px; padding: 10px 12px; border-radius: var(--r-sm); background: var(--bg-2); border: 1px solid var(--accent-line); overflow-wrap: anywhere; user-select: all; }
.det { font-family: var(--f-mono); font-size: 12px; color: var(--ink-2); white-space: pre-wrap; overflow-wrap: anywhere; max-width: 420px; }

/* ---------- modal, toast, avisos ---------- */
.modal { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 16px; background: rgba(3, 5, 8, .62); }
.modal .sheet { background: var(--bg); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow); width: min(560px, 100%); max-height: 90vh; overflow: auto; padding: 20px; display: flex; flex-direction: column; gap: 12px; }
.modal .sheet.wide { width: min(1000px, 100%); }
.toast { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 11px 18px; border-radius: 999px; z-index: 80; font-size: 13.5px; font-weight: 600; box-shadow: var(--shadow); max-width: calc(100% - 32px); }
.toast.bad { background: var(--bad); color: #fff; }
.bell-wrap { position: relative; }
.bell-btn { position: relative; padding: 8px 11px; }
.bell-btn .badge { position: absolute; top: -4px; right: -4px; }
.bell-panel { position: absolute; top: calc(100% + 8px); right: 0; z-index: 50; width: min(380px, calc(100vw - 32px)); max-height: min(70vh, 560px); overflow: auto; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); display: flex; flex-direction: column; }
.bp-head { display: flex; align-items: center; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--panel); z-index: 1; }
.bp-head b { font-size: 15px; } .bp-head .btn { margin-left: auto; }
.bp-list { display: flex; flex-direction: column; }
.bp-item { display: grid; grid-template-columns: 32px 1fr; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.bp-item.late { background: color-mix(in srgb, var(--bad) 5%, var(--panel)); }
.bp-item.now { background: color-mix(in srgb, var(--ok) 5%, var(--panel)); }
.bp-body { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.bp-when { font-size: 12.5px; color: var(--ink-3); }
.bp-item.late .bp-when { color: color-mix(in srgb, var(--bad) 85%, var(--ink)); }
.bp-item.now .bp-when { color: color-mix(in srgb, var(--ok) 85%, var(--ink)); }
.bp-empty { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 26px 16px; text-align: center; color: var(--ink-2); }
.bp-foot { padding: 10px 14px; display: flex; justify-content: center; position: sticky; bottom: 0; background: var(--panel); border-top: 1px solid var(--line); }
.notifs { position: fixed; top: 14px; right: 14px; z-index: 90; display: flex; flex-direction: column; gap: 10px; width: min(380px, calc(100% - 28px)); pointer-events: none; }
.notif { pointer-events: auto; position: relative; display: grid; grid-template-columns: 40px 1fr; gap: 12px; background: var(--panel); border: 1px solid var(--accent-line); border-radius: var(--r); padding: 14px 40px 14px 14px; box-shadow: var(--shadow), inset 4px 0 0 var(--accent); }
.n-bell { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-text); }
.n-body { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.n-when { font-size: 12.5px; color: var(--accent-text); font-weight: 800; }
.n-text { font-size: 13px; color: var(--ink-2); overflow-wrap: anywhere; }
.n-x { position: absolute; top: 8px; right: 8px; padding: 4px; }

@media (prefers-reduced-motion: no-preference) {
  .drawer { animation: slide .22s cubic-bezier(.2, .8, .2, 1); }
  @keyframes slide { from { transform: translateX(32px); opacity: .5; } to { transform: none; opacity: 1; } }
  .notif { animation: nin .25s cubic-bezier(.2, .8, .2, 1); }
  @keyframes nin { from { transform: translateY(-12px); opacity: 0; } to { transform: none; opacity: 1; } }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }

/* ---------- pantallas angostas: el riel se encoge a iconos y luego pasa abajo ---------- */
@media (max-width: 1100px) and (min-width: 821px) {
  :root { --side: 84px; }
  .brand .logo, .brand-txt, .tab .tl, .side-foot { display: none; }
  .brand .mark { display: block; }
  .brand { align-items: center; }
  .tab { justify-content: center; padding: 8px; }
  .tab .badge { position: absolute; top: 2px; right: 6px; }
}
@media (max-width: 820px) {
  .app { grid-template-columns: 1fr; }
  .side { position: fixed; top: auto; bottom: 0; left: 0; right: 0; height: auto; z-index: 35; flex-direction: row; padding: 6px 8px calc(6px + env(safe-area-inset-bottom, 0px)); border-right: 0; border-top: 1px solid var(--line); }
  .brand, .side-foot { display: none; }
  .tabs { flex-direction: row; flex: 1; justify-content: space-around; gap: 2px; }
  .tab { flex-direction: column; gap: 3px; padding: 4px 2px; font-size: 10.5px; flex: 1; min-width: 0; text-align: center; }
  .tab[aria-selected="true"] { background: transparent; }
  .tab .ti { width: 40px; height: 30px; border-radius: 999px; }
  .tab .tl { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; letter-spacing: -.01em; }
  /* en el riel de abajo la selección la dice el icono; el peso no cambia para que «Conductores» quepa a 375 px */
  .tab[aria-selected="true"] { font-weight: 700; color: var(--accent-text); }
  .tab .badge { position: absolute; top: 0; right: calc(50% - 26px); }
  .top-row, main { padding-left: 16px; padding-right: 16px; }
  .top-row { padding-block: 12px 10px; }
  .page-title h1 { font-size: 22px; }
  .mobile-only { display: inline-flex !important; }
  main { padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px)); }
  .table-wrap { max-height: none; }
  .kpi .big { font-size: 28px; }
  .chips { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
  .toast { bottom: calc(84px + env(safe-area-inset-bottom, 0px)); }
  .bell-panel { position: fixed; top: 70px; left: 16px; right: 16px; width: auto; }
  .notifs { left: 50%; right: auto; transform: translateX(-50%); }
}
@media (max-width: 640px) {
  .m-cell { min-height: 56px; padding: 4px; } .m-tag { font-size: 10px; padding: 0 4px; }
  .ta-title { font-size: 19px; } .cal-stats { margin-left: 0; }
  .inc-top-row { grid-template-columns: 1fr; }
  .report-chip { font-size: 12px; padding: 6px 10px; }
  #go-upload .lbl { display: none; }
  /* barras horizontales: la etiqueta va en su propio renglón para no cortarla («Sin conectarse 7+ días») */
  .hbar { grid-template-columns: minmax(0, 1fr) auto; row-gap: 4px; }
  .hbar .lab { grid-column: 1 / -1; white-space: normal; }
  /* tablas chicas en su caja con scroll: a lo ancho y sin partir las celdas (como la de Conductores), en vez de
     apretar cada columna hasta un nombre por renglón */
  .overflow > .mini-table th, .overflow > .mini-table td { white-space: nowrap; }
  .overflow > .mini-table .det { min-width: 240px; }
}
