/* ============================================================
   SOLEA — Design system vanilla, mobile-first
   Cible : téléphone en plein soleil → contrastes forts, touch 44px
   ============================================================ */

:root {
    --bg: #FAFAF7;
    --surface: #FFFFFF;
    --primary: #F77F00;
    --primary-dark: #D96E00;
    --primary-soft: #FFF1E0;
    --secondary: #1D3557;
    --secondary-soft: #E8EDF5;
    --accent: #2A9D8F;
    --accent-soft: #E2F3F1;
    --danger: #E63946;
    --danger-soft: #FCE8EA;
    --warning: #E9A800;
    --warning-soft: #FBF3D9;
    --text: #1A1D21;
    --text-muted: #5C6470;
    --border: #E4E2DC;
    --radius: 12px;
    --radius-sm: 8px;
    --s1: 4px;
    --s2: 8px;
    --s3: 16px;
    --s4: 24px;
    --s5: 32px;
    --shadow: 0 1px 3px rgba(29, 53, 87, .08), 0 4px 14px rgba(29, 53, 87, .06);
    --shadow-lg: 0 8px 30px rgba(29, 53, 87, .16);
    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --bottombar-h: 62px;
    --topbar-h: 56px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    font-size: 16px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; }
a { color: var(--secondary); text-decoration: none; }
button { font-family: inherit; }
.icon { vertical-align: -0.22em; flex-shrink: 0; }

h1 { font-size: 1.45rem; font-weight: 800; letter-spacing: -.01em; }
h2 { font-size: 1.15rem; font-weight: 700; }
h3 { font-size: 1rem; font-weight: 700; }
.text-muted { color: var(--text-muted); }
.text-small { font-size: .85rem; }
.text-danger { color: var(--danger); }
.text-success { color: var(--accent); }
.text-right { text-align: right; }
.text-center { text-align: center; }
.nowrap { white-space: nowrap; }
.mt-1 { margin-top: var(--s1); } .mt-2 { margin-top: var(--s2); } .mt-3 { margin-top: var(--s3); } .mt-4 { margin-top: var(--s4); }
.mb-2 { margin-bottom: var(--s2); } .mb-3 { margin-bottom: var(--s3); } .mb-4 { margin-bottom: var(--s4); }
.flex { display: flex; align-items: center; gap: var(--s2); }
.flex-between { display: flex; align-items: center; justify-content: space-between; gap: var(--s2); }
.flex-wrap { flex-wrap: wrap; }
.grow { flex: 1; }
.hide-mobile { display: none !important; }

/* ---------- Layout app ---------- */
.app-shell { min-height: 100vh; }
.app-main {
    padding: var(--s3);
    padding-bottom: calc(var(--bottombar-h) + var(--s4) + env(safe-area-inset-bottom));
    max-width: 1280px;
    margin: 0 auto;
    width: 100%;
}

