/* ============================================================================
 * resa-spa.css — Styles pour la SPA Réservations
 * ============================================================================
 * Couvre :
 *   - Vue Liste compacte (hauteur réduite, ordre colonnes personnalisable)
 *   - Vue Calendrier mensuel (lane assignment, bandeaux multi-jours)
 *   - Vue Semaine (swimlanes par bien)
 *   - Vue Agenda 12 mois (grille de mini-calendriers)
 *   - Popover thématique
 *   - Modal d'édition large
 *   - Skeleton screens
 * ============================================================================ */

/* ─── Skeleton screens ─────────────────────────────────────────────── */
.res-item.skeleton { pointer-events: none; opacity: .8; }
.sk-bar {
    display: inline-block; height: 12px; border-radius: 4px;
    background: linear-gradient(90deg, #eee 0%, #f5f5f5 50%, #eee 100%);
    background-size: 200% 100%; animation: sk-pulse 1.4s ease-in-out infinite;
}
@keyframes sk-pulse {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ─── Onglets statut ───────────────────────────────────────────────── */
.resa-status-tab { background: transparent; border: 1px solid transparent; }
.resa-status-tab.active {
    background: #e3f0e8; color: #1f6f78; border-color: #1f6f78;
}

/* ─── Onglets de vue ───────────────────────────────────────────────── */
.resa-view-tabs {
    display: flex; gap: 4px; margin-bottom: 14px;
    border-bottom: 1px solid #e8e8e8;
}
.resa-view-tab {
    background: transparent; border: none; padding: 10px 16px;
    color: #777; font-weight: 600; font-size: 14px; cursor: pointer;
    border-bottom: 2px solid transparent; margin-bottom: -1px;
    transition: all .15s;
}
.resa-view-tab:hover:not(:disabled) { color: #222; }
.resa-view-tab.active { color: #1f6f78; border-bottom-color: #1f6f78; }
.resa-view-tab:disabled { opacity: .4; cursor: not-allowed; }

/* ─── Vue Liste — version compacte ─────────────────────────────────── */
.res-list-compact .res-item {
    border-radius: 6px;
}
.res-list-compact .res-header {
    padding: 6px 12px;
    gap: 10px;
    align-items: center;
    min-height: 36px;
}
.res-list-compact .res-header-dates {
    font-size: 12px;
    min-width: 150px;
}
.res-list-compact .res-header-dates strong { font-weight: 600; }
.res-list-compact .res-header-type { min-width: 50px; }
.res-list-compact .res-header-prop {
    min-width: 110px; max-width: 150px;
    font-size: 12px;
}
.res-list-compact .res-header-guest { flex: 1; min-width: 0; }
.res-list-compact .res-header-guest-name {
    font-size: 13px; font-weight: 600;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.res-list-compact .res-header-pers { min-width: 42px; }
.res-list-compact .res-header-pers strong {
    font-size: 14px; line-height: 1;
}
.res-list-compact .res-header-pers .label {
    font-size: 9px; color: #999; line-height: 1;
}
.res-list-compact .res-header-lang { min-width: 30px; }
.res-list-compact .res-header-sent { min-width: 40px; gap: 4px; }
.res-list-compact .res-header-chevron { min-width: 14px; }
.res-list-compact .badge {
    padding: 1px 6px; font-size: 10px;
}
.res-list-compact.res-list-reservations .res-header-prop {
    min-width: 0;
    max-width: none;
}

/* ─── Cellule "Bien" ───────────────────────────────────────────────── */
.res-header-prop {
    display: flex; align-items: center; gap: 6px;
    overflow: hidden;
    color: #555;
}
.res-prop-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.res-prop-name {
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    font-weight: 500;
}

/* ============================================================================
 * Marqueur temporel — pilotage via data-marker-style sur .res-list
 * ============================================================================
 * IMPORTANT : app.css (legacy) pose un liseré via `box-shadow: inset 4px 0 0 0`
 * sur .res-item.is-current/is-upcoming/is-past, ainsi qu'un background teinté.
 * On utilise ce liseré natif au lieu d'en empiler un nouveau.
 *
 * Deux modes :
 *   - "border" (défaut) : on laisse app.css faire son travail (rien à faire)
 *   - "pill"            : on neutralise le box-shadow + on ajoute une pilule
 *
 * Le sélecteur .res-list[data-marker-style="..."] est plus spécifique que
 * .res-item seul → surcharge correctement.
 * ============================================================================ */

/* ─── Mode "pill" : neutraliser le liseré natif et ajouter une pilule ─── */
.res-list[data-marker-style="pill"] .res-item.is-current,
.res-list[data-marker-style="pill"] .res-item.is-now,
.res-list[data-marker-style="pill"] .res-item.is-upcoming,
.res-list[data-marker-style="pill"] .res-item.is-past {
    box-shadow: none !important;
}
.res-list[data-marker-style="pill"] .res-item.is-current:hover,
.res-list[data-marker-style="pill"] .res-item.is-now:hover,
.res-list[data-marker-style="pill"] .res-item.is-upcoming:hover,
.res-list[data-marker-style="pill"] .res-item.is-past:hover {
    box-shadow: var(--shadow, 0 2px 4px rgba(0,0,0,0.06)) !important;
}
/* La pilule : un pseudo-élément en début de .res-header.
   On utilise position: absolute pour ne pas casser le grid de liste. */
.res-list[data-marker-style="pill"] .res-item {
    position: relative;
}
.res-list[data-marker-style="pill"] .res-item:not(.res-item-sort)::before {
    content: "";
    position: absolute;
    left: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 24px;
    border-radius: 2px;
    background: #ccc;
    z-index: 1;
}
.res-list[data-marker-style="pill"] .res-item-sort::before {
    display: none !important;
}
.res-list[data-marker-style="pill"] .res-item.is-past::before     { background: #a8c5b8; }
.res-list[data-marker-style="pill"] .res-item.is-current::before,
.res-list[data-marker-style="pill"] .res-item.is-now::before      { background: #e07856; }
.res-list[data-marker-style="pill"] .res-item.is-upcoming::before { background: #1f6f78; }
/* En mode pill, on décale légèrement le contenu pour laisser la place à la pilule.
   On l'applique AUSSI à la barre de tri (qui est une .res-item-sort) pour
   que les colonnes restent alignées avec les lignes. */
.res-list[data-marker-style="pill"] .res-header,
body.resa-marker-pill .res-item-sort .res-header {
    padding-left: 24px !important;
}

/* ============================================================================
 * Vue Liste Réservations — grid dédiée à 8 colonnes
 * ============================================================================
 * La liste utilise maintenant une vraie colonne "Bien". Avant, le bien était
 * intégré dans la cellule "Voyageur", ce qui rendait impossible l'alignement
 * propre de l'en-tête "Bien" avec les valeurs affichées dessous.
 *
 * Colonnes : Dates | Type | Voyageur | Bien | Pers. | Lang | Envois | Chevron
 * ============================================================================ */
.res-list-reservations .res-header {
    grid-template-columns: 200px 70px minmax(150px, 190px) minmax(130px, 1fr) 80px 50px 80px 30px;
}
.res-list-reservations .res-header-guest,
.res-list-reservations .res-header-prop {
    min-width: 0;
}
.res-list-reservations .res-header-prop {
    max-width: none;
    font-size: 12px;
}
.res-list-reservations .res-header-lang,
.res-list-reservations .res-header-sent,
.res-list-reservations .res-header-chevron {
    justify-self: center;
}
.res-list-reservations .res-header-pers {
    justify-self: stretch;
}
.res-list-reservations .res-header-guest-name {
    min-width: 0;
}

/* ─── Barre de tri = .res-item-sort (ligne fantôme) ──────────────────────
 * Elle hérite de la même grid 8-cols que les lignes de la liste réservations.
 * La classe res-list-compact est appliquée aussi à l'en-tête pour conserver
 * exactement les mêmes paddings et gaps que les lignes.
 * On ne fait que :
 *   - changer la couleur de fond (gris léger pour ressembler à un header)
 *   - retirer le hover (le tri se fait par bouton interne)
 *   - retirer le liseré (pas pertinent pour la barre)
 *   - réduire la hauteur (header plus fin que les lignes)
 * ───────────────────────────────────────────────────────────────────── */
.res-item-sort {
    background: #f7faf9 !important;
    box-shadow: none !important;  /* retire le faux liseré coral éventuel */
    cursor: default !important;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-size: 11px;
    color: #555;
}
.res-item-sort:hover {
    background: #f7faf9 !important;
    box-shadow: none !important;
    border-color: var(--line) !important;
}
.res-item-sort .res-header {
    cursor: default !important;
    padding-top: 8px !important;
    padding-bottom: 8px !important;
    min-height: 32px;
}
/* L'en-tête utilise exactement les mêmes padding/gap compact que les lignes.
   Les boutons n'ajoutent donc plus de décalage horizontal parasite. */
.res-item-sort .resa-sort-btn {
    padding-left: 0;
    padding-right: 0;
}
.res-item-sort .res-header-dates {
    display: flex;
    align-items: center;
    gap: 6px;
}
.res-item-sort .res-header-guest,
.res-item-sort .res-header-prop {
    display: flex;
    align-items: center;
    justify-content: flex-start;
}
.res-item-sort .res-header-pers {
    display: flex;
    align-items: center;
    justify-content: center;
}
.res-item-sort .res-header:hover {
    background: #f7faf9 !important;
}
.res-item-sort .res-header-prop {
    color: inherit;
}
.res-item-sort .res-header-pers {
    text-align: center;
}
.res-item-sort .res-header-pers .resa-sort-btn {
    justify-content: center;
}

/* ─── Cellule "Voyageur" : nom + icônes sur la MÊME ligne ────────────────
 * app.css ligne 1174 met .res-header-guest-icons en `display: flex` ce qui
 * en fait un block element → l'icône 🐾 tombe sous le nom. On force en
 * inline-flex pour qu'il reste à côté du texte du nom dans le même flux.
 * ───────────────────────────────────────────────────────────────────── */
.res-header-guest-name {
    display: flex;
    align-items: center;
    gap: 8px;
}
.res-header-guest-name > span:first-child {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}
.res-header-guest-icons {
    display: inline-flex !important;
    gap: 4px;
    align-items: center;
    flex-shrink: 0;
    margin-top: 0 !important;
}

/* ─── Tri (cliquable en-tête) ──────────────────────────────────────── */
.resa-sort-bar {
    display: flex; gap: 4px; align-items: center; flex-wrap: wrap;
    padding: 4px 12px; border-bottom: 1px solid #f0f0f0;
    background: #fafafa; border-radius: 6px 6px 0 0;
    font-size: 11px; color: #777; font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.04em;
}
.resa-sort-btn {
    cursor: pointer; padding: 4px 8px; border-radius: 4px;
    border: none; background: transparent; color: inherit;
    font-size: inherit; font-weight: inherit;
    display: inline-flex; align-items: center; gap: 4px;
}
.resa-sort-btn:hover { background: #fff; color: #222; }
.resa-sort-btn.active { color: #1f6f78; background: #fff; }
.resa-sort-btn .sort-arrow { font-size: 10px; opacity: .6; }


@media (max-width: 900px) {
    .res-list-reservations .res-header {
        grid-template-columns: 1fr 60px 30px;
    }
    .res-list-reservations .res-header-dates,
    .res-list-reservations .res-header-type,
    .res-list-reservations .res-header-prop,
    .res-list-reservations .res-header-lang,
    .res-list-reservations .res-header-sent {
        display: none;
    }
}

/* ─── Rappel "en cours" ─────────────────────────────────────────────── */
.resa-current-banner {
    background: linear-gradient(to right, #fef3ed, #fef9f5);
    border: 1px solid #f5d9c8;
    border-left: 4px solid #e07856;
    border-radius: 8px; padding: 10px 14px;
    margin-bottom: 12px;
    display: flex; align-items: center; gap: 10px;
    font-size: 13px;
}
.resa-current-banner .icon { color: #e07856; font-size: 18px; }
.resa-current-banner .body { flex: 1; }
.resa-current-banner .name { font-weight: 600; color: #222; }
.resa-current-banner .meta { font-size: 12px; color: #777; }
.resa-current-banner button {
    background: #e07856; color: #fff; border: none;
    padding: 4px 10px; border-radius: 4px; font-size: 12px;
    cursor: pointer; font-weight: 600;
}

/* ─── Batch bar (sélection multiple) ────────────────────────────────── */
.batch-bar {
    position: sticky; top: 0; z-index: 50;
    display: flex; gap: 10px; align-items: center;
    padding: 10px 14px; background: #1f6f78; color: #fff;
    border-radius: 8px; margin-bottom: 12px;
}
.batch-bar .btn { color: #fff; border-color: rgba(255,255,255,.3); }
.batch-bar .btn:hover { background: rgba(255,255,255,.1); }
.res-item.batch-selected { background: rgba(31, 111, 120, 0.06); border-color: #1f6f78; }

/* ─── Vue Calendrier mensuel ────────────────────────────────────────── */
.cal-month {
    background: #fff; border: 1px solid #e8e8e8; border-radius: 8px;
    overflow: hidden;
}
.cal-month-header {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 16px; background: #f7faf9; border-bottom: 1px solid #e8e8e8;
}
.cal-month-title {
    font-size: 18px; font-weight: 700; color: #1f6f78;
    text-transform: capitalize; flex: 1;
}
.cal-nav-btn {
    background: #fff; border: 1px solid #e0e6e6; border-radius: 4px;
    width: 28px; height: 28px; cursor: pointer; color: #1f6f78;
    display: inline-flex; align-items: center; justify-content: center;
}
.cal-nav-btn:hover { background: #eef4f4; }
.cal-today-btn {
    background: #fff; border: 1px solid #e0e6e6; border-radius: 4px;
    padding: 4px 10px; cursor: pointer; font-size: 12px; color: #333;
    font-weight: 600;
}
.cal-today-btn:hover { background: #eef4f4; }
.cal-weekdays {
    display: grid; grid-template-columns: repeat(7, 1fr);
    background: #fafafa; border-bottom: 1px solid #e8e8e8;
    font-size: 11px; text-transform: uppercase; color: #777; font-weight: 600;
    letter-spacing: 0.04em;
}
.cal-weekday { padding: 8px 10px; text-align: center; }
.cal-grid {
    display: flex;
    flex-direction: column;
}
/* ─── Une semaine = une grille 7 colonnes × N lignes (1 ligne num + N lanes) */
.cal-week {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    /* 1 ligne pour les numéros, puis N lignes pour les lanes (var --lanes posée inline) */
    grid-template-rows: 28px repeat(var(--lanes, 0), 22px);
    grid-auto-rows: 22px;
    border-top: 1px solid #f0f0f0;
    padding-bottom: 4px;
    min-height: 80px;
    position: relative;
}
.cal-week:first-child { border-top: none; }

/* Cellules de fond pour les jours (séparateurs verticaux) */
.cal-day-bg {
    border-right: 1px solid #f0f0f0;
    background: #fff;
}
.cal-day-bg:last-of-type { border-right: none; }
.cal-day-bg.is-other-month { background: #fafafa; }
.cal-day-bg.is-today       { background: #fef9f5; }

/* Numéros de jour */
.cal-day-num {
    padding: 4px 8px;
    font-weight: 600;
    font-size: 13px;
    color: #333;
    z-index: 1;  /* au-dessus du fond */
}
.cal-day-num.is-other-month { color: #ccc; }
.cal-day-num.is-today       { color: #e07856; }

/* Barres de réservation : positionnées via grid-column inline.
 * Les couleurs (background, color) sont définies inline en PHP depuis le
 * triptyque du bien (palette arrival/stay/departure). */
.cal-bar {
    height: 18px;
    margin: 2px 0;
    padding: 0 8px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: flex;
    align-items: center;
    transition: filter .15s;
    z-index: 2;  /* au-dessus des fonds et numéros */
}
.cal-bar:hover { filter: brightness(0.92); }

/* Continuité visuelle entre sous-segments d'une même résa :
   les bords gauches/droits sont arrondis UNIQUEMENT aux extrémités réelles
   (is-actual-start / is-actual-end). Les jonctions internes (entre arrival
   et stay, ou entre stay et departure) restent plates et collées.        */
.cal-bar {
    border-radius: 0;
}
.cal-bar.is-actual-start {
    border-top-left-radius: 4px;
    border-bottom-left-radius: 4px;
    margin-left: 2px;
}
.cal-bar.is-actual-end {
    border-top-right-radius: 4px;
    border-bottom-right-radius: 4px;
    margin-right: 2px;
}

/* Spécificités par kind : départ/arrivée peuvent avoir une nuance visuelle
   (légère bordure verticale entre kinds pour matérialiser la transition) */
.cal-bar-arrival + .cal-bar-stay,
.cal-bar-stay + .cal-bar-departure {
    /* pas de bordure ajoutée — laisser le triptyque parler */
}

.cal-legend {
    display: flex; gap: 14px; padding: 10px 16px;
    border-top: 1px solid #f0f0f0; background: #fafafa;
    font-size: 12px;
    align-items: center;
}
.cal-legend-item { display: flex; align-items: center; gap: 6px; }
.cal-legend-dot { width: 14px; height: 14px; border-radius: 3px; }
.cal-legend-triptyque {
    display: inline-flex;
    gap: 2px;
    align-items: center;
}
.cal-legend-triptyque span {
    display: inline-block;
    width: 12px; height: 12px;
    border-radius: 2px;
}
.cal-legend-sep { color: #ccc; margin: 0 4px; }

/* ─── Vue Semaine (swim lanes par bien) ─────────────────────────────── */
.week-container {
    background: #fff; border: 1px solid #e8e8e8; border-radius: 8px;
    overflow: hidden;
}
.week-header {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 16px; background: #f7faf9; border-bottom: 1px solid #e8e8e8;
}
.week-title {
    font-size: 16px; font-weight: 700; color: #1f6f78; flex: 1;
}
.week-grid {
    display: grid;
    /* 1 colonne propriété + 7 colonnes jours */
    grid-template-columns: 160px repeat(7, 1fr);
}
.week-grid-header {
    background: #fafafa; border-bottom: 1px solid #e8e8e8;
    padding: 8px 10px; font-size: 11px; text-transform: uppercase;
    color: #777; font-weight: 600; letter-spacing: 0.04em;
    text-align: center;
}
.week-grid-header.first { text-align: left; }
.week-row-prop {
    padding: 12px 10px; font-size: 13px; font-weight: 600;
    border-bottom: 1px solid #f0f0f0; border-right: 1px solid #f0f0f0;
    background: #fafafa;
    display: flex; align-items: center; gap: 6px;
}
.week-row-prop .res-prop-dot { width: 10px; height: 10px; }
.week-cell {
    border-right: 1px solid #f0f0f0; border-bottom: 1px solid #f0f0f0;
    min-height: 50px; padding: 4px; position: relative;
}
.week-cell.is-today { background: #fef9f5; }
.week-bar {
    height: 20px; border-radius: 3px; color: #fff;
    font-size: 11px; padding: 0 6px;
    display: flex; align-items: center;
    cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.week-bar:hover { filter: brightness(0.9); }
.week-bar.is-past     { background: #14554a; }
.week-bar.is-current  { background: #e07856; }
.week-bar.is-upcoming { background: #c5824a; }

/* ─── Vue Agenda 12 mois ────────────────────────────────────────────── */
.agenda-container {
    background: #fff; border: 1px solid #e8e8e8; border-radius: 8px;
    padding: 16px;
}
.agenda-header {
    display: flex; align-items: center; gap: 12px; margin-bottom: 16px;
}
.agenda-title { font-size: 18px; font-weight: 700; color: #1f6f78; flex: 1; }
.agenda-grid {
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px;
}
@media (max-width: 1100px) {
    .agenda-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 800px) {
    .agenda-grid { grid-template-columns: repeat(2, 1fr); }
}
.agenda-month {
    border: 1px solid #e8e8e8; border-radius: 6px;
    background: #fff; padding: 8px;
}
.agenda-month-title {
    font-size: 12px; text-transform: uppercase; font-weight: 700;
    color: #1f6f78; letter-spacing: 0.05em; padding: 4px 4px 8px;
    text-align: center;
}
.agenda-mini-grid {
    display: grid; grid-template-columns: repeat(7, 1fr); gap: 1px;
    font-size: 10px;
}
.agenda-mini-day-header {
    text-align: center; color: #aaa; padding: 2px;
    font-weight: 600;
}
.agenda-mini-cell {
    aspect-ratio: 1; display: flex; align-items: center; justify-content: center;
    border-radius: 3px; cursor: pointer; position: relative;
    background: transparent;
}
.agenda-mini-cell.has-resa { color: #fff; font-weight: 600; }
.agenda-mini-cell.is-past     { background: #d4e3db; color: #2d5e52; }
.agenda-mini-cell.is-current  { background: #e07856; }
.agenda-mini-cell.is-upcoming { background: #14554a; }
.agenda-mini-cell.is-today { box-shadow: 0 0 0 1.5px #e07856 inset; }
.agenda-mini-cell.is-other-month { color: #ddd; }
.agenda-mini-cell:hover:not(.is-other-month) { filter: brightness(0.9); }
.agenda-mini-cell.has-multi { background-image: linear-gradient(135deg, #14554a 50%, #c5824a 50%); }

/* ─── Popover (utilisé sur Agenda + Calendrier + Semaine) ──────────── */
.ycs-popover {
    position: fixed; z-index: 200;
    background: #fff; border: 1px solid #e0e0e0; border-radius: 8px;
    box-shadow: 0 10px 30px -10px rgba(0,0,0,0.25);
    padding: 12px 14px;
    min-width: 240px; max-width: 320px;
    font-size: 13px; color: #333;
    animation: pop-in .15s ease-out;
}
@keyframes pop-in {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}
.ycs-popover-arrow {
    position: absolute; width: 10px; height: 10px;
    background: #fff; border: 1px solid #e0e0e0;
    transform: rotate(45deg);
    border-bottom: none; border-right: none;
}
.ycs-popover-title {
    font-weight: 700; color: #1f6f78; font-size: 14px;
    margin-bottom: 6px; padding-bottom: 6px;
    border-bottom: 1px solid #f0f0f0;
    display: flex; align-items: center; gap: 6px;
}
.ycs-popover-row {
    display: flex; gap: 8px; margin-top: 4px; font-size: 12px;
}
.ycs-popover-row .label {
    color: #777; min-width: 70px;
}
.ycs-popover-row .value { font-weight: 500; color: #333; }
.ycs-popover-actions {
    margin-top: 10px; padding-top: 8px; border-top: 1px solid #f0f0f0;
    display: flex; gap: 6px;
}
.ycs-popover-actions button {
    background: #1f6f78; color: #fff; border: none;
    padding: 4px 10px; border-radius: 4px; font-size: 12px;
    cursor: pointer; font-weight: 600;
}
.ycs-popover-actions button.secondary {
    background: transparent; color: #555; border: 1px solid #ddd;
}

/* ─── Modal d'édition large ────────────────────────────────────────── */
.ycs-modal-backdrop {
    position: fixed; inset: 0; background: rgba(20, 30, 30, 0.45);
    z-index: 1040;
    opacity: 0; visibility: hidden;
    transition: opacity .2s, visibility .2s;
}
.ycs-modal-backdrop.open { opacity: 1; visibility: visible; }
.ycs-modal {
    position: fixed; top: 50%; left: 50%;
    transform: translate(-50%, -50%) scale(.96);
    background: #fff; border-radius: 12px;
    width: 920px; max-width: 95vw;
    max-height: 92vh;
    overflow: hidden;
    z-index: 1060;
    opacity: 0; visibility: hidden;
    transition: all .2s cubic-bezier(.2,.8,.3,1);
    box-shadow: 0 30px 80px -20px rgba(0,0,0,0.5);
    display: flex; flex-direction: column;
}
.ycs-modal.open {
    opacity: 1; visibility: visible;
    transform: translate(-50%, -50%) scale(1);
}
.ycs-modal-header {
    padding: 18px 24px; border-bottom: 1px solid #eee;
    display: flex; align-items: center; gap: 12px;
    background: #fafafa;
}
.ycs-modal-header h2 {
    margin: 0; font-size: 18px; font-weight: 700; color: #222;
    flex: 1;
}
.ycs-modal-close {
    background: transparent; border: 1px solid #ddd; border-radius: 5px;
    width: 32px; height: 32px; cursor: pointer; color: #777;
    display: inline-flex; align-items: center; justify-content: center;
}
.ycs-modal-close:hover { background: #f0f0f0; color: #222; }
.ycs-modal-body {
    flex: 1; overflow-y: auto; padding: 20px 24px;
}
.ycs-modal-footer {
    padding: 14px 24px; border-top: 1px solid #eee;
    display: flex; gap: 10px; align-items: center;
    background: #fafafa;
}
.ycs-modal-footer .spacer { flex: 1; }

.ycs-form-grid {
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px 16px;
}
.ycs-form-grid .field-2 { grid-column: span 2; }
.ycs-form-grid .field-4 { grid-column: span 4; }
.ycs-form-grid label {
    display: block; font-size: 12px; color: #666; font-weight: 600;
    margin-bottom: 4px;
}
.ycs-form-grid input, .ycs-form-grid select, .ycs-form-grid textarea {
    width: 100%; padding: 7px 10px; border: 1px solid #ddd;
    border-radius: 5px; font-size: 13px; box-sizing: border-box;
}
.ycs-form-grid textarea { resize: vertical; min-height: 60px; }
.ycs-form-section {
    margin-bottom: 20px;
}
.ycs-form-section-title {
    font-size: 11px; text-transform: uppercase; color: #1f6f78;
    font-weight: 700; letter-spacing: 0.05em;
    margin-bottom: 10px; padding-bottom: 4px;
    border-bottom: 1px solid #eef4f4;
}

/* ─── Préférences (mini-panel slide-in) ───────────────────────────── */
.prefs-panel {
    position: fixed; top: 0; right: 0; height: 100vh; width: 380px;
    background: #fff; box-shadow: -4px 0 20px -8px rgba(0,0,0,0.2);
    transform: translateX(100%); transition: transform .25s cubic-bezier(.2,.8,.3,1);
    z-index: 1050; display: flex; flex-direction: column;
}
.prefs-panel.open { transform: translateX(0); }
.prefs-panel-header {
    padding: 16px 20px; border-bottom: 1px solid #eee;
    display: flex; align-items: center; gap: 10px;
}
.prefs-panel-header h3 { margin: 0; font-size: 16px; flex: 1; }
.prefs-panel-body { flex: 1; overflow-y: auto; padding: 20px; }
.prefs-section-title {
    font-size: 11px; text-transform: uppercase; color: #1f6f78;
    font-weight: 700; letter-spacing: 0.05em;
    margin: 16px 0 8px; padding-bottom: 4px;
    border-bottom: 1px solid #eef4f4;
}
.prefs-section-title:first-child { margin-top: 0; }
.prefs-col-list {
    display: flex; flex-direction: column; gap: 6px;
}
.prefs-col-item {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 10px; background: #fafafa;
    border: 1px solid #e8e8e8; border-radius: 5px;
    cursor: grab;
}
.prefs-col-item.dragging { opacity: 0.5; }
.prefs-col-item .handle { color: #aaa; cursor: grab; }
.prefs-col-item .name { flex: 1; font-size: 13px; }
.prefs-col-item .toggle { font-size: 12px; }

/* Transitions liste */
#resaList, #resaEmpty { animation: fadeIn .25s ease-out; }
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ═══════════════════════════════════════════════════════════════════════
 * CONSOLIDATION MULTI-BIENS — VUE SEMAINE
 * Layout A (horizontal) : la barre 100% du jour est subdivisée en N
 *                         sous-bandes horizontales (une par bien)
 * Layout B (vertical)   : une barre par bien, empilées verticalement
 * =================================================================== */

/* Layout A — subdivision horizontale */
.week-bar.week-bar-multi-h {
    display: flex;
    gap: 2px;
    height: auto;
}
.week-bar-multi-h .week-bar-prop {
    flex: 1;
    position: relative;
    min-height: 40px;
    background: rgba(0,0,0,0.02);
    border-radius: 4px;
    overflow: hidden;
}
.week-bar-multi-h .week-bar-prop .week-bar-prop-label {
    position: absolute;
    top: 2px;
    left: 6px;
    font-size: 10px;
    color: #666;
    font-weight: 600;
    z-index: 1;
    pointer-events: none;
    text-shadow: 0 0 4px rgba(255,255,255,0.6);
}

/* Layout B — pile verticale */
.week-day.week-day-multi-v .week-bar-stack {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}
.week-day.week-day-multi-v .week-bar-stack .week-bar {
    height: 32px;
    position: relative;
}
.week-day.week-day-multi-v .week-bar-stack .week-bar-prop-label {
    position: absolute;
    left: 8px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 11px;
    color: #666;
    font-weight: 600;
    z-index: 5;
    pointer-events: none;
    text-shadow: 0 0 4px rgba(255,255,255,0.7);
}

/* Garantir que les segments restent cliquables */
.week-bar-segment {
    cursor: pointer;
    transition: filter 0.15s;
}
.week-bar-segment:hover {
    filter: brightness(0.92);
}

/* ─── Agenda 12 mois : cellules cliquables ─────────────────────── */
.mini-month td[data-resa-id],
.mini-month td.arrival,
.mini-month td.departure,
.mini-month td.stay {
    cursor: pointer;
    transition: filter 0.15s;
}
.mini-month td[data-resa-id]:hover,
.mini-month td.arrival:hover,
.mini-month td.departure:hover,
.mini-month td.stay:hover {
    filter: brightness(0.92);
}

/* ─── Masquer le filtre statut sur Semaine, Calendrier, Agenda 12 mois ─── */
/* (filtres "à venir/en cours/passées" non pertinents pour ces vues
 *  qui montrent une période fixe par leur navigation propre)             */
body.resa-page-week .resa-status-tab,
body.resa-page-calendar .resa-status-tab,
body.resa-page-agenda .resa-status-tab {
    display: none !important;
}
/* Cacher aussi le wrapper des onglets pour éviter le vide à gauche */
body.resa-page-week #resaFilters > div > div:first-child,
body.resa-page-calendar #resaFilters > div > div:first-child,
body.resa-page-agenda #resaFilters > div > div:first-child {
    display: none !important;
}

/* ============================================================================
 * P47 — staysy réservation : modal détail puis édition
 * ============================================================================ */
.ycs-modal {
    background:
        radial-gradient(760px 260px at 16% -8%, rgba(232,112,74,.14), transparent 62%),
        radial-gradient(640px 280px at 108% 8%, rgba(30,78,69,.12), transparent 58%),
        var(--surface, #fff);
    border: 1px solid rgba(227,214,196,.9);
    border-radius: 28px;
    width: min(1040px, 96vw);
    box-shadow: var(--shadow-modal, 0 28px 72px -24px rgba(42,37,33,.42));
}
.ycs-modal.is-detail { width: min(1080px, 96vw); }
.ycs-modal-backdrop {
    background:
        radial-gradient(900px 560px at 50% 0%, rgba(232,112,74,.16), transparent 60%),
        rgba(42,37,33,.46);
    backdrop-filter: blur(5px);
}
.ycs-modal-header {
    padding: 22px 28px 18px;
    background: linear-gradient(135deg, rgba(251,246,238,.96), rgba(243,234,221,.92));
    border-bottom: 1px solid var(--line-soft, #EEE3D4);
}
.ycs-modal-header h2 {
    font-family: var(--font-display, 'Fraunces'), Georgia, serif;
    font-size: clamp(23px, 2.4vw, 32px);
    line-height: 1.05;
    letter-spacing: -.02em;
    color: var(--ink, #2A2521);
    font-weight: 600;
}
.ycs-modal-close {
    width: 40px;
    height: 40px;
    border-radius: 14px;
    border-color: var(--line, #E3D6C4);
    background: rgba(255,255,255,.74);
    color: var(--ink-soft, #6E655B);
    box-shadow: var(--shadow-sm, 0 1px 2px rgba(42,37,33,.06));
}
.ycs-modal-close:hover {
    background: var(--coral-soft, #F8DED4);
    color: var(--coral-deep, #C9552F);
}
.ycs-modal-body {
    padding: 24px 28px 26px;
    background: linear-gradient(180deg, rgba(251,246,238,.35), rgba(255,255,255,.84));
}
.ycs-modal-footer {
    padding: 18px 28px 22px;
    background: rgba(251,246,238,.92);
    border-top: 1px solid var(--line-soft, #EEE3D4);
}
.ycs-modal-footer .btn {
    border-radius: 999px;
    padding-left: 18px;
    padding-right: 18px;
}

.resa-detail-modal { display: grid; gap: 20px; }
.resa-detail-hero {
    position: relative;
    overflow: hidden;
    border-radius: 24px;
    padding: clamp(22px, 3vw, 34px);
    color: #fff;
    background:
        linear-gradient(135deg, rgba(30,78,69,.94), rgba(22,50,44,.96)),
        var(--resa-property-color, var(--coral, #E8704A));
    box-shadow: 0 22px 44px -26px rgba(30,78,69,.78);
}
.resa-detail-hero::before,
.resa-detail-hero::after {
    content: "";
    position: absolute;
    border-radius: 999px;
    pointer-events: none;
}
.resa-detail-hero::before {
    width: 320px;
    height: 320px;
    right: -110px;
    top: -130px;
    background: radial-gradient(circle, rgba(232,112,74,.46), transparent 66%);
}
.resa-detail-hero::after {
    width: 180px;
    height: 180px;
    left: -52px;
    bottom: -88px;
    background: radial-gradient(circle, rgba(242,181,68,.34), transparent 68%);
}
.resa-detail-hero > * { position: relative; z-index: 1; }
.resa-detail-hero-top {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 18px;
}
.resa-detail-status {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    border-radius: 999px;
    padding: 7px 12px;
    background: rgba(255,255,255,.16);
    border: 1px solid rgba(255,255,255,.22);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .04em;
    text-transform: uppercase;
    backdrop-filter: blur(6px);
}
.resa-detail-status.is-upcoming { background: rgba(232,112,74,.28); }
.resa-detail-status.is-current { background: rgba(242,181,68,.26); }
.resa-detail-status.is-past,
.resa-detail-status.is-archived,
.resa-detail-status.is-locked { background: rgba(255,255,255,.14); color: rgba(255,255,255,.86); }
.resa-detail-kicker {
    color: rgba(255,255,255,.72);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .16em;
    text-transform: uppercase;
    margin-bottom: 8px;
}
.resa-detail-hero h3 {
    margin: 0;
    font-family: var(--font-display, 'Fraunces'), Georgia, serif;
    font-size: clamp(30px, 4.8vw, 54px);
    line-height: 1.03;
    letter-spacing: -.025em;
    font-weight: 600;
    color: #fff;
    max-width: 780px;
}
.resa-detail-hero-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 18px;
    margin-top: 18px;
    color: rgba(255,255,255,.88);
    font-weight: 700;
}
.resa-detail-hero-meta span {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.resa-detail-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 18px;
}
.resa-detail-badges span {
    border-radius: 999px;
    padding: 6px 11px;
    background: rgba(255,255,255,.12);
    border: 1px solid rgba(255,255,255,.18);
    color: rgba(255,255,255,.88);
    font-size: 12px;
    font-weight: 800;
}
.resa-detail-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}
.resa-detail-card {
    background: rgba(255,255,255,.82);
    border: 1px solid var(--line, #E3D6C4);
    border-radius: 22px;
    padding: 18px;
    box-shadow: 0 12px 28px -22px rgba(42,37,33,.32);
}
.resa-detail-card h4,
.resa-detail-notes h4 {
    margin: 0 0 14px;
    color: var(--teal, #1E4E45);
    font-size: 12px;
    font-weight: 900;
    letter-spacing: .12em;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 8px;
}
.resa-detail-row {
    display: grid;
    grid-template-columns: minmax(110px, .9fr) minmax(0, 1.1fr);
    gap: 12px;
    align-items: start;
    padding: 10px 0;
    border-top: 1px solid var(--line-soft, #EEE3D4);
}
.resa-detail-row:first-of-type { border-top: 0; padding-top: 0; }
.resa-detail-row-label {
    color: var(--ink-mute, #8F8276);
    font-size: 12px;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    gap: 7px;
}
.resa-detail-row strong {
    color: var(--ink, #2A2521);
    font-weight: 800;
    text-align: right;
    overflow-wrap: anywhere;
}
.resa-composition-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}
.resa-composition-grid div {
    border-radius: 18px;
    padding: 14px 10px;
    background: linear-gradient(180deg, var(--bg, #FBF6EE), var(--surface-2, #F3EADD));
    border: 1px solid var(--line-soft, #EEE3D4);
    text-align: center;
}
.resa-composition-grid strong {
    display: block;
    font-family: var(--font-display, 'Fraunces'), Georgia, serif;
    font-size: 32px;
    line-height: 1;
    color: var(--coral, #E8704A);
}
.resa-composition-grid span {
    display: block;
    margin-top: 6px;
    color: var(--ink-soft, #6E655B);
    font-size: 11px;
    font-weight: 900;
    letter-spacing: .06em;
    text-transform: uppercase;
}
.resa-detail-mini-note {
    margin-top: 12px;
    color: var(--ink-soft, #6E655B);
    font-size: 13px;
    font-weight: 700;
}
.resa-options-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
}
.resa-options-list span {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    border-radius: 999px;
    padding: 7px 11px;
    background: var(--surface-2, #F3EADD);
    color: var(--ink-mute, #8F8276);
    font-size: 12px;
    font-weight: 800;
}
.resa-options-list span.is-on {
    background: var(--coral-soft, #F8DED4);
    color: var(--coral-deep, #C9552F);
}
.resa-detail-notes {
    display: grid;
    gap: 12px;
}
.resa-detail-notes article {
    border-radius: 20px;
    padding: 18px;
    background: rgba(243,234,221,.72);
    border: 1px solid var(--line, #E3D6C4);
}
.resa-detail-notes p {
    margin: 0;
    color: var(--ink-soft, #6E655B);
    line-height: 1.65;
    white-space: pre-wrap;
}
.resa-lock-alert {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    background: var(--coral-soft, #F8DED4);
    color: var(--coral-deep, #C9552F);
    border: 1px solid rgba(232,112,74,.24);
    border-radius: 18px;
    padding: 13px 15px;
    margin-bottom: 18px;
    font-size: 13px;
    font-weight: 700;
}

@media (max-width: 820px) {
    .ycs-modal { width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; border-radius: 0; }
    .ycs-modal-body { padding: 18px; }
    .ycs-modal-header, .ycs-modal-footer { padding-left: 18px; padding-right: 18px; }
    .resa-detail-grid { grid-template-columns: 1fr; }
    .resa-detail-row { grid-template-columns: 1fr; gap: 4px; }
    .resa-detail-row strong { text-align: left; }
    .resa-composition-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .ycs-form-grid { grid-template-columns: 1fr; }
    .ycs-form-grid .field-2,
    .ycs-form-grid .field-4 { grid-column: span 1; }
    .ycs-modal-footer { flex-wrap: wrap; }
    .ycs-modal-footer .spacer { display: none; }
    .ycs-modal-footer .btn { flex: 1; justify-content: center; }
}
