/* Bigbuda Dashboard v7 — Premium Final
   Linear/Stripe/Attio · Minimal · Serious · Easy to scan · Action-oriented */

* { margin: 0; padding: 0; box-sizing: border-box; }
img, svg, video, iframe, canvas { max-width: 100%; }
/* IMPORTANTE: NO aplicar overflow-x al body o html — rompe el position: sticky del header.
   El scroll horizontal lo prevenimos con max-width en elementos hijos específicos. */
html, body { max-width: 100%; }

/* Defensa contra scroll horizontal en mobile (sin tocar body/html) */
@media (max-width: 768px) {
  .main { max-width: 100vw; overflow-x: clip; padding-left: 14px; padding-right: 14px; }
  .header-inner { max-width: 100vw; padding-left: 14px; padding-right: 14px; }
  .panel, .priority-deal, .ai-card, .meeting-card, .briefing { max-width: 100%; min-width: 0; }
  .table-wrap { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .table { width: 100%; }
  input, button, .pd-email, .meeting-email code { max-width: 100%; }
  code, .pd-email, .meeting-email code { word-break: break-all; }
}

:root {
  /* Surfaces */
  --bg-base: #fafafa;
  --bg-card: #ffffff;
  --bg-card-hover: #fafafb;
  --bg-elevated: #f1f1f4;
  --bg-tinted: #f7f7f9;

  /* Borders */
  --border-subtle: #ececef;
  --border: #e2e2e6;
  --border-bright: #c7c7cc;

  /* Text */
  --text-primary: #0a0a0a;
  --text-secondary: #525252;
  --text-tertiary: #71717a;
  --text-muted: #a1a1aa;

  /* Accents — usados con moderación */
  --accent: #18181b;
  --accent-soft: #27272a;
  --link: #4338ca;

  /* Semantic — sólo donde MATTERS */
  --hot: #dc2626;
  --hot-soft: #fef2f2;
  --hot-border: #fee2e2;
  --warm: #b45309;
  --warm-soft: #fffbeb;
  --warm-border: #fef3c7;
  --cold: #71717a;
  --cold-soft: #f4f4f5;
  --cold-border: #e4e4e7;
  --won: #059669;
  --won-soft: #f0fdf4;
  --won-border: #dcfce7;
  --info: #0e7490;
  --info-soft: #ecfeff;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.06);
  --shadow-card: 0 0 0 1px var(--border-subtle), 0 1px 2px rgba(0, 0, 0, 0.04);

  --r-sm: 8px;
  --r-md: 8px;
  --r-lg: 12px;
  --r-xl: 16px;

  --t-fast: 0.12s ease;
  --t-base: 0.2s ease;
}

[data-theme="dark"] {
  /* Dark mode con jerarquía clara — base oscura, cards más claros, elevated más claros aún */
  --bg-base: #0e0e10;          /* fondo página */
  --bg-card: #1a1a1e;          /* cards (priority-deal, panels) — claro respecto a base */
  --bg-card-hover: #22222a;
  --bg-elevated: #2a2a32;      /* elementos sobre cards (frames, modals) — más claro aún */
  --bg-tinted: #15151a;
  /* Borders más visibles para definir contornos */
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border: rgba(255, 255, 255, 0.14);
  --border-bright: rgba(255, 255, 255, 0.24);
  /* Texto: contraste cómodo, sin blanco puro */
  --text-primary: #f4f4f5;     /* títulos, valores importantes */
  --text-secondary: #cfcfd6;   /* descripciones */
  --text-tertiary: #a1a1aa;    /* labels, metadatos */
  --text-muted: #7a7a83;       /* textos de soporte, timestamps */
  /* Accent: blanco roto, no blanco puro */
  --accent: #fafafa;
  --accent-soft: #d4d4d8;
  --link: #a5b4fc;
  --hot: #fb7185;
  --hot-soft: rgba(251, 113, 133, 0.16);
  --hot-border: rgba(251, 113, 133, 0.30);
  --warm: #fcd34d;
  --warm-soft: rgba(252, 211, 77, 0.14);
  --warm-border: rgba(252, 211, 77, 0.28);
  --won: #4ade80;
  --won-soft: rgba(74, 222, 128, 0.14);
  --info: #22d3ee;
  --info-soft: rgba(34, 211, 238, 0.14);
  --cold: #a1a1aa;
  --cold-soft: rgba(161, 161, 170, 0.14);
  --cold-border: rgba(161, 161, 170, 0.28);
}

/* Botón primario en dark con buen contraste */
[data-theme="dark"] .btn-primary-full,
[data-theme="dark"] .modal-btn-confirm,
[data-theme="dark"] .modal-btn-archive,
[data-theme="dark"] .btn-ai-email {
  background: var(--accent);
  color: #0a0a0a;
  border-color: var(--accent);
  font-weight: 600;
}
[data-theme="dark"] .btn-primary-full:hover,
[data-theme="dark"] .modal-btn-confirm:hover,
[data-theme="dark"] .btn-ai-email:hover {
  background: #ffffff;
  color: #0a0a0a;
}

/* Botones de estado del deal (Ganar/Perder/Archivar) — borde visible, hover claro */
[data-theme="dark"] .btn-action {
  border-color: var(--border);
  background: var(--bg-card);
  color: var(--text-secondary);
}
[data-theme="dark"] .btn-action:hover {
  background: var(--bg-elevated);
  border-color: var(--border-bright);
  color: var(--text-primary);
}

/* Frame "Análisis IA del lead" en dark — más diferenciado del card padre */
[data-theme="dark"] .lead-context-frame {
  background: var(--bg-tinted);
  border-color: var(--border);
}
[data-theme="dark"] .lead-context-frame-head {
  border-bottom-color: var(--border-subtle);
}
[data-theme="dark"] .lead-insight {
  background: var(--bg-elevated);
  border-color: var(--border);
}

/* Score block en dark con más contraste */
[data-theme="dark"] .score-block-hot {
  background: rgba(251, 113, 133, 0.18);
  color: #fda4af;
  border-color: rgba(251, 113, 133, 0.34);
}
[data-theme="dark"] .score-block-warm {
  background: rgba(252, 211, 77, 0.16);
  color: #fde68a;
  border-color: rgba(252, 211, 77, 0.30);
}
[data-theme="dark"] .score-block-cold {
  background: rgba(161, 161, 170, 0.16);
  color: #d4d4d8;
  border-color: rgba(161, 161, 170, 0.28);
}

/* Status pills en dark con mejor legibilidad */
[data-theme="dark"] .pd-status-pill {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-secondary);
  border-color: var(--border);
}
[data-theme="dark"] .pd-status-meeting   { background: rgba(165, 180, 252, 0.16); color: #c7d2fe; border-color: rgba(165, 180, 252, 0.34); }
[data-theme="dark"] .pd-status-contacted { background: rgba(103, 232, 249, 0.16); color: #cffafe; border-color: rgba(103, 232, 249, 0.34); }
[data-theme="dark"] .pd-status-sent      { background: rgba(147, 197, 253, 0.16); color: #dbeafe; border-color: rgba(147, 197, 253, 0.34); }
[data-theme="dark"] .pd-status-viewed    { background: rgba(196, 181, 253, 0.18); color: #ddd6fe; border-color: rgba(196, 181, 253, 0.36); }
[data-theme="dark"] .pd-status-closing   { background: rgba(252, 211, 77, 0.20); color: #fef3c7; border-color: rgba(252, 211, 77, 0.40); }
[data-theme="dark"] .pd-status-won       { background: rgba(74, 222, 128, 0.18); color: #bbf7d0; border-color: rgba(74, 222, 128, 0.36); }
[data-theme="dark"] .pd-status-lost      { background: rgba(251, 113, 133, 0.18); color: #fecdd3; border-color: rgba(251, 113, 133, 0.36); }

/* Hover de cards en dark */
[data-theme="dark"] .priority-deal {
  background: var(--bg-card);
  border-color: var(--border);
}
[data-theme="dark"] .priority-deal:hover {
  border-color: var(--border-bright);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
}

/* Inputs en dark */
[data-theme="dark"] input,
[data-theme="dark"] textarea,
[data-theme="dark"] .modal-email-rich {
  background: var(--bg-tinted);
  color: var(--text-primary);
  border-color: var(--border);
}
[data-theme="dark"] input::placeholder,
[data-theme="dark"] textarea::placeholder {
  color: var(--text-muted);
}

/* Secciones, labels, headers — mejor contraste */
[data-theme="dark"] .section-h1,
[data-theme="dark"] .panel-meta,
[data-theme="dark"] .pd-toolbar-label,
[data-theme="dark"] .lead-context-frame-title,
[data-theme="dark"] .total-side-label,
[data-theme="dark"] .total-label {
  color: var(--text-tertiary);
}

/* Pills, tags y badges chicos en dark */
[data-theme="dark"] .ai-tag,
[data-theme="dark"] .pd-tag,
[data-theme="dark"] .pd-views-meta,
[data-theme="dark"] .pd-empresa,
[data-theme="dark"] .pd-days-ok {
  background: var(--bg-elevated);
  color: var(--text-tertiary);
}

/* Header en dark — sutil pero diferenciado */
[data-theme="dark"] .header {
  background: rgba(14, 14, 16, 0.85);
  border-bottom-color: var(--border-subtle);
}

/* Login overlay en dark */
[data-theme="dark"] .login-card {
  background: var(--bg-card);
  border-color: var(--border);
}
[data-theme="dark"] .login-user-selector {
  background: var(--bg-tinted);
  border-color: var(--border);
}
[data-theme="dark"] .login-user-option.active {
  background: var(--bg-elevated);
  color: var(--text-primary);
}
[data-theme="dark"] .login-input {
  background: var(--bg-tinted);
  border-color: var(--border);
}
[data-theme="dark"] .login-btn {
  background: var(--accent);
  color: #0a0a0a;
}
[data-theme="dark"] .login-btn:hover { background: #ffffff; }

/* En dark mode los botones primary usan accent (gris claro) en lugar de text-primary blanco puro */
[data-theme="dark"] .btn-primary-full,
[data-theme="dark"] .modal-btn-confirm,
[data-theme="dark"] .modal-btn-archive,
[data-theme="dark"] .btn-ai-email {
  background: var(--accent);
  color: var(--bg-base);
  border-color: var(--accent);
}
[data-theme="dark"] .btn-primary-full:hover,
[data-theme="dark"] .modal-btn-confirm:hover,
[data-theme="dark"] .btn-ai-email:hover {
  background: #fafafa;
  color: var(--bg-base);
}

/* Score block en dark — un poco más legible */
[data-theme="dark"] .score-block-hot {
  background: rgba(220, 38, 38, 0.18);
  color: #fca5a5;
}
[data-theme="dark"] .score-block-warm {
  background: rgba(180, 83, 9, 0.18);
  color: #fcd34d;
}
[data-theme="dark"] .score-block-cold {
  background: rgba(113, 113, 122, 0.18);
  color: #d4d4d8;
}

/* Status pills en dark con mejor legibilidad */
[data-theme="dark"] .pd-status-pill {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-secondary);
}
[data-theme="dark"] .pd-status-meeting   { background: rgba(99, 102, 241, 0.16); color: #a5b4fc; border-color: rgba(99, 102, 241, 0.30); }
[data-theme="dark"] .pd-status-contacted { background: rgba(14, 165, 233, 0.16); color: #67e8f9; border-color: rgba(14, 165, 233, 0.30); }
[data-theme="dark"] .pd-status-sent      { background: rgba(37, 99, 235, 0.16); color: #93c5fd; border-color: rgba(37, 99, 235, 0.30); }
[data-theme="dark"] .pd-status-viewed    { background: rgba(124, 58, 237, 0.16); color: #c4b5fd; border-color: rgba(124, 58, 237, 0.30); }
[data-theme="dark"] .pd-status-closing   { background: rgba(245, 158, 11, 0.18); color: #fcd34d; border-color: rgba(245, 158, 11, 0.34); }
[data-theme="dark"] .pd-status-won       { background: rgba(5, 150, 105, 0.18); color: #4ade80; border-color: rgba(5, 150, 105, 0.34); }
[data-theme="dark"] .pd-status-lost      { background: rgba(220, 38, 38, 0.18); color: #fca5a5; border-color: rgba(220, 38, 38, 0.34); }

/* Hover de cards en dark — más sutil */
[data-theme="dark"] .priority-deal:hover {
  border-color: var(--border-bright);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
}

/* Inputs en dark más cómodos */
[data-theme="dark"] input,
[data-theme="dark"] textarea,
[data-theme="dark"] .modal-email-rich {
  background: var(--bg-tinted);
  color: var(--text-primary);
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-base);
  color: var(--text-primary);
  font-size: 14px;
  line-height: 1.5;
  min-height: 100vh;
  font-feature-settings: 'cv11', 'ss01';
  letter-spacing: -0.011em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ─────── HEADER ─────── */
.header {
  position: -webkit-sticky;
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--bg-base);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle);
  /* Asegurar que el sticky funcione en Safari/iOS */
  width: 100%;
  will-change: transform;
}
.header-inner {
  max-width: 1500px;  /* alineado con .main */
  margin: 0 auto;
  padding: 12px 32px;
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

/* ─────── HEADER SEARCH ─────── */
.header-search {
  position: relative;
  flex: 1;
  max-width: 380px;
  margin: 0 auto;
}
.header-search input {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 7px 36px 7px 32px;
  font-size: 13px;
  color: var(--text-primary);
  font-family: inherit;
  outline: none !important;
  transition: border-color var(--t-fast);
}
.header-search input::placeholder { color: var(--text-muted); }
.header-search input:focus,
.header-search input:focus-visible {
  outline: none !important;
  border-color: var(--border-bright);
  background: var(--bg-card);
  box-shadow: none;
}
.search-icon {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-tertiary);
  pointer-events: none;
}
.search-kbd {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 11px;
  color: var(--text-muted);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  padding: 1px 6px;
  border-radius: 8px;
  font-family: 'JetBrains Mono', monospace;
  pointer-events: none;
}
.header-search input:focus ~ .search-kbd { display: none; }

.search-results {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.08);
  max-height: 480px;
  overflow-y: auto;
  z-index: 1000;
  display: none;
}
.search-results.visible { display: block; }
.search-result {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  cursor: pointer;
  border-bottom: 1px solid var(--border-subtle);
  text-decoration: none;
  color: inherit;
  transition: background var(--t-fast);
}
.search-result:last-child { border-bottom: none; }
.search-result:hover, .search-result.active {
  background: var(--bg-tinted);
}
.search-result-info {
  flex: 1;
  min-width: 0;
}
.search-result-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.search-result-meta {
  font-size: 11px;
  color: var(--text-tertiary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.search-result-meta mark {
  background: var(--accent-bg, rgba(124, 58, 237, 0.12));
  color: var(--text-primary);
  font-weight: 600;
  padding: 0 2px;
  border-radius: 2px;
}
.search-result-name mark {
  background: var(--accent-bg, rgba(124, 58, 237, 0.12));
  color: var(--text-primary);
  padding: 0 2px;
  border-radius: 2px;
}
.search-result-status {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 999px;
  white-space: nowrap;
  flex-shrink: 0;
}
.search-empty {
  padding: 20px;
  text-align: center;
  color: var(--text-muted);
  font-size: 12px;
}
[data-theme="light"] .header {
  background: rgba(250, 250, 250, 0.92);
}
[data-theme="dark"] .header {
  background: rgba(9, 9, 11, 0.92);
}

.logo { display: flex; align-items: baseline; gap: 10px; }
.logo-icon {
  font-size: 14px;
  color: var(--text-primary);
  display: inline-block;
}
.logo-text {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.025em;
  color: var(--text-primary);
}
.logo-sub {
  font-size: 13px;
  color: var(--text-tertiary);
  font-weight: 400;
  margin-left: 6px;
  padding-left: 12px;
  border-left: 1px solid var(--border);
}

.header-right { display: flex; align-items: center; gap: 8px; }

.filter-pills {
  display: flex;
  gap: 0;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 3px;
}
.filter-pill {
  background: transparent;
  border: none;
  color: var(--text-tertiary);
  padding: 5px 12px;
  border-radius: var(--r-sm);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--t-fast);
  font-family: inherit;
}
.filter-pill:hover { color: var(--text-primary); }
.filter-pill.active {
  background: var(--bg-card);
  color: var(--text-primary);
  box-shadow: var(--shadow-sm);
}

.status {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 6px 11px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  font-size: 12px;
  color: var(--text-secondary);
}
.status-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--cold);
}
.status-dot.live { background: var(--won); }
.status-dot.error { background: var(--hot); }

.last-update {
  font-size: 11px;
  color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace;
  font-variant-numeric: tabular-nums;
  padding: 6px 10px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
}

.btn-refresh, .btn-theme {
  background: var(--bg-card);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  width: 32px;
  height: 32px;
  border-radius: var(--r-md);
  cursor: pointer;
  font-size: 13px;
  font-family: inherit;
  transition: all var(--t-fast);
  display: flex;
  align-items: center;
  justify-content: center;
}
.btn-refresh:hover, .btn-theme:hover {
  background: var(--bg-elevated);
  color: var(--text-primary);
  border-color: var(--border-bright);
}

/* ─────── MAIN ─────── */
.main {
  max-width: 1500px;
  margin: 0 auto;
  padding: 28px 32px 60px;
  width: 100%;
}

.section-h1 {
  font-size: 11px;
  color: var(--text-tertiary);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 0 0 14px;
}

.hero { margin-bottom: 28px; }

/* ─────── HOY HERO — acciones del día (top of mind) ─────── */
.hoy-hero { margin-bottom: 32px; }
.hoy-card {
  background: linear-gradient(135deg, #1a1d2e 0%, #2a1d3e 100%);
  background: linear-gradient(135deg, #fafafa 0%, #f5f3ff 100%);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 24px 28px;
  position: relative;
  overflow: hidden;
}
.hoy-card::before {
  content: '';
  position: absolute;
  top: -30%; right: -10%;
  width: 360px; height: 360px;
  background: radial-gradient(circle, rgba(124, 58, 237, 0.06) 0%, transparent 70%);
  pointer-events: none;
}
.hoy-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 18px;
  position: relative;
}
.hoy-title { display: flex; align-items: center; gap: 14px; }
.hoy-emoji { font-size: 32px; }
.hoy-h1 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}
.hoy-h2 {
  font-size: 12px;
  color: var(--text-tertiary);
  margin-top: 2px;
}
.hoy-meta {
  font-size: 11px;
  color: var(--accent);
  font-weight: 600;
  background: var(--accent-bg, rgba(124, 58, 237, 0.08));
  padding: 4px 12px;
  border-radius: 999px;
}

.hoy-list { list-style: none; counter-reset: hoy; }
.hoy-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 14px 16px;
  margin-bottom: 10px;
  counter-increment: hoy;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-left: 50px;
  transition: all var(--t-fast);
}
.hoy-item:hover {
  border-color: var(--border-bright);
  box-shadow: 0 4px 12px rgba(0,0,0,0.04);
}
.hoy-item:last-child { margin-bottom: 0; }
.hoy-item::before {
  content: counter(hoy);
  position: absolute;
  left: 14px; top: 14px;
  width: 26px; height: 26px;
  background: var(--accent);
  color: white;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
  font-size: 12px;
}
.hoy-item-head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.hoy-deal-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  text-decoration: none;
  letter-spacing: -0.01em;
}
.hoy-deal-name:hover { color: var(--accent); }
.hoy-empresa {
  font-size: 12px;
  color: var(--text-tertiary);
}
.hoy-spacer { flex: 1; }
.hoy-amount {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}
.hoy-action {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-primary);
  flex-wrap: wrap;
}
.hoy-action strong { font-weight: 500; }
.hoy-email {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  background: var(--bg-tinted);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-sm);
  padding: 5px 10px;
}
.hoy-email code {
  font-family: 'JetBrains Mono', monospace;
  background: none;
  color: var(--text-secondary);
}

/* TOTAL CARD + Breakdown — el más importante */
.total-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,0.02);
}
.total-main {
  padding: 32px 36px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  border-right: 1px solid var(--border-subtle);
  position: relative;
  overflow: hidden;
}
.total-main::before {
  content: '';
  position: absolute;
  top: -40%; right: -20%;
  width: 240px; height: 240px;
  background: radial-gradient(circle, rgba(124, 58, 237, 0.04) 0%, transparent 70%);
  pointer-events: none;
}
.total-label {
  font-size: 12px;
  color: var(--text-tertiary);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 12px;
  position: relative;
}
.total-value {
  font-size: 56px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.045em;
  color: var(--text-primary);
  font-feature-settings: 'tnum';
  font-variant-numeric: tabular-nums;
  margin-bottom: 10px;
  position: relative;
}
.total-sub {
  font-size: 13px;
  color: var(--text-tertiary);
}
.total-sub span {
  color: var(--text-primary);
  font-weight: 600;
}

.total-side {
  padding: 16px 24px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.total-side-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-subtle);
}
.total-side-row:last-child { border-bottom: none; }
.total-side-label {
  font-size: 12px;
  color: var(--text-secondary);
}
.total-side-val {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
  font-family: 'JetBrains Mono', monospace;
}

@media (max-width: 800px) {
  .total-grid { grid-template-columns: 1fr; }
  .total-main { border-right: none; border-bottom: 1px solid var(--border-subtle); padding: 24px; }
  .total-value { font-size: 40px; }
  .total-side { padding: 8px 24px 16px; }
}

/* ─────── KPI CARDS — minimal style ─────── */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
}

.kpi {
  background: var(--bg-card);
  border-right: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
  padding: 18px 22px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  position: relative;
  transition: background var(--t-fast);
  cursor: default;
}
.kpi:hover { background: var(--bg-card-hover); }
.kpi:last-child { border-right: none; }

/* Sin iconos */
.kpi-icon { display: none; }

.kpi-body { flex: 1; min-width: 0; }
.kpi-label {
  font-size: 12px;
  color: var(--text-tertiary);
  font-weight: 500;
  margin-bottom: 8px;
  letter-spacing: 0;
  text-transform: none;
}
.kpi-value {
  font-size: 28px;
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.02em;
  font-feature-settings: 'tnum';
  font-variant-numeric: tabular-nums;
  margin-bottom: 4px;
  color: var(--text-primary);
}
.kpi-sub {
  font-size: 12px;
  color: var(--text-tertiary);
  font-weight: 400;
}

/* Solo HOT lleva color destacado, el resto = negro */
.kpi-hot .kpi-value { color: var(--hot); }
.kpi-won .kpi-value { color: var(--won); }
.kpi-overdue .kpi-value { color: var(--hot); }

/* Resto en negro/gris standard */
.kpi-warm .kpi-value,
.kpi-cold .kpi-value,
.kpi-meet .kpi-value,
.kpi-active .kpi-value,
.kpi-cash .kpi-value,
.kpi-pending .kpi-value,
.kpi-avg .kpi-value,
.kpi-rate .kpi-value,
.kpi-velocity .kpi-value {
  color: var(--text-primary);
}

@media (max-width: 1100px) {
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .kpi:nth-child(even) { border-right: none; }
}
@media (max-width: 600px) {
  .kpi-grid { grid-template-columns: 1fr; }
  .kpi { border-right: none; }
}

/* ─────── GROUPED RECOMMENDATIONS ─────── */
.grouped-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  flex-wrap: wrap;
  gap: 12px;
}
.grouped-filters {
  display: flex;
  gap: 0;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 3px;
}
.grouped-filters .filter-pill {
  background: transparent;
  border: none;
  color: var(--text-tertiary);
  padding: 5px 12px;
  border-radius: var(--r-sm);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--t-fast);
  font-family: inherit;
}
.grouped-filters .filter-pill:hover { color: var(--text-primary); }
.grouped-filters .filter-pill.active {
  background: var(--bg-card);
  color: var(--text-primary);
  box-shadow: var(--shadow-sm);
}

