/* El Mundo del Catálogo — diseño liquid glass: azul rey, blanco y destellos dorados */
:root {
  --azul-900: #0a1f6b; --azul-800: #0f2f9e; --azul-700: #1741c6; --azul-500: #2f5ae8; --azul-200: #b9c9ff; --azul-50: #eef2ff;
  --oro: #c9962b; --oro-claro: #f3d98b;
  --tinta: #101b45; --tinta-2: #4a5683; --linea: rgba(23, 65, 198, .14);
  --verde: #12804a; --rojo: #c0392b; --ambar: #b7791f;
  --vidrio: rgba(255, 255, 255, .58); --vidrio-2: rgba(255, 255, 255, .78);
  --radio: 22px; --sombra: 0 18px 50px rgba(15, 47, 158, .16), 0 2px 6px rgba(15, 47, 158, .08);
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { font: 15px/1.45 "Segoe UI Variable Text", "Segoe UI", system-ui, sans-serif; color: var(--tinta); background: #eaf0ff; overflow: hidden; }
h1, h2, h3 { margin: 0; font-family: "Segoe UI Variable Display", "Segoe UI", sans-serif; letter-spacing: -.01em; text-wrap: balance; }
h1 { font-size: 26px; } h2 { font-size: 19px; } h3 { font-size: 15px; }
button, input, select, textarea { font: inherit; color: inherit; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--tinta-2); } .der { text-align: right; } .chica { font-size: 13px; }
.fila { display: flex; align-items: center; gap: 10px; } .fila.entre { justify-content: space-between; } .fila.envuelve { flex-wrap: wrap; }
.col { display: flex; flex-direction: column; gap: 12px; } .crece { flex: 1; min-width: 0; }

/* ---- Fondo con luces de color detrás del vidrio ---- */
.fondo { position: fixed; inset: 0; z-index: -1; background: linear-gradient(140deg, #dfe8ff 0%, #f6f8ff 45%, #fff7e2 100%); overflow: hidden; }
.fondo i { position: absolute; border-radius: 50%; filter: blur(70px); }
.fondo i:nth-child(1) { width: 52vw; height: 52vw; left: -14vw; top: -20vw; background: radial-gradient(circle, #2f5ae8 0%, rgba(47, 90, 232, 0) 70%); opacity: .55; }
.fondo i:nth-child(2) { width: 40vw; height: 40vw; right: -10vw; bottom: -16vw; background: radial-gradient(circle, #e7b84a 0%, rgba(231, 184, 74, 0) 70%); opacity: .5; }
.fondo i:nth-child(3) { width: 34vw; height: 34vw; right: 18vw; top: -12vw; background: radial-gradient(circle, #8fb0ff 0%, rgba(143, 176, 255, 0) 70%); opacity: .55; }

/* ---- Vidrio ---- */
.glass {
  position: relative; background: var(--vidrio); border-radius: var(--radio);
  -webkit-backdrop-filter: blur(26px) saturate(180%); backdrop-filter: blur(26px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, .75);
  box-shadow: var(--sombra), inset 0 1px 0 rgba(255, 255, 255, .9), inset 0 -1px 0 rgba(23, 65, 198, .06);
}
.glass::before { /* reflejo superior */
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: linear-gradient(180deg, rgba(255, 255, 255, .55) 0%, rgba(255, 255, 255, 0) 38%);
  -webkit-mask: linear-gradient(#000, #000) content-box, linear-gradient(#000, #000); mask-composite: exclude; -webkit-mask-composite: xor; padding: 1px;
}
.pad { padding: 20px; }

/* ---- Estructura ---- */
#app { height: 100%; }
.shell { display: grid; grid-template-columns: 232px 1fr; height: 100%; gap: 16px; padding: 16px; }
.side {
  display: flex; flex-direction: column; padding: 18px 12px; border-radius: 28px; color: #fff; overflow: hidden; position: relative;
  background: linear-gradient(165deg, rgba(15, 47, 158, .9), rgba(23, 65, 198, .78) 55%, rgba(10, 31, 107, .92));
  -webkit-backdrop-filter: blur(26px) saturate(180%); backdrop-filter: blur(26px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, .28); box-shadow: var(--sombra), inset 0 1px 0 rgba(255, 255, 255, .35);
}
.side::after { content: ""; position: absolute; width: 220px; height: 220px; right: -90px; top: -90px; border-radius: 50%; background: radial-gradient(circle, rgba(243, 217, 139, .55), transparent 70%); pointer-events: none; }
.marca { padding: 4px 10px 18px; }
.marca small { display: block; color: var(--oro-claro); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; }
.marca b { font-size: 19px; line-height: 1.15; display: block; font-family: "Segoe UI Variable Display", "Segoe UI", sans-serif; }
.nav { display: flex; flex-direction: column; gap: 4px; flex: 1; overflow-y: auto; }
.nav button {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 11px 12px; border: 0; border-radius: 14px; background: transparent;
  color: rgba(255, 255, 255, .86); cursor: pointer; text-align: left; font-weight: 500; transition: background .15s;
}
.nav button:hover { background: rgba(255, 255, 255, .12); }
.nav button.activo { background: rgba(255, 255, 255, .2); color: #fff; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .4), inset 3px 0 0 var(--oro-claro); }
.nav .cuenta { margin-left: auto; background: var(--oro-claro); color: var(--azul-900); border-radius: 99px; font-size: 12px; font-weight: 700; padding: 1px 8px; }
.side .pie { border-top: 1px solid rgba(255, 255, 255, .18); padding: 12px 8px 0; font-size: 13px; }
.side .pie b { display: block; font-size: 14px; }
.main { display: flex; flex-direction: column; min-width: 0; min-height: 0; gap: 14px; }
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 4px 4px 0; }
.scroll { overflow-y: auto; min-height: 0; flex: 1; padding: 2px 4px 12px; }
svg.ic { width: 19px; height: 19px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---- Botones y campos ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 16px; border-radius: 14px; cursor: pointer; font-weight: 600;
  border: 1px solid rgba(255, 255, 255, .8); background: var(--vidrio-2); color: var(--azul-800);
  box-shadow: 0 2px 8px rgba(15, 47, 158, .1), inset 0 1px 0 #fff; transition: transform .08s, box-shadow .15s, filter .15s; white-space: nowrap;
}
.btn:hover { filter: brightness(1.04); box-shadow: 0 6px 16px rgba(15, 47, 158, .16), inset 0 1px 0 #fff; }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.pri { color: #fff; border-color: rgba(255, 255, 255, .35); background: linear-gradient(180deg, #3a66f2, var(--azul-700) 60%, var(--azul-800)); box-shadow: 0 8px 20px rgba(23, 65, 198, .35), inset 0 1px 0 rgba(255, 255, 255, .45); }
.btn.oro { color: #3d2c05; border-color: rgba(255, 255, 255, .6); background: linear-gradient(180deg, #fbe7a8, #e7b84a 70%, #cf9d2f); box-shadow: 0 8px 20px rgba(201, 150, 43, .35), inset 0 1px 0 rgba(255, 255, 255, .7); }
.btn.ok { color: #fff; background: linear-gradient(180deg, #23a866, var(--verde)); border-color: rgba(255, 255, 255, .35); }
.btn.peligro { color: var(--rojo); }
.btn.peligro.lleno { color: #fff; background: linear-gradient(180deg, #d9584a, var(--rojo)); border-color: rgba(255, 255, 255, .35); }
.btn.chico { padding: 6px 11px; border-radius: 11px; font-size: 13px; }
.btn.grande { padding: 15px 20px; font-size: 17px; border-radius: 18px; width: 100%; }
.btn.icono { padding: 8px; }
label.campo { display: flex; flex-direction: column; gap: 5px; font-size: 13px; font-weight: 600; color: var(--tinta-2); }
input, select, textarea {
  width: 100%; padding: 10px 13px; border-radius: 13px; border: 1px solid var(--linea); background: rgba(255, 255, 255, .8);
  outline: none; transition: border-color .15s, box-shadow .15s; font-weight: 500; color: var(--tinta);
}
input:focus, select:focus, textarea:focus { border-color: var(--azul-500); box-shadow: 0 0 0 4px rgba(47, 90, 232, .16); }
input.grande { font-size: 22px; padding: 12px 14px; font-weight: 700; }
input[type=file] { padding: 8px; }
.buscar { position: relative; flex: 1; min-width: 200px; }
.buscar svg { position: absolute; left: 14px; top: 50%; translate: 0 -50%; color: var(--tinta-2); }
.buscar input { padding-left: 42px; height: 46px; border-radius: 16px; font-size: 16px; background: var(--vidrio-2); }
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; padding: 4px; border-radius: 15px; background: rgba(23, 65, 198, .09); gap: 4px; }
.seg button { border: 0; background: transparent; padding: 9px 10px; border-radius: 11px; cursor: pointer; font-weight: 600; color: var(--tinta-2); }
.seg button.activo { background: #fff; color: var(--azul-800); box-shadow: 0 2px 8px rgba(15, 47, 158, .15); }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 6px; scrollbar-width: thin; }
.chip { flex: none; padding: 7px 14px; border-radius: 99px; border: 1px solid rgba(255, 255, 255, .8); background: var(--vidrio); cursor: pointer; font-weight: 600; font-size: 13px; color: var(--tinta-2); }
.chip.activo { background: var(--azul-700); color: #fff; border-color: transparent; box-shadow: 0 4px 12px rgba(23, 65, 198, .3); }

/* ---- Venta ---- */
.pos { display: grid; grid-template-columns: 1fr 370px; gap: 16px; flex: 1; min-height: 0; }
.catalogo { display: flex; flex-direction: column; gap: 10px; min-height: 0; min-width: 0; }
.grid-prod { display: grid; grid-template-columns: repeat(auto-fill, minmax(158px, 1fr)); gap: 12px; align-content: start; overflow-y: auto; padding: 2px 4px 14px 2px; flex: 1; }
.prod { padding: 10px; border-radius: 20px; cursor: pointer; text-align: left; border: 1px solid rgba(255, 255, 255, .75); display: flex; flex-direction: column; gap: 6px; transition: transform .12s, box-shadow .15s; }
.prod:hover { transform: translateY(-3px); box-shadow: 0 22px 44px rgba(15, 47, 158, .22), inset 0 1px 0 #fff; }
.prod.agotado { opacity: .55; cursor: not-allowed; }
.prod .foto { aspect-ratio: 4/3; border-radius: 14px; overflow: hidden; display: grid; place-items: center; font-size: 34px; font-weight: 800; color: rgba(255, 255, 255, .95);
  background: linear-gradient(140deg, var(--azul-500), var(--azul-800)); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .4); }
.prod .foto img { width: 100%; height: 100%; object-fit: cover; }
.prod .nombre { font-weight: 600; font-size: 13.5px; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.5em; }
.prod .precio { font-weight: 800; font-size: 17px; color: var(--azul-800); }
.prod .meta { font-size: 12px; color: var(--tinta-2); display: flex; justify-content: space-between; gap: 6px; }
.poco { color: var(--ambar); font-weight: 700; } .cero { color: var(--rojo); font-weight: 700; }
.carrito { display: flex; flex-direction: column; min-height: 0; padding: 16px; gap: 10px; }
.carrito .lista { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; margin: 0 -6px; padding: 0 6px; }
.linea { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; padding: 10px 12px; border-radius: 15px; background: rgba(255, 255, 255, .62); border: 1px solid rgba(255, 255, 255, .8); }
.linea .n { font-weight: 600; font-size: 14px; line-height: 1.2; }
.paso { display: inline-flex; align-items: center; gap: 4px; }
.paso button { width: 28px; height: 28px; border-radius: 9px; border: 1px solid var(--linea); background: #fff; cursor: pointer; font-weight: 700; color: var(--azul-800); display: grid; place-items: center; padding: 0; }
.paso input { width: 46px; text-align: center; padding: 4px; border-radius: 9px; }
.totales { border-top: 1px dashed var(--linea); padding-top: 10px; display: flex; flex-direction: column; gap: 4px; }
.totales .t { display: flex; justify-content: space-between; }
.totales .gran { font-size: 28px; font-weight: 800; color: var(--azul-800); align-items: baseline; }
.vacio { display: grid; place-items: center; text-align: center; color: var(--tinta-2); padding: 34px 16px; gap: 8px; }
.vacio svg { width: 42px; height: 42px; opacity: .45; }

/* ---- Tablas, tarjetas y estados ---- */
table.tabla { width: 100%; border-collapse: collapse; }
.tabla th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--tinta-2); padding: 8px 10px; position: sticky; top: 0; background: rgba(244, 247, 255, .92); z-index: 1; }
.tabla td { padding: 9px 10px; border-top: 1px solid var(--linea); vertical-align: middle; }
.tabla tr:hover td { background: rgba(255, 255, 255, .45); }
.tabla .der { text-align: right; }
.mini { width: 40px; height: 40px; border-radius: 10px; object-fit: cover; background: linear-gradient(140deg, var(--azul-500), var(--azul-800)); display: grid; place-items: center; color: #fff; font-weight: 700; flex: none; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.kpi { padding: 12px 14px; border-radius: 16px; background: rgba(255, 255, 255, .62); border: 1px solid rgba(255, 255, 255, .85); }
.kpi span { font-size: 12px; color: var(--tinta-2); font-weight: 600; display: block; }
.kpi b { font-size: 20px; font-variant-numeric: tabular-nums; }
.kpi.fuerte { background: linear-gradient(150deg, var(--azul-700), var(--azul-900)); color: #fff; border-color: rgba(255, 255, 255, .3); }
.kpi.fuerte span { color: var(--oro-claro); }
.kpi.oro { background: linear-gradient(150deg, #fdf0c4, #f1cf73); border-color: rgba(255, 255, 255, .8); }
.dos { display: grid; grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); gap: 16px; align-items: start; }
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 99px; font-size: 12px; font-weight: 700; white-space: nowrap; background: rgba(23, 65, 198, .1); color: var(--azul-800); }
.badge.ok { background: rgba(18, 128, 74, .13); color: var(--verde); }
.badge.mal { background: rgba(192, 57, 43, .13); color: var(--rojo); }
.badge.espera { background: rgba(201, 150, 43, .2); color: #7a5607; }
.aviso { padding: 12px 14px; border-radius: 14px; background: rgba(243, 217, 139, .45); border: 1px solid rgba(201, 150, 43, .35); color: #5d4204; font-size: 14px; }
.aviso.azul { background: rgba(47, 90, 232, .1); border-color: rgba(47, 90, 232, .25); color: var(--azul-800); }
.barra { height: 8px; border-radius: 99px; background: rgba(23, 65, 198, .1); overflow: hidden; }
.barra i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--azul-500), var(--oro)); }
.pend { display: flex; gap: 12px; align-items: center; padding: 12px; border-radius: 16px; background: rgba(255, 255, 255, .6); border: 1px solid rgba(255, 255, 255, .85); flex-wrap: wrap; }
.pend img { width: 64px; height: 64px; object-fit: cover; border-radius: 12px; cursor: zoom-in; }

/* ---- Gráficas ---- */
.graficas { display: grid; grid-template-columns: 1.15fr 1fr; gap: 18px; align-items: start; }
.grafica { width: 100%; height: auto; display: block; }
.g-val { font-size: 11px; font-weight: 700; fill: var(--azul-800); }
.g-eje { font-size: 11.5px; font-weight: 600; fill: var(--tinta-2); }
.g-eje.sel { fill: #9a6d0e; font-weight: 800; }
.g-total { font-size: 17px; font-weight: 800; fill: var(--azul-900); }
.dona { display: flex; gap: 14px; align-items: center; }
.dona svg { width: 132px; flex: none; }
.leyenda { display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; min-width: 0; flex: 1; }
.leyenda div { display: flex; align-items: center; gap: 7px; }
.leyenda i { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.leyenda span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 1300px) { .graficas { grid-template-columns: 1fr; } }

/* ---- Inicio de sesión ---- */
.centro { height: 100%; display: grid; place-items: center; padding: 20px; overflow-y: auto; }
.login { width: min(430px, 100%); padding: 34px 30px; border-radius: 30px; display: flex; flex-direction: column; gap: 16px; }
.sello { width: 64px; height: 64px; border-radius: 20px; display: grid; place-items: center; color: #fff; font-size: 26px; font-weight: 800;
  background: linear-gradient(150deg, var(--azul-500), var(--azul-900)); box-shadow: 0 10px 24px rgba(23, 65, 198, .4), inset 0 1px 0 rgba(255, 255, 255, .5), inset 0 0 0 2px rgba(243, 217, 139, .7); }
.error { color: var(--rojo); font-weight: 600; font-size: 14px; }

/* ---- Escena azul: bienvenida e inicio de sesión ---- */
.escena { position: fixed; inset: 0; overflow: hidden; color: #fff;
  background: radial-gradient(ellipse 90% 60% at 50% 108%, #3f6df5 0%, rgba(63, 109, 245, 0) 70%), linear-gradient(180deg, #071c78 0%, #0d2fa8 48%, #1746d6 100%); }
.letrero { position: absolute; left: 1.2vw; top: 5vh; width: 97.6vw; height: 34vh; overflow: visible; pointer-events: none; }
.letrero text { font: 900 292px "Segoe UI Black", "Arial Black", "Segoe UI Variable Display", "Segoe UI", sans-serif; letter-spacing: -6px; }
.escena.acceso .letrero { opacity: .72; top: 3vh; height: 30vh; }
.escena.acceso .centro { position: relative; }
.escena.acceso .login { background: rgba(255, 255, 255, .82); color: var(--tinta); }

.bv { position: fixed; inset: 0; z-index: 90; overflow: hidden; cursor: pointer; color: #fff; transition: opacity .38s ease, transform .38s ease;
  background: radial-gradient(ellipse 90% 60% at 50% 108%, #3f6df5 0%, rgba(63, 109, 245, 0) 70%), linear-gradient(180deg, #071c78 0%, #0d2fa8 48%, #1746d6 100%); }
.bv.fuera { opacity: 0; transform: scale(1.04); pointer-events: none; }
.bv .letrero { animation: bvSube 1.1s cubic-bezier(.2, .8, .2, 1) .26s both; }
.bv-tag { position: absolute; top: 2.2vh; height: 38px; padding: 0 18px; display: inline-flex; align-items: center; background: #fff; color: #0d0f1e; border: 0; cursor: pointer;
  font: 650 16.5px "Segoe UI Variable Display", "Segoe UI", sans-serif; letter-spacing: -.02em; white-space: nowrap; z-index: 3;
  box-shadow: 0 3px 0 rgba(0, 0, 0, .18), 0 6px 14px rgba(0, 0, 0, .18); transition: transform .25s cubic-bezier(.2, .8, .2, 1), box-shadow .25s;
  animation: bvEtiqueta .7s cubic-bezier(.3, 1.5, .5, 1) both; }
.bv-tag:hover { transform: translateY(-2px) rotate(-1.5deg); box-shadow: 0 5px 0 rgba(0, 0, 0, .22), 0 10px 18px rgba(0, 0, 0, .2); }
.bv-tag.t1 { left: 2vw; animation-delay: .12s; } .bv-tag.t2 { left: calc(2vw + 250px); animation-delay: .2s; }
.bv-ir { top: auto; bottom: 9vh; left: 6vw; height: 54px; padding: 0 28px; font-size: 20px; background: linear-gradient(180deg, #fbe7a8, #e7b84a); animation-delay: 1.9s; }
.bv-nombre { position: absolute; left: 6vw; top: calc(5vh + 34vh - .62em); z-index: 2; line-height: 1; white-space: nowrap; transform: rotate(-6deg); transform-origin: 0 50%;
  font: 400 clamp(64px, 11vw, 200px) "Segoe Script", "Ink Free", "Lucida Handwriting", "Brush Script MT", cursive; text-shadow: 0 4px 22px rgba(4, 16, 80, .45);
  animation: bvEscribe 1s cubic-bezier(.5, 0, .3, 1) 1.05s both; }
.bv-texto { position: absolute; left: 6vw; bottom: calc(9vh + 84px); width: min(360px, 60vw); z-index: 2; animation: bvAparece .6s ease 1.7s both; }
.bv-texto b { font-size: 17px; letter-spacing: -.02em; color: var(--oro-claro); }
.bv-texto p { margin: 10px 0 0; font-size: 15px; line-height: 1.36; font-weight: 500; color: rgba(255, 255, 255, .92); }
.bv-pista { position: absolute; left: 50%; bottom: 2.6vh; translate: -50% 0; display: flex; align-items: center; gap: 12px; font-size: 12px; letter-spacing: .18em; text-transform: uppercase; font-weight: 600; opacity: .85; animation: bvAparece .6s ease 1.8s both; white-space: nowrap; }
.bv-pista i { position: relative; width: 1.5px; height: 22px; background: rgba(255, 255, 255, .35); overflow: hidden; }
.bv-pista i::after { content: ""; position: absolute; left: 0; top: -40%; width: 100%; height: 40%; background: #fff; animation: bvGota 1.6s cubic-bezier(.6, 0, .4, 1) infinite; }

/* Gafete colgante de vidrio */
.gafete { position: absolute; right: 7vw; top: 0; width: 250px; z-index: 4; transform-origin: 50% 0; pointer-events: none;
  animation: bvCae 1.5s cubic-bezier(.2, .8, .2, 1) .7s both, bvMece 3.2s ease-in-out 2.3s infinite alternate; }
.gafete .correa { width: 26px; height: 21vh; margin: 0 auto; background: linear-gradient(90deg, #dfe6ff, #fff 45%, #cfd9ff); box-shadow: 0 6px 14px rgba(0, 0, 0, .25); }
.gafete .broche { width: 34px; height: 30px; margin: -2px auto -8px; border-radius: 6px 6px 12px 12px; background: linear-gradient(180deg, #f4f6fb, #9aa6c4); box-shadow: inset 0 1px 0 #fff, 0 3px 6px rgba(0, 0, 0, .3); position: relative; z-index: 1; }
.gafete .tarjeta { position: relative; padding: 30px 18px 16px; border-radius: 20px; color: #fff;
  background: linear-gradient(160deg, rgba(255, 255, 255, .3), rgba(255, 255, 255, .1)); -webkit-backdrop-filter: blur(22px) saturate(180%); backdrop-filter: blur(22px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, .55); box-shadow: 0 24px 50px rgba(3, 12, 70, .45), inset 0 1px 0 rgba(255, 255, 255, .8), inset 0 -1px 0 rgba(255, 255, 255, .15); }
.gafete .ojal { position: absolute; left: 50%; top: 9px; translate: -50% 0; width: 46px; height: 9px; border-radius: 99px; background: rgba(4, 16, 80, .45); box-shadow: inset 0 1px 2px rgba(0, 0, 0, .5); }
.gafete h4 { margin: 0; font: 800 28px/.95 "Segoe UI Variable Display", "Segoe UI", sans-serif; letter-spacing: -.5px; }
.gafete .anio { position: absolute; right: 18px; top: 34px; font-size: 11px; font-weight: 700; color: var(--oro-claro); }
.gafete .rol { margin-top: 12px; padding-top: 6px; border-top: 1px solid rgba(255, 255, 255, .6); font-size: 9.5px; font-weight: 700; letter-spacing: .2px; }
.gafete .foto { width: 92px; height: 104px; margin: 12px auto; border-radius: 12px; display: grid; place-items: center; font: 900 58px "Segoe UI", sans-serif; color: #0a1f6b;
  background: linear-gradient(160deg, #fff6d2, #e7b84a); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .9), 0 6px 14px rgba(3, 12, 70, .35); }
.gafete .ren { display: flex; justify-content: space-between; align-items: flex-end; gap: 10px; padding: 6px 0 3px; border-bottom: 1.5px dotted rgba(255, 255, 255, .6); font-size: 9.5px; font-weight: 700; }
.gafete .ren b { font-weight: 600; text-align: right; }

/* Gafete pequeño en la barra lateral: quién está trabajando */
.mini-gafete { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 14px; background: rgba(255, 255, 255, .14); border: 1px solid rgba(255, 255, 255, .3); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35); }
.mini-gafete .l { width: 34px; height: 38px; border-radius: 9px; flex: none; display: grid; place-items: center; font-weight: 900; font-size: 19px; color: #0a1f6b; background: linear-gradient(160deg, #fff6d2, #e7b84a); }
.mini-gafete small { display: block; font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--oro-claro); }
.mini-gafete b { display: block; font-size: 14.5px; line-height: 1.15; }

@keyframes bvSube { from { opacity: 0; transform: translateY(60px); clip-path: inset(100% 0 0 0); } to { opacity: 1; transform: none; clip-path: inset(-20% 0 -20% 0); } }
@keyframes bvEscribe { from { opacity: 0; clip-path: inset(-30% 100% -30% 0); } to { opacity: 1; clip-path: inset(-30% -10% -30% 0); } }
@keyframes bvEtiqueta { from { opacity: 0; transform: translateY(-40px) rotate(-4deg); } }
@keyframes bvAparece { from { opacity: 0; transform: translateY(14px); } }
@keyframes bvCae { 0% { opacity: 0; transform: translateY(-120%) rotate(8deg); } 60% { opacity: 1; transform: translateY(0) rotate(-3deg); } 80% { transform: rotate(1.6deg); } 100% { transform: rotate(0); } }
@keyframes bvMece { from { rotate: -1.1deg; } to { rotate: 1.1deg; } }
@keyframes bvGota { to { top: 100%; } }
@media (max-width: 820px) {
  .gafete { right: 4vw; width: 190px; scale: .82; transform-origin: 100% 0; } .gafete .correa { height: 12vh; }
  .bv-tag.t2 { left: auto; right: 2vw; } .bv-nombre { top: calc(5vh + 24vh); } .letrero { height: 24vh; }
  .bv-texto { display: none; }
}

/* ---- Ventanas y avisos ---- */
.velo { position: fixed; inset: 0; background: rgba(10, 31, 107, .28); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); display: grid; place-items: center; padding: 20px; z-index: 50; animation: aparecer .15s; }
.modal { width: min(520px, 100%); max-height: 92vh; overflow-y: auto; padding: 24px; border-radius: 28px; background: rgba(250, 252, 255, .93); display: flex; flex-direction: column; gap: 14px; animation: subir .2s; }
.modal.ancho { width: min(920px, 100%); }
.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 80; display: flex; flex-direction: column; gap: 8px; }
.toast { padding: 12px 18px; border-radius: 16px; color: #fff; font-weight: 600; background: rgba(15, 47, 158, .92); box-shadow: var(--sombra); animation: subir .2s; max-width: 380px; }
.toast.mal { background: rgba(192, 57, 43, .95); }
@keyframes aparecer { from { opacity: 0; } }
@keyframes subir { from { opacity: 0; transform: translateY(10px); } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
::-webkit-scrollbar { width: 10px; height: 10px; } ::-webkit-scrollbar-thumb { background: rgba(23, 65, 198, .22); border-radius: 99px; border: 2px solid transparent; background-clip: padding-box; }

/* ==== TEMA AZUL REY ==== */
/* Fondo azul rey en toda la app, letras blancas y tarjetas de vidrio translúcido */
:root {
  --tinta: #ffffff; --tinta-2: rgba(255, 255, 255, .74); --linea: rgba(255, 255, 255, .2);
  --vidrio: rgba(255, 255, 255, .09); --vidrio-2: rgba(255, 255, 255, .15);
  --verde: #86e8b0; --rojo: #ffa698; --ambar: #ffd27a;
  --sombra: 0 18px 46px rgba(3, 12, 70, .34), 0 2px 6px rgba(3, 12, 70, .2);
  color-scheme: dark;
}
html { scrollbar-color: rgba(255, 255, 255, .3) transparent; }
body { background: #0d2fa8; }
.fondo { background: linear-gradient(165deg, #081d78 0%, #0d30a6 48%, #0a278e 100%); }
.fondo i:nth-child(1) { background: radial-gradient(circle, #3f6df5 0%, rgba(63, 109, 245, 0) 70%); opacity: .4; }
.fondo i:nth-child(2) { background: radial-gradient(circle, #e7b84a 0%, rgba(231, 184, 74, 0) 70%); opacity: .16; }
.fondo i:nth-child(3) { background: radial-gradient(circle, #6f96ff 0%, rgba(111, 150, 255, 0) 70%); opacity: .4; }
.glass { -webkit-backdrop-filter: blur(26px) saturate(125%); backdrop-filter: blur(26px) saturate(125%); border-color: rgba(255, 255, 255, .24); box-shadow: var(--sombra), inset 0 1px 0 rgba(255, 255, 255, .42), inset 0 -1px 0 rgba(255, 255, 255, .06); }
.glass::before { background: linear-gradient(180deg, rgba(255, 255, 255, .2) 0%, rgba(255, 255, 255, 0) 38%); }
.side { background: linear-gradient(165deg, rgba(5, 20, 96, .62), rgba(9, 30, 120, .46) 55%, rgba(4, 16, 80, .66)); border-color: rgba(255, 255, 255, .24); }
.btn { color: #fff; border-color: rgba(255, 255, 255, .34); box-shadow: 0 2px 8px rgba(3, 12, 70, .22), inset 0 1px 0 rgba(255, 255, 255, .34); }
.btn:hover { filter: brightness(1.12); box-shadow: 0 6px 16px rgba(3, 12, 70, .3), inset 0 1px 0 rgba(255, 255, 255, .4); }
.btn.pri { color: var(--azul-800); border-color: rgba(255, 255, 255, .9); background: linear-gradient(180deg, #ffffff, #dfe7ff); box-shadow: 0 8px 20px rgba(3, 12, 70, .32), inset 0 1px 0 #fff; }
.btn.ok { background: linear-gradient(180deg, #2bb673, #12804a); }
.btn.peligro { color: #ffb9ad; }
.btn.peligro.lleno { color: #fff; background: linear-gradient(180deg, #e2604f, #c0392b); }
label.campo { color: rgba(255, 255, 255, .82); }
.fila:has(> label.campo) { align-items: flex-end; }
input, select, textarea { background: rgba(255, 255, 255, .13); border-color: rgba(255, 255, 255, .28); color: #fff; }
input::placeholder, textarea::placeholder { color: rgba(255, 255, 255, .5); }
input:focus, select:focus, textarea:focus { border-color: var(--oro-claro); box-shadow: 0 0 0 4px rgba(243, 217, 139, .2); }
select option { color: #101b45; background: #fff; }
.buscar svg { color: rgba(255, 255, 255, .75); }
.seg { background: rgba(255, 255, 255, .12); }
.seg button { color: rgba(255, 255, 255, .78); }
.seg button.activo { background: #fff; color: var(--azul-800); }
.chip { border-color: rgba(255, 255, 255, .3); color: rgba(255, 255, 255, .88); }
.chip.activo { background: #fff; color: var(--azul-800); box-shadow: 0 4px 12px rgba(3, 12, 70, .3); }
.prod { border-color: rgba(255, 255, 255, .26); color: #fff; }
.prod:hover { box-shadow: 0 22px 44px rgba(3, 12, 70, .4), inset 0 1px 0 rgba(255, 255, 255, .5); }
.prod .foto { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .45), 0 0 0 1px rgba(255, 255, 255, .22); }
.prod .precio { color: #fff; }
.linea { background: rgba(255, 255, 255, .1); border-color: rgba(255, 255, 255, .22); }
.paso button { background: rgba(255, 255, 255, .16); border-color: rgba(255, 255, 255, .3); color: #fff; }
.totales .gran { color: #fff; }
.tabla th { background: rgba(12, 36, 132, .94); color: rgba(255, 255, 255, .72); }
.tabla tr:hover td { background: rgba(255, 255, 255, .06); }
.mini { background: rgba(255, 255, 255, .18); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .4); }
.kpi { background: rgba(255, 255, 255, .1); border-color: rgba(255, 255, 255, .22); }
.kpi.fuerte { background: linear-gradient(150deg, #ffffff, #dfe7ff); color: var(--azul-900); border-color: #fff; }
.kpi.fuerte span { color: var(--azul-700); }
.kpi.oro { color: #3d2c05; border-color: rgba(255, 255, 255, .7); }
.kpi.oro span { color: #6b4d08; }
.badge { background: rgba(255, 255, 255, .16); color: #fff; }
.badge.ok { background: rgba(80, 225, 150, .2); color: #a5f3c7; }
.badge.mal { background: rgba(255, 120, 100, .24); color: #ffc0b5; }
.badge.espera { background: rgba(243, 217, 139, .22); color: #fbe7a8; }
.aviso { background: rgba(243, 217, 139, .15); border-color: rgba(243, 217, 139, .45); color: #fbe7a8; }
.aviso.azul { background: rgba(255, 255, 255, .1); border-color: rgba(255, 255, 255, .28); color: #fff; }
.barra { background: rgba(255, 255, 255, .14); }
.barra i { background: linear-gradient(90deg, #a9c1ff, #f3d98b); }
.pend { background: rgba(255, 255, 255, .1); border-color: rgba(255, 255, 255, .22); }
.error { color: #ffb9ad; }
.escena.acceso .login { background: rgba(255, 255, 255, .13); color: #fff; }
.velo { background: rgba(3, 12, 64, .5); }
.modal { background: rgba(14, 42, 150, .9); color: #fff; }
.toast { background: #fff; color: var(--azul-900); }
.toast.mal { background: #c0392b; color: #fff; }
.g-val { fill: #fff; } .g-eje.sel { fill: var(--oro-claro); } .g-total { fill: #fff; }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .28); background-clip: padding-box; }
/* ==== FIN TEMA AZUL REY ==== */
@media (max-width: 980px) {
  /* Celular y tableta: el menú pasa a ser una barra de pestañas abajo */
  html, body { height: auto; min-height: 100%; }
  body { overflow: auto; }
  #app { height: auto; }
  .shell { display: block; height: auto; min-height: 100vh; padding: 12px 12px 96px; }
  .side { position: fixed; left: 10px; right: 10px; bottom: 10px; top: auto; z-index: 40; flex-direction: row; align-items: stretch; padding: 6px; border-radius: 24px; }
  .side::after, .marca, .mini-gafete { display: none; }
  .nav { flex-direction: row; gap: 2px; overflow-x: auto; scrollbar-width: none; }
  .nav::-webkit-scrollbar { display: none; }
  .nav button { position: relative; flex: 1 0 auto; width: auto; min-width: 54px; flex-direction: column; justify-content: center; gap: 3px; padding: 7px 8px; border-radius: 16px; font-size: 10.5px; text-align: center; white-space: nowrap; }
  .nav button.activo { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .4), inset 0 -3px 0 var(--oro-claro); }
  .nav .cuenta { position: absolute; top: 2px; right: 6px; margin: 0; font-size: 10px; padding: 0 6px; }
  .side .pie { border: 0; padding: 0; display: flex; }
  .side .pie .nav { margin: 0 !important; flex: none; }
  .main { min-height: calc(100vh - 110px); }
  .scroll { overflow: visible; padding: 2px 0 8px; }
  .top { padding: 2px 2px 0; } h1 { font-size: 22px; }
  .dos { grid-template-columns: 1fr; }
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .pad { padding: 14px; }
  .scroll > .glass, .dos > .glass, .scroll .glass.pad { overflow-x: auto; }
  .tabla { min-width: 540px; }
  .graficas { grid-template-columns: 1fr; }
  .pos { grid-template-columns: 1fr; } .grid-prod { max-height: 56vh; }
  .pend { align-items: flex-start; }
  .velo { padding: 10px; align-items: end; } .modal { padding: 18px; border-radius: 24px; max-height: 88vh; }
  .toasts { left: 12px; right: 12px; bottom: 96px; } .toast { max-width: none; }
  input, select, textarea { font-size: 16px; } /* evita el zoom automático del teléfono al escribir */
}
@media print {
  /* impresión en papel */
  :root { --tinta: #111; --tinta-2: #555; --linea: #ccc; --verde: #12804a; --rojo: #c0392b; color-scheme: light; }
  body { color: #111; } .kpi, .kpi.fuerte, .kpi.oro { background: #fff; color: #111; border: 1px solid #ccc; } .kpi span, .kpi.fuerte span { color: #555; }
  .tabla th { background: #eee; color: #333; } .badge { background: #eee; color: #333; } .g-val, .g-total { fill: #111; }
  body { overflow: visible; background: #fff; } .fondo, .side, .no-imprimir, .toasts { display: none !important; }
  .shell { display: block; padding: 0; } .glass { box-shadow: none; border: 0; backdrop-filter: none; background: #fff; } .scroll { overflow: visible; }
}
