:root {
    /* Palette Wal3aa High-Contrast */
    --primary: #FF5722;
    --primary-light: #FF8A65;
    --primary-glow: rgba(255, 87, 34, 0.3);
    --bg: #0A0A0B;
    --card: #161618;
    --glass: rgba(255, 255, 255, 0.05);
    --glass-heavy: rgba(20, 20, 22, 0.85);
    --text: #F5F5F7;
    --text-dim: #A1A1AA;
    --success: #10B981;
    --danger: #EF4444;
    --info: #3B82F6;
    --accent: #F59E0B;
}

* {
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    margin: 0;
    line-height: 1.5;
    touch-action: manipulation;
    /* Empêche le zoom auto sur mobile */
}

/* --- UTILITAIRES DE DESIGN --- */
.glass {
    background: var(--glass);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
}

.shadow-fire {
    box-shadow: 0 10px 30px rgba(255, 87, 34, 0.15), 0 0 20px var(--primary-glow);
}

/* --- BOUTONS TACTILES --- */
button {
    border: none;
    border-radius: 14px;
    padding: 14px 20px;
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    width: 100%;
}

button:active {
    transform: scale(0.94);
    filter: brightness(1.2);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: white;
    box-shadow: 0 4px 15px rgba(255, 87, 34, 0.3);
}

.btn-outline {
    background: rgba(255, 255, 255, 0.03);
    color: var(--text);
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.btn-quick-add {
    background: var(--glass);
    border: 1px solid var(--primary-light);
    color: white;
    padding: 10px 18px;
    border-radius: 12px;
    white-space: nowrap;
    width: auto;
    font-size: 0.85rem;
}

/* --- GRILLE DES TABLES --- */
.grid-layout {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(105px, 1fr));
    gap: 14px;
    padding: 16px;
}

.table-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 110px;
    border-radius: 22px;
    transition: 0.3s all ease;
    cursor: pointer;
    text-align: center;
}

/* Table Vide (État par défaut) */
.table-box.empty {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    color: #444;
    /* Texte grisé pour les tables vides */
}

.table-box.empty b {
    opacity: 0.5;
}

/* Table Occupée (État Actif) */
.table-box.active {
    background: linear-gradient(145deg, #1e1e20, #161618);
    border: 2px solid var(--primary);
    color: var(--primary);
    box-shadow: 0 0 20px rgba(255, 87, 34, 0.25);
    animation: pulse-active 2s infinite ease-in-out;
}

.table-box.active span {
    color: var(--success);
    /* Petit point ou texte "OCCUPÉE" en vert ou orange */
}

@keyframes pulse-active {
    0% {
        transform: scale(1);
        box-shadow: 0 0 10px rgba(255, 87, 34, 0.2);
    }

    50% {
        transform: scale(1.03);
        box-shadow: 0 0 25px rgba(255, 87, 34, 0.4);
    }

    100% {
        transform: scale(1);
        box-shadow: 0 0 10px rgba(255, 87, 34, 0.2);
    }
}

/* --- ALERTES URGENTES (Notifications Serveur) --- */
@keyframes pulse-urgent {
    0% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.6);
    }

    100% {
        box-shadow: 0 0 0 15px rgba(239, 68, 68, 0);
    }
}

.urgent-anim {
    animation: pulse-urgent 1.2s infinite;
    border: 1px solid var(--danger) !important;
    background: rgba(239, 68, 68, 0.1) !important;
}

/* --- MODALES & TICKETS --- */
.modal {
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.ticket-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px dashed rgba(255, 255, 255, 0.1);
    font-size: 0.95rem;
}

.ticket-item b {
    color: var(--primary-light);
}

/* --- SCROLLBARS (Look Mobile App) --- */
#quick-menu-server::-webkit-scrollbar,
#panier-liste::-webkit-scrollbar,
#admin-menu-list::-webkit-scrollbar {
    display: none;
}

#quick-menu-server {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* --- INPUTS & ADMIN --- */
input,
select,
textarea {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    padding: 12px;
    border-radius: 12px;
    font-family: inherit;
    font-size: 1rem;
    outline: none;
    transition: 0.3s;
}

input:focus {
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.12);
}

.admin-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: rgba(255, 255, 255, 0.03);
    margin-bottom: 8px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

/* --- IMPRESSION QR --- */
@media print {
    body * {
        visibility: hidden;
    }

    #qrcode-result-container,
    #qrcode-result,
    #qrcode-result *,
    #qr-info-text {
        visibility: visible;
    }

    #qrcode-result-container {
        position: absolute;
        left: 0;
        top: 0;
        width: 100vw;
        text-align: center;
    }
}