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

:root {
    /* Colors - Primary */
    --color-primary: #4f46e5;
    --color-primary-hover: #4338ca;
    --color-primary-light: rgba(79, 70, 229, 0.1);

    /* Colors - Semantic */
    --color-success: #10b981;
    --color-warning: #f59e0b;
    --color-danger: #ef4444;
    --color-info: #3b82f6;

    /* Colors - Gray Scale */
    --color-gray-50: #f9fafb;
    --color-gray-100: #f3f4f6;
    --color-gray-200: #e5e7eb;
    --color-gray-300: #d1d5db;
    --color-gray-400: #9ca3af;
    --color-gray-500: #6b7280;
    --color-gray-600: #4b5563;
    --color-gray-700: #374151;
    --color-gray-800: #1f2937;
    --color-gray-900: #111827;

    /* Colors - Regions (consistent across app) */
    --color-region-eu: #4f46e5;      /* Indigo */
    --color-region-ap: #10b981;      /* Green */
    --color-region-us: #f59e0b;      /* Amber */

    /* Background */
    --bg-primary: #ffffff;
    --bg-secondary: #f4f4f5;
    --bg-tertiary: #f9fafb;

    /* Text */
    --text-primary: #111827;
    --text-secondary: #6b7280;
    --text-tertiary: #9ca3af;
    --text-inverse: #ffffff;

    /* Borders */
    --border-color: #e5e7eb;
    --border-color-light: #f3f4f6;
    --border-color-dark: #d1d5db;

    /* Spacing */
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;
    --spacing-2xl: 48px;

    /* Border Radius */
    --radius-sm: 4px;
    --radius-md: 6px;
    --radius-lg: 8px;
    --radius-xl: 12px;

    /* Shadows */
    --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.15);

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-base: 200ms ease;
    --transition-slow: 300ms ease;

    /* Z-index layers */
    --z-base: 1;
    --z-dropdown: 100;
    --z-sticky: 200;
    --z-fixed: 300;
    --z-modal-backdrop: 400;
    --z-modal: 500;
    --z-popover: 600;
    --z-toast: 700;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: var(--bg-secondary);
    min-height: 100vh;
    padding: 0;
    color: var(--text-primary);
    display: flex;
    margin: 0;
    overflow-x: hidden;
    max-width: 100vw;
}

/* Menu latéral */
.sidebar {
    width: 240px;
    background: #1f2937;
    color: white;
    height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    z-index: 1000;
    border-right: 1px solid #374151;
    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-header h2 {
    margin: 0;
    font-size: 1.5em;
    color: white;
}

.sidebar-nav {
    padding: 20px 0;
}

.nav-section {
    margin-bottom: 30px;
}

.nav-section-title {
    padding: 10px 20px;
    font-size: 0.85em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.6);
    font-weight: 600;
    letter-spacing: 1px;
    margin: 0;
}

.nav-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.nav-item {
    margin: 0;
}

.nav-item a {
    display: block;
    padding: 12px 20px;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: all 0.3s;
    border-left: 3px solid transparent;
}

.nav-item a:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.nav-item.active a {
    background: rgba(79, 70, 229, 0.15);
    color: white;
    border-left-color: #4f46e5;
}

.container {
    flex: 1;
    margin-left: 240px;
    width: calc(100% - 240px);
    max-width: calc(100% - 240px);
    background: #f4f4f5;
    min-height: 100vh;
    padding: 24px;
    overflow-x: hidden;
    box-sizing: border-box;
}

.container > * {
    max-width: 100%;
    box-sizing: border-box;
}

header {
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid #e5e7eb;
}

header h1 {
    font-size: 1.875rem;
    font-weight: 600;
    color: #111827;
    margin-bottom: 4px;
}

header p {
    color: #6b7280;
    font-size: 0.875rem;
}

/* Filtres */
.filters {
    background: white;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 24px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.filters h2 {
    margin-bottom: 16px;
    color: #111827;
    font-size: 1.125rem;
    font-weight: 600;
}

.filters-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.filter-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    align-items: end;
}

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

.filter-item-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.filter-item label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    font-size: 0.875rem;
    color: #374151;
}

.filter-item select,
.filter-item input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.875rem;
    background: white;
    color: #111827;
    transition: border-color 0.2s;
}

.filter-item select:hover,
.filter-item input:hover {
    border-color: #9ca3af;
}

.filter-item select:focus,
.filter-item input:focus {
    outline: none;
    border-color: #4f46e5;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.filter-actions {
    display: flex;
    gap: 12px;
    padding-top: 8px;
    border-top: 1px solid #e5e7eb;
}

.btn-primary,
.btn-secondary {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    font-size: 0.875rem;
    transition: all 0.2s;
}

.btn-primary {
    background: #4f46e5;
    color: white;
}

.btn-primary:hover {
    background: #4338ca;
}

.btn-secondary {
    background: #6b7280;
    color: white;
}

.btn-secondary:hover {
    background: #4b5563;
}


/* Vue d'ensemble */
.overview {
    margin-bottom: 24px;
}

.overview h2 {
    margin-bottom: 16px;
    color: #111827;
    font-size: 1.125rem;
    font-weight: 600;
}

.stats-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 2fr;
    gap: 16px;
    max-width: 100%;
}

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

.stat-card {
    background: white;
    color: #111827;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.stat-card-large {
    /* Card principale pour le coût total */
}

.stat-card-small {
    padding: 16px;
    text-align: center;
}

.stat-card h3 {
    font-size: 0.875rem;
    color: #6b7280;
    margin-bottom: 8px;
    font-weight: 500;
}

