:root {
  color-scheme: dark;
  --bg: #0b0e13;
  --panel: #121720;
  --line: #252c38;
  --muted: #8d98aa;
  --text: #edf2f7;
  --accent: #70e1b1;
  --accent-dark: #163d31;
  --danger: #ff7a90;
  --warning: #f2c66d;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.5 Inter, ui-sans-serif, system-ui, sans-serif; }
button, input { font: inherit; }
button { border: 0; border-radius: 8px; padding: 10px 15px; background: var(--accent); color: #07130e; font-weight: 700; cursor: pointer; }
button:hover { filter: brightness(1.08); }
button.secondary { background: #202734; color: var(--text); }
button.ghost { background: transparent; color: var(--muted); }
header { height: 68px; padding: 0 4vw; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 24px; }
header > div, .header-actions { display: flex; align-items: center; gap: 10px; }
.brand-mark { width: 48px; height: 48px; border-radius: 13px; display: grid; place-items: center; background: var(--accent); color: #07130e; font-weight: 900; letter-spacing: -.08em; margin: 0 auto 18px; }
.brand-mark.small { width: 34px; height: 34px; border-radius: 9px; margin: 0 5px 0 0; font-size: 12px; }
main { max-width: 1440px; margin: auto; padding: 42px 4vw 70px; }
.hero { display: flex; justify-content: space-between; align-items: end; margin-bottom: 42px; }
h1 { font-size: clamp(30px, 4vw, 50px); letter-spacing: -.045em; margin: 2px 0 6px; }
h2 { font-size: 18px; margin: 0 0 14px; }
.eyebrow { color: var(--accent); font-size: 11px; font-weight: 800; letter-spacing: .16em; margin: 0; }
.hero p, .section-title span { color: var(--muted); }
section { margin-bottom: 38px; }
.metrics { display: grid; grid-template-columns: repeat(6, minmax(120px, 1fr)); gap: 10px; }
.metric { padding: 17px; border: 1px solid var(--line); border-radius: 11px; background: var(--panel); }
.metric span { display: block; color: var(--muted); font-size: 12px; margin-bottom: 7px; }
.metric strong { font-size: 20px; }
.section-title { display: flex; align-items: baseline; justify-content: space-between; }
.table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
table { width: 100%; border-collapse: collapse; white-space: nowrap; }
th { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .08em; text-align: left; }
th, td { padding: 15px 17px; border-bottom: 1px solid var(--line); }
tbody tr:last-child td { border-bottom: 0; }
.primary { display: block; font-weight: 700; }
.secondary-text { color: var(--muted); font-size: 12px; }
.pill { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 4px 9px; background: var(--accent-dark); color: var(--accent); font-size: 11px; font-weight: 800; }
.pill.offline { background: #352027; color: var(--danger); }
.pill.warning { background: #352f20; color: var(--warning); }
.actions { display: flex; gap: 5px; justify-content: end; }
.actions button, .actions a { border: 1px solid var(--line); background: transparent; color: var(--muted); border-radius: 7px; padding: 6px 9px; text-decoration: none; font-size: 12px; }
.empty { text-align: center; color: var(--muted); padding: 38px; }
.login-page { min-height: 100vh; display: grid; place-items: center; background: radial-gradient(circle at 50% 20%, #183329, var(--bg) 42%); }
.login-card { width: min(390px, calc(100vw - 32px)); padding: 34px; background: rgba(18,23,32,.96); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 25px 80px #0008; }
.login-card h1 { font-size: 28px; text-align: center; }
.login-card > p { color: var(--muted); text-align: center; margin-bottom: 26px; }
label { display: block; color: var(--muted); font-size: 12px; margin: 13px 0; }
input { width: 100%; margin-top: 6px; border: 1px solid var(--line); border-radius: 8px; padding: 11px; background: #0c1118; color: var(--text); outline: none; }
input:focus { border-color: var(--accent); }
form > button[type=submit] { width: 100%; margin-top: 12px; }
dialog { width: min(500px, calc(100vw - 30px)); background: var(--panel); color: var(--text); border: 1px solid var(--line); border-radius: 14px; padding: 24px; }
dialog::backdrop { background: #000a; backdrop-filter: blur(4px); }
.dialog-title { display: flex; justify-content: space-between; align-items: center; }
.dialog-title h2 { margin: 0; }
.dialog-title button { font-size: 24px; padding: 0 5px; }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.check { display: flex; align-items: center; gap: 8px; }
.check input { width: auto; margin: 0; }
.error { color: var(--danger); min-height: 20px; }
#toast { position: fixed; right: 22px; bottom: 22px; padding: 12px 16px; border-radius: 9px; background: var(--text); color: var(--bg); opacity: 0; transform: translateY(10px); transition: .2s; pointer-events: none; }
#toast.show { opacity: 1; transform: none; }
@media (max-width: 1000px) {
  .metrics { grid-template-columns: repeat(3, 1fr); }
  header { height: auto; padding-top: 12px; padding-bottom: 12px; align-items: flex-start; }
  .header-actions { flex-wrap: wrap; justify-content: end; }
}
@media (max-width: 650px) {
  .metrics { grid-template-columns: repeat(2, 1fr); }
  header .secondary { display: none; }
  .hero { align-items: flex-start; gap: 20px; }
  .hero h1 { font-size: 32px; }
}
