/* ==========================================================================
   Contabilidad BZ · sistema de diseño (docs/DISENO.md)
   Modo oscuro único. Todo color, tamaño, radio y espacio sale de los tokens.
   ========================================================================== */

/* ---------- 1. Tokens ---------- */
:root {
  color-scheme: dark;
  /* superficies (suben de tono por capa; sin sombras en cards) */
  --bg-0: #0B0B0C;
  --bg-1: #141416;
  --bg-2: #1C1C1F;
  --bg-3: #26262A;
  --borde: #2A2A2E;
  --borde-fuerte: #3A3A40;
  --linea: rgba(255, 255, 255, .06);
  /* texto */
  --texto-1: #F4F4F2;
  --texto-2: #A3A3A8;
  --texto-3: #6B6B72;
  /* acento único: amarillo BZ */
  --acento: #F5C400;
  --acento-hover: #FFD01A;
  --acento-suave: rgba(245, 196, 0, .12);
  --sobre-acento: #111111;
  /* estado */
  --ok: #3DD68C;        --ok-suave: rgba(61, 214, 140, .12);
  --peligro: #FF5C5C;   --peligro-suave: rgba(255, 92, 92, .12);
  --aviso: #FFB347;     --aviso-suave: rgba(255, 179, 71, .12);
  --info: #6EA8FE;      --info-suave: rgba(110, 168, 254, .12);
  /* paleta de cuentas (solo punto de 8 px o barra lateral de 3 px) */
  --cuenta-1: #6EA8FE; --cuenta-2: #3DD68C; --cuenta-3: #FF8A65; --cuenta-4: #C58AF9;
  --cuenta-5: #4DD0E1; --cuenta-6: #F5C400; --cuenta-7: #F06292; --cuenta-8: #A1887F;
  /* tipografía */
  --f-ui: "DM Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --f-num: "Space Grotesk", var(--f-ui);
  --t-12: 12px; --t-13: 13px; --t-15: 15px; --t-17: 17px; --t-22: 22px; --t-28: 28px; --t-36: 36px;
  --lh-texto: 1.35; --lh-cifra: 1.1;
  /* espacio (escala de 4) */
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 20px; --s6: 24px; --s7: 32px; --s8: 48px;
  --gutter: var(--s4);
  --card-pad: var(--s4);
  --fila: 60px;
  --ancho-max: 1120px;
  /* forma */
  --r-sm: 8px; --r-md: 12px; --r-lg: 18px; --r-pill: 999px;
  --sombra-flotante: 0 12px 40px rgba(0, 0, 0, .5);
  /* movimiento */
  --dur: 160ms;
  --ease: cubic-bezier(.2, .8, .2, 1);
  /* navegación */
  --nav-alto: 56px;
  --sidebar: 240px;
  --foco: 0 0 0 3px var(--acento-suave);
}
@media (min-width: 1024px) {
  :root { --gutter: var(--s7); --card-pad: var(--s5); --fila: 52px; }
}
@media (prefers-reduced-motion: reduce) {
  :root { --dur: 0ms; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- 2. Fuentes (autohospedadas, CSP font-src 'self') ---------- */
@font-face { font-family: "Space Grotesk"; font-style: normal; font-weight: 300 700; font-display: swap; src: url("fonts/SpaceGrotesk-latin.woff2") format("woff2"); }
@font-face { font-family: "DM Sans"; font-style: normal; font-weight: 100 1000; font-display: swap; src: url("fonts/DMSans-latin.woff2") format("woff2"); }

/* ---------- 3. Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--bg-0); }
body {
  margin: 0; min-height: 100vh; background: var(--bg-0); color: var(--texto-1);
  font: 400 var(--t-15)/var(--lh-texto) var(--f-ui);
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
}
a { color: inherit; text-decoration: none; }
a:hover { text-decoration: none; }
p { margin: 0 0 var(--s3); }
h1, h2, h3, h4 { margin: 0; font-weight: 600; line-height: 1.2; color: var(--texto-1); }
h1 { font-family: var(--f-num); font-size: var(--t-28); letter-spacing: -0.01em; }
h2 { font-family: var(--f-num); font-size: var(--t-22); letter-spacing: -0.01em; }
h3 { font-size: var(--t-17); }
small, .meta { font-size: var(--t-13); color: var(--texto-2); }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .92em; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: none; box-shadow: var(--foco); border-color: var(--acento); }
.oculto { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[x-cloak] { display: none !important; }
.ic { width: 20px; height: 20px; display: inline-block; vertical-align: middle; flex-shrink: 0; }
.ic-16 { width: 16px; height: 16px; } .ic-22 { width: 22px; height: 22px; } .ic-40 { width: 40px; height: 40px; }

/* tipografía utilitaria */
.cifra { font-family: var(--f-num); font-variant-numeric: tabular-nums; line-height: var(--lh-cifra); font-weight: 600; }
.cifra-22 { font-size: var(--t-22); letter-spacing: -0.01em; }
.cifra-28 { font-size: var(--t-28); letter-spacing: -0.01em; }
.cifra-36 { font-size: var(--t-36); letter-spacing: -0.01em; }
.caption { font-size: var(--t-12); text-transform: uppercase; letter-spacing: .06em; color: var(--texto-3); font-weight: 500; }
.texto-2 { color: var(--texto-2); } .texto-3 { color: var(--texto-3); }
.tabular { font-variant-numeric: tabular-nums; }
/* semántica de montos */
.monto { font-family: var(--f-num); font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }
.monto-ingreso { color: var(--ok); }
.monto-gasto { color: var(--texto-1); }
.monto-neutro { color: var(--texto-2); font-weight: 500; }
.monto-deuda { color: var(--aviso); }
.texto-ok { color: var(--ok); } .texto-peligro { color: var(--peligro); } .texto-aviso { color: var(--aviso); }

/* ---------- 4. Layout ---------- */
.app { display: flex; min-height: 100vh; }
.app-main { flex: 1; min-width: 0; display: flex; flex-direction: column; padding-bottom: calc(var(--nav-alto) + 16px + env(safe-area-inset-bottom)); }
.contenido { width: 100%; max-width: var(--ancho-max); margin: 0 auto; padding: 0 var(--gutter) var(--s7); }
.cabecera-pagina {
  display: flex; align-items: flex-start; justify-content: space-between; gap: var(--s3); flex-wrap: wrap;
  padding: calc(var(--s4) + env(safe-area-inset-top)) var(--gutter) var(--s4);
  max-width: var(--ancho-max); margin: 0 auto; width: 100%;
}
.cabecera-pagina-texto { display: flex; flex-direction: column; gap: var(--s1); min-width: 0; }
.cabecera-pagina .subtitulo { font-size: var(--t-13); color: var(--texto-2); margin: 0; }
.cabecera-acciones { display: flex; gap: var(--s2); align-items: center; flex-wrap: wrap; }
.seccion { margin-top: var(--s7); }
.seccion-titulo { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s3); margin-bottom: var(--s3); }
@media (max-width: 639px) { .seccion-titulo:has(.mes-nav) { flex-wrap: wrap; } .seccion-titulo:has(.mes-nav) .meta { flex-basis: 100%; } }
.seccion-titulo h2 { font-size: var(--t-17); font-family: var(--f-ui); letter-spacing: 0; }
.pila { display: flex; flex-direction: column; gap: var(--s3); }
.grid-2c { display: grid; gap: var(--s4); grid-template-columns: 1fr; }
.grid-ancho { grid-column: 1 / -1; }
@media (min-width: 640px) { .grid-2c { grid-template-columns: 1fr 1fr; } }
.grid-kpi { display: grid; gap: var(--s3); grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 1024px) { .grid-kpi { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); } }
.grid-inicio { display: grid; gap: var(--s3); grid-template-columns: 1fr; }
@media (min-width: 1024px) { .grid-inicio { grid-template-columns: 1fr 1fr; } }
.form-ancho { max-width: 760px; }
.mt { margin-top: var(--s4); }
@media (max-width: 1023px) { .solo-escritorio { display: none !important; } }
@media (min-width: 1024px) { .solo-movil { display: none !important; } }
.fila-acciones { display: flex; gap: var(--s2); flex-wrap: wrap; align-items: center; }
.fila-acciones form { margin: 0; }

