/* REVIEWS-modal (owner, 24 Oct 2026): header button #rf-button ("Avaliações Airbnb") and the #rf-dialog modal.
   Desktop: centred 720px card with an internally scrolling list; phones <= 780px: full-height sheet. Same language as the
   Histórico dialog (activity.css: .hist-badge, .hist-block, .hist-more, .hist-end and .hist-sr are reused as-is) in the
   restrained Materialize Madalena theme (navy/gold, 10px card, 8px rows, 6px chips). Scoped to body.rm-admin; theme tokens
   (--rm-*). No style attributes anywhere (the page CSP forbids them): state is classes + [hidden] only. */

/* ---- Header button (badge = .hist-badge) ---- */
body.rm-admin .rf-button { position: relative; flex-shrink: 0; }
body.rm-admin .rf-button svg { display: block; }

/* ---- Dialog shell ---- */
body.rm-admin .rf-dialog { box-sizing: border-box; width: min(720px, calc(100vw - 28px)); max-width: none; max-height: min(84vh, 880px); margin: auto; padding: 0; overflow: hidden;
  border: 1px solid #e1e6ee; border-radius: 10px; background: #fff; color: #526174; box-shadow: 0 22px 60px rgba(15, 34, 58, .22); font-size: 12px; line-height: 1.4; }
body.rm-admin .rf-dialog[open] { display: flex; flex-direction: column; }
body.rm-admin .rf-dialog::backdrop { background: rgba(15, 34, 58, .35); }
body.rm-admin .rf-head { flex: 0 0 auto; display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 18px 18px 12px; border-bottom: 1px solid #edf0f3; }
body.rm-admin .rf-head small { display: block; color: #FF385C; font-size: 11px; font-weight: 800; letter-spacing: .08em; }
body.rm-admin .rf-head h2 { margin: 2px 0 4px; color: var(--rm-heading, #303548); font-size: 1.2rem; line-height: 1.2; }
body.rm-admin .rf-head p { margin: 0; color: var(--rm-secondary, #9295a1); font-size: 12.5px; }
body.rm-admin .rf-head .icon-button { flex: 0 0 auto; width: 34px; min-width: 34px; height: 34px; font-size: 18px; }

/* ---- List ---- */
body.rm-admin .rf-scroll { flex: 1 1 auto; min-height: 200px; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; scrollbar-gutter: stable; }
body.rm-admin .rf-scroll:focus-visible { outline: none; }
body.rm-admin .rf-list { margin: 0; padding: 6px 10px 4px; list-style: none; }
body.rm-admin .rf-item { padding: 12px 10px; border-radius: 8px; }
body.rm-admin .rf-item + .rf-item { border-top: 1px solid #f0f3f6; }
body.rm-admin .rf-item.is-unseen { background: #fdfaf2; }

body.rm-admin .rf-top { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; min-height: 22px; }
body.rm-admin .rf-unit { display: inline-flex; align-items: center; height: 20px; padding: 0 7px; border-radius: 6px; background: var(--rm-primary, #142f53); color: #fff; font-size: 11.5px; font-weight: 750; letter-spacing: .01em; white-space: nowrap; font-variant-numeric: tabular-nums; }
body.rm-admin .rf-name { color: #16304d; font-size: 13.5px; font-weight: 750; letter-spacing: -.01em; }
body.rm-admin .rf-rating { display: inline-flex; align-items: center; gap: 5px; color: #16304d; font-size: 12px; }
body.rm-admin .rf-rating b { font-weight: 750; font-variant-numeric: tabular-nums; }
body.rm-admin .rf-rating.is-none { color: #8a93a3; font-size: 11.5px; }
body.rm-admin .rf-stars { display: inline-flex; gap: 1px; line-height: 0; }
body.rm-admin .rf-star svg { display: block; fill: #dfe4ea; }
body.rm-admin .rf-star.is-full svg { fill: var(--rm-accent, #d2aa61); }
body.rm-admin .rf-star.is-half svg { fill: var(--rm-accent, #d2aa61); opacity: .55; }
body.rm-admin .rf-when { margin-left: auto; color: #8a93a3; font-size: 11.5px; font-variant-numeric: tabular-nums; white-space: nowrap; }
body.rm-admin .rf-item.is-unseen .rf-when { color: #6b5a3a; font-weight: 700; }
body.rm-admin .rf-item.is-unseen .rf-when::before { content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 6px; border-radius: 50%; background: var(--rm-accent, #d2aa61); box-shadow: 0 0 0 3px rgba(210, 170, 97, .22); vertical-align: 1px; }

body.rm-admin .rf-sub { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 0; margin-top: 5px; color: #526174; font-size: 12px; }
body.rm-admin .rf-sub i { margin-right: 4px; color: #8a93a3; font-size: 13px; vertical-align: -2px; }
body.rm-admin .rf-dates { color: #263b54; font-weight: 650; font-variant-numeric: tabular-nums; white-space: nowrap; }
body.rm-admin .rf-sep { margin: 0 7px; color: #b5bcc7; }
body.rm-admin .rf-clean b { color: #263b54; font-weight: 700; }
body.rm-admin .rf-clean.is-unknown { color: #8a93a3; }

body.rm-admin .rf-body { margin-top: 7px; }
body.rm-admin .rf-text { margin: 0; color: #334155; font-size: 13px; line-height: 1.5; overflow-wrap: anywhere; white-space: normal; }
body.rm-admin .rf-more-text { margin-top: 2px; padding: 2px 0; border: 0; background: none; color: var(--rm-primary, #142f53); font: inherit; font-size: 12px; font-weight: 700; cursor: pointer; }
body.rm-admin .rf-more-text:hover { text-decoration: underline; }
body.rm-admin .rf-more-text:focus-visible { outline: 2px solid var(--rm-primary, #142f53); outline-offset: 2px; border-radius: 4px; }
body.rm-admin .rf-state { display: flex; align-items: flex-start; gap: 7px; margin: 0; padding: 8px 10px; border-radius: 8px; background: #f6f8fa; color: #5f6b7b; font-size: 12px; line-height: 1.45; }
body.rm-admin .rf-state i { flex: 0 0 auto; margin-top: 1px; font-size: 14px; }
body.rm-admin .rf-state.is-hidden { background: #fff7f8; color: #7a4a52; }
body.rm-admin .rf-state.is-hidden i { color: #FF385C; }
body.rm-admin .rf-state b { color: inherit; font-weight: 750; }

body.rm-admin .rf-meta { display: flex; flex-wrap: wrap; gap: 5px 6px; margin-top: 8px; }
body.rm-admin .rf-chip { display: inline-flex; align-items: center; gap: 4px; height: 21px; padding: 0 8px 0 6px; border-radius: 6px; background: #f1f5f8; color: #476078; font-size: 11px; font-weight: 650; white-space: nowrap; }
body.rm-admin .rf-chip i { font-size: 13px; line-height: 1; }
body.rm-admin .rf-chip.is-ok { background: #eef6f1; color: #2e6b4c; }
body.rm-admin .rf-chip.is-pending { background: #faf3e5; color: #8a6738; }

body.rm-admin .rf-status { padding: 6px 18px 16px; }
body.rm-admin .rf-status:empty { display: none; }

/* ---- Phones: full-height sheet ---- */
@media (max-width: 780px) {
  body.rm-admin .rf-dialog { width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; margin: 0; border: 0; border-radius: 0; box-shadow: none; }
  body.rm-admin .rf-head { padding: calc(14px + env(safe-area-inset-top)) 16px 10px; }
  body.rm-admin .rf-head h2 { font-size: 1.25rem; }
  body.rm-admin .rf-head .icon-button { width: 38px; min-width: 38px; height: 38px; }
  body.rm-admin .rf-scroll { min-height: 0; }
  body.rm-admin .rf-list { padding: 4px 8px 2px; }
  body.rm-admin .rf-item { padding: 12px 8px; }
  body.rm-admin .rf-name { font-size: 14px; }
  body.rm-admin .rf-text { font-size: 13.5px; }
  body.rm-admin .rf-status { padding: 6px 16px calc(16px + env(safe-area-inset-bottom)); }
}

/* ---- Phones <= 480px: the sixth header button must not squeeze the page title. The six action buttons share the space the
   five had: 32px wide (height unchanged) and a 3px gap, so "Visão geral", "Calendário" and "Mensagens" still fit at 390px. ---- */
@media (max-width: 480px) {
  body.rm-admin .topbar-actions { gap: 3px; }
  body.rm-admin .topbar-actions .icon-button { width: 32px; min-width: 32px; }
}
@media (max-width: 370px) { body.rm-admin .topbar-actions { gap: 2px; } }

/* ---- RAIL (owner addition, 24 Oct 2026): the COLLAPSED desktop sidebar (>= 1181px, .app-shell.sidebar-collapsed) ----
   - every nav icon on the rail's centre axis, the same axis as the "RM" tile and the active pill: items are 48px flex boxes
     centred in the nav; the group parents (Segurança, Configurações) no longer keep their expanded grid columns (their icon
     sat 11.5px left of centre); the nav's own scrollbar is hidden in the rail (a classic Windows scrollbar took ~15px from the
     nav and pushed every icon left of the tile; the rail still scrolls by wheel/touch/keyboard);
   - count badges and the group red dot share one anchor: the icon's top-right corner (left = item centre + 9px; badge top 4px, dot top 8px: same centre line), small
     (16px), so they no longer cover the glyph or float at item-width-dependent offsets;
   - the "RM" tile is centred in the brand row and the chevron sits on the rail edge, vertically centred on the tile, clear of it.
   Expanded mode and phones/tablets (<= 1180px) are untouched: everything here is inside the collapsed selector and media query. */
@media (min-width: 1181px) {
  body.rm-admin .app-shell.sidebar-collapsed .sidebar-brand { display: flex; align-items: center; justify-content: center; min-height: 72px; padding: 10px 0; }
  body.rm-admin .app-shell.sidebar-collapsed .sidebar-brand .sidebar-monogram { flex: 0 0 42px; margin: 0; }
  body.rm-admin .app-shell.sidebar-collapsed .sidebar-brand .sidebar-close { display: none; }
  body.rm-admin .app-shell.sidebar-collapsed .sidebar-brand .sidebar-collapse { top: 50%; right: -14px; margin-top: -14px; }
  body.rm-admin .app-shell.sidebar-collapsed .sidebar-nav { padding-right: 0; padding-left: 0; scrollbar-width: none; align-items: center; }
  body.rm-admin .app-shell.sidebar-collapsed .sidebar-nav::-webkit-scrollbar { display: none; width: 0; height: 0; }
  body.rm-admin .app-shell.sidebar-collapsed .sidebar-nav .nav-group { justify-items: center; width: 100%; }
  body.rm-admin .app-shell.sidebar-collapsed .sidebar-nav .nav-item,
  body.rm-admin .app-shell.sidebar-collapsed .sidebar-nav .nav-group .nav-parent {
    position: relative; display: flex; align-items: center; justify-content: center; box-sizing: border-box;
    width: 48px; min-width: 48px; max-width: 48px; min-height: 44px; margin: 1px auto; padding: 0; gap: 0;
  }
  body.rm-admin .app-shell.sidebar-collapsed .sidebar-nav .nav-item > i.ri:first-child { flex: 0 0 auto; display: block; width: 1.3rem; margin: 0; font-size: 1.3rem; line-height: 1; text-align: center; }
  body.rm-admin .app-shell.sidebar-collapsed .sidebar-nav .nav-item > b.has-value {
    position: absolute; top: 4px; left: calc(50% + 9px); right: auto; display: grid; place-items: center; box-sizing: border-box;
    min-width: 16px; height: 16px; margin: 0; padding: 0 4px; border: 1.5px solid var(--rm-body, #f7f7f9); border-radius: 999px;
    font-size: .5625rem; font-weight: 750; line-height: 1; letter-spacing: 0; font-variant-numeric: tabular-nums;
  }
  body.rm-admin .app-shell.sidebar-collapsed .nav-group:has(.nav-subitem > b.has-value.warning) .nav-parent::after,
  body.rm-admin .app-shell.sidebar-collapsed .nav-group:has(.nav-subitem > b.has-value.danger) .nav-parent::after {
    top: 8px; left: calc(50% + 9px); right: auto; box-sizing: border-box; width: 9px; height: 9px; border: 1.5px solid var(--rm-body, #f7f7f9);
  }
}

/* ---- RO1 (REVIEWS-allota, owner 24 Oct 2026, -ro1): every channel ----
   Channel mark per row (existing Airbnb mask / Booking "B." glyph / Expedia-Vrbo logos), channel filter chips under the title,
   Booking-style 0-10 score box (never stars), Booking public parts (title / Positivo / Negativo), roomier rows on the theme's
   4/8/12/16/24 spacing (cards with a gap instead of hairlines), comfortable line-height. Response chips are no longer drawn. */
body.rm-admin .rf-head-text { min-width: 0; }
body.rm-admin .rf-head h2 { margin: 0 0 4px; }
body.rm-admin .rf-filter { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
body.rm-admin .rf-filter[hidden] { display: none; }
body.rm-admin .rf-filter-chip { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border: 1px solid var(--rm-line, #e1e6ee); border-radius: 999px;
  background: #fff; color: #476078; font: inherit; font-size: 12.5px; font-weight: 650; line-height: 1; cursor: pointer; white-space: nowrap; }
body.rm-admin .rf-filter-chip:hover { border-color: #c9d3df; background: #f7f9fb; }
body.rm-admin .rf-filter-chip:focus-visible { outline: 2px solid var(--rm-primary, #142f53); outline-offset: 2px; }
body.rm-admin .rf-filter-chip.is-active { border-color: var(--rm-primary, #142f53); background: var(--rm-primary, #142f53); color: #fff; }
body.rm-admin .rf-filter-chip small { color: inherit; opacity: .7; font-size: 11.5px; font-weight: 700; font-variant-numeric: tabular-nums; }
body.rm-admin .rf-filter-chip .rf-channel { width: 16px; height: 16px; }
body.rm-admin .rf-filter-chip.is-active .rf-channel { border-radius: 4px; background: #fff; }

body.rm-admin .rf-list { display: flex; flex-direction: column; gap: 12px; padding: 16px 16px 8px; }
body.rm-admin .rf-item { padding: 16px; border: 1px solid #edf0f3; border-radius: 10px; background: #fff; }
body.rm-admin .rf-item + .rf-item { border-top: 1px solid #edf0f3; }
body.rm-admin .rf-item.is-unseen { border-color: #efe2c4; background: #fdfaf2; }
body.rm-admin .rf-top { gap: 6px 10px; min-height: 24px; }
body.rm-admin .rf-sub { gap: 4px 0; margin-top: 8px; line-height: 1.5; }
body.rm-admin .rf-body { margin-top: 12px; }
body.rm-admin .rf-text { line-height: 1.65; }
body.rm-admin .rf-more-text { margin-top: 4px; }
body.rm-admin .rf-state { padding: 10px 12px; line-height: 1.55; }

body.rm-admin .rf-channel { display: inline-grid; place-items: center; flex: 0 0 auto; width: 20px; height: 20px; line-height: 0; }
body.rm-admin .rf-channel .brand-logo.is-airbnb { display: block; width: 18px; height: 18px; }
body.rm-admin .rf-channel .booking-logo { width: 18px; height: 18px; }
body.rm-admin .rf-channel .property-ota-logo { display: block; width: 18px; height: 18px; }
body.rm-admin .rf-channel.is-other i { color: #8a93a3; font-size: 16px; line-height: 1; }

/* Booking.com style score: navy square with the number, "/10" beside it. */
body.rm-admin .rf-score10 { display: inline-flex; align-items: center; gap: 3px; color: #16304d; font-size: 12px; }
body.rm-admin .rf-score10 b { display: inline-grid; place-items: center; min-width: 30px; height: 24px; padding: 0 6px; border-radius: 6px 6px 6px 0; background: #003580; color: #fff;
  font-size: 12.5px; font-weight: 750; line-height: 1; font-variant-numeric: tabular-nums; }
body.rm-admin .rf-score10 small { color: #6b7686; font-size: 11.5px; font-weight: 650; }

body.rm-admin .rf-parts { display: grid; gap: 8px; }
body.rm-admin .rf-part { display: flex; align-items: flex-start; gap: 10px; margin: 0; color: #334155; font-size: 13px; line-height: 1.6; overflow-wrap: anywhere; }
body.rm-admin .rf-part.is-title { color: #16304d; font-size: 13.5px; font-weight: 750; }
body.rm-admin .rf-part-label { display: inline-flex; flex: 0 0 auto; align-items: center; justify-content: center; min-width: 72px; height: 22px; padding: 0 8px; border-radius: 6px;
  font-size: 11px; font-weight: 700; line-height: 1; white-space: nowrap; }
body.rm-admin .rf-part.is-positive .rf-part-label { background: var(--rm-success-soft, #eef6f1); color: #2e6b4c; }
body.rm-admin .rf-part.is-negative .rf-part-label { background: var(--rm-danger-soft, #fbeeee); color: #8a3b3b; }
body.rm-admin .rf-part-text { min-width: 0; padding-top: 1px; }

@media (max-width: 780px) {
  body.rm-admin .rf-filter { gap: 6px; margin-top: 10px; }
  body.rm-admin .rf-list { gap: 10px; padding: 12px 12px 8px; }
  body.rm-admin .rf-item { padding: 14px; }
  body.rm-admin .rf-part { flex-direction: column; gap: 4px; }
  body.rm-admin .rf-part-label { min-width: 0; align-self: flex-start; }
}

/* REVIEWS-zelofy (28 Oct 2026, -rz1): per-category detail view of a review (Airbnb; Booking.com when it sends categories). */
body.rm-admin .rf-item.is-openable { cursor: pointer; transition: border-color .15s ease, background-color .15s ease; }
body.rm-admin .rf-item.is-openable:hover { border-color: #d9dee6; background: #fbfcfd; }
body.rm-admin .rf-open { display: inline-flex; align-items: center; gap: 2px; margin-top: 10px; padding: 6px 10px 6px 12px; border: 1px solid #e3e7ed; border-radius: 999px; background: #fff; color: var(--rm-primary, #16304d); font: inherit; font-size: 12px; font-weight: 650; line-height: 1.2; cursor: pointer; min-height: 32px; }
body.rm-admin .rf-open:hover { border-color: var(--rm-accent, #d2aa61); }
body.rm-admin .rf-open:focus-visible, body.rm-admin .rf-back:focus-visible { outline: 2px solid var(--rm-accent, #d2aa61); outline-offset: 2px; }
body.rm-admin .rf-open i { font-size: 16px; }
body.rm-admin .rf-detail { flex: 1 1 auto; min-height: 200px; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; scrollbar-gutter: stable; padding: 0 18px 18px; }
body.rm-admin .rf-detail[hidden], body.rm-admin .rf-scroll[hidden] { display: none; }
body.rm-admin .rf-detail-bar { position: sticky; top: 0; z-index: 1; padding: 12px 0 10px; background: #fff; }
body.rm-admin .rf-back { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 6px 12px 6px 8px; border: 0; border-radius: 8px; background: #f3f5f8; color: var(--rm-primary, #16304d); font: inherit; font-size: 13px; font-weight: 650; cursor: pointer; }
body.rm-admin .rf-back:hover { background: #e9edf2; }
body.rm-admin .rf-back i { font-size: 18px; }
body.rm-admin .rf-detail-card { padding: 16px; border: 1px solid #edf0f3; border-radius: 10px; background: #fff; }
body.rm-admin .rf-d-section { margin-top: 16px; }
body.rm-admin .rf-d-section h3 { margin: 0 0 8px; color: #6b7686; font-size: 11px; font-weight: 750; letter-spacing: .06em; text-transform: uppercase; }
body.rm-admin .rf-detail .rf-text { line-height: 1.65; }
body.rm-admin .rf-cats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 0; padding: 0; list-style: none; }
body.rm-admin .rf-cat { padding: 12px; border: 1px solid #edf0f3; border-radius: 10px; background: #fbfcfd; min-width: 0; }
body.rm-admin .rf-cat-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
body.rm-admin .rf-cat-label { color: var(--rm-heading, #16304d); font-size: 13px; font-weight: 700; }
body.rm-admin .rf-cat-empty { margin: 8px 0 0; color: #8a93a3; font-size: 12px; }
body.rm-admin .rf-star.is-split { position: relative; }
body.rm-admin .rf-star.is-split .rf-star-fill { position: absolute; top: 0; left: 0; bottom: 0; width: 50%; overflow: hidden; }
body.rm-admin .rf-star.is-split .rf-star-fill svg { fill: var(--rm-accent, #d2aa61); }
body.rm-admin .rf-tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 0; padding: 0; list-style: none; }
body.rm-admin .rf-tag { display: inline-flex; align-items: center; gap: 6px; padding: 4px 9px; border-radius: 999px; background: #f1f4f7; color: #334155; font-size: 12px; line-height: 1.35; }
body.rm-admin .rf-tag::before { content: ''; flex: 0 0 auto; width: 6px; height: 6px; border-radius: 50%; background: #8a93a3; }
body.rm-admin .rf-tag.is-positive { background: var(--rm-success-soft, #e8f6ee); color: #1f5f3a; }
body.rm-admin .rf-tag.is-positive::before { background: #2f8a57; }
body.rm-admin .rf-tag.is-negative { background: var(--rm-danger-soft, #fdeceb); color: #8a2d26; }
body.rm-admin .rf-tag.is-negative::before { background: #c2463c; }
@media (max-width: 780px) {
  body.rm-admin .rf-detail { min-height: 0; padding: 0 14px 18px; }
  body.rm-admin .rf-detail-card { padding: 14px; }
  body.rm-admin .rf-cats { grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) { body.rm-admin .rf-item.is-openable { transition: none; } }
