/* Reseñas Pro — hoja de estilos del panel */

:root {
  --bg: #f4f5f9;
  --surface: #ffffff;
  --surface-2: #f8f9fc;
  --surface-3: #eef0f6;
  --border: #e3e6ee;
  --border-strong: #cdd2de;
  --text: #0f172a;
  --text-2: #475569;
  --text-3: #8a94a8;
  --primary: #4f46e5;
  --primary-hover: #4338ca;
  --primary-soft: #eef2ff;
  --primary-text: #3730a3;
  --success: #15803d;
  --success-soft: #dcfce7;
  --warning: #b45309;
  --warning-soft: #fef3c7;
  --danger: #dc2626;
  --danger-soft: #fee2e2;
  --info: #0369a1;
  --info-soft: #e0f2fe;
  --star: #f59e0b;
  --wa: #25d366;
  --wa-hover: #1db955;
  --wa-bubble: #d9fdd3;
  --wa-bg: #efeae2;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .06);
  --shadow: 0 1px 3px rgba(15, 23, 42, .07), 0 6px 16px rgba(15, 23, 42, .04);
  --shadow-lg: 0 20px 50px rgba(15, 23, 42, .22);
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --sidebar: 248px;
  --font: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b1020;
    --surface: #121829;
    --surface-2: #161d31;
    --surface-3: #1d253b;
    --border: #262f47;
    --border-strong: #36405c;
    --text: #e8ebf4;
    --text-2: #a6afc6;
    --text-3: #6f7a96;
    --primary: #818cf8;
    --primary-hover: #a5b4fc;
    --primary-soft: rgba(129, 140, 248, .14);
    --primary-text: #c7d2fe;
    --success: #4ade80;
    --success-soft: rgba(74, 222, 128, .13);
    --warning: #fbbf24;
    --warning-soft: rgba(251, 191, 36, .13);
    --danger: #f87171;
    --danger-soft: rgba(248, 113, 113, .13);
    --info: #38bdf8;
    --info-soft: rgba(56, 189, 248, .13);
    --wa-bubble: #144d37;
    --wa-bg: #0b141a;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
    --shadow: 0 1px 3px rgba(0, 0, 0, .4), 0 6px 16px rgba(0, 0, 0, .25);
    --shadow-lg: 0 20px 50px rgba(0, 0, 0, .55);
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; letter-spacing: -.01em; }
h1 { font-size: 22px; font-weight: 700; }
h2 { font-size: 17px; font-weight: 650; }
h3 { font-size: 15px; font-weight: 650; }
p { margin: 0; }
code, .mono { font-family: var(--mono); font-size: 12.5px; }
[hidden] { display: none !important; }
button { font: inherit; color: inherit; }
svg.ico { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
svg.ico-sm { width: 15px; height: 15px; }
svg.ico-lg { width: 22px; height: 22px; }
svg.ico-relleno { fill: currentColor; stroke: none; }
.girar { animation: girar 1s linear infinite; }
@keyframes girar { to { transform: rotate(360deg); } }

/* ───────── Layout ───────── */

.app { display: flex; min-height: 100vh; }
.sidebar {
  position: fixed; inset: 0 auto 0 0; z-index: 40;
  width: var(--sidebar);
  display: flex; flex-direction: column;
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 18px 14px;
  overflow-y: auto;
}
.marca { display: flex; align-items: center; gap: 10px; padding: 4px 8px 18px; }
.marca-logo {
  width: 34px; height: 34px; border-radius: 10px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, #fbbf24, #f97316);
  color: #fff; box-shadow: 0 4px 12px rgba(249, 115, 22, .35);
}
.marca-logo svg { width: 19px; height: 19px; }
.marca-nombre { font-weight: 750; font-size: 16px; letter-spacing: -.02em; }
.marca-nombre span { color: var(--primary); }

.selector-negocio { margin: 0 4px 14px; }
.selector-negocio label { display: block; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--text-3); margin: 0 0 4px 2px; }
.negocio-actual { padding: 10px 12px; margin: 0 4px 14px; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--border); }
.negocio-actual .etiqueta { font-size: 11px; color: var(--text-3); text-transform: uppercase; letter-spacing: .05em; font-weight: 600; }
.negocio-actual .nombre { font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-seccion { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); padding: 14px 12px 6px; }
.nav a {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 12px; border-radius: var(--radius-sm);
  color: var(--text-2); font-weight: 550;
  text-decoration: none;
}
.nav a:hover { background: var(--surface-3); color: var(--text); }
.nav a.activo { background: var(--primary-soft); color: var(--primary-text); }
.nav a .contador { margin-left: auto; font-size: 11.5px; font-weight: 700; background: var(--primary); color: #fff; border-radius: 99px; padding: 1px 7px; }

.sidebar-pie { margin-top: auto; padding-top: 14px; border-top: 1px solid var(--border); }
.usuario-mini { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: var(--radius-sm); }
.usuario-mini .datos { min-width: 0; flex: 1; }
.usuario-mini .nombre { font-weight: 600; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.usuario-mini .rol { font-size: 12px; color: var(--text-3); }

.principal { flex: 1; min-width: 0; margin-left: var(--sidebar); display: flex; flex-direction: column; }
.topbar-movil { display: none; }
.contenido { padding: 28px 32px 110px; max-width: 1280px; width: 100%; margin: 0 auto; }
.fondo-menu { display: none; }

@media (max-width: 960px) {
  .sidebar { transform: translateX(-100%); transition: transform .22s ease; box-shadow: var(--shadow-lg); }
  .app.menu-abierto .sidebar { transform: none; }
  .app.menu-abierto .fondo-menu { display: block; position: fixed; inset: 0; z-index: 39; background: rgba(15, 23, 42, .45); }
  .principal { margin-left: 0; }
  .topbar-movil {
    display: flex; align-items: center; gap: 10px;
    position: sticky; top: 0; z-index: 30;
    padding: 10px 16px; background: var(--surface); border-bottom: 1px solid var(--border);
  }
  .topbar-movil .marca { padding: 0; }
  .contenido { padding: 20px 16px 140px; }
}

/* ───────── Encabezados de página ───────── */

.pagina-cabecera { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.pagina-cabecera .sub { color: var(--text-2); margin-top: 4px; }
.acciones { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ───────── Botones ───────── */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 38px; padding: 0 15px;
  border-radius: var(--radius-sm); border: 1px solid var(--border-strong);
  background: var(--surface); color: var(--text);
  font-weight: 600; font-size: 13.5px; white-space: nowrap;
  cursor: pointer; text-decoration: none;
  transition: background .12s, border-color .12s, box-shadow .12s, transform .05s;
}
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:focus-visible, .input:focus-visible, .switch input:focus-visible + span { outline: 3px solid color-mix(in srgb, var(--primary) 35%, transparent); outline-offset: 1px; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.btn-primario { background: var(--primary); border-color: var(--primary); color: #fff; box-shadow: 0 1px 2px rgba(79, 70, 229, .3); }
.btn-primario:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.btn-wa { background: var(--wa); border-color: var(--wa); color: #06331d; }
.btn-wa:hover { background: var(--wa-hover); border-color: var(--wa-hover); }
.btn-peligro { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 40%, var(--border)); }
.btn-peligro:hover { background: var(--danger-soft); }
.btn-peligro-solido { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-fantasma { border-color: transparent; background: transparent; color: var(--text-2); }
.btn-fantasma:hover { background: var(--surface-3); color: var(--text); }
.btn-sm { height: 32px; padding: 0 11px; font-size: 13px; }
.btn-lg { height: 46px; padding: 0 22px; font-size: 15px; }
.btn-bloque { width: 100%; }
.btn-icono { width: 34px; height: 34px; padding: 0; border-color: transparent; background: transparent; color: var(--text-2); }
.btn-icono:hover { background: var(--surface-3); color: var(--text); }
.enlace-boton { background: none; border: 0; padding: 0; color: var(--primary); font-weight: 600; cursor: pointer; }
.enlace-boton:hover { text-decoration: underline; }

/* ───────── Formularios ───────── */

.campo { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.campo > label, .etiqueta-campo { font-weight: 600; font-size: 13px; }
.campo .ayuda, .ayuda { font-size: 12.5px; color: var(--text-3); }
.campo .opcional { font-weight: 400; color: var(--text-3); }
.input, .select, .textarea {
  width: 100%; height: 40px; padding: 0 12px;
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text);
  font: inherit; font-size: 14px;
  transition: border-color .12s, box-shadow .12s;
}
.textarea { height: auto; min-height: 110px; padding: 10px 12px; resize: vertical; line-height: 1.5; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 18%, transparent); }
.input[disabled], .select[disabled], .textarea[disabled] { background: var(--surface-2); color: var(--text-2); }
.input-error { border-color: var(--danger) !important; }
.error-campo { color: var(--danger); font-size: 12.5px; }
.select { appearance: none; padding-right: 34px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238a94a8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; }
.fila-campos { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 0 16px; }
.input-grupo { display: flex; gap: 8px; }
.input-grupo .input { flex: 1; min-width: 0; }
.buscador { position: relative; }
.buscador svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--text-3); pointer-events: none; }
.buscador .input { padding-left: 36px; }
.check { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; font-size: 13.5px; }
.check input { width: 17px; height: 17px; margin: 1px 0 0; accent-color: var(--primary); flex: none; }
.check .sub { color: var(--text-3); font-size: 12.5px; display: block; }
input[type="checkbox"].casilla { width: 17px; height: 17px; accent-color: var(--primary); cursor: pointer; margin: 0; vertical-align: middle; }

/* Interruptor */
.switch { position: relative; display: inline-flex; width: 44px; height: 25px; flex: none; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: inherit; z-index: 1; }
.switch span {
  position: absolute; inset: 0; border-radius: 99px;
  background: var(--border-strong); transition: background .18s;
}
.switch span::after {
  content: ""; position: absolute; top: 3px; left: 3px;
  width: 19px; height: 19px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25);
  transition: transform .18s;
}
.switch input:checked + span { background: var(--wa); }
.switch input:checked + span::after { transform: translateX(19px); }
.switch input:disabled { cursor: not-allowed; }
.switch input:disabled + span { opacity: .55; }
.switch input:checked:disabled + span { opacity: .75; }
.switch.cargando span::after { animation: pulso .8s ease-in-out infinite alternate; }
@keyframes pulso { from { opacity: 1; } to { opacity: .4; } }
.switch-fila { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 0; }
.switch-fila .texto { font-weight: 600; }
.switch-fila .sub { color: var(--text-3); font-size: 12.5px; font-weight: 400; }

/* ───────── Tarjetas ───────── */

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.card-cuerpo { padding: 20px; }
.card-cabecera { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.card-cabecera .sub { color: var(--text-3); font-size: 13px; margin-top: 2px; }
.card-pie { padding: 14px 20px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 8px; background: var(--surface-2); border-radius: 0 0 var(--radius) var(--radius); }
.rejilla { display: grid; gap: 16px; }
.rejilla-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.rejilla-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.rejilla-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1100px) { .rejilla-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 760px) { .rejilla-2, .rejilla-3 { grid-template-columns: 1fr; } }
@media (max-width: 480px) { .rejilla-4 { grid-template-columns: 1fr 1fr; gap: 10px; } }
.separador { height: 1px; background: var(--border); margin: 18px 0; border: 0; }
.mt { margin-top: 16px; }
.mt-lg { margin-top: 24px; }
.mb { margin-bottom: 16px; }
.texto-2 { color: var(--text-2); }
.texto-3 { color: var(--text-3); }
.centro { text-align: center; }
.derecha { text-align: right; }
.fuerte { font-weight: 650; }
.nowrap { white-space: nowrap; }
.flex { display: flex; align-items: center; gap: 8px; }
.flex-entre { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.envolver { flex-wrap: wrap; }

/* KPIs */
.kpi { padding: 18px 20px; }
.kpi .etiqueta { display: flex; align-items: center; gap: 8px; color: var(--text-2); font-weight: 600; font-size: 13px; }
.kpi .etiqueta .ico-caja { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; }
.kpi .valor { font-size: 30px; font-weight: 750; letter-spacing: -.03em; margin-top: 10px; line-height: 1.1; }
.kpi .detalle { color: var(--text-3); font-size: 12.5px; margin-top: 4px; }
.tono-primario { background: var(--primary-soft); color: var(--primary); }
.tono-verde { background: var(--success-soft); color: var(--success); }
.tono-ambar { background: var(--warning-soft); color: var(--warning); }
.tono-rojo { background: var(--danger-soft); color: var(--danger); }
.tono-azul { background: var(--info-soft); color: var(--info); }
@media (max-width: 480px) { .kpi { padding: 14px; } .kpi .valor { font-size: 24px; } }

/* ───────── Insignias ───────── */

.badge {
  display: inline-flex; align-items: center; gap: 5px;
  height: 24px; padding: 0 9px; border-radius: 99px;
  font-size: 12px; font-weight: 650; white-space: nowrap;
  background: var(--surface-3); color: var(--text-2);
}
.badge svg { width: 13px; height: 13px; }
.badge-gris { background: var(--surface-3); color: var(--text-2); }
.badge-azul { background: var(--info-soft); color: var(--info); }
.badge-verde { background: var(--success-soft); color: var(--success); }
.badge-ambar { background: var(--warning-soft); color: var(--warning); }
.badge-rojo { background: var(--danger-soft); color: var(--danger); }
.badge-primario { background: var(--primary-soft); color: var(--primary-text); }
.badge-oscuro { background: var(--text); color: var(--surface); }

/* ───────── Pestañas / píldoras ───────── */

.pildoras { display: flex; gap: 6px; flex-wrap: wrap; }
.pildora {
  display: inline-flex; align-items: center; gap: 7px;
  height: 34px; padding: 0 13px; border-radius: 99px;
  border: 1px solid var(--border); background: var(--surface);
  color: var(--text-2); font-weight: 600; font-size: 13px; cursor: pointer; white-space: nowrap;
}
.pildora:hover { border-color: var(--border-strong); color: var(--text); }
.pildora .num { font-size: 12px; color: var(--text-3); font-weight: 650; }
.pildora.activa { background: var(--text); border-color: var(--text); color: var(--surface); }
.pildora.activa .num { color: inherit; opacity: .7; }
.pestanas { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 22px; overflow-x: auto; scrollbar-width: none; }
.pestanas::-webkit-scrollbar { display: none; }
.pestana {
  padding: 10px 14px; border: 0; background: none; cursor: pointer; white-space: nowrap;
  color: var(--text-2); font-weight: 600; border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.pestana:hover { color: var(--text); }
.pestana.activa { color: var(--primary); border-bottom-color: var(--primary); }

/* ───────── Tablas ───────── */

.tabla-caja { overflow-x: auto; }
.tabla { width: 100%; border-collapse: collapse; }
.tabla th {
  text-align: left; font-size: 12px; font-weight: 650; text-transform: uppercase; letter-spacing: .04em;
  color: var(--text-3); padding: 11px 12px; border-bottom: 1px solid var(--border); background: var(--surface-2);
  white-space: nowrap;
}
.tabla th:first-child { border-top-left-radius: var(--radius); }
.tabla th:last-child { border-top-right-radius: var(--radius); }
.tabla td { padding: 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.tabla tr:last-child td { border-bottom: 0; }
.tabla tbody tr.clicable { cursor: pointer; }
.tabla tbody tr.clicable:hover td { background: var(--surface-2); }
.tabla tbody tr.seleccionada td { background: var(--primary-soft); }
.tabla .col-check { width: 44px; padding-right: 0; }
.tabla .col-accion { width: 50px; text-align: right; }
.tabla .sub { color: var(--text-3); font-size: 12.5px; }
.celda-cliente { display: flex; align-items: center; gap: 11px; min-width: 150px; }
.tabla .col-visita { white-space: nowrap; }
.tabla .col-estado .sub { max-width: 190px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.celda-cliente .nombre { font-weight: 600; }
.avatar {
  width: 36px; height: 36px; border-radius: 50%; flex: none;
  display: grid; place-items: center; font-weight: 700; font-size: 13px;
  color: #fff; background: var(--primary);
}
.avatar-lg { width: 52px; height: 52px; font-size: 18px; }

/* Lista de clientes en móvil: tarjetas */
@media (max-width: 760px) {
  .tabla-clientes thead { display: none; }
  .tabla-clientes, .tabla-clientes tbody { display: block; }
  .tabla-clientes tr {
    display: grid; grid-template-columns: 28px 1fr auto; grid-template-areas: "chk cli sw" "chk est menu";
    gap: 6px 10px; padding: 14px; border-bottom: 1px solid var(--border);
  }
  .tabla-clientes td { padding: 0; border: 0; }
  .tabla-clientes .col-check { grid-area: chk; width: auto; }
  .tabla-clientes .col-cliente { grid-area: cli; }
  .tabla-clientes .col-visita { display: none; }
  .tabla-clientes .col-estado { grid-area: est; }
  .tabla-clientes .col-switch { grid-area: sw; }
  .tabla-clientes .col-accion { grid-area: menu; width: auto; }
  .tabla-clientes tr:last-child { border-bottom: 0; }
  .celda-cliente { min-width: 0; }
}

.barra-herramientas { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; margin-bottom: 14px; }
.barra-herramientas .buscador { width: min(320px, 100%); }
.barra-masiva {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 10px 14px; border-radius: var(--radius);
  background: var(--text); color: var(--surface);
  position: fixed; z-index: 50; bottom: 20px; left: calc(var(--sidebar) + 32px); right: 32px;
  max-width: 1216px; margin: 0 auto;
  box-shadow: var(--shadow-lg); animation: entrar .18s ease;
}
@media (max-width: 960px) { .barra-masiva { left: 16px; right: 16px; bottom: 16px; } }
body:has(.barra-masiva) .avisos { bottom: 96px; }
.barra-masiva .btn { height: 32px; font-size: 13px; background: transparent; color: var(--surface); border-color: color-mix(in srgb, var(--surface) 30%, transparent); }
.barra-masiva .btn:hover { background: color-mix(in srgb, var(--surface) 12%, transparent); }
.barra-masiva .btn-wa { background: var(--wa); color: #06331d; border-color: var(--wa); }
.barra-masiva .enlace-boton { color: var(--surface); text-decoration: underline; }
.barra-masiva .espacio { flex: 1; }

.paginacion { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 4px 0; color: var(--text-2); flex-wrap: wrap; }
.paginacion .flex { gap: 6px; }

/* Estado vacío y carga */
.vacio { text-align: center; padding: 52px 20px; color: var(--text-2); }
.vacio .ico-vacio { width: 56px; height: 56px; margin: 0 auto 14px; border-radius: 16px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); }
.vacio .ico-vacio svg { width: 26px; height: 26px; }
.vacio h3 { color: var(--text); margin-bottom: 6px; }
.vacio p { max-width: 420px; margin: 0 auto 18px; }
.cargando-bloque { display: grid; place-items: center; padding: 60px; color: var(--text-3); }
.esqueleto { background: linear-gradient(90deg, var(--surface-3), var(--surface-2), var(--surface-3)); background-size: 200% 100%; animation: brillo 1.2s infinite; border-radius: 6px; }
@keyframes brillo { to { background-position: -200% 0; } }

/* ───────── Avisos (toasts) ───────── */

.avisos { position: fixed; right: 20px; bottom: 20px; z-index: 100; display: flex; flex-direction: column; gap: 10px; max-width: min(420px, calc(100vw - 32px)); }
.aviso {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 12px 12px 14px; border-radius: var(--radius);
  background: var(--text); color: var(--surface); box-shadow: var(--shadow-lg);
  animation: entrar .2s ease;
}
.aviso-texto { flex: 1; padding-top: 1px; }
.aviso-icono { padding-top: 1px; }
.aviso-exito .aviso-icono { color: #4ade80; }
.aviso-error .aviso-icono { color: #f87171; }
.aviso-info .aviso-icono { color: #93c5fd; }
.aviso-accion { background: none; border: 0; color: #fbbf24; font-weight: 700; cursor: pointer; padding: 1px 4px; white-space: nowrap; }
.aviso-cerrar { background: none; border: 0; color: inherit; opacity: .6; cursor: pointer; padding: 0; display: flex; }
.aviso-cerrar:hover { opacity: 1; }
@keyframes entrar { from { transform: translateY(8px); opacity: 0; } }
@media (max-width: 760px) { .avisos { left: 16px; right: 16px; bottom: 16px; max-width: none; } }

/* ───────── Modal y panel lateral ───────── */

.velo {
  position: fixed; inset: 0; z-index: 80;
  background: rgba(15, 23, 42, .5);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 7vh 16px 16px; overflow-y: auto;
  animation: aparecer .15s ease;
}
@keyframes aparecer { from { opacity: 0; } }
.modal { width: 100%; max-width: 520px; background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); animation: entrar .2s ease; }
.modal-lg { max-width: 760px; }
.modal-sm { max-width: 420px; }
.modal-cabecera { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 20px 14px; }
.modal-cuerpo { padding: 4px 20px 20px; }
.modal-pie { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 var(--radius-lg) var(--radius-lg); flex-wrap: wrap; }

.velo-lateral { justify-content: flex-end; padding: 0; align-items: stretch; }
.panel-lateral {
  width: min(480px, 100vw); height: 100vh; overflow-y: auto;
  background: var(--surface); box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column;
  animation: deslizar .22s ease;
}
@keyframes deslizar { from { transform: translateX(40px); opacity: 0; } }
.panel-lateral .modal-cabecera { position: sticky; top: 0; background: var(--surface); z-index: 2; border-bottom: 1px solid var(--border); padding-bottom: 16px; }
.panel-lateral .modal-cuerpo { padding-top: 18px; flex: 1; }

/* ───────── Alertas en línea ───────── */

.alerta { display: flex; gap: 12px; align-items: flex-start; padding: 13px 15px; border-radius: var(--radius); border: 1px solid; font-size: 13.5px; }
.alerta svg { margin-top: 1px; }
.alerta-info { background: var(--info-soft); border-color: color-mix(in srgb, var(--info) 25%, transparent); color: var(--text); }
.alerta-info > svg { color: var(--info); }
.alerta-aviso { background: var(--warning-soft); border-color: color-mix(in srgb, var(--warning) 25%, transparent); }
.alerta-aviso > svg { color: var(--warning); }
.alerta-error { background: var(--danger-soft); border-color: color-mix(in srgb, var(--danger) 25%, transparent); }
.alerta-error > svg { color: var(--danger); }
.alerta-exito { background: var(--success-soft); border-color: color-mix(in srgb, var(--success) 25%, transparent); }
.alerta-exito > svg { color: var(--success); }
.alerta .titulo { font-weight: 650; margin-bottom: 2px; }

/* ───────── Checklist de inicio ───────── */

.pasos { display: grid; gap: 10px; }
.paso { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.paso .circulo { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; flex: none; font-weight: 700; font-size: 13px; background: var(--surface-3); color: var(--text-2); }
.paso.hecho .circulo { background: var(--success); color: #fff; }
.paso.hecho .titulo { color: var(--text-2); text-decoration: line-through; text-decoration-color: var(--text-3); }
.paso .titulo { font-weight: 650; }
.paso .texto { flex: 1; min-width: 0; }
.paso .sub { color: var(--text-3); font-size: 12.5px; }
.progreso { height: 8px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.progreso > div { height: 100%; background: linear-gradient(90deg, var(--primary), #8b5cf6); border-radius: 99px; transition: width .3s; }

/* Gráfica */
.grafica { width: 100%; height: auto; display: block; }
.grafica .barra-env { fill: var(--primary); opacity: .85; }
.grafica .barra-clic { fill: var(--star); }
.grafica .eje { stroke: var(--border); }
.grafica text { fill: var(--text-3); font-size: 11px; font-family: var(--font); }
.leyenda { display: flex; gap: 6px 16px; flex-wrap: wrap; justify-content: flex-end; font-size: 12.5px; color: var(--text-2); }
.leyenda span { white-space: nowrap; }
.leyenda i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.embudo { display: grid; gap: 12px; }
.embudo-fila .flex-entre { font-size: 13px; margin-bottom: 5px; }
.embudo-barra { height: 10px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.embudo-barra > div { height: 100%; border-radius: 99px; }

/* ───────── WhatsApp: vista previa ───────── */

.wa-telefono {
  background: var(--wa-bg); border-radius: var(--radius); padding: 18px 14px;
  background-image: radial-gradient(color-mix(in srgb, var(--text-3) 18%, transparent) 1px, transparent 1px);
  background-size: 16px 16px;
}
.wa-burbuja {
  position: relative; max-width: 88%; margin-left: auto;
  background: var(--wa-bubble); color: var(--text);
  padding: 8px 10px 20px; border-radius: 10px 0 10px 10px;
  box-shadow: 0 1px 1px rgba(0, 0, 0, .12);
  white-space: pre-wrap; word-break: break-word; font-size: 14px; line-height: 1.45;
}
.wa-burbuja.recibida { margin-left: 0; margin-right: auto; background: var(--surface); border-radius: 0 10px 10px 10px; }
.wa-burbuja .hora { position: absolute; right: 8px; bottom: 4px; font-size: 11px; color: var(--text-3); }
.wa-burbuja .pie { color: var(--text-3); font-size: 12.5px; margin-top: 6px; }
.wa-boton { display: flex; align-items: center; justify-content: center; gap: 6px; margin: 6px -10px -20px; padding: 10px; border-top: 1px solid color-mix(in srgb, var(--text-3) 25%, transparent); color: #1f8fd6; font-weight: 600; font-size: 14px; }
.wa-burbuja a { color: #1f8fd6; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { height: 28px; padding: 0 10px; border-radius: 99px; border: 1px dashed var(--border-strong); background: var(--surface-2); font-family: var(--mono); font-size: 12px; cursor: pointer; color: var(--text-2); }
.chip:hover { border-color: var(--primary); color: var(--primary); }

/* Selector de modo */
.opciones-modo { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 760px) { .opciones-modo { grid-template-columns: 1fr; } }
.opcion-modo { position: relative; display: block; padding: 16px; border: 2px solid var(--border); border-radius: var(--radius); cursor: pointer; background: var(--surface); }
.opcion-modo:hover { border-color: var(--border-strong); }
.opcion-modo input { position: absolute; opacity: 0; }
.opcion-modo:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); }
.opcion-modo .titulo { font-weight: 700; display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.opcion-modo p { color: var(--text-2); font-size: 13px; }
.opcion-modo .etiquetas { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }

/* ───────── Importador ───────── */

.zona-soltar {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  min-height: 210px; padding: 28px; text-align: center;
  border: 2px dashed var(--border-strong); border-radius: var(--radius);
  background: var(--surface-2); cursor: pointer; transition: border-color .15s, background .15s;
}
.zona-soltar:hover, .zona-soltar.arrastrando { border-color: var(--primary); background: var(--primary-soft); }
.zona-soltar .ico-vacio { width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; background: var(--surface); color: var(--primary); box-shadow: var(--shadow-sm); }
.zona-soltar .ico-vacio svg { width: 24px; height: 24px; }
.mapeo { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.mapeo .campo { margin: 0; }
.mapeo .ejemplo { font-size: 12px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pasos-import { display: flex; gap: 8px; align-items: center; margin-bottom: 20px; color: var(--text-3); font-weight: 600; font-size: 13px; flex-wrap: wrap; }
.pasos-import .activo { color: var(--primary); }
.pasos-import .hecho { color: var(--success); }
.resumen-num { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; }
.resumen-num > div { padding: 14px; border-radius: var(--radius); background: var(--surface-2); border: 1px solid var(--border); }
.resumen-num .n { font-size: 24px; font-weight: 750; }
.resumen-num .t { color: var(--text-2); font-size: 12.5px; }

/* Línea de tiempo */
.linea-tiempo { display: grid; gap: 0; }
.evento { display: grid; grid-template-columns: 22px 1fr; gap: 10px; padding-bottom: 16px; position: relative; }
.evento::before { content: ""; position: absolute; left: 10px; top: 22px; bottom: 0; width: 2px; background: var(--border); }
.evento:last-child::before { display: none; }
.evento .punto { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-3); color: var(--text-2); }
.evento .punto svg { width: 12px; height: 12px; }

/* Clave / código copiable */
.copiable { display: flex; align-items: center; gap: 8px; padding: 8px 8px 8px 12px; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--border); font-family: var(--mono); font-size: 12.5px; word-break: break-all; }
.copiable span { flex: 1; }
pre.codigo { margin: 0; padding: 14px; border-radius: var(--radius-sm); background: #0f172a; color: #e2e8f0; font-family: var(--mono); font-size: 12.5px; overflow-x: auto; line-height: 1.6; }

/* Menú contextual */
.menu-flotante {
  position: fixed; z-index: 90; min-width: 210px; padding: 6px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg);
  animation: aparecer .1s ease;
}
.menu-flotante button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border: 0; background: none; border-radius: 7px; cursor: pointer; text-align: left; font-weight: 550; color: var(--text); }
.menu-flotante button:hover { background: var(--surface-3); }
.menu-flotante button.peligro { color: var(--danger); }
.menu-flotante hr { border: 0; height: 1px; background: var(--border); margin: 5px 0; }

/* ───────── Login ───────── */

.login { min-height: 100vh; display: grid; grid-template-columns: 1.05fr 1fr; }
.login-marca {
  position: relative; overflow: hidden;
  display: flex; flex-direction: column; justify-content: center; gap: 22px;
  padding: 56px; color: #fff;
  background: radial-gradient(circle at 20% 20%, #6366f1 0%, transparent 55%), radial-gradient(circle at 85% 80%, #f97316 0%, transparent 50%), #1e1b4b;
}
.login-marca h1 { font-size: 36px; font-weight: 800; letter-spacing: -.03em; max-width: 480px; }
.login-marca p { font-size: 16px; opacity: .85; max-width: 440px; }
.login-marca .marca-nombre span { color: #fbbf24; }
.login-demo { max-width: 360px; display: grid; gap: 10px; margin-top: 10px; }
.login-demo .wa-burbuja { background: #fff; color: #111; margin: 0; max-width: 100%; border-radius: 0 12px 12px 12px; }
.login-demo .estrellas { color: #fbbf24; font-size: 22px; letter-spacing: 3px; }
.login-lado { display: grid; place-items: center; padding: 32px 20px; }
.login-form { width: 100%; max-width: 380px; }
.login-form h2 { font-size: 24px; margin-bottom: 6px; }
@media (max-width: 900px) {
  .login { grid-template-columns: 1fr; }
  .login-marca { padding: 32px 22px; gap: 12px; }
  .login-marca h1 { font-size: 24px; }
  .login-marca p { font-size: 14px; }
  .login-demo { display: none; }
}
