/* Reset & Base */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: #000;
    background-color: #fff;
    line-height: 1.5;
    min-height: 100vh;
}


body.user-bg-zoom {
    position: relative;
    isolation: isolate;
}

body.user-bg-zoom::before {
    content: "";
    position: fixed;
    inset: 0;
    background-image: url('/assets/img/fond.png');
    background-repeat: no-repeat;
    background-position: center;
    background-size: auto var(--zoom-bg-height, 2px);
    opacity: var(--zoom-bg-image-opacity, 0.2);
    pointer-events: none;
    z-index: -1;
    transition: opacity 0.4s ease;
}

body.user-bg-zoom::after {
    content: "Il faut travailler et arrêter de baver";
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: clamp(20px, 3vw, 42px);
    font-weight: 700;
    color: rgba(0, 0, 0, 0.2);
    text-align: center;
    padding: 24px;
    pointer-events: none;
    opacity: var(--zoom-bg-message-opacity, 0);
    z-index: -1;
}


a {
    text-decoration: none;
    color: inherit;
}

/* Header */
.main-header {
    background-color: #2657A3;
    color: #fff;
    padding: 0 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-container {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 30px;
    height: 70px;
}

.logo-link {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.logo {
    width: 60px;
    height: 60px;
    object-fit: contain;
}

.main-nav {
    flex: 1;
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 5px;
}

.nav-links a {
    display: block;
    padding: 8px 18px;
    border-radius: 6px;
    color: #fff;
    font-weight: 500;
    transition: background-color 0.2s;
}

.nav-links a:hover,
.nav-links a.active {
    background-color: #2F6CCB;
}

.header-right {
    position: relative;
}

.profile-btn {
    background: none;
    border: 1px solid rgba(255,255,255,0.3);
    color: #fff;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    transition: background-color 0.2s;
}

.profile-btn:hover {
    background-color: rgba(255,255,255,0.1);
}

.profile-icon {
    font-size: 10px;
}

.dropdown-arrow {
    font-size: 10px;
}

.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    min-width: 180px;
    margin-top: 8px;
    overflow: hidden;
    z-index: 1001;
}

.dropdown-menu.show {
    display: block;
}

.dropdown-menu a {
    display: block;
    padding: 10px 16px;
    color: #000;
    transition: background-color 0.2s;
}

.dropdown-menu a:hover {
    background-color: #f0f4f8;
}

.dropdown-menu hr {
    border: none;
    border-top: 1px solid #eee;
}

/* Main Content */
.main-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* Auth Pages */
.auth-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #2657A3 0%, #1C417A 100%);
}

.auth-container {
    background: #fff;
    border-radius: 12px;
    padding: 40px;
    width: 100%;
    max-width: 440px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}

.auth-logo {
    text-align: center;
    margin-bottom: 24px;
}

.auth-logo img {
    width: 200px;
    height: 200px;
    object-fit: contain;
}

.auth-title {
    text-align: center;
    font-size: 22px;
    color: #1C417A;
    margin-bottom: 8px;
}

.auth-subtitle {
    text-align: center;
    color: #666;
    margin-bottom: 24px;
    font-size: 14px;
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    margin-bottom: 4px;
    font-weight: 600;
    font-size: 14px;
    color: #333;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #2657A3;
    box-shadow: 0 0 0 3px rgba(38,87,163,0.1);
}

.password-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.password-wrapper input {
    padding-right: 70px;
}

.toggle-password {
    position: absolute;
    right: 10px;
    background: none;
    border: none;
    color: #2657A3;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    padding: 4px;
}

.toggle-password:hover {
    color: #1C417A;
}

.password-strength {
    margin-top: 6px;
    font-size: 12px;
}

.password-strength .rule {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 2px;
    color: #999;
}

.password-strength .rule.valid {
    color: #22a653;
}

.password-strength .rule.invalid {
    color: #dc3545;
}

.btn {
    display: inline-block;
    padding: 10px 24px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s;
}

.btn:active {
    transform: scale(0.98);
}

.btn-primary {
    background-color: #2657A3;
    color: #fff;
    width: 100%;
    padding: 12px;
    font-size: 16px;
}

.btn-primary:hover {
    background-color: #1C417A;
}

