/* ============================================================
   SalesAId — Design System
   Dark theme, violet brand, B2B SaaS aesthetics
   ============================================================ */

@import url("https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600&display=swap");

/* ---------- Tokens ---------- */
:root {
  /* Surfaces */
  --bg-base: #0a0a14;
  --bg-surface: #14141f;
  --bg-surface-2: #1a1a28;
  --bg-elevated: #20202f;
  --bg-input: #0f0f1a;

  /* Borders */
  --border-subtle: rgba(255, 255, 255, 0.06);
  --border-default: rgba(255, 255, 255, 0.1);
  --border-strong: rgba(255, 255, 255, 0.16);

  /* Text */
  --text-primary: #f4f5f9;
  --text-secondary: #aab0c0;
  --text-tertiary: #6b7185;
  --text-dim: #4b5063;

  /* Brand */
  --brand-from: #7c5cff;
  --brand-to: #c084fc;
  --brand-solid: #8b5cf6;
  --brand-strong: #a78bfa;
  --brand-soft: rgba(139, 92, 246, 0.14);
  --brand-soft-hover: rgba(139, 92, 246, 0.22);
  --brand-border: rgba(139, 92, 246, 0.35);
  --brand-gradient: linear-gradient(135deg, #7c5cff 0%, #c084fc 100%);

  /* Semantic */
  --success: #34d399;
  --success-soft: rgba(52, 211, 153, 0.12);
  --success-border: rgba(52, 211, 153, 0.3);
  --warning: #fbbf24;
  --warning-soft: rgba(251, 191, 36, 0.12);
  --warning-border: rgba(251, 191, 36, 0.3);
  --danger: #f87171;
  --danger-soft: rgba(248, 113, 113, 0.12);
  --danger-border: rgba(248, 113, 113, 0.3);
  --info: #60a5fa;
  --info-soft: rgba(96, 165, 250, 0.12);
  --pink: #f472b6;
  --pink-soft: rgba(244, 114, 182, 0.14);
  --pink-border: rgba(244, 114, 182, 0.32);

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 6px 24px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 0 1px var(--brand-border), 0 10px 40px rgba(124, 92, 255, 0.18);

  /* Radii */
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 20px;
  --r-full: 999px;

  /* Spacing scale (used inline) */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 20px;
  --sp-6: 24px;
  --sp-8: 32px;

  /* Type */
  --font-body: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
}

/* ---------- Reset / base ---------- */
* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--bg-base);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "cv11";
}

body {
  min-height: 100vh;
  /* Subtle atmospheric gradient — gives depth without being noisy */
  background:
    radial-gradient(1100px 600px at 12% -10%, rgba(124, 92, 255, 0.08), transparent 60%),
    radial-gradient(900px 500px at 100% 110%, rgba(192, 132, 252, 0.05), transparent 60%),
    var(--bg-base);
  background-attachment: fixed;
}

a {
  color: inherit;
  text-decoration: none;
}

h1, h2, h3, h4, p {
  margin: 0;
}

button {
  font-family: inherit;
  cursor: pointer;
}

input,
select,
textarea {
  font-family: inherit;
  color: inherit;
}

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.18);
}

.muted { color: var(--text-secondary); }
.dim   { color: var(--text-tertiary); }

/* ============================================================
   LOGIN PAGE
   ============================================================ */
.auth-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px;
  position: relative;
  overflow: hidden;
}

.auth-bg-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.35;
  pointer-events: none;
}
.auth-bg-orb.one {
  width: 480px; height: 480px;
  top: -120px; left: -80px;
  background: radial-gradient(circle, #7c5cff 0%, transparent 70%);
}
.auth-bg-orb.two {
  width: 520px; height: 520px;
  bottom: -180px; right: -120px;
  background: radial-gradient(circle, #c084fc 0%, transparent 70%);
}

.auth-card {
  position: relative;
  width: 100%;
  max-width: 440px;
  background: linear-gradient(180deg, rgba(28,28,44,0.85), rgba(20,20,31,0.95));
  border: 1px solid var(--border-default);
  border-radius: var(--r-xl);
  padding: 36px;
  box-shadow: var(--shadow-lg), inset 0 1px 0 rgba(255,255,255,0.04);
  backdrop-filter: blur(20px);
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}
.auth-brand .brand-name {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.auth-tagline {
  color: var(--text-secondary);
  font-size: 14px;
  margin-bottom: 8px;
}

.form-group { margin-top: 18px; }
.form-group label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: 8px;
}
.form-group input,
.form-group select {
  width: 100%;
  padding: 13px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border-default);
  border-radius: var(--r-md);
  color: var(--text-primary);
  font-size: 14px;
  transition: border-color .15s, box-shadow .15s;
}
.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--brand-border);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.15);
}
.form-group select {
  appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'><path d='M3 4.5L6 7.5L9 4.5' stroke='%23aab0c0' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}

.role-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 8px;
}
.role-option {
  padding: 14px;
  border-radius: var(--r-md);
  border: 1px solid var(--border-default);
  background: var(--bg-input);
  cursor: pointer;
  transition: .15s;
  text-align: left;
}
.role-option:hover {
  border-color: var(--border-strong);
}
.role-option.active {
  border-color: var(--brand-border);
  background: var(--brand-soft);
  box-shadow: inset 0 0 0 1px var(--brand-border);
}
.role-option .role-label {
  font-weight: 700;
  margin-bottom: 4px;
}
.role-option .role-desc {
  font-size: 12px;
  color: var(--text-secondary);
}

.btn {
  border: none;
  border-radius: var(--r-md);
  padding: 13px 16px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: transform .12s, box-shadow .15s, filter .15s, background .15s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.btn-primary {
  width: 100%;
  margin-top: 24px;
  background: var(--brand-gradient);
  color: white;
  box-shadow: 0 10px 30px rgba(124, 92, 255, 0.25);
}
.btn-primary:hover { filter: brightness(1.08); }
.btn-primary:active { transform: translateY(1px); }

.btn-ghost {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border-default);
}
.btn-ghost:hover { background: var(--bg-elevated); }

.btn-soft {
  background: var(--brand-soft);
  color: var(--brand-strong);
  border: 1px solid var(--brand-border);
}
.btn-soft:hover { background: var(--brand-soft-hover); }

.login-note {
  margin-top: 22px;
  font-size: 13px;
  color: var(--text-tertiary);
  text-align: center;
}
.login-note strong { color: var(--text-secondary); }

/* ============================================================
   APP SHELL (sidebar + content)
   ============================================================ */
.app-shell {
  display: grid;
  grid-template-columns: 264px 1fr;
  min-height: 100vh;
}

/* ---------- Sidebar ---------- */
.sidebar {
  background: rgba(20, 20, 31, 0.6);
  border-right: 1px solid var(--border-subtle);
  padding: 22px 16px 20px;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  backdrop-filter: blur(12px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 6px 0;
  margin-bottom: 4px;
}
.brand-mark {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  object-fit: contain;
  filter: drop-shadow(0 4px 14px rgba(124, 92, 255, 0.35));
}
.auth-brand .brand-mark { width: 48px; height: 48px; }
.brand-name {
  font-weight: 800;
  font-size: 18px;
  letter-spacing: -0.02em;
}
.brand-name em {
  font-style: normal;
  background: var(--brand-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.sidebar-subtitle {
  color: var(--text-tertiary);
  font-size: 12px;
  padding-left: 6px;
  margin-bottom: 22px;
  margin-top: 2px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}
.nav-group-label {
  padding: 14px 10px 8px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-tertiary);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: var(--r-md);
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  transition: background .15s, color .15s;
  cursor: pointer;
}
.nav-link:hover {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-primary);
}
.nav-link svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  opacity: 0.85;
}
.nav-link.active {
  background: var(--brand-soft);
  color: var(--brand-strong);
  box-shadow: inset 0 0 0 1px var(--brand-border);
}
.nav-link.active svg { opacity: 1; }
.nav-link.logout {
  color: var(--text-tertiary);
  margin-top: auto;
}
.nav-link.logout:hover {
  background: var(--danger-soft);
  color: var(--danger);
}

.user-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  margin-top: 14px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-md);
}
.user-card .avatar {
  width: 34px; height: 34px;
  flex-shrink: 0;
}
.user-card .user-info {
  flex: 1;
  min-width: 0;
}
.user-card .user-name {
  font-weight: 600;
  font-size: 13px;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.user-card .user-role {
  font-size: 11px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* ---------- Main content ---------- */
.main-content {
  padding: 22px 32px 40px;
  max-width: 1400px;
}

/* ---------- Topbar (URL pill + actions) ---------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}
.url-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-full);
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-secondary);
}
.url-pill svg { width: 12px; height: 12px; opacity: 0.7; }
.url-pill .url-path { color: var(--text-primary); }
.url-pill .url-sep { color: var(--text-dim); margin: 0 2px; }

.topbar-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}
.topbar-search {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-md);
  color: var(--text-tertiary);
  font-size: 13px;
  min-width: 220px;
  position: relative;   /* needed for dropdown positioning */
  cursor: text;
  transition: border-color .15s;
}
.topbar-search:focus-within {
  border-color: var(--border-default);
}
.topbar-search svg { width: 14px; height: 14px; flex-shrink: 0; }

/* Live search input */
.gs-input {
  border: none;
  background: transparent;
  color: var(--text-primary);
  font-size: 13px;
  font-family: var(--font-body);
  outline: none;
  flex: 1;
  min-width: 0;
  padding: 0;
}
.gs-input::placeholder { color: var(--text-tertiary); }

/* Dropdown */
.gs-dropdown {
  position: fixed;
  top: 60px;          /* debajo del topbar — ajustá si cambia la altura del header */
  right: 16px;        /* margen del borde derecho del viewport */
  width: min(400px, calc(100vw - 32px));   /* ancho controlado, nunca desborda */
  max-height: 70vh;
  overflow-y: auto;
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-lg);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.55);
  z-index: 200;
}

.gs-group-label {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-dim);
  padding: 10px 14px 4px;
}

.gs-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  cursor: pointer;
  transition: background .12s;
}
.gs-item:hover { background: var(--bg-surface-2); }
.gs-item:last-child { border-radius: 0 0 var(--r-lg) var(--r-lg); }

.gs-item-icon {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  display: grid;
  place-items: center;
  flex-shrink: 0;
  color: var(--text-tertiary);
}
.gs-item-icon svg { width: 13px; height: 13px; }

.gs-item-info {
  flex: 1;
  min-width: 0;
}
.gs-item-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.gs-item-sub {
  font-size: 11px;
  color: var(--text-tertiary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 1px;
}

.gs-empty {
  padding: 18px 14px;
  text-align: center;
  color: var(--text-tertiary);
  font-size: 13px;
}
.kbd {
  font-family: var(--font-mono);
  font-size: 10px;
  padding: 2px 5px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  color: var(--text-tertiary);
  margin-left: auto;
}

/* ---------- Page header ---------- */
.page-header {
  margin-bottom: 24px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.page-header h1 {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.page-header .subtitle {
  color: var(--text-secondary);
  margin-top: 4px;
  font-size: 14px;
}
/* Link contextual discreto (rep / deal en subtítulo de reuniones) */
.ctx-link {
  color: var(--text-secondary);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  cursor: pointer;
  transition: color .15s, border-color .15s;
}
.ctx-link:hover { color: var(--brand-strong); border-bottom-color: var(--brand-border); }
.ctx-link:focus-visible,
.breadcrumb a:focus-visible {
  outline: 2px solid var(--brand-border);
  outline-offset: 2px;
  border-radius: 3px;
}
.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-tertiary);
  margin-bottom: 10px;
}
.breadcrumb a {
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: color .15s;
}
.breadcrumb a:hover { color: var(--brand-strong); }
.breadcrumb .crumb-sep { opacity: 0.6; }
.breadcrumb .crumb-current { color: var(--text-primary); }
.breadcrumb svg { width: 12px; height: 12px; }

/* ============================================================
   KPI CARDS
   ============================================================ */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 22px;
}
.kpi-card {
  position: relative;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-lg);
  padding: 18px;
  overflow: hidden;
  transition: transform .15s, border-color .15s;
}
.kpi-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.08), transparent);
}
/* Solo la KPI card con chip IA: permite que el popover escape del recorte de la card,
   flotando sobre las cards vecinas. No afecta a las demás KPI cards. */
.kpi-card--has-popover {
  overflow: visible;
  z-index: 5;
}
/* Card con delta IA: monto + ajuste comparten una línea y el mismo tamaño.
   Se ajusta a 23px (en vez de 28px) para que ambos entren en el ancho de la card.
   Selector con especificidad alta para ganarle a ".kpi-card .kpi-value". */
.kpi-card.kpi-card--has-popover .kpi-value { font-size: 23px; }
.kpi-card:hover { border-color: var(--border-default); }
.kpi-card .kpi-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.kpi-card .kpi-label {
  font-size: 12px;
  color: var(--text-secondary);
  letter-spacing: 0.02em;
}
.kpi-card .kpi-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--brand-soft);
  display: grid;
  place-items: center;
  color: var(--brand-strong);
}
.kpi-card .kpi-icon svg { width: 14px; height: 14px; }
.kpi-card .kpi-value {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;             /* en mobile la anotación cae limpio a la línea siguiente */
}
.kpi-value-main { display: inline-flex; align-items: baseline; }
.kpi-card .kpi-sub {
  margin-top: 8px;
  font-size: 12px;
  color: var(--text-tertiary);
  display: flex;
  align-items: center;
  gap: 4px;
}
.kpi-card .kpi-sub.up { color: var(--success); }
.kpi-card .kpi-sub.down { color: var(--danger); }
.kpi-card .kpi-sub svg { width: 12px; height: 12px; }

/* ============================================================
   SECTION CARDS
   ============================================================ */
.content-grid.two-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 22px;
}
.content-grid.three-cols {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
}

.card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-lg);
  padding: 20px;
  margin-bottom: 22px;
}
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}
.card-header h2 {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.005em;
}
.card-header .card-action {
  font-size: 12px;
  color: var(--brand-strong);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  transition: color .15s;
}
.card-header .card-action:hover { color: var(--text-primary); }
.card-header .card-action svg { width: 12px; height: 12px; }

.stack { display: flex; flex-direction: column; gap: 10px; }

/* ============================================================
   INFO / ALERT / INSIGHT BOXES
   ============================================================ */
.info-box {
  padding: 12px 14px;
  background: var(--bg-surface-2);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-md);
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.55;
}
.info-box strong { color: var(--text-primary); font-weight: 600; }

.alert-box {
  padding: 12px 14px 12px 14px;
  background: var(--warning-soft);
  border: 1px solid var(--warning-border);
  border-radius: var(--r-md);
  font-size: 13px;
  color: var(--warning);
  line-height: 1.55;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.alert-box.danger {
  background: var(--danger-soft);
  border-color: var(--danger-border);
  color: var(--danger);
}
.alert-box svg {
  width: 16px; height: 16px;
  flex-shrink: 0;
  margin-top: 1px;
}

.insight-box {
  padding: 14px;
  background: var(--bg-surface-2);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-md);
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.insight-box .insight-icon {
  width: 32px; height: 32px;
  border-radius: 8px;
  background: var(--brand-soft);
  color: var(--brand-strong);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.insight-box .insight-icon svg { width: 16px; height: 16px; }
.insight-box .insight-content { flex: 1; }
.insight-box .insight-title {
  font-weight: 700;
  font-size: 13px;
  margin-bottom: 4px;
  color: var(--text-primary);
}
.insight-box .insight-detail {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.55;
}

/* ============================================================
   ENTITY CARDS (Deals / Reps)
   ============================================================ */
.entity-card {
  background: var(--bg-surface-2);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-md);
  padding: 14px;
  cursor: pointer;
  transition: border-color .15s, transform .15s, background .15s;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.entity-card:hover {
  border-color: var(--brand-border);
  background: var(--bg-elevated);
  transform: translateY(-1px);
}
.entity-card .entity-top {
  display: flex;
  align-items: center;
  gap: 12px;
}
.entity-card .entity-name {
  font-weight: 700;
  font-size: 14px;
  color: var(--text-primary);
}
.entity-card .entity-sub {
  font-size: 12px;
  color: var(--text-tertiary);
  margin-top: 2px;
}
.entity-card .entity-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 12px;
  color: var(--text-secondary);
  flex-wrap: wrap;
}
.entity-card .entity-cta {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--brand-strong);
  font-weight: 600;
  font-size: 12px;
}
.entity-card .entity-cta svg { width: 12px; height: 12px; }

