/* Demo Retail Co. :: Planejamento de Clientes
   Light/dark tokens, sidebar shell, KPI strip, cards, tables and page-specific blocks. */

:root {
  color-scheme: light;
  --bg: #f6f5f2;
  --surface: #ffffff;
  --surface-2: #f1f0ec;
  --surface-3: #e8e7e2;
  --line: #e4e3de;
  --line-strong: #d0cfc9;
  --text: #141413;
  --text-2: #5a5955;
  --text-3: #8a8984;
  --ink: #161616;
  --ink-text: #ffffff;
  --accent: #d9372b;
  --accent-soft: #fbebe9;
  --mod: #241b42;
  --mod-fg: #f2effc;
  --mod-accent: #a797f8;
  --mod-muted: #f2effc99;
  --mod-hover: #f2effc14;
  --mod-line: #f2effc1c;
  --chart-1: #d9372b;
  --chart-2: #c8c7c1;
  --chart-3: #6b5ce0;
  --grid-line: #ecebe7;
  --good: #12764f;
  --bad: #c3341f;
  --good-soft: #e3f3ea;
  --bad-soft: #fbebe8;
  --warn: #93590a;
  --warn-soft: #fbf1dd;
  --heat: 107, 92, 224;
  --shadow-card: 0 1px 2px #1212120a;
  --shadow-pop: 0 24px 60px -24px #12121244;
  --radius: 16px;
  font-family: Geist, ui-sans-serif, system-ui, "Segoe UI", sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0c0c0d; --surface: #141416; --surface-2: #1a1a1d; --surface-3: #232327;
    --line: #252529; --line-strong: #36363c;
    --text: #f1f1ef; --text-2: #a5a49f; --text-3: #76756f;
    --ink: #f1f1ef; --ink-text: #0c0c0d;
    --accent: #f0493b; --accent-soft: #f0493b22;
    --mod: #261d47; --mod-accent: #b6a9ff; --mod-muted: #f2effc90; --mod-hover: #f2effc10; --mod-line: #f2effc18;
    --chart-1: #f0493b; --chart-2: #57575e; --chart-3: #9a8ff5; --grid-line: #212125;
    --good: #43c592; --bad: #ff705c; --good-soft: #43c5921f; --bad-soft: #ff705c1f; --warn: #eeb04c; --warn-soft: #eeb04c1f;
    --heat: 154, 143, 245;
    --shadow-card: 0 1px 2px #0007; --shadow-pop: 0 24px 60px -24px #000d;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0c0c0d; --surface: #141416; --surface-2: #1a1a1d; --surface-3: #232327;
  --line: #252529; --line-strong: #36363c;
  --text: #f1f1ef; --text-2: #a5a49f; --text-3: #76756f;
  --ink: #f1f1ef; --ink-text: #0c0c0d;
  --accent: #f0493b; --accent-soft: #f0493b22;
  --mod: #261d47; --mod-accent: #b6a9ff; --mod-muted: #f2effc90; --mod-hover: #f2effc10; --mod-line: #f2effc18;
  --chart-1: #f0493b; --chart-2: #57575e; --chart-3: #9a8ff5; --grid-line: #212125;
  --good: #43c592; --bad: #ff705c; --good-soft: #43c5921f; --bad-soft: #ff705c1f; --warn: #eeb04c; --warn-soft: #eeb04c1f;
  --heat: 154, 143, 245;
  --shadow-card: 0 1px 2px #0007; --shadow-pop: 0 24px 60px -24px #000d;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--text); font-size: 14px; line-height: 1.45; -webkit-font-smoothing: antialiased; }
h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -0.02em; }
button, input, select { font: inherit; color: inherit; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
* { scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
select option { background: var(--surface); color: var(--text); }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--text-3); }
svg.ic { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---------------- shell ---------------- */
.shell { display: grid; grid-template-columns: 252px minmax(0, 1fr); min-height: 100vh; transition: grid-template-columns .2s ease; }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 14px; padding: 16px 12px 14px;
  background: var(--surface); border-right: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 6px 6px; }
