:root {
    /* Palette Pains & Pots */
    --primary-brown: #5D4037;
    --accent-gold: #D4A373;
    --bg-cream: #FAEDCD;
    --white: #FFFFFF;

    /* Couleurs Fonctionnelles (Livreurs) */
    --success-green: #2D6A4F;
    --error-red: #BC4749;
    --info-blue: #1A759F;
    --warning-yellow: #FFB703;

    /* Typo */
    --font-main: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

body {
    margin: 0;
    font-family: var(--font-main);
    background-color: var(--bg-cream);
    color: var(--primary-brown);
    line-height: 1.6;
}

/* --- BOUTONS CRUD (DIRECTION / PC) --- */
.btn {
    padding: 10px 20px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.btn-create { background-color: var(--accent-gold); color: white; }
.btn-edit { background-color: var(--info-blue); color: white; }
.btn-delete { background-color: transparent; color: var(--error-red); border: 1px solid var(--error-red); }

/* --- BOUTONS TERRAIN (MOBILE / GROS BOUTONS) --- */
.btn-mobile {
    display: block;
    width: 100%;
    padding: 15px;
    border-radius: 12px;
    border: none;
    font-weight: bold;
    font-size: 1rem;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
}

.btn-mobile-success { background-color: var(--success-green); color: white; }
.btn-mobile-info { background-color: var(--info-blue); color: white; }

main, .content-wrapper, .container {
    padding-top: 80px;
}

/* Si tu utilises un wrapper global dans base.html */
.main-content {
    margin-top: 60px; /* Taille exacte du header */
    padding-top: 20px; /* Espace de confort */
}

/* Style pour l'étoile des champs obligatoires */
label.required::after {
    content: " *";
    color: var(--error-red);
    font-weight: bold;
}

/* Style pour les boutons du panneau d'administration */
.btn-admin-panel {
    display: flex;
    align-items: center;
    gap: 12px;
    background: white;
    color: var(--primary-brown);
    text-align: left;
    padding: 12px 15px;
    margin-bottom: 8px;
    border: 1px solid transparent;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}

/* Effet au survol (Desktop) */
.btn-admin-panel:hover {
    background: var(--bg-cream);
    border-color: var(--accent-gold);
    color: var(--primary-brown);
    transform: translateX(5px);
}

/* Style des icônes à l'intérieur */
.btn-admin-panel i {
    width: 20px;
    color: var(--accent-gold);
    font-size: 1.1rem;
}

.hidden { display: none !important; }

/* --- COMPOSANTS INTERACTIFS TERRAIN --- */
.card-mobile {
    background: var(--white);
    padding: 15px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    margin-bottom: 12px;
    border: 2px solid transparent;
    transition: all 0.2s ease;
}

/* Transforme n'importe quel label/div en bouton tactile géant */
.touch-row {
    display: flex;
    align-items: center;
    gap: 15px;
    cursor: pointer;
    min-height: 65px; /* Taille optimale pour un pouce */
    width: 100%;
    box-sizing: border-box;
}

/* État coché automatique (utilisable par Chauffeurs et Préparateurs) */
.card-mobile:has(input:checked) {
    background-color: #f0fdf4; /* Teinte légère de success-green */
    border-color: var(--success-green);
    opacity: 0.8;
}

/* Grandes cases à cocher tactiles */
.big-check {
    width: 28px;
    height: 28px;
    cursor: pointer;
    accent-color: var(--success-green);
    flex-shrink: 0;
}

/* Style pour l'empilement vertical */
.touch-column {
    display: flex;
    flex-direction: column; /* Aligne les éléments de haut en bas */
    align-items: stretch;
    padding: 15px;
    gap: 10px;
}

.big-check-wide {
    width: 100% !important; /* Prend toute la largeur */
    height: 50px !important; /* Très haut pour être immanquable */
    margin: 0 !important;
    cursor: pointer;
    accent-color: var(--success-green);
}

.check-label-text {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--primary-brown);
    display: block;
    margin-bottom: 5px;
}

/* Espacement entre les cartes générées */
.card-mobile {
    background: var(--white);
    padding: 12px;
    border-radius: 15px;
    margin-bottom: 15px; /* L'espace de sécurité entre les blocs */
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    border: 2px solid transparent;
}

/* Quand la checkbox dans la carte est cochée, toute la carte réagit */
.card-mobile:has(input:checked) {
    background-color: #f0fdf4;
    border-color: var(--success-green);
}

.touch-column {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* La checkbox devient un véritable bouton horizontal */
.big-check-wide {
    -webkit-appearance: none; /* On enlève le look standard pour certains navigateurs */
    appearance: none;
    width: 100%;
    height: 60px; /* Énorme zone de clic */
    background-color: #eee;
    border-radius: 10px;
    position: relative;
    cursor: pointer;
    margin: 0;
}

/* Indicateur visuel à l'intérieur de la checkbox géante */
.big-check-wide:checked {
    background-color: var(--success-green);
}

.big-check-wide::after {
    content: 'VALIDER';
    color: #888;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-weight: bold;
    font-size: 0.9rem;
}

.big-check-wide:checked::after {
    content: '✓ VALIDÉ';
    color: white;
}

/* Style Industriel Vif pour le Chat */
.btn-chat {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 15px;

    /* OPTION VERT VIF (Recommandé pour l'aspect positif/action) */
    background-color: #1a759f;
    border-bottom: 5px solid #16a34a; /* Ombre plus foncée */

    /* OPTION BLEU VIF (Décommentez si vous préférez le bleu) */
    /* background-color: #007bff; */
    /* border-bottom: 5px solid #0056b3; */

    color: #ffffff !important; /* Blanc pur */
    padding: 18px 30px;
    min-width: 160px;
    border-radius: 15px;
    text-decoration: none;
    font-weight: 900; /* Extra gras */
    font-size: 1.2rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    border: none;
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.2);
    transition: all 0.1s ease;
    cursor: pointer;
    touch-action: manipulation;
}

/* Effet au clic */
.btn-chat:active {
    transform: translateY(3px);
    border-bottom-width: 1px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    background-color: #16a34a; /* Devient un peu plus sombre à l'appui */
}

.btn-chat i {
    font-size: 1.5rem; /* Icône encore plus visible */
}

/* Version flottante (FAB) adaptée aux nouvelles couleurs */
.btn-chat-fab {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
    width: 70px; /* Un peu plus gros pour le tactile */
    height: 70px;
    border-radius: 50%;
    background-color: #22c55e;
    color: white !important;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    border: none;
    border-bottom: 4px solid #16a34a;
}

.btn-small-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: var(--info-blue);
    color: var(--white) !important;
    padding: 6px 16px;
    border-radius: 20px; /* Forme pilule */
    font-size: 0.75rem;
    font-weight: 800;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: none;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(26, 117, 159, 0.2);
    cursor: pointer;
}

.btn-small-action:hover {
    background-color: #1565C0; /* Un bleu légèrement plus soutenu */
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(26, 117, 159, 0.3);
}

.btn-small-action:active {
    transform: translateY(0);
}