@import url('./inter-local.css');

/* temas */
/* TEMA DÍA*/
:root {
    --bg-fondo: #eef2f6; 
    --bg-tarjeta: rgba(255, 255, 255, 0.75);
    --texto-primario: #1e293b;
    --texto-secundario: #64748b;
    
    --glass-border: 1px solid rgba(255, 255, 255, 0.8);
    --neumo-shadow-raised: 8px 8px 20px rgba(166, 180, 200, 0.4), -8px -8px 20px rgba(255, 255, 255, 0.9);
    --neumo-shadow-recessed: inset 4px 4px 10px rgba(166, 180, 200, 0.3), inset -4px -4px 10px rgba(255, 255, 255, 0.8);
    --vantage-soft-shadow-hover: 12px 12px 25px rgba(166, 180, 200, 0.5), -12px -12px 25px rgba(255, 255, 255, 1);
    
    --accent-color: #10B981;
    --accent-hover: #059669;
    --accent-text: #ffffff;
    --bg-input: rgba(255, 255, 255, 0.5);
    --border-input: 1px solid rgba(0, 0, 0, 0.1);
    --panel-bg: #ffffff;
    --bg-fila: rgba(0, 0, 0, 0.03);
    --border-color-light: rgba(0, 0, 0, 0.09);
    
    --vantage-black: #0f172a;
    --vantage-white: #ffffff;
    --vantage-navy: #1e1b4b;
    --bg-panel-historial: rgba(241, 245, 249, 0.85);

    --radio-apple: 20px;
    --radio-pequeno: 12px;
    --transicion-apple: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* TEMA NOCHE */
body.modo-noche {
    --bg-fondo: linear-gradient(180deg, #0A1128 0%, #000000 100%);
    --bg-tarjeta: rgba(255, 255, 255, 0.02);
    --texto-primario: #FFFFFF;
    --texto-secundario: #A0A0A0;
    
    --glass-border: 1px solid rgba(16, 239, 207, 0.25);
    --neumo-shadow-raised: 0 4px 20px rgba(0, 0, 0, 0.5);
    --neumo-shadow-recessed: inset 0 2px 5px rgba(0, 0, 0, 0.5);
    --vantage-soft-shadow-hover: 0 6px 20px rgba(16, 239, 207, 0.15);
    
    --accent-color: #10EFCF;
    --accent-hover: #0DDEBF;
    --accent-text: #000000;
    --bg-input: rgba(255, 255, 255, 0.05);
    --border-input: 1px solid rgba(255, 255, 255, 0.1);
    --panel-bg: #111827;
    --bg-fila: rgba(255, 255, 255, 0.04);
    --border-color-light: rgba(255, 255, 255, 0.08);
    
    --vantage-black: #ffffff; 
    --vantage-white: #0f172a;
    --vantage-navy: #10EFCF;
    --bg-panel-historial: rgba(15, 23, 42, 0.85);
}

/* Corrección global: texto negro sobre botones accent en modo noche */
body.modo-noche [style*="background:var(--accent-color)"],
body.modo-noche [style*="background: var(--accent-color)"] {
    color: var(--accent-text) !important;
}

/* base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

body {
    background: var(--bg-fondo);
    background-attachment: fixed;
    color: var(--texto-primario);
    min-height: 100vh;
    padding: 2.5rem;
    transition: var(--transicion-apple);
}

/* headers */
.kds-header, .tarjeta-comanda, .tarjeta-kpi, .scoreboard-panel, .categoria-bloque, .item-menu, .ticket-item, .glass-panel {
    background: var(--bg-tarjeta);
    border: var(--glass-border);
    box-shadow: var(--neumo-shadow-raised);
    color: var(--texto-primario);
    backdrop-filter: blur(14px); 
    -webkit-backdrop-filter: blur(14px);
    transition: var(--transicion-apple);
}

.kds-header {
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    border-radius: var(--radio-apple);
    padding: 1rem 2rem;
    margin-bottom: 1rem; 
}

.tarjeta-comanda, .tarjeta-kpi {
    border-radius: var(--radio-apple);
    padding: 2.5rem;
    display: flex;
    flex-direction: column;
}

.tarjeta-kpi { padding: 2rem; text-align: center; }

.kds-header:hover, .tarjeta-comanda:hover, .tarjeta-kpi:hover, .item-menu:hover, .glass-panel:hover {
    transform: translateY(-5px);
    box-shadow: var(--vantage-soft-shadow-hover);
    border-color: rgba(16, 239, 207, 0.3); /* Brillo en hover modo noche, sutil en dia */
}

body.modo-dia .tarjeta-comanda:hover, body.modo-dia .tarjeta-kpi:hover {
    border-color: rgba(255, 255, 255, 1);
}

.kds-header h1 { font-size: 1.6rem; font-weight: 700; letter-spacing: -0.6px; }
.panel-header h2, .tarjeta-kpi h3, .score-label { color: var(--texto-secundario); }


#kpi-ventas, .score-value, .cantidad-derecha, #cobro-division, body.modo-noche .item-historial div strong { 
    color: var(--accent-color); 
    font-weight: 800;
}
body.modo-noche #kpi-ventas, body.modo-noche .score-value, body.modo-noche .cantidad-derecha {
    font-family: 'Roboto Mono', monospace;
    text-shadow: 0 0 10px rgba(16, 239, 207, 0.2);
}

