:root {
  color-scheme: dark;
  --bg: #080b10;
  --panel: #11161e;
  --panel-2: #151c25;
  --line: #26303d;
  --text: #f5f7fa;
  --muted: #8995a5;
  --lime: #b9f53d;
  --lime-dark: #17250a;
  --danger: #ff6b72;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; color: var(--text); background: radial-gradient(circle at 80% 0%, #172315 0, transparent 28rem), var(--bg); }
button, input { font: inherit; }
button { border: 0; cursor: pointer; }
button:disabled { cursor: wait; opacity: .55; }
.dashboard-shell { width: min(1160px, calc(100% - 40px)); margin: 0 auto; padding: 34px 0 64px; }
.topbar { display: flex; justify-content: space-between; align-items: center; padding-bottom: 30px; border-bottom: 1px solid var(--line); }
h1, h2, h3, h4, p { margin-top: 0; }
h1 { margin-bottom: 0; letter-spacing: -.04em; font-size: 1.45rem; }
h2 { font-size: clamp(2.65rem, 6vw, 5.8rem); letter-spacing: -.065em; line-height: .95; margin: 22px 0; max-width: 760px; }
h2 em { color: var(--lime); font-style: normal; }
h3 { font-size: 1.5rem; margin-bottom: 0; letter-spacing: -.025em; }
h4 { margin: 0 0 5px; font-size: 1rem; }
.eyebrow { color: var(--lime); font-size: .69rem; font-weight: 800; letter-spacing: .2em; margin-bottom: 8px; }
.muted, .device-card p, .empty { color: var(--muted); }
.ghost, .danger-outline { color: var(--text); background: transparent; border: 1px solid var(--line); border-radius: 999px; padding: 11px 18px; }
.ghost:hover, .danger-outline:hover { border-color: #566476; }
.hero { display: grid; grid-template-columns: 1fr auto; gap: 28px; align-items: end; padding: 70px 0 42px; }
.status-dot { display: inline-block; width: 9px; height: 9px; margin-right: 10px; border-radius: 50%; background: var(--danger); box-shadow: 0 0 16px rgba(255,107,114,.55); }
.status-dot.online { background: var(--lime); box-shadow: 0 0 18px rgba(185,245,61,.6); }
#service-label { color: #c5ccd5; font-size: .88rem; }
.ip-card { min-width: 280px; padding: 24px; border: 1px solid #334127; background: linear-gradient(145deg, rgba(185,245,61,.11), rgba(185,245,61,.025)); border-radius: 18px; }
.ip-card span, .ip-card small { display: block; color: var(--muted); }
.ip-card strong { display: block; font: 700 1.45rem ui-monospace, SFMono-Regular, Menlo, monospace; margin: 10px 0; }
.metrics { display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; margin-bottom: 22px; background: rgba(17,22,30,.8); }
.metrics article { padding: 24px; border-right: 1px solid var(--line); }
.metrics article:last-child { border: 0; }
.metrics span { color: var(--muted); font-size: .8rem; }
.metrics strong { display: block; font-size: 2rem; margin-top: 10px; }
.panel { background: rgba(17,22,30,.91); border: 1px solid var(--line); border-radius: 18px; padding: 26px; margin-top: 22px; }
.section-head, .service-panel { display: flex; justify-content: space-between; align-items: center; gap: 20px; }
#add-device, dialog button[type="submit"], .login-card button[type="submit"] { color: #0b0f06; background: var(--lime); border-radius: 999px; padding: 12px 19px; font-weight: 800; }
.device-list { margin-top: 22px; border-top: 1px solid var(--line); }
.device-card { display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 24px; padding: 20px 4px; border-bottom: 1px solid var(--line); }
.device-card.disabled { opacity: .55; }
.device-identity { display: flex; gap: 14px; align-items: center; min-width: 0; }
.device-icon { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 13px; color: var(--lime); background: var(--lime-dark); font-size: 1.2rem; }
.device-card p { margin: 0; font-size: .8rem; }
.traffic { color: #bfc7d1; font: .78rem ui-monospace, SFMono-Regular, Menlo, monospace; }
.switch { position: relative; width: 44px; height: 25px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; inset: 0; border-radius: 999px; background: #303947; transition: .2s; }
.slider::before { content: ""; position: absolute; width: 19px; height: 19px; left: 3px; top: 3px; border-radius: 50%; background: #fff; transition: .2s; }
.switch input:checked + .slider { background: var(--lime); }
.switch input:checked + .slider::before { transform: translateX(19px); background: #0b0f06; }
.service-panel p:last-child { margin: 7px 0 0; }
.danger-outline { color: #ffb3b7; border-color: #5e3035; }
dialog { width: min(470px, calc(100% - 32px)); color: var(--text); background: var(--panel-2); border: 1px solid var(--line); border-radius: 20px; padding: 30px; box-shadow: 0 32px 100px rgba(0,0,0,.7); }
dialog::backdrop { background: rgba(2,5,8,.78); backdrop-filter: blur(5px); }
dialog form { position: relative; }
.dialog-close { position: absolute; top: -18px; right: -12px; color: var(--muted); background: transparent; font-size: 1.7rem; }
label { display: block; color: #c7ced7; font-size: .82rem; margin: 22px 0; }
input { width: 100%; color: var(--text); background: #0c1117; border: 1px solid var(--line); border-radius: 11px; padding: 13px 14px; margin-top: 8px; outline: none; }
input:focus { border-color: var(--lime); box-shadow: 0 0 0 3px rgba(185,245,61,.12); }
.alert { color: #ffb3b7; background: #2a1317; border: 1px solid #673038; border-radius: 10px; padding: 11px 13px; }
.hidden { display: none; }
.toast { position: fixed; right: 24px; bottom: 24px; max-width: min(420px, calc(100% - 48px)); padding: 14px 18px; color: #0b0f06; background: var(--lime); border-radius: 12px; font-weight: 700; opacity: 0; transform: translateY(12px); pointer-events: none; transition: .2s; }
.toast.visible { opacity: 1; transform: none; }
.toast.error { color: #fff; background: #b4333b; }
.login-shell { display: grid; place-items: center; padding: 24px; }
.login-card { width: min(430px, 100%); padding: 38px; border: 1px solid var(--line); border-radius: 22px; background: rgba(17,22,30,.94); box-shadow: 0 30px 90px rgba(0,0,0,.45); }
.brand-mark { display: grid; place-items: center; width: 48px; height: 48px; margin-bottom: 28px; color: #0b0f06; background: var(--lime); border-radius: 14px; font-weight: 900; font-size: 1.4rem; }
.login-card h1 { font-size: 2rem; margin-bottom: 9px; }
.login-card form { margin-top: 30px; }
.login-card button[type="submit"] { width: 100%; margin-top: 3px; }
.secure-note { color: #697484; text-align: center; font-size: .72rem; margin: 24px 0 0; }
@media (max-width: 760px) {
  .dashboard-shell { width: min(100% - 24px, 1160px); padding-top: 22px; }
  .hero { grid-template-columns: 1fr; padding-top: 44px; }
  .ip-card { min-width: 0; }
  .metrics { grid-template-columns: 1fr; }
  .metrics article { border-right: 0; border-bottom: 1px solid var(--line); }
  .device-card { grid-template-columns: 1fr auto; }
  .traffic { grid-column: 1 / -1; padding-left: 56px; }
  .service-panel { align-items: flex-start; flex-direction: column; }
  h2 { font-size: 3.3rem; }
}
