:root {
  --bg: #0d0d0f;
  --surface: #151518;
  --surface-2: #1c1c20;
  --surface-3: #24242a;
  --border: #2a2a31;
  --border-strong: #3a3a43;
  --text: #ece8e1;
  --text-2: #b9b4ab;
  --muted: #847f77;
  --gold: #c9a85c;
  --gold-strong: #dcbd72;
  --gold-soft: rgba(201, 168, 92, 0.12);
  --gold-line: rgba(201, 168, 92, 0.35);
  --ok: #6fbf8e;
  --warn: #d9a441;
  --bad: #d9705f;
  --radius: 10px;
  --radius-sm: 6px;
  --serif: 'Cormorant Garamond', 'Times New Roman', serif;
  --sans: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --sidebar-w: 240px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font: 14px/1.5 var(--sans);
  font-variant-numeric: lining-nums;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
button { font: inherit; color: inherit; cursor: pointer; }
input, select, textarea { font: inherit; color: inherit; }
a { color: var(--gold); text-decoration: none; }
svg { display: block; }

/* ---------- Layout ---------- */
.shell { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 30;
}
.brand { padding: 28px 24px 24px; border-bottom: 1px solid var(--border); }
.brand-mark { display: block; font: 600 22px/1 var(--serif); letter-spacing: 0.22em; color: var(--gold); }
.brand-sub { display: block; margin-top: 8px; font-size: 11px; letter-spacing: 0.3em; text-transform: uppercase; color: var(--muted); }

.nav { padding: 16px 12px; display: flex; flex-direction: column; gap: 2px; flex: 1; overflow-y: auto; }
.nav-label { font-size: 10px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--muted); padding: 14px 12px 6px; }
.nav a {
  display: flex; align-items: center; gap: 12px;
  padding: 9px 12px; border-radius: var(--radius-sm);
  color: var(--text-2); font-weight: 500;
}
.nav a:hover { background: var(--surface-2); color: var(--text); }
.nav a.active { background: var(--gold-soft); color: var(--gold-strong); }
.nav a .badge { margin-left: auto; }

.sidebar-foot { padding: 16px 24px 22px; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.proto-tag { font-size: 11px; color: var(--gold); border: 1px solid var(--gold-line); border-radius: 99px; padding: 2px 10px; }
.by { font-size: 11px; color: var(--muted); }
.link-btn { background: none; border: 0; padding: 0; color: var(--text-2); font-size: 12px; text-decoration: underline; text-underline-offset: 3px; }
.link-btn:hover { color: var(--text); }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 16px;
  padding: 14px 32px;
  background: rgba(13, 13, 15, 0.88);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.menu-btn { display: none; }
.content { padding: 28px 32px 56px; max-width: 1440px; width: 100%; }

/* ---------- Search ---------- */
.search { position: relative; flex: 1; max-width: 440px; }
.search-icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.search input {
  width: 100%; padding: 9px 12px 9px 38px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
  outline: none;
}
.search input:focus { border-color: var(--gold-line); }
.search-results {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0;
  background: var(--surface-2); border: 1px solid var(--border-strong); border-radius: var(--radius);
  padding: 6px; max-height: 380px; overflow-y: auto; box-shadow: 0 20px 40px rgba(0,0,0,.5);
}
.search-results a { display: flex; justify-content: space-between; gap: 12px; padding: 8px 10px; border-radius: var(--radius-sm); color: var(--text); }
.search-results a:hover, .search-results a:focus { background: var(--surface-3); outline: none; }
.search-results small { color: var(--muted); white-space: nowrap; }
.search-results .empty { padding: 10px; color: var(--muted); }

.role-switch { margin-left: auto; display: flex; background: var(--surface); border: 1px solid var(--border); border-radius: 99px; padding: 3px; }
.role-switch button { background: none; border: 0; padding: 6px 14px; border-radius: 99px; color: var(--text-2); font-size: 13px; font-weight: 500; white-space: nowrap; }
.role-switch button[aria-selected="true"] { background: var(--gold); color: #17140d; }

/* ---------- Typography / headers ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.eyebrow { font-size: 11px; letter-spacing: 0.24em; text-transform: uppercase; color: var(--gold); margin: 0 0 6px; }
h1 { font: 600 34px/1.1 var(--serif); margin: 0; font-variant-numeric: lining-nums; letter-spacing: 0.01em; }
h2 { font: 600 22px/1.2 var(--serif); margin: 0; font-variant-numeric: lining-nums; }
h3 { font-size: 12px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-2); margin: 0; }
.sub { color: var(--muted); margin: 6px 0 0; }
.muted { color: var(--muted); }
.num { font-variant-numeric: lining-nums tabular-nums; }

/* ---------- Cards / grid ---------- */
.grid { display: grid; gap: 16px; }
.kpis { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); margin-bottom: 16px; }
.cols-2 { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); }
.cols-2-even { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; min-width: 0; }
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.card-head .muted { font-size: 12px; }
.card-head a { white-space: nowrap; display: inline-flex; align-items: center; gap: 4px; }
.stack { display: flex; flex-direction: column; gap: 16px; }

