:root {
  --prelude: #D9C4E8; --east: #A37DCC; --affair: #6C4389; --dark: #4B2F60; --deep: #2E1B3F;
  --bg: #F3EFF8; --surface: #FFFFFF; --alt: #F0EAF6; --line: #ECE5F3;
  --text: #1E1726; --muted: #7A6F88; --ok: #1F8A5B; --bad: #D64545; --warn: #F5B700;
  --sombra: 0 6px 22px rgba(75, 47, 96, .10);
  --font: -apple-system, "SF Pro Display", "SF Pro Text", "Segoe UI", Roboto, system-ui, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #150E1D; --surface: #211730; --alt: #2A1D3B; --line: #33264A; --text: #F1EAF8; --muted: #A99BBB;
          --ok: #43C48D; --bad: #FF7B7B; --sombra: 0 6px 22px rgba(0, 0, 0, .35); --prelude: #4B2F60; }
}
/* ---------- Versiones de temporada (mismos colores que la caja; se eligen en Configuración) ---------- */
:root[data-tema="halloween"] {
  --prelude: #FFD8A8; --east: #FF9F43; --affair: #E8710A; --dark: #1C1C1C; --deep: #0F0F0F;
  --bg: #FFF4E6; --alt: #FDE9D2; --line: #F2CFA6; --text: #1A1A1A; --muted: #6E6254;
  --sombra: 0 6px 22px rgba(120, 60, 0, .14);
}
:root[data-tema="navidad"] {
  --prelude: #F9D9D6; --east: #D9585A; --affair: #B3202A; --dark: #12452A; --deep: #0A2A18;
  --bg: #F3F8F2; --alt: #E9F3E8; --line: #CBDFCB; --text: #14231A; --muted: #5C6E62;
  --sombra: 0 6px 22px rgba(18, 69, 42, .14);
}
@media (prefers-color-scheme: dark) {
  :root[data-tema="halloween"] { --bg: #15100A; --surface: #221A10; --alt: #2C2114; --line: #3A2B18; --text: #FFEBD6; --muted: #C9A97F;
                                 --prelude: #5A3410; --sombra: 0 6px 22px rgba(0, 0, 0, .4); }
  :root[data-tema="navidad"] { --bg: #0E1A13; --surface: #15261C; --alt: #1B3226; --line: #234031; --text: #E9F6EC; --muted: #9DBBA8;
                               --prelude: #5A1E24; --sombra: 0 6px 22px rgba(0, 0, 0, .4); }
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
/* Sin zoom por doble toque (Safari acerca la pantalla si se toca dos veces rápido); el pellizco para acercar sí se conserva */
html, body, button, a, input, select, label { touch-action: manipulation; }
button { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.35 var(--font); }
[hidden] { display: none !important; }
h1, h2, h3 { margin: 0; }
.suave { color: var(--muted); }
.centro { text-align: center; }
.verde { color: var(--ok); } .rojo { color: var(--bad); }
.error { color: var(--bad); min-height: 1.4em; margin: .5rem 0; font-weight: 600; }
button { font-family: inherit; }

/* ---------- Entrada ---------- */
/* La pantalla del PIN ocupa exactamente la pantalla y NUNCA se desplaza: todo se achica según el alto disponible
   (100dvh = lo que de verdad se ve en Safari del iPhone; 100vh es más alto que eso y por eso aparecía la barra). */
#login { position: fixed; top: 0; right: 0; bottom: 0; left: 0; overflow: hidden; display: flex; flex-direction: column; align-items: center; text-align: center;
         justify-content: center; padding: calc(2vh + env(safe-area-inset-top)) 24px calc(2vh + env(safe-area-inset-bottom));
         background: radial-gradient(120% 70% at 50% 0%, var(--prelude) 0%, transparent 70%); }
/* Con la pantalla del PIN a la vista, la página queda clavada: sin barra, sin desplazarse y sin rebote al jalar con el dedo (iPhone). */
html.en-login, html.en-login body { overflow: hidden; overscroll-behavior: none; height: 100%; }
html.en-login body { position: fixed; width: 100%; }
.login-logo { width: clamp(64px, 13vh, 120px); height: clamp(64px, 13vh, 120px); object-fit: contain; margin-bottom: 4px; filter: drop-shadow(0 6px 14px color-mix(in srgb, var(--dark) 30%, transparent)); }
#login h1 { font-size: clamp(18px, 2.9vh, 24px); letter-spacing: -.3px; }
#login p { margin: 2px 0; }
#login-error { min-height: 1.3em; margin: 2px 0; }
#login-usuario { width: min(280px, 80vw); margin: clamp(6px, 1.5vh, 14px) 0 2px; padding: 11px 14px; border-radius: 14px; border: 2px solid var(--line);
                 background: var(--surface); color: var(--text); font: inherit; font-size: 16px; text-align: center; }
#login-usuario:focus { outline: none; border-color: var(--affair); }
#pin-puntos { display: flex; gap: 18px; margin: clamp(8px, 2vh, 20px) 0 4px; }
#pin-puntos i { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--affair); transition: .12s; }
#pin-puntos i.lleno { background: var(--affair); transform: scale(1.15); }
#teclado { --tecla: clamp(50px, 9vh, 74px); display: grid; grid-template-columns: repeat(3, var(--tecla)); gap: clamp(8px, 1.5vh, 14px); margin-top: 4px; }
#teclado button { width: var(--tecla); height: var(--tecla); padding: 0; font-size: clamp(22px, 3.6vh, 28px); font-weight: 600; border-radius: 50%; border: 0;
                  background: var(--surface); color: var(--text); box-shadow: var(--sombra); transition: transform .08s; }