#kpi-alertas { color: #ef4444; }
#kpi-movimientos { color: #3b82f6; }


.buscador-apple, .input-notas, .input-vantage, .select-vantage {
    background: var(--bg-input);
    border: var(--border-input);
    color: var(--texto-primario);
    border-radius: 12px;
    padding: 12px 15px;
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    outline: none;
    box-shadow: var(--neumo-shadow-recessed);
    transition: var(--transicion-apple);
}

.buscador-apple:focus, .input-notas:focus, .input-vantage:focus, .select-vantage:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.2), var(--neumo-shadow-recessed);
}

/* Force dark native rendering for selects in dark mode */
.modo-noche select {
    color-scheme: dark;
    background-color: #1e293b;
    color: var(--texto-primario);
}

.btn-secundario, .btn-revertir, .btn-pildora, .btn-icono-vantage {
    background: var(--bg-input);
    color: var(--texto-primario);
    border: var(--border-input);
    padding: 0.7rem 1.4rem;
    border-radius: 30px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    box-shadow: var(--neumo-shadow-raised);
    transition: var(--transicion-apple);
    backdrop-filter: blur(10px);
}

.btn-secundario:hover {
    transform: translateY(-2px);
    background: var(--bg-tarjeta);
    box-shadow: var(--vantage-soft-shadow-hover);
}

.btn-marcar-listo, .btn-enviar, .btn-cobrar, .btn-guardar-vantage {
    background: var(--accent-color);
    color: var(--accent-text);
    font-weight: 800;
    border: none;
    cursor: pointer;
    border-radius: 50px;
    padding: 1rem 2rem;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.btn-marcar-listo:hover, .btn-enviar:hover, .btn-cobrar:hover, .btn-guardar-vantage:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.3);
}

/* tablas */
.vantage-table { width: 100%; border-collapse: collapse; text-align: left; }
.vantage-table th { padding: 1rem; color: var(--texto-secundario); border-bottom: 2px solid rgba(0,0,0,0.05); }
.vantage-table td { border-bottom: 1px solid rgba(0,0,0,0.05); padding: 1rem; color: var(--texto-primario); }
body.modo-noche .vantage-table th, body.modo-noche .vantage-table td { border-bottom: 1px solid rgba(255,255,255,0.05); }

.item-stock, .item-fila {
    display: flex; justify-content: space-between; align-items: center;
    padding: 0.8rem 1.2rem;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    color: var(--texto-primario);
    transition: all 0.3s ease;
}
body.modo-noche .item-stock, body.modo-noche .item-fila { border-bottom: 1px solid rgba(255,255,255,0.05); }

.item-historial {
    background: var(--bg-input);
    padding: 1.5rem;
    border-radius: var(--radio-pequeno);
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 0.75rem;
    border: var(--border-input);
    box-shadow: var(--neumo-shadow-recessed);
    transition: var(--transicion-apple);
}

/* ellie */
/* ── Botón Ellie en header gerencia ── */
.btn-eli-premium {
    text-decoration: none;
    display: flex; align-items: center; gap: 10px;
    padding: 7px 16px 7px 8px;
    border-radius: 50px;
    background: rgba(139, 92, 246, 0.12);
    border: 1px solid rgba(139, 92, 246, 0.35);
    transition: background 0.25s, border-color 0.25s, box-shadow 0.25s, transform 0.15s;
    position: relative; overflow: hidden;
    box-shadow: 0 0 0 0 rgba(139, 92, 246, 0);
}
.btn-eli-premium::before {
    content: '';
    position: absolute; inset: 0; border-radius: 50px;
    background: linear-gradient(135deg, rgba(139,92,246,0.15) 0%, rgba(16,239,207,0.08) 100%);
    opacity: 0; transition: opacity 0.3s;
}
.btn-eli-premium:hover {
    background: rgba(139, 92, 246, 0.2);
    border-color: rgba(139, 92, 246, 0.6);
    box-shadow: 0 0 18px rgba(139, 92, 246, 0.35), 0 0 40px rgba(16, 239, 207, 0.1);
    transform: translateY(-1px);
}
.btn-eli-premium:hover::before { opacity: 1; }

