/* ══════════════════════════════════════════════════════════════
   PULSO by KY Systems — Sistema de diseño
   Una sola fuente de verdad para login, garzón, cocina y admin.
   Regla de color: el rojo Pulso marca la acción principal y lo que
   necesita atención ahora. Todo lo demás es tinta, grafito y papel.
   ══════════════════════════════════════════════════════════════ */
/* Fuentes locales (licencia SIL OFL, ver assets/fonts): cargan rápido y funcionan sin internet */
@font-face { font-family: 'Bricolage Grotesque'; font-style: normal; font-display: swap; font-weight: 200 800; src: url('../fonts/bricolage-grotesque.woff2') format('woff2'); }
@font-face { font-family: 'Instrument Sans'; font-style: normal; font-display: swap; font-weight: 400 700; src: url('../fonts/instrument-sans.woff2') format('woff2'); }

:root {
  /* Base */
  --papel:      #F2F2F7;
  --superficie: #FFFFFF;
  --superficie-2: #F9F9FB;
  --hundido:    #EDEDF2;
  --linea:      rgba(60,60,67,.12);
  --linea-2:    rgba(60,60,67,.22);
  --tinta:      #1C1C1E;
  --tinta-2:    #2C2C2E;
  --grafito:    #6C6C72;
  --tenue:      #9A9AA0;

  /* Marca */
  --rojo:       #D61F26;
  --rojo-hover: #B8161C;
  --rojo-neon:  #FF3B3B;
  --rojo-suave: #FDECEC;
  --rojo-borde: #F7C6C7;

  /* Estados de servicio (no compiten con el rojo) */
  --libre:      #FFFFFF;
  --ocupada:    #1C1C1E;
  --preparando: #E08A00;
  --preparando-suave: #FFF4E0;
  --listo:      #10915A;
  --listo-suave: #E5F6EE;
  --sirviendo:  #0A6CF0;
  --sirviendo-suave: #E5F0FF;

  /* Tipografía */
  --f-display: 'Bricolage Grotesque', 'Instrument Sans', system-ui, sans-serif;
  --f-ui:      'Instrument Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;

  /* Escala tipográfica (1.2) */
  --t-xs: 12px; --t-sm: 13px; --t-md: 14px; --t-base: 15px;
  --t-lg: 18px; --t-xl: 22px; --t-2xl: 28px; --t-3xl: 36px;

  /* Espacios, radios, sombras */
  --r-xs: 8px; --r-sm: 10px; --r-md: 14px; --r-lg: 20px; --r-xl: 26px;
  --sombra-1: 0 1px 2px rgba(0,0,0,.05);
  --sombra-2: 0 1px 1px rgba(0,0,0,.03), 0 6px 20px rgba(0,0,0,.06);
  --sombra-3: 0 24px 60px rgba(0,0,0,.18), 0 4px 14px rgba(0,0,0,.08);
  --anillo: 0 0 0 3px rgba(214,31,38,.18);

  --ease: cubic-bezier(.2,.7,.2,1);
  --ease-sheet: cubic-bezier(.32,.72,0,1);
  --resorte: cubic-bezier(.34,1.36,.64,1);     /* rebote suave tipo iOS */

  /* Materiales (vidrio) */
  --vidrio:        rgba(255,255,255,.72);
  --vidrio-fuerte: rgba(255,255,255,.86);
  --vidrio-oscuro: rgba(28,28,30,.78);
  --vidrio-borde:  rgba(255,255,255,.65);
  --desenfoque:    saturate(180%) blur(22px);
  --relleno:       rgba(118,118,128,.12);    /* campos y segmentos */
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--f-ui); font-size: var(--t-md); line-height: 1.5;
  color: var(--tinta); background: var(--papel);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: none; }
a { color: inherit; }
img, svg { display: block; }
.num, .tnum { font-variant-numeric: tabular-nums; }
::selection { background: var(--rojo-suave); }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: var(--linea-2); border-radius: 8px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-track { background: transparent; }
:focus-visible { outline: 2px solid var(--rojo); outline-offset: 2px; }

