/* ============================================================
   AUTO SALLONI ALBERTI — Owner Dashboard
   Monochrome terminal aesthetic · off-black + brushed metal
   Sharp edges · hairline rules · tabular mono numerics
   Outfit + JetBrains Mono · GPU-only motion · no color, no glow
   ============================================================ */

/* ---------------- THEME — light · warm white + champagne gold (efferd/shadcn) ---------------- */
:root {
  --bg: #070707;                /* efferd near-black page */
  --bg-elev: #101010;           /* cards / panels (efferd ~#0d0d0d) */
  --bg-elev-2: #1a1a1a;         /* inset / hover / muted track */
  --bg-hover: rgba(255,255,255,.045);
  --line: rgba(255,255,255,.10); /* hairline border (white-alpha) */
  --line-2: rgba(255,255,255,.15);
  --line-strong: rgba(255,255,255,.30);
  --text: #fafafa;              /* near-white foreground */
  --text-2: rgba(250,250,250,.72);
  --text-3: rgba(250,250,250,.5); /* muted-foreground */
  --gold: #c8a86a;              /* champagne gold — brighter for dark legibility */
  --gold-soft: #ddc28b;
  --metal: #c8a86a;
  --accent: #c8a86a;            /* the brand accent — the Alberti splash */
  --accent-weak: rgba(200,168,106,.14);
  --accent-line: rgba(200,168,106,.42);
  --pos: #4ec08a;               /* green — positive delta (legible on dark) */
  --pos-weak: rgba(78,192,138,.15);
  --neg: #f0625a;               /* red — negative delta / alert */
  --neg-weak: rgba(240,98,90,.16);
  --solid: #fafafa;             /* light solid button (inverted) */
  --solid-ink: #0a0a0a;
  --shadow-card: 0 1px 2px rgba(0,0,0,.5), 0 1px 1px rgba(0,0,0,.35);  /* depth on dark */
  --shadow-card-h: 0 6px 20px -8px rgba(0,0,0,.6), 0 2px 6px -2px rgba(0,0,0,.4);  /* hover lift */
  --shadow: 0 24px 64px -20px rgba(0,0,0,.75);  /* deep — drawer / modals / fab */
  --metal-sheen: linear-gradient(176deg,#e8d6a6 0%,#b08d4f 54%,#f0e2bb 100%);
  color-scheme: dark;

  --sidebar-w: 244px;
  --topbar-h: 60px;
  --r: 14px;           /* soft — panels, tables, KPI cards (efferd rounded-xl) */
  --r-sm: 10px;        /* nested cells, smaller cards */
  --r-round: 8px;      /* buttons, inputs, segmented, nav items, badges */
  --r-pill: 999px;     /* pills — fab, avatars, dots */
  --ease: cubic-bezier(.4,0,.2,1);
  --mono: "JetBrains Mono", ui-monospace, monospace;
  font-synthesis: none;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg); color: var(--text);
  font-family: "Outfit", system-ui, sans-serif; font-weight: 400; line-height: 1.5;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  transition: background .35s var(--ease), color .35s var(--ease);
  overflow: hidden;
}
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, select { font-family: inherit; color: inherit; }
.num { font-variant-numeric: tabular-nums; font-feature-settings: "tnum" 1; font-family: var(--mono); }
.mono { font-family: var(--mono); }
::selection { background: var(--text); color: var(--bg); }

*::-webkit-scrollbar { width: 9px; height: 9px; }
*::-webkit-scrollbar-thumb { background: var(--line-2); border: 2px solid transparent; background-clip: padding-box; }
*::-webkit-scrollbar-thumb:hover { background: var(--line-strong); background-clip: padding-box; }
*::-webkit-scrollbar-track { background: transparent; }

/* ---------------- APP SHELL ---------------- */
.app { display: flex; height: 100dvh; width: 100%; }