/* navegación móvil (barra inferior) */
.nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  background: var(--bg-1); border-top: 1px solid var(--linea);
  padding-bottom: env(safe-area-inset-bottom);
}
.nav-marca, .nav-pie { display: none; }
.nav-lista { list-style: none; margin: 0; padding: 0; display: flex; height: var(--nav-alto); }
.nav-item { flex: 1; min-width: 0; }
.nav-item a, .nav-boton {
  all: unset; box-sizing: border-box; cursor: pointer; width: 100%; height: 100%;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  color: var(--texto-3); font-size: 11px; font-weight: 500; letter-spacing: .01em; -webkit-tap-highlight-color: transparent;
}
.nav-item a:focus-visible, .nav-boton:focus-visible { box-shadow: inset var(--foco); }
.nav-item.activo a { color: var(--acento); }
.nav-icono .ic { width: 22px; height: 22px; }
.nav-item-destacado .nav-boton { overflow: visible; }
.nav-item-destacado .nav-icono {
  display: grid; place-items: center; width: 52px; height: 52px; border-radius: 50%;
  background: var(--acento); color: var(--sobre-acento); margin-top: -24px;
  box-shadow: 0 6px 20px rgba(245, 196, 0, .35); transition: transform var(--dur) var(--ease);
}
.nav-item-destacado .nav-boton:active .nav-icono { transform: translateY(1px); }
.nav-item-destacado .nav-texto { display: none; }
/* escritorio: sidebar */
@media (min-width: 1024px) {
  .app-main { padding-bottom: 0; }
  .nav {
    position: sticky; top: 0; bottom: auto; height: 100vh; width: var(--sidebar); flex-shrink: 0;
    border-top: 0; border-right: 1px solid var(--linea); padding: var(--s5) var(--s3);
    display: flex; flex-direction: column;
  }
  .nav-marca { display: flex; align-items: center; gap: var(--s3); padding: 0 var(--s3) var(--s6); color: var(--texto-1); }
  .nav-marca .logo { height: 24px; width: auto; }
  .nav-marca-nombre { font-size: var(--t-13); font-weight: 500; color: var(--texto-2); letter-spacing: .02em; }
  .nav-lista { flex-direction: column; height: auto; gap: 2px; }
  .nav-item { flex: 0 0 auto; }
  .nav-item a, .nav-boton { flex-direction: row; justify-content: flex-start; gap: var(--s3); height: 40px; padding: 0 var(--s3); border-radius: var(--r-sm); font-size: var(--t-15); font-weight: 500; color: var(--texto-2); position: relative; transition: background var(--dur) var(--ease), color var(--dur) var(--ease); }
  .nav-item a:hover { background: var(--bg-2); color: var(--texto-1); }
  .nav-item.activo a { background: var(--bg-3); color: var(--texto-1); }
  .nav-item.activo a::before { content: ""; position: absolute; left: 0; top: 8px; bottom: 8px; width: 3px; border-radius: 2px; background: var(--acento); }
  .nav-item-destacado { order: 10; margin-top: var(--s4); }
  .nav-item-destacado .nav-boton { background: var(--acento); color: var(--sobre-acento); font-weight: 600; height: 44px; justify-content: center; }
  .nav-item-destacado .nav-boton:hover { background: var(--acento-hover); }
  .nav-item-destacado .nav-icono { width: auto; height: auto; margin: 0; background: transparent; box-shadow: none; border-radius: 0; }
  .nav-item-destacado .nav-texto { display: inline; }
  .nav-pie { display: block; margin-top: auto; padding-top: var(--s4); border-top: 1px solid var(--linea); }
  .nav-pie form { margin: 0; }
}