.monogram { width: 34px; height: 34px; flex: none; border-radius: 10px; display: grid; place-items: center;
  background: var(--mod); color: var(--mod-fg); font-weight: 700; font-size: 13px; letter-spacing: .02em; }
.monogram svg { width: 20px; height: 20px; }
.brand-text { min-width: 0; }
.brand-text strong { display: block; font-size: 14.5px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.15; }
.brand-text span { display: block; margin-top: 3px; font-size: 10.5px; font-weight: 500; letter-spacing: .07em; text-transform: uppercase; color: var(--text-3); white-space: nowrap; }
.collapse-btn { margin-left: auto; width: 30px; height: 30px; flex: none; display: grid; place-items: center; border: 0; border-radius: 8px;
  background: none; color: var(--text-3); cursor: pointer; }
.collapse-btn:hover { background: var(--surface-2); color: var(--text); }

.nav { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; }
.nav-group { background: var(--mod); color: var(--mod-fg); border-radius: 14px; padding: 6px; display: flex; flex-direction: column; gap: 2px; }
.nav-head { display: flex; align-items: center; gap: 8px; height: 34px; padding: 0 12px; font-size: 11.5px; font-weight: 700;
  letter-spacing: .07em; text-transform: uppercase; }
.dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--mod-accent); flex: none; }
.nav a { display: flex; align-items: center; gap: 12px; height: 40px; padding: 0 12px; border-radius: 10px; color: var(--mod-muted);
  text-decoration: none; font-weight: 500; white-space: nowrap; transition: background .12s, color .12s; }
.nav a:hover, .nav a.active { background: var(--mod-hover); color: var(--mod-fg); }
.nav a.active svg { color: var(--mod-accent); }

.sidebar-foot { display: flex; flex-direction: column; gap: 10px; padding: 12px 4px 0; border-top: 1px solid var(--line); }
.data-info { margin: 0 4px; font-size: 11.5px; color: var(--text-3); }
.data-info b { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 500; color: var(--text); }
.data-info b i { width: 7px; height: 7px; border-radius: 50%; background: var(--good); }
.data-info span { display: block; padding-left: 15px; }
.foot-actions { display: flex; gap: 6px; }
.foot-actions .btn:first-child { flex: 1; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 36px; padding: 0 12px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--surface); color: var(--text); font-size: 13px; font-weight: 500; white-space: nowrap;
  cursor: pointer; box-shadow: var(--shadow-card); text-decoration: none; transition: border-color .12s, background .12s; }
.btn:hover { border-color: var(--line-strong); }
.btn svg { width: 16px; height: 16px; }
.btn.ghost { background: transparent; color: var(--text-2); box-shadow: none; }
.btn.ghost:hover { background: var(--surface-2); color: var(--text); }
.btn.icon { width: 36px; padding: 0; flex: none; }
.btn.dark { background: var(--ink); color: var(--ink-text); border-color: var(--ink); }
.btn.sm { height: 30px; font-size: 12.5px; padding: 0 10px; }

.shell.collapsed { grid-template-columns: 72px minmax(0, 1fr); }
.shell.collapsed .sidebar { padding-inline: 10px; overflow: hidden; }
.shell.collapsed .brand { flex-direction: column; padding: 0; gap: 12px; }
.shell.collapsed .brand-text, .shell.collapsed .nav a span, .shell.collapsed .nav-head span,
.shell.collapsed .data-info, .shell.collapsed .foot-actions .btn span { display: none; }
.shell.collapsed .collapse-btn { margin: 0; }
.shell.collapsed .nav-head { justify-content: center; padding: 0; height: 22px; }
.shell.collapsed .nav a { justify-content: center; padding: 0; }
.shell.collapsed .foot-actions { flex-direction: column; }
.shell.collapsed .foot-actions .btn { padding: 0; }

.main { min-width: 0; }
.main > .page-head, .main > .content { max-width: 1440px; margin-inline: auto; }

/* ---------------- top bar ---------------- */
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 10px; height: 62px; padding: 0 32px;
  background: color-mix(in srgb, var(--bg) 86%, transparent); backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
