﻿/* ============================================================
   BioPatterns Cloud — sistema de diseño (F10.1c)
   Dirección: GRAFITO NEUTRO. El principio: el cromo es gris para que
   el ÚNICO color de la pantalla sean los datos — si el shell fuera azul
   corporativo, el azul dejaría de significar algo y los rojos de alarma
   competirían con la decoración.
   Responsive desde el nacimiento (el portal F13 hereda este shell).
   ============================================================ */
:root {
  /* --- superficies (grises neutros, sin tinte) --- */
  --page: #f7f7f8;
  --panel: #ffffff;
  --panel-2: #fbfbfc;
  --rail: #22252b;            /* la barra lateral */
  --rail-ink: #b8bcc4;
  --rail-ink-strong: #ffffff;
  --rail-ink-dim: #767c88;
  --rail-hover: rgba(255,255,255,.07);
  --rail-active: rgba(255,255,255,.10);

  /* --- tinta --- */
  --ink: #22252b;
  --ink-2: #6b7280;
  --ink-muted: #9096a1;

  /* --- líneas --- */
  --hairline: #e5e5e8;
  --grid: #d6d7db;

  /* --- el ÚNICO acento del cromo ---
     ÍNDIGO a propósito: ningún DATO lo usa (verde=bien, rojo=alarma,
     ámbar=aviso, azul=serie), así el acento nunca compite con el dato.
     El aqua anterior daba ΔE 11.8 contra el verde de "ya llegaron" (bajo el
     piso de 12) y ΔE 1.9 en daltonismo tritán = el MISMO color: la marca y el
     menú activo se veían como "todo bien". Índigo da ΔE 75.5. Medido, no a ojo. */
  --accent: #5b5bd6;
  --accent-soft: #ecebfb;
  --accent-ink: #4338ca;

  /* --- estado (reservados: jamás se usan de adorno) --- */
  --ok: #1D9E75;
  --ok-soft: #e1f5ee;
  --warn: #BA7517;
  --warn-soft: #faeeda;
  --crit: #d43d3d;
  --crit-soft: #fdeeee;
  --info: #378ADD;
  --warn-ink: #854F0B;   /* tinta sobre el fondo tintado del badge */
  --crit-ink: #A32D2D;
  --ok-ink: #0F6E56;
  --mut-soft: #eef0f3;

  /* --- serie de gráficas: VALIDADA con el script del sistema de diseño
         (banda de luminosidad, piso de croma, separación CVD ΔE 62 en
         deuteranopía y contraste) en claro y oscuro. No tocar a ojo. --- */
  --c-ok: #1D9E75;
  --c-info: #378ADD;
  --c-warn: #BA7517;
  --c-neutral: #888780;   /* neutro deliberado (no es una serie más) */

  --radius: 8px;
  --rail-w: 218px;
  --rail-w-collapsed: 56px;
}

/* ============================================================
   TEMA OSCURO
   Tres estados: claro · oscuro · automático (sigue al sistema).
   El bloque se escribe UNA vez y se aplica por dos vías:
     · [data-theme="dark"]  → elección explícita del usuario
     · @media prefers-color-scheme + :root:not([data-theme]) → automático
   El riel casi no cambia (ya era grafito): en oscuro el CONTENIDO se le
   acerca, así que el contraste lo dan las superficies, no el color.
   La serie de gráficas NO cambia: la misma paleta pasó las 4 pruebas del
   validador contra este fondo (#16181c) — verificado, no supuesto.
   ============================================================ */
:root[data-theme="dark"] {
  /* color-scheme le dice al NAVEGADOR que pinte sus controles nativos en oscuro.
     Sin esto el calendario de <input type=date> sale blanco sobre el panel
     oscuro: el CSS no puede alcanzar ese popup, sólo esta propiedad. */
  color-scheme: dark;
  --page: #16181c;
  --panel: #1e2126;
  --panel-2: #24272d;
  --rail: #101216;
  --rail-ink: #a7adb9;
  --rail-ink-strong: #ffffff;
  --rail-ink-dim: #6b7280;
  --rail-hover: rgba(255,255,255,.06);
  --rail-active: rgba(255,255,255,.10);

  --ink: #e8e9ec;
  --ink-2: #a2a8b4;
  --ink-muted: #767c88;

  --hairline: #2c3037;
  --grid: #3a3f48;

  --accent: #818cf8;
  --accent-soft: #262552;
  --accent-ink: #a5b0ff;

  --ok: #2bb583;
  --ok-soft: #12352a;
  --warn: #d8912a;
  --warn-soft: #38290f;
  --crit: #e56060;
  --crit-soft: #3a1d1d;
  --info: #5b9fe6;
  --warn-ink: #f0b458;
  --crit-ink: #f09595;
  --ok-ink: #5dcaa5;
  --mut-soft: #2c3037;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;   /* idem: los controles nativos siguen al tema */
    --page: #16181c;
    --panel: #1e2126;
    --panel-2: #24272d;
    --rail: #101216;
    --rail-ink: #a7adb9;
    --rail-ink-strong: #ffffff;
    --rail-ink-dim: #6b7280;
    --rail-hover: rgba(255,255,255,.06);
    --rail-active: rgba(255,255,255,.10);

    --ink: #e8e9ec;
    --ink-2: #a2a8b4;
    --ink-muted: #767c88;

    --hairline: #2c3037;
    --grid: #3a3f48;

    --accent: #818cf8;
    --accent-soft: #262552;
    --accent-ink: #a5b0ff;

    --ok: #2bb583;
    --ok-soft: #12352a;
    --warn: #d8912a;
    --warn-soft: #38290f;
    --crit: #e56060;
    --crit-soft: #3a1d1d;
    --info: #5b9fe6;
    --warn-ink: #f0b458;
    --crit-ink: #f09595;
    --mut-soft: #2c3037;
  }
}

* { box-sizing: border-box; margin: 0; }
html, body { height: 100%; }
body {
  font: 14px/1.5 "Segoe UI", system-ui, -apple-system, sans-serif;
  background: var(--page); color: var(--ink);
  -webkit-font-smoothing: antialiased;
}
button { font: inherit; cursor: pointer; }
a { color: inherit; }

/* ============================================================
   SHELL
   ============================================================ */
/* App-shell de altura fija: el cromo (riel, topbar) NO se mueve; el scroll vive
   DENTRO de #view (o, en páginas full-height como los catálogos master/detail,
   dentro de sus paneles). Antes el scroll era de la ventana con topbar sticky. */
.shell { display: flex; height: 100dvh; overflow: hidden; }
.shell[hidden] { display: none; }

.rail {
  width: var(--rail-w); flex-shrink: 0;
  background: var(--rail); color: var(--rail-ink);
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
  transition: width .16s ease;
}
.shell.collapsed .rail { width: var(--rail-w-collapsed); }

.brand {
  display: flex; align-items: center; gap: 10px;
  padding: 15px 16px 14px; border-bottom: 1px solid rgba(255,255,255,.07);
  white-space: nowrap; overflow: hidden;
}
.brand i { font-size: 21px; color: var(--accent); flex-shrink: 0; }
.brand-text { line-height: 1.15; }
.brand-name { color: var(--rail-ink-strong); font-weight: 600; font-size: 13.5px; }
.brand-sub { font-size: 9.5px; color: var(--rail-ink-dim); letter-spacing: .1em; }
.shell.collapsed .brand-text { display: none; }
.shell.collapsed .brand { justify-content: center; padding: 15px 0 14px; }

.nav { display: flex; flex-direction: column; padding: 8px; gap: 1px; flex: 1; overflow-y: auto; }
.nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 11px; border-radius: 6px;
  color: var(--rail-ink); text-decoration: none; font-size: 13px;
  white-space: nowrap; border-left: 2px solid transparent;
}
.nav a i { font-size: 17px; flex-shrink: 0; }
.nav a:hover { background: var(--rail-hover); color: var(--rail-ink-strong); }
.nav a.active {
  background: var(--rail-active); color: var(--rail-ink-strong);
  border-left-color: var(--accent); border-radius: 0 6px 6px 0;
}
.nav a[hidden] { display: none; }
.shell.collapsed .nav a { justify-content: center; padding: 8px 0; border-left: none; border-radius: 6px; }
.shell.collapsed .nav a span { display: none; }

.rail-foot {
  padding: 10px; border-top: 1px solid rgba(255,255,255,.07);
  display: flex; flex-direction: column; gap: 2px;
}
.rail-btn {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 11px; border-radius: 6px; border: none; background: none;
  color: var(--rail-ink); font-size: 12.5px; text-align: left; width: 100%;
  white-space: nowrap;
}
.rail-btn i { font-size: 16px; flex-shrink: 0; }
.rail-btn:hover { background: var(--rail-hover); color: var(--rail-ink-strong); }
.shell.collapsed .rail-btn { justify-content: center; padding: 8px 0; }
.shell.collapsed .rail-btn span { display: none; }

/* ---------- contenido ---------- */
.content { flex: 1; min-width: 0; display: flex; flex-direction: column; min-height: 0; }
.topbar {
  display: flex; align-items: center; gap: 11px;
  padding: 11px 20px; background: var(--panel);
  border-bottom: 1px solid var(--hairline);
  position: sticky; top: 0; z-index: 8;
}
.icon-btn {
  border: none; background: none; color: var(--ink-2);
  display: flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: 6px; position: relative;
}
.icon-btn i { font-size: 17px; }
.icon-btn:hover { background: var(--page); color: var(--ink); }
.page-title { font-size: 15px; font-weight: 600; }
.page-note { font-size: 12px; color: var(--ink-muted); }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 4px; }

.dot {
  position: absolute; top: 3px; right: 3px;
  min-width: 15px; height: 15px; padding: 0 4px;
  background: var(--crit); color: #fff;
  font-size: 9.5px; font-weight: 600; line-height: 15px;
  border-radius: 8px; text-align: center;
}
.dot[hidden] { display: none; }

/* ---------- selector de tema (claro · oscuro · automático) ---------- */
.theme-seg { display: inline-flex; border: 1px solid var(--grid); border-radius: 999px; overflow: hidden; margin-right: 2px; }
.theme-seg button {
  border: none; background: none; color: var(--ink-muted);
  width: 28px; height: 26px; display: flex; align-items: center; justify-content: center;
}
.theme-seg button i { font-size: 15px; }
.theme-seg button:hover { color: var(--ink); }
.theme-seg button.on { background: var(--accent-soft); color: var(--accent-ink); }
@media (max-width: 620px) { .theme-seg { display: none; } }

.avatar {
  width: 27px; height: 27px; border-radius: 50%;
  background: var(--rail); color: #fff;
  font-size: 10px; font-weight: 600;
  display: flex; align-items: center; justify-content: center;
  margin-left: 4px; flex-shrink: 0;
}

.view { flex: 1; min-height: 0; overflow-y: auto; padding: 18px 20px 40px; max-width: 1240px; width: 100%; }
/* Página full-height (catálogos master/detail): los tabs quedan fijos y sólo los
   paneles internos scrollean. Si un contenedor no acota la altura, height:100%
   cae a auto ⇒ no afecta a las páginas normales (siguen fluyendo y scrollea #view). */
.pg-full { height: 100%; display: flex; flex-direction: column; min-height: 0; }
.pg-full > .tabs { flex-shrink: 0; }
.pg-full .pg-body { flex: 1; min-height: 0; display: flex; }
.pg-full .md { flex: 1; min-height: 0; align-items: stretch; margin: 0; }
.pg-full .md-list, .pg-full .md-detail { overflow-y: auto; min-height: 0; }
.pg-full .cat-scroll { max-height: none; }   /* el scroll lo lleva .md-list, no la tabla */

