/* ══ Neo Portal · Tokens de marca (coherentes con neo-partners-web) ══ */
:root {
  --navy:        #0A1628;
  --navy-2:      #0D1E38;
  --navy-3:      #0f2040;
  --gold:        #D4AF37;
  --gold-light:  #E8CB6A;
  --gold-dark:   #B8932A;
  --gold-glow:   rgba(212,175,55,0.12);
  --gold-border: rgba(212,175,55,0.28);
  --text-1:      #F0F4FF;
  --text-2:      #8899BB;
  --text-3:      #5A6B8C;
  --surface:     rgba(255,255,255,0.035);
  --surface-2:   rgba(255,255,255,0.065);
  --border:      rgba(255,255,255,0.08);
  --green:       #3DD68C;
  --green-bg:    rgba(61,214,140,0.12);
  --blue:        #5B9BF0;
  --blue-bg:     rgba(91,155,240,0.12);
  --orange:      #F0A35B;
  --orange-bg:   rgba(240,163,91,0.12);
  --red:         #F06D6D;
  --red-bg:      rgba(240,109,109,0.12);
  --h-font: 'Cormorant Garamond', Georgia, serif;
  --b-font: 'Jost', sans-serif;
  --r:   16px;
  --r-s: 10px;
  --t:   200ms ease;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; }

body {
  font-family: var(--b-font);
  background: var(--navy);
  color: var(--text-1);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

button { font-family: inherit; cursor: pointer; }
input, select { font-family: inherit; }
a { color: inherit; }
svg { flex-shrink: 0; }

/* ══ LOGIN ══ */
.login-page {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(ellipse 60% 50% at 20% 0%, rgba(212,175,55,0.07), transparent),
    radial-gradient(ellipse 50% 40% at 90% 100%, rgba(91,155,240,0.06), transparent),
    var(--navy);
}
.login-card {
  width: 100%;
  max-width: 420px;
  background: var(--navy-2);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 44px 40px;
  box-shadow: 0 30px 80px rgba(0,0,0,0.45);
}
.login-crown { text-align: center; margin-bottom: 10px; }
.login-logo {
  font-family: var(--h-font);
  font-size: 30px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-align: center;
}
.login-logo span { color: var(--gold); }
.login-sub {
  text-align: center;
  color: var(--text-2);
  font-size: 14px;
  margin: 6px 0 34px;
  letter-spacing: 0.4px;
}
.field { margin-bottom: 18px; }
.field label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-2);
  margin-bottom: 7px;
  letter-spacing: 0.3px;
}
.field input {
  width: 100%;
  padding: 13px 15px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-s);
  color: var(--text-1);
  font-size: 15px;
  transition: border-color var(--t), box-shadow var(--t);
}
.field input:focus {
  outline: none;
  border-color: var(--gold-border);
  box-shadow: 0 0 0 3px var(--gold-glow);
}
.field input::placeholder { color: var(--text-3); }
.login-error {
  display: none;
  background: var(--red-bg);
  border: 1px solid rgba(240,109,109,0.3);
  color: var(--red);
  font-size: 13.5px;
  border-radius: var(--r-s);
  padding: 10px 14px;
  margin-bottom: 18px;
}
.login-error.show { display: block; }
.btn-primary {
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, var(--gold-dark), var(--gold));
  color: var(--navy);
  border: none;
  border-radius: var(--r-s);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.5px;
  transition: transform var(--t), box-shadow var(--t), opacity var(--t);
}
.btn-primary:hover { box-shadow: 0 8px 24px rgba(212,175,55,0.25); transform: translateY(-1px); }
.btn-primary:disabled { opacity: 0.6; cursor: default; transform: none; }
.demo-creds {
  margin-top: 28px;
  padding-top: 22px;
  border-top: 1px solid var(--border);
  font-size: 12.5px;
  color: var(--text-3);
}
.demo-creds strong { color: var(--text-2); font-weight: 500; }
.demo-creds code {
  color: var(--gold-light);
  background: var(--surface);
  padding: 1px 6px;
  border-radius: 5px;
  font-size: 12px;
  cursor: pointer;
}

/* ══ APP LAYOUT ══ */
.app {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 100dvh;
}

