/* ============================================================
   ACEII · Cafetería
   Estilos globales
   Paleta unificada azul — POS moderno
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
  --fondo: #f4f6fa;
  --superficie: #ffffff;
  --superficie-2: #eef3fb;

  --texto: #182235;
  --texto-suave: #667085;
  --texto-claro: #98a2b3;

  /* ===== PALETA UNIFICADA AZUL ===== */
  --azul: #1E64F0;
  --azul-claro: #3B82F6;
  --azul-suave: #EFF6FF;
  --azul-borde: #DBEAFE;

  /* Acentos funcionales (solo cuando comunican) */
  --verde: #10B981;
  --exito: #10B981;
  --alerta: #DC2626;
  --aviso: #D97706;

  /* Neutros */
  --gris: #64748B;
  --gris-suave: #F1F5F9;

  --radio: 18px;
  --radio-sm: 12px;
  --padding: 16px;

  --sombra:
    0 1px 3px rgba(50, 72, 110, 0.04),
    0 6px 20px rgba(50, 72, 110, 0.06);

  --sombra-fuerte:
    0 8px 30px rgba(50, 72, 110, 0.12);

  --fuente:
    'Inter',
    -apple-system,
    BlinkMacSystemFont,
    'Segoe UI',
    sans-serif;
}


/* ============================================================
   TEMA OSCURO
   ============================================================ */

html.tema-oscuro {
  --fondo: #0F1621;
  --superficie: #192231;
  --superficie-2: #222d40;

  --texto: #edf2f7;
  --texto-suave: #aab5c5;
  --texto-claro: #748197;

  --azul: #60A5FA;
  --azul-claro: #93C5FD;
  --azul-suave: #1E3A8A;
  --azul-borde: #1E3A8A;

  --verde: #34D399;
  --exito: #34D399;
  --alerta: #F87171;
  --aviso: #FBBF24;

  --gris: #94A3B8;
  --gris-suave: #1E293B;

  --sombra:
    0 3px 12px rgba(0, 0, 0, 0.25),
    0 10px 30px rgba(0, 0, 0, 0.18);

  --sombra-fuerte:
    0 10px 35px rgba(0, 0, 0, 0.35);
}

@media (prefers-color-scheme: dark) {
  html.tema-auto {
    --fondo: #0F1621;
    --superficie: #192231;
    --superficie-2: #222d40;

    --texto: #edf2f7;
    --texto-suave: #aab5c5;
    --texto-claro: #748197;

    --azul: #60A5FA;
    --azul-claro: #93C5FD;
    --azul-suave: #1E3A8A;
    --azul-borde: #1E3A8A;

    --verde: #34D399;
    --exito: #34D399;
    --alerta: #F87171;
    --aviso: #FBBF24;

    --gris: #94A3B8;
    --gris-suave: #1E293B;

    --sombra:
      0 3px 12px rgba(0, 0, 0, 0.25),
      0 10px 30px rgba(0, 0, 0, 0.18);

    --sombra-fuerte:
      0 10px 35px rgba(0, 0, 0, 0.35);
  }
}


/* ============================================================
   RESET
   ============================================================ */

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--fuente);
  margin: 0;
  padding: 0;
  background: var(--fondo);
  color: var(--texto);
  font-size: 15px;
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  animation: fadeInBody 0.25s ease-out;
  transition: background 0.25s ease, color 0.25s ease;
}

@keyframes fadeInBody {
  from { opacity: 0; }
  to   { opacity: 1; }
}


/* ============================================================
   HEADER
   ============================================================ */

.app-header {
  position: relative;
  overflow: hidden;
  color: #ffffff;

  background:
    radial-gradient(
      circle at 90% 10%,
      rgba(255, 255, 255, 0.18),
      transparent 32%
    ),
    linear-gradient(
      135deg,
      #1E40AF 0%,
      #2563EB 55%,
      #3B82F6 100%
    );

  padding: 22px 20px 62px;
  border-radius: 0 0 30px 30px;
  box-shadow: 0 10px 30px rgba(37, 99, 235, 0.25);
  transition: background 0.25s ease, box-shadow 0.25s ease;
}

.app-header::before {
  content: '';
  position: absolute;
  width: 190px;
  height: 190px;
  right: -90px;
  top: -100px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.10);
  pointer-events: none;
}

.app-header::after {
  content: '';
  position: absolute;
  left: -10%;
  right: -10%;
  bottom: -31px;
  height: 64px;
  background: var(--fondo);
  border-radius: 50% 50% 0 0 / 100% 100% 0 0;
  transition: background 0.25s ease;
}

html.tema-oscuro .app-header {
  background:
    radial-gradient(
      circle at 90% 10%,
      rgba(255, 255, 255, 0.08),
      transparent 32%
    ),
    linear-gradient(
      135deg,
      #1E3A8A,
      #2563EB
    );
}

@media (prefers-color-scheme: dark) {
  html.tema-auto .app-header {
    background:
      radial-gradient(
        circle at 90% 10%,
        rgba(255, 255, 255, 0.08),
        transparent 32%
      ),
      linear-gradient(
        135deg,
        #1E3A8A,
        #2563EB
      );
  }
}

.app-header-contenido {
  position: relative;
  z-index: 2;
  max-width: 480px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 14px;
}

.app-header-logo {
  width: 54px;
  height: 54px;
  object-fit: contain;
  flex-shrink: 0;
  padding: 5px;
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.22);
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.18));
}

.app-header-texto { flex: 1; min-width: 0; }

.app-header-titulo {
  font-size: 30px;
  font-weight: 800;
  letter-spacing: 0.5px;
  line-height: 1.05;
}

.app-header-sub {
  margin-top: 4px;
  font-size: 13px;
  font-weight: 500;
  opacity: 0.85;
}


