/* El sistema visual de Abarrotín en la web. Los valores salen del catálogo de
   colores del iPhone (ios/TiendAI/Recursos/Assets.xcassets), con los MISMOS
   nombres que en Tema.swift: `bosque` es el azul de marca y `dorado` el
   amarillo (nombres viejos, se conservan para que una pantalla de la web y la
   suya del iPhone se lean igual). Claro y oscuro siguen al sistema. */
:root {
  --bosque: #0A6CF0; --bosque-profundo: #012B68; --dorado: #FFB503; --dorado-texto: #945700;
  --resalte: #FFE08A; --sobre-dorado: #1F1605; --acento: #0A60D6;
  --fondo: #F4F7FC; --tarjeta: #FFFFFF; --campo: #FFFFFF; --borde: #E3E8F0;
  --tinta: #111827; --tinta-suave: #5B6475; --sobre-bosque: #FFFFFF; --sobre-bosque-suave: #F2F7FF;
  --bien: #017A57; --revisar: #9A6A00; --atencion: #D92D36; --oportunidad: #6E48E8;
  --mosaico-verde: #01875E; --mosaico-azul: #0A6CF0; --mosaico-amarillo: #FFE7A8; --mosaico-amarillo-texto: #8A5200;
  --mosaico-rosa: #FFD3E4; --mosaico-rosa-texto: #B0205A;
  --barra: #1A5FD0;                 /* la barra lateral del iPad */
  --burbuja: #DDE7F8;               /* el globo de Abarrotín en el Inicio */
  --sombra: 0 4px 12px rgba(13, 51, 115, .07);
  --xs: 4px; --s: 8px; --m: 12px; --l: 16px; --xl: 20px; --xxl: 24px; --seccion: 32px;
  --r-tarjeta: 18px; --r-boton: 16px; --r-campo: 12px; --r-chip: 8px;
  --toque: 48px; --toque-grande: 56px;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bosque: #1A5FD0; --bosque-profundo: #0A1F44; --dorado: #FFC233; --dorado-texto: #FFC24A; --acento: #5B9BFF;
    --fondo: #0B111C; --tarjeta: #151D2B; --campo: #1B2535; --borde: #2A3546;
    --tinta: #EEF2F7; --tinta-suave: #A3ADBA;
    --bien: #3DD6A0; --revisar: #FFC24A; --atencion: #FF7B7B; --oportunidad: #A99BFF;
    --mosaico-verde: #0E7A58; --mosaico-azul: #1A5FD0; --mosaico-amarillo: #4A3A12; --mosaico-amarillo-texto: #FFD479;
    --mosaico-rosa: #4A2233; --mosaico-rosa-texto: #FF9CC2;
    --barra: #12397F; --burbuja: #1B2A45; --sombra: none;
  }
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; background: var(--fondo); color: var(--tinta);
  font: 17px/1.4 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
}
h1, h2, h3, p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--acento); text-decoration: none; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--acento) 55%, transparent); outline-offset: 2px; }
.ico { width: 1.25em; height: 1.25em; flex: none; fill: currentColor; vertical-align: -0.22em; }

