/* ==========================================================================
   CSS GLOBAL - Variables & Reset
   ========================================================================== */

:root {
    /* Couleurs officielles du Niger */
    --color-niger-green: #008751;
    --color-niger-orange: #E05206;
    --color-niger-yellow: #FCD116;
    --color-niger-white: #FFFFFF;
    --color-niger-black: #000000;

    /* Thème clair */
    --color-primary: #008751;
    --color-secondary: #E05206;
    --color-accent: #FCD116;
    --color-background: #f8f9fa;
    --color-surface: #ffffff;
    --color-surface-variant: #f1f3f5;
    --color-text-primary: #1a1a1a;
    --color-text-secondary: #5c5c5c;
    --color-text-muted: #8a8a8a;
    --color-border: #e0e0e0;
    --color-success: #28a745;
    --color-warning: #ffc107;
    --color-danger: #dc3545;
    --color-info: #17a2b8;
    --color-purple: #6f42c1;

    /* Espacement */
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.25rem;
    --space-6: 1.5rem;
    --space-7: 1.75rem;
    --space-8: 2rem;
    --space-12: 3rem;
    --space-16: 4rem;

    /* Bordures */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-2xl: 24px;
    --radius-3xl: 32px;

    /* Ombres */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.1);
    --shadow-2xl: 0 25px 50px rgba(0, 0, 0, 0.15);

    /* Typographie */
    --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
    --text-xs: 0.75rem;
    --text-sm: 0.875rem;
    --text-base: 1rem;
    --text-lg: 1.125rem;
    --text-xl: 1.25rem;
    --text-2xl: 1.5rem;
    --text-3xl: 1.875rem;
    --text-4xl: 2.25rem;
    --text-5xl: 3rem;

    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
}

/* Thème sombre */
body.dark {
    --color-primary: #00a86b;
    --color-secondary: #ff6b35;
    --color-accent: #ffd700;
    --color-background: #121212;
    --color-surface: #1e1e1e;
    --color-surface-variant: #2d2d2d;
    --color-text-primary: #ffffff;
    --color-text-secondary: #b0b0b0;
    --color-text-muted: #6c6c6c;
    --color-border: #3a3a3a;
    --color-success: #2ecc71;
    --color-warning: #f39c12;
    --color-danger: #e74c3c;
    --color-info: #3498db;
    --color-purple: #9b59b6;
}

/* Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-sans);
    background: var(--color-background);
    color: var(--color-text-primary);
    line-height: 1.6;
    min-height: 100vh;
    transition: background-color var(--transition-normal);
    overflow-x: hidden;
}

/* ==========================================================================
   LAYOUT PRINCIPAL
   ========================================================================== */

.app-container {
    display: flex;
    min-height: 100vh;
    position: relative;
}

/* SIDEBAR ENHANCED */
.sidebar {
    width: 280px;
    background: linear-gradient(180deg, var(--color-surface) 0%, color-mix(in srgb, var(--color-surface), var(--color-background) 20%) 100%);
    border-right: 1px solid var(--color-border);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 1000;
    transition: transform var(--transition-normal);
    box-shadow: var(--shadow-lg);
}

.logo-container {
    padding: var(--space-8) var(--space-6);
    border-bottom: 1px solid var(--color-border);
    background: linear-gradient(135deg, rgba(0, 135, 81, 0.1), rgba(224, 82, 6, 0.1));
}

.logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-3);
    text-align: center;
}

.logo img {
    width: 60px;
    height: 60px;
    object-fit: contain;
}

.logo-text {
    font-weight: 900;
    font-size: var(--text-xl);
    background: linear-gradient(135deg, var(--color-niger-green), var(--color-niger-orange));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.5px;
    line-height: 1.2;
}

.logo-subtext {
    font-size: var(--text-xs);
    color: var(--color-text-muted);
    margin-top: var(--space-1);
}

/* MVP Banner */
.mvp-banner {
    background: linear-gradient(135deg, rgba(224, 82, 6, 0.95), rgba(252, 209, 22, 0.95));
    color: white;
    padding: var(--space-3) var(--space-6);
    text-align: center;
    font-weight: 600;
    font-size: var(--text-sm);
    border-bottom: 3px solid var(--color-niger-orange);
    box-shadow: var(--shadow-lg);
    position: sticky;
    top: 0;
    z-index: 1001;
}

