/* ============================================================
   VITRINE MOTORS · CRM
   Tokens, base, layout
   ============================================================ */

:root {
  /* Brand */
  --vm-orange:        #ff6a1f;
  --vm-orange-deep:   #e3550e;
  --vm-orange-soft:   #ffb285;
  --vm-graphite:      #1c2127;
  --vm-silver:        #9ba3ad;

  /* Type */
  --font-sans: 'Geist', ui-sans-serif, system-ui, sans-serif;
  --font-mono: 'Geist Mono', ui-monospace, monospace;
  --font-display: 'Bebas Neue', 'Geist', sans-serif;

  /* Type scale (8 steps, was 17 sizes pre-consolidation) */
  --fs-xxs: 11px;  /* badges, captions, meta — ex 9/10/11 */
  --fs-xs:  12px;  /* eyebrows, small labels */
  --fs-sm:  13px;  /* metadata, names in lists — ex 13/15 */
  --fs-md:  14px;  /* body default */
  --fs-lg:  16px;  /* section subtitles — ex 16/18 */
  --fs-xl:  20px;  /* page titles — ex 20/22 */
  --fs-2xl: 28px;  /* hero numbers / KPI big — ex 24/28/30 */
  --fs-3xl: 40px;  /* display — ex 32/36/50/60 */

  /* Categorical chart palette (chart-1 follows --accent) */
  --chart-1: var(--vm-orange);
  --chart-2: #4aa6ff;
  --chart-3: #3ec18b;
  --chart-4: #a36bff;
  --chart-5: #f5b142;
  --chart-6: #ef5757;
  --chart-pink: #ec4899;
  --chart-neutral: #6e7682;

  /* Radii */
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 14px;
  --r-xl: 20px;

  /* Shadow (dark) */
  --shadow-1: 0 1px 0 rgba(255,255,255,0.04) inset, 0 1px 2px rgba(0,0,0,0.4);
  --shadow-pop: 0 18px 40px -16px rgba(0,0,0,0.6), 0 2px 6px rgba(0,0,0,0.3);

  /* density (overridden on body) */
  --pad-card: 20px;
  --row-h:    44px;

  /* Accent */
  --accent: var(--vm-orange);
  --accent-soft: color-mix(in oklch, var(--accent) 18%, transparent);
  --accent-fg: #fff;
}

/* ---------- THEMES ---------- */
[data-theme="dark"] {
  --bg:           #0e1116;
  --bg-deep:      #090b10;
  --surface:      #14181f;
  --surface-2:    #1a1f27;
  --surface-3:    #232932;
  --border:       #262d37;
  --border-soft:  #1d232c;
  --text:         #e8ebf0;
  --text-dim:     #aab1bd;
  --text-mute:    #828a98; /* WCAG AA: 5.7:1 on #0e1116 */
  --success:      #3ec18b;
  --warning:      #f5b142;
  --danger:       #ef5757;
  --info:         #4aa6ff;
  --shadow-1: 0 1px 0 rgba(255,255,255,0.04) inset, 0 1px 2px rgba(0,0,0,0.4);
  --shadow-pop: 0 18px 40px -16px rgba(0,0,0,0.6), 0 2px 6px rgba(0,0,0,0.3);
}

[data-theme="light"] {
  --bg:           #e9ecf1; /* 2 tons mais escuro que o original (#f4f5f7) */
  --bg-deep:      #dfe2e8;
  --surface:      #ffffff;
  --surface-2:    #f1f3f6;
  --surface-3:    #e0e3e9; /* mantém-se mais escuro que --bg para containers (kanban col, catalog section) */
  --border:       #d4d8de;
  --border-soft:  #e6e9ee;
  --text:         #14181f;
  --text-dim:     #4a525e;
  --text-mute:    #525a66; /* WCAG AA: 5.5:1 on #e9ecf1 */
  --success:      #20a26b;
  --warning:      #d68a14;
  --danger:       #d63d3d;
  --info:         #1f7adf;
  --shadow-1: 0 1px 2px rgba(20,24,31,0.04);
  --shadow-pop: 0 24px 50px -20px rgba(20,24,31,0.18), 0 2px 6px rgba(20,24,31,0.06);
}

[data-theme="hybrid"] {
  --bg:           #e9ecf1; /* 2 tons mais escuro que o original (#f4f5f7) */
  --bg-deep:      #dfe2e8;
  --surface:      #ffffff;
  --surface-2:    #f1f3f6;
  --surface-3:    #e0e3e9; /* mantém-se mais escuro que --bg para containers (kanban col, catalog section) */
  --border:       #d4d8de;
  --border-soft:  #e6e9ee;
  --text:         #14181f;
  --text-dim:     #4a525e;
  --text-mute:    #525a66; /* WCAG AA: 5.5:1 on #e9ecf1 */
  --success:      #20a26b;
  --warning:      #d68a14;
  --danger:       #d63d3d;
  --info:         #1f7adf;
  --shadow-1: 0 1px 2px rgba(20,24,31,0.04);
  --shadow-pop: 0 24px 50px -20px rgba(20,24,31,0.18), 0 2px 6px rgba(20,24,31,0.06);
  /* sidebar overrides applied per-element */
}

[data-density="compact"] {
  --pad-card: 14px;
  --row-h:    36px;
}

* { box-sizing: border-box; }
html, body, #root { height: 100%; }
body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--fs-md);
  line-height: 1.45;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 8px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: var(--text-mute); }

/* ============================================================
   LAYOUT
   ============================================================ */
.app {
  display: grid;
  grid-template-columns: 248px 1fr;
  height: 100vh;
  overflow: hidden;
}
.app[data-collapsed="true"] { grid-template-columns: 72px 1fr; }

/* ============================================================
   SIDEBAR
   ============================================================ */
.sidebar {
  background: var(--surface);
  border-right: 1px solid var(--accent);
  /* TRON-like neon glow on the right edge */
  box-shadow:
    1px 0 8px color-mix(in oklch, var(--accent) 50%, transparent),
    2px 0 24px -2px color-mix(in oklch, var(--accent) 25%, transparent);
  display: flex;
  flex-direction: column;
  padding: 18px 14px;
  gap: 6px;
  position: relative;
  overflow: visible;
  z-index: 2;
}
[data-theme="hybrid"] .sidebar,
[data-sidebar="metallic"] .sidebar {
  background:
    radial-gradient(120% 80% at 0% 0%, rgba(255,106,31,0.06) 0%, transparent 55%),
    linear-gradient(180deg, #14181f 0%, #0c0f14 100%);
  color: #e8ebf0;
  border-right-color: #1d232c;
}
[data-sidebar="flat"] .sidebar {
  background: var(--surface);
}

.sidebar-brand {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 8px 14px 8px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 8px;
}
[data-sidebar="metallic"] .sidebar-brand,
[data-theme="hybrid"] .sidebar-brand { border-bottom-color: rgba(255,255,255,0.06); }

.sidebar-brand img {
  width: 36px; height: 36px;
  object-fit: contain; object-position: center;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.4));
}
.sidebar-brand .brand-text {
  font-family: var(--font-display);
  letter-spacing: 0.02em;
  font-size: var(--fs-xl);
  line-height: 1;
}
.sidebar-brand .brand-text .v { color: var(--vm-orange); }
.sidebar-brand .brand-text .m { color: inherit; }
.sidebar-brand .brand-sub {
  font-size: var(--fs-xxs);
  color: var(--text-mute);
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
[data-sidebar="metallic"] .sidebar-brand .brand-sub,
[data-theme="hybrid"] .sidebar-brand .brand-sub { color: rgba(255,255,255,0.4); }

.nav-section-label {
  font-size: var(--fs-xxs);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-mute);
  padding: 12px 12px 6px;
}
[data-sidebar="metallic"] .nav-section-label,
[data-theme="hybrid"] .nav-section-label { color: rgba(255,255,255,0.35); }

.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px;
  border-radius: var(--r-md);
  color: var(--text-dim);
  text-decoration: none;
  font-size: var(--fs-md);
  font-weight: 500;
  border: 1px solid transparent;
  background: transparent;
  width: 100%;
  text-align: left;
  cursor: pointer;
  position: relative;
}
[data-sidebar="metallic"] .nav-item,
[data-theme="hybrid"] .nav-item { color: rgba(255,255,255,0.7); }

.nav-item:hover {
  background: var(--surface-2);
  color: var(--text);
}
[data-sidebar="metallic"] .nav-item:hover,
[data-theme="hybrid"] .nav-item:hover {
  background: rgba(255,255,255,0.04);
  color: #fff;
}

.nav-item[aria-current="page"] {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: color-mix(in oklch, var(--accent) 25%, transparent);
}
.nav-item[aria-current="page"]::before {
  content: '';
  position: absolute;
  left: -14px; top: 8px; bottom: 8px;
  width: 3px; border-radius: 2px;
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent);
}
.nav-item .badge {
  margin-left: auto;
  background: var(--accent);
  color: #fff;
  font-size: var(--fs-xxs);
  padding: 2px 7px;
  border-radius: 999px;
  font-weight: 600;
}
.nav-item svg { flex-shrink: 0; }

.sidebar-bottom {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  display: flex; align-items: center; gap: 10px;
  padding: 12px 8px 4px;
}
[data-sidebar="metallic"] .sidebar-bottom,
[data-theme="hybrid"] .sidebar-bottom { border-top-color: rgba(255,255,255,0.06); }

.user-avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--vm-orange), var(--vm-orange-deep));
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 600;
  font-size: var(--fs-sm);
  flex-shrink: 0;
}
.user-meta { line-height: 1.2; min-width: 0; flex: 1; }
.user-meta .name { font-weight: 600; font-size: var(--fs-sm); color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-meta .role { font-size: var(--fs-xxs); color: var(--text-mute); }
[data-sidebar="metallic"] .user-meta .name,
[data-theme="hybrid"] .user-meta .name { color: #fff; }
[data-sidebar="metallic"] .user-meta .role,
[data-theme="hybrid"] .user-meta .role { color: rgba(255,255,255,0.5); }

/* ============================================================
   TOPBAR
   ============================================================ */
.main {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
}
.topbar {
  display: flex; align-items: center; gap: 16px;
  padding: 14px 28px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  height: 64px;
  flex-shrink: 0;
}
.topbar h1 {
  font-size: var(--fs-xl);
  font-weight: 600;
  margin: 0;
  letter-spacing: -0.01em;
}
.topbar .crumbs {
  font-size: var(--fs-xs);
  color: var(--text-mute);
  margin-bottom: 2px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.topbar-spacer { flex: 1; }
.topbar-search {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 14px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  width: 320px;
  color: var(--text-dim);
}
.topbar-search input {
  background: transparent; border: none; outline: none;
  color: var(--text); flex: 1;
  font-size: var(--fs-sm);
}
.topbar-icon-btn {
  width: 40px; height: 40px;
  border-radius: 50%;                                    /* circular TRON neon */
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex; align-items: center; justify-content: center;
  color: rgba(255, 255, 255, 0.78);
  position: relative;
  transition: background .18s, border-color .18s, color .18s, box-shadow .18s, transform .15s;
  cursor: pointer;
}
.topbar-icon-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--accent);
  color: #ffffff;
  box-shadow: 0 0 16px -2px color-mix(in oklch, var(--accent) 45%, transparent);
}
.topbar-icon-btn:active { transform: scale(0.96); }
.topbar-icon-btn .dot {
  position: absolute; top: 8px; right: 8px;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--vm-orange);
  border: none;
  box-shadow:
    0 0 0 2px rgba(28, 32, 41, 0.6),                     /* "halo" escuro pra destacar do bg */
    0 0 8px var(--accent);                                /* glow laranja externo */
}

.page {
  flex: 1;
  overflow: auto;
  padding: 24px 28px 40px;
}

/* ============================================================
   PRIMITIVES
   ============================================================ */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--pad-card);
  box-shadow: var(--shadow-1);
}
.card-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 14px;
}
.card-head h3 {
  margin: 0;
  font-size: var(--fs-md);
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.005em;
}
.card-head .sub {
  font-size: var(--fs-xs); color: var(--text-mute);
}

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 16px;
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  font-size: var(--fs-sm);
  font-weight: 500;
  transition: all .15s;
}
.btn:hover { border-color: var(--text-mute); background: var(--surface-3); }
.btn-primary,
.btn-success {
  background: linear-gradient(180deg, var(--accent) 0%, var(--vm-orange-deep) 100%);
  color: #fff;
  border-color: var(--vm-orange-deep);
  box-shadow:
    0 1px 0 rgba(255,255,255,0.22) inset,
    0 4px 14px -4px color-mix(in oklch, var(--accent) 45%, transparent);
}
.btn-primary:hover,
.btn-success:hover {
  filter: brightness(1.06);
  border-color: var(--vm-orange-deep);
}

/* Warning — gradiente amarelo-âmbar, mesmo estilo que primary */
.btn-warning {
  background: linear-gradient(180deg, var(--warning) 0%, color-mix(in oklch, var(--warning), black 22%) 100%);
  color: #fff;
  border-color: color-mix(in oklch, var(--warning), black 22%);
  box-shadow:
    0 1px 0 rgba(255,255,255,0.22) inset,
    0 4px 14px -4px color-mix(in oklch, var(--warning) 45%, transparent);
}
.btn-warning:hover { filter: brightness(1.06); }

/* Danger — gradiente vermelho, mesmo estilo */
.btn-danger {
  background: linear-gradient(180deg, var(--danger) 0%, color-mix(in oklch, var(--danger), black 22%) 100%);
  color: #fff;
  border-color: color-mix(in oklch, var(--danger), black 22%);
  box-shadow:
    0 1px 0 rgba(255,255,255,0.22) inset,
    0 4px 14px -4px color-mix(in oklch, var(--danger) 45%, transparent);
}
.btn-danger:hover { filter: brightness(1.06); }

/* ============================================================
   COMPONENTES — página de showcase
   ============================================================ */
.cmp-page { display: flex; flex-direction: column; gap: 16px; }
.cmp-section { display: flex; flex-direction: column; gap: 14px; }
.cmp-body { display: flex; flex-direction: column; gap: 14px; padding-top: 4px; }
.cmp-row {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 16px;
  padding: 12px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  align-items: flex-start;
}
.cmp-row:first-child { border-top: none; padding-top: 0; }
.cmp-row-label {
  font-size: var(--fs-xs);
  color: rgba(255, 255, 255, 0.55);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
}
.cmp-row-content { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

.cmp-kpi-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}

