/* =============================================================================
   CS Reporting Dashboard — design tokens and layout.

   Theme rule: the COMPLETE light palette lives on bare :root. Dark mode only
   ever *redefines* those same token names, in two places — the system
   preference (guarded so an explicit light choice still wins) and the explicit
   :root[data-theme="dark"] toggle. No colour is defined only inside a media
   query, so nothing disappears when the query does not match.
   ========================================================================== */

:root {
  /* surfaces */
  --plane: #f6f6f3;
  --surface: #fcfcfb;
  --surface-sunk: #f1f1ec;

  /* ink */
  --ink: #0b0b0b;
  --ink-2: #52514e;
  --ink-muted: #898781;

  /* lines */
  --grid: #e1e0d9;
  --border: #e1e0d9;
  --border-strong: #cfcec5;

  /* series — a cor de cada loja, tirada do próprio site (10/09/2026):
     Lumvelle rosa, Vellum verde-sálvia, Elevare vermelho, Vigewell preto,
     Old Harvest verde-floresta (clareado para não virar preto na tela).
     Stratum ainda sem site — violeta provisório. No tema escuro cada uma
     fica mais clara, mesma cor, para aparecer no fundo preto. */
  --series-1: #e3559f; /* Lumvelle    — rosa */
  --series-2: #3a5c4e; /* Vellum      — verde-sálvia */
  --series-3: #e0262d; /* Elevare     — vermelho */
  --series-4: #1d1d1d; /* Vigewell    — preto */
  --series-5: #62901c; /* Old Harvest — verde-floresta */
  --series-6: #7945ab; /* Stratum     — violeta (provisório) */

  /* ordinal ramp for backlog aging: young -> old. Grafite, de propósito: todas
     as matizes fortes já são de alguma loja, e o azul antigo se confundia com a
     Vigewell. Uma escala ordenada, não categórica — mesma cor, mais funda. */
  --ramp-1: #cfcdc4;
  --ramp-2: #8e8c84;
  --ramp-3: #4a4945;

  /* accent: segue a loja selecionada no filtro (app.js troca para a cor dela).
     Em "All" é neutro — nenhuma loja fala pelas outras. */
  --accent: #0b0b0b;
  --accent-line: transparent;
  --neutral-mark: #7a7872;

  /* status — never reused as series colours, always paired with a text label */
  --good: #0ca30c;
  --warning: #fab219;
  --critical: #d03b3b;
  --good-tint: rgba(12, 163, 12, 0.12);
  --warning-tint: rgba(250, 178, 25, 0.16);
  --critical-tint: rgba(208, 59, 59, 0.12);

  --focus: #0b0b0b;
  --shadow: 0 1px 2px rgba(11, 11, 11, 0.05), 0 8px 24px -18px rgba(11, 11, 11, 0.35);
  --highlight: 0 0 0 0 transparent;
  --glow: rgba(11, 11, 11, 0.035);

  --radius: 12px;
  --radius-sm: 6px;
  --maxw: 1440px;

  --font-head: "Archivo", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-body: "IBM Plex Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Consolas, monospace;

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --plane: #0d0d0d;
    --surface: #1a1a19;
    --surface-sunk: #131312;
    --ink: #ffffff;
    --ink-2: #c3c2b7;
    --ink-muted: #898781;
    --grid: #2c2c2a;
    --border: #2c2c2a;
    --border-strong: #3d3d3a;
    --series-1: #ff75b8;
    --series-2: #5f9e8c;
    --series-3: #f0444a;
    --series-4: #ececec;
    --series-5: #98b83f;
    --series-6: #9b6fd0;
    /* invertida: no fundo escuro o degrau mais velho é o mais claro */
    --ramp-1: #55534e;
    --ramp-2: #8f8d86;
    --ramp-3: #d6d4cc;
    --accent: #ffffff;
    --neutral-mark: #8f8d86;
    --good-tint: rgba(12, 163, 12, 0.2);
    --warning-tint: rgba(250, 178, 25, 0.2);
    --critical-tint: rgba(208, 59, 59, 0.2);
    --focus: #ffffff;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.5), 0 8px 24px -18px rgba(0, 0, 0, 0.9);
    --highlight: inset 0 1px 0 rgba(255, 255, 255, 0.035);
    --glow: rgba(255, 255, 255, 0.045);
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --plane: #0d0d0d;
  --surface: #1a1a19;
  --surface-sunk: #131312;
  --ink: #ffffff;
  --ink-2: #c3c2b7;
  --ink-muted: #898781;
  --grid: #2c2c2a;
  --border: #2c2c2a;
  --border-strong: #3d3d3a;
  --series-1: #ff75b8;
  --series-2: #5f9e8c;
  --series-3: #f0444a;
  --series-4: #ececec;
  --series-5: #98b83f;
  --series-6: #9b6fd0;
  --ramp-1: #55534e;
  --ramp-2: #8f8d86;
  --ramp-3: #d6d4cc;
  --accent: #ffffff;
  --neutral-mark: #8f8d86;
  --good-tint: rgba(12, 163, 12, 0.2);
  --warning-tint: rgba(250, 178, 25, 0.2);
  --critical-tint: rgba(208, 59, 59, 0.2);
  --focus: #ffffff;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.5), 0 8px 24px -18px rgba(0, 0, 0, 0.9);
  --highlight: inset 0 1px 0 rgba(255, 255, 255, 0.035);
  --glow: rgba(255, 255, 255, 0.045);
  color-scheme: dark;
}