.btn-secondary {
    background-color: #2F6CCB;
    color: #fff;
}

.btn-secondary:hover {
    background-color: #2657A3;
}

.btn-sm {
    padding: 6px 14px;
    font-size: 13px;
}

.btn-danger {
    background-color: #dc3545;
    color: #fff;
}

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

.auth-links {
    text-align: center;
    margin-top: 16px;
    font-size: 14px;
}

.auth-links a {
    color: #2657A3;
    font-weight: 500;
}

.auth-links a:hover {
    text-decoration: underline;
}

.alert {
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 16px;
    font-size: 14px;
}

.alert-error {
    background-color: #fde8e8;
    color: #c0392b;
    border: 1px solid #f5c6cb;
}

.alert-success {
    background-color: #e8fde8;
    color: #27ae60;
    border: 1px solid #c6f5c6;
}

/* Page Header */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 16px;
}

.page-title {
    font-size: 24px;
    color: #1C417A;
}

/* Date Navigation */
.date-nav {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #f8f9fa;
    padding: 8px 16px;
    border-radius: 8px;
    flex-wrap: wrap;
}

.date-nav select {
    padding: 6px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    background: #fff;
}

.date-nav-btn {
    background: #2657A3;
    color: #fff;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
}

.date-nav-btn:hover {
    background: #1C417A;
}

.date-nav-label {
    font-weight: 600;
    font-size: 14px;
    color: #333;
    min-width: 60px;
}

/* Tables */
.table-container {
    overflow-x: auto;
    margin-bottom: 30px;
    border-radius: 8px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

.table-title {
    font-size: 18px;
    color: #1C417A;
    margin-bottom: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.data-table-compact {
    width: auto;
    min-width: 640px;
    margin: 0 auto;
    table-layout: auto;
}

.data-table-compact thead th,
.data-table-compact tbody td {
    white-space: normal;
    padding: 6px 8px;
}

.data-table-compact thead th:first-child,
.data-table-compact tbody td:first-child {
    width: 48px;
}

.data-table thead {
    background-color: #2657A3;
    color: #fff;
}

.data-table thead th {
    padding: 8px 10px;
    text-align: center;
    font-weight: 600;
    white-space: nowrap;
    border: 1px solid #1C417A;
}

.data-table .sort-btn {
    background: none;
    border: none;
    color: inherit;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    padding: 0;
}

.data-table .sort-btn:hover,
.data-table .sort-btn:focus {
    text-decoration: underline;
    outline: none;
}

.data-table thead tr:first-child th {
    background-color: #1C417A;
}

.data-table tbody td {
    padding: 6px 10px;
    text-align: center;
    border: 1px solid #dee2e6;
}

.data-table tbody tr:nth-child(even) {
    background-color: #f8f9fa;
}

.data-table tbody tr:hover {
    background-color: #e9ecef;
}

.data-table tbody tr.total-row {
    background-color: #2657A3;
    color: #fff;
    font-weight: 700;
}

.data-table tbody tr.total-row td {
    border-color: #1C417A;
}

.data-table tbody tr.gestion-sale-row--validated {
    background-color: #dcfce7;
}

.data-table tbody tr.gestion-sale-row--pending {
    background-color: #fee2e2;
}

.data-table tbody tr.gestion-sale-row--validated:hover {
    background-color: #bbf7d0;
}

.data-table tbody tr.gestion-sale-row--pending:hover {
    background-color: #fecaca;
}


#commercialCompensationSummary .comp-row--estimated {
    background-color: #ffedd5;
    color: #7c2d12;
    font-weight: 700;
}

#commercialCompensationSummary .comp-row--real {
    background-color: #2657A3;
    color: #fff;
    font-weight: 700;
}

#commercialCompensationSummary .comp-row--real td {
    border-color: #1C417A;
}

.data-table .team-name {
    text-align: left;
    font-weight: 600;
    white-space: nowrap;
}

.data-table .col-day-header {
    background-color: #2F6CCB;
}

/* Séparateurs visuels plus marqués entre les jours (page /mon-magasin) */
#tableCA thead tr:first-child .col-day-header,
#tableRDV thead tr:first-child .col-day-header,
#tableContacts thead tr:first-child .col-day-header {
    border-left-width: 3px;
    border-right-width: 3px;
}

