/* Residents suite (Maintenance, Rent & Renewals, Daily Jobs). Phase 0: the page header and the empty state.
   Spec: Fix Mds/residents-suite-phase0-spec.md.

   The page header is the app's shared blue-glass header (class "lp-page-header", defined once in
   index.html with every other page's header), so nothing here copies it. Colours come from the
   shell's tokens (--bg, --text, --border...), so light and dark follow the app's theme switch.
   Design rule: CLAUDE.md "New screens match the app's design"; checked by tests/design-rule.test.js. */

.res-page .res-body {
  flex: 1; min-height: 0; overflow-y: auto;
  padding: 22px 22px 40px;
  display: flex; flex-direction: column; align-items: center;
}
.res-page .res-mhead { display: none; }

.res-empty {
  width: 100%; max-width: 560px; margin-top: 40px;
  background: var(--bg);
  border: 1px solid var(--border2);
  border-radius: var(--radius-xl, 16px);
  box-shadow: var(--shadow-xs, 0 1px 2px rgba(24,24,27,0.04));
  padding: 32px 32px 28px;
  text-align: center;
  color: var(--text);
}
.res-empty-icon {
  width: 52px; height: 52px; margin: 0 auto 14px;
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  background: var(--accent-soft, rgba(37,99,235,0.08));
  color: var(--accent, #2563eb);
}
.res-empty-icon svg { width: 24px; height: 24px; }
.res-empty-badge {
  display: inline-block; margin-bottom: 10px;
  padding: 3px 10px; border-radius: 999px;
  font-size: 11px; font-weight: 600; letter-spacing: .02em;
  background: var(--bg3); color: var(--text2);
  border: 1px solid var(--border);
}
.res-empty-title {
  margin: 0 0 6px;
  font-family: var(--font-display); font-size: 20px; font-weight: 700; letter-spacing: -0.02em;
  color: var(--text);
}
.res-empty-lead { margin: 0 0 18px; font-size: 14px; line-height: 1.5; color: var(--text2); }
.res-empty-list {
  list-style: none; margin: 0; padding: 16px 0 0;
  border-top: 1px solid var(--border);
  text-align: left; display: flex; flex-direction: column; gap: 10px;
}
.res-empty-list li { display: flex; gap: 10px; align-items: flex-start; font-size: 13.5px; line-height: 1.45; color: var(--text2); }
.res-empty-list li svg { width: 16px; height: 16px; flex: none; margin-top: 2px; color: var(--accent, #2563eb); }

/* Phone: the app's phone pages drop the blue page header under the brand bar and put a large
   title at the top of the page (Tasks' .t-mhead look), so the Residents pages do the same. */
@media (max-width: 768px) {
  .res-page .topbar.res-topbar { display: none !important; }
  .res-page .res-body { padding: 12px 16px calc(96px + var(--safe-bottom, 0px)); align-items: stretch; }
  .res-page .res-mhead {
    display: block;
    font-size: 30px; font-weight: 800; letter-spacing: -.6px; line-height: 1.1;
    color: var(--text); padding: 4px 0 6px;
  }
  .res-empty { margin-top: 12px; padding: 24px 20px 22px; max-width: none; }
}

/* A big empty card sits in the middle of the space under the header and tools, not near the top
   (Reuven, 27 Nov 2026: "centre the 3 banners ... so they sit flush in the center of the screen").
   Every box between the page body and the card grows to fill the height, and the card's auto
   margins centre it both ways. Only pages showing an empty card change. */
.res-page .res-body:has(.res-empty) :has(.res-empty) {
  flex: 1 0 auto; display: flex; flex-direction: column; min-height: 0;
}
.res-page .res-body .res-empty { margin: auto; }
@media (max-width: 768px) {
  .res-page .res-body .res-empty { margin: auto 0; }
}

/* ── Rent & Renewals, Phase 1: the rent roll from the property management software ─────────────────────
   Spec: Fix Mds/residents-suite-phase1-spec.md §7. Shell tokens only, the app's card look and .btn. */
.res-roll { width: 100%; max-width: 1100px; display: flex; flex-direction: column; gap: 12px; color: var(--text); }
.res-roll .res-empty { align-self: center; }
.res-empty-actions { margin-top: 18px; display: flex; justify-content: center; }
.res-roll-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.res-stats { display: flex; gap: 10px; flex-wrap: wrap; }
.res-stat {
  min-width: 110px; padding: 10px 14px;
  background: var(--bg); border: 1px solid var(--border2);
  border-radius: var(--radius-xl, 16px); box-shadow: var(--shadow-xs, 0 1px 2px rgba(24,24,27,0.04));
}
.res-stat-v { font-family: var(--font-display); font-size: 18px; font-weight: 700; letter-spacing: -0.01em; color: var(--text); }
.res-stat-l { font-size: 12px; color: var(--text2); margin-top: 2px; }
.res-upload-btn { display: inline-flex; align-items: center; gap: 6px; }
.res-upload-btn svg { width: 16px; height: 16px; }
.res-roll-asof { font-size: 12.5px; color: var(--text2); }
.res-roll-msg { font-size: 13px; color: var(--text2); min-height: 0; }
.res-roll-msg:empty { display: none; }

.res-roll-table {
  background: var(--bg); border: 1px solid var(--border2);
  border-radius: var(--radius-xl, 16px); box-shadow: var(--shadow-xs, 0 1px 2px rgba(24,24,27,0.04));
  overflow: hidden;
}
.res-roll-row {
  display: grid; grid-template-columns: minmax(220px, 2fr) 1fr 1.2fr 1.4fr; gap: 12px; align-items: start;
  padding: 12px 16px; border-top: 1px solid var(--border); font-size: 13.5px; color: var(--text);
}
.res-with-bal .res-roll-row { grid-template-columns: minmax(220px, 2fr) 1fr 1.2fr 1.3fr 1.4fr; }
.res-roll-row:first-child { border-top: 0; }
.res-roll-head { background: var(--bg2); font-size: 12px; font-weight: 600; color: var(--text2); padding-top: 10px; padding-bottom: 10px; }
.res-name { font-weight: 600; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.res-sub { font-size: 12px; color: var(--text2); margin-top: 2px; }
.res-muted { color: var(--text3, var(--text2)); }
.res-owed { color: var(--danger); font-weight: 600; }
.res-badge {
  padding: 1px 8px; border-radius: 999px; font-size: 11px; font-weight: 600;
  background: var(--accent-soft); color: var(--accent);
}
.res-match { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 11.5px; background: var(--bg3); color: var(--text2); border: 1px solid var(--border); }
.res-match-matched, .res-match-unit_only { background: var(--accent-soft); color: var(--accent); border-color: transparent; }

.res-runs { background: var(--bg); border: 1px solid var(--border2); border-radius: var(--radius-xl, 16px); padding: 12px 16px; }
.res-runs-title { font-size: 12px; font-weight: 600; color: var(--text2); margin-bottom: 6px; }
.res-runs ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.res-runs li { display: flex; gap: 12px; font-size: 12.5px; color: var(--text2); }
.res-run-file { color: var(--text); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Phone: one card per resident, labels in front of each value. */
@media (max-width: 768px) {
  .res-roll { gap: 10px; }
  .res-roll-bar { flex-direction: column; align-items: stretch; }
  .res-stat { flex: 1; min-width: 0; }
  .res-upload-btn { justify-content: center; }
  .res-roll-table { background: transparent; border: 0; box-shadow: none; display: flex; flex-direction: column; gap: 10px; overflow: visible; }
  .res-roll-head { display: none; }
  .res-roll-row, .res-with-bal .res-roll-row {
    grid-template-columns: 1fr; gap: 6px;
    background: var(--bg); border: 1px solid var(--border2);
    border-radius: var(--radius-xl, 16px); box-shadow: var(--shadow-xs, 0 1px 2px rgba(24,24,27,0.04));
  }
  .res-roll-row > [data-label] { display: flex; justify-content: space-between; gap: 12px; text-align: right; }
  .res-roll-row > [data-label]::before { content: attr(data-label); color: var(--text2); font-size: 12px; text-align: left; }
}

/* ── Frosted glass look (Reuven, 26 Nov 2026) ────────────────────────────────────────────────────────────
   The look he approved for the guided setup tip, carried across every Residents tab: the same iOS frosted
   glass as the Inbox "Back to top" pill (the shell's shared --glass-* tokens, which already follow light and
   dark), solid blue pill buttons, and the Tasks and Inbox page feel (soft page, rounded glass cards, small
   uppercase captions). Scoped to .res-page so it wins over the per-tab files whatever their load order, and
   touches nothing outside the Residents pages. Tokens only: no colour is written here. */

/* The page: the Tasks grey with a faint blue wash, so the glass has something to frost.
   It sits on the whole page, not only the body under the header, so it runs up behind the
   floating header with no plain strip above it (Reuven, 27 Nov 2026). */
.res-page {
  background:
    radial-gradient(900px 560px at 8% -6%, var(--accent-soft), transparent 64%),
    radial-gradient(900px 560px at 8% -6%, var(--accent-soft), transparent 52%),
    radial-gradient(820px 520px at 100% 4%, var(--accent-soft), transparent 60%),
    radial-gradient(820px 520px at 100% 4%, var(--accent-soft), transparent 46%),
    radial-gradient(1000px 600px at 55% 110%, var(--accent-soft), transparent 62%),
    var(--bg2);
  background-attachment: fixed;
}

/* Glass surfaces. Cards that sit on the page are the firmer glass; panels that hold cards are lighter. */
.res-page .res-empty, .res-page .res-stat, .res-page .res-roll-table, .res-page .res-runs,
.res-page .mt-list, .res-page .mt-detail-card, .res-page .mt-card, .res-page .dj-job, .res-page .dj-wo {
  background: var(--glass-inner);
  -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
  border: 0;
  box-shadow: var(--glass-edge), var(--glass-shadow);
}
.res-page .res-empty, .res-page .res-roll-table, .res-page .res-runs, .res-page .mt-list, .res-page .mt-detail-card { border-radius: 24px; }
.res-page .res-stat { border-radius: 20px; }
.res-page .mt-card, .res-page .dj-job, .res-page .dj-wo { border-radius: 18px; }
.res-page .mt-col {
  background: var(--glass-fill);
  -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
  border: 0; border-radius: 24px;
  box-shadow: var(--glass-edge);
}
.res-page .mt-card, .res-page .mt-row, .res-page .dj-wo { transition: transform .18s ease, box-shadow .18s ease; }
.res-page .mt-card:hover, .res-page .dj-wo:hover {
  border: 0; transform: translateY(-1px);
  box-shadow: var(--glass-edge), var(--shadow-md);
}
.res-page .mt-card:active, .res-page .dj-wo:active { transform: scale(.99); }

/* Number tiles: the Tasks status-strip feel, a small uppercase caption under a big number. */
.res-page .res-stat { min-width: 120px; padding: 12px 16px 11px; }
.res-page .res-stat-v { font-size: 24px; line-height: 1.1; letter-spacing: -0.02em; }
.res-page .res-stat-l { margin-top: 4px; font-size: 10.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--text3, var(--text2)); }

/* Buttons: solid blue pills for the main action, quiet glass pills for the rest (the setup tip's pair). */
.res-page .btn { border-radius: 999px; padding-left: 16px; padding-right: 16px; }
.res-page .btn:not(.btn-primary) {
  background: var(--glass-inner); color: var(--text);
  border-color: transparent; box-shadow: var(--glass-edge);
}
.res-page .btn:not(.btn-primary):hover { background: var(--glass-inner); filter: brightness(.97); }
.res-page .btn-primary { background: var(--accent); border-color: var(--accent); box-shadow: var(--shadow-sm); }
.res-page .btn-primary:hover { background: var(--accent); filter: brightness(1.08); }
.res-page .btn.dj-icon { padding-left: 10px; padding-right: 10px; }

/* Board / List / Vendors and the Rent & Renewals switch: a glass segmented pill, the chosen one solid blue. */
.res-page .mt-tabs {
  background: var(--glass-fill);
  -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
  border: 0; box-shadow: var(--glass-edge); padding: 4px;
}
.res-page .mt-tab { padding: 7px 16px; }
.res-page .mt-tab.is-on { background: var(--accent); color: var(--bg); box-shadow: var(--shadow-sm); }

/* Search and filters: rounded glass fields. */
.res-page .mt-tools .form-input {
  border-radius: 999px; border-color: transparent;
  background: var(--glass-inner); box-shadow: var(--glass-edge);
  -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
}
.res-page .mt-panel .form-input { border-radius: 14px; }
/* Search and the filter dropdowns sit side by side on one line; search takes the spare room. */
.res-page .mt-tools { align-items: center; gap: 10px; margin-bottom: 4px; }
.res-page .mt-tools .mt-search { flex: 1 1 260px; max-width: 460px; width: auto; }
.res-page .mt-tools > .cs-wrap { flex: 0 0 auto; width: auto; min-width: 170px; }
.res-page .mt-tools > .cs-wrap .cs-btn, .res-page .mt-tools > select { width: 100%; }

/* Rent & Renewals switch lines up with the content under it (both sit in the same 1100px column). */
.res-page .res-mhead + .rr-switch, .res-page .rr-switch { margin-left: max(0px, calc((100% - 1100px) / 2)); }

/* The board's sideways scrollbar: thin and themed, so dark mode never shows a white strip. */
.res-page .mt-board { scrollbar-width: thin; scrollbar-color: var(--border2) transparent; }
.res-page .mt-board::-webkit-scrollbar { height: 8px; background: transparent; }
.res-page .mt-board::-webkit-scrollbar-track { background: transparent; }
.res-page .mt-board::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 999px; }

/* Board columns: the heading is a small caption with a glass count, like the Tasks board. */
.res-page .mt-col-head { padding: 12px 14px 6px; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--text3, var(--text2)); }
.res-page .mt-count, .res-page .dj-count { background: var(--glass-inner); box-shadow: var(--glass-edge); color: var(--text2); }
.res-page .mt-col-body { padding: 4px 10px 12px; gap: 10px; }

/* Lists: the header row is a caption line, rows lift on hover. */
.res-page .mt-list .mt-row, .res-page .res-roll-row { border-top-color: var(--border); }
.res-page .mt-list .mt-row-head, .res-page .res-roll-head {
  background: transparent; font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--text3, var(--text2));
}
.res-page .mt-list button.mt-row:hover { background: var(--glass-inner); }

/* Small chips stay as they were, just rounder; inner boxes (offers, plans) become light glass. */
.res-page .rr-offers li, .res-page .rc-plan li, .res-page .rc-queue li {
  background: var(--glass-inner); border-color: transparent; box-shadow: var(--glass-edge); border-radius: 16px;
}
.res-page .rr-offers li.is-chosen { background: var(--accent-soft); box-shadow: inset 0 0 0 1.5px var(--accent); }
.res-page .rr-warn { border-radius: 18px; }
.res-page .res-empty-icon { border-radius: 16px; background: var(--accent); color: var(--bg); box-shadow: var(--shadow-sm); }
.res-page .dj-progress-bar { height: 6px; background: var(--glass-inner); box-shadow: var(--glass-edge); }

/* Phone: every row is its own glass card (the Tasks phone list), with the big page title on top. */
@media (max-width: 768px) {
  .res-page .res-roll-table, .res-page .mt-list {
    background: transparent; box-shadow: none; border-radius: 0;
    -webkit-backdrop-filter: none; backdrop-filter: none;
  }
  .res-page .mt-list .mt-row, .res-page .res-roll-row, .res-page .res-with-bal .res-roll-row {
    background: var(--glass-inner);
    -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
    border: 0; border-radius: 20px; box-shadow: var(--glass-edge), var(--glass-shadow);
  }
  .res-page .mt-list .mt-row:first-child { border-top: 0; }
  .res-page .mt-col { background: transparent; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; border-radius: 0; }
  .res-page .mt-col-head { padding: 8px 4px 4px; }
  .res-page .mt-col-body { padding: 0; }
  .res-page .res-stat { min-width: 0; padding: 10px 12px; }
  .res-page .res-stat-v { font-size: 20px; }
  .res-page .mt-tab.is-on { box-shadow: none; }
}
