/* Centinela MDR · platform design tokens and layout.
   Dark first (the identity of the status page: deep navy, teal, blue, glass), with a light theme.
   The data-viz tokens of Escudo Digital (series, status colours, sequential ramp, surfaces) are kept
   in both themes because charts.js and the report preview read them. No inline styles anywhere:
   the server sends a strict CSP. */
:root, :root[data-theme="dark"] {
  color-scheme: dark;
  --page: #03060c;
  --page-2: #070d18;
  --surface: #0b1320;
  --surface-2: #121c2c;
  --surface-3: #1a2638;
  --glass: rgba(8, 18, 32, 0.62);
  --ink: #e8f6ff;
  --ink-2: #aac2d6;
  --muted: #7f97ab;
  --grid: #1b2738;
  --axis: #2b3b52;
  --border: rgba(140, 220, 255, 0.12);
  --border-strong: rgba(140, 220, 255, 0.24);
  --accent: #38f2d0;
  --accent-ink: #03110f;
  --accent-2: #4da3ff;
  --glow: rgba(56, 242, 208, 0.28);
  --series-1: #4da3ff; --series-2: #ff8a5b; --series-3: #2ed3a2; --series-4: #f2b84b;
  --series-5: #e07aae; --series-6: #58c85a; --series-7: #a79bff; --series-8: #ff6b7f;
  --good: #2fd27a; --warning: #ffc247; --serious: #ff8a5b; --critical: #ff5470; --deemph: #4a5566;
  --seq-1: #184f95; --seq-2: #1c5cab; --seq-3: #256abf; --seq-4: #3987e5; --seq-5: #5598e7; --seq-6: #86b6ef; --seq-7: #b7d3f6;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(0, 0, 0, .5), 0 18px 40px -24px rgba(0, 0, 0, .85);
  --font: "Inter", "SF Pro Text", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --mono: "SF Mono", ui-monospace, Menlo, Consolas, monospace;
  --rail: 76px;
  --top: 58px;
}
:root[data-theme="light"] {
  color-scheme: light;
  --page: #f2f5f9;
  --page-2: #e9eef5;
  --surface: #ffffff;
  --surface-2: #f1f4f8;
  --surface-3: #e4e9f0;
  --glass: rgba(255, 255, 255, 0.78);
  --ink: #0f1620;
  --ink-2: #46556a;
  --muted: #76869a;
  --grid: #e3e8ef;
  --axis: #c6cfdb;
  --border: rgba(15, 22, 32, 0.09);
  --border-strong: rgba(15, 22, 32, 0.18);
  --accent: #0ba58f;
  --accent-ink: #ffffff;
  --accent-2: #2a78d6;
  --glow: rgba(11, 165, 143, 0.18);
  --series-1: #2a78d6; --series-2: #eb6834; --series-3: #1baf7a; --series-4: #eda100;
  --series-5: #e87ba4; --series-6: #008300; --series-7: #4a3aa7; --series-8: #e34948;
  --good: #0ca30c; --warning: #e0a000; --serious: #ec835a; --critical: #d03b3b; --deemph: #c3c2b7;
  --seq-1: #cde2fb; --seq-2: #9ec5f4; --seq-3: #6da7ec; --seq-4: #3987e5; --seq-5: #256abf; --seq-6: #184f95; --seq-7: #0d366b;
  --shadow: 0 1px 2px rgba(0, 0, 0, .05), 0 12px 30px -20px rgba(0, 0, 0, .25);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { background: var(--page); }
body { background: radial-gradient(900px 520px at 85% -10%, color-mix(in srgb, var(--accent-2) 14%, transparent), transparent 60%),
       radial-gradient(700px 400px at -10% 110%, color-mix(in srgb, var(--accent) 10%, transparent), transparent 60%), var(--page);
  color: var(--ink); font: 14px/1.45 var(--font); min-height: 100vh; display: flex; -webkit-font-smoothing: antialiased; }
a { color: var(--accent-2); }
button, select, input, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.muted { color: var(--muted); }
.mono { font-family: var(--mono); font-size: 12px; }
.num, .tabular { font-variant-numeric: tabular-nums; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ------------------------------------------------------------------- rail */
.rail { position: sticky; top: 0; height: 100vh; width: var(--rail); flex: 0 0 var(--rail); z-index: 20;
  background: color-mix(in srgb, var(--surface) 88%, transparent); border-right: 1px solid var(--border);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  display: flex; flex-direction: column; align-items: center; padding: 14px 0 12px; gap: 6px; }
.rail nav { display: contents; }
.rail-brand { display: grid; place-items: center; width: 42px; height: 42px; margin-bottom: 10px; border-radius: 12px; color: var(--accent);
  text-decoration: none; }
.rail-brand svg { width: 34px; height: 34px; display: block; filter: drop-shadow(0 0 10px var(--glow)); }
.rail-btn { width: 64px; border: 0; background: none; color: var(--ink-2); display: flex; flex-direction: column; align-items: center; gap: 5px;
  padding: 9px 0 7px; border-radius: 12px; cursor: pointer; font-size: 10.5px; line-height: 1; letter-spacing: .01em; position: relative; }
.rail-btn svg { width: 21px; height: 21px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.rail-btn:hover { background: var(--surface-2); color: var(--ink); }
.rail-btn[aria-selected="true"] { color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); }
.rail-btn[aria-selected="true"]::before { content: ""; position: absolute; left: -6px; top: 12px; bottom: 12px; width: 3px; border-radius: 3px; background: var(--accent);
  box-shadow: 0 0 10px var(--glow); }
.rail-spacer { flex: 1; }
.rail-user { width: 64px; display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 8px 0; border: 0; background: none; cursor: pointer; color: var(--ink-2); font-size: 10.5px; border-radius: 12px; }
.rail-user:hover { background: var(--surface-2); color: var(--ink); }
.avatar { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 12px; color: var(--accent-ink);
  background: linear-gradient(135deg, var(--accent), var(--accent-2)); letter-spacing: .02em; }
.icon-sun, .icon-moon { display: none; }
:root[data-theme="dark"] .icon-sun, :root:not([data-theme="light"]) .icon-sun { display: block; }
:root[data-theme="light"] .icon-moon { display: block; }
:root[data-theme="light"] .icon-sun { display: none; }

/* ------------------------------------------------------------------ shell */
.shell { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.top { position: sticky; top: 0; z-index: 15; min-height: var(--top); display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; padding: 10px 22px;
  background: color-mix(in srgb, var(--surface) 82%, transparent); border-bottom: 1px solid var(--border);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.crumbs { display: flex; align-items: center; gap: 8px; min-height: 30px; font-size: 13px; color: var(--muted); min-width: 0; }
.crumbs .brand-name { color: var(--ink-2); font-weight: 600; letter-spacing: .08em; text-transform: uppercase; font-size: 11.5px; }
.crumbs b { color: var(--ink); font-size: 15.5px; font-weight: 650; letter-spacing: -0.01em; white-space: nowrap; }
.crumbs .sep { opacity: .5; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-left: auto; align-items: center; min-width: 0; }
.chip { display: inline-flex; align-items: center; gap: 7px; padding: 5px 11px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border);
  font-size: 12.5px; color: var(--ink-2); white-space: nowrap; }
.chip b { color: var(--ink); font-weight: 600; }
a.chip { text-decoration: none; }
a.chip:hover { border-color: var(--border-strong); }
.chip.toggle { cursor: pointer; user-select: none; }
.chip.toggle input { accent-color: var(--accent); margin: 0; }
.chip.state-running { border-color: color-mix(in srgb, var(--accent) 45%, transparent); }
.chip.state-degraded { border-color: color-mix(in srgb, var(--warning) 55%, transparent); }
.chip.state-down { border-color: color-mix(in srgb, var(--critical) 55%, transparent); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); display: inline-block; flex: 0 0 auto; }
.dot.good, .dot.running { background: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
.dot.warning, .dot.degraded { background: var(--warning); box-shadow: 0 0 0 3px color-mix(in srgb, var(--warning) 22%, transparent); }
.dot.critical, .dot.down, .dot.error { background: var(--critical); box-shadow: 0 0 0 3px color-mix(in srgb, var(--critical) 22%, transparent); }
.dot.serious { background: var(--serious); }
.dot.pulse { animation: dotpulse 1.8s ease-out infinite; }
@keyframes dotpulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 45%, transparent); } 100% { box-shadow: 0 0 0 9px transparent; } }
.clock { font-variant-numeric: tabular-nums; }