#tableCA thead tr:last-child th:nth-child(4n + 1),
#tableRDV thead tr:last-child th:nth-child(4n + 1) {
    border-left-width: 3px;
}

#tableCA thead tr:last-child th:nth-child(4n),
#tableRDV thead tr:last-child th:nth-child(4n) {
    border-right-width: 3px;
}

#tableCA tbody td:nth-child(4n + 2),
#tableRDV tbody td:nth-child(4n + 2) {
    border-left-width: 3px;
}

#tableCA tbody td:nth-child(4n + 1),
#tableRDV tbody td:nth-child(4n + 1) {
    border-right-width: 3px;
}

#tableContacts thead tr:last-child th:nth-child(8n + 1) {
    border-left-width: 3px;
}

#tableContacts thead tr:last-child th:nth-child(8n) {
    border-right-width: 3px;
}

#tableContacts tbody td:nth-child(8n + 2) {
    border-left-width: 3px;
}

#tableContacts tbody td:nth-child(8n + 1) {
    border-right-width: 3px;
}

.data-table input[type="number"],
.data-table input[type="text"] {
    width: 60px;
    padding: 4px 6px;
    border: 1px solid #ddd;
    border-radius: 3px;
    text-align: center;
    font-size: 13px;
}

.data-table input:focus {
    outline: none;
    border-color: #2657A3;
}

.data-table .input-montant {
    width: 80px;
}

.gestion-ventes-table input[data-field="client_name"] {
    width: 180px;
}

.gestion-ventes-table input[data-field="montant"] {
    width: 120px;
}

.objectifs-table input[type="number"] {
    width: 110px;
    padding: 8px 10px;
    font-size: 14px;
}

/* Summary Table */
.summary-section {
    margin-top: 30px;
}

.summary-table {
    width: auto;
    min-width: 600px;
}

.summary-table thead th {
    padding: 10px 16px;
}

.summary-table tbody td {
    padding: 8px 16px;
}

/* Tabs */
.tabs {
    display: flex;
    gap: 0;
    margin-bottom: 0;
    border-bottom: 2px solid #2657A3;
}

.tab-btn {
    padding: 10px 24px;
    background: #f0f4f8;
    border: 1px solid #ddd;
    border-bottom: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: #666;
    border-radius: 6px 6px 0 0;
    transition: background-color 0.2s, color 0.2s;
    margin-right: 2px;
}

.tab-btn:hover {
    background: #e0e7f0;
}

.tab-btn.active {
    background: #2657A3;
    color: #fff;
    border-color: #2657A3;
}

.tab-content {
    display: none;
    padding: 20px 0;
}

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

/* Admin Page */
.admin-section {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 24px;
    margin-bottom: 24px;
}

.admin-section h3 {
    color: #1C417A;
    margin-bottom: 16px;
    font-size: 18px;
}

.user-list {
    list-style: none;
}

.user-item {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 12px 16px;
    background: #fff;
    border-radius: 6px;
    margin-bottom: 8px;
    border: 1px solid #eee;
    gap: 10px;
}

.user-item-info {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    width: 100%;
}

.user-item-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    width: 100%;
}

.user-item-actions select {
    padding: 6px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 13px;
}

.badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.badge-admin {
    background: #1C417A;
    color: #fff;
}

.badge-responsable {
    background: #2657A3;
    color: #fff;
}

.badge-adjoint {
    background: #2F6CCB;
    color: #fff;
}

.badge-commercial {
    background: #e0e7f0;
    color: #1C417A;
}

.badge-comptable {
    background: #ffc107;
    color: #000;
}

.badge-formateur {
    background: #6f42c1;
    color: #fff;
}

/* Chantier page */
.chantier-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 400px;
    text-align: center;
}

.chantier-container h2 {
    color: #1C417A;
    font-size: 28px;
    margin-bottom: 16px;
}

.chantier-container p {
    color: #666;
    font-size: 16px;
}

/* Magasin selector */
.magasin-selector {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.magasin-btn {
    padding: 8px 20px;
    border: 2px solid #2657A3;
    background: #fff;
    color: #2657A3;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.2s;
}

.magasin-btn:hover,
.magasin-btn.active {
    background: #2657A3;
    color: #fff;
}

/* Sale entry modal */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 2000;
    justify-content: center;
    align-items: center;
}