.stat-value {
    font-size: 1.875rem;
    font-weight: 600;
    color: #111827;
}

.stat-value-small {
    font-size: 1.5rem;
}

.stat-value-medium {
    font-size: 1.25rem;
}

/* Insights Grid */
.insights-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-top: 16px;
}

.insight-card {
    background: white;
    padding: 16px;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.insight-icon {
    font-size: 1.5rem;
    line-height: 1;
}

.insight-content {
    flex: 1;
    min-width: 0;
}

.insight-content h4 {
    font-size: 0.75rem;
    color: #6b7280;
    margin: 0 0 4px 0;
    font-weight: 500;
    text-transform: uppercase;
}

.insight-value {
    font-size: 1.25rem;
    font-weight: 600;
    color: #111827;
    margin: 0;
}

.insight-detail {
    font-size: 0.75rem;
    color: #6b7280;
    margin: 4px 0 0 0;
}

.insight-card.forecast .insight-value {
    color: #4f46e5;
}

.insight-card.savings .insight-value {
    color: #16a34a;
}

/* Anomalies Section */
.anomalies-section {
    margin-bottom: 24px;
}

.anomalies-section h2 {
    margin-bottom: 16px;
    color: #111827;
    font-size: 1.125rem;
    font-weight: 600;
}

.anomalies-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 12px;
}

.anomaly-card {
    background: white;
    padding: 16px;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 12px;
    border-left: 4px solid #e5e7eb;
}

.anomaly-card.warning {
    border-left-color: #f59e0b;
    background: #fffbeb;
}

.anomaly-card.danger {
    border-left-color: #dc2626;
    background: #fef2f2;
}

.anomaly-card.info {
    border-left-color: #3b82f6;
    background: #eff6ff;
}

.anomaly-card.success {
    border-left-color: #16a34a;
    background: #f0fdf4;
}

.anomaly-icon {
    font-size: 1.25rem;
}

.anomaly-content {
    flex: 1;
}

.anomaly-title {
    font-weight: 600;
    color: #111827;
    font-size: 0.875rem;
    margin: 0 0 4px 0;
}

.anomaly-detail {
    font-size: 0.75rem;
    color: #6b7280;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 180px;
}

.anomaly-accounts {
    font-size: 0.65rem;
    color: #9ca3af;
    margin: 2px 0 0 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 180px;
    font-style: italic;
}

.anomaly-value {
    font-weight: 600;
    font-size: 0.875rem;
    text-align: right;
}

.anomaly-value.positive {
    color: #dc2626;
}

.anomaly-value.negative {
    color: #16a34a;
}

.no-anomalies {
    grid-column: 1 / -1;
    text-align: center;
    padding: 20px;
    color: #16a34a;
    background: #f0fdf4;
    border-radius: 8px;
}

@media (max-width: 1100px) {
    .insights-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

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

/* Graphiques - grille avec proportions ajustées */
.charts {
    display: grid;
    grid-template-columns: 1fr 1.5fr 1fr;
    gap: 16px;
    margin-bottom: 24px;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    box-sizing: border-box;
}

/* Grille de graphiques générique */
.charts-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.charts-grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

@media (max-width: 1200px) {
    .charts-grid-3 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 800px) {
    .charts-grid,
    .charts-grid-3 {
        grid-template-columns: 1fr;
    }
}

.chart-container {
    background: white;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    min-width: 0;
}

.chart-container h3 {
    margin-bottom: 16px;
    color: #111827;
    font-size: 1rem;
    font-weight: 600;
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.chart-header h3 {
    margin-bottom: 0;
}

.legend-mode-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
}

.legend-mode-label {
    font-size: 0.75rem;
    color: #6b7280;
}

.legend-mode-btn {
    padding: 4px 10px;
    font-size: 0.75rem;
    font-weight: 500;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    background: #f9fafb;
    color: #374151;
    cursor: pointer;
    transition: all 0.2s;
}

.legend-mode-btn:hover {
    background: #f3f4f6;
    border-color: #9ca3af;
}

.legend-mode-btn.include-mode {
    background: #dbeafe;
    border-color: #3b82f6;
    color: #1d4ed8;
}

.chart-container canvas {
    max-height: 300px;
}

/* Graphique des services - plus de hauteur pour les labels */
.chart-container.chart-services {
    min-height: 400px;
}

.chart-container.chart-services canvas {
    min-height: 350px;
    max-height: 450px;
    height: 380px !important;
}

/* Graphique Timeline - pleine largeur et plus grand */
.chart-container.chart-timeline {
    grid-column: 1 / -1;
    width: 100%;
}

.chart-container.chart-timeline canvas {
    max-height: 550px;
    min-height: 450px;
    width: 100% !important;
    height: 450px !important;
}

/* Graphique des contributeurs GitHub - plus de hauteur pour les barres horizontales */
.chart-container.chart-contributors {
    min-height: 350px;
}

.chart-container.chart-contributors canvas {
    min-height: 280px;
    max-height: 350px;
    height: 300px !important;
}

/* En-tête de graphique avec filtre */
.chart-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.chart-header-row h3 {
    margin: 0;
}

.chart-filter {
    display: flex;
    align-items: center;
    gap: 8px;
}

.chart-filter label {
    font-size: 13px;
    color: #666;
}

.chart-filter select {
    padding: 6px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 13px;
    background: white;
    cursor: pointer;
}

/* Légende personnalisée cliquable */
.custom-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px 0;
    justify-content: center;
}

.custom-legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s ease;
    background: #f5f5f5;
    border: 1px solid #ddd;
}

.custom-legend-item:hover {
    background: #e8e8e8;
}