/* ---------- 5. Componentes ---------- */
/* botones */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s2);
  height: 44px; padding: 0 var(--s4); border-radius: var(--r-sm); border: 1px solid transparent;
  font-size: var(--t-15); font-weight: 500; white-space: nowrap; text-decoration: none; cursor: pointer;
  background: var(--bg-2); color: var(--texto-1); border-color: var(--borde-fuerte);
  transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease), transform var(--dur) var(--ease), color var(--dur) var(--ease);
  -webkit-tap-highlight-color: transparent;
}
.btn:hover { background: var(--bg-3); }
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .4; pointer-events: none; }
.btn-primario { background: var(--acento); color: var(--sobre-acento); border-color: var(--acento); font-weight: 600; }
.btn-primario:hover { background: var(--acento-hover); border-color: var(--acento-hover); }
.btn-secundario { background: var(--bg-2); border-color: var(--borde-fuerte); color: var(--texto-1); }
.btn-fantasma, .btn-ghost { background: transparent; border-color: transparent; color: var(--texto-2); }
.btn-fantasma:hover, .btn-ghost:hover { background: var(--bg-3); color: var(--texto-1); }
.btn-peligro { background: transparent; border-color: var(--peligro); color: var(--peligro); }
.btn-peligro:hover { background: var(--peligro-suave); }
.btn-fantasma-peligro { background: transparent; border-color: transparent; color: var(--peligro); }
.btn-fantasma-peligro:hover { background: var(--peligro-suave); }
.btn-sm { height: 36px; padding: 0 var(--s3); font-size: var(--t-13); }
.btn-lg { height: 48px; padding: 0 var(--s5); font-size: var(--t-15); }
.btn-bloque { width: 100%; }
.btn-icono { width: 44px; padding: 0; }
.btn-icono.btn-sm { width: 36px; }
.btn[aria-busy="true"] { color: transparent; position: relative; }
.btn[aria-busy="true"]::after { content: ""; position: absolute; width: 16px; height: 16px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; color: var(--sobre-acento); animation: girar .8s linear infinite; }
.btn-secundario[aria-busy="true"]::after, .btn-fantasma[aria-busy="true"]::after { color: var(--texto-2); }
@keyframes girar { to { transform: rotate(360deg); } }

/* campos */
.campo { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.campo > span:first-child, .campo > label:first-child, .campo-etiqueta { font-size: var(--t-13); color: var(--texto-2); font-weight: 500; }
.campo-etiqueta small { color: var(--texto-3); font-weight: 400; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=search], select, textarea {
  width: 100%; height: 44px; padding: 0 14px; border-radius: var(--r-sm); border: 1px solid var(--borde);
  background: var(--bg-3); color: var(--texto-1); font-size: var(--t-15);
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
textarea { height: auto; min-height: 88px; padding: var(--s3) 14px; resize: vertical; }
input::placeholder, textarea::placeholder { color: var(--texto-3); }
input:focus-visible, select:focus-visible, textarea:focus-visible { border-color: var(--acento); box-shadow: var(--foco); outline: none; }
input[type=search]::-webkit-search-cancel-button { -webkit-appearance: none; }
select {
  -webkit-appearance: none; appearance: none; padding-right: 40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23A3A3A8' stroke-width='1.75' 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 12px center; background-size: 18px;
}
select option { background: var(--bg-2); color: var(--texto-1); }
.campo-conteo { width: 6ch; margin-left: auto; }
.campo-conteo > span:first-child { text-align: right; }
.campo-conteo input { text-align: right; font-family: var(--f-num); }
.campo-error { color: var(--peligro); font-size: var(--t-12); margin: 0; display: flex; align-items: center; gap: var(--s1); }
.campo-error:empty { display: none; }
.campo-error::before { content: "!"; display: inline-grid; place-items: center; width: 14px; height: 14px; border-radius: 50%; background: var(--peligro-suave); font-weight: 700; font-size: 10px; flex-shrink: 0; }
.campo-aviso { color: var(--aviso); font-size: var(--t-12); margin: 0; }
.campo-aviso:empty { display: none; }
.campo-ayuda { color: var(--texto-3); font-size: var(--t-12); margin: 0; }
.campo-prefijo { position: relative; }
.campo-prefijo > input { padding-left: 34px; }
.campo-prefijo::before { content: "$"; position: absolute; left: 14px; bottom: 12px; color: var(--texto-3); font-family: var(--f-num); pointer-events: none; }
.campo-busqueda { position: relative; }
.campo-busqueda > input { padding-left: 42px; }
.campo-busqueda > .ic { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--texto-3); pointer-events: none; }
.campo-busqueda .campo-etiqueta { position: absolute; }
/* check / radio / toggle a medida */
.check { display: flex; align-items: center; gap: var(--s3); cursor: pointer; font-size: var(--t-15); min-height: 44px; }
.check input { -webkit-appearance: none; appearance: none; width: 22px; height: 22px; margin: 0; border-radius: 6px; border: 1.5px solid var(--borde-fuerte); background: var(--bg-3); display: grid; place-items: center; flex-shrink: 0; transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease); }
.check input[type=radio] { border-radius: 50%; }
.check input:checked { background: var(--acento); border-color: var(--acento); }
.check input:checked::after { content: ""; width: 12px; height: 12px; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23111' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12 5 5L20 7'/%3E%3C/svg%3E") center/contain no-repeat; }
.check input[type=radio]:checked::after { width: 8px; height: 8px; border-radius: 50%; background: var(--sobre-acento); }
.toggle { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); min-height: 44px; cursor: pointer; }
.toggle input { -webkit-appearance: none; appearance: none; width: 44px; height: 26px; margin: 0; border-radius: var(--r-pill); background: var(--bg-3); border: 1px solid var(--borde-fuerte); position: relative; flex-shrink: 0; transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease); }
.toggle input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: var(--texto-2); transition: transform var(--dur) var(--ease), background var(--dur) var(--ease); }
.toggle input:checked { background: var(--acento); border-color: var(--acento); }
.toggle input:checked::after { transform: translateX(18px); background: var(--sobre-acento); }
.form { display: flex; flex-direction: column; gap: var(--s4); }
.form-seccion { display: flex; flex-direction: column; gap: var(--s3); }
.form-seccion > .caption { margin-bottom: var(--s1); }
.acciones-form { display: flex; gap: var(--s2); flex-wrap: wrap; align-items: center; margin-top: var(--s2); }
.acciones-form form { margin: 0; }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
legend { padding: 0; }

/* segmented control (holder, tipo) */
.segmentos { display: inline-flex; background: var(--bg-2); border: 1px solid var(--borde); border-radius: var(--r-pill); padding: 3px; gap: 2px; }
.segmento, .holder-opcion { all: unset; box-sizing: border-box; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; padding: 0 var(--s4); height: 34px; border-radius: var(--r-pill); color: var(--texto-2); font-size: var(--t-13); font-weight: 500; white-space: nowrap; transition: background var(--dur) var(--ease), color var(--dur) var(--ease); }
.segmento input { position: absolute; opacity: 0; }
.segmento.activo, .holder-opcion.activo, .segmento[aria-checked="true"] { background: var(--bg-3); color: var(--texto-1); }
.segmento:focus-visible, .holder-opcion:focus-visible { box-shadow: var(--foco); }
.holder-selector { display: inline-flex; background: var(--bg-2); border: 1px solid var(--borde); border-radius: var(--r-pill); padding: 3px; gap: 2px; margin: 0; }
.segmentos-bloque { display: flex; width: 100%; } .segmentos-bloque .segmento { flex: 1; }