.group {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  margin-bottom: 14px;
  overflow: hidden;
}
.group-head {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-tinted);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.group-title { display: flex; align-items: center; gap: 10px; }
.group-icon { font-size: 18px; }
.group-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}
.group-count {
  background: var(--bg-elevated);
  color: var(--text-secondary);
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.group-subtitle {
  font-size: 12px;
  color: var(--text-tertiary);
}

.group-hot .group-name { color: var(--hot); }
.group-hot .group-count { background: var(--hot-soft); color: var(--hot); }
.group-won .group-name { color: var(--won); }
.group-won .group-count { background: var(--won-soft); color: var(--won); }
.group-info .group-name { color: var(--info); }
.group-info .group-count { background: var(--info-soft); color: var(--info); }
.group-purple .group-name { color: #7c3aed; }
.group-purple .group-count { background: #f5f3ff; color: #7c3aed; }
.group-warm .group-name { color: var(--warm); }
.group-warm .group-count { background: var(--warm-soft); color: var(--warm); }

.group-body {}
.g-deal {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border-subtle);
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}
.g-deal:last-child { border-bottom: none; }
.g-deal:hover { background: var(--bg-tinted); }

.g-deal-main {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.g-deal-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  text-decoration: none;
  letter-spacing: -0.01em;
  flex: 1;
  min-width: 0;
}
.g-deal-name:hover { color: var(--link); }
.g-deal-views {
  font-size: 11px;
  color: var(--text-secondary);
  background: var(--bg-elevated);
  padding: 2px 7px;
  border-radius: 8px;
  font-weight: 500;
}
.g-deal-amount {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}
.g-deal-amount-empty {
  font-family: 'Inter', sans-serif;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 400;
  font-style: italic;
}

.g-deal-action {
  font-size: 13px;
  color: var(--text-primary);
  line-height: 1.5;
}
.g-deal-action strong { font-weight: 600; }
.g-deal-why {
  display: block;
  font-size: 12px;
  color: var(--text-tertiary);
  margin-top: 2px;
}

.g-deal-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--text-tertiary);
  flex-wrap: wrap;
  gap: 8px;
}
.g-deal-who strong { color: var(--text-primary); font-weight: 600; }

