/* Stratus Ventas. Sistema Apple monocromo heredado de BASALT: canales RGB, claro por defecto,
   oscuro con el equipo o con data-theme. El único color es de estado (verde, ámbar, rojo). */

:root {
  --c-ventana: 245 245 247;   /* #F5F5F7 */
  --c-lateral: 236 236 240;
  --c-superficie: 255 255 255;
  --c-elevado: 242 242 245;
  --c-linea: 226 226 231;
  --c-linea-fuerte: 205 205 212;
  --c-hover: 236 236 240;
  --c-t1: 29 29 31;           /* #1D1D1F */
  --c-t2: 72 72 77;
  --c-t3: 110 110 115;        /* 5:1 sobre blanco */
  --c-t4: 134 134 139;
  --c-verde: 26 127 55;       /* #1A7F37: 5:1 sobre blanco, legible como texto */
  --c-ambar: 158 80 0;        /* #9E5000 */
  --c-rojo: 200 0 20;         /* #C80014 */
  --lateral-alfa: .78;
  --sombra: 0 0 0 .5px rgb(0 0 0 / .05), 0 1px 2px rgb(0 0 0 / .04), 0 6px 22px rgb(0 0 0 / .045);
  --sombra-flota: 0 0 0 .5px rgb(0 0 0 / .06), 0 12px 40px rgb(0 0 0 / .14);
  --fuente: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI Variable Text", "Segoe UI", system-ui, sans-serif;
  --fuente-titulo: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI Variable Display", "Segoe UI", system-ui, sans-serif;
  --r-panel: 12px;
  --r-control: 8px;
  --curva: cubic-bezier(.22, 1, .36, 1);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --c-ventana: 22 22 24;
    --c-lateral: 30 30 33;
    --c-superficie: 32 32 35;
    --c-elevado: 42 42 46;
    --c-linea: 52 52 56;
    --c-linea-fuerte: 74 74 80;
    --c-hover: 44 44 48;
    --c-t1: 245 245 247;
    --c-t2: 205 205 210;
    --c-t3: 161 161 166;
    --c-t4: 134 134 140;
    --c-verde: 48 209 88;
    --c-ambar: 255 179 64;
    --c-rojo: 255 69 58;
    --lateral-alfa: .72;
    --sombra: 0 0 0 .5px rgb(255 255 255 / .07), 0 1px 2px rgb(0 0 0 / .3), 0 8px 26px rgb(0 0 0 / .28);
    --sombra-flota: 0 0 0 .5px rgb(255 255 255 / .1), 0 16px 48px rgb(0 0 0 / .5);
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --c-ventana: 22 22 24;
  --c-lateral: 30 30 33;
  --c-superficie: 32 32 35;
  --c-elevado: 42 42 46;
  --c-linea: 52 52 56;
  --c-linea-fuerte: 74 74 80;
  --c-hover: 44 44 48;
  --c-t1: 245 245 247;
  --c-t2: 205 205 210;
  --c-t3: 161 161 166;
  --c-t4: 134 134 140;
  --c-verde: 48 209 88;
  --c-ambar: 255 179 64;
  --c-rojo: 255 69 58;
  --lateral-alfa: .72;
  --sombra: 0 0 0 .5px rgb(255 255 255 / .07), 0 1px 2px rgb(0 0 0 / .3), 0 8px 26px rgb(0 0 0 / .28);
  --sombra-flota: 0 0 0 .5px rgb(255 255 255 / .1), 0 16px 48px rgb(0 0 0 / .5);
  color-scheme: dark;
}

