/* Vision Solution · Central de monitoreo
   Consola oscura y precisa: líneas de 1 px, esquinas casi rectas, sin degradados ni brillos. */

/* ---------- Tipografías (servidas localmente) ---------- */
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 100 700; font-display: swap;
  src: url(/assets/fonts/IBMPlexSans-400-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 100 700; font-display: swap;
  src: url(/assets/fonts/IBMPlexSans-400-latin-ext.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "IBM Plex Mono"; font-weight: 400; font-display: swap; src: url(/assets/fonts/IBMPlexMono-400-latin.woff2) format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-weight: 500; font-display: swap; src: url(/assets/fonts/IBMPlexMono-500-latin.woff2) format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-weight: 600; font-display: swap; src: url(/assets/fonts/IBMPlexMono-600-latin.woff2) format("woff2"); }
@font-face { font-family: "IBM Plex Sans Condensed"; font-weight: 600; font-display: swap; src: url(/assets/fonts/IBMPlexSansCondensed-600-latin.woff2) format("woff2"); }
@font-face { font-family: "IBM Plex Sans Condensed"; font-weight: 700; font-display: swap; src: url(/assets/fonts/IBMPlexSansCondensed-700-latin.woff2) format("woff2"); }

/* ---------- Variables ---------- */
:root {
  color-scheme: dark;
  --ink: #0b0b0c;
  --ink-2: #101011;
  --ink-3: #141416;
  --ink-4: #1b1b1e;
  --line: #26262a;
  --line-2: #35353b;
  --line-3: #4a4a52;
  --text: #e8e7e3;
  --text-2: #9d9d98;
  --text-3: #85857f;
  --signal: #ff6a1a;
  --alarm: #f4503c;
  --warn: #e3b341;
  --ok: #3fb950;
  --med: #4c8dff;
  --sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
  --cond: "IBM Plex Sans Condensed", "IBM Plex Sans", system-ui, sans-serif;
  --radius: 2px;
  --side-w: 216px;
  --top-h: 52px;
}

/* Tonos: cada componente usa var(--tone). Los valores por defecto van en :where()
   (especificidad 0) para que cualquier clase .tone-* los reemplace. */
:where(.badge, .list-head) { --tone: var(--text-3); }
:where(.ev-row, .vs-marker, .vs-dot, .drawer) { --tone: var(--text-2); }
:where(.kpi) { --tone: var(--text); }
.tone-panic, .tone-alarm { --tone: var(--alarm); }
.tone-fire, .tone-overdue, .tone-signal { --tone: var(--signal); }
.tone-medical { --tone: var(--med); }
.tone-warn { --tone: var(--warn); }
.tone-ok { --tone: var(--ok); }
.tone-info { --tone: var(--text-2); }
.tone-muted { --tone: var(--text-3); }

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--ink);
  color: var(--text);
  font: 400 14px/1.45 var(--sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
h1, h2, h3, h4, p { margin: 0; }
a { color: var(--text); text-decoration-color: var(--line-3); text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--signal); }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--signal); outline-offset: 2px; }
::selection { background: rgba(255, 106, 26, .35); }
.mono { font-family: var(--mono); font-feature-settings: "zero" 0; }
.muted { color: var(--text-3); }
.small { font-size: 12.5px; }
.txt-alarm { color: var(--alarm); }
.txt-warn { color: var(--warn); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
[hidden] { display: none !important; }
.icon { width: 18px; height: 18px; flex: none; }
.eyebrow { font: 500 11px/1.3 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--signal); }
.count {
  display: inline-block; min-width: 20px; padding: 1px 6px; margin-left: 8px;
  font: 500 11px/16px var(--mono); text-align: center; color: var(--text-2);
  border: 1px solid var(--line-2); border-radius: var(--radius);
}
.count.tone-alarm { color: var(--ink); background: var(--alarm); border-color: var(--alarm); }
.count.tone-warn { color: var(--warn); border-color: var(--warn); }
.stack-xs { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.spacer { flex: 1; }

/* ---------- Carga inicial ---------- */
#app.boot { min-height: 100vh; display: grid; place-content: center; justify-items: center; gap: 16px; }
.boot-mark { width: 44px; height: 44px; }
.boot-text { font: 500 12px var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--text-3); }
#print-root { display: none; }