.topbar {
    position: sticky; top: 0; z-index: 40;
    height: var(--topbar-h);
    background: var(--secondary);
    color: #fff;
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 var(--s3);
}
.topbar .brand { display: flex; align-items: center; gap: var(--s2); color: #fff; font-weight: 800; font-size: 1.1rem; letter-spacing: -.01em; }
.topbar .brand .icon { color: var(--primary); }
.topbar-actions { display: flex; align-items: center; gap: var(--s1); }
.topbar-btn {
    position: relative; display: inline-flex; align-items: center; justify-content: center;
    width: 44px; height: 44px; border: 0; background: transparent; color: #fff;
    border-radius: var(--radius-sm); cursor: pointer;
}
.topbar-btn:active { background: rgba(255,255,255,.15); }
.notif-dot {
    position: absolute; top: 6px; right: 6px; min-width: 18px; height: 18px;
    background: var(--danger); color: #fff; border-radius: 9px;
    font-size: .68rem; font-weight: 700; line-height: 18px; text-align: center; padding: 0 4px;
    display: none;
}
.notif-dot.on { display: block; }

/* Bandeau impersonation / lecture seule */
.banner {
    padding: var(--s2) var(--s3);
    font-size: .9rem; font-weight: 600;
    display: flex; align-items: center; justify-content: space-between; gap: var(--s2);
    flex-wrap: wrap;
}
.app-shell > .banner { width: 100%; }
.banner-danger { background: var(--danger); color: #fff; }
.banner-warning { background: var(--warning-soft); color: #7a5b00; border-bottom: 1px solid #ecd9a0; }
.banner a, .banner button { color: inherit; text-decoration: underline; background: none; border: 0; cursor: pointer; font: inherit; }

/* Bottom bar mobile */
.bottombar {
    position: fixed; bottom: 0; left: 0; right: 0; z-index: 50;
    height: calc(var(--bottombar-h) + env(safe-area-inset-bottom));
    padding-bottom: env(safe-area-inset-bottom);
    background: var(--surface);
    border-top: 1px solid var(--border);
    display: grid; grid-template-columns: repeat(5, 1fr);
    box-shadow: 0 -2px 12px rgba(29,53,87,.08);
}
.bottombar a {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 2px; color: var(--text-muted); font-size: .68rem; font-weight: 600;
    min-height: 44px;
}
.bottombar a.active { color: var(--primary); }
.bottombar a .icon { width: 22px; height: 22px; }

/* Sidebar desktop */
.sidebar { display: none; }

@media (min-width: 900px) {
    .app-shell { display: grid; grid-template-columns: 232px 1fr; }
    .bottombar { display: none; }
    .topbar { grid-column: 2; background: var(--surface); color: var(--text); border-bottom: 1px solid var(--border); }
    .topbar .brand { display: none; }
    .topbar-btn { color: var(--secondary); }
    .topbar-btn:hover { background: var(--secondary-soft); }
    /* Les bannières (mode support, essai) restent dans la colonne contenu :
       grid-column 1/-1 entrerait en conflit avec la sidebar qui span 99 lignes */
    .app-shell > .banner { grid-column: 2; }
    .app-main { grid-column: 2; padding: var(--s4) var(--s5); padding-bottom: var(--s5); }
    .sidebar {
        display: flex; flex-direction: column;
        grid-row: 1 / span 99; grid-column: 1;
        position: sticky; top: 0; height: 100vh;
        background: var(--secondary); color: #fff;
        padding: var(--s3) var(--s2);
    }
    .sidebar .brand {
        display: flex; align-items: center; gap: var(--s2);
        color: #fff; font-weight: 800; font-size: 1.25rem;
        padding: var(--s2) var(--s3) var(--s4);
    }
    .sidebar .brand .icon { color: var(--primary); }
    .sidebar nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
    .sidebar nav a {
        display: flex; align-items: center; gap: 10px;
        color: rgba(255,255,255,.78); font-weight: 600; font-size: .93rem;
        padding: 11px var(--s3); border-radius: var(--radius-sm);
    }
    .sidebar nav a:hover { background: rgba(255,255,255,.08); color: #fff; }
    .sidebar nav a.active { background: var(--primary); color: #fff; }
    .sidebar .sidebar-foot { padding: var(--s2) var(--s3); font-size: .8rem; color: rgba(255,255,255,.5); }
    .hide-mobile { display: revert !important; }
    .hide-desktop { display: none !important; }
}

/* ---------- Boutons ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    min-height: 44px; padding: 0 18px;
    border-radius: var(--radius-sm); border: 1px solid transparent;
    font-size: .95rem; font-weight: 700; cursor: pointer;
    text-decoration: none; white-space: nowrap;
    transition: background .12s, transform .05s;
}
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-secondary { background: var(--secondary); color: #fff; }
.btn-secondary:hover { background: #16294a; }
.btn-outline { background: var(--surface); color: var(--secondary); border-color: var(--border); }
.btn-outline:hover { background: var(--secondary-soft); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-ghost { background: transparent; color: var(--secondary); }
.btn-ghost:hover { background: var(--secondary-soft); }
.btn-success { background: var(--accent); color: #fff; }
.btn-sm { min-height: 36px; padding: 0 12px; font-size: .85rem; }
.btn-lg { min-height: 52px; padding: 0 26px; font-size: 1.05rem; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.icon-btn {
    display: inline-flex; align-items: center; justify-content: center;
    width: 44px; height: 44px; min-height: 44px; padding: 0;
    border-radius: var(--radius-sm); border: 1px solid var(--border);
    background: var(--surface); color: var(--secondary); cursor: pointer;
}
.icon-btn:hover { background: var(--secondary-soft); }

/* ---------- Formulaires ---------- */
.field { margin-bottom: var(--s3); }
.field label { display: block; font-weight: 700; font-size: .88rem; margin-bottom: 6px; color: var(--secondary); }
.field .hint { font-size: .8rem; color: var(--text-muted); margin-top: 4px; }
input[type=text], input[type=email], input[type=password], input[type=tel],
input[type=number], input[type=date], input[type=time], input[type=datetime-local],
input[type=search], input[type=url], select, textarea {
    width: 100%; min-height: 44px;
    padding: 10px 12px;
    border: 1.5px solid var(--border); border-radius: var(--radius-sm);
    background: var(--surface); color: var(--text);
    font-size: 16px; font-family: inherit;
}
textarea { min-height: 90px; resize: vertical; }
input:focus, select:focus, textarea:focus {
    outline: none; border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(247, 127, 0, .18);
}
.field.has-error input, .field.has-error select { border-color: var(--danger); }
.field-error { color: var(--danger); font-size: .82rem; font-weight: 600; margin-top: 4px; }
.form-row { display: grid; gap: var(--s3); }
@media (min-width: 640px) {
    .form-row-2 { grid-template-columns: 1fr 1fr; }
    .form-row-3 { grid-template-columns: 1fr 1fr 1fr; }
}
.checkbox-line { display: flex; align-items: flex-start; gap: 10px; font-size: .92rem; }
.checkbox-line input { width: 22px; height: 22px; min-height: 22px; accent-color: var(--primary); flex-shrink: 0; margin-top: 2px; }

/* Slider */
input[type=range] { width: 100%; accent-color: var(--primary); min-height: 44px; }

/* Autocomplete commune */
.autocomplete { position: relative; }
.autocomplete-list {
    position: absolute; top: 100%; left: 0; right: 0; z-index: 30;
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg); max-height: 260px; overflow-y: auto; display: none;
}
.autocomplete-list.open { display: block; }
.autocomplete-item {
    display: flex; justify-content: space-between; gap: var(--s2);
    padding: 11px 14px; cursor: pointer; min-height: 44px; align-items: center;
}
.autocomplete-item:hover, .autocomplete-item.focus { background: var(--primary-soft); }
.autocomplete-item .cp { color: var(--text-muted); font-size: .85rem; }
.zone-tag { font-size: .7rem; font-weight: 700; padding: 2px 8px; border-radius: 99px; color: #fff; }

/* ---------- Cards ---------- */
.card {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: var(--s3);
    margin-bottom: var(--s3);
}
.card-title { display: flex; align-items: center; justify-content: space-between; gap: var(--s2); margin-bottom: var(--s3); }
.card-title h2 { display: flex; align-items: center; gap: 8px; }

/* ---------- KPI ---------- */
.kpi-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s2); margin-bottom: var(--s3); }
@media (min-width: 900px) { .kpi-grid { grid-template-columns: repeat(3, 1fr); gap: var(--s3); } }
@media (min-width: 1100px) { .kpi-grid { grid-template-columns: repeat(6, 1fr); } }
.kpi {
    background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow);
    padding: var(--s3); display: flex; flex-direction: column; gap: 2px;
}
.kpi .kpi-label { font-size: .74rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted); }
.kpi .kpi-value { font-size: 1.5rem; font-weight: 800; letter-spacing: -.02em; color: var(--secondary); }
.kpi .kpi-sub { font-size: .78rem; color: var(--text-muted); }
.kpi.kpi-primary .kpi-value { color: var(--primary); }
.kpi.kpi-accent .kpi-value { color: var(--accent); }
.kpi.kpi-danger .kpi-value { color: var(--danger); }

/* ---------- Badges statuts ---------- */
.badge {
    display: inline-flex; align-items: center; gap: 5px;
    font-size: .76rem; font-weight: 700; padding: 3px 10px; border-radius: 99px;
    white-space: nowrap;
}
.badge-nouveau { background: var(--secondary-soft); color: var(--secondary); }
.badge-contacte { background: #E3F0FB; color: #1565AE; }
.badge-rdv_pris { background: #EAE4FA; color: #5B3FA8; }
.badge-etude { background: var(--warning-soft); color: #8a6700; }
.badge-devis_envoye { background: var(--primary-soft); color: var(--primary-dark); }
.badge-negociation { background: #FFE8D9; color: #C2410C; }
.badge-signe { background: var(--accent-soft); color: #19756B; }
.badge-installe { background: #DCF5E3; color: #1B7A3D; }
.badge-perdu { background: var(--danger-soft); color: var(--danger); }
.badge-brouillon { background: var(--secondary-soft); color: var(--secondary); }
.badge-envoye { background: #E3F0FB; color: #1565AE; }
.badge-accepte { background: var(--accent-soft); color: #19756B; }
.badge-refuse { background: var(--danger-soft); color: var(--danger); }
.badge-expire { background: var(--warning-soft); color: #8a6700; }
.badge-emise { background: #E3F0FB; color: #1565AE; }
.badge-payee { background: #DCF5E3; color: #1B7A3D; }
.badge-partielle { background: var(--warning-soft); color: #8a6700; }
.badge-retard { background: var(--danger-soft); color: var(--danger); }
.badge-annulee { background: #EEE; color: #666; }
.badge-essai { background: #E3F0FB; color: #1565AE; }
.badge-actif { background: #DCF5E3; color: #1B7A3D; }
.badge-suspendu { background: var(--danger-soft); color: var(--danger); }
.badge-zone { color: #fff; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 calc(-1 * var(--s3)); padding: 0 var(--s3); }
.table { width: 100%; border-collapse: collapse; font-size: .92rem; min-width: 560px; }
.table th {
    text-align: left; font-size: .74rem; text-transform: uppercase; letter-spacing: .04em;
    color: var(--text-muted); font-weight: 700; padding: 10px 12px;
    border-bottom: 2px solid var(--border);
}
.table td { padding: 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr { cursor: default; }
.table tbody tr.clickable { cursor: pointer; }
.table tbody tr.clickable:hover { background: var(--primary-soft); }

/* ---------- Liste mobile (cards de lead) ---------- */
.item-list { display: flex; flex-direction: column; gap: var(--s2); }
.item-card {
    background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow);
    padding: var(--s3); display: block; color: var(--text);
}
.item-card:active { background: var(--primary-soft); }
.item-card .item-top { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--s2); margin-bottom: 4px; }
.item-card .item-name { font-weight: 700; font-size: 1rem; }
.item-card .item-meta { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: .84rem; color: var(--text-muted); align-items: center; }

/* ---------- Kanban ---------- */
.kanban {
    display: flex; gap: var(--s2);
    overflow-x: auto; -webkit-overflow-scrolling: touch;
    padding-bottom: var(--s3);
    margin: 0 calc(-1 * var(--s3)); padding-left: var(--s3); padding-right: var(--s3);
    scroll-snap-type: x mandatory;
}
.kanban-col {
    flex: 0 0 272px; max-width: 272px;
    background: #F1EFE9; border-radius: var(--radius);
    display: flex; flex-direction: column;
    max-height: calc(100vh - 230px);
    scroll-snap-align: start;
}
.kanban-col-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 10px 12px; font-weight: 700; font-size: .85rem;
    border-top: 3px solid var(--secondary); border-radius: var(--radius) var(--radius) 0 0;
}
.kanban-col-head .count { background: var(--surface); border-radius: 99px; padding: 1px 9px; font-size: .76rem; }
.kanban-cards { padding: 0 var(--s2) var(--s2); overflow-y: auto; display: flex; flex-direction: column; gap: var(--s2); min-height: 60px; }
.kanban-card {
    background: var(--surface); border-radius: var(--radius-sm); box-shadow: var(--shadow);
    padding: 12px; cursor: grab; display: block; color: var(--text);
}
.kanban-card.dragging { opacity: .45; cursor: grabbing; }
.kanban-col.drag-over .kanban-cards { outline: 2px dashed var(--primary); outline-offset: -4px; border-radius: var(--radius-sm); }
.kanban-card .kc-name { font-weight: 700; font-size: .92rem; }
.kanban-card .kc-meta { font-size: .8rem; color: var(--text-muted); display: flex; flex-wrap: wrap; gap: 2px 10px; margin-top: 4px; }
.kanban-card .kc-actions { display: flex; gap: 6px; margin-top: 8px; }
.kc-mini-btn {
    flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 5px;
    min-height: 36px; border-radius: 7px; border: 1px solid var(--border);
    background: var(--bg); color: var(--secondary); font-size: .78rem; font-weight: 700;
}
.kc-mini-btn.wa { color: #128C50; }

/* ---------- Vue switch / filtres ---------- */
.view-switch { display: inline-flex; background: var(--secondary-soft); border-radius: var(--radius-sm); padding: 3px; }
.view-switch a {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 8px 14px; min-height: 38px; border-radius: 6px;
    font-size: .86rem; font-weight: 700; color: var(--secondary);
}
.view-switch a.active { background: var(--surface); box-shadow: var(--shadow); }
.filters { display: flex; gap: var(--s2); flex-wrap: wrap; margin-bottom: var(--s3); }
.filters select, .filters input { width: auto; min-width: 130px; flex: 1; }
.filters input[type=search] { flex: 2; min-width: 160px; }

/* ---------- Timeline activités ---------- */
.timeline { list-style: none; }
.timeline li { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.timeline li:last-child { border-bottom: 0; }
.timeline .tl-icon {
    width: 36px; height: 36px; flex-shrink: 0;
    background: var(--secondary-soft); color: var(--secondary);
    border-radius: 50%; display: flex; align-items: center; justify-content: center;
}
.timeline .tl-body { flex: 1; font-size: .92rem; }
.timeline .tl-date { font-size: .78rem; color: var(--text-muted); }

/* ---------- Modal ---------- */
.modal-backdrop {
    position: fixed; inset: 0; background: rgba(20, 26, 38, .55); z-index: 90;
    display: none; align-items: flex-end; justify-content: center;
}
.modal-backdrop.open { display: flex; }
.modal {
    background: var(--surface); border-radius: var(--radius) var(--radius) 0 0;
    width: 100%; max-width: 560px; max-height: 92vh; overflow-y: auto;
    padding: var(--s4) var(--s3) calc(var(--s4) + env(safe-area-inset-bottom));
    animation: slideUp .18s ease-out;
}
@keyframes slideUp { from { transform: translateY(40px); opacity: .6; } to { transform: none; opacity: 1; } }
@media (min-width: 640px) {
    .modal-backdrop { align-items: center; padding: var(--s3); }
    .modal { border-radius: var(--radius); }
}
.modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: var(--s3); }

/* ---------- Flash / toasts ---------- */
.flash-stack { position: fixed; top: calc(var(--topbar-h) + 8px); left: 50%; transform: translateX(-50%); z-index: 100; width: min(94vw, 480px); display: flex; flex-direction: column; gap: var(--s2); }
.flash {
    padding: 13px 16px; border-radius: var(--radius-sm); box-shadow: var(--shadow-lg);
    font-weight: 600; font-size: .92rem; display: flex; align-items: center; gap: 10px;
    animation: slideDown .2s ease-out;
}
@keyframes slideDown { from { transform: translateY(-16px); opacity: 0; } to { transform: none; opacity: 1; } }
.flash-success { background: var(--accent); color: #fff; }
.flash-error { background: var(--danger); color: #fff; }
.flash-info { background: var(--secondary); color: #fff; }

/* ---------- Dropdown ---------- */
.dropdown { position: relative; }
.dropdown-menu {
    position: absolute; right: 0; top: calc(100% + 4px); z-index: 60;
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg); min-width: 210px; display: none; overflow: hidden;
}
.dropdown-menu.open { display: block; }
.dropdown-menu a, .dropdown-menu button {
    display: flex; align-items: center; gap: 10px; width: 100%;
    padding: 12px 14px; min-height: 44px; font-size: .9rem; font-weight: 600;
    color: var(--text); background: none; border: 0; cursor: pointer; text-align: left;
}
.dropdown-menu a:hover, .dropdown-menu button:hover { background: var(--primary-soft); }
.dropdown-menu .sep { border-top: 1px solid var(--border); }

/* ---------- Empty state ---------- */
.empty {
    text-align: center; padding: var(--s5) var(--s3); color: var(--text-muted);
}
.empty .icon { width: 44px; height: 44px; color: var(--border); margin-bottom: var(--s2); }
.empty p { margin-bottom: var(--s3); }

/* ---------- Page head ---------- */
.page-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s2); margin-bottom: var(--s3); flex-wrap: wrap; }
.page-head .back { display: inline-flex; align-items: center; gap: 6px; color: var(--text-muted); font-weight: 600; font-size: .88rem; margin-bottom: 4px; }

/* ---------- Onglets fiche ---------- */
.tabs { display: flex; gap: 2px; border-bottom: 2px solid var(--border); margin-bottom: var(--s3); overflow-x: auto; }
.tabs a {
    padding: 11px 16px; font-weight: 700; font-size: .9rem; color: var(--text-muted);
    border-bottom: 3px solid transparent; margin-bottom: -2px; white-space: nowrap; min-height: 44px; display: inline-flex; align-items: center; gap: 7px;
}
.tabs a.active { color: var(--primary); border-bottom-color: var(--primary); }

/* ---------- Carte SVG Guadeloupe ---------- */
.gp-map-wrap { display: flex; flex-direction: column; gap: var(--s2); align-items: center; }
.gp-map { width: 100%; max-width: 420px; height: auto; }
.gp-map path, .gp-map ellipse { transition: opacity .15s; cursor: pointer; }
.gp-map path:hover, .gp-map ellipse:hover { opacity: .75; }
.gp-map text { font-family: var(--font); pointer-events: none; }
.gp-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; justify-content: center; font-size: .8rem; font-weight: 600; }
.gp-legend span { display: inline-flex; align-items: center; gap: 6px; }
.gp-legend i { width: 12px; height: 12px; border-radius: 4px; display: inline-block; }

/* ---------- Calendrier ---------- */
.cal-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s2); margin-bottom: var(--s3); flex-wrap: wrap; }
.cal-title { font-weight: 800; font-size: 1.1rem; text-transform: capitalize; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); background: var(--border); gap: 1px; border-radius: var(--radius-sm); overflow: hidden; }
.cal-dow { background: var(--secondary-soft); padding: 8px 4px; text-align: center; font-size: .72rem; font-weight: 700; text-transform: uppercase; color: var(--secondary); }
.cal-cell { background: var(--surface); min-height: 92px; padding: 4px; cursor: pointer; position: relative; }
.cal-cell:hover { background: var(--primary-soft); }
.cal-cell.other { background: #F4F3EE; color: var(--text-muted); }
.cal-cell.today .cal-day { background: var(--primary); color: #fff; }
.cal-day { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: 50%; font-size: .82rem; font-weight: 700; }
.cal-ev {
    display: block; font-size: .7rem; font-weight: 700; color: #fff;
    border-radius: 4px; padding: 2px 5px; margin-top: 2px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cal-more { font-size: .68rem; color: var(--text-muted); font-weight: 700; }
.cal-week { display: grid; grid-template-columns: repeat(7, 1fr); gap: var(--s2); }
.agenda-day { margin-bottom: var(--s3); }
.agenda-day h3 { font-size: .85rem; text-transform: capitalize; color: var(--text-muted); margin-bottom: var(--s2); position: sticky; top: var(--topbar-h); background: var(--bg); padding: 6px 0; z-index: 5; }
.agenda-ev {
    display: flex; gap: 12px; background: var(--surface); border-radius: var(--radius);
    box-shadow: var(--shadow); padding: 12px; margin-bottom: var(--s2);
    border-left: 4px solid var(--secondary); cursor: pointer;
}
.agenda-ev .ae-time { font-weight: 800; font-size: .9rem; white-space: nowrap; }
.agenda-ev .ae-body { flex: 1; min-width: 0; }
.agenda-ev .ae-title { font-weight: 700; font-size: .95rem; }
.agenda-ev .ae-meta { font-size: .8rem; color: var(--text-muted); display: flex; gap: 10px; flex-wrap: wrap; }

/* Couleurs types d'événements */
.ev-rdv_decouverte { border-color: #1565AE; } .bg-ev-rdv_decouverte { background: #1565AE; }
.ev-rdv_signature { border-color: var(--accent); } .bg-ev-rdv_signature { background: var(--accent); }
.ev-visite_technique { border-color: #5B3FA8; } .bg-ev-visite_technique { background: #5B3FA8; }
.ev-pose { border-color: var(--primary); } .bg-ev-pose { background: var(--primary); }
.ev-relance { border-color: var(--warning); } .bg-ev-relance { background: var(--warning); }
.ev-autre { border-color: #5C6470; } .bg-ev-autre { background: #5C6470; }

/* ---------- Document (devis/facture) ---------- */
.doc-lines { width: 100%; border-collapse: collapse; font-size: .9rem; }
.doc-lines th { text-align: left; font-size: .72rem; text-transform: uppercase; color: var(--text-muted); padding: 8px; border-bottom: 2px solid var(--border); }
.doc-lines td { padding: 8px; border-bottom: 1px solid var(--border); vertical-align: top; }
.doc-totaux { margin-left: auto; max-width: 320px; width: 100%; margin-top: var(--s3); }
.doc-totaux .row { display: flex; justify-content: space-between; padding: 6px 0; font-size: .95rem; }
.doc-totaux .row.total { font-size: 1.2rem; font-weight: 800; border-top: 2px solid var(--secondary); padding-top: 10px; color: var(--secondary); }
.ligne-row td { padding: 6px 4px; }
.ligne-row input { min-height: 40px; padding: 6px 8px; font-size: .9rem; }
.ligne-row .ligne-designation { min-width: 180px; }

/* ---------- Simulation ---------- */
.sim-result-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s2); }
@media (min-width: 760px) { .sim-result-grid { grid-template-columns: repeat(4, 1fr); } }
.sim-big {
    background: linear-gradient(135deg, var(--secondary), #2A4A7B);
    color: #fff; border-radius: var(--radius); padding: var(--s4) var(--s3);
    text-align: center; margin-bottom: var(--s3);
}
.sim-big .val { font-size: 2.2rem; font-weight: 800; letter-spacing: -.02em; color: #FFD166; }
.sim-bars { display: flex; flex-direction: column; gap: 10px; }
.sim-bar-label { font-size: .82rem; font-weight: 700; margin-bottom: 3px; display: flex; justify-content: space-between; }
.sim-bar { height: 26px; border-radius: 7px; background: var(--secondary-soft); overflow: hidden; }
.sim-bar > div { height: 100%; border-radius: 7px; }

/* ---------- Checklist ---------- */
.checklist { list-style: none; }
.checklist li { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--border); }
.checklist li:last-child { border-bottom: 0; }
.checklist .done { text-decoration: line-through; color: var(--text-muted); }
.check-toggle {
    width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--border);
    background: var(--surface); cursor: pointer; flex-shrink: 0;
    display: inline-flex; align-items: center; justify-content: center; color: transparent;
}
.check-toggle.on { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ---------- Auth (login/signup) ---------- */
.auth-wrap { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: var(--s3); background: linear-gradient(160deg, var(--secondary) 0%, #2A4A7B 60%, var(--primary) 160%); }
.auth-card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow-lg); width: 100%; max-width: 430px; padding: var(--s5) var(--s4); }
.auth-brand { display: flex; align-items: center; justify-content: center; gap: 10px; font-size: 1.6rem; font-weight: 800; color: var(--secondary); margin-bottom: var(--s2); }
.auth-brand .icon { color: var(--primary); }
.auth-sub { text-align: center; color: var(--text-muted); margin-bottom: var(--s4); font-size: .92rem; }

/* ---------- Wizard onboarding ---------- */
.wizard-steps { display: flex; gap: var(--s2); margin-bottom: var(--s4); }
.wizard-step { flex: 1; text-align: center; font-size: .78rem; font-weight: 700; color: var(--text-muted); }
.wizard-step .dot {
    width: 34px; height: 34px; border-radius: 50%; margin: 0 auto 5px;
    background: var(--secondary-soft); color: var(--secondary);
    display: flex; align-items: center; justify-content: center; font-weight: 800;
}
.wizard-step.active .dot { background: var(--primary); color: #fff; }
.wizard-step.done .dot { background: var(--accent); color: #fff; }

/* ---------- Pagination ---------- */
.pagination { display: flex; gap: var(--s1); justify-content: center; margin-top: var(--s3); flex-wrap: wrap; }
.pagination a, .pagination span {
    min-width: 44px; min-height: 44px; display: inline-flex; align-items: center; justify-content: center;
    border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface);
    font-weight: 700; font-size: .9rem; color: var(--secondary); padding: 0 10px;
}
.pagination .current { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ---------- Progress (checklist démarrage) ---------- */
.progress { height: 10px; border-radius: 6px; background: var(--secondary-soft); overflow: hidden; }
.progress > div { height: 100%; background: var(--accent); border-radius: 6px; transition: width .3s; }

/* ============================================================
   LANDING PAGE
   ============================================================ */
.landing { background: var(--bg); }
.landing-header {
    position: sticky; top: 0; z-index: 50;
    background: rgba(250, 250, 247, .92); backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--border);
}
.landing-header-inner {
    max-width: 1100px; margin: 0 auto; padding: 0 var(--s3);
    height: 64px; display: flex; align-items: center; justify-content: space-between;
}
.landing-brand { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 1.3rem; color: var(--secondary); }
.landing-brand .icon { color: var(--primary); }
.landing-nav { display: none; gap: var(--s4); }
@media (min-width: 800px) { .landing-nav { display: flex; } }
.landing-nav a { font-weight: 600; font-size: .92rem; color: var(--text); }
.landing-nav a:hover { color: var(--primary); }
.landing section { padding: var(--s5) var(--s3); }
.landing-inner { max-width: 1100px; margin: 0 auto; }

.hero { background: linear-gradient(165deg, var(--secondary) 0%, #24477A 70%, #2A9D8F 170%); color: #fff; padding: 56px var(--s3) 64px !important; }
.hero .landing-inner { display: grid; gap: var(--s4); align-items: center; }
@media (min-width: 900px) { .hero .landing-inner { grid-template-columns: 1.05fr .95fr; gap: var(--s5); } }
.hero h1 { font-size: clamp(1.9rem, 5vw, 2.9rem); line-height: 1.12; margin-bottom: var(--s3); }
.hero h1 em { color: #FFD166; font-style: normal; }
.hero p.lead { font-size: 1.08rem; color: rgba(255,255,255,.85); margin-bottom: var(--s4); max-width: 520px; }
.hero-badge {
    display: inline-flex; align-items: center; gap: 8px;
    background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.25);
    padding: 6px 14px; border-radius: 99px; font-size: .82rem; font-weight: 700; margin-bottom: var(--s3);
}
.hero-cta { display: flex; gap: var(--s2); flex-wrap: wrap; }
.hero-note { font-size: .82rem; color: rgba(255,255,255,.7); margin-top: var(--s2); }
.hero-shot {
    background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow-lg);
    padding: var(--s3); color: var(--text);
}

.section-title { text-align: center; max-width: 640px; margin: 0 auto var(--s5); }
.section-title h2 { font-size: clamp(1.5rem, 4vw, 2.1rem); font-weight: 800; margin-bottom: var(--s2); }
.section-title p { color: var(--text-muted); }
.feat-grid { display: grid; gap: var(--s3); }
@media (min-width: 700px) { .feat-grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1000px) { .feat-grid { grid-template-columns: 1fr 1fr 1fr; } }
.feat {
    background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow);
    padding: var(--s4);
}
.feat .feat-icon {
    width: 48px; height: 48px; border-radius: var(--radius-sm);
    background: var(--primary-soft); color: var(--primary);
    display: flex; align-items: center; justify-content: center; margin-bottom: var(--s3);
}
.feat h3 { margin-bottom: var(--s2); }
.feat p { font-size: .92rem; color: var(--text-muted); }

.pricing-grid { display: grid; gap: var(--s3); max-width: 820px; margin: 0 auto; }
@media (min-width: 760px) { .pricing-grid { grid-template-columns: 1fr 1fr; } }
.price-card {
    background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow);
    padding: var(--s4); display: flex; flex-direction: column; gap: var(--s3);
    border: 2px solid transparent;
}
.price-card.featured { border-color: var(--primary); position: relative; }
.price-tag { position: absolute; top: -13px; left: 50%; transform: translateX(-50%); background: var(--primary); color: #fff; font-size: .74rem; font-weight: 800; padding: 4px 14px; border-radius: 99px; }
.price-amount { font-size: 2.4rem; font-weight: 800; color: var(--secondary); }
.price-amount small { font-size: 1rem; color: var(--text-muted); font-weight: 600; }
.price-card ul { list-style: none; display: flex; flex-direction: column; gap: 9px; font-size: .92rem; }
.price-card ul li { display: flex; gap: 9px; align-items: flex-start; }
.price-card ul .icon { color: var(--accent); margin-top: 2px; }

.faq-list { max-width: 720px; margin: 0 auto; display: flex; flex-direction: column; gap: var(--s2); }
.faq-item { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); }
.faq-item summary {
    padding: var(--s3) var(--s4); font-weight: 700; cursor: pointer; list-style: none;
    display: flex; justify-content: space-between; align-items: center; gap: var(--s2); min-height: 44px;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary .icon { transition: transform .15s; flex-shrink: 0; }
.faq-item[open] summary .icon { transform: rotate(180deg); }
.faq-item .faq-body { padding: 0 var(--s4) var(--s3); color: var(--text-muted); font-size: .94rem; }

.landing-cta-final { background: linear-gradient(135deg, var(--primary), #FF9E2C); color: #fff; text-align: center; }
.landing-cta-final h2 { font-size: clamp(1.5rem, 4vw, 2rem); margin-bottom: var(--s3); }
.landing-footer { background: var(--secondary); color: rgba(255,255,255,.7); padding: var(--s4) var(--s3); font-size: .85rem; }
.landing-footer .landing-inner { display: flex; justify-content: space-between; gap: var(--s3); flex-wrap: wrap; }
.landing-footer a { color: rgba(255,255,255,.85); }

/* Mini-mockup app dans le hero */
.mock-row { display: flex; justify-content: space-between; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--border); font-size: .85rem; }
.mock-row:last-child { border-bottom: 0; }
.mock-kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s2); margin-bottom: var(--s3); }
.mock-kpi { background: var(--bg); border-radius: var(--radius-sm); padding: 10px; text-align: center; }
.mock-kpi b { display: block; font-size: 1.1rem; color: var(--secondary); }
.mock-kpi span { font-size: .68rem; color: var(--text-muted); font-weight: 700; text-transform: uppercase; }

/* ---------- Print ---------- */
@media print {
    .sidebar, .bottombar, .topbar, .banner, .btn, .page-head .btn { display: none !important; }
    .app-main { padding: 0; }
}
