:root {
  --bg: #0d131b;
  --panel: #131a24;
  --panel-2: #18212d;
  --line: #243041;
  --line-2: #2e3b4f;
  --text: #edf1f6;
  --muted: #8b97a9;
  --dim: #5d6a7d;
  --teal: #3ed6c3;
  --orange: #f2895b;
  --purple: #a48dff;
  --amber: #e4bf6a;
  --up: #3fd68a;
  --warn: #f2b84b;
  --down: #ff5f6d;
  --unknown: #5d6a7d;
  --sans: "Inter", "SF Pro Display", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --mono: "JetBrains Mono", "SF Mono", ui-monospace, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--sans); }
body { -webkit-font-smoothing: antialiased; }
.mono { font-family: var(--mono); }

.poster { max-width: 1480px; margin: 0 auto; padding: 40px 56px 28px; }

/* header */
.head { display: flex; justify-content: space-between; align-items: flex-end; gap: 32px; flex-wrap: wrap; margin-bottom: 36px; }
.eyebrow { display: flex; align-items: center; gap: 14px; font-size: 12px; letter-spacing: .14em; color: var(--muted); font-weight: 600; }
.rule { width: 38px; height: 3px; border-radius: 2px; background: var(--teal); }
h1 { font-size: clamp(44px, 6vw, 68px); line-height: 1; margin: 14px 0 0; font-weight: 800; letter-spacing: -.03em; }
.counters { display: flex; gap: 52px; flex-wrap: wrap; }
.counter { text-align: left; }
.counter b { display: block; font-size: 44px; font-weight: 600; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.counter b.accent { color: var(--teal); }
.counter b.alert { color: var(--down); }
.counter span { font-size: 11px; letter-spacing: .16em; color: var(--muted); font-weight: 600; text-transform: uppercase; }

/* panels */
.box { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; }

/* edge row */
.edge { display: grid; grid-template-columns: minmax(200px, 1fr) 36px minmax(220px, 1.1fr) 36px minmax(300px, 2.4fr); align-items: stretch; margin-bottom: 26px; }
.edge .arrow { align-self: center; height: 2px; background: var(--amber); position: relative; margin: 0 6px; }
.edge .arrow::after { content: ""; position: absolute; right: -2px; top: -4px; border: 5px solid transparent; border-left: 7px solid var(--amber); border-right: 0; }
.edge .box { padding: 16px 20px; display: flex; flex-direction: column; justify-content: center; gap: 6px; }
.edge .gw { border-color: var(--line-2); }
.isp-line { display: flex; align-items: center; gap: 10px; font-size: 17px; font-weight: 600; }
.isp-line.sub { font-size: 15px; font-weight: 400; color: var(--muted); }
.gw-name { font-size: 20px; font-weight: 600; }
.gw-sub { color: var(--muted); font-size: 14px; }
.badge-u { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: #1b5fd6; color: white; font-weight: 800; font-size: 15px; flex: none; }
.gw-row { display: flex; align-items: center; gap: 14px; }
.unifi-head { font-size: 11px; letter-spacing: .16em; color: var(--amber); font-weight: 700; }
.core { display: flex; gap: 28px; flex-wrap: wrap; }
.core div { min-width: 120px; }
.core b { display: block; font-size: 16px; font-weight: 600; }
.core small { font-size: 10px; letter-spacing: .14em; color: var(--dim); text-transform: uppercase; }
.fleet { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 6px; font-size: 12px; color: var(--muted); }
.fleet .pill { display: inline-flex; align-items: center; gap: 6px; }

/* vlan row */
.vlans { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-bottom: 30px; position: relative; }
.vlan { padding: 12px 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); display: flex; align-items: baseline; gap: 10px; font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; }
.vlan .vid { font-family: var(--mono); color: var(--muted); font-size: 13px; }
.vlan .n { overflow: hidden; text-overflow: ellipsis; }
.vlan .c { margin-left: auto; font-family: var(--mono); font-size: 11px; color: var(--dim); font-weight: 400; }
.vlan.s-bagskuret { border-color: color-mix(in srgb, var(--teal) 45%, var(--line)); }
.vlan.s-bagskuret .n { color: var(--teal); }
.vlan.s-vendel { border-color: color-mix(in srgb, var(--orange) 40%, var(--line)); }
.vlan.s-vendel .n { color: var(--orange); }
.vlan.empty { border-style: dashed; color: var(--muted); }

/* site sections */
.site { margin-bottom: 34px; }
.site-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; flex-wrap: wrap; border-top: 1px solid var(--line); padding-top: 22px; margin-bottom: 18px; }
.site-head h2 { margin: 0; font-size: 30px; font-weight: 800; letter-spacing: -.02em; display: flex; align-items: center; gap: 14px; }
.site-head h2 .bar { width: 4px; height: 26px; border-radius: 2px; background: var(--accent); }
.site-head .tag { font-size: 12px; letter-spacing: .14em; color: var(--muted); font-weight: 600; text-transform: uppercase; }
.site-stats { display: flex; gap: 26px; font-size: 13px; color: var(--muted); }
.site-stats b { color: var(--text); font-size: 18px; font-weight: 600; margin-right: 4px; font-variant-numeric: tabular-nums; }