.mvp-banner .mvp-label {
    background: rgba(0, 0, 0, 0.3);
    padding: var(--space-1) var(--space-3);
    border-radius: var(--radius-md);
    display: inline-block;
    margin-right: var(--space-2);
    font-weight: 800;
    letter-spacing: 1px;
}

/* Company Footer */
.company-footer {
    background: var(--color-surface);
    border-top: 2px solid var(--color-border);
    padding: var(--space-6) var(--space-8);
    margin-top: auto;
}

.company-info {
    max-width: 1600px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--space-6);
}

.company-section h3 {
    color: var(--color-primary);
    font-size: var(--text-lg);
    margin-bottom: var(--space-3);
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.company-section p {
    color: var(--color-text-secondary);
    line-height: 1.8;
    margin-bottom: var(--space-2);
}

.company-logo-footer {
    width: 80px;
    height: 80px;
    object-fit: contain;
    margin-bottom: var(--space-3);
}

.contact-item {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    margin-bottom: var(--space-2);
    color: var(--color-text-secondary);
}

.contact-item i {
    color: var(--color-primary);
    width: 20px;
}

.disclaimer {
    background: linear-gradient(135deg, rgba(224, 82, 6, 0.1), rgba(252, 209, 22, 0.1));
    border: 2px dashed var(--color-niger-orange);
    border-radius: var(--radius-lg);
    padding: var(--space-4);
    margin-top: var(--space-4);
    text-align: center;
}

.disclaimer strong {
    color: var(--color-niger-orange);
    font-size: var(--text-lg);
}

/* Navigation améliorée */
.sidebar-nav {
    flex: 1;
    padding: var(--space-6) 0;
    overflow-y: auto;
}

.nav-section {
    padding: 0 var(--space-4);
    margin-bottom: var(--space-6);
}

.nav-title {
    font-size: var(--text-xs);
    text-transform: uppercase;
    color: var(--color-text-muted);
    letter-spacing: 1px;
    margin-bottom: var(--space-3);
    padding-left: var(--space-3);
    font-weight: 600;
}

.nav-list {
    list-style: none;
}

.nav-item {
    margin-bottom: var(--space-2);
}

.nav-link {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    color: var(--color-text-secondary);
    text-decoration: none;
    border-radius: var(--radius-lg);
    transition: all var(--transition-fast);
    position: relative;
    overflow: hidden;
}

.nav-link:hover {
    background: var(--color-surface-variant);
    color: var(--color-text-primary);
    transform: translateX(4px);
}

.nav-link.active {
    background: linear-gradient(135deg, rgba(0, 135, 81, 0.15), rgba(224, 82, 6, 0.15));
    color: var(--color-primary);
    font-weight: 600;
    box-shadow: var(--shadow-sm);
}

.nav-link.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(to bottom, var(--color-niger-green), var(--color-niger-orange));
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.nav-icon {
    width: 24px;
    text-align: center;
    color: inherit;
    font-size: var(--text-lg);
}

.nav-text {
    flex: 1;
    font-weight: 500;
}

.nav-badge {
    background: var(--color-danger);
    color: white;
    font-size: var(--text-xs);
    padding: 2px 8px;
    border-radius: 12px;
    font-weight: 600;
    min-width: 24px;
    text-align: center;
}

/* User profile in sidebar */
.sidebar-user {
    padding: var(--space-6) var(--space-4);
    border-top: 1px solid var(--color-border);
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.user-avatar {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
    border-radius: var(--radius-xl);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: var(--text-lg);
    box-shadow: var(--shadow-md);
}

.user-info {
    flex: 1;
}

.user-name {
    font-weight: 600;
    font-size: var(--text-sm);
}

.user-role {
    font-size: var(--text-xs);
    color: var(--color-text-muted);
}

/* MAIN CONTENT */
.main-content {
    flex: 1;
    margin-left: 280px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: margin-left var(--transition-normal);
}

/* HEADER ENHANCED */
.main-header {
    padding: var(--space-4) var(--space-8);
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 500;
    backdrop-filter: blur(10px);
    background: color-mix(in srgb, var(--color-surface) 95%, transparent);
}

.header-left {
    display: flex;
    align-items: center;
    gap: var(--space-4);
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    color: var(--color-text-primary);
    font-size: var(--text-xl);
    cursor: pointer;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    transition: background-color var(--transition-fast);
}

.mobile-menu-btn:hover {
    background: var(--color-surface-variant);
}

.header-title h1 {
    font-size: var(--text-xl);
    font-weight: 700;
    background: linear-gradient(135deg, var(--color-text-primary), var(--color-primary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.header-title .subtitle {
    font-size: var(--text-sm);
    color: var(--color-text-secondary);
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.date-display {
    background: var(--color-surface);
    padding: var(--space-2) var(--space-4);
    border-radius: var(--radius-lg);
    border: 1px solid var(--color-border);
    font-weight: 600;
    color: var(--color-primary);
    display: flex;
    align-items: center;
    gap: var(--space-2);
    box-shadow: var(--shadow-sm);
}

/* CONTENT SECTIONS */
.content-wrapper {
    flex: 1;
    padding: var(--space-8);
    max-width: 1600px;
    margin: 0 auto;
    width: 100%;
}

.section-content {
    display: none;
    animation: fadeIn 0.4s ease;
}

.section-content.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==========================================================================
   COMPONENTS COMMUNS AMÉLIORÉS
   ========================================================================== */

/* Boutons améliorés */
.btn {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-4);
    border-radius: var(--radius-md);
    border: none;
    font-family: inherit;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    text-decoration: none;
    font-size: var(--text-sm);
    position: relative;
    overflow: hidden;
}

.btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 5px;
    height: 5px;
    background: rgba(255, 255, 255, 0.5);
    opacity: 0;
    border-radius: 100%;
    transform: scale(1, 1) translate(-50%);
    transform-origin: 50% 50%;
}

.btn:focus:not(:active)::after {
    animation: ripple 1s ease-out;
}

@keyframes ripple {
    0% {
        transform: scale(0, 0);
        opacity: 0.5;
    }

    100% {
        transform: scale(20, 20);
        opacity: 0;
    }
}

.btn-primary {
    background: linear-gradient(135deg, var(--color-primary), color-mix(in srgb, var(--color-primary), black 20%));
    color: white;
    box-shadow: var(--shadow-md);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    background: linear-gradient(135deg, var(--color-secondary), color-mix(in srgb, var(--color-secondary), black 20%));
    color: white;
    box-shadow: var(--shadow-md);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--color-border);
    color: var(--color-text-primary);
}

.btn-outline:hover {
    background: var(--color-surface-variant);
    border-color: var(--color-primary);
}

.btn-sm {
    padding: var(--space-1) var(--space-3);
    font-size: var(--text-xs);
}

.btn-lg {
    padding: var(--space-3) var(--space-6);
    font-size: var(--text-base);
}

/* KPI Cards améliorées */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--space-6);
    margin-bottom: var(--space-8);
}

.kpi-card {
    background: var(--color-surface);
    border-radius: var(--radius-xl);
    border: 1px solid var(--color-border);
    padding: var(--space-6);
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

.kpi-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--color-primary), var(--color-secondary));
}

