/* ==========================================================================
   1. VARIABLES & CONFIGURATION GÉNÉRALE
   ========================================================================== */
:root {
    --bg-main: #3a444d;       /* Fond général de l'application */
    --bg-card: #2b3036;       /* Fond des blocs (login et éléments du dashboard) */
    --bg-input: #3b424a;      /* Fond des champs de saisie et composants secondaires */
    --border-color: #4f5761;  /* Couleur des bordures principales */
    --border-light: #3d454f;  /* Couleur des bordures discrètes */
    --text-main: #ffffff;     /* Couleur du texte principal */
    --text-muted: #a0aab5;    /* Couleur du texte secondaire / grisé */
    --text-placeholder: #7a828a;
    
    /* Couleurs d'accentuation */
    --color-primary: #3b638c;  /* Bleu EpidémiaTracker */
    --color-primary-hover: #46729f;
    --color-link: #0088ff;
    --color-link-hover: #33a3ff;
    
    /* Couleurs de statut */
    --color-danger: #fc5c5c;
    --color-warning: #fd9644;
    --color-success: #26c281;
}

/* Réinitialisation globale */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Open Sans', sans-serif;
}

body {
    background-color: var(--bg-main);
    color: var(--text-main);
    min-height: 100vh;
}

/* Style partagé pour le titre EpidémiaTracker */
.main-title span, .sidebar-brand h2 span {
    font-weight: 300;
    color: #cccccc;
}


/* ==========================================================================
   2. STYLES DE LA PAGE DE CONNEXION (INDEX)
   ========================================================================== */
.login-body {
    display: flex;
    justify-content: center;
    align-items: center;
}

.login-container {
    width: 100%;
    max-width: 440px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.login-title {
    font-size: 2.5rem;
    font-weight: 400;
    color: var(--text-main);
    margin-bottom: 25px;
    letter-spacing: 0.5px;
}

.login-card {
    background-color: var(--bg-card);
    width: 100%;
    padding: 40px 35px;
    border-radius: 4px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

.logo-container {
    text-align: center;
    margin-bottom: 30px;
}

.logo-insp {
    max-width: 100%;
    height: auto;
    object-fit: contain;
}

.login-card h2 {
    text-align: center;
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 25px;
}

/* Champs formulaires de connexion */
.input-group {
    position: relative;
    margin-bottom: 20px;
}

.input-group input {
    width: 100%;
    padding: 14px 45px 14px 15px;
    background-color: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-main);
    font-size: 1rem;
    outline: none;
    transition: border-color 0.2s;
}

.input-group input::placeholder {
    color: var(--text-placeholder);
}

.input-group input:focus {
    border-color: var(--color-primary);
}

.input-group i {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-placeholder);
    font-size: 1.1rem;
}

/* Bouton Connexion */
.button-container {
    display: flex;
    justify-content: center; /* Modifié ici : flex-end -> center */
    margin-top: 25px;
    margin-bottom: 30px;
}

.btn-submit {
    background-color: var(--color-primary);
    color: var(--text-main);
    border: none;
    padding: 12px 40px;
    font-size: 1.05rem;
    border-radius: 4px;
    cursor: pointer;
    width: 65%; /* Le bouton prendra 65% de la largeur et sera parfaitement centré */
    transition: background-color 0.2s;
}

.btn-submit:hover {
    background-color: var(--color-primary-hover);
}
/* Liens du bas */
.card-footer {
    display: flex;
    flex-direction: column;
    gap: 12px;
    border-top: 1px solid var(--border-light);
    padding-top: 20px;
}

.footer-link {
    color: var(--color-link);
    text-decoration: none;
    font-size: 0.95rem;
    width: max-content;
    transition: color 0.2s;
}

.footer-link:hover {
    color: var(--color-link-hover);
    text-decoration: underline;
}


/* ==========================================================================
   3. STYLES DU TABLEAU DE BORD (DASHBOARD)
   ========================================================================== */
