@import url("https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500&family=IBM+Plex+Sans:wght@400;500;600&display=swap");

:root {
  color-scheme: dark;
  --ground: #121417; --card: #1A1D21; --raised: #20242A; --line: #2C3137; --line-soft: #24282E;
  --ink: #E8EAED; --ink-2: #C3C8CE; --muted: #9AA2AB; --faint: #6B737C;
  --field: #15181C; --field-line: #3A4048; --field-line-hover: #59616B;
  --accent: #1F7A75; --accent-text: #5CC8C0; --accent-hover: #8EDDD6; --accent-soft: #173A39; --accent-ink: #9EE3DC;
  --red: #FF8A7A; --red-bg: #3A1F1C; --red-ink: #FFB4A8; --red-line: #6B3129;
  --amber: #F0A04B; --amber-bg: #3A2A14; --amber-ink: #F5C27E;
  --blue-bg: #1C2A3D; --blue-ink: #A9C4EC;
  --ok-bg: #12302D; --ok-line: #2A6B65;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--ground); color: var(--ink); font: 15px/1.45 "IBM Plex Sans", system-ui, sans-serif; }
a { color: var(--accent-text); } a:hover { color: var(--accent-hover); }
h1 { margin: 0; font-size: 30px; font-weight: 600; letter-spacing: -0.02em; }
h2 { margin: 0; font-size: 18px; font-weight: 600; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.mono { font-family: var(--mono); }

.top { background: #16191D; border-bottom: 1px solid var(--line); }
.top-in { max-width: 1280px; margin: 0 auto; padding: 14px 24px; display: flex; flex-wrap: wrap; align-items: center; gap: 12px 28px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 600; color: var(--ink); text-decoration: none; }
.brand-mark { width: 32px; height: 32px; border-radius: 8px; background: var(--accent); color: #fff; display: flex; align-items: center; justify-content: center; }
.nav { display: flex; flex-wrap: wrap; gap: 4px; flex: 1 1 auto; }
.nav a { padding: 8px 14px; border-radius: 8px; color: var(--ink-2); text-decoration: none; }
.nav a[aria-current="page"] { background: var(--accent-soft); color: var(--accent-ink); font-weight: 500; }
.who { display: flex; align-items: center; gap: 12px; }
.who-name { text-align: right; line-height: 1.2; }

main { max-width: 1280px; margin: 0 auto; padding: 32px 24px 56px; display: flex; flex-direction: column; gap: 24px; }
.head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 16px; }
.head p { margin: 4px 0 0; color: var(--muted); }

.btn { font: inherit; display: inline-flex; align-items: center; justify-content: center; min-height: 40px; padding: 8px 16px; border: 1px solid var(--field-line); border-radius: 8px; background: var(--raised); color: var(--ink); cursor: pointer; text-decoration: none; }
.btn:hover { border-color: var(--field-line-hover); color: var(--ink); }
.btn:disabled { opacity: 0.6; cursor: default; }
.btn.on, .btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 500; }
.btn.small { min-height: 32px; padding: 4px 10px; font-size: 13px; }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.row.end { align-items: flex-end; }

label.field { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
input[type=text], input[type=password], input[type=search], input[type=date], select {
  font: inherit; color: var(--ink); padding: 8px 10px; border: 1px solid var(--field-line); border-radius: 8px; background: var(--field); min-height: 40px;
}
input:focus, select:focus, .btn:focus-visible, a:focus-visible { outline: 2px solid var(--accent-text); outline-offset: 2px; }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 18px 20px; display: flex; flex-direction: column; gap: 6px; }
.kpi-label, .kpi-note { font-size: 13px; color: var(--muted); }
.kpi-value { font-family: var(--mono); font-size: clamp(22px, 3vw, 28px); font-weight: 500; letter-spacing: -0.02em; }
.kpi-value.red { color: var(--red); } .kpi-value.amber { color: var(--amber); }

.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 20px; display: flex; flex-direction: column; gap: 16px; }
.card-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; }
.tablebox { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
table.wide { min-width: 1060px; }
th { background: var(--raised); color: var(--ink-2); font-weight: 500; padding: 12px 14px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
th a { color: inherit; text-decoration: none; } th a:hover { text-decoration: underline; }
tbody tr:hover td { background: #1E2227; }
td { padding: 12px 14px; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
.num { text-align: right; font-family: var(--mono); }
th.num { font-family: inherit; }
.zero { color: var(--faint); }
.warn { color: var(--amber); font-family: inherit; font-size: 13px; }
.gap-note { display: block; font-family: "IBM Plex Sans", sans-serif; font-size: 12px; color: var(--amber); }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { padding: 3px 10px; border-radius: 999px; font-size: 13px; font-weight: 500; white-space: nowrap; }
.chip.drain { background: var(--red-bg); color: var(--red-ink); }
.chip.card { background: var(--amber-bg); color: var(--amber-ink); }
.chip.hw { background: var(--blue-bg); color: var(--blue-ink); }
.legend { display: flex; flex-wrap: wrap; gap: 8px 20px; font-size: 13px; color: var(--muted); }
.legend > span { display: inline-flex; align-items: center; gap: 6px; }
td.car { font-weight: 500; min-width: 190px; }

.flash { padding: 12px 16px; border-radius: 10px; border: 1px solid var(--line); background: var(--card); }
.flash.ok { border-color: var(--ok-line); background: var(--ok-bg); }
.flash.error { border-color: var(--red-line); background: var(--red-bg); color: var(--red-ink); }
.status-ok { color: var(--accent-text); } .status-error { color: var(--red); }

.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.login { width: 100%; max-width: 380px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 28px; display: flex; flex-direction: column; gap: 16px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.empty { padding: 32px; text-align: center; color: var(--muted); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

@media (max-width: 640px) {
  main { padding: 20px 16px 40px; }
  h1 { font-size: 24px; }
  .who-name { text-align: left; }
}
table.wide td:last-child { min-width: 220px; }
