/* ==========================================================================
   SoluZen · Agente comercial — design system (brand colors from soluzen.pro)
   Tokens first; components only reference tokens. Dark mode = its own steps.
   ========================================================================== */

:root {
  color-scheme: light;
  /* SoluZen brand (soluzen.pro): off-white paper, near-black ink, lime-olive accent, gold detail. */
  --font: "Geist", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --bg: #f2f2ee;
  --surface: #ffffff;
  --surface-2: #f7f7f3;
  --surface-hover: #efefe9;
  --border: #e2e2db;
  --border-strong: #cdcdc4;
  --text: #111111;
  --text-2: #3d3d39;
  --text-3: #6b6b64;

  --primary: #8dac00;
  --primary-hover: #7d9900;
  --primary-soft: #eef3d4;
  --primary-ink: #566a00;
  --on-primary: #111111;
  --ring: #8dac00;
  --gold: #d4a537;
  --ink: #111111;      /* dark panels (sidebar, hero) in both themes */
  --ink-2: #1b1b19;
  --on-ink: #f2f2ee;
  --on-ink-2: rgba(242, 242, 238, .62);

  --hot: #c2410c;      --hot-soft: #fff1e8;
  --warm: #9a6a00;     --warm-soft: #fbf3df;
  --cold: #2f6f8f;     --cold-soft: #e8f2f6;
  --good: #4d7a00;     --good-soft: #eef5dc;
  --warn: #9a6a00;     --warn-soft: #fbf3df;
  --bad: #b91c1c;      --bad-soft: #fdecec;
  --neutral-soft: #ecece6;

  /* chart roles: ink for volume, lime for replies; lime ordinal ramp for the funnel */
  --series-1: #2b2b28;
  --series-2: #8dac00;
  --grid: #e7e7e0;
  --axis: #c4c4ba;
  --funnel-1: #d9e6a0; --funnel-2: #bdd35c; --funnel-3: #a1bf1e; --funnel-4: #7f9b00; --funnel-5: #566a00;

  --shadow-sm: 0 1px 2px rgba(17, 17, 17, .05);
  --shadow-md: 0 6px 18px -6px rgba(17, 17, 17, .12), 0 2px 4px rgba(17, 17, 17, .04);
  --shadow-lg: 0 24px 48px -16px rgba(17, 17, 17, .28);
  --shadow-3d: 0 1px 0 rgba(255, 255, 255, .8) inset, 0 18px 40px -18px rgba(17, 17, 17, .30), 0 4px 10px -4px rgba(17, 17, 17, .08);
  --radius-sm: 10px;
  --radius: 14px;
  --radius-lg: 20px;
  --ease-out: cubic-bezier(.2, .8, .2, 1);
  --ease-spring: cubic-bezier(.34, 1.56, .64, 1);
  --dur-fast: 140ms;
  --dur: 240ms;
  --sidebar: 252px;
}

@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) {
    color-scheme: dark;
    --bg: #0c0c0b; --surface: #161614; --surface-2: #1c1c19; --surface-hover: #232320;
    --border: #2a2a26; --border-strong: #3b3b35;
    --text: #f2f2ee; --text-2: #d0d0c8; --text-3: #9d9d94;
    --primary: #a6c41a; --primary-hover: #b8d52f; --primary-soft: rgba(166, 196, 26, .14); --primary-ink: #c4dd52;
    --on-primary: #111111; --ring: #b8d52f; --gold: #e0b54e;
    --ink: #080807; --ink-2: #141412; --on-ink: #f2f2ee; --on-ink-2: rgba(242, 242, 238, .58);
    --hot: #fb923c; --hot-soft: rgba(251, 146, 60, .14);
    --warm: #e0b54e; --warm-soft: rgba(224, 181, 78, .13);
    --cold: #7fc3df; --cold-soft: rgba(127, 195, 223, .12);
    --good: #b8d52f; --good-soft: rgba(184, 213, 47, .13);
    --warn: #e0b54e; --warn-soft: rgba(224, 181, 78, .13);
    --bad: #f87171; --bad-soft: rgba(248, 113, 113, .13);
    --neutral-soft: #252521;
    --series-1: #e6e6df; --series-2: #b8d52f; --grid: #262622; --axis: #3b3b35;
    --funnel-1: #44530a; --funnel-2: #6a8100; --funnel-3: #8dac00; --funnel-4: #b0cd2a; --funnel-5: #d3e77e;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
    --shadow-md: 0 8px 22px -8px rgba(0, 0, 0, .65);
    --shadow-lg: 0 28px 56px -16px rgba(0, 0, 0, .75);
    --shadow-3d: 0 1px 0 rgba(255, 255, 255, .05) inset, 0 22px 44px -18px rgba(0, 0, 0, .8), 0 4px 10px -4px rgba(0, 0, 0, .5);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0c0c0b; --surface: #161614; --surface-2: #1c1c19; --surface-hover: #232320;
  --border: #2a2a26; --border-strong: #3b3b35;
  --text: #f2f2ee; --text-2: #d0d0c8; --text-3: #9d9d94;
  --primary: #a6c41a; --primary-hover: #b8d52f; --primary-soft: rgba(166, 196, 26, .14); --primary-ink: #c4dd52;
  --on-primary: #111111; --ring: #b8d52f; --gold: #e0b54e;
  --ink: #080807; --ink-2: #141412; --on-ink: #f2f2ee; --on-ink-2: rgba(242, 242, 238, .58);
  --hot: #fb923c; --hot-soft: rgba(251, 146, 60, .14);
  --warm: #e0b54e; --warm-soft: rgba(224, 181, 78, .13);
  --cold: #7fc3df; --cold-soft: rgba(127, 195, 223, .12);
  --good: #b8d52f; --good-soft: rgba(184, 213, 47, .13);
  --warn: #e0b54e; --warn-soft: rgba(224, 181, 78, .13);
  --bad: #f87171; --bad-soft: rgba(248, 113, 113, .13);
  --neutral-soft: #252521;
  --series-1: #e6e6df; --series-2: #b8d52f; --grid: #262622; --axis: #3b3b35;
  --funnel-1: #44530a; --funnel-2: #6a8100; --funnel-3: #8dac00; --funnel-4: #b0cd2a; --funnel-5: #d3e77e;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow-md: 0 8px 22px -8px rgba(0, 0, 0, .65);
  --shadow-lg: 0 28px 56px -16px rgba(0, 0, 0, .75);
  --shadow-3d: 0 1px 0 rgba(255, 255, 255, .05) inset, 0 22px 44px -18px rgba(0, 0, 0, .8), 0 4px 10px -4px rgba(0, 0, 0, .5);
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.55 var(--font); -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-hover); }
h1, h2, h3 { margin: 0; line-height: 1.25; letter-spacing: -.01em; }
h1 { font-size: 24px; font-weight: 700; }
h2 { font-size: 16px; font-weight: 650; }
h3 { font-size: 14px; font-weight: 650; }
p { margin: 0; }
button { font: inherit; }
svg.lucide { width: 18px; height: 18px; stroke-width: 1.75; flex: none; }
:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 12px; top: -40px; background: var(--primary); color: var(--on-primary); padding: 8px 12px; border-radius: 8px; z-index: 100; }
.skip:focus { top: 12px; color: var(--on-primary); }