.subtabs { display: flex; gap: 2px; padding: 12px 22px 0; flex-wrap: wrap; align-items: center; }
.segment { display: inline-flex; gap: 2px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 11px; padding: 3px; }
.segment button { border: 0; background: transparent; padding: 6px 13px; border-radius: 8px; cursor: pointer; color: var(--ink-2); font-size: 13px; white-space: nowrap; }
.segment button:hover { color: var(--ink); }
.segment button[aria-selected="true"], .segment button[aria-pressed="true"] { background: var(--surface); color: var(--ink); font-weight: 600; box-shadow: var(--shadow); }
.subtabs .spacer { flex: 1; }
.subtabs .hint { color: var(--muted); font-size: 12.5px; }

main { padding: 14px 22px 48px; flex: 1; }
.view { min-height: 40vh; }

/* ------------------------------------------------------------------- cards */
.grid { display: grid; gap: 14px; grid-template-columns: repeat(12, minmax(0, 1fr)); }
.card { position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px 12px;
  box-shadow: var(--shadow); min-width: 0; display: flex; flex-direction: column; }
.card h3 { margin: 0 0 2px; font-size: 14.5px; font-weight: 600; letter-spacing: -0.005em; }
.card .caption { color: var(--muted); font-size: 12px; }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.card-titles { min-width: 0; }
.card .chart { flex: 1; }
.card-foot { margin-top: 10px; font-size: 10.5px; color: var(--muted); }
.span-12 { grid-column: span 12; } .span-8 { grid-column: span 8; } .span-6 { grid-column: span 6; }
.span-4 { grid-column: span 4; } .span-3 { grid-column: span 3; }
@media (max-width: 1100px) { .span-4, .span-3 { grid-column: span 6; } .span-8 { grid-column: span 12; } }
@media (max-width: 720px) { .grid > * { grid-column: span 12 !important; } }

.menu { position: relative; flex: 0 0 auto; }
.icon-btn { width: 30px; height: 30px; border-radius: 8px; border: 1px solid transparent; background: transparent; color: var(--ink-2); cursor: pointer; font-size: 18px; line-height: 1; padding: 0; display: inline-grid; place-items: center; }
.icon-btn svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn:hover, .icon-btn[aria-expanded="true"] { background: var(--surface-2); color: var(--ink); }
.menu-list { position: absolute; right: 0; top: 34px; min-width: 180px; background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: 10px; box-shadow: var(--shadow); padding: 4px; z-index: 25; display: flex; flex-direction: column; }
.menu-item { text-align: left; background: none; border: 0; padding: 7px 10px; border-radius: 7px; color: var(--ink); cursor: pointer; font-size: 13px; text-decoration: none; }
.menu-item:hover { background: var(--surface-2); }
.menu-item.danger { color: var(--critical); }
.user-pop { position: fixed; left: 84px; bottom: 14px; top: auto; right: auto; min-width: 220px; z-index: 45; }
.user-head { padding: 8px 10px 10px; border-bottom: 1px solid var(--border); margin-bottom: 4px; font-size: 13px; }
.user-head b { display: block; }
.user-pop form { display: contents; }
.mt { margin-top: 14px; }
.card.expanded { position: fixed; inset: 24px; z-index: 30; overflow: auto; grid-column: auto; }
body.has-expanded::after { content: ""; position: fixed; inset: 0; background: rgba(0, 0, 0, .5); z-index: 25; }