/* ── Sidebar ── */
.sidebar {
  background: var(--navy-2);
  border-right: 1px solid var(--border);
  padding: 26px 16px;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100dvh;
}
.side-logo {
  font-family: var(--h-font);
  font-size: 23px;
  font-weight: 600;
  padding: 0 12px 26px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.side-logo em { font-style: normal; color: var(--gold); }
.side-nav { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.side-nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 12px;
  border-radius: var(--r-s);
  color: var(--text-2);
  text-decoration: none;
  font-size: 14.5px;
  font-weight: 500;
  letter-spacing: 0.2px;
  transition: background var(--t), color var(--t);
}
.side-nav a:hover { background: var(--surface); color: var(--text-1); }
.side-nav a.active {
  background: var(--gold-glow);
  color: var(--gold-light);
}
.side-version {
  font-size: 11px;
  color: var(--text-3);
  padding: 0 12px 8px;
  letter-spacing: 0.5px;
}
.side-footer {
  border-top: 1px solid var(--border);
  padding-top: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold-dark), var(--gold));
  color: var(--navy);
  display: grid;
  place-items: center;
  font-weight: 600;
  font-size: 14px;
}
.side-user { flex: 1; min-width: 0; }
.side-user .name { font-size: 13.5px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-user .role { font-size: 11.5px; color: var(--text-3); }
.btn-logout {
  background: none;
  border: none;
  color: var(--text-3);
  padding: 8px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  transition: color var(--t), background var(--t);
}
.btn-logout:hover { color: var(--red); background: var(--red-bg); }

/* ── Main ── */
.main { padding: 30px 36px 60px; min-width: 0; }
.topbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}
.topbar h1 {
  font-family: var(--h-font);
  font-size: 34px;
  font-weight: 600;
  line-height: 1.15;
}
.topbar .subtitle { color: var(--text-2); font-size: 14px; margin-top: 2px; }
.client-select {
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-1);
  border-radius: var(--r-s);
  padding: 10px 14px;
  font-size: 14px;
}
.client-select:focus { outline: none; border-color: var(--gold-border); }

/* ── Cards / grids ── */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 22px;
}
.kpi .kpi-label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-2);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.3px;
}
.kpi .kpi-label svg { color: var(--gold); }
.kpi .kpi-value {
  font-size: 32px;
  font-weight: 600;
  margin-top: 8px;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}
.kpi .kpi-hint { font-size: 12.5px; color: var(--text-3); margin-top: 4px; }

.two-col {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 16px;
  align-items: start;
}
.card h2 {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.2px;
  margin-bottom: 16px;
}

/* ── Chart ── */
.chart-wrap { width: 100%; overflow-x: auto; }
.chart-svg { width: 100%; height: auto; display: block; }

/* ── Tables / lists ── */
.plain-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.plain-table th {
  text-align: left;
  color: var(--text-3);
  font-weight: 500;
  font-size: 12.5px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  padding: 0 12px 10px 0;
  border-bottom: 1px solid var(--border);
}
.plain-table td {
  padding: 12px 12px 12px 0;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.plain-table tr:last-child td { border-bottom: none; }
.table-scroll { overflow-x: auto; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 500;
  padding: 3px 10px;
  border-radius: 999px;
  letter-spacing: 0.3px;
  white-space: nowrap;
}
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.nuevo      { color: var(--blue); background: var(--blue-bg); }
.badge.contactado { color: var(--orange); background: var(--orange-bg); }
.badge.calificado { color: var(--gold-light); background: var(--gold-glow); }
.badge.agendado   { color: var(--green); background: var(--green-bg); }
.badge.cerrado    { color: var(--green); background: var(--green-bg); }
.badge.en_curso   { color: var(--blue); background: var(--blue-bg); }
.badge.descartado { color: var(--text-3); background: var(--surface-2); }
.badge.activa     { color: var(--green); background: var(--green-bg); }
.badge.pausada    { color: var(--orange); background: var(--orange-bg); }

/* ── Conversaciones ── */
.conv-layout {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 16px;
  align-items: start;
}
.conv-list { padding: 10px; }
.conv-item {
  width: 100%;
  display: block;
  text-align: left;
  background: none;
  border: none;
  border-radius: var(--r-s);
  padding: 13px 14px;
  transition: background var(--t);
  border-bottom: 1px solid var(--border);
}
.conv-item:last-child { border-bottom: none; }
.conv-item:hover { background: var(--surface); }
.conv-item.active { background: var(--gold-glow); }
.conv-item .row1 {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}
.conv-item .lead-name { font-weight: 500; font-size: 14.5px; color: var(--text-1); }
.conv-item .preview {
  color: var(--text-3);
  font-size: 13px;
  margin-top: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 270px;
}
.conv-detail { min-height: 480px; display: flex; flex-direction: column; }
.conv-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
}
.conv-head .who { font-weight: 600; font-size: 16px; }
.conv-head .phone { color: var(--text-3); font-size: 13px; }
.messages { display: flex; flex-direction: column; gap: 10px; flex: 1; }
.msg {
  max-width: 72%;
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.5;
}
.msg .at { display: block; font-size: 11px; color: var(--text-3); margin-top: 4px; }
.msg.lead {
  align-self: flex-start;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-bottom-left-radius: 4px;
}
.msg.agente {
  align-self: flex-end;
  background: linear-gradient(135deg, rgba(212,175,55,0.16), rgba(212,175,55,0.08));
  border: 1px solid var(--gold-border);
  border-bottom-right-radius: 4px;
}
.msg.agente .at { text-align: right; }
.empty-state {
  color: var(--text-3);
  font-size: 14px;
  text-align: center;
  padding: 60px 20px;
}