.cmp-typo {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.cmp-typo > div {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 16px;
  align-items: center;
  padding: 6px 0;
}
.cmp-typo-label {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  color: rgba(255, 255, 255, 0.55);
}

.cmp-swatch {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: center;
  min-width: 84px;
}
.cmp-swatch-color {
  width: 64px; height: 48px;
  border-radius: var(--r-md);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 2px 8px -2px rgba(0, 0, 0, 0.4);
}
.cmp-swatch-name {
  font-family: var(--font-mono);
  font-size: var(--fs-xxs);
  color: rgba(255, 255, 255, 0.78);
  text-align: center;
}

@media (max-width: 720px) {
  .cmp-row { grid-template-columns: 1fr; gap: 8px; }
  .cmp-typo > div { grid-template-columns: 1fr; gap: 4px; }
}

.btn-ghost {
  background: transparent; border-color: transparent; color: var(--text-dim);
}
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.btn-sm { padding: 6px 12px; font-size: var(--fs-xs); }
.btn-icon { padding: 8px; gap: 0; }

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 9px;
  font-size: var(--fs-xxs);
  font-weight: 500;
  border-radius: 999px;
  background: var(--surface-3);
  color: var(--text-dim);
  border: 1px solid var(--border);
  white-space: nowrap;
}
.chip-orange { background: color-mix(in oklch, var(--accent) 16%, transparent); color: var(--accent); border-color: color-mix(in oklch, var(--accent) 30%, transparent); }
.chip-green  { background: color-mix(in oklch, var(--success) 14%, transparent); color: var(--success); border-color: color-mix(in oklch, var(--success) 28%, transparent); }
.chip-red    { background: color-mix(in oklch, var(--danger) 14%, transparent); color: var(--danger); border-color: color-mix(in oklch, var(--danger) 28%, transparent); }
.chip-amber  { background: color-mix(in oklch, var(--warning) 14%, transparent); color: var(--warning); border-color: color-mix(in oklch, var(--warning) 28%, transparent); }
.chip-blue   { background: color-mix(in oklch, var(--info) 14%, transparent); color: var(--info); border-color: color-mix(in oklch, var(--info) 28%, transparent); }
.chip-mute   { background: var(--surface-3); color: var(--text-mute); }

.dot-status {
  display: inline-block;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--text-mute);
}
.dot-status.green { background: var(--success); box-shadow: 0 0 0 3px color-mix(in oklch, var(--success) 24%, transparent); }
.dot-status.amber { background: var(--warning); box-shadow: 0 0 0 3px color-mix(in oklch, var(--warning) 24%, transparent); }
.dot-status.red   { background: var(--danger); box-shadow: 0 0 0 3px color-mix(in oklch, var(--danger) 24%, transparent); }

.avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff;
  font-size: var(--fs-xs);
  font-weight: 600;
  flex-shrink: 0;
  border: 2px solid var(--surface);
}
.avatar-xs { width: 22px; height: 22px; font-size: var(--fs-xxs); border-width: 1.5px; }
.avatar-sm { width: 28px; height: 28px; font-size: var(--fs-xxs); }
.avatar-lg { width: 44px; height: 44px; font-size: var(--fs-md); }

.kpi {
  display: flex; flex-direction: column; gap: 8px;
  padding: var(--pad-card);
  background:
    radial-gradient(120% 90% at 100% 0%, color-mix(in oklch, var(--kpi-tone, var(--accent)) 12%, transparent) 0%, transparent 55%),
    var(--surface);
  border: 1px solid var(--border);
  border-top: 3px solid var(--kpi-tone, var(--accent));
  border-radius: var(--r-lg);
  position: relative;
  overflow: hidden;
}
.kpi-label { font-size: var(--fs-xs); color: var(--text-mute); text-transform: uppercase; letter-spacing: 0.06em; font-weight: 500; }
.kpi-value { font-size: var(--fs-2xl); font-weight: 700; color: var(--text); letter-spacing: -0.02em; line-height: 1; font-family: var(--font-display); letter-spacing: 0.02em; }
.kpi-meta { font-size: var(--fs-xs); color: var(--text-mute); display: flex; align-items: center; gap: 6px; }
.kpi-trend.up { color: var(--success); }
.kpi-trend.down { color: var(--danger); }
.kpi-icon {
  position: absolute; top: 16px; right: 16px;
  width: 32px; height: 32px;
  border-radius: var(--r-md);
  background: color-mix(in oklch, var(--kpi-tone, var(--accent)) 18%, transparent);
  color: var(--kpi-tone, var(--accent));
  display: flex; align-items: center; justify-content: center;
}

