/* ============================================================
   TYPOGRAPHIE GÉNÉRALE
   Application de gestion des marchés
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
    --font-main: 'Inter', Arial, sans-serif;

    --text-primary: #263238;
    --text-secondary: #607d8b;
    --text-muted: #90a4ae;

    --color-primary: #2f6f9f;
    --color-primary-dark: #245878;

    --sidebar-bg: #263b4a;
    --sidebar-border: #344e5d;

    --page-bg: #f4f6f8;
    --card-bg: #ffffff;

    --border-color: #e2e7eb;
}


/* ============================================================
   BASE
   ============================================================ */

html,
body {
    font-family: var(--font-main);
    font-size: 14px;
    color: var(--text-primary);
    background: var(--page-bg);
    line-height: 1.6;
}

body {
    margin: 0;
    font-weight: 400;
}


/* ============================================================
   TITRES
   ============================================================ */

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-main);
    color: var(--text-primary);
    margin-top: 0;
    letter-spacing: -0.02em;
}

h1 {
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1.25;
    margin-bottom: 1rem;
}

h2 {
    font-size: 1.45rem;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 0.85rem;
}

h3 {
    font-size: 1.2rem;
    font-weight: 600;
    line-height: 1.35;
    margin-bottom: 0.7rem;
}

h4 {
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: 0.6rem;
}

h5 {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

h6 {
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 0.4rem;
}


/* ============================================================
   PARAGRAPHES
   ============================================================ */

p {
    margin-top: 0;
    margin-bottom: 0.8rem;
    color: var(--text-primary);
    font-size: 0.9rem;
    line-height: 1.6;
}

.text-muted {
    color: var(--text-muted) !important;
}

.text-secondary {
    color: var(--text-secondary) !important;
}


/* ============================================================
   LIENS
   ============================================================ */

a {
    color: var(--color-primary);
    text-decoration: none;
    transition:
        color 0.15s ease,
        background-color 0.15s ease;
}

a:hover {
    color: var(--color-primary-dark);
    text-decoration: none;
}

a:focus {
    outline: none;
}


/* ============================================================
   SIDEBAR
   ============================================================ */

.sidebar {
    position: fixed;
    top: 56px;
    left: 0;
    bottom: 0;
    width: 220px;

    background: var(--sidebar-bg);
    color: #ecf0f1;

    overflow-y: auto;
    z-index: 1000;

    display: flex;
    flex-direction: column;

    padding: 15px 0;
}

.sidebar-header {
    padding: 0 15px 15px 15px;
    border-bottom: 1px solid var(--sidebar-border);
}

.sidebar-header h5 {
    color: #ffffff;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 3px;
}

.sidebar-header p {
    margin: 0;
    color: #b8c5cc;
    font-size: 0.7rem;
    line-height: 1.4;
}


/* ============================================================
   NAVIGATION
   ============================================================ */

.sidebar-nav {
    list-style: none;
    padding: 0;
    margin: 10px 0;
    flex: 1;
}

.sidebar-nav li {
    padding: 0 10px;
    margin-bottom: 3px;
}

.sidebar-nav li a {
    display: block;

    padding: 8px 12px;

    color: #bdc7cc;

    border-radius: 5px;

    text-decoration: none;

    font-size: 0.82rem;
    font-weight: 500;

    transition:
        background-color 0.15s ease,
        color 0.15s ease;
}

.sidebar-nav li a i {
    margin-right: 8px;
    width: 18px;
    text-align: center;
}

.sidebar-nav li a:hover {
    background: #344e5d;
    color: #ffffff;
}

.sidebar-nav li.active a {
    background: var(--color-primary);
    color: #ffffff;
}


/* ============================================================
   FOOTER SIDEBAR
   ============================================================ */

.sidebar-footer {
    padding: 10px 15px;

    border-top: 1px solid var(--sidebar-border);

    text-align: center;

    font-size: 0.65rem;
    color: #aebbc2;
}


/* ============================================================
   CONTENU PRINCIPAL
   ============================================================ */

.main-content {
    margin-left: 220px;
    margin-top: 56px;

    padding: 25px 30px;

    min-height: 100vh;
}


/* ============================================================
   TITRE DE PAGE
   ============================================================ */

.page-title {
    margin-bottom: 5px;

    font-size: 1.55rem;
    font-weight: 700;

    color: var(--text-primary);
}

.page-subtitle {
    margin-bottom: 20px;

    font-size: 0.85rem;
    color: var(--text-secondary);
}


/* ============================================================
   CARTES STATISTIQUES
   ============================================================ */

.stat-card {
    border-radius: 8px;

    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);

    border: 1px solid var(--border-color);

    background: var(--card-bg);

    transition: transform 0.15s ease,
                box-shadow 0.15s ease;
}