/* ---------- App shell ---------- */
.app { display: grid; grid-template-columns: var(--sidebar) 1fr; min-height: 100dvh; }
.sidebar {
  position: sticky; top: 0; height: 100dvh; display: flex; flex-direction: column; gap: 4px;
  padding: 20px 14px; background: var(--surface); border-right: 1px solid var(--border);
}
.logo { display: flex; align-items: center; gap: 10px; padding: 4px 10px 20px; color: var(--text); }
.logo-mark {
  width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; color: #fff;
  background: linear-gradient(135deg, #2563eb, #1e40af); font-weight: 800; font-size: 15px;
}
.logo b { display: block; font-size: 15px; }
.logo small { display: block; color: var(--text-3); font-size: 12px; margin-top: -2px; }
.nav-label { font-size: 11px; font-weight: 650; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); padding: 14px 12px 6px; }
.nav a {
  display: flex; align-items: center; gap: 12px; min-height: 40px; padding: 8px 12px; border-radius: 10px;
  color: var(--text-2); font-weight: 550; transition: background var(--dur-fast), color var(--dur-fast);
}
.nav a:hover { background: var(--surface-hover); color: var(--text); }
.nav a[aria-current="page"] { background: var(--primary-soft); color: var(--primary-ink); }
.nav a .count { margin-left: auto; font-size: 12px; font-weight: 650; background: var(--neutral-soft); color: var(--text-2); padding: 1px 8px; border-radius: 999px; }
.sidebar-foot { margin-top: auto; display: grid; gap: 10px; }
.agent-status { display: flex; align-items: center; gap: 10px; padding: 12px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-2); font-size: 13px; }
.agent-status b { display: block; font-size: 13px; }
.agent-status span { color: var(--text-3); font-size: 12px; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--text-3); flex: none; }
.dot.live { background: #16a34a; box-shadow: 0 0 0 0 rgba(22, 163, 74, .5); animation: pulse 2.4s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(22, 163, 74, .45); } 70% { box-shadow: 0 0 0 8px rgba(22, 163, 74, 0); } 100% { box-shadow: 0 0 0 0 rgba(22, 163, 74, 0); } }

.main { min-width: 0; display: flex; flex-direction: column; }
.scrim { display: none; }
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 14px;
  padding: 14px 32px; background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(1.4) blur(12px); -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--border);
}
.menu-btn { display: none; }
.search {
  position: relative; flex: 1; max-width: 460px;
}
.search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-3); pointer-events: none; }
.search input {
  width: 100%; height: 40px; padding: 0 64px 0 38px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); font: inherit; font-size: 14px; transition: border-color var(--dur-fast), box-shadow var(--dur-fast);
}
.search input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.kbd { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); font-size: 11px; color: var(--text-3); border: 1px solid var(--border); border-radius: 6px; padding: 1px 6px; background: var(--surface-2); }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.icon-btn {
  width: 40px; height: 40px; display: inline-grid; place-items: center; border-radius: 10px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text-2); cursor: pointer; transition: background var(--dur-fast), color var(--dur-fast);
}
.icon-btn:hover { background: var(--surface-hover); color: var(--text); }
.theme-dark-only { display: none; }
:root[data-theme="dark"] .theme-dark-only { display: inline; }
:root[data-theme="dark"] .theme-light-only { display: none; }

.content { padding: 28px 32px 64px; max-width: 1400px; width: 100%; margin: 0 auto; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.page-head p { color: var(--text-3); margin-top: 4px; }
.page-head .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.breadcrumb { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-3); margin-bottom: 8px; }
.breadcrumb svg.lucide { width: 14px; height: 14px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 0 16px;
  border-radius: 10px; border: 1px solid transparent; font: inherit; font-size: 14px; font-weight: 600; cursor: pointer;
  background: var(--primary); color: var(--on-primary); box-shadow: var(--shadow-sm);
  transition: background var(--dur-fast), transform var(--dur-fast), box-shadow var(--dur-fast);
}
.btn:hover { background: var(--primary-hover); color: var(--on-primary); }
.btn:active { transform: scale(.98); }
.btn.secondary { background: var(--surface); color: var(--text); border-color: var(--border); }
.btn.secondary:hover { background: var(--surface-hover); color: var(--text); }
.btn.ghost { background: transparent; color: var(--text-2); box-shadow: none; }
.btn.ghost:hover { background: var(--surface-hover); color: var(--text); }
.btn.sm { min-height: 32px; padding: 0 12px; font-size: 13px; border-radius: 8px; }
.btn[disabled], .btn.htmx-request { opacity: .55; pointer-events: none; }