.chips { flex: 1; min-width: 0; display: flex; align-items: center; justify-content: flex-end; gap: 6px; overflow-x: auto; scrollbar-width: none; padding: 2px; }
.chips::-webkit-scrollbar { display: none; }
.chip-label { flex: none; font-size: 11px; color: var(--text-3); margin-right: 2px; }
.chip { flex: none; height: 28px; padding: 0 11px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--text-2);
  font-size: 10.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; cursor: pointer; }
.chip:hover { color: var(--text); border-color: var(--line-strong); }
.chip.on { background: var(--ink); color: var(--ink-text); border-color: var(--ink); }
.chip-sep { flex: none; width: 1px; height: 18px; background: var(--line); margin: 0 6px; }
.menu-btn { display: none; }

/* ---------------- page header ---------------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; padding: 24px 32px 4px; }
.eyebrow { display: flex; align-items: center; gap: 8px; margin: 0 0 4px; font-size: 11px; font-weight: 600; letter-spacing: .16em;
  text-transform: uppercase; color: var(--text-3); }
.page-head h1 { font-size: 26px; line-height: 1.25; letter-spacing: -0.025em; }
.subtitle { margin: 4px 0 0; font-size: 13px; color: var(--text-2); }
.head-right { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.ref-pill { display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--surface); color: var(--text-2); font-size: 12.5px; box-shadow: var(--shadow-card); white-space: nowrap; }
.ref-pill svg { width: 15px; height: 15px; }
.ref-pill b { color: var(--text); font-weight: 600; }

.content { padding: 20px 32px 48px; }
.notice { font-size: 12.5px; color: var(--warn); background: var(--warn-soft); border-radius: 10px; padding: 8px 12px; margin: 0 0 16px; }

/* ---------------- KPI strip (module colour, single block with hairline dividers) ---------------- */
.kpi-strip { display: grid; gap: 1px; background: var(--mod-line); border-radius: 14px; overflow: hidden; margin-bottom: 16px;
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--mod-accent) 22%, transparent); }
.kpi-strip.k5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.kpi-strip.k4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.kpi { background: var(--mod); color: var(--mod-fg); padding: 14px 18px 16px; min-width: 0; display: flex; flex-direction: column; }
.kpi h3 { font-size: 11px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--mod-muted); margin-bottom: 6px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi .value { font-size: 27px; font-weight: 600; letter-spacing: -0.03em; line-height: 1.12; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
.kpi .value small { font-size: 13px; font-weight: 500; color: var(--mod-muted); letter-spacing: 0; }
.kpi .meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-top: auto; padding-top: 8px; font-size: 12px; color: var(--mod-muted); }
.kpi .meta b { color: var(--mod-fg); font-weight: 600; font-variant-numeric: tabular-nums; }
.delta { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums;
  background: var(--surface-2); color: var(--text-2); }