/* Dashboard hero greeting — subtle gradient text */
.dash-hero h2 {
  background: linear-gradient(135deg, var(--text) 0%, var(--accent) 80%, var(--vm-orange-deep) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  display: inline-block;
}

/* Dashboard section identity */
.dash-section { border-top: 3px solid var(--rep-color, var(--accent)); }
.dash-section.dash-funnel { --rep-color: var(--chart-1); }
.dash-section.dash-origin { --rep-color: var(--chart-2); }
.dash-section .card-head h3 { color: var(--text); }

/* Page bg gradient escuro — aplica em light/hybrid sobre área de conteúdo (.main) */
[data-theme="hybrid"] .main,
[data-theme="light"]  .main {
  background:
    radial-gradient(70% 55% at 0% 0%, color-mix(in oklch, var(--accent) 12%, transparent) 0%, transparent 60%),
    linear-gradient(85deg, #1c2029, #22272fe0);
}

/* Headers de página sobre bg escuro — escopo restrito ao bloco do título e ao .lead
   (não vaza para PeriodSelector, botões de ação, chips, etc. que ficam dentro do title-row mas têm bg próprio claro) */
[data-theme="hybrid"] .title-row > div:first-child,
[data-theme="light"]  .title-row > div:first-child,
[data-theme="hybrid"] .title-row > .lead,
[data-theme="light"]  .title-row > .lead,
[data-theme="hybrid"] .rep-header > div:first-child,
[data-theme="light"]  .rep-header > div:first-child {
  --text: #ffffff;
  --text-dim: rgba(255, 255, 255, 0.78);
  --text-mute: rgba(255, 255, 255, 0.55);
  color: var(--text);
}
[data-theme="hybrid"] .rep-header > div:first-child h2,
[data-theme="light"]  .rep-header > div:first-child h2 {
  color: #ffffff;
}

/* Topbar sobre bg escuro — mesmo gradient da .main com texto claro;
   a search-pill e os ícones mantém bg próprio claro (efeito Slack/Discord) */
[data-theme="hybrid"] .topbar,
[data-theme="light"]  .topbar {
  background: linear-gradient(85deg, #1c2029, #22272fe0);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  color: #ffffff;
}
[data-theme="hybrid"] .topbar h1,
[data-theme="light"]  .topbar h1 { color: #ffffff; }
[data-theme="hybrid"] .topbar .crumbs,
[data-theme="light"]  .topbar .crumbs { color: rgba(255, 255, 255, 0.55); }

/* ============================================================
   GLASS CARDS — frosted glass overlay sobre o gradient escuro
   - bg translucent white 4%
   - backdrop-filter blur 18px
   - borda white 14% via redefine de --border (preserva border-top/border-left
     de identidade nas seções/colunas/cards de status)
   - texto branco (redefine de --text/--text-dim/--text-mute)
   ============================================================ */
[data-theme="hybrid"] .card:not(.alert-card),
[data-theme="light"]  .card:not(.alert-card),
[data-theme="hybrid"] .kpi,
[data-theme="light"]  .kpi,
[data-theme="hybrid"] .lead-card,
[data-theme="light"]  .lead-card,
[data-theme="hybrid"] .veh-card,
[data-theme="light"]  .veh-card,
[data-theme="hybrid"] .wa-info-section,
[data-theme="light"]  .wa-info-section,
[data-theme="hybrid"] .kanban-col,
[data-theme="light"]  .kanban-col,
[data-theme="hybrid"] .catalog-section,
[data-theme="light"]  .catalog-section {
  background: rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  --text:        #ffffff;
  --text-dim:    rgba(255, 255, 255, 0.78);
  --text-mute:   rgba(255, 255, 255, 0.55);
  --border:      rgba(255, 255, 255, 0.14);
  --border-soft: rgba(255, 255, 255, 0.06);
  --surface-2:   rgba(255, 255, 255, 0.06);
  --surface-3:   rgba(255, 255, 255, 0.08);
  color: var(--text);
}

/* Container externo do WhatsApp — transparent para que os painéis filhos (wa-list,
   wa-chat, wa-info) revelem o gradient escuro da .main por trás do glass */
[data-theme="hybrid"] .wa-wrap,
[data-theme="light"]  .wa-wrap {
  background: transparent;
  border-color: rgba(255, 255, 255, 0.08);
}

/* Painéis externos do WhatsApp (lista esquerda + rail direita) — glass mais visível
   pra contrastar com o gradient escuro */
[data-theme="hybrid"] .wa-list,
[data-theme="light"]  .wa-list,
[data-theme="hybrid"] .wa-info,
[data-theme="light"]  .wa-info {
  background: rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  --text:        #ffffff;
  --text-dim:    rgba(255, 255, 255, 0.78);
  --text-mute:   rgba(255, 255, 255, 0.55);
  --border:      rgba(255, 255, 255, 0.14);
  --border-soft: rgba(255, 255, 255, 0.06);
  --surface-2:   rgba(255, 255, 255, 0.06);
  --surface-3:   rgba(255, 255, 255, 0.08);
  color: var(--text);
}

/* Wa-info-section dentro do wa-info (já em glass) — ligeiramente mais opaco
   pra criar efeito de "card sobre tray" */
[data-theme="hybrid"] .wa-info-section,
[data-theme="light"]  .wa-info-section {
  background: rgba(255, 255, 255, 0.06);
}

/* Mobile (≤ 900px) — gradient da página vai de baixo pra cima */
@media (max-width: 900px) {
  [data-theme="hybrid"] .main,
  [data-theme="light"]  .main {
    background:
      radial-gradient(80% 40% at 50% 100%, color-mix(in oklch, var(--accent) 12%, transparent) 0%, transparent 60%),
      linear-gradient(to top, #1c2029, #22272fe0);
  }
  [data-theme="hybrid"] .topbar,
  [data-theme="light"]  .topbar {
    background: linear-gradient(to top, #1c2029, #22272fe0);
  }
}

/* Dash hero gradient text — agora branco → laranja em vez de preto → laranja */
[data-theme="hybrid"] .dash-hero h2,
[data-theme="light"]  .dash-hero h2 {
  background: linear-gradient(135deg, #ffffff 0%, var(--accent) 70%, var(--vm-orange-deep) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  display: inline-block;
}

/* ============================================================
   FORM CONTROLS
   ============================================================ */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: var(--fs-xs); color: var(--text-dim); font-weight: 500; }
.input, .select, .textarea {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 9px 12px;
  color: var(--text);
  font-size: var(--fs-sm);
  outline: none;
  transition: border-color .15s;
  width: 100%;
}
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in oklch, var(--accent) 18%, transparent);
}
.textarea { resize: vertical; min-height: 80px; }

/* ============================================================
   PAGE-SPECIFIC styles imported below
   ============================================================ */

/* DASHBOARD */
.dash-grid { display: grid; gap: 18px; }
.dash-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.dash-row { display: grid; gap: 18px; }
.dash-row-2 { grid-template-columns: 2fr 1fr; }
.dash-row-3 { grid-template-columns: 1fr 1fr 1fr; }
.dash-row-funnel { grid-template-columns: 1.4fr 1fr; }

/* funnel */
.funnel { display: flex; flex-direction: column; gap: 6px; }
.funnel-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  align-items: center;
}
.funnel-bar {
  height: 32px;
  border-radius: 6px;
  background: linear-gradient(90deg, var(--accent), color-mix(in oklch, var(--accent) 65%, transparent));
  display: flex; align-items: center;
  padding: 0 12px;
  color: #fff;
  font-weight: 500;
  font-size: var(--fs-sm);
  position: relative;
  min-width: 90px;
}
.funnel-bar.f0 { background: linear-gradient(90deg, #4aa6ff, #357fcd); }
.funnel-bar.f1 { background: linear-gradient(90deg, #5fb4d6, #438ba8); }
.funnel-bar.f2 { background: linear-gradient(90deg, #ffb285, #ff8a4d); }
.funnel-bar.f3 { background: linear-gradient(90deg, #ff8e4f, #ff6a1f); }
.funnel-bar.f4 { background: linear-gradient(90deg, #ff6a1f, #e3550e); }
.funnel-bar.f5 { background: linear-gradient(90deg, #3ec18b, #2a9968); }
.funnel-pct { font-size: var(--fs-xs); color: var(--text-mute); width: 50px; text-align: right; font-variant-numeric: tabular-nums; }

/* heatmap */
.heatmap-grid {
  display: grid;
  grid-template-columns: 30px repeat(24, 1fr);
  gap: 2px;
  font-size: var(--fs-xxs);
  color: var(--text-mute);
}
.heatmap-cell {
  aspect-ratio: 1;
  border-radius: 3px;
  background: var(--surface-3);
  position: relative;
}

/* ranking */
.ranking-list { display: flex; flex-direction: column; }
.ranking-row {
  display: grid;
  grid-template-columns: 28px auto 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-soft);
}
.ranking-row:last-child { border-bottom: none; }
.ranking-rank { font-family: var(--font-display); font-size: var(--fs-lg); color: var(--text-mute); width: 24px; }
.ranking-rank.top { color: var(--accent); }

/* origins */
.origin-row {
  display: grid;
  grid-template-columns: 24px 100px 1fr 50px;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
}
.origin-bar {
  height: 8px;
  background: var(--surface-3);
  border-radius: 4px;
  overflow: hidden;
}
.origin-bar > div {
  height: 100%;
  background: var(--accent);
  border-radius: 4px;
}

/* top vehicles list */
.top-vehicle-row {
  display: grid;
  grid-template-columns: 56px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-soft);
}
.top-vehicle-row:last-child { border-bottom: none; }
.top-vehicle-thumb {
  width: 56px; height: 40px;
  border-radius: 6px;
  background: var(--surface-3);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-mute);
  overflow: hidden;
}
.top-vehicle-thumb img { width: 100%; height: 100%; object-fit: cover; }

/* ============================================================
   KANBAN
   ============================================================ */
.kanban {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding-bottom: 8px;
  height: calc(100vh - 64px - 48px - 70px);
  overflow-x: auto;
}
.kanban-col {
  flex: 0 0 290px;
  background: var(--surface-3); /* #eef0f4 — 6 pts abaixo do page bg, separação clara */
  border: 1px solid var(--border);
  border-top: 3px solid var(--stage-color, var(--accent));
  border-radius: var(--r-lg);
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden; /* radius corta o header tinted */
}
.kanban-col-head {
  display: flex; align-items: center; gap: 8px;
  padding: 14px;
  background: color-mix(in oklch, var(--stage-color, var(--accent)) 8%, transparent);
  border-bottom: 1px solid var(--border);
}
.kanban-col-head .col-dot {
  width: 10px; height: 10px; border-radius: 50%;
  box-shadow: 0 0 0 2px color-mix(in oklch, var(--stage-color, var(--accent)) 30%, transparent);
}
.kanban-col-head .col-name { font-weight: 600; font-size: var(--fs-sm); flex: 1; }
.kanban-col-head .col-count {
  font-size: var(--fs-xxs);
  color: #ffffff;
  background: color-mix(in oklch, var(--stage-color, var(--accent)) 28%, transparent);
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid color-mix(in oklch, var(--stage-color, var(--accent)) 40%, transparent);
}
.kanban-col-body {
  flex: 1;
  overflow-y: auto;
  padding: 12px 10px;
  display: flex; flex-direction: column; gap: 10px;
}
.kanban-col-body::-webkit-scrollbar { width: 6px; }
.kanban-col-body::-webkit-scrollbar-thumb { background: var(--border); border: none; }
.lead-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 12px;
  cursor: pointer;
  transition: all .15s;
  position: relative;
  display: flex; flex-direction: column; gap: 8px;
  box-shadow: 0 1px 2px rgba(20,24,31,0.04), 0 1px 0 rgba(255,255,255,0.6) inset;
}
.lead-card:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
  box-shadow: 0 8px 20px -8px rgba(20,24,31,0.18), 0 2px 4px rgba(20,24,31,0.06);
}
.lead-card-head { display: flex; align-items: center; gap: 8px; }
.lead-card-head .name { font-weight: 600; font-size: var(--fs-md); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lead-card-vehicle {
  display: flex; align-items: center; gap: 8px;
  padding: 8px;
  background: var(--surface-2);
  border-radius: 6px;
  border: 1px solid var(--border-soft);
}
.lead-card-vehicle img { width: 48px; height: 36px; border-radius: 5px; object-fit: cover; }
.lead-card-vehicle .veh-name { font-size: var(--fs-md); font-weight: 500; line-height: 1.25; }
.lead-card-vehicle .veh-price { font-size: var(--fs-sm); color: var(--text-mute); margin-top: 3px; }
.lead-card-meta {
  display: flex; align-items: center; gap: 8px;
  font-size: var(--fs-xxs);
  color: var(--text-mute);
  flex-wrap: wrap;
}
.lead-card-foot {
  display: flex; align-items: center; gap: 6px;
  padding-top: 6px;
  border-top: 1px solid var(--border-soft);
  font-size: var(--fs-xxs);
  color: var(--text-mute);
}
.lead-card-foot .last { flex: 1; }
.tag-pill {
  font-size: var(--fs-xxs);
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--surface-3);
  color: var(--text-dim);
  font-weight: 500;
}
/* Temperature — primary tags: filled tint, high salience */
.tag-pill.hot  { background: color-mix(in oklch, var(--chart-6) 18%, transparent); color: var(--chart-6); font-weight: 600; }
.tag-pill.warm { background: color-mix(in oklch, var(--chart-5) 18%, transparent); color: var(--chart-5); font-weight: 600; }
.tag-pill.cold { background: color-mix(in oklch, var(--chart-2) 18%, transparent); color: var(--chart-2); font-weight: 600; }

/* Modalidade — secondary tags: outline only, lower salience */
.tag-pill.financiacion,
.tag-pill.contado { background: transparent; border: 1px solid var(--border); color: var(--text-dim); font-weight: 500; }

.kanban-toolbar {
  display: flex; align-items: center; gap: 10px;
  padding: 0 0 14px;
}

/* drawer */
.drawer-backdrop {
  position: fixed; inset: 0;
  background: rgba(8,10,14,0.6);
  backdrop-filter: blur(4px);
  z-index: 50;
  animation: fadeIn .2s;
}
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: min(560px, 92vw);
  /* Painel slide-in dark — gradient diagonal sutil + glow neon laranja na borda esquerda */
  background: linear-gradient(135deg, #1c2029 0%, #16191f 100%);
  border-left: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow:
    -1px 0 24px -4px color-mix(in oklch, var(--accent) 25%, transparent),
    -8px 0 32px -8px rgba(0, 0, 0, 0.5);
  /* Texto branco + tokens redefinidos pra dark coerente com o resto do sistema */
  --text: #ffffff;
  --text-dim: rgba(255, 255, 255, 0.78);
  --text-mute: rgba(255, 255, 255, 0.55);
  --border: rgba(255, 255, 255, 0.14);
  --border-soft: rgba(255, 255, 255, 0.06);
  --surface-2: rgba(255, 255, 255, 0.06);
  --surface-3: rgba(255, 255, 255, 0.08);
  color: var(--text);
  z-index: 51;
  display: flex; flex-direction: column;
  animation: slideInRight .25s cubic-bezier(.2,.7,.2,1);
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideInRight { from { transform: translateX(40px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
.drawer-head {
  padding: 18px 22px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex; align-items: center; gap: 12px;
}
.drawer-body { flex: 1; overflow-y: auto; padding: 22px; display: flex; flex-direction: column; gap: 22px; }
.drawer-foot { padding: 14px 22px; border-top: 1px solid rgba(255, 255, 255, 0.08); display: flex; gap: 10px; justify-content: flex-end; }

.timeline { display: flex; flex-direction: column; gap: 14px; position: relative; }
.timeline::before {
  content: '';
  position: absolute;
  left: 11px; top: 8px; bottom: 8px;
  width: 2px;
  background: var(--border);
}
.tl-item { display: grid; grid-template-columns: 24px 1fr; gap: 12px; position: relative; }
.tl-dot {
  width: 24px; height: 24px;
  border-radius: 50%;
  background: var(--surface-2);
  border: 2px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-mute);
  z-index: 1;
}
.tl-dot.accent { background: var(--accent); border-color: var(--accent); color: #fff; }
.tl-dot.green { background: var(--success); border-color: var(--success); color: #fff; }
.tl-content { padding-top: 2px; }
.tl-content .when { font-size: var(--fs-xxs); color: var(--text-mute); }
.tl-content .what { font-size: var(--fs-sm); color: var(--text); margin-top: 2px; }

/* ============================================================
   WHATSAPP
   ============================================================ */
.wa-wrap {
  display: grid;
  grid-template-columns: 360px 1fr 320px;
  height: calc(100vh - 64px - 48px);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
  background: var(--surface);
}
.wa-list {
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  background: var(--surface);
}
.wa-list-head {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 10px;
}
.wa-list-search {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
}
.wa-list-search input { background: transparent; border: none; outline: none; flex: 1; font-size: var(--fs-sm); color: var(--text); }
.wa-stats { display: flex; gap: 14px; font-size: var(--fs-xxs); }
.wa-stats .stat { display: flex; flex-direction: column; }
.wa-stats .stat .v { font-weight: 700; font-size: var(--fs-md); color: var(--text); }
.wa-stats .stat .l { color: var(--text-mute); }
.wa-list-body { overflow-y: auto; flex: 1; }
.wa-conv {
  display: grid;
  grid-template-columns: 44px 1fr auto;
  gap: 10px;
  padding: 12px 14px 12px 11px;
  border-left: 3px solid transparent;
  border-bottom: 1px solid var(--border-soft);
  cursor: pointer;
  transition: background .12s, border-left-color .12s;
  align-items: center;
}
.wa-conv:hover { background: var(--surface-2); }
.wa-conv.active {
  background: color-mix(in oklch, var(--accent) 14%, transparent);
  border-left-color: var(--accent);
}
.wa-conv .conv-avatar {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2a3038, #1c2127);
  color: #fff; font-weight: 600;
  display: flex; align-items: center; justify-content: center;
  position: relative;
}
.wa-conv .conv-avatar .seller-badge {
  position: absolute; bottom: -2px; right: -2px;
  width: 18px; height: 18px;
  border-radius: 50%;
  border: 2px solid var(--surface);
  font-size: var(--fs-xxs);
  font-weight: 700;
}
.wa-conv .conv-mid { min-width: 0; }
.wa-conv .conv-name { font-weight: 600; font-size: var(--fs-sm); display: flex; align-items: center; gap: 6px; }
.wa-conv .conv-preview {
  font-size: var(--fs-xs); color: var(--text-mute);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.wa-conv .conv-right { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.wa-conv .conv-time { font-size: var(--fs-xxs); color: var(--text-mute); }
.wa-conv .conv-time.green { color: var(--success); }
.wa-conv .conv-time.amber { color: var(--warning); }
.wa-conv .conv-time.red { color: var(--danger); }
.wa-conv .conv-unread {
  background: var(--accent);
  color: #fff;
  font-size: var(--fs-xxs);
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 999px;
  min-width: 18px;
  text-align: center;
}

.wa-chat {
  display: flex; flex-direction: column;
  background:
    radial-gradient(120% 80% at 50% 0%, color-mix(in oklch, var(--accent) 4%, transparent), transparent 60%),
    var(--bg-deep);
}
/* WhatsApp dark theme — converte chat de bege clássico para dark coerente com o sistema */
[data-theme="light"] .wa-chat,
[data-theme="hybrid"] .wa-chat {
  background:
    radial-gradient(120% 80% at 50% 0%, color-mix(in oklch, var(--accent) 6%, transparent), transparent 60%),
    #0b141a;
  /* Redefine tokens locais — todos os elementos filhos (chat-head, msgs, composer) herdam */
  --text: #ffffff;
  --text-dim: rgba(255, 255, 255, 0.78);
  --text-mute: rgba(255, 255, 255, 0.55);
  --border: rgba(255, 255, 255, 0.14);
  --border-soft: rgba(255, 255, 255, 0.06);
  --surface: rgba(255, 255, 255, 0.05);
  --surface-2: rgba(255, 255, 255, 0.06);
  --surface-3: rgba(255, 255, 255, 0.08);
  color: var(--text);
}

/* Chat header — glass sutil com border-bottom subtle */
[data-theme="light"] .wa-chat .wa-chat-head,
[data-theme="hybrid"] .wa-chat .wa-chat-head {
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

/* Composer — glass dark */
[data-theme="light"] .wa-chat .wa-composer,
[data-theme="hybrid"] .wa-chat .wa-composer {
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

/* Outgoing bubble — verde-escuro WhatsApp dark (era verde claro #d9fdd3) */
[data-theme="light"] .wa-chat .wa-msg.out,
[data-theme="hybrid"] .wa-chat .wa-msg.out {
  background: #005c4b;
  color: #e8ebf0;
  border: none;
}

.wa-chat-head {
  padding: 12px 18px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 12px;
  background: var(--surface);
}
.wa-chat-head .h-name { font-weight: 600; font-size: var(--fs-md); }
.wa-chat-head .h-sub { font-size: var(--fs-xxs); color: var(--text-mute); display: flex; align-items: center; gap: 6px; }
.wa-chat-actions { margin-left: auto; display: flex; gap: 6px; }

.wa-messages {
  flex: 1;
  overflow-y: auto;
  padding: 22px 28px;
  display: flex; flex-direction: column; gap: 8px;
}
.wa-msg {
  max-width: 65%;
  padding: 8px 12px;
  border-radius: 10px;
  font-size: var(--fs-sm);
  line-height: 1.4;
  position: relative;
}
.wa-msg .meta { font-size: var(--fs-xxs); color: var(--text-mute); margin-top: 4px; display: flex; gap: 6px; align-items: center; justify-content: flex-end; }
.wa-msg.in { background: var(--surface); align-self: flex-start; border: 1px solid var(--border); border-top-left-radius: 2px; }
.wa-msg.out { background: #d9fdd3; color: #14181f; align-self: flex-end; border-top-right-radius: 2px; }
[data-theme="dark"] .wa-msg.out { background: #056162; color: #e8ebf0; }
.wa-msg.bot { background: linear-gradient(180deg, color-mix(in oklch, var(--accent) 14%, var(--surface)), var(--surface)); align-self: flex-end; border: 1px solid color-mix(in oklch, var(--accent) 30%, transparent); border-top-right-radius: 2px; }
.wa-msg .bot-tag {
  font-size: var(--fs-xxs);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  font-weight: 700;
  margin-bottom: 4px;
}
.wa-msg .vehicle-card-mini {
  margin-top: 8px;
  border-radius: 8px;
  overflow: hidden;
  background: var(--surface-2);
  border: 1px solid var(--border);
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 8px;
  padding: 6px;
  align-items: center;
}
.wa-msg .vehicle-card-mini img { width: 80px; height: 60px; object-fit: cover; border-radius: 4px; }
.wa-msg .vehicle-card-mini .vc-name { font-weight: 600; font-size: var(--fs-xs); color: var(--text); }
.wa-msg .vehicle-card-mini .vc-price { font-size: var(--fs-sm); color: var(--accent); font-weight: 700; }

.wa-day-sep {
  align-self: center;
  background: var(--surface-3);
  color: var(--text-mute);
  font-size: var(--fs-xxs);
  padding: 3px 12px;
  border-radius: 999px;
  margin: 8px 0;
}

.wa-composer {
  border-top: 1px solid var(--border);
  background: var(--surface);
  padding: 12px 16px;
  display: flex; flex-direction: column; gap: 10px;
}
.wa-templates { display: flex; gap: 6px; flex-wrap: wrap; }
.wa-templates .tmpl {
  font-size: var(--fs-xxs);
  padding: 4px 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-dim);
  cursor: pointer;
}
.wa-templates .tmpl:hover { border-color: var(--accent); color: var(--accent); }
.wa-input-row {
  display: flex; align-items: center; gap: 10px;
}
.wa-input-row .input { flex: 1; }
.wa-bot-toggle {
  display: flex; align-items: center; gap: 8px;
  font-size: var(--fs-xs); color: var(--text-dim);
  margin-right: auto;
}

.wa-info {
  border-left: 1px solid var(--border);
  background: var(--surface-2);
  padding: 12px;
  display: flex; flex-direction: column;
  overflow-y: auto;
}
.wa-info-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 14px 16px;
  margin-bottom: 12px;
}
.wa-info-section:last-child { margin-bottom: 0; }
.wa-info-section h4 {
  margin: 0 0 10px;
  font-size: var(--fs-xs);
  color: var(--text);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 600;
  display: flex; align-items: center; gap: 6px;
}
.wa-info-row { display: flex; justify-content: space-between; gap: 10px; padding: 4px 0; font-size: var(--fs-sm); }
.wa-info-row .k { color: var(--text-mute); }

/* Identity colors per section */
.wa-info-section.contact-card {
  border-top: 3px solid var(--temp-color, var(--accent));
}
.wa-info-section.origin-card {
  border-left: 3px solid var(--canal-color, var(--text-mute));
}

/* Compact fchip in WhatsApp list head */
.wa-list-head .filter-chips { margin-bottom: 0; gap: 6px; }
.wa-list-head .filter-chips .fchip { padding: 6px 10px; font-size: var(--fs-xxs); gap: 6px; }
.wa-list-head .filter-chips .fchip-count { font-size: 10px; padding: 0 5px; margin-left: 0; }
.wa-list-head .filter-chips .fchip-dot { width: 6px; height: 6px; }

/* toggle switch */
.switch {
  position: relative;
  width: 36px; height: 20px;
  background: var(--surface-3);
  border-radius: 999px;
  cursor: pointer;
  transition: background .2s;
  border: 1px solid var(--border);
  flex-shrink: 0;
}
.switch::after {
  content: '';
  position: absolute;
  top: 2px; left: 2px;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--text);
  transition: transform .2s;
}
.switch[aria-checked="true"] { background: var(--accent); border-color: var(--accent); }
.switch[aria-checked="true"]::after { transform: translateX(16px); background: #fff; }

/* ============================================================
   CATÁLOGO
   ============================================================ */

/* Filter chips — substituem dropdowns nativos com feedback visual claro */
.filter-chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.fchip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.78);
  font-size: var(--fs-xs);
  font-weight: 500;
  cursor: pointer;
  transition: all .15s;
  font-family: inherit;
  --fchip-color: var(--accent);
}
.fchip:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.22);
  color: #ffffff;
}
.fchip-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--fchip-color);
  opacity: 0.7;
}
.fchip-count {
  font-size: var(--fs-xxs);
  background: rgba(255, 255, 255, 0.1);
  padding: 1px 7px;
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.78);
  font-weight: 600;
  margin-left: 2px;
}
.fchip.on {
  background: color-mix(in oklch, var(--fchip-color) 14%, transparent);
  border-color: var(--fchip-color);
  color: var(--fchip-color);
  font-weight: 600;
}
.fchip.on .fchip-dot { opacity: 1; }
.fchip.on .fchip-count {
  background: var(--fchip-color);
  color: #fff;
}
.fchip[data-tone="success"] { --fchip-color: var(--success); }
.fchip[data-tone="warning"] { --fchip-color: var(--warning); }
.fchip[data-tone="mute"]    { --fchip-color: var(--text-mute); }
.fchip[data-tone="orange"]  { --fchip-color: var(--vm-orange); }
.fchip[data-tone="info"]    { --fchip-color: var(--info); }
.fchip[data-tone="neutral"] { --fchip-color: var(--accent); }

/* Catálogo section — container por categoria com border-top colorida */
.catalog-section {
  background: var(--surface-3);
  border: 1px solid var(--border);
  border-top: 3px solid var(--cat-color, var(--accent));
  border-radius: var(--r-lg);
  padding: 14px 16px 18px;
  margin-bottom: 16px;
  --cat-color: var(--accent);
}
.catalog-section[data-cat="pickup"] { --cat-color: var(--vm-orange); }
.catalog-section[data-cat="suv"]    { --cat-color: var(--info); }
.catalog-section[data-cat="sedan"]  { --cat-color: var(--success); }
.catalog-section-head {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-soft);
  color: var(--cat-color);
}
.catalog-section-head .cat-name {
  font-weight: 600; font-size: var(--fs-md);
  color: var(--text);
}
.catalog-section-head .cat-count {
  font-size: var(--fs-xxs);
  background: var(--cat-color);
  color: #fff;
  padding: 2px 9px;
  border-radius: 999px;
  font-weight: 600;
}

/* Empty state */
.catalog-empty {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  padding: 60px 20px;
  text-align: center;
  color: var(--text-mute);
  border: 1px dashed var(--border);
  border-radius: var(--r-lg);
  background: var(--surface-2);
}
.catalog-empty .empty-title {
  font-size: var(--fs-md); font-weight: 600; color: var(--text);
  margin-top: 4px;
}
.catalog-empty .empty-sub {
  font-size: var(--fs-xs);
  margin-bottom: 6px;
}

.catalog-toolbar {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  max-width: 1600px; /* ~5 cols max at 1920px viewport */
}
.veh-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--status-color, transparent);
  border-radius: var(--r-lg);
  overflow: hidden;
  cursor: pointer;
  transition: all .15s;
  display: flex; flex-direction: column;
}
.veh-card[data-status="disponible"] { --status-color: var(--success); }
.veh-card[data-status="reservado"]  { --status-color: var(--warning); }
.veh-card[data-status="vendido"]    { --status-color: var(--text-mute); }
.veh-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  box-shadow: var(--shadow-pop);
}
.veh-img {
  aspect-ratio: 4/3;
  background: var(--surface-3);
  position: relative;
  overflow: hidden;
}
.veh-img img { width: 100%; height: 100%; object-fit: cover; }
.veh-status-ribbon {
  position: absolute; top: 10px; left: 10px;
  font-size: var(--fs-xxs);
  padding: 3px 8px;
  border-radius: 4px;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}
.veh-status-ribbon.disp { background: var(--success); color: #fff; border-color: transparent; }
.veh-status-ribbon.res  { background: var(--warning); color: #14181f; border-color: transparent; }
.veh-status-ribbon.vend { background: var(--text-mute); color: #fff; border-color: transparent; }
.veh-promo {
  position: absolute; top: 10px; right: 10px;
  background: var(--accent); color: #fff;
  font-size: var(--fs-xxs); font-weight: 700;
  padding: 4px 9px; border-radius: 4px;
}
.veh-body { padding: 14px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.veh-title { font-weight: 600; font-size: var(--fs-md); line-height: 1.25; }
.veh-sub { font-size: var(--fs-xs); color: var(--text-mute); }
.veh-specs { display: flex; gap: 10px; font-size: var(--fs-xxs); color: var(--text-mute); margin-top: 4px; flex-wrap: wrap; }
.veh-specs .s { display: flex; align-items: center; gap: 4px; }
.veh-price-row { display: flex; justify-content: space-between; align-items: baseline; margin-top: auto; padding-top: 10px; }
.veh-price { font-family: var(--font-display); font-size: var(--fs-xl); color: var(--accent); letter-spacing: 0.02em; }
.veh-price-old { font-size: var(--fs-xs); color: var(--text-mute); text-decoration: line-through; }

/* vehicle detail */
.vd-header {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 24px;
}
.vd-gallery {
  display: grid;
  grid-template-rows: auto 80px;
  gap: 8px;
}
.vd-main-img {
  aspect-ratio: 4/3;
  background: var(--surface-3);
  border-radius: var(--r-lg);
  overflow: hidden;
  border: 1px solid var(--border);
}
.vd-main-img img { width: 100%; height: 100%; object-fit: cover; }
.vd-thumbs {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}
.vd-thumb {
  height: 80px;
  border-radius: 8px;
  overflow: hidden;
  border: 2px solid transparent;
  cursor: pointer;
  background: var(--surface-3);
}
.vd-thumb.active { border-color: var(--accent); }
.vd-thumb img { width: 100%; height: 100%; object-fit: cover; }
.vd-info { display: flex; flex-direction: column; gap: 14px; }
.vd-specs-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 24px;
}
.vd-spec { display: flex; flex-direction: column; gap: 2px; padding: 8px 0; border-bottom: 1px solid var(--border-soft); }
.vd-spec .k { font-size: var(--fs-xxs); color: var(--text-mute); text-transform: uppercase; letter-spacing: 0.06em; }
.vd-spec .v { font-size: var(--fs-md); font-weight: 500; }

.opt-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 8px;
}
.opt-row {
  display: flex; align-items: center; gap: 8px;
  font-size: var(--fs-sm);
  color: var(--text-dim);
}
.opt-row .check {
  width: 16px; height: 16px;
  border-radius: 4px;
  background: var(--accent);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
}

/* ============================================================
   CONFIG
   ============================================================ */
.config-tabs {
  display: flex; gap: 4px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--border);
}
.config-tab {
  padding: 10px 16px;
  font-size: var(--fs-sm);
  color: var(--text-dim);
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  font-weight: 500;
}
.config-tab[aria-selected="true"] {
  color: var(--accent);
  border-bottom-color: var(--accent);
}
.config-tab:hover { color: var(--text); }

.qr-card {
  display: flex;
  gap: 24px;
  align-items: center;
}
.qr-box {
  width: 220px; height: 220px;
  border-radius: var(--r-lg);
  padding: 14px;
  flex-shrink: 0;
}
/* Estado QR pendente — fundo branco pra QR ficar scannable */
.qr-box.qr-pending {
  background: #fff;
}
/* Estado conectado — glass dark coerente com o resto do tema */
.qr-box.qr-connected {
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.qr-box svg { width: 100%; height: 100%; }
.qr-info { flex: 1; }
.qr-info h2 { margin: 0 0 8px; font-size: var(--fs-lg); font-weight: 600; }

.users-table {
  width: 100%;
  border-collapse: collapse;
}
.users-table th, .users-table td {
  text-align: left;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-soft);
  font-size: var(--fs-sm);
}
.users-table th {
  font-size: var(--fs-xxs);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-mute);
  font-weight: 500;
  background: var(--surface-2);
}

/* ============================================================
   DETAIL LEAD
   ============================================================ */
.lead-detail-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 18px;
}

/* ============================================================
   UTILS
   ============================================================ */
.hstack { display: flex; align-items: center; gap: 8px; }
.vstack { display: flex; flex-direction: column; gap: 8px; }
.spacer { flex: 1; }
.muted { color: var(--text-mute); }
.dim { color: var(--text-dim); }
.text-center { text-align: center; }
.mono { font-family: var(--font-mono); }
.ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* welcome */
.welcome-banner {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 18px;
  background: linear-gradient(90deg, color-mix(in oklch, var(--accent) 16%, var(--surface)), var(--surface));
  border: 1px solid color-mix(in oklch, var(--accent) 30%, transparent);
  border-radius: var(--r-lg);
  margin-bottom: 18px;
}
.welcome-banner .ico {
  width: 38px; height: 38px;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
}
.welcome-banner .close { margin-left: auto; }

/* segmented — glass dark + active state com gradient laranja TRON neon */
.segmented {
  display: inline-flex;
  background: rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--r-md);
  padding: 3px;
  gap: 2px;
}
.segmented button {
  background: transparent;
  border: none;
  padding: 6px 14px;
  font-size: var(--fs-xs);
  color: rgba(255, 255, 255, 0.65);
  border-radius: 7px;
  font-weight: 500;
  transition: color .15s, background .15s;
  cursor: pointer;
  font-family: inherit;
}
.segmented button:hover:not([aria-pressed="true"]) {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.04);
}
.segmented button[aria-pressed="true"] {
  background: linear-gradient(180deg, var(--accent) 0%, var(--vm-orange-deep) 100%);
  color: #ffffff;
  font-weight: 600;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.22) inset,
    0 1px 3px rgba(0, 0, 0, 0.3),
    0 0 12px color-mix(in oklch, var(--accent) 35%, transparent);
}

/* badge sm */
.b-sm { font-size: var(--fs-xxs); padding: 2px 6px; border-radius: 4px; font-weight: 600; }

/* ribbon line under title */
.title-row { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; margin-bottom: 18px; }
.title-row h2 { margin: 0; font-size: var(--fs-xl); font-weight: 700; letter-spacing: -0.02em; }
.title-row .lead { color: var(--text-mute); font-size: var(--fs-sm); }


/* ============================================================
   Sprint 1 — Toasts, modales, command palette, drag & drop
   ============================================================ */

.toast-host {
  position: fixed; bottom: 20px; right: 20px;
  display: flex; flex-direction: column; gap: 10px;
  z-index: 9999; pointer-events: none;
  width: 360px; max-width: calc(100vw - 40px);
}
.toast {
  pointer-events: auto;
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 12px 32px -10px rgba(0,0,0,.35), 0 2px 4px rgba(0,0,0,.08);
  animation: toast-in .26s cubic-bezier(.2,.8,.2,1);
  position: relative;
}
@keyframes toast-in { from { transform: translateY(8px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.toast-icon {
  width: 28px; height: 28px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.toast-icon.t-success { background: color-mix(in oklch, var(--success) 18%, transparent); color: var(--success); }
.toast-icon.t-error   { background: color-mix(in oklch, var(--danger) 18%, transparent);  color: var(--danger); }
.toast-icon.t-warning { background: color-mix(in oklch, var(--warning) 18%, transparent); color: var(--warning); }
.toast-icon.t-info    { background: var(--accent-soft); color: var(--accent); }
.toast-body { flex: 1; min-width: 0; }
.toast-title { font-size: var(--fs-sm); font-weight: 600; color: var(--text); }
.toast-text  { font-size: var(--fs-xs); color: var(--text-dim); margin-top: 2px; }
.toast-action {
  font-size: var(--fs-xs); font-weight: 600;
  padding: 6px 10px; border-radius: 6px;
  background: var(--accent); color: #fff; border: none; cursor: pointer;
  align-self: center;
}
.toast-close {
  position: absolute; top: 6px; right: 6px;
  width: 22px; height: 22px; border-radius: 6px;
  background: transparent; border: none; cursor: pointer;
  color: var(--text-mute);
  display: flex; align-items: center; justify-content: center;
}
.toast-close:hover { background: var(--surface-2); color: var(--text); }
.toast-success { border-left: 3px solid var(--success); }
.toast-error   { border-left: 3px solid var(--danger); }
.toast-warning { border-left: 3px solid var(--warning); }
.toast-info    { border-left: 3px solid var(--accent); }

/* ── Modals ───────────────────────────────────────────── */
.modal-backdrop {
  position: fixed; inset: 0;
  background: color-mix(in oklch, #000 55%, transparent);
  backdrop-filter: blur(4px);
  z-index: 9000;
  display: flex; align-items: center; justify-content: center;
  animation: fade-in .2s ease;
}
@keyframes fade-in { from { opacity: 0 } to { opacity: 1 } }
.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  width: 720px; max-width: calc(100vw - 40px);
  max-height: calc(100vh - 60px);
  display: flex; flex-direction: column;
  box-shadow: 0 30px 80px -20px rgba(0,0,0,.5);
  animation: modal-in .28s cubic-bezier(.2,.8,.2,1);
}
.modal-sm { width: 460px; }
.modal-vehicle { width: 820px; }
@keyframes modal-in { from { transform: translateY(12px) scale(.98); opacity: 0 } to { transform: translateY(0) scale(1); opacity: 1 } }
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
}
.modal-search {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--border);
  color: var(--text-mute);
}
.modal-search input {
  flex: 1; background: transparent; border: none; outline: none;
  color: var(--text); font-size: var(--fs-md);
}
.modal-grid {
  flex: 1; overflow-y: auto;
  padding: 16px;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}
.modal-foot {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 18px;
  border-top: 1px solid var(--border);
  background: var(--surface-2);
  border-radius: 0 0 14px 14px;
}
.vp-card {
  position: relative;
  display: flex; flex-direction: column;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 10px; overflow: hidden;
  cursor: pointer; text-align: left;
  padding: 0;
  transition: border-color .15s, transform .15s;
}
.vp-card:hover { border-color: var(--accent); transform: translateY(-1px); }
.vp-card.picked { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.vp-card img { width: 100%; aspect-ratio: 16/10; object-fit: cover; }
.vp-meta { padding: 10px 12px; }
.vp-name { font-size: var(--fs-sm); font-weight: 600; color: var(--text); }
.vp-sub  { font-size: var(--fs-xxs); color: var(--text-mute); margin: 2px 0 4px; }
.vp-price { font-family: var(--font-display, inherit); font-size: var(--fs-lg); color: var(--accent); font-weight: 600; }
.vp-check {
  position: absolute; top: 8px; right: 8px;
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--accent); color: #fff;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 8px rgba(0,0,0,.3);
}

.seller-pick {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: 10px;
  background: var(--surface-2); border: 1px solid var(--border);
  cursor: pointer; text-align: left;
  transition: border-color .15s, transform .15s;
}
.seller-pick:hover { border-color: var(--accent); transform: translateX(2px); }
.seller-pick-avatar {
  width: 34px; height: 34px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: var(--fs-xxs); font-weight: 700; color: #fff;
}

/* ── Command palette (⌘K) ──────────────────────────────── */
.cmdk-backdrop {
  position: fixed; inset: 0; z-index: 9500;
  background: color-mix(in oklch, #000 50%, transparent);
  backdrop-filter: blur(6px);
  display: flex; justify-content: center; padding-top: 14vh;
  animation: fade-in .15s ease;
}
.cmdk {
  width: 580px; max-width: calc(100vw - 40px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 30px 80px -20px rgba(0,0,0,.6);
  overflow: hidden;
  animation: modal-in .22s cubic-bezier(.2,.8,.2,1);
}
.cmdk-input {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--text-mute);
}
.cmdk-input input {
  flex: 1; background: transparent; border: none; outline: none;
  font-size: var(--fs-md); color: var(--text);
}
.cmdk-list {
  max-height: 60vh; overflow-y: auto;
  padding: 6px;
}
.cmdk-item {
  display: flex; align-items: center; gap: 10px;
  width: 100%; padding: 10px 12px;
  background: transparent; border: none; border-radius: 8px;
  cursor: pointer; text-align: left; color: var(--text);
}
.cmdk-item:hover { background: var(--surface-2); }
.cmdk-label { flex: 1; font-size: var(--fs-sm); }
.cmdk-empty { padding: 30px; text-align: center; color: var(--text-mute); font-size: var(--fs-sm); }
.kbd {
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: var(--fs-xxs); font-weight: 600;
  padding: 2px 6px; border-radius: 4px;
  background: var(--surface-3); color: var(--text-dim);
  border: 1px solid var(--border);
}

/* ── Drag & drop Kanban ────────────────────────────────── */
.lead-card { cursor: grab; transition: box-shadow .15s, transform .15s, opacity .15s; }
.lead-card:active { cursor: grabbing; }
.lead-card.dragging { opacity: .4; transform: scale(.98); }
.kanban-col-body.drop-target {
  background: var(--accent-soft);
  outline: 2px dashed var(--accent); outline-offset: -4px;
  border-radius: 8px;
}
.kanban-col-body { transition: background .12s; min-height: 60px; }

/* Empty state — preenche colunas sem leads para evitar buraco visual */
.kanban-col-body:empty::before {
  content: 'Sem leads neste estágio';
  display: flex; align-items: center; justify-content: center;
  height: 100%; min-height: 80px;
  font-size: var(--fs-xxs);
  color: var(--text-mute);
  text-align: center;
  padding: 20px;
  border: 1px dashed var(--border);
  border-radius: var(--r-md);
  margin: 4px;
}

.lead-card-asumir {
  width: 100%;
  margin-top: 6px;
  padding: 6px 8px;
  font-size: var(--fs-xxs); font-weight: 600;
  background: var(--accent); color: #fff;
  border: none; border-radius: 6px; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 4px;
}
.lead-card-asumir:hover { filter: brightness(1.05); }

/* ── WhatsApp tweaks: bot toggle in header + typing ───── */
.bot-mode-toggle {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 5px 10px; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--border);
  font-size: var(--fs-xxs); font-weight: 500; color: var(--text-dim);
  cursor: pointer; user-select: none;
  transition: all .15s;
}
.bot-mode-toggle.active-bot { color: var(--accent); border-color: color-mix(in oklch, var(--accent) 35%, transparent); background: var(--accent-soft); }
.bot-mode-toggle.active-human { color: var(--success); border-color: color-mix(in oklch, var(--success) 35%, transparent); background: color-mix(in oklch, var(--success) 14%, transparent); }
.bot-mode-toggle .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 3px color-mix(in oklch, currentColor 22%, transparent); }

.wa-typing {
  display: inline-flex; align-items: center; gap: 3px;
  padding: 8px 12px; border-radius: 12px;
  background: var(--surface-2); align-self: flex-start;
  margin-top: 4px;
}
.wa-typing span {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--text-mute);
  animation: typing 1.2s infinite ease-in-out;
}
.wa-typing span:nth-child(2) { animation-delay: .15s }
.wa-typing span:nth-child(3) { animation-delay: .3s }
@keyframes typing { 0%,60%,100% { opacity: .3; transform: translateY(0) } 30% { opacity: 1; transform: translateY(-3px) } }

.wa-msg.sending { opacity: .65; }
.wa-msg.sending .meta::after { content: " · enviando…"; color: var(--text-mute); }

/* =============================================================
   SPRINT 2 — Dashboard com vida
   ============================================================= */

/* KPI animado com sparkline */
.kpi.kpi-anim { position: relative; overflow: hidden; }
.kpi-spark {
  position: absolute;
  bottom: 0; left: 0;
  width: 100%;
  height: 32px;
  opacity: 0.7;
  pointer-events: none;
}
.kpi.kpi-anim .kpi-meta { position: relative; z-index: 1; }

/* Alert row — Acção requerida */
.alert-row {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  gap: 14px;
  margin-bottom: 18px;
}
.alert-card {
  position: relative; overflow: hidden;
  /* Glass dark — todos os 3 alert cards agora usam laranja (TRON-like neon)
     com intensidades diferentes pra hierarquia visual */
  --alert-tone: var(--accent);
  --alert-glow: 18%;
  --alert-bar: 4px;
  background:
    radial-gradient(80% 100% at 0% 0%, color-mix(in oklch, var(--alert-tone) var(--alert-glow), transparent) 0%, transparent 60%),
    rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-left: var(--alert-bar) solid var(--alert-tone);
  --text: #ffffff;
  --text-dim: rgba(255, 255, 255, 0.78);
  --text-mute: rgba(255, 255, 255, 0.55);
  color: var(--text);
  box-shadow:
    0 0 24px -8px color-mix(in oklch, var(--alert-tone) var(--alert-glow), transparent),
    0 4px 18px -4px color-mix(in oklch, var(--alert-tone) 25%, transparent),
    0 1px 3px rgba(0, 0, 0, 0.2);
}
/* 3 níveis de intensidade — todos laranja, tipo brilho de neon TRON */
.alert-card.alert-danger  { --alert-glow: 28%; --alert-bar: 5px; }  /* highest urgency */
.alert-card.alert-warning { --alert-glow: 16%; --alert-bar: 4px; }  /* medium */
.alert-card.alert-accent  { --alert-glow: 9%;  --alert-bar: 3px; }  /* subtle */
.alert-card-inner {
  display: flex; align-items: center; gap: 14px;
}
.alert-card.alert-danger::before {
  content: "";
  position: absolute; inset: 0;
  border-radius: inherit;
  pointer-events: none;
  box-shadow: 0 0 0 2px color-mix(in oklch, var(--alert-tone) 22%, transparent) inset;
  animation: alert-pulse 2.4s ease-in-out infinite;
}
@keyframes alert-pulse {
  0%, 100% { box-shadow: 0 0 0 1px color-mix(in oklch, var(--accent) 22%, transparent) inset; }
  50%      { box-shadow: 0 0 0 2px color-mix(in oklch, var(--accent) 50%, transparent) inset; }
}
.alert-pulse-icon {
  width: 42px; height: 42px; flex: none;
  border-radius: 11px;
  display: flex; align-items: center; justify-content: center;
  background: color-mix(in oklch, var(--alert-tone, var(--accent)) 22%, transparent);
  color: var(--alert-tone, var(--accent));
  position: relative;
  box-shadow: 0 0 12px -2px color-mix(in oklch, var(--alert-tone, var(--accent)) 35%, transparent);
}
.alert-card.alert-danger .alert-pulse-icon::after {
  content: "";
  position: absolute; inset: -4px;
  border-radius: inherit;
  border: 2px solid color-mix(in oklch, var(--alert-tone) 55%, transparent);
  animation: ring-pulse 1.8s ease-out infinite;
}
@keyframes ring-pulse {
  0%   { transform: scale(0.85); opacity: 1; }
  100% { transform: scale(1.4);  opacity: 0; }
}
.alert-eyebrow {
  font-size: var(--fs-xxs); font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--alert-tone, var(--accent));
  margin-bottom: 4px;
}
.alert-headline {
  font-family: var(--font-display);
  font-size: var(--fs-2xl); font-weight: 700; letter-spacing: 0.02em;
  line-height: 1;
}
.alert-headline span {
  font-family: var(--font-sans);
  font-size: var(--fs-sm); font-weight: 500; color: var(--text-mute);
  letter-spacing: 0;
}
.alert-sub { font-size: var(--fs-xs); color: var(--text-mute); margin-top: 4px; }

/* Floating tooltip */
.float-tip {
  position: fixed;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: var(--fs-xs);
  box-shadow: 0 10px 28px rgba(0,0,0,.18), 0 2px 6px rgba(0,0,0,.08);
  pointer-events: none;
  z-index: 9999;
  min-width: 180px;
  animation: tip-in .12s ease-out;
}
@keyframes tip-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }
.float-tip .ft-title {
  font-weight: 700; font-size: var(--fs-xs); color: var(--text);
  margin-bottom: 6px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border-soft);
}
.float-tip .ft-row {
  display: flex; justify-content: space-between; gap: 12px;
  font-size: var(--fs-xxs); color: var(--text-mute);
  padding: 2px 0;
}
.float-tip .ft-row b { color: var(--text); font-variant-numeric: tabular-nums; }

/* Funnel & origin hover affordance */
.funnel-row-hover, .origin-row-hover { cursor: pointer; transition: filter .15s ease; }
.funnel-row-hover:hover .funnel-bar { filter: brightness(1.08); }
.origin-row-hover:hover { background: var(--surface-2); border-radius: 6px; }

/* Top vehicle row clickable */
.top-vehicle-clickable { cursor: pointer; transition: background .15s; border-radius: 6px; padding-left: 4px; padding-right: 4px; margin-left: -4px; margin-right: -4px; }
/* =============================================================
   SPRINT 3 — Identidad visual + polimento
   ============================================================= */

/* Refined cool-neutral palette tweaks */
[data-theme="dark"] {
  --bg:           #0d1117;
  --bg-deep:      #08090d;
  --surface:      #151a22;
  --surface-2:    #1b212b;
  --surface-3:    #242b36;
  --border:       #28303b;
  --border-soft:  #1d232c;
}

/* Metallic wordmark */
.brand-metallic {
  font-family: var(--font-display);
  font-size: var(--fs-xl);
  letter-spacing: 0.04em;
  line-height: 1;
  display: inline-flex;
  filter: drop-shadow(0 1px 0 rgba(0,0,0,0.4));
}
.brand-metallic .v {
  background: linear-gradient(180deg, #ffb285 0%, var(--vm-orange) 45%, var(--vm-orange-deep) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 1px 0 rgba(0,0,0,0.3);
}
.brand-metallic .m {
  background: linear-gradient(180deg, #d8dde5 0%, #8a92a0 50%, #4a525e 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
[data-theme="light"] .brand-metallic .m {
  background: linear-gradient(180deg, #5c6470 0%, #2a323e 60%, #14181f 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Sidebar logo: subtle metallic glow ring */
.sidebar-brand img {
  background: radial-gradient(circle at 30% 20%, rgba(255,255,255,0.08), transparent 60%);
  border-radius: 8px;
  padding: 2px;
}

/* Skeleton shimmer */
.vm-skel {
  display: inline-block;
  background: linear-gradient(90deg,
    var(--surface-2) 0%,
    var(--surface-3) 40%,
    var(--surface-2) 80%);
  background-size: 200% 100%;
  animation: vm-shimmer 1.4s ease-in-out infinite;
}
@keyframes vm-shimmer {
  0%   { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}

/* Empty state */
.vm-empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center;
  padding: 48px 24px;
  gap: 14px;
  color: var(--text-mute);
}
.vm-empty-icon { opacity: 0.85; margin-bottom: 4px; }
.vm-empty-title {
  font-family: var(--font-display);
  font-size: var(--fs-xl); letter-spacing: 0.03em;
  color: var(--text);
}
.vm-empty-sub {
  font-size: var(--fs-sm); max-width: 360px; line-height: 1.5;
}
.vm-empty-action { margin-top: 8px; }

/* Iconography consistency: standardize stroke width on inline svgs */
.icon { stroke-width: 1.6; }

/* Refined card hover */
.card { transition: border-color .2s, box-shadow .2s; }
.card:hover { border-color: color-mix(in oklch, var(--border) 60%, var(--text-mute)); }

/* Tabular numbers everywhere they matter */
.kpi-value, .funnel-bar span, .ranking-row [class*=" "] b,
.alert-headline { font-variant-numeric: tabular-nums; }

/* Accent button polish: deeper highlight */
.btn-primary {
  background: linear-gradient(180deg,
    color-mix(in oklch, var(--accent) 100%, white 12%) 0%,
    var(--accent) 50%,
    var(--vm-orange-deep) 100%);
  box-shadow:
    0 1px 0 rgba(255,255,255,0.25) inset,
    0 -1px 0 rgba(0,0,0,0.15) inset,
    0 6px 18px -6px color-mix(in oklch, var(--accent) 60%, transparent);
}

/* Sidebar nav glow refinement */
.nav-item[aria-current="page"] {
  background: linear-gradient(90deg,
    color-mix(in oklch, var(--accent) 18%, transparent),
    color-mix(in oklch, var(--accent) 8%, transparent));
}

/* =============================================================
   SPRINT 4 — Mobile responsivo
   ============================================================= */

/* Hamburger button (only visible mobile) */
.mobile-menu-btn { display: none; }

@media (max-width: 900px) {
  /* Layout becomes single column */
  .app {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr auto;
    height: 100%;
  }

  /* Sidebar transforms into bottom nav */
  .sidebar {
    position: fixed; left: 0; right: 0; bottom: 0; top: auto;
    z-index: 50;
    flex-direction: row;
    border-right: none;
    border-top: 1px solid var(--accent);
    padding: 6px 8px;
    gap: 0;
    height: 64px;
    overflow: visible;
    background: var(--surface);
    /* TRON-like neon glow on top edge of bottom nav */
    box-shadow:
      0 -1px 8px color-mix(in oklch, var(--accent) 50%, transparent),
      0 -2px 24px -2px color-mix(in oklch, var(--accent) 25%, transparent),
      0 -8px 24px rgba(0, 0, 0, 0.15);
  }
  .sidebar-brand,
  .nav-section-label,
  .sidebar-bottom { display: none; }

  .nav-item {
    flex: 1; flex-direction: column; gap: 2px;
    padding: 8px 4px;
    font-size: var(--fs-xxs);
    border-radius: 8px;
    text-align: center;
    min-height: 48px;
  }
  .nav-item .badge {
    position: absolute; top: 4px; right: 18px;
    margin-left: 0;
    transform: translateX(50%);
  }
  .nav-item[aria-current="page"]::before { display: none; }
  .nav-item[aria-current="page"] {
    background: var(--accent-soft);
  }

  /* Main area scrolls under bottom nav */
  .main { padding-bottom: 64px; }

  /* Topbar collapses */
  .topbar {
    padding: 10px 14px;
    gap: 8px;
    height: 56px;
  }
  .topbar h1 { font-size: var(--fs-lg); }
  .topbar .crumbs { font-size: var(--fs-xxs); margin-bottom: 0; }
  .topbar-search { display: none; }
  .topbar-icon-btn { width: 36px; height: 36px; }
  .mobile-menu-btn { display: flex; }

  /* Page padding */
  .page { padding: 14px !important; }

  /* Title row stacks */
  .title-row { flex-direction: column; align-items: flex-start !important; gap: 8px; }
  .title-row > div:last-child { width: 100%; }

  /* Dashboard collapses to single col */
  .dash-kpis { grid-template-columns: 1fr 1fr; gap: 10px; }
  .dash-row, .dash-row-2, .dash-row-3, .dash-row-funnel,
  .alert-row {
    grid-template-columns: 1fr !important;
    gap: 12px;
  }
  .alert-headline { font-size: var(--fs-xl); }

  /* KPI compact */
  .kpi { padding: 14px; }
  .kpi-value { font-size: var(--fs-2xl); }

  /* Card padding */
  .card { padding: 14px; }

  /* Kanban → vertical stack */
  .kanban {
    flex-direction: column;
    overflow-x: visible;
    overflow-y: auto;
    gap: 10px;
  }
  .kanban-col {
    flex: 0 0 auto;
    width: 100%;
    max-height: none;
  }
  .kanban-col-body {
    max-height: none;
    overflow-y: visible;
    padding: 8px;
  }
  /* Esconde colunas vazias para n\u00e3o desperdi\u00e7ar espa\u00e7o vertical */
  .kanban-col:has(.kanban-col-body:empty) { display: none; }
  .kanban-col-body:empty::after {
    content: 'Sin leads en esta etapa';
    display: block;
    padding: 10px 12px;
    color: var(--text-mute);
    font-size: var(--fs-xxs);
    font-style: italic;
  }
  .kanban-col-body:empty { padding: 0; }
  .kanban-toolbar {
    flex-wrap: wrap;
    gap: 6px;
  }

  /* Stage chips for mobile filter (added inline) */
  .kanban-mobile-chips {
    display: flex; gap: 6px;
    overflow-x: auto;
    padding: 8px 0;
    margin: -4px 0 8px;
    -webkit-overflow-scrolling: touch;
  }
  .kanban-mobile-chips::-webkit-scrollbar { display: none; }
  .kanban-mobile-chips .stage-chip {
    flex: 0 0 auto;
    padding: 8px 14px;
    border-radius: 999px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    color: var(--text-dim);
    font-size: var(--fs-xs);
    font-weight: 500;
    white-space: nowrap;
    min-height: 36px;
    display: inline-flex; align-items: center; gap: 6px;
  }
  .kanban-mobile-chips .stage-chip[aria-pressed="true"] {
    background: var(--accent-soft);
    color: var(--accent);
    border-color: color-mix(in oklch, var(--accent) 30%, transparent);
  }

  /* Drawer becomes bottom sheet */
  .drawer {
    width: 100%;
    top: auto;
    height: 92vh;
    border-top-left-radius: 18px;
    border-top-right-radius: 18px;
    animation: slideUpSheet .28s cubic-bezier(.2,.7,.2,1);
  }
  @keyframes slideUpSheet {
    from { transform: translateY(100%); opacity: 0.7; }
    to   { transform: translateY(0); opacity: 1; }
  }
  .drawer::before {
    content: "";
    position: absolute; top: 6px; left: 50%;
    transform: translateX(-50%);
    width: 40px; height: 4px; border-radius: 2px;
    background: var(--text-mute);
    opacity: 0.4;
  }

  /* WhatsApp inbox m\u00f3vil — list compacta no topo, chat fullscreen abaixo */
  .wa-wrap {
    display: grid !important;
    grid-template-columns: 1fr !important;
    grid-template-rows: auto 1fr !important;
    height: calc(100dvh - 132px) !important;
    gap: 0 !important;
  }
  .wa-info { display: none !important; }
  .wa-list {
    max-height: 38dvh;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
  .wa-list-head { padding: 10px 12px; gap: 6px; }
  .wa-stats { gap: 10px; font-size: var(--fs-xxs); }
  .wa-list-body { max-height: calc(38dvh - 96px); }
  .wa-chat {
    min-height: 0;
    height: 100%;
    display: flex;
    flex-direction: column;
  }
  .wa-chat-head { padding: 10px 12px; }
  .wa-chat-head .h-name { font-size: var(--fs-sm); }
  .wa-chat-actions { gap: 4px; }
  .wa-chat-actions .btn { padding: 4px 8px; font-size: var(--fs-xxs); }
  .wa-messages {
    flex: 1 1 0;
    min-height: 0;
    padding: 10px 8px;
  }
  .wa-composer { padding: 8px; }
  .wa-templates { display: none; }
  .wa-input-row { gap: 6px; }
  .bot-mode-toggle .label { display: none; }

  /* Modals fill more of the screen */
  .modal { width: 96vw !important; max-height: 90vh; }
  .modal-vehicle { width: 96vw !important; }

  /* Touch targets ≥44px */
  .btn { min-height: 40px; padding: 10px 14px; }
  .btn-sm { min-height: 36px; padding: 8px 12px; }
  .topbar-icon-btn { min-width: 40px; min-height: 40px; }

  /* Catálogo grid → 1 col */
  .vehicle-grid, .catalog-grid { grid-template-columns: 1fr !important; }
}

@media (max-width: 480px) {
  .dash-kpis { grid-template-columns: 1fr; }
  .nav-item span { font-size: var(--fs-xxs); }
}



/* ============================================================
   SPRINT 5 — Detalhes que vendem
   ============================================================ */

/* — Lead score badge tooltip portal — */
.lead-score-badge { user-select: none; }
.lead-score-badge:hover { transform: translateY(-1px); transition: transform .15s; }

/* — Conversation timeline rich — */
.vm-timeline-rich { display: flex; flex-direction: column; gap: 14px; }
.vm-timeline-filters { display: flex; gap: 6px; flex-wrap: wrap; padding-bottom: 10px; border-bottom: 1px solid var(--border-soft); }
.vm-tl-filter {
  padding: 6px 12px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface-2);
  color: var(--text-dim); font-size: var(--fs-xs); font-weight: 500;
  display: inline-flex; align-items: center; gap: 6px; cursor: pointer;
}
.vm-tl-filter:hover { color: var(--text); border-color: var(--text-mute); }
.vm-tl-filter.active { background: var(--accent-soft); color: var(--accent); border-color: color-mix(in oklch, var(--accent) 35%, transparent); }
.vm-tl-filter .count { font-size: var(--fs-xxs); opacity: 0.7; padding: 0 5px; background: rgba(0,0,0,0.15); border-radius: 6px; }

.vm-timeline-track { position: relative; display: flex; flex-direction: column; }
.vm-timeline-track::before {
  content: ''; position: absolute; left: 84px; top: 6px; bottom: 6px;
  width: 2px; background: var(--border-soft);
}
.vm-tl-row { display: grid; grid-template-columns: 64px 24px 1fr; gap: 12px; align-items: flex-start; padding: 8px 0; position: relative; }
.vm-tl-time { text-align: right; padding-top: 4px; }
.vm-tl-time .t1 { font-size: var(--fs-xs); font-weight: 600; color: var(--text-dim); font-variant-numeric: tabular-nums; }
.vm-tl-time .t2 { font-size: var(--fs-xxs); color: var(--text-mute); text-transform: uppercase; letter-spacing: 0.06em; }
.vm-tl-marker {
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--surface-3); color: var(--text-mute);
  border: 2px solid var(--surface);
  display: flex; align-items: center; justify-content: center;
  position: relative; z-index: 1; margin-top: 4px;
}
.vm-tl-marker.blue   { background: color-mix(in oklch, #4aa6ff 22%, var(--surface)); color: #4aa6ff; }
.vm-tl-marker.purple { background: color-mix(in oklch, #a36bff 22%, var(--surface)); color: #a36bff; }
.vm-tl-marker.amber  { background: color-mix(in oklch, var(--warning) 22%, var(--surface)); color: var(--warning); }
.vm-tl-marker.green  { background: color-mix(in oklch, var(--success) 22%, var(--surface)); color: var(--success); }
.vm-tl-marker.orange { background: color-mix(in oklch, var(--accent) 22%, var(--surface)); color: var(--accent); }
.vm-tl-marker.mute   { background: var(--surface-3); color: var(--text-mute); }
.vm-tl-card {
  background: var(--surface-2); border: 1px solid var(--border-soft);
  border-radius: 10px; padding: 10px 14px;
}
.vm-tl-eyebrow { font-size: var(--fs-xxs); font-weight: 700; color: var(--text-mute); letter-spacing: 0.1em; text-transform: uppercase; margin-bottom: 4px; }
.vm-tl-text { font-size: var(--fs-sm); color: var(--text); line-height: 1.5; }
.vm-tl-text .mono { font-family: var(--font-mono); font-size: var(--fs-xxs); padding: 1px 5px; background: var(--surface-3); border-radius: 4px; }
.vm-tl-author { font-size: var(--fs-xxs); color: var(--text-mute); margin-top: 6px; }
.vm-tl-attach { display: flex; gap: 10px; align-items: center; margin-top: 8px; padding: 8px; background: var(--surface); border-radius: 8px; }
.vm-tl-attach img { width: 60px; height: 44px; border-radius: 6px; object-fit: cover; }
.vm-tl-attach .t { font-size: var(--fs-xs); font-weight: 600; }
.vm-tl-attach .s { font-size: var(--fs-xxs); color: var(--text-mute); }
.vm-tl-attach .audio-icon, .vm-tl-attach .doc-icon {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent);
  display: flex; align-items: center; justify-content: center;
}
.vm-tl-attach .audio-wave { display: flex; gap: 2px; align-items: flex-end; height: 18px; margin-top: 4px; }
.vm-tl-attach .audio-wave span { display: inline-block; width: 2px; background: var(--accent); border-radius: 1px; opacity: 0.7; }

/* — Financing simulator — */
.fin-veh {
  display: flex; gap: 14px; align-items: center; padding: 14px;
  background: var(--surface-2); border: 1px solid var(--border-soft); border-radius: 10px; margin-bottom: 14px;
}
.fin-veh img { width: 96px; height: 64px; object-fit: cover; border-radius: 8px; }
.fin-veh .t { font-weight: 600; font-size: var(--fs-md); }
.fin-veh .s { font-size: var(--fs-xs); color: var(--text-mute); margin-top: 2px; }
.fin-veh .p { font-family: var(--font-display); font-size: var(--fs-xl); color: var(--accent); margin-top: 4px; letter-spacing: 0.02em; }

.fin-grid { display: flex; flex-direction: column; gap: 16px; }
.fin-slider .row { display: flex; justify-content: space-between; margin-bottom: 6px; align-items: baseline; }
.fin-slider label { font-size: var(--fs-xs); color: var(--text-dim); font-weight: 500; }
.fin-slider .val { font-family: var(--font-display); font-size: var(--fs-lg); color: var(--text); letter-spacing: 0.02em; }
.fin-slider .val b { font-size: var(--fs-xl); color: var(--accent); margin-right: 2px; }
.fin-slider input[type=range] { width: 100%; accent-color: var(--accent); }
.fin-slider .hint { font-size: var(--fs-xxs); color: var(--text-mute); margin-top: 2px; }
.fin-toggle label { display: flex; align-items: center; gap: 8px; font-size: var(--fs-sm); color: var(--text-dim); cursor: pointer; }
.fin-toggle input[type=checkbox] { accent-color: var(--accent); width: 16px; height: 16px; }

.fin-summary {
  background: linear-gradient(180deg, var(--accent) 0%, var(--vm-orange-deep) 100%);
  color: #fff; border-radius: 12px; padding: 18px;
  display: flex; flex-direction: column; gap: 14px;
}
.fin-installment .lbl { font-size: var(--fs-xxs); opacity: 0.8; text-transform: uppercase; letter-spacing: 0.1em; font-weight: 600; }
.fin-installment .val { font-family: var(--font-display); font-size: var(--fs-3xl); letter-spacing: 0.02em; line-height: 1.05; margin-top: 2px; }
.fin-installment .sub { font-size: var(--fs-xxs); opacity: 0.85; }
.fin-rows { display: flex; flex-direction: column; gap: 6px; padding-top: 12px; border-top: 1px solid rgba(255,255,255,0.18); }
.fin-rows > div { display: flex; justify-content: space-between; font-size: var(--fs-sm); }
.fin-rows > div span { opacity: 0.85; }
.fin-rows > div b { font-weight: 600; font-variant-numeric: tabular-nums; }
.fin-rows .total { padding-top: 8px; margin-top: 2px; border-top: 1px dashed rgba(255,255,255,0.25); font-size: var(--fs-md); }
.fin-rows .total b { font-family: var(--font-display); font-size: var(--fs-lg); }

@media (max-width: 720px) {
  .modal[style*="720"] .modal-body { grid-template-columns: 1fr !important; }
}

/* — Bulk dispatch — */
.bulk-stepper { display: flex; gap: 14px; padding: 0 0 14px; border-bottom: 1px solid var(--border-soft); margin-bottom: 16px; }
.bulk-stepper span { font-size: var(--fs-xs); color: var(--text-mute); padding: 4px 10px; border-radius: 6px; background: var(--surface-2); font-weight: 500; }
.bulk-stepper span.on { background: var(--accent-soft); color: var(--accent); }
.bulk-step { display: flex; flex-direction: column; gap: 14px; }
.bulk-row label { display: block; font-size: var(--fs-xs); color: var(--text-dim); margin-bottom: 6px; font-weight: 500; }
.bulk-row.two { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.bulk-audience { background: var(--surface-2); border: 1px solid var(--border-soft); border-radius: 10px; }
.bulk-audience .head { display: flex; align-items: center; padding: 14px; border-bottom: 1px solid var(--border-soft); }
.bulk-audience .big { font-size: var(--fs-md); }
.bulk-audience .big b { font-family: var(--font-display); font-size: var(--fs-2xl); color: var(--accent); margin-right: 6px; letter-spacing: 0.02em; }
.bulk-audience .small { font-size: var(--fs-xs); color: var(--text-mute); margin-top: 2px; }
.bulk-audience .estim { margin-left: auto; text-align: right; }
.bulk-audience .estim .lbl { font-size: var(--fs-xxs); color: var(--text-mute); text-transform: uppercase; letter-spacing: 0.08em; }
.bulk-audience .estim .val { font-family: var(--font-display); font-size: var(--fs-xl); color: var(--text); }
.bulk-audience .estim .sub { font-size: var(--fs-xxs); color: var(--text-mute); }
.bulk-audience .list { padding: 8px 14px; max-height: 280px; overflow: auto; }
.bulk-audience .list .row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border-soft); }
.bulk-audience .list .row:last-child { border-bottom: none; }
.bulk-audience .list .av { width: 30px; height: 30px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #fff; font-size: var(--fs-xxs); font-weight: 600; }
.bulk-audience .list .meta { flex: 1; }
.bulk-audience .list .n { font-size: var(--fs-sm); font-weight: 500; }
.bulk-audience .list .s { font-size: var(--fs-xxs); color: var(--text-mute); }
.bulk-audience .more { padding: 8px 0; font-size: var(--fs-xxs); color: var(--text-mute); text-align: center; }
.bulk-audience .empty { padding: 24px; font-size: var(--fs-sm); color: var(--text-mute); text-align: center; }

.bulk-preview { display: flex; flex-direction: column; align-items: flex-start; }
.bp-bubble { background: color-mix(in oklch, #25d366 18%, var(--surface)); border: 1px solid color-mix(in oklch, #25d366 30%, transparent); border-radius: 12px 12px 12px 2px; padding: 10px 14px; font-size: var(--fs-sm); color: var(--text); max-width: 480px; line-height: 1.5; white-space: pre-wrap; }
.bp-meta { font-size: var(--fs-xxs); color: var(--text-mute); margin-top: 6px; }

.bulk-confirm { text-align: center; padding: 24px; }
.bc-icon { width: 64px; height: 64px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: inline-flex; align-items: center; justify-content: center; margin: 0 auto 14px; }
.bc-title { font-size: var(--fs-lg); font-weight: 600; }
.bc-sub { font-size: var(--fs-sm); color: var(--text-mute); margin-top: 6px; max-width: 480px; margin-left: auto; margin-right: auto; }
.bc-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 18px; max-width: 520px; margin-left: auto; margin-right: auto; }
.bc-stats > div { background: var(--surface-2); border: 1px solid var(--border-soft); border-radius: 10px; padding: 12px; }
.bc-stats span { display: block; font-size: var(--fs-xxs); color: var(--text-mute); text-transform: uppercase; letter-spacing: 0.08em; }
.bc-stats b { font-family: var(--font-display); font-size: var(--fs-lg); color: var(--text); margin-top: 4px; display: block; }

/* — Auto-distribution — */
.auto-dist .auto-dist-body { display: flex; flex-direction: column; gap: 16px; padding-top: 14px; transition: opacity .2s; }
.auto-strategy { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.auto-strat-card {
  position: relative; text-align: left; padding: 12px;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 10px; cursor: pointer;
  font: inherit; color: inherit;
}
.auto-strat-card:hover { border-color: var(--text-mute); }
.auto-strat-card.active { border-color: var(--accent); background: var(--accent-soft); }
.auto-strat-card .t { font-size: var(--fs-sm); font-weight: 600; }
.auto-strat-card .d { font-size: var(--fs-xxs); color: var(--text-mute); margin-top: 2px; line-height: 1.4; }
.auto-strat-card svg { position: absolute; top: 8px; right: 8px; color: var(--accent); }

.auto-toggles { display: flex; flex-direction: column; gap: 4px; }
.toggle-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border-soft); cursor: pointer; }
.toggle-row:last-child { border-bottom: none; }
.toggle-row .meta { flex: 1; }
.toggle-row .meta .t { font-size: var(--fs-sm); font-weight: 500; }
.toggle-row .meta .s { font-size: var(--fs-xxs); color: var(--text-mute); margin-top: 2px; }

.vm-switch { position: relative; display: inline-block; cursor: pointer; }
.vm-switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.vm-switch .track { display: inline-block; width: 36px; height: 20px; background: var(--surface-3); border: 1px solid var(--border); border-radius: 999px; position: relative; transition: all .2s; }
.vm-switch .thumb { position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,0.3); transition: all .2s; }
.vm-switch input:checked + .track { background: var(--accent); border-color: var(--accent); }
.vm-switch input:checked + .track .thumb { left: 18px; }

.auto-slider { padding: 6px 0; }
.auto-slider .row { display: flex; justify-content: space-between; margin-bottom: 6px; }
.auto-slider label { font-size: var(--fs-sm); color: var(--text-dim); }
.auto-slider b { font-family: var(--font-display); font-size: var(--fs-lg); color: var(--accent); }
.auto-slider input[type=range] { width: 100%; accent-color: var(--accent); }

.auto-sellers .lbl { font-size: var(--fs-xxs); color: var(--text-mute); text-transform: uppercase; letter-spacing: 0.08em; font-weight: 600; margin-bottom: 8px; }
.auto-sellers .list { display: flex; flex-direction: column; gap: 6px; }
.seller-toggle { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 8px; cursor: pointer; transition: background .15s; }
.seller-toggle:hover { background: var(--surface-2); }
.seller-toggle input { accent-color: var(--accent); width: 16px; height: 16px; }
.seller-toggle .av { width: 32px; height: 32px; border-radius: 50%; color: #fff; font-size: var(--fs-xs); font-weight: 600; display: flex; align-items: center; justify-content: center; }
.seller-toggle .meta { flex: 1; }
.seller-toggle .n { font-size: var(--fs-sm); font-weight: 500; }
.seller-toggle .s { font-size: var(--fs-xxs); color: var(--text-mute); }

.auto-foot { display: flex; justify-content: flex-end; padding-top: 8px; border-top: 1px solid var(--border-soft); }


/* ============================================================
   REPORTES
   ============================================================ */
.rep-page { display: flex; flex-direction: column; gap: 18px; }

.rep-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.rep-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.rep-period-tabs {
  display: inline-flex;
  background: rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  padding: 3px;
}
.rep-period-tabs button {
  padding: 7px 14px; border-radius: 7px; border: none; background: transparent;
  color: rgba(255, 255, 255, 0.65);
  font-size: var(--fs-xs); font-weight: 500; cursor: pointer;
  transition: color .15s, background .15s;
  font-family: inherit;
}
.rep-period-tabs button:hover:not(.on) {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.04);
}
.rep-period-tabs button.on {
  background: linear-gradient(180deg, var(--accent) 0%, var(--vm-orange-deep) 100%);
  color: #ffffff;
  font-weight: 600;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.22) inset,
    0 1px 3px rgba(0, 0, 0, 0.3),
    0 0 12px color-mix(in oklch, var(--accent) 35%, transparent);
}

.rep-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); padding-bottom: 0; }
.rep-tab {
  padding: 10px 16px; border: none; background: transparent;
  font-size: var(--fs-sm); font-weight: 500; color: var(--text-dim);
  display: inline-flex; align-items: center; gap: 6px; cursor: pointer;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
  font-family: inherit;
}
.rep-tab { transition: background .15s, color .15s; border-radius: 8px 8px 0 0; }
.rep-tab:hover { color: var(--text); }
.rep-tab:not(.on):hover { background: var(--surface-2); }
.rep-tab.on {
  color: var(--accent);
  border-bottom-color: var(--accent);
  background: color-mix(in oklch, var(--accent) 8%, transparent);
}

.rep-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.rep-kpi {
  position: relative; overflow: hidden; padding: 18px;
  border-top: 3px solid var(--kpi-tone, var(--accent));
}
.rep-kpi[data-tone="up"]   { --kpi-tone: var(--success); }
.rep-kpi[data-tone="down"] { --kpi-tone: var(--danger); }
.rep-kpi-label { font-size: var(--fs-xxs); color: var(--text-mute); text-transform: uppercase; letter-spacing: 0.08em; font-weight: 600; }
.rep-kpi-value { font-family: var(--font-display); font-size: var(--fs-2xl); letter-spacing: 0.02em; margin-top: 4px; color: var(--text); position: relative; z-index: 1; }
.rep-kpi-delta {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: var(--fs-xs); font-weight: 700;
  margin-top: 8px;
  padding: 3px 9px;
  border-radius: 999px;
  position: relative; z-index: 1;
}
.rep-kpi-delta.up   { color: var(--success); background: color-mix(in oklch, var(--success) 14%, transparent); }
.rep-kpi-delta.down { color: var(--danger);  background: color-mix(in oklch, var(--danger)  14%, transparent); }
.rep-kpi-delta .vs { color: var(--text-mute); margin-left: 4px; font-weight: 400; }
.rep-kpi-spark { position: absolute; left: 0; right: 0; bottom: 0; height: 32px; pointer-events: none; opacity: 0.85; }

/* Section identity per chart type */
.rep-section { border-top: 3px solid var(--rep-color, var(--accent)); }
.rep-section[data-rep="evolution"] { --rep-color: var(--chart-2); }
.rep-section[data-rep="funnel"]    { --rep-color: var(--chart-1); }
.rep-section[data-rep="losses"]    { --rep-color: var(--chart-6); }
.rep-section[data-rep="speed"]     { --rep-color: var(--chart-4); }
.rep-section .card-head .eyebrow { color: var(--rep-color); }

/* Period tabs vs action buttons divider */
.rep-actions-sep {
  width: 1px;
  height: 24px;
  background: var(--border);
  margin: 0 4px;
}

.rep-row { display: grid; gap: 14px; }
.rep-legend { display: flex; gap: 14px; font-size: var(--fs-xs); color: var(--text-mute); }
.rep-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 5px; vertical-align: middle; }
.eyebrow { font-size: var(--fs-xxs); color: var(--text-mute); text-transform: uppercase; letter-spacing: 0.1em; font-weight: 700; }

/* bars */
.rep-bars { display: flex; align-items: flex-end; justify-content: space-between; gap: 4px; padding: 14px 0 0; position: relative; }
.rep-bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 0; }
.rep-bar-val { font-size: var(--fs-xxs); color: var(--text-mute); font-variant-numeric: tabular-nums; opacity: 0; transition: opacity .15s; }
.rep-bar-col:hover .rep-bar-val { opacity: 1; }
.rep-bar { width: 100%; max-width: 36px; border-radius: 5px 5px 2px 2px; transition: opacity .15s; min-height: 4px; }
.rep-bar-col:hover .rep-bar { opacity: 0.8; }
.rep-bar-label { font-size: var(--fs-xxs); color: var(--text-mute); text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 60px; }

/* line */
.rep-line-svg { display: block; }

/* funnel (vertical bars) */
.rep-funnel { display: flex; flex-direction: column; gap: 8px; padding-top: 6px; }
.rep-funnel-row { display: grid; grid-template-columns: 100px 1fr 50px; gap: 8px; align-items: center; font-size: var(--fs-xs); }
.rep-funnel-row .lbl { color: var(--text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rep-funnel-row .bar-wrap { background: var(--surface-3); border-radius: 6px; height: 22px; overflow: hidden; }
.rep-funnel-row .bar { height: 100%; border-radius: 6px; display: flex; align-items: center; justify-content: flex-end; padding: 0 8px; min-width: 30px; transition: width .5s cubic-bezier(0.2, 0.6, 0.2, 1); }
.rep-funnel-row .bar .v { color: #fff; font-size: var(--fs-xxs); font-weight: 600; font-variant-numeric: tabular-nums; }
.rep-funnel-row .pct { font-size: var(--fs-xxs); color: var(--text-mute); text-align: right; font-variant-numeric: tabular-nums; }

/* loss reasons */
.rep-loss { display: flex; flex-direction: column; gap: 8px; padding-top: 6px; }
.rep-loss-row { display: grid; grid-template-columns: 200px 1fr 100px; gap: 10px; align-items: center; font-size: var(--fs-xs); }
.rep-loss-row .meta { display: flex; align-items: center; gap: 8px; min-width: 0; }
.rep-loss-row .d { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.rep-loss-row .r { color: var(--text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rep-loss-row .bar { height: 8px; background: var(--surface-3); border-radius: 4px; overflow: hidden; }
.rep-loss-row .bar > div { height: 100%; border-radius: 4px; transition: width .5s; }
.rep-loss-row .n { font-size: var(--fs-xxs); color: var(--text-mute); text-align: right; font-variant-numeric: tabular-nums; }
.rep-loss-row .n b { color: var(--text); font-family: var(--font-display); font-size: var(--fs-md); margin-right: 3px; }

/* team table */
.rep-team-table { display: flex; flex-direction: column; }
.rep-team-table .head, .rep-team-table .row {
  display: grid; grid-template-columns: 1.6fr .7fr .7fr .7fr 1fr 1fr 1fr; gap: 10px;
  align-items: center; padding: 10px 4px;
}
.rep-team-table .head { font-size: var(--fs-xxs); color: var(--text-mute); text-transform: uppercase; letter-spacing: 0.06em; font-weight: 600; border-bottom: 1px solid var(--border); }
.rep-team-table .row { border-bottom: 1px solid var(--border-soft); font-size: var(--fs-sm); font-variant-numeric: tabular-nums; }
.rep-team-table .row:last-child { border-bottom: none; }
.rep-team-table .row .strong { font-family: var(--font-display); font-size: var(--fs-lg); }
.rep-team-table .cell-seller { display: flex; align-items: center; gap: 8px; }
.rep-team-table .cell-seller .rank { font-family: var(--font-display); font-size: var(--fs-lg); color: var(--text-mute); width: 18px; }
.rep-team-table .cell-seller .av { width: 30px; height: 30px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #fff; font-size: var(--fs-xxs); font-weight: 600; }
.rep-team-table .cell-seller .n { font-size: var(--fs-sm); font-weight: 500; }
.rep-team-table .cell-seller .o { font-size: var(--fs-xxs); color: var(--text-mute); display: flex; align-items: center; gap: 4px; }
.sla-cell { display: flex; flex-direction: column; gap: 3px; }
.sla-cell span:first-child { font-size: var(--fs-xs); }
.sla-cell .bar { height: 4px; background: var(--surface-3); border-radius: 2px; overflow: hidden; display: block; }
.sla-cell .bar span { display: block; height: 100%; border-radius: 2px; }

/* response list */
.rep-resp-list { display: flex; flex-direction: column; gap: 8px; padding-top: 6px; }
.rep-resp-row { display: flex; align-items: center; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--border-soft); }
.rep-resp-row:last-child { border-bottom: none; }
.rep-resp-row .av { width: 30px; height: 30px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #fff; font-size: var(--fs-xxs); font-weight: 600; }
.rep-resp-row .meta { flex: 1; }
.rep-resp-row .n { font-size: var(--fs-xs); font-weight: 500; margin-bottom: 4px; }
.rep-resp-row .bar { height: 5px; background: var(--surface-3); border-radius: 3px; overflow: hidden; }
.rep-resp-row .bar span { display: block; height: 100%; border-radius: 3px; transition: width .5s; }
.rep-resp-row .t { font-family: var(--font-mono); font-size: var(--fs-xs); font-weight: 600; }

/* stock list */
.rep-stock-list { display: flex; flex-direction: column; }
.rep-stock-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border-soft); }
.rep-stock-row:last-child { border-bottom: none; }
.rep-stock-row .rk { font-family: var(--font-display); font-size: var(--fs-lg); color: var(--text-mute); width: 28px; }
.rep-stock-row img { width: 60px; height: 44px; border-radius: 6px; object-fit: cover; }
.rep-stock-row .meta { flex: 1; min-width: 0; }
.rep-stock-row .n { font-size: var(--fs-sm); font-weight: 600; }
.rep-stock-row .s { font-size: var(--fs-xxs); color: var(--text-mute); }
.rep-stock-row .stat { text-align: center; min-width: 50px; }
.rep-stock-row .stat .big { font-family: var(--font-display); font-size: var(--fs-xl); color: var(--accent); }
.rep-stock-row .stat .lbl { font-size: var(--fs-xxs); color: var(--text-mute); text-transform: uppercase; letter-spacing: 0.05em; }

/* ROI table */
.rep-roi-table { display: flex; flex-direction: column; }
.rep-roi-table .head, .rep-roi-table .row {
  display: grid; grid-template-columns: 1.4fr 1fr .8fr 1fr .7fr .7fr 1.2fr .9fr; gap: 8px;
  align-items: center; padding: 10px 4px;
}
.rep-roi-table .head { font-size: var(--fs-xxs); color: var(--text-mute); text-transform: uppercase; letter-spacing: 0.06em; font-weight: 600; border-bottom: 1px solid var(--border); }
.rep-roi-table .row { border-bottom: 1px solid var(--border-soft); font-size: var(--fs-sm); font-variant-numeric: tabular-nums; }
.rep-roi-table .row:last-child { border-bottom: none; }
.cell-origin { display: flex; align-items: center; gap: 8px; }
.cell-origin .d { width: 10px; height: 10px; border-radius: 50%; }
.roi-pill { padding: 3px 9px; border-radius: 6px; font-size: var(--fs-xs); font-weight: 600; font-family: var(--font-display); letter-spacing: 0.02em; }
.roi-pill.high { background: color-mix(in oklch, var(--success) 20%, transparent); color: var(--success); }
.roi-pill.mid  { background: color-mix(in oklch, var(--warning) 20%, transparent); color: var(--warning); }
.roi-pill.low  { background: color-mix(in oklch, var(--danger) 18%, transparent); color: var(--danger); }

/* responsive */
@media (max-width: 1100px) {
  .rep-kpis { grid-template-columns: repeat(2, 1fr); }
  .rep-row { grid-template-columns: 1fr !important; }
  .auto-strategy { grid-template-columns: 1fr; }
  .bulk-row.two { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
  .rep-team-table .head, .rep-roi-table .head { display: none; }
  .rep-team-table .row, .rep-roi-table .row {
    grid-template-columns: 1fr 1fr; gap: 6px; padding: 12px 6px;
  }
  .rep-stock-row { flex-wrap: wrap; }
}


/* ============================================================
   SPRINT 6 — Optimización técnica
   Boot splash, lazy images, page skeletons, perf HUD, install
   ============================================================ */

/* Boot splash — se muestra antes de React montar */
#boot-splash {
  position: fixed; inset: 0; z-index: 99999;
  display: grid; place-items: center;
  background: radial-gradient(120% 80% at 50% 40%, #15181d 0%, #0a0b0e 60%, #050608 100%);
  transition: opacity .45s ease, filter .45s ease;
}
#boot-splash.boot-splash-hide { opacity: 0; filter: blur(6px); pointer-events: none; }
.boot-splash-inner {
  display: flex; flex-direction: column; align-items: center; gap: 18px;
}
.boot-splash-inner img {
  width: 84px; height: 84px; object-fit: contain;
  filter: drop-shadow(0 8px 28px rgba(255,106,31,.35));
  animation: boot-pulse 2.4s ease-in-out infinite;
}
@keyframes boot-pulse {
  0%, 100% { transform: scale(1); filter: drop-shadow(0 8px 28px rgba(255,106,31,.35)); }
  50%      { transform: scale(1.04); filter: drop-shadow(0 12px 40px rgba(255,106,31,.55)); }
}
.boot-splash-bar {
  width: 180px; height: 3px; border-radius: 99px;
  background: rgba(255,255,255,.06); overflow: hidden; position: relative;
}
.boot-splash-fill {
  position: absolute; inset: 0;
  width: 40%;
  background: linear-gradient(90deg, transparent, #ff6a1f, transparent);
  animation: boot-bar 1.4s ease-in-out infinite;
}
@keyframes boot-bar {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(350%); }
}
.boot-splash-tag {
  font-family: 'Geist Mono', monospace;
  font-size: var(--fs-xxs); letter-spacing: .14em; text-transform: uppercase;
  color: rgba(255,255,255,.45);
}

/* Lazy image — placeholder + shimmer + fade-in */
.lazy-img {
  display: block;
  width: 100%; height: 100%;
}
.lazy-shimmer {
  position: absolute; inset: 0;
  background: linear-gradient(90deg,
    rgba(255,255,255,0) 0%,
    rgba(255,255,255,.04) 50%,
    rgba(255,255,255,0) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.4s linear infinite;
  pointer-events: none;
}
[data-theme="light"] .lazy-shimmer {
  background: linear-gradient(90deg,
    rgba(0,0,0,0) 0%, rgba(0,0,0,.05) 50%, rgba(0,0,0,0) 100%);
  background-size: 200% 100%;
}
@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Page skeleton (default / dashboard) */
.page-skeleton {
  padding: 24px;
  animation: skel-fade-in .25s ease-out both;
}
@keyframes skel-fade-in { from { opacity: 0; } to { opacity: 1; } }
.skel-bar {
  height: 12px; border-radius: 6px;
  background: linear-gradient(90deg,
    var(--surface-2) 0%, var(--surface-3) 50%, var(--surface-2) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.6s linear infinite;
  margin: 8px 0;
}
.skel-bar.lg { height: 22px; }
.skel-bar.w40 { width: 40%; }
.skel-bar.w50 { width: 50%; }
.skel-bar.w60 { width: 60%; }
.skel-bar.w70 { width: 70%; }
.skel-bar.w80 { width: 80%; }
.skel-circle {
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--surface-2);
  flex-shrink: 0;
}
.skel-card {
  height: 96px; border-radius: 10px;
  background: linear-gradient(90deg, var(--surface-2) 0%, var(--surface-3) 50%, var(--surface-2) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.6s linear infinite;
  margin-bottom: 10px;
}
.skel-kpi {
  height: 110px; border-radius: 12px;
  background: linear-gradient(90deg, var(--surface-2) 0%, var(--surface-3) 50%, var(--surface-2) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.6s linear infinite;
}
.skel-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px;
}
.skel-block {
  height: 320px; border-radius: 12px; margin-top: 16px;
  background: linear-gradient(90deg, var(--surface-2) 0%, var(--surface-3) 50%, var(--surface-2) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.6s linear infinite;
}

/* Kanban skeleton */
.kanban-skel {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px;
}
.kanban-skel .skel-col { display: flex; flex-direction: column; gap: 10px; }

/* WhatsApp skeleton */
.wa-skel {
  display: grid; grid-template-columns: 320px 1fr; gap: 16px; height: calc(100vh - 200px);
}
.wa-skel-list { padding: 12px; border-right: 1px solid var(--border); }
.wa-skel-chat { padding: 24px; }
.skel-row { display: flex; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--border); }

@media (max-width: 900px) {
  .skel-grid { grid-template-columns: repeat(2, 1fr); }
  .kanban-skel { grid-template-columns: 1fr; }
  .wa-skel { grid-template-columns: 1fr; }
}

/* Perf HUD */
.perf-hud {
  position: fixed; bottom: 14px; left: 14px;
  z-index: 9000;
  background: rgba(8,9,12,.88);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 10px;
  padding: 8px 12px;
  display: flex; flex-direction: column; gap: 4px;
  font-family: 'Geist Mono', monospace;
  font-size: var(--fs-xxs);
  color: #d8dde5;
  box-shadow: 0 8px 24px rgba(0,0,0,.4);
  pointer-events: none;
  user-select: none;
}
.perf-row { display: flex; justify-content: space-between; gap: 14px; min-width: 90px; }
.perf-key { color: rgba(255,255,255,.45); letter-spacing: .08em; text-transform: uppercase; font-size: var(--fs-xxs); }
.perf-val { font-weight: 600; }

/* Install PWA button */
.install-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 0 10px;
  width: auto !important;
  background: linear-gradient(135deg, var(--vm-orange), var(--vm-orange-deep)) !important;
  border-color: transparent !important;
  color: #fff !important;
  animation: install-fade-in .4s ease-out both;
}
.install-btn:hover { transform: translateY(-1px); }
.install-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 0 rgba(255,255,255,.7);
  animation: install-pulse 1.6s ease-out infinite;
}
@keyframes install-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(255,255,255,.7); }
  100% { box-shadow: 0 0 0 8px rgba(255,255,255,0); }
}
@keyframes install-fade-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

/* Virtualized list — scrollbar más sutil */
.virtual-list::-webkit-scrollbar { width: 8px; }
.virtual-list::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,.08); border-radius: 99px;
}
.virtual-list::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,.16); }
[data-theme="light"] .virtual-list::-webkit-scrollbar-thumb { background: rgba(0,0,0,.12); }
