:root {
  color-scheme: light;
  --bg: #eef2f8; --card: #ffffff; --ink: #16233b; --muted: #5f6b80; --line: #dfe5ee;
  --primary: #1f4e8c; --primary-soft: #e4ecf7; --track: #edf0f5;
  --series-1: #2a78d6; --good: #1baf7a; --warn: #c98500; --bad: #d03b3b;
  --good-soft: #e3f6ee; --warn-soft: #fbf1dc; --bad-soft: #fbe6e6;
  --shadow: 0 1px 2px rgba(20,30,60,.06), 0 4px 14px rgba(20,30,60,.06);
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: 'Segoe UI', system-ui, -apple-system, Arial, sans-serif; background: var(--bg); color: var(--ink); font-size: 14px; line-height: 1.5; }
h1, h2, h3 { margin: 0; line-height: 1.3; }
h2 { font-size: 17px; font-weight: 600; }
h3 { font-size: 14px; font-weight: 600; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.hidden { display: none !important; }
.topbar { background: var(--primary); color: #fff; padding: 12px 24px; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.topbar .brand { font-weight: 600; font-size: 16px; }
.topbar .brand small { display: block; font-weight: 400; font-size: 12px; opacity: .85; }
.spacer { flex: 1; }
.wrap { max-width: 1240px; margin: 0 auto; padding: 18px 24px 60px; }
.card { background: var(--card); border-radius: 12px; box-shadow: var(--shadow); padding: 16px 18px; min-width: 0; }
.stack > * + * { margin-top: 14px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.btn { font: inherit; font-size: 13px; font-weight: 500; border: 1px solid var(--line); background: #fff; color: var(--ink); padding: 7px 13px; border-radius: 8px; cursor: pointer; white-space: nowrap; }
.btn:hover { background: #f4f6fa; }
.btn.primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn.primary:hover { background: #193f73; }
.btn.danger { color: var(--bad); }
.btn.sm { padding: 4px 9px; font-size: 12px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
input, select, textarea { font: inherit; font-size: 14px; color: var(--ink); border: 1px solid var(--line); border-radius: 8px; padding: 7px 9px; background: #fff; min-width: 0; }
input:focus, select:focus, textarea:focus, .btn:focus-visible { outline: 2px solid var(--series-1); outline-offset: 1px; }
label.field { display: grid; gap: 3px; font-size: 12px; color: var(--muted); font-weight: 500; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.tile .num { font-size: 28px; font-weight: 600; font-variant-numeric: tabular-nums; }
.tile .lab { font-size: 12px; color: var(--muted); }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 14px; }
.bar { display: grid; grid-template-columns: minmax(110px, 44%) 1fr 48px; gap: 8px; align-items: center; padding: 3px 0; font-size: 13px; position: relative; border-radius: 6px; }
.bar:hover { background: #f4f6fa; }
.bar .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar .track { height: 10px; background: var(--track); border-radius: 4px; overflow: hidden; }
.bar .fill { height: 100%; background: var(--series-1); border-radius: 4px; }
.bar .val { text-align: right; font-variant-numeric: tabular-nums; font-weight: 500; }
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 13px; }
th { text-align: left; font-weight: 600; color: var(--muted); font-size: 12px; border-bottom: 1px solid var(--line); padding: 7px 8px; white-space: nowrap; }
td { border-bottom: 1px solid var(--line); padding: 7px 8px; vertical-align: top; }
td.n, th.n { text-align: right; font-variant-numeric: tabular-nums; }
tbody tr.click { cursor: pointer; }
tbody tr.click:hover { background: #f4f6fa; }
.badge { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--primary-soft); color: var(--primary); }
.badge.good { background: var(--good-soft); color: #0d7a52; }
.badge.warn { background: var(--warn-soft); color: #8a5c00; }
.badge.bad { background: var(--bad-soft); color: #a92929; }
.notice { padding: 9px 12px; border-radius: 8px; background: var(--warn-soft); color: #6f4a00; font-size: 13px; }
.notice.bad { background: var(--bad-soft); color: #8e2020; }
.notice.good { background: var(--good-soft); color: #0b6443; }
.modal-bg { position: fixed; inset: 0; background: rgba(15,25,45,.45); display: flex; justify-content: center; align-items: flex-start; padding: 28px 14px; overflow-y: auto; z-index: 20; }
.modal { background: #fff; border-radius: 12px; width: min(980px, 100%); padding: 18px 20px; }
.hero { display: flex; gap: 20px; flex-wrap: wrap; align-items: center; }
.hero .big { font-size: 42px; font-weight: 600; font-variant-numeric: tabular-nums; line-height: 1; }
@media (max-width: 640px) { .wrap { padding: 14px 16px 50px; } .topbar { padding: 12px 16px; } .grid2 { grid-template-columns: 1fr; } }
