/* ==================== VARIABLES CSS - THÈME LUXE ==================== */
:root {
    /* Palette Luxe - Thème Clair */
    --primary-color: #2C3445;        /* Bleu nuit profond (titres, CTA) */
    --primary-dark: #1a1f2e;
    --primary-light: #395B9C;        /* Bleu cobalt */
    --accent-gold: #D4AF37;          /* Or mat discret (accents) */
    --secondary-color: #395B9C;      /* Bleu cobalt */
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;

    /* Backgrounds Clair */
    --bg-primary: #F8F7F5;           /* Blanc cassé neutre */
    --bg-secondary: #ECD9B0;         /* Beige doré élégant */
    --bg-tertiary: #C9C6C0;          /* Gris chaud subtil */
    --card-bg: #F8F7F5;
    --navbar-bg: #F8F7F5;

    /* Texte Clair */
    --text-primary: #282828;         /* Noir charbon (texte principal) */
    --text-secondary: #2C3445;       /* Bleu nuit profond */
    --text-tertiary: #A49C87;        /* Taupe doux */

    /* Bordures & Séparateurs */
    --border-color: #A49C87;         /* Taupe doux */
    --border-focus: #D4AF37;         /* Or mat */

    /* Ombres Premium */
    --shadow-sm: 0 1px 2px 0 rgba(44, 52, 69, 0.04);
    --shadow-md: 0 4px 6px -1px rgba(44, 52, 69, 0.08), 0 2px 4px -1px rgba(44, 52, 69, 0.05);
    --shadow-lg: 0 10px 15px -3px rgba(44, 52, 69, 0.12), 0 4px 6px -2px rgba(44, 52, 69, 0.06);
    --shadow-xl: 0 20px 25px -5px rgba(44, 52, 69, 0.15), 0 10px 10px -5px rgba(44, 52, 69, 0.08);

    /* Radius */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
}

/* ==================== MODE SOMBRE LUXE ==================== */
[data-theme="dark"] {
    /* Palette Luxe - Thème Sombre */
    --primary-color: #395B9C;        /* Bleu cobalt (éléments interactifs) */
    --primary-dark: #2a4576;
    --primary-light: #4d6fb3;
    --accent-gold: #B7964C;          /* Or mat (accents, icônes) */
    --secondary-color: #395B9C;

    /* Backgrounds Sombre */
    --bg-primary: #222734;           /* Bleu nuit chic (fond principal) */
    --bg-secondary: #141416;         /* Noir mat profond */
    --bg-tertiary: #414449;          /* Gris anthracite (zones secondaires) */
    --card-bg: #222734;
    --navbar-bg: #222734;

    /* Texte Sombre */
    --text-primary: #ECEBE9;         /* Blanc cassé (texte, contrastes) */
    --text-secondary: #C9C6C0;       /* Gris chaud subtil */
    --text-tertiary: #7A7364;        /* Taupe foncé */

    /* Bordures Sombre */
    --border-color: #414449;         /* Gris anthracite */
    --border-focus: #B7964C;         /* Or mat */

    /* Couleurs ajustées pour le mode sombre */
    --success-color: #34d399;
    --danger-color: #f87171;
    --warning-color: #fbbf24;

    /* Ombres Sombre - plus subtiles avec le fond sombre */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.4);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.5), 0 2px 4px -1px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.6), 0 4px 6px -2px rgba(0, 0, 0, 0.4);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.7), 0 10px 10px -5px rgba(0, 0, 0, 0.5);
}