/* chips */
.chips { display: flex; gap: var(--s2); flex-wrap: wrap; align-items: center; }
.chips-scroll { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; -ms-overflow-style: none; margin: 0 calc(-1 * var(--gutter)); padding: 0 var(--gutter); mask-image: linear-gradient(90deg, transparent, #000 var(--s4), #000 calc(100% - var(--s4)), transparent); -webkit-mask-image: linear-gradient(90deg, transparent, #000 var(--s4), #000 calc(100% - var(--s4)), transparent); }
.chips-scroll::-webkit-scrollbar { display: none; }
.chip { all: unset; box-sizing: border-box; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 var(--s3); border-radius: var(--r-pill); background: var(--bg-2); border: 1px solid var(--borde); font-size: var(--t-13); font-weight: 500; color: var(--texto-2); white-space: nowrap; transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease), color var(--dur) var(--ease); }
.chip:hover { background: var(--bg-3); color: var(--texto-1); }
.chip[aria-pressed="true"], .chip.activo { background: var(--acento-suave); border-color: var(--acento); color: var(--texto-1); }
.chip:focus-visible { box-shadow: var(--foco); }
.chip .ic { width: 16px; height: 16px; }

/* cards y KPIs */
.tarjeta { background: var(--bg-1); border: 1px solid var(--borde); border-radius: var(--r-md); padding: var(--card-pad); }
.tarjeta-plana { padding: 0; overflow: hidden; }
.tarjeta-cabecera { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); margin-bottom: var(--s3); flex-wrap: wrap; }
.tarjeta-cabecera h2 { font-size: var(--t-17); font-family: var(--f-ui); letter-spacing: 0; }
.kpi { display: flex; flex-direction: column; gap: var(--s1); min-width: 0; }
.kpi-etiqueta { font-size: var(--t-12); text-transform: uppercase; letter-spacing: .06em; color: var(--texto-3); font-weight: 500; }
.kpi-cifra { font-family: var(--f-num); font-variant-numeric: tabular-nums; font-size: var(--t-28); font-weight: 600; letter-spacing: -0.01em; line-height: var(--lh-cifra); color: var(--texto-1); overflow-wrap: anywhere; }
.kpi-cifra.principal { font-size: var(--t-36); }
.kpi-sub { font-size: var(--t-13); color: var(--texto-2); }
.delta-ok { color: var(--ok); } .delta-mal { color: var(--peligro); }
.kpis { display: contents; }
.kpis-linea { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s3); }
.kpis-linea .kpi-cifra { font-size: var(--t-22); }
@media (max-width: 639px) {
  /* en móvil las cifras grandes no caben en dos columnas: la principal ocupa el ancho y las demás bajan a 22px */
  .grid-kpi > .kpi:first-child { grid-column: 1 / -1; }
  .grid-kpi .kpi-cifra { font-size: var(--t-22); }
  .grid-kpi .kpi-cifra.principal { font-size: var(--t-36); }
  .kpis-linea { gap: var(--s2); }
  .kpis-linea .kpi-cifra { font-size: var(--t-15); }
  .kpis-linea .kpi-sub { font-size: var(--t-12); }
}
.tarjeta .caption + .kpis-linea { margin-top: var(--s2); }
.tarjeta .kpis-linea + .caption, .tarjeta .campo-ayuda + .caption, .tarjeta .lista-saldos + .caption { margin-top: var(--s4); }

/* badges */
.badge { display: inline-flex; align-items: center; gap: 4px; height: 20px; padding: 0 8px; border-radius: var(--r-pill); font-size: 11px; font-weight: 500; letter-spacing: .01em; background: var(--bg-3); color: var(--texto-2); white-space: nowrap; }
.badge-ok { background: var(--ok-suave); color: var(--ok); }
.badge-aviso { background: var(--aviso-suave); color: var(--aviso); }
.badge-info { background: var(--info-suave); color: var(--info); }
.badge-peligro { background: var(--peligro-suave); color: var(--peligro); }
.badge-acento { background: var(--acento-suave); color: var(--acento); }

/* divisores y breadcrumb */
.divisor { border: 0; border-top: 1px solid var(--linea); margin: var(--s4) 0; }
.breadcrumb { display: flex; align-items: center; gap: var(--s1); font-size: var(--t-13); color: var(--texto-3); margin: 0; }
.breadcrumb a { color: var(--texto-2); }
.breadcrumb .ic { width: 14px; height: 14px; }

/* punto y barra de color de cuenta */
.punto { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--c, var(--texto-3)); flex-shrink: 0; }
.c-0 { --c: var(--texto-3); } .c-1 { --c: var(--cuenta-1); } .c-2 { --c: var(--cuenta-2); } .c-3 { --c: var(--cuenta-3); } .c-4 { --c: var(--cuenta-4); }
.c-5 { --c: var(--cuenta-5); } .c-6 { --c: var(--cuenta-6); } .c-7 { --c: var(--cuenta-7); } .c-8 { --c: var(--cuenta-8); }

