/* HeinenTech Control Center */
@font-face { font-family: "Inter"; font-weight: 400; font-display: swap; src: url(../fonts/inter-400.woff2) format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 500; font-display: swap; src: url(../fonts/inter-500.woff2) format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 600; font-display: swap; src: url(../fonts/inter-600.woff2) format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 700; font-display: swap; src: url(../fonts/inter-700.woff2) format("woff2"); }
@font-face { font-family: "Barlow SC"; font-weight: 500; font-display: swap; src: url(../fonts/barlow-sc-500.woff2) format("woff2"); }
@font-face { font-family: "Barlow SC"; font-weight: 600; font-display: swap; src: url(../fonts/barlow-sc-600.woff2) format("woff2"); }
@font-face { font-family: "Barlow SC"; font-weight: 700; font-display: swap; src: url(../fonts/barlow-sc-700.woff2) format("woff2"); }
@font-face { font-family: "JetBrains Mono"; font-weight: 400; font-display: swap; src: url(../fonts/jbmono-400.woff2) format("woff2"); }

:root {
  --navy-950: #071631;
  --navy-900: #0B1F44;
  --navy-800: #102A5C;
  --blue-700: #1D3FAF;
  --blue-600: #1D4ED8;
  --blue-500: #2B5CE6;
  --blue-tint: #EEF1F8;      /* neutral blue-grey, not light blue */
  --ink: #0E1A2E;
  --ink-2: #33415A;
  --muted: #64728A;
  --line: #DDE2EA;
  --line-2: #EBEEF3;
  --bg: #F4F6F9;
  --white: #FFFFFF;
  --ok: #157347;   --ok-bg: #E7F4EC;
  --warn: #A15C00; --warn-bg: #FBF0DF;
  --bad: #C0262D;  --bad-bg: #FBE9E9;
  --radius: 4px;
  --side-w: 248px;
  --side-w-collapsed: 68px;
  --top-h: 56px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-head: "Barlow SC", "Inter", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 14px/1.5 var(--font); color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; }
