/*
|--------------------------------------------------------------------------
| style.css — Design System complet du CRM ClientFlow
|--------------------------------------------------------------------------
|
| RÔLE : Ce fichier unique contient TOUS les styles CSS du CRM.
|        Il implémente la charte graphique définie dans brand-guidelines.md :
|        - Palette Indigo (#6366F1) comme couleur primaire
|        - Typographie Inter (Google Fonts)
|        - Badges colorés par statut
|        - Layout sidebar + contenu responsive
|
| ORGANISATION :
|   1. Variables CSS (Design Tokens)
|   2. Reset & Base
|   3. Layout (Sidebar + Content)
|   4. Topbar
|   5. Navigation (Sidebar)
|   6. Cartes & KPI
|   7. Tableaux
|   8. Formulaires & Inputs
|   9. Boutons
|  10. Badges & Statuts
|  11. Modals
|  12. Alertes & Toasts
|  13. Page Login
|  14. Composants spécifiques
|  15. Animations
|  16. Responsive (Mobile & Tablette)
|
*/

/* =============================================
   1. VARIABLES CSS — Design Tokens
   ============================================= */
:root {
    /* Couleurs primaires (Indigo) */
    --color-primary:        #6366F1;
    --color-primary-dark:   #4F46E5;
    --color-primary-light:  #EEF2FF;
    --color-primary-rgb:    99, 102, 241;

    /* Couleurs de statut client */
    --color-prospect:       #F59E0B;
    --color-actif:          #10B981;
    --color-termine:        #6B7280;
    --color-perdu:          #EF4444;

    /* Couleurs de statut facture */
    --color-facture-attente: #F59E0B;
    --color-facture-payee:   #10B981;
    --color-facture-annulee: #EF4444;

    /* Couleurs de priorité rappel */
    --color-priorite-haute:   #EF4444;
    --color-priorite-normale: #F59E0B;
    --color-priorite-basse:   #10B981;

    /* Neutres & surfaces */
    --color-bg:             #F8FAFC;
    --color-surface:        #FFFFFF;
    --color-border:         #E2E8F0;
    --color-text-primary:   #0F172A;
    --color-text-secondary: #64748B;
    --color-text-muted:     #94A3B8;

    /* Couleurs de feedback */
    --color-success:        #10B981;
    --color-warning:        #F59E0B;
    --color-danger:         #EF4444;
    --color-info:           #3B82F6;

    /* Typographie */
    --font-family:          'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --text-xs:              12px;
    --text-sm:              13px;
    --text-base:            15px;
    --text-lg:              17px;
    --text-xl:              20px;
    --text-2xl:             24px;
    --text-3xl:             30px;

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

    /* Rayons de bordure */
    --radius-sm:            8px;
    --radius-md:            12px;
    --radius-lg:            16px;
    --radius-full:          99px;

    /* Ombres */
    --shadow-sm:            0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md:            0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-lg:            0 4px 6px rgba(0, 0, 0, 0.07), 0 2px 4px rgba(0, 0, 0, 0.04);
    --shadow-xl:            0 10px 25px rgba(0, 0, 0, 0.1);

    /* Layout */
    --sidebar-width:        240px;
    --sidebar-collapsed:    64px;
    --topbar-height:        64px;

    /* Transitions */
    --transition-fast:      0.15s ease;
    --transition-base:      0.2s ease;
    --transition-slow:      0.3s ease;
}

/* =============================================
   2. RESET & BASE
   ============================================= */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: var(--text-base);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-family);
    background-color: var(--color-bg);
    color: var(--color-text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

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

a:hover {
    color: var(--color-primary-dark);
}

img {
    max-width: 100%;
    height: auto;
}

/* =============================================
   3. LAYOUT — Sidebar + Contenu
   ============================================= */

/* Sidebar fixe à gauche */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--color-surface);
    border-right: 1px solid var(--color-border);
    display: flex;
    flex-direction: column;
    z-index: 100;
    transition: transform var(--transition-slow);
    overflow-y: auto;
}

/* Zone du logo en haut de la sidebar */
.sidebar-logo {
    padding: var(--spacing-lg) var(--spacing-md);
    border-bottom: 1px solid var(--color-border);
}