/* =============================================================================
   Base
   ========================================================================== */

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { background: var(--plane); }
/* Um brilho muito leve no topo — dá profundidade sem virar enfeite. */
body {
  background:
    radial-gradient(1100px 420px at 50% -240px, var(--glow), transparent 70%),
    var(--plane);
  min-height: 100vh;
}

body {
  margin: 0;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  margin: 0;
  font-family: var(--font-head);
  font-weight: 600;
  letter-spacing: -0.015em;
}

h1 { font-size: 17px; }
h2 { font-size: 16px; }
h3 { font-size: 13px; }

button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }

/* every number on the page is mono and tabular */
.num {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

.shell { max-width: var(--maxw); margin: 0 auto; padding: 0 20px 64px; }

/* =============================================================================
   Top bar and sticky filter bar
   ========================================================================== */

.topbar {
  position: relative;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

/* Faixa com a cor de cada loja, na ordem do stores.json. Com uma loja
   selecionada vira só a cor dela (app.js). */
.brand-strip {
  height: 3px;
  background: var(--border-strong);
  transition: background 0.2s ease;
}

.topbar-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  align-items: baseline;
  gap: 16px;
  flex-wrap: wrap;
}

.brand { display: flex; align-items: center; gap: 10px; align-self: center; }
.brand-logo {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  background: var(--ink);
  color: var(--plane);
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.02em;
  display: grid;
  place-items: center;
  flex: none;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-mark {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: -0.02em;
}
.brand-stores { display: flex; flex-wrap: wrap; gap: 2px 10px; font-size: 11px; color: var(--ink-muted); }
.brand-stores span { display: inline-flex; align-items: center; gap: 5px; }
.brand-stores i { width: 6px; height: 6px; border-radius: 50%; display: inline-block; }
.topbar-meta {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 18px;
  font-size: 12px;
  color: var(--ink-2);
}
.topbar-meta dl { display: flex; gap: 18px; margin: 0; }
.topbar-meta div { display: flex; flex-direction: column; gap: 1px; }
.topbar-meta dt {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-muted);
}
.topbar-meta dd { margin: 0; color: var(--ink); }

.theme-toggle {
  background: var(--surface-sunk);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 5px 9px;
  font-size: 12px;
  color: var(--ink-2);
  white-space: nowrap;
}
.theme-toggle:hover { border-color: var(--border-strong); color: var(--ink); }

.stickybar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: color-mix(in srgb, var(--plane) 88%, transparent);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.stickybar-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 10px 20px;
  display: flex;
  align-items: center;
  gap: 22px;
  flex-wrap: wrap;
}

/* tabs */
.tabs { display: flex; gap: 2px; }
.tab {
  background: none;
  border: 0;
  border-bottom: 2px solid transparent;
  padding: 7px 12px;
  color: var(--ink-2);
  font-weight: 500;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}
.tab:hover { color: var(--ink); background: var(--surface-sunk); }
.tab[aria-selected="true"] {
  color: var(--ink);
  border-bottom-color: var(--accent);
  font-weight: 600;
}

