/* Salud de flota — formato común de las apps (ColdChain / DriveIQ): fondo gris, tarjeta izquierda (marca, grupo, menú,
   información del sistema) y tarjeta derecha (cabecera + una vista), esquinas de 18, menú de 250 con el activo marcado a la
   izquierda; en el celular (≤ 760 px) menú en cajón y barra fija abajo con 5 pestañas. Lo único propio: el color violeta.
   Colores de estado (urgente / revisar / vigilar / sano) con su texto oscuro medido ≥ 4,5 sobre su fondo. */
:root {
  --shell: #eef2f7; --surf: #ffffff; --card: #f8fafc; --borde: #e4e7ec; --linea: #eef1f5;
  --texto: #101828; --tenue: #475467; --suave: #667085;
  --acc: #6250d6; --acc-txt: #5340c4; --acc-bg: #f1eefd; --acc-on: #ffffff;
  --urg: #d03b3b; --urg-t: #b42318; --urg-bg: #fdecea;
  --med: #fab219; --med-t: #8a4b00; --med-bg: #fef3dc;
  --baj: #2a78d6; --baj-t: #1d4ed8; --baj-bg: #e8effd;
  --ok: #0ca30c;  --ok-t: #067647;  --ok-bg: #e6f6ec;
  --gri: #98a2b3; --gri-t: #475467; --gri-bg: #f2f4f7;
  --celda: #e9edf2; --rep: #1baf7a;
  --sombra: 0 1px 3px rgba(16,24,40,.06), 0 1px 2px rgba(16,24,40,.04);
  --sombra-alta: 0 12px 32px rgba(16,24,40,.14);
  --r-xl: 18px; --r-lg: 14px; --r-md: 10px; --r-sm: 8px;
  --fuente: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: light;
}
[data-theme="dark"] {
  --shell: #0a0e14; --surf: #111827; --card: #161e2e; --borde: #243045; --linea: #1c2536;
  --texto: #e6edf3; --tenue: #a7b1bf; --suave: #8b97a8;
  --acc: #6250d6; --acc-txt: #a99ff0; --acc-bg: #221d3d;
  --urg-t: #fca5a5; --urg-bg: #331a1c;
  --med-t: #fcd34d; --med-bg: #2e2612;
  --baj-t: #93c5fd; --baj-bg: #13223d;
  --ok-t: #6ee7a0; --ok-bg: #11291c;
  --gri-t: #b8c1cf; --gri-bg: #1f2937;
  --celda: #1c2536; --rep: #199e70;
  --sombra: 0 1px 3px rgba(0,0,0,.4);
  --sombra-alta: 0 12px 32px rgba(0,0,0,.5);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { background: var(--shell); color: var(--texto); font: 14px/1.5 var(--fuente); -webkit-font-smoothing: antialiased; }
button, select, input { font: inherit; color: inherit; }
[hidden] { display: none !important; }
.oculto { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ico { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ico-sm { width: 16px; height: 16px; }
:is(button, a, select, input, [tabindex]):focus-visible { outline: 2px solid var(--acc); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ── Las dos tarjetas ───────────────────────────────────────────────────────── */
.shell { display: flex; gap: 14px; padding: 14px; min-height: 100vh; align-items: flex-start; }
.side { width: 250px; flex: none; position: sticky; top: 14px; height: calc(100vh - 28px); overflow-y: auto; background: var(--surf);
  border: 1px solid var(--borde); border-radius: var(--r-xl); box-shadow: var(--sombra); padding: 14px; display: flex; flex-direction: column; gap: 4px; z-index: 40; }
.main { flex: 1; min-width: 0; background: var(--surf); border: 1px solid var(--borde); border-radius: var(--r-xl); box-shadow: var(--sombra); min-height: calc(100vh - 28px); }
.marca { display: flex; align-items: center; gap: 10px; padding: 4px 6px 12px; border-bottom: 1px solid var(--borde); }
.marca img { width: 36px; height: 36px; border-radius: 10px; display: block; }
.marca b { display: block; font-size: 1.12rem; font-weight: 700; color: var(--texto); letter-spacing: -.2px; line-height: 1.2; }
.marca span { display: block; font-size: .76rem; color: var(--tenue); }
.campo-lado { display: flex; flex-direction: column; gap: 4px; margin: 10px 4px 6px; font-size: .75rem; color: var(--tenue); font-weight: 600; }
.nav { display: flex; flex-direction: column; gap: 2px; margin-top: 4px; }
.nav-it { display: flex; align-items: center; gap: 11px; width: 100%; text-align: left; background: none; cursor: pointer; color: var(--tenue);
  border: 0; border-left: 3px solid transparent; border-radius: 11px; padding: 9px 11px; font-size: .88rem; font-weight: 600; white-space: nowrap;
  transition: background .15s, color .15s; text-decoration: none; min-height: 40px; }
.nav-it:hover { color: var(--texto); background: var(--acc-bg); }
.nav-it[aria-current="page"] { color: var(--acc-txt); background: var(--acc-bg); border-left-color: var(--acc); }
.nav-n { margin-left: auto; min-width: 22px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--urg); color: #fff; font-size: .72rem;
  font-weight: 700; line-height: 20px; text-align: center; }
.sys { margin-top: auto; padding: 12px 6px 0; border-top: 1px solid var(--borde); font-size: .78rem; color: var(--tenue); display: flex; flex-direction: column; gap: 6px; }
.sys > div { display: flex; justify-content: space-between; gap: 8px; }
.sys b { color: var(--texto); font-weight: 600; text-align: right; max-width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sys-t { font-size: .68rem; letter-spacing: .06em; text-transform: uppercase; font-weight: 700; }
.punto { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); display: inline-block; margin-right: 6px; box-shadow: 0 0 0 3px rgba(12,163,12,.15); }

/* ── Cabecera de la tarjeta derecha ── */
.mhead { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 10px; padding: 12px 18px; background: var(--surf);
  border-bottom: 1px solid var(--borde); border-radius: var(--r-xl) var(--r-xl) 0 0; }
.mhead h1 { font-size: 1.05rem; margin: 0; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mhead-marca { display: none; align-items: center; gap: 9px; }
.mhead-marca img { width: 30px; height: 30px; border-radius: 9px; }
.mhead-marca b { font-size: 1rem; }
.mhead-acc { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.demo-banda { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 16px 22px 0; padding: 9px 14px; border-radius: var(--r-md);
  background: var(--med-bg); color: var(--med-t); font-size: .84rem; border: 1px solid rgba(250,178,25,.45); }
.demo-banda b { letter-spacing: .06em; font-size: .76rem; padding: 2px 8px; border-radius: 6px; background: var(--med); color: #3d2600; }
/* Ejemplos de una cuenta real: misma franja que la demostración, con el botón «Borrar ejemplos» al final. */
.ej-banda span { flex: 1 1 260px; }
.ej-banda .btn { height: 34px; }
.contenido { padding: 22px; }

/* ── Controles ── */
.campo { height: 38px; padding: 0 10px; border: 1px solid var(--borde); border-radius: var(--r-sm); background: var(--surf); color: var(--texto); font-size: .88rem; min-width: 0; }
.btn { height: 38px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 0 14px; border: 1px solid var(--borde);
  border-radius: var(--r-sm); background: var(--surf); color: var(--texto); font-size: .88rem; font-weight: 500; cursor: pointer; white-space: nowrap; text-decoration: none; }
.btn:hover { background: var(--acc-bg); border-color: var(--acc); }
.btn:disabled { opacity: .6; cursor: default; }
.btn-pri { background: var(--acc); border-color: var(--acc); color: var(--acc-on); font-weight: 600; }
.btn-pri:hover { background: #5340c4; border-color: #5340c4; color: #fff; }
.btn-icono { width: 38px; padding: 0; }
.seg { display: inline-flex; border: 1px solid var(--borde); border-radius: var(--r-sm); overflow: hidden; background: var(--card); }
.seg button { height: 36px; padding: 0 14px; border: 0; background: none; cursor: pointer; font-size: .86rem; color: var(--tenue); font-weight: 600; }
.seg button[aria-pressed="true"] { background: var(--surf); color: var(--acc-txt); box-shadow: inset 0 -2px 0 var(--acc); }
.enlace { white-space: nowrap; background: none; border: 0; padding: 4px 0; color: var(--acc-txt); font-size: .86rem; font-weight: 600; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; gap: 4px; }
.enlace:hover { text-decoration: underline; }

/* ── Vistas ── */
.vcab { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.vcab h2 { font-size: 1.4rem; font-weight: 700; margin: 0; letter-spacing: -.3px; }
.vcab p { margin: 4px 0 0; color: var(--tenue); font-size: .9rem; max-width: 640px; }
.vcab-acc { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.tarjeta { background: var(--surf); border: 1px solid var(--borde); border-radius: var(--r-lg); padding: 18px; min-width: 0; }
.tarjeta h3 { font-size: 1rem; font-weight: 700; margin: 0; }
.tarjeta .sub { color: var(--tenue); font-size: .84rem; margin: 4px 0 14px; }
.tcab { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.rej { display: grid; gap: 14px; }
.rej + .rej { margin-top: 14px; }
.rej-hero { grid-template-columns: minmax(300px, 1.05fr) 2fr; }
.rej-2 { grid-template-columns: 1.25fr 1fr; }
.rej-2i { grid-template-columns: 1fr 1fr; }
.rej-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.rej-k { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.pila { display: flex; flex-direction: column; gap: 14px; min-width: 0; }

/* Salud de la flota (anillo + barra) */
.salud { display: flex; flex-direction: column; gap: 16px; }
.salud-top { display: flex; align-items: center; gap: 18px; }
.anillo { position: relative; width: 132px; height: 132px; flex: none; }
.anillo svg { width: 132px; height: 132px; transform: rotate(-90deg); }
.anillo-n { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.anillo-n b { font-size: 2.3rem; font-weight: 700; letter-spacing: -1px; line-height: 1; }
.anillo-n span { font-size: .78rem; color: var(--tenue); margin-top: 2px; }
.salud-txt b { font-size: 1.05rem; display: block; }
.salud-txt p { margin: 4px 0 0; color: var(--tenue); font-size: .86rem; }
.barra-est { display: flex; gap: 2px; height: 12px; border-radius: 6px; overflow: hidden; background: var(--linea); }
.barra-est i { display: block; height: 100%; }
.leyenda { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: .82rem; color: var(--tenue); }
.leyenda button { display: inline-flex; align-items: center; gap: 6px; background: none; border: 0; padding: 4px 0; cursor: pointer; color: var(--tenue); font-size: .82rem; min-height: 32px; }
.leyenda button:hover { color: var(--texto); }
.leyenda b { color: var(--texto); font-weight: 700; }
.mk { width: 10px; height: 10px; border-radius: 3px; display: inline-block; flex: none; }

/* KPI */
.kpi { display: flex; flex-direction: column; gap: 6px; text-align: left; cursor: pointer; background: var(--surf); border: 1px solid var(--borde);
  border-radius: var(--r-lg); padding: 16px; transition: border-color .15s, box-shadow .15s; min-height: 118px; color: var(--texto); }
.kpi:hover { border-color: var(--acc); box-shadow: var(--sombra); }
.kpi-cab { display: flex; align-items: center; gap: 10px; font-size: .86rem; color: var(--tenue); font-weight: 600; }
.kpi-ic { width: 34px; height: 34px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.kpi b { font-size: 2rem; font-weight: 700; letter-spacing: -.8px; line-height: 1.1; }
.kpi small { color: var(--tenue); font-size: .8rem; }

/* Pastillas de estado y urgencia: color + palabra, nunca solo color */
.pas { display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px; border-radius: 999px; font-size: .78rem; font-weight: 700; white-space: nowrap; line-height: 20px; }
.pas::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.p-urgente, .p-alta { background: var(--urg-bg); color: var(--urg-t); }
.p-atencion, .p-media { background: var(--med-bg); color: var(--med-t); }
.p-vigilar, .p-baja { background: var(--baj-bg); color: var(--baj-t); }
.p-sano { background: var(--ok-bg); color: var(--ok-t); }
.p-sin_reporte, .p-sin_equipo, .p-sin_clasificar { background: var(--gri-bg); color: var(--gri-t); }
.cod { display: inline-flex; align-items: center; gap: 6px; padding: 3px 8px; border-radius: 7px; font: 700 .8rem/1.2 var(--mono); border: 1px solid var(--borde); background: var(--card); white-space: nowrap; }
.cod i { width: 8px; height: 8px; border-radius: 2px; display: inline-block; }
.i-alta { background: var(--urg); } .i-media { background: var(--med); } .i-baja { background: var(--baj); } .i-sin_clasificar { background: var(--gri); }
.taller-t { font-size: .78rem; color: var(--tenue); white-space: nowrap; }

/* Lista "Atender primero" */
.lista { display: flex; flex-direction: column; }
.fila { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 11px 6px; min-height: 56px; border: 0; border-top: 1px solid var(--linea);
  background: none; color: var(--texto); cursor: pointer; border-radius: 8px; }
.fila:first-child { border-top: 0; }
.fila:hover { background: var(--acc-bg); }
.fila-t { display: flex; flex-direction: column; min-width: 0; flex: 1; gap: 4px; }
.fila-p { font-weight: 700; font-size: .95rem; display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.fila-p small { color: var(--tenue); font-weight: 500; font-size: .82rem; }
.fila-c { display: flex; gap: 6px; flex-wrap: wrap; }
.fila-d { text-align: right; flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.chev { color: var(--suave); }

/* Tablas */
.tabla-env { overflow-x: auto; border: 1px solid var(--borde); border-radius: var(--r-md); }
table.t { width: 100%; border-collapse: collapse; font-size: .86rem; }
table.t th { text-align: left; font-size: .76rem; color: var(--tenue); font-weight: 700; padding: 10px 12px; background: var(--card); border-bottom: 1px solid var(--borde); line-height: 1.3; }
table.t th.num { text-align: right; }
table.t td { padding: 10px 12px; border-bottom: 1px solid var(--linea); vertical-align: middle; }
table.t tr:last-child td { border-bottom: 0; }
table.t tbody tr.clic { cursor: pointer; }
table.t tbody tr.clic:hover td { background: var(--acc-bg); }
table.t .num { text-align: right; font-variant-numeric: tabular-nums; }
.veh-n { font-weight: 700; } .veh-s { color: var(--tenue); font-size: .8rem; }

/* Filtros */
.filtros { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 14px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { height: 34px; display: inline-flex; align-items: center; gap: 7px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--borde); background: var(--surf);
  font-size: .84rem; cursor: pointer; color: var(--tenue); font-weight: 600; }
.chip b { color: var(--texto); }
.chip[aria-pressed="true"] { border-color: var(--acc); color: var(--acc-txt); background: var(--acc-bg); }
.buscar { position: relative; flex: 1 1 220px; max-width: 320px; }
.buscar .ico { position: absolute; left: 10px; top: 10px; color: var(--suave); }
.buscar input { width: 100%; padding-left: 34px; }

/* Mapa de calor */
.calor { overflow-x: auto; }
.calor-rej { display: grid; gap: 3px 0; min-width: 560px; }
.calor-f { display: grid; grid-template-columns: 150px 1fr; align-items: center; gap: 10px; border: 0; background: none; padding: 0; cursor: pointer; text-align: left; color: var(--texto); border-radius: 6px; }
.calor-f:hover .calor-n { color: var(--acc-txt); }
.calor-n { font-size: .8rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.calor-n small { color: var(--tenue); font-weight: 500; margin-left: 4px; }
.calor-c { display: grid; grid-template-columns: repeat(30, 1fr); gap: 2px; }
.calor-c i { display: block; height: 16px; border-radius: 3px; background: var(--celda); }
.calor-c i.c1 { background: var(--baj); } .calor-c i.c2 { background: var(--gri); } .calor-c i.c3 { background: var(--med); } .calor-c i.c4 { background: var(--urg); }
.calor-eje { display: grid; grid-template-columns: 150px 1fr; gap: 10px; font-size: .74rem; color: var(--suave); margin-top: 6px; }
.calor-eje div { display: flex; justify-content: space-between; }

/* Gráficos SVG */
.graf { width: 100%; display: block; overflow: visible; }
.graf text { font: 11px var(--fuente); fill: var(--suave); }
.graf .lbl { fill: var(--texto); font-weight: 700; }
.graf .rejilla { stroke: var(--linea); stroke-width: 1; }
.graf .base { stroke: var(--borde); stroke-width: 1; }
.barras-h { display: flex; flex-direction: column; gap: 10px; }
.bh { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px; align-items: center; }
.bh-t { font-size: .86rem; min-width: 0; display: flex; align-items: center; gap: 8px; line-height: 1.35; }
.bh-t small { color: var(--tenue); }
.bh-v { font-size: .84rem; font-variant-numeric: tabular-nums; color: var(--tenue); text-align: right; }
.bh-v b { color: var(--texto); }
.bh-b { grid-column: 1 / -1; height: 8px; border-radius: 4px; background: var(--linea); overflow: hidden; }
.bh-b i { display: block; height: 100%; border-radius: 0 4px 4px 0; background: var(--acc); }
.veredicto { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: var(--r-md); background: var(--card); border: 1px solid var(--borde); margin-bottom: 12px; }
.veredicto .vic { width: 38px; height: 38px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.v-mejora .vic { background: var(--ok-bg); color: var(--ok-t); }
.v-empeora .vic { background: var(--urg-bg); color: var(--urg-t); }
.v-igual .vic { background: var(--gri-bg); color: var(--gri-t); }
.veredicto b { display: block; font-size: 1rem; }
.veredicto span { color: var(--tenue); font-size: .84rem; }
.pct { font-weight: 700; }
.leyenda-g { display: flex; gap: 14px; font-size: .8rem; color: var(--tenue); margin-bottom: 8px; flex-wrap: wrap; }
.leyenda-g span { display: inline-flex; align-items: center; gap: 6px; }
.tip { position: fixed; z-index: 100; pointer-events: none; background: var(--texto); color: var(--surf); padding: 7px 10px; border-radius: 8px; font-size: .8rem; box-shadow: var(--sombra-alta); max-width: 260px; }

/* Ficha */
.ficha-cab { display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; margin-bottom: 16px; }
.ficha-ic { width: 54px; height: 54px; border-radius: 14px; background: var(--acc-bg); color: var(--acc-txt); display: inline-flex; align-items: center; justify-content: center; flex: none; }
.ficha-ic .ico { width: 28px; height: 28px; }
.ficha-cab h2 { margin: 0; font-size: 1.45rem; letter-spacing: -.3px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ficha-meta { display: flex; flex-wrap: wrap; gap: 4px 14px; color: var(--tenue); font-size: .86rem; margin-top: 4px; }
.ficha-meta b { color: var(--texto); font-weight: 600; }
.mini-k { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.mini-k div { background: var(--card); border: 1px solid var(--borde); border-radius: var(--r-md); padding: 12px 14px; }
.mini-k b { display: block; font-size: 1.4rem; letter-spacing: -.4px; }
.mini-k span { color: var(--tenue); font-size: .8rem; }
.dtc { border: 1px solid var(--borde); border-radius: var(--r-lg); padding: 16px; display: flex; flex-direction: column; gap: 10px; background: var(--surf); position: relative; overflow: hidden; }
.dtc::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; }
.dtc.u-alta::before { background: var(--urg); } .dtc.u-media::before { background: var(--med); } .dtc.u-baja::before { background: var(--baj); } .dtc.u-sin_clasificar::before { background: var(--gri); }
.dtc-cab { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.dtc-cod { font: 700 1.25rem/1 var(--mono); letter-spacing: .5px; }
.dtc-tit { font-weight: 700; font-size: 1rem; }
.dtc p { margin: 0; font-size: .9rem; }
.dtc .et { display: block; font-size: .74rem; font-weight: 700; color: var(--tenue); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 2px; }
.dtc-pie { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding-top: 10px; border-top: 1px solid var(--linea); }
.dtc-pie small { color: var(--tenue); font-size: .82rem; }
.rej-dtc { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; }
.lt { width: 100%; }
.vacio { text-align: center; padding: 28px 16px; color: var(--tenue); }
.vacio .ico { width: 34px; height: 34px; color: var(--suave); margin-bottom: 8px; }
.vacio b { display: block; color: var(--texto); font-size: 1rem; margin-bottom: 4px; }
.vacio p { max-width: 520px; margin: 0 auto 14px; }
.aviso { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: var(--r-md); background: var(--acc-bg); color: var(--texto); font-size: .88rem; }
.aviso .ico { color: var(--acc-txt); margin-top: 2px; }

/* Taller */
.kanban { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.col { background: var(--card); border: 1px solid var(--borde); border-radius: var(--r-lg); padding: 12px; min-width: 0; }
.col-cab { display: flex; align-items: center; justify-content: space-between; padding: 2px 4px 10px; font-weight: 700; font-size: .9rem; }
.col-cab span { min-width: 26px; height: 22px; padding: 0 8px; border-radius: 11px; background: var(--surf); border: 1px solid var(--borde); font-size: .78rem; line-height: 20px; text-align: center; }
.col-l { display: flex; flex-direction: column; gap: 8px; }
.tk { background: var(--surf); border: 1px solid var(--borde); border-radius: var(--r-md); padding: 11px 12px; display: flex; flex-direction: column; gap: 6px; cursor: pointer; text-align: left; color: var(--texto); width: 100%; }
.tk:hover { border-color: var(--acc); }
.tk-a { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.tk-a b { font-size: .9rem; }
.tk small { color: var(--tenue); font-size: .8rem; }
.dias { font-weight: 700; font-variant-numeric: tabular-nums; }

/* Informe (documento) */
.doc { background: #fff; color: #101828; border: 1px solid var(--borde); border-radius: var(--r-lg); padding: 28px; max-width: 900px; }
.doc h3 { font-size: 1.05rem; margin: 22px 0 8px; color: #101828; }
.doc-cab { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; border-bottom: 2px solid #101828; padding-bottom: 14px; flex-wrap: wrap; }
.doc-cab b { font-size: 1.3rem; display: block; }
.doc-cab span { color: #475467; font-size: .86rem; }
.doc .rej-k4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-top: 16px; }
.doc .rej-k4 div { border: 1px solid #e4e7ec; border-radius: 10px; padding: 12px; }
.doc .rej-k4 b { font-size: 1.6rem; display: block; }
.doc .rej-k4 span { font-size: .8rem; color: #475467; }
.doc table.t { font-size: .84rem; } .doc table.t th { background: #f8fafc; color: #475467; } .doc table.t td { border-color: #eef1f5; color: #101828; }
.doc .pas.p-alta, .doc .pas.p-urgente { background: #fdecea; color: #b42318; } .doc .pas.p-media, .doc .pas.p-atencion { background: #fef3dc; color: #8a4b00; }
.doc .pas.p-baja, .doc .pas.p-vigilar { background: #e8effd; color: #1d4ed8; } .doc .pas.p-sin_clasificar { background: #f2f4f7; color: #475467; }
tr.demo-fila { display: none; }
#imprimir .demo-doc { background: #fef3dc; color: #7a2e0e; font-size: .78rem; font-weight: 700; padding: 4px 10px; border-radius: 6px; display: inline-block; }
.doc .demo-doc { background: #fef3dc; color: #7a2e0e; font-size: .78rem; font-weight: 700; padding: 4px 10px; border-radius: 6px; display: inline-block; margin-bottom: 12px; }
.form-correo { display: grid; grid-template-columns: 1fr 220px auto; gap: 10px; align-items: end; }
.form-correo label { display: flex; flex-direction: column; gap: 4px; font-size: .8rem; color: var(--tenue); font-weight: 600; }
.marco-correo { width: 100%; height: 520px; border: 1px solid var(--borde); border-radius: var(--r-md); background: #f2f4f7; margin-top: 12px; }

/* Diccionario */
.dic-l { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 10px; }
.dic-it { border: 1px solid var(--borde); border-radius: var(--r-md); padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; }
.dic-it .dtc-cab { justify-content: space-between; }
.dic-it p { margin: 0; font-size: .86rem; }
.crit { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.crit div { border: 1px solid var(--borde); border-radius: var(--r-md); padding: 12px; font-size: .84rem; color: var(--tenue); display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }

/* Avisos flotantes */
.toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); z-index: 120; background: var(--texto); color: var(--surf); padding: 12px 16px;
  border-radius: 12px; box-shadow: var(--sombra-alta); font-size: .88rem; max-width: min(520px, calc(100vw - 32px)); display: flex; gap: 12px; align-items: center; }
.toast button { background: none; border: 0; color: inherit; cursor: pointer; padding: 4px; display: inline-flex; }

/* Entrada */
.entrada { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.entrada-c { background: var(--surf); border: 1px solid var(--borde); border-radius: 22px; box-shadow: var(--sombra-alta); padding: 32px; width: 100%; max-width: 440px; text-align: center; }
.entrada-c img { width: 64px; height: 64px; border-radius: 16px; }
.entrada-c h1 { font-size: 1.5rem; margin: 14px 0 6px; }
.entrada-c p { color: var(--tenue); margin: 0 0 18px; }
.entrada-l { display: flex; flex-direction: column; gap: 10px; text-align: left; }
.entrada-l button { display: flex; align-items: center; gap: 12px; padding: 14px; border: 1px solid var(--borde); border-radius: 12px; background: var(--card); cursor: pointer; min-height: 60px; }
.entrada-l button:hover { border-color: var(--acc); background: var(--acc-bg); }
.entrada-l small { color: var(--tenue); display: block; }

/* Esqueleto de carga */
.esq { background: linear-gradient(90deg, var(--linea), var(--card), var(--linea)); background-size: 200% 100%; animation: brillo 1.2s infinite; border-radius: 10px; }
@keyframes brillo { to { background-position: -200% 0; } }

/* Barra de abajo y hoja «Más» (celular) */
.barra-cel { display: none; }
.hoja-fondo { position: fixed; inset: 0; background: rgba(16,24,40,.45); z-index: 90; }
.hoja { position: fixed; left: 0; right: 0; bottom: 0; z-index: 95; background: var(--surf); border-radius: 20px 20px 0 0; padding: 10px 16px calc(18px + env(safe-area-inset-bottom, 0px)); box-shadow: var(--sombra-alta); animation: subir .2s ease-out; }
@keyframes subir { from { transform: translateY(100%); } }
.hoja-asa { width: 40px; height: 5px; border-radius: 3px; background: var(--borde); margin: 0 auto 12px; }
.hoja .nav-it { font-size: 1rem; min-height: 50px; }
.hoja-fila { display: flex; gap: 8px; padding: 10px 11px; align-items: center; justify-content: space-between; border-top: 1px solid var(--linea); margin-top: 6px; }

@media (max-width: 1180px) {
  .rej-hero { grid-template-columns: 1fr; }
  .rej-2 { grid-template-columns: 1fr; }
  .rej-3 { grid-template-columns: 1fr 1fr; }
}
@media screen and (max-width: 760px) { /* solo pantalla: el PDF (A4, ~720 px) usa el diseño de PC */
  body { font-size: 15px; }
  .shell { padding: 0; gap: 0; display: block; }
  .side { display: none; }
  .main { border: 0; border-radius: 0; box-shadow: none; min-height: 100vh; padding-bottom: calc(74px + env(safe-area-inset-bottom, 0px)); }
  .mhead { border-radius: 0; padding: 10px 16px; top: env(safe-area-inset-top, 0px); }
  .mhead h1 { display: none; }
  .mhead-marca { display: flex; }
  .mhead-acc .solo-pc { display: none; }
  .demo-banda { margin: 12px 16px 0; font-size: .82rem; }
  .contenido { padding: 16px; }
  .vcab h2 { font-size: 1.3rem; }
  .rej-2i, .rej-3, .kanban, .crit { grid-template-columns: 1fr; }
  .rej-k { gap: 10px; }
  .kpi { min-height: 108px; padding: 14px; }
  .kpi b { font-size: 1.75rem; }
  .salud-top { gap: 14px; }
  .anillo, .anillo svg { width: 112px; height: 112px; }
  .anillo-n b { font-size: 2rem; }
  .mini-k { grid-template-columns: 1fr 1fr; }
  .rej-dtc { grid-template-columns: 1fr; }
  .tabla-cel-oculta { display: none; }
  .tcab { flex-wrap: wrap; } /* título y botones de exportar: si no caben juntos, los botones bajan */
  /* Tablas como fichas: rótulo a la izquierda, valor a la derecha (los rótulos los pone etiquetarTablas en app.js). */
  .tabla-env { overflow-x: visible; }
  table.t thead { display: none; }
  table.t, table.t tbody, table.t tr { display: block; width: 100%; }
  table.t tr { padding: 10px 14px; border-bottom: 1px solid var(--linea); }
  table.t tbody tr:last-child { border-bottom: 0; }
  table.t td { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 3px 0; border: 0; text-align: right; min-width: 0; }
  table.t td.num { text-align: right; }
  table.t td::before { content: attr(data-l); color: var(--tenue); font-size: .78rem; font-weight: 600; text-align: left; flex: 0 0 auto; max-width: 45%; }
  table.t td:first-child { display: block; text-align: left; padding: 0 0 4px; font-size: .95rem; }
  table.t td:first-child::before { content: none; }
  table.t td.tabla-cel-oculta { display: none; }
  .calor-f, .calor-eje { grid-template-columns: 64px 1fr; }
  .calor-n .cn-nombre { display: none; }
  .calor-n small { margin-left: 0; color: var(--texto); font-weight: 600; }
  .calor-rej { min-width: 0; }
  .calor-c { gap: 1px; } .calor-c i { height: 14px; border-radius: 2px; }
  .buscar { max-width: none; flex-basis: 100%; }
  .form-correo { grid-template-columns: 1fr; }
  .doc { padding: 18px; } .doc .rej-k4 { grid-template-columns: 1fr 1fr; }
  .col-l { max-height: none; }
  .barra-cel { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; background: var(--surf);
    border-top: 1px solid var(--borde); padding: 6px 4px calc(6px + env(safe-area-inset-bottom, 0px)); box-shadow: 0 -4px 16px rgba(16,24,40,.06); }
  .barra-cel button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; background: none; border: 0; color: var(--tenue);
    font-size: .72rem; font-weight: 600; min-height: 56px; cursor: pointer; position: relative; }
  .barra-cel button .ico { width: 22px; height: 22px; }
  .barra-cel button[aria-current="page"] { color: var(--acc-txt); }
  .barra-cel .nav-n { position: absolute; top: 2px; left: calc(50% + 6px); margin: 0; height: 18px; min-width: 18px; line-height: 18px; font-size: .68rem; }
  .toast { bottom: calc(84px + env(safe-area-inset-bottom, 0px)); }
}

/* Imprimir / PDF: solo el documento del informe */
@media print {
  body { background: #fff; }
  .side, .mhead, .barra-cel, .demo-banda, .no-imprimir, .toast { display: none !important; }
  .shell { padding: 0; display: block; } .main { border: 0; box-shadow: none; }
  .contenido { padding: 0; } .doc { border: 0; padding: 0 2px; max-width: none; } /* 2 px: el borde derecho no queda en el filo de la hoja */
  /* En la demostración, la marca va en el encabezado de cada tabla, que el navegador repite en cada hoja. */
  tr.demo-fila { display: table-row !important; } tr.demo-fila th { text-align: center; font-size: 8pt; font-weight: 700; color: #7a2e0e; background: #fef3dc !important; }
  #imprimir tr { break-inside: avoid; }
  .doc h3 { break-after: avoid; page-break-after: avoid; } .doc tr, .doc .rej-k4 div { break-inside: avoid; }
}