.services { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.svc { display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); font-size: 13px; }
.svc small { color: var(--dim); font-size: 10px; letter-spacing: .12em; text-transform: uppercase; }

.hosts { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 18px; align-items: start; }
.host { padding: 20px 22px 22px; border-left: 3px solid var(--accent); position: relative; }
.host.st-down { border-left-color: var(--down); }
.host-top { display: flex; justify-content: space-between; gap: 12px; }
.kicker { font-size: 11px; letter-spacing: .16em; color: var(--accent); font-weight: 700; text-transform: uppercase; }
.host h3 { margin: 6px 0 4px; font-size: 30px; font-weight: 800; letter-spacing: -.02em; display: flex; align-items: center; gap: 10px; }
.hw { color: #c9d2de; font-size: 15px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.chip-vendor { font-weight: 800; font-size: 13px; padding: 1px 6px; border-radius: 3px; background: #f4f6f9; color: #0b63c5; letter-spacing: -.02em; }
.chip-vendor.amd { color: #111; }
.status { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; letter-spacing: .14em; font-weight: 700; text-transform: uppercase; white-space: nowrap; }
.dot { display: inline-block; vertical-align: middle; width: 8px; height: 8px; border-radius: 50%; background: var(--unknown); flex: none; }
.alerts { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; margin: -10px 0 26px; font-size: 12.5px; color: var(--muted); }
.alerts .lbl { font-size: 11px; letter-spacing: .14em; color: var(--down); font-weight: 700; text-transform: uppercase; margin-right: 4px; }
.alerts span.m { display: inline-flex; align-items: center; gap: 6px; padding: 4px 9px; border-radius: 6px; border: 1px solid color-mix(in srgb, var(--down) 35%, var(--line)); }
.dot.up { background: var(--up); box-shadow: 0 0 0 3px color-mix(in srgb, var(--up) 18%, transparent); }
.dot.warn { background: var(--warn); box-shadow: 0 0 0 3px color-mix(in srgb, var(--warn) 18%, transparent); }
.dot.down { background: var(--down); box-shadow: 0 0 0 3px color-mix(in srgb, var(--down) 22%, transparent); }
.status.up { color: var(--up); } .status.warn { color: var(--warn); } .status.down { color: var(--down); } .status.unknown { color: var(--dim); }

.spec { margin: 16px 0 6px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel-2); display: grid; grid-template-columns: 48px 1fr 44px; gap: 8px 12px; align-items: center; font-size: 13px; }
.spec .k { color: var(--accent); font-weight: 600; }
.spec .v { font-family: var(--mono); font-size: 12px; color: var(--muted); text-align: right; }
.meter { height: 6px; border-radius: 3px; background: #0f151d; overflow: hidden; }
.meter i { display: block; height: 100%; border-radius: 3px; background: var(--accent); }
.meter i.hot { background: var(--warn); } .meter i.crit { background: var(--down); }
.spec .na { grid-column: 1 / -1; color: var(--dim); font-size: 12px; }

.sub-head { display: flex; justify-content: space-between; align-items: center; margin: 16px 0 10px; font-size: 11px; letter-spacing: .16em; color: var(--accent); font-weight: 700; text-transform: uppercase; }
.sub-head span:last-child { color: var(--dim); letter-spacing: .08em; font-weight: 500; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 6px; }
.tile { border: 1px solid var(--line); border-radius: 8px; background: var(--panel-2); padding: 10px 6px 8px; text-align: center; font-size: 12.5px; position: relative; min-width: 0; }
.tile .ico { width: 30px; height: 30px; border-radius: 8px; margin: 0 auto 6px; display: grid; place-items: center; font-weight: 800; font-size: 13px; color: #0d131b; }
.tile .nm { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile .kd { position: absolute; top: 5px; left: 6px; font-family: var(--mono); font-size: 9px; color: var(--dim); }
.tile .dot { position: absolute; top: 7px; right: 7px; width: 6px; height: 6px; box-shadow: none; }
.tile.st-down { opacity: .45; }
.tile.st-down .ico { filter: grayscale(1); }
.svc-list { display: flex; flex-wrap: wrap; gap: 6px; }
.svc-list span { font-size: 12px; padding: 4px 9px; border-radius: 6px; border: 1px dashed var(--line-2); color: var(--muted); }
.host-foot { display: flex; gap: 16px; margin-top: 14px; font-size: 12px; color: var(--muted); flex-wrap: wrap; }
.host-foot b { color: var(--text); font-weight: 600; }
.host-foot .bad { color: var(--down); }

/* compact cards for non-hypervisor hosts */
.small-hosts { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; margin-top: 18px; }
.mini { padding: 14px 16px; border-left: 3px solid var(--accent); }
.mini .row { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.mini b { font-size: 17px; font-weight: 700; }
.mini p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.mini .meters { display: flex; gap: 10px; margin-top: 8px; font-family: var(--mono); font-size: 11px; color: var(--dim); }

.foot { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; border-top: 1px solid var(--line); padding-top: 18px; margin-top: 10px; font-size: 13px; color: var(--muted); }
.foot .mono { font-size: 12px; letter-spacing: .08em; }
#sources { display: flex; gap: 14px; flex-wrap: wrap; }
#sources span { display: inline-flex; align-items: center; gap: 6px; }
.stale-banner { margin-bottom: 18px; padding: 10px 14px; border-radius: 8px; border: 1px solid color-mix(in srgb, var(--warn) 50%, var(--line)); color: var(--warn); font-size: 13px; }

/* login */
.login-page { min-height: 100vh; display: grid; place-items: center; }
.login { width: min(400px, 100% - 32px); padding: 32px 0; }
.login h1 { margin-bottom: 28px; }
.login-form { padding: 24px; display: grid; gap: 8px; }
.login-form label { font-size: 11px; letter-spacing: .14em; color: var(--muted); font-weight: 700; text-transform: uppercase; margin-top: 6px; }
.login-form input { font: inherit; font-size: 16px; color: var(--text); background: var(--panel-2); border: 1px solid var(--line-2); border-radius: 8px; padding: 11px 12px; }
.login-form input:focus { outline: 2px solid var(--teal); outline-offset: 1px; border-color: transparent; }
.login-form button { margin-top: 14px; font: inherit; font-weight: 700; font-size: 15px; color: #0d131b; background: var(--teal); border: 0; border-radius: 8px; padding: 12px; cursor: pointer; }
.login-form button:hover { filter: brightness(1.08); }
.login-err { margin: 6px 0 0; color: var(--down); font-size: 13px; }
.login-note { margin: 0 0 4px; color: var(--muted); font-size: 13.5px; line-height: 1.45; }
.login-foot { margin-top: 18px; font-size: 11px; letter-spacing: .1em; color: var(--dim); }
.logout { display: inline; margin: 0; }
.logout button { font: inherit; font-size: 13px; color: var(--muted); background: none; border: 1px solid var(--line-2); border-radius: 6px; padding: 3px 10px; cursor: pointer; }
.logout button:hover { color: var(--text); }

@media (max-width: 980px) {
  .poster { padding: 28px 16px; }
  .edge { grid-template-columns: 1fr; gap: 10px; }
  .edge .arrow { width: 2px; height: 18px; justify-self: center; margin: 0; }
  .edge .arrow::after { right: -4px; top: auto; bottom: -2px; border: 5px solid transparent; border-top: 7px solid var(--amber); border-bottom: 0; }
  .counters { gap: 26px; }
  .counter b { font-size: 34px; }
  .hosts { grid-template-columns: 1fr; }
}
