/* =============================
   AppNat – Global Theme (Light/Dark)
   ============================= */
:root {
  --brand-grad-start: #4361ee;
  --brand-grad-end: #3f37c9;
  --card-bg: #ffffff;
  --card-border: #e9ecef;
  --shadow-sm: 0 10px 15px -3px rgba(0, 0, 0, 0.07);
}

html[data-bs-theme="dark"] {
  --brand-grad-start: #3b82f6;
  --brand-grad-end: #1d4ed8;
  --card-bg: #1e293b;
  --card-border: #334155;
  --bs-body-bg: #0f172a;
}

body { font-family: 'Inter', sans-serif; background-color: var(--bs-body-bg); color: var(--bs-body-color); }

.bg-appnat { background: linear-gradient(135deg, var(--brand-grad-start), var(--brand-grad-end)); }

.navbar { backdrop-filter: blur(10px); border-bottom: 1px solid var(--card-border); }

/* --- CARTES & OMBRES --- */
.card { 
    border-radius: 1rem; 
    background-color: var(--card-bg); 
    border: 1px solid var(--card-border); 
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s ease;
}

.shadow-soft { box-shadow: 0 8px 24px rgba(0,0,0,.08); }

/* --- BOUTONS MODERNES --- */
.btn { border-radius: 10px; font-weight: 600; padding: 0.6rem 1.2rem; }
.btn-primary { background: linear-gradient(135deg, var(--brand-grad-start), var(--brand-grad-end)); border: none; }

/* --- LISTES ADMIN --- */
.list-group-item {
    transition: all 0.2s ease;
    border: 1px solid transparent;
}
.list-group-item:hover {
    background-color: var(--card-bg) !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    z-index: 1;
}

/* --- GRAPHIQUES --- */
.chart-box { height: 420px; position: relative; }
@media (min-width: 1200px) { .chart-box { height: 520px; } }

/* =============================
   OPTIMISATIONS MOBILE (SMARTPHONES)
   ============================= */
@media (max-width: 768px) {
    /* 1. ESPACEMENT & CONTENEUR */
    .container {
        padding-left: 12px;
        padding-right: 12px;
    }
    
    h2 {
        font-size: 1.5rem; /* Titres moins envahissants */
        margin-bottom: 1rem !important;
    }

    /* 2. CARTES COMPACTES */
    .card-body {
        padding: 1rem; /* Moins de vide à l'intérieur */
    }

    /* 3. BOUTONS TACTILES */
    /* Rendre les petits boutons d'action plus faciles à toucher */
    .btn-sm, .btn-xs {
        padding: 0.5rem 0.8rem; /* Zone de touche plus grande */
        font-size: 0.9rem;
    }
    
    /* Boutons pleine largeur sur mobile pour les actions principales */
    .btn-block-mobile {
        width: 100%;
        margin-bottom: 0.5rem;
    }

    /* 4. TABLEAUX SCROLLABLES */
    /* Permet de faire glisser le tableau horizontalement sans casser la page */
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch; /* Scroll fluide sur iOS */
        border-radius: 8px;
        border: 1px solid var(--card-border);
    }
    
    /* Empêche le texte de se couper bizarrement */
    table td {
        white-space: nowrap;
        padding: 0.8rem 0.5rem;
    }

    /* 5. FORMULAIRES & FILTRES */
    .form-label {
        font-size: 0.85rem;
        margin-bottom: 0.2rem;
        color: #6c757d; /* Gris un peu plus foncé pour lisibilité */
    }
    
    .form-select, .form-control {
        font-size: 16px; /* Empêche le zoom auto sur iPhone quand on clique */
    }

    /* 6. ADMIN SPECIFIQUE */
    textarea.form-control {
        min-height: 120px; /* Plus facile pour coller des données */
    }

    .scrollable-list {
        max-height: 250px; /* Limite la hauteur pour voir le reste de la page */
    }
}