/* «Надзор» (Oversight) console — a dark instrument surface for a control-room / wall display.
   CSP style-src 'self': colours via classes/attributes + CSSOM; no inline style= in markup. */
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
body { display: flex; flex-direction: column; background: #0f171c; color: #e4ecf0; }

.ov-header { display: flex; align-items: center; gap: 14px; padding: 9px 16px; background: #131f26; border-bottom: 1px solid #223038; }
.ov-brand { font-size: 15px; font-weight: 600; }
.ov-brand span { color: #5ba3c2; }
.ov-brand b { color: #e4ecf0; }
.ov-clock { font-variant-numeric: tabular-nums; font-size: 18px; font-weight: 700; color: #9fc4d6; letter-spacing: .04em; }
.ov-spacer { flex: 1; }
.ov-btn { font-size: 13px; padding: 6px 13px; border: 1px solid #2f4a56; background: #17262e; color: #9fc4d6; border-radius: 7px; cursor: pointer; }
.ov-btn:hover { background: #1d3540; }
.ov-lang { display: flex; gap: 3px; }
.ov-lang button { font-size: 12px; padding: 4px 8px; border: 1px solid #2f4a56; background: #17262e; color: #8fa8b4; border-radius: 5px; cursor: pointer; }
.ov-lang button[aria-pressed="true"] { background: #1d3a47; color: #cfe6f0; border-color: #3a6478; }

.ov-main { flex: 1; min-height: 0; display: flex; flex-direction: column; padding: 14px 16px 18px; gap: 14px; overflow: hidden; }
.ov-gate { background: #17262e; border: 1px solid #33505d; border-radius: 10px; padding: 22px; font-size: 15px; color: #cfe0e8; max-width: 60ch; margin: 30px auto; text-align: center; }

.ov-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.ov-kpi { background: #16242b; border: 1px solid #223038; border-radius: 10px; padding: 14px 16px; }
.ov-kpi-n { font-size: 30px; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1.05; color: #dfeef5; }
.ov-kpi-l { font-size: 12px; color: #8fa8b4; margin-top: 3px; text-transform: uppercase; letter-spacing: .05em; }

.ov-grid { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(320px, 1fr); gap: 14px; }
.ov-panel { background: #16242b; border: 1px solid #223038; border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; min-height: 0; }
.ov-panel h2 { margin: 0 0 8px; font-size: 12px; text-transform: uppercase; letter-spacing: .07em; color: #8fa8b4; font-weight: 700; }
.ov-map { flex: 1; min-height: 240px; border-radius: 8px; background: #0d1418; }
.ov-feed { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; }
.ov-row { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; background: none; border: none; border-bottom: 1px solid #1e2c33; padding: 8px 4px; cursor: pointer; color: #dfeef5; }
.ov-row:hover { background: #1a2b33; }
.ov-rank { font: 700 12px/1 "Segoe UI", monospace; min-width: 18px; color: #6d8a99; font-variant-numeric: tabular-nums; }
.ov-dot { width: 11px; height: 11px; border-radius: 50%; flex: none; }
.ov-row-body { display: flex; flex-direction: column; font-size: 13px; min-width: 0; }
.ov-row-body b { font-weight: 600; }
.ov-row-sub { font-size: 11px; color: #8fa8b4; margin-top: 1px; }
.ov-empty { color: #6d8a99; padding: 12px; }
.ov-note { margin: 8px 0 0; font-size: 11px; color: #7c96a2; line-height: 1.4; }

/* Map popup: a candidate's identity, themed to the dark board (Leaflet's default bubble is white). */
.ov-pop { font-size: 12px; line-height: 1.4; min-width: 150px; }
.ov-pop b { display: block; color: #e4ecf0; font-weight: 600; }
.ov-pop-hyp { color: #cfe0e8; margin-top: 2px; }
.ov-pop-sub { color: #8fa8b4; margin-top: 3px; font-variant-numeric: tabular-nums; }
.ov-pop-cav { color: #7c96a2; margin-top: 5px; font-size: 11px; }
.leaflet-popup-content-wrapper, .leaflet-popup-tip { background: #16242b; color: #cfe0e8; border: 1px solid #2f4a56; }
.leaflet-popup-content { margin: 9px 12px; }
.leaflet-container a.leaflet-popup-close-button { color: #8fa8b4; }

/* Wall mode: hide chrome, go big — a video-wall board. */
body.ov-wall .ov-header { padding: 6px 16px; }
body.ov-wall .ov-lang, body.ov-wall .ov-brand span { display: none; }
body.ov-wall .ov-kpi-n { font-size: 40px; }
body.ov-wall .ov-row { padding: 11px 4px; }
body.ov-wall .ov-row-body { font-size: 15px; }

@media (max-width: 820px) {
  .ov-grid { grid-template-columns: 1fr; grid-auto-rows: minmax(240px, auto); }
}

/* Facility markers + dossier overlay (Phase 2) */
.ov-fac { cursor: pointer; }
.ov-dossier { position: absolute; top: 0; right: 0; bottom: 0; width: 380px; max-width: 92vw; z-index: 1100;
  background: #14222a; border-left: 1px solid #2a3f49; box-shadow: -4px 0 24px rgba(0,0,0,.5); overflow-y: auto; padding: 16px 18px 24px; }
.ov-dossier[hidden] { display: none; }
.ov-dossier h2 { margin: 0 26px 8px 0; font-size: 17px; color: #dfeef5; }
.ov-dossier h3 { margin: 16px 0 4px; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: #8fa8b4; }
.ov-dos-close { position: absolute; top: 12px; right: 14px; border: none; background: none; color: #8fa8b4; font-size: 22px; line-height: 1; cursor: pointer; }
.ov-dos-close:hover { color: #dfeef5; }
.ov-dos-block { background: #17262e; border: 1px solid #223038; border-radius: 9px; padding: 8px 12px; }
.ov-dos-dec { border-left: 3px solid #5ba3c2; } .ov-dos-obs { border-left: 3px solid #b56b00; }
.ov-dos-row { display: flex; justify-content: space-between; gap: 12px; padding: 5px 0; border-bottom: 1px solid #1e2c33; font-size: 13px; }
.ov-dos-row:last-child { border-bottom: none; }
.ov-dos-row span { color: #8fa8b4; } .ov-dos-row b { text-align: right; color: #e4ecf0; font-variant-numeric: tabular-nums; }
.ov-dos-sub { font-size: 11.5px; color: #9fb4bf; padding: 2px 0 2px 8px; }
.ov-dos-none { font-size: 12.5px; color: #6d8a99; font-style: italic; }
.ov-dos-note { margin-top: 14px; font-size: 11px; line-height: 1.5; color: #7c96a2; }
.ov-muted { color: #8fa8b4; }

/* Station trend sparkline (slide-in panel) — full-width SVG polyline over the recent series */
.ov-spark { margin: 12px 0 4px; background: #12202700; }
.ov-spark svg { display: block; width: 100%; height: 60px; }

/* Anomaly queue groups (Phase 3) */
.ov-anom { margin-bottom: 6px; }
.ov-anom-group { margin-bottom: 4px; }
.ov-anom-head { width: 100%; text-align: left; background: #1c1a12; border: 1px solid #4a3a1a; color: #d9a441; border-radius: 8px; padding: 7px 10px; font-size: 12.5px; font-weight: 700; cursor: pointer; }
.ov-anom-head:hover { background: #241f13; }
.ov-anom-count { display: inline-block; background: #4a3a1a; color: #f0c669; border-radius: 10px; padding: 1px 8px; font-variant-numeric: tabular-nums; margin-left: 4px; }
.ov-anom-body { padding: 2px 0 4px; }
.ov-anom-row { border-bottom: 1px solid #1e2c33; }
.ov-anom-mark { color: #d9a441; min-width: 16px; flex: none; }

/* Coverage / blind spots (Phase 4) */
.ov-blind { cursor: pointer; }
.ov-btn[aria-pressed="true"] { background: #1d3a47; color: #cfe6f0; border-color: #3a6478; }

/* Changes: emerging / ceased (Phase 5) */
.ov-changes { margin-bottom: 6px; }
.ov-ch-group { margin-bottom: 4px; }
.ov-ch-head { width: 100%; text-align: left; border: 1px solid #223038; border-radius: 8px; padding: 7px 10px; font-size: 12.5px; font-weight: 700; cursor: pointer; }
.ov-ch-head.up { background: #12211a; border-color: #1f4a34; color: #6cc294; }
.ov-ch-head.down { background: #171f24; border-color: #2a3a41; color: #8fa8b4; }
.ov-ch-head:hover { filter: brightness(1.15); }
.ov-ch-count { display: inline-block; border-radius: 10px; padding: 1px 8px; font-variant-numeric: tabular-nums; margin-left: 4px; background: rgba(255,255,255,.08); }
.ov-ch-row { border-bottom: 1px solid #1e2c33; }

/* Area passport print (Phase 6): print only the passport panel */
.ov-passport { }
@media print {
  body * { visibility: hidden !important; }
  .ov-dossier, .ov-dossier * { visibility: visible !important; }
  .ov-dossier { position: static !important; width: auto !important; box-shadow: none !important; border: none !important; background: #fff !important; color: #111 !important; }
  .ov-dossier h2, .ov-dossier h3, .ov-dos-row b, .ov-dos-sub { color: #111 !important; }
  .ov-dos-block { background: #fff !important; border-color: #ccc !important; }
  .no-print { display: none !important; }
}

/* Gate card (BUG-P-005/013): a sign-in card instead of a bare line over an empty console. */
.ov-gate-lead { margin: 0 0 10px; color: #e6f0f4; }
.ov-gate-msg { margin: 0 0 6px; font-weight: 600; }
.ov-gate-sub { margin: 0 0 12px; color: #a9bfc9; font-size: 14px; }
.ov-gate-actions { margin: 14px 0 0; display: flex; flex-wrap: wrap; gap: 10px; }
.ov-gate-btn, .ov-gate-btn:visited { text-decoration: none; color: inherit; }
body.ov-gated .ov-kpis, body.ov-gated .ov-grid, body.ov-gated .ov-dossier, body.ov-gated #ov-wall, body.ov-gated #ov-area, body.ov-gated #ov-cover, body.ov-gated #ov-air { display: none; }