.eli-avatar-ring {
    width: 36px; height: 36px; border-radius: 50%;
    flex-shrink: 0; position: relative;
    display: flex; align-items: center; justify-content: center;
}
.eli-avatar-ring::before {
    content: '';
    position: absolute; inset: -2px; border-radius: 50%;
    border: 1.5px solid transparent;
    border-top-color: #a78bfa;
    border-right-color: rgba(16, 239, 207, 0.6);
    animation: eli-ring-spin 2.5s linear infinite;
}
.eli-avatar-inner {
    width: 34px; height: 34px; border-radius: 50%;
    background: rgba(13, 8, 32, 0.85);
    display: flex; align-items: center; justify-content: center;
    overflow: hidden; position: relative; z-index: 1;
}
@keyframes eli-ring-spin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

.eli-avatar-container { width: 45px; height: 45px; border-radius: 50%; position: relative; overflow: hidden; border: 1px solid rgba(255, 255, 255, 0.2); transition: 0.3s; }
.eli-icon { width: 100%; height: 100%; object-fit: contain; }

.eli-text-wrapper {
    display: flex; flex-direction: column; gap: 1px;
    position: relative; overflow: hidden; height: 32px;
}
.eli-text-wrapper .eli-label {
    font-size: 0.68rem; font-weight: 700; letter-spacing: 0.08em;
    text-transform: uppercase; color: #a78bfa; line-height: 1;
}
.eli-text-wrapper .eli-main {
    font-size: 0.88rem; font-weight: 700;
    color: rgba(255,255,255,0.92); line-height: 1.2;
    white-space: nowrap;
    transition: transform 0.3s cubic-bezier(0.4,0,0.2,1), opacity 0.3s;
}
.eli-text-wrapper .eli-sub {
    font-size: 0.78rem; font-weight: 500;
    color: #10efcf; line-height: 1.2;
    white-space: nowrap;
    position: absolute; bottom: 0; left: 0;
    transform: translateY(100%); opacity: 0;
    transition: transform 0.3s cubic-bezier(0.4,0,0.2,1), opacity 0.3s;
}
.btn-eli-premium:hover .eli-main { transform: translateY(-100%); opacity: 0; }
.btn-eli-premium:hover .eli-sub  { transform: translateY(0); opacity: 1; }

/* legado — mantiene compatibilidad con código viejo */
.eli-text-wrapper span { font-size: 0.9rem; font-weight: 700; color: rgba(255,255,255,0.9); transition: 0.3s; }
.hover-text { opacity: 0; position: absolute; top: 0; left: 0; visibility: hidden; color: #a78bfa !important; }
.btn-eli-premium:hover .default-text { opacity: 0; visibility: hidden; }
.btn-eli-premium:hover .hover-text  { opacity: 1; visibility: visible; }

@keyframes gradient-shift { 0% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } 100% { background-position: 0% 50%; } }

/* modales */
.modal-overlay {
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(5px);
}
body.modo-noche .modal-overlay { background: rgba(0, 0, 0, 0.7); backdrop-filter: blur(10px); }

.modal-content, .modal-contenido-vantage {
    background: var(--bg-fondo);
    border: var(--glass-border);
    box-shadow: var(--neumo-shadow-raised);
    color: var(--texto-primario);
    border-radius: var(--radio-apple);
    padding: 25px;
}

#vantage-toast-container { position: fixed; top: 20px; right: 20px; z-index: 999999; display: flex; flex-direction: column; gap: 15px; pointer-events: none; }
.vantage-toast {
    background: linear-gradient(145deg, rgba(10, 17, 40, 0.95) 0%, rgba(0, 0, 0, 0.98) 100%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    color: #FFFFFF; border-radius: 14px; padding: 18px 24px; display: flex; align-items: center; gap: 18px; position: relative; overflow: hidden;
    animation: slideInRight 0.4s forwards;
}

.logo-vantage { height: 26px; width: auto; object-fit: contain; transition: filter 0.4s ease; }
body.modo-dia .logo-vantage { filter: invert(1) brightness(0.2); }

.badge { padding: 6px 14px; border-radius: 20px; font-size: 0.75rem; font-weight: 700; white-space: normal; word-break: break-word; text-align: center; max-width: 110px; display: inline-block; line-height: 1.3; }
.kpi-grid, .main-grid { display: grid; gap: 1.5rem; margin-bottom: 2rem; }
.kpi-grid { grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }

.segmented-control { background: var(--bg-input); border-radius: 10px; padding: 4px; box-shadow: var(--neumo-shadow-recessed); display: flex; }
.segmented-control input[type="radio"] { display: none; }
.segmented-control label { padding: 6px 18px; font-size: 0.85rem; font-weight: 600; color: var(--texto-secundario); cursor: pointer; border-radius: 8px; transition: 0.3s; }
.segmented-control input[type="radio"]:checked + label { background: var(--bg-tarjeta); color: var(--texto-primario); box-shadow: var(--neumo-shadow-raised); }

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(100, 116, 139, 0.3); border-radius: 10px; }
body.modo-noche ::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.15); }