/* store filter */
.filter { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.filter-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-muted);
}
.filter-group {
  display: flex;
  gap: 0;
  background: var(--surface-sunk);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 2px;
}
.chip {
  background: none;
  border: 0;
  border-radius: 4px;
  padding: 5px 11px;
  font-size: 13px;
  color: var(--ink-2);
  display: flex;
  align-items: center;
  gap: 6px;
}
.chip:hover { color: var(--ink); }
.chip[aria-pressed="true"] {
  background: var(--surface);
  color: var(--ink);
  font-weight: 600;
  box-shadow: var(--shadow);
}
.chip-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; transition: box-shadow 0.15s ease; }

/* Loja selecionada: fundo tingido com a cor dela, contorno fino e um halo no
   ponto. O texto continua em tinta — a cor mora na marca, não nas letras. */
.chip.is-store[aria-pressed="true"] {
  background: color-mix(in oklab, var(--store) 15%, var(--surface));
  box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--store) 50%, transparent);
}
.chip.is-store[aria-pressed="true"] .chip-dot {
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--store) 30%, transparent);
}
.chip.is-store:hover:not([aria-pressed="true"]) {
  background: color-mix(in oklab, var(--store) 8%, transparent);
}

/* period selector */
.period-group {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--surface-sunk);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 3px 5px;
}
.date-input {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 12px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 3px 6px;
  /* The native picker icon is drawn by the browser in its own colour; invert it
     in dark mode so it does not sit as a black glyph on a dark field. */
  color-scheme: inherit;
}
.date-input:hover { border-color: var(--border-strong); }
.period-dash { color: var(--ink-muted); font-size: 12px; }
.period-reset {
  background: none;
  border: 0;
  border-radius: 4px;
  padding: 3px 7px;
  font-size: 12px;
  color: var(--ink-muted);
}
.period-reset:hover { color: var(--ink); background: var(--surface); }
.period-reset[hidden] { display: none !important; }

/* flags a period that is not the one meta.json ships with */
.period-custom {
  font-size: 11px;
  color: var(--warning);
  font-weight: 500;
}

/* =============================================================================
   Cards, sections, tiles
   ========================================================================== */

.section { margin-top: 34px; }
.section-head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.section-note { font-size: 12px; color: var(--ink-muted); }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--highlight);
}

.grid { display: grid; gap: 12px; }
.tiles { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.cols-2 { grid-template-columns: repeat(auto-fit, minmax(420px, 1fr)); }

.tile { display: flex; flex-direction: column; gap: 7px; position: relative; overflow: hidden; padding: 16px 18px; }
/* Linha no topo do cartão: some em "All", assume a cor da loja filtrada. */
.tile::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 2px;
  background: var(--accent-line);
}
.tile-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}
.tile-value {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 30px;
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.02em;
}
.tile-unit { font-size: 14px; font-weight: 400; color: var(--ink-2); margin-left: 3px; }
.tile-sub { font-size: 12px; color: var(--ink-2); }
.tile-foot {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--ink-muted);
  margin-top: auto;
  padding-top: 4px;
}

/* change indicator — colour follows whether the movement is GOOD, not up */
.change {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}
.change.is-good { color: var(--good); }
.change.is-bad { color: var(--critical); }
.change.is-flat { color: var(--ink-muted); }

/* status chip: dot + label. Never colour alone. */
.status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}
.status-dot { width: 7px; height: 7px; border-radius: 50%; flex: none; }
.status.good { background: var(--good-tint); }
.status.good .status-dot { background: var(--good); }
.status.warning { background: var(--warning-tint); }
.status.warning .status-dot { background: var(--warning); }
.status.critical { background: var(--critical-tint); }
.status.critical .status-dot { background: var(--critical); }
.status.unknown { background: var(--surface-sunk); }
.status.unknown .status-dot { background: var(--ink-muted); }

/* A tile is a column flexbox, so a chip inside one stretches to the full width
   unless told not to. It should hug its own text. */
.tile > .status { align-self: flex-start; }

/* =============================================================================
   Tables — always scroll inside their own container
   ========================================================================== */

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

table { border-collapse: collapse; width: 100%; font-size: 13px; }

th, td {
  padding: 9px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

thead th {
  position: sticky;
  top: 0;
  background: var(--surface);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-muted);
  font-weight: 600;
  z-index: 1;
}

tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: var(--surface-sunk); }

