/* Inventory Flow Analytics - portfolio demo (Demo Retail Co., fictional).
   Layout: fixed sidebar + sticky top bar + page header + KPI strip + content cards. */

:root {
  color-scheme: light;
  --bg: #f6f6f4;
  --panel: #ffffff;
  --panel-2: #f1f1ef;
  --panel-3: #e8e8e5;
  --line: #e4e4e0;
  --line-strong: #d0d0cb;
  --ink: #141414;
  --ink-2: #5a5a56;
  --ink-3: #8a8a85;
  --solid: #151515;
  --solid-ink: #ffffff;
  --accent: #d6293d;
  --accent-soft: #fcebed;
  --nav: #173430;
  --nav-ink: #eef5f2;
  --nav-dot: #63cbb4;
  --nav-muted: #eef5f299;
  --nav-hover: #eef5f214;
  --s1: #d6293d;
  --s2: #c8c8c3;
  --s3: #2f8f7d;
  --grid: #ececea;
  --axis: #d0d0cb;
  --ok: #12704e;
  --ok-soft: #e4f3ec;
  --warn: #965804;
  --warn-soft: #fbf1de;
  --bad: #c03421;
  --bad-soft: #fbebe8;
  --cov-low: #e5f8e1;
  --cov-mid: #fff8de;
  --cov-high: #f7d3d6;
  --shadow-card: 0 1px 2px #1010100a;
  --shadow: 0 1px 2px #1010100a, 0 8px 24px -12px #1010101f;
  --shadow-lg: 0 24px 64px -24px #10101047;
  --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; --panel: #141416; --panel-2: #1a1a1d; --panel-3: #232327;
    --line: #25252a; --line-strong: #36363c;
    --ink: #f2f2f1; --ink-2: #a5a5a1; --ink-3: #76766f;
    --solid: #f2f2f1; --solid-ink: #0c0c0d;
    --accent: #ef3d50; --accent-soft: #ef3d5022;
    --nav: #18332f; --nav-dot: #72d8c1; --nav-muted: #eef5f290; --nav-hover: #eef5f210;
    --s1: #ef3d50; --s2: #5d5d64; --s3: #4fc0a8; --grid: #202024; --axis: #36363c;
    --ok: #41c591; --ok-soft: #41c5911f; --warn: #eeb04c; --warn-soft: #eeb04c1f; --bad: #ff6f5b; --bad-soft: #ff6f5b1f;
    --cov-low: #1e3a22; --cov-mid: #3a3520; --cov-high: #4a2328;
    --shadow-card: 0 1px 2px #0006; --shadow: 0 1px 2px #0006, 0 8px 24px -12px #0009; --shadow-lg: 0 24px 64px -24px #000c;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0c0c0d; --panel: #141416; --panel-2: #1a1a1d; --panel-3: #232327;
  --line: #25252a; --line-strong: #36363c;
  --ink: #f2f2f1; --ink-2: #a5a5a1; --ink-3: #76766f;
  --solid: #f2f2f1; --solid-ink: #0c0c0d;
  --accent: #ef3d50; --accent-soft: #ef3d5022;
  --nav: #18332f; --nav-dot: #72d8c1; --nav-muted: #eef5f290; --nav-hover: #eef5f210;
  --s1: #ef3d50; --s2: #5d5d64; --s3: #4fc0a8; --grid: #202024; --axis: #36363c;
  --ok: #41c591; --ok-soft: #41c5911f; --warn: #eeb04c; --warn-soft: #eeb04c1f; --bad: #ff6f5b; --bad-soft: #ff6f5b1f;
  --cov-low: #1e3a22; --cov-mid: #3a3520; --cov-high: #4a2328;
  --shadow-card: 0 1px 2px #0006; --shadow: 0 1px 2px #0006, 0 8px 24px -12px #0009; --shadow-lg: 0 24px 64px -24px #000c;
}

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

