/* NextGenPoker analytics dashboard. Dark only, matching nextgenerationpoker.com
   (page #181a1b, cards #232627). Chart colors validated with the dataviz
   validator on the card surface: brand green alone, and green + violet. */
:root {
  color-scheme: dark;
  --page: #181a1b;
  --surface-1: #232627;
  --text-primary: #e8e6e3;
  --text-secondary: #b9b6b0;
  --text-muted: #8f8b85;
  --grid: #33373a;
  --axis: #464b4e;
  --border: rgba(255, 255, 255, 0.08);
  --series-1: #28a745;          /* brand green */
  --series-2: #9085e9;          /* violet (validated pair with green) */
  --accent: #28a745;
  --meter-track: #1d3a24;       /* darker step of the green ramp */
  --font: system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--page); color: var(--text-primary); font-family: var(--font); }
body { line-height: 1.45; }

.top {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px 24px; border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 10px; font-size: 1.05rem; }
.brand strong { font-weight: 600; }
.logo { height: 28px; width: auto; }
.session { display: flex; align-items: center; gap: 14px; }

main { max-width: 1180px; margin: 0 auto; padding: 20px 24px 48px; }
h2 { font-size: 1.05rem; font-weight: 600; margin: 0 0 4px; }
.muted { color: var(--text-muted); }
.small { font-size: 0.85rem; }

button { font: inherit; color: inherit; cursor: pointer; }
.btn-ghost {
  background: transparent; border: 1px solid var(--axis); border-radius: 6px; padding: 5px 12px;
  color: var(--text-secondary);
}
.btn-ghost:hover { background: rgba(255, 255, 255, 0.05); }

.filters { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0 0 18px; }
.filter-label { color: var(--text-muted); font-size: 0.85rem; margin-right: 4px; }
.filters button {
  background: transparent; border: 1px solid var(--border); border-radius: 6px;
  padding: 5px 12px; color: var(--text-secondary); font-size: 0.9rem;
}
.filters button:hover { background: rgba(255, 255, 255, 0.05); }
.filters button.selected { border-color: var(--accent); color: var(--text-primary); font-weight: 600; }

.kpis { display: grid; grid-template-columns: minmax(220px, 1fr) 3fr; gap: 14px; margin-bottom: 14px; }
.hero, .tile, .card {
  background: var(--surface-1); border: 1px solid var(--border); border-radius: 10px;
}
.hero { padding: 18px 20px; }
.hero .label, .tile .label { color: var(--text-secondary); font-size: 0.9rem; }
.hero .value { font-size: 3.4rem; font-weight: 600; line-height: 1.1; margin: 6px 0 2px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; }
.tile { padding: 14px 16px; }
.tile .value { font-size: 1.7rem; font-weight: 600; margin-top: 4px; }

.card { padding: 18px 20px; margin-bottom: 14px; }
.grid { display: grid; gap: 18px; margin-top: 12px; }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.grid.three { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }

.funnel { list-style: none; padding: 0; margin: 14px 0 0; display: grid; gap: 8px; }
.funnel li { display: grid; grid-template-columns: 190px 90px 1fr 70px; align-items: center; gap: 12px; }
.funnel .step { color: var(--text-secondary); }
.funnel .count { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.funnel .meter { height: 8px; background: var(--meter-track); border-radius: 4px; overflow: hidden; }
.funnel .meter > span { display: block; height: 100%; background: var(--series-1); border-radius: 4px; }
.funnel .rate { font-variant-numeric: tabular-nums; color: var(--text-secondary); text-align: right; }
.funnel .source { grid-column: 1 / -1; color: var(--text-muted); font-size: 0.78rem; margin: 4px 0 -2px; }

.chart { margin: 0; }
.chart figcaption { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.chart .title { font-size: 0.92rem; color: var(--text-secondary); }
.chart .total { font-size: 0.92rem; font-weight: 600; }
.chart svg { display: block; width: 100%; height: auto; margin-top: 6px; overflow: visible; }
.chart .legend { display: flex; gap: 14px; font-size: 0.82rem; color: var(--text-secondary); margin-top: 4px; }
.chart .key { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; }
.chart .key.s1 { background: var(--series-1); }
.chart .key.s2 { background: var(--series-2); }
.chart details { margin-top: 6px; font-size: 0.82rem; }
.chart summary { color: var(--text-muted); cursor: pointer; }
.chart table { border-collapse: collapse; margin-top: 6px; width: 100%; font-variant-numeric: tabular-nums; }
.chart th, .chart td { text-align: right; padding: 2px 6px; border-bottom: 1px solid var(--grid); }
.chart th:first-child, .chart td:first-child { text-align: left; }
.empty { color: var(--text-muted); font-size: 0.85rem; padding: 30px 0; text-align: center; }

svg .grid-line { stroke: var(--grid); stroke-width: 1; shape-rendering: crispEdges; }
svg .baseline { stroke: var(--axis); stroke-width: 1; shape-rendering: crispEdges; }
svg .tick { fill: var(--text-muted); font-size: 11px; font-family: var(--font); font-variant-numeric: tabular-nums; }
svg .bar { fill: var(--series-1); }
svg .bar.s2 { fill: var(--series-2); }
svg .bar:hover, svg .hit:hover + .bar, svg .bar.active { filter: brightness(1.25); }
svg .hit { fill: transparent; }
svg .line { fill: none; stroke: var(--series-1); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
svg .area { fill: var(--series-1); fill-opacity: 0.1; }
svg .dot { fill: var(--series-1); stroke: var(--surface-1); stroke-width: 2; }
svg .crosshair { stroke: var(--axis); stroke-width: 1; }

.tooltip {
  position: fixed; z-index: 10; pointer-events: none; background: #2d3133; border: 1px solid var(--border);
  border-radius: 6px; padding: 6px 9px; font-size: 0.82rem; box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
}
.tooltip .tt-period { color: var(--text-muted); }
.tooltip .tt-row { display: flex; align-items: center; gap: 6px; }
.tooltip .tt-key { width: 12px; height: 2px; border-radius: 1px; }
.tooltip .tt-key.s1 { background: var(--series-1); }
.tooltip .tt-key.s2 { background: var(--series-2); }
.tooltip strong { font-weight: 600; }

.notes { margin-top: 20px; }
.notes li { margin-bottom: 4px; }

@media (max-width: 760px) {
  .kpis { grid-template-columns: 1fr; }
  .funnel li { grid-template-columns: 1fr 70px 60px; }
  .funnel .meter { grid-column: 1 / -1; grid-row: 2; }
  main { padding: 16px; }
  .top { padding: 12px 16px; }
}