/* ==================== RESET & BASE ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    line-height: 1.6;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* ==================== NAVIGATION ==================== */
.navbar {
    background: var(--navbar-bg);
    box-shadow: var(--shadow-md);
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid var(--border-color);
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.nav-container {
    max-width: 100%;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
    gap: 1rem;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.1rem;
    font-weight: 700;
    color: white;
    flex-shrink: 0;
    white-space: nowrap;
    min-width: fit-content;
}

.nav-brand i {
    font-size: 1.5rem;
    color: var(--primary-light);
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 0.15rem;
    flex: 1;
    justify-content: center;
    min-width: 0;
    overflow: visible;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.5rem 0.5rem;
    color: #cbd5e1;
    text-decoration: none;
    border-radius: var(--radius-md);
    transition: all 0.2s;
    position: relative;
    white-space: nowrap;
    font-size: 0.875rem;
    min-width: fit-content;
}

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

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

.badge {
    background: var(--danger-color);
    color: white;
    font-size: 0.75rem;
    padding: 0.125rem 0.5rem;
    border-radius: 999px;
    font-weight: 600;
    min-width: 1.25rem;
    text-align: center;
}

.nav-user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: white;
    flex-shrink: 0;
    min-width: fit-content;
}

.user-email {
    font-size: 0.875rem;
    color: #cbd5e1;
}

/* Adaptation de la navbar pour le thème clair */
:root .nav-brand,
:root .nav-link,
:root .user-email {
    color: var(--text-primary);
}

:root .nav-brand i {
    color: var(--primary-color);
}

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

/* Mode sombre - garder les couleurs claires */
[data-theme="dark"] .nav-brand,
[data-theme="dark"] .nav-link,
[data-theme="dark"] .user-email {
    color: #cbd5e1;
}

[data-theme="dark"] .nav-brand i {
    color: var(--primary-light);
}

[data-theme="dark"] .nav-link:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

/* Cacher le menu burger sur desktop */
.nav-toggle {
    display: none;
}

.btn-logout {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #fca5a5;
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s;
}

.btn-logout:hover {
    background: var(--danger-color);
    color: white;
}

/* Bouton toggle thème (dark mode) */
.btn-theme-toggle {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.5rem 0.75rem;
    font-size: 1rem;
    border-radius: var(--radius-md);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
}

.btn-theme-toggle:hover {
    background: var(--bg-secondary);
    color: var(--primary-color);
    transform: scale(1.05);
    border-color: var(--primary-light);
}

.btn-theme-toggle:active {
    transform: scale(0.95);
}

/* Animation de l'icône du thème */
#theme-icon {
    transition: transform 0.3s ease;
}

.btn-theme-toggle:hover #theme-icon {
    transform: rotate(15deg);
}

/* ==================== MAIN CONTENT ==================== */
.main-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
    min-height: calc(100vh - 128px);
}

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

.page-header h1 {
    font-size: 1.875rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.page-header h1 i {
    color: var(--primary-color);
}

/* ==================== CARDS ==================== */
.card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: 1.5rem;
    transition: all 0.2s;
}

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

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.card-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.card-title i {
    color: var(--primary-color);
}

/* ==================== STATS CARDS ==================== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: linear-gradient(135deg, var(--card-bg) 0%, #f1f5f9 100%);
    border-radius: var(--radius-lg);
    padding: 1rem;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s;
    border: 1px solid var(--border-color);
}

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

.stat-card.primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
}

.stat-card.success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
}

.stat-card.warning {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
}

.stat-card.danger {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
}

/* Amélioration de la lisibilité des stat-cards */
.stat-card.primary .stat-label,
.stat-card.primary .stat-value,
.stat-card.success .stat-label,
.stat-card.success .stat-value,
.stat-card.warning .stat-label,
.stat-card.warning .stat-value,
.stat-card.danger .stat-label,
.stat-card.danger .stat-value {
    color: white;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    font-weight: 700;
}

.stat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.stat-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.125rem;
    background: rgba(255, 255, 255, 0.2);
}

.stat-card:not(.primary):not(.success):not(.warning):not(.danger) .stat-icon {
    background: var(--primary-color);
    color: white;
}