.kpi { padding: 18px 20px; }
.kpi .label { font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.kpi .value { font: 600 30px/1.1 var(--serif); margin-top: 8px; white-space: nowrap; font-variant-numeric: lining-nums tabular-nums; }
.kpi .delta { font-size: 12px; color: var(--text-2); margin-top: 4px; }
.kpi .delta b { color: var(--ok); font-weight: 600; }
.kpi.highlight { border-color: var(--gold-line); background: linear-gradient(160deg, rgba(201,168,92,.10), var(--surface) 60%); }
.kpi.highlight .value { color: var(--gold-strong); }

/* ---------- Buttons / chips ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong); background: var(--surface-2); color: var(--text);
  font-weight: 500; font-size: 13px; white-space: nowrap;
}
.btn:hover { border-color: var(--gold-line); }
.btn.primary { background: var(--gold); border-color: var(--gold); color: #17140d; }
.btn.primary:hover { background: var(--gold-strong); }
.btn.ghost { background: none; }
.icon-btn { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface); color: var(--text-2); }
.icon-btn:hover { color: var(--text); border-color: var(--border-strong); }

.chip { display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px; border-radius: 99px; font-size: 12px; font-weight: 500; border: 1px solid var(--border-strong); color: var(--text-2); white-space: nowrap; }
.chip .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.chip.stage-novo { color: #a9b6c9; }
.chip.stage-qualificacao { color: #b8aa86; }
.chip.stage-negociacao { color: #d0b16a; }
.chip.stage-proposta { color: var(--gold-strong); border-color: var(--gold-line); }
.chip.stage-documentacao { color: #e6cf93; border-color: var(--gold-line); }
.chip.stage-vendido { color: var(--ok); border-color: rgba(111,191,142,.4); }
.chip.stage-perdido { color: var(--muted); }
.badge { font-size: 11px; font-weight: 600; background: var(--surface-3); color: var(--text-2); border-radius: 99px; padding: 1px 8px; }
.badge.gold { background: var(--gold-soft); color: var(--gold-strong); }

.due { font-size: 12px; display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.due.late { color: var(--bad); }
.due.today { color: var(--warn); }
.due.later { color: var(--muted); }

.tabs { display: flex; gap: 4px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 3px; }
.tabs button { background: none; border: 0; padding: 6px 12px; border-radius: 4px; color: var(--text-2); font-size: 13px; }
.tabs button[aria-pressed="true"] { background: var(--surface-3); color: var(--text); }

.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 16px; }
.select, .input {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 8px 10px; outline: none; min-width: 0;
}
.select:focus, .input:focus { border-color: var(--gold-line); }
select option { background: var(--surface-2); }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; margin: 0 -20px -20px; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 11px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); padding: 10px 20px; border-bottom: 1px solid var(--border); white-space: nowrap; }
td { padding: 12px 20px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tbody tr.clickable { cursor: pointer; }
tbody tr.clickable:hover td { background: var(--surface-2); }
td.right, th.right { text-align: right; }
.cell-title { font-weight: 500; }
.cell-sub { font-size: 12px; color: var(--muted); }

.bar-cell { display: flex; align-items: center; gap: 10px; min-width: 140px; }
.bar-track { flex: 1; height: 6px; background: var(--surface-3); border-radius: 3px; overflow: hidden; }
.bar-fill { display: block; height: 100%; background: var(--gold); border-radius: 3px; }

/* ---------- Charts ---------- */
.chart { width: 100%; }
.chart text { fill: var(--muted); font: 11px var(--sans); }
.chart .val { fill: var(--text-2); font-weight: 500; }
.chart .grid-line { stroke: var(--border); stroke-width: 1; }
.chart .mark { fill: var(--gold); transition: opacity .15s; }
.chart .mark-muted { fill: var(--surface-3); }
.chart .hit { fill: transparent; cursor: default; }
.chart .hit:hover + .mark, .chart g.bar:hover .mark { fill: var(--gold-strong); }
.chart .line { fill: none; stroke: var(--gold); stroke-width: 2; }
.chart .area { fill: url(#goldFade); }
.chart .pt { fill: var(--gold); stroke: var(--surface); stroke-width: 2; }

.hbars { display: flex; flex-direction: column; gap: 12px; }
.hbar { display: grid; grid-template-columns: 120px 1fr 84px; align-items: center; gap: 12px; }
.hbar .name { color: var(--text-2); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar .track, .hbar .fill { display: block; }
.hbar .v { white-space: nowrap; }
.hbar .track { height: 10px; background: var(--surface-2); border-radius: 0 4px 4px 0; }
.hbar .fill { height: 100%; background: var(--gold); border-radius: 0 4px 4px 0; min-width: 2px; }
.hbar:hover .fill { background: var(--gold-strong); }
.hbar .v { text-align: right; font-variant-numeric: lining-nums tabular-nums; font-size: 13px; }

.funnel { display: flex; flex-direction: column; gap: 6px; }
.funnel-row { display: grid; grid-template-columns: 110px 1fr 90px; align-items: center; gap: 12px; }
.funnel-row .bar { height: 28px; display: flex; align-items: center; justify-content: center; }
.funnel-row .bar span { height: 100%; background: var(--gold); border-radius: 4px; opacity: var(--o, 1); min-width: 4px; }
.funnel-row:hover .bar span { opacity: 1; background: var(--gold-strong); }
.funnel-row .name { font-size: 13px; color: var(--text-2); }
.funnel-row .v { text-align: right; font-size: 13px; font-variant-numeric: lining-nums tabular-nums; }
.funnel-row .v small { color: var(--muted); margin-left: 4px; }

.tooltip {
  position: fixed; z-index: 100; pointer-events: none;
  background: var(--surface-3); border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  padding: 8px 10px; font-size: 12px; line-height: 1.4; box-shadow: 0 10px 30px rgba(0,0,0,.5);
  opacity: 0; transform: translateY(4px); transition: opacity .1s, transform .1s; max-width: 260px;
}
.tooltip.show { opacity: 1; transform: none; }
.tooltip b { display: block; color: var(--text); font-weight: 600; }
.tooltip span { color: var(--text-2); }

/* ---------- Kanban ---------- */
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(250px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 12px; }
.column { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); display: flex; flex-direction: column; min-height: 420px; }
.column-head { padding: 14px 14px 10px; border-bottom: 1px solid var(--border); }
.column-head .row { display: flex; align-items: center; justify-content: space-between; }
.column-head .total { font-size: 12px; color: var(--muted); margin-top: 4px; font-variant-numeric: lining-nums tabular-nums; }
.column-body { padding: 10px; display: flex; flex-direction: column; gap: 8px; flex: 1; transition: background .15s; border-radius: 0 0 var(--radius) var(--radius); }
.column-body.drop { background: var(--gold-soft); }
.opp-card {
  background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 12px; cursor: pointer; text-align: left; width: 100%;
}
.opp-card:hover { border-color: var(--gold-line); }
.opp-card.dragging { opacity: .4; }
.opp-card .t { font-weight: 500; display: flex; align-items: center; gap: 8px; }
.opp-card .t svg { color: var(--gold); flex-shrink: 0; }
.opp-card .price { font: 600 18px/1.2 var(--serif); color: var(--gold-strong); margin: 6px 0; font-variant-numeric: lining-nums tabular-nums; }
.opp-card .meta { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--muted); }
.opp-card .foot { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--border); gap: 8px; }
.score { font-size: 11px; font-weight: 600; color: var(--text-2); display: inline-flex; align-items: center; gap: 4px; }
.score i { width: 28px; height: 4px; border-radius: 2px; background: var(--surface-3); overflow: hidden; display: inline-block; }
.score i b { display: block; height: 100%; background: var(--gold); }

/* ---------- Products ---------- */
.products { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.product-card { color: inherit; padding: 0; overflow: hidden; cursor: pointer; display: flex; flex-direction: column; text-align: left; }
.product-card:hover { border-color: var(--gold-line); }
.product-visual {
  aspect-ratio: 16 / 9; display: grid; place-items: center; position: relative;
  background: radial-gradient(circle at 30% 20%, rgba(201,168,92,.18), transparent 60%), linear-gradient(160deg, #1f1d19, #121214);
  color: var(--gold); border-bottom: 1px solid var(--border);
}
.product-visual .cat { position: absolute; top: 12px; left: 12px; font-size: 10px; letter-spacing: .2em; text-transform: uppercase; color: var(--text-2); }
.product-visual .ribbon { position: absolute; top: 12px; right: 12px; }
.product-body { padding: 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.product-body .name { font-weight: 500; }
.product-body .price { font: 600 22px/1.1 var(--serif); color: var(--gold-strong); font-variant-numeric: lining-nums tabular-nums; }
.product-body .drop { font-size: 12px; color: var(--ok); }
.product-stats { display: flex; gap: 14px; font-size: 12px; color: var(--muted); margin-top: auto; padding-top: 10px; border-top: 1px solid var(--border); }
.product-stats b { color: var(--text); font-weight: 600; }

.checks { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 8px; }
.check { display: flex; align-items: center; gap: 8px; font-size: 13px; padding: 8px 10px; border-radius: var(--radius-sm); background: var(--surface-2); }
.check.ok svg { color: var(--ok); }
.check.pending { color: var(--text-2); }
.check.pending svg { color: var(--warn); }

.detail-hero { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); gap: 16px; margin-bottom: 16px; }
.detail-hero .product-visual { aspect-ratio: auto; min-height: 240px; border-radius: var(--radius); border: 1px solid var(--border); }
.big-price { font: 600 40px/1 var(--serif); color: var(--gold-strong); font-variant-numeric: lining-nums tabular-nums; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 12px; margin-top: 18px; }
.fact .k { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.fact .v { font-size: 20px; font-weight: 600; margin-top: 2px; font-variant-numeric: lining-nums tabular-nums; }
.spec-list { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; color: var(--text-2); }
.spec-list li::before { content: '—'; color: var(--gold); margin-right: 8px; }
.restricted { font-size: 11px; color: var(--muted); border: 1px dashed var(--border-strong); border-radius: 4px; padding: 1px 6px; margin-left: 6px; }

/* ---------- Drawer ---------- */
.drawer { position: fixed; inset: 0; z-index: 50; pointer-events: none; }
.drawer::before { content: ''; position: absolute; inset: 0; background: rgba(0,0,0,.55); opacity: 0; transition: opacity .2s; }
.drawer.open { pointer-events: auto; }
.drawer.open::before { opacity: 1; }
.drawer-panel {
  position: absolute; top: 0; right: 0; bottom: 0; width: min(560px, 100%);
  background: var(--surface); border-left: 1px solid var(--border-strong);
  transform: translateX(100%); transition: transform .25s ease; overflow-y: auto;
  display: flex; flex-direction: column;
}
.drawer.open .drawer-panel { transform: none; }
.drawer-head { padding: 22px 24px 18px; border-bottom: 1px solid var(--border); display: flex; gap: 16px; align-items: flex-start; }
.drawer-head .grow { flex: 1; min-width: 0; }
.drawer-body { padding: 20px 24px 32px; display: flex; flex-direction: column; gap: 22px; }
.kv { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 20px; }
.kv .k { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.kv .v { margin-top: 2px; }
.ai-box { border: 1px solid var(--gold-line); background: linear-gradient(160deg, rgba(201,168,92,.10), transparent 70%); border-radius: var(--radius); padding: 16px; }
.ai-box .ai-head { display: flex; align-items: center; gap: 8px; color: var(--gold-strong); font-weight: 600; font-size: 13px; margin-bottom: 10px; }
.ai-box p { margin: 0 0 10px; color: var(--text-2); }
.ai-box .suggest { color: var(--text); padding-top: 10px; border-top: 1px solid var(--gold-line); margin: 0; }
.ai-box .suggest b { color: var(--gold-strong); font-weight: 600; }
.stage-track { display: flex; gap: 4px; }
.stage-track button { flex: 1; height: 30px; border: 1px solid var(--border); background: var(--surface-2); border-radius: 4px; font-size: 11px; color: var(--muted); padding: 0 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stage-track button.done { background: var(--gold-soft); color: var(--gold); border-color: var(--gold-line); }
.stage-track button.current { background: var(--gold); color: #17140d; border-color: var(--gold); font-weight: 600; }
.timeline { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.timeline li { position: relative; padding: 0 0 16px 22px; }
.timeline li::before { content: ''; position: absolute; left: 4px; top: 6px; width: 7px; height: 7px; border-radius: 50%; background: var(--gold); }
.timeline li::after { content: ''; position: absolute; left: 7px; top: 16px; bottom: 0; width: 1px; background: var(--border-strong); }
.timeline li:last-child::after { display: none; }
.timeline .when { font-size: 12px; color: var(--muted); }
.note-form { display: flex; gap: 8px; }
.note-form .input { flex: 1; }

/* ---------- Matching ---------- */
.match-form { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)) auto; gap: 10px; align-items: end; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field label { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.presets { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.preset { background: none; border: 1px solid var(--border-strong); border-radius: 99px; padding: 5px 12px; font-size: 12px; color: var(--text-2); }
.preset:hover { border-color: var(--gold-line); color: var(--gold-strong); }
.match-row { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; gap: 16px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--border); cursor: pointer; }
.match-row:last-child { border-bottom: 0; }
.match-row:hover .cell-title { color: var(--gold-strong); }
.match-score { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; font: 600 18px var(--serif); font-variant-numeric: lining-nums; color: var(--gold-strong); border: 1px solid var(--gold-line); background: var(--gold-soft); }
.reasons { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.reasons span { font-size: 11px; color: var(--text-2); background: var(--surface-2); border-radius: 4px; padding: 2px 7px; }

.empty-state { text-align: center; padding: 48px 16px; color: var(--muted); }

/* ---------- Affiliate ---------- */
.avatar { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--gold-soft); color: var(--gold-strong); font-weight: 600; font-size: 13px; flex-shrink: 0; border: 1px solid var(--gold-line); }
.who { display: flex; align-items: center; gap: 12px; }
.rank { font: 600 18px var(--serif); font-variant-numeric: lining-nums; color: var(--muted); width: 22px; }
.rank.top { color: var(--gold); }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .cols-2, .cols-2-even, .detail-hero { grid-template-columns: minmax(0, 1fr); }
  .match-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .match-form .btn { grid-column: 1 / -1; justify-content: center; }
}
@media (max-width: 900px) {
  .sidebar { position: fixed; left: 0; top: 0; transform: translateX(-100%); transition: transform .25s ease; }
  .sidebar.open { transform: none; }
  .scrim { position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 25; display: none; }
  .scrim.show { display: block; }
  .menu-btn { display: inline-grid; }
  .topbar { padding: 12px 16px; gap: 10px; flex-wrap: wrap; }
  .search { order: 3; flex-basis: 100%; max-width: none; }
  .content { padding: 20px 16px 48px; }
  h1 { font-size: 28px; }
}
@media (max-width: 560px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi .value { font-size: 26px; }
  .hbar { grid-template-columns: 90px 1fr 76px; }
  .funnel-row { grid-template-columns: 92px 1fr 70px; }
  .kv, .checks { grid-template-columns: minmax(0, 1fr); }
  .match-form { grid-template-columns: minmax(0, 1fr); }
  .role-switch button { padding: 6px 10px; font-size: 12px; }
  .drawer-head, .drawer-body { padding-left: 16px; padding-right: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
