/* ============================================================
   Plus personne à la rue — Charte graphique Le Souffle du Nord
   Bleu #000090 · Orange #FF4900 · Magenta #FF007D
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Droid+Sans:wght@400;700&family=Poppins:wght@700;800&display=swap');

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --teal:        #000090;  /* Bleu marque */
    --teal-dark:   #000070;
    --teal-light:  #EAEAF8;
    --orange:      #FF4900;  /* Orange marque */
    --orange-dark: #CC3A00;
    --orange-light:#FFF2ED;
    --magenta:     #FF007D;  /* Magenta marque */
    --cream:       #F7F5FC;
    --text:        #1A2333;
    --text-light:  #5A6478;
    --border:      #DDD8D2;
    --white:       #FFFFFF;
    --success:     #1E7A4A;
    --error:       #C0392B;
}

body {
    font-family: 'Droid Sans', system-ui, sans-serif;
    font-size: 1rem;
    line-height: 1.65;
    color: var(--text);
    background: var(--cream);
}

/* ============================================================
   HEADER PUBLIC
   ============================================================ */
.site-header {
    background: var(--white);
    border-bottom: 3px solid var(--orange);
    padding: 1rem 2rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}
.site-header .logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    line-height: 1;
}
.site-header .logo img { display: block; }

/* ============================================================
   HERO FORMULAIRE
   ============================================================ */
.form-hero {
    background: linear-gradient(135deg, var(--teal) 0%, var(--teal-dark) 100%);
    color: var(--white);
    padding: 3rem 2rem;
    text-align: center;
}
.form-hero h1 {
    font-family: 'Barbieri Black', 'Poppins', sans-serif;
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 0.75rem;
    line-height: 1.2;
}
.form-hero p {
    max-width: 620px;
    margin: 0 auto;
    font-size: 1.05rem;
    opacity: 0.9;
}

/* ============================================================
   CONTENEUR FORMULAIRE
   ============================================================ */
.form-container {
    max-width: 740px;
    margin: 2.5rem auto;
    padding: 0 1rem 4rem;
}
.form-container--narrow { max-width: 440px; }

/* ============================================================
   SECTIONS DU FORMULAIRE
   ============================================================ */
.form-section {
    background: var(--white);
    border-radius: 16px;
    padding: 2rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 12px rgba(0,0,144,0.08);
    border-left: 4px solid var(--teal);
}
.hidden { display: none; }

.section-title {
    font-family: 'Barbieri Black', 'Poppins', sans-serif;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--teal);
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.section-title .emoji { font-size: 1.2rem; }

/* ============================================================
   CHAMPS
   ============================================================ */
.field { margin-bottom: 1.4rem; }
.field:last-child { margin-bottom: 0; }

.field label {
    display: block;
    font-weight: 700;
    font-size: 0.95rem;
    margin-bottom: 0.35rem;
    color: var(--text);
}
.field--inline {
    display: flex;
    align-items: flex-end;
    gap: 0.75rem;
    flex-wrap: wrap;
}
.field--inline label { margin-bottom: 0; white-space: nowrap; }

.hint {
    font-size: 0.82rem;
    color: var(--text-light);
    margin-bottom: 0.45rem;
    font-style: italic;
}
.required { color: var(--orange); margin-left: 2px; }

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="date"],
select,
textarea {
    width: 100%;
    padding: 0.6rem 0.9rem;
    border: 2px solid var(--border);
    border-radius: 10px;
    font-size: 1rem;
    font-family: 'Droid Sans', sans-serif;
    background: var(--white);
    color: var(--text);
    transition: border-color 0.2s, box-shadow 0.2s;
    appearance: auto;
}
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--teal);
    box-shadow: 0 0 0 3px rgba(0,0,144,0.12);
}

/* ============================================================
   RADIO / CHECKBOX STYLISÉS
   ============================================================ */
.radio-group, .checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.radio-option, .checkbox-option {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border: 2px solid var(--border);
    border-radius: 10px;
    cursor: pointer;
    transition: border-color 0.18s, background 0.18s;
    font-weight: 600;
    font-size: 0.95rem;
}
.radio-option:hover, .checkbox-option:hover {
    border-color: var(--teal);
    background: var(--teal-light);
}
.radio-option input, .checkbox-option input {
    width: auto;
    margin-top: 0.15rem;
    flex-shrink: 0;
    accent-color: var(--teal);
}
.radio-option input:checked ~ span,
.checkbox-option input:checked ~ span {
    color: var(--teal);
}
.radio-option:has(input:checked),
.checkbox-option:has(input:checked) {
    border-color: var(--teal);
    background: var(--teal-light);
}

/* Situation cards — plus grandes */
.situation-group { display: flex; flex-direction: column; gap: 0.75rem; }
.situation-option {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    border: 2px solid var(--border);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.18s;
    font-weight: 700;
    font-size: 1rem;
}
.situation-option:hover { border-color: var(--orange); background: var(--orange-light); }
.situation-option:has(input:checked) {
    border-color: var(--orange);
    background: var(--orange-light);
    color: var(--orange-dark);
}
.situation-option input { accent-color: var(--orange); flex-shrink: 0; }
.situation-option .sit-icon { font-size: 1.5rem; }