/* ---------- Cards ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 20px 0; }
.card-head p { color: var(--text-3); font-size: 13px; margin-top: 2px; }
.card-body { padding: 18px 20px 20px; }
.grid { display: grid; gap: 20px; }
.grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.main-side { grid-template-columns: minmax(0, 1.7fr) minmax(300px, 1fr); }
.stack { display: grid; gap: 20px; align-content: start; }
/* Let grid children shrink, so wide tables scroll inside their card instead of widening the page */
.grid > *, .stack > *, .card { min-width: 0; }

/* ---------- KPI tiles ---------- */
.kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 16px; margin-bottom: 20px; }
.kpi { padding: 18px 18px 16px; position: relative; overflow: hidden; }
.kpi-top { display: flex; align-items: center; justify-content: space-between; color: var(--text-2); font-size: 13px; font-weight: 600; }
.kpi-icon { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary-ink); }
.kpi-icon svg.lucide { width: 17px; height: 17px; }
.kpi-value { font-size: 30px; font-weight: 750; letter-spacing: -.02em; margin-top: 10px; line-height: 1.1; }
.kpi-sub { margin-top: 6px; font-size: 12.5px; color: var(--text-3); display: flex; align-items: center; gap: 6px; }
.kpi-sub .up { color: var(--good); font-weight: 650; display: inline-flex; align-items: center; gap: 2px; }
.kpi-sub svg.lucide { width: 13px; height: 13px; }
.kpi.highlight { border-color: color-mix(in srgb, var(--primary) 40%, var(--border)); background: linear-gradient(180deg, var(--primary-soft), var(--surface) 70%); }

/* ---------- Funnel (ordinal ramp, labels outside the bar when it is narrow) ---------- */
.funnel { display: grid; gap: 14px; }
.funnel-row { display: grid; grid-template-columns: 104px 1fr 40px; align-items: center; gap: 12px; }
.funnel-label { font-size: 13px; color: var(--text-2); font-weight: 550; }
.funnel-track { height: 30px; background: var(--surface-2); border-radius: 6px; overflow: hidden; }
.funnel-bar { height: 100%; border-radius: 0 6px 6px 0; min-width: 4px; transform-origin: left; animation: grow .6s var(--ease-out) both; }
.funnel-value { font-variant-numeric: tabular-nums; font-weight: 700; text-align: right; }
.funnel-conv { grid-column: 2; font-size: 12px; color: var(--text-3); margin-top: -8px; display: flex; align-items: center; gap: 4px; }
.funnel-conv svg.lucide { width: 12px; height: 12px; }
@keyframes grow { from { transform: scaleX(0); } }