/* ─────── PRIORITY DEALS — Rich card with email + message ─────── */
.priority-deals {
  display: grid;
  gap: 16px;
}
.priority-deal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: all var(--t-base);
  position: relative;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.025);
}
.priority-deal::before {
  content: '';
  position: absolute;
  left: 0; top: 0;
  width: 3px; height: 100%;
  background: var(--cold);
  opacity: 0.4;
  transition: opacity var(--t-fast);
}
.priority-deal:has(.score-hot)::before { background: var(--hot); opacity: 1; }
.priority-deal:has(.score-warm)::before { background: var(--warm); opacity: 1; }
.priority-deal:hover {
  border-color: var(--border-bright);
  box-shadow: 0 4px 14px rgba(0,0,0,0.06);
  transform: translateY(-1px);
}

.pd-header {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.pd-name-block { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.pd-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  text-decoration: none;
  letter-spacing: -0.01em;
}
.pd-name:hover { color: var(--link); }
.pd-name-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.pd-empresa {
  font-size: 12px;
  color: var(--text-tertiary);
}
.pd-days {
  font-size: 11px;
  font-weight: 500;
  padding: 1px 8px;
  border-radius: 999px;
  font-family: 'JetBrains Mono', monospace;
}
.pd-days-ok { background: var(--bg-elevated); color: var(--text-tertiary); }
.pd-days-soon { background: var(--warm-soft); color: var(--warm); }
.pd-days-urgent { background: var(--hot-soft); color: var(--hot); font-weight: 600; }
/* Monto del deal — se ve como texto plano, editable al click (reset full button styles) */
.pd-amount-inline {
  font-family: 'JetBrains Mono', monospace;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
  background: transparent;
  border: none;
  outline: none;
  padding: 3px 6px;
  margin: 0;
  cursor: pointer;
  border-radius: var(--r-sm);
  transition: background var(--t-fast);
  -webkit-appearance: none;
  appearance: none;
  letter-spacing: -0.01em;
}
.pd-amount-inline:hover {
  background: var(--bg-elevated);
}
.pd-amount-inline:active {
  transform: none;
}
.pd-amount-empty-btn {
  color: var(--text-muted) !important;
  font-size: 11px;
  font-weight: 500;
  font-family: 'Inter', sans-serif;
  font-style: italic;
}
.pd-amount-empty-btn:hover {
  color: var(--text-tertiary) !important;
}
.pd-amount-empty {
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 400;
  font-family: 'Inter', sans-serif;
  font-style: italic;
}

/* Email — usado en pd-meta-bar */
.pd-email {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: var(--text-primary);
  background: none;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.btn-copy {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  padding: 3px 9px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 11px;
  font-family: inherit;
  transition: all var(--t-fast);
  font-weight: 500;
  white-space: nowrap;
}
.btn-copy:hover {
  background: var(--text-primary);
  border-color: var(--text-primary);
  color: var(--bg-card);
}
.btn-copy.copied {
  background: var(--won-soft);
  border-color: var(--won);
  color: var(--won);
}

/* (CSS de pd-message / pd-footer / pd-meta-row / pd-email-row eliminado:
   reemplazado por pd-toolbar + pd-meta-bar + pill-followup en el nuevo layout) */

/* Botones de acción del deal */
.pd-actions {
  display: flex;
  gap: 6px;
  padding-top: 10px;
  margin-top: 4px;
  border-top: 1px solid var(--border-subtle);
}
.btn-action {
  flex: 1;
  border: 1px solid var(--border-subtle);
  background: var(--bg-card);
  color: var(--text-tertiary);
  padding: 8px 12px;
  border-radius: var(--r-sm);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--t-fast);
  font-family: inherit;
  min-height: 34px;
  letter-spacing: -0.005em;
}
.btn-action:hover { background: var(--bg-tinted); border-color: var(--border-bright); color: var(--text-primary); }
.btn-action:disabled { opacity: 0.6; cursor: wait; }
.btn-action.done { background: var(--won-soft); border-color: var(--won); color: var(--won); }

.btn-win:hover { background: var(--won-soft); border-color: var(--won); color: var(--won); }
.btn-lose:hover { background: var(--hot-soft); border-color: var(--hot); color: var(--hot); }
.btn-archive:hover { background: var(--cold-soft); border-color: var(--cold); color: var(--cold); }
.btn-unarchive:hover { background: var(--accent-bg, rgba(124,58,237,0.08)); border-color: var(--accent); color: var(--accent); }
.btn-emailed:hover { background: var(--accent-bg, rgba(37, 99, 235, 0.08)); border-color: #2563eb; color: #2563eb; }

/* ─── MICRO ANIMACIONES GLOBALES ─── */
@keyframes fade-in-up {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes fade-in-only {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes pulse-soft {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}
@keyframes shimmer-soft {
  0% { background-position: -300px 0; }
  100% { background-position: 300px 0; }
}
@keyframes header-slide-down {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Primera carga: header + secciones aparecen escalonadamente */
body.first-load .header { animation: header-slide-down 0.35s ease-out backwards; }
body.first-load .briefing { animation: fade-in-up 0.4s ease-out 0.1s backwards; }
body.first-load .panel-meetings { animation: fade-in-up 0.4s ease-out 0.18s backwards; }
body.first-load .panel-ai { animation: fade-in-up 0.4s ease-out 0.22s backwards; }
body.first-load .hero { animation: fade-in-up 0.4s ease-out 0.26s backwards; }
body.first-load .row-2 { animation: fade-in-up 0.4s ease-out 0.30s backwards; }
body.first-load .footer { animation: fade-in-only 0.5s ease-out 0.5s backwards; }

/* Cards aparecen con fade-in sutil SOLO al cargar la página por primera vez.
   En refreshes posteriores no animan (evita parpadeo). */
body.first-load .priority-deal,
body.first-load .ai-card,
body.first-load .meeting-card {
  animation: fade-in-up 0.28s ease-out backwards;
}
body.first-load .priority-deal:nth-child(1) { animation-delay: 0.02s; }
body.first-load .priority-deal:nth-child(2) { animation-delay: 0.05s; }
body.first-load .priority-deal:nth-child(3) { animation-delay: 0.08s; }
body.first-load .priority-deal:nth-child(4) { animation-delay: 0.11s; }
body.first-load .priority-deal:nth-child(5) { animation-delay: 0.14s; }
body.first-load .priority-deal:nth-child(n+6) { animation-delay: 0.17s; }

body.first-load .ai-card:nth-child(1) { animation-delay: 0.04s; }
body.first-load .ai-card:nth-child(2) { animation-delay: 0.08s; }
body.first-load .ai-card:nth-child(3) { animation-delay: 0.12s; }
body.first-load .ai-card:nth-child(n+4) { animation-delay: 0.16s; }

/* Status sync indicator pulse during refresh */
.status.syncing .status-dot {
  animation: pulse-soft 1.2s ease-in-out infinite;
}

/* Transitions universales suaves */
button, a, input, select, .priority-deal, .ai-card, .lead-task, .meeting-card,
.btn-action, .btn-primary-full, .pill-followup, .pill-sent,
.task-check, .task-btn, .filter-pill, .modal-btn {
  transition: all 0.18s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Botones tienen feedback al click (active state) */
button:active:not(:disabled) {
  transform: scale(0.97);
}

/* ─── BRIEFING IA — saludo contextual arriba ─── */
.briefing {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  margin-bottom: 14px;
  position: relative;
}
.briefing-icon {
  position: relative;
  width: 36px; height: 36px;
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.briefing-pulse {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: #7c3aed;
  position: relative;
}
.briefing-pulse::before,
.briefing-pulse::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: rgba(124, 58, 237, 0.5);
  animation: briefing-ping 2.4s ease-out infinite;
}
.briefing-pulse::after { animation-delay: 1.2s; }
@keyframes briefing-ping {
  0% { transform: scale(1); opacity: 0.6; }
  70%, 100% { transform: scale(3.2); opacity: 0; }
}
.briefing-body { flex: 1; min-width: 0; position: relative; z-index: 1; }
.briefing-greeting {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.005em;
  margin-bottom: 2px;
}
.briefing-summary {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
}
.briefing-summary strong { color: var(--text-primary); font-weight: 600; }
.briefing-meta {
  display: flex;
  gap: 18px;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}
.briefing-meta-item { display: flex; flex-direction: column; align-items: flex-end; gap: 1px; }
.briefing-meta-num {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: -0.01em;
}
.briefing-meta-hot { color: var(--hot); }
.briefing-meta-lbl {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 500;
}
@media (max-width: 700px) {
  .briefing { flex-direction: column; align-items: flex-start; }
  .briefing-meta { width: 100%; justify-content: space-between; gap: 8px; }
  .briefing-meta-item { align-items: flex-start; }
}

/* ─── PRÓXIMAS REUNIONES DE MARCEL ─── */
.panel-meetings {
  background: var(--bg-card);
  border-color: var(--border);
}
.meetings-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.meetings-empty {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  font-size: 13px;
  color: var(--text-tertiary);
  background: var(--bg-elevated);
  border-radius: var(--r-md);
  border: 1px dashed var(--border);
}
.meetings-empty-icon {
  width: 20px; height: 20px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--bg-card);
  border: 1.5px dashed var(--border-bright);
  color: var(--text-muted);
  border-radius: 50%;
  font-size: 11px; font-weight: 700;
  margin-top: 1px;
  flex-shrink: 0;
}
.meetings-empty-body { display: flex; flex-direction: column; gap: 3px; }
.meetings-empty-body strong { color: var(--text-primary); font-weight: 600; }
.meetings-empty-sub { font-size: 12px; line-height: 1.5; }

.meeting-card {
  display: grid;
  grid-template-columns: minmax(0, 130px) minmax(0, 1fr) auto;
  gap: 14px;
  padding: 12px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  align-items: center;
  transition: all var(--t-fast);
  min-width: 0;
}
.meeting-card:hover {
  border-color: var(--border-bright);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}
.meeting-card-urgent {
  border-color: rgba(220, 38, 38, 0.30);
  background: var(--hot-soft);
}

.meeting-date {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.meeting-date-main {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  text-transform: capitalize;
  letter-spacing: -0.005em;
}
.meeting-date-relative {
  font-size: 11px;
  color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace;
}

.meeting-body { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.meeting-head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.meeting-name {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-primary);
  text-decoration: none;
  letter-spacing: -0.005em;
}
.meeting-name:hover { color: var(--link); }
.meeting-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  color: var(--text-tertiary);
  flex-wrap: wrap;
}
.meeting-empresa { font-weight: 500; }
.meeting-amount {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 600;
  color: var(--text-primary);
}
.meeting-score {
  font-size: 10.5px;
  padding: 1px 7px;
  border-radius: 999px;
  font-weight: 600;
  font-family: 'JetBrains Mono', monospace;
}
.meeting-email {
  font-size: 11.5px;
  color: var(--text-tertiary);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
}
.meeting-email-icon { color: var(--text-muted); }
.meeting-email code {
  font-family: 'JetBrains Mono', monospace;
  background: var(--bg-tinted);
  padding: 1px 6px;
  border-radius: var(--r-sm);
}

.meeting-actions { display: flex; gap: 6px; }

@media (max-width: 700px) {
  .meeting-card { grid-template-columns: 1fr; gap: 8px; }
}

/* ─── BOTÓN COMPACTO "SEGUIMIENTO" en pd-toolbar ─── */
.pill-followup-compact {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 11px;
  background: var(--text-primary);
  color: var(--bg-card);
  border: 1px solid var(--text-primary);
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s ease;
  letter-spacing: -0.005em;
  white-space: nowrap;
  line-height: 1;
}
.pill-followup-compact:hover {
  opacity: 0.9;
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.10);
}
.pill-followup-compact svg {
  display: block;
  flex-shrink: 0;
}
[data-theme="dark"] .pill-followup-compact {
  background: var(--accent);
  color: #0a0a0a;
  border-color: var(--accent);
}
[data-theme="dark"] .pill-followup-compact:hover {
  background: #ffffff;
}

/* ─── CHAT IA GLOBAL (widget flotante estilo Intercom) ─── */
.chat-fab {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--text-primary);
  color: var(--bg-card);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18), 0 2px 8px rgba(0, 0, 0, 0.10);
  z-index: 9000;
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.2s ease;
  animation: chat-fab-in 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) backwards;
  animation-delay: 0.6s;
}
@keyframes chat-fab-in {
  from { transform: scale(0); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}
.chat-fab:hover {
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.22), 0 4px 12px rgba(0, 0, 0, 0.12);
}
.chat-fab:active { transform: translateY(-1px) scale(1); }
.chat-fab.active {
  background: var(--bg-elevated);
  color: var(--text-primary);
}
.chat-fab.active .chat-fab-icon { display: none; }
.chat-fab.active .chat-fab-close { display: block !important; }
[data-theme="dark"] .chat-fab {
  background: var(--accent);
  color: #0a0a0a;
}

/* Panel del chat */
.chat-panel {
  position: fixed;
  bottom: 96px;
  right: 24px;
  width: 400px;
  max-width: calc(100vw - 32px);
  height: 600px;
  max-height: calc(100vh - 120px);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.18), 0 6px 16px rgba(0, 0, 0, 0.06);
  display: flex;
  flex-direction: column;
  z-index: 9001;
  opacity: 0;
  transform: translateY(8px);
  transform-origin: bottom right;
  pointer-events: none;
  transition: opacity 0.18s ease-out, transform 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}
