/* assets/css/style.css - VERSION ENTREPRISE */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    --primary: #0044cc;
    --primary-dark: #003399;
    --sidebar-bg: #0f172a;  /* Bleu Nuit Profond */
    --sidebar-hover: #1e293b;
    --bg-light: #f8fafc;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
}

* { box-sizing: border-box; }

body {
    margin: 0; padding: 0;
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-light);
    color: var(--text-main);
    font-size: 14px;
    height: 100vh; /* Prend toute la hauteur de l'écran */
    display: flex; /* Active le mode Flexbox */
    overflow: hidden; /* Empêche le scroll global moche */
}

a { text-decoration: none; color: inherit; }
ul { list-style: none; padding: 0; margin: 0; }

/* === 1. SIDEBAR (GAUCHE - SCROLL INDÉPENDANT) === */
.sidebar {
    width: 260px;
    background-color: var(--sidebar-bg);
    color: #94a3b8;
    display: flex;
    flex-direction: column;
    height: 100vh; /* Hauteur totale */
    flex-shrink: 0;
    border-right: 1px solid rgba(255,255,255,0.05);
}

/* En-tête Logo */
.sidebar-header {
    height: 70px;
    min-height: 70px;
    display: flex; align-items: center; padding: 0 24px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}
.brand-title { color: white; font-weight: 800; font-size: 18px; letter-spacing: 0.5px; display: flex; align-items: center; gap: 10px; }

/* AJOUT POUR LE BOUTON AGENCE */
.agency-badge {
    background-color: #f59e0b; /* Jaune Orange LCA */
    color: #0f172a;
    font-weight: 800;
    font-size: 11px;
    padding: 10px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: center;
    box-shadow: 0 4px 6px rgba(0,0,0,0.2);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Zone Menu qui Défile */
.sidebar-menu-wrapper {
    flex: 1; /* Prend tout l'espace restant */
    overflow-y: auto; /* Active le scroll vertical ICI */
    padding: 20px 0;
}
/* Scrollbar personnalisée fine pour le menu */
.sidebar-menu-wrapper::-webkit-scrollbar { width: 4px; }
.sidebar-menu-wrapper::-webkit-scrollbar-thumb { background: #334155; border-radius: 2px; }

.menu-category {
    font-size: 11px; font-weight: 700; text-transform: uppercase;
    color: #475569; margin: 25px 24px 10px; letter-spacing: 1px;
}

.nav-link {
    display: flex; align-items: center;
    padding: 12px 24px;
    color: #cbd5e1; font-weight: 500; font-size: 13.5px;
    transition: all 0.2s; border-left: 3px solid transparent;
    cursor: pointer;
}
.nav-link:hover, .nav-link.active {
    background-color: var(--sidebar-hover);
    color: white;
    border-left-color: var(--primary);
}
.nav-link svg { width: 20px; height: 20px; margin-right: 12px; opacity: 0.9; }
.nav-arrow { margin-left: auto; width: 14px; height: 14px; transition: 0.3s; opacity: 0.5; }

/* Sous-menus */
.submenu {
    display: none;
    background: #020617;
    padding: 5px 0;
}
.has-submenu.open .submenu { display: block; }
.has-submenu.open .nav-arrow { transform: rotate(90deg); opacity: 1; }

.submenu a {
    display: block; padding: 10px 24px 10px 60px; /* Indentation */
    font-size: 13px; color: #64748b; transition: 0.2s;
}
.submenu a:hover { color: white; padding-left: 65px; }

.sidebar-footer {
    padding: 20px; border-top: 1px solid rgba(255,255,255,0.05);
}

/* === 2. CONTENU PRINCIPAL (DROITE - SCROLL INDÉPENDANT) === */
.main-content {
    flex: 1; /* Prend le reste de la largeur */
    height: 100vh;
    overflow-y: auto; /* Scroll vertical pour la page */
    background: var(--bg-light);
    display: flex; flex-direction: column;
}

.topbar {
    height: 70px; background: white; border-bottom: 1px solid var(--border-color);
    display: flex; justify-content: space-between; align-items: center;
    padding: 0 40px; position: sticky; top: 0; z-index: 50;
}

.page-wrapper {
    padding: 30px 40px;
    max-width: 1600px; margin: 0 auto; width: 100%;
}

/* CARTES ET KPI */
.welcome-banner {
    background: linear-gradient(135deg, #0044cc 0%, #0033aa 100%);
    color: white; padding: 40px; border-radius: 16px; margin-bottom: 40px;
    box-shadow: 0 10px 30px -10px rgba(0, 68, 204, 0.4);
    position: relative; overflow: hidden;
}

.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); /* Responsive intelligent */
    gap: 30px; margin-bottom: 40px;
}

.kpi-card {
    background: white; padding: 25px; border-radius: 12px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.03); border: 1px solid var(--border-color);
    display: flex; align-items: flex-start; justify-content: space-between;
    transition: transform 0.2s;
}
.kpi-card:hover { transform: translateY(-5px); border-color: #bfdbfe; }

.kpi-icon {
    width: 48px; height: 48px; border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    color: var(--primary); background: #eff6ff;
}
.kpi-icon svg { width: 24px; height: 24px; }

/* ACTIONS RAPIDES */
.section-title { font-size: 16px; font-weight: 700; margin-bottom: 20px; color: var(--text-main); }

.actions-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 20px;
}

.action-card {
    background: white; padding: 20px; border-radius: 12px;
    border: 1px solid var(--border-color); box-shadow: 0 2px 4px rgba(0,0,0,0.02);
    display: flex; flex-direction: column; align-items: center; gap: 15px; text-align: center;
    cursor: pointer; transition: 0.2s;
}
.action-card:hover { border-color: var(--primary); box-shadow: 0 5px 15px rgba(0,68,204,0.1); }
.action-card span { font-weight: 600; color: #334155; }