/* ── Pipeline (kanban) ── */
.kanban {
  display: grid;
  grid-template-columns: repeat(5, minmax(210px, 1fr));
  gap: 14px;
  overflow-x: auto;
  padding-bottom: 8px;
}
.kanban-col {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 14px;
  min-height: 320px;
}
.kanban-col.drag-over { border-color: var(--gold-border); background: var(--gold-glow); }
.kanban-col h3 {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--text-2);
  display: flex;
  justify-content: space-between;
  margin-bottom: 12px;
}
.kanban-col h3 .count { color: var(--text-3); font-weight: 500; }
.lead-card {
  background: var(--navy-2);
  border: 1px solid var(--border);
  border-radius: var(--r-s);
  padding: 13px 14px;
  margin-bottom: 10px;
  cursor: grab;
  transition: border-color var(--t), box-shadow var(--t), opacity var(--t);
}
.lead-card:hover { border-color: var(--gold-border); }
.lead-card.dragging { opacity: 0.4; }
.lead-card .name { font-weight: 500; font-size: 14px; }
.lead-card .service { color: var(--text-2); font-size: 12.5px; margin-top: 2px; }
.lead-card .meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 10px;
  font-size: 12px;
  color: var(--text-3);
}
.lead-card .value { color: var(--gold-light); font-weight: 600; font-variant-numeric: tabular-nums; }
.lead-card .meta-left { display: inline-flex; align-items: center; gap: 7px; min-width: 0; }

/* Temperatura del lead (clasificada por la IA o a mano) */
.temp-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.4px;
  padding: 2px 8px;
  border-radius: 999px;
  white-space: nowrap;
}
.temp-chip::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.temp-chip.caliente { color: var(--red); background: var(--red-bg); }
.temp-chip.tibio    { color: var(--orange); background: var(--orange-bg); }
.temp-chip.frio     { color: var(--blue); background: var(--blue-bg); }
.temp-hint { color: var(--text-3); font-weight: 400; font-size: 12px; }

/* ── Toolbar de vista + modal de prospectos ── */
.view-toolbar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 14px;
}
.sync-bar { gap: 10px; flex-wrap: wrap; }
.ad-input { flex: 1; max-width: 340px; min-width: 200px; }
.btn-inline {
  width: auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  font-size: 14px;
}
.card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}
.lead-edit {
  background: none;
  border: none;
  color: var(--text-3);
  padding: 4px;
  border-radius: 6px;
  display: grid;
  place-items: center;
  transition: color var(--t), background var(--t);
}
.lead-edit:hover { color: var(--gold-light); background: var(--gold-glow); }

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(4, 10, 20, 0.7);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: grid;
  place-items: center;
  padding: 20px;
  z-index: 1000;
  animation: fadeIn 160ms ease;
}
@keyframes fadeIn { from { opacity: 0; } }
.modal {
  width: 100%;
  max-width: 460px;
  background: var(--navy-2);
  max-height: 90dvh;
  overflow-y: auto;
  box-shadow: 0 30px 80px rgba(0,0,0,0.5);
}
.modal h2 { margin-bottom: 18px; }
.modal-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 14px;
}
.modal .field select.client-select { width: 100%; }
.modal-error {
  background: var(--red-bg);
  border: 1px solid rgba(240,109,109,0.3);
  color: var(--red);
  font-size: 13px;
  border-radius: var(--r-s);
  padding: 9px 12px;
  margin-bottom: 14px;
}
.modal-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 6px;
}
.modal-actions .spacer { flex: 1; }
.btn-secondary {
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-2);
  padding: 10px 16px;
  border-radius: var(--r-s);
  font-size: 14px;
  transition: color var(--t), border-color var(--t);
}
.btn-secondary:hover { color: var(--text-1); border-color: var(--text-3); }
.btn-danger {
  background: var(--red-bg);
  border: 1px solid rgba(240,109,109,0.3);
  color: var(--red);
  padding: 10px 16px;
  border-radius: var(--r-s);
  font-size: 14px;
  transition: background var(--t);
}
.btn-danger:hover { background: rgba(240,109,109,0.22); }
@media (max-width: 480px) {
  .modal-grid { grid-template-columns: 1fr; }
}