@keyframes pulsoVantage {
    0% { box-shadow: 0 0 10px rgba(16, 239, 207, 0.2), inset 0 0 5px rgba(16, 239, 207, 0.1); }
    50% { box-shadow: 0 0 25px rgba(16, 239, 207, 0.6), inset 0 0 15px rgba(16, 239, 207, 0.3); }
    100% { box-shadow: 0 0 10px rgba(16, 239, 207, 0.2), inset 0 0 5px rgba(16, 239, 207, 0.1); }
}
body.modo-noche .mesa-btn.mesa-activa { animation: pulsoVantage 2s infinite ease-in-out; }

@keyframes deslizarArriba { 0% { opacity: 0; transform: translateY(20px); } 100% { opacity: 1; transform: translateY(0); } }
body.modo-noche .item-menu, body.modo-noche .mesa-btn { animation: deslizarArriba 0.4s forwards; }

@keyframes deslizarDerecha { 0% { opacity: 0; transform: translateX(30px); } 100% { opacity: 1; transform: translateX(0); } }
body.modo-noche .ticket-item { animation: deslizarDerecha 0.3s forwards; }

@keyframes slideInRight { 0% { transform: translateX(120%); opacity: 0; } 100% { transform: translateX(0); opacity: 1; } }
@keyframes fadeOutUp { 0% { transform: translateY(0); opacity: 1; } 100% { transform: translateY(-20px); opacity: 0; } }
@keyframes toastProgress { 0% { width: 100%; } 100% { width: 0%; } }

#panel-historial, .panel-lateral {
    position: fixed;
    top: 0;
    right: -450px; /* 🔴 Se mantiene oculto por defecto */
    width: 400px;
    height: 100vh;
    background: var(--bg-panel-historial);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border-left: var(--glass-border);
    box-shadow: -15px 0 40px rgba(0, 0, 0, 0.2);
    z-index: 99999;
    padding: 2.5rem 2rem;
    transition: right 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    overflow-y: auto;
    color: var(--texto-primario);
}

#panel-historial.abierto, 
#panel-historial.activo,
.panel-lateral.abierto,
.panel-lateral.activo {
    right: 0 !important;
}

#panel-historial h2, .panel-lateral h2 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: var(--texto-primario);
    display: flex;
    align-items: center;
    gap: 10px;
}

/* El botón de la "X" para cerrar */
.btn-cerrar-panel {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.2);
    width: 35px;
    height: 35px;
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transicion-apple);
}

.btn-cerrar-panel:hover {
    background: #ef4444;
    color: var(--vantage-white);
    transform: scale(1.1);
}

#panel-historial div, .panel-lateral div {
    color: var(--texto-primario) !important;
    font-weight: 500;
}

body:not(.modo-noche) .mesa-btn.mesa-activa span {
    color: var(--vantage-black) !important;
    text-shadow: none !important;
    font-weight: 800 !important;
}

body:not(.modo-noche) .mesa-btn.mesa-activa {
    background: rgba(16, 239, 207, 0.2) !important;
    border: 2px solid var(--accent-color) !important;
    box-shadow: 0 4px 15px rgba(16, 239, 207, 0.3) !important;
}

.panel-header {
    margin-bottom: 2rem !important; 
}

.segmented-control {
    margin-top: 0.5rem !important;
    margin-bottom: 1.5rem !important;
}


.control-comensales {
    margin-bottom: 2rem !important;
}

body:not(.modo-noche) .comensal-separador {
    margin-top: 0.5rem !important;
    margin-bottom: 0.8rem !important;
    font-weight: 700 !important;
    color: var(--texto-secundario) !important;
    font-size: 0.95rem !important;
}

body:not(.modo-noche) #grid-ingredientes {
    background: rgba(0, 0, 0, 0.04) !important;
    border: 1px solid rgba(0, 0, 0, 0.05) !important;
}

body:not(.modo-noche) #grid-ingredientes > div {
    background: var(--vantage-white) !important;
    border: 1px solid rgba(0, 0, 0, 0.08) !important;
    border-radius: 10px !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04) !important;
    color: var(--texto-primario) !important;
    margin-bottom: 8px !important;
}

body:not(.modo-noche) #grid-ingredientes span,
body:not(.modo-noche) #grid-ingredientes strong {
    color: var(--texto-primario) !important;
    text-shadow: none !important;
}

body:not(.modo-noche) #resumen-cambios-ingredientes span {
    color: var(--texto-secundario) !important;
    font-weight: 600 !important;
}

.ticket-vantage-card {
    border-radius: 24px !important; 
    padding: 20px !important;
}

body:not(.modo-noche) .ticket-vantage-card {
    background: var(--bg-tarjeta) !important;
    border: 2px dashed rgba(148, 163, 184, 0.4) !important; 
    box-shadow: var(--neumo-shadow-raised) !important;
    color: var(--texto-primario) !important;
}

