/* ─────────────────────────────────────────────────────────────────────
   Rooms — modern look (2026-10-05). Plan: docs/ROOMS_MODERNISE_PLAN.md
   Same palette as the reservations page (reservations-modern.css):
   slate neutrals, indigo for actions, colour only for status.
   ───────────────────────────────────────────────────────────────────── */

.rmx-page {
    --rmx-ink: #0f172a;
    --rmx-text: #333333;
    --rmx-muted: #5f5f5f;
    --rmx-faint: #8a8a8a;
    --rmx-line: #e2e8f0;
    --rmx-line-soft: #f1f5f9;
    --rmx-surface: #ffffff;
    --rmx-subtle: #f8fafc;
    --rmx-accent: var(--color-indigo-600, var(--brand, #4f46e5));
    color: var(--rmx-text);
}

/* ── Header ─────────────────────────────────────────────────────────── */
.rmx-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
}
.rmx-head h2 {
    margin: 0;
    color: var(--rmx-ink);
    font-size: 26px;
    font-weight: 700;
    letter-spacing: -0.01em;
}
.rmx-head__sub {
    margin: 4px 0 0;
    font-size: 14px;
    color: var(--rmx-muted);
}
.rmx-head__actions { display: flex; gap: 8px; flex-shrink: 0; }

/* ── Buttons ────────────────────────────────────────────────────────── */
.rmx-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 40px;
    padding: 0 16px;
    border: 1px solid var(--rmx-line);
    border-radius: 10px;
    background: var(--rmx-surface);
    color: var(--rmx-ink);
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}
.rmx-btn:hover { background: var(--rmx-subtle); text-decoration: none; }
.rmx-btn:focus-visible { outline: 2px solid var(--rmx-accent); outline-offset: 2px; }
.rmx-btn--primary { background: var(--rmx-accent); border-color: var(--rmx-accent); color: #fff; }
.rmx-btn--primary:hover { background: var(--brand-ink, #4338ca); color: #fff; }
.rmx-btn--danger { background: #e11d48; border-color: #e11d48; color: #fff; }
.rmx-btn--danger:hover { background: #be123c; }
.rmx-btn--unlock { background: #ecfdf5; border-color: #a7f3d0; color: #047857; }
.rmx-btn--unlock:hover { background: #d1fae5; }
.rmx-btn--sm { min-height: 32px; padding: 0 12px; font-size: 13px; border-radius: 8px; }
.rmx-btn:disabled { opacity: 0.6; cursor: not-allowed; }

/* ── Front door strip ───────────────────────────────────────────────── */
.rmx-frontdoor {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    margin-bottom: 16px;
    background: var(--rmx-surface);
    border: 1px solid var(--rmx-line);
    border-radius: 12px;
}
.rmx-frontdoor__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: var(--brand-soft, #eef2ff);
    color: var(--rmx-accent);
    flex-shrink: 0;
}
.rmx-frontdoor__text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.rmx-frontdoor__text strong { color: var(--rmx-ink); font-size: 14px; }
.rmx-frontdoor__text span { color: var(--rmx-muted); font-size: 12.5px; }

/* ── Toolbar: Active / Archived + search ────────────────────────────── */
.rmx-toolbar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 16px;
}
.rmx-seg {
    display: inline-flex;
    padding: 3px;
    background: var(--rmx-line-soft);
    border-radius: 10px;
}
.rmx-seg__opt {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 34px;
    padding: 0 14px;
    border-radius: 8px;
    color: var(--rmx-muted);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
}
.rmx-seg__opt span { font-weight: 500; color: var(--rmx-faint); }
.rmx-seg__opt:hover { color: var(--rmx-ink); text-decoration: none; }
.rmx-seg__opt.is-on { background: var(--rmx-surface); color: var(--rmx-ink); box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08); }
.rmx-search {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 200px;
    max-width: 360px;
    margin-left: auto;
    padding: 0 12px;
    min-height: 40px;
    background: var(--rmx-surface);
    border: 1px solid var(--rmx-line);
    border-radius: 10px;
    color: var(--rmx-faint);
}
.rmx-search:focus-within { border-color: var(--rmx-accent); box-shadow: 0 0 0 3px rgba(var(--brand-rgb, 79, 70, 229), 0.12); }
.rmx-search input {
    flex: 1;
    min-width: 0;
    border: 0;
    outline: 0;
    background: transparent;
    font: inherit;
    font-size: 14px;
    color: var(--rmx-ink);
}

/* ── Card grid ──────────────────────────────────────────────────────── */
.rmx-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}
.rmx-card {
    display: flex;
    flex-direction: column;
    background: var(--rmx-surface);
    border: 1px solid var(--rmx-line);
    border-radius: 14px;
    overflow: hidden;
    transition: box-shadow 0.15s, border-color 0.15s;
}
.rmx-card:hover { border-color: #cbd5e1; box-shadow: 0 4px 14px rgba(15, 23, 42, 0.06); }
.rmx-card[hidden] { display: none; }
.rmx-card__media {
    display: block;
    aspect-ratio: 16 / 9;
    background: linear-gradient(135deg, var(--brand-soft, #eef2ff), #f8fafc);
}
.rmx-card__media--empty { aspect-ratio: 16 / 6; }
.rmx-nowrap { white-space: nowrap; }
/* The photo sits out of the flow so a tall (portrait) upload can't stretch
   the box: aspect-ratio only sets a minimum height when content is taller. */
.rmx-card__media { position: relative; overflow: hidden; }
.rmx-card__media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.rmx-card__ph {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    color: var(--brand-300, #a5b4fc);
}
.rmx-card--archived .rmx-card__media { filter: grayscale(1); opacity: 0.7; }
.rmx-card__body { display: flex; flex-direction: column; gap: 10px; padding: 14px 16px 16px; flex: 1; }
.rmx-card__top { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.rmx-card__title { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 8px; min-width: 0; }
.rmx-card__name {
    color: var(--rmx-ink);
    font-size: 16px;
    font-weight: 700;
    text-decoration: none;
    overflow-wrap: anywhere;
}
.rmx-card__name:hover { color: var(--rmx-accent); text-decoration: none; }
.rmx-card__door {
    padding: 2px 8px;
    border-radius: 999px;
    background: var(--rmx-line-soft);
    color: var(--rmx-muted);
    font-size: 12px;
    font-weight: 600;
}
.rmx-card__meta { margin: -4px 0 0; color: var(--rmx-muted); font-size: 13.5px; line-height: 1.45; }

/* Today's state */
.rmx-status {
    --st: #22c55e;
    --st-bg: #f0fdf4;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 10px;
    background: var(--st-bg);
}
.rmx-status__dot {
    width: 9px;
    height: 9px;
    margin-top: 5px;
    border-radius: 50%;
    background: var(--st);
    flex-shrink: 0;
}
.rmx-status__text { display: flex; flex-direction: column; min-width: 0; }
.rmx-status__text strong { color: var(--rmx-ink); font-size: 14px; font-weight: 600; overflow-wrap: anywhere; }
.rmx-status__text span { color: var(--rmx-muted); font-size: 12.5px; overflow-wrap: anywhere; }
.rmx-status[data-state="occupied"] { --st: #059669; --st-bg: #ecfdf5; }
.rmx-status[data-state="arriving"] { --st: #3b82f6; --st-bg: #eff6ff; }
.rmx-status[data-state="departing"] { --st: #f43f5e; --st-bg: #fff1f2; }
.rmx-status[data-state="departed"] { --st: #be123c; --st-bg: #ffe4e6; }
.rmx-status[data-state="turnover"] { --st: #f59e0b; --st-bg: #fff8eb; }
.rmx-status[data-state="blocked"],
.rmx-status[data-state="archived"] { --st: #94a3b8; --st-bg: var(--rmx-subtle); }

.rmx-card__foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: auto;
}
.rmx-access {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--rmx-muted);
    font-size: 13px;
}

/* ── ⋮ menu ─────────────────────────────────────────────────────────── */
.rmx-menu { position: relative; flex-shrink: 0; }
.rmx-menu__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    margin: -6px -8px 0 0;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--rmx-muted);
    cursor: pointer;
}
.rmx-menu__btn:hover,
.rmx-menu__btn[aria-expanded="true"] { background: var(--rmx-line-soft); color: var(--rmx-ink); }
.rmx-menu__list {
    position: fixed;
    z-index: 1200;
    min-width: 190px;
    padding: 6px;
    background: var(--rmx-surface);
    border: 1px solid var(--rmx-line);
    border-radius: 12px;
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.14);
}
.rmx-menu__list[hidden] { display: none; }
.rmx-menu__list form { margin: 0; }
.rmx-menu__list a,
.rmx-menu__list button {
    display: block;
    width: 100%;
    padding: 9px 12px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--rmx-ink);
    font: inherit;
    font-size: 14px;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
}
.rmx-menu__list a:hover,
.rmx-menu__list button:hover,
.rmx-menu__list a:focus-visible,
.rmx-menu__list button:focus-visible { background: var(--rmx-line-soft); outline: none; text-decoration: none; }
.rmx-menu__list .is-danger { color: #be123c; }

/* ── Empty / no match ──────────────────────────────────────────────── */
.rmx-empty {
    max-width: 440px;
    margin: 32px auto;
    padding: 28px 20px;
    text-align: center;
}
.rmx-empty__art { margin-bottom: 12px; }
.rmx-empty h3 { margin: 0 0 6px; color: var(--rmx-ink); font-size: 19px; }
.rmx-empty p { margin: 0 0 18px; color: var(--rmx-muted); font-size: 14.5px; }
.rmx-nomatch { margin: 24px 0; text-align: center; color: var(--rmx-muted); }

/* ── Dialog ─────────────────────────────────────────────────────────── */
.rmx-dialog {
    position: fixed;
    inset: 0;
    z-index: 1300;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(15, 23, 42, 0.45);
}
.rmx-dialog[hidden] { display: none; }
.rmx-dialog__panel {
    position: relative;
    width: 100%;
    max-width: 440px;
    padding: 22px 22px 18px;
    background: var(--rmx-surface);
    border-radius: 16px;
    box-shadow: 0 20px 48px rgba(15, 23, 42, 0.2);
}
.rmx-dialog__panel h3 { margin: 0 36px 10px 0; color: var(--rmx-ink); font-size: 18px; overflow-wrap: anywhere; }
.rmx-dialog__panel p { margin: 0 0 12px; color: var(--rmx-muted); font-size: 14px; line-height: 1.5; }
.rmx-dialog__warn { padding: 10px 12px; border-radius: 10px; background: #fff8eb; color: #92400e !important; }
.rmx-dialog__close {
    position: absolute;
    top: 14px;
    right: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 50%;
    background: var(--rmx-line-soft);
    color: var(--rmx-muted);
    cursor: pointer;
}
.rmx-dialog__close:hover { color: var(--rmx-ink); }
.rmx-dialog__actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 6px; }

/* ═════════════════════════════════════════════════════════════════════
   Room page (step 2) — .rmd
   ═════════════════════════════════════════════════════════════════════ */
.rmd-back {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 10px;
    color: var(--rmx-muted);
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
}
.rmd-back:hover { color: var(--rmx-ink); text-decoration: none; }
.rmd-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}
.rmd-head__main { min-width: 0; }
.rmd-head__title { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 10px; }
.rmd-head__title h2 {
    margin: 0;
    color: var(--rmx-ink);
    font-size: 26px;
    font-weight: 700;
    letter-spacing: -0.01em;
    overflow-wrap: anywhere;
}
.rmd-head__sub { margin: 6px 0 0; color: var(--rmx-muted); font-size: 14px; }
.rmd-head__actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.rmd-more {
    width: 40px;
    height: 40px;
    margin: 0;
    border: 1px solid var(--rmx-line);
    border-radius: 10px;
    background: var(--rmx-surface);
}
.rmd-pill {
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
}
.rmd-pill--archived { background: var(--rmx-line-soft); color: var(--rmx-muted); }

.rmd-archived {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px 16px;
    padding: 14px 16px;
    margin-bottom: 18px;
    background: #fff8eb;
    border: 1px solid #fde68a;
    border-radius: 12px;
}
.rmd-archived > div:first-child { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1 1 280px; }
.rmd-archived strong { color: #78350f; font-size: 14.5px; }
.rmd-archived span { color: #92400e; font-size: 13.5px; }
.rmd-archived__note { margin-top: 4px; }
.rmd-archived__actions { display: flex; gap: 8px; flex-wrap: wrap; }
.rmd-archived__actions form { margin: 0; }

/* Photos */
.rmd-photos {
    display: grid;
    gap: 8px;
    margin-bottom: 20px;
    border-radius: 14px;
    overflow: hidden;
}
.rmd-photos--one { grid-template-columns: 1fr; }
.rmd-photos--one .rmd-photo { aspect-ratio: 21 / 8; }
.rmd-photos--two { grid-template-columns: 1fr 1fr; }
.rmd-photos--two .rmd-photo { aspect-ratio: 4 / 3; max-height: 340px; }
.rmd-photos--many {
    grid-template-columns: 2fr 1fr 1fr;
    grid-template-rows: repeat(2, 160px);
}
.rmd-photos--many .rmd-photo--main { grid-row: span 2; }
/* 3 photos: main + two stacked; 4 photos: the last one spans the bottom. */
.rmd-photos--three { grid-template-columns: 2fr 1fr; }
.rmd-photos--four .rmd-photo:nth-child(4) { grid-column: span 2; }
.rmd-photo {
    position: relative;
    display: block;
    padding: 0;
    border: 0;
    background: var(--rmx-line-soft);
    cursor: zoom-in;
    overflow: hidden;
    min-height: 0;
}
.rmd-photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.2s; }
.rmd-photo:hover img { transform: scale(1.02); }
.rmd-photo:focus-visible { outline: 3px solid var(--rmx-accent); outline-offset: -3px; }
.rmd-photo__more {
    position: absolute;
    right: 10px;
    bottom: 10px;
    padding: 6px 10px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.94);
    color: var(--rmx-ink);
    font-size: 13px;
    font-weight: 600;
}
.rmd-photo__count { display: none; }
.rmd-nophotos {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 18px;
    margin-bottom: 20px;
    border: 1px dashed var(--brand-line, #c7d2fe);
    border-radius: 14px;
    background: #f8faff;
    color: var(--rmx-accent);
    text-decoration: none;
}
.rmd-nophotos:hover { background: var(--brand-soft, #eef2ff); text-decoration: none; }
.rmd-nophotos span { display: flex; flex-direction: column; color: var(--rmx-muted); font-size: 13.5px; }
.rmd-nophotos strong { color: var(--rmx-ink); font-size: 14.5px; }

/* Two columns of cards */
.rmd-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
    gap: 16px;
    align-items: start;
}
.rmd-col { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.rmd-card {
    padding: 18px 18px 16px;
    background: var(--rmx-surface);
    border: 1px solid var(--rmx-line);
    border-radius: 14px;
}
.rmd-card h3 { margin: 0 0 12px; color: var(--rmx-ink); font-size: 16px; font-weight: 700; }
.rmd-card__head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.rmd-card__head h3 { margin: 0; }
.rmd-link { color: var(--rmx-accent); font-size: 13.5px; font-weight: 600; text-decoration: none; }
.rmd-link:hover { text-decoration: underline; }
.rmd-muted { margin: 0; color: var(--rmx-muted); font-size: 13.5px; }
.rmd-hint { margin: 10px 0 0; color: var(--rmx-muted); font-size: 13px; }
.rmd-hint a { color: var(--rmx-accent); font-weight: 600; }
.rmd-lead { margin: 14px 0 0; color: var(--rmx-ink); font-size: 14.5px; font-weight: 500; }
.rmd-text { margin: 8px 0 0; color: var(--rmx-text); font-size: 14px; line-height: 1.6; overflow-wrap: anywhere; }
.rmd-mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: 0.04em; }

/* Right now */
.rmd-now { border-color: var(--brand-line, #c7d2fe); box-shadow: 0 1px 0 rgba(var(--brand-rgb, 79, 70, 229), 0.04); }
.rmd-stays { list-style: none; margin: 12px 0 0; padding: 0; }
.rmd-stays li {
    display: grid;
    grid-template-columns: 112px minmax(0, 1fr) auto;
    align-items: baseline;
    gap: 10px;
    padding: 9px 0;
    border-top: 1px solid var(--rmx-line-soft);
    font-size: 14px;
}
.rmd-stays li:first-child { border-top: 0; }
.rmd-stays__role { color: var(--rmx-muted); font-size: 13px; }
.rmd-stays__name { color: var(--rmx-ink); font-weight: 600; text-decoration: none; overflow-wrap: anywhere; }
.rmd-stays__name:hover { color: var(--rmx-accent); text-decoration: underline; }
.rmd-stays__dates { color: var(--rmx-muted); font-size: 13px; white-space: nowrap; }
.rmd-cleaning {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
    padding: 9px 12px;
    border-radius: 10px;
    background: var(--rmx-subtle);
    color: var(--rmx-text);
    font-size: 13.5px;
    text-decoration: none;
}
.rmd-cleaning:hover { background: var(--rmx-line-soft); text-decoration: none; }
.rmd-cleaning__label { color: var(--rmx-muted); }
.rmd-cleaning__state { font-weight: 600; color: var(--rmx-ink); }
.rmd-cleaning__state--completed { color: #047857; }
.rmd-cleaning__state--in_progress { color: #b45309; }
.rmd-unlock {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--rmx-line-soft);
}
.rmd-unlock__btns { display: flex; flex-wrap: wrap; gap: 8px; }

/* Facts */
.rmd-facts {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px 16px;
    margin: 0;
}
.rmd-facts > div { min-width: 0; }
.rmd-facts dt { color: var(--rmx-muted); font-size: 12.5px; margin-bottom: 2px; }
.rmd-facts dd { margin: 0; color: var(--rmx-ink); font-size: 14px; font-weight: 500; overflow-wrap: anywhere; }
.rmd-facts dd a { color: var(--rmx-accent); }
.rmd-facts--stack { grid-template-columns: minmax(0, 1fr); margin-top: 12px; }
.rmd-facts--stack:empty { display: none; }
.rmd-access { display: flex; align-items: center; gap: 10px; margin: 0; }
.rmd-access__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: var(--brand-soft, #eef2ff);
    color: var(--rmx-accent);
}
.rmd-access strong { color: var(--rmx-ink); font-size: 15px; }

/* Lists: feeds, blocks, maintenance */
.rmd-feeds, .rmd-blocks, .rmd-list { list-style: none; margin: 0 0 12px; padding: 0; }
.rmd-feeds li {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    border-top: 1px solid var(--rmx-line-soft);
    font-size: 14px;
}
.rmd-feeds li:first-child { border-top: 0; }
.rmd-feeds__dot { width: 8px; height: 8px; border-radius: 50%; background: #22c55e; flex-shrink: 0; }
.rmd-feeds__dot.is-paused { background: #f59e0b; }
.rmd-feeds__name { flex: 1; min-width: 0; color: var(--rmx-ink); font-weight: 500; overflow-wrap: anywhere; }
.rmd-feeds__name em { color: var(--rmx-muted); font-weight: 400; }
.rmd-feeds__meta { color: var(--rmx-muted); font-size: 12.5px; white-space: nowrap; }
.rmd-blocks li {
    display: flex;
    flex-direction: column;
    padding: 9px 0;
    border-top: 1px solid var(--rmx-line-soft);
}
.rmd-blocks li:first-child { border-top: 0; }
.rmd-blocks li.is-past { opacity: 0.6; }
.rmd-blocks__dates { color: var(--rmx-ink); font-size: 14px; font-weight: 600; }
.rmd-blocks__meta, .rmd-blocks__notes { color: var(--rmx-muted); font-size: 13px; }
.rmd-list li { padding: 7px 0; font-size: 14px; border-top: 1px solid var(--rmx-line-soft); }
.rmd-list li:first-child { border-top: 0; }
.rmd-list a { color: var(--rmx-ink); font-weight: 500; }
.rmd-prio { margin-left: 6px; padding: 2px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 600; background: var(--rmx-line-soft); color: var(--rmx-muted); }
.rmd-prio--urgent { background: #ffe4e6; color: #be123c; }

.rmd-foot { margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--rmx-line); }
.rmd-foot__archive {
    padding: 8px 0;
    border: 0;
    background: none;
    color: #be123c;
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}
.rmd-foot__archive:hover { text-decoration: underline; }

/* Photo viewer */
.rmx-viewer {
    position: fixed;
    inset: 0;
    z-index: 1400;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 56px 64px;
    background: rgba(2, 6, 23, 0.92);
}
.rmx-viewer[hidden] { display: none; }
.rmx-viewer__fig { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 12px; max-width: 100%; max-height: 100%; }
.rmx-viewer__fig img { max-width: 100%; max-height: calc(100vh - 150px); object-fit: contain; border-radius: 10px; }
.rmx-viewer__fig figcaption { color: #e2e8f0; font-size: 14px; text-align: center; }
.rmx-viewer__close, .rmx-viewer__nav {
    position: absolute;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
    cursor: pointer;
}
.rmx-viewer__close:hover, .rmx-viewer__nav:hover { background: rgba(255, 255, 255, 0.24); }
.rmx-viewer__close { top: 14px; right: 14px; }
.rmx-viewer__nav--prev { left: 14px; top: 50%; transform: translateY(-50%); }
.rmx-viewer__nav--next { right: 14px; top: 50%; transform: translateY(-50%); }

@media (max-width: 900px) {
    .rmd-grid { grid-template-columns: minmax(0, 1fr); }
}

/* ═════════════════════════════════════════════════════════════════════
   Add / Edit room (step 3) — .rmf
   ═════════════════════════════════════════════════════════════════════ */
/* The dashboard shell sets overflow-x: hidden, which makes it a scroll
   container and stops position: sticky (side menu, Save bar). clip keeps
   the same clipping without that side effect. */
.dashboard:has(.rmf),
.page-content:has(.rmf) { overflow-x: clip; }
.rmf-layout {
    display: grid;
    grid-template-columns: 180px minmax(0, 1fr);
    gap: 24px;
    align-items: start;
}
.rmf-nav {
    position: sticky;
    top: 84px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.rmf-nav a {
    position: relative;
    padding: 8px 12px;
    border-radius: 8px;
    color: var(--rmx-muted);
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
}
.rmf-nav a:hover { background: var(--rmx-line-soft); color: var(--rmx-ink); text-decoration: none; }
.rmf-nav a.is-on { background: var(--brand-soft, #eef2ff); color: var(--rmx-accent); font-weight: 600; }
.rmf-nav a.has-error::after {
    content: "";
    position: absolute;
    top: 50%;
    right: 10px;
    width: 7px;
    height: 7px;
    margin-top: -3.5px;
    border-radius: 50%;
    background: #e11d48;
}
.has-property-bar .rmf-nav { top: 136px; }
.has-property-bar .rmf-section { scroll-margin-top: 136px; }
/* From 1200px the property picker sits inside the top bar (2026-10-08). */
@media (min-width: 1200px) {
    .has-property-bar .rmf-nav { top: 84px; }
    .has-property-bar .rmf-section { scroll-margin-top: 84px; }
}
.rmf-main { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.rmf-section { scroll-margin-top: 84px; }
.rmf-section h3 { margin-bottom: 16px; }
.rmf-errors {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 12px 14px;
    border-radius: 12px;
    background: #fff1f2;
    border: 1px solid #fecdd3;
    color: #9f1239;
    font-size: 14px;
}
.rmf-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 16px;
}
.rmf-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.rmf-grid .form-group { min-width: 0; }
.rmf-span-2 { grid-column: 1 / -1; }
.rmf .form-group { margin-bottom: 16px; }
.rmf .form-group label { color: var(--rmx-ink); font-size: 14px; font-weight: 600; }
.rmf .form-hint { display: block; margin-top: 5px; color: var(--rmx-muted); font-size: 12.5px; line-height: 1.45; }
.rmf .form-control { border-radius: 10px; border-color: #d7dee8; }
.rmf .form-control:focus { border-color: var(--rmx-accent); box-shadow: 0 0 0 3px rgba(var(--brand-rgb, 79, 70, 229), 0.12); }
.rmf .has-error .form-control { border-color: #e11d48; }
.rmf-req { color: #e11d48; }
.rmf-sub { margin-top: 10px; }
.rmf-sub label { font-size: 13px !important; font-weight: 500 !important; }
.rmf-note {
    margin: 0 0 16px;
    padding: 10px 12px;
    border-radius: 10px;
    background: var(--brand-soft, #eef2ff);
    color: var(--brand-ink-2, #3730a3);
    font-size: 13.5px;
    line-height: 1.5;
}
.rmf-note a { color: var(--rmx-accent); font-weight: 600; }
.rmf-method { max-width: 360px; }
.rmf-access-hint { margin: 0 !important; }
.rm-access-fields[hidden] { display: none; }
.rmf-more { margin-top: 4px; border-top: 1px solid var(--rmx-line-soft); padding-top: 12px; }
.rmf-more > summary {
    cursor: pointer;
    color: var(--rmx-ink);
    font-size: 14px;
    font-weight: 600;
    list-style: none;
    padding: 4px 0 8px;
}
.rmf-more > summary::-webkit-details-marker { display: none; }
.rmf-more > summary::before { content: "›"; display: inline-block; width: 16px; transition: transform 0.15s; color: var(--rmx-muted); }
.rmf-more[open] > summary::before { transform: rotate(90deg); }
.rmf-more > summary span { color: var(--rmx-muted); font-weight: 400; }
.rmf-more > .form-hint { margin: 0 0 12px; }

/* Visibility switch */
.rmf-switch {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 8px;
    cursor: pointer;
}
.rmf-switch > span { display: flex; flex-direction: column; }
.rmf-switch strong { color: var(--rmx-ink); font-size: 14.5px; }
.rmf-switch input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    position: relative;
    flex-shrink: 0;
    width: 44px;
    height: 26px;
    margin: 0;
    border-radius: 999px;
    background: #cbd5e1;
    cursor: pointer;
    transition: background 0.15s;
}
.rmf-switch input[type="checkbox"]::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.2);
    transition: transform 0.15s;
}
.rmf-switch input[type="checkbox"]:checked { background: #16a34a; }
.rmf-switch input[type="checkbox"]:checked::after { transform: translateX(18px); }
.rmf-switch input[type="checkbox"]:focus-visible { outline: 2px solid var(--rmx-accent); outline-offset: 2px; }

/* Photos */
.rmf-photos { display: grid; grid-template-columns: minmax(0, 300px) minmax(0, 1fr); gap: 20px; }
.rmf-main-photo { margin: 0 !important; padding: 0 !important; border: 0 !important; }
.rmf-main-photo > label, .rmf-gallery__head label { display: block; margin-bottom: 8px; color: var(--rmx-ink); font-size: 14px; font-weight: 600; }
.rmf-main-photo .prop-img-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.rmf-gallery__head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.rmf-gallery__count { color: var(--rmx-muted); font-size: 13px; }
.rmf-gallery__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 10px;
    margin-bottom: 10px;
}
.rmf-gallery__grid:empty { display: none; }
.rmf-gallery__item {
    position: relative;
    border: 1px solid var(--rmx-line);
    border-radius: 10px;
    overflow: hidden;
    background: var(--rmx-surface);
}
.rmf-gallery__item[draggable="true"] { cursor: grab; }
.rmf-gallery__item.is-dragging { opacity: 0.5; box-shadow: 0 6px 16px rgba(15, 23, 42, 0.18); }
.rmf-gallery__item img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; }
.rmf-gallery__caption {
    width: 100%;
    padding: 7px 9px;
    border: 0;
    border-top: 1px solid var(--rmx-line);
    font: inherit;
    font-size: 12.5px;
    outline: none;
}
.rmf-gallery__caption:focus { background: var(--rmx-subtle); }
.rmf-gallery__actions { position: absolute; top: 6px; right: 6px; display: flex; gap: 4px; }
.rmf-gallery__drag, .rmf-gallery__delete {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border: 0;
    border-radius: 7px;
    background: rgba(15, 23, 42, 0.55);
    color: #fff;
    font-size: 16px;
    line-height: 1;
}
.rmf-gallery__delete { cursor: pointer; }
.rmf-gallery__delete:hover { background: #e11d48; }
.rmf-gallery__loading {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 96px;
    border: 1px dashed var(--brand-line, #c7d2fe);
    border-radius: 10px;
    background: #f8faff;
    color: var(--rmx-muted);
    font-size: 13px;
}
.rmf-gallery__add { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.rmf-gallery__add[hidden] { display: none; }
.rmf-gallery__add .form-hint { margin: 0 !important; }

/* Save bar */
.rmf-bar {
    position: sticky;
    bottom: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    margin: 20px 0 0 204px;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid var(--rmx-line);
    border-bottom: 0;
    border-radius: 14px 14px 0 0;
    box-shadow: 0 -6px 20px rgba(15, 23, 42, 0.06);
    backdrop-filter: blur(6px);
}
.rmf-bar__dirty { margin-right: auto; color: #b45309; font-size: 13.5px; font-weight: 600; }
.rmf-bar__dirty[hidden] { display: none; }
.rmf-bar__dirty::before { content: "●"; margin-right: 6px; font-size: 10px; vertical-align: 1px; }

@media (max-width: 1024px) {
    .rmf-layout { grid-template-columns: minmax(0, 1fr); }
    .rmf-nav,
    .has-property-bar .rmf-nav {
        position: static;
        flex-direction: row;
        gap: 4px;
        margin: 0 -4px;
        padding: 6px 4px;
        overflow-x: auto;
        scrollbar-width: none;
    }
    .rmf-nav::-webkit-scrollbar { display: none; }
    .rmf-nav a { white-space: nowrap; padding: 7px 12px; }
    .rmf-nav a.has-error::after { top: 6px; right: 4px; margin: 0; }
    .rmf-section,
    .has-property-bar .rmf-section { scroll-margin-top: 130px; }
    .rmf-bar { margin-left: 0; }
}

/* ── Phone ──────────────────────────────────────────────────────────── */
@media (max-width: 640px) {
    .rmx-head { align-items: center; margin-bottom: 16px; }
    .rmx-head h2 { font-size: 22px; }
    .rmx-head__sub { font-size: 13px; }
    .rmx-search { max-width: none; margin-left: 0; flex-basis: 100%; }
    .rmx-grid { grid-template-columns: minmax(0, 1fr); gap: 12px; }
    /* Photo on the left keeps the cards short on a phone. */
    .rmx-card { flex-direction: row; }
    .rmx-card__media { width: 96px; min-height: 96px; flex-shrink: 0; aspect-ratio: auto; }
    .rmx-card__body { padding: 12px 12px 12px 14px; gap: 8px; min-width: 0; }
    .rmx-card__name { font-size: 15px; }
    .rmx-card__meta { font-size: 13px; }
    .rmx-status { padding: 8px 10px; }
    .rmd-head { flex-direction: column; gap: 12px; }
    .rmd-head__title h2 { font-size: 22px; }
    .rmd-head__actions { width: 100%; }
    .rmd-head__actions > .rmx-btn { flex: 1; }
    .rmd-photos { gap: 6px; border-radius: 12px; }
    .rmd-photos--many { grid-template-columns: 1fr 1fr; grid-template-rows: 200px 110px; }
    .rmd-photos--many,
    .rmd-photos--three { grid-template-columns: 1fr 1fr; }
    .rmd-photos--many .rmd-photo--main { grid-row: auto; grid-column: span 2; }
    .rmd-photos--four .rmd-photo:nth-child(4) { grid-column: auto; }
    .rmd-photos--many .rmd-photo:nth-child(n+4) { display: none; }
    .rmd-photos--two .rmd-photo { aspect-ratio: 4 / 3; }
    .rmd-photos--one .rmd-photo { aspect-ratio: 16 / 9; }
    .rmd-photo__count {
        display: inline-flex;
        position: absolute;
        right: 10px;
        bottom: 10px;
        padding: 5px 10px;
        border-radius: 8px;
        background: rgba(255, 255, 255, 0.94);
        color: var(--rmx-ink);
        font-size: 12.5px;
        font-weight: 600;
    }
    .rmd-card { padding: 16px 14px 14px; }
    .rmf-grid, .rmf-grid--3 { grid-template-columns: minmax(0, 1fr); }
    .rmf-photos { grid-template-columns: minmax(0, 1fr); }
    .rmf-method { max-width: none; }
    .rmf-bar { margin-left: -16px; margin-right: -16px; border-radius: 0; padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); }
    .rmf-bar .rmx-btn { flex: 1; }
    .rmf-bar__dirty { display: none; }
    .rmd-stays li { grid-template-columns: minmax(0, 1fr) auto; }
    .rmd-stays__role { grid-column: 1 / -1; margin-bottom: -6px; font-size: 12px; }
    .rmx-viewer { padding: 56px 8px; }
    .rmx-viewer__nav { top: auto; bottom: 18px; transform: none; }
    .rmx-dialog { align-items: flex-end; padding: 0; }
    .rmx-dialog__panel { max-width: none; border-radius: 18px 18px 0 0; padding-bottom: calc(18px + env(safe-area-inset-bottom)); }
    .rmx-dialog__actions .rmx-btn { flex: 1; }
}
@media (prefers-reduced-motion: reduce) {
    .rmx-card, .rmx-btn { transition: none; }
}

/* ── Cards | List switch, filters, list view (2026-10-24) ──────────────
   docs/GROWTH_AND_PRICING_PLAN_2026_10.md §1. */
.rmx-seg--view .rmx-seg__opt { padding: 0 12px; }
.rmx-filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; }
.rmx-filter select {
    min-height: 40px;
    padding: 0 32px 0 12px;
    border: 1px solid var(--rmx-line);
    border-radius: 10px;
    background-color: var(--rmx-surface);
    color: var(--rmx-ink);
    font: inherit;
    font-size: 14px;
    max-width: 220px;
}
.rmx-filter select:focus { outline: none; border-color: var(--rmx-accent); box-shadow: 0 0 0 3px rgba(var(--brand-rgb, 79, 70, 229), 0.12); }

.rmx-tablewrap {
    background: var(--rmx-surface);
    border: 1px solid var(--rmx-line);
    border-radius: 14px;
    overflow: hidden;
}
.rmx-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.rmx-th {
    padding: 10px 14px;
    text-align: left;
    background: var(--rmx-subtle);
    border-bottom: 1px solid var(--rmx-line);
    color: var(--rmx-muted);
    font-size: 12.5px;
    font-weight: 600;
    white-space: nowrap;
}
.rmx-th--actions { width: 48px; }
.rmx-sort { display: inline-flex; align-items: center; gap: 4px; color: inherit; text-decoration: none; }
.rmx-sort:hover, .rmx-sort.is-on { color: var(--rmx-ink); text-decoration: none; }
.rmx-sort__arrow { color: var(--rmx-faint); font-size: 11px; }
.rmx-sort.is-on .rmx-sort__arrow { color: var(--rmx-accent); }
.rmx-td {
    padding: 10px 14px;
    border-bottom: 1px solid var(--rmx-line-soft);
    color: var(--rmx-text);
    vertical-align: middle;
}
.rmx-row:last-child .rmx-td { border-bottom: 0; }
.rmx-row:hover .rmx-td { background: var(--rmx-subtle); }
.rmx-num { text-align: right; font-variant-numeric: tabular-nums; }
.rmx-th.rmx-num .rmx-sort { flex-direction: row-reverse; }
.rmx-faint { color: var(--rmx-faint); }
.rmx-td--actions { text-align: right; width: 48px; }
.rmx-row__link { display: inline-flex; align-items: baseline; gap: 8px; color: var(--rmx-ink); text-decoration: none; }
.rmx-row__link:hover .rmx-row__name { text-decoration: underline; }
.rmx-row__door { font-weight: 700; font-variant-numeric: tabular-nums; }
.rmx-row__name { font-weight: 600; }
.rmx-row__door + .rmx-row__name { font-weight: 500; color: var(--rmx-muted); }
.rmx-way { margin-right: 8px; }

.rmx-sync,
.rmx-tonight {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    text-decoration: none;
}
.rmx-sync::before,
.rmx-tonight::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--st, #94a3b8);
    flex-shrink: 0;
}
.rmx-sync { color: var(--rmx-text); }
a.rmx-sync:hover { text-decoration: underline; }
.rmx-sync[data-sync="working"] { --st: #059669; }
.rmx-sync[data-sync="failing"] { --st: #e11d48; color: #be123c; }
.rmx-sync[data-sync="paused"] { --st: #f59e0b; }
.rmx-sync[data-sync="none"] { --st: #cbd5e1; color: var(--rmx-faint); font-weight: 500; }
.rmx-tonight { color: var(--rmx-ink); }
.rmx-tonight[data-state="free"] { --st: #94a3b8; color: var(--rmx-muted); }
.rmx-tonight[data-state="occupied"] { --st: #059669; }
.rmx-tonight[data-state="arriving"] { --st: #3b82f6; }
.rmx-tonight[data-state="departing"] { --st: #f43f5e; }
.rmx-tonight[data-state="departed"] { --st: #be123c; }
.rmx-tonight[data-state="turnover"] { --st: #f59e0b; }
.rmx-tonight[data-state="blocked"],
.rmx-tonight[data-state="archived"] { --st: #94a3b8; color: var(--rmx-muted); }

@media (max-width: 1100px) {
    .rmx-tablewrap { overflow-x: auto; }
}
/* Phones: compact rows (number + name, tonight, ⋮) — never a sideways table. */
@media (max-width: 600px) {
    .rmx-seg--view { margin-left: auto; }
    .rmx-filters { flex-basis: 100%; }
    .rmx-filter { flex: 1; min-width: 0; }
    .rmx-filter select { width: 100%; max-width: none; }
    .rmx-tablewrap { overflow: visible; }
    .rmx-table thead,
    .rmx-table .rmx-col-opt { display: none; }
    .rmx-table, .rmx-table tbody { display: block; }
    .rmx-row {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto 44px;
        align-items: center;
        border-bottom: 1px solid var(--rmx-line-soft);
    }
    .rmx-row[hidden] { display: none; }
    .rmx-row:last-child { border-bottom: 0; }
    .rmx-row .rmx-td { display: block; border: 0; padding: 12px 6px 12px 14px; min-width: 0; }
    .rmx-row .rmx-td--tonight { padding: 12px 4px; }
    .rmx-row .rmx-td--actions { width: auto; padding: 6px 4px 6px 0; }
    .rmx-row__link { min-width: 0; max-width: 100%; }
    .rmx-row__name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .rmx-row__door { flex-shrink: 0; }
}