/* ── Marca ─────────────────────────────────────────────────── */
.marca { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.marca-icono {
  width: 34px; height: 34px; border-radius: 9px; background: var(--rojo);
  display: grid; place-items: center; flex-shrink: 0; overflow: hidden;
  box-shadow: inset 0 -2px 0 rgba(0,0,0,.12);
}
.marca-icono svg { width: 22px; height: 22px; }
.marca-icono img { width: 100%; height: 100%; object-fit: cover; }
.marca-nombre { font-family: var(--f-display); font-weight: 700; font-size: 19px; letter-spacing: -.02em; line-height: 1; }
.marca-sub { font-size: var(--t-xs); color: var(--grafito); line-height: 1.2; margin-top: 2px; }
.marca-sub b { font-weight: 600; color: var(--tinta-2); }

/* ── Botones ───────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 16px; border-radius: var(--r-sm);
  font-size: var(--t-md); font-weight: 600; line-height: 1; white-space: nowrap;
  border: 1px solid transparent; text-decoration: none;
  transition: background-color .15s, border-color .15s, color .15s, box-shadow .15s, transform .1s;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn svg { width: 16px; height: 16px; flex-shrink: 0; }
.btn-primario { background: var(--rojo); color: #fff; }
.btn-primario:hover:not(:disabled) { background: var(--rojo-hover); }
.btn-tinta { background: var(--tinta); color: #fff; }
.btn-tinta:hover:not(:disabled) { background: var(--tinta-2); }
.btn-secundario { background: var(--superficie); color: var(--tinta); border-color: var(--linea-2); }
.btn-secundario:hover:not(:disabled) { background: var(--hundido); }
.btn-fantasma { color: var(--grafito); }
.btn-fantasma:hover:not(:disabled) { background: var(--hundido); color: var(--tinta); }
.btn-peligro { background: var(--superficie); color: var(--rojo); border-color: var(--rojo-borde); }
.btn-peligro:hover:not(:disabled) { background: var(--rojo-suave); }
.btn-exito { background: var(--listo); color: #fff; }
.btn-exito:hover:not(:disabled) { background: #0B7A4B; }
.btn-sm { height: 32px; padding: 0 12px; font-size: var(--t-sm); border-radius: var(--r-xs); }
.btn-lg { height: 52px; padding: 0 22px; font-size: var(--t-base); border-radius: var(--r-md); }
.btn-bloque { width: 100%; }
.btn-icono { width: 40px; padding: 0; }
.btn-icono.btn-sm { width: 32px; }

/* ── Campos ────────────────────────────────────────────────── */
.campo { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.campo-label { font-size: var(--t-sm); font-weight: 600; color: var(--tinta-2); }
.campo-ayuda { font-size: var(--t-xs); color: var(--grafito); }
.input, .select, .textarea {
  width: 100%; height: 42px; padding: 0 12px; border-radius: var(--r-sm);
  background: var(--superficie); border: 1px solid var(--linea-2);
  font-size: var(--t-md); color: var(--tinta); outline: none; -webkit-appearance: none; appearance: none;
  transition: border-color .15s, box-shadow .15s;
}
.textarea { height: auto; min-height: 76px; padding: 10px 12px; resize: vertical; line-height: 1.45; }
.select {
  padding-right: 34px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%235E6470' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
}
.input:hover, .select:hover, .textarea:hover { border-color: var(--tenue); }
.input:focus, .select:focus, .textarea:focus { border-color: var(--rojo); box-shadow: var(--anillo); }
.input::placeholder, .textarea::placeholder { color: var(--tenue); }

/* ── Etiquetas de estado ───────────────────────────────────── */
.etq {
  display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 9px;
  border-radius: 99px; font-size: var(--t-xs); font-weight: 600; white-space: nowrap;
  background: var(--hundido); color: var(--tinta-2);
}
.etq::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .9; }
.etq.sin-punto::before { display: none; }
.etq-neutro   { background: var(--hundido); color: var(--tinta-2); }
.etq-rojo     { background: var(--rojo-suave); color: var(--rojo); }
.etq-ambar    { background: var(--preparando-suave); color: #A86400; }
.etq-verde    { background: var(--listo-suave); color: var(--listo); }
.etq-azul     { background: var(--sirviendo-suave); color: var(--sirviendo); }
.etq-tinta    { background: var(--tinta); color: #fff; }

/* ── En vivo ───────────────────────────────────────────────── */
.en-vivo { display: inline-flex; align-items: center; gap: 7px; font-size: var(--t-xs); font-weight: 600; color: var(--grafito); }
.en-vivo i { width: 8px; height: 8px; border-radius: 50%; background: var(--listo); position: relative; }
.en-vivo i::after { content: ''; position: absolute; inset: -4px; border-radius: 50%; border: 2px solid var(--listo); opacity: 0; animation: latido 2s var(--ease) infinite; }
.en-vivo.caido i { background: var(--rojo); }
.en-vivo.caido i::after { border-color: var(--rojo); }
@keyframes latido { 0% { transform: scale(.5); opacity: .7; } 100% { transform: scale(1.4); opacity: 0; } }

/* ── Tarjeta ───────────────────────────────────────────────── */
.tarjeta { background: var(--superficie); border: 1px solid var(--linea); border-radius: var(--r-lg); }

/* ── Vacío ─────────────────────────────────────────────────── */
.vacio { text-align: center; padding: 40px 20px; color: var(--grafito); }
.vacio svg { width: 40px; height: 40px; margin: 0 auto 12px; color: var(--linea-2); }
.vacio h3 { font-family: var(--f-display); font-size: var(--t-lg); font-weight: 700; color: var(--tinta); margin-bottom: 4px; letter-spacing: -.01em; }
.vacio p { font-size: var(--t-sm); max-width: 36ch; margin: 0 auto; }

/* ── Aviso (toast) ─────────────────────────────────────────── */
.aviso-pila { position: fixed; z-index: 9999; left: 50%; bottom: 24px; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.aviso {
  pointer-events: auto; display: flex; align-items: center; gap: 10px; min-width: 260px; max-width: min(440px, calc(100vw - 32px));
  padding: 12px 16px; border-radius: var(--r-md); background: var(--tinta); color: #fff;
  font-size: var(--t-md); font-weight: 500; box-shadow: var(--sombra-3);
  animation: aviso-entra .28s var(--ease) both;
}
.aviso.sale { animation: aviso-sale .2s ease forwards; }
.aviso svg { width: 18px; height: 18px; flex-shrink: 0; }
.aviso.ok svg { color: #4ADE80; } .aviso.warn svg { color: #FBBF24; } .aviso.err svg { color: var(--rojo-neon); }
@keyframes aviso-entra { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes aviso-sale { to { opacity: 0; transform: translateY(8px); } }

/* ── SweetAlert2 con la identidad Pulso ────────────────────── */
.swal2-popup { font-family: var(--f-ui) !important; border-radius: var(--r-xl) !important; padding: 28px 24px 22px !important; color: var(--tinta) !important; }
.swal2-title { font-family: var(--f-display) !important; font-size: var(--t-xl) !important; font-weight: 700 !important; letter-spacing: -.01em; color: var(--tinta) !important; padding: 4px 8px 0 !important; }
.swal2-html-container { font-size: var(--t-md) !important; color: var(--grafito) !important; margin-top: 10px !important; }
.swal2-actions { gap: 8px; margin-top: 22px !important; width: 100%; }
.swal2-styled { margin: 0 !important; height: 44px; padding: 0 20px !important; border-radius: var(--r-sm) !important; font-weight: 600 !important; font-size: var(--t-md) !important; box-shadow: none !important; }
.swal2-styled.swal2-confirm { background: var(--rojo) !important; }
.swal2-styled.swal2-confirm.ok { background: var(--listo) !important; }
.swal2-styled.swal2-cancel { background: var(--superficie) !important; color: var(--tinta) !important; border: 1px solid var(--linea-2) !important; }
.swal2-input, .swal2-select { font-family: var(--f-ui) !important; height: 44px !important; border-radius: var(--r-sm) !important; border: 1px solid var(--linea-2) !important; box-shadow: none !important; font-size: var(--t-base) !important; margin: 8px 0 0 !important; width: 100% !important; }
.swal2-input:focus { border-color: var(--rojo) !important; box-shadow: var(--anillo) !important; }
.swal2-icon { transform: scale(.8); margin: 4px auto 0 !important; }
.swal2-icon.swal2-success [class^='swal2-success-line'] { background-color: var(--listo) !important; }
.swal2-icon.swal2-success .swal2-success-ring { border-color: rgba(16,145,90,.3) !important; }
.swal2-icon.swal2-question, .swal2-icon.swal2-info { border-color: var(--linea-2) !important; color: var(--grafito) !important; }
.swal2-icon.swal2-warning { border-color: #F6C46B !important; color: var(--preparando) !important; }
.swal2-icon.swal2-error { border-color: var(--rojo-borde) !important; }
.swal2-icon.swal2-error [class^='swal2-x-mark-line'] { background-color: var(--rojo) !important; }
.swal2-validation-message { background: var(--rojo-suave) !important; color: var(--rojo) !important; border-radius: var(--r-sm); }
.sw-campo { text-align: left; margin-top: 12px; }
.sw-campo label { display: block; font-size: var(--t-sm); font-weight: 600; color: var(--tinta-2); }
.sw-segmento { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 8px; }
.sw-segmento button { height: 44px; border-radius: var(--r-sm); border: 1px solid var(--linea-2); background: var(--superficie); font-weight: 600; transition: all .15s; }
.sw-segmento button.on { background: var(--tinta); color: #fff; border-color: var(--tinta); }

/* ── Utilidades ────────────────────────────────────────────── */
.oculto { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }

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


/* ══════════════════════════════════════════════════════════════
   CAPA iOS — materiales, controles y movimiento
   ══════════════════════════════════════════════════════════════ */
body { background-color: var(--papel); }
/* Luz ambiente: da algo que difuminar a los materiales de vidrio */
body::before {
  content: ''; position: fixed; inset: -10vmax; z-index: -1; pointer-events: none;
  background:
    radial-gradient(38vmax 30vmax at 8% 0%,   rgba(214,31,38,.13), transparent 70%),
    radial-gradient(34vmax 28vmax at 96% 8%,  rgba(10,108,240,.11), transparent 70%),
    radial-gradient(40vmax 30vmax at 60% 105%, rgba(16,145,90,.09), transparent 70%);
}
/* Entrada suave de cada pantalla. Solo opacidad: animar transform en <body> rompería los elementos fijos */
body { animation: pagina-entra .4s ease-out; }
@keyframes pagina-entra { from { opacity: 0; } to { opacity: 1; } }

.vidrio { background: var(--vidrio); -webkit-backdrop-filter: var(--desenfoque); backdrop-filter: var(--desenfoque); border: 1px solid var(--vidrio-borde); }
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) { .vidrio { background: var(--vidrio-fuerte); } }

/* Pulsación: todo lo tocable responde como en iOS */
.btn, .perfil, .tecla, .mesa-btn, .prod-card, .cat, .comanda-chip, .metodo, .act-btn, .nav-item, .kds-item, .segmento button, .kds-tab {
  transition: transform .28s var(--resorte), background-color .2s, color .2s, border-color .2s, box-shadow .2s, opacity .2s;
}
.btn:active:not(:disabled), .perfil:active, .mesa-btn:active, .prod-card:active, .cat:active, .comanda-chip:active, .metodo:active, .act-btn:active, .nav-item:active, .segmento button:active { transform: scale(.96); }

/* Botones */
.btn { height: 44px; border-radius: 12px; font-weight: 600; letter-spacing: -.005em; }
.btn-sm { height: 34px; border-radius: 10px; }
.btn-lg { height: 54px; border-radius: 16px; font-size: 16px; }
.btn-primario { box-shadow: 0 6px 18px -6px rgba(214,31,38,.55); }
.btn-exito { box-shadow: 0 6px 18px -6px rgba(16,145,90,.55); }
.btn-secundario { background: var(--vidrio-fuerte); border-color: var(--linea); }
.btn-fantasma:hover:not(:disabled) { background: var(--relleno); }

/* Campos rellenos estilo iOS */
.input, .select, .textarea { background-color: var(--relleno); border: 1px solid transparent; border-radius: 12px; height: 44px; }
.textarea { height: auto; }
.input:hover, .select:hover, .textarea:hover { border-color: transparent; background-color: rgba(118,118,128,.16); }
.input:focus, .select:focus, .textarea:focus { background-color: #fff; border-color: var(--rojo); box-shadow: var(--anillo); }

/* Etiquetas */
.etq { height: 24px; border-radius: 8px; }

/* Interruptor iOS (reutilizable) */
.switch { position: relative; width: 40px; height: 24px; border-radius: 999px; box-sizing: border-box; background: transparent; border: 2px solid #8E8E93; flex-shrink: 0; transition: background-color .15s ease, border-color .15s ease; }
.switch::before { content: ''; position: absolute; top: 50%; left: 4px; width: 12px; height: 12px; border-radius: 50%; background: #8E8E93; transform: translateY(-50%); transition: transform .15s ease, width .15s ease, height .15s ease, left .15s ease, background-color .15s ease; }
.switch.on { background: var(--tinta); border-color: var(--tinta); }
.switch.on::before { width: 16px; height: 16px; left: 2px; background: #fff; transform: translate(16px, -50%); }

/* Control segmentado */
.segmento { display: inline-flex; padding: 2px; gap: 0; background: var(--relleno); border-radius: 10px; }
.segmento button { height: 32px; padding: 0 14px; border-radius: 8px; font-size: var(--t-sm); font-weight: 600; color: var(--tinta-2); background: transparent; }
.segmento button.on { background: #fff; color: var(--tinta); box-shadow: 0 3px 8px rgba(0,0,0,.12), 0 3px 1px rgba(0,0,0,.04); }

/* Avisos: píldora flotante arriba, como la isla dinámica */
.aviso-pila { top: calc(14px + env(safe-area-inset-top)); bottom: auto; }
.aviso { background: var(--vidrio-oscuro); -webkit-backdrop-filter: var(--desenfoque); backdrop-filter: var(--desenfoque); border-radius: 22px; padding: 12px 18px; border: 1px solid rgba(255,255,255,.08); animation: aviso-entra .5s var(--resorte) both; }
@keyframes aviso-entra { from { opacity: 0; transform: translateY(-18px) scale(.9); } to { opacity: 1; transform: none; } }
@keyframes aviso-sale { to { opacity: 0; transform: translateY(-12px) scale(.95); } }

/* ══════════════════════════════════════════════════════════════
   LENGUAJE PULSO 2026 — vidrio líquido propio
   Superficies flotantes con bordes muy redondeados, luz en el canto,
   botones cápsula y hojas separadas de los bordes. Sin divisiones con
   líneas ni botones de texto azul (lo que hacía ver todo "iOS antiguo").
   ══════════════════════════════════════════════════════════════ */
:root {
  --liquido:        rgba(255,255,255,.74);
  --liquido-borde:  rgba(255,255,255,.7);
  --liquido-luz:    inset 0 1px 0 rgba(255,255,255,.95), inset 0 0 0 1px rgba(255,255,255,.35);
  --liquido-sombra: 0 30px 80px -20px rgba(16,18,24,.35), 0 10px 24px -12px rgba(16,18,24,.18);
  --r-hoja: 32px;
}

/* Botones cápsula */
.btn { border-radius: 999px; }
.btn-sm { border-radius: 999px; padding: 0 14px; }
.btn-lg { border-radius: 999px; }
.btn-icono { border-radius: 50%; }
.btn-primario, .btn-exito { box-shadow: 0 8px 20px -10px rgba(214,31,38,.7), inset 0 1px 0 rgba(255,255,255,.22); }
.btn-exito { box-shadow: 0 8px 20px -10px rgba(16,145,90,.7), inset 0 1px 0 rgba(255,255,255,.22); }
.btn-secundario { background: rgba(118,118,128,.12); border-color: transparent; }
.btn-secundario:hover:not(:disabled) { background: rgba(118,118,128,.18); }

/* Control segmentado cápsula: en pantallas angostas se desplaza en vez de partir el texto */
.segmento { border-radius: 999px; padding: 3px; max-width: 100%; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.segmento::-webkit-scrollbar { display: none; }
.segmento button { border-radius: 999px; white-space: nowrap; flex-shrink: 0; }
.seg-bloque button { flex-shrink: 1; }
.segmento button.on { box-shadow: 0 2px 10px rgba(0,0,0,.10), inset 0 0 0 .5px rgba(0,0,0,.04); }
.sw-segmento button { border-radius: 999px !important; }

/* Botón cerrar circular de vidrio (hojas y modales) */
.modal-close, .panel-close, .resumen-header .btn-icono, .hoja-cab .btn-icono {
  width: 36px !important; height: 36px !important; border-radius: 50% !important; padding: 0 !important;
  background: rgba(118,118,128,.14) !important; color: var(--tinta-2) !important; display: grid; place-items: center;
}
.modal-close svg, .panel-close svg, .resumen-header .btn-icono svg, .hoja-cab .btn-icono svg { width: 16px !important; height: 16px !important; stroke-width: 2.6; }

/* ── Alertas y diálogos (SweetAlert) ──────────────────────── */
.swal2-container.swal2-backdrop-show { background: rgba(16,18,24,.22) !important; -webkit-backdrop-filter: blur(8px) saturate(120%); backdrop-filter: blur(8px) saturate(120%); }
.swal2-popup {
  width: min(380px, calc(100vw - 24px)) !important; border-radius: var(--r-hoja) !important; padding: 26px 22px 18px !important;
  background: var(--liquido) !important; -webkit-backdrop-filter: saturate(190%) blur(28px); backdrop-filter: saturate(190%) blur(28px);
  border: 1px solid var(--liquido-borde) !important; box-shadow: var(--liquido-luz), var(--liquido-sombra) !important;
  text-align: left !important; overflow: hidden;
}
.swal2-show { animation: dialogo-entra .5s var(--resorte) !important; }
.swal2-hide { animation: dialogo-sale .2s ease forwards !important; }
@keyframes dialogo-entra { from { opacity: 0; transform: translateY(14px) scale(.94); } to { opacity: 1; transform: none; } }
@keyframes dialogo-sale { to { opacity: 0; transform: translateY(8px) scale(.97); } }
.swal2-title { text-align: left !important; font-size: 21px !important; line-height: 1.2 !important; letter-spacing: -.02em !important; padding: 0 !important; margin: 0 !important; }
.swal2-html-container { text-align: left !important; padding: 0 !important; margin: 8px 0 0 !important; font-size: 15px !important; line-height: 1.5 !important; color: var(--grafito) !important; }
.swal2-input-label { justify-content: flex-start !important; padding: 0 !important; margin: 16px 0 0 !important; font-size: 13px; font-weight: 600; color: var(--tinta-2); }
.swal2-input, .swal2-select { width: 100% !important; margin: 12px 0 0 !important; height: 48px !important; border-radius: 16px !important; border: 1px solid transparent !important; background: rgba(118,118,128,.12) !important; padding: 0 16px !important; }
.swal2-input { box-shadow: none !important; color: var(--tinta) !important; font-size: 16px !important; }
.swal2-input::placeholder { color: var(--tenue) !important; }
.swal2-input:focus { background: #fff !important; border-color: var(--rojo) !important; box-shadow: var(--anillo) !important; }
.sw-campo { padding: 0; margin-top: 16px; }
.sw-campo label { margin-bottom: 0; }
.sw-campo .swal2-input { margin: 8px 0 0 !important; }
.sw-chips { justify-content: flex-start !important; }
.swal2-validation-message { margin: 12px 0 0 !important; justify-content: flex-start !important; border-radius: 14px !important; padding: 10px 14px !important; font-size: 13px !important; }
.swal2-validation-message::before { display: none !important; }
.swal2-actions {
  display: flex !important; gap: 10px !important; width: 100% !important;
  margin: 22px 0 0 !important; padding: 0 !important; border: 0 !important; flex-wrap: nowrap !important; justify-content: stretch !important;
}
.swal2-actions:not(.swal2-loading) .swal2-styled:hover { background-image: none !important; }
.swal2-styled {
  flex: 1 1 0; height: 50px !important; margin: 0 !important; padding: 0 18px !important; border-radius: 999px !important; border: 0 !important;
  font-size: 16px !important; font-weight: 600 !important; box-shadow: none !important;
}
.swal2-styled.swal2-confirm { background: var(--rojo) !important; color: #fff !important; box-shadow: 0 8px 20px -10px rgba(214,31,38,.7), inset 0 1px 0 rgba(255,255,255,.22) !important; }
.swal2-styled.swal2-confirm.ok { background: var(--listo) !important; box-shadow: 0 8px 20px -10px rgba(16,145,90,.7), inset 0 1px 0 rgba(255,255,255,.22) !important; }
.swal2-styled.swal2-cancel { background: rgba(118,118,128,.14) !important; color: var(--tinta) !important; border: 0 !important; }
.sw-segmento button { border: 0 !important; background: rgba(118,118,128,.12) !important; color: var(--tinta-2); }
.sw-segmento button.on { background: var(--tinta) !important; color: #fff !important; }
.modal-foot .btn-secondary, .modal-foot .btn-secundario { background: rgba(118,118,128,.14) !important; border-color: transparent !important; }
.swal2-styled:focus-visible { outline: 2px solid var(--tinta) !important; outline-offset: 2px; }
/* Íconos: en vez del círculo animado clásico, una ficha de color a la izquierda */
.swal2-icon { width: 46px !important; height: 46px !important; margin: 0 0 14px !important; border: 0 !important; border-radius: 15px !important; transform: none !important; align-items: center; justify-content: center; animation: none !important; }
.swal2-icon > * { display: none !important; }
.swal2-icon::after { content: ''; width: 22px; height: 22px; background: currentColor; -webkit-mask: var(--ico) center / contain no-repeat; mask: var(--ico) center / contain no-repeat; }
.swal2-icon.swal2-error   { background: var(--rojo-suave) !important; color: var(--rojo) !important; --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='M18 6 6 18M6 6l12 12'/%3E%3C/svg%3E"); }
.swal2-icon.swal2-warning { background: var(--preparando-suave) !important; color: #B26A00 !important; --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='M12 8v5M12 17h.01'/%3E%3C/svg%3E"); }
.swal2-icon.swal2-success { background: var(--listo-suave) !important; color: var(--listo) !important; --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E"); }
.swal2-icon.swal2-info, .swal2-icon.swal2-question { background: rgba(118,118,128,.14) !important; color: var(--tinta-2) !important; --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='M12 11v6M12 7h.01'/%3E%3C/svg%3E"); }

/* En el teléfono los diálogos suben desde abajo, flotando sobre el borde */
@media (max-width: 640px) {
  .swal2-container.swal2-center { padding: 0 8px calc(8px + env(safe-area-inset-bottom)) !important; }
  .swal2-container.swal2-center > .swal2-popup { align-self: end !important; width: 100% !important; border-radius: 36px !important; padding: 26px 22px 20px !important; }
  .swal2-show { animation: dialogo-sube .55s var(--ease-sheet) !important; }
  .swal2-hide { animation: dialogo-baja .25s ease forwards !important; }
  @keyframes dialogo-sube { from { transform: translateY(105%); } to { transform: none; } }
  @keyframes dialogo-baja { to { transform: translateY(105%); } }
}

/* ── Hojas y modales de todas las pantallas ───────────────── */
.resumen-sheet, .hoja, #panelComanda, .modal-box {
  background: var(--liquido) !important; -webkit-backdrop-filter: saturate(190%) blur(30px) !important; backdrop-filter: saturate(190%) blur(30px) !important;
  border: 1px solid var(--liquido-borde) !important; box-shadow: var(--liquido-luz), var(--liquido-sombra) !important;
}
.modal-box { border-radius: var(--r-hoja) !important; }
#panelComanda { border-radius: var(--r-hoja) !important; }
.modal-head { padding: 22px 22px 8px !important; }
.modal-foot { padding: 16px 22px 22px !important; }
.modal-foot .btn { height: 46px; padding: 0 22px; }
/* Las hojas inferiores flotan: separadas 8 px de los bordes y con todas sus esquinas redondeadas */
.resumen-sheet, .hoja { width: calc(100% - 16px) !important; margin: 0 8px calc(8px + env(safe-area-inset-bottom)) !important; border-radius: 36px !important; max-height: calc(100dvh - 24px) !important; }
.resumen-sheet { padding-bottom: 22px !important; }
@media (max-width: 640px) {
  #panelComanda { left: 8px !important; right: 8px !important; bottom: calc(8px + env(safe-area-inset-bottom)) !important; width: auto !important; height: calc(100dvh - 56px) !important; border-radius: 36px !important; }
  body #panelComanda { transform: translateY(calc(100% + 40px)); }
  body #panelComanda.open { transform: none; }
  #modalOverlay { padding: 0 8px calc(8px + env(safe-area-inset-bottom)) !important; }
  .modal-box { border-radius: 36px !important; }
}
.tirador, .tirador-panel { width: 36px !important; height: 5px !important; background: rgba(60,60,67,.22) !important; }
.panel-footer, .hoja-pie { background: transparent !important; border-top: 0 !important; }
.panel-header { border-bottom: 0 !important; }

/* Tarjetas de vidrio */
.tarjeta { background: var(--vidrio-fuerte); -webkit-backdrop-filter: var(--desenfoque); backdrop-filter: var(--desenfoque); border: 1px solid var(--vidrio-borde); box-shadow: var(--sombra-2); }


/* ══════════════════════════════════════════════════════════════
   RENDIMIENTO (v1.5.2) — va al final y manda sobre lo anterior.
   · El desenfoque (backdrop-filter) obliga al teléfono a recalcular
     todo lo que hay detrás en cada cuadro: se deja solo en las barras
     superiores (pequeñas). Velos, hojas, modales y tarjetas sobre un
     fondo liso se ven igual con un fondo casi opaco, y vuelan.
   · Animaciones cortas (≈0,25–0,3 s), sin rebote en ventanas grandes.
   ══════════════════════════════════════════════════════════════ */
:root { --desenfoque: saturate(160%) blur(14px); --rapido: cubic-bezier(.2,.8,.2,1); }
body { animation: none !important; }

/* Velos oscuros: solo oscurecen */
.swal2-container.swal2-backdrop-show, #modalOverlay, #overlay, #velo, #modalResumen, #modalFicha {
  -webkit-backdrop-filter: none !important; backdrop-filter: none !important; background-color: rgba(16,18,24,.36) !important;
}
.swal2-container:not(.swal2-backdrop-show) { background: transparent !important; }
#modalOverlay, #overlay, #velo, #modalResumen, #modalFicha { transition: opacity .2s ease !important; }

/* Hojas, modales y diálogos: fondo casi opaco, sin desenfoque, en su propia capa */
.swal2-popup, .resumen-sheet, .hoja, #panelComanda, .modal-box {
  -webkit-backdrop-filter: none !important; backdrop-filter: none !important;
  background: #FAFAFC !important; will-change: transform; contain: layout paint;
}
.resumen-sheet, .hoja, .modal-box { transition: transform .3s var(--ease-sheet) !important; }
#panelComanda.open { transition: transform .3s var(--ease-sheet) !important; }
#panelComanda:not(.open) { transition: transform .26s var(--ease-sheet), visibility 0s .26s !important; }
@media (min-width: 641px) { .modal-box { transition: transform .24s var(--rapido) !important; } }

/* Diálogos (SweetAlert) */
.swal2-show { animation: dialogo-entra .24s var(--rapido) !important; }
.swal2-hide { animation: dialogo-sale .15s ease forwards !important; }
@media (max-width: 640px) {
  .swal2-show { animation: dialogo-sube .3s var(--ease-sheet) !important; }
  .swal2-hide { animation: dialogo-baja .2s ease forwards !important; }
}

/* Tarjetas y paneles sobre fondo liso: sin desenfoque */
.tarjeta, .card, .stat-card, .table-wrap, .plato-card, .kitchen-card, .prods, .grupo, .accion, .tabla-wrap, .acceso, .aviso {
  -webkit-backdrop-filter: none !important; backdrop-filter: none !important;
}
.tarjeta, .card, .stat-card, .table-wrap, .plato-card, .kitchen-card, .prods, .grupo, .accion, .tabla-wrap { background-color: rgba(255,255,255,.94) !important; }
.acceso { background-color: rgba(255,255,255,.95) !important; }
.aviso { background-color: rgba(28,28,30,.94) !important; animation-duration: .3s !important; }

/* Admin: menú lateral en el teléfono y cambio de sección */
@media (max-width: 960px) {
  #sidebar { -webkit-backdrop-filter: none !important; backdrop-filter: none !important; background: #FAFAFC !important; transition: transform .26s var(--ease-sheet) !important; will-change: transform; }
}
.module.active { animation: entrar-rapido .18s ease-out !important; }
@keyframes entrar-rapido { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* Garzón: barra flotante del pedido, más ágil y sin rebote largo */
#btnFlotante { transition: transform .3s var(--ease-sheet), visibility 0s .3s !important; }
#btnFlotante.visible { transition: transform .32s var(--rapido) !important; }

/* Botones: respuesta inmediata al toque */
.btn, button { touch-action: manipulation; }

/* ── Vigía de impresión: un aviso pequeño en la esquina, nunca tapa el trabajo ── */
.vigia { position: fixed; right: max(14px, env(safe-area-inset-right, 0px)); bottom: calc(14px + env(safe-area-inset-bottom, 0px)); z-index: 900; width: min(380px, calc(100% - 28px)); pointer-events: none; }
.vigia.arriba { bottom: auto; top: calc(8px + env(safe-area-inset-top, 0px)); left: 50%; right: auto; transform: translateX(-50%); }
.vigia-item { pointer-events: auto; display: flex; gap: 10px; align-items: flex-start; padding: 12px 12px 10px; border-radius: var(--r-md); background: var(--tinta); color: #fff; box-shadow: var(--sombra-3); animation: vigia-entra .25s ease-out; }
.vigia-item > svg { width: 18px; height: 18px; flex-shrink: 0; color: var(--rojo-neon); margin-top: 1px; }
.vigia-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.vigia-txt b { font-size: 13.5px; line-height: 1.3; }
.vigia-txt span { font-size: 12.5px; line-height: 1.35; color: rgba(255,255,255,.75); }
.vigia-acc { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-top: 6px; }
.vigia-acc button { font: inherit; font-size: 12px; font-weight: 600; padding: 5px 10px; border-radius: 999px; border: 0; cursor: pointer; background: rgba(255,255,255,.14); color: #fff; }
.vigia-acc button.pri { background: var(--rojo); }
.vigia-acc button:disabled { opacity: .5; }
.vigia-acc small { font-size: 11.5px; color: rgba(255,255,255,.6); margin-left: auto; }
@keyframes vigia-entra { from { transform: translateY(8px); opacity: 0; } }
body:has(#modalOverlay.show) .vigia, body.swal2-shown .vigia { display: none; }
body:has(#mod-impresoras.active) .vigia { display: none; }