/* ---------- panel lateral (notificaciones / ayuda) ---------- */
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(360px, 92vw);
  background: var(--panel); border-left: 1px solid var(--hairline);
  z-index: 30; display: flex; flex-direction: column;
  box-shadow: -8px 0 32px rgba(0,0,0,.10);
}
.drawer[hidden] { display: none; }
.drawer-head {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 16px; border-bottom: 1px solid var(--hairline);
}
.drawer-head h2 { font-size: 14px; font-weight: 600; }
.drawer-body { padding: 14px 16px; overflow-y: auto; font-size: 13px; color: var(--ink-2); }
.drawer-item {
  display: flex; gap: 11px; padding: 11px 0;
  border-bottom: 1px solid var(--hairline);
}
.drawer-item:last-child { border-bottom: none; }
.drawer-item i { font-size: 17px; flex-shrink: 0; margin-top: 1px; }
.drawer-item .di-title { color: var(--ink); font-weight: 500; font-size: 13px; }
.drawer-item .di-sub { font-size: 12px; color: var(--ink-muted); margin-top: 1px; }
.scrim { position: fixed; inset: 0; background: rgba(20,22,26,.28); z-index: 25; }
.scrim[hidden] { display: none; }

/* ---------- responsive ---------- */
@media (max-width: 880px) {
  .rail {
    /* z-index POR ENCIMA del scrim (25): con el cajón abierto, el scrim cubre
       toda la pantalla para cerrar-al-tocar-fuera, pero NO debe tapar el propio
       riel — si el scrim queda encima (era z-20 < 25), tocar un link del menú
       caía en el scrim y sólo cerraba el cajón: "no hace nada". Cazado por
       Wences en iPhone; invisible en escritorio (ahí el riel es fijo, sin scrim). */
    position: fixed; z-index: 30; left: 0; top: 0; width: var(--rail-w);
    transform: translateX(-100%); transition: transform .18s ease;
  }
  .shell.collapsed .rail { width: var(--rail-w); }
  .shell.collapsed .brand-text, .shell.collapsed .nav a span, .shell.collapsed .rail-btn span { display: revert; }
  .shell.collapsed .nav a { justify-content: flex-start; padding: 8px 11px; }
  .rail.open { transform: translateX(0); box-shadow: 0 0 48px rgba(0,0,0,.4); }
  .view { padding: 14px 14px 40px; }
}

/* ============================================================
   PIEZAS DE PÁGINA
   ============================================================ */
.toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.toolbar-label { font-size: 12.5px; color: var(--ink-2); }
.seg { display: inline-flex; border: 1px solid var(--grid); border-radius: var(--radius); overflow: hidden; background: var(--panel); }
.seg button {
  border: none; background: none; padding: 6px 12px; font-size: 12.5px; color: var(--ink-2);
  display: flex; align-items: center; gap: 6px;
}
.seg button + button { border-left: 1px solid var(--hairline); }
.seg button i { font-size: 15px; }
.seg button.on { background: var(--page); color: var(--ink); font-weight: 600; }

/* ---------- tiles ---------- */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(148px, 1fr)); gap: 10px; margin-bottom: 18px; }
.tile { background: var(--panel); border: 1px solid var(--hairline); border-radius: var(--radius); padding: 12px 14px; }
.tile .t-num { font-size: 24px; font-weight: 600; line-height: 1.15; }
.tile .t-label { font-size: 11.5px; color: var(--ink-2); margin-top: 2px; }
.tile.ok   .t-num { color: var(--ok); }
.tile.warn .t-num { color: var(--warn); }
.tile.crit .t-num { color: var(--crit); }
.tile.crit { border-left: 3px solid var(--crit); }

/* ---------- resumen en lista ---------- */
.sumlist { background: var(--panel); border: 1px solid var(--hairline); border-radius: var(--radius); overflow: hidden; margin-bottom: 18px; }
.sumlist div { display: flex; justify-content: space-between; align-items: center; padding: 9px 14px; font-size: 13px; }
.sumlist div + div { border-top: 1px solid var(--hairline); }
.sumlist .s-label { color: var(--ink-2); }
.sumlist .s-num { font-weight: 600; }

/* ---------- gráficas ---------- */
.charts { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 12px; margin-bottom: 18px; }
.chart-card { background: var(--panel); border: 1px solid var(--hairline); border-radius: var(--radius); padding: 14px 16px; }
.chart-card h2 { font-size: 13.5px; font-weight: 600; margin-bottom: 12px; }
.chart-row { display: flex; align-items: center; gap: 18px; }

/* La dona: el SVG dibuja los arcos y el centro es HTML superpuesto, en px
   reales (dentro del viewBox el texto quedaba en ~7px, ilegible). */
.dona { position: relative; width: 146px; height: 146px; flex-shrink: 0; }
.dona svg { width: 100%; height: 100%; display: block; }
.dona-centro {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  pointer-events: none; line-height: 1.1;
}
.dona-num { font-size: 30px; font-weight: 600; color: var(--ink); }
.dona-lbl { font-size: 11.5px; color: var(--ink-muted); margin-top: 2px; }
.legend { font-size: 12.5px; display: flex; flex-direction: column; gap: 6px; flex: 1; min-width: 0; }
.legend div { display: flex; align-items: center; gap: 8px; }
.legend .sw { width: 9px; height: 9px; border-radius: 2px; flex-shrink: 0; }
.legend .lb { color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.legend .vn { font-weight: 600; margin-left: auto; }

/* ---------- paneles y tablas ---------- */
.board { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 12px; }
.panel { background: var(--panel); border: 1px solid var(--hairline); border-radius: var(--radius); padding: 14px 16px; }
.panel h2 { font-size: 13.5px; font-weight: 600; margin-bottom: 10px; }
.panel h2 .count { color: var(--ink-muted); font-weight: 400; }
.panel .empty { color: var(--ink-muted); font-size: 12.5px; padding: 6px 0; }
/* "No se pudo cargar" NO es lo mismo que "no hay": un panel que falla tiene que
   verse distinto de uno vacío, o la ficha afirma tranquilamente que alguien no
   tiene biometría cuando en realidad no pudo preguntar. */
.panel .empty.err { color: var(--crit); display: flex; align-items: center; gap: 6px; }
.panel .empty.err i { font-size: 15px; }

table.list { width: 100%; border-collapse: collapse; font-size: 12.5px; }
table.list th {
  text-align: left; font-size: 10.5px; text-transform: uppercase; letter-spacing: .05em;
  color: var(--ink-muted); font-weight: 600; padding: 4px 8px 6px; border-bottom: 1px solid var(--hairline);
}
table.list td { padding: 7px 8px; border-bottom: 1px solid var(--hairline); }
table.list tr:last-child td { border-bottom: none; }

/* La tinta del badge sale de su propia familia y por variable: si se quemara
   (#854F0B), en oscuro quedaría ilegible sobre el fondo tintado. */
.badge { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 11px; font-weight: 600; }
.badge.warn { background: var(--warn-soft); color: var(--warn-ink); }
.badge.crit { background: var(--crit-soft); color: var(--crit-ink); }
.badge.ok   { background: var(--ok-soft); color: var(--ok-ink); }
.badge.mut  { background: var(--mut-soft); color: var(--ink-2); }

.note { font-size: 11.5px; color: var(--ink-muted); margin-top: 14px; }

/* ============================================================
   PESTAÑAS DENTRO DE LA PÁGINA (F10.2)
   La alternativa a los submenús: el riel se queda en 9 elementos
   escaneables y el modo colapsado no necesita flyouts (patrón UKG/Workday).
   ============================================================ */
.tabs {
  display: flex; gap: 2px; margin-bottom: 16px;
  border-bottom: 1px solid var(--hairline);
  /* Scrollea si no caben (móvil), pero SIN barra a la vista: en escritorio,
     con 3 o 4 pestañas, la barra sólo era ruido junto al borde derecho. */
  overflow-x: auto;
  scrollbar-width: none;            /* Firefox */
  -ms-overflow-style: none;         /* Edge viejo */
}
.tabs::-webkit-scrollbar { display: none; }   /* Chrome/Safari */
.tabs a {
  display: flex; align-items: center; gap: 7px; flex-shrink: 0;
  padding: 9px 13px; font-size: 13px; color: var(--ink-2); text-decoration: none;
  border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap;
}
.tabs a i { font-size: 16px; }
.tabs a:hover { color: var(--ink); }
.tabs a.on { color: var(--accent-ink); border-bottom-color: var(--accent); font-weight: 600; }

/* ---------- botones ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 12px; font-size: 12.5px; border-radius: 6px;
  border: 1px solid var(--grid); background: var(--panel); color: var(--ink);
}
.btn i { font-size: 15px; }
.btn:hover:not(:disabled) { background: var(--page); }
.btn:disabled { opacity: .45; cursor: default; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.btn.primary:hover { filter: brightness(1.08); background: var(--accent); }
.btn.danger { color: var(--crit); border-color: var(--crit-soft); }
.btn.danger:hover { background: var(--crit-soft); }

/* ---------- búsqueda ---------- */
.search { position: relative; flex: 1; min-width: 180px; max-width: 380px; }
.search i {
  position: absolute; left: 9px; top: 50%; transform: translateY(-50%);
  color: var(--ink-muted); font-size: 16px; pointer-events: none;
}
.search input {
  width: 100%; font: inherit; font-size: 13px; padding: 7px 10px 7px 31px;
  border: 1px solid var(--grid); border-radius: 6px;
  background: var(--panel); color: var(--ink);
}
.search input:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: transparent; }

.pager { display: flex; align-items: center; gap: 10px; margin-top: 12px; font-size: 12.5px; color: var(--ink-2); }

/* ---------- tabla con filas navegables ---------- */
/* Contenido ancho: scrollea DENTRO de su caja. La página nunca se mueve en
   horizontal — en móvil la tabla de 6 columnas empujaba el body a 518px
   sobre un viewport de 375 (cazado midiendo, no a ojo). */
.tabla-scroll { overflow-x: auto; }
table.list.rows tbody tr { cursor: pointer; }
table.list.rows tbody tr:hover { background: var(--panel-2); }
table.list.rows tbody tr:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
table.list .nom { font-weight: 500; }
table.list .sub { display: block; font-size: 11px; color: var(--ink-muted); margin-top: 1px; }
table.list td.right { text-align: right; white-space: nowrap; }
table.list .go { color: var(--ink-muted); font-size: 15px; vertical-align: middle; margin-left: 6px; }

/* ============================================================
   FICHA 360
   ============================================================ */
.ficha-head { margin-bottom: 14px; }
.volver {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 12px; color: var(--ink-2); text-decoration: none; margin-bottom: 12px;
  background: none; border: 0; padding: 0; cursor: pointer; font-family: inherit;
}
.volver:hover { color: var(--accent-ink); }
.ficha-id { display: flex; align-items: center; gap: 13px; }
.ficha-av {
  width: 42px; height: 42px; border-radius: 50%; flex-shrink: 0;
  background: var(--rail); color: #fff; font-size: 14px; font-weight: 600;
  display: flex; align-items: center; justify-content: center;
}
.ficha-nom { font-size: 17px; font-weight: 600; display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
/* El VALOR con tinta plena y la etiqueta apagada: el dato se lee de un vistazo
   sin que la línea grite. Antes todo iba en --ink-2 y el gafete se perdía. */
.ficha-sub { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12.5px; color: var(--ink); margin-top: 5px; }
.ficha-sub span { display: inline-flex; align-items: center; gap: 5px; font-weight: 500; }
.ficha-sub em { font-style: normal; font-weight: 400; color: var(--ink-muted); }
.ficha-sub i { font-size: 14px; color: var(--ink-muted); }

.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(330px, 1fr)); gap: 12px; margin-bottom: 12px; }
.cols .panel { margin: 0; }

/* Pares etiqueta/valor. Columna de etiqueta de ancho fijo y el valor JUNTO a
   ella: con `space-between` la etiqueta quedaba pegada a la izquierda y el valor
   al extremo derecho, y el ojo tenía que cruzar la tarjeta entera para aparear
   cada renglón. */
