:root {
    color-scheme: light;
    --app-bg: #f4f7fb;
    --surface: #ffffff;
    --surface-soft: #f8fafc;
    --surface-hover: #f0f5f8;
    --text: #1c2b3a;
    --muted: #738195;
    --border: #e6ecf2;
    --primary: #167d79;
    --primary-dark: #116763;
    --navy: #14283e;
    --navy-soft: #1c3854;
    --success: #16865f;
    --danger: #c94c57;
    --warning: #b97821;
    --shadow: 0 8px 28px rgba(24, 45, 68, .055);
    --radius: 18px;
}
html[data-theme="dark"] {
    color-scheme: dark;
    --app-bg: #101a26;
    --surface: #182535;
    --surface-soft: #1d2d40;
    --surface-hover: #26394e;
    --text: #e8eff6;
    --muted: #a1b0c1;
    --border: #2b3d51;
    --primary: #45b9ad;
    --primary-dark: #5bc8bc;
    --navy: #0e1a28;
    --navy-soft: #1b3045;
    --success: #55c49b;
    --danger: #ff7c83;
    --warning: #e5ad59;
    --shadow: 0 8px 28px rgba(0, 0, 0, .18);
}
* { box-sizing: border-box; }
html { font-size: 14px; direction: rtl; scroll-behavior: smooth; }
body { margin: 0; min-height: 100vh; background: var(--app-bg); color: var(--text); font-family: "Vazirmatn", Tahoma, Arial, sans-serif; font-weight: 400; line-height: 1.8; }
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); }
button, input, select, textarea { font-family: inherit; }
.app-main-shell { min-height: 100vh; margin-right: 276px; display: flex; flex-direction: column; }
.app-sidebar { position: fixed; z-index: 1040; inset: 0 0 0 auto; width: 276px; display: flex; flex-direction: column; padding: 22px 16px 16px; color: #e9f1f8; background: linear-gradient(180deg, #14283e 0%, #102235 100%); box-shadow: -8px 0 32px rgba(14, 35, 55, .08); }
.brand-lockup { display: flex; align-items: center; gap: 12px; padding: 0 8px 22px; color: inherit; }
.brand-lockup:hover { color: inherit; }
.brand-mark { width: 43px; height: 43px; flex: 0 0 43px; display: inline-flex; align-items: center; justify-content: center; border-radius: 14px; color: #fff; font-size: 1.35rem; background: linear-gradient(135deg, #24b8a7, #16847e); box-shadow: 0 7px 18px rgba(28, 174, 159, .25); }
.brand-copy { display: flex; flex-direction: column; line-height: 1.45; }
.brand-copy strong { font-size: 1.12rem; font-weight: 800; letter-spacing: -.3px; }
.brand-copy small { margin-top: 3px; color: #9db2c5; font-size: .72rem; }
.sidebar-building { display: flex; align-items: center; gap: 10px; margin: 0 0 19px; padding: 12px 10px; border: 1px solid rgba(210, 229, 243, .13); border-radius: 14px; background: rgba(255,255,255,.055); }
.building-avatar { width: 35px; height: 35px; display: grid; place-items: center; border-radius: 11px; color: #83d9d0; background: rgba(44, 185, 170, .13); font-size: 1.1rem; }
.sidebar-building span:nth-child(2) { min-width: 0; flex: 1; display: flex; flex-direction: column; line-height: 1.5; }
.sidebar-building small { color: #91a8bc; font-size: .7rem; }
.sidebar-building strong { overflow: hidden; color: #f2f7fb; font-size: .82rem; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-building a { color: #9bb1c4; padding: 4px; }
.sidebar-nav { flex: 1; overflow-y: auto; padding: 0 1px 12px; scrollbar-width: thin; scrollbar-color: #36516b transparent; }
.nav-caption { padding: 9px 12px 7px; color: #7891a8; font-size: .69rem; font-weight: 700; letter-spacing: .3px; }
.side-link { position: relative; display: flex; align-items: center; gap: 12px; min-height: 43px; margin: 3px 0; padding: 9px 12px; border-radius: 11px; color: #c1cfdb; font-size: .86rem; font-weight: 500; transition: .18s ease; }
.side-link i { width: 19px; color: #91a9bd; font-size: 1.05rem; text-align: center; }
.side-link:hover { color: #fff; background: rgba(255,255,255,.075); }
.side-link.active { color: #fff; background: linear-gradient(90deg, rgba(35, 179, 164, .22), rgba(35, 179, 164, .09)); box-shadow: inset -3px 0 #36c0b1; }
.side-link.active i { color: #65d7ca; }
.sidebar-footer { padding-top: 13px; border-top: 1px solid rgba(210, 229, 243, .12); }
.sidebar-help { display: flex; align-items: center; gap: 10px; margin: 0 2px 13px; padding: 10px; border-radius: 12px; color: #8fe0d6; background: rgba(37, 174, 161, .1); }
.sidebar-help > i { font-size: 1.25rem; }
.sidebar-help span, .user-meta { display: flex; flex-direction: column; line-height: 1.45; }
.sidebar-help strong { color: #d8f5f1; font-size: .77rem; }
.sidebar-help small { color: #91bdb9; font-size: .68rem; }
.sidebar-user { display: flex; align-items: center; gap: 9px; padding: 8px 4px 2px; }
.user-avatar, .topbar-avatar { width: 35px; height: 35px; display: inline-grid; flex: 0 0 35px; place-items: center; border-radius: 50%; color: #fff; background: linear-gradient(135deg, #3b9d9a, #286c81); font-weight: 700; }
.user-meta { min-width: 0; }
.user-meta strong { max-width: 145px; overflow: hidden; color: #eef5fa; font-size: .77rem; text-overflow: ellipsis; white-space: nowrap; }
.user-meta small { color: #91a8bc; font-size: .68rem; }
.icon-button { width: 38px; height: 38px; display: inline-grid; place-items: center; border: 1px solid var(--border); border-radius: 12px; color: var(--muted); background: var(--surface); font-size: 1.05rem; transition: .18s ease; }
.icon-button:hover { color: var(--primary); border-color: var(--primary); background: var(--surface-hover); }
.sidebar-user .icon-button { width: 32px; height: 32px; border-color: rgba(255,255,255,.12); color: #b4c4d2; background: rgba(255,255,255,.06); }
.topbar { position: sticky; z-index: 1020; top: 0; min-height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 0 32px; border-bottom: 1px solid var(--border); background: color-mix(in srgb, var(--surface) 93%, transparent); backdrop-filter: blur(14px); }
.topbar-start, .topbar-actions { display: flex; align-items: center; gap: 13px; }
.breadcrumb-context { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: .82rem; }
.breadcrumb-context i { color: #aab5c2; font-size: .7rem; }
.breadcrumb-context strong { color: var(--text); font-weight: 700; }
.topbar-date { color: var(--muted); font-size: .77rem; }
.topbar-date i { margin-left: 5px; }
.topbar-avatar { width: 37px; height: 37px; }
.mobile-menu-button { display: none; }
.app-content { width: 100%; max-width: 1600px; flex: 1; margin: 0 auto; padding: 30px 32px 44px; }
.app-footer { display: flex; justify-content: space-between; gap: 15px; padding: 16px 32px 20px; border-top: 1px solid var(--border); color: var(--muted); font-size: .72rem; }
.public-header { min-height: 76px; display: flex; align-items: center; justify-content: space-between; padding: 12px max(5vw, 20px); border-bottom: 1px solid var(--border); background: var(--surface); }
.public-header .brand-lockup { padding: 0; color: var(--text); }
.public-header .brand-copy small { color: var(--muted); }
.app-public .app-main-shell { margin-right: 0; }
.app-public .app-content { max-width: 1180px; min-height: calc(100vh - 140px); padding-top: 42px; }
.sidebar-backdrop { display: none; }
/* Shared page components */
h1, h2, h3, h4, h5, h6 { color: var(--text); font-weight: 700; letter-spacing: -.25px; }
h1 { font-size: 1.75rem; }
h2 { font-size: 1.4rem; }
h3 { font-size: 1.18rem; }
p { color: inherit; }
.text-muted, .text-secondary, .form-text { color: var(--muted) !important; }
.card { overflow: hidden; border: 1px solid var(--border); border-radius: var(--radius); color: var(--text); background: var(--surface); box-shadow: var(--shadow); }
.card-header { padding: 15px 19px; border-bottom: 1px solid var(--border); color: var(--text); background: var(--surface-soft); font-weight: 700; }
.card-body { padding: 20px; }
.card-footer { border-top: 1px solid var(--border); background: var(--surface-soft); }
.dashboard-hero { position: relative; overflow: hidden; color: #fff; border: 0; border-radius: 22px; background: radial-gradient(circle at 10% 15%, rgba(73, 208, 190, .26), transparent 30%), linear-gradient(120deg, #142d47 0%, #1b5365 60%, #167d79 100%); box-shadow: 0 15px 38px rgba(20, 63, 82, .16); }
.dashboard-hero::after { position: absolute; left: -45px; bottom: -105px; width: 250px; height: 250px; border: 1px solid rgba(255,255,255,.12); border-radius: 50%; box-shadow: 0 0 0 28px rgba(255,255,255,.035), 0 0 0 58px rgba(255,255,255,.025); content: ""; }
.dashboard-hero h1, .dashboard-hero h2, .dashboard-hero p { position: relative; z-index: 1; color: #fff; }
.dashboard-hero p { color: rgba(255,255,255,.75); }
.dashboard-hero .btn-light { position: relative; z-index: 2; border: 0; border-radius: 11px; color: #174e58; font-weight: 700; }
.transparency-dashboard-card { position: relative; display: flex; align-items: center; gap: 20px; min-height: 126px; padding: 23px 26px; overflow: hidden; border: 1px solid rgba(34, 157, 145, .32); border-radius: 20px; color: #fff; background: radial-gradient(circle at 12% 20%, rgba(255,255,255,.16), transparent 28%), linear-gradient(110deg, #12334b 0%, #176b70 58%, #15917e 100%); box-shadow: 0 13px 30px rgba(20, 85, 91, .17); text-decoration: none; transition: transform .18s ease, box-shadow .18s ease; }
.transparency-dashboard-card:hover { color: #fff; transform: translateY(-3px); box-shadow: 0 18px 36px rgba(20, 85, 91, .24); }
.transparency-dashboard-icon { width: 68px; height: 68px; flex: 0 0 68px; display: grid; place-items: center; border: 1px solid rgba(255,255,255,.25); border-radius: 19px; color: #fff; background: rgba(255,255,255,.13); font-size: 2rem; }
.transparency-dashboard-copy { display: flex; flex: 1; flex-direction: column; gap: 3px; min-width: 0; }
.transparency-dashboard-copy strong { color: #fff; font-size: 1.22rem; font-weight: 800; }
.transparency-dashboard-copy > span { color: rgba(255,255,255,.82); font-size: .88rem; }
.transparency-dashboard-copy small { margin-top: 5px; color: #b9f3e9; font-size: .78rem; font-weight: 700; }
.transparency-dashboard-arrow { width: 42px; height: 42px; flex: 0 0 42px; display: grid; place-items: center; border-radius: 50%; color: #145a61; background: #fff; font-size: 1.2rem; }
.dashboard-stat { position: relative; display: flex; flex-direction: column; gap: 5px; min-height: 142px; height: 100%; padding: 18px; border: 1px solid var(--border); border-radius: 17px; color: var(--text); background: var(--surface); box-shadow: var(--shadow); transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease; text-decoration: none; }
.dashboard-stat:hover { color: var(--text); transform: translateY(-3px); border-color: color-mix(in srgb, var(--primary) 35%, var(--border)); box-shadow: 0 13px 30px rgba(20, 50, 70, .1); }
.dashboard-stat::before { width: 37px; height: 4px; margin-bottom: 5px; border-radius: 8px; background: var(--stat-accent, var(--primary)); content: ""; }
.dashboard-stat span { color: var(--muted); font-size: .81rem; }
.dashboard-stat strong { color: var(--text); font-size: 1.9rem; font-weight: 800; line-height: 1.3; }
.dashboard-stat small { margin-top: auto; color: var(--primary); font-size: .73rem; }
.dashboard-stat:nth-child(4n+1) { --stat-accent: #2da99b; }
.dashboard-stat:nth-child(4n+2) { --stat-accent: #5686c5; }
.dashboard-stat:nth-child(4n+3) { --stat-accent: #d49a43; }
.dashboard-stat:nth-child(4n+4) { --stat-accent: #8b78bd; }
.quick-links { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 9px; margin-top: 14px; }
.quick-links a { display: flex; align-items: center; gap: 9px; min-height: 48px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 12px; color: var(--text); background: var(--surface-soft); font-size: .79rem; transition: .15s ease; }
.quick-links a:hover { border-color: var(--primary); color: var(--primary); background: var(--surface-hover); }
/* Forms and tables */
.form-label { margin-bottom: 7px; color: var(--text); font-size: .82rem; font-weight: 600; }
.form-control, .form-select { min-height: 44px; padding: 9px 12px; border: 1px solid var(--border); border-radius: 11px; color: var(--text); background-color: var(--surface); font-size: .86rem; }
.form-control:focus, .form-select:focus { border-color: var(--primary); color: var(--text); background-color: var(--surface); box-shadow: 0 0 0 .2rem color-mix(in srgb, var(--primary) 14%, transparent); }
.form-control::placeholder { color: #9ba8b7; }
textarea.form-control { min-height: 115px; }
.form-check-input { border-color: var(--border); }
.form-check-input:checked { border-color: var(--primary); background-color: var(--primary); }
.input-group-text { border-color: var(--border); color: var(--muted); background: var(--surface-soft); }
.btn { min-height: 40px; padding: 8px 15px; border-radius: 10px; font-size: .82rem; font-weight: 600; transition: .16s ease; }
.btn-primary { border-color: var(--primary); background: var(--primary); }
.btn-primary:hover, .btn-primary:focus { border-color: var(--primary-dark); background: var(--primary-dark); }
.btn-outline-primary { border-color: color-mix(in srgb, var(--primary) 55%, var(--border)); color: var(--primary); }
.btn-outline-primary:hover { border-color: var(--primary); background: var(--primary); }
.btn-outline-secondary { border-color: var(--border); color: var(--muted); }
.btn-outline-secondary:hover { border-color: var(--muted); color: var(--text); background: var(--surface-hover); }
.btn-danger { background: #c94c57; }
.btn-success { background: #16865f; }
.table-responsive { overflow-x: auto; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); }
.table { margin-bottom: 0; color: var(--text); vertical-align: middle; --bs-table-bg: var(--surface); --bs-table-color: var(--text); --bs-table-border-color: var(--border); --bs-table-hover-bg: var(--surface-hover); --bs-table-hover-color: var(--text); }
.table > :not(caption) > * > * { padding: 12px 14px; border-bottom-color: var(--border); }
.table thead th { color: var(--muted); background: var(--surface-soft) !important; font-size: .76rem; font-weight: 700; white-space: nowrap; }
.table tbody td { font-size: .81rem; }
.table-light { --bs-table-bg: var(--surface-soft); --bs-table-color: var(--text); }
.list-group-item { border-color: var(--border); color: var(--text); background: transparent; }
.list-group-item-action:hover { color: var(--primary); background: var(--surface-hover); }
.alert { border: 1px solid var(--border); border-radius: 13px; font-size: .84rem; }
.alert-success { color: var(--success); border-color: color-mix(in srgb, var(--success) 22%, var(--border)); background: color-mix(in srgb, var(--success) 8%, var(--surface)); }
.alert-danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 22%, var(--border)); background: color-mix(in srgb, var(--danger) 8%, var(--surface)); }
.alert-warning { color: var(--warning); border-color: color-mix(in srgb, var(--warning) 22%, var(--border)); background: color-mix(in srgb, var(--warning) 8%, var(--surface)); }
.alert-info { color: #397ca2; border-color: #cfe4f1; background: #eff8fc; }
html[data-theme="dark"] .alert-info { color: #a7d8f0; border-color: #31516a; background: #1b3448; }
.badge { padding: .45em .7em; border-radius: 7px; font-weight: 600; }
.pagination { gap: 4px; }
.page-link { border-color: var(--border); border-radius: 8px !important; color: var(--primary); background: var(--surface); }
.modal-content { border: 1px solid var(--border); border-radius: 17px; color: var(--text); background: var(--surface); }
.dropdown-menu { border: 1px solid var(--border); border-radius: 12px; color: var(--text); background: var(--surface); box-shadow: var(--shadow); }
.dropdown-item { color: var(--text); }
.dropdown-item:hover { color: var(--primary); background: var(--surface-hover); }
.message-body { white-space: pre-wrap; overflow-wrap: anywhere; }
.message-card { border-inline-start: 4px solid #7bb8b2; }
.table-responsive + .alert { margin-top: 15px; }
.app-alert { margin-bottom: 20px; }
.validation-summary-errors, .field-validation-error { color: var(--danger); font-size: .78rem; }
hr { border-color: var(--border); opacity: 1; }
/* Keep legacy nested .container wrappers aligned with the new shell */
.app-content > .container, .app-content .container.py-4 { width: 100%; max-width: 100%; padding-right: 0; padding-left: 0; }
@media (max-width: 1199.98px) {
    .app-main-shell { margin-right: 250px; }
    .app-sidebar { width: 250px; }
    .app-content { padding-right: 24px; padding-left: 24px; }
}
@media (max-width: 991.98px) {
    .app-main-shell { margin-right: 0; }
    .app-sidebar { width: min(290px, 86vw); transform: translateX(110%); transition: transform .22s ease; }
    .app-sidebar.is-open { transform: translateX(0); }
    .sidebar-backdrop { position: fixed; z-index: 1035; inset: 0; display: block; visibility: hidden; opacity: 0; background: rgba(7, 19, 31, .52); transition: .2s ease; }
    .sidebar-backdrop.is-visible { visibility: visible; opacity: 1; }
    .mobile-menu-button { display: inline-grid; }
    .topbar { min-height: 65px; padding: 0 22px; }
}
@media (max-width: 767.98px) {
    html { font-size: 13px; }
    .topbar { min-height: 60px; padding: 0 14px; }
    .topbar-start, .topbar-actions { gap: 8px; }
    .breadcrumb-context { gap: 6px; font-size: .75rem; }
    .topbar-avatar { width: 33px; height: 33px; flex-basis: 33px; }
    .app-content { padding: 19px 14px 30px; }
    .app-footer { padding: 13px 15px; font-size: .67rem; }
    .public-header { padding: 10px 14px; }
    .public-header .brand-mark { width: 37px; height: 37px; flex-basis: 37px; }
    .public-header .btn { min-height: 36px; padding: 6px 10px; }
    h1 { font-size: 1.5rem; }
    h2 { font-size: 1.25rem; }
    .card { border-radius: 14px; }
    .card-body { padding: 15px; }
    .dashboard-hero { padding: 20px !important; border-radius: 17px; }
    .transparency-dashboard-card { min-height: 112px; gap: 13px; padding: 17px; border-radius: 16px; }
    .transparency-dashboard-icon { width: 52px; height: 52px; flex-basis: 52px; border-radius: 15px; font-size: 1.6rem; }
    .transparency-dashboard-copy strong { font-size: 1.02rem; }
    .transparency-dashboard-copy > span { font-size: .76rem; }
    .transparency-dashboard-arrow { width: 34px; height: 34px; flex-basis: 34px; }
    .dashboard-stat { min-height: 120px; padding: 14px; }
    .dashboard-stat strong { font-size: 1.55rem; }
    .quick-links { grid-template-columns: 1fr; }
    .table { min-width: 650px; }
    .btn { white-space: normal; }
    .d-flex.justify-content-between { align-items: flex-start !important; }
    .row.g-3 > [class*="col-"] { min-width: 0; }
}
@media print {
    .app-sidebar, .topbar, .app-footer, .btn, .d-print-none { display: none !important; }
    .app-main-shell { margin: 0; }
    .app-content { max-width: none; padding: 0; }
    body { background: #fff; color: #000; }
    .card { box-shadow: none; }
}
.announcement-list { display: flex; flex-direction: column; }
.announcement-item { display: flex; align-items: center; gap: 12px; padding: 12px 2px; border-bottom: 1px solid var(--border); color: var(--text); }
.announcement-item:last-child { border-bottom: 0; }
.announcement-item:hover { color: var(--primary); }
.announcement-icon, .feature-icon, .balance-icon { width: 42px; height: 42px; display: inline-grid; flex: 0 0 42px; place-items: center; border-radius: 13px; color: var(--primary); background: color-mix(in srgb, var(--primary) 10%, var(--surface)); font-size: 1.15rem; }
.announcement-content { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 3px; }
.announcement-content strong { overflow: hidden; color: var(--text); font-size: .83rem; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.announcement-content small { color: var(--muted); font-size: .71rem; }
.announcement-arrow { color: var(--muted); font-size: .75rem; }
.quick-links a::before { content: none; }
.quick-links a i { width: 19px; color: var(--primary); font-size: 1rem; text-align: center; }
.balance-banner { display: flex; align-items: center; gap: 15px; padding: 17px 20px; }
.balance-icon { width: 48px; height: 48px; flex-basis: 48px; font-size: 1.35rem; }
.balance-copy { display: flex; flex-direction: column; gap: 2px; }
.balance-copy span { color: var(--muted); font-size: .78rem; }
.balance-copy strong { color: var(--text); font-size: 1.45rem; font-weight: 800; }
.balance-copy small { color: var(--muted); font-size: .72rem; font-weight: 500; }
.feature-icon { width: 48px; height: 48px; font-size: 1.35rem; }
@media (max-width: 767.98px) { .balance-banner { align-items: flex-start; flex-wrap: wrap; } .balance-banner .btn { width: 100%; margin-right: 0 !important; } .balance-copy strong { font-size: 1.25rem; } }
html[data-theme="dark"] .text-dark { color: var(--text) !important; }
html[data-theme="dark"] .bg-white, html[data-theme="dark"] .bg-light, html[data-theme="dark"] .text-bg-light { color: var(--text) !important; background-color: var(--surface-soft) !important; }
html[data-theme="dark"] .border, html[data-theme="dark"] .border-top, html[data-theme="dark"] .border-bottom { border-color: var(--border) !important; }
html[data-theme="dark"] .btn-close { filter: invert(1) grayscale(100%) brightness(200%); }
html[data-theme="dark"] .text-primary { color: #70cfc5 !important; }
html[data-theme="dark"] .text-success { color: #68d2a8 !important; }
html[data-theme="dark"] .text-danger { color: #ff8d94 !important; }
html[data-theme="dark"] .text-warning { color: #f0bd6d !important; }
.app-public .row.justify-content-center { margin-top: 24px; margin-bottom: 24px; }
.app-public .row.justify-content-center > [class*="col-"] { max-width: 520px; }
.app-public .row.justify-content-center .card { border-radius: 20px; }
.app-public .row.justify-content-center .card-body { padding: clamp(22px, 5vw, 38px); }
.app-public .row.justify-content-center h2 { margin-bottom: 24px !important; font-size: 1.55rem; }
.app-public .row.justify-content-center .btn-primary { min-height: 47px; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--primary) 45%, transparent); outline-offset: 2px; }
.cash-chart-legend { display: flex; flex-wrap: wrap; gap: 18px; margin-bottom: 16px; color: var(--muted); font-size: .73rem; }
.cash-chart-legend span { display: inline-flex; align-items: center; gap: 7px; }
.legend-dot { width: 9px; height: 9px; display: inline-block; border-radius: 50%; }
.income-dot, .income-bar { background: #269d91; }
.expense-dot, .expense-bar { background: #d69b4c; }
.cash-chart { display: flex; flex-direction: column; gap: 13px; }
.cash-chart-row { display: grid; grid-template-columns: 78px minmax(100px, 1fr) minmax(135px, auto); align-items: center; gap: 14px; }
.cash-chart-month { color: var(--muted); font-size: .73rem; direction: ltr; text-align: right; }
.cash-chart-bars { display: flex; flex-direction: column; gap: 5px; }
.cash-bar-track { height: 8px; overflow: hidden; border-radius: 20px; background: var(--surface-soft); }
.cash-bar { height: 100%; display: block; min-width: 0; border-radius: inherit; transition: width .35s ease; }
.cash-chart-values { display: flex; justify-content: flex-end; gap: 13px; color: var(--muted); font-size: .68rem; direction: ltr; font-variant-numeric: tabular-nums; }
.cash-chart-values span { min-width: 48px; text-align: left; }
@media (max-width: 575.98px) { .cash-chart-row { grid-template-columns: 58px minmax(80px, 1fr); gap: 9px; } .cash-chart-values { grid-column: 2; justify-content: space-between; } }

/* Finance actions: responsive, consistently sized action cards instead of a crowded button row. */
.finance-page-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.finance-page-heading h2 { color: var(--text); font-weight: 800; font-size: 1.35rem; }
.finance-action-panel { padding: 20px; border: 1px solid var(--border); border-radius: 18px; background: var(--surface); box-shadow: var(--shadow); }
.finance-action-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 15px; }
.finance-action-heading h3 { margin: 0 0 4px; color: var(--text); font-size: 1rem; font-weight: 800; }
.finance-action-heading p { margin: 0; color: var(--muted); font-size: .78rem; }
.finance-action-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.finance-action-card { display: flex; align-items: center; gap: 12px; min-width: 0; min-height: 82px; padding: 13px 14px; border: 1px solid var(--border); border-radius: 14px; color: var(--text); background: var(--surface-soft); text-decoration: none; transition: border-color .16s ease, transform .16s ease, background .16s ease; }
.finance-action-card:hover { color: var(--text); border-color: var(--primary); background: var(--surface-hover); transform: translateY(-2px); }
.finance-action-card > span:nth-child(2) { display: flex; flex: 1; flex-direction: column; min-width: 0; gap: 4px; }
.finance-action-card strong { color: var(--text); font-size: .82rem; font-weight: 750; line-height: 1.6; }
.finance-action-card small { color: var(--muted); font-size: .69rem; line-height: 1.6; }
.finance-action-icon { display: grid; flex: 0 0 42px; width: 42px; height: 42px; place-items: center; border-radius: 12px; color: var(--primary); background: color-mix(in srgb, var(--primary) 10%, var(--surface)); font-size: 1.1rem; }
.finance-action-card.action-income .finance-action-icon { color: #16856f; background: rgba(22,133,111,.10); }
.finance-action-card.action-expense .finance-action-icon { color: #c34e5b; background: rgba(195,78,91,.10); }
.finance-action-card.action-credit .finance-action-icon { color: #16856f; background: rgba(22,133,111,.10); }
.finance-action-card .action-arrow { color: var(--muted); font-size: .8rem; }
@media (max-width: 991.98px) { .finance-action-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 575.98px) { .finance-action-panel { padding: 14px; } .finance-action-grid { grid-template-columns: 1fr; gap: 9px; } .finance-action-card { min-height: 72px; } }


/* Prominent home-page finance entry */
.dashboard-hero-actions { position: relative; z-index: 2; display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 10px; }
.dashboard-hero-actions .btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 48px; padding: 10px 16px; border-radius: 12px; font-size: .88rem; font-weight: 750; line-height: 1.35; white-space: nowrap; text-decoration: none; box-shadow: 0 5px 14px rgba(0,0,0,.10); transition: transform .18s ease, box-shadow .18s ease, background .18s ease; }
.dashboard-hero-actions .btn:hover { transform: translateY(-2px); box-shadow: 0 9px 20px rgba(0,0,0,.16); }
.btn-finance-hero { border: 1px solid rgba(255,255,255,.8); color: #123d45; background: #fff; }
.btn-finance-hero:hover { color: #0e655f; background: #f0fffc; }
.dashboard-hero-actions .hero-action-secondary { border: 1px solid rgba(255,255,255,.55); color: #164451; background: rgba(255,255,255,.94); }
.dashboard-hero-actions .hero-action-tertiary { border: 1px solid rgba(255,255,255,.68); color: #fff; background: rgba(255,255,255,.08); }
.dashboard-hero-actions .hero-action-tertiary:hover { color: #123d45; background: #fff; }
@media (max-width: 991.98px) { .dashboard-hero-actions { justify-content: flex-start; } }
@media (max-width: 575.98px) { .dashboard-hero-actions { display: grid; grid-template-columns: 1fr; width: 100%; } .dashboard-hero-actions .btn { width: 100%; min-height: 48px; } }


/* Building settings and mobile-first building selection */
.building-selection-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 290px), 1fr)); gap: 16px; }
.building-selection-card { height: 100%; }
.building-selection-icon { width: 48px; height: 48px; flex: 0 0 48px; display: grid; place-items: center; border-radius: 14px; color: var(--primary); background: color-mix(in srgb, var(--primary) 12%, var(--surface)); font-size: 1.3rem; }
.building-selection-name { margin: 0 0 4px; font-size: 1rem; font-weight: 800; overflow-wrap: anywhere; }
.building-selection-meta, .building-selection-address { color: var(--muted); font-size: .76rem; overflow-wrap: anywhere; }
.building-selection-address { margin-top: 6px; line-height: 1.8; }
@media (max-width: 767.98px) {
  html, body { max-width: 100%; overflow-x: clip; }
  .app-main-shell, .app-content, .container, .row, [class*="col-"] { min-width: 0; max-width: 100%; }
  .table { width: 100% !important; min-width: 0 !important; table-layout: fixed; }
  .table th, .table td { white-space: normal !important; overflow-wrap: anywhere; word-break: break-word; padding: 8px 6px !important; font-size: .72rem !important; }
  .table-responsive { max-width: 100%; }
  .btn, .form-control, .form-select { max-width: 100%; }
  .public-header { flex-wrap: wrap; gap: 10px; }
  .public-header > div { max-width: 100%; flex-wrap: wrap; }
  .topbar, .topbar-start, .topbar-actions { min-width: 0; }
  .breadcrumb-context { min-width: 0; overflow: hidden; }
  .breadcrumb-context strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}

/* Building-specific accent palette: keep the selected color visible in both themes. */
.btn-primary, .btn-primary:active, .btn-primary:focus-visible {
    --bs-btn-bg: var(--primary);
    --bs-btn-border-color: var(--primary);
    --bs-btn-hover-bg: var(--primary-dark);
    --bs-btn-hover-border-color: var(--primary-dark);
    --bs-btn-active-bg: var(--primary-dark);
    --bs-btn-active-border-color: var(--primary-dark);
    background-color: var(--primary) !important;
    border-color: var(--primary) !important;
}
.btn-primary:hover, .btn-primary:focus { background-color: var(--primary-dark) !important; border-color: var(--primary-dark) !important; }
.btn-outline-primary { --bs-btn-color: var(--primary); --bs-btn-border-color: var(--primary); --bs-btn-hover-bg: var(--primary); --bs-btn-hover-border-color: var(--primary); }
.form-check-input:checked { background-color: var(--primary) !important; border-color: var(--primary) !important; }
.page-link, a:not(.side-link):not(.brand-lockup) { --bs-link-color: var(--primary); --bs-link-hover-color: var(--primary-dark); }
.theme-swatch { width: 34px; height: 34px; border: 3px solid var(--surface); outline: 1px solid var(--border); border-radius: 50%; background: var(--swatch); cursor: pointer; }
.theme-swatch:hover, .theme-swatch:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.theme-live-preview { border-color: color-mix(in srgb, var(--primary) 35%, var(--border)); }
.theme-preview-dot { width: 17px; height: 17px; display: inline-block; border-radius: 50%; background: var(--primary); box-shadow: 0 0 0 5px color-mix(in srgb, var(--primary) 14%, transparent); }

/* Keep traditional tabular records on mobile; allow horizontal scrolling instead of stacking cells. */
@media (max-width: 767.98px) {
    .table-responsive {
        display: block;
        width: 100%;
        max-width: 100%;
        overflow-x: auto !important;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior-inline: contain;
        border: 1px solid var(--border);
        border-radius: 12px;
        background: var(--surface);
    }
    .table-responsive > .table {
        width: max-content !important;
        min-width: 760px !important;
        max-width: none !important;
        table-layout: auto !important;
        margin-bottom: 0;
    }
    .table-responsive > .table th,
    .table-responsive > .table td {
        white-space: nowrap !important;
        word-break: normal !important;
        overflow-wrap: normal !important;
        padding: 9px 10px !important;
        font-size: .78rem !important;
        vertical-align: middle;
    }
    .table-responsive > .table td .btn,
    .table-responsive > .table th .btn { white-space: nowrap !important; }
}

/* Replace the remaining hard-coded teal accents with the building's selected brand color. */
.brand-mark { background: linear-gradient(135deg, var(--primary), var(--primary-dark)); box-shadow: 0 7px 18px color-mix(in srgb, var(--primary) 25%, transparent); }
.side-link.active { background: linear-gradient(90deg, color-mix(in srgb, var(--primary) 24%, transparent), color-mix(in srgb, var(--primary) 9%, transparent)); box-shadow: inset -3px 0 var(--primary); }
.side-link.active i { color: color-mix(in srgb, var(--primary) 72%, #fff); }
.building-avatar { color: color-mix(in srgb, var(--primary) 45%, #fff); background: color-mix(in srgb, var(--primary) 18%, transparent); }
.sidebar-help { color: color-mix(in srgb, var(--primary) 45%, #fff); background: color-mix(in srgb, var(--primary) 13%, transparent); }

/* Priority finance shortcuts for resident dashboard */
.member-finance-priority { padding: 18px; border: 1px solid var(--border); border-radius: 18px; background: var(--surface); box-shadow: var(--shadow); }
.member-finance-link { display: flex; align-items: center; gap: 12px; min-height: 82px; height: 100%; padding: 14px; border: 1px solid var(--border); border-radius: 13px; color: var(--text) !important; background: var(--surface); text-decoration: none; transition: transform .16s ease, border-color .16s ease, background .16s ease; }
.member-finance-link:hover { transform: translateY(-2px); border-color: var(--primary); background: var(--surface-hover); }
.member-finance-link > i:first-child { display: grid; place-items: center; width: 42px; height: 42px; flex: 0 0 42px; border-radius: 12px; color: var(--primary); background: color-mix(in srgb, var(--primary) 12%, transparent); font-size: 1.15rem; }
.member-finance-link span { display: grid; gap: 4px; min-width: 0; }
.member-finance-link strong { font-size: .88rem; }
.member-finance-link small { color: var(--muted); font-size: .73rem; line-height: 1.7; }
.member-finance-link .bi-chevron-left { color: var(--muted); }


/* Drill-down financial reports: intuitive clickable periods, units and months. */
.member-charge-period-button, .drilldown-card, .unit-drilldown-link, .month-drilldown-link {
    display: flex; align-items: center; gap: 12px; min-width: 0; height: 100%; padding: 14px;
    border: 1px solid var(--border); border-radius: 14px; color: var(--text) !important;
    background: var(--surface); text-decoration: none; transition: border-color .15s ease, transform .15s ease, background .15s ease;
}
.member-charge-period-button:hover, .drilldown-card:hover, .unit-drilldown-link:hover, .month-drilldown-link:hover {
    border-color: var(--primary); background: var(--surface-hover); transform: translateY(-2px);
}
.member-charge-period-button { justify-content: space-between; }
.member-charge-period-button > span:first-child, .drilldown-card-content, .unit-drilldown-link, .month-drilldown-link { min-width: 0; }
.member-charge-period-button > span:first-child, .drilldown-card-content { display: grid; gap: 4px; }
.member-charge-period-button strong, .drilldown-card strong, .unit-drilldown-link strong, .month-drilldown-link strong { font-size: .9rem; }
.member-charge-period-button small, .drilldown-card small, .unit-drilldown-link span, .month-drilldown-link span, .month-drilldown-link small { color: var(--muted); font-size: .75rem; line-height: 1.7; }
.member-charge-period-button > i, .drilldown-card > i, .unit-drilldown-link > i { color: var(--primary); flex: 0 0 auto; }
.drilldown-card-icon { display: grid; place-items: center; width: 42px; height: 42px; flex: 0 0 42px; border-radius: 12px; color: var(--primary); background: color-mix(in srgb, var(--primary) 12%, transparent); font-size: 1.2rem; }
.drilldown-card-content { flex: 1; }
.unit-drilldown-link, .month-drilldown-link { flex-direction: column; align-items: flex-start; gap: 3px; position: relative; }
.unit-drilldown-link > i { position: absolute; left: 13px; top: 14px; }
.month-drilldown-link { min-height: 118px; }
@media (max-width: 575.98px) { .member-charge-period-button { flex-wrap: wrap; } .member-charge-period-button > span:nth-child(2) { font-size: .76rem; } }

/* Compact, expandable building cash position on the dashboard */
.cash-availability-details { border: 1px solid rgba(24, 126, 117, .28); border-radius: 20px; overflow: hidden; background: var(--surface); box-shadow: var(--shadow); }
.cash-availability-details > summary { list-style: none; }
.cash-availability-details > summary::-webkit-details-marker { display: none; }
.cash-availability-card { display: flex; align-items: center; gap: 18px; padding: 20px 24px; cursor: pointer; color: var(--text); background: linear-gradient(110deg, rgba(20, 107, 111, .10), rgba(32, 164, 143, .07)); }
.cash-availability-icon { display: grid; place-items: center; flex: 0 0 54px; width: 54px; height: 54px; border-radius: 16px; color: #fff; background: linear-gradient(145deg, #176b70, #15917e); font-size: 1.55rem; }
.cash-availability-copy { display: flex; flex: 1; flex-direction: column; gap: 2px; min-width: 0; }
.cash-availability-copy > small { color: var(--muted); font-size: .88rem; font-weight: 700; }
.cash-availability-copy > strong { color: #087c69; font-size: clamp(1.7rem, 4vw, 2.35rem); font-weight: 900; line-height: 1.35; }
.cash-availability-copy > strong small { font-size: .9rem; font-weight: 700; }
.cash-availability-copy > span { color: var(--muted); font-size: .78rem; }
.cash-availability-expand { display: flex; align-items: center; gap: 8px; color: var(--primary); font-size: .82rem; font-weight: 700; white-space: nowrap; }
.cash-availability-details[open] .cash-availability-expand i { transform: rotate(180deg); }
.cash-availability-expand i { transition: transform .18s ease; }
.cash-availability-breakdown { display: grid; gap: 0; padding: 4px 24px 18px; border-top: 1px solid var(--border); }
.cash-availability-breakdown > div { display: flex; justify-content: space-between; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.cash-availability-breakdown > div span { color: var(--muted); }
.cash-availability-breakdown > div strong { color: var(--text); font-weight: 800; }
.cash-availability-breakdown > .cash-availability-net strong { color: #087c69; font-size: 1.08rem; }
.cash-availability-breakdown > p { padding-top: 12px; }
@media (max-width: 575.98px) {
  .cash-availability-card { align-items: flex-start; gap: 12px; padding: 16px; }
  .cash-availability-icon { flex-basis: 42px; width: 42px; height: 42px; border-radius: 13px; font-size: 1.25rem; }
  .cash-availability-expand { align-self: center; font-size: 0; }
  .cash-availability-expand i { font-size: 1rem; }
  .cash-availability-breakdown { padding-right: 16px; padding-left: 16px; }
  .cash-availability-breakdown > div { font-size: .85rem; }
}