/* ── Credenciales de cliente nuevo (se muestran una vez) ── */
.cred-box {
  display: grid;
  gap: 10px;
  background: var(--gold-glow);
  border: 1px solid var(--gold-border);
  border-radius: var(--r-s);
  padding: 16px;
  margin: 14px 0 6px;
}
.cred-box > div { display: flex; align-items: center; gap: 12px; }
.cred-label {
  width: 90px;
  color: var(--text-2);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  flex-shrink: 0;
}
.cred-box code {
  color: var(--gold-light);
  font-size: 14.5px;
  word-break: break-all;
  user-select: all;
}

/* ── Campañas ── */
.campaign-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}
.campaign-card .head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 4px;
}
.campaign-card .name { font-weight: 600; font-size: 15.5px; line-height: 1.35; }
.campaign-card .platform {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--text-2);
  font-size: 13px;
  margin-bottom: 16px;
}
.campaign-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 16px;
}
.campaign-stats .stat .lbl { font-size: 11.5px; color: var(--text-3); letter-spacing: 0.4px; text-transform: uppercase; }
.campaign-stats .stat .val { font-size: 18px; font-weight: 600; font-variant-numeric: tabular-nums; }
.campaign-stats .stat .val.gold { color: var(--gold-light); }

/* ── Skeleton / loading ── */
.skeleton {
  border-radius: var(--r);
  background: linear-gradient(100deg, var(--surface) 40%, var(--surface-2) 50%, var(--surface) 60%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  min-height: 110px;
}
@keyframes shimmer { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* ── Agente IA ── */
.agente-layout {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 16px;
  align-items: start;
}
.model-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.model-card { display: flex; flex-direction: column; padding: 18px; transition: border-color var(--t); }
.model-card.active { border-color: var(--gold-border); background: var(--gold-glow); }
.model-name { font-weight: 600; font-size: 15px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.model-reco {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--navy);
  background: linear-gradient(135deg, var(--gold-dark), var(--gold));
  padding: 2px 8px;
  border-radius: 999px;
}
.model-provider { font-size: 12px; color: var(--text-3); margin-top: 2px; }
.model-desc { font-size: 12.5px; color: var(--text-2); line-height: 1.55; margin: 10px 0 14px; flex: 1; }
.model-btn {
  width: 100%;
  padding: 10px;
  border-radius: var(--r-s);
  font-size: 13px;
  font-weight: 500;
  transition: opacity var(--t), background var(--t);
}
.model-btn.select {
  border: 1px solid var(--gold-border);
  background: var(--gold-glow);
  color: var(--gold-light);
}
.model-btn.select:hover { background: rgba(212,175,55,0.22); }
.model-btn.current {
  border: none;
  background: linear-gradient(135deg, var(--gold-dark), var(--gold));
  color: var(--navy);
  font-weight: 600;
  cursor: default;
}
.model-btn.locked {
  border: 1px dashed var(--border);
  background: none;
  color: var(--text-3);
}
.agent-test { display: flex; flex-direction: column; min-height: 480px; position: sticky; top: 24px; }
.agent-test-sub { font-size: 12.5px; color: var(--text-2); margin: -8px 0 12px; }
.agent-test-sub strong { color: var(--gold-light); }
.agent-test-messages {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 4px 0;
  min-height: 280px;
}
.agent-test-input { padding: 12px 0 0; border-top: 1px solid var(--border); margin-top: 12px; }

/* ── Marca blanca ── */
.brand-form .field input { font-size: 14px; }
.color-row { display: flex; align-items: center; gap: 12px; }
.color-row input[type="color"] {
  width: 52px;
  height: 38px;
  padding: 3px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-s);
  cursor: pointer;
}
.color-row code { color: var(--text-2); font-size: 13px; }
.brand-saved { margin-top: 12px; color: var(--green); font-size: 13.5px; }
.help-text { color: var(--text-2); font-size: 13.5px; margin-bottom: 12px; }
.help-list { color: var(--text-2); font-size: 13.5px; padding-left: 20px; display: grid; gap: 8px; margin-bottom: 12px; }
.brand-logo-img { width: 30px; height: 30px; object-fit: contain; }

/* ══ ASISTENTE "NEO" ══ */
.asst-fab {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, var(--gold-dark), var(--gold));
  color: var(--navy);
  display: grid;
  place-items: center;
  box-shadow: 0 10px 30px rgba(212,175,55,0.35);
  z-index: 900;
  transition: transform var(--t), box-shadow var(--t), opacity var(--t);
}
.asst-fab:hover { transform: translateY(-2px) scale(1.05); box-shadow: 0 14px 36px rgba(212,175,55,0.45); }
.asst-fab.hidden { opacity: 0; pointer-events: none; }