.stat-card:hover {
    transform: translateY(-2px);

    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
}

.stat-card .card-body {
    padding: 18px 20px;
}

.stat-card .stat-number {
    font-size: 1.7rem;
    font-weight: 700;
    line-height: 1.2;
}

.stat-card .stat-label {
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--text-secondary);
}


/* ============================================================
   CARTE MARCHÉ
   ============================================================ */

.marche-card {
    border-radius: 8px;

    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);

    border: 1px solid var(--border-color);
    border-left: 4px solid var(--color-primary);

    margin-bottom: 18px;

    background: var(--card-bg);

    transition:
        box-shadow 0.15s ease,
        transform 0.15s ease;
}

.marche-card:hover {
    box-shadow: 0 5px 16px rgba(0, 0, 0, 0.08);
    transform: translateY(-1px);
}

.marche-card .card-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.marche-card .card-subtitle {
    color: var(--text-secondary);
    font-size: 0.82rem;
}

.marche-card .badge-statut {
    font-size: 0.72rem;
    font-weight: 600;

    padding: 5px 11px;

    border-radius: 15px;
}

.marche-card .superficie {
    background: #eef2f4;

    padding: 3px 11px;

    border-radius: 15px;

    font-size: 0.78rem;
    color: var(--text-primary);
}

.marche-card .progress {
    height: 18px;

    border-radius: 9px;

    background-color: #e9edf0;
}

.marche-card .progress-bar {
    border-radius: 9px;

    font-size: 0.72rem;
    line-height: 18px;
}

.marche-card .op-en-cours {
    background: #fff7df;

    border-radius: 5px;

    padding: 6px 10px;

    margin-top: 5px;

    font-size: 0.8rem;
}


/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 768px) {

    .sidebar {
        width: 100%;
        position: relative;

        top: 0;

        height: auto;

        padding: 10px 0;
    }

    .main-content {
        margin-left: 0;
        margin-top: 0;

        padding: 15px;
    }

    .sidebar-nav {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;

        margin: 5px 0;
    }

    .sidebar-nav li {
        padding: 0 5px;
    }

    .sidebar-nav li a {
        padding: 5px 10px;

        font-size: 0.75rem;
    }

    .sidebar-header,
    .sidebar-footer {
        display: none;
    }

    h1 {
        font-size: 1.45rem;
    }

    h2 {
        font-size: 1.25rem;
    }
}


/* =================================================================ay
   Tableau de bord - DPANEF de Sefrou (Styles des Indicateurs de Marchés)
   ========================================================================== */

.dpanef-dashboard {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: #333333;
    margin-bottom: 2rem;
}

/* Titre principal de la section */
.dpanef-dashboard h2, .dashboard-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 1.25rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #e9ecef;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Grille des cartes (compatible Bootstrap row/col ou grille CSS pure) */
.dpanef-card {
    background-color: #ffffff;
    border: none;
 
    box-shadow: 0 0.15rem 1.75rem 0 rgba(58, 59, 69, 0.08);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    margin-bottom: 1rem;
    position: relative;
    display: flex;
    flex-direction: column;
    min-width: 0;
    word-wrap: break-word;
    height: 100%;
}

.dpanef-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 0.5rem 2rem 0 rgba(58, 59, 69, 0.12);
}

.dpanef-card-body {
    padding: 1.25rem;
}

/* Intitulé de l'indicateur */
.dpanef-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 700;
    color: #6c757d;
    margin-bottom: 0.35rem;
}

/* Valeur numérique de l'indicateur */
.dpanef-value {
    font-size: 1.5rem;
    font-weight: 800;
    color: #2c3e50;
    line-height: 1.2;
}

/* --- Bordures latérales gauches colorées (États des marchés) --- */

/* Total / Général (Bleu institutionnel) */
.border-left-total {
    border-left: 0.2rem solid black !important;
}

/* En cours (Bleu clair / Info) */
.border-left-encours {
    border-left: 0.2rem solid #007bff !important;
}

/* En attente (Orange / Avertissement) */
.border-left-attente {
    border-left: 0.2rem solid #858796 !important;
}

/* Terminés (Vert / Succès) */
.border-left-termines {
    border-left: 0.2rem solid #28a745 !important;
}

/* En arrêt (Gris neutre ou ambre foncé) */
.border-left-arret {
    border-left: 0.2rem solid #ffc107 !important;
}

/* Résiliés (Rouge / Danger) */
.border-left-resilies {
    border-left: 0.2rem solid #e74a3b !important;
}