/* Bouton suppression RDV */
#crm-rdv-delete {
    font-family: 'Albert Sans', Arial, sans-serif;
    background: #f0f0f0 !important;
    color: #bfbfc0 !important;
}
#crm-rdv-delete:hover {
    background: #f42c59 !important;
    color: #ffeef1 !important;
}
/* Statuts calendrier */
.crm-calendar-event-done {
    background: #b0ddea !important;
    color: #1e98bc !important;
}
.crm-calendar-event-todo {
    background: #ffffff !important;
    color: #6462af !important;
}
.crm-calendar-invite-status-accepted {
    background: #ffc774 !important;
    color: #ffffff !important;
}
/* Sidebar onglet actif pour .crm-nav-link-active */
.crm-nav-link-active {
    background-color: #61b9d2 !important;
    color: #fff !important;
}
/* Sidebar : onglet actif */
.crm-sidebar-tab-active, .crm-sidebar .active {
    background-color: #61b9d2 !important;
    color: #fff !important;
}
/* Boutons et statuts personnalisés */
.button {
    background: #61b9d2 !important;
    color: #fff !important;
    border: none !important;
    padding: 8px 16px !important;
    border-radius: 4px !important;
    cursor: pointer !important;
    text-decoration: none !important;
}
.button:hover {
    background: #50deee !important;
}
.crm-status-success {
    background: #e165b0 !important;
    color: #ffffff !important;
}
.crm-status-sent {
    background: #ffc999 !important;
    color: #ffffff !important;
}
.crm-status-pending {
    background: #fdfa99 !important;
    color: #6b6b6b !important;
}
.crm-projet-montant {
    font-weight: bold !important;
    color: #8078e8 !important;
    margin-bottom: 10px !important;
}
.crm-btn-delete-projet {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 9px 14px !important;
    border-radius: 4px !important;
    background: #f0f0f0 !important;
    color: #bfbfc0 !important;
    text-decoration: none !important;
    font-weight: 300 !important;
}
.crm-btn-delete-projet:hover {
    background: #f42c59 !important;
    color: #ffeef1 !important;
}
.crm-projet-progress {
    background: #8fd8d9 !important;
    height: 100% !important;
    border-radius: 6px 0 0 6px !important;
    transition: width 0.3s !important;
}
/* Prospection : textarea notes style */
textarea[name="notes"] {
    padding: 8px;
    border-radius: 4px;
    border: 1px solid #d1d5db;
    width: 95%;
}
/* Réglages : style pour les selects sidebar_default_group et sidebar_default_page */
select[name="sidebar_default_group"],
select[name="sidebar_default_page"] {
    padding: 8px;
    border-radius: 4px;
    border: 1px solid #d1d5db;
}
/* Modale e-mail : champs largeur spécifique */
input[type="text"][name="sujet"] {
    width: 95% !important;
}
input[type="text"][name="destinataire"] {
    width: 95% !important;
}
input[type="text"]#crm-compose-project-search {
    width: 97.6% !important;
}
select#crm-compose-font {
    padding: 8px 6px !important;
    width: 49% !important;
    margin-bottom: 10px !important;
}
/* Modale devis : textarea description et champ projet largeur 100% */
#devis-modal textarea[name="description"] {
    width: 100%;
    box-sizing: border-box;
}
#devis-modal input[type="text"].devis-project-input {
    width: 97.6%;
    box-sizing: border-box;
}

/* Modale devis : limite la hauteur et rend scrollable */
#devis-modal .crm-modal-content {
    max-height: 92vh;
    overflow-y: auto;
}
#crm-modal-rdv-form input[type="text"] {
    width: 100%;
}
#crm-modal-rdv-form input[type="text"],
#crm-modal-rdv-form input[type="date"],
#crm-modal-rdv-form input[type="time"],
#crm-modal-rdv-form input[type="number"],
#crm-modal-rdv-form textarea,
#crm-modal-rdv-form select {
    margin-bottom: 10px;
}
/* RDV modal: uniformiser tous les champs */
#crm-modal-rdv-form input[type="text"],
#crm-modal-rdv-form input[type="date"],
#crm-modal-rdv-form input[type="time"],
#crm-modal-rdv-form input[type="number"],
#crm-modal-rdv-form textarea,
#crm-modal-rdv-form select {
    padding: 8px;
    border-radius: 5px;
    border: 1px solid #d1d5db;
    font-family: 'Albert Sans', Arial, sans-serif;
    box-sizing: border-box;
}
#crm-modal-rdv-form textarea,
#crm-modal-rdv-form select {
    width: 100%;
}
/* Navigation group separator */
.crm-nav-group-separator {
    border-top: 1px solid #e6e6e6;
    width: 96%;
    margin: auto;
}

/* Arrow icon for navigation */
.crm-arrow {
    float: right;
    color: #e6e6e6;
    margin-top: -4px;
}
/* --- Aperçu devis : boutons sticky en haut --- */
.crm-apercu-devis-actions-sticky {
    position: sticky;
    top: 0;
    z-index: 10;
    background: #fff;
    display: flex;
    justify-content: center;
    gap: 18px;
    padding: 18px 0 12px 0;
    margin-bottom: 8px;
    border-radius: 0 0 12px 12px;
    box-shadow: 0 2px 8px #0001;
}
.crm-apercu-devis-actions-sticky .button {
    background: #1769aa;
    color: #fff;
}