.modal-overlay.show {
    display: flex;
}

.modal {
    background: #fff;
    border-radius: 12px;
    padding: 30px;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
}

.modal-title {
    font-size: 20px;
    color: #1C417A;
    margin-bottom: 20px;
}

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

.btn-cancel {
    background: #6c757d;
    color: #fff;
}

.btn-cancel:hover {
    background: #5a6268;
}

/* Loading spinner */
.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(38,87,163,0.3);
    border-top-color: #2657A3;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-overlay {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255,255,255,0.7);
    justify-content: center;
    align-items: center;
    z-index: 10;
}

.loading-overlay.show {
    display: flex;
}

/* Responsive */
@media (max-width: 768px) {
    .header-container {
        flex-wrap: wrap;
        height: auto;
        padding: 10px 0;
        gap: 10px;
    }

    .nav-links {
        flex-wrap: wrap;
    }

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

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

    .data-table {
        font-size: 12px;
    }
}

/* Vente form inline */
.add-sale-row {
    background: #eef3fa !important;
}

.add-sale-row td {
    padding: 8px 6px !important;
}

.add-sale-row select,
.add-sale-row input {
    font-size: 12px;
    padding: 4px 6px;
    border: 1px solid #ccc;
    border-radius: 3px;
}


.commercial-vente-row--validated {
    background-color: #ecfdf3 !important;
}

.commercial-vente-row--pending {
    background-color: #fef2f2 !important;
}

.commercial-vente-row--validated:hover,
.commercial-vente-row--pending:hover {
    filter: brightness(0.98);
}

.commercial-accueil-table .inline-select {
    font-size: 12px;
    padding: 4px 6px;
    border: 1px solid #cfd6df;
    border-radius: 4px;
    background: #fff;
    width: 100%;
}

.commercial-accueil-table .inline-input {
    font-size: 12px;
    padding: 4px 6px;
    border: 1px solid #cfd6df;
    border-radius: 4px;
    background: #fff;
    width: 100%;
}

.formateur-coaching-table .inline-select {
    font-size: 12px;
    padding: 4px 6px;
    border: 1px solid #cfd6df;
    border-radius: 4px;
    background: #fff;
    width: 100%;
}

.formateur-coaching-table .inline-textarea {
    font-size: 12px;
    padding: 6px 8px;
    border: 1px solid #cfd6df;
    border-radius: 4px;
    background: #fff;
    width: 100%;
    resize: vertical;
    min-height: 72px;
    font-family: inherit;
}

.formateur-coaching-table th:nth-child(2),
.formateur-coaching-table td:nth-child(2) {
    min-width: 320px;
}

.formateur-coaching-table th:nth-child(4),
.formateur-coaching-table td:nth-child(4) {
    min-width: 440px;
}

.formateur-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
}