/* Consentements */
.consent-option {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.9rem 1rem;
    border: 2px solid var(--border);
    border-radius: 10px;
    cursor: pointer;
    font-size: 0.88rem;
    line-height: 1.5;
    transition: border-color 0.18s, background 0.18s;
}
.consent-option:has(input:checked) {
    border-color: var(--teal);
    background: var(--teal-light);
}
.consent-option input { accent-color: var(--teal); flex-shrink: 0; margin-top: 0.2rem; }

/* ============================================================
   BOUTONS
   ============================================================ */
.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.8rem 2rem;
    background: var(--orange);
    color: var(--white);
    border: none;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 800;
    font-family: 'Barbieri Black', 'Poppins', sans-serif;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.2s, transform 0.1s;
    letter-spacing: 0.01em;
}
.btn-primary:hover { background: var(--orange-dark); transform: translateY(-1px); }
.btn-primary:active { transform: translateY(0); }

.btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.65rem 1.5rem;
    background: transparent;
    color: var(--teal);
    border: 2px solid var(--teal);
    border-radius: 50px;
    font-size: 0.95rem;
    font-weight: 700;
    font-family: 'Barbieri Black', 'Poppins', sans-serif;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s;
}
.btn-secondary:hover { background: var(--teal); color: var(--white); }

.btn-small {
    padding: 0.3rem 0.9rem;
    background: var(--teal);
    color: var(--white);
    border-radius: 50px;
    text-decoration: none;
    font-size: 0.82rem;
    font-weight: 700;
    white-space: nowrap;
    transition: background 0.2s;
}
.btn-small:hover { background: var(--teal-dark); }

.form-submit { margin-top: 0.5rem; text-align: center; }

/* ============================================================
   ALERTES
   ============================================================ */
.alert {
    padding: 1rem 1.25rem;
    border-radius: 10px;
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
    font-weight: 600;
}
.alert ul { padding-left: 1.25rem; margin-top: 0.25rem; font-weight: 400; }
.alert-error   { background: #fdecea; border-left: 4px solid var(--error); color: #7b1d1d; }
.alert-success { background: #e9f7ef; border-left: 4px solid var(--success); color: #1a5c34; }

/* ============================================================
   PAGE MERCI / REDIRECTION
   ============================================================ */
.success-page {
    min-height: 70vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}
.success-card {
    background: var(--white);
    border-radius: 20px;
    padding: 3rem 2.5rem;
    max-width: 560px;
    text-align: center;
    box-shadow: 0 4px 24px rgba(0,0,144,0.12);
}
.success-card .big-emoji { font-size: 3.5rem; margin-bottom: 1rem; display: block; }
.success-card h1 {
    font-family: 'Barbieri Black', 'Poppins', sans-serif;
    font-size: 1.6rem;
    color: var(--teal);
    margin-bottom: 1rem;
}
.success-card p { color: var(--text-light); margin-bottom: 0.75rem; }

.merci-contact {
    background: #F0F0FA;
    border: 1.5px solid #B0B0E0;
    border-radius: 12px;
    padding: 1.1rem 1.4rem;
    margin: 1.25rem 0;
    text-align: left;
}
.merci-contact-title {
    font-weight: 700;
    color: var(--teal) !important;
    margin-bottom: 0.6rem !important;
}
.merci-assos {
    list-style: none;
    padding: 0;
    margin: 0;
}
.merci-assos li {
    display: flex;
    align-items: baseline;
    gap: 0.6rem;
    padding: 0.35rem 0;
    border-bottom: 1px solid #D6D6F0;
    font-size: 0.95rem;
    color: var(--text);
}
.merci-assos li:last-child { border-bottom: none; }
.merci-assos strong { color: var(--teal); }
.merci-tel {
    font-size: 0.9rem;
    color: var(--text-light);
}
.merci-note {
    font-size: 0.85rem;
    color: var(--orange);
    font-style: italic;
}
.form-hero-sub {
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.85);
    font-style: italic;
    margin-top: 0.25rem;
}
.info-bloc {
    background: #F0F0FA;
    border-left: 4px solid var(--teal);
    border-radius: 0 12px 12px 0;
    padding: 1.1rem 1.4rem;
}
.field--inbloc {
    margin-top: 1rem;
    padding-top: 0.9rem;
    border-top: 1px solid #B0B0E0;
}
.info-bloc-title {
    font-family: 'Barbieri Black', 'Poppins', sans-serif;
    font-weight: 700;
    font-size: 1rem;
    color: var(--teal);
    margin-bottom: 0.5rem;
}
.merci-email-note {
    font-size: 0.85rem !important;
    color: #aaa !important;
    margin-top: 1.25rem !important;
}

/* ============================================================
   NAVBAR ADMIN
   ============================================================ */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.85rem 1.75rem;
    background: var(--teal-dark);
    color: var(--white);
    flex-wrap: wrap;
    gap: 0.5rem;
}
.navbar-brand {
    display: flex;
    align-items: center;
    text-decoration: none;
}
.navbar-brand img { display: block; }
.navbar-brand span { color: #FF8855; }
.navbar-links { display: flex; align-items: center; gap: 1.25rem; flex-wrap: wrap; }
.navbar-links a {
    color: rgba(255,255,255,0.85);
    text-decoration: none;
    font-size: 0.88rem;
    font-weight: 600;
    transition: color 0.15s;
}
.navbar-links a:hover { color: var(--white); }
.navbar-user { color: rgba(255,255,255,0.55); font-size: 0.82rem; }

/* Grille communes MEL */
.communes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(185px, 1fr));
    gap: 0.1rem 0.5rem;
    max-height: 280px;
    overflow-y: auto;
    padding: 0.5rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--white);
}
.communes-grid .checkbox-option { padding: 0.2rem 0.4rem; font-size: 0.875rem; border: none; background: none; }
.communes-grid .checkbox-option:hover { background: var(--teal-light); border-color: transparent; }