/* ============================================================
   AVATAR
   ============================================================ */
.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 13px;
  color: white;
  flex-shrink: 0;
  font-family: var(--font-body);
  letter-spacing: 0.02em;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.1);
}
.avatar.sm { width: 28px; height: 28px; font-size: 11px; }
.avatar.lg { width: 48px; height: 48px; font-size: 16px; }
.avatar.deal {
  border-radius: 10px;
  background: linear-gradient(135deg, #334155, #1e293b);
  color: var(--brand-strong);
}

/* ============================================================
   MEETING CARDS
   ============================================================ */
.meeting-card {
  background: var(--bg-surface-2);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-md);
  padding: 16px;
  cursor: pointer;
  transition: border-color .15s, transform .15s, background .15s;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.meeting-card:hover {
  border-color: var(--brand-border);
  background: var(--bg-elevated);
  transform: translateY(-1px);
}
.meeting-card .meeting-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}
.meeting-card .meeting-title {
  font-weight: 700;
  font-size: 14px;
  line-height: 1.35;
}
.meeting-card .meeting-subtitle {
  font-size: 12px;
  color: var(--text-tertiary);
  margin-top: 4px;
}
.meeting-card .meeting-summary {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.meeting-card .meeting-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 12px;
}

/* ============================================================
   BADGES / TAGS
   ============================================================ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 9px;
  border-radius: var(--r-full);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  border: 1px solid transparent;
  white-space: nowrap;
}
.badge svg { width: 10px; height: 10px; }
.badge.neutral {
  background: rgba(255,255,255,0.06);
  color: var(--text-secondary);
  border-color: var(--border-subtle);
}
.badge.success {
  background: var(--success-soft);
  color: var(--success);
  border-color: var(--success-border);
}
.badge.warning {
  background: var(--warning-soft);
  color: var(--warning);
  border-color: var(--warning-border);
}
.badge.danger {
  background: var(--danger-soft);
  color: var(--danger);
  border-color: var(--danger-border);
}
.badge.info {
  background: var(--info-soft);
  color: var(--info);
  border-color: rgba(96,165,250,0.32);
}
.badge.pink {
  background: var(--pink-soft);
  color: var(--pink);
  border-color: var(--pink-border);
}
.badge.brand {
  background: var(--brand-soft);
  color: var(--brand-strong);
  border-color: var(--brand-border);
}
.badge .badge-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
}

/* ============================================================
   SCORE CHIP
   ============================================================ */
.score-chip {
  display: inline-flex;
  align-items: baseline;
  gap: 2px;
  padding: 4px 10px;
  border-radius: var(--r-full);
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 13px;
  border: 1px solid transparent;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.score-chip .score-suffix {
  font-size: 10px;
  opacity: 0.6;
  font-weight: 500;
}
/* Escala semántica gradual de scores (4D.2): cada bucket define --sc-* */
.sc-crit  { --sc-color:#f87171; --sc-soft:rgba(248,113,113,0.13); --sc-border:rgba(248,113,113,0.34); }
.sc-warn  { --sc-color:#fb923c; --sc-soft:rgba(251,146,60,0.13);  --sc-border:rgba(251,146,60,0.34); }
.sc-amber { --sc-color:#fbbf24; --sc-soft:rgba(251,191,36,0.13);  --sc-border:rgba(251,191,36,0.34); }
.sc-solid { --sc-color:#84cc16; --sc-soft:rgba(132,204,22,0.13);  --sc-border:rgba(132,204,22,0.34); }
.sc-high  { --sc-color:#34d399; --sc-soft:rgba(52,211,153,0.13);  --sc-border:rgba(52,211,153,0.34); }
.sc-na    { --sc-color:var(--text-tertiary); --sc-soft:rgba(107,113,133,0.12); --sc-border:var(--border-default); }

.score-chip {
  background: var(--sc-soft, var(--bg-surface-2));
  color: var(--sc-color, var(--text-primary));
  border-color: var(--sc-border, transparent);
}

.score-circle {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--bg-elevated);
  border: 2px solid var(--brand-border);
  font-weight: 800;
  font-size: 16px;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}
.score-circle { border-color: var(--sc-border, var(--brand-border)); color: var(--sc-color, var(--text-primary)); }

/* Trend arrows */
.trend {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.trend.up { color: var(--success); }
.trend.down { color: var(--danger); }
.trend.flat { color: var(--text-tertiary); }
.trend svg { width: 11px; height: 11px; }

/* ============================================================
   PLAYBOOK ROWS (progress bars)
   ============================================================ */
.playbook-row {
  display: grid;
  grid-template-columns: 36px 1fr 80px 60px;
  align-items: center;
  gap: 14px;
  padding: 14px;
  background: var(--bg-surface-2);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-md);
}
.playbook-row .crit-icon {
  width: 36px; height: 36px;
  border-radius: 9px;
  background: var(--brand-soft);
  color: var(--brand-strong);
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 14px;
}
.playbook-row .crit-info .crit-title {
  font-weight: 700;
  font-size: 14px;
  margin-bottom: 2px;
}
.playbook-row .crit-info .crit-desc {
  font-size: 12px;
  color: var(--text-secondary);
}
.playbook-row .crit-bar {
  height: 6px;
  background: var(--bg-elevated);
  border-radius: 999px;
  overflow: hidden;
}
.playbook-row .crit-bar-fill {
  height: 100%;
  background: var(--brand-gradient);
  border-radius: 999px;
}
.playbook-row .crit-weight {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 13px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* ============================================================
   TIMELINE (Momentos clave) / TRANSCRIPT
   ============================================================ */
.timeline-item {
  padding: 12px 14px;
  background: var(--bg-surface-2);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-md);
  border-left: 3px solid var(--brand-solid);
}
.timeline-item .ti-top {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}
.timeline-item .ti-time {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  color: var(--brand-strong);
  background: var(--brand-soft);
  padding: 2px 8px;
  border-radius: var(--r-full);
}
.timeline-item .ti-text {
  font-size: 13px;
  color: var(--text-primary);
  line-height: 1.55;
}

.transcript {
  max-height: 480px;
  overflow-y: auto;
  padding-right: 6px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.transcript-line {
  padding: 12px 14px;
  background: var(--bg-surface-2);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-md);
}
.transcript-line .tl-top {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}
.transcript-line .tl-time {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-tertiary);
}
.transcript-line .tl-speaker {
  font-weight: 700;
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.transcript-line .tl-text {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.55;
}

/* ============================================================
   STRENGTHS / IMPROVEMENT items (with icon)
   ============================================================ */
.assess-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--r-md);
  border: 1px solid var(--border-subtle);
  font-size: 13px;
  line-height: 1.55;
}
.assess-item.positive {
  background: var(--success-soft);
  border-color: var(--success-border);
  color: var(--success);
}
.assess-item.negative {
  background: var(--danger-soft);
  border-color: var(--danger-border);
  color: var(--danger);
}
.assess-item .ai-icon {
  width: 18px; height: 18px;
  flex-shrink: 0;
  margin-top: 1px;
}
.assess-item .ai-text { color: var(--text-primary); }

/* ============================================================
   SETTINGS-specific (integrations)
   ============================================================ */
.integration-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px;
  background: var(--bg-surface-2);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-md);
}
.integration-row .int-logo {
  width: 38px; height: 38px;
  border-radius: 9px;
  background: var(--bg-elevated);
  display: grid;
  place-items: center;
}
.integration-row .int-info { flex: 1; }
.integration-row .int-name {
  font-weight: 700;
  font-size: 14px;
}
.integration-row .int-desc {
  font-size: 12px;
  color: var(--text-tertiary);
  margin-top: 2px;
}

.toggle {
  width: 38px;
  height: 22px;
  background: var(--bg-elevated);
  border-radius: 999px;
  position: relative;
  cursor: pointer;
  border: 1px solid var(--border-subtle);
  transition: .15s;
  flex-shrink: 0;
}
.toggle::after {
  content: "";
  position: absolute;
  width: 16px; height: 16px;
  background: var(--text-tertiary);
  border-radius: 50%;
  top: 2px; left: 2px;
  transition: .15s;
}
.toggle.on {
  background: var(--brand-soft);
  border-color: var(--brand-border);
}
.toggle.on::after {
  background: var(--brand-strong);
  left: 18px;
}
.toggle.disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
/* Toggle de solo lectura (sin onclick) → cursor por defecto */
.toggle[role="switch"]:not([onclick]) { cursor: default; }
.integration-row.pv-locked .int-info { opacity: 0.6; }

/* ============================================================
   EMPTY STATES + UTILS
   ============================================================ */
.space-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.flex { display: flex; }
.flex-1 { flex: 1; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.items-center { align-items: center; }
.text-sm { font-size: 13px; }
.text-xs { font-size: 12px; }

/* Subtle animated fade-in for content (helps cards land with rhythm) */
.fade-in {
  animation: fadeIn .35s ease both;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1180px) {
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .content-grid.two-cols { grid-template-columns: 1fr; }
}
@media (max-width: 820px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar {
    position: relative;
    height: auto;
    border-right: none;
    border-bottom: 1px solid var(--border-subtle);
  }
  .nav { flex-direction: row; flex-wrap: wrap; }
  .nav-link.logout { margin-top: 0; margin-left: auto; }
  .user-card { display: none; }
  .main-content { padding: 18px 18px 32px; }
  .kpi-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .topbar-search { display: none; }
  .playbook-row {
    grid-template-columns: 36px 1fr;
    grid-template-areas:
      "icon info"
      "bar  bar"
      "weight weight";
    gap: 10px;
  }
  .playbook-row .crit-icon { grid-area: icon; }
  .playbook-row .crit-info { grid-area: info; }
  .playbook-row .crit-bar { grid-area: bar; }
  .playbook-row .crit-weight { grid-area: weight; text-align: left; }
}

/* ── Mobile: header compacto + nav sticky por tabs (Fase 1) ─────────────────── */
.mobile-topbar, .mobile-nav { display: none; }
.gs-mobile-lock { overflow: hidden; }

@media (max-width: 820px) {
  /* La sidebar grande y el topbar desktop se reemplazan por el header+tabs mobile. */
  .sidebar { display: none !important; }
  .topbar { display: none; }

  .mobile-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin: -2px 0 10px;
  }
  .mobile-brand { display: flex; align-items: center; gap: 8px; min-width: 0; }
  .mobile-topbar .brand-mark { width: 28px; height: 28px; }
  .mobile-topbar .brand-name { font-size: 16px; }
  .mobile-search-btn {
    flex: 0 0 auto;
    display: inline-flex; align-items: center; justify-content: center;
    width: 38px; height: 38px; border-radius: 10px;
    background: var(--bg-surface); border: 1px solid var(--border-default);
    color: var(--text-secondary); cursor: pointer;
  }
  .mobile-search-btn svg { width: 18px; height: 18px; }

  .mobile-nav {
    display: flex;
    gap: 4px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    position: sticky;
    top: 0;
    z-index: 50;
    background: var(--bg-base);
    border-bottom: 1px solid var(--border-subtle);
    padding: 7px 0;
    margin: 0 0 14px;
    white-space: nowrap;
  }
  .mobile-nav::-webkit-scrollbar { display: none; }
  .mnav-tab {
    flex: 0 0 auto;
    display: inline-flex; align-items: center; gap: 6px;
    padding: 7px 12px; border-radius: 8px;
    font-size: 13px; font-weight: 600;
    color: var(--text-tertiary); text-decoration: none;
    white-space: nowrap;
    transition: background .13s, color .13s;
  }
  .mnav-tab svg { width: 15px; height: 15px; flex: 0 0 auto; }
  .mnav-tab.active { background: var(--brand-soft); color: var(--brand-strong); }
  .mnav-tab:focus-visible { outline: 2px solid var(--brand-border); outline-offset: 1px; }
}

/* ── Overlay de búsqueda mobile ────────────────────────────────────────────── */
.gs-mobile-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(8, 8, 14, 0.82);
  backdrop-filter: blur(4px);
  display: flex;
  flex-direction: column;
  padding: 14px;
  gap: 12px;
}
.gs-mobile-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  border-radius: 12px;
  padding: 10px 12px;
}
.gs-mobile-icon { display: inline-flex; color: var(--text-tertiary); }
.gs-mobile-icon svg { width: 18px; height: 18px; }
.gs-mobile-input {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-size: 15px;
}
.gs-mobile-close {
  flex: 0 0 auto;
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: 8px;
  background: transparent; border: none; color: var(--text-secondary); cursor: pointer;
}
.gs-mobile-close svg { width: 18px; height: 18px; }
.gs-mobile-results {
  flex: 1;
  overflow-y: auto;
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  border-radius: 12px;
}
.gs-mobile-results:empty { display: none; }
.gs-mobile-hint { padding: 16px; color: var(--text-tertiary); font-size: 13px; }

/* ============================================================
   PLAYBOOK EDITABLE
   ============================================================ */

.playbook-validation {
  margin-bottom: 16px;
  padding: 12px 14px;
  border-radius: var(--r-md);
  border: 1px solid rgba(248, 113, 113, 0.45);
  background: rgba(127, 29, 29, 0.22);
  color: #fecaca;
  font-size: 13px;
  line-height: 1.45;
}

.playbook-validation.hidden {
  display: none;
}

.danger-text {
  color: #fca5a5 !important;
}

.playbook-row.editing {
  border-color: rgba(168, 85, 247, 0.45);
  background:
    radial-gradient(circle at top right, rgba(168, 85, 247, 0.12), transparent 34%),
    var(--bg-surface-2);
}

.crit-weight-edit {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--text-primary);
}

.crit-weight-edit input {
  width: 72px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  text-align: right;
  outline: none;
}

.crit-weight-edit input:focus {
  border-color: var(--brand-strong);
  box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.18);
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none !important;
  filter: none !important;
}

@media (max-width: 900px) {
  .playbook-row .crit-weight-edit {
    grid-area: weight;
    justify-content: flex-start;
  }

  .crit-weight-edit input {
    text-align: left;
  }
}

/* ============================================================
   PLAYBOOK BUILDER — editable criteria + sliders
   ============================================================ */

.hidden {
  display: none !important;
}

.pb-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.playbook-validation {
  margin-bottom: 16px;
  padding: 12px 14px;
  border-radius: var(--r-md);
  border: 1px solid var(--danger-border);
  background:
    radial-gradient(circle at top left, rgba(248, 113, 113, 0.18), transparent 42%),
    rgba(127, 29, 29, 0.2);
  color: #fecaca;
  font-size: 13px;
  line-height: 1.45;
}

.playbook-validation strong {
  display: block;
  margin-bottom: 4px;
}

.playbook-validation span {
  display: block;
}

.danger-text {
  color: #fca5a5 !important;
}

.pb-config-note {
  margin-bottom: 16px;
  padding: 12px 14px;
  border-radius: var(--r-md);
  border: 1px solid var(--brand-border);
  background: var(--brand-soft);
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.45;
}

.playbook-row.pb-editing {
  grid-template-columns: 36px minmax(260px, 1fr) minmax(260px, 360px) 42px;
  align-items: start;
  border-color: rgba(168, 85, 247, 0.42);
  background:
    radial-gradient(circle at top right, rgba(168, 85, 247, 0.13), transparent 34%),
    var(--bg-surface-2);
}

.pb-edit-fields {
  display: grid;
  gap: 10px;
}

.pb-edit-fields label,
.pb-weight-editor label {
  display: grid;
  gap: 6px;
}

