:root {
    /* VOS VARIABLES ORIGINALES (DARK PAR DÉFAUT) */
    --bg-main: #0f172a;
    --bg-sidebar: #020617;
    --bg-card: #0b1120;
    --bg-hover: rgba(255, 255, 255, 0.05);
    --bg-elevated: #020617;
    --border-subtle: #1e293b;
    
    --accent: #3b82f6;
    --accent-soft: rgba(59,130,246,0.15);
    --accent-strong: #1d4ed8;
    
    --text-main: #e5e7eb;
    --text-muted: #9ca3af;
    
    /* NOUVELLE VARIABLE POUR LE TEXTE ACTIF */
    --text-active: #eff6ff; /* Blanc bleuté pour le mode sombre */

    --danger: #ef4444;
    --danger-soft: rgba(248,113,113,0.12);
    --success: #22c55e;
    --success-soft: rgba(34,197,94,0.15);
    --pill-muted-bg: rgba(148,163,184,0.15);
    --pill-muted-text: #e5e7eb;
    
    --radius-card: 14px;
    --radius-pill: 999px;
    
    --shadow-soft: 0 18px 40px rgba(15,23,42,0.9);
    --shadow-card: 0 18px 40px rgba(15,23,42,0.65);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    /* Gradient Sombre Original */
    background: radial-gradient(circle at top, #1e293b 0, #020617 40%, #000 100%);
    color: var(--text-main);
    transition: background 0.3s ease, color 0.3s ease;
}

.app-shell {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */

.sidebar {
    width: 260px;
    background: linear-gradient(180deg, #020617 0%, #020617 40%, #020617 100%);
    border-right: 1px solid rgba(148,163,184,0.25);
    padding: 16px 14px 14px;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    transition: background 0.3s ease, border-color 0.3s ease;
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 10px 14px;
    margin-bottom: 8px;
    border-radius: 12px;
    background: radial-gradient(circle at top left, #1d4ed8 0, transparent 45%);
}

.sidebar-logo-icon {
    width: 40px;
    height: 40px;
    border-radius: 14px;
    background: rgba(15,23,42,0.95);
    border: 1px solid rgba(148,163,184,0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 18px;
    color: #e5e7eb;
}

.sidebar-logo-title {
    font-weight: 600;
    font-size: 14px;
}

.sidebar-logo-sub {
    font-size: 12px;
    color: var(--text-muted);
}

.sidebar-nav {
    margin-top: 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-radius: 999px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 14px;
    transition: background 0.15s ease, color 0.15s ease, transform 0.08s ease;
}

.sidebar-link .icon {
    font-size: 16px;
}

.sidebar-link:hover {
    background: rgba(15,23,42,0.95);
    color: var(--text-main);
    transform: translateY(-1px);
}

/* C'EST ICI QUE LA CORRECTION S'APPLIQUE */
.sidebar-link.active {
    background: var(--accent-soft);
    color: var(--text-active); /* Utilise la variable dynamique au lieu de #eff6ff */
    font-weight: 600;
}

.sidebar-footer {
    margin-top: auto;
    padding-top: 10px;
    border-top: 1px solid rgba(30,64,175,0.5);
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.sidebar-user-text {
    display: flex;
    flex-direction: column;
}

.sidebar-user-name {
    font-size: 14px;
}

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

.sidebar-logout {
    display: inline-flex;
    font-size: 13px;
    color: var(--text-muted);
    text-decoration: none;
    padding: 4px 0;
}

.sidebar-logout:hover {
    color: #e5e7eb;
}

/* Main area */

.main-area {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.topbar {
    height: 52px;
    display: flex;
    align-items: center;
    padding: 0 24px;
    border-bottom: 1px solid rgba(148,163,184,0.18);
    backdrop-filter: blur(14px);
    background: linear-gradient(90deg, rgba(15,23,42,0.96), rgba(15,23,42,0.88));
    position: sticky;
    top: 0;
    z-index: 10;
    justify-content: space-between; 
}

.topbar-breadcrumb {
    font-size: 13px;
    color: var(--text-muted);
}

/* Breadcrumb */

.crumb-link {
    color: var(--text-muted);
    text-decoration: none;
}

.crumb-link:hover {
    color: var(--text-main);
}

.crumb-sep {
    margin: 0 5px;
    opacity: 0.6;
}

.crumb-current {
    color: var(--text-main);
}

/* Page layout */

.page-content {
    padding: 20px 24px 28px;
}

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

.page-header h1 {
    margin: 0 0 4px;
    font-size: 22px;
}

.page-subtitle {
    margin: 0;
    font-size: 13px;
    color: var(--text-muted);
}

.text-muted {
    color: var(--text-muted);
    font-size: 13px;
}

/* Cards */

.card {
    background: radial-gradient(circle at top left, rgba(37,99,235,0.2) 0, transparent 50%),
                radial-gradient(circle at bottom right, rgba(15,23,42,1) 0, #020617 70%);
    border-radius: var(--radius-card);
    padding: 16px 16px 14px;
    margin-bottom: 14px;
    border: 1px solid rgba(148,163,184,0.15);
    box-shadow: var(--shadow-card);
    transition: background 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.card-title {
    margin: 0 0 2px;
    font-size: 15px;
}

.card-subtitle {
    margin: 0 0 10px;
    font-size: 12px;
    color: var(--text-muted);
}

.card-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.card-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Layout grid */

.layout-two {
    display: grid;
    grid-template-columns: 1.2fr 1.2fr;
    gap: 14px;
    margin-bottom: 14px;
}

.layout-stacked-mobile {
    align-items: flex-start;
}

@media (max-width: 980px) {
    .sidebar {
        display: none;
    }
    .main-area {
        flex: 1;
    }
    .page-content {
        padding: 18px 16px 24px;
    }
    .layout-two {
        grid-template-columns: 1fr;
    }
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
}

/* Tables */

.table-wrapper {
    max-width: 100%;
    overflow-x: auto;
}

.table-modern {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    border-radius: 10px;
    overflow: hidden;
    background: rgba(15,23,42,0.85);
}

.table-modern thead {
    background: linear-gradient(90deg, #020617, #020617);
}

.table-modern th,
.table-modern td {
    padding: 8px 10px;
    text-align: left;
    border-bottom: 1px solid rgba(30,64,175,0.4);
}

.table-modern th {
    font-weight: 500;
    font-size: 12px;
    color: #9ca3af;
}

.table-modern tbody tr:nth-child(even) {
    background: rgba(15,23,42,0.9);
}

.table-modern tbody tr:hover {
    background: rgba(30,64,175,0.35);
}

.table-modern.compact th,
.table-modern.compact td {
    padding: 6px 8px;
}

/* Forms */

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 10px 14px;
    margin-top: 8px;
}

.form-grid.single-column {
    grid-template-columns: 1fr;
}

.form-grid label {
    display: flex;
    flex-direction: column;
    font-size: 12px;
}

input,
textarea,
select {
    margin-top: 4px;
    padding: 7px 8px;
    border-radius: 8px;
    border: 1px solid rgba(148,163,184,0.4);
    background: rgba(15,23,42,0.9);
    color: var(--text-main);
    font-size: 13px;
    outline: none;
}

input::placeholder,
textarea::placeholder {
    color: #6b7280;
}

input:focus,
textarea:focus,
select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 1px rgba(37,99,235,0.35);
}

textarea {
    resize: vertical;
    min-height: 70px;
}

.form-inline {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

.form-inline input {
    flex: 1;
}

.form-actions {
    margin-top: 8px;
    grid-column: 1 / -1;
    display: flex;
    gap: 6px;
}

.checkbox-inline {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-main);
}

/* Buttons */

button {
    font-family: inherit;
}

.btn-primary {
    background: linear-gradient(90deg, var(--accent), var(--accent-strong));
    color: #eff6ff;
    border: none;
    padding: 7px 14px;
    border-radius: 999px;
    font-size: 13px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    box-shadow: 0 10px 30px rgba(37,99,235,0.55);
    border: 1px solid rgba(191,219,254,0.3);
    transition: transform 0.08s ease, box-shadow 0.12s ease, filter 0.12s ease;
}

.btn-primary:hover {
    filter: brightness(1.05);
    transform: translateY(-1px);
    box-shadow: 0 14px 40px rgba(37,99,235,0.75);
}

.btn-full {
    width: 100%;
}

.btn-ghost {
    padding: 6px 12px;
    border-radius: 999px;
    border: 1px solid rgba(148,163,184,0.6);
    background: transparent;
    color: var(--text-main);
    font-size: 12px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.btn-ghost:hover {
    background: rgba(15,23,42,0.9);
}

.btn-ghost-small {
    padding: 5px 10px;
    border-radius: 999px;
    border: 1px solid rgba(148,163,184,0.6);
    font-size: 12px;
    color: var(--text-main);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-ghost-small:hover {
    background: rgba(15,23,42,0.9);
}

.btn-icon {
    padding: 4px 7px;
    border-radius: 999px;
    border: 1px solid rgba(148,163,184,0.6);
    background: transparent;
    cursor: pointer;
    font-size: 13px;
    color: var(--text-main);
}

.btn-icon:hover {
    background: rgba(15,23,42,0.9);
}

.btn-danger {
    background: var(--danger);
    border-radius: 999px;
}

.alert {
    padding: 8px 10px;
    border-radius: 8px;
    margin-bottom: 10px;
    font-size: 13px;
}

.alert-error {
    background: var(--danger-soft);
    color: #fecaca;
}

/* Badges / pills */

.badge-count {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 999px;
    background: rgba(37,99,235,0.15);
    color: #bfdbfe;
    font-size: 11px;
    border: 1px solid rgba(37,99,235,0.4);
}

.pill {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: var(--radius-pill);
    font-size: 11px;
}

.pill-status {
    background: rgba(59,130,246,0.1);
    color: #bfdbfe;
    border: 1px solid rgba(59,130,246,0.4);
}

.pill-success {
    background: var(--success-soft);
    color: #bbf7d0;
    border: 1px solid rgba(34,197,94,0.6);
}

.pill-muted {
    background: var(--pill-muted-bg);
    color: var(--pill-muted-text);
    border: 1px solid rgba(148,163,184,0.35);
}

.pill-admin {
    background: rgba(59,130,246,0.2);
    color: #bfdbfe;
    border: 1px solid rgba(59,130,246,0.7);
}

/* Stats */

.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 10px;
    margin-top: 8px;
}

.stat-card {
    background: rgba(15,23,42,0.85);
    border-radius: 12px;
    padding: 10px 12px;
    border: 1px solid rgba(148,163,184,0.3);
}

.stat-label {
    font-size: 11px;
    color: var(--text-muted);
}

.stat-value {
    font-size: 18px;
    font-weight: 600;
    margin-top: 4px;
}

/* Cells */

.cell-main {
    display: flex;
    align-items: center;
    gap: 8px;
}

.avatar-circle,
.avatar-pill {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: radial-gradient(circle at top, #1d4ed8 0, #020617 70%);
    border: 1px solid rgba(191,219,254,0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    color: #e5e7eb;
}

.avatar-pill {
    border-radius: 999px;
    width: 36px;
}

.cell-title {
    font-size: 14px;
}

.cell-subtitle {
    font-size: 11px;
    color: var(--text-muted);
}

/* Login page */

.login-body {
    background: radial-gradient(circle at top, #1d4ed8 0, #020617 40%, #000 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.login-card {
    background: rgba(15,23,42,0.98);
    padding: 22px 22px 18px;
    border-radius: 16px;
    width: 360px;
    max-width: 100%;
    box-shadow: var(--shadow-soft);
    border: 1px solid rgba(148,163,184,0.4);
}

.login-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.login-header h1 {
    margin: 0 0 2px;
    font-size: 18px;
}

.login-header p {
    margin: 0;
    font-size: 12px;
    color: var(--text-muted);
}

.login-icon {
    width: 36px;
    height: 36px;
    border-radius: 14px;
    background: radial-gradient(circle at top, #1d4ed8 0, #020617 70%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 16px;
    color: #e5e7eb;
    border: 1px solid rgba(191,219,254,0.5);
}

.login-card .form-vertical label {
    display: block;
    font-size: 12px;
    margin-bottom: 8px;
}

.login-card input {
    width: 100%;
}

.login-card button {
    margin-top: 4px;
}

.login-card .hint {
    margin-top: 10px;
    font-size: 11px;
    color: var(--text-muted);
}


/* ========================================= */
/* THÈME CLAIR (Light Mode Overrides)      */
/* ========================================= */

.light-theme {
    --text-main: #1f2937;        /* Gris foncé presque noir */
    --text-muted: #4b5563;       /* Gris moyen foncé (PLUS SOMBRE qu'avant) */
    
    --accent: #2563eb;           /* Bleu un peu plus vif */
    --accent-soft: rgba(37,99,235,0.1);
    
    /* CORRECTION TEXTE ACTIF : BLEU FONCÉ */
    --text-active: #1d4ed8;      
    
    --border-subtle: #e5e7eb;    /* Gris clair */
    --shadow-card: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

/* Override du Body Gradient */
body.light-theme {
    background: #f8fafc; /* Fond gris très clair (Slate 50) */
}

/* Override Sidebar */
body.light-theme .sidebar {
    background: #ffffff;
    border-right: 1px solid #e2e8f0;
}
body.light-theme .sidebar-link:hover {
    background: #f1f5f9;
    color: #0f172a;
}
body.light-theme .sidebar-logo-icon {
    background: var(--accent);
    color: white;
    border: none;
}

/* Override Topbar */
body.light-theme .topbar {
    background: rgba(255, 255, 255, 0.8);
    border-bottom: 1px solid #e2e8f0;
}

/* Override Cards */
body.light-theme .card,
body.light-theme .login-card,
body.light-theme .stat-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

/* Override Inputs */
body.light-theme input,
body.light-theme textarea,
body.light-theme select {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    color: #111827; /* Force le texte noir dans les inputs */
}
body.light-theme input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}

/* Override Table */
body.light-theme .table-modern {
    background: #ffffff;
    border: 1px solid #e2e8f0;
}
body.light-theme .table-modern thead {
    background: #f8fafc;
}
body.light-theme .table-modern th {
    color: #4b5563;
    border-bottom: 1px solid #e2e8f0;
}
body.light-theme .table-modern td {
    border-bottom: 1px solid #f1f5f9;
    color: #1f2937;
}
body.light-theme .table-modern tbody tr:nth-child(even) {
    background: #f8fafc;
}
body.light-theme .table-modern tbody tr:hover {
    background: #eff6ff;
}

/* Override Boutons Ghost */
body.light-theme .btn-ghost,
body.light-theme .btn-ghost-small,
body.light-theme .btn-icon {
    color: #4b5563;
    border-color: #d1d5db;
}
body.light-theme .btn-ghost:hover,
body.light-theme .btn-ghost-small:hover,
body.light-theme .btn-icon:hover {
    background: #f3f4f6;
    color: #111827;
}

/* Pills */
body.light-theme .pill-muted {
    background: #f3f4f6;
    color: #4b5563;
    border: 1px solid #e5e7eb;
}
/* Badge d'alerte rouge pulsant */
.badge-alert {
    background-color: #ef4444;
    color: white;
    font-size: 10px;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 10px;
    margin-left: auto; /* Pousse le badge à droite */
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
    animation: pulse-red 2s infinite;
}

@keyframes pulse-red {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
    }
    70% {
        transform: scale(1);
        box-shadow: 0 0 0 6px rgba(239, 68, 68, 0);
    }
    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
    }
}
/* ... Fin du fichier style.css ... */

/* Ligne verte pour les éléments cochés dans les modules custom */
.row-success td {
    background-color: rgba(34, 197, 94, 0.15) !important;
    color: #15803d; /* Vert foncé lisible */
}
/* Mode sombre adaptation */
body:not(.light-theme) .row-success td {
    color: #bbf7d0;
}
/* ... (Fin du fichier style.css) ... */

/* Bouton d'ajout rapide (+) pour les menus déroulants */
.btn-add-inline {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 2px 8px;
    height: 24px;
    border-radius: 999px;
    border: 1px solid var(--accent);
    color: var(--accent);
    background: rgba(59, 130, 246, 0.1); /* Accent soft */
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s ease;
    line-height: 1;
    white-space: nowrap;
}

.btn-add-inline:hover {
    background: var(--accent);
    color: white; /* Texte blanc au survol pour bon contraste */
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    transform: translateY(-1px);
}
/* --- CORRECTIFS LIGHT MODE (Ajouter à la fin de style.css) --- */

/* 1. Corriger la visibilité du texte dans les bulles vertes (Pill Success) */
body.light-theme .pill-success {
    background-color: #dcfce7 !important; /* Vert très pâle */
    color: #15803d !important;           /* Vert foncé (Lisible) */
    border-color: #86efac !important;
}

/* 2. Corriger les bulles rouges (Pill Danger) */
body.light-theme .pill[style*="var(--danger)"] {
    background-color: #fee2e2 !important; /* Rouge très pâle */
    color: #b91c1c !important;           /* Rouge foncé */
}

/* 3. Corriger la variable de fond "élevé" pour la barre de recherche */
body.light-theme {
    --bg-elevated: #ffffff;       /* Blanc pur au lieu de bleu nuit */
    --border-subtle: #e5e7eb;     /* Gris clair */
}

/* 4. Forcer les inputs en mode clair */
body.light-theme input,
body.light-theme select, 
body.light-theme textarea {
    background-color: #ffffff !important;
    color: #1f2937 !important;    /* Texte gris foncé */
    border: 1px solid #d1d5db !important;
}

body.light-theme input::placeholder {
    color: #9ca3af !important;
}
/* --- BADGE REQUÊTES (PENDING) --- */
.badge-pending {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 2px 6px;
    border-radius: 10px;
    background-color: #f59e0b; /* Jaune/Orange */
    color: #ffffff;
    font-size: 10px;
    font-weight: bold;
    box-shadow: 0 0 0 1px rgba(245, 158, 11, 0.5);
    margin-left: 4px; /* Petit espace entre les badges */
    animation: pulse-yellow 2s infinite;
}

@keyframes pulse-yellow {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 4px rgba(245, 158, 11, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(245, 158, 11, 0); }
}

/* Support Light Mode */
body.light-theme .badge-pending {
    background-color: #d97706;
    color: white;
}
/* Fond sombre transparent */
.modal-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background-color: rgba(0,0,0,0.7);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Boite blanche centrale */
.modal-content {
    background-color: white;
    padding: 30px;
    border-radius: 10px;
    width: 90%;
    max-width: 600px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    position: relative;
    font-family: Arial, sans-serif;
}

.close-btn {
    position: absolute;
    top: 10px; right: 15px;
    font-size: 24px;
    cursor: pointer;
    color: #666;
}

.admin-input {
    width: 100%;
    padding: 10px;
    margin: 10px 0;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 16px;
}

.history-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}

.history-table th, .history-table td {
    padding: 10px;
    border-bottom: 1px solid #eee;
    text-align: left;
}

.btn-refund {
    background-color: #ef4444;
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 4px;
    cursor: pointer;
}
/* ============================
   FICHE EMPLOYÉ – ACTIONS
   ============================ */

.employee-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 15px;
}

.action-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 999px;
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
    border: none;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.2s ease, transform 0.1s ease;
}

.action-pill:hover {
    transform: translateY(-1px);
}

/* Actions standards (bleu) */
.action-pill.primary {
    background-color: #e7f1ff;
    color: #0d6efd;
}

.action-pill.primary:hover {
    background-color: #d0e2ff;
}

/* Action destructive (rouge) */
.action-pill.danger {
    background-color: #fdeaea;
    color: #dc3545;
}

.action-pill.danger:hover {
    background-color: #f9cfcf;
}
/* =========================================
   NOUVEAU : DASHBOARD ASSETS & ACCORDÉONS
   (À coller à la fin de style.css)
   ========================================= */

/* --- Grille du Dashboard --- */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

/* On réutilise votre .stat-card existante, on ajoute juste le style pour les gros chiffres */
.stat-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 1.5rem !important; /* Un peu plus d'espace que les stats habituelles */
}

.stat-number {
    font-size: 2rem;
    font-weight: 700;
    color: var(--accent); /* Utilise votre bleu défini */
    line-height: 1.2;
    display: block;
}

.stat-label {
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 4px;
}

/* --- Accordéons (Filtres & Ajouts) --- */
details.modern-details {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle, rgba(148,163,184,0.15));
    border-radius: var(--radius-card);
    margin-bottom: 1rem;
    overflow: hidden;
    transition: background 0.3s ease, border-color 0.3s ease;
}

details.modern-details summary {
    padding: 1rem;
    cursor: pointer;
    font-weight: 600;
    background: var(--bg-hover); /* Légèrement plus clair que le fond */
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-main);
    transition: background 0.2s ease;
}

details.modern-details summary:hover {
    background: rgba(255, 255, 255, 0.08);
}

details.modern-details summary::-webkit-details-marker { display: none; }
details.modern-details summary::after { 
    content: '+'; 
    font-size: 1.2rem; 
    font-weight: 300;
    color: var(--text-muted);
}
details.modern-details[open] summary::after { content: '-'; }

.details-content {
    padding: 1.5rem;
    border-top: 1px solid var(--border-subtle);
    background: var(--bg-card); /* Assure le même fond */
}

/* --- Grille de formulaire moderne --- */
.form-grid-modern {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}
.full-width { grid-column: 1 / -1; }

.label-text {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 4px;
    display: block;
}

/* Bouton "+" inline (petit lien textuel) */
.btn-link-small {
    background: none;
    border: none;
    color: var(--accent);
    font-size: 0.75rem;
    cursor: pointer;
    padding: 0;
    text-decoration: underline;
}
.btn-link-small:hover { text-decoration: none; color: #fff; }

/* --- Popup Ajout Rapide --- */
.inline-add-box {
    display: none;
    margin-top: 5px;
    padding: 12px;
    background: var(--bg-elevated); /* Important pour le contraste */
    border: 1px solid var(--border-subtle);
    box-shadow: var(--shadow-card);
    border-radius: 8px;
    position: absolute;
    z-index: 100;
    width: 100%;
}

/* =========================================================
   OVERRIDES SPECIFIQUES THÈME CLAIR (.light-theme)
   ========================================================= */

body.light-theme details.modern-details {
    background: #ffffff;
    border-color: #e2e8f0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

body.light-theme details.modern-details summary {
    background: #f8fafc;
    color: #1e293b;
    border-bottom: 1px solid #e2e8f0;
}

body.light-theme details.modern-details summary:hover {
    background: #f1f5f9;
}

body.light-theme .details-content {
    background: #ffffff;
    border-top-color: #e2e8f0;
}

/* Force la couleur des labels en mode clair */
body.light-theme .label-text,
body.light-theme .stat-label {
    color: #64748b; /* Slate-500 */
}

/* Popup blanc en mode clair */
body.light-theme .inline-add-box {
    background: #ffffff;
    border-color: #cbd5e1;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

/* Bouton lien en mode clair */
body.light-theme .btn-link-small:hover {
    color: var(--accent-strong);
}
/* =========================================
   RESPONSIVE / MOBILE SIDEBAR
   ========================================= */

/* Par défaut (Desktop) : éléments mobiles cachés */
#mobile-menu-btn { display: none; }
#mobile-overlay { display: none; }
#close-sidebar-btn { display: none; }

/* --- TABLETTES ET MOBILES (Max 1024px) --- */
@media (max-width: 1024px) {
    
    /* 1. Layout global */
    .app-shell {
        display: block; /* Casse le flex desktop */
        height: auto;
    }

    /* 2. Sidebar cachée à gauche */
    .sidebar {
        position: fixed;
        top: 0;
        left: -280px;
        height: 100vh;
        width: 260px;
        z-index: 1000;
        transition: left 0.3s ease-in-out;
        box-shadow: 2px 0 15px rgba(0,0,0,0.5);
        display: flex; /* Force le flex pour que le contenu s'affiche */
    }

    /* Classe active pour montrer la sidebar */
    .sidebar.mobile-open {
        left: 0;
    }

    /* 3. Zone principale */
    .main-area {
        width: 100%;
        margin-left: 0;
    }

    /* 4. Bouton Menu (Burger) */
    #mobile-menu-btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        background: transparent;
        border: none;
        font-size: 1.5rem;
        cursor: pointer;
        margin-right: 15px;
        color: var(--text-main); /* S'adapte au thème clair/sombre */
        padding: 5px;
        border-radius: 4px;
    }
    
    #mobile-menu-btn:hover {
        background: var(--bg-hover);
    }

    /* 5. Bouton Fermer (Croix dans la sidebar) */
    #close-sidebar-btn {
        display: block;
        background: transparent;
        border: none;
        color: var(--text-muted);
        font-size: 1.2rem;
        cursor: pointer;
        margin-left: auto;
    }
    #close-sidebar-btn:hover {
        color: var(--text-main);
    }

    /* 6. Overlay sombre (fond) */
    #mobile-overlay {
        display: block;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.6);
        backdrop-filter: blur(2px);
        z-index: 999;
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.3s ease;
    }

    #mobile-overlay.active {
        opacity: 1;
        visibility: visible;
    }
    
    /* Ajustement Topbar pour mobile */
    .topbar {
        padding: 0 15px;
    }
    
    /* Ajustement Padding Contenu */
    .page-content {
        padding: 15px;
    }
}
/* =========================================
   CORRECTIFS POUR LE MODE SOMBRE / CLAIR
   ========================================= */

/* 1. On définit les variables de fond pour le mode Clair (si manquantes) */
.light-theme {
    --bg-main: #f8fafc;
    --bg-card: #ffffff;
    --bg-elevated: #ffffff;
    --border-subtle: #e2e8f0;
}

/* 2. FORCE LE MODE SOMBRE sur les éléments avec fond blanc "hardcodé" */
/* Cible les boîtes de statut et les cartes de modules à l'unité */
body:not(.light-theme) [style*="background: white"],
body:not(.light-theme) [style*="background:white"] {
    background-color: var(--bg-card) !important;
    color: var(--text-main) !important;
    border-color: var(--border-subtle) !important;
    box-shadow: var(--shadow-card) !important;
}

/* On s'assure que les titres et textes dans ces boîtes deviennent blancs en mode sombre */
body:not(.light-theme) [style*="background: white"] h2,
body:not(.light-theme) [style*="background: white"] h3,
body:not(.light-theme) [style*="background: white"] p:not([style*="color"]),
body:not(.light-theme) [style*="background: white"] div:not([style*="color"]) {
    color: var(--text-main) !important;
}

/* 3. FORCE LE MODE CLAIR sur les bundles (pour éviter qu'ils restent sombres) */
body.light-theme [style*="background:var(--bg-card)"],
body.light-theme [style*="background: var(--bg-card)"],
body.light-theme .card {
    background: #ffffff !important;
    color: #1f2937 !important;
    border-color: #e2e8f0 !important;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05) !important;
}

/* Correction des textes de bundle en mode clair */
body.light-theme .card h3,
body.light-theme .card p,
body.light-theme .card li {
    color: #4b5563 !important;
}

/* Correction pour les titres principaux (Gestion des offres, Modules à l'unité) */
body.light-theme h1, 
body.light-theme h2,
body.light-theme .container h2 {
    color: #111827 !important;
}

/* Correction pour le texte "Prochain paiement" pour qu'il ne disparaisse pas */
body:not(.light-theme) div[style*="color: #111827"] {
    color: var(--text-main) !important;
}
/* ============================================================
   CORRECTIFS DE LISIBILITÉ (DARK & LIGHT MODE)
   ============================================================ */

/* 1. Rendre les listes de modules lisibles en Dark Mode */
/* Cible les noms de modules comme employees, assets, inventory... */
body:not(.light-theme) small, 
body:not(.light-theme) .text-muted,
body:not(.light-theme) td small {
    color: #cbd5e1 !important; /* Un blanc-gris beaucoup plus brillant */
    font-weight: 500;
}

/* 2. Corriger le fond blanc des modules à l'unité en Dark Mode */
body:not(.light-theme) [style*="background: white"],
body:not(.light-theme) [style*="background:white"] {
    background: var(--bg-card) !important;
    border-color: var(--border-subtle) !important;
    color: var(--text-main) !important;
}

/* 3. Forcer les Bundles à passer en BLANC en Light Mode */
/* On doit annuler le gradient bleu/noir qui est codé en dur */
body.light-theme .card, 
body.light-theme [style*="background:var(--bg-card)"],
body.light-theme [style*="background: var(--bg-card)"] {
    background: #ffffff !important;
    background-image: none !important; /* Supprime le gradient sombre */
    color: #1f2937 !important;
    border: 1px solid #e2e8f0 !important;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05) !important;
}

/* 4. Texte des bundles en Light Mode */
body.light-theme .card h3, 
body.light-theme .card div,
body.light-theme .card li,
body.light-theme .card p {
    color: #374151 !important; /* Gris très foncé pour le contraste */
}

/* 5. Correction spécifique pour le statut et prix dans billing.html */
body:not(.light-theme) div[style*="color: #111827"] {
    color: #ffffff !important; /* Le prix "Prochain paiement" devient blanc */
}
.inline-add-box {
    display: none;
    position: absolute;
    background: white;
    border: 1px solid #ddd;
    padding: 10px;
    z-index: 100;
    width: 200px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    border-radius: 8px;
    top: 100%;
}

.option-manage-list form {
    display: inline;
}
/* --- Correction Thème & Alignement Gestion Options --- */
.inline-add-box {
    display: none;
    position: absolute;
    background-color: var(--bg-card); /* S'adapte au thème */
    border: 1px solid var(--border-subtle);
    padding: 12px;
    z-index: 100;
    width: 100%; /* S'aligne sur la largeur du champ */
    box-shadow: var(--shadow-card);
    border-radius: 8px;
    top: 100%;
}

/* Force la visibilité du texte dans la liste de gestion */
.option-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85em;
    padding: 6px 0;
    border-bottom: 1px solid var(--border-subtle);
    color: var(--text-main) !important; /* Texte visible partout */
}

.option-manage-list p {
    color: var(--text-muted);
    font-size: 0.75em;
    margin-bottom: 8px;
    font-weight: 600;
}

/* Rapprochement de l'icône paramètre */
.label-header-flex {
    display: flex; 
    align-items: center; 
    gap: 8px; /* Espace fixe entre le texte et l'engrenage */
    margin-bottom: 4px;
}