.kpi-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
}

.kpi-card.danger::before {
    background: var(--color-danger);
}

.kpi-card.warning::before {
    background: var(--color-warning);
}

.kpi-card.success::before {
    background: var(--color-success);
}

.kpi-card.info::before {
    background: var(--color-info);
}

.kpi-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: var(--space-4);
}

.kpi-title {
    font-size: var(--text-sm);
    color: var(--color-text-secondary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.kpi-icon {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--text-2xl);
    color: white;
    box-shadow: var(--shadow-md);
}

.kpi-icon.primary {
    background: linear-gradient(135deg, var(--color-primary), #00a86b);
}

.kpi-icon.success {
    background: linear-gradient(135deg, var(--color-success), #1e7e34);
}

.kpi-icon.warning {
    background: linear-gradient(135deg, var(--color-warning), #e0a800);
}

.kpi-icon.danger {
    background: linear-gradient(135deg, var(--color-danger), #c82333);
}

.kpi-icon.info {
    background: linear-gradient(135deg, var(--color-info), #138496);
}

.kpi-value {
    font-size: var(--text-3xl);
    font-weight: 800;
    margin-bottom: var(--space-2);
    background: linear-gradient(135deg, var(--color-text-primary), var(--color-primary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.kpi-trend {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: var(--text-sm);
    font-weight: 600;
}

.trend-up {
    color: var(--color-success);
}

.trend-down {
    color: var(--color-danger);
}

/* Charts améliorés */
.charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(500px, 1fr));
    gap: var(--space-6);
    margin-bottom: var(--space-8);
}

.chart-container {
    background: var(--color-surface);
    border-radius: var(--radius-xl);
    border: 1px solid var(--color-border);
    padding: var(--space-6);
    box-shadow: var(--shadow-md);
    transition: transform var(--transition-normal);
}

.chart-container:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.chart-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-6);
}

.chart-title {
    font-size: var(--text-lg);
    font-weight: 700;
    color: var(--color-text-primary);
}

.chart-wrapper {
    position: relative;
    height: 300px;
}

/* Tableaux améliorés */
.table-section {
    background: var(--color-surface);
    border-radius: var(--radius-xl);
    border: 1px solid var(--color-border);
    overflow: hidden;
    margin-bottom: var(--space-8);
    box-shadow: var(--shadow-md);
}

.table-header {
    padding: var(--space-6);
    border-bottom: 1px solid var(--color-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--color-surface-variant);
}

.table-title {
    font-size: var(--text-lg);
    font-weight: 700;
}

.table-container {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 800px;
}

thead {
    background: var(--color-surface-variant);
}

th {
    padding: var(--space-4);
    text-align: left;
    font-weight: 600;
    color: var(--color-text-primary);
    border-bottom: 2px solid var(--color-border);
    white-space: nowrap;
}

td {
    padding: var(--space-4);
    border-bottom: 1px solid var(--color-border);
    color: var(--color-text-secondary);
}

tr:hover {
    background: var(--color-surface-variant);
}

/* Alertes améliorées */
.alerts-section {
    background: var(--color-surface);
    border-radius: var(--radius-xl);
    border: 1px solid var(--color-border);
    padding: var(--space-6);
    margin-bottom: var(--space-8);
    box-shadow: var(--shadow-md);
}

.alert-item {
    display: flex;
    align-items: flex-start;
    gap: var(--space-4);
    padding: var(--space-4);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-3);
    background: var(--color-surface-variant);
    border-left: 4px solid;
    transition: transform var(--transition-fast);
}

.alert-item:hover {
    transform: translateX(4px);
}

.alert-item.danger {
    border-left-color: var(--color-danger);
    background: color-mix(in srgb, var(--color-danger), transparent 95%);
}

.alert-item.warning {
    border-left-color: var(--color-warning);
    background: color-mix(in srgb, var(--color-warning), transparent 95%);
}

.alert-item.info {
    border-left-color: var(--color-info);
    background: color-mix(in srgb, var(--color-info), transparent 95%);
}

.alert-item.success {
    border-left-color: var(--color-success);
    background: color-mix(in srgb, var(--color-success), transparent 95%);
}

.alert-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    flex-shrink: 0;
    font-size: var(--text-lg);
}

.alert-icon.danger {
    background: var(--color-danger);
}

.alert-icon.warning {
    background: var(--color-warning);
}

.alert-icon.info {
    background: var(--color-info);
}

.alert-icon.success {
    background: var(--color-success);
}

.alert-content {
    flex: 1;
}

.alert-title {
    font-weight: 700;
    margin-bottom: var(--space-1);
    color: var(--color-text-primary);
}

.alert-description {
    font-size: var(--text-sm);
    color: var(--color-text-secondary);
    line-height: 1.5;
}

.alert-meta {
    display: flex;
    gap: var(--space-4);
    margin-top: var(--space-2);
    font-size: var(--text-xs);
}

.alert-impact {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
}

/* Badges améliorés */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: var(--text-xs);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-success {
    background: color-mix(in srgb, var(--color-success), transparent 90%);
    color: var(--color-success);
    border: 1px solid color-mix(in srgb, var(--color-success), transparent 70%);
}

.badge-warning {
    background: color-mix(in srgb, var(--color-warning), transparent 90%);
    color: var(--color-warning);
    border: 1px solid color-mix(in srgb, var(--color-warning), transparent 70%);
}

.badge-danger {
    background: color-mix(in srgb, var(--color-danger), transparent 90%);
    color: var(--color-danger);
    border: 1px solid color-mix(in srgb, var(--color-danger), transparent 70%);
}

.badge-info {
    background: color-mix(in srgb, var(--color-info), transparent 90%);
    color: var(--color-info);
    border: 1px solid color-mix(in srgb, var(--color-info), transparent 70%);
}

.badge-primary {
    background: color-mix(in srgb, var(--color-primary), transparent 90%);
    color: var(--color-primary);
    border: 1px solid color-mix(in srgb, var(--color-primary), transparent 70%);
}

/* Scénarios de prévision */
.forecast-scenarios {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-6);
    margin-bottom: var(--space-8);
}

.scenario-card {
    padding: var(--space-6);
    border-radius: var(--radius-xl);
    border: 2px solid transparent;
    background: var(--color-surface);
    transition: all var(--transition-normal);
    text-align: center;
    box-shadow: var(--shadow-md);
}

.scenario-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
}

.scenario-optimistic {
    border-color: var(--color-success);
    background: linear-gradient(135deg, color-mix(in srgb, var(--color-success), transparent 95%), var(--color-surface));
}

.scenario-realistic {
    border-color: var(--color-info);
    background: linear-gradient(135deg, color-mix(in srgb, var(--color-info), transparent 95%), var(--color-surface));
}

.scenario-pessimistic {
    border-color: var(--color-danger);
    background: linear-gradient(135deg, color-mix(in srgb, var(--color-danger), transparent 95%), var(--color-surface));
}

/* Sources de données */
.sources-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--space-6);
    margin-bottom: var(--space-8);
}