.pb-edit-fields span,
.pb-weight-editor span {
  color: var(--text-tertiary);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.pb-edit-fields input,
.pb-edit-fields textarea,
.pb-weight-number {
  width: 100%;
  border: 1px solid var(--border-default);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 13px;
  outline: none;
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

.pb-edit-fields input {
  padding: 10px 11px;
  font-weight: 700;
}

.pb-edit-fields textarea {
  padding: 10px 11px;
  resize: vertical;
  min-height: 48px;
  line-height: 1.4;
}

.pb-edit-fields input:focus,
.pb-edit-fields textarea:focus,
.pb-weight-number:focus {
  border-color: var(--brand-strong);
  box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.16);
  background: rgba(255, 255, 255, 0.06);
}

.pb-weight-editor {
  display: grid;
  gap: 10px;
}

.pb-weight-top {
  display: grid;
  grid-template-columns: 78px 18px 1fr;
  align-items: center;
  gap: 6px;
}

.pb-weight-number {
  padding: 9px 10px;
  font-family: var(--font-mono);
  font-weight: 800;
  text-align: right;
}

.pb-weight-preview {
  justify-self: end;
  color: var(--text-primary) !important;
  font-family: var(--font-mono);
  font-size: 13px !important;
  font-weight: 800 !important;
}

.pb-slider-row {
  display: grid;
}

.pb-weight-range {
  width: 100%;
  accent-color: var(--brand-solid);
  cursor: pointer;
}

.pb-weight-range::-webkit-slider-runnable-track {
  height: 6px;
  border-radius: 999px;
  background: var(--bg-elevated);
}

.pb-weight-range::-webkit-slider-thumb {
  width: 16px;
  height: 16px;
  margin-top: -5px;
  border-radius: 999px;
  background: var(--brand-gradient);
  border: 2px solid rgba(255,255,255,0.85);
  box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.16);
}

.pb-remove-btn {
  width: 36px;
  height: 36px;
  border: 1px solid var(--danger-border);
  border-radius: 10px;
  background: var(--danger-soft);
  color: var(--danger);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: transform .18s ease, background .18s ease, border-color .18s ease;
}

.pb-remove-btn:hover {
  transform: translateY(-1px);
  background: rgba(248, 113, 113, 0.18);
  border-color: rgba(248, 113, 113, 0.45);
}

.pb-remove-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.pb-add-criterion {
  width: 100%;
  margin-top: 14px;
  padding: 14px 16px;
  border: 1px dashed var(--brand-border);
  border-radius: var(--r-md);
  background: rgba(139, 92, 246, 0.08);
  color: var(--brand-strong);
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  transition: background .18s ease, border-color .18s ease, transform .18s ease;
}

.pb-add-criterion:hover {
  transform: translateY(-1px);
  background: rgba(139, 92, 246, 0.14);
  border-color: var(--brand-strong);
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none !important;
  filter: none !important;
}

@media (max-width: 1050px) {
  .playbook-row.pb-editing {
    grid-template-columns: 36px 1fr;
  }

  .playbook-row.pb-editing .pb-weight-editor,
  .playbook-row.pb-editing .pb-remove-btn {
    grid-column: 2;
  }

  .pb-remove-btn {
    justify-self: start;
  }
}

/* ============================================================
   SETTINGS — integrations workspace
   ============================================================ */

.section-subtitle {
  margin-top: 4px;
  color: var(--text-tertiary);
  font-size: 12px;
}

.integration-category-stack {
  display: grid;
  gap: 18px;
}

.integration-category {
  padding: 14px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-lg);
  background:
    radial-gradient(circle at top right, rgba(139, 92, 246, 0.08), transparent 34%),
    rgba(255, 255, 255, 0.015);
}

.integration-category-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
}

.integration-category-head h3 {
  font-size: 14px;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.integration-category-head p {
  margin-top: 3px;
  color: var(--text-tertiary);
  font-size: 12px;
  max-width: 700px;
}

.integration-category-count {
  flex-shrink: 0;
  color: var(--text-tertiary);
  font-size: 11px;
  font-family: var(--font-mono);
}

.integration-row {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px;
  background: var(--bg-surface-2);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-md);
  transition: border-color .18s ease, background .18s ease, transform .18s ease;
}

.integration-row:hover {
  border-color: var(--border-default);
  background: rgba(255, 255, 255, 0.045);
}

.integration-row.custom {
  border-style: dashed;
}

.integration-row.pending {
  background:
    radial-gradient(circle at top right, rgba(251, 191, 36, 0.08), transparent 34%),
    var(--bg-surface-2);
}

.integration-row.connected {
  background:
    radial-gradient(circle at top right, rgba(52, 211, 153, 0.08), transparent 34%),
    var(--bg-surface-2);
}

.integration-row .int-logo {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--bg-elevated);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.integration-row .int-logo svg { width: 18px; height: 18px; }

.integration-row .int-info {
  flex: 1;
  min-width: 0;
}

.integration-row .int-name {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  font-size: 14px;
}

.integration-row .int-desc {
  font-size: 12px;
  color: var(--text-tertiary);
  margin-top: 2px;
}

.custom-chip {
  padding: 3px 7px;
  border-radius: var(--r-full);
  background: var(--brand-soft);
  color: var(--brand-strong);
  border: 1px solid var(--brand-border);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.integration-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.integration-action {
  min-width: 124px;
  border-radius: var(--r-md);
  padding: 9px 14px;
  font-weight: 800;
  font-size: 13px;
  border: 1px solid;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  transition:
    transform .14s ease,
    background .18s ease,
    border-color .18s ease,
    color .18s ease,
    box-shadow .18s ease;
}

.integration-action:hover {
  transform: translateY(-1px);
}

.integration-action.disconnected {
  color: var(--brand-strong);
  background: var(--brand-soft);
  border-color: var(--brand-border);
}

.integration-action.disconnected:hover {
  background: var(--brand-soft-hover);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.12);
}

.integration-action.connected {
  color: var(--success);
  background: var(--success-soft);
  border-color: var(--success-border);
}

.integration-action.connected:hover {
  color: #fca5a5;
  background: var(--danger-soft);
  border-color: var(--danger-border);
}

.integration-action.connected:hover::after {
  content: " desconectar";
  font-size: 11px;
  font-weight: 700;
  color: #fca5a5;
}

.integration-action.loading {
  color: var(--text-secondary);
  background:
    linear-gradient(90deg, rgba(139, 92, 246, 0.10), rgba(52, 211, 153, 0.10), rgba(139, 92, 246, 0.10));
  background-size: 220% 100%;
  border-color: var(--border-default);
  cursor: wait;
  animation: integrationShimmer 1s linear infinite;
}

.integration-action:disabled {
  opacity: .9;
  cursor: wait;
  transform: none;
}

.integration-action svg {
  width: 14px;
  height: 14px;
}

.int-spinner {
  width: 14px;
  height: 14px;
  border-radius: 999px;
  border: 2px solid rgba(255,255,255,.16);
  border-top-color: var(--brand-strong);
  animation: integrationSpin .75s linear infinite;
}

.integration-badge {
  min-width: 112px;
  border-radius: var(--r-md);
  padding: 9px 12px;
  font-weight: 800;
  font-size: 13px;
  border: 1px solid;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
}

.integration-badge.pending {
  color: var(--warning);
  background: var(--warning-soft);
  border-color: var(--warning-border);
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--warning);
  box-shadow: 0 0 0 0 rgba(251, 191, 36, .5);
  animation: pendingPulse 1.45s infinite;
}

.int-delete-btn {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid var(--danger-border);
  background: var(--danger-soft);
  color: var(--danger);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: transform .14s ease, background .18s ease;
}

.int-delete-btn:hover {
  transform: translateY(-1px);
  background: rgba(248, 113, 113, 0.18);
}

.int-delete-btn svg {
  width: 14px;
  height: 14px;
}

.integration-add-trigger {
  width: 100%;
  margin-top: 16px;
  padding: 14px 16px;
  border: 1px dashed var(--brand-border);
  border-radius: var(--r-md);
  background: rgba(139, 92, 246, 0.08);
  color: var(--brand-strong);
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  transition: background .18s ease, border-color .18s ease, transform .18s ease;
}

.integration-add-trigger:hover {
  transform: translateY(-1px);
  background: rgba(139, 92, 246, 0.14);
  border-color: var(--brand-strong);
}

.integration-add-form {
  margin-top: 16px;
  padding: 16px;
  border-radius: var(--r-lg);
  border: 1px solid var(--brand-border);
  background:
    radial-gradient(circle at top left, rgba(139, 92, 246, 0.12), transparent 38%),
    var(--bg-surface-2);
  display: grid;
  gap: 14px;
}

.integration-form-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.integration-form-header h3 {
  font-size: 15px;
  font-weight: 800;
}

.integration-form-header p {
  margin-top: 3px;
  color: var(--text-tertiary);
  font-size: 12px;
}

.integration-form-close {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  border: 1px solid var(--border-default);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
}

.integration-form-close:hover {
  background: var(--bg-elevated);
  color: var(--text-primary);
}

.integration-form-grid {
  display: grid;
  grid-template-columns: 1fr 260px;
  gap: 12px;
}

.integration-add-form label {
  display: grid;
  gap: 6px;
}

.integration-add-form label span {
  color: var(--text-tertiary);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .03em;
}

.integration-add-form input,
.integration-add-form select,
.integration-add-form textarea {
  width: 100%;
  border: 1px solid var(--border-default);
  border-radius: 10px;
  background: var(--bg-input);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 13px;
  outline: none;
  padding: 11px 12px;
}

.integration-add-form textarea {
  resize: vertical;
  min-height: 48px;
}

.integration-add-form input:focus,
.integration-add-form select:focus,
.integration-add-form textarea:focus {
  border-color: var(--brand-strong);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.14);
}

.integration-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.integration-form-error {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: var(--r-md);
  border: 1px solid rgba(251, 146, 60, 0.38);
  background: rgba(251, 146, 60, 0.12);
  color: #fdba74;
  font-size: 12.5px;
  line-height: 1.4;
}
.integration-form-error svg { width: 16px; height: 16px; flex-shrink: 0; }

/* ── Política "Solo insights" — estado limitado elegante ──────────────────── */
.si-policy-body {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 18px 4px 6px;
}
.si-policy-body-lg { padding: 34px 8px; }
.si-policy-icon {
  flex-shrink: 0;
  width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 12px;
  background: var(--brand-soft);
  border: 1px solid var(--brand-border);
  color: var(--brand-strong);
}
.si-policy-icon svg { width: 20px; height: 20px; }
.si-policy-title { font-size: 14px; font-weight: 700; color: var(--text-primary); margin-bottom: 4px; }
.si-policy-body p { font-size: 13px; color: var(--text-secondary); line-height: 1.5; margin: 0 0 6px; }
.rv-si-caption {
  display: flex; align-items: center; gap: 8px;
  margin: 10px 0 0;
  padding: 9px 12px;
  border-radius: var(--r-md);
  background: var(--brand-soft);
  border: 1px solid var(--brand-border);
  color: var(--text-secondary);
  font-size: 12px;
}
.rv-si-caption svg { width: 15px; height: 15px; color: var(--brand-strong); flex-shrink: 0; }

/* ── Navegación secundaria Resumen / Revisión IA (Etapa 3) ───────────────── */
.mtabs {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  margin: 0 0 18px;
  border-radius: 12px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
}
.mtab {
  display: inline-flex;
  align-items: center;
  padding: 7px 16px;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  text-decoration: none;
  transition: background .15s, color .15s;
  white-space: nowrap;
}
.mtab:hover { color: var(--text-primary); background: var(--bg-hover, rgba(255,255,255,0.04)); }
.mtab-active {
  background: var(--brand-soft);
  color: var(--brand-strong);
  border: 1px solid var(--brand-border);
  cursor: default;
}
.mtab-active:hover { background: var(--brand-soft); }

/* ── Lente de análisis IA por Playbook (Etapa 4 storytelling) ────────────── */
.hero-lens-card { margin-bottom: 18px; }
.hero-lens-focus {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 11px 13px;
  margin-bottom: 14px;
  border-radius: var(--r-md);
  background: var(--brand-soft);
  border: 1px solid var(--brand-border);
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.45;
}
.hero-lens-focus svg { width: 16px; height: 16px; flex-shrink: 0; color: var(--brand-strong); margin-top: 1px; }
.hero-lens-item {
  padding: 11px 13px;
  border-radius: var(--r-md);
  border: 1px solid var(--border-subtle);
  background: var(--bg-elevated);
}
.hero-lens-item + .hero-lens-item { margin-top: 8px; }
.hero-lens-item-head { display: flex; align-items: center; gap: 8px; margin-bottom: 7px; flex-wrap: wrap; }
.hero-lens-title { font-size: 13px; font-weight: 600; color: var(--text-primary); }
.hero-lens-evidence {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding-left: 2px;
}
.hero-lens-time {
  flex-shrink: 0;
  font-family: var(--font-mono, monospace);
  font-size: 11px;
  color: var(--brand-strong);
  background: var(--brand-soft);
  border-radius: 5px;
  padding: 1px 6px;
}
.hero-lens-quote { font-size: 12.5px; color: var(--text-secondary); font-style: italic; line-height: 1.4; }
.hero-lens-crm {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 12px;
  padding: 10px 13px;
  border-radius: var(--r-md);
  border: 1px dashed var(--border-default);
  color: var(--text-secondary);
  font-size: 12.5px;
  line-height: 1.45;
}
.hero-lens-crm svg { width: 15px; height: 15px; flex-shrink: 0; color: var(--success); margin-top: 1px; }

/* Lente estándar compacta (reuniones ready no-hero) */
.lens-card { margin-bottom: 18px; }
.lens-block { margin-bottom: 14px; }
.lens-block:last-of-type { margin-bottom: 0; }
.lens-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-tertiary);
  margin-bottom: 7px;
}
.lens-focus-text { font-size: 13px; color: var(--text-secondary); line-height: 1.5; margin: 0; }
.lens-evidence-text { font-size: 12.5px; color: var(--text-secondary); line-height: 1.4; flex: 1; }
.lens-card .hero-lens-evidence { margin-bottom: 7px; flex-wrap: wrap; }
.lens-card .hero-lens-evidence:last-child { margin-bottom: 0; }

/* ── Monto compacto con tooltip de valor exacto (Etapa money-polish) ─────── */
.money-amount {
  position: relative;
  cursor: default;
  border-bottom: 1px dashed var(--border-default);
  outline: none;
}
.money-amount:focus-visible {
  border-bottom-color: var(--brand-strong);
  box-shadow: 0 2px 0 -1px var(--brand-strong);
}
.money-tip {
  position: absolute;
  bottom: calc(100% + 7px);
  left: 50%;
  transform: translateX(-50%) translateY(3px);
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  border-radius: 8px;
  padding: 5px 10px;
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
  color: var(--text-primary);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.35);
  opacity: 0;
  pointer-events: none;
  transition: opacity .13s ease, transform .13s ease;
  z-index: 60;
}
.money-tip::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: var(--border-default);
}
.money-amount:hover .money-tip,
.money-amount:focus .money-tip,
.money-amount:focus-visible .money-tip,
.money-amount.tip-open .money-tip {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ── Chip "✦ IA $XXK": variación de valor sugerida por IA en Pipeline activo ── */
/* Anotación económica IA global: texto violeta liviano (sin fondo/borde/pastilla),
   alineado a la derecha del monto del KPI. Mismo lenguaje que los deltas por fila. */
.ai-review-chip {
  position: relative;
  display: inline-flex;
  align-items: baseline;
  margin-left: 12px;            /* misma línea que el monto, a su derecha */
  color: var(--brand-strong);
  font-size: inherit;          /* mismo tamaño tipográfico que $1.55M */
  font-weight: 700;            /* diferenciación por color + peso (vs 800 del monto) */
  letter-spacing: -0.02em;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  outline: none;
  white-space: nowrap;
}
.ai-review-chip:focus-visible { text-decoration: underline; }
.ai-review-chip-label { display: inline-flex; align-items: baseline; color: var(--brand-strong); }
.ai-review-spark { display: inline-flex; align-items: flex-start; margin-left: 3px; }
.ai-review-spark .icon { display: inline-flex; }
.ai-review-spark .icon svg { width: 12px; height: 12px; transform: translateY(-5px); }

.ai-review-popover {
  position: fixed;             /* posicionado por JS (viewport-aware, flip/clamp) */
  top: 0;
  left: 0;
  width: max-content;
  max-width: min(290px, 86vw);
  background: var(--bg-elevated);
  border: 1px solid var(--brand-border);
  border-radius: 12px;
  padding: 13px 14px;
  box-shadow: var(--shadow-md);
  color: var(--text-primary);
  font-weight: 500;
  text-align: left;
  opacity: 0;
  transform: translateY(3px);
  pointer-events: none;
  transition: opacity .14s ease, transform .14s ease;
  z-index: 70;
  cursor: default;
}
/* Puente transparente que cubre el gap de 8px entre chip y popover, para que el
   hover no se corte al mover el mouse hacia el popover (solo activo si está abierto). */
.ai-review-popover::before {
  content: "";
  position: absolute;
  top: -10px; left: 0; right: 0;
  height: 10px;
}
/* Reveal gestionado por JS (.is-open), no por :hover/:focus-within. */
.ai-review-chip.is-open .ai-review-popover {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.ai-review-pop-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--brand-strong);
  margin-bottom: 9px;
  letter-spacing: .01em;
}
.ai-review-list { display: flex; flex-direction: column; gap: 8px; }
.ai-review-row-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
}
.ai-review-deal { font-size: 13px; font-weight: 600; color: var(--text-primary); }
.ai-review-delta { font-size: 13px; font-weight: 700; white-space: nowrap; }
.ai-review-delta.pos { color: var(--success); }
.ai-review-delta.neg { color: var(--brand-strong); }
.ai-review-reason { font-size: 11.5px; font-weight: 500; color: var(--text-tertiary); margin-top: 1px; }
.ai-review-divider { height: 1px; background: var(--border-subtle); margin: 11px 0; }
.ai-review-totals { display: flex; flex-direction: column; gap: 5px; }
.ai-review-total-line {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  font-size: 12.5px;
  color: var(--text-secondary);
}
.ai-review-total-line strong { color: var(--text-primary); font-weight: 700; }
.ai-review-total-line strong.neg { color: var(--brand-strong); }
.ai-review-total-line strong.pos { color: var(--success); }
.ai-review-foot {
  margin-top: 10px;
  font-size: 10.5px;
  font-weight: 500;
  color: var(--text-tertiary);
  line-height: 1.4;
}

