/* ==========================================================================
   PITER PRO - OPERATIONAL DESIGN SYSTEM (V1.0 Stable)
   Módulos: Almacén, Cocina, Barra, Caja
   ========================================================================== */

:root {
    /* --- PALETA DE COLORES SEMÁNTICA --- */
    --op-brand-blue: #194B95;
    --op-brand-blue-hover: #123670;
    --op-brand-red: #E21C21;
    --op-success: #10b981;  /* Emerald 500 */
    --op-warning: #f59e0b;  /* Amber 500 */
    
    /* --- SUPERFICIES & BORDES --- */
    --op-bg-app: #f8fafc;   /* Slate 50 */
    --op-bg-card: #ffffff;
    --op-border-subtle: #e2e8f0; /* Slate 200 */
    --op-border-focus: #194B95;
    
    /* --- SOMBRAS SUAVES --- */
    --op-shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --op-shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    --op-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.04);
}

/* ==========================================================================
   1. COMPONENTES DE NAVEGACIÓN (TABS)
   ========================================================================== */

.nav-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.625rem 1.25rem; /* 10px 20px */
    font-size: 0.75rem; /* 12px */
    font-weight: 700;
    letter-spacing: 0.025em;
    color: #64748b; /* Slate 500 */
    background-color: transparent;
    border: 1px solid transparent;
    border-radius: 0.5rem; /* 8px */
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
}

.nav-pill:hover {
    color: var(--op-brand-blue);
    background-color: #f1f5f9; /* Slate 100 */
}

.nav-pill.active {
    background-color: #ffffff;
    color: var(--op-brand-blue);
    border-color: var(--op-border-subtle);
    box-shadow: var(--op-shadow-sm);
    transform: translateY(-1px); /* Sutil elevación */
}

/* ==========================================================================
   2. VISUALIZACIÓN DE DATOS (KPIs & STOCK)
   ========================================================================== */

/* --- Barras de Stock --- */
.stock-track {
    background-color: #e2e8f0;
    height: 6px;
    width: 100%;
    border-radius: 9999px;
    overflow: hidden;
    position: relative;
}