.source-card {
    background: var(--color-surface);
    border-radius: var(--radius-xl);
    padding: var(--space-6);
    border: 1px solid var(--color-border);
    transition: all var(--transition-normal);
    box-shadow: var(--shadow-md);
}

.source-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.source-header {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    margin-bottom: var(--space-4);
}

.source-icon {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--text-xl);
    color: white;
    background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
    flex-shrink: 0;
}

.source-status {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    margin-left: auto;
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.status-dot.online {
    background: var(--color-success);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-success), transparent 80%);
}

.status-dot.delayed {
    background: var(--color-warning);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-warning), transparent 80%);
}

.status-dot.offline {
    background: var(--color-danger);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-danger), transparent 80%);
}

.progress-bar {
    height: 8px;
    background: var(--color-surface-variant);
    border-radius: 4px;
    overflow: hidden;
    margin-top: var(--space-2);
}

.progress-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 1s ease;
}

/* Rapports et export */
.export-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--space-6);
    margin-bottom: var(--space-8);
}

.export-card {
    background: var(--color-surface);
    border-radius: var(--radius-xl);
    padding: var(--space-6);
    border: 1px solid var(--color-border);
    text-align: center;
    transition: all var(--transition-normal);
    cursor: pointer;
    box-shadow: var(--shadow-md);
}