.asst-panel[hidden], .tour-card[hidden] { display: none; }
.asst-panel {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 370px;
  max-width: calc(100vw - 32px);
  height: 540px;
  max-height: calc(100dvh - 48px);
  background: var(--navy-2);
  border: 1px solid var(--gold-border);
  border-radius: var(--r);
  box-shadow: 0 30px 80px rgba(0,0,0,0.55);
  z-index: 950;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.asst-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--gold-glow);
}
.asst-title { display: flex; align-items: center; gap: 10px; }
.asst-title .name { font-weight: 600; font-size: 15px; line-height: 1.2; }
.asst-title .tag { font-size: 11.5px; color: var(--text-2); }
.asst-close {
  background: none;
  border: none;
  color: var(--text-2);
  font-size: 15px;
  padding: 6px 9px;
  border-radius: 8px;
  transition: background var(--t), color var(--t);
}
.asst-close:hover { background: var(--surface-2); color: var(--text-1); }
.asst-tour-btn {
  margin: 12px 14px 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px;
  border: 1px solid var(--gold-border);
  border-radius: var(--r-s);
  background: var(--gold-glow);
  color: var(--gold-light);
  font-size: 14px;
  font-weight: 500;
  transition: background var(--t);
}
.asst-tour-btn:hover { background: rgba(212,175,55,0.2); }
.asst-messages {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.asst-msg {
  max-width: 86%;
  padding: 10px 13px;
  border-radius: 13px;
  font-size: 13.5px;
  line-height: 1.55;
  white-space: pre-wrap;
}
.asst-msg strong { color: var(--gold-light); font-weight: 600; }
.asst-msg.assistant {
  align-self: flex-start;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-bottom-left-radius: 4px;
}
.asst-msg.user {
  align-self: flex-end;
  background: linear-gradient(135deg, rgba(212,175,55,0.2), rgba(212,175,55,0.1));
  border: 1px solid var(--gold-border);
  border-bottom-right-radius: 4px;
}
.asst-msg.typing { color: var(--text-3); letter-spacing: 3px; }
.asst-input {
  display: flex;
  gap: 8px;
  padding: 12px 14px;
  border-top: 1px solid var(--border);
}
.asst-input input {
  flex: 1;
  padding: 11px 13px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-s);
  color: var(--text-1);
  font-size: 14px;
}
.asst-input input:focus { outline: none; border-color: var(--gold-border); }
.asst-input input::placeholder { color: var(--text-3); }
.asst-input button {
  width: 44px;
  border: none;
  border-radius: var(--r-s);
  background: linear-gradient(135deg, var(--gold-dark), var(--gold));
  color: var(--navy);
  display: grid;
  place-items: center;
  transition: opacity var(--t);
}
.asst-input button:hover { opacity: 0.9; }

/* ── Tour guiado ── */
.tour-card {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  width: 520px;
  max-width: calc(100vw - 32px);
  background: var(--navy-2);
  border: 1px solid var(--gold-border);
  border-radius: var(--r);
  padding: 22px 24px;
  box-shadow: 0 30px 80px rgba(0,0,0,0.6);
  z-index: 960;
}
.tour-step-label {
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 6px;
}
.tour-card h3 { font-size: 18px; font-weight: 600; margin-bottom: 8px; }
.tour-card p { color: var(--text-2); font-size: 14px; line-height: 1.6; }
.tour-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 18px;
  flex-wrap: wrap;
}
.tour-dots { display: flex; gap: 6px; }
.tour-dots .dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--surface-2);
  border: 1px solid var(--border);
}
.tour-dots .dot.on { background: var(--gold); border-color: var(--gold); }
.tour-nav { display: flex; gap: 8px; }
.tour-btn {
  padding: 9px 16px;
  border-radius: var(--r-s);
  font-size: 13.5px;
  font-weight: 500;
  transition: opacity var(--t), background var(--t);
}
.tour-btn.solid {
  border: none;
  background: linear-gradient(135deg, var(--gold-dark), var(--gold));
  color: var(--navy);
  font-weight: 600;
}
.tour-btn.solid:hover { opacity: 0.9; }
.tour-btn.ghost {
  border: 1px solid var(--border);
  background: none;
  color: var(--text-2);
}
.tour-btn.ghost:hover { background: var(--surface); color: var(--text-1); }
.tour-btn:disabled { opacity: 0.4; cursor: default; }

