/* ==========================================================
   🎨 CONFIGURATION & VARIABLES
   ========================================================== */
:root {
    --primary: #2c3e50;    /* Couleur des titres et de la barre de navigation */
    --accent: #3498db;     /* Couleur des boutons d'action (MyPos, Recap) */
    --bg: #f4f7f6;         /* Fond gris clair de l'application */
    --white: #ffffff;      /* Fond des cartes et champs de saisie */
    --success: #27ae60;    /* Vert pour les validations et succès */
    --danger: #e74c3c;     /* Rouge pour les erreurs et suppressions */
    --amex: #007bc1;       /* Bleu spécifique à American Express */
}

/* ==========================================================
   📱 STRUCTURE DE BASE
   ========================================================== */
body { 
    font-family: -apple-system, sans-serif; 
    background: var(--bg); 
    margin: 0; 
    padding-bottom: 95px; /* Espace pour ne pas cacher le contenu par la nav-bar */
}

.view { padding: 15px; } /* Conteneur de chaque page */

/* Sous-section : Gestion de l'affichage */
.hidden { display: none !important; } /* Cache les sections non actives */


/* ==========================================================
   📦 Selecteur date
   ========================================================== */

.date-impactante {
    background: #fff3cd !important; /* Jaune alerte */
    border: 2px solid #ffeeba !important;
    text-align: center;
    padding: 15px !important;
    margin-bottom: 20px;
}
.date-impactante label {
    display: block;
    font-weight: 900;
    color: #856404;
    margin-bottom: 10px;
    font-size: 0.9rem;
}
#service-date {
    font-size: 1.2rem;
    padding: 10px;
    border-radius: 8px;
    border: 1px solid #856404;
    width: 100%;
    text-align: center;
}
.date-warning {
    font-size: 0.7rem;
    color: #856404;
    margin-top: 8px;
    font-weight: bold;
}


/* ==========================================================
   📦 CARTES & CONTENEURS (Sections Blanches)
   ========================================================== */
header h1 { 
    text-align: center; 
    color: var(--primary); 
    font-size: 1.1rem; 
    margin-bottom: 10px; 
}

.card-section { 
    background: var(--white); 
    border-radius: 12px; 
    padding: 15px; 
    margin-bottom: 12px; 
    box-shadow: 0 2px 8px rgba(0,0,0,0.06); 
}

/* Sous-section : Variantes de bordures */
.highlight-amex { border-left: 5px solid var(--amex); }

/* ==========================================================
   🔢 AFFICHAGE DES TOTAUX & INPUTS
   ========================================================== */
.total-display { 
    font-size: 1.2rem; 
    font-weight: bold; 
    text-align: center; 
    padding: 8px; 
    background: #eef2f3; 
    border-radius: 8px; 
    border: 1px solid #d1d8db; 
    margin-bottom: 10px; 
}

/* État : Mise en avant du total Net */
.highlight { background: #d4edda; color: #155724; }

/* Sous-section : Groupes de saisie */
.input-group { margin-bottom: 8px; }
.input-group label { display: block; font-size: 0.8rem; margin-bottom: 3px; color: #555; }

input, select { 
    width: 100%; 
    padding: 10px; 
    border: 1px solid #ccc; 
    border-radius: 8px; 
    box-sizing: border-box; 
    font-size: 1rem; 
}

/* ==========================================================
    🗺️ GRILLES & DISPOSITION (Cash & ANCV)
   ========================================================== */

/* Conteneur principal : on passe en flex pour mettre les colonnes côte à côte */
.cash-grid { 
    display: flex; 
    gap: 12px; 
    align-items: flex-start;
    margin-top: 10px;
}

/* Nouvelle sous-section : Définit chaque colonne (Billets vs Pièces) */
.cash-column { 
    flex: 1; /* Les deux colonnes auront la même largeur (50/50) */
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Style des items (individuel pour chaque billet/pièce) */
.cash-item { 
    background: #fdfdfd; 
    padding: 8px; 
    border-radius: 8px; 
    border: 1px solid #eee;
    display: flex;
    flex-direction: column;
}

/* Petit réglage pour les étiquettes (ex: 20€) à l'intérieur des items */
.cash-item label {
    font-size: 0.75rem;
    font-weight: bold;
    color: var(--primary);
    margin-bottom: 2px;
}

/* Sélecteur de type ANCV (Papier/Connect) */
.type-selector { 
    display: flex; 
    background: #eee; 
    padding: 3px; 
    border-radius: 8px; 
    margin-bottom: 10px; 
}

/* ==========================================================
   📝 LISTES DE RÉCAPITULATIF (Items ajoutés)
   ========================================================== */
.recap-item { 
    background: var(--white); 
    padding: 8px; 
    border-radius: 8px; 
    margin-bottom: 5px; 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    border: 1px solid #eee; 
    font-size: 0.85rem; 
}

/* ==========================================================
   🔲 FENÊTRES MODALES (Pop-ups)
   ========================================================== */
.modal { 
    position: fixed; 
    top: 0; left: 0; 
    width: 100%; height: 100%; 
    background: rgba(0,0,0,0.85); /* Fond noir transparent */
    display: flex; 
    align-items: center; 
    justify-content: center; 
    z-index: 2000; 
}

.modal-content { 
    background: white; 
    width: 92%; 
    max-height: 90%; 
    border-radius: 15px; 
    padding: 15px; 
    overflow-y: auto; 
}

/* Ligne de détail dans la modale */
.recap-row { 
    display: flex; 
    justify-content: space-between; 
    padding: 6px 0; 
    border-bottom: 1px dashed #eee; 
    font-size: 0.85rem; 
}
/* ==========================================================
   📍 BARRE DE NAVIGATION (Menu bas ergonomique)
   ========================================================== */
.nav-bar { 
    position: fixed; 
    bottom: 0; 
    width: 100%; 
    background: var(--primary); 
    display: flex; 
    justify-content: space-around; 
    align-items: center;
    padding: 8px 0; /* Un peu plus d'espace en hauteur */
    z-index: 1000; 
    box-shadow: 0 -2px 10px rgba(0,0,0,0.2);
}

.nav-bar button {
    background: transparent;
    border: none;
    color: white;
    font-size: 0.7rem; /* Texte légèrement plus petit pour tenir sur une ligne */
    display: flex;
    flex-direction: column; /* ICONE AU DESSUS DU TEXTE */
    align-items: center;
    justify-content: center;
    gap: 4px; /* Espace entre l'émoji et le texte */
    opacity: 0.8;
    flex: 1; /* Chaque bouton prend la même place */
    min-width: 0;
    padding: 5px 0;
}

/* Style spécifique pour le bouton récap pour qu'il ressorte */
.btn-recap-nav {
    background: var(--accent) !important;
    border-radius: 8px;
    font-weight: bold;
    opacity: 1 !important;
    margin: 0 4px; /* Petit espace sur les côtés */
}

.nav-bar button:active {
    background: rgba(255,255,255,0.1);
    transform: scale(0.95);
}