/* ---------- Chart ---------- */
.chart-wrap { position: relative; height: 260px; }
.legend { display: flex; gap: 16px; font-size: 13px; color: var(--text-2); flex-wrap: wrap; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 14px; height: 3px; border-radius: 2px; display: inline-block; }
.seg { display: inline-flex; background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 3px; }
.seg button { border: 0; background: transparent; color: var(--text-2); font: inherit; font-size: 12.5px; font-weight: 600; padding: 5px 10px; border-radius: 7px; cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
details.table-view { margin-top: 12px; font-size: 13px; color: var(--text-3); }
details.table-view summary { cursor: pointer; }
details.table-view table { margin-top: 8px; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
th { font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--text-3); font-weight: 650; background: var(--surface-2); white-space: nowrap; }
th a { color: inherit; display: inline-flex; align-items: center; gap: 4px; }
th a svg.lucide { width: 13px; height: 13px; }
tbody tr { transition: background var(--dur-fast); }
tbody tr:hover { background: var(--surface-hover); }
tbody tr:last-child td { border-bottom: 0; }
td.num { font-variant-numeric: tabular-nums; }
.cell-main { display: flex; align-items: center; gap: 12px; min-width: 200px; }
.cell-main b { display: block; color: var(--text); font-weight: 600; }
.cell-main small { display: block; color: var(--text-3); font-size: 12.5px; }
.avatar {
  width: 36px; height: 36px; border-radius: 10px; flex: none; display: grid; place-items: center;
  font-weight: 700; font-size: 13px; color: var(--primary-ink); background: var(--primary-soft);
}
.avatar.lg { width: 52px; height: 52px; border-radius: 14px; font-size: 18px; }
.row-link { color: inherit; }
.row-link:hover b { color: var(--primary); }

/* ---------- Pills, chips ---------- */
.pill {
  display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: 999px;
  font-size: 12.5px; font-weight: 600; white-space: nowrap; background: var(--neutral-soft); color: var(--text-2);
}
.pill svg.lucide { width: 13px; height: 13px; }
.pill.st-interested, .pill.st-meeting, .pill.cp-active { background: var(--good-soft); color: var(--good); }
.pill.st-needs_info { background: var(--warn-soft); color: var(--warn); }
.pill.st-contacted, .pill.st-approved { background: var(--primary-soft); color: var(--primary-ink); }
.pill.st-discarded, .pill.st-opted_out { background: var(--bad-soft); color: var(--bad); }
.pill.cp-paused { background: var(--warn-soft); color: var(--warn); }
.score { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 650; }
.score svg.lucide { width: 14px; height: 14px; }
.score.hot { color: var(--hot); } .score.warm { color: var(--warm); } .score.cold { color: var(--cold); }
.score.none { color: var(--text-3); font-weight: 500; }

/* inline select styled as a pill */
.pill-select {
  width: auto; min-height: 0; appearance: none; -webkit-appearance: none; border: 1px solid var(--border); background: var(--surface);
  color: var(--text); font: inherit; font-size: 13px; font-weight: 600; height: 32px; padding: 0 30px 0 12px; border-radius: 999px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center;
}
.pill-select:hover { border-color: var(--border-strong); }

/* ---------- Filters ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.filters .field-inline { position: relative; flex: 1; min-width: 220px; }
.filters .field-inline svg.lucide { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-3); }
.filters .field-inline input { padding-left: 38px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text-2); font-size: 13px; font-weight: 600; cursor: pointer;
}
.chip:hover { border-color: var(--border-strong); color: var(--text); }
.chip[aria-pressed="true"] { background: var(--text); color: var(--surface); border-color: var(--text); }
.chip .n { font-variant-numeric: tabular-nums; opacity: .7; }
.results-meta { padding: 12px 16px; font-size: 13px; color: var(--text-3); display: flex; justify-content: space-between; border-top: 1px solid var(--border); }
#leads-results.htmx-request, .loading-fade.htmx-request { opacity: .55; transition: opacity var(--dur); }

/* ---------- Forms ---------- */
.field { display: grid; gap: 6px; margin-bottom: 14px; }
.field > span { font-size: 13px; font-weight: 600; color: var(--text-2); }
.field small { color: var(--text-3); font-size: 12px; }
.req { color: var(--bad); }
input, select, textarea {
  width: 100%; min-height: 40px; padding: 9px 12px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); font: inherit; font-size: 14px; transition: border-color var(--dur-fast), box-shadow var(--dur-fast);
}
textarea { resize: vertical; line-height: 1.5; }
input:hover, select:hover, textarea:hover { border-color: var(--border-strong); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.form-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
.form-actions { display: flex; gap: 10px; align-items: center; padding-top: 6px; }
.save-state { font-size: 12.5px; color: var(--text-3); display: inline-flex; align-items: center; gap: 6px; }
.save-state svg.lucide { width: 14px; height: 14px; }
.dropzone {
  display: grid; place-items: center; text-align: center; gap: 8px; padding: 36px 20px; border: 2px dashed var(--border-strong);
  border-radius: var(--radius); background: var(--surface-2); color: var(--text-2); cursor: pointer; transition: border-color var(--dur), background var(--dur);
}
.dropzone:hover, .dropzone.drag { border-color: var(--primary); background: var(--primary-soft); }
.dropzone svg.lucide { width: 32px; height: 32px; color: var(--primary); }
.dropzone input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.dropzone b { color: var(--text); }

/* ---------- Pipeline board ---------- */
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(270px, 1fr); gap: 14px; overflow-x: auto; padding-bottom: 12px; align-items: start; }
.col { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-lg); display: flex; flex-direction: column; max-height: calc(100dvh - 210px); }
.col-head { display: flex; align-items: center; gap: 8px; padding: 14px 14px 10px; font-weight: 650; font-size: 14px; }
.col-head .n { margin-left: auto; font-size: 12px; font-weight: 650; color: var(--text-2); background: var(--surface); border: 1px solid var(--border); border-radius: 999px; padding: 0 8px; }
.col-head .bar { width: 4px; height: 16px; border-radius: 2px; background: var(--text-3); }
.col[data-status="interested"] .bar, .col[data-status="meeting"] .bar { background: var(--good); }
.col[data-status="needs_info"] .bar { background: var(--warn); }
.col[data-status="contacted"] .bar, .col[data-status="approved"] .bar { background: var(--primary); }
.col[data-status="discarded"] .bar { background: var(--bad); }
.col-body { padding: 4px 10px 12px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; overflow: hidden auto; min-height: 80px; align-content: start; }
.lead-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px; box-shadow: var(--shadow-sm);
  cursor: grab; user-select: none; -webkit-user-select: none;
  transition: box-shadow var(--dur), border-color var(--dur), transform var(--dur);
}
.lead-card:hover { border-color: var(--border-strong); box-shadow: var(--shadow-md); }
.lead-card:active { cursor: grabbing; }
.lead-card a { color: var(--text); font-weight: 650; }
.lead-card a:hover { color: var(--primary); }
.lead-card .meta { color: var(--text-3); font-size: 12.5px; margin-top: 2px; }
.lead-card .foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 10px; }
.lead-card .move { flex: 0 1 auto; min-width: 0; width: auto; max-width: 62%; min-height: 0; height: 28px; font-size: 12px; padding: 0 26px 0 10px; background-position: right 8px center; text-overflow: ellipsis; }
.lead-card .foot > :first-child { white-space: nowrap; }
.score { white-space: nowrap; }
.sortable-ghost { opacity: .35; }
.sortable-chosen { box-shadow: var(--shadow-lg); transform: rotate(1.5deg); }
.col-empty { font-size: 12.5px; color: var(--text-3); text-align: center; padding: 14px 6px; border: 1px dashed var(--border-strong); border-radius: var(--radius); }

