/* ════════════════════════════════════════════════════════
   SHELTER.515 — Premium Dark Dashboard
   Space Grotesk + Inter · editorial operations aesthetic
════════════════════════════════════════════════════════ */

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

/* Rol cliente/suscriptor: solo lectura — oculta cualquier control de escritura
   (el backend ya bloquea estas acciones; esto evita mostrar botones que 403).
   Además de .rw-write (tageada a mano), se ocultan clases que en toda la app
   se usan EXCLUSIVAMENTE para crear/editar/borrar (verificado caso por caso
   en business_design.js y growth.js — Growth OS, Business Design ampliado). */
body.role-readonly .rw-write,
body.role-readonly .btn-icon,
body.role-readonly .bd-ci-del,
body.role-readonly .bd-ob-acc-del,
body.role-readonly .bd-ob-add-proc,
body.role-readonly .bd-ob-add-acc,
body.role-readonly .bd-ob-progress-edit,
body.role-readonly .agenda-inline-btn,
body.role-readonly .agenda-mini-btn {
  display: none !important;
}

/* ─── DESIGN TOKENS ───────────────────────────────────── */
:root {
  /* Backgrounds — tema claro (papel) */
  --bg:            #F1F0E9;
  --surface:       rgba(20,20,16,0.03);
  --surface2:      rgba(20,20,16,0.05);
  --surface-solid: #ffffff;
  --sidebar:       #ffffff;

  /* Brand — paleta editorial: crema statement, oliva crecimiento,
     lila conocimiento, naranja acción. El color significa, no decora. */
  --paper:         #F1F0E9;
  --brand-cream:   #F1F0E9;
  --brand-violet:  #C0A2E5;   /* Social issues — único violeta */
  --brand-lime:    #CFEA5B;   /* Museum — único verde */
  --brand-blue:    #4657D4;   /* Daily life — único azul */
  --brand-coral:   #EE5A38;   /* Food — único coral */
  /* aliases → todo mapea a la paleta de 4 */
  --brand-periwinkle: #4657D4;
  --brand-mauve:   #C0A2E5;
  --brand-orange:  #EE5A38;
  --brand-olive:   #CFEA5B;
  --brand-lilac:   #C0A2E5;
  --accent:        #EE5A38;
  --accent-glow:   rgba(20,20,16,0.18);
  --accent-soft:   rgba(238,90,56,0.10);
  --accent-mid:    rgba(238,90,56,0.16);
  --accent-label:  #8a8a80;

  /* Borders — SIEMPRE neutros: el color de marca nunca delimita */
  --border:        rgba(20,20,16,0.12);
  --border-hover:  rgba(20,20,16,0.24);
  --border-subtle: rgba(20,20,16,0.08);

  /* Status */
  --green:  #CFEA5B;
  --red:    #EE5A38;
  --yellow: #C0A2E5;
  --blue:   #94A6EF;

  /* Text */
  --text:  #141410;
  --text2: #55554c;
  --text3: #8a8a80;
  --text1: #141410;
  --bg1:   #ffffff;
  --bg2:   #F1F0E9;
  --card:  #ffffff;

  /* Layout */
  --sidebar-w: 240px;
  --radius:    16px;
  --t:         200ms ease;

  /* Fonts */
  --font-display: 'Space Grotesk', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body:    'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* ─── SCROLLBAR ───────────────────────────────────────── */
::-webkit-scrollbar            { width: 4px; height: 4px; }
::-webkit-scrollbar-track      { background: transparent; }
::-webkit-scrollbar-thumb      { background: rgba(20,20,16,0.08); border-radius: 2px; }
::-webkit-scrollbar-thumb:hover{ background: rgba(20,20,16,0.15); }

/* ─── BASE ────────────────────────────────────────────── */
html, body {
  height: 100%;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}
body {
  font-family: var(--font-body);
  background: #F1F0E9;
  color: var(--text);
  display: flex; font-size: 14px; overflow: hidden;
  overscroll-behavior-x: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Headings usan la misma familia visual de la app */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  letter-spacing: -0.5px;
}

/* ─── SIDEBAR ─────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w); min-width: var(--sidebar-w);
  background: var(--sidebar);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  height: 100vh; overflow-y: auto;
  position: relative;
}

/* Blob decorativo en la parte superior del sidebar */
.sidebar::before {
  content: '';
  position: absolute; top: -80px; left: -80px;
  width: 400px; height: 400px;
  display: none;
  filter: blur(80px);
  pointer-events: none; z-index: 0;
}

.sidebar-header {
  padding: 22px 18px 16px;
  border-bottom: 1px solid var(--border);
  position: relative; z-index: 1;
}

/* ── Logo SHELTER.515 ── */
.logo { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; position: relative; }
.logo::before {
  content: '';
  position: absolute; left: -6px; top: 50%; transform: translateY(-50%);
  width: 60px; height: 60px;
  display: none;
  filter: blur(16px);
  pointer-events: none; z-index: 0;
}
.logo-mark {
  width: 30px; height: 30px; border-radius: 8px;
  background: #EE5A38;
  box-shadow: 0 12px 30px -16px rgba(20,20,16,.28);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  position: relative; z-index: 1;
}
.logo-mark svg { width: 16px; height: 16px; fill: white; }
.logo-wordmark {
  font-family: var(--font-display);
  font-size: 15px; font-weight: 700;
  letter-spacing: 2px; color: #141410;
  text-transform: uppercase; line-height: 1;
  position: relative; z-index: 1;
}
.logo-dot { color: inherit; }

/* ── Nav ── */
.sidebar-nav { padding: 12px 8px; display: flex; flex-direction: column; gap: 2px; position: relative; z-index: 1; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 14px; border-radius: 8px;
  background: none; border: none; color: #666;
  cursor: pointer; font-size: 13px; font-weight: 500; font-family: var(--font-body);
  transition: all var(--t); text-align: left; width: 100%;
  border-left: 2px solid transparent;
}
.nav-item:hover { background: rgba(20,20,16,.04); color: #141410; }
.nav-item.active {
  background: rgba(238,90,56,0.10);
  border-left: 2px solid #EE5A38;
  color: #141410;
  border-radius: 0 8px 8px 0;
  padding-left: 12px;
}
.nav-item svg { opacity: .4; transition: opacity var(--t); flex-shrink: 0; }
.nav-item:hover svg { opacity: .7; }
.nav-item.active svg { opacity: 1; }

.sidebar-clients { padding: 8px 8px 0; flex: 1; position: relative; z-index: 1; }
.section-label {
  font-family: var(--font-display);
  font-size: 9px; font-weight: 700;
  letter-spacing: 3px; text-transform: uppercase;
  color: var(--accent-label); padding: 4px 14px 6px;
}
#client-list { display: flex; flex-direction: column; gap: 2px; }
.client-chip {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 14px; border-radius: 8px; cursor: pointer;
  background: none; border: none; border-left: 2px solid transparent; color: #666;
  font-size: 12px; font-weight: 500; font-family: var(--font-body);
  transition: all var(--t); width: 100%; text-align: left;
}
.client-chip:hover { background: rgba(20,20,16,.04); color: #141410; }
.client-chip.active { background: rgba(238,90,56,0.10); border-left: 2px solid #EE5A38; color: #141410; border-radius: 0 8px 8px 0; padding-left: 12px; }
.client-avatar {
  width: 24px; height: 24px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 700; flex-shrink: 0; color: white;
}

.archived-toggle {
  display: flex; align-items: center; gap: 6px; width: 100%;
  padding: 8px 14px; margin-top: 4px; border-radius: 8px; cursor: pointer;
  background: none; border: none; color: var(--text3);
  font-family: var(--font-display); font-size: 9px; font-weight: 700;
  letter-spacing: 2px; text-transform: uppercase;
  transition: all var(--t);
}
.archived-toggle:hover { color: #141410; }
.archived-toggle .chev { transition: transform var(--t); margin-left: auto; flex-shrink: 0; }
.archived-toggle.open .chev { transform: rotate(90deg); }
#archived-count-badge { font-weight: 500; letter-spacing: 0; text-transform: none; }
#archived-client-list { display: none; flex-direction: column; gap: 2px; padding-bottom: 6px; }
#archived-client-list.open { display: flex; }
.client-chip.archived-chip { opacity: .65; }
.client-chip.archived-chip:hover { opacity: 1; }
.chip-restore-btn {
  margin-left: auto; flex-shrink: 0; width: 20px; height: 20px; border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  background: none; color: var(--text3);
}
.chip-restore-btn:hover { background: rgba(20,20,16,.08); color: var(--accent); }

.sidebar-footer { padding: 12px 8px; border-top: 1px solid var(--border); position: relative; z-index: 1; }
.btn-update {
  display: flex; align-items: center; gap: 8px; width: 100%;
  padding: 9px 12px; border-radius: 10px;
  background: var(--accent-soft); border: 1px solid var(--border);
  color: var(--accent); font-size: 12px; font-weight: 600; font-family: var(--font-body);
  cursor: pointer; transition: all var(--t);
}
.btn-update:hover { background: var(--accent-mid); box-shadow: 0 10px 24px -14px rgba(20,20,16,.28); }

/* ─── MAIN ────────────────────────────────────────────── */
.main {
  flex: 1;
  min-width: 0;
  max-width: 100%;
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

/* ─── TOPBAR ──────────────────────────────────────────── */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 32px; border-bottom: 1px solid var(--border);
  background: rgba(13,13,18,0.8); flex-shrink: 0;
  position: relative; overflow: hidden;
  backdrop-filter: blur(20px);
}
/* Gradiente azul sutil desde arriba en el topbar */
.topbar::before {
  content: '';
  position: absolute; inset: 0; pointer-events: none;
  background: transparent;
}
/* Blob azul — div real como elemento decorativo en el topbar */
.topbar-glow-blob {
  position: absolute; top: -100px; left: 50%; transform: translateX(-50%);
  width: 400px; height: 400px;
  display: none;
  filter: blur(80px);
  pointer-events: none; z-index: 0;
}
.topbar h1 {
  font-family: var(--font-display);
  font-size: 18px; font-weight: 700; letter-spacing: -0.5px;
  position: relative; z-index: 1;
}
.topbar-left { display: flex; align-items: center; gap: 12px; min-width: 0; position: relative; z-index: 1; }
.mobile-menu-btn {
  display: none;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #ffffff;
  color: var(--text);
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 4px;
  cursor: pointer;
  flex-shrink: 0;
  box-shadow: 0 10px 24px -18px rgba(20,20,16,.4);
}
.mobile-menu-btn span {
  width: 18px;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
  transition: transform var(--t), opacity var(--t);
}
.mobile-menu-btn.active span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.mobile-menu-btn.active span:nth-child(2) { opacity: 0; }
.mobile-menu-btn.active span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }
.topbar-right { display: flex; align-items: center; gap: 14px; position: relative; z-index: 1; }
.last-update { font-size: 11px; color: var(--text3); }
#client-select {
  background: rgba(20,20,16,0.04); border: 1px solid var(--border);
  color: var(--text); padding: 7px 12px; border-radius: 10px;
  font-size: 13px; cursor: pointer; outline: none; font-family: var(--font-body);
  transition: border-color var(--t);
}
#client-select:focus { border-color: var(--accent); }

/* ─── SECTIONS ────────────────────────────────────────── */
.section {
  display: none;
  min-width: 0;
  max-width: 100%;
  padding: 28px 32px;
  overflow-y: auto;
  overflow-x: hidden;
  flex: 1;
}
.section.active { display: block; }

.mobile-sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(20,20,16,.42);
  backdrop-filter: blur(2px);
  z-index: 80;
}
.mobile-sidebar-backdrop.open { display: block; }

/* ─── CARD BASE — glass effect ────────────────────────── */
.kpi-card, .chart-card, .post-card, .ai-card, .ai-summary-card,
.ai-estado-card, .ai-rec, .ai-metrics-eval, .ai-ext-section,
.ad-card, .adv-card, .tool-card, .modal-box, .discovered-card,
.impact-kpi-card, .impact-method-box, .proj-kpi, .summary-kpi,
.proposal-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  backdrop-filter: blur(10px);
}

/* ─── KPI ─────────────────────────────────────────────── */
.kpi-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 16px; margin-bottom: 28px; }
.kpi-card {
  padding: 22px;
  transition: border-color var(--t), box-shadow var(--t);
}
.kpi-card:hover {
  border-color: var(--border-hover);
  box-shadow: 0 12px 30px -16px rgba(20,20,16,.28);
}
.kpi-card.skeleton { height: 120px; animation: pulse 1.5s infinite; }
.kpi-label {
  font-family: var(--font-display);
  font-size: 9px; color: var(--accent-label); margin-bottom: 10px;
  font-weight: 700; letter-spacing: 3px; text-transform: uppercase;
}
.kpi-value { font-size: 30px; font-weight: 700; margin-bottom: 8px; letter-spacing: -1px; color: #141410; }
.kpi-delta { font-size: 12px; display: flex; align-items: center; gap: 4px; }
.kpi-delta.up { color: var(--green); }
.kpi-delta.down { color: var(--red); }
.kpi-delta.neutral { color: var(--text3); }
.kpi-icon { float: right; opacity: .08; margin-top: -4px; }

/* ─── CHARTS ──────────────────────────────────────────── */
.charts-row { display: flex; gap: 16px; margin-bottom: 24px; }
.chart-card {
  padding: 22px; flex: 1;
  transition: border-color var(--t), box-shadow var(--t);
}
.chart-card:hover { border-color: var(--border-hover); box-shadow: 0 12px 30px -16px rgba(20,20,16,.28); }
.chart-card.wide { flex: 2; }
.chart-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.chart-header h3 {
  font-family: var(--font-display);
  font-size: 13px; font-weight: 600; color: var(--text);
}
.chart-wrap { position: relative; height: 220px; }
.period-btns { display: flex; gap: 4px; }
.period-btn {
  padding: 4px 10px; border-radius: 7px;
  border: 1px solid var(--border);
  background: none; color: var(--text2); font-size: 12px;
  cursor: pointer; transition: all var(--t); font-weight: 500; font-family: var(--font-body);
}
.period-btn:hover { color: var(--text); border-color: rgba(238,90,56,.3); }
.period-btn.active {
  background: #EE5A38;
  border-color: var(--accent); color: white;
  box-shadow: 0 10px 24px -14px rgba(20,20,16,.28);
}

/* ─── POSTS ───────────────────────────────────────────── */
.posts-header { display: flex; align-items: baseline; gap: 12px; margin-bottom: 22px; }
.posts-header h3 { font-family: var(--font-display); font-size: 16px; font-weight: 700; }
.posts-subtitle { font-size: 12px; color: var(--text3); }
.posts-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 16px; }
.post-card {
  overflow: hidden;
  transition: transform var(--t), border-color var(--t), box-shadow var(--t);
}
.post-card:hover {
  transform: translateY(-3px);
  border-color: var(--border-hover);
  box-shadow: 0 12px 30px -16px rgba(20,20,16,.28);
}
.post-img { width: 100%; aspect-ratio: 1; object-fit: cover; background: var(--surface2); }
.post-img-placeholder {
  width: 100%; aspect-ratio: 1; background: var(--surface2);
  display: flex; align-items: center; justify-content: center; font-size: 32px;
}
.post-img-fallback {
  background: #141410;
  color: #F1F0E9;
  flex-direction: column;
  gap: 10px;
  padding: 26px;
  text-align: center;
  font-size: 13px;
}
.post-fallback-type {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 86px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--brand-lime);
  color: #141410;
  font-weight: 800;
}
.post-fallback-title {
  font-family: var(--font-display);
  font-size: 19px;
  line-height: 1.15;
  font-weight: 800;
  max-width: 220px;
}
.post-fallback-cta {
  padding: 7px 12px;
  border-radius: 999px;
  background: var(--brand-coral);
  color: #ffffff;
  font-weight: 800;
  font-size: 12px;
}
.post-body { padding: 16px; }
.post-caption {
  font-size: 12px; color: var(--text2); margin-bottom: 12px; line-height: 1.6;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.post-stats { display: flex; gap: 14px; }
.post-stat { display: flex; align-items: center; gap: 5px; font-size: 12px; color: var(--text2); }
.post-engagement { margin-top: 10px; }
.engagement-bar { height: 2px; background: var(--border); border-radius: 4px; overflow: hidden; }
.engagement-fill { height: 100%; border-radius: 4px; background: #EE5A38; }
.engagement-label { font-size: 11px; color: var(--text3); margin-top: 4px; }
.post-skeleton { height: 320px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); animation: pulse 1.5s infinite; }

/* ─── CLIENTS ─────────────────────────────────────────── */
.clients-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.clients-header h3 { font-family: var(--font-display); font-size: 16px; font-weight: 700; }
.discover-bar { margin-bottom: 20px; }
.clients-table { width: 100%; border-collapse: collapse; }
.clients-table th, .clients-table td { padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--border); }
.clients-table th {
  font-family: var(--font-display);
  font-size: 9px; font-weight: 700; letter-spacing: 3px;
  color: var(--accent-label); text-transform: uppercase;
}
.clients-table td { font-size: 13px; color: var(--text); }
.clients-table tr:hover td { background: rgba(238,90,56,0.04); }
.client-name-cell { display: flex; align-items: center; gap: 10px; }
.badge { display: inline-flex; align-items: center; padding: 3px 9px; border-radius: 99px; font-size: 11px; font-weight: 600; }
.badge-green { background: rgba(207,234,91,.12); color: var(--green); border: 1px solid rgba(207,234,91,.2); }
.badge-gray  { background: rgba(20,20,16,.04); color: var(--text3); border: 1px solid var(--border-subtle); }
.icon-btn { background: none; border: none; cursor: pointer; color: var(--text3); padding: 4px; border-radius: 6px; transition: all var(--t); }
.icon-btn:hover { color: var(--text); background: rgba(20,20,16,.06); }

/* ─── DISCOVERED ──────────────────────────────────────── */
.discovered-list { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 12px; }
.discovered-card { padding: 16px; min-width: 200px; }
.discovered-card h4 { font-size: 13px; margin-bottom: 6px; font-family: var(--font-display); }
.discovered-card p  { font-size: 11px; color: var(--text3); margin-bottom: 10px; }

/* ─── BUTTONS ─────────────────────────────────────────── */
.btn-primary {
  background: #EE5A38;
  color: white; border: none;
  padding: 9px 20px; border-radius: 10px; font-size: 13px; font-weight: 600;
  cursor: pointer; transition: all var(--t); font-family: var(--font-body);
  box-shadow: 0 12px 30px -16px rgba(20,20,16,.28);
}
.btn-primary:hover { box-shadow: 0 12px 30px -16px rgba(20,20,16,.28); transform: translateY(-1px); }
.btn-secondary {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(20,20,16,.04); color: var(--text2);
  border: 1px solid var(--border);
  padding: 8px 16px; border-radius: 10px; font-size: 13px; font-weight: 500;
  cursor: pointer; transition: all var(--t); font-family: var(--font-body);
}
.btn-secondary:hover { border-color: var(--border-hover); color: var(--accent); background: var(--accent-soft); }

/* ─── MODAL ───────────────────────────────────────────── */
.modal-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,.8); z-index: 100;
  align-items: center; justify-content: center;
  backdrop-filter: blur(8px);
}
.modal-overlay.open { display: flex; }
.modal-box {
  padding: 32px; width: 460px; max-width: 95vw;
  box-shadow: 0 12px 30px -16px rgba(20,20,16,.28);
  border-radius: 20px;
}
.modal-box h3 { font-family: var(--font-display); font-size: 16px; font-weight: 700; margin-bottom: 22px; }
.modal-box label { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; font-size: 12px; color: var(--text2); font-weight: 500; }
.modal-box input {
  background: rgba(20,20,16,.05); border: 1px solid var(--border);
  color: var(--text); padding: 10px 14px; border-radius: 10px;
  font-size: 13px; outline: none; font-family: var(--font-body);
  transition: all var(--t);
}
.modal-box input:focus { border-color: var(--accent); box-shadow: 0 12px 30px -16px rgba(20,20,16,.28); }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 8px; }
.form-error { color: var(--red); font-size: 12px; margin-top: 8px; min-height: 18px; }

/* ─── TOAST ───────────────────────────────────────────── */
.toast {
  position: fixed; bottom: 24px; right: 24px; z-index: 200;
  background: var(--surface-solid); border: 1px solid var(--border);
  color: var(--text); padding: 12px 20px; border-radius: 12px;
  font-size: 13px; font-weight: 500; pointer-events: none;
  opacity: 0; transform: translateY(10px); transition: all var(--t);
  box-shadow: 0 12px 30px -16px rgba(20,20,16,.28);
  backdrop-filter: blur(10px);
}
.toast.show { opacity: 1; transform: none; }

/* ─── EMPTY STATE ─────────────────────────────────────── */
.empty-state {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; padding: 70px 24px; color: var(--text3); text-align: center;
}
.empty-state svg { margin-bottom: 16px; opacity: .15; }
.empty-state h4 { font-family: var(--font-display); font-size: 15px; color: var(--text2); margin-bottom: 6px; font-weight: 700; }
.empty-state p { font-size: 13px; }

/* ─── AI ANALYSIS ─────────────────────────────────────── */
.ai-toolbar { display: flex; align-items: center; gap: 14px; margin-bottom: 28px; flex-wrap: wrap; }
.btn-ai-generate {
  display: inline-flex; align-items: center; gap: 8px;
  background: #EE5A38;
  color: white; border: none; padding: 10px 22px; border-radius: 10px;
  font-size: 13px; font-weight: 600; cursor: pointer; transition: all var(--t);
  box-shadow: 0 12px 30px -16px rgba(20,20,16,.28); font-family: var(--font-body);
}
.btn-ai-generate:hover { box-shadow: 0 12px 30px -16px rgba(20,20,16,.28); transform: translateY(-1px); }
.btn-ai-generate:disabled { opacity: .4; cursor: not-allowed; box-shadow: none; transform: none; }