.logo {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.logo-text {
    font-weight: 600;
    font-size: 16px;
    color: var(--color-text-primary);
}

/* Navigation dans la sidebar */
.sidebar-nav {
    flex: 1;
    padding: var(--spacing-md);
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
}

/* Pied de la sidebar (déconnexion) */
.sidebar-footer {
    padding: var(--spacing-md);
    border-top: 1px solid var(--color-border);
}

/* Zone de contenu principale (à droite de la sidebar) */
.main-wrapper {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.content {
    flex: 1;
    padding: var(--spacing-lg);
    max-width: 1400px;
    width: 100%;
}

/* Overlay mobile (fond sombre quand sidebar ouverte) */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 99;
    opacity: 0;
    transition: opacity var(--transition-slow);
}

.sidebar-overlay.active {
    display: block;
    opacity: 1;
}

/* =============================================
   4. TOPBAR — Barre supérieure
   ============================================= */
.topbar {
    height: var(--topbar-height);
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
    display: flex;
    align-items: center;
    padding: 0 var(--spacing-lg);
    gap: var(--spacing-md);
    position: sticky;
    top: 0;
    z-index: 50;
}

.topbar-title {
    font-size: var(--text-xl);
    font-weight: 600;
    color: var(--color-text-primary);
    flex: 1;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

/* Bouton burger (masqué sur desktop) */
.burger-btn {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: var(--spacing-sm);
    border-radius: var(--radius-sm);
    color: var(--color-text-secondary);
    transition: background var(--transition-fast);
}

.burger-btn:hover {
    background: var(--color-bg);
}

.burger-btn svg {
    width: 24px;
    height: 24px;
}

/* Info utilisateur dans la topbar */
.user-info {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-full);
    background: var(--color-primary-light);
    color: var(--color-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: var(--text-sm);
}

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

/* =============================================
   5. NAVIGATION — Liens sidebar
   ============================================= */
.nav-link {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    color: var(--color-text-secondary);
    font-weight: 500;
    font-size: var(--text-sm);
    transition: all var(--transition-fast);
    position: relative;
}

.nav-link:hover {
    background: var(--color-bg);
    color: var(--color-text-primary);
}

/* Lien actif dans la sidebar */
.nav-link.active {
    background: var(--color-primary-light);
    color: var(--color-primary);
}

.nav-link.active .nav-icon {
    color: var(--color-primary);
}

/* Icônes de navigation (SVG) */
.nav-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

/* Label de navigation (masqué quand sidebar réduite) */
.nav-label {
    white-space: nowrap;
    overflow: hidden;
}

/* Badge sur le lien Rappels */
.nav-badge {
    background: var(--color-danger);
    color: white;
    font-size: 11px;
    font-weight: 600;
    padding: 1px 6px;
    border-radius: var(--radius-full);
    margin-left: auto;
    min-width: 20px;
    text-align: center;
}

/* Style spécial pour le lien déconnexion */
.nav-link-logout {
    color: var(--color-text-muted);
}

.nav-link-logout:hover {
    color: var(--color-danger);
    background: #FEF2F2;
}

/* =============================================
   6. CARTES & KPI
   ============================================= */
.card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 20px 24px;
    box-shadow: var(--shadow-md);
    transition: box-shadow var(--transition-base);
}

.card:hover {
    box-shadow: var(--shadow-lg);
}

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

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

.card-subtitle {
    font-size: var(--text-sm);
    color: var(--color-text-secondary);
}

/* Grille de KPI (4 cartes en ligne) */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
}

/* Carte KPI individuelle */
.kpi-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 20px 24px;
    box-shadow: var(--shadow-md);
    transition: all var(--transition-base);
}

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

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

.kpi-label {
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--color-text-secondary);
}

.kpi-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
}

.kpi-icon svg {
    width: 20px;
    height: 20px;
}