/* ---------- Lead detail ---------- */
.lead-hero { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.lead-hero h1 { font-size: 26px; }
.lead-hero .sub { color: var(--text-3); display: flex; gap: 14px; flex-wrap: wrap; margin-top: 4px; font-size: 13.5px; }
.lead-hero .sub span { display: inline-flex; align-items: center; gap: 6px; }
.lead-hero .sub svg.lucide { width: 15px; height: 15px; }
.lead-controls { margin-left: auto; display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.info-list { display: grid; gap: 14px; }
.info-item { display: flex; gap: 12px; align-items: flex-start; }
.info-item .ic { width: 34px; height: 34px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border); display: grid; place-items: center; color: var(--text-2); flex: none; }
.info-item .ic svg.lucide { width: 16px; height: 16px; }
.info-item small { display: block; color: var(--text-3); font-size: 12px; }
.info-item p { overflow-wrap: anywhere; }

.timeline { position: relative; display: grid; gap: 18px; }
.timeline::before { content: ""; position: absolute; left: 17px; top: 6px; bottom: 6px; width: 2px; background: var(--border); }
.tl-item { position: relative; display: grid; grid-template-columns: 36px 1fr; gap: 14px; }
.tl-dot { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); border: 2px solid var(--border); color: var(--text-2); z-index: 1; }
.tl-dot svg.lucide { width: 16px; height: 16px; }
.tl-item.in .tl-dot { border-color: var(--good); color: var(--good); }
.tl-item.out .tl-dot { border-color: var(--primary); color: var(--primary); }
.bubble { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; }
.tl-item.in .bubble { background: var(--good-soft); border-color: color-mix(in srgb, var(--good) 25%, var(--border)); }
.bubble .meta { font-size: 12px; color: var(--text-3); display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.bubble b { display: block; margin-bottom: 4px; }
.pre { white-space: pre-wrap; overflow-wrap: anywhere; }

/* ---------- Campaign cards ---------- */
.campaigns { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 18px; }
.campaign-card { display: flex; flex-direction: column; gap: 14px; padding: 20px; color: var(--text); transition: box-shadow var(--dur), border-color var(--dur), transform var(--dur); }
.campaign-card:hover { box-shadow: var(--shadow-md); border-color: var(--border-strong); color: var(--text); transform: translateY(-2px); }
.campaign-card .tags { display: flex; gap: 6px; flex-wrap: wrap; }
.campaign-card .stats3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; padding-top: 14px; border-top: 1px solid var(--border); }
.stats3 b { display: block; font-size: 20px; font-weight: 750; }
.stats3 small { color: var(--text-3); font-size: 12px; }
.progress { height: 6px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--primary); border-radius: 999px; }
.dl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 24px; }
.dl small { display: block; color: var(--text-3); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; margin-bottom: 2px; }
.dl .wide { grid-column: 1 / -1; }

/* ---------- Status bars list ---------- */
.bars { display: grid; gap: 12px; }
.bars-row { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; align-items: center; font-size: 13.5px; }
.bars-row .track { grid-column: 1 / -1; height: 6px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.bars-row .track i { display: block; height: 100%; background: var(--series-1); border-radius: 999px; animation: grow .6s var(--ease-out) both; transform-origin: left; }
.bars-row b { font-variant-numeric: tabular-nums; }

/* ---------- Empty states ---------- */
.empty { display: grid; place-items: center; text-align: center; gap: 10px; padding: 48px 20px; color: var(--text-2); }
.empty .em-icon { width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary-ink); }
.empty .em-icon svg.lucide { width: 26px; height: 26px; }
.empty b { color: var(--text); font-size: 16px; }
.empty p { max-width: 420px; color: var(--text-3); }