.chat-panel.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.chat-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-card);
}
.chat-panel-bot {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
}
.chat-panel-avatar {
  position: relative;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, #18181b, #3f3f46);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}
[data-theme="dark"] .chat-panel-avatar {
  background: linear-gradient(135deg, #ececef, #a1a1aa);
}
.chat-panel-avatar-icon { filter: grayscale(0.1); }
.chat-panel-avatar-status {
  position: absolute;
  bottom: -1px;
  right: -1px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--won);
  border: 2px solid var(--bg-card);
  animation: chat-online-pulse 2.4s ease-in-out infinite;
}
@keyframes chat-online-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.5); }
  50% { box-shadow: 0 0 0 4px rgba(74, 222, 128, 0); }
}
.chat-panel-bot-name {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.01em;
  line-height: 1.2;
}
.chat-panel-bot-role {
  font-size: 10.5px;
  color: var(--text-muted);
  margin-top: 2px;
  letter-spacing: -0.005em;
}
.chat-panel-close {
  background: transparent;
  border: 1px solid var(--border-subtle);
  color: var(--text-tertiary);
  width: 30px;
  height: 30px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  flex-shrink: 0;
}
.chat-panel-close:hover {
  background: var(--bg-elevated);
  border-color: var(--border-bright);
  color: var(--text-primary);
}

.chat-panel-body {
  flex: 1;
  overflow-y: auto;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--bg-tinted);
}
.chat-panel-body::-webkit-scrollbar { width: 6px; }
.chat-panel-body::-webkit-scrollbar-thumb { background: var(--border-bright); border-radius: 3px; }

.chat-msg {
  font-size: 13px;
  line-height: 1.5;
  padding: 10px 13px;
  border-radius: var(--r-md);
  max-width: 85%;
  word-wrap: break-word;
  animation: chat-msg-in 0.2s ease-out backwards;
}
@keyframes chat-msg-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
.chat-msg-user {
  align-self: flex-end;
  background: var(--text-primary);
  color: var(--bg-card);
  font-weight: 500;
}
[data-theme="dark"] .chat-msg-user {
  background: var(--accent);
  color: #0a0a0a;
}
.chat-msg-ai {
  align-self: flex-start;
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border-subtle);
}
.chat-msg-ai p { margin: 0 0 6px; }
.chat-msg-ai p:last-child { margin: 0; }
.chat-msg-ai strong { color: var(--text-primary); font-weight: 600; }
.chat-msg-ai ul { padding-left: 18px; margin: 6px 0; }
.chat-msg-ai li { margin-bottom: 4px; }
.chat-msg-ai a { color: var(--link); text-decoration: underline; }
.chat-msg-error { border-color: rgba(220, 38, 38, 0.30); color: var(--hot); }
.chat-msg-loading { padding: 14px 16px; }

.chat-loading-dots {
  display: inline-flex;
  gap: 4px;
  align-items: center;
}
.chat-loading-dots span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-muted);
  animation: chat-dots-bounce 1.4s ease-in-out infinite;
}
.chat-loading-dots span:nth-child(2) { animation-delay: 0.16s; }
.chat-loading-dots span:nth-child(3) { animation-delay: 0.32s; }
@keyframes chat-dots-bounce {
  0%, 80%, 100% { opacity: 0.3; transform: translateY(0); }
  40% { opacity: 1; transform: translateY(-4px); }
}

.chat-suggestions-grid {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 6px;
  align-self: stretch;
}
.chat-suggestion-pill {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  padding: 9px 12px;
  border-radius: var(--r-md);
  font-size: 12.5px;
  cursor: pointer;
  font-family: inherit;
  text-align: left;
  transition: all 0.15s ease;
  letter-spacing: -0.005em;
}
.chat-suggestion-pill:hover {
  background: var(--bg-elevated);
  border-color: var(--border-bright);
  color: var(--text-primary);
  transform: translateX(2px);
}

.chat-msg-action {
  align-self: flex-start;
  margin-top: 2px;
}
.chat-go-to-lead {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--link);
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 12px;
  cursor: pointer;
  font-family: inherit;
  font-weight: 500;
  transition: all 0.15s ease;
}
.chat-go-to-lead:hover {
  background: var(--bg-card);
  border-color: var(--link);
}

.chat-panel-foot {
  padding: 12px 14px 14px;
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-card);
}
.chat-input-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 4px 4px 4px;
  background: var(--bg-tinted);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  transition: border-color 0.15s ease;
}
.chat-attach-btn {
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-muted);
  width: 32px;
  height: 32px;
  border-radius: var(--r-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: color 0.15s ease, background 0.15s ease;
  -webkit-appearance: none;
  appearance: none;
  padding: 0;
}
.chat-attach-btn:hover {
  background: var(--bg-elevated);
  color: var(--text-primary);
}
.chat-attach-btn:focus, .chat-attach-btn:focus-visible {
  outline: none;
  border: none;
}
.chat-input-wrap input {
  padding: 8px 4px;
}
.chat-attachment-preview {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  background: var(--bg-tinted);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-sm);
  font-size: 11.5px;
  color: var(--text-secondary);
  margin-bottom: 6px;
}
.chat-attachment-preview .chat-attachment-remove {
  margin-left: auto;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 14px;
  padding: 2px 6px;
}
.chat-attachment-preview .chat-attachment-remove:hover { color: var(--hot); }
.chat-input-wrap:focus-within { border-color: var(--text-primary); }
.chat-input-wrap input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  padding: 8px 0;
  font-size: 13px;
  color: var(--text-primary);
  font-family: inherit;
}
.chat-input-wrap input::placeholder { color: var(--text-muted); }
.chat-send-btn {
  background: var(--text-primary);
  color: var(--bg-card);
  border: none;
  width: 32px;
  height: 32px;
  border-radius: var(--r-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  flex-shrink: 0;
}
[data-theme="dark"] .chat-send-btn {
  background: var(--accent);
  color: #0a0a0a;
}
.chat-send-btn:hover { transform: scale(1.08); }
.chat-send-btn:active { transform: scale(0.94); }
.chat-panel-foot-meta {
  text-align: center;
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 8px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-weight: 500;
}

/* Mobile: el chat ocupa fullscreen al abrir */
@media (max-width: 600px) {
  .chat-panel {
    bottom: 0;
    right: 0;
    left: 0;
    width: 100vw;
    max-width: 100vw;
    height: 100dvh;
    max-height: 100dvh;
    border-radius: 16px 16px 0 0;
  }
  .chat-fab {
    bottom: 16px;
    right: 16px;
    width: 52px;
    height: 52px;
  }
}

/* ─── ACCIONES RÁPIDAS EN TABLA PIPELINE ─── */
.th-actions, .td-actions { text-align: right; white-space: nowrap; }
.row-actions {
  display: inline-flex;
  gap: 4px;
  justify-content: flex-end;
}
.deal-amount {
  font-family: 'JetBrains Mono', monospace;
  font-variant-numeric: tabular-nums;
  font-weight: 500;
  color: var(--text-primary);
}
.row-action-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-tertiary);
  width: 28px;
  height: 28px;
  border-radius: var(--r-sm);
  font-size: 12px;
  cursor: pointer;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all var(--t-fast);
  padding: 0;
}
.row-action-btn:hover { border-color: var(--border-bright); color: var(--text-primary); background: var(--bg-elevated); }
.row-action-win:hover { color: var(--won); border-color: var(--won); background: var(--won-soft); }
.row-action-lose:hover { color: var(--hot); border-color: var(--hot); background: var(--hot-soft); }
.row-action-archive:hover { color: var(--text-primary); border-color: var(--border-bright); }
.row-action-btn:disabled { opacity: 0.5; cursor: wait; }
.row-action-btn.done { background: var(--won-soft); border-color: var(--won); color: var(--won); }

/* En mobile esconder columna de acciones (poco espacio) */
@media (max-width: 768px) {
  .row-actions { gap: 2px; }
  .row-action-btn { width: 26px; height: 26px; font-size: 11px; }
}

