/* ═══════════════════════════════════════════════════════════════════
   Développé par Karim BRAHIM
   © 2025-2026 — Tous droits réservés
   "Tu peux copier, mais jamais égaler — j'ai déjà évolué."
   ═══════════════════════════════════════════════════════════════════ */

/* --- DÉFINITION DES POLICES LOCALES (INTER) --- */
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 400; src: url('webfonts/Inter-Regular.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 500; src: url('webfonts/Inter-Medium.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 600; src: url('webfonts/Inter-SemiBold.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 700; src: url('webfonts/Inter-Bold.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 800; src: url('webfonts/Inter-ExtraBold.woff2') format('woff2'); }

/* --- VARIABLES GLOBALES --- */
:root {
    --primary-color: #1C33C3;       
    --primary-color-hover: #152a9e;
    --danger-color: #BE2A25;        
    --white-color: #ffffff;
    --light-bg-color: #f4f7fc;
    --dark-color: #1e293b; 
    --border-color: #e2e8f0;
    --success-color: #22c55e;
    --warning-color: #f59e0b;
    --info-color: #3b82f6;

    --col-std: #f59e0b; 
    --col-rev: #a855f7; 
    --col-bdg: #22c55e; 
    --col-rem: #475569; 
    
    --border-radius-sm: 8px; 
    --border-radius-md: 16px;
    --shadow-card: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

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

body { 
    font-family: 'Inter', sans-serif;
    background-color: var(--light-bg-color);
    color: var(--dark-color);
    min-height: 100vh;
    padding-bottom: 60px;
    line-height: 1.6; 
    -webkit-font-smoothing: antialiased; 
    -moz-osx-font-smoothing: grayscale;
}

*:focus-visible { outline: 3px solid var(--primary-color); outline-offset: 2px; }
.icon { width: 1.2em; height: 1.2em; vertical-align: text-bottom; fill: currentColor; display: inline-block; }

/* HEADER */
.main-header {
    background-color: var(--white-color);
    padding: 10px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
    border-bottom: 1px solid var(--border-color);
}
.header-logo { max-height: 30px; width: auto; display: block; }
.header-title { font-size: 20px; font-weight: 800; color: #0f172a; text-transform: uppercase; letter-spacing: -0.5px; }

/* SWITCH LOCATION / INVESTISSEMENT (Header) */
.financing-switch-container {
    margin-left: auto;
    margin-right: 0;
}

.financing-switch {
    display: flex;
    background: #e2e8f0;
    border-radius: 6px; 
    padding: 4px;
    position: relative;
    cursor: pointer;
    width: 260px;
    height: 40px;
    user-select: none;
    border: 1px solid #cbd5e1;
}

.financing-option {
    flex: 1;
    text-align: center;
    z-index: 2;
    line-height: 32px;
    font-size: 12px;
    font-weight: 700;
    color: #64748b;
    transition: color 0.3s;
}

.financing-bg {
    position: absolute;
    left: 4px;
    top: 4px;
    width: calc(50% - 4px);
    height: 32px;
    background: var(--white-color);
    border-radius: 4px;
    transition: transform 0.3s cubic-bezier(0.4, 0.0, 0.2, 1);
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

/* État Investissement */
.financing-switch.buy-mode .financing-bg {
    transform: translateX(100%);
    background-color: var(--dark-color); 
}

.financing-switch.buy-mode #mode_buy { color: white; }
.financing-switch:not(.buy-mode) #mode_rent { color: var(--primary-color); }


.main-container { max-width: 900px; margin: 0 auto; display: flex; flex-direction: column; gap: 25px; padding: 0 20px; }

/* SECTIONS */
.section-box {
    background: var(--white-color);
    border-radius: var(--border-radius-md);
    box-shadow: var(--shadow-card);
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    margin-bottom: 20px;
    border: 1px solid var(--border-color);
}
.section-header { 
    background-color: var(--primary-color); 
    color: var(--white-color); 
    padding: 15px 30px; 
    display: flex; 
    align-items: center; 
    gap: 12px; 
}
.section-header h2 { font-size: 16px; font-weight: 600; margin: 0; text-transform: uppercase; letter-spacing: 0.5px; }
.section-content { padding: 30px; }

/* INPUTS */
input[type="number"], select { 
    padding: 8px 12px; 
    border: 1px solid var(--border-color); 
    border-radius: var(--border-radius-sm); 
    font-size: 14px;
    font-family: 'Inter', sans-serif;
    color: var(--dark-color); 
    background-color: #f8fafc; 
    height: 42px;
    transition: all 0.2s;
}
input:focus { outline: none; border-color: var(--primary-color); background-color: #fff; box-shadow: 0 0 0 3px rgba(28, 51, 195, 0.1); }
.input-error { border-color: var(--danger-color) !important; background-color: #fef2f2 !important; }
input[type=number]::-webkit-inner-spin-button, input[type=number]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
input[type=number] { -moz-appearance: textfield; }

/* STEPPER */
.stepper-wrapper { display: flex; align-items: center; border: 1px solid var(--border-color); border-radius: var(--border-radius-sm); overflow: hidden; height: 48px; background: #fff; }
.stepper-btn { width: 40px; height: 100%; border: none; background: #f8fafc; color: var(--primary-color); font-size: 18px; font-weight: bold; cursor: pointer; transition: background 0.2s; }
.stepper-btn:hover { background: #e2e8f0; }
.qty-input { width: 70px !important; text-align: center; font-weight: 700; border: none !important; height: 100% !important; font-size: 16px !important; background: transparent !important; color: #0f172a !important; }
.qty-input:focus { background: #f0f9ff !important; }

/* CONFIG GRID */
.config-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.config-item { background: #f8fafc; padding: 15px 20px; border-radius: var(--border-radius-sm); border: 1px solid var(--border-color); display: flex; align-items: center; justify-content: space-between; position: relative; transition: border-color 0.2s; }
.config-item:hover { border-color: #cbd5e1; }
.config-label { font-weight: 600; color: #334155; font-size: 14px; }
.config-wrapper { cursor: pointer; display: flex; align-items: center; }
.config-text { font-weight: 700; color: var(--primary-color); font-size: 16px; border-bottom: 1px dashed rgba(28, 51, 195, 0.3); }
.config-wrapper:hover .config-text { border-bottom-color: var(--primary-color); }
.config-input { width: 80px !important; height: 35px !important; display: none; margin-right: 5px; }
.cost-text { color: #64748b !important; font-weight: 600; }

/* PRODUITS */
.product-row { display: flex; align-items: center; justify-content: space-between; background: #fff; border: 1px solid var(--border-color); border-left: 5px solid transparent; padding: 15px; border-radius: var(--border-radius-sm); margin-bottom: 10px; }
.product-row:hover { border-color: #cbd5e1; }
.product-row[data-ref="std"] { border-left-color: var(--col-std); }
.product-row[data-ref="rev"] { border-left-color: var(--col-rev); }
.product-row[data-ref="bdg"] { border-left-color: var(--col-bdg); }
.product-row[data-ref="rem"] { border-left-color: var(--col-rem); }
.prod-title { font-weight: 700; font-size: 15px; color: #1e293b; }
.prod-actions { display: flex; align-items: center; gap: 15px; }

/* SWITCH */
.toggle-switch { display: flex; background: #e2e8f0; border-radius: 25px; padding: 3px; position: relative; cursor: pointer; width: 270px; height: 48px; user-select: none; }
.toggle-option { flex: 1; text-align: center; z-index: 2; line-height: 42px; font-size: 13px; font-weight: 600; color: #64748b; transition: color 0.3s; }
.toggle-bg { position: absolute; left: 3px; top: 3px; width: calc(33.33% - 2px); height: 42px; background: var(--white-color); border-radius: 22px; transition: transform 0.3s cubic-bezier(0.4, 0.0, 0.2, 1); box-shadow: 0 1px 3px rgba(0,0,0,0.1); }
.toggle-switch[data-val="day"] .toggle-bg { transform: translateX(0); }
.toggle-switch[data-val="week"] .toggle-bg { transform: translateX(100%); }
.toggle-switch[data-val="month"] .toggle-bg { transform: translateX(200%); }
.toggle-switch[data-val="day"] .active-day, .toggle-switch[data-val="week"] .active-week, .toggle-switch[data-val="month"] .active-month { color: var(--primary-color); font-weight: 700; }

/* SWITCH BRUT / NET */
.view-switch-container { display: flex; justify-content: center; margin-bottom: 10px; margin-top: 5px; }
.view-switch { display: flex; background: #e2e8f0; border-radius: 20px; padding: 3px; position: relative; cursor: pointer; width: 240px; height: 40px; user-select: none; }
.view-option { flex: 1; text-align: center; z-index: 2; line-height: 34px; font-size: 12px; font-weight: 700; color: #64748b; transition: color 0.3s; }
.view-bg { position: absolute; left: 3px; top: 3px; width: calc(50% - 3px); height: 34px; background: var(--white-color); border-radius: 17px; transition: transform 0.3s cubic-bezier(0.4, 0.0, 0.2, 1); box-shadow: 0 1px 2px rgba(0,0,0,0.1); }
.view-switch.net-mode .view-bg { transform: translateX(100%); }
.view-switch:not(.net-mode) .view-bg { transform: translateX(0); }
.view-switch:not(.net-mode) #opt_brut { color: var(--primary-color); }
.view-switch.net-mode #opt_net { color: var(--success-color); }

/* RESULTATS */
#resultsSection { animation: slideDown 0.6s cubic-bezier(0.16, 1, 0.3, 1); }
@keyframes slideDown { from { opacity: 0; transform: translateY(-20px); } to { opacity: 1; transform: translateY(0); } }
.validate-container { text-align: center; margin-top: 30px; }
.btn-validate { background-color: var(--primary-color); color: white; font-size: 16px; padding: 15px 40px; border-radius: 30px; border: none; font-weight: 700; cursor: pointer; box-shadow: 0 4px 15px rgba(28, 51, 195, 0.25); transition: all 0.2s; display: inline-flex; align-items: center; gap: 10px; font-family: 'Inter', sans-serif; }
.btn-validate:hover { transform: translateY(-2px); background-color: var(--primary-color-hover); box-shadow: 0 6px 20px rgba(28, 51, 195, 0.35); }

.result-highlight { text-align: center; padding: 25px; background: #f8fafc; border-radius: var(--border-radius-sm); margin-bottom: 20px; border: 1px solid var(--border-color); }
.pack-display { display: inline-block; padding: 6px 16px; border-radius: 20px; color: white; font-weight: 800; font-size: 12px; margin-bottom: 15px; text-transform: uppercase; letter-spacing: 1px; }
.bg-pack1 { background-color: var(--primary-color); box-shadow: 0 2px 10px rgba(28, 51, 195, 0.3); }
.bg-pack2 { background-color: var(--danger-color); box-shadow: 0 2px 10px rgba(190, 42, 37, 0.3); }
.advice-box { margin-top: 20px; padding: 15px; background: #eff6ff; border-left: 4px solid #3b82f6; text-align: left; font-size: 14px; color: #1e40af; display: none; border-radius: 0 6px 6px 0; margin-bottom:15px; line-height: 1.5; }
.profit-amount { font-size: 42px; font-weight: 800; margin: 15px 0; letter-spacing: -1px; }
.text-success { color: var(--success-color) !important; }
.text-danger { color: var(--danger-color) !important; }
.text-info { color: var(--info-color) !important; }

.progress-track { background: #e2e8f0; height: 12px; border-radius: 6px; overflow: hidden; display: flex; width: 100%; position: relative; }
.progress-seg { height: 100%; transition: width 0.6s cubic-bezier(0.4, 0.0, 0.2, 1); }
.seg-std { background-color: var(--col-std); }
.seg-rev { background-color: var(--col-rev); }
.seg-bdg { background-color: var(--col-bdg); }
.seg-rem { background-color: var(--col-rem); }
.legend-container { display: flex; gap: 20px; justify-content: center; margin-top: 15px; flex-wrap: wrap; }
.legend-item { font-size: 12px; display: flex; align-items: center; gap: 8px; color: #64748b; white-space: nowrap; font-weight: 600; }
.legend-dot { width: 10px; height: 10px; border-radius: 50%; }

.btn { padding: 12px 24px; border: none; border-radius: var(--border-radius-sm); cursor: pointer; font-weight: 600; font-size: 14px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; transition: opacity 0.2s; font-family: 'Inter', sans-serif; }
.btn:hover { opacity: 0.9; }
.btn-primary { background-color: var(--primary-color); color: white; }
.btn-secondary { background-color: #64748b; color: white; }
.btn-danger { background-color: var(--danger-color); color: white; }
.btn-print { background-color: #334155; color: white; }
.actions-group { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 25px; }
.btn-full { flex: 1; }

.scenario-section { display: none; margin-top: 30px; }
.scenario-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 20px; margin-top: 20px; }
.scenario-card { border: 1px solid var(--border-color); border-radius: var(--border-radius-sm); padding: 20px; background: white; box-shadow: 0 2px 4px rgba(0,0,0,0.05); }
.details-content { display: none; margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--border-color); }
.detail-row { display: flex; justify-content: space-between; padding: 6px 0; font-size: 14px; color: #475569; }
.detail-row.total { font-weight: 700; font-size: 15px; margin-top: 12px; border-top: 1px dashed #cbd5e1; padding-top: 12px; color: #1e293b; }
.footer-signature { text-align: center; margin-top: 50px; font-size: 12px; color: #94a3b8; font-weight: 500; width: 100%; }

/* MODAL */
.pdf-modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(15, 23, 42, 0.6); backdrop-filter: blur(2px); z-index: 9999; display: flex; justify-content: center; align-items: center; }
.pdf-modal { background: white; padding: 35px; border-radius: 20px; width: 380px; text-align: center; box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1); font-family: 'Inter', sans-serif; }
.pdf-modal h3 { font-weight: 800; color: #1e293b; margin-bottom: 5px; }
.pack-switch { display: flex; background: #e2e8f0; border-radius: 25px; margin: 25px 0; cursor: pointer; position: relative; height: 44px; }
.pack-opt { flex: 1; z-index: 2; line-height: 44px; font-weight: 700; font-size: 14px; color: #64748b; transition: color 0.3s; }
.pack-bg { position: absolute; width: 50%; height: 100%; background: var(--primary-color); border-radius: 25px; transition: transform 0.3s cubic-bezier(0.4, 0.0, 0.2, 1); top: 0; left: 0; }
.active-opt { color: white !important; }
.modal-btn { background: var(--primary-color); color: white; border: none; padding: 12px 35px; border-radius: 25px; font-weight: 700; cursor: pointer; margin-top: 15px; width: 100%; transition: background 0.2s; font-family: 'Inter', sans-serif; }
.modal-btn:hover { background-color: var(--primary-color-hover); }
.loader-spinner { border: 4px solid #f1f5f9; border-top: 4px solid var(--primary-color); border-radius: 50%; width: 35px; height: 35px; animation: spin 0.8s linear infinite; margin: 25px auto; }
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

/* SELECTEUR COMMERCIAL */
.commercial-select-group { text-align: left; margin: 20px 0; }
.commercial-select-group label { font-size: 13px; font-weight: 600; color: #475569; display: block; margin-bottom: 8px; }
.commercial-select { width: 100%; padding: 10px 12px; border: 1px solid #cbd5e1; border-radius: 8px; font-size: 14px; background: #f8fafc; font-family: 'Inter', sans-serif; }
.commercial-select:focus { border-color: var(--primary-color); outline: none; box-shadow: 0 0 0 3px rgba(28, 51, 195, 0.1); }

/* --- TOAST NOTIFICATIONS --- */
#notification-container {
    position: fixed;
    top: 25px;
    right: 25px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.toast {
    background: white;
    padding: 16px 24px;
    border-radius: 12px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 15px;
    min-width: 320px;
    max-width: 420px;
    animation: slideInRight 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    border-left: 5px solid #ccc;
    font-size: 14px;
    font-weight: 500;
    color: #334155;
}
.toast-success { border-left-color: var(--success-color); }
.toast-error { border-left-color: var(--danger-color); }
.toast-warning { border-left-color: var(--warning-color); }
.toast-info { border-left-color: var(--info-color); }

.toast-icon { font-size: 20px; }
.toast-success .toast-icon { color: var(--success-color); }
.toast-error .toast-icon { color: var(--danger-color); }
.toast-warning .toast-icon { color: var(--warning-color); }
.toast-info .toast-icon { color: var(--info-color); }

.toast.hide { animation: slideOutRight 0.3s ease-in forwards; }

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

@media (max-width: 600px) {
    .main-header { flex-direction: column; gap: 15px; text-align: center; padding: 20px; }
    .financing-switch-container { margin: 10px auto; width: 100%; display: flex; justify-content: center; }
    .config-grid { grid-template-columns: 1fr; } 
    .product-row { flex-direction: column; align-items: flex-start; gap: 15px; }
    .prod-actions { width: 100%; justify-content: space-between; }
    .toggle-switch { width: 100%; }
    #notification-container { left: 20px; right: 20px; top: 10px; }
    .toast { width: 100%; min-width: auto; }
}
/* --- BOUTON EMAIL --- */
.btn-email {
    background: linear-gradient(135deg, #0ea5e9, #0284c7);
    color: white;
    border: none;
    font-weight: 600;
    letter-spacing: 0.3px;
    transition: all 0.2s ease;
}
.btn-email:hover { background: linear-gradient(135deg, #0284c7, #0369a1); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(14, 165, 233, 0.4); }

/* --- MODAL EMAIL CLIENT --- */
.email-modal-overlay {
    position: fixed; inset: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    display: flex; align-items: center; justify-content: center;
    z-index: 10000; padding: 20px;
    animation: fadeInOverlay 0.2s ease;
}
@keyframes fadeInOverlay { from { opacity: 0; } to { opacity: 1; } }

.email-modal {
    background: white;
    border-radius: 20px;
    width: 100%; max-width: 520px;
    max-height: 90vh;
    display: flex; flex-direction: column;
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.35);
    animation: slideUpModal 0.25s ease;
    overflow: hidden;
}
@keyframes slideUpModal { from { transform: translateY(30px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

.email-modal-header {
    background: linear-gradient(135deg, #0ea5e9, #0284c7);
    color: white; padding: 20px 24px;
    display: flex; align-items: center; gap: 12px;
}
.email-modal-header i { font-size: 22px; }
.email-modal-header h3 { font-size: 17px; font-weight: 700; margin: 0; }

.email-modal-body {
    padding: 24px; overflow-y: auto;
    display: flex; flex-direction: column; gap: 16px;
    flex: 1;
}

.email-field-group { display: flex; flex-direction: column; gap: 5px; margin-bottom: 4px; }
.email-field-group label { font-size: 11px; font-weight: 600; color: #475569; text-transform: uppercase; letter-spacing: 0.04em; }

.email-input {
    padding: 9px 12px; border: 1.5px solid #e2e8f0;
    border-radius: 8px; font-size: 13px; color: #1e293b;
    font-family: inherit; background: #f8fafc;
    transition: border-color 0.15s, box-shadow 0.15s;
    outline: none; width: 100%;
}
.email-input:focus { border-color: #1a73e8; box-shadow: 0 0 0 3px rgba(26,115,232,0.12); background: #fff; }

.email-textarea {
    padding: 9px 12px; border: 1.5px solid #e2e8f0;
    border-radius: 8px; font-size: 13px; color: #334155;
    font-family: inherit; background: #f8fafc;
    resize: vertical; line-height: 1.6;
    transition: border-color 0.15s, box-shadow 0.15s;
    outline: none; width: 100%;
}
.email-textarea:focus { border-color: #1a73e8; box-shadow: 0 0 0 3px rgba(26,115,232,0.12); background: #fff; }

.email-note {
    background: #eff6ff; border: 1px solid #bfdbfe;
    border-radius: 8px; padding: 10px 14px;
    font-size: 12px; color: #1d4ed8; line-height: 1.5;
    display: flex; align-items: flex-start; gap: 8px;
}
.email-note i { margin-top: 2px; flex-shrink: 0; }

.email-modal-footer {
    padding: 14px 20px 18px;
    border-top: 1px solid #e8edf5;
    display: flex; gap: 10px; justify-content: flex-end;
    background: #fff;
}

/* =========================================================
   HEADER CLIENT BAR — supprimé, saisie dans les popups
   ========================================================= */

/* =========================================================
   NBSITES STEPPER
   ========================================================= */
.nbsites-stepper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 10px 18px;
    margin-bottom: 14px;
}
.nbsites-label {
    font-size: 13px;
    font-weight: 600;
    color: #475569;
    display: flex;
    align-items: center;
    gap: 6px;
}
.nbsites-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}
.nbsites-display {
    font-size: 20px;
    font-weight: 800;
    color: #1C33C3;
    min-width: 28px;
    text-align: center;
}

/* =========================================================
   SCENARIO CARDS (rendu complet)
   ========================================================= */
.scenario-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
}
.scenario-empty {
    text-align: center;
    color: #94a3b8;
    font-size: 13px;
    padding: 20px 0;
}
.scenario-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 12px;
    position: relative;
}
.scenario-card-header {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}
.scenario-pack-badge {
    font-size: 10px;
    font-weight: 700;
    color: #fff;
    padding: 2px 7px;
    border-radius: 20px;
}
.scenario-mode-badge {
    font-size: 10px;
    background: #f1f5f9;
    color: #64748b;
    padding: 2px 7px;
    border-radius: 20px;
    font-weight: 600;
}
.scenario-del-btn {
    margin-left: auto;
    background: none;
    border: none;
    color: #cbd5e1;
    cursor: pointer;
    padding: 0 2px;
    font-size: 13px;
    transition: color 0.2s;
}
.scenario-del-btn:hover { color: #ef4444; }
.scenario-client-name {
    font-size: 11px;
    color: #64748b;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.scenario-profit {
    font-size: 18px;
    font-weight: 800;
    margin: 4px 0;
}
.scenario-date {
    font-size: 10px;
    color: #94a3b8;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* =========================================================
   COMPARE SECTION
   ========================================================= */
.compare-section {
    margin-top: 20px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 18px;
    animation: fadeIn 0.2s ease;
}
.cmp-title {
    font-size: 14px;
    font-weight: 700;
    color: #334155;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.cmp-note {
    font-size: 11px;
    color: #94a3b8;
    margin-bottom: 14px;
}
.cmp-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    margin-bottom: 14px;
}
.cmp-table thead th {
    font-size: 11px;
    font-weight: 700;
    padding: 6px 8px;
    text-align: center;
    background: #f1f5f9;
    border-bottom: 2px solid #e2e8f0;
}
.cmp-pack1 { color: var(--primary-color); }
.cmp-pack2 { color: #7c3aed; }
.cmp-table td {
    padding: 7px 8px;
    border-bottom: 1px solid #f1f5f9;
    color: #475569;
}
.cmp-val {
    text-align: center;
    font-weight: 600;
}
.cmp-winner {
    color: #16a34a;
    background: #f0fdf4;
}
.cmp-pos { color: #16a34a; }
.cmp-neg { color: #ef4444; }
.cmp-row-net td { background: #fff; }
.cmp-verdict {
    font-size: 13px;
    color: #475569;
    padding: 10px 12px;
    background: #fff;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* =========================================================
   BTN COMPARE
   ========================================================= */
.btn-compare {
    background: linear-gradient(135deg, #7c3aed, #5b21b6);
    color: #fff;
    border: none;
}
.btn-compare:hover {
    background: linear-gradient(135deg, #6d28d9, #4c1d95);
}

/* =========================================================
   PDF CLIENT BADGE (modal)
   ========================================================= */
.pdf-client-badge {
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    color: #0369a1;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 12px;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* =========================================================
   ANIMATIONS
   ========================================================= */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* =========================================================
   CHART TITLE BLOCK
   ========================================================= */
.chart-title-block {
    text-align: center;
    margin-bottom: 14px;
}
.chart-dynamic-title {
    font-size: 16px;
    font-weight: 600;
    color: #1C33C3;
    letter-spacing: -0.3px;
}
.chart-dynamic-title strong {
    font-size: 18px;
}
.chart-subtitle {
    font-size: 11px;
    color: #94a3b8;
    margin-top: 3px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* =========================================================
   TOOLTIPS
   ========================================================= */
.tooltip-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 14px;
    height: 14px;
    background: #cbd5e1;
    color: #fff;
    border-radius: 50%;
    font-size: 9px;
    font-weight: 700;
    cursor: help;
    margin-left: 4px;
    flex-shrink: 0;
    vertical-align: middle;
    transition: background 0.2s;
    font-style: normal;
}
.tooltip-icon:hover { background: #1C33C3; }

.tooltip-bubble {
    position: absolute;
    z-index: 9999;
    background: #1e293b;
    color: #f8fafc;
    font-size: 12px;
    line-height: 1.5;
    padding: 8px 12px;
    border-radius: 8px;
    max-width: 240px;
    pointer-events: none;
    opacity: 0;
    transform: translateY(4px);
    transition: opacity 0.15s ease, transform 0.15s ease;
    box-shadow: 0 4px 16px rgba(0,0,0,0.2);
}
.tooltip-bubble.tooltip-visible {
    opacity: 1;
    transform: translateY(0);
}

/* =========================================================
   BTN CSV
   ========================================================= */
.btn-csv {
    background: linear-gradient(135deg, #059669, #047857);
    color: #fff;
    border: none;
}
.btn-csv:hover {
    background: linear-gradient(135deg, #047857, #065f46);
}

/* =========================================================
   CMP CHART WRAPPER
   ========================================================= */
.cmp-chart-wrap {
    position: relative;
    height: 200px;
    margin-bottom: 16px;
    background: #fff;
    border-radius: 10px;
    border: 1px solid #f1f5f9;
    padding: 8px;
}

/* =========================================================
   BOUTON GÉNÉRER UNE OFFRE
   ========================================================= */
.btn-offer {
    background: linear-gradient(135deg, #0f4c81, #1a73e8);
    color: #fff;
    border: none;
    box-shadow: 0 2px 8px rgba(26,115,232,0.30);
}
.btn-offer:hover {
    background: linear-gradient(135deg, #0d3f6e, #1558b0);
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(26,115,232,0.40);
}

/* =========================================================
   MODAL OFFRE
   ========================================================= */
.offer-modal-overlay {
    position: fixed; inset: 0; z-index: 9999;
    background: rgba(15,25,50,0.55);
    backdrop-filter: blur(4px);
    display: flex; align-items: center; justify-content: center;
    padding: 16px;
    animation: offerFadeIn 0.2s ease;
}
@keyframes offerFadeIn { from { opacity:0 } to { opacity:1 } }

.offer-modal {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 24px 60px rgba(0,0,0,0.22);
    width: 100%; max-width: 560px;
    max-height: 92vh; overflow-y: auto;
    display: flex; flex-direction: column;
    animation: offerSlideUp 0.25s ease;
}
@keyframes offerSlideUp { from { transform:translateY(24px); opacity:0 } to { transform:translateY(0); opacity:1 } }

.offer-modal-header {
    display: flex; align-items: center; gap: 10px;
    padding: 18px 20px 14px;
    border-bottom: 1px solid #e8edf5;
    position: sticky; top: 0; background: #fff; z-index: 1;
    border-radius: 16px 16px 0 0;
}
.offer-modal-header i.fa-file-contract { color: #1a73e8; font-size: 18px; }
.offer-modal-header h3 { flex:1; margin:0; font-size:15px; font-weight:700; color:#1e293b; }
.offer-close-btn {
    background: none; border: none; cursor: pointer;
    color: #94a3b8; font-size: 16px; padding: 4px 6px;
    border-radius: 6px; transition: background 0.15s, color 0.15s;
}
.offer-close-btn:hover { background: #f1f5f9; color: #475569; }

.offer-modal-body { padding: 20px; display: flex; flex-direction: column; gap: 4px; }

.offer-subtitle {
    margin: 0 0 16px; font-size: 13px; color: #64748b;
    line-height: 1.5;
}

.offer-section-title {
    font-size: 11px; font-weight: 700; color: #1a73e8;
    text-transform: uppercase; letter-spacing: 0.06em;
    margin: 14px 0 8px; display: flex; align-items: center; gap: 6px;
}
.offer-section-title i { font-size: 10px; }

.offer-field-row {
    display: flex; gap: 12px;
}
.offer-field-group {
    display: flex; flex-direction: column; gap: 5px; flex: 1;
    margin-bottom: 6px;
}
.offer-field-group label {
    font-size: 11px; font-weight: 600; color: #475569;
    text-transform: uppercase; letter-spacing: 0.04em;
}
.offer-input {
    padding: 9px 12px; border: 1.5px solid #e2e8f0;
    border-radius: 8px; font-size: 13px; color: #1e293b;
    transition: border-color 0.15s, box-shadow 0.15s;
    outline: none; background: #f8fafc;
}
.offer-input:focus {
    border-color: #1a73e8;
    box-shadow: 0 0 0 3px rgba(26,115,232,0.12);
    background: #fff;
}

.offer-pack-info {
    font-size: 12px; color: #64748b; margin-bottom: 10px;
}
.offer-pack-info strong { color: #1e293b; }

/* Slider Location / Investissement */
.offer-slider-wrap {
    display: flex; align-items: center; gap: 12px;
    margin-bottom: 14px;
}
.offer-slider-label {
    font-size: 12px; font-weight: 600; color: #94a3b8;
    transition: color 0.2s;
    user-select: none;
}
.offer-slider-label.active { color: #1e293b; }

.offer-toggle-track {
    position: relative; width: 52px; height: 28px;
    background: #1a73e8; border-radius: 14px;
    cursor: pointer; transition: background 0.2s;
    flex-shrink: 0;
}
.offer-toggle-track.is-right { background: #7c3aed; }
.offer-toggle-thumb {
    position: absolute; top: 3px; left: 3px;
    width: 22px; height: 22px;
    background: #fff; border-radius: 50%;
    box-shadow: 0 1px 4px rgba(0,0,0,0.2);
    transition: transform 0.2s ease;
}
.offer-toggle-track.is-right .offer-toggle-thumb { transform: translateX(24px); }

.offer-date-info {
    font-size: 12px; color: #64748b;
    background: #f1f5f9; border-radius: 8px;
    padding: 8px 12px; margin-top: 4px;
    display: flex; align-items: center; gap: 6px;
}
.offer-date-info i { color: #1a73e8; }
.offer-date-info strong { color: #1e293b; }

.offer-modal-footer {
    padding: 14px 20px 18px;
    border-top: 1px solid #e8edf5;
    display: flex; gap: 10px; justify-content: flex-end;
}

/* =========================================================
   OFFER MODAL — SECTION PACK (switch + toggles sur une ligne)
   ========================================================= */
.offer-pack-line {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
    flex-wrap: nowrap;
}

/* Switch PACK 1 / PACK 2 */
.offer-pack-sw {
    display: flex;
    background: #e2e8f0;
    border-radius: 20px;
    padding: 3px;
    position: relative;
    cursor: pointer;
    width: 140px;
    height: 34px;
    flex-shrink: 0;
    user-select: none;
}
.offer-pack-sw-bg {
    position: absolute;
    left: 3px; top: 3px;
    width: calc(50% - 3px);
    height: 28px;
    background: var(--primary-color);
    border-radius: 16px;
    transition: transform 0.3s cubic-bezier(0.4, 0.0, 0.2, 1);
    box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}
/* PACK 2 = rouge */
.offer-pack-sw.is-pack2 .offer-pack-sw-bg {
    transform: translateX(100%);
    background: var(--danger-color);
}
.offer-pack-sw-opt {
    flex: 1; text-align: center; z-index: 2;
    line-height: 28px; font-size: 11px; font-weight: 700;
    color: #64748b; transition: color 0.3s;
}
.offer-pack-sw-opt.active { color: #fff; }

/* Boutons Activé / Désactivé (badges, télécommandes) */
.offer-prod-toggle {
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    user-select: none;
    transition: all 0.2s;
    background: #e2e8f0;
    color: #94a3b8;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 5px;
}
.offer-prod-toggle.active {
    background: var(--primary-color);
    color: #fff;
    box-shadow: 0 2px 6px rgba(28,51,195,0.25);
}

/* Boutons validité +1/+2 mois */
.offer-validity-btn {
    padding: 0 10px;
    height: 36px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    border: 2px solid #e2e8f0;
    background: #f8fafc;
    color: #475569;
    white-space: nowrap;
    transition: all 0.15s;
    flex-shrink: 0;
}
.offer-validity-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background: #eff6ff;
}
/* Bouton actif (sélectionné) */
.offer-validity-btn.active {
    border-color: var(--primary-color);
    background: var(--primary-color);
    color: #fff;
}
.offer-validity-btn.active:hover {
    background: var(--primary-color-hover, #1a2db0);
}
/* Champ date actif (date saisie manuellement) */
.offer-date-active {
    border-color: var(--primary-color) !important;
    box-shadow: 0 0 0 2px rgba(28, 51, 195, 0.2) !important;
    outline: none;
}

/* Toggle sections (offre / observation) */
.offer-toggle-section {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 10px 12px;
}
.offer-toggle-section-header {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    user-select: none;
}
.offer-toggle-hint {
    font-size: 11px;
    color: #94a3b8;
}
.offer-textarea {
    width: 100%;
    resize: vertical;
    min-height: 64px;
    box-sizing: border-box;
    font-family: inherit;
    font-size: 13px;
    line-height: 1.5;
}

.btn-offer-generate {
    background: linear-gradient(135deg, #0f4c81, #1a73e8);
    color: #fff; border: none; padding: 10px 22px;
    border-radius: 9px; font-size: 13px; font-weight: 700;
    cursor: pointer; display: flex; align-items: center; gap: 7px;
    transition: all 0.18s; box-shadow: 0 2px 8px rgba(26,115,232,0.3);
}
.btn-offer-generate:hover:not(:disabled) {
    background: linear-gradient(135deg, #0d3f6e, #1558b0);
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(26,115,232,0.4);
}
.btn-offer-generate:disabled { opacity: 0.65; cursor: not-allowed; }

/* =========================================================
   TOOLTIP AMORTISSEMENT
   ========================================================= */
.amort-tooltip {
    position: static; display: inline-block; margin-left: 4px; vertical-align: middle;
}
.amort-tooltip-icon {
    display: inline-flex; align-items: center; justify-content: center;
    width: 16px; height: 16px; border-radius: 50%;
    background: #64748b; color: #fff; font-size: 10px; font-weight: 700;
    cursor: pointer; line-height: 1; user-select: none;
}
.amort-tooltip-box {
    display: none;
    position: fixed;
    background: #1e293b; color: #f8fafc; font-size: 12px; font-weight: 400;
    padding: 10px 14px; border-radius: 8px; width: 260px; z-index: 9999;
    line-height: 1.5; box-shadow: 0 4px 20px rgba(0,0,0,.4);
    pointer-events: none; white-space: normal;
}
.amort-tooltip:hover .amort-tooltip-box { display: block; }