/* -------------------------------------------------------------- stat tiles */
.kpis { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); margin: 0 0 14px; }
.tile { position: relative; overflow: hidden; min-width: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px 16px 10px; box-shadow: var(--shadow); min-height: 118px; display: flex; flex-direction: column; }
.tile .label { color: var(--ink-2); font-size: 12.5px; font-weight: 500; }
.tile .value-row { display: flex; align-items: baseline; gap: 8px; margin-top: 8px; flex-wrap: wrap; min-width: 0; }
.tile .value { font-size: 38px; font-weight: 300; line-height: 1; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tile.hero .value { font-size: 48px; }
.tile .value.long { font-size: 26px; line-height: 1.15; }
.tile .value.xlong { font-size: 20px; line-height: 1.2; white-space: normal; }
.tile .of { color: var(--muted); font-size: 15px; font-weight: 400; }
.tile .spark { width: 110px; height: 32px; margin-left: auto; align-self: center; flex: 0 0 auto; }
.tile .delta { font-size: 12px; color: var(--muted); margin-top: 6px; display: flex; gap: 6px; align-items: center; }
.tile .delta.up-bad, .tile .delta.down-bad { color: var(--critical); }
.tile .delta.up-good, .tile .delta.down-good { color: var(--good); }
.tile .delta .mark { font-weight: 700; }
.tile .sub { font-size: 12px; color: var(--muted); margin-top: 6px; }
.tile .refreshed { margin-top: auto; padding-top: 8px; font-size: 10.5px; color: var(--muted); }
.tile .accent { position: absolute; left: 0; top: 0; bottom: 0; width: 3px; margin: 0; border-radius: 0; background: transparent; }
.tile .accent.critical { background: var(--critical); } .tile .accent.serious { background: var(--serious); }
.tile .accent.warning { background: var(--warning); } .tile .accent.good { background: var(--good); }
.tile .accent.accent { background: var(--accent); } .tile .accent.muted { background: var(--grid); }

/* ------------------------------------------------------------------ charts */
.chart { width: 100%; position: relative; }
.chart svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart text { font-family: var(--font); fill: var(--ink-2); font-size: 11px; }
.chart .tick text { fill: var(--muted); font-variant-numeric: tabular-nums; }
.chart .grid line { stroke: var(--grid); stroke-width: 1; }
.chart .axis line { stroke: var(--axis); stroke-width: 1; }
.chart .label { fill: var(--ink-2); }
.chart .value-label { fill: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.chart rect.mark, .chart circle.mark, .chart path.mark, .chart rect.cell { transition: opacity .12s; cursor: default; }
.chart .hit { fill: transparent; }
.chart rect.mark:hover, .chart path.mark:hover, .chart circle.mark:hover { filter: brightness(1.15); }
.chart .crosshair { stroke: var(--axis); stroke-width: 1; pointer-events: none; }
.donut-wrap { display: flex; justify-content: center; }
.donut-wrap svg { width: min(100%, 200px); }
.chart .donut-value { font-size: 30px; font-weight: 300; fill: var(--ink); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.chart .donut-label { font-size: 11px; fill: var(--muted); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 10px; font-size: 12px; color: var(--ink-2); }
.legend .key { display: inline-flex; align-items: center; gap: 6px; }
.legend .swatch { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.legend .swatch.line { width: 14px; height: 2px; border-radius: 1px; }
.empty { color: var(--muted); font-size: 13px; padding: 22px 0; text-align: center; }
.tooltip { position: fixed; z-index: 60; pointer-events: none; background: var(--surface); color: var(--ink);
  border: 1px solid var(--border-strong); border-radius: 9px; padding: 8px 10px; font-size: 12px; box-shadow: 0 8px 24px rgba(0, 0, 0, .35); max-width: 300px; }
.tooltip .t-title { color: var(--ink-2); margin-bottom: 4px; }
.tooltip .t-row { display: flex; justify-content: space-between; gap: 12px; }
.tooltip .t-row b { font-variant-numeric: tabular-nums; }
.tooltip .t-key { display: inline-block; width: 12px; height: 2px; vertical-align: middle; margin-right: 6px; }

/* ------------------------------------------------------------------ tables */
.table-wrap { overflow: auto; max-height: 520px; border: 1px solid var(--border); border-radius: 10px; }
table.data { width: 100%; border-collapse: collapse; font-size: 12.5px; }
table.data th, table.data td { padding: 7px 10px; text-align: left; border-bottom: 1px solid var(--grid); white-space: nowrap; }
table.data th { position: sticky; top: 0; background: var(--surface-2); color: var(--ink-2); font-weight: 600; cursor: pointer; user-select: none; font-size: 12px; z-index: 1; }
table.data th[aria-sort="ascending"]::after { content: " ↑"; } table.data th[aria-sort="descending"]::after { content: " ↓"; }
table.data td.num, table.data th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.data tr:hover td { background: var(--surface-2); }
table.data td.wrap { white-space: normal; }
table.data td .bar { display: inline-block; height: 8px; border-radius: 2px; background: var(--seq-4); vertical-align: middle; margin-right: 6px; }
.table-tools { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; flex-wrap: wrap; }
.table-tools input[type="search"] { padding: 5px 9px; border-radius: 9px; border: 1px solid var(--border-strong); background: var(--surface); min-width: 220px; }
.row-link { cursor: pointer; }

.badge { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 600; border: 1px solid var(--border); background: var(--surface-2); color: var(--ink-2); white-space: nowrap; }
.badge.P1 { color: #fff; background: var(--critical); border-color: transparent; }
.badge.P2 { color: #fff; background: var(--serious); border-color: transparent; }
.badge.P3 { color: #1a1a19; background: var(--warning); border-color: transparent; }
.badge.P4 { background: var(--surface-3); }
.badge.sent, .badge.ok, .badge.ready, .badge.good { color: var(--good); border-color: color-mix(in srgb, var(--good) 35%, transparent); }
.badge.pending, .badge.sending, .badge.warning { color: var(--warning); border-color: color-mix(in srgb, var(--warning) 40%, transparent); }
.badge.failed, .badge.error, .badge.critical { color: var(--critical); border-color: color-mix(in srgb, var(--critical) 40%, transparent); }
.badge.info { color: var(--accent-2); }
.badge.admin { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 40%, transparent); }
.badge.analista { color: var(--accent-2); border-color: color-mix(in srgb, var(--accent-2) 40%, transparent); }
.badge.reportes { color: var(--series-7); border-color: color-mix(in srgb, var(--series-7) 45%, transparent); }
.badge.lectura { color: var(--muted); }
.badge.off { color: var(--muted); text-decoration: line-through; }

/* ----------------------------------------------------------------- buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 7px 13px; border-radius: 10px; border: 1px solid var(--border-strong);
  background: var(--surface-2); cursor: pointer; text-decoration: none; color: var(--ink); font-weight: 500; line-height: 1.2; white-space: nowrap; }
.btn:hover { border-color: var(--axis); background: var(--surface-3); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: transparent; font-weight: 650; }
.btn.primary:hover { filter: brightness(1.06); }
.btn.danger { color: var(--critical); border-color: color-mix(in srgb, var(--critical) 45%, transparent); background: color-mix(in srgb, var(--critical) 8%, transparent); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn.ghost:hover { background: var(--surface-2); color: var(--ink); }
.btn.small { padding: 4px 9px; font-size: 12px; border-radius: 8px; }
.btn[aria-disabled="true"], .btn:disabled { opacity: .5; pointer-events: none; }
.btn svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ------------------------------------------------------------------- forms */
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px 18px; align-items: end; }
.field { display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; color: var(--ink-2); min-width: 0; }
.field.wide { grid-column: 1 / -1; }
.field input, .field select, .field textarea, .input { width: 100%; padding: 8px 11px; border-radius: 10px; border: 1px solid var(--border-strong); background: var(--surface-2); color: var(--ink); min-width: 0; }
.field input:focus, .field select:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
.field input[type="file"] { padding: 6px; }
.field .help { font-size: 11.5px; color: var(--muted); }
.form-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; justify-content: flex-end; margin-top: 14px; }
.form-error { color: var(--critical); font-size: 13px; margin-top: 8px; min-height: 1.2em; }
.switch { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.switch input { accent-color: var(--accent); width: 16px; height: 16px; }

/* ------------------------------------------------------------------- board */
.board-meta { display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: center; margin: 2px 0 12px; color: var(--muted); font-size: 12.5px; }
.board { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; align-items: start; }
.col { background: color-mix(in srgb, var(--surface) 70%, transparent); border: 1px solid var(--border); border-radius: var(--radius); min-height: 220px; display: flex; flex-direction: column; }
.col-head { display: flex; align-items: center; gap: 8px; padding: 12px 14px 10px; border-bottom: 1px solid var(--border); font-weight: 600; }
.col-head .count { margin-left: auto; font-variant-numeric: tabular-nums; font-weight: 600; font-size: 12px; padding: 2px 9px; border-radius: 999px; background: var(--surface-2); color: var(--ink-2); }
.col.todo .col-head .dot { background: var(--critical); } .col.doing .col-head .dot { background: var(--warning); } .col.done .col-head .dot { background: var(--good); }
.col-body { display: flex; flex-direction: column; gap: 10px; padding: 12px; }
.col-empty { color: var(--muted); font-size: 13px; padding: 26px 10px; text-align: center; }
.case-card { position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px 10px 16px; cursor: pointer;
  box-shadow: var(--shadow); overflow: hidden; will-change: transform; }
.case-card::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--muted); }
.case-card.P1::before { background: var(--critical); } .case-card.P2::before { background: var(--serious); } .case-card.P3::before { background: var(--warning); }
.case-card:hover { border-color: var(--border-strong); }
.case-card.selected { border-color: var(--accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 30%, transparent), var(--shadow); }
.case-head { display: flex; align-items: center; gap: 8px; min-width: 0; }
.case-head .entity { font-weight: 600; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.case-head .ref { margin-left: auto; color: var(--muted); font-family: var(--mono); font-size: 11px; }
.case-host { margin-top: 4px; display: flex; gap: 8px; align-items: center; color: var(--ink-2); font-size: 12.5px; min-width: 0; }
.case-host .host { font-family: var(--mono); font-size: 12px; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.case-host .alerts { color: var(--muted); white-space: nowrap; }
.case-names { margin-top: 6px; font-size: 12.5px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.case-foot { margin-top: 9px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12px; }
.sla { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px; background: var(--surface-2); color: var(--ink-2); font-variant-numeric: tabular-nums; border: 1px solid var(--border); }
.sla.due { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 35%, transparent); }
.sla.soon { color: var(--warning); border-color: color-mix(in srgb, var(--warning) 45%, transparent); }
.sla.overdue { color: var(--critical); border-color: color-mix(in srgb, var(--critical) 45%, transparent); background: color-mix(in srgb, var(--critical) 10%, transparent); font-weight: 600; }
.sla.none { color: var(--muted); }
.where { color: var(--ink-2); }
.notice-chips { margin-left: auto; display: inline-flex; gap: 4px; }
.nchip { display: inline-flex; align-items: center; gap: 3px; padding: 1px 7px; border-radius: 999px; font-size: 11px; font-weight: 600; background: var(--surface-2); border: 1px solid var(--border); color: var(--ink-2); }
.nchip.sent { color: var(--good); } .nchip.pending { color: var(--warning); } .nchip.failed { color: var(--critical); }
.legend-line { color: var(--muted); font-size: 12px; margin-top: 12px; line-height: 1.5; }

/* ------------------------------------------------------------------ drawer */
.drawer-backdrop { position: fixed; inset: 0; background: rgba(2, 5, 10, .55); z-index: 40; opacity: 0; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(560px, 100vw); z-index: 41; background: var(--surface); border-left: 1px solid var(--border-strong);
  box-shadow: -20px 0 60px rgba(0, 0, 0, .45); display: flex; flex-direction: column; transform: translateX(100%); }
.drawer-head { display: flex; align-items: flex-start; gap: 10px; padding: 18px 20px 12px; border-bottom: 1px solid var(--border); }
.drawer-head h2 { margin: 0; font-size: 17px; font-weight: 650; letter-spacing: -0.01em; }
.drawer-head .sub { color: var(--muted); font-size: 12.5px; margin-top: 3px; }
.drawer-head .close { margin-left: auto; }
.drawer-body { overflow: auto; padding: 14px 20px 30px; flex: 1; }
.section { margin: 0 0 18px; }
.section h4 { margin: 0 0 8px; font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.kv { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.kv th { text-align: left; width: 36%; color: var(--ink-2); font-weight: 500; padding: 5px 8px; vertical-align: top; }
.kv td { padding: 5px 8px; color: var(--ink); }
.kv tr:nth-child(odd) { background: var(--surface-2); }
.steps { margin: 4px 0 0; padding-left: 18px; } .steps li { margin: 3px 0; }
.analysis { background: color-mix(in srgb, var(--accent-2) 8%, var(--surface-2)); border: 1px solid color-mix(in srgb, var(--accent-2) 30%, transparent); border-radius: 12px; padding: 12px 14px; }
.analysis .title { font-weight: 650; margin-bottom: 6px; }
.analysis p { margin: 6px 0; }
.analysis .verdict { display: inline-flex; gap: 6px; align-items: center; margin-top: 4px; }
.notice-list { display: flex; flex-direction: column; gap: 6px; }
.notice-row { display: grid; grid-template-columns: 1fr auto auto; gap: 8px; align-items: center; padding: 6px 10px; border-radius: 9px; background: var(--surface-2); font-size: 12.5px; }
.notice-row .who { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.notice-row .type { color: var(--muted); font-size: 11.5px; }

/* ------------------------------------------------------------------- modal */
.modal-backdrop { position: fixed; inset: 0; background: rgba(2, 5, 10, .6); z-index: 50; display: grid; place-items: center; padding: 16px; opacity: 0; }
.modal { width: min(520px, 100%); background: var(--surface); border: 1px solid var(--border-strong); border-radius: 16px; box-shadow: 0 30px 80px rgba(0, 0, 0, .6); padding: 20px 22px; transform: scale(.96); }
.modal h2 { margin: 0 0 4px; font-size: 17px; }
.modal .lead { color: var(--muted); font-size: 13px; margin: 0 0 14px; }

/* ------------------------------------------------------------------ toasts */
.toasts { position: fixed; right: 18px; bottom: 18px; z-index: 70; display: flex; flex-direction: column; gap: 8px; max-width: min(420px, calc(100vw - 32px)); }
.toast { background: var(--surface); border: 1px solid var(--border-strong); border-left: 3px solid var(--accent); border-radius: 12px; padding: 10px 14px; box-shadow: var(--shadow);
  font-size: 13px; display: flex; gap: 10px; align-items: center; }
.toast.error { border-left-color: var(--critical); }
.toast.warning { border-left-color: var(--warning); }
.toast .btn { margin-left: auto; }

/* ---------------------------------------------------------------- pipeline */
.flow-card { padding: 18px 18px 14px; }
.flow { display: flex; align-items: stretch; gap: 0; margin: 6px 0 4px; }
.node { flex: 0 0 auto; width: 150px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 14px; padding: 12px 14px 10px; position: relative; min-width: 0; }
.node::after { content: ""; position: absolute; left: 12px; right: 12px; top: 0; height: 2px; border-radius: 2px; background: var(--muted); opacity: .6; }
.node.ok::after { background: var(--accent); } .node.warn::after { background: var(--warning); } .node.error::after { background: var(--critical); }
.node .node-label { font-size: 11.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-2); display: flex; align-items: center; gap: 6px; }
.node .node-label svg { width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.node .node-value { font-size: 34px; font-weight: 300; letter-spacing: -0.02em; line-height: 1.05; margin-top: 8px; font-variant-numeric: tabular-nums; }
.node .node-hint { font-size: 11.5px; color: var(--muted); margin-top: 6px; line-height: 1.35; }
.connector { flex: 1 1 40px; min-width: 28px; position: relative; height: auto; }
.connector .track { position: absolute; left: 0; right: 0; top: 50%; height: 2px; background: var(--grid); transform: translateY(-50%); border-radius: 2px; }
.connector .track::after { content: ""; position: absolute; right: -1px; top: 50%; width: 7px; height: 7px; border-top: 2px solid var(--axis); border-right: 2px solid var(--axis); transform: translateY(-50%) rotate(45deg); }
.flow-dot { position: absolute; left: 0; top: 50%; width: 7px; height: 7px; margin: -3.5px 0 0 -3.5px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 8px var(--glow); opacity: 0; }
.flow.down .flow-dot { background: var(--critical); }
.flow-foot { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 12px; color: var(--muted); font-size: 12.5px; align-items: center; }
.stat-list { display: flex; flex-direction: column; gap: 0; font-size: 13px; }
.stat-list > div { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px solid var(--grid); }
.stat-list > div:last-child { border-bottom: 0; }
.stat-list span:first-child { color: var(--ink-2); }
.stat-list b { font-variant-numeric: tabular-nums; font-weight: 600; }
.prio-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 4px; }
.prio { border-radius: 11px; padding: 10px 10px 8px; background: var(--surface-2); border: 1px solid var(--border); text-align: center; }
.prio .v { font-size: 26px; font-weight: 300; font-variant-numeric: tabular-nums; line-height: 1; }
.prio .k { font-size: 11px; color: var(--muted); margin-top: 5px; font-weight: 600; }
.prio.P1 .v { color: var(--critical); } .prio.P2 .v { color: var(--serious); } .prio.P3 .v { color: var(--warning); }
.meter { height: 8px; border-radius: 6px; background: var(--surface-3); overflow: hidden; margin: 6px 0 2px; }
.meter > span { display: block; height: 100%; border-radius: 6px; background: linear-gradient(90deg, var(--accent), var(--accent-2)); width: 0; }
.meter-label { display: flex; justify-content: space-between; font-size: 12px; color: var(--ink-2); }
.meter-label b { font-variant-numeric: tabular-nums; }

/* --------------------------------------------------------------- messaging */
.events { display: flex; flex-direction: column; font-size: 12.5px; max-height: 440px; overflow: auto; padding-right: 4px; }
.events > div { display: grid; grid-template-columns: 112px 64px 1fr; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--grid); align-items: baseline; }
.events > div:last-child { border-bottom: 0; }
.events .at { color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.events .text { color: var(--ink-2); overflow-wrap: anywhere; }
.delivery-note { display: flex; gap: 10px; align-items: center; padding: 10px 14px; border-radius: 12px; background: color-mix(in srgb, var(--warning) 10%, var(--surface)); border: 1px solid color-mix(in srgb, var(--warning) 35%, transparent); font-size: 13px; margin-bottom: 14px; }
.delivery-note.live { background: color-mix(in srgb, var(--good) 8%, var(--surface)); border-color: color-mix(in srgb, var(--good) 35%, transparent); }
.delivery-note.simulation { background: color-mix(in srgb, var(--accent-2) 8%, var(--surface)); border-color: color-mix(in srgb, var(--accent-2) 35%, transparent); }

/* ------------------------------------------------------------------- admin */
.users-toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.users-toolbar .spacer { flex: 1; }
.role-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 10px; }
.role-card { background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; font-size: 12.5px; }
.role-card .name { font-weight: 650; margin-bottom: 3px; }
.role-card .perms { color: var(--muted); font-size: 11.5px; margin-top: 4px; }
.actions { display: inline-flex; gap: 4px; }

/* ---------------------------------------------------------------- reportes */
.report-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px 18px; align-items: end; margin: 8px 0 4px; }
.report-form label { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; color: var(--ink-2); }
.report-form select, .report-form input[type="date"] { padding: 7px 10px; border-radius: 10px; border: 1px solid var(--border-strong); background: var(--surface-2); color: var(--ink); }
.report-form label.kinds { grid-column: 1 / -1; }
.report-kinds { display: inline-flex; flex-wrap: wrap; align-self: start; gap: 2px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 11px; padding: 3px; }
.report-kinds button { border: 0; background: transparent; padding: 6px 12px; border-radius: 8px; cursor: pointer; color: var(--ink-2); white-space: nowrap; }
.report-kinds button[aria-pressed="true"] { background: var(--surface); color: var(--ink); font-weight: 600; box-shadow: var(--shadow); }
.report-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.report-upload { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px 18px; align-items: end; margin: 10px 0 4px; }
.report-upload label { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; color: var(--ink-2); }
.report-upload input { padding: 6px 9px; border-radius: 10px; border: 1px solid var(--border-strong); background: var(--surface-2); color: var(--ink); font: inherit; max-width: 100%; }
.report-queries { margin: 8px 0 2px; font-size: 12.5px; }
.report-queries summary { cursor: pointer; color: var(--accent-2); }
.report-queries .query-name { font-weight: 600; margin: 8px 0 2px; color: var(--ink-2); }
.report-queries pre { background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; font-size: 11.5px; overflow-x: auto; margin: 0; white-space: pre; font-family: var(--mono); }
.status-line { margin-top: 8px; font-size: 12.5px; color: var(--ink-2); min-height: 1.2em; }
.report-doc { background: #ffffff; color: #0f1620; border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 30px 36px; max-width: 980px; margin: 14px auto 0;
  --surface: #ffffff; --surface-2: #f1f4f8; --surface-3: #e4e9f0; --ink: #0f1620; --ink-2: #46556a; --muted: #76869a; --grid: #e3e8ef; --axis: #c6cfdb;
  --border: rgba(15, 22, 32, 0.09); --border-strong: rgba(15, 22, 32, 0.18); --accent: #2a78d6; --good: #0ca30c; --warning: #e0a000; --serious: #ec835a; --critical: #d03b3b; --deemph: #c3c2b7;
  --series-1: #2a78d6; --series-2: #eb6834; --series-3: #1baf7a; --series-4: #eda100; --series-5: #e87ba4; --series-6: #008300; --series-7: #4a3aa7; --series-8: #e34948;
  --shadow: 0 1px 2px rgba(0, 0, 0, .05), 0 12px 30px -20px rgba(0, 0, 0, .25); }
.report-doc .doc-kicker { color: var(--muted); font-size: 12px; letter-spacing: .06em; text-transform: uppercase; }
.report-doc .doc-title { font-size: 21px; font-weight: 700; color: var(--accent); margin: 6px 0 2px; letter-spacing: -0.01em; }
.report-doc .doc-subtitle { font-size: 14px; color: var(--ink-2); font-weight: 600; margin: 0 0 14px; }
.report-doc h2 { font-size: 16px; margin: 26px 0 6px; padding-bottom: 4px; border-bottom: 2px solid var(--accent); color: var(--accent); }
.report-doc h3 { font-size: 13.5px; margin: 16px 0 6px; }
.report-doc p { margin: 6px 0; line-height: 1.5; }
.report-doc p.caption { color: var(--muted); font-size: 12px; font-style: italic; }
.report-doc p.muted { color: var(--ink-2); font-size: 13px; }
.report-doc ul { margin: 6px 0; padding-left: 20px; } .report-doc li { margin: 3px 0; line-height: 1.45; }
.report-doc .tlp { background: #ffc000; color: #111; font-weight: 700; text-align: center; border-radius: 6px; padding: 6px; margin: 12px 0; letter-spacing: .02em; }
.report-doc .doc-note { background: var(--surface-2); border-left: 3px solid var(--accent); padding: 8px 12px; border-radius: 6px; font-size: 12.5px; color: var(--ink-2); margin: 10px 0; }
.report-doc .kv { margin: 6px 0 10px; }
.report-doc .kv th { width: 32%; font-weight: 600; }
.report-doc .kpis { margin: 12px 0; }
.report-doc .tile { background: var(--surface); border-color: var(--border); color: var(--ink); }
.report-doc .tile .refreshed { display: none; }
.report-doc .figure { margin: 10px 0 16px; } .report-doc .figure .fig-title { font-size: 12.5px; font-weight: 600; color: var(--ink-2); margin: 10px 0 6px; }
.report-doc .table-wrap { max-height: 420px; margin: 6px 0 12px; }
.report-doc table.data th, .report-doc table.data td { white-space: normal; vertical-align: top; }
.report-doc table.data tr.total td { font-weight: 700; border-top: 1px solid var(--ink-2); }
.report-doc .truncated { color: var(--muted); font-size: 12px; font-style: italic; margin: -6px 0 10px; }
.report-doc .doc-foot { margin-top: 24px; padding-top: 10px; border-top: 1px solid var(--grid); color: var(--muted); font-size: 11.5px; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
.report-doc .tooltip { color: var(--ink); }

/* ------------------------------------------------------------- skeletons */
.skeleton { position: relative; overflow: hidden; background: var(--surface-2); border-radius: 10px; min-height: 16px; }
.skeleton::after { content: ""; position: absolute; inset: 0; transform: translateX(-100%); background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--ink) 7%, transparent), transparent); animation: shimmer 1.4s infinite; }
@keyframes shimmer { to { transform: translateX(100%); } }
.skeleton.card-like { min-height: 140px; border-radius: var(--radius); }
.loading-row { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); margin-bottom: 14px; }
.error-box { background: color-mix(in srgb, var(--critical) 10%, var(--surface)); border: 1px solid color-mix(in srgb, var(--critical) 40%, transparent); border-radius: 12px; padding: 14px 16px; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.empty-state { text-align: center; color: var(--muted); padding: 40px 16px; }
.empty-state svg { width: 40px; height: 40px; stroke: currentColor; fill: none; stroke-width: 1.5; margin-bottom: 8px; opacity: .6; }

/* ------------------------------------------------------------------- login */
.login-body { display: block; overflow: hidden; background: #03060c; color: #e8f6ff; }
.login-body canvas { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }
.login-vignette { position: fixed; inset: 0; pointer-events: none;
  background: radial-gradient(60% 55% at 50% 50%, transparent 0%, rgba(3, 6, 12, 0.15) 55%, rgba(3, 6, 12, 0.85) 100%),
              linear-gradient(180deg, rgba(3, 6, 12, 0.6) 0%, transparent 18%, transparent 82%, rgba(3, 6, 12, 0.7) 100%); }
.login-header, .login-footer { position: fixed; left: 0; right: 0; z-index: 3; display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 18px clamp(16px, 4vw, 40px); font-size: 12px; letter-spacing: 0.18em; text-transform: uppercase; color: #8aa3b8; }
.login-header { top: 0; } .login-footer { bottom: 0; letter-spacing: 0.12em; }
.login-header a, .login-footer a { color: #8aa3b8; text-decoration: none; border: 1px solid rgba(140, 220, 255, 0.14); border-radius: 999px; padding: 6px 12px; }
.login-header a:hover, .login-footer a:hover { color: #e8f6ff; }
.login-brand { display: flex; align-items: center; gap: 10px; color: #e8f6ff; font-weight: 600; }
.login-brand i { width: 8px; height: 8px; border-radius: 50%; background: #38f2d0; box-shadow: 0 0 12px #38f2d0; }
.login-main { position: relative; z-index: 2; min-height: 100vh; display: grid; place-items: center; padding: 88px 16px; }
.login-card { width: min(420px, 100%); padding: 32px clamp(20px, 5vw, 36px) 26px; border-radius: 26px; background: rgba(8, 18, 32, 0.62); border: 1px solid rgba(140, 220, 255, 0.14);
  backdrop-filter: blur(16px) saturate(140%); -webkit-backdrop-filter: blur(16px) saturate(140%);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.02) inset, 0 0 120px -30px rgba(56, 242, 208, 0.35); text-align: center; }
.emblem { position: relative; width: 92px; height: 92px; margin: 0 auto 14px; }
.emblem svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.emblem .ring { transform-origin: 54px 54px; animation: spin 14s linear infinite; }
.emblem .ring.slow { animation-duration: 26s; animation-direction: reverse; }
.emblem .core { animation: breathe 3.2s ease-in-out infinite; transform-origin: 54px 52px; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes breathe { 0%, 100% { opacity: .75; transform: scale(.94); } 50% { opacity: 1; transform: scale(1.06); } }
.login-card h1 { margin: 0; font-size: clamp(28px, 6vw, 34px); font-weight: 800; letter-spacing: 0.3em; margin-right: -0.3em;
  background: linear-gradient(180deg, #ffffff 0%, #b9d7ea 100%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.login-card .sub { margin: 6px 0 0; font-size: 11.5px; letter-spacing: 0.3em; margin-right: -0.3em; color: #8aa3b8; text-transform: uppercase; }
.login-form { margin-top: 24px; text-align: left; display: flex; flex-direction: column; gap: 12px; }
.login-form label { display: flex; flex-direction: column; gap: 5px; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: #8aa3b8; }
.login-form input { width: 100%; padding: 11px 13px; border-radius: 12px; border: 1px solid rgba(140, 220, 255, 0.18); background: rgba(255, 255, 255, 0.04); color: #e8f6ff; font-size: 15px; letter-spacing: normal; text-transform: none; }
.login-form input:focus { outline: none; border-color: #38f2d0; box-shadow: 0 0 0 3px rgba(56, 242, 208, 0.22); }
.login-form .btn.primary { margin-top: 6px; padding: 11px 14px; font-size: 15px; border-radius: 12px; background: linear-gradient(135deg, #38f2d0, #4da3ff); color: #03110f; }
.login-msg { margin: 14px 0 0; font-size: 13px; line-height: 1.5; color: #8aa3b8; }
.login-msg.error { color: #ff5470; }
.login-msg.warn { color: #ffb547; }
.login-status { margin-top: 18px; display: inline-flex; align-items: center; gap: 8px; font-size: 12px; color: #8aa3b8; letter-spacing: .06em; text-transform: uppercase; }
.login-status .dot { background: #38f2d0; box-shadow: 0 0 10px #38f2d0; }
.login-status[data-state="degraded"] .dot { background: #ffb547; box-shadow: 0 0 10px #ffb547; }
.login-status[data-state="down"] .dot { background: #ff5470; box-shadow: 0 0 10px #ff5470; }

/* ------------------------------------------------------------------ mobile */
@media (max-width: 980px) { .board { grid-template-columns: 1fr; } .flow { flex-direction: column; } .node { width: 100%; }
  .connector { min-height: 34px; flex: 0 0 34px; } .connector .track { left: 50%; right: auto; top: 0; bottom: 0; width: 2px; height: auto; transform: translateX(-50%); }
  .connector .track::after { right: auto; left: 50%; top: auto; bottom: -1px; transform: translateX(-50%) rotate(135deg); }
  .flow-dot { left: 50%; top: 0; } .drawer { width: 100vw; } }
@media (max-width: 760px) {
  body { flex-direction: column; }
  .rail { position: fixed; top: auto; bottom: 0; height: 62px; width: 100%; flex: none; flex-direction: row; justify-content: space-around; padding: 4px 6px;
    border-right: 0; border-top: 1px solid var(--border); gap: 0; }
  .rail-brand, .rail-spacer { display: none; }
  .rail-btn, .rail-user { width: auto; flex: 1 1 0; min-width: 0; padding: 6px 2px; font-size: 9.5px; }
  .rail-btn[aria-selected="true"]::before { left: 10px; right: 10px; top: -5px; bottom: auto; width: auto; height: 3px; }
  .rail-btn span, .rail-user span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .shell { padding-bottom: 70px; max-width: 100vw; overflow-x: clip; }
  .top { padding: 8px 16px; gap: 6px 10px; }
  .crumbs .brand-name, .crumbs .sep-brand { display: none; }
  .chips { margin-left: 0; width: 100%; overflow-x: auto; flex-wrap: nowrap; scrollbar-width: none; }
  .chips::-webkit-scrollbar { display: none; }
  .subtabs { padding: 10px 16px 0; }
  .segment { overflow-x: auto; max-width: 100%; scrollbar-width: none; }
  main { padding: 12px 16px 40px; }
  .tile .spark { display: none; }
  .tile .value { font-size: 32px; } .tile.hero .value { font-size: 38px; }
  .card.expanded { inset: 8px 8px 72px; }
  .toasts { right: 16px; left: 16px; bottom: 76px; max-width: none; }
  .user-pop { left: auto; right: 10px; bottom: 70px; }
  .notice-row { grid-template-columns: 1fr auto; }
  .events > div { grid-template-columns: 92px 1fr; } .events .lvl { grid-column: 1; } .events .text { grid-column: 1 / -1; }
  .prio-row { grid-template-columns: repeat(2, 1fr); }
  .report-doc { padding: 20px 16px; }
  .modal { padding: 18px 16px; }
}

@media (prefers-reduced-motion: reduce) {
  .emblem .ring, .emblem .core, .dot.pulse, .skeleton::after { animation: none; }
  * { scroll-behavior: auto !important; }
}
