.workspace-main [hidden], .tenant-edit-modal [hidden] { display: none !important; }
.access-module-group th { background: #edf3f8; text-align: left; }
.access-console .access-permissions th { text-align: left; }

/* Payment history stays within its card; small screens show labelled records. */
#manager-payments-screen, #owner-payments-screen { min-width: 0; max-width: 100%; }
#manager-payments-screen > .panel, #owner-payments-screen > .panel { min-width: 0; }
.payment-history-table, .owner-payment-history { width: 100%; min-width: 0; table-layout: fixed; font-size: 14px; }
.payment-history-table th, .payment-history-table td,
.owner-payment-history th, .owner-payment-history td { padding: 12px 8px; vertical-align: top; overflow-wrap: anywhere; }
.payment-history-table th:nth-child(1), .owner-payment-history th:nth-child(1) { width: 11%; }
.payment-history-table th:nth-child(2), .owner-payment-history th:nth-child(2) { width: 21%; }
.payment-history-table th:nth-child(3), .owner-payment-history th:nth-child(3) { width: 15%; }
.payment-history-table th:nth-child(4), .owner-payment-history th:nth-child(4) { width: 11%; }
.payment-history-table th:nth-child(5), .owner-payment-history th:nth-child(5) { width: 11%; }
.payment-history-table th:nth-child(6), .owner-payment-history th:nth-child(6) { width: 10%; }
.payment-history-table th:nth-child(7), .owner-payment-history th:nth-child(7) { width: 12%; }
.payment-history-table th:nth-child(8), .owner-payment-history th:nth-child(8) { width: 9%; }
.payment-history-table th select, .owner-payment-history th select { width: 100%; min-width: 0; max-width: 100%; box-sizing: border-box; }
.payment-history-table td, .owner-payment-history td { white-space: normal !important; }
.payment-history-table td:first-child, .payment-history-table td:nth-child(4),
.owner-payment-history td:first-child, .owner-payment-history td:nth-child(4) { font-variant-numeric: tabular-nums; }
.payment-history-table .table-actions { flex-wrap: wrap; gap: 6px; }
.payment-history-table td:last-child button, .owner-payment-history td:last-child button { max-width: 100%; min-width: 0; padding: 6px 8px; font-size: 12px; line-height: 1.35; white-space: normal; overflow-wrap: anywhere; box-sizing: border-box; }
.payment-history-table .receipt-split-total { white-space: normal !important; }
@media (max-width: 900px) {
 .payment-history-table, .owner-payment-history,
 .payment-history-table thead, .owner-payment-history thead,
 .payment-history-table tbody, .owner-payment-history tbody { display: block; width: 100%; }
 .payment-history-table thead tr, .owner-payment-history thead tr { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); }
 .payment-history-table thead th, .owner-payment-history thead th { display: none; width: auto; }
 .payment-history-table thead th:nth-child(2), .payment-history-table thead th:nth-child(3),
 .owner-payment-history thead th:nth-child(2), .owner-payment-history thead th:nth-child(3) { display: block; width: auto; min-width: 0; box-sizing: border-box; }
 .payment-history-table tbody tr, .owner-payment-history tbody tr { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); padding: 10px 4px; border-bottom: 1px solid #dce4ed; }
 .payment-history-table tbody td, .owner-payment-history tbody td { display: block; min-width: 0; border: 0; padding: 8px; white-space: normal; }
 .payment-history-table tbody td::before, .owner-payment-history tbody td::before { content: attr(data-column-label); display: block; font-weight: 700; font-size: 12px; color: #5b6e84; margin-bottom: 4px; }
 .payment-history-table tbody td:nth-child(2), .owner-payment-history tbody td:nth-child(2) { grid-column: 1 / -1; grid-row: 1; }
 .payment-history-table tbody td:nth-child(7), .payment-history-table tbody td:nth-child(8),
 .owner-payment-history tbody td:nth-child(7), .owner-payment-history tbody td:nth-child(8),
 .payment-history-table tbody td[colspan], .owner-payment-history tbody td[colspan] { grid-column: 1 / -1; }
 .payment-history-table tbody td:last-child .table-actions { display: flex; }
 .payment-history-table tbody td:last-child button, .owner-payment-history tbody td:last-child button { width: auto; }
}

.payment-history-table.is-view-only th:nth-child(8), .payment-history-table.is-view-only td:nth-child(8),
.owner-payment-history.is-view-only th:nth-child(8), .owner-payment-history.is-view-only td:nth-child(8) { display: none; }
.payment-history-table.is-view-only th:nth-child(7), .owner-payment-history.is-view-only th:nth-child(7) { width: 21%; }
#manager-payments-screen .page-title, #owner-payments-screen .page-title { flex-wrap: wrap; gap: 12px; }
#manager-payments-screen .receipt-entry-actions { min-width: 0; max-width: 100%; }
#manager-payments-screen .receipt-entry-actions .button { max-width: 100%; white-space: normal; }

/* Scoped people directory: categories and immediate actions stay close to each record. */
#manager-users-screen{min-width:0}.user-directory .page-title h1{font-size:28px}.user-directory .page-title{align-items:start;margin-bottom:18px}.user-category-tabs{display:flex;flex-wrap:wrap;gap:8px;margin:16px 0}.user-category-tabs button{padding:9px 13px}.user-category-tabs button[aria-pressed=true]{background:#173c66;color:white;border-color:#173c66}.user-category-tabs span{margin-left:5px;opacity:.8}.user-directory-filters{display:grid;grid-template-columns:minmax(180px,2fr) repeat(3,minmax(120px,1fr));gap:12px;align-items:end}.user-directory-filters label{display:grid;gap:6px;min-width:0;font-size:14px}.user-directory-filters input,.user-directory-filters select{width:100%;min-width:0;box-sizing:border-box;padding:10px;border:1px solid #d5dfeb;border-radius:9px;font:inherit}.user-directory-filters>.action-row{grid-column:1/-1;margin:0}.user-directory-list{border-top:1px solid #dce4ee}.user-directory-row{display:grid;grid-template-columns:minmax(0,1.3fr) minmax(0,1fr) auto;gap:16px;align-items:center;padding:15px 0;border-bottom:1px solid #dce4ee}.user-directory-identity,.user-directory-lease{display:grid;gap:6px;min-width:0;overflow-wrap:anywhere}.user-directory-name{border:0;padding:0;background:none;text-align:left;color:#173c66;font:inherit;font-weight:700;cursor:pointer;overflow-wrap:anywhere}.user-directory-row-actions{display:flex;gap:8px;flex-wrap:wrap}.user-directory-row-actions .button{padding:9px 13px}.user-directory-pages{justify-content:center}.manager-user-dialog{width:min(1040px,calc(100vw - 32px));max-height:90vh;box-sizing:border-box;border:1px solid #cbd8e5;border-radius:20px;padding:0;color:#173c66;background:white}.manager-user-dialog::backdrop{background:#10203399}.manager-user-dialog .manager-user-detail{margin:0;border:0;padding:20px;border-radius:0}.manager-user-dialog .manager-user-detail>.page-title{position:sticky;top:-20px;z-index:2;background:white;padding:16px 0;margin-top:-16px;border-bottom:1px solid #dce4ee}.manager-user-dialog .manager-user-detail h1{font-size:26px}.manager-user-dialog .manager-user-detail .page-title p:not(.eyebrow){display:none}.manager-household-panel{padding:14px 0;border-bottom:1px solid #dce4ee;margin-bottom:16px}.manager-household-panel summary{font-weight:700;cursor:pointer}.manager-household-panel input,.manager-household-panel select{max-width:100%;box-sizing:border-box}.manager-household-panel label{display:grid;gap:6px;margin:10px 0}#manager-tenant-edit-modal .tenant-edit-modal-card>.page-title{position:sticky;top:-24px;background:white;z-index:2;padding:12px 0;margin-top:-12px;border-bottom:1px solid #dce4ee}#manager-tenant-edit-modal-form>.action-row{position:sticky;bottom:-24px;background:white;padding:12px 0;z-index:2;border-top:1px solid #dce4ee}
@media(max-width:900px){.user-directory-filters{grid-template-columns:1fr 1fr}.user-directory-row{grid-template-columns:minmax(0,1fr) auto}.user-directory-lease{grid-column:1}.user-directory-row-actions{grid-column:2;grid-row:1/3}.user-directory .page-title{flex-wrap:wrap}.manager-user-dialog .manager-user-detail>.page-title{flex-wrap:wrap}.manager-user-dialog .manager-detail-actions{flex-wrap:wrap}}
@media(max-width:520px){.user-directory-filters{grid-template-columns:1fr}.user-directory-row{grid-template-columns:1fr;gap:10px}.user-directory-row-actions{grid-column:1;grid-row:auto}.user-category-tabs button{flex:1 1 110px}.manager-user-dialog{width:calc(100vw - 16px);max-height:94vh}.manager-user-dialog .manager-user-detail{padding:14px}.manager-user-dialog .manager-user-detail-grid{grid-template-columns:1fr}.manager-user-dialog .manager-user-detail>.page-title{top:-14px}.user-directory .page-title h1{font-size:24px}}
.tenant-workspace-navigation{padding:16px 22px;margin-bottom:14px}.tenant-workspace-navigation h2{margin:0 0 8px;font-size:20px}.tenant-workspace-navigation .action-row{margin:0}.tenant-workspace-navigation button[aria-pressed=true]{background:#173c66;color:white}.user-directory-row-actions{max-width:240px}
#manager-tenant-edit-modal .page-title p:not(.eyebrow){display:none}#manager-tenant-edit-modal [data-close-manager-tenant-modal]{border:1px solid #d5dfeb;border-radius:18px;background:white;color:#173c66;padding:8px 12px;font:inherit}

/* Keep Sites cards inside the tenant workspace on narrow screens. */
#manager-sites-grid,.manager-sites-stack{min-width:0;grid-template-columns:minmax(0,1fr)}
#manager-sites-grid .manager-site-grid{grid-template-columns:repeat(auto-fit,minmax(min(280px,100%),1fr))}
#manager-sites-grid .site-card{min-width:0;overflow-wrap:anywhere}