.stat-label {
    font-size: 0.8125rem;
    font-weight: 500;
    opacity: 0.9;
    margin-bottom: 0.25rem;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.stat-trend {
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    opacity: 0.9;
}

/* ==================== TABLE ==================== */
.table-container {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

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

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

.table th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.table tbody tr {
    border-bottom: 1px solid var(--border-color);
    transition: all 0.2s;
}

.table tbody tr:hover {
    background: var(--light-bg);
}

.table td {
    padding: 1rem;
    font-size: 0.875rem;
    color: var(--text-primary);
}

/* Amélioration du contraste pour les tableaux en mode sombre */
[data-theme="dark"] .table thead {
    background: var(--bg-tertiary);
}

[data-theme="dark"] .table th {
    color: var(--text-secondary);
}

[data-theme="dark"] .table td {
    color: var(--text-primary);
}

[data-theme="dark"] .table tbody tr:hover {
    background: var(--bg-tertiary);
}

/* Boîte d'information */
.info-box {
    margin-top: 1rem;
    padding: 1rem;
    background: #dbeafe;
    color: #1e40af;
    border-radius: var(--radius-md);
    border-left: 4px solid #3b82f6;
}

[data-theme="dark"] .info-box {
    background: #1e3a8a;
    color: #bfdbfe;
    border-left-color: #60a5fa;
}

/* ==================== BUTTONS ==================== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 500;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

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

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-secondary {
    background: var(--text-secondary);
    color: white;
}

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

.btn-success {
    background: var(--secondary-color);
    color: white;
}

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

.btn-danger {
    background: var(--danger-color);
    color: white;
}

.btn-danger:hover {
    background: #dc2626;
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

.btn-outline:hover {
    background: var(--light-bg);
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.8125rem;
}

/* ==================== BADGES ==================== */
.status-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-nouveau {
    background: #dbeafe;
    color: #1e40af;
}

.status-contacte {
    background: #e0e7ff;
    color: #4338ca;
}

.status-relance_j7 {
    background: #fef3c7;
    color: #92400e;
}

.status-relance_j14 {
    background: #fed7aa;
    color: #9a3412;
}

.status-signe {
    background: #d1fae5;
    color: #065f46;
}

.status-perdu {
    background: #fee2e2;
    color: #991b1b;
}

/* Badges de statut en mode sombre - meilleur contraste */
[data-theme="dark"] .status-nouveau {
    background: #1e3a8a;
    color: #bfdbfe;
}

[data-theme="dark"] .status-contacte {
    background: #4338ca;
    color: #c7d2fe;
}

[data-theme="dark"] .status-relance_j7 {
    background: #92400e;
    color: #fde68a;
}

[data-theme="dark"] .status-relance_j14 {
    background: #9a3412;
    color: #fed7aa;
}

[data-theme="dark"] .status-signe {
    background: #065f46;
    color: #a7f3d0;
}

[data-theme="dark"] .status-perdu {
    background: #991b1b;
    color: #fecaca;
}

/* ==================== FORMS ==================== */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 0.625rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    transition: all 0.2s;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

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

/* ==================== SEARCH & FILTERS ==================== */
.search-filters {
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-sm);
}

.search-bar {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.search-input {
    flex: 1;
    position: relative;
}

.search-input input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 2.5rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 0.875rem;
}

.search-input i {
    position: absolute;
    left: 0.875rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
}

.filters-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

/* ==================== PAGINATION ==================== */
.pagination {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 2rem;
}

.pagination button {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color);
    background: var(--card-bg);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s;
}

.pagination button:hover {
    background: var(--light-bg);
}

.pagination button.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* ==================== MODAL ==================== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
}

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

.modal-title {
    font-size: 1.25rem;
    font-weight: 700;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-secondary);
}

.modal-body {
    padding: 1.5rem;
}

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

/* ==================== ALERTS ==================== */
.flash-messages {
    position: fixed;
    top: 80px;
    right: 2rem;
    z-index: 1500;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-width: 400px;
}

.alert {
    padding: 1rem 1.5rem;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    animation: slideIn 0.3s ease-out;
}

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

.alert-success {
    background: #d1fae5;
    color: #065f46;
    border-left: 4px solid #10b981;
}

