:root {
  color-scheme: dark;
  --bg: #07100f;
  --panel: rgba(17, 31, 29, .82);
  --line: rgba(185, 222, 211, .14);
  --text: #eef9f5;
  --muted: #8ba59e;
  --mint: #70f0c3;
  --cyan: #63c8ff;
  --orange: #ffb45e;
  --red: #ff7b76;
}
[hidden] { display: none !important; }
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; color: var(--text); font: 14px/1.45 ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; background: radial-gradient(circle at 15% -10%, #173e35 0, transparent 35%), radial-gradient(circle at 90% 0, #112e40 0, transparent 30%), var(--bg); }
body::before { content: ""; position: fixed; inset: 0; pointer-events: none; opacity: .22; background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px); background-size: 32px 32px; mask-image: linear-gradient(to bottom, black, transparent 72%); }
header, main { position: relative; z-index: 1; max-width: 1420px; margin: auto; }
header { display: flex; justify-content: space-between; align-items: flex-end; padding: 36px 30px 18px; }
h1, h2, p { margin: 0; }
h1 { font-size: clamp(28px, 4vw, 44px); letter-spacing: -.04em; }
h2 { font-size: 18px; }
.eyebrow, .section-title p, .device-card .card-title p { color: var(--mint); font-size: 11px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; }
.connection { display: flex; align-items: center; gap: 9px; color: var(--muted); }
#status-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--orange); box-shadow: 0 0 14px currentColor; }
#status-dot.online { color: var(--mint); background: var(--mint); }
#status-dot.offline { color: var(--red); background: var(--red); }
main { padding: 0 30px 48px; }
.panel { border: 1px solid var(--line); background: var(--panel); box-shadow: 0 16px 60px rgba(0,0,0,.24); backdrop-filter: blur(14px); border-radius: 18px; }
.toolbar { padding: 12px 16px; margin-bottom: 16px; display: flex; align-items: center; gap: 10px; color: var(--muted); }
.toolbar label { display: flex; align-items: center; gap: 9px; }
input { width: 240px; border: 1px solid var(--line); border-radius: 9px; color: var(--text); background: #081411; padding: 9px 11px; outline: none; }
input:focus { border-color: var(--mint); }
button { border: 0; border-radius: 9px; color: #042018; background: var(--mint); padding: 9px 14px; font-weight: 750; cursor: pointer; }
#server-time { margin-left: auto; }
.device-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 16px; }
.device-card { padding: 22px; overflow: hidden; position: relative; }
.device-card::after { content: ""; position: absolute; width: 200px; height: 200px; right: -90px; top: -110px; background: var(--mint); filter: blur(70px); opacity: .12; }
.card-title, .section-title { display: flex; justify-content: space-between; align-items: center; gap: 18px; }
.card-title h2 { margin-top: 4px; }
.badge { border: 1px solid currentColor; border-radius: 99px; padding: 5px 9px; font-size: 11px; color: var(--mint); }
.badge.idle { color: var(--muted); }
.badge.bad { color: var(--red); }
.vitals { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 28px 0 24px; }
.vitals div { display: flex; flex-direction: column; }
.vitals strong { font-size: clamp(34px, 5vw, 64px); font-variant-numeric: tabular-nums; line-height: 1; letter-spacing: -.055em; }
.vitals div:first-child strong { color: var(--mint); }
.vitals span, dt { color: var(--muted); font-size: 12px; }
dl { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 0; border-top: 1px solid var(--line); padding-top: 15px; }
dl div { display: flex; flex-direction: column; gap: 2px; }
dd { margin: 0; font-variant-numeric: tabular-nums; }
.chart-panel { margin-top: 16px; padding: 20px 22px; }
.section-title { margin-bottom: 16px; }
.section-title h2 { margin-top: 3px; }
.section-title > span { color: var(--muted); }
.legend { display: flex; gap: 18px; color: var(--muted); }
.legend span::before { content: ""; display: inline-block; width: 18px; height: 3px; margin-right: 7px; vertical-align: middle; border-radius: 3px; background: var(--mint); }
.legend .pulse::before { background: var(--cyan); }
canvas { width: 100%; display: block; }
.lower-grid { display: grid; grid-template-columns: 1.3fr .7fr; gap: 16px; margin-top: 16px; }
.lower-grid article { padding: 20px 22px; min-width: 0; }
.table-wrap { overflow: auto; max-height: 300px; }
table { width: 100%; border-collapse: collapse; font-size: 12px; }
th { color: var(--muted); text-align: left; font-weight: 500; position: sticky; top: 0; background: #10201d; }
th, td { padding: 9px 7px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td:last-child { max-width: 270px; overflow: hidden; text-overflow: ellipsis; color: #a8c6bd; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.logs { list-style: none; padding: 0; margin: 0; max-height: 300px; overflow: auto; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }
.logs li { border-bottom: 1px solid var(--line); padding: 8px 0; overflow-wrap: anywhere; }
.logs time { color: var(--muted); margin-right: 8px; }
.logs .error, .logs .warn { color: var(--orange); }
.logs .error { color: var(--red); }
.empty { color: var(--muted); text-align: center; padding: 22px !important; }
button.quiet { color: var(--muted); background: transparent; border: 1px solid var(--line); padding: 6px 9px; }
.scan-control { margin: 16px 0; padding: 20px 22px; }
.scan-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.scan-actions label { display: flex; align-items: center; gap: 9px; color: var(--muted); }
.target-button { color: var(--text); background: #10201d; border: 1px solid var(--line); }
.target-button.selected { color: #042018; background: var(--mint); border-color: var(--mint); }
.target-button:disabled { cursor: wait; opacity: .55; }
.control-note { margin-top: 12px; color: var(--muted); font-size: 12px; }
@media (max-width: 900px) { .device-grid, .lower-grid { grid-template-columns: 1fr; } .vitals strong { font-size: 44px; } }
@media (max-width: 600px) { header, main { padding-left: 14px; padding-right: 14px; } header { align-items: flex-start; gap: 20px; } .toolbar { flex-wrap: wrap; } .toolbar label { width: 100%; } input { width: 100%; flex: 1; } #server-time { margin-left: 0; } .vitals { gap: 4px; } .vitals strong { font-size: 36px; } }