:root {
  --ventana: rgb(var(--c-ventana));
  --superficie: rgb(var(--c-superficie));
  --elevado: rgb(var(--c-elevado));
  --linea: rgb(var(--c-linea));
  --linea-fuerte: rgb(var(--c-linea-fuerte));
  --hover: rgb(var(--c-hover));
  --t1: rgb(var(--c-t1));
  --t2: rgb(var(--c-t2));
  --t3: rgb(var(--c-t3));
  --t4: rgb(var(--c-t4));
  --verde: rgb(var(--c-verde));
  --ambar: rgb(var(--c-ambar));
  --rojo: rgb(var(--c-rojo));
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--ventana);
  color: var(--t1);
  font: 14px/1.45 var(--fuente);
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "cv11", "ss01";
  caret-color: var(--t1);
}
h1, h2, h3 { font-family: var(--fuente-titulo); text-wrap: balance; margin: 0; }
p { margin: 0; text-wrap: pretty; }
a { color: inherit; text-underline-offset: 3px; text-decoration-thickness: 1px; }
::selection { background: rgb(var(--c-t1) / .16); }
:focus-visible { outline: 2px solid var(--t1); outline-offset: 2px; border-radius: 6px; }
* { scrollbar-width: thin; scrollbar-color: rgb(var(--c-t1) / .22) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: rgb(var(--c-t1) / .2); border-radius: 10px; border: 3px solid transparent; background-clip: content-box; }
.num { font-variant-numeric: tabular-nums; }
.icono { width: 18px; height: 18px; flex: none; fill: currentColor; }
.icono.chico { width: 15px; height: 15px; }

/* --- Estructura ----------------------------------------------------------------------- */

