/* SwiftTenant theme (dark mode). Loaded right after Bootstrap by Site.Master.
   Light values below equal the original hard-coded colors, so light mode is unchanged.
   The theme is set on <html data-bs-theme> by the inline script at the top of Site.Master <head>
   (localStorage "pm-theme": system | light | dark). Printing always switches to light. */
:root {
    --pm-page-bg: #f8fafc;
    --pm-bd-334155: #334155;
    --pm-bd-cbd5e1: #cbd5e1;
    --pm-bd-ced4da: #ced4da;
    --pm-bd-cfd4da: #cfd4da;
    --pm-bd-d9a3a8: #d9a3a8;
    --pm-bd-dee2e6: #dee2e6;
    --pm-bd-e2e8f0: #e2e8f0;
    --pm-bd-f0f1f3: #f0f1f3;
    --pm-bd-f1f3f5: #f1f3f5;
    --pm-bg-cbd5e1: #cbd5e1;
    --pm-bg-dcfce7: #dcfce7;
    --pm-bg-e2e8f0: #e2e8f0;
    --pm-bg-e7f1ff: #e7f1ff;
    --pm-bg-e9ecef: #e9ecef;
    --pm-bg-ede9fe: #ede9fe;
    --pm-bg-eef1f5: #eef1f5;
    --pm-bg-f1f5f9: #f1f5f9;
    --pm-bg-fcfcfd: #fcfcfd;
    --pm-bg-fde8e8: #fde8e8;
    --pm-bg-fef3c7: #fef3c7;
    --pm-bg-fff7ed: #fff7ed;
    --pm-fg-15803d: #15803d;
    --pm-fg-166534: #166534;
    --pm-fg-198754: #198754;
    --pm-fg-1e40af: #1e40af;
    --pm-fg-2563eb: #2563eb;
    --pm-fg-334: #334;
    --pm-fg-334155: #334155;
    --pm-fg-475569: #475569;
    --pm-fg-495057: #495057;
    --pm-fg-5b21b6: #5b21b6;
    --pm-fg-64748b: #64748b;
    --pm-fg-6c757d: #6c757d;
    --pm-fg-8a94a6: #8a94a6;
    --pm-fg-92400e: #92400e;
    --pm-fg-9a3412: #9a3412;
    --pm-fg-b02a37: #b02a37;
    --pm-fg-b91c1c: #b91c1c;
    --pm-fg-dc2626: #dc2626;
    --pm-fg-dc3545: #dc3545;
    --pm-bd-cccccc: #cccccc;
    --pm-bd-d1d5db: #d1d5db;
    --pm-bd-e5e7eb: #e5e7eb;
    --pm-bd-e6e6e6: #e6e6e6;
    --pm-bd-eef0f3: #eef0f3;
    --pm-bg-d1d5db: #d1d5db;
    --pm-bg-dbeafe: #dbeafe;
    --pm-bg-e5e7eb: #e5e7eb;
    --pm-bg-e9e9e9: #e9e9e9;
    --pm-bg-eee: #eee;
    --pm-bg-eef2f7: #eef2f7;
    --pm-bg-eff6ff: #eff6ff;
    --pm-bg-f3f4f6: #f3f4f6;
    --pm-bg-f4f6f8: #f4f6f8;
    --pm-bg-f8f9fa: #f8f9fa;
    --pm-bg-f8fafc: #f8fafc;
    --pm-bg-f9fafb: #f9fafb;
    --pm-bg-fff: #fff;
    --pm-bg-ffffff: #ffffff;
    --pm-bg-white: white;
    --pm-fg-111827: #111827;
    --pm-fg-1a202c: #1a202c;
    --pm-fg-1d4ed8: #1d4ed8;
    --pm-fg-1e3a8a: #1e3a8a;
    --pm-fg-1f2937: #1f2937;
    --pm-fg-212529: #212529;
    --pm-fg-2d3748: #2d3748;
    --pm-fg-333: #333;
    --pm-fg-374151: #374151;
    --pm-fg-4a5568: #4a5568;
    --pm-fg-4b5563: #4b5563;
    --pm-fg-6b7280: #6b7280;
    --pm-fg-999999: #999999;
    --pm-fg-9ca3af: #9ca3af;
}
[data-bs-theme=dark] {
    --pm-page-bg: #16191d;
    --pm-bd-334155: #adb5bd;
    --pm-bd-cbd5e1: #495057;
    --pm-bd-ced4da: #495057;
    --pm-bd-cfd4da: #495057;
    --pm-bd-d9a3a8: #6b3a3f;
    --pm-bd-dee2e6: #3d434a;
    --pm-bd-e2e8f0: #3d434a;
    --pm-bd-f0f1f3: #3d434a;
    --pm-bd-f1f3f5: #3d434a;
    --pm-bg-cbd5e1: #495057;
    --pm-bg-dcfce7: #17331f;
    --pm-bg-e2e8f0: #495057;
    --pm-bg-e7f1ff: #1c2b45;
    --pm-bg-e9ecef: #343a40;
    --pm-bg-ede9fe: #2c2447;
    --pm-bg-eef1f5: #2b3035;
    --pm-bg-f1f5f9: #343a40;
    --pm-bg-fcfcfd: #2b3035;
    --pm-bg-fde8e8: #3d1f22;
    --pm-bg-fef3c7: #3d3214;
    --pm-bg-fff7ed: #3b2a1a;
    --pm-fg-15803d: #6ee7a0;
    --pm-fg-166534: #6ee7a0;
    --pm-fg-198754: #5cc98a;
    --pm-fg-1e40af: #93b4f5;
    --pm-fg-2563eb: #6ea8fe;
    --pm-fg-334: #f1f3f5;
    --pm-fg-334155: #dee2e6;
    --pm-fg-475569: #dee2e6;
    --pm-fg-495057: #dee2e6;
    --pm-fg-5b21b6: #c4b5fd;
    --pm-fg-64748b: #adb5bd;
    --pm-fg-6c757d: #adb5bd;
    --pm-fg-8a94a6: #adb5bd;
    --pm-fg-92400e: #fcd34d;
    --pm-fg-9a3412: #fdba74;
    --pm-fg-b02a37: #f28b94;
    --pm-fg-b91c1c: #f28b94;
    --pm-fg-dc2626: #f87171;
    --pm-fg-dc3545: #ea868f;
    --pm-bd-cccccc: #495057;
    --pm-bd-d1d5db: #495057;
    --pm-bd-e5e7eb: #3d434a;
    --pm-bd-e6e6e6: #3d434a;
    --pm-bd-eef0f3: #3d434a;
    --pm-bg-d1d5db: #495057;
    --pm-bg-dbeafe: #1c2b45;
    --pm-bg-e5e7eb: #343a40;
    --pm-bg-e9e9e9: #343a40;
    --pm-bg-eee: #343a40;
    --pm-bg-eef2f7: #343a40;
    --pm-bg-eff6ff: #1c2b45;
    --pm-bg-f3f4f6: #343a40;
    --pm-bg-f4f6f8: #2b3035;
    --pm-bg-f8f9fa: #2b3035;
    --pm-bg-f8fafc: #2b3035;
    --pm-bg-f9fafb: #2b3035;
    --pm-bg-fff: #212529;
    --pm-bg-ffffff: #212529;
    --pm-bg-white: #212529;
    --pm-fg-111827: #f1f3f5;
    --pm-fg-1a202c: #f1f3f5;
    --pm-fg-1d4ed8: #93b4f5;
    --pm-fg-1e3a8a: #93b4f5;
    --pm-fg-1f2937: #f1f3f5;
    --pm-fg-212529: #f1f3f5;
    --pm-fg-2d3748: #f1f3f5;
    --pm-fg-333: #f1f3f5;
    --pm-fg-374151: #dee2e6;
    --pm-fg-4a5568: #dee2e6;
    --pm-fg-4b5563: #dee2e6;
    --pm-fg-6b7280: #adb5bd;
    --pm-fg-999999: #adb5bd;
    --pm-fg-9ca3af: #adb5bd;
}