.integration-explainer {
  margin-top: 16px;
  padding: 13px 14px;
  border-radius: var(--r-md);
  border: 1px solid var(--brand-border);
  background: var(--brand-soft);
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.45;
}

.integration-explainer strong {
  color: var(--text-primary);
}
.integration-explainer svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  vertical-align: -2px;
  margin-right: 6px;
  color: var(--brand-strong);
}

@keyframes integrationSpin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes integrationShimmer {
  0% {
    background-position: 0% 50%;
  }
  100% {
    background-position: 220% 50%;
  }
}

@keyframes pendingPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(251, 191, 36, .5);
  }
  70% {
    box-shadow: 0 0 0 8px rgba(251, 191, 36, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(251, 191, 36, 0);
  }
}

@media (max-width: 900px) {
  .integration-category-head {
    flex-direction: column;
  }

  .integration-form-grid {
    grid-template-columns: 1fr;
  }

  .integration-row {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .integration-action,
  .integration-badge {
    width: 100%;
  }

  .integration-actions {
    width: 100%;
  }
}

/* ============================================================
   PRIORITIES PATCH — permissions, CRM intelligence, manager feedback
   ============================================================ */

.access-denied-card {
  max-width: 720px;
  margin: 60px auto;
  text-align: center;
  padding: 42px;
}

.access-denied-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 18px;
  border-radius: var(--r-lg);
  display: grid;
  place-items: center;
  background: var(--brand-soft);
  color: var(--brand-strong);
  border: 1px solid var(--brand-border);
}

.access-denied-icon svg {
  width: 28px;
  height: 28px;
}

.access-denied-card h2 {
  margin-bottom: 8px;
}

.access-denied-card p {
  color: var(--text-secondary);
  margin-bottom: 20px;
}

.readonly-card {
  cursor: default;
}

.readonly-card:hover {
  transform: none;
}

.mini-chip,
.lock-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border-radius: var(--r-full);
  padding: 4px 8px;
  font-size: 10px;
  font-weight: 800;
  margin-left: 8px;
}

.mini-chip {
  background: var(--brand-soft);
  color: var(--brand-strong);
  border: 1px solid var(--brand-border);
}

.lock-chip {
  background: rgba(255,255,255,0.04);
  color: var(--text-tertiary);
  border: 1px solid var(--border-default);
}

.lock-chip svg {
  width: 12px;
  height: 12px;
}

/* CRM Intelligence */

.crm-card {
  margin-bottom: 24px;
}

.section-subtitle {
  margin-top: 4px;
  color: var(--text-tertiary);
  font-size: 12px;
}

.card-header.slim {
  margin-top: 18px;
  margin-bottom: 10px;
}

.card-header.slim h3 {
  font-size: 14px;
}

.crm-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.crm-update-box {
  padding: 14px;
  border-radius: var(--r-md);
  background: var(--bg-surface-2);
  border: 1px solid var(--border-subtle);
}

.crm-update-box.highlight {
  border-color: var(--brand-border);
  background:
    radial-gradient(circle at top right, rgba(139, 92, 246, 0.16), transparent 40%),
    var(--bg-surface-2);
}

.crm-label {
  color: var(--text-tertiary);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .04em;
  margin-bottom: 6px;
}

.crm-value {
  font-weight: 800;
  color: var(--text-primary);
}

.crm-next-action {
  margin-top: 14px;
  padding: 16px;
  border-radius: var(--r-md);
  border: 1px solid var(--brand-border);
  background: var(--brand-soft);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.crm-next-action p {
  margin-top: 4px;
  color: var(--text-secondary);
  font-size: 12px;
}

.crm-nextsteps {
  margin-top: 16px;
}

.crm-step {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 13px 14px;
  border-radius: var(--r-md);
  background: var(--bg-surface-2);
  border: 1px solid var(--border-subtle);
}

.crm-step p {
  margin-top: 3px;
  color: var(--text-tertiary);
  font-size: 12px;
}

/* Manager coaching */

.coach-card {
  margin-bottom: 24px;
}

.coach-ai-card,
.manager-feedback-card,
.coach-editor {
  padding: 16px;
  border-radius: var(--r-md);
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface-2);
}

.coach-ai-card {
  margin-bottom: 12px;
}

.manager-feedback-card {
  margin-top: 12px;
  background:
    radial-gradient(circle at top right, rgba(139, 92, 246, 0.10), transparent 36%),
    var(--bg-surface-2);
  border-color: var(--brand-border);
}

.manager-feedback-card.compact {
  margin-top: 0;
}

.manager-feedback-card p,
.coach-ai-card p {
  color: var(--text-secondary);
  margin-top: 8px;
  line-height: 1.55;
}

.feedback-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.coach-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.coach-editor {
  margin-top: 12px;
  display: grid;
  gap: 12px;
  border-color: var(--brand-border);
  background:
    radial-gradient(circle at top left, rgba(139, 92, 246, 0.12), transparent 36%),
    var(--bg-surface-2);
}

.coach-editor label {
  display: grid;
  gap: 6px;
}

.coach-editor label span {
  color: var(--text-tertiary);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.coach-editor textarea {
  width: 100%;
  min-height: 84px;
  padding: 12px;
  border-radius: var(--r-md);
  border: 1px solid var(--border-default);
  background: var(--bg-input);
  color: var(--text-primary);
  resize: vertical;
  outline: none;
}

.coach-editor textarea:focus {
  border-color: var(--brand-strong);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.14);
}

@media (max-width: 1000px) {
  .crm-grid {
    grid-template-columns: 1fr 1fr;
  }

  .crm-next-action {
    flex-direction: column;
    align-items: flex-start;
  }

  .crm-step {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 700px) {
  .crm-grid {
    grid-template-columns: 1fr;
  }
}

/* ============================================================
   AI CONTEXT SECTION — workspace context + reference documents
   ============================================================ */

.ai-context-card {
  margin-bottom: 22px;
}

/* Context textarea editor */
.ai-context-editor {
  display: grid;
  gap: 12px;
}

.ai-context-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
  letter-spacing: 0.03em;
  display: block;
}

.ai-context-label-hint {
  display: block;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-tertiary);
  margin-top: 3px;
  letter-spacing: 0;
}

.ai-context-textarea {
  width: 100%;
  min-height: 130px;
  padding: 13px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border-default);
  border-radius: var(--r-md);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 13px;
  line-height: 1.55;
  resize: vertical;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}

.ai-context-textarea:focus {
  border-color: var(--brand-border);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.14);
}

.ai-context-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.ai-context-readonly {
  display: grid;
  gap: 10px;
}

/* Collapsed / saved state */
.ai-context-saved {
  display: grid;
  gap: 10px;
}

.ai-context-saved-text {
  white-space: pre-wrap;
  word-break: break-word;
}

.ai-context-saved-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  flex-wrap: wrap;
}

/* Scorecard card header with buttons inline */
.scorecard-header-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.scorecard-header-right .pb-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.scorecard-header-right .btn {
  padding: 7px 12px;
  font-size: 12px;
}

/* Reference document rows */

.ai-docs-list {
  margin-bottom: 14px;
}

.ai-doc-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 14px;
  background: var(--bg-surface-2);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-md);
}

.ai-doc-logo {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  background: var(--brand-soft);
  color: var(--brand-strong);
  border: 1px solid var(--brand-border);
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 15px;
  flex-shrink: 0;
}

.ai-doc-info {
  flex: 1;
  min-width: 0;
}

.ai-doc-name {
  font-weight: 700;
  font-size: 14px;
  color: var(--text-primary);
}

.ai-doc-meta {
  font-size: 12px;
  color: var(--text-tertiary);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ai-doc-delete {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid var(--danger-border);
  background: var(--danger-soft);
  color: var(--danger);
  display: grid;
  place-items: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: transform .14s ease, background .15s ease;
}

.ai-doc-delete:hover {
  transform: translateY(-1px);
  background: rgba(248, 113, 113, 0.18);
}

.ai-doc-delete svg {
  width: 14px;
  height: 14px;
}

/* Add document trigger button */

.ai-doc-add-trigger {
  width: 100%;
  margin-top: 14px;
  padding: 13px 16px;
  border: 1px dashed var(--brand-border);
  border-radius: var(--r-md);
  background: rgba(139, 92, 246, 0.07);
  color: var(--brand-strong);
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  transition: background .15s, border-color .15s, transform .15s;
}

.ai-doc-add-trigger:hover {
  transform: translateY(-1px);
  background: rgba(139, 92, 246, 0.13);
  border-color: var(--brand-strong);
}

.ai-doc-add-trigger svg {
  width: 16px;
  height: 16px;
}

/* Add document form */

.ai-doc-add-form {
  margin-top: 14px;
  padding: 16px;
  border-radius: var(--r-lg);
  border: 1px solid var(--brand-border);
  background:
    radial-gradient(circle at top left, rgba(139, 92, 246, 0.12), transparent 38%),
    var(--bg-surface-2);
  display: grid;
  gap: 12px;
}

.ai-doc-form-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.ai-doc-form-header h3 {
  font-size: 14px;
  font-weight: 800;
}

.ai-doc-form-header p {
  margin-top: 3px;
  color: var(--text-tertiary);
  font-size: 12px;
}

.ai-doc-form-close {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid var(--border-default);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
  display: grid;
  place-items: center;
  transition: background .15s;
}

.ai-doc-form-close:hover {
  background: var(--bg-elevated);
  color: var(--text-primary);
}

.ai-doc-form-grid {
  display: grid;
  grid-template-columns: 1fr 220px;
  gap: 12px;
}

.ai-doc-add-form label {
  display: grid;
  gap: 6px;
}

.ai-doc-add-form label span {
  font-size: 11px;
  font-weight: 800;
  color: var(--text-tertiary);
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.ai-doc-add-form input,
.ai-doc-add-form select,
.ai-doc-add-form textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border-default);
  border-radius: var(--r-md);
  background: var(--bg-input);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 13px;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}

.ai-doc-add-form textarea {
  resize: vertical;
  min-height: 48px;
}

.ai-doc-add-form input:focus,
.ai-doc-add-form select:focus,
.ai-doc-add-form textarea:focus {
  border-color: var(--brand-strong);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.14);
}

.ai-doc-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

@media (max-width: 700px) {
  .ai-doc-form-grid {
    grid-template-columns: 1fr;
  }

  .ai-doc-row {
    flex-wrap: wrap;
  }
}

/* ============================================================
   MEETING REVIEW PAGE
   ============================================================ */

/* Layout grids */
.rv-top-grid {
  display: grid;
  grid-template-columns: 1.55fr 1fr;
  gap: 22px;
  margin-bottom: 22px;
}

.rv-bottom-grid {
  display: grid;
  grid-template-columns: 1fr 1.65fr;
  gap: 22px;
}

/* ---- Mock player ---- */
.rv-player-card { padding-bottom: 18px; }

.rv-screen {
  background: linear-gradient(135deg, #0c0c1c 0%, #12122a 100%);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  min-height: 178px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 36px;
  position: relative;
  margin-bottom: 16px;
}

.rv-participant {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.rv-av {
  width: 54px;
  height: 54px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-size: 17px;
  font-weight: 800;
  color: white;
}

.rv-av-deal {
  background: var(--brand-gradient);
}

.rv-pname {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-tertiary);
  max-width: 90px;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rv-vs {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-dim);
  letter-spacing: 0.05em;
}

.rv-ai-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  font-size: 11px;
  font-weight: 700;
  color: var(--brand-strong);
  background: var(--brand-soft);
  border: 1px solid var(--brand-border);
  border-radius: 20px;
  padding: 4px 10px;
  display: flex;
  align-items: center;
  gap: 5px;
}
.rv-ai-badge svg { width: 11px; height: 11px; }

/* Controls */
.rv-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 2px;
}

.rv-play-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--brand-solid);
  border: none;
  color: white;
  display: grid;
  place-items: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: transform .15s, background .15s;
}
.rv-play-btn:hover { transform: scale(1.06); background: var(--brand-from); }
.rv-play-btn svg   { width: 20px; height: 20px; }

.rv-timeline-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
}

.rv-time {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-tertiary);
  min-width: 36px;
  flex-shrink: 0;
}
.rv-time-total { text-align: right; }

.rv-timeline {
  flex: 1;
  height: 28px;
  display: flex;
  align-items: center;
  position: relative;
  cursor: pointer;
}

.rv-tl-bg {
  position: absolute;
  left: 0; right: 0;
  height: 4px;
  background: var(--bg-elevated);
  border-radius: 2px;
  pointer-events: none;
}

.rv-tl-fill {
  position: absolute;
  left: 0;
  height: 4px;
  background: var(--brand-gradient);
  border-radius: 2px;
  pointer-events: none;
  transition: width .25s linear;
}

.rv-marker {
  position: absolute;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  transform: translateX(-50%);
  top: 50%;
  margin-top: -6px;
  border: 2px solid var(--bg-surface);
  cursor: pointer;
  z-index: 2;
  transition: transform .15s;
  padding: 0;
}
.rv-marker:hover, .rv-marker-active { transform: translateX(-50%) scale(1.45); }
.rv-marker.success { background: var(--success); }
.rv-marker.warning { background: var(--warning); }
.rv-marker.danger  { background: var(--danger);  }
.rv-marker.brand   { background: var(--brand-solid); }

/* ---- Scorecard breakdown ---- */
.rv-score-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--bg-surface-2);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-md);
}

.rv-crit-sm {
  width: 28px;
  height: 28px;
  font-size: 11px;
  flex-shrink: 0;
}

.rv-score-info {
  flex: 1;
  display: grid;
  gap: 5px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
}

.rv-score-bar {
  height: 3px;
  background: var(--bg-elevated);
  border-radius: 2px;
  overflow: hidden;
}

.rv-score-fill {
  height: 100%;
  border-radius: 2px;
}
.rv-score-fill { background: var(--sc-color, var(--brand-solid)); }

.rv-score-val {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 700;
  min-width: 30px;
  text-align: right;
  flex-shrink: 0;
}
.rv-score-val { color: var(--sc-color, var(--text-primary)); }

/* ---- Filtros ---- */
.rv-filters {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.rv-filter-btn {
  padding: 5px 12px;
  border-radius: 20px;
  border: 1px solid var(--border-default);
  background: transparent;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
  font-family: var(--font-body);
  cursor: pointer;
  transition: all .15s;
}
.rv-filter-btn:hover  { border-color: var(--brand-border); color: var(--brand-strong); }
.rv-filter-btn.active { background: var(--brand-soft); border-color: var(--brand-border); color: var(--brand-strong); }

/* ---- Transcript ---- */
.rv-transcript { display: grid; gap: 6px; }

.rv-tl-line {
  padding: 11px 13px;
  border-radius: var(--r-md);
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface-2);
  transition: border-color .15s, background .15s;
}
.rv-tl-line.rv-clickable { cursor: pointer; }
.rv-tl-line.rv-clickable:hover { border-color: var(--border-default); background: var(--bg-elevated); }
.rv-tl-line.active { border-color: var(--brand-border); background: var(--brand-soft); }