/* ═══════════════════════════════════════════════════════════════
   ✨ CAPA DE VITALIDAD — animaciones, hovers y microinteracciones
   Todo con transform/opacity (60fps). El bloque prefers-reduced-motion
   de más arriba desactiva todo esto para quien lo pida.
   ═══════════════════════════════════════════════════════════════ */

/* ── Fondo ambiental: auroras doradas que respiran detrás del contenido ── */
.app { position: relative; isolation: isolate; }
.app::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(38% 42% at 82% 8%, rgba(212,175,55,0.10), transparent 70%),
    radial-gradient(34% 40% at 12% 92%, rgba(91,155,240,0.08), transparent 70%),
    radial-gradient(30% 34% at 60% 60%, rgba(212,175,55,0.05), transparent 70%);
  background-size: 160% 160%, 160% 160%, 160% 160%;
  animation: auroraDrift 22s ease-in-out infinite alternate;
}
@keyframes auroraDrift {
  0%   { background-position: 0% 0%, 100% 100%, 40% 40%; }
  100% { background-position: 30% 20%, 70% 80%, 60% 55%; }
}

/* ── Entrada de vistas: el panel principal aparece deslizando ── */
.view-anim { animation: viewIn 400ms cubic-bezier(.22,.61,.36,1) both; }
@keyframes viewIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}
/* Entrada escalonada de tarjetas y filas dentro de la vista */
.view-anim .kpi-grid > *,
.view-anim .two-col > *,
.view-anim .campaign-grid > *,
.view-anim .kanban > *,
.view-anim .conv-layout > *,
.view-anim .agente-layout > *,
.view-anim .model-grid > *,
.view-anim > .card,
.view-anim .plain-table tbody tr {
  animation: cardIn 460ms cubic-bezier(.22,.61,.36,1) both;
}
.view-anim .kpi-grid > *:nth-child(1),
.view-anim .model-grid > *:nth-child(1),
.view-anim .kanban > *:nth-child(1),
.view-anim .campaign-grid > *:nth-child(1) { animation-delay: 40ms; }
.view-anim .kpi-grid > *:nth-child(2),
.view-anim .model-grid > *:nth-child(2),
.view-anim .kanban > *:nth-child(2),
.view-anim .campaign-grid > *:nth-child(2) { animation-delay: 100ms; }
.view-anim .kpi-grid > *:nth-child(3),
.view-anim .model-grid > *:nth-child(3),
.view-anim .kanban > *:nth-child(3),
.view-anim .campaign-grid > *:nth-child(3) { animation-delay: 160ms; }
.view-anim .kpi-grid > *:nth-child(4),
.view-anim .model-grid > *:nth-child(4),
.view-anim .kanban > *:nth-child(4),
.view-anim .campaign-grid > *:nth-child(5) { animation-delay: 220ms; }
.view-anim .kanban > *:nth-child(5) { animation-delay: 280ms; }
.view-anim .plain-table tbody tr:nth-child(1) { animation-delay: 60ms; }
.view-anim .plain-table tbody tr:nth-child(2) { animation-delay: 110ms; }
.view-anim .plain-table tbody tr:nth-child(3) { animation-delay: 160ms; }
.view-anim .plain-table tbody tr:nth-child(4) { animation-delay: 210ms; }
.view-anim .plain-table tbody tr:nth-child(5) { animation-delay: 260ms; }
@keyframes cardIn {
  from { opacity: 0; transform: translateY(14px) scale(.985); }
  to   { opacity: 1; transform: none; }
}

/* ── Tarjetas: elevación y borde dorado al pasar el mouse ── */
.card {
  transition: transform 260ms cubic-bezier(.22,.61,.36,1),
              border-color 260ms ease, box-shadow 260ms ease;
}
.kpi { position: relative; overflow: hidden; }
.kpi:hover {
  transform: translateY(-4px);
  border-color: var(--gold-border);
  box-shadow: 0 16px 40px rgba(0,0,0,0.35), 0 0 0 1px var(--gold-border);
}
/* Brillo diagonal que barre la tarjeta KPI al hacer hover */
.kpi::after {
  content: '';
  position: absolute;
  top: 0; left: -60%;
  width: 40%; height: 100%;
  background: linear-gradient(105deg, transparent, rgba(255,255,255,0.06), transparent);
  transform: skewX(-18deg);
  transition: left 650ms ease;
  pointer-events: none;
}
.kpi:hover::after { left: 130%; }
.kpi .kpi-value { transition: color 260ms ease; }
.kpi:hover .kpi-value { color: var(--gold-light); }
.kpi:hover .kpi-label svg { animation: iconPop 420ms ease; }
@keyframes iconPop {
  0% { transform: scale(1); } 45% { transform: scale(1.22) rotate(-4deg); } 100% { transform: scale(1); }
}

