/* Panel de Ventaza — mobile first, claro/oscuro. Estilo minimalista (como la app): fondo gris claro, tarjetas blancas
   sin borde, interacción en negro. Colores de datos según la skill dataviz (paleta validada). */
:root {
  color-scheme: light;
  --plano: #f2f2f4;
  --superficie: #ffffff;
  --superficie-2: #f2f2f4;
  --tinta: #1d1d1f;
  --tinta-2: #4a4d52;
  --tinta-3: #6e6e73;
  --tenue: #86868b;
  --gris: #86868b; /* segunda parte de los titulares */
  --grilla: #ececee;
  --eje: #d2d2d7;
  --borde: rgba(0, 0, 0, 0.07);
  --sombra: 0 30px 60px -30px rgba(0, 0, 0, 0.16), 0 2px 6px rgba(0, 0, 0, 0.04);
  --acento: #030303;
  --acento-tinta: #f7f8f9;
  --acento-suave: rgba(3, 3, 3, 0.06);
  --serie-1: #2a78d6; /* ingresos */
  --serie-2: #eb6834; /* gasto Meta */
  --bueno: #0ca30c;
  --bueno-txt: #006300;
  --alerta: #fab219;
  --serio: #ec835a;
  --critico: #d03b3b;
  --critico-txt: #b42a2a;
  --bueno-bg: rgba(12, 163, 12, 0.1);
  --alerta-bg: rgba(250, 178, 25, 0.16);
  --serio-bg: rgba(236, 131, 90, 0.16);
  --critico-bg: rgba(208, 59, 59, 0.08);
  --neutro-bg: rgba(118, 118, 128, 0.12);
  --burbuja-cliente: #ffffff;
  --burbuja-bot: #e9f1fb;
  --burbuja-alexis: #fdeee6;
  --r: 22px;
  --r-s: 12px;
  --fuente: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Helvetica Neue", system-ui, "Segoe UI", Roboto, Arial, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --plano: #000000;
    --superficie: #1c1c1e;
    --superficie-2: #2c2c2e;
    --tinta: #f5f5f7;
    --tinta-2: #c7c7cc;
    --tinta-3: #a1a1a6;
    --tenue: #8e8e93;
    --gris: #86868b;
    --grilla: #2c2c2e;
    --eje: #3a3a3c;
    --borde: rgba(255, 255, 255, 0.08);
    --sombra: none;
    --acento: #f5f5f7;
    --acento-tinta: #030303;
    --acento-suave: rgba(255, 255, 255, 0.1);
    --serie-1: #3987e5;
    --serie-2: #d95926;
    --bueno-txt: #3cc23c;
    --critico-txt: #ef7b7b;
    --neutro-bg: rgba(118, 118, 128, 0.24);
    --burbuja-cliente: #2c2c2e;
    --burbuja-bot: #1b2a3d;
    --burbuja-alexis: #3a2519;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --plano: #000000;
  --superficie: #1c1c1e;
  --superficie-2: #2c2c2e;
  --tinta: #f5f5f7;
  --tinta-2: #c7c7cc;
  --tinta-3: #a1a1a6;
  --tenue: #8e8e93;
  --gris: #86868b;
  --grilla: #2c2c2e;
  --eje: #3a3a3c;
  --borde: rgba(255, 255, 255, 0.08);
  --sombra: none;
  --acento: #f5f5f7;
  --acento-tinta: #030303;
  --acento-suave: rgba(255, 255, 255, 0.1);
  --serie-1: #3987e5;
  --serie-2: #d95926;
  --bueno-txt: #3cc23c;
  --critico-txt: #ef7b7b;
  --neutro-bg: rgba(118, 118, 128, 0.24);
  --burbuja-cliente: #2c2c2e;
  --burbuja-bot: #1b2a3d;
  --burbuja-alexis: #3a2519;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--plano);
  color: var(--tinta);
  font: 15px/1.45 var(--fuente);
  -webkit-font-smoothing: antialiased;
  padding-bottom: calc(76px + env(safe-area-inset-bottom));
  overflow-x: hidden;
}
button, input, select { font: inherit; color: inherit; }
a { color: var(--acento); }
svg { flex: none; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--acento); outline-offset: 2px; border-radius: 6px; }