/* lista de cuentas */
.lista-cuentas { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--s3); }
.cuenta-fila { display: flex; align-items: center; gap: var(--s3); min-height: 64px; padding: var(--s3) var(--card-pad) var(--s3) calc(var(--card-pad) + 6px); background: var(--bg-1); border: 1px solid var(--borde); border-radius: var(--r-md); position: relative; color: var(--texto-1); transition: background var(--dur) var(--ease); }
.cuenta-fila::before { content: ""; position: absolute; left: 0; top: 10px; bottom: 10px; width: 3px; border-radius: 2px; background: var(--c, var(--texto-3)); }
.cuenta-fila:hover { background: var(--bg-2); }
.cuenta-fila.inactiva { opacity: .5; }
.cuenta-texto { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.cuenta-nombre { font-size: var(--t-15); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cuenta-meta { font-size: var(--t-13); color: var(--texto-3); }
.cuenta-saldo { text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.cuenta-saldo .cifra { font-size: var(--t-22); }
.cuenta-saldo small { font-size: var(--t-12); color: var(--texto-3); }
.cuenta-fila progress, .barra { display: block; width: 100%; height: 4px; border: 0; background: var(--bg-3); border-radius: 2px; overflow: hidden; -webkit-appearance: none; appearance: none; margin-top: 6px; }
.barra::-webkit-progress-bar { background: var(--bg-3); border-radius: 2px; }
.barra::-webkit-progress-value { background: var(--aviso); border-radius: 2px; }
.barra::-moz-progress-bar { background: var(--aviso); border-radius: 2px; }
.lista-saldos { list-style: none; margin: 0; padding: 0; }
.saldo-fila { display: flex; align-items: center; gap: var(--s3); min-height: 52px; padding: var(--s2) 0; border-bottom: 1px solid var(--linea); color: var(--texto-1); }
.lista-saldos li:last-child .saldo-fila { border-bottom: 0; }
.saldo-nombre { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.saldo-nombre small { color: var(--texto-3); }
.saldo-monto { text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 1px; }
.saldo-monto small { font-size: var(--t-12); color: var(--texto-3); font-family: var(--f-ui); font-weight: 400; }
.saldo-total { display: flex; justify-content: space-between; gap: var(--s3); flex-wrap: wrap; padding-top: var(--s3); margin-top: var(--s2); border-top: 1px solid var(--linea); font-size: var(--t-13); color: var(--texto-2); }

/* filas de movimiento */
.lista-mov { list-style: none; margin: 0; padding: 0; }
.tarjeta-lista { padding: 0 var(--card-pad); }
.dia-cabecera { position: sticky; top: 0; z-index: 2; display: flex; align-items: baseline; justify-content: space-between; gap: var(--s3); padding: var(--s3) var(--s1) var(--s2); margin: var(--s4) 0 0; background: var(--bg-0); font-size: var(--t-12); text-transform: uppercase; letter-spacing: .06em; color: var(--texto-3); font-weight: 500; }
.dia-cabecera .subtotal { font-family: var(--f-num); font-variant-numeric: tabular-nums; text-transform: none; letter-spacing: 0; color: var(--texto-2); }
.mov { display: flex; align-items: center; gap: var(--s2); border-bottom: 1px solid var(--linea); }
.mov:last-child { border-bottom: 0; }
.mov-principal { flex: 1; min-width: 0; display: flex; align-items: center; gap: var(--s3); min-height: var(--fila); padding: var(--s2) 0; color: var(--texto-1); transition: background var(--dur) var(--ease); }
.mov-icono { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--bg-3); flex-shrink: 0; font-size: 18px; line-height: 1; color: var(--texto-2); }
.mov-texto { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.mov-titulo { font-size: var(--t-15); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mov-sub { display: block; min-width: 0; font-size: var(--t-13); color: var(--texto-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mov-sub > * + * { margin-left: 4px; }
.mov-cuenta { display: inline; }
.mov-cuenta::before { content: ""; display: inline-block; width: 8px; height: 8px; margin-right: 5px; border-radius: 50%; background: var(--c, var(--texto-3)); vertical-align: 0; }
.mov-monto { font-family: var(--f-num); font-variant-numeric: tabular-nums; font-weight: 600; font-size: var(--t-15); white-space: nowrap; }
.mov-chevron { color: var(--texto-3); }
.mov-inline { display: none; }
@media (min-width: 1024px) {
  .mov-chevron { display: none; }
  .mov-principal:hover { background: var(--bg-1); }
  .mov-inline { display: flex; align-items: center; gap: var(--s2); width: 260px; flex-shrink: 0; }
  .mov-inline-texto { color: var(--texto-3); font-size: var(--t-13); }
  .select-inline { height: 36px; padding: 0 32px 0 10px; font-size: var(--t-13); background-color: transparent; border-color: transparent; background-position: right 8px center; }
  .select-inline:hover, .select-inline:focus { border-color: var(--borde); background-color: var(--bg-3); }
  .mov-inline-estado { font-size: var(--t-13); color: var(--ok); min-width: 1.2em; }
}
.lista-mov-nueva .mov:first-child .mov-principal { animation: aparecer var(--dur) var(--ease); }
@keyframes aparecer { from { background: var(--acento-suave); } to { background: transparent; } }

/* filtros y buscador */
.filtros { display: flex; gap: var(--s2); flex-wrap: wrap; align-items: center; }
.filtros .campo { flex: 1 1 140px; } .filtros .campo-busqueda { flex: 2 1 220px; }
.filtros select, .filtros input { height: 44px; }
.filtros-avanzados { display: contents; }
@media (max-width: 1023px) {
  .filtros-avanzados { display: none; }
  .filtros-conmutador:checked ~ .filtros-avanzados { display: contents; }
  .filtros-conmutador:focus-visible + .btn { box-shadow: var(--foco); }
}
.mes-nav { display: flex; align-items: center; gap: var(--s2); }
.mes-nav h2 { font-size: var(--t-17); font-family: var(--f-ui); letter-spacing: 0; min-width: 150px; text-align: center; }
.paginacion { display: flex; gap: var(--s3); align-items: center; justify-content: center; margin: var(--s5) 0; font-size: var(--t-13); color: var(--texto-2); }

/* tablas de escritorio */
.tabla-wrap { overflow-x: auto; margin: 0 calc(-1 * var(--card-pad)); }
.tabla { width: 100%; border-collapse: collapse; font-size: var(--t-15); }
.tabla th { position: sticky; top: 0; background: var(--bg-1); text-align: left; padding: var(--s2) var(--s3); font-size: var(--t-12); text-transform: uppercase; letter-spacing: .06em; color: var(--texto-3); font-weight: 500; border-bottom: 1px solid var(--borde); }
.tabla td { padding: var(--s2) var(--s3); height: 52px; border-bottom: 1px solid var(--linea); vertical-align: middle; }
.tabla tr:hover td { background: var(--bg-2); }
.tabla .num, .tabla th.num { text-align: right; font-variant-numeric: tabular-nums; }
.tabla td.tabular { white-space: nowrap; }   /* una fecha nunca se parte en dos líneas */
.tabla tr.inactiva { opacity: .5; }
.celda-acciones { white-space: nowrap; text-align: right; }
.input-mini { width: 84px; min-width: 84px; height: 36px; padding: 0 8px; } .input-icono { width: 56px; min-width: 56px; text-align: center; }
.input-tabla { min-width: 220px; height: 36px; padding: 0 10px; }
.tabla .flags { font-size: var(--t-12); color: var(--texto-3); }
.tabs { display: flex; gap: var(--s1); border-bottom: 1px solid var(--linea); margin-bottom: var(--s4); }
.tab { padding: var(--s3) var(--s4); color: var(--texto-2); border-bottom: 2px solid transparent; font-weight: 500; font-size: var(--t-15); margin-bottom: -1px; }
.tab.activo { color: var(--texto-1); border-bottom-color: var(--acento); }

/* lista-menú (Ajustes) */
.lista-menu { list-style: none; margin: 0; padding: 0; background: var(--bg-1); border: 1px solid var(--borde); border-radius: var(--r-md); overflow: hidden; }
.lista-menu li { border-bottom: 1px solid var(--linea); }
.lista-menu li:last-child { border-bottom: 0; }
.lista-menu a, .lista-menu li.deshabilitado > .lista-menu-item { display: flex; align-items: center; gap: var(--s3); min-height: 60px; padding: var(--s3) var(--card-pad); color: var(--texto-1); transition: background var(--dur) var(--ease); }
.lista-menu a:hover { background: var(--bg-2); }
.lista-menu-icono { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--bg-3); color: var(--texto-2); flex-shrink: 0; }
.lista-menu-texto { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.lista-menu small { color: var(--texto-3); }
.lista-menu li.deshabilitado { opacity: .5; }
.lista-menu .mov-chevron { display: block; }

/* estados vacíos y skeletons */
.vacio { display: flex; flex-direction: column; align-items: center; text-align: center; gap: var(--s2); padding: var(--s7) var(--s4); color: var(--texto-2); }
.vacio .ic-40 { color: var(--texto-3); }
.vacio h3 { font-size: var(--t-17); }
.vacio p { font-size: 14px; max-width: 32ch; }
.skeleton { background: var(--bg-3); border-radius: var(--r-sm); animation: pulso 1.4s ease-in-out infinite; min-height: 14px; }
@keyframes pulso { 50% { opacity: .5; } }

/* alertas (flash) */
.alerta { display: flex; align-items: flex-start; gap: var(--s2); padding: var(--s3) var(--s4); border-radius: var(--r-sm); margin-bottom: var(--s4); border: 1px solid; font-size: 14px; }
.alerta .ic { width: 18px; height: 18px; margin-top: 1px; }
.alerta-ok { border-color: rgba(61, 214, 140, .35); background: var(--ok-suave); color: var(--texto-1); }
.alerta-ok .ic { color: var(--ok); }
.alerta-error { border-color: rgba(255, 92, 92, .35); background: var(--peligro-suave); color: var(--texto-1); }
.alerta-error .ic { color: var(--peligro); }
.alerta-info { border-color: rgba(110, 168, 254, .35); background: var(--info-suave); }
.alerta-info .ic { color: var(--info); }
.alerta-aviso { border-color: rgba(255, 179, 71, .35); background: var(--aviso-suave); color: var(--texto-1); }
.alerta-aviso .ic { color: var(--aviso); }
.alerta-texto { flex: 1; min-width: 0; }
.alerta-accion { display: block; margin-top: var(--s2); }

/* Fase 2B · subida de cartola */
.subir { display: flex; flex-direction: column; align-items: center; gap: var(--s2); text-align: center; padding: var(--s7) var(--s4); margin-bottom: var(--s5); border: 1px dashed var(--borde-fuerte); border-radius: var(--r-md); background: var(--bg-2); transition: border-color var(--dur) var(--ease), background var(--dur) var(--ease); }
.subir.encima { border-color: var(--acento); background: var(--acento-suave); }
.subir .ic-40 { color: var(--texto-3); }
.subir-etiqueta { font-size: var(--t-15); color: var(--texto-2); cursor: pointer; padding: var(--s3) 0; }
.subir-enlace { color: var(--acento); text-decoration: underline; }
.subir-input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.subir-input:focus-visible + .subir-nombre, .subir:focus-within { box-shadow: var(--foco); }
.subir-nombre { font-family: var(--f-num); font-size: var(--t-13); color: var(--texto-1); }

/* Fase 2B · historial de cartolas */
.lista-cartolas { list-style: none; margin: 0; padding: 0; }
.lista-cartolas li { border-bottom: 1px solid var(--linea); }
.lista-cartolas li:last-child { border-bottom: 0; }
.lista-cartolas li.inactiva { opacity: .5; }
.cartola-fila { display: flex; align-items: center; gap: var(--s3); padding: var(--s3) var(--card-pad); min-height: var(--fila); transition: background var(--dur) var(--ease); }
.cartola-fila:hover { background: var(--bg-2); }
.cartola-texto { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.cartola-nombre { display: flex; align-items: center; gap: var(--s2); font-weight: 500; }
.cartola-texto small { overflow-wrap: anywhere; }
.cartola-estado { display: flex; flex-wrap: wrap; gap: var(--s1); justify-content: flex-end; max-width: 45%; }
@media (max-width: 639px) {
  .cartola-fila { flex-wrap: wrap; }
  .cartola-texto { flex: 1 1 100%; }
  .cartola-estado { max-width: none; justify-content: flex-start; }
  .cartola-fila .mov-chevron { display: none; }
}

/* Fase 2B · pares etiqueta/valor (ficha de cartola, de importación) */
.datos { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: var(--s3) var(--s5); margin: var(--s3) 0 0; }
.dato { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.dato dt { font-size: var(--t-12); text-transform: uppercase; letter-spacing: .06em; color: var(--texto-3); }
.dato dd { margin: 0; font-size: var(--t-15); color: var(--texto-1); overflow-wrap: anywhere; }
.dato dd.cifra { font-family: var(--f-num); font-variant-numeric: tabular-nums; }
.lista-simple { list-style: none; margin: var(--s2) 0 0; padding: 0; display: flex; flex-direction: column; gap: var(--s2); font-size: var(--t-13); color: var(--texto-2); }
.lista-simple .cifra { color: var(--texto-1); }

/* Fase 2B.1 · filas que no se pudieron importar, con sus campos rotulados */
.lista-invalidas { list-style: none; margin: var(--s3) 0 0; padding: 0; display: flex; flex-direction: column; gap: var(--s3); }
.lista-invalidas li { border-left: 2px solid var(--peligro); padding-left: var(--s3); }
.invalida-motivo { margin: 0 0 var(--s1); font-size: var(--t-13); }
.invalida-motivo .caption { margin-right: var(--s2); }
.campos-fila { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: var(--s1) var(--s4); font-size: var(--t-13); color: var(--texto-2); }
.campos-fila li { display: flex; gap: var(--s2); align-items: baseline; min-width: 0; }
.campos-fila .campo-ilegible { color: var(--peligro); }

/* Fase 2B · confirmación en lote */
.confirmar { padding-bottom: calc(var(--nav-alto) + var(--s8)); }
.confirmar-buscador { display: flex; gap: var(--s3); align-items: center; margin-bottom: var(--s4); }
.confirmar-buscador .campo-busqueda { flex: 1; }
.atajos { background: var(--bg-1); border: 1px solid var(--borde); border-radius: var(--r-md); padding: var(--s3) var(--card-pad); margin-bottom: var(--s4); }
kbd { font-family: var(--f-num); font-size: var(--t-12); background: var(--bg-3); border: 1px solid var(--borde-fuerte); border-radius: 6px; padding: 1px 6px; }

.grupo { background: var(--bg-1); border: 1px solid var(--borde); border-radius: var(--r-md); padding: var(--card-pad); margin-bottom: var(--s4); transition: border-color var(--dur) var(--ease), opacity var(--dur) var(--ease); }
.grupo:focus-visible { box-shadow: var(--foco); outline: none; }
.grupo-enfocado { border-color: var(--acento); }
.grupo-hecho { opacity: .5; }
.grupo-cabecera { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--s3); }
.grupo-titulo h3 { font-size: var(--t-17); overflow-wrap: anywhere; }
.grupo-titulo .meta { margin-top: 2px; }
.grupo-estado { font-size: var(--t-13); color: var(--acento); white-space: nowrap; }
.grupo-sugerencia { margin-top: var(--s3); display: flex; flex-direction: column; gap: var(--s2); }
.grupo-sugerencia .campo select { max-width: 420px; }
.grupo-sugerencia .alerta { margin-bottom: 0; }
.grupo-aparte { margin-top: var(--s3); padding-top: var(--s3); border-top: 1px solid var(--linea); display: flex; flex-direction: column; gap: var(--s2); align-items: flex-start; }
.grupo-filas { margin-top: var(--s3); border-top: 1px solid var(--linea); padding-top: var(--s2); }
.grupo-filas summary { font-size: var(--t-13); color: var(--texto-2); cursor: pointer; min-height: 44px; display: flex; align-items: center; }
.grupo-fila { display: flex; align-items: center; gap: var(--s2); flex-wrap: wrap; }
.grupo-fila-texto { flex: 1; min-width: 120px; color: var(--texto-1); overflow-wrap: anywhere; }
.grupo-fila-aparte { opacity: .5; }
.auto-plegado > summary { font-size: var(--t-13); color: var(--texto-2); cursor: pointer; min-height: 44px; display: flex; align-items: center; }

.barra-confirmar { position: fixed; left: 0; right: 0; bottom: var(--nav-alto); z-index: 30; display: flex; align-items: center; gap: var(--s3);
  padding: var(--s3) var(--gutter) calc(var(--s3) + env(safe-area-inset-bottom)); background: var(--bg-2); border-top: 1px solid var(--borde-fuerte); box-shadow: var(--sombra-flotante); }
.barra-texto { flex: 1; font-size: var(--t-13); color: var(--texto-2); }
.barra-texto .cifra { font-size: var(--t-22); color: var(--texto-1); margin-right: var(--s1); }
@media (min-width: 1024px) {
  .barra-confirmar { bottom: 0; left: var(--sidebar); }
  .confirmar { padding-bottom: var(--s8); }
}

/* paleta de colores (formulario de cuenta) */
.paleta { display: flex; gap: var(--s2); flex-wrap: wrap; }
.paleta-opcion { position: relative; }
.paleta-opcion input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.paleta-opcion span { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--c); cursor: pointer; border: 2px solid transparent; transition: transform var(--dur) var(--ease); }
.paleta-opcion span .ic { width: 16px; height: 16px; color: var(--sobre-acento); opacity: 0; }
.paleta-opcion input:checked + span { border-color: var(--texto-1); transform: scale(1.08); }
.paleta-opcion input:checked + span .ic { opacity: 1; }
.paleta-opcion input:focus-visible + span { box-shadow: var(--foco); }

/* diálogo nativo */
.dialogo { background: var(--bg-2); color: var(--texto-1); border: 1px solid var(--borde-fuerte); border-radius: var(--r-md); padding: var(--s5); max-width: 480px; width: calc(100% - 2 * var(--s4)); box-shadow: var(--sombra-flotante); }
.dialogo::backdrop { background: rgba(0, 0, 0, .6); }

/* sheet (móvil) / popover (escritorio) */
.sin-scroll { overflow: hidden; }
.sheet-fondo { position: fixed; inset: 0; background: rgba(0, 0, 0, .55); z-index: 40; }
@keyframes sheet-subir { from { transform: translateY(32px); opacity: 0; } to { transform: none; opacity: 1; } }
.sheet { display: none; position: fixed; left: 0; right: 0; bottom: 0; z-index: 41; background: var(--bg-2); border-radius: var(--r-lg) var(--r-lg) 0 0; border-top: 1px solid var(--borde-fuerte); max-height: 92vh; overflow-y: auto; padding: 0 var(--s4) 0; box-shadow: var(--sombra-flotante); overscroll-behavior: contain; }
.sheet.abierto { display: block; animation: sheet-subir var(--dur) var(--ease); }
.sheet-asa { display: flex; justify-content: center; padding: var(--s2) 0 var(--s1); touch-action: none; cursor: grab; }
.sheet-asa span { width: 36px; height: 4px; border-radius: 2px; background: var(--borde-fuerte); }
.sheet-cabecera { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--s3); }
.sheet-titulo { margin: 0; font-size: var(--t-17); font-family: var(--f-ui); letter-spacing: 0; }
.sheet-form { display: flex; flex-direction: column; gap: var(--s4); }
.sheet-bloque { display: flex; flex-direction: column; gap: var(--s3); }
.campo-monto { position: relative; }
.campo-monto input { height: 64px; padding: 0 0 0 28px; border: 0; border-bottom: 1px solid var(--borde-fuerte); border-radius: 0; background: transparent; font-family: var(--f-num); font-size: var(--t-36); font-weight: 600; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; text-align: left; }
.campo-monto input:focus-visible { box-shadow: none; border-bottom-color: var(--acento); }
.campo-monto::before { content: "$"; position: absolute; left: 0; top: 34px; font-family: var(--f-num); font-size: var(--t-22); color: var(--texto-3); }
.campo-monto input::placeholder { color: var(--texto-3); }
.autocompletar { list-style: none; margin: calc(-1 * var(--s2)) 0 0; padding: var(--s1); background: var(--bg-3); border: 1px solid var(--borde); border-radius: var(--r-sm); max-height: 220px; overflow-y: auto; }
.autocompletar li { display: flex; justify-content: space-between; align-items: center; gap: var(--s2); min-height: 44px; padding: 0 var(--s3); border-radius: 6px; cursor: pointer; font-size: var(--t-15); }
.autocompletar li:hover, .autocompletar li.activo { background: var(--bg-2); }
.autocompletar small { color: var(--texto-3); font-size: var(--t-12); }
.sugerencia { display: flex; align-items: center; gap: var(--s3); padding: var(--s3) var(--s4); background: var(--acento-suave); border: 1px solid rgba(245, 196, 0, .35); border-radius: var(--r-sm); }
.sugerencia-icono { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--bg-2); font-size: 16px; flex-shrink: 0; }
.sugerencia-texto { flex: 1; font-size: 14px; min-width: 0; }
.sheet-resumen { font-size: var(--t-13); color: var(--texto-3); }
.enlace-plegar { all: unset; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; color: var(--texto-2); font-size: var(--t-13); font-weight: 500; min-height: 36px; }
.enlace-plegar:hover { color: var(--texto-1); }
.sheet-acciones { position: sticky; bottom: 0; background: var(--bg-2); padding: var(--s3) 0 calc(var(--s4) + env(safe-area-inset-bottom)); margin-top: var(--s2); border-top: 1px solid var(--linea); }
@media (min-width: 1024px) {
  .sheet { left: 50%; right: auto; bottom: auto; top: 10vh; transform: translateX(-50%); width: 480px; border-radius: var(--r-md); border: 1px solid var(--borde-fuerte); max-height: 82vh; padding: 0 var(--s5); }
  .sheet-asa { display: none; }
  .sheet-cabecera { padding-top: var(--s5); }
  .sheet-acciones { padding-bottom: var(--s5); }
}

/* toast */
.toast-raiz { position: fixed; left: 50%; bottom: calc(var(--nav-alto) + 12px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 50; width: min(480px, calc(100% - 2 * var(--s4))); }
@media (min-width: 1024px) { .toast-raiz { left: auto; right: var(--s6); bottom: var(--s6); transform: none; width: 380px; } }
.toast { position: relative; display: flex; align-items: center; gap: var(--s3); background: var(--bg-2); border: 1px solid var(--borde-fuerte); border-radius: var(--r-md); padding: var(--s3) var(--s4); box-shadow: var(--sombra-flotante); font-size: 14px; overflow: hidden; animation: sheet-subir var(--dur) var(--ease); }
.toast .toast-icono { color: var(--ok); }
.toast-texto { flex: 1; min-width: 0; }
.toast .btn-deshacer { all: unset; cursor: pointer; color: var(--acento); font-weight: 500; padding: var(--s2); margin: calc(-1 * var(--s2)) 0; border-radius: var(--r-sm); }
.toast .btn-deshacer:hover { background: var(--acento-suave); }
.toast-progreso { position: absolute; left: 0; bottom: 0; height: 2px; background: var(--acento); width: 100%; transform-origin: left; animation: toast-barra 30s linear forwards; }
@keyframes toast-barra { from { transform: scaleX(1); } to { transform: scaleX(0); } }

/* login */
.body-auth { display: grid; place-items: center; padding: var(--s4); min-height: 100vh; }
.auth-wrap { width: 100%; max-width: 400px; }
.auth-marca { display: flex; justify-content: center; margin-bottom: var(--s6); color: var(--texto-1); }
.auth-marca .logo { height: 32px; width: auto; }
.auth-card { background: var(--bg-1); border: 1px solid var(--borde); border-radius: var(--r-lg); padding: var(--s6); }
.auth-titulo { font-size: var(--t-22); margin-bottom: var(--s4); }
.auth-pie { text-align: center; margin-top: var(--s4); font-size: var(--t-13); color: var(--texto-3); }
.auth-pie a { color: var(--texto-2); }
.input-codigo { letter-spacing: .25em; font-size: var(--t-22); text-align: center; font-family: var(--f-num); }

/* 2FA / seguridad */
.qr-wrap { background: #fff; display: inline-block; padding: 8px; border-radius: var(--r-sm); margin: var(--s2) 0; }
.secreto { display: inline-block; padding: 6px 10px; background: var(--bg-3); border-radius: 6px; letter-spacing: .1em; font-family: var(--f-num); }
.codigos { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: var(--s2); }
.codigos code { display: block; padding: var(--s2) var(--s3); background: var(--bg-3); border-radius: 6px; text-align: center; font-family: var(--f-num); }
.tarjeta-destacada { border-color: rgba(245, 196, 0, .45); }

/* páginas de error */
.pagina-centrada { min-height: 100vh; display: grid; place-items: center; padding: var(--s4); text-align: center; }
.pagina-centrada .vacio { padding: 0; }
.pagina-centrada .codigo { font-family: var(--f-num); font-size: var(--t-36); font-weight: 600; color: var(--texto-3); letter-spacing: -0.02em; }

/* utilidades finales */
.texto-centro { text-align: center; }
.marca { display: flex; align-items: center; gap: var(--s2); }
.marca-logo { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: var(--r-sm); background: var(--acento); color: var(--sobre-acento); font-family: var(--f-num); font-weight: 700; font-size: 13px; letter-spacing: .04em; }
.marca-nombre { font-weight: 500; color: var(--texto-2); font-size: var(--t-13); }
