/* ==========================================================================
   PARLIXA ENTERPRISE DESIGN SYSTEM
   Version: 2.0 (Investor Grade)
   ========================================================================== */

:root {
    /* --- COLOR PALETTE (Slate & Indigo Theme) --- */
    /* Primary (Brand) */
    --primary-50: #eef2ff;
    --primary-100: #e0e7ff;
    --primary-500: #6366f1;
    --primary-600: #4f46e5;
    --primary-700: #4338ca;
    --primary-900: #312e81;

    /* Surface (Backgrounds) */
    --surface-0: #ffffff;
    --surface-50: #f8fafc;
    --surface-100: #f1f5f9;
    --surface-200: #e2e8f0;
    --surface-300: #cbd5e1;
    --surface-800: #1e293b;
    --surface-900: #0f172a;

    /* Text */
    --text-primary: #0f172a;   /* High contrast */
    --text-secondary: #64748b; /* Medium contrast */
    --text-tertiary: #94a3b8;  /* Low contrast */
    --text-inverse: #ffffff;

    /* Semantic States */
    --success-bg: #dcfce7; --success-text: #166534;
    --warning-bg: #fef3c7; --warning-text: #92400e;
    --danger-bg: #fee2e2;  --danger-text: #991b1b;
    --info-bg: #e0f2fe;    --info-text: #075985;

    /* --- METRICS & LAYOUT --- */
    --sidebar-width: 280px;
    --header-height: 64px;
    
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-full: 9999px;

    /* --- EFFECTS --- */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    
    /* Glassmorphism */
    --glass-bg: rgba(255, 255, 255, 0.85);
    --glass-border: rgba(255, 255, 255, 0.5);
    --backdrop-blur: blur(12px);
    
    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==========================================================================
   RESET & BASE
   ========================================================================== */
*, *::before, *::after {
    box-sizing: border-box;
    outline: none;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--surface-50);
    color: var(--text-primary);
    margin: 0;
    height: 100vh;
    width: 100vw;
    overflow: hidden;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

a { text-decoration: none; color: inherit; }
button { font-family: inherit; }

/* ==========================================================================
   LAYOUT STRUCTURE (APP SHELL)
   ========================================================================== */
.layout-wrapper {
    display: flex;
    height: 100vh;
    width: 100%;
}

/* 1. SIDEBAR */
.sidebar-container {
    width: var(--sidebar-width);
    background: var(--surface-0);
    border-right: 1px solid var(--surface-200);
    display: flex;
    flex-direction: column;
    padding: 1.5rem 1rem;
    z-index: 50;
    flex-shrink: 0;
    transition: width var(--transition-normal);
}

.brand-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 0.75rem;
    margin-bottom: 2.5rem;
    font-weight: 700;
    font-size: 1.125rem;
    color: var(--surface-900);
    letter-spacing: -0.025em;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    margin-bottom: 4px;
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 500;
    transition: all var(--transition-fast);
}

.nav-item:hover {
    background-color: var(--surface-50);
    color: var(--surface-900);
}

.nav-item.active {
    background-color: var(--surface-50);
    color: var(--primary-600);
    font-weight: 600;
}

.nav-item i {
    font-size: 1rem;
    width: 20px;
    text-align: center;
}

/* 2. MAIN CONTENT AREA */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
    background-color: var(--surface-50);
}

/* 3. TOPBAR */
.topbar-container {
    height: var(--header-height);
    background: var(--glass-bg);
    backdrop-filter: var(--backdrop-blur);
    border-bottom: 1px solid var(--surface-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    position: sticky;
    top: 0;
    z-index: 40;
}

/* 4. VIEWPORT */
.content-viewport {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 2rem;
    scroll-behavior: smooth;
}

/* ==========================================================================
   COMPONENTS
   ========================================================================== */

/* --- DATA GRID (Tables) --- */
.data-grid {
    background: var(--surface-0);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--surface-200);
    overflow: hidden;
    width: 100%;
}