.delta.up { background: var(--good-soft); color: var(--good); }
.delta.down { background: var(--bad-soft); color: var(--bad); }
.delta.up::before { content: "▲ "; font-size: 9px; }
.delta.down::before { content: "▼ "; font-size: 9px; }
.kpi .delta { background: var(--mod-hover); color: var(--mod-muted); }
.kpi .delta.up { background: #43c59226; color: #74e2b6; }
.kpi .delta.down { background: #ff705c26; color: #ffa092; }
.kpi .bar { height: 5px; border-radius: 3px; background: var(--mod-hover); margin-top: 10px; overflow: hidden; }
.kpi .bar i { display: block; height: 100%; background: var(--mod-accent); border-radius: 3px; }

/* ---------------- cards ---------------- */
.grid { display: grid; gap: 16px; margin-bottom: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-wide { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow-card); min-width: 0; margin-bottom: 16px; }
.grid > .card { margin-bottom: 0; }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; gap: 10px 12px; margin-bottom: 14px; }
.card-title { flex: 1 1 200px; min-width: 0; }
.card-title h2 { font-size: 15px; line-height: 1.35; letter-spacing: -0.01em; }
.card-title p { margin: 2px 0 0; font-size: 12.5px; color: var(--text-3); }
.card-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.chart { position: relative; height: 260px; }
.chart.tall { height: 340px; }
.chart.short { height: 210px; }
.note { font-size: 12px; color: var(--text-3); margin: 10px 0 0; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12px; color: var(--text-2); margin-bottom: 8px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }

.seg { display: inline-flex; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 3px; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.seg button { border: 0; background: none; color: var(--text-2); padding: 5px 12px; border-radius: 7px; cursor: pointer; font-size: 13px; font-weight: 500; white-space: nowrap; }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px #12121218; }

.callouts { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 10px; margin-bottom: 16px; }
.callout { display: flex; flex-direction: column; gap: 3px; padding: 12px 14px; text-align: left; cursor: pointer; text-decoration: none;
  border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: 0 10px 10px 0; background: var(--surface); color: var(--text); }
.callout:hover { background: var(--surface-2); }
.callout b { font-size: 14px; font-weight: 600; letter-spacing: -0.01em; }
.callout span { font-size: 12px; color: var(--text-3); }

.how { margin: 4px 0 24px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.how summary { list-style: none; cursor: pointer; padding: 14px 20px; font-size: 14px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.how summary::-webkit-details-marker { display: none; }
.how summary span { color: var(--text-3); transition: transform .15s; }
.how[open] summary span { transform: rotate(45deg); }
.how ul { margin: 0; padding: 0 20px 16px; list-style: none; display: grid; gap: 8px; }
.how li { position: relative; padding-left: 16px; font-size: 13px; color: var(--text-2); }
.how li::before { content: ""; position: absolute; left: 2px; top: .6em; width: 5px; height: 5px; border-radius: 50%; background: var(--mod-accent); }

/* ---------------- tables ---------------- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; }
.table th { text-align: left; font-size: 10.5px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--text-3);
  padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: var(--surface-2); }
.table .r { text-align: right; }
.table th.sortable { cursor: pointer; }
.table th.sortable:hover { color: var(--text); }
.table th.sorted { color: var(--text); }
.tag { display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 500;
  background: var(--surface-2); color: var(--text); }
.tag i { width: 8px; height: 8px; border-radius: 50%; }
.abc-tag { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 6px; font-size: 11.5px; font-weight: 700; color: #fff; }
.mini-bar { height: 6px; border-radius: 3px; background: var(--surface-3); overflow: hidden; min-width: 60px; }
.mini-bar i { display: block; height: 100%; border-radius: 3px; }

/* ---------------- region cards ---------------- */
.region-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.region-card { display: grid; gap: 4px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface);
  text-align: left; cursor: pointer; transition: border-color .12s; }
.region-card:hover { border-color: var(--line-strong); }
.region-card.on { border-color: var(--text); box-shadow: inset 0 0 0 1px var(--text); }
.region-card span { font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); }
.region-card b { font-size: 20px; font-weight: 600; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.region-card small { font-size: 12px; color: var(--text-3); }

/* ---------------- RFV ---------------- */
.rfv-layout { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 24px; align-items: start; }
.rfv-grid { display: grid; grid-template-columns: 74px repeat(5, minmax(0, 1fr)); gap: 5px; }
.rfv-axis { font-size: 11.5px; color: var(--text-3); display: flex; align-items: center; justify-content: center; text-align: center; font-weight: 500; }
.rfv-axis.row { justify-content: flex-start; text-align: left; line-height: 1.25; }
.rfv-cell { position: relative; min-height: 72px; border: 0; border-radius: 10px; padding: 8px; cursor: pointer; text-align: left; color: #fff;
  display: flex; flex-direction: column; justify-content: space-between; transition: transform .1s, opacity .15s; }
.rfv-cell:hover { transform: scale(1.03); }
.rfv-cell b { font-size: 17px; font-weight: 600; font-variant-numeric: tabular-nums; }
.rfv-cell small { font-size: 11px; opacity: .85; }
.rfv-cell.dim { opacity: .28; }
.rfv-cell.sel { outline: 2px solid var(--text); outline-offset: 2px; }
.rfv-caption { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--text-3); margin-top: 8px; padding-left: 79px; }
.seg-list { display: grid; gap: 4px; }
.seg-row { display: grid; grid-template-columns: minmax(110px, 1.1fr) minmax(0, 1.4fr) 62px 60px; gap: 10px; align-items: center; padding: 7px 8px;
  border: 1px solid transparent; border-radius: 10px; background: none; cursor: pointer; text-align: left; font-size: 13px; }
.seg-row:hover { background: var(--surface-2); }
.seg-row.on { border-color: var(--text); }
.seg-row .name { display: flex; align-items: center; gap: 8px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.seg-row .name i { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.seg-row .r { text-align: right; font-variant-numeric: tabular-nums; }
.seg-row .r small { display: block; font-size: 11px; color: var(--text-3); }
.seg-head { display: grid; grid-template-columns: minmax(110px, 1.1fr) minmax(0, 1.4fr) 62px 60px; gap: 10px; padding: 0 8px 6px; font-size: 11px; color: var(--text-3); border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.seg-head span:nth-child(n+3) { text-align: right; }
.vmix { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.vmix-item { border: 1px solid var(--line); border-radius: 12px; padding: 12px; display: grid; gap: 4px; }
.vmix-item span { font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); }
.vmix-item b { font-size: 20px; font-weight: 600; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.vmix-item small { font-size: 12px; color: var(--text-3); }
.seg-detail { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr); gap: 20px; }
.seg-about h3 { display: flex; align-items: center; gap: 10px; font-size: 18px; }
.seg-about h3 i { width: 12px; height: 12px; border-radius: 4px; }
.seg-about p { margin: 8px 0 0; color: var(--text-2); font-size: 13px; }
.seg-about .action { margin-top: 12px; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); font-size: 13px; }
.seg-about .action b { display: block; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); margin-bottom: 2px; }
.stat-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 14px; }
.stat-row div { border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; }
.stat-row span { display: block; font-size: 11px; color: var(--text-3); }
.stat-row b { font-size: 16px; font-weight: 600; font-variant-numeric: tabular-nums; }
.empty { display: grid; place-items: center; gap: 6px; text-align: center; padding: 28px 12px; color: var(--text-3); font-size: 13px; }
.empty b { color: var(--text); font-size: 15px; }
.shortcut-list { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-top: 8px; }

/* ---------------- funnel ---------------- */
.funnel { display: grid; gap: 8px; }
.funnel-row { display: grid; grid-template-columns: 170px minmax(0, 1fr) 150px; gap: 14px; align-items: center; }
.funnel-name b { display: block; font-size: 14px; font-weight: 600; }
.funnel-name span { font-size: 11.5px; color: var(--text-3); }
.funnel-track { height: 42px; display: flex; justify-content: center; }
.funnel-bar { height: 100%; border-radius: 10px; min-width: 6px; display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 600; font-variant-numeric: tabular-nums; font-size: 14px; }
.funnel-rate { text-align: right; font-size: 12px; color: var(--text-3); }
.funnel-rate b { display: block; font-size: 15px; color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }

/* ---------------- cohort heatmap ---------------- */
.cohort td.cell { text-align: center; min-width: 46px; font-size: 12px; padding: 7px 4px; border-bottom: 2px solid var(--surface); }
.cohort td.cell.na { color: transparent; background: none !important; }

/* ---------------- tile map ---------------- */
.map-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; align-items: start; }
.map-layout > div, .rfv-layout > div { min-width: 0; }
.tile-map { width: 100%; max-width: 480px; height: auto; display: block; margin: 0 auto; }
.tile-map .bgtile { fill: var(--surface-2); }
.tile-map .tile { cursor: pointer; }
.tile-map .tile:hover .bgtile { stroke: var(--text-2); stroke-width: 1.5; }
.tile-map .tile.sel .bgtile { stroke: var(--text); stroke-width: 2.5; }
.tile-map .tile.dim { opacity: .35; }
.tile-map text { font-family: inherit; pointer-events: none; }
.tile-map .uf { font-size: 13px; font-weight: 700; }
.tile-map .val { font-size: 10.5px; font-weight: 500; }
.tile-map .lt { fill: #fff; }
.tile-map .dk { fill: var(--text); }
.map-scale { display: flex; align-items: center; gap: 8px; font-size: 11.5px; color: var(--text-3); justify-content: center; margin-top: 10px; }
.map-scale i { width: 140px; height: 8px; border-radius: 4px; }
.region-list { display: grid; gap: 4px; }
.region-row { display: grid; grid-template-columns: minmax(100px, 1fr) minmax(0, 1.4fr) 76px 64px; gap: 10px; align-items: center; padding: 8px;
  border: 1px solid transparent; border-radius: 10px; background: none; cursor: pointer; text-align: left; font-size: 13px; }
.region-row:hover { background: var(--surface-2); }
.region-row.on { border-color: var(--text); }
.region-row .r { text-align: right; font-variant-numeric: tabular-nums; }

/* ---------------- customer list ---------------- */
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 12px; }
.search { flex: 1 1 260px; display: flex; align-items: center; gap: 8px; height: 38px; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--surface); box-shadow: var(--shadow-card); color: var(--text-3); }
.search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--text); font-size: 13.5px; }
.select { height: 38px; padding: 0 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--text); font-size: 13px; font-weight: 500; }
.pills { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.pill { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--surface); color: var(--text-2); font-size: 12.5px; font-weight: 500; cursor: pointer; }
.pill i { width: 8px; height: 8px; border-radius: 50%; }
.pill small { color: var(--text-3); font-size: 11px; }
.pill:hover { border-color: var(--line-strong); color: var(--text); }
.pill.on { background: var(--ink); border-color: var(--ink); color: var(--ink-text); }
.pill.on small { color: inherit; opacity: .7; }
.pager { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 12px; font-size: 12.5px; color: var(--text-3); }
.pager div { display: flex; gap: 6px; }