.app { display: grid; grid-template-columns: 232px minmax(0, 1fr); min-height: 100dvh; }
.lateral {
  position: sticky; top: 0; height: 100dvh;
  display: flex; flex-direction: column; gap: 4px;
  padding: 18px 12px 14px;
  background: rgb(var(--c-lateral) / var(--lateral-alfa));
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-right: 1px solid var(--linea);
}
.marca { display: flex; align-items: flex-end; gap: 7px; padding: 6px 10px 18px; }
.marca .logo { height: 17px; width: auto; color: var(--t1); }
.marca span { color: var(--t3); font-size: 13px; line-height: 1; }
.nav { display: grid; gap: 2px; }
.nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 10px; border-radius: var(--r-control);
  color: var(--t2); text-decoration: none; font-weight: 500;
  transition: background .15s, color .15s;
}
.nav a:hover { background: rgb(var(--c-t1) / .05); color: var(--t1); }
.nav a[aria-current="page"] { background: rgb(var(--c-t1) / .08); color: var(--t1); }
.nav .cuenta-n { margin-left: auto; font-size: 12px; font-weight: 600; color: var(--t3); }
.nav a[aria-current="page"] .cuenta-n { color: var(--t1); }
.lateral-pie { margin-top: auto; display: grid; gap: 10px; padding: 0 10px; font-size: 12px; color: var(--t3); }
.lateral-pie .usuario { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.lateral-pie a { color: var(--t3); text-decoration: none; display: inline-flex; align-items: center; gap: 4px; }
.lateral-pie a:hover { color: var(--t1); }

.contenido { min-width: 0; padding: 34px 40px 80px; }
.vista { max-width: 1180px; margin: 0 auto; animation: entra .22s var(--curva); }
@keyframes entra { from { opacity: 0; transform: translateY(4px); } }

.cabecera { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 26px; }
.cabecera h1 { font-size: 28px; font-weight: 700; letter-spacing: -.025em; line-height: 1.15; }
.cabecera h1::first-letter { text-transform: uppercase; }
.cabecera .sub { margin-top: 6px; color: var(--t3); font-size: 14px; max-width: 70ch; }
.cabecera .acciones { display: flex; gap: 8px; flex-wrap: wrap; }

/* --- Piezas --------------------------------------------------------------------------- */

.panel { background: var(--superficie); border-radius: var(--r-panel); box-shadow: var(--sombra); }
.panel + .panel, .bloque + .bloque { margin-top: 22px; }
.bloque h2 { font-size: 15px; font-weight: 600; letter-spacing: -.01em; margin: 0 4px 10px; display: flex; align-items: baseline; gap: 8px; }
.bloque h2 small { font: 500 13px var(--fuente); color: var(--t3); }
.lista { list-style: none; margin: 0; padding: 0; }
.lista > li { display: flex; align-items: center; gap: 12px; padding: 11px 16px; min-height: 48px; }
.lista > li + li { border-top: 1px solid var(--linea); }
.lista > li.click { cursor: pointer; transition: background .12s; }
.lista > li.click:hover { background: var(--hover); }
.lista > li.click:first-child { border-radius: var(--r-panel) var(--r-panel) 0 0; }
.lista > li.click:last-child { border-radius: 0 0 var(--r-panel) var(--r-panel); }
.lista > li.click:only-child { border-radius: var(--r-panel); }
.lista .principal { min-width: 0; flex: 1; }
.lista .titulo { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lista .detalle { color: var(--t3); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lista .lado { color: var(--t3); font-size: 13px; white-space: nowrap; }
.hora { font: 600 13px var(--fuente); color: var(--t2); width: 44px; flex: none; font-variant-numeric: tabular-nums; }

.vacio { padding: 26px 20px; color: var(--t3); }
.vacio b { display: block; color: var(--t1); font-weight: 600; margin-bottom: 4px; }

.boton {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 34px; padding: 0 14px; border-radius: 999px;
  border: 1px solid var(--linea-fuerte); background: var(--superficie); color: var(--t1);
  font: 600 13px var(--fuente); cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background .15s, border-color .15s, transform .1s, opacity .15s;
}
.boton:hover { background: var(--hover); }
.boton:active { transform: scale(.98); }
.boton[disabled] { opacity: .45; cursor: default; transform: none; }
.boton.primario { background: var(--t1); border-color: var(--t1); color: var(--superficie); }
.boton.primario:hover { opacity: .88; }
.boton.peligro { color: var(--rojo); }
.boton.chico { height: 28px; padding: 0 11px; font-size: 12px; }
.boton.solo-icono { width: 34px; padding: 0; }
.boton .icono { width: 16px; height: 16px; }
.boton.cargando .icono { animation: gira 1s linear infinite; }
@keyframes gira { to { transform: rotate(360deg); } }

/* Estado como texto, igual que en Mail o Recordatorios: sin píldora ni punto. El color solo marca
   lo que pide atención (verde avanza, ámbar espera, rojo se detuvo). */
.chip { display: inline-flex; align-items: center; gap: 5px; font: 600 12.5px/1.2 var(--fuente); color: var(--t3); white-space: nowrap; text-decoration: none; }
.chip.verde { color: var(--verde); }
.chip.ambar { color: var(--ambar); }
.chip.rojo { color: var(--rojo); }
.chip.negro { color: var(--t1); }
a.chip:hover { color: var(--t1); text-decoration: underline; }

.campo { display: grid; gap: 5px; }
.campo > span { font-size: 12px; font-weight: 600; color: var(--t3); }
input, textarea, select {
  font: inherit; color: var(--t1); background: var(--elevado);
  border: 1px solid transparent; border-radius: var(--r-control);
  padding: 8px 10px; width: 100%;
  transition: border-color .15s, background .15s, box-shadow .15s;
}
textarea { resize: vertical; line-height: 1.55; min-height: 90px; }
input:hover, textarea:hover, select:hover { border-color: var(--linea-fuerte); }
input:focus, textarea:focus, select:focus { outline: none; background: var(--superficie); border-color: var(--t1); box-shadow: 0 0 0 3px rgb(var(--c-t1) / .08); }
input::placeholder, textarea::placeholder { color: var(--t4); }
select { appearance: none; padding-right: 30px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 256 256'%3E%3Cpath fill='%2386868B' d='M213.66,101.66l-80,80a8,8,0,0,1-11.32,0l-80-80A8,8,0,0,1,53.66,90.34L128,164.69l74.34-74.35a8,8,0,0,1,11.32,11.32Z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 9px center; background-size: 13px; }

.segmentado { display: inline-flex; padding: 2px; border-radius: var(--r-control); background: rgb(var(--c-t1) / .07); gap: 2px; }
.segmentado button { border: 0; background: transparent; color: var(--t2); font: 600 12px var(--fuente); height: 26px; padding: 0 12px; border-radius: 6px; cursor: pointer; transition: background .15s, color .15s; }
.segmentado button[aria-pressed="true"] { background: var(--superficie); color: var(--t1); box-shadow: 0 1px 2px rgb(0 0 0 / .12); }

.interruptor { position: relative; width: 38px; height: 22px; flex: none; appearance: none; background: rgb(var(--c-t1) / .16); border-radius: 999px; padding: 0; border: 0; cursor: pointer; transition: background .2s; }
.interruptor::after { content: ""; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgb(0 0 0 / .25); transition: transform .2s var(--curva); }
.interruptor:checked { background: var(--verde); }
.interruptor:checked::after { transform: translateX(16px); }

/* --- Hoy ------------------------------------------------------------------------------ */

.estado-envio { display: inline-flex; align-items: center; gap: 8px; }
.cupo { padding: 18px 20px; display: grid; gap: 12px; }
.cupo-linea { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.cupo-linea b { font: 700 20px var(--fuente-titulo); letter-spacing: -.02em; }
.cupo-linea span { color: var(--t3); font-size: 13px; }
.ranuras { display: grid; grid-template-columns: repeat(var(--n, 25), minmax(0, 1fr)); gap: 4px; }
.ranura { height: 22px; border-radius: 4px; background: rgb(var(--c-t1) / .07); transition: background .3s; }
.ranura.enviado { background: var(--t1); }
.ranura.programado { background: transparent; box-shadow: inset 0 0 0 1.5px var(--t1); }
.leyenda { display: flex; gap: 16px; flex-wrap: wrap; color: var(--t3); font-size: 12px; }
.leyenda i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; background: rgb(var(--c-t1) / .07); }
.leyenda i.e { background: var(--t1); }
.leyenda i.p { background: transparent; box-shadow: inset 0 0 0 1.5px var(--t1); }

.dos-col { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 22px; align-items: start; margin-top: 22px; }
.dos-col > .bloque + .bloque { margin-top: 0; }
.aviso-tanda { padding: 18px 20px; display: grid; gap: 12px; }
.aviso-tanda p { color: var(--t2); }
.aviso-tanda strong { color: var(--t1); }

.llamada-acciones { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.llamada li { align-items: flex-start; }
.tel { font-weight: 600; text-decoration: none; display: inline-flex; gap: 6px; align-items: center; }
.tel:hover { text-decoration: underline; }

/* --- Aprobar -------------------------------------------------------------------------- */

.borrador { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); }
.borrador + .borrador { margin-top: 18px; }
.borrador .correo { padding: 20px 22px; display: grid; gap: 12px; border-right: 1px solid var(--linea); }
.borrador .contexto { padding: 20px 22px; display: grid; gap: 14px; align-content: start; background: rgb(var(--c-t1) / .018); border-radius: 0 var(--r-panel) var(--r-panel) 0; }
.borrador h3 { font-size: 17px; font-weight: 700; letter-spacing: -.015em; }
.borrador .para { color: var(--t3); font-size: 13px; }
.borrador textarea.cuerpo { min-height: 230px; font-size: 14px; }
.revision { display: flex; gap: 6px; flex-wrap: wrap; }
.dato { display: grid; gap: 3px; }
.dato > span { font-size: 12px; font-weight: 600; color: var(--t3); }
.dato p { color: var(--t2); }
.borrador .pie { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
details.seguimiento summary { cursor: pointer; font-weight: 600; font-size: 13px; color: var(--t2); list-style: none; display: flex; align-items: center; gap: 6px; }
details.seguimiento summary::-webkit-details-marker { display: none; }
details.seguimiento summary .icono { transition: transform .2s; }
details.seguimiento[open] summary .icono { transform: rotate(180deg); }
details.seguimiento textarea { margin-top: 8px; min-height: 120px; }

/* --- Bandeja -------------------------------------------------------------------------- */

.bandeja { display: grid; grid-template-columns: 360px minmax(0, 1fr); height: calc(100dvh - 160px); min-height: 520px; overflow: hidden; }
.bandeja .columna-lista { border-right: 1px solid var(--linea); display: flex; flex-direction: column; min-height: 0; }
.bandeja .herramientas { padding: 12px; display: grid; gap: 10px; border-bottom: 1px solid var(--linea); }
.bandeja .hilos { overflow: auto; flex: 1; }
.hilo-item { display: grid; gap: 2px; padding: 11px 14px 11px 22px; border-bottom: 1px solid var(--linea); cursor: pointer; position: relative; transition: background .12s; }
.hilo-item:hover { background: var(--hover); }
.hilo-item[aria-current="true"] { background: rgb(var(--c-t1) / .07); }
.hilo-item.no-leido::before { content: ""; position: absolute; left: 8px; top: 17px; width: 7px; height: 7px; border-radius: 50%; background: var(--t1); }
.hilo-item .fila { display: flex; justify-content: space-between; gap: 8px; }
.hilo-item .de { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hilo-item.no-leido .de, .hilo-item.no-leido .asunto { font-weight: 700; }
.hilo-item .fecha { color: var(--t3); font-size: 12px; white-space: nowrap; }
.hilo-item .asunto { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hilo-item .extracto { color: var(--t3); font-size: 12.5px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.columna-hilo { display: flex; flex-direction: column; min-height: 0; }
.columna-hilo .cab { padding: 16px 22px; border-bottom: 1px solid var(--linea); display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.columna-hilo .cab h2 { font-size: 17px; font-weight: 700; letter-spacing: -.015em; }
.mensajes { overflow: auto; flex: 1; padding: 8px 22px 22px; }
.mensaje { padding: 16px 0; border-bottom: 1px solid var(--linea); }
.mensaje .cab-msg { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.mensaje .cab-msg b { display: block; }
.mensaje .cab-msg span { color: var(--t3); font-size: 12px; }
.mensaje .texto { white-space: pre-wrap; overflow-wrap: anywhere; color: var(--t1); max-width: 75ch; }
.mensaje.propio .texto { color: var(--t2); }
.mensaje iframe { width: 100%; border: 0; min-height: 300px; background: #fff; border-radius: var(--r-control); }
.redactar { border-top: 1px solid var(--linea); padding: 14px 22px; display: grid; gap: 10px; background: var(--superficie); }
.redactar textarea { min-height: 110px; }
.redactar .fila { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; }

/* --- Empresas ------------------------------------------------------------------------- */

.herramientas-tabla { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.herramientas-tabla input[type="search"] { max-width: 280px; }
.herramientas-tabla select { width: auto; min-width: 170px; }
table.tabla { width: 100%; border-collapse: collapse; }
.tabla th { text-align: left; font-size: 12px; font-weight: 600; color: var(--t3); padding: 10px 16px; border-bottom: 1px solid var(--linea); }
.tabla td { padding: 11px 16px; border-bottom: 1px solid var(--linea); vertical-align: middle; }
.tabla tbody tr { cursor: pointer; transition: background .12s; }
.tabla tbody tr:hover { background: var(--hover); }
.tabla tbody tr:last-child td { border-bottom: 0; }
.tabla .sec { color: var(--t3); font-size: 12.5px; }
.envoltorio-tabla { overflow-x: auto; }

.ficha { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 22px; align-items: start; }
.formulario { padding: 20px 22px; display: grid; gap: 12px; }
.formulario .doble { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.linea-tiempo { list-style: none; margin: 0; padding: 6px 20px 14px; }
.linea-tiempo li { display: grid; grid-template-columns: 22px 1fr; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--linea); }
.linea-tiempo li:last-child { border-bottom: 0; }
.linea-tiempo .icono { margin-top: 2px; color: var(--t3); }
.linea-tiempo .q { color: var(--t3); font-size: 12px; }
.linea-tiempo .t { white-space: pre-wrap; }
.panel-llamada { padding: 16px 20px; display: grid; gap: 10px; }

/* --- Tablero -------------------------------------------------------------------------- */

.vista-ancha { max-width: none; }
.tablero { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(212px, 1fr); gap: 12px; overflow-x: auto; align-items: start; padding-bottom: 12px; }
.carril { background: rgb(var(--c-t1) / .035); border-radius: var(--r-panel); padding: 10px; min-height: 260px; max-height: calc(100dvh - 190px); display: flex; flex-direction: column; transition: background .15s, box-shadow .15s; }
.carril .tarjetas { overflow-y: auto; min-height: 0; padding: 2px 2px 6px; margin: -2px; }
.carril.sobre { background: rgb(var(--c-t1) / .08); box-shadow: inset 0 0 0 1.5px var(--linea-fuerte); }
.carril h2 { display: flex; justify-content: space-between; align-items: baseline; font-size: 13px; font-weight: 600; margin: 2px 4px 10px; }
.carril h2 span { color: var(--t3); font-weight: 600; }
.tarjetas { display: grid; gap: 8px; }
.tarjeta { background: var(--superficie); border-radius: 10px; box-shadow: var(--sombra); padding: 10px 12px; display: grid; gap: 2px; cursor: pointer; transition: transform .15s var(--curva), box-shadow .15s, opacity .15s; }
.tarjeta[draggable="true"] { cursor: grab; }
.tarjeta:hover { box-shadow: var(--sombra-flota); }
.tarjeta:active { cursor: grabbing; }
.tarjeta.arrastrando { opacity: .45; transform: scale(.98); }
.tarjeta b { font-weight: 600; line-height: 1.3; }
.tarjeta .sec { color: var(--t3); font-size: 12px; }
.tarjeta .meta { color: var(--t2); font-size: 12.5px; margin-top: 4px; }
.tarjeta .meta.ambar { color: var(--ambar); font-weight: 600; }
.tarjeta .chip { margin-top: 4px; }
.carril-vacio { color: var(--t4); font-size: 12.5px; padding: 6px 4px; }

/* --- Panel ---------------------------------------------------------------------------- */

.cifras { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); }
.cifra { padding: 18px 20px; display: grid; gap: 4px; align-content: start; }
.cifra + .cifra { border-left: 1px solid var(--linea); }
.cifra span { font-size: 12px; font-weight: 600; color: var(--t3); }
.cifra b { font: 700 26px/1.1 var(--fuente-titulo); letter-spacing: -.025em; font-variant-numeric: tabular-nums; }
.cifra small { color: var(--t3); font-size: 12px; }
.grafico { padding: 18px 20px 14px; }
.grafico svg { width: 100%; height: 190px; display: block; overflow: visible; }
.grafico .eje { fill: var(--t4); font-size: 10px; font-family: var(--fuente); }
.barras-h { padding: 10px 20px 16px; display: grid; gap: 8px; }
.barra-h { display: grid; grid-template-columns: 120px minmax(0, 1fr) 40px; gap: 12px; align-items: center; font-size: 13px; }
.barra-h .pista { height: 10px; background: rgb(var(--c-t1) / .07); border-radius: 999px; overflow: hidden; }
.barra-h .pista i { display: block; height: 100%; width: 100%; background: var(--t1); border-radius: 999px; transform: scaleX(var(--f, 0)); transform-origin: left; transition: transform .5s var(--curva); }
.barra-h b { text-align: right; font-variant-numeric: tabular-nums; }

/* --- Ajustes -------------------------------------------------------------------------- */

.ajustes { max-width: 760px; }
.grupo > h2 { font-size: 13px; font-weight: 600; color: var(--t3); margin: 0 16px 8px; }
.grupo + .grupo { margin-top: 26px; }
.fila-ajuste { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 16px; min-height: 52px; }
.fila-ajuste + .fila-ajuste { border-top: 1px solid var(--linea); }
.fila-ajuste .principal { min-width: 0; }
.fila-ajuste .principal p { color: var(--t3); font-size: 12.5px; margin-top: 2px; }
.fila-ajuste input:not([type="checkbox"]), .fila-ajuste select { width: 140px; text-align: right; }
.fila-ajuste .controles { display: flex; gap: 8px; align-items: center; }
.pista-ayuda { color: var(--t3); font-size: 12.5px; margin: 8px 16px 0; }
.fila-ajuste input[type="email"], .fila-ajuste input[type="text"] { width: 240px; }
.fila-plantilla { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; padding: 14px 16px; }
.fila-plantilla + .fila-plantilla, .fila-plantilla + .fila-ajuste { border-top: 1px solid var(--linea); }
.fila-plantilla input { font-weight: 600; }
.fila-plantilla textarea { min-height: 96px; }

/* --- Avisos en pantalla ---------------------------------------------------------------- */

.tostadas { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); display: grid; gap: 8px; z-index: 50; pointer-events: none; }
.tostada { background: var(--t1); color: var(--superficie); padding: 10px 16px; border-radius: 999px; font-weight: 600; font-size: 13px; box-shadow: var(--sombra-flota); animation: tostada .3s var(--curva); pointer-events: auto; max-width: min(92vw, 560px); }
.tostada.error { background: var(--rojo); color: #fff; }
@keyframes tostada { from { opacity: 0; transform: translateY(10px) scale(.98); } }

.esqueleto { background: linear-gradient(90deg, rgb(var(--c-t1) / .05), rgb(var(--c-t1) / .1), rgb(var(--c-t1) / .05)); background-size: 200% 100%; animation: brillo 1.2s ease-in-out infinite; border-radius: 6px; height: 14px; }
@keyframes brillo { to { background-position: -200% 0; } }

.banda { display: flex; gap: 12px; align-items: center; padding: 12px 14px 12px 16px; border-radius: var(--r-panel); margin-bottom: 18px; background: var(--superficie); box-shadow: var(--sombra); color: var(--t1); font-weight: 500; }
.banda .icono { color: var(--ambar); }
.banda.roja .icono { color: var(--rojo); }
.banda .boton { margin-left: auto; }

/* --- Celular ---------------------------------------------------------------------------- */

@media (max-width: 1080px) {
  .dos-col, .ficha { grid-template-columns: minmax(0, 1fr); }
  .dos-col > .primero-en-celular { order: -1; }
  .borrador { grid-template-columns: minmax(0, 1fr); }
  .borrador .correo { border-right: 0; border-bottom: 1px solid var(--linea); }
  .borrador .contexto { border-radius: 0 0 var(--r-panel) var(--r-panel); }
  .cifras { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .cifra:nth-child(4) { border-left: 0; }
  .cifra:nth-child(n + 4) { border-top: 1px solid var(--linea); }
}

@media (max-width: 820px) {
  body { font-size: 15px; }
  .app { grid-template-columns: minmax(0, 1fr); }
  .lateral {
    position: fixed; top: auto; bottom: 0; left: 0; right: 0; height: auto; z-index: 40;
    flex-direction: row; padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
    border-right: 0; border-top: 1px solid var(--linea);
  }
  .marca, .lateral-pie { display: none; }
  .nav { grid-auto-flow: column; grid-auto-columns: 1fr; width: 100%; }
  .nav a { flex-direction: column; gap: 3px; padding: 6px 2px; font-size: 10.5px; font-weight: 600; }
  .nav a .icono { width: 22px; height: 22px; }
  .nav .cuenta-n { position: absolute; margin: 0 0 0 18px; transform: translateY(-4px); background: var(--t1); color: var(--superficie); border-radius: 999px; padding: 0 5px; font-size: 10px; line-height: 15px; }
  .nav a { position: relative; }
  .nav a[aria-current="page"] .cuenta-n { color: var(--superficie); }
  .contenido { padding: calc(20px + env(safe-area-inset-top)) 16px calc(96px + env(safe-area-inset-bottom)); }
  .cabecera h1 { font-size: 24px; }
  .bandeja { grid-template-columns: minmax(0, 1fr); height: auto; min-height: 0; overflow: visible; }
  .bandeja.con-hilo .columna-lista { display: none; }
  .bandeja:not(.con-hilo) .columna-hilo { display: none; }
  .bandeja .hilos { max-height: none; }
  .cifras { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cifra:nth-child(odd) { border-left: 0; }
  .cifra:nth-child(n + 3) { border-top: 1px solid var(--linea); }
  .formulario .doble { grid-template-columns: minmax(0, 1fr); }
  .fila-ajuste input:not([type="checkbox"]), .fila-ajuste select { width: 110px; }
  .ranura { height: 18px; }
  .barra-h { grid-template-columns: 96px minmax(0, 1fr) 32px; }
}

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

/* --- Ingreso ---------------------------------------------------------------------------- */

.ingreso { min-height: 100dvh; display: grid; place-items: center; padding: 24px; }
.ingreso main { width: min(100%, 400px); display: grid; gap: 22px; }
.marca-ingreso { display: flex; align-items: flex-end; gap: 9px; }
.marca-ingreso .logo { height: 30px; width: auto; color: var(--t1); }
.marca-ingreso span { color: var(--t3); font-size: 18px; line-height: 1; }
.ingreso p { color: var(--t3); }
.ingreso .boton { height: 44px; font-size: 14px; width: 100%; }
