/**** --- STYLE DU TABLEAU DE BORD INDEX --- ****/

.main-index {
    max-width: 1600px;
    width: 95vw;
    margin-left: auto; 
    margin-right: auto;
    margin-top: 20px; 
    padding-top: 20px;
    box-sizing: border-box;
    min-height: calc(100vh - 290px);
    display: flex;
    background-color: #fff;
    border-radius: 10px;
    flex-direction: column;
    box-sizing: border-box;
}

/* --- PREMIÈRE LIGNE : DISPOSITION EN 3 COLONNES --- */
.top-board-grid {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 20px;
    padding: 0 20px;
    margin-bottom: 25px;
}

/* Sections du haut */
.communication-fd {
    flex: 2;
    background-color: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    height: 100%;
    box-sizing: border-box;
}

.bulletin {
    display: flex;
    align-items: center;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    transition: transform 0.2s;
    background-color: white;
}

.bulletin_icon {
    height: 150px;
    flex:2;
    aspect-ratio: 1/1;
}



/* --- CARTE METEO --- */
.meteo-cards-container {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 10px;
    justify-content: space-between;
    align-content: space-between;
}

.meteo-card {
    flex: 1;
    background-color: var(--color-light);
    border-radius: 8px;
    padding: 15px;
    text-align: center;
    border-left: 4px solid var(--color-blue-normal);
}

.meteo-title {
    display: block;
    font-size: 0.85rem;
    color: #666;
    font-weight: bold;
    margin-bottom: 5px;
}

.meteo-value {
    font-size: 1.4rem;
    font-weight: bold;
    color: var(--color-dark);
}

/*** STYLE GENERAL DES CARTES D'INFORMATION ***/
.info-card { 
    display: flex;
    align-items: center;
    padding: 15px;
    margin-bottom: 15px;
    border-radius: 8px;
    border-left: 6px solid var(--color-alfa);
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    transition: transform 0.2s;
    background-color: white;
}

.info-card:last-child {
    margin-bottom: 0;
}

.info-card:hover {
    transform: translateY(-2px);
}

.info-contenu {
    flex-grow: 1;
}

.info-contenu h4 {
    margin: 0 0 5px 0;
    font-size: 1.05rem;
}

.info-contenu p {
    margin: 0;
    font-size: 0.88rem;
}

.info_icon {
    font-size: 1.8rem;
    margin-right: 15px;
}

.info-action {
    margin-left: 15px;
    text-align: right;
}

.bouton-card {
    min-width: 90px;
    display: inline-block;
    background-color: var(--color-alfa) !important;
    color: white;
    padding: 8px 12px;
    text-decoration: none;
    text-align: center;
    border-radius: 5px;
    font-weight: bold;
    font-size: 0.85rem;
    transition: background 0.3s, transform 0.2s;
}

.bouton-card:hover {
    background-color: var(--color-alfa-dark) !important;
    transform: scale(1.03);
}

/* Variantes de couleurs Alerte/Info */
.alerte-datesTO {
    background-color: var(--color-blue-light);
    border-left-color: var(--color-blue-normal);
}
.bouton-card-datesTO { background-color: var(--color-blue-normal) !important; }
.bouton-card-datesTO:hover { background-color: var(--color-blue-dark) !important; }

.alerte-prospection {
    background-color: var(--color-red-light);
    border-left-color: var(--color-red-normal);
    color: var(--color-red-dark);
}
.bouton-card-alerte-prospection { background-color: var(--color-red-normal) !important; }
.bouton-card-alerte-prospection:hover { background-color: var(--color-red-dark) !important; }

.info-prospection {
    background-color: var(--color-orange-light);
    border-left-color: var(--color-orange-normal);
    color: var(--color-orange-dark);
}
.bouton-card-info-prospection { background-color: var(--color-orange-normal) !important; }
.bouton-card-info-prospection:hover { background-color: var(--color-orange-dark) !important; }


/* --- SECONDE LIGNE : DATA BOARD (LIMITÉ À 4 CARTES PAR LIGNE) --- */
.data-board {
    display: grid;
    /* Crée 4 colonnes de taille égale max, bascule automatiquement si l'écran rétrécit */
    grid-template-columns: repeat(auto-fit, minmax(calc(25% - 15px), 1fr));
    gap: 20px;
    margin-bottom: 30px;
    padding: 0 20px;
}

.data-card {
    padding: 20px;
    border-radius: 12px;
    border: 1px solid rgba(0,0,0,0.05);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    transition: transform 0.2s;
    background-color: white;
}

.data-card:hover {
    transform: translateY(-2px);
}

.card-link {
    text-decoration: none;
    color: inherit;
    display: block;
    width: 100%;
    height: 100%;
}