#teclado button:active { transform: scale(.92); background: var(--prelude); }
#teclado .vacio { visibility: hidden; }

/* ---------- Barra ---------- */
.barra { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 10px;
         padding: calc(10px + env(safe-area-inset-top)) 14px 10px;
         background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
         border-bottom: 1px solid var(--line); }
.icono { width: 40px; height: 40px; background: var(--surface); border: 0; border-radius: 12px; display: flex; flex-direction: column;
         justify-content: center; gap: 4px; padding: 11px; box-shadow: var(--sombra); }
.icono span { display: block; height: 2.5px; background: var(--affair); border-radius: 2px; }
.titulo-barra { font-weight: 700; font-size: 19px; letter-spacing: -.2px; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.icono, .pastilla, .ayuda, .cuenta { flex: none; }
#app { overflow-x: clip; }
@media (max-width: 359px) { .cuenta { display: none; } .barra { gap: 8px; padding-left: 10px; padding-right: 10px; } .pastilla { font-size: 12px; padding: 6px 9px; } }
.cuenta { display: flex; align-items: center; gap: 4px; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.pastilla { background: linear-gradient(135deg, #FFD54A, #F5A300); color: #2b2100; font-weight: 700; font-size: 13px; padding: 7px 11px; border-radius: 20px; white-space: nowrap; }
.pastilla.sin-red { background: #C9C3D1; color: #3b3347; }
.ayuda { width: 36px; height: 36px; border-radius: 50%; border: 0; background: var(--affair); color: #fff; font-size: 19px; font-weight: 700; flex: none; }

/* ---------- Menú ---------- */
#velo { position: fixed; inset: 0; background: rgba(15,8,22,.55); z-index: 9; backdrop-filter: blur(2px); }
#menu { position: fixed; top: 0; bottom: 0; left: 0; width: min(80vw, 310px); background: var(--surface); z-index: 10;
        transform: translateX(-104%); transition: transform .24s cubic-bezier(.2,.8,.2,1); padding: calc(24px + env(safe-area-inset-top)) 18px 20px;
        display: flex; flex-direction: column; gap: 6px; border-radius: 0 24px 24px 0; }
#menu.abierto { transform: none; box-shadow: 8px 0 30px rgba(0,0,0,.3); }
.menu-logo { width: 88px; height: 88px; object-fit: contain; align-self: center; }
.menu-usuario { text-align: center; margin: 2px 0 18px; display: flex; flex-direction: column; font-size: 17px; }
.menu-usuario span { color: var(--muted); font-size: 13px; }
#menu a, #menu .link { display: flex; align-items: center; gap: 12px; padding: 14px 14px; font-size: 18px; color: var(--text); text-decoration: none;
                       border: 0; border-radius: 14px; background: none; text-align: left; }
#menu a i { font-style: normal; font-size: 20px; }
#menu a.activo { background: var(--alt); font-weight: 700; color: var(--affair); }
#menu .link { margin-top: auto; color: var(--bad); font-weight: 600; }

/* ---------- Filtros ---------- */
.filtros { margin: 14px 14px 0; padding: 14px; background: var(--surface); border-radius: 20px; box-shadow: var(--sombra); max-width: 640px; margin-inline: auto; width: calc(100% - 28px); }
.segmentos { display: grid; grid-template-columns: repeat(4, 1fr); background: var(--alt); border-radius: 14px; padding: 4px; gap: 2px; }
.segmentos button { border: 0; background: none; padding: 10px 0; border-radius: 11px; font-size: 14.5px; font-weight: 600; color: var(--muted); transition: .15s; }
.segmentos button.activo { background: var(--surface); color: var(--affair); box-shadow: 0 2px 8px color-mix(in srgb, var(--dark) 18%, transparent); }
.fechas { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: 10px; margin-top: 12px; }
.fechas label { min-width: 0; display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .4px; }
/* Campos de fecha: Safari del iPhone los dibuja con ancho propio y el texto pegado arriba. Aquí se pinta la fecha en un
   recuadro propio (centrada) y el campo de verdad queda encima, invisible, para que al tocar abra el selector normal. */
.campo-fecha { position: relative; height: 46px; border-radius: 12px; background: var(--alt); display: flex; align-items: center;
               padding: 0 38px 0 12px; overflow: hidden; min-width: 0; }
.campo-fecha .valor { font-size: 16px; font-weight: 400; text-transform: none; letter-spacing: 0; color: var(--text); line-height: 1;
                      white-space: nowrap; overflow: hidden; text-overflow: ellipsis; pointer-events: none; }
.campo-fecha::after { content: "📅"; position: absolute; right: 12px; top: 50%; transform: translateY(-50%); font-size: 16px; opacity: .75; pointer-events: none; }
.campo-fecha input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; border: 0; padding: 0; margin: 0; font-size: 16px; background: none; }
/* Safari del iPhone da a los campos de fecha un ancho propio que se sale de su caja; se les obliga a respetarla */
input[type=date], input[type=datetime-local] { -webkit-appearance: none; appearance: none; display: block; width: 100%; min-width: 0; max-width: 100%;
  height: 46px; font: inherit; font-size: 16px; padding: 0 12px; border: 0; border-radius: 12px; background: var(--alt); color: var(--text); text-align: left; }
input[type=date]::-webkit-date-and-time-value, input[type=datetime-local]::-webkit-date-and-time-value { text-align: left; min-width: 0; }
.primario { height: 52px; border: 0; border-radius: 16px; background: linear-gradient(135deg, var(--east), var(--affair) 55%, var(--dark));
            color: #fff; font: 700 18px var(--font); margin-top: 14px; width: 100%; box-shadow: 0 8px 18px color-mix(in srgb, var(--affair) 35%, transparent); transition: transform .08s; }
.primario:active { transform: scale(.98); }
/* Actualizar va en verde menta (el del pelícano del logo) para distinguirlo del morado del resto de la app */
#btn-actualizar, #btn-actualizar-inv { background: linear-gradient(135deg, #5FD6A8, #2EA877 55%, #1F8A5B); box-shadow: 0 8px 18px rgba(31,138,91,.38); }
#btn-actualizar:active, #btn-actualizar-inv:active { background: linear-gradient(135deg, #48C093, #238F63 55%, #19734B); }
.primario:disabled { opacity: .75; }
.primario:disabled .giro { animation: gira 0.9s linear infinite; }
.giro { display: inline-block; }
@keyframes gira { to { transform: rotate(360deg); } }
.aviso { background: #FFF3CD; border-radius: 14px; padding: 11px 14px; margin: 12px auto 0; color: #5c4400; max-width: 612px; width: calc(100% - 28px); font-size: 14.5px; }

/* ---------- Contenido ---------- */
main { padding: 4px 14px 48px; max-width: 640px; margin: 0 auto; }

.hero { margin-top: 16px; padding: 22px 20px 18px; border-radius: 26px; color: #fff; text-align: center; position: relative; overflow: hidden;
        background: radial-gradient(90% 120% at 90% -10%, color-mix(in srgb, var(--east) 65%, white) 0%, transparent 60%), linear-gradient(145deg, var(--affair), var(--deep));
        box-shadow: 0 14px 34px color-mix(in srgb, var(--dark) 38%, transparent); }
.hero::after { content: ""; position: absolute; width: 220px; height: 220px; border-radius: 50%; right: -70px; bottom: -110px; background: rgba(255,255,255,.07); }
.hero-etiqueta { font-size: 14px; letter-spacing: 1.2px; text-transform: uppercase; opacity: .85; font-weight: 600; }
.hero-monto { font-size: clamp(44px, 14vw, 62px); font-weight: 800; letter-spacing: -1.5px; margin: 4px 0 6px; font-variant-numeric: tabular-nums; line-height: 1.05; }
.hero-cambio { display: inline-block; min-height: 28px; font-size: 14px; font-weight: 700; padding: 5px 12px; border-radius: 20px; background: rgba(255,255,255,.16); }
.hero-cambio:empty { visibility: hidden; }
.hero-cambio.sube { background: rgba(67,196,141,.28); } .hero-cambio.baja { background: rgba(255,123,123,.30); }
.hero-chips { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 16px; position: relative; z-index: 1; }
.hero-chips div { background: rgba(255,255,255,.12); border-radius: 16px; padding: 10px 4px; display: flex; flex-direction: column; }
.hero-chips b { font-size: 19px; font-variant-numeric: tabular-nums; }
.hero-chips span { font-size: 12px; opacity: .8; }

.tarjeta { background: var(--surface); border-radius: 22px; margin-top: 16px; overflow: hidden; box-shadow: var(--sombra); }
.tarjeta > h2 { font-size: 17px; padding: 18px 18px 8px; letter-spacing: -.2px; }
.fila { display: flex; justify-content: space-between; gap: 12px; padding: 13px 18px; align-items: center; border-top: 1px solid var(--line); }
.fila b { font-variant-numeric: tabular-nums; white-space: nowrap; }
.fila .pct { color: var(--muted); font-weight: 500; margin-left: 8px; font-size: 14px; }
.fila.barra-fila { display: block; }
.fila .linea { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.fila .n { color: var(--muted); width: 22px; flex: none; font-weight: 700; }
.fila .nom { flex: 1; font-weight: 600; font-size: 15px; text-transform: uppercase; letter-spacing: .1px; }
.pista { height: 7px; border-radius: 4px; background: var(--alt); margin-top: 8px; overflow: hidden; }
.pista i { display: block; height: 100%; border-radius: 4px; background: linear-gradient(90deg, var(--east), var(--affair)); width: 0; transition: width .6s cubic-bezier(.2,.8,.2,1); }
.total { padding: 14px 18px 18px; display: flex; justify-content: space-between; align-items: baseline; border-top: 2px solid var(--line); color: var(--muted); }
.total b { font-size: 26px; color: var(--ok); }
.vacio-msg { padding: 18px; color: var(--muted); text-align: center; }

.cuentas { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 16px; }
.caja-cuenta { border-radius: 22px; padding: 16px 14px; color: #fff; display: flex; flex-direction: column; gap: 2px; box-shadow: var(--sombra); }
.caja-cuenta span { font-size: 13px; opacity: .9; font-weight: 600; }
.caja-cuenta b { font-size: 38px; line-height: 1.05; }
.caja-cuenta em { font-style: normal; font-weight: 600; font-variant-numeric: tabular-nums; opacity: .95; }
.atendidas { background: linear-gradient(145deg, color-mix(in srgb, var(--affair) 88%, white), var(--dark)); }
.canceladas { background: linear-gradient(145deg, #E0627A, #B02A4A); }

.metas { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 6px; padding: 0 10px 18px; }
.meta { text-align: center; padding: 10px 6px; }
.meta h3 { font-size: 14px; color: var(--muted); font-weight: 600; margin-bottom: 4px; }
.dona { position: relative; width: 132px; margin: 0 auto; }
.dona svg { width: 100%; height: auto; display: block; }
.dona .centro-dona { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 21px; }
.meta .resta { font-size: 13px; color: var(--muted); margin-top: 6px; }
.meta .resta b { color: var(--text); }

#grafica svg, #reporte-grafica svg { width: 100%; height: auto; display: block; }
.titulo-vista { margin: 18px 2px 6px; font-size: 26px; letter-spacing: -.5px; }
.volver { border: 0; background: none; color: var(--affair); font-size: 17px; font-weight: 700; padding: 14px 0 0; }

/* ---------- Datos curiosos ---------- */
.curioso { display: flex; gap: 12px; align-items: flex-start; padding: 13px 18px; border-top: 1px solid var(--line); font-size: 15.5px; }
.curioso i { font-style: normal; font-size: 22px; line-height: 1.2; }
.curioso.sube span { color: var(--ok); font-weight: 600; } .curioso.baja span { color: var(--bad); font-weight: 600; }

/* ---------- Adornos de temporada: piezas sueltas, nunca dentro de un botón ---------- */
.adorno { position: absolute; pointer-events: none; user-select: none; -webkit-user-drag: none; z-index: 0; }
#login > :not(.adorno) { position: relative; z-index: 1; }
.hero > .adorno { z-index: 0; }
.hero > :not(.adorno) { position: relative; z-index: 1; }
.menu-mascota { position: static; display: block; height: 118px; margin: auto auto 6px; }
#menu .menu-mascota + .link { margin-top: 0; }
.op-texto { display: flex; flex-direction: column; gap: 1px; flex: 1; text-align: left; }
.op-texto small { font-size: 13px; font-weight: 400; color: var(--muted); }
#app[data-vista="config"] .cuenta, #app[data-vista="plataformas"] .cuenta { display: none; }      /* el reloj de actualización no aplica ahí: así cabe el título */
.lista-op > button.tema-op { gap: 12px; justify-content: flex-start; }
.lista-op > button.tema-op i { margin-left: auto; }
.tema-op img { width: 42px; height: 42px; object-fit: contain; flex: none; }
.tema-op .sin-img { width: 42px; height: 42px; border-radius: 12px; flex: none; background: linear-gradient(135deg, #A37DCC, #4B2F60); }
.nota-cfg { font-size: 13px; padding: 4px 18px 18px; margin: 0; }
.cfg-hoy { margin: 0; padding: 0 18px 8px; font-size: 14px; }

/* ---------- Productos: qué comparar ---------- */
.chips-scroll { display: flex; gap: 8px; overflow-x: auto; margin: 12px -14px 0; padding: 4px 14px 8px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.chips-scroll::-webkit-scrollbar { display: none; }
.chips-scroll button { flex: none; white-space: nowrap; border: 0; padding: 10px 15px; border-radius: 20px; background: var(--surface); color: var(--muted);
                       font-weight: 600; font-size: 14.5px; box-shadow: var(--sombra); }
.chips-scroll button.activo { background: var(--affair); color: #fff; }
.chips-scroll button.vacio { opacity: .5; }
.prod-sub { margin: 0; padding: 0 18px 10px; font-size: 13.5px; }

/* ---------- Ranking de días ---------- */
.sub-ranking { margin: 0; padding: 0 18px 8px; font-size: 14px; }
.sub-ranking:empty { display: none; }
.pos { display: flex; align-items: center; gap: 12px; padding: 12px 18px; border-top: 1px solid var(--line); }
.pos .medalla { width: 30px; text-align: center; font-size: 22px; flex: none; font-weight: 800; color: var(--muted); }
.pos .dia { flex: 1; min-width: 0; }
.pos .dia b { display: block; font-size: 15px; }
.pos .dia small { color: var(--muted); font-size: 12.5px; }
.pos .monto { font-weight: 800; font-variant-numeric: tabular-nums; }
.corte-fila { cursor: pointer; }
.corte-texto { margin: 0; padding: 14px 16px; background: var(--alt); border-top: 1px solid var(--line); font: 12.5px/1.35 ui-monospace, Menlo, Consolas, monospace; overflow-x: auto; white-space: pre; }
.pos.es-hoy { background: var(--alt); box-shadow: inset 4px 0 0 var(--affair); }

.hero-plat { background: linear-gradient(145deg, #5E6B7D, #2B3340); box-shadow: 0 14px 34px rgba(43,51,64,.35); }
.nom-plat { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.nom-plat i { width: 14px; height: 14px; border-radius: 50%; display: inline-block; }

/* ---------- Inventario ---------- */
.filtros-inv { margin: 14px 0 0; width: 100%; }
.segmentos.tres { grid-template-columns: repeat(3, 1fr); margin-top: 14px; }
.nota-turnos { font-size: 12.5px; margin: 8px 2px 0; }
.chips { margin-bottom: 12px; }
.lista-op { display: flex; flex-direction: column; }
.lista-op > button { display: flex; justify-content: space-between; align-items: center; width: 100%; padding: 14px 4px; border: 0;
                     border-bottom: 1px solid var(--line); background: none; color: var(--text); font-size: 17px; text-align: left; }
.lista-op > button small { color: var(--muted); font-size: 13px; }
.lista-op > button i { font-style: normal; color: var(--affair); font-weight: 800; opacity: 0; transition: opacity .15s; }
.lista-op > button.activo { color: var(--affair); font-weight: 700; }
.lista-op > button.activo i { opacity: 1; }
.op-extra { padding: 8px 0 12px; display: grid; gap: 10px; grid-template-columns: minmax(0, 1fr); }
.op-extra label { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .4px; min-width: 0; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chips button { border: 0; padding: 9px 14px; border-radius: 20px; background: var(--alt); color: var(--muted); font-weight: 600; font-size: 14px; }
.chips button.activo { background: var(--affair); color: #fff; }
.hero-inv { background: radial-gradient(90% 120% at 90% -10%, #7FD8B6 0%, transparent 60%), linear-gradient(145deg, #2F7F66, #153B3A); box-shadow: 0 14px 34px rgba(21,59,58,.35); }
.grupo-inv .encabezado { display: flex; justify-content: space-between; align-items: baseline; padding: 18px 18px 8px; }
.grupo-inv .encabezado h2 { padding: 0; font-size: 17px; }
.grupo-inv .encabezado b { color: var(--ok); font-size: 17px; }
.inv-linea { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; padding: 12px 18px; border-top: 1px solid var(--line); }
.inv-linea .nom { font-weight: 600; font-size: 15px; }
.inv-linea .cant { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.inv-linea .sub { grid-column: 1 / -1; display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); }
.inv-linea .sin { color: var(--muted); font-style: italic; }

/* ---------- Reportes ---------- */
.mosaicos { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 10px; }
.mosaico { border: 0; border-radius: 22px; padding: 18px 12px 16px; color: #fff; min-height: 138px; display: flex; flex-direction: column;
           align-items: center; justify-content: space-between; gap: 10px; text-align: center; font-weight: 700; font-size: 13.5px;
           text-transform: uppercase; letter-spacing: .3px; box-shadow: var(--sombra); transition: transform .08s;
           background-image: linear-gradient(160deg, rgba(255,255,255,.22), rgba(0,0,0,.14)); }
.mosaico:active { transform: scale(.96); }
.mosaico i { font-style: normal; font-size: 38px; filter: drop-shadow(0 3px 4px rgba(0,0,0,.25)); }
.tabla-scroll { overflow-x: auto; }
.rep-tabla { width: 100%; border-collapse: collapse; font-size: 15px; font-variant-numeric: tabular-nums; }
.rep-tabla th { text-align: right; font-size: 12px; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); padding: 14px 14px 8px; white-space: nowrap; }
.rep-tabla td { text-align: right; padding: 12px 14px; border-top: 1px solid var(--line); white-space: nowrap; }
.rep-tabla th:first-child, .rep-tabla td:first-child { text-align: left; position: sticky; left: 0; background: var(--surface); }
.rep-tabla tfoot td { font-weight: 800; border-top: 2px solid var(--line); }
.rep-tabla .sube { color: var(--ok); } .rep-tabla .baja { color: var(--bad); }

/* ---------- Ayuda ---------- */
.modal { position: fixed; inset: 0; background: rgba(15,8,22,.6); display: flex; align-items: center; justify-content: center; z-index: 20; padding: 20px; backdrop-filter: blur(3px); }
.modal-caja { background: var(--surface); border-radius: 24px; padding: 22px; max-width: 420px; max-height: 88vh; overflow: auto; }
.modal-caja h2 { margin-bottom: 8px; }

/* ---------- Computadora (pantalla ancha): menú fijo a la izquierda y bloques en columnas, como el Admin de Soft ---------- */
@media (min-width: 1000px) {
  #app { padding-left: 252px; }
  #btn-menu, #velo { display: none !important; }
  #menu { transform: none; width: 252px; border-radius: 0; box-shadow: none; border-right: 1px solid var(--line); overflow-y: auto; transition: none; }
  #menu.abierto { box-shadow: none; }
  .barra { padding-left: 24px; padding-right: 24px; }
  .titulo-barra { font-size: 22px; }
  .filtros { max-width: none; width: auto; margin: 16px 24px 0; display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
  .filtros .segmentos { width: 340px; }
  .filtros .fechas { margin-top: 0; flex: 1; min-width: 280px; }
  .filtros .primario { width: 190px; margin-top: 0; }
  .aviso { max-width: none; width: auto; margin: 12px 24px 0; }
  main { max-width: 1500px; padding: 8px 24px 48px; }
  main > .tarjeta, main > .hero, main > .cuentas { margin-top: 0; }
  #vista-inicio { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 18px; padding-top: 18px; grid-auto-flow: dense; align-items: start; }
  #vista-inicio > * { min-width: 0; }
  #vista-inicio > #hero { grid-column: span 4; margin-top: 0; }
  #vista-inicio > #t-grafica { grid-column: span 8; }
  #vista-inicio > #t-horas, #vista-inicio > #t-productos { grid-column: span 4; }
  #vista-inicio > .cuentas { grid-column: span 4; grid-template-columns: 1fr; }
  #vista-inicio > #t-resumen, #vista-inicio > #t-porturno, #vista-inicio > #t-metas,
  #vista-inicio > #t-pagos, #vista-inicio > #t-servicio, #vista-inicio > #t-tipo { grid-column: span 4; }
  #vista-inicio > #t-curiosos, #vista-inicio > #turno-estado { grid-column: 1 / -1; }
  #lista-horas, #lista-productos { max-height: 340px; overflow-y: auto; }
  #vista-rankings { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
  #vista-rankings > .titulo-vista, #vista-rankings > p { grid-column: 1 / -1; margin: 0; }
  #vista-rankings > .tarjeta { margin-top: 0; }
  #vista-productos, #vista-inventario, #vista-cortes, #vista-reportes, #vista-config, #vista-plataformas { max-width: 1100px; }
}
@media (min-width: 1000px) and (max-width: 1299px) {
  #vista-inicio > #hero { grid-column: span 12; }
  #vista-inicio > #t-grafica { grid-column: span 12; }
  #vista-inicio > #t-horas, #vista-inicio > #t-productos { grid-column: span 6; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
