:root { --bg:#070b14; --card:#0f172a; --border:#1e293b; --text:#e5e7eb; --muted:#94a3b8; --up:#22c55e; --warn:#f59e0b; --down:#ef4444; --paused:#64748b; --maint:#60a5fa; }
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.35 "Segoe UI", system-ui, Arial, sans-serif; display: flex; flex-direction: column; overflow: hidden; }
.hidden { display: none !important; }
.n-head { display: flex; align-items: center; gap: 24px; padding: 12px 24px; border-bottom: 1px solid var(--border); }
.n-title { display: flex; align-items: center; gap: 10px; font-size: 20px; font-weight: 700; }
.n-sum { display: flex; gap: 14px; flex: 1; }
.n-sum span { font-size: 18px; font-weight: 700; padding: 4px 12px; border-radius: 8px; background: var(--card); }
.n-sum .d { color: var(--down); } .n-sum .w { color: var(--warn); } .n-sum .u { color: var(--up); }
.n-oncall { color: var(--muted); font-size: 15px; }
.n-clock { font-size: 28px; font-weight: 700; font-variant-numeric: tabular-nums; }
.n-main { flex: 1; display: grid; grid-template-columns: 1fr 440px; gap: 20px; padding: 20px 24px; min-height: 0; }
.n-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); grid-auto-rows: min-content; gap: 14px; overflow: auto; align-content: start; }
.n-tile { background: var(--card); border: 1px solid var(--border); border-left: 8px solid var(--up); border-radius: 12px; padding: 14px 16px; min-height: 110px; }
.n-tile.warning { border-left-color: var(--warn); } .n-tile.down { border-left-color: var(--down); background: #2a0f14; animation: pulse 2s ease-in-out infinite; }
.n-tile.acked { animation: none; } .n-tile.unknown, .n-tile.paused { border-left-color: var(--paused); }
@keyframes pulse { 50% { background: #3b1219; } }
.n-tile h3 { margin: 0 0 6px; font-size: 19px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.n-tile .cnt { color: var(--muted); font-size: 14px; }
.n-tile .bad { margin-top: 8px; font-size: 14px; color: #fecaca; }
.n-tile .bad div { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.n-tile .probe { color: var(--down); font-size: 13px; margin-top: 6px; }
.n-list { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; overflow: auto; }
.n-list h2 { margin: 0 0 10px; font-size: 17px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.n-out { padding: 10px 0; border-bottom: 1px solid var(--border); }
.n-out .t { display: flex; justify-content: space-between; gap: 10px; font-weight: 700; }
.n-out .t .dur { color: var(--down); font-variant-numeric: tabular-nums; white-space: nowrap; }
.n-out .s { color: var(--muted); font-size: 14px; }
.n-out.acked .t .dur { color: var(--warn); }
.n-out .ack { color: var(--warn); font-size: 14px; }
.n-ok { color: var(--up); font-size: 20px; font-weight: 700; padding: 20px 0; text-align: center; }
.n-err { position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%); background: var(--down); color: #fff; padding: 8px 16px; border-radius: 8px; }
@media (max-width: 1000px) { .n-main { grid-template-columns: 1fr; } body { overflow: auto; } }
/* ---- 1.20: pages, map, customer pages, controls ---- */
.n-page { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 15px; white-space: nowrap; }
.n-dots { display: flex; gap: 5px; }
.n-dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--border); }
.n-dots i.on { background: var(--text); }
.n-area { position: relative; min-height: 0; display: flex; flex-direction: column; }
.n-area > * { flex: 1; min-height: 0; }
.n-logo { height: 22px; max-width: 90px; object-fit: contain; vertical-align: -4px; margin-right: 8px; background: #fff; border-radius: 4px; padding: 2px 3px; }
.n-logo.big { height: 48px; max-width: 180px; margin: 0; padding: 4px 6px; }
.n-map { position: relative; overflow: hidden; border-radius: 12px; border: 1px solid var(--border); background: #0b1220; }
.n-tiles img { position: absolute; width: 256px; height: 256px; filter: brightness(.62) saturate(.7) contrast(1.05); user-select: none; }
.n-marks .n-mark { position: absolute; transform: translate(-50%, -50%); display: flex; align-items: center; gap: 6px; }
.n-mark .pin { width: 18px; height: 18px; border-radius: 50%; background: var(--up); border: 3px solid #0b1220; box-shadow: 0 0 0 2px var(--up); flex: none; }
.n-mark .lbl { position: absolute; left: 22px; white-space: nowrap; background: rgba(7, 11, 20, .82); padding: 2px 8px; border-radius: 6px; font-size: 14px; font-weight: 600; }
.n-mark .lbl b { color: var(--down); }
.n-mark.warning .pin { background: var(--warn); box-shadow: 0 0 0 2px var(--warn); }
.n-mark.acked .pin { background: #b91c1c; box-shadow: 0 0 0 2px #b91c1c; }
.n-mark.down .pin { background: var(--down); box-shadow: 0 0 0 2px var(--down); animation: ping 1.4s ease-out infinite; }
.n-mark.down { z-index: 3; } .n-mark.acked, .n-mark.warning { z-index: 2; }
.n-mark.unknown .pin, .n-mark.paused .pin, .n-mark.maint .pin { background: var(--paused); box-shadow: 0 0 0 2px var(--paused); }
@keyframes ping { 0% { box-shadow: 0 0 0 2px var(--down), 0 0 0 0 rgba(239, 68, 68, .7); } 100% { box-shadow: 0 0 0 2px var(--down), 0 0 0 22px rgba(239, 68, 68, 0); } }
.n-attr { position: absolute; right: 6px; bottom: 4px; font-size: 11px; color: var(--muted); background: rgba(7, 11, 20, .7); padding: 1px 6px; border-radius: 4px; }
.n-empty { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 18px; padding: 40px; text-align: center; }
.n-cust { display: flex; flex-direction: column; gap: 14px; overflow: hidden; }
.n-cust-head { display: flex; align-items: center; gap: 16px; flex: none; }
.n-cust-head h2 { margin: 0; font-size: 26px; }
.n-cust-head .sub { color: var(--muted); font-size: 16px; }
.n-cust-head .d { color: var(--down); font-weight: 700; } .n-cust-head .w { color: var(--warn); font-weight: 700; } .n-cust-head .u { color: var(--up); font-weight: 700; }
.n-devs { flex: 1; display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); grid-auto-rows: min-content; gap: 10px; overflow: auto; align-content: start; }
.n-sub { grid-column: 1 / -1; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; font-size: 13px; margin-top: 6px; }
.n-dev { background: var(--card); border: 1px solid var(--border); border-left: 6px solid var(--up); border-radius: 10px; padding: 10px 12px; }
.n-dev .nm { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.n-dev .st { color: var(--muted); font-size: 13px; margin-top: 4px; }
.n-dev .st .down { color: #fecaca; } .n-dev .st .warning { color: #fde68a; }
.n-dev.warning { border-left-color: var(--warn); }
.n-dev.down { border-left-color: var(--down); background: #2a0f14; animation: pulse 2s ease-in-out infinite; }
.n-dev.acked { border-left-color: #b91c1c; background: #2a0f14; }
.n-dev.paused, .n-dev.unknown { border-left-color: var(--paused); opacity: .7; } .n-dev.maint { border-left-color: var(--maint); }
.n-ctl { position: fixed; left: 50%; bottom: 16px; transform: translate(-50%, 120%); opacity: 0; transition: .25s; display: flex; align-items: center; gap: 10px;
  background: rgba(15, 23, 42, .95); border: 1px solid var(--border); border-radius: 12px; padding: 8px 14px; font-size: 14px; z-index: 10; }
body.ctl-on .n-ctl, .n-ctl:hover, .n-ctl:focus-within { transform: translate(-50%, 0); opacity: 1; }
.n-ctl button, .n-ctl select { background: var(--card); color: var(--text); border: 1px solid var(--border); border-radius: 8px; padding: 5px 10px; font: inherit; cursor: pointer; }
.n-ctl label { display: flex; align-items: center; gap: 4px; color: var(--muted); white-space: nowrap; }
body.ctl-on { cursor: default; }
body:not(.ctl-on) { cursor: none; }
@media (max-width: 1000px) { .n-map { min-height: 60vh; } .n-ctl { flex-wrap: wrap; width: 94vw; } }
/* flapping sensors (went down repeatedly within the last hour) */
.n-mark.flap .pin { background: var(--warn); box-shadow: 0 0 0 2px var(--warn); } .n-mark.flap { z-index: 2; }
.n-tile .bad .d { color: #fecaca; } .n-tile .bad .f, .n-tile .bad .w { color: #fde68a; }
.flapb { display: inline-block; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: #1c1917; background: var(--warn); border-radius: 4px; padding: 0 5px; vertical-align: 1px; }
.n-dev.flap { border-left-color: var(--warn); }
.n-dev .st .fl-s { color: #fde68a; }
.n-dev .pth { color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.n-out.flap .t .dur { color: var(--warn); }
.n-out .fl { color: var(--warn); font-size: 13px; }
.n-rest { grid-column: 1 / -1; margin-top: 10px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.n-rest-h { width: 100%; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; font-size: 13px; margin-bottom: 2px; }
.n-chip { background: var(--card); border: 1px solid var(--border); border-left: 4px solid var(--up); border-radius: 6px; padding: 3px 8px; font-size: 13px; color: var(--muted); white-space: nowrap; }
.n-chip.maint { border-left-color: var(--maint); } .n-chip.paused, .n-chip.unknown { border-left-color: var(--paused); }
.n-devs > .n-ok { grid-column: 1 / -1; }