/* Couleurs Data Cards */
.card-pheno { background-color: #fff9c4; border-left: 8px solid #fbc02d; }
.card-vol   { background-color: #e8f5e9; border-left: 8px solid #4caf50; }
.card-maladies { background-color: #fff3e0; border-left: 8px solid #fb8c00; }

.card-title {
    font-size: 0.9rem;
    font-weight: bold;
    color: #555;
    margin-bottom: 15px;
}

/* --- Section Phénologie --- */
.pheno-wrapper {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-top: 10px;
}

.icon-svg {
    width: 55px;
    height: 55px;
    object-fit: contain;
}

.pheno-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.pheno-main-title {
    margin: 0;
    font-size: 1.1rem;
    color: #333;
    font-weight: 600;
}

.pheno-date-text {
    margin: 0;
    font-size: 0.7rem;
    color: #777;
    font-style: italic;
}

.stade-badge {
    display: inline-block;
    padding: 2px 8px;
    background-color: #fbc02d;
    color: #fff;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: bold;
    width: fit-content;
}

/* --- Section Vol Eudémis --- */
.vol-wrapper {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-top: 10px;
}

.vol-info-principal {
    display: flex;
    align-items: center;
    gap: 10px;
}

.icon-pente-svg {
    width: 35px;
    height: 35px;
    display: block;
}

.vol-tendance-text {
    margin-top: 3px;
    font-size: 0.85rem;
    color: #555;
    font-style: italic;
}

.vol-main {
    color: #275f29;
    font-weight: bold;
    font-size: 1.8rem;
}

/* --- Section Maladies --- */
.maladies-wrapper {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-top: 10px;
}

.maladies-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px 12px;
    flex-grow: 1;
}

.maladies-2-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px 12px;
    flex-grow: 1;
}

.maladie-item {
    display: flex;
    flex-direction: column;
}

.maladie-name {
    font-weight: bold;
    font-size: 0.85rem;
    color: #333;
}

.val-fi {
    color: #e65100;
    font-family: monospace;
    font-size: 0.85rem;
}


/* ==========================================================================
   STRUCTURES ET NIVEAUX D'IMPORTANCE EN CARDS (Phéno / Vol / Maladies)
   ========================================================================== */

/* Conteneur principal flex descendant pour caler la date tout en bas */
.card-body-hierarchise {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    flex-grow: 1;
    gap: 12px;
    margin-top: 10px;
}

/* --- 1. IMPORTANCE MAXIMALE (Mise en avant héro) --- */
.importance-max {
    display: flex;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px dashed rgba(0, 0, 0, 0.1);
}

/* Héros Phénologie */
.pheno-hero {
    gap: 15px;
}

.pheno-img-hero {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    border: 2px solid #fff;
}

.pheno-hero-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.pheno-libelle {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 700;
    color: #2c3e50;
    line-height: 1.25;
}

/* Héros Vol Eudémis */
.vol-hero {
    justify-content: space-between;
    padding: 5px 0;
}

.vol-captures-main {
    display: flex;
    align-items: baseline;
    gap: 6px;
}

.vol-number {
    font-size: 2.2rem;
    font-weight: 900;
    color: #1b5e20;
    line-height: 1;
}

.vol-unit {
    font-size: 0.85rem;
    color: #555;
    font-weight: 600;
}

/* Badges de tendance avec icônes FontAwesome */
.vol-tendance-badge {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: transform 0.2s ease;
}

.vol-tendance-badge:hover {
    transform: scale(1.1);
}

.tendance-hausse {
    background-color: var(--color-red-light);
    color: var(--color-red-normal);
    border: 1px solid var(--color-red-normal);
}

.tendance-baisse {
    background-color: #c4dfc6;
    color: #2e7d32;
    border: 1px solid #4caf50;
}


.tendance-stable {
    background-color: #f5f5f5;
    color: #616161;
    border: 1px solid #ccc;
}

/* --- 2. IMPORTANCE MOYENNE (KPIs et ratios secondaires) --- */
.importance-moyenne {
    display: flex;
    flex-direction: column;
    gap: 6px;
    background-color: rgba(255, 255, 255, 0.5);
    padding: 8px 10px;
    border-radius: 6px;
}

.kpi-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.82rem;
}

.kpi-label {
    color: #555;
    display: flex;
    align-items: center;
    gap: 6px;
}

.kpi-label i {
    font-size: 0.85rem;
    opacity: 0.7;
}

.kpi-value {
    font-weight: 700;
    color: #222;
}

/* --- 3. IMPORTANCE MINIMALE (Pied de carte / Date) --- */
.importance-min {
    font-size: 0.72rem;
    color: #777;
    font-style: italic;
    display: flex;
    align-items: center;
    gap: 5px;
    margin-top: 4px;
    padding-top: 6px;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}


/* RESPONSIVE (Tablettes & Mobiles) */
@media (max-width: 1100px) {
    .top-board-grid {
        grid-template-columns: 1fr; /* Bascule les 3 sections principales l'une sous l'autre sur écran réduit */
    }
    
    .data-board {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    }
}

@media (max-width: 960px) {
    .info-card {
        flex-direction: column;
        text-align: center;
    }
    .info_icon {
        margin: 0 0 10px 0;
    }
    .info-action {
        margin-top: 15px;
        margin-left: 0;
        width: 100%;
        text-align: center;
    }
    .bouton-card {
        width: 80%;
    }
}