/* ------------------------------------------------ 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(--panel); border-right: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 6px; }
.monogram { width: 34px; height: 34px; flex: none; border-radius: 10px; display: grid; place-items: center;
  background: var(--solid); color: var(--solid-ink); font-weight: 700; font-size: 13px; letter-spacing: -0.02em; }
.brand-text { min-width: 0; }
.brand-text strong { display: block; font-size: 14.5px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.1; }
.brand-text span { display: block; margin-top: 4px; font-size: 10.5px; font-weight: 500; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); }
.collapse-btn { margin-left: auto; width: 30px; height: 30px; display: inline-grid; place-items: center; border: 0; border-radius: 8px;
  background: transparent; color: var(--ink-3); cursor: pointer; flex: none; }
.collapse-btn:hover { background: var(--panel-2); color: var(--ink); }
.nav { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; }
.nav-module { background: var(--nav); color: var(--nav-ink); border-radius: 14px; padding: 6px; display: flex; flex-direction: column; gap: 2px; }
.nav-head { display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 12px; font-size: 11.5px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .06em; }
.dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--nav-dot); flex: none; }
.nav a { display: flex; align-items: center; gap: 12px; height: 40px; padding: 0 12px; border-radius: 10px; color: var(--nav-muted);
  text-decoration: none; font-weight: 500; white-space: nowrap; transition: background .12s, color .12s; }
.nav a:hover, .nav a.active { background: var(--nav-hover); color: var(--nav-ink); }
.nav a.active .icon { color: var(--nav-dot); }
.nav-badge { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; font-size: 11px; font-weight: 700;
  display: inline-grid; place-items: center; background: var(--accent); color: #fff; }
.side-foot { display: flex; flex-direction: column; gap: 10px; padding: 12px 6px 0; border-top: 1px solid var(--line); }
.side-foot .status { margin: 0 4px; font-size: 11.5px; line-height: 1.5; color: var(--ink-3); }
.side-foot .status b { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 500; color: var(--ink); }
.side-foot .status span { display: block; padding-left: 15px; }
.ok-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); flex: none; }
.foot-btns { display: flex; gap: 6px; }
.foot-btns .btn:first-child { flex: 1; }
.shell.collapsed { grid-template-columns: 72px minmax(0, 1fr); }
.shell.collapsed .sidebar { padding: 16px 10px 14px; overflow: hidden; }
.shell.collapsed .brand { flex-direction: column; gap: 12px; padding: 0; }
.shell.collapsed .brand-text, .shell.collapsed .nav a span, .shell.collapsed .nav-head span, .shell.collapsed .nav-badge,
.shell.collapsed .side-foot .status, .shell.collapsed .side-foot .btn span { display: none; }
.shell.collapsed .collapse-btn { margin: 0; }
.shell.collapsed .nav-head { justify-content: center; padding: 0; height: 24px; }
.shell.collapsed .nav a { justify-content: center; padding: 0; }
.shell.collapsed .foot-btns { flex-direction: column; }

/* ------------------------------------------------ buttons */
.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(--panel); color: var(--ink); font-size: 13px; font-weight: 500; cursor: pointer;
  white-space: nowrap; box-shadow: var(--shadow-card); transition: border-color .12s, background .12s; }
.btn:hover { border-color: var(--line-strong); }
.btn:disabled { opacity: .5; cursor: default; }
.btn .icon { width: 16px; height: 16px; }
.btn.dark { background: var(--solid); color: var(--solid-ink); border-color: var(--solid); }
.btn.ghost { background: transparent; color: var(--ink-2); box-shadow: none; }
.btn.ghost:hover { background: var(--panel-2); color: var(--ink); }
.btn.square { width: 36px; padding: 0; flex: none; }
.pill-btn { border: 1px solid var(--line); background: var(--panel-2); color: var(--ink-2); cursor: pointer; font-size: 12px; font-weight: 500;
  padding: 3px 10px; border-radius: 999px; white-space: nowrap; }