.dashboard-body {
    display: flex;
}

/* Barre latérale (Sidebar) */
.sidebar {
    width: 260px;
    background-color: var(--bg-card);
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--border-light);
    position: fixed;
    height: 100vh;
}

.sidebar-brand {
    padding: 25px 20px;
    border-bottom: 1px solid var(--border-light);
}

.sidebar-brand h2 {
    font-size: 1.5rem;
    font-weight: 400;
}

.sidebar-menu {
    display: flex;
    flex-direction: column;
    padding: 20px 0;
    flex-grow: 1;
}

.sidebar-menu a {
    color: var(--text-muted);
    text-decoration: none;
    padding: 15px 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 0.95rem;
    transition: all 0.2s;
}

.sidebar-menu a:hover, .sidebar-menu a.active {
    color: var(--text-main);
    background-color: var(--bg-input);
    border-left: 4px solid var(--color-primary);
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid var(--border-light);
}

.sidebar-footer a {
    color: var(--color-danger);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Zone de contenu à droite */
.main-content {
    margin-left: 260px;
    flex-grow: 1;
    padding: 30px;
}

/* En-tête (Header) */
.main-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 20px;
    margin-bottom: 30px;
}

.header-title h1 {
    font-size: 1.8rem;
    font-weight: 600;
}

.header-title p {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-top: 2px;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-info {
    text-align: right;
}

.user-name {
    display: block;
    font-weight: 600;
    font-size: 0.95rem;
}

.user-role {
    font-size: 0.8rem;
    color: var(--color-link);
}

.user-avatar {
    background-color: var(--bg-input);
    width: 45px;
    height: 45px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    border: 1px solid var(--border-color);
    font-size: 1.2rem;
}

/* Cartes de statistiques (KPIs) */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background-color: var(--bg-card);
    padding: 20px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 20px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
}

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 6px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.4rem;
}

.icon-red { background-color: rgba(252, 92, 92, 0.15); color: var(--color-danger); }
.icon-orange { background-color: rgba(253, 150, 68, 0.15); color: var(--color-warning); }
.icon-green { background-color: rgba(38, 194, 129, 0.15); color: var(--color-success); }

.stat-data h3 {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 400;
    text-transform: uppercase;
}

.stat-number {
    font-size: 1.6rem;
    font-weight: 700;
    margin-top: 2px;
}

/* Blocs détails (Graphique & Tableau) */
.dashboard-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

@media (max-width: 992px) {
    .dashboard-details { grid-template-columns: 1fr; }
}

.content-card {
    background-color: var(--bg-card);
    padding: 25px;
    border-radius: 6px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
}

.content-card h3 {
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: 20px;
    border-left: 3px solid var(--color-primary);
    padding-left: 10px;
}

/* Graphique en barres CSS */
.fake-chart {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    height: 180px;
    padding-top: 20px;
    border-bottom: 1px solid var(--border-color);
}

.chart-bar {
    background-color: var(--color-primary);
    width: 35px;
    border-top-left-radius: 4px;
    border-top-right-radius: 4px;
    position: relative;
    display: flex;
    justify-content: center;
}

.chart-bar.red-bar {
    background-color: var(--color-danger);
}

.chart-bar span {
    position: absolute;
    bottom: -25px;
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Tableaux de données */
.data-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.data-table th, .data-table td {
    padding: 12px;
    font-size: 0.9rem;
}

.data-table th {
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-color);
    font-weight: 400;
}

.data-table td {
    border-bottom: 1px solid var(--border-light);
}

/* Badges de Statut */
.badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-danger { background-color: rgba(252, 92, 92, 0.2); color: var(--color-danger); }
.badge-warning { background-color: rgba(253, 150, 68, 0.2); color: var(--color-warning); }
.badge-success { background-color: rgba(38, 194, 129, 0.2); color: var(--color-success); }