.rv-ll-top {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 5px;
  flex-wrap: wrap;
}

.rv-ll-time {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-tertiary);
}

.rv-ll-speaker {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.01em;
}
.rv-ll-speaker.rep    { color: var(--brand-strong); }
.rv-ll-speaker.client { color: var(--info); }

.rv-ll-text {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* ---- Insight panel ---- */
.rv-insight-card { min-height: 200px; }

.rv-insight-body { display: grid; gap: 14px; padding-top: 2px; }

.rv-insight-quote {
  font-style: italic;
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.55;
  padding: 10px 13px;
  border-left: 3px solid var(--brand-border);
  background: var(--bg-surface-2);
  border-radius: 0 var(--r-md) var(--r-md) 0;
}

.rv-insight-block { display: grid; gap: 4px; }

.rv-insight-lbl {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-tertiary);
}

.rv-insight-txt {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* CRM box dentro del insight panel */
.rv-crm-box {
  background: var(--success-soft);
  border: 1px solid var(--success-border);
  border-radius: var(--r-md);
  padding: 12px 13px;
  display: grid;
  gap: 8px;
}

.rv-crm-head {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}
.rv-crm-head svg    { width: 13px; height: 13px; color: var(--success); flex-shrink: 0; }
.rv-crm-head strong { font-size: 12px; color: var(--success); }

.rv-crm-suggestion {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.45;
}

.rv-crm-btn { width: fit-content; }

/* Responsive */
@media (max-width: 1100px) {
  .rv-top-grid    { grid-template-columns: 1fr; }
  .rv-bottom-grid { grid-template-columns: 1fr; }
}

/* ============================================================
   DEMO TOOLS CARD
   ============================================================ */

.demo-tools-card {
  border-color: rgba(251, 191, 36, 0.25);
  background:
    radial-gradient(circle at top right, rgba(251, 191, 36, 0.06), transparent 40%),
    var(--bg-surface);
}

.demo-tools-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  flex-wrap: wrap;
}

/* Demo tools — dos acciones con descripción (Etapa Demo Tools) */
.demo-tools-list { display: flex; flex-direction: column; gap: 10px; }
.demo-tool-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 12px 14px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-md);
  background: var(--bg-surface-2);
}
.demo-tool-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.demo-tool-info strong { color: var(--text-primary); font-size: 14px; }
.demo-tool-item .btn { flex: 0 0 auto; }

/* Botón destructivo (controlado) */
.btn-danger {
  background: var(--danger);
  border: 1px solid var(--danger);
  color: #1a0b0b;
  font-weight: 650;
}
.btn-danger:hover { filter: brightness(1.06); }
.btn-danger-soft {
  background: var(--danger-soft);
  border: 1px solid var(--danger-border);
  color: var(--danger);
}
.btn-danger-soft:hover { background: rgba(248, 113, 113, 0.2); }

/* ============================================================
   CAPTION WIDGET — player inline captions (prev / active / next)
   ============================================================ */

.rv-caption-widget {
  padding: 0 4px;
  margin: 12px 0 14px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.rv-cap-line {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 6px 10px;
  border-radius: var(--r-md);
  min-height: 30px;
  transition: background .15s, opacity .2s;
  border: 1px solid transparent;
}

.rv-cap-line.rv-cap-prev,
.rv-cap-line.rv-cap-next {
  opacity: 0.38;
}

.rv-cap-line.rv-cap-active {
  opacity: 1;
  background: rgba(139, 92, 246, 0.14);
  border-color: var(--brand-border);
}

.rv-cap-line.rv-cap-empty {
  opacity: 0;
  pointer-events: none;
}

.rv-cap-line:not(.rv-cap-empty) {
  cursor: pointer;
}

.rv-cap-line:not(.rv-cap-empty):hover {
  opacity: 0.85;
  background: rgba(255, 255, 255, 0.04);
}

.rv-cap-time {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-dim);
  flex-shrink: 0;
  min-width: 34px;
}

.rv-cap-speaker {
  font-size: 10px;
  font-weight: 700;
  flex-shrink: 0;
  min-width: 52px;
}
.rv-cap-speaker.rep    { color: var(--brand-strong); }
.rv-cap-speaker.client { color: var(--info); }

.rv-cap-text {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.4;
  flex: 1;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.rv-cap-line.rv-cap-active .rv-cap-text {
  color: var(--text-primary);
  font-weight: 500;
}

/* ============================================================
   MEETING REVIEW — NOTAS DEL MANAGER
   ============================================================ */

/* Botón de acceso desde meeting-detail */
.rv-review-access-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 14px;
  font-size: 13px;
}
.rv-review-access-btn svg { width: 14px; height: 14px; flex-shrink: 0; }

/* Marcadores de nota en timeline */
.rv-note-marker {
  position: absolute;
  width: 10px;
  height: 10px;
  border-radius: 2px;
  transform: translateX(-50%) rotate(45deg);
  top: 50%;
  margin-top: -5px;
  background: var(--warning);
  border: 2px solid var(--bg-surface);
  cursor: pointer;
  z-index: 3;
  padding: 0;
  transition: transform .15s;
}
.rv-note-marker:hover,
.rv-note-marker-active {
  transform: translateX(-50%) rotate(45deg) scale(1.5);
}

/* Botón "+ Agregar nota" dentro del player */
.rv-add-note-btn {
  width: 100%;
  margin-top: 10px;
  padding: 8px 14px;
  border: 1px dashed rgba(251, 191, 36, 0.35);
  border-radius: var(--r-md);
  background: rgba(251, 191, 36, 0.05);
  color: var(--warning);
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  transition: background .15s, border-color .15s;
}
.rv-add-note-btn:hover {
  background: rgba(251, 191, 36, 0.1);
  border-color: rgba(251, 191, 36, 0.55);
}
.rv-add-note-btn svg { width: 13px; height: 13px; }

/* Modal overlay */
.rv-note-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.65);
  display: grid;
  place-items: center;
  padding: 20px;
}

.rv-note-modal {
  width: 100%;
  max-width: 460px;
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-xl);
  padding: 22px;
  display: grid;
  gap: 16px;
  box-shadow: 0 24px 60px rgba(0,0,0,0.5);
}

.rv-note-modal-hdr {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.rv-note-modal-hdr h3 {
  font-size: 15px;
  font-weight: 800;
}

.rv-note-close {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 1px solid var(--border-default);
  background: transparent;
  color: var(--text-secondary);
  font-size: 18px;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background .15s;
  flex-shrink: 0;
}
.rv-note-close:hover { background: var(--bg-elevated); color: var(--text-primary); }

.rv-note-form {
  display: grid;
  gap: 12px;
}

.rv-note-form label {
  display: grid;
  gap: 5px;
}

.rv-note-form label span {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-tertiary);
}

.rv-note-form select,
.rv-note-form textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border-default);
  border-radius: var(--r-md);
  background: var(--bg-input);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 13px;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}

.rv-note-form textarea { resize: vertical; min-height: 64px; }

.rv-note-form select:focus,
.rv-note-form textarea:focus {
  border-color: var(--brand-border);
  box-shadow: 0 0 0 3px rgba(139,92,246,0.14);
}

.rv-note-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

/* Filas de notas en el transcript */
.rv-note-row {
  background: rgba(251, 191, 36, 0.05);
  border-color: rgba(251, 191, 36, 0.2);
  position: relative;
}
.rv-note-row.active {
  background: rgba(251, 191, 36, 0.12);
  border-color: rgba(251, 191, 36, 0.4);
}
.rv-note-row:hover {
  background: rgba(251, 191, 36, 0.09);
  border-color: rgba(251, 191, 36, 0.32);
}

/* Botón eliminar nota en la fila del transcript */
.rv-note-del {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  border: 1px solid var(--danger-border);
  background: var(--danger-soft);
  color: var(--danger);
  display: grid;
  place-items: center;
  cursor: pointer;
  margin-left: auto;
  flex-shrink: 0;
  transition: background .15s;
}
.rv-note-del:hover { background: rgba(248,113,113,0.2); }
.rv-note-del svg   { width: 11px; height: 11px; }

/* ============================================================
   TOAST NOTIFICATION
   ============================================================ */
.app-toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-lg);
  padding: 10px 20px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  z-index: 3000;
  box-shadow: 0 8px 24px rgba(0,0,0,0.45);
  white-space: nowrap;
  animation: toast-in .2s ease;
}
@keyframes toast-in {
  from { opacity:0; transform:translateX(-50%) translateY(8px); }
  to   { opacity:1; transform:translateX(-50%) translateY(0); }
}

/* ============================================================
   REP REFLECTION MARKERS & ROWS
   ============================================================ */
.rv-reflection-marker {
  position: absolute;
  width: 10px;
  height: 10px;
  border-radius: 2px;
  transform: translateX(-50%);
  top: 50%;
  margin-top: -5px;
  background: var(--info);
  border: 2px solid var(--bg-surface);
  cursor: pointer;
  z-index: 3;
  padding: 0;
  transition: transform .15s;
}
.rv-reflection-marker:hover,
.rv-reflection-marker.active { transform: translateX(-50%) scale(1.5); }

.rv-reflection-row {
  background: rgba(96, 165, 250, 0.05);
  border-color: rgba(96, 165, 250, 0.18);
}
.rv-reflection-row.active {
  background: rgba(96, 165, 250, 0.12);
  border-color: rgba(96, 165, 250, 0.38);
}
.rv-reflection-row:hover {
  background: rgba(96, 165, 250, 0.09);
  border-color: rgba(96, 165, 250, 0.28);
}

/* Add reflection button */
.rv-add-refl-btn {
  border-color: rgba(96, 165, 250, 0.35) !important;
  background: rgba(96, 165, 250, 0.06) !important;
  color: var(--info) !important;
}
.rv-add-refl-btn:hover {
  background: rgba(96, 165, 250, 0.12) !important;
  border-color: rgba(96, 165, 250, 0.55) !important;
}

/* ============================================================
   AMOUNT SUGGESTION CARD (CRM Intelligence)
   ============================================================ */
.crm-amount-suggestion {
  margin-top: 18px;
  padding: 14px 16px;
  background: rgba(139, 92, 246, 0.07);
  border: 1px solid var(--brand-border);
  border-radius: var(--r-md);
  display: grid;
  gap: 10px;
}

.crm-amount-hdr {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.crm-amount-badge {
  font-size: 12px;
  font-weight: 800;
  color: var(--brand-strong);
}

.crm-amount-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.crm-value-detected {
  color: var(--brand-strong);
  font-weight: 800;
}

.crm-diff {
  font-size: 11px;
  color: var(--text-tertiary);
  margin-top: 2px;
}

.crm-amount-reason {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.45;
  font-style: italic;
}

.crm-amount-evidence {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  font-size: 11px;
  color: var(--text-tertiary);
  line-height: 1.4;
}
.crm-amount-evidence svg { width: 12px; height: 12px; flex-shrink: 0; margin-top: 1px; }

.crm-amount-btn { width: fit-content; }

/* ============================================================
   MEETINGS PAGE
   ============================================================ */

.mt-filters-wrap { flex-wrap: wrap; gap: 6px; }

.mt-select {
  padding: 5px 10px;
  border-radius: 20px;
  border: 1px solid var(--border-default);
  background: var(--bg-input);
  color: var(--text-secondary);
  font-size: 12px;
  font-family: var(--font-body);
  font-weight: 600;
  outline: none;
  cursor: pointer;
  transition: border-color .15s;
}
.mt-select:focus { border-color: var(--brand-border); }

.mt-meeting-list { gap: 8px; }

.mt-meeting-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 13px 16px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-md);
  background: var(--bg-surface-2);
  transition: border-color .15s, background .15s;
}
/* Badge "Reanalizada" discreto (meetings list + meeting cards) */
.mt-reanalyzed-badge { font-size: 9px; }
.mt-meeting-row:hover {
  border-color: var(--border-default);
  background: var(--bg-elevated);
}

.mt-row-info { flex: 1; min-width: 0; }

.mt-meeting-name {
  font-weight: 700;
  font-size: 14px;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mt-meeting-meta {
  font-size: 11px;
  color: var(--text-tertiary);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mt-row-mid {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.mt-row-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.mt-btn {
  font-size: 12px;
  padding: 6px 11px;
  white-space: nowrap;
}
.mt-btn svg { width: 13px; height: 13px; }

@media (max-width: 900px) {
  .mt-meeting-row { flex-wrap: wrap; }
  .mt-row-actions { flex-wrap: wrap; }
}

/* ============================================================
   TEAM PAGE
   ============================================================ */

.tm-team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  padding-top: 4px;
}

.tm-rep-card {
  background: var(--bg-surface-2);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-lg);
  padding: 18px;
  display: grid;
  gap: 14px;
  cursor: pointer;
  transition: border-color .15s, background .15s, transform .15s;
}
.tm-rep-card:hover {
  border-color: var(--brand-border);
  background: var(--bg-elevated);
  transform: translateY(-2px);
}

/* Identidad cromática estable por rep (4D.1) — acento de identidad, no de score */
.rep-accented { border-left: 3px solid var(--rep-accent, var(--border-default)); }
.tm-rep-card.rep-accented:hover { border-left-color: var(--rep-accent, var(--brand-border)); }
.rep-id-dot {
  display: inline-block;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--rep-accent, var(--text-tertiary));
  flex: 0 0 auto;
}

.tm-rep-top {
  display: flex;
  align-items: center;
  gap: 12px;
}

.tm-rep-identity { flex: 1; min-width: 0; }

.tm-rep-name {
  font-weight: 800;
  font-size: 14px;
  color: var(--text-primary);
}

.tm-rep-role {
  font-size: 11px;
  color: var(--text-tertiary);
  margin-top: 2px;
}

.tm-rep-scores {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
}

.tm-rep-stats {
  display: flex;
  gap: 14px;
}

.tm-stat {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: var(--text-tertiary);
}
.tm-stat svg { width: 13px; height: 13px; }

.tm-rep-insights {
  display: grid;
  gap: 6px;
}

.tm-rep-cta {
  font-size: 12px;
  font-weight: 700;
  color: var(--brand-strong);
  display: flex;
  align-items: center;
  gap: 6px;
}
.tm-rep-cta svg { width: 13px; height: 13px; }

/* Rep evolution section */
.evol-scores-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.evol-score-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

/* ============================================================
   DEALS / PIPELINE PAGE
   ============================================================ */

/* CRM connection status in header */
.dl-crm-hdr {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 5px;
}

/* Deal list */
.dl-deal-list { gap: 10px; }

.dl-deal-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-md);
  background: var(--bg-surface-2);
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.dl-deal-row:hover {
  border-color: var(--border-default);
  background: var(--bg-elevated);
}

/* Left: avatar + name */
.dl-row-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 0 0 210px;
  min-width: 0;
}

.dl-deal-identity { min-width: 0; }