/* ---- sidebar ---- */
.sidebar {
  width: var(--sidebar-w); flex: 0 0 var(--sidebar-w); height: 100dvh;
  background: var(--bg-elev); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; z-index: 40;
  transition: transform .3s var(--ease), background .35s var(--ease);
}
.brand {
  display: flex; align-items: center; gap: 11px; padding: 15px 18px;
  border-bottom: 1px solid var(--line); height: var(--topbar-h);
}
.brand__chip {
  width: 34px; height: 34px; background: #0c0c0d; border: 1px solid rgba(255,255,255,.08);
  display: grid; place-items: center; flex: 0 0 auto;
}
.brand__chip img { width: 26px; }
.brand__name {
  font-weight: 700; letter-spacing: .22em; font-size: .92rem;
  background: var(--metal-sheen); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.brand__sub { font-family: var(--mono); font-size: .54rem; letter-spacing: .26em; color: var(--text-3); text-transform: uppercase; margin-top: 2px; }
.nav { padding: 8px 0; flex: 1; overflow-y: auto; display: flex; flex-direction: column; }
.nav__label { font-family: inherit; font-size: .68rem; letter-spacing: .04em; color: var(--text-3); text-transform: uppercase; font-weight: 500; padding: 16px 22px 7px; }
.nav__item {
  display: flex; align-items: center; gap: 11px; padding: 8px 11px; margin: 1px 10px;
  color: var(--text-2); font-size: .87rem; font-weight: 500; position: relative;
  transition: background .16s, color .16s; cursor: pointer; user-select: none;
}
.nav__item:hover { background: var(--bg-hover); color: var(--text); }
.nav__item.active { background: var(--accent-weak); color: var(--text); }
.nav__item svg { width: 17px; height: 17px; flex: 0 0 auto; opacity: .8; }
.nav__item.active svg { opacity: 1; color: var(--accent); }
.nav__item .badge-count { margin-left: auto; font-family: var(--mono); font-size: .64rem; color: var(--text-3); }
.sidebar__foot { padding: 12px 14px; border-top: 1px solid var(--line); }
.demo-pill {
  display: flex; align-items: center; gap: 8px; width: 100%; justify-content: center;
  font-family: var(--mono); font-size: .6rem; letter-spacing: .18em; text-transform: uppercase;
  color: var(--text-3); border: 1px solid var(--line-2); padding: 7px 9px; cursor: help;
}
.demo-pill .dot { width: 5px; height: 5px; background: var(--accent); }

/* side search */
.side-search { padding: 10px 12px 4px; }
.searchbtn.side { width: 100%; justify-content: flex-start; padding: 8px 11px; }
.searchbtn.side kbd { margin-left: auto; }

/* rep directory */
.rep-dir { display: flex; flex-direction: column; padding: 2px 0 10px; }
.rep-item { display: flex; align-items: center; gap: 10px; padding: 6px 11px; margin: 0 10px; color: var(--text-2); font-size: .83rem; cursor: pointer; transition: background .16s, color .16s; }
.rep-item:hover { background: var(--bg-hover); color: var(--text); }
.rep-item__av { width: 22px; height: 22px; flex: 0 0 auto; display: grid; place-items: center; background: var(--bg-elev-2); border: 1px solid var(--line); font-family: var(--mono); font-size: .58rem; font-weight: 600; color: var(--text-2); }
.rep-item .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rep-item .v { font-family: var(--mono); font-size: .66rem; color: var(--text-3); }

/* owner footer */
.owner { display: flex; align-items: center; gap: 10px; padding: 2px 2px 12px; }
.owner__av { width: 30px; height: 30px; flex: 0 0 auto; display: grid; place-items: center; background: var(--accent); color: #fff; font-family: var(--mono); font-weight: 600; font-size: .7rem; }
.owner__id { flex: 1; min-width: 0; }
.owner__out { width: 30px; height: 30px; flex: 0 0 auto; }
.owner__name { font-size: .82rem; font-weight: 600; }
.owner__role { font-size: .64rem; color: var(--text-3); font-family: var(--mono); letter-spacing: .02em; margin-top: 1px; }

/* secondary stat strip */
.substats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); overflow: hidden; box-shadow: var(--shadow-card); }
.substat { background: var(--bg-elev); padding: 13px 16px; }
.substat .l { font-family: inherit; font-size: .73rem; letter-spacing: 0; text-transform: none; color: var(--text-3); }
.substat .v { font-size: 1.04rem; font-weight: 600; margin-top: 6px; font-variant-numeric: tabular-nums; }
.substat .v small { color: var(--text-3); font-weight: 500; font-size: .72rem; }

/* 12-column layout */
.g12 { display: grid; grid-template-columns: repeat(12, 1fr); gap: 14px; }
.col-12 { grid-column: span 12; } .col-8 { grid-column: span 8; } .col-7 { grid-column: span 7; }
.col-6 { grid-column: span 6; } .col-5 { grid-column: span 5; } .col-4 { grid-column: span 4; }
@media (max-width: 1180px) { .g12 .col-8, .g12 .col-7, .g12 .col-6, .g12 .col-5, .g12 .col-4 { grid-column: span 12; } }

/* bigger primary KPIs */
.kpi-grid.primary .kpi { padding: 17px 18px 18px; }
.kpi-grid.primary .kpi__val { font-size: 1.95rem; margin-top: 13px; }
.kpi__cap { font-size: .72rem; color: var(--text-3); }