.alert-error {
    background: #fee2e2;
    color: #991b1b;
    border-left: 4px solid #ef4444;
}

.alert-warning {
    background: #fef3c7;
    color: #92400e;
    border-left: 4px solid #f59e0b;
}

.alert-info {
    background: #dbeafe;
    color: #1e40af;
    border-left: 4px solid #3b82f6;
}

.close-btn {
    background: none;
    border: none;
    font-size: 1.25rem;
    cursor: pointer;
    margin-left: auto;
    opacity: 0.5;
}

.close-btn:hover {
    opacity: 1;
}

/* ==================== FOOTER ==================== */
.footer {
    background: var(--dark-bg);
    color: #cbd5e1;
    text-align: center;
    padding: 1.5rem;
    font-size: 0.875rem;
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 768px) {
    .nav-menu {
        display: none;
    }

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

    .main-content {
        padding: 1rem;
    }

    .search-bar {
        flex-direction: column;
    }

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

/* ==================== UTILITIES ==================== */
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }

.text-center { text-align: center; }
.text-right { text-align: right; }

.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }

/* ==================== FLOATING ACTION BUTTON ==================== */
.fab {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
    border: none;
    border-radius: 50%;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.4);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    transition: all 0.3s ease;
    z-index: 999;
}

.fab:hover {
    transform: scale(1.1) rotate(10deg);
    box-shadow: 0 6px 20px rgba(245, 158, 11, 0.6);
}

.fab:active {
    transform: scale(0.95);
}

.fab i {
    animation: pulse 2s ease-in-out infinite;
}

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

/* Tooltip du bouton flottant */
.fab-tooltip {
    position: fixed;
    bottom: 2.5rem;
    right: 6rem;
    background: var(--dark-bg);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 998;
}

.fab:hover + .fab-tooltip {
    opacity: 1;
}

/* ==================== RESPONSIVE DESIGN ==================== */

/* Tablettes (max 1024px) */
@media (max-width: 1024px) {
    .nav-container {
        padding: 0 1rem;
    }

    .nav-menu {
        gap: 0.25rem;
    }

    .nav-link {
        padding: 0.5rem 0.75rem;
        font-size: 0.9rem;
    }

    .main-content {
        padding: 1.5rem 1rem;
    }

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

    .pipeline-container {
        gap: 0.75rem;
    }

    .pipeline-column {
        flex: 0 0 260px;
    }
}