.data-grid table {
    width: 100%;
    border-collapse: collapse;
    border-spacing: 0;
}

.data-grid th {
    background-color: var(--surface-50);
    color: var(--text-secondary);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
    padding: 12px 24px;
    text-align: left;
    border-bottom: 1px solid var(--surface-200);
    white-space: nowrap;
}

.data-grid td {
    padding: 16px 24px;
    border-bottom: 1px solid var(--surface-100);
    color: var(--text-primary);
    font-size: 0.875rem;
    vertical-align: middle;
}

.data-grid tr:last-child td {
    border-bottom: none;
}

.data-grid tr:hover td {
    background-color: var(--surface-50);
}

/* --- BADGES --- */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 10px;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 500;
    line-height: 1.5;
    white-space: nowrap;
}

.badge-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    margin-right: 6px;
    flex-shrink: 0;
}

.badge-lg {
    padding: 4px 12px;
    font-size: 0.875rem;
}

/* Badge Variants */
.badge-success { background: var(--success-bg); color: var(--success-text); }
.badge-success .badge-dot { background: var(--success-text); }

.badge-warning { background: var(--warning-bg); color: var(--warning-text); }
.badge-warning .badge-dot { background: var(--warning-text); }

.badge-danger { background: var(--danger-bg); color: var(--danger-text); }
.badge-danger .badge-dot { background: var(--danger-text); }

.badge-info { background: var(--info-bg); color: var(--info-text); }
.badge-info .badge-dot { background: var(--info-text); }

.badge-neutral { background: var(--surface-100); color: var(--text-secondary); }
.badge-neutral .badge-dot { background: var(--text-secondary); }

/* --- BUTTONS --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-weight: 500;
    font-size: 0.875rem;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all var(--transition-fast);
    text-decoration: none;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Button Variants */
.btn-primary {
    background-color: var(--primary-600);
    color: var(--text-inverse);
    box-shadow: var(--shadow-sm);
}
.btn-primary:hover:not(:disabled) {
    background-color: var(--primary-700);
    transform: translateY(-1px);
}

.btn-secondary {
    background-color: var(--surface-0);
    color: var(--text-primary);
    border-color: var(--surface-200);
    box-shadow: var(--shadow-sm);
}
.btn-secondary:hover:not(:disabled) {
    background-color: var(--surface-50);
    border-color: var(--surface-300);
}

.btn-ghost {
    background-color: transparent;
    color: var(--text-secondary);
}
.btn-ghost:hover:not(:disabled) {
    background-color: var(--surface-100);
    color: var(--text-primary);
}

.btn-success {
    background-color: var(--success-bg);
    color: var(--success-text);
    border: 1px solid transparent;
}
.btn-success:hover:not(:disabled) {
    background-color: #bbf7d0; /* Darker green tint */
}

/* --- FORMS & INPUTS --- */
input[type="text"], input[type="search"], select, textarea {
    appearance: none;
    background-color: var(--surface-0);
    border: 1px solid var(--surface-200);
    border-radius: var(--radius-sm);
    padding: 8px 12px;
    font-size: 0.875rem;
    color: var(--text-primary);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
    font-family: inherit;
}

input:focus, select:focus, textarea:focus {
    border-color: var(--primary-500);
    box-shadow: 0 0 0 3px var(--primary-100);
    outline: none;
}

/* --- MODALS (Overlays) --- */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background-color: rgba(15, 23, 42, 0.6); /* Slate 900 with opacity */
    backdrop-filter: blur(4px);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    animation: fadeIn 0.2s forwards;
}

.modal-panel {
    background-color: var(--surface-0);
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
    transform: scale(0.95);
    opacity: 0;
    animation: scaleIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--surface-200);
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    background: var(--surface-0);
    border-top-left-radius: var(--radius-lg);
    border-top-right-radius: var(--radius-lg);
    position: sticky;
    top: 0;
    z-index: 10;
}

.modal-body {
    padding: 1.5rem;
    overflow-y: auto;
}