.ai-empty {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; padding: 80px 24px; text-align: center; gap: 14px;
}
.ai-empty-icon { font-size: 56px; line-height: 1; }
.ai-empty h3 { font-family: var(--font-display); font-size: 20px; font-weight: 700; color: #141410; }
.ai-empty p { font-size: 14px; color: var(--text2); max-width: 440px; line-height: 1.7; }
.ai-model-badge {
  display: inline-block; background: rgba(20,20,16,.04);
  border: 1px solid var(--border); color: var(--text3);
  font-size: 11px; padding: 4px 12px; border-radius: 99px; margin-top: 4px; letter-spacing: .5px;
}
.ai-loading { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 80px 24px; gap: 18px; }
.ai-spinner { width: 44px; height: 44px; border: 2px solid var(--border); border-top-color: var(--accent); border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.ai-loading p { color: var(--text2); font-size: 14px; margin: 0; }
.ai-loading-sub { color: var(--text3); font-size: 12px; margin: 0; }

.ai-stream-header { display: flex; align-items: center; gap: 10px; color: var(--text2); font-size: 13px; margin-bottom: 14px; padding: 12px 16px; background: rgba(183,175,227,.06); border: 1px solid rgba(183,175,227,.2); border-radius: 8px; }
.ai-stream-header.done { background: rgba(207,234,91,.06); border-color: rgba(207,234,91,.2); color: #141410; }
.ai-stream-output {
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0;
  font-family: inherit;
  font-size: 14px;
  line-height: 1.7;
  color: var(--text1);
  word-wrap: break-word;
  overflow-wrap: break-word;
  max-height: 74vh;
  overflow-y: auto;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* ── AI analysis cards — redesigned ────────────────────────────── */
.ai-acard {
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: 0 2px 10px rgba(0,0,0,.07);
  background: var(--bg1);
}
.ai-acard-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 18px;
  /* background set inline per section */
}
.ai-acard-emoji { font-size: 18px; line-height: 1; flex-shrink: 0; }
.ai-acard-title {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  color: #141410;
  letter-spacing: -.01em;
  line-height: 1.3;
}
.ai-acard-body {
  padding: 16px 18px;
  background: var(--bg1);
}
/* Metric chips row */
.ai-metrics-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}
.ai-metric-chip {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 9px 13px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 10px;
  min-width: 80px;
}
.ai-metric-chip-lbl {
  font-size: 10px;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: .05em;
  font-weight: 600;
}
.ai-metric-chip-val {
  font-size: 15px;
  font-weight: 700;
  color: var(--text1);
  font-family: var(--font-display);
  line-height: 1.2;
}
/* Body text */
.ai-acard-body p {
  font-size: 13.5px;
  color: var(--text1);
  line-height: 1.65;
  margin: 0 0 10px;
}
.ai-acard-body p:last-child { margin-bottom: 0; }
.ai-acard-body strong { color: var(--text1); font-weight: 700; }
.ai-acard-body em { color: var(--text2); font-style: italic; }
/* Bullet lists */
.ai-acard-body ul {
  list-style: none;
  padding: 0;
  margin: 0 0 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.ai-acard-body ul:last-child { margin-bottom: 0; }
.ai-acard-body ul li {
  font-size: 13px;
  color: var(--text1);
  line-height: 1.55;
  padding: 9px 12px 9px 30px;
  position: relative;
  background: var(--bg2);
  border-radius: 8px;
  border: 1px solid var(--border);
}
.ai-acard-body ul li::before {
  content: "→";
  position: absolute;
  left: 10px;
  color: var(--text3);
  font-size: 12px;
  font-weight: 700;
}
.ai-acard-body ol {
  padding-left: 20px;
  margin: 0 0 10px;
}
.ai-acard-body ol li {
  font-size: 13px;
  color: var(--text1);
  line-height: 1.55;
  margin-bottom: 6px;
}
/* Sub-headings within sections */
.ai-acard-body h3 {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text3);
  font-weight: 700;
  margin: 14px 0 6px;
}
.ai-acard-body h4 {
  font-size: 13px;
  font-weight: 700;
  color: var(--text1);
  margin: 10px 0 4px;
}
/* Intro card (no header) */
.ai-acard-intro {
  border-left: 4px solid #EE5A38;
  padding: 16px 18px;
}
.ai-acard-intro p {
  font-size: 13.5px;
  color: var(--text1);
  line-height: 1.65;
  margin: 0 0 8px;
}
.ai-acard-intro p:last-child { margin-bottom: 0; }
/* Wrapper grid */
.ai-acards-wrap {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
/* During streaming: plain markdown style */
.ai-stream-output.streaming { background: #ffffff; border: 1px solid rgba(20,20,16,.12); border-radius:10px; padding:24px 28px; color:#141410; display:block; }

/* Estilos markdown dentro del output de streaming */
.ai-stream-markdown h1 {
  font-family: var(--font-display); font-weight: 700; color: #141410;
  font-size: 18px; margin: 20px 0 10px;
  border-bottom: 1px solid rgba(238,90,56,.25); padding-bottom: 8px; line-height: 1.3;
}
.ai-stream-markdown h2 {
  font-family: var(--font-display); font-weight: 700; color: #141410;
  font-size: 16px; margin: 18px 0 8px; line-height: 1.3;
}
.ai-stream-markdown h3 {
  font-family: var(--font-display); font-weight: 700; color: #141410;
  font-size: 13px; text-transform: uppercase; letter-spacing: .07em; margin: 14px 0 6px;
}
.ai-stream-markdown p { margin: 0 0 10px; color: #141410; }
.ai-stream-markdown ul { padding-left: 0; margin: 0 0 12px; list-style: none; }
.ai-stream-markdown ol { padding-left: 20px; margin: 0 0 12px; }
.ai-stream-markdown ul li { margin-bottom: 6px; padding-left: 18px; position: relative; color: #141410; }
.ai-stream-markdown ul li::before { content: "•"; position: absolute; left: 0; color: #141410; font-weight: 700; }
.ai-stream-markdown ol li { margin-bottom: 6px; color: #141410; }
.ai-stream-markdown strong { color: #141410; font-weight: 700; }
.ai-stream-markdown em { color: #55554c; font-style: italic; }
.ai-stream-markdown code {
  background: rgba(20,20,16,.06); color: #141410;
  padding: 2px 6px; border-radius: 4px; font-size: 12px;
  font-family: var(--font-body);
}
.ai-stream-markdown pre {
  background: rgba(20,20,16,.05); border: 1px solid rgba(20,20,16,.12);
  border-radius: 8px; padding: 14px 18px; overflow-x: auto; margin: 0 0 12px;
}
.ai-stream-markdown pre code { background: none; padding: 0; color: #141410; font-size: 12px; }
.ai-stream-markdown hr { border: none; border-top: 1px solid rgba(20,20,16,.12); margin: 18px 0; }
.ai-stream-markdown blockquote {
  border-left: 3px solid #141410; padding-left: 14px; color: #55554c; margin: 0 0 10px;
}

/* Tablas de los reportes IA — antes salían sin estilo (cuadros ilegibles) */
.ai-stream-markdown table, .ai-acard-body table {
  width: 100%; border-collapse: collapse; margin: 6px 0 16px;
  font-size: 12.5px; background: #ffffff;
  border: 1px solid rgba(20,20,16,.12); border-radius: 10px; overflow: hidden;
}
.ai-stream-markdown thead th, .ai-acard-body thead th {
  text-align: left; padding: 10px 13px; background: #141410; color: #ffffff;
  font-family: var(--font-display); font-weight: 700; font-size: 10.5px;
  text-transform: uppercase; letter-spacing: .04em; white-space: nowrap;
}
.ai-stream-markdown tbody td, .ai-acard-body tbody td {
  padding: 9px 13px; border-top: 1px solid rgba(20,20,16,.08);
  color: #141410; vertical-align: top; line-height: 1.4;
}
.ai-stream-markdown tbody tr:nth-child(even) td,
.ai-acard-body tbody tr:nth-child(even) td { background: rgba(20,20,16,.025); }
.ai-stream-markdown tbody td:first-child,
.ai-acard-body tbody td:first-child { font-weight: 600; white-space: nowrap; }
.ai-stream-markdown table strong, .ai-acard-body table strong { color: #141410; }

.ai-stream-toggle { display: flex; align-items: center; gap: 6px; background: none; border: 1px solid var(--border); color: var(--text3); font-size: 12px; padding: 6px 12px; border-radius: 6px; cursor: pointer; margin-top: 10px; transition: color .15s, border-color .15s; }
.ai-stream-toggle:hover { color: var(--text2); border-color: var(--border-hover); }
.ai-stream-toggle svg { transition: transform .2s; }
.ai-stream-toggle.expanded svg { transform: rotate(180deg); }
#ai-stream-collapse { overflow: hidden; transition: max-height .35s ease; }
#ai-stream-collapse.collapsed { max-height: 0 !important; }

.ai-result-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 22px; }
.ai-result-meta { font-size: 12px; color: var(--text3); }
.ai-result-meta strong { color: var(--text2); }

/* ── AI SUMMARY + ESTADO ─────────────────────────────────── */
.ai-summary-row { display: flex; gap: 16px; margin-bottom: 20px; }
.ai-summary-card { flex: 2; padding: 22px; border: 1px solid rgba(238,90,56,.25); border-top: 3px solid #EE5A38; border-radius: 12px; }
.ai-summary-card p { font-size: 14px; color: #141410; line-height: 1.85; margin: 0; }
.ai-summary-card > p:first-of-type { font-size: 11px; color: #A0A0B8; text-transform: uppercase; letter-spacing: .08em; font-weight: 700; margin-bottom: 8px; }

/* Estado general — círculo de color con glow */
.ai-estado-card { display: flex; align-items: center; gap: 16px; padding: 24px; flex: 1; border-radius: 12px; }
.estado-excelente { border: 1px solid rgba(207,234,91,.35);  background: rgba(207,234,91,.07); }
.estado-bueno     { border: 1px solid rgba(238,90,56,.35);   background: rgba(238,90,56,.07); }
.estado-regular   { border: 1px solid rgba(203,166,215,.35);  background: rgba(203,166,215,.07); }
.estado-critico, .estado-crítico { border: 1px solid rgba(238,90,56,.35); background: rgba(238,90,56,.07); }

.ai-estado-dot { width: 20px; height: 20px; border-radius: 50%; flex-shrink: 0; }
.estado-excelente .ai-estado-dot { background: #CFEA5B; box-shadow: none; }
.estado-bueno     .ai-estado-dot { background: #B7AFE3; box-shadow: none; }
.estado-regular   .ai-estado-dot { background: #C0A2E5; box-shadow: none; }
.estado-critico   .ai-estado-dot, .estado-crítico .ai-estado-dot { background: #EE5A38; box-shadow: none; }

.ai-estado-label { font-family: var(--font-display); font-size: 9px; color: #A0A0B8; text-transform: uppercase; letter-spacing: 3px; font-weight: 700; margin-bottom: 4px; }
.ai-estado-value { font-family: var(--font-display); font-size: 20px; font-weight: 700; color: #141410; }
.estado-excelente .ai-estado-value { color: #34d399; }
.estado-bueno     .ai-estado-value { color: #B7AFE3; }
.estado-regular   .ai-estado-value { color: #141410; }
.estado-critico   .ai-estado-value, .estado-crítico .ai-estado-value { color: #f87171; }

/* ── Legacy ai-card aliases (kept for compatibility) ─────────── */
.ai-card { overflow: hidden; border-radius: 12px; border: 1px solid var(--border); background: var(--bg1); }
.ai-card-header { display: flex; align-items: center; gap: 10px; padding: 14px 16px 10px; }
.ai-card-icon { font-size: 18px; }
.ai-card-header h4 { font-family: var(--font-display); font-size: 13px; font-weight: 700; color: var(--text1); margin: 0; }
.ai-card-body { padding: 14px 16px; color: var(--text1); font-size: 13px; }
.ai-card-body ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.ai-card-body li { font-size: 13px; color: var(--text1); line-height: 1.55; padding: 8px 12px; background: var(--bg2); border-radius: 8px; border: 1px solid var(--border); }
.ai-item-name   { font-weight: 600; color: var(--text1); display: block; margin-bottom: 4px; }
.ai-item-detail { font-size: 12px; color: var(--text2); display: block; }
.ai-item-sub    { font-size: 11px; color: var(--text3); display: block; margin-top: 4px; }
.ai-empty-list  { font-size: 12px; color: var(--text3); font-style: italic; padding: 4px 0; }

.ai-recs-section { margin-bottom: 24px; }
.ai-recs-section h3 { font-family: var(--font-display); font-size: 15px; font-weight: 700; margin-bottom: 14px; color: #141410; }
#ai-recs { display: flex; flex-direction: column; gap: 10px; }
.ai-rec {
  padding: 14px 18px; border-radius: 12px;
  display: flex; align-items: flex-start; gap: 12px;
  background: rgba(20,20,16,.03);
  transition: border-color var(--t), box-shadow var(--t);
}
.ai-rec:hover { border-color: var(--border-hover); box-shadow: 0 12px 30px -16px rgba(20,20,16,.28); }
/* Borde izquierdo según prioridad para escaneo visual rápido */
.ai-rec:has(.priority-alta)  { border-left: 3px solid #EE5A38; }
.ai-rec:has(.priority-media) { border-left: 3px solid #C0A2E5; }
.ai-rec:has(.priority-baja)  { border-left: 3px solid rgba(20,20,16,.15); }
.ai-rec-priority {
  flex-shrink: 0; padding: 4px 12px; border-radius: 99px;
  font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: 1.5px; margin-top: 1px;
  font-family: var(--font-display);
}
.priority-alta  { background: rgba(238,90,56,.18); color: #f87171; border: 1px solid rgba(238,90,56,.35); }
.priority-media { background: rgba(203,166,215,.18); color: #141410; border: 1px solid rgba(203,166,215,.35); }
.priority-baja  { background: rgba(20,20,16,.06); color: #A0A0B8; border: 1px solid rgba(20,20,16,.12); }
.ai-rec-content { flex: 1; }
.ai-rec-action  { font-size: 13px; font-weight: 600; color: #141410; margin-bottom: 5px; }
.ai-rec-impact  { font-size: 12px; color: #55554c; line-height: 1.5; }

.ai-metrics-eval { padding: 0 0 24px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.ai-metric-item { background: rgba(238,90,56,.06); border: 1px solid rgba(238,90,56,.2); border-radius: 10px; padding: 14px 16px; }
.ai-metric-name { font-family: var(--font-display); font-size: 9px; color: #A0A0B8; text-transform: uppercase; letter-spacing: 2.5px; margin-bottom: 8px; font-weight: 700; }
.ai-metric-eval { font-size: 13px; color: #141410; line-height: 1.5; }

/* ─── AI EXTENDED ─────────────────────────────────────── */
.ai-ext-section { padding: 24px; margin-bottom: 20px; transition: border-color var(--t), box-shadow var(--t); }
.ai-ext-section:hover { border-color: var(--border-hover); box-shadow: 0 12px 30px -16px rgba(20,20,16,.28); }
.ai-ext-header { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
.ai-ext-icon { font-size: 18px; line-height: 1; }
.ai-ext-header h3 { font-family: var(--font-display); font-size: 15px; font-weight: 700; color: var(--text); margin: 0; }
.ai-ext-subtitle { font-size: 12px; color: var(--text3); }
.ai-ext-footer { margin-top: 16px; padding: 12px 16px; background: rgba(20,20,16,.03); border: 1px solid var(--border-subtle); border-radius: 10px; font-size: 13px; color: var(--text2); line-height: 1.5; }

/* Segmentación */
.ai-seg-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.ai-seg-col h4 { font-family: var(--font-display); font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: 3px; margin-bottom: 12px; }
.ai-seg-best h4  { color: #141410; }
.ai-seg-worst h4 { color: #EE5A38; }
.ai-seg-item { background: rgba(20,20,16,.04); border: 1px solid var(--border-subtle); border-radius: 10px; padding: 12px 14px; margin-bottom: 8px; }
.ai-seg-name    { font-size: 13px; font-weight: 600; color: #141410; margin-bottom: 3px; }
.ai-seg-metric  { font-size: 12px; color: var(--accent); margin-bottom: 2px; }
.ai-seg-reason  { font-size: 12px; color: var(--text2); }
.ai-seg-problem { font-size: 12px; color: var(--red); margin-bottom: 2px; }
.ai-seg-action  { font-size: 12px; color: var(--text3); }

/* Tabla de anuncios AI */
.ai-table-wrap { overflow-x: auto; }
.ai-ads-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.ai-ads-table th { padding: 8px 12px; text-align: left; background: rgba(20,20,16,.04); color: var(--accent-label); font-family: var(--font-display); font-weight: 700; text-transform: uppercase; letter-spacing: 2px; font-size: 9px; white-space: nowrap; }
.ai-ads-table td { padding: 9px 12px; border-bottom: 1px solid var(--border-subtle); color: var(--text); vertical-align: top; }
.ai-ads-table tr:hover td { background: rgba(238,90,56,.04); }
.ai-ads-table td:first-child { font-weight: 600; max-width: 200px; }
.ad-clasificacion { display: inline-flex; align-items: center; padding: 3px 9px; border-radius: 99px; font-size: 11px; font-weight: 700; white-space: nowrap; }
.ad-ganador  { background: rgba(207,234,91,.12); color: #141410; border: 1px solid rgba(207,234,91,.2); }
.ad-promedio { background: rgba(238,90,56,.12);  color: var(--accent); border: 1px solid rgba(238,90,56,.2); }
.ad-perdedor { background: rgba(238,90,56,.12);  color: #EE5A38; border: 1px solid rgba(238,90,56,.2); }
.ad-razon { font-size: 11px; color: var(--text2); max-width: 180px; line-height: 1.4; }
.ad-accion{ font-size: 11px; color: var(--text3); max-width: 160px; line-height: 1.4; }

/* Creatividades */
.ai-creative-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }
.ai-creative-winner {
  background: rgba(238,90,56,.10);
  border: 1px solid rgba(238,90,56,.3); border-radius: 12px; padding: 18px;
  box-shadow: 0 12px 30px -16px rgba(20,20,16,.28);
}
.ai-creative-winner .ai-c-label { font-family: var(--font-display); font-size: 9px; font-weight: 700; color: var(--accent); text-transform: uppercase; letter-spacing: 3px; margin-bottom: 8px; }
.ai-creative-winner .ai-c-value { font-family: var(--font-display); font-size: 16px; font-weight: 700; color: #141410; }
.ai-creative-patterns, .ai-creative-test { background: rgba(20,20,16,.04); border: 1px solid var(--border-subtle); border-radius: 12px; padding: 16px; }
.ai-c-section-title { font-size: 12px; font-weight: 600; color: var(--text2); margin-bottom: 10px; }
.ai-c-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; }
.ai-c-list li { font-size: 12px; color: var(--text); line-height: 1.5; }
.ai-c-list li::before { content: "→ "; color: var(--accent); }

/* Presupuesto */
.ai-budget-flow { display: flex; align-items: center; gap: 12px; background: rgba(20,20,16,.04); border: 1px solid var(--border-subtle); border-radius: 12px; padding: 14px 16px; margin-bottom: 10px; }
.ai-budget-from, .ai-budget-to { flex: 1; }
.ai-budget-arrow { color: var(--accent); font-size: 18px; flex-shrink: 0; }
.ai-budget-label { font-family: var(--font-display); font-size: 9px; color: var(--text3); text-transform: uppercase; letter-spacing: 2px; margin-bottom: 3px; font-weight: 700; }
.ai-budget-name  { font-size: 13px; font-weight: 600; color: #141410; }
.ai-budget-monto { font-size: 14px; font-weight: 700; color: var(--green); margin: 0 16px; white-space: nowrap; }
.ai-budget-why   { font-size: 11px; color: var(--text3); margin-top: 4px; }
.ai-budget-summary { margin-top: 14px; padding: 14px 16px; background: rgba(238,90,56,.06); border: 1px solid rgba(238,90,56,.2); border-radius: 12px; font-size: 13px; color: var(--text); line-height: 1.5; }
.ai-budget-ideal { font-size: 12px; color: var(--accent); font-weight: 600; margin-bottom: 6px; }

/* Frecuencia */
.ai-freq-alert { background: rgba(238,90,56,.05); border: 1px solid rgba(238,90,56,.18); border-radius: 12px; padding: 14px 16px; margin-bottom: 10px; }
.ai-freq-alert-severe { background: rgba(238,90,56,.10); border-color: rgba(238,90,56,.3); }
.ai-freq-name { font-size: 13px; font-weight: 600; color: #141410; margin-bottom: 4px; }
.ai-freq-badge { display: inline-flex; align-items: center; gap: 4px; background: rgba(238,90,56,.12); color: #EE5A38; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 99px; margin-bottom: 6px; border: 1px solid rgba(238,90,56,.2); }
.ai-freq-diag   { font-size: 12px; color: var(--text2); margin-bottom: 4px; }
.ai-freq-action { font-size: 12px; color: var(--text3); }
.ai-freq-healthy { margin-top: 12px; padding: 12px 14px; background: rgba(207,234,91,.06); border: 1px solid rgba(207,234,91,.18); border-radius: 12px; }
.ai-freq-healthy-title { font-family: var(--font-display); font-size: 9px; font-weight: 700; color: #141410; margin-bottom: 8px; letter-spacing: 2px; text-transform: uppercase; }
.ai-freq-healthy-list { display: flex; flex-wrap: wrap; gap: 8px; }
.ai-freq-healthy-item { background: rgba(207,234,91,.10); color: #141410; border-radius: 99px; padding: 3px 10px; font-size: 11px; font-weight: 600; border: 1px solid rgba(207,234,91,.2); }

@media (max-width: 900px) {
  .ai-seg-grid { grid-template-columns: 1fr; }
  .ai-creative-grid { grid-template-columns: 1fr; }
  .ai-budget-flow { flex-direction: column; align-items: flex-start; }
}

/* ─── ADS ─────────────────────────────────────────────── */
.ads-toolbar { display: flex; align-items: center; gap: 14px; margin-bottom: 24px; flex-wrap: wrap; }
.ads-account-selector { display: flex; align-items: center; gap: 10px; }
.ads-account-selector label { font-family: var(--font-display); font-size: 9px; color: var(--accent-label); font-weight: 700; letter-spacing: 3px; text-transform: uppercase; }
.ads-account-selector select { background: rgba(20,20,16,.04); border: 1px solid var(--border); color: var(--text); padding: 8px 14px; border-radius: 10px; font-size: 13px; cursor: pointer; outline: none; min-width: 200px; transition: border-color var(--t); font-family: var(--font-body); }
.ads-account-selector select:focus { border-color: var(--accent); }
.ads-period-btns { display: flex; gap: 4px; }
.ads-section-title { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.ads-section-title h3 { font-family: var(--font-display); font-size: 15px; font-weight: 700; }
.campaigns-table-wrap { overflow-x: auto; margin-bottom: 8px; background: #ffffff; border: 1px solid rgba(20,20,16,.09); border-radius: 12px; }
.campaigns-table-wrap .clients-table th { background: #ffffff; color: #6b6f5a; }
.campaigns-table-wrap .clients-table td { color: #141410; }
.status-dot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 20px;
  padding: 2px 9px;
  border-radius: 12px;
  border: none;
  white-space: nowrap;
  font-size: 10.5px;
  line-height: 1.25;
  font-weight: 600;
  color: #141410;
}
.status-dot::before { content: none; }
.status-dot.status-active,
.status-dot.status-paused,
.status-dot.status-archived {
  color: #141410;
}
.status-dot.status-active   { background: var(--green); }
.status-dot.status-paused   { background: var(--yellow); }
.status-dot.status-archived { background: var(--red); }
.ad-card {
  overflow: hidden;
  transition: transform var(--t), border-color var(--t), box-shadow var(--t);
}
.ad-card:hover { transform: translateY(-3px); border-color: var(--border-hover); box-shadow: 0 12px 30px -16px rgba(20,20,16,.28); }
.ad-thumb { width: 100%; aspect-ratio: 1.5; object-fit: cover; background: rgba(20,20,16,.04); }
.ad-thumb-placeholder { width: 100%; aspect-ratio: 1.5; background: rgba(20,20,16,.04); display: flex; align-items: center; justify-content: center; font-size: 28px; color: var(--text3); }
.ad-body { padding: 14px; }
.ad-name { font-size: 12px; font-weight: 600; color: #141410; margin-bottom: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ad-title { font-size: 11px; color: var(--text2); margin-bottom: 10px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ad-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.ad-stat { background: rgba(20,20,16,.04); border: 1px solid var(--border-subtle); border-radius: 8px; padding: 6px 10px; }
.ad-stat-label { font-family: var(--font-display); font-size: 9px; color: var(--text3); margin-bottom: 2px; letter-spacing: 1.5px; text-transform: uppercase; }
.ad-stat-value { font-size: 13px; font-weight: 700; color: #141410; }
.account-status-badge { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 99px; font-size: 11px; font-weight: 600; }
.status-1 { background: rgba(207,234,91,.12); color: var(--green); border: 1px solid rgba(207,234,91,.2); }
.status-9 { background: rgba(203,166,215,.12); color: var(--yellow); }
.status-2, .status-101 { background: rgba(238,90,56,.12); color: var(--red); }

/* ─── HEALTH / ANÁLISIS DE SANGRE ─────────────────────── */
.campaign-row { cursor: pointer; transition: background var(--t); }
.campaign-row:hover td { background: rgba(238,90,56,.04); }
.campaign-expand-icon { font-size: 9px; color: var(--text3); margin-right: 5px; transition: color var(--t); }
.campaign-row:hover .campaign-expand-icon { color: var(--accent); }

.health-badge-loading { color: var(--text3); font-size: 11px; }
.health-score-badge {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 24px; border-radius: 8px;
  font-size: 12px; font-weight: 800; cursor: default; font-family: var(--font-display);
}
.health-saludable {
  background: #CFEA5B; color: #141410;
  box-shadow: none;
  border: none;
}
.health-atencion {
  background: #C0A2E5; color: #141410;
  box-shadow: none;
  border: none;
}
.health-critico {
  background: #EE5A38; color: #ffffff;
  box-shadow: none;
  border: none;
}

.health-detail-row td { padding: 0 !important; }
.health-detail-cell { padding: 0 !important; }
.health-panel {
  padding: 22px 28px;
  background: #F1F0E9;
  border-top: 1px solid rgba(20,20,16,.1);
  border-bottom: 1px solid rgba(20,20,16,.1);
  /* queda fijo al borde izquierdo aunque la tabla scrollee horizontalmente */
  position: sticky;
  left: 0;
  width: calc(100vw - 320px);
  max-width: 100%;
  box-sizing: border-box;
}
.health-panel-loading { color: var(--text3); font-size: 13px; padding: 8px 0; }

.health-overview { display: flex; align-items: center; gap: 20px; margin-bottom: 18px; padding-bottom: 18px; border-bottom: 1px solid var(--border-subtle); }
.health-score-ring {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  width: 76px; height: 76px; border-radius: 50%; border: none; flex-shrink: 0;
}
.health-score-ring.health-saludable { background: #CFEA5B; color: #141410; box-shadow: none; }
.health-score-ring.health-atencion  { background: #C0A2E5; color: #141410; box-shadow: none; }
.health-score-ring.health-critico   { background: #EE5A38; color: #ffffff; box-shadow: none; }
.health-score-num  { font-family: var(--font-display); font-size: 24px; font-weight: 700; line-height: 1; }
.health-score-word { font-family: var(--font-display); font-size: 8px; font-weight: 700; text-transform: uppercase; letter-spacing: 1.5px; color: currentColor; opacity: .72; margin-top: 2px; }
.health-saludable .health-score-num,
.health-atencion .health-score-num { color: #141410; }
.health-critico .health-score-num { color: #ffffff; }
.health-context { display: flex; flex-direction: column; gap: 8px; }
.health-type-badge { display: inline-flex; align-items: center; gap: 5px; padding: 5px 12px; border-radius: 99px; color: #141410; font-size: 12px; font-weight: 600; border: none; }
.health-type-badge.health-saludable { background: #CFEA5B; color: #141410; }
.health-type-badge.health-atencion { background: #C0A2E5; color: #141410; }
.health-type-badge.health-critico { background: #EE5A38; color: #ffffff; }
.health-weight-note { font-size: 11px; color: var(--text3); }
.health-note { font-size: 12px; color: var(--text2); background: rgba(238,90,56,.06); border: 1px solid rgba(238,90,56,.18); border-radius: 10px; padding: 8px 14px; margin-bottom: 12px; line-height: 1.5; }
.health-note-warn { background: rgba(203,166,215,.06); border-color: rgba(203,166,215,.2); }

.blood-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 10px; }
.blood-card {
  border-radius: 10px;
  padding: 14px 16px;
  border: none;
  background: #ffffff;
  box-shadow: none;
}
.blood-card[style*="background:#EE5A38"],
.blood-card[style*="background: #EE5A38"],
.blood-card[style*="background: rgb(238, 90, 56)"] {
  color: #ffffff !important;
}
.blood-card-critico,
.blood-card-critico .blood-name,
.blood-card-critico .blood-value,
.blood-card-critico .blood-status,
.blood-card-critico .blood-interp,
.blood-card-critico .blood-accion {
  color: #ffffff !important;
}
.blood-card-critico .blood-status {
  background: rgba(255,255,255,.18);
}
.blood-card-critico .blood-accion {
  border-top-color: rgba(255,255,255,.28);
}
.blood-card[style*="background:#EE5A38"] .blood-name,
.blood-card[style*="background:#EE5A38"] .blood-value,
.blood-card[style*="background:#EE5A38"] .blood-status,
.blood-card[style*="background:#EE5A38"] .blood-interp,
.blood-card[style*="background:#EE5A38"] .blood-accion,
.blood-card[style*="background: #EE5A38"] .blood-name,
.blood-card[style*="background: #EE5A38"] .blood-value,
.blood-card[style*="background: #EE5A38"] .blood-status,
.blood-card[style*="background: #EE5A38"] .blood-interp,
.blood-card[style*="background: #EE5A38"] .blood-accion {
  color: #ffffff !important;
}
.blood-header { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
.blood-name   { font-family: var(--font-display); font-size: 10px; font-weight: 700; color: #141410; flex: 1; letter-spacing: 1px; text-transform: uppercase; }
.blood-value  { font-family: var(--font-display); font-size: 14px; font-weight: 700; color: #141410; }
.blood-status { font-family: var(--font-display); font-size: 8px; font-weight: 700; letter-spacing: 1.5px; padding: 2px 7px; border-radius: 4px; background: rgba(20,20,16,.10); color: #141410; text-transform: uppercase; }
.blood-interp { font-size: 12px; color: rgba(20,20,16,.78); line-height: 1.5; margin-bottom: 6px; }
.blood-accion { font-size: 11px; color: rgba(20,20,16,.62); line-height: 1.4; border-top: 1px solid rgba(20,20,16,.12); padding-top: 6px; margin-top: 4px; }
@media (max-width: 900px) { .blood-grid { grid-template-columns: 1fr 1fr; } }

/* ─── AGENTE DE OPTIMIZACIÓN ──────────────────────────── */
.agent-toolbar { display: flex; align-items: center; gap: 14px; margin-bottom: 22px; flex-wrap: wrap; }
.btn-agent-analyze {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 22px; border-radius: 10px; font-size: 13px; font-weight: 600;
  background: #EE5A38; color: #141410;
  border: none; cursor: pointer; transition: all var(--t); font-family: var(--font-body);
  box-shadow: 0 12px 30px -16px rgba(20,20,16,.28);
}
.btn-agent-analyze:hover { box-shadow: 0 12px 30px -16px rgba(20,20,16,.28); transform: translateY(-1px); }
.btn-agent-analyze:disabled { opacity: .4; cursor: not-allowed; box-shadow: none; transform: none; }
.agent-tabs { display: flex; gap: 0; border-bottom: 1px solid var(--border); margin-bottom: 22px; }
.agent-tab {
  padding: 10px 18px; background: none; border: none; border-bottom: 2px solid transparent;
  color: var(--text2); font-size: 13px; font-weight: 500; cursor: pointer;
  transition: all var(--t); margin-bottom: -1px; display: flex; align-items: center; gap: 6px;
  font-family: var(--font-body);
}
.agent-tab:hover { color: var(--text); }
.agent-tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.agent-tab-badge { background: #EE5A38; color: #141410; font-size: 10px; font-weight: 700; padding: 1px 7px; border-radius: 99px; min-width: 18px; text-align: center; }
.agent-tab-content { display: none; }
.agent-tab-content.active { display: block; }
.agent-proposals-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; flex-wrap: wrap; gap: 10px; }
.agent-count-badge {
  display: inline-flex; align-items: center; padding: 5px 12px;
  border-radius: 999px; font-size: 12px; font-weight: 700;
  background: #141410; color: #F1F0E9; border: 0; margin-right: 8px;
}
.agent-count-high { background: var(--brand-lime); color: #141410; border: 0; }
.btn-approve-all {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 18px; border-radius: 10px; background: #CFEA5B;
  color: #141410; border: none; font-size: 13px; font-weight: 600;
  cursor: pointer; transition: all var(--t); font-family: var(--font-body);
  box-shadow: none;
}
.btn-approve-all:hover { box-shadow: none; transform: translateY(-1px); }
.btn-approve-all:disabled { opacity: .4; cursor: not-allowed; box-shadow: none; transform: none; }
.proposal-card {
  padding: 20px 22px; margin-bottom: 12px;
  border: 0 !important;
  border-radius: 16px;
  transition: transform var(--t), box-shadow var(--t);
}
.proposal-card:nth-child(4n+1) { background: var(--brand-lime) !important; color: #141410; }
.proposal-card:nth-child(4n+2) { background: var(--brand-violet) !important; color: #141410; }
.proposal-card:nth-child(4n+3) { background: var(--brand-blue) !important; color: #ffffff; }
.proposal-card:nth-child(4n+4) { background: var(--brand-coral) !important; color: #ffffff; }
.proposal-card:hover { transform: translateY(-1px); box-shadow: 0 14px 30px -18px rgba(20,20,16,.32); }
.proposal-card.proposal-executed { opacity: .55; border-color: rgba(207,234,91,.3); }
.proposal-card.proposal-ignored  { opacity: .35; }
.proposal-card.proposal-error    { border-color: rgba(238,90,56,.3); }
.proposal-badges { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.proposal-tipo-badge,
.proposal-conf-badge,
.proposal-exec-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 24px; padding: 4px 12px; border-radius: 999px;
  font-size: 11px; font-weight: 800; border: 0;
}
.proposal-chip-lime, .proposal-exec-badge { background: var(--brand-lime); color: #141410; }
.proposal-chip-violet { background: var(--brand-violet); color: #141410; }
.proposal-chip-coral, .exec-manual { background: var(--brand-coral) !important; color: #ffffff !important; }
.proposal-chip-blue { background: var(--brand-blue); color: #ffffff; }
.proposal-chip-neutral { background: #141410; color: #F1F0E9; }
.proposal-card:nth-child(4n+1) .proposal-badges > span,
.proposal-card:nth-child(4n+2) .proposal-badges > span {
  background: #141410 !important;
  color: #F1F0E9 !important;
}
.proposal-card:nth-child(4n+3) .proposal-badges > span,
.proposal-card:nth-child(4n+4) .proposal-badges > span {
  background: #F1F0E9 !important;
  color: #141410 !important;
}
.proposal-object { font-family: var(--font-display); font-size: 14px; font-weight: 800; color: currentColor; margin-bottom: 4px; }
.proposal-accion { font-size: 13px; color: currentColor; opacity: .78; margin-bottom: 12px; }
.proposal-detail { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.proposal-razon, .proposal-impacto { display: flex; gap: 8px; font-size: 12px; color: currentColor; line-height: 1.5; opacity: .86; }
.proposal-detail-icon { flex-shrink: 0; font-size: 14px; }
.proposal-footer { display: flex; gap: 10px; align-items: center; }
.btn-approve {
  padding: 8px 20px; border-radius: 10px;
  background: #CFEA5B;
  color: #141410; border: none; font-size: 13px; font-weight: 600;
  cursor: pointer; transition: all var(--t); text-decoration: none;
  display: inline-flex; align-items: center; font-family: var(--font-body);
  box-shadow: none;
}
.btn-approve:hover { box-shadow: none; transform: translateY(-1px); }
.btn-approve:disabled { opacity: .4; cursor: not-allowed; box-shadow: none; transform: none; }
.btn-manual { background: #EE5A38 !important; box-shadow: 0 10px 24px -14px rgba(20,20,16,.28) !important; }
.proposal-card:nth-child(4n+1) .btn-approve,
.proposal-card:nth-child(4n+2) .btn-approve {
  background: #141410 !important;
  color: #F1F0E9 !important;
}
.proposal-card:nth-child(4n+3) .btn-approve,
.proposal-card:nth-child(4n+4) .btn-approve {
  background: #F1F0E9 !important;
  color: #141410 !important;
}
.btn-ignore { padding: 8px 16px; border-radius: 10px; background: #F1F0E9; color: #141410; border: 0; font-size: 13px; font-weight: 700; cursor: pointer; transition: all var(--t); font-family: var(--font-body); }
.btn-ignore:hover { background: #141410; color: #F1F0E9; }
.proposal-card:nth-child(4n+1) .btn-ignore,
.proposal-card:nth-child(4n+2) .btn-ignore {
  background: rgba(20,20,16,.12);
  color: #141410;
}
.proposal-card:nth-child(4n+3) .btn-ignore,
.proposal-card:nth-child(4n+4) .btn-ignore {
  background: rgba(241,240,233,.18);
  color: #ffffff;
}
.proposal-ignore-form { padding-top: 12px; border-top: 1px solid var(--border-subtle); margin-top: 12px; }
.ignore-note-input { width: 100%; background: rgba(20,20,16,.05); border: 1px solid var(--border); color: var(--text); padding: 8px 14px; border-radius: 10px; font-size: 13px; outline: none; font-family: var(--font-body); transition: border-color var(--t); }
.ignore-note-input:focus { border-color: var(--accent); box-shadow: 0 12px 30px -16px rgba(20,20,16,.28); }
.btn-ignore-confirm { padding: 7px 14px; border-radius: 8px; background: rgba(238,90,56,.10); color: var(--red); border: 1px solid rgba(238,90,56,.25); font-size: 12px; font-weight: 600; cursor: pointer; font-family: var(--font-body); }
.btn-ignore-cancel { padding: 7px 14px; border-radius: 8px; background: none; color: var(--text3); border: 1px solid var(--border-subtle); font-size: 12px; cursor: pointer; font-family: var(--font-body); }
.proposal-result-ok  { color: var(--green); font-size: 12px; font-weight: 700; }
.proposal-result-err { color: var(--red);   font-size: 12px; font-weight: 700; margin-left: 10px; }
.agent-rules-form { max-width: 640px; }
.rules-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.rule-field { display: flex; flex-direction: column; gap: 5px; }
.rule-label { font-family: var(--font-display); font-size: 12px; font-weight: 600; color: #141410; }
.rule-hint  { font-size: 11px; color: var(--text3); line-height: 1.5; margin-bottom: 4px; }
.rule-field input { background: rgba(20,20,16,.05); border: 1px solid var(--border); color: var(--text); padding: 9px 14px; border-radius: 10px; font-size: 13px; outline: none; font-family: var(--font-body); transition: all var(--t); }
.rule-field input:focus { border-color: var(--accent); box-shadow: 0 12px 30px -16px rgba(20,20,16,.28); }
.summary-kpis { display: grid; grid-template-columns: repeat(3,1fr); gap: 14px; margin-bottom: 6px; }
.summary-kpi { padding: 16px 18px; }
.summary-kpi-label { font-family: var(--font-display); font-size: 9px; color: var(--accent-label); margin-bottom: 8px; font-weight: 700; text-transform: uppercase; letter-spacing: 3px; }
.summary-kpi-value { font-family: var(--font-display); font-size: 28px; font-weight: 700; color: #141410; letter-spacing: -1px; }

/* ─── ANÁLISIS AVANZADO META ADS ──────────────────────── */
.adv-toggle-bar { display: flex; align-items: center; justify-content: space-between; margin-top: 36px; padding: 18px 0 0; border-top: 1px solid var(--border); }
.adv-card { padding: 22px 24px; margin-top: 16px; transition: border-color var(--t), box-shadow var(--t); }
.adv-card:hover { border-color: var(--border-hover); box-shadow: 0 12px 30px -16px rgba(20,20,16,.28); }
.adv-card-header { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; flex-wrap: wrap; }
.adv-icon { font-size: 18px; }
.adv-card-header h4 { font-family: var(--font-display); font-size: 14px; font-weight: 700; margin: 0; }
.adv-sub { font-size: 12px; color: var(--text3); }
.adv-mini-label { font-family: var(--font-display); font-size: 9px; font-weight: 700; color: var(--accent-label); text-transform: uppercase; letter-spacing: 3px; margin-bottom: 12px; }
.adv-disclaimer { font-size: 11px; color: var(--text3); margin-top: 12px; line-height: 1.5; }
.adv-table-scroll { overflow-x: auto; }
.adv-table { width: 100%; border-collapse: collapse; font-size: 12px; min-width: 760px; }
.adv-table th { padding: 8px 12px; text-align: left; font-family: var(--font-display); font-size: 9px; font-weight: 800; color: var(--accent-label); text-transform: uppercase; letter-spacing: 2px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.adv-table td { padding: 10px 12px; border-bottom: 1px solid rgba(20,20,16,.06); vertical-align: middle; }
.adv-table tr:hover td { background: rgba(20,20,16,.035); }
.ab-thumb    { width: 34px; height: 34px; object-fit: cover; border-radius: 6px; display: block; }
.ab-thumb-ph { width: 34px; height: 34px; background: rgba(20,20,16,.06); border-radius: 6px; display: flex; align-items: center; justify-content: center; font-size: 14px; }
.ab-ad-name  { font-size: 12px; font-weight: 600; color: #141410; max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ab-ad-body  { font-size: 11px; color: var(--text3); max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 2px; }
.ab-type { display: inline-flex; padding: 2px 7px; border-radius: 5px; font-size: 10px; font-weight: 700; letter-spacing: .5px; }
.ab-type-video    { background: rgba(238,90,56,.15); color: var(--accent); border: 1px solid rgba(238,90,56,.2); }
.ab-type-image    { background: rgba(238,90,56,.10); color: var(--accent); }
.ab-type-carousel { background: rgba(203,166,215,.12); color: #C0A2E5; }
.ab-rank { font-size: 16px; }
.metric-chip,
.freq-badge {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  min-width: 48px;
  padding: 4px 10px;
  border-radius: 99px;
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  border: none !important;
  box-shadow: none !important;
  box-sizing: border-box;
}
.metric-chip-lime,
.freq-ok {
  background: #CFEA5B !important;
  color: #141410 !important;
}
.metric-chip-violet,
.freq-warn {
  background: #C0A2E5 !important;
  color: #141410 !important;
}
.metric-chip-orange,
.freq-severe {
  background: #EE5A38 !important;
  color: #ffffff !important;
}
.metric-chip-blue {
  background: #4657D4 !important;
  color: #ffffff !important;
}
.adv-table .metric-chip,
.adv-table .freq-badge {
  width: fit-content;
}
.funnel-wrap {}
.funnel-steps { display: flex; flex-direction: column; gap: 0; }
.funnel-step  { display: flex; flex-direction: column; gap: 0; }
.funnel-bar-wrap { padding: 4px 0; }
.funnel-bar { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-radius: 10px; transition: width .3s; box-shadow: none; }
.funnel-icon  { font-size: 16px; flex-shrink: 0; }
.funnel-label { font-size: 13px; font-weight: 600; color: var(--text); flex: 1; }
.funnel-value { font-family: var(--font-display); font-size: 16px; font-weight: 700; color: #141410; }
.funnel-arrow { padding: 4px 0 4px 22px; font-size: 12px; color: var(--text3); }
.funnel-conv  { color: var(--accent); font-weight: 600; }
.funnel-summary { display: flex; gap: 28px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--border-subtle); flex-wrap: wrap; }
.funnel-kpi-label { font-family: var(--font-display); font-size: 9px; color: var(--accent-label); margin-bottom: 4px; text-transform: uppercase; letter-spacing: 3px; font-weight: 700; }
.funnel-kpi-value { font-family: var(--font-display); font-size: 18px; font-weight: 700; color: #141410; }
.breakdown-tabs { display: flex; gap: 6px; margin-bottom: 16px; }
.bdown-tab { padding: 6px 16px; border-radius: 8px; border: 1px solid var(--border); background: none; color: var(--text2); font-size: 12px; font-weight: 600; cursor: pointer; transition: all var(--t); font-family: var(--font-body); }
.bdown-tab:hover { background: rgba(20,20,16,.06); color: var(--text); }
.bdown-tab.active { background: #141410; border-color: #141410; color: #F1F0E9; box-shadow: none; }
.bdown-bar-wrap { height: 4px; background: rgba(20,20,16,.06); border-radius: 2px; overflow: hidden; min-width: 80px; }
.bdown-bar { height: 100%; background: #EE5A38; border-radius: 2px; transition: width .3s; }
.hourly-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 28px; align-items: start; }
.hourly-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  border-radius: 10px;
  background: rgba(20,20,16,.035);
  color: var(--text3);
  font-size: 12px;
  text-align: center;
  padding: 18px;
}
.dow-row   { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.dow-name  { font-family: var(--font-display); font-size: 11px; font-weight: 700; color: var(--text2); width: 32px; flex-shrink: 0; }
.dow-bar-wrap { flex: 1; height: 6px; background: rgba(20,20,16,.06); border-radius: 3px; overflow: hidden; }
.dow-bar   { height: 100%; border-radius: 3px; transition: width .4s; }
.dow-ctr   { font-family: var(--font-display); font-size: 11px; font-weight: 700; width: 54px; text-align: center; flex-shrink: 0; }
.dow-msgs  { font-size: 10px; color: var(--text3); width: 52px; flex-shrink: 0; }
.sat-item  { border: none; border-radius: var(--radius); padding: 16px 18px; margin-bottom: 10px; }
.sat-header{ display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.sat-name  { font-family: var(--font-display); font-size: 13px; font-weight: 700; color: currentColor; margin-bottom: 3px; }
.sat-meta  { font-size: 11px; color: currentColor; opacity: .72; }
.sat-badge { padding: 3px 10px; border-radius: 99px; font-size: 11px; font-weight: 700; white-space: nowrap; border: none; background: rgba(255,255,255,.22); color: currentColor; }
.sat-freq-row  { display: flex; align-items: center; gap: 10px; }
.sat-freq-label{ font-family: var(--font-display); font-size: 9px; color: currentColor; opacity: .72; width: 64px; flex-shrink: 0; letter-spacing: 2px; text-transform: uppercase; font-weight: 700; }
.sat-freq-bar-wrap { flex: 1; height: 6px; background: rgba(255,255,255,.24); border-radius: 3px; position: relative; overflow: visible; }
.sat-freq-bar  { height: 100%; border-radius: 3px; transition: width .4s; }
.sat-freq-mark { position: absolute; top: -14px; transform: translateX(-50%); font-size: 9px; color: currentColor; opacity: .72; }
.sat-freq-val  { font-family: var(--font-display); font-size: 13px; font-weight: 700; width: 56px; text-align: right; flex-shrink: 0; color: currentColor; }

/* ─── ADS & ORGÁNICO — IMPACTO ────────────────────────── */
.impact-toolbar { display: flex; align-items: center; gap: 14px; margin-bottom: 22px; flex-wrap: wrap; }
.impact-disclaimer { display: flex; align-items: flex-start; gap: 10px; background: rgba(238,90,56,.06); border: 1px solid rgba(238,90,56,.18); border-radius: var(--radius); padding: 14px 18px; font-size: 12px; color: var(--text2); line-height: 1.6; margin-bottom: 20px; }
.impact-disc-icon { font-size: 16px; flex-shrink: 0; margin-top: 1px; }
.impact-kpi-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 14px; margin-bottom: 22px; }
.impact-kpi-card { padding: 18px 20px; text-align: center; transition: border-color var(--t), box-shadow var(--t); }
.impact-kpi-card:hover { border-color: var(--border-hover); box-shadow: 0 12px 30px -16px rgba(20,20,16,.28); }
.impact-kpi-icon  { font-size: 22px; margin-bottom: 10px; }
.impact-kpi-label { font-family: var(--font-display); font-size: 9px; color: var(--accent-label); font-weight: 700; text-transform: uppercase; letter-spacing: 3px; margin-bottom: 8px; }
.impact-kpi-value { font-family: var(--font-display); font-size: 28px; font-weight: 700; line-height: 1; margin-bottom: 4px; color: #141410; }
.impact-kpi-sub   { font-size: 11px; color: var(--text3); }
.impact-period-badge { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 99px; font-size: 11px; font-weight: 600; }
.impact-period-active  { background: var(--accent-soft); color: var(--accent); border: 1px solid var(--border); }
.impact-period-organic { background: rgba(207,234,91,.10); color: var(--green); border: 1px solid rgba(207,234,91,.2); }
.impact-uplift { font-size: 11px; font-weight: 700; margin-left: 6px; padding: 2px 7px; border-radius: 5px; }
.impact-uplift-pos { background: rgba(207,234,91,.12); color: var(--green); }
.impact-uplift-neg { background: rgba(238,90,56,.12);  color: var(--red); }
.impact-method-box { padding: 18px 22px; font-size: 12px; color: var(--text2); line-height: 1.7; margin-top: 4px; }
.impact-method-title { font-family: var(--font-display); font-size: 12px; font-weight: 700; color: #141410; margin-bottom: 10px; }

/* ─── HERRAMIENTAS ────────────────────────────────────── */
.tools-header { margin-bottom: 26px; }
.tool-card { padding: 26px 28px; transition: border-color var(--t), box-shadow var(--t); }
.tool-card:hover { border-color: var(--border-hover); box-shadow: 0 12px 30px -16px rgba(20,20,16,.28); }
.tool-card-header { display: flex; align-items: flex-start; gap: 18px; margin-bottom: 26px; padding-bottom: 22px; border-bottom: 1px solid var(--border-subtle); }
.tool-icon { font-size: 30px; flex-shrink: 0; line-height: 1; margin-top: 2px; }
.tool-title { font-family: var(--font-display); font-size: 17px; font-weight: 700; margin-bottom: 5px; color: #141410; }
.tool-subtitle { font-size: 13px; color: var(--text2); line-height: 1.5; }
.tool-empty { font-size: 13px; color: var(--text3); padding: 22px 0; line-height: 1.6; }

/* Calculadora */
.calc-input-row { display: flex; align-items: flex-end; gap: 28px; margin-bottom: 26px; flex-wrap: wrap; }
.calc-input-group { display: flex; flex-direction: column; gap: 8px; }
.calc-label { font-family: var(--font-display); font-size: 9px; font-weight: 700; color: var(--accent-label); text-transform: uppercase; letter-spacing: 3px; }
.calc-input-wrap { display: flex; align-items: stretch; }
.calc-input {
  background: #F1F0E9; border: 1px solid var(--border); border-right: none;
  color: #141410; padding: 12px 16px; border-radius: 14px 0 0 14px;
  font-family: var(--font-display); font-size: 22px; font-weight: 700; outline: none;
  width: 170px; letter-spacing: -0.5px; transition: border-color var(--t);
}
.calc-input:focus { border-color: var(--accent); }
.calc-input::-webkit-inner-spin-button { opacity: 0; }
.calc-input-unit { background: #141410; border: 1px solid #141410; border-left: none; color: #F1F0E9; padding: 12px 14px; border-radius: 0 14px 14px 0; font-size: 12px; font-weight: 800; white-space: nowrap; font-family: var(--font-body); display:flex; align-items:center; }
.calc-cpa-display { display: flex; flex-direction: column; gap: 5px; }
.calc-cpa-label { font-family: var(--font-display); font-size: 9px; font-weight: 700; color: var(--accent-label); text-transform: uppercase; letter-spacing: 3px; }
.calc-cpa-value { font-family: var(--font-display); font-size: 22px; font-weight: 700; color: var(--accent); text-shadow: 0 0 20px rgba(20,20,16,0.15); }

.calc-scenarios { display: grid; grid-template-columns: repeat(3,1fr); gap: 14px; margin-bottom: 18px; }
.calc-scenario { border-radius: var(--radius); padding: 18px 20px; border: 1px solid; }
.calc-base { background: rgba(238,90,56,.06); border-color: rgba(238,90,56,.25); }
.calc-opt  { background: rgba(207,234,91,.05); border-color: rgba(207,234,91,.22); }
.calc-pess { background: rgba(238,90,56,.04);  border-color: rgba(238,90,56,.18); }
.calc-scenario-label { font-family: var(--font-display); font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: 3px; margin-bottom: 3px; }
.calc-base .calc-scenario-label  { color: var(--accent); }
.calc-opt  .calc-scenario-label  { color: var(--green); }
.calc-pess .calc-scenario-label  { color: var(--red); }
.calc-scenario-hint    { font-size: 11px; color: var(--text3); margin-bottom: 12px; }
.calc-scenario-monthly { font-family: var(--font-display); font-size: 20px; font-weight: 700; color: #141410; margin-bottom: 3px; letter-spacing: -0.5px; }
.calc-scenario-daily   { font-size: 12px; color: var(--text2); }

.calc-footer-row { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.calc-data-note { font-size: 12px; color: var(--text3); }
.calc-copy-btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 10px 20px; border-radius: 10px;
  background: #141410; color: #F1F0E9; border: none;
  font-size: 13px; font-weight: 800; cursor: pointer; transition: all var(--t); font-family: var(--font-body);
  box-shadow: 0 12px 30px -16px rgba(20,20,16,.28);
}
.calc-copy-btn:hover { box-shadow: 0 12px 30px -16px rgba(20,20,16,.28); transform: translateY(-1px); }

/* Proyección */
.proj-trend-bar { display: flex; align-items: center; gap: 16px; padding: 18px 22px; border-radius: var(--radius); margin-bottom: 22px; border: 0; }
.trend-positiva  { background: var(--brand-lime); color:#141410; }
.trend-negativa  { background: var(--brand-coral); color:#ffffff; }
.trend-estable   { background: var(--brand-violet); color:#141410; }
.trend-sin-datos { background: #141410; color:#F1F0E9; }
.proj-trend-icon   { font-size: 24px; flex-shrink: 0; }
.proj-trend-label  { font-family: var(--font-display); font-size: 14px; font-weight: 800; color: currentColor; margin-bottom: 2px; }
.proj-trend-detail { font-size: 12px; color: currentColor; opacity:.74; }

.proj-kpis { display: grid; grid-template-columns: repeat(4,1fr); gap: 14px; margin-bottom: 6px; }
.proj-kpi { padding: 18px 20px; border:0!important; border-radius:16px; transition: transform var(--t); }
.proj-kpi:hover { transform: translateY(-1px); }
.proj-kpi:nth-child(1){background:var(--brand-lime);color:#141410}
.proj-kpi:nth-child(2){background:var(--brand-violet);color:#141410}
.proj-kpi:nth-child(3){background:var(--brand-blue);color:#ffffff}
.proj-kpi:nth-child(4){background:var(--brand-coral);color:#ffffff}
.proj-kpi-label { font-family: var(--font-display); font-size: 10px; font-weight: 800; color: currentColor; opacity:.72; text-transform: uppercase; letter-spacing: 3px; margin-bottom: 10px; }
.proj-kpi-value { font-family: var(--font-display); font-size: 28px; font-weight: 800; color: currentColor; margin-bottom: 4px; letter-spacing: 0; }
.proj-kpi-range { display:inline-flex; width:max-content; padding:3px 9px; border-radius:999px; background:#141410; color:#F1F0E9; font-size: 11px; font-weight:800; margin-bottom: 6px; }
.proj-kpi:nth-child(3) .proj-kpi-range,
.proj-kpi:nth-child(4) .proj-kpi-range{background:#F1F0E9;color:#141410}
.proj-kpi-sub   { font-size: 12px; color: currentColor; opacity:.72; }

.proj-disclaimer { display: flex; align-items: flex-start; gap: 10px; margin-top: 16px; padding: 14px 18px; background: #141410; border: 0; border-radius: 12px; font-size: 12px; color: #F1F0E9; line-height: 1.6; }

@media (max-width: 900px) {
  .calc-scenarios { grid-template-columns: 1fr; }
  .proj-kpis      { grid-template-columns: 1fr 1fr; }
}

/* ─── ANIMATIONS ──────────────────────────────────────── */
@keyframes pulse { 0%,100%{ opacity:1 } 50%{ opacity:.25 } }
@keyframes shimmer { 0%{ background-position:200% 0 } 100%{ background-position:-200% 0 } }

/* ─── SECTION LOADING BAR ─────────────────────────────────── */
/* Barra de progreso animada en la parte superior de secciones que cargan datos */
.section[data-loading] { position: relative; }
.section[data-loading]::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--brand-lime);
  background-size: 200% 100%;
  animation: shimmer 1.2s ease-in-out infinite;
  z-index: 20;
  border-radius: 2px;
}

/* ─── RESPONSIVE ──────────────────────────────────────── */
@media (max-width: 900px) {
  .kpi-grid { grid-template-columns: repeat(2,1fr); }
  .charts-row { flex-direction: column; }
  .chart-card.wide { flex: 1; }
  .posts-grid { grid-template-columns: repeat(2,1fr); }
  .impact-kpi-grid { grid-template-columns: repeat(2,1fr); }
  .blood-grid { grid-template-columns: 1fr 1fr; }
  .ai-seg-grid { grid-template-columns: 1fr; }
  .ai-creative-grid { grid-template-columns: 1fr; }
  .ai-budget-flow { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 760px) {
  html, body { overflow-x: hidden; }
  body { overflow: hidden; position: fixed; inset: 0; width: 100%; }
  body.mobile-menu-open { touch-action: none; }
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(86vw, 320px);
    min-width: 0;
    height: 100dvh;
    z-index: 90;
    transform: translateX(-105%);
    transition: transform 220ms ease;
    box-shadow: 22px 0 48px -28px rgba(20,20,16,.55);
    display: flex;
  }
  .sidebar.mobile-open { transform: translateX(0); }
  .sidebar-header { padding: 18px 16px 14px; }
  .sidebar-nav { padding: 10px 8px; }
  .nav-item, .client-chip { min-height: 42px; font-size: 13px; }
  .sidebar-clients { max-height: 38dvh; overflow-y: auto; flex: 0 0 auto; }
  .sidebar-footer { margin-top: auto; }
  .main { width: 100%; max-width: 100%; height: 100dvh; overflow-x: hidden; }
  .topbar {
    padding: 10px 12px;
    gap: 10px;
    align-items: flex-start;
    overflow: visible;
  }
  .mobile-menu-btn { display: flex; }
  .topbar-left { flex: 1; min-height: 40px; }
  .topbar h1 {
    font-size: 16px;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .topbar-right {
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
    max-width: 48%;
  }
  .last-update, #bg-refresh-badge { display: none !important; }
  .client-selector-wrap { width: 100%; }
  #client-select {
    width: 100%;
    max-width: 170px;
    padding: 9px 10px;
    font-size: 12px;
  }
  .section {
    padding: 18px 14px 28px;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
  }
  .kpi-grid { grid-template-columns: 1fr 1fr; }
  .kpi-card { padding: 16px; min-width: 0; }
  .kpi-value { font-size: 23px; line-height: 1.1; word-break: break-word; }
  .chart-card { padding: 16px; min-width: 0; }
  .chart-header { align-items: flex-start; gap: 10px; flex-direction: column; }
  .chart-wrap { height: 240px; }
  .posts-grid { grid-template-columns: 1fr; }
  .clients-header, .posts-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  #clients-table-wrap, .campaigns-table-wrap, .adv-table-scroll, .ai-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
    overscroll-behavior-x: contain;
  }
  .clients-table { min-width: 720px; }
  .modal-overlay {
    padding: 12px;
    align-items: flex-start;
    overflow-y: auto;
  }
  .modal-box {
    width: min(100%, 520px) !important;
    max-width: 100% !important;
    max-height: calc(100dvh - 24px);
    overflow-y: auto;
  }
}

@media (max-width: 430px) {
  .topbar { flex-direction: column; align-items: stretch; }
  .topbar-right { max-width: none; width: 100%; justify-content: stretch; }
  #client-select { max-width: none; }
  .kpi-grid { grid-template-columns: 1fr; }
}

/* ─── CAMPAIGN WIZARD ─────────────────────────────────────────────────── */

/* Breadcrumb de pasos */
.cwiz-steps {
  display: flex;
  align-items: center;
  gap: 0;
  margin-bottom: 24px;
  padding: 14px 20px;
  background: var(--bg1);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow-x: auto;
}
.cwiz-step-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 8px;
  cursor: default;
  white-space: nowrap;
  transition: all 0.2s;
}
.cwiz-step-num {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  font-size: 12px;
  font-weight: 700;
  background: var(--surface2);
  color: var(--text3);
  border: 2px solid var(--border);
  flex-shrink: 0;
  transition: all 0.2s;
}
.cwiz-step-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text3);
  transition: color 0.2s;
}
.cwiz-step-item.active .cwiz-step-num {
  background: #EE5A38;
  border-color: #EE5A38;
  color: #141410;
  box-shadow: none;
}
.cwiz-step-item.active .cwiz-step-label {
  color: var(--text);
  font-weight: 700;
}
.cwiz-step-item.completed .cwiz-step-num {
  background: #CFEA5B;
  border-color: #141410;
  color: #141410;
}
.cwiz-step-item.completed .cwiz-step-label {
  color: #141410;
}
.cwiz-step-divider {
  flex: 1;
  height: 1px;
  background: var(--border);
  min-width: 16px;
  max-width: 40px;
}

/* Formulario step 1 */
.cwiz-form {}
.cwiz-form .chat-input {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-family: var(--font-body);
}
.cwiz-form .chat-input:focus {
  outline: none;
  border-color: #EE5A38;
}

/* Contenedor de resultados */
.cwiz-results {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

/* Sección individual de resultado */
.cwiz-section {
  background: var(--bg1);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px 24px;
  margin-bottom: 16px;
}
.cwiz-section-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.cwiz-section-header svg {
  color: #EE5A38;
  flex-shrink: 0;
}
.cwiz-section-header h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}

/* Grid de recomendaciones */
.cwiz-rec-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
}

/* Card de recomendación */
.cwiz-rec-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
}
.cwiz-rec-card-green { border-left: 3px solid #CFEA5B; }
.cwiz-rec-card-red   { border-left: 3px solid #EE5A38; }
.cwiz-rec-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 6px;
}
.cwiz-rec-value {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
}

/* Badge de dato histórico */
.cwiz-data-badge {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  background: rgba(238,90,56,0.08);
  border-left: 2px solid rgba(20,20,16,0.15);
  border-radius: 0 6px 6px 0;
  padding: 5px 8px;
  font-size: 11px;
  color: rgba(147,167,255,0.9);
  line-height: 1.4;
  margin-top: 6px;
}

/* Badge de confianza */
.cwiz-conf-badge {
  display: inline-flex;
  align-items: center;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  margin-left: 4px;
}
.cwiz-conf-alta  { background: rgba(207,234,91,0.15); color: #141410; }
.cwiz-conf-media { background: rgba(203,166,215,0.15); color: #C0A2E5; }
.cwiz-conf-baja  { background: rgba(107,114,128,0.15); color: #9ca3af; }

/* Manual paso a paso */
.cwiz-manual-list {}
.cwiz-manual-step {
  display: flex;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}
.cwiz-manual-step:last-child { border-bottom: none; }
.cwiz-manual-num {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #EE5A38;
  color: #141410;
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 2px;
}
.cwiz-manual-content { flex: 1; }
.cwiz-manual-titulo {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}
.cwiz-manual-instruccion {
  font-size: 13px;
  color: var(--text2);
  line-height: 1.6;
  margin-bottom: 4px;
}
.cwiz-manual-detalle {
  font-size: 12px;
  color: var(--text3);
  font-style: italic;
  line-height: 1.5;
  padding: 4px 8px;
  background: var(--bg2);
  border-radius: 6px;
  margin-top: 6px;
}

/* Grid de copies */
.cwiz-copies-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

/* Card de copy */
.cwiz-copy-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: border-color 0.15s;
}
.cwiz-copy-card:hover { border-color: #EE5A38; }
.cwiz-copy-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.cwiz-copy-id {
  font-size: 11px;
  font-weight: 700;
  color: #EE5A38;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.cwiz-copy-tono {
  font-size: 11px;
  background: rgba(238,90,56,0.1);
  color: #EE5A38;
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 600;
}
.cwiz-copy-titulo {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.4;
}
.cwiz-copy-texto {
  font-size: 13px;
  color: var(--text2);
  line-height: 1.65;
  white-space: pre-wrap;
}
.cwiz-copy-cta {
  font-size: 12px;
  font-weight: 600;
  color: #141410;
  padding: 5px 10px;
  background: rgba(207,234,91,0.1);
  border-radius: 6px;
}
.cwiz-copy-why {
  font-size: 11px;
  color: var(--text3);
  font-style: italic;
  line-height: 1.5;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

/* Checklist */
.cwiz-checklist {}
.cwiz-checklist-cat {
  margin-bottom: 20px;
}
.cwiz-checklist-cat-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #EE5A38;
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(238,90,56,0.15);
}
.cwiz-checklist-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid transparent;
  cursor: pointer;
  font-size: 13px;
  color: var(--text2);
  margin-bottom: 4px;
  background: var(--bg2);
  transition: all 0.15s;
  user-select: none;
}
.cwiz-checklist-item:hover { border-color: var(--border); color: var(--text); }
.cwiz-checklist-item.critico {
  border-color: rgba(238,90,56,0.25);
  background: rgba(238,90,56,0.04);
}
.cwiz-checklist-item.critico:hover { border-color: #EE5A38; }
.cwiz-checklist-item input[type="checkbox"]:checked + span {
  text-decoration: line-through;
  color: var(--text3);
}
.cwiz-critico-badge {
  margin-left: auto;
  font-size: 10px;
  font-weight: 700;
  color: #EE5A38;
  background: rgba(238,90,56,0.1);
  padding: 2px 7px;
  border-radius: 4px;
  white-space: nowrap;
}

@media (max-width: 900px) {
  .cwiz-results { grid-template-columns: 1fr; }
  .cwiz-rec-grid { grid-template-columns: 1fr 1fr; }
  .cwiz-copies-grid { grid-template-columns: 1fr; }
}

/* ─── OVERVIEW TABS ───────────────────────── */
.overview-tabs { display: flex; gap: 6px; margin-bottom: 20px; }
.overview-tab { background: var(--surface2); border: 1px solid var(--border-subtle); color: var(--text3); border-radius: 8px; padding: 7px 18px; font-size: 13px; font-weight: 500; cursor: pointer; transition: all var(--t); font-family: var(--font-body); }
.overview-tab:hover { color: var(--text2); border-color: var(--border); }
.overview-tab.active { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); font-weight: 600; }

/* ─── REPORTES ─────────────────────────────── */
.reports-list { display: flex; flex-direction: column; gap: 14px; }
.report-card { background: var(--card, var(--surface2)); border: 1px solid var(--border); border-radius: 12px; padding: 18px 20px; display: flex; align-items: center; justify-content: space-between; gap: 16px; transition: border-color var(--t); }
.report-card:hover { border-color: var(--border-hover); }
.report-card-header { display: flex; align-items: center; gap: 14px; flex: 1; }
.report-icon { font-size: 22px; flex-shrink: 0; }
.report-info { flex: 1; }
.report-title { font-size: 14px; font-weight: 600; color: #141410; margin-bottom: 4px; }
.report-date { font-size: 12px; color: var(--text2); }
.report-missing { color: var(--text3); font-style: italic; }
.report-actions { display: flex; gap: 8px; flex-shrink: 0; }

/* ─── SERVICE STATE BANNERS ───────────────────────────────────── */
.svc-state-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 20px;
  border: 1px solid transparent;
}
.svc-banner-icon { font-size: 16px; flex-shrink: 0; }
.svc-banner-text { flex: 1; line-height: 1.4; }
.svc-banner-cta {
  background: transparent;
  border: 1px solid currentColor;
  color: inherit;
  border-radius: 6px;
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  opacity: 0.85;
  font-family: var(--font-body);
  white-space: nowrap;
}
.svc-banner-cta:hover { opacity: 1; background: rgba(20,20,16,.06); }

.svc-banner-warning {
  background: rgba(245, 158, 11, .10);
  border-color: rgba(245, 158, 11, .30);
  color: #C0A2E5;
}
.svc-banner-paused {
  background: rgba(100, 116, 139, .10);
  border-color: rgba(100, 116, 139, .25);
  color: var(--text2);
}
.svc-banner-info {
  background: rgba(99, 102, 241, .08);
  border-color: rgba(99, 102, 241, .25);
  color: var(--accent);
}
.svc-banner-muted {
  background: rgba(30, 41, 59, .60);
  border-color: var(--border-subtle);
  color: var(--text3);
}

/* ─── DECISION ENGINE BAND ─────────────────────────────────────── */
.dei-band {
  border-radius: 12px;
  padding: 12px 16px;
  margin-bottom: 20px;
  border: 1px solid var(--border-subtle);
  background: var(--surface2);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.dei-band.dei-loading { opacity: .6; }
.dei-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.dei-scope {
  font-size: 12px;
  font-weight: 600;
  color: var(--text2);
  letter-spacing: .02em;
}
.dei-chip {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 20px;
  background: rgba(20,20,16,.05);
  border: 1px solid var(--border-subtle);
  color: var(--text2);
  white-space: nowrap;
}
.dei-bks { color: var(--accent); border-color: rgba(183,175,227,.3); background: rgba(183,175,227,.08); }
.dei-count { color: var(--text3); }
.dei-chip-ok { color: #141410; border-color: rgba(207,234,91,.3); background: rgba(207,234,91,.08); }

.dei-action { justify-content: space-between; align-items: center; gap: 16px; }
.dei-action-text { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.dei-action-title { font-size: 14px; font-weight: 600; color: var(--text1, #141410); }
.dei-action-reason { font-size: 12px; color: var(--text2); line-height: 1.4; }
.dei-cta {
  background: var(--accent);
  border: none;
  color: #141410;
  border-radius: 8px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  font-family: var(--font-body);
  transition: opacity var(--t);
}
.dei-cta:hover { opacity: .88; }
.dei-here { font-size: 12px; color: var(--text3); font-weight: 500; white-space: nowrap; }

/* Acento lateral por urgencia */
.dei-band.dei-critica { border-left: 3px solid #EE5A38; }
.dei-band.dei-alta    { border-left: 3px solid #C0A2E5; }
.dei-band.dei-media   { border-left: 3px solid #eab308; }
.dei-band.dei-baja    { border-left: 3px solid #B7AFE3; }
.dei-band.dei-ok      { border-left: 3px solid #CFEA5B; }

.dei-urgency { font-weight: 600; }

/* ─── CLIENTES — PANEL OPERATIVO ──────────────────────────────── */
.client-industry { font-size: 11px; color: var(--text3); margin-top: 2px; }

.svc-chip-row { display: flex; flex-wrap: wrap; gap: 6px; }
.svc-chip {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; font-weight: 500; color: var(--text2);
  background: var(--surface2); border: 1px solid var(--border-subtle);
  border-radius: 20px; padding: 3px 9px; white-space: nowrap;
}
.svc-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.svc-dot-running  { background: #CFEA5B; }
.svc-dot-setup    { background: #C0A2E5; }
.svc-dot-paused   { background: #6b6f5a; }
.svc-dot-muted    { background: #B0B0A6; }
.svc-dot-internal { background: #B7AFE3; }
.svc-chip-pending {
  color: #C0A2E5; border-color: rgba(203,166,215,.35);
  background: rgba(203,166,215,.08); font-weight: 600;
}

.bks-cell { display: flex; flex-direction: column; gap: 5px; min-width: 110px; }
.bks-bar {
  height: 5px; border-radius: 3px; background: var(--surface2);
  border: 1px solid var(--border-subtle); overflow: hidden;
}
.bks-bar-fill { height: 100%; background: var(--accent); border-radius: 3px; }
.bks-cell-label { font-size: 11px; color: var(--text2); font-weight: 500; }

.next-action-cell {
  display: flex; align-items: center; gap: 8px; cursor: pointer;
  max-width: 320px; border-radius: 8px; padding: 4px 6px; margin: -4px -6px;
  transition: background var(--t);
}
.next-action-cell:hover { background: rgba(20,20,16,.04); }
.next-action-title {
  font-size: 12.5px; color: var(--text1, #141410); font-weight: 500;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.next-action-ok { font-size: 12px; color: #141410; font-weight: 600; }

/* ─── BUSINESS DESIGN — HEADER EJECUTIVO ─────────────────────── */
.bd-exec {
  background: var(--surface2);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  padding: 16px 20px;
  margin-bottom: 22px;
  display: flex; flex-direction: column; gap: 14px;
}
.bd-exec-loading { color: var(--text3); font-size: 13px; }
.bd-exec-quiet { flex-direction: row; align-items: center; gap: 12px; }
.bd-exec-quiet-text { font-size: 13px; color: var(--text2); line-height: 1.5; }

.bd-exec-top { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.bd-exec-state-chip {
  font-size: 11px; font-weight: 700; letter-spacing: .03em;
  padding: 4px 11px; border-radius: 20px; white-space: nowrap;
}
.chip-active   { color: #141410; background: rgba(207,234,91,.1);  border: 1px solid rgba(207,234,91,.3); }
.chip-setup    { color: #C0A2E5; background: rgba(203,166,215,.1);  border: 1px solid rgba(203,166,215,.3); }
.chip-paused   { color: var(--text2); background: rgba(100,116,139,.12); border: 1px solid rgba(100,116,139,.3); }
.chip-muted    { color: var(--text3); background: rgba(51,65,85,.3); border: 1px solid var(--border-subtle); }
.chip-internal { color: var(--accent); background: rgba(183,175,227,.1); border: 1px solid rgba(183,175,227,.3); }

.bd-exec-kpi { font-size: 13px; color: var(--text2); }
.bd-exec-kpi strong { color: var(--text1, #141410); font-weight: 700; }

.bd-exec-action {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  background: rgba(20,20,16,.02);
  border: 1px solid var(--border-subtle);
  border-radius: 10px; padding: 12px 16px;
}
.bd-exec-action-text { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.bd-exec-action-label {
  font-size: 10.5px; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; color: var(--accent);
}
.bd-exec-action-title { font-size: 14px; font-weight: 600; color: var(--text1, #141410); }
.bd-exec-action-reason { font-size: 12px; color: var(--text2); line-height: 1.4; }
.bd-exec-action-ok { font-size: 13px; color: #141410; font-weight: 600; }
.bd-exec-cta {
  background: var(--accent); border: none; color: #141410;
  border-radius: 8px; padding: 8px 16px; font-size: 13px; font-weight: 600;
  cursor: pointer; white-space: nowrap; font-family: var(--font-body);
  transition: opacity var(--t);
}
.bd-exec-cta:hover { opacity: .88; }

.bd-exec-missing { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.bd-exec-missing-label { font-size: 12px; color: var(--text3); font-weight: 500; }
.bd-exec-missing-item {
  font-size: 11.5px; color: var(--text2);
  background: rgba(20,20,16,.03); border: 1px solid var(--border-subtle);
  border-radius: 20px; padding: 3px 10px;
}

.bd-exec-setup-guide { display: flex; flex-direction: column; gap: 10px; }
.bd-exec-setup-title { font-size: 13px; font-weight: 700; color: var(--text1, #141410); }
.bd-exec-steps { display: flex; gap: 10px; flex-wrap: wrap; }
.bd-exec-step {
  display: flex; align-items: center; gap: 8px;
  background: rgba(20,20,16,.03); border: 1px solid var(--border-subtle);
  border-radius: 10px; padding: 10px 14px; cursor: pointer;
  font-size: 13px; font-weight: 500; color: var(--text1, #141410);
  font-family: var(--font-body); transition: border-color var(--t);
}
.bd-exec-step:hover { border-color: var(--accent); }
.bd-exec-step-n {
  width: 20px; height: 20px; border-radius: 50%; flex-shrink: 0;
  background: var(--accent-soft, rgba(183,175,227,.15)); color: var(--accent);
  font-size: 11px; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center;
}
.bd-exec-step-hint { font-size: 11px; color: var(--text3); font-weight: 400; }

/* ─── META ADS — CHIP DE OBJETIVO ────────────────────────────── */
.camp-obj-chip {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 20px; font-size: 10.5px; font-weight: 600;
  padding: 2px 9px; border-radius: 12px;
  border: 1px solid currentColor; white-space: nowrap;
}

/* ─── CENTRO DE OPERACIONES — GRÁFICOS EJECUTIVOS ────────────── */
.ops-charts {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) 1.6fr;
  gap: 16px;
  margin: 20px 0 24px;
}
.ops-chart-card {
  background: var(--surface2);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  padding: 20px 22px;
}
.ops-chart-title {
  font-size: 12px; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; color: var(--text3);
  margin: 0 0 14px;
}
.ops-chart-canvas-wrap { position: relative; height: 190px; }
.ops-chart-donut { height: 170px; }
@media (max-width: 900px) { .ops-charts { grid-template-columns: 1fr; } }

/* ─── PASE VISUAL PREMIUM — AIRE Y JERARQUÍA ─────────────────── */
/* Títulos de sección con más presencia editorial */
.ops-title { font-size: 26px; letter-spacing: -0.02em; }
.section > h3, .clients-header h3, .bd-panel-header h2 {
  font-size: 22px; letter-spacing: -0.015em; font-weight: 700;
}
/* Más aire entre bloques principales */
.section { padding-bottom: 48px; }
.kpi-card { padding: 20px 22px; border-radius: 16px; }
.kpi-value { letter-spacing: -0.02em; }
.chart-card { border-radius: 16px; }
/* Tablas más respirables */
.clients-table td, .data-table td { padding-top: 14px; padding-bottom: 14px; }

/* ═══ BUSINESS DESIGN — DASHBOARD EJECUTIVO (R5) ═══════════════ */

/* Tabs nuevas */
.bd-tabs { display:flex; gap:6px; align-items:center; padding-bottom:16px; }
.bd-more-wrap { position:relative; margin-left:auto; }
.bd-tab-more { color: var(--text3); }
.bd-more-menu {
  position:absolute; right:0; top:calc(100% + 6px); z-index:50;
  background: var(--surface2); border:1px solid var(--border);
  border-radius:12px; padding:6px; min-width:170px;
  box-shadow: 0 12px 32px rgba(0,0,0,.45);
}
.bd-more-menu button {
  display:block; width:100%; text-align:left; background:none; border:none;
  color:var(--text2); font-size:13px; padding:8px 12px; border-radius:8px;
  cursor:pointer; font-family:var(--font-body);
}
.bd-more-menu button:hover { background:rgba(20,20,16,.05); color:var(--text1,#141410); }

.bd-dash-loading { padding:60px 0; text-align:center; color:var(--text3); font-size:13px; }

/* HERO — editorial: tipografía grande, mucho aire */
.bd-hero {
  display:grid; grid-template-columns:repeat(4, 1fr); gap:16px;
  margin-bottom:28px;
}
.bd-hero-card {
  background: var(--surface2); border:1px solid var(--border-subtle);
  border-radius:18px; padding:26px 26px 22px;
  display:flex; flex-direction:column; gap:6px; min-height:130px;
}
.bd-hero-label {
  font-size:11px; font-weight:700; letter-spacing:.08em; text-transform:uppercase;
  color:var(--text3);
}
.bd-hero-value {
  font-size:34px; font-weight:700; letter-spacing:-.03em; line-height:1.1;
  color:var(--text1,#141410);
}
.bd-hero-sub { font-size:12.5px; color:var(--text3); }
.bd-hero-chips { display:flex; gap:6px; margin-top:6px; flex-wrap:wrap; }
.bd-hero-chip {
  font-size:11px; font-weight:600; padding:3px 9px; border-radius:20px;
  background:rgba(20,20,16,.05); border:1px solid var(--border-subtle); color:var(--text2);
}
.bd-hero-chip.pos { color: #141410; border-color:rgba(207,234,91,.3); background:rgba(207,234,91,.08); }
.bd-hero-chip.neg { color:#EE5A38; border-color:rgba(238,90,56,.3); background:rgba(238,90,56,.08); }
.bd-hero-bar {
  height:4px; border-radius:2px; background:rgba(20,20,16,.06);
  margin-top:10px; overflow:hidden;
}
.bd-hero-bar div { height:100%; background:var(--accent); border-radius:2px; }

/* Secciones del tablero */
.bd-dash-section {
  background: var(--surface2); border:1px solid var(--border-subtle);
  border-radius:18px; padding:24px 26px; margin-bottom:16px; flex:1; min-width:0;
}
.bd-dash-section-head {
  display:flex; align-items:baseline; justify-content:space-between; margin-bottom:18px;
}
.bd-dash-section-head h3 {
  font-size:17px; font-weight:700; letter-spacing:-.01em; margin:0;
}
.bd-dash-section-hint { font-size:12px; color:var(--text3); }
.bd-dash-link {
  background:none; border:none; color:#141410; font-size:12.5px; font-weight:600;
  cursor:pointer; font-family:var(--font-body); padding:0;
}
.bd-dash-row { display:flex; gap:16px; margin-bottom:0; }
.bd-dash-row .bd-dash-section { margin-bottom:16px; }
@media (max-width: 1000px) { .bd-dash-row { flex-direction:column; } .bd-hero { grid-template-columns:repeat(2,1fr); } }

.bd-dash-chart-lg { position:relative; height:280px; }
.bd-dash-chart-md { position:relative; height:200px; }

/* Estados vacíos honestos */
.bd-dash-empty { text-align:center; padding:36px 26px; }
.bd-dash-empty h3 { font-size:17px; margin-bottom:6px; }
.bd-dash-empty p { font-size:13px; color:var(--text3); margin-bottom:16px; }
.bd-dash-empty-inline { text-align:left; padding:20px 26px; }
.bd-dash-empty-inline p { margin-bottom:0; }
.bd-dash-quiet { font-size:13px; color:var(--text3); }

/* Objetivos */
.bd-dash-objs { display:flex; flex-direction:column; gap:14px; }
.bd-dash-obj-top { display:flex; justify-content:space-between; margin-bottom:6px; }
.bd-dash-obj-name { font-size:13.5px; font-weight:600; color:var(--text1,#141410); }
.bd-dash-obj-pct { font-size:13px; font-weight:700; }
.bd-dash-obj-bar {
  height:6px; border-radius:3px; background:rgba(20,20,16,.06); overflow:hidden;
}
.bd-dash-obj-bar div { height:100%; border-radius:3px; transition:width .4s; }

/* Salud integrada */
.bd-dash-health { display:flex; flex-wrap:wrap; gap:8px; }
.bd-dash-health-chip {
  display:inline-flex; align-items:center; gap:7px;
  font-size:12px; font-weight:500; color:var(--text2); text-transform:capitalize;
  background:rgba(20,20,16,.03); border:1px solid var(--border-subtle);
  border-radius:20px; padding:6px 12px;
}
.bd-dash-health-dot { width:8px; height:8px; border-radius:50%; }

/* ═══ CARGA DE DATOS — BLOQUES ═════════════════════════════════ */
.bd-de-intro { margin-bottom:22px; max-width:520px; }
.bd-de-intro h3 { font-size:22px; letter-spacing:-.015em; margin-bottom:6px; }
.bd-de-intro p { font-size:13.5px; color:var(--text3); line-height:1.55; }
.bd-de-blocks { display:flex; flex-direction:column; gap:10px; max-width:640px; }
.bd-de-block {
  display:flex; align-items:center; gap:16px; text-align:left;
  background:var(--surface2); border:1px solid var(--border-subtle);
  border-radius:14px; padding:18px 20px; cursor:pointer;
  font-family:var(--font-body); transition:border-color var(--t), transform .15s;
}
.bd-de-block:hover { border-color:var(--accent); transform:translateX(2px); }
.bd-de-icon { font-size:22px; flex-shrink:0; }
.bd-de-body { display:flex; flex-direction:column; gap:2px; flex:1; min-width:0; }
.bd-de-title { font-size:14.5px; font-weight:700; color:var(--text1,#141410); }
.bd-de-desc { font-size:12px; color:var(--text3); }
.bd-de-status { font-size:11.5px; font-weight:600; color:var(--text3); white-space:nowrap; }
.bd-de-status.ok { color: #141410; }
.bd-de-status.pending { color:#C0A2E5; }

/* ═══ R7 — ONBOARDING PREMIUM ══════════════════════════════════ */
.bd-panel-subtitle {
  font-size: 13px; color: var(--text3); margin-top: 4px;
  max-width: 480px; line-height: 1.5; font-weight: 400;
}
.bd-panel-header-continuation { margin-top: 36px; padding-top: 28px; border-top: 1px solid var(--border-subtle); }

/* Acordeones como cards editoriales numeradas */
#bd-panel-onboarding .bd-accordion, #bd-panel-audit .bd-accordion {
  background: var(--surface2);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  margin-bottom: 14px;
  overflow: hidden;
  counter-increment: bd-step;
}
#bd-onboarding-body, .bd-audit-form { counter-reset: bd-step; max-width: 760px; }
#bd-panel-onboarding .bd-accordion-head, #bd-panel-audit .bd-accordion-head {
  width: 100%; display: flex; align-items: center; justify-content: space-between;
  background: none; border: none; cursor: pointer;
  padding: 20px 24px; font-family: var(--font-body);
  font-size: 15.5px; font-weight: 700; color: var(--text1, #141410);
  letter-spacing: -0.01em;
}
#bd-panel-onboarding .bd-accordion-head > span:first-child::before,
#bd-panel-audit .bd-accordion-head > span:first-child::before {
  content: counter(bd-step, decimal-leading-zero);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 26px;
  padding: 0 10px;
  margin-right: 12px;
  border-radius: 999px;
  background: var(--brand-coral);
  color: #ffffff;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  vertical-align: 1px;
}
#bd-panel-onboarding .bd-accordion:nth-child(4n+1) .bd-accordion-head > span:first-child::before,
#bd-panel-audit .bd-accordion:nth-child(4n+1) .bd-accordion-head > span:first-child::before {
  background: var(--brand-violet);
  color: #141410;
}
#bd-panel-onboarding .bd-accordion:nth-child(4n+2) .bd-accordion-head > span:first-child::before,
#bd-panel-audit .bd-accordion:nth-child(4n+2) .bd-accordion-head > span:first-child::before {
  background: var(--brand-lime);
  color: #141410;
}
#bd-panel-onboarding .bd-accordion:nth-child(4n+3) .bd-accordion-head > span:first-child::before,
#bd-panel-audit .bd-accordion:nth-child(4n+3) .bd-accordion-head > span:first-child::before {
  background: var(--brand-coral);
  color: #ffffff;
}
#bd-panel-onboarding .bd-accordion:nth-child(4n+4) .bd-accordion-head > span:first-child::before,
#bd-panel-audit .bd-accordion:nth-child(4n+4) .bd-accordion-head > span:first-child::before {
  background: var(--brand-blue);
  color: #ffffff;
}
#bd-panel-onboarding .bd-accordion-head:hover, #bd-panel-audit .bd-accordion-head:hover {
  background: rgba(20,20,16,.02);
}
.bd-acc-arrow { color: var(--text3); font-size: 13px; transition: transform .2s; }
#bd-panel-onboarding .bd-accordion-body, #bd-panel-audit .bd-accordion-body {
  padding: 4px 24px 26px;
}
.bd-field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 18px; }
.bd-field { display: flex; flex-direction: column; gap: 7px; }
.bd-field-wide { grid-column: 1 / -1; }
.bd-field > span {
  font-size: 12px; font-weight: 600; color: var(--text2);
  letter-spacing: .01em;
}
@media (max-width: 760px) { .bd-field-grid { grid-template-columns: 1fr; } }

/* ═══ R7 — DASHBOARD EXTRAS ════════════════════════════════════ */
.bd-dash-topbar {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px;
}
.bd-dash-kicker {
  font-size: 11px; font-weight: 700; letter-spacing: .1em;
  text-transform: uppercase; color: var(--text3);
}
.bd-hero { grid-template-columns: repeat(4, 1fr); }
.bd-hero-card-sm { min-height: 104px; }
.bd-hero-card-sm .bd-hero-value { font-size: 26px; }

.bd-dash-rank-row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 0; border-bottom: 1px solid rgba(20,20,16,.04);
}
.bd-dash-rank-row:last-child { border-bottom: none; }
.bd-dash-rank-n {
  width: 24px; height: 24px; border-radius: 8px; flex-shrink: 0;
  background: rgba(183,175,227,.12); color: var(--accent);
  font-size: 11.5px; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center;
}
.bd-dash-rank-name { flex: 1; font-size: 13.5px; font-weight: 600; color: var(--text1,#141410);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bd-dash-rank-name em { font-style: normal; font-size: 11px; color: var(--text3); font-weight: 500; margin-left: 6px; }
.bd-dash-rank-val { font-size: 13px; font-weight: 700; color: var(--text2); white-space: nowrap; }

.bd-dash-cust { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.bd-dash-cust-kpi { text-align: center; padding: 14px 8px; background: rgba(20,20,16,.02);
  border: 1px solid var(--border-subtle); border-radius: 12px; }
.bd-dash-cust-kpi span { display: block; font-size: 22px; font-weight: 700; letter-spacing: -.02em; color: var(--text1,#141410); }
.bd-dash-cust-kpi label { font-size: 11px; color: var(--text3); font-weight: 500; }

/* ═══ R7 — FLAGS EN CARGA DE DATOS ═════════════════════════════ */
.bd-de-block-wrap {
  border-radius: 14px; overflow: hidden;
  border: 1px solid var(--border-subtle);
}
.bd-de-block-wrap .bd-de-block { border: none; border-radius: 0; width: 100%; }
.bd-de-block-wrap.flagged { opacity: .65; }
.bd-de-flags {
  display: flex; gap: 20px; padding: 10px 20px 12px 58px;
  background: rgba(20,20,16,.015);
  border-top: 1px solid rgba(20,20,16,.04);
}
.bd-de-flags label {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 11.5px; color: var(--text3); cursor: pointer; user-select: none;
}
.bd-de-flags input { accent-color: var(--accent); }

/* ═══ R7 — UNIFICACIÓN GLOBAL UX ═══════════════════════════════ */
/* Un solo lenguaje de formularios en toda la app */
.form-input, select.form-input, textarea.form-input,
#srv-modal select, #srv-modal input[type=text],
.modal-box input, .modal-box select, .modal-box textarea {
  border-radius: 10px !important;
  font-size: 13.5px;
}
.form-label { font-size: 12px; font-weight: 600; color: var(--text2); }

/* Botones: jerarquía clara y consistente */
.btn-primary { border-radius: 10px; font-weight: 600; padding: 9px 18px; }
.btn-secondary { border-radius: 10px; font-weight: 500; }
.icon-btn { border-radius: 8px; }

/* Tablas: densidad respirable en todos los módulos */
.data-table th, .clients-table th {
  font-size: 10.5px; font-weight: 700; letter-spacing: .07em;
  text-transform: uppercase; color: var(--text3);
  padding-top: 10px; padding-bottom: 10px;
}
.data-table td { padding-top: 13px; padding-bottom: 13px; font-size: 13px; }

/* Estados vacíos consistentes */
.empty-state h4 { font-size: 16px; font-weight: 700; letter-spacing: -.01em; }
.empty-state p { font-size: 13px; color: var(--text3); max-width: 380px; margin-left: auto; margin-right: auto; }

/* Evitar textos cortados en cards y celdas */
.kpi-value { overflow-wrap: anywhere; }
.next-action-title { max-width: 100%; }
.ops-action-title { overflow: hidden; text-overflow: ellipsis; }

/* Modales con el mismo lenguaje */
.modal-box { border-radius: 18px; }
.modal-header h3 { font-size: 17px; letter-spacing: -.01em; }

/* R7 — Inputs oscuros en toda la app (adiós inputs blancos estilo Bootstrap) */
.form-input, select.form-input, textarea.form-input,
.bd-field input, .bd-field textarea, .bd-field select,
.modal-box input:not([type=checkbox]):not([type=radio]),
.modal-box select, .modal-box textarea {
  background: var(--bg1, #101010) !important;
  border: 1.5px solid var(--border-subtle, #23283d) !important;
  color: var(--text1, #141410) !important;
  font-family: var(--font-body) !important;
  padding: 9px 12px;
  transition: border-color .15s;
}
.form-input:focus, .bd-field input:focus, .bd-field textarea:focus,
.modal-box input:focus, .modal-box select:focus, .modal-box textarea:focus {
  border-color: var(--accent) !important;
  outline: none;
}
.form-input::placeholder, .bd-field input::placeholder, .bd-field textarea::placeholder {
  color: var(--text3, #6b6f5a);
}

/* ═══════════════════════════════════════════════════════════════
   R8 — TRANSFORMACIÓN DE PRODUCTO
   Principios: un protagonista por bloque · el número es el diseño ·
   delimitar con espacio, no con líneas · densidad decreciente ·
   cromía disciplinada · cero ruido administrativo.
   ═══════════════════════════════════════════════════════════════ */

/* ── A. EL NÚMERO ES EL DISEÑO ─────────────────────────────────── */
.kpi-value, .bd-hero-value, .posts-kpi-value, .funnel-kpi-value {
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.035em;
  line-height: 1.05;
}
.kpi-value { font-size: 34px; font-weight: 700; }
.bd-hero-value { font-size: 44px; }
.bd-hero-card-sm .bd-hero-value { font-size: 30px; }
.posts-kpi-value { font-size: 28px; font-weight: 700; }
/* Labels: quietos, que no compitan con el dato */
.kpi-label, .posts-kpi-label {
  font-size: 10.5px; font-weight: 600; letter-spacing: .09em;
  text-transform: uppercase; color: var(--text3);
}
.kpi-delta { font-size: 11.5px; }

/* ── B. DELIMITAR CON ESPACIO, NO CON LÍNEAS ───────────────────── */
/* Superficie sutil > borde + fondo + radio (triple delimitación) */
.kpi-card, .chart-card, .bd-hero-card, .bd-dash-section,
.ops-chart-card, .bd-exec, .dei-band, .posts-kpi-card,
.report-card, .bd-de-block-wrap, .bd-accordion {
  border-color: rgba(20,20,16,.045) !important;
  background: rgba(20,20,16,.022);
  box-shadow: none;
}
/* Los acentos laterales de urgencia se mantienen (tienen significado) */
.dei-band.dei-critica, .dei-band.dei-alta, .dei-band.dei-media,
.dei-band.dei-baja, .dei-band.dei-ok { border-left-width: 3px !important; }

/* Tablas sin cuadrícula: alineación y espacio hacen el trabajo */
.clients-table td, .data-table td { border-color: rgba(20,20,16,.04); }
.clients-table tr:hover td, .data-table tr:hover td { background: rgba(20,20,16,.015); }

/* ── D. HEADLINE EDITORIAL DEL CENTRO ──────────────────────────── */
.ops-kicker {
  font-size: 11px; font-weight: 700; letter-spacing: .12em;
  text-transform: uppercase; color: var(--text3); margin-bottom: 10px;
}
.ops-headline {
  font-size: 38px; font-weight: 700; letter-spacing: -0.03em;
  line-height: 1.12; color: var(--text1, #141410);
  max-width: 640px; margin: 0 0 8px;
}
.ops-headline strong { font-weight: 700; }
.ops-hl-crit { color: #EE5A38; }
.ops-hl-aten { color: #C0A2E5; }
.ops-hl-ok   { color: #141410; }
.ops-title { display: none; } /* reemplazado por kicker + headline */
.ops-meta { font-size: 12px; color: var(--text3); }
/* La tira de chips pasa a rol secundario, bajo el headline */
.ops-strip { margin-top: 4px; opacity: .85; }
.ops-chip { font-size: 11px; }

/* ── F. MICROINTERACCIONES SOBRIAS ─────────────────────────────── */
.kpi-card, .bd-hero-card, .bd-dash-section, .ops-chart-card,
.post-card, .bd-de-block-wrap, .report-card {
  transition: transform .16s ease, background .16s ease, border-color .16s ease;
}
.kpi-card:hover, .bd-hero-card:hover, .post-card:hover {
  transform: translateY(-2px);
  background: rgba(20,20,16,.032);
}
.nav-item { transition: background .14s ease, color .14s ease; }
.btn-primary, .btn-secondary, .dei-cta, .bd-exec-cta, .svc-banner-cta {
  transition: opacity .14s ease, transform .14s ease;
}
.btn-primary:active, .dei-cta:active, .bd-exec-cta:active { transform: scale(.98); }
button:focus-visible, .form-input:focus-visible {
  outline: 2px solid rgba(183,175,227,.5); outline-offset: 2px;
}

/* ── CROMÍA DISCIPLINADA ───────────────────────────────────────── */
/* Los KPI ya no gritan en 4 colores: el color queda para deltas y estados */
#ads-kpi-grid .kpi-value, #kpi-grid .kpi-value { color: var(--text1, #141410) !important; }

/* ── DETALLES DE QUIETUD ───────────────────────────────────────── */
.nav-group-label { font-size: 10px; letter-spacing: .12em; opacity: .7; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: rgba(20,20,16,.08); border-radius: 5px; border: 3px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-track { background: transparent; }

/* ═══ R8.1 — LA ÚLTIMA MILLA EDITORIAL ═════════════════════════ */

/* 1. Tipografía display real para datos y headlines */
:root { --font-display: 'Space Grotesk', var(--font-body); }
.ops-headline, .kpi-value, .bd-hero-value, .posts-kpi-value,
.funnel-kpi-value, .bd-dash-cust-kpi span, .bks-cell-label strong {
  font-family: var(--font-display);
}

/* 2. Hero asimétrico de BD: facturación domina la composición */
.bd-hero { grid-template-columns: 2fr 1fr 1fr; grid-auto-rows: auto; }
.bd-hero-card:nth-child(2) { /* Facturación: protagonista con superficie de rol */
  grid-column: 1; grid-row: 1 / span 2; order: -1;
  background: var(--brand-violet);
  border-color: rgba(183,175,227,.22) !important;
  justify-content: center; padding: 34px 34px;
}
.bd-hero-card:nth-child(2) .bd-hero-value { font-size: 62px; }
.bd-hero-card:nth-child(2) .bd-hero-label { color: #C0A2E5; }
@media (max-width: 1000px) {
  .bd-hero { grid-template-columns: 1fr 1fr; }
  .bd-hero-card:nth-child(2) { grid-column: 1 / -1; grid-row: auto; }
  .bd-hero-card:nth-child(2) .bd-hero-value { font-size: 44px; }
}

/* 3. Cartera de Clientes: la tabla que no parece tabla */
.clients-table thead th {
  border-bottom: none; padding-bottom: 14px;
}
.clients-table td { border-bottom: 1px solid rgba(20,20,16,.03); }
.clients-table tbody tr:last-child td { border-bottom: none; }
.client-name-cell { font-size: 16.5px; font-weight: 700; letter-spacing: -.015em; }
.client-name-cell .client-avatar { width: 34px; height: 34px; font-size: 14px; }
.clients-table td { padding-top: 18px; padding-bottom: 18px; }
#clients-table-wrap { background: none; }
.clients-table { border-collapse: collapse; }

/* 4. Entrada escalonada sobria (solo transform/opacity, respeta reduced-motion) */
@media (prefers-reduced-motion: no-preference) {
  .bd-hero-card, .kpi-card, .ops-chart-card, .bd-dash-section {
    animation: rise-in .38s ease both;
  }
  .bd-hero-card:nth-child(1), .kpi-card:nth-child(1) { animation-delay: .03s; }
  .bd-hero-card:nth-child(2), .kpi-card:nth-child(2) { animation-delay: .07s; }
  .bd-hero-card:nth-child(3), .kpi-card:nth-child(3) { animation-delay: .11s; }
  .bd-hero-card:nth-child(4), .kpi-card:nth-child(4) { animation-delay: .15s; }
  .bd-hero-card:nth-child(5) { animation-delay: .19s; }
  .bd-hero-card:nth-child(6) { animation-delay: .23s; }
  .bd-hero-card:nth-child(7) { animation-delay: .27s; }
}
@keyframes rise-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}

/* Headline del Centro también en display */
.ops-headline { font-size: 42px; }

/* ═══ R8.2 — PALETA DE MARCA (de la referencia) ════════════════ */
/* Roles, no decoración:
   crema  = statement (la card que domina)
   oliva  = crecimiento / actividad
   lila   = comparativas / conocimiento
   naranja= acción (CTAs, foco interactivo)                        */
:root {
  --brand-cream:  #ECEFE3;
  --brand-lime:   #C6F24E;
  --brand-violet: #B7AFE3;
  --brand-orange: #EE5A38;
  --brand-olive:  #C6F24E;
  --brand-lilac:  #B7AFE3;
  /* El acento de acción pasa del violeta genérico al naranja de marca */
  --accent:       #EE5A38;
  --accent-soft:  rgba(241, 87, 31, .14);
}

/* Statement en crema: la card dominante habla en positivo (texto oscuro) */
.bd-hero-card:nth-child(2) {
  background: var(--brand-cream);
  border-color: transparent !important;
}
.bd-hero-card:nth-child(2) .bd-hero-value { color: #10120b; }
.bd-hero-card:nth-child(2) .bd-hero-label { color: #6b6f5a; }
.bd-hero-card:nth-child(2) .bd-hero-sub   { color: #6b6f5a; }
.bd-hero-card:nth-child(2) .bd-hero-chip {
  background: rgba(16,18,11,.08); border-color: rgba(16,18,11,.15); color: #3d4032;
}
.bd-hero-card:nth-child(2) .bd-hero-chip.pos { color: #3c6b1f; border-color: rgba(60,107,31,.35); background: rgba(60,107,31,.1); }
.bd-hero-card:nth-child(2) .bd-hero-chip.neg { color: #b03415; border-color: rgba(176,52,21,.3); background: rgba(176,52,21,.08); }

/* Conocimiento del negocio: superficie lila */
.bd-hero-card:nth-child(1) {
  background: var(--brand-lilac);
  border-color: transparent !important;
}
.bd-hero-card:nth-child(1) .bd-hero-value { color: #10120b; }
.bd-hero-card:nth-child(1) .bd-hero-label { color: #3d3a55; }
.bd-hero-card:nth-child(1) .bd-hero-sub { color: #3d3a55; }
.bd-hero-card:nth-child(1) .bd-hero-bar { background: rgba(16,18,11,.15); }
.bd-hero-card:nth-child(1) .bd-hero-bar div { background: #10120b; }

/* BKS y elementos de "conocimiento" en lila (rol consistente) */
.dei-bks { color: var(--brand-lilac) !important; border-color: rgba(183,175,227,.3) !important; background: rgba(183,175,227,.08) !important; }
.bks-bar-fill { background: var(--brand-lilac); }
.bd-exec-action-label { color: var(--brand-orange); }

/* El naranja de acción hereda vía --accent en: nav activa, CTAs,
   botones primarios, links, focus. Suavizar donde era demasiado violeta: */
.nav-item.active { background: rgba(238,90,56,.12); }
.bd-tab.active { background: var(--brand-orange); color: #141410; }

/* ═══ R8.3 — UN STATEMENT POR PANTALLA ═════════════════════════ */
/* La primera métrica de cada dashboard habla en crema (texto oscuro):
   el mismo gesto en Meta Ads, Instagram y Business Design. */
#ads-kpi-grid .kpi-card:first-child,
#kpi-grid .kpi-card:first-child {
  background: var(--brand-cream);
  border-color: transparent !important;
}
#ads-kpi-grid .kpi-card:first-child .kpi-value,
#kpi-grid .kpi-card:first-child .kpi-value {
  color: #10120b !important;
}
#ads-kpi-grid .kpi-card:first-child .kpi-label,
#kpi-grid .kpi-card:first-child .kpi-label { color: #6b6f5a; }
#ads-kpi-grid .kpi-card:first-child .kpi-delta.up,
#kpi-grid .kpi-card:first-child .kpi-delta.up { color: #3c6b1f; }
#ads-kpi-grid .kpi-card:first-child .kpi-delta.down,
#kpi-grid .kpi-card:first-child .kpi-delta.down { color: #b03415; }

/* Nav activa: el naranja como marcador fino, no como bloque */
.nav-item.active {
  background: rgba(238,90,56,.08);
  box-shadow: inset 2.5px 0 0 var(--brand-orange);
}

/* El glow del login pasa a neutro cálido (el naranja a plena pantalla cansa) */
.login-screen { background-image: none !important; }

/* R10 — Banda DEI compacta fuera de su pantalla (no roba foco) */
.dei-band-slim { padding: 8px 14px; }
.dei-slim-row { flex-wrap: nowrap; align-items: center; }
.dei-slim-title {
  flex: 1; min-width: 0; font-size: 12.5px; color: var(--text2);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.dei-band-slim .dei-cta { padding: 5px 12px; font-size: 12px; }

/* R10 — Inteligencia: el BKS como contexto, antes de los aprendizajes */
.intel-bks {
  background: var(--brand-lilac);
  border: none;
  border-radius: 18px; padding: 24px 26px; margin-bottom: 20px;
}
.intel-bks * { color: #10120b !important; }
.intel-bks .intel-bks-sub, .intel-bks .intel-bks-dim-name { color: #3d3a55 !important; }
.intel-bks-dim-bar { background: rgba(16,18,11,.15) !important; }
.intel-bks-dim-bar div { background: #10120b !important; }
.intel-bks-head { display: flex; align-items: center; gap: 18px; margin-bottom: 18px; }
.intel-bks-score {
  font-family: var(--font-display); font-size: 44px; font-weight: 700;
  letter-spacing: -.03em; color: var(--brand-lilac);
}
.intel-bks-title { font-size: 14.5px; font-weight: 700; }
.intel-bks-sub { font-size: 12px; color: var(--text3); }
.intel-bks-dims { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 28px; }
.intel-bks-dim { display: flex; align-items: center; gap: 10px; }
.intel-bks-dim-name { width: 150px; font-size: 12px; color: var(--text2); flex-shrink: 0; }
.intel-bks-dim-bar { flex: 1; height: 5px; background: rgba(20,20,16,.05); border-radius: 3px; overflow: hidden; }
.intel-bks-dim-bar div { height: 100%; background: var(--brand-lilac); border-radius: 3px; }
.intel-bks-dim-val { width: 36px; text-align: right; font-size: 11.5px; font-weight: 700; color: var(--text2); font-variant-numeric: tabular-nums; }
@media (max-width: 900px) { .intel-bks-dims { grid-template-columns: 1fr; } }

/* ═══ R10.1 — INTERACCIÓN VIVA (sutil, nunca circo) ════════════ */
/* Las filas de acción se deslizan hacia su destino */
.ops-action-item, .bd-dash-rank-row, .ops-cs-row {
  transition: transform .18s cubic-bezier(.2,.7,.3,1), background .18s ease;
}
.ops-action-item:hover, .ops-cs-row:hover {
  transform: translateX(4px);
  background: rgba(20,20,16,.025);
}
.bd-dash-rank-row:hover { transform: translateX(4px); }

/* Cards: levantan con una sombra que aparece (profundidad al tacto) */
.kpi-card:hover, .bd-hero-card:hover, .post-card:hover,
.ops-chart-card:hover, .bd-dash-section:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 32px -18px rgba(0,0,0,.7);
}

/* Bloques de carga: el ícono avanza con el bloque */
.bd-de-block { transition: transform .18s cubic-bezier(.2,.7,.3,1), border-color .18s ease; }
.bd-de-block:hover { transform: translateX(5px); }
.bd-de-block:hover .bd-de-icon { transform: scale(1.12); }
.bd-de-icon { transition: transform .18s ease; }

/* Tabs y chips responden al cursor */
.bd-tab, .overview-tab, .period-btn, .posts-period-tab {
  transition: transform .15s ease, background .15s ease, color .15s ease;
}
.bd-tab:hover:not(.active), .period-btn:hover:not(.active) { transform: translateY(-1px); }

/* CTAs: la flecha del texto avanza */
.dei-cta:hover, .bd-exec-cta:hover, .bd-dash-link:hover { transform: translateX(2px); }

/* Filas de la cartera: el nombre responde */
.clients-table tbody tr { transition: background .15s ease; }
.clients-table tbody tr:hover .client-name-cell { color: var(--brand-orange); transition: color .15s ease; }
.client-name-cell { transition: color .15s ease; }

/* Nav: micro-desplazamiento al hover */
.nav-item:hover:not(.active) { transform: translateX(2px); }
.nav-item { transition: transform .15s ease, background .14s ease, color .14s ease; }

/* Respeto absoluto por reduced-motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

/* ═══ R10.2 — ANIMACIÓN DE MENÚ, VENTANAS Y SECCIONES ══════════ */
/* El menú entra en cascada al renderizarse */
#nav-modules .nav-item, #nav-modules .nav-group-label {
  animation: nav-in .3s ease both;
}
#nav-modules .nav-item:nth-child(2)  { animation-delay: .02s; }
#nav-modules .nav-item:nth-child(4)  { animation-delay: .05s; }
#nav-modules .nav-item:nth-child(6)  { animation-delay: .08s; }
#nav-modules .nav-item:nth-child(8)  { animation-delay: .11s; }
#nav-modules .nav-item:nth-child(10) { animation-delay: .14s; }
#nav-modules .nav-item:nth-child(12) { animation-delay: .17s; }
@keyframes nav-in {
  from { opacity: 0; transform: translateX(-8px); }
  to   { opacity: 1; transform: none; }
}

/* Las ventanas (modales) entran con presencia */
.modal-overlay { animation: overlay-in .18s ease both; }
.modal-overlay .modal-box { animation: modal-in .26s cubic-bezier(.2,.8,.3,1.05) both; }
@keyframes overlay-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes modal-in {
  from { opacity: 0; transform: scale(.955) translateY(10px); }
  to   { opacity: 1; transform: none; }
}

/* Cambio de sección: el contenido sube suave */
.section.active { animation: section-in .18s ease-out; }
@keyframes section-in { from { transform: translateY(6px); } to { transform: none; } }

/* ═══ R10.3 — DOCUMENTO BEHANCE: color pleno con propósito ═════ */

/* Títulos del menú: cada grupo con su color de paleta (sin azul) */
.nav-group-label { color: var(--text3); }
#nav-modules .nav-group-label:nth-of-type(1) { color: var(--brand-cream); }   /* Business Design */
#nav-modules .nav-group-label:nth-of-type(2) { color: var(--brand-lilac); }   /* Instagram Orgánico */
#nav-modules .nav-group-label:nth-of-type(3) { color: var(--brand-olive); }   /* Estrategia */
#nav-modules .nav-group-label:nth-of-type(4) { color: var(--brand-orange); }  /* Meta Ads */
#nav-modules .nav-group-label:nth-of-type(5) { color: var(--brand-cream); }   /* Cliente */
.section-label { color: var(--brand-lilac); } /* "CLIENTES" del sidebar */

/* Títulos de sección del tablero: rotación de paleta (títulos de colores) */
.bd-dash-section:nth-of-type(odd) .bd-dash-section-head h3 { color: var(--brand-cream); }
.bd-dash-section:nth-of-type(even) .bd-dash-section-head h3 { color: var(--brand-lilac); }
.bd-dash-row .bd-dash-section:nth-child(2) .bd-dash-section-head h3 { color: var(--brand-olive); }
.ops-chart-card:nth-child(1) .ops-chart-title { color: var(--brand-olive); }
.ops-chart-card:nth-child(2) .ops-chart-title { color: var(--brand-lilac); }

/* KPI grids: la segunda card también juega en pleno (lila) */
#ads-kpi-grid .kpi-card:nth-child(2),
#kpi-grid .kpi-card:nth-child(2) {
  background: var(--brand-lilac);
  border-color: transparent !important;
}
#ads-kpi-grid .kpi-card:nth-child(2) .kpi-value,
#kpi-grid .kpi-card:nth-child(2) .kpi-value { color: #10120b !important; }
#ads-kpi-grid .kpi-card:nth-child(2) .kpi-label,
#kpi-grid .kpi-card:nth-child(2) .kpi-label { color: #3d3a55; }
#ads-kpi-grid .kpi-card:nth-child(2) .kpi-delta,
#kpi-grid .kpi-card:nth-child(2) .kpi-delta { color: #3d3a55 !important; }

/* Hero BD: Rentabilidad en oliva pleno (tercer bloque de color) */
.bd-hero-card:nth-child(3) {
  background: var(--brand-olive);
  border-color: transparent !important;
}
.bd-hero-card:nth-child(3) .bd-hero-value { color: #10120b; }
.bd-hero-card:nth-child(3) .bd-hero-label,
.bd-hero-card:nth-child(3) .bd-hero-sub { color: #3f3a12; }

/* Los títulos de las cards del Centro (buckets) con color */
.ops-bucket-title, #section-portfolio h3 { color: var(--brand-cream); }

/* Posts KPI: títulos en paleta */
.posts-kpi-card:nth-child(1) .posts-kpi-label { color: var(--brand-cream); }
.posts-kpi-card:nth-child(2) .posts-kpi-label { color: var(--brand-lilac); }
.posts-kpi-card:nth-child(3) .posts-kpi-label { color: var(--brand-olive); }
.posts-kpi-card:nth-child(4) .posts-kpi-label { color: var(--brand-orange); }

/* ═══════════════════════════════════════════════════════════════
   R11 — RE-THEME BEHANCE: lima + violeta protagonistas, naranja
   solo detalle, menú crema flotante, cards de color, cero negros sueltos.
   ═══════════════════════════════════════════════════════════════ */

/* Fondo general: papel cálido neutro (como el fondo de la referencia) */
body { background: #F1F0E9 !important; }

/* ── MENÚ: ventana crema flotante con puntas redondeadas ── */
.sidebar {
  background: var(--brand-cream) !important;
  border: none !important;
  margin: 12px 0 12px 12px;
  height: calc(100vh - 24px);
  border-radius: 24px;
  box-shadow: 0 20px 60px -30px rgba(0,0,0,.6);
  overflow-y: auto; overflow-x: hidden;
}
.sidebar::before { display: none !important; }  /* fuera el blob decorativo */

/* Logo negro sobre crema */
.sidebar-header { border-bottom: 1px solid rgba(16,18,11,.08) !important; }
.sidebar .logo-wordmark { color: #10120b !important; }
.sidebar .logo-dot { color: #10120b !important; }

/* Ítems del menú: texto oscuro sobre crema */
.nav-item { color: #4a4c41 !important; border-left: none !important; }
.nav-item svg { opacity: .55; }
.nav-item:hover { background: rgba(16,18,11,.05); color: #10120b !important; }
.nav-item:hover svg { opacity: .85; }
/* Activo: bloque lima pleno con texto negro (protagonista) */
.nav-item.active {
  background: var(--brand-lime) !important;
  color: #10120b !important;
  border-radius: 12px !important;
  padding-left: 14px !important;
  font-weight: 600;
}
.nav-item.active svg { opacity: 1; }

/* Títulos del menú: un solo color, negro (anula los colores por grupo de R10.3) */
.nav-group-label,
#nav-modules .nav-group-label,
#nav-modules .nav-group-label:nth-of-type(1),
#nav-modules .nav-group-label:nth-of-type(2),
#nav-modules .nav-group-label:nth-of-type(3),
#nav-modules .nav-group-label:nth-of-type(4),
#nav-modules .nav-group-label:nth-of-type(5) {
  color: #10120b !important; opacity: .55; font-weight: 700;
}
.section-label { color: #10120b !important; opacity: .5 !important; }

/* Chips de clientes en el sidebar: texto oscuro */
.client-chip { color: #4a4c41 !important; }
.client-chip:hover { background: rgba(16,18,11,.05); color: #10120b !important; }
.client-chip.active {
  background: var(--brand-violet) !important;
  color: #10120b !important; border-left: none !important;
  border-radius: 12px !important; padding-left: 12px !important;
}
.archived-toggle { color: #6b6d5f !important; }
.archived-toggle:hover { color: #10120b !important; }
.chip-restore-btn { color: #6b6d5f !important; }
.chip-restore-btn:hover { background: rgba(16,18,11,.08) !important; color: #10120b !important; }

/* Footer del sidebar: sobre crema */
.sidebar-footer { border-top: 1px solid rgba(16,18,11,.08) !important; }
.sidebar-user-name { color: #10120b !important; }
.sidebar-user-role { color: #6b6d5f !important; }
.sidebar-user-btn { color: #4a4c41 !important; border-color: rgba(16,18,11,.12) !important; }
.sidebar-user-btn:hover { background: rgba(16,18,11,.06) !important; }
.btn-update {
  background: #10120b !important; color: var(--brand-cream) !important;
  border: none !important; border-radius: 12px !important;
}
.btn-update:hover { background: #23261a !important; }
.sidebar-logout-btn:hover { color: #EE5A38 !important; }

/* Scrollbar del sidebar en tono crema */
.sidebar::-webkit-scrollbar-thumb { background: rgba(16,18,11,.15); }

/* ── CARDS DE COLOR: menos negro, jerarquía cromática ── */

/* Hero BD: 3 bloques de color pleno + estado general oscuro (semáforo) */
.bd-hero-card:nth-child(2) { background: var(--brand-cream); }        /* Facturación — crema */
.bd-hero-card:nth-child(1) { background: var(--brand-violet); }       /* Conocimiento — violeta */
.bd-hero-card:nth-child(3) { background: var(--brand-lime); }         /* Rentabilidad — lima */
.bd-hero-card:nth-child(3) .bd-hero-value { color: #10120b; }
.bd-hero-card:nth-child(3) .bd-hero-label,
.bd-hero-card:nth-child(3) .bd-hero-sub { color: #3f4a12; }
/* Las 3 chicas (salud, financiero, objetivos): superficie clara translúcida, no negro */
.bd-hero-card:nth-child(4),
.bd-hero-card:nth-child(5),
.bd-hero-card:nth-child(6),
.bd-hero-card:nth-child(7) {
  background: rgba(236,239,227,.06);
  border-color: rgba(236,239,227,.12) !important;
}

/* Centro: las dos chart-cards con un lavado de color (no negro pleno) */
.ops-chart-card:nth-child(1) { background: rgba(198,242,78,.05); border-color: rgba(198,242,78,.14) !important; }
.ops-chart-card:nth-child(2) { background: rgba(183,175,227,.05); border-color: rgba(183,175,227,.14) !important; }

/* Secciones del tablero: superficie cálida, no #000 */
.bd-dash-section { background: rgba(236,239,227,.035) !important; }

/* KPI grids: 1ª crema (statement), 2ª violeta, 3ª lima — el resto oscuro sutil */
#ads-kpi-grid .kpi-card:nth-child(3),
#kpi-grid .kpi-card:nth-child(3) {
  background: var(--brand-lime); border-color: transparent !important;
}
#ads-kpi-grid .kpi-card:nth-child(3) .kpi-value,
#kpi-grid .kpi-card:nth-child(3) .kpi-value { color: #10120b !important; }
#ads-kpi-grid .kpi-card:nth-child(3) .kpi-label,
#kpi-grid .kpi-card:nth-child(3) .kpi-label { color: #3f4a12; }

/* Títulos de sección del tablero: un solo color (blanco) — sin arcoíris */
.bd-dash-section .bd-dash-section-head h3,
.bd-dash-row .bd-dash-section .bd-dash-section-head h3,
.ops-chart-card .ops-chart-title {
  color: #141410 !important;
}

/* "Próximo paso" y labels de acento: lima en vez de naranja protagonista */
.bd-exec-action-label { color: var(--brand-lime) !important; }
.ops-kicker, .bd-dash-kicker { color: var(--brand-lime); }

/* DEI band BKS chip → violeta (rol conocimiento) */
.dei-bks { color: var(--brand-violet) !important; }

/* R11 — Tab activa de BD en lima (naranja solo detalle/hover) */
.bd-tab.active { background: var(--brand-lime) !important; color: #10120b !important; }
/* Sub-tabs (overview, períodos) activos en violeta */
.overview-tab.active, .period-btn.active, .posts-period-tab.active, .brief-tab.active {
  background: #141410 !important; color: #F1F0E9 !important; border-color: transparent !important;
}
/* "+ Nuevo cliente" y CTAs primarios: negro sobrio (el color llega en el hover cíclico) */
.btn-primary { background: #10120b; color: var(--brand-cream); border: 1px solid rgba(236,239,227,.18); }

/* ═══════════════════════════════════════════════════════════════
   R12 — TEMA CLARO (papel) · fiel a la referencia abc
   Fondo papel, cards blancas o de color pleno, texto negro.
   ═══════════════════════════════════════════════════════════════ */

body { background: #F1F0E9 !important; color: #141410 !important; }

/* Sidebar: ventana BLANCA flotante sobre papel */
.sidebar { background: #ffffff !important; box-shadow: 0 10px 40px -24px rgba(20,20,16,.25); }
.sidebar .logo-wordmark, .sidebar .logo-dot { color: #141410 !important; }
.nav-item { color: #6b6b60 !important; }
.nav-item:hover { background: rgba(20,20,16,.05); color: #141410 !important; }
.nav-item.active { background: var(--brand-lime) !important; color: #141410 !important; }
.nav-group-label, .section-label { color: #141410 !important; opacity: .5; }
.client-chip { color: #6b6b60 !important; }
.client-chip.active { background: var(--brand-violet) !important; color: #141410 !important; }
.archived-toggle { color: #6b6b60 !important; }
.archived-toggle:hover { color: #141410 !important; }

/* Cards de datos: BLANCAS con borde sutil (no superficies translúcidas) */
.kpi-card, .chart-card, .ops-chart-card, .bd-dash-section, .dei-band,
.report-card, .bd-exec, .posts-kpi-card, .bd-de-block-wrap, .bd-accordion,
.srv-modal .modal-box, .modal-box, .card, .intel-bks,
.ops-action-item, #clients-table-wrap, .discovered-card {
  background: #ffffff !important;
  border: 1px solid rgba(20,20,16,.09) !important;
}

/* Superficies de color PLENO se mantienen (statement cards) */
.bd-hero-card:nth-child(2) { background: #F1F0E9 !important; }
.bd-hero-card:nth-child(1) { background: var(--brand-violet) !important; }
.bd-hero-card:nth-child(3) { background: var(--brand-lime) !important; }
.bd-hero-card:nth-child(4), .bd-hero-card:nth-child(5),
.bd-hero-card:nth-child(6), .bd-hero-card:nth-child(7) { background: #ffffff !important; border:1px solid rgba(20,20,16,.09) !important; }
#ads-kpi-grid .kpi-card:first-child, #kpi-grid .kpi-card:first-child { background: #F1F0E9 !important; }
#ads-kpi-grid .kpi-card:nth-child(2), #kpi-grid .kpi-card:nth-child(2) { background: var(--brand-violet) !important; }
#ads-kpi-grid .kpi-card:nth-child(3), #kpi-grid .kpi-card:nth-child(3) { background: var(--brand-lime) !important; }
.ops-chart-card:nth-child(1) { background: #ffffff !important; }
.ops-chart-card:nth-child(2) { background: #ffffff !important; }

/* Títulos y texto principal → negro */
h1,h2,h3,h4, .kpi-value, .bd-hero-value, .ops-headline, .posts-kpi-value,
.bd-dash-section-head h3, .ops-chart-title, .page-title, #page-title,
.client-name-cell, .bd-panel-header h2, .clients-header h3, .ops-title {
  color: #141410 !important;
}
.kpi-label, .posts-kpi-label, .bd-dash-kicker, .ops-kicker { color: #7a7a70 !important; }

/* Statement cards de color: texto oscuro (contraste sobre pastel) */
.bd-hero-card:nth-child(1) .bd-hero-value, .bd-hero-card:nth-child(3) .bd-hero-value,
#ads-kpi-grid .kpi-card:nth-child(2) .kpi-value, #ads-kpi-grid .kpi-card:nth-child(3) .kpi-value,
#kpi-grid .kpi-card:nth-child(2) .kpi-value, #kpi-grid .kpi-card:nth-child(3) .kpi-value {
  color: #141410 !important;
}

/* Topbar / header → papel, sin barra oscura */
.topbar, .main-header, .ops-topbar { background: transparent !important; }
#client-select, .client-select, select {
  background: #ffffff !important; color: #141410 !important;
  border: 1px solid rgba(20,20,16,.14) !important;
}

/* Tablas: sobre blanco */
.clients-table td, .data-table td { color: #141410; border-color: rgba(20,20,16,.07) !important; }
.clients-table th, .data-table th { color: #8a8a80 !important; }
.clients-table tbody tr:hover td, .data-table tr:hover td { background: rgba(20,20,16,.02); }

/* Chips / badges legibles sobre claro */
.badge, .svc-chip, .dei-chip, .bd-exec-chip { color: #55554c; }
.badge-gray { background: rgba(20,20,16,.06); color: #8a8a80; }

/* Botones primarios: negro con texto papel (alto contraste, como la referencia) */
.btn-primary { background: #141410 !important; color: #F1F0E9 !important; border: none !important; }
.btn-secondary { background: #ffffff !important; color: #141410 !important; border: 1px solid rgba(20,20,16,.14) !important; }
.btn-update { background: #141410 !important; color: #F1F0E9 !important; }

/* Inputs claros */
.form-input, textarea.form-input, select.form-input, .bd-field input, .bd-field textarea, .bd-field select, .modal-box input, .modal-box textarea, .modal-box select {
  background: #ffffff !important; color: #141410 !important; border: 1px solid rgba(20,20,16,.14) !important;
  font-family: var(--font-body) !important;
}
.form-input::placeholder { color: #b0b0a6; }

.objectives-active-row {
  margin: 18px 0 18px;
  padding: 0 4px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.objectives-active-label {
  color: var(--text2);
  font-size: 14px;
  font-weight: 600;
}
.objectives-active-chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.objective-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 7px 16px;
  border-radius: 999px;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 800;
  line-height: 1;
}
.objective-chip-0 { background: var(--brand-lime); color: #141410; }
.objective-chip-1 { background: var(--brand-violet); color: #141410; }
.objective-chip-2 { background: var(--brand-coral); color: #ffffff; }
.objective-chip-3 { background: var(--brand-blue); color: #ffffff; }

/* Scrollbar clara */
::-webkit-scrollbar-thumb { background: rgba(20,20,16,.14) !important; }

/* Estados vacíos y textos secundarios */
.empty-state h4 { color: #141410; }
.empty-state p, .bd-panel-subtitle, .bd-dash-section-hint { color: #8a8a80; }

/* ═══════════════════════════════════════════════════════════════
   R12.1 — CARDS DE COLOR PLENO + HOVER GLOBAL + DELTAS
   Regla: cada card statement un color de la paleta (nunca papel).
   Texto negro salvo deltas: verde sube, coral baja.
   ═══════════════════════════════════════════════════════════════ */

/* Hero BD: 3 statements en color pleno distinto (no papel = fondo) */
.bd-hero-card:nth-child(2) { background: var(--brand-lime) !important; }       /* Facturación */
.bd-hero-card:nth-child(1) { background: var(--brand-violet) !important; }     /* Conocimiento */
.bd-hero-card:nth-child(3) { background: var(--brand-periwinkle) !important; } /* Rentabilidad */
.bd-hero-card:nth-child(2) .bd-hero-value,
.bd-hero-card:nth-child(1) .bd-hero-value,
.bd-hero-card:nth-child(3) .bd-hero-value,
.bd-hero-card .bd-hero-label, .bd-hero-card .bd-hero-sub { color: #141410 !important; }
.bd-hero-card:nth-child(4), .bd-hero-card:nth-child(5),
.bd-hero-card:nth-child(6), .bd-hero-card:nth-child(7) { background: #ffffff !important; }

/* KPI statement (Instagram / Meta Ads): lima · violeta · periwinkle · blanco */
#ads-kpi-grid .kpi-card:first-child, #kpi-grid .kpi-card:first-child { background: var(--brand-lime) !important; }
#ads-kpi-grid .kpi-card:nth-child(2), #kpi-grid .kpi-card:nth-child(2) { background: var(--brand-violet) !important; }
#ads-kpi-grid .kpi-card:nth-child(3), #kpi-grid .kpi-card:nth-child(3) { background: var(--brand-periwinkle) !important; }
#ads-kpi-grid .kpi-card .kpi-value, #kpi-grid .kpi-card .kpi-value,
#ads-kpi-grid .kpi-card .kpi-label, #kpi-grid .kpi-card .kpi-label { color: #141410 !important; }

/* Posts KPIs: rotación de paleta */
.posts-kpi-card:nth-child(1) { background: var(--brand-lime) !important; }
.posts-kpi-card:nth-child(2) { background: var(--brand-violet) !important; }
.posts-kpi-card:nth-child(3) { background: var(--brand-periwinkle) !important; }
.posts-kpi-card:nth-child(4) { background: var(--brand-mauve) !important; }
.posts-kpi-card .posts-kpi-value, .posts-kpi-card .posts-kpi-label { color: #141410 !important; }

/* Cartera: barra de conocimiento (BKS) en violeta */
.bks-bar-fill { background: var(--brand-violet) !important; }

/* SOMBRA DE HOVER EN TODAS LAS CARDS (la de Business Design, en todos lados) */
.kpi-card, .chart-card, .ops-chart-card, .bd-dash-section, .bd-hero-card,
.report-card, .posts-kpi-card, .bd-de-block-wrap, .bd-exec, .intel-bks,
.dei-band, .ops-action-item, .discovered-card, .card {
  transition: transform .18s cubic-bezier(.2,.7,.3,1), box-shadow .18s ease !important;
}
.kpi-card:hover, .chart-card:hover, .ops-chart-card:hover, .bd-dash-section:hover,
.bd-hero-card:hover, .report-card:hover, .posts-kpi-card:hover, .bd-de-block-wrap:hover,
.intel-bks:hover, .discovered-card:hover, .card:hover {
  transform: translateY(-4px);
  box-shadow: 0 18px 40px -20px rgba(20,20,16,.35) !important;
}

/* DELTAS: única excepción a "texto negro" — verde sube, coral baja */
.kpi-delta.up, .kpi-delta.pos, .bd-hero-chip.pos { color: #0f9d58 !important; }
.kpi-delta.down, .kpi-delta.neg, .bd-hero-chip.neg { color: #EE5A38 !important; }

/* Statement cards: deltas mantienen verde/coral incluso sobre color */
.bd-hero-card .bd-hero-chip.pos { color: #1a6b34 !important; }
.bd-hero-card .bd-hero-chip.neg { color: #a8360f !important; }

/* ═══════════════════════════════════════════════════════════════
   R12.2 — CORRECCIONES DE LOTE (paleta estricta, sin naranja glow)
   ═══════════════════════════════════════════════════════════════ */

/* Cruz de cerrar: arriba a la derecha, sin fondo, solo la X */
.modal-box { position: relative; }
.modal-header { display: flex; align-items: center; justify-content: space-between; }
.modal-close {
  position: absolute; top: 16px; right: 18px;
  width: 30px; height: 30px; padding: 0;
  background: none !important; border: none !important;
  color: #8a8a80 !important; font-size: 20px; line-height: 1;
  cursor: pointer; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
}
.modal-close:hover { background: rgba(20,20,16,.06) !important; color: #141410 !important; }

/* Modales de carga: horizontales (más anchos, campos en 2 columnas) */
#bd-fin-modal .modal-box, #bd-product-modal .modal-box, #bd-customer-modal .modal-box,
#bd-channel-modal .modal-box, #bd-objective-modal .modal-box, #nc-modal .modal-box {
  max-width: 680px !important; width: 92vw !important;
}
/* Body: stack de filas; cada fila ya es un grid horizontal de campos */
.modal-body { display: flex; flex-direction: column; gap: 14px; }

/* Labels pegados a su casillero */
.modal-body label, .modal-body .form-label { margin-bottom: 3px !important; }
.form-label { display: block; margin-bottom: 4px; }
.modal-body > label { display: flex; flex-direction: column; gap: 4px; }

/* BOTONES: sin naranja, negros con sombra de card (o blancos con borde) */
.btn-primary, .btn-primary:hover {
  background: #141410 !important; color: #F1F0E9 !important; border: none !important;
  box-shadow: 0 10px 24px -14px rgba(20,20,16,.4) !important;
}
.btn-secondary { background: #fff !important; color: #141410 !important; border: 1px solid rgba(20,20,16,.14) !important; box-shadow: none !important; }
.btn-secondary:hover { box-shadow: 0 8px 20px -12px rgba(20,20,16,.3) !important; }

/* "Ver →" del Centro: neutro (blanco con borde), no coral */
.ops-action-cta {
  background: #fff !important; color: #141410 !important;
  border: 1px solid rgba(20,20,16,.14) !important; box-shadow: none !important;
}
.ops-action-cta:hover { box-shadow: 0 8px 18px -10px rgba(20,20,16,.3) !important; transform: translateY(-1px); }

/* +Nuevo cliente y cuentas descubiertas: sombra card, sin glow naranja */
.discovered-card, .discovered-card button {
  box-shadow: none !important;
}
.discovered-card button, .btn-primary {
  background: #141410 !important; color: #F1F0E9 !important;
}

/* Performance y Posts: KPIs con color pleno de la paleta */
#section-performance .kpi-card:nth-child(1), #perf-kpis .kpi-card:nth-child(1) { background: var(--brand-lime) !important; }
#section-performance .kpi-card:nth-child(2), #perf-kpis .kpi-card:nth-child(2) { background: var(--brand-violet) !important; }
#section-performance .kpi-card:nth-child(3), #perf-kpis .kpi-card:nth-child(3) { background: var(--brand-periwinkle) !important; }
#section-performance .kpi-card:nth-child(4), #perf-kpis .kpi-card:nth-child(4) { background: var(--brand-mauve) !important; }
#section-performance .kpi-card .kpi-value, #section-performance .kpi-card .kpi-label { color: #141410 !important; }

/* Semáforo del headline: crítico en coral (no rojo puro) */
.ops-hl-crit { color: #EE5A38 !important; }
.ops-hl-aten { color: #B58A2E !important; }
.ops-hl-ok   { color: #4a7a1e !important; }

/* ═══════════════════════════════════════════════════════════════
   R14 — PALETA FINAL DE 4 COLORES + CONTRASTE AUTOMÁTICO DE TEXTO
   Solo: violeta #C0A2E5 · lima #CFEA5B · azul #4657D4 · coral #EE5A38
   + papel · blanco · negro. Nada más. Texto negro/blanco por contraste.
   ═══════════════════════════════════════════════════════════════ */

/* Colores claros → TEXTO NEGRO. Colores oscuros → TEXTO BLANCO. */

/* ── Cards claras (texto negro) ── */
.bd-hero-card:nth-child(1) { background: var(--brand-violet) !important; }   /* Conocimiento */
.bd-hero-card:nth-child(2) { background: var(--brand-lime) !important; }     /* Facturación */
.bd-hero-card:nth-child(3) { background: #ffffff !important; }               /* Rentabilidad → blanca */
.bd-hero-card:nth-child(4) { background: #ffffff !important; border:1px solid rgba(20,20,16,.09) !important; }  /* Estado general → blanca */
.bd-hero-card:nth-child(5) { background: var(--brand-coral) !important; }    /* Salud → coral */
.bd-hero-card:nth-child(6) { background: #ffffff !important; border:1px solid rgba(20,20,16,.09) !important; }  /* Nivel financiero → blanca */
.bd-hero-card:nth-child(7) { background: var(--brand-blue) !important; }     /* Objetivos → azul */
.bd-hero-card:nth-child(8) { background: #ffffff !important; border:1px solid rgba(20,20,16,.09) !important; }  /* Ticket promedio → blanca */

/* Texto por contraste en el hero */
.bd-hero-card:nth-child(1) *, .bd-hero-card:nth-child(2) *,
.bd-hero-card:nth-child(3) *, .bd-hero-card:nth-child(4) *,
.bd-hero-card:nth-child(6) *, .bd-hero-card:nth-child(8) * { color: #141410 !important; }
.bd-hero-card:nth-child(5) *, .bd-hero-card:nth-child(7) * { color: #ffffff !important; }
.bd-hero-card:nth-child(5) .bd-hero-bar, .bd-hero-card:nth-child(7) .bd-hero-bar { background: rgba(255,255,255,.25) !important; }
.bd-hero-card:nth-child(5) .bd-hero-bar div, .bd-hero-card:nth-child(7) .bd-hero-bar div { background: #ffffff !important; }
.bd-hero-card:nth-child(4) .bd-hero-bar, .bd-hero-card:nth-child(6) .bd-hero-bar { background: rgba(20,20,16,.12) !important; }
.bd-hero-card:nth-child(4) .bd-hero-bar div, .bd-hero-card:nth-child(6) .bd-hero-bar div { background: #141410 !important; }

/* KPI statement (Instagram / Meta Ads / Posts): rotación violeta/lima/azul/coral */
#kpi-grid .kpi-card:nth-child(1), #ads-kpi-grid .kpi-card:nth-child(1),
.posts-kpi-card:nth-child(1) { background: var(--brand-lime) !important; }
#kpi-grid .kpi-card:nth-child(2), #ads-kpi-grid .kpi-card:nth-child(2),
.posts-kpi-card:nth-child(2) { background: var(--brand-violet) !important; }
#kpi-grid .kpi-card:nth-child(3), #ads-kpi-grid .kpi-card:nth-child(3),
.posts-kpi-card:nth-child(3) { background: var(--brand-blue) !important; }
#kpi-grid .kpi-card:nth-child(4), #ads-kpi-grid .kpi-card:nth-child(4),
.posts-kpi-card:nth-child(4) { background: var(--brand-coral) !important; }
/* contraste: 1-2 (claros) negro, 3-4 (oscuros) blanco */
#kpi-grid .kpi-card:nth-child(1) *, #kpi-grid .kpi-card:nth-child(2) *,
#ads-kpi-grid .kpi-card:nth-child(1) *, #ads-kpi-grid .kpi-card:nth-child(2) *,
.posts-kpi-card:nth-child(1) *, .posts-kpi-card:nth-child(2) * { color: #141410 !important; }
#kpi-grid .kpi-card:nth-child(3) *, #kpi-grid .kpi-card:nth-child(4) *,
#ads-kpi-grid .kpi-card:nth-child(3) *, #ads-kpi-grid .kpi-card:nth-child(4) *,
.posts-kpi-card:nth-child(3) *, .posts-kpi-card:nth-child(4) * { color: #ffffff !important; }
/* fuerza número blanco en cards oscuras (gana a reglas .kpi-value viejas) */
#kpi-grid .kpi-card:nth-child(3) .kpi-value, #kpi-grid .kpi-card:nth-child(4) .kpi-value,
#ads-kpi-grid .kpi-card:nth-child(3) .kpi-value, #ads-kpi-grid .kpi-card:nth-child(4) .kpi-value,
.posts-kpi-card:nth-child(3) .kpi-value, .posts-kpi-card:nth-child(4) .kpi-value { color: #ffffff !important; }

/* Centro: chart-cards blancas (los gráficos van sobre blanco) */
.ops-chart-card { background: #ffffff !important; }

/* ── SIN TEXTO DE COLOR salvo el headline del Centro ── */
.bd-dash-section-head h3, .ops-chart-title, .bd-dash-kicker, .ops-kicker,
.bd-exec-action-label, .kpi-label, .posts-kpi-label, .bd-dash-section-hint {
  color: #7a7a70 !important;
}
h1,h2,h3,h4, .kpi-value, .bd-hero-value { color: #141410; }
/* El headline del Centro SÍ lleva color (es la excepción que te gusta) */
.ops-hl-crit { color: #EE5A38 !important; }
.ops-hl-aten { color: #4657D4 !important; }
.ops-hl-ok   { color: #141410 !important; }

/* ── BOTONES: neutros en reposo, color solo al hover/click (via JS cycle) ── */
.btn-primary { background: #141410 !important; color: #F1F0E9 !important; }
.btn-secondary, .ops-action-cta, .dei-cta, .bd-exec-cta {
  background: #ffffff !important; color: #141410 !important;
  border: 1px solid rgba(20,20,16,.14) !important;
}

/* ── HOVER SHADOW en TODAS las cards (una sola regla) ── */
.kpi-card, .chart-card, .ops-chart-card, .bd-dash-section, .bd-hero-card,
.report-card, .posts-kpi-card, .bd-de-block-wrap, .bd-exec, .intel-bks,
.card, .discovered-card, .svc-card, .bd-dash-obj, .ops-action-item {
  transition: transform .18s cubic-bezier(.2,.7,.3,1), box-shadow .18s ease !important;
}
.kpi-card:hover, .chart-card:hover, .ops-chart-card:hover, .bd-dash-section:hover,
.bd-hero-card:hover, .report-card:hover, .posts-kpi-card:hover, .bd-de-block-wrap:hover,
.intel-bks:hover, .card:hover, .discovered-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 18px 40px -20px rgba(20,20,16,.35) !important;
}

/* Sin bordes de color: todos neutros */
.bd-hero-card, .kpi-card, .posts-kpi-card, .ops-chart-card { border: none !important; }

/* Barras de completitud estilo BD en cards blancas (para unificar) */
.bd-hero-card:nth-child(3) .bd-hero-bar div,
#kpi-grid .kpi-card .kpi-value, #ads-kpi-grid .kpi-card .kpi-value { }

/* ═══════════════════════════════════════════════════════════════
   R15 — Focus sin naranja · tabs activas rotando 4 colores ·
   regla global coral/azul → texto blanco
   ═══════════════════════════════════════════════════════════════ */

/* Focus: nada de borde naranja. Anillo sutil oscuro + micro-lift. */
button:focus-visible, .form-input:focus-visible, .bd-tab:focus-visible,
.nav-item:focus-visible, a:focus-visible {
  outline: 2px solid rgba(20,20,16,.28) !important;
  outline-offset: 2px !important;
}
/* Quitar el borde coral inset de la nav activa */
.nav-item.active { box-shadow: none !important; }

/* Nav activa: lima limpio, sin borde de color */
.nav-item.active { background: var(--brand-lime) !important; color: #141410 !important; border: none !important; }

/* TABS de Business Design: la activa rota entre los 4 colores según posición */
.bd-tab.active { color: #141410 !important; border: none !important; }
.bd-tab:nth-child(1).active { background: var(--brand-lime) !important; color:#141410 !important; }
.bd-tab:nth-child(2).active { background: var(--brand-violet) !important; color:#141410 !important; }
.bd-tab:nth-child(3).active { background: var(--brand-blue) !important; color:#ffffff !important; }
.bd-tab:nth-child(4).active { background: var(--brand-coral) !important; color:#ffffff !important; }
.bd-tab:nth-child(5).active { background: var(--brand-lime) !important; color:#141410 !important; }
.bd-tab:nth-child(6).active { background: var(--brand-violet) !important; color:#141410 !important; }
/* Sub-tabs (períodos, overview) activos rotan también */
.period-btn.active, .posts-period-tab.active, .overview-tab.active, .brief-tab.active {
  background: #141410 !important; color: #F1F0E9 !important; border: none !important;
}

/* ── REGLA GLOBAL: fondo coral o azul → TEXTO BLANCO (toda la app) ── */
[style*="background:#EE5A38"], [style*="background: #EE5A38"],
[style*="background:#4657D4"], [style*="background: #4657D4"] { color: #ffffff !important; }
.bg-coral, .bg-coral *, .bg-blue, .bg-blue * { color: #ffffff !important; }

/* R15b — Performance/Impact KPI: color pleno, sin emoji, texto por contraste */
.impact-kpi-icon { display: none !important; }
.impact-kpi-card { border: none !important; }
#section-impact .impact-kpi-card:nth-child(1),
#section-performance .impact-kpi-card:nth-child(1) { background: var(--brand-lime) !important; }
#section-impact .impact-kpi-card:nth-child(2),
#section-performance .impact-kpi-card:nth-child(2) { background: var(--brand-violet) !important; }
#section-impact .impact-kpi-card:nth-child(3),
#section-performance .impact-kpi-card:nth-child(3) { background: var(--brand-blue) !important; }
#section-impact .impact-kpi-card:nth-child(4),
#section-performance .impact-kpi-card:nth-child(4) { background: var(--brand-coral) !important; }
/* contraste: 1-2 (claros) negro, 3-4 (oscuros) blanco */
#section-impact .impact-kpi-card:nth-child(1) *, #section-impact .impact-kpi-card:nth-child(2) *,
#section-performance .impact-kpi-card:nth-child(1) *, #section-performance .impact-kpi-card:nth-child(2) * { color: #141410 !important; }
#section-impact .impact-kpi-card:nth-child(3) *, #section-impact .impact-kpi-card:nth-child(4) *,
#section-performance .impact-kpi-card:nth-child(3) *, #section-performance .impact-kpi-card:nth-child(4) * { color: #ffffff !important; }

/* R15c — Guía de carga inicial y chips de estado del header BD → neutros */
.bd-exec-state-chip,
.chip-setup, .chip-active, .chip-paused, .chip-muted, .chip-internal {
  color: #141410 !important;
  background: rgba(20,20,16,.05) !important;
  border: 1px solid rgba(20,20,16,.14) !important;
}
.bd-exec-step-n {
  background: #141410 !important;
  color: #ffffff !important;
}

/* R16 — TODOS los botones negros en reposo (color solo al hover via JS cycle) */
.btn-secondary, .btn-download, .btn-ghost, .report-btn,
.ops-action-cta, .dei-cta, .bd-exec-cta, .svc-banner-cta,
.discovered-card button, button.btn, .btn {
  background: #141410 !important;
  color: #F1F0E9 !important;
  border: 1px solid #141410 !important;
  box-shadow: none !important;
}
.btn-secondary svg, .btn-download svg, .report-btn svg,
.ops-action-cta svg, .dei-cta svg, .bd-exec-cta svg { color: #F1F0E9 !important; }
/* hover: micro-lift (el color pleno lo pone el ciclo JS) */
.btn-secondary:hover, .btn-download:hover, .report-btn:hover,
.ops-action-cta:hover, .dei-cta:hover, .bd-exec-cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 22px -12px rgba(20,20,16,.4) !important;
}

/* R16b — CTAs coral restantes → negro (Analizar cuenta, Generar análisis) */
.btn-agent-analyze, .btn-ai-generate {
  background: #141410 !important;
  color: #F1F0E9 !important;
  border: 1px solid #141410 !important;
}
.btn-agent-analyze svg, .btn-ai-generate svg { color: #F1F0E9 !important; }

/* R17 — Elementos coral que faltaban → negro (círculos de paso, toggles, tabs, checkboxes) */
.adv-step-num { background: #141410 !important; color: #F1F0E9 !important; }
.cwiz-step-item.active .cwiz-step-num { background: #141410 !important; border-color: #141410 !important; color: #F1F0E9 !important; }
.adv-seg-btn.active { background: #141410 !important; border-color: #141410 !important; color: #F1F0E9 !important; }
.agent-tab.active { color: #141410 !important; border-bottom-color: #141410 !important; }
.agent-tab-badge { background: #141410 !important; color: #F1F0E9 !important; }
/* checkboxes/radios coral → negro */
input[type=checkbox], input[type=radio] { accent-color: #141410 !important; }

/* Headers de sección del modal "Cargar mes" (carga de datos más lógica) */
.bd-fin-sec {
  font-family: var(--font-display); font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .08em; color: #141410;
  margin: 20px 0 10px; padding-bottom: 6px;
  border-bottom: 2px solid #141410;
}
.bd-fin-sec:first-child { margin-top: 0; }

/* ── Business Design V2 · F2 — Registro Mensual ──────────────────────────── */
.bd-reg-head { display:flex; justify-content:space-between; align-items:flex-start; gap:16px; margin-bottom:14px; }
.bd-reg-head h3 { margin:0 0 4px; font-size:18px; }
.bd-reg-sub { margin:0; font-size:12.5px; color:var(--text3); max-width:560px; line-height:1.5; }
.bd-reg-toolbar { display:flex; align-items:center; gap:14px; margin-bottom:10px; flex-wrap:wrap; }
.bd-reg-year { width:auto; min-width:96px; }
.bd-reg-filters { display:flex; gap:6px; }
.bd-reg-fbtn { background:var(--surface2); border:1px solid var(--border-subtle); color:var(--text2,#555);
  border-radius:20px; padding:5px 14px; font-size:12.5px; cursor:pointer; transition:.15s; }
.bd-reg-fbtn:hover { background:#F1F0E9; color:#141410; }
.bd-reg-fbtn.active { background:#141410; color:#fff; border-color:#141410; }
.bd-reg-legend { display:flex; gap:6px; flex-wrap:wrap; margin-bottom:14px; }
.bd-reg-legend-chip { display:inline-flex; align-items:center; justify-content:center; padding:4px 9px; border-radius:999px; font-size:10.5px; font-weight:700; line-height:1; }
.bd-reg-legend-chip.ok { background:#CFEA5B; color:#141410; }
.bd-reg-legend-chip.estimado { background:#C0A2E5; color:#141410; }
.bd-reg-legend-chip.vacio { background:#F1F0E9; color:#55554c; }
.bd-reg-legend-chip.notengo { background:#EE5A38; color:#ffffff; }
.bd-reg-legend-chip.noaplica { background:#4657D4; color:#ffffff; }
.bd-reg-legend-chip.contexto { background:#141410; color:#F1F0E9; }
.bd-reg-list { display:flex; flex-direction:column; gap:10px; }
.bd-reg-row { display:flex; align-items:center; gap:14px; width:100%; text-align:left;
  background:#F8F7F1; border:1px solid rgba(20,20,16,.09); border-radius:10px;
  padding:16px 18px; cursor:pointer; transition:.15s; }
.bd-reg-row:hover { border-color:#141410; box-shadow:none; transform:none; }
.bd-reg-row:focus { outline:none; }
.bd-reg-row:focus-visible { outline:2px solid #141410; outline-offset:2px; }
.bd-reg-month { font-weight:750; font-size:15px; min-width:100px; color:#141410; }
.bd-reg-estado { font-size:11px; font-weight:800; padding:5px 12px; border-radius:999px; min-width:76px; text-align:center; }
.bd-reg-estado.abierto { background:#EE5A38; color:#ffffff; }
.bd-reg-estado.cerrado { background:#141410; color:#F1F0E9; }
.bd-reg-blocks { display:flex; gap:8px; flex-wrap:wrap; margin-left:auto; align-items:center; justify-content:flex-end; }
.bd-reg-chip { display:inline-flex; align-items:center; justify-content:center; gap:5px; min-width:56px; height:30px;
  font-size:13px; line-height:1; padding:0 9px; border-radius:10px; background:#F1F0E9; color:#141410; box-sizing:border-box; }
.bd-reg-chip b { font-family:var(--font-display); font-size:11px; font-style:normal; font-weight:800; }
.bd-reg-chip.ok { background:#CFEA5B; color:#141410; }
.bd-reg-chip.estimado { background:#C0A2E5; color:#141410; }
.bd-reg-chip.notengo { background:#EE5A38; color:#ffffff; }
.bd-reg-chip.noaplica { background:#4657D4; color:#ffffff; }
.bd-reg-chip.contexto { background:#141410; color:#F1F0E9; }
.bd-reg-chip.vacio { background:#ECEBE5; color:#8a8a80; }

/* Editor del Mes — contexto, tags, historial, subbloques */
.bd-tags-wrap { display:flex; flex-direction:column; gap:10px; }
.bd-tag-group { display:flex; flex-wrap:wrap; gap:6px; align-items:center; }
.bd-tag-glabel { font-size:10.5px; text-transform:uppercase; letter-spacing:.5px; color:var(--text3);
  width:74px; flex-shrink:0; font-weight:600; }
.bd-tag { background:var(--surface2); border:1px solid var(--border-subtle); color:var(--text2,#555);
  border-radius:20px; padding:4px 11px; font-size:12px; cursor:pointer; transition:.12s; }
.bd-tag:hover { border-color:#141410; }
.bd-tag.on { background:#141410; color:#fff; border-color:#141410; }
.bd-tag.on.imp-positivo { background:#3a8a1e; border-color:#3a8a1e; }
.bd-tag.on.imp-negativo { background:var(--accent); border-color:var(--accent); }
.bd-tag.on b { font-style:normal; }
.bd-tag-free { border:1px dashed var(--border); border-radius:20px; padding:4px 11px; font-size:12px;
  background:transparent; color:var(--text1); width:110px; }
.bd-mes-subblocks { display:flex; flex-direction:column; gap:6px; }
.bd-sub-row { display:flex; justify-content:space-between; align-items:center; padding:10px 14px;
  background:var(--surface2); border-radius:10px; cursor:pointer; font-size:13px; transition:.12s; }
.bd-sub-row:hover { background:var(--yellow); color:#141410; }
.bd-sub-go { font-size:12px; color:var(--text3); }
.bd-sub-row:hover .bd-sub-go { color:#141410; }
.bd-mes-historial { display:flex; flex-direction:column; gap:6px; max-height:180px; overflow-y:auto; }
.bd-hist-row { display:flex; gap:10px; align-items:baseline; font-size:12px; padding:6px 0;
  border-bottom:1px solid var(--border-subtle); flex-wrap:wrap; }
.bd-hist-when { color:var(--text3); font-variant-numeric:tabular-nums; min-width:104px; }
.bd-hist-what b { font-style:normal; color:#141410; }
.bd-hist-why { color:var(--yellow); font-style:italic; }
.bd-hist-who { color:var(--text3); margin-left:auto; }
.bd-mes-estado-badge { font-size:11.5px; font-weight:600; padding:4px 12px; border-radius:20px; }
.bd-mes-estado-badge.abierto { background:var(--accent-soft); color:var(--accent); }
.bd-mes-estado-badge.cerrado { background:#141410; color:var(--green); }

/* ── F2 · toggle de modo en Carga de datos ──────────────────────────────── */
.bd-de-modes { display:flex; gap:8px; margin-bottom:18px; border-bottom:1px solid var(--border-subtle); padding-bottom:2px; }
.bd-de-mode { background:transparent; border:none; border-bottom:2px solid transparent; color:var(--text3);
  padding:8px 14px; font-size:13.5px; font-weight:600; cursor:pointer; transition:.15s; margin-bottom:-2px; }
.bd-de-mode:hover { color:#141410; }
.bd-de-mode.active { color:#141410; border-bottom-color:var(--accent); }

/* ── F2 · robustez del Editor del Mes: nunca cortar el fondo del modal ─────
   modal-box acotado a la altura visible; el cuerpo scrollea internamente y el
   footer (Guardar/Cerrar) queda SIEMPRE fijo y visible. El overlay scrollea
   como red de seguridad si aún así algo excede. */
#bd-fin-modal { align-items:flex-start; overflow-y:auto; padding:3vh 0; }
#bd-fin-modal .modal-box { margin:auto; max-height:94vh; }
#bd-fin-modal .modal-body { min-height:0; overflow-y:auto; flex:1; }
#bd-fin-modal .modal-footer { flex-shrink:0; }

/* ── Ventas por categoría — selector de mes ──────────────────────────────── */
.bd-cat-months { display:flex; gap:6px; flex-wrap:wrap; }
.bd-cat-chip { background:var(--surface2); border:1px solid var(--border-subtle); color:var(--text3);
  border-radius:20px; padding:4px 11px; font-size:11.5px; font-weight:600; cursor:pointer; transition:.15s; }
.bd-cat-chip:hover { color:#141410; border-color:#141410; }
.bd-cat-chip.active { background:#141410; color:#fff; border-color:#141410; }

/* Gastos por categoría — chips de mes (mismo estilo que ventas) */
.bd-exp-chip { background:var(--surface2); border:1px solid var(--border-subtle); color:var(--text3);
  border-radius:20px; padding:4px 11px; font-size:11.5px; font-weight:600; cursor:pointer; transition:.15s; }
.bd-exp-chip:hover { color:#141410; border-color:#141410; }
.bd-exp-chip.active { background:#141410; color:#fff; border-color:#141410; }

/* ── Biblioteca del cliente (links + archivos) ─────────────────────────── */
.tool-sub { font-size: 12px; color: var(--text3); margin: 2px 0 0; }
.lib-add-row {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  margin: 4px 0 14px;
}
.lib-input {
  padding: 9px 12px; border: 1.5px solid var(--border); border-radius: 8px;
  background: var(--bg1); color: var(--text1); font-size: 13px; min-width: 140px;
}
.lib-input-wide { flex: 1; min-width: 220px; }
.lib-list { display: flex; flex-direction: column; gap: 6px; }
.lib-empty { font-size: 13px; color: var(--text3); margin: 4px 0; }
.lib-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px;
  background: rgba(20,20,16,0.02);
}
.lib-item-ico { font-size: 18px; flex-shrink: 0; }
.lib-item-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.lib-item-name {
  font-size: 13px; font-weight: 600; color: var(--text1);
  text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.lib-item-name:hover { text-decoration: underline; }
.lib-download {
  appearance: none; border: 0; background: transparent; padding: 0; text-align: left;
  font-size: 13px; font-weight: 600; color: var(--text1); cursor: pointer;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.lib-download:hover { text-decoration: underline; }
.lib-item-meta {
  font-size: 11px; color: var(--text3);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.lib-item-del {
  flex-shrink: 0; background: none; border: none; color: var(--text3);
  cursor: pointer; font-size: 14px; padding: 4px 8px; border-radius: 6px;
}
.lib-item-del:hover { background: rgba(229,85,85,0.12); color: var(--red); }

/* ── Planificación (tablas editables Posts / Stories) ──────────────────── */
.planning-table-wrap { overflow-x: auto; margin-top: 4px; }
.planning-table {
  width: 100%; border-collapse: collapse; font-size: 13px;
  min-width: 1280px;
}
.planning-table th {
  text-align: left; font-size: 11px; font-weight: 600; color: var(--text3);
  text-transform: uppercase; letter-spacing: 0.5px;
  padding: 8px 8px; border-bottom: 1.5px solid var(--border);
  white-space: nowrap;
}
.pl-cell { padding: 4px 4px; border-bottom: 1px solid var(--border-subtle); vertical-align: top; }
.pl-cell-wide { min-width: 220px; }
.pl-input {
  width: 100%; border: 1px solid transparent; border-radius: 6px;
  background: transparent; color: var(--text1);
  font-size: 13px; font-family: var(--font-body);
  padding: 7px 8px; resize: vertical; min-width: 90px;
}
.pl-input:hover { border-color: var(--border); background: var(--bg1); }
.pl-input:focus {
  outline: none; border-color: var(--accent); background: var(--bg1);
}
select.pl-input { cursor: pointer; }
.pl-cell-objectives { min-width: 230px; }
.pl-cell-media { min-width: 260px; }
.pl-cell-copy { min-width: 280px; }
.pl-chip-row { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 7px; }
.pl-chip {
  display: inline-flex; align-items: center; min-height: 24px;
  padding: 3px 10px; border-radius: 999px; gap: 7px;
  font-size: 12px; font-weight: 800; line-height: 1.1;
}
.pl-chip-x {
  width: 16px; height: 16px; display: inline-flex; align-items: center; justify-content: center;
  border: 0; border-radius: 999px; background: rgba(20,20,16,.16); color: inherit;
  font-size: 13px; line-height: 1; cursor: pointer; padding: 0;
}
.pl-chip-orange .pl-chip-x,
.pl-chip-blue .pl-chip-x,
.pl-chip-black .pl-chip-x { background: rgba(255,255,255,.24); color: #fff; }
.pl-chip-lime { background: var(--brand-lime); color: #141410; }
.pl-chip-violet { background: var(--brand-violet); color: #141410; }
.pl-chip-orange { background: var(--brand-coral); color: #fff; }
.pl-chip-blue { background: var(--brand-blue); color: #fff; }
.pl-chip-black { background: #141410; color: #fff; }
.pl-muted { color: var(--text3); font-size: 12px; }
.pl-picker summary,
.pl-emoji-picker summary {
  cursor: pointer; color: var(--text1); font-size: 12px; font-weight: 700;
  list-style: none; width: max-content;
}
.pl-picker summary::-webkit-details-marker,
.pl-emoji-picker summary::-webkit-details-marker { display: none; }
.pl-options {
  display: flex; flex-direction: column; gap: 6px;
  min-width: 210px; margin-top: 8px; padding: 8px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 8px;
}
.pl-option { display: flex; gap: 7px; align-items: flex-start; font-size: 12px; color: var(--text2); }
.pl-option input { accent-color: var(--brand-lime); margin-top: 2px; }
.pl-manual-objective {
  display: grid; grid-template-columns: minmax(130px, 1fr) auto;
  gap: 6px; margin-top: 8px; align-items: center;
}
.pl-date-label { margin-top: 5px; font-size: 11px; color: var(--text3); white-space: nowrap; }
.pl-link-field { display: grid; grid-template-columns: 62px minmax(130px, 1fr) auto auto; gap: 6px; align-items: center; margin-bottom: 7px; }
.pl-link-field span { color: var(--text3); font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; }
.pl-slide { padding-bottom: 8px; margin-bottom: 8px; border-bottom: 1px dashed var(--border); }
.pl-slide:last-of-type { border-bottom: 0; margin-bottom: 3px; }
.pl-slide .pl-link-field { margin-bottom: 5px; }
.pl-slide-text { width: 100%; resize: vertical; }
.pl-open-link,
.pl-mini-btn,
.pl-add-slide,
.pl-prepare-btn {
  border: 0; border-radius: 999px; padding: 5px 9px;
  background: #141410; color: #fff; font-size: 11px; font-weight: 800;
  cursor: pointer; text-decoration: none; white-space: nowrap;
}
.pl-prepare-btn { background: var(--brand-blue); color: #fff; }
.pl-prepare-btn:disabled { opacity: .65; cursor: wait; }
.pl-add-slide { background: var(--brand-lime); color: #141410; margin-top: 3px; }
.pl-hist-list { display: flex; flex-direction: column; gap: 8px; max-height: 340px; overflow-y: auto; }
.pl-hist-item { display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); }
.pl-hist-date { font-size: 13px; font-weight: 600; color: var(--text); }
.pl-hist-meta { font-size: 11px; color: var(--text3); margin-top: 2px; }
.pl-emoji-picker { margin-top: 6px; }

/* ── Simulador IG ─────────────────────────────────────────────────────── */
.simulator-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 110px;
  gap: 22px;
  align-items: center;
  background: var(--brand-blue);
  color: #fff;
  border-radius: 22px;
  padding: 28px;
  margin-bottom: 18px;
}
.simulator-hero h3 {
  margin: 12px 0 8px;
  font-size: clamp(28px, 4vw, 48px);
  line-height: .95;
  letter-spacing: 0;
  color: #fff;
}
.simulator-hero p {
  max-width: 720px;
  margin: 0;
  color: #fff;
  font-size: 16px;
  line-height: 1.45;
}
.simulator-chip {
  display: inline-flex;
  align-items: center;
  width: max-content;
  background: var(--brand-lime);
  color: #141410;
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 900;
}
.simulator-phone {
  justify-self: end;
  width: 88px;
  height: 150px;
  border: 4px solid #fff;
  border-radius: 22px;
  padding: 14px 10px;
  display: grid;
  gap: 8px;
  align-content: center;
}
.simulator-phone span {
  display: block;
  height: 22px;
  border-radius: 999px;
  background: #fff;
}
.simulator-phone span:nth-child(2) { background: var(--brand-lime); }
.simulator-phone span:nth-child(3) { background: var(--brand-violet); }
.simulator-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(280px, .7fr);
  gap: 16px;
}
.simulator-card { min-height: 250px; }
.simulator-card-lime {
  background: var(--brand-lime) !important;
  border-color: var(--brand-lime) !important;
}
.simulator-card-lime .tool-sub { color: #141410; opacity: .74; }
.simulator-info-card {
  min-height: 0;
  padding: 32px 34px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 22px;
}
.simulator-info-copy {
  max-width: 520px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.simulator-info-card .tool-title {
  margin: 0;
  line-height: 1.05;
}
.simulator-info-card .tool-sub {
  margin: 0;
  max-width: 430px;
  line-height: 1.28;
}
.simulator-info-btn {
  margin-top: 2px;
  width: auto;
  min-width: 220px;
  justify-content: center;
}
.simulator-status {
  display: inline-flex;
  width: fit-content;
  max-width: 100%;
  margin: 14px 0 12px;
  padding: 9px 14px;
  border-radius: 999px;
  background: #141410;
  color: #fff;
  font-weight: 900;
  font-size: 13px;
}
.simulator-status.is-active { background: var(--brand-lime); color: #141410; }
.simulator-status.is-paused { background: var(--brand-violet); color: #141410; }
.simulator-status.is-empty { background: var(--brand-coral); color: #fff; }
.simulator-link-box {
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  margin: 4px 0 14px;
}
.simulator-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

@media (max-width: 760px) {
  .simulator-hero,
  .simulator-grid {
    grid-template-columns: 1fr;
  }
  .simulator-phone {
    justify-self: start;
    width: 76px;
    height: 126px;
  }
  .simulator-link-box {
    grid-template-columns: 1fr;
  }
}
.pl-emoji-panel {
  display: flex; flex-direction: column; gap: 10px;
  width: 360px; max-width: min(72vw, 360px); max-height: 260px; overflow: auto;
  margin-top: 7px; padding: 10px; border-radius: 8px;
  background: var(--surface); border: 1px solid var(--border);
}
.pl-emoji-section h4 {
  margin: 0 0 6px; color: var(--text3); font-size: 10px; font-weight: 900;
  text-transform: uppercase; letter-spacing: .08em;
}
.pl-emoji-grid { display: flex; flex-wrap: wrap; gap: 5px; }
.pl-emoji-picker button {
  width: 28px; height: 28px; border: 0; border-radius: 999px;
  background: var(--bg2); cursor: pointer; font-size: 16px;
}
.brief-objetivo-row {
  display: grid; grid-template-columns: minmax(180px, .8fr) minmax(260px, 1.2fr) auto;
  gap: 8px; align-items: start; margin-bottom: 8px;
}
.brief-objetivo-row input,
.brief-objetivo-row textarea {
  background: var(--bg2); border: 1px solid var(--border); border-radius: 8px;
  color: var(--text1); padding: 9px 11px; font-size: 13px; font-family: inherit;
}
@media (max-width: 720px) {
  .brief-objetivo-row { grid-template-columns: 1fr auto; }
  .brief-objetivo-row textarea { grid-column: 1 / -1; }
}

/* ── Finanzas de la agencia ─────────────────────────────────────────── */
.fin-cards {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px; margin-bottom: 16px;
}
.fin-card {
  background: var(--brand-lime);
  border: 1px solid var(--brand-lime);
  border-radius: 10px; padding: 12px 14px; display: flex; flex-direction: column; gap: 4px;
}
.fin-card-label { font-size: 11px; color: var(--text1); text-transform: uppercase; letter-spacing: .5px; }
.fin-card-value { font-size: 18px; font-weight: 700; color: var(--text1); }
.fin-muted,
.fin-error {
  color: var(--text1);
}
.fin-card-lime {
  background: var(--brand-lime);
  border-color: var(--brand-lime);
}
.fin-card-violet {
  background: var(--brand-violet);
  border-color: var(--brand-violet);
}
.fin-card-blue {
  background: var(--brand-blue);
  border-color: var(--brand-blue);
}
.fin-card-coral {
  background: var(--brand-coral);
  border-color: var(--brand-coral);
}
.fin-card-blue .fin-card-label,
.fin-card-blue .fin-card-value,
.fin-card-coral .fin-card-label,
.fin-card-coral .fin-card-value {
  color: #fff;
}
.fin-card-lime .fin-card-label,
.fin-card-lime .fin-card-value,
.fin-card-violet .fin-card-label,
.fin-card-violet .fin-card-value {
  color: var(--text1);
}
.fin-input {
  padding: 7px 9px; border: 1px solid var(--border); border-radius: 7px;
  background: var(--bg1); color: var(--text1); font-size: 13px; min-width: 90px;
}

input[type="date"],
input[type="datetime-local"],
input[type="time"],
input[type="month"] {
  font-family: var(--font-body) !important;
  letter-spacing: 0 !important;
  font-variant-numeric: proportional-nums;
}

input[type="date"]::-webkit-datetime-edit,
input[type="date"]::-webkit-datetime-edit-fields-wrapper,
input[type="date"]::-webkit-datetime-edit-text,
input[type="date"]::-webkit-datetime-edit-month-field,
input[type="date"]::-webkit-datetime-edit-day-field,
input[type="date"]::-webkit-datetime-edit-year-field {
  font-family: var(--font-body) !important;
  letter-spacing: 0 !important;
}
.fin-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 6px; }
.fin-mini-btn { padding: 5px 9px; font-size: 11px; white-space: nowrap; }
.fin-socias-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 640px) { .fin-socias-grid { grid-template-columns: 1fr; } }
.fin-socia-col { border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; }
.fin-socia-nombre { font-weight: 700; font-size: 14px; margin-bottom: 8px; }
.fin-socia-row { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; padding: 4px 0; }
.fin-socia-destacado { font-size: 14px; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); padding: 8px 0; margin: 4px 0; }
.fin-socia-destacado strong { color: var(--accent); }
.fin-socia-info { color: var(--text3); }
.fin-desglose { border: 1px solid var(--border); border-radius: 8px; margin-top: 8px; padding: 4px 10px; }
.fin-desglose > summary { cursor: pointer; font-size: 13px; font-weight: 600; padding: 6px 0; }
.fin-desglose[open] > summary { border-bottom: 1px solid var(--border); margin-bottom: 8px; }
.fin-badge {
  padding: 3px 9px; border-radius: 10px; font-size: 11px; font-weight: 700; white-space: nowrap;
}
.fin-badge-green  { background: var(--brand-lime); color: var(--text1); }
.fin-badge-yellow { background: var(--brand-violet); color: var(--text1); }
.fin-badge-red    { background: var(--brand-coral); color: #fff; }
.fin-badge-gray   { background: var(--brand-blue); color: #fff; }
.fin-linkbtn { background: none; border: none; color: var(--accent); cursor: pointer; font-size: 11.5px; padding: 0 0 0 6px; text-decoration: underline; }
.fin-linkbtn:hover { opacity: .75; }
.fin-block-label { font-size: 13px; font-weight: 600; color: var(--text2); margin: 0 0 10px; letter-spacing: .02em; }
.fin-block-label span { font-weight: 400; color: var(--text3); font-size: 12px; }
.fin-pay-list { display: flex; flex-direction: column; gap: 4px; margin-bottom: 10px; }
.fin-pay-item { display: grid; grid-template-columns: 22px 1fr 1fr 70px 110px 28px; align-items: center; gap: 8px; padding: 7px 10px; border: 1px solid var(--border); border-radius: 8px; font-size: 13px; cursor: pointer; }
.fin-pay-item:hover { background: var(--bg2, rgba(127,127,127,.06)); }
.fin-pay-item input { cursor: pointer; }
.fin-pay-cli { font-weight: 600; }
.fin-pay-svc, .fin-pay-mes { color: var(--text3); font-size: 12px; }
.fin-pay-monto { text-align: right; }
.fin-pay-edit { padding: 4px 8px; font-size: 13px; min-width: 0; cursor: text; }
.fin-pay-item input.fin-pay-edit { cursor: text; }
@media (max-width: 600px) {
  .fin-pay-item { grid-template-columns: 22px 1fr 1fr; }
}
.fin-pay-add { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 10px; border-top: 1px solid var(--border); }
.fin-pay-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px; border-top: 1px solid var(--border); }
.fin-pay-total { margin-left: auto; font-size: 13px; color: var(--text2); }
.fin-pay-total strong { color: var(--accent); font-size: 15px; }

/* ── Cobros ──────────────────────────────────────────────────────── */
/* KPIs: color pleno (paleta) con letra negra, como el resto de la app.
   Lógica: lime = entró / OK · coral = atención (falta, atrasados). */
.fin-kpi-strip { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 20px; }
.fin-kpi { background: var(--kpi-bg, var(--brand-lime)); border-radius: 14px; padding: 18px 22px 16px; color: #141410; }
.fin-kpi-label { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: #141410; opacity: .72; font-weight: 700; }
.fin-kpi-value { display: block; font-size: 28px; font-weight: 800; color: #141410; letter-spacing: -.02em; margin-top: 5px; line-height: 1.1; }
.fin-kpi-sub { display: block; font-size: 12px; color: #141410; opacity: .62; margin-top: 4px; font-weight: 500; }
.fin-kpi-in   { --kpi-bg: var(--brand-lime); }
.fin-kpi-out  { --kpi-bg: var(--brand-coral); }
.fin-kpi-warn { --kpi-bg: var(--brand-coral); }
/* Cards coral: toda la tipografía en blanco */
.fin-kpi-out .fin-kpi-label, .fin-kpi-out .fin-kpi-value, .fin-kpi-out .fin-kpi-sub,
.fin-kpi-warn .fin-kpi-label, .fin-kpi-warn .fin-kpi-value, .fin-kpi-warn .fin-kpi-sub { color: #fff; }
.fin-kpi-out .fin-kpi-label, .fin-kpi-warn .fin-kpi-label { opacity: .85; }
.fin-kpi-out .fin-kpi-sub, .fin-kpi-warn .fin-kpi-sub { opacity: .8; }
@media (max-width: 720px) { .fin-kpi-strip { grid-template-columns: 1fr; } }

/* Tabla de cobros: sin scroll lateral (anula el min-width:1280 global),
   filas aireadas y columnas ajustadas al contenido. */
.fin-cobros-wrap { overflow-x: visible; background: var(--bg1); border: 1px solid var(--border);
  border-radius: 14px; padding: 4px 14px; box-shadow: 0 1px 3px rgba(20,20,16,.04); margin-top: 8px; }
.fin-cobros-table { min-width: 0; width: 100%; table-layout: auto; }
.fin-cobros-table tbody tr:last-child.fin-crow { border-bottom: none; }
.fin-cobros-table thead th, .fin-cobros-table td { vertical-align: middle; padding: 13px 12px; }
.fin-cobros-table thead th { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--text3); border-bottom: 1.5px solid var(--border); }
.fin-cobros-table .fin-right { text-align: right; white-space: nowrap; }
.fin-cobros-table th:first-child, .fin-cobros-table td:first-child { width: 30px; padding-left: 6px; padding-right: 0; }
.fin-cobros-table .fin-svc { width: 100%; color: var(--text2); }   /* absorbe el espacio sobrante */
.fin-cobros-table .fin-cli { white-space: nowrap; }
.fin-crow { border-bottom: 1px solid var(--border-subtle); }
.fin-crow:hover { background: rgba(20,20,16,.02); }
.fin-num { font-variant-numeric: tabular-nums; font-weight: 600; }
.fin-cli { font-weight: 600; }
.fin-falta { display: block; font-size: 11px; color: var(--brand-coral); font-weight: 500; }
.fin-crow-late .fin-cli { color: var(--brand-coral); }
.fin-expand { background: none; border: none; cursor: pointer; font-size: 16px; line-height: 1; color: var(--text3);
  transition: transform .15s ease; padding: 2px 4px; }
.fin-expand.open { transform: rotate(90deg); color: var(--accent); }
.fin-cobrar-btn { background: var(--brand-lime); border: none; color: #141410;
  font-size: 12px; font-weight: 700; padding: 6px 16px; border-radius: 8px; cursor: pointer; white-space: nowrap; }
.fin-cobrar-btn:hover { filter: brightness(.96); }
.fin-paid-check { color: #4a7c2f; font-weight: 800; font-size: 15px; }
.fin-crow-detail > td { background: var(--surface); border-top: none; padding: 6px 14px 16px; }
.fin-detail-grid { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 12px; }
.fin-detail-grid label { display: flex; flex-direction: column; gap: 3px; font-size: 11px; color: var(--text3); text-transform: uppercase; letter-spacing: .03em; }
.fin-detail-nums { display: flex; flex-wrap: wrap; gap: 20px; font-size: 12.5px; color: var(--text2); }
.fin-detail-nums strong { color: var(--text1); font-variant-numeric: tabular-nums; }
.fin-detail-neto strong { color: var(--accent); }
.fin-crow-total td { border-top: 2px solid var(--border); font-weight: 700; font-size: 13px; color: var(--text1); padding-top: 12px; }
.fin-badge-violet { background: var(--brand-violet); color: var(--text1); }
.fin-badge-neutral { background: rgba(20,20,16,.08); color: var(--text2); }

/* Seguridad: intentos de acceso fallidos */
.sec-card-alert { border-color: rgba(238,90,56,.4); background: rgba(238,90,56,.05); }
.sec-list { margin-top: 12px; display: flex; flex-direction: column; gap: 2px; }
.sec-row { display: grid; grid-template-columns: 14px 1.4fr 1fr 1fr auto; align-items: center; gap: 10px;
  padding: 8px 6px; border-bottom: 1px solid var(--border-subtle); font-size: 12.5px; }
.sec-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--brand-coral); }
.sec-email { font-weight: 600; color: var(--text1); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sec-motivo { color: var(--text2); }
.sec-ip, .sec-fecha { color: var(--text3); font-size: 11.5px; white-space: nowrap; }
@media (max-width: 720px) { .sec-row { grid-template-columns: 14px 1fr auto; } .sec-motivo, .sec-ip { display: none; } }
.sec-row2 { padding: 9px 6px; border-bottom: 1px solid var(--border-subtle); }
.sec-line1 { display: flex; align-items: center; gap: 10px; font-size: 12.5px; }
.sec-line1 .sec-fecha { margin-left: auto; }
.sec-line2 { display: flex; align-items: center; gap: 14px; margin-top: 4px; padding-left: 18px;
  font-size: 11.5px; color: var(--text2); flex-wrap: wrap; }
.sec-line2 a { color: var(--accent); text-decoration: none; }
.sec-line2 a:hover { text-decoration: underline; }
.fin-service-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px;
  margin-top: 16px;
}
.fin-service-card {
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 220px;
  color: var(--text1);
}
.fin-service-card-lime {
  background: var(--brand-lime);
}
.fin-service-card-violet {
  background: var(--brand-violet);
}
.fin-service-card-blue {
  background: var(--brand-blue);
  color: #fff;
}
.fin-service-card-coral {
  background: var(--brand-coral);
  color: #fff;
}
.fin-service-card.is-paused {
  filter: saturate(.82);
}
.fin-service-card-top {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}
.fin-service-client {
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .04em;
  margin-bottom: 4px;
}
.fin-service-card h4 {
  margin: 0;
  font-size: 22px;
  line-height: 1.05;
}
.fin-service-price {
  flex: 0 0 auto;
  font-size: 23px;
  font-weight: 900;
  line-height: 1;
}
.fin-service-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.fin-service-meta span,
.fin-service-cost-pill,
.fin-service-action {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-radius: 999px;
  padding: 5px 10px;
  background: var(--text1);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
}
.fin-service-card-blue .fin-service-meta span,
.fin-service-card-blue .fin-service-cost-pill,
.fin-service-card-blue .fin-service-action,
.fin-service-card-coral .fin-service-meta span,
.fin-service-card-coral .fin-service-cost-pill,
.fin-service-card-coral .fin-service-action {
  background: #fff;
  color: var(--text1);
}
.fin-service-costs {
  display: grid;
  gap: 8px;
}
.fin-service-costs strong {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.fin-service-costs div {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.fin-service-actions {
  display: flex;
  gap: 8px;
  margin-top: auto;
}
.fin-service-action {
  border: 0;
  cursor: pointer;
  font-family: inherit;
}
.fin-provider-balance-list {
  display: grid;
  gap: 10px;
}
.fin-provider-card {
  border: 1px solid var(--brand-lime);
  border-radius: 10px;
  background: var(--brand-lime);
  overflow: hidden;
}
.fin-provider-card-lime {
  background: var(--brand-lime);
  border-color: var(--brand-lime);
}
.fin-provider-card-violet {
  background: var(--brand-violet);
  border-color: var(--brand-violet);
}
.fin-provider-card-blue {
  background: var(--brand-blue);
  border-color: var(--brand-blue);
}
.fin-provider-card-coral {
  background: var(--brand-coral);
  border-color: var(--brand-coral);
}
.fin-provider-head {
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--text1);
  padding: 12px 14px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  text-align: left;
  cursor: pointer;
}
.fin-provider-headrow { display: flex; align-items: center; }
.fin-provider-headrow .fin-provider-head { flex: 1; min-width: 0; }
.fin-provider-del { color: var(--text1); margin-right: 10px; flex-shrink: 0; }
.fin-provider-head strong { font-size: 15px; }
.fin-provider-head small {
  display: block;
  margin-top: 2px;
  color: var(--text1);
  font-size: 11px;
}
.fin-provider-card-blue .fin-provider-head,
.fin-provider-card-blue .fin-provider-head small,
.fin-provider-card-coral .fin-provider-head,
.fin-provider-card-coral .fin-provider-head small,
.fin-provider-card-blue .fin-provider-del,
.fin-provider-card-coral .fin-provider-del {
  color: #fff;
}
.fin-provider-amount {
  text-align: right;
  white-space: nowrap;
}
.fin-provider-saldo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 4px;
  padding: 0;
  border-radius: 0;
  font-size: 12px;
  background: transparent;
}
.fin-chip-coral {
  background: transparent;
  color: inherit;
}
.fin-chip-lime {
  background: transparent;
  color: inherit;
}
.fin-provider-detail {
  border-top: 1px solid rgba(20,20,16,.14);
  padding: 12px 14px 14px;
  background: var(--surface-solid);
}
.fin-provider-card-blue .fin-provider-detail,
.fin-provider-card-coral .fin-provider-detail {
  border-top-color: rgba(255,255,255,.28);
}
.fin-provider-payments {
  margin-top: 12px;
  display: grid;
  gap: 6px;
}
.fin-provider-payments h5 {
  margin: 0 0 4px;
  font-size: 12px;
  color: var(--text3);
  text-transform: uppercase;
}
.fin-provider-payment {
  display: grid;
  grid-template-columns: 110px 110px 1fr auto;
  gap: 8px;
  align-items: center;
  font-size: 12px;
  color: var(--text2);
}
.fin-provider-payment strong {
  color: var(--text1);
}
.fin-provider-payment-form {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}
.fin-table-input {
  min-width: 150px;
  width: 100%;
}
.fin-money-input {
  min-width: 90px;
  width: 110px;
}
.fin-empty-box {
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text3);
  background: var(--surface, #fff);
}
@media (max-width: 720px) {
  .fin-provider-head {
    align-items: flex-start;
    flex-direction: column;
  }
  .fin-provider-amount {
    text-align: left;
  }
  .fin-provider-payment {
    grid-template-columns: 1fr;
  }
}

/* ── Bloque 1 UX: avisos compactos ─────────────────────────────────── */
.svc-state-banner.svc-banner-slim {
  padding: 8px 12px;
  font-size: 12px;
  margin-bottom: 12px;
  border-radius: 8px;
  gap: 8px;
}
.svc-banner-slim .svc-banner-icon { font-size: 13px; }
.svc-banner-slim .svc-banner-cta { padding: 4px 10px; font-size: 11px; }
.svc-banner-dismiss {
  background: none; border: none; cursor: pointer;
  color: inherit; opacity: .45; font-size: 12px; padding: 2px 6px;
  border-radius: 5px; flex-shrink: 0;
}
.svc-banner-dismiss:hover { opacity: 1; background: rgba(20,20,16,.07); }

.bd-exec-compact { align-items: center; gap: 10px; flex-wrap: wrap; }
.bd-exec-toggle {
  background: none; border: 1px solid var(--border); border-radius: 7px;
  color: var(--text3); font-size: 11px; padding: 5px 10px; cursor: pointer;
  white-space: nowrap; flex-shrink: 0;
}
.bd-exec-toggle:hover { color: var(--text1); border-color: var(--border-hover); }
.bd-exec-detail { margin-top: 10px; display: flex; flex-direction: column; gap: 8px; }

/* ═══ BLOQUE 2 — SISTEMA DE DISEÑO: capa de normalización ══════════════
   Unifica las variantes históricas de botones, chips e inputs sin tocar
   el markup. Regla: 2 intenciones de botón (primaria/secundaria) × 2
   tamaños; 1 escala de chips de estado; 1 estilo de input. */

/* Botones — métrica y radio únicos */
.btn-primary, .btn-secondary, .login-btn, .btn-ai-generate {
  border-radius: 9px;
  font-size: 13px;
  font-weight: 600;
  padding: 9px 16px;
  line-height: 1.2;
  transition: all var(--t, .15s);
}
.sidebar-user-btn, .fin-mini-btn, .svc-banner-cta, .bd-exec-toggle {
  border-radius: 7px;
  font-size: 11px;
  font-weight: 600;
  padding: 5px 10px;
  line-height: 1.2;
}
.btn-icon, .icon-btn, .lib-item-del {
  border-radius: 7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 26px;
  min-height: 26px;
  line-height: 1;
}
.btn-icon:hover, .icon-btn:hover { background: rgba(20,20,16,.07); }

/* Chips de estado — una sola escala (forma y peso) */
.fin-badge, .svc-chip, .role-badge, .status-badge, .badge, .cal-badge-obj, .cal-badge-format {
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  line-height: 1.5;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

/* Inputs — un solo estilo (métrica y foco) */
.lib-input, .fin-input, .pl-input, .clickup-list-select {
  border-radius: 8px;
  font-size: 13px;
  font-family: var(--font-body);
  transition: border-color var(--t, .15s), background var(--t, .15s);
}
.lib-input:focus, .fin-input:focus, .pl-input:focus, .clickup-list-select:focus {
  outline: none;
  border-color: var(--accent);
}

/* Empty states — emoji tratado como ilustración monocroma consistente */
.ai-empty-icon {
  filter: grayscale(1);
  opacity: .55;
  background: rgba(20,20,16,.05);
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  margin-bottom: 4px;
}

/* Los SVG heredan el color del texto en cards y acciones */
.tool-icon svg { display: block; color: var(--text1); }
.tool-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 9px;
  background: rgba(20,20,16,.05);
  flex-shrink: 0;
}
.btn-icon svg, .icon-btn svg { display: block; }

/* ── Bloque 3: navegación ──────────────────────────────────────────── */
.client-search {
  width: calc(100% - 16px);
  margin: 0 8px 8px;
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg1);
  color: var(--text1);
  font-size: 12px;
  font-family: var(--font-body);
}
.client-search:focus { outline: none; border-color: var(--accent); }
.estudio-chip { border: 1px dashed rgba(20,20,16,.25); }
.nav-group-toggle {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%; background: none; border: none; cursor: pointer;
  text-align: left; font: inherit;
}
.nav-group-caret { font-size: 9px; opacity: .5; margin-right: 10px; }
.nav-group-items.collapsed { display: none; }

/* ── Ajuste sidebar clientes: mismo lenguaje que el menú superior ────── */
.sidebar-clients { padding: 12px 8px 0; }
.section-label,
#estudio-chip-wrap .section-label {
  font-family: var(--font-body);
  font-size: 10px; font-weight: 700;
  letter-spacing: .12em; text-transform: uppercase;
  color: #10120b !important; opacity: .55;
  padding: 10px 14px 6px;
}
/* Klapa: chip normal (sin punteado), avatar lima con letra blanca */
.estudio-chip { border: none; }
.estudio-chip .client-avatar { background: var(--brand-lime, #CFEA5B) !important; color: #fff !important; }
/* Buscador integrado al menú (sin caja blanca flotante) */
.client-search {
  width: calc(100% - 12px);
  margin: 2px 6px 10px;
  padding: 8px 12px;
  background: rgba(20,20,16,.04);
  border: 1px solid transparent;
  border-radius: 8px;
  font-size: 12px;
}
.client-search::placeholder { color: var(--text3); }
.client-search:focus { outline: none; border-color: var(--border-hover); background: var(--bg1); }

/* ── Bloque 4: mobile ──────────────────────────────────────────────── */
/* Cards de cobros: solo en pantallas chicas (la tabla, solo en grandes) */
.fin-mcards { display: none; }
.fin-mcard {
  border: 1px solid var(--border); border-radius: 12px;
  padding: 12px 14px; margin-bottom: 10px; background: var(--surface, #fff);
  display: flex; flex-direction: column; gap: 8px;
}
.fin-mcard-late { border-color: rgba(238,90,56,.5); background: rgba(238,90,56,.04); }
.fin-mcard-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.fin-mcard-client { font-weight: 700; font-size: 14px; }
.fin-mcard-svc { font-size: 12px; color: var(--text3); }
.fin-mcard-row {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 13px; color: var(--text3);
}
.fin-mcard-row strong { color: var(--text1); }
.fin-mcard-actions { display: flex; gap: 8px; align-items: center; }
.fin-mcard-actions .fin-input { flex: 1; }

@media (max-width: 700px) {
  .fin-mcards { display: block; }
  #section-finance .planning-table-wrap { display: none; }
  /* Toolbar de finanzas compacta */
  #section-finance .impact-toolbar { position: sticky; top: 0; z-index: 5; background: var(--bg2, #f2f1ea); padding: 8px 0; }
  /* Cartera: en el teléfono solo lo esencial (Cliente / Próxima acción / Acciones) */
  #clients-table-wrap .clients-table { min-width: 0; }
  #clients-table-wrap .clients-table th:nth-child(2),
  #clients-table-wrap .clients-table td:nth-child(2),
  #clients-table-wrap .clients-table th:nth-child(3),
  #clients-table-wrap .clients-table td:nth-child(3) { display: none; }
  /* Cards de resumen de finanzas: 2 por fila */
  .fin-cards { grid-template-columns: repeat(2, 1fr); }
}

/* Chip de cobranzas en el Centro de Operaciones (solo admins) */
.ops-chip-finanzas { cursor: pointer; border: 1px solid var(--border); }
.ops-chip-finanzas:hover { border-color: var(--border-hover); background: rgba(20,20,16,.05); }

/* ── Mobile: grids que se cortaban a la derecha (capturas 16/7) ───────── */
@media (max-width: 700px) {
  /* Briefing: formularios a 1 columna, meses a 2 */
  .brief-form-grid { grid-template-columns: 1fr !important; }
  .brief-month-grid { grid-template-columns: repeat(2, 1fr) !important; }
  /* Posts: KPIs a 2 columnas (antes 4 fijas, se cortaban) */
  .posts-kpi-row { grid-template-columns: repeat(2, 1fr) !important; }
  /* Onboarding BD: campos a 1 columna */
  .bd-field-grid { grid-template-columns: 1fr !important; }
  /* Modales: nunca más anchos que la pantalla; footer apilable */
  .modal-box { max-width: calc(100vw - 20px) !important; }
  .modal-footer { flex-wrap: wrap !important; row-gap: 8px; }
  .modal-footer .btn-primary, .modal-footer .btn-secondary { flex: 1 1 auto; }
}

/* ── Mobile: hero BD, tabla de usuarios y tabs de finanzas ─────────────── */
@media (max-width: 700px) {
  /* Tablero BD: cards del hero a 1 columna (se cortaban a la derecha) */
  .bd-hero { grid-template-columns: 1fr !important; }
  /* Usuarios: la tabla scrollea horizontal SIN cortar, y oculta columnas
     secundarias (Clientes / Secciones) — quedan Usuario, Rol, Estado, Acciones */
  #users-table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  #users-table th:nth-child(4), #users-table td:nth-child(4),
  #users-table th:nth-child(5), #users-table td:nth-child(5) { display: none; }
  /* Tabs (Finanzas, Briefing, etc.): que envuelvan en 2 filas, no que se corten */
  .brief-tabs { flex-wrap: wrap; }
  .brief-tabs .brief-tab { flex: 1 1 auto; text-align: center; }
}


/* ── Procesos: clientes → servicios → etapas ─────────────────────────────── */
.pm-head { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.pm-head-label { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--text3); }
.pm-head-mes { font-family: var(--font-display); font-size: 22px; font-weight: 700; }
.pm-head-actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.pm-spacer { flex: 1; }

.pm-weeks { margin-bottom: 14px; }
.pm-weeks-title { font-weight: 600; margin-bottom: 8px; }
.pm-weeks-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.pm-weeks-row label { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; }
.pm-weeks-row input { width: 64px; }
.pm-weeks-help { font-size: 12px; margin: 8px 0 0; }

/* Banner de atrasos */
.pm-banner-item { display: flex; gap: 10px; align-items: baseline; width: 100%; text-align: left; background: none;
  border: none; padding: 5px 4px; border-radius: 6px; cursor: pointer; font: inherit; font-size: 13px; color: var(--text); }
.pm-banner-item:hover { background: rgba(238,90,56,.10); }

/* Cliente */
.pm-client { background: var(--card); border: 1px solid var(--border); border-radius: 14px; margin-bottom: 10px; }
.pm-client-head { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 10px; width: 100%; padding: 12px 14px;
  background: none; border: none; cursor: pointer; font: inherit; color: var(--text); text-align: left; }
.pm-chevron { color: var(--text3); font-size: 13px; transition: transform .15s; }
.pm-client.is-open .pm-chevron { transform: rotate(90deg); }
.pm-client-name { font-weight: 700; font-size: 15px; }
.pm-minis { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-left: auto; }
.pm-mini { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text2); }
.pm-mini-name { white-space: nowrap; }
.pm-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--brand-coral); display: inline-block; }
.pm-client-body:empty { display: none; }
.pm-client-body { padding: 0 14px 14px; }
.pm-client-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 12px; padding-top: 12px;
  border-top: 1px solid var(--border-subtle); }
.pm-client-actions .fin-input { min-width: 160px; }
.pm-add-client { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.pm-add-client .fin-input { flex: 1; min-width: 200px; }

.pm-pill { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 10px; background: var(--surface2); color: var(--text2); white-space: nowrap; }
.pm-pill-late { background: var(--brand-coral); color: #fff; }
.pm-pill-agenda { background: var(--brand-violet); color: var(--text1); }

.pm-bar { display: inline-block; width: 70px; height: 6px; border-radius: 3px; background: var(--surface2); overflow: hidden; vertical-align: middle; }
.pm-bar > span { display: block; height: 100%; background: var(--brand-blue); }
.pm-bar.is-full > span { background: var(--brand-lime); }
.pm-count { font-size: 12px; color: var(--text2); min-width: 28px; }

/* Servicio (desplegable) */
.pm-svc { border-top: 1px solid var(--border-subtle); }
.pm-svc-head { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; width: 100%; padding: 10px 2px;
  background: none; border: none; cursor: pointer; font: inherit; color: var(--text); text-align: left; }
.pm-svc-head:hover { background: var(--surface); }
.pm-svc.is-open > .pm-svc-head .pm-chevron { transform: rotate(90deg); }
.pm-svc-name { font-weight: 700; }
.pm-svc-bar { display: inline-flex; align-items: center; gap: 6px; }
.pm-svc-cont { font-size: 12px; color: var(--text3); margin-left: auto; }
.pm-svc-body:empty { display: none; }
.pm-svc-body { padding: 0 0 10px 18px; }
.pm-svc-actions { display: flex; gap: 12px; justify-content: flex-end; margin-top: 6px; }
.pm-add-svc { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 10px 0; border-top: 1px solid var(--border-subtle); }
.pm-add-svc .fin-input { min-width: 160px; }
.pm-empty { font-size: 13px; margin: 4px 0; }

/* Etapa */
.pm-stage { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 8px; padding: 5px 6px; border-radius: 8px; }
.pm-stage:hover { background: var(--surface); }
.pm-stage-check { flex: 0 0 auto; display: inline-flex; min-width: 22px; }
.pm-check { width: 18px; height: 18px; accent-color: var(--brand-blue); cursor: pointer; }
.pm-stage-name { flex: 1 1 200px; min-width: 140px; border: 1px solid transparent; background: none; border-radius: 6px;
  padding: 4px 6px; font: inherit; font-size: 13.5px; color: var(--text); }
.pm-stage-name:hover, .pm-stage-name:focus { border-color: var(--border); background: var(--card); outline: none; }
.pm-stage.is-done .pm-stage-name { color: var(--text3); text-decoration: line-through; }
.pm-stage.is-na { opacity: .45; }
.pm-stage.is-na .pm-stage-name { font-style: italic; }
.pm-stage.is-late { background: rgba(238,90,56,.07); }
.pm-stage.is-late .pm-date { border-color: var(--brand-coral); color: var(--brand-coral); }
.pm-late-label { font-size: 11px; font-weight: 700; color: var(--brand-coral); white-space: nowrap; }
.pm-date-wrap { display: inline-flex; align-items: center; gap: 6px; }
.pm-date { border: 1px solid var(--border); border-radius: 6px; padding: 3px 6px; font: inherit; font-size: 12px; background: var(--card); color: var(--text); }
.pm-resp { display: inline-flex; flex-wrap: wrap; gap: 4px; background: none; border: none; padding: 2px; cursor: pointer; border-radius: 6px; }
.pm-resp:hover { background: var(--surface2); }
.pm-chip { background: var(--surface2); border: 1px solid var(--border); border-radius: 10px; padding: 1px 8px; font-size: 11.5px; white-space: nowrap; color: var(--text); }
.pm-chip-empty { border-style: dashed; color: var(--text3); background: none; }
.pm-na, .pm-more { background: none; border: 1px solid var(--border); border-radius: 6px; padding: 2px 7px; font-size: 11px;
  cursor: pointer; color: var(--text2); font-family: inherit; }
.pm-na.is-on { background: var(--text2); color: #fff; border-color: var(--text2); }
.pm-more { font-size: 14px; line-height: 1; padding: 2px 8px; }
.pm-weeks-checks { display: inline-flex; gap: 3px; }
.pm-wk { border: 1px solid var(--border); background: var(--card); border-radius: 6px; padding: 2px 5px; font-size: 11px;
  font-weight: 700; cursor: pointer; color: var(--text2); font-family: inherit; }
.pm-wk.is-now { border-color: var(--brand-blue); }
.pm-wk.is-on { background: var(--brand-blue); border-color: var(--brand-blue); color: #fff; }
.pm-wk.is-late { background: rgba(238,90,56,.12); border-color: var(--brand-coral); color: var(--brand-coral); }
.pm-wk:disabled { cursor: default; }
.pm-add-stage { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 6px 0 4px 6px; }
.pm-add-stage .fin-input { flex: 1 1 200px; max-width: 360px; }
.pm-check-label { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--text2); }
.pm-flash { animation: pm-flash 1.6s ease; }
@keyframes pm-flash { 0%, 40% { box-shadow: 0 0 0 3px var(--brand-coral); } 100% { box-shadow: 0 0 0 0 transparent; } }

/* Lo contratado */
.pm-cont { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 8px 0 0 6px; }
.pm-cont-label { font-size: 12px; color: var(--text3); }
.pm-counter { display: inline-flex; align-items: center; gap: 4px; background: var(--surface2); border-radius: 10px; padding: 3px 6px; font-size: 13px; }
.pm-counter.is-full { background: var(--brand-lime); }
.pm-counter-name { font-weight: 600; cursor: pointer; margin-right: 2px; }
.pm-counter-val { font-weight: 700; min-width: 14px; text-align: right; }
.pm-counter-meta { width: 40px; border: 1px solid transparent; background: none; font: inherit; font-weight: 700; padding: 0 2px; border-radius: 4px; color: var(--text); }
.pm-counter-meta:hover, .pm-counter-meta:focus { border-color: var(--border); background: var(--card); }
.pm-counter-btn { width: 22px; height: 22px; border-radius: 50%; border: 1px solid var(--border); background: var(--card);
  cursor: pointer; font-weight: 700; line-height: 1; padding: 0; color: var(--text); }
.pm-counter-x { background: none; border: none; color: var(--text3); cursor: pointer; font-size: 10px; padding: 0 2px; }
.pm-counter-add { display: inline-flex; gap: 4px; }
.pm-counter-add .fin-input { width: 110px; padding: 4px 6px; font-size: 12px; }
.pm-counter-add .fin-input[type=number] { width: 64px; }

/* Secciones del cliente: pedidos, reuniones y pagos */
.pm-sec { border-top: 1px solid var(--border-subtle); margin-top: 6px; padding-top: 10px; }
.pm-sec-title { font-weight: 700; margin-bottom: 6px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.pm-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding: 6px; border-radius: 8px; font-size: 13px; }
.pm-row:hover { background: var(--surface); }
.pm-row.is-res { opacity: .5; }
.pm-row.is-res .pm-row-texto { text-decoration: line-through; }
.pm-row-fecha { color: var(--text3); font-size: 12px; min-width: 36px; }
.pm-row-texto { flex: 1 1 220px; }
.pm-row-resp { color: var(--text2); font-size: 12px; }
.pm-ped-toggle { margin: 4px 0; }
.pm-urg { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 10px; white-space: nowrap; }
.pm-urg-alta { background: var(--brand-coral); color: #fff; }
.pm-urg-media { background: var(--brand-violet); color: var(--text1); }
.pm-urg-baja { background: var(--surface2); color: var(--text2); }
.pm-sec-add { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.pm-grow { flex: 1 1 200px; }
.pm-num { width: 64px; }
.pm-inline { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 400; color: var(--text2); }
.pm-inline .pm-num { padding: 3px 6px; }
.pm-help { font-size: 12px; margin: 6px 0 0; }
.pm-pill-pago { background: var(--brand-violet); color: var(--text1); }
.pm-pill-reu { background: rgba(70,87,212,.12); color: var(--brand-blue); }
.pm-pill-ok { background: var(--brand-lime); color: var(--text1); }

/* Esta semana */
.pm-semana-fecha { flex: 0 0 auto; min-width: 74px; font-weight: 600; color: var(--text2); }
.pm-semana-fecha.is-late { color: var(--brand-coral); }
.pm-bloq { font-style: italic; color: var(--text2); }
.pm-faltan { color: #8B1E2D; }
.pm-tag { font-size: 10.5px; font-weight: 700; padding: 1px 7px; border-radius: 8px; margin-right: 6px; }
.pm-tag-reu { background: rgba(70,87,212,.12); color: var(--brand-blue); }
.pm-tag-pago { background: var(--brand-violet); color: var(--text1); }

/* Vista por persona */
.pm-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 12px; }
.pm-tab { border: 1px solid var(--border); background: var(--card); border-radius: 18px; padding: 5px 12px; font: inherit;
  font-size: 13px; cursor: pointer; color: var(--text2); }
.pm-tab.is-on { background: var(--text); border-color: var(--text); color: #fff; }
.pm-persona { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 14px; align-items: start; }
.pm-persona-lista, .pm-persona-msg { background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 12px 14px; }
.pm-persona ul { list-style: none; margin: 0 0 10px; padding: 0; }
.pm-persona-titulo { font-weight: 700; margin: 2px 0 6px; display: flex; align-items: center; gap: 6px; }
.pm-persona-titulo.is-late { color: var(--brand-coral); }
.pm-persona-msg textarea { width: 100%; font-family: inherit; font-size: 13px; resize: vertical; margin-bottom: 8px; box-sizing: border-box; }
@media (max-width: 900px) { .pm-persona { grid-template-columns: 1fr; } }

/* Menú flotante (responsables / opciones de etapa) */
.pm-pop { position: fixed; z-index: 1000; background: var(--card); border: 1px solid var(--border); border-radius: 10px;
  box-shadow: 0 12px 30px -10px rgba(20,20,16,.3); padding: 6px; min-width: 200px; }
.pm-pop-title { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--text3); padding: 4px 6px; }
.pm-pop-opt { display: flex; align-items: center; gap: 8px; padding: 6px; border-radius: 6px; cursor: pointer; font-size: 13px; }
.pm-pop-opt:hover, .pm-pop-btn:hover:not(:disabled) { background: var(--surface2); }
.pm-pop-opt small { color: var(--text3); margin-left: 4px; }
.pm-pop-btn { display: block; width: 100%; text-align: left; background: none; border: none; padding: 7px 8px; border-radius: 6px;
  cursor: pointer; font: inherit; font-size: 13px; color: var(--text); }
.pm-pop-btn:disabled { opacity: .35; cursor: default; }

@media (max-width: 700px) {
  .pm-minis { margin-left: 0; width: 100%; }
  .pm-stage { padding: 8px 4px; border-bottom: 1px solid var(--border-subtle); border-radius: 0; }
  .pm-stage-name { flex-basis: calc(100% - 40px); }
  .pm-head-actions { margin-left: 0; }
}

/* ── Finanzas 2.0 ─────────────────────────────────────────────────────────── */
.f2-num { width: 70px; }
.f2-money { width: 120px; }
.f2-pct { width: 56px; padding: 3px 5px; }
.f2-tc { font-weight: 700; padding: 6px 0; }
.f2-r { text-align: right; white-space: nowrap; }
.f2-c { text-align: center; white-space: nowrap; }
.f2-table td { vertical-align: top; }
.f2-row-dim td { opacity: .6; }
.f2-form-row td { background: var(--surface); }
.f2-acts { white-space: nowrap; }
.f2-card-sub { font-size: 11.5px; color: var(--text2); margin-top: 4px; }
.f2-chips { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.f2-chip { background: var(--surface2); border-radius: 10px; padding: 1px 8px; font-size: 11.5px; white-space: nowrap; }
.f2-x { background: none; border: none; color: var(--text3); cursor: pointer; font-size: 10px; padding: 0 0 0 2px; }
.f2-x:hover { color: var(--brand-coral); }
.f2-pcts { display: flex; gap: 4px; margin-top: 4px; }
.f2-add-costo { display: flex; gap: 4px; margin-top: 6px; }
.f2-fondo { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; margin-top: 16px; }
.f2-socias { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; margin-bottom: 16px; }
.f2-socia h3 { margin: 0 0 10px; }
.f2-line { display: flex; justify-content: space-between; gap: 12px; padding: 5px 0; font-size: 13.5px; border-bottom: 1px solid var(--border-subtle); }
.f2-total { font-weight: 700; font-size: 16px; border-bottom: none; padding-top: 8px; }
.f2-neg { color: var(--brand-coral); font-size: 12.5px; margin: 6px 0; }
.f2-alerta { background: rgba(238,90,56,.08); border: 1px solid rgba(238,90,56,.35); color: var(--text); border-radius: 12px;
  padding: 10px 14px; margin-bottom: 16px; font-size: 13.5px; }
.f2-group td { font-weight: 700; background: var(--surface); }
.f2-total-row td { font-weight: 700; }
.f2-help { font-size: 12.5px; margin: 6px 0 12px; }
.f2-check { display: flex; align-items: center; gap: 8px; font-size: 13px; margin-top: 6px; }
.f2-cliente { margin-bottom: 12px; }
.f2-cliente-head { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.f2-cliente-nombre { font-weight: 700; min-width: 180px; }
.f2-grow { flex: 1; min-width: 180px; }
.planning-table.f2-table { min-width: 720px; }
.f2-table td { padding-top: 8px; padding-bottom: 8px; }
.f2-table .fin-input { min-width: 0; padding: 5px 7px; }
.f2-table td input.fin-input:not([type]) { width: 120px; }
.f2-table .f2-money { width: 88px; }
.f2-table .f2-pct { width: 44px; }
.f2-table .f2-num { width: 56px; }
.f2-table select.fin-input { width: 100px; }
.f2-table input[type=month] { width: 116px; }
.f2-add-costo select.fin-input { width: 92px; }
.f2-add-costo .f2-money { width: 80px; }
.f2-pct { -moz-appearance: textfield; text-align: center; }
.f2-pct::-webkit-inner-spin-button, .f2-pct::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
/* Finanzas 2.0: clientes como cards desplegables de colores */
.f2-cli { border-radius: 14px; margin-bottom: 10px; overflow: hidden; border: 1px solid var(--border); background: var(--card); }
.f2-cli-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; width: 100%; padding: 14px 16px; border: none;
  cursor: pointer; font: inherit; font-size: 15px; text-align: left; color: var(--text1); }
.f2-cli-lime .f2-cli-head { background: var(--brand-lime); }
.f2-cli-violet .f2-cli-head { background: var(--brand-violet); }
.f2-cli-blue .f2-cli-head { background: var(--brand-blue); color: #fff; }
.f2-cli-coral .f2-cli-head { background: var(--brand-coral); color: #fff; }
.f2-cli-sub { margin-left: auto; font-size: 13px; opacity: .85; }
.f2-chev { transition: transform .15s; font-size: 13px; }
.f2-cli.is-open .f2-chev { transform: rotate(90deg); }
.f2-cli-body { padding: 14px 16px; }
.f2-cli-name { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; font-size: 12px; color: var(--text2); }
.f2-cli-name .fin-input { font-weight: 700; min-width: 200px; }
.f2-pct-label { display: inline-flex; align-items: center; gap: 3px; font-size: 11.5px; color: var(--text2); }
.f2-pcts { flex-wrap: wrap; gap: 6px; }
.f2-reparto { font-size: 12.5px; white-space: nowrap; }
.f2-add-costo input.fin-input:not([type]) { width: 92px; }
.f2-tablero select.fin-input { width: 124px; }
.f2-table .f2-reparto { padding-left: 16px; }
.fin-card-blue .f2-card-sub, .fin-card-coral .f2-card-sub { color: rgba(255,255,255,.85); }
.f2-pct-msg { flex-basis: 100%; font-size: 11.5px; color: var(--brand-coral); }
.f2-pct-msg:empty { display: none; }
/* Finanzas 2.0 · Tablero editable y modal de cliente del mes */
.f2-card-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.f2-card-head h3 { margin: 0; margin-right: auto; }
.f2-row-click { cursor: pointer; }
.f2-row-click:hover td { background: var(--surface); }
.f2-parte { font-size: 12.5px; white-space: nowrap; }
.f2-parte span { color: var(--text3); margin-left: 4px; }
.f2-parte.is-ok span { color: var(--green, #2e9e5b); font-weight: 600; }
.f2-moneda { width: 64px !important; }
.f2-modal { width: 620px; max-width: 95vw; max-height: 90vh; overflow-y: auto; }
.f2-modal-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; }
.f2-modal-grid label { margin: 0 !important; }
.f2-modal-grid .fin-input { width: 100%; }
.f2-modal-sec { border-top: 1px solid var(--border-subtle); padding-top: 12px; }
.f2-modal-sec .fin-card-label { margin-bottom: 6px; }
.f2-modal .f2-pct-label { flex-direction: row; align-items: center; margin: 0 !important; }
.f2-modal .f2-pct { width: 56px; padding: 6px; }
.f2-modal .f2-check { flex-direction: row; margin: 0 !important; }
@media (max-width: 560px) { .f2-modal-grid { grid-template-columns: 1fr; } .f2-modal { padding: 20px; } }

/* ─── GROWTH MKT (Business Design) ───────────────────── */
#section-bd-growth { padding-top: 18px; }
.gm-save-status { margin-left: auto; font-size: 12px; color: var(--text3); font-weight: 600; }
.gm-save-status.error { color: var(--red); }
.gm-btn-sm { padding: 6px 12px !important; font-size: 12px !important; border-radius: 9px !important; }
.gm-btn-sm:disabled { opacity: .45; cursor: not-allowed; }
.gm-empty { font-size: 13px; color: var(--text3); margin: 4px 0 8px; }
.gm-warn { font-size: 12px; color: var(--red); margin: 6px 0 0; }
.gm-warn:empty { display: none; }

.gm-layout { display: grid; grid-template-columns: 260px minmax(0,1fr); gap: 16px; align-items: start; }
.gm-side { position: sticky; top: 12px; padding: 14px; }
.gm-side .agenda-panel-head h3 { font-size: 16px; }
.gm-month-list { display: flex; flex-direction: column; gap: 6px; }
.gm-month-item { display: flex; flex-direction: column; gap: 5px; text-align: left; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--border-subtle); background: #fff; cursor: pointer; font-family: inherit; color: var(--text); }
.gm-month-item:hover { border-color: var(--border-hover); }
.gm-month-item.active { border-color: #141410; box-shadow: inset 0 0 0 1px #141410; }
.gm-month-name { font: 700 14px var(--font-display); }
.gm-month-meta { display: flex; gap: 5px; flex-wrap: wrap; }
.gm-month-progress { font-size: 11px; color: var(--text3); }
.gm-chip { display: inline-block; font-size: 10px; font-weight: 800; letter-spacing: .03em; text-transform: uppercase; padding: 3px 8px; border-radius: 999px; }
.gm-chip-overdue { background: var(--brand-coral); color: #fff; }

.gm-new-month { display: flex; flex-direction: column; gap: 8px; padding: 10px; margin-bottom: 10px; border-radius: 12px; background: var(--bg2); }
.gm-new-row { display: flex; gap: 6px; }
.gm-new-row select, .gm-new-row input { flex: 1; min-width: 0; border: 1.5px solid var(--border); border-radius: 9px; padding: 7px 8px; font: 600 13px var(--font-body); background: #fff; }
.gm-carry { display: flex; gap: 6px; align-items: flex-start; font-size: 12px; font-weight: 600; line-height: 1.35; cursor: pointer; }

.gm-detail { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.gm-head { padding: 14px 18px; }
.gm-head-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.gm-head-row h3 { margin: 0; font-size: 22px; }
.gm-estado { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text3); font-weight: 600; }
/* El select global va blanco con !important: el color del estado entra por variables */
.gm-estado select { border: 0 !important; border-radius: 999px; padding: 6px 12px; min-width: 120px; font: 800 12px var(--font-body); cursor: pointer;
  background: var(--gm-bg, #fff) !important; color: var(--gm-fg, #141410) !important; }
.gm-del-month { margin-left: auto; }
.gm-month-n { font: 600 11px var(--font-body); color: var(--text3); margin-left: 6px; }
.gm-ficha-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 12px; }
.gm-ficha-tab { display: inline-flex; align-items: center; gap: 6px; border: 1.5px solid var(--border); background: #fff; color: #141410; border-radius: 999px; padding: 6px 12px; font: 700 12px var(--font-body); cursor: pointer; }
.gm-ficha-tab:hover { border-color: var(--border-hover); }
.gm-ficha-tab.active { background: #141410; border-color: #141410; color: #fff; }
.gm-ficha-add { border-style: dashed; color: var(--text2); }
.gm-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.gm-ficha-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.gm-del-ficha { margin-left: auto; }
.gm-alert:empty { display: none; }
#gm-overdue-alert .gm-alert { margin: 0 0 12px; }
.gm-alert { margin-top: 10px; padding: 9px 12px; border-radius: 10px; background: var(--accent-soft); color: #b8391c; font-size: 13px; font-weight: 700; }

.gm-block { padding: 14px 18px; }
.gm-block > summary { cursor: pointer; font: 700 15px var(--font-display); list-style: none; display: flex; align-items: center; gap: 8px; }
.gm-block > summary::-webkit-details-marker { display: none; }
.gm-block > summary::before { content: "▸"; font-size: 12px; color: var(--text3); transition: transform var(--t); }
.gm-block[open] > summary::before { transform: rotate(90deg); }
.gm-block[open] > summary { margin-bottom: 12px; }
.gm-count { font-size: 11px; background: var(--bg2); border-radius: 999px; padding: 2px 8px; color: var(--text2); }

.gm-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; }
.gm-field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.gm-field-wide { grid-column: 1 / -1; }
.gm-field > span, .gm-subhead h4, .gm-check-head h4 { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; color: var(--text3); margin: 0; }
.gm-field textarea, .gm-field input, .gm-deadline input, .gm-kpi-row input, .gm-check-add input, .gm-deliv-row input, .gm-resp {
  width: 100%; border: 1.5px solid var(--border); border-radius: 9px; background: #fff; color: #141410;
  font: 500 13px var(--font-body); padding: 7px 9px; resize: vertical; min-width: 0; }
.gm-field textarea:focus, .gm-field input:focus, .gm-deadline input:focus, .gm-kpi-row input:focus, .gm-check-add input:focus, .gm-deliv-row input:focus, .gm-check-text:focus { outline: none; border-color: var(--brand-blue); }
.gm-deadline { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.gm-deadline input { width: auto; flex: 1; min-width: 130px; }
.gm-arrow { color: var(--text3); }
.gm-seg { display: inline-flex; background: var(--bg2); border-radius: 9px; padding: 3px; }
.gm-seg button { border: 0; background: transparent; padding: 5px 10px; border-radius: 7px; font: 700 12px var(--font-body); color: var(--text2); cursor: pointer; }
.gm-seg button.active { background: #141410; color: #fff; }

.gm-subhead { display: flex; align-items: center; justify-content: space-between; margin: 16px 0 8px; }
.gm-kpi-table { display: flex; flex-direction: column; gap: 6px; }
.gm-kpi-row { display: grid; grid-template-columns: minmax(120px,2fr) minmax(60px,.8fr) repeat(3, minmax(70px,1fr)) 64px 26px; gap: 6px; align-items: center; }
.gm-kpi-headrow span { font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; color: var(--text3); }
.gm-kpi-pct { text-align: center; font-size: 12px; color: var(--text3); }
.gm-pct { font-weight: 800; font-size: 12px; padding: 2px 7px; border-radius: 999px; }
.gm-pct.ok { background: var(--brand-lime); color: #141410; }
.gm-pct.mid { background: var(--brand-violet); color: #141410; }
.gm-pct.low { background: var(--accent-soft); color: #b8391c; }

.gm-checklists { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 16px 0; }
.gm-checklist { background: var(--bg2); border-radius: 12px; padding: 12px; min-width: 0; }
.gm-check-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.gm-check-head h4 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gm-check-count { font: 800 14px var(--font-display); }
.gm-progress { height: 5px; background: rgba(20,20,16,.08); border-radius: 4px; overflow: hidden; margin: 6px 0 8px; }
.gm-progress > div { height: 100%; background: var(--brand-blue); transition: width .3s; }
.gm-check-list { list-style: none; display: flex; flex-direction: column; gap: 2px; }
.gm-check-item { display: flex; align-items: center; gap: 6px; }
.gm-check-item input[type=checkbox] { width: 16px; height: 16px; flex-shrink: 0; accent-color: #141410; cursor: pointer; }
.gm-check-text { flex: 1; min-width: 0; border: 1.5px solid transparent; border-radius: 7px; background: transparent; padding: 5px 6px; font: 500 13px var(--font-body); color: #141410; }
.gm-check-text:hover { border-color: var(--border-subtle); background: #fff; }
.gm-check-item.done .gm-check-text { text-decoration: line-through; color: var(--text3); }
.gm-carried { font-size: 12px; color: var(--brand-blue); font-weight: 800; }
.gm-resp { width: auto !important; max-width: 135px; padding: 4px 6px !important; font-size: 12px !important; }
.gm-check-add { display: flex; gap: 6px; margin-top: 8px; }
.gm-check-add input { flex: 1; }
.gm-del { border: 0; background: transparent; color: var(--text3); font-size: 18px; line-height: 1; cursor: pointer; padding: 2px 6px; border-radius: 6px; }
.gm-del:hover { color: var(--red); background: var(--accent-soft); }

.gm-deliv-row { display: flex; align-items: center; gap: 8px; padding: 7px 0; border-bottom: 1px solid var(--border-subtle); }
.gm-deliv-link { font-weight: 700; font-size: 14px; color: var(--brand-blue); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gm-deliv-link:hover { text-decoration: underline; }
.gm-deliv-host { font-size: 11px; color: var(--text3); flex: 1; }
.gm-link-btn { border: 0; background: transparent; color: var(--text2); font: 600 12px var(--font-body); cursor: pointer; }
.gm-link-btn:hover { color: var(--accent); }
.gm-deliv-add, .gm-deliv-edit { border-bottom: 0; }
.gm-deliv-add .gm-deliv-name, .gm-deliv-edit .gm-deliv-name { flex: 1; }
.gm-deliv-add .gm-deliv-url, .gm-deliv-edit .gm-deliv-url { flex: 2; }

.gm-tl-track { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 6px; scroll-snap-type: x proximity; }
.gm-tl-card { flex: 0 0 250px; scroll-snap-align: start; display: flex; flex-direction: column; gap: 7px; background: #fff; border: 1px solid var(--border-subtle); border-radius: 16px; padding: 14px; cursor: pointer; }
.gm-tl-card:hover { border-color: var(--border-hover); }
.gm-tl-card.overdue { border-color: var(--brand-coral); }
.gm-tl-top { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.gm-tl-month { font: 700 16px var(--font-display); }
.gm-tl-ficha { display: flex; flex-direction: column; gap: 5px; padding: 8px 10px; border-radius: 10px; background: var(--bg2); }
.gm-tl-ficha.overdue { box-shadow: inset 0 0 0 1px var(--brand-coral); }
.gm-tl-ficha-top { display: flex; align-items: center; justify-content: space-between; gap: 6px; font-size: 12px; }
.gm-tl-ficha > .gm-chip-overdue { align-self: flex-start; }
.gm-tl-prop { font-size: 13px; line-height: 1.4; margin: 0; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.gm-tl-meta { font-size: 11px; color: var(--text3); }
.gm-tl-kpis { display: flex; flex-direction: column; gap: 4px; border-top: 1px solid var(--border-subtle); padding-top: 8px; }
.gm-tl-kpi { display: flex; align-items: baseline; gap: 4px; font-size: 12px; flex-wrap: wrap; }
.gm-tl-kpi > span:first-child { flex: 1 1 100%; color: var(--text2); font-weight: 600; }
.gm-tl-kpi .gm-pct { margin-left: auto; }
.gm-evo { margin-top: 14px; }
.gm-evo-scroll { overflow-x: auto; }
.gm-evo-table { border-collapse: collapse; font-size: 13px; width: 100%; }
.gm-evo-table th, .gm-evo-table td { padding: 7px 10px; border-bottom: 1px solid var(--border-subtle); text-align: right; white-space: nowrap; }
.gm-evo-table th:first-child, .gm-evo-table td:first-child { text-align: left; font-weight: 700; }
.gm-evo-table th { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--text3); }
.gm-evo-empty { color: var(--text3); }

@media (max-width: 920px) {
  .gm-layout { grid-template-columns: minmax(0,1fr); }
  .gm-side { position: static; }
  .gm-month-list { flex-direction: row; overflow-x: auto; }
  .gm-month-item { flex: 0 0 190px; }
}
@media (max-width: 640px) {
  .gm-grid, .gm-checklists { grid-template-columns: 1fr; }
  .gm-kpi-headrow { display: none !important; }
  .gm-kpi-row { grid-template-columns: 1fr 1fr 1fr; padding: 8px; background: var(--bg2); border-radius: 10px; }
  .gm-kpi-row .gm-kpi-name { grid-column: 1 / 3; }
  .gm-deliv-add, .gm-deliv-edit { flex-wrap: wrap; }
  .gm-deliv-add input, .gm-deliv-edit input { flex: 1 1 100% !important; }
  .gm-del-month { margin-left: 0; }
}

/* ── Tareas del equipo ─────────────────────────────────────────────────────
   Una sola columna con el mismo espacio entre módulos; cada tarea es una fila
   (estado · tarea · cliente · deadline) que se despliega para ver
   especificaciones y link. Sin scroll horizontal. */
.tareas-wrap { display: flex; flex-direction: column; gap: 16px; }
.tareas-wrap > * { margin: 0; }
.tareas-new {
  display: grid; gap: 8px; margin-top: 6px;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) 150px;
}
.tareas-new .fin-input { width: 100%; min-width: 0; box-sizing: border-box; }
.tareas-new .tareas-specs { grid-column: 1 / -1; }
.tareas-new #tareas-new-drive { grid-column: 1 / 3; }
.tareas-specs { resize: vertical; font-family: var(--font-body); line-height: 1.5; }
.tareas-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.tareas-list { display: flex; flex-direction: column; }
.tareas-row {
  display: grid; align-items: center; gap: 10px;
  grid-template-columns: 104px minmax(0, 1fr) minmax(0, 180px) 150px 30px;
  padding: 10px 4px;
}
.tareas-thead {
  font-size: 11px; font-weight: 600; color: var(--text3);
  text-transform: uppercase; letter-spacing: .5px;
  border-bottom: 1.5px solid var(--border); padding-top: 0;
}
.tareas-item { border-bottom: 1px solid var(--border-subtle); }
.tareas-item:last-child { border-bottom: none; }
.tareas-item.is-done .tareas-row { opacity: .55; }
.tareas-item.is-done .tareas-c-tarea strong { text-decoration: line-through; }
.tareas-item.is-highlight { background: #eef0ff; box-shadow: inset 4px 0 0 var(--brand-blue, #455CFF); transition: background .4s; }
.tareas-row-click { cursor: pointer; border-radius: 8px; }
.tareas-row-click:hover { background: var(--surface); }
.tareas-row .fin-input { width: 100%; min-width: 0; box-sizing: border-box; }
.tareas-c-tarea, .tareas-c-cliente { min-width: 0; overflow-wrap: anywhere; }
.tareas-c-cliente { color: var(--text2); }
.tareas-c-deadline { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; white-space: nowrap; }
.tareas-estado {
  width: 100%; padding: 6px 8px; border-radius: 999px; cursor: pointer;
  font-size: 12px; font-weight: 600; font-family: var(--font-body); white-space: nowrap;
  border: 1px solid var(--border); background: var(--surface-solid); color: var(--text2);
  transition: border-color var(--t), background var(--t);
}
.tareas-estado:hover { border-color: var(--border-hover); }
.tareas-estado.hecho { background: var(--brand-lime); border-color: transparent; color: var(--text1); }
.tareas-chevron {
  width: 28px; height: 28px; border-radius: 8px; border: 1px solid transparent;
  background: none; color: var(--text3); cursor: pointer; font-size: 14px;
  transition: transform var(--t), color var(--t), background var(--t);
}
.tareas-chevron:hover { color: var(--accent); background: var(--accent-soft); }
.tareas-item.open .tareas-chevron { transform: rotate(180deg); color: var(--accent); }
.tareas-detail {
  display: none; flex-direction: column; gap: 12px;
  margin: 0 4px 12px 118px; padding: 14px 16px;
  background: var(--surface-solid); border: 1px solid var(--border-subtle); border-radius: 10px;
}
.tareas-item.open .tareas-detail { display: flex; }
.tareas-field { display: flex; flex-direction: column; gap: 5px; }
.tareas-label {
  font-family: var(--font-display); font-size: 9px; font-weight: 700;
  letter-spacing: 3px; text-transform: uppercase; color: var(--accent-label);
}
.tareas-specs-text { white-space: pre-wrap; font-size: 13px; line-height: 1.55; color: var(--text1); }
.tareas-detail a { color: var(--accent); overflow-wrap: anywhere; font-size: 13px; }
.tareas-detail .fin-input { width: 100%; min-width: 0; box-sizing: border-box; }
.tareas-link-edit { display: flex; gap: 10px; align-items: center; }
.tareas-link-edit a { white-space: nowrap; }

@media (max-width: 720px) {
  .tareas-new { grid-template-columns: 1fr 1fr; }
  .tareas-new .tareas-new-tarea, .tareas-new #tareas-new-drive { grid-column: 1 / -1; }
  .tareas-thead { display: none; }
  .tareas-row { grid-template-columns: 96px minmax(0, 1fr) 30px; row-gap: 6px; }
  .tareas-c-estado { grid-row: 1; grid-column: 1; }
  .tareas-c-tarea { grid-row: 1; grid-column: 2; }
  .tareas-chevron { grid-row: 1; grid-column: 3; }
  .tareas-c-cliente { grid-row: 2; grid-column: 2; font-size: 12px; }
  .tareas-c-deadline { grid-row: 3; grid-column: 2; font-size: 12px; }
  .tareas-detail { margin-left: 4px; }
}

/* ── Pagos del equipo: meses desplegables ──────────────────────────────────
   Cada mes de pago (lo trabajado el mes anterior) se abre y se cierra. */
.pagos-meses { display: flex; flex-direction: column; gap: 16px; }
.pagos-mes { padding: 18px 22px; }
.pagos-mes-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; cursor: pointer; }
.pagos-chevron {
  width: 28px; height: 28px; display: inline-flex; align-items: center; justify-content: center;
  border-radius: 8px; color: var(--text3); font-size: 14px; transform: rotate(-90deg);
  transition: transform var(--t), color var(--t), background var(--t);
}
.pagos-mes-head:hover .pagos-chevron { color: var(--accent); background: var(--accent-soft); }
.pagos-mes.open .pagos-chevron { transform: none; color: var(--accent); }
.pagos-mes-title { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.pagos-mes-title h3 { margin: 0; }
.pagos-mes-sub { font-size: 13px; color: var(--text3); }
.pagos-mes-total { margin-left: auto; font-size: 13px; color: var(--text2); }
.pagos-mes-total strong { color: var(--text1); font-size: 16px; }
.pagos-mes-body { display: none; flex-direction: column; gap: 18px; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border-subtle); }
.pagos-mes.open .pagos-mes-body { display: flex; }
.pagos-table { width: 100%; border-collapse: collapse; font-size: 13px; table-layout: auto; }
.pagos-table th {
  text-align: left; font-size: 11px; font-weight: 600; color: var(--text3);
  text-transform: uppercase; letter-spacing: .5px;
  padding: 0 8px 8px; border-bottom: 1.5px solid var(--border); white-space: nowrap;
}
.pagos-table td { padding: 8px; border-bottom: 1px solid var(--border-subtle); vertical-align: middle; }
.pagos-table tr:last-child td { border-bottom: none; }
.pagos-in { width: 100%; min-width: 0; box-sizing: border-box; }
.pagos-c-cli { width: 22%; }
.pagos-c-monto { width: 130px; white-space: nowrap; }
.pagos-c-estado { width: 110px; white-space: nowrap; }
.pagos-c-del { width: 70px; }

@media (max-width: 720px) {
  .pagos-mes { padding: 16px; }
  .pagos-mes-total { margin-left: 40px; width: 100%; }
  .pagos-table thead { display: none; }
  .pagos-table tr { display: grid; grid-template-columns: 1fr auto; gap: 6px; padding: 8px 0; border-bottom: 1px solid var(--border-subtle); }
  .pagos-table td { width: auto; padding: 0; border: none; }
  .pagos-table td:nth-child(2) { grid-column: 1 / -1; }
}
.pagos-new-row td { background: var(--accent-soft); }
.pagos-new-row td:first-child { border-radius: 8px 0 0 8px; }
.pagos-new-row td:last-child { border-radius: 0 8px 8px 0; }

/* Finanzas 2.0 · Tablero: Facturación y Ganancia con cobrado / sin cobrar */
.f2-top-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.f2-card-split { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 8px; font-size: 12px; }
.f2-card-split strong { font-weight: 700; }
@media (max-width: 720px) { .f2-top-cards { grid-template-columns: 1fr; } }

/* Growth MKT · análisis de mejora escrito por Claude */
.gm-ia-body { font-size: 13.5px; line-height: 1.55; color: var(--text1); }
.gm-ia-body h5 { margin: 10px 0 4px; font: 700 10px var(--font-display); letter-spacing: 2px; text-transform: uppercase; color: var(--accent-label); }
.gm-ia-body h5:first-child { margin-top: 0; }
.gm-ia-body ul { margin: 0; padding-left: 18px; }
.gm-ia-body li { margin: 3px 0; }
.gm-ia-body li::marker { color: var(--accent); }
.gm-ia-body p { margin: 4px 0; }
.gm-ia-empty { color: var(--text3); }
.gm-ia-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 10px; font-size: 11.5px; color: var(--text3); }
.gm-ia-notas { margin-top: 12px; border-top: 1px solid var(--border-subtle); padding-top: 10px; }
.gm-ia-notas > summary { cursor: pointer; font-size: 12px; color: var(--text2); margin-bottom: 8px; }
.tareas-filtros { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 12px; }
.tareas-filtros label { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; color: var(--text3); }
.tareas-filtros select { min-width: 140px; }

/* ── Growth Marketing (Business Design) ─────────────────────────────────── */
.gmk-shell{display:flex;flex-direction:column;gap:14px;padding-top:6px}
.gmk-card{background:#fff;border:1px solid var(--border-subtle);border-radius:16px;padding:16px;display:flex;flex-direction:column;gap:10px;min-width:0}
.gmk-card h3{margin:0;font-size:16px}
.gmk-card-head{display:flex;align-items:center;justify-content:space-between;gap:10px;flex-wrap:wrap}
.gmk-hero{display:flex;align-items:flex-end;justify-content:space-between;gap:12px;flex-wrap:wrap}
.gmk-hero h2{margin:2px 0;font-size:clamp(22px,2.4vw,30px);line-height:1.1}
.gmk-hero p{margin:0}
.gmk-hero-actions{display:flex;gap:8px;align-items:center}
.gmk-muted{color:var(--text3);font-size:12.5px;margin:0;display:block}
.gmk-note{margin-bottom:-4px}
.gmk-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(230px,1fr));gap:12px}
.gmk-client{text-align:left;cursor:pointer;font:inherit}
.gmk-client:hover{border-color:var(--brand-blue)}
.gmk-row{display:flex;gap:8px;align-items:center;flex-wrap:wrap}
.gmk-row label{font-size:13px;font-weight:600}
.gmk-between{justify-content:space-between}
.gmk-row input,.gmk-row select,.gmk-card textarea,.gmk-field input,.gmk-field select,.gmk-field textarea,.gmk-score-row select{border:1.5px solid var(--border);border-radius:10px;background:#fafaf6;padding:8px 10px;font:500 13px var(--font-body);color:#141410;min-width:0}
.gmk-card textarea,.gmk-field textarea{width:100%;resize:vertical;line-height:1.45}
.gmk-row input{flex:1 1 160px}
.gmk-link{border:0;background:transparent;color:var(--brand-blue);font:700 12.5px var(--font-body);cursor:pointer;padding:2px 0;text-align:left}
.gmk-link:hover{text-decoration:underline}
.gmk-danger{color:#c23b1c;align-self:flex-start}
.gmk-add{align-self:flex-start;margin-bottom:6px}
.gmk-x{border:0;background:transparent;color:#8a8a80;font-size:16px;cursor:pointer;padding:0 4px;line-height:1}
.gmk-chips{display:flex;flex-wrap:wrap;gap:5px;margin:3px 0}
.gmk-chip{display:inline-flex;align-items:center;border-radius:999px;padding:3px 9px;font:800 10.5px var(--font-body);background:#eeede4;color:#55554c;white-space:nowrap}
.gmk-chip.is-ok{background:#e6f5df;color:#2e7d32}
.gmk-chip.is-area{background:#eef0ff;color:#3442b3}
.gmk-chip.is-detect{background:#fff1d6;color:#9a6300}
.gmk-chip.is-prob{background:#fde3dc;color:#c23b1c}
.gmk-chip.is-op{background:#e6f5df;color:#2e7d32}
.gmk-chip.is-imp-alto{background:#141410;color:#fff}
.gmk-chip.is-deriv{background:#f3e8ff;color:#6b3fa0}
.gmk-chip.is-mini{background:var(--brand-lime);color:#141410}
.gmk-chip.is-forced{background:#fff1d6;color:#9a6300}
.gmk-chip.is-ini-activa{background:#e6f5df;color:#2e7d32}
.gmk-chip.is-ini-en_desarrollo{background:#eef0ff;color:#3442b3}
.gmk-sem{display:inline-flex;align-items:center;gap:6px;border-radius:999px;padding:3px 10px 3px 7px;background:#f4f3ec;font:800 11px var(--font-body);color:#141410;white-space:nowrap}
.gmk-sem i{width:10px;height:10px;border-radius:50%;background:var(--c)}
.gmk-bell{position:relative;border:1px solid var(--border-subtle);background:#fff;border-radius:999px;width:42px;height:42px;font-size:18px;cursor:pointer}
.gmk-bell b{position:absolute;top:-4px;right:-4px;min-width:18px;height:18px;border-radius:9px;background:#d64532;color:#fff;font:800 10px/18px var(--font-body);padding:0 4px}
.gmk-notifs{gap:6px}
.gmk-notif{display:flex;flex-direction:column;gap:2px;text-align:left;border:1px solid var(--border-subtle);border-radius:11px;background:#fafaf6;padding:9px 11px;cursor:pointer;font:inherit}
.gmk-notif.is-new{background:#eef0ff;border-color:#d6dbff}
.gmk-notif strong{font-size:13px}
.gmk-notif small{color:#55554c;font-size:12px}
.gmk-notif em{color:var(--text3);font-size:11px;font-style:normal}
.gmk-progress{gap:14px;padding-bottom:30px}
.gmk-progress-top{display:flex;justify-content:space-between;align-items:center;gap:10px;flex-wrap:wrap}
.gmk-progress-top strong{font:900 18px var(--font-body)}
.gmk-stage{background:var(--brand-blue);color:#fff;border-radius:999px;padding:6px 12px;font:800 12px var(--font-body)}
.gmk-bar{position:relative;height:12px;border-radius:999px;background:#eeede4;margin:0 6px}
.gmk-bar-fill{height:100%;border-radius:999px;background:linear-gradient(90deg,var(--brand-blue),#7b8bff)}
.gmk-mark{position:absolute;top:-4px;transform:translateX(-50%);display:flex;flex-direction:column;align-items:center}
.gmk-mark i{width:3px;height:20px;border-radius:2px;background:#c9c9bf}
.gmk-mark.is-done i{background:#141410}
.gmk-mark small{font:800 10px var(--font-body);color:#55554c;white-space:nowrap;margin-top:2px}
.gmk-mark:last-child small{transform:translateX(-30%)}
.gmk-tabs{display:flex;gap:6px;flex-wrap:wrap}
.gmk-stage-group{background:#fff;border:1px solid var(--border-subtle);border-radius:16px;padding:12px 14px 4px;margin-bottom:12px}
.gmk-stage-title{margin:0 0 8px;font:900 11px var(--font-body);letter-spacing:.08em;text-transform:uppercase;color:var(--brand-blue)}
.gmk-step{position:relative;border-left:2px solid #e3e2da;margin-left:14px;padding-left:22px}
.gmk-step:last-child{border-left-color:transparent}
.gmk-step.is-completo{border-left-color:var(--brand-lime)}
.gmk-step-head{display:flex;align-items:center;gap:10px;width:100%;background:transparent;border:0;padding:8px 0;cursor:pointer;font:inherit;text-align:left}
.gmk-step-dot{position:absolute;left:-15px;width:28px;height:28px;border-radius:50%;display:grid;place-items:center;font:900 12px var(--font-body);background:#fff;border:2px solid #c9c9bf;color:#8a8a80}
.gmk-step.is-completo .gmk-step-dot{background:var(--brand-lime);border-color:var(--brand-lime);color:#141410}
.gmk-step.is-en_curso .gmk-step-dot{background:var(--brand-blue);border-color:var(--brand-blue);color:#fff;box-shadow:0 0 0 4px #e3e7ff}
.gmk-step-title{flex:1;font:800 14px var(--font-body);color:#141410;display:flex;gap:6px;align-items:center;flex-wrap:wrap}
.gmk-step.is-pendiente .gmk-step-title{color:#8a8a80}
.gmk-step-state{font:800 11px var(--font-body);color:#8a8a80;white-space:nowrap}
.gmk-step.is-en_curso .gmk-step-state{color:var(--brand-blue)}
.gmk-step-body{padding:4px 0 14px;display:flex;flex-direction:column;gap:8px}
.gmk-step-foot{display:flex;justify-content:flex-end}
.gmk-locked{margin:0;background:#f4f3ec;border-radius:10px;padding:8px 10px;font-size:12.5px;color:#55554c}
.gmk-form-slot{display:flex;align-items:center;gap:10px;flex-wrap:wrap;border:1.5px dashed #c9c9bf;border-radius:12px;padding:12px;background:#fafaf6}
.gmk-form-slot>div{flex:1;min-width:180px}
.gmk-scores{display:flex;flex-direction:column;gap:6px}
.gmk-score-row{display:grid;grid-template-columns:minmax(0,1fr) 70px 120px;gap:10px;align-items:center;border:1px solid var(--border-subtle);border-radius:11px;padding:8px 10px}
.gmk-score-row.is-detect{background:#fffaf0}
.gmk-score-row small{display:block}
.gmk-score-val{font:900 16px var(--font-body);text-align:center}
.gmk-score-bar{height:8px;border-radius:999px;background:#eeede4;overflow:hidden}
.gmk-score-bar i{display:block;height:100%;background:var(--brand-blue)}
.gmk-group{display:flex;flex-direction:column;gap:6px;margin-top:4px}
.gmk-group-title{margin:6px 0 0;font:900 11px var(--font-body);letter-spacing:.06em;text-transform:uppercase;color:#55554c;display:flex;gap:6px;align-items:center}
.gmk-item{display:flex;gap:10px;align-items:flex-start;border:1px solid var(--border-subtle);border-radius:12px;padding:10px 12px;background:#fafaf6;min-width:0}
.gmk-item.is-off{opacity:.6}
.gmk-item-main{flex:1;min-width:0;display:flex;flex-direction:column;gap:2px}
.gmk-item-main strong{font-size:13.5px;overflow-wrap:anywhere}
.gmk-item-actions{display:flex;flex-direction:column;gap:4px;align-items:flex-end;flex:0 0 auto}
.gmk-a{font:700 12px var(--font-body);color:var(--brand-blue)}
.gmk-prio{margin-top:3px;width:18px;height:18px;accent-color:var(--brand-blue)}
.gmk-prio-row{display:flex;gap:8px;align-items:center}
.gmk-prio-row .gmk-item{flex:1}
.gmk-prio-n{font:900 16px var(--font-body);width:20px;text-align:center}
.gmk-order{display:flex;flex-direction:column;gap:2px}
.gmk-order button{border:1px solid var(--border-subtle);background:#fff;border-radius:6px;width:26px;height:22px;cursor:pointer}
.gmk-order button:disabled{opacity:.35;cursor:default}
.gmk-ind{display:flex;justify-content:space-between;gap:10px;align-items:center;flex-wrap:wrap;border:1px solid var(--border-subtle);border-radius:11px;padding:8px 10px;background:#fff}
.gmk-ind>div:first-child{flex:1;min-width:180px}
.gmk-ind-right{display:flex;gap:8px;align-items:center;flex-wrap:wrap}
.gmk-phases{display:grid;grid-template-columns:1fr auto 1fr;gap:8px;align-items:stretch}
.gmk-phase{border:1px solid var(--border-subtle);border-radius:12px;padding:10px 12px;display:flex;flex-direction:column;gap:3px;background:#fafaf6}
.gmk-phase.is-now{border-color:var(--brand-blue);background:#eef0ff}
.gmk-phase.is-done{background:#f1f8ec;border-color:#cfe6c2}
.gmk-milestone{border-style:dashed;min-width:150px}
.gmk-phase small{color:var(--text3);font-size:12px}
.gmk-md{font-size:13.5px;line-height:1.5;color:#141410;overflow-wrap:anywhere}
.gmk-md p{margin:0 0 6px}.gmk-md h1,.gmk-md h2,.gmk-md h3{font-size:15px;margin:8px 0 4px}.gmk-md ul{margin:0 0 6px;padding-left:18px}
.gmk-links{display:flex;flex-wrap:wrap;gap:8px}
.gmk-links a{font:700 12.5px var(--font-body);color:var(--brand-blue);background:#eef0ff;border-radius:999px;padding:5px 11px;text-decoration:none}
.gmk-obj-head{display:flex;justify-content:space-between;gap:12px;flex-wrap:wrap}
.gmk-obj-head h3{font-size:17px}
.gmk-obj-kpis{display:flex;gap:16px;align-items:center;flex-wrap:wrap}
.gmk-obj-kpis>div{display:flex;flex-direction:column;align-items:flex-start;gap:2px}
.gmk-obj-kpis small{font:800 10px var(--font-body);text-transform:uppercase;color:var(--text3)}
.gmk-obj-kpis b{font:900 20px var(--font-body)}
.gmk-obj-grid{display:grid;grid-template-columns:minmax(0,1.6fr) minmax(0,1fr);gap:14px}
.gmk-chart-box{display:flex;flex-direction:column;gap:6px;margin-bottom:10px}
.gmk-chart{position:relative;height:190px}
.gmk-mini{border-bottom:1px solid var(--border-subtle);padding:6px 0;font-size:13px;display:flex;flex-wrap:wrap;gap:6px;align-items:center}
.gmk-mini small{flex-basis:100%}
.gmk-obj-foot{display:flex;gap:8px;flex-wrap:wrap;justify-content:flex-end;border-top:1px solid var(--border-subtle);padding-top:10px}
.gmk-meeting-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}
.gmk-check{display:flex;gap:9px;align-items:flex-start;padding:6px 0;border-bottom:1px solid var(--border-subtle);font-size:13px;cursor:pointer}
.gmk-check input{margin-top:2px;width:17px;height:17px;accent-color:var(--brand-blue);flex:0 0 auto}
.gmk-check span{flex:1;display:flex;flex-direction:column;gap:2px}
.gmk-check small{color:#2e7d32;font-size:11px;font-weight:700}
.gmk-check.is-done span{color:#8a8a80}
.gmk-adjust{border:2px dashed #e0c07a;background:#fffdf6}
.gmk-report-card{gap:8px}
.gmk-table{display:flex;flex-direction:column}
.gmk-table>div{display:flex;justify-content:space-between;gap:10px;padding:6px 0;border-bottom:1px solid var(--border-subtle);font-size:13px}
.gmk-table em{font-style:normal;font-weight:900;margin-left:6px}
.gmk-table em.is-up{color:#2e7d32}.gmk-table em.is-down{color:#c23b1c}
.gmk-checks{display:flex;flex-direction:column;gap:5px;max-height:190px;overflow:auto;border:1px solid var(--border-subtle);border-radius:10px;padding:8px}
.gmk-checks label,.gmk-inline{display:flex;gap:7px;align-items:flex-start;font-size:13px;font-weight:500}
.gmk-modal-backdrop{position:fixed;inset:0;background:rgba(20,20,16,.45);display:flex;align-items:center;justify-content:center;z-index:1200;padding:16px}
.gmk-modal{background:#fff;border-radius:18px;width:min(560px,100%);max-height:calc(100vh - 32px);display:flex;flex-direction:column}
.gmk-modal-head{display:flex;justify-content:space-between;align-items:center;padding:16px 18px 8px}
.gmk-modal-head h3{margin:0;font-size:17px}
.gmk-modal-body{padding:6px 18px;overflow:auto;display:flex;flex-direction:column;gap:12px}
.gmk-field{display:flex;flex-direction:column;gap:5px}
.gmk-field>label{font:800 12px var(--font-body);color:#55554c}
.gmk-modal-foot{display:flex;justify-content:space-between;align-items:center;gap:8px;padding:12px 18px 16px;border-top:1px solid var(--border-subtle);margin-top:8px}
.gmk-modal-foot>div{display:flex;gap:8px}
.gmk-btn-danger{border:0;background:transparent;color:#c23b1c;font:800 13px var(--font-body);cursor:pointer}
@media(max-width:820px){
  .gmk-obj-grid,.gmk-meeting-grid{grid-template-columns:1fr}
  .gmk-phases{grid-template-columns:1fr}
  .gmk-score-row{grid-template-columns:minmax(0,1fr) 64px}
  .gmk-score-row .gmk-score-bar{grid-column:1/-1}
  .gmk-item{flex-direction:column}
  .gmk-item-actions{flex-direction:row;align-items:center}
  .gmk-mark small{font-size:9px}
  .gmk-tabs{overflow-x:auto;flex-wrap:nowrap;padding-bottom:4px}
  .gmk-tabs .agenda-view-btn{flex:0 0 auto}
}