/* ============================================================
   BOTÓN DE TEMA
   ============================================================ */

.btn-tema {
  position: absolute;
  top: 18px;
  right: 18px;
  z-index: 5;
  width: 43px;
  height: 43px;
  padding: 0;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #ffffff;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
  font-size: 19px;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.2s ease;
}
.btn-tema:active { transform: scale(0.91); }
.btn-tema:hover { background: rgba(255, 255, 255, 0.28); }


/* ============================================================
   BARRA DE ESTADO
   ============================================================ */

#estado {
  max-width: 480px;
  margin: 8px auto 0;
  padding: 11px 15px;
  border-radius: 13px;
  background: var(--superficie);
  color: var(--texto-suave);
  font-weight: 500;
  font-size: 13px;
  text-align: center;
  box-shadow: 0 3px 12px rgba(50, 72, 110, 0.05);
  word-break: break-word;
  transition: background 0.2s, color 0.2s;
}

#estado.estado-vacio { display: none; }
#estado.ok, .estado-ok { background: var(--exito) !important; color: #fff !important; }
#estado.error, .estado-error { background: var(--alerta) !important; color: #fff !important; }
#estado.aviso, .estado-aviso { background: var(--aviso) !important; color: #fff !important; }


/* ============================================================
   CAJAS GENERALES
   ============================================================ */

.caja {
  max-width: 480px;
  margin: 12px auto;
  padding: 17px;
  background: var(--superficie);
  border-radius: var(--radio);
  color: var(--texto);
  box-shadow: var(--sombra);
  animation: aparecerCaja 0.3s ease-out;
  transition: background 0.2s ease, color 0.2s ease;
}

@keyframes aparecerCaja {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}


/* ============================================================
   PANEL DEL MENÚ
   ============================================================ */

.panel-menu {
  width: 100%;
  max-width: 480px;
  margin: 13px auto 24px;
  padding: 0 13px;
  background: transparent;
  animation: aparecerCaja 0.4s ease-out;
}

.grid-menu {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 11px;
}


/* ============================================================
   TARJETAS — Blancas y limpias (Sin círculos ni líneas)
   ============================================================ */

.card {
  position: relative;
  min-height: 128px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 13px;
  padding: 15px 14px 14px;

  /* Fondo blanco sólido y limpio */
  background: var(--superficie);
  background-image: none !important;

  color: var(--texto);
  text-decoration: none;
  border-radius: 18px;
  border: 1px solid rgba(92, 112, 150, 0.08);

  box-shadow:
    0 2px 5px rgba(50, 72, 110, 0.035),
    0 7px 18px rgba(50, 72, 110, 0.055);

  cursor: pointer;
  transition:
    transform 0.16s ease,
    box-shadow 0.18s ease,
    border-color 0.18s ease;
}

/* ===== EL DESTRUCTOR DE CÍRCULOS (Aplastado total) ===== */
.card::before, 
.card::after,
.panel-menu .card::before,
.panel-menu .card::after,
.grid-operacion-resto .card::before,
.grid-operacion-resto .card::after {
  content: none !important;
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  width: 0 !important;
  height: 0 !important;
  background: transparent !important;
  clip-path: polygon(0 0, 0 0, 0 0) !important;
}

/* Hover suave */
.card:hover {
  transform: translateY(-2px);
  box-shadow:
    0 6px 14px rgba(37, 99, 235, 0.08),
    0 14px 28px rgba(37, 99, 235, 0.10);
  border-color: rgba(37, 99, 235, 0.15);
}
.card:active { transform: scale(0.975); }


/* Tema oscuro */
html.tema-oscuro .card {
  background: var(--superficie) !important;
  border-color: rgba(255, 255, 255, 0.055);
  box-shadow:
    0 2px 7px rgba(0, 0, 0, 0.25),
    0 8px 20px rgba(0, 0, 0, 0.18);
}
@media (prefers-color-scheme: dark) {
  html.tema-auto .card {
    background: var(--superficie) !important;
    border-color: rgba(255, 255, 255, 0.055);
    box-shadow:
      0 2px 7px rgba(0, 0, 0, 0.25),
      0 8px 20px rgba(0, 0, 0, 0.18);
  }
}


/* ============================================================
   ANIMACIÓN DE TARJETAS
   ============================================================ */

.grid-menu .card {
  animation: entradaCard 0.4s ease-out backwards;
}
.grid-menu .card:nth-child(1)  { animation-delay: 0.02s; }
.grid-menu .card:nth-child(2)  { animation-delay: 0.05s; }
.grid-menu .card:nth-child(3)  { animation-delay: 0.08s; }
.grid-menu .card:nth-child(4)  { animation-delay: 0.11s; }
.grid-menu .card:nth-child(5)  { animation-delay: 0.14s; }
.grid-menu .card:nth-child(6)  { animation-delay: 0.17s; }
.grid-menu .card:nth-child(7)  { animation-delay: 0.20s; }
.grid-menu .card:nth-child(8)  { animation-delay: 0.23s; }
.grid-menu .card:nth-child(9)  { animation-delay: 0.26s; }
.grid-menu .card:nth-child(10) { animation-delay: 0.29s; }

@keyframes entradaCard {
  from { opacity: 0; transform: translateY(9px); }
  to   { opacity: 1; transform: translateY(0); }
}


/* ============================================================
   TARJETAS DESTACADAS (Caja y Ventas)
   ============================================================ */

.card.destacada {
  background:
    radial-gradient(
      circle at 20% 0%,
      #ffffff 0%,
      var(--azul-suave) 100%
    );

  border-color: var(--azul-borde);

  box-shadow:
    0 3px 8px rgba(37, 99, 235, 0.08),
    0 10px 23px rgba(37, 99, 235, 0.10);
}