td.n, th.n { text-align: right; }
td.n {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

tr.total-row td {
  border-top: 2px solid var(--border-strong);
  font-weight: 600;
  background: var(--surface-sunk);
}
tr.total-row:hover td { background: var(--surface-sunk); }

.cell-store { display: flex; align-items: center; gap: 8px; }
/* Barrinha vertical na cor da loja — lê como etiqueta, não como ponto solto. */
.store-swatch { width: 4px; height: 14px; border-radius: 2px; flex: none; }

/* Linha de tabela de uma loja: o hover tinge com a cor dela. */
tbody tr.store-row:hover td { background: color-mix(in oklab, var(--store) 7%, var(--surface)); }

.sub { color: var(--ink-muted); font-size: 12px; }
.wrap-cell { white-space: normal; min-width: 260px; }

/* =============================================================================
   Charts
   ========================================================================== */

.chart { width: 100%; display: block; overflow: visible; }
.chart-scroll { overflow-x: auto; }

.chart text { font-family: var(--font-body); fill: var(--ink-2); }
.chart .tick {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 10px;
  fill: var(--ink-muted);
}
.chart .axis-title { font-size: 10px; fill: var(--ink-muted); letter-spacing: 0.05em; }
.chart .gridline { stroke: var(--grid); stroke-width: 1; }
.chart .axisline { stroke: var(--border-strong); stroke-width: 1; }
.chart .divider { stroke: var(--border-strong); stroke-width: 1; stroke-dasharray: 4 3; }
.chart .mark { cursor: default; }
.chart .mark:hover { opacity: 0.78; }
.chart .dot { stroke: var(--surface); stroke-width: 1.5; }
/* 1px de fundo entre segmentos empilhados, para cada loja ter borda própria. */
.chart .stack { stroke: var(--surface); stroke-width: 1; }
.chart .series-line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }

.legend {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--ink-2);
  margin: 2px 0 12px;
}
.legend-item { display: flex; align-items: center; gap: 6px; }
.legend-swatch { width: 10px; height: 10px; border-radius: 3px; flex: none; }

/* shared tooltip */
.tooltip {
  position: fixed;
  z-index: 100;
  pointer-events: none;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  padding: 7px 10px;
  font-size: 12px;
  line-height: 1.45;
  max-width: 260px;
  opacity: 0;
  transition: opacity 0.09s ease;
}
.tooltip[data-show="true"] { opacity: 1; }
.tooltip-title { font-weight: 600; margin-bottom: 2px; }
.tooltip-row { display: flex; align-items: center; gap: 6px; }
.tooltip-val {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

/* =============================================================================
   Action plans view
   ========================================================================== */

.plan { display: flex; flex-direction: column; gap: 10px; }

.plan-head { display: flex; align-items: flex-start; gap: 12px; }

/* the priority number, not a decoration — 1 is the one that costs money */
.plan-rank {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-2);
  background: var(--surface-sunk);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  min-width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
}

.plan-title-wrap { flex: 1; min-width: 0; }
.plan-title-wrap h3 { margin-bottom: 4px; }

.plan-meta {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--ink-muted);
}

.plan-status { flex: none; margin-top: 2px; }

.plan-problem { margin: 0; color: var(--ink-2); }

.plan-why {
  margin: 0;
  color: var(--ink-2);
  font-size: 13px;
  border-left: 2px solid var(--border-strong);
  padding-left: 11px;
}
.plan-why strong { color: var(--ink); }

.plan-actions {
  list-style: none;
  margin: 2px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  counter-reset: step;
}

.plan-action {
  display: flex;
  align-items: baseline;
  gap: 10px;
  font-size: 13px;
}

/* An open step is a hollow ring, a done step is filled — paired with an
   aria-label carrying the same state as words, never colour alone. */
.plan-action-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  border: 1.5px solid var(--border-strong);
  flex: none;
  transform: translateY(1px);
}
.plan-action.is-done .plan-action-dot { background: var(--good); border-color: var(--good); }
.plan-action.is-done .plan-action-body { color: var(--ink-muted); text-decoration: line-through; }

.plan-action-body { flex: 1; }

.plan-action-tag {
  display: inline-block;
  margin-left: 8px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-muted);
  background: var(--surface-sunk);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 5px;
  vertical-align: 1px;
  white-space: nowrap;
}

.plan-metric {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--ink-2);
  border-top: 1px solid var(--border);
  padding-top: 10px;
}
.plan-metric-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-muted);
  flex: none;
}

/* =============================================================================
   Data-sources view
   ========================================================================== */