/* ─── MINI CHAT IA POR LEAD ─── */
.modal-chat-card {
  width: min(620px, 92vw);
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  text-align: left;
  padding: 24px;
}
.chat-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 12px 0 14px;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 14px;
}
.chat-suggestion {
  background: var(--bg-tinted);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  padding: 6px 11px;
  border-radius: 999px;
  font-size: 12px;
  cursor: pointer;
  font-family: inherit;
  transition: all var(--t-fast);
  text-align: left;
  letter-spacing: -0.005em;
}
.chat-suggestion:hover {
  background: var(--bg-elevated);
  border-color: var(--border-bright);
  color: var(--text-primary);
}
.chat-history {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 4px 4px 14px;
  min-height: 240px;
  max-height: 50vh;
}
.chat-empty {
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
  font-style: italic;
  padding: 40px 12px;
}
.chat-q { display: flex; justify-content: flex-end; }
.chat-a { display: flex; justify-content: flex-start; }
.chat-bubble-user {
  background: var(--text-primary);
  color: var(--bg-card);
  padding: 9px 13px;
  border-radius: 14px 14px 4px 14px;
  font-size: 13px;
  max-width: 80%;
  font-weight: 500;
  line-height: 1.45;
}
.chat-bubble-ai {
  background: var(--bg-elevated);
  color: var(--text-primary);
  padding: 10px 14px;
  border-radius: 14px 14px 14px 4px;
  font-size: 13px;
  max-width: 90%;
  line-height: 1.55;
  border: 1px solid var(--border-subtle);
}
.chat-bubble-ai p { margin: 0 0 8px; }
.chat-bubble-ai p:last-child { margin: 0; }
.chat-bubble-ai strong { color: var(--text-primary); font-weight: 600; }
.chat-bubble-ai ul { padding-left: 18px; margin: 6px 0; }
.chat-bubble-ai li { margin-bottom: 4px; }
.chat-error { color: var(--hot); border-color: rgba(220,38,38,0.30); }

.chat-loading-dots {
  display: inline-flex;
  gap: 4px;
  padding: 12px 16px;
  align-items: center;
}
.chat-loading-dots span {
  width: 6px; height: 6px;
  background: var(--text-muted);
  border-radius: 50%;
  display: inline-block;
  animation: chat-dots 1.4s ease-in-out infinite;
}
.chat-loading-dots span:nth-child(2) { animation-delay: 0.16s; }
.chat-loading-dots span:nth-child(3) { animation-delay: 0.32s; }
@keyframes chat-dots {
  0%, 80%, 100% { opacity: 0.3; transform: translateY(0); }
  40% { opacity: 1; transform: translateY(-3px); }
}

.chat-input-row {
  display: flex;
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--border-subtle);
}
.chat-input-row input {
  flex: 1;
  padding: 10px 14px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  color: var(--text-primary);
  font-size: 13.5px;
  font-family: inherit;
  outline: none;
  transition: border-color var(--t-fast);
}
.chat-input-row input:focus { border-color: var(--text-primary); }
.chat-input-row .modal-btn { flex: 0 0 auto; padding: 10px 18px; }

/* ─── PANEL DE CONTEXTO IA DEL LEAD (enmarcado elegante) ─── */
.lead-context-frame {
  background: var(--bg-tinted);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-md);
  overflow: hidden;
}
.lead-context-frame-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  background: transparent;
  border-bottom: 1px solid var(--border-subtle);
}
.lead-context-frame-icon {
  font-size: 12px;
  filter: grayscale(0.25);
  opacity: 0.85;
}
.lead-context-frame-title {
  flex: 1;
  font-size: 10.5px;
  font-weight: 600;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.lead-context-frame-count {
  font-size: 10px;
  color: var(--text-muted);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  padding: 1px 8px;
  border-radius: 999px;
  font-weight: 500;
}
.lead-context-frame-body {
  padding: 8px 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* Cada insight (señal) dentro del frame */
.lead-insight {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 10px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-sm);
  transition: border-color var(--t-fast);
}
.lead-insight:hover { border-color: var(--border-bright); }
.lead-insight.insight-waiting {
  border-color: rgba(5, 150, 105, 0.22);
}
.lead-insight.insight-warn {
  border-color: rgba(245, 158, 11, 0.30);
}
.lead-insight-icon {
  font-size: 13px;
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
  filter: grayscale(0.15);
}
.lead-insight-body { flex: 1; min-width: 0; }
.lead-insight-title {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.4;
  margin-bottom: 2px;
}
.lead-insight-desc {
  font-size: 11.5px;
  color: var(--text-tertiary);
  line-height: 1.5;
}
.lead-insight.insight-waiting .lead-insight-icon { color: var(--won); }
.lead-insight.insight-waiting .lead-insight-title::after {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--won);
  margin-left: 6px;
  vertical-align: middle;
  animation: ai-monitoring-pulse 2.4s ease-in-out infinite;
}

/* ─── LISTA DE TAREAS POR LEAD (modelo tipo ClickUp) ─── */
.lead-tasks {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 0 4px;
}
.lead-tasks-empty {
  font-size: 12.5px;
  color: var(--text-muted);
  font-style: italic;
  padding: 6px 0;
}
.lead-task {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  transition: all var(--t-fast);
}
.lead-task.task-primary {
  background: var(--bg-card);
  border-color: var(--border);
}
.lead-task.task-waiting {
  background: var(--bg-tinted);
  border-style: dashed;
  border-color: var(--border);
  opacity: 0.85;
}
.lead-task.task-warn {
  background: var(--warm-soft, rgba(245, 158, 11, 0.08));
  border-color: rgba(245, 158, 11, 0.35);
}
.lead-task.task-founder {
  background: var(--bg-card);
  border-color: var(--border);
}
.lead-task:hover { transform: translateX(1px); border-color: var(--border-bright); }

.task-check {
  background: var(--bg-card);
  border: 1.5px solid var(--border-bright);
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: all var(--t-fast);
  margin-top: 1px;
  padding: 0;
}
.task-check:hover:not(:disabled) {
  border-color: var(--won);
  background: var(--won-soft);
}
.task-check:hover:not(:disabled) .task-check-circle {
  color: var(--won);
}
.task-check:disabled { cursor: not-allowed; opacity: 0.5; }
.task-check-circle {
  font-size: 11px;
  color: transparent;
  font-weight: 700;
  line-height: 1;
}
.task-check-done {
  background: var(--won);
  border-color: var(--won);
}
.task-check-done .task-check-circle {
  color: white;
}
.task-check-done:hover { opacity: 0.85; }

.task-body { flex: 1; min-width: 0; }
.task-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.4;
  margin-bottom: 3px;
  display: flex;
  align-items: baseline;
  gap: 6px;
}
.task-title-done {
  text-decoration: line-through;
  color: var(--text-tertiary);
  font-weight: 500;
}
.task-icon { font-size: 13px; }
.task-desc {
  font-size: 12px;
  color: var(--text-tertiary);
  line-height: 1.5;
  margin-bottom: 8px;
}
.task-actions {
  display: flex;
  gap: 6px;
  margin-top: 4px;
  flex-wrap: wrap;
}
.task-btn {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  padding: 5px 11px;
  border-radius: var(--r-sm);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  transition: all var(--t-fast);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.task-btn:hover {
  background: var(--bg-elevated);
  border-color: var(--border-bright);
  color: var(--text-primary);
}
.task-btn-primary {
  background: var(--text-primary);
  border-color: var(--text-primary);
  color: var(--bg-card);
}
.task-btn-primary:hover {
  opacity: 0.9;
  background: var(--text-primary);
  color: var(--bg-card);
  border-color: var(--text-primary);
}

/* Botón único "Hacer seguimiento" debajo de las tareas */
.lead-followup-cta {
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.btn-primary-full {
  flex: 1;
  background: var(--text-primary);
  color: var(--bg-card);
  border: 1px solid var(--text-primary);
  padding: 11px 16px;
  border-radius: var(--r-md);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: all var(--t-fast);
  letter-spacing: -0.005em;
}
.btn-primary-full:hover { opacity: 0.92; }
.btn-primary-full:disabled { opacity: 0.55; cursor: wait; }

.lead-followup-done {
  background: var(--won-soft);
  border: 1px solid rgba(5, 150, 105, 0.25);
  border-radius: var(--r-md);
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.followup-done-mark {
  width: 22px; height: 22px;
  background: var(--won); color: white;
  border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700;
  flex-shrink: 0;
}
.followup-done-body { flex: 1; display: flex; flex-direction: column; gap: 1px; font-size: 12.5px; }
.followup-done-body strong { color: var(--won); font-weight: 600; }
.followup-done-body span { font-size: 11.5px; color: var(--text-tertiary); }

.btn-followup-undo {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-tertiary);
  width: 26px; height: 26px;
  border-radius: var(--r-sm);
  cursor: pointer;
  font-size: 14px;
  font-weight: 400;
  transition: all var(--t-fast);
  padding: 0;
}
.btn-followup-undo:hover { color: var(--text-primary); border-color: var(--text-primary); }

/* Modal email — checkbox CC */
.modal-email-cc {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 4px 0 14px;
  font-size: 12.5px;
  color: var(--text-secondary);
  cursor: pointer;
}
.modal-email-cc input[type="checkbox"] {
  width: 16px; height: 16px;
  accent-color: var(--accent);
  cursor: pointer;
}

/* Botón secundario en modal */
.modal-btn-secondary {
  background: var(--bg-card);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}
.modal-btn-secondary:hover {
  background: var(--bg-elevated);
  color: var(--text-primary);
  border-color: var(--border-bright);
}

/* Histórico de tareas hechas (collapsible) */
.lead-tasks-history { margin-top: 6px; }
.lead-tasks-history-toggle {
  font-size: 11px;
  color: var(--text-muted);
  cursor: pointer;
  padding: 6px 8px;
  list-style: none;
  user-select: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.lead-tasks-history-toggle::-webkit-details-marker { display: none; }
.lead-tasks-history-toggle::before {
  content: "▸";
  transition: transform var(--t-fast);
  display: inline-block;
}
.lead-tasks-history[open] .lead-tasks-history-toggle::before { transform: rotate(90deg); }
.lead-tasks-history-toggle:hover { color: var(--text-primary); }
.lead-tasks-history-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-top: 6px;
}
.lead-tasks-history-list .lead-task {
  background: transparent;
  border: 1px dashed var(--border-subtle);
  padding: 8px 10px;
}

/* ─── PRIORITY DEAL — toolbar compacta (footer integrado) ─── */
.pd-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 4px 0 2px;
  flex-wrap: wrap;
  font-size: 12px;
}
.pd-toolbar-left {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-tertiary);
  flex: 1;
  min-width: 0;
}
.pd-toolbar-left strong { color: var(--text-primary); font-weight: 600; }
.pd-toolbar-label {
  font-size: 10.5px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 500;
}
.pd-toolbar-sep { color: var(--border-bright); }
.pd-toolbar-right { display: inline-flex; align-items: center; gap: 6px; }
.pd-who-mini { display: inline-flex; align-items: center; gap: 6px; }

/* Pill: marcar email enviado (estado pendiente) */
.pill-followup {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  padding: 5px 11px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  transition: all var(--t-fast);
}
.pill-followup:hover {
  background: var(--text-primary);
  color: var(--bg-card);
  border-color: var(--text-primary);
}
.pill-followup-icon { font-size: 11px; }

/* Pill: estado "ya enviado" */
.pill-sent {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--won-soft);
  color: var(--won);
  padding: 4px 6px 4px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 500;
  border: 1px solid rgba(5, 150, 105, 0.25);
}
.pill-sent-check {
  width: 16px; height: 16px;
  background: var(--won); color: white;
  border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 700;
}
.pill-sent-undo {
  background: transparent; border: none;
  color: var(--won);
  cursor: pointer;
  font-size: 14px;
  padding: 0 2px;
  opacity: 0.6;
  transition: opacity var(--t-fast);
}
.pill-sent-undo:hover { opacity: 1; }

/* Card en standby — email enviado, IA monitoreando */
.priority-deal-sent {
  background: var(--bg-tinted);
  border-left: 3px solid var(--won);
  opacity: 0.95;
}
.priority-deal-sent::before { background: var(--won); opacity: 0.65 !important; }
.priority-deal-sent .pd-name { color: var(--text-secondary); }

