/* Property Manager (#agent/pm). Figma page "Property Manager v1", brought
   into the clean portal look on 2026-09-23: the same white rail as every
   other app (navy active item, no icons), the portal navy for primary
   actions and tabs, white cards on a light gray ground. Green stays only
   where it means money in or paid. Everything is scoped under .pm-app. */
.pm-app {
  --pm-accent: var(--brand, #1d2733); --pm-accent-ink: #fff; --pm-accent-soft: var(--brand-soft, #e3e8ef);
  --pm-green: #2e8540; --pm-green-hi: #256d34; --pm-green-lt: #e8f3ea; --pm-blue: #1c6dd0; --pm-blue-lt: #e7f0fb;
  --pm-red: #c0392b; --pm-red-lt: #fbeae8; --pm-amber: #b7791f; --pm-amber-lt: #fdf3e1;
  --pm-bg: #f4f6f8; --pm-card: #fff; --pm-line: #e1e5ea; --pm-line-2: #eef1f4; --pm-ink: #1f2933; --pm-mute: #637381;
  --pm-surface-2: #f7f9fa; --pm-soft: #eef1f4; --pm-line-strong: #b8c2cc; --pm-input-line: #c7d0d9; --pm-label: #3e4c59; --pm-faint: #9aa5b1;
  --pm-note-ink: #1f4f8f; --pm-note-line: #c9dcf5; --pm-todo-ink: #6b4a12; --pm-todo-line: #f1dcb3;
  display: grid; grid-template-columns: 236px minmax(0, 1fr); min-height: calc(100vh - 56px);
  background: var(--pm-bg); color: var(--pm-ink); font: 13.5px/1.45 -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, sans-serif; -webkit-font-smoothing: antialiased;
}
.pm-app *, .pm-app *::before, .pm-app *::after { box-sizing: border-box; }
.pm-app a { color: inherit; text-decoration: none; }
.pm-app svg.i { width: 16px; height: 16px; flex-shrink: 0; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.pm-app h1, .pm-app h2, .pm-app h3 { margin: 0; }

/* rail */
.pm-rail { background: var(--pm-card); border-right: 1px solid var(--pm-line); position: sticky; top: 56px; height: calc(100vh - 56px); overflow-y: auto; display: flex; flex-direction: column; gap: 1px; padding: 22px 14px 16px; }
.pm-brand { display: flex; align-items: center; gap: 9px; padding: 2px 10px 14px; }
.pm-brand a { flex: 1; font-size: 16px; font-weight: 600; color: var(--pm-ink) !important; }
.pm-iconbtn { width: 28px; height: 28px; border-radius: 7px; border: 0; background: transparent; color: var(--pm-faint); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.pm-iconbtn:hover { background: var(--pm-surface-2); color: var(--pm-ink); }
.pm-nav { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 8px; color: var(--pm-mute) !important; font-size: 13.5px; }
.pm-nav svg.i { display: none; }
.pm-nav:hover { background: var(--pm-surface-2); }
.pm-nav.on { background: var(--pm-accent); color: var(--pm-accent-ink) !important; font-weight: 600; }
.pm-rail-foot { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--pm-line); }
.pm-co { padding: 8px 10px 0; font-size: 12px; color: var(--pm-faint); }

/* top bar */
.pm-main { min-width: 0; display: flex; flex-direction: column; }
.pm-top { display: flex; align-items: center; gap: 14px; background: var(--pm-card); border-bottom: 1px solid var(--pm-line); padding: 10px 28px; position: sticky; top: 56px; z-index: 20; }
.pm-search { position: relative; display: flex; align-items: center; gap: 8px; background: var(--pm-soft); border-radius: 5px; padding: 0 12px; width: min(460px, 100%); color: var(--pm-mute); }
.pm-search input { border: 0; background: transparent; font: inherit; padding: 8px 0; width: 100%; color: var(--pm-ink); outline: none; }
.pm-results { position: absolute; top: calc(100% + 4px); left: 0; right: 0; background: var(--pm-card); border: 1px solid var(--pm-line); border-radius: 6px; box-shadow: 0 8px 24px rgba(15, 23, 42, .12); overflow: hidden; z-index: 40; }
.pm-result { display: flex; justify-content: space-between; gap: 10px; padding: 9px 12px; border-bottom: 1px solid var(--pm-line-2); color: var(--pm-ink) !important; }
.pm-result:hover { background: var(--pm-surface-2); }
.pm-result span { color: var(--pm-mute); font-size: 12px; }
.pm-top-r { margin-left: auto; position: relative; }
.pm-menu-scrim { position: fixed; inset: 0; z-index: 30; }
.pm-menu { position: absolute; right: 0; top: calc(100% + 6px); background: var(--pm-card); border: 1px solid var(--pm-line); border-radius: 6px; box-shadow: 0 8px 24px rgba(15, 23, 42, .14); padding: 6px; min-width: 200px; z-index: 31; display: flex; flex-direction: column; }
.pm-menu button { text-align: left; background: none; border: 0; font: inherit; padding: 7px 10px; border-radius: 4px; cursor: pointer; color: var(--pm-ink); }
.pm-menu button:hover { background: var(--pm-surface-2); }
.pm-menu hr { border: 0; border-top: 1px solid var(--pm-line); margin: 4px 0; }

.pm-body { padding: 22px 28px 40px; display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.pm-crumbs { font-size: 12.5px; color: var(--pm-mute); display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: -8px; }
.pm-crumbs a { color: var(--pm-blue) !important; font-weight: 500; }
.pm-sep { color: var(--pm-line-strong); }
.pm-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.pm-head h1 { font-size: 24px; font-weight: 700; letter-spacing: -.01em; overflow-wrap: anywhere; }
.pm-head > div:first-child, .pm-crumbs > * { min-width: 0; overflow-wrap: anywhere; }
.pm-sub { color: var(--pm-mute); margin-top: 4px; display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.pm-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.pm-wrap { flex-wrap: wrap; }
.pm-right { display: flex; justify-content: flex-end; margin-top: 12px; }
.pm-grow { flex: 1; }

/* buttons, pills */
.pm-btn { display: inline-flex; align-items: center; gap: 6px; font: inherit; font-weight: 600; font-size: 13px; padding: 7px 14px; border-radius: 4px; border: 1px solid var(--pm-line-strong); background: var(--pm-card); color: var(--pm-ink) !important; cursor: pointer; white-space: nowrap; line-height: 1.3; }
.pm-btn:hover { border-color: var(--pm-mute); background: var(--pm-surface-2); }
.pm-btn.pm-primary { background: var(--pm-accent); border-color: var(--pm-accent); color: var(--pm-accent-ink) !important; }
.pm-btn.pm-primary:hover { filter: brightness(1.15); }
.pm-btn.pm-danger { color: var(--pm-red) !important; border-color: #e3b5af; }
.pm-btn.pm-ghost { border-color: transparent; background: transparent; }
.pm-btn.pm-ghost:hover { background: var(--pm-soft); }
.pm-top .pm-btn.pm-ghost { color: var(--pm-accent) !important; }
.pm-btn.pm-small { padding: 4px 9px; font-size: 12px; }
.pm-btn[disabled] { opacity: .55; cursor: default; }
.pm-pill { display: inline-block; font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 10px; white-space: nowrap; background: var(--pm-soft); color: var(--pm-mute); }
.pm-pill.pm-green { background: var(--pm-green-lt); color: var(--pm-green); }
.pm-pill.pm-red { background: var(--pm-red-lt); color: var(--pm-red); }
.pm-pill.pm-amber { background: var(--pm-amber-lt); color: var(--pm-amber); }
.pm-pill.pm-blue { background: var(--pm-blue-lt); color: var(--pm-blue); }
.pm-link, .pm-app a.pm-link { color: var(--pm-blue) !important; font-weight: 500; cursor: pointer; }
.pm-link:hover { text-decoration: underline; }
.pm-link-t { color: var(--pm-blue); font-size: 12px; font-weight: 500; }
.pm-mute { color: var(--pm-mute); font-size: 12px; }
.pm-t-red { color: var(--pm-red); font-weight: 600; } .pm-t-green { color: var(--pm-green); font-weight: 600; }

/* tabs, filters */
.pm-tabs { display: flex; gap: 24px; border-bottom: 1px solid var(--pm-line); overflow-x: auto; }
.pm-tab { padding: 0 0 9px; color: var(--pm-mute) !important; font-size: 14px; border-bottom: 3px solid transparent; white-space: nowrap; margin-bottom: -1px; }
.pm-tab.on { color: var(--pm-ink) !important; font-weight: 600; border-bottom-color: var(--pm-accent); }
.pm-count { background: var(--pm-soft); border-radius: 9px; font-size: 11px; padding: 1px 6px; }
.pm-filters { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.pm-select, .pm-inl input { font: inherit; font-size: 13px; padding: 6px 10px; border: 1px solid var(--pm-input-line); border-radius: 4px; background: var(--pm-card); color: var(--pm-ink); }
.pm-inl { display: inline-flex; align-items: center; gap: 6px; color: var(--pm-mute); font-size: 12.5px; }
td .pm-select { padding: 3px 6px; font-size: 12px; }

/* cards, stats, grids */
.pm-card { background: var(--pm-card); border: 1px solid var(--pm-line); border-radius: 6px; padding: 16px 18px; min-width: 0; }
.pm-card p { overflow-wrap: anywhere; }
.pm-card-h { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.pm-card-h h3 { font-size: 15px; font-weight: 600; flex: 1; }
.pm-card-r { display: flex; gap: 8px; align-items: center; font-size: 12.5px; }
.pm-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 16px; }
.pm-stat { background: var(--pm-card); border: 1px solid var(--pm-line); border-radius: 6px; padding: 14px 18px; display: flex; flex-direction: column; gap: 3px; }
a.pm-stat:hover { border-color: var(--pm-line-strong); }
.pm-stat-l { font-size: 12px; color: var(--pm-mute); font-weight: 500; }
.pm-stat-v { font-size: 24px; font-weight: 700; letter-spacing: -.01em; }
.pm-stat-s { font-size: 12px; color: var(--pm-mute); font-weight: 500; }
.pm-stat-s.pm-t-red { color: var(--pm-red); } .pm-stat-s.pm-t-green { color: var(--pm-green); }
.pm-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.pm-split { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; align-items: start; }
.pm-side, .pm-stack { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.pm-foot { margin-top: -6px; }
.pm-note { background: var(--pm-blue-lt); color: var(--pm-note-ink); border-radius: 5px; padding: 9px 12px; margin: 0; font-size: 12.5px; }
.pm-todo { display: flex; align-items: center; gap: 10px; background: var(--pm-amber-lt); border: 1px solid var(--pm-todo-line); border-radius: 6px; padding: 10px 14px; color: var(--pm-todo-ink); }
.pm-todo span { flex: 1; }
.pm-kv { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 7px 12px; margin: 0; }
.pm-kv dt { color: var(--pm-mute); } .pm-kv dd { margin: 0; font-weight: 500; overflow-wrap: anywhere; }
.pm-person { padding: 6px 0; border-bottom: 1px solid var(--pm-line-2); }
.pm-person:last-child { border-bottom: 0; }
.pm-list { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 6px; }

/* tables */
.pm-tablewrap { overflow-x: auto; margin: 0 -18px; }
.pm-card > .pm-tablewrap:first-child, .pm-card > div > .pm-tablewrap:first-child { margin-top: -16px; }
.pm-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.pm-table th { text-align: left; font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--pm-mute); background: var(--pm-surface-2); padding: 9px 12px; border-bottom: 1px solid var(--pm-line); white-space: nowrap; }
.pm-table td { padding: 9px 12px; border-bottom: 1px solid var(--pm-line-2); vertical-align: middle; max-width: 360px; overflow-wrap: break-word; }
/* a pasted 500-character name must not push the other columns off the card */
.pm-table td:first-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pm-table th:first-child, .pm-table td:first-child { padding-left: 18px; }
.pm-table th:last-child, .pm-table td:last-child { padding-right: 18px; }
.pm-table tbody tr:hover td { background: var(--pm-surface-2); }
.pm-table tbody tr:last-child td { border-bottom: 0; }
.pm-table .r { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.pm-table tfoot td { border-top: 2px solid var(--pm-line); font-weight: 600; background: var(--pm-surface-2); }
.pm-table tr.pm-voided td { color: var(--pm-faint); text-decoration: line-through; }
.pm-table tr.pm-voided td .pm-btn, .pm-table tr.pm-voided td .pm-pill { text-decoration: none; }
.pm-stmt td { padding: 7px 12px; }
.pm-stmt tr.pm-sect td { font-weight: 700; background: var(--pm-surface-2); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--pm-mute); }
.pm-stmt tr.pm-tot td { font-weight: 600; border-top: 1px solid var(--pm-line); }
.pm-stmt tr.pm-grand td { font-weight: 700; font-size: 14px; border-top: 2px solid var(--pm-ink); }
.pm-empty { color: var(--pm-mute); padding: 18px 0; text-align: center; }
.pm-loading { color: var(--pm-mute); padding: 40px; text-align: center; }
.pm-error { background: var(--pm-red-lt); color: var(--pm-red); border-radius: 6px; padding: 12px 14px; display: flex; gap: 10px; align-items: center; }

/* charts */
.pm-chart { width: 100%; height: auto; display: block; }
.pm-axis { font-size: 10px; fill: var(--pm-faint); }
.pm-legend { font-size: 12px; color: var(--pm-mute); display: flex; gap: 8px; align-items: center; margin-top: 6px; flex-wrap: wrap; }
.pm-legend i { width: 10px; height: 10px; border-radius: 2px; display: inline-block; }
.pm-legend i.g { background: #2e8540; } .pm-legend i.b { background: #9bb5cf; }
.pm-hbars { display: flex; flex-direction: column; gap: 8px; }
.pm-hbar { display: grid; grid-template-columns: 170px minmax(0, 1fr) 90px; gap: 10px; align-items: center; font-size: 12.5px; }
.pm-hbar-t { background: var(--pm-soft); border-radius: 3px; height: 10px; overflow: hidden; }
.pm-hbar-t i { display: block; height: 100%; background: #9bb5cf; border-radius: 3px; }
.pm-hbar-v { text-align: right; color: var(--pm-mute); font-variant-numeric: tabular-nums; }

/* leasing board */
.pm-board { display: grid; grid-template-columns: repeat(5, minmax(180px, 1fr)); gap: 12px; overflow-x: auto; align-items: start; }
.pm-col { background: var(--pm-soft); border-radius: 6px; padding: 12px; display: flex; flex-direction: column; gap: 10px; min-height: 120px; }
.pm-col-h { font-weight: 600; display: flex; align-items: center; gap: 7px; }
.pm-col-h i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.pm-kcard { background: var(--pm-card); border: 1px solid var(--pm-line); border-radius: 6px; padding: 11px 12px; display: flex; flex-direction: column; gap: 4px; }
.pm-kact { display: flex; gap: 4px; align-items: center; flex-wrap: wrap; margin-top: 6px; }

/* reports */
.pm-repgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; align-items: start; }
.pm-rep { display: flex; flex-direction: column; gap: 2px; padding: 8px 0; border-bottom: 1px solid var(--pm-line-2); }
.pm-rep:last-child { border-bottom: 0; }
.pm-rep b { color: var(--pm-blue); font-weight: 500; }
.pm-rep span { color: var(--pm-mute); font-size: 12px; }

/* welcome */
.pm-welcome { max-width: 720px; padding: 10px 4px; display: flex; flex-direction: column; gap: 12px; }
.pm-welcome h2 { font-size: 20px; }
.pm-welcome p { margin: 0; color: var(--pm-mute); font-size: 14px; }
.pm-steps { margin: 6px 0 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }
.pm-setup { max-width: 640px; }

/* modal */
.pm-scrim { position: fixed; inset: 0; background: rgba(15, 23, 42, .4); z-index: 60; }
.pm-modal { position: fixed; z-index: 61; top: 50%; left: 50%; transform: translate(-50%, -50%); width: min(640px, calc(100vw - 32px)); max-height: calc(100vh - 48px); display: flex; flex-direction: column; background: var(--pm-card); border-radius: 8px; box-shadow: 0 20px 60px rgba(15, 23, 42, .25); }
.pm-modal header { display: flex; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--pm-line); }
.pm-modal header h2 { font-size: 17px; flex: 1; }
.pm-x { border: 0; background: none; font-size: 24px; line-height: 1; cursor: pointer; color: var(--pm-mute); }
.pm-modal-b { padding: 16px 20px; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; }
.pm-modal footer { display: flex; gap: 8px; padding: 12px 20px; border-top: 1px solid var(--pm-line); }
.pm-modal-sum { font-weight: 600; margin-top: 8px; }
.pm-rentnav { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.pm-rentnav b { font-size: 16px; }
.pm-modal .pm-tablewrap { margin: 0; border: 1px solid var(--pm-line); border-radius: 5px; max-height: 320px; }
.pm-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 14px; }
.pm-field { grid-column: 1 / -1; display: flex; flex-direction: column; gap: 4px; }
.pm-field.half { grid-column: auto; }
.pm-field label { font-size: 12px; font-weight: 600; color: var(--pm-label); }
.pm-field label b { color: var(--pm-red); }
.pm-field input, .pm-field select, .pm-field textarea { font: inherit; font-size: 13.5px; padding: 7px 10px; border: 1px solid var(--pm-input-line); border-radius: 4px; background: var(--pm-card); color: var(--pm-ink); width: 100%; }
.pm-field input:focus, .pm-field select:focus, .pm-field textarea:focus { outline: 2px solid var(--pm-accent-soft); border-color: var(--pm-accent); }
.pm-field small { color: var(--pm-mute); font-size: 11.5px; }
.pm-check { grid-column: 1 / -1; display: flex; align-items: center; gap: 8px; font-size: 13px; }
.pm-check.half { grid-column: auto; }
.pm-lines { display: flex; flex-direction: column; gap: 6px; }
.pm-line { display: grid; grid-template-columns: minmax(0, 2fr) 1fr 1fr; gap: 6px; }
.pm-budget { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 14px; max-height: 320px; overflow-y: auto; }
.pm-budget label { display: grid; grid-template-columns: minmax(0, 1fr) 110px; gap: 8px; align-items: center; font-size: 12.5px; }
.pm-budget input { padding: 5px 8px; border: 1px solid var(--pm-input-line); border-radius: 4px; font: inherit; }

@media (max-width: 1100px) { .pm-split { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 900px) {
  /* one column; rows sit at the top instead of stretching the menu strip
     to fill the page's min-height */
  .pm-app { grid-template-columns: 1fr; grid-template-rows: auto 1fr; align-content: start; }
  /* the rail becomes the same chip strip as every other app on a phone */
  .pm-rail { position: static; height: auto; flex-direction: row; overflow-x: auto; padding: 8px 16px; gap: 6px; border-right: 0; border-bottom: 1px solid var(--pm-line); scrollbar-width: none; }
  .pm-rail::-webkit-scrollbar { display: none; }
  .pm-brand, .pm-co { display: none; }
  .pm-rail-foot { display: contents; }
  .pm-nav { flex-shrink: 0; min-height: 34px; padding: 7px 14px; border-radius: 999px; background: var(--pm-surface-2); font-size: 13px; white-space: nowrap; }
  .pm-top { position: static; padding: 10px 16px; }
  .pm-body { padding: 16px; }
  .pm-grid { grid-template-columns: minmax(0, 1fr); }
  .pm-fields { grid-template-columns: 1fr; }
  .pm-field.half, .pm-check.half { grid-column: 1 / -1; }
  .pm-kv { grid-template-columns: 120px minmax(0, 1fr); }
}
@media print {
  .pm-rail, .pm-top, .pm-actions, .pm-filters, .pm-tabs, .pm-btn { display: none !important; }
  .pm-app { display: block; background: #fff; }
  .pm-card { border: 0; padding: 0; }
}

/* Resident Center controls */
.pm-todo-blue { background: var(--pm-blue-lt); border-color: var(--pm-note-line); color: var(--pm-note-ink); }
.pm-linkrow { display: flex; gap: 8px; }
.pm-linkrow input { flex: 1; font: inherit; font-size: 12.5px; padding: 8px 10px; border: 1px solid var(--pm-input-line); border-radius: 4px; background: var(--pm-surface-2); }
.pm-photos { display: flex; flex-wrap: wrap; gap: 8px; }

/* Dark mode: the agent workspace's theme switch (money.css --m-* dark
   values) reaches the Property Manager too; pm.js puts data-theme on
   .pm-app. The rail follows the other apps' dark rail. */
.pm-app[data-theme="dark"] {
  --pm-bg: #0d1117; --pm-card: #151b23; --pm-surface-2: #1c232c; --pm-soft: #1f2730; --pm-line: #27303a; --pm-line-2: #1f2730;
  --pm-ink: #e9edf2; --pm-mute: #a3adb9; --pm-faint: #6f7a86; --pm-line-strong: #3a4552; --pm-input-line: #3a4552; --pm-label: #c3cbd4;
  --pm-accent: var(--brand-dark, #6d92ba); --pm-accent-ink: #0d1117; --pm-accent-soft: #1d2733;
  --pm-green-lt: #12301f; --pm-blue: #6d9fe0; --pm-blue-lt: #1d2733; --pm-red: #f05a67; --pm-red-lt: #3a1520; --pm-amber: #f0b45a; --pm-amber-lt: #3a2a0c;
  --pm-note-ink: #a9c7ee; --pm-note-line: #2b3d55; --pm-todo-ink: #f0cf8f; --pm-todo-line: #5a4518;
  color-scheme: dark;
}
.pm-app[data-theme="dark"] .pm-pill.pm-green, .pm-app[data-theme="dark"] .pm-t-green, .pm-app[data-theme="dark"] .pm-stat-s.pm-t-green { color: #4cc26a !important; }
.pm-app[data-theme="dark"] .pm-btn.pm-danger { border-color: #6b2a30; }
.pm-app[data-theme="dark"] .pm-scrim { background: rgba(0, 0, 0, .6); }