html.tema-oscuro .card.destacada {
  background:
    radial-gradient(
      circle at 20% 0%,
      #1e2a3f 0%,
      #1a2540 100%
    );
  border-color: rgba(96, 165, 250, 0.20);
}

@media (prefers-color-scheme: dark) {
  html.tema-auto .card.destacada {
    background:
      radial-gradient(
        circle at 20% 0%,
        #1e2a3f 0%,
        #1a2540 100%
      );
    border-color: rgba(96, 165, 250, 0.20);
  }
}


/* ============================================================
   ICONOS — Todos azules, en círculo
   ============================================================ */

.card-icono {
  position: relative;
  z-index: 1;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}

.card:hover .card-icono { transform: translateY(-1px); }
.card:active .card-icono { transform: scale(1.05); }

.card-icono svg {
  width: 24px;
  height: 24px;
  fill: #ffffff;
  stroke: none;
}


/* ===== TODOS los iconos en azul corporativo ===== */

.card-icono.azul,
.card-icono.cyan,
.card-icono.morado,
.card-icono.coral,
.card-icono.verde,
.card-icono.amarillo,
.card-icono.gris,
.card-icono.violeta,
.card-icono.turquesa,
.card-icono.rosa {
  background: linear-gradient(145deg, #3B82F6 0%, #2563EB 100%);
  box-shadow: 0 6px 14px rgba(37, 99, 235, 0.32);
}


/* ===== Excepción: Cerrar sesión en rojo suave ===== */

.card.cerrar-sesion .card-icono,
.cerrar-sesion-box .cerrar-sesion-icono {
  background: linear-gradient(145deg, #F87171 0%, #DC2626 100%);
  box-shadow: 0 6px 14px rgba(220, 38, 38, 0.32);
}


/* ============================================================
   TÍTULO DE TARJETA
   ============================================================ */

.card-titulo {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-top: auto;
  color: var(--texto);
  font-size: 14px;
  font-weight: 650;
  line-height: 1.25;
  letter-spacing: -0.1px;
}

.card:hover .card-titulo::after {
  color: var(--azul);
  transform: translateX(2px);
}


/* ============================================================
   CERRAR SESIÓN
   ============================================================ */

.cerrar-sesion-box {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 18px auto 6px;
  padding: 11px 18px;
  max-width: 220px;
  color: var(--texto-suave);
  font-size: 13px;
  font-weight: 550;
  cursor: pointer;
  border-radius: 12px;
  transition:
    background 0.15s ease,
    color 0.15s ease,
    transform 0.15s ease;
}

.cerrar-sesion-box:hover {
  background: rgba(220, 38, 38, 0.10);
  color: var(--alerta);
}
.cerrar-sesion-box:active { transform: scale(0.97); }

.cerrar-sesion-icono {
  width: 18px;
  height: 18px;
  fill: currentColor;
  flex-shrink: 0;
}


/* ============================================================
   BOTONES GENERALES
   ============================================================ */

button {
  font-family: var(--fuente);
  font-size: 15px;
  font-weight: 600;
  padding: 12px 16px;
  border: none;
  border-radius: 12px;
  background: var(--superficie-2);
  color: var(--texto);
  cursor: pointer;
  margin: 4px 4px 4px 0;
  transition:
    transform 0.1s ease,
    background 0.15s ease,
    box-shadow 0.15s ease;
}

button:active:not(:disabled) { transform: scale(0.97); }

button.main {
  background: linear-gradient(135deg, var(--azul), var(--azul-claro));
  color: #fff;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.32);
}

button.main:active:not(:disabled) { background: var(--azul-claro); }

button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}


/* ============================================================
   INPUTS
   ============================================================ */

input[type=text],
input[type=password],
input[type=number],
input[type=range],
select,
textarea {
  width: 100%;
  padding: 12px 14px;
  margin: 6px 0;
  font-family: var(--fuente);
  font-size: 15px;
  border-radius: 12px;
  background: var(--superficie);
  color: var(--texto);
  border: 1.5px solid var(--azul-borde);
  box-sizing: border-box;
  transition:
    border-color 0.15s,
    background 0.15s,
    box-shadow 0.15s;
}

html.tema-oscuro input[type=text],
html.tema-oscuro input[type=password],
html.tema-oscuro input[type=number],
html.tema-oscuro input[type=range],
html.tema-oscuro select,
html.tema-oscuro textarea {
  background: var(--superficie-2);
  color: var(--texto);
  border-color: #303b50;
}

@media (prefers-color-scheme: dark) {
  html.tema-auto input[type=text],
  html.tema-auto input[type=password],
  html.tema-auto input[type=number],
  html.tema-auto input[type=range],
  html.tema-auto select,
  html.tema-auto textarea {
    background: var(--superficie-2);
    color: var(--texto);
    border-color: #303b50;
  }
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--azul);
  background: var(--superficie);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

html.tema-oscuro input:focus,
html.tema-oscuro select:focus,
html.tema-oscuro textarea:focus {
  background: var(--superficie-2);
  box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.25);
}


/* ============================================================
   FILAS / TOGGLES
   ============================================================ */

.fila { display: flex; gap: 8px; margin: 6px 0; }
.fila > * { flex: 1; }

.tog {
  flex: 1;
  margin: 0;
  background: var(--superficie-2);
  color: var(--texto-suave);
  border: 2px solid transparent;
  font-weight: 600;
}

.tog.on {
  background: var(--azul);
  color: #fff;
  border-color: var(--azul-claro);
}


/* ============================================================
   HEADERS INTERNOS
   ============================================================ */