.kpi-icon.revenue    { background: #EEF2FF; color: var(--color-primary); }
.kpi-icon.clients    { background: #ECFDF5; color: var(--color-actif); }
.kpi-icon.factures   { background: #FFFBEB; color: var(--color-facture-attente); }
.kpi-icon.rappels    { background: #FEF2F2; color: var(--color-danger); }

.kpi-value {
    font-size: var(--text-3xl);
    font-weight: 700;
    color: var(--color-text-primary);
    line-height: 1.2;
}

.kpi-change {
    font-size: var(--text-xs);
    font-weight: 500;
    margin-top: var(--spacing-xs);
}

.kpi-change.positive { color: var(--color-success); }
.kpi-change.negative { color: var(--color-danger); }

/* Grille du dashboard (graphique + listes) */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-lg);
    margin-top: var(--spacing-lg);
}

.dashboard-full {
    grid-column: 1 / -1;
}

/* =============================================
   7. TABLEAUX
   ============================================= */
.table-container {
    overflow-x: auto;
    border-radius: var(--radius-md);
    border: 1px solid var(--color-border);
    background: var(--color-surface);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table thead {
    background: var(--color-bg);
}

.data-table th {
    padding: 12px 16px;
    text-align: left;
    font-size: var(--text-xs);
    font-weight: 600;
    color: var(--color-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--color-border);
    white-space: nowrap;
}

.data-table td {
    padding: 12px 16px;
    font-size: var(--text-sm);
    color: var(--color-text-primary);
    border-bottom: 1px solid var(--color-border);
    vertical-align: middle;
}

/* Alternance de couleur sur les lignes */
.data-table tbody tr:nth-child(even) {
    background: #FAFAFA;
}

/* Effet de survol sur les lignes */
.data-table tbody tr {
    transition: background var(--transition-fast);
}

.data-table tbody tr:hover {
    background: var(--color-primary-light);
}

/* Actions au survol de la ligne */
.row-actions {
    display: flex;
    gap: var(--spacing-sm);
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.data-table tbody tr:hover .row-actions {
    opacity: 1;
}

/* Boutons d'action dans les lignes de tableau */
.action-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    border-radius: var(--radius-sm);
    color: var(--color-text-muted);
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
}

.action-btn:hover {
    color: var(--color-primary);
    background: var(--color-primary-light);
}

.action-btn.delete:hover {
    color: var(--color-danger);
    background: #FEF2F2;
}

.action-btn svg {
    width: 16px;
    height: 16px;
}

/* Barre de filtres au-dessus du tableau */
.table-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--spacing-md);
    gap: var(--spacing-md);
    flex-wrap: wrap;
}

.table-filters {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    flex-wrap: wrap;
}

/* Champ de recherche */
.search-input {
    position: relative;
}

.search-input input {
    padding-left: 36px;
    width: 280px;
    max-width: 100%;
}

.search-input svg {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    color: var(--color-text-muted);
}

/* =============================================
   8. FORMULAIRES & INPUTS
   ============================================= */
.form-group {
    margin-bottom: var(--spacing-md);
    flex: 1;
}

.form-group label {
    display: block;
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--color-text-secondary);
    margin-bottom: var(--spacing-xs);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    font-family: var(--font-family);
    font-size: var(--text-sm);
    color: var(--color-text-primary);
    background: var(--color-surface);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
    outline: none;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(var(--color-primary-rgb), 0.1);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--color-text-muted);
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

/* Ligne de formulaire avec 2 champs côte à côte */
.form-row {
    display: flex;
    gap: var(--spacing-md);
}

.form-row .form-group {
    flex: 1;
}

/* =============================================
   9. BOUTONS
   ============================================= */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-family: var(--font-family);
    font-weight: 600;
    font-size: 14px;
    border: none;
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
    text-decoration: none;
}

/* Bouton primaire (Indigo) */
.btn-primary {
    background: var(--color-primary);
    color: white;
}

.btn-primary:hover {
    background: var(--color-primary-dark);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(var(--color-primary-rgb), 0.4);
}

/* Bouton secondaire (bordure) */
.btn-secondary {
    background: var(--color-surface);
    color: var(--color-text-secondary);
    border: 1px solid var(--color-border);
}

.btn-secondary:hover {
    background: var(--color-bg);
    color: var(--color-text-primary);
}

/* Bouton danger (rouge) */
.btn-danger {
    background: var(--color-danger);
    color: white;
}

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

/* Bouton succès (vert) */
.btn-success {
    background: var(--color-success);
    color: white;
}

.btn-success:hover {
    background: #059669;
    color: white;
}

/* Bouton pleine largeur */
.btn-block {
    width: 100%;
}

/* Bouton petit */
.btn-sm {
    padding: 4px 10px;
    font-size: var(--text-xs);
}