.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--surface-200);
    background-color: var(--surface-50);
    border-bottom-left-radius: var(--radius-lg);
    border-bottom-right-radius: var(--radius-lg);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* ==========================================================================
   UTILITY CLASSES (Functional CSS)
   ========================================================================== */
.w-full { width: 100%; }
.text-center { text-align: center; }
.text-right { text-align: right; }

.text-primary { color: var(--text-primary); }
.text-secondary { color: var(--text-secondary); }
.text-tertiary { color: var(--text-tertiary); }
.text-success { color: var(--success-text); }
.text-danger { color: var(--danger-text); }

.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }

.text-sm { font-size: 0.875rem; }
.text-xs { font-size: 0.75rem; }
.text-lg { font-size: 1.125rem; }
.text-xl { font-size: 1.25rem; }

.mb-2 { margin-bottom: 0.5rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }
.mr-2 { margin-right: 0.5rem; }

.p-3 { padding: 0.75rem; }
.p-4 { padding: 1rem; }

.rounded { border-radius: var(--radius-sm); }
.bg-surface-50 { background-color: var(--surface-50); }

.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 0.5rem; }
.gap-4 { gap: 1rem; }

.grid-2-cols {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

.divider {
    height: 1px;
    background-color: var(--surface-200);
    margin: 1.5rem 0;
    width: 100%;
}

/* ==========================================================================
   ANIMATIONS
   ========================================================================== */
.fade-in { animation: fadeIn 0.3s ease-out forwards; }

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes scaleIn {
    from { transform: scale(0.95); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

@keyframes slideInRight {
    from { transform: translateX(20px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* ==========================================================================
   RESPONSIVE ADJUSTMENTS
   ========================================================================== */
@media (max-width: 768px) {
    .sidebar-container {
        position: fixed;
        left: -280px;
        height: 100%;
    }
    
    .sidebar-container.open {
        left: 0;
        box-shadow: var(--shadow-lg);
    }
    
    .grid-2-cols {
        grid-template-columns: 1fr;
    }
    
    .data-grid th, .data-grid td {
        padding: 12px 16px;
    }
}
/* ============================================================================
   STYLES SUPPLÉMENTAIRES POUR ANALYTICS DASHBOARD
   À AJOUTER À LA FIN DE admin-dashboard.css (après les styles KPI existants)
   ============================================================================ */

/* --- ANALYTICS HEADER --- */
.analytics-dashboard {
    max-width: 1400px;
    margin: 0 auto;
}

.analytics-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.analytics-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--surface-900);
}

.analytics-subtitle {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-top: 4px;
}

.analytics-actions {
    display: flex;
    gap: 12px;
}

/* --- KPI CARDS AMÉLIORÉES --- */
.kpi-card.kpi-primary .kpi-icon { background: var(--primary-50); color: var(--primary-600); }
.kpi-card.kpi-success .kpi-icon { background: var(--success-bg); color: var(--success-text); }
.kpi-card.kpi-warning .kpi-icon { background: var(--warning-bg); color: var(--warning-text); }
.kpi-card.kpi-info .kpi-icon { background: var(--info-bg); color: var(--info-text); }

.kpi-content {
    flex: 1;
    min-width: 0;
}

.kpi-trend {
    font-size: 0.75rem;
    margin-top: 6px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.trend-up { color: var(--success-text); }
.trend-down { color: var(--danger-text); }
.trend-warning { color: var(--warning-text); }
.trend-neutral { color: var(--text-secondary); }

/* --- KPI MINI CARDS (Row 2) --- */
.kpi-grid-secondary {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
}

.kpi-card-mini {
    background: var(--surface-0);
    border-radius: var(--radius-md);
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--surface-200);
}

.kpi-mini-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    background: var(--surface-100);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
}

.kpi-mini-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.kpi-mini-value {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--surface-900);
}

/* --- CHARTS GRID --- */
.charts-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.chart-container.chart-large {
    grid-column: span 1;
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.chart-legend {
    display: flex;
    gap: 1rem;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.chart-body {
    height: 280px;
    position: relative;
}

/* --- TOP CLIENTS LIST --- */
.top-clients-list {
    height: 100%;
    overflow-y: auto;
}

.top-client-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.875rem 0;
    border-bottom: 1px solid var(--surface-100);
}

.top-client-item:last-child {
    border-bottom: none;
}

.top-client-rank {
    width: 28px;
    height: 28px;
    background: var(--surface-100);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-secondary);
}

.top-client-info {
    flex: 1;
    min-width: 0;
}

.top-client-email {
    font-weight: 500;
    font-size: 0.875rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.top-client-orders {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.top-client-revenue {
    font-weight: 600;
    color: var(--success-text);
}

/* --- ACTIVITY SECTION --- */
.activity-section {
    background: var(--surface-0);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--surface-200);
}

.view-all-link {
    font-size: 0.875rem;
    color: var(--primary-600);
    text-decoration: none;
    font-weight: 500;
}

.view-all-link:hover {
    text-decoration: underline;
}

.activity-list {
    margin-top: 1rem;
}

.activity-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background 0.2s ease;
}

.activity-item:hover {
    background: var(--surface-50);
}

.activity-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

.activity-icon.badge-success {
    background: var(--success-bg);
    color: var(--success-text);
}

.activity-icon.badge-warning {
    background: var(--warning-bg);
    color: var(--warning-text);
}

.activity-icon.badge-info {
    background: var(--info-bg);
    color: var(--info-text);
}

.activity-icon.badge-neutral {
    background: var(--surface-100);
    color: var(--text-secondary);
}

.activity-content {
    flex: 1;
    min-width: 0;
}

.activity-title {
    font-weight: 600;
    font-size: 0.875rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.activity-meta {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.activity-amount {
    font-weight: 600;
    font-size: 0.875rem;
    margin-right: 1rem;
}

/* --- ORDERS VIEW AMÉLIORÉ --- */
.orders-view {
    background: var(--surface-0);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--surface-200);
    overflow: hidden;
}

.orders-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--surface-200);
}

.page-title {
    font-size: 1.25rem;
    font-weight: 700;
}

.orders-filters {
    display: flex;
    gap: 12px;
}

.filter-select {
    padding: 0.625rem 1rem;
    border: 1px solid var(--surface-200);
    border-radius: var(--radius-sm);
    background: var(--surface-0);
    font-size: 0.875rem;
    color: var(--text-primary);
    cursor: pointer;
}

.filter-select:focus {
    outline: none;
    border-color: var(--primary-500);
    box-shadow: 0 0 0 3px var(--primary-100);
}

.search-input-wrapper {
    position: relative;
}

.search-input-wrapper i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
}