.pantalla-header {
  max-width: 480px;
  margin: 0 auto;
  padding: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.pantalla-header a {
  color: var(--azul);
  text-decoration: none;
  font-weight: 600;
  font-size: 15px;
}

.pantalla-header .usuario {
  color: var(--azul);
  font-weight: 600;
  font-size: 13px;
}

a {
  color: var(--azul);
  text-decoration: none;
  transition: color 0.15s ease;
}


/* ============================================================
   OPCIONES
   ============================================================ */

a.op {
  display: block;
  padding: 14px;
  margin: 8px 0;
  border-radius: 12px;
  background: var(--azul);
  color: #fff;
  text-decoration: none;
  font-size: 16px;
  font-weight: 600;
  text-align: center;
}

a.op.off {
  background: var(--superficie-2);
  color: var(--texto-claro);
}


/* ============================================================
   LÍNEAS
   ============================================================ */

.linea {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid #e8edf5;
  font-size: 14px;
  transition: border-color 0.2s;
}

html.tema-oscuro .linea { border-bottom-color: #303b50; }
@media (prefers-color-scheme: dark) {
  html.tema-auto .linea { border-bottom-color: #303b50; }
}


/* ============================================================
   TOAST
   ============================================================ */


/* ===== TOAST ELEGANTE ===== */
#toastGlobal {
  position: fixed;
  bottom: 24px; /* Por defecto, pegado abajo (para Caja y Ventas) */
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: #1F2937;
  color: #fff;
  padding: 12px 20px;
  border-radius: 999px;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  z-index: 2000;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  opacity: 0;
  pointer-events: none;
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

#toastGlobal.visible {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* Colores según el tipo */
#toastGlobal.ok { background: #059669; }
#toastGlobal.error { background: #DC2626; }
#toastGlobal.aviso { background: #D97706; }

/* SOLO en pantallas que tengan la barra de navegación inferior, lo subimos */
body:has(.bottom-nav-bar-container) #toastGlobal {
  bottom: calc(var(--bottom-nav-height, 84px) + 20px);
}


/* ============================================================
   ANIMACIONES
   ============================================================ */

.resultado,
.prod-item,
.cat-item,
.turno,
.mov,
.item-carrito {
  animation: aparecerItem 0.25s ease-out backwards;
}

@keyframes aparecerItem {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}


/* ============================================================
   SPINNER
   ============================================================ */

.spinner-global {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: girarGlobal 0.7s linear infinite;
  vertical-align: middle;
  margin-right: 6px;
}

@keyframes girarGlobal {
  to { transform: rotate(360deg); }
}


/* ============================================================
   ESCRITORIO
   ============================================================ */

@media (min-width: 700px) {

  body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 28px 0;
    background:
      radial-gradient(
        circle at 15% 10%,
        #dbeafe 0,
        transparent 32%
      ),
      linear-gradient(135deg, #f2f5fa, #e9eef7);
  }

  html.tema-oscuro body {
    background:
      radial-gradient(
        circle at 15% 10%,
        #1e3a8a,
        transparent 32%
      ),
      linear-gradient(135deg, #101621, #192231);
  }

  @media (prefers-color-scheme: dark) {
    html.tema-auto body {
      background:
        radial-gradient(
          circle at 15% 10%,
          #1e3a8a,
          transparent 32%
        ),
        linear-gradient(135deg, #101621, #192231);
    }
  }

  .app-header {
    width: 100%;
    max-width: 640px;
    padding: 24px 28px 68px;
    border-radius: 26px;
  }
  .app-header::after { display: none; }
  .app-header-contenido { max-width: 100%; }
  .app-header-logo { width: 60px; height: 60px; }
  .app-header-titulo { font-size: 37px; }
  .app-header-sub { font-size: 14px; }

  .btn-tema {
    top: 23px;
    right: 25px;
    width: 46px;
    height: 46px;
  }

  #estado,
  .panel-menu,
  .caja {
    width: 100%;
    max-width: 640px;
    margin-left: auto;
    margin-right: auto;
  }

  #estado { margin-top: 12px; }
  .panel-menu { padding: 0; margin-top: 17px; }
  .grid-menu { gap: 14px; }

  .card {
    min-height: 140px;
    padding: 18px 17px 16px;
    border-radius: 19px;
  }
  .card.destacada { min-height: 150px; }
  .card-icono { width: 52px; height: 52px; }
  .card-icono svg { width: 26px; height: 26px; }
  .card-titulo { font-size: 15px; }
  .caja { padding: 24px; border-radius: 20px; }
}


/* ============================================================
   REDUCIR ANIMACIONES
   ============================================================ */

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

  /* =====================================================
     EL DESTRUCTOR DEL CÍRCULO GRIS (Esquina superior)
     ===================================================== */
  .panel-menu .card::before, 
  .panel-menu .card::after,
  .grid-operacion-resto .card::before,
  .grid-operacion-resto .card::after,
  .card-ventas-ancha::before,
  .card-ventas-ancha::after {
    content: "" !important;
    display: none !important; 
    visibility: hidden !important;
    opacity: 0 !important;
    width: 0 !important;
    height: 0 !important;
    background: transparent !important;
    clip-path: polygon(0 0, 0 0, 0 0) !important;
  }

  /* Aseguramos que las tarjetas tengan fondo blanco sólido */
  .panel-menu .card {
    background: var(--superficie) !important;
    background-image: none !important;
  }

  /* ===== TOAST: SPINNER E ICONOS ===== */
#toastGlobal.toast-global {
  transition:
    transform 0.3s cubic-bezier(0.16, 1, 0.3, 1),
    opacity 0.2s ease,
    background-color 0.2s ease;
}

#toastGlobal .toast-ico {
  display: inline-flex;
  flex-shrink: 0;
}

#toastGlobal .toast-spinner {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  border-radius: 50%;
  border: 2.5px solid rgba(255, 255, 255, 0.28);
  border-top-color: #fff;
  animation: toastGiro 0.7s linear infinite;
}

@keyframes toastGiro {
  to { transform: rotate(360deg); }
}

/* El "Cargando..." en píldora oscura tipo cristal */
#toastGlobal.toast-global.cargando {
  background: rgba(17, 24, 39, 0.92);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

/* ===== PULIDO DE LOGO Y TÍTULO ===== */
.app-header-logo {
  width: 58px;
  height: 58px;
  border-radius: 17px;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.28);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.25),
    0 6px 16px rgba(0, 0, 0, 0.20);
}
.app-header-titulo {
  letter-spacing: 1px;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.18);
}

