/**
 * MayGestCaisse - Module Restaurant
 * Styles CSS centralises pour le module restaurant, cuisine et reservations
 * Version: 24.04.00
 */

/* ==========================================================================
   VARIABLES ET COULEURS
   ========================================================================== */
:root {
    --rest-vert: #28a745;
    --rest-rouge: #dc3545;
    --rest-jaune: #ffc107;
    --rest-bleu: #007bff;
    --rest-gris: #6c757d;
    --rest-cyan: #17a2b8;
    --rest-fond: #f8f9fa;
    --rest-bordure: #ddd;
}

/* ==========================================================================
   COMPOSANTS COMMUNS
   ========================================================================== */

/* Badges de statut */
.badge {
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9em;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}
.badge-success {
    background: linear-gradient(135deg, #27ae60 0%, #2ecc71 100%);
    color: white;
}
.badge-danger {
    background: linear-gradient(135deg, #e74c3c 0%, #ec7063 100%);
    color: white;
}
.badge-warning {
    background: linear-gradient(135deg, #f39c12 0%, #f1c40f 100%);
    color: white;
}
.badge-secondary {
    background: linear-gradient(135deg, #9b59b6 0%, #a569bd 100%);
    color: white;
}
.badge-info {
    background: linear-gradient(135deg, #3498db 0%, #5dade2 100%);
    color: white;
}

/* Boutons */
.btn-sm {
    padding: 5px 10px;
    font-size: 0.85em;
}
.btn-lg {
    padding: 15px 30px;
    font-size: 1.1em;
}

/* Formulaires */
.form-restaurant {
    /* max-width: 600px; */
}
.form-group {
    margin-bottom: 20px;
}
.form-group label {
    display: block;
    margin-bottom: 10px;
    font-weight: bold;
}
.form-control {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--rest-bordure);
    border-radius: 5px;
}
.form-actions {
    margin-top: 30px;
    display: flex;
    gap: 10px;
}
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}
.form-control:focus {
    border-color: var(--rest-bleu);
    outline: none;
}
.form-text {
    font-size: 0.85em;
    color: #666;
}
.form-check {
    margin: 5px 0;
}
.form-check input {
    margin-right: 10px;
}
.capacite-info {
    color: #666;
}
.capacite-info.warning {
    color: var(--rest-rouge);
}

/* Liste des reservations dans formulaire */
.reservations-list {
    background: var(--rest-fond);
    padding: 15px;
    border-radius: 5px;
}
.reservation-item {
    background: white;
    border-radius: 5px;
    border: 1px solid var(--rest-bordure);
}

/* Formulaire reservation */
.form-reservation {
    max-width: 700px;
}

/* Headers */
.restaurant-header,
.commande-header,
.addition-header,
.reservation-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    padding: 15px 0;
}
.restaurant-header h1,
.reservation-header h1 {
    color: #2c3e50;
    font-size: 1.8em;
    font-weight: 700;
    margin: 0;
}

/* Actions */
.restaurant-actions,
.commande-actions-top,
.reservation-actions,
.calendrier-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 25px;
}

/* Boutons d'action principaux (style moderne) */
.restaurant-actions .btn,
.reservation-actions .btn,
.calendrier-actions .btn,
.commande-actions-top a {
    padding: 12px 24px;
    font-size: 1em;
    font-weight: 600;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    transition: all 0.25s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    text-transform: none;
    letter-spacing: 0.3px;
}
.restaurant-actions .btn:hover,
.reservation-actions .btn:hover,
.calendrier-actions .btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.25);
}
/* + Nouvelle table - Bleu électrique */
.restaurant-actions .btn-primary,
.reservation-actions .btn-primary {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: white;
}
.restaurant-actions .btn-primary:hover {
    background: linear-gradient(135deg, #5dade2 0%, #3498db 100%);
}
/* Ecran Cuisine - Orange vif */
.restaurant-actions .btn-warning {
    background: linear-gradient(135deg, #6D6D73 0%, #1A1A2E 100%);
    color: white;
}
.restaurant-actions .btn-warning:hover {
    background: linear-gradient(135deg, #99999c 0%, #272736 100%);
}
/* Reservations - Turquoise */
.restaurant-actions .btn-info,
.reservation-actions .btn-info {
    background: linear-gradient(135deg, #1abc9c 0%, #16a085 100%);
    color: white;
}
.restaurant-actions .btn-info:hover,
.reservation-actions .btn-info:hover {
    background: linear-gradient(135deg, #48c9b0 0%, #1abc9c 100%);
}
.restaurant-actions .btn-secondary,
.reservation-actions .btn-secondary {
    background: linear-gradient(135deg, #7f8c8d 0%, #636e72 100%);
    color: white;
}
.restaurant-actions .btn-secondary:hover {
    background: linear-gradient(135deg, #95a5a6 0%, #7f8c8d 100%);
}

/* Stats - Couleurs distinctives pour chaque stat */
.restaurant-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}
.stat-item {
    padding: 10px 18px;
    border-radius: 25px;
    font-size: 0.95em;
    font-weight: 500;
    box-shadow: 0 3px 10px rgba(0,0,0,0.15);
    color: white;
}
.stat-item strong {
    font-size: 1.3em;
    font-weight: 700;
}
/* Couverts - Violet */
.stat-item:nth-child(1) {
    background: linear-gradient(135deg, #8e44ad 0%, #9b59b6 100%);
}
/* Tables occupées - Rouge/Orange */
.stat-item:nth-child(2) {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
}
/* Tables libres - Vert */
.stat-item:nth-child(3) {
    background: linear-gradient(135deg, #27ae60 0%, #2ecc71 100%);
}
.stat-badge {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: white;
    padding: 10px 20px;
    border-radius: 25px;
    font-weight: 600;
    box-shadow: 0 3px 10px rgba(52,152,219,0.4);
}

/* ==========================================================================
   GRILLE DES TABLES
   ========================================================================== */
.tables-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 24px;
    margin-top: 25px;
}

.table-card {
    border-radius: 16px;
    padding: 20px;
    background: #fff;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    border: none;
    position: relative;
    overflow: hidden;
}
.table-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: var(--rest-bordure);
}
.table-card:hover {
    box-shadow: 0 8px 25px rgba(0,0,0,0.12);
    transform: translateY(-4px);
}

/* Couleurs par statut - Palette harmonieuse */
.table-libre::before { background: linear-gradient(90deg, #27ae60, #2ecc71); }
.table-libre {
    border-left: none;
    background: linear-gradient(180deg, #f0fff4 0%, #fff 100%);
}

.table-occupee::before { background: linear-gradient(90deg, #e74c3c, #ec7063); }
.table-occupee { background: linear-gradient(180deg, #fdf2f2 0%, #fff 100%); }

.table-reservee::before { background: linear-gradient(90deg, #f39c12, #f1c40f); }
.table-reservee { background: linear-gradient(180deg, #fef9e7 0%, #fff 100%); }

.table-a_nettoyer::before { background: linear-gradient(90deg, #9b59b6, #a569bd); }
.table-a_nettoyer { background: linear-gradient(180deg, #f5eef8 0%, #fff 100%); }

.table-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
    padding-top: 5px;
}
.table-numero {
    font-size: 1.35em;
    font-weight: 700;
    color: #2c3e50;
    line-height: 1.2;
}
.table-capacite {
    background: #e9ecef;
    color: #495057;
    font-size: 0.85em;
    font-weight: 500;
    padding: 4px 10px;
    border-radius: 20px;
}
.table-body {
    min-height: 50px;
    margin-bottom: 15px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.table-statut {
    text-align: center;
}
.table-statut .badge {
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9em;
    font-weight: 600;
    letter-spacing: 0.5px;
}
.table-statut small {
    display: block;
    margin-top: 8px;
    color: #6c757d;
    font-size: 0.85em;
}
.table-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding-top: 15px;
    border-top: 1px solid #eee;
}
.table-actions .btn {
    flex: 1;
    min-width: 90px;
    padding: 10px 14px;
    font-size: 0.9em;
    font-weight: 600;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: all 0.25s ease;
    text-align: center;
    text-decoration: none;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
.table-actions .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}
/* Ouvrir service - Vert émeraude */
.table-actions .btn-success {
    background: linear-gradient(135deg, #27ae60 0%, #2ecc71 100%);
    color: white;
}
.table-actions .btn-success:hover {
    background: linear-gradient(135deg, #2ecc71 0%, #58d68d 100%);
}
/* Commande - Bleu */
.table-actions .btn-primary {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: white;
}
.table-actions .btn-primary:hover {
    background: linear-gradient(135deg, #5dade2 0%, #3498db 100%);
}
/* Addition - Turquoise */
.table-actions .btn-info {
    background: linear-gradient(135deg, #1abc9c 0%, #16a085 100%);
    color: white;
}
.table-actions .btn-info:hover {
    background: linear-gradient(135deg, #48c9b0 0%, #1abc9c 100%);
}
/* Modifier - Gris élégant avec bordure */
.table-actions .btn-outline-secondary {
    background: white;
    border: 2px solid #bdc3c7;
    color: #7f8c8d;
}
.table-actions .btn-outline-secondary:hover {
    background: #ecf0f1;
    border-color: #95a5a6;
    color: #5d6d7e;
}
/* Marquer libre - Gris */
.table-actions .btn-secondary {
    background: linear-gradient(135deg, #95a5a6 0%, #7f8c8d 100%);
    color: white;
}
.table-actions .btn-secondary:hover {
    background: linear-gradient(135deg, #bdc3c7 0%, #95a5a6 100%);
}
.table-actions .btn-sm {
    padding: 8px 12px;
    font-size: 0.85em;
}

/* Selection de tables (transfert/fusion) */
.tables-selection {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
}
.table-option {
    display: block;
    cursor: pointer;
}
.table-option input {
    display: none;
}
.table-option-content {
    display: block;
    padding: 15px;
    border: 2px solid var(--rest-vert);
    border-radius: 10px;
    text-align: center;
    transition: all 0.2s;
}
.table-option input:checked + .table-option-content {
    background: var(--rest-vert);
    color: white;
}
.table-option-content strong {
    display: block;
}
.table-option-content small {
    color: #666;
}
.table-option input:checked + .table-option-content small {
    color: rgba(255,255,255,0.8);
}

/* Selection de services (fusion) */
.services-selection {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 10px;
}
.service-option {
    display: block;
    cursor: pointer;
}
.service-option input {
    display: none;
}
.service-option-content {
    display: block;
    padding: 15px;
    border: 2px solid var(--rest-cyan);
    border-radius: 10px;
    text-align: center;
    transition: all 0.2s;
}
.service-option input:checked + .service-option-content {
    background: var(--rest-cyan);
    color: white;
}
.service-option-content strong {
    display: block;
    font-size: 1.1em;
}
.service-option-content span {
    display: block;
    margin: 5px 0;
}
.service-option-content small {
    color: #666;
}
.service-option input:checked + .service-option-content small {
    color: rgba(255,255,255,0.8);
}

/* Info fusion */
.fusion-info-box {
    background: #e7f3ff;
    border-left: 4px solid var(--rest-bleu);
    padding: 15px;
    margin-bottom: 20px;
}
.fusion-info-box ul {
    margin: 10px 0 0 20px;
}

/* ==========================================================================
   PRISE DE COMMANDE
   ========================================================================== */
.commande-total {
    text-align: right;
}
.commande-total .montant {
    display: block;
    font-size: 2em;
    font-weight: bold;
    color: var(--rest-vert);
}
.commande-container {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
    margin-top: 20px;
}

/* Panneau articles */
.articles-panel,
.panier-panel {
    background: var(--rest-fond);
    padding: 15px;
    border-radius: 10px;
}
.categories-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-bottom: 15px;
}
.cat-tab {
    padding: 8px 15px;
    border: 1px solid var(--rest-bordure);
    background: white;
    border-radius: 20px;
    cursor: pointer;
}
.cat-tab.active {
    background: var(--rest-bleu);
    color: white;
    border-color: var(--rest-bleu);
}
.articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 10px;
    max-height: 400px;
    overflow-y: auto;
    padding-top: 15px;
    border-top: 1px solid #ccc;
}
.article-item {
    background: white;
    padding: 10px;
    border-radius: 5px;
    cursor: pointer;
    text-align: center;
    border: 2px solid var(--rest-bordure);
    transition: all 0.2s;
}
.article-item:hover {
    border-color: var(--rest-bleu);
    transform: scale(1.02);
}
.article-item.article-epuise {
    opacity: 0.5;
    pointer-events: none;
    background: #e9ecef;
    position: relative;
}
.article-item.article-epuise:hover {
    transform: none;
    border-color: var(--rest-bordure);
}
.article-stock-epuise {
    display: block;
    font-size: 0.85em;
    color: #fff;
    background: var(--rest-rouge);
    font-weight: bold;
    margin-top: 6px;
    padding: 2px 8px;
    border-radius: 3px;
    text-align: center;
}
.article-nom {
    display: block;
    font-weight: bold;
    font-size: 0.9em;
}
.article-prix {
    display: block;
    color: var(--rest-vert);
    font-size: 0.85em;
}

/* Panier */
.panier-lignes {
    min-height: 200px;
    background: white;
    padding: 10px;
    border-radius: 5px;
    margin-bottom: 10px;
}
.panier-vide {
    color: #999;
    text-align: center;
    padding: 50px 0;
}
.panier-ligne {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px;
    border-bottom: 1px solid #eee;
}
.panier-ligne-qte {
    display: flex;
    align-items: center;
    gap: 5px;
}
.panier-ligne-qte button {
    width: 25px;
    height: 25px;
    border: none;
    background: #ddd;
    cursor: pointer;
    border-radius: 3px;
}
.panier-ligne-notes {
    width: 100%;
    padding: 5px;
    border: 1px solid var(--rest-bordure);
    border-radius: 3px;
    margin-top: 5px;
    font-size: 0.85em;
}
.panier-notes textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--rest-bordure);
    border-radius: 5px;
}
.panier-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 15px;
}

/* Historique des envois */
.envois-historique {
    margin-top: 30px;
}
.envoi-card {
    background: white;
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 10px;
    border-left: 4px solid var(--rest-bordure);
}
.envoi-envoye { border-left-color: var(--rest-jaune); }
.envoi-en_preparation { border-left-color: var(--rest-cyan); }
.envoi-pret { border-left-color: var(--rest-vert); }
.envoi-servi { border-left-color: var(--rest-gris); }
.envoi-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
}
.envoi-lignes {
    margin: 0;
    padding-left: 20px;
}

/* ==========================================================================
   ADDITION
   ========================================================================== */
.addition-container {
    max-width: 600px;
    margin: 0 auto;
}
.table-addition {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}
.table-addition th,
.table-addition td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid var(--rest-bordure);
}
.table-addition th {
    background: var(--rest-fond);
}
.table-addition td:last-child,
.table-addition th:last-child {
    text-align: right;
}
.total-row {
    font-size: 1.3em;
    background: var(--rest-fond);
}
.total-row td {
    border-top: 2px solid #333;
}
.par-personne {
    color: #666;
    font-style: italic;
}
.fusion-info {
    background: #e9ecef;
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 20px;
}
.addition-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Lignes en rupture ou annulées dans l'addition */
.ligne-rupture-addition,
.ligne-annulee-addition {
    opacity: 0.6;
    text-decoration: line-through;
    background: #f8d7da;
}
.ligne-annulee-addition {
    background: #fff3cd;
}
.badge-rupture,
.badge-annule {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.75em;
    font-weight: bold;
    text-decoration: none;
}
.badge-rupture {
    background: var(--rest-rouge);
    color: white;
}
.badge-annule {
    background: var(--rest-jaune);
    color: #333;
}

/* Impression */
@media print {
    /* Masquer tout sauf le contenu de l'addition */
    .addition-actions,
    .alert:not(.case-general),
    nav,
    header,
    footer,
    .restaurant-actions,
    .commande-actions-top,
    .navbar,
    .hb,
    .card-header,
    .cadresystememultiartisans,
    #menunavigation,
    .collapse {
        display: none !important;
    }

    body {
        margin: 0 !important;
        padding: 0 !important;
    }

    .main-content {
        margin: 0 !important;
        padding: 0 !important;
    }

    .case-general,
    #welcome {
        border: none !important;
        padding: 0 !important;
        margin: 0 !important;
        min-height: auto !important;
    }

    /* En-tete de l'addition */
    .addition-header {
        text-align: center !important;
        margin-bottom: 20px !important;
        padding-bottom: 15px !important;
        border-bottom: 2px solid #000 !important;
    }

    .addition-header h2 {
        font-size: 18pt !important;
        margin-bottom: 5px !important;
    }

    .addition-header p {
        font-size: 11pt !important;
        color: #333 !important;
    }

    h1 {
        text-align: center !important;
        font-size: 22pt !important;
        margin-bottom: 10px !important;
    }

    /* Tableau de l'addition */
    .addition-container {
        max-width: 100% !important;
    }

    .table-addition {
        width: 100% !important;
        border-collapse: collapse !important;
        font-size: 11pt !important;
    }

    .table-addition thead tr {
        border-bottom: 2px solid #000 !important;
    }

    .table-addition th {
        padding: 8px 12px !important;
        font-weight: bold !important;
        text-align: left !important;
    }

    .table-addition td {
        padding: 6px 12px !important;
    }

    .table-addition tbody tr {
        border-bottom: 1px solid #ccc !important;
    }

    .table-addition tfoot .total-row {
        border-top: 2px solid #000 !important;
    }

    .table-addition tfoot .total-row td {
        padding-top: 12px !important;
        font-size: 14pt !important;
    }

    .table-addition tfoot .par-personne td {
        font-size: 10pt !important;
        font-style: italic !important;
        color: #555 !important;
    }

    /* Infos fusion */
    .fusion-info {
        margin-top: 15px !important;
        font-size: 10pt !important;
        color: #555 !important;
    }
}

/* ==========================================================================
   ECRAN CUISINE (KDS)
   ========================================================================== */
.cuisine-body {
    background: #1a1a2e !important;
}
.cuisine-container {
    min-height: 100vh;
    color: white;
    padding: 20px;
}
.cuisine-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
    background: #16213e;
    border-radius: 10px;
    margin-bottom: 20px;
}
.cuisine-header h1 {
    margin: 0;
    font-size: 2em;
}
.cuisine-stats {
    font-size: 1.2em;
}
.cuisine-stats #count-attente {
    color: var(--rest-jaune);
    font-weight: bold;
    font-size: 1.5em;
}
.cuisine-stats #count-prets {
    color: var(--rest-vert);
    font-weight: bold;
    font-size: 1.5em;
}
.separator {
    margin: 0 15px;
    color: #666;
}
.cuisine-time {
    font-size: 2em;
    font-family: monospace;
}
.cuisine-content {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
}
.cuisine-section h2 {
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #333;
}
.commandes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 15px;
}
.section-prets {
    background: rgba(40, 167, 69, 0.1);
    padding: 15px;
    border-radius: 10px;
}
.section-prets .commandes-grid {
    grid-template-columns: 1fr;
}
.commande-card {
    background: #16213e;
    border-radius: 10px;
    padding: 15px;
    border-left: 5px solid var(--rest-jaune);
    transition: all 0.3s;
}
.commande-card.en-preparation {
    border-left-color: var(--rest-cyan);
    animation: pulse 2s infinite;
}
.commande-card.en-retard {
    border-left-color: var(--rest-rouge);
    background: #2d1f1f;
    animation: blink 1s infinite;
}
.commande-card.pret {
    border-left-color: var(--rest-vert);
    background: #1f2d1f;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.8; }
}
@keyframes blink {
    0%, 100% { background: #2d1f1f; }
    50% { background: #3d2020; }
}

.table-name {
    font-size: 1.5em;
    font-weight: bold;
}
.envoi-time {
    color: #aaa;
}
.pret-badge {
    background: var(--rest-vert);
    color: white;
    padding: 5px 15px;
    border-radius: 20px;
    font-weight: bold;
    animation: glow 1s infinite alternate;
}
@keyframes glow {
    from { box-shadow: 0 0 5px var(--rest-vert); }
    to { box-shadow: 0 0 20px var(--rest-vert); }
}
.commande-timer {
    text-align: center;
    font-size: 1.8em;
    margin: 10px 0;
}
.commande-timer .timer-value {
    font-weight: bold;
}
.en-retard .commande-timer {
    color: var(--rest-rouge);
}
.commande-lignes {
    list-style: none;
    padding: 0;
    margin: 15px 0;
}
.commande-lignes li {
    padding: 8px 0;
    border-bottom: 1px solid #333;
    font-size: 1.1em;
}
.commande-lignes li:last-child {
    border-bottom: none;
}
.commande-lignes .qte {
    display: inline-block;
    width: 40px;
    font-weight: bold;
    color: var(--rest-jaune);
}
.commande-lignes .notes {
    display: block;
    color: #ff6b6b;
    font-style: italic;
    margin-left: 40px;
    font-size: 0.9em;
}
.commande-lignes .entree { border-left: 3px solid var(--rest-cyan); padding-left: 10px; }
.commande-lignes .plat { border-left: 3px solid var(--rest-jaune); padding-left: 10px; }
.commande-lignes .dessert { border-left: 3px solid #e83e8c; padding-left: 10px; }
.commande-lignes .boisson { border-left: 3px solid #6f42c1; padding-left: 10px; }
.commande-notes {
    background: #0f3460;
    padding: 10px;
    border-radius: 5px;
    font-style: italic;
    margin-bottom: 10px;
}
.commande-actions {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}
.btn-action {
    flex: 1;
    padding: 15px;
    border: none;
    border-radius: 5px;
    font-size: 1.1em;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-preparer {
    background: var(--rest-cyan);
    color: white;
}
.btn-pret {
    background: var(--rest-vert);
    color: white;
}
.btn-servi {
    background: var(--rest-gris);
    color: white;
}
.btn-action:hover {
    transform: scale(1.05);
}
.no-commandes {
    text-align: center;
    padding: 50px;
    color: #666;
    font-size: 1.2em;
}

/* Rupture de stock - Cuisine */
.btn-rupture {
    background: transparent;
    border: 1px solid var(--rest-rouge);
    color: var(--rest-rouge);
    padding: 2px 8px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 0.9em;
    margin-left: 10px;
    transition: all 0.2s;
}
.btn-rupture:hover {
    background: var(--rest-rouge);
    color: white;
}
.ligne-rupture {
    opacity: 0.5;
    text-decoration: line-through;
    background: rgba(220, 53, 69, 0.2);
    padding: 5px;
    border-radius: 3px;
}
.rupture-badge {
    display: block;
    background: var(--rest-rouge);
    color: white;
    padding: 3px 8px;
    border-radius: 3px;
    font-size: 0.8em;
    margin-top: 5px;
    font-style: normal;
}

/* Modal rupture */
.modal-rupture {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}
.modal-rupture-content {
    background: #16213e;
    padding: 25px;
    border-radius: 15px;
    width: 90%;
    max-width: 450px;
    border: 2px solid var(--rest-rouge);
}
.modal-rupture-content h3 {
    margin-top: 0;
    color: var(--rest-rouge);
    font-size: 1.4em;
}
.modal-rupture-content p {
    color: #fff;
    margin-bottom: 15px;
}
.motifs-rapides {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 15px;
}
.motifs-rapides button {
    background: #0f3460;
    border: 1px solid #333;
    color: white;
    padding: 8px 12px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9em;
    transition: all 0.2s;
}
.motifs-rapides button:hover {
    background: #1a4a7a;
    border-color: var(--rest-bleu);
}
.modal-rupture-content textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #333;
    border-radius: 5px;
    background: #0f3460;
    color: white;
    font-size: 1em;
    resize: vertical;
}
.modal-rupture-content textarea::placeholder {
    color: #666;
}
.modal-rupture-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}
.modal-rupture-actions button {
    flex: 1;
    padding: 15px;
    border: none;
    border-radius: 5px;
    font-size: 1em;
    font-weight: bold;
    cursor: pointer;
}
.btn-annuler {
    background: #333;
    color: white;
}
.btn-confirmer {
    background: var(--rest-rouge);
    color: white;
}
.btn-annuler:hover {
    background: #444;
}
.btn-confirmer:hover {
    background: #c82333;
}

/* Commande avec ruptures */
.commande-card.avec-ruptures {
    border-left-color: var(--rest-rouge);
    background: linear-gradient(135deg, #2d1f1f 0%, #1a1a2e 100%);
}
.rupture-warning {
    background: var(--rest-rouge);
    color: white;
    padding: 8px 15px;
    border-radius: 5px;
    font-weight: bold;
    text-align: center;
    width: 100%;
    margin-bottom: 10px;
}
.btn-action.btn-annuler-envoi {
    background: var(--rest-rouge);
    color: white;
}
.btn-action.btn-annuler-envoi:hover {
    background: #c82333;
}

/* ==========================================================================
   RESERVATIONS
   ========================================================================== */
.reservation-filters {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 15px;
    background: var(--rest-fond);
    border-radius: 5px;
}
.filter-form {
    display: flex;
    align-items: center;
    gap: 10px;
}
.filter-form input[type="date"] {
    padding: 8px;
    border: 1px solid var(--rest-bordure);
    border-radius: 5px;
}
.search-box {
    position: relative;
}
.search-box input {
    padding: 8px 15px;
    border: 1px solid var(--rest-bordure);
    border-radius: 20px;
    width: 250px;
}
.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid var(--rest-bordure);
    border-radius: 5px;
    max-height: 300px;
    overflow-y: auto;
    display: none;
    z-index: 100;
}
.search-results.active {
    display: block;
}
.search-result-item {
    padding: 10px;
    border-bottom: 1px solid #eee;
    cursor: pointer;
}
.search-result-item:hover {
    background: var(--rest-fond);
}

/* Grille reservations */
.reservations-section {
    margin-bottom: 30px;
}
.reservations-section h3 {
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--rest-bordure);
}
.reservations-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 15px;
}
.reservation-card {
    background: white;
    border-radius: 10px;
    padding: 15px;
    border-left: 5px solid var(--rest-bordure);
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}
.resa-en_attente { border-left-color: var(--rest-jaune); }
.resa-confirmee { border-left-color: var(--rest-vert); }
.resa-annulee { border-left-color: var(--rest-rouge); opacity: 0.6; }
.resa-honoree { border-left-color: var(--rest-gris); }

.resa-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
}
.resa-heure {
    font-size: 1.5em;
    font-weight: bold;
}
.resa-statut {
    font-size: 0.85em;
    padding: 3px 10px;
    border-radius: 10px;
    background: #eee;
}
.resa-client {
    font-size: 1.2em;
    font-weight: bold;
}
.resa-details,
.resa-phone {
    color: #666;
    margin: 5px 0;
}
.resa-notes {
    background: var(--rest-fond);
    padding: 8px;
    border-radius: 5px;
    font-style: italic;
    margin-top: 10px;
}
.resa-actions {
    display: flex;
    gap: 5px;
    margin-top: 15px;
}

/* Tableau reservations */
.table-reservations {
    width: 100%;
    border-collapse: collapse;
}
.table-reservations th,
.table-reservations td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid var(--rest-bordure);
}
.table-reservations th {
    background: var(--rest-fond);
}
.resa-row-annulee {
    opacity: 0.5;
    text-decoration: line-through;
}
.badge-statut {
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 0.85em;
}
.badge-en_attente { background: var(--rest-jaune); color: black; }
.badge-confirmee { background: var(--rest-vert); color: white; }
.badge-annulee { background: var(--rest-rouge); color: white; }
.badge-honoree { background: var(--rest-gris); color: white; }

.no-data {
    text-align: center;
    padding: 30px;
    color: #666;
}

/* ==========================================================================
   CALENDRIER RESERVATIONS
   ========================================================================== */
.calendrier-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}
.mois-titre {
    margin: 0;
}
.calendrier {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}
.calendrier th {
    padding: 10px;
    background: var(--rest-fond);
    text-align: center;
    border: 1px solid var(--rest-bordure);
}
.calendrier th.weekend {
    background: #e9ecef;
}
.calendrier td {
    border: 1px solid var(--rest-bordure);
    vertical-align: top;
    height: 120px;
    padding: 5px;
    position: relative;
}
.jour-vide {
    background: var(--rest-fond);
}
.jour-numero {
    font-weight: bold;
    font-size: 1.1em;
}
.aujourdhui {
    background: #e7f3ff !important;
}
.aujourdhui .jour-numero {
    background: var(--rest-bleu);
    color: white;
    padding: 2px 8px;
    border-radius: 50%;
}
.avec-resa {
    background: #f0fff4;
}
.jour-resas {
    margin-top: 5px;
    max-height: 80px;
    overflow-y: auto;
}
.resa-mini {
    display: block;
    padding: 3px 5px;
    margin-bottom: 2px;
    border-radius: 3px;
    font-size: 0.75em;
    text-decoration: none;
    color: white;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.resa-mini.resa-confirmee { background: var(--rest-vert); }
.resa-mini.resa-en_attente { background: var(--rest-jaune); color: black; }
.resa-mini.resa-honoree { background: var(--rest-gris); }
.resa-mini.resa-annulee { background: var(--rest-rouge); opacity: 0.5; }

.btn-add-resa {
    position: absolute;
    bottom: 5px;
    right: 5px;
    width: 25px;
    height: 25px;
    background: var(--rest-bleu);
    color: white;
    border-radius: 50%;
    text-align: center;
    line-height: 25px;
    text-decoration: none;
    font-size: 1.2em;
    opacity: 0.3;
    transition: opacity 0.2s;
}
.jour:hover .btn-add-resa {
    opacity: 1;
}
.legende {
    margin-top: 20px;
    display: flex;
    gap: 20px;
}
.legende-item {
    display: flex;
    align-items: center;
    gap: 5px;
}
.dot {
    width: 15px;
    height: 15px;
    border-radius: 3px;
}
.dot.resa-confirmee { background: var(--rest-vert); }
.dot.resa-en_attente { background: var(--rest-jaune); }
.dot.resa-honoree { background: var(--rest-gris); }
.dot.resa-annulee { background: var(--rest-rouge); }

/* ==========================================================================
   ALERTES RUPTURES (restaurant/index)
   ========================================================================== */
.ruptures-alert-zone {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a5a 100%);
    color: white;
    padding: 15px 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    box-shadow: 0 4px 15px rgba(220, 53, 69, 0.4);
    animation: pulse-alert 2s infinite;
}
@keyframes pulse-alert {
    0%, 100% { box-shadow: 0 4px 15px rgba(220, 53, 69, 0.4); }
    50% { box-shadow: 0 4px 25px rgba(220, 53, 69, 0.7); }
}
.ruptures-alert-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}
.ruptures-icon {
    font-size: 1.5em;
}
.ruptures-close {
    margin-left: auto;
    background: transparent;
    border: none;
    color: white;
    font-size: 1.5em;
    cursor: pointer;
    opacity: 0.8;
}
.ruptures-close:hover {
    opacity: 1;
}
.ruptures-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.ruptures-list li {
    background: rgba(255,255,255,0.15);
    padding: 10px 15px;
    border-radius: 5px;
    margin-bottom: 5px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.ruptures-list li:last-child {
    margin-bottom: 0;
}
.rupture-motif {
    opacity: 0.9;
    font-style: italic;
}
.btn-voir-commande {
    margin-left: auto;
    background: white;
    color: #dc3545;
    padding: 5px 15px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: bold;
    font-size: 0.9em;
}
.btn-voir-commande:hover {
    background: #f8f9fa;
}
.btn-dismiss-rupture {
    background: rgba(255,255,255,0.3);
    border: none;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.1em;
    line-height: 1;
    margin-left: 10px;
    opacity: 0.7;
    transition: all 0.2s;
}
.btn-dismiss-rupture:hover {
    background: rgba(255,255,255,0.5);
    opacity: 1;
}

/* Bouton avec alerte (ruptures) */
.btn-avec-alerte {
    position: relative;
    animation: pulse-btn 1.5s infinite;
}
@keyframes pulse-btn {
    0%, 100% { box-shadow: 0 2px 8px rgba(0,0,0,0.1); }
    50% { box-shadow: 0 2px 15px rgba(220, 53, 69, 0.5); }
}
.table-actions .btn-warning {
    background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%);
    color: white;
    animation: pulse-btn 1.5s infinite;
}
.badge-alerte {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    color: #dc3545;
    font-weight: bold;
    font-size: 0.75em;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 10px;
    margin-left: 3px;
    position: relative;
}
.badge-alerte::after {
    content: '';
    position: absolute;
    left: 3px;
    right: 3px;
    top: 45%;
    height: 2px;
    background: #dc3545;
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */
@media (max-width: 992px) {
    .commande-container {
        grid-template-columns: 1fr;
    }
    .cuisine-content {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .tables-grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    }
    .restaurant-header,
    .commande-header,
    .reservation-header {
        flex-direction: column;
        text-align: center;
    }
    .restaurant-stats {
        flex-wrap: wrap;
        justify-content: center;
    }
    .reservation-filters {
        flex-direction: column;
        gap: 15px;
    }
    .calendrier td {
        height: 80px;
    }
    .jour-resas {
        max-height: 50px;
    }
}

/* ==========================================================================
   STATISTIQUES RESTAURANT
   ========================================================================== */
.stat-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 25px;
}
.stat-card {
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    border-left: 4px solid var(--rest-bleu);
}
.stat-card.vert { border-left-color: var(--rest-vert); }
.stat-card.jaune { border-left-color: var(--rest-jaune); }
.stat-card.cyan { border-left-color: var(--rest-cyan); }
.stat-card .stat-valeur {
    font-size: 2rem;
    font-weight: bold;
    color: #333;
}
.stat-card .stat-libelle {
    font-size: 0.9rem;
    color: #666;
    margin-top: 5px;
}
.stat-graphique {
    background: #fff;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
.stat-graphique h3 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #333;
}
.stat-nav {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}
.stat-nav a {
    padding: 8px 16px;
    border-radius: 5px;
    text-decoration: none;
    background: #e9ecef;
    color: #333;
}
.stat-nav a.active {
    background: var(--rest-bleu);
    color: #fff;
}
@media (max-width: 768px) {
    .stat-cards-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