.search-input {
    padding: 0.625rem 1rem 0.625rem 2.5rem;
    border: 1px solid var(--surface-200);
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    width: 220px;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-500);
    box-shadow: 0 0 0 3px var(--primary-100);
}

.orders-table {
    width: 100%;
    border-collapse: collapse;
}

.orders-table th {
    text-align: left;
    padding: 1rem 1.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    background: var(--surface-50);
    border-bottom: 1px solid var(--surface-200);
}

.orders-table td {
    padding: 1rem 1.5rem;
    font-size: 0.875rem;
    border-bottom: 1px solid var(--surface-100);
}

.orders-table tbody tr {
    transition: background 0.2s ease;
}

.orders-table tbody tr:hover {
    background: var(--surface-50);
}

.orders-footer {
    padding: 1rem 2rem;
    border-top: 1px solid var(--surface-200);
    background: var(--surface-50);
}

/* --- BADGES SUPPLÉMENTAIRES --- */
.badge-purple {
    background: #ede9fe;
    color: #7c3aed;
}

.badge-purple .badge-dot {
    background: #7c3aed;
}

/* --- DELIVERED FILES --- */
.delivered-files-list {
    background: var(--surface-50);
    border-radius: var(--radius-sm);
    padding: 0.75rem;
}

.delivered-file-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0.5rem;
    font-size: 0.875rem;
    color: var(--success-text);
}