.custom-legend-item.selected {
    background: #e3f2fd;
    border-color: #2196f3;
}

.custom-legend-item.dimmed {
    opacity: 0.4;
}

.legend-reset-btn {
    display: none;
    margin-bottom: 8px;
    padding: 4px 12px;
    font-size: 12px;
    background: #f0f0f0;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    color: #666;
    transition: all 0.2s;
}

.legend-reset-btn:hover {
    background: #e0e0e0;
    border-color: #ccc;
}

.custom-legend-item .legend-color {
    width: 14px;
    height: 14px;
    border-radius: 3px;
    flex-shrink: 0;
}

.custom-legend-item .legend-label {
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Tableaux */
.tables {
    display: grid;
    gap: 30px;
}

.table-container {
    background: white;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.table-container h3 {
    margin-bottom: 15px;
    color: #333;
}

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

table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 6px;
    overflow: hidden;
}

thead {
    background: #f9fafb;
    color: #374151;
    border-bottom: 2px solid #e5e7eb;
}

th, td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
}

th {
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85em;
}

tbody tr:hover {
    background: #f8f9fa;
}

tbody tr:nth-child(even) {
    background: #fafbfc;
}

tbody tr:nth-child(even):hover {
    background: #f1f3f5;
}

.text-right {
    text-align: right !important;
}

td.text-right {
    font-variant-numeric: tabular-nums;
}

.loading {
    text-align: center;
    color: #999;
    font-style: italic;
    padding: 20px !important;
}

/* Badge pour les types d'utilisateurs */
.badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
    background: #e3f2fd;
    color: #1565c0;
}

.badge.success {
    background: #d4edda;
    color: #155724;
}

.badge.warning {
    background: #fff3cd;
    color: #856404;
}

.badge.danger {
    background: #f8d7da;
    color: #721c24;
}

/* KPI Card highlight (coût) */
.kpi-card.highlight {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.kpi-card.highlight h3 {
    color: rgba(255, 255, 255, 0.9);
}

.kpi-card.highlight .kpi-value {
    color: white;
}

.kpi-card.highlight .kpi-detail {
    color: rgba(255, 255, 255, 0.8);
}

.kpi-card.highlight-success {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    color: white;
}

.kpi-card.highlight-success h3,
.kpi-card.highlight-success .kpi-value {
    color: white;
}

.kpi-card.highlight-success .kpi-detail {
    color: rgba(255, 255, 255, 0.8);
}

.kpi-card.highlight-warning {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
}

.kpi-card.highlight-warning h3,
.kpi-card.highlight-warning .kpi-value {
    color: white;
}

.kpi-card.highlight-warning .kpi-detail {
    color: rgba(255, 255, 255, 0.8);
}

/* KPIs Grid 4 colonnes */
.kpis-grid-4 {
    grid-template-columns: repeat(4, 1fr);
}

@media (max-width: 1200px) {
    .kpis-grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .kpis-grid-4 {
        grid-template-columns: 1fr;
    }
}

/* KPIs Grid 5 colonnes */
.kpis-grid-5 {
    grid-template-columns: repeat(5, 1fr);
}

@media (max-width: 1400px) {
    .kpis-grid-5 {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 900px) {
    .kpis-grid-5 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .kpis-grid-5 {
        grid-template-columns: 1fr;
    }
}

/* KPIs avec camembert (CircleCI) */
.kpis-with-chart {
    display: flex;
    gap: 24px;
    margin-bottom: 24px;
    align-items: stretch;
}

.kpis-with-chart .kpis-grid-3 {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.kpi-pie-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    min-width: 280px;
    max-width: 320px;
    display: flex;
    flex-direction: column;
}

.kpi-pie-card h3 {
    margin: 0 0 12px 0;
    font-size: 14px;
    color: #666;
    text-align: center;
}

.pie-chart-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 120px;
    max-height: 150px;
}

.pie-chart-wrapper canvas {
    max-width: 140px !important;
    max-height: 140px !important;
}

.pie-chart-legend {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 12px;
}

.pie-legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border-radius: 6px;
    background: #f8f9fa;
}

.pie-legend-item.success {
    border-left: 3px solid #4caf50;
}

.pie-legend-item.failure {
    border-left: 3px solid #f44336;
}

.pie-legend-item .legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.pie-legend-item.success .legend-dot {
    background: #4caf50;
}

.pie-legend-item.failure .legend-dot {
    background: #f44336;
}

.pie-legend-item .legend-text {
    flex: 1;
    font-size: 13px;
    color: #333;
}

.pie-legend-item .legend-value {
    font-weight: 600;
    font-size: 14px;
    color: #333;
}

.pie-legend-item .legend-percent {
    font-size: 13px;
    color: #666;
    min-width: 45px;
    text-align: right;
}

@media (max-width: 1200px) {
    .kpis-with-chart {
        flex-direction: column;
    }

    .kpi-pie-card {
        max-width: 100%;
        flex-direction: row;
        align-items: center;
        gap: 24px;
    }

    .kpi-pie-card h3 {
        display: none;
    }

    .pie-chart-wrapper {
        min-height: auto;
        max-height: 100px;
    }

    .pie-chart-wrapper canvas {
        max-width: 100px !important;
        max-height: 100px !important;
    }

    .pie-chart-legend {
        flex-direction: row;
        flex: 1;
        margin-top: 0;
    }

    .pie-legend-item {
        flex: 1;
    }
}