/* =============================================
   10. BADGES & STATUTS
   ============================================= */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 10px;
    border-radius: var(--radius-full);
    font-size: var(--text-xs);
    font-weight: 500;
    white-space: nowrap;
}

/* Badges de statut client */
.badge-prospect {
    background: #FFFBEB;
    color: #D97706;
}

.badge-actif {
    background: #ECFDF5;
    color: #059669;
}

.badge-termine {
    background: #F3F4F6;
    color: #4B5563;
}

.badge-perdu {
    background: #FEF2F2;
    color: #DC2626;
}

/* Badges de statut facture */
.badge-en_attente {
    background: #FFFBEB;
    color: #D97706;
}

.badge-payee {
    background: #ECFDF5;
    color: #059669;
}

.badge-annulee {
    background: #FEF2F2;
    color: #DC2626;
}

/* Badges de priorité rappel */
.badge-haute {
    background: #FEF2F2;
    color: #DC2626;
}

.badge-normale {
    background: #FFFBEB;
    color: #D97706;
}

.badge-basse {
    background: #ECFDF5;
    color: #059669;
}

/* Badge de type d'interaction */
.badge-appel   { background: #EEF2FF; color: var(--color-primary); }
.badge-email   { background: #F0FDF4; color: #16A34A; }
.badge-reunion { background: #FFF7ED; color: #EA580C; }
.badge-note    { background: #F8FAFC; color: var(--color-text-secondary); }

/* Bouton de statut cliquable (changement en 1 clic) */
.status-btn {
    cursor: pointer;
    border: none;
    background: none;
    padding: 0;
    transition: transform var(--transition-fast);
}

.status-btn:hover {
    transform: scale(1.1);
}

/* =============================================
   11. MODALS
   ============================================= */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 200;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity var(--transition-base);
}

.modal-overlay.active {
    display: flex;
    opacity: 1;
}

.modal {
    background: var(--color-surface);
    border-radius: var(--radius-md);
    width: 100%;
    max-width: 560px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-xl);
    animation: modalSlideIn var(--transition-slow) ease;
}

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

.modal-header h2 {
    font-size: var(--text-lg);
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--color-text-muted);
    padding: 4px;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
    line-height: 1;
}

.modal-close:hover {
    background: var(--color-bg);
    color: var(--color-text-primary);
}

.modal-body {
    padding: 20px 24px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: var(--spacing-sm);
    padding: 16px 24px;
    border-top: 1px solid var(--color-border);
}

/* =============================================
   12. ALERTES & TOASTS
   ============================================= */
.alert {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-size: var(--text-sm);
    font-weight: 500;
    margin-bottom: var(--spacing-md);
}

.alert-error {
    background: #FEF2F2;
    color: #DC2626;
    border: 1px solid #FECACA;
}

.alert-success {
    background: #ECFDF5;
    color: #059669;
    border: 1px solid #A7F3D0;
}

.alert-warning {
    background: #FFFBEB;
    color: #D97706;
    border: 1px solid #FDE68A;
}

.alert-info {
    background: #EFF6FF;
    color: #2563EB;
    border: 1px solid #BFDBFE;
}

/* Conteneur de toasts (notifications flottantes) */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 300;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.toast {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    font-size: var(--text-sm);
    font-weight: 500;
    min-width: 280px;
    max-width: 400px;
    animation: toastSlideIn var(--transition-slow) ease;
}

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

.toast-close {
    margin-left: auto;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--color-text-muted);
    font-size: 18px;
    padding: 0 4px;
}

/* =============================================
   13. PAGE LOGIN
   ============================================= */
.login-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #EEF2FF 0%, #F8FAFC 50%, #EEF2FF 100%);
}

.login-container {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: var(--spacing-xl);
    width: 100%;
    max-width: 400px;
    box-shadow: var(--shadow-lg);
}

.login-header {
    text-align: center;
    margin-bottom: var(--spacing-lg);
}

.login-header .logo {
    justify-content: center;
    margin-bottom: var(--spacing-sm);
}

.login-subtitle {
    font-size: var(--text-sm);
    color: var(--color-text-secondary);
    margin-top: var(--spacing-sm);
}

.login-form .form-group {
    margin-bottom: var(--spacing-md);
}

