/* ═══════════════════════════════════════════════════════════
   LEADSHUNTER — Sistema visual
   Instrumento de trabajo, no folleto: densidad alta, datos en
   monoespaciada, una sola nota de color para la señal.
   ═══════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Archivo:wght@500;600;700;800&family=Public+Sans:ital,wght@0,400;0,500;0,600;1,400&family=JetBrains+Mono:wght@400;500;700&display=swap');

:root {
  /* Paleta */
  --tinta:      #12161C;
  --tinta-2:    #1B222B;
  --tinta-3:    #2A333F;
  --lienzo:     #F1F3F0;
  --papel:      #FFFFFF;
  --caza:       #0B7A5C;   /* señal / acción */
  --caza-claro: #E4F2ED;
  --caza-hover: #096349;
  --brasa:      #B45309;   /* aviso */
  --brasa-claro:#FCF0E2;
  --sangre:     #B4231C;   /* error / perdido */
  --sangre-claro:#FBEAE9;
  --cielo:      #1D4ED8;
  --cielo-claro:#E8EDFC;
  --linea:      #E2E6E0;
  --linea-2:    #CFD5CC;
  --texto:      #12161C;
  --texto-2:    #5E6862;
  --texto-3:    #8A938C;

  /* Tipografía */
  --display: 'Archivo', 'Helvetica Neue', sans-serif;
  --cuerpo:  'Public Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --dato:    'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  /* Métrica */
  --r:    8px;
  --r-sm: 5px;
  --sombra:    0 1px 2px rgba(18,22,28,.06), 0 1px 3px rgba(18,22,28,.05);
  --sombra-md: 0 4px 12px rgba(18,22,28,.08), 0 2px 4px rgba(18,22,28,.04);
  --sombra-lg: 0 16px 40px rgba(18,22,28,.16);
  --nav-w: 240px;
  --transicion: 140ms cubic-bezier(.4,0,.2,1);
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--cuerpo);
  font-size: 14px;
  line-height: 1.55;
  color: var(--texto);
  background: var(--lienzo);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5 { font-family: var(--display); font-weight: 700; letter-spacing: -.02em; line-height: 1.2; }
h1 { font-size: 24px; }
h2 { font-size: 19px; }
h3 { font-size: 16px; }
h4 { font-size: 14px; }

a { color: var(--caza); text-decoration: none; }
a:hover { text-decoration: underline; }

code, .dato, .mono { font-family: var(--dato); font-variant-numeric: tabular-nums; }