.kv { display: flex; flex-direction: column; gap: 1px; }
.kv div {
  display: grid; grid-template-columns: 118px 1fr; gap: 12px;
  align-items: baseline; padding: 7px 0; font-size: 13px;
}
.kv div + div { border-top: 1px solid var(--hairline); }
.kv span { color: var(--ink-2); }
.kv b { font-weight: 600; text-align: left; }
@media (max-width: 480px) { .kv div { grid-template-columns: 1fr; gap: 1px; } }
.mono { font-family: ui-monospace, Consolas, monospace; font-size: 11px; color: var(--ink-muted); margin-left: 5px; }

/* ---------- formularios ---------- */
.form { display: flex; flex-direction: column; gap: 11px; }
.form label { display: flex; flex-direction: column; font-size: 11.5px; font-weight: 600; color: var(--ink-2); gap: 4px; }
.form input, .form select {
  font: inherit; font-size: 13px; padding: 7px 9px; font-weight: 400;
  border: 1px solid var(--grid); border-radius: 6px;
  background: var(--panel-2); color: var(--ink); width: 100%;
}
.form input:focus, .form select:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: transparent; }
.form .row2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 11px; }
.form .hint { font-size: 10.5px; color: var(--ink-muted); font-weight: 400; line-height: 1.35; }
.form .sep {
  font-size: 10.5px; text-transform: uppercase; letter-spacing: .05em; font-weight: 600;
  color: var(--ink-muted); border-top: 1px solid var(--hairline); padding-top: 11px; margin-top: 3px;
}
.form label.chk { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 7px; align-self: end; padding-bottom: 7px; }
.form label.chk input { width: auto; }
.form label.chk[hidden] { display: none; }
.form label.chk .hint { flex-basis: 100%; }
.form [inert] { opacity: .6; }
.acciones { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; margin-top: 4px; }
.acciones select {
  font: inherit; font-size: 12.5px; padding: 6px 9px;
  border: 1px solid var(--grid); border-radius: 6px; background: var(--panel-2); color: var(--ink);
}
.form-msg { font-size: 12px; margin-top: 2px; }
.form-msg.ok  { color: var(--ok); }
.form-msg.err { color: var(--crit); }
.form-msg[hidden] { display: none; }
.hint { font-size: 10.5px; color: var(--ink-muted); line-height: 1.4; }
.hint a, .empty a { color: var(--accent-ink); }

/* ---------- historial SCD2 ---------- */
.tl { list-style: none; padding: 0 0 0 15px; margin: 0; position: relative; }
.tl::before { content: ""; position: absolute; left: 3px; top: 5px; bottom: 5px; width: 1px; background: var(--hairline); }
.tl li { position: relative; padding: 0 0 15px 8px; font-size: 12.5px; }
.tl li::before {
  content: ""; position: absolute; left: -15px; top: 4px;
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--panel); border: 1.5px solid var(--grid);
}
.tl li.viva::before { background: var(--accent); border-color: var(--accent); }
.tl li.anulada { opacity: .5; text-decoration: line-through; }
.tl-rango { font-size: 11px; color: var(--ink-muted); display: flex; align-items: center; gap: 6px; }
.tl-cuerpo { font-weight: 500; margin-top: 1px; }
.tl-cuerpo .sub { display: block; font-weight: 400; font-size: 11.5px; color: var(--ink-2); }
.tl-pie { font-size: 10.5px; color: var(--ink-muted); margin-top: 1px; }

/* ---------- calendario materializado ---------- */
.cal { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 6px; }
.cal-d {
  position: relative; border: 1px solid var(--hairline); border-radius: 6px;
  padding: 7px 8px; background: var(--panel-2); min-height: 72px;
}
.cal-d.lab  { border-left: 3px solid var(--ok); }
.cal-d.desc { border-left: 3px solid var(--grid); }
.cal-d.fest { border-left: 3px solid var(--warn); background: var(--warn-soft); }
.cal-dow { font-size: 10px; text-transform: uppercase; color: var(--ink-muted); letter-spacing: .04em; }
.cal-num { font-size: 17px; font-weight: 600; line-height: 1.15; }
.cal-txt { font-size: 10.5px; color: var(--ink-2); margin-top: 2px; }
.cal-tag { font-size: 9.5px; color: var(--ink-muted); font-family: ui-monospace, Consolas, monospace; margin-top: 1px; }
.cal-man { position: absolute; top: 6px; right: 6px; font-size: 12px; color: var(--ink-muted); }
.cal-leyenda { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 11px; font-size: 11px; color: var(--ink-2); }
.cal-leyenda span { display: inline-flex; align-items: center; gap: 5px; }
.cal-leyenda .sw { width: 3px; height: 12px; border-radius: 2px; display: inline-block; }
.cal-leyenda .sw.lab  { background: var(--ok); }
.cal-leyenda .sw.desc { background: var(--grid); }
.cal-leyenda .sw.fest { background: var(--warn); }

/* ============================================================
   CREDENCIALES (F10.2c)
   Las manos: cinco barras por lado con altura anatómica y los pulgares al
   centro. Se reconoce como un par de manos sin leer una etiqueta — es la
   convención de cualquier software de huella. La acción vive en el dedo.
   ============================================================ */
.manos { display: flex; gap: 40px; justify-content: center; padding: 14px 0 6px; flex-wrap: wrap; }
.mano { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.mano-dedos { display: flex; align-items: flex-end; gap: 5px; }
.mano-lbl { font-size: 11px; color: var(--ink-muted); }

.fdedo {
  width: 28px; border-radius: 14px 14px 6px 6px;
  border: 1.5px solid var(--grid); background: var(--panel-2);
  display: flex; align-items: flex-start; justify-content: center;
  padding-top: 6px; transition: transform .1s ease, border-color .1s ease;
}
.fdedo i { font-size: 13px; color: var(--ink-muted); }
.fdedo:hover { border-color: var(--accent); transform: translateY(-2px); }
.fdedo:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
/* Enrolado = relleno Y verde: la identidad nunca depende sólo del color */
.fdedo.on { border-color: var(--ok); background: var(--ok-soft); }
.fdedo.on i { color: var(--ok); }
/* El pulgar cuelga más abajo, como en una mano de verdad */
.fdedo.pulgar { margin-bottom: -14px; }

/* El dedo que se está enrolando: late en el color del acento mientras dura la
   operación física. No es adorno — es el ancla visual de "esto es lo que estás
   haciendo ahorita". */
.fdedo.trabajando { border-color: var(--accent); background: var(--accent-soft); }
.fdedo.trabajando i { color: var(--accent-ink); }
.fdedo.trabajando { animation: latir 1.1s ease-in-out infinite; }
@keyframes latir { 50% { opacity: .45; } }

.manos-pie { text-align: center; font-size: 12.5px; color: var(--ink-2); margin-top: 16px; }
.manos-pie b { color: var(--ink); }

/* ---------- progreso de una operación FÍSICA ----------
   Enrolar tarda: el comando entra en cola, el agente lo recoge (~10 s) y luego
   la persona tiene que ir a tocar la terminal. La tira de pasos cuenta esa
   historia; sin ella el usuario no sabe si funcionó y termina dando F5. */
.proceso {
  margin-top: 14px; padding: 12px 14px; border-radius: var(--radius);
  border: 1px solid var(--grid); background: var(--panel-2);
}
.proceso[hidden] { display: none; }
.proceso.delivered { border-color: var(--accent); background: var(--accent-soft); }
.proceso.completed { border-color: var(--ok); background: var(--ok-soft); }
.proceso.failed    { border-color: var(--crit); background: var(--crit-soft); }

.proceso-cab { display: flex; align-items: center; gap: 10px; }
.proceso-cab > i { font-size: 19px; color: var(--ink-2); flex-shrink: 0; }
.proceso.delivered .proceso-cab > i { color: var(--accent-ink); }
.proceso.completed .proceso-cab > i { color: var(--ok); }
.proceso.failed    .proceso-cab > i { color: var(--crit); }
.proceso-cab b { font-size: 13px; display: block; }
.proceso-cab span { font-size: 11.5px; color: var(--ink-2); }
.proceso-extra { font-size: 11px; color: var(--ink-2); margin-top: 8px; line-height: 1.45; }

.girando { animation: girar 1.1s linear infinite; }
@keyframes girar { to { transform: rotate(360deg); } }

/* La tira de pasos: el activo lleva punto lleno y negrita — la identidad no
   depende sólo del color. */
.pasos {
  list-style: none; padding: 0; margin: 11px 0 0;
  display: flex; gap: 6px; flex-wrap: wrap; font-size: 11px; color: var(--ink-muted);
}
.pasos li { display: flex; align-items: center; gap: 5px; }
.pasos li::before {
  content: ""; width: 7px; height: 7px; border-radius: 50%;
  border: 1.5px solid var(--grid); background: transparent;
}
.pasos li + li::after { content: ""; }
.pasos li:not(:last-child)::after {
  content: "›"; margin-left: 5px; color: var(--ink-muted); opacity: .6;
}
.pasos li.ok { color: var(--ink-2); }
.pasos li.ok::before { background: var(--ok); border-color: var(--ok); }
.pasos li.activo { color: var(--ink); font-weight: 600; }
.pasos li.activo::before { background: var(--accent); border-color: var(--accent); }
.pasos li.err { color: var(--crit); font-weight: 600; }
.pasos li.err::before { background: var(--crit); border-color: var(--crit); }

@media (prefers-reduced-motion: reduce) {
  .girando, .fdedo.trabajando { animation: none; }
}

/* ---------- modalidades ---------- */
.creds {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 8px;
  margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--hairline);
}
.cred {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 12px; border: 1px solid var(--hairline); border-radius: var(--radius);
  background: var(--panel-2);
}
.cred.on { border-color: var(--ok); background: var(--ok-soft); }
.cred.pend { opacity: .72; }
.cred-cab { display: flex; align-items: center; gap: 9px; min-width: 0; }
.cred-cab > i { font-size: 21px; color: var(--ink-muted); flex-shrink: 0; }
.cred.on .cred-cab > i { color: var(--ok); }
.cred-nom { font-size: 13px; font-weight: 600; }
.cred-est { font-size: 10.5px; color: var(--ink-2); margin-top: 1px; }
.cred-btn { padding: 5px 9px; font-size: 11.5px; flex-shrink: 0; }
.cred-btn i { font-size: 13px; }

/* ---------- menú contextual ----------
   Vive en <body> con position:fixed: dentro de la tarjeta lo recortaría el
   overflow del panel. */