.login-form .btn {
    margin-top: var(--spacing-sm);
}

.login-demo-info {
    margin-top: var(--spacing-lg);
    padding: var(--spacing-md);
    background: var(--color-bg);
    border-radius: var(--radius-sm);
    font-size: var(--text-xs);
    color: var(--color-text-secondary);
    text-align: center;
}

.login-demo-info code {
    background: var(--color-surface);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    color: var(--color-primary);
    border: 1px solid var(--color-border);
}

/* =============================================
   14. COMPOSANTS SPÉCIFIQUES
   ============================================= */

/* Timeline d'interactions (fiche client) */
.timeline {
    position: relative;
    padding-left: 28px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 8px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--color-border);
}

.timeline-item {
    position: relative;
    padding-bottom: var(--spacing-lg);
}

.timeline-item:last-child {
    padding-bottom: 0;
}

.timeline-dot {
    position: absolute;
    left: -24px;
    top: 4px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid var(--color-primary);
    background: var(--color-surface);
}

.timeline-dot.appel   { border-color: var(--color-primary); }
.timeline-dot.email   { border-color: #16A34A; }
.timeline-dot.reunion { border-color: #EA580C; }
.timeline-dot.note    { border-color: var(--color-text-muted); }

.timeline-date {
    font-size: var(--text-xs);
    color: var(--color-text-muted);
    margin-bottom: var(--spacing-xs);
}

.timeline-content {
    background: var(--color-bg);
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--color-border);
}

.timeline-content p {
    font-size: var(--text-sm);
    color: var(--color-text-primary);
}

/* Fiche client — Section d'infos */
.client-info-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-md);
}

.info-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.info-label {
    font-size: var(--text-xs);
    font-weight: 500;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.info-value {
    font-size: var(--text-sm);
    color: var(--color-text-primary);
    font-weight: 500;
}

/* Section vide (quand pas de données) */
.empty-state {
    text-align: center;
    padding: var(--spacing-2xl) var(--spacing-lg);
    color: var(--color-text-muted);
}

.empty-state svg {
    width: 48px;
    height: 48px;
    margin-bottom: var(--spacing-md);
    opacity: 0.5;
}

.empty-state p {
    font-size: var(--text-sm);
}

/* Rappel alerte visuelle (fond coloré quand le rappel est dû) */
.rappel-urgent {
    border-left: 4px solid var(--color-danger) !important;
    background: #FEF2F2 !important;
}

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

/* Liste des rappels / factures en attente dans le dashboard */
.list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid var(--color-border);
    gap: var(--spacing-md);
}

.list-item:last-child {
    border-bottom: none;
}

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

.list-item-title {
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--color-text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.list-item-subtitle {
    font-size: var(--text-xs);
    color: var(--color-text-muted);
}

.list-item-value {
    font-weight: 600;
    font-size: var(--text-sm);
    white-space: nowrap;
}

/* Export page — sélection */
.export-options {
    display: flex;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
    flex-wrap: wrap;
}

.export-card {
    flex: 1;
    min-width: 200px;
    padding: var(--spacing-lg);
    background: var(--color-surface);
    border: 2px solid var(--color-border);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-base);
    text-align: center;
}

.export-card:hover,
.export-card.selected {
    border-color: var(--color-primary);
    background: var(--color-primary-light);
}

.export-card h3 {
    font-size: var(--text-lg);
    margin-bottom: var(--spacing-xs);
}

.export-card p {
    font-size: var(--text-sm);
    color: var(--color-text-secondary);
}

/* Pagination */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-xs);
    margin-top: var(--spacing-lg);
}

.page-btn {
    padding: 6px 12px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    background: var(--color-surface);
    color: var(--color-text-secondary);
    font-size: var(--text-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.page-btn:hover {
    background: var(--color-bg);
    color: var(--color-text-primary);
}

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

/* Section de page avec titre + action */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--spacing-lg);
    flex-wrap: wrap;
    gap: var(--spacing-md);
}

/* Détails tabs (client-detail) */
.tabs {
    display: flex;
    border-bottom: 2px solid var(--color-border);
    margin-bottom: var(--spacing-lg);
    gap: 0;
}

.tab {
    padding: 10px 20px;
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--color-text-secondary);
    border: none;
    background: none;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all var(--transition-fast);
}