.pill-btn:hover { color: var(--ink); border-color: var(--line-strong); }
.text-link { border: 0; background: none; padding: 0; font-weight: 600; color: var(--ink); cursor: pointer; text-align: left; }
.text-link:hover { color: var(--accent); text-decoration: underline; }

/* ------------------------------------------------ top bar + filters */
.main { min-width: 0; }
.main > .page-head, .main > .kpis, .main > .content { max-width: 1440px; margin-inline: auto; }
.topbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 12px; height: 64px; padding: 0 32px;
  background: color-mix(in srgb, var(--bg) 86%, transparent); backdrop-filter: blur(16px); border-bottom: 1px solid var(--line); }
.quick { flex: 1; min-width: 0; display: flex; align-items: center; justify-content: flex-end; gap: 6px; overflow-x: auto; scrollbar-width: none; padding: 2px; }
.quick::-webkit-scrollbar { display: none; }
.quick-chip { flex: none; height: 28px; padding: 0 10px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel);
  color: var(--ink-2); font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; cursor: pointer; }
.quick-chip:hover { color: var(--ink); border-color: var(--line-strong); }
.quick-chip.on { background: var(--solid); color: var(--solid-ink); border-color: var(--solid); }
.quick-sep { flex: none; width: 1px; height: 18px; background: var(--line); margin: 0 4px; }
.filter-btn .count { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--accent); color: #fff;
  font-size: 10.5px; font-weight: 700; display: inline-grid; place-items: center; }
.filter-panel { position: absolute; top: calc(100% + 8px); right: 32px; width: min(780px, calc(100vw - 32px)); z-index: 40;
  background: var(--panel); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-lg); padding: 16px; }
.fp-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 12px; }
.fp-head b { font-size: 15px; font-weight: 600; }
.fp-head span { font-size: 12px; color: var(--ink-3); }
.fp-close { margin-left: auto; width: 28px; height: 28px; border: 0; border-radius: 8px; background: none; color: var(--ink-3); cursor: pointer; }
.fp-close:hover { background: var(--panel-2); color: var(--ink); }
.fp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; }
.fp-foot { display: flex; justify-content: space-between; gap: 8px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.fsel { position: relative; min-width: 0; }
.fsel > button { width: 100%; height: 44px; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 4px 10px;
  text-align: left; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); cursor: pointer; box-shadow: var(--shadow-card); }
.fsel > button:hover { border-color: var(--line-strong); }
.fsel .lbl { display: block; font-size: 11px; color: var(--ink-3); }
.fsel .val { display: block; font-size: 13px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fsel .caret { color: var(--ink-3); font-size: 10px; }
.fsel > button > span:first-child { min-width: 0; }
.fsel.on > button { border-color: var(--accent); background: var(--accent-soft); }
.fsel.on .lbl { color: var(--accent); }
.pop { position: absolute; top: calc(100% + 6px); left: 0; z-index: 45; width: 290px; max-height: 380px; display: flex; flex-direction: column;
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lg); overflow: hidden; }
.pop input[type=search] { margin: 8px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel-2); outline: none; }
.pop .opts { overflow: auto; padding: 0 6px 6px; }
.pop label { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 6px; cursor: pointer; font-size: 13px; }
.pop label:hover { background: var(--panel-2); }
.pop label small { margin-left: auto; color: var(--ink-3); font-size: 11px; }
.pop input[type=checkbox] { accent-color: var(--accent); }
.pop .pop-foot { display: flex; justify-content: space-between; padding: 8px 10px; border-top: 1px solid var(--line); }
.pop .pop-foot button { border: 0; background: none; color: var(--ink-2); cursor: pointer; padding: 4px 6px; font-weight: 500; }
.pop .pop-foot button.go { color: var(--accent); }

/* ------------------------------------------------ page header + KPIs */
.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; text-transform: uppercase;
  letter-spacing: .16em; color: var(--ink-3); }
