/* Tema: cabina nocturna. Colores sacados del emblema (amarillo, rojo, azul) sobre azul noche. */
:root {
  --noche: #070b14;
  --fondo: #0b111d;
  --panel: rgba(20, 28, 44, .72);
  --panel-solido: #141c2c;
  --panel2: #1b2538;
  --linea: rgba(127, 147, 180, .16);
  --linea2: rgba(127, 147, 180, .28);
  --texto: #eef1f6;
  --tenue: #8d9ab1;
  --acero: #8fa6c0;
  --amarillo: #f6c62a;
  --amarillo2: #ffdd5c;
  --sobre-amarillo: #1a1400;
  --rojo: #e2392e;
  --azul: #2f73d8;
  --azul-claro: #6ea4f5;
  --ok: #34c77b;
  --alerta: #f3a53b;
  --mal: #ef5a50;
  --display: "Saira Stencil One", "Barlow Condensed", Impact, sans-serif;
  --titulos: "Barlow Condensed", "Arial Narrow", sans-serif;
  --cuerpo: "Barlow", "Segoe UI", Roboto, sans-serif;
  --r: 12px;
  --sombra: 0 10px 30px -10px rgba(0, 0, 0, .6);
  --brillo: 0 0 0 1px rgba(246, 198, 42, .5), 0 8px 28px -6px rgba(246, 198, 42, .45);
  --ease: cubic-bezier(.22, 1, .36, 1);
  color-scheme: dark;
}

* { box-sizing: border-box }
html, body { height: 100% }
/* sin zoom en iPhone/iPad: sin doble toque ni ajuste automático del texto */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; touch-action: manipulation }
* { -webkit-tap-highlight-color: transparent }
@media (pointer: coarse) { input, select, textarea { font-size: 16px !important } }
body {
  margin: 0;
  color: var(--texto);
  font-family: var(--cuerpo);
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  background:
    radial-gradient(900px 500px at 85% -10%, rgba(47, 115, 216, .16), transparent 60%),
    radial-gradient(700px 420px at -10% 110%, rgba(226, 57, 46, .10), transparent 60%),
    var(--noche);
  background-attachment: fixed;
}
button, input, select, textarea { font: inherit; color: inherit }
h1, h2, h3 { margin: 0; text-wrap: balance }
h1 { font-family: var(--display); font-weight: 400; font-size: 34px; letter-spacing: .03em; text-transform: uppercase; line-height: 1 }
h2 { font-family: var(--titulos); font-weight: 700; font-size: 22px; letter-spacing: .03em; text-transform: uppercase }
h3 { font-family: var(--titulos); font-weight: 700; font-size: 15px; letter-spacing: .12em; text-transform: uppercase; color: var(--acero) }
a { color: var(--amarillo) }
code { background: var(--panel2); padding: 1px 6px; border-radius: 6px; font-size: 13px }
.num { font-variant-numeric: tabular-nums }
.muted { color: var(--tenue) }
.small { font-size: 13px }
.hidden { display: none !important }

/* ---------- botones ---------- */
.btn {
  position: relative; overflow: hidden; isolation: isolate;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 42px; padding: 10px 18px;
  border: 1px solid var(--linea2); border-radius: var(--r);
  background: var(--panel2); cursor: pointer; font-weight: 600;
  transition: transform .18s var(--ease), background .2s, border-color .2s, box-shadow .25s;
}
.btn:hover { background: #24304a; border-color: rgba(143, 166, 192, .45); transform: translateY(-1px) }
.btn:active { transform: translateY(1px) scale(.98) }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none }
.btn.primary {
  background: linear-gradient(135deg, var(--amarillo2), var(--amarillo) 55%, #e7ad12);
  color: var(--sobre-amarillo); border-color: transparent; box-shadow: 0 6px 18px -8px rgba(246, 198, 42, .8);
}
.btn.primary::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, .55) 50%, transparent 70%);
  transform: translateX(-120%); transition: transform .7s var(--ease);
}
.btn.primary:hover { box-shadow: var(--brillo) }
.btn.primary:hover::after { transform: translateX(120%) }
.btn.danger { background: transparent; color: var(--mal); border-color: rgba(239, 90, 80, .6) }
.btn.danger:hover { background: rgba(239, 90, 80, .12); border-color: var(--mal) }
.btn.ghost { background: transparent }
.btn.sm { min-height: 34px; padding: 6px 12px; font-size: 13px; border-radius: 10px }
.btn.block { width: 100% }
:focus-visible { outline: 2px solid var(--amarillo); outline-offset: 2px }

/* onda al tocar */
.onda { position: absolute; border-radius: 50%; pointer-events: none; background: currentColor; opacity: .25; transform: scale(0); animation: onda .6s var(--ease) forwards }
@keyframes onda { to { transform: scale(1); opacity: 0 } }

/* ---------- formularios ---------- */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0 }
.field > label:first-child { font-size: 11.5px; text-transform: uppercase; letter-spacing: .12em; color: var(--tenue); font-weight: 600 }
.input, input[type=text], input[type=number], input[type=password], input[type=date], input[type=tel], select, textarea {
  width: 100%; min-height: 44px; padding: 10px 13px;
  background: rgba(7, 11, 20, .7); border: 1px solid var(--linea2); border-radius: 10px;
  transition: border-color .2s, box-shadow .2s, background .2s;
}
input:hover, select:hover, textarea:hover { border-color: rgba(143, 166, 192, .45) }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--amarillo); box-shadow: 0 0 0 4px rgba(246, 198, 42, .14); background: rgba(7, 11, 20, .95) }
textarea { min-height: 120px; resize: vertical; font-family: ui-monospace, Consolas, monospace; font-size: 13px }
input[type=checkbox] { accent-color: var(--amarillo); width: 17px; height: 17px }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end }
.row > * { flex: 1 1 160px; min-width: 0 }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px }
.stack { display: flex; flex-direction: column; gap: 14px }
.between { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap }

/* ---------- tarjetas, tablas, etiquetas ---------- */
.card {
  position: relative; padding: 18px;
  background: var(--panel); border: 1px solid var(--linea); border-radius: 18px;
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  box-shadow: var(--sombra);
}
.card::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px; pointer-events: none;
  background: linear-gradient(140deg, rgba(246, 198, 42, .35), transparent 30%, transparent 70%, rgba(47, 115, 216, .35));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude;
}
.card.tight { padding: 14px }
.tablewrap { overflow-x: auto; border: 1px solid var(--linea); border-radius: 14px; background: rgba(13, 19, 31, .6) }
table { width: 100%; border-collapse: collapse; font-size: 14px }
th, td { padding: 11px 14px; text-align: left; border-bottom: 1px solid var(--linea); white-space: nowrap; vertical-align: middle }
th { font-size: 11px; text-transform: uppercase; letter-spacing: .12em; color: var(--tenue); font-weight: 600; background: rgba(27, 37, 56, .7); position: sticky; top: 0 }
tbody tr { transition: background .15s }
tbody tr:hover { background: rgba(143, 166, 192, .06) }
tr:last-child td { border-bottom: 0 }
td.r, th.r { text-align: right }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; border: 1px solid; white-space: nowrap }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; box-shadow: 0 0 8px currentColor }
.pill.ok { color: var(--ok); border-color: rgba(52, 199, 123, .45); background: rgba(52, 199, 123, .08) }
.pill.warn { color: var(--alerta); border-color: rgba(243, 165, 59, .45); background: rgba(243, 165, 59, .08) }
.pill.bad { color: var(--mal); border-color: rgba(239, 90, 80, .45); background: rgba(239, 90, 80, .08) }
.pill.bad::before { animation: parpadeo 1.2s infinite }
.pill.blue { color: var(--azul-claro); border-color: rgba(110, 164, 245, .45); background: rgba(47, 115, 216, .1) }
.pill.steel { color: var(--acero); border-color: rgba(143, 166, 192, .4); background: rgba(143, 166, 192, .07) }
.pill.accent { color: var(--amarillo); border-color: rgba(246, 198, 42, .5); background: rgba(246, 198, 42, .08) }
@keyframes parpadeo { 50% { opacity: .25 } }

/* indicadores tipo instrumento */
.stat {
  position: relative; overflow: hidden; padding: 16px 18px;
  background: linear-gradient(160deg, rgba(27, 37, 56, .9), rgba(14, 20, 33, .9));
  border: 1px solid var(--linea); border-radius: 16px;
  transition: transform .25s var(--ease), border-color .25s;
}
.stat::after {
  content: ""; position: absolute; right: -30px; top: -30px; width: 110px; height: 110px; border-radius: 50%;
  border: 1px dashed rgba(143, 166, 192, .18); box-shadow: inset 0 0 0 14px rgba(143, 166, 192, .03);
}
.stat:hover { transform: translateY(-3px); border-color: rgba(246, 198, 42, .35) }
.stat .v { font-family: var(--titulos); font-size: 32px; font-weight: 700; line-height: 1.05; margin-top: 4px }
.stat .l { font-size: 11px; text-transform: uppercase; letter-spacing: .14em; color: var(--tenue); font-weight: 600 }