/* Mobile (max 768px) */
@media (max-width: 768px) {
    /* Navigation mobile */
    .nav-container {
        flex-wrap: wrap;
        height: auto;
        padding: 0.75rem 1rem;
    }

    .nav-brand {
        font-size: 1.1rem;
        gap: 0.5rem;
    }

    .nav-brand i {
        font-size: 1.3rem;
    }

    .nav-menu {
        width: 100%;
        flex-direction: column;
        gap: 0.25rem;
        margin-top: 0.75rem;
        display: none;
    }

    .nav-menu.active {
        display: flex;
    }

    .nav-link {
        width: 100%;
        padding: 0.75rem 1rem;
        justify-content: flex-start;
    }

    .nav-user {
        order: -1;
        margin-left: auto;
    }

    .user-email {
        display: none;
    }

    /* Menu hamburger */
    .nav-toggle {
        display: block;
        order: 2;
        background: none;
        border: none;
        color: var(--text-primary);
        font-size: 1.5rem;
        cursor: pointer;
        padding: 0.5rem;
    }

    [data-theme="dark"] .nav-toggle {
        color: white;
    }

    /* Contenu principal */
    .main-content {
        padding: 1rem 0.75rem;
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .page-header h1 {
        font-size: 1.5rem;
    }

    /* Statistiques */
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .stat-card {
        padding: 1.25rem;
    }

    .stat-value {
        font-size: 1.75rem;
    }

    /* Cards */
    .card {
        padding: 1rem;
        margin-bottom: 1rem;
    }

    .card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    /* Formulaires */
    .form-row {
        flex-direction: column;
    }

    .form-group {
        margin-bottom: 1rem;
    }

    .btn {
        width: 100%;
        justify-content: center;
    }

    /* Tables */
    .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    table {
        font-size: 0.85rem;
    }

    th, td {
        padding: 0.5rem;
        white-space: nowrap;
    }

    /* Modals */
    .modal-content {
        margin: 1rem;
        max-width: calc(100% - 2rem);
        max-height: calc(100vh - 2rem);
        overflow-y: auto;
    }

    .modal-header {
        padding: 1rem;
    }

    .modal-body {
        padding: 1rem;
    }

    .modal-footer {
        padding: 1rem;
        flex-direction: column;
        gap: 0.75rem;
    }

    .modal-footer .btn {
        width: 100%;
    }

    /* Pipeline */
    .pipeline-container {
        flex-direction: column;
        gap: 1rem;
    }

    .pipeline-column {
        flex: 1;
        min-width: 100%;
    }

    /* Bouton flottant */
    .fab {
        bottom: 1.5rem;
        right: 1.5rem;
        width: 56px;
        height: 56px;
    }

    .fab-tooltip {
        display: none;
    }

    /* Grilles à 2 colonnes passent en 1 colonne */
    [style*="grid-template-columns: 1fr 1fr"],
    [style*="grid-template-columns: repeat(2, 1fr)"] {
        grid-template-columns: 1fr !important;
    }

    /* Filtres et actions en colonne */
    .filters-container {
        flex-direction: column;
        gap: 0.75rem;
    }

    .filters-container > * {
        width: 100%;
    }

    /* Prospect detail - sections */
    .prospect-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .prospect-actions {
        width: 100%;
        flex-direction: column;
    }

    .prospect-actions .btn {
        width: 100%;
    }

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

    /* Settings page */
    .sync-section {
        grid-template-columns: 1fr;
    }

    .sync-button-container {
        order: -1;
        margin-bottom: 1.5rem;
    }
}

/* Très petits mobiles (max 480px) */
@media (max-width: 480px) {
    .nav-brand span {
        display: none;
    }

    .page-header h1 {
        font-size: 1.3rem;
    }

    .card {
        padding: 0.75rem;
    }

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

    .stat-label {
        font-size: 0.75rem;
    }

    .btn {
        padding: 0.625rem 1rem;
        font-size: 0.9rem;
    }

    .btn-sm {
        padding: 0.375rem 0.75rem;
        font-size: 0.8rem;
    }

    .form-input,
    .form-select,
    .form-textarea {
        font-size: 16px; /* Empêche le zoom iOS */
    }

    /* Cartes de prospects plus compactes */
    .prospect-card {
        padding: 0.75rem;
    }

    .prospect-name {
        font-size: 0.95rem;
    }

    /* Contacts et documents compacts */
    .contact-item,
    .document-item {
        padding: 0.75rem;
    }
}

/* Touch improvements pour mobiles/tablettes */
@media (hover: none) and (pointer: coarse) {
    /* Augmenter la zone de touch */
    .btn,
    .nav-link,
    a {
        min-height: 44px;
        display: inline-flex;
        align-items: center;
    }

    /* Supprimer les effets hover sur touch */
    .btn:hover,
    .nav-link:hover,
    .card:hover {
        transform: none;
    }

    /* Meilleur feedback au touch */
    .btn:active,
    .nav-link:active {
        opacity: 0.7;
    }
}

/* Landscape mobile */
@media (max-width: 768px) and (orientation: landscape) {
    .modal-content {
        max-height: 90vh;
    }

    .main-content {
        padding: 1rem;
    }
}

/* Print styles */
@media print {
    .navbar,
    .fab,
    .btn,
    .modal,
    .flash-messages {
        display: none !important;
    }

    .main-content {
        padding: 0;
    }

    .card {
        box-shadow: none;
        border: 1px solid #ddd;
        page-break-inside: avoid;
    }
}