::selection { background: var(--caza); color: #fff; }

:focus-visible { outline: 2px solid var(--caza); outline-offset: 2px; border-radius: 3px; }

/* ── Estructura ──────────────────────────────────────── */
.capa { display: flex; min-height: 100vh; }

.nav {
  width: var(--nav-w);
  flex: 0 0 var(--nav-w);
  background: var(--tinta);
  color: #A8B2AC;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.nav__marca {
  display: flex; align-items: center; gap: 9px;
  padding: 18px 18px 16px;
  border-bottom: 1px solid rgba(255,255,255,.07);
}
.nav__marca-txt { font-family: var(--display); font-weight: 800; font-size: 17px; color: #fff; letter-spacing: -.03em; }
.nav__marca-txt span { color: var(--caza); }

.nav__cuenta {
  padding: 11px 18px;
  border-bottom: 1px solid rgba(255,255,255,.07);
  font-size: 12px;
}
.nav__cuenta-nom { color: #E6EBE8; font-weight: 600; display: block; }
.nav__cuenta-plan { color: var(--texto-3); font-family: var(--dato); font-size: 10px; text-transform: uppercase; letter-spacing: .06em; }

.nav__grupo { padding: 14px 0 4px; }
.nav__titulo {
  font-family: var(--dato); font-size: 10px; font-weight: 500;
  text-transform: uppercase; letter-spacing: .1em;
  color: #5A6560; padding: 0 18px 7px;
}

.nav a.nav__item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 18px;
  color: #A8B2AC; font-size: 13.5px; font-weight: 500;
  border-left: 2px solid transparent;
  transition: var(--transicion);
  text-decoration: none;
}
.nav a.nav__item:hover { background: rgba(255,255,255,.045); color: #fff; text-decoration: none; }
.nav a.nav__item.activo { background: rgba(11,122,92,.14); color: #fff; border-left-color: var(--caza); }
.nav__item svg { width: 16px; height: 16px; flex: 0 0 16px; stroke-width: 1.9; }
.nav__contador {
  margin-left: auto; font-family: var(--dato); font-size: 10px; font-weight: 700;
  background: var(--sangre); color: #fff; padding: 1px 6px; border-radius: 20px;
}

.nav__pie { margin-top: auto; padding: 12px; border-top: 1px solid rgba(255,255,255,.07); }
.nav__yo { display: flex; align-items: center; gap: 9px; padding: 6px; border-radius: var(--r-sm); }
.nav__yo:hover { background: rgba(255,255,255,.05); }
.nav__yo-nom { font-size: 12.5px; color: #E6EBE8; font-weight: 600; line-height: 1.25; }
.nav__yo-rol { font-size: 10.5px; color: var(--texto-3); font-family: var(--dato); text-transform: uppercase; letter-spacing: .05em; }

/* Nav modo superadmin: cambia la temperatura para que nunca confundas dónde estás */
.nav--admin { background: #16120E; }
.nav--admin .nav__marca-txt span { color: var(--brasa); }
.nav--admin a.nav__item.activo { background: rgba(180,83,9,.16); border-left-color: var(--brasa); }

/* ── Contenido ───────────────────────────────────────── */
.principal { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.barra {
  height: 56px; background: var(--papel); border-bottom: 1px solid var(--linea);
  display: flex; align-items: center; gap: 14px; padding: 0 22px;
  position: sticky; top: 0; z-index: 40;
}
.barra h1 { font-size: 17px; }
.barra__crumb { font-size: 12px; color: var(--texto-3); font-family: var(--dato); }
.barra__der { margin-left: auto; display: flex; align-items: center; gap: 8px; }

.contenido { padding: 22px; flex: 1; max-width: 1560px; width: 100%; }

.rejilla { display: grid; gap: 14px; }
.rejilla--2 { grid-template-columns: repeat(2, 1fr); }
.rejilla--3 { grid-template-columns: repeat(3, 1fr); }
.rejilla--4 { grid-template-columns: repeat(4, 1fr); }
.rejilla--12 { grid-template-columns: repeat(12, 1fr); }
.col-8 { grid-column: span 8; } .col-4 { grid-column: span 4; }
.col-6 { grid-column: span 6; } .col-3 { grid-column: span 3; }

/* ── Tarjetas ────────────────────────────────────────── */
.tarjeta { background: var(--papel); border: 1px solid var(--linea); border-radius: var(--r); box-shadow: var(--sombra); }
.tarjeta__cab {
  padding: 13px 16px; border-bottom: 1px solid var(--linea);
  display: flex; align-items: center; gap: 10px;
}
.tarjeta__cab h3 { font-size: 14px; }
.tarjeta__cab .der { margin-left: auto; display: flex; gap: 6px; align-items: center; }
.tarjeta__cuerpo { padding: 16px; }
.tarjeta__pie { padding: 11px 16px; border-top: 1px solid var(--linea); background: #FAFBFA; border-radius: 0 0 var(--r) var(--r); }

/* ── KPI ─────────────────────────────────────────────── */
.kpi { background: var(--papel); border: 1px solid var(--linea); border-radius: var(--r); padding: 15px 16px; position: relative; overflow: hidden; }
.kpi__label { font-family: var(--dato); font-size: 10px; text-transform: uppercase; letter-spacing: .09em; color: var(--texto-3); font-weight: 500; }
.kpi__valor { font-family: var(--display); font-size: 28px; font-weight: 800; letter-spacing: -.035em; margin-top: 5px; line-height: 1; font-variant-numeric: tabular-nums; }
.kpi__pie { font-size: 11.5px; color: var(--texto-2); margin-top: 6px; display: flex; align-items: center; gap: 5px; }
.kpi__delta { font-family: var(--dato); font-size: 11px; font-weight: 700; }
.kpi__delta--sube { color: var(--caza); }
.kpi__delta--baja { color: var(--sangre); }
.kpi--acento::after { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--caza); }

/* ── Botones ─────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 7px 13px; border-radius: var(--r-sm);
  font-family: var(--cuerpo); font-size: 13px; font-weight: 600;
  border: 1px solid var(--linea-2); background: var(--papel); color: var(--texto);
  cursor: pointer; transition: var(--transicion); white-space: nowrap; text-decoration: none;
}
.btn:hover { background: #F7F8F6; border-color: var(--texto-3); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; transform: none; }
.btn svg { width: 15px; height: 15px; stroke-width: 2; }

.btn--principal { background: var(--caza); border-color: var(--caza); color: #fff; }
.btn--principal:hover { background: var(--caza-hover); border-color: var(--caza-hover); }
.btn--oscuro { background: var(--tinta); border-color: var(--tinta); color: #fff; }
.btn--oscuro:hover { background: var(--tinta-2); border-color: var(--tinta-2); }
.btn--peligro { background: var(--sangre); border-color: var(--sangre); color: #fff; }
.btn--peligro:hover { background: #96190F; }
.btn--fantasma { background: transparent; border-color: transparent; color: var(--texto-2); }
.btn--fantasma:hover { background: rgba(18,22,28,.05); color: var(--texto); }
.btn--sm { padding: 4px 9px; font-size: 12px; }
.btn--sm svg { width: 13px; height: 13px; }
.btn--lg { padding: 10px 18px; font-size: 14px; }
.btn--bloque { width: 100%; }

/* ── Formularios ─────────────────────────────────────── */
.campo { margin-bottom: 13px; }
.campo label, .etiqueta {
  display: block; font-size: 12px; font-weight: 600; color: var(--texto-2);
  margin-bottom: 5px; letter-spacing: .01em;
}
.campo__ayuda { font-size: 11.5px; color: var(--texto-3); margin-top: 4px; }

input[type=text], input[type=email], input[type=password], input[type=number],
input[type=date], input[type=datetime-local], input[type=url], input[type=search],
select, textarea {
  width: 100%; padding: 8px 10px;
  border: 1px solid var(--linea-2); border-radius: var(--r-sm);
  font-family: var(--cuerpo); font-size: 13.5px; color: var(--texto);
  background: var(--papel); transition: var(--transicion);
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--caza); box-shadow: 0 0 0 3px rgba(11,122,92,.12);
}
input::placeholder, textarea::placeholder { color: var(--texto-3); }
input:disabled, select:disabled, textarea:disabled { background: #F4F5F3; color: var(--texto-3); cursor: not-allowed; }
textarea { resize: vertical; min-height: 76px; line-height: 1.5; }
select { appearance: none; background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%235E6862' stroke-width='2.5'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 9px center; padding-right: 28px; }

.fila { display: flex; gap: 11px; }
.fila > * { flex: 1; min-width: 0; }

.check { display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: 13px; }
.check input { width: 15px; height: 15px; accent-color: var(--caza); cursor: pointer; }

/* ── Tablas ──────────────────────────────────────────── */
.tabla-envoltura { overflow-x: auto; border-radius: var(--r); }
table.tabla { width: 100%; border-collapse: collapse; font-size: 13px; }
.tabla thead th {
  background: #FAFBFA; text-align: left; padding: 8px 12px;
  font-family: var(--dato); font-size: 10px; font-weight: 500;
  text-transform: uppercase; letter-spacing: .08em; color: var(--texto-3);
  border-bottom: 1px solid var(--linea); white-space: nowrap; position: sticky; top: 0; z-index: 2;
}
.tabla tbody td { padding: 9px 12px; border-bottom: 1px solid var(--linea); vertical-align: middle; }
.tabla tbody tr { transition: background var(--transicion); }
.tabla tbody tr:hover { background: #FAFBF9; }
.tabla tbody tr:last-child td { border-bottom: none; }
.tabla .num { font-family: var(--dato); text-align: right; font-variant-numeric: tabular-nums; }
.tabla .acciones { text-align: right; white-space: nowrap; }
.tabla a.enlace-fuerte { color: var(--texto); font-weight: 600; }
.tabla a.enlace-fuerte:hover { color: var(--caza); }

/* ── Insignias ───────────────────────────────────────── */
.insignia {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 7px; border-radius: 20px;
  font-family: var(--dato); font-size: 10px; font-weight: 500;
  text-transform: uppercase; letter-spacing: .05em; white-space: nowrap;
  background: #EEF0ED; color: var(--texto-2);
}
.insignia--ok      { background: var(--caza-claro); color: var(--caza); }
.insignia--aviso   { background: var(--brasa-claro); color: var(--brasa); }
.insignia--peligro { background: var(--sangre-claro); color: var(--sangre); }
.insignia--info    { background: var(--cielo-claro); color: var(--cielo); }
.insignia--neutro  { background: #EEF0ED; color: var(--texto-2); }
.insignia__punto { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }

/* ── SIGNATURE: medidor de verificación ──────────────
   Tres segmentos = tres niveles de evidencia. El elemento
   por el que se recuerda el producto: nunca muestres un
   lead sin decir cuánta evidencia real lo sostiene.        */
.medidor { display: inline-flex; align-items: center; gap: 6px; }
.medidor__barras { display: flex; gap: 2px; }
.medidor__seg { width: 13px; height: 5px; border-radius: 1px; background: var(--linea-2); }
.medidor__txt { font-family: var(--dato); font-size: 10px; text-transform: uppercase; letter-spacing: .05em; font-weight: 500; }

.medidor--verificado .medidor__seg { background: var(--caza); }
.medidor--verificado .medidor__txt { color: var(--caza); }
.medidor--parcial .medidor__seg:nth-child(-n+2) { background: var(--brasa); }
.medidor--parcial .medidor__txt { color: var(--brasa); }
.medidor--sin_verificar .medidor__seg:nth-child(1) { background: var(--sangre); }
.medidor--sin_verificar .medidor__txt { color: var(--sangre); }

/* Puntaje del lead */
.score { display: inline-flex; align-items: center; gap: 6px; }
.score__n { font-family: var(--dato); font-size: 12px; font-weight: 700; width: 24px; text-align: right; }
.score__pista { width: 44px; height: 4px; background: var(--linea); border-radius: 2px; overflow: hidden; }
.score__relleno { height: 100%; background: var(--caza); border-radius: 2px; transition: width .3s; }
.score--bajo .score__relleno { background: var(--sangre); }
.score--medio .score__relleno { background: var(--brasa); }

/* ── Avatares ────────────────────────────────────────── */
.avatar {
  width: 28px; height: 28px; border-radius: 50%; flex: 0 0 28px;
  background: var(--caza); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--dato); font-size: 10.5px; font-weight: 700; letter-spacing: -.02em;
}
.avatar--sm { width: 22px; height: 22px; flex-basis: 22px; font-size: 9px; }
.avatar--lg { width: 40px; height: 40px; flex-basis: 40px; font-size: 14px; }
.avatar--gris { background: var(--tinta-3); }

/* ── Alertas ─────────────────────────────────────────── */
.alerta {
  padding: 10px 13px; border-radius: var(--r-sm); font-size: 13px;
  margin-bottom: 14px; border: 1px solid; display: flex; gap: 9px; align-items: flex-start;
}
.alerta--ok    { background: var(--caza-claro); border-color: #B9DDD1; color: #06503C; }
.alerta--error { background: var(--sangre-claro); border-color: #F0C4C1; color: #8A1B14; }
.alerta--info  { background: var(--cielo-claro); border-color: #C3D0F5; color: #17359B; }
.alerta--aviso { background: var(--brasa-claro); border-color: #F0D6AE; color: #8A3F07; }

/* ── Estado vacío ────────────────────────────────────── */
.vacio { text-align: center; padding: 48px 22px; color: var(--texto-2); }
.vacio__icono { width: 40px; height: 40px; margin: 0 auto 12px; color: var(--linea-2); stroke-width: 1.5; }
.vacio h3 { font-size: 15px; margin-bottom: 5px; color: var(--texto); }
.vacio p { font-size: 13px; max-width: 380px; margin: 0 auto 16px; }

/* ── Pestañas ────────────────────────────────────────── */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--linea); margin-bottom: 16px; overflow-x: auto; }
.tabs a, .tabs button {
  padding: 8px 13px; font-size: 13px; font-weight: 600; color: var(--texto-2);
  border: none; background: none; cursor: pointer; border-bottom: 2px solid transparent;
  margin-bottom: -1px; white-space: nowrap; font-family: var(--cuerpo); text-decoration: none;
}
.tabs a:hover, .tabs button:hover { color: var(--texto); text-decoration: none; }
.tabs a.activo, .tabs button.activo { color: var(--caza); border-bottom-color: var(--caza); }

/* ── Kanban ──────────────────────────────────────────── */
.kanban { display: flex; gap: 11px; overflow-x: auto; padding-bottom: 12px; align-items: flex-start; }
.columna {
  flex: 0 0 282px; background: #E9ECE7; border-radius: var(--r);
  display: flex; flex-direction: column; max-height: calc(100vh - 190px);
}
.columna__cab { padding: 10px 12px; display: flex; align-items: center; gap: 7px; border-bottom: 1px solid var(--linea-2); }
.columna__punto { width: 7px; height: 7px; border-radius: 50%; flex: 0 0 7px; }
.columna__nom { font-size: 12.5px; font-weight: 700; font-family: var(--display); }
.columna__n { font-family: var(--dato); font-size: 10.5px; color: var(--texto-3); background: rgba(255,255,255,.7); padding: 1px 6px; border-radius: 10px; }
.columna__monto { margin-left: auto; font-family: var(--dato); font-size: 11px; font-weight: 700; color: var(--texto-2); }
.columna__lista { padding: 9px; overflow-y: auto; flex: 1; min-height: 70px; display: flex; flex-direction: column; gap: 8px; }
.columna__lista.sobre { background: rgba(11,122,92,.07); box-shadow: inset 0 0 0 2px var(--caza); border-radius: var(--r-sm); }

.ficha {
  background: var(--papel); border: 1px solid var(--linea); border-radius: var(--r-sm);
  padding: 10px; cursor: grab; box-shadow: var(--sombra); transition: var(--transicion);
}
.ficha:hover { box-shadow: var(--sombra-md); border-color: var(--linea-2); }
.ficha.arrastrando { opacity: .4; transform: rotate(1.5deg); }
.ficha__emp { font-weight: 700; font-size: 13px; line-height: 1.3; margin-bottom: 3px; }
.ficha__emp a { color: var(--texto); }
.ficha__nec { font-size: 11.5px; color: var(--texto-2); line-height: 1.4; margin-bottom: 8px; }
.ficha__pie { display: flex; align-items: center; gap: 7px; }
.ficha__monto { font-family: var(--dato); font-size: 11.5px; font-weight: 700; }
.ficha__meta { margin-left: auto; display: flex; align-items: center; gap: 5px; }
.ficha__alerta { color: var(--sangre); }

/* ── Timeline ────────────────────────────────────────── */
.linea-tiempo { position: relative; padding-left: 26px; }
.linea-tiempo::before { content: ''; position: absolute; left: 8px; top: 5px; bottom: 5px; width: 1px; background: var(--linea); }
.hito { position: relative; padding-bottom: 16px; }
.hito__punto {
  position: absolute; left: -22px; top: 3px; width: 15px; height: 15px; border-radius: 50%;
  background: var(--papel); border: 2px solid var(--linea-2);
  display: flex; align-items: center; justify-content: center;
}
.hito__punto svg { width: 8px; height: 8px; stroke-width: 3; }
.hito__punto--email { border-color: var(--cielo); color: var(--cielo); }
.hito__punto--llamada { border-color: var(--caza); color: var(--caza); }
.hito__punto--nota { border-color: var(--texto-3); color: var(--texto-3); }
.hito__punto--cambio_etapa { border-color: var(--brasa); color: var(--brasa); }
.hito__cab { display: flex; align-items: baseline; gap: 8px; margin-bottom: 2px; }
.hito__titulo { font-size: 13px; font-weight: 600; }
.hito__fecha { font-family: var(--dato); font-size: 10.5px; color: var(--texto-3); margin-left: auto; }
.hito__cuerpo { font-size: 12.5px; color: var(--texto-2); line-height: 1.5; white-space: pre-wrap; }

/* ── Chat del agente ─────────────────────────────────── */
.chat { display: flex; flex-direction: column; height: calc(100vh - 100px); background: var(--papel); border: 1px solid var(--linea); border-radius: var(--r); overflow: hidden; }
.chat__hilo { flex: 1; overflow-y: auto; padding: 20px; scroll-behavior: smooth; }
.burbuja { max-width: 780px; margin: 0 auto 18px; display: flex; gap: 11px; }
.burbuja__cuerpo { flex: 1; min-width: 0; font-size: 14px; line-height: 1.65; }
.burbuja__cuerpo h2 { font-size: 17px; margin: 14px 0 7px; }
.burbuja__cuerpo h3 { font-size: 15px; margin: 14px 0 6px; }
.burbuja__cuerpo h4 { font-size: 13.5px; margin: 12px 0 5px; color: var(--texto-2); }
.burbuja__cuerpo ul { margin: 7px 0 7px 18px; }
.burbuja__cuerpo li { margin-bottom: 3px; }
.burbuja__cuerpo code { background: #F1F3F0; padding: 1px 5px; border-radius: 3px; font-size: 12.5px; }
.burbuja--yo .burbuja__cuerpo { background: #F4F6F3; border: 1px solid var(--linea); padding: 11px 13px; border-radius: var(--r); }

.chat__pie { border-top: 1px solid var(--linea); padding: 12px 20px; background: var(--papel); }
.compositor { max-width: 780px; margin: 0 auto; }
.compositor__caja { display: flex; gap: 9px; align-items: flex-end; border: 1px solid var(--linea-2); border-radius: var(--r); padding: 7px; background: var(--papel); transition: var(--transicion); }
.compositor__caja:focus-within { border-color: var(--caza); box-shadow: 0 0 0 3px rgba(11,122,92,.1); }
.compositor textarea { border: none; resize: none; min-height: 38px; max-height: 190px; padding: 5px 7px; font-size: 14px; }
.compositor textarea:focus { box-shadow: none; }
.compositor__pistas { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 9px; }
.pista { font-size: 11.5px; padding: 4px 9px; border: 1px solid var(--linea); border-radius: 20px; background: var(--papel); cursor: pointer; color: var(--texto-2); transition: var(--transicion); }
.pista:hover { border-color: var(--caza); color: var(--caza); background: var(--caza-claro); }
.compositor__nota { font-size: 11px; color: var(--texto-3); text-align: center; margin-top: 7px; font-family: var(--dato); }

/* Radar: el agente está buscando de verdad, y se nota */
.radar { display: flex; align-items: center; gap: 9px; color: var(--texto-2); font-size: 13px; padding: 4px 0; }
.radar__anillo { width: 15px; height: 15px; border-radius: 50%; border: 2px solid var(--caza); position: relative; flex: 0 0 15px; }
.radar__anillo::after {
  content: ''; position: absolute; inset: -2px; border-radius: 50%;
  border: 2px solid var(--caza); animation: pulso 1.5s ease-out infinite;
}
@keyframes pulso { 0% { transform: scale(1); opacity: .8; } 100% { transform: scale(2.1); opacity: 0; } }

.chat__pasos { font-family: var(--dato); font-size: 11px; color: var(--texto-3); margin-top: 5px; }

/* Tarjeta de lead dentro del chat */
.lead-chip {
  border: 1px solid var(--linea); border-radius: var(--r); padding: 12px; margin: 9px 0;
  background: var(--papel); box-shadow: var(--sombra);
}
.lead-chip__cab { display: flex; align-items: flex-start; gap: 9px; margin-bottom: 7px; }
.lead-chip__emp { font-family: var(--display); font-weight: 700; font-size: 14px; }
.lead-chip__meta { font-size: 11.5px; color: var(--texto-3); font-family: var(--dato); }
.lead-chip__nec { font-size: 12.5px; color: var(--texto-2); line-height: 1.5; margin-bottom: 9px; }
.lead-chip__datos { display: flex; flex-wrap: wrap; gap: 5px 12px; font-size: 11.5px; margin-bottom: 10px; }
.lead-chip__dato { display: flex; gap: 4px; align-items: center; color: var(--texto-2); }
.lead-chip__dato svg { width: 12px; height: 12px; color: var(--texto-3); }
.lead-chip__pie { display: flex; align-items: center; gap: 7px; padding-top: 9px; border-top: 1px solid var(--linea); }
.lead-chip__motivos { font-size: 11px; color: var(--brasa); margin-top: 6px; line-height: 1.45; }

/* ── Modal ───────────────────────────────────────────── */
.modal-fondo {
  position: fixed; inset: 0; background: rgba(18,22,28,.5); z-index: 100;
  display: flex; align-items: center; justify-content: center; padding: 18px;
  backdrop-filter: blur(2px); animation: aparecer .12s ease-out;
}
@keyframes aparecer { from { opacity: 0; } to { opacity: 1; } }
.modal {
  background: var(--papel); border-radius: var(--r); box-shadow: var(--sombra-lg);
  width: 100%; max-width: 540px; max-height: 90vh; display: flex; flex-direction: column;
  animation: subir .16s cubic-bezier(.2,.9,.3,1);
}
@keyframes subir { from { transform: translateY(10px) scale(.99); opacity: 0; } to { transform: none; opacity: 1; } }
.modal--ancho { max-width: 860px; }
.modal__cab { padding: 15px 18px; border-bottom: 1px solid var(--linea); display: flex; align-items: center; }
.modal__cab h3 { flex: 1; }
.modal__cuerpo { padding: 18px; overflow-y: auto; flex: 1; }
.modal__pie { padding: 13px 18px; border-top: 1px solid var(--linea); display: flex; justify-content: flex-end; gap: 8px; background: #FAFBFA; }

/* ── Toast ───────────────────────────────────────────── */
#toasts { position: fixed; bottom: 18px; right: 18px; z-index: 200; display: flex; flex-direction: column; gap: 8px; }
.toast {
  background: var(--tinta); color: #fff; padding: 10px 15px; border-radius: var(--r-sm);
  font-size: 13px; box-shadow: var(--sombra-lg); animation: entrar .18s ease-out;
  display: flex; align-items: center; gap: 8px; max-width: 340px;
}
@keyframes entrar { from { transform: translateX(20px); opacity: 0; } to { transform: none; opacity: 1; } }
.toast--ok { background: var(--caza); }
.toast--error { background: var(--sangre); }

/* ── Barras de progreso ──────────────────────────────── */
.progreso { height: 5px; background: var(--linea); border-radius: 3px; overflow: hidden; }
.progreso__relleno { height: 100%; background: var(--caza); border-radius: 3px; transition: width .4s ease; }
.progreso__relleno--aviso { background: var(--brasa); }
.progreso__relleno--peligro { background: var(--sangre); }

/* ── Login ───────────────────────────────────────────── */
.acceso { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.acceso__lado { background: var(--tinta); color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.acceso__lado::after {
  content: ''; position: absolute; right: -140px; bottom: -140px; width: 400px; height: 400px;
  border-radius: 50%; border: 1px solid rgba(11,122,92,.4);
  box-shadow: 0 0 0 60px rgba(11,122,92,.05), 0 0 0 120px rgba(11,122,92,.03);
}
.acceso__lema { font-family: var(--display); font-size: 34px; font-weight: 800; letter-spacing: -.04em; line-height: 1.1; max-width: 420px; position: relative; z-index: 1; }
.acceso__lema em { color: var(--caza); font-style: normal; }
.acceso__sub { color: #8A938C; font-size: 14px; margin-top: 14px; max-width: 380px; position: relative; z-index: 1; }
.acceso__form { display: flex; align-items: center; justify-content: center; padding: 40px; background: var(--papel); }
.acceso__caja { width: 100%; max-width: 350px; }

/* ── Utilidades ──────────────────────────────────────── */
.flex { display: flex; } .items-c { align-items: center; } .just-b { justify-content: space-between; }
.gap-4 { gap: 4px; } .gap-6 { gap: 6px; } .gap-8 { gap: 8px; } .gap-12 { gap: 12px; }
.ml-auto { margin-left: auto; } .mt-8 { margin-top: 8px; } .mt-16 { margin-top: 16px; } .mb-8 { margin-bottom: 8px; } .mb-16 { margin-bottom: 16px; }
.txt-2 { color: var(--texto-2); } .txt-3 { color: var(--texto-3); }
.xs { font-size: 11.5px; } .sm { font-size: 12.5px; }
.b { font-weight: 700; } .sb { font-weight: 600; }
.der { text-align: right; } .cen { text-align: center; }
.oculto { display: none !important; }
.cortar { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wrap { flex-wrap: wrap; }
.pill-fuente { font-family: var(--dato); font-size: 10px; color: var(--texto-3); }

/* ── Filtros ─────────────────────────────────────────── */
.filtros { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.filtros input, .filtros select { width: auto; min-width: 130px; padding: 6px 9px; font-size: 12.5px; }
.filtros .buscar { min-width: 240px; }

/* ── Paginación ──────────────────────────────────────── */
.paginacion { display: flex; gap: 4px; justify-content: center; padding: 14px; align-items: center; }
.paginacion a, .paginacion span {
  padding: 5px 10px; border-radius: var(--r-sm); font-family: var(--dato); font-size: 12px;
  border: 1px solid var(--linea); color: var(--texto-2); background: var(--papel);
}
.paginacion a:hover { border-color: var(--caza); color: var(--caza); text-decoration: none; }
.paginacion .actual { background: var(--caza); border-color: var(--caza); color: #fff; }

/* ── Responsive ──────────────────────────────────────── */
.nav__hamburguesa { display: none; }

@media (max-width: 1100px) {
  .rejilla--4 { grid-template-columns: repeat(2, 1fr); }
  .col-8, .col-4, .col-6, .col-3 { grid-column: span 12; }
}

@media (max-width: 860px) {
  .nav {
    position: fixed; left: 0; top: 0; bottom: 0; z-index: 90;
    transform: translateX(-100%); transition: transform .22s ease;
  }
  .nav.abierta { transform: none; box-shadow: var(--sombra-lg); }
  .nav__hamburguesa { display: inline-flex; }
  .contenido { padding: 14px; }
  .barra { padding: 0 14px; }
  .rejilla--2, .rejilla--3, .rejilla--4 { grid-template-columns: 1fr; }
  .acceso { grid-template-columns: 1fr; }
  .acceso__lado { display: none; }
  .fila { flex-direction: column; gap: 0; }
  .chat { height: calc(100vh - 76px); border-radius: 0; border-left: none; border-right: none; }
  .kpi__valor { font-size: 24px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

@media print {
  .nav, .barra, .btn, .filtros { display: none !important; }
  .contenido { padding: 0; }
  .tarjeta { border: 1px solid #ddd; box-shadow: none; }
}