/* ---------- armazón de la app ---------- */
#app { display: none; height: 100% }
#app.on { display: grid; grid-template-columns: 248px 1fr; grid-template-rows: 100% }
nav.side {
  display: flex; flex-direction: column; gap: 4px; padding: 16px 12px; overflow-y: auto;
  background: linear-gradient(180deg, rgba(20, 28, 44, .95), rgba(10, 15, 26, .95));
  border-right: 1px solid var(--linea);
}
nav.side .brand { display: flex; align-items: center; gap: 12px; padding: 4px 6px 16px; margin-bottom: 6px; border-bottom: 1px solid var(--linea) }
nav.side .brand { flex-wrap: wrap }
.brand-logos { display: flex; align-items: center }
.brand-logos { gap: 8px }
.brand-logos img:first-child { width: 78px; height: auto; filter: drop-shadow(0 4px 10px rgba(0, 0, 0, .55)) }
.brand-logos img + img { width: 50px; height: 50px; border-radius: 50%; box-shadow: 0 0 0 2px rgba(47, 115, 216, .55) }
.brand-titulo { display: block; height: 22px; width: auto; max-width: 100% }
nav.side .brand b { display: block; font-family: var(--display); font-weight: 400; font-size: 22px; text-transform: uppercase; line-height: 1 }
nav.side .brand span { display: block; margin-top: 3px; font-size: 10.5px; color: var(--acero); letter-spacing: .14em; text-transform: uppercase }
.reloj { margin: 2px 6px 10px; padding: 10px 12px; border-radius: 12px; background: rgba(7, 11, 20, .6); border: 1px solid var(--linea); font-family: var(--titulos); }
.reloj b { display: block; font-size: 26px; letter-spacing: .06em; color: var(--amarillo); line-height: 1; font-variant-numeric: tabular-nums }
.reloj span { font-size: 11px; color: var(--tenue); text-transform: uppercase; letter-spacing: .12em }
.navbtn {
  position: relative; display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 11px 14px; border: 0; border-radius: 12px; background: transparent; color: var(--texto);
  cursor: pointer; text-align: left; font-weight: 500; overflow: hidden;
  transition: background .2s, color .2s, transform .2s var(--ease);
}
.navbtn:hover { background: rgba(143, 166, 192, .08); transform: translateX(3px) }
.navbtn svg { width: 20px; height: 20px; flex: none; transition: transform .3s var(--ease) }
.navbtn:hover svg { transform: scale(1.12) rotate(-6deg) }
.navbtn.on { background: linear-gradient(90deg, rgba(246, 198, 42, .22), rgba(246, 198, 42, .04)); color: var(--amarillo); font-weight: 700 }
.navbtn.on::before { content: ""; position: absolute; left: 0; top: 18%; bottom: 18%; width: 3px; border-radius: 3px; background: var(--amarillo); box-shadow: 0 0 12px var(--amarillo); animation: aparecerBarra .35s var(--ease) }
@keyframes aparecerBarra { from { transform: scaleY(0) } }
.navbtn .badge { margin-left: auto; min-width: 22px; text-align: center; background: var(--rojo); color: #fff; border-radius: 999px; font-size: 11px; padding: 2px 7px; font-weight: 700; animation: latido 2s ease-in-out infinite }
@keyframes latido { 0%, 100% { box-shadow: 0 0 0 0 rgba(226, 57, 46, .6) } 50% { box-shadow: 0 0 0 6px rgba(226, 57, 46, 0) } }
nav.side .who { margin-top: auto; padding: 12px 6px 0; border-top: 1px solid var(--linea); font-size: 13px }
main { overflow-y: auto; overflow-x: hidden; padding-block: 22px; padding-inline: 26px; min-width: 0 }
.page { max-width: 1160px; margin: 0 auto; display: flex; flex-direction: column; gap: 18px }
.pagehead { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; padding-bottom: 4px }
.pagehead h1 { position: relative; padding-bottom: 8px }
.pagehead h1::after { content: ""; position: absolute; left: 0; bottom: 0; height: 3px; width: 56px; border-radius: 3px; background: linear-gradient(90deg, var(--amarillo), var(--rojo)); }
nav.bottom { display: none }

/* entrada de página: solo cuando se cambia de sección */
.page.entrando > * { animation: subir .55s var(--ease) both; animation-delay: calc(var(--i, 0) * 60ms) }
.page.entrando > .qr-card { animation: none }
.page.entrando .prod, .page.entrando .stat, .page.entrando .grid2 > .card, .page.entrando .userbtn, .page.entrando .logline { animation: subir .5s var(--ease) both; animation-delay: calc(120ms + var(--i, 0) * 35ms) }
.page.entrando .pagehead h1::after { animation: trazo .8s var(--ease) both .2s }
@keyframes subir { from { opacity: 0; transform: translateY(16px) } }
@keyframes trazo { from { width: 0 } }

@media (max-width: 860px) {
  #app.on { grid-template-columns: 1fr; grid-template-rows: 1fr auto }
  nav.side { display: none }
  nav.bottom {
    display: flex; gap: 2px; overflow-x: auto; padding: 6px 6px calc(6px + env(safe-area-inset-bottom, 0px));
    background: rgba(12, 18, 30, .92); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
    border-top: 1px solid var(--linea); scrollbar-width: none;
  }
  nav.bottom .navbtn { flex: 1 0 66px; flex-direction: column; gap: 3px; font-size: 10.5px; padding: 7px 4px; justify-content: center }
  nav.bottom .navbtn:hover { transform: none }
  nav.bottom .navbtn.on::before { left: 25%; right: 25%; top: 0; bottom: auto; width: auto; height: 3px }
  nav.bottom .navbtn .badge { position: absolute; top: 3px; right: 10px; margin: 0; min-width: 0; padding: 1px 6px; font-size: 10px }
  main { padding-inline: 16px; padding-block: 16px }
  h1 { font-size: 28px }
  .stat .v { font-size: 25px }
}

/* ---------- login ---------- */
#login { position: relative; min-height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px; padding-block: 30px 60px; padding-inline: 16px; overflow: hidden }
.cielo { position: fixed; inset: 0; z-index: -1; overflow: hidden; background: radial-gradient(1000px 600px at 50% 0%, #13213d 0%, var(--noche) 70%) }
.estrellas { position: absolute; inset: -50%; background-image:
  radial-gradient(1px 1px at 20px 30px, #fff8, transparent), radial-gradient(1px 1px at 120px 80px, #fff6, transparent),
  radial-gradient(1.5px 1.5px at 200px 150px, #fff9, transparent), radial-gradient(1px 1px at 300px 40px, #fff5, transparent),
  radial-gradient(1px 1px at 380px 200px, #fff7, transparent);
  background-size: 420px 260px; animation: derivar 120s linear infinite; opacity: .6 }
@keyframes derivar { to { transform: translate(-420px, -260px) } }
.pista { position: absolute; left: 50%; bottom: -10%; width: 220%; height: 60%; transform: translateX(-50%) perspective(420px) rotateX(62deg); transform-origin: bottom;
  background:
    linear-gradient(90deg, transparent 49.6%, rgba(246, 198, 42, .55) 49.6%, rgba(246, 198, 42, .55) 50.4%, transparent 50.4%) 0 0 / 100% 80px,
    linear-gradient(rgba(143, 166, 192, .12) 1px, transparent 1px) 0 0 / 100% 40px,
    linear-gradient(90deg, rgba(143, 166, 192, .12) 1px, transparent 1px) 0 0 / 60px 100%;
  -webkit-mask: linear-gradient(transparent, #000 70%); mask: linear-gradient(transparent, #000 70%);
  animation: rodar 2.4s linear infinite }
@keyframes rodar { to { background-position: 0 80px, 0 40px, 0 0 } }
.luces { position: absolute; bottom: 18px; left: 0; right: 0; display: flex; justify-content: center; gap: clamp(10px, 3vw, 26px) }
.luces i { width: 7px; height: 7px; border-radius: 50%; background: var(--amarillo); opacity: .15; animation: luz 1.8s infinite; animation-delay: calc(var(--n) * 110ms) }
.luces i:nth-child(3n) { background: var(--rojo) }
@keyframes luz { 0%, 60%, 100% { opacity: .15; box-shadow: none } 20% { opacity: 1; box-shadow: 0 0 14px 3px currentColor; color: var(--amarillo) } }

.marca-login { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; animation: subir .8s var(--ease) both }
.emblema-wrap { position: relative; width: 250px; height: 204px; display: grid; place-items: center }
.radar { position: absolute; width: 260px; height: 260px; left: calc(50% - 130px); top: calc(50% - 130px); border-radius: 50%; border: 1px solid rgba(110, 164, 245, .25);
  background: conic-gradient(from 0deg, rgba(110, 164, 245, .0) 0deg, rgba(110, 164, 245, .0) 290deg, rgba(110, 164, 245, .35) 355deg, rgba(110, 164, 245, 0) 360deg);
  animation: barrido 4s linear infinite }
.radar::before, .radar::after { content: ""; position: absolute; border-radius: 50%; border: 1px dashed rgba(110, 164, 245, .18) }
.radar::before { inset: 14% }
.radar::after { inset: -16%; border-style: solid; border-color: rgba(246, 198, 42, .12) }
@keyframes barrido { to { transform: rotate(360deg) } }
.emblema { position: relative; width: 100%; height: auto; filter: drop-shadow(0 0 26px rgba(47, 115, 216, .45)) drop-shadow(0 18px 24px rgba(0, 0, 0, .6)); animation: flotar 5s ease-in-out infinite }
@keyframes flotar { 50% { transform: translateY(-6px) } }
.titulo { margin: 0; line-height: 0 }
.titulo img { height: clamp(40px, 9vw, 64px); width: auto; max-width: 100%; filter: drop-shadow(0 4px 14px rgba(0, 0, 0, .6)) }
.lema { margin: 0; display: flex; align-items: center; gap: 10px; color: var(--acero); font-family: var(--titulos); font-weight: 700; letter-spacing: .22em; text-transform: uppercase; font-size: 14px }
.lema::before, .lema::after { content: "★"; color: var(--amarillo); font-size: 12px }
.lema { text-align: center; flex-wrap: wrap; justify-content: center }

.loginbox { width: min(100%, 440px); display: flex; flex-direction: column; gap: 14px; animation: subir .8s var(--ease) both .15s }
.loginbox .card { background: rgba(14, 20, 33, .78) }
.userlist { display: grid; grid-template-columns: repeat(auto-fill, minmax(124px, 1fr)); gap: 10px }
.userbtn {
  position: relative; overflow: hidden; display: flex; flex-direction: column; align-items: center; gap: 7px;
  padding: 16px 10px; border-radius: 16px; border: 1px solid var(--linea2); background: rgba(27, 37, 56, .6); cursor: pointer;
  transition: transform .25s var(--ease), border-color .25s, box-shadow .25s;
  animation: subir .5s var(--ease) both; animation-delay: calc(var(--i, 0) * 60ms + .2s);
}
.userbtn:hover { transform: translateY(-4px); border-color: var(--amarillo); box-shadow: 0 10px 26px -10px rgba(246, 198, 42, .5) }
.avatar { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; font-family: var(--titulos); font-size: 20px; font-weight: 700; background: linear-gradient(140deg, #b9c9dc, var(--acero)); color: #0b111d; box-shadow: 0 0 0 3px rgba(143, 166, 192, .2) }
.avatar.admin { background: linear-gradient(140deg, #ff5f3a, #ff2d55 55%, #c3007a); color: #fff; box-shadow: 0 0 0 3px rgba(255, 45, 85, .3), 0 0 22px rgba(255, 45, 85, .55) }
.avatar.db { background: linear-gradient(140deg, #00e0ff, #0a84ff 60%, #3a32d8); color: #fff; box-shadow: 0 0 0 3px rgba(10, 132, 255, .3), 0 0 22px rgba(10, 132, 255, .55) }
/* etiqueta de rol: Admin rojo-fucsia, D/B azul eléctrico */
.rol { display: inline-flex; align-items: center; gap: 5px; padding: 3px 11px; border-radius: 999px; font-size: 11.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: #fff; white-space: nowrap }
.rol::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #fff; box-shadow: 0 0 8px #fff }
.rol.admin { background: linear-gradient(120deg, #ff5f3a, #ff2d55 60%, #c3007a); box-shadow: 0 4px 14px -4px rgba(255, 45, 85, .8) }
.rol.db { background: linear-gradient(120deg, #00d2ff, #0a84ff 60%, #3a32d8); box-shadow: 0 4px 14px -4px rgba(10, 132, 255, .8) }
.rol.chico { font-size: 10px; padding: 2px 8px }
.pin { display: flex; gap: 12px; justify-content: center; margin: 8px 0 }
.pin.temblor { animation: temblor .45s }
@keyframes temblor { 20%, 60% { transform: translateX(-9px) } 40%, 80% { transform: translateX(9px) } }
.pin i { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--linea2); display: block; transition: background .15s, border-color .15s }
.pin i.f { background: var(--amarillo); border-color: var(--amarillo); box-shadow: 0 0 12px rgba(246, 198, 42, .7); animation: pop .3s var(--ease) }
.pin.temblor i { border-color: var(--mal) }
@keyframes pop { 0% { transform: scale(.4) } 60% { transform: scale(1.3) } }
.pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px }
.pad button.ok { font-size: 20px; color: var(--sobre-amarillo); border-color: transparent; background: linear-gradient(180deg, var(--amarillo2), var(--amarillo)); box-shadow: 0 4px 0 #a37a06 }
.pad button.ok:active { box-shadow: 0 1px 0 #a37a06 }
.pin { cursor: text; flex-wrap: wrap }
.pin-oculto { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; border: 0; padding: 0; min-height: 0 }
.acceso-qr { order: 3; width: 210px; display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; padding: 16px; animation: subir .8s var(--ease) both .3s }
.acceso-qr[hidden] { display: none }
.acceso-qr-t { margin: 0; font-family: var(--titulos); font-weight: 700; text-transform: uppercase; letter-spacing: .12em; color: var(--acero) }
.acceso-qr-caja { width: 100%; padding: 10px; border-radius: 14px; background: #fff }
.acceso-qr-caja img { display: block; width: 100%; image-rendering: pixelated }
.acceso-qr code { font-size: 12px; color: var(--amarillo); word-break: break-all }
@media (min-width: 1000px) { .acceso-qr { position: fixed; right: 28px; bottom: 28px } }
.pad button {
  position: relative; overflow: hidden; min-height: 60px; border-radius: 16px; cursor: pointer;
  font-family: var(--titulos); font-size: 26px; font-weight: 700;
  border: 1px solid var(--linea2); background: linear-gradient(180deg, rgba(36, 48, 72, .8), rgba(20, 28, 44, .8));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .05), 0 4px 0 rgba(0, 0, 0, .35);
  transition: transform .1s, box-shadow .1s, border-color .2s;
}
.pad button:hover { border-color: rgba(246, 198, 42, .5) }
.pad button:active { transform: translateY(3px); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .05), 0 1px 0 rgba(0, 0, 0, .35) }
.err { color: var(--mal); font-weight: 600; min-height: 20px }
.err:not(:empty) { animation: temblor .4s }

/* cargando */
.cargando { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 20px }
.avion { width: 56px; height: 56px; color: var(--amarillo); animation: volar 1.6s ease-in-out infinite }
@keyframes volar { 0% { transform: translate(-30px, 6px) rotate(8deg); opacity: 0 } 30%, 70% { opacity: 1 } 100% { transform: translate(30px, -6px) rotate(-4deg); opacity: 0 } }

/* ---------- vender ---------- */
.pos { display: grid; grid-template-columns: 1fr 370px; gap: 18px; align-items: start }
.chips { display: flex; gap: 8px; flex-wrap: wrap }
.chip { padding: 8px 16px; border-radius: 999px; border: 1px solid var(--linea2); background: rgba(27, 37, 56, .6); cursor: pointer; font-weight: 600; font-size: 13px; transition: all .2s var(--ease) }
.chip:hover { border-color: var(--acero); transform: translateY(-1px) }
.chip.on { background: var(--acero); color: #0b111d; border-color: var(--acero); box-shadow: 0 4px 16px -4px rgba(143, 166, 192, .6) }
.prods { display: grid; grid-template-columns: repeat(auto-fill, minmax(158px, 1fr)); gap: 12px }
.prod {
  position: relative; overflow: hidden; display: flex; flex-direction: column; gap: 4px; min-height: 112px; padding: 14px;
  text-align: left; cursor: pointer; border-radius: 16px; border: 1px solid var(--linea);
  background: linear-gradient(160deg, rgba(30, 41, 62, .9), rgba(16, 23, 37, .9));
  transition: transform .25s var(--ease), border-color .25s, box-shadow .25s;
}
.prod::after { content: ""; position: absolute; right: -18px; bottom: -18px; width: 70px; height: 70px; border-radius: 50%; background: radial-gradient(rgba(246, 198, 42, .18), transparent 70%); transition: transform .35s var(--ease) }
.prod:hover { transform: translateY(-4px); border-color: rgba(246, 198, 42, .6); box-shadow: 0 14px 30px -14px rgba(246, 198, 42, .55) }
.prod:hover::after { transform: scale(2.4) }
.prod:active { transform: scale(.97) }
.prod.out { opacity: .4; cursor: not-allowed; filter: grayscale(.6) }
.prod.out:hover { transform: none; box-shadow: none; border-color: var(--linea) }
.prod b { font-size: 15px; line-height: 1.25 }
.prod-foto { position: relative; margin: -14px -14px 8px; aspect-ratio: 4 / 3; overflow: hidden; display: grid; place-items: center; background: linear-gradient(140deg, #1d2a42, #111827); border-bottom: 1px solid var(--linea) }
.prod-foto img { width: 100%; height: 100%; object-fit: cover; transition: transform .45s var(--ease) }
.prod:hover .prod-foto img { transform: scale(1.08) }
.prod-foto span { font-family: var(--titulos); font-size: 30px; font-weight: 800; color: rgba(143, 166, 192, .35); letter-spacing: .05em }
.prod-foto em { position: absolute; inset: auto 0 10px; margin: 0 auto; width: max-content; padding: 3px 12px; border-radius: 999px; font-style: normal; font-size: 12px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; background: var(--mal); color: #fff }
.prod-fila { display: flex; align-items: center; gap: 10px }
.mini { width: 40px; height: 40px; flex: none; border-radius: 10px; object-fit: cover; border: 1px solid var(--linea2); display: grid; place-items: center; background: var(--panel2); font-weight: 800; color: var(--tenue) }
.prod .p { margin-top: auto; font-family: var(--titulos); font-size: 22px; font-weight: 700; color: var(--amarillo) }
.prod .s { font-size: 12px; color: var(--tenue) }
.prod .s.low { color: var(--alerta) }
.mas1 { position: fixed; z-index: 70; pointer-events: none; font-family: var(--titulos); font-weight: 800; font-size: 22px; color: var(--amarillo); text-shadow: 0 0 12px rgba(246, 198, 42, .8); animation: mas1 .8s var(--ease) forwards }
@keyframes mas1 { to { transform: translateY(-50px) scale(1.3); opacity: 0 } }

.cart { position: sticky; top: 0 }
.cartline { display: grid; grid-template-columns: 1fr auto auto; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px dashed var(--linea2) }
.cartline.nuevo { animation: deslizar .45s var(--ease) }
@keyframes deslizar { from { opacity: 0; transform: translateX(24px); background: rgba(246, 198, 42, .15) } }
.qty { display: inline-flex; align-items: center; border: 1px solid var(--linea2); border-radius: 10px; overflow: hidden }
.qty button { width: 32px; height: 32px; border: 0; background: var(--panel2); cursor: pointer; font-weight: 700; transition: background .15s }
.qty button:hover { background: rgba(246, 198, 42, .25) }
.qty span { min-width: 30px; text-align: center; font-weight: 700 }
.total { display: flex; justify-content: space-between; align-items: baseline; padding-top: 12px; border-top: 1px solid var(--linea2) }
.total span { text-transform: uppercase; letter-spacing: .14em; font-size: 12px; color: var(--tenue); font-weight: 600 }
.total b { font-family: var(--titulos); font-size: 36px; font-weight: 800; color: var(--amarillo); text-shadow: 0 0 22px rgba(246, 198, 42, .35); display: inline-block }
.total b.bump { animation: bump .4s var(--ease) }
@keyframes bump { 40% { transform: scale(1.14) } }
.paybtns { display: grid; grid-template-columns: 1fr 1fr; gap: 10px }
.paybtn {
  position: relative; overflow: hidden; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; min-height: 112px; padding: 12px 8px;
  border-radius: 16px; border: 1px solid var(--linea2); background: rgba(27, 37, 56, .7); cursor: pointer; font-weight: 700;
  transition: transform .2s var(--ease), border-color .2s, box-shadow .25s, background .2s;
}
.paybtn img { height: 64px; max-width: 120px; object-fit: contain; transition: transform .3s var(--ease) }
.paybtn:not(:disabled):hover { transform: translateY(-3px) }
.paybtn:not(:disabled):hover img { transform: scale(1.1) rotate(-4deg) }
#pay-nequi { background: linear-gradient(160deg, #ffffff, #f1eef7); color: #210049; border-color: transparent }
#pay-nequi:not(:disabled):hover { box-shadow: 0 0 0 2px #da0081, 0 12px 28px -10px rgba(218, 0, 129, .6) }
#pay-fiado:not(:disabled):hover { border-color: var(--alerta); box-shadow: 0 12px 28px -12px rgba(243, 165, 59, .6); color: var(--alerta) }
.paybtn:disabled { opacity: .4; cursor: not-allowed }
.nequi-ph { font-family: var(--titulos); font-size: 22px; letter-spacing: .1em; padding: 2px 10px }
.photo { display: block; border: 2px dashed var(--linea2); border-radius: 16px; padding: 18px; text-align: center; cursor: pointer; background: rgba(7, 11, 20, .5); transition: border-color .2s, background .2s }
.photo:hover { border-color: var(--amarillo); background: rgba(246, 198, 42, .05) }
.photo.ok { border-color: var(--ok); border-style: solid; background: rgba(52, 199, 123, .06) }
.photo img { max-height: 170px; border-radius: 10px; animation: subir .4s var(--ease) }
.photo input { display: none }
@media (max-width: 1000px) { .pos { grid-template-columns: 1fr } .cart { position: static } }

/* ---------- modales, avisos, éxito ---------- */
.modal { position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(3, 6, 12, .7); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); animation: velo .25s ease }
.modal .box { width: min(100%, 560px); max-height: 92vh; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; padding: 22px; background: var(--panel-solido); border: 1px solid var(--linea2); border-radius: 22px; box-shadow: 0 30px 80px -20px #000, 0 0 0 1px rgba(246, 198, 42, .08); animation: abrir .4s var(--ease) }
.modal .box.wide { width: min(100%, 920px) }
@keyframes velo { from { opacity: 0 } }
@keyframes abrir { from { opacity: 0; transform: translateY(24px) scale(.96) } }
.toast { position: fixed; z-index: 60; left: 50%; bottom: calc(26px + env(safe-area-inset-bottom, 0px)); display: flex; align-items: center; gap: 10px; padding: 12px 20px; border-radius: 999px; font-weight: 700; color: var(--sobre-amarillo); background: linear-gradient(135deg, var(--amarillo2), var(--amarillo)); box-shadow: 0 12px 34px -8px rgba(0, 0, 0, .7); transform: translateX(-50%); animation: tostada .45s var(--ease) }
.toast.bad { background: linear-gradient(135deg, #ff7166, var(--mal)); color: #fff }
@keyframes tostada { from { opacity: 0; transform: translate(-50%, 30px) scale(.9) } }
@media (max-width: 860px) { .toast { bottom: calc(86px + env(safe-area-inset-bottom, 0px)) } }

.exito { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; background: rgba(3, 6, 12, .75); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); animation: velo .2s ease }
.exito.fuera { animation: velo .3s ease reverse forwards }
.exito .caja { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; animation: abrir .45s var(--ease) }
.exito svg { width: 120px; height: 120px; overflow: visible }
.exito circle { fill: none; stroke: var(--ok); stroke-width: 4; stroke-dasharray: 315; stroke-dashoffset: 315; animation: dibujar .6s var(--ease) forwards }
.exito path { fill: none; stroke: var(--ok); stroke-width: 6; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 80; stroke-dashoffset: 80; animation: dibujar .4s var(--ease) forwards .45s }
@keyframes dibujar { to { stroke-dashoffset: 0 } }
.exito h2 { font-size: 28px }
.exito .monto { font-family: var(--titulos); font-weight: 800; font-size: 40px; color: var(--amarillo) }
.confeti { position: fixed; top: -12px; width: 9px; height: 14px; z-index: 81; pointer-events: none; border-radius: 2px; animation: caer var(--d) linear forwards }
@keyframes caer { to { transform: translate(var(--x), 105vh) rotate(var(--r)); opacity: .2 } }

/* ---------- logos institucionales y créditos ---------- */
.logos-login { display: flex; align-items: center; justify-content: center; gap: clamp(18px, 5vw, 40px) }
.sello-emavi { width: 132px; height: 132px; border-radius: 50%; box-shadow: 0 0 0 3px rgba(47, 115, 216, .55), 0 0 40px rgba(47, 115, 216, .35), 0 18px 40px -10px #000; animation: flotar 5s ease-in-out infinite 1.2s }
@media (max-width: 480px) { .emblema-wrap { width: 180px; height: 147px } .sello-emavi { width: 96px; height: 96px } .radar { width: 190px; height: 190px; left: calc(50% - 95px); top: calc(50% - 95px) } }
.autor { margin: 0; font-size: 13px; line-height: 1.4; color: var(--tenue) }
.autor a { color: inherit; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px }
.autor a:hover { color: var(--texto) }
.acceso-autor { order: 4; text-align: center; animation: subir .8s var(--ease) both .4s }
.rail-autor { margin-top: 10px; padding: 0 6px; font-size: 11.5px }
.barra-movil { display: none }
.acerca { display: flex; align-items: center; gap: 18px; flex-wrap: wrap }
.acerca > div:nth-child(2) { display: flex; flex-direction: column; gap: 2px; flex: 1 1 200px; min-width: 0 }
.acerca strong { font-family: var(--titulos); font-size: 20px; letter-spacing: .06em }
.acerca .autor { flex-basis: 100% }
.logos { display: flex; align-items: center; gap: 12px }
.logos img { width: 72px; height: 72px; border-radius: 50% }
.logos img:first-child { width: 110px; height: auto; border-radius: 0 }
.acerca-titulo { display: block; height: 30px; width: auto; max-width: 100% }
@media (max-width: 860px) {
  .barra-movil { display: flex; align-items: center; gap: 10px; margin: -4px 0 14px; padding-bottom: 12px; border-bottom: 1px solid var(--linea) }
  .barra-movil img { width: 38px; height: 38px; border-radius: 50% }
  .barra-movil img:first-child { width: 58px; height: auto; border-radius: 0 }
  .barra-movil .titulo-img { width: auto; height: 22px; border-radius: 0; margin-left: 4px }
  .barra-movil b { flex: 1; font-family: var(--display); font-weight: 400; font-size: 20px; text-transform: uppercase; letter-spacing: .04em }
}

/* ---------- barras de acciones ---------- */
.barra { display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap }
.barra > .input { flex: 1 1 220px; max-width: 320px }
.acciones { display: flex; gap: 8px; align-items: center; flex-wrap: wrap }
.acciones > .btn { flex: 0 0 auto; white-space: nowrap }
.btn .ico { width: 16px; height: 16px; flex: none }
@media (max-width: 600px) {
  .barra > .input { max-width: none; flex-basis: 100% }
  .barra > .acciones, .pagehead > .acciones { width: 100% }
  .barra > .acciones > .btn, .pagehead > .acciones > .btn { flex: 1 1 0 }
}

/* ---------- fotos desde internet e importación ---------- */
.fw-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(140px, 42%), 1fr)); gap: 10px; min-height: 120px }
.fw-op { position: relative; display: flex; flex-direction: column; gap: 4px; padding: 6px; border-radius: 12px; border: 2px solid var(--linea2); background: #fff; cursor: pointer; transition: transform .2s var(--ease), border-color .2s }
.fw-op:hover { transform: translateY(-3px); border-color: var(--amarillo) }
.fw-op img { width: 100%; aspect-ratio: 1; object-fit: contain; border-radius: 8px; background: #fff }
.fw-op span { font-size: 11px; color: #555; text-align: center }
.fw-op.cargando-op { opacity: .5; pointer-events: none }
.fa-barra { height: 12px; border-radius: 999px; background: var(--panel2); overflow: hidden; border: 1px solid var(--linea) }
.fa-barra i { display: block; height: 100%; background: linear-gradient(90deg, var(--amarillo), var(--ok)); transition: width .5s var(--ease) }
.rev-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(140px, 42%), 1fr)); gap: 12px; max-height: 62vh; overflow-y: auto; padding: 2px }
.rev { display: flex; flex-direction: column; gap: 6px; padding: 8px; border-radius: 14px; border: 1px solid var(--linea); background: var(--panel2); font-size: 13px }
.rev-foto { aspect-ratio: 1; border-radius: 10px; overflow: hidden; background: #fff; display: grid; place-items: center }
.rev-foto img { width: 100%; height: 100%; object-fit: contain }
.rev-foto span { color: #888; font-size: 12px }
.imp { max-height: 55vh }
.imp input { width: 92px; min-height: 34px; padding: 4px 8px; text-align: right }
.imp-nom small { display: block; margin: 2px 0 4px }
.imp-nom .pill.warn { margin-top: 2px }
@media (max-width: 640px) {
  .imp thead { display: none }
  .imp tr { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; padding: 10px 12px; border-bottom: 1px solid var(--linea) }
  .imp td { padding: 0; border: 0; background: none !important }
  .imp td.imp-nom { grid-column: 1 / -1 }
  .imp td[data-l]::before { content: attr(data-l); display: block; font-size: 11px; color: var(--tenue); text-align: left; margin-bottom: 2px }
  .imp input { width: 100% }
  .imp tr.aviso { background: rgba(243, 165, 59, .1) }
}
.imp tr.aviso td { background: rgba(243, 165, 59, .1) }

/* ---------- permisos ---------- */
.permisos th.c, .permisos td.c { text-align: center; width: 140px }
.permisos tr.apagada td:first-child, .permisos tr.apagada td:nth-child(2) { opacity: .45 }
.switch { position: relative; display: inline-block; width: 50px; height: 28px; cursor: pointer }
.switch input { position: absolute; opacity: 0; width: 0; height: 0 }
.switch span { position: absolute; inset: 0; border-radius: 999px; background: rgba(143, 166, 192, .25); border: 1px solid var(--linea2); transition: background .25s }
.switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, .4); transition: transform .25s var(--ease) }
.switch input:checked + span { background: var(--ok); border-color: var(--ok) }
.switch input:checked + span::after { transform: translateX(22px) }
.switch input:focus-visible + span { outline: 2px solid var(--amarillo); outline-offset: 2px }

/* ---------- zona de borrado ---------- */
.card.peligro { border-color: rgba(239, 90, 80, .45); background: linear-gradient(160deg, rgba(239, 90, 80, .08), var(--panel)) }
.card.peligro::before { background: linear-gradient(140deg, rgba(239, 90, 80, .5), transparent 40%) }
.card.peligro h2 { color: var(--mal) }

/* ---------- parte diario ---------- */
.parte-hora { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 14px; border-radius: 14px; background: rgba(246, 198, 42, .07); border: 1px solid rgba(246, 198, 42, .3) }
.parte-hora label { font-size: 12px; text-transform: uppercase; letter-spacing: .1em; color: var(--tenue); font-weight: 600 }
.hora-mil { display: inline-flex; align-items: center; gap: 4px }
.hora-mil b { font-family: var(--titulos); font-size: 24px; color: var(--amarillo) }
.hora-mil select { width: auto; font-family: var(--titulos); font-size: 24px !important; font-weight: 700; color: var(--amarillo); padding: 2px 8px; min-height: 42px; text-align: center }

/* ---------- QR ---------- */
.qr-card { display: grid; grid-template-columns: auto 1fr; gap: 28px; align-items: center }
.qr-marco { position: relative; width: 236px; height: 236px; padding: 14px; border-radius: 20px; background: #fff; box-shadow: 0 0 0 1px rgba(246, 198, 42, .4), 0 18px 44px -14px rgba(246, 198, 42, .45); overflow: hidden }
.qr-img { width: 100%; height: 100%; display: grid; place-items: center }
.qr-img img { width: 100%; height: 100%; image-rendering: pixelated }
.qr-carga { width: 42px; height: 42px; border-radius: 50%; border: 4px solid #e4e8ef; border-top-color: var(--amarillo); animation: barrido .8s linear infinite }
.qr-esquina { position: absolute; width: 26px; height: 26px; border: 4px solid var(--amarillo) }
.qr-esquina.a { top: 5px; left: 5px; border-right: 0; border-bottom: 0; border-top-left-radius: 12px }
.qr-esquina.b { top: 5px; right: 5px; border-left: 0; border-bottom: 0; border-top-right-radius: 12px }
.qr-esquina.c { bottom: 5px; left: 5px; border-right: 0; border-top: 0; border-bottom-left-radius: 12px }
.qr-esquina.d { bottom: 5px; right: 5px; border-left: 0; border-top: 0; border-bottom-right-radius: 12px }
.qr-url { display: flex; gap: 8px; align-items: center; flex-wrap: wrap }
.qr-url code { font-size: 16px; padding: 8px 12px; color: var(--amarillo); user-select: all; word-break: break-all }
.qr-pasos { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 4px }
.qr-grande { align-self: center; width: min(78vw, 420px); padding: 16px; border-radius: 22px; background: #fff }
.qr-grande img { display: block; width: 100%; image-rendering: pixelated }
@media (max-width: 700px) { .qr-card { grid-template-columns: 1fr; justify-items: center } .qr-info { width: 100% } }

/* ---------- gráficos y listas ---------- */
.bars { display: flex; align-items: flex-end; gap: 8px; height: 150px; padding-top: 10px }
.bars div { position: relative; flex: 1; min-height: 3px; border-radius: 6px 6px 2px 2px; background: linear-gradient(180deg, var(--azul-claro), var(--azul)); transform-origin: bottom; transition: filter .2s }
.bars div:hover { filter: brightness(1.25) }
.bars div.today { background: linear-gradient(180deg, var(--amarillo2), var(--amarillo)); box-shadow: 0 0 18px rgba(246, 198, 42, .35) }
.page.entrando .bars div { animation: crecer .9s var(--ease) both; animation-delay: calc(.25s + var(--i, 0) * 70ms) }
@keyframes crecer { from { transform: scaleY(0) } }
.bars div span { position: absolute; top: 100%; left: -4px; right: -4px; text-align: center; font-size: 11px; color: var(--tenue); padding-top: 5px }
.logline { display: grid; grid-template-columns: 150px 150px 1fr; gap: 10px; padding: 10px 4px; border-bottom: 1px solid var(--linea); font-size: 14px; transition: background .15s }
.logline:hover { background: rgba(143, 166, 192, .05) }
@media (max-width: 600px) { .logline { grid-template-columns: 1fr; gap: 2px } }
.receipt-th { width: 44px; height: 44px; object-fit: cover; border-radius: 8px; border: 1px solid var(--linea2); cursor: zoom-in; transition: transform .2s var(--ease) }
.receipt-th:hover { transform: scale(1.12) }
.card > table td { white-space: normal }
.card > table td.r { white-space: nowrap }
.note { padding: 12px 14px; border-radius: 12px; font-size: 14px; background: rgba(246, 198, 42, .07); border: 1px solid rgba(246, 198, 42, .3) }

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