/* ---------- Notices & toasts ---------- */
.notice { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--radius); background: var(--warn-soft); color: var(--text); border: 1px solid color-mix(in srgb, var(--warn) 30%, transparent); margin-bottom: 16px; font-size: 14px; }
.notice svg.lucide { color: var(--warn); margin-top: 2px; }
.notice.ok { background: var(--good-soft); border-color: color-mix(in srgb, var(--good) 30%, transparent); }
.notice.ok svg.lucide { color: var(--good); }
.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 1000; display: grid; gap: 10px; }
.toast {
  display: flex; align-items: center; gap: 10px; min-width: 260px; max-width: 380px; padding: 12px 14px; border-radius: 12px;
  background: var(--text); color: var(--surface); box-shadow: var(--shadow-lg); font-size: 14px; font-weight: 550;
  animation: toast-in .28s var(--ease-out) both;
}
.toast svg.lucide { color: #4ade80; }
.toast.error svg.lucide { color: #f87171; }
.toast.out { animation: toast-out .18s ease-in both; }
@keyframes toast-in { from { opacity: 0; transform: translateY(12px) scale(.98); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(8px); } }

/* ---------- Page entrance ---------- */
.content > * { animation: rise .35s var(--ease-out); }
/* Live refreshes swap content in place: no entrance motion after the first load */
.live-updated .funnel-bar, .live-updated .bars-row .track i { animation: none; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } }

.muted { color: var(--text-3); }
.small { font-size: 12.5px; }
.mt { margin-top: 20px; }
.row-gap { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* ---------- Responsive ---------- */
@media (max-width: 1200px) {
  .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid.main-side { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; inset: 0 auto 0 0; width: 280px; z-index: 50; transform: translateX(-100%);
    transition: transform var(--dur) var(--ease-out); box-shadow: var(--shadow-lg);
  }
  .app.nav-open .sidebar { transform: none; }
  .scrim { display: block; position: fixed; inset: 0; background: rgba(15, 23, 42, .45); z-index: 40; opacity: 0; pointer-events: none; transition: opacity var(--dur); }
  .app.nav-open .scrim { opacity: 1; pointer-events: auto; }
  .menu-btn { display: inline-grid; }
  .topbar { padding: 12px 16px; }
  .content { padding: 20px 16px 48px; }
  .grid.cols-2, .form-row, .dl { grid-template-columns: 1fr; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kbd { display: none; }
  .funnel-row { grid-template-columns: 96px 1fr 44px; }
}
@media (max-width: 520px) {
  .kpis { grid-template-columns: 1fr 1fr; gap: 12px; }
  .kpi-value { font-size: 24px; }
  .topbar-actions .btn span { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}

/* ---------- Agent: steps, background jobs, approval queue ---------- */
.agent-step { display: flex; align-items: center; gap: 10px; padding: 12px 0; border-top: 1px solid var(--border); color: inherit; text-decoration: none; }
.agent-step:first-of-type { border-top: 0; padding-top: 0; }
.agent .notice + .agent-step { border-top: 0; }
.agent-step.link:hover b { color: var(--primary-ink); }
.agent-step select { width: auto; min-height: 32px; padding: 0 8px; }
.step-n { flex: none; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; font-weight: 700; background: var(--primary-soft); color: var(--primary-ink); }
.step-text { flex: 1; min-width: 0; }
.step-text b { display: block; font-size: 14px; }
.step-text small { display: block; color: var(--text-3); font-size: 12.5px; }
.job-slot:empty { display: none; }
.job { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; margin: 0 0 12px 36px; border-radius: var(--radius); background: var(--surface-2); font-size: 13px; }
.job .job-ic svg.lucide { width: 18px; height: 18px; margin-top: 1px; }
.job.running .job-ic svg.lucide { color: var(--primary); animation: spin 1s linear infinite; }
.job.done .job-ic svg.lucide { color: var(--good); }
.job.error .job-ic svg.lucide { color: var(--bad); }
.job-text { flex: 1; min-width: 0; display: grid; gap: 6px; }
.job-text small { color: var(--text-3); }
@keyframes spin { to { transform: rotate(360deg); } }
.draft .card-head { flex-wrap: wrap; }
.draft-profile { display: flex; gap: 8px; color: var(--text-2); font-size: 13.5px; margin-bottom: 14px; }
.draft-profile svg.lucide { flex: none; width: 16px; height: 16px; color: var(--primary); margin-top: 2px; }
.draft textarea { font: inherit; line-height: 1.55; }
.draft .form-actions { flex-wrap: wrap; }
@media (prefers-reduced-motion: reduce) { .job.running .job-ic svg.lucide { animation: none; } }

/* ---------- Envío ---------- */
.nav .count.on { background: var(--good-soft); color: var(--good); }
.nav .count.off { background: var(--surface-2); color: var(--text-3); }
.switch-card { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.switch-card .state { flex: 1; min-width: 220px; display: flex; gap: 12px; align-items: center; }
.switch-card .state .dot { width: 12px; height: 12px; border-radius: 50%; background: var(--text-3); flex: none; }
.switch-card .state .dot.on { background: var(--good); animation: pulse 2s infinite; }
.switch-card .state b { display: block; font-size: 16px; }
.switch-card .state small { color: var(--text-3); }
.confirm-box { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; margin: 4px 0 12px; }
.confirm-box input { margin-top: 3px; width: 18px; height: 18px; flex: none; }
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.stat-row > div { padding: 12px 14px; border-radius: var(--radius); background: var(--surface-2); }
.stat-row small { display: block; color: var(--text-3); font-size: 12px; }
.stat-row b { font-size: 20px; font-variant-numeric: tabular-nums; }
.rules { display: grid; gap: 8px; padding-left: 18px; font-size: 13.5px; color: var(--text-2); margin-bottom: 8px; }

/* ==========================================================================
   Brand + depth layer: SoluZen look (dark sidebar, lime accent, pill buttons),
   3D tilt cards, ambient light, entrance motion. All motion is off with
   prefers-reduced-motion.
   ========================================================================== */

a { color: var(--primary-ink); }
a:hover { color: var(--text); }
h1 { font-size: 26px; font-weight: 800; letter-spacing: -.02em; text-transform: uppercase; }
h2 { font-weight: 700; letter-spacing: -.01em; }
.page-head h1 .accent, h1 .accent { color: var(--primary); }

/* Ambient light behind the content: two soft brand-colored glows that drift slowly. */
body::before, body::after {
  content: ""; position: fixed; z-index: -1; width: 46vw; height: 46vw; border-radius: 50%;
  filter: blur(90px); opacity: .32; pointer-events: none; animation: drift 26s ease-in-out infinite alternate;
}
body::before { background: radial-gradient(circle, var(--primary) 0%, transparent 65%); top: -18vw; right: -12vw; }
body::after { background: radial-gradient(circle, var(--gold) 0%, transparent 65%); bottom: -24vw; left: 10vw; opacity: .16; animation-delay: -13s; }
@keyframes drift { to { transform: translate3d(-6vw, 5vw, 0) scale(1.12); } }
:root[data-theme="dark"] body::before { opacity: .18; }

/* ---------- Sidebar: black panel like the website footer ---------- */
.sidebar { background: var(--ink); border-right: 0; color: var(--on-ink); box-shadow: 8px 0 32px -24px rgba(0, 0, 0, .6); }
.logo { color: var(--on-ink); }
.logo:hover { color: var(--on-ink); }
.logo-mark { background: var(--primary); color: var(--ink); border-radius: 50%; font-size: 13px; letter-spacing: -.02em;
  box-shadow: 0 0 0 4px rgba(141, 172, 0, .18), 0 8px 18px -6px rgba(141, 172, 0, .6); }
.logo b { font-size: 19px; font-weight: 800; letter-spacing: -.03em; text-transform: lowercase; }
.logo small { color: var(--on-ink-2); }
.nav-label { color: var(--on-ink-2); }
.nav a { color: var(--on-ink-2); border-radius: 999px; position: relative; }
.nav a:hover { background: rgba(255, 255, 255, .07); color: var(--on-ink); }
.nav a[aria-current="page"] { background: var(--primary); color: var(--ink); font-weight: 700; box-shadow: 0 8px 20px -10px rgba(141, 172, 0, .9); }
.nav a .count { background: rgba(255, 255, 255, .1); color: var(--on-ink); }
.nav a[aria-current="page"] .count { background: rgba(17, 17, 17, .15); color: var(--ink); }
.nav .count.on { background: rgba(141, 172, 0, .22); color: #c9e15a; }
.nav .count.off { background: rgba(255, 255, 255, .08); color: var(--on-ink-2); }
.agent-status { background: var(--ink-2); border-color: rgba(255, 255, 255, .08); color: var(--on-ink); }
.agent-status span { color: var(--on-ink-2); }
.dot.live { background: var(--primary); }
.sidebar .icon-btn { background: transparent; }

/* ---------- Topbar, buttons, inputs: pill shapes like soluzen.pro ---------- */
.topbar { background: color-mix(in srgb, var(--bg) 78%, transparent); }
.search input { border-radius: 999px; }
.icon-btn { border-radius: 999px; }
.btn { border-radius: 999px; font-weight: 700; letter-spacing: .01em; padding: 0 20px;
  box-shadow: 0 1px 0 rgba(255, 255, 255, .35) inset, 0 6px 16px -8px rgba(141, 172, 0, .9);
  transition: background var(--dur-fast), transform var(--dur) var(--ease-spring), box-shadow var(--dur); }
.btn:hover { transform: translateY(-2px); box-shadow: 0 1px 0 rgba(255, 255, 255, .35) inset, 0 12px 24px -10px rgba(141, 172, 0, .95); }
.btn:active { transform: translateY(0) scale(.98); }
.btn.secondary { box-shadow: var(--shadow-sm); border-color: var(--text); }
.btn.secondary:hover { background: var(--text); color: var(--surface); box-shadow: var(--shadow-md); }
.btn.ghost:hover { transform: none; box-shadow: none; }
.btn.sm { border-radius: 999px; padding: 0 14px; }
.seg { border-radius: 999px; }
.seg button { border-radius: 999px; }
.seg button[aria-pressed="true"] { background: var(--text); color: var(--surface); }
.chip { border-radius: 999px; }

/* ---------- Cards with depth ---------- */
.card { border-radius: var(--radius-lg); box-shadow: var(--shadow-3d); transition: box-shadow var(--dur), border-color var(--dur); }
.card:hover { border-color: var(--border-strong); }

/* 3D tilt: JS sets --rx/--ry (rotation) and --mx/--my (pointer, for the glare). */
.tilt { transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) translateZ(0);
  transform-style: preserve-3d; transition: transform .45s var(--ease-out), box-shadow var(--dur); will-change: transform; position: relative; }
.tilt.tilting { transition: transform .08s linear, box-shadow var(--dur); box-shadow: var(--shadow-lg); }
.tilt::after { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: 0;
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 50%), rgba(255, 255, 255, .45), transparent 45%);
  mix-blend-mode: soft-light; transition: opacity var(--dur); }
.tilt.tilting::after { opacity: 1; }
.tilt .lift { transform: translateZ(28px); }

/* ---------- KPI tiles ---------- */
.kpis { gap: 18px; }
.kpi { padding: 20px 20px 18px; }
.kpi-icon { border-radius: 50%; background: var(--text); color: var(--primary); box-shadow: 0 8px 16px -8px rgba(17, 17, 17, .6); }
.kpi-value { font-size: 36px; font-weight: 800; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.kpi.highlight { background: var(--ink); color: var(--on-ink); border-color: transparent; }
.kpi.highlight .kpi-top, .kpi.highlight .kpi-sub { color: var(--on-ink-2); }
.kpi.highlight .kpi-value { color: var(--primary); text-shadow: 0 0 24px rgba(141, 172, 0, .45); }
.kpi.highlight .kpi-icon { background: var(--primary); color: var(--ink); }
.kpi-value.bump { animation: bump .7s var(--ease-spring); }
@keyframes bump { 30% { transform: translateY(-4px) scale(1.08); color: var(--primary); } }

/* ---------- Funnel and bars in brand colors ---------- */
.funnel-track { border-radius: 999px; }
.funnel-bar { border-radius: 999px; box-shadow: 0 1px 0 rgba(255, 255, 255, .35) inset, 0 6px 14px -8px rgba(86, 106, 0, .8); }
.bars .track i, .progress i { background: linear-gradient(90deg, var(--primary), var(--primary-hover)); }

/* ---------- Pills and avatars ---------- */
.avatar { background: var(--text); color: var(--primary); }
.step-n { background: var(--text); color: var(--primary); }

/* ---------- Dashboard hero: the agent, live, with a 3D orbit ---------- */
.hero { display: grid; grid-template-columns: minmax(0, 1fr) 220px; align-items: center; gap: 24px; padding: 26px 28px;
  margin-bottom: 20px; background: var(--ink); color: var(--on-ink); border: 0; overflow: hidden; }
.hero .eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 700; letter-spacing: .12em;
  text-transform: uppercase; color: var(--primary); }
.hero .eyebrow .dots { display: inline-flex; gap: 4px; }
.hero .eyebrow .dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--on-ink-2); }
.hero .eyebrow .dots i:first-child { background: var(--primary); }
.hero h1 { color: var(--on-ink); font-size: 30px; margin: 10px 0 8px; line-height: 1.1; }
.hero p { color: var(--on-ink-2); max-width: 560px; }
.hero-stats { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.hero-stats a, .hero-stats span { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px;
  background: rgba(255, 255, 255, .07); color: var(--on-ink); font-size: 13px; font-weight: 600; border: 1px solid rgba(255, 255, 255, .08); }
.hero-stats a:hover { background: rgba(141, 172, 0, .2); color: var(--on-ink); }
.hero-stats b { color: var(--primary); font-variant-numeric: tabular-nums; }
.hero-stats .off b { color: var(--on-ink-2); }

.orbit { position: relative; width: 200px; height: 200px; perspective: 700px; justify-self: center; }
.orbit .core { position: absolute; inset: 62px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #e4f37a, var(--primary) 45%, #3f4d00 100%);
  box-shadow: 0 0 40px rgba(141, 172, 0, .55), inset -10px -14px 24px rgba(0, 0, 0, .35); animation: breathe 4s ease-in-out infinite; }
.orbit.idle .core { filter: saturate(.55) brightness(.85); box-shadow: 0 0 22px rgba(141, 172, 0, .25), inset -10px -14px 24px rgba(0, 0, 0, .35); animation-duration: 7s; }
.orbit .ring { position: absolute; inset: 0; border-radius: 50%; border: 1.5px solid rgba(141, 172, 0, .55); transform-style: preserve-3d; }
.orbit .ring::before { content: ""; position: absolute; top: -5px; left: 50%; width: 10px; height: 10px; margin-left: -5px; border-radius: 50%;
  background: var(--primary); box-shadow: 0 0 12px var(--primary); }
.orbit .r1 { transform: rotateX(68deg); animation: spin3d-a 9s linear infinite; }
.orbit .r2 { inset: 18px; border-color: rgba(212, 165, 55, .55); transform: rotateY(64deg); animation: spin3d-b 12s linear infinite; }
.orbit .r2::before { background: var(--gold); box-shadow: 0 0 12px var(--gold); }
.orbit .r3 { inset: 36px; border-color: rgba(242, 242, 238, .25); transform: rotateX(-50deg) rotateY(30deg); animation: spin3d-c 7s linear infinite; }
.orbit .r3::before { background: var(--on-ink); box-shadow: 0 0 10px var(--on-ink); width: 7px; height: 7px; top: -3.5px; margin-left: -3.5px; }
.orbit.idle .ring { animation-duration: 40s; opacity: .5; }
@keyframes spin3d-a { from { transform: rotateX(68deg) rotateZ(0); } to { transform: rotateX(68deg) rotateZ(360deg); } }
@keyframes spin3d-b { from { transform: rotateY(64deg) rotateZ(0); } to { transform: rotateY(64deg) rotateZ(-360deg); } }
@keyframes spin3d-c { from { transform: rotateX(-50deg) rotateY(30deg) rotateZ(0); } to { transform: rotateX(-50deg) rotateY(30deg) rotateZ(360deg); } }
@keyframes breathe { 50% { transform: scale(1.06); box-shadow: 0 0 60px rgba(141, 172, 0, .7), inset -10px -14px 24px rgba(0, 0, 0, .35); } }

/* ---------- Entrance: cards rise in with a slight 3D turn, one after another ---------- */
.reveal { animation: reveal3d .7s var(--ease-out) both; animation-delay: calc(var(--i, 0) * 60ms); }
@keyframes reveal3d { from { opacity: 0; transform: perspective(900px) translateY(18px) rotateX(9deg); } }

/* Live refresh: the overview glows briefly when new numbers arrive */
#overview.fresh .kpi { animation: fresh 1.2s var(--ease-out); }
@keyframes fresh { 20% { box-shadow: 0 0 0 2px var(--primary), var(--shadow-3d); } }

/* Pipeline cards lift like paper cards */
.lead-card { transition: transform var(--dur) var(--ease-spring), box-shadow var(--dur); }
.lead-card:hover { transform: translateY(-3px) rotateX(4deg); box-shadow: var(--shadow-md); }
.sortable-chosen, .sortable-drag { transform: rotate(-2.5deg) scale(1.03) !important; box-shadow: var(--shadow-lg) !important; }

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; }
  .orbit { display: none; }
}
/* Motion follows the system setting; the "Efectos 3D" button in the top bar can force it on or off. */
@media (prefers-reduced-motion: reduce) {
  :root:not([data-motion="on"]) body::before, :root:not([data-motion="on"]) body::after,
  :root:not([data-motion="on"]) .orbit .core, :root:not([data-motion="on"]) .reveal,
  :root:not([data-motion="on"]) .kpi-value.bump, :root:not([data-motion="on"]) #overview.fresh .kpi,
  :root:not([data-motion="on"]) .orbit .ring { animation: none !important; }
  :root:not([data-motion="on"]) .tilt, :root:not([data-motion="on"]) .lead-card { transition: none; transform: none !important; }
}
:root[data-motion="off"] body::before, :root[data-motion="off"] body::after, :root[data-motion="off"] .orbit .ring,
:root[data-motion="off"] .orbit .core, :root[data-motion="off"] .reveal, :root[data-motion="off"] .kpi-value.bump,
:root[data-motion="off"] #overview.fresh .kpi { animation: none !important; }
:root[data-motion="off"] .tilt, :root[data-motion="off"] .lead-card { transition: none; transform: none !important; }
[data-motion-toggle][aria-pressed="true"] { background: var(--primary); color: var(--ink); border-color: transparent; }