.tab:hover {
    color: var(--color-text-primary);
}

.tab.active {
    color: var(--color-primary);
    border-bottom-color: var(--color-primary);
}

.tab-content {
    display: none;
}

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

/* Montant en monnaie */
.money {
    font-variant-numeric: tabular-nums;
}

.money-positive { color: var(--color-success); }
.money-negative { color: var(--color-danger); }

/* Filter chip / pill */
.filter-pill {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: var(--radius-full);
    font-size: var(--text-xs);
    font-weight: 500;
    border: 1px solid var(--color-border);
    background: var(--color-surface);
    color: var(--color-text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.filter-pill:hover,
.filter-pill.active {
    border-color: var(--color-primary);
    background: var(--color-primary-light);
    color: var(--color-primary);
}

/* Graphique container */
.chart-container {
    position: relative;
    width: 100%;
    height: 300px;
}

/* =============================================
   15. ANIMATIONS
   ============================================= */
@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes toastSlideIn {
    from {
        opacity: 0;
        transform: translateX(100px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes toastSlideOut {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(100px);
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

/* Classe utilitaire pour les skeleton loaders */
.skeleton {
    background: linear-gradient(90deg, #F1F5F9 25%, #E2E8F0 50%, #F1F5F9 75%);
    background-size: 200% 100%;
    animation: pulse 1.5s ease-in-out infinite;
    border-radius: var(--radius-sm);
}

/* =============================================
   16. RESPONSIVE — Mobile & Tablette
   ============================================= */

/* Tablette (640px — 1024px) : sidebar réduite à icônes */
@media (max-width: 1024px) {
    .sidebar {
        width: var(--sidebar-collapsed);
    }

    .sidebar-logo {
        padding: var(--spacing-md) var(--spacing-sm);
        display: flex;
        justify-content: center;
    }

    .logo-text,
    .nav-label,
    .sidebar-footer .nav-label {
        display: none;
    }

    .nav-link {
        justify-content: center;
        padding: 10px;
    }

    .nav-badge {
        position: absolute;
        top: 2px;
        right: 2px;
        margin-left: 0;
        font-size: 10px;
        padding: 0 4px;
        min-width: 16px;
    }

    .main-wrapper {
        margin-left: var(--sidebar-collapsed);
    }

    .kpi-grid {
        grid-template-columns: repeat(2, 1fr);
    }

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

    .user-name {
        display: none;
    }

    .btn-label {
        display: none;
    }

    .form-row {
        flex-direction: column;
        gap: 0;
    }

    .client-info-grid {
        grid-template-columns: 1fr;
    }
}

/* Mobile (< 640px) : sidebar masquée, menu burger */
@media (max-width: 640px) {
    .sidebar {
        width: var(--sidebar-width);
        transform: translateX(-100%);
    }

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

    .sidebar.open ~ .sidebar-overlay {
        display: block;
        opacity: 1;
    }

    /* Rétablir les labels sur mobile quand sidebar ouverte */
    .sidebar.open .logo-text,
    .sidebar.open .nav-label,
    .sidebar.open .sidebar-footer .nav-label {
        display: inline;
    }

    .sidebar.open .nav-link {
        justify-content: flex-start;
        padding: 10px 12px;
    }

    .sidebar.open .sidebar-logo {
        justify-content: flex-start;
        padding: var(--spacing-lg) var(--spacing-md);
    }

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

    .burger-btn {
        display: flex;
    }

    .topbar-title {
        font-size: var(--text-lg);
    }

    .content {
        padding: var(--spacing-md);
    }

    .kpi-grid {
        grid-template-columns: 1fr 1fr;
        gap: var(--spacing-sm);
    }

    .kpi-value {
        font-size: var(--text-2xl);
    }

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

    .table-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .search-input input {
        width: 100%;
    }

    .modal {
        margin: var(--spacing-md);
        max-height: calc(100vh - 32px);
    }

    .tabs {
        overflow-x: auto;
    }

    .pagination {
        flex-wrap: wrap;
    }

    .export-options {
        flex-direction: column;
    }
}

/* Très petit écran (< 400px) */
@media (max-width: 400px) {
    .kpi-grid {
        grid-template-columns: 1fr;
    }

    .topbar-actions .btn {
        padding: 6px 10px;
    }
}