/* ---- main ---- */
.main { flex: 1; height: 100dvh; overflow-y: auto; overflow-x: hidden; position: relative; }
.topbar {
  position: sticky; top: 0; z-index: 30; height: var(--topbar-h);
  display: flex; align-items: center; gap: 12px; padding: 0 18px;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(14px) saturate(140%); -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid var(--line);
}
.topbar__title { font-weight: 600; font-size: 1rem; letter-spacing: -.01em; }
.topbar__title small { display: block; font-weight: 400; font-size: .7rem; color: var(--text-3); letter-spacing: 0; margin-top: -2px; }
.topbar__spacer { flex: 1; }
.iconbtn {
  width: 34px; height: 34px; display: grid; place-items: center;
  border: 1px solid var(--line); color: var(--text-2); transition: all .16s; background: transparent;
}
.iconbtn:hover { color: var(--text); border-color: var(--line-strong); background: var(--bg-hover); }
.iconbtn:active { transform: scale(.96); }
.iconbtn svg { width: 16px; height: 16px; }
.searchbtn {
  display: flex; align-items: center; gap: 9px; height: 34px; padding: 0 11px;
  border: 1px solid var(--line); color: var(--text-3); background: transparent; font-size: .8rem; transition: all .16s;
}
.searchbtn:hover { border-color: var(--line-strong); color: var(--text-2); }
.searchbtn kbd { font-family: var(--mono); font-size: .62rem; border: 1px solid var(--line-2); padding: 1px 5px; color: var(--text-3); }
.searchbtn svg { width: 14px; height: 14px; }

.seg { display: inline-flex; border: 1px solid var(--line); overflow: hidden; }
.seg button { padding: 7px 11px; font-size: .76rem; font-weight: 500; color: var(--text-3); transition: all .16s; }
.seg button.active { background: var(--text); color: var(--bg); }
.seg.mono button { font-family: var(--mono); font-size: .7rem; letter-spacing: .08em; }

.period { display: flex; align-items: center; gap: 8px; }
.period__presets { display: inline-flex; border: 1px solid var(--line); overflow: hidden; }
.period__presets button { padding: 7px 11px; font-family: var(--mono); font-size: .72rem; letter-spacing: .04em; color: var(--text-3); transition: all .16s; border-right: 1px solid var(--line); }
.period__presets button:last-child { border-right: none; }
.period__presets button.active { background: var(--text); color: var(--bg); }
.period__presets button:hover:not(.active) { background: var(--bg-hover); color: var(--text-2); }
.date-range { display: flex; align-items: center; gap: 6px; font-family: var(--mono); font-size: .72rem; color: var(--text-2); }
.date-range input { background: transparent; border: 1px solid var(--line); padding: 5px 7px; font-family: var(--mono); font-size: .72rem; }