/* ---------- Replies, login ---------- */
.draft-kind { margin-bottom: 10px; }
.their-reply { border-left: 3px solid var(--primary); background: var(--surface-2); border-radius: 0 var(--radius) var(--radius) 0; padding: 10px 14px; margin-bottom: 14px; }
.their-reply small { display: block; color: var(--text-3); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; margin-bottom: 4px; }
.their-reply .pre { font-size: 14px; max-height: 220px; overflow: auto; }
.their-reply .draft-profile { margin: 10px 0 0; }
.logout { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 999px; color: var(--on-ink-2); font-size: 13px; }
.logout:hover { color: var(--on-ink); background: rgba(255, 255, 255, .07); }
.login-page { min-height: 100dvh; display: grid; place-items: center; padding: 16px; }
.login-card { width: min(400px, 100%); padding: 28px; display: grid; gap: 14px; }
.login-card .logo { color: var(--text); padding: 0; }
.login-card .logo small { color: var(--text-3); }
.login-card h1 { margin: 4px 0; }

/* ---------- Language switch ---------- */
.lang-btn { font-size: 12px; font-weight: 800; letter-spacing: .04em; text-decoration: none; color: var(--text-2); }
.lang-btn:hover { color: var(--text); }
.lang-switch { justify-self: end; font-size: 13px; font-weight: 600; margin-top: -40px; }
