/* Панель управления нодами: тёмный пульт, статусы цветом и словом, адреса — моноширинным */
:root {
  --bg: #0D1117; --bar: #11161D; --panel: #151B23; --line: #2A3340; --row: #222A35; --map: #0B0F14; --grid: #1A222C;
  --fg: #E6EDF3; --soft: #C9D3DD; --muted: #9AA7B4; --dim: #6E7B88;
  --accent: #F2A93B; --accent-ink: #1A1206; --ok: #56D364; --ok-bg: #12301C; --bad: #FF7B72; --bad-bg: #3A1618;
  --warn-bg: #221A0C; --warn-line: #5A4318; --main: #8FB3FF;
  --mono: "JetBrains Mono", ui-monospace, monospace; --sans: "IBM Plex Sans", system-ui, sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 14px/1.45 var(--sans); }
a { color: var(--accent); } a:hover { color: #FFC56B; }
button, input { font: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.mono { font-family: var(--mono); }
.muted { color: var(--muted); }

.top { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 32px; padding: 14px max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); border-bottom: 1px solid var(--line); background: var(--bar); }
.brand { font-family: var(--mono); font-weight: 500; font-size: 16px; letter-spacing: .08em; color: var(--accent); text-decoration: none; }
.top .right { margin-left: auto; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 9px 14px; border-radius: 6px; border: 1px solid var(--line); background: transparent; color: var(--fg); text-decoration: none; }
.btn:hover { border-color: var(--muted); color: var(--fg); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
.btn-primary:hover { background: #FFC56B; color: var(--accent-ink); }
.btn-sm { padding: 6px 11px; font-size: 13px; }
.btn-danger { border-color: #5A2A2A; color: var(--bad); }

main { max-width: 1376px; margin: 0 auto; padding: 24px max(16px, env(safe-area-inset-right, 0px)) 48px max(16px, env(safe-area-inset-left, 0px)); display: flex; flex-direction: column; gap: 20px; }
.card { border: 1px solid var(--line); border-radius: 12px; background: var(--panel); overflow: hidden; }
.card-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 16px; padding: 14px 20px; border-bottom: 1px solid var(--line); }
.card-head h2 { margin: 0; font-size: 18px; font-weight: 600; }

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr)); gap: 12px; }
.tile { padding: 16px 18px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); }
.tile .k { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.tile .v { font-family: var(--mono); font-size: 28px; margin-top: 6px; font-variant-numeric: tabular-nums; }
.tile .v small { font-size: 15px; color: var(--muted); }

.flash { padding: 12px 16px; border-radius: 10px; border: 1px solid #1F4A2C; background: #0F2418; color: #A7E3B5; }
.flash.err { border-color: #5A2A2A; background: #2A1214; color: #FFB3AD; }
.warn { padding: 12px 16px; border-radius: 10px; border: 1px solid var(--warn-line); background: var(--warn-bg); color: #D8C9AE; }

.tablewrap { overflow-x: auto; }
table { width: 100%; min-width: 1060px; border-collapse: collapse; font-variant-numeric: tabular-nums; }
th { text-align: left; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .05em; font-weight: 500; padding: 10px 12px; }
td { padding: 12px; border-top: 1px solid var(--row); vertical-align: middle; }
th:first-child, td:first-child { padding-left: 20px; }
th:last-child, td:last-child { padding-right: 20px; }
td.num, th.num { text-align: right; }
.pill { display: inline-flex; align-items: center; gap: 8px; padding: 3px 10px; border-radius: 999px; font-size: 13px; }
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill.ok { background: var(--ok-bg); color: var(--ok); }
.pill.bad { background: var(--bad-bg); color: var(--bad); }
.pill.unk { background: #1E2631; color: var(--muted); }
.sub { font-size: 12px; color: var(--muted); }
.inline { display: inline; margin: 0; }

.map { position: relative; height: 520px; background: var(--map); }
.map svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.map .region { position: absolute; transform: translate(-50%, -50%); font-size: 22px; font-weight: 600; letter-spacing: .2em; text-transform: uppercase; color: #1F2833; white-space: nowrap; pointer-events: none; }
.map .pin { position: absolute; transform: translate(-7px, -7px); display: flex; align-items: flex-start; gap: 10px; }
.map .dot { flex: none; width: 14px; height: 14px; border-radius: 50%; }
.map .dot.ok { background: var(--ok); box-shadow: 0 0 0 4px rgba(86, 211, 100, .2); }
.map .dot.idle { background: var(--accent); box-shadow: 0 0 0 4px rgba(242, 169, 59, .2); }
.map .dot.bad { background: var(--bad); box-shadow: 0 0 0 4px rgba(255, 123, 114, .2); }
.map .dot.home { border-radius: 2px; background: var(--main); transform: rotate(45deg) scale(.8); }
.map .label { margin-top: -4px; padding: 2px 6px; border-radius: 6px; background: rgba(11, 15, 20, .85); display: flex; flex-direction: column; }
.map .label b { font-family: var(--mono); font-weight: 500; }
.legend { margin-left: auto; display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12px; color: var(--muted); }

.center { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.box { width: min(100%, 420px); display: flex; flex-direction: column; gap: 20px; }
.box h1 { margin: 0; font-size: 24px; }
