/* =====================================================================
   KOLOC — couche de composants (inspirée d'Access Healthcare v2)
   S'appuie sur les tokens de app.css : --blue --coral --ink --muted
   --line --soft --white --shadow --radius. Chargée APRÈS app.css.
   ===================================================================== */

:root {
    --ok: #07805e;
    --ok-soft: #ddf8ef;
    --warn: #8a5300;
    --warn-soft: #fff4e5;
    --err: #b0322a;
    --err-soft: #ffe9e6;
    --shadow-lg: 0 14px 40px rgba(7, 27, 75, 0.18);
    --field-radius: 10px;
    /* Séparation carte / fond : plus marquée que --line seul. */
    --line-strong: #cfd8ec;
    --card-lift: 0 1px 3px rgba(12, 35, 91, .06), 0 6px 20px rgba(12, 35, 91, .05);
}

/* --------------------------------------------- Thèmes des espaces connectés (choisis dans Admin > Apparence)
   On redéfinit les tokens de marque de app.css sur <body> : ils se propagent à toute l'interface. */
body.theme-emeraude {
    --blue: #0b7a5b; --blue-2: #075c44; --navy: #06281c;
    --coral: #ff7a45; --coral-dark: #ef6631; --mint: #1fae7d;
}
body.theme-emeraude.app-body { background: #e7f0ec; }

body.theme-corail {
    --blue: #de524a; --blue-2: #bf3d35; --navy: #3d1512;
    --coral: #f59e0b; --coral-dark: #d98806; --mint: #14b8a6;
}
body.theme-corail.app-body { background: #f4ece9; }

/* L'attribut [hidden] doit gagner sur les display:flex du menu (sinon les
   entrées masquées selon les activités restent visibles). */
.sidebar nav a[hidden], .bottom-nav a[hidden] { display: none !important; }

/* Accueil : les 3 boutons du hero tiennent leur texte sur une ligne (desktop). */
.hero-actions .btn { white-space: nowrap; }
@media (min-width: 721px) { .hero-actions .btn { flex: 0 0 auto; } }

/* Accueil, section propriétaires : le bouton ne se comprime pas, texte sur une ligne. */
.owner-cta .btn { white-space: nowrap; flex: none; }

/* Marque dans la sidebar : logo complet en grand, pictogramme seul quand elle se réduit. */
.sidebar .brand { display: flex; align-items: center; }
.sidebar .brand .brand-mark { display: none; }
@media (max-width: 1050px) {
    .sidebar .brand { justify-content: center; }
    .sidebar .brand .brand-full { display: none; }
    .sidebar .brand .brand-mark { display: block; }
}

/* --------------------------------------------- Canevas mieux détachés du fond (site ET modale) */
.app-body { background: #eaeef6; }
.modal-body { background: #f6f8fd; }

/* ------------------------------------------------------------ Boutons */
.btn { gap: 8px; font-weight: 600; }
.btn .ic { flex: none; }
.btn-sm { padding: 7px 12px; font-size: 0.85rem; }
.btn-lg { padding: 13px 24px; font-size: 1rem; }
.btn-block { display: flex; width: 100%; justify-content: center; text-align: center; line-height: 1.35; }

/* Numéro de téléphone révélé : centré et bien lisible */
.reveal-phone-out {
    margin: 12px 0 0; text-align: center; font-weight: 800; font-size: 2.4rem; line-height: 1.2;
    letter-spacing: 1px; color: var(--blue);
}

/* Surbrillance de l'élément ciblé par une notification */
.hash-flash { animation: hash-flash 2.2s ease; border-radius: 10px; }
@keyframes hash-flash {
    0%, 100% { box-shadow: 0 0 0 0 rgba(11, 57, 163, 0); }
    12% { box-shadow: 0 0 0 4px rgba(11, 57, 163, .22); }
}

/* En-têtes de tableau triables */
.table th.is-sortable { cursor: pointer; user-select: none; white-space: nowrap; }
.table th.is-sortable:hover { color: var(--blue); }
.table th.is-sortable::after { content: "↕"; margin-left: 5px; opacity: .35; font-size: .85em; }
.table th.sort-asc::after { content: "↑"; opacity: 1; }
.table th.sort-desc::after { content: "↓"; opacity: 1; }

/* Verdict après visite */
.post-visit { margin-top: 12px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--soft); }
.post-visit > strong { display: block; margin-bottom: 4px; }
.post-visit form { margin-top: 10px; }
.btn-outline { background: #fff; color: var(--blue); border: 1px solid var(--blue); }
.btn-outline:hover { background: var(--soft); }
.btn-danger { background: var(--err); color: #fff; }
.btn-danger:hover { background: #8f2a23; }
.btn[disabled], .btn.is-disabled { opacity: 0.5; cursor: not-allowed; pointer-events: none; }
.btn-icon {
    display: inline-flex; align-items: center; justify-content: center;
    width: 36px; height: 36px; padding: 0; border-radius: 10px;
    background: #fff; border: 1px solid var(--line); color: var(--muted); cursor: pointer;
    transition: color .12s, border-color .12s;
}
.btn-icon:hover { color: var(--blue); border-color: var(--blue); }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

/* ------------------------------------------------------------ Alertes / flash */
.alert {
    display: flex; align-items: flex-start; gap: 10px;
    border-radius: var(--field-radius); padding: 11px 14px; margin: 0 0 16px;
    font-size: 0.93rem; border: 1px solid transparent;
}
.alert .ic { margin-top: 2px; }
.alert-success { background: var(--ok-soft); color: var(--ok); border-color: #bfe6d7; }
.alert-error { background: var(--err-soft); color: var(--err); border-color: #f3cbc6; }
.alert-info { background: #e9f0ff; color: var(--blue); border-color: #cfe0ff; }
.alert-warning { background: var(--warn-soft); color: var(--warn); border-color: #f0dcb8; }

/* ------------------------------------------------------------ Badges */
.badge {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 3px 10px; border-radius: 999px; font-size: 0.78rem; font-weight: 600; white-space: nowrap;
}
.badge-blue { background: #e9f0ff; color: var(--blue); }
.badge-green { background: var(--ok-soft); color: var(--ok); }
.badge-amber { background: var(--warn-soft); color: var(--warn); }
.badge-red { background: var(--err-soft); color: var(--err); }
.badge-gray { background: var(--soft); color: var(--muted); }

/* Canaux d'une alerte de recherche (Email / Push) : allumé = actif */
.chan-badge {
    display: inline-block; padding: 2px 8px; border-radius: 999px;
    font-size: 0.72rem; font-weight: 600; white-space: nowrap;
    background: var(--soft); color: var(--muted);
    text-decoration: line-through; text-decoration-thickness: 1px;
}
.chan-badge.is-on { background: var(--ok-soft); color: var(--ok); text-decoration: none; }

/* Fiche alerte : grille des filtres + boutons de sélection des canaux */
.alert-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.alert-form-grid .field { margin: 0; }
.chan-toggle-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 6px; }
.chan-toggle {
    display: flex; align-items: center; gap: 9px; width: 100%; padding: 11px 12px;
    border: 1.5px solid var(--line-strong); border-radius: 12px; background: #fff;
    color: var(--ink); font: inherit; text-align: left; cursor: pointer; transition: border-color .12s, background .12s;
}
.chan-toggle > span { position: static; display: flex; flex-direction: column; gap: 1px; min-width: 0; flex: 1; background: none; padding: 0; width: auto; height: auto; }
.chan-toggle strong { font-size: 0.9rem; }
.chan-toggle small { color: var(--muted); font-size: 0.74rem; line-height: 1.25; }
.chan-toggle .chan-tick { opacity: 0; color: var(--blue); flex: none; }
.chan-toggle:hover { border-color: var(--blue); }
.chan-toggle[aria-pressed="true"] { border-color: var(--blue); background: #e9f0ff; }
.chan-toggle[aria-pressed="true"] .chan-tick { opacity: 1; }
@media (max-width: 480px) {
    .alert-form-grid, .chan-toggle-row { grid-template-columns: 1fr; }
}

/* Icône enveloppe (nombre total de messages, pastille bleue) + pastille rouge (nouveau message non lu) */
.mail-badge {
    position: relative; display: inline-flex; align-items: center; gap: 4px;
    padding: 3px 8px; border-radius: 999px; background: #e9f0ff; color: var(--blue);
    font-size: 0.78rem; font-weight: 700; white-space: nowrap;
}
.mail-badge-dot {
    position: absolute; top: -3px; right: -3px; width: 9px; height: 9px;
    border-radius: 50%; background: var(--coral); border: 2px solid #fff;
}

/* ------------------------------------------------------------ Formulaires */
.field { margin-bottom: 16px; }
.field > label, .field-label { display: block; font-weight: 600; font-size: 0.9rem; margin-bottom: 6px; color: var(--ink); }
.field .hint { font-weight: 400; color: var(--muted); font-size: 0.83rem; }
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.field-grid .field-span { grid-column: 1 / -1; }
@media (max-width: 620px) { .field-grid { grid-template-columns: 1fr; } }

.field input[type=text], .field input[type=email], .field input[type=password], .field input[type=tel],
.field input[type=date], .field input[type=datetime-local], .field input[type=number], .field input[type=search],
.field select, .field textarea,
.input {
    width: 100%; padding: 11px 12px; border: 1px solid var(--line); border-radius: var(--field-radius);
    font: inherit; color: var(--ink); background: #fff; transition: border-color .12s, box-shadow .12s;
}
.field input:focus, .field select:focus, .field textarea:focus, .input:focus {
    outline: 0; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(11, 57, 163, .15);
}
.field textarea { min-height: 92px; resize: vertical; }
.field .error, .field-error { color: var(--err); font-size: 0.83rem; margin: 5px 0 0; }
.field input[aria-invalid=true], .field textarea[aria-invalid=true] { border-color: var(--err); }

/* Aucun champ ne déborde de son conteneur, même dans une grille ou un flex étroit.
   Cas typique : <input type=date/datetime-local> sur mobile, dont la largeur
   intrinsèque (icône + « jj/mm/aaaa ») dépasse la colonne. */
.field { min-width: 0; }
.field input, .field select, .field textarea, .input { min-width: 0; max-width: 100%; }
input[type="date"], input[type="datetime-local"], input[type="month"], input[type="time"] {
    -webkit-appearance: none;
    appearance: none;
}
input[type="date"]::-webkit-date-and-time-value { text-align: left; }

.check { display: flex; align-items: flex-start; gap: 9px; padding: 5px 0; font-size: 0.92rem; color: var(--muted); }
.check input { width: auto; margin-top: 3px; }

/* Chips de suggestion cliquables */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 8px; }
.chip {
    border: 1px solid var(--line); background: #fff; border-radius: 999px;
    padding: 6px 13px; font-size: 0.85rem; font-family: inherit; color: var(--ink); cursor: pointer; transition: all .12s;
}
.chip:hover { border-color: var(--blue); color: var(--blue); }
.chip[aria-pressed=true] { background: #e9f0ff; border-color: var(--blue); color: var(--blue); }
.chip[aria-pressed=true]::before { content: "✓ "; }

/* Zone d'upload + aperçu fichiers */
.upload-zone {
    border: 2px dashed var(--line); border-radius: var(--field-radius);
    padding: 22px; text-align: center; color: var(--muted); background: var(--soft);
    transition: border-color .12s, background .12s;
}
.upload-zone.is-drag { border-color: var(--blue); background: #eef3ff; }
.upload-zone .ic { color: var(--blue); }
.upload-zone p { margin: 8px 0 0; font-size: 0.85rem; }
.file-list { list-style: none; margin: 12px 0 0; padding: 0; text-align: left; }
.file-list li {
    display: flex; align-items: center; gap: 10px; padding: 8px 12px;
    border: 1px solid var(--line); border-radius: var(--field-radius); margin-bottom: 6px;
    font-size: 0.88rem; background: #fff;
}
.file-list .file-size { color: var(--muted); font-size: 0.8rem; margin-left: auto; }

/* ------------------------------------------------------------ Panneaux */
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card + .card { margin-top: 16px; }
.card-head {
    display: flex; align-items: center; justify-content: space-between; gap: 14px;
    padding: 14px 18px; border-bottom: 1px solid var(--line); flex-wrap: wrap;
}
.card-head h2, .card-head h3 { margin: 0; font-size: 1.02rem; }
.card-body { padding: 18px; }
.card-body > :last-child { margin-bottom: 0; }

.dl-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 8px 20px; margin: 0; }
.dl-grid > div { padding: 6px 0; border-bottom: 1px dashed var(--line); }
.dl-grid dt { font-size: 0.76rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; font-weight: 600; }
.dl-grid dd { margin: 2px 0 0; font-size: 0.94rem; }

.recap-block { border: 1px solid var(--line); border-radius: var(--field-radius); padding: 14px 16px; margin-bottom: 12px; }
.recap-block h3 { font-size: 0.95rem; margin: 0 0 8px; }

/* Ligne d'item cliquable (listes) */
.row-item {
    display: flex; align-items: center; gap: 14px; padding: 13px 16px;
    border: 1px solid var(--line); border-radius: var(--field-radius); background: #fff; margin-bottom: 8px;
    text-decoration: none; color: inherit; transition: border-color .12s, box-shadow .12s;
}
a.row-item:hover, a.row-item:focus-visible {
    border-color: var(--blue); background: #eef3ff; outline: none;
}
.row-item .row-main { flex: 1; min-width: 0; }
.row-item .row-main strong { display: block; color: var(--ink); }
.row-item .row-main small { color: var(--muted); }

/* ------------------------------------------------------------ Tableaux */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }

/* Barre d'actions groupées au-dessus d'un tableau admin */
.bulk-bar {
    display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
    padding: 10px 12px; margin-bottom: 10px; background: var(--soft);
    border: 1px solid var(--line); border-radius: 12px;
}
.bulk-bar [data-bulk-count] { min-width: 8em; }

/* Titre d'annonce dans un tableau : tronqué, s'élargit avec l'écran. */
.cell-title { display: inline-block; max-width: 16ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom; }
@media (min-width: 720px) { .cell-title { max-width: 26ch; } }
@media (min-width: 1100px) { .cell-title { max-width: 40ch; } }
table.table { width: 100%; border-collapse: collapse; font-size: 0.9rem; min-width: 560px; }
.table th, .table td { padding: 11px 14px; text-align: left; border-bottom: 1px solid var(--line); }
.table th {
    background: var(--soft); color: var(--muted); font-weight: 600; font-size: 0.78rem;
    text-transform: uppercase; letter-spacing: .04em; white-space: nowrap;
}
.table tbody tr:hover { background: #f3f6ff; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr.row-past td { color: var(--muted); background: #fafafa; }
.table tbody tr.row-past strong { color: var(--muted); font-weight: 600; }
.table-toolbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 14px; }

/* Repère « Aujourd'hui / Demain / Passée » devant une date de visite */
.day-pill {
    display: inline-block; margin-left: 7px; padding: 1px 8px; border-radius: 999px;
    font-size: 0.7rem; font-weight: 700; letter-spacing: .02em; vertical-align: 1px;
}
.day-pill-today { background: #e7f7ee; color: var(--ok); }
.day-pill-tomorrow { background: #e9f0ff; color: var(--blue); }
.day-pill-past { background: var(--soft); color: var(--muted); }

/* Recherche avec icône + croix */
.search-box { position: relative; flex: 1; min-width: 200px; }
.search-box .ic { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.search-box input { padding-left: 36px; }

/* ------------------------------------------------------------ Timeline de parcours */
/* Les étapes se partagent toujours la largeur disponible (pas de largeur fixe) et les
   traits sont élastiques : les 6 étapes — y compris la place réservée d'Écarté —
   tiennent toujours dans leur conteneur, qu'il soit étroit (colonne, mobile) ou large,
   sans jamais déclencher d'ascenseur horizontal. */
.workflow { display: flex; gap: 0; overflow-x: hidden; padding: 6px 2px 10px; }
.wf-step { display: flex; align-items: flex-start; flex: 1 1 0; min-width: 0; }
.wf-node { display: flex; flex-direction: column; align-items: center; text-align: center; flex: 0 1 104px; width: auto; }
.wf-dot {
    display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px;
    border-radius: 50%; border: 2px solid var(--line); background: #fff; color: var(--muted); flex: none;
}
.wf-label { font-size: 0.74rem; margin-top: 7px; color: var(--muted); line-height: 1.3; }
.wf-line { flex: 1 1 0; width: auto; max-width: 40px; min-width: 2px; height: 2px; background: var(--line); margin-top: 18px; }
.wf-step.is-done .wf-dot { border-color: var(--ok); background: var(--ok-soft); color: var(--ok); }
.wf-step.is-done .wf-line { background: var(--ok); }
.wf-step.is-done .wf-label { color: var(--ok); }
.wf-step.is-current .wf-dot { border-color: var(--blue); background: var(--blue); color: #fff; box-shadow: 0 0 0 4px rgba(11,57,163,.14); }
.wf-step.is-current .wf-label { color: var(--ink); font-weight: 600; }
/* Écarté : dernier nœud, gris, connecteur gris */
.wf-step.is-rejected .wf-dot { border-color: var(--err); color: var(--err); background: #fdecea; border-style: dashed; }
.wf-step.is-rejected .wf-label { color: var(--err); font-weight: 600; }
/* Sa place reste toujours réservée en bout de ligne : invisible tant que le logement
   n'est pas écarté, pour que son apparition ne décale jamais les autres étapes. */
.wf-step-reject:not(.is-rejected) { visibility: hidden; }

/* Mobile : pastilles et texte plus compacts (la largeur s'adapte déjà via flex ci-dessus). */
@media (max-width: 480px) {
    .wf-node { flex-basis: 40px; }
    .wf-dot { width: 24px; height: 24px; }
    .wf-line { max-width: 16px; margin-top: 12px; }
    .wf-label { font-size: 0.56rem; margin-top: 3px; line-height: 1.15; }
}

/* ------------------------------------------------------------ Choix d'une Team (bouton) */
.team-pick-btn {
    display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 12px;
    border: 1px solid var(--line); border-radius: 12px; background: #fff; cursor: pointer;
    text-align: left; color: var(--ink); font: inherit;
}
.team-pick-btn:hover:not(:disabled) { border-color: var(--blue); background: var(--soft); }
.team-pick-btn:disabled, .team-pick-btn.is-invited { opacity: .7; cursor: default; background: var(--soft); }
.team-pick-btn.is-invited { color: var(--ok); border-color: var(--ok-soft); }
/* Un style générique "button span" (pastille de notification) positionne tout <span>
   direct d'un <button> en absolu — on l'annule ici, ces spans ne sont pas des badges. */
.team-pick-btn > span {
    position: static; background: none; font-size: inherit;
    border-radius: 0; padding: 0; width: auto; height: auto;
}
.team-pick-info { display: flex; flex-direction: column; gap: 2px; text-align: left; min-width: 0; flex: 1; }
.team-pick-info strong { color: var(--ink); }
.team-pick-info small { color: var(--muted); }
.team-pick-btn.is-invited .team-pick-info strong { color: var(--ok); }
.team-pick-list { display: grid; gap: 8px; }
.team-pick-list form { margin: 0; }
.team-pick-go { color: var(--muted); flex: none; }
.team-pick-btn:hover:not(:disabled) .team-pick-go { color: var(--blue); }
.team-pick-btn > span.team-pick-tag {
    position: static; flex: none; display: inline-flex; align-items: center; gap: 4px;
    padding: 3px 9px; border-radius: 999px; background: var(--ok-soft); color: var(--ok);
    font-size: 0.74rem; font-weight: 700; width: auto; height: auto;
}

/* ------------------------------------------------------------ Formulaire multi-étapes */
.steps-tabs { display: flex; gap: 4px; margin-bottom: 22px; overflow-x: auto; padding-bottom: 4px; }
.step-tab {
    display: inline-flex; align-items: center; gap: 8px; flex: 1; min-width: 120px;
    padding: 9px 12px; border-radius: var(--field-radius); font-size: 0.84rem; font-weight: 600;
    color: var(--muted); background: var(--soft); border: 1px solid var(--line); white-space: nowrap;
}
.step-tab .step-n {
    display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px;
    border-radius: 50%; background: var(--line); color: var(--muted); font-size: 0.76rem;
}
.step-tab.is-current { background: #e9f0ff; border-color: var(--blue); color: var(--ink); }
.step-tab.is-current .step-n { background: var(--blue); color: #fff; }
.step-tab.is-done { color: var(--ok); border-color: #bfe6d7; background: var(--ok-soft); }
.step-tab.is-done .step-n { background: var(--ok); color: #fff; }
.step-panel[hidden] { display: none; }
.step-nav { display: flex; justify-content: space-between; gap: 12px; margin-top: 22px; flex-wrap: wrap; }

/* ------------------------------------------------------------ Modales */
.modal-overlay {
    position: fixed; inset: 0; z-index: 400; background: rgba(7, 27, 75, .5);
    display: flex; align-items: center; justify-content: center; padding: 18px;
}
.modal-overlay[hidden] { display: none; }
.modal {
    background: #fff; color: var(--ink); border-radius: var(--radius); box-shadow: var(--shadow-lg);
    width: 100%; max-width: 520px; max-height: calc(100vh - 40px); display: flex; flex-direction: column;
    animation: modal-in .16s ease;
}
@keyframes modal-in { from { transform: translateY(8px); opacity: 0; } }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 15px 18px; border-bottom: 1px solid var(--line); }
.modal-head h2 { margin: 0; font-size: 1.05rem; }
.modal-body { padding: 18px; overflow-y: auto; }
.modal-body > :last-child { margin-bottom: 0; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 13px 18px; border-top: 1px solid var(--line); flex-wrap: wrap; }

/* ------------------------------------------------------------ Fil d'ariane */
.breadcrumb { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; font-size: 1.05rem; font-weight: 700; margin: 0 0 16px; color: var(--ink); }
.breadcrumb a { color: var(--muted); text-decoration: none; font-weight: 700; display: inline-flex; align-items: center; gap: 5px; }
.breadcrumb a:hover { color: var(--blue); text-decoration: underline; }
.breadcrumb span { color: var(--ink); }
.breadcrumb > *:not(:first-child)::before { content: "›"; margin: 0 8px; color: var(--muted); font-weight: 400; }

/* ------------------------------------------------------------ Chat / discussion */
.thread { display: flex; flex-direction: column; gap: 12px; max-height: 420px; overflow-y: auto; padding: 4px; }
.bubble {
    max-width: 78%; align-self: flex-start; padding: 9px 13px; font-size: 0.92rem;
    background: #eef2fb; border: 1px solid #e0e7f6;
    border-radius: 14px 14px 14px 4px;
}
.bubble.is-own {
    align-self: flex-end;
    background: var(--blue); color: #fff; border-color: var(--blue);
    border-radius: 14px 14px 4px 14px;
}
/* Fond stable et distinct par personne dans une discussion (jamais blanc). */
.bubble.bubble-t0 { background: #eef2fb; border-color: #e0e7f6; }
.bubble.bubble-t1 { background: #eaf6f0; border-color: #d8ede2; }
.bubble.bubble-t2 { background: #fdf0ec; border-color: #f6ddd4; }
.bubble.bubble-t3 { background: #f2eefb; border-color: #e4dbf5; }
.bubble.bubble-t4 { background: #fbf5e9; border-color: #f1e6cf; }
.bubble.bubble-t5 { background: #eaf4f6; border-color: #d6e9ec; }
.bubble.is-own .bubble-author, .bubble.is-own .bubble-date { color: rgba(255, 255, 255, .82); }
.bubble .bubble-head { display: flex; gap: 10px; align-items: baseline; margin-bottom: 3px; }
.bubble .bubble-author { font-weight: 600; font-size: 0.83rem; color: var(--ink); }
.bubble .bubble-role { font-weight: 600; font-size: 0.72rem; color: var(--coral); }
.bubble .bubble-date { font-size: 0.75rem; color: var(--muted); }
.bubble .bubble-report {
    margin-left: auto; padding: 2px; border: 0; background: none; color: var(--muted);
    cursor: pointer; opacity: 0; transition: opacity .12s, color .12s; line-height: 0;
}
.bubble:hover .bubble-report, .bubble .bubble-report:focus-visible { opacity: .7; }
.bubble .bubble-report:hover { color: var(--err); opacity: 1; }
.bubble.is-own .bubble-report { color: rgba(255, 255, 255, .7); }
@media (hover: none) { .bubble .bubble-report { opacity: .55; } }
.bubble.is-flash { animation: bubble-flash 2.4s ease; }
@keyframes bubble-flash {
    0%, 100% { box-shadow: 0 0 0 0 rgba(11, 57, 163, 0); }
    12%, 55% { box-shadow: 0 0 0 3px rgba(11, 57, 163, .55); }
}
.bubble p { margin: 0; white-space: pre-line; }

/* Fil de discussion en lecture seule (modération) : on voit tout le contexte, la bulle signalée est encadrée */
.thread-review { max-height: 560px; }
.review-msg { display: flex; flex-direction: column; gap: 3px; }
.review-msg.is-flagged { background: var(--err-soft); border: 1px solid #f3cbc6; border-radius: 14px; padding: 8px 10px; margin: 4px 0; }
.review-msg-tag { margin: 0; font-size: .76rem; font-weight: 700; color: var(--err); display: flex; align-items: center; gap: 4px; text-transform: uppercase; letter-spacing: .02em; }

.composer { display: flex; gap: 8px; margin-top: 14px; align-items: stretch; }
.composer input { flex: 1; min-height: 46px; font-size: 15px; padding: 10px 14px; }
.composer .btn { flex: none; min-height: 46px; padding-inline: 16px; }
/* Contact d'une chambre : le fil part de rien, on lui donne de la place */
#contact-proprietaire .thread { min-height: 90px; }

/* Popup messages plein écran : la barre de saisie respire (surtout sur mobile) */
.modal-full .composer { margin: 0; padding: 12px 16px 14px; border-top: 1px solid var(--line); }
@media (max-width: 560px) {
    .modal-full .composer { padding: 12px 14px calc(14px + env(safe-area-inset-bottom, 0px)); gap: 10px; }
    .modal-full .modal-body { padding: 12px 14px; }
}

/* Deux discussions distinctes sur un même logement : la Team (neutre) et le
   propriétaire (teinté corail) — pour qu'on ne les confonde jamais. */
.dossier-discussions { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 18px; }
@media (max-width: 780px) { .dossier-discussions { grid-template-columns: 1fr; } }
.discussion-owner { background: #fff6f4; border-color: #ffd9d0; }
.discussion-owner .card-head { border-bottom-color: #ffd9d0; }
.discussion-owner .bubble.is-own { background: var(--coral); border-color: var(--coral); color: #fff; }
.discussion-owner .bubble.is-own .bubble-author, .discussion-owner .bubble.is-own .bubble-date { color: rgba(255, 255, 255, .85); }

/* ------------------------------------------------------------ En-tête public : figé + hover animé */
.site-header {
    position: sticky; top: 0; z-index: 100;
    box-shadow: 0 1px 0 var(--line);
    transition: box-shadow .2s, background .2s;
}
.site-header.is-scrolled { box-shadow: var(--shadow); }
.site-header { gap: clamp(16px, 3vw, 36px); }
.main-nav { gap: clamp(14px, 1.8vw, 24px); font-size: 13.5px; white-space: nowrap; }
.main-nav a {
    position: relative; padding: 6px 2px; color: var(--ink); text-decoration: none;
    white-space: nowrap; transition: color .15s;
}
.main-nav a::after {
    content: ""; position: absolute; left: 0; right: 100%; bottom: -2px; height: 2px;
    background: var(--coral); transition: right .22s ease;
}
.main-nav a:hover, .main-nav a:focus-visible { color: var(--blue); }
.main-nav a:hover::after, .main-nav a[aria-current]::after { right: 0; }

/* Panneau de recherche : texte plus lisible */
.search-panel label { font-size: 12.5px; font-weight: 600; color: var(--muted); }
.search-panel select, .search-panel input { font-size: 15px; padding-top: 6px; }
.search-panel .btn { height: 46px; font-size: 15px; }
.hero-actions .btn { font-size: 14px; }
@media (max-width: 640px) { .flatmate-choices { grid-template-columns: 1fr !important; } }

/* Zoom lent et discret sur la photo d'accueil (façon Ken Burns), au lieu d'un
   agrandissement brutal quand la barre d'adresse du navigateur mobile se replie. */
.hero { overflow: hidden; }
.hero-photo { animation: hero-zoom 20s ease-out both; will-change: transform; }
@keyframes hero-zoom { from { transform: scale(1.09); } to { transform: scale(1); } }
@media (prefers-reduced-motion: reduce) { .hero-photo { animation: none; } }

/* Accueil mobile : titre en haut, les 3 boutons + « 15 000+ » calés en bas de l'image.
   Hauteur fixe (pas de vh) pour éviter que l'image « saute » au scroll. */
@media (max-width: 720px) {
    .hero { align-items: stretch; padding-top: 36px; min-height: 640px; }
    .hero-copy { display: flex; flex-direction: column; padding-bottom: 26px; }
    .hero-copy .eyebrow, .hero-copy h1, .hero-copy > p { flex: none; }
    .hero-actions { margin-top: auto; padding-top: 22px; }
    .trust-row { margin-top: 16px; }
    .trust-row p { text-shadow: 0 1px 8px rgba(255,255,255,.9); }
}

/* Fiche colocataire : ligne d'attributs à icônes */
.trait-row { display: flex; flex-wrap: wrap; gap: 6px 12px; margin: 8px 0; font-size: 0.85rem; color: var(--muted); }
.trait-row span { display: inline-flex; align-items: center; gap: 5px; }
.trait-row .ic { color: var(--blue); }

/* ------------------------------------------------------------ Barre de navigation basse (mobile) */
@media (max-width: 720px) {
    .bottom-nav { padding: 0 4px; gap: 2px; }
    .bottom-nav a {
        flex: 1; min-width: 0; gap: 2px; padding: 6px 0; text-decoration: none;
        color: var(--muted); font-size: inherit; border-radius: 10px;
    }
    .bottom-nav a .ic { color: currentColor; }
    .bottom-nav a[aria-current] { color: var(--blue); background: var(--soft); }
    .bottom-nav a span { font-size: 10px; }
    .bottom-nav .bn-badge {
        position: absolute; top: 2px; left: 58%; background: var(--coral); color: #fff;
        font-size: 9px; font-weight: 700; border-radius: 999px; min-width: 15px;
        height: 15px; display: flex; align-items: center; justify-content: center; padding: 0 3px;
    }
}

/* ------------------------------------------------------------ Menu mobile — en-tête public */
@media (max-width: 1050px) {
    .site-header .main-nav {
        display: flex !important; flex-direction: column; gap: 2px; align-items: stretch;
        position: fixed; top: 0; right: 0; bottom: 0; width: min(84vw, 300px);
        background: #fff; z-index: 95; padding: 80px 12px 24px; margin: 0;
        box-shadow: -8px 0 40px rgba(7, 17, 40, .28);
        transform: translateX(100%); transition: transform .22s ease; visibility: hidden;
    }
    .site-header .main-nav.is-open { transform: translateX(0); visibility: visible; }
    body.menu-open::after {
        content: ""; position: fixed; inset: 0; background: rgba(7, 17, 40, .5); z-index: 90;
    }
    body.menu-open { overflow: hidden; }
    .site-header .main-nav a {
        padding: 14px 16px; border-radius: 10px; font-size: 15px; font-weight: 600;
    }
    .site-header .main-nav a:hover { background: var(--soft); color: var(--blue); }
    .site-header .mobile-menu { z-index: 96; position: relative; }
}

/* ------------------------------------------------------------ Menu mobile (tiroir latéral) */
@media (max-width: 720px) {
    .app-shell .sidebar {
        display: flex !important;
        position: fixed !important; top: 0; bottom: 0; height: auto;
        left: -340px; width: min(82vw, 300px); z-index: 90;
        transition: left .22s ease;
        box-shadow: 0 0 40px rgba(0, 0, 0, .35);
    }
    .app-shell .sidebar.is-open,
    body.menu-open .app-shell .sidebar { left: 0; }
    body.menu-open::after {
        content: ""; position: fixed; inset: 0; background: rgba(7, 17, 40, .5); z-index: 80;
    }
    body.menu-open { overflow: hidden; }

    /* dans le tiroir, on montre les libellés (masqués sur la sidebar desktop étroite) */
    .app-shell .sidebar nav span,
    .app-shell .sidebar-profile > span:last-child { display: inline !important; }
    .app-shell .sidebar nav a { justify-content: flex-start; }

    /* Les pastilles (notifications, favoris...) sont positionnées en absolu avec des
       marges pensées pour la sidebar desktop réduite (icône seule) : dans le tiroir,
       la ligne complète (icône + libellé) est visible, la pastille flotte alors ailleurs
       et chevauche la ligne du dessus. On la remet dans le flux, alignée à droite. */
    .app-shell .sidebar nav a b { position: static; margin: 0 0 0 auto; }
}

/* ------------------------------------------------------------ Sidebar : scroll si la nav dépasse (fix section Admin masquée) */
.sidebar { overflow-y: auto; }
.sidebar nav { margin-top: 22px; }
.sidebar::-webkit-scrollbar { width: 6px; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,.14); border-radius: 3px; }

/* ------------------------------------------------------------ Empty state */
.empty {
    text-align: center; color: var(--muted); padding: 34px 20px;
    border: 1px dashed var(--line); border-radius: var(--radius); background: var(--soft);
}
.empty .ic { color: var(--line); }

/* ------------------------------------------------------------ Utilitaires */
.visually-hidden, .sr-only {
    position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ------------------------------------------------------------ Toasts (retours AJAX) */
.toast-host {
    position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%);
    z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center;
    pointer-events: none;
}
.toast {
    pointer-events: auto; padding: 10px 16px; border-radius: 999px;
    background: var(--blue); color: #fff; font-size: 0.88rem; font-weight: 600;
    box-shadow: var(--shadow-lg); opacity: 0; transform: translateY(8px);
    transition: opacity .2s, transform .2s; max-width: min(90vw, 420px);
}
.toast.is-in { opacity: 1; transform: none; }
.toast-ok { background: var(--ok); }
.toast-err { background: var(--err); }

/* ------------------------------------------------------------ Cœur favori (bascule sans reload) */
.fav-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    cursor: pointer; border: 0; background: transparent; color: var(--muted);
    transition: color .15s, transform .1s;
}
.fav-btn:active { transform: scale(.9); }
.fav-btn.is-fav { color: var(--coral); }
.fav-btn.is-fav .ic { fill: currentColor; }
.listing-card .fav-btn {
    position: absolute; top: 10px; right: 10px; z-index: 2;
    width: 32px; height: 32px; border-radius: 999px;
    background: rgba(255, 255, 255, .92); box-shadow: 0 2px 8px rgba(7, 27, 75, .14);
}
form.is-busy { opacity: .6; pointer-events: none; }

/* ------------------------------------------------------------ Contrôle segmenté (Meublé / Non meublé, etc.) */
.segmented {
    display: inline-flex; border: 1px solid var(--line); border-radius: 12px;
    overflow: hidden; background: var(--soft); flex-wrap: wrap;
}
.segmented label {
    position: relative; display: flex; align-items: center; gap: 6px;
    padding: 9px 16px; font-size: 0.9rem; font-weight: 600; color: var(--muted);
    cursor: pointer; user-select: none; transition: background .15s, color .15s;
}
.segmented label + label { border-left: 1px solid var(--line); }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented label:has(input:checked) { background: var(--blue); color: #fff; }
.segmented label:has(input:focus-visible) { outline: 2px solid var(--coral); outline-offset: -2px; }

/* ------------------------------------------------------------ Groupe de boutons à cocher (remplace les <select>) */
.choice-group {
    display: flex; flex-wrap: wrap; gap: 8px;
}
.choice-btn {
    border: 1.5px solid var(--line); background: #fff; color: var(--ink);
    border-radius: 11px; padding: 9px 15px; font: inherit; font-size: 0.9rem; font-weight: 600;
    cursor: pointer; transition: border-color .12s, background .12s, color .12s;
}
.choice-btn:hover { border-color: var(--blue); }
.choice-btn.is-on { background: var(--blue); border-color: var(--blue); color: #fff; }
.choice-btn:focus-visible { outline: 2px solid var(--coral); outline-offset: 2px; }
.choice-group.is-multiple .choice-btn.is-on { background: #eef3ff; color: var(--blue); }
.choice-group.is-icons .choice-btn { padding: 10px; width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center; }
.choice-group[style*="--cg-cols"] { display: grid; grid-template-columns: repeat(var(--cg-cols), 1fr); }
.choice-group[style*="--cg-cols"] .choice-btn { text-align: center; }

/* ------------------------------------------------------------ Groupe de bascules (chips à cocher) */
.toggle-group { display: flex; flex-wrap: wrap; gap: 8px; }
.toggle-chip {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 8px 14px; border: 1px solid var(--line); border-radius: 999px;
    font-size: 0.88rem; font-weight: 600; color: var(--muted); cursor: pointer;
    background: #fff; transition: all .15s;
}
.toggle-chip .ic { color: var(--muted); transition: color .15s; }
.toggle-chip input { position: absolute; opacity: 0; pointer-events: none; }
.toggle-chip:has(input:checked) { border-color: var(--blue); background: #eef3ff; color: var(--blue); }
.toggle-chip:has(input:checked) .ic { color: var(--coral); }
.toggle-chip:has(input:focus-visible) { outline: 2px solid var(--coral); outline-offset: 2px; }

/* ------------------------------------------------------------ Aperçus photos (formulaire annonce) */
.photo-previews {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 10px; margin-top: 12px;
}
.photo-previews:empty { display: none; }
.photo-cell { position: relative; aspect-ratio: 4 / 3; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); }
.photo-cell img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-cell-remove {
    position: absolute; top: 4px; right: 4px; width: 24px; height: 24px;
    border: 0; border-radius: 999px; background: rgba(7, 27, 75, .78); color: #fff;
    font-size: 16px; line-height: 1; cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.photo-cell-remove:hover { background: var(--err); }
.upload-zone.is-full { opacity: .55; }
.upload-zone.is-full label[for] { pointer-events: none; }

/* ------------------------------------------------------------ Paramètres admin : ligne explication + contrôle */
.setting-row {
    display: grid; grid-template-columns: 1fr auto; gap: 20px; align-items: start;
    padding-bottom: 16px; border-bottom: 1px solid var(--line);
}
.setting-row:last-child { border-bottom: 0; padding-bottom: 0; }
.setting-copy label { display: block; font-weight: 600; color: var(--ink); margin-bottom: 4px; }
.setting-copy code {
    font-size: 11px; color: var(--muted); background: var(--soft);
    padding: 2px 6px; border-radius: 5px;
}
.setting-control { min-width: 150px; text-align: right; }
.setting-control select, .setting-control input[type=number] {
    border: 1px solid var(--line); border-radius: 10px; padding: 9px 11px; font: inherit; background: #fff;
}

/* Interrupteur on/off */
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; }
.switch-track {
    width: 44px; height: 25px; border-radius: 999px; background: var(--line);
    position: relative; transition: background .15s; flex: none;
}
.switch-track::after {
    content: ""; position: absolute; top: 3px; left: 3px; width: 19px; height: 19px;
    border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .15s;
}
.switch input:checked + .switch-track { background: var(--ok); }
.switch input:checked + .switch-track::after { transform: translateX(19px); }
.switch input:focus-visible + .switch-track { outline: 2px solid var(--blue); outline-offset: 2px; }
.switch-text { font-size: 0.85rem; font-weight: 600; color: var(--muted); }

/* Réglages « Notifications » : groupes email / push */
.notif-group { border: 0; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 12px; }
.notif-group > legend { font-weight: 700; padding: 0; margin-bottom: 2px; }

/* Bandeau d'information cookies (première visite). */
.cookie-notice {
    position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 200;
    display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
    max-width: 720px; margin: 0 auto; padding: 14px 16px;
    background: #fff; border: 1px solid var(--line-strong); border-radius: 14px;
    box-shadow: var(--shadow-lg); font-size: 0.86rem; line-height: 1.5;
}
.cookie-notice[hidden] { display: none; }
.cookie-notice p { flex: 1 1 260px; }
.cookie-notice-actions { display: flex; gap: 8px; flex: none; }
@media (max-width: 480px) {
    .cookie-notice-actions { width: 100%; }
    .cookie-notice-actions .btn { flex: 1; }
}

/* Bandeau « Installer l'app » — revient à chaque nouvelle visite tant que non installée. */
.install-banner {
    position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 190;
    display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
    max-width: 560px; margin: 0 auto; padding: 12px 14px;
    background: #0b39a3; color: #fff; border-radius: 14px; box-shadow: var(--shadow-lg);
    font-size: 0.86rem; line-height: 1.45;
}
.install-banner[hidden] { display: none; }
.install-banner small { color: rgba(255, 255, 255, .82); }
.install-banner-ic { flex: none; display: inline-flex; }
.install-banner-act { display: flex; align-items: center; gap: 8px; flex: none; margin-left: auto; }
.install-banner .btn-primary { background: #fff; color: #0b39a3; }
.install-banner .btn-icon { width: 30px; height: 30px; border: 0; background: rgba(255, 255, 255, .15); color: #fff; }
.install-banner .btn-icon:hover { background: rgba(255, 255, 255, .28); color: #fff; }
@media (max-width: 720px) { .install-banner { bottom: 74px; } }
@media (max-width: 400px) {
    .install-banner-act { margin-left: 0; width: 100%; }
    .install-banner-act .btn-primary { flex: 1; }
}

/* Bandeau « Installer l'app / activer les notifications » du tableau de bord (mobile / tablette). */
.push-cta {
    display: flex; align-items: center; gap: 12px; padding: 13px 15px; margin-bottom: 16px;
    border-radius: 14px; background: #eef3ff; border: 1px solid #d7e3ff; color: var(--ink);
}
.push-cta[hidden] { display: none; }
.push-cta small { color: var(--muted); }
@media (min-width: 1025px) { .push-cta { display: none !important; } }
.push-device {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 12px 14px; background: var(--soft); border: 1px solid var(--line); border-radius: 12px;
}
.push-device strong { display: block; font-size: 0.9rem; }
.push-device small { display: block; margin-top: 2px; }
.push-cats { display: flex; flex-direction: column; gap: 12px; margin-top: 4px; }
.push-cats[hidden] { display: none; }
.push-note {
    margin: 0; padding: 10px 12px; border-radius: 10px; font-size: 0.85rem; line-height: 1.5;
    background: #eef3ff; color: var(--ink); border: 1px solid #d7e3ff;
}
.push-note[hidden] { display: none; }

@media (max-width: 560px) {
    .setting-row { grid-template-columns: 1fr; }
    .setting-control { text-align: left; }
    .push-device { flex-direction: column; align-items: stretch; }
}

/* ------------------------------------------------------------ Puces de valeur rapide (budget…) */
.chip-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.chip-sm {
    border: 1px solid var(--line); background: #fff; color: var(--muted);
    border-radius: 999px; padding: 4px 11px; font-size: 0.78rem; font-weight: 600; cursor: pointer;
    transition: all .13s;
}
.chip-sm:hover { border-color: var(--blue); color: var(--blue); }
.chip-sm.is-on { background: var(--blue); border-color: var(--blue); color: #fff; }

/* ------------------------------------------------------------ Photo principale d'annonce (carte + fiche) */
.listing-visual img,
.detail-photo > img {
    position: absolute; inset: 0; width: 100%; height: 100%;
    object-fit: cover; display: block; z-index: 0;
}
/* Vignette : badge type (Appartement/Studio/Chambre) + badge nombre de pièces (S0 à S+6), séparés et de couleurs différentes */
.listing-tags { position: absolute; top: 14px; left: 14px; z-index: 2; display: flex; gap: 6px; flex-wrap: wrap; }
.listing-tags span { padding: 6px 9px; border-radius: 7px; font-size: 10px; font-weight: 800; }
.listing-tags .tag-kind { background: #fff; color: var(--blue); }
.listing-tags .tag-rooms { background: var(--coral); color: #fff; }
/* le lien plein-cadre de la carte passe AU-DESSUS de la photo → clic photo = ouvrir l'annonce */
.listing-card > a[aria-label] { z-index: 3 !important; }
.listing-card .fav-btn { z-index: 4; }
.detail-photo[data-lightbox] { cursor: zoom-in; }

/* Titre de carte annonce : 3 lignes maxi, le reste coupé par « … »
   (certaines annonces vues sur des sites externes ont des titres à rallonge). */
.listing-body h3 {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    overflow: hidden;
    line-height: 1.3;
}

.lightbox {
    position: fixed; inset: 0; z-index: 300; background: rgba(7, 17, 40, .92);
    overflow: hidden; -webkit-user-select: none; user-select: none; touch-action: none;
    animation: lb-fade .18s ease;
}
.lightbox.is-closing { opacity: 0; transition: opacity .18s ease; }
@keyframes lb-fade { from { opacity: 0; } }

/* Rail de 3 photos (préc. / courante / suiv.) qu'on fait glisser au doigt.
   Placé à left:-100% : sa 2e photo occupe exactement l'écran quand transform = 0. */
.lightbox-track {
    position: absolute; top: 0; left: -100%; width: 300%; height: 100%;
    display: flex; transform: translateX(0);
}
.lightbox-slide {
    width: 33.3333%; height: 100%; flex: none;
    object-fit: contain; padding: 3vw; box-sizing: border-box;
}
@media (max-width: 640px) { .lightbox-slide { padding: 0; } }
@media (prefers-reduced-motion: reduce) { .lightbox { animation: none; } }

.lightbox-close {
    position: absolute; top: 18px; right: 22px; width: 42px; height: 42px;
    border: 0; border-radius: 999px; background: rgba(255,255,255,.15); color: #fff;
    font-size: 26px; line-height: 1; cursor: pointer;
}
.lightbox-close:hover { background: rgba(255,255,255,.3); }
.lightbox-nav {
    position: absolute; top: 50%; transform: translateY(-50%); width: 48px; height: 48px;
    border: 0; border-radius: 999px; background: rgba(255,255,255,.15); color: #fff;
    font-size: 30px; line-height: 1; cursor: pointer;
}
.lightbox-nav:hover { background: rgba(255,255,255,.32); }
.lightbox-prev { left: 3vw; }
.lightbox-next { right: 3vw; }
.lightbox-counter {
    position: absolute; top: 18px; left: 50%; transform: translateX(-50%);
    color: #fff; font-size: 0.85rem; font-weight: 600;
    background: rgba(0,0,0,.35); padding: 4px 12px; border-radius: 999px;
}
/* Points « à la Instagram » sous la photo */
.lightbox-dots {
    position: absolute; bottom: 22px; left: 50%; transform: translateX(-50%);
    display: flex; gap: 7px; padding: 6px 10px; border-radius: 999px; background: rgba(0,0,0,.3);
}
.lightbox-dots i {
    width: 7px; height: 7px; border-radius: 50%; background: rgba(255,255,255,.4);
    cursor: pointer; transition: background .15s, transform .15s;
}
.lightbox-dots i.is-active { background: #fff; transform: scale(1.25); }
@media (max-width: 640px) {
    .lightbox { padding: 0; }
    .lightbox-slide { padding: 0; }
    /* Sur mobile on navigue au doigt (balayage) et on ferme en tirant vers le bas :
       pas de flèches. */
    .lightbox-nav { display: none; }
    .lightbox-dots { bottom: calc(16px + env(safe-area-inset-bottom, 0px)); }
    .lightbox-close { top: calc(10px + env(safe-area-inset-top, 0px)); right: 12px; }
}

.listing-gallery { position: relative; }
/* Indice « Agrandir » sur la photo principale (le clic ouvre la visionneuse) */
.detail-photo > .photo-hint,
.dossier-photo > .photo-hint {
    position: absolute; right: 12px; bottom: 12px; top: auto; left: auto; z-index: 2;
    display: inline-flex; align-items: center; gap: 5px;
    background: rgba(7, 17, 40, .72); color: #fff; font-size: 0.75rem; font-weight: 600;
    padding: 4px 9px; border-radius: 999px; pointer-events: none;
}
.detail-photo > .photo-hint .ic,
.dossier-photo > .photo-hint .ic { color: #fff; }

/* Bandeau de vignettes : sélecteur de photo (ne zoome pas, il change la grande photo) */
.thumb-strip {
    display: flex; gap: 8px; padding: 12px; overflow-x: auto;
    border-bottom: 1px solid var(--line); background: var(--soft);
}
.thumb-strip .thumb {
    flex: none; width: 92px; height: 68px; padding: 0; border-radius: 8px; overflow: hidden;
    border: 2px solid transparent; background: none; cursor: pointer; transition: border-color .12s;
}
.thumb-strip .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb-strip .thumb:hover { border-color: #b9c8e8; }
.thumb-strip .thumb.is-active { border-color: var(--blue); }

/* Dossier Team : en-tête avec photo à droite */
.visite-note { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; margin-bottom: 12px; background: var(--soft); border: 1px solid var(--line); border-radius: 12px; }
.visite-note > .ic { color: var(--blue); flex: none; margin-top: 2px; }
.visite-note strong { display: block; font-size: 0.86rem; color: var(--ink); }
.visite-note p { margin: 3px 0 0; font-size: 0.85rem; color: var(--muted); line-height: 1.45; }
.visite-note a { color: var(--blue); font-weight: 600; }

.dossier-head { display: grid; grid-template-columns: 1fr 220px; gap: 22px; align-items: start; }
/* Sans min-width:0, une grille ne rétrécit jamais une colonne sous le contenu
   min-content de ce qu'elle contient (ex. le bandeau d'étapes) : la colonne
   1fr est alors poussée plus large que la carte et repousse la photo hors cadre. */
.dossier-head-main { min-width: 0; }
.dossier-head-media { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.dossier-photo {
    position: relative; width: 100%; aspect-ratio: 4 / 3; border-radius: 12px; overflow: hidden;
    display: flex; align-items: center; justify-content: center; color: #fff;
}
.dossier-photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; cursor: zoom-in; }
@media (max-width: 640px) { .dossier-head { grid-template-columns: 1fr; } }

/* Description d'annonce mise en forme (listes, paragraphes) */
.listing-desc { margin: 4px 0 0; color: var(--body, #333); line-height: 1.6; }
.listing-desc p { margin: 0 0 10px; }
.listing-desc p:last-child { margin-bottom: 0; }
.listing-desc-list { margin: 4px 0 10px; padding-left: 20px; }
.listing-desc-list li { margin: 2px 0; }
.listing-desc-list li strong { color: var(--ink); }
.listing-desc-empty { color: var(--muted); font-style: italic; }

/* Emplacement réservé aux connectés */
.location-box {
    margin-top: 22px; padding: 14px 16px; border: 1px solid var(--line);
    border-radius: 12px; background: var(--soft);
}
.location-box strong { display: flex; align-items: center; gap: 6px; color: var(--ink); }
.location-box p { margin: 6px 0 2px; }
.location-box small { color: var(--muted); }
.location-box small a { color: var(--blue); font-weight: 600; display: inline-flex; align-items: center; gap: 4px; }

/* Pastille neutre dans la barre latérale (favoris : pas d'urgence, ≠ messages/notifs) */
.sidebar nav b.pill-muted { background: rgba(255, 255, 255, .16); color: #cbd7f6; }

/* ------------------------------------------------------------ Mes annonces : ligne + vignette + stats */
.owner-listing-row { gap: 12px; cursor: pointer; font: inherit; width: 100%; text-align: left; }
.owner-thumb {
    flex: none; width: 56px; height: 44px; border-radius: 8px; overflow: hidden;
    display: flex; align-items: center; justify-content: center; color: #fff; position: relative;
}
.owner-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.owner-mini-stats { display: flex; gap: 12px; font-size: 0.8rem; color: var(--muted); flex: none; }
.owner-mini-stats span { display: inline-flex; align-items: center; gap: 4px; }
@media (max-width: 620px) { .owner-mini-stats { display: none; } }

.owner-preview-grid { display: grid; grid-template-columns: 1fr 200px; gap: 18px; }
.owner-stats { display: flex; flex-direction: column; gap: 12px; }
.owner-stats h3 { margin: 0; font-size: 0.9rem; }
.owner-stat {
    display: grid; grid-template-columns: 24px auto; grid-auto-rows: auto; align-items: center;
    column-gap: 8px; padding: 10px 12px; background: var(--soft); border-radius: 10px;
}
.owner-stat .ic { grid-row: 1 / 3; color: var(--blue); }
.owner-stat strong { font: 800 1.2rem/1 var(--display); }
.owner-stat span { font-size: 0.78rem; color: var(--muted); }
@media (max-width: 620px) { .owner-preview-grid { grid-template-columns: 1fr; } }

/* ------------------------------------------------------------ Mes annonces : grille de fiches */
.owner-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.owner-cards { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
.owner-card { border: 1px solid var(--line); border-radius: 16px; overflow: hidden; background: #fff; box-shadow: var(--shadow); display: flex; flex-direction: column; }
.owner-card-photo { position: relative; height: 150px; display: flex; align-items: center; justify-content: center; color: #fff; }
.owner-card-photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.photo-count {
    position: absolute; right: 8px; bottom: 8px; display: inline-flex; align-items: center; gap: 4px;
    background: rgba(255, 255, 255, .93); color: var(--ink); border-radius: 999px; padding: 2px 8px;
    font-size: 0.72rem; font-weight: 700;
}
.owner-card-status { position: absolute; left: 8px; top: 8px; }
.owner-card-body { padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.owner-card-body h3 { font-size: 1rem; }
.owner-card-stats { display: flex; gap: 16px; font-size: 0.82rem; color: var(--muted); }
.owner-card-stats span { display: inline-flex; align-items: center; gap: 5px; }
.owner-card-section { border-top: 1px solid var(--line); padding-top: 10px; }
.owner-card-section h4 { margin: 0 0 8px; font-size: 0.78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.owner-team-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.owner-team-row { border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; font-size: 0.86rem; }
.owner-team-row.is-unread { background: #eef3ff; border-color: #d8e4ff; }
.owner-team-row-head, .owner-team-row { display: flex; align-items: center; gap: 8px; }
.owner-team-row { flex-direction: column; align-items: stretch; }
.owner-team-row-head { width: 100%; }
.owner-card-foot { margin-top: auto; display: flex; gap: 8px; padding-top: 4px; }
.owner-card-foot .btn { flex: 1; }
@media (max-width: 560px) { .owner-cards { grid-template-columns: 1fr; } }

/* Tableau de bord : bandeau « actions à faire » cliquable en haut d'écran */
.todo-alert { text-decoration: none; cursor: pointer; }
.todo-alert:hover { filter: brightness(0.97); }
#a-faire, #avis-panel { scroll-margin-top: 84px; }

/* Annonce publiée par une agence */
.agency-line { display: flex; align-items: center; gap: 8px; margin: 4px 0 6px; }
.agency-line img { height: 26px; width: auto; max-width: 90px; border-radius: 6px; object-fit: contain; }
.listing-card .agency-tag, .agency-tag {
    display: inline-flex; align-items: center; gap: 4px; font-size: 0.7rem; font-weight: 700;
    color: var(--blue); background: #e9f0ff; border-radius: 999px; padding: 2px 7px;
}

/* Bloc RDV d'une Team (fiche annonce + popup) */
.owner-rdv { display: flex; flex-direction: column; gap: 6px; }
.rdv-line { display: flex; align-items: flex-start; gap: 6px; margin: 4px 0 0; font-size: 0.84rem; color: var(--muted); }
.rdv-line strong { color: var(--ink); }
.rdv-pending { color: var(--warn); }
.rdv-pending strong { color: var(--warn); }
.rdv-ok { color: var(--ok); }
.rdv-ok strong { color: var(--ok); }
.rdv-form { gap: 6px; flex-wrap: wrap; margin-top: 2px; }
.rdv-form .input { width: auto; flex: 1; min-width: 150px; }

/* Fiche membre condensée (popup Team côté propriétaire) */
.member-mini { display: flex; gap: 10px; align-items: flex-start; padding: 10px; border: 1px solid var(--line); border-radius: 12px; }
.member-mini .avatar { flex: none; }
.member-budget {
    display: inline-flex; align-items: center; gap: 3px; margin-left: 6px;
    padding: 1px 7px; border-radius: 999px; background: #eef3ff; color: var(--blue);
    font-size: 0.72rem; font-weight: 700; vertical-align: 1px;
}

/* Modale « Ajouter un colocataire » : deux options nettes */
.invite-option { border: 1px solid var(--line); border-radius: 12px; padding: 14px; }
.invite-option-title { margin: 0 0 4px; font-weight: 700; display: flex; align-items: center; gap: 6px; }
.invite-or {
    text-align: center; font-weight: 700; color: var(--muted); text-transform: uppercase;
    font-size: 0.75rem; letter-spacing: .08em; margin: 12px 0;
}

/* Popup plein écran (messages) */
.modal.modal-full {
    width: min(760px, calc(100vw - 24px)); height: min(80vh, calc(100vh - 32px));
    display: flex; flex-direction: column;
}
.modal-full .modal-body { flex: 1; overflow: auto; min-height: 0; }
/* Un seul ascenseur : c'est .modal-body qui défile, pas le .thread imbriqué. */
.modal-full .thread { max-height: none; overflow: visible; flex: none; }

/* En-tête d'une popup messages : titre + annonce + accès à la fiche Team/profil */
.conv-head { align-items: flex-start; }
.conv-head-main { min-width: 0; }
.conv-head-main h3 { margin: 0; }
.conv-head-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 4px; font-size: 0.82rem; }
.conv-head-meta a, .conv-head-link {
    display: inline-flex; align-items: center; gap: 4px;
    color: var(--blue); font-weight: 600; text-decoration: none;
    background: none; border: 0; padding: 0; cursor: pointer; font-size: inherit;
}
.conv-head-meta a:hover, .conv-head-link:hover { text-decoration: underline; }

/* ------------------------------------------------------------ Aperçu d'annonce (modale « Vérifier ») */
.listing-preview { border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.listing-preview-photo {
    position: relative; height: 200px; display: flex; align-items: center; justify-content: center; color: #fff;
}
.listing-preview-photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.listing-preview-body { padding: 16px 18px; }

/* ------------------------------------------------------------ Fiche colocataire (composant réutilisable) */
.flatmate-card { border: 1px solid var(--line); border-radius: 16px; padding: 18px; background: #fff; display: flex; flex-direction: column; gap: 14px; }
.flatmate-card.is-compact { padding: 14px; gap: 11px; }
.flatmate-card .fc-head { display: flex; align-items: center; gap: 12px; }
.fc-avatar {
    flex: none; width: 46px; height: 46px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 0.95rem; color: #fff;
    background: linear-gradient(135deg, var(--blue), #4f7be6);
}
.fc-id { min-width: 0; }
.fc-id strong { display: block; color: var(--ink); font-size: 1.06rem; line-height: 1.2; }
.fc-sub { color: var(--muted); font-size: 0.85rem; }

.fc-search { display: flex; gap: 10px; align-items: flex-start; background: #eef3ff; border: 1px solid #d8e4ff; border-radius: 12px; padding: 10px 12px; }
.fc-search > .ic { color: var(--blue); margin-top: 2px; flex: none; }
.fc-search-label { display: block; font-size: 0.7rem; text-transform: uppercase; letter-spacing: .04em; color: var(--blue); font-weight: 700; }
.fc-search strong { display: block; color: var(--ink); font-size: 0.98rem; }
.fc-budget { color: var(--muted); font-size: 0.82rem; }

.fc-facts { list-style: none; padding: 0; margin: 0; display: grid; gap: 7px; }
.fc-facts li { display: flex; align-items: center; gap: 8px; font-size: 0.88rem; color: var(--ink); }
.fc-facts li .ic { color: var(--blue); flex: none; }

.fc-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.fc-tag { border: 1px solid var(--line); background: var(--soft); color: var(--muted); border-radius: 999px; padding: 3px 10px; font-size: 0.76rem; font-weight: 600; }

.fc-bio { margin: 0; padding: 9px 12px; border-left: 3px solid var(--blue); background: var(--soft); border-radius: 0 8px 8px 0; color: var(--muted); font-size: 0.9rem; font-style: italic; white-space: pre-line; }

/* ------------------------------------------------------------ Profil : en-tête lecture */
.profile-hero {
    display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
    background: linear-gradient(115deg, #fff, #edf3ff); border: 1px solid var(--line);
    border-radius: 16px; padding: 20px 22px; margin-bottom: 16px;
}
.profile-hero h2 { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* ------------------------------------------------------------ Inscription : rappel du rôle propriétaire */
.auth-role-note {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 10px 12px; margin-bottom: 14px; border-radius: 10px;
    background: #eef3ff; border: 1px solid #cfe0ff;
}
.auth-role-note .badge { display: inline-flex; align-items: center; gap: 5px; }
.auth-role-note a { font-size: 0.85rem; color: var(--blue); font-weight: 600; }

/* ------------------------------------------------------------ Topbar : utilisateur (icône + prénom) */
.topbar-user {
    display: inline-flex; align-items: center; gap: 8px; text-decoration: none;
    color: var(--ink); font-weight: 600; font-size: 0.9rem; padding: 5px 10px 5px 6px;
    border-radius: 999px; border: 1px solid var(--line); transition: background .13s, border-color .13s;
}
.topbar-user:hover { background: var(--soft); border-color: var(--blue); }
.avatar.avatar-sm { width: 28px; height: 28px; }
.avatar.avatar-sm .ic { color: var(--blue); }

.topbar-dropdown { position: relative; }
.topbar-dropdown .topbar-user { border: 1px solid var(--line); background: #fff; cursor: pointer; }
.dropdown-menu {
    position: absolute; right: 0; top: calc(100% + 6px); z-index: 60;
    background: #fff; border: 1px solid var(--line); border-radius: 12px;
    box-shadow: var(--shadow-lg); min-width: 190px; padding: 6px; display: flex; flex-direction: column;
}
.dropdown-menu[hidden] { display: none; }
.dropdown-menu a, .dropdown-menu button {
    display: flex; align-items: center; gap: 9px; width: 100%; text-align: left;
    padding: 9px 11px; border: 0; background: none; border-radius: 8px; cursor: pointer;
    font: inherit; font-size: 0.9rem; color: var(--ink); text-decoration: none;
}
.dropdown-menu a:hover, .dropdown-menu button:hover { background: var(--soft); }
.dropdown-menu form { margin: 0; border-top: 1px solid var(--line); margin-top: 4px; padding-top: 4px; }
.dropdown-menu form button { color: var(--err); }

/* Compte : « Vos activités » et « Agence » côte à côte en desktop */
.roles-agency-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.roles-agency-grid > .card { margin-top: 0; }
@media (max-width: 860px) { .roles-agency-grid { grid-template-columns: 1fr; } }

/* Upload d'une seule image (logo agence, avatar) */
.single-image { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.single-image-zone {
    display: flex; align-items: center; justify-content: center; text-align: center;
    width: 130px; height: 130px; border: 2px dashed var(--line-strong); border-radius: 14px;
    background: var(--soft); color: var(--muted); cursor: pointer; overflow: hidden; position: relative;
    transition: border-color .12s, background .12s;
}
.single-image-zone:hover { border-color: var(--blue); }
.single-image-zone.is-drag { border-color: var(--blue); background: #eef3ff; }
.single-image-hint { font-size: 0.76rem; line-height: 1.4; padding: 8px; }
.single-image-preview { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #fff; }
.single-image-remove { border: 0; background: none; color: var(--err); font-size: 0.8rem; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; padding: 0; }

/* Menu déroulant de la cloche : liste des notifications défilante */
.notif-menu { width: 360px; max-width: calc(100vw - 24px); padding: 0; overflow: hidden; }
.notif-menu-head { display: flex; align-items: center; justify-content: space-between; padding: 11px 14px; border-bottom: 1px solid var(--line); background: var(--soft); }
.notif-menu-head strong { font-size: 0.95rem; }
.notif-menu-head form { border: 0; margin: 0; padding: 0; }
.notif-menu-readall { color: var(--blue) !important; font-size: 0.78rem; font-weight: 700; padding: 4px 6px !important; border-radius: 6px; }
.notif-menu-list { max-height: min(64vh, 420px); overflow-y: auto; overscroll-behavior: contain; padding: 6px; }
.notif-menu-item {
    display: flex !important; flex-direction: row; align-items: flex-start; gap: 11px;
    padding: 11px 12px !important; border-radius: 10px; position: relative;
}
.notif-menu-item + .notif-menu-item { margin-top: 2px; }
.notif-menu-item.is-unread { background: #eef3ff; }
.notif-menu-item.is-unread:hover { background: #e3ecff; }
.notif-menu-ico {
    flex: none; width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center;
    background: #e9eefb; color: var(--blue);
}
.notif-menu-item.is-unread .notif-menu-ico { background: #dbe4fb; }
.notif-menu-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.notif-menu-msg { font-size: 0.86rem; line-height: 1.35; color: var(--ink); }
.notif-menu-item time { font-size: 0.72rem; color: var(--muted); }
.notif-menu-dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--coral); margin-top: 6px; }
.notif-menu-empty { margin: 0; padding: 28px 16px; text-align: center; color: var(--muted); font-size: 0.85rem; line-height: 1.5; }
.notif-menu-foot { justify-content: center; border-top: 1px solid var(--line); font-weight: 700; color: var(--blue) !important; font-size: 0.85rem; padding: 11px !important; }

/* Sur mobile : le menu de la cloche se cale sous la barre du haut, pleine largeur,
   la liste garde une hauteur bornée et se parcourt à l'ascenseur. */
@media (max-width: 720px) {
    .topbar-dropdown[data-notification-bell] { position: static; }
    .topbar-dropdown[data-notification-bell] .notif-menu:not([hidden]) {
        position: fixed; top: 60px; left: 10px; right: 10px; width: auto; max-width: none;
        z-index: 120; max-height: calc(100dvh - 150px); display: flex; flex-direction: column;
    }
    .topbar-dropdown[data-notification-bell] .notif-menu[hidden] { display: none; }
    .notif-menu-list { max-height: 56vh; flex: 1; }
}

/* ------------------------------------------------------------ Grille de cartes : hauteurs harmonisées */
.dashboard-grid { align-items: stretch; }
.dashboard-grid > .card { display: flex; flex-direction: column; }
.dashboard-grid > .card + .card { margin-top: 0; }
.dashboard-grid > .card > .card-body,
.dashboard-grid > .card > [id$="-panel"] { flex: 1 1 auto; }
.dashboard-grid > .card > .card-head { min-height: 52px; }

/* ------------------------------------------------------------ Cartes KPI (tableau de bord, admin) */
.kpi-row {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(158px, 1fr)); gap: 14px; margin: 20px 0;
}
.kpi {
    position: relative; display: flex; flex-direction: column; gap: 6px;
    padding: 18px 18px 16px; border-radius: 16px; text-decoration: none; color: #fff;
    overflow: hidden; min-height: 122px; transition: transform .15s, box-shadow .15s;
}
.kpi:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.kpi-icon {
    width: 38px; height: 38px; border-radius: 11px; display: flex; align-items: center; justify-content: center;
    background: rgba(255, 255, 255, .22);
}
.kpi-value { font: 800 2rem/1 var(--display); }
.kpi-label { font-size: 0.82rem; font-weight: 600; opacity: .92; display: flex; align-items: center; gap: 5px; margin-top: auto; }
.kpi-label .ic { opacity: .7; transition: transform .15s; }
.kpi:hover .kpi-label .ic { transform: translateX(3px); }
.kpi-blue { background: linear-gradient(140deg, #0b39a3, #1553d6); }
.kpi-coral { background: linear-gradient(140deg, #ff5c4d, #e8443a); }
.kpi-mint { background: linear-gradient(140deg, #0f9d76, #14c995); }
.kpi-sand { background: linear-gradient(140deg, #b5851f, #d8a53d); }
.kpi-plum { background: linear-gradient(140deg, #6d28d9, #9333ea); }
@media (max-width: 760px) { .kpi-row { grid-template-columns: 1fr 1fr; } }
/* Groupes de KPI titrés (Pilotage admin) */
.kpi-group { margin-top: 22px; }
.kpi-group > h2 {
    margin: 0; font-size: 0.82rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: .04em; color: var(--muted);
}
.kpi-group > h2 + .kpi-row { margin-top: 10px; }

/* ------------------------------------------------------------ Pages « Location à … » */
.place-stats { display: flex; flex-wrap: wrap; gap: 12px; margin: 0 0 18px; }
.place-stat { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 12px 18px; min-width: 150px; }
.place-stat strong { display: block; font: 800 1.45rem/1.15 var(--display); color: var(--ink); white-space: nowrap; }
.place-stat span { font-size: 0.84rem; color: var(--muted); }
.place-about { margin-top: 32px; max-width: 760px; }
.place-about h2 { font-size: 1.05rem; margin: 0 0 8px; }
.place-about p { margin: 0; color: var(--muted); line-height: 1.6; }

/* ------------------------------------------------------------ Audience (admin) */
.audience-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; margin-top: 16px; }
.audience-grid > .card, .audience-grid > .card + .card { margin-top: 0; }
.audience-section { margin: 26px 0 -4px; font-size: 0.82rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.audience-chart { display: block; width: 100%; height: auto; }
.audience-chart text { font: 600 11px/1 var(--body, inherit); fill: var(--muted); }
.audience-chart .grid { stroke: var(--line); stroke-width: 1; }
.audience-legend { display: flex; gap: 14px; font-size: 0.8rem; color: var(--muted); }
.audience-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.hbar + .hbar { margin-top: 11px; }
.hbar-top { display: flex; justify-content: space-between; gap: 10px; font-size: 0.88rem; }
.hbar-top small { color: var(--muted); margin-left: 5px; }
.hbar-track { height: 6px; border-radius: 999px; background: var(--soft); margin-top: 5px; overflow: hidden; }
.hbar-track > i { display: block; height: 100%; border-radius: 999px; background: var(--blue); }
.audience-note { margin: 12px 0 0; font-size: 0.86rem; color: var(--muted); }
.audience-filter { display: flex; flex-wrap: wrap; gap: 6px; }
a.chip-sm { text-decoration: none; display: inline-block; }

/* ------------------------------------------------------------ Lignes de tableau cliquables */
tr[data-row-href], tr[data-modal-open], tr[data-search-edit] { cursor: pointer; }
tr[data-row-href]:hover td, tr[data-modal-open]:hover td, tr[data-search-edit]:hover td { background: #eef3ff; }
tr[data-search-edit]:focus-visible { outline: 2px solid var(--blue); outline-offset: -2px; }
.stack-card[data-search-edit] { cursor: pointer; }
.stack-card[data-search-edit]:hover { border-color: var(--blue); }
.stack-card[data-search-edit]:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

/* ------------------------------------------------------------ Lignes cliquables : survol unifié */
.row-link {
    display: flex; align-items: center; gap: 12px; padding: 13px 16px;
    text-decoration: none; color: inherit; border-bottom: 1px solid var(--line);
    transition: background .13s;
}
.row-link:last-child { border-bottom: 0; }
.row-link:hover, .row-link:focus-visible { background: #eef3ff; outline: none; }
.row-link:focus-visible { box-shadow: inset 3px 0 0 var(--coral); }
.row-link .row-main { flex: 1; min-width: 0; }
.row-link .row-main strong { display: block; color: var(--ink); }
.row-link .row-main small { color: var(--muted); }
.row-link.is-unread { background: #eef3ff; }
a.team-card { transition: transform .15s, box-shadow .15s, border-color .15s; }
a.team-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--blue); }
.row-link.is-unread .row-main strong::before {
    content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%;
    background: var(--coral); margin-right: 7px; vertical-align: middle;
}

/* ------------------------------------------------------------ Page favoris : cartes de hauteur égale + note perso */
#fav-grid { align-items: stretch; }
.fav-item { display: flex; flex-direction: column; }
.fav-item .listing-card { flex: 1 1 auto; display: flex; flex-direction: column; }
.fav-item .listing-card .listing-body { flex: 1 1 auto; display: flex; flex-direction: column; }
.fav-item .listing-card .listing-body footer { margin-top: auto; }

.fav-note-wrap {
    margin-top: 10px;
    background: #fdfdfa; border: 1px solid #ececec; border-radius: 12px;
    padding: 11px 13px; box-shadow: 0 1px 2px rgba(16, 24, 40, .04);
    transition: border-color .15s, box-shadow .15s;
}
.fav-note-wrap:focus-within { border-color: #cfd8e6; box-shadow: 0 3px 12px rgba(16, 24, 40, .08); }
.fav-note-wrap > label {
    display: flex; align-items: center; gap: 6px; font-size: 0.72rem; font-weight: 700;
    color: #98a2b3; margin-bottom: 4px; text-transform: uppercase; letter-spacing: .04em;
}
.fav-note-wrap > label .ic { color: #b0b8c4; }
.fav-note {
    display: block; width: 100%; border: 0; background: transparent;
    padding: 0; font: inherit; font-size: 0.9rem; line-height: 1.55; color: #1a2233;
    resize: none; overflow: hidden; min-height: 40px;
}
.fav-note::placeholder { color: #b6bdc9; }
.fav-note:focus { outline: none; }
.fav-note-status { font-size: 11px; color: #667085; margin-top: 4px; min-height: 14px; font-weight: 500; }

/* ------------------------------------------------------------ Calendrier des visites (tient dans la popup, sans ascenseur) */
.cal-modal .modal { height: min(600px, calc(100vh - 32px)); }
.cal-modal .modal-body { flex: 1 1 auto; overflow: hidden; display: flex; flex-direction: column; padding: 14px 16px; }
.cal { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; }
.cal-bar { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; flex: none; }
.cal-bar [data-cal-label] { font-size: 1rem; text-transform: capitalize; min-width: 140px; text-align: center; }
.cal-bar [data-cal-today] { margin-left: auto; }

.cal-week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; flex: none; }
.cal-wd { text-align: center; font-size: 0.68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); padding-bottom: 4px; }

.cal-grid {
    display: grid; grid-template-columns: repeat(7, 1fr);
    grid-template-rows: repeat(var(--cal-rows, 6), minmax(0, 1fr));
    gap: 4px; flex: 1 1 auto; min-height: 0;
}
.cal-cell {
    min-height: 0; border: 1px solid var(--line); border-radius: 7px; padding: 3px;
    display: flex; flex-direction: column; gap: 2px; background: #fff; overflow: hidden;
}
.cal-cell.is-empty { border: 0; background: transparent; }
.cal-cell.is-today { border-color: var(--blue); box-shadow: inset 0 0 0 1px var(--blue); }
.cal-cell.has-ev { background: var(--soft); }
.cal-day { font-size: 0.72rem; font-weight: 600; color: var(--muted); flex: none; }
.cal-cell.is-today .cal-day { color: var(--blue); }
.cal-pill {
    display: block; width: 100%; text-align: left; border: 0; cursor: pointer; flex: none;
    font: inherit; font-size: 0.68rem; font-weight: 600; line-height: 1.3;
    color: #fff; background: var(--c, var(--blue)); border-radius: 4px; padding: 1px 4px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cal-pill.is-past { opacity: .5; }
/* RDV proposé, pas encore confirmé par l'autre partie : contour pointillé, fond transparent. */
.cal-pill.is-proposed {
    background: transparent; color: var(--c, var(--blue));
    border: 1px dashed var(--c, var(--blue)); padding: 0 3px;
}
.cal-more { font-size: 0.64rem; color: var(--muted); font-weight: 700; padding-left: 3px; }

.cal-legend {
    display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 10px; flex: none;
    font-size: 0.76rem; color: var(--muted); max-height: 44px; overflow: hidden;
}
.cal-legend span, .cal-tip-team { display: inline-flex; align-items: center; gap: 6px; }
.cal-legend i, .cal-tip-team i { width: 9px; height: 9px; border-radius: 3px; flex: none; }

.cal-tip {
    position: fixed; z-index: 9000; width: 220px; max-width: calc(100vw - 16px);
    background: var(--ink); color: #fff;
    border-radius: 8px; padding: 9px 11px; font-size: 0.78rem; line-height: 1.4;
    box-shadow: var(--shadow-lg); display: flex; flex-direction: column; gap: 2px;
    text-decoration: none;
}
a.cal-tip { cursor: pointer; }
a.cal-tip:hover, a.cal-tip:focus { background: #1e2c50; outline: none; }
.cal-tip strong { font-size: 0.82rem; }
.cal-tip-past { color: #ffd7d2; font-weight: 600; }

@media (max-width: 560px) {
    /* Mobile : la grille garde une hauteur de case naturelle et c'est le corps de la
       modale qui défile — plus de cases étirées ni de RDV réduits à un trait. */
    .cal-modal .modal { height: calc(100vh - 16px); max-width: none; }
    .cal-modal .modal-body { overflow-y: auto; overflow-x: hidden; }
    .cal { flex: none; }
    .cal-grid { flex: none; grid-template-rows: none; grid-auto-rows: minmax(56px, auto); }
    .cal-cell { min-height: 56px; }
    .cal-pill {
        font-size: 0.62rem; padding: 1px 4px; height: auto; line-height: 1.25;
        border-radius: 5px;
    }
    .cal-pill.is-proposed { padding: 0 3px; }
    .cal-day { font-size: 0.68rem; }
    .cal-bar [data-cal-label] { min-width: 0; flex: 1; font-size: 0.92rem; }
    .cal-bar [data-cal-today] { font-size: 0.72rem; padding: 5px 9px; }
    .cal-legend { max-height: none; }
}

/* ------------------------------------------------------------ Effets de survol */
/* Accueil : les 3 cartes « Je cherche… » */
.path-card { transition: transform .16s ease, box-shadow .16s ease; }
.path-card:hover, .path-card:focus-visible {
    transform: translateY(-4px);
    box-shadow: 0 20px 42px rgba(5, 42, 123, .28);
    outline: none;
}
.path-card > b { transition: transform .16s ease; }
.path-card:hover > b { transform: translateX(4px); }

/* Colocataires : survol d'une fiche */
.team-card-grid .flatmate-card { transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease; }
.team-card-grid .flatmate-card:hover {
    transform: translateY(-3px);
    border-color: var(--blue);
    box-shadow: 0 14px 32px rgba(11, 57, 163, .14);
}

/* --------------------------------------------- Avatars (photo dans les pastilles + sélecteur) */
.avatar img, .avatar-sm img, .fc-avatar img, .team-members > span img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; display: block; }
.fc-avatar, .team-members > span { overflow: hidden; }

.avatar-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(58px, 1fr)); gap: 10px; }
.avatar-opt {
    border: 2px solid transparent; border-radius: 14px; padding: 0; background: none; cursor: pointer;
    overflow: hidden; aspect-ratio: 1; transition: border-color .12s, transform .12s;
}
.avatar-opt img { width: 100%; height: 100%; display: block; }
.avatar-opt:hover { transform: translateY(-2px); }
.avatar-opt.is-selected { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(11, 57, 163, .16); }
.avatar-upload summary { cursor: pointer; color: var(--blue); font-weight: 600; font-size: 0.88rem; }

/* --------------------------------------------- Affichage mobile : tableaux → fiches empilées */
.mob-only { display: none; }
.stack-cards { display: flex; flex-direction: column; gap: 8px; padding: 10px; }
.stack-card {
    display: flex; gap: 12px; align-items: center; padding: 10px;
    border: 1px solid var(--line-strong); border-radius: 12px; background: #fff;
    color: inherit; text-decoration: none;
}
.stack-card.row-past { opacity: .62; }
.stack-card-thumb {
    position: relative;
    flex: none; width: 62px; height: 62px; border-radius: 10px; overflow: hidden;
    display: flex; align-items: center; justify-content: center; color: #fff;
    background: var(--blue); /* fond par défaut quand il n'y a pas de photo ni de classe tone-* */
}
.stack-card-thumb img { width: 100%; height: 100%; object-fit: cover; }
/* Nombre de photos, en pastille sur la miniature */
.stack-card-thumb .thumb-count {
    position: absolute; right: 3px; bottom: 3px;
    padding: 0 5px; border-radius: 999px;
    background: rgba(7, 17, 40, 0.72); color: #fff;
    font-size: 0.68rem; font-weight: 700; line-height: 1.7;
}
.stack-card-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.stack-card-body strong { font-size: 0.92rem; line-height: 1.25; }
.stack-card-body small { color: var(--muted); font-size: 0.8rem; }

.team-member-names { margin: 8px 0 0; font-size: 0.82rem; color: var(--muted); }

/* ---------------------------------------------- Radar : doublons appariés (déjà en base ↔ en attente) */
.dup-mini { display: flex; gap: 9px; align-items: flex-start; color: inherit; text-decoration: none; min-width: 0; }
.dup-mini .ic { flex: none; color: var(--muted); margin-top: 2px; }
.dup-mini-body { min-width: 0; display: flex; flex-direction: column; gap: 1px; flex: 1; }
.dup-mini-body strong { font-size: 0.86rem; line-height: 1.25; }
.dup-mini-body small { color: var(--muted); font-size: 0.76rem; }
.dup-mini-meta { color: var(--ink) !important; }
.dup-mini:hover strong { color: var(--blue); }
.dup-mini.is-gone { align-items: center; }
.dup-mini-thumb {
    flex: none; width: 44px; height: 44px; border-radius: 8px; overflow: hidden;
    display: flex; align-items: center; justify-content: center; color: #fff; background: var(--blue);
}
.dup-mini-thumb img { width: 100%; height: 100%; object-fit: cover; }

/* Déclaration manuelle de doublon : liste de candidats + action de rattachement. */
.dup-choice-list { display: flex; flex-direction: column; gap: 8px; }
.dup-choice {
    display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
    border: 1px solid var(--line-strong); border-radius: 12px; background: #fff; padding: 10px 12px;
}
.dup-choice .dup-mini { flex: 1 1 260px; }
.dup-choice-act { flex: none; margin-left: auto; }
@media (max-width: 620px) {
    .dup-choice-act { margin-left: 0; width: 100%; }
    .dup-choice-act form, .dup-choice-act .btn { width: 100%; }
}

.dup-card { border: 1px solid var(--line-strong); border-radius: 12px; background: #fff; padding: 12px; }
.dup-card + .dup-card { margin-top: 8px; }
/* La paire a besoin de toute la largeur : elle ne se met pas en grille 2 colonnes */
.section-views.view-cards .stack-cards .dup-card { grid-column: 1 / -1; }
.dup-card-cols { display: grid; grid-template-columns: 1fr auto 1fr; gap: 12px; align-items: center; }
.dup-col { min-width: 0; }
.dup-col-tag {
    align-self: flex-start; margin-bottom: 3px; padding: 1px 8px; border-radius: 999px;
    font-size: 0.68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .02em;
    background: var(--soft); color: var(--muted);
}
/* Dans le tableau, l'en-tête de colonne dit déjà « Déjà en base » / « En attente » */
.table .dup-col-tag { display: none; }
.dup-col-tag-pending { background: #fff1e8; color: #9a4a12; }
.dup-vs { flex: none; font-weight: 700; font-size: 0.85rem; color: var(--muted); white-space: nowrap; }
.dup-card-decide {
    display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
    margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line);
}
.dup-card-decide > span { font-weight: 600; font-size: 0.85rem; }
.dup-decide { display: inline-flex; gap: 6px; }
.dup-why { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.dup-why .badge { font-size: 0.72rem; }
td.dup-why { max-width: 190px; }
@media (max-width: 620px) {
    .dup-card-cols { grid-template-columns: 1fr; }
    .dup-vs { justify-self: start; }
}

/* ---------------------------------------------- Partage d'annonce */
.detail-title-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.detail-title-row > h2 { margin: 0; }
.detail-title-row .btn { flex: none; }

/* Actions secondaires de la fiche (favori + partage), regroupées sous « Ajouter à la Team » */
.listing-side-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.listing-side-actions > .btn { flex: 1 1 auto; justify-content: center; }
/* Signalement : discret, en pied de carte, loin du bouton « Contacter » */
.listing-report-line {
    margin: 18px 0 0; padding-top: 14px; border-top: 1px solid var(--line);
    font-size: 0.82rem; color: var(--muted); display: flex; align-items: center; gap: 4px; flex-wrap: wrap;
}
.listing-report-line .btn { color: var(--muted); padding-inline: 6px; }
.listing-report-line .btn:hover { color: var(--err); }
.share-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.share-app {
    display: flex; flex-direction: column; align-items: center; gap: 6px;
    padding: 10px 2px; border: 0; background: none; cursor: pointer; border-radius: 10px;
    color: var(--ink); font: 600 0.73rem var(--font); text-align: center; text-decoration: none;
}
.share-app:hover { background: var(--soft); }
.share-ic {
    width: 44px; height: 44px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    background: var(--soft); color: var(--muted);
}
.share-wa .share-ic { background: #e7f7ee; color: #1fa855; }
.share-msg .share-ic { background: #e8f0ff; color: #0a7cff; }
.share-ig .share-ic { background: #fdecf3; color: #d6296b; }
.share-tg .share-ic { background: #e8f4fb; color: #29a9e0; }
.share-mail .share-ic { background: #e9efff; color: var(--blue); }
.share-gmail .share-ic { background: #fdeceb; color: #d93025; }
@media (max-width: 420px) { .share-grid { grid-template-columns: repeat(3, 1fr); } }

/* ---------------------------------------------- Boutons flottants : remonter / retour */
.scroll-top, .nav-back {
    position: fixed; z-index: 55; width: 44px; height: 44px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    box-shadow: var(--shadow); cursor: pointer; transition: opacity .2s, transform .2s;
}
.scroll-top {
    right: 16px; bottom: 78px; border: 0; background: var(--blue); color: #fff;
    opacity: 0; transform: translateY(10px); pointer-events: none;
}
.scroll-top.is-visible { opacity: 1; transform: none; pointer-events: auto; }
.nav-back {
    left: 16px; bottom: 78px; border: 1px solid var(--line-strong); background: #fff; color: var(--ink);
}
@media (min-width: 900px) {
    .scroll-top { right: 24px; bottom: 24px; }
    .nav-back { display: none; }
}

/* ---------------------------------------------- Annonce dont le lien d'origine est mort */
.dead-badge {
    position: absolute; left: 8px; top: 8px; z-index: 3;
    display: inline-flex; align-items: center; gap: 4px;
    background: var(--err, #d92d20); color: #fff;
    font-size: 0.68rem; font-weight: 800; text-transform: uppercase; letter-spacing: .02em;
    padding: 3px 8px; border-radius: 999px;
}
.dead-badge-sm { left: 3px; top: 3px; padding: 1px 5px; font-size: 0.6rem; }
.dossier-photo.is-dead img, .stack-card-thumb.is-dead img, .dossier-mini.is-dead img { filter: grayscale(1) opacity(.55); }

/* ---------------------------------------------- Emoji dans les composeurs de message */
.emoji-btn {
    flex: none; min-height: 46px; width: 42px; padding: 0;
    display: flex; align-items: center; justify-content: center;
    background: #fff; border: 1px solid var(--line-strong); border-radius: 11px;
    color: var(--muted); cursor: pointer;
}
.emoji-btn:hover { color: var(--blue); border-color: var(--blue); }
.emoji-panel {
    position: fixed; z-index: 400; top: 0; left: 0; width: 300px; max-width: calc(100vw - 16px);
    background: #fff; border: 1px solid var(--line-strong); border-radius: 14px;
    box-shadow: var(--shadow); padding: 8px; overflow: hidden;
}
.emoji-panel[hidden] { display: none; }
.emoji-tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); padding-bottom: 6px; margin-bottom: 6px; }
.emoji-tabs button {
    flex: 1; border: 0; background: none; cursor: pointer; font-size: 1.15rem;
    padding: 5px 0; border-radius: 8px; line-height: 1;
}
.emoji-tabs button.is-active { background: var(--soft); }
.emoji-grid {
    display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px;
    max-height: 200px; overflow-y: auto;
}
.emoji-grid button {
    border: 0; background: none; cursor: pointer; font-size: 1.35rem;
    padding: 5px 0; border-radius: 8px; line-height: 1;
}
.emoji-grid button:hover { background: var(--soft); }
@media (max-width: 560px) {
    .emoji-panel { left: 8px !important; right: 8px; width: auto; top: auto !important; bottom: 8px; }
    .emoji-grid { grid-template-columns: repeat(8, 1fr); max-height: 34vh; }
}

/* Historique des visites non effectuées */
.missed-visits { background: var(--soft); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin-bottom: 12px; }
.missed-visits > strong { display: inline-flex; align-items: center; gap: 6px; font-size: 0.85rem; }
.missed-visits ul { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 3px; }
.missed-visits li { font-size: 0.82rem; color: var(--ink); }

/* Déplacement d'une visite : le champ date/heure n'apparaît qu'au clic sur le crayon */
.reschedule { margin-top: 10px; }
.reschedule-panel { margin-top: 10px; }
/* .reschedule-field est en display:flex : sans ça, [hidden] ne le masque pas. */
.reschedule-field[hidden], .reschedule-panel[hidden] { display: none; }
.reschedule-field { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.reschedule-field .input { width: auto; }
/* Encart RDV : le crayon « modifier » est calé à droite, centré sur toute la hauteur. */
.visit-alert { align-items: center; }
.visit-alert > .ic { margin-top: 0; }
.visit-pencil[hidden] { display: none; }
.visit-pencil {
    flex: none; align-self: center;
    display: inline-flex; align-items: center; justify-content: center;
    width: 30px; height: 30px; padding: 0;
    border: 1px solid currentColor; border-radius: 8px; background: rgba(255, 255, 255, .5);
    color: inherit; cursor: pointer; transition: background .12s;
}
.visit-pencil:hover { background: #fff; }

/* Invitation reçue (Mes Teams) : boutons côte à côte en desktop, empilés en mobile. */
.invite-actions { display: flex; gap: 8px; flex: none; }
@media (max-width: 720px) {
    .invite-row { flex-wrap: wrap; }
    .invite-row .row-main { flex-basis: 100%; }
    .invite-actions { flex-direction: column; width: 100%; }
    .invite-actions form, .invite-actions .btn { width: 100%; }
    /* RDV de visite : le champ date/heure prend toute la largeur, le bouton suit dessous, sans grand vide. */
    .reschedule-field { gap: 8px; }
    .reschedule-field .input { width: 100%; flex: 1 1 100%; }
    .reschedule-field .btn { width: 100%; }
    form .input[type="datetime-local"] { width: 100%; }
}
.hint-xs { font-size: 0.74rem; margin-top: 6px; }

/* Bascule Tableau / Vignettes (desktop) — sélecteur icônes */
.view-switch { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 9px; overflow: hidden; flex: none; }
.view-switch button {
    padding: 6px 9px; line-height: 0; background: #fff; color: var(--muted);
    border: 0; cursor: pointer; display: inline-flex; align-items: center;
}
.view-switch button + button { border-left: 1px solid var(--line-strong); }
.view-switch button.is-active { background: var(--blue); color: #fff; }
.section-views [data-view-pane] { display: none; }
.section-views.view-table [data-view-pane="table"] { display: block; }
.section-views.view-cards [data-view-pane="cards"] { display: block; }
@media (min-width: 721px) {
    .section-views.view-cards .stack-cards { display: grid; grid-template-columns: 1fr 1fr; }
}
@media (max-width: 720px) {
    .view-switch { display: none; }
    .section-views [data-view-pane="table"] { display: none !important; }
    .section-views [data-view-pane="cards"] { display: block !important; }

    /* Consoles qui restent en tableau sur mobile (défilement horizontal) : le
       sélecteur reste visible et c'est le choix Tableau/Vignettes qui décide. */
    .view-switch.view-switch-mobile { display: inline-flex; }
    .section-views.keep-table-mobile.view-table [data-view-pane="table"] { display: block !important; }
    .section-views.keep-table-mobile.view-table [data-view-pane="cards"] { display: none !important; }
    .section-views.keep-table-mobile.view-cards [data-view-pane="table"] { display: none !important; }
    .section-views.keep-table-mobile.view-cards [data-view-pane="cards"] { display: block !important; }
}

/* Bascule admin/propriétaire ↔ colocataire sur une fiche annonce */
.preview-switch { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 10px; overflow: hidden; margin-bottom: 14px; }
.preview-switch a {
    display: inline-flex; align-items: center; gap: 6px; padding: 7px 13px;
    font-size: 0.82rem; font-weight: 700; color: var(--muted); background: #fff;
}
.preview-switch a + a { border-left: 1px solid var(--line-strong); }
.preview-switch a.is-active { background: var(--blue); color: #fff; }

/* Fiche Team : 4 compteurs (budget / logements / messages / visites) */
.team-card dl { grid-template-columns: repeat(2, 1fr) !important; gap: 12px 10px; }
.team-card-new {
    display: inline-block; background: var(--coral); color: #fff; font-size: 9px;
    font-weight: 800; padding: 1px 5px; border-radius: 10px; vertical-align: middle; margin-left: 2px;
}

/* Repère « Nouveau » (alerte de recherche) : à côté de la source (« Vu sur… »),
   dans les résultats de recherche uniquement — jamais sur la fiche annonce. */
.listing-new-badge {
    display: inline-block; margin-left: 5px; background: var(--coral); color: #fff;
    font-size: 9px; font-weight: 800; letter-spacing: .03em; text-transform: uppercase;
    padding: 2px 6px; border-radius: 999px; vertical-align: middle;
}

/* Nombre de photos, en bas à droite de la vignette d'une annonce */
.listing-visual .photo-count, .detail-photo .photo-count {
    position: absolute; inset: auto 10px 10px auto; z-index: 3;
    background: rgba(6, 20, 55, .72); color: #fff; font-size: 11px; font-weight: 700;
    padding: 3px 7px; border-radius: 7px; display: inline-flex; align-items: center; gap: 4px;
}

/* Titres longs : jamais de débordement horizontal */
.breadcrumb span, .app-topbar h1, .dossier-head-main h2, .detail-copy h2 { overflow-wrap: anywhere; }

/* Bouton « Annonces qui correspondent à la Team » : texte multi-lignes centré */
.team-match-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.btn-team-match { white-space: normal; text-align: center; line-height: 1.3; }
.btn-team-match > span { display: inline; }
@media (max-width: 720px) {
    .team-match-row { flex-direction: column; align-items: stretch; }
    .btn-team-match { width: 100%; }
}

@media (max-width: 720px) {
    .desk-only { display: none !important; }
    .mob-only { display: block; }

    /* Barre du haut : le titre de page (souvent le nom d'une annonce) tient sur une ligne.
       NB : pas d'overflow:hidden sur .app-topbar — ça masquerait les menus déroulants. */
    .app-topbar h1 {
        font-size: 1rem; min-width: 0; flex: 1;
        white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    }
    .app-topbar .top-actions { flex: none; }
    /* Menus déroulants de la barre du haut : bien au-dessus du contenu. */
    .app-stage { position: relative; z-index: 1; }
    .app-topbar { position: relative; z-index: 40; }
    .app-topbar .dropdown-menu { z-index: 200; }
    /* Dernier maillon du fil d'Ariane : tronqué s'il est trop long */
    .breadcrumb { flex-wrap: nowrap; font-size: 0.95rem; }
    .breadcrumb span:last-child {
        overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0;
    }
    .breadcrumb a { white-space: nowrap; flex: none; }
    .dossier-head-main h2, .detail-copy h2 { font-size: 1.25rem; line-height: 1.3; }
}

/* --------------------------------------------- Contraste des canevas (fin de fichier = priorité) */
.card,
.panel,
.metric-grid article,
.team-card,
.dashboard-grid > .card {
    border: 1px solid var(--line-strong);
    box-shadow: var(--card-lift);
}
/* Fiche colocataire / fiche Team, y compris posée sur une modale blanche. */
.flatmate-card {
    border: 1px solid var(--line-strong);
    box-shadow: var(--card-lift);
}
.modal-body > .flatmate-card,
.modal-body > .card,
.modal-body .team-hero {
    background: #fff;
    border: 1px solid var(--line-strong);
    box-shadow: var(--card-lift);
}

/* --------------------------------------------- Pied de page : liens réseaux sociaux */
@media (min-width: 721px) {
    .site-footer { grid-template-columns: auto 1fr auto auto; }
}
.footer-social { display: flex; align-items: center; gap: 10px; }
.footer-social span { color: var(--muted); font-size: 13px; }
.footer-social a {
    display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%;
    background: var(--soft); color: var(--blue); transition: .2s;
}
.footer-social a.social-facebook:hover { background: var(--blue); color: #fff; }
.footer-social a.social-instagram:hover { background: #d6249f; color: #fff; }
@media (max-width: 720px) {
    /* La grille du pied de page repasse déjà à 1 colonne (app.css) : ce bloc devient
       sa propre ligne, centrée comme le reste. */
    .footer-social { justify-content: center; }
}