/* --- REGLAGES (restored from archive) --- */
.crm-settings-header {
    display: flex;
    flex-direction: column;
    gap: 18px;
    margin-bottom: 24px;
}
.crm-settings-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 18px;
}
.crm-settings-tab {
    background: #f7f7f7;
    border: 1px solid #e0e0e0;
    border-radius: 8px 8px 0 0;
    padding: 8px 24px;
    cursor: pointer;
    color: #232946;
    font-weight: 600;
    outline: none;
    transition: background 0.2s, color 0.2s;
}
.crm-settings-tab.active, .crm-settings-tab:hover {
    background: #fff;
    color: #1769aa;
    border-bottom: 1px solid #fff;
}
.crm-settings-content {
    background: #fff;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 2px 8px #0001;
    padding: 24px 32px;
    min-height: 400px;
}
.crm-settings-panel { display: none; }
.crm-settings-panel[style*='display:block'] { display: block; }
.crm-settings-panel h2 { margin-top: 0; color: #1769aa; }
.crm-settings-panel form { margin-bottom: 18px; }
.crm-settings-panel label { display: block; margin-bottom: 8px; font-weight: 500; color: #232946; }
.crm-settings-panel input[type="text"],
.crm-settings-panel input[type="email"],
.crm-settings-panel input[type="number"],
.crm-settings-panel input[type="password"],
.crm-settings-panel textarea {
    width: 100%;
    padding: 8px;
    border-radius: 5px;
    border: 1px solid #d1d5db;
    margin-top: 4px;
    font-size: 1em;
    font-family: inherit;
    box-sizing: border-box;
}
.crm-settings-panel input[type="color"] {
    width: 40px;
    height: 32px;
    border: none;
    margin-left: 8px;
    vertical-align: middle;
}
.crm-settings-panel input[type="checkbox"] {
    margin-right: 8px;
}
.crm-settings-panel button[type="button"] {
    background: #1769aa;
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 8px 18px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    margin-top: 8px;
}
.crm-settings-panel button[type="button"]:hover {
    background: #2980b9;
}
.crm-settings-panel #users-list { margin-top: 18px; }
.crm-settings-subtabs {
    display: inline-flex;
    gap: 6px;
    margin: 8px 0 12px 0;
    border-bottom: 1px solid #e5e7eb;
}
.crm-settings-subtab {
    border: none;
    background: transparent;
    padding: 6px 14px;
    border-radius: 8px 8px 0 0;
    cursor: pointer;
    font-weight: 600;
    color: #4b5563;
}
.crm-settings-subtab.active {
    background: #ffffff;
    color: #1769aa;
    border: 1px solid #e5e7eb;
    border-bottom-color: #ffffff;
}

/* --- LOGIN (restored from archive) --- */
.crm-login-container { max-width: 350px; margin: 80px auto; background: #fff; border-radius: 10px; box-shadow: 0 2px 16px #0002; padding: 32px 28px; }
.crm-login-container h2 { text-align: center; margin-bottom: 24px; }
.crm-login-container label { font-weight: 600; display: block; margin-bottom: 8px; }
.crm-login-container input { width: 100%; padding: 8px 10px; border: 1px solid #e0e0e0; border-radius: 5px; margin-bottom: 16px; font-size: 1em; font-family: inherit; }
.crm-login-container button { width: 100%; background: #1769aa; color: #fff; border: none; border-radius: 6px; padding: 10px 0; font-size: 1.1em; font-weight: 600; cursor: pointer; transition: background 0.2s; }
.crm-login-container button:hover { background: #2980b9; }
.crm-login-error { color: #e63946; text-align: center; margin-bottom: 12px; }


/* Retroplanning styles removed entirely */
input,
select {
    max-width: 100%;
}

@media (max-width: 900px) {
    body.crm-mobile-menu-open {
        overflow: hidden;
    }

    .crm-container {
        display: block;
    }

    .crm-mobile-menu-toggle {
        display: block;
    }

    .crm-mobile-sidebar-backdrop {
        position: fixed;
        inset: 0;
        background: rgba(15, 23, 42, 0.38);
        z-index: 10000;
    }

    .crm-mobile-sidebar-backdrop-visible {
        display: block;
    }

    .crm-sidebar {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        width: min(82vw, 320px);
        z-index: 10010;
        transform: translateX(-100%);
        transition: transform 0.22s ease;
        box-shadow: 8px 0 24px rgba(15, 23, 42, 0.16);
    }

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

    .crm-main {
        width: 100%;
        padding: 72px 12px 14px;
    }

    .crm-main > * {
        max-width: 100%;
    }

    .crm-settings-header,
    .crm-emails-header {
        gap: 12px;
    }

    .crm-settings-header > div,
    .crm-emails-header > div {
        flex-wrap: wrap;
    }

    .crm-settings-tabs,
    .crm-emails-tabs {
        flex-wrap: wrap;
    }

    .crm-settings-card,
    .crm-encart,
    .crm-clients-list-container,
    .crm-devis-list-container,
    .crm-modal-content {
        min-width: 0;
        width: 100%;
        box-sizing: border-box;
    }

    .crm-settings-panel .crm-rdv-row,
    #crm-modal-rdv-form .crm-rdv-row,
    .crm-settings-content [style*='display:flex'],
    .crm-main [style*='display:flex'] {
        flex-direction: column;
    }

    .crm-main table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }

    .crm-dashboard-donut-wrap {
        width: 116px;
        height: 116px;
    }

    .crm-dashboard-donut {
        width: 116px;
        height: 116px;
    }

    .crm-modal {
        padding: 10px;
        box-sizing: border-box;
        align-items: flex-start;
    }

    .crm-modal-content {
        margin-top: 56px;
        padding: 20px 16px;
        max-width: 100%;
        max-height: calc(100vh - 76px);
    }

    /* Ensure invoices modal fits viewport and action buttons remain visible */
    #factures-modal .crm-modal-content {
        max-height: 90vh !important;
        overflow: auto !important;
    }
    #factures-modal .crm-modal-actions {
        position: sticky;
        bottom: 0;
        background: #fff;
        padding-top: 8px;
        z-index: 2;
    }
}

.crm-status-pending {
    background: #eceff3;
    color: #4b5563;
}

.crm-status-sent {
    background: #d9ecff;
    color: #1769aa;
}

.crm-status-success {
    background: #ddf6e8;
    color: #157347;
}

.crm-status-cancelled {
    background: #fde2e2;
    color: #b42318;
}

.crm-status-converted {
    background: #eee4ff;
    color: #6f42c1;
}

/* Form field utilities */
.crm-field {
    width: 100%;
    padding: 8px;
    border-radius: 5px;
    border: 1px solid #d1d5db;
    font-family: 'Albert Sans', Arial, sans-serif;
    box-sizing: border-box;
}
.crm-field--compact { padding: 6px 8px; }
.crm-textarea { min-height: 80px; white-space: pre-wrap; }

.crm-stat-chart {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.crm-dashboard-card-limited {
    max-height: 500px;
    overflow-y: auto;
}

.crm-dashboard-bottom-row-triptych {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
    align-items: start;
}

.crm-dashboard-bottom-row-triptych > .crm-encart,
.crm-dashboard-bottom-row-triptych > .crm-dashboard-chart-panel {
    width: auto;
}

.crm-dashboard-panel-limited {
    min-height: 0;
    max-height: 500px;
    overflow-y: auto;
}

.crm-dashboard-chart-toggle {
    border: none;
    background: transparent;
    padding: 0;
    font: inherit;
    color: #1769aa;
    text-align: left;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.crm-dashboard-chart-toggle:hover {
    color: #2980b9;
}

.crm-dashboard-chart-toggle-title {
    font-weight: 700;
}

.crm-dashboard-chart-toggle-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.crm-dashboard-chart-toggle-current {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 999px;
    background: #d9ecff;
    color: #1769aa;
    font-size: 0.82em;
    font-weight: 700;
}

.crm-dashboard-chart-toggle-hint {
    color: #6b7280;
    font-size: 0.8em;
}

.crm-dashboard-chart-views {
    min-height: 200px;
}

.crm-dashboard-chart-view {
    display: none;
}

.crm-dashboard-chart-view.crm-dashboard-chart-view-active {
    display: block;
    animation: crm-dashboard-chart-fade 0.22s ease;
}

@keyframes crm-dashboard-chart-fade {
    from {
        opacity: 0;
        transform: translateY(4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.crm-dashboard-donut-wrap {
    position: relative;
    width: 132px;
    height: 132px;
    margin: 0 auto 10px;
}

.crm-dashboard-donut {
    width: 132px;
    height: 132px;
    transform: rotate(-90deg);
}

.crm-dashboard-donut-track,
.crm-dashboard-donut-segment {
    fill: none;
    stroke-width: 16;
}

/* Retroplanning minimal styles */
.crm-projet-retroplanning-panel .buttons { margin-bottom: 12px; }
/* Pour l'affichage normal, panels 48/52% */
#retro-container .container { display:flex; gap:0; width:100%; border:1px solid #ddd; max-width:100%; box-sizing:border-box; }
.left-panel { flex:0 0 48%; max-width:48%; border-right:1px solid #ddd; overflow-y:auto; max-height:60vh; }
.right-panel { flex:0 0 52%; max-width:52%; overflow:auto; max-height:60vh; }
.timeline-header { display:flex; background:#f2f2f2; border-bottom:1px solid #ddd; position:sticky; top:0; z-index:1; height:28px; align-items:center; }
.date-cell { flex:0 0 34px; padding:2px; text-align:center; border-right:1px solid #ddd; font-size:12px; height:28px; display:flex; align-items:center; justify-content:center; box-sizing:border-box; }
.timeline-body { display:flex; flex-direction:column; }
.task-row { display:flex; height:47px; line-height:47px; }
.color-cell { flex:0 0 34px; height:100%; border:1px solid #eee; cursor:pointer; box-sizing:border-box; }
.retro-tasks-header { display:flex; align-items:center; background:#fafafa; border-bottom:1px solid #ddd; padding:6px 8px; box-sizing:border-box; }
.retro-tasks-header .retro-col { padding:4px 6px; box-sizing:border-box; font-weight:600; }
.retro-task-row { display:flex; align-items:center; width:100%; box-sizing:border-box; height:47px; }
.retro-task-row .retro-cell { padding:6px; box-sizing:border-box; }
.retro-task-row .retro-cell { border-right:1px solid #e9e9e9; }
.retro-task-row .retro-cell:last-child { border-right: none; }
/* remove visible borders for select elements inside left-panel */
.left-panel select { border: none; background: transparent; outline: none; padding: 4px; }
select { width: 90%; }
.retro-task-row + .retro-task-row { border-top:1px solid #f1f1f1; }
.action-cell { width:40px; text-align:center; }
.remove-task { background:none; border:none; font-size:14px; cursor:pointer; color:#ff5722; padding:0; margin:0; }
.retro-task-rows { display:block; }

/* small color palette option */
.color-option { width:18px; height:18px; display:inline-block; margin:3px; cursor:pointer; }

/* Retroplanning modal sizing (extended) */
#crm-modal-retroplanning {
    align-items: center;
    justify-content: center;
}
#crm-modal-retroplanning .crm-modal-content {
    width: min(1200px, 98%) !important;
    max-width: 1200px !important;
    height: 88vh !important;
    max-height: 92vh !important;
    padding: 18px !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
}
#retro-planner {
    height: calc(88vh - 80px);
    display: flex;
    gap: 0;
}
#retro-planner .left-panel, #retro-planner .right-panel {
    max-height: calc(88vh - 120px);
    overflow: auto;
}


.crm-dashboard-donut-track {
    stroke: #e5e7eb;
}

    .crm-dashboard-bottom-row-triptych {
        grid-template-columns: 1fr;
    }

/* Retroplanning styles removed */

.crm-dashboard-donut-segment {
    stroke-linecap: butt;
}

.crm-dashboard-donut-center {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: #232946;
    pointer-events: none;
}

.crm-dashboard-donut-center strong {
    font-size: 1.35em;
    line-height: 1;
}

.crm-dashboard-donut-center span {
    font-size: 0.82em;
    color: #6b7280;
}

.crm-dashboard-chart-legend {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.crm-dashboard-chart-legend li {
    display: grid;
    grid-template-columns: 10px minmax(0, 1fr);
    gap: 6px 10px;
    align-items: start;
}

.crm-dashboard-chart-swatch {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    margin-top: 4px;
}

.crm-dashboard-chart-label {
    font-weight: 600;
    color: #232946;
}

.crm-dashboard-chart-meta {
    grid-column: 2;
    color: #6b7280;
    font-size: 0.85em;
}
/* --- CALENDRIER DASHBOARD --- */
.crm-calendar-container {
    width: 100%;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px #0001;
    padding: 16px 8px 24px 8px;
    margin-bottom: 32px;
    overflow-x: auto;
}
.crm-calendar-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 8px;
    font-size: 0.9em;
    color: #6b7280;
}
.crm-calendar-nav-link {
    color: #4b5563;
    text-decoration: none;
    padding: 2px 4px;
    border-radius: 4px;
}
.crm-calendar-nav-link:hover {
    text-decoration: underline;
    color: #1769aa;
    background: transparent;
}
.crm-calendar-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 8px 12px;
    table-layout: fixed;
}
.crm-calendar-table td {
    vertical-align: top;
    padding: 0;
    background: #f7f7f7;
    border-radius: 8px;
}
.crm-calendar-day {
    min-height: 90px;
    padding: 8px 6px 6px 6px;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    position: relative;
}
.crm-calendar-date {
    font-weight: bold;
    color: #1769aa;
    margin-bottom: 6px;
    font-size: 1em;
    text-align: center;
}
.crm-calendar-events {
    flex: 1;
    margin-bottom: 4px;
}
.crm-calendar-event {
    border-radius: 6px;
    padding: 4px 6px;
    margin-bottom: 4px;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    font-size: 0.97em;
}
.crm-calendar-event-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 6px;
}
.crm-calendar-event-content {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    align-items: flex-start;
    gap: 6px;
}
.crm-calendar-event-time {
    flex: 0 0 auto;
    min-width: 38px;
    font-size: 0.82em;
    font-weight: 700;
    line-height: 1.35;
    color: inherit;
    opacity: 0.9;
}
.crm-calendar-event-time-empty {
    min-width: 0;
}
.crm-calendar-event-title {
    flex: 1 1 auto;
    min-width: 0;
    /* Afficher davantage le nom du rendez-vous (jusqu'à 3 lignes) */
    white-space: normal;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    line-clamp: 3;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    line-height: 1.35;
}

/* Project form field width overrides requested by user */
input#crm-projet-client-autocomplete{width: 90%!important;}
input#crm-projet-titre{width: 94%!important;}
input#crm-projet-date{width: 91%!important;}
input#crm-projet-montant{width: 90%!important;}
input#crm-projet-description{width: 98.5%!important;}
.crm-calendar-event-actions {
    flex-shrink: 0;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 2px;
}
.crm-calendar-event-todo {
    background: #dbeafe;
    color: #1d4ed8;
}
.crm-calendar-event-done {
    background: #dcfce7;
    color: #15803d;
}
.crm-calendar-event-pending {
    background: #f3f4f6;
    color: #4b5563;
}
.crm-calendar-event-cancelled {
    background: #fee2e2;
    color: #b91c1c;
}
.crm-calendar-invite-status-line {
    margin-top: 2px;
    display: inline-flex;
    flex-wrap: wrap;
    gap: 4px;
}
.crm-calendar-invite-status {
    font-size: 0.78em;
    padding: 1px 6px;
    border-radius: 999px;
    font-weight: 600;
}
.crm-calendar-invite-status-accepted {
    background: #ddf6e8;
    color: #157347;
}
.crm-calendar-invite-status-refused {
    background: #fde2e2;
    color: #b42318;
}
.crm-calendar-add {
    background: #e9ecef;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    font-size: 1.2em;
    color: #232946;
    cursor: pointer;
    align-self: flex-end;
    margin-top: 2px;
    transition: background 0.2s;
}
.crm-calendar-add:hover { background: #d1e7fd; color: #1769aa; }
.crm-calendar-edit, .crm-calendar-delete {
    background: none;
    border: none;
    color: #888;
    font-size: 1em;
    cursor: pointer;
    margin-left: 0;
    padding: 0;
    line-height: 1;
    transition: color 0.2s;
}
.crm-calendar-edit:hover { color: #1769aa; }

.crm-calendar-legend {
    margin-top: 10px;
    font-size: 0.8em;
    color: #6b7280;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}
.crm-calendar-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

/* Boutons de réorganisation (groupes & onglets sidebar) */
.sidebar-group-up,
.sidebar-group-down,
.sidebar-tab-up,
.sidebar-tab-down {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    margin-left: 4px;
    border-radius: 4px;
    border: 1px solid #e5e7eb;
    background: #f9fafb;
    color: #6b7280;
    font-size: 11px;
    cursor: pointer;
    padding: 0;
}

.sidebar-group-up:hover,
.sidebar-group-down:hover,
.sidebar-tab-up:hover,
.sidebar-tab-down:hover {
    background: #e5e7eb;
    color: #374151;
}

.sidebar-group-up:focus,
.sidebar-group-down:focus,
.sidebar-tab-up:focus,
.sidebar-tab-down:focus {
    outline: none;
    box-shadow: 0 0 0 1px #d1d5db;
}
.crm-calendar-dot {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    display: inline-block;
}
.crm-calendar-dot-todo { background: #1d4ed8; }
.crm-calendar-dot-done { background: #15803d; }
.crm-calendar-dot-pending { background: #6b7280; }
.crm-calendar-dot-cancelled { background: #b91c1c; }
.crm-calendar-delete:hover { color: #e63946; }

/* RDV modal */
.crm-rdv-row {
    display: flex;
    gap: 12px;
    margin-bottom: 8px;
    align-items: flex-end;
}
.crm-rdv-row label {
    flex: 1;
}
.crm-rdv-row-primary label {
    min-width: 0;
}
.crm-rdv-row-statut {
    margin-top: 6px;
}
.crm-rdv-select {
    width: 100%;
    padding: 6px 8px;
    border-radius: 6px;
    border: 1px solid #d1d5db;
    background: #fff;
    font-size: 0.95em;
}
/* --- BOUTON EXPORT PDF --- */
.crm-btn-export-pdf {
    background: #1769aa;
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 8px 18px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    box-shadow: 0 2px 8px #0001;
}
.crm-btn-export-pdf:hover {
    background: #2980b9;
}
/* --- EMAILS --- */
.crm-emails-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    width: 100%;
}
.crm-emails-actions {
    display: flex;
    gap: 12px;
}
.crm-emails-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 18px;
}
.crm-emails-tab {
    background: #f7f7f7;
    border: 1px solid #e0e0e0;
    border-radius: 8px 8px 0 0;
    padding: 8px 24px;
    cursor: pointer;
    color: #232946;
    font-weight: 600;
    outline: none;
    transition: background 0.2s, color 0.2s;
}
.crm-emails-tab.active, .crm-emails-tab:hover {
    background: #fff;
    color: #1769aa;
    border-bottom: 1px solid #fff;
}
.crm-emails-lists {
    width: 100%;
}
.crm-emails-list {
    background: #fff;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 2px 8px #0001;
    padding: 18px 24px;
    width: 95%;
    margin: 0 auto 24px auto;
    overflow-x: auto;
}
.crm-emails-table {
    width: 100%;
    min-width: 600px;
    border-collapse: collapse;
    margin: 0;
}
.crm-emails-table th, .crm-emails-table td {
    border: 1px solid #e0e0e0;
    padding: 10px 8px;
    text-align: left;
}
.crm-emails-table th { background: #f0f0f0; }
.crm-email-row { cursor: pointer; transition: background 0.15s; }
.crm-email-row:hover, .crm-email-row:focus { background: #e9ecef; }
.crm-email-actions { font-size: 1.5em; cursor: pointer; color: #232946; padding: 0 8px; }
.crm-email-actions:hover { color: #e63946; }
/* Barre d'édition du composeur d'e-mails */
#crm-compose-toolbar {
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    background: #f9fafb;
    padding: 6px 8px;
}
.crm-compose-btn {
    background: #ffffff;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
    color: #374151;
    box-shadow: none;
}
.crm-compose-btn:hover {
    background: #f3f4f6;
    color: #111827;
}
/* --- PROJETS --- */
.crm-projet-origin {
    margin-top: 2px;
    margin-bottom: 4px;
    font-size: 0.8em;
    color: #6b7280;
}
/* --- PROSPECTION --- */
.crm-prospection-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    width: 100%;
}
.crm-prospection-actions {
    display: flex;
    gap: 12px;
}
.crm-prospection-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 24px;
    width: 100%;
    margin: 0 auto;
}
.crm-prospect-card {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 8px #0001;
    padding: 20px 24px 16px 24px;
    display: flex;
    flex-direction: column;
    min-height: 140px;
    position: relative;
}
.crm-prospect-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-weight: bold;
    font-size: 1.1em;
}
.crm-prospect-nom { color: #232946; }
.crm-prospect-entreprise { color: #3e497a; font-size: 0.98em; }
.crm-prospect-card-header-stack {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
}
.crm-prospect-contact-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    color: #4b5563;
    font-size: 0.95em;
    margin-bottom: 10px;
}
.crm-prospect-montant { font-weight: bold; color: #2980b9; margin-bottom: 8px; }
.crm-prospect-action { color: #444; font-size: 0.98em; margin-bottom: 12px; }
.crm-prospect-status-row {
    margin-bottom: 12px;
}
/* Retroplanning selectors removed */
.crm-prospect-card-footer {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin-top: auto;
    font-size: 1.3em;
}
.crm-prospect-card-footer-actions {
    justify-content: flex-start;
    gap: 8px;
    flex-wrap: wrap;
    font-size: 1em;
}
.crm-prospect-actions {
    cursor: pointer;
    color: #232946;
    padding: 0 8px;
    font-size: 1.5em;
    transition: color 0.2s;
}
.crm-prospect-actions:hover { color: #e63946; }
.crm-prospect-empty {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 8px #0001;
    padding: 20px 24px;
    color: #6b7280;
}
.crm-button-danger {
    background: #e63946;
}
.crm-button-danger:hover {
    background: #c92f3b;
}
/* --- PROJETS --- */
.crm-projets-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    width: 100%;
}
.crm-projets-actions {
    display: flex;
    gap: 12px;
}
.crm-projets-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 24px;
    width: 100%;
    margin: 0 auto;
}
.crm-projet-card {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 8px #0001;
    padding: 20px 24px 16px 24px;
    display: flex;
    flex-direction: column;
    min-height: 220px;
    position: relative;
}
.crm-projet-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-weight: bold;
    font-size: 1.1em;
}
.crm-projet-nom { color: #232946; }
.crm-projet-client { color: #3e497a; font-size: 0.98em; }
.crm-projet-desc {
    color: #444;
    font-size: 0.98em;
    margin-bottom: 10px;
    display: -webkit-box;
    line-clamp: 2;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    min-height: 2.6em;
}
.crm-projet-status {
    display: inline-block;
    padding: 3px 12px;
    border-radius: 12px;
    font-size: 0.95em;
    margin-bottom: 8px;
}
.crm-status-proposition { background: #fff3cd; color: #b8860b; }
.crm-status-encours { background: #d1e7fd; color: #1769aa; }
.crm-status-termine { background: #d4f8e8; color: #218c5a; }
.crm-projet-montant { font-weight: bold; color: #2980b9; margin-bottom: 10px; }
.crm-projet-progress-bar {
    background: #e0e0e0;
    border-radius: 6px;
    height: 7px;
    width: 100%;
    margin-bottom: 12px;
    overflow: hidden;
}
.crm-projet-progress {
    background: #2980b9;
    height: 100%;
    border-radius: 6px 0 0 6px;
    transition: width 0.3s;
}
.crm-projet-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    font-size: 1em;
}
.crm-projet-card-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-left: auto;
}
.crm-projet-files {
    color: #888;
    display: flex;
    align-items: center;
    gap: 4px;
}
.crm-projet-files-icon { font-size: 1.2em; }
.crm-btn-delete-projet {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 9px 14px;
    border-radius: 8px;
    background: #fdeaea;
    color: #c0392b;
    text-decoration: none;
    font-weight: 600;
}
.crm-btn-delete-projet:hover { background: #f9d5d1; }
.crm-projet-page {
    width: 100%;
}
.crm-projet-page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 24px;
    margin-bottom: 24px;
}
.crm-projet-page-subtitle {
    margin: 8px 0 0;
    color: #61708e;
    max-width: 760px;
}
.crm-projet-breadcrumbs {
    color: #61708e;
    font-size: 0.95em;
    margin-bottom: 8px;
}
.crm-projet-breadcrumbs a {
    color: #1769aa;
    text-decoration: none;
}
.crm-projet-page-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}
.crm-projet-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.95fr);
    gap: 24px;
    align-items: start;
    margin-bottom: 24px;
}
.crm-projet-sections {
    display: grid;
    gap: 24px;
    margin-bottom: 24px;
}
.crm-projet-info-overview {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
    gap: 20px;
    align-items: start;
}
.crm-projet-panel {
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 2px 8px #0001;
    padding: 22px 24px;
}
.crm-projet-panel-plain {
    background: transparent;
    box-shadow: none;
    padding: 0;
}
.crm-projet-panel-full {
    grid-column: 1 / -1;
}
.crm-projet-panel h2,
.crm-projet-panel h3 {
    margin-top: 0;
    color: #232946;
}
.crm-projet-reports-panel {
    display: flex;
    flex-direction: column;
    gap: 22px;
}
.crm-projet-reports-panel > h2 {
    margin-bottom: 0;
}
.crm-projet-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    margin-bottom: 16px;
}
.crm-projet-panel-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px;
}
.crm-projet-panel-header h2 {
    margin-bottom: 0;
}
.crm-projet-section-block {
    margin-top: 20px;
}
.crm-projet-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 14px;
}
.crm-projet-info-card {
    background: #f7f9fc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 14px 16px;
}
.crm-projet-description-panel {
    background: #f9fbfe;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 18px 20px;
    min-height: 100%;
    box-sizing: border-box;
}
.crm-projet-description-panel h3 {
    margin-bottom: 12px;
}
.crm-projet-info-label {
    display: block;
    color: #61708e;
    font-size: 0.82em;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    margin-bottom: 6px;
}
.crm-projet-info-value {
    color: #232946;
    font-weight: 600;
}
.crm-projet-rich-content {
    color: #31405b;
    line-height: 1.65;
}
.crm-projet-rich-content p:first-child {
    margin-top: 0;
}
.crm-projet-rich-content p:last-child {
    margin-bottom: 0;
}
.crm-projet-empty {
    color: #7a8397;
    font-style: italic;
}
.crm-projet-form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
}
.crm-projet-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.crm-projet-field span {
    font-weight: 600;
    color: #31405b;
}
.crm-projet-field-full {
    grid-column: 1 / -1;
}
.crm-projet-field input,
.crm-projet-field select,
.crm-projet-field textarea {
    width: 100%;
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid #cfd7e6;
    box-sizing: border-box;
    font: inherit;
    color: #232946;
    background: #fff;
}
.crm-projet-field textarea {
    resize: vertical;
    min-height: 120px;
}
.crm-projet-form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 18px;
}
.crm-projet-report-form-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 14px;
}
.crm-projet-report-composer {
    background: #fff;
    border: 1px solid #e6edf6;
    border-radius: 14px;
    box-shadow: 0 2px 8px #0001;
    padding: 22px 24px;
}
.crm-projet-reports-panel .crm-projet-section-block {
    margin-top: 0;
    padding-top: 22px;
    border-top: 1px solid #e6edf6;
}
.crm-projet-reports-panel .crm-projet-section-block h3 {
    margin-bottom: 14px;
}
.crm-projet-report-form-header h3 {
    margin: 0;
}
.crm-projet-report-cancel {
    white-space: nowrap;
}
.crm-projet-report-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.crm-projet-report-item {
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 16px 18px;
    background: #f7f9fc;
    box-shadow: none;
    min-width: 0;
}
.crm-projet-report-meta {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
    color: #61708e;
    font-size: 0.92em;
}
.crm-projet-report-meta-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.crm-btn-edit-report {
    padding: 7px 12px;
}
.crm-projet-report-preview {
    margin-top: 12px;
    padding-top: 14px;
    border-top: 1px solid #e6edf6;
}
.crm-projet-alert {
    border-radius: 12px;
    padding: 12px 14px;
    margin-bottom: 18px;
    font-weight: 600;
}
.crm-projet-alert-success {
    background: #e4f6ec;
    color: #20744d;
}
.crm-projet-alert-warning {
    background: #fff4d8;
    color: #9a6a00;
}
.crm-projet-alert-inline {
    margin-bottom: 14px;
}
.crm-projet-legacy-content {
    border: 1px dashed #d7c27f;
    border-radius: 12px;
    background: #fffdf5;
    padding: 14px 16px;
    margin-bottom: 16px;
    color: #6b7280;
}
/* Retroplanning CSS removed */
.crm-btn-add-file {
    background: #e9ecef;
    border: none;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    font-size: 1.2em;
    color: #232946;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}
.crm-btn-add-file:hover { background: #d1e7fd; color: #1769aa; }
/* Retroplanning styles neutralized (removed per request) */
/* Keep this override to avoid visual regressions while selectors are removed from templates. */
/* Retroplanning override removed */

/* --- FACTURES --- */
.crm-factures-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    width: 100%;
}
.crm-factures-actions {
    display: flex;
    gap: 12px;
}
.crm-factures-list-container {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px #0001;
    padding: 18px 24px;
    width: 95%;
    margin: 0 auto;
    overflow-x: auto;
}
.crm-factures-table {
    width: 100%;
    min-width: 700px;
    border-collapse: collapse;
    margin: 0;
}
.crm-factures-table th, .crm-factures-table td {
    border: 1px solid #e0e0e0;
    padding: 10px 8px;
    text-align: left;
}
.crm-factures-table th { background: #f0f0f0; }
.crm-facture-row { cursor: pointer; transition: background 0.15s; }
.crm-facture-row:hover, .crm-facture-row:focus { background: #e9ecef; }
.crm-factures-actions { font-size: 1.5em; cursor: pointer; color: #232946; padding: 0 8px; }
.crm-factures-actions:hover { color: #e63946; }
/* --- DEVIS --- */
.crm-devis-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    width: 100%;
}
.crm-devis-actions {
    display: flex;
    gap: 12px;
}
.crm-devis-list-container {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px #0001;
    padding: 18px 24px;
    width: 95%;
    margin: 0 auto;
    overflow-x: auto;
}
.crm-devis-table {
    width: 100%;
    min-width: 700px;
    border-collapse: collapse;
    margin: 0;
}
.crm-devis-table th, .crm-devis-table td {
    border: 1px solid #e0e0e0;
    padding: 10px 8px;
    text-align: left;
}
.crm-devis-table th { background: #f0f0f0; }
.crm-devis-row { cursor: pointer; transition: background 0.15s; }
.crm-devis-row:hover, .crm-devis-row:focus { background: #e9ecef; }
.crm-devis-actions { font-size: 1.5em; cursor: pointer; color: #232946; padding: 0 8px; }
.crm-devis-actions:hover { color: #e63946; }
.crm-status-envoye { background: #d1e7fd; color: #1769aa; padding: 3px 12px; border-radius: 12px; font-size: 0.95em; }
.crm-status-signe { background: #d4f8e8; color: #218c5a; padding: 3px 12px; border-radius: 12px; font-size: 0.95em; }
@import url('https://fonts.googleapis.com/css2?family=Albert+Sans:wght@400;600;700&display=swap');

body { font-family: 'Albert Sans', Arial, sans-serif; background: #f7f7f7; margin: 0; padding: 0; }

.crm-container { display: flex; min-height: 100vh; align-items: flex-start; }
.crm-sidebar {
    width: 250px;
    background: #fff;
    color: #232946;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    border-right: 1px solid #e0e0e0;
    height: 100vh;
    max-height: 100vh;
    min-height: 100vh;
    box-sizing: border-box;
    position: sticky;
    top: 0;
    left: 0;
    z-index: 10;
}
.crm-sidebar-top { padding: 24px 0 0 0; }
.crm-logo {
    text-align: center;
    margin: 0 0 24px 0;
    font-size: 2em;
    letter-spacing: 2px;
    color: #232946;
}
.crm-nav-link {
    display: block;
    color: #232946;
    text-decoration: none;
    padding: 10px 32px;
    transition: background 0.2s, color 0.2s;
}
.crm-nav-link:hover, .crm-nav-link.active {
    background: #f0f0f0;
    color: #1769aa;
}
.crm-nav-group { margin-bottom: 8px; }
.crm-nav-group-title {
    cursor: pointer;
    padding: 10px 32px;
    font-weight: bold;
    background: #f7f7f7;
    color: #232946;
}
.crm-nav-group-items { background: #fff; }
.crm-arrow { float: right; }
.crm-sidebar-bottom { padding: 16px 0 24px 0; }
.crm-sidebar-bottom hr {
    border: none;
    border-top: 1px solid #e0e0e0;
    margin: 0 24px 12px 24px;
}
.crm-logout { color: #e63946; }
.crm-main { flex: 1; padding: 32px 40px; background: #f7f7f7; min-height: 100vh; font-size: 0.9em; }

.crm-clients-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    width: 100%;
    max-width: none;
    margin-left: 0;
    margin-right: 0;
}
.crm-clients-actions { display: flex; gap: 12px; }
.crm-clients-list-container {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px #0001;
    padding: 18px 24px;
    width: 100%;
    max-width: none;
    margin: 0;
    overflow-x: auto;
}
.crm-clients-table {
    width: 100%;
    min-width: 600px;
    max-width: none;
    border-collapse: collapse;
    margin: 0;
}
.crm-clients-table th, .crm-clients-table td { border: 1px solid #e0e0e0; padding: 10px 8px; text-align: left; }
.crm-clients-table th { background: #f0f0f0; }
.crm-client-row { cursor: pointer; transition: background 0.15s; }
.crm-client-row:hover, .crm-client-row:focus { background: #e9ecef; }
.crm-client-actions { font-size: 1.5em; cursor: pointer; color: #232946; padding: 0 8px; }
.crm-client-actions:hover { color: #e63946; }

/* Modale client */
.crm-modal { position: fixed; z-index: 9999; left: 0; top: 0; width: 100vw; height: 100vh; background: rgba(0,0,0,0.3); display: flex; align-items: center; justify-content: center; }
.crm-modal-content { background: #fff; padding: 32px 40px; border-radius: 10px; min-width: 320px; max-width: 600px; box-shadow: 0 2px 16px #0002; position: relative; }
.crm-modal-close { position: absolute; top: 12px; right: 18px; font-size: 2em; color: #888; cursor: pointer; }
.crm-modal-close:hover { color: #e63946; }

.crm-dashboard-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; }
.crm-dashboard-date { font-size: 1.1em; color: #232946; background: #e9ecef; padding: 8px 18px; border-radius: 20px; }
.crm-dashboard-calendar { margin-bottom: 32px; }
.crm-dashboard-stats-row { display: flex; gap: 18px; margin-bottom: 32px; flex-wrap: wrap; }
.crm-stat { background: #fff; border-radius: 8px; box-shadow: 0 2px 8px #0001; padding: 18px 24px; min-width: 140px; flex: 1; text-align: center; margin-bottom: 12px; }
.crm-stat-large { min-width: 220px; font-size: 1.2em; flex: 2; }
.crm-stat-value { display: block; font-size: 1.5em; font-weight: bold; margin-top: 6px; color: #2980b9; }
.crm-dashboard-bottom-row { display: flex; gap: 24px; }
.crm-encart { background: #fff; border-radius: 8px; box-shadow: 0 2px 8px #0001; padding: 18px 24px; flex: 1; min-width: 0; }
.crm-encart-50 { width: 50%; }
.crm-list { list-style: none; padding: 0; margin: 0; }
.crm-list li { margin-bottom: 10px; display: flex; align-items: center; justify-content: space-between; }
.crm-status { display: inline-block; padding: 3px 12px; border-radius: 12px; font-size: 0.95em; margin-left: 10px; }
.crm-status-payee { background: #d4f8e8; color: #218c5a; }
.crm-status-attente { background: #fff3cd; color: #b8860b; }
.crm-status-retard { background: #f8d7da; color: #c82333; }
.crm-status-actif { background: #d1e7fd; color: #1769aa; }
.crm-status-pause { background: #f0e6fa; color: #7c3aed; }

@media (max-width: 1100px) {
    .crm-dashboard-stats-row { flex-direction: column; gap: 10px; }
    .crm-dashboard-bottom-row { flex-direction: column; gap: 10px; }
    .crm-encart-50 { width: 100%; }
}
@media (max-width: 800px) {
    .crm-container { flex-direction: column; }
    .crm-sidebar { width: 100%; flex-direction: row; min-height: unset; }
    .crm-main { padding: 16px 8px; }
}
@media (max-width: 700px) {
    .crm-clients-header { flex-direction: column; align-items: flex-start; gap: 10px; }
    .crm-modal-content { padding: 18px 8px; }
}
table { width: 100%; border-collapse: collapse; margin-bottom: 20px; }
th, td { border: 1px solid #ddd; padding: 8px; }
th { background: #f0f0f0; }
.button { background: #2980b9; color: #fff; border: none; padding: 8px 16px; border-radius: 4px; cursor: pointer; }
.button:hover { background: #3498db; }

/* Retroplanning CSS tweaks (requested) */
.retro-tasks-header { display: flex; align-items: center; background: #fafafa; border-bottom: 1px solid #ddd; padding: 6px; box-sizing: border-box; }
div.retro-col.col-task{ width: 32% !important; }
div.retro-col.col-participant{ width: 32% !important; }
div.retro-col.col-status{ width: 32% !important; }
div.retro-col.col-action{width: 4% !important;}

div.retro-cell.task-cell { width: 32% !important; }
.action-cell { width: 4%; }
.timeline-header { height: 31.5px; padding: 4px 0px;}
div.date-cell { height: 31.5px; padding: 4px 0px;}
.task-row { display:flex; height:47px; line-height:47px; }


/* Corrections finales du layout mobile: le contenu ne doit pas passer sous la sidebar */
@media (max-width: 900px) {
    body.crm-mobile-menu-open {
        overflow: hidden;
    }

    .crm-container {
        display: block;
        min-height: 100vh;
    }

    .crm-mobile-menu-toggle {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
    }

    .crm-mobile-sidebar-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(15, 23, 42, 0.38);
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.2s ease;
        z-index: 10005;
    }

    .crm-mobile-sidebar-backdrop.crm-mobile-sidebar-backdrop-visible {
        opacity: 1;
        pointer-events: auto;
    }

    .crm-sidebar {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        width: min(84vw, 320px);
        max-width: 320px;
        min-width: 0;
        height: 100vh;
        min-height: 100vh;
        max-height: none;
        transform: translateX(calc(-100% - 16px));
        transition: transform 0.22s ease;
        z-index: 10010;
        box-shadow: 0 18px 48px rgba(15, 23, 42, 0.22);
        overflow: hidden;
    }

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

    .crm-sidebar-top {
        padding-top: 72px;
    }

    .crm-sidebar-bottom {
        padding-bottom: 18px;
    }

    .crm-main {
        width: 100%;
        min-height: 100vh;
        margin: 0;
        padding: 72px 12px 18px;
        box-sizing: border-box;
    }

    .crm-dashboard-header,
    .crm-dashboard-stats-row,
    .crm-dashboard-bottom-row,
    .crm-clients-header,
    .crm-devis-header,
    .crm-factures-header,
    #crm-modal-rdv-form .crm-rdv-row {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .crm-clients-actions,
    .crm-devis-actions,
    .crm-factures-actions {
        width: 100%;
        justify-content: flex-start;
        flex-wrap: wrap;
    }

    .crm-clients-list-container,
    .crm-devis-list-container,
    .crm-factures-list-container,
    .crm-encart {
        width: 100%;
        margin: 0;
        padding: 16px 12px;
        box-sizing: border-box;
    }

    .crm-encart-50 {
        width: 100%;
    }

    .crm-modal {
        align-items: flex-start;
        overflow-y: auto;
        padding: 12px;
        box-sizing: border-box;
    }

    .crm-modal-content {
        width: min(100%, 640px);
        max-width: 100%;
        max-height: none;
        margin: 56px auto 16px;
        padding: 20px 16px;
        box-sizing: border-box;
    }
}