/* ── Navegación lateral: indicador que crece y hover con deslizamiento ── */
.side-nav a { position: relative; }
.side-nav a::before {
  content: '';
  position: absolute;
  left: 4px; top: 50%;
  width: 3px; height: 0;
  border-radius: 3px;
  background: var(--gold);
  transform: translateY(-50%);
  transition: height 240ms cubic-bezier(.22,.61,.36,1);
}
.side-nav a.active::before { height: 60%; }
.side-nav a:hover { transform: translateX(2px); }
.side-nav a svg { transition: transform 240ms ease; }
.side-nav a:hover svg, .side-nav a.active svg { transform: scale(1.12); }

/* ── Botones dorados: brillo que barre al pasar el mouse ── */
.btn-primary, .btn-inline, .model-btn.current, .tour-btn.solid {
  position: relative;
  overflow: hidden;
}
.btn-primary::after, .btn-inline::after {
  content: '';
  position: absolute;
  top: 0; left: -75%;
  width: 50%; height: 100%;
  background: linear-gradient(105deg, transparent, rgba(255,255,255,0.35), transparent);
  transform: skewX(-20deg);
  transition: left 600ms ease;
  pointer-events: none;
}
.btn-primary:hover::after, .btn-inline:hover::after { left: 130%; }
.btn-inline:hover { transform: translateY(-2px); box-shadow: 0 10px 26px rgba(212,175,55,0.3); }
.btn-primary:active, .btn-inline:active { transform: translateY(0) scale(.98); }

/* ── Avatar y corona: pulso dorado sutil y vivo ── */
.avatar {
  transition: transform 300ms cubic-bezier(.34,1.56,.64,1), box-shadow 300ms ease;
  box-shadow: 0 0 0 0 rgba(212,175,55,0.4);
}
.avatar:hover { transform: scale(1.08) rotate(-3deg); box-shadow: 0 6px 20px rgba(212,175,55,0.4); }
.side-logo .crown { transition: transform 400ms cubic-bezier(.34,1.56,.64,1); transform-origin: center bottom; }
.side-logo:hover .crown { transform: translateY(-2px) scale(1.08); }

/* ── Tablas: realce de fila al pasar el mouse ── */
.plain-table tbody tr { transition: background 200ms ease; }
.plain-table tbody tr:hover { background: var(--surface); }

/* ── Kanban: tarjetas con más vida al arrastrar ── */
.lead-card {
  transition: transform 220ms cubic-bezier(.22,.61,.36,1), border-color 220ms ease, box-shadow 220ms ease;
}
.lead-card:hover {
  transform: translateY(-3px);
  border-color: var(--gold-border);
  box-shadow: 0 10px 26px rgba(0,0,0,0.32);
}
.lead-card:active { cursor: grabbing; }
.kanban-col { transition: background 240ms ease, border-color 240ms ease, box-shadow 240ms ease; }
.kanban-col.drag-over { box-shadow: inset 0 0 0 2px var(--gold-border); transform: none; }

/* ── Temperatura "Caliente": late suavemente para llamar la atención ── */
.temp-chip.caliente { animation: heatPulse 2.4s ease-in-out infinite; }
@keyframes heatPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(240,109,109,0); }
  50%      { box-shadow: 0 0 0 4px rgba(240,109,109,0.12); }
}

/* ── Modelos de IA: elevación y check del recomendado ── */
.model-card { transition: transform 240ms cubic-bezier(.22,.61,.36,1), border-color 240ms ease, box-shadow 240ms ease; }
.model-card:hover { transform: translateY(-3px); border-color: var(--gold-border); box-shadow: 0 12px 30px rgba(0,0,0,0.3); }
.model-reco { animation: recoGlow 2.8s ease-in-out infinite; }
@keyframes recoGlow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(212,175,55,0); }
  50%      { box-shadow: 0 0 12px 0 rgba(212,175,55,0.45); }
}

