:root {
  color-scheme: light;
  --ink: #17212b;
  --muted: #647483;
  --navy: #15324b;
  --blue: #176b87;
  --pale: #eef4f6;
  --line: #d8e1e5;
  --white: #ffffff;
  --danger: #a33b3b;
  font-family: "Segoe UI", system-ui, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: #f5f7f8; color: var(--ink); }
a { color: var(--blue); }
.topbar { background: var(--navy); color: white; padding: 18px max(18px, calc((100vw - 980px) / 2)); display: flex; justify-content: space-between; align-items: center; }
.brand { color: white; text-decoration: none; font-size: 1.15rem; font-weight: 700; }
.user { color: #dbe8ef; }
.nav { background: white; border-bottom: 1px solid var(--line); display: flex; gap: 8px; overflow-x: auto; padding: 0 max(12px, calc((100vw - 980px) / 2)); }
.nav a { color: var(--ink); text-decoration: none; padding: 14px 12px; font-weight: 600; }
.nav a:hover { color: var(--blue); }
.container { max-width: 980px; margin: 0 auto; padding: 26px 18px 48px; }
.page-heading, .panel-heading { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
h1 { margin: 0 0 20px; font-size: clamp(2rem, 8vw, 3rem); letter-spacing: -0.04em; }
h2 { margin-top: 0; font-size: 1.15rem; }
.eyebrow { margin: 0 0 6px; color: var(--blue); font-size: .78rem; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
.metric-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 16px; }
.metric, .panel, .login-card { background: white; border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 8px 24px rgba(21,50,75,.05); }
.metric { padding: 20px; }
.metric.hero { background: var(--navy); color: white; border-color: var(--navy); }
.metric span { display: block; color: var(--muted); font-size: .82rem; margin-bottom: 8px; }
.metric.hero span { color: #bed3df; }
.metric strong { font-size: clamp(1.3rem, 4vw, 2rem); }
.panel { padding: 20px; margin: 16px 0; }
.button-row { display: flex; gap: 10px; flex-wrap: wrap; }
button, input, select { font: inherit; }
button { border: 1px solid #b9c9d1; border-radius: 9px; padding: 11px 16px; background: white; color: var(--ink); font-weight: 700; cursor: pointer; }
button:hover { border-color: var(--blue); }
button.primary, .primary { background: var(--blue); color: white; border-color: var(--blue); }
button.danger { color: var(--danger); border-color: #ddbcbc; }
.inline-form { display: flex; gap: 10px; align-items: end; flex-wrap: wrap; margin: 16px 0; }
.stack { display: grid; gap: 16px; }
label { display: grid; gap: 6px; color: #42515d; font-size: .88rem; font-weight: 650; }
input, select { width: 100%; border: 1px solid #b9c9d1; border-radius: 8px; padding: 11px; background: white; color: var(--ink); }
.inline-form input { width: 160px; }
.facts { margin: 0; }
.facts div { display: flex; justify-content: space-between; gap: 20px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.facts div:last-child { border: 0; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; font-weight: 700; text-align: right; }
.status { padding: 6px 10px; border-radius: 999px; background: #e6edf0; color: #49606f; font-size: .78rem; font-weight: 800; }
.status.online { background: #dff3e8; color: #267249; }
.status.offline { background: #f6e8e3; color: #92543c; }
.settings-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 12px 10px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
th { color: var(--muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; }
.login-card { max-width: 420px; margin: 10vh auto; padding: 28px; }
.flash { padding: 12px 15px; border-radius: 9px; margin-bottom: 14px; background: #e9f3f5; }
.flash.error { background: #f8e7e7; color: #8b3131; }
.flash.success { background: #e3f4e9; color: #276846; }
.muted { color: var(--muted); }
footer { max-width: 980px; margin: 0 auto; padding: 0 18px 36px; }
.link-button { border: 0; color: var(--muted); background: transparent; padding: 0; }
@media (max-width: 680px) {
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .settings-grid { grid-template-columns: 1fr; }
  .container { padding-top: 20px; }
  .panel { padding: 17px; }
}