@media (max-width: 900px) {
    .kpis-with-chart .kpis-grid-3 {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 600px) {
    .kpis-with-chart .kpis-grid-3 {
        grid-template-columns: 1fr;
    }

    .kpi-pie-card {
        flex-direction: column;
    }

    .kpi-pie-card h3 {
        display: block;
    }

    .pie-chart-legend {
        flex-direction: column;
    }
}

/* Section Import */
.import-section {
    margin-bottom: 24px;
    display: block !important;
}

.import-section[style*="display: none"] {
    display: none !important;
}

.import-card {
    background: white;
    padding: 24px;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.import-card-global {
    background: linear-gradient(135deg, #f0f9ff, #e0f2fe);
    border: 2px solid #0ea5e9;
    margin-bottom: 24px;
}

.import-card-global h3 {
    font-size: 1.1rem;
    margin-bottom: 16px;
}

.btn-import-all {
    padding: 10px 32px;
    font-size: 1rem;
    font-weight: 600;
}

.import-description {
    color: #6b7280;
    font-size: 0.875rem;
    margin-bottom: 20px;
}

.import-filters {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.import-actions {
    margin-bottom: 16px;
}

.import-status {
    padding: 12px 16px;
    border-radius: 6px;
    font-size: 0.875rem;
    margin-top: 16px;
}

.import-status-success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.import-status-error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.import-status-info {
    background: #dbeafe;
    color: #1e40af;
    border: 1px solid #bfdbfe;
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Section Analytics */
.analytics-section {
    display: block;
}

.analytics-filters {
    background: white;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    margin-bottom: 24px;
    display: flex;
    gap: 20px;
    align-items: flex-end;
    flex-wrap: wrap;
}

.analytics-filters .filter-item {
    min-width: 200px;
}

.analytics-summary {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.analytics-card {
    background: white;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.analytics-card h3 {
    font-size: 0.875rem;
    color: #6b7280;
    margin-bottom: 8px;
    font-weight: 500;
}

.analytics-value {
    font-size: 1.75rem;
    font-weight: 600;
    color: #111827;
    margin: 0;
}

.analytics-value.positive {
    color: #dc2626;
}

.analytics-value.negative {
    color: #16a34a;
}

.analytics-detail {
    font-size: 0.875rem;
    color: #6b7280;
    margin: 4px 0 0 0;
}

.analytics-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.analytics-panel {
    background: white;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.analytics-panel h3 {
    font-size: 1rem;
    color: #111827;
    margin-bottom: 16px;
    font-weight: 600;
}

.variation-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.variation-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: #f9fafb;
    border-radius: 6px;
    border-left: 4px solid #e5e7eb;
}

.variation-item.increase {
    border-left-color: #dc2626;
}

.variation-item.decrease {
    border-left-color: #16a34a;
}

.variation-item-name {
    font-weight: 500;
    color: #111827;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-right: 12px;
}

.variation-item-values {
    text-align: right;
    min-width: 150px;
}

.variation-item-change {
    font-weight: 600;
    font-size: 1rem;
}

.variation-item-change.positive {
    color: #dc2626;
}

.variation-item-change.negative {
    color: #16a34a;
}

.variation-item-detail {
    font-size: 0.75rem;
    color: #6b7280;
    margin-top: 2px;
}

@media (max-width: 900px) {
    .analytics-summary {
        grid-template-columns: 1fr;
    }

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

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

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

@media (max-width: 768px) {
    .sidebar {
        width: 200px;
    }

    .container {
        margin-left: 200px;
        max-width: calc(100% - 200px);
        padding: 16px;
    }

    .filter-row {
        grid-template-columns: 1fr;
    }

    .filter-item-group {
        grid-template-columns: 1fr;
    }

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

@media (max-width: 600px) {
    .sidebar {
        width: 0;
        overflow: hidden;
    }

    .container {
        margin-left: 0;
        max-width: 100%;
    }
}

/* ======================= */
/* Section Déploiements    */
/* ======================= */
.deployments-section {
    margin-top: 2rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, #1e3a5f 0%, #0f172a 100%);
    border-radius: 12px;
    color: white;
}

.deployments-section h2 {
    margin: 0 0 1.5rem 0;
    font-size: 1.5rem;
    color: white;
}

.deployments-summary {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.deploy-stat {
    background: rgba(255, 255, 255, 0.1);
    padding: 1rem 1.5rem;
    border-radius: 8px;
    text-align: center;
    min-width: 100px;
}

.deploy-stat.success {
    background: rgba(74, 222, 128, 0.2);
    border-left: 3px solid #4ade80;
}

.deploy-stat.failure {
    background: rgba(248, 113, 113, 0.2);
    border-left: 3px solid #f87171;
}

.deploy-stat-value {
    display: block;
    font-size: 1.75rem;
    font-weight: 700;
    color: white;
}

.deploy-stat-label {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.7);
    margin-top: 4px;
}

.deployments-section .chart-container {
    background: rgba(255, 255, 255, 0.05);
    margin-bottom: 1.5rem;
}

.deployments-section .chart-container h3 {
    color: white;
}

.deployments-timeline {
    max-height: 400px;
    overflow-y: auto;
}

.deployment-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    margin-bottom: 0.5rem;
    transition: background 0.2s;
}

.deployment-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

.deployment-status {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.deployment-status.success {
    background: #4ade80;
    box-shadow: 0 0 8px rgba(74, 222, 128, 0.5);
}

.deployment-status.failed {
    background: #f87171;
    box-shadow: 0 0 8px rgba(248, 113, 113, 0.5);
}

.deployment-status.running {
    background: #60a5fa;
    box-shadow: 0 0 8px rgba(96, 165, 250, 0.5);
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.deployment-info {
    flex: 1;
    min-width: 0;
}

.deployment-project {
    font-weight: 600;
    color: white;
    font-size: 0.95rem;
}

.deployment-workflow {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.7);
}

.deployment-pipeline {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.5);
    font-weight: 400;
}

.deployment-tag {
    font-size: 0.75rem;
    color: #fbbf24;
    background: rgba(251, 191, 36, 0.15);
    padding: 2px 8px;
    border-radius: 4px;
    display: inline-block;
    margin-top: 4px;
    margin-right: 4px;
}

.deployment-branch {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
    background: rgba(255, 255, 255, 0.1);
    padding: 2px 8px;
    border-radius: 4px;
    display: inline-block;
    margin-top: 4px;
}

.deployment-time {
    text-align: right;
    flex-shrink: 0;
}

.deployment-date {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.9);
}

.deployment-duration {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
}

/* Tableau filtrable des déploiements */
.deploy-filter-table-container {
    background: #1e293b;
    border-radius: 8px;
    padding: 16px;
    margin: 16px 0;
    max-height: 320px;
    overflow-y: auto;
}

.deploy-filter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.deploy-filter-header h3 {
    color: white;
    font-size: 0.95rem;
    margin: 0;
}

.deploy-filter-table,
.deploy-filter-table thead,
.deploy-filter-table tbody {
    background: #1e293b;
}

.deploy-filter-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
    border-radius: 0;
}

.deploy-filter-table thead th {
    text-align: left;
    padding: 8px 12px;
    color: rgba(255, 255, 255, 0.6);
    font-weight: 500;
    text-transform: uppercase;
    font-size: 0.75rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    position: sticky;
    top: 0;
    background: #1e293b;
}

.deploy-filter-table tbody tr {
    cursor: pointer;
    transition: background 0.15s;
    background: transparent;
}

.deploy-filter-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.08);
}

.deploy-filter-table tbody tr.selected {
    background: rgba(59, 130, 246, 0.25);
}

.deploy-filter-table tbody tr.selected td:first-child::before {
    content: '✓ ';
    color: #3b82f6;
    font-weight: bold;
}

.deploy-filter-table tbody td {
    padding: 6px 12px;
    color: rgba(255, 255, 255, 0.85);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    background: transparent;
}

.deploy-chip {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    margin: 1px 3px 1px 0;
    white-space: nowrap;
}

.deploy-chip-tag {
    color: #fbbf24;
    background: rgba(251, 191, 36, 0.15);
}

.deploy-chip-branch {
    color: rgba(255, 255, 255, 0.6);
    background: rgba(255, 255, 255, 0.08);
}

.deploy-chip-workflow {
    color: #93c5fd;
    background: rgba(59, 130, 246, 0.15);
    cursor: pointer;
}

.deploy-chip-workflow:hover {
    background: rgba(59, 130, 246, 0.3);
}

.deploy-chip-workflow.deploy-cell-selected {
    background: rgba(59, 130, 246, 0.4);
    border-left: 2px solid #3b82f6;
}

.deploy-pipeline-num {
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.8rem;
    font-weight: 400;
}

.deploy-chips-row {
    margin-top: 4px;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.deploy-chips-row .deploy-chip {
    cursor: pointer;
}

.deploy-chips-row .deploy-chip:hover {
    opacity: 0.8;
}

.deploy-chips-row .deploy-chip.deploy-cell-selected {
    border-left: 2px solid currentColor;
}

.deploy-cell-clickable {
    cursor: pointer;
    transition: background 0.15s;
}

.deploy-cell-clickable:hover {
    background: rgba(255, 255, 255, 0.08);
}

.deploy-cell-selected {
    background: rgba(59, 130, 246, 0.2) !important;
    border-left: 3px solid #3b82f6;
}

.btn-small {
    padding: 4px 12px;
    font-size: 0.75rem;
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    cursor: pointer;
}

.btn-small:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* ========== SYNTHESIS SECTION ========== */

/* ============================== */
/* Synthèse - Layout & Header     */
/* ============================== */
.synthesis-section {
    padding: 20px 0;
}

.synthesis-section header {
    margin-bottom: 28px;
}

.synthesis-section header h1 {
    font-size: 1.8em;
    margin-bottom: 4px;
}

.synthesis-section header p {
    color: #6b7280;
}

.synthesis-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 32px;
    padding: 12px 16px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.synthesis-controls label {
    font-weight: 600;
    color: #374151;
}

.synthesis-controls select {
    padding: 6px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.95rem;
}

/* ============================== */
/* Blocs principaux               */
/* ============================== */
.synth-block {
    margin-bottom: 28px;
    border-radius: 12px;
    overflow: hidden;
    background: white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.07);
}

.synth-block-header {
    padding: 14px 24px;
    color: white;
    display: flex;
    align-items: center;
    gap: 10px;
}

.synth-block-header h2 {
    margin: 0;
    font-size: 1.1em;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.synth-header-rentability { background: linear-gradient(135deg, #6366f1, #8b5cf6); }
.synth-header-cost { background: linear-gradient(135deg, #f59e0b, #ef4444); }
.synth-header-usage { background: linear-gradient(135deg, #10b981, #059669); }
.synth-header-perf { background: linear-gradient(135deg, #3b82f6, #1d4ed8); }

/* ============================== */
/* Sous-blocs & groupes           */
/* ============================== */
.synth-subblock {
    padding: 14px 24px;
    border-bottom: 1px solid #e5e7eb;
}

.synth-subblock:last-child {
    border-bottom: none;
}

.synth-separator {
    border-top: 3px solid #e5e7eb;
}

.synth-subtitle {
    font-size: 0.78em;
    font-weight: 700;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    margin: 0 0 10px 0;
}

/* Premier sous-bloc = KPI phare (total AWS, etc.) */
.synth-subblock-hero {
    background: #f8fafc;
    padding: 20px 24px;
}

.synth-subblock-hero .synth-subtitle {
    font-size: 0.85em;
    color: #374151;
    margin-bottom: 12px;
}

.synth-subblock-hero .synth-cell {
    background: white;
    border-color: #e2e8f0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.synth-subblock-hero .synth-cell-highlight {
    background: linear-gradient(135deg, #eef2ff, #e0e7ff);
    border-color: #a5b4fc;
}

/* Hero cells : labels et valeurs plus grands */
.synth-cell-hero {
    padding: 18px 22px;
    min-height: 72px;
}

.synth-cell-hero .synth-label {
    font-size: 1.1em;
    font-weight: 700;
    color: #1f2937;
}

.synth-cell-hero .synth-value-num {
    font-size: 1.5em;
}

.synth-row-hero {
    gap: 14px;
}

/* Groupe de comptes (grille compacte) */
.synth-account-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2px;
    background: #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
}

.synth-account-card {
    background: white;
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
}

.synth-account-card .synth-subtitle {
    font-size: 0.95em;
    margin-bottom: 8px;
    color: #374151;
    font-weight: 700;
}

.synth-account-card .synth-row {
    gap: 6px;
}

.synth-account-card .synth-cell {
    padding: 8px 10px;
    font-size: 0.95em;
    border-radius: 6px;
}

.synth-account-card .synth-label {
    font-size: 1.28em;
}

/* Bandeau Global pour Build/Prod */
.synth-account-global-banner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    border-radius: 6px;
    margin-bottom: 8px;
    border: 1px solid #c7d2fe;
}

.synth-account-global-banner .synth-label {
    font-size: 1.08em;
    font-weight: 600;
    color: #4f46e5;
}

.synth-account-global-banner .synth-value-num {
    font-size: 1.05em;
    color: #312e81;
}

/* Groupe services (Other, GitHub, CircleCI dans Cost) */
.synth-services-group {
    padding: 16px 24px;
    background: #fafbfc;
    border-top: 2px solid #e5e7eb;
}

.synth-services-group .synth-subtitle {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #374151;
    font-size: 0.82em;
    margin-bottom: 12px;
}

.synth-services-group .synth-subtitle::before {
    content: '';
    display: inline-block;
    width: 3px;
    height: 14px;
    border-radius: 2px;
}

/* Couleur de l'accent vertical par type */
.synth-services-group[data-service="other"] .synth-subtitle::before { background: #8b5cf6; }
.synth-services-group[data-service="github"] .synth-subtitle::before { background: #24292f; }
.synth-services-group[data-service="circleci"] .synth-subtitle::before { background: #049b4a; }
.synth-services-group[data-service="newrelic"] .synth-subtitle::before { background: #008c99; }

/* ============================== */
/* Lignes & Cellules              */
/* ============================== */
.synth-row {
    display: flex;
    gap: 10px;
    margin-bottom: 6px;
}

.synth-row:last-child {
    margin-bottom: 0;
}

.synth-row-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.synth-cell {
    flex: 1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: #f9fafb;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    min-width: 0;
    transition: all 0.15s ease;
}

.synth-cell:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
}

.synth-cell-wide {
    max-width: 300px;
}

.synth-cell-highlight {
    background: #eef2ff;
    border-color: #c7d2fe;
    box-shadow: 0 1px 2px rgba(99,102,241,0.08);
}

.synth-cell-highlight:hover {
    background: #e0e7ff;
    border-color: #a5b4fc;
}

.synth-label {
    font-size: 0.82em;
    color: #6b7280;
    font-weight: 500;
    white-space: nowrap;
}

.synth-value {
    font-size: 1.05em;
    font-weight: 700;
    color: #111827;
    font-variant-numeric: tabular-nums;
}

.synth-value small {
    font-size: 0.7em;
    font-weight: 400;
    color: #9ca3af;
}

.synth-value-num {
    font-size: 1.05em;
    font-weight: 700;
    color: #111827;
    font-variant-numeric: tabular-nums;
}

.synth-right {
    text-align: right;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 1px;
}

/* ============================== */
/* Deltas (comparaison M-1)       */
/* ============================== */
.synth-delta {
    font-size: 0.72em;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding: 1px 5px;
    border-radius: 4px;
    white-space: nowrap;
}

.synth-delta-up {
    color: #dc2626;
    background: #fef2f2;
}

.synth-delta-down {
    color: #059669;
    background: #ecfdf5;
}

.synth-delta-neutral {
    color: #9ca3af;
    background: #f9fafb;
}

/* Inverse pour les métriques "plus = mieux" */
.synth-cell[data-higher-better] .synth-delta-up {
    color: #059669;
    background: #ecfdf5;
}

.synth-cell[data-higher-better] .synth-delta-down {
    color: #dc2626;
    background: #fef2f2;
}

/* ============================== */
/* Performance services           */
/* ============================== */
.synth-perf-service {
    padding: 10px 0;
    border-bottom: 1px solid #f3f4f6;
}

.synth-perf-service:last-child {
    border-bottom: none;
}

.synth-service-name {
    font-size: 0.88em;
    font-weight: 600;
    color: #374151;
    margin: 0 0 6px 0;
    padding-left: 4px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.synth-service-name::before {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #3b82f6;
}

/* ============================== */
/* Budget Gauge (Sentry)          */
/* ============================== */
.budget-gauge-container {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    margin-bottom: 30px;
}

.budget-gauge-container h3 {
    margin: 0 0 20px 0;
    font-size: 1.1em;
    color: #374151;
}

.budget-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    flex-wrap: wrap;
    gap: 10px;
}

.budget-label {
    font-size: 0.95em;
    color: #6b7280;
}

.budget-usage {
    font-size: 1.3em;
    font-weight: 700;
    color: #3b82f6;
}

.budget-percentage {
    font-size: 1.1em;
    font-weight: 600;
    color: #6b7280;
    padding: 4px 12px;
    background: #f3f4f6;
    border-radius: 6px;
}

.budget-bar {
    position: relative;
    width: 100%;
    height: 40px;
    background: #f3f4f6;
    border-radius: 8px;
    overflow: visible;
    margin-bottom: 10px;
}

.budget-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #10b981 0%, #3b82f6 50%, #f59e0b 80%, #ef4444 100%);
    border-radius: 8px;
    transition: width 0.6s ease-in-out, background 0.3s ease;
    position: relative;
}

.budget-bar-fill.over-budget {
    background: linear-gradient(90deg, #ef4444 0%, #dc2626 100%);
}

.budget-bar-limit {
    position: absolute;
    right: 0;
    top: -5px;
    bottom: -5px;
    width: 3px;
    background: #374151;
    border-radius: 2px;
    z-index: 10;
}

.budget-bar-limit::after {
    content: '$79';
    position: absolute;
    right: -8px;
    top: -22px;
    font-size: 0.75em;
    font-weight: 600;
    color: #374151;
    background: white;
    padding: 2px 6px;
    border-radius: 4px;
    white-space: nowrap;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.budget-note {
    font-size: 0.85em;
    color: #9ca3af;
    margin: 5px 0 0 0;
    font-style: italic;
}

.budget-note.over-budget {
    color: #ef4444;
    font-weight: 600;
}

.budget-note.under-budget {
    color: #10b981;
}

/* ============================== */
/* Responsive                     */
/* ============================== */
@media (max-width: 768px) {
    .synth-row {
        flex-direction: column;
    }
    .synth-row-grid {
        grid-template-columns: 1fr;
    }
    .synth-cell-wide {
        max-width: 100%;
    }
    .synth-account-grid {
        grid-template-columns: 1fr;
    }
}


/* ============================== */
/* Toast Notifications            */
/* ============================== */
.toast-container {
    position: fixed;
    top: var(--spacing-lg);
    right: var(--spacing-lg);
    z-index: var(--z-toast);
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
    pointer-events: none;
}

.toast {
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    padding: var(--spacing-md) var(--spacing-lg);
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    min-width: 320px;
    max-width: 480px;
    pointer-events: auto;
    border-left: 4px solid var(--color-info);
    transition: opacity var(--transition-base), transform var(--transition-base);
}

.toast__icon {
    font-size: 1.5rem;
    flex-shrink: 0;
    line-height: 1;
}

.toast__message {
    flex: 1;
    color: var(--text-primary);
    font-size: 0.875rem;
    line-height: 1.5;
}

.toast__close {
    background: transparent;
    border: none;
    color: var(--text-tertiary);
    cursor: pointer;
    font-size: 1.5rem;
    line-height: 1;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    transition: background var(--transition-fast), color var(--transition-fast);
    flex-shrink: 0;
}

.toast__close:hover {
    background: var(--color-gray-100);
    color: var(--text-secondary);
}

/* Toast variants */
.toast--success {
    border-left-color: var(--color-success);
}

.toast--error {
    border-left-color: var(--color-danger);
}

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

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

.toast--loading {
    border-left-color: var(--color-primary);
}

.toast--loading .toast__icon {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Mobile responsive */
@media (max-width: 768px) {
    .toast-container {
        top: var(--spacing-md);
        right: var(--spacing-md);
        left: var(--spacing-md);
    }

    .toast {
        min-width: auto;
        max-width: none;
    }
}

/* ============================== */
/* Loading Spinner Global         */
/* ============================== */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: var(--z-modal);
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--transition-base), visibility var(--transition-base);
}

.loading-overlay.active {
    opacity: 1;
    visibility: visible;
}

.loading-spinner {
    background: var(--bg-primary);
    border-radius: var(--radius-xl);
    padding: var(--spacing-xl);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-md);
    box-shadow: var(--shadow-xl);
}

.loading-spinner__icon {
    width: 48px;
    height: 48px;
    border: 4px solid var(--color-gray-200);
    border-top-color: var(--color-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.loading-spinner__text {
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
}

/* ============================== */
/* LONGITUDINAL TRACKING SECTION  */
/* ============================== */

.longitudinal-charts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.longitudinal-chart-container {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
}

.longitudinal-chart-container h4 {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.longitudinal-chart-container canvas {
    max-height: 250px;
}

.longitudinal-table-wrapper {
    overflow-x: auto;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
}

.longitudinal-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.longitudinal-table thead {
    background: var(--color-gray-50);
    position: sticky;
    top: 0;
    z-index: 10;
}

.longitudinal-table th {
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
    border-bottom: 2px solid var(--border-color);
}

.longitudinal-table tbody tr {
    border-bottom: 1px solid var(--border-color-light);
    transition: background-color 0.15s ease;
}

.longitudinal-table tbody tr:hover {
    background-color: var(--color-gray-50);
}

.longitudinal-table tbody tr:first-child {
    background-color: #f0f9ff;
    font-weight: 600;
}

.longitudinal-table td {
    padding: 12px 16px;
    color: var(--text-primary);
    white-space: nowrap;
}

.longitudinal-table td:first-child {
    font-weight: 600;
    color: var(--color-primary);
}

.longitudinal-change-positive {
    color: #dc2626;
    font-weight: 600;
}

.longitudinal-change-negative {
    color: #059669;
    font-weight: 600;
}

.longitudinal-change-neutral {
    color: var(--text-tertiary);
}

.longitudinal-arrow {
    font-size: 0.75rem;
    margin-right: 2px;
}

@media (max-width: 768px) {
    .longitudinal-charts {
        grid-template-columns: 1fr;
    }
    
    .longitudinal-table {
        font-size: 0.75rem;
    }
    
    .longitudinal-table th,
    .longitudinal-table td {
        padding: 8px 12px;
    }
}

/* ============================== */
/* Monthly Report Styles          */
/* ============================== */

.report-textarea {
    width: 100%;
    padding: 1rem;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    font-size: 1rem;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.6;
    resize: vertical;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.report-textarea:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.report-textarea::placeholder {
    color: #9ca3af;
    font-style: italic;
}

.report-service-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 1rem 1.25rem;
    margin-bottom: 0.75rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: transform 0.2s, box-shadow 0.2s;
}

.report-service-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.report-service-name {
    font-weight: 600;
    color: #374151;
    font-size: 0.95rem;
}

.report-service-cost {
    font-size: 1.4rem;
    font-weight: 700;
    color: #1f2937;
}

.report-service-ratio {
    font-size: 1.1rem;
    font-weight: 600;
    color: #6b7280;
}

.form-select {
    background-color: white;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 0.5rem center;
    background-repeat: no-repeat;
    background-size: 1.5em 1.5em;
    padding-right: 2.5rem;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.form-select:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.btn-primary {
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
}

@media print {
    .report-textarea {
        border: 1px solid #e5e7eb;
        background: white;
    }
    
    button, select {
        display: none !important;
    }
}

/* ============================= */
/* Section Admin                 */
/* ============================= */

.admin-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    max-width: 900px;
    margin-top: 1.5rem;
}

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

.admin-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.admin-card-icon {
    font-size: 2rem;
    margin-bottom: 0.75rem;
}

.admin-card h2 {
    font-size: 1.2rem;
    font-weight: 600;
    color: #111827;
    margin-bottom: 0.75rem;
}

.admin-card p {
    color: #6b7280;
    font-size: 0.9rem;
    line-height: 1.6;
    margin-bottom: 1.25rem;
}

.admin-info-box {
    background: #f3f4f6;
    border-radius: 8px;
    padding: 0.875rem 1rem;
    font-size: 0.82rem;
    color: #374151;
    line-height: 1.7;
    margin-bottom: 1.5rem;
}

.admin-warning-box {
    background: #fef3c7;
    border: 1px solid #f59e0b;
    border-radius: 8px;
    padding: 0.875rem 1rem;
    font-size: 0.82rem;
    color: #92400e;
    line-height: 1.6;
    margin-bottom: 1.25rem;
}

.admin-file-zone {
    position: relative;
    border: 2px dashed #d1d5db;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s;
}

.admin-file-zone:hover {
    border-color: #6b7280;
}

.admin-file-zone input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
    width: 100%;
    height: 100%;
}

.admin-file-label {
    font-size: 0.875rem;
    color: #6b7280;
    pointer-events: none;
}

.admin-btn {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
    border-radius: 8px;
    cursor: pointer;
    border: none;
    font-weight: 600;
    transition: all 0.2s;
}

.admin-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

.btn-danger {
    background: #dc2626;
    color: white;
}

.btn-danger:hover:not(:disabled) {
    background: #b91c1c;
}

.admin-status-info {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 8px;
    padding: 1rem 1.25rem;
    font-size: 0.875rem;
    color: #1e40af;
    line-height: 1.7;
}

.admin-status-success {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 8px;
    padding: 1rem 1.25rem;
    font-size: 0.875rem;
    color: #166534;
    line-height: 1.7;
}

.admin-status-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    padding: 1rem 1.25rem;
    font-size: 0.875rem;
    color: #991b1b;
    line-height: 1.7;
}

/* ================================ */
/* Login overlay                    */
/* ================================ */

#appContent {
    display: flex;
    width: 100%;
    min-height: 100vh;
}

.login-overlay {
    position: fixed;
    inset: 0;
    background: #0f172a;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.login-card {
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 16px;
    padding: 2.5rem 2rem;
    width: 100%;
    max-width: 380px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
}

.login-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 2rem;
}

.login-logo h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #f1f5f9;
    margin: 0;
}

.login-field {
    margin-bottom: 1.25rem;
}

.login-field label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.4rem;
}

.login-field input {
    width: 100%;
    padding: 0.65rem 0.9rem;
    background: #0f172a;
    border: 1px solid #334155;
    border-radius: 8px;
    color: #f1f5f9;
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.15s;
}

.login-field input:focus {
    border-color: #4f46e5;
}

.login-error {
    background: #450a0a;
    border: 1px solid #991b1b;
    color: #fca5a5;
    border-radius: 8px;
    padding: 0.6rem 0.9rem;
    font-size: 0.85rem;
    margin-bottom: 1rem;
}

.login-btn {
    width: 100%;
    padding: 0.75rem;
    background: #4f46e5;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
    margin-top: 0.25rem;
}

.login-btn:hover:not(:disabled) {
    background: #4338ca;
}

.login-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Bouton logout dans la sidebar */
.sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: auto;
}

.logout-btn {
    width: 100%;
    padding: 8px 12px;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.8rem;
    cursor: pointer;
    text-align: left;
    transition: all 0.15s;
}

.logout-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: white;
    border-color: rgba(255, 255, 255, 0.4);
}