/* ── Campañas: elevación al pasar el mouse ── */
.campaign-card { transition: transform 240ms cubic-bezier(.22,.61,.36,1), border-color 240ms ease, box-shadow 240ms ease; }
.campaign-card:hover { transform: translateY(-3px); border-color: var(--gold-border); box-shadow: 0 12px 30px rgba(0,0,0,0.3); }

/* ── Conversaciones: mensajes que aparecen deslizando ── */
.messages .msg, .agent-test-messages .msg {
  animation: msgIn 320ms cubic-bezier(.22,.61,.36,1) both;
}
@keyframes msgIn {
  from { opacity: 0; transform: translateY(8px) scale(.98); }
  to   { opacity: 1; transform: none; }
}
.conv-item { transition: background 200ms ease, transform 200ms ease; }
.conv-item:hover { transform: translateX(3px); }

/* ── Gráfico: la línea se dibuja sola al entrar ── */
.view-anim .chart-svg polyline {
  stroke-dasharray: 1400;
  stroke-dashoffset: 1400;
  animation: drawLine 1200ms cubic-bezier(.4,0,.2,1) 200ms forwards;
}
.view-anim .chart-svg polygon { animation: fadeArea 900ms ease 500ms both; }
.view-anim .chart-svg circle { animation: dotPop 300ms cubic-bezier(.34,1.56,.64,1) both; }
.view-anim .chart-svg circle:nth-child(1) { animation-delay: 800ms; }
.view-anim .chart-svg circle:nth-child(2) { animation-delay: 880ms; }
.view-anim .chart-svg circle:nth-child(3) { animation-delay: 960ms; }
.view-anim .chart-svg circle:nth-child(4) { animation-delay: 1040ms; }
.view-anim .chart-svg circle:nth-child(5) { animation-delay: 1120ms; }
.view-anim .chart-svg circle:nth-child(6) { animation-delay: 1200ms; }
.view-anim .chart-svg circle:nth-child(7) { animation-delay: 1280ms; }
.view-anim .chart-svg circle:nth-child(8) { animation-delay: 1360ms; }
@keyframes drawLine { to { stroke-dashoffset: 0; } }
@keyframes fadeArea { from { opacity: 0; } to { opacity: 1; } }
@keyframes dotPop { from { opacity: 0; transform: scale(0); transform-box: fill-box; transform-origin: center; } to { opacity: 1; transform: scale(1); } }

/* ── Inputs: foco con leve elevación y glow ── */
.field input, .field select, .client-select, .asst-input input, .ad-input {
  transition: border-color 200ms ease, box-shadow 200ms ease, transform 200ms ease;
}
.field input:focus, .field select:focus, .asst-input input:focus, .ad-input:focus {
  transform: translateY(-1px);
}

/* ── Modales: entran con escala desde el centro ── */
.modal { animation: modalIn 300ms cubic-bezier(.34,1.4,.5,1) both; }
@keyframes modalIn {
  from { opacity: 0; transform: translateY(16px) scale(.96); }
  to   { opacity: 1; transform: none; }
}

/* ── Marca (logo lateral): brillo dorado que recorre "Partners" ── */
.side-logo em {
  background: linear-gradient(90deg, var(--gold-dark) 0%, var(--gold-light) 50%, var(--gold-dark) 100%);
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: shineText 5.5s linear infinite;
}
@keyframes shineText { to { background-position: 200% center; } }

/* ── Botón flotante del asistente: latido de invitación ── */
.asst-fab { animation: fabBreathe 3.2s ease-in-out infinite; }
@keyframes fabBreathe {
  0%, 100% { box-shadow: 0 10px 30px rgba(212,175,55,0.35); }
  50%      { box-shadow: 0 10px 30px rgba(212,175,55,0.35), 0 0 0 8px rgba(212,175,55,0.06); }
}
.asst-fab:hover { animation: none; }

/* ── Responsive ── */
@media (max-width: 980px) {
  .app { grid-template-columns: 1fr; }
  .sidebar {
    position: static;
    height: auto;
    flex-direction: row;
    align-items: center;
    padding: 12px 16px;
    gap: 10px;
  }
  .side-logo { padding: 0 8px 0 0; font-size: 19px; }
  .side-nav { flex-direction: row; overflow-x: auto; }
  .side-nav a { white-space: nowrap; padding: 9px 12px; }
  .side-nav a .nav-label { display: none; }
  .side-footer { border: none; padding: 0; }
  .side-user { display: none; }
  .main { padding: 20px 16px 50px; }
  .two-col, .conv-layout, .agente-layout { grid-template-columns: 1fr; }
  .model-grid { grid-template-columns: 1fr; }
  .agent-test { position: static; }
  .topbar h1 { font-size: 27px; }
}
