/* ==========================================
   Variables globales (Thème Moderne)
   ========================================== */
:root {
    --bg-main: #f8f9fa;
    --text-main: #2d3748;
    --border-color: #e2e8f0;
    --radius-lg: 12px;
    --radius-md: 8px;
    --primary-glow: rgba(13, 110, 253, 0.15);
}

/* ==========================================
   1. HARMONISATION GLOBALE & ARRIÈRE-PLAN
   ========================================== */
body {
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-main);
    color: var(--text-main);
    -webkit-font-smoothing: antialiased;
}

/* ==========================================
   2. STYLISATION & INTERACTION DES BOUTONS
   ========================================== */
.btn {
    border-radius: var(--radius-md) !important;
    font-weight: 500;
    transition: transform 0.15s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.15s ease, background-color 0.2s ease;
}

.btn:hover:not([disabled]) {
    transform: translateY(-2px); /* Élévation fluide */
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.12) !important;
}

/* Effet "clic" ou retour tactile réel */
.btn:active:not([disabled]) {
    transform: translateY(0) scale(0.98); /* Enfoncement et léger rétrécissement */
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08) !important;
}

/* Gestion propre des boutons désactivés */
.btn:disabled, .btn.disabled {
    opacity: 0.55 !important;
    transform: none !important;
    box-shadow: none !important;
    cursor: not-allowed;
}

/* ==========================================
   3. ARRONDI ET OMBRES DES CARTES (Cards)
   ========================================== */
.card {
    border: none !important;
    border-radius: var(--radius-lg) !important;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.03) !important;
    transition: box-shadow 0.25s ease, transform 0.25s ease;
}

.card:hover {
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.06) !important;
}

.card-header {
    border-top-left-radius: var(--radius-lg) !important;
    border-top-right-radius: var(--radius-lg) !important;
    font-weight: 600;
    background-color: transparent !important;
    border-bottom: 1px solid var(--border-color) !important;
}

/* ==========================================
   4. HARMONISATION DES COMPOSANTS FORMULAIRES DASH
   ========================================== */
/* Force les dcc.Dropdown à adopter les angles arrondis et la hauteur Bootstrap */
.Select-control {
    border-radius: var(--radius-md) !important;
    border: 1px solid #ced4da !important;
    height: 38px !important;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

/* Effet Focus moderne sur les menus déroulants Dash */
.is-focused:not(.is-opened) > .Select-control {
    border-color: #86b7fe !important;
    box-shadow: 0 0 0 0.25rem var(--primary-glow) !important;
}

.Select-placeholder, .Select-value {
    line-height: 36px !important; /* Aligne verticalement le texte interne */
    padding-left: 12px !important;
}

/* ==========================================
   5. POLISSAGE DES FENÊTRES MODALES (dbc.Modal)
   ========================================== */
.modal-content {
    border: none !important;
    border-radius: var(--radius-lg) !important;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15) !important;
    overflow: hidden;
}

.modal-header {
    border-bottom: 1px solid var(--border-color) !important;
    background-color: #fcfcfd;
}

.modal-footer {
    border-top: 1px solid var(--border-color) !important;
    background-color: #fcfcfd;
}

/* ==========================================
   6. DESIGN DES TABLEAUX (Dash DataTable)
   ========================================== */
.dash-spreadsheet-container {
    border: 1px solid var(--border-color) !important;
    border-radius: var(--radius-md) !important;
    overflow: hidden;
    background-color: white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.01);
}

/* Hover fluide sur les lignes du tableau */
.dash-spreadsheet tr:hover td {
    background-color: #f7fafc !important;
    color: #1a202c !important;
    cursor: pointer;
}

/* Style de sélection minimaliste et professionnel */
.dash-spreadsheet tr.selected td {
    background-color: #eef2f7 !important;
    font-weight: 500;
}

/* Ajustement cosmétique des cases à cocher de sélection nativité Dash */
.dash-spreadsheet [type="checkbox"], .dash-spreadsheet [type="radio"] {
    cursor: pointer;
    accent-color: #0d6efd; /* Aligne la couleur sur le bleu primaire Bootstrap */
}

/* ==========================================
   7. PERSONNALISATION DE LA SCROLLBAR
   ========================================== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: var(--radius-md);
}
::-webkit-scrollbar-thumb {
    background: #cbd5e0;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #a0aec0;
}

/* ==========================================
   8. OPTIMISATIONS POUR TÉLÉPHONES (Mobile)
   ========================================== */
@media (max-width: 768px) {
    .btn {
        padding: 10px 18px !important;
        width: 100%; /* Force les boutons d'action à prendre toute la largeur sur mobile pour plus d'ergonomie */
    }
    
    .dash-spreadsheet-container {
        margin-left: 0;
        margin-right: 0;
        border-radius: 0 !important; /* Pleine largeur sur petit écran pour maximiser la visibilité des données */
    }
}