.formateur-summary-card {
    background: #f3f6fb;
    border: 1px solid #d8e2f1;
    border-radius: 10px;
    padding: 12px 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.formateur-summary-card span {
    color: #5b6b7f;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.formateur-summary-card strong {
    font-size: 20px;
    color: #1f2a44;
}

.formateur-debrief-cell {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.formateur-ventes-table th:nth-child(1),
.formateur-ventes-table td:nth-child(1) {
    min-width: 220px;
}

.formateur-ventes-table th:nth-child(2),
.formateur-ventes-table td:nth-child(2) {
    width: 130px;
    min-width: 130px;
}

.formateur-ventes-table th:nth-child(12),
.formateur-ventes-table td:nth-child(12) {
    min-width: 230px;
}

.formateur-ventes-table th:nth-child(13),
.formateur-ventes-table td:nth-child(13) {
    width: 110px;
    min-width: 110px;
}


.formateur-ventes-table td:nth-child(1) .inline-input,
.formateur-ventes-table td:nth-child(12) .inline-input {
    min-width: 100%;
}

/* Flash messages */
.flash-message {
    position: fixed;
    top: 80px;
    right: 20px;
    padding: 12px 24px;
    border-radius: 8px;
    z-index: 3000;
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    animation: slideIn 0.3s ease;
}

.flash-message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.flash-message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

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

/* Row highlighting for editable cells */
.editable-cell {
    cursor: pointer;
    position: relative;
}

.editable-cell:hover {
    background-color: #e0e7f0 !important;
}

/* Accueil magasin cards */
.magasin-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.magasin-card {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    border: 1px solid #dee2e6;
    transition: box-shadow 0.2s;
    position: relative;
}

.magasin-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.magasin-card h3 {
    color: #1C417A;
    margin-bottom: 12px;
    font-size: 18px;
}

.objective-badge {
    position: absolute;
    top: 16px;
    right: 16px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    background: #e9ecef;
    color: #495057;
}

.objective-badge--inline {
    position: static;
    top: auto;
    right: auto;
    padding: 2px 8px;
    font-size: 11px;
}

.objective-badge--ahead {
    background: #d4edda;
    color: #155724;
}

.objective-badge--behind {
    background: #f8d7da;
    color: #721c24;
}

.objective-badge--neutral {
    background: #e2e3e5;
    color: #41464b;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    border-bottom: 1px solid #eee;
}

.stat-label {
    color: #666;
}

.stat-value {
    font-weight: 700;
    color: #2657A3;
}

.stat-value-group {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

/* Form row */
.form-row {
    display: flex;
    gap: 12px;
}

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

.stats-filter-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.stats-filter-row label {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #334;
    font-weight: 600;
}

.stats-filter-row select {
    min-width: 220px;
}

.stats-card {
    min-width: 320px;
}

/* Stats pages alignment with Mes chiffres look */
.stats-page-content {
    margin-top: 6px;
}

.stats-cards-layout {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    align-items: stretch;
}

.stats-cards-layout .stats-card {
    background: #fff;
    border: 1px solid #dee6f2;
    border-radius: 8px;
    padding: 18px 20px;
    width: 360px;
    max-width: 100%;
    box-shadow: none;
}

.stats-cards-layout .stats-card h3 {
    margin-bottom: 14px;
    font-size: 18px;
}

.stats-cards-layout .stat-row {
    border-bottom: 1px solid #edf1f7;
    padding: 8px 0;
}

.stats-cards-layout .stat-label {
    color: #374151;
}

.stats-cards-layout .stat-value {
    color: #0047b5;
    font-weight: 700;
}

.stats-typology-title {
    margin-top: 14px;
    margin-bottom: 4px;
    color: #1C417A;
    font-weight: 700;
    font-size: 15px;
}

.stats-filter-row {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    margin-bottom: 20px;
    padding: 10px 14px;
    border: 1px solid #e5ebf5;
    border-radius: 8px;
    background: #f8fafc;
}

.stats-filter-row label {
    color: #1f2d46;
    font-weight: 600;
}

.stats-filter-row select {
    min-width: 240px;
    padding: 6px 10px;
    border: 1px solid #d5deec;
    border-radius: 4px;
    background: #fff;
}

@media (max-width: 768px) {
    .stats-cards-layout .stats-card {
        width: 100%;
    }

    .stats-filter-row select {
        min-width: 180px;
    }
}

.stats-entity-section {
    margin-bottom: 28px;
}

.stats-entity-title {
    color: #1C417A;
    margin-bottom: 12px;
    font-size: 34px;
    font-weight: 700;
}

.stats-cards-layout--4 .stats-card {
    width: min(100%, 360px);
}

.stats-cards-layout--4 .stats-card h3 {
    font-size: 28px;
}

.stats-graphs-section {
    margin-top: 24px;
}

.stats-graphs-title {
    color: #1C417A;
    margin-bottom: 12px;
    font-size: 26px;
    font-weight: 700;
}

.stats-cards-layout--3 .stats-card {
    width: min(100%, 420px);
}

.gestion-typology-card h3 {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 22px;
}

.gestion-typology-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .2px;
}

.gestion-typology-badge--chassis {
    background: #dbeafe;
    color: #1d4ed8;
}

.gestion-typology-badge--bardage {
    background: #dcfce7;
    color: #166534;
}

.gestion-typology-badge--toiture {
    background: #fee2e2;
    color: #991b1b;
}


.gestion-compensation-card h3 {
    font-size: 22px;
}

.gestion-compensation-card .stat-value {
    color: #14532d;
}


.gestion-young-tracking-card {
    width: min(100%, 420px) !important;
}

.gestion-young-tracking-list {
    display: grid;
    gap: 10px;
    margin-top: 6px;
}

.gestion-young-tracking-empty {
    color: #6b7280;
    font-size: 14px;
    border: 1px dashed #d1d9e6;
    border-radius: 8px;
    padding: 12px;
    text-align: center;
}

.gestion-young-tracking-item {
    border: 1px solid #dbe5f3;
    border-radius: 8px;
    background: #f8fbff;
    padding: 10px 12px;
}

.gestion-young-tracking-item > header {
    font-weight: 700;
    color: #1f2d46;
    margin-bottom: 8px;
}

.gestion-young-tracking-metrics {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.gestion-young-metric {
    background: #fff;
    border: 1px solid #e6edf7;
    border-radius: 6px;
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.gestion-young-metric span {
    color: #4b5563;
    font-size: 12px;
}

.gestion-young-metric strong {
    color: #14532d;
    font-size: 14px;
}

@media (max-width: 900px) {
    .gestion-young-tracking-metrics {
        grid-template-columns: 1fr;
    }
}

.gestion-commission-list {
    margin: 10px 0 0;
    padding-left: 18px;
    color: #1f2d46;
    line-height: 1.5;
}

.discount-gauge-wrap {
    position: relative;
    margin-top: 16px;
    padding-top: 8px;
}

.discount-gauge-scale {
    height: 16px;
    border-radius: 999px;
    background: linear-gradient(90deg, #27ae60 0%, #f1c40f 55%, #e74c3c 100%);
}

.discount-gauge-needle {
    position: absolute;
    top: 0;
    width: 2px;
    height: 32px;
    background: #1f2937;
    transform: translateX(-1px);
}

.discount-gauge-value {
    margin-top: 10px;
    font-size: 26px;
    font-weight: 700;
    color: #1C417A;
}

.discount-gauge-legend {
    display: flex;
    justify-content: space-between;
    color: #6b7280;
    font-size: 12px;
}

.rdv-gauge-wrap {
    margin-top: 12px;
}

.rdv-gauge-bar {
    display: flex;
    width: 100%;
    height: 18px;
    border-radius: 999px;
    overflow: hidden;
    background: #e5e7eb;
}

.rdv-gauge-part {
    height: 100%;
}

.rdv-gauge-part--r1 {
    background: #27ae60;
}

.rdv-gauge-part--r2 {
    background: #1d4ed8;
}

.rdv-gauge-legend {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-top: 10px;
    font-size: 13px;
    flex-wrap: wrap;
}

.rdv-legend-item {
    font-weight: 700;
}

.rdv-legend-item--r1 {
    color: #27ae60;
}

.rdv-legend-item--r2 {
    color: #1d4ed8;
}

.mini-chart {
    height: 180px;
    display: flex;
    align-items: flex-end;
    gap: 8px;
}

.mini-chart-item {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
}

.mini-chart-value {
    font-size: 12px;
    color: #334155;
    min-height: 16px;
}

.mini-chart-bar {
    width: 100%;
    border-radius: 8px 8px 0 0;
    background: #1C417A;
    min-height: 8px;
}

.mini-chart-bar--violet {
    background: #7c3aed;
}

.mini-chart-label {
    font-size: 12px;
    color: #374151;
    font-weight: 600;
}

@media (max-width: 1024px) {
    .stats-entity-title {
        font-size: 28px;
    }

    .stats-cards-layout--4 .stats-card h3 {
        font-size: 22px;
    }
}

/* Préparation slides */
.prep-section {
    margin-top: 26px;
}

.prep-section h2 {
    margin-bottom: 14px;
}

.prep-section h3,
.prep-section h4 {
    margin: 18px 0 10px;
}

.prep-table th,
.prep-table td {
    text-align: center;
}

.prep-table td:first-child,
.prep-table th:first-child {
    text-align: left;
}

.prep-positive {
    color: #0a7d37;
    font-weight: 600;
}

.prep-negative {
    color: #b82020;
    font-weight: 600;
}

.prep-ratio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
}