/* Calendário · preços por canal (owner 18 Oct 2026; compact layout 18 Oct, 2nd round: "just layout the final price and
   add a + on each channel"). Hover card on empty nights (#cp-pop), the "Preços por canal" section of the action panel
   (#cp-panel), the estimate inside the calendar cells (.calendar-rate.is-estimate) and the "Descontos dos canais" editor
   (#cp-editor). Same language as the reservation hover card (calendar-dnd.css .cal-hover) and the PriceLabs dialogs
   (imoveis-pricing.css .base-price-dialog). Scoped to body.rm-admin and the cp- classes; theme tokens (--rm-*) so the RM
   and VJ themes both apply. Geometry is set through CSSOM only (left/top/max-height on #cp-pop): the page CSP forbids
   style attributes. */

body.rm-admin .cp-pop { position: fixed; left: 0; top: 0; z-index: 72; box-sizing: border-box; width: 312px; max-width: calc(100vw - 16px); padding: 0; overflow: auto; overscroll-behavior: contain;
  border: 1px solid #e4e9ef; border-radius: 14px; background: #fff; color: #526174; box-shadow: 0 18px 40px -16px rgba(17, 33, 53, .34); font-size: 12px; line-height: 1.35; }
body.rm-admin .cp-pop[hidden] { display: none; }
body.rm-admin .cp-pop .cp-card { padding: 11px 12px 9px; }

/* ---- The card (popover and panel share it) ---- */
body.rm-admin .cp-card { font-size: 12px; line-height: 1.35; color: #526174; }
body.rm-admin .cp-head { display: grid; gap: 2px; padding-bottom: 7px; }
body.rm-admin .cp-title { color: #16304d; font-size: 13px; font-weight: 750; letter-spacing: -.01em; }
body.rm-admin .cp-sub { color: #7c8797; font-size: 10.5px; line-height: 1.3; }
body.rm-admin .cp-sub b { color: #16304d; font-weight: 750; font-variant-numeric: tabular-nums; }
body.rm-admin .cp-sub.is-empty { color: #9a6817; font-weight: 650; }
body.rm-admin .cp-first { color: #8a6738; font-size: 10.5px; font-weight: 650; }
body.rm-admin .cp-banner { display: flex; align-items: center; gap: 6px; margin: 0 0 6px; padding: 5px 8px; border-radius: 8px; color: #6e5935; background: #fffaf0; border: 1px solid #edd9ae; font-size: 11px; font-weight: 650; }
body.rm-admin .cp-banner i { color: var(--rm-warning, #c28725); font-size: 14px; }
body.rm-admin .cp-empty { margin: 4px 0 0; color: #647184; }
body.rm-admin .cp-channels { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; border-top: 1px solid #edf0f3; }
body.rm-admin .cp-channel { border-bottom: 1px solid #edf0f3; }
body.rm-admin .cp-channel:last-child { border-bottom: 0; }
/* Collapsed row: dot · name + one-line reason · final price · "+" */
body.rm-admin .cp-row { display: grid; grid-template-columns: 9px minmax(0, 1fr) auto 22px; align-items: center; column-gap: 7px; min-height: 38px; padding: 4px 0; cursor: pointer; }
body.rm-admin .cp-row:hover .cp-more { border-color: #c9d2dc; color: #16304d; }
body.rm-admin .cp-dot { flex: 0 0 auto; width: 9px; height: 9px; border-radius: 50%; background: #868f9d; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .06); }
body.rm-admin .cp-dot.is-airbnb { background: #FF385C; }
body.rm-admin .cp-dot.is-booking { background: #003580; }
body.rm-admin .cp-dot.is-expedia { background: #f5cb40; }
body.rm-admin .cp-dot.is-vrbo { background: #2668b7; }
body.rm-admin .cp-dot.is-decolar { background: #5734a8; }
body.rm-admin .cp-dot.is-direct { background: var(--rm-accent, #d2aa61); }
body.rm-admin .cp-row-main { display: grid; gap: 1px; min-width: 0; }
body.rm-admin .cp-row-name { display: flex; align-items: center; gap: 6px; min-width: 0; }
body.rm-admin .cp-name { color: #16304d; font-size: 12.5px; font-weight: 750; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
body.rm-admin .cp-row-why { display: block; color: #7c8797; font-size: 10.5px; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
body.rm-admin .cp-row-price { display: inline-flex; align-items: baseline; gap: 5px; white-space: nowrap; font-variant-numeric: tabular-nums; }
body.rm-admin .cp-row-price strong { color: #16304d; font-size: 14.5px; font-weight: 800; letter-spacing: -.01em; }
body.rm-admin .cp-row-price.is-lower strong { color: #1f5a3a; }
body.rm-admin .cp-was { color: #9aa3b1; font-size: 10.5px; font-weight: 600; text-decoration-color: #b4bcc7; }
body.rm-admin .cp-more { display: inline-flex; align-items: center; justify-content: center; box-sizing: border-box; width: 22px; height: 22px; min-height: 0; padding: 0; border: 1px solid #dfe5eb; border-radius: 50%; color: #647184; background: #fff; box-shadow: none; cursor: pointer; font-size: 14px; line-height: 1; transition: transform .16s ease, border-color .16s ease, color .16s ease; }
body.rm-admin .cp-more i { pointer-events: none; }
body.rm-admin .cp-more .ri-subtract-line, body.rm-admin .cp-channel.is-open .cp-more .ri-add-line { display: none; }
body.rm-admin .cp-channel.is-open .cp-more .ri-subtract-line { display: inline; }
body.rm-admin .cp-channel.is-open .cp-more { transform: rotate(180deg); border-color: #16304d; color: #16304d; background: #f3f6f9; }
body.rm-admin .cp-more:focus-visible { outline: 2px solid var(--gold-strong, #b88937); outline-offset: 2px; }
body.rm-admin .cp-channel.is-unpublished .cp-name, body.rm-admin .cp-channel.is-unpublished .cp-row-price strong { color: #8a93a3; }
body.rm-admin .cp-channel.is-unpublished .cp-line-price { color: #9aa3b1; }
body.rm-admin .cp-chip { display: inline-flex; align-items: center; flex: 0 0 auto; height: 16px; padding: 0 6px; border-radius: 999px; font-size: 9.5px; font-weight: 700; letter-spacing: .01em; white-space: nowrap; }
body.rm-admin .cp-chip.is-off { color: #8a4d2b; background: #fff1e8; }
/* Expanded breakdown (one level): base after the modifier, each scenario, promotions. */
body.rm-admin .cp-detail { padding: 0 0 8px 16px; }
body.rm-admin .cp-detail[hidden] { display: none; }
body.rm-admin .cp-lines { display: grid; gap: 4px; margin: 0; padding: 0; list-style: none; }
body.rm-admin .cp-line { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "main price" "when price"; column-gap: 8px; align-items: baseline; }
body.rm-admin .cp-line-main { grid-area: main; display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 6px; min-width: 0; }
body.rm-admin .cp-line-label { color: #263b54; font-weight: 650; }
body.rm-admin .cp-line-detail { color: #7c8797; font-size: 10.5px; font-variant-numeric: tabular-nums; }
body.rm-admin .cp-tag { display: inline-flex; align-items: center; height: 15px; padding: 0 5px; border-radius: 4px; color: #8a6738; background: #faf3e5; font-size: 9.5px; font-weight: 750; letter-spacing: .02em; text-transform: uppercase; cursor: help; }
body.rm-admin .cp-line-when { grid-area: when; color: #8a93a3; font-size: 10.5px; }
body.rm-admin .cp-line.is-on .cp-line-when { color: var(--rm-success, #2e7d55); font-weight: 650; }
body.rm-admin .cp-line.is-on .cp-line-when::before, body.rm-admin .cp-line.is-best .cp-line-when::before { content: ""; display: inline-block; width: 6px; height: 6px; margin: 0 5px 1px 0; border-radius: 50%; background: var(--rm-success, #2e7d55); }
body.rm-admin .cp-line.is-best .cp-line-when { color: #1f5a3a; font-weight: 700; }
body.rm-admin .cp-line-price { grid-area: price; align-self: center; color: #263b54; font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
body.rm-admin .cp-line.is-on .cp-line-price { color: #16304d; }
body.rm-admin .cp-line.is-best .cp-line-price { color: #1f5a3a; font-weight: 800; }
body.rm-admin .cp-line.is-base .cp-line-label { color: #5a6878; font-weight: 650; }
body.rm-admin .cp-line.is-base .cp-line-price { color: #5a6878; }
body.rm-admin .cp-line.is-base.is-best .cp-line-price { color: #1f5a3a; }
body.rm-admin .cp-line.is-length .cp-line-price, body.rm-admin .cp-line.is-length .cp-line-label { color: #5a6878; }
body.rm-admin .cp-line.is-ineligible .cp-line-price { color: var(--rm-secondary, #9295a1); }
body.rm-admin .cp-line.is-promo .cp-line-label { color: #5a6878; font-weight: 600; }
body.rm-admin .cp-line.is-promo .cp-line-when { color: #8a6738; }
body.rm-admin .cp-line.is-none .cp-line-detail { color: #8a93a3; }
body.rm-admin .cp-note { margin: 6px 0 0; color: #8a93a3; font-size: 10.5px; line-height: 1.4; }
body.rm-admin .cp-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 6px; padding-top: 6px; border-top: 1px solid #edf0f3; }
body.rm-admin .cp-read { color: #8a93a3; font-size: 10.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
body.rm-admin .cp-read[title] { cursor: help; text-decoration: underline dotted #c3c8d1; text-underline-offset: 2px; }
body.rm-admin .cp-edit { flex: 0 0 auto; min-height: 0; padding: 2px 0; color: var(--rm-primary, #142f53); font-size: 11.5px; font-weight: 750; text-decoration: none; }
body.rm-admin .cp-edit:hover { text-decoration: underline; }
body.rm-admin .cp-edit:focus-visible { outline: 2px solid var(--gold-strong, #b88937); outline-offset: 2px; border-radius: 4px; }
/* Panel only: the long explanation behind a small disclosure. */
body.rm-admin .cp-how { margin-top: 4px; }
body.rm-admin .cp-how summary { display: inline-flex; align-items: center; gap: 4px; color: #7c8797; font-size: 10.5px; font-weight: 650; cursor: pointer; list-style: none; }
body.rm-admin .cp-how summary::-webkit-details-marker { display: none; }
body.rm-admin .cp-how summary::before { content: "›"; display: inline-block; transition: transform .12s ease; }
body.rm-admin .cp-how[open] summary::before { transform: rotate(90deg); }
body.rm-admin .cp-how .cp-note { margin-top: 4px; }

/* ---- Calendar cell: the lowest channel estimate as the price, the PriceLabs rate small (struck when higher) ---- */
body.rm-admin .calendar-rate.is-estimate { display: inline-flex; flex-direction: column; align-items: center; gap: 1px; max-width: 100%; line-height: 1; }
body.rm-admin .calendar-rate-list { color: #98a1ae; font-size: 9px; font-weight: 600; line-height: 1; text-decoration-color: #b4bcc7; font-variant-numeric: tabular-nums; }
body.rm-admin .calendar-rate-est { display: block; max-width: 100%; overflow: hidden; color: #16304d; font-size: 12px; font-weight: 750; line-height: 1; letter-spacing: -.01em; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
body.rm-admin .calendar-cell.is-closed .calendar-rate-est { color: #5a6878; }
body.rm-admin .calendar-cell.is-closed .calendar-rate-list { color: #a3abb7; }

/* ---- Action panel section (details, like the "Imóveis" picker just above it) ---- */
body.rm-admin .cp-panel[hidden] { display: none; }
body.rm-admin .cp-panel summary small { min-width: 0; height: 20px; padding: 0 8px; font-size: 11px; font-weight: 700; white-space: nowrap; }
body.rm-admin .cp-panel .cp-panel-body { padding: 0 12px 10px; }
body.rm-admin .cp-panel .cp-card { padding-top: 2px; }
body.rm-admin .cp-panel .cp-row { min-height: 42px; }
body.rm-admin .cp-panel .cp-more { width: 26px; height: 26px; }
body.rm-admin .cp-panel .cp-row { grid-template-columns: 9px minmax(0, 1fr) auto 26px; }
body.rm-admin.rm-ari-price-modal #cp-panel { margin-top: 4px; }
body.rm-admin.rm-ari-price-modal #cp-panel .cp-card { font-size: 12px; }

/* ---- Toolbar button (wide screens; phones keep the toolbar's single row and reach the editor from the panel's link) ---- */
body.rm-admin .cp-toolbar i { font-size: 16px; }
@media (max-width: 780px) { body.rm-admin .cp-toolbar { display: none; } }

/* ---- "Descontos dos canais" editor (built on .base-price-dialog) ---- */
body.rm-admin .cp-editor { display: flex; flex-direction: column; width: min(680px, calc(100vw - 28px)); max-height: min(90vh, 760px); overflow: hidden; }
body.rm-admin .cp-editor[open] { display: flex; }
body.rm-admin .cp-editor form { display: flex; flex-direction: column; min-height: 0; }
body.rm-admin .cp-editor .base-price-head { flex: 0 0 auto; }
/* The channel list scrolls on its own; title and actions (Salvar) stay in view. */
body.rm-admin .cp-ed-scroll { flex: 1 1 auto; min-height: 0; margin: 0 -6px 10px; padding: 2px 6px; overflow: auto; overscroll-behavior: contain; }
body.rm-admin .cp-ed-fields { display: grid; gap: 10px; min-width: 0; margin: 0; padding: 0; border: 0; }
body.rm-admin .cp-ed-actions, body.rm-admin .cp-editor .base-price-error { flex: 0 0 auto; }
body.rm-admin .cp-ed-fields:disabled { opacity: .6; }
body.rm-admin .cp-ed-channel { padding: 10px 12px 11px; border: 1px solid var(--rm-line, #e5e6e8); border-radius: 12px; background: #fafbfc; }
body.rm-admin .cp-ed-head { display: flex; align-items: center; gap: 8px; }
body.rm-admin .cp-ed-head h3 { margin: 0; color: var(--rm-heading, #303548); font-size: 13.5px; font-weight: 750; }
body.rm-admin .cp-ed-add { margin-left: auto; min-height: 30px; padding: 0 10px; font-size: 11.5px; }
body.rm-admin .cp-ed-add i { font-size: 15px; }
body.rm-admin .cp-ed-hint { margin: 7px 0 0; color: #6e5935; font-size: 11px; line-height: 1.45; }
body.rm-admin .cp-ed-rows { display: grid; gap: 6px; margin-top: 8px; }
body.rm-admin .cp-ed-rows:empty { display: none; }
body.rm-admin .cp-ed-row { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1.65fr) 74px 86px 34px; gap: 6px; align-items: end; }
body.rm-admin .cp-ed-row label { display: grid; gap: 3px; margin: 0; min-width: 0; color: var(--rm-secondary, #9295a1); font-size: 10.5px; font-weight: 600; }
body.rm-admin .cp-ed-row label > span { font-size: 10.5px; }
body.rm-admin .cp-ed-row input, body.rm-admin .cp-ed-row select { box-sizing: border-box; width: 100%; min-height: 36px; height: 36px; padding: 0 9px; border: 1px solid var(--rm-line, #e5e6e8); border-radius: 9px; color: var(--rm-heading, #303548); background: #fff; font: inherit; font-size: 13px; }
body.rm-admin .cp-ed-row select { padding-right: 6px; }
body.rm-admin .cp-ed-row input:focus, body.rm-admin .cp-ed-row select:focus { border-color: var(--gold-strong, #b88937); box-shadow: 0 0 0 3px rgba(210, 170, 97, .2); outline: 0; }
body.rm-admin .cp-ed-days.is-off { visibility: hidden; }
body.rm-admin .cp-ed-lead { grid-column: 1 / 3; }
body.rm-admin .cp-ed-components { grid-column: 3 / 5; }
body.rm-admin .cp-ed-lead[hidden], body.rm-admin .cp-ed-components[hidden] { display: none; }
body.rm-admin .cp-ed-remove { width: 34px; min-width: 34px; height: 36px; box-shadow: none; color: #6b7482; font-size: 17px; }
body.rm-admin .cp-ed-remove:hover { color: var(--rm-danger, #d94b48); border-color: #f2c6c6; background: #fff5f5; }
body.rm-admin .cp-ed-empty { margin: 8px 0 0; color: var(--rm-secondary, #9295a1); font-size: 11.5px; }
body.rm-admin .cp-ed-empty[hidden] { display: none; }
body.rm-admin .cp-ed-actions { align-items: center; }
body.rm-admin .cp-ed-meta { margin-right: auto; color: var(--rm-secondary, #9295a1); font-size: 11px; }
body.rm-admin .cp-editor .base-price-error:not(:empty) { padding: 8px 10px; border-radius: 8px; background: var(--rm-danger-soft, #ffe8e7); }
@media (max-width: 600px) {
  body.rm-admin .cp-ed-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 34px; grid-template-areas: "label label remove" "kind kind kind" "days percent percent" "lead lead lead" "components components components"; }
  body.rm-admin .cp-ed-row:has(.cp-ed-days.is-off) { grid-template-areas: "label label remove" "kind kind kind" "percent percent percent"; }
  body.rm-admin .cp-ed-row label:nth-child(1) { grid-area: label; }
  body.rm-admin .cp-ed-row label:nth-child(2) { grid-area: kind; }
  body.rm-admin .cp-ed-row .cp-ed-days { grid-area: days; }
  body.rm-admin .cp-ed-row .cp-ed-percent { grid-area: percent; }
  body.rm-admin .cp-ed-row .cp-ed-remove { grid-area: remove; }
  body.rm-admin .cp-ed-row .cp-ed-lead { grid-area: lead; }
  body.rm-admin .cp-ed-row .cp-ed-components { grid-area: components; }
  body.rm-admin .cp-ed-days.is-off { display: none; }
  body.rm-admin .cp-ed-row + .cp-ed-row { padding-top: 8px; border-top: 1px dashed var(--rm-line, #e5e6e8); }
  body.rm-admin .cp-ed-actions { flex-wrap: wrap; }
  body.rm-admin .cp-ed-meta { flex-basis: 100%; margin-bottom: 4px; }
}
@media (prefers-reduced-motion: no-preference) {
  body.rm-admin .cp-pop { animation: cp-pop-in .14s ease-out; }
  @keyframes cp-pop-in { from { opacity: 0; transform: translateY(3px); } to { opacity: 1; transform: none; } }
}

/* ---- FORMS-toolbar (owner, 28 Oct 2026): "Reserva direta" card of the editor (former Reservas -> "Reservas diretas"). ---- */
/* A closed editor is not drawn: ".cp-editor { display: flex }" above outranks the browser's dialog:not([open]) rule, so after a
   save/close the dialog stayed laid out on the page and caught clicks (a second opening could not be clicked). */
body.rm-admin .cp-editor:not([open]) { display: none; }
body.rm-admin .cp-ed-direct { padding: 10px 12px 12px; border: 1px solid #eadfc6; border-radius: 12px; background: #fffaf0; }
body.rm-admin .cp-ed-direct-mark { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; width: 22px; height: 22px; border-radius: 6px; background: var(--rm-primary, #193452); color: #e9c97f; font-size: 13px; }
body.rm-admin .cp-ed-direct-sub { margin-left: auto; color: var(--rm-secondary, #9295a1); font-size: 11px; }
/* One setting per row: sub-heading, then label | field (130 px), the help line under both. */
body.rm-admin .cp-ed-direct-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; margin-top: 8px; }
body.rm-admin .cp-ed-direct-group { min-width: 0; }
body.rm-admin .cp-ed-direct h4 { margin: 0 0 5px; color: var(--rm-heading, #303548); font-size: 11px; font-weight: 700; letter-spacing: .02em; text-transform: uppercase; }
body.rm-admin .cp-ed-direct label { display: grid; grid-template-columns: minmax(0, 1fr) 130px; align-items: center; gap: 3px 10px; margin: 0; min-width: 0; color: var(--rm-heading, #303548); font-size: 12px; font-weight: 600; }
body.rm-admin .cp-ed-direct label > small { grid-column: 1 / -1; }
body.rm-admin .cp-ed-direct label > small { color: var(--rm-text, #6d6f7a); font-size: 10.5px; font-weight: 500; line-height: 1.4; }
body.rm-admin .cp-ed-direct input, body.rm-admin .cp-ed-direct select { box-sizing: border-box; width: 100%; min-height: 36px; height: 36px; padding: 0 9px; border: 1px solid var(--rm-line, #e5e6e8); border-radius: 9px;
  color: var(--rm-heading, #303548); background: #fff; font: inherit; font-size: 12.5px; }
body.rm-admin .cp-ed-direct input:focus, body.rm-admin .cp-ed-direct select:focus { border-color: var(--gold-strong, #b88937); box-shadow: 0 0 0 3px rgba(210, 170, 97, .2); outline: 0; }
body.rm-admin .cp-ed-direct-rules { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; margin: 12px 0 6px; }
body.rm-admin .cp-ed-direct-rules h4 { margin: 0; }
body.rm-admin .cp-ed-direct-rules small { color: var(--rm-secondary, #9295a1); font-size: 10.5px; }
body.rm-admin .cp-ed-direct .cp-ed-direct-facts { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 6px; }
body.rm-admin .cp-ed-direct .cp-ed-direct-facts > div { min-height: 0; padding: 7px 9px; border: 1px solid #eadfc6; border-radius: 9px; background: #fff; }
body.rm-admin .cp-ed-direct-error { margin: 8px 0 0; padding: 8px 10px; border-radius: 8px; background: var(--rm-danger-soft, #ffe8e7); color: #b23836; font-size: 12px; }
body.rm-admin .cp-ed-direct-error[hidden] { display: none; }
@media (max-width: 600px) {
  body.rm-admin .cp-ed-direct input, body.rm-admin .cp-ed-direct select { height: 44px; min-height: 44px; font-size: 16px; }
}
/* Phones: the Imóveis "Descontos" button stays reachable as an icon beside the search (the direct settings live here now). */
@media (max-width: 780px) {
  body.rm-admin .toolbar .cp-toolbar { display: inline-flex; flex: 0 0 auto; width: 44px; min-width: 44px; height: 44px; min-height: 44px; padding: 0; }
  body.rm-admin .toolbar .cp-toolbar > span { display: none; }
}