.stock-bar {
    height: 100%;
    border-radius: 9999px;
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Variantes de estado */
.stock-bar.critico { background-color: var(--op-brand-red); }
.stock-bar.warning { background-color: var(--op-warning); }
.stock-bar.ok { background-color: var(--op-success); }

/* ==========================================================================
   3. FORMULARIOS & INPUTS
   ========================================================================== */

/* --- Input Estándar --- */
.op-input {
    width: 100%;
    background-color: #ffffff;
    border: 1px solid #cbd5e1; /* Slate 300 */
    color: #0f172a;
    border-radius: 0.75rem; /* 12px */
    padding: 0.625rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    outline: none;
    transition: all 0.2s ease;
}

.op-input:focus {
    border-color: var(--op-brand-blue);
    box-shadow: 0 0 0 3px rgba(25, 75, 149, 0.1);
}

/* --- Input Numérico Gigante (Para Modales de Ajuste) --- */
.op-input-giant {
    width: 100%;
    background-color: transparent;
    border: none;
    border-bottom: 2px solid var(--op-border-subtle);
    font-family: 'JetBrains Mono', monospace; /* Fuente monoespaciada para números */
    font-size: 2.25rem;
    font-weight: 800;
    text-align: center;
    color: #0f172a;
    padding-bottom: 0.25rem;
    outline: none;
    transition: border-color 0.2s ease;
}

.op-input-giant:focus {
    border-color: var(--op-brand-blue);
}


input[type=number]::-webkit-inner-spin-button, 
input[type=number]::-webkit-outer-spin-button { 
    -webkit-appearance: none; margin: 0; 
}
input[type=number] {
    -moz-appearance: textfield; 
    appearance: textfield;     
}

.upload-zone {
    border: 2px dashed #cbd5e1;
    background-color: #f8fafc;
    border-radius: 0.75rem;
    transition: all 0.2s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.upload-zone:hover {
    border-color: var(--op-brand-blue);
    background-color: #eff6ff; /* Blue 50 */
}

/* ==========================================================================
   4. TABLAS OPERATIVAS
   ========================================================================== */

.op-table {
    width: 100%;
    border-collapse: collapse;
}

.op-table thead th {
    background-color: #f8fafc;
    position: sticky;
    top: 0;
    z-index: 10;
    padding: 0.75rem 1.5rem;
    text-align: left;
    font-size: 0.65rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #64748b;
    border-bottom: 1px solid var(--op-border-subtle);
}

.op-table tbody tr {
    border-bottom: 1px solid #f1f5f9;
    transition: background-color 0.15s ease;
}

.op-table tbody tr:hover {
    background-color: #f8fafc;
}

.op-table tbody td {
    padding: 1rem 1.5rem;
    vertical-align: middle;
}

/* ==========================================================================
   5. UTILIDADES & ANIMACIONES
   ========================================================================== */

/* Scrollbar Fino y Elegante */
.custom-scrollbar::-webkit-scrollbar { width: 5px; height: 5px; }
.custom-scrollbar::-webkit-scrollbar-track { background: transparent; }
.custom-scrollbar::-webkit-scrollbar-thumb { background-color: #cbd5e1; border-radius: 10px; }
.custom-scrollbar::-webkit-scrollbar-thumb:hover { background-color: #94a3b8; }

.no-scrollbar::-webkit-scrollbar { display: none; }
.no-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }

/* Animación de Entrada Suave */
.fade-in {
    animation: fadeInSlide 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    opacity: 0;
    transform: translateY(10px);
}

@keyframes fadeInSlide {
    to { opacity: 1; transform: translateY(0); }
}


/* === MÓDULO CAJA / POS === */

/* Botones de Pestaña (Caja) */
.tab-btn {
    transition: all 0.2s;
    border: 1px solid transparent;
}
.tab-btn.active { 
    background-color: white; 
    color: #194B95; /* Brand Blue */
    border-color: #e2e8f0; 
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}
.tab-btn:not(.active):hover {
    background-color: rgba(255,255,255,0.5);
    color: #194B95;
}

/* Efecto Ticket de Papel (Receipt) */
.receipt-paper {
    background: #fff;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    position: relative;
}
.receipt-paper::after {
    content: "";
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 100%;
    height: 5px;
    background-image: linear-gradient(135deg, transparent 66%, #e2e8f0 67%, #e2e8f0 100%), linear-gradient(45deg, #e2e8f0 33%, #fff 34%, #fff 100%);
    background-size: 10px 10px;
    background-repeat: repeat-x;
}

/* Botones Grandes de Pago */
.metodo-btn {
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.metodo-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}
.metodo-btn.active {
    border-color: #194B95;
    background-color: #eff6ff; /* Blue 50 */
    box-shadow: 0 0 0 2px #194B95;
}


/* === MÓDULO KDS (MONITOR DE COCINA) === */

/* Fuente Digital para Tiempos */
@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@500;700&display=swap');

.font-display { font-family: 'Orbitron', sans-serif; letter-spacing: 1px; }

/* Semáforo de Tiempos */
.time-box {
    font-family: 'Orbitron', monospace;
    font-weight: 700;
    padding: 6px 12px;
    border-radius: 6px;
    display: inline-block;
    min-width: 90px;
    text-align: center;
    background: #fff;
    border: 2px solid #e2e8f0;
    color: #0f172a;
}

/* Estados del Timer */
.verde { background-color: #f0fdf4; color: #15803d; border-color: #86efac; }
.naranja { background-color: #fffbeb; color: #b45309; border-color: #fcd34d; }
.rojo { background-color: #fef2f2; color: #E21C21; border-color: #fecaca; font-weight: 800; }
.alerta-roja { 
    background-color: #E21C21; color: #fff; border-color: #E21C21;
    animation: pulse-alert 1s infinite; 
}

@keyframes pulse-alert { 
    0% { transform: scale(1); }
    50% { transform: scale(1.05); box-shadow: 0 0 15px rgba(226, 28, 33, 0.4); }
    100% { transform: scale(1); }
}

/* Pestañas KDS */
.tab-active { 
    background-color: #194B95; color: white; 
    box-shadow: 0 4px 6px -1px rgba(25, 75, 149, 0.3); border-color: #194B95;
}
.tab-inactive { 
    background-color: white; color: #64748b; border-color: #e2e8f0; 
}
.tab-inactive:hover { background-color: #f8fafc; color: #194B95; }

/* Badges */
.badge-table { 
    background-color: #eff6ff; color: #194B95; border: 1px solid #dbeafe; font-weight: 800; 
}
.badge-note {
    background-color: #fff1f2; color: #E21C21; border: 1px solid #fecaca;
    font-size: 0.7rem; font-weight: 700; text-transform: uppercase;
    padding: 2px 6px; border-radius: 4px;
}

/* Modo Trabajo (Teclado) */
.row-focused {
    background-color: #f0f9ff !important;
    border-left: 6px solid #194B95 !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    z-index: 20; position: relative; transform: scale(1.002);
}
.row-tachado {
    background-color: #f8fafc !important; opacity: 0.5;
    text-decoration: line-through; pointer-events: none; filter: grayscale(100%);
}

/* Botón Acción Principal */
.btn-action-primary {
    background-color: #E21C21; color: white;
    box-shadow: 0 2px 4px rgba(226, 28, 33, 0.2); transition: all 0.2s;
}
.btn-action-primary:hover {
    background-color: #c4181c; transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(226, 28, 33, 0.3);
}


/* === MÓDULO MESERO / COMANDERA === */

/* Estilos de Mesa */
.mesa-base { 
    background-color: white; 
    border: 1px solid #e2e8f0; 
}
.mesa-padre { 
    position: relative; 
    border-color: #194B95; 
    background-color: #eff6ff; 
}

/* Tarjeta Producto (Menú Visual) */
.card-producto {
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}
.card-producto:active { transform: scale(0.97); }

/* Navegación Móvil (Bottom Bar) */
.nav-item.active { color: #194B95; }
.nav-item.active .nav-icon { 
    background-color: #eff6ff; 
    color: #194B95; 
}
.nav-icon { transition: all 0.2s; }

/* Botones de Categoría */
.btn-cat-active { 
    background-color: #194B95; color: white; font-weight: 700; 
    box-shadow: 0 4px 6px -1px rgba(25, 75, 149, 0.3);
}
.btn-cat-inactive { 
    background-color: white; color: #64748b; 
    border: 1px solid #e2e8f0; font-weight: 600;
}

/* Animaciones */
.slide-in-right { 
    animation: slideInRight 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards; 
}
@keyframes slideInRight { 
    from { opacity: 0; transform: translateX(10px); } 
    to { opacity: 1; transform: translateX(0); } 
}

/* Modal Overlay */
.modal-overlay { 
    background-color: rgba(15, 23, 42, 0.5); 
    backdrop-filter: blur(4px); 
}


/* === MÓDULO CAJA (POS) === */

/* Efecto Papel de Ticket (ZigZag y Sombra) */
.ticket-shadow {
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}
.ticket-zigzag {
    background: linear-gradient(-45deg, transparent 8px, #ffffff 8px) 0 100%,
                linear-gradient(45deg, transparent 8px, #ffffff 8px) 0 100%;
    background-repeat: repeat-x; 
    background-size: 16px 16px; 
    height: 16px; 
    width: 100%;
}

/* Tarjetas de Lista de Pedidos (Estilo Selección) */
.order-card {
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    border-left: 4px solid transparent;
}
.order-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}
.order-card.selected {
    background-color: #fff;
    border-left-color: #194B95;
    box-shadow: 0 10px 15px -3px rgba(25, 75, 149, 0.15);
    border-color: #bfdbfe;
}

/* Botones Grandes de Pago */
.pay-btn {
    transition: all 0.2s;
    border: 2px solid #e2e8f0;
}
.pay-btn.active {
    background-color: #eff6ff;
    border-color: #194B95;
    color: #194B95;
    box-shadow: 0 4px 12px rgba(25, 75, 149, 0.15);
}

/* Transiciones para Panel Móvil (Responsive) */
.mobile-panel { transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1); }
.mobile-closed { transform: translateX(100%); } 
.mobile-open { transform: translateX(0); }
@media (min-width: 1024px) { .mobile-closed { transform: none; } }




/* === MÓDULO RECEPCIÓN / HOSTESS === */

/* Tarjetas de Reserva (Lista Lateral) */
.reserva-card { 
    transition: all 0.2s ease; 
    border-left: 3px solid transparent; 
}
.reserva-card:hover { 
    transform: translateX(3px); 
    border-left-color: #194B95; /* Brand Blue */
    background-color: #f8fafc; 
}
.reserva-card.selected { 
    background-color: #eff6ff; 
    border-left-color: #194B95; 
    border-color: #bfdbfe; 
}

/* Tarjetas de Mesa (Mapa Visual) */
.mesa-card { 
    transition: transform 0.2s, box-shadow 0.2s; 
}
.mesa-card:active { 
    transform: scale(0.95); 
}

/* Animación Modal */
.modal-enter { 
    animation: modalIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards; 
}
@keyframes modalIn { 
    from { opacity: 0; transform: scale(0.95) translateY(10px); } 
    to { opacity: 1; transform: scale(1) translateY(0); } 
}