.menu-cred {
  position: fixed; z-index: 40; width: 262px;
  background: var(--panel); border: 1px solid var(--grid); border-radius: var(--radius);
  box-shadow: 0 12px 32px rgba(0,0,0,.18); overflow: hidden;
}
.menu-cab { padding: 10px 12px; border-bottom: 1px solid var(--hairline); background: var(--panel-2); }
.menu-tit { font-size: 12.5px; font-weight: 600; }
.menu-det { font-size: 10.5px; color: var(--ink-muted); margin-top: 1px; }
.menu-it {
  display: flex; align-items: center; gap: 9px; width: 100%;
  padding: 9px 12px; border: none; background: none; text-align: left; color: var(--ink);
}
.menu-it:hover { background: var(--page); }
.menu-it > i:first-child { font-size: 16px; color: var(--ink-muted); flex-shrink: 0; }
.menu-it span { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.menu-it b { font-size: 12.5px; font-weight: 500; }
.menu-it em { font-style: normal; font-size: 10.5px; color: var(--ink-muted); }
.menu-it .badge { align-self: flex-start; margin-top: 2px; }
.menu-it.peligro:hover { background: var(--crit-soft); }
.menu-it.peligro > i:first-child, .menu-it.peligro b { color: var(--crit); }
.menu-inerte { padding: 10px 12px; font-size: 11.5px; color: var(--ink-muted); line-height: 1.45; }

.chips { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.chips li {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 6px 4px 10px; border-radius: 999px; font-size: 12px;
  background: var(--mut-soft); color: var(--ink);
}
.chips .x {
  border: none; background: none; padding: 0; color: var(--ink-muted);
  display: flex; align-items: center; border-radius: 50%;
}
.chips .x:hover { color: var(--crit); }
.chips .x i { font-size: 14px; }

/* ============================================================
   ESTRUCTURA ORG (F10.2b) — un ÁRBOL dibujado como árbol
   La alternativa era una tabla con columna "padre": el objeto real es una
   jerarquía, así que se dibuja como jerarquía. La línea guía a la izquierda
   hace legible la pertenencia sin leer nada.
   ============================================================ */
/* ---------- acordeón de dimensiones (F10.2f) ----------
   Cada dimensión es una sección colapsable; el encabezado siempre a la vista da
   la foto de conjunto y expandes la que trabajas. El contenido (nodos) se ve en
   lista o árbol a elección. */
.accs { display: flex; flex-direction: column; gap: 8px; }
.acc { border: 1px solid var(--hairline); border-radius: var(--radius); background: var(--panel); overflow: hidden; }
.acc-cab {
  display: flex; align-items: center; gap: 9px; padding: 11px 13px; cursor: pointer; user-select: none;
}
.acc-cab:hover { background: var(--panel-2); }
.acc-cab:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.acc-chevron { font-size: 15px; color: var(--ink-muted); transition: transform .12s ease; flex-shrink: 0; }
.acc.abierta .acc-chevron { transform: rotate(90deg); }
.acc-cab > i:not(.acc-chevron) { font-size: 16px; color: var(--ink-muted); flex-shrink: 0; }
.acc-nom { font-size: 13.5px; font-weight: 600; }
.acc-cab .count { font-size: 10.5px; color: var(--ink-2); background: var(--mut-soft); padding: 1px 7px; border-radius: 999px; }
.acc-cuerpo { padding: 4px 13px 13px; border-top: 1px solid var(--hairline); }
.dim-acc { margin-left: auto; display: flex; gap: 1px; }

/* La coincidencia de la búsqueda, resaltada; los ancestros que sólo son contexto
   (no coinciden, pero cuelgan de ellos los que sí) van atenuados. */
mark { background: var(--accent-soft); color: var(--accent-ink); border-radius: 3px; padding: 0 1px; }
.nodo.contexto { opacity: .55; }
.nodo.contexto .nodo-nom { font-weight: 400; }

.arbol ul { list-style: none; margin: 0; padding: 0; }
/* Los niveles cuelgan de una guía: la sangría sola no dice "pertenece a" */
.arbol > ul > li > ul { margin-left: 9px; padding-left: 11px; border-left: 1px solid var(--hairline); }
.arbol ul ul ul { margin-left: 9px; padding-left: 11px; border-left: 1px solid var(--hairline); }

.nodo {
  display: flex; align-items: center; gap: 7px;
  padding: 5px 6px; border-radius: 6px; font-size: 12.5px;
}
.nodo:hover { background: var(--panel-2); }
.nodo-ico { font-size: 14px; color: var(--ink-muted); flex-shrink: 0; }
.nodo-nom { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Las acciones se ven SIEMPRE, tenues, y se encienden al acercarse. Esconderlas
   del todo y sacarlas con `@media (hover: none)` era una apuesta: hay equipos
   táctiles que reportan hover, y esta pantalla se usa poco — un botón invisible
   en una pantalla que visitas cada seis meses no existe. */
.nodo-acc { display: flex; gap: 1px; opacity: .4; transition: opacity .1s ease; }
.nodo:hover .nodo-acc, .nodo:focus-within .nodo-acc { opacity: 1; }

/* El USO a la vista: es la razón por la que algo no se puede borrar.
   Enseñarlo antes convierte un error en una explicación. */
.uso {
  display: inline-flex; align-items: center; gap: 3px; flex-shrink: 0;
  font-size: 10.5px; font-weight: 600; color: var(--ink-2);
  background: var(--mut-soft); padding: 1px 7px; border-radius: 999px;
}
.uso i { font-size: 11px; }
.uso.vacio { font-weight: 400; background: none; color: var(--ink-muted); }

.ico {
  border: none; background: none; color: var(--ink-muted);
  width: 24px; height: 24px; border-radius: 5px;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.ico i { font-size: 14px; }
.ico:hover:not(:disabled) { background: var(--page); color: var(--ink); }
.ico:disabled { opacity: .3; cursor: default; }
.ico[data-delnodo]:hover, .ico[data-deldim]:hover, .ico[data-del]:hover { color: var(--crit); background: var(--crit-soft); }

.btn.agregar {
  margin-top: 8px; width: 100%; justify-content: center;
  border-style: dashed; color: var(--ink-2); font-size: 12px;
}
.btn.agregar:hover { color: var(--accent-ink); border-color: var(--accent); }

/* ============================================================
   COMPONENTE CATÁLOGO (F10.2e) — la tabla consistente de los maestros de datos.
   Búsqueda + orden por encabezado + lista acotada (scroll con tope o páginas).
   Una sola apariencia en Empleados, Puestos, y luego Turnos/Terminales.
   ============================================================ */
.cat-bar { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.cat-tools { display: flex; align-items: center; gap: 8px; margin-left: auto; }

/* El tope es de ALTO: la lista no crece sin control, scrollea dentro de su caja.
   El overflow-x cubre además el desborde horizontal en móvil (la página nunca
   se desplaza en horizontal). */
.cat-scroll { max-height: 60vh; overflow-y: auto; overflow-x: auto; border-radius: var(--radius); }
.cat-tabla { width: 100%; }
/* Encabezado pegajoso: al scrollear la lista larga, las columnas no se pierden. */
.cat-tabla thead th { position: sticky; top: 0; z-index: 1; background: var(--panel); }

th.orden { cursor: pointer; user-select: none; white-space: nowrap; }
th.orden span { display: inline-flex; align-items: center; gap: 4px; }
th.orden i { font-size: 13px; opacity: .5; }
th.orden:hover { color: var(--ink); }
th.orden.activa { color: var(--ink); }
th.orden.activa i { opacity: 1; color: var(--accent-ink); }
th.orden:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }

.cat-foot { margin-top: 10px; }
.cat-ico { font-size: 15px; color: var(--ink-muted); margin-right: 7px; vertical-align: -2px; }

.alta { display: flex; gap: 8px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--hairline); }
.alta input {
  flex: 1; min-width: 0; font: inherit; font-size: 13px; padding: 7px 10px;
  border: 1px solid var(--grid); border-radius: 6px; background: var(--panel-2); color: var(--ink);
}
.alta input:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: transparent; }

.toolbar input[type=date],
.toolbar input[type=search],
.toolbar input[type=text] {
  font: inherit; font-size: 12.5px; padding: 6px 9px; height: 32px; box-sizing: border-box;
  border: 1px solid var(--grid); border-radius: 6px; background: var(--panel); color: var(--ink); color-scheme: dark light;
}
.toolbar input:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: transparent; }
.toolbar input[type=search]::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; }

/* ---------- la lista en pantalla angosta ----------
   Nombre + Gafete es lo que se necesita para ENCONTRAR a alguien; puesto y
   adscripción bajan como subtítulo y sus columnas se retiran. Todo el dato
   sigue estando a un toque, en la ficha. */
/* OJO con la especificidad: `table.list .sub` (0,1,1) le gana a un `.solo-angosto`
   (0,1,0) suelto, y el subtítulo se colaba en escritorio duplicando las columnas.
   Misma familia que el bug de `[hidden]` vs `display` de S51: aquí se empata el
   selector, no se confía en el orden. */
table.list .sub.solo-angosto { display: none; }
@media (max-width: 720px) {
  /* Las columnas secundarias del catálogo se marcan con .col-sec (ya no por
     nth-child): así el componente decide cuáles bajan sin acoplarse al orden. */
  table.list .col-sec { display: none; }
  table.list .sub.solo-angosto { display: block; }
  .ficha-nom { font-size: 15.5px; }
  .cal { grid-template-columns: repeat(auto-fill, minmax(74px, 1fr)); }
}

.placeholder {
  background: var(--panel); border: 1px dashed var(--grid); border-radius: var(--radius);
  padding: 44px; text-align: center; color: var(--ink-muted); font-size: 13px;
}
.placeholder b { color: var(--ink-2); }
.placeholder a { color: var(--accent-ink); }

/* ============================================================
   LOGIN
   ============================================================ */
.login-overlay {
  position: fixed; inset: 0; background: var(--rail);
  display: flex; align-items: center; justify-content: center; z-index: 50;
}
.login-overlay[hidden] { display: none; }
.login-card {
  background: var(--panel); border-radius: 12px; padding: 32px 34px;
  width: min(370px, 92vw); display: flex; flex-direction: column; text-align: center;
  box-shadow: 0 20px 64px rgba(0,0,0,.4);
}
.login-mark { color: var(--accent); font-size: 34px; margin-bottom: 10px; }
.login-card h1 { font-size: 19px; font-weight: 600; }
.login-sub { color: var(--ink-muted); font-size: 12.5px; margin: 2px 0 22px; letter-spacing: .04em; }
.login-card label { text-align: left; font-size: 11.5px; font-weight: 600; color: var(--ink-2); margin-bottom: 5px; }
.login-card input, .login-card select {
  font: inherit; font-size: 13.5px; padding: 9px 11px; border-radius: 6px; margin-bottom: 12px;
  border: 1px solid var(--grid); background: var(--panel-2); color: var(--ink); width: 100%;
}
.login-card input:focus, .login-card select:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
.login-tenant-row { display: flex; flex-direction: column; }
.login-tenant-row[hidden] { display: none; }
.login-card button[type=submit] {
  margin-top: 10px; font-weight: 600; font-size: 13.5px; padding: 10px;
  border-radius: 6px; border: none; background: var(--accent); color: #fff;
}
.login-card button[type=submit]:hover { filter: brightness(1.08); }
.login-card button[type=submit]:disabled { opacity: .7; }
.login-error { color: var(--crit); font-size: 12px; text-align: left; margin-top: 2px; }
.login-error[hidden] { display: none; }

/* ============================================================
   TIEMPO (F10.3)
   ============================================================ */
.mono-code { font-family: ui-monospace, Consolas, monospace; font-size: 12px; }

/* --- Turnos: un turno es un tramo de tiempo, así que la fila lo DIBUJA --- */
.turno-horas { font-size: 12px; white-space: nowrap; }
.mas1 { font-size: 9.5px; color: var(--ink-muted); vertical-align: 2px; }
/* barra de 24 h: la pista es neutra a propósito (no reclama un color de estado) */
.turno-bar { position: relative; display: block; height: 5px; margin-top: 5px; border-radius: 3px; background: var(--mut-soft); }
.turno-seg { position: absolute; top: 0; height: 100%; background: var(--ink-2); border-radius: 3px; }
.turno-tick { position: absolute; top: -1px; width: 2px; height: 7px; background: var(--ink-muted); border-radius: 1px; }

.badge.info-b { background: var(--mut-soft); color: var(--info); }

/* --- Festivos: selector de calendario --- */
.cal-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.cal-chip {
  display: inline-flex; align-items: center; gap: 8px; padding: 8px 11px; font: inherit;
  border: 1px solid var(--grid); border-radius: var(--radius); background: var(--panel-2);
  cursor: pointer; text-align: left; color: var(--ink);
}
.cal-chip:hover { border-color: var(--ink-muted); }
.cal-chip.on { border-color: var(--accent); background: var(--accent-soft); }
.cal-chip > i { font-size: 16px; color: var(--ink-muted); flex-shrink: 0; }
.cal-chip.on > i { color: var(--accent-ink); }
.cc-nom { font-size: 12.5px; font-weight: 600; }
.cc-def { font-size: 10px; font-weight: 400; color: var(--ink-muted); }
.cc-meta { font-size: 10.5px; color: var(--ink-2); }
.cc-del { display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; border-radius: 50%; color: var(--ink-muted); }
.cc-del:hover { color: var(--crit); background: var(--crit-soft); }
.cc-del i { font-size: 13px; }