/* Tarea waiting con dot pulsante "IA observando" */
.lead-task.task-waiting {
  position: relative;
  background: var(--bg-card);
  border-style: solid;
  border-color: rgba(5, 150, 105, 0.20);
}
.lead-task.task-waiting .task-icon {
  color: var(--won);
  position: relative;
}
.lead-task.task-waiting .task-title {
  color: var(--text-primary);
}
.lead-task.task-waiting .task-title::after {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--won);
  margin-left: 8px;
  vertical-align: middle;
  animation: ai-monitoring-pulse 2.4s ease-in-out infinite;
  box-shadow: 0 0 0 0 rgba(5, 150, 105, 0.4);
}
/* Tarea info — sin checkbox, es una nota del sistema (ej. "IA monitoreando") */
.lead-task-info {
  align-items: center;
}
.lead-task-info .task-icon-info {
  font-size: 16px;
  width: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--won);
  margin-top: 1px;
}
@keyframes ai-monitoring-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(5, 150, 105, 0.45); }
  50% { box-shadow: 0 0 0 5px rgba(5, 150, 105, 0); }
}

/* Meta-bar: email + tags ClickUp */
.pd-meta-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 12px;
  padding: 6px 0;
}
.pd-meta-email {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-tinted);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-sm);
  padding: 4px 8px;
}
.pd-meta-icon { color: var(--text-tertiary); font-size: 11px; }
.btn-icon {
  background: transparent;
  border: 1px solid var(--border-subtle);
  cursor: pointer;
  font-size: 11px;
  padding: 3px 8px;
  border-radius: var(--r-sm);
  color: var(--text-tertiary);
  transition: all var(--t-fast);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  text-decoration: none;
  font-family: inherit;
  line-height: 1;
}
.btn-icon:hover {
  background: var(--bg-elevated);
  color: var(--text-primary);
  border-color: var(--border-bright);
}
.btn-icon svg { display: block; flex-shrink: 0; }
.btn-icon-label {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: -0.005em;
}

/* Tags de ClickUp */
.pd-tags { display: inline-flex; gap: 4px; flex-wrap: wrap; }
.pd-tag {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text-tertiary);
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 500;
  text-transform: lowercase;
  letter-spacing: 0.02em;
}

/* Status pill (estado actual del deal en ClickUp) — color por estado */
.pd-status-pill {
  display: inline-flex;
  align-items: center;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 2px 8px;
  border-radius: 999px;
}
.pd-status-new       { background: var(--bg-elevated); color: var(--text-tertiary); }
.pd-status-meeting   { background: rgba(99, 102, 241, 0.10); color: #6366f1; border-color: rgba(99, 102, 241, 0.25); }
.pd-status-contacted { background: rgba(14, 165, 233, 0.10); color: #0ea5e9; border-color: rgba(14, 165, 233, 0.25); }
.pd-status-sent      { background: rgba(37, 99, 235, 0.10); color: #2563eb; border-color: rgba(37, 99, 235, 0.25); }
.pd-status-viewed    { background: rgba(124, 58, 237, 0.10); color: #7c3aed; border-color: rgba(124, 58, 237, 0.25); }
.pd-status-closing   { background: rgba(245, 158, 11, 0.12); color: #d97706; border-color: rgba(245, 158, 11, 0.30); }
.pd-status-won       { background: var(--won-soft); color: var(--won); border-color: rgba(5, 150, 105, 0.30); }
.pd-status-lost      { background: var(--hot-soft); color: var(--hot); border-color: rgba(220, 38, 38, 0.30); }

/* Header right: monto + link ClickUp */
.pd-header-right {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.pd-clickup-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-tertiary);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  transition: all var(--t-fast);
}
.pd-clickup-link:hover {
  background: var(--text-primary);
  color: var(--bg-card);
  border-color: var(--text-primary);
}

/* Assignees ClickUp (avatares circulares apilados) */
.pd-assignees {
  display: inline-flex;
  align-items: center;
}
.pd-assignee-avatar {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent);
  color: white;
  font-size: 9.5px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--bg-card);
  margin-left: -5px;
  letter-spacing: 0.02em;
}
.pd-assignee-avatar:first-child { margin-left: 0; }

/* (Urgent dot eliminado — no comunicaba nada útil) */
.pd-views-meta {
  font-size: 11px;
  color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace;
}

/* Botones de estado del deal — fila clara y separada */
.pd-actions {
  display: flex;
  gap: 6px;
  padding-top: 12px;
  border-top: 1px solid var(--border-subtle);
}

/* Modal botón desarchivar */
.modal-btn-unarchive {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}
.modal-btn-unarchive:hover { opacity: 0.9; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(124, 58, 237, 0.3); }

/* Filter pill divider antes de Archivados */
.filter-pill-divider {
  margin-left: 8px;
  padding-left: 12px;
  border-left: 1px solid var(--border);
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
}
.filter-pill-divider.active {
  background: var(--cold-soft);
  color: var(--cold);
  border-left-color: var(--border);
}

/* Visual indicator para deals archivados */
.priority-deal:has(.btn-unarchive) {
  opacity: 0.85;
  background: var(--bg-tinted);
}
.priority-deal:has(.btn-unarchive)::after {
  content: '📦 Archivado';
  position: absolute;
  top: 12px;
  right: 12px;
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg-card);
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
}

.pd-recommendation {
  background: var(--bg-tinted);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-md);
  padding: 12px 14px;
  position: relative;
}
.pd-recommendation::before {
  content: '';
  position: absolute;
  top: 12px; left: 0;
  width: 2px;
  height: calc(100% - 24px);
  background: var(--accent);
  border-radius: 2px;
  opacity: 0.6;
}
.pd-recommendation { padding-left: 16px; }
.pd-action {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-primary);
  margin-bottom: 6px;
  flex-wrap: wrap;
}
.pd-action strong { font-weight: 500; }
.pd-why {
  font-size: 12px;
  color: var(--text-tertiary);
  line-height: 1.5;
}
.pd-why-label {
  font-weight: 500;
  color: var(--text-secondary);
}

/* (clases viejas pd-right / pd-who-row / pd-meta-row / pd-views eliminadas:
   ahora se usa pd-toolbar + pd-who-mini + pd-views-meta) */

@media (max-width: 900px) {
  .priority-deal {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .pd-right { align-items: flex-start; }
  .pd-amount-inline { margin-left: 0; }
}

/* ─────── PANELS ─────── */
.panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 22px;
  margin-bottom: 16px;
  transition: border-color var(--t-base);
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border-subtle);
}
.panel-head h3 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}
.panel-meta {
  font-size: 12px;
  color: var(--text-tertiary);
  font-weight: 400;
}

.row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}
@media (max-width: 1100px) { .row-2 { grid-template-columns: 1fr; } }

/* ─────── FUNNEL ─────── */
.funnel { display: flex; flex-direction: column; gap: 4px; }

.funnel-step {
  display: grid;
  grid-template-columns: 130px 1fr 32px;
  align-items: center;
  gap: 12px;
  padding: 8px 4px;
  border-radius: var(--r-sm);
  transition: background var(--t-fast);
}
.funnel-step:hover { background: var(--bg-tinted); }

.funnel-bar {
  height: 24px;
  border-radius: 8px;
  background: var(--text-primary);
  display: flex;
  align-items: center;
  padding: 0 10px;
  color: var(--bg-card);
  font-weight: 600;
  font-size: 11px;
  min-width: 32px;
  font-feature-settings: 'tnum';
  transition: width var(--t-base);
}
.funnel-label {
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 400;
}
.funnel-count {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* ─────── ACTIONS LIST ─────── */
.action-list { list-style: none; counter-reset: action; }
.action-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-subtle);
  counter-increment: action;
}
.action-item:last-child { border-bottom: none; padding-bottom: 0; }
.action-item:first-child { padding-top: 0; }
.action-item::before {
  content: counter(action);
  width: 22px;
  height: 22px;
  background: var(--bg-elevated);
  color: var(--text-secondary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 11px;
  flex-shrink: 0;
}
.action-content { flex: 1; }
.action-name {
  font-weight: 500;
  font-size: 13px;
  margin-bottom: 3px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--text-primary);
}
.action-name a {
  color: var(--text-primary);
  text-decoration: none;
  transition: color var(--t-fast);
}
.action-name a:hover { color: var(--link); }
.action-why {
  font-size: 12px;
  color: var(--text-tertiary);
  line-height: 1.5;
}
.action-why strong { color: var(--text-secondary); font-weight: 500; }

/* ─────── AI CO-PILOT — neutral ─────── */
.panel-ai { background: var(--bg-card); }

.ai-suggestions {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(320px, 100%), 1fr));
  gap: 12px;
  width: 100%;
}

.ai-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 14px 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: all var(--t-fast);
  position: relative;
}
.ai-card:hover {
  border-color: var(--border-bright);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}
.ai-card-head {
  display: flex;
  align-items: center;
  gap: 8px;
}
.ai-card-cta {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  align-self: flex-start;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  padding: 10px 0 4px;
  margin-top: auto;
  border-top: 1px solid var(--border-subtle);
  width: 100%;
  transition: color var(--t-fast);
  background: transparent;
  border-left: none;
  border-right: none;
  border-bottom: none;
  cursor: pointer;
  font-family: inherit;
  text-align: left;
}
.ai-card-cta:hover { color: var(--text-primary); }
.ai-card-cta-arrow { transition: transform var(--t-fast); }
.ai-card-cta:hover .ai-card-cta-arrow { transform: translateX(2px); }

/* Flash highlight cuando el usuario hace scroll a un deal específico desde la sugerencia */
@keyframes priority-deal-flash {
  0% { box-shadow: 0 0 0 0 rgba(124, 58, 237, 0); border-color: var(--border); }
  20% { box-shadow: 0 0 0 4px rgba(124, 58, 237, 0.18); border-color: rgba(124, 58, 237, 0.5); }
  100% { box-shadow: 0 0 0 0 rgba(124, 58, 237, 0); border-color: var(--border); }
}
.priority-deal-flash {
  animation: priority-deal-flash 1.6s ease-out;
}
.ai-card-dismiss {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  font-family: inherit;
  font-weight: 300;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: all var(--t-fast);
  padding: 0;
}
.ai-card:hover .ai-card-dismiss { opacity: 1; }
.ai-card-dismiss:hover {
  background: var(--bg-elevated);
  border-color: var(--border-bright);
  color: var(--text-primary);
}

/* Empty state — sistema analizando constante */
.ai-empty {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 20px;
  background: var(--bg-tinted);
  border: 1px dashed var(--border);
  border-radius: var(--r-md);
}
.ai-empty-pulse {
  position: relative;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #7c3aed;
  flex-shrink: 0;
}
.ai-empty-pulse::before,
.ai-empty-pulse::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: rgba(124, 58, 237, 0.4);
  animation: empty-ping 2s ease-out infinite;
}
.ai-empty-pulse::after { animation-delay: 1s; }
@keyframes empty-ping {
  0% { transform: scale(1); opacity: 0.7; }
  80%, 100% { transform: scale(2.6); opacity: 0; }
}
.ai-empty-content { flex: 1; }
.ai-empty-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 2px;
  letter-spacing: -0.005em;
}
.ai-empty-msg {
  font-size: 12px;
  color: var(--text-tertiary);
  line-height: 1.45;
  font-style: italic;
}

.ai-icon {
  font-size: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  filter: grayscale(0.15);
}
.ai-content { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.ai-tag {
  display: inline-flex;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--bg-elevated);
  color: var(--text-tertiary);
}
.ai-tag.discount { background: var(--won-soft); color: var(--won); }
.ai-tag.combo { background: var(--info-soft); color: var(--info); }
.ai-tag.revive { background: var(--warm-soft); color: var(--warm); }
.ai-tag.strategic { background: var(--cold-soft); color: var(--cold); }
.ai-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.4;
  margin-bottom: 4px;
  letter-spacing: -0.005em;
}
.ai-text {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.5;
}
.ai-text strong { color: var(--text-primary); font-weight: 500; }
.ai-text a { color: var(--link); text-decoration: none; font-weight: 500; }
.ai-text a:hover { text-decoration: underline; }

