:root {
  --bg: #f4f6f8; --surface: #fff; --surface-2: #eef2f5; --text: #17212b; --muted: #5d6b78;
  --line: #dfe5ea; --accent: #0f766e; --accent-soft: #d9f2ee; --download: #2563eb; --upload: #d97706;
  --danger: #c0262d; --danger-soft: #fde8e8; --warn: #a15c00; --warn-soft: #fdf0d9; --ok: #15803d;
  --shadow: 0 1px 2px rgb(20 30 40 / .06); color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #10161c; --surface: #18212a; --surface-2: #222d37; --text: #edf2f6; --muted: #9dabb7;
  --line: #2d3945; --accent: #2dd4bf; --accent-soft: #123a37; --download: #60a5fa; --upload: #fbbf24;
  --danger: #f87171; --danger-soft: #431d20; --warn: #fbbf24; --warn-soft: #3e2f12; --ok: #4ade80;
  --shadow: none; color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #10161c; --surface: #18212a; --surface-2: #222d37; --text: #edf2f6; --muted: #9dabb7;
    --line: #2d3945; --accent: #2dd4bf; --accent-soft: #123a37; --download: #60a5fa; --upload: #fbbf24;
    --danger: #f87171; --danger-soft: #431d20; --warn: #fbbf24; --warn-soft: #3e2f12; --ok: #4ade80;
    --shadow: none; color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; }