.fest-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.fest-nav { display: flex; align-items: center; gap: 6px; }
.fest-year { font-size: 15px; font-weight: 600; min-width: 46px; text-align: center; }

.copiar-box { border: 1px solid var(--hairline); border-radius: var(--radius); background: var(--panel-2); padding: 12px; margin-bottom: 12px; }
.copiar-box[hidden] { display: none; }
.cb-tit { font-size: 12.5px; font-weight: 600; }
.cb-sub { font-size: 11px; color: var(--ink-2); margin: 3px 0 10px; line-height: 1.4; }
.cb-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.cb-row label { font-size: 12px; color: var(--ink-2); display: inline-flex; align-items: center; gap: 6px; }
.cb-row select { font: inherit; font-size: 13px; padding: 6px 8px; border: 1px solid var(--grid); border-radius: 6px; background: var(--panel); color: var(--ink); }

/* --- Festivos: el calendario mensual (un mes = rejilla de 7, lunes primero) --- */
.mescal { display: grid; grid-template-columns: repeat(auto-fill, minmax(146px, 1fr)); gap: 12px; margin-top: 4px; }
.mescal-mes { border: 1px solid var(--hairline); border-radius: var(--radius); padding: 9px 10px; background: var(--panel-2); }
.mescal-tit { font-size: 12.5px; font-weight: 600; margin-bottom: 7px; }
.mescal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.mescal-dow { font-size: 9.5px; color: var(--ink-muted); text-align: center; padding-bottom: 2px; }
.mescal-d {
  font: inherit; font-size: 11px; text-align: center; padding: 4px 0; border-radius: 5px;
  border: 1px solid transparent; background: none; color: var(--ink-2);
  font-variant-numeric: tabular-nums;
}
button.mescal-d { cursor: pointer; }
button.mescal-d:hover { background: var(--page); color: var(--ink); }
.mescal-d.vacio { visibility: hidden; }
/* festivo = ÁMBAR (consistente con el calendario de la ficha; el rojo es alarma) */
.mescal-d.fest { background: var(--warn-soft); color: var(--warn-ink); border-color: var(--warn); font-weight: 600; }
.mescal-d:focus-visible { outline: 2px solid var(--accent); outline-offset: -1px; }

.hol-lista { display: flex; flex-direction: column; gap: 1px; margin-top: 4px; }
.hol-row { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 6px; }
.hol-row:hover { background: var(--panel-2); }
.hr-fecha { font-size: 11px; color: var(--ink-muted); min-width: 58px; font-variant-numeric: tabular-nums; }
.hr-nom { font-size: 12.5px; flex: 1; min-width: 0; }
.hol-row .badge { flex-shrink: 0; }

.asg-form { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.asg-form select {
  flex: 1; min-width: 150px; font: inherit; font-size: 13px; padding: 7px 9px;
  border: 1px solid var(--grid); border-radius: 6px; background: var(--panel-2); color: var(--ink);
}
.asg-form select:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: transparent; }

/* --- Festivos: editor de nombre (popover anclado al día; hereda .menu-cred) --- */
.pop-fest .pf-body { padding: 11px 12px; }
.pf-lbl { display: block; font-size: 11px; font-weight: 600; color: var(--ink-2); margin: 0 0 4px; }
.pf-nom {
  width: 100%; font: inherit; font-size: 13px; padding: 7px 9px; margin-bottom: 10px;
  border: 1px solid var(--grid); border-radius: 6px; background: var(--panel-2); color: var(--ink);
}
.pf-nom:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: transparent; }
.pf-kind { margin-bottom: 10px; }
.pf-acc { display: flex; gap: 7px; margin-top: 4px; }
.pf-acc .btn { padding: 6px 11px; font-size: 12.5px; }

/* ============================================================
   ROTACIONES (F10.3b) — la rejilla PINTABLE
   El color de cada turno es apoyo; el CÓDIGO va siempre en la celda. Las tintas
   son categóricas (rampas CDS validadas), NO estado — este grid no lleva colores
   de estado, así que no compiten con verde=bien / rojo=alarma.
   ============================================================ */
.rp-paleta { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.rp-chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; font: inherit;
  font-size: 12px; font-weight: 600; border-radius: 999px; cursor: pointer;
  background: var(--tb, var(--panel-2)); color: var(--ti, var(--ink)); border: 1.5px solid var(--td, var(--grid));
}
.rp-chip .rp-sw { width: 12px; height: 12px; border-radius: 3px; background: var(--td, transparent); border: 1px solid var(--td, var(--ink-muted)); }
.rp-chip.descanso .rp-sw { border-style: dashed; background: transparent; }
.rp-chip.on { outline: 2px solid var(--accent); outline-offset: 1px; }

.rp-grid { border-collapse: separate; border-spacing: 4px; }
.rp-grid thead th { font-size: 11px; font-weight: 600; color: var(--ink-2); padding-bottom: 2px; }
.rp-grid tbody th { font-size: 11px; font-weight: 600; color: var(--ink-2); text-align: right; padding-right: 5px; white-space: nowrap; }
.rp-cel {
  min-width: 42px; height: 38px; font: inherit; font-size: 12px; font-weight: 600; cursor: pointer;
  border-radius: 6px; background: var(--tb, var(--panel-2)); color: var(--ti, var(--ink-muted)); border: 1.5px solid var(--td, var(--grid));
}
.rp-cel:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

/* tintas categóricas: cada clase define --tb/--ti/--td (bg/tinta/borde) y los
   componentes las consumen; se voltean por tema. Rampas: teal, púrpura, coral,
   rosa, azul, ámbar (50/800 claro; 800/100 oscuro). */