.delivered-file-item i {
    color: var(--success-text);
}

/* --- SPINNER --- */
.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--surface-200);
    border-top-color: var(--primary-600);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* --- EMPTY STATE --- */
.empty-state {
    text-align: center;
    padding: 2rem;
    color: var(--text-secondary);
}

/* --- BUTTON SMALL --- */
.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.8125rem;
}

/* --- RESPONSIVE ANALYTICS --- */
@media (max-width: 1200px) {
    .kpi-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .charts-grid {
        grid-template-columns: 1fr;
    }
    
    .kpi-grid-secondary {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .kpi-grid {
        grid-template-columns: 1fr;
    }
    
    .kpi-grid-secondary {
        grid-template-columns: 1fr;
    }
    
    .orders-header {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }
    
    .orders-filters {
        flex-direction: column;
    }
    
    .search-input {
        width: 100%;
    }
    
    .analytics-header {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }
    
    .chart-body {
        height: 220px;
    }
}
/* AJOUTER CECI A LA FIN DE VOTRE FICHIER EXISTANT */

/* --- ANALYTICS DASHBOARD --- */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.kpi-card {
    background: var(--surface-0);
    padding: 1.5rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--surface-200);
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: transform 0.2s ease;
}

.kpi-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.kpi-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.icon-primary { background: var(--primary-50); color: var(--primary-600); }
.icon-success { background: var(--success-bg); color: var(--success-text); }
.icon-warning { background: var(--warning-bg); color: var(--warning-text); }
.icon-info { background: var(--info-bg); color: var(--info-text); }

.kpi-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.kpi-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}

.chart-container {
    background: var(--surface-0);
    padding: 1.5rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--surface-200);
    box-shadow: var(--shadow-sm);
    min-height: 350px;
}

.chart-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--surface-900);
    margin-bottom: 1.5rem;
}
/* ============================================================
   AJOUTER CE STYLE DANS admin-dashboard.css
   (après les autres styles de boutons, vers la ligne 330)
   ============================================================ */

.btn-warning {
    background-color: var(--warning-bg);
    color: var(--warning-text);
    border: 1px solid transparent;
}

.btn-warning:hover:not(:disabled) {
    background-color: #fde68a; /* Jaune plus foncé au hover */
    transform: translateY(-1px);
}
/* ============================================================
   STYLES SUPPLÉMENTAIRES POUR ORDER DETAIL AMÉLIORÉ
   À AJOUTER À LA FIN DE admin-dashboard.css
   ============================================================ */

/* Modal plus large pour les détails */
.modal-panel.modal-large {
    max-width: 900px;
}

/* Grille de détails */
.order-detail-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 2rem;
}

.order-detail-left {
    padding-right: 1rem;
}

.order-detail-right {
    border-left: 1px solid var(--surface-200);
    padding-left: 1.5rem;
}

/* Titres de section */
.section-title {
    font-weight: 700;
    font-size: 0.875rem;
    color: var(--surface-800);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-title i {
    color: var(--primary-600);
}

/* Grille d'informations */
.info-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.info-item {
    background: var(--surface-50);
    padding: 0.75rem;
    border-radius: var(--radius-sm);
}

.info-label {
    display: block;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    margin-bottom: 2px;
}

.info-value {
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text-primary);
}

/* Sections de détails */
.detail-section {
    margin-bottom: 1.25rem;
    padding: 1rem;
    background: var(--surface-50);
    border-radius: var(--radius-sm);
    border-left: 3px solid var(--primary-500);
}

.detail-section-title {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--surface-700);
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 6px;
}

.detail-section-title i {
    color: var(--primary-600);
    font-size: 0.875rem;
}

.detail-content {
    font-size: 0.875rem;
    color: var(--text-primary);
    line-height: 1.6;
    white-space: pre-wrap;
}

/* Liste des voix */
.voices-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.voice-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px dashed var(--surface-200);
}

.voice-item:last-child {
    border-bottom: none;
}