.buscador-cam {
  overflow: hidden !important;
  white-space: nowrap !important;
  font-size: 0 !important; /* Oculta cualquier texto que haya quedado */
}

#estado {
  display: none !important;
}

/* Botón cámara: el SVG y sus trazos siempre visibles */
.buscador-cam svg {
  display: block !important;
  width: 24px !important;
  height: 24px !important;
  fill: none !important;
  stroke: currentColor !important;
  stroke-width: 2 !important;
  stroke-linecap: round !important;
  stroke-linejoin: round !important;
}
.buscador-cam svg * {
  display: inline !important;
}

/* ========================================= */
/* ===== FASE 2: TARJETAS Y CÁMARA LIMPIAS ===== */
/* ========================================= */

/* --- 1. BOTÓN CÁMARA --- */
.buscador-cam {
  position: absolute !important;
  right: 4px !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  width: 44px !important;
  height: 44px !important;
  padding: 0 !important;
  display: grid !important;
  place-items: center !important;
  background: var(--azul) !important;
  color: #fff !important;
  border: none !important;
  border-radius: 12px !important;
  cursor: pointer !important;
  font-size: 0 !important; /* Oculta el texto rebelde */
  overflow: hidden !important;
}
.buscador-cam:active { transform: translateY(-50%) scale(0.94) !important; }
.buscador-cam svg {
  display: block !important;
  width: 24px !important;
  height: 24px !important;
  fill: none !important;
  stroke: currentColor !important;
  stroke-width: 2 !important;
  stroke-linecap: round !important;
  stroke-linejoin: round !important;
}

/* --- 2. CUADRÍCULA DE PRODUCTOS --- */
#botonesRapidos {
  display: grid !important;
  grid-template-columns: repeat(3, 1fr) !important;
  gap: 8px !important;
}
@media (max-width: 359px) {
  #botonesRapidos { grid-template-columns: repeat(2, 1fr) !important; }
}

/* --- 3. TARJETA DEL PRODUCTO --- */
.btn-rapido {
  position: relative !important;
  background: var(--superficie) !important;
  border: 1.5px solid var(--azul-borde) !important;
  border-radius: 14px !important;
  padding: 8px !important;
  min-height: auto !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  text-align: center !important;
  box-shadow: 0 2px 6px rgba(50, 72, 110, 0.04) !important;
  touch-action: manipulation;
  transition: transform 120ms cubic-bezier(0.23, 1, 0.32, 1), opacity 150ms;
  overflow: visible !important;
}
.btn-rapido:active { transform: scale(0.97) !important; }

/* Eliminar la barra azul y el botón + para siempre */
.btn-rapido::before, .btn-rapido .plus { display: none !important; }

/* La foto (cuadrada perfecta y sin fondo gris) */
.btn-rapido .icono {
  width: 100% !important;
  height: auto !important;
  aspect-ratio: 1 / 1 !important;
  background: transparent !important;
  padding: 0 !important;
  display: grid !important;
  place-items: center !important;
  margin-bottom: 4px !important;
  border-radius: 0 !important;
}
.btn-rapido .icono img, 
.btn-rapido .icono svg {
  width: 100% !important;
  height: 100% !important;
  object-fit: contain !important;
  padding: 4px !important;
  box-sizing: border-box !important;
  filter: drop-shadow(0 4px 6px rgba(0,0,0,0.08));
}

/* Nombre y Precio */
.btn-rapido .nom {
  font-size: 12px !important;
  font-weight: 600 !important;
  color: var(--texto) !important;
  line-height: 1.2 !important;
  display: -webkit-box !important;
  -webkit-line-clamp: 2 !important;
  -webkit-box-orient: vertical !important;
  overflow: hidden !important;
  padding: 0 !important; 
  margin: 0 !important; 
  text-align: center !important;
}
.btn-rapido .pre {
  font-size: 13px !important;
  font-weight: 800 !important;
  color: var(--azul) !important;
  font-variant-numeric: tabular-nums !important;
  padding: 0 !important; 
  margin: 0 !important; 
  text-align: center !important;
}

/* Insignia azul de cantidad en el carrito */
.btn-rapido .badge-cantidad {
  position: absolute !important;
  top: -6px !important; 
  right: -6px !important;
  background: var(--azul) !important;
  color: #fff !important;
  font-size: 11px !important; 
  font-weight: 800 !important;
  width: 22px !important; 
  height: 22px !important;
  border-radius: 50% !important;
  display: grid !important; 
  place-items: center !important;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2) !important;
  border: 2px solid var(--superficie) !important;
  z-index: 10 !important;
  animation: badgePop 200ms cubic-bezier(0.23, 1, 0.32, 1);
}
@keyframes badgePop {
  0% { transform: scale(0); }
  80% { transform: scale(1.2); }
  100% { transform: scale(1); }
}

/* Estados de Stock (Agotado y Bajo) */
.btn-rapido.agotado { opacity: 0.5 !important; cursor: not-allowed !important; }
.btn-rapido.agotado:active { transform: none !important; }
.btn-rapido.agotado .pre { color: var(--texto-suave) !important; font-size: 11px !important; }

.btn-rapido.stock-bajo .nom::after {
  content: '' !important;
  display: inline-block !important;
  width: 6px !important; 
  height: 6px !important;
  background: var(--aviso) !important;
  border-radius: 50% !important;
  margin-left: 4px !important; 
  vertical-align: middle !important;
}