body.modo-noche .ticket-vantage-card {
    border: 2px dashed rgba(16, 239, 207, 0.3) !important; 
}

body:not(.modo-noche) .ticket-vantage-card:hover {
    box-shadow: var(--vantage-soft-shadow-hover) !important;
    border-color: rgba(99, 102, 241, 0.4) !important; 
}

.kds-header {
    position: relative;
    z-index: 99999 !important; 
}

#label-sucursal {
    color: var(--texto-primario) !important;
    font-weight: 700;
}

.btn-campana {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    font-size: 1.8rem !important;
    width: 45px !important;
    height: 45px !important;
    border-radius: 50% !important;
    outline: none !important;
}

.btn-campana:hover {
    background: var(--bg-input) !important;
}

.tarjeta-kpi p {
    font-size: 2.8rem !important;
    font-family: 'Roboto Mono', monospace !important;
}
#contenedor-alertas {
    z-index: 999999 !important;
}


.modal-overlay {
    z-index: 999999 !important; 
}

body:not(.modo-noche) .logo-vantage {
    filter: invert(1) brightness(0.2) !important;
}

body:not(.modo-noche) .kds-header .badge {
    color: var(--color-blue-light) !important;
    background: rgba(59, 130, 246, 0.1) !important;
    border-color: rgba(59, 130, 246, 0.3) !important;
}


.modal-overlay {
    position: fixed !important;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999999 !important;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal-overlay.activo {
    opacity: 1;
    pointer-events: all;
}


.kds-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
    align-items: start;
    padding: 0 25px;
}

.kds-grid .tarjeta-comanda {
    padding: 20px !important;
    border-radius: 20px !important;
}

.scoreboard-panel {
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 15px 30px !important;
    margin: 0 25px 25px 25px;
    border-radius: 20px !important;
    flex-wrap: wrap;
    gap: 15px;
}

.score-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.score-label {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 800;
}

.score-value {
    font-size: 2.2rem !important;
    line-height: 1;
}

.score-mensaje {
    font-weight: 800;
    padding: 10px 20px;
    border-radius: 15px;
    font-size: 0.95rem;
    text-align: center;
}

.item-fila.completado {
    opacity: 0.4;
    text-decoration: line-through;
    filter: grayscale(1);
    background: rgba(0,0,0,0.05);
}
body.modo-noche .item-fila.completado {
    background: rgba(255,255,255,0.02);
}

.sticky-zone {
    position: sticky;
    top: 0;
    z-index: 99000;
    background: transparent;
    backdrop-filter: blur(20px) saturate(1.4);
    -webkit-backdrop-filter: blur(20px) saturate(1.4);
    padding-top: 15px;
    margin-top: -15px;
}

/* Modo oscuro: overlay oscuro muy suave para no perder contraste del header */
body.modo-noche .sticky-zone {
    background: rgba(10, 10, 20, 0.55);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.25);
    border-bottom: 1px solid rgba(139, 92, 246, 0.12);
}

/* Modo claro: overlay claro con toque morado sutil */
body:not(.modo-noche) .sticky-zone {
    background: rgba(245, 243, 255, 0.6);
    box-shadow: 0 4px 24px rgba(109, 40, 217, 0.08);
    border-bottom: 1px solid rgba(109, 40, 217, 0.1);
}


.acordeon-btn {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-input);
    border: var(--border-input);
    padding: 15px 20px;
    font-size: 1rem;
    font-weight: 700;
    color: var(--texto-primario);
    cursor: pointer;
    border-radius: 14px;
    margin-bottom: 8px;
    box-shadow: var(--neumo-shadow-raised);
    transition: var(--transicion-apple);
}

.acordeon-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--vantage-soft-shadow-hover);
}

.chevron {
    transition: transform 0.3s ease;
    font-size: 1.2rem;
    color: var(--accent-color);
}
.chevron.abierto {
    transform: rotate(90deg);
}

.acordeon-contenido {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease, padding 0.4s ease;
    background: rgba(0,0,0,0.03);
    border-radius: 0 0 14px 14px;
    margin-top: -15px;
    margin-bottom: 15px;
    padding: 0 15px;
}
body.modo-noche .acordeon-contenido { background: rgba(255,255,255,0.03); }

.acordeon-contenido.activo {
    max-height: 400px;
    overflow-y: auto;
    padding: 25px 15px 15px 15px;
}

.btn-toggle-stock {
    background: var(--bg-tarjeta);
    border: var(--border-input);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--texto-primario);
    cursor: pointer;
    box-shadow: var(--neumo-shadow-raised);
    transition: var(--transicion-apple);
}

.btn-toggle-stock:hover {
    transform: scale(1.05);
    border-color: var(--accent-color);
}