.voice-name {
    font-weight: 600;
    color: var(--text-primary);
}

.voice-meta {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* Liste des personnages */
.characters-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.character-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem;
    background: white;
    border-radius: var(--radius-sm);
}

.character-name {
    font-weight: 600;
    color: var(--surface-800);
}

.character-voice {
    font-size: 0.75rem;
    color: var(--primary-600);
}

/* Tags d'options */
.options-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.option-tag {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: var(--success-bg);
    color: var(--success-text);
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: var(--radius-full);
}

/* Métadonnées de la commande */
.order-meta {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.meta-item i {
    width: 16px;
    text-align: center;
    color: var(--surface-400);
}

/* Responsive */
@media (max-width: 768px) {
    .modal-panel.modal-large {
        max-width: 100%;
        margin: 1rem;
    }
    
    .order-detail-grid {
        grid-template-columns: 1fr;
    }
    
    .order-detail-right {
        border-left: none;
        border-top: 1px solid var(--surface-200);
        padding-left: 0;
        padding-top: 1.5rem;
    }
    
    .info-grid {
        grid-template-columns: 1fr;
    }
}

/* Bouton warning pour révision */
.btn-warning {
    background-color: var(--warning-bg);
    color: var(--warning-text);
    border: 1px solid #fcd34d;
}

.btn-warning:hover:not(:disabled) {
    background-color: #fde68a;
}

/* Texte warning */
.text-warning {
    color: var(--warning-text);
}
/* --- SEGMENTED CONTROL (STYLE PREMIUM) --- */
.orders-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap; 
    gap: 1.5rem;
}

.segmented-control {
    background: var(--surface-100);
    padding: 4px;
    border-radius: var(--radius-md);
    display: inline-flex;
    position: relative;
    border: 1px solid var(--surface-200);
}

.segment-btn {
    background: transparent;
    border: none;
    padding: 6px 20px;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 8px;
}

.segment-btn:hover {
    color: var(--text-primary);
}

.segment-btn.active {
    background: var(--surface-0);
    color: var(--primary-600);
    font-weight: 600;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.segment-btn i {
    font-size: 0.8rem;
}

/* Ajustement responsive */
@media (max-width: 768px) {
    .segmented-control {
        width: 100%;
        display: flex;
    }
    .segment-btn {
        flex: 1;
        justify-content: center;
    }
}
/* ============================================================
   SYSTEME DE NOTIFICATIONS (TOASTS)
   ============================================================ */

#toast-root {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 10000; /* Toujours au-dessus de tout */
    display: flex;
    flex-direction: column;
    gap: 12px;
    pointer-events: none; /* Laisse cliquer à travers si vide */
}

.toast {
    background: var(--surface-0);
    color: var(--text-primary);
    padding: 16px 20px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    border-left: 4px solid var(--primary-500);
    min-width: 300px;
    max-width: 400px;
    display: flex;
    align-items: center;
    gap: 12px;
    pointer-events: auto; /* Réactive le clic sur la notif */
    animation: slideInToast 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
}

.toast.toast-success { border-color: var(--success-text); background: #f0fdf4; color: #14532d; }
.toast.toast-error   { border-color: var(--danger-text);  background: #fef2f2; color: #7f1d1d; }
.toast.toast-info    { border-color: var(--info-text);    background: #f0f9ff; color: #0c4a6e; }

.toast i { font-size: 1.1em; }

/* Animation d'entrée */
@keyframes slideInToast {
    from { opacity: 0; transform: translateY(20px) scale(0.95); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* Animation de sortie (ajoutée via JS) */
.toast.hide {
    animation: fadeOutToast 0.2s ease forwards;
}

@keyframes fadeOutToast {
    to { opacity: 0; transform: translateX(20px); }
}

/* Mobile : Centrer en bas */
@media (max-width: 768px) {
    #toast-root {
        right: 50%;
        transform: translateX(50%);
        bottom: 20px;
        width: 90%;
    }
    .toast { width: 100%; min-width: auto; }
}