a { color: var(--blue-600); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; color: var(--navy-900); }
[hidden] { display: none !important; }
.ico { width: 18px; height: 18px; flex: none; }
.ico-xs { width: 12px; height: 12px; }
.mono { font-family: var(--font-mono); font-size: 12.5px; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.truncate { max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
:focus-visible { outline: 2px solid var(--blue-600); outline-offset: 2px; }

/* ------------------------------------------------------------------ top bar */
.topbar {
  position: fixed; inset: 0 0 auto 0; height: var(--top-h); z-index: 30;
  display: flex; align-items: center; gap: 14px; padding: 0 20px 0 14px;
  background: var(--white); border-bottom: 1px solid var(--line);
}
.icon-btn { display: inline-grid; place-items: center; width: 36px; height: 36px; padding: 0; border: 0; background: none; color: var(--navy-900); border-radius: var(--radius); cursor: pointer; }
.icon-btn:hover { background: var(--bg); }
.icon-btn .ico { width: 22px; height: 22px; }
.wordmark { font-family: var(--font-head); font-weight: 700; font-size: 21px; letter-spacing: .12em; color: var(--navy-900); }
.wordmark:hover { text-decoration: none; }
.wordmark .dot { color: var(--blue-600); margin: 0 .15em; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 16px; }
.refresh-pick { position: relative; display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 4px 0 10px; border: 1px solid var(--line); border-radius: var(--radius); color: var(--ink-2); cursor: pointer; }
.refresh-pick:hover { border-color: #C9D0DB; }
.refresh-pick .ico { width: 15px; height: 15px; color: var(--muted); }
.refresh-pick select { width: auto; height: 30px; padding: 0 4px; border: 0; background: transparent; font: 600 12.5px var(--font); color: var(--navy-900); cursor: pointer; }
.refresh-pick select:focus { box-shadow: none; }
.refresh-dot { width: 7px; height: 7px; border-radius: 50%; background: #B6BFCC; }
.refresh-dot.is-on { background: var(--ok); box-shadow: 0 0 0 0 rgba(21, 115, 71, .5); animation: pulse 2s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 6px rgba(21, 115, 71, 0); } 100% { box-shadow: 0 0 0 0 rgba(21, 115, 71, 0); } }
.clock { font-family: var(--font-mono); font-size: 12.5px; color: var(--muted); }
.who { display: inline-flex; align-items: center; gap: 6px; font-weight: 500; color: var(--ink-2); padding-left: 16px; border-left: 1px solid var(--line); }
.who .ico { width: 16px; height: 16px; color: var(--muted); }
.tag { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; padding: 3px 8px; border-radius: 3px; }
.tag .ico { width: 13px; height: 13px; }
.tag-ok { color: var(--ok); background: var(--ok-bg); }
.tag-warn { color: var(--warn); background: var(--warn-bg); }
.tag-warn:hover { text-decoration: none; filter: brightness(.97); }

/* ------------------------------------------------------------------ sidebar */
.sidebar {
  position: fixed; top: var(--top-h); bottom: 0; left: 0; width: var(--side-w); z-index: 20;
  display: flex; flex-direction: column; background: var(--white); border-right: 1px solid var(--line);
  transition: width .18s ease, transform .2s ease;
}
.nav { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 14px 0 10px; scrollbar-width: thin; }
.nav-label { font-size: 11px; font-weight: 600; letter-spacing: .2em; text-transform: uppercase; color: #8A95A8; padding: 16px 22px 6px; white-space: nowrap; }
.nav-label:first-child { padding-top: 4px; }
.nav-item {
  position: relative; display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 5px 14px 5px 20px; margin: 1px 0; border: 0; background: none; font: inherit; text-align: left;
  color: var(--ink-2); font-weight: 500; cursor: pointer; white-space: nowrap;
}
.nav-item:hover { text-decoration: none; background: var(--bg); color: var(--navy-900); }
.nav-ico {
  flex: none; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%;
  border: 1.5px solid currentColor; color: var(--tone, var(--blue-600)); background: var(--white);
}
.nav-ico .ico { width: 16px; height: 16px; }
.tone-a { --tone: var(--navy-800); }
.tone-b { --tone: var(--blue-600); }
.tone-c { --tone: #4A5A78; }
/* one colour per menu category */
.tone-overview   { --tone: #5865F2; }
.tone-operations { --tone: #15803D; }
.tone-admin      { --tone: #C2410C; }
.nav-ico { background: color-mix(in srgb, var(--tone) 7%, #fff); }
.nav-item[href$="/discord"] .nav-ico .ico { width: 17px; height: 17px; }
.nav-item.active .nav-ico, .nav-item.active-parent .nav-ico { background: var(--tone); border-color: var(--tone); color: #fff; }
.nav-item.active::before { background: var(--tone); }
.nav-text { flex: 1; overflow: hidden; text-overflow: ellipsis; }
.nav-item.active, .nav-item.active-parent { background: var(--blue-tint); color: var(--navy-900); font-weight: 600; }
.nav-item.active::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; }
.nav-badge { flex: none; min-width: 22px; padding: 1px 6px; border-radius: 3px; background: var(--bad); color: #fff; font-size: 11px; font-weight: 700; text-align: center; line-height: 18px; }
.nav-badge.is-warn { background: #C77700; }
.nav-badge-sm { min-width: 18px; padding: 0 5px; font-size: 10.5px; line-height: 16px; margin-left: 6px; }
.nav-chev { flex: none; color: var(--muted); display: grid; transition: transform .15s; }
.nav-chev .ico { width: 15px; height: 15px; }
.nav-group.open .nav-chev { transform: rotate(180deg); }
.nav-sub { display: none; padding: 2px 0 6px; }
.nav-group.open .nav-sub { display: block; }
.nav-sub a { position: relative; display: flex; align-items: center; padding: 6px 14px 6px 64px; color: var(--ink-2); font-size: 13.5px; white-space: nowrap; }
.nav-sub a::before { content: ""; position: absolute; left: 35px; top: 0; bottom: 0; border-left: 1px solid var(--line); }
.nav-sub a:hover { text-decoration: none; color: var(--navy-900); background: var(--bg); }
.nav-group[data-group="monitoring"] { --tone: #15803D; }  /* operations */
.nav-sub a.active { color: var(--tone, var(--blue-600)); font-weight: 600; }
.nav-sub a.active::before { border-left: 2px solid var(--tone, var(--blue-600)); left: 34px; }

.sidebar-foot { padding: 12px; border-top: 1px solid var(--line); }
.sidebar-foot form { margin: 0; }
.foot-btn {
  display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; height: 40px;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--white); cursor: pointer;
  font: 600 12px var(--font); letter-spacing: .14em; text-transform: uppercase; color: var(--navy-900);
}
.foot-btn:hover { border-color: var(--navy-900); }
.foot-btn .ico { width: 17px; height: 17px; }
.collapse-btn {
  position: absolute; top: 50%; right: -13px; width: 26px; height: 26px; padding: 0; z-index: 2;
  display: grid; place-items: center; border-radius: 50%; border: 1px solid var(--line); background: var(--white);
  color: var(--ink-2); cursor: pointer; box-shadow: 0 1px 3px rgba(11, 31, 68, .1);
}
.collapse-btn:hover { color: var(--blue-600); border-color: var(--blue-600); }
.collapse-btn .ico { width: 14px; height: 14px; transition: transform .18s; }

/* collapsed sidebar (desktop) */
.side-collapsed .sidebar { width: var(--side-w-collapsed); }
.side-collapsed .main { margin-left: var(--side-w-collapsed); }
.side-collapsed .nav-text, .side-collapsed .nav-chev, .side-collapsed .nav-label,
.side-collapsed .nav-group .nav-sub, .side-collapsed .nav-group.open .nav-sub { display: none; }
.side-collapsed .nav { padding-top: 10px; }
.side-collapsed .nav-item { padding: 6px 0; justify-content: center; margin: 3px 0; }
.side-collapsed .nav-badge:not(.nav-badge-sm) { position: absolute; top: 2px; right: 8px; min-width: 16px; padding: 0 4px; font-size: 10px; line-height: 15px; }
.side-collapsed .foot-btn { padding: 0; }
.side-collapsed .collapse-btn .ico { transform: rotate(180deg); }

/* ------------------------------------------------------------------ main */
.main { margin-left: var(--side-w); padding-top: var(--top-h); min-height: 100vh; transition: margin-left .18s ease; }
.content { padding: 26px 32px 48px; }
.page-head { display: flex; align-items: center; gap: 16px; padding-bottom: 18px; margin-bottom: 22px; border-bottom: 1px solid var(--line); }
.page-head h1 { font-family: var(--font-head); font-weight: 600; font-size: 28px; line-height: 1.15; letter-spacing: .01em; }
.page-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 16px; margin-bottom: 20px; }
.kpi { display: flex; align-items: center; gap: 16px; padding: 18px 20px; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); }
.kpi-ico { display: grid; place-items: center; width: 44px; height: 44px; border-radius: var(--radius); background: var(--blue-tint); color: var(--tone, var(--blue-600)); }
.kpi-ico.tone-ok { color: var(--ok); background: var(--ok-bg); }
.kpi-ico.tone-bad { color: var(--bad); background: var(--bad-bg); }
.kpi-ico .ico { width: 21px; height: 21px; }
.kpi-num { font-family: var(--font-head); font-size: 30px; font-weight: 600; line-height: 1; color: var(--navy-900); font-variant-numeric: tabular-nums; }
.kpi-label { margin-top: 6px; font-size: 10.5px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }

.grid-2 { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.grid-dash { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); }
.panel { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 20px; overflow-x: auto; }
.panel-head { display: flex; align-items: center; gap: 12px; padding: 14px 20px; border-bottom: 1px solid var(--line); }
.panel-head h2 { font-size: 13px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.panel-head > :last-child:not(h2) { margin-left: auto; }
.panel-body { padding: 20px; }
.link { font-size: 13px; font-weight: 500; }
.form-panel { max-width: 860px; padding: 24px; }

/* tables */
.table { width: 100%; border-collapse: collapse; }
.table th { padding: 10px 16px; text-align: left; font-size: 11px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); background: #F8F9FB; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 12px 16px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: #FAFBFC; }
.table th.right, .table td.right { text-align: right; }
.table-compact td { padding: 9px 20px; }
.table-mini td { padding: 7px 20px; font-size: 13px; }
.table-mini .ev::before { width: 6px; height: 6px; }
.table th:first-child, .table td:first-child { padding-left: 20px; }
.table th:last-child, .table td:last-child { padding-right: 20px; }
.table th[data-sortable] { cursor: pointer; user-select: none; }
.table th[data-sortable]:hover { color: var(--navy-900); }
.table th[data-sortable]::after { content: "↕"; margin-left: 5px; opacity: .3; font-size: 10px; }
.table th.sort-asc::after { content: "▲"; opacity: .9; color: var(--blue-600); }
.table th.sort-desc::after { content: "▼"; opacity: .9; color: var(--blue-600); }
.table .empty { padding: 36px 20px; text-align: center; color: var(--muted); }
.row-actions { text-align: right; white-space: nowrap; }
.row-actions form { display: inline; margin: 0; }
.addr-link { display: inline-flex; align-items: center; gap: 5px; font-weight: 500; color: var(--blue-600); }
.addr-link .ico { color: var(--muted); }
.watch { display: inline-block; padding: 1px 7px; font-size: 11px; font-weight: 600; letter-spacing: .04em; border-radius: 3px; border: 1px solid; white-space: nowrap; }
.watch-agent { color: var(--blue-600); border-color: rgba(29, 78, 216, .35); }
.watch-agent:hover { text-decoration: none; background: var(--blue-tint); }
.watch-tcp, .watch-http { color: var(--muted); border-color: var(--line); }
.pill-note { margin-top: 4px; font-size: 11.5px; color: var(--bad); min-width: 140px; max-width: 170px; margin-left: auto; line-height: 1.3; white-space: normal; }
.pill-note:empty { display: none; }
.col-server { min-width: 150px; }
.row-actions .btn-sm { padding: 0 8px; }
.table-compact .pill-note { min-width: 0; max-width: 170px; }
.srv-ok { color: var(--ok); white-space: nowrap; }
.srv-bad { color: var(--bad); white-space: nowrap; }
.addr-sub { margin-top: 1px; font-size: 11.5px; color: var(--muted); }
.ext { display: inline-flex; align-items: center; gap: 5px; color: var(--ink-2); }

.pill { display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px; font-size: 11.5px; font-weight: 600; border-radius: 3px; white-space: nowrap; }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill-up { color: var(--ok); background: var(--ok-bg); }
.pill-down { color: var(--bad); background: var(--bad-bg); }
.pill-warn { color: var(--warn); background: var(--warn-bg); }
.pill-wait { color: var(--muted); background: var(--line-2); }
.days-ok, .days-warn, .days-bad { white-space: nowrap; }
.days-ok { color: var(--ok); font-weight: 600; }
.days-warn { color: var(--warn); font-weight: 600; }
.days-bad { color: var(--bad); font-weight: 600; }

.ev { font-weight: 500; }
.ev::before { content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 8px; border-radius: 1px; background: var(--muted); vertical-align: 1px; }
.ev-ok::before { background: var(--ok); }
.ev-bad::before { background: var(--bad); }
.ev-neutral::before { background: var(--blue-600); }

/* systems */
.sys-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.sys-card { display: grid; gap: 16px; padding: 18px 20px; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); color: var(--ink); }
.sys-card:hover { text-decoration: none; border-color: var(--blue-600); }
.sys-card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.sys-name { font-family: var(--font-head); font-size: 20px; font-weight: 600; color: var(--navy-900); line-height: 1.2; }
.sys-meters { display: grid; gap: 8px; }
.mini-meter { display: grid; grid-template-columns: 52px 1fr 40px; align-items: center; gap: 10px; font-size: 12.5px; color: var(--ink-2); }
.mini-meter strong { font-family: var(--font-mono); font-weight: 400; text-align: right; }
.mini-meter.is-warn .meter-bar span { background: #C77700; }
.mini-meter.is-crit .meter-bar span { background: var(--bad); }
.sys-facts { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; margin: 0; padding-top: 12px; border-top: 1px solid var(--line-2); font-size: 12.5px; }
.sys-facts dt { color: var(--muted); }
.sys-facts dd { margin: 0; text-align: right; }
.sys-wait { margin: 0; }
.soon { display: flex; gap: 20px; align-items: flex-start; padding: 32px; }
.soon-ico { flex: none; display: grid; place-items: center; width: 52px; height: 52px; border-radius: 50%; border: 1.5px solid var(--blue-600); color: var(--blue-600); }
.soon-ico .ico { width: 24px; height: 24px; }
.soon-discord { border-color: #5865F2; color: #5865F2; }
.soon h2 { font-family: var(--font-head); font-weight: 600; font-size: 24px; margin-bottom: 6px; }
.soon p { margin: 0; max-width: 620px; }
.soon-tag { display: inline-block; margin-bottom: 8px; font-size: 11px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--blue-600); }
.callout { border-left: 3px solid var(--blue-600); }
.callout p:first-child { margin-top: 0; }
.cmd { display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: var(--navy-950); border-radius: var(--radius); }
.cmd code { flex: 1; font-family: var(--font-mono); font-size: 12.5px; color: #E6ECF7; word-break: break-all; }
.uninstall code { font-family: var(--font-mono); font-size: 12px; word-break: break-all; }
.inline-form { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; align-items: end; padding-bottom: 8px; }
.update-note { display: inline-block; margin-left: 10px; vertical-align: top; }
.update-note summary { cursor: pointer; font-size: 12px; font-weight: 600; color: var(--warn); list-style: none; }
.update-note summary::-webkit-details-marker { display: none; }
.update-note summary::before { content: "▸ "; }
.update-note[open] { display: block; margin: 8px 0 0; }
.update-note[open] summary::before { content: "▾ "; }
.update-note p { margin: 6px 0; }
.danger-zone { margin-top: 0; padding-top: 6px; padding-bottom: 0; }

/* charts */
.charts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; }
.chart { margin: 0; padding: 16px 20px 12px; border-right: 1px solid var(--line-2); min-width: 0; }
.chart:last-child { border-right: 0; }
.chart figcaption { display: flex; justify-content: space-between; font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2); margin-bottom: 6px; }
.c-now { font-family: var(--font-mono); font-size: 13px; letter-spacing: 0; color: var(--navy-900); }
.chart-plot { position: relative; height: 150px; }
.chart-plot svg { display: block; overflow: visible; }
.c-grid { stroke: var(--line-2); stroke-width: 1; }
.c-base { stroke: var(--line); stroke-width: 1; }
.c-tick { font: 10.5px var(--font-mono); fill: var(--muted); }
.c-line { fill: none; stroke: var(--blue-600); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.c-cross { stroke: var(--ink-2); stroke-width: 1; stroke-dasharray: 3 3; }
.c-dot { fill: var(--blue-600); stroke: #fff; stroke-width: 2; }
.c-tip { position: absolute; pointer-events: none; display: flex; gap: 8px; align-items: baseline; padding: 5px 9px; white-space: nowrap;
  background: var(--navy-950); color: #fff; border-radius: 3px; font-size: 12px; box-shadow: 0 2px 8px rgba(7, 22, 49, .25); }
.c-tip-t { font-family: var(--font-mono); opacity: .7; }

/* location autocomplete */
.place-field { position: relative; }
.field-static { display: flex; align-items: center; gap: 8px; height: 38px; }
.steps-inline { display: flex; flex-wrap: wrap; gap: 6px 28px; margin: 0 0 4px; padding-left: 18px; color: var(--muted); font-size: 13px; }
.steps-inline strong { color: var(--navy-900); }
.place-field > label > span { font-size: 12px; font-weight: 600; color: var(--ink-2); }
.place-list { position: absolute; z-index: 20; top: 64px; left: 0; right: 0; margin: 0; padding: 4px 0; list-style: none;
  background: #fff; border: 1px solid #C9D0DB; border-radius: var(--radius); box-shadow: 0 6px 18px rgba(11, 31, 68, .14); max-height: 260px; overflow-y: auto; }
.place-list li { padding: 8px 12px; cursor: pointer; font-size: 13.5px; }
.place-list li.is-active, .place-list li:hover { background: var(--blue-tint); color: var(--navy-900); }
.place-list li.place-empty { color: var(--muted); cursor: default; background: none; }
.place-hint { margin-top: 2px; }
.place-ok { color: var(--ok); }
.place-warn { color: var(--warn); }

/* discord */
.guilds { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; margin-bottom: 20px; }
.guild { display: flex; align-items: center; gap: 14px; padding: 16px 18px; background: var(--white); border: 1px solid var(--line); border-left: 3px solid #5865F2; border-radius: var(--radius); }
.guild img, .guild-ph { width: 44px; height: 44px; border-radius: 50%; flex: none; }
.guild-ph { display: grid; place-items: center; background: #5865F2; color: #fff; font-weight: 700; font-size: 18px; }
.guild-name { font-family: var(--font-head); font-size: 19px; font-weight: 600; color: var(--navy-900); }
.channel { font-weight: 500; color: #4752C4; }
.guild-panel { border-top: 3px solid #5865F2; }
.guild-panel td:first-child { min-width: 140px; }
.guild-panel .srv-ok, .guild-panel .srv-bad { white-space: normal; }
.guild-panel td[data-st$=":proc"] { min-width: 170px; max-width: 240px; }
.guild-panel .pill-note { min-width: 110px; }
.log-out { width: 0; min-width: 100%; }
.log-out pre { width: 100%; box-sizing: border-box; }
.guild-head { display: flex; align-items: center; gap: 14px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.guild-head img { width: 44px; height: 44px; border-radius: 50%; }
.guild-ph .ico { width: 24px; height: 24px; }
.filters.pick-filters { grid-template-columns: minmax(180px, 260px) minmax(0, 1fr); }
.pick-col { width: 44px; }
.pick-table input[type=checkbox] { width: 17px; height: 17px; accent-color: var(--blue-600); cursor: pointer; }
.pick-table label { cursor: pointer; }
.pick-table tr.is-system td { opacity: .7; }
.pick-table .tag { margin-left: 8px; }
.pick-name { height: 32px !important; max-width: 220px; }
.pick-name:disabled { background: var(--bg); color: var(--muted); }
.pick-foot { align-items: end; margin-bottom: 4px; }
.timeline { display: grid; grid-template-columns: repeat(var(--slots, 96), 1fr); gap: 1px; width: 150px; height: 18px; }
.timeline span { border-radius: 1px; }
.tl-up { background: var(--ok); }
.tl-down { background: var(--bad); }
.tl-none { background: var(--line-2); }
.tl-missed { background: repeating-linear-gradient(135deg, var(--bad) 0 2px, #f6c9cb 2px 4px); }
.timeline-hourly { gap: 2px; }
.sub-row td { padding-top: 0 !important; border-bottom: 1px solid var(--line-2); }
.table tbody tr:has(+ .sub-row) td { border-bottom: 0; }
.log-out summary { cursor: pointer; font-size: 12.5px; color: var(--ink-2); }
.log-out pre { margin: 8px 0 4px; max-height: 260px; overflow: auto; padding: 10px 12px; background: var(--navy-950); color: #E6ECF7;
  font: 12px/1.45 var(--font-mono); border-radius: var(--radius); white-space: pre-wrap; word-break: break-word; }
.tl-axis { display: flex; justify-content: space-between; width: 150px; margin-top: 2px; font: 10px var(--font-mono); color: var(--muted); }
.form-section { margin: 8px 0 -4px; font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-2); }
.every { display: grid; grid-template-columns: 100px 1fr; gap: 8px; }
.token-form { grid-template-columns: minmax(0, 1fr) auto; max-width: 620px; padding: 0; }
.token-remove { margin-top: 10px; }
.delete-zone { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line-2); }

/* map */
.map-panel { overflow: hidden; }
.map { height: 420px; background: #EEF0F3; z-index: 0; }
.map-pin { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: #fff; border: 3px solid var(--blue-600);
  font: 700 13px var(--font); color: var(--navy-900); box-shadow: 0 2px 6px rgba(11, 31, 68, .25); }
.map-pin.pin-up { border-color: var(--ok); }
.map-pin.pin-down { border-color: var(--bad); color: var(--bad); }
.map-pin.pin-wait { border-color: #9AA5B5; }
.leaflet-popup-content-wrapper { border-radius: var(--radius); box-shadow: 0 4px 16px rgba(11, 31, 68, .18); }
.leaflet-popup-content { margin: 12px 14px; font: 13px/1.4 var(--font); min-width: 220px; }
.leaflet-container { font-family: var(--font); }
.leaflet-container a.leaflet-popup-close-button { top: 6px; right: 6px; }
.map-pop-title { font-size: 11px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; padding-right: 16px; }
.map-pop-row { display: flex; gap: 10px; align-items: flex-start; padding: 7px 0; border-top: 1px solid var(--line-2); color: var(--ink) !important; }
.map-pop-row:hover { text-decoration: none; background: #FAFBFC; }
.map-pop-text { display: grid; }
.map-pop-addr { font-size: 12px; color: var(--muted); }
.map-dot { flex: none; width: 8px; height: 8px; margin-top: 6px; border-radius: 50%; background: #9AA5B5; }
.map-dot.dot-up { background: var(--ok); }
.map-dot.dot-down { background: var(--bad); }

/* meters */
.meters { display: grid; gap: 18px; }
.meter-head { display: flex; justify-content: space-between; font-size: 13px; font-weight: 500; margin-bottom: 6px; }
.meter-head strong { font-family: var(--font-mono); font-weight: 400; }
.meter-bar { height: 6px; background: var(--line-2); border-radius: 1px; overflow: hidden; }
.meter-bar span { display: block; height: 100%; width: var(--w); background: var(--blue-600); transition: width .4s; }
.meter.is-warn .meter-bar span { background: #C77700; }
.meter.is-crit .meter-bar span { background: var(--bad); }
.meter-detail { margin-top: 5px; font-size: 12px; color: var(--muted); }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; margin: 0; font-size: 13px; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; }
.facts-table { padding: 8px 20px 10px; gap: 0; column-gap: 28px; grid-template-columns: minmax(130px, max-content) 1fr; }
.facts-table dt, .facts-table dd { padding: 9px 0; border-bottom: 1px solid var(--line-2); }
.facts-table dt:nth-last-of-type(1), .facts-table dd:last-of-type { border-bottom: 0; }

/* buttons & forms */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 36px; padding: 0 14px;
  font: 600 13px var(--font); color: var(--navy-900); background: var(--white); border: 1px solid #C9D0DB;
  border-radius: var(--radius); cursor: pointer; white-space: nowrap;
}
.btn:hover { text-decoration: none; border-color: var(--navy-900); }
.btn .ico { width: 16px; height: 16px; }
.btn-primary { background: var(--blue-600); border-color: var(--blue-600); color: #fff; }
.btn-primary:hover { background: var(--blue-700); border-color: var(--blue-700); }
.btn-danger { color: var(--bad); }
.btn-danger:hover { border-color: var(--bad); background: var(--bad-bg); }
.btn-sm { height: 30px; padding: 0 10px; font-size: 12.5px; }
.btn-block { width: 100%; height: 42px; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 8px; }
.btn.is-busy .ico { animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.form { display: grid; gap: 16px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 20px; }
.field { display: grid; gap: 6px; }
.field > span { font-size: 12px; font-weight: 600; color: var(--ink-2); }
.field-wide { grid-column: 1 / -1; }
input:not([type=hidden]), select, textarea {
  width: 100%; height: 38px; padding: 0 11px; font: inherit; color: var(--ink);
  background: var(--white); border: 1px solid #C9D0DB; border-radius: var(--radius);
}
textarea { height: auto; padding: 9px 11px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--blue-600); box-shadow: 0 0 0 3px rgba(29, 78, 216, .15); }
.code-input { font-family: var(--font-mono); font-size: 18px; letter-spacing: .3em; }

.flashes { display: grid; gap: 8px; margin-bottom: 20px; }
.flash { padding: 10px 14px; border-left: 3px solid var(--blue-600); background: var(--white); border-radius: 0 var(--radius) var(--radius) 0; font-size: 13.5px; box-shadow: inset 0 0 0 1px var(--line); }
.flash-success { border-left-color: var(--ok); }
.flash-error { border-left-color: var(--bad); background: var(--bad-bg); box-shadow: none; }
.flash-warning { border-left-color: #C77700; background: var(--warn-bg); box-shadow: none; }

.empty-state { padding: 40px 20px; text-align: center; color: var(--muted); }
.empty-state .btn-row { justify-content: center; }
.pager { display: flex; align-items: center; justify-content: center; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.pages { display: flex; gap: 4px; }
.page { display: inline-grid; place-items: center; min-width: 32px; height: 30px; padding: 0 6px; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--white); font: 600 12.5px var(--font); color: var(--ink-2); }
.page:hover { text-decoration: none; border-color: var(--navy-900); }
.page.is-current { background: var(--blue-600); border-color: var(--blue-600); color: #fff; }
.gap { display: inline-grid; place-items: center; width: 20px; color: var(--muted); }
.btn.is-disabled { opacity: .45; pointer-events: none; }
.center { text-align: center; }
.filters { display: grid; grid-template-columns: repeat(5, minmax(120px, 1fr)) minmax(180px, 1.6fr) auto; align-items: end; gap: 12px;
  padding: 14px 16px; margin-bottom: 16px; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); }
.filters input, .filters select { height: 36px; min-width: 0; }
.filter-actions { display: flex; gap: 8px; }
.log-panel { max-height: calc(100vh - 290px); min-height: 320px; overflow-y: auto; }
.log-panel .table thead th { position: sticky; top: 0; z-index: 1; }
.steps { margin: 0 0 18px; padding-left: 18px; color: var(--ink-2); }
.steps li { margin-bottom: 4px; }
.totp-setup { display: grid; grid-template-columns: 168px 1fr; gap: 20px; align-items: start; }
.qr { border: 1px solid var(--line); padding: 4px; background: #fff; }
.qr svg { display: block; width: 100%; height: auto; }
.secret { display: block; margin: 4px 0 16px; padding: 8px 10px; font-family: var(--font-mono); font-size: 12px; word-break: break-all; background: var(--bg); border: 1px solid var(--line); }

/* ------------------------------------------------------------------ login */
.auth { display: grid; grid-template-columns: minmax(360px, 44%) 1fr; min-height: 100vh; background: var(--white); }
.auth-side { display: flex; flex-direction: column; padding: 40px 48px; color: #fff; background: var(--navy-900); position: relative; overflow: hidden; }
.auth-side::after { content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px);
  background-size: 40px 40px; }
.auth-side > * { position: relative; z-index: 1; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand-name { font-family: var(--font-head); font-weight: 700; font-size: 20px; letter-spacing: .14em; line-height: 1.1; }
.brand-sub { font-size: 11px; letter-spacing: .22em; text-transform: uppercase; opacity: .65; }
.auth-pitch { margin: auto 0; max-width: 440px; }
.auth-pitch h1 { color: #fff; font-family: var(--font-head); font-weight: 600; font-size: 34px; line-height: 1.15; margin-bottom: 28px; }
.auth-pitch ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.auth-pitch li { display: flex; align-items: center; gap: 12px; color: rgba(255,255,255,.82); }
.auth-pitch li .ico { width: 20px; height: 20px; color: #fff; padding: 0; }
.auth-foot { font-size: 12px; opacity: .5; }
.auth-main { display: grid; place-items: center; padding: 40px 24px; }
.auth-card { width: 100%; max-width: 380px; display: grid; gap: 16px; }
.auth-card h2 { font-family: var(--font-head); font-weight: 600; font-size: 30px; }
.auth-card .muted { margin: -10px 0 4px; }
.auth-card .flash { margin: 0; }

.error-page { display: grid; place-items: center; min-height: 100vh; }
.error-box { text-align: center; max-width: 420px; padding: 24px; }
.error-code { font-family: var(--font-head); font-size: 72px; font-weight: 700; color: var(--blue-600); line-height: 1; }
.error-box h1 { font-family: var(--font-head); font-weight: 600; font-size: 26px; margin: 8px 0 12px; }
.error-box .btn { margin-top: 12px; }

.scrim { display: none; }

/* ------------------------------------------------------------------ responsive */
@media (max-width: 1100px) {
  .filters { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .filters .field-grow { grid-column: span 2; }
  .grid-2, .grid-dash { grid-template-columns: 1fr; }
  .charts { grid-template-columns: 1fr; }
  .chart { border-right: 0; border-bottom: 1px solid var(--line-2); }
  .map { height: 340px; }
}
@media (max-width: 860px) {
  .collapse-btn { display: none; }
  .sidebar { transform: translateX(-100%); width: var(--side-w) !important; box-shadow: 0 0 24px rgba(7, 22, 49, .2); }
  .side-open .sidebar { transform: none; }
  .side-open .scrim { display: block; position: fixed; inset: var(--top-h) 0 0 0; z-index: 15; background: rgba(7, 22, 49, .35); }
  .main, .side-collapsed .main { margin-left: 0; }
  .side-collapsed .nav-text, .side-collapsed .nav-chev, .side-collapsed .nav-label { display: revert; }
  .side-collapsed .nav-group.open .nav-sub { display: block; }
  .side-collapsed .nav-group:not(.open) .nav-sub { display: none; }
  .side-collapsed .nav-item { padding: 5px 14px 5px 20px; justify-content: flex-start; }
  .content { padding: 20px 16px 40px; }
  .clock, .who { display: none; }
  .topbar { gap: 8px; padding: 0 12px 0 8px; }
  .topbar-right { gap: 8px; }
  .wordmark { font-size: 17px; letter-spacing: .08em; }
  .wordmark .wm-sub { display: none; }
  .tag .tag-text { display: none; }
  .tag { padding: 5px 6px; }
  .refresh-pick { padding: 0 2px 0 8px; }
  .refresh-pick .ico { display: none; }
  .form-grid { grid-template-columns: 1fr; }
  .auth { grid-template-columns: 1fr; }
  .auth-side { padding: 24px; }
  .auth-pitch, .auth-foot { display: none; }
  .totp-setup { grid-template-columns: 1fr; }
  .qr { max-width: 200px; }
  .page-head { flex-wrap: wrap; }
  .sys-grid { grid-template-columns: 1fr; }
  .inline-form { grid-template-columns: 1fr; }
  .filters { grid-template-columns: 1fr 1fr; }
  .filters .field-grow, .filter-actions { grid-column: 1 / -1; }
  .soon { padding: 20px; flex-direction: column; }
  .cmd { flex-direction: column; align-items: stretch; }
}