.export-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
    border-color: var(--color-primary);
}

.export-icon {
    font-size: var(--text-4xl);
    margin-bottom: var(--space-4);
    color: var(--color-primary);
    height: 80px;
    width: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto var(--space-4);
    background: linear-gradient(135deg, rgba(0, 135, 81, 0.1), rgba(224, 82, 6, 0.1));
    border-radius: var(--radius-xl);
}

/* Risk Matrix */
.risk-matrix {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-6);
    margin-bottom: var(--space-8);
}

.risk-card {
    background: var(--color-surface);
    border-radius: var(--radius-xl);
    padding: var(--space-6);
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-md);
}

/* AI Insights */
.ai-insights {
    background: linear-gradient(135deg, rgba(0, 135, 81, 0.05), rgba(224, 82, 6, 0.05));
    border-radius: var(--radius-xl);
    padding: var(--space-6);
    margin-bottom: var(--space-8);
    border: 1px solid var(--color-border);
}

.ai-header {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    margin-bottom: var(--space-4);
}

.ai-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: var(--text-xl);
}

/* Footer */
.main-footer {
    padding: var(--space-8);
    border-top: 1px solid var(--color-border);
    background: var(--color-surface);
    text-align: center;
}

.sovereignty-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    background: linear-gradient(135deg, rgba(0, 135, 81, 0.1), rgba(224, 82, 6, 0.1));
    color: var(--color-primary);
    padding: var(--space-2) var(--space-4);
    border-radius: var(--radius-xl);
    font-weight: 600;
    margin-top: var(--space-4);
}