.dl-deal-name {
  font-weight: 700;
  font-size: 14px;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dl-deal-sub {
  font-size: 11px;
  color: var(--text-tertiary);
  margin-top: 2px;
  display: flex;
  align-items: baseline;
  gap: 0 5px;
  min-width: 0;
  overflow: visible;            /* permite que los tooltips escapen sin recorte */
}
/* La industria cede espacio (ellipsis); el monto y el delta IA nunca se encogen. */
.dl-sub-industry {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
  flex: 0 1 auto;
}
.dl-sub-sep,
.dl-deal-sub > .money-amount,
.dl-deal-sub > .dl-ai-delta { flex: 0 0 auto; }

/* Anotación económica IA individual: violeta, secundaria, sin fondo/borde/pastilla. */
.dl-ai-delta {
  position: relative;
  display: inline-flex;
  align-items: baseline;
  color: var(--brand-strong);
  font-weight: 700;
  font-size: 9.5px;
  cursor: pointer;
  outline: none;
  white-space: nowrap;
}
.dl-ai-delta:focus-visible { text-decoration: underline; }
.dl-ai-spark { display: inline-flex; align-items: flex-start; margin-left: 1px; }
.dl-ai-spark .icon { display: inline-flex; }
.dl-ai-spark .icon svg { width: 7px; height: 7px; transform: translateY(-2px); }
/* Microtooltip compacto del delta IA (valor exacto + frase breve), dos líneas. */
.dl-ai-tip {
  position: absolute;
  bottom: calc(100% + 7px);
  left: 50%;
  transform: translateX(-50%) translateY(3px);
  display: flex;
  flex-direction: column;
  gap: 1px;
  background: var(--bg-elevated);
  border: 1px solid var(--brand-border);
  border-radius: 8px;
  padding: 6px 10px;
  white-space: nowrap;
  box-shadow: var(--shadow-md);
  opacity: 0;
  pointer-events: none;
  transition: opacity .13s ease, transform .13s ease;
  z-index: 60;
}
.dl-ai-tip strong { color: var(--brand-strong); font-size: 12px; font-weight: 700; }
.dl-ai-tip span   { color: var(--text-secondary); font-size: 10.5px; font-weight: 500; }
.dl-ai-delta:hover .dl-ai-tip,
.dl-ai-delta:focus .dl-ai-tip,
.dl-ai-delta:focus-visible .dl-ai-tip,
.dl-ai-delta.tip-open .dl-ai-tip {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Mid: stage + risk + score + reps */
.dl-row-mid {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  flex-wrap: wrap;
}

.dl-stage-pill {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  padding: 3px 9px;
  border-radius: 12px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  white-space: nowrap;
}

.dl-reps { display: flex; gap: 4px; }

/* Right: CRM status + next task */
.dl-row-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  flex: 0 0 170px;
}

.dl-task-text {
  max-width: 170px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: right;
}

/* Actions column (edit button) */
.dl-row-actions { flex: 0 0 auto; }

.dl-edit-btn {
  font-size: 12px;
  padding: 5px 10px;
  opacity: 0.65;
}
.dl-edit-btn:hover { opacity: 1; }

/* Edit modal */
.dl-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.65);
  display: grid;
  place-items: center;
  padding: 20px;
}

.dl-modal {
  width: 100%;
  max-width: 500px;
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-xl);
  padding: 22px;
  display: grid;
  gap: 16px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
}

.dl-modal-form {
  display: grid;
  gap: 12px;
}

.dl-modal-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.dl-modal-form label {
  display: grid;
  gap: 5px;
}

.dl-modal-form label span {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-tertiary);
}

.dl-modal-form select,
.dl-modal-form input,
.dl-modal-form textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border-default);
  border-radius: var(--r-md);
  background: var(--bg-input);
  color: var(--text-primary);
  caret-color: var(--brand-strong);
  font-family: inherit;
  font-size: 13px;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}

.dl-modal-form textarea {
  min-height: 84px;
  line-height: 1.5;
  resize: vertical;
}

.dl-modal-form input::placeholder,
.dl-modal-form textarea::placeholder {
  color: var(--text-tertiary);
  opacity: 1;
}

.dl-modal-form select:focus,
.dl-modal-form input:focus,
.dl-modal-form textarea:focus {
  border-color: var(--brand-border);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.14);
}

.dl-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

/* Responsive */
@media (max-width: 1000px) {
  .dl-deal-row   { flex-wrap: wrap; }
  .dl-row-left   { flex: 0 0 100%; }
  .dl-row-right  { align-items: flex-start; }
  .dl-modal-grid { grid-template-columns: 1fr; }
}


/* ============================================================
   MEETING SECONDARY INDICATORS
   ============================================================ */
.mt-indicators-row {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  margin-top: 5px;
}
.mt-indicator {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 10px;
  letter-spacing: 0.02em;
}
.mt-ind-feedback   { background: rgba(139,92,246,0.12); color: var(--brand-strong); border: 1px solid var(--brand-border); }
.mt-ind-reflection { background: rgba(96,165,250,0.10); color: var(--info);         border: 1px solid rgba(96,165,250,0.25); }
.mt-ind-pending    { background: rgba(251,191,36,0.10); color: var(--warning);      border: 1px solid rgba(251,191,36,0.3); }

/* ============================================================
   TEAM COMPARISON CHART
   ============================================================ */
.tc-card { margin-top: 22px; }

/* Selector temporal */
.tc-selector {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 4px 0 12px;
}
.tc-custom-fields {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.tc-custom-fields label {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: var(--text-tertiary);
  font-weight: 600;
}
.tc-custom-fields input[type="date"] {
  padding: 5px 8px;
  border-radius: 8px;
  border: 1px solid var(--border-default);
  background: var(--bg-input);
  color: var(--text-secondary);
  font-size: 12px;
  font-family: var(--font-body);
  outline: none;
}
.tc-custom-fields input[type="date"]:focus { border-color: var(--brand-border); }
.tc-custom-error {
  font-size: 11px;
  font-weight: 600;
  color: var(--danger);
}
.tc-custom-error:empty { display: none; }

/* Layout dos columnas: gráfico (~70%) + panel (~30%) */
.tc-main {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(220px, 3fr);
  gap: 18px;
  align-items: start;
}
.tc-chart-col { min-width: 0; }

.tc-chart-wrap {
  width: 100%;
  position: relative;
  overflow-x: auto;
  padding: 4px 0 8px;
}
.tc-hover-zone { cursor: pointer; }
.tc-guide { pointer-events: none; }

/* Tooltip agrupado por bucket temporal (4D.3) */
.tc-group-tooltip {
  position: absolute;
  top: 6px;
  transform: translateX(-50%);
  min-width: 132px;
  max-width: 200px;
  padding: 8px 10px;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-md);
  background: var(--bg-elevated);
  box-shadow: var(--shadow-md);
  z-index: 6;
  pointer-events: none;
}
.tc-group-tooltip.tc-gt-flip  { transform: translateX(-100%); }
.tc-group-tooltip.tc-gt-start { transform: translateX(0); }
.tc-gt-label {
  font-size: 11px; font-weight: 700; color: var(--text-tertiary);
  text-transform: uppercase; letter-spacing: 0.03em;
  margin-bottom: 6px; white-space: nowrap;
}
.tc-gt-row { display: flex; align-items: center; gap: 8px; padding: 2px 0; }
.tc-gt-name {
  flex: 1 1 auto; min-width: 0; font-size: 12px; color: var(--text-primary);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.tc-gt-score {
  flex: 0 0 auto; font-family: var(--font-mono); font-weight: 700; font-size: 12px;
  color: var(--sc-color, var(--text-primary)); font-variant-numeric: tabular-nums;
}

.tc-svg {
  width: 100%;
  max-width: 760px;
  height: auto;
  display: block;
}

/* Panel derecho: Resumen del período */
.tc-panel {
  background: var(--bg-surface-2);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-md);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.tc-panel-head { margin-bottom: 6px; }
.tc-panel-head h3 { font-size: 13px; font-weight: 800; }
.tc-panel-head .dim { display: block; margin-top: 2px; }

.tc-kpi {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 7px 0;
  border-bottom: 1px solid var(--border-subtle);
}
.tc-kpi:last-child { border-bottom: none; }
.tc-kpi-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-tertiary);
  font-weight: 700;
}
.tc-kpi-value {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 6px;
}
.tc-kpi-suffix { font-size: 11px; color: var(--text-tertiary); font-weight: 600; }
.tc-kpi-mini {
  font-size: 12px;
  font-weight: 800;
  font-family: var(--font-mono);
  color: var(--text-secondary);
}
.tc-kpi-mini.up   { color: var(--success); }
.tc-kpi-mini.down { color: var(--danger); }

@media (max-width: 880px) {
  .tc-main { grid-template-columns: 1fr; }
}

.tc-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  padding: 10px 4px 2px;
}

.tc-legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  padding: 3px 8px 3px 5px;
  border-radius: 8px;
  border: 1px solid transparent;
  transition: background .12s, border-color .12s;
  user-select: none;
}
.tc-legend-item:hover { background: var(--bg-elevated); border-color: var(--border-subtle); }
.tc-legend-faded { opacity: 0.35; }

.tc-legend-dot {
  width: 9px; height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ============================================================
   PLAYBOOK COMPENSATION CARD + LOCK BUTTONS
   ============================================================ */
.pb-comp-card {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 12px 14px;
  background: var(--bg-surface-2);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-md);
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.pb-comp-info {
  flex: 1;
  display: grid;
  gap: 3px;
}
.pb-comp-info strong { font-size: 13px; color: var(--text-primary); }

.pb-comp-toggle-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  flex-shrink: 0;
}
.pb-comp-toggle-wrap input[type="checkbox"] { display: none; }

.pb-toggle-track {
  width: 36px; height: 20px;
  border-radius: 10px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  position: relative;
  transition: background .2s, border-color .2s;
}
.pb-toggle-track::after {
  content: "";
  position: absolute;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--text-tertiary);
  top: 2px; left: 2px;
  transition: transform .2s, background .2s;
}
input:checked ~ .pb-toggle-track {
  background: var(--brand-soft);
  border-color: var(--brand-border);
}
input:checked ~ .pb-toggle-track::after {
  transform: translateX(16px);
  background: var(--brand-strong);
}

.pb-comp-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-tertiary);
}
input:checked ~ .pb-comp-label { color: var(--brand-strong); }

.pb-comp-warn {
  width: 100%;
  font-size: 11px;
  color: var(--warning);
  padding: 6px 10px;
  background: var(--warning-soft);
  border: 1px solid var(--warning-border);
  border-radius: var(--r-md);
  margin-top: 4px;
}

/* Lock button per criterion row */
.pb-row-tools {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: center;
  flex-shrink: 0;
}

.pb-lock-btn {
  width: 30px; height: 30px;
  border-radius: 7px;
  border: 1px solid var(--border-subtle);
  background: transparent;
  color: var(--text-dim);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background .12s, border-color .12s, color .12s;
}
.pb-lock-btn svg { width: 13px; height: 13px; }
.pb-lock-btn:hover { border-color: var(--border-default); color: var(--text-secondary); background: var(--bg-elevated); }
.pb-lock-btn.locked {
  border-color: var(--warning-border);
  background: var(--warning-soft);
  color: var(--warning);
}

/* ============================================================
   PLAYBOOK — Versionado (Etapa 4B.1)
   ============================================================ */
.pb-active-card {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 16px 18px;
  margin-bottom: 16px;
  border: 1px solid var(--brand-border);
  border-radius: var(--radius-lg, 14px);
  background: var(--brand-soft);
}
.pb-active-info { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.pb-active-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.pb-active-top .badge { text-transform: none; }
.pb-active-name { font-size: 15px; font-weight: 650; color: var(--text-primary); }
.pb-active-meta { font-size: 12px; color: var(--text-tertiary); }
.pb-active-summary { font-size: 13px; color: var(--text-secondary); margin-top: 2px; max-width: 60ch; }

/* Historial de versiones — accordion compacto (Etapa 4B.1.2) */
.pb-history-panel {
  margin: -6px 0 16px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg, 14px);
  background: var(--bg-surface);
  overflow: hidden;
}
.pb-history-head {
  padding: 10px 14px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-tertiary);
  border-bottom: 1px solid var(--border-subtle);
}
.pb-history-list {
  max-height: 320px;
  overflow-y: auto;
  overflow-x: hidden;
}
.pb-history-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-subtle);
}
.pb-history-item:last-child { border-bottom: 0; }
.pb-history-item.is-active { background: var(--brand-soft); }
.pb-history-main { min-width: 0; flex: 1 1 auto; }
.pb-history-row1 { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pb-history-name { font-weight: 600; font-size: 14px; color: var(--text-primary); }
.pb-history-meta {
  margin-top: 2px;
  font-size: 12px;
  color: var(--text-tertiary);
  white-space: normal;
  overflow-wrap: anywhere;
  max-width: 100%;
}
.pb-history-detail-btn { flex: 0 0 auto; padding: 5px 10px; font-size: 12px; }

/* (legacy) filas verticales del historial — conservadas por compatibilidad */
.pb-history { margin-bottom: 16px; }
.pb-version-main { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.pb-version-name { display: flex; align-items: center; gap: 8px; font-weight: 600; color: var(--text-primary); }
.pb-version-summary { font-size: 13px; color: var(--text-secondary); max-width: 64ch; }
.pb-version-apply {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13px;
  color: var(--text-secondary);
  padding: 12px;
  margin-top: 4px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md, 10px);
  background: var(--bg-surface-2);
}
.pb-version-apply input { margin-top: 2px; accent-color: var(--brand-solid); }

/* Referencia compacta de versión en review / detail */
.rv-pb-version,
.md-pb-version {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-tertiary);
  margin: 4px 0 10px;
}
.rv-pb-version svg,
.md-pb-version svg { width: 14px; height: 14px; opacity: .8; }
.rv-pb-link {
  color: var(--brand-strong);
  text-decoration: none;
  border-bottom: 1px dashed var(--brand-border);
}
.rv-pb-link:hover { color: var(--brand-to); }
.md-pb-version { margin-top: -4px; }

/* Modal "Guardar nueva versión" */
.pb-version-summary-input {
  width: 100%;
  min-height: 84px;
  resize: vertical;
  padding: 10px 12px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md, 10px);
  background: var(--bg-input);
  color: var(--text-primary);
  font: inherit;
  font-size: 13px;
}
.pb-version-summary-input:focus { outline: none; border-color: var(--brand-border); }
.pb-apply-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px;
  margin-top: 12px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md, 10px);
  background: var(--bg-surface-2);
}
.pb-apply-row .pb-apply-text { font-size: 13px; color: var(--text-secondary); }
.pb-apply-row .pb-apply-text strong { color: var(--text-primary); }

/* Banner "Borrador sin guardar" (Restaurar default → borrador baseline) */
.pb-draft-banner {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  margin-bottom: 16px;
  border: 1px solid var(--warning-border);
  border-radius: var(--radius-lg, 14px);
  background: var(--warning-soft);
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.45;
}
.pb-draft-banner svg { width: 16px; height: 16px; flex: 0 0 auto; margin-top: 1px; color: var(--warning); }
.pb-draft-banner strong { color: var(--text-primary); }

/* Tag de versión baseline en historial / detalle */
.pb-baseline-tag { font-size: 11px; font-weight: 500; color: var(--text-tertiary); }

/* Modal "Ver detalle": header fijo + cuerpo con scroll interno */
.pb-detail-modal {
  max-height: calc(100vh - 40px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.pb-detail-hdr { flex: 0 0 auto; }
.pb-detail-body {
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* ── Nombres legibles + lineage + rename (Etapa 4B.1.1) ── */
.pb-version-num { font-size: 12px; font-weight: 500; color: var(--text-tertiary); }
.pb-draft-banner-title { font-weight: 700; color: var(--text-primary); margin-bottom: 2px; }

.pb-detail-lineage {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  font-size: 12px;
  color: var(--text-secondary);
}
.pb-detail-lineage svg { width: 13px; height: 13px; opacity: .8; }
.pb-detail-lineage strong { color: var(--text-primary); }

.pb-detail-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.pb-rename-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.pb-rename-row input {
  flex: 1 1 200px;
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid var(--border-default);
  border-radius: var(--r-md);
  background: var(--bg-input);
  color: var(--text-primary);
  font: inherit;
  font-size: 14px;
}
.pb-rename-row input:focus { outline: none; border-color: var(--brand-border); }

/* Campo read-only "Basado en" del modal de guardado */
.pb-readonly-field {
  color: var(--text-secondary) !important;
  background: var(--bg-surface-2) !important;
  cursor: default;
}
/* Error de campo (nombre obligatorio) */
.pb-field-error { font-size: 12px; color: var(--danger); }
.pb-field-error.hidden { display: none; }

/* ============================================================
   PREVIEW COMPARATIVO DE REANÁLISIS (Etapa 4B.2.A)
   ============================================================ */
.rv-reanalysis-cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin: 4px 0 10px;
  padding: 10px 12px;
  border: 1px solid var(--brand-border);
  border-radius: var(--radius-md, 10px);
  background: var(--brand-soft);
}
.rv-reanalysis-btn { padding: 7px 12px; font-size: 13px; flex: 0 0 auto; }

/* Estado A — Introducción */
.rv-reanalysis-intro { display: flex; flex-direction: column; gap: 10px; }
.rv-reanalysis-intro p { margin: 0; font-size: 13px; color: var(--text-secondary); }
.rv-intro-ver {
  padding: 10px 14px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md, 10px);
  background: var(--bg-surface-2);
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}
.rv-intro-ver-active { border-color: var(--brand-border); background: var(--brand-soft); }
.rv-generate-btn { align-self: flex-start; margin-top: 4px; }

/* Estado B — Procesando (loading IA) */
.rv-reanalysis-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 22px 12px;
  text-align: center;
}
.rv-loading-spinner {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 3px solid var(--brand-soft);
  border-top-color: var(--brand-strong);
  animation: rvSpin 0.8s linear infinite;
}
@keyframes rvSpin { to { transform: rotate(360deg); } }
.rv-loading-title { font-size: 14px; font-weight: 600; color: var(--text-primary); }
.rv-loading-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  max-width: 360px;
}
.rv-loading-steps .rv-step {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-secondary);
  opacity: 0;
  animation: rvStepIn 0.4s ease forwards;
}
.rv-loading-steps .rv-step svg { width: 15px; height: 15px; color: var(--success); }
.rv-step-1 { animation-delay: 0.15s; }
.rv-step-2 { animation-delay: 0.75s; }
.rv-step-3 { animation-delay: 1.35s; }
.rv-step-spin { display: inline-block; color: var(--brand-strong); animation: rvSpin 1s linear infinite; }
@keyframes rvStepIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }

/* Respetar reduce-motion: sin animaciones, contenido visible de inmediato */
@media (prefers-reduced-motion: reduce) {
  .rv-loading-spinner { animation: none; }
  .rv-loading-steps .rv-step { opacity: 1; animation: none; transform: none; }
  .rv-step-spin { animation: none; }
}

/* ── Loader fluido de APLICACIÓN de reanálisis (Etapa 1) ──────────────────── */
.rv-apply-overlay { backdrop-filter: blur(3px); }
.rv-apply-card {
  max-width: 440px;
  width: 100%;
  text-align: center;
  padding: 30px 28px 26px;
  animation: rvApplyCardIn 0.32s ease;
}
@keyframes rvApplyCardIn { from { opacity: 0; transform: translateY(8px) scale(0.98); } to { opacity: 1; transform: none; } }
.rv-apply-spinner {
  width: 40px; height: 40px;
  margin: 0 auto 16px;
  border-radius: 50%;
  border: 3px solid var(--brand-soft);
  border-top-color: var(--brand-strong);
  animation: rvSpin 0.8s linear infinite;
}
.rv-apply-title { font-size: 15px; font-weight: 700; color: var(--text-primary); margin: 0 0 18px; }
.rv-apply-steps {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-direction: column; gap: 10px;
  text-align: left;
}
.rv-apply-step {
  display: flex; align-items: center; gap: 10px;
  font-size: 13.5px;
  transition: color 0.3s ease;
}
.rv-apply-step svg { width: 16px; height: 16px; flex-shrink: 0; }
.rv-apply-step-pending { color: var(--text-tertiary); }
.rv-apply-step-active  { color: var(--text-primary); font-weight: 600; }
.rv-apply-step-done    { color: var(--text-secondary); }
.rv-apply-step-done svg { color: var(--success); }
.rv-apply-dot { display: inline-block; width: 16px; text-align: center; color: var(--text-tertiary); }
.rv-apply-spin { display: inline-block; width: 16px; text-align: center; color: var(--brand-strong); animation: rvSpin 1s linear infinite; }
/* Estado final — éxito */
.rv-apply-done-icon {
  width: 52px; height: 52px;
  margin: 0 auto 14px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: var(--success-soft, rgba(52,211,153,0.16));
  animation: rvApplyDonePop 0.4s ease;
}
.rv-apply-done-icon svg { width: 26px; height: 26px; color: var(--success); }
@keyframes rvApplyDonePop { 0% { transform: scale(0.6); opacity: 0; } 60% { transform: scale(1.08); } 100% { transform: scale(1); opacity: 1; } }
.rv-apply-done-title { font-size: 17px; font-weight: 700; color: var(--text-primary); margin: 0 0 8px; }
.rv-apply-done-text { font-size: 13.5px; color: var(--text-secondary); margin: 0 0 4px; line-height: 1.45; }
.rv-apply-done-sub  { font-size: 12.5px; color: var(--text-tertiary); margin: 0; }

@media (prefers-reduced-motion: reduce) {
  .rv-apply-card,
  .rv-apply-done-icon { animation: none; }
  .rv-apply-spinner,
  .rv-apply-spin { animation: none; }
}

/* Texto de ayuda */
.rv-cmp-help { margin: 8px 0 0; line-height: 1.45; }

/* Dos scorecards independientes (Etapa 4B.2.A.2) */
.rv-sc-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.rv-sc-card {
  min-width: 0;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md, 10px);
  background: var(--bg-surface-2);
  overflow: hidden;
}
.rv-sc-card-active { border-color: var(--brand-border); }
.rv-sc-head {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-subtle);
}
.rv-sc-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-tertiary);
}
.rv-sc-ver { margin-top: 3px; font-size: 13px; font-weight: 600; color: var(--text-primary); }
.rv-sc-list { padding: 4px 0; }
.rv-sc-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border-bottom: 1px solid var(--border-subtle);
}
.rv-sc-row:last-child { border-bottom: 0; }
.rv-sc-crit {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 13px;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
}
.rv-sc-new { font-size: 8px; vertical-align: middle; }
.rv-sc-w { flex: 0 0 auto; font-size: 12px; color: var(--text-tertiary); width: 42px; text-align: right; }
.rv-sc-s { flex: 0 0 auto; font-size: 13px; font-weight: 700; width: 34px; text-align: right; }
.rv-sc-s { color: var(--sc-color, var(--text-primary)); }

@media (max-width: 640px) {
  .rv-sc-grid { grid-template-columns: 1fr; }
}

/* ── Aplicar reanálisis: footer + metadata + confirm + historial (Etapa 4B.2.C.1) ── */
.rv-reanalysis-footer {
  border-top: 1px solid var(--border-subtle);
  padding-top: 14px;
  margin-top: 2px;
}
.rv-reanalysis-meta { margin: 2px 0 8px; }

/* Confirm modal */
.rv-apply-body { display: flex; flex-direction: column; gap: 10px; }
.rv-apply-body p { margin: 0; font-size: 13px; color: var(--text-secondary); }
.rv-apply-ver {
  padding: 10px 14px;
  border: 1px solid var(--brand-border);
  border-radius: var(--radius-md, 10px);
  background: var(--brand-soft);
  font-size: 14px; font-weight: 600; color: var(--text-primary);
}
.rv-apply-scores {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 6px 0;
}
.rv-apply-scores > div { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.rv-apply-lbl { font-size: 11px; text-transform: uppercase; letter-spacing: 0.03em; color: var(--text-tertiary); }
.rv-apply-val { font-size: 22px; font-weight: 800; color: var(--text-primary); }

/* Historial compacto de análisis */
.rv-ah { margin: 4px 0 10px; }
.rv-ah-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: 0;
  padding: 4px 0;
  font: inherit;
  font-size: 12px;
  color: var(--brand-strong);
  cursor: pointer;
}
.rv-ah-toggle svg { width: 13px; height: 13px; }
.rv-ah-panel {
  margin-top: 6px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md, 10px);
  background: var(--bg-surface-2);
  overflow: hidden;
}
.rv-ah-head {
  padding: 8px 12px;
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em;
  color: var(--text-tertiary);
  border-bottom: 1px solid var(--border-subtle);
}
.rv-ah-list { max-height: 220px; overflow-y: auto; overflow-x: hidden; }
.rv-ah-item { padding: 8px 12px; border-bottom: 1px solid var(--border-subtle); }
.rv-ah-item:last-child { border-bottom: 0; }
.rv-ah-meta { font-size: 11px; color: var(--text-tertiary); }
.rv-ah-flow { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 3px; font-size: 13px; }
.rv-ah-ver { color: var(--text-secondary); }
.rv-ah-ver-to { color: var(--text-primary); font-weight: 600; }
.rv-ah-score { font-weight: 700; color: var(--text-secondary); }
.rv-ah-score-to { color: var(--brand-strong); }
.rv-ah-arrow svg { width: 13px; height: 13px; color: var(--text-tertiary); vertical-align: middle; }

.md-pb-meta { color: var(--text-tertiary); }

/* Aviso de simulación */
.rv-sim-note {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid var(--warning-border);
  border-radius: var(--radius-md, 10px);
  background: var(--warning-soft);
  font-size: 13px;
  color: var(--text-secondary);
}
.rv-sim-note svg { width: 16px; height: 16px; flex: 0 0 auto; margin-top: 1px; color: var(--warning); }

/* Resumen comparativo (dos bloques + flecha) */
.rv-cmp-summary {
  display: flex;
  align-items: stretch;
  gap: 12px;
  flex-wrap: wrap;
}
.rv-cmp-block {
  flex: 1 1 220px;
  min-width: 0;
  padding: 12px 14px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md, 10px);
  background: var(--bg-surface-2);
}
.rv-cmp-block-lbl { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-tertiary); }
.rv-cmp-block-ver { margin-top: 4px; font-size: 14px; font-weight: 600; color: var(--text-primary); }
.rv-cmp-block-score { margin-top: 6px; font-size: 13px; color: var(--text-secondary); }
.rv-cmp-block-score strong { font-size: 18px; color: var(--text-primary); }
.rv-cmp-sfx { font-size: 11px; color: var(--text-tertiary); }
.rv-cmp-arrow { display: flex; align-items: center; color: var(--text-tertiary); }
.rv-cmp-arrow svg { width: 18px; height: 18px; }

/* Variación total */
.rv-cmp-delta {
  padding: 8px 12px;
  border-radius: var(--radius-md, 10px);
  font-size: 14px;
  text-align: center;
  background: var(--bg-surface-2);
  border: 1px solid var(--border-subtle);
}
.rv-delta-pos { color: var(--success); }
.rv-delta-neg { color: var(--danger); }
.rv-delta-neu { color: var(--text-secondary); }

/* Tabla comparativa */
.rv-cmp-table-wrap { width: 100%; }
.rv-cmp-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.rv-cmp-table th {
  text-align: left;
  padding: 8px 8px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text-tertiary);
  border-bottom: 1px solid var(--border-default);
}
.rv-cmp-table td {
  padding: 8px 8px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-secondary);
}
.rv-cmp-table td.rv-cmp-crit { color: var(--text-primary); font-weight: 600; }
.rv-cmp-num { text-align: right; white-space: nowrap; }
th.rv-cmp-num { text-align: right; }
.rv-cmp-row.rv-cmp-new td.rv-cmp-crit { color: var(--brand-strong); }
.rv-cmp-row.rv-cmp-removed td { color: var(--text-tertiary); }

/* Responsive: en mobile la tabla se apila (sin scroll horizontal) */
@media (max-width: 640px) {
  .rv-cmp-table thead { display: none; }
  .rv-cmp-table, .rv-cmp-table tbody, .rv-cmp-table tr, .rv-cmp-table td { display: block; width: 100%; }
  .rv-cmp-table tr {
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md, 10px);
    margin-bottom: 8px;
    padding: 8px 12px;
  }
  .rv-cmp-table td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 4px 0;
    border-bottom: 0;
    text-align: right;
  }
  .rv-cmp-table td::before {
    content: attr(data-label);
    color: var(--text-tertiary);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
  }
  .rv-cmp-table td.rv-cmp-crit {
    border-bottom: 1px solid var(--border-subtle);
    margin-bottom: 4px;
    padding-bottom: 6px;
  }
  .rv-cmp-table td.rv-cmp-crit::before { content: ""; }
}

/* ============================================================
   LIFECYCLE — reuniones en vivo / procesando (Etapa 4C.1)
   ============================================================ */
.lc-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.lc-badge.lc-live { color: var(--danger); background: var(--danger-soft); border: 1px solid var(--danger-border); }
.lc-badge.lc-proc { color: var(--info); background: var(--info-soft); border: 1px solid rgba(96,165,250,0.3); }

/* Dot rojo pulsante (recording) */
.lc-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--danger);
  box-shadow: 0 0 0 0 rgba(248,113,113,0.6);
  animation: lcPulse 1.6s ease-out infinite;
}
.lc-dot-lg { width: 14px; height: 14px; }
@keyframes lcPulse {
  0%   { box-shadow: 0 0 0 0 rgba(248,113,113,0.55); }
  70%  { box-shadow: 0 0 0 8px rgba(248,113,113,0); }
  100% { box-shadow: 0 0 0 0 rgba(248,113,113,0); }
}
/* Spinner de procesamiento (ring) */
.lc-spinner {
  width: 11px; height: 11px; border-radius: 50%;
  border: 2px solid rgba(96,165,250,0.35);
  border-top-color: var(--info);
  animation: lcSpin 0.8s linear infinite;
}
@keyframes lcSpin { to { transform: rotate(360deg); } }

/* Card compacta de Actividad en curso (dashboard) */
.lc-activity-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.lc-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px;
  border: 1px solid var(--border-default);
  border-radius: var(--r-md);
  background: var(--bg-surface-2);
}
.lc-card-live { border-color: var(--danger-border); }
.lc-card-proc { border-color: rgba(96,165,250,0.3); }
.lc-card-title { font-size: 14px; font-weight: 650; color: var(--text-primary); }
.lc-card-desc { margin-top: 2px; }
.lc-card-cta { align-self: flex-start; margin-top: 6px; padding: 6px 12px; font-size: 13px; }

/* Card central operativa (Meeting Detail) */
.lc-detail-card { text-align: center; padding: 32px 22px; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.lc-detail-badge { margin-bottom: 4px; }
.lc-capture-icon {
  display: flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--danger-soft); border: 1px solid var(--danger-border);
  color: var(--danger);
}
.lc-capture-icon svg { width: 20px; height: 20px; }
.lc-detail-lead { font-size: 16px; font-weight: 600; color: var(--text-primary); margin: 0; }
.lc-detail-sub { font-size: 13px; margin: 0; max-width: 46ch; }

/* Pasos de procesamiento */
.lc-steps { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; text-align: left; width: 100%; max-width: 360px; }
.lc-step { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-secondary); }
.lc-step svg { width: 15px; height: 15px; color: var(--success); }
.lc-step-active { color: var(--text-primary); }
.lc-step-spin { display: inline-block; color: var(--info); animation: lcSpin 1s linear infinite; }
.lc-step-dot { color: var(--text-tertiary); }
.lc-step-pending { color: var(--text-tertiary); }

/* Filtro lifecycle en meetings list — con etiqueta "Estado del análisis" */
.mt-lc-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
}
.mt-lc-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-tertiary);
  white-space: nowrap;
}
.mt-lc-filters { margin-top: 0; }

/* CTA "Solo demo" en la card operativa */
.lc-demo-cta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border-subtle);
}
.lc-demo-tag { font-size: 9px; }
.lc-demo-btn { padding: 8px 14px; }

/* Barra de progreso de la transición */
.lc-progress {
  width: 100%;
  max-width: 360px;
  height: 6px;
  border-radius: 999px;
  background: var(--bg-surface-2);
  overflow: hidden;
  margin: 6px 0 4px;
}
.lc-progress-bar {
  height: 100%;
  border-radius: 999px;
  background: var(--brand-gradient);
  width: 0%;
  transition: width .55s ease;
}
.lc-trans-card .lc-steps { margin-top: 4px; }