/* ---------------- VIEW / SECTIONS ---------------- */
.view { padding: 20px; max-width: 1680px; margin: 0 auto; display: none; animation: fade .3s var(--ease); }
.view.active { display: block; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

.section-row { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin: 28px 1px 11px; }
.section-row:first-child { margin-top: 2px; }
.section-row h2 { font-size: .98rem; font-weight: 600; letter-spacing: -.015em; text-transform: none; font-family: inherit; }
.section-row h2 .sub { font-weight: 400; color: var(--text-3); font-size: .82rem; margin-left: 8px; letter-spacing: 0; text-transform: none; }
.section-row .act { display: flex; gap: 8px; align-items: center; }
.tinybtn { font-size: .76rem; color: var(--text-2); border: 1px solid var(--line-2); padding: 6px 11px; transition: all .16s; display: inline-flex; align-items: center; gap: 6px; }
.tinybtn:hover { color: var(--text); border-color: var(--line-strong); }
.tinybtn:active { transform: scale(.97); }
.tinybtn svg { width: 13px; height: 13px; }

/* filter chip bar */
.filterbar { display: flex; flex-wrap: wrap; gap: 7px; align-items: center; margin: 2px 1px 14px; }
.filterbar:empty { display: none; }
.fchip { display: inline-flex; align-items: center; gap: 8px; font-size: .76rem; padding: 5px 6px 5px 10px; border: 1px solid var(--line-strong); color: var(--text); background: var(--accent-weak); }
.fchip b { font-weight: 600; }
.fchip .x { width: 16px; height: 16px; display: grid; place-items: center; border: 1px solid var(--line-2); font-size: .68rem; line-height: 1; color: var(--text-2); }
.fchip .x:hover { background: var(--text); color: var(--bg); border-color: var(--text); }
.fchip__clear { font-family: var(--mono); font-size: .7rem; color: var(--text-3); text-transform: uppercase; letter-spacing: .1em; padding: 4px 6px; }
.fchip__clear:hover { color: var(--text); }

/* ---------------- KPI STRIP (terminal, hairline-divided) ---------------- */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(176px, 1fr)); gap: 14px; }
.kpi { background: var(--bg-elev); border: 1px solid var(--line); box-shadow: var(--shadow-card); padding: 16px 18px 17px; position: relative; transition: box-shadow .2s var(--ease), transform .2s var(--ease); }
.kpi.clickable { cursor: pointer; }
.kpi.clickable:hover { box-shadow: var(--shadow-card-h); transform: translateY(-1px); }
.kpi__label { font-size: .77rem; letter-spacing: 0; text-transform: none; color: var(--text-3); font-weight: 500; font-family: inherit; display: flex; align-items: center; gap: 6px; }
.kpi__val { font-size: 1.7rem; font-weight: 600; letter-spacing: -.02em; margin-top: 12px; line-height: 1; font-variant-numeric: tabular-nums; }
.kpi__val small { font-size: .8rem; color: var(--text-3); font-weight: 500; }
.kpi__foot { display: flex; align-items: center; gap: 8px; margin-top: 11px; font-size: .72rem; color: var(--text-3); }
.delta { display: inline-flex; align-items: center; gap: 3px; font-family: var(--mono); font-size: .71rem; font-weight: 600; padding: 2px 7px; border-radius: var(--r-round); }
.delta.up { color: var(--pos); background: var(--pos-weak); }
.delta.down { color: var(--neg); background: var(--neg-weak); }
.delta.flat { color: var(--text-3); background: var(--bg-elev-2); }
.delta svg { width: 11px; height: 11px; }

/* ---------------- PANELS / GRID ---------------- */
.grid { display: grid; gap: 14px; }
.grid.c2 { grid-template-columns: repeat(2, 1fr); }
.grid.c3 { grid-template-columns: repeat(3, 1fr); }
.grid.c4 { grid-template-columns: repeat(4, 1fr); }
.grid.s21 { grid-template-columns: 1.9fr 1fr; }
.grid.s12 { grid-template-columns: 1fr 1.9fr; }
.panel { background: var(--bg-elev); border: 1px solid var(--line); box-shadow: var(--shadow-card); padding: 18px; min-width: 0; }
.panel__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.panel__head h3 { font-size: .84rem; font-weight: 600; letter-spacing: -.01em; text-transform: none; font-family: inherit; color: var(--text); }
.panel__head .hint { font-family: var(--mono); font-size: .68rem; color: var(--text-3); letter-spacing: .04em; }
.chart { width: 100%; }
.chart.h-sm { height: 196px; } .chart.h-md { height: 252px; } .chart.h-lg { height: 330px; }

