:root { --bg-color: #0d0e15; --glass-bg: rgba(255, 255, 255, 0.03); --glass-border: rgba(255, 255, 255, 0.08); --accent-color: #00ffcc; --text-main: #ffffff; --text-muted: #8b8d9b; }
* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Inter', "Noto Color Emoji", sans-serif; }

body { background-color: var(--bg-color); color: var(--text-main); margin: 0; padding: 0; overflow: hidden; user-select: none; }

/* LA MAGIA SPA */
.spa-view { display: none; width: 100vw; height: 100dvh; overflow: hidden; }
.spa-view.active { display: flex; }

/* ESCUDO ANTI-BLOQUEO PARA BOTONES FLOTANTES */
#global-floats { pointer-events: none; position: fixed; top:0; left:0; width: 100%; z-index: 9999; }
#global-floats button { pointer-events: auto; }

/* MODALES FLOTANTES (Cristal Oscuro) */
.modal-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.7); backdrop-filter: blur(8px); z-index: 10000; align-items: center; justify-content: center; padding: 20px; }
.modal-overlay.active { display: flex; }
.modal-box { background: var(--bg-color); border: 1px solid var(--glass-border); border-radius: 20px; padding: 25px; width: 100%; max-width: 400px; box-shadow: 0 25px 50px rgba(0,0,0,0.8); }
.modal-title { font-size: 18px; font-weight: 700; color: #fff; margin-bottom: 15px; border-bottom: 1px solid var(--glass-border); padding-bottom: 10px; }
.modal-actions { display: flex; gap: 10px; margin-top: 20px; }
.btn-cancel { flex: 1; background: rgba(255, 60, 60, 0.1); color: #ff4d4d; border: 1px solid rgba(255, 60, 60, 0.3); padding: 12px; border-radius: 10px; font-weight: bold; cursor: pointer; }
.btn-confirm { flex: 1; background: rgba(0, 255, 204, 0.1); color: var(--accent-color); border: 1px solid rgba(0, 255, 204, 0.3); padding: 12px; border-radius: 10px; font-weight: bold; cursor: pointer; }

/* LOGIN & STAFF */
.center-layout { justify-content: center; align-items: center; background-image: radial-gradient(circle at 50% 0%, #1a1c29 0%, transparent 70%); flex-direction: column; }
.login-container, .staff-container { width: 90%; max-width: 400px; padding: 40px; background: var(--glass-bg); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); border: 1px solid var(--glass-border); border-radius: 24px; box-shadow: 0 25px 50px rgba(0,0,0,0.5); text-align: center; position: relative; z-index: 10; }
.staff-container { max-width: 450px; background: rgba(255, 255, 255, 0.02); }
.logo { font-size: 24px; font-weight: 700; letter-spacing: 2px; margin-bottom: 5px; background: linear-gradient(90deg, #fff, var(--accent-color)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.staff-title { font-size: 20px; font-weight: 700; color: #a29bfe; margin-bottom: 5px; letter-spacing: 1px;}
.subtitle { color: var(--text-muted); font-size: 13px; margin-bottom: 40px; font-weight: 300; letter-spacing: 1px; text-transform: uppercase; }

/* TECLADO PIN */
.pin-indicators { display: flex; justify-content: center; gap: 15px; margin-bottom: 40px; }
.dot { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--glass-border); transition: all 0.2s ease; }
.dot.active { background: var(--accent-color); border-color: var(--accent-color); box-shadow: 0 0 15px rgba(0, 255, 204, 0.5); }
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 15px; width: 100%; }
.key { background: rgba(255, 255, 255, 0.02); border: 1px solid var(--glass-border); border-radius: 16px; padding: 20px 0; font-size: 24px; font-weight: 500; color: var(--text-main); cursor: pointer; transition: all 0.1s; display: flex; justify-content: center; align-items: center; }
.key:active { transform: scale(0.95); background: rgba(255, 255, 255, 0.1); border-color: var(--accent-color); }
.key.action { font-size: 14px; color: var(--text-muted); }
.admin-link { margin-top: 35px; display: inline-block; font-size: 12px; color: rgba(139, 141, 155, 0.5); text-decoration: none; transition: color 0.3s; letter-spacing: 1px; }

.action-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; margin-top: 30px; }
.btn-staff { background: rgba(255,255,255,0.05); border: 1px solid var(--glass-border); color: #fff; padding: 15px 10px; border-radius: 12px; cursor: pointer; font-weight: 700; transition: all 0.2s; }
.btn-staff:active { transform: scale(0.95); }
.btn-in { border-color: rgba(0, 255, 204, 0.3); color: var(--accent-color); }
.btn-out { border-color: rgba(255, 99, 132, 0.3); color: #ff6384; }
.btn-break { grid-column: span 2; border-color: rgba(255, 206, 86, 0.3); color: #ffce56; }

/* UTILIDADES FLOTANTES */
.btn-icon { background: rgba(255,255,255,0.05); border: 1px solid var(--glass-border); color: #fff; width: 44px !important; height: 44px !important; min-width: 44px !important; border-radius: 10px; cursor: pointer; display: flex; justify-content: center; align-items: center; transition: all 0.2s; flex-shrink: 0 !important; }
.btn-icon:hover { background: rgba(0, 255, 204, 0.1); border-color: var(--accent-color); color: var(--accent-color); }
.btn-icon svg { width: 22px; height: 22px; fill: currentColor; }

/* DASHBOARD MESAS */
.dashboard-layout { flex-direction: column; padding: 20px; }
.dash-topbar { flex-shrink: 0; display: grid; grid-template-columns: 1fr auto; grid-template-rows: auto auto; gap: 15px; background: var(--glass-bg); backdrop-filter: blur(10px); border: 1px solid var(--glass-border); padding: 20px 30px; border-radius: 16px; margin-bottom: 20px; }
.dash-user { grid-column: 1; grid-row: 1; display: flex; flex-direction: column; align-self: center; }
.dash-user .name { font-size: 20px; font-weight: 700; color: #fff; white-space: nowrap; }
.dash-user .role { font-size: 12px; color: var(--accent-color); letter-spacing: 1px; white-space: nowrap; text-transform: uppercase;}
.dash-fs { grid-column: 2; grid-row: 1; justify-self: end; align-self: center; }
.dash-clock { grid-column: 1; grid-row: 2; font-size: 22px; color: var(--accent-color); font-weight: 700; align-self: center; letter-spacing: 1px; font-variant-numeric: tabular-nums;}
.dash-logout { grid-column: 2; grid-row: 2; justify-self: end; align-self: center; }
.btn-logout { background: rgba(255, 60, 60, 0.1); border: 1px solid rgba(255, 60, 60, 0.3); color: #ff4d4d; padding: 12px 25px; border-radius: 10px; cursor: pointer; font-weight: 500; transition: all 0.3s; white-space: nowrap; font-size: 14px;}
.btn-logout:hover { background: rgba(255, 60, 60, 0.2); border-color: #ff4d4d; }

.map-container { flex: 1; overflow-y: auto; padding-right: 10px; padding-bottom: 20px; }
.area-section { margin-bottom: 30px; }
.area-title { font-size: 20px; font-weight: 300; color: var(--text-muted); margin-bottom: 15px; border-bottom: 1px solid var(--glass-border); padding-bottom: 10px; }
.tables-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 15px; }
.table-card { background: var(--glass-bg); border: 1px solid var(--glass-border); border-radius: 16px; padding: 20px 15px; text-align: center; cursor: pointer; transition: all 0.2s; position: relative; overflow: hidden; min-height: 110px; display: flex; flex-direction: column; justify-content: center; align-items: center;}
.table-card:active { transform: scale(0.95); }
.table-card.libre { border-color: rgba(0, 255, 204, 0.3); }
.table-card.ocupada { border-color: rgba(255, 87, 34, 0.3); }
.table-number { font-size: 20px; font-weight: 700; margin-bottom: 5px; }
.table-capacity { font-size: 12px; color: var(--text-muted); }
.table-owner { font-size: 11px; color: #ff9800; font-weight: 700; margin-top: 8px; background: rgba(255, 152, 0, 0.1); padding: 2px 8px; border-radius: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%;}
.status-dot { width: 8px; height: 8px; border-radius: 50%; position: absolute; top: 15px; right: 15px; }
.libre .status-dot { background-color: var(--accent-color); box-shadow: 0 0 8px var(--accent-color); }
.ocupada .status-dot { background-color: #ff5722; box-shadow: 0 0 8px #ff5722; }

/* POS COMANDA */
.pos-layout { padding: 15px; gap: 15px; box-sizing: border-box; }
.menu-section { flex: 2; background: var(--glass-bg); border: 1px solid var(--glass-border); border-radius: 16px; display: flex; flex-direction: column; padding: 15px; overflow: hidden; }

.menu-header { flex-shrink: 0; display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; border-bottom: 1px solid var(--glass-border); padding-bottom: 15px; gap: 20px; }
.btn-back { flex-shrink: 0; background: rgba(255, 255, 255, 0.05); border: 1px solid var(--glass-border); color: #fff; padding: 12px 20px; border-radius: 10px; cursor: pointer; font-weight: 500; display: flex; align-items: center; gap: 8px; white-space: nowrap; font-size: 14px;}
.btn-back:hover { background: rgba(255, 255, 255, 0.1); border-color: var(--accent-color); }

.header-tools { display: flex; align-items: center; gap: 15px; flex-wrap: nowrap; justify-content: flex-end; }
.header-tools .live-clock { flex-shrink: 0; }
.mesa-badge { background: rgba(0, 255, 204, 0.1); border: 1px solid rgba(0, 255, 204, 0.3); color: var(--accent-color); font-weight: 700; font-size: 16px; padding: 10px 20px; border-radius: 10px; white-space: nowrap; letter-spacing: 1px; text-align: center;}

/* Buscador y Categorﾃｭas */
.search-bar { background: rgba(0,0,0,0.4); border: 1px solid var(--glass-border); color: #fff; padding: 12px 15px; border-radius: 10px; font-size: 14px; width: 100%; margin-bottom: 15px; outline: none; transition: border 0.2s;}
.search-bar:focus { border-color: var(--accent-color); }
.categories-scroll { flex-shrink: 0; display: flex; gap: 10px; overflow-x: auto; padding-bottom: 15px; margin-bottom: 15px; }
.categories-scroll::-webkit-scrollbar { height: 6px; }
.categories-scroll::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); border-radius: 10px; }
.cat-btn { background: rgba(255,255,255,0.03); border: 1px solid var(--glass-border); color: var(--text-muted); padding: 12px 25px; border-radius: 12px; cursor: pointer; white-space: nowrap; font-size: 14px; font-weight: 500; }
.cat-btn.active { background: rgba(0, 255, 204, 0.1); border-color: var(--accent-color); color: #fff; }
.products-grid { flex: 1; overflow-y: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; align-content: start; padding-right: 5px; }
.product-card { background: rgba(0,0,0,0.2); border: 1px solid var(--glass-border); border-radius: 12px; padding: 15px 10px; text-align: center; cursor: pointer; display: flex; flex-direction: column; justify-content: center; min-height: 90px; }
.product-card h4 { font-size: 13px; font-weight: 500; margin-bottom: 5px; color: #fff; }
.product-card p { font-size: 14px; color: var(--accent-color); font-weight: 700; margin:0; }

/* TICKET DE COMANDA */
.ticket-section { flex: 1; min-width: 320px; background: rgba(0,0,0,0.4); border: 1px solid var(--glass-border); border-radius: 16px; display: flex; flex-direction: column; overflow: hidden; }
.ticket-header { flex-shrink: 0; padding: 15px; border-bottom: 1px solid var(--glass-border); }

/* Nuevo layout cabecera de ticket (Usuario + Pax) */
.ticket-info-top { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 10px;}
.ticket-title-group h2 { font-size: 16px; color: #fff; margin:0 0 2px 0; }
.ticket-title-group span { font-size: 11px; color: var(--accent-color); }
.pax-controls { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-muted); background: rgba(255,255,255,0.05); padding: 5px; border-radius: 8px; border: 1px solid var(--glass-border);}

.order-controls { display: flex; flex-direction: column; gap: 10px; }
.client-row { display: flex; gap: 8px; }
.control-input, .control-select { width: 100%; background: rgba(0,0,0,0.3); border: 1px solid var(--glass-border); color: #fff; padding: 12px; border-radius: 8px; font-size: 14px; outline: none; }
.control-select option { background: var(--bg-color); color: #fff; }
.btn-add-client { background: rgba(0, 255, 204, 0.1); border: 1px solid rgba(0, 255, 204, 0.3); color: var(--accent-color); width: 44px; border-radius: 8px; font-weight: bold; font-size: 18px; cursor: pointer;}

.ticket-body { flex: 1; overflow-y: auto; padding: 15px; display: flex; flex-direction: column; align-items: flex-start; }
.ticket-empty { text-align: center; width: 100%; color: var(--text-muted); margin-top: 30px; font-size: 14px; }
.ticket-row { display: flex; justify-content: space-between; align-items: center; width: 100%; margin-bottom: 15px; border-bottom: 1px dashed var(--glass-border); padding-bottom: 10px; gap: 10px;}
.ticket-row-info { flex: 1; min-width: 0; }
.ticket-row-name { font-weight: 700; font-size: 14px; color: #fff; margin-bottom: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; justify-content: space-between; align-items: center;}
.ticket-row-note { font-size: 11px; color: #ff9800; font-style: italic; margin-bottom: 3px; line-height: 1.2; white-space: normal; background: rgba(255, 152, 0, 0.1); padding: 2px 5px; border-radius: 4px; display: inline-block;}
.ticket-row-price { font-size: 11px; color: var(--text-muted); }
.ticket-row-controls { display: flex; align-items: center; gap: 8px; flex-shrink: 0;}
.btn-qty { background: rgba(255,255,255,0.05); border: 1px solid var(--glass-border); color: #fff; width: 30px; height: 30px; border-radius: 8px; cursor: pointer; font-weight: bold; font-size: 16px; display: flex; justify-content: center; align-items: center; }
.row-total { font-weight: 700; color: var(--accent-color); min-width: 50px; text-align: right; font-size: 14px;}

.ticket-footer { flex-shrink: 0; padding: 15px; border-top: 1px solid var(--glass-border); background: rgba(255,255,255,0.02); }
.tax-breakdown { display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: var(--text-muted); margin-bottom: 6px; }
.btn-toggle-tip { background: rgba(0, 255, 204, 0.1); border: 1px solid var(--accent-color); color: var(--accent-color); padding: 4px 10px; border-radius: 6px; font-size: 11px; cursor: pointer; font-weight: bold; }
.btn-toggle-tip.off { background: rgba(255, 60, 60, 0.1); border-color: #ff4d4d; color: #ff4d4d; }
.total-row { display: flex; justify-content: space-between; font-size: 22px; font-weight: 700; color: #fff; margin-bottom: 15px; margin-top: 10px; border-top: 1px solid var(--glass-border); padding-top: 10px; }

.action-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 10px; }
.btn-action { width: 100%; border: none; padding: 12px 5px; border-radius: 10px; font-size: 14px; font-weight: 700; cursor: pointer; text-align: center; }
.btn-action:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-cocina { background: rgba(255,255,255,0.1); color: #fff; border: 1px solid var(--glass-border); }
.btn-precuenta { background: rgba(255, 152, 0, 0.1); color: #ff9800; border: 1px solid rgba(255, 152, 0, 0.3); }
.btn-cobrar { background: linear-gradient(135deg, #00ffcc, #00b38f); color: #000; box-shadow: 0 5px 15px rgba(0, 255, 204, 0.2); font-size: 16px; padding: 15px;}

/* RESPONSIVIDAD Mﾃ天ILES */
@media (max-width: 900px) {
    body, html { overflow-y: auto !important; height: auto !important; min-height: 100%; }
    .spa-view { height: auto !important; min-height: 100dvh; overflow: visible !important; }
    
    .spa-view.active.center-layout { display: flex; }
    .dash-topbar { padding: 15px; }
    
    .spa-view.active.pos-layout { display: block; padding: 10px; }
    .menu-section { display: flex; height: auto; margin-bottom: 15px; overflow: visible; }
    .products-grid { max-height: none; overflow: visible; padding-bottom: 0; } 
    .ticket-section { display: flex; height: auto; overflow: visible; margin-bottom: 20px; }
    .ticket-body { max-height: none; overflow: visible; } 
    
    .menu-header { flex-direction: column; align-items: stretch; gap: 15px; }
    .header-tools { width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 10px; }
    .mesa-badge { flex: 1; }
    .btn-back { justify-content: center; }
}
@media (max-width: 480px) {
    .login-container, .staff-container { width: 95%; padding: 30px 15px; }
    .key { padding: 15px 0; font-size: 20px; }
    .keypad { gap: 10px; }
    .dash-topbar { grid-template-columns: 1fr auto; padding: 15px; }
}
/* ========================================= */
/* MGA SPEED DIAL (Menú Flotante de Mando)   */
/* ========================================= */
.mga-fab-wrapper {
    position: fixed; /* 🚀 FIX: Fijo a la pantalla, no a la página. Ideal para Drag & Drop */
    bottom: 30px;
    left: 30px;
    z-index: 99999; /* 🚀 FIX: Inmunidad total para estar por encima de los modales */
    display: flex;
    flex-direction: column-reverse; /* Crece hacia arriba */
    align-items: flex-start; /* 🚀 FIX: Asegura que el menú no flote raro si se mueve */
    gap: 15px;
}

.mga-fab-menu {
    display: flex;
    flex-direction: column-reverse;
    gap: 12px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.mga-fab-wrapper.active .mga-fab-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Botón Principal (Estilo Glassmorphism MGA) */
.mga-fab-main {
    width: 65px;
    height: 65px;
    border-radius: 50%;
    background: rgba(0, 255, 204, 0.15);
    border: 1px solid rgba(0, 255, 204, 0.4);
    color: #00ffcc;
    font-size: 28px;
    box-shadow: 0 4px 20px rgba(0,255,204,0.3);
    backdrop-filter: blur(8px);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Cuando se abre, se vuelve rojo como botón de abortar */
.mga-fab-wrapper.active .mga-fab-main {
    transform: rotate(45deg);
    background: rgba(255, 77, 77, 0.2);
    border-color: rgba(255, 77, 77, 0.5);
    color: #ff4d4d;
    box-shadow: 0 4px 20px rgba(255, 77, 77, 0.3);
}

/* Sub-botones (Las Armas del Sistema) */
.mga-fab-item {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(22, 27, 34, 0.9);
    color: #fff;
    border: 1px solid rgba(48, 54, 61, 0.8);
    padding: 10px 20px;
    border-radius: 30px;
    cursor: pointer;
    font-weight: bold;
    font-size: 14px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.5);
    backdrop-filter: blur(5px);
    transition: all 0.2s ease;
    white-space: nowrap;
}

.mga-fab-item:hover {
    background: #30363d;
    transform: scale(1.05);
}

/* ========================================= */
/* 🎨 CÓDIGOS DE COLOR NEÓN                  */
/* ========================================= */
.fab-caja { border-left: 4px solid #00ffcc; }
.fab-mando { border-left: 4px solid #a29bfe; }
.fab-bodega { border-left: 4px solid #f39c12; }
.fab-anulaciones { border-left: 4px solid #ff4d4d; } /* 🚀 El Destructor Fiscal */

/* Efecto Glow Hover Corporativo */
.fab-caja:hover { background: rgba(0, 255, 204, 0.15) !important; color: #00ffcc; }
.fab-mando:hover { background: rgba(162, 155, 254, 0.15) !important; color: #a29bfe; }
.fab-bodega:hover { background: rgba(243, 156, 18, 0.15) !important; color: #f39c12; }
.fab-anulaciones:hover { background: rgba(255, 77, 77, 0.15) !important; color: #ff4d4d; text-shadow: 0 0 8px rgba(255, 77, 77, 0.6); }


.btn-neon-red {
    background: rgba(255, 77, 77, 0.1);
    border: 1px solid #ff4d4d;
    color: #ff4d4d;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    transition: 0.3s;
}
.btn-neon-red:hover {
    background: #ff4d4d;
    color: #fff;
    box-shadow: 0 0 10px rgba(255, 77, 77, 0.6);
}

/* ========================================= */
/* 📱 HOTFIX RESPONSIVE: CABECERA DE BODEGA  */
/* ========================================= */

/* Contenedor principal de la cabecera (Topbar) */
#view-bodega-mga .dash-topbar {
    display: flex;
    justify-content: space-between; /* Desktop: Título izquierda, Botones derecha */
    align-items: center;
    flex-wrap: wrap; /* Importante: Permitir envoltura si el título es largo */
    gap: 15px;
    padding: 10px 0;
}

/* Nuevo contenedor de botones principales (Logout area) */
#view-bodega-mga .action-buttons-container {
    display: flex;
    gap: 10px; /* Espacio entre botones */
    flex-wrap: wrap; /* Importante para móvil: Permitir que los botones bajen */
    justify-content: flex-end; /* Alinear a la derecha en escritorio */
    align-items: center;
}

/* Base de estilo para los botones (Limpieza visual) */
.btn-excel { background: rgba(46, 204, 113, 0.1) !important; border-color: #2ecc71 !important; color: #2ecc71 !important; padding: 10px 15px !important; flex: 1; justify-content: center;}
.btn-pdf { background: rgba(231, 76, 60, 0.1) !important; border-color: #e74c3c !important; color: #e74c3c !important; padding: 10px 15px !important; flex: 1; justify-content: center;}
.btn-entry { background: rgba(0, 255, 204, 0.1) !important; border-color: #00ffcc !important; color: #00ffcc !important; }

/* 🔥 MEDIA QUERY PARA MÓVIL (Punto de quiebre) */
@media (max-width: 768px) {
    
    /* 1. Cambiar el topbar a COLUMNA (apilar verticalmente) */
    #view-bodega-mga .dash-topbar {
        flex-direction: column; /* Apilar Título y Botones verticalmente */
        align-items: flex-start; /* Alinear todo a la izquierda */
        text-align: left;
        margin-bottom: 30px !important;
    }

    /* 2. Ajustar el contenedor de botones para que ocupe todo el ancho */
    #view-bodega-mga .action-buttons-container {
        width: 100%;
        justify-content: flex-start; /* Alinear botones a la izquierda en móvil */
        gap: 8px; /* Menor espacio */
        flex-direction: column; /* Apilar botones verticalmente en móvil */
        align-items: stretch; /* Hacer que los botones ocupen todo el ancho */
    }

    /* 3. Hacer los botones operativos anchos en móvil */
    #view-bodega-mga .btn-logout {
        padding: 15px;
        font-size: 14px;
        width: 100%; /* Ancho completo */
        justify-content: center;
    }
    
    /* El contenedor de Excel/PDF lo mantenemos como fila pero ancho */
    #view-bodega-mga .action-buttons-container > div {
        width: 100%;
        margin-top: 10px;
    }
    
    /* Ajustar textos del título para que no se corten */
    #view-bodega-mga .dash-user .name {
        font-size: 20px;
    }
    #view-bodega-mga .dash-user .role {
        font-size: 10px;
        white-space: normal; /* Permitir envoltura del texto largo */
    }
}

/* ========================================= */
/* 🖨️ MODO IMPRESIÓN (PDF LIMPIO)            */
/* ========================================= */
@media print {
    .no-print { display: none !important; }
    body, #view-bodega-mga { background: white !important; color: black !important; }
    th { color: black !important; border-bottom: 2px solid #ccc !important; }
    td { color: black !important; }
}

/* ========================================================= */
/* 🛡️ CENTRO DE MANDO (STAFF & ADMIN)                        */
/* ========================================================= */

.mando-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100vh;
    flex-direction: column;
    background-color: #0d1117; /* Fondo oscuro sólido */
}

.mando-box {
    background-color: #161b22;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 16px;
    padding: 40px;
    width: 380px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}

.mando-back-btn {
    position: absolute; 
    top: 20px; 
    left: 20px;
    background: transparent; 
    border: none;
    color: #8b949e; 
    cursor: pointer; 
    font-size: 18px; 
    transition: 0.3s;
}

.mando-back-btn:hover { color: #f39c12; }

.mando-title { color: #a29bfe; letter-spacing: 2px; text-transform: uppercase; font-size: 18px; margin: 10px 0 5px 0; }
.mando-subtitle { color: #8b949e; font-size: 11px; letter-spacing: 1px; margin-bottom: 25px; }

.mando-pin-indicators { display: flex; gap: 15px; margin-bottom: 30px; }
.mando-pin-dot { width: 15px; height: 15px; border-radius: 50%; border: 2px solid rgba(255,255,255,0.08); background: transparent; transition: 0.2s; }
.mando-pin-dot.filled { background: #a29bfe; border-color: #a29bfe; box-shadow: 0 0 10px #a29bfe; }

.mando-numpad-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; width: 100%; margin-bottom: 25px; }
.mando-btn-numpad { background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.05); color: white; font-size: 20px; font-weight: bold; height: 60px; border-radius: 8px; cursor: pointer; transition: 0.1s; }
.mando-btn-numpad:active { background: rgba(255,255,255,0.1); transform: scale(0.95); }

.mando-actions-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; width: 100%; margin-bottom: 10px; }
.mando-btn-entrada { background: rgba(0, 255, 204, 0.05); border: 1px solid rgba(0, 255, 204, 0.2); color: #00ffcc; padding: 15px; border-radius: 8px; font-weight: bold; cursor: pointer; transition: 0.2s; }
.mando-btn-salida { background: rgba(255, 77, 77, 0.05); border: 1px solid rgba(255, 77, 77, 0.2); color: #ff4d4d; padding: 15px; border-radius: 8px; font-weight: bold; cursor: pointer; transition: 0.2s; }
.mando-btn-descanso { width: 100%; background: rgba(243, 156, 18, 0.05); border: 1px solid rgba(243, 156, 18, 0.2); color: #f39c12; padding: 15px; border-radius: 8px; font-weight: bold; cursor: pointer; margin-bottom: 25px; transition: 0.2s; }

.mando-btn-admin { background: transparent; border: none; color: #8b949e; font-size: 11px; cursor: pointer; transition: 0.3s; }
.mando-btn-admin:hover { color: #a29bfe; }

            /* ===================================================
           MÓDULO RRHH: BOTONES GIGANTES DE ASISTENCIA (BLINDADOS)
           =================================================== */
        #actionPanel { 
            transition: opacity 0.3s; 
            margin-top: 20px; 
            display: flex !important; 
            flex-direction: column !important; 
            gap: 15px !important; 
            width: 100% !important;
        }
        .btn-staff-giant {
            width: 100% !important;
            padding: 20px !important;
            font-size: 18px !important;
            font-weight: 900 !important;
            border-radius: 16px !important;
            margin: 0 !important; 
            cursor: pointer !important;
            text-transform: uppercase !important;
            box-shadow: 0 10px 25px rgba(0,0,0,0.5) !important;
            transition: transform 0.2s !important;
            display: none; /* Ocultos por defecto, el radar los enciende */
            text-align: center !important;
        }
        .btn-in-giant { 
            background: linear-gradient(135deg, #10b981, #059669) !important; 
            color: white !important; 
            border: 2px solid #34d399 !important; 
        }
        .btn-break-giant { 
            background: linear-gradient(135deg, #f59e0b, #d97706) !important; 
            color: white !important; 
            border: 2px solid #fbbf24 !important; 
        }
        .btn-out-giant { 
            background: linear-gradient(135deg, #ef4444, #dc2626) !important; 
            color: white !important; 
            border: 2px solid #f87171 !important; 
        }
        .btn-staff-giant:active { 
            transform: scale(0.95) !important; 
        }

        /* ===================================================
           MÓDULO: SIDEBAR COLAPSABLE (CORRECCIÓN ESTÉTICA)
           =================================================== */
        #sidebar {
            transition: width 0.3s ease;
            width: 260px; /* Ancho por defecto */
            overflow-x: hidden;
            z-index: 1000;
        }
        
        /* CUANDO SE ENCOGE (MODO MINI) */
        #sidebar.mini {
            width: 75px !important;
        }
        
        /* 🚀 1. El Botón Solito en la Cima */
        #sidebar.mini .sidebar-header {
            justify-content: center !important;
        }
        #sidebar.mini .sidebar-logo {
            display: none !important; /* Desaparece MGA ROS y el subtítulo */
        }
        
        /* 🚀 2. Ocultar estrictamente todos los textos y flechas */
        #sidebar.mini .nav-text, 
        #sidebar.mini .flecha-drop {
            display: none !important;
        }
        
        /* 🚀 3. Centrar únicamente los Iconos */
        #sidebar.mini .nav-item {
            justify-content: center !important;
            padding: 15px 0 !important;
        }
        #sidebar.mini .nav-icon {
            margin: 0 !important;
            font-size: 22px !important;
            display: block !important;
            text-align: center !important;
        }
        
        /* Forza ocultar submenús abiertos al colapsar */
        #sidebar.mini .nav-dropdown > div {
            display: none !important;
        }
        /* ===================================================
           AJUSTE GLOBAL DEL CONTENEDOR DERECHO
           =================================================== */
        /* Aseguramos que el contenedor de las vistas tenga transición suave */
        #sidebar + div {
            transition: margin-left 0.3s ease, width 0.3s ease !important;
        }

        /* Cuando el body tiene la bandera de 'colapsado', el contenedor derecho se estira */
        body.sidebar-colapsado #sidebar + div {
            margin-left: 75px !important;
            width: calc(100% - 75px) !important;
        }
        
        #btn-add-suborder:hover {
    background: var(--accent-color);
    color: #000;
    box-shadow: 0 0 15px var(--accent-color);
    transform: scale(1.1);
}
    
    /* Solo brilla si la mesa ya tiene una orden activa Para agregar subordenes */
    @keyframes neon-pulse {
        0% { box-shadow: 0 0 5px rgba(0, 255, 204, 0.2); }
        50% { box-shadow: 0 0 15px rgba(0, 255, 204, 0.6); }
        100% { box-shadow: 0 0 5px rgba(0, 255, 204, 0.2); }
    }
    .pulse-neon {
        animation: neon-pulse 2s infinite;
    }
    /* 🚫 EFECTO AGOTADO ELEGANTE (MÓDULO 86) */
    .producto-agotado {
        opacity: 0.5 !important;
        filter: grayscale(100%);
        pointer-events: none !important; /* Bloqueo táctil */
        position: relative;
        overflow: hidden;
    }
    .producto-agotado::before {
        content: "AGOTADO";
        position: absolute;
        top: 8px;
        right: 8px;
        background: #ff4757;
        color: #fff;
        font-size: 10px;
        font-weight: 900;
        padding: 4px 8px;
        border-radius: 4px;
        z-index: 10;
        letter-spacing: 1px;
        box-shadow: 0 2px 5px rgba(0,0,0,0.5);
    }