/* Modo Oscuro */
html.tema-oscuro .btn-rapido { border-color: #303b50 !important; }
html.tema-oscuro .btn-rapido .pre { color: var(--azul-claro) !important; }




/* ========================================== */
/* NUEVA CABECERA Y TARJETA FLOTANTE          */
/* ========================================== */

:root {
  --header-bg-start: #2563eb;
  --header-bg-end: #1e40af;
  --text-white: #ffffff;
  --text-white-85: rgba(255, 255, 255, 0.85);
  --text-white-70: rgba(255, 255, 255, 0.70);
  --text-gray: #6b7280;
  --text-dark: #1f2937;
  --green-pulse: #10b981;
}

.app-header {
  background: linear-gradient(135deg, var(--header-bg-start), var(--header-bg-end));
  padding: calc(env(safe-area-inset-top, 0px) + 16px) 16px 24px 16px;
  border-bottom-left-radius: 24px;
  border-bottom-right-radius: 24px;
  position: relative;
  overflow: hidden;
  animation: fadeSlideDown 240ms cubic-bezier(0.23, 1, 0.32, 1) forwards;
}



.header-content {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  position: relative;
  z-index: 2;
}

.header-logo {
  width: 56px; height: 56px;
  background: #ffffff;
  border-radius: 16px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  flex-shrink: 0;
  margin-top: 4px;
  overflow: hidden;
}
.header-logo img { width: 100%; height: 100%; object-fit: contain; }

.header-titles {
  flex-grow: 1;
  display: flex; flex-direction: column; gap: 2px;
}

.greeting {
  font-size: 13px; color: var(--text-white-85); font-weight: 500;
  display: flex; align-items: center; gap: 4px;
}
.ico-mano { width: 14px; height: 14px; color: #fbbf24; }

.main-title {
  font-size: 26px; font-weight: 800; color: var(--text-white);
  margin: 0; line-height: 1.1; letter-spacing: -0.5px;
}
.subtitle { font-size: 13px; color: var(--text-white-85); font-weight: 400; margin-bottom: 2px; }
.motivational-phrase {
  font-size: 12px; color: var(--text-white-70); margin: 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%;
}

/* ========================================== */
/* BOTÓN DE TEMA CON ANIMACIÓN                */
/* ========================================== */
/* ========================================== */
/* BOTÓN DE TEMA CON ANIMACIÓN VISIBLE        */
/* ========================================== */
.theme-toggle {
  width: 44px; height: 44px;
  border-radius: 50%;
  padding: 0; border: none; background: transparent;
  cursor: pointer; flex-shrink: 0; margin-top: 2px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  transition: transform 0.2s ease;
}
.theme-toggle:active { transform: scale(0.94); }
.theme-svg { width: 100%; height: 100%; display: block; }

/* Colores y Transiciones (Claro) */
.theme-bg { fill: #60A5FA; transition: fill 0.4s ease; }
.theme-sun { 
  fill: #FBBF24; 
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1); /* Efecto rebote */
  transform-origin: center; 
}
.theme-moon { 
  fill: #E2E8F0; 
  opacity: 0; 
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1); 
  transform-origin: center; 
  transform: translateY(30px) rotate(-45deg) scale(0.5); /* Empieza abajo y girada */
}
.theme-cloud-front { fill: #9CD0FE; transition: all 0.4s ease; transform-origin: bottom; }
.theme-cloud-back { fill: #7AB8F5; transition: all 0.4s ease; transform-origin: bottom; }

/* Colores y Transiciones (Oscuro) - Se activa con la clase .is-dark */
.theme-toggle.is-dark .theme-bg { fill: #1E3A8A; }
.theme-toggle.is-dark .theme-sun { 
  opacity: 0; 
  transform: translateY(-30px) rotate(45deg) scale(0.5); /* El sol sube y se va */
}
.theme-toggle.is-dark .theme-moon { 
  opacity: 1; 
  transform: translateY(0) rotate(0deg) scale(1); /* La luna baja y se centra */
}
.theme-toggle.is-dark .theme-cloud-front { fill: #3B82F6; transform: translateY(4px); }
.theme-toggle.is-dark .theme-cloud-back { fill: #2563EB; transform: translateY(2px); }
/* Colores y Transiciones (Oscuro) - Se activa con la clase .is-dark */
.theme-toggle.is-dark .theme-bg { fill: #1E3A8A; }
.theme-toggle.is-dark .theme-sun { opacity: 0; transform: translateY(-20px) scale(0.5); }
.theme-toggle.is-dark .theme-moon { opacity: 1; transform: translateY(0) scale(1); }
.theme-toggle.is-dark .theme-cloud-front { fill: #3B82F6; transform: translateY(4px); }
.theme-toggle.is-dark .theme-cloud-back { fill: #2563EB; transform: translateY(2px); }

/* ========================================== */
/* TARJETA FLOTANTE                           */
/* ========================================== */
.status-card-wrapper {
  padding: 0 16px;
  margin-top: -28px;
  position: relative; z-index: 10;
  animation: fadeSlideUp 240ms cubic-bezier(0.23, 1, 0.32, 1) 60ms forwards;
  opacity: 0;
}

.status-card {
  background: #ffffff;
  border-radius: 20px;
  padding: 16px;
  display: flex; align-items: center; justify-content: space-between;
  box-shadow: 0 8px 24px rgba(11, 42, 111, 0.12);
}
html.tema-oscuro .status-card { background: #121D3A; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4); }

.status-col { display: flex; flex-direction: column; gap: 4px; flex: 1; text-align: center; }
.status-col:first-child { text-align: left; }
.status-col:last-child { text-align: right; }

.status-label { font-size: 11px; color: var(--text-gray); font-weight: 500; text-transform: uppercase; letter-spacing: 0.5px; }
html.tema-oscuro .status-label { color: #9AA8CC; }

.status-value { font-size: 16px; font-weight: 700; color: var(--text-dark); display: flex; align-items: center; gap: 6px; }
html.tema-oscuro .status-value { color: #F1F5FF; }
.status-col:first-child .status-value { justify-content: flex-start; }
.status-col:last-child .status-value { justify-content: flex-end; }

.tabular { font-variant-numeric: tabular-nums; letter-spacing: -0.3px; }
.status-divider { width: 1px; height: 32px; background: #e5e7eb; margin: 0 8px; }
html.tema-oscuro .status-divider { background: #223156; }

.pulse-dot { width: 8px; height: 8px; background-color: var(--green-pulse); border-radius: 50%; display: inline-block; animation: pulseGreen 2s infinite; }
@keyframes pulseGreen { 0% { opacity: 1; } 50% { opacity: 0.4; } 100% { opacity: 1; } }

@keyframes fadeSlideDown { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeSlideUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

@media (hover: hover) and (pointer: fine) {
  .theme-toggle:hover { transform: scale(1.05); }
}
@media (prefers-reduced-motion: reduce) {
  .app-header, .status-card-wrapper, .pulse-dot, .theme-sun, .theme-moon, .theme-cloud-front, .theme-cloud-back { animation: none !important; transition: none !important; }
}

/* ===== INICIO (index.html): header + status card. Solo afecta al index ===== */
body.pagina-inicio { --card-overlap: 28px; }

body.pagina-inicio .app-header {
  padding: calc(env(safe-area-inset-top, 0px) + 16px) 16px calc(var(--card-overlap) + 28px);
  background:
  radial-gradient(circle at 90% 10%, rgba(255,255,255,0.18), transparent 32%),
  radial-gradient(circle at 8% 100%, rgba(255,255,255,0.10), transparent 40%),
  linear-gradient(135deg, #1E40AF 0%, #2563EB 55%, #3B82F6 100%) !important;
  border-radius: 0 0 24px 24px;
  overflow: hidden;
}

body.pagina-inicio .app-header::after {
  content: '' !important;
  display: block !important;
  position: absolute !important;
  left: -30px !important;
  right: auto !important;
  top: auto !important;
  bottom: -50px !important;
  width: 120px !important;
  height: 120px !important;
  border-radius: 50% !important;
  background: rgba(255, 255, 255, 0.07) !important;
  pointer-events: none !important;
}

body.pagina-inicio .header-titles { min-width: 0; }
body.pagina-inicio .motivational-phrase {
  margin: 4px 0 0;
  line-height: 1.35;
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
}

body.pagina-inicio .wave-emoji {
  display: inline-block;
  line-height: 1;
  vertical-align: middle;
  transform-origin: 70% 70%;
  animation: wave 1.5s ease-in-out 2;
}
@keyframes wave {
  0%, 100% { transform: rotate(0); }
  20%, 60% { transform: rotate(15deg); }
  40%, 80% { transform: rotate(-10deg); }
}

body.pagina-inicio .theme-toggle { margin-top: 0; border: 1px solid rgba(255, 255, 255, 0.25); }
body.pagina-inicio .theme-sun,
body.pagina-inicio .theme-moon { transform-origin: 50px 45px; }

body.pagina-inicio .status-card-wrapper {
  margin: calc(var(--card-overlap) * -1) 0 24px;
}
body.pagina-inicio .status-card {
  display: grid;
  grid-template-columns: 1fr 1px 1fr 1px 1fr;
  align-items: center;
  width: 100%;
  height: 88px;
  padding: 0 8px;
  box-sizing: border-box;
  background: var(--superficie);
  border: 1px solid var(--ac-borde);
  border-radius: 24px;
  box-shadow: 0 10px 30px rgba(20, 60, 200, 0.15);
}
body.pagina-inicio .status-col {
  min-width: 0;
  padding: 0 2px;
  gap: 0;
  align-items: center;
  justify-content: center;
  text-align: center;
}
body.pagina-inicio .status-label {
  margin-bottom: 4px;
  font-size: 10px;
  letter-spacing: 0;
  white-space: nowrap;
  color: var(--ac-texto-suave);
}
body.pagina-inicio .status-col .status-value {
  justify-content: center;
  gap: 4px;
  font-size: 15px;
  white-space: nowrap;
  color: var(--ac-texto);
}
body.pagina-inicio .status-divider {
  height: 40px;
  margin: 0 auto;
  background: var(--ac-borde);
}

.ico-admin-usuarios svg {
  fill: none !important;
  stroke: #7C3AED !important;
  stroke-width: 2.2 !important;
  stroke-linecap: round !important;
  stroke-linejoin: round !important;
  filter: none !important;
}
html.tema-oscuro .ico-admin-usuarios svg {
  stroke: #A78BFA !important;
}

/* =======================================================
   HEADER INICIO: TAMAÑOS Y BOTÓN DE TEMA (CONSOLIDADO)
   ======================================================= */

body.pagina-inicio .header-logo {
  width: 64px !important;
  height: 64px !important;
  border-radius: 18px !important;
}

/* 1. Estructura del Botón de Tema (Tamaño y Alineación) */
body.pagina-inicio .theme-toggle {
  width: 46px !important;
  height: 46px !important;
  margin-top: 0 !important; 
  border: 2px solid rgba(255, 255, 255, 0.8) !important;
  box-shadow: 0 4px 10px rgba(15, 23, 42, 0.25) !important;
  background: transparent !important; 
}

/* 2. Colores del Botón (MODO CLARO) */
body.pagina-inicio .theme-toggle .theme-bg { 
  fill: #8EC5FF !important; /* Azul clarito */
}
body.pagina-inicio .theme-toggle .theme-cloud-front { 
  fill: #F2F8FF !important; /* Nube blanca */
}
body.pagina-inicio .theme-toggle .theme-cloud-back { 
  fill: #C9E3FF !important; /* Nube azul pálido */
}

/* 3. Colores del Botón (MODO OSCURO) */
body.pagina-inicio .theme-toggle.is-dark {
  border-color: rgba(255, 255, 255, 0.35) !important; /* Aro más sutil */
}
body.pagina-inicio .theme-toggle.is-dark .theme-bg { 
  fill: #0F172A !important; /* Fondo azul noche profundo */
}
body.pagina-inicio .theme-toggle.is-dark .theme-cloud-front { 
  fill: #1E3A8A !important; /* Nube oscura */
}
body.pagina-inicio .theme-toggle.is-dark .theme-cloud-back { 
  fill: #2563EB !important; /* Nube azul medio */
}

/* 4. Círculos decorativos del Header */
body.pagina-inicio .app-header::before {
  width: 180px !important;
  height: 180px !important;
  top: -90px !important;
  right: -75px !important;
}

body.pagina-inicio .app-header::after {
  width: 100px !important;
  height: 100px !important;
  left: -35px !important;
  bottom: -45px !important;
}

/* ============================================================
   HEADER UNIVERSAL DEFINITIVO (Premium SaaS Style)
   ============================================================ */

:root {
  --header-pad-top: calc(env(safe-area-inset-top, 0px) + 16px);
  --header-pad-bottom: 56px;
  --insignia-size: 64px; /* Logo más grande */
}

/* 1. Fondo, Gradiente y Curva del Header */
.app-header-universal {
  position: relative;
  overflow: hidden;
  color: #ffffff;
  
  /* Gradiente con dos puntos de luz (Premium) */
  background: 
    radial-gradient(circle at 10% 20%, rgba(255, 255, 255, 0.15), transparent 40%),
    radial-gradient(circle at 90% 80%, rgba(255, 255, 255, 0.1), transparent 40%),
    linear-gradient(135deg, #1E40AF 0%, #2563EB 50%, #3B82F6 100%) !important;
    
  padding: var(--header-pad-top) 20px var(--header-pad-bottom);
  border-radius: 0 0 30px 30px;
  box-shadow: 0 10px 30px rgba(30, 64, 175, 0.3);
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}

/* Círculo decorativo superior derecho */
.app-header-universal::before {
  content: '';
  position: absolute;
  width: 190px;
  height: 190px;
  right: -60px;
  top: -100px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  pointer-events: none;
}

/* Curva inferior para fusionar con el fondo gris */
.app-header-universal::after {
  content: '';
  position: absolute;
  left: -10%;
  right: -10%;
  bottom: -20px;
  height: 48px;
  background: var(--bg-main, var(--fondo));
  border-radius: 50% 50% 0 0 / 100% 100% 0 0;
  pointer-events: none;
}

/* 2. Contenedor Flex */
.header-contenido {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 16px;
  max-width: 480px;
  margin: 0 auto;
}

/* 3. Botón de Volver (Más grande y visible) */
.header-btn-volver {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2) !important;
  border: 1px solid rgba(255, 255, 255, 0.3) !important;
  backdrop-filter: blur(8px);
  color: #fff;
  text-decoration: none;
  transition: transform 120ms cubic-bezier(0.23, 1, 0.32, 1);
  flex-shrink: 0;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}
.header-btn-volver:active { transform: scale(0.95); }
.header-btn-volver svg {
  width: 26px;
  height: 26px;
  transform: translateX(-2px);
}

/* 4. Título Principal */
.header-textos {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.header-titulo {
  font-size: 30px !important;
  font-weight: 800;
  line-height: 1.2;
  margin: 0;
  letter-spacing: -0.5px;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

/* 5. Chip "En Línea" (Glassmorphism) */
.header-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.12) !important;
  border: 1px solid rgba(255, 255, 255, 0.3) !important;
  -webkit-backdrop-filter: blur(16px) !important;
  backdrop-filter: blur(16px) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3), 0 4px 12px rgba(0, 0, 0, 0.1) !important;
  padding: 6px 14px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.95);
  margin-top: 8px;
  max-width: max-content;
}
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: #10B981;
  box-shadow: 0 0 6px rgba(16, 185, 129, 0.6);
  flex-shrink: 0;
  animation: pulse-dot 2s cubic-bezier(0.23, 1, 0.32, 1) infinite;
}
@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* 6. Insignia del Centro (Logo 64px) */
.header-con-insignia {
  position: relative;
  padding-right: calc(var(--insignia-size) + 16px);
}

.header-insignia {
  position: absolute;
  top: 50%;
  right: 0;
  transform: translateY(-50%);
  width: var(--insignia-size);
  height: var(--insignia-size);
  background: #ffffff;
  border-radius: 18px;
  padding: 5px;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.25), inset 0 2px 4px rgba(255, 255, 255, 1);
  border: 1px solid rgba(255, 255, 255, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  overflow: hidden;
  animation: insigniaEntrada 200ms cubic-bezier(0.23, 1, 0.32, 1) both;
}

@keyframes insigniaEntrada {
  from { opacity: 0; transform: translateY(-50%) translateY(4px); }
  to   { opacity: 1; transform: translateY(-50%) translateY(0); }
}

.header-insignia img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.header-insignia .insignia-fallback {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #3B82F6, #1E64F0);
  color: #fff;
  font-size: 22px;
  font-weight: 800;
  border-radius: 13px;
  letter-spacing: -0.5px;
}
.insignia-fallback svg {
  width: 60%;
  height: 60%;
  fill: none;
  stroke: #fff;
  stroke-width: 2;
}

.header-insignia.oculta { display: none; }

/* Chip del turno formato */
.chip-id-num {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 160px;
}

