/* ── Variables & Thème ───────────────────────────────────────── */
:root, [data-theme="dark"] {
    --bg-base: #0f1115;
    --bg-panel: rgba(255, 255, 255, 0.03);
    --border-color: rgba(255, 255, 255, 0.08);
    --primary: #6366f1; /* Indigo vibrant */
    --primary-hover: #4f46e5;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --success: #10b981;
    --danger: #ef4444;
    
    --shadow-glass: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    --backdrop-blur: blur(12px);
    
    --radius-lg: 16px;
    --radius-md: 12px;
    --radius-sm: 8px;
    
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="light"] {
    --bg-base: #f0f4f8; /* Bleu très gris clair */
    --bg-panel: rgba(255, 255, 255, 0.7);
    --border-color: rgba(0, 0, 0, 0.1);
    --primary: #1e3a8a; /* Bleu marine doux */
    --primary-hover: #1e40af;
    --text-main: #0f172a;
    --text-muted: #475569;
    --success: #059669;
    --danger: #dc2626;
    
    --shadow-glass: 0 8px 32px 0 rgba(0, 0, 0, 0.05);
}

/* ── Reset & Base ────────────────────────────────────────────── */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
}

body {
    background-color: var(--bg-base);
    color: var(--text-main);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    margin: 0;
}

a { color: var(--primary); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--primary-hover); }

/* ── Utilitaires & Composants ────────────────────────────────── */
.glass-panel {
    background: var(--bg-panel);
    backdrop-filter: var(--backdrop-blur);
    -webkit-backdrop-filter: var(--backdrop-blur);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-glass);
}

.cache { display: none !important; }
.visible { display: flex !important; }

/* Boutons */
.btn-primary {
    background: var(--primary);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: var(--radius-md);
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition);
}
.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

.btn-icon {
    background: transparent;
    color: var(--text-muted);
    border: none;
    padding: 8px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
}
.btn-icon:hover {
    background: rgba(255,255,255,0.1);
    color: var(--text-main);
}

.btn-secondary {
    background: transparent;
    color: var(--text-main);
    border: 1px solid var(--border-color);
    padding: 10px 20px;
    border-radius: var(--radius-md);
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition);
}
.btn-secondary:hover {
    background: var(--bg-panel);
    border-color: var(--text-muted);
}

/* Formulaires */
.input-group { margin-bottom: 20px; }
.input-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.9rem;
    color: var(--text-muted);
}
.input-group input, .input-group textarea {
    width: 100%;
    padding: 12px 16px;
    background: rgba(0,0,0,0.2);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-main);
    font-size: 1rem;
    transition: var(--transition);
    font-family: inherit;
    resize: vertical;
}
.input-group input:focus, .input-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

/* Password Reveal (v0.9) */
.password-wrapper {
    position: relative;
    width: 100%;
}
.password-wrapper input {
    padding-right: 45px !important; border-radius: var(--radius-md) !important; appearance: none; -webkit-appearance: none; -moz-appearance: none;
}
.btn-reveal {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: var(--transition);
}
.btn-reveal:hover {
    color: var(--primary);
    background: rgba(99, 102, 241, 0.1);
}

.theme-toggle-global {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 1100;
}

/* ── Écran de Connexion ──────────────────────────────────────── */
.ecran {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at top right, rgba(99, 102, 241, 0.15), transparent 40%),
                var(--bg-base);
    z-index: 1000;
    padding: 40px 20px;
}

.connexion-box {
    width: 100%;
    max-width: 400px;
    padding: 40px;
    text-align: center;
}

.logo-area {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 10px;
    color: var(--primary);
}
.logo-area h1 { color: var(--text-main); font-size: 2rem; }
.subtitle { color: var(--text-muted); margin-bottom: 30px; font-weight: 300; }

.switch-auth { margin-top: 24px; font-size: 0.9rem; color: var(--text-muted); }

.app-layout {
    width: 100%;
    display: flex;
    flex: 1;
}

/* Sidebar */
.sidebar {
    width: 280px;
    height: 100vh;
    position: sticky;
    top: 0;
    display: flex;
    flex-direction: column;
    padding: 24px;
    border-right: 1px solid var(--border-color);
    border-radius: 0; /* Override glass-panel default */
}

.sidebar-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 40px;
    color: var(--primary);
}
.sidebar-header h2 { color: var(--text-main); }

