/* H-property-redesign (12 Oct 2026): Imóveis one-line list, Imóvel banner and the "Códigos de acesso" card.
   Only theme tokens (--rm-*), so the RM navy/gold and the VJ violet/peach themes both apply. Loaded after
   materialize-madalena.css; every rule is scoped to the new classes (nothing shipped is restyled). */

/* ---- Imóveis: one line per apartment ------------------------------------------------------------------ */
body.rm-admin .pms-property-table-shell { overflow-x: auto; }
body.rm-admin .pms-property-table { width: 100%; min-width: 860px; table-layout: fixed; border-collapse: separate; border-spacing: 0; }
body.rm-admin .pms-property-table .pms-col-unit { width: 220px; }
body.rm-admin .pms-property-table .pms-col-status { width: 84px; }
/* W-wifi-column (13 Oct 2026): no Wi-Fi column; "Reserva atual" takes the free width (Wi-Fi stays on the Imovel page). */
body.rm-admin .pms-property-table .pms-col-code { width: 116px; }
body.rm-admin .pms-property-table .pms-col-occupancy { width: 112px; }
body.rm-admin .pms-property-table .pms-col-adr { width: 100px; }
body.rm-admin .pms-property-table .pms-col-edit { width: 52px; }
body.rm-admin .pms-property-table th { position: sticky; top: 0; z-index: 2; padding: 10px; border-bottom: 1px solid var(--rm-line); color: var(--rm-secondary); background: #f5f5f7; font-size: 12px; font-weight: 600; letter-spacing: .02em; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
body.rm-admin .pms-property-table th.pms-prop-num { line-height: 1.2; text-align: right; }
body.rm-admin .pms-property-table th.pms-prop-num small { display: block; color: var(--rm-secondary); font-size: 10.5px; font-weight: 500; letter-spacing: 0; }
body.rm-admin .pms-property-table td { height: 48px; padding: 6px 10px; border-bottom: 1px solid var(--rm-line); color: var(--rm-text); font-size: 12.5px; line-height: 1.3; vertical-align: middle; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
body.rm-admin .pms-property-table tbody tr { cursor: pointer; transition: background .18s ease; }
body.rm-admin .pms-property-table tbody tr:hover { background: #fafafd; }
body.rm-admin .pms-property-table tbody tr:last-child td { border-bottom: 0; }
body.rm-admin .pms-property-table tbody tr:focus-visible { outline: 2px solid var(--rm-primary); outline-offset: -2px; }
body.rm-admin .pms-property-table tbody tr.hidden { display: none; }
body.rm-admin .pms-property-table .cell-primary { display: inline; color: var(--rm-heading); font-weight: 700; }
body.rm-admin .pms-prop-name { display: inline; margin-left: 8px; color: var(--rm-text); }
body.rm-admin .pms-prop-guest i { margin-right: 4px; color: var(--rm-accent); font-size: 14px; vertical-align: -2px; }
body.rm-admin .pms-prop-guest strong { color: var(--rm-heading); font-weight: 650; }
body.rm-admin .pms-prop-dates { margin-left: 8px; color: var(--rm-text); font-variant-numeric: tabular-nums; }
body.rm-admin .pms-prop-free { color: var(--rm-success); font-weight: 650; }
body.rm-admin .pms-prop-icon { margin-right: 4px; color: var(--rm-secondary); font-size: 15px; vertical-align: -2px; }
body.rm-admin .pms-prop-icon.is-missing { color: var(--rm-warning); }
body.rm-admin .pms-prop-ssid { color: var(--rm-heading); }
body.rm-admin .pms-prop-mask { margin-left: 6px; color: var(--rm-secondary); font-weight: 700; letter-spacing: .14em; }
body.rm-admin .pms-prop-code .pms-prop-mask { margin-left: 0; }
body.rm-admin .pms-prop-missing { color: var(--rm-warning); font-weight: 600; }
body.rm-admin .pms-prop-wifi .pms-prop-missing:not(:first-child) { margin-left: 6px; font-weight: 500; }
body.rm-admin .pms-prop-muted { color: var(--rm-secondary); }
body.rm-admin .pms-prop-num { text-align: right; font-variant-numeric: tabular-nums; }
body.rm-admin .pms-prop-num strong { color: var(--rm-heading); font-weight: 650; }
body.rm-admin .pms-prop-base { margin-left: 6px; color: var(--rm-secondary); font-size: 11px; }
body.rm-admin .pms-prop-edit { text-align: right; }
body.rm-admin .pms-prop-edit .icon-button { width: 32px; min-width: 32px; height: 32px; }

/* Phones: the row becomes a compact card. Primary line: code, short name, status, pencil; second line: the stay
   in the unit, Wi-Fi and emergency marks, occupancy and nightly rate. Still one node per apartment (keyed). */
@media (max-width: 780px) {
  body.rm-admin .pms-property-table { min-width: 0; table-layout: auto; }
  body.rm-admin .pms-property-table colgroup,
  body.rm-admin .pms-property-table thead { display: none; }
  body.rm-admin .pms-property-table tbody { display: block; }
  body.rm-admin .pms-property-table tbody tr { display: grid; grid-template-columns: minmax(0, 1fr) auto auto auto auto; grid-template-areas: "unit unit unit status edit" "stay stay code occupancy adr"; align-items: center; gap: 4px 12px; padding: 10px 12px; border-bottom: 1px solid var(--rm-line); }
  body.rm-admin .pms-property-table tbody tr:last-child { border-bottom: 0; }
  body.rm-admin .pms-property-table tbody tr.hidden { display: none; }
  body.rm-admin .pms-property-table td { display: block; height: auto; min-width: 0; padding: 0; border: 0; font-size: 12px; }
  body.rm-admin .pms-property-table td[colspan] { grid-column: 1 / -1; }
  body.rm-admin .pms-prop-unit { grid-area: unit; font-size: 13.5px; }
  body.rm-admin .pms-prop-status { grid-area: status; }
  body.rm-admin .pms-prop-edit { grid-area: edit; }
  body.rm-admin .pms-prop-stay { grid-area: stay; }
  body.rm-admin .pms-prop-wifi { grid-area: wifi; }
  body.rm-admin .pms-prop-code { grid-area: code; }
  body.rm-admin .pms-prop-occupancy { grid-area: occupancy; }
  body.rm-admin .pms-prop-adr { grid-area: adr; }
  /* Wi-Fi and emergency keep only their icon (warning colour when missing); the title says what it means. */
  body.rm-admin .pms-prop-wifi .pms-prop-label,
  body.rm-admin .pms-prop-code .pms-prop-label { display: none; }
  body.rm-admin .pms-prop-wifi .pms-prop-icon,
  body.rm-admin .pms-prop-code .pms-prop-icon { margin-right: 0; font-size: 17px; }
  body.rm-admin .pms-prop-base { display: none; }
  body.rm-admin .pms-prop-edit .icon-button { width: 30px; min-width: 30px; height: 30px; }
}

/* ---- Imóvel banner -------------------------------------------------------------------------------------- */
body.rm-admin .property-banner { min-height: 220px; align-items: flex-end; }
/* The photo (z 0) must sit under the scrim (::before) and the copy: the scrim was drawn below the static <img>
   because both had z-index 0 and the picture comes later in the tree. */
body.rm-admin .property-banner.has-photo::before { z-index: 1; }
body.rm-admin .property-banner > .property-hero-copy,
body.rm-admin .property-banner > .property-hero-actions { position: relative; z-index: 2; }
body.rm-admin .property-banner-heading { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 14px; min-width: 0; margin: 0; }
body.rm-admin .property-banner-code { color: var(--rm-accent); font-size: clamp(1.75rem, 3vw, 2.5rem); font-weight: 700; line-height: 1.05; white-space: nowrap; }
body.rm-admin .property-banner-code:empty { display: none; }
body.rm-admin .property-banner-title { min-width: 0; max-width: 100%; overflow: hidden; color: #fff; font-size: clamp(1.05rem, 1.6vw, 1.375rem); font-weight: 500; line-height: 1.3; text-overflow: ellipsis; white-space: nowrap; }
body.rm-admin .property-banner-stay { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; width: fit-content; max-width: 100%; margin-top: 14px; padding: 8px 14px; border: 1px solid rgba(255, 255, 255, .18); border-radius: 12px; color: #fff; background: rgba(255, 255, 255, .1); font-size: .875rem; line-height: 1.35; -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
body.rm-admin .property-banner-stay.hidden { display: none; }
body.rm-admin .property-banner-stay i { color: var(--rm-accent); font-size: 18px; }
body.rm-admin .property-banner-stay strong { color: #fff; font-weight: 650; }
body.rm-admin .property-banner-stay[data-state="loading"] strong { color: rgba(255, 255, 255, .7); font-weight: 500; }
body.rm-admin .property-banner-dates { color: rgba(255, 255, 255, .82); font-variant-numeric: tabular-nums; }
body.rm-admin .property-banner-dates:empty { display: none; }
body.rm-admin .property-banner-nights { padding: 2px 9px; border-radius: 999px; color: var(--rm-primary); background: var(--rm-accent); font-size: 12px; font-weight: 650; }
body.rm-admin .property-banner-nights.hidden { display: none; }
/* No photo: the .hero-card gradient with the unit code drawn faintly on the right (text, not an image). */
body.rm-admin .property-banner:not(.has-photo)::before { content: attr(data-code); position: absolute; right: 28px; bottom: -0.18em; z-index: 0; color: rgba(255, 255, 255, .06); font-size: clamp(4.5rem, 11vw, 9rem); font-weight: 800; letter-spacing: -.02em; line-height: 1; white-space: nowrap; pointer-events: none; }
@media (max-width: 780px) {
  body.rm-admin .property-banner { min-height: 0; }
  body.rm-admin .property-banner-code { font-size: 1.75rem; }
  body.rm-admin .property-banner-title { font-size: 1rem; white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
  body.rm-admin .property-banner-stay { width: 100%; box-sizing: border-box; }
  body.rm-admin .property-banner .property-hero-actions { display: flex; width: 100%; margin-top: 14px; }
  body.rm-admin .property-banner .property-hero-actions .button { width: 100%; justify-content: center; }
}

/* ---- Visão geral: Wi-Fi and Códigos de acesso side by side ---------------------------------------------- */
body.rm-admin .property-access-grid:has(> .card.hidden) { grid-template-columns: minmax(0, 1fr); }
body.rm-admin .property-codes-body { display: grid; gap: 12px; }
body.rm-admin .property-code-block { min-width: 0; padding: 14px; border: 1px solid var(--rm-line); border-radius: 10px; background: var(--rm-paper); }
body.rm-admin .property-code-block.hidden { display: none; }
body.rm-admin .property-code-block[data-code-kind="emergency"] { background: var(--rm-accent-soft); }
body.rm-admin .property-code-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
body.rm-admin .property-code-label { display: inline-flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; min-width: 0; }
body.rm-admin .property-code-label i { align-self: center; color: var(--rm-accent); font-size: 17px; }
body.rm-admin .property-code-label strong { color: var(--rm-heading); font-size: 14px; }
body.rm-admin .property-code-label small { color: var(--rm-text); font-size: 12px; }
body.rm-admin .property-code-head .status-badge { flex: none; white-space: nowrap; }
body.rm-admin .property-code-view code { font-size: 19px; letter-spacing: .08em; font-variant-numeric: tabular-nums; }
body.rm-admin .property-code-view > small { display: block; margin-top: 8px; color: var(--rm-text); font-size: 12px; line-height: 1.45; }
body.rm-admin .property-code-view > small:empty { display: none; }
body.rm-admin .property-code-empty-copy { display: grid; gap: 2px; margin: 0; }
body.rm-admin .property-code-empty-copy strong { color: var(--rm-heading); font-size: 13px; }
body.rm-admin .property-code-empty-copy small { color: var(--rm-text); font-size: 12px; }
body.rm-admin .property-code-empty-copy small:empty { display: none; }
body.rm-admin .property-code-block .modal-actions { margin-top: 12px; padding-top: 0; border-top: 0; }
body.rm-admin .property-code-form { display: grid; gap: 10px; }
body.rm-admin .property-code-form.hidden,
body.rm-admin .property-code-view.hidden,
body.rm-admin .property-code-empty.hidden { display: none; }

/* ---- Moved actions -------------------------------------------------------------------------------------- */
body.rm-admin .property-sync-actions { align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
body.rm-admin .property-sync-actions small { color: var(--rm-text); font-size: 12px; }
body.rm-admin .property-photos-head-actions { display: flex; flex: none; align-items: flex-start; }