/* ---------- Ingreso ---------- */
.app-login { min-height: 100vh; }
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.login-card { width: 100%; max-width: 400px; background: var(--ink-2); border: 1px solid var(--line); padding: 32px 28px 26px; display: flex; flex-direction: column; gap: 14px; }
.login-brand { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.brand-mark { width: 32px; height: 32px; flex: none; }
.brand-mark.lg { width: 44px; height: 44px; }
.brand-name { font-weight: 600; font-size: 15px; letter-spacing: .01em; }
.brand-sub { font: 500 11px/1.4 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--signal); }
.login-title { font-size: 24px; font-weight: 600; line-height: 1.2; }
.login-lead { color: var(--text-2); }
.login-form { display: flex; flex-direction: column; gap: 16px; margin-top: 6px; }
.login-foot { font-size: 12.5px; color: var(--text-3); border-top: 1px solid var(--line); padding-top: 14px; margin-top: 4px; }
.form-note { font-size: 13px; color: var(--text); border-left: 2px solid var(--signal); padding: 6px 10px; background: var(--ink-3); }
.form-error { font-size: 13px; color: #ffb3a8; border-left: 2px solid var(--alarm); padding: 8px 10px; background: rgba(244, 80, 60, .08); }

/* ---------- Formularios ---------- */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field-label { font: 500 11px/1.3 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); }
.field-hint { font-size: 12px; color: var(--text-3); }
.input, .field > input, .field > select, .field-with-addon > input, textarea {
  width: 100%; height: 36px; padding: 0 10px;
  background: var(--ink); color: var(--text);
  border: 1px solid var(--line-2); border-radius: var(--radius);
  font: 400 14px var(--sans);
}
textarea { height: auto; min-height: 64px; padding: 8px 10px; resize: vertical; line-height: 1.4; }
select.input { cursor: pointer; }
.input:hover, textarea:hover { border-color: var(--line-3); }
.input:focus, textarea:focus, .field > input:focus, .field-with-addon > input:focus { outline: none; border-color: var(--signal); }
.input::placeholder, textarea::placeholder, input::placeholder { color: #66665f; }
.invalid { border-color: var(--alarm) !important; }
.input-sm { height: 30px; font-size: 13px; padding: 0 4px; width: auto; min-width: 96px; }
.input-num { width: 92px; }
.field-with-addon { position: relative; display: block; }
.field-with-addon > input { padding-right: 40px; }
.field-addon { position: absolute; right: 2px; top: 2px; }
.form-grid { display: flex; flex-direction: column; gap: 14px; }
.form-row { display: flex; gap: 12px; }
.form-actions { display: flex; justify-content: flex-end; gap: 8px; padding-top: 4px; }
.range-row { display: flex; align-items: center; gap: 10px; }
.range-row input[type=range] { flex: 1; accent-color: var(--signal); }
.inline-field { display: inline-flex; align-items: center; gap: 8px; }
.inline-field > span { font: 500 11px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); }
.inline-field .input { min-width: 220px; }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-2); cursor: pointer; user-select: none; }
.check input { width: 16px; height: 16px; margin: 0; accent-color: var(--signal); }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 36px; padding: 0 14px;
  background: var(--ink-3); color: var(--text);
  border: 1px solid var(--line-2); border-radius: var(--radius);
  font: 500 13.5px/1 var(--sans); white-space: nowrap; text-decoration: none; cursor: pointer;
}
.btn:hover { background: var(--ink-4); border-color: var(--line-3); }
.btn .icon { width: 16px; height: 16px; }
.btn-primary { background: var(--signal); border-color: var(--signal); color: #0b0b0c; font-weight: 600; }
.btn-primary:hover { background: #ff7f3a; border-color: #ff7f3a; }
.btn-danger { background: var(--alarm); border-color: var(--alarm); color: #0b0b0c; font-weight: 600; }
.btn-danger:hover { background: #ff6754; border-color: #ff6754; }
.btn-outline { background: transparent; border-color: var(--line-3); }
.btn-ghost { background: transparent; border-color: var(--line); }
.btn-danger-text { color: #ff8f80; }
.btn-danger-text:hover { border-color: rgba(244, 80, 60, .6); }
.btn-sm { height: 30px; padding: 0 10px; font-size: 12.5px; gap: 6px; }
.btn-sm .icon { width: 14px; height: 14px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .5; cursor: default; }
.btn.is-busy { cursor: progress; }
.icon-btn {
  display: inline-grid; place-items: center; width: 32px; height: 32px; padding: 0;
  background: transparent; color: var(--text-2); border: 1px solid transparent; border-radius: var(--radius); cursor: pointer;
}
.icon-btn:hover { color: var(--text); border-color: var(--line-2); }
.link-btn { background: none; border: 0; padding: 0; color: var(--text-2); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; font-size: 12.5px; }
.link-btn:hover { color: var(--text); }
.row-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; justify-content: flex-end; }

/* ---------- Etiquetas ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 4px; height: 20px; padding: 0 7px;
  font: 500 10.5px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; white-space: nowrap;
  color: var(--tone); border: 1px solid color-mix(in srgb, var(--tone) 50%, transparent);
  background: color-mix(in srgb, var(--tone) 10%, transparent); border-radius: var(--radius);
}
.badge.tone-muted { color: var(--text-2); }
.badge.blink { animation: blink 1.1s steps(2, start) infinite; }
@keyframes blink { 50% { color: var(--ink); background: var(--tone); } }
.chips-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.code-chip { font-size: 12.5px; letter-spacing: .08em; color: var(--text-2); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 2px 0 6px; }
.chip, .seg-btn {
  padding: 7px 12px; background: transparent; color: var(--text);
  border: 1px solid var(--line-2); border-radius: var(--radius); font-size: 13px; cursor: pointer;
}
.chip:hover, .seg-btn:hover { border-color: var(--line-3); }
.chip[aria-checked="true"], .seg-btn[aria-checked="true"] { border-color: var(--signal); background: rgba(255, 106, 26, .14); }
.seg { display: flex; gap: 0; }
.seg-btn { flex: 1; border-radius: 0; }
.seg-btn + .seg-btn { margin-left: -1px; }
.seg-btn[aria-checked="true"] { position: relative; z-index: 1; }

/* Interruptor */
.switch { position: relative; display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 12.5px; color: var(--text-2); }
.switch-input { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.switch-track { position: relative; width: 32px; height: 18px; border: 1px solid var(--line-3); background: var(--ink); border-radius: 9px; transition: background .15s, border-color .15s; }
.switch-track::after { content: ""; position: absolute; top: 2px; left: 2px; width: 12px; height: 12px; border-radius: 50%; background: var(--text-3); transition: transform .15s, background .15s; }
.switch-input:checked + .switch-track { background: rgba(63, 185, 80, .18); border-color: var(--ok); }
.switch-input:checked + .switch-track::after { transform: translateX(14px); background: var(--ok); }
.switch-input:focus-visible + .switch-track { outline: 2px solid var(--signal); outline-offset: 2px; }
.switch-input:disabled + .switch-track { opacity: .5; }

/* ---------- Estructura principal ---------- */
.app { height: 100vh; height: 100dvh; }
.shell { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); height: 100vh; height: 100dvh; }
.sidebar { display: flex; flex-direction: column; background: var(--ink-2); border-right: 1px solid var(--line); min-height: 0; }
.brand { display: flex; align-items: center; gap: 12px; height: var(--top-h); padding: 0 16px; border-bottom: 1px solid var(--line); text-decoration: none; }
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-text .brand-name { font-size: 14px; }
.nav { display: flex; flex-direction: column; padding: 12px 8px; gap: 2px; flex: 1; overflow-y: auto; }
.nav-link {
  position: relative; display: flex; align-items: center; gap: 12px; height: 40px; padding: 0 12px;
  color: var(--text-2); text-decoration: none; border: 1px solid transparent; border-radius: var(--radius); font-weight: 500;
}
.nav-link:hover { color: var(--text); background: var(--ink-3); }
.nav-link[aria-current="page"] { color: var(--text); background: var(--ink-4); border-color: var(--line); }
.nav-link[aria-current="page"]::before { content: ""; position: absolute; left: -9px; top: 9px; bottom: 9px; width: 2px; background: var(--signal); }
.nav-badge { margin-left: auto; min-width: 22px; padding: 2px 6px; font: 600 11px/14px var(--mono); text-align: center; color: var(--ink); background: var(--alarm); border-radius: var(--radius); }
.side-user { border-top: 1px solid var(--line); padding: 12px 8px; display: flex; flex-direction: column; gap: 2px; }
.side-user-info { padding: 4px 12px 10px; }
.side-user-name { font-weight: 600; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-user-role { font: 500 10.5px/1.5 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); }
.side-btn {
  display: flex; align-items: center; gap: 12px; height: 36px; padding: 0 12px; background: transparent; border: 1px solid transparent;
  color: var(--text-2); border-radius: var(--radius); cursor: pointer; text-align: left; font-size: 13px;
}
.side-btn:hover { color: var(--text); background: var(--ink-3); }

.main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.topbar { display: flex; align-items: center; gap: 10px; height: var(--top-h); flex: none; padding: 0 16px 0 20px; border-bottom: 1px solid var(--line); background: var(--ink); }
.topbar-title { font-size: 17px; font-weight: 600; letter-spacing: .005em; }
.net { display: inline-flex; align-items: center; gap: 7px; font: 500 11px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); }
.net-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); }
.net.is-off { color: var(--alarm); }
.net.is-off .net-dot { background: var(--alarm); animation: blinkdot 1s steps(2, start) infinite; }
@keyframes blinkdot { 50% { opacity: .2; } }
.clock { font-size: 13px; color: var(--text-2); padding: 0 10px; border-left: 1px solid var(--line); border-right: 1px solid var(--line); line-height: 28px; }
.top-btn {
  display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 10px;
  background: transparent; color: var(--text-2); border: 1px solid var(--line); border-radius: var(--radius); cursor: pointer; font-size: 12.5px; white-space: nowrap;
}
.top-btn:hover { color: var(--text); border-color: var(--line-3); }
.top-btn .icon { width: 16px; height: 16px; }
.top-btn.icon-only { width: 32px; padding: 0; justify-content: center; }
.top-btn.is-warn { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 50%, transparent); }
.top-btn.is-ok { color: var(--text); }
.top-btn.is-ok .icon { color: var(--ok); }
.top-btn.is-ringing { color: var(--ink); background: var(--alarm); border-color: var(--alarm); animation: ring-btn 1.3s steps(2, start) infinite; }
@keyframes ring-btn { 50% { background: transparent; color: var(--alarm); } }