.nav-links {
    list-style: none;
    flex: 1;
}
.nav-links li { margin-bottom: 8px; }
.nav-links a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--text-muted);
    border-radius: var(--radius-md);
    transition: var(--transition);
}
.nav-links a:hover, .nav-links a.active {
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary);
}

.sidebar-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
}
.user-info { display: flex; align-items: center; gap: 12px; }
.avatar {
    width: 40px; height: 40px;
    border-radius: 50%;
    background: var(--primary);
    display: flex; align-items: center; justify-content: center;
    font-weight: bold;
}
.user-details { display: flex; flex-direction: column; }
.user-role { font-size: 0.8rem; color: var(--text-muted); }

/* Main Content */
.main-content {
    flex: 1;
    padding: 40px;
    max-width: 1200px;
    margin: 0 auto;
}

.vue { display: none; animation: fadeIn 0.4s ease; }
.vue.active { display: block; }

@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

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

/* Dashboard Stats */
/* ── Dashboard Stats ──────────────────────────────────────────── */
/* 5 blocs forcés sur une ligne — se wrappent en 2+3 sur tablette et 1 colonne sur mobile */
.stats-grid { display: grid; gap: 16px; }
.stats-grid-3 { grid-template-columns: 1fr 2fr 1fr; }
@media (max-width: 1100px) { .stats-grid-3 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 700px)  { .stats-grid-3 { grid-template-columns: 1fr; } }
.stat-card {
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 20px;
}
.stat-card-cliquable {
    cursor: pointer; position: relative;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.stat-card-cliquable:hover {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(99,102,241,0.2), var(--shadow-glass);
}
.stat-card-fleche {
    position: absolute; right: 16px; top: 50%; transform: translateY(-50%);
    width: 16px; height: 16px; color: var(--text-muted); opacity: 0.5;
}
.stat-card-cliquable:hover .stat-card-fleche { opacity: 1; color: var(--primary); }
.stat-card-ca { align-items: flex-start; }
.stat-card-ca .stat-icon { margin-top: 4px; flex-shrink: 0; }
.stat-card-ca .stat-details { width: 100%; }
.ca-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 28px; margin-top: 14px; }
.ca-metrique { display: flex; flex-direction: column; gap: 4px; }
.ca-label { font-size: 0.72rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; }
.ca-valeur { font-size: 1.15rem; font-weight: 700; color: var(--text-main); }
.ca-metrique-accent .ca-valeur { color: var(--primary); font-size: 1.25rem; }
.stat-icon {
    width: 48px; height: 48px;
    border-radius: var(--radius-md);
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary);
    display: flex; align-items: center; justify-content: center;
}
.stat-value { font-size: 1.8rem; font-weight: 600; margin-top: 4px; }

/* Empty States */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}
.empty-state i { width: 48px; height: 48px; margin-bottom: 16px; opacity: 0.5; }

/* ── Modales ─────────────────────────────────────────────────── */
.modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.7); /* Plus sombre pour faire ressortir la fenêtre */
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    animation: fadeIn 0.3s ease;
}
.modal.cache { display: none !important; }

.modal-content {
    width: 100%;
    max-width: 500px;
    padding: 0; /* On gère le padding par zones pour l'effet fenêtre */
    position: relative;
    max-height: 90vh;
    overflow: hidden; /* Pour les arrondis */
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.05), 0 30px 70px rgba(0, 0, 0, 0.8);
    background: var(--bg-base);
    display: flex;
    flex-direction: column;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    background: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid var(--border-color);
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 20px 24px;
    background: rgba(255, 255, 255, 0.02);
    border-top: 1px solid var(--border-color);
}
.modal-header h2 { font-size: 1.4rem; color: var(--text-main); }

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 12px;
}