.btn-listo {
    background: var(--vantage-navy);
    color: var(--vantage-white);
    font-weight: 800;
    border: none;
    padding: 15px;
    border-radius: 20px;
    width: 100%;
    cursor: pointer;
    margin-top: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: var(--transicion-apple);
}

.btn-listo:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

#panel-stock h2, #panel-historial h2 {
    color: var(--texto-primario) !important;
}


.panel-lateral, .scroll-area, body {
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: none;
}

.btn-secundario, .btn-marcar-listo, .btn-toggle-stock, .acordeon-btn, .item-fila {
    min-height: 54px;
    touch-action: manipulation;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.item-fila:active, .btn-marcar-listo:active, .acordeon-btn:active, .btn-cerrar-panel:active {
    transform: scale(0.96) !important;
    opacity: 0.8;
    transition: transform 0.1s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

@keyframes entradaTicket {
    0% { opacity: 0; transform: translateY(40px) scale(0.90); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}

.tarjeta-comanda {
    animation: entradaTicket 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
    border-top: 6px solid var(--accent-color) !important; 
}

.item-fila {
    margin-bottom: 12px !important;
    padding: 16px 18px !important;
}

.item-nombre {
    font-size: 1.1rem;
    font-weight: 700;
}

.panel-lateral {
    transition: right 0.5s cubic-bezier(0.3, 1.1, 0.4, 1) !important; 
    box-shadow: -20px 0 60px rgba(0,0,0,0.4) !important;
}

#buscador-stock {
    width: 100%;
    background: var(--bg-tarjeta);
    border: 2px solid transparent;
    font-size: 1.05rem;
    padding: 16px 20px;
    border-radius: 18px;
    box-shadow: var(--neumo-shadow-recessed);
    color: var(--texto-primario);
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    margin-top: 15px;
    margin-bottom: 25px;
}

#buscador-stock:focus {
    border-color: var(--accent-color);
    background: var(--bg-fondo);
    box-shadow: 0 0 15px rgba(16, 239, 207, 0.2), var(--neumo-shadow-recessed);
    transform: scale(1.02);
}

.categoria-bloque {
    background: var(--bg-tarjeta);
    border: var(--glass-border);
    border-radius: 18px;
    margin-bottom: 15px;
    box-shadow: var(--neumo-shadow-raised);
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.categoria-bloque:hover {
    box-shadow: var(--vantage-soft-shadow-hover);
}

.acordeon-btn {
    background: transparent !important;
    box-shadow: none !important;
    border: none !important;
    margin-bottom: 0 !important;
    border-radius: 0 !important;
    padding: 18px 22px !important;
}

.acordeon-btn:hover {
    background: rgba(128, 128, 128, 0.05) !important;
}

.acordeon-contenido {
    background: rgba(0, 0, 0, 0.02) !important;
    border-top: 1px solid rgba(128, 128, 128, 0.1);
    margin-top: 0 !important; 
}
body.modo-noche .acordeon-contenido {
    background: rgba(0, 0, 0, 0.2) !important;
}

.acordeon-contenido .item-stock {
    background: var(--bg-fondo);
    border-radius: 12px;
    margin-bottom: 10px;
    border: 1px solid rgba(128, 128, 128, 0.1);
    padding: 14px 16px !important;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
}

.acordeon-contenido .item-stock:hover {
    transform: translateX(5px);
    border-left: 4px solid var(--accent-color);
}


.btn-toggle-stock {
    background: rgba(239, 68, 68, 0.1) !important;
    color: #ef4444 !important;
    border: 1px solid rgba(239, 68, 68, 0.3) !important;
    padding: 8px 14px !important;
}

.btn-toggle-stock:hover {
    background: #ef4444 !important;
    color: white !important;
}

.item-stock.estado-agotado {
    background: rgba(239, 68, 68, 0.05) !important;
    border: 1px dashed rgba(239, 68, 68, 0.3) !important;
}

.item-stock.estado-agotado strong {
    color: #ef4444;
    text-decoration: line-through;
    opacity: 0.8;
}

.item-stock.estado-agotado .btn-toggle-stock {
    background: rgba(16, 185, 129, 0.1) !important;
    color: #10b981 !important;
    border: 1px solid rgba(16, 185, 129, 0.3) !important;
}

.item-stock.estado-agotado .btn-toggle-stock:hover {
    background: #10b981 !important;
    color: white !important;
}

/* tablets*/

/* 1. Ocultar scrollbars pero mantener el deslizamiento */
.grid-mesas::-webkit-scrollbar,
.grid-menu::-webkit-scrollbar,
#lista-ticket::-webkit-scrollbar,
.scroll-area::-webkit-scrollbar,
.panel-scroll::-webkit-scrollbar {
    display: none !important; /* Oculta la barra en Chrome/Safari */
}

.grid-mesas, .grid-menu, #lista-ticket, .scroll-area, .panel-scroll {
    -ms-overflow-style: none;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch; /* Scroll fluido */
    overscroll-behavior: contain; /* Evita que la pantalla entera rebote */
}

.mesa-btn, .item-menu, .btn-pildora, .btn-enviar, .btn-cobrar, .comensal-btn, .ticket-item {
    touch-action: manipulation;
    user-select: none; /* Evita que el mesero seleccione texto por accidente */
    -webkit-tap-highlight-color: transparent; /* Quita el cuadro azul feo  */
    transition: transform 0.1s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.1s ease !important;
}

/* El efecto de hundimiento cuando el dedo toca la pantalla */
.mesa-btn:active, .item-menu:active, .btn-pildora:active, .btn-enviar:active, .btn-cobrar:active, .comensal-btn:active {
    transform: scale(0.95) !important;
    box-shadow: inset 0 4px 10px rgba(0,0,0,0.1) !important;
    opacity: 0.9;
}

/* 3. Animación Elástica para platillos agregados a la cuenta */
@keyframes slideInRightElastic {
    0% { transform: translateX(40px) scale(0.9); opacity: 0; }
    60% { transform: translateX(-5px) scale(1.02); opacity: 1; }
    100% { transform: translateX(0) scale(1); opacity: 1; }
}

.ticket-item {
    animation: slideInRightElastic 0.4s cubic-bezier(0.25, 0.8, 0.25, 1) forwards !important;
    padding: 15px !important;
    margin-bottom: 12px !important;
    border-radius: 16px !important;
}

.btn-enviar, .btn-cobrar, .btn-secundario {
    min-height: 54px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.05rem !important;
    letter-spacing: 0.5px;
}

/* historial*/

/* 1. Transformar texto plano en tarjetas */
.tarjeta-notificacion, .notif-item {
    background: var(--panel-bg, rgba(255,255,255,0.8)) !important;
    border: 1px solid var(--border-color-light, rgba(0,0,0,0.1)) !important;
    border-radius: 18px !important;
    padding: 16px 20px !important;
    margin-bottom: 15px !important;
    box-shadow: var(--panel-shadow, 0 4px 10px rgba(0,0,0,0.1)) !important;
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: transform 0.1s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.1s ease !important;
    touch-action: manipulation;
}

body.modo-noche .tarjeta-notificacion, body.modo-noche .notif-item {
    background: rgba(255, 255, 255, 0.03) !important;
}

/* 2. Efecto físico al tocar */
.tarjeta-notificacion:active, .notif-item:active {
    transform: scale(0.96) !important;
    box-shadow: inset 0 4px 10px rgba(0,0,0,0.1) !important;
}
body.modo-noche .tarjeta-notificacion:active { box-shadow: inset 0 2px 5px rgba(0,0,0,0.4) !important; }

/* 3. Texto principal del mensaje */
.notif-mensaje {
    font-size: 1.05rem !important;
    font-weight: 700 !important;
    color: var(--text-primary, #1e293b) !important;
    line-height: 1.4 !important;
}

/* 4. Pie de la tarjeta (La hora) */
.notif-hora {
    font-size: 0.85rem !important;
    color: var(--text-secondary, #64748b) !important;
    font-weight: 800 !important;
    display: flex;
    justify-content: flex-end;
    margin-top: 5px;
    border-top: 1px dashed var(--border-color-light, rgba(0,0,0,0.1));
    padding-top: 10px;
}
/* min y max de inventario*/

/* Estilo Base */
.celda-editable {
    position: relative;
    padding: 6px 12px !important;
    border-radius: 8px;
    background: var(--bg-input);
    border: 1px dashed var(--border-input); 
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-block; 
    min-width: 45px;
}

body:not(.modo-noche) .columna-minimo .celda-editable {
    background: rgba(239, 68, 68, 0.08); /* Fondo muy suave */
    border: 1px dashed rgba(239, 68, 68, 0.4); /* Borde rojo más marcado */
    color: #ef4444;
}

body:not(.modo-noche) .columna-maximo .celda-editable {
    background: rgba(16, 185, 129, 0.08); /* Fondo muy suave */
    border: 1px dashed rgba(16, 185, 129, 0.4); /* Borde verde más marcado */
    color: #059669; /* Un verde un poquito más oscuro para leerse bien en blanco */
}

/* Efecto al pasar el mouse por encima (Hover general) */
.celda-editable:hover {
    background: var(--bg-tarjeta);
    transform: translateY(-2px);
}

/* Hover específico para Modo Día (Hace que la cajita brille en blanco) */
body:not(.modo-noche) .columna-minimo .celda-editable:hover {
    background: #ffffff;
    border-color: #ef4444;
    box-shadow: 0 4px 10px rgba(239, 68, 68, 0.15);
}

body:not(.modo-noche) .columna-maximo .celda-editable:hover {
    background: #ffffff;
    border-color: #10B981;
    box-shadow: 0 4px 10px rgba(16, 185, 129, 0.15);
}

/* Iconito de "editar" invisible que aparece al hacer hover */
.celda-editable::after {
    content: '';
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23a0aec0'%3E%3Cpath d='M21.731 2.269a2.625 2.625 0 00-3.712 0l-1.157 1.157 3.712 3.712 1.157-1.157a2.625 2.625 0 000-3.712zM19.513 8.199l-3.712-3.712-12.15 12.15a5.25 5.25 0 00-1.32 2.214l-.8 2.685a.75.75 0 00.933.933l2.685-.8a5.25 5.25 0 002.214-1.32L19.513 8.2z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-size: contain;
    width: 13px;
    height: 13px;
    display: inline-block;
    position: absolute;
    right: -18px;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.celda-editable:hover::after {
    opacity: 1;
}

/* Ajustes de color para Modo Noche*/
body.modo-noche .columna-minimo .celda-editable { color: #ef4444; font-weight: 800; }
body.modo-noche .columna-maximo .celda-editable { color: #10B981; font-weight: 800; }
body.modo-noche .columna-minimo .celda-editable:hover { border-color: rgba(239, 68, 68, 0.5); box-shadow: 0 2px 8px rgba(239, 68, 68, 0.2); }
body.modo-noche .columna-maximo .celda-editable:hover { border-color: rgba(16, 185, 129, 0.5); box-shadow: 0 2px 8px rgba(16, 185, 129, 0.2); }

/* calendario */
.dia-calendario {
    aspect-ratio: 1; /* Hace que sean cuadrados  */
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 700;
    color: var(--texto-primario);
    font-family: 'Roboto Mono', monospace;
    font-size: 0.9rem;
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    background: transparent;
    border: 1px solid transparent;
}

/* Efecto al pasar el mouse/dedo */
.dia-calendario:hover {
    background: var(--bg-input);
    transform: scale(1.15);
    box-shadow: var(--neumo-shadow-raised);
}

/* Para los espacios vacíos antes del día 1 */
.dia-calendario.dia-vacio {
    pointer-events: none;
    background: transparent;
}

/* Resaltar el día de hoy */
.dia-calendario.dia-hoy {
    border: 1px solid var(--accent-color);
    color: var(--accent-color);
}

/* El día que el usuario seleccionó */
.dia-calendario.dia-seleccionado {
    background: var(--accent-color) !important;
    color: var(--accent-text) !important;
    box-shadow: 0 4px 15px rgba(16, 239, 207, 0.4);
    transform: scale(1.1);
    border: none;
}
/* ── Header actions: tema + volver ───────────────────────────────── */
.header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-tema {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--texto-primario);
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.25s ease;
    backdrop-filter: blur(10px);
    flex-shrink: 0;
}
.btn-tema:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}

.btn-volver {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    height: 38px;
    padding: 0 16px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--texto-primario);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.25s ease;
    backdrop-filter: blur(10px);
    letter-spacing: 0.01em;
    white-space: nowrap;
}
.btn-volver svg {
    opacity: 0.75;
    flex-shrink: 0;
}
.btn-volver:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}

body.modo-dia .btn-tema,
body.modo-dia .btn-volver {
    background: rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 0, 0, 0.1);
}
body.modo-dia .btn-tema:hover,
body.modo-dia .btn-volver:hover {
    background: rgba(0, 0, 0, 0.1);
    border-color: rgba(0, 0, 0, 0.18);
}

/* Píldoras de modificadores en el modal de meseros — base = modo día, override noche */
.pildora-mod {
    background: rgba(139,92,246,0.08);
    border: 1.5px solid rgba(139,92,246,0.4);
    border-radius: 20px;
    padding: 6px 14px;
    cursor: pointer;
    font-size: 0.82rem;
    font-weight: 700;
    color: #5b21b6;
    transition: all 0.15s;
    white-space: nowrap;
}
.pildora-mod:hover {
    background: rgba(139,92,246,0.15);
    border-color: #7c3aed;
}
.pildora-mod.activa {
    background: #7c3aed;
    border-color: #6d28d9;
    color: #ffffff;
}
body.modo-noche .pildora-mod {
    color: #e2d9f3;
    background: rgba(139,92,246,0.12);
    border-color: rgba(139,92,246,0.4);
}
body.modo-noche .pildora-mod:hover {
    background: rgba(139,92,246,0.22);
    border-color: rgba(139,92,246,0.7);
}
body.modo-noche .pildora-mod.activa {
    background: rgba(139,92,246,0.45);
    border-color: #8b5cf6;
    color: #ffffff;
}

/* Precio extra dentro de las píldoras */
.pildora-precio {
    font-size: 0.7rem;
    font-weight: 700;
    color: #dc2626;
}
body.modo-noche .pildora-precio {
    color: #10EFCF;
}
