:root {
  color-scheme: dark;
  --bg: #0d1119;
  --rail: #101620;
  --panel: #151d29;
  --inset: #101722;
  --hover: #1b2635;
  --line: #293648;
  --ink: #eef3fa;
  --muted: #a3b0c3;
  --dim: #798aa2;
  --accent: #5ce4cb;
  --accent-bg: #14342f;
  --red: #ff818d;
  --amber: #ffc46e;
  --blue: #95b9ff;
  font: 14px/1.5 "Segoe UI", system-ui, sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); }
button, input, textarea, select { font: inherit; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
button, a { touch-action: manipulation; }
button { cursor: pointer; }
button:disabled { opacity: .5; cursor: wait; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: clamp(27px, 4vw, 40px); line-height: 1.14; letter-spacing: -.045em; }
h2 { font-size: 17px; letter-spacing: -.02em; }
h3 { font-size: 15px; }
small, .small { font-size: 12px; }
.muted { color: var(--muted); }
.eyebrow { color: var(--accent); font: 700 10px/1.4 ui-monospace, Consolas, monospace; letter-spacing: .18em; text-transform: uppercase; }
.mono, time { font-family: ui-monospace, Consolas, monospace; }
.boot { display: grid; min-height: 100vh; place-items: center; color: var(--muted); }
.brand { display: flex; align-items: center; gap: 11px; font-weight: 700; }
.brand small { display: block; font: 600 9px/1.5 ui-monospace, Consolas, monospace; text-transform: uppercase; letter-spacing: .15em; color: var(--muted); }
.mark { width: 36px; height: 36px; display: grid; place-items: center; flex: 0 0 auto; color: #09221e; background: var(--accent); border-radius: 10px; }
svg.icon { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; vertical-align: middle; }
.mark svg { width: 22px; height: 22px; stroke-width: 2; }
.login { min-height: 100vh; display: grid; place-items: center; padding: 25px; background: radial-gradient(ellipse at 20% 10%, #1a3a3e 0, transparent 48%), var(--bg); }
.login-card { width: min(100%, 470px); border: 1px solid var(--line); border-radius: 18px; padding: clamp(23px, 5vw, 42px); background: var(--rail); box-shadow: 0 25px 90px #05080f99; }
.login-card h1 { margin-top: 30px; }
.login-card form { margin-top: 24px; }
.login-card .btn { width: 100%; }
.auth-link { margin-top: 12px; }
.shell { display: grid; grid-template: 66px minmax(calc(100vh - 66px), auto) / 210px minmax(0, 1fr); }
.header { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 25px; border-bottom: 1px solid var(--line); background: var(--rail); position: sticky; top: 0; z-index: 3; }
.head-right, .inline { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.online { color: var(--accent); }
.offline { color: var(--amber); }
.signal { display: inline-flex; align-items: center; gap: 7px; padding: 5px 9px; font: 700 10px/1.5 ui-monospace, Consolas, monospace; letter-spacing: .08em; }
.signal::before, .status-dot::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.clock { padding: 0 8px; color: var(--muted); font-size: 12px; }
.sidebar { background: var(--rail); border-right: 1px solid var(--line); padding: 22px 13px 14px; }
.sidebar-inner { position: sticky; top: 88px; display: flex; flex-direction: column; min-height: calc(100vh - 102px); }
.section-label { padding: 0 10px 9px; color: var(--dim); font: 700 10px/1.4 ui-monospace, Consolas, monospace; letter-spacing: .16em; text-transform: uppercase; }
.nav { display: grid; gap: 4px; }
.nav button { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; padding: 10px; color: var(--muted); background: transparent; border: 1px solid transparent; border-radius: 8px; }
.nav button:hover { background: var(--hover); color: var(--ink); }
.nav button[aria-current="page"] { color: var(--accent); border-color: #26514a; background: var(--accent-bg); }
.account { margin-top: auto; padding: 18px 9px 0; border-top: 1px solid var(--line); overflow-wrap: anywhere; }
.account .btn { margin-top: 9px; }
.content { padding: 25px clamp(16px, 3.1vw, 42px) 35px; max-width: 1650px; width: 100%; margin: 0 auto; min-width: 0; }
.pagehead { display: flex; align-items: end; justify-content: space-between; gap: 14px; margin-bottom: 20px; }
.pagehead h1 { margin: 3px 0 4px; }
.button-row { display: flex; flex-wrap: wrap; gap: 8px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 1px solid var(--line); background: var(--hover); color: var(--ink); border-radius: 8px; padding: 8px 12px; min-height: 36px; white-space: nowrap; text-decoration: none; }
.btn:hover { border-color: var(--dim); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #0a2824; font-weight: 750; }
.btn.primary:hover { background: #a1f7e8; }
.btn.danger { background: #3b2029; color: #ffadb5; border-color: #743743; font-weight: 700; }
.btn.ghost { background: transparent; }
.btn.tiny { font-size: 12px; padding: 4px 8px; min-height: 28px; }
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 15px; }
.metric { background: var(--panel); border: 1px solid var(--line); padding: 13px 15px; border-radius: 10px; }
.metric strong { display: block; font: 650 25px/1.2 ui-monospace, Consolas, monospace; margin-top: 4px; }
.metric span { color: var(--muted); font-size: 12px; }
.metric.hot strong { color: var(--red); }
.grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(275px, 1fr); gap: 14px; align-items: start; }
.stack { display: grid; gap: 14px; min-width: 0; }
.panel { border: 1px solid var(--line); border-radius: 11px; background: var(--panel); min-width: 0; overflow: hidden; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 9px; padding: 13px 15px; border-bottom: 1px solid var(--line); }
.panel-head .eyebrow { color: var(--dim); }
.panel-body { padding: 14px 15px; }
.list { display: grid; }
.list > * + * { border-top: 1px solid var(--line); }
.call { width: 100%; display: grid; grid-template-columns: 35px minmax(0, 1fr) auto; align-items: center; gap: 11px; text-align: left; padding: 11px 14px; border: 0; background: transparent; color: var(--ink); }
.call:hover, .row-button:hover { background: var(--hover); }
.call strong, .row-button strong { display: block; overflow-wrap: anywhere; }
.call .tag { justify-self: end; }
.priority { display: grid; place-items: center; height: 31px; border-radius: 6px; border: 1px solid #37546a; background: #203142; color: var(--blue); font: 750 12px/1 ui-monospace, Consolas, monospace; }
.priority.p1 { color: var(--red); background: #3a222d; border-color: #713d4c; }
.priority.p2 { color: var(--amber); background: #3a3124; border-color: #665239; }
.tag { display: inline-flex; width: max-content; max-width: 100%; align-items: center; gap: 5px; border-radius: 5px; color: #b9c9dc; padding: 2px 6px; background: #202c3d; font: 650 10px/1.5 ui-monospace, Consolas, monospace; }
.tag.good { color: var(--accent); background: #1b3b36; }
.tag.warn { color: var(--amber); background: #392f23; }
.tag.danger { color: var(--red); background: #3a222d; }
.unit, .row { display: flex; justify-content: space-between; align-items: center; gap: 9px; padding: 9px 14px; }
.unit strong, .row strong { overflow-wrap: anywhere; }
.unit small { display: block; }
.empty { color: var(--muted); padding: 22px 15px; }
.alert { border: 1px solid #763c48; background: #351d27; color: #ffb1b9; border-radius: 9px; padding: 9px 12px; margin-bottom: 14px; font-weight: 650; }
.map { background: #101b29; display: block; width: 100%; height: auto; }
.map text { font: 500 11px ui-monospace, Consolas, monospace; fill: #a4b4c8; }
.map .marker { font-weight: 700; paint-order: stroke; stroke: #101b29; stroke-width: 4px; stroke-linejoin: round; fill: #f0f8fb; }
.map-foot { padding: 8px 14px; font-size: 11px; color: var(--muted); border-top: 1px solid var(--line); }
.pin-picker { border: 1px solid var(--line); border-radius: 8px; padding: 9px 11px; }
.pin-picker summary { cursor: pointer; font-weight: 650; }
.pin-picker .map { cursor: crosshair; border-radius: 6px; margin: 8px 0; }
.pin-picker [data-pin][hidden] { display: none; }
.search { display: flex; gap: 8px; align-items: end; }
.search label { flex: 1; }
label { display: grid; gap: 5px; font-weight: 600; color: #c8d3e0; font-size: 12px; }
input, select, textarea { width: 100%; border: 1px solid var(--line); border-radius: 7px; min-height: 38px; background: var(--inset); color: var(--ink); padding: 8px 10px; }
textarea { resize: vertical; min-height: 80px; }
input[type="checkbox"] { width: auto; min-height: 0; accent-color: var(--accent); }
.check { display: flex; align-items: center; gap: 8px; }
form.form { display: grid; gap: 12px; }
.fields { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
.form-error { color: var(--red); font-size: 12px; }
.row-button { text-align: left; padding: 11px 15px; background: transparent; color: var(--ink); width: 100%; border: 0; }
.table-wrap { overflow: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; }
th, td { padding: 9px 13px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: 10px; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); }
tr:last-child td { border-bottom: 0; }
dialog { color: var(--ink); background: var(--panel); border: 1px solid #3f526a; border-radius: 14px; padding: 0; max-height: calc(100dvh - 32px); width: min(640px, calc(100vw - 24px)); }
dialog::backdrop { background: #080c13c9; }
.dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; position: sticky; top: 0; z-index: 1; padding: 13px 17px; background: var(--panel); border-bottom: 1px solid var(--line); }
.dialog-body { padding: 16px 17px 19px; display: grid; gap: 14px; }
.detail { white-space: pre-wrap; overflow-wrap: anywhere; }
.well { background: var(--inset); border: 1px solid var(--line); border-radius: 8px; padding: 11px; overflow-wrap: anywhere; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { padding: 7px 0 7px 10px; border-left: 2px solid var(--line); overflow-wrap: anywhere; }
.timeline li + li { border-top: 1px solid var(--line); }
.map-page { max-width: 950px; margin: auto; }
#notice { position: fixed; z-index: 6; right: 16px; bottom: 16px; max-width: min(430px, calc(100vw - 32px)); }
#notice:empty { display: none; }
#notice div { background: #203343; border: 1px solid #3d6674; box-shadow: 0 8px 28px #0008; border-radius: 9px; padding: 10px 14px; overflow-wrap: anywhere; }
@media (max-width: 1000px) { .shell { grid-template-columns: 168px minmax(0, 1fr); } .clock { display: none; } }
@media (max-width: 830px) { .grid { grid-template-columns: 1fr; } }
@media (max-width: 640px) {
  .shell { display: block; }
  .header { position: relative; min-height: 61px; padding: 9px 12px; }
  .sidebar { padding: 5px 8px; border-right: 0; border-bottom: 1px solid var(--line); }
  .sidebar-inner { position: static; min-height: 0; }
  .section-label, .account { display: none; }
  .nav { display: flex; overflow: auto; padding: 4px; }
  .nav button { white-space: nowrap; width: auto; padding: 7px; font-size: 12px; }
  .content { padding-top: 16px; }
  .pagehead { align-items: start; flex-direction: column; }
  .metrics { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .call { grid-template-columns: 30px minmax(0,1fr) auto; gap: 7px; padding-inline: 9px; }
  .fields { grid-template-columns: 1fr; }
}