/* Utilitaires */
.mt-2 {
    margin-top: var(--space-2);
}

.mt-4 {
    margin-top: var(--space-4);
}

.mt-6 {
    margin-top: var(--space-6);
}

.mt-8 {
    margin-top: var(--space-8);
}

.mb-2 {
    margin-bottom: var(--space-2);
}

.mb-4 {
    margin-bottom: var(--space-4);
}

.mb-6 {
    margin-bottom: var(--space-6);
}

.mb-8 {
    margin-bottom: var(--space-8);
}

.p-4 {
    padding: var(--space-4);
}

.p-6 {
    padding: var(--space-6);
}

/* Responsive */
@media (max-width: 1400px) {
    .charts-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 1200px) {
    .forecast-scenarios {
        grid-template-columns: 1fr;
    }

    .risk-matrix {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.active {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
    }

    .mobile-menu-btn {
        display: flex;
        align-items: center;
        justify-content: center;
    }
}

@media (max-width: 768px) {
    .kpi-grid {
        grid-template-columns: 1fr;
    }

    .sources-grid {
        grid-template-columns: 1fr;
    }

    .export-grid {
        grid-template-columns: 1fr;
    }

    .content-wrapper {
        padding: var(--space-4);
    }

    .main-header {
        padding: var(--space-4);
        flex-direction: column;
        gap: var(--space-4);
        align-items: flex-start;
    }

    .header-actions {
        width: 100%;
        justify-content: space-between;
    }
}

/* Toast notifications */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    padding: 16px 20px;
    border-radius: var(--radius-lg);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-xl);
    display: flex;
    align-items: center;
    gap: 12px;
    animation: slideInRight 0.3s ease;
    max-width: 400px;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.toast.success {
    border-left: 4px solid var(--color-success);
}

.toast.warning {
    border-left: 4px solid var(--color-warning);
}

.toast.danger {
    border-left: 4px solid var(--color-danger);
}

.toast.info {
    border-left: 4px solid var(--color-info);
}

.toast-close {
    margin-left: auto;
    background: none;
    border: none;
    color: var(--color-text-muted);
    cursor: pointer;
    font-size: 18px;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
}

.toast-close:hover {
    background: var(--color-surface-variant);
}

/* Loading states */
.loading {
    position: relative;
    overflow: hidden;
}

.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    animation: loading 1.5s infinite;
}

@keyframes loading {
    100% {
        left: 100%;
    }
}

/* Tooltips */
[data-tooltip] {
    position: relative;
}

[data-tooltip]:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 6px 12px;
    background: var(--color-surface);
    color: var(--color-text-primary);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    font-size: var(--text-xs);
    white-space: nowrap;
    z-index: 1000;
    box-shadow: var(--shadow-lg);
}

/* Button group */
.btn-group {
    display: inline-flex;
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--color-border);
}

.btn-group .btn {
    border-radius: 0;
    border: none;
    border-right: 1px solid var(--color-border);
}

.btn-group .btn:last-child {
    border-right: none;
}

.btn-group .btn.active {
    background: var(--color-primary);
    color: white;
}
