/* IMOVEIS-locks (owner, 24 Oct 2026): Imóveis absorbs the Fechaduras page. The Fechadura column (status dot + battery),
   the row's emergency-code copy button beside the pencil, the "Fechaduras sem imóvel" line and the Imóvel "Fechadura" card.
   Theme tokens only (--rm-*), so the RM navy/gold theme applies. Loaded after imoveis-pricing.css; every rule is scoped to
   the new classes or to the two columns this release changed (lock replaces code, the Airbnb column is gone). */

/* ---- Imóveis table ---------------------------------------------------------------------------------------- */
body.rm-admin .pms-property-table { min-width: 940px; }
body.rm-admin .pms-property-table .pms-col-lock { width: 136px; }
body.rm-admin .pms-property-table .pms-col-edit { width: 90px; }
body.rm-admin .pms-lock { display: inline-flex; align-items: center; gap: 8px; max-width: 100%; vertical-align: middle; }
body.rm-admin .pms-lock-state { display: inline-flex; align-items: center; gap: 6px; min-width: 0; color: var(--rm-heading); font-weight: 600; }
body.rm-admin .pms-lock-dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--rm-secondary); box-shadow: 0 0 0 3px rgba(23, 53, 84, .06); }
body.rm-admin .pms-lock-state.is-online .pms-lock-dot { background: var(--rm-success); box-shadow: 0 0 0 3px var(--rm-success-soft); }
body.rm-admin .pms-lock-state.is-offline { color: #b23836; }
body.rm-admin .pms-lock-state.is-offline .pms-lock-dot { background: var(--rm-danger); box-shadow: 0 0 0 3px var(--rm-danger-soft); }
body.rm-admin .pms-lock-state.is-unknown { color: #96661d; }
body.rm-admin .pms-lock-state.is-unknown .pms-lock-dot { background: var(--rm-warning); box-shadow: 0 0 0 3px var(--rm-warning-soft); }
body.rm-admin .pms-lock-state.is-unmapped { color: var(--rm-secondary); font-weight: 500; }
body.rm-admin .pms-lock-battery { display: inline-flex; flex: none; align-items: center; gap: 2px; padding: 1px 7px 1px 5px; border-radius: 999px; color: var(--rm-text); background: #f1f2f6; font-size: 11.5px; font-weight: 650; line-height: 18px; font-variant-numeric: tabular-nums; }
body.rm-admin .pms-lock-battery i { font-size: 13px; }
body.rm-admin .pms-lock-battery.is-success { color: #367849; background: var(--rm-success-soft); }
body.rm-admin .pms-lock-battery.is-warning { color: #96661d; background: var(--rm-warning-soft); }
body.rm-admin .pms-lock-battery.is-danger { color: #b23836; background: var(--rm-danger-soft); }
body.rm-admin .pms-prop-actions { display: inline-flex; align-items: center; justify-content: flex-end; gap: 4px; }
body.rm-admin .pms-prop-edit .pms-prop-copy i { color: var(--rm-accent); transition: color .15s ease; }
body.rm-admin .pms-prop-edit .pms-prop-copy.is-copied { background: var(--rm-success-soft); }
body.rm-admin .pms-prop-edit .pms-prop-copy.is-copied i { color: #367849; }
body.rm-admin .pms-prop-edit .pms-prop-copy.is-copy-failed { background: var(--rm-danger-soft); }
body.rm-admin .pms-prop-edit .pms-prop-copy.is-copy-failed i { color: #b23836; }

/* ---- Fechaduras without a PMS apartment (rare): one quiet line above the table ------------------------------ */
body.rm-admin .property-lock-orphans { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin: 0 0 12px; padding: 8px 12px; border: 1px solid var(--rm-line); border-radius: 10px; color: var(--rm-text); background: var(--rm-paper); font-size: 12.5px; }
body.rm-admin .property-lock-orphans.hidden { display: none; }
body.rm-admin .property-lock-orphans-label { display: inline-flex; align-items: center; gap: 6px; margin-right: 4px; color: var(--rm-secondary); font-weight: 600; }
body.rm-admin .property-lock-orphans-label i { color: var(--rm-accent); font-size: 15px; }
body.rm-admin .property-lock-orphan { display: inline-flex; align-items: center; gap: 8px; min-height: 28px; padding: 2px 10px; border: 1px solid var(--rm-line); border-radius: 999px; color: var(--rm-text); background: #fff; font: inherit; cursor: pointer; }
body.rm-admin .property-lock-orphan:hover { border-color: var(--rm-accent); }
body.rm-admin .property-lock-orphan:focus-visible { outline: 2px solid var(--rm-primary); outline-offset: 1px; }
body.rm-admin .property-lock-orphan strong { color: var(--rm-heading); font-weight: 700; }

/* ---- Imóvel: Fechadura card ----------------------------------------------------------------------------- */
body.rm-admin .property-lock-card.hidden { display: none; }
body.rm-admin .property-lock-card { margin-top: 16px; }
body.rm-admin .property-lock-facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px 18px; margin: 0; }
body.rm-admin .property-lock-facts > div { min-width: 0; padding: 10px 12px; border: 1px solid var(--rm-line); border-radius: 10px; background: var(--rm-paper); }
body.rm-admin .property-lock-facts small { display: block; margin-bottom: 3px; color: var(--rm-text); font-size: 12px; }
body.rm-admin .property-lock-facts strong { display: block; color: var(--rm-heading); font-size: 14px; font-weight: 650; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
body.rm-admin .property-lock-facts strong.is-success { color: #367849; }
body.rm-admin .property-lock-facts strong.is-warning { color: #96661d; }
body.rm-admin .property-lock-facts strong.is-danger { color: #b23836; }
body.rm-admin .property-lock-card .modal-actions { margin-top: 14px; padding-top: 0; border-top: 0; }

/* ---- Phones: the row card gets the lock on its third line (right of the price), the key button beside the pencil ---- */
@media (max-width: 780px) {
  body.rm-admin .pms-property-table { min-width: 0; }
  body.rm-admin .pms-property-table tbody tr { grid-template-areas: "sel unit unit unit status edit" "sel stay stay stay occupancy adr" "sel price price lock lock lock"; column-gap: 8px; }
  body.rm-admin .pms-property-table td.pms-prop-lock { grid-area: lock; justify-self: end; min-width: 0; }
  body.rm-admin .pms-prop-actions { gap: 2px; }
  body.rm-admin .pms-prop-edit .pms-prop-actions .icon-button { width: 28px; min-width: 28px; height: 28px; }
  /* the cell (overflow hidden in property-redesign.css) must not be narrower than its two buttons */
  body.rm-admin .pms-property-table td.pms-prop-edit { overflow: visible; min-width: max-content; }
  body.rm-admin .property-lock-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  body.rm-admin .property-lock-card .modal-actions .button { width: 100%; justify-content: center; }
}