.prose { max-width: 78ch; }
.prose p { color: var(--ink-2); margin: 0 0 12px; }
.prose ul { color: var(--ink-2); margin: 0 0 12px; padding-left: 20px; }
.prose li { margin-bottom: 5px; }
.prose code {
  font-family: var(--font-mono);
  font-size: 12px;
  background: var(--surface-sunk);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 5px;
}

.pipeline { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.pipeline-step {
  background: var(--surface-sunk);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
}
.pipeline-step .step-n {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-muted);
  display: block;
  margin-bottom: 4px;
}
.pipeline-step strong { display: block; margin-bottom: 4px; }
.pipeline-step span.d { font-size: 12px; color: var(--ink-2); }

.option-card { border-left: 3px solid var(--border-strong); }

.helpdesk-tag {
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--ink-2);
  background: var(--surface-sunk);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 6px;
}

/* =============================================================================
   Store scorecards — um cartão por loja, com a cor dela
   ========================================================================== */

.store-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(215px, 1fr)); }

.store-card {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px 16px 14px;
  background:
    linear-gradient(180deg, color-mix(in oklab, var(--store) 10%, var(--surface)) 0%, var(--surface) 62%);
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.store-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: var(--store);
}
.store-card:hover { border-color: color-mix(in oklab, var(--store) 45%, var(--border)); }
button.store-card { text-align: left; font: inherit; color: inherit; cursor: pointer; width: 100%; }
button.store-card:hover { transform: translateY(-1px); }

.store-card-head { display: flex; align-items: center; gap: 9px; }
.store-mono {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--store);
  color: var(--surface);
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 12px;
  display: grid;
  place-items: center;
  flex: none;
  box-shadow: 0 4px 14px -6px var(--store);
}
.store-card-title { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
.store-card-name { font-family: var(--font-head); font-weight: 600; font-size: 14px; letter-spacing: -0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.store-card-desk { font-size: 10.5px; color: var(--ink-muted); letter-spacing: 0.02em; }

.store-card-hero { display: flex; align-items: baseline; gap: 6px; }
.store-card-hero .v {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1;
}
.store-card-hero .u { font-size: 12px; color: var(--ink-2); }

.store-card-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.store-card-stats div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.store-card-stats dt {
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--ink-muted);
  white-space: nowrap;
}
.store-card-stats dd {
  margin: 0;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 13px;
  font-weight: 500;
}
.store-card-stats { margin: 0; }

/* participação da loja no volume total */
.store-share { display: flex; align-items: center; gap: 8px; font-size: 11px; color: var(--ink-muted); }
.store-share-track { flex: 1; height: 4px; border-radius: 2px; background: var(--surface-sunk); overflow: hidden; }
.store-share-fill { height: 100%; border-radius: 2px; background: var(--store); }
.store-share .num { color: var(--ink-2); min-width: 34px; text-align: right; }

/* =============================================================================
   Notices and "not connected yet" states
   ========================================================================== */

.notice {
  margin: 14px 0 0;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  color: var(--ink-2);
  background: var(--warning-tint);
  border: 1px solid color-mix(in oklab, var(--warning) 35%, transparent);
}

.pending-card {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  border-style: dashed;
  background: var(--surface-sunk);
  box-shadow: none;
}
.pending-icon {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1.5px dashed var(--border-strong);
  display: grid;
  place-items: center;
  flex: none;
  color: var(--ink-muted);
  font-size: 13px;
}
.pending-card h3 { margin-bottom: 3px; }
.pending-card p { margin: 0; color: var(--ink-2); font-size: 13px; max-width: 72ch; }
.pending-stores { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.pending-stores span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--ink-2);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 2px 9px 2px 7px;
}
.pending-stores i { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }

/* =============================================================================
   Loading / error
   ========================================================================== */

.state {
  padding: 48px 20px;
  text-align: center;
  color: var(--ink-2);
}
.state h2 { margin-bottom: 8px; }
.state pre {
  display: inline-block;
  text-align: left;
  font-family: var(--font-mono);
  font-size: 12px;
  background: var(--surface-sunk);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin-top: 10px;
  white-space: pre-wrap;
  max-width: 640px;
}

@media (max-width: 720px) {
  .store-card-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .topbar-meta { margin-left: 0; width: 100%; }
  .filter { margin-left: 0; width: 100%; }
  .tile-value { font-size: 24px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