.netbar, .audiobar, .alarmbar {
  display: flex; align-items: center; gap: 10px; flex: none; padding: 8px 20px; font-size: 13px; border: 0; border-bottom: 1px solid var(--line); text-align: left; width: 100%;
}
.netbar .icon, .audiobar .icon, .alarmbar .icon { width: 16px; height: 16px; }
.netbar { background: rgba(244, 80, 60, .12); color: #ffc0b6; border-bottom-color: rgba(244, 80, 60, .4); }
.audiobar { background: rgba(227, 179, 65, .1); color: var(--warn); cursor: pointer; }
.audiobar:hover { background: rgba(227, 179, 65, .16); }
.alarmbar { background: var(--alarm); color: #0b0b0c; text-decoration: none; font-weight: 500; }
.alarmbar strong { font-weight: 700; }
.alarmbar-cta { margin-left: auto; display: inline-flex; align-items: center; gap: 4px; font-weight: 600; white-space: nowrap; }

.view { flex: 1; min-height: 0; overflow: auto; }
.view.fill { overflow: hidden; display: flex; flex-direction: column; }
.view:focus { outline: none; }

/* ---------- Páginas (grupos, usuarios, rondas) ---------- */
.page { padding: 20px 24px 32px; max-width: 1680px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.page-title { font-size: 24px; font-weight: 600; line-height: 1.2; margin-top: 4px; }
.page-head .muted { margin-top: 4px; }
.page-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.page-body { min-width: 0; }
.back-link { display: inline-flex; align-items: center; gap: 4px; color: var(--text-2); text-decoration: none; font-size: 13px; margin-bottom: 12px; }
.back-link:hover { color: var(--text); }
.back-link .icon { width: 16px; height: 16px; }
.link-strong { font-weight: 600; text-decoration: none; }
.link-strong:hover { text-decoration: underline; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 14px; }
.toolbar .input { width: auto; min-width: 150px; }
.toolbar .muted { margin-left: 4px; }
.search-box { position: relative; display: flex; align-items: center; flex: 1 1 240px; max-width: 360px; }
.search-box .icon { position: absolute; left: 10px; width: 16px; height: 16px; color: var(--text-3); pointer-events: none; }
.search-box .input { width: 100%; padding-left: 34px; }

.panel { background: var(--ink-2); border: 1px solid var(--line); min-width: 0; }
.panel > .table-wrap { border-left: 0; border-right: 0; border-bottom: 0; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; }
.panel-head h3 { font-size: 14px; font-weight: 600; display: inline-flex; align-items: center; }
.panel-head + .table-wrap, .panel-head + .empty { margin-top: 0; }
.panel-foot { padding: 10px 14px; border-top: 1px solid var(--line); }
.panel-side { padding: 16px; align-self: start; }
.detail-grid { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 16px; align-items: start; }
.col-stack { display: grid; gap: 16px; min-width: 0; align-content: start; }
.invite { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.invite-code { font-size: 26px; letter-spacing: .14em; border: 1px dashed var(--line-3); padding: 10px 14px; width: 100%; text-align: center; }

/* Tablas */
.table-wrap { overflow: auto; border: 1px solid var(--line); background: var(--ink-2); }
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th {
  position: sticky; top: 0; z-index: 2; background: var(--ink-3); text-align: left; white-space: nowrap;
  font: 500 10.5px/1.2 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--text-3);
  padding: 10px 10px; border-bottom: 1px solid var(--line);
}
.table td { padding: 9px 10px; border-top: 1px solid var(--line); vertical-align: middle; }
.table th:first-child, .table td:first-child { padding-left: 14px; }
.table tbody tr:first-child td { border-top: 0; }
.table tr.clickable { cursor: pointer; }
.table tbody tr:hover td { background: var(--ink-3); }
.table .num { text-align: right; }
.table td.num { font-family: var(--mono); font-size: 13px; }
.table .actions { text-align: right; white-space: nowrap; width: 1%; }
.table .wrap { min-width: 150px; max-width: 320px; color: var(--text-2); }
.btn-icon { width: 30px; padding: 0; }
.row-actions { flex-wrap: nowrap; }
.table tr.is-disabled td { color: var(--text-3); }
.table tr.is-disabled td strong, .table tr.is-disabled td a { opacity: .7; }
.table tr.row-warn td:first-child { box-shadow: inset 2px 0 0 var(--alarm); }

.empty { padding: 36px 20px; text-align: center; color: var(--text-2); display: flex; flex-direction: column; gap: 6px; align-items: center; }
.empty p:first-child { color: var(--text); font-weight: 500; }
.empty .muted { max-width: 46ch; }
.loading { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 32px 16px; color: var(--text-3); font-size: 13px; }
.spinner { width: 14px; height: 14px; border: 2px solid var(--line-2); border-top-color: var(--signal); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.note-warn { display: flex; gap: 8px; align-items: flex-start; padding: 10px 14px; font-size: 13px; color: var(--warn); border-top: 1px solid var(--line); background: rgba(227, 179, 65, .06); }
.note-warn .icon { width: 16px; height: 16px; margin-top: 1px; }

/* Pestañas */
.tabs { display: flex; border-bottom: 1px solid var(--line); flex: none; }
.tab {
  display: inline-flex; align-items: center; height: 40px; padding: 0 14px; margin-bottom: -1px;
  background: transparent; border: 0; border-bottom: 2px solid transparent; color: var(--text-2);
  font-weight: 500; font-size: 13.5px; cursor: pointer; text-decoration: none; white-space: nowrap;
}
.tab:hover { color: var(--text); }
.tab[aria-selected="true"] { color: var(--text); border-bottom-color: var(--signal); }
.page-tabs { margin-bottom: 16px; overflow-x: auto; }

/* ---------- Contadores ---------- */
.kpis { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); border-bottom: 1px solid var(--line); flex: none; }
.kpis-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1px solid var(--line); margin-bottom: 16px; }
.kpi {
  display: flex; flex-direction: column; justify-content: space-between; gap: 2px; min-width: 0; min-height: 70px;
  padding: 10px 14px; background: var(--ink); border: 0; border-right: 1px solid var(--line); color: var(--text); text-align: left; text-decoration: none; cursor: pointer;
}
.kpi:last-child { border-right: 0; }
.kpi:hover { background: var(--ink-3); }
.kpi.static { cursor: default; }
.kpi.static:hover { background: var(--ink); }
.kpi-label { font: 500 10.5px/1.3 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); }
.kpi-value { font: 600 28px/1 var(--cond); letter-spacing: .01em; color: var(--text); }
.kpi-sub { font-size: 11.5px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-height: 14px; }
.kpi.is-hot .kpi-value { color: var(--tone); }
.kpi.is-hot.tone-alarm { background: rgba(244, 80, 60, .09); box-shadow: inset 0 -2px 0 var(--alarm); }
.kpi.is-hot.tone-alarm .kpi-label { color: #ff9b8e; }

/* ---------- Monitoreo ---------- */
.monitor { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.mon-toolbar { padding: 10px 16px; margin: 0; border-bottom: 1px solid var(--line); flex: none; }
.mon-toolbar .input { min-width: 0; max-width: 180px; }
.mon-toolbar input[type=date].input { width: 146px; }
.mon-toolbar .search-box { flex: 1 1 160px; max-width: 300px; }
.mon-toolbar .search-box .input { max-width: none; }
.mon-body { position: relative; flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(340px, 420px) minmax(0, 1fr); }
.mon-side { display: flex; flex-direction: column; min-height: 0; border-right: 1px solid var(--line); background: var(--ink-2); }
.mon-list { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.list-head {
  position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between;
  padding: 8px 14px; background: var(--ink-3); border-bottom: 1px solid var(--line);
  font: 500 10.5px/1.2 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--tone);
}
.list-head.tone-alarm { --tone: #ff9b8e; background: #1e1312; border-bottom-color: rgba(244, 80, 60, .35); }
.list-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 12px; border-top: 1px solid var(--line); flex: none; }

.ev-row {
  position: relative; display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; gap: 10px; align-items: start;
  width: 100%; padding: 11px 14px 11px 12px; text-align: left; cursor: pointer;
  background: transparent; color: var(--text); border: 0; border-bottom: 1px solid var(--line); border-left: 3px solid transparent;
}
.ev-row:hover { background: var(--ink-3); }
.ev-row.is-critical { border-left-color: var(--tone); background: color-mix(in srgb, var(--tone) 8%, var(--ink-2)); }
.ev-row.is-critical:hover { background: color-mix(in srgb, var(--tone) 13%, var(--ink-2)); }
.ev-row.is-critical.st-open { background: color-mix(in srgb, var(--tone) 14%, var(--ink-2)); }
.ev-row.is-selected { background: var(--ink-4); box-shadow: inset 0 0 0 1px var(--line-3); }
.ev-row.is-critical.is-selected { box-shadow: inset 0 0 0 1px var(--tone); }
.ev-row.st-resolved { color: var(--text-2); }
.ev-row.st-resolved .ev-icon { opacity: .6; }
.ev-row.is-new { animation: newrow 1s steps(2, start) 4; }
@keyframes newrow { 50% { background: color-mix(in srgb, var(--tone) 28%, var(--ink-2)); } }
.ev-icon { display: grid; place-items: center; width: 34px; height: 34px; color: var(--tone); border: 1px solid color-mix(in srgb, var(--tone) 45%, transparent); border-radius: var(--radius); }
.ev-row.is-critical.st-open .ev-icon { background: var(--tone); color: var(--ink); border-color: var(--tone); }
.ev-main { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.ev-line1 { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ev-type { font-weight: 600; font-size: 14px; }
.ev-row.is-critical .ev-type { color: var(--tone); text-transform: uppercase; letter-spacing: .03em; font-size: 13.5px; }
.ev-person { color: var(--text); font-weight: 500; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ev-house { font: 600 12.5px/18px var(--mono); color: var(--ink); background: var(--text); padding: 0 5px; margin-right: 7px; border-radius: 2px; letter-spacing: .02em; }
.ev-line3 { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text-2); min-width: 0; }
.ev-group { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.ev-sep { color: var(--text-3); }
.ev-nomon { flex: none; font: 500 10px/14px var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); border: 1px solid var(--line-2); padding: 0 4px; white-space: nowrap; }
.ev-msg { font-size: 12.5px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ev-time { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; font-size: 12px; color: var(--text-3); white-space: nowrap; }
.ev-clock { color: var(--text-2); font-size: 12.5px; }

.trip-row { display: flex; align-items: center; gap: 8px; padding: 10px 14px 10px 12px; border-bottom: 1px solid var(--line); border-left: 3px solid transparent; }
.trip-row.is-late { border-left-color: var(--alarm); background: rgba(244, 80, 60, .07); }
.trip-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; background: none; border: 0; padding: 0; text-align: left; cursor: pointer; }
.trip-line1 { display: flex; gap: 6px; align-items: baseline; min-width: 0; }
.trip-line1 strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.trip-line2 { font-size: 12.5px; color: var(--text-2); }
.trip-line3 { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-2); flex-wrap: wrap; }

.mon-map { position: relative; min-width: 0; min-height: 0; }
.mon-map-canvas { position: absolute; inset: 0; }
.map-tools { position: absolute; top: 10px; right: 10px; z-index: 500; display: flex; gap: 6px; }
.mon-map.has-drawer .map-tools { right: 470px; }
.map-btn {
  display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 10px; font-size: 12.5px;
  background: rgba(16, 16, 17, .92); color: var(--text); border: 1px solid var(--line-2); border-radius: var(--radius); cursor: pointer;
}
.map-btn:hover { border-color: var(--line-3); }
.map-btn .icon { width: 15px; height: 15px; }
.map-legend {
  position: absolute; left: 10px; bottom: 22px; z-index: 500; display: flex; flex-wrap: wrap; gap: 4px 12px; max-width: calc(100% - 20px);
  padding: 6px 10px; background: rgba(16, 16, 17, .9); border: 1px solid var(--line); font: 500 10.5px var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--text-2);
}
.map-legend .lg { display: inline-flex; align-items: center; gap: 6px; }
.map-legend i { width: 9px; height: 9px; border-radius: 50%; background: var(--tone); }

/* ---------- Detalle de señal ---------- */
.drawer {
  position: absolute; top: 0; right: 0; bottom: 0; z-index: 800; width: 460px; max-width: 100%;
  display: flex; flex-direction: column; background: var(--ink-2); border-left: 1px solid var(--line-2);
}
.drawer:focus { outline: none; }
.drawer[data-tone="panic"] { --tone: var(--alarm); }
.drawer[data-tone="fire"], .drawer[data-tone="overdue"] { --tone: var(--signal); }
.drawer[data-tone="medical"] { --tone: var(--med); }
.drawer[data-tone="warn"] { --tone: var(--warn); }
.drawer-head { display: flex; justify-content: space-between; gap: 12px; padding: 14px 14px 12px 18px; border-bottom: 1px solid var(--line); border-top: 3px solid var(--tone); flex: none; }
.drawer-head-right { display: flex; align-items: flex-start; gap: 6px; }
.drawer-title { min-width: 0; }
.d-type { display: flex; align-items: center; gap: 8px; color: var(--tone); }
.d-type .icon { width: 20px; height: 20px; }
.d-type h2 { font-size: 19px; font-weight: 600; line-height: 1.2; }
.d-sub { font-size: 12.5px; color: var(--text-3); margin-top: 4px; }
.drawer-actions { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 18px; border-bottom: 1px solid var(--line); flex: none; }
.drawer-scroll { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.d-section { padding: 14px 18px; border-bottom: 1px solid var(--line); }
.d-title { display: flex; align-items: center; font: 500 10.5px/1.2 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--text-3); margin-bottom: 10px; }
.d-name { font-size: 18px; font-weight: 600; }
.d-house { display: inline-flex; align-items: center; gap: 8px; margin-bottom: 8px; font: 600 20px/1.2 var(--mono); color: var(--ink); background: var(--text); padding: 4px 10px; border-radius: 2px; }
.d-house .icon { width: 18px; height: 18px; }
.d-phone { display: inline-flex; align-items: center; gap: 8px; margin-top: 6px; font-size: 16px; color: var(--text); text-decoration: none; border-bottom: 1px solid var(--line-3); }
.d-phone:hover { border-bottom-color: var(--signal); }
.d-phone .icon { width: 16px; height: 16px; color: var(--signal); }
.d-group { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 10px; color: var(--text-2); }
.d-group .icon { width: 16px; height: 16px; }
.d-message { font-size: 15px; border-left: 2px solid var(--tone); padding: 2px 0 2px 10px; white-space: pre-wrap; word-break: break-word; }
.facts { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 7px 12px; margin: 0; font-size: 13.5px; }
.facts dt { color: var(--text-3); }
.facts dd { margin: 0; min-width: 0; }
.d-trip.is-late { background: rgba(244, 80, 60, .06); }
.d-mapbox { height: 230px; border: 1px solid var(--line); position: relative; }
.d-mapfacts { display: flex; flex-direction: column; gap: 4px; margin-top: 8px; }
.d-links { display: flex; gap: 14px; font-size: 12.5px; }
.d-links a { display: inline-flex; align-items: center; gap: 4px; color: var(--text-2); }
.d-links .icon { width: 12px; height: 12px; }
.timeline { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.timeline li { display: grid; grid-template-columns: 46px minmax(0, 1fr); gap: 10px; font-size: 13.5px; }
.tl-time { font-size: 12px; color: var(--text-3); padding-top: 1px; }
.tl-note { color: var(--text-2); white-space: pre-wrap; word-break: break-word; }
.tl-who { font-weight: 500; }
.note-form { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; margin-top: 12px; }
.d-resolution p:first-of-type { font-size: 14px; }

/* ---------- Mapas (Leaflet) ---------- */
.vs-map { background: #111113; }
.leaflet-container { font: 400 12px/1.4 var(--sans); background: #111113; outline: none; }
.vs-map .leaflet-tile-pane { filter: invert(1) hue-rotate(180deg) brightness(.95) contrast(.86) saturate(.22); }
.leaflet-bar { border: 1px solid var(--line-2) !important; border-radius: var(--radius) !important; box-shadow: none !important; }
.leaflet-bar a, .leaflet-bar a:hover { background: var(--ink-2); color: var(--text); border-bottom-color: var(--line-2); width: 30px; height: 30px; line-height: 30px; }
.leaflet-bar a:hover { background: var(--ink-4); }
.leaflet-bar a.leaflet-disabled { background: var(--ink-2); color: var(--text-3); }
.leaflet-bar a:first-child, .leaflet-bar a:last-child { border-radius: 0; }
.leaflet-control-attribution { background: rgba(11, 11, 12, .8) !important; color: var(--text-3); font-size: 10.5px; }
.leaflet-control-attribution a { color: var(--text-2); }
.leaflet-tooltip { background: var(--ink-3); color: var(--text); border: 1px solid var(--line-2); border-radius: var(--radius); box-shadow: none; padding: 5px 8px; }
.leaflet-tooltip-top::before { border-top-color: var(--line-2); }
.leaflet-tooltip-bottom::before { border-bottom-color: var(--line-2); }
.leaflet-tooltip-left::before { border-left-color: var(--line-2); }
.leaflet-tooltip-right::before { border-right-color: var(--line-2); }
.map-tip { display: flex; flex-direction: column; gap: 1px; }
.map-tip strong { font-weight: 600; }
.map-tip span { color: var(--text-2); }
.leaflet-tooltip.cp-label { padding: 2px 6px; font: 500 11px var(--mono); background: rgba(16, 16, 17, .88); }
.leaflet-tooltip.cp-label .map-tip span { display: none; }
.map-missing { display: grid; place-items: center; height: 100%; color: var(--text-3); }

.vs-marker { border-radius: 50%; background: var(--ink); border: 2px solid var(--tone); }
.vs-marker::after { content: ""; position: absolute; inset: 4px; border-radius: 50%; background: var(--tone); }
.vs-marker.is-open::before { content: ""; position: absolute; inset: -7px; border: 1.5px solid var(--tone); border-radius: 50%; animation: pulse 1.6s ease-out infinite; }
.vs-marker.is-selected { outline: 2px solid var(--text); outline-offset: 3px; }
@keyframes pulse { from { transform: scale(.6); opacity: 1; } to { transform: scale(1.5); opacity: 0; } }
.vs-dot { border-radius: 50%; background: var(--tone); border: 2px solid var(--ink); }
.track-dot { --tone: var(--signal); opacity: .8; }
.trip-dot { --tone: var(--text); }
.trip-dot.late { --tone: var(--alarm); }
.cp-dot { --tone: var(--signal); }
.cp-handle { --tone: var(--signal); border-color: var(--text); cursor: grab; }
.scan-dot { border-color: var(--ink); }
path.cp-circle { stroke: var(--signal); fill: var(--signal); fill-opacity: .1; stroke-opacity: .8; }
path.cp-circle.editing { stroke-dasharray: 5 4; fill-opacity: .18; }
path.acc-circle { stroke: var(--signal); fill: var(--signal); fill-opacity: .08; stroke-opacity: .5; }
path.track-line { stroke: var(--signal); stroke-opacity: .85; fill: none; }
path.scan-link { stroke: var(--alarm); stroke-opacity: .7; fill: none; }

/* ---------- Rondas ---------- */
.rounds-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 16px; align-items: start; }
.rounds-left { display: flex; flex-direction: column; background: var(--ink-2); border: 1px solid var(--line); min-width: 0; }
.rounds-left > .table-wrap { border-left: 0; border-right: 0; }
.rounds-left > .panel-head ~ .panel-head { border-top: 1px solid var(--line); }
.rounds-grid.is-report { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); }
.rounds-map { position: sticky; top: 16px; height: calc(100vh - 260px); height: calc(100dvh - 260px); min-height: 360px; border: 1px solid var(--line); }
.last-scan { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.cp-loc { margin-top: 4px; }
.table .nowrap { white-space: nowrap; }
.table td.col-name { min-width: 150px; }
.rounds-map-canvas { position: absolute; inset: 0; }
.rounds-map-canvas.is-picking { cursor: crosshair; }
.rounds-map-canvas.is-picking .leaflet-container, .rounds-map-canvas.is-picking.leaflet-container { cursor: crosshair; }
.map-hint {
  position: absolute; top: 10px; left: 50%; transform: translateX(-50%); z-index: 600; display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 12px; background: var(--signal); color: var(--ink); font-weight: 600; font-size: 13px; border-radius: var(--radius); pointer-events: none; white-space: nowrap;
}
.map-hint .icon { width: 16px; height: 16px; }
.cp-form { display: flex; flex-direction: column; gap: 14px; padding: 0 14px 16px; }
.cp-form .panel-head { padding: 12px 0 0; }
.cp-form .row-actions { justify-content: flex-start; }
.cp-form .row-actions .input { flex: 1; min-width: 200px; }

/* Hoja QR */
.qr-layout { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 20px; align-items: start; }
.qr-options { display: flex; flex-direction: column; gap: 12px; padding: 0 14px 16px; background: var(--ink-2); border: 1px solid var(--line); position: sticky; top: 16px; }
.qr-options .panel-head { padding: 12px 0 0; }
.qr-pick-head { display: flex; justify-content: space-between; align-items: center; margin-top: 4px; }
.qr-pick { display: flex; flex-direction: column; gap: 8px; max-height: 280px; overflow-y: auto; padding: 8px 10px; border: 1px solid var(--line); background: var(--ink); }
.qr-preview { min-width: 0; overflow-x: auto; padding: 16px; background: var(--ink-3); border: 1px solid var(--line); }
.qr-preview .qr-sheet { zoom: .62; }
.qr-preview .qr-page { margin: 0 auto 10mm; }
.qr-missing { color: #b00; font-size: 12px; }

/* Tarjetas QR: medidas en mm (pantalla = vista previa; impresión = tamaño real).
   Página útil 190 × 255 mm: cabe en A4 y en carta con márgenes de 10 mm. */
.qr-page { width: 190mm; height: 255mm; background: #fff; color: #111; display: grid; font-family: var(--sans); }
.per-2 .qr-page { grid-template-rows: 1fr 1fr; }
.per-4 .qr-page { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; }
.qr-card { display: flex; flex-direction: column; gap: 4mm; padding: 9mm 10mm; border: .3mm dashed #b5b5b5; margin: -.15mm; overflow: hidden; break-inside: avoid; }
.qr-card-head { display: flex; justify-content: space-between; align-items: center; border-bottom: .4mm solid #111; padding-bottom: 3mm; }
.qr-brand { display: flex; align-items: center; gap: 2.5mm; font-weight: 600; font-size: 11pt; }
.qr-brand-mark { width: 8mm; height: 8mm; }
.qr-brand-mark rect, .qr-brand-mark path { stroke: #888; }
.qr-brand-mark circle:first-of-type { stroke: #111; }
.qr-eyebrow { font: 600 8.5pt var(--mono); letter-spacing: .14em; text-transform: uppercase; color: #d4500b; }
.qr-card-body { flex: 1; display: flex; gap: 8mm; align-items: center; min-height: 0; }
.qr-box { flex: none; }
.qr { display: block; width: 92mm; height: 92mm; }
.qr-info { display: flex; flex-direction: column; gap: 2.5mm; min-width: 0; }
.qr-name { font-size: 22pt; font-weight: 700; line-height: 1.1; color: #000; word-break: break-word; }
.qr-group { font-size: 12pt; color: #333; }
.qr-desc { font-size: 10.5pt; color: #444; }
.qr-steps { font-size: 10.5pt; color: #222; margin-top: 2mm; padding: 2.5mm 3mm; border-left: 1mm solid #ff6a1a; background: #f4f4f2; }
.qr-code-label { font: 600 7.5pt var(--mono); letter-spacing: .14em; text-transform: uppercase; color: #666; margin-top: 2mm; }
.qr-code { font: 600 13pt var(--mono); letter-spacing: .1em; color: #000; }
.per-4 .qr-card { padding: 6mm 6mm; gap: 3mm; }
.per-4 .qr-card-body { flex-direction: column; gap: 3mm; align-items: center; text-align: center; }
.per-4 .qr { width: 62mm; height: 62mm; }
.per-4 .qr-info { align-items: center; gap: 1.5mm; }
.per-4 .qr-name { font-size: 15pt; }
.per-4 .qr-group { font-size: 10pt; }
.per-4 .qr-desc { display: none; }
.per-4 .qr-steps { font-size: 8.5pt; margin-top: 1mm; padding: 1.5mm 2.5mm; }
.per-4 .qr-code { font-size: 10.5pt; }
.per-4 .qr-brand { font-size: 9pt; }
.per-4 .qr-brand-mark { width: 6mm; height: 6mm; }

/* ---------- Avisos y modales ---------- */
.toasts { position: fixed; right: 16px; bottom: 16px; z-index: 3000; display: flex; flex-direction: column; gap: 8px; max-width: min(420px, calc(100vw - 32px)); }
.toast {
  display: flex; align-items: flex-start; gap: 10px; padding: 11px 14px; font-size: 13.5px; cursor: pointer;
  background: var(--ink-3); color: var(--text); border: 1px solid var(--line-2); border-left: 3px solid var(--text-3); border-radius: var(--radius);
  animation: toast-in .18s ease-out;
}
.toast .icon { width: 16px; height: 16px; margin-top: 1px; }
.toast-ok { border-left-color: var(--ok); }
.toast-ok .icon { color: var(--ok); }
.toast-error { border-left-color: var(--alarm); }
.toast-error .icon { color: var(--alarm); }
.toast.out { opacity: 0; transition: opacity .2s; }
@keyframes toast-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.modal-backdrop { position: fixed; inset: 0; z-index: 2000; display: grid; place-items: center; padding: 16px; background: rgba(0, 0, 0, .66); }
.modal { width: min(480px, 100%); max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px); display: flex; flex-direction: column; background: var(--ink-2); border: 1px solid var(--line-2); border-top: 2px solid var(--signal); }
.modal-wide { width: min(720px, 100%); }
.modal:focus { outline: none; }
.modal-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 16px 16px 12px 20px; border-bottom: 1px solid var(--line); }
.modal-head h2 { font-size: 18px; font-weight: 600; line-height: 1.25; margin-top: 2px; }
.modal-body { padding: 16px 20px; overflow-y: auto; }
.modal-text { color: var(--text-2); }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 20px 16px; border-top: 1px solid var(--line); }
.resolve-form { display: flex; flex-direction: column; gap: 10px; }
.secret { display: flex; flex-direction: column; gap: 14px; }
.secret-row { display: flex; align-items: center; gap: 10px; }
.secret-value { flex: 1; font: 600 28px/1 var(--mono); letter-spacing: .14em; padding: 14px; text-align: center; border: 1px dashed var(--signal); color: var(--text); background: var(--ink); }
body.modal-open { overflow: hidden; }

/* ---------- Adaptación a pantallas ---------- */
@media (max-width: 1440px) {
  .mon-body { grid-template-columns: minmax(330px, 380px) minmax(0, 1fr); }
  .top-btn .top-label { display: none; }
  .top-btn { width: 32px; padding: 0; justify-content: center; }
  .kpi { padding: 9px 12px; }
}
@media (max-width: 1180px) {
  :root { --side-w: 64px; }
  .brand { justify-content: center; padding: 0; }
  .brand-text, .nav-label, .side-user-info { display: none; }
  .nav-link, .side-btn { justify-content: center; padding: 0; }
  .nav-badge { position: absolute; top: 2px; right: 2px; min-width: 18px; padding: 1px 4px; font-size: 10px; }
  .kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .kpi:nth-child(4n) { border-right: 0; }
  .kpi:nth-child(-n+4) { border-bottom: 1px solid var(--line); }
  .kpis-4 .kpi:nth-child(-n+4) { border-bottom: 0; }
  .kpi { min-height: 60px; }
  .kpi-value { font-size: 24px; }
  .detail-grid { grid-template-columns: minmax(0, 1fr); }
  .qr-layout { grid-template-columns: minmax(0, 1fr); }
  .qr-options { position: static; }
}
@media (max-width: 1000px) {
  .view.fill { overflow-y: auto; display: block; }
  .monitor { height: auto; }
  .mon-body { display: flex; flex-direction: column; }
  .mon-map { order: -1; height: 300px; flex: none; border-bottom: 1px solid var(--line); }
  .mon-side { border-right: 0; }
  .mon-list { overflow: visible; }
  .list-head { top: 0; }
  .drawer { position: fixed; top: 0; z-index: 1500; width: min(480px, 100%); }
  .mon-map.has-drawer .map-tools { right: 10px; }
  .rounds-grid { grid-template-columns: minmax(0, 1fr); }
  .rounds-map { position: relative; top: 0; height: 360px; min-height: 0; order: -1; }
  .page { padding: 16px; }
  .clock { display: none; }
}
@media (max-width: 640px) {
  .kpis, .kpis-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi:nth-child(2n) { border-right: 0; }
  .kpi { border-bottom: 1px solid var(--line); }
  .net-text, .hide-sm { display: none; }
  .search-box { max-width: none; flex-basis: 100%; }
  .toolbar .input { flex: 1 1 140px; }
  .facts { grid-template-columns: 100px minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  .badge.blink, .ev-row.is-new, .vs-marker.is-open::before, .top-btn.is-ringing, .net.is-off .net-dot { animation: none; }
}

/* ---------- Impresión: solo la hoja de QR ---------- */
@media print {
  @page { margin: 10mm; }
  :root { color-scheme: light; }
  html, body { background: #fff !important; color: #000; height: auto; }
  body > :not(#print-root) { display: none !important; }
  #print-root { display: block !important; }
  .qr-sheet { zoom: 1 !important; }
  .qr-page { margin: 0 !important; break-after: page; page-break-after: always; }
  .qr-page:last-child { break-after: auto; page-break-after: auto; }
  .qr-card, .qr-steps, .qr-eyebrow { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