/* Reveal del detalle completo tras completar */
.lc-reveal { animation: lcReveal .5s ease both; }
@keyframes lcReveal { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

@media (max-width: 640px) {
  .lc-activity-grid { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  .lc-dot { animation: none; box-shadow: 0 0 0 2px rgba(248,113,113,0.35); }
  .lc-spinner, .lc-step-spin { animation: none; }
  .lc-progress-bar { transition: none; }
  .lc-reveal { animation: none; }
}

/* ============================================================
   TUTORIAL / AYUDA CONTEXTUAL (Fase 2)
   ============================================================ */
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.tut-help-btn {
  flex: 0 0 auto;
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: 9px;
  background: var(--bg-surface); border: 1px solid var(--border-default);
  color: var(--text-secondary); cursor: pointer;
  transition: border-color .13s, color .13s;
}
.tut-help-btn:hover { border-color: var(--brand-border); color: var(--brand-strong); }
.tut-help-btn .icon { display: inline-flex; align-items: center; justify-content: center; line-height: 0; }
.tut-help-btn svg { width: 17px; height: 17px; display: block; }
.mobile-top-actions { display: flex; align-items: center; gap: 8px; }

.tut-help-menu {
  position: fixed;
  top: 64px; right: 24px;
  z-index: 240;
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  padding: 6px;
  display: flex; flex-direction: column; gap: 2px;
  min-width: 240px;
}
.tut-help-item {
  display: flex; align-items: center; gap: 9px;
  padding: 9px 11px; border-radius: 8px;
  background: transparent; border: none; cursor: pointer;
  color: var(--text-secondary); font-size: 13px; font-weight: 600; text-align: left;
}
.tut-help-item:hover { background: var(--brand-soft); color: var(--brand-strong); }
.tut-help-item svg { width: 15px; height: 15px; flex: 0 0 auto; }

/* z-index por encima de modales de la app (.dl-modal-overlay = 1000) para que la
   guía quede SIEMPRE sobre el modal histórico de Playbook (step 11/13). */
#tut-layer { position: fixed; inset: 0; z-index: 1200; }
/* Montaje "armado": oculto hasta posicionar spotlight+tooltip → evita el flash oscuro
   (backdrop sin tooltip) durante el scroll/reposicionamiento de la transición. */
#tut-layer.tut-arming { visibility: hidden; }
.tut-backdrop { position: fixed; inset: 0; }
.tut-spotlight {
  position: fixed;
  top: 0; left: 0; width: 0; height: 0;
  border-radius: 10px;
  box-shadow: 0 0 0 9999px rgba(6, 6, 12, 0.72);
  pointer-events: none;
}
/* Tooltip guiado: caja compacta anclada al target con caret. */
.tut-box {
  position: fixed;
  width: min(340px, calc(100vw - 24px));
  background: var(--bg-elevated);
  border: 1px solid var(--brand-border);
  border-radius: 14px;
  box-shadow: 0 12px 38px rgba(8, 8, 14, 0.5), 0 0 0 1px rgba(167, 139, 250, 0.10);
  padding: 14px 16px 13px;
}
/* Foco accesible del tooltip integrado a la identidad SalesAId: halo violeta discreto.
   Reemplaza el outline nativo (celeste/azul) que el navegador aplicaba al .tut-box
   enfocado por JS tras navegar — mismo indicador consistente en todas las páginas. */
.tut-box:focus,
.tut-box:focus-visible {
  outline: none;
  box-shadow: 0 12px 38px rgba(8, 8, 14, 0.5), 0 0 0 1px rgba(167, 139, 250, 0.10), 0 0 0 3px rgba(139, 92, 246, 0.5);
}
.tut-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 7px; }
.tut-progress { font-size: 11px; font-weight: 700; color: var(--brand-strong); text-transform: uppercase; letter-spacing: .04em; }
.tut-close {
  flex: 0 0 auto;
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; border-radius: 7px;
  background: transparent; border: none; color: var(--text-tertiary); cursor: pointer;
  transition: background .12s, color .12s;
}
.tut-close:hover { background: var(--bg-surface-2); color: var(--text-secondary); }
.tut-close:focus-visible { outline: none; box-shadow: 0 0 0 2px var(--brand-border); color: var(--brand-strong); }
.tut-close svg { width: 15px; height: 15px; }
.tut-title { font-size: 15.5px; font-weight: 700; color: var(--text-primary); margin-bottom: 4px; line-height: 1.3; }
.tut-desc { font-size: 13px; color: var(--text-secondary); line-height: 1.5; margin-bottom: 13px; }
/* Énfasis declarativo en tooltips (emphasis: [...]) — violeta SalesAId, peso mayor. */
.tut-em { color: var(--brand-strong); font-weight: 600; }
/* Glifo ✦ del marcador IA: pequeño y visualmente elevado, sin romper la lectura. */
.tut-spark { color: var(--brand-strong); font-size: 0.82em; vertical-align: 0.12em; }
/* Lista compacta opcional dentro de la caja (step "Mapa de la plataforma" / "Mapa de tu espacio"). */
.tut-items { list-style: none; margin: -4px 0 13px; padding: 0; display: flex; flex-direction: column; gap: 5px; }
.tut-items li { font-size: 12.5px; line-height: 1.35; color: var(--text-secondary); }
.tut-item-label { color: var(--text-primary); font-weight: 600; }
.tut-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.tut-foot-spacer { flex: 1 1 auto; }
.tut-foot-nav { display: flex; align-items: center; gap: 7px; margin-left: auto; }
.tut-link {
  background: transparent; border: none; cursor: pointer;
  color: var(--text-tertiary); font-size: 12.5px; font-weight: 600; padding: 4px 2px;
  text-decoration: underline; text-underline-offset: 2px;
  transition: color .12s;
}
.tut-link:hover { color: var(--brand-strong); }
.tut-link:focus-visible { outline: none; color: var(--brand-strong); box-shadow: 0 0 0 2px var(--brand-border); border-radius: 5px; }
.tut-btn {
  height: 34px;
  width: auto;                 /* neutraliza el width:100% de .btn-primary */
  margin: 0;                   /* neutraliza el margin-top:24px de .btn-primary (desalineaba Siguiente/Finalizar) */
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0 15px; font-size: 12.5px; line-height: 1; white-space: nowrap;
  vertical-align: middle;
}
/* Caret que conecta la caja con el target. */
.tut-caret {
  position: absolute;
  left: 24px;
  width: 12px; height: 12px;
  background: var(--bg-elevated);
  border: 1px solid var(--brand-border);
  transform: rotate(45deg);
}
.tut-box.tut-place-below .tut-caret { top: -7px; border-right: none; border-bottom: none; }
.tut-box.tut-place-above .tut-caret { bottom: -7px; border-left: none; border-top: none; }
.tut-box.tut-sheet .tut-caret { display: none; }

/* Mobile (<=600px): bottom sheet compacto fijo, sin caret. */
@media (max-width: 600px) {
  .tut-box.tut-sheet {
    top: auto !important;
    left: 12px !important;
    right: 12px;
    bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    width: auto;
    max-width: none;
    max-height: 56vh;
    overflow-y: auto;
    border-radius: 16px;
  }
  .tut-box.tut-sheet .tut-foot { flex-wrap: wrap; gap: 8px; }
  .tut-box.tut-sheet .tut-foot-nav { width: 100%; justify-content: flex-end; }
}

.tut-invite-overlay {
  position: fixed; inset: 0; z-index: 260;
  background: rgba(6, 6, 12, 0.7);
  backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.tut-invite {
  width: min(380px, 100%);
  background: var(--bg-elevated);
  border: 1px solid var(--brand-border);
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  padding: 26px 24px;
  text-align: center;
}
.tut-invite-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 48px; height: 48px; border-radius: 50%;
  background: var(--brand-soft); color: var(--brand-strong);
  margin-bottom: 14px;
}
.tut-invite-icon svg { width: 24px; height: 24px; }
.tut-invite h3 { font-size: 19px; font-weight: 700; margin: 0 0 8px; }
.tut-invite p { font-size: 14px; color: var(--text-secondary); margin: 0 0 20px; line-height: 1.5; }
.tut-invite-actions { display: flex; flex-direction: column; align-items: center; gap: 12px; }
/* Botón principal: conserva gradiente de .btn-primary; ancho equilibrado; sin el margin-top:24px heredado. */
.tut-invite-start { width: 100%; margin-top: 0; }
/* "Ahora no": acción terciaria liviana — sin caja/borde/fondo, una sola línea, hover y focus sutiles. */
.tut-invite-skip {
  border: none; background: none; box-shadow: none;
  padding: 6px 10px; border-radius: 8px;
  font-size: 13px; font-weight: 600; line-height: 1;
  color: var(--text-secondary); cursor: pointer;
  white-space: nowrap;
  transition: color .15s, background .15s;
}
.tut-invite-skip:hover { color: var(--text-primary); background: var(--bg-subtle, rgba(255,255,255,0.04)); }
.tut-invite-skip:focus-visible { outline: 2px solid var(--brand-strong); outline-offset: 2px; }

@media (max-width: 820px) {
  .tut-help-menu { top: 58px; right: 14px; left: 14px; min-width: 0; }
}

/* ── Pipeline activo por vendedor (Fase 3, rediseño compacto) ──────────────── */
.tmpl-team-note { font-size: 12px; color: var(--text-secondary); margin-top: -4px; margin-bottom: 4px; }
.tmpl-risk-note { font-size: 11.5px; color: var(--text-tertiary); margin-bottom: 12px; line-height: 1.4; }
.tmpl-list { display: flex; flex-direction: column; gap: 2px; }
.tmpl-row {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 9px 10px;
  border-radius: 9px;
  cursor: pointer;
  outline: none;
  transition: background .13s;
}
.tmpl-row:hover, .tmpl-row[aria-expanded="true"] { background: var(--bg-surface-2); }
.tmpl-row:focus-visible { box-shadow: 0 0 0 2px var(--brand-border); }
.tmpl-main { display: flex; align-items: center; gap: 12px; }
.tmpl-name {
  flex: 0 0 132px; width: 132px;
  font-size: 13.5px; font-weight: 600; color: var(--text-primary);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.tmpl-row-zero .tmpl-name { color: var(--text-secondary); }
.tmpl-bar {
  flex: 1 1 auto; min-width: 40px;
  height: 8px; border-radius: 999px;
  background: var(--border-subtle); overflow: hidden;
}
.tmpl-bar-empty { background: var(--border-subtle); opacity: 0.55; }
.tmpl-bar-fill {
  height: 100%; border-radius: 999px;
  background: linear-gradient(90deg, #7c5cff, #c084fc);
  transition: width .25s ease;
}
.tmpl-amount { flex: 0 0 auto; font-size: 13.5px; font-weight: 700; color: var(--text-primary); font-variant-numeric: tabular-nums; min-width: 52px; text-align: right; }
.tmpl-row-zero .tmpl-amount { color: var(--text-tertiary); }
.tmpl-amount .money-amount { border-bottom: none; cursor: default; }
.tmpl-zero-note { font-size: 11.5px; color: var(--text-tertiary); padding-left: 1px; }
.tmpl-pop-status { border-top: 1px solid var(--border-subtle); margin-top: 4px; padding-top: 8px; }
.tmpl-pop-status strong { color: var(--brand-strong); }

.tmpl-popover {
  position: fixed;
  z-index: 210;
  width: min(250px, calc(100vw - 28px));
  background: var(--bg-elevated);
  border: 1px solid var(--brand-border);
  border-radius: 12px;
  box-shadow: var(--shadow-md);
  padding: 13px 14px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(3px);
  transition: opacity .13s ease, transform .13s ease;
}
.tmpl-popover.is-open { opacity: 1; pointer-events: auto; transform: translateY(0); }
.tmpl-pop-name { font-size: 13px; font-weight: 700; color: var(--brand-strong); margin-bottom: 9px; }
.tmpl-pop-line { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; font-size: 12.5px; color: var(--text-secondary); padding: 3px 0; }
.tmpl-pop-line strong { color: var(--text-primary); font-weight: 700; font-variant-numeric: tabular-nums; }

@media (max-width: 560px) {
  .tmpl-name { flex-basis: 96px; width: 96px; font-size: 12.5px; }
}

/* ── Perfil de sesión editable (Fase 4) ────────────────────────────────────── */
/* User card premium: cajita sobria con gradiente tenue y borde violeta sutil. */
.user-card-btn {
  display: flex; align-items: center; gap: 10px;
  width: 100%; text-align: left;
  color: var(--text-secondary);
  background:
    linear-gradient(135deg, rgba(124, 92, 255, 0.10) 0%, rgba(192, 132, 252, 0.05) 100%),
    var(--bg-surface);
  border: 1px solid var(--brand-border);
  border-radius: 12px; padding: 9px 10px; margin-top: auto; cursor: pointer;
  transition: background .14s, border-color .14s, box-shadow .14s;
}
.user-card-btn:hover {
  border-color: var(--brand-strong);
  box-shadow: 0 0 0 1px rgba(167, 139, 250, 0.18), 0 6px 18px rgba(124, 92, 255, 0.12);
}
.user-card-btn:focus-visible {
  outline: none;
  border-color: var(--brand-strong);
  box-shadow: 0 0 0 2px var(--bg-base), 0 0 0 4px var(--brand-border);
}
.user-card-btn .user-info { flex: 1 1 auto; min-width: 0; }
.user-card-chevron { display: inline-flex; color: var(--text-tertiary); flex: 0 0 auto; transition: color .14s; }
.user-card-btn:hover .user-card-chevron { color: var(--brand-strong); }
.user-card-chevron svg { width: 15px; height: 15px; }

.profile-modal-lock { overflow: hidden; }
.profile-overlay {
  position: fixed; inset: 0; z-index: 220;
  background: rgba(6, 6, 12, 0.72);
  backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  padding: 18px;
}
.profile-modal {
  width: min(520px, 100%);
  max-height: calc(100vh - 36px);
  overflow-y: auto;
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
}
.profile-modal .dl-edit-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 20px 12px;
}
.profile-modal .dl-edit-head h2 { font-size: 18px; font-weight: 700; margin: 0; }
.profile-modal .dl-edit-close {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: 8px;
  background: transparent; border: none; color: var(--text-secondary); cursor: pointer;
}
.profile-modal .dl-edit-close:hover { background: var(--bg-surface-2); color: var(--text-primary); }
.profile-modal .dl-edit-close svg { width: 18px; height: 18px; }
.profile-body { padding: 4px 20px 8px; display: flex; flex-direction: column; gap: 12px; }
.profile-avatar-row { display: flex; align-items: center; gap: 14px; margin-bottom: 4px; }
.profile-avatar-row .avatar.lg {
  width: 52px; height: 52px; font-size: 18px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; border-radius: 14px; color: #fff; flex: 0 0 auto;
}
.profile-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.profile-field { display: flex; flex-direction: column; gap: 5px; font-size: 12px; font-weight: 600; color: var(--text-secondary); }
.profile-field input {
  background: var(--bg-surface); border: 1px solid var(--border-default);
  border-radius: 9px; padding: 9px 11px; color: var(--text-primary); font-size: 14px; font-weight: 500; outline: none;
}
.profile-field input:focus { border-color: var(--brand-strong); }
.profile-field input:disabled { color: var(--text-tertiary); background: var(--bg-base); cursor: not-allowed; }
.profile-error {
  background: rgba(248, 113, 113, 0.12); border: 1px solid rgba(248, 113, 113, 0.4);
  color: var(--danger); font-size: 12.5px; font-weight: 600; padding: 9px 12px; border-radius: 9px;
}
.profile-footer {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 14px 20px 18px;
}
.profile-footer-right { display: flex; gap: 8px; }

@media (max-width: 560px) {
  .profile-grid { grid-template-columns: 1fr; }
}

/* Perfil — sección read-only "Información de la organización" + botones uniformes */
.profile-org {
  margin-top: 4px;
  padding: 13px 14px;
  border-radius: 11px;
  background: var(--bg-base);
  border: 1px solid var(--border-subtle);
}
.profile-org-title {
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
  color: var(--text-tertiary); margin-bottom: 11px;
}
.profile-org-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 11px 16px; }
.profile-org-field { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.profile-org-label { font-size: 11px; color: var(--text-tertiary); }
.profile-org-value { font-size: 13.5px; font-weight: 600; color: var(--text-secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-btn {
  height: 38px;
  width: auto;                 /* neutraliza el width:100% de .btn-primary */
  margin: 0;                   /* neutraliza el margin-top:24px de .btn-primary */
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0 16px; font-size: 13px; line-height: 1; white-space: nowrap;
  border-radius: 9px;          /* radio consistente entre los 3 */
}
/* Restablecer: acción terciaria discreta, separada del grupo derecho pero armónica. */
.profile-btn-tertiary {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-tertiary);
  padding: 0 10px;
}
.profile-btn-tertiary:hover { color: var(--text-secondary); background: var(--bg-surface-2); }
.profile-footer { align-items: center; }
@media (max-width: 560px) {
  .profile-org-grid { grid-template-columns: 1fr; }
  .profile-footer { flex-wrap: wrap; gap: 8px; }
  .profile-footer-right { flex: 1 1 100%; justify-content: flex-end; }
}

/* Login — fila de dos columnas (nombre/apellido) + botón autofill + error */
.auth-card .form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.auth-card .form-row .form-group { margin-bottom: 0; }
.login-autofill { width: 100%; margin-top: 8px; }
.login-error {
  background: rgba(248, 113, 113, 0.12); border: 1px solid rgba(248, 113, 113, 0.4);
  color: var(--danger); font-size: 12.5px; font-weight: 600; padding: 8px 11px; border-radius: 9px; margin-bottom: 12px;
}
@media (max-width: 420px) {
  .auth-card .form-row { grid-template-columns: 1fr; gap: 0; }
  .auth-card .form-row .form-group { margin-bottom: 14px; }
}