/* insights */
.insights { display: grid; grid-template-columns: repeat(auto-fit, minmax(244px, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); overflow: hidden; box-shadow: var(--shadow-card); }
.insight { display: flex; gap: 12px; padding: 16px; background: var(--bg-elev); }
.insight__ic { width: 30px; height: 30px; flex: 0 0 auto; display: grid; place-items: center; border-radius: var(--r-round); background: var(--accent-weak); color: var(--accent); }
.insight__ic svg { width: 15px; height: 15px; }
.insight__b { font-size: .82rem; line-height: 1.45; color: var(--text-2); }
.insight__b b { color: var(--text); font-weight: 600; }

/* ---------------- TABLES ---------------- */
.tablewrap { background: var(--bg-elev); border: 1px solid var(--line); overflow: hidden; box-shadow: var(--shadow-card); }
.table-tools { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.table-search { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 180px; border: 1px solid var(--line); padding: 6px 10px; }
.table-search input { flex: 1; background: none; border: none; outline: none; font-size: .84rem; }
.table-search svg { width: 14px; height: 14px; color: var(--text-3); }
.selct { background: transparent; border: 1px solid var(--line); padding: 6px 9px; font-size: .8rem; color: var(--text-2); cursor: pointer; }
.tscroll { overflow-x: auto; max-height: 72vh; overflow-y: auto; }
table { width: 100%; border-collapse: collapse; font-size: .83rem; }
thead th {
  position: sticky; top: 0; z-index: 2; background: var(--bg-elev);
  text-align: left; font-weight: 500; font-size: .73rem; letter-spacing: 0; text-transform: none;
  color: var(--text-3); padding: 13px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; cursor: pointer; user-select: none; font-family: inherit;
}
thead th.sortable:hover { color: var(--text); }
thead th .arr { opacity: 0; margin-left: 4px; font-size: .7rem; }
thead th.sorted { color: var(--text); }
thead th.sorted .arr { opacity: 1; color: var(--metal); }
thead th.r, td.r { text-align: right; }
tbody td { padding: 13px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; color: var(--text-2); }
tbody tr { transition: background .12s; cursor: pointer; }
tbody tr:hover td { background: var(--bg-hover); color: var(--text); }
tbody tr:last-child td { border-bottom: none; }
td .strong { color: var(--text); font-weight: 600; }
.cellcar { display: flex; align-items: center; gap: 10px; }
.cellcar img { width: 46px; height: 31px; object-fit: cover; background: var(--bg-elev-2); flex: 0 0 auto; filter: grayscale(.15); }
.cellcar .m { color: var(--text); font-weight: 600; }
.cellcar .b { font-size: .7rem; color: var(--text-3); font-family: var(--mono); }
.muted { color: var(--text-3); }
.table-foot { display: flex; align-items: center; justify-content: space-between; padding: 10px 13px; border-top: 1px solid var(--line); font-family: var(--mono); font-size: .72rem; color: var(--text-3); letter-spacing: .03em; }
.pager { display: flex; gap: 6px; align-items: center; }
.pager button { width: 26px; height: 26px; border: 1px solid var(--line); color: var(--text-2); transition: all .16s; }
.pager button:hover:not(:disabled) { border-color: var(--line-strong); color: var(--text); }
.pager button:disabled { opacity: .35; cursor: default; }

/* tags — monochrome (fill vs outline vs dim conveys meaning) */
.tag { display: inline-flex; align-items: center; gap: 5px; font-size: .72rem; font-weight: 600; padding: 3px 9px; border: 1px solid transparent; background: var(--bg-elev-2); color: var(--text-2); white-space: nowrap; font-family: inherit; letter-spacing: 0; }
.tag.dot::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.tag.green { background: var(--pos-weak); color: var(--pos); border-color: transparent; }     /* won / positive */
.tag.red { background: var(--neg-weak); color: var(--neg); border-color: transparent; }        /* lost / dead stock = alert */
.tag.amber { background: var(--accent-weak); color: var(--gold-soft); border-color: transparent; }      /* warn = gold tint */
.tag.blue { background: var(--bg-elev-2); color: var(--text-2); border-color: var(--line); }
.tag.plain { background: transparent; color: var(--text-3); border-color: var(--line); }
.swatch { width: 10px; height: 10px; border: 1px solid var(--line-2); display: inline-block; vertical-align: -1px; margin-right: 6px; }

.minibar { height: 4px; background: var(--bg-elev-2); overflow: hidden; min-width: 64px; }
.minibar > span { display: block; height: 100%; background: var(--accent); }

/* ---------------- DRAWER ---------------- */
.overlay { position: fixed; inset: 0; background: rgba(0,0,0,.55); backdrop-filter: blur(2px); z-index: 60; opacity: 0; visibility: hidden; transition: opacity .25s, visibility .25s; }
.overlay.open { opacity: 1; visibility: visible; }
.drawer {
  position: fixed; top: 0; right: 0; height: 100dvh; width: min(520px, 94vw); z-index: 70;
  background: var(--bg-elev); border-left: 1px solid var(--line-2); box-shadow: var(--shadow);
  transform: translateX(101%); transition: transform .32s var(--ease); display: flex; flex-direction: column;
}
.drawer.open { transform: none; }
.drawer__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.drawer__title { font-size: 1.04rem; font-weight: 600; letter-spacing: -.01em; }
.drawer__title small { display: block; font-family: var(--mono); font-size: .7rem; color: var(--text-3); font-weight: 400; margin-top: 3px; letter-spacing: .02em; }
.drawer__body { flex: 1; overflow-y: auto; padding: 18px; }
.drawer__hero { width: 100%; aspect-ratio: 16/9; object-fit: cover; background: var(--bg-elev-2); margin-bottom: 14px; filter: grayscale(.12); }
.thumbs { display: flex; gap: 6px; margin: -6px 0 16px; overflow-x: auto; padding-bottom: 4px; }
.thumbs img { width: 62px; height: 42px; object-fit: cover; flex: 0 0 auto; opacity: .55; cursor: pointer; transition: opacity .16s; border: 1px solid var(--line); filter: grayscale(.2); }
.thumbs img:hover, .thumbs img.active { opacity: 1; border-color: var(--metal); }
.spec-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r-sm); overflow: hidden; margin-bottom: 18px; }
.spec-grid div { background: var(--bg-elev); padding: 10px 13px; }
.spec-grid .k { font-size: .58rem; text-transform: uppercase; letter-spacing: .1em; color: var(--text-3); font-family: var(--mono); }
.spec-grid .v { font-size: .9rem; font-weight: 600; margin-top: 3px; }
.pl-table { width: 100%; font-size: .85rem; margin-bottom: 18px; }
.pl-table td { padding: 8px 0; border-bottom: 1px solid var(--line); }
.pl-table td:last-child { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; font-family: var(--mono); }
.pl-table tr.total td { border-bottom: none; border-top: 1px solid var(--line-strong); padding-top: 11px; font-size: .98rem; }
.drawer__sec-title { font-size: .62rem; text-transform: uppercase; letter-spacing: .14em; color: var(--text-3); margin: 4px 0 11px; font-family: var(--mono); }
.timeline { position: relative; padding-left: 18px; }
.timeline::before { content: ""; position: absolute; left: 3px; top: 5px; bottom: 5px; width: 1px; background: var(--line-2); }
.tl-item { position: relative; padding: 0 0 14px; }
.tl-item::before { content: ""; position: absolute; left: -18px; top: 4px; width: 7px; height: 7px; background: var(--accent); }
.tl-item .t { font-size: .82rem; color: var(--text); }
.tl-item .d { font-family: var(--mono); font-size: .68rem; color: var(--text-3); margin-top: 1px; }

