:root {
  --bg: #f6f7f9; --card: #ffffff; --ink: #1b1f24; --muted: #667085; --line: #e4e7ec;
  --accent: #2f6fed; --accent-soft: #e6eefd; --good: #12805c; --warn: #b54708; --bad: #c4320a;
  --bar: #2f6fed; --bar-soft: #c9d8fb;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1216; --card: #171b21; --ink: #e8ebef; --muted: #98a2b3; --line: #2a3038;
    --accent: #6b9bff; --accent-soft: #1d2a44; --good: #3ccb8f; --warn: #f5a524; --bad: #ff6b5b;
    --bar: #6b9bff; --bar-soft: #2a3a5c;
  }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.45 system-ui, -apple-system, "Segoe UI", sans-serif; }
.top { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; padding: 24px 16px 8px; max-width: 1180px; margin: 0 auto; }
h1 { margin: 0; font-size: 26px; }
h2 { margin: 0 0 12px; font-size: 15px; font-weight: 600; }
.sub, .viewer, .muted { color: var(--muted); font-weight: 400; }
.sub { margin: 4px 0 0; } .viewer { margin: 0; font-size: 13px; }
main { max-width: 1180px; margin: 0 auto; padding: 8px 16px 24px; display: grid; gap: 16px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 16px; min-width: 0; }
.grid2 { display: grid; gap: 16px; grid-template-columns: 1fr 1fr; }
@media (max-width: 820px) { .grid2 { grid-template-columns: 1fr; } .top { flex-direction: column; align-items: flex-start; } }

.tiles { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.tile { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 14px; }
.tile .label { color: var(--muted); font-size: 13px; }
.tile .value { font-size: 28px; font-weight: 650; margin-top: 2px; font-variant-numeric: tabular-nums; }
.tile .cmp { font-size: 12px; color: var(--muted); }

.funnel .step { display: grid; grid-template-columns: 110px 1fr 44px; align-items: center; gap: 10px; margin: 6px 0; }
.funnel .track { background: var(--bar-soft); border-radius: 4px; height: 18px; overflow: hidden; }
.funnel .fill { background: var(--bar); height: 100%; border-radius: 4px; }
.funnel .n { text-align: right; font-variant-numeric: tabular-nums; }

.trend { display: flex; align-items: flex-end; gap: 6px; height: 150px; padding-top: 8px; }
.trend .col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; min-width: 0; }
.trend .b { width: 100%; max-width: 34px; background: var(--bar); border-radius: 3px 3px 0 0; }
.trend .v { font-size: 11px; color: var(--muted); }
.trend .d { font-size: 11px; color: var(--muted); margin-top: 4px; white-space: nowrap; }

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 7px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 500; font-size: 12px; text-transform: uppercase; letter-spacing: .03em; }
.scroll { overflow-x: auto; max-height: 520px; overflow-y: auto; }
.pill { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 12px; background: var(--accent-soft); color: var(--accent); white-space: nowrap; }
.overdue { color: var(--bad); font-weight: 600; }
.empty { color: var(--muted); margin: 4px 0; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.row h2 { margin: 0 auto 0 0; }
input, select { font: inherit; color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: 6px 10px; }
.flags h3 { font-size: 13px; margin: 0 0 4px; color: var(--muted); font-weight: 500; }
.flags p { margin: 0 0 10px; white-space: pre-wrap; }
.foot { max-width: 1180px; margin: 0 auto; padding: 0 16px 32px; color: var(--muted); font-size: 12px; }
.err { color: var(--bad); }