/* ============================================================
   ADMIN CONTAINER
   ============================================================ */
.is-admin { padding-top: 4rem; }

.admin-container {
    max-width: 1140px;
    margin: 2rem auto;
    padding: 0 1.25rem 4rem;
}
.admin-container h1 {
    font-family: 'Barbieri Black', 'Poppins', sans-serif;
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--teal-dark);
    margin-bottom: 1.5rem;
}
.admin-container h2 {
    font-family: 'Barbieri Black', 'Poppins', sans-serif;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text);
    margin: 2rem 0 1rem;
}

/* ============================================================
   TABLES
   ============================================================ */
.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
    background: var(--white);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 6px rgba(0,0,0,0.07);
}
.table th, .table td {
    padding: 0.7rem 1rem;
    text-align: left;
    border-bottom: 1px solid #EEE;
}
.table th { background: var(--teal-dark); color: var(--white); font-weight: 700; font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.04em; }
.table tbody tr:hover td { background: var(--teal-light); }
.table--compact td, .table--compact th { padding: 0.45rem 0.75rem; }
.row--warning td { background: #FFFBEA; }

/* Variante groupée (dashboard) */
.table--grouped {
    border-collapse: separate;
    border-spacing: 0 3px;
    background: transparent;
    border-radius: 0;
    box-shadow: none;
    overflow: visible;
}
.table--grouped th { background: var(--teal-dark); color: #fff; }
.table--grouped th:first-child { border-radius: 8px 0 0 8px; }
.table--grouped th:last-child  { border-radius: 0 8px 8px 0; }
.table--grouped td {
    background: #fff;
    border-top: 1px solid #E8EDF2;
    border-bottom: 1px solid #E8EDF2;
    padding: 0.7rem 1rem;
}
.table--grouped td:first-child { border-left: 1px solid #E8EDF2; border-radius: 8px 0 0 8px; }
.table--grouped td:last-child  { border-right: 1px solid #E8EDF2; border-radius: 0 8px 8px 0; }
.table--grouped tbody tr:hover td { background: var(--teal-light) !important; }

/* Groupe encadré */
.table--grouped .g td { background: #F4F4FB; border-color: #9999CC; }
.table--grouped .g-first td { border-top: 2px solid var(--teal); }
.table--grouped .g-first td:first-child { border-left: 2px solid var(--teal); border-radius: 8px 0 0 0; }
.table--grouped .g-first td:last-child  { border-right: 2px solid var(--teal); border-radius: 0 8px 0 0; }
.table--grouped .g-last td { border-bottom: 2px solid var(--teal); }
.table--grouped .g-last td:first-child { border-left: 2px solid var(--teal); border-radius: 0 0 0 8px; }
.table--grouped .g-last td:last-child  { border-right: 2px solid var(--teal); border-radius: 0 0 8px 0; }
.table--grouped .g-mid td:first-child { border-left: 2px solid var(--teal); border-radius: 0; }
.table--grouped .g-mid td:last-child  { border-right: 2px solid var(--teal); border-radius: 0; }

/* ============================================================
   STATS
   ============================================================ */
.stats-grid {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 2rem;
}
.stat-card {
    flex: 1;
    min-width: 130px;
    padding: 1.25rem 1rem;
    background: var(--white);
    border-radius: 14px;
    box-shadow: 0 2px 8px rgba(0,0,144,0.08);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    border-top: 4px solid var(--border);
    transition: transform 0.15s;
}
.stat-card:hover { transform: translateY(-2px); }
.stat-card--alert { border-top-color: var(--error); }
.stat-card--warning { border-top-color: #F39C12; }
.stat-card--teal { border-top-color: var(--teal); }
.stat-number { font-family: 'Barbieri Black', 'Poppins', sans-serif; font-size: 2.2rem; font-weight: 800; color: var(--teal-dark); }
.stat-card span:last-child { font-size: 0.8rem; font-weight: 700; color: var(--text-light); text-transform: uppercase; letter-spacing: 0.05em; }

/* ============================================================
   DASHBOARD CHARTS
   ============================================================ */
.unassigned-bar {
    display: flex; align-items: center; gap: 1rem; justify-content: space-between;
    background: #fff8f5; border: 1.5px solid #ffd0bc; border-radius: var(--radius);
    padding: .7rem 1.1rem; margin-bottom: 1.25rem; font-size: .875rem;
}
.unassigned-bar strong { color: var(--orange); }
.btn-orange {
    background: var(--orange); color: #fff; border: none; border-radius: 4px;
    padding: .3rem .85rem; font-size: .8rem; cursor: pointer; font-family: inherit;
    white-space: nowrap; text-decoration: none; display: inline-block;
}
.asso-filter {
    display: flex; align-items: center; gap: .15rem; flex-wrap: wrap; margin-bottom: 1.25rem;
}
.asso-filter-label {
    font-size: .78rem; font-weight: 700; color: #999; text-transform: uppercase;
    letter-spacing: .04em; white-space: nowrap; margin-right: .5rem;
}
.ftoggle {
    display: inline-block; padding: .3rem .7rem; border-radius: 4px;
    font-size: .82rem; cursor: pointer; user-select: none; border: none; background: none;
    color: #888; font-family: inherit; transition: all .15s;
}
.ftoggle input { display: none; }
.ftoggle.on { background: var(--teal-light); color: var(--teal); font-weight: 700; }
.ftoggle:hover:not(.on) { background: #f0f1f8; color: var(--text); }
.filter-sep { width: 1px; height: 16px; background: var(--border); margin: 0 .25rem; align-self: center; display: inline-block; }
.charts-row {
    display: grid; grid-template-columns: 1fr 1fr; gap: 1.1rem; margin-bottom: 1.75rem;
}
.chart-card {
    background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem 1.5rem;
}
.chart-title {
    font-size: .9rem; font-weight: 700; margin-bottom: 1rem; display: flex; align-items: center; gap: .5rem;
}
.badge-alert {
    display: inline-block; background: var(--orange); color: #fff;
    border-radius: 999px; padding: .1rem .55rem; font-size: .7rem; font-weight: 700;
}
.chart-body { display: flex; align-items: center; gap: 1.5rem; }
.canvas-wrap { position: relative; width: 155px; height: 155px; flex-shrink: 0; }
.canvas-center {
    position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
    text-align: center; pointer-events: none;
}
.canvas-center .big { font-size: 1.9rem; font-weight: 700; color: var(--teal); line-height: 1; }
.canvas-center .sm { font-size: .68rem; color: #999; }
.legend-chart { display: flex; flex-direction: column; gap: .3rem; flex: 1; }
.li-chart { display: flex; align-items: center; gap: .45rem; font-size: .8rem; }
.dot-chart { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.lbl-chart { flex: 1; color: #555; }
.cnt-chart { font-weight: 700; min-width: 18px; text-align: right; }
.pct-chart { color: #bbb; font-size: .73rem; min-width: 30px; text-align: right; }
@media (max-width: 680px) {
    .charts-row { grid-template-columns: 1fr; }
    .chart-body { flex-direction: column; }
}

/* ============================================================
   CARDS ADMIN
   ============================================================ */
.card {
    background: var(--white);
    border-radius: 14px;
    padding: 1.5rem;
    box-shadow: 0 2px 10px rgba(0,0,144,0.07);
    margin-bottom: 1.5rem;
}
.card h2, .card h3 {
    font-family: 'Barbieri Black', 'Poppins', sans-serif;
    margin-top: 0;
    color: var(--teal-dark);
    border-bottom: 2px solid var(--teal-light);
    padding-bottom: 0.5rem;
    margin-bottom: 1rem;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.25rem;
}

.bien-layout {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 1.25rem;
    align-items: stretch;
}

/* Colonne gauche : un seul bloc, sections séparées par un trait */
.bien-col-main {
    margin-bottom: 0;
}
.bien-section + .bien-section {
    border-top: 1px solid var(--border);
    margin-top: 1.25rem;
    padding-top: 1.25rem;
}

/* Colonne droite : chaîne flex complète pour que la textarea remplisse l'espace */
.bien-col-side                      { display: flex; flex-direction: column; }
.bien-gestion-card                  { display: flex; flex-direction: column; flex: 1; margin-bottom: 0; }
.bien-gestion-form                  { display: flex; flex-direction: column; flex: 1; }
.bien-notes-field                   { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.bien-notes-field textarea          { flex: 1; resize: vertical; min-height: 8rem; }

dl { display: grid; grid-template-columns: auto 1fr; gap: 0.35rem 1rem; font-size: 0.92rem; align-items: start; }
dt { font-weight: 700; color: var(--text-light); white-space: nowrap; }

/* ============================================================
   BADGES
   ============================================================ */
.badge {
    display: inline-block;
    padding: 0.2rem 0.65rem;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 700;
    background: #E0E0E0;
    color: #555;
    letter-spacing: 0.02em;
}
.badge--nouveau          { background: #FEEEE4; color: #c04a00; }   /* #e85d04 */
.badge--alerte           { background: #FEE2E2; color: #991B1B; font-weight: 700; }
.row--alerte td          { background: #FFFBEB; }
.row--alerte td:first-child { border-left: 3px solid #F59E0B; }
.badge--contacte         { background: #E0E8F4; color: #023e8a; }   /* #023e8a */
.badge--offre_confirmee  { background: #DDF3FA; color: #006d93; }   /* #0096c7 */
.badge--occupe           { background: #E0F6FC; color: #0e7490; }   /* #48cae4 */
.badge--cloture          { background: #F0F0F0; color: #777; }      /* #ced4da */
.badge--reoriente        { background: #F3E8FF; color: #8b31cc; }   /* #c77dff */
.badge--en_discussion    { background: #EEEEFF; color: #4042a8; }   /* #5e60ce */
.badge--converti         { background: #E4F9EC; color: #1a7a3a; }   /* #2dc653 */
.badge--abandon          { background: #F0F0F0; color: #777; }      /* #ced4da */
.badge--responsable      { background: #EAE0F5; color: #6C3483; }

/* ============================================================
   PAGE HEADER (titre + action principale)
   ============================================================ */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.page-header h1 {
    margin: 0;
}

/* ============================================================
   ASSOCIATION — méta-infos
   ============================================================ */
.asso-header {
    margin-bottom: 1rem;
}
.asso-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.5rem;
    margin-top: 0.4rem;
    font-size: 0.875rem;
    color: #555;
}
.asso-meta a {
    color: var(--teal);
    text-decoration: none;
}
.asso-meta a:hover {
    text-decoration: underline;
}

/* ============================================================
   FORMULAIRE — éléments complémentaires
   ============================================================ */
.field-hint {
    font-size: 0.875rem;
    color: #777;
    margin: -0.25rem 0 1rem;
}
.required {
    color: var(--orange);
}
.form-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 1rem;
}

/* ============================================================
   FILTRES & TRI — style Linear/Notion
   ============================================================ */

.filter-toolbar { margin-bottom: 1rem; }

.filter-toolbar-row {
    display: flex;
    align-items: center;
    height: 42px;
    background: #fff;
    border: 1.5px solid #E2E5EA;
    border-radius: 10px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

/* Champ de recherche */
.filter-search-wrap {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0 0.9rem;
    flex: 1;
    min-width: 0;
    align-self: stretch;
    cursor: text;
}
.filter-search-icon { color: #9CA3AF; flex-shrink: 0; }
.filter-search-wrap input[type="search"] {
    border: none;
    outline: none;
    font-size: 0.875rem;
    font-family: inherit;
    width: 100%;
    height: 100%;
    background: transparent;
    color: var(--text);
    -webkit-appearance: none;
    appearance: none;
}
.filter-search-wrap input[type="search"]::-webkit-search-cancel-button { display: none; }
.filter-search-wrap input::placeholder { color: #B0B7C3; }

/* Séparateurs verticaux */
.filter-toolbar-sep {
    width: 1px;
    background: #E2E5EA;
    flex-shrink: 0;
    align-self: stretch;
    margin: 6px 0;
}

/* Boutons filtre */
.filter-dropdown { position: relative; display: flex; align-self: stretch; }

.filter-btn {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0 1rem;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 0.82rem;
    font-family: inherit;
    color: #6B7280;
    white-space: nowrap;
    align-self: stretch;
    transition: background 0.1s, color 0.1s;
}
.filter-btn:hover { background: #F5F7FA; color: #111827; }
.filter-btn--active { color: var(--teal-dark); font-weight: 700; }

.filter-badge {
    display: none;
    background: var(--teal);
    color: #fff;
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 700;
    padding: 0.05em 0.5em;
    min-width: 1.35em;
    text-align: center;
    line-height: 1.6;
}
.filter-arrow { font-size: 0.6em; color: #C0C8D2; }

/* Panel dropdown */
.filter-panel {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    min-width: 230px;
    background: #fff;
    border: 1px solid #E2E5EA;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.10), 0 2px 6px rgba(0,0,0,0.04);
    padding: 0.4rem;
    z-index: 200;
    display: none;
}
.filter-panel.open { display: block; }

.filter-panel label {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.5rem 0.65rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 400;
    color: #374151;
    margin: 0;
    transition: background 0.08s;
}
.filter-panel label:hover { background: #F3F4F6; }
.filter-panel input[type="checkbox"] {
    width: 1rem;
    height: 1rem;
    accent-color: var(--teal);
    flex-shrink: 0;
    cursor: pointer;
}

/* Compteur */
.filter-count {
    display: flex;
    align-items: center;
    padding: 0 1rem;
    font-size: 0.78rem;
    color: #9CA3AF;
    white-space: nowrap;
    flex-shrink: 0;
}

/* Chips des filtres actifs */
.chips-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem;
    margin-top: 0.6rem;
}
.chips-bar:empty { margin-top: 0; }

.filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.22rem 0.35rem 0.22rem 0.65rem;
    background: #F3F4F6;
    border: 1px solid #E2E5EA;
    border-radius: 6px;
    font-size: 0.78rem;
    color: #374151;
    font-weight: 500;
}
.filter-chip button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 1.1rem;
    height: 1.1rem;
    background: #E5E7EB;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    color: #6B7280;
    font-size: 0.65rem;
    padding: 0;
    transition: background 0.1s, color 0.1s;
}
.filter-chip button:hover { background: #FEE2E2; color: #DC2626; }

.chips-clear-all {
    font-size: 0.78rem;
    color: #9CA3AF;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.1rem 0.2rem;
    margin-left: 0.1rem;
    transition: color 0.1s;
}
.chips-clear-all:hover { color: #DC2626; }

/* Tri sur colonnes */
.th-sort {
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
}
.th-sort:hover .sort-icon { opacity: 0.7; }
.sort-icon { font-size: 0.75em; opacity: 0.25; }
.sort-icon--active { opacity: 1; }

/* ============================================================
   MISC
   ============================================================ */
.field-actions { display: flex; gap: 1rem; align-items: center; margin-top: 1.5rem; flex-wrap: wrap; }
.help-text { font-size: 0.85rem; color: #666; margin: 0.5rem 0 0; }
.card--action { border-left: 4px solid var(--teal); margin-top: 2rem; }
/* ============================================================
   MULTI-BIENS
   ============================================================ */
.bien-block {
    border: 2px dashed var(--border);
    border-radius: 12px;
    padding: 1.25rem;
    margin-bottom: 1.25rem;
    background: var(--cream);
}
.bien-block-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}
.bien-block-num {
    font-family: 'Barbieri Black', 'Poppins', sans-serif;
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--teal);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.btn-remove-bien {
    background: none;
    border: none;
    color: var(--error);
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    transition: background 0.15s;
}
.btn-remove-bien:hover { background: #fdecea; }
.add-bien-wrap { text-align: center; margin-top: 0.5rem; }
.btn-add-bien {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.6rem 1.5rem;
    background: var(--teal-light);
    color: var(--teal-dark);
    border: 2px dashed var(--teal);
    border-radius: 50px;
    font-size: 0.95rem;
    font-weight: 700;
    font-family: 'Barbieri Black', 'Poppins', sans-serif;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-add-bien:hover { background: var(--teal); color: var(--white); border-style: solid; }

.btn-small--outline {
    background: transparent;
    color: var(--teal);
    border: 1.5px solid var(--teal);
}
.btn-small--outline:hover { background: var(--teal); color: #fff; }
.btn-small--danger { background: transparent; border: 1px solid #FCA5A5; color: #DC2626; }
.btn-small--danger:hover { background: #FEE2E2; border-color: #DC2626; }

/* Planning permanences */
.perm-actuelle { margin-bottom: 1.25rem; }
.perm-actuelle p { margin: 0; font-size: 1rem; }
.perm-label { color: var(--text-light); margin-right: 0.5rem; }
.perm-row--actuelle td { background: #F0FDFA; }
.perm-row--passee td { opacity: 0.5; }
.perm-dates { white-space: nowrap; color: var(--text-light); font-size: 0.88rem; }
.perm-annee { font-size: 0.8rem; color: var(--text-light); }
.perm-select { font-size: 0.85rem; padding: 0.2rem 0.4rem; border: 1px solid var(--border); border-radius: 6px; }

.perm-banner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.35rem 1.5rem;
    font-size: 0.8rem;
    font-weight: 500;
    text-decoration: none;
    transition: filter 0.15s;
    position: sticky;
    top: 4rem;
    z-index: 100;
    width: 100%;
}
.perm-banner:hover { filter: brightness(0.95); }
.perm-banner--active {
    background: #CCFBF1;
    color: #0F766E;
    border: 1px solid #99F6E4;
}
.perm-banner--next {
    background: var(--bg);
    color: var(--text-light);
    border: 1px solid var(--border);
    font-weight: 400;
}

.invite-panel {
    margin-top: 1rem;
    padding: 1rem 1.25rem;
    background: var(--teal-light);
    border-radius: 10px;
    border: 1.5px solid #B0B0E0;
}
.invite-panel .field label { font-size: 0.85rem; }

.btn-icon-danger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.6rem;
    height: 1.6rem;
    background: none;
    border: 1px solid transparent;
    border-radius: 5px;
    cursor: pointer;
    color: #9CA3AF;
    padding: 0;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.btn-icon-danger:hover { background: #FEE2E2; color: #DC2626; border-color: #FECACA; }

/* Édition inline des blocs bien */
.card-editable-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.75rem; }
.card-editable-header h2 { margin: 0; }
.btn-pencil {
    display: inline-flex; align-items: center; justify-content: center;
    width: 1.8rem; height: 1.8rem;
    background: none; border: 1px solid transparent; border-radius: 0.375rem;
    color: var(--text-light); cursor: pointer; flex-shrink: 0;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.btn-pencil:hover { background: var(--teal-light); color: var(--teal-dark); border-color: var(--teal); }
.edit-actions { display: flex; gap: 0.5rem; margin-top: 1rem; }

/* Dialog clôture */
.dialog-cloture {
    border: none;
    border-radius: 14px;
    padding: 2rem;
    max-width: 480px;
    width: 90%;
    box-shadow: 0 8px 40px rgba(0,0,0,0.18);
    margin: auto;
}
.dialog-cloture::backdrop { background: rgba(0,0,0,0.4); }
.dialog-cloture h2 { margin-top: 0; color: var(--teal-dark); }
.dialog-intro { font-size: 0.9rem; color: var(--text-light); margin-bottom: 1.25rem; }
.dialog-radios { display: flex; flex-direction: column; gap: 0.5rem; }
.dialog-radio-option { display: flex; align-items: center; gap: 0.6rem; cursor: pointer; font-size: 0.92rem; padding: 0.4rem 0.6rem; border-radius: 6px; }
.dialog-radio-option:hover { background: var(--teal-light); }
.dialog-radio-option input[type="radio"] { accent-color: var(--teal); width: 1rem; height: 1rem; flex-shrink: 0; }
.dialog-actions { display: flex; gap: 0.75rem; margin-top: 1.5rem; }

/* Raison clôture dans l'historique */
.raison-cloture { color: var(--text-light); font-style: italic; }

.empty-state { color: var(--text-light); font-style: italic; margin: 1.5rem 0; text-align: center; }
.show-clotures-wrap { margin: .5rem 0 1.5rem; }
.link-btn { background: none; border: none; padding: 0; cursor: pointer; color: var(--teal); font-size: .85rem; text-decoration: underline; }
.meta { font-size: 0.8rem; color: #AAA; margin-top: 1rem; line-height: 1.6; }
a { color: var(--teal); }
a:hover { color: var(--teal-dark); }

/* ============================================================
   PILOTAGE — tab-bar, pipeline, health-table, profil, souffrance
   ============================================================ */
.section-lbl {
    font-size: .72rem;
    font-weight: 700;
    color: #aaa;
    text-transform: uppercase;
    letter-spacing: .06em;
    margin: 0 0 .6rem;
    display: block;
}

.tab-bar { display: flex; align-items: center; gap: .15rem; border-bottom: 2px solid var(--border); margin-bottom: 1.25rem; }
.tab-btn {
    padding: .55rem 1.1rem;
    border: none;
    background: none;
    font-family: inherit;
    font-size: .875rem;
    cursor: pointer;
    color: var(--text-light);
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all .15s;
}
.tab-btn.active { color: var(--teal); font-weight: 700; border-bottom-color: var(--teal); }

.pipeline {
    display: flex;
    align-items: center;
    gap: 0;
    overflow-x: auto;
    padding-bottom: .5rem;
    margin-bottom: .25rem;
}
.pipe-stage { display: flex; flex-direction: column; align-items: center; gap: .3rem; flex-shrink: 0; }
.pipe-box {
    background: var(--teal-light);
    border: 1.5px solid var(--teal);
    border-radius: 6px;
    padding: .45rem .9rem;
    font-size: .8rem;
    font-weight: 700;
    color: var(--teal-dark);
    white-space: nowrap;
}
.pipe-count { font-size: .72rem; color: var(--text-light); }
.pipe-arrow { display: flex; flex-direction: column; align-items: center; gap: .15rem; padding: 0 .5rem; flex-shrink: 0; }
.pipe-time { font-size: .78rem; font-weight: 700; white-space: nowrap; }
.pipe-time.ok   { color: var(--success); }
.pipe-time.warn { color: #F39C12; }
.pipe-time.late { color: var(--error); }
.pipe-line { display: flex; align-items: center; width: 60px; }
.pipe-line-bar { height: 2px; flex: 1; }
.pipe-line-bar.ok   { background: var(--success); }
.pipe-line-bar.warn { background: #F39C12; }
.pipe-line-bar.late { background: var(--error); }
.pipe-line-arrow { font-size: .9rem; }
.pipe-line-arrow.ok   { color: var(--success); }
.pipe-line-arrow.warn { color: #F39C12; }
.pipe-line-arrow.late { color: var(--error); }

.health-table { width: 100%; border-collapse: collapse; font-size: .82rem; }
.health-table th {
    background: #f7f8fc;
    padding: .55rem 1rem;
    text-align: left;
    font-weight: 700;
    color: #888;
    font-size: .72rem;
    text-transform: uppercase;
    letter-spacing: .04em;
    border-bottom: 1px solid var(--border);
}
.health-table th.group-biens { border-left: 3px solid var(--teal-light); }
.health-table th.group-inv   { border-left: 3px solid #FCE4EC; }
.health-table td { padding: .55rem 1rem; border-bottom: 1px solid #f0f1f5; vertical-align: middle; }
.health-table td.group-biens { border-left: 3px solid var(--teal-light); }
.health-table td.group-inv   { border-left: 3px solid #FCE4EC; }
.health-table tr:last-child td { border-bottom: none; }
.badge-sm { display: inline-block; padding: .1rem .45rem; border-radius: 999px; font-size: .7rem; font-weight: 700; }
.b-ok   { background: #e8f5ee; color: #1E7A4A; }
.b-warn { background: #FEF9EC; color: #9a6200; }
.b-late { background: #FEF0EE; color: #a93226; }
.last-activity       { font-size: .75rem; color: var(--text-light); }
.last-activity.stale { color: var(--error); }

.profil-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-bottom: 1.25rem; }
.profil-card { background: var(--white); border: 1px solid var(--border); border-radius: 10px; padding: 1rem 1.25rem; }
.profil-card h3 { font-size: .82rem; font-weight: 700; color: var(--teal); margin-bottom: .7rem; }
.bar-row { display: flex; align-items: center; gap: .5rem; margin-bottom: .35rem; font-size: .78rem; }
.bar-label { width: 130px; flex-shrink: 0; color: #555; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-wrap { flex: 1; background: #f0f1f5; border-radius: 999px; height: 8px; }
.bar-fill { height: 8px; border-radius: 999px; background: var(--teal); opacity: .7; }
.bar-val { width: 36px; text-align: right; font-weight: 700; color: #555; flex-shrink: 0; }
.taux-row { display: flex; justify-content: space-between; align-items: center; padding: .4rem 0; border-bottom: 1px solid #f0f1f5; font-size: .8rem; }
.taux-row:last-child { border-bottom: none; }
.taux-val { font-weight: 700; }


.pf-btn {
    padding: .28rem .75rem;
    border-radius: 4px;
    border: 1px solid var(--border);
    background: var(--white);
    font-size: .78rem;
    cursor: pointer;
    font-family: inherit;
    color: var(--text-light);
    text-decoration: none;
    display: inline-block;
}
.pf-btn.active { background: var(--teal-light); color: var(--teal); border-color: var(--teal); font-weight: 700; }

/* Suivi par association — date range + sortable tables */
.suivi-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: .5rem;
}
.date-range-form {
    display: flex;
    align-items: center;
    gap: .5rem;
    flex-wrap: wrap;
    margin-left: auto;
}
.dr-label { font-size: .82rem; font-weight: 600; color: var(--text-light); display: flex; align-items: center; gap: .35rem; }
.dr-input {
    padding: .3rem .55rem;
    border: 1.5px solid var(--border);
    border-radius: 6px;
    font-size: .82rem;
    font-family: inherit;
    background: var(--white);
    color: var(--text);
}
.btn-filter {
    padding: .32rem .9rem;
    background: var(--teal);
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: .82rem;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
}
.suivi-note { font-size: .73rem; color: var(--text-light); margin-bottom: .75rem; }

.suivi-tab-bar { display: flex; gap: .15rem; border-bottom: 2px solid var(--border); margin-bottom: 1rem; }
.suivi-tab-btn {
    padding: .5rem 1.1rem;
    border: none; background: none;
    font-family: inherit; font-size: .875rem;
    cursor: pointer; color: var(--text-light);
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all .15s;
}
.suivi-tab-btn.active { color: var(--teal); font-weight: 700; border-bottom-color: var(--teal); }

.suivi-table { width: 100%; border-collapse: collapse; font-size: .82rem; }
.suivi-table th {
    background: #f7f8fc;
    padding: .55rem 1rem;
    text-align: left;
    font-size: .72rem;
    font-weight: 700;
    color: var(--text-light);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}
.suivi-table th.num { text-align: right; }
.suivi-table td { padding: .55rem 1rem; border-bottom: 1px solid #f0f1f5; vertical-align: middle; }
.suivi-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.suivi-table tbody tr:last-child td { border-bottom: none; }
.suivi-table tbody tr:hover { background: #fafbff; }

.suivi-table .reo-header {
    text-align: center;
    border-left: 2px solid #E8EAF2;
    background: #f2f3f9;
    font-size: .72rem;
    font-weight: 700;
    color: #7b8ab8;
    white-space: nowrap;
}
.suivi-subhead th { padding-top: .3rem; padding-bottom: .3rem; border-top: 1px solid #E8EAF2; }
.reo-spacer { background: #f7f8fc; border: none; }
.reo-sub { border-left: 2px solid #E8EAF2; background: #f2f3f9; width: 65px; text-align: center; }
.reo-cell { border-left: 2px solid #E8EAF2; }

.suivi-table tfoot .total-row th,
.suivi-table tfoot .total-row td {
    background: #f0f2fa;
    font-weight: 700;
    border-top: 2px solid var(--border);
    border-bottom: none;
    padding: .6rem 1rem;
}
.suivi-table tfoot .total-row td { text-align: right; }

.sortable { cursor: pointer; user-select: none; }
.sortable:hover { background: #eef0f8; }
.sortable::after  { content: ' ↕'; color: #ccc; }
.sort-asc::after  { content: ' ↑'; color: var(--teal); }
.sort-desc::after { content: ' ↓'; color: var(--teal); }

/* Délais par étape — grille 3 colonnes */
.dc-grid { display: flex; gap: 1.25rem; margin-bottom: .75rem; flex-wrap: wrap; }
.dc-col { flex: 1; min-width: 160px; }
.dc-col-hd { margin-bottom: .5rem; }
.dc-col-ft { display: flex; align-items: center; gap: .45rem; margin-top: .35rem; flex-wrap: wrap; }
.dc-na { font-size: .82rem; color: var(--text-light); margin-top: .3rem; }
.dc-outcome { display: block; font-size: .78rem; font-weight: 700; }
.dc-outcome.s-ok    { color: var(--success); }
.dc-outcome.s-fail  { color: var(--error); }
.dc-outcome.s-cours { color: var(--teal); }
.dc-outcome.s-reo   { color: #B06820; }
.dc-count { display: block; font-size: .72rem; color: var(--text-light); margin-top: .1rem; }
.dc-bar { display: flex; height: 22px; border-radius: 4px; overflow: hidden; background: #eef0f5; min-width: 3px; }
.dc-seg { height: 100%; }
.seg-1    { background: #80B8E0; }
.seg-2    { background: #4090C8; }
.seg-3    { background: #1060A8; }
.seg-4    { background: #000090; }
.seg-reo  { background: #E88060; }
.seg-i1   { background: #C0A0E0; }
.seg-i2   { background: #8060C8; }
.seg-i3   { background: #5030A8; }
.seg-iann { background: #E88060; }
.dc-total { font-size: .78rem; font-weight: 700; color: var(--text); white-space: nowrap; min-width: 36px; }
.trend-badge { font-size: .72rem; font-weight: 700; padding: .15rem .5rem; border-radius: 999px; white-space: nowrap; flex-shrink: 0; }
.trend-good { background: #e8f5ee; color: var(--success); }
.trend-bad  { background: #fef0ee; color: var(--error); }
.dc-legend { display: flex; flex-wrap: wrap; gap: .3rem .85rem; margin-top: .9rem; padding-top: .65rem; border-top: 1px solid var(--border); }
.dc-leg-item { display: flex; align-items: center; gap: .3rem; font-size: .72rem; color: var(--text-light); }
.dc-swatch { display: inline-block; width: 11px; height: 11px; border-radius: 2px; flex-shrink: 0; }

@media (max-width: 680px) {
    .profil-grid { grid-template-columns: 1fr; }
    .suivi-header { flex-direction: column; align-items: flex-start; }
    .date-range-form { margin-left: 0; }
    .tab-bar { flex-wrap: wrap; }
    .dc-grid { grid-template-columns: 1fr; }
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 600px) {
    .form-hero h1 { font-size: 1.5rem; }
    .form-section { padding: 1.25rem; }
    .stats-grid { gap: 0.75rem; }
    .stat-card { min-width: 100px; }
    .navbar { padding: 0.75rem 1rem; }
    .detail-grid { grid-template-columns: 1fr; }
    .bien-layout { grid-template-columns: 1fr; align-items: start; }
    .bien-gestion-card { flex: none; }
}