/* Toast */
#toast-container {
    position: fixed;
    bottom: 24px; right: 24px;
    display: flex; flex-direction: column; gap: 12px;
    z-index: 2000;
}
.toast {
    padding: 16px 24px;
    border-radius: var(--radius-md);
    background: #1e293b;
    color: white;
    box-shadow: 0 10px 25px rgba(0,0,0,0.5);
    display: flex; align-items: center; gap: 12px;
    animation: slideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

.mt-4 { margin-top: 40px; }

/* ── Utilitaires d'espacement ────────────────────────────────── */
/* Définis ici car utilisés dans index.html sans déclaration préalable,
   ce qui provoquait un padding/margin nul sur les panels profil et factures */
.p-4   { padding: 24px 32px; }
.mt-1  { margin-top: 8px; }
.mt-2  { margin-top: 16px; }
.mt-3  { margin-top: 24px; }
.mb-2  { margin-bottom: 16px; }
.mb-3  { margin-bottom: 24px; }
.my-4  { margin-top: 32px; margin-bottom: 32px; }

/* ── Tableau de données (factures) ───────────────────────────── */
/* Styles manquants sur .table-data : th/td n'avaient aucun padding,
   le contenu était compressé contre les bords du panel glass */
.table-data {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}
.table-data thead tr {
    border-bottom: 2px solid var(--border-color);
}
.table-data th {
    padding: 14px 20px;
    text-align: left;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    white-space: nowrap;
}
.table-data td {
    padding: 14px 20px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-main);
    vertical-align: middle;
}
.table-data tbody tr:last-child td { border-bottom: none; }
.table-data tbody tr:hover {
    background: rgba(99, 102, 241, 0.05);
    transition: var(--transition);
}