/* ---------- Cascarón: barra lateral (ancho) o pestañas (estrecho) ---------- */
.app { min-height: 100%; display: flex; }
.barra {
  width: 292px; flex: none; margin: 10px; border-radius: 26px; background: var(--barra); color: #fff;
  display: flex; flex-direction: column; position: sticky; top: 10px; height: calc(100vh - 20px); overflow: hidden;
}
.barra-cab { padding: 22px 22px 16px; border-bottom: 1px solid rgba(255,255,255,.14); }
.barra-cab button { all: unset; cursor: pointer; display: block; width: 100%; }
.barra-tienda { font-size: 22px; font-weight: 700; letter-spacing: -.2px; }
.barra-plan { font-size: 15px; opacity: .9; margin-top: 2px; }
.barra-lista { flex: 1; overflow-y: auto; padding: 6px 8px 12px; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.3) transparent; }
.barra-grupo { font-size: 12px; font-weight: 700; letter-spacing: .9px; text-transform: uppercase; opacity: .85; padding: 22px 12px 8px; }
.barra-item {
  all: unset; box-sizing: border-box; cursor: pointer; display: flex; align-items: center; gap: 14px; width: 100%;
  min-height: 44px; padding: 8px 12px; border-radius: 12px; font-size: 17px;
}
.barra-item .ico { width: 22px; height: 22px; }
.barra-item:hover { background: rgba(255,255,255,.10); }
.barra-item[aria-current="page"] { background: rgba(255,255,255,.18); font-weight: 600; }
.barra-item[aria-current="page"] .ico { color: var(--resalte); }
.barra-item .candado { margin-left: auto; opacity: .7; width: 15px; height: 15px; }
.barra-pie { padding: 14px 18px; border-top: 1px solid rgba(255,255,255,.14); font-size: 13.5px; display: flex; gap: 10px; align-items: center; }
.barra-pie i { width: 9px; height: 9px; border-radius: 50%; background: #3DD6A0; flex: none; }
.barra-pie.sin i { background: #FFC24A; }

.zona { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.pantalla { width: 100%; max-width: 1080px; margin: 0 auto; padding: 16px 16px 120px; flex: 1; }
.pantalla.ancha { max-width: 1320px; }
.cab { display: flex; align-items: center; gap: 12px; min-height: 52px; margin-bottom: 8px; }
.cab-titulo { font-size: 17px; font-weight: 600; flex: 1; text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cab-lado { display: flex; gap: 8px; min-width: 48px; }
.cab-lado.fin { justify-content: flex-end; }
.redondo {
  all: unset; box-sizing: border-box; cursor: pointer; width: 48px; height: 48px; border-radius: 50%; background: var(--tarjeta);
  display: grid; place-items: center; color: var(--acento); box-shadow: var(--sombra); border: .5px solid var(--borde); position: relative; flex: none;
}
.redondo .ico { width: 22px; height: 22px; }
.redondo .globo { position: absolute; top: -2px; right: -2px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px; background: var(--atencion); color: #fff; font-size: 12px; font-weight: 700; display: grid; place-items: center; }

.pestanas {
  position: fixed; left: 50%; bottom: max(12px, env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 20;
  width: min(560px, calc(100% - 24px)); display: none; padding: 5px; border-radius: 34px;
  background: color-mix(in srgb, var(--tarjeta) 86%, transparent); backdrop-filter: blur(18px) saturate(1.6); -webkit-backdrop-filter: blur(18px) saturate(1.6);
  box-shadow: 0 8px 28px rgba(13, 51, 115, .16); border: .5px solid var(--borde);
}
.pestana { all: unset; cursor: pointer; flex: 1; display: grid; justify-items: center; gap: 2px; padding: 8px 2px 7px; border-radius: 28px; font-size: 12.5px; font-weight: 500; color: var(--tinta); }
.pestana .ico { width: 26px; height: 26px; }
.pestana[aria-current="page"] { background: color-mix(in srgb, var(--tinta) 9%, transparent); color: var(--acento); font-weight: 600; }
@media (max-width: 899px) {
  .barra { display: none; }
  .barra.abierta { display: flex; position: fixed; inset: 0 auto 0 0; z-index: 40; margin: 0; height: 100%; border-radius: 0 26px 26px 0; width: min(320px, 88vw); }
  .pestanas { display: flex; }
  .velo-barra { position: fixed; inset: 0; z-index: 39; background: rgba(4, 12, 28, .45); }
}
@media (min-width: 900px) { .solo-estrecho { display: none !important; } .velo-barra { display: none; } }
@media (max-width: 899px) { .solo-ancho { display: none !important; } }

/* ---------- Texto ---------- */
.grande { font-size: 34px; font-weight: 800; letter-spacing: -.5px; line-height: 1.12; }
.titulo { font-size: 22px; font-weight: 700; letter-spacing: -.2px; }
.titulo3 { font-size: 20px; font-weight: 700; }
.cuerpo { font-size: 17px; }
.sub { font-size: 15px; }
.nota { font-size: 13px; }
.suave { color: var(--tinta-suave); }
.negrita { font-weight: 600; }
.cifra { font-variant-numeric: tabular-nums; font-weight: 600; }
.etiqueta { font-size: 12px; font-weight: 600; letter-spacing: .5px; text-transform: uppercase; color: var(--tinta-suave); }
.c-bien { color: var(--bien); } .c-revisar { color: var(--revisar); } .c-atencion { color: var(--atencion); } .c-oportunidad { color: var(--oportunidad); }
.c-acento { color: var(--acento); } .c-dorado { color: var(--dorado-texto); }
.derecha { text-align: right; } .centro { text-align: center; }
.corta { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Acomodo ---------- */
.pila { display: flex; flex-direction: column; gap: var(--m); }
.pila.junta { gap: var(--xs); } .pila.s { gap: var(--s); } .pila.l { gap: var(--l); } .pila.xl { gap: var(--xxl); } .pila.seccion { gap: var(--seccion); }
.fila { display: flex; align-items: center; gap: var(--m); }
.fila.s { gap: var(--s); } .fila.l { gap: var(--l); } .fila.arriba { align-items: flex-start; } .fila.base { align-items: baseline; } .fila.envuelve { flex-wrap: wrap; }
.crece { flex: 1; min-width: 0; }
.rejilla { display: grid; gap: var(--m); grid-template-columns: repeat(auto-fit, minmax(var(--min, 220px), 1fr)); }
.rejilla.dos { grid-template-columns: repeat(2, 1fr); } .rejilla.tres { grid-template-columns: repeat(3, 1fr); } .rejilla.cuatro { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 699px) { .rejilla.cuatro { grid-template-columns: repeat(2, 1fr); } }
.dos-columnas { display: grid; gap: var(--l); grid-template-columns: minmax(0, 1fr) minmax(320px, 420px); align-items: start; }
@media (max-width: 899px) { .dos-columnas { grid-template-columns: 1fr; } }

/* ---------- Tarjetas ---------- */
.tarjeta { background: var(--tarjeta); border-radius: var(--r-tarjeta); border: .5px solid var(--borde); box-shadow: var(--sombra); padding: var(--l); min-width: 0; }
.tarjeta.sin-relleno { padding: 0; overflow: hidden; }
.tarjeta.toca { cursor: pointer; text-align: left; width: 100%; display: block; }
.tarjeta-azul { background: var(--bosque); color: var(--sobre-bosque); border-radius: var(--r-tarjeta); padding: var(--l); }
.tarjeta-azul .etiqueta { color: var(--sobre-bosque-suave); } .tarjeta-azul .resalte { color: var(--resalte); }
.mosaico { all: unset; box-sizing: border-box; cursor: pointer; border-radius: 22px; padding: 20px; min-height: 172px; display: flex; flex-direction: column; color: #fff; box-shadow: 0 8px 18px color-mix(in srgb, currentColor 0%, rgba(13,51,115,.12)); transition: transform .12s; }
.mosaico:active { transform: scale(.975); }
.mosaico > .ico { width: 40px; height: 40px; }
.mosaico-pie .ico { width: 20px; height: 20px; }
.mosaico-nombre { font-size: 19px; font-weight: 600; margin-top: auto; }
.mosaico-cifra { font-size: 32px; font-weight: 800; letter-spacing: -.3px; line-height: 1.15; font-variant-numeric: tabular-nums; }
.mosaico-pie { display: flex; align-items: center; justify-content: space-between; font-size: 17px; font-weight: 600; }
.mosaico.verde { background: var(--mosaico-verde); } .mosaico.azul { background: var(--mosaico-azul); }
.mosaico.amarillo { background: var(--mosaico-amarillo); color: var(--mosaico-amarillo-texto); } .mosaico.rosa { background: var(--mosaico-rosa); color: var(--mosaico-rosa-texto); }
.mini { background: var(--tarjeta); border-radius: var(--r-tarjeta); border: .5px solid var(--borde); box-shadow: var(--sombra); padding: 14px; display: flex; flex-direction: column; gap: 4px; min-height: 108px; }
.mini .valor { font-size: 22px; font-weight: 700; margin-top: auto; font-variant-numeric: tabular-nums; }

/* ---------- Listas ---------- */
.lista { background: var(--tarjeta); border-radius: var(--r-tarjeta); border: .5px solid var(--borde); box-shadow: var(--sombra); overflow: hidden; }
.renglon { all: unset; box-sizing: border-box; display: flex; align-items: center; gap: var(--m); width: 100%; min-height: var(--toque-grande); padding: 10px var(--l); border-bottom: .5px solid var(--borde); }
.renglon:last-child { border-bottom: 0; }
button.renglon, a.renglon { cursor: pointer; }
button.renglon:hover, a.renglon:hover { background: color-mix(in srgb, var(--acento) 5%, transparent); }
.renglon .punta { color: var(--tinta-suave); opacity: .6; width: 16px; height: 16px; }
.insignia { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; flex: none; background: color-mix(in srgb, var(--c, var(--acento)) 13%, transparent); color: var(--c, var(--acento)); }
.insignia .ico { width: 21px; height: 21px; }
.seccion-cab { display: flex; align-items: baseline; justify-content: space-between; gap: var(--m); margin: var(--s) 0 calc(-1 * var(--xs)); }
.seccion-cab button, .seccion-cab a { all: unset; cursor: pointer; color: var(--acento); font-weight: 600; font-size: 17px; }

/* ---------- Chips ---------- */
.chip { display: inline-flex; align-items: center; gap: 5px; padding: 4px 9px; border-radius: var(--r-chip); font-size: 13px; font-weight: 600; background: color-mix(in srgb, var(--c, var(--tinta-suave)) 13%, transparent); color: var(--c, var(--tinta-suave)); white-space: nowrap; }
.chip .ico { width: 14px; height: 14px; }
.chip.bien { --c: var(--bien); } .chip.revisar { --c: var(--revisar); } .chip.atencion { --c: var(--atencion); } .chip.oportunidad { --c: var(--oportunidad); }
.pastillas { display: flex; gap: var(--s); overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.pastillas::-webkit-scrollbar { display: none; }
.pastilla { all: unset; cursor: pointer; white-space: nowrap; padding: 9px 15px; border-radius: 999px; font-size: 15px; font-weight: 600; background: var(--tarjeta); border: .5px solid var(--borde); color: var(--tinta); }
.pastilla[aria-pressed="true"] { background: var(--dorado); color: var(--sobre-dorado); border-color: transparent; }
.segmentado { display: flex; padding: 3px; border-radius: 12px; background: color-mix(in srgb, var(--tinta) 8%, transparent); }
.segmentado button { all: unset; cursor: pointer; flex: 1; text-align: center; padding: 8px 10px; border-radius: 9px; font-size: 15px; font-weight: 600; color: var(--tinta); white-space: nowrap; }
.segmentado button[aria-pressed="true"] { background: var(--tarjeta); box-shadow: 0 1px 4px rgba(0,0,0,.12); }

/* ---------- Botones ---------- */
.boton { all: unset; box-sizing: border-box; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: var(--toque-grande); padding: 10px 18px; border-radius: var(--r-boton); font-size: 17px; font-weight: 700; text-align: center; transition: transform .1s, opacity .1s; }
.boton:active { transform: scale(.985); }
.boton[disabled] { opacity: .45; cursor: default; }
.boton.principal { background: var(--bosque); color: #fff; }
.boton.dinero { background: var(--dorado); color: var(--sobre-dorado); }
.boton.secundario { background: color-mix(in srgb, var(--acento) 11%, transparent); color: var(--acento); }
.boton.peligro { background: color-mix(in srgb, var(--atencion) 11%, transparent); color: var(--atencion); }
.boton.liso { color: var(--acento); min-height: var(--toque); font-weight: 600; }
.boton.chico { min-height: 40px; width: auto; padding: 6px 14px; font-size: 15px; border-radius: 12px; }
.boton.auto { width: auto; }
.girando { width: 20px; height: 20px; border-radius: 50%; border: 2.5px solid currentColor; border-right-color: transparent; animation: giro .7s linear infinite; }
@keyframes giro { to { transform: rotate(360deg); } }

/* ---------- Campos ---------- */
.campo { display: flex; flex-direction: column; gap: 6px; }
.campo > span { font-size: 15px; font-weight: 600; }
.campo > small { font-size: 13px; color: var(--tinta-suave); }
.entrada, select.entrada, textarea.entrada { width: 100%; min-height: var(--toque); padding: 11px 14px; border-radius: var(--r-campo); border: 1px solid var(--borde); background: var(--campo); font-size: 17px; outline: none; appearance: none; -webkit-appearance: none; }
.entrada:focus { border-color: var(--acento); box-shadow: 0 0 0 3px color-mix(in srgb, var(--acento) 18%, transparent); }
.entrada.cifra { text-align: right; }
textarea.entrada { min-height: 96px; resize: vertical; }
select.entrada { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 256 256' fill='%235B6475'%3E%3Cpath d='M215.4 92.9A8 8 0 0 0 208 88H48a8 8 0 0 0-5.7 13.7l80 80a8 8 0 0 0 11.4 0l80-80a8 8 0 0 0 1.7-8.8Z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; background-size: 14px; padding-right: 36px; }
.buscador { position: relative; }
.buscador .ico { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--tinta-suave); }
.buscador .entrada { padding-left: 42px; border-radius: 14px; }
.interruptor { appearance: none; -webkit-appearance: none; width: 51px; height: 31px; border-radius: 16px; background: color-mix(in srgb, var(--tinta) 18%, transparent); position: relative; cursor: pointer; flex: none; transition: background .15s; margin: 0; }
.interruptor::after { content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff; box-shadow: 0 2px 5px rgba(0,0,0,.25); transition: transform .15s; }
.interruptor:checked { background: #34C759; } .interruptor:checked::after { transform: translateX(20px); }
.paso { display: inline-flex; align-items: center; border-radius: 12px; background: color-mix(in srgb, var(--tinta) 8%, transparent); }
.paso button { all: unset; cursor: pointer; width: 44px; height: 40px; display: grid; place-items: center; color: var(--acento); }
.paso output { min-width: 44px; text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; }

/* ---------- Estados ---------- */
.vacio { display: grid; justify-items: center; text-align: center; gap: 10px; padding: 40px 20px; }
.vacio img { width: 132px; height: auto; }
.vacio .ico { width: 44px; height: 44px; color: var(--tinta-suave); }
.vacio p { max-width: 420px; }
.cargando { display: grid; place-items: center; gap: 12px; padding: 60px 20px; color: var(--tinta-suave); }
.banda { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 14px; background: color-mix(in srgb, var(--c, var(--acento)) 11%, transparent); color: var(--c, var(--acento)); font-size: 15px; }
.banda.revisar { --c: var(--revisar); } .banda.atencion { --c: var(--atencion); } .banda.bien { --c: var(--bien); } .banda.oportunidad { --c: var(--oportunidad); }
.banda .ico { margin-top: 1px; }
.barrita { height: 8px; border-radius: 4px; background: color-mix(in srgb, var(--tinta) 9%, transparent); overflow: hidden; }
.barrita i { display: block; height: 100%; border-radius: 4px; background: var(--c, var(--acento)); }

/* ---------- Hojas (modales) y avisos ---------- */
.velo { position: fixed; inset: 0; z-index: 60; background: rgba(4, 12, 28, .45); display: flex; align-items: flex-end; justify-content: center; animation: aparece .18s; }
.hoja { background: var(--fondo); width: min(640px, 100%); max-height: 92vh; border-radius: 22px 22px 0 0; display: flex; flex-direction: column; animation: sube .22s cubic-bezier(.2,.8,.2,1); }
.hoja.ancha { width: min(900px, 100%); }
@media (min-width: 700px) { .velo { align-items: center; padding: 24px; } .hoja { border-radius: 22px; max-height: 88vh; } }
.hoja-cab { display: flex; align-items: center; gap: 8px; padding: 12px 12px 8px 20px; }
.hoja-cab h2 { flex: 1; font-size: 19px; font-weight: 700; }
.hoja-cuerpo { padding: 8px 20px 20px; overflow-y: auto; }
.hoja-pie { padding: 12px 20px max(16px, env(safe-area-inset-bottom)); border-top: .5px solid var(--borde); display: flex; gap: 10px; }
.cerrar-hoja { all: unset; cursor: pointer; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: color-mix(in srgb, var(--tinta) 9%, transparent); color: var(--tinta-suave); }
@keyframes aparece { from { opacity: 0; } } @keyframes sube { from { transform: translateY(28px); opacity: 0; } }
.avisos { position: fixed; left: 50%; top: 14px; transform: translateX(-50%); z-index: 90; display: grid; gap: 8px; width: min(480px, calc(100% - 24px)); pointer-events: none; }
.aviso { pointer-events: auto; display: flex; gap: 10px; align-items: center; padding: 12px 16px; border-radius: 16px; background: var(--tinta); color: var(--fondo); font-size: 15px; font-weight: 600; box-shadow: 0 10px 30px rgba(0,0,0,.25); animation: sube .2s; }
.aviso.mal { background: var(--atencion); color: #fff; } .aviso.bien { background: var(--bien); color: #fff; }
@media (prefers-color-scheme: dark) { .aviso.bien { color: #06231A; } .aviso.mal { color: #2A0508; } }
.sin-conexion { background: var(--revisar); color: #fff; text-align: center; font-size: 14px; font-weight: 600; padding: 7px 12px; }

/* ---------- Tablas (lo que en el iPad son listas anchas) ---------- */
.tabla { width: 100%; border-collapse: collapse; font-size: 15px; }
.tabla th { text-align: left; font-size: 12px; font-weight: 600; letter-spacing: .5px; text-transform: uppercase; color: var(--tinta-suave); padding: 10px 12px; border-bottom: .5px solid var(--borde); }
.tabla td { padding: 12px; border-bottom: .5px solid var(--borde); }
.tabla tr:last-child td { border-bottom: 0; }
.tabla .num { text-align: right; font-variant-numeric: tabular-nums; }
.desliza { overflow-x: auto; }

/* ---------- Acceso ---------- */
.acceso { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.acceso-caja { width: min(440px, 100%); display: flex; flex-direction: column; gap: var(--l); }
.acceso-logo { width: 190px; margin: 0 auto; display: block; }

@media print { .barra, .pestanas, .cab, .no-imprime { display: none !important; } .pantalla { padding: 0; max-width: none; } body { background: #fff; } }
.grande-ico { width: 26px; height: 26px; }
