/* LLM FinOps — dark, Grafana-like. Palette from the dataviz reference (validated). */
:root {
  --plane:    #0d0d0d;
  --surface:  #1a1a19;
  --ink:      #ffffff;
  --ink-2:    #c3c2b7;
  --muted:    #898781;
  --series-1: #3987e5;
  --good:     #0ca30c;
  --critical: #d03b3b;
  --grid:     #2c2c2a;
  --baseline: #383835;
  --border:   rgba(255,255,255,0.10);
  --radius: 10px;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
}
@media (prefers-color-scheme: light) {
  :root {
    --plane: #f9f9f7; --surface: #fcfcfb; --ink: #0b0b0b; --ink-2: #52514e;
    --muted: #898781; --series-1: #2a78d6; --good: #006300; --critical: #d03b3b;
    --grid: #e1e0d9; --baseline: #c3c2b7; --border: rgba(11,11,11,0.10);
  }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--plane); color: var(--ink); }

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 20px; border-bottom: 1px solid var(--border);
  position: sticky; top: 0; background: var(--plane); z-index: 5;
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand h1 { font-size: 16px; margin: 0; font-weight: 650; letter-spacing: .2px; }
.brand .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--series-1); }
.tz { font-size: 11px; color: var(--muted); border: 1px solid var(--border); padding: 1px 6px; border-radius: 6px; }
.controls { display: flex; align-items: center; gap: 14px; }
.range { display: inline-flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.range button {
  background: transparent; color: var(--ink-2); border: 0; padding: 6px 12px;
  font: inherit; font-size: 13px; cursor: pointer;
}
.range button.active { background: var(--series-1); color: #fff; }
.filter {
  background: var(--surface); color: var(--ink); border: 1px solid var(--border);
  border-radius: 8px; padding: 6px 10px; font: inherit; font-size: 13px; cursor: pointer;
  max-width: 180px;
}
.filter:focus-visible { outline: 2px solid var(--series-1); outline-offset: 1px; }
.updated { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }

main { padding: 20px; max-width: 1180px; margin: 0 auto; display: grid; gap: 16px; }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.card, .panel {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px 18px;
}
.card .label { font-size: 13px; color: var(--ink-2); }
.card .label .sub, .panel-head .sub { color: var(--muted); font-weight: 400; }
.card .value { font-size: 34px; font-weight: 680; margin: 8px 0 6px; line-height: 1.1; }
.card .foot { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.card.over .value { color: var(--critical); }
.card.ok .value { color: var(--ink); }

.meter { height: 6px; background: var(--grid); border-radius: 4px; overflow: hidden; margin: 4px 0 8px; }
.meter-fill { height: 100%; width: 0%; background: var(--good); border-radius: 4px; transition: width .3s; }
.meter-fill.over { background: var(--critical); }

.panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.panel-head h2 { font-size: 14px; margin: 0; font-weight: 600; }
.legend { font-size: 12px; color: var(--ink-2); display: flex; align-items: center; gap: 8px; }
.legend .swatch { width: 10px; height: 10px; border-radius: 3px; background: var(--series-1); display: inline-block; }
.legend-budget { color: var(--muted); }

.chart { width: 100%; height: 280px; }
.chart svg { width: 100%; height: 100%; display: block; overflow: visible; }
.bar { fill: var(--series-1); }
.bar:hover { fill: #5598e7; }
.gridline { stroke: var(--grid); stroke-width: 1; }
.baseline { stroke: var(--baseline); stroke-width: 1; }
.budget-line { stroke: var(--critical); stroke-width: 1.5; stroke-dasharray: 5 4; }
.axis-label { fill: var(--muted); font-size: 11px; font-family: inherit; }
.axis-label.tnum { font-variant-numeric: tabular-nums; }

.tooltip {
  position: fixed; pointer-events: none; z-index: 10;
  background: var(--surface); border: 1px solid var(--border); border-radius: 8px;
  padding: 8px 10px; font-size: 12px; color: var(--ink);
  box-shadow: 0 6px 20px rgba(0,0,0,.35); min-width: 120px;
}
.tooltip .t-day { color: var(--muted); margin-bottom: 4px; }
.tooltip .t-cost { font-weight: 650; font-variant-numeric: tabular-nums; }
.tooltip .t-reqs { color: var(--ink-2); font-variant-numeric: tabular-nums; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--border); }
th { color: var(--muted); font-weight: 500; font-size: 12px; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
tbody tr:hover { background: rgba(255,255,255,.03); }
.empty { color: var(--muted); text-align: center; }

@media (max-width: 720px) { .stats { grid-template-columns: 1fr; } }
