:root {
    --primary: #e63946;
    --primary-dark: #d62839;
    --secondary: #1d3557;
    --light: #f8f9fa;
    --dark: #212529;
    --success: #2a9d8f;
    --warning: #e9c46a;
    --radius: 1rem;
    --shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    --shadow-sm: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

body {
    background-color: #f0f2f5;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    color: var(--dark);
}

/* Tarjetas y Contenedores */
.card-saas {
    background: white;
    border: none;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card-saas:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

/* Botones Personalizados */
.btn-primary {
    background-color: var(--primary);
    border-color: var(--primary);
}

.btn-primary:hover, .btn-primary:active, .btn-primary:focus {
    background-color: var(--primary-dark) !important;
    border-color: var(--primary-dark) !important;
}

.btn-outline-primary {
    color: var(--primary);
    border-color: var(--primary);
}

.btn-outline-primary:hover {
    background-color: var(--primary);
    color: white;
}

/* Sidebar Responsive */
.sidebar {
    height: 100vh;
    width: 280px;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1050;
    background-color: var(--secondary);
    color: white;
    transition: all 0.3s ease;
    overflow-y: auto;
}

.sidebar .nav-link {
    color: rgba(255, 255, 255, 0.8);
    padding: 0.8rem 1.5rem;
    border-radius: 0 2rem 2rem 0;
    margin-right: 1rem;
    transition: all 0.2s;
}

.sidebar .nav-link:hover, .sidebar .nav-link.active {
    color: white;
    background-color: rgba(255, 255, 255, 0.1);
    font-weight: 600;
}

.sidebar .nav-link i {
    margin-right: 0.8rem;
    font-size: 1.1rem;
}

.main-content {
    margin-left: 280px;
    padding: 2rem;
    transition: all 0.3s ease;
    width: calc(100% - 280px);
}

/* Modo Mobile */
@media (max-width: 991.98px) {
    .sidebar {
        margin-left: -280px; /* Oculto por defecto */
    }
    
    .sidebar.active {
        margin-left: 0;
    }

    .main-content {
        margin-left: 0;
        width: 100%;
        padding: 1rem;
    }

    .overlay {
        display: none;
        position: fixed;
        width: 100%;
        height: 100%;
        top: 0;
        left: 0;
        background: rgba(0,0,0,0.5);
        z-index: 1040;
    }
    
    .overlay.active {
        display: block;
    }
}

/* --- DISEÑO DE MESAS (ALTO IMPACTO VISUAL) --- */
.mesa-card {
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    height: 150px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    border-radius: 24px;
    border: none;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.mesa-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 12px 25px rgba(0,0,0,0.2);
}

/* Mesa LIBRE: VERDE LIMA BRILLANTE (MÁXIMA VISIBILIDAD) */
.mesa-libre {
    background-color: #2ecc71 !important; /* Verde Esmeralda/Lima brillante */
    background-image: linear-gradient(135deg, #2ecc71 0%, #27ae60 100%) !important;
    color: white !important;
    border: 4px solid rgba(255,255,255,0.3);
    box-shadow: 0 8px 20px rgba(46, 204, 113, 0.3);
}

/* Mesa OCUPADA: ROJO VIBRANTE */
.mesa-ocupada {
    background-color: #e74c3c !important; /* Rojo intenso */
    background-image: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%) !important;
    color: white !important;
    border: 4px solid rgba(255,255,255,0.3);
    box-shadow: 0 8px 20px rgba(231, 76, 60, 0.3);
}

.btn-dashboard-top {
    background: var(--secondary);
    color: white;
    border-radius: 50px;
    padding: 8px 20px;
    font-weight: bold;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
    border: 1px solid rgba(255,255,255,0.2);
}

.btn-dashboard-top:hover {
    background: #2c3e50;
    color: #00ff88;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

.mesa-num {
    font-size: 3.8rem;
    font-weight: 900;
    margin: 0;
    padding: 0;
    line-height: 1;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
}

.mesa-status-badge {
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(4px);
    color: white;
    padding: 6px 16px;
    border-radius: 50px;
    margin-top: 8px;
    letter-spacing: 0.5px;
    border: 1px solid rgba(255,255,255,0.3);
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 5px;
}

.mesa-libre .status-dot {
    background-color: #00ff88;
    box-shadow: 0 0 10px #00ff88;
    animation: pulse-green 2s infinite;
}

.mesa-ocupada .status-dot {
    background-color: #ffffff;
    box-shadow: 0 0 10px #ffffff;
}

@keyframes pulse-green {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(0, 255, 136, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 10px rgba(0, 255, 136, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(0, 255, 136, 0); }
}

.mesa-icon-top {
    position: absolute;
    top: 15px;
    right: 18px;
    font-size: 1.2rem;
    opacity: 0.8;
}

/* Header Móvil */
.mobile-header {
    display: none;
    background-color: var(--secondary);
    color: white;
    padding: 1rem;
    align-items: center;
    justify-content: space-between;
}

@media (max-width: 991.98px) {
    .mobile-header {
        display: flex;
        position: sticky;
        top: 0;
        z-index: 1030;
    }
}

/* Floating Action Button (FAB) para Carrito en móvil */
.fab-cart {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: var(--primary);
    color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 24px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    z-index: 2000;
    display: none; /* Solo visible en POS móvil cuando hay items */
}

.fab-cart:hover {
    background-color: var(--primary-dark);
    color: white;
}