.tinta-0 { --tb:#E1F5EE; --ti:#085041; --td:#5DCAA5; }
.tinta-1 { --tb:#EEEDFE; --ti:#3C3489; --td:#AFA9EC; }
.tinta-2 { --tb:#FAECE7; --ti:#712B13; --td:#F0997B; }
.tinta-3 { --tb:#FBEAF0; --ti:#72243E; --td:#ED93B1; }
.tinta-4 { --tb:#E6F1FB; --ti:#0C447C; --td:#85B7EB; }
.tinta-5 { --tb:#FAEEDA; --ti:#633806; --td:#EF9F27; }
:root[data-theme="dark"] .tinta-0 { --tb:#085041; --ti:#9FE1CB; --td:#1D9E75; }
:root[data-theme="dark"] .tinta-1 { --tb:#3C3489; --ti:#CECBF6; --td:#7F77DD; }
:root[data-theme="dark"] .tinta-2 { --tb:#712B13; --ti:#F5C4B3; --td:#D85A30; }
:root[data-theme="dark"] .tinta-3 { --tb:#72243E; --ti:#F4C0D1; --td:#D4537E; }
:root[data-theme="dark"] .tinta-4 { --tb:#0C447C; --ti:#B5D4F4; --td:#378ADD; }
:root[data-theme="dark"] .tinta-5 { --tb:#633806; --ti:#FAC775; --td:#BA7517; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) .tinta-0 { --tb:#085041; --ti:#9FE1CB; --td:#1D9E75; }
  :root:not([data-theme]) .tinta-1 { --tb:#3C3489; --ti:#CECBF6; --td:#7F77DD; }
  :root:not([data-theme]) .tinta-2 { --tb:#712B13; --ti:#F5C4B3; --td:#D85A30; }
  :root:not([data-theme]) .tinta-3 { --tb:#72243E; --ti:#F4C0D1; --td:#D4537E; }
  :root:not([data-theme]) .tinta-4 { --tb:#0C447C; --ti:#B5D4F4; --td:#378ADD; }
  :root:not([data-theme]) .tinta-5 { --tb:#633806; --ti:#FAC775; --td:#BA7517; }
}

/* --- Asignaciones: selección múltiple --- */
/* Red de seguridad del bug S51: un <label> con [hidden] dentro de .form no se
   ocultaba porque `.form label{display:flex}` (0,1,1) vence a `[hidden]` (0,1,0).
   Esta regla (0,2,1) lo devuelve a la normalidad para cualquier label futuro. */
.form label[hidden] { display: none; }

.selbox {
  display: inline-block; width: 16px; height: 16px; border: 1.5px solid var(--grid);
  border-radius: 4px; position: relative; vertical-align: -3px; background: var(--panel);
}
.selbox.on { background: var(--accent); border-color: var(--accent); }
.selbox.on::after {
  content: ""; position: absolute; left: 4px; top: 1px; width: 4px; height: 8px;
  border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg);
}
.cat-tabla tbody tr.sel { background: var(--accent-soft); }

.sel-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 12px; }
.sel-chip {
  display: inline-flex; align-items: center; font-size: 12px; padding: 3px 9px;
  border-radius: 999px; background: var(--accent-soft); color: var(--accent-ink);
}
.sel-chip.mut { background: var(--mut-soft); color: var(--ink-2); }
.sel-chips .btn { margin-left: auto; padding: 4px 10px; font-size: 12px; }
.toolbar .sel-chips { margin-bottom: 0; }

/* Alcance de eventos (11.3): chips quitables en el editor + radios */
.alc-radios { display: flex; flex-wrap: wrap; gap: 18px; margin-bottom: 8px; }
.alc-chips { margin-bottom: 8px; }
.alc-chips .sel-chip { gap: 4px; }
.alc-chips .sel-chip i[data-rmalc] { cursor: pointer; margin-left: 4px; }
.alc-add { align-items: end; }
.asg-cal-lbl { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--ink-2); }
.asg-cal-lbl select {
  font: inherit; font-size: 13px; padding: 6px 9px; border: 1px solid var(--grid);
  border-radius: 6px; background: var(--panel-2); color: var(--ink);
}
.asg-cal-lbl select:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: transparent; }

/* ============================================================
   INCIDENCIAS (F10.4) — bandeja de excepciones + captura en lote
   ============================================================ */
.toolbar select {
  font: inherit; font-size: 12.5px; padding: 6px 9px; border: 1px solid var(--grid);
  border-radius: 6px; background: var(--panel-2); color: var(--ink); color-scheme: dark light;
}
.toolbar select:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: transparent; }

/* Resumen de la bandeja: tiles de ANCHO FIJO (no estiran). El grid .tiles de
   "Hoy" reparte 1fr y con 1 solo tile lo estira a todo lo ancho; aquí el conteo
   es variable (1–4), así que van en flex sin crecer. */
.resumen-tiles { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 18px; }
.resumen-tiles .tile { flex: 0 0 auto; min-width: 130px; }

/* grupo colapsable por empleado (la cola se lee como una cola, no una tabla) */
/* overflow VISIBLE (antes hidden): deja escapar el dropdown de "Justificar
   directo" anclado al botón; el redondeo se hace en el header y la última fila. */
.grupo { border: 1px solid var(--hairline); border-radius: var(--radius); background: var(--panel); margin-bottom: 10px; }
.grupo-cab { border-radius: 7px 7px 0 0; }
.grupo.cerrado .grupo-cab { border-radius: 7px; }
.grupo-cab {
  display: flex; align-items: center; gap: 11px; padding: 10px 14px; cursor: pointer;
  background: var(--panel-2); border-bottom: 1px solid var(--hairline);
}
.grupo-cab:hover { background: var(--mut-soft); }
.grupo-cab:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.grupo-cab .chev { color: var(--ink-2); font-size: 16px; transition: transform .12s; }
.grupo.cerrado .grupo-cab .chev { transform: rotate(-90deg); }
.grupo.cerrado .grupo-cab { border-bottom: none; }
.grupo.cerrado .grupo-body { display: none; }
.grupo-cab .badge { margin-left: auto; flex-shrink: 0; }
.ava {
  width: 30px; height: 30px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-ink);
  display: inline-flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 600; flex-shrink: 0;
}
.grupo-id { min-width: 0; }
.grupo-id .nom { font-weight: 500; font-size: 13.5px; }
.grupo-id .sub { font-size: 11.5px; color: var(--ink-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* fila de excepción: fecha · punto de color · código+nombre · origen · justificar */
.exc-fila { display: flex; align-items: center; gap: 11px; padding: 9px 14px 9px 16px; border-bottom: 1px solid var(--hairline); }
.exc-fila:last-child { border-bottom: none; }
.exc-fecha { width: 88px; flex-shrink: 0; font-size: 12px; color: var(--ink-2); text-transform: capitalize; }
.exc-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; background: var(--ink-muted); }
.exc-dot.falta { background: var(--crit); }
.exc-dot.ret   { background: var(--warn); }
.exc-dot.otra  { background: var(--ink-muted); }
.exc-what { flex: 1; min-width: 0; font-size: 12.5px; }
.exc-what .exc-name { color: var(--ink-2); margin-left: 4px; }
.exc-min { color: var(--warn-ink); margin-left: 6px; }
.exc-src { font-size: 11px; color: var(--ink-muted); flex-shrink: 0; }
.exc-just-btn, .exc-dir-btn { padding: 4px 10px; font-size: 12px; flex-shrink: 0; }
.exc-delcap { flex-shrink: 0; }
.exc-delcap:hover:not(:disabled) { color: var(--crit); background: var(--crit-soft); }
.exc-just-btn.on, .exc-dir-btn.on { border-color: var(--accent); color: var(--accent-ink); }
.exc-dir-btn { border-color: var(--accent); color: var(--accent-ink); }

/* menú de "Justificar directo": dropdown ANCLADO al botón (un clic aplica) */
.exc-acciones { position: relative; display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.exc-directo {
  position: absolute; top: calc(100% + 4px); right: 0; z-index: 30;
  display: flex; flex-direction: column; gap: 3px; min-width: 232px; max-width: 320px;
  background: var(--panel); border: 1px solid var(--hairline); border-radius: 10px;
  box-shadow: 0 8px 26px rgba(0,0,0,.16); padding: 6px;
}
.dir-op {
  display: flex; align-items: center; gap: 8px; width: 100%; max-width: 340px;
  border: 1px solid var(--grid); border-radius: 6px; background: var(--panel);
  padding: 7px 10px; font: inherit; font-size: 12.5px; color: var(--ink); cursor: pointer; text-align: left;
}
.dir-op:hover { border-color: var(--accent); }
.dir-op:disabled { opacity: .6; cursor: default; }
.dir-op > i:first-child { color: var(--ok); font-size: 15px; flex-shrink: 0; }
.dir-nom { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dir-nota { font-size: 10.5px; color: var(--ink-muted); display: inline-flex; align-items: center; gap: 3px; flex-shrink: 0; }
.exc-directo .j-msg { font-size: 12px; margin-top: 4px; }
.exc-directo .j-msg.ok  { color: var(--ok); }
.exc-directo .j-msg.err { color: var(--crit); }

/* En pantalla angosta la fila NO cabe con los dos botones (medido: 436px sobre
   358): se parte en dos líneas — datos arriba, acciones abajo — y el origen
   (Motor/Capturada) se retira por secundario. Sin el min-width, .exc-what se
   colapsa a 0 y deja que los botones desborden en vez de bajar. */
@media (max-width: 560px) {
  .exc-fila { flex-wrap: wrap; row-gap: 7px; }
  .exc-fila .exc-src { display: none; }
  .exc-fila .exc-what { min-width: 130px; }
  .exc-just { padding-left: 16px; }
  .exc-directo { max-width: calc(100vw - 40px); }
}

/* panel de justificar inline (la acción vive en la excepción) */
.exc-just {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  padding: 10px 14px 12px 88px; background: var(--accent-soft); border-bottom: 1px solid var(--hairline);
}
.exc-just select, .exc-just input {
  font: inherit; font-size: 12.5px; padding: 6px 9px; border: 1px solid var(--grid);
  border-radius: 6px; background: var(--panel); color: var(--ink); color-scheme: dark light;
}
.exc-just input { flex: 1; min-width: 130px; }
.exc-just .j-msg { font-size: 12px; flex-basis: 100%; }
.exc-just .j-msg.ok  { color: var(--ok); }
.exc-just .j-msg.err { color: var(--crit); }

/* selector de nodo como ÁRBOL en popover (reusa .arbol/.nodo) */
.nodo-sel { position: relative; display: inline-block; }
.nodo-btn {
  display: inline-flex; align-items: center; gap: 7px; max-width: 230px; height: 32px; box-sizing: border-box;
  border: 1px solid var(--grid); border-radius: 6px; padding: 6px 10px; font: inherit; font-size: 12.5px;
  background: var(--panel); color: var(--ink); cursor: pointer;
}
.nodo-btn:hover { border-color: var(--accent); }
.nodo-btn-lbl { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nodo-btn .chev { color: var(--ink-muted); flex-shrink: 0; }
.nodo-pop {
  position: absolute; top: calc(100% + 4px); left: 0; z-index: 40; width: 300px; max-width: 86vw;
  background: var(--panel); border: 1px solid var(--hairline); border-radius: 10px;
  box-shadow: 0 8px 26px rgba(0,0,0,.16); overflow: hidden;
}
.nodo-pop[hidden] { display: none; }
.nodo-pop-search { display: flex; align-items: center; gap: 8px; padding: 9px 12px; border-bottom: 1px solid var(--hairline); color: var(--ink-muted); }
.nodo-pop-search input { flex: 1; border: none; background: none; font: inherit; font-size: 12.5px; color: var(--ink); outline: none; }
.nodo-pop-body { max-height: 300px; overflow-y: auto; padding: 6px; }
.nodo-dim-h { padding: 8px 8px 3px; font-size: 10.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-muted); }
.nodo-todos { display: flex; align-items: center; gap: 8px; padding: 7px 8px; border-radius: 6px; cursor: pointer; font-size: 12.5px; color: var(--ink-2); }
.nodo-todos:hover { background: var(--panel-2); }
.nodo-todos.sel, .nodo-pop .selnodo.sel { background: var(--accent-soft); color: var(--accent-ink); font-weight: 500; }
.nodo-pop .selnodo { cursor: pointer; border-radius: 6px; }
.nodo-pop .selnodo-exp { cursor: pointer; }
.nodo-pop .arbol { margin-top: 2px; }

/* captura: encabezado + selección por nodo + chips de nodo */
.cap-intro { font-size: 11.5px; color: var(--ink-muted); margin: -2px 0 12px; line-height: 1.5; }
.cap-pornodo { margin-bottom: 10px; }
.cap-nodo-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.cap-nodo-chips:not(:empty) { margin-bottom: 12px; }
.cap-nodo-chips .sel-chip i { cursor: pointer; margin-left: 2px; }

/* multi-select de tipos: toggle "Sólo excepciones" + checklist en popover */
.tipo-slot { display: inline-flex; align-items: center; gap: 10px; }
.tb-toggle { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--ink-2); cursor: pointer; white-space: nowrap; }

/* switch on/off reusable */
.switch { position: relative; display: inline-block; width: 34px; height: 18px; flex-shrink: 0; }
.switch input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.switch .slider { position: absolute; inset: 0; background: var(--mut-soft); border: 1px solid var(--grid); border-radius: 999px; transition: background .15s; }
.switch .slider::before { content: ""; position: absolute; width: 12px; height: 12px; left: 2px; top: 2px; background: #fff; border-radius: 50%; box-shadow: 0 1px 2px rgba(0,0,0,.25); transition: transform .15s; }
.switch input:checked + .slider { background: var(--accent); border-color: var(--accent); }
.switch input:checked + .slider::before { transform: translateX(16px); }
.switch input:focus-visible + .slider { outline: 2px solid var(--accent); outline-offset: 1px; }
.tipo-sel { position: relative; display: inline-block; }
.nodo-pop.tipo-pop { width: 232px; max-height: 340px; overflow-y: auto; padding-bottom: 6px; }
.tipo-it { display: flex; align-items: center; gap: 8px; padding: 6px 10px; font-size: 12.5px; border-radius: 6px; cursor: pointer; }
.tipo-it:hover { background: var(--panel-2); }
.tipo-it input { width: auto; margin: 0; }

/* ============================================================
   MASTER / DETAIL (F10.4c) — lista a todo el ancho → clic → índice + formulario
   ============================================================ */
.md { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 12px; }
.md-list, .md-detail { margin: 0; min-width: 0; }
.md-list { flex: 1; }
.md-detail { flex: 1; }
.md:not(.split) .md-detail { display: none; }        /* sin selección: sólo la lista, a todo el ancho */
.md.split .md-list { flex: 0 0 218px; }              /* con selección: índice angosto */
/* multi-select: el split reparte parejo — la lista sigue trabajable (checkboxes,
   búsqueda, nodo), no se encoge a índice angosto. (4 clases vencen a las 3 de arriba) */
.md.md-multi.split .md-list { flex: 1; }
/* Festivos (composite, SIEMPRE split): izquierda calendarios + festivos del año,
   derecha los 12 meses. La izquierda es más ancha que el índice angosto (lleva la
   lista de festivos con fecha/nombre/tipo). */
.md.md-fest.split .md-list { flex: 0 0 340px; }
@media (max-width: 720px) {
  .md { flex-direction: column; }
  .md-list, .md-detail { width: 100%; }
  .md.split .md-list { display: none; }              /* en móvil el detalle reemplaza a la lista */
  .md.md-multi.split .md-list { display: block; }    /* multi: en móvil la lista sigue visible (se sigue seleccionando) */
  .md.md-fest.split .md-list { display: block; }     /* Festivos: en móvil apilan, la lista NO se oculta */
  .md.md-fest.split .md-list { flex: 1 1 auto; }
}

/* fila seleccionada + modo compacto (índice angosto: sin encabezado ni columnas anchas) */
.cat-body tr.sel { background: var(--accent-soft); }
.cat-body tr.sel .mono-code { color: var(--accent-ink); }
.cat-wrap.compacto thead { display: none; }
.cat-wrap.compacto td.col-ancho, .cat-wrap.compacto th.col-ancho { display: none; }
.cat-wrap.compacto .cat-body td { padding: 8px 8px; }
/* Toolbar en el índice angosto (master/detail): que no se apriete el seg ni se
   desborde el botón. El seg no se encoge, la barra de herramientas envuelve, la
   búsqueda puede achicarse, y "Nuevo empleado" queda icónico. (Fix de Wences.) */
.cat-tools { flex-wrap: wrap; }
.seg { flex-shrink: 0; }
.cat-wrap.compacto .search { min-width: 0; }
.cat-wrap.compacto .btn-lbl { display: none; }

/* el botón Cancelar / cerrar del detalle */
.md-detail .det-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 14px; }

/* Eventos (v2 Configuración): el comportamiento (Kind) en la lista */
.ev-kind { font-weight: 500; }
/* lista curable de justificantes (10.4b-3b): el orden es la prioridad del menú.
   Se reordena ARRASTRANDO por el asa (10.4c, Pointer Events = mouse + touch). */
.just-row { display: flex; align-items: center; gap: 8px; padding: 6px 4px; border-bottom: 1px solid var(--hairline); font-size: 12.5px; background: var(--panel); border-radius: 6px; }
.just-row:last-of-type { border-bottom: none; }
.just-row.arrastrando { opacity: .55; background: var(--accent-soft); }
.just-grip { display: inline-flex; flex-shrink: 0; color: var(--ink-muted); cursor: grab; touch-action: none; padding: 2px; }
.just-grip:active { cursor: grabbing; }
.just-grip i { font-size: 15px; }
.just-nom { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.just-add { display: flex; gap: 8px; margin-top: 10px; }
.just-add select {
  flex: 1; min-width: 0; font: inherit; font-size: 12.5px; padding: 6px 9px;
  border: 1px solid var(--grid); border-radius: 6px; background: var(--panel-2); color: var(--ink); color-scheme: dark light;
}
.just-add select:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: transparent; }

/* el tag "Cuenta como excepción" (10.4b-2) */
.ev-flag { display: flex; flex-direction: column; gap: 4px; padding: 10px 12px; background: var(--panel-2); border-radius: var(--radius); }
.ev-flag .tb-toggle { color: var(--ink); font-size: 12.5px; font-weight: 600; }
.ev-flag .hint { font-size: 10.5px; color: var(--ink-muted); font-weight: 400; line-height: 1.35; }

/* capturas del empleado (cuando hay uno seleccionado) */
.sep-caps { font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-muted); margin: 14px 0 8px; }
.cap-row { display: flex; align-items: center; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--hairline); font-size: 12.5px; }
.cap-row:last-child { border-bottom: none; }
.cap-row > div { flex: 1; min-width: 0; }
.cap-row .sub { display: block; font-size: 11px; color: var(--ink-muted); margin-top: 1px; }
.cap-del { padding: 4px 8px; flex-shrink: 0; }

/* ===== Diálogo modal temado (reemplaza confirm/prompt/alert nativos) ===== */
.dlg-ov {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(0, 0, 0, .45);
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.dlg {
  background: var(--panel); border: 1px solid var(--hairline); border-radius: 14px;
  padding: 20px 22px; max-width: 440px; width: 100%;
  box-shadow: 0 14px 44px rgba(0, 0, 0, .28);
}
.dlg-tit { margin: 0 0 8px; font-size: 16px; font-weight: 600; }
.dlg-msg { margin: 0 0 14px; color: var(--ink); font-size: 14px; line-height: 1.55; }
.dlg-input { width: 100%; margin-bottom: 16px; }
.dlg-acc { display: flex; justify-content: flex-end; gap: 8px; }

/* Mensaje transitorio en una fila de la bandeja de incidencias (tras justificar
   o quitar una captura): reemplaza al menú flotante + su mensaje. */
.exc-flash { margin-left: auto; font-size: 12px; font-weight: 500; white-space: nowrap; padding-left: 10px; }
.exc-flash.ok  { color: var(--ok); }
.exc-flash.err { color: var(--crit); }

/* ============================================================
   CIERRE / PRENÓMINA (10.5) — aviso de pendientes, pivote, export.
   ============================================================ */
.aviso-pend {
  display: flex; align-items: center; gap: 10px; margin-bottom: 16px;
  background: var(--warn-soft); border: 1px solid var(--warn); border-radius: var(--radius); padding: 10px 14px;
}
.aviso-pend > i { color: var(--warn-ink); font-size: 20px; flex-shrink: 0; }
.aviso-pend .ap-txt { flex: 1; font-size: 12.5px; color: var(--warn-ink); }
.aviso-pend .ap-txt b { font-weight: 600; }
.aviso-ok {
  display: flex; align-items: center; gap: 8px; margin-bottom: 16px;
  font-size: 12.5px; color: var(--ok);
}
.aviso-ok i { font-size: 18px; }

/* pivote empleado × código: nombres a la izquierda, cifras centradas por código */
.pivote { width: 100%; border-collapse: collapse; font-size: 12.5px; min-width: 560px; }
.pivote th, .pivote td { padding: 8px 10px; border-bottom: 1px solid var(--hairline); }
.pivote thead th { background: var(--panel-2); font-weight: 600; color: var(--ink-2); text-align: center; white-space: nowrap; position: sticky; top: 0; }
.pivote thead th.emp-col, .pivote td.emp-col { text-align: left; }
.pivote td { text-align: center; }
.pivote .nom { font-weight: 500; }
.pivote .sub { display: block; font-size: 11px; color: var(--ink-muted); margin-top: 1px; }
.pivote .cero { color: var(--ink-muted); }
.pivote .falta-num { color: var(--crit); font-weight: 500; }
.pivote tbody tr:hover { background: var(--panel-2); }
.pivote tfoot td { border-top: 2px solid var(--grid); border-bottom: none; background: var(--panel-2); font-weight: 600; }
.pivote-wrap { border: 1px solid var(--hairline); border-radius: var(--radius); overflow: auto; max-height: 60vh; }

.cierre-acc { display: flex; align-items: center; gap: 10px; margin-top: 16px; flex-wrap: wrap; }
.cierre-acc .sp { flex: 1; font-size: 11.5px; color: var(--ink-muted); min-width: 120px; }

/* ============================================================
   REPORTES (10.6) — catálogo a la izquierda, filtros + vista previa + export.
   ============================================================ */
.rep { display: grid; grid-template-columns: 210px 1fr; gap: 16px; align-items: start; }
.rep-list { border: 1px solid var(--hairline); border-radius: var(--radius); overflow: hidden; background: var(--panel); }
.rep-list-h { padding: 9px 12px; font-size: 11.5px; color: var(--ink-2); border-bottom: 1px solid var(--hairline); }
.rep-item { display: flex; align-items: center; gap: 9px; padding: 10px 12px; cursor: pointer; border-top: 1px solid var(--hairline); }
.rep-item:first-of-type { border-top: none; }
.rep-item i { font-size: 18px; color: var(--ink-2); flex-shrink: 0; }
.rep-item .rep-nom { font-size: 13px; }
.rep-item:hover { background: var(--panel-2); }
.rep-item.on { background: var(--accent-soft); border-left: 2px solid var(--accent); padding-left: 10px; }
.rep-item.on i, .rep-item.on .rep-nom { color: var(--accent-ink); }
.rep-item.on .rep-nom { font-weight: 500; }

.rep-head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 4px; }
.rep-head h2 { margin: 0; }
.rep-head .rep-desc { font-size: 12px; color: var(--ink-muted); }
.rep-table-wrap { border: 1px solid var(--hairline); border-radius: var(--radius); overflow: auto; max-height: 58vh; }
table.rep-table { width: 100%; border-collapse: collapse; font-size: 12.5px; min-width: 520px; }
table.rep-table th { position: sticky; top: 0; background: var(--panel-2); font-weight: 600; color: var(--ink-2); padding: 8px 10px; white-space: nowrap; text-align: left; }
table.rep-table td { padding: 7px 10px; border-top: 1px solid var(--hairline); }
table.rep-table th.r, table.rep-table td.r { text-align: right; }
table.rep-table th.c, table.rep-table td.c { text-align: center; }
table.rep-table tbody tr:hover { background: var(--panel-2); }

.rep-acc { display: flex; align-items: center; gap: 10px; margin-top: 14px; flex-wrap: wrap; }
.rep-acc .sp { flex: 1; font-size: 11.5px; color: var(--ink-muted); min-width: 120px; }

@media (max-width: 720px) {
  .rep { grid-template-columns: 1fr; }
  .rep-list { display: flex; overflow-x: auto; }
  .rep-list-h { display: none; }
  .rep-item { border-top: none; border-left: 1px solid var(--hairline); white-space: nowrap; }
  .rep-item:first-of-type { border-left: none; }
  .rep-item.on { border-left: 1px solid var(--accent); }
}

/* ============================================================
   DISPOSITIVOS (10.7a) — flota (master/detail) + huérfanos.
   ============================================================ */
.disp-row { display: flex; align-items: center; gap: 9px; }
.disp-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; background: var(--ink-muted); }
.disp-dot.on { background: var(--ok); }
.disp-dot.off { background: var(--ink-muted); }
.disp-dot.pend { background: var(--warn); }
.disp-dot.blocked { background: var(--crit); }
.disp-id { min-width: 0; }
.disp-id .nom { font-weight: 500; font-size: 13px; }
.disp-id .sub { display: block; font-size: 11px; color: var(--ink-muted); }

.det-head { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; flex-wrap: wrap; }
.det-head h2 { margin: 0; font-size: 17px; }
.disp-meta { font-size: 12px; color: var(--ink-muted); margin-bottom: 14px; }
.disp-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 16px; }
.disp-card { background: var(--panel-2); border-radius: var(--radius); padding: 10px 12px; }
.disp-card .lbl { font-size: 11px; color: var(--ink-2); }
.disp-card .val { font-size: 13px; margin-top: 3px; }
.disp-card select {
  width: 100%; margin-top: 4px; font: inherit; font-size: 13px; padding: 6px 9px;
  border: 1px solid var(--grid); border-radius: 6px; background: var(--panel); color: var(--ink);
}
.disp-card select:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: transparent; }
.disp-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }

.disp-sec { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.disp-sec h3 { margin: 0; font-size: 13.5px; }
.disp-sec .sp { flex: 1; }
.cmd-feed { border: 1px solid var(--hairline); border-radius: var(--radius); font-size: 12px; overflow: hidden; }
.cmd-row { display: flex; align-items: center; gap: 10px; padding: 8px 11px; border-bottom: 1px solid var(--hairline); }
.cmd-row:last-child { border-bottom: none; }
.cmd-row .ci { font-size: 15px; flex-shrink: 0; }
.cmd-row .ci.ok { color: var(--ok); }
.cmd-row .ci.warn { color: var(--warn); }
.cmd-row .ci.crit { color: var(--crit); }
.cmd-row .ci.mut { color: var(--ink-muted); }
.cmd-row .cmd-main { flex: 1; min-width: 0; }
.cmd-row .cmd-t { color: var(--ink); }
.cmd-row .cmd-sub { color: var(--ink-muted); font-size: 11px; }
.cmd-row .cmd-st { color: var(--ink-muted); flex-shrink: 0; }

.disp-pop { position: relative; }
.disp-menu { position: absolute; right: 0; top: calc(100% + 4px); z-index: 30; background: var(--panel); border: 1px solid var(--grid);
  border-radius: var(--radius); box-shadow: 0 6px 20px rgba(0,0,0,.14); min-width: 200px; overflow: hidden; }
.disp-menu button { display: flex; align-items: center; gap: 9px; width: 100%; text-align: left; background: none; border: none;
  padding: 9px 12px; font-size: 12.5px; color: var(--ink); cursor: pointer; }
.disp-menu button:hover { background: var(--panel-2); }
.disp-menu button i { font-size: 16px; color: var(--ink-2); }

@media (max-width: 560px) { .disp-cards { grid-template-columns: 1fr; } }

/* ============================================================
   CONFIGURACIÓN (10.7b) — Ajustes + Usuarios.
   ============================================================ */
.set-list { display: flex; flex-direction: column; margin-top: 8px; }
.set-row { display: flex; align-items: center; gap: 14px; padding: 12px 2px; border-bottom: 1px solid var(--hairline); }
.set-row:last-child { border-bottom: none; }
.set-info { flex: 1; min-width: 0; }
.set-lbl { font-size: 13px; }
.set-meta { font-size: 11px; color: var(--ink-muted); margin-top: 2px; }
.set-ctl { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.set-ctl .set-in:not([type=checkbox]) {
  width: 130px; font: inherit; font-size: 13px; padding: 6px 9px;
  border: 1px solid var(--grid); border-radius: 6px; background: var(--panel); color: var(--ink);
}
.set-ctl .set-in:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: transparent; }
.set-msg { font-size: 11.5px; min-width: 0; }
.set-msg.ok { color: var(--ok); } .set-msg.err { color: var(--crit); }

.us-roles { display: flex; flex-direction: column; gap: 9px; }
.us-roles .chk { font-weight: 400; font-size: 13px; }

/* Roles y permisos (10.7b) — rail de roles + MATRIZ recurso × acción */
.rolm { display: grid; grid-template-columns: 200px 1fr; gap: 16px; align-items: start; margin-top: 8px; }
.rolm-list { border: 1px solid var(--hairline); border-radius: 12px; overflow: hidden; background: var(--panel); }
.rolm-list-h { padding: 9px 12px; font-size: 11.5px; color: var(--ink-2); border-bottom: 1px solid var(--hairline); }
.rolm-item { display: block; width: 100%; text-align: left; background: none; border: none; cursor: pointer;
  padding: 10px 12px; border-top: 1px solid var(--hairline); }
.rolm-item:first-of-type { border-top: none; }
.rolm-item:hover { background: var(--panel-2); }
.rolm-item.on { background: var(--accent-soft); border-left: 2px solid var(--accent); padding-left: 10px; }
.rolm-item .rolm-nom { font-size: 13px; font-weight: 500; color: var(--ink); }
.rolm-item.on .rolm-nom { color: var(--accent-ink); }
.rolm-item .rolm-sub { display: block; font-size: 11px; color: var(--ink-muted); margin-top: 1px; }

.rolm-head { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; flex-wrap: wrap; }
.rolm-head h3 { margin: 0; font-size: 16px; }
.rolm-head .rolm-desc { font-size: 12px; color: var(--ink-muted); }
.rolm-item { transition: none; }
.rolm-nuevo { display: flex; align-items: center; gap: 7px; width: 100%; text-align: left; cursor: pointer;
  background: none; border: none; border-top: 1px solid var(--hairline); padding: 10px 12px; font-size: 12.5px; color: var(--accent-ink); }
.rolm-nuevo:hover { background: var(--panel-2); }
.rolm-nuevo i { font-size: 16px; }
.rolm-edit-f { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; width: 100%; }
.rolm-edit-f input { font: inherit; font-size: 13px; padding: 6px 9px; border: 1px solid var(--grid); border-radius: 6px;
  background: var(--panel-2); color: var(--ink); }
.rolm-edit-f input:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: transparent; }
.rolm-edit-f #rh-name { width: 180px; } .rolm-edit-f #rh-desc { flex: 1; min-width: 160px; }
.rolm-edit-f .form-msg { flex-basis: 100%; }
/* matriz editable: las celdas aplicables invitan al clic */
.rolm-t.editable td.yes, .rolm-t.editable td.no { cursor: pointer; }
.rolm-t.editable td.yes:hover, .rolm-t.editable td.no:hover { background: var(--accent-soft); }
.rolm-t.editable td.no:hover::after { content: "＋"; color: var(--accent-ink); font-size: 13px; opacity: .6; }
.rolm-t.editable td:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.rolm-wrap { border: 1px solid var(--hairline); border-radius: 12px; overflow: auto; max-height: 62vh; margin-top: 10px; }
table.rolm-t { border-collapse: separate; border-spacing: 0; font-size: 12.5px; width: 100%; }
table.rolm-t th, table.rolm-t td { padding: 9px 10px; border-bottom: 1px solid var(--hairline); text-align: center; white-space: nowrap; }
table.rolm-t thead th { position: sticky; top: 0; z-index: 2; background: var(--panel-2); font-weight: 600; color: var(--ink-2); }
table.rolm-t .rolm-res { position: sticky; left: 0; z-index: 1; background: var(--panel); text-align: left; min-width: 150px; }
table.rolm-t thead .rolm-res { z-index: 3; }
table.rolm-t tbody tr:hover td { background: var(--panel-2); }
table.rolm-t tbody tr:hover .rolm-res { background: var(--panel-2); }
.rolm-res-lbl { font-weight: 500; }
.rolm-res-code { display: block; font-size: 10.5px; color: var(--ink-muted); font-family: var(--mono, monospace); margin-top: 1px; }
td.yes .rolm-chk { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px;
  border-radius: 50%; background: var(--ok-soft); color: var(--ok); }
td.yes .rolm-chk i { font-size: 14px; }
/* "no aplica": sólo un guion muted, SIN fondo — así el hover tiñe el renglón
   parejo y no choca con el gris de la celda (feedback de Wences). */
td.na::after { content: "–"; color: var(--ink-muted); opacity: .5; }

/* leyenda ARRIBA de la matriz (antes se perdía al fondo — feedback de Wences) */
.rolm-legend { display: flex; flex-wrap: wrap; gap: 16px; margin: 6px 0 10px; font-size: 11.5px; color: var(--ink-muted); }
.rolm-legend span { display: inline-flex; align-items: center; gap: 6px; }
.rolm-legend .lg-yes { width: 16px; height: 16px; border-radius: 50%; background: var(--ok-soft); color: var(--ok);
  display: inline-flex; align-items: center; justify-content: center; }
.rolm-legend .lg-yes i { font-size: 11px; }
.rolm-legend .lg-no { width: 16px; height: 16px; border-radius: 4px; border: 1px solid var(--hairline); }
.rolm-legend .lg-na { width: 16px; text-align: center; color: var(--ink-muted); }

@media (max-width: 720px) {
  .rolm { grid-template-columns: 1fr; }
  .rolm-list { display: flex; overflow-x: auto; }
  .rolm-list-h { display: none; }
  .rolm-item { border-top: none; border-left: 1px solid var(--hairline); white-space: nowrap; }
  .rolm-item:first-of-type { border-left: none; }
  .rolm-item.on { border-left: 1px solid var(--accent); }
}

/* ============================================================
   PLATAFORMA (10.7c) — alta y monitoreo de clientes (tenants).
   ============================================================ */
.plat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; margin-top: 8px; }
.plat-card { border: 1px solid var(--hairline); border-radius: 12px; padding: 14px; background: var(--panel); }
.plat-card .plat-h { display: flex; align-items: center; gap: 8px; }
.plat-card .plat-nom { font-size: 14px; font-weight: 500; flex: 1; min-width: 0; }
.plat-card .plat-meta { font-size: 11px; color: var(--ink-muted); margin-top: 3px; }
.plat-stats { display: flex; gap: 8px; margin-top: 12px; }
.plat-stat { flex: 1; background: var(--panel-2); border-radius: var(--radius); padding: 8px 6px; text-align: center; }
.plat-stat .n { font-size: 18px; font-weight: 600; line-height: 1.1; }
.plat-stat .l { font-size: 10.5px; color: var(--ink-2); margin-top: 2px; }
.plat-form { border: 1px solid var(--accent); border-radius: 12px; padding: 16px; background: var(--panel); margin-bottom: 16px; }
.plat-form h3 { margin: 0 0 12px; font-size: 15px; }
.plat-edit { background: none; border: none; cursor: pointer; color: var(--ink-muted); padding: 2px; flex-shrink: 0; }
.plat-edit:hover { color: var(--accent-ink); }
.plat-edit i { font-size: 16px; }
.plat-card.editing { border-color: var(--accent); }
.plat-el { display: flex; flex-direction: column; font-size: 11.5px; font-weight: 600; color: var(--ink-2); gap: 4px; margin-bottom: 10px; }
.plat-el input.pe-name { font: inherit; font-size: 13px; font-weight: 400; padding: 7px 9px; border: 1px solid var(--grid);
  border-radius: 6px; background: var(--panel-2); color: var(--ink); }
.plat-el input.pe-name:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: transparent; }
.plat-el.tb-toggle { flex-direction: row; align-items: center; font-weight: 400; color: var(--ink); }

/* Llaves de integración (10.7d) */
.perm-chip { display: inline-block; font-size: 11px; font-family: var(--mono, monospace); background: var(--panel-2);
  border: 1px solid var(--hairline); border-radius: 5px; padding: 1px 6px; color: var(--ink-2); }
.key-shown { border: 1px solid var(--ok); background: var(--ok-soft); border-radius: 12px; padding: 14px 16px; margin-bottom: 16px; }
.key-shown-h { display: flex; align-items: center; gap: 8px; font-weight: 600; color: var(--ok-ink); }
.key-shown-h i { font-size: 18px; }
.key-shown p { font-size: 12.5px; margin: 6px 0 10px; color: var(--ink-2); }
.key-val { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.key-val code { flex: 1; min-width: 220px; font-family: var(--mono, monospace); font-size: 13px; background: var(--panel);
  border: 1px solid var(--hairline); border-radius: 6px; padding: 8px 10px; word-break: break-all; }
.kf-perms { max-height: 260px; overflow: auto; border: 1px solid var(--hairline); border-radius: var(--radius); padding: 10px 12px; }
.kf-perms.disabled { opacity: .4; pointer-events: none; }
.kf-mod { margin-bottom: 10px; }
.kf-mod:last-child { margin-bottom: 0; }
.kf-mod-h { font-size: 12px; font-weight: 600; color: var(--ink-2); text-transform: capitalize; margin-bottom: 5px; }
.kf-perms .chk { font-weight: 400; font-size: 12.5px; margin-bottom: 4px; }

@media (max-width: 560px) {
  .set-row { flex-direction: column; align-items: stretch; gap: 8px; }
  .set-ctl { justify-content: flex-end; }
}

/* ===== 10.9 — Monitoreo de terminales ===== */
.mon-toolbar select { height: 32px; padding: 0 10px; border: 1px solid var(--hairline); border-radius: 6px;
  background: var(--panel); color: var(--ink); font-size: 13px; }
.mon-toolbar select:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.mon-tiles { margin-bottom: 12px; }

.mon-fila { cursor: pointer; }
.mon-fila:hover td { background: var(--panel-2); }
.crit-txt { color: var(--crit); }

.spark { width: 120px; height: 26px; display: block; }
.spark polyline { stroke: var(--c-info); stroke-width: 2; stroke-linejoin: round; }

.sqs { display: flex; gap: 2px; flex-wrap: nowrap; }
.sq { width: 7px; height: 15px; border-radius: 2px; background: var(--hairline); flex-shrink: 0; }
.sq.ok { background: var(--c-ok); }
.sq.warn { background: var(--c-warn); }
.sq.crit { background: var(--crit); }
.sq.nd { background: var(--hairline); }
.sqs.grande { gap: 3px; flex-wrap: wrap; }
.sqs.grande .sq { width: 22px; height: 30px; border-radius: 4px; }
.mon-dispgrande { margin: 6px 0 10px; }
.mon-leyenda { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12px; color: var(--ink-2); }
.mon-leyenda span { display: inline-flex; align-items: center; gap: 6px; }
.mon-leyenda .sq { height: 12px; width: 12px; }

.hbars { display: flex; align-items: stretch; gap: 2px; height: 110px; }
.hcol { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; min-width: 0; }
.hbar { background: var(--c-info); border-radius: 2px 2px 0 0; }
.hlbl { font-size: 9.5px; color: var(--ink-muted); height: 14px; overflow: hidden; text-align: center; white-space: nowrap; }

.mon-rank { display: grid; gap: 8px; font-size: 12.5px; }
.mon-rank > div { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.mon-rank > div > span:first-child { display: inline-flex; align-items: center; gap: 7px; min-width: 0; }
.mon-rank .hint { text-align: right; }

.mon-cmdtasa { font-size: 13px; margin-bottom: 8px; }
.mon-cmdtasa b { font-size: 24px; color: var(--ok-ink, var(--c-ok)); margin-right: 4px; }
.mon-cmdbar { display: flex; height: 10px; border-radius: 4px; overflow: hidden; gap: 2px; margin-bottom: 10px; }
.mon-cmdbar .ok { background: var(--c-ok); }
.mon-cmdbar .crit { background: var(--crit); }
.mon-cmdbar .warn { background: var(--c-warn); }

.mon-drillhead { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; flex-wrap: wrap; }
.mon-drillhead h2 { font-size: 18px; margin: 0; }
.mon-2col { margin-top: 12px; }

@media (max-width: 560px) {
  .mon-toolbar { flex-wrap: wrap; }
  .sqs.grande .sq { width: 14px; height: 22px; }
  .spark { width: 84px; }
}