/* ---------------- COMMAND PALETTE ---------------- */
.cmdk { position: fixed; inset: 0; z-index: 90; display: none; align-items: flex-start; justify-content: center; padding-top: 12vh; background: rgba(0,0,0,.5); backdrop-filter: blur(3px); }
.cmdk.open { display: flex; animation: fade .16s; }
.cmdk__box { width: min(620px, 92vw); background: var(--bg-elev); border: 1px solid var(--line-2); box-shadow: var(--shadow); overflow: hidden; max-height: 70vh; display: flex; flex-direction: column; }
.cmdk__in { display: flex; align-items: center; gap: 11px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.cmdk__in svg { width: 17px; height: 17px; color: var(--text-3); }
.cmdk__in input { flex: 1; background: none; border: none; outline: none; font-size: .98rem; }
.cmdk__list { overflow-y: auto; padding: 5px; }
.cmdk__item { display: flex; align-items: center; gap: 11px; padding: 9px 11px; cursor: pointer; }
.cmdk__item.sel, .cmdk__item:hover { background: var(--bg-hover); }
.cmdk__item img { width: 38px; height: 26px; object-fit: cover; filter: grayscale(.2); }
.cmdk__item .m { font-size: .87rem; font-weight: 500; }
.cmdk__item .s { font-family: var(--mono); font-size: .7rem; color: var(--text-3); }
.cmdk__item .kind { margin-left: auto; font-family: var(--mono); font-size: .6rem; color: var(--text-3); text-transform: uppercase; letter-spacing: .12em; }
.cmdk__empty { padding: 30px; text-align: center; color: var(--text-3); font-size: .86rem; }

/* ---------------- AGENT ---------------- */
.agent-modal { position: fixed; inset: 0; z-index: 80; display: none; align-items: center; justify-content: center; padding: 24px; background: rgba(0,0,0,.6); backdrop-filter: blur(4px); }
.agent-modal.open { display: flex; animation: fade .2s; }
.agent { width: min(720px, 96vw); height: min(82vh, 760px); background: var(--bg-elev); border: 1px solid var(--line-2); box-shadow: var(--shadow); display: flex; flex-direction: column; overflow: hidden; }
.agent__head { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.agent__avatar { width: 34px; height: 34px; background: #0c0c0d; border: 1px solid rgba(255,255,255,.08); display: grid; place-items: center; flex: 0 0 auto; }
.agent__avatar img { width: 24px; }
.agent__id h4 { font-size: .94rem; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.agent__id .demo-tag { font-family: var(--mono); font-size: .54rem; letter-spacing: .14em; color: var(--text-3); border: 1px solid var(--line-2); padding: 1px 5px; }
.agent__id p { font-size: .72rem; color: var(--text-3); }
.agent__live { margin-left: auto; display: flex; align-items: center; gap: 6px; font-family: var(--mono); font-size: .68rem; color: var(--text-3); text-transform: uppercase; letter-spacing: .1em; }
.agent__live .dot { width: 6px; height: 6px; background: var(--accent); animation: pulse 2s infinite; }
@keyframes pulse { 0%,100% { opacity: .35; } 50% { opacity: 1; } }
.agent__body { flex: 1; overflow-y: auto; padding: 18px; display: flex; flex-direction: column; gap: 13px; }
.msg { display: flex; gap: 10px; max-width: 88%; }
.msg.user { align-self: flex-end; flex-direction: row-reverse; }
.msg__ic { width: 27px; height: 27px; flex: 0 0 auto; display: grid; place-items: center; background: var(--bg-elev-2); border: 1px solid var(--line); }
.msg__ic svg { width: 14px; height: 14px; color: var(--text-2); }
.msg.user .msg__ic { background: var(--text); border-color: var(--text); }
.msg.user .msg__ic svg { color: var(--bg); }
.msg__bubble { background: var(--bg-elev-2); border: 1px solid var(--line); padding: 11px 14px; font-size: .89rem; line-height: 1.55; }
.msg.user .msg__bubble { background: var(--accent-weak); border-color: var(--line-2); }
.msg__bubble b { font-weight: 600; color: var(--text); }
.msg__bubble .big { font-size: 1.45rem; font-weight: 600; letter-spacing: -.02em; display: block; margin: 5px 0; font-variant-numeric: tabular-nums; }
.msg__bubble ul { margin: 7px 0 2px; padding-left: 15px; }
.msg__bubble li { margin: 3px 0; }
.msg__bubble .ministat { display: flex; gap: 16px; margin-top: 9px; flex-wrap: wrap; }
.msg__bubble .ministat div { font-family: var(--mono); font-size: .72rem; color: var(--text-3); text-transform: uppercase; letter-spacing: .05em; }
.msg__bubble .ministat b { display: block; font-size: 1.05rem; color: var(--text); margin-bottom: 2px; }
.typing span { display: inline-block; width: 5px; height: 5px; background: var(--text-3); margin-right: 3px; animation: blink 1.3s infinite; }
.typing span:nth-child(2) { animation-delay: .2s; } .typing span:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%,60%,100% { opacity: .25; } 30% { opacity: 1; } }
.agent__suggest { display: flex; gap: 7px; padding: 0 18px 12px; flex-wrap: wrap; }
.suggest-chip { font-size: .77rem; padding: 7px 11px; border: 1px solid var(--line-2); color: var(--text-2); transition: all .16s; }
.suggest-chip:hover { border-color: var(--metal); color: var(--text); }
.agent__foot { display: flex; gap: 10px; padding: 13px 18px; border-top: 1px solid var(--line); }
.agent__foot input { flex: 1; background: transparent; border: 1px solid var(--line); padding: 11px 14px; font-size: .89rem; outline: none; transition: border-color .16s; }
.agent__foot input:focus { border-color: var(--line-strong); }
.agent__send { width: 44px; background: var(--accent); color: #fff; display: grid; place-items: center; transition: opacity .16s, transform .16s; }
.agent__send:hover { opacity: .85; } .agent__send:active { transform: scale(.96); }
.agent__send svg { width: 17px; height: 17px; }

/* fab — inverted solid */
.fab { position: fixed; right: 20px; bottom: 20px; z-index: 50; display: flex; align-items: center; gap: 9px; padding: 12px 17px; background: var(--accent); color: #fff; font-weight: 600; font-size: .85rem; border: 1px solid var(--accent); transition: transform .2s var(--ease), opacity .2s; box-shadow: var(--shadow); }
.fab:hover { transform: translateY(-2px); } .fab:active { transform: scale(.97); }
.fab svg { width: 17px; height: 17px; }

/* toast */
.toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%) translateY(16px); z-index: 100; background: var(--bg-elev-2); color: var(--text); border: 1px solid var(--line-2); padding: 11px 18px; font-size: .84rem; font-weight: 500; box-shadow: var(--shadow); opacity: 0; visibility: hidden; transition: all .25s var(--ease); }
.toast.show { opacity: 1; visibility: visible; transform: translateX(-50%) translateY(0); }

/* loader */
.loader { position: fixed; inset: 0; z-index: 200; background: var(--bg); display: grid; place-items: center; transition: opacity .45s, visibility .45s; }
.loader.done { opacity: 0; visibility: hidden; }
.loader__inner { display: flex; flex-direction: column; align-items: center; gap: 20px; }
.loader__inner img { width: 58px; animation: floaty 2.4s var(--ease) infinite; }
@keyframes floaty { 50% { transform: translateY(-7px); } }
.loader__bar { width: 130px; height: 1px; background: var(--line-2); overflow: hidden; }
.loader__bar span { display: block; height: 100%; width: 30%; background: var(--accent); animation: load 1.1s var(--ease) infinite; }
@keyframes load { 0% { transform: translateX(-120%); } 100% { transform: translateX(460%); } }

.empty { text-align: center; padding: 48px 20px; color: var(--text-3); font-size: .88rem; font-family: var(--mono); }

/* funnel */
.funnel { display: flex; flex-direction: column; gap: 9px; }
.funnel__step { display: flex; align-items: center; gap: 12px; }
.funnel__bar { height: 38px; background: var(--accent-weak); border: 1px solid var(--line); border-left: 2px solid var(--accent); border-radius: var(--r-round); display: flex; align-items: center; padding: 0 12px; color: var(--text); font-weight: 600; font-size: .88rem; min-width: 56px; font-variant-numeric: tabular-nums; transition: width .5s var(--ease); }
.funnel__meta { font-size: .78rem; color: var(--text-3); white-space: nowrap; font-family: var(--mono); }
.funnel__meta b { color: var(--text-2); }

.menu-toggle { display: none; }

/* =============== INFO TOOLTIP (hover/focus the «i») =============== */
.kpi__label, .substat .l { display: flex; align-items: center; gap: 6px; }
.infotip { position: relative; display: inline-grid; place-items: center; width: 15px; height: 15px; margin-left: auto; color: var(--text-3); cursor: help; flex: 0 0 auto; }
.infotip:hover, .infotip:focus { color: var(--accent); outline: none; }
.infotip svg { width: 13px; height: 13px; }
.infotip__pop {
  position: absolute; top: calc(100% + 8px); right: 0; width: 236px;
  background: #1c1c1c; color: var(--text); border: 1px solid var(--line-2); padding: 10px 12px;
  font-family: "Outfit", sans-serif; font-size: .76rem; font-weight: 400; line-height: 1.45;
  letter-spacing: 0; text-transform: none; border-radius: 9px; box-shadow: var(--shadow);
  opacity: 0; visibility: hidden; transform: translateY(-4px); transition: opacity .16s var(--ease), transform .16s var(--ease), visibility .16s;
  z-index: 45; pointer-events: none;
}
.infotip__pop::before { content: ""; position: absolute; top: -5px; right: 4px; width: 9px; height: 9px; background: #1c1c1c; border-left: 1px solid var(--line-2); border-top: 1px solid var(--line-2); transform: rotate(45deg); }
.infotip:hover .infotip__pop, .infotip:focus .infotip__pop, .infotip:focus-within .infotip__pop { opacity: 1; visibility: visible; transform: none; }

/* =============== SURFACE LANGUAGE — soft shadcn radii =============== */
.iconbtn, .searchbtn, .tinybtn, .seg, .period__presets, .selct, .table-search,
.agent__send, .agent__foot input, .msg__ic, .agent__avatar, .brand__chip,
.pager button, .date-range input, .nav__item, .rep-item,
.tag, .fchip, .suggest-chip, .cmdk__item { border-radius: var(--r-round); }
.fab, .demo-pill, .toast, .minibar, .minibar > span { border-radius: var(--r-pill); }
.fchip .x, .rep-item__av, .owner__av, .agent__live .dot, .demo-pill .dot { border-radius: 50%; }
.msg__bubble { border-radius: 14px; }
.agent, .cmdk__box { border-radius: var(--r); }
.drawer__hero { border-radius: var(--r-sm); }
.cellcar img, .thumbs img, .cmdk__item img { border-radius: 8px; }
/* soft rounded surfaces */
.kpi, .substats, .insights, .tablewrap, .panel { border-radius: var(--r); }
/* product photos in full colour (it's a car dealer) */
.cellcar img, .thumbs img, .drawer__hero, .cmdk__item img { filter: none; }

/* gold active states (accent — used sparingly) */
.seg button.active, .period__presets button.active { background: var(--accent); color: #fff; }
.nav__item.active::before { display: none; }

/* ---------------- RESPONSIVE ---------------- */
@media (max-width: 1180px) {
  .grid.c4 { grid-template-columns: repeat(2, 1fr); }
  .grid.c3 { grid-template-columns: 1fr; }
  .grid.s21, .grid.s12 { grid-template-columns: 1fr; }
}
@media (max-width: 920px) {
  .sidebar { position: fixed; transform: translateX(-101%); box-shadow: var(--shadow); }
  .sidebar.open { transform: none; }
  .menu-toggle { display: grid; }
  .grid.c2 { grid-template-columns: 1fr; }
  .view { padding: 14px; }
  .topbar { padding: 0 12px; gap: 8px; }
  .topbar__title small { display: none; }
  .hide-sm { display: none !important; }
}
@media (max-width: 560px) {
  .kpi__val { font-size: 1.35rem; }
  .date-range { display: none; }
}