/* ── Badges statut facture ───────────────────────────────────── */
.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.03em;
}
.badge-brouillon { background: rgba(148,163,184,0.15); color: #94a3b8; }
.badge-envoyee   { background: rgba(59,130,246,0.15);  color: #3b82f6; }
.badge-payee     { background: rgba(16,185,129,0.15);  color: #10b981; }
.badge-impayee   { background: rgba(239,68,68,0.15);   color: #ef4444; }

/* ── Logo profil fournisseur ─────────────────────────────────── */
/* Image masquée par défaut (src vide).
   profil.js la rend visible avec img.style.display='block' quand logo_url est défini. */
#prof-logo-img[src=""] { display: none !important; }

/* Cercle fallback avec initiales — affiché si pas de logo uploadé */
.logo-placeholder {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: rgba(99, 102, 241, 0.15);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    font-weight: 700;
    margin-bottom: 15px;
    border: 2px dashed var(--border-color);
    user-select: none;
}

/* ── Alerte seuil auto-entrepreneur ─────────────────────────── */
.alerte-seuil {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 16px 20px;
    border-radius: var(--radius-md);
    border: 1px solid;
    margin-top: 24px;
    font-size: 0.9rem;
}
.alerte-seuil.warning {
    background: rgba(245, 158, 11, 0.08);
    border-color: rgba(245, 158, 11, 0.3);
    color: #f59e0b;
}
.alerte-seuil.danger {
    background: rgba(239, 68, 68, 0.08);
    border-color: rgba(239, 68, 68, 0.3);
    color: var(--danger);
}
.alerte-seuil .alerte-titre { font-weight: 600; margin-bottom: 4px; }
.alerte-seuil .alerte-corps { opacity: 0.9; }

/* ── Barre de progression URSSAF ─────────────────────────────── */
.progress-seuil {
    height: 8px;
    background: var(--border-color);
    border-radius: 99px;
    margin-top: 8px;
    overflow: hidden;
}
.progress-seuil-bar {
    height: 100%;
    border-radius: 99px;
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Politique de confidentialité ────────────────────────────── */
.page-rgpd { max-width: 760px; line-height: 1.8; }
.page-rgpd h2 { margin-top: 32px; margin-bottom: 12px; font-size: 1.1rem; color: var(--primary); }
.page-rgpd p  { margin-bottom: 12px; color: var(--text-main); }
.page-rgpd ul { padding-left: 20px; margin-bottom: 12px; }
.page-rgpd ul li { margin-bottom: 6px; color: var(--text-muted); }

/* ── Footer applicatif ───────────────────────────────────────── */
.app-footer {
    width: 100%;
    text-align: center;
    padding: 24px 20px;
    background: var(--bg-panel);
    border-top: 1px solid var(--border-color);
    color: var(--text-muted);
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 30px;
    flex-wrap: wrap;
    margin-top: auto;
    z-index: 100;
}
.app-footer img { height: 20px; opacity: 0.7; }
.app-footer a { color: var(--text-muted); }
.app-footer a:hover { color: var(--primary); }

/* ── Indicateur force mot de passe ──────────────────────────── */
.password-strength {
    height: 4px;
    border-radius: 99px;
    background: var(--border-color);
    margin-top: 6px;
    overflow: hidden;
}
.password-strength-bar {
    height: 100%;
    border-radius: 99px;
    transition: width 0.3s ease, background 0.3s ease;
}
.password-hint {
    font-size: 0.78rem;
    margin-top: 6px;
    color: var(--text-muted);
}

/* ── Modal compact (sans ascenseur vertical) ─────────────────── */
/* max-height retiré du .modal-content générique et remplacé par .modal-compact
   qui ajuste la hauteur au contenu sans scroll vertical */
.modal-compact {
    max-height: 92vh;
    overflow-y: auto;
    width: 100%;
}

/* Grilles internes aux modals */
.modal-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.modal-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 15px; }

/* Bouton fermer modal — moderne, sans icône SVG externe */
.btn-fermer-modal {
    background: transparent;
    border: none;
    font-size: 1.2rem;
    line-height: 1;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}
.btn-fermer-modal:hover {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

/* ── Accordéon formulaire client ─────────────────────────────── */
/* Permet d'afficher un formulaire long sans scroll vertical :
   chaque section se déplie/replie indépendamment */
.accord-section {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    margin-bottom: 12px;
    overflow: hidden;
}
.accord-titre {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    background: rgba(255,255,255,0.03);
    user-select: none;
    transition: var(--transition);
}
.accord-titre:hover { background: rgba(99, 102, 241, 0.08); }
.accord-chevron { margin-left: auto; transition: transform 0.25s ease; }
.accord-titre.ouvert .accord-chevron { transform: rotate(180deg); }
.accord-corps {
    padding: 16px;
    border-top: 1px solid var(--border-color);
    display: none; /* Contrôlé par application.js */
}
.accord-corps.ouvert { display: block; }

/* ── Filtre statut factures ───────────────────────────────────── */
.filtre-select {
    padding: 9px 36px 9px 14px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-panel);
    color: var(--text-main);
    font-size: 0.9rem;
    cursor: pointer;
    min-width: 160px;
}

/* ── Actions tableau factures sur une ligne ───────────────────── */
/* Empêche le wrap des boutons d'action dans la colonne Actions */
.actions-facture {
    display: flex;
    gap: 4px;
    align-items: center;
    flex-wrap: nowrap;
    white-space: nowrap;
}
.actions-facture .filtre-select {
    min-width: 100px;
    max-width: 110px;
    font-size: 0.78rem;
    padding: 4px 24px 4px 7px;
}

/* ── Responsive modals ───────────────────────────────────────── */
@media (max-width: 600px) {
    .modal-grid-2, .modal-grid-3 { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
    .app-layout { flex-direction: column; }
    
    .sidebar {
        width: 100%; height: auto;
        position: relative;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        padding: 16px;
    }
    .nav-links { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
    .nav-links li { margin-bottom: 0; }
    .nav-links a { padding: 8px 12px; }
    
    .sidebar-footer { padding-top: 16px; }
    
    .main-content { padding: 20px; }
    .vue-header { flex-direction: column; align-items: flex-start; gap: 16px; }
    
    /* Optimisation lecture mobile RGPD */
    .page-rgpd { padding: 0 10px; font-size: 0.95rem; line-height: 1.6; }
    .page-rgpd h2 { font-size: 1.1rem; margin-top: 25px; }
}

@media (max-width: 600px) {
    .connexion-box { padding: 20px; }
    .logo-area img { max-width: 180px !important; }
    .nav-links { flex-direction: column; }
}

/* --- Profil --- */
.profile-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 30px;
    margin-top: 30px;
}

.logo-upload-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    border: 2px dashed var(--border-color);
    padding: 30px;
    border-radius: 12px;
    transition: all 0.3s ease;
}

.logo-upload-area:hover {
    border-color: var(--primary-color);
    background: rgba(100, 108, 255, 0.05);
}

.checkbox-group {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
    cursor: pointer;
}

.checkbox-group input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.checkbox-group label {
    margin-bottom: 0;
    cursor: pointer;
    font-weight: 500;
}

/* --- Modern Select & Inputs Premium --- */
.input-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-muted);
    transition: color 0.3s ease;
}

.input-group:focus-within label {
    color: var(--primary-color);
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
select,
textarea {
    width: 100%;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    color: var(--text-color);
    font-family: inherit;
    font-size: 0.95rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05);
}

[data-theme="light"] input,
[data-theme="light"] select,
[data-theme="light"] textarea {
    background: #ffffff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 0 4px rgba(var(--primary-rgb), 0.15);
    transform: translateY(-1px);
}

select {
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236366f1' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 12px center !important;
    background-size: 14px !important;
    padding: 12px 40px 12px 16px !important;
    border-radius: 12px !important;
    appearance: none !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    background-color: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    font-size: 1rem;
    transition: var(--transition);
}
select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

select option {
    background: #1e1e24;
    color: white;
    padding: 10px;
}

[data-theme="light"] select option {
    background: white;
    color: #1e1e24;
}

/* --- Checkbox Premium --- */
.checkbox-group {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.checkbox-group:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: var(--primary-color);
}

.checkbox-group input[type="checkbox"] {
    width: 20px;
    height: 20px;
    accent-color: var(--primary-color);
    cursor: pointer;
}

/* --- Dashboard --- */

/* Vue URSSAF détail trimestriel — v0.7 */
#table-urssaf thead th { font-size: 0.78rem; white-space: nowrap; text-align: right; }
#table-urssaf thead th:first-child { text-align: left; }
#table-urssaf td { text-align: right; white-space: nowrap; }
#table-urssaf td:first-child { text-align: left; font-weight: 500; }
#table-urssaf tfoot td { padding: 14px 20px; border-top: 2px solid var(--border-color); }

/* ── Synthèse CA par Client (Matrice) ────────────────────────── */
.synthesis-container {
    padding: 0;
    overflow-x: auto;
}
.synthesis-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    min-width: 800px;
}
.synthesis-table th, .synthesis-table td {
    padding: 8px 12px;
    text-align: right;
    border-bottom: 1px solid var(--border-color);
    border-right: 1px solid var(--border-color);
    font-size: 0.85rem;
}
.synthesis-table th {
    background: rgba(255, 255, 255, 0.02);
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    position: sticky;
    top: 0;
    z-index: 10;
}
.synthesis-table th:first-child, .synthesis-table td:first-child {
    text-align: left;
    position: sticky;
    left: 0;
    z-index: 11;
    background: var(--bg-base);
    border-right: 2px solid var(--border-color);
    min-width: 150px;
}
.synthesis-table td:first-child {
    font-weight: 500;
    color: var(--text-muted);
}
.synthesis-table .col-total, .synthesis-table .row-total {
    background: rgba(99, 102, 241, 0.03) !important;
    font-weight: 700;
}
.synthesis-table .col-total {
    border-left: 2px solid var(--border-color);
    color: var(--primary);
}
.synthesis-table .row-total td {
    border-top: 2px solid var(--border-color);
    color: var(--primary);
}
.synthesis-table .col-urssaf { color: #ef4444; opacity: 0.9; }
.synthesis-table .col-ca-reel { color: #22c55e; font-weight: 600; }
.synthesis-table tr:hover td {
    background: rgba(99, 102, 241, 0.08);
}
.synthesis-table td:hover {
    background: rgba(99, 102, 241, 0.15) !important;
    color: var(--primary);
}
.synthesis-table .val-vide {
    opacity: 0.2;
    font-weight: 300;
}

[data-theme="light"] .synthesis-table th { background: rgba(0, 0, 0, 0.02); }
[data-theme="light"] .synthesis-table th:first-child, [data-theme="light"] .synthesis-table td:first-child { background: #f8fafc; }

/* -- Zone de danger (v1.0) -- */
.danger-zone { border: 1px dashed var(--danger); background: rgba(239, 68, 68, 0.05); border-radius: var(--radius-lg); padding: 24px; text-align: center; }
.danger-zone h3 { display: flex; align-items: center; justify-content: center; gap: 10px; }
.btn-danger { background: var(--danger); color: white; border: none; padding: 12px 24px; border-radius: var(--radius-md); font-weight: 600; cursor: pointer; transition: var(--transition); box-shadow: 0 4px 12px rgba(239, 68, 68, 0.2); }
.btn-danger:hover { background: #dc2626; transform: translateY(-1px); box-shadow: 0 6px 16px rgba(239, 68, 68, 0.3); }
.btn-danger:disabled { background: #64748b; opacity: 0.5; cursor: not-allowed; transform: none; box-shadow: none; }

.modal-danger .modal-content { border-top-color: var(--danger); }
