/* === shared.css === Base/reset, layout, forms, cards, sidebar, login, choice screen, print, responsive === */

/* ====== FINANCE BAR (sticky résumé TTC / Aides / RAC) ====== */
.finance-bar {
    position: sticky; top: 0; z-index: 99;
    background: white;
    border-bottom: 1px solid #e5e7eb;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    padding: 0;
    transition: transform 0.25s ease, opacity 0.25s ease;
}
.finance-bar.hidden { display: none; }
.finance-bar-inner {
    max-width: 100%; margin: 0; padding: 8px 24px;
    display: flex; align-items: stretch; gap: 6px; flex-wrap: wrap; justify-content: center;
}
.fb-item {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    padding: 4px 14px;
    border-radius: 8px;
    background: #f5f5f7;
    min-width: 90px;
}
.fb-label {
    font-size: 9px; font-weight: 600; text-transform: uppercase;
    letter-spacing: 0.5px; color: #86868b;
    white-space: nowrap;
}
.fb-value {
    font-size: 15px; font-weight: 700; color: #1d1d1f;
    white-space: nowrap; line-height: 1.3;
}
.fb-value.green { color: #16a34a; }
.fb-value.blue { color: #2563eb; }
.fb-value.orange { color: #ea580c; }
.fb-value.purple { color: #7c3aed; }
.fb-sep { width: 1px; align-self: stretch; background: #e5e7eb; margin: 0 2px; flex-shrink: 0; }
.fb-scen {
    padding: 4px 10px; border-radius: 5px; border: 1px solid #d1d5db;
    background: #f9fafb; font-size: 11px; font-weight: 700; color: #6b7280;
    cursor: pointer; white-space: nowrap; transition: all 0.15s;
}
.fb-scen:hover { background: #e5e7eb; }
.fb-scen.active { background: #2563eb; color: white; border-color: #2563eb; }
.fb-item.fb-rac {
    background: #fff7ed;
    border: 1px solid #fed7aa;
}
.fb-editable { cursor: text; }
.fb-input {
    width: 90px; border: none; background: transparent;
    font-size: 15px; font-weight: 700; color: #1d1d1f;
    text-align: center; outline: none; padding: 0;
}
.fb-input:focus { border-bottom: 2px solid #3b82f6; }
.fb-remise-input {
    width: 48px; padding: 2px 4px; border-radius: 4px;
    border: 1px solid #e5e7eb; background: #f9fafb;
    font-size: 12px; font-weight: 600; text-align: center;
    color: #1d1d1f; outline: none;
}
.fb-remise-input:focus { border-color: #7c3aed; background: white; }
.fb-remise { background: rgba(139,92,246,0.06); border: 1px solid rgba(139,92,246,0.15); }
@media (max-width: 1024px) {
    .finance-bar { display: none !important; }
}
@media (max-width: 700px) {
    .finance-bar-inner { padding: 6px 10px; gap: 4px; }
    .fb-item { padding: 3px 8px; min-width: 70px; }
    .fb-value { font-size: 12px; }
    .fb-label { font-size: 8px; }
    .fb-sep { display: none; }
}

/* ====== DOSSIER SIDEBAR ====== */
.dossier-sidebar {
    display: none;
    position: fixed;
    left: 0;
    top: var(--header-h, 80px);
    width: 260px;
    height: calc(100vh - var(--header-h, 80px));
    background: rgba(15, 23, 42, 0.97);
    z-index: 95;
    overflow-y: auto;
    padding: 0;
    box-shadow: 4px 0 20px rgba(0,0,0,0.18);
    transition: transform 0.25s ease;
}
.dossier-sidebar.open { display: flex; flex-direction: column; }
/* Header */
.dossier-sidebar .ds-header {
    padding: 14px 16px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}
.dossier-sidebar .ds-header h3 { font-size: 15px; font-weight: 700; color: #f1f5f9; margin: 0; flex: 1; }
.ds-close-btn { background: none; border: none; font-size: 20px; cursor: pointer; color: #64748b; line-height: 1; padding: 0 4px; }
.ds-close-btn:hover { color: #f1f5f9; }
/* Search */
.dossier-sidebar .ds-search-wrap {
    padding: 10px 14px;
    flex-shrink: 0;
}
.dossier-sidebar .ds-search-wrap input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    font-size: 12px;
    box-sizing: border-box;
    background: rgba(255,255,255,0.06);
    color: #e2e8f0;
}
.dossier-sidebar .ds-search-wrap input::placeholder { color: #64748b; }
.dossier-sidebar .ds-search-wrap input:focus { border-color: #16a34a; outline: none; background: rgba(255,255,255,0.1); }
/* Category nav items */
.ds-nav-section { font-size: 10px; text-transform: uppercase; letter-spacing: 1px; color: #475569; font-weight: 700; padding: 12px 16px 4px; }
.ds-nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 16px;
    cursor: pointer;
    color: #94a3b8;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.15s;
    border-left: 3px solid transparent;
}
.ds-nav-item:hover { background: rgba(255,255,255,0.05); color: #e2e8f0; }
.ds-nav-item.active { background: rgba(22,163,74,0.12); color: #4ade80; border-left-color: #16a34a; }
.ds-nav-icon { font-size: 15px; width: 20px; text-align: center; }
.ds-nav-badge { margin-left: auto; background: rgba(255,255,255,0.1); color: #94a3b8; font-size: 10px; padding: 1px 7px; border-radius: 10px; font-weight: 600; }
.ds-nav-item.active .ds-nav-badge { background: rgba(22,163,74,0.25); color: #4ade80; }
/* Dossier list */
.dossier-sidebar .ds-list {
    flex: 1;
    overflow-y: auto;
    padding: 6px 10px;
}
.dossier-sidebar .ds-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    margin-bottom: 3px;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s;
    border-left: 3px solid rgba(255,255,255,0.08);
}
.dossier-sidebar .ds-item:hover { background: rgba(22,163,74,0.08); border-color: rgba(22,163,74,0.2); }
.dossier-sidebar .ds-item .ds-name { font-weight: 600; font-size: 12px; color: #e2e8f0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dossier-sidebar .ds-item .ds-meta { font-size: 10px; color: #64748b; display: flex; gap: 6px; flex-wrap: wrap; margin-top: 2px; }
.dossier-sidebar .ds-item .ds-type { padding: 1px 6px; border-radius: 3px; font-size: 9px; font-weight: 700; color: #fff; flex-shrink: 0; }
.dossier-sidebar .ds-item .ds-status { font-size: 10px; flex-shrink: 0; }
/* Folder button in header */
.ds-folder-btn {
    background: none;
    border: 1px solid #d2d2d7;
    border-radius: 6px;
    cursor: pointer;
    padding: 4px 8px;
    font-size: 16px;
    line-height: 1;
    color: #6b7280;
    transition: all 0.15s;
}
.ds-folder-btn:hover { background: #f0fdf4; border-color: #16a34a; }
.ds-folder-btn.active { background: #16a34a; border-color: #16a34a; }
/* Overlay always visible when sidebar open */
.ds-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.35);
    z-index: 94;
}
body.ds-open .ds-overlay { display: block; }
@media (max-width: 1024px) {
    .dossier-sidebar { width: 280px; }
}

/* ====== E-SIGNATURE MODAL ====== */
.esign-overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.7); z-index: 100000; display: flex; align-items: center; justify-content: center; animation: esignFadeIn 0.3s ease; }
@keyframes esignFadeIn { from { opacity: 0; } to { opacity: 1; } }
.esign-modal { background: white; border-radius: 16px; width: 95%; max-width: 540px; max-height: 90vh; overflow-y: auto; box-shadow: 0 20px 60px rgba(0,0,0,0.3); }
.esign-header { padding: 20px 24px; border-bottom: 1px solid #e5e7eb; display: flex; align-items: center; justify-content: space-between; }
.esign-header h3 { font-size: 18px; font-weight: 800; color: #111827; margin: 0; }
.esign-close { width: 36px; height: 36px; border-radius: 50%; border: none; background: #f3f4f6; cursor: pointer; font-size: 18px; display: flex; align-items: center; justify-content: center; color: #6b7280; transition: all 0.2s; }
.esign-close:hover { background: #e5e7eb; color: #111; }
.esign-body { padding: 24px; }
.esign-step { margin-bottom: 20px; }
.esign-step-label { font-size: 12px; font-weight: 700; color: #6b7280; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 8px; }
.esign-canvas-wrap { border: 2px solid #d1d5db; border-radius: 12px; overflow: hidden; background: #fafafa; position: relative; }
.esign-canvas-wrap.active { border-color: #3b82f6; box-shadow: 0 0 0 3px rgba(59,130,246,0.15); }
.esign-canvas { width: 100%; height: 150px; cursor: crosshair; touch-action: none; }
.esign-canvas-placeholder { position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); color: #9ca3af; font-size: 14px; pointer-events: none; }
.esign-clear-btn { margin-top: 8px; padding: 6px 14px; border-radius: 8px; border: 1px solid #d1d5db; background: white; color: #374151; font-size: 12px; font-weight: 600; cursor: pointer; transition: all 0.2s; }
.esign-clear-btn:hover { background: #f9fafb; border-color: #9ca3af; }
.esign-info { font-size: 12px; color: #6b7280; line-height: 1.5; margin-top: 6px; }
.esign-footer { padding: 16px 24px; border-top: 1px solid #e5e7eb; display: flex; gap: 10px; justify-content: flex-end; }
.esign-btn { padding: 10px 20px; border-radius: 10px; font-size: 14px; font-weight: 700; cursor: pointer; transition: all 0.2s; border: none; }
.esign-btn-cancel { background: #f3f4f6; color: #374151; }
.esign-btn-cancel:hover { background: #e5e7eb; }
.esign-btn-sign { background: linear-gradient(135deg, #1e40af, #3b82f6); color: white; box-shadow: 0 4px 12px rgba(59,130,246,0.3); }
.esign-btn-sign:hover { box-shadow: 0 6px 16px rgba(59,130,246,0.4); transform: translateY(-1px); }
.esign-status { display: flex; align-items: center; gap: 8px; padding: 12px 16px; border-radius: 10px; font-size: 13px; font-weight: 600; margin-top: 12px; }
.esign-status.pending { background: #fef3c7; color: #92400e; border: 1px solid #fcd34d; }
.esign-status.signed { background: #d1fae5; color: #065f46; border: 1px solid #6ee7b7; }

* {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

body {
            overflow-x: hidden;
            max-width: 100vw;
        }

body {
            font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
            background: #f5f5f7;
            color: #1d1d1f;
            line-height: 1.6;
        }

/* === BANDEAU INFO 2026 === */

.info-banner-2026 {
            background: linear-gradient(135deg, #14532d 0%, #166534 50%, #15803d 100%);
            color: white;
            padding: 10px 20px;
            font-size: 13px;
            text-align: center;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 8px;
            flex-wrap: wrap;
        }

.info-banner-2026 strong { color: #86efac; }

.info-banner-2026 .separator-dot { opacity: 0.4; margin: 0 4px; }

/* === AUTO-DETECTION REVENUS === */

.revenus-section {
            background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
            border: 1px solid #bbf7d0;
            border-radius: 12px;
            padding: 16px;
            margin-bottom: 16px;
            transition: all 0.3s ease;
        }

.revenus-toggle {
            display: flex;
            align-items: center;
            justify-content: space-between;
            cursor: pointer;
            user-select: none;
        }

.revenus-toggle h3 {
            font-size: 14px;
            font-weight: 600;
            color: #16a34a;
            display: flex;
            align-items: center;
            gap: 8px;
            margin: 0;
        }

.revenus-toggle .toggle-arrow {
            transition: transform 0.3s ease;
            font-size: 12px;
            color: #16a34a;
        }

.revenus-toggle .toggle-arrow.open { transform: rotate(180deg); }

.revenus-body {
            max-height: 0;
            overflow: hidden;
            transition: max-height 0.4s ease, padding 0.3s ease;
            padding-top: 0;
        }

.revenus-body.open {
            max-height: 500px;
            padding-top: 14px;
        }

.revenus-grid {
            display: grid;
            grid-template-columns: 1fr 1fr 1fr;
            gap: 10px;
        }

@media (max-width: 600px) {
            .revenus-grid { grid-template-columns: 1fr; }
        }

.revenus-grid label {
            font-size: 12px;
            font-weight: 500;
            color: #475569;
            margin-bottom: 4px;
            display: block;
        }

.revenus-grid select, .revenus-grid input {
            width: 100%;
            padding: 8px 10px;
            border: 1px solid #cbd5e1;
            border-radius: 8px;
            font-size: 13px;
            background: white;
            transition: border-color 0.2s;
        }

.revenus-grid select:focus, .revenus-grid input:focus {
            border-color: #16a34a;
            outline: none;
            box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.1);
        }

.profil-result {
            margin-top: 12px;
            padding: 10px 14px;
            border-radius: 10px;
            font-size: 13px;
            font-weight: 600;
            text-align: center;
            display: none;
            animation: fadeSlide 0.3s ease;
        }

@keyframes fadeSlide {
            from { opacity: 0; transform: translateY(-5px); }
            to { opacity: 1; transform: translateY(0); }
        }

.profil-result.show { display: block; }

.profil-result.profil-bleu {
            background: linear-gradient(135deg, #dbeafe, #bfdbfe);
            color: #1e40af;
            border: 1px solid #93c5fd;
        }

.profil-result.profil-jaune {
            background: linear-gradient(135deg, #fef9c3, #fef08a);
            color: #92400e;
            border: 1px solid #fcd34d;
        }

.profil-result.profil-violet {
            background: linear-gradient(135deg, #ede9fe, #ddd6fe);
            color: #5b21b6;
            border: 1px solid #c4b5fd;
        }

.profil-result.profil-rose {
            background: linear-gradient(135deg, #fce7f3, #fbcfe8);
            color: #9d174d;
            border: 1px solid #f9a8d4;
        }

/* === CEE DETAIL SECTION === */

.cee-section {
            background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
            border: 1px solid #93c5fd;
            border-radius: 12px;
            padding: 16px;
            margin-bottom: 16px;
            transition: all 0.3s ease;
        }

.cee-toggle {
            display: flex;
            align-items: center;
            justify-content: space-between;
            cursor: pointer;
            user-select: none;
        }

.cee-toggle h3 {
            font-size: 14px;
            font-weight: 600;
            color: #2563eb;
            display: flex;
            align-items: center;
            gap: 8px;
            margin: 0;
        }

.cee-toggle .toggle-arrow {
            transition: transform 0.3s ease;
            font-size: 12px;
            color: #2563eb;
        }

.cee-toggle .toggle-arrow.open { transform: rotate(180deg); }

.cee-body {
            max-height: 0;
            overflow: hidden;
            transition: max-height 0.5s ease, padding 0.3s ease;
            padding-top: 0;
        }

.cee-body.open {
            max-height: 800px;
            padding-top: 14px;
        }

.cee-grid {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 10px;
        }

@media (max-width: 600px) {
            .cee-grid { grid-template-columns: 1fr; }
        }

.cee-grid label {
            font-size: 12px;
            font-weight: 500;
            color: #475569;
            margin-bottom: 4px;
            display: block;
        }

.cee-grid select, .cee-grid input {
            width: 100%;
            padding: 8px 10px;
            border: 1px solid #cbd5e1;
            border-radius: 8px;
            font-size: 13px;
            background: white;
            transition: border-color 0.2s;
        }

.cee-grid select:focus, .cee-grid input:focus {
            border-color: #2563eb;
            outline: none;
            box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
        }

.cee-result {
            margin-top: 12px;
            padding: 12px 16px;
            border-radius: 10px;
            font-size: 13px;
            text-align: center;
            display: none;
            animation: fadeSlide 0.3s ease;
            background: linear-gradient(135deg, #dbeafe, #bfdbfe);
            color: #1e40af;
            border: 1px solid #93c5fd;
        }

.cee-result.show { display: block; }

.cee-hint {
            font-size: 11px;
            color: #6b7280;
            margin-top: 4px;
        }

.cee-bloc-171, .cee-bloc-148 {
            transition: all 0.3s ease;
        }

.cee-hidden { display: none !important; }

/* Isolation state radio buttons */

.g-radio {
            display: flex; align-items: flex-start; gap: 12px; padding: 14px 16px;
            border: 1.5px solid #e2e8f0; border-radius: 10px; cursor: pointer;
            transition: all 0.15s ease; font-size: 13px; background: white;
        }

.g-radio:hover { border-color: #a3cfbb; background: #f8fdfb; }

.g-radio.selected { border-color: #16a34a; background: #f0fdf4; }

.g-radio input[type="radio"] { accent-color: #16a34a; margin: 3px 0 0 0; width: 18px; height: 18px; flex-shrink: 0; }

.g-label { flex: 1; }

.g-label-title { font-weight: 600; color: #1d1d1f; font-size: 13px; }

.g-label-sub { font-size: 11px; color: #94a3b8; margin-top: 2px; }

.g-value { display: none; }

/* Dim form */

/* Confort slider */

/* ===== PRODUIT & OPTIONS ===== */

/* Custom searchable PAC dropdown */

/* Isolation checklist */

.iso-check {
            display: flex; align-items: center; gap: 10px; padding: 10px 14px;
            border: 1.5px solid #e2e8f0; border-radius: 8px; cursor: pointer;
            transition: all 0.15s ease; background: white;
        }

.iso-check:hover { border-color: #a3cfbb; background: #f8fdfb; }

.iso-check:has(input:checked) { border-color: #16a34a; background: #f0fdf4; }

.iso-check input[type="checkbox"] { accent-color: #16a34a; width: 18px; height: 18px; flex-shrink: 0; cursor: pointer; }

.iso-info { flex: 1; }

.iso-title { font-weight: 600; color: #1d1d1f; font-size: 13px; display: block; }

.iso-sub { font-size: 11px; color: #94a3b8; }

.iso-quand {
            padding: 4px 8px; border: 1px solid #e2e8f0; border-radius: 6px; font-size: 11px;
            color: #64748b; background: #f8fafc; display: none; cursor: pointer;
        }

.iso-check:has(input:checked) .iso-quand { display: block; }

.cee-kpi-row {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 8px;
            margin-top: 12px;
        }

.cee-kpi {
            background: white;
            border: 1px solid #e2e8f0;
            border-radius: 8px;
            padding: 10px 12px;
            text-align: center;
        }

.cee-kpi .kpi-label {
            font-size: 11px;
            color: #64748b;
            text-transform: uppercase;
            letter-spacing: 0.5px;
            margin-bottom: 4px;
        }

.cee-kpi .kpi-value {
            font-size: 16px;
            font-weight: 700;
            color: #1e40af;
        }

.cee-kpi .kpi-value.green { color: #16a34a; }

.cee-kpi .kpi-detail {
            font-size: 10px;
            color: #94a3b8;
            margin-top: 2px;
            font-family: ui-monospace, monospace;
        }

.header {
            background: white;
            padding: 20px 0;
            box-shadow: 0 2px 10px rgba(0,0,0,0.05);
            position: sticky;
            top: 0;
            z-index: 100;
        }

.header-content {
            display: flex;
            justify-content: space-between;
            align-items: center;
        }

.container {
            max-width: 100%;
            margin: 0;
            padding: 0 20px;
        }

.header h1 {
            font-size: 24px;
            font-weight: 600;
        }

.btn-apply {
            flex: 1;
            background: #0071e3;
            color: white;
            border: none;
            padding: 12px;
            border-radius: 8px;
            font-size: 14px;
            font-weight: 500;
            cursor: pointer;
            transition: all 0.2s;
        }

.btn-apply:hover {
            background: #0077ed;
        }

.btn-close-modal {
            background: #f5f5f7;
            color: #1d1d1f;
            border: none;
            padding: 12px 24px;
            border-radius: 8px;
            font-size: 14px;
            font-weight: 500;
            cursor: pointer;
            transition: all 0.2s;
        }

.btn-close-modal:hover {
            background: #e8e8ed;
        }

.main-content {
            display: grid;
            grid-template-columns: 1fr;
            gap: 0;
            padding: 0;
            max-width: 100%;
            margin: 0;
        }

.main-content > .parameters-section {
            padding: 20px 16px;
            width: 100%;
            box-sizing: border-box;
        }

@media (min-width: 1441px) {
            .main-content > .parameters-section {
                padding: 12px 20px;
            }
        }

.card {
            background: white;
            border-radius: 12px;
            padding: 20px;
            box-shadow: 0 2px 16px rgba(0,0,0,0.08);
            min-width: 0;
            overflow: hidden;
        }

.card-title {
            font-size: 12px;
            font-weight: 600;
            color: #86868b;
            text-transform: uppercase;
            letter-spacing: 0.5px;
            margin-bottom: 16px;
        }

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

.form-group label {
            display: block;
            font-size: 12px;
            font-weight: 500;
            margin-bottom: 5px;
            color: #1d1d1f;
        }

.form-group small {
            display: block;
            font-size: 12px;
            color: #86868b;
            margin-top: 4px;
        }

select, input[type="number"], input[type="text"] {
            width: 100%;
            padding: 10px 14px;
            border: 1px solid #d2d2d7;
            border-radius: 8px;
            font-size: 15px;
            background: white;
            transition: all 0.2s;
        }

select:focus, input:focus {
            outline: none;
            border-color: #0071e3;
            box-shadow: 0 0 0 4px rgba(0,113,227,0.1);
        }

.fournisseur-only {
            display: none;
        }

/* Sidebar card groups need higher specificity to override .sidebar-card-group { display: flex } */

.sidebar-card-group.fournisseur-only {
            display: none;
        }

.fournisseur-mode .fournisseur-only {
            display: block;
        }
.fournisseur-mode .fb-item.fournisseur-only {
            display: flex;
        }

.fournisseur-mode .sidebar-card-group.fournisseur-only {
            display: flex;
        }

.fournisseur-mode .ttc-readonly {
            display: none !important;
        }

.client-only {
            display: block;
        }

.fournisseur-mode .client-only {
            display: none;
        }

/* Telepro mode: like fournisseur but hides marge, dimensionnement, photo */

.telepro-mode .fournisseur-only {
            display: block;
        }

.telepro-mode .sidebar-card-group.fournisseur-only {
            display: flex;
        }

.telepro-mode .ttc-readonly {
            display: none !important;
        }

.telepro-mode .client-only {
            display: none;
        }

.telepro-mode .telepro-hide {
            display: none !important;
        }

/* Telepro script panel — visible only in telepro mode */

.telepro-only { display: none !important; }

.telepro-mode .telepro-only { display: block !important; }

#teleproPanel {
            background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
            border: 1px solid rgba(96,165,250,0.18);
            border-radius: 14px;
            padding: 16px;
            margin-bottom: 16px;
        }

#teleproPanel h3 {
            color: #60a5fa;
            font-size: 15px;
            font-weight: 800;
            margin: 0 0 12px 0;
            display: flex;
            align-items: center;
            gap: 8px;
        }

.tp-step {
            background: rgba(255,255,255,0.04);
            border: 1px solid rgba(255,255,255,0.08);
            border-radius: 10px;
            margin-bottom: 6px;
            overflow: hidden;
            transition: all 0.2s;
        }

.tp-step.done { border-color: rgba(52,211,153,0.3); }

.tp-step.active { border-color: rgba(96,165,250,0.5); background: rgba(96,165,250,0.06); }

.tp-step-head {
            display: flex;
            align-items: center;
            gap: 8px;
            padding: 10px 12px;
            cursor: pointer;
            user-select: none;
            font-size: 13px;
            font-weight: 600;
            color: #e2e8f0;
        }

.tp-step-head:hover { background: rgba(255,255,255,0.04); }

.tp-step-num {
            width: 22px; height: 22px;
            border-radius: 50%;
            background: rgba(96,165,250,0.15);
            color: #60a5fa;
            font-size: 11px;
            font-weight: 800;
            display: flex;
            align-items: center;
            justify-content: center;
            flex-shrink: 0;
        }

.tp-step.done .tp-step-num { background: rgba(52,211,153,0.2); color: #34d399; }

.tp-step.active .tp-step-num { background: #3b82f6; color: #fff; }

.tp-step-body {
            display: none;
            padding: 0 12px 12px 42px;
        }

.tp-step.active .tp-step-body { display: block; }

.tp-script-text {
            font-size: 12.5px;
            color: #94a3b8;
            line-height: 1.5;
            margin-bottom: 10px;
            font-style: italic;
            background: rgba(0,0,0,0.2);
            border-radius: 8px;
            padding: 8px 10px;
            border-left: 3px solid #3b82f6;
        }

.tp-script-text b { color: #e2e8f0; font-style: normal; }

.tp-fields {
            display: flex;
            flex-wrap: wrap;
            gap: 6px;
        }

.tp-fields label {
            font-size: 11px;
            color: #94a3b8;
            display: block;
            margin-bottom: 2px;
        }

.tp-fields input, .tp-fields select {
            background: rgba(255,255,255,0.06);
            border: 1px solid rgba(255,255,255,0.12);
            border-radius: 6px;
            color: #e2e8f0;
            padding: 6px 8px;
            font-size: 12px;
            width: 100%;
        }

.tp-field { flex: 1; min-width: 120px; }

#sResultBadge {
            display: none;
            padding: 10px 12px;
            border-radius: 8px;
            font-size: 13px;
            font-weight: 700;
            text-align: center;
            margin-top: 6px;
        }

/* ===== DASHBOARD ADMIN ===== */

.dash-kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 18px; }

.dash-kpi {
            background: linear-gradient(135deg, #f8fafc, #f1f5f9);
            border: 1px solid #e2e8f0;
            border-radius: 12px;
            padding: 14px 12px;
            text-align: center;
        }

.dash-kpi-icon { font-size: 22px; margin-bottom: 4px; }

.dash-kpi-value { font-size: 26px; font-weight: 900; color: #0f172a; line-height: 1.1; }

.dash-kpi-label { font-size: 11px; color: #64748b; font-weight: 600; margin-top: 2px; text-transform: uppercase; letter-spacing: 0.5px; }

.dash-kpi.blue { border-bottom: 3px solid #3b82f6; }

.dash-kpi.green { border-bottom: 3px solid #22c55e; }

.dash-kpi.orange { border-bottom: 3px solid #f59e0b; }

.dash-kpi.purple { border-bottom: 3px solid #8b5cf6; }

.dash-section { margin-bottom: 18px; }

.dash-section-title { font-size: 13px; font-weight: 800; color: #334155; margin-bottom: 8px; display: flex; align-items: center; gap: 6px; }

.dash-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }

.dash-table th { text-align: left; padding: 8px 10px; background: #f8fafc; color: #64748b; font-weight: 700; font-size: 10px; text-transform: uppercase; letter-spacing: 0.5px; border-bottom: 2px solid #e2e8f0; }

.dash-table td { padding: 8px 10px; border-bottom: 1px solid #f1f5f9; color: #1e293b; }

.dash-table tr:hover td { background: #f8fafc; }

.dash-table .td-name { font-weight: 700; }

.dash-table .td-bar { width: 40%; }

.dash-table .td-num { text-align: center; font-weight: 600; }

.dash-table .td-pct { text-align: center; font-weight: 800; }

.dash-bar-wrap { background: #e2e8f0; border-radius: 4px; height: 18px; overflow: hidden; position: relative; }

.dash-bar-fill { height: 100%; border-radius: 4px; transition: width 0.4s ease; }

.dash-bar-fill.green { background: linear-gradient(90deg, #22c55e, #16a34a); }

.dash-bar-fill.blue { background: linear-gradient(90deg, #3b82f6, #2563eb); }

.dash-bar-fill.orange { background: linear-gradient(90deg, #f59e0b, #d97706); }

.dash-bar-label { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); font-size: 10px; font-weight: 700; color: #475569; }

.dash-row { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }

.dash-row-label { width: 50px; font-size: 12px; font-weight: 700; color: #475569; text-align: right; }

.dash-row-bar { flex: 1; }

.dash-row-val { width: 36px; font-size: 12px; font-weight: 700; color: #1e293b; }

.dash-filter { display: flex; gap: 4px; }

.dash-filter button { padding: 4px 10px; font-size: 11px; font-weight: 600; border: 1px solid #d1d5db; border-radius: 6px; background: white; color: #64748b; cursor: pointer; }

.dash-filter button.active { background: #0f172a; color: white; border-color: #0f172a; }

.dossier-status-badge { display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 10px; font-weight: 700; }

.dossier-status-badge.brouillon { background: #fef3c7; color: #92400e; }

.dossier-status-badge.envoye { background: #dbeafe; color: #1e40af; }

.dossier-status-badge.attente_signature { background: #fef3c7; color: #d97706; border: 1px solid #fbbf24; }

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

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

.dossier-status-select {
            padding: 3px 6px; font-size: 11px; border: 1px solid #d1d5db; border-radius: 6px;
            background: white; cursor: pointer; font-weight: 600; color: #334155;
        }

@media (max-width: 600px) { .dash-kpi-grid { grid-template-columns: repeat(2, 1fr); } }

.results-sidebar {
            position: sticky;
            top: var(--header-h, 80px);
            z-index: 90;
            order: -1;
            width: 100%;
            grid-column: 1 / -1;
        }

.results-sidebar .summary-card {
            border-radius: 0;
            margin-bottom: 0;
            padding: 8px 16px;
        }

/* Desktop: horizontal layout */

@media (min-width: 1025px) {
            .results-sidebar .summary-card > .scenario-label-dark { margin-bottom: 6px; font-size: 11px; padding: 4px 10px; }
            /* Row 1: all metrics + actions in one row */
            .sidebar-row1 {
                display: flex;
                flex-wrap: wrap;
                gap: 10px;
                align-items: center;
            }
            .sidebar-card-group {
                display: flex;
                flex-direction: column;
                align-items: center;
                gap: 3px;
            }
            .sidebar-row1 .result-row-card,
            .sidebar-row1 .result-highlight-card {
                margin-bottom: 0;
                padding: 6px 16px;
                flex: 0 1 auto;
                flex-direction: column;
                justify-content: center;
                align-items: center;
                gap: 2px;
            }
            .sidebar-row1 .rrc-label, .sidebar-row1 .rhc-label { font-size: 9px; letter-spacing: 0.5px; }
            .sidebar-row1 .rrc-value { font-size: 14px !important; white-space: nowrap; }
            .sidebar-row1 .rhc-value { font-size: 14px; }
            .sidebar-row1-rac .result-row-card {
                padding: 6px 18px !important;
                border: 1px solid rgba(251,191,36,0.4) !important;
            }
            .sidebar-row1-rac .rrc-value { font-size: 18px !important; font-weight: 800 !important; }
            /* Checkbox inside card — top-right corner */
            .sidebar-card-check {
                position: absolute;
                top: 3px;
                right: 3px;
                display: flex;
                align-items: center;
                justify-content: center;
                z-index: 2;
            }
            .sidebar-card-check input[type="checkbox"] {
                width: 11px; height: 11px; accent-color: #22c55e; cursor: pointer; margin: 0;
            }
            /* Card needs relative for checkbox positioning */
            .sidebar-row1 .result-row-card { position: relative; }
            /* TTC editable card visual cue */
            .ttc-editable-active .rrc-value {
                border: 1.5px solid rgba(96,165,250,0.6);
                border-radius: 6px;
                padding: 2px 8px;
                background: rgba(96,165,250,0.08);
                cursor: text !important;
            }
            .ttc-editable-locked .rrc-value { cursor: default !important; }
            /* Remise inputs inside result-row-card */
            .sidebar-row1 .remise-inputs { display: flex; align-items: center; gap: 4px; }
            .sidebar-row1 .remise-inputs input[type="number"] {
                width: 64px; padding: 3px 4px; border-radius: 5px;
                border: 1px solid rgba(255,255,255,0.15); background: rgba(255,255,255,0.06);
                color: #e2e8f0; font-size: 14px; text-align: center; font-weight: 700;
            }
            .sidebar-row1 .remise-unit { font-size: 12px; color: rgba(255,255,255,0.5); font-weight: 700; }
            .sidebar-row1 .remise-max { font-size: 8px; color: #34d399; }
            /* Action buttons */
            .sidebar-action-btn {
                padding: 7px 14px;
                border-radius: 8px;
                border: none;
                font-size: 11px;
                font-weight: 700;
                cursor: pointer;
                white-space: nowrap;
                display: flex;
                align-items: center;
                gap: 4px;
                height: 32px;
            }
            .sidebar-btn-devis { background: #16a34a; color: #fff; }
            .sidebar-btn-devis:hover { background: #15803d; }
            .sidebar-btn-ptz { background: linear-gradient(135deg, #006B3F, #2E9D5E); color: #fff; }
            .sidebar-btn-ptz:hover { opacity: 0.9; }
            .sidebar-btn-sign { background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.12) !important; color: #94a3b8; }
            .sidebar-btn-sign:hover { background: rgba(255,255,255,0.12); color: #e2e8f0; }
            /* Financement toggle */
            .sidebar-toggle-btn {
                background: rgba(255,255,255,0.08);
                border: 1px solid rgba(255,255,255,0.12);
                color: #94a3b8;
                padding: 7px 14px;
                border-radius: 8px;
                font-size: 11px;
                cursor: pointer;
                white-space: nowrap;
                height: 32px;
                display: flex;
                align-items: center;
            }
            .sidebar-toggle-btn:hover { background: rgba(255,255,255,0.12); color: #e2e8f0; }
            .sidebar-details { display: none; }
            .sidebar-details.open { display: block; padding-top: 8px; border-top: 1px solid rgba(255,255,255,0.08); margin-top: 6px; }
        }

/* Hide sidebar scenario buttons on mobile, show mobile ones */

@media (min-width: 1025px) {
            #mobileScenarioBtns { display: none !important; }
            #mobileStickyKpi { display: none !important; }
        }

/* Mobile sticky KPI bar */

@media (max-width: 1024px) {
            #mobileStickyKpi {
                position: relative;
                z-index: 89;
                background: #0f172a;
                padding: 8px 12px 10px;
                border-bottom: 1px solid rgba(255,255,255,0.08);
            }
            #mobileScenarioLabel {
                font-size: 11px;
                color: rgba(255,255,255,0.6);
                padding: 2px 10px;
                background: rgba(255,255,255,0.06);
                border-radius: 20px;
                display: inline-block;
                margin-bottom: 6px;
            }
            #mobileStickyKpi #mobileScenarioBtns {
                display: flex !important;
                margin-bottom: 6px;
            }
            #mobileKpiRow {
                display: flex;
                gap: 6px;
            }
            .mkpi {
                flex: 1;
                background: rgba(255,255,255,0.06);
                border: 1px solid rgba(255,255,255,0.08);
                border-radius: 8px;
                padding: 4px 6px;
                text-align: center;
            }
            .mkpi-label { font-size: 9px; color: rgba(255,255,255,0.45); display: block; text-transform: uppercase; letter-spacing: 0.3px; }
            .mkpi-value { font-size: 14px; font-weight: 700; color: #f1f5f9; }
            .mkpi-green { color: #34d399; }
            .mkpi-yellow { color: #fbbf24; }
            #mobileKpiRow2 {
                display: flex;
                gap: 6px;
                margin-top: 6px;
            }
            #mobileKpiRow2 .mkpi {
                flex: 1;
            }
        }

/* Mobile: after content, vertical */

@media (max-width: 1024px) {
            .results-sidebar {
                position: static;
                order: 1;
            }
            .results-sidebar .summary-card {
                border-radius: 16px;
                padding: 24px;
                margin: 10px;
            }
            .sidebar-row1 { display: block; }
            .sidebar-card-group { margin-bottom: 10px; width: 100%; display: block !important; }
            .sidebar-card-group.fournisseur-only { display: none !important; }
            .fournisseur-mode .sidebar-card-group.fournisseur-only { display: block !important; }
            .telepro-mode .sidebar-card-group.fournisseur-only { display: block !important; }
            .fournisseur-mode .sidebar-card-group.client-only { display: none !important; }
            .telepro-mode .sidebar-card-group.client-only { display: none !important; }
            .sidebar-row1 .result-row-card { width: 100% !important; flex-direction: row !important; justify-content: space-between !important; align-items: center !important; padding: 12px 16px !important; box-sizing: border-box !important; }
            .sidebar-card-check { position: absolute; top: 4px; right: 4px; display: flex; }
            .sidebar-card-check input[type="checkbox"] { width: 14px; height: 14px; accent-color: #22c55e; cursor: pointer; }
            .sidebar-row1 .result-row-card { position: relative; }
            .remise-inputs { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
            .remise-inputs input[type="number"] {
                width: 70px; padding: 6px 8px; border-radius: 6px;
                border: 1px solid rgba(255,255,255,0.12); background: rgba(255,255,255,0.06);
                color: #e2e8f0; font-size: 13px; text-align: center; font-weight: 600;
            }
            .remise-unit { font-size: 11px; color: rgba(255,255,255,0.35); }
            .remise-max { font-size: 10px; color: #34d399; margin-top: 4px; }
            /* Geste commercial card mobile layout */
            .geste-co-card { flex-wrap: wrap !important; gap: 4px 0 !important; }
            .geste-co-card .rrc-label { width: 100%; margin-bottom: 4px; }
            .geste-co-card .geste-co-right { width: 100%; justify-content: space-between !important; }
            .sidebar-action-btn {
                display: block; width: 100%; padding: 12px; border-radius: 10px; border: none;
                font-size: 14px; font-weight: 700; cursor: pointer; text-align: center; margin-top: 8px;
            }
            .sidebar-btn-devis { background: #16a34a; color: #fff; }
            .sidebar-btn-ptz { background: linear-gradient(135deg, #006B3F, #2E9D5E); color: #fff; }
            .sidebar-btn-sign { background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.12) !important; color: #94a3b8; }
            .sidebar-details { display: block !important; }
            .sidebar-toggle-btn { display: none; }
        }

.summary-card {
            background: linear-gradient(165deg, #0f172a 0%, #1e293b 50%, #0f172a 100%);
            border-radius: 16px;
            padding: 24px;
            box-shadow: 0 8px 32px rgba(0,0,0,0.25), 0 0 0 1px rgba(255,255,255,0.05);
            margin-bottom: 16px;
            position: relative;
        }

.summary-card::before {
            content: '';
            position: absolute;
            top: 0; left: 0; right: 0;
            height: 3px;
            background: var(--scroll-gradient, linear-gradient(90deg, #34d399, #22d3ee, #818cf8));
            transition: background 0.4s ease;
        }

.result-row-card {
            background: rgba(255,255,255,0.04);
            border: 1px solid rgba(255,255,255,0.06);
            border-radius: 12px;
            padding: 14px 18px;
            margin-bottom: 10px;
            display: flex;
            justify-content: space-between;
            align-items: center;
            transition: all 0.25s ease;
            position: relative;
            overflow: hidden;
        }

.result-row-card:hover {
            background: rgba(255,255,255,0.07);
            border-color: rgba(255,255,255,0.12);
            transform: translateY(-1px);
        }

.result-row-card .rrc-label {
            font-size: 13px;
            font-weight: 500;
            color: rgba(255,255,255,0.55);
            letter-spacing: 0.3px;
        }

.result-row-card .rrc-value {
            font-size: 20px;
            font-weight: 700;
            color: #f1f5f9;
            font-variant-numeric: tabular-nums;
        }

.result-row-card .rrc-value.green { color: #34d399; }

.result-row-card .rrc-value.yellow { color: #fbbf24; }

.result-row-card .rrc-value.red { color: #f87171; }

.result-row-card .rrc-value.cyan { color: #22d3ee; }

.result-row-card .rrc-value.blue { color: #60a5fa; }

.result-highlight-card {
            background: linear-gradient(135deg, rgba(52,211,153,0.12) 0%, rgba(34,211,238,0.08) 100%);
            border: 1px solid rgba(52,211,153,0.2);
            border-radius: 14px;
            padding: 18px 22px;
            margin-bottom: 12px;
            text-align: center;
            position: relative;
        }

.result-highlight-card .rhc-label {
            font-size: 12px;
            font-weight: 600;
            color: rgba(255,255,255,0.5);
            text-transform: uppercase;
            letter-spacing: 1px;
            margin-bottom: 6px;
        }

.result-highlight-card .rhc-value {
            font-size: 34px;
            font-weight: 800;
            color: #34d399;
            text-shadow: 0 0 30px rgba(52,211,153,0.3);
        }

.glow-separator {
            height: 2px;
            margin: 16px 0;
            border-radius: 2px;
            background: var(--scroll-gradient, linear-gradient(90deg, #34d399, #22d3ee, #818cf8));
            opacity: 0.4;
            transition: opacity 0.3s, background 0.6s;
        }

.glow-separator:hover { opacity: 0.7; }

.dark-section-title {
            font-size: 11px;
            font-weight: 700;
            color: rgba(255,255,255,0.35);
            text-transform: uppercase;
            letter-spacing: 1.5px;
            margin-bottom: 12px;
            padding-left: 2px;
        }

.scenario-label-dark {
            font-size: 13px;
            color: rgba(255,255,255,0.8);
            margin-bottom: 18px;
            padding: 12px 16px;
            background: rgba(255,255,255,0.05);
            border-radius: 10px;
            border-left: 3px solid #34d399;
            line-height: 1.5;
            transition: border-color 0.4s;
        }

.scenario-label-dark strong { font-weight: 600; color: #f1f5f9; }

.scenario-label-dark .separator { color: rgba(255,255,255,0.3); margin: 0 8px; }

.rac-dark-section {
            background: rgba(255,255,255,0.03);
            border: 1px solid rgba(255,255,255,0.06);
            border-radius: 12px;
            padding: 16px;
        }

.rac-dark-section .amount-label {
            color: rgba(255,255,255,0.45);
        }

.rac-dark-section input[type="number"] {
            background: rgba(255,255,255,0.06);
            border: 1px solid rgba(255,255,255,0.12);
            color: #f1f5f9;
            font-size: 22px;
            font-weight: 700;
            text-align: center;
            padding: 10px;
            border-radius: 8px;
            transition: border-color 0.2s;
        }

.rac-dark-section input[type="number"]:focus {
            border-color: #34d399;
            box-shadow: 0 0 0 3px rgba(52,211,153,0.15);
            outline: none;
        }

.rac-dark-section .note-small { color: rgba(255,255,255,0.35); }

.ttc-input-dark {
            font-size: 26px;
            font-weight: 700;
            text-align: right;
            padding: 0;
            margin: 0;
            width: 150px;
            border: none !important;
            border-radius: 0;
            background: none !important;
            background-color: transparent !important;
            -webkit-appearance: none;
            -moz-appearance: textfield;
            appearance: none;
            color: #60a5fa;
            color-scheme: dark;
            font-variant-numeric: tabular-nums;
            font-family: inherit;
            box-shadow: none !important;
        }

.ttc-input-dark::-webkit-outer-spin-button,

.ttc-input-dark::-webkit-inner-spin-button {
            -webkit-appearance: none;
            margin: 0;
        }

.ttc-input-dark:focus {
            outline: none !important;
            border: none !important;
            box-shadow: none !important;
        }

.btn-dark-export {
            width: 100%;
            border: 1px solid rgba(255,255,255,0.1);
            padding: 14px 20px;
            border-radius: 12px;
            font-size: 13px;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.25s;
            margin-bottom: 8px;
            background: rgba(255,255,255,0.05);
            color: rgba(255,255,255,0.6);
            letter-spacing: 0.3px;
        }

.btn-dark-export:hover {
            background: rgba(255,255,255,0.12);
            color: white;
            border-color: rgba(255,255,255,0.2);
        }

.btn-dark-export.pdf { }

.summary-header {
            font-size: 12px;
            font-weight: 600;
            color: #86868b;
            text-transform: uppercase;
            letter-spacing: 0.5px;
            margin-bottom: 12px;
        }

.scenario-label {
            font-size: 13px;
            color: #1d1d1f;
            margin-bottom: 20px;
            padding: 14px;
            background: #f5f5f7;
            border-radius: 8px;
            border-left: 4px solid #0071e3;
            line-height: 1.5;
        }

.scenario-label strong {
            font-weight: 600;
        }

.scenario-label .separator {
            color: #86868b;
            margin: 0 8px;
        }

.color-bleu { color: #0071e3; }

.color-jaune { color: #fbbf24; }

.color-violet { color: #8b5cf6; }

.color-rose { color: #ec4899; }

.amount-row {
            margin-bottom: 12px;
        }

.amount-label {
            font-size: 12px;
            color: #86868b;
            margin-bottom: 4px;
        }

.amount-value {
            font-size: 26px;
            font-weight: 700;
            color: #1d1d1f;
        }

.amount-value.highlight {
            color: #34c759;
        }

.rac-card {
            background: white;
            border-radius: 12px;
            padding: 24px;
            box-shadow: 0 2px 16px rgba(0,0,0,0.08);
        }

.rac-grid {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 16px;
            margin-bottom: 20px;
        }

.rac-item input {
            font-size: 22px;
            font-weight: 700;
            color: #1d1d1f;
            text-align: center;
            padding: 8px 10px;
        }

.final-amount {
            text-align: right;
            padding-top: 20px;
            border-top: 2px solid #f5f5f7;
        }

.final-amount .amount-label {
            font-size: 13px;
            color: #86868b;
            margin-bottom: 6px;
        }

.final-amount .amount-value {
            font-size: 34px;
            font-weight: 700;
            color: #1d1d1f;
        }

.status-badge {
            padding: 18px 24px;
            font-weight: 700;
            font-size: 15px;
            border-radius: 14px;
            text-align: center;
            width: 100%;
            letter-spacing: 0.3px;
            transition: all 0.3s;
            cursor: default;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 10px;
        }

.status-badge.ok {
            background: linear-gradient(135deg, #065f46, #059669);
            color: white;
            cursor: pointer;
            box-shadow: 0 4px 20px rgba(5, 150, 105, 0.35);
        }

.status-badge.ok:hover {
            box-shadow: 0 6px 28px rgba(5, 150, 105, 0.5);
            transform: translateY(-1px);
        }

.status-badge.ok:active { transform: translateY(0); }

.status-badge.danger {
            background: linear-gradient(135deg, #7f1d1d, #dc2626);
            color: white;
            box-shadow: 0 4px 16px rgba(220, 38, 38, 0.25);
        }

.btn-reset {
            background: #f5f5f7;
            border: 1px solid #e5e7eb;
            padding: 8px;
            border-radius: 8px;
            font-size: 0;
            cursor: pointer;
            transition: all 0.2s;
            display: flex;
            align-items: center;
            justify-content: center;
            flex-shrink: 0;
        }

.btn-reset:hover {
            background: #e8e8ed;
        }

.footer {
            text-align: center;
            padding: 8px 20px 8px;
            color: #86868b;
            font-size: 13px;
        }

@media print {
            #loginScreen, .header, .user-bar, .guest-bar, .btn-reset, .footer, .parameters-section, .main-content, .hist-overlay, #pwdModal {
                display: none !important;
            }
            
            #appScreen {
                display: block !important;
            }

            /* PAC mode: show pacDevisArea, hide ITE + printArea */
            .tab-pac-active ~ #printArea,
            body:not(:has(.tab-ite-active)) #printArea {
                display: none !important;
            }
            .tab-pac-active ~ #pacDevisArea,
            body:not(:has(.tab-ite-active)) #pacDevisArea {
                display: block !important;
            }
            body:not(:has(.tab-ite-active)) #iteDevisArea {
                display: none !important;
            }
            /* ITE mode: show iteDevisArea, hide PAC */
            .tab-ite-active ~ #iteDevisArea,
            body:has(.tab-ite-active) #iteDevisArea {
                display: block !important;
            }
            body:has(.tab-ite-active) #printArea {
                display: none !important;
            }
            body:has(.tab-ite-active) #pacDevisArea {
                display: none !important;
            }

            body {
                background: white;
                -webkit-print-color-adjust: exact;
                print-color-adjust: exact;
            }

            @page {
                margin: 10mm;
                size: A4;
            }
        }

@media (max-width: 1024px) {
            .main-content {
                grid-template-columns: 1fr;
            }
            .main-content > .parameters-section {
                padding: 16px 10px;
            }
        }

.note-small {
            font-size: 11px;
            color: #86868b;
            text-align: center;
            margin-top: 8px;
        }

.loading {
            text-align: center;
            padding: 40px;
            color: #86868b;
        }

.loading::after {
            content: '...';
            animation: dots 1.5s steps(4, end) infinite;
        }

@keyframes dots {
            0%, 20% { content: '.'; }
            40% { content: '..'; }
            60%, 100% { content: '...'; }
        }

/* ============ MOBILE ============ */

@media (max-width: 380px) {
            .grid-3col { grid-template-columns: 1fr 1fr !important; }
            .view-toggle .toggle-opt { padding: 3px 6px; font-size: 9px; }
        }

/* iOS Safari auto-zooms on inputs < 16px — force 16px on all touch devices */

@media (max-width: 1024px) {
            input, select, textarea { font-size: 16px !important; }
        }

/* LOGIN SCREEN */

.login-container { display:flex; align-items:center; justify-content:center; min-height:100vh; background:linear-gradient(135deg, #0f172a 0%, #1e3a5f 40%, #134e4a 100%); padding: 20px; box-sizing: border-box; }

.login-box { background:white; padding:40px; border-radius:16px; width:360px; max-width:100%; box-shadow:0 20px 60px rgba(0,0,0,0.3); box-sizing:border-box; }

.login-box h2 { text-align:center; margin:0 0 6px; font-size:20px; }

.login-box h2 span { color:#16a34a; }

.login-box .login-sub { text-align:center; color:#6b7280; font-size:13px; margin-bottom:24px; }

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

.login-box .form-group label { display:block; font-size:13px; font-weight:600; color:#374151; margin-bottom:6px; }

.login-box .form-group input { width:100%; padding:10px 14px; border:1px solid #d1d5db; border-radius:8px; font-size:14px; box-sizing:border-box; }

.login-box .form-group input:focus { border-color:#16a34a; outline:none; box-shadow:0 0 0 3px rgba(22,163,74,0.15); }

.login-box .btn-login { width:100%; padding:12px; background:linear-gradient(135deg,#16a34a,#15803d); color:white; border:none; border-radius:8px; font-size:15px; font-weight:700; cursor:pointer; }

.login-box .btn-login:hover { opacity:0.9; }

.login-error { color:#dc2626; text-align:center; margin-top:12px; font-size:13px; display:none; }

.login-logo { text-align:center; margin-bottom:20px; }

.login-logo span { background:linear-gradient(135deg,#16a34a,#15803d); color:white; padding:10px 18px; border-radius:10px; font-weight:700; font-size:14px; display:inline-block; }

/* USER BAR */

.user-bar { display:flex; align-items:center; gap:8px; justify-content:center; flex-wrap:wrap; }

.user-bar .user-name { font-size:12px; color:#6b7280; font-weight:600; }

.user-bar .user-role { font-size:10px; color:white; background:#16a34a; padding:1px 6px; border-radius:4px; font-weight:600; }

.user-bar .btn-hist { padding:4px 10px; font-size:11px; background:#f3f4f6; border:1px solid #d1d5db; border-radius:6px; cursor:pointer; font-weight:600; color:#374151; }

.user-bar .btn-hist:hover { background:#e5e7eb; }

.user-bar .btn-logout { padding:4px 10px; font-size:11px; background:#fef2f2; border:1px solid #fecaca; border-radius:6px; cursor:pointer; font-weight:600; color:#dc2626; }

.user-bar .btn-logout:hover { background:#fee2e2; }

.guest-bar { display:flex; align-items:center; gap:8px; }

.guest-bar .btn-login-small { padding:6px 14px; font-size:12px; background:linear-gradient(135deg,#16a34a,#15803d); color:white; border:none; border-radius:6px; cursor:pointer; font-weight:600; }

/* VIEW TOGGLE SWITCH */

.view-toggle { display:flex; align-items:center; gap:4px; background:#1e293b; border-radius:10px; padding:4px; border:2px solid #334155; }

.view-toggle .toggle-opt { padding:6px 16px; border-radius:7px; font-size:12px; font-weight:700; cursor:pointer; color:#94a3b8; transition:all 0.2s; border:none; background:none; letter-spacing:0.3px; }

.view-toggle .toggle-opt.active { color:white; box-shadow:0 2px 8px rgba(0,0,0,0.3); }

.view-toggle .toggle-opt#togClient.active { background:linear-gradient(135deg,#2563eb,#3b82f6); }
.view-toggle .toggle-opt#togTelepro.active { background:linear-gradient(135deg,#f59e0b,#fbbf24); color:#1d1d1f; }
.view-toggle .toggle-opt#togFournisseur.active { background:linear-gradient(135deg,#16a34a,#22c55e); }

.view-toggle .toggle-opt:hover:not(.active) { color:#e2e8f0; background:rgba(255,255,255,0.08); }

/* HISTORY MODAL */

.hist-overlay { display:none; position:fixed; top:0; left:0; right:0; bottom:0; background:rgba(0,0,0,0.5); z-index:9999; justify-content:center; align-items:center; }

.hist-overlay.active { display:flex; }

.hist-modal { background:white; border-radius:14px; width:90%; max-width:500px; max-height:80vh; overflow:hidden; box-shadow:0 20px 60px rgba(0,0,0,0.3); }

.hist-modal-header { padding:16px 20px; border-bottom:1px solid #e5e7eb; display:flex; justify-content:space-between; align-items:center; }

.hist-modal-header h3 { margin:0; font-size:16px; }

.hist-modal-close { background:none; border:none; font-size:22px; cursor:pointer; color:#6b7280; padding:0 4px; }

.hist-modal-body { padding:16px 20px; overflow-y:auto; max-height:60vh; }

.hist-entry { padding:10px 0; border-bottom:1px solid #f3f4f6; }

.hist-entry:last-child { border-bottom:none; }

.hist-meta { display:flex; gap:8px; align-items:center; margin-bottom:4px; }

.hist-date { font-size:11px; color:#9ca3af; }

.hist-user { font-size:11px; font-weight:700; color:#16a34a; }

.hist-action { font-size:13px; color:#1f2937; }

.hist-detail { font-size:11px; color:#6b7280; margin-top:2px; }

.hist-empty { text-align:center; color:#9ca3af; padding:30px 0; }

.hist-clear { margin-top:12px; text-align:center; }

.hist-clear button { font-size:12px; color:#dc2626; background:none; border:1px solid #fecaca; padding:4px 12px; border-radius:6px; cursor:pointer; }

/* ============ TAB SYSTEM ============ */

/* ONGLETS PAC / ITE / 174 (Yoann, 18/09/2026) : « beaucoup plus explicite, beaucoup plus
   gros qu'on est sur ITE ou sur PAC ». Trois pastilles de 13 px se ressemblaient trop pour
   qu'on repère où l'on est — et « PAC » / « ITE » ne disent rien à qui découvre l'outil.
   Chaque onglet porte donc son code EN GROS et le métier en dessous, et l'actif est nettement
   détaché : plein, relevé, légèrement agrandi. */
.tab-btn {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 1px;
    padding: 8px 26px;
    border-radius: 16px;
    border: 2px solid #d2d2d7;
    background: white;
    color: #1d1d1f;
    cursor: pointer;
    transition: all 0.15s;
    font-family: inherit;
    letter-spacing: 0;
    line-height: 1.05;
}
.tab-btn .tab-btn-lab  { font-size: 21px; font-weight: 800; letter-spacing: .5px; }
.tab-btn .tab-btn-sous { font-size: 11px; font-weight: 600; opacity: .62; white-space: nowrap; }

.tab-btn:hover { background: #f0fdf4; border-color: #16a34a; color: #374151; }

.tab-btn.active {
    background: #16a34a;
    color: white;
    border-color: #16a34a;
    transform: scale(1.08);
    box-shadow: 0 5px 16px -4px rgba(22,163,74,.55);
}
.tab-btn.active .tab-btn-sous { opacity: .92; font-weight: 700; }
/* La couleur de l'opération, la même que la pastille du haut (shared.js, _opCourante). */
.tab-btn.active.tab-op-ite { background: #0284c7; border-color: #0284c7; box-shadow: 0 5px 16px -4px rgba(2,132,199,.55); }
.tab-btn.active.tab-op-174 { background: #7c3aed; border-color: #7c3aed; box-shadow: 0 5px 16px -4px rgba(124,58,237,.55); }
.tab-btn.tab-op-ite:hover { background: #eff6ff; border-color: #0284c7; }
.tab-btn.tab-op-174:hover { background: #f5f3ff; border-color: #7c3aed; }
.tab-btn.active.tab-op-ite:hover { background: #0284c7; }
.tab-btn.active.tab-op-174:hover { background: #7c3aed; }
/* LA BASCULE VERS LA GESTION (28/09/2026). Elle n'est PAS une opération : elle change d'outil.
   D'où un aspect à part — trait de séparation au-dessus, fond plus sobre — pour qu'on ne la
   confonde pas avec un troisième type de devis. Elle n'est jamais « active » : on ne reste pas
   dessus, on passe par elle. */
.tab-btn.tab-op-gestion { margin-top: 10px; border-top: 2px solid #e5e7eb; padding-top: 12px;
  border-radius: 12px; color: #0f3d22; background: #f0fdf4; border-color: #bbf7d0; }
.tab-btn.tab-op-gestion:hover { background: #dcfce7; border-color: #16a34a; }
.tab-btn.tab-op-gestion .tab-btn-sous { color: #15803d; }

.tab-buttons { display: flex; gap: 10px; align-items: center; }
/* EMPILES (Yoann, 18/09/2026) : les trois démarches passent à gauche, les unes au-dessus des
   autres. En colonne, l'agrandissement de l'onglet actif (scale 1.08) débordait sur ses
   voisins — on le réduit et on aère d'autant. Largeur commune : trois pastilles de largeurs
   différentes, alignées verticalement, se lisent comme un escalier. */
/* Les trois demarches forment UN bloc, pas trois pastilles qui flottent (Yoann, 18/09/2026 :
   « les trois boutons a gauche, je les trouve moches »). Un rail gris clair les tient
   ensemble : on lit un selecteur a trois positions, et l'actif se detache dedans au lieu de
   grossir en debordant. */
.tab-rail { background: #f2f3f5; border: 1px solid #e3e5e8; border-radius: 16px; padding: 5px; display: inline-block; }
.tab-buttons.tab-col { flex-direction: column; align-items: stretch; gap: 4px; min-width: 146px; }
/* :not(.active) — SANS LUI, cette regle (3 classes) l'emporte sur `.tab-btn.active`
   (2 classes) et repeignait l'onglet actif en transparent : texte blanc sur fond clair,
   illisible. Collision de specificite, vue a l'ecran avant d'etre mise en ligne. */
.tab-buttons.tab-col .tab-btn { padding: 7px 18px; border-radius: 12px; }
.tab-buttons.tab-col .tab-btn:not(.active) { border-color: transparent; background: transparent; }
.tab-buttons.tab-col .tab-btn .tab-btn-lab { font-size: 19px; }
.tab-buttons.tab-col .tab-btn:hover { background: #fff; border-color: #d2d2d7; }
.tab-buttons.tab-col .tab-btn.active { transform: none; box-shadow: 0 2px 8px -2px rgba(0,0,0,.25); }

/* FACTURE LAV : admin et manager seulement (Yoann, 18/09/2026). Émettre une facture n'est
   pas un geste de vente, c'est un acte comptable. Classe posée par shared.js. */
.lav-cache-facture #mainBtnFacture,
.lav-cache-facture #mainBtnFactureHome,
.lav-cache-facture #pacFinBtnFactureLAV { display: none !important; }

/* Tab visibility */

.tab-pac-content { display: none; }

.tab-ite-content { display: none; }

.tab-photos-content { display: none; }

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

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

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

/* For grid layouts in sidebar */

.tab-pac-active .tab-pac-content.sidebar-grid { display: block; }

.tab-ite-active .tab-ite-content.sidebar-grid { display: block; }

/* Hide MPR/CEE wrapper entirely in ITE mode (the dark gradient bar) */

.tab-ite-active #mprCeeWrapper { display: none !important; }

/* ============ MPR PROFIL CARD ============ */

#mprResultBloc.mpr-card {
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 14px;
    border: 1px solid rgba(255,255,255,0.18);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.mpr-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255,255,255,0.18);
}

.mpr-card-icon { font-size: 38px; line-height: 1; }

.mpr-card-title { font-size: 18px; font-weight: 800; letter-spacing: 0.3px; }

.mpr-card-subtitle { font-size: 12px; opacity: 0.75; margin-top: 2px; }

.mpr-card-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px 12px;
    margin-bottom: 14px;
}

.mpr-detail-row {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12.5px;
    opacity: 0.92;
}

.mpr-detail-icon { font-size: 13px; flex-shrink: 0; }

.mpr-card-aide {
    padding: 10px 14px;
    background: rgba(255,255,255,0.13);
    border-radius: 10px;
    font-weight: 700;
    font-size: 13.5px;
    text-align: center;
    letter-spacing: 0.2px;
}

@media (max-width: 600px) {
    .mpr-card-details { grid-template-columns: 1fr; gap: 6px; }
}

/* ============ ITE CARDS (light theme) ============ */

/* Lot selector bar */

/* ITE KPI row */

/* ITE CEE table */

/* ITE alerts */

/* ITE search row */

/* === HERO RECHERCHE DOSSIER === */

.dossier-hero {
    background: linear-gradient(135deg, #0f172a 0%, #1a2e4a 50%, #0d3321 100%);
    border-radius: 14px;
    padding: 22px 20px 18px;
    margin-bottom: 18px;
    position: relative;
    overflow: hidden;
}

.dossier-hero::before {
    content: '';
    position: absolute;
    top: -30px; right: -30px;
    width: 120px; height: 120px;
    background: radial-gradient(circle, rgba(52,211,153,0.12) 0%, transparent 70%);
    border-radius: 50%;
}

.dossier-hero-label {
    font-size: 10px;
    font-weight: 700;
    color: rgba(255,255,255,0.4);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 4px;
}

.dossier-hero-title {
    font-size: 16px;
    font-weight: 800;
    color: white;
    margin-bottom: 2px;
}

.dossier-hero-sub {
    font-size: 11px;
    color: rgba(255,255,255,0.35);
    margin-bottom: 14px;
}

.dossier-hero-row {
    display: flex;
    gap: 8px;
    align-items: stretch;
}

.dossier-hero-input {
    flex: 1;
    padding: 13px 16px;
    border: 1.5px solid rgba(255,255,255,0.12) !important;
    border-radius: 10px;
    background: rgba(255,255,255,0.07) !important;
    background-color: rgba(255,255,255,0.07) !important;
    color: white !important;
    font-size: 17px;
    font-weight: 700;
    letter-spacing: 1.5px;
    font-family: ui-monospace, 'SF Mono', monospace;
    transition: all 0.2s;
}

.dossier-hero-input::placeholder { color: rgba(255,255,255,0.2); }

.dossier-hero-input:focus {
    outline: none;
    border-color: #34d399;
    background: rgba(52,211,153,0.07);
    box-shadow: 0 0 0 3px rgba(52,211,153,0.12);
}

.dossier-hero-btn {
    padding: 13px 20px;
    border-radius: 10px;
    background: linear-gradient(135deg, #16a34a, #15803d);
    color: white;
    font-size: 13px;
    font-weight: 700;
    border: none;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
    box-shadow: 0 2px 10px rgba(22,163,74,0.4);
}

.dossier-hero-btn:hover {
    background: linear-gradient(135deg, #15803d, #14532d);
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(22,163,74,0.5);
}

.dossier-hero-btn:active { transform: translateY(0); }

.dossier-hero-status {
    margin-top: 10px;
    font-size: 12px;
    font-weight: 600;
    padding: 8px 12px;
    border-radius: 8px;
    display: none;
}

.dossier-hero-status.ok {
    display: block;
    background: rgba(52,211,153,0.12);
    color: #34d399;
    border: 1px solid rgba(52,211,153,0.25);
}

.dossier-hero-status.err {
    display: block;
    background: rgba(239,68,68,0.1);
    color: #f87171;
    border: 1px solid rgba(239,68,68,0.2);
}

.dossier-hero-status.loading {
    display: block;
    background: rgba(96,165,250,0.1);
    color: #60a5fa;
    border: 1px solid rgba(96,165,250,0.2);
}

/* Champs du hero en dark */

.dossier-hero .form-group label {
    color: rgba(255,255,255,0.55);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.dossier-hero .form-group input,

.dossier-hero .form-group select {
    background: rgba(255,255,255,0.07) !important;
    background-color: rgba(255,255,255,0.07) !important;
    color: white !important;
    border: 1px solid rgba(255,255,255,0.12) !important;
    border-radius: 8px;
}

.dossier-hero .form-group input::placeholder { color: rgba(255,255,255,0.25) !important; }

.dossier-hero .form-group input:focus,

.dossier-hero .form-group select:focus {
    border-color: #34d399 !important;
    outline: none;
    box-shadow: 0 0 0 2px rgba(52,211,153,0.15) !important;
}

.dossier-hero .form-group select option { background: #1e293b; color: white; }

.dossier-hero-divider {
    border: none;
    border-top: 1px solid rgba(255,255,255,0.1);
    margin: 16px 0;
}

/* Picker doublons */

.dossier-picker-title {
    font-size: 11px;
    font-weight: 700;
    color: rgba(255,255,255,0.45);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 8px;
}

.dossier-picker-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.1);
    background: rgba(255,255,255,0.05);
    cursor: pointer;
    transition: all 0.15s ease;
    margin-bottom: 6px;
}

.dossier-picker-item:hover {
    background: rgba(52,211,153,0.12);
    border-color: rgba(52,211,153,0.3);
}

.dossier-picker-num {
    font-size: 12px;
    font-weight: 800;
    color: #34d399;
    font-family: ui-monospace, monospace;
    white-space: nowrap;
}

.dossier-picker-name {
    font-size: 13px;
    font-weight: 600;
    color: white;
    flex: 1;
}

.dossier-picker-tel {
    font-size: 11px;
    color: rgba(255,255,255,0.4);
    white-space: nowrap;
}

/* Statut de recherche à l'intérieur du hero */

/* ITE QR block */

/* ITE devis print styles */

/* PTZ Document Styles - Official CERFA Eco-PTZ */

/* E-Signature Modal */

/* Fiche Contact ECO-PTZ Modal */

/* Print: updated for tab system */

@media print {
    .tab-pac-active #pacDevisArea { display: block !important; }
    .tab-pac-active #printArea { display: none !important; }
    .tab-pac-active #iteDevisArea { display: none !important; }
    .tab-ite-active #iteDevisArea { display: block !important; }
    .tab-ite-active #printArea { display: none !important; }
    .tab-ite-active #pacDevisArea { display: none !important; }
}

/* Shared client card */

.shared-client-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 16px rgba(0,0,0,0.08);
    margin-bottom: 16px;
}

/* ============ CHOICE SCREEN (ITE / PAC) ============ */

.choice-screen {
    display: none;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 40%, #134e4a 100%);
    padding: 20px;
    box-sizing: border-box;
    flex-direction: column;
}

.choice-screen.active { display: flex; }

.choice-logo { margin-bottom: 24px; }

.choice-logo img { height: 72px; width: auto; filter: drop-shadow(0 4px 12px rgba(0,0,0,0.3)); }

.choice-title { color: #fff; font-size: 22px; font-weight: 800; margin: 0 0 6px; text-align: center; letter-spacing: -0.3px; }

.choice-subtitle { color: rgba(255,255,255,0.5); font-size: 13px; margin: 0 0 36px; text-align: center; }

.choice-cards {
    flex-wrap: wrap;
    justify-content: center;
    display: flex;
    gap: 24px;
    perspective: 800px;
}

@media (max-width: 600px) {
    .choice-cards { flex-direction: column; gap: 16px; }
    .choice-card { width: 260px !important; height: 180px !important; }
}

.choice-card {
    width: 280px;
    height: 220px;
    border-radius: 20px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    border: 2px solid rgba(255,255,255,0.12);
    position: relative;
    overflow: hidden;
    transition: transform 0.35s cubic-bezier(0.34,1.56,0.64,1), box-shadow 0.35s, border-color 0.35s;
    user-select: none;
    -webkit-user-select: none;
}

.choice-card:hover {
    transform: translateY(-6px) scale(1.03);
    border-color: rgba(255,255,255,0.25);
}

.choice-card:active { transform: translateY(-2px) scale(0.98); }

.choice-card-pac {
    background: linear-gradient(145deg, #1e40af, #3b82f6);
    box-shadow: 0 8px 32px rgba(59,130,246,0.25);
}

.choice-card-pac:hover { box-shadow: 0 12px 40px rgba(59,130,246,0.4); }

.choice-card-ite {
    background: linear-gradient(145deg, #065f46, #16a34a);
    box-shadow: 0 8px 32px rgba(22,163,74,0.25);
}

.choice-card-ite:hover { box-shadow: 0 12px 40px rgba(22,163,74,0.4); }

.choice-icon { font-size: 48px; filter: drop-shadow(0 2px 6px rgba(0,0,0,0.2)); }

.choice-label { color: #fff; font-size: 20px; font-weight: 800; letter-spacing: 1px; }

.choice-desc { color: rgba(255,255,255,0.7); font-size: 12px; text-align: center; max-width: 200px; line-height: 1.4; }

.choice-hint {
    color: rgba(255,255,255,0.35);
    font-size: 12px;
    margin-top: 28px;
    text-align: center;
    font-style: italic;
}

/* Dashboard résumé dossiers sur choice screen */

.choice-dashboard {
    width: 100%;
    max-width: 700px;
    margin-bottom: 32px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

@media (max-width: 400px) {
    .choice-dashboard { gap: 8px; }
}

.choice-dash-card {
    border-radius: 14px;
    padding: 18px 16px;
    text-align: center;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    position: relative;
    overflow: hidden;
}

.choice-dash-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}

.choice-dash-card:active {
    transform: translateY(-1px);
}

.choice-dash-label {
    color: #fff;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    text-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.choice-dash-count {
    color: #fff;
    font-size: 36px;
    font-weight: 900;
    margin-top: 4px;
    text-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

.choice-dash-detail {
    font-size: 10px;
    font-weight: 700;
    color: rgba(255,255,255,0.7);
    margin-top: 4px;
    letter-spacing: 0.3px;
}

.choice-dash-signe { background: linear-gradient(135deg, #22c55e, #16a34a); }

.choice-dash-afaire { background: linear-gradient(135deg, #3b82f6, #2563eb); }

.choice-dash-envoye { background: linear-gradient(135deg, #f59e0b, #d97706); }

.choice-dash-perdu { background: linear-gradient(135deg, #ef4444, #dc2626); }

/* Slide-out animation */

.choice-screen.slide-out-left {
    animation: choiceSlideLeft 0.5s cubic-bezier(0.4,0,0.2,1) forwards;
}

.choice-screen.slide-out-right {
    animation: choiceSlideRight 0.5s cubic-bezier(0.4,0,0.2,1) forwards;
}

@keyframes choiceSlideLeft {
    0% { opacity:1; transform:translateX(0); }
    100% { opacity:0; transform:translateX(-100vw); }
}

@keyframes choiceSlideRight {
    0% { opacity:1; transform:translateX(0); }
    100% { opacity:0; transform:translateX(100vw); }
}

/* Chosen card glow before slide */

.choice-card.chosen {
    animation: choiceGlow 0.3s ease-out;
    z-index: 2;
}

@keyframes choiceGlow {
    0% { transform: scale(1); box-shadow: 0 8px 32px rgba(255,255,255,0.1); }
    50% { transform: scale(1.08); box-shadow: 0 0 60px rgba(255,255,255,0.4); }
    100% { transform: scale(1.04); box-shadow: 0 0 40px rgba(255,255,255,0.2); }
}

/* =============================================== */

/* BACK OFFICE VIEW                                */

/* =============================================== */

/* Dashboard blocks */

/* Detail panel */

/* CRM KPI cards (reused from old style) */

/* Status-grouped blocks */

/* ===== DEVIS PDF PRINT STYLES ===== */
.ite-page { width: 210mm; min-height: 297mm; margin: 20px auto; padding: 10mm 12mm 20mm; background: #fff; position: relative; font-family: Arial, Helvetica, sans-serif; font-size: 8.5pt; color: #111; line-height: 1.45; }
.ite-page .dv-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 6mm; }
.ite-page .dv-title { display: flex; justify-content: space-between; border-bottom: 2px solid #000; padding-bottom: 2mm; margin-bottom: 3mm; }
.ite-page .dv-title span { font-size: 12pt; font-weight: 900; }
.ite-page .dv-info { display: grid; grid-template-columns: 1fr 1fr; gap: 0 6mm; margin-bottom: 4mm; font-size: 8pt; line-height: 1.6; }
.ite-page .dv-th { display: grid; grid-template-columns: 1fr 50px 72px 72px 48px; border-bottom: 2px solid #000; padding: 2mm 0 1mm; margin-bottom: 2mm; }
.ite-page .dv-th div { font-size: 10pt; font-weight: 900; }
.ite-page .dv-th .r { text-align: right; }
.ite-page .dv-th .c { text-align: center; }
.ite-page .dv-block { margin-bottom: 3mm; font-size: 8pt; line-height: 1.55; }
.ite-page .dv-row { display: grid; grid-template-columns: 1fr 50px 72px 72px 48px; border-top: 1.5px solid #333; border-bottom: 1.5px solid #333; padding: 1.5mm 0; margin: 2mm 0 1mm; }
.ite-page .dv-row div { font-size: 8pt; }
.ite-page .dv-row .n { font-weight: 700; }
.ite-page .dv-row .r { text-align: right; font-weight: 600; }
.ite-page .dv-row .c { text-align: center; }
.ite-page .dv-specs { font-size: 7.5pt; line-height: 1.55; margin-bottom: 3mm; padding-left: 2mm; }
.ite-page .dv-cond { font-size: 7.5pt; line-height: 1.45; margin-bottom: 3mm; padding: 0; border: none; }
.ite-page .dv-cond h4 { font-weight: 700; font-size: 8pt; margin: 2mm 0 1mm 0; }
.ite-page .dv-cond h4:first-child { margin-top: 0; }
.ite-page .dv-cond p { margin: 0.5mm 0; }
.ite-page .dv-cond b { display: inline; }
.ite-page .dv-totaux { display: flex; gap: 6mm; margin-top: 4mm; align-items: flex-start; }
/* LA SIGNATURE GARDE SA PLACE (Yoann, 18/09/2026 : « y a plus de place pour la signature »).
   `flex: 1` sans plancher : le jour ou la table des totaux s'est allongee (devis mixte, ligne
   de reprise du second devis), elle a pousse la case de signature a une quinzaine de mm et le
   texte « Bon pour accord » est tombe sur huit lignes. 58 mm est la largeur en-dessous de
   laquelle on ne signe plus confortablement ; c'est desormais la table qui se comprime. */
.ite-page .dv-sig { border: 1px solid #999; padding: 4mm; font-size: 7.5pt; flex: 1 1 58mm; min-width: 58mm; min-height: 28mm; }
.ite-page .dv-tt { font-size: 8pt; min-width: 200px; max-width: 92mm; border-collapse: collapse; }
.ite-page .dv-tt td { padding: 1.5px 4px; }
.ite-page .dv-tt td:last-child { text-align: right; font-weight: 600; }
.ite-page .dv-tt .ttc td { font-size: 10pt; font-weight: 900; border-top: 1px solid #333; padding-top: 3px; }
.ite-page .dv-tt .reste td { color: #dc2626; font-size: 10pt; font-weight: 900; padding: 4px 6px; }
.ite-page .dv-footer { position: absolute; bottom: 5mm; left: 12mm; right: 12mm; border-top: 1px solid #ccc; padding-top: 1.5mm; font-size: 5pt; color: #444; text-align: center; line-height: 1.4; }
.ite-page .dv-pn { position: absolute; right: 0; bottom: 0; font-weight: 700; font-size: 9pt; }
.ite-page .dv-legal { font-size: 7pt; line-height: 1.4; color: #333; margin-top: 4mm; }
.ite-page .dv-finance { font-size: 8pt; line-height: 1.6; margin-top: 4mm; }
.ite-page.cerfa { font-family: Arial, Helvetica, sans-serif; font-size: 8.5pt; color: #111; line-height: 1.5; }
.ite-page .ptz-sig-block { border: 1px solid #999; padding: 4mm; min-height: 28mm; font-size: 7.5pt; line-height: 1.5; position: relative; }
.ite-page .sig-canvas-area { width: 100%; height: 18mm; border: 1px dashed #cbd5e1; border-radius: 4px; margin-top: 2mm; background: #fafafa; }

/* ===== Devis PAC / Homelior : DENSIFICATION =====
   Ciblé sur #pacDevisArea uniquement (n'affecte ni le devis ITE ni les autres modules).
   Resserre l'interligne et les marges du détail (matériel / installation / pose) afin
   de réduire le blanc entre opérations et le nombre de pages. Le sélecteur survit au
   re-découpage d'autoSplitOverflowPages (les pages restent dans #pacDevisArea). */
#pacDevisArea .dv-block { line-height: 1.28; margin-bottom: 1.5mm; }
#pacDevisArea .dv-block ul { line-height: 1.28; margin: 0.5mm 0; }
#pacDevisArea .dv-specs { line-height: 1.22; margin-bottom: 1mm; }
#pacDevisArea .dv-row { margin: 1.2mm 0 0.5mm; padding: 1mm 0; }

/* ===== MOBILE RESPONSIVE — PAC / ITE / SHARED ===== */

@media (max-width: 768px) {
    /* Header: compact */
    .shared-header { padding: 8px 10px !important; }
    .shared-header .logo-row { gap: 6px !important; flex-wrap: wrap; }
    .shared-header .logo-row img { height: 28px !important; }
    .shared-header .qr-container { display: none !important; }

    /* Page nav buttons (PAC / ITE / 174) */
    .page-nav-btns { gap: 4px !important; }
    .page-nav-btns a, .page-nav-btns button { padding: 5px 10px !important; font-size: 11px !important; }

    /* Sub-tabs row (Importer, Coller, Documents...) */
    #subTabsRow { display: flex !important; flex-wrap: wrap !important; gap: 4px !important; justify-content: center; }
    #subTabsRow .sub-tab { padding: 3px 8px !important; font-size: 9px !important; margin: 0 !important; }

    /* View tabs (Client / Telepro / Pro) */
    .view-tabs { gap: 2px !important; }
    .view-tabs button { padding: 4px 8px !important; font-size: 10px !important; }

    /* Icon buttons row */
    .icon-btns-row { gap: 4px !important; flex-wrap: wrap; justify-content: center; }
    .icon-btns-row button, .icon-btns-row a { width: 30px !important; height: 30px !important; font-size: 14px !important; }

    /* User info row */
    .user-info-row { font-size: 11px !important; }

    /* Finance bar - sticky on mobile */
    #mobileStickyKpi { position: sticky !important; top: 0; z-index: 89; }

    /* Mobile scenario buttons */
    #mobileStickyKpi button { padding: 4px 8px !important; font-size: 10px !important; }

    /* Client info form — stack vertically */
    .client-fields-row, .info-fields-grid, [style*="display:flex"][style*="gap:14px"] {
        flex-direction: column !important;
        gap: 8px !important;
    }
    .client-fields-row > div, .info-fields-grid > div { width: 100% !important; min-width: 0 !important; }

    /* Produit blocs side by side → stacked */
    div[style*="display:flex"][style*="gap:14px"][style*="max-width:100%"] {
        flex-direction: column !important;
    }

    /* Costs grid: 2 columns */
    .costs-grid, div[style*="grid-template-columns: repeat(6"] {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    /* Results sidebar */
    .results-sidebar { width: 100% !important; position: static !important; }
    .results-sidebar .summary-card { margin: 8px 0 !important; }

    /* Buttons: full width on mobile */
    .action-btn-full { width: 100% !important; }

    /* Devis area */
    .devis-area { padding: 10px !important; }
    .devis-area table { font-size: 10px !important; }

    /* Form inputs */
    .form-group input, .form-group select, .form-group textarea {
        font-size: 14px !important; /* prevent iOS zoom */
    }

    /* Search dossier */
    #dossierPickerList { max-height: 50vh; overflow-y: auto; }

    /* General padding */
    .main-content, .page-content { padding: 8px !important; }
}

@media (max-width: 480px) {
    #subTabsRow .sub-tab { font-size: 8px !important; padding: 2px 6px !important; }
    #mobileStickyKpi .mkpi-value { font-size: 12px !important; }
    .produit-bloc { padding: 8px !important; }
    .produit-bloc-title { font-size: 12px !important; }
}

/* ===== BO SIDEBAR ===== */

/* Collapsible sidebar sections */

/* Sub-source toggles (LAV, PIXEL, CHELLY) */

/* ============================================================
   VUES PAR RÔLE ET PAR RÉGIE (08/09/2026)
   Deux classes posées sur <body> par shared.js : `lav-role-telepro`
   (rôle de l'utilisateur connecté) et `lav-regie-noah` (télépro d'un
   centre d'appel externe). On passe par du CSS et non par du JS parce
   que la barre d'actions est recalculée en permanence
   (mainUpdateHeaderButtons) et réécrit les style.display : seule une
   règle !important tient dans la durée.
   ============================================================ */

/* Un télépro ne voit ni les coûts d'achat, ni l'import de documents, ni les photos :
   il n'a que le client au téléphone, pas le dossier physique. Le bloc Coûts est déjà en
   « vue fournisseur », mais on le masque aussi par rôle pour que changer de vue ne le
   fasse pas réapparaître. */
.lav-role-telepro .lav-bloc-couts,
.lav-role-telepro #subTabImporter,
.lav-role-telepro #subTabPhotos { display: none !important; }

/* Le bloc « Coûts » (prix d'achat matériel et pose, total coût HT, prix cumac) : ADMIN et
   MANAGER seulement. Il n'était masqué qu'aux télépros ; un commercial, une régie ou un
   poseur y lisaient les prix catalogue — devant le client, l'écran étant tourné vers lui.
   La classe est posée par shared.js dès l'init, donc sans clignotement. 17/09/2026. */
.lav-cache-couts .lav-bloc-couts { display: none !important; }

/* LE BALLON ÉLECTRIQUE N'EST PAS PROPOSÉ AUX TÉLÉPROS (Ishay, 23/09/2026) : « rajoute les
   ballons électriques comme avant, mais pas pour les télépros, je ne veux pas qu'ils puissent
   le voir. » Le scénario existe donc partout ailleurs — trois barres de boutons — et disparaît
   pour eux seuls. Par CSS et non par JS, comme la marge : les barres de scénario sont
   redessinées à chaque recalcul, et seul un !important tient dans la durée.
   Une fiche DÉJÀ enregistrée en ballon électrique continue de s'ouvrir et de se calculer
   normalement pour un télépro : ce qui lui est retiré, c'est le CHOIX, pas la lecture. */
.lav-role-telepro .lav-scen-be { display: none !important; }

/* LE SSC REVIENT, POUR LES ADMINS ET MANAGERS SEULEMENT (Anthony, 25/09/2026) : « tu remets le
   SSC […] pour tous les admin managers ». Retiré de tout le monde le 04/09/2026 (MaPrimeRénov'
   ne finance plus le solaire thermique depuis le 01/09/2026), il manquait pour rouvrir et
   retravailler les anciens dossiers SSC (BLANCO CAROLE, AVR-2025-3185). Caché tant que le
   marqueur `lav-role-manager` n'est pas posé : jamais visible, même une fraction de seconde,
   pour un commercial, une régie ou un télépro. */
body:not(.lav-role-manager) .lav-scen-ssc { display: none !important; }

/* Un télépro ne voit jamais la MARGE. Sur la page PAC, l'encart est réutilisé pour
   afficher son geste commercial maximum : il est alors marqué `lav-geste-ok` par
   _peindreEncartMarge et reste visible. Partout ailleurs (ITE), l'encart afficherait
   la marge : il reste masqué. */
.lav-role-telepro .lav-marge-box:not(.lav-geste-ok) { display: none !important; }

/* Régie NOAH : un seul chemin vers un devis, le bouton « Devis signature
   électronique ». Tous les autres boutons de génération, d'envoi et de
   facture disparaissent, dans la barre du haut comme dans la colonne de
   droite. Restent visibles : signature électronique, fiche contact,
   financement. */
.lav-regie-noah #mainBtnVoirDevis,
.lav-regie-noah #mainBtnDevisHome,
.lav-regie-noah #mainBtnDevisMixte,
.lav-regie-noah #mainBtnFacture,
.lav-regie-noah #mainBtnEnvoyerDevis,
.lav-regie-noah #mainBtnSignature,
.lav-regie-noah #mainBtnFicheTech,
.lav-regie-noah #mainBtnPTZ,
.lav-regie-noah #exportBtn,
.lav-regie-noah #exportFactureBtn,
.lav-regie-noah #ficheTechBtn,
.lav-regie-noah #pacFinBtnDevisLAV,
.lav-regie-noah #pacFinBtnFactureLAV,
.lav-regie-noah #pacFinBtnDevisHome,
.lav-regie-noah #pacFinBtnDevisMixte { display: none !important; }

/* UN TÉLÉPRO NE PRODUIT PAS DE DOCUMENT (Yoann, 18/09/2026) : « les télépros ne peuvent
   pas faire autre chose que Documents, Envoyer Signature, Financement, Fiche Contact,
   RDV MPR ». Il vend au téléphone : il monte le financement, remplit la fiche contact,
   pose le rendez-vous MPR et envoie le devis à signer par e-mail. Il n'édite pas le PDF
   lui-même, ne le télécharge pas, ne fait pas signer sur écran (il n'a pas le client en
   face) et ne dépose pas le dossier signé — c'est le commercial qui le fait.
   Même liste que la régie NOAH, plus « Déposer un dossier ». Les boutons de devis du
   panneau Financement partent aussi : le financement se monte sur les chiffres à l'écran,
   pas en éditant un devis. */
.lav-role-telepro #mainBtnDepot,
.lav-role-telepro #mainBtnFicheTech,
.lav-role-telepro #mainBtnVoirDevis,
.lav-role-telepro #mainBtnDevisHome,
.lav-role-telepro #mainBtnDevisMixte,
.lav-role-telepro #mainBtnFacture,
.lav-role-telepro #mainBtnEnvoyerDevis,
.lav-role-telepro #mainBtnSignature,
.lav-role-telepro #mainBtnPTZ,
.lav-role-telepro #mainBtnPtzIte,
.lav-role-telepro #exportBtn,
.lav-role-telepro #exportFactureBtn,
.lav-role-telepro #ficheTechBtn,
.lav-role-telepro #pacFinBtnDevisLAV,
.lav-role-telepro #pacFinBtnFactureLAV,
.lav-role-telepro #pacFinBtnDevisHome,
.lav-role-telepro #pacFinBtnDevisMixte { display: none !important; }

/* Champ Régie : la saisie est en capitales, pas son texte d'aide. */
input[id$="Regie"]::placeholder, input[id*="Regie_"]::placeholder { text-transform: none; }

/* Le 174 (rénovation d'ampleur) n'est pas du ressort d'un télépro : ni l'onglet de la
   barre du haut, ni la carte de l'écran d'accueil. */
.lav-role-telepro #tab174,
.lav-role-telepro .choice-card-174 { display: none !important; }