/* ---------------------------------------------------------------- barra superior */
.barra {
  position: sticky; top: 0; z-index: 20;
  /* Sin backdrop-filter en móvil: crearía un bloque contenedor y la barra de pestañas (fixed) quedaría atrapada aquí. */
  background: var(--plano);
  border-bottom: 1px solid var(--borde);
}
.barra-in { max-width: 1120px; margin: 0 auto; padding: 10px 16px; padding-top: max(10px, env(safe-area-inset-top)); display: flex; align-items: center; gap: 12px; }
.marca { display: flex; align-items: center; gap: 8px; font-weight: 650; letter-spacing: -0.01em; }
.logo { width: 24px; height: 24px; border-radius: 7px; box-shadow: 0 0 0 1px var(--borde); background: #030303 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Cpath d='M8 21l5-6 4 3 7-8' stroke='white' stroke-width='3.2' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/100% no-repeat; }
.rol { font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 99px; background: var(--neutro-bg); color: var(--tinta-2); letter-spacing: 0.01em; }
.rol.admin { background: var(--acento-suave); color: var(--acento); }
.acciones-barra { margin-left: auto; display: flex; gap: 4px; }
.icono { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 10px; border: 0; background: transparent; color: var(--tinta-2); cursor: pointer; }
.icono:hover { background: var(--neutro-bg); }
.icono svg, .pestanas svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* Pestañas: barra inferior en móvil, arriba en escritorio */
.pestanas {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: grid; grid-template-columns: repeat(3, 1fr);
  background: color-mix(in srgb, var(--superficie) 92%, transparent);
  backdrop-filter: saturate(1.6) blur(14px); -webkit-backdrop-filter: saturate(1.6) blur(14px);
  border-top: 1px solid var(--borde);
  padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
}
.pestanas a { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 0; font-size: 11.5px; font-weight: 550; color: var(--tenue); text-decoration: none; border-radius: 10px; }
.pestanas a[aria-current="page"] { color: var(--acento); }
.badge { position: absolute; top: 2px; left: calc(50% + 6px); min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px; background: var(--critico); color: #fff; font-size: 11px; font-weight: 700; line-height: 18px; text-align: center; box-shadow: 0 0 0 2px var(--superficie); }

/* ---------------------------------------------------------------- filtros */
.filtros { max-width: 1120px; margin: 0 auto; padding: 12px 16px 4px; }
.filtros-in { display: flex; flex-direction: column; gap: 10px; }
.seg { display: flex; gap: 4px; padding: 3px; background: var(--neutro-bg); border-radius: 12px; overflow-x: auto; scrollbar-width: none; }
.seg::-webkit-scrollbar { display: none; }
.seg button { flex: 1 0 auto; border: 0; background: transparent; padding: 7px 11px; border-radius: 9px; font-size: 13.5px; font-weight: 550; color: var(--tinta-2); cursor: pointer; white-space: nowrap; }
.seg button[aria-checked="true"] { background: var(--superficie); color: var(--tinta); box-shadow: 0 1px 2px rgba(0,0,0,.08), 0 0 0 1px var(--borde); }
.fechas { display: flex; gap: 8px; }
.fechas label { flex: 1; display: flex; flex-direction: column; font-size: 12px; color: var(--tinta-3); gap: 3px; }
.fechas input { width: 100%; padding: 8px 10px; border-radius: var(--r-s); border: 1px solid var(--borde); background: var(--superficie); }
.filtros-fila { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.select { flex: 1 1 200px; min-width: 0; }
.select select { width: 100%; appearance: none; padding: 9px 34px 9px 12px; border-radius: var(--r-s); border: 1px solid var(--borde); background: var(--superficie) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23898781' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m7 10 5 5 5-5'/%3E%3C/svg%3E") right 10px center/18px no-repeat; font-size: 14px; }
.switch { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--tinta-2); cursor: pointer; user-select: none; white-space: nowrap; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch-ui { width: 36px; height: 22px; border-radius: 99px; background: var(--eje); position: relative; transition: background .2s; }
.switch-ui::after { content: ""; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.25); transition: transform .2s; }
.switch input:checked + .switch-ui { background: var(--acento); }
.switch input:checked + .switch-ui::after { transform: translateX(14px); }
.switch input:focus-visible + .switch-ui { outline: 2px solid var(--acento); outline-offset: 2px; }

/* ---------------------------------------------------------------- contenido */
.contenido { max-width: 1120px; margin: 0 auto; padding: 8px 16px 24px; transition: opacity .2s; }
.contenido.cargando { opacity: .55; }
.rango-txt { font-size: 12.5px; color: var(--tenue); margin: 2px 2px 12px; }
.tarjeta { background: var(--superficie); border: 0; border-radius: var(--r); box-shadow: var(--sombra); padding: 16px; }
.seccion { margin-top: 22px; }
.seccion > h2, .tit { font-size: 13px; font-weight: 650; color: var(--tinta-2); margin: 0 2px 10px; letter-spacing: 0.01em; }
.vacio { text-align: center; color: var(--tenue); padding: 28px 12px; font-size: 14px; }
.error { color: var(--critico-txt); }

/* Banner de derivaciones */
.banner { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: var(--r); background: var(--critico-bg); color: var(--tinta); text-decoration: none; margin-bottom: 14px; border: 1px solid color-mix(in srgb, var(--critico) 25%, transparent); }
.banner strong { font-weight: 650; }
.banner .flecha { margin-left: auto; color: var(--tinta-2); }

/* Héroe: utilidad */
.heroe { display: grid; gap: 14px; }
.heroe-etq { font-size: 13px; color: var(--tinta-2); font-weight: 550; display: flex; align-items: center; gap: 8px; }
.heroe-valor { font-size: 48px; line-height: 1.05; font-weight: 680; letter-spacing: -0.03em; }
.heroe-valor.neg { color: var(--critico-txt); }
.heroe-formula { font-size: 13px; color: var(--tinta-3); display: flex; flex-wrap: wrap; gap: 4px 10px; }
.heroe-formula b { color: var(--tinta); font-weight: 600; font-variant-numeric: tabular-nums; }
.reparto { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.reparto div { background: var(--superficie-2); border-radius: 12px; padding: 10px 12px; }
.reparto span { display: block; font-size: 12px; color: var(--tinta-3); }
.reparto b { font-size: 17px; font-weight: 650; }
.nota { font-size: 12px; color: var(--tenue); }

/* KPIs */
.kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.kpi { padding: 14px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.kpi-etq { font-size: 12.5px; color: var(--tinta-2); font-weight: 550; }
.kpi-valor { font-size: 24px; font-weight: 650; letter-spacing: -0.02em; line-height: 1.15; overflow-wrap: anywhere; }
.kpi-sub { font-size: 12px; color: var(--tenue); }
.delta { font-size: 12px; font-weight: 600; display: inline-flex; align-items: center; gap: 3px; }
.delta.bien { color: var(--bueno-txt); }
.delta.mal { color: var(--critico-txt); }
.delta.neutro { color: var(--tinta-3); }
.kpi .pill { align-self: flex-start; margin-top: 2px; }

/* Pills de estado (icono + texto, nunca solo color) */
.pill { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px 3px 7px; border-radius: 99px; font-size: 12px; font-weight: 600; color: var(--tinta); background: var(--neutro-bg); white-space: nowrap; }
.pill::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--tenue); }
.pill.bueno { background: var(--bueno-bg); } .pill.bueno::before { background: var(--bueno); }
.pill.alerta { background: var(--alerta-bg); } .pill.alerta::before { background: var(--alerta); }
.pill.serio { background: var(--serio-bg); } .pill.serio::before { background: var(--serio); }
.pill.critico { background: var(--critico-bg); } .pill.critico::before { background: var(--critico); }
.pill .ico { font-size: 11px; }
.chip { display: inline-block; padding: 2px 8px; border-radius: 99px; font-size: 11.5px; font-weight: 550; background: var(--neutro-bg); color: var(--tinta-2); }
.chip.prueba { background: var(--alerta-bg); color: var(--tinta); }

/* Semáforo */
.semaforos { display: grid; gap: 10px; }
.sem { display: grid; gap: 10px; align-content: start; }
.sem-cab { display: flex; align-items: center; gap: 10px; justify-content: space-between; }
.sem-nombre { font-weight: 650; font-size: 15px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sem-datos { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.sem-datos span { display: block; font-size: 11.5px; color: var(--tinta-3); }
.sem-datos b { font-size: 16px; font-weight: 650; font-variant-numeric: tabular-nums; }
.medidor { position: relative; height: 8px; border-radius: 99px; background: var(--superficie-2); overflow: hidden; }
.medidor i { position: absolute; inset: 0 auto 0 0; border-radius: 99px; }
.medidor-eje { display: flex; justify-content: space-between; font-size: 11px; color: var(--tenue); margin-top: 4px; font-variant-numeric: tabular-nums; }
.alertas { margin: 0; padding: 10px 12px; list-style: none; border-radius: 12px; background: var(--critico-bg); font-size: 13px; display: grid; gap: 4px; }
.alertas li::before { content: "⚠ "; }

/* Gráfico */
.graf-cab { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.graf-cab h3 { margin: 0; font-size: 15px; font-weight: 650; }
.graf-cab p { margin: 2px 0 0; font-size: 12.5px; color: var(--tinta-3); }
.leyenda { display: flex; gap: 14px; font-size: 12.5px; color: var(--tinta-2); }
.leyenda span { display: inline-flex; align-items: center; gap: 6px; }
.leyenda i { width: 14px; height: 2px; border-radius: 2px; display: inline-block; }
.graf { position: relative; width: 100%; height: 230px; touch-action: pan-y; }
.graf svg { display: block; width: 100%; height: 100%; overflow: visible; }
.graf .grid line { stroke: var(--grilla); stroke-width: 1; shape-rendering: crispEdges; }
.graf .base { stroke: var(--eje); stroke-width: 1; shape-rendering: crispEdges; }
.graf text { fill: var(--tenue); font-size: 11px; font-variant-numeric: tabular-nums; }
.graf text.fin { fill: var(--tinta-2); font-weight: 600; }
.graf .linea { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.graf .area { opacity: .1; }
.graf .punto { stroke: var(--superficie); stroke-width: 2; }
.graf .cruz { stroke: var(--eje); stroke-width: 1; }
details.tabla { margin-top: 10px; }
details.tabla summary { cursor: pointer; font-size: 13px; color: var(--acento); font-weight: 550; list-style: none; padding: 4px 0; }
details.tabla summary::-webkit-details-marker { display: none; }
.tabla-scroll { overflow-x: auto; margin-top: 6px; }
table { width: 100%; border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; }
th, td { padding: 7px 8px; text-align: right; border-bottom: 1px solid var(--grilla); white-space: nowrap; }
th:first-child, td:first-child { text-align: left; }
th { font-weight: 600; color: var(--tinta-2); font-size: 12px; }

.tooltip { position: fixed; z-index: 50; pointer-events: none; background: var(--superficie); color: var(--tinta); border: 1px solid var(--borde); border-radius: 12px; padding: 9px 11px; font-size: 12.5px; box-shadow: 0 6px 24px rgba(0,0,0,.14); min-width: 150px; }
.tooltip .tt-f { color: var(--tinta-3); font-size: 12px; margin-bottom: 4px; }
.tooltip .tt-r { display: flex; align-items: center; gap: 8px; }
.tooltip .tt-r i { width: 12px; height: 2px; border-radius: 2px; }
.tooltip .tt-r b { font-weight: 650; font-variant-numeric: tabular-nums; }
.tooltip .tt-r span { color: var(--tinta-3); margin-left: auto; padding-left: 10px; }

/* ---------------------------------------------------------------- listas (chats y pedidos) */
.herramientas { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.buscar { flex: 1 1 220px; position: relative; }
.buscar input { width: 100%; padding: 9px 12px 9px 36px; border-radius: var(--r-s); border: 1px solid var(--borde); background: var(--superficie); font-size: 14px; }
.buscar svg { position: absolute; left: 11px; top: 50%; width: 17px; height: 17px; transform: translateY(-50%); fill: none; stroke: var(--tenue); stroke-width: 2; stroke-linecap: round; }
.lista { background: var(--superficie); border: 0; border-radius: var(--r); box-shadow: var(--sombra); overflow: hidden; }
.fila { display: flex; gap: 12px; padding: 12px 14px; align-items: flex-start; width: 100%; text-align: left; border: 0; background: transparent; cursor: pointer; border-bottom: 1px solid var(--grilla); }
.fila:last-child { border-bottom: 0; }
.fila:hover { background: color-mix(in srgb, var(--superficie-2) 60%, transparent); }
.avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--superficie-2); color: var(--tinta-2); display: grid; place-items: center; font-weight: 650; font-size: 15px; flex: none; position: relative; }
.avatar.der::after { content: ""; position: absolute; right: -1px; top: -1px; width: 11px; height: 11px; border-radius: 50%; background: var(--critico); box-shadow: 0 0 0 2px var(--superficie); }
.fila-cuerpo { flex: 1; min-width: 0; display: grid; gap: 3px; }
.fila-l1 { display: flex; gap: 8px; align-items: baseline; }
.fila-nombre { font-weight: 620; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fila-tel { font-size: 12.5px; color: var(--tenue); font-variant-numeric: tabular-nums; white-space: nowrap; }
.fila-hora { margin-left: auto; font-size: 12px; color: var(--tenue); white-space: nowrap; }
.fila-msg { font-size: 13.5px; color: var(--tinta-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fila-chips { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 2px; }
.mas { display: block; margin: 12px auto 0; padding: 9px 16px; border-radius: 99px; border: 1px solid var(--borde); background: var(--superficie); font-weight: 550; cursor: pointer; }

.derivs { display: grid; gap: 10px; margin-bottom: 18px; }
.deriv { border-left: 3px solid var(--critico); display: grid; gap: 8px; }
.deriv-cab { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.deriv-cab strong { font-weight: 650; }
.deriv-cab .fila-hora { margin-left: auto; }
.deriv .botones .btn { flex: 1 1 auto; padding: 8px 10px; }
@media (min-width: 760px) { .deriv .botones .btn { flex: 0 0 auto; padding: 8px 14px; } }
.deriv p { margin: 0; font-size: 14px; color: var(--tinta-2); }
.botones { display: flex; gap: 8px; flex-wrap: wrap; }
.btn { border: 1px solid var(--borde); background: var(--superficie); padding: 8px 13px; border-radius: 10px; font-size: 13.5px; font-weight: 600; cursor: pointer; color: var(--tinta); }
.btn:hover { background: var(--superficie-2); }
.btn.primario { background: var(--acento); border-color: transparent; color: var(--acento-tinta); }
.btn.primario:hover { filter: brightness(1.06); }
.btn:disabled { opacity: .5; cursor: default; }

/* Filtro de estado (pedidos) */
.estados { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; margin-bottom: 12px; scrollbar-width: none; }
.estados::-webkit-scrollbar { display: none; }
.estados button { border: 1px solid var(--borde); background: var(--superficie); padding: 6px 11px; border-radius: 99px; font-size: 13px; font-weight: 550; white-space: nowrap; cursor: pointer; color: var(--tinta-2); }
.estados button[aria-pressed="true"] { background: var(--tinta); color: var(--superficie); border-color: transparent; }
.estados b { font-weight: 650; margin-left: 4px; font-variant-numeric: tabular-nums; }

.pedidos { display: grid; gap: 10px; }
.pedido { display: grid; gap: 10px; }
.pedido-cab { display: flex; gap: 10px; align-items: center; justify-content: space-between; }
.pedido-tit { font-weight: 650; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pedido-sub { font-size: 12.5px; color: var(--tenue); }
.pedido-monto { font-size: 20px; font-weight: 650; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; }
.pedido-monto small { font-size: 12.5px; font-weight: 550; color: var(--critico-txt); margin-left: 6px; }
.lectura { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; font-size: 13px; margin: 0; padding: 10px 12px; background: var(--superficie-2); border-radius: 12px; }
.lectura dt { color: var(--tinta-3); }
.lectura dd { margin: 0; font-weight: 550; overflow-wrap: anywhere; }
.confianza { display: inline-flex; align-items: center; gap: 8px; }
.confianza .medidor { display: block; width: 72px; height: 6px; }

/* ---------------------------------------------------------------- hoja de detalle (chat) */
dialog.hoja { border: 0; padding: 0; margin: 0; max-width: none; max-height: none; width: 100%; height: 100%; background: var(--plano); color: var(--tinta); }
dialog.hoja::backdrop { background: rgba(0, 0, 0, 0.4); }
.hoja-in { display: flex; flex-direction: column; height: 100%; }
.hoja-cab { display: flex; align-items: center; gap: 10px; padding: 10px 12px; padding-top: max(10px, env(safe-area-inset-top)); border-bottom: 1px solid var(--borde); background: var(--superficie); }
.hoja-cab h2 { margin: 0; font-size: 16px; font-weight: 650; }
.hoja-cab p { margin: 0; font-size: 12.5px; color: var(--tenue); }
.hoja-cuerpo { flex: 1; overflow-y: auto; padding: 14px 14px 24px; display: grid; gap: 14px; align-content: start; }
.info { display: grid; grid-template-columns: auto 1fr; gap: 5px 12px; font-size: 13.5px; margin: 0; }
.info dt { color: var(--tinta-3); }
.info dd { margin: 0; overflow-wrap: anywhere; }
.conv { display: flex; flex-direction: column; gap: 6px; }
.dia-sep { align-self: center; font-size: 11.5px; color: var(--tenue); background: var(--superficie-2); padding: 2px 10px; border-radius: 99px; margin: 6px 0; }
.msg { max-width: 82%; padding: 8px 11px 6px; border-radius: 14px; font-size: 14px; line-height: 1.4; white-space: pre-wrap; overflow-wrap: anywhere; box-shadow: 0 1px 1px rgba(0,0,0,.06); }
.msg.cliente { align-self: flex-start; background: var(--burbuja-cliente); border-bottom-left-radius: 4px; border: 1px solid var(--borde); }
.msg.bot { align-self: flex-end; background: var(--burbuja-bot); border-bottom-right-radius: 4px; }
.msg.alexis, .msg.sistema { align-self: flex-end; background: var(--burbuja-alexis); border-bottom-right-radius: 4px; }
.msg .meta { display: block; font-size: 11px; color: var(--tenue); text-align: right; margin-top: 3px; }
.msg.media { font-style: italic; color: var(--tinta-2); }

.aviso { position: fixed; left: 50%; bottom: calc(88px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 60; background: var(--tinta); color: var(--superficie); padding: 10px 16px; border-radius: 99px; font-size: 13.5px; font-weight: 550; box-shadow: 0 8px 24px rgba(0,0,0,.2); max-width: calc(100% - 32px); }

/* ---------------------------------------------------------------- escritorio */
@media (min-width: 760px) {
  body { padding-bottom: 0; }
  .barra { background: color-mix(in srgb, var(--plano) 86%, transparent); backdrop-filter: saturate(1.6) blur(14px); -webkit-backdrop-filter: saturate(1.6) blur(14px); }
  .pestanas { position: static; display: flex; gap: 2px; background: transparent; backdrop-filter: none; -webkit-backdrop-filter: none; border: 0; padding: 0; margin-left: 18px; }
  .pestanas a { flex-direction: row; gap: 7px; padding: 7px 12px; font-size: 14px; color: var(--tinta-2); }
  .pestanas a:hover { background: var(--neutro-bg); }
  .pestanas a[aria-current="page"] { background: var(--acento-suave); color: var(--acento); }
  .pestanas svg { width: 17px; height: 17px; }
  .badge { position: static; margin-left: 2px; box-shadow: none; }
  .filtros-in { flex-direction: row; align-items: center; flex-wrap: wrap; }
  .seg { flex: 0 0 auto; }
  .fechas label { flex-direction: row; align-items: center; gap: 6px; }
  .filtros-fila { flex: 1; justify-content: flex-end; flex-wrap: nowrap; }
  .select { flex: 0 1 260px; }
  .kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .heroe { grid-template-columns: 1.3fr 1fr; align-items: end; }
  .heroe-valor { font-size: 56px; }
  .semaforos { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
  .graf { height: 280px; }
  .pedidos { grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); }
  dialog.hoja { width: min(560px, 100%); margin-left: auto; height: 100%; border-left: 1px solid var(--borde); box-shadow: -12px 0 40px rgba(0,0,0,.12); }
  .aviso { bottom: 24px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
@media (forced-colors: active) { .pill::before, .medidor i { forced-color-adjust: none; } }

/* ---------------------------------------------------------------- titulares en dos tonos (estilo de la app) */
.titular { font-size: 28px; line-height: 1.1; font-weight: 700; letter-spacing: -0.025em; margin: 6px 2px 4px; color: var(--tinta); text-wrap: balance; }
.titular span { color: var(--gris); }
@media (min-width: 760px) { .titular { font-size: 40px; } }

/* ---------------------------------------------------------------- pantalla de login */
.login-body { padding: 0; min-height: 100dvh; display: flex; flex-direction: column; }
.login { width: 100%; max-width: 420px; margin: 0 auto; padding: max(28px, env(safe-area-inset-top)) 16px 32px; flex: 1; display: flex; flex-direction: column; }
.login-marca { display: flex; align-items: center; gap: 9px; font-weight: 650; font-size: 16px; letter-spacing: -0.01em; }
.login-cuerpo { margin: auto 0; padding: 40px 0 24px; display: grid; gap: 22px; }
.login .titular { font-size: 34px; margin: 0; }
.login-card { padding: 22px; display: grid; gap: 14px; }
.campo { display: grid; gap: 6px; font-size: 13px; font-weight: 550; color: var(--tinta-2); }
.campo input { width: 100%; font-size: 17px; padding: 13px 14px; border-radius: 14px; border: 1px solid transparent; background: var(--superficie-2); color: var(--tinta); outline: none; transition: border-color .15s, background .15s; }
.campo input:focus { border-color: var(--acento); background: var(--superficie); }
.campo input.codigo { font-size: 30px; font-weight: 650; letter-spacing: 0.32em; text-align: center; font-variant-numeric: tabular-nums; padding: 14px 0 14px 0.32em; }
.btn-negro { width: 100%; border: 0; border-radius: 14px; padding: 15px 18px; font-size: 16px; font-weight: 600; background: var(--acento); color: var(--acento-tinta); cursor: pointer; box-shadow: 0 14px 30px -12px rgba(3, 3, 3, 0.45); transition: transform .12s, opacity .15s; }
.btn-negro:active { transform: scale(0.985); }
.btn-negro:disabled { opacity: .45; cursor: default; box-shadow: none; }
.btn-texto { border: 0; background: none; padding: 6px 2px; font-size: 14px; font-weight: 550; color: var(--tinta-2); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--eje); }
.btn-texto:hover { color: var(--tinta); }
.login-acciones { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.login-nota { font-size: 14px; color: var(--tinta-3); margin: 0; line-height: 1.45; }
.login-nota b { color: var(--tinta); font-weight: 600; overflow-wrap: anywhere; }
.login-msg { font-size: 14px; margin: 0; padding: 11px 14px; border-radius: 12px; background: var(--neutro-bg); color: var(--tinta); }
.login-msg.error { background: var(--critico-bg); color: var(--critico-txt); }
.login-pie { text-align: center; font-size: 12.5px; color: var(--tenue); }

/* Logo de Ventaza (SVG en línea, hereda el color del texto) */
.logo-ventaza { display: block; height: 26px; width: auto; color: var(--tinta, #1d1d1f); }
.login-marca .logo-ventaza { height: 30px; }

/* Agente de ventas: barras del embudo y de objeciones */
.agente-dos { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); margin-top: 12px; }
.barra-ag { display: grid; gap: 4px; margin-top: 10px; }
.barra-ag .sem-cab span { font-size: 13px; color: var(--tinta-2); }
.barra-ag .sem-cab b { font-variant-numeric: tabular-nums; }