/* ─────── TABLE ─────── */
.table-wrap {
  background: var(--bg-card);
  overflow: hidden;
  margin: 0 -22px -22px;
}
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th {
  text-align: left;
  padding: 11px 22px;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-tertiary);
  letter-spacing: 0;
  text-transform: none;
  background: var(--bg-tinted);
  border-bottom: 1px solid var(--border-subtle);
}
.table td {
  padding: 13px 22px;
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: middle;
}
.table tbody tr { transition: background var(--t-fast); }
.table tbody tr:hover { background: var(--bg-tinted); }
.table tbody tr:last-child td { border-bottom: none; }

.score-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 11px;
  font-family: 'JetBrains Mono', monospace;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  border: 1px solid;
}
.score-hot { background: var(--hot-soft); color: var(--hot); border-color: var(--hot-border); }
.score-warm { background: var(--warm-soft); color: var(--warm); border-color: var(--warm-border); }
.score-cold { background: var(--cold-soft); color: var(--cold); border-color: var(--cold-border); }

/* Score block — versión destacada con número + label HOT/TIBIO/FRÍO en columnas */
.score-block {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 56px;
  min-height: 52px;
  padding: 6px 4px;
  border-radius: var(--r-md);
  border: 1px solid;
  font-family: 'JetBrains Mono', monospace;
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
  line-height: 1;
}
.score-block-num {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 3px;
}
.score-block-label {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  opacity: 0.85;
}
.score-block-hot {
  background: var(--hot-soft);
  color: var(--hot);
  border-color: var(--hot-border);
}
.score-block-warm {
  background: var(--warm-soft);
  color: var(--warm);
  border-color: var(--warm-border);
}
.score-block-cold {
  background: var(--cold-soft);
  color: var(--cold);
  border-color: var(--cold-border);
}

.deal-name { font-weight: 500; color: var(--text-primary); }
.deal-link { color: var(--text-primary); text-decoration: none; transition: color var(--t-fast); }
.deal-link:hover { color: var(--link); }

.status-badge {
  display: inline-block;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 500;
  border-radius: 8px;
  background: var(--bg-elevated);
  color: var(--text-secondary);
  white-space: nowrap;
  border: 1px solid var(--border-subtle);
}
.status-badge.cierre, .status-badge.negociacion { background: var(--cold-soft); color: var(--text-secondary); }
.status-badge.reunion { background: var(--warm-soft); color: var(--warm); }
.status-badge.ganado { background: var(--won-soft); color: var(--won); }
.status-badge.perdido { background: var(--hot-soft); color: var(--hot); }
.status-badge.lead { background: var(--info-soft); color: var(--info); }
.status-badge.vista { background: var(--won-soft); color: var(--won); }

.assignee-list { display: inline-flex; }
.avatar {
  width: 24px; height: 24px;
  border-radius: 50%;
  border: 2px solid var(--bg-card);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 600;
  color: white;
  margin-left: -7px;
  transition: transform var(--t-fast);
}
.avatar:hover { transform: translateY(-1px); z-index: 1; }
.avatar:first-child { margin-left: 0; }
.avatar.paulete { background: #ec4899; }
.avatar.andres { background: #0891b2; }
.avatar.marcel { background: #d97706; }
.avatar.unassigned { background: var(--bg-elevated); color: var(--text-muted); border-color: var(--border); }

.due-date {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}
.due-date.urgent { color: var(--hot); font-weight: 600; }
.due-date.soon { color: var(--warm); font-weight: 500; }

.action-suggestion {
  font-size: 12px;
  color: var(--text-tertiary);
  line-height: 1.5;
  max-width: 320px;
}
.action-suggestion strong { color: var(--text-secondary); font-weight: 500; }

.legend-row { display: flex; gap: 14px; align-items: center; }
.legend {
  font-size: 11px;
  color: var(--text-tertiary);
  display: flex;
  align-items: center;
  gap: 5px;
  font-weight: 400;
}
.dot { width: 6px; height: 6px; border-radius: 50%; }
.dot-hot { background: var(--hot); }
.dot-warm { background: var(--warm); }
.dot-cold { background: var(--cold); }

/* ─────── DISTRIBUCIÓN PIPELINE — barras horizontales elegantes ─────── */
.dist-bars {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.dist-row {
  display: grid;
  grid-template-columns: 160px 1fr 40px 50px;
  align-items: center;
  gap: 16px;
  padding: 10px 4px;
  border-radius: var(--r-sm);
  transition: background var(--t-fast);
}
.dist-row:hover { background: var(--bg-tinted); }
.dist-label {
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 500;
}
.dist-bar-wrap {
  background: var(--bg-tinted);
  border-radius: 8px;
  height: 8px;
  overflow: hidden;
  position: relative;
}
.dist-bar {
  height: 100%;
  background: var(--text-primary);
  border-radius: 8px;
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}
.dist-bar-won { background: var(--won); }
.dist-bar-lost { background: var(--cold); opacity: 0.5; }
.dist-count {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-family: 'JetBrains Mono', monospace;
}
.dist-pct {
  font-size: 11px;
  color: var(--text-tertiary);
  text-align: right;
  font-variant-numeric: tabular-nums;
}

@media (max-width: 600px) {
  .dist-row { grid-template-columns: 110px 1fr 36px; gap: 10px; }
  .dist-pct { display: none; }
  .dist-label { font-size: 12px; }
}

/* ─────── CHARTS (legacy, sólo si se usa) ─────── */
.chart-wrap { position: relative; height: 280px; }

/* ─────── PROJECTS ─────── */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 10px;
}
.project-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 14px 16px;
  text-decoration: none;
  color: inherit;
  display: block;
  transition: all var(--t-fast);
}
.project-card:hover {
  border-color: var(--border-bright);
  background: var(--bg-card-hover);
}
.project-name {
  font-weight: 500;
  font-size: 13px;
  margin-bottom: 4px;
  color: var(--text-primary);
}
.project-meta { font-size: 11px; color: var(--text-tertiary); margin-bottom: 8px; }
.project-tasks {
  font-size: 11px;
  color: var(--text-secondary);
  font-weight: 500;
}

/* ─────── LOADING + FOOTER ─────── */
.loading {
  text-align: center;
  color: var(--text-muted);
  padding: 32px;
  font-size: 13px;
}

.footer {
  margin-top: 48px;
  text-align: center;
  font-size: 11px;
  color: var(--text-muted);
  padding: 20px;
  border-top: 1px solid var(--border-subtle);
}

/* ─────── LOGIN ─────── */
.login-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg-base);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}
.login-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 40px 36px;
  width: 360px;
  max-width: calc(100% - 32px);
  text-align: center;
  box-shadow: var(--shadow-lg);
}
.login-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 24px;
}
.login-logo .logo-icon { font-size: 18px; }
.login-logo .logo-text { font-size: 22px; }
.login-card h1 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 6px;
  letter-spacing: -0.01em;
  color: var(--text-primary);
}
.login-card p {
  font-size: 13px;
  color: var(--text-tertiary);
  margin-bottom: 24px;
}
.login-card input {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 11px 14px;
  color: var(--text-primary);
  font-size: 14px;
  font-family: inherit;
  margin-bottom: 10px;
  outline: none;
  transition: all var(--t-fast);
}
.login-card input:focus {
  border-color: var(--text-primary);
}
.login-card input::placeholder { color: var(--text-muted); }
.login-card button {
  width: 100%;
  background: var(--text-primary);
  color: var(--bg-card);
  border: none;
  padding: 11px;
  border-radius: var(--r-md);
  font-weight: 500;
  cursor: pointer;
  font-size: 14px;
  font-family: inherit;
  transition: all var(--t-fast);
}
.login-card button:hover { opacity: 0.9; }
.login-error {
  margin-top: 10px;
  margin-bottom: 0;
  font-size: 12px;
  color: var(--hot);
  min-height: 16px;
  font-weight: 400;
}
.login-user-selector {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 4px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-md);
  padding: 4px;
  margin-bottom: 12px;
}
.login-user-option {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  padding: 9px 6px;
  border-radius: var(--r-sm);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s ease, color 0.15s ease;
  width: 100%;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  letter-spacing: -0.005em;
}
.login-user-option:hover:not(.active) {
  background: rgba(0, 0, 0, 0.03);
  color: var(--text-primary);
}
.login-user-option.active {
  background: var(--bg-card);
  color: var(--text-primary);
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06), 0 0 0 1px rgba(0, 0, 0, 0.04);
}
.login-user-option:focus-visible {
  outline: none;
}
.login-foot {
  margin-top: 28px;
  margin-bottom: 0;
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}

/* ─────── RESPONSIVE 100/100 ─────── */
@media (max-width: 1100px) {
  .total-grid { grid-template-columns: 1fr; }
  .total-main { border-right: none; border-bottom: 1px solid var(--border-subtle); }
  .row-2 { grid-template-columns: 1fr; gap: 14px; }
  .ai-suggestions { grid-template-columns: 1fr; }
}

@media (max-width: 1100px) {
  .header-search { max-width: 240px; }
}

@media (max-width: 900px) {
  .header-inner { flex-wrap: wrap; gap: 10px; }
  .header-search { order: 5; max-width: none; width: 100%; margin: 0; }
  .search-kbd { display: none; }
}

@media (max-width: 768px) {
  /* HEADER mobile — 3 filas claras:
     Fila 1: Logo izquierda · iconos tema/refresh/× derecha (flex 100% width juntos)
     Fila 2: Filter pills (scroll horizontal)
     Fila 3: Buscador (full width) */
  .header-inner {
    padding: 12px 14px;
    gap: 10px 8px;
    flex-wrap: wrap;
    align-items: center;
  }
  .header-left {
    order: 1;
    flex: 0 1 auto;       /* no se estira: deja espacio para los iconos a la derecha */
    min-width: 0;
  }
  .header-right {
    order: 2;
    gap: 6px;
    flex: 0 0 auto;
    margin-left: auto;    /* empuja al extremo derecho */
  }
  .filter-pills, .grouped-filters {
    order: 3;
    flex: 1 1 100%;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 2px;
    flex-wrap: nowrap;
  }
  .filter-pills::-webkit-scrollbar, .grouped-filters::-webkit-scrollbar { display: none; }
  .header-search {
    order: 4;
    flex: 1 1 100%;
    width: 100%;
    max-width: none;
    margin: 0;
  }
  .last-update, .status { display: none; }
  .logo-sub { display: none; }

  /* MAIN content */
  .main { padding: 16px 14px 32px; }
  .panel { padding: 16px 14px; }
  .panel-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    margin-bottom: 14px;
    padding-bottom: 10px;
  }
  .panel-head h3 { font-size: 14px; }
  .panel-meta { font-size: 11.5px; }
  .legend-row { gap: 10px; flex-wrap: wrap; }

  /* HERO total pipeline */
  .total-main { padding: 20px 18px; }
  .total-value { font-size: 32px; }
  .total-label { font-size: 11px; }
  .total-side { padding: 10px 18px 16px; }
  .total-side-row { padding: 7px 0; font-size: 12.5px; }
  .total-side-label { font-size: 12px; }
  .total-side-val { font-size: 14px; }

  /* PRIORITY DEALS */
  .priority-deal { padding: 14px; gap: 10px; }
  .pd-header { gap: 10px; flex-wrap: wrap; align-items: flex-start; }
  .pd-name { font-size: 13.5px; }
  .pd-name-block { flex: 1; min-width: 0; }
  .pd-header-right { width: auto; gap: 6px; align-items: center; flex-shrink: 0; }
  .pd-amount-inline { font-size: 13px; }
  .score-block { width: 48px; min-height: 46px; padding: 4px; }
  .score-block-num { font-size: 17px; }
  .score-block-label { font-size: 8.5px; }
  .pd-recommendation { padding: 10px 12px; padding-left: 14px; font-size: 12px; }
  .pd-toolbar { flex-direction: column; align-items: flex-start; gap: 6px; }
  .pd-toolbar-right { width: 100%; }
  .pill-followup { width: 100%; justify-content: center; }
  .pill-sent { width: 100%; justify-content: flex-start; }

  /* TABLE pipeline — sin margin negativo (causaba scroll horizontal) */
  .table-wrap { margin: 0; border-radius: var(--r-md); overflow-x: auto; }
  .table { font-size: 12px; min-width: 0; }
  .table th, .table td { padding: 10px 12px; }
  .table th:nth-child(7), .table td:nth-child(7) { display: none; }
  .table th:nth-child(5), .table td:nth-child(5) { display: none; }
  .action-suggestion { display: none; }

  /* KPI grid mobile */
  .kpi-grid { grid-template-columns: 1fr 1fr; gap: 1px; }
  .kpi { padding: 14px 16px; }
  .kpi-value { font-size: 22px; }

  /* AI suggestions */
  .ai-card { padding: 12px 14px; gap: 10px; }
  .ai-icon { width: 30px; height: 30px; font-size: 13px; }
  .ai-title { font-size: 12.5px; line-height: 1.4; }
  .ai-text { font-size: 11.5px; line-height: 1.5; }
  .ai-card-dismiss { opacity: 1; } /* siempre visible en mobile, no hover */

  /* Botones header */
  .btn-refresh, .btn-theme { width: 32px; height: 32px; min-height: 32px; }

  /* Briefing IA */
  .briefing { flex-direction: column; align-items: flex-start; padding: 14px; gap: 10px; }
  .briefing-meta { width: 100%; justify-content: space-between; gap: 6px; }
  .briefing-meta-item { align-items: flex-start; }
  .briefing-greeting { font-size: 13px; }
  .briefing-summary { font-size: 12.5px; }

  /* Reuniones de cierre */
  .meeting-card { grid-template-columns: 1fr; gap: 8px; padding: 12px; }
  .meeting-actions { width: 100%; }
  .meeting-actions .task-btn { flex: 1; justify-content: center; }

  /* Lista de tareas por lead */
  .lead-task { padding: 10px; gap: 8px; }
  .task-title { font-size: 12.5px; }
  .task-desc { font-size: 11.5px; }
  .task-actions { width: 100%; }
  .task-btn { flex: 1; min-height: 36px; justify-content: center; }

  /* Modal email full CRO */
  .modal-email-card { width: calc(100vw - 32px); padding: 20px 16px; }
  .modal-email-field textarea { min-height: 200px; font-size: 12.5px; }
}