/* Dark mode: Bootstrap utilities that are fixed light in 5.3 follow the theme. Light mode is untouched. */
[data-bs-theme=dark] .bg-white { background-color: var(--bs-body-bg) !important; }
[data-bs-theme=dark] .bg-light { background-color: var(--bs-tertiary-bg) !important; }
[data-bs-theme=dark] .text-dark:not([class*="bg-warning"]):not([class*="bg-info"]):not([class*="btn-warning"]):not([class*="btn-info"]) { color: var(--bs-body-color) !important; }
[data-bs-theme=dark] .bg-warning .text-dark, [data-bs-theme=dark] .bg-info .text-dark { color: #212529 !important; }
[data-bs-theme=dark] .table-light { --bs-table-color: var(--bs-emphasis-color); --bs-table-bg: var(--bs-tertiary-bg); --bs-table-border-color: var(--bs-border-color); --bs-table-striped-bg: var(--bs-secondary-bg); --bs-table-hover-bg: var(--bs-secondary-bg); color: var(--bs-emphasis-color); border-color: var(--bs-border-color); }
[data-bs-theme=dark] .btn-light { --bs-btn-color: var(--bs-body-color); --bs-btn-bg: var(--bs-secondary-bg); --bs-btn-border-color: var(--bs-border-color); --bs-btn-hover-color: var(--bs-emphasis-color); --bs-btn-hover-bg: #495057; --bs-btn-hover-border-color: #6c757d; --bs-btn-active-bg: #495057; --bs-btn-active-color: var(--bs-emphasis-color); }
[data-bs-theme=dark] .btn-outline-dark { --bs-btn-color: var(--bs-body-color); --bs-btn-border-color: #6c757d; --bs-btn-hover-color: #fff; --bs-btn-hover-bg: #495057; --bs-btn-hover-border-color: #6c757d; --bs-btn-active-bg: #495057; --bs-btn-active-color: #fff; }
[data-bs-theme=dark] .btn-close { filter: var(--bs-btn-close-white-filter); }
[data-bs-theme=dark] .modal .modal-content, [data-bs-theme=dark] .dropdown-menu { color: var(--bs-body-color); }
[data-bs-theme=dark] input::placeholder, [data-bs-theme=dark] textarea::placeholder { color: #8b949e; }

/* Theme picker (account menu and Settings): System / Light / Dark segmented buttons. */
.pm-theme-seg { display: flex; gap: 4px; padding: 3px; border-radius: 10px; background: var(--pm-bg-f3f4f6); }
.pm-theme-seg button { flex: 1 1 0; min-width: 0; border: 0; border-radius: 8px; padding: 6px 4px; font-size: .85rem; font-weight: 600; background: transparent; color: var(--pm-fg-374151); line-height: 1.2; }
.pm-theme-seg button.active { background: #2563eb; color: #fff; }
.pm-theme-row { padding: .5rem .9rem .6rem; }
.pm-theme-row > span { display: block; font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--pm-fg-6b7280); margin-bottom: 4px; }

/* ===== Stage 3: Dashboard (Default.aspx), Reports.aspx and report pages (Balance Sheet, Statement of Activity,
   Capital Improvements, Tax Report). Screen only: print, PDFs and emails stay light. Text uses #dee2e6 / #adb5bd
   (no dim grays on dark). ===== */
@media screen {
/* Dashboard */
[data-bs-theme=dark] .dashboard-container { background-color: var(--pm-page-bg, #16191d); }
[data-bs-theme=dark] .main-title, [data-bs-theme=dark] .section-subtitle, [data-bs-theme=dark] .card-text,
[data-bs-theme=dark] .dash-title-link, [data-bs-theme=dark] .dash-strong, [data-bs-theme=dark] .task-name,
[data-bs-theme=dark] .details-grid, [data-bs-theme=dark] #modalTitle:not([style]) { color: #dee2e6; }
[data-bs-theme=dark] .alert-card, [data-bs-theme=dark] .task-group-disclosure, [data-bs-theme=dark] .nested-task-list-wrapper,
[data-bs-theme=dark] .details-grid tr.dash-row { background: #2b3035; border-color: #3d434a !important; }
[data-bs-theme=dark] .details-grid tr.dash-row td { border-color: #3d434a !important; }
[data-bs-theme=dark] .task-row { border-bottom-color: #3d434a; }
[data-bs-theme=dark] .btn-review { background: #495057; color: #fff; }
[data-bs-theme=dark] .details-modal, [data-bs-theme=dark] .details-modal-footer { background: #212529; border-color: #3d434a; }
[data-bs-theme=dark] #modalTitle { background: #343a40; color: #fff; }
[data-bs-theme=dark] .details-modal-footer .btn-review { background: #495057; color: #fff; border-color: #6c757d; }
[data-bs-theme=dark] .details-modal-footer .btn-review:hover { background: #5c636a; }
[data-bs-theme=dark] .modal-filter, [data-bs-theme=dark] .alert-search-box { background: #2b3035; color: #dee2e6; border-color: #495057; }
[data-bs-theme=dark] .modal-filter-wrap i, [data-bs-theme=dark] .clear-icon { color: #adb5bd; }
[data-bs-theme=dark] .clear-icon:hover { color: #fff; }
[data-bs-theme=dark] .dash-link, [data-bs-theme=dark] .dash-title-link:hover { color: #93c5fd; }
[data-bs-theme=dark] .dash-link:hover, [data-bs-theme=dark] .dash-link:focus { color: #bfdbfe; }
[data-bs-theme=dark] .dash-chip { background: #1c2b45; color: #c7d2fe !important; }
[data-bs-theme=dark] .dash-chip:hover, [data-bs-theme=dark] .dash-chip:focus { background: #26375a; color: #e0e7ff !important; }
[data-bs-theme=dark] .dash-chip-muted, [data-bs-theme=dark] .pill-slate, [data-bs-theme=dark] .priority-Low,
[data-bs-theme=dark] .status-pill { background: #343a40; color: #dee2e6 !important; border-color: #495057; }
[data-bs-theme=dark] .dash-muted, [data-bs-theme=dark] .dash-wo-num, [data-bs-theme=dark] .details-grid th,
[data-bs-theme=dark] .details-grid td::before, [data-bs-theme=dark] #noResultsMessage { color: #adb5bd !important; }
[data-bs-theme=dark] .task-name.done { color: #8b949e; }
[data-bs-theme=dark] .dash-amount { color: #f87171; }
[data-bs-theme=dark] .dash-plain, [data-bs-theme=dark] .dash-plain a, [data-bs-theme=dark] .details-grid a[href^="tel:"] { color: #dee2e6 !important; }
[data-bs-theme=dark] .pill-red, [data-bs-theme=dark] .priority-Emergency, [data-bs-theme=dark] .task-badge-counter { background: #4a1d1d; color: #fecaca; }
[data-bs-theme=dark] .pill-amber, [data-bs-theme=dark] .priority-Medium { background: #42330f; color: #fde68a; }
[data-bs-theme=dark] .priority-High { background: #44260f; color: #fed7aa; }
[data-bs-theme=dark] .pill-green { background: #17331f; color: #bbf7d0; }
[data-bs-theme=dark] .task-group-disclosure[open] .summary-expand-control { background: #495057; color: #fff; }
[data-bs-theme=dark] .wo-emerg-wrap span[style] { color: #f87171 !important; }

/* Reports.aspx */
[data-bs-theme=dark] body:has(.rpt-page) { background-color: var(--pm-page-bg, #16191d) !important; }
[data-bs-theme=dark] .rpt-page { background-color: var(--bs-body-bg) !important; }
[data-bs-theme=dark] .rpt-card, [data-bs-theme=dark] .rpt-card.rpt-sec { background: #2b3035; border-color: #495057 !important; }
[data-bs-theme=dark] .rpt-card .card-header, [data-bs-theme=dark] .rpt-card.rpt-sec > .card-header.rpt-hdr { background-color: #2b3035 !important; border-bottom-color: #3d434a; color: #dee2e6; }
@media (hover: hover) and (pointer: fine) { [data-bs-theme=dark] .rpt-card.rpt-sec > .card-header.rpt-hdr:hover { background-color: #343a40 !important; } }
[data-bs-theme=dark] .rpt-totals-wrap .rpt-totals td { box-shadow: inset -1px -1px 0 #3d434a; }
[data-bs-theme=dark] .rpt-totals-wrap .rpt-totals td::before, [data-bs-theme=dark] .rpt-lbl, [data-bs-theme=dark] .rpt-sugg-head,
[data-bs-theme=dark] .rpt-sugg-loading, [data-bs-theme=dark] .rpt-qsearch .input-group-text { color: #adb5bd; }
[data-bs-theme=dark] .rpt-ft-grid .link-primary, [data-bs-theme=dark] .rpt-page .btn-outline-primary { color: #dee2e6 !important; border-color: #6c757d !important; }
[data-bs-theme=dark] .rpt-ft-grid .link-primary:hover { color: #fff !important; }
[data-bs-theme=dark] .rpt-page .btn-outline-primary:hover { background-color: #495057 !important; color: #fff !important; }
[data-bs-theme=dark] .rpt-page input.rpt-cal-btn, [data-bs-theme=dark] .rpt-qsearch .input-group-text { background: #2b3035; border-color: #495057; }
[data-bs-theme=dark] .rpt-page .ajax__calendar_container { background-color: #2b3035; color: #dee2e6; }
[data-bs-theme=dark] .rpt-ft-grid > tbody > tr { border-bottom-color: #3d434a !important; }
[data-bs-theme=dark] .sticky-header { background-color: #2b3035 !important; border-bottom-color: #3d434a; }
[data-bs-theme=dark] .rpt-add-sheet .rpt-lbl { color: #dee2e6 !important; }
[data-bs-theme=dark] .rpt-add-sheet .form-control, [data-bs-theme=dark] .rpt-add-sheet .form-select { background-color: #2b3035 !important; color: #dee2e6 !important; border-color: #495057 !important; }
[data-bs-theme=dark] .yellowInfoBlock { background-color: #42330f; border-color: #6b5417; color: #fde68a; }
[data-bs-theme=dark] .rpt-rowcount-delta.rpt-rowcount-up { color: #4ade80; }
[data-bs-theme=dark] .rpt-rowcount-delta.rpt-rowcount-down { color: #f87171; }
[data-bs-theme=dark] .rpt-sugg { background-color: #2b3035; border-color: #495057; color: #dee2e6; }
[data-bs-theme=dark] .rpt-sugg-head { background-color: #343a40; border-bottom-color: #3d434a; }
[data-bs-theme=dark] .rpt-sugg-head .bi, [data-bs-theme=dark] .rpt-sugg-meta, [data-bs-theme=dark] .rpt-sugg-desc { color: #dee2e6; }
[data-bs-theme=dark] .rpt-sugg-opt, [data-bs-theme=dark] .rpt-sugg-loading { border-top-color: #3d434a; }
[data-bs-theme=dark] .rpt-sugg-opt:focus, [data-bs-theme=dark] .rpt-sugg-opt.active { background-color: #343a40; }
@media (hover: hover) and (pointer: fine) { [data-bs-theme=dark] .rpt-sugg-opt:hover { background-color: #343a40; } }
[data-bs-theme=dark] .rpt-sec-toggle[aria-expanded="true"] { background-color: #495057; border-color: #6c757d; color: #fff; }
[data-bs-theme=dark] .ft-suites label { background: #2b3035; border-color: #495057; color: #dee2e6; }
[data-bs-theme=dark] .ft-suites input:checked + label { background: #1c2b45; border-color: #3b82f6; color: #bfdbfe; }
[data-bs-theme=dark] .rpt-page .table { --bs-table-bg: transparent; --bs-table-color: var(--bs-body-color); }
[data-bs-theme=dark] .rpt-page .text-muted, [data-bs-theme=dark] .fs-wrap .text-muted, [data-bs-theme=dark] .tx-wrap .text-muted { color: #adb5bd !important; }
[data-bs-theme=dark] .rpt-page span[style*="#000000"], [data-bs-theme=dark] .rpt-page td[style*="#000000"] { color: var(--bs-body-color) !important; }

/* Balance Sheet / Statement of Activity / Capital Improvements (fs-*) */
[data-bs-theme=dark] .fs-filters label { color: #adb5bd; }
[data-bs-theme=dark] .fs-tabs a, [data-bs-theme=dark] .tx-tabs a { background: #343a40; color: #dee2e6; }
[data-bs-theme=dark] .fs-tabs a.on, [data-bs-theme=dark] .tx-tabs a.on { background: #2563eb; color: #fff; }
[data-bs-theme=dark] .tx-tabs a:not(.on):hover { background: #495057; }
[data-bs-theme=dark] .site-main .fs-wrap .fs-card, [data-bs-theme=dark] .site-main .tx-wrap .tx-card { background: #2b3035; border-color: #3d434a; box-shadow: none; }
[data-bs-theme=dark] .fs-ch, [data-bs-theme=dark] .fs-li, [data-bs-theme=dark] .fs-li.fs-t { border-color: #3d434a; }
[data-bs-theme=dark] .fs-li.fs-t, [data-bs-theme=dark] .site-main .fs-wrap .fs-table tr.fs-h td { background: #343a40; }
[data-bs-theme=dark] .fs-li small { color: #adb5bd; }
[data-bs-theme=dark] .fs-li small.fs-warn { color: #fbbf24; }
[data-bs-theme=dark] .fs-neg, [data-bs-theme=dark] .tx-neg, [data-bs-theme=dark] .tx-err { color: #f87171 !important; }
[data-bs-theme=dark] .site-main .fs-wrap .fs-table th, [data-bs-theme=dark] .site-main .fs-wrap .fs-table th:first-child,
[data-bs-theme=dark] .site-main .tx-wrap .tx-table th { background: #343a40; color: #ced4da; border-color: #3d434a; }
[data-bs-theme=dark] .site-main .fs-wrap .fs-table td { background: #2b3035; border-color: #3d434a; }
[data-bs-theme=dark] .site-main .fs-wrap .fs-table tr.fs-tt td { border-top-color: #6c757d; }

/* Tax Report (tx-*) */
[data-bs-theme=dark] .site-main .tx-wrap .tx-sl, [data-bs-theme=dark] .site-main .tx-wrap .tx-row .tx-rl, [data-bs-theme=dark] .tx-foot .tx-li,
[data-bs-theme=dark] .tx-num, [data-bs-theme=dark] .tx-bt, [data-bs-theme=dark] .site-main .tx-wrap .tx-pm { color: #adb5bd; }
[data-bs-theme=dark] .site-main .tx-wrap .tx-big, [data-bs-theme=dark] .site-main .tx-wrap .tx-sv, [data-bs-theme=dark] .site-main .tx-wrap .tx-pn,
[data-bs-theme=dark] .site-main .tx-wrap .tx-pv, [data-bs-theme=dark] .site-main .tx-wrap .tx-row .tx-ra, [data-bs-theme=dark] .site-main .tx-wrap .tx-foot .tx-li.tx-b,
[data-bs-theme=dark] .tx-prop h4, [data-bs-theme=dark] .site-main .tx-wrap .tx-table td { color: #dee2e6; }
[data-bs-theme=dark] .tx-bars, [data-bs-theme=dark] .tx-foot, [data-bs-theme=dark] .tx-ch, [data-bs-theme=dark] .tx-prop, [data-bs-theme=dark] .tx-li.tx-b,
[data-bs-theme=dark] .tx-list .tx-r, [data-bs-theme=dark] .tx-map, [data-bs-theme=dark] .tx-pad { border-color: #3d434a !important; }
[data-bs-theme=dark] .tx-bk { background: #3d434a; }
[data-bs-theme=dark] .site-main .tx-wrap .tx-table td { background: #2b3035; border-color: #3d434a; }
[data-bs-theme=dark] .site-main .tx-wrap .tx-table tr.tx-tot td { background: #343a40; }
[data-bs-theme=dark] .tx-table a, [data-bs-theme=dark] .tx-list a, [data-bs-theme=dark] button.amt { color: #93c5fd; }
[data-bs-theme=dark] .tx-ok { color: #4ade80; }
[data-bs-theme=dark] .tx-pill { background: #17331f; color: #bbf7d0; }
[data-bs-theme=dark] .tx-pill.bad { background: #4a1d1d; color: #fecaca; }
[data-bs-theme=dark] .site-main .tx-wrap .tx-need { background: #42330f; color: #fde68a; }
/* Tax Report edit sheet keeps its light panel; give it dark text so it stays readable. */
[data-bs-theme=dark] .cv-pan { color: #212529; color-scheme: light; }
}