.page-head h1 { font-size: 26px; line-height: 1.25; letter-spacing: -0.025em; }
.page-head .subtitle { margin: 4px 0 0; font-size: 13px; color: var(--ink-2); }
.ref-month { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 10px 0 12px; border: 1px solid var(--line);
  border-radius: 10px; background: var(--panel); color: var(--ink-2); box-shadow: var(--shadow-card); flex: none; }
.ref-month select { border: 0; background: var(--panel); color: var(--ink); font-size: 13px; font-weight: 500; outline: none; cursor: pointer; }
.kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; padding: 20px 32px 0; }
.kpi { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; min-height: 128px;
  display: flex; flex-direction: column; box-shadow: var(--shadow-card); text-align: left; min-width: 0; }
button.kpi { cursor: pointer; transition: border-color .12s, transform .12s; }
button.kpi:hover { border-color: var(--line-strong); transform: translateY(-1px); }
.kpi h3 { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .1em; color: var(--ink-3); margin-bottom: 10px; }
.kpi .value { font-size: 28px; font-weight: 600; line-height: 1.1; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.kpi .value small { font-size: 13px; font-weight: 500; color: var(--ink-3); letter-spacing: 0; }
.kpi .foot { margin-top: auto; padding-top: 8px; font-size: 12px; color: var(--ink-3); }
.kpi .rows { display: grid; gap: 2px; margin-top: 8px; font-size: 12px; color: var(--ink-2); }
.kpi .rows div { display: flex; justify-content: space-between; }
.kpi .rows b { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.delta { display: inline-block; padding: 2px 7px; border-radius: 999px; background: var(--panel-2); color: var(--ink); font-weight: 500; margin-right: 4px; font-variant-numeric: tabular-nums; }
.delta.up::before { content: "▲ "; font-size: 9px; }
.delta.down::before { content: "▼ "; font-size: 9px; }
.meter { height: 6px; margin-top: 12px; border-radius: 3px; background: var(--panel-3); overflow: hidden; }
.meter > div { height: 100%; border-radius: 3px; background: var(--accent); }

/* ------------------------------------------------ content cards */
.content { padding: 24px 32px 48px; }
.grid { display: grid; gap: 16px; margin-bottom: 16px; }
.c2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.c3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.c4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow-card); min-width: 0; }
.card.block { margin-bottom: 16px; }
.card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.card h2 { font-size: 15px; line-height: 1.6; letter-spacing: -0.01em; }
.note { font-size: 12px; color: var(--ink-3); margin: 10px 0 0; line-height: 1.5; }
.card-head .note { margin-top: 2px; }
.section-title { font-size: 18px; letter-spacing: -0.02em; margin: 28px 0 12px; }
.chart { position: relative; height: 260px; }
.chart.tall { height: 340px; }
.chart.short { height: 210px; }
.chart-off { height: 100%; display: grid; place-items: center; color: var(--ink-3); font-size: 13px; border: 1px dashed var(--line); border-radius: 12px; text-align: center; padding: 12px; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12px; color: var(--ink-2); margin-bottom: 8px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.legend i.dash { height: 0; border-top: 2px dashed; border-radius: 0; vertical-align: 3px; width: 14px; }
.seg { display: inline-flex; background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; padding: 3px; flex-wrap: wrap; }
.seg button { border: 0; background: none; color: var(--ink-2); padding: 5px 12px; border-radius: 7px; cursor: pointer; font-size: 13px; font-weight: 500; }
.seg button.on { background: var(--panel); color: var(--ink); box-shadow: 0 1px 2px #10101014; }
.big-number { font-size: 34px; font-weight: 600; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.head-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

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

/* composition row */
.comp-row { display: grid; grid-template-columns: minmax(220px, .8fr) minmax(0, 1.3fr) minmax(0, 1.4fr); gap: 16px; margin-bottom: 16px; }
.stat-big { font-size: 30px; font-weight: 600; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.stat-lines { display: grid; gap: 6px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); font-size: 13px; }
.stat-lines div { display: flex; justify-content: space-between; }
.stat-lines span { color: var(--ink-2); }
.spark-list { display: grid; gap: 2px; }
.spark-head, .spark-row { display: grid; grid-template-columns: minmax(80px, 1fr) minmax(70px, 110px) 78px 66px; gap: 8px; align-items: center; }
.spark-head { font-size: 11px; color: var(--ink-3); padding: 0 6px 6px; border-bottom: 1px solid var(--line); }
.spark-head span:nth-child(n+3), .spark-row > :nth-child(n+3) { text-align: right; font-variant-numeric: tabular-nums; }
.spark-row { padding: 6px; border-radius: 8px; font-size: 13px; }
.spark-row:hover { background: var(--panel-2); }
.spark { display: block; width: 100%; height: 28px; overflow: visible; }

/* ranking (Top 10) */
.rank { display: grid; gap: 4px; }
.rank-row { display: grid; grid-template-columns: 28px minmax(150px, 1.4fr) minmax(0, 2fr) 110px; gap: 12px; align-items: center; padding: 6px;
  border-radius: 8px; font-size: 13px; cursor: pointer; border: 0; background: none; text-align: left; width: 100%; }
.rank-row:hover { background: var(--panel-2); }
.rank-pos { width: 24px; height: 24px; border-radius: 7px; display: grid; place-items: center; font-size: 12px; font-weight: 700; background: var(--panel-2); color: var(--ink-2); }
.rank-row:nth-child(-n+3) .rank-pos { background: var(--solid); color: var(--solid-ink); }
.rank-name { min-width: 0; }
.rank-name b, .rank-name span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-name span { font-size: 11px; color: var(--ink-3); }
.rank-val { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.rank-val small { display: block; font-size: 11px; font-weight: 400; color: var(--ink-3); }

/* bars in lists */
.bar-track { height: 12px; }
.bar-track > span { display: block; height: 100%; min-width: 2px; border-radius: 0 4px 4px 0; }
.bar-total { background: color-mix(in srgb, var(--s1) 28%, transparent); overflow: hidden; }
.bar-fill { background: var(--s1); }
.bar-list { display: grid; gap: 2px; max-height: 720px; overflow-y: auto; padding-right: 4px; }
.bar-row { display: grid; grid-template-columns: minmax(120px, 1.2fr) minmax(0, 2fr) 96px; gap: 12px; align-items: center; padding: 5px 6px;
  border-radius: 8px; font-size: 13px; }
.bar-row:hover { background: var(--panel-2); }
.bar-row.click { cursor: pointer; }
.bar-row[aria-current="true"] { background: var(--panel-2); box-shadow: inset 3px 0 0 var(--s1); }
.bar-row .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-row .val { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.bar-row .val small { display: block; font-size: 11px; font-weight: 400; color: var(--ink-3); }
.two-cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; align-items: start; }
.mini-title { font-size: 12px; font-weight: 500; color: var(--ink-3); margin-bottom: 8px; letter-spacing: 0; }

/* heatmaps */
.heat-layout { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 20px; align-items: start; }
.heat { display: grid; gap: 4px; }
.heat-col { font-size: 12px; color: var(--ink-3); text-align: center; padding: 4px 0; font-weight: 500; }
.heat-rowname { font-size: 13px; color: var(--ink-2); display: flex; align-items: center; min-width: 0; }
.heat-cell { border: 0; border-radius: 8px; min-height: 42px; padding: 4px; font-size: 13px; font-weight: 500; color: var(--ink); cursor: pointer;
  font-variant-numeric: tabular-nums; transition: transform .1s; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; }
.heat-cell small { font-size: 11px; color: var(--ink-2); font-weight: 400; }
.heat-cell:hover { transform: scale(1.04); }
.heat-cell.total { background: var(--panel-2); color: var(--ink-2); }
.heat-cell.sel { outline: 2px solid var(--ink); }
.heat-cell.static { cursor: default; }
.heat-cell.static:hover { transform: none; }
.detail-pane { background: var(--panel-2); border-radius: 12px; padding: 14px 16px; min-height: 100%; }
.detail-pane h3 { font-size: 15px; }
.detail-pane > p { margin: 2px 0 10px; font-size: 12px; color: var(--ink-3); }
.detail-list { display: grid; gap: 8px; max-height: 380px; overflow: auto; }
.detail-row { display: grid; grid-template-columns: minmax(120px, 1.5fr) minmax(0, 1.2fr) 80px; gap: 10px; align-items: center; font-size: 13px; }
.detail-row .nm span { display: block; font-size: 11px; color: var(--ink-3); }
.detail-row .vv { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.detail-row .vv small { display: block; font-size: 11px; font-weight: 400; color: var(--ink-3); }
.stack { display: flex; gap: 2px; height: 14px; }
.stack span { display: block; height: 100%; border-radius: 3px; }

/* collections cards */
.season-cols { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 14px; }
.season-list { display: grid; gap: 8px; max-height: 360px; overflow: hidden auto; padding-right: 4px; }
.season-card { border: 1px solid var(--line); border-radius: 10px; padding: 9px 11px; background: var(--panel); min-width: 0; }
.season-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.season-top b { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.season-sub { font-size: 12px; color: var(--ink-3); margin: 2px 0 6px; }
.season-num { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 2px 8px; font-variant-numeric: tabular-nums; }
.season-num span { font-size: 16px; font-weight: 600; }
.season-num small { font-size: 11px; color: var(--ink-3); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.chips button { display: inline-flex; align-items: baseline; gap: 6px; border: 1px solid var(--line); background: var(--panel); color: var(--ink-2);
  border-radius: 999px; padding: 6px 14px; cursor: pointer; font-size: 13px; font-weight: 500; }
.chips button small { font-size: 11px; color: var(--ink-3); }
.chips button:hover { border-color: var(--line-strong); color: var(--ink); }
.chips button.on { background: var(--ink); border-color: var(--ink); color: var(--panel); }
.chips button.on small { color: var(--panel-3); }

/* badges */
.badge { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.bad { background: var(--bad-soft); color: var(--bad); }
.badge.neutral { background: var(--panel-2); color: var(--ink-2); }
.badge.hot { background: var(--accent-soft); color: var(--accent); }
.badge.ok::before { content: "✓"; }
.badge.bad::before { content: "✕"; }
.badge.warn::before { content: "!"; }

/* ------------------------------------------------ gallery ("galeria de produtos") */
.page-kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.page-kpis.six { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.page-kpis .value { font-size: 24px; }
.toolbar { display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.toolbar .tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.field { height: 36px; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel-2); color: var(--ink); outline: none; }
.field:focus { border-color: var(--line-strong); }
input.field[type=search] { min-width: 260px; }
.toggle { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px;
  cursor: pointer; font-size: 13px; font-weight: 500; color: var(--ink-2); }
.toggle:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.toggle input { accent-color: var(--accent); }
.removable { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 6px 0 12px; border-radius: 999px; font-size: 12px; font-weight: 600;
  background: var(--accent-soft); color: var(--accent); }
.removable button { border: 0; background: none; color: inherit; cursor: pointer; width: 20px; height: 20px; border-radius: 50%; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; }
.tile { display: flex; flex-direction: column; text-align: left; padding: 0; border: 1px solid var(--line); border-radius: 12px; background: var(--panel);
  cursor: pointer; overflow: hidden; transition: border-color .12s, box-shadow .12s, transform .12s; }
.tile:hover { border-color: var(--line-strong); box-shadow: var(--shadow); transform: translateY(-1px); }
.thumb { position: relative; aspect-ratio: 4 / 3; display: grid; place-items: center; border-bottom: 1px solid var(--line); overflow: hidden;
  background: radial-gradient(120% 90% at 30% 20%, color-mix(in srgb, var(--tint, #888) 18%, var(--panel)) 0%, var(--panel-2) 70%); color: color-mix(in srgb, var(--tint, #888) 70%, var(--ink-2)); }
.thumb svg { width: 42%; height: auto; max-height: 62%; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.thumb .tag { position: absolute; left: 8px; top: 8px; }
.thumb.small { width: 64px; height: 44px; aspect-ratio: auto; border: 0; border-radius: 6px; }
.thumb.small svg { width: 56%; }
.tile-body { padding: 10px 12px 12px; display: grid; gap: 6px; }
.tile-l1 { display: flex; justify-content: space-between; align-items: baseline; gap: 6px; }
.tile-l1 b { font-size: 14px; font-weight: 600; letter-spacing: -0.01em; }
.tile-l1 span { font-size: 12px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.tile-l2 { font-size: 12px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile-stock { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: center; font-size: 13px; font-variant-numeric: tabular-nums; }
.tile-stock small { color: var(--ink-3); font-size: 11px; }
.tile-bar { height: 6px; border-radius: 3px; background: color-mix(in srgb, var(--s1) 25%, transparent); overflow: hidden; }
.tile-bar span { display: block; height: 100%; background: var(--s1); }
.swatches { display: flex; flex-wrap: wrap; gap: 4px; min-height: 20px; }
.swatch { font-size: 11px; padding: 1px 6px; border-radius: 999px; background: var(--panel-2); color: var(--ink-2); border: 1px solid var(--line); }
.more-row { display: flex; justify-content: center; align-items: center; gap: 12px; margin-top: 16px; font-size: 13px; color: var(--ink-2); }

/* drawer */
.drawer-bg { position: fixed; inset: 0; z-index: 60; display: flex; justify-content: flex-end; background: rgba(11, 11, 12, .35); }
.drawer { width: min(720px, 100%); height: 100%; background: var(--panel); box-shadow: var(--shadow-lg); padding: 20px; display: flex; flex-direction: column;
  gap: 12px; animation: slide-in .18s ease-out; }
@keyframes slide-in { from { transform: translateX(24px); opacity: 0; } }
.drawer-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.drawer-head h2 { font-size: 18px; }
.drawer-body { flex: 1; overflow: auto; padding-right: 6px; }
.pd { display: grid; gap: 14px; }
.pd-top { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 18px; }
.pd-top .thumb { border: 1px solid var(--line); border-radius: 12px; }
.pd-title { font-size: 20px; font-weight: 600; letter-spacing: -0.02em; }
.pd-sub { font-size: 13px; color: var(--ink-3); margin: 2px 0 10px; }
.pd-price { font-size: 18px; font-weight: 600; margin-bottom: 12px; }
.pd-price small { display: block; font-size: 12px; font-weight: 400; color: var(--ink-3); }
.pd-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.pd-stat { background: var(--panel-2); border-radius: 10px; padding: 10px 12px; }
.pd-stat span, .pd-stat small { display: block; font-size: 11px; color: var(--ink-3); }
.pd-stat b { font-size: 16px; font-weight: 600; font-variant-numeric: tabular-nums; }
.pd h3 { font-size: 14px; margin-top: 4px; }
.pd-attrs { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0; font-size: 13px; }
.pd-attrs dt { color: var(--ink-3); }
.pd-attrs dd { margin: 0; }
.loc-row { display: grid; grid-template-columns: minmax(140px, 1.3fr) minmax(0, 1.5fr) 90px; gap: 10px; align-items: center; font-size: 13px; }
.loc-row .nm span { display: block; font-size: 11px; color: var(--ink-3); }

/* tables */
.table-wrap { overflow: auto; max-height: 520px; border: 1px solid var(--line); border-radius: 12px; }
table { border-collapse: collapse; width: 100%; font-size: 13px; }
th, td { padding: 8px 12px; border-bottom: 1px solid var(--line); text-align: center; white-space: nowrap; }
td.l, th.l { text-align: left; }
tbody tr:hover td { background: var(--panel-2); }
th { position: sticky; top: 0; z-index: 1; background: var(--panel); color: var(--ink-3); font-size: 10.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; }
th.sortable { cursor: pointer; user-select: none; }
th.sortable:hover { color: var(--ink); }
th.asc::after { content: " ▲"; font-size: 9px; }
th.desc::after { content: " ▼"; font-size: 9px; }
td { font-variant-numeric: tabular-nums; }
tr.total td { position: sticky; bottom: 0; font-weight: 600; background: var(--panel-2); }
tr.group td { background: var(--panel-2); cursor: pointer; font-weight: 600; }
tr.group:hover td { background: var(--panel-3); }
tr.group td:first-child::before { content: "▸ "; color: var(--ink-3); }
tr.group.open td:first-child::before { content: "▾ "; }
tr.click { cursor: pointer; }
td small { display: block; font-size: 11px; color: var(--ink-3); font-weight: 400; }
td select { height: 28px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); padding: 0 6px; font-size: 12px; }
.pager { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 12px; font-size: 13px; color: var(--ink-2); flex-wrap: wrap; }
.pager .btns { display: flex; gap: 8px; align-items: center; }
.empty { color: var(--ink-3); padding: 20px; text-align: center; }
.check-grid { display: flex; flex-wrap: wrap; gap: 6px; }
.check-grid label { border: 1px solid var(--line); background: var(--panel); border-radius: 999px; padding: 5px 12px; cursor: pointer; font-size: 13px; font-weight: 500; color: var(--ink-2); }
.check-grid input { display: none; }
.check-grid label:has(input:checked) { background: var(--ink); border-color: var(--ink); color: var(--panel); }

/* validation */
.val-summary { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.val-ring { width: 74px; height: 74px; flex: none; }
.val-matrix td { padding: 6px 8px; }
.val-matrix td .badge { min-width: 64px; justify-content: center; }
.info-box { font-size: 12px; color: var(--warn); background: var(--warn-soft); border-radius: 8px; padding: 8px 12px; margin: 12px 0 0; }

.toast { position: fixed; right: 16px; bottom: 16px; z-index: 70; max-width: 460px; background: var(--panel); border: 1px solid var(--line);
  border-left: 3px solid var(--ok); border-radius: 12px; padding: 12px 16px; box-shadow: var(--shadow-lg); font-size: 13px; }

/* ------------------------------------------------ responsive */
@media (max-width: 1280px) {
  .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .c4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .comp-row { grid-template-columns: 1fr 1fr; }
  .page-kpis.six { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 1100px) {
  .heat-layout, .two-cols, .season-cols { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .shell, .shell.collapsed { grid-template-columns: 1fr; }
  .collapse-btn { display: none; }
  .sidebar { position: static; height: auto; padding: 12px 16px; gap: 10px; border-right: 0; border-bottom: 1px solid var(--line); }
  .nav { overflow-x: auto; }
  .nav-module { flex-direction: row; align-items: center; width: max-content; }
  .nav-head, .side-foot .status { display: none; }
  .side-foot { flex-direction: row; border-top: 0; padding-top: 0; }
  .topbar { padding: 0 16px; }
  .quick { justify-content: flex-start; }
  .filter-panel { right: 16px; }
  .page-head { padding: 20px 16px 4px; flex-wrap: wrap; align-items: flex-start; }
  .kpis { grid-template-columns: 1fr 1fr; padding: 16px 16px 0; }
  .content { padding: 16px 16px 40px; }
  .c2, .c3, .c4, .comp-row, .pd-top { grid-template-columns: 1fr; }
  .page-kpis, .page-kpis.six, .pd-stats { grid-template-columns: 1fr 1fr; }
  input.field[type=search] { min-width: 0; width: 100%; }
  .rank-row { grid-template-columns: 28px minmax(0, 1fr) 96px; }
  .rank-row .bar-track { display: none; }
}