/* ---------------- responsive ---------------- */
@media (max-width: 1280px) {
  .kpi-strip.k5 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .g3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .vmix { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 1100px) {
  .rfv-layout, .map-layout, .seg-detail, .g-wide { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .shell, .shell.collapsed { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; flex-direction: column; border-right: 0; border-bottom: 1px solid var(--line); }
  .shell .sidebar .nav { flex: none; }
  .shell:not(.menu-open) .nav, .shell:not(.menu-open) .sidebar-foot { display: none; }
  .collapse-btn { display: none; }
  .menu-btn { display: grid; margin-left: auto; }
  .shell.collapsed .brand { flex-direction: row; }
  .shell.collapsed .brand-text, .shell.collapsed .nav a span, .shell.collapsed .nav-head span { display: block; }
  .topbar { padding: 0 16px; position: static; }
  .page-head { padding: 18px 16px 4px; flex-direction: column; align-items: flex-start; }
  .content { padding: 16px 16px 40px; }
  .kpi-strip.k5, .kpi-strip.k4, .g2, .g3 { grid-template-columns: 1fr 1fr; }
  .funnel-row { grid-template-columns: 1fr; gap: 4px; }
  .funnel-rate { text-align: left; }
}
@media (max-width: 560px) {
  .kpi-strip.k5, .kpi-strip.k4, .g2, .g3, .vmix { grid-template-columns: 1fr; }
  .seg-row, .seg-head { grid-template-columns: minmax(100px, 1fr) 62px 56px; }
  .seg-row .mini-bar, .seg-head span:nth-child(2) { display: none; }
  .region-row { grid-template-columns: minmax(90px, 1fr) 76px 60px; }
  .region-row .mini-bar { display: none; }
  .rfv-grid { grid-template-columns: 54px repeat(5, minmax(0, 1fr)); gap: 3px; }
  .rfv-cell { min-height: 52px; padding: 5px; }
  .rfv-cell b { font-size: 13px; }
  .rfv-cell small { display: none; }
  .rfv-caption { padding-left: 57px; }
}