a { color: inherit; text-decoration: none; }
h1 { margin: 0; font-size: 26px; line-height: 1.2; letter-spacing: -.02em; }
h2 { margin: 0; font-size: 16px; }
button, input, select { font: inherit; color: inherit; }
.shell { display: grid; grid-template-columns: 224px minmax(0, 1fr); min-height: 100vh; }
.side { min-height: 100vh; display: flex; flex-direction: column; gap: 22px; padding: 22px 14px; background: var(--surface); border-right: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; padding: 0 8px; font-size: 17px; font-weight: 700; }
.brand svg { width: 28px; height: 28px; color: var(--accent); }
.nav { position: sticky; top: 22px; display: flex; flex-direction: column; gap: 3px; }
.nav a { display: flex; align-items: center; gap: 11px; padding: 9px 10px; border-radius: 7px; color: var(--muted); font-weight: 550; }
.nav a:hover { background: var(--surface-2); color: var(--text); }
.nav a.on { background: var(--accent-soft); color: var(--accent); }
.nav svg { width: 18px; height: 18px; flex: none; }
.count { margin-left: auto; min-width: 21px; padding: 0 6px; border-radius: 11px; background: var(--danger); color: #fff; font-size: 12px; line-height: 21px; text-align: center; }
:root[data-theme="dark"] .count { color: #10161c; }
.side-foot { position: sticky; bottom: 18px; margin-top: auto; display: flex; flex-direction: column; gap: 6px; }
.ghost { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 0; border-radius: 7px; background: none; color: var(--muted); cursor: pointer; text-align: left; }
.ghost:hover { background: var(--surface-2); color: var(--text); }
.main { padding: 26px 30px 44px; max-width: 1420px; width: 100%; }
.top { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.sub { margin: 4px 0 0; color: var(--muted); }
.ranges { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.seg { display: inline-flex; padding: 3px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.seg a { padding: 6px 13px; border-radius: 5px; color: var(--muted); font-weight: 600; font-size: 14px; white-space: nowrap; }
.seg a.on { background: var(--accent); color: #fff; }
:root[data-theme="dark"] .seg a.on { color: #10161c; }
.dates { display: inline-flex; align-items: center; gap: 6px; }
.dates input { width: 142px; padding: 6px 8px; font-size: 14px; }
.banner { display: flex; gap: 10px; align-items: center; justify-content: space-between; margin-bottom: 16px; padding: 11px 14px; border-radius: 8px; background: var(--warn-soft); color: var(--warn); font-weight: 550; }
.banner.err { background: var(--danger-soft); color: var(--danger); }
.banner.good { background: var(--accent-soft); color: var(--accent); }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 14px; }
.card { min-width: 0; padding: 18px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); box-shadow: var(--shadow); }
.label { color: var(--muted); font-size: 13px; font-weight: 600; }
.value { margin-top: 5px; font-size: 27px; line-height: 1.15; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.hint { margin-top: 5px; color: var(--muted); font-size: 13px; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 6px; }
.dot.down { background: var(--download); } .dot.up { background: var(--upload); }
.grid { display: grid; grid-template-columns: minmax(0, 1.75fr) minmax(290px, 1fr); gap: 14px; margin-bottom: 14px; align-items: start; }
.head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.head a { color: var(--accent); font-size: 14px; font-weight: 600; }
.legend { display: flex; gap: 14px; color: var(--muted); font-size: 13px; }
.chart { position: relative; height: 320px; }
.chart.small { height: 210px; }
.rank { display: flex; flex-direction: column; gap: 13px; }
.rank a { display: block; }
.rank-line { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 5px; }
.rank-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.bar { height: 7px; overflow: hidden; border-radius: 4px; background: var(--surface-2); }
.bar i { display: block; height: 100%; border-radius: 4px; background: var(--accent); }
.bar i.warning { background: var(--upload); } .bar i.over { background: var(--danger); }
.cover { display: flex; height: 9px; margin: 12px 0; overflow: hidden; border-radius: 5px; background: var(--surface-2); }
.cover i { display: block; height: 100%; }
.two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 11px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
th { color: var(--muted); font-size: 12.5px; font-weight: 650; white-space: nowrap; }
th[data-sort] { cursor: pointer; user-select: none; }
th[data-sort]:hover { color: var(--text); }
th.sorted::after { content: " ↓"; } th.sorted.asc::after { content: " ↑"; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr.link { cursor: pointer; } tbody tr.link:hover { background: var(--surface-2); }
td.r, th.r { text-align: right; }
.name { font-weight: 650; }
.small { color: var(--muted); font-size: 12.5px; }
.status { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); white-space: nowrap; }
.status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.status.on { color: var(--ok); } .status.on::before { background: var(--ok); }
.status.blocked { color: var(--danger); } .status.blocked::before { background: var(--danger); }
.tag { display: inline-block; padding: 2px 7px; border-radius: 5px; background: var(--warn-soft); color: var(--warn); font-size: 12px; font-weight: 650; }
.tag.over { background: var(--danger-soft); color: var(--danger); }
.tag.ok { background: var(--accent-soft); color: var(--accent); }
.toolbar { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
input, select { min-height: 36px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); }
input:focus-visible, select:focus-visible, button:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.search { width: min(320px, 100%); }
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 36px; padding: 7px 14px; border: 1px solid var(--accent); border-radius: 7px; background: var(--accent); color: #fff; font-weight: 650; cursor: pointer; white-space: nowrap; }
:root[data-theme="dark"] .btn { color: #10161c; }
.btn.alt { border-color: var(--line); background: var(--surface); color: var(--text); }
.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 13px; font-weight: 600; font-size: 13.5px; }
.field input, .field select { width: 100%; font-weight: 400; font-size: 15px; }
.info { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 8px 16px; margin: 0; }
.info dt { color: var(--muted); } .info dd { margin: 0; text-align: right; overflow-wrap: anywhere; }
.crumb { display: inline-block; margin-bottom: 8px; color: var(--muted); font-size: 14px; font-weight: 600; }
.alert-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 13px 0; border-bottom: 1px solid var(--line); }
.alert-row:last-child { border-bottom: 0; }
.alert-main { min-width: 0; flex: 1; }
.actions { display: flex; gap: 7px; flex: none; }
.empty { padding: 22px 0; color: var(--muted); text-align: center; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.login { display: grid; place-items: center; min-height: 100vh; padding: 16px; }
.login .card { width: min(380px, 100%); padding: 26px; }
.login .brand { padding: 0; margin-bottom: 18px; }
.settings-input { width: 100%; min-width: 130px; }
.quota-input { width: 96px; text-align: right; }
@media (max-width: 1120px) { .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } .grid { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 760px) {
  .shell { display: block; padding-bottom: 66px; }
  .side { position: fixed; z-index: 10; left: 0; right: 0; top: auto; bottom: 0; min-height: 0; height: 62px; padding: 5px 8px; flex-direction: row; border-top: 1px solid var(--line); border-right: 0; }
  .brand, .side-foot { display: none; }
  .nav { position: static; flex: 1; flex-direction: row; justify-content: space-around; }
  .nav a { position: relative; flex: 1; flex-direction: column; gap: 2px; padding: 5px 2px; font-size: 11px; }
  .count { position: absolute; top: 0; left: 54%; min-width: 17px; margin: 0; padding: 0 4px; font-size: 10px; line-height: 17px; }
  .main { padding: 18px 16px 24px; }
  h1 { font-size: 23px; }
  .ranges, .seg { width: 100%; }
  .seg a { flex: 1; padding: 6px 4px; text-align: center; }
  .dates { width: 100%; } .dates input { flex: 1; width: 0; min-width: 0; }
  .stats { gap: 10px; } .card { padding: 14px; } .value { font-size: 21px; }
  .chart { height: 250px; } .two { grid-template-columns: minmax(0, 1fr); }
  .hide-m { display: none; }
  th, td { padding: 10px 6px; }
  .alert-row { align-items: flex-start; flex-direction: column; }
  .search { width: 100%; }
}