/* Touch targets mínimos en mobile */
@media (max-width: 768px) and (pointer: coarse) {
  .filter-pill, .btn-copy, .pd-message-toggle {
    min-height: 36px;
    padding: 8px 14px;
  }
  a.deal-link, a.pd-name, a.hoy-deal-name { min-height: 32px; display: inline-flex; align-items: center; }
}

/* Smooth scroll */
html { scroll-behavior: smooth; }

/* Focus states — SIN bordes ni rings molestos en ningún elemento.
   El estado hover/active ya comunica la interacción visualmente. */
button:focus,
button:focus-visible,
a:focus,
a:focus-visible,
input:focus,
input:focus-visible,
textarea:focus,
textarea:focus-visible,
[contenteditable]:focus,
[contenteditable]:focus-visible,
.search-result:focus,
.search-result:focus-visible,
.filter-pill:focus,
.filter-pill:focus-visible {
  outline: none !important;
  box-shadow: none;
}

/* Inputs/textareas en focus solo cambian color del borde existente (sin outline extra) */
input:focus,
textarea:focus,
[contenteditable]:focus {
  border-color: var(--text-primary);
}

/* Sin highlight azul/gris en click táctil mobile */
* {
  -webkit-tap-highlight-color: transparent;
}

/* Loading skeleton animation */
@keyframes skeleton {
  0% { background-position: -200px 0; }
  100% { background-position: 200px 0; }
}
.loading {
  background: linear-gradient(90deg, var(--bg-tinted) 25%, var(--bg-elevated) 50%, var(--bg-tinted) 75%);
  background-size: 400px 100%;
  animation: skeleton 1.5s infinite;
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}

/* ─────── MODAL DE CONFIRMACIÓN ─────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  opacity: 0;
  transition: opacity 0.2s;
  padding: 20px;
}
.modal-overlay.visible { opacity: 1; }
.modal-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 32px;
  max-width: 460px;
  width: 100%;
  box-shadow: 0 20px 60px rgba(0,0,0,0.18);
  text-align: center;
  transform: translateY(10px) scale(0.97);
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
.modal-overlay.visible .modal-card { transform: translateY(0) scale(1); }

.modal-icon {
  font-size: 40px;
  margin-bottom: 14px;
  line-height: 1;
}
.modal-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
  letter-spacing: -0.02em;
}
.modal-desc {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 16px;
  line-height: 1.5;
}
.modal-desc strong { color: var(--text-primary); font-weight: 600; }
.modal-detail {
  background: var(--bg-tinted);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-md);
  padding: 14px 18px;
  text-align: left;
  margin-bottom: 22px;
}
.modal-detail ul {
  list-style: none;
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.6;
}
.modal-detail li {
  padding: 3px 0;
  position: relative;
  padding-left: 18px;
}
.modal-detail li::before {
  content: '→';
  position: absolute;
  left: 0;
  color: var(--accent);
  font-weight: 600;
}
.modal-detail strong { color: var(--text-primary); font-weight: 600; }

/* Modal options: checkbox CC equipo */
.modal-options {
  margin: 16px 0 18px;
  padding: 12px 14px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  text-align: left;
}
.modal-checkbox {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  font-family: inherit;
}
.modal-checkbox input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin-top: 1px;
  accent-color: var(--accent);
  cursor: pointer;
  flex-shrink: 0;
}
.modal-checkbox-label {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 13px;
  color: var(--text-primary);
  line-height: 1.45;
}
.modal-checkbox-label strong { font-weight: 600; }
.modal-checkbox-sub { font-size: 11.5px; color: var(--text-tertiary); font-weight: 400; }

/* Modal email full CRO */
.modal-email-card { width: min(640px, 92vw); text-align: left; }
.modal-email-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 6px;
}
.modal-email-head .modal-title { margin: 0; }
.modal-close {
  background: transparent;
  border: none;
  color: var(--text-tertiary);
  font-size: 22px;
  cursor: pointer;
  width: 28px; height: 28px;
  border-radius: var(--r-sm);
}
.modal-close:hover { background: var(--bg-elevated); color: var(--text-primary); }
.modal-email-field {
  display: block;
  margin: 14px 0 4px;
  text-align: left;
}
.modal-email-label {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 6px;
  font-weight: 500;
}
.modal-email-field input,
.modal-email-field textarea,
.modal-email-rich {
  width: 100%;
  padding: 10px 12px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  color: var(--text-primary);
  font-size: 13.5px;
  font-family: inherit;
  outline: none;
  transition: border-color var(--t-fast);
}
.modal-email-rich {
  min-height: 220px;
  max-height: 380px;
  overflow-y: auto;
  line-height: 1.6;
  cursor: text;
}
.modal-email-rich p { margin: 0 0 10px; }
.modal-email-rich p:last-child { margin-bottom: 0; }
.modal-email-rich a { color: var(--link); text-decoration: underline; }
.modal-email-rich strong { color: var(--text-primary); font-weight: 600; }
.modal-email-rich:empty::before {
  content: "Escribe el cuerpo del email…";
  color: var(--text-muted);
}
.modal-email-field input:focus,
.modal-email-field textarea:focus,
.modal-email-rich:focus {
  border-color: var(--text-primary);
}

/* Bloque de análisis IA inline en cada lead */
.ai-slot {
  margin: 12px 0 4px;
}
.btn-ai-trigger {
  width: 100%;
  background: var(--bg-tinted);
  border: 1px dashed var(--border-bright);
  color: var(--text-primary);
  padding: 10px 14px;
  border-radius: var(--r-md);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  transition: all var(--t-fast);
}
.btn-ai-trigger:hover {
  background: var(--bg-elevated);
  border-style: solid;
  border-color: var(--text-primary);
}
.ai-slot-loading-text {
  padding: 14px;
  font-size: 13px;
  color: var(--text-tertiary);
  text-align: center;
  background: var(--bg-elevated);
  border-radius: var(--r-md);
  border: 1px solid var(--border);
}
.ai-slot-error {
  padding: 12px;
  background: var(--hot-soft);
  color: var(--hot);
  border-radius: var(--r-md);
  font-size: 12.5px;
  border: 1px solid var(--hot);
}
.ai-block {
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.05), rgba(37, 99, 235, 0.04));
  border: 1px solid rgba(124, 58, 237, 0.25);
  border-radius: var(--r-md);
  padding: 12px 14px;
}
.ai-block-head {
  display: flex; align-items: center; gap: 10px; margin-bottom: 6px;
}
.ai-block-tag {
  display: inline-flex; align-items: center;
  padding: 2px 8px;
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-radius: 999px;
}
.ai-urgency-high { background: var(--hot-soft); color: var(--hot); }
.ai-urgency-med { background: var(--warm-soft, rgba(245, 158, 11, 0.12)); color: var(--warm, #f59e0b); }
.ai-urgency-low { background: var(--cold-soft); color: var(--cold); }
.ai-block-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  flex: 1;
}
.ai-block-why {
  font-size: 12.5px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 8px;
}
.ai-block-why-label {
  font-weight: 600;
  color: var(--text-primary);
  margin-right: 4px;
}
.ai-block-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  font-size: 12px;
  color: var(--text-tertiary);
  margin-bottom: 10px;
}
.ai-block-meta strong { color: var(--text-primary); font-weight: 600; }
.ai-block-actions {
  display: flex;
  gap: 8px;
}
.btn-ai-email {
  flex: 1;
  background: var(--text-primary);
  color: var(--bg-card);
  border: 1px solid var(--text-primary);
  font-weight: 600;
}
.btn-ai-email:hover {
  opacity: 0.9;
  background: var(--text-primary);
  color: var(--bg-card);
  border-color: var(--text-primary);
}
.btn-ai-refresh {
  flex: 0 0 auto;
  width: 36px;
  padding: 7px;
}

.modal-buttons {
  display: flex;
  gap: 10px;
}
.modal-btn {
  flex: 1;
  padding: 11px 16px;
  border-radius: var(--r-md);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--t-fast);
  font-family: inherit;
  border: 1px solid;
  min-height: 42px;
}
.modal-btn-cancel {
  background: var(--bg-card);
  border-color: var(--border);
  color: var(--text-secondary);
}
.modal-btn-cancel:hover {
  background: var(--bg-elevated);
  color: var(--text-primary);
}
.modal-btn-confirm, .modal-btn-win, .modal-btn-lose, .modal-btn-archive {
  color: white;
  border-color: transparent;
}
.modal-btn-confirm {
  background: var(--text-primary);
  border-color: var(--text-primary);
  color: var(--bg-card);
}
.modal-btn-confirm:hover { opacity: 0.9; transform: translateY(-1px); }
.modal-btn-win { background: var(--won); border-color: var(--won); }
.modal-btn-win:hover { opacity: 0.9; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(5, 150, 105, 0.3); }
.modal-btn-lose { background: var(--hot); border-color: var(--hot); }
.modal-btn-lose:hover { opacity: 0.9; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(220, 38, 38, 0.3); }
.modal-btn-archive { background: var(--text-primary); border-color: var(--text-primary); color: var(--bg-card); }
.modal-btn-archive:hover { opacity: 0.85; transform: translateY(-1px); }

@media (max-width: 480px) {
  .modal-card { padding: 24px 20px; }
  .modal-buttons { flex-direction: column-reverse; }
  .modal-icon { font-size: 32px; }
  .modal-title { font-size: 16px; }
}

/* ─────── TOAST ─────── */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--text-primary);
  color: var(--bg-card);
  padding: 12px 18px;
  border-radius: var(--r-md);
  font-size: 13px;
  font-weight: 500;
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
  z-index: 3000;
  transform: translateY(20px);
  opacity: 0;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  max-width: 360px;
  letter-spacing: -0.005em;
}
.toast.visible { transform: translateY(0); opacity: 1; }
.toast-success { background: var(--won); color: white; }
.toast-error { background: var(--hot); color: white; }

@media (max-width: 600px) {
  .toast { bottom: 12px; right: 12px; left: 12px; max-width: none; }
}

/* Print-friendly */
@media print {
  .header, .panel-ai, .row-2, .footer { display: none; }
  .panel { break-inside: avoid; }
}
