/* Reference dashboard. Scoped overrides leave login and other pages untouched. */
body.dashboard-reference {
    --bg-base: #f1f5f9;
    --bg-card: #fff;
    --bg-card-hover: #f8fafc;
    --bg-input: #fff;
    --bg-glass: #fff;
    --bg-nav: #f1f5f9;
    --border: #e2e8f0;
    --border-strong: #cbd5e1;
    --text-primary: #0f172a;
    --text-secondary: #334155;
    --text-muted: #64748b;
    --primary: #059669;
    --primary-glow: rgb(16 185 129 / 15%);
    --accent: #10b981;
    --income: #047857;
    --income-bg: #ecfdf5;
    --expense: #e11d48;
    --expense-bg: #fff1f2;
    --warning: #b45309;
    --warning-bg: #fffbeb;
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100vh;
    height: 100dvh;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--bg-base);
    color: var(--text-secondary);
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 12px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    color-scheme: light;
}
body.dashboard-reference::before { display: none; }
body.dashboard-reference [hidden],
body.dashboard-reference .screen-view.hidden,
body.dashboard-reference .reference-legacy-hooks { display: none !important; }
body.dashboard-reference button,
body.dashboard-reference input,
body.dashboard-reference select { font: inherit; }
body.dashboard-reference button { cursor: pointer; }
body.dashboard-reference button:focus-visible,
body.dashboard-reference summary:focus-visible,
body.dashboard-reference input:focus-visible,
body.dashboard-reference select:focus-visible,
body.dashboard-reference [tabindex]:focus-visible {
    outline: 2px solid #059669;
    outline-offset: 3px;
}
body.dashboard-reference .reference-icon-definitions { position: absolute; width: 0; height: 0; overflow: hidden; }
body.dashboard-reference .reference-icon {
    width: 16px; height: 16px; flex-shrink: 0;
    fill: none; stroke: currentColor; stroke-width: 1.8;
    stroke-linecap: round; stroke-linejoin: round;
}
body.dashboard-reference .reference-header {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    flex: 0 0 auto; padding: 10px 16px;
    background: #fff; border-bottom: 1px solid rgb(226 232 240 / 90%);
    z-index: 30; box-shadow: 0 1px 2px rgb(0 0 0 / 3%);
}
body.dashboard-reference .reference-brand { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
body.dashboard-reference .reference-brand-icon {
    width: 36px; height: 36px; border-radius: 12px;
    display: flex; align-items: center; justify-content: center; color: #fff;
    background: linear-gradient(35deg, #059669, #14b8a6);
    box-shadow: 0 4px 6px rgb(16 185 129 / 20%);
}
body.dashboard-reference .reference-brand-icon .reference-icon { width: 21px; height: 21px; }
body.dashboard-reference .reference-brand-title { display: flex; align-items: center; gap: 8px; }
body.dashboard-reference .reference-brand h1 { margin: 0; font-size: 14px; font-weight: 800; letter-spacing: -.35px; line-height: 1; color: #0f172a; }
body.dashboard-reference .reference-no-scroll { padding: 2px 6px; border-radius: 4px; font-size: 10px; font-weight: 800; background: #d1fae5; color: #065f46; line-height: 15px; }
body.dashboard-reference .reference-brand p { margin-top: 2px; font-size: 11px; line-height: 1.2; color: #64748b; }
body.dashboard-reference .reference-brand p strong { color: #1e293b; font-weight: 700; }
body.dashboard-reference .reference-screen-nav { display: flex; align-items: center; gap: 4px; padding: 4px; border: 1px solid rgb(226 232 240 / 80%); border-radius: 12px; background: #f1f5f9; }
body.dashboard-reference .screen-btn {
    display: flex; align-items: center; gap: 6px; white-space: nowrap;
    border: 0; border-radius: 8px; padding: 6px 12px;
    color: #475569; background: transparent; font-size: 12px; font-weight: 700;
    transition: background .15s, color .15s;
}
body.dashboard-reference .screen-btn:hover { color: #0f172a; background: #e2e8f0; }
body.dashboard-reference .screen-btn.active,
body.dashboard-reference .screen-btn[aria-pressed="true"] { color: #065f46; background: #fff; box-shadow: 0 1px 2px rgb(0 0 0 / 5%); }
body.dashboard-reference .screen-btn .reference-icon { width: 14px; height: 14px; }
body.dashboard-reference .reference-header-tools { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
body.dashboard-reference .reference-mode-toggle { display: flex; padding: 2px; border-radius: 8px; background: rgb(226 232 240 / 60%); }
body.dashboard-reference .reference-mode-toggle button { border: 0; padding: 4px 10px; border-radius: 6px; color: #475569; background: transparent; font-size: 11px; font-weight: 700; }
body.dashboard-reference .reference-mode-toggle button.active,
body.dashboard-reference .reference-mode-toggle button[aria-pressed="true"] { background: #fff; color: #047857; box-shadow: 0 1px 2px rgb(0 0 0 / 4%); }
body.dashboard-reference .reference-button { display: inline-flex; align-items: center; justify-content: center; gap: 4px; border: 1px solid #e2e8f0; border-radius: 8px; padding: 6px 10px; background: #fff; color: #334155; font-size: 12px; font-weight: 700; white-space: nowrap; }
body.dashboard-reference .reference-button:hover { background: #f8fafc; }
body.dashboard-reference .reference-kpi-strip {
    display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px;
    flex: 0 0 auto; padding: 6px 16px; border-bottom: 1px solid #e2e8f0;
    background: rgb(255 255 255 / 80%); font-size: 11px;
}
body.dashboard-reference .reference-kpi-strip > div { display: flex; align-items: center; gap: 8px; min-width: 0; color: #64748b; }
body.dashboard-reference .reference-kpi-strip strong { color: #0f172a; white-space: nowrap; font-weight: 700; }
body.dashboard-reference .reference-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; background: currentColor; }
body.dashboard-reference .emerald { color: #10b981; }
body.dashboard-reference .indigo { color: #6366f1; }
body.dashboard-reference .teal { color: #14b8a6; }
body.dashboard-reference .purple { color: #a855f7; }
body.dashboard-reference .rose { color: #e11d48; }

/* Small compatibility toolbar, separate from the original top bar. */
body.dashboard-reference .reference-period-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; flex-shrink: 0; padding: 4px 16px; border-bottom: 1px solid #e2e8f0; background: #f8fafc; }
body.dashboard-reference .reference-period-controls,
body.dashboard-reference .reference-account-actions { display: flex; align-items: center; gap: 10px; min-width: 0; }
body.dashboard-reference .reference-account-actions { flex-shrink: 0; flex-wrap: wrap; max-width: 100%; margin-left: auto; }
body.dashboard-reference .month-navigator { display: flex; align-items: center; gap: 6px; padding: 0; border: 0; border-radius: 0; background: none; box-shadow: none; }
body.dashboard-reference .month-navigator .nav-btn { display: grid; place-items: center; width: 24px; height: 24px; padding: 0; border: 0; border-radius: 6px; background: transparent; color: #64748b; font-size: 20px; }
body.dashboard-reference .month-navigator .nav-btn:hover { color: #047857; background: #ecfdf5; transform: none; }
body.dashboard-reference #currentMonth { font-size: 11px; font-weight: 700; color: #475569; min-width: 105px; text-align: center; }
body.dashboard-reference .period-badge { display: none; }
body.dashboard-reference .period-tabs { display: flex; width: auto; gap: 2px; margin: 0; padding: 0; border: 0; background: none; border-radius: 6px; }
body.dashboard-reference .period-tab { display: inline-flex; justify-content: center; flex: none; padding: 3px 7px; border: 0; border-radius: 5px; background: transparent; color: #64748b; font-size: 10px; font-weight: 600; box-shadow: none; }
body.dashboard-reference .period-tab.active { color: #047857; background: #ecfdf5; box-shadow: none; }
body.dashboard-reference .reference-payment-summary { color: #64748b; font-size: 10px; white-space: nowrap; }
body.dashboard-reference .reference-payment-summary strong { color: #334155; }
body.dashboard-reference .reference-budget-indicator { --budget-ink: #475569; --budget-fill: #94a3b8; --budget-bg: #f1f5f9; display: flex; flex-direction: column; justify-content: center; gap: 4px; min-height: 44px; padding: 6px 10px; border: 1px solid var(--budget-fill); border-radius: 10px; background: var(--budget-bg); color: var(--budget-ink); text-align: left; font-size: 11px; font-weight: 800; white-space: nowrap; cursor: pointer; }
body.dashboard-reference .reference-budget-indicator[data-level="safe"] { --budget-ink: #065f46; --budget-fill: #059669; --budget-bg: #ecfdf5; }
body.dashboard-reference .reference-budget-indicator[data-level="warning"] { --budget-ink: #92400e; --budget-fill: #d97706; --budget-bg: #fffbeb; }
body.dashboard-reference .reference-budget-indicator[data-level="danger"] { --budget-ink: #991b1b; --budget-fill: #dc2626; --budget-bg: #fef2f2; }
body.dashboard-reference .reference-budget-indicator-detail { display: flex; align-items: center; gap: 8px; font-size: 10px; font-weight: 600; }
body.dashboard-reference .reference-budget-indicator-track { width: 48px; height: 4px; overflow: hidden; border-radius: 99px; background: rgb(100 116 139 / 20%); }
body.dashboard-reference #budgetToolbarBar { display: block; height: 100%; width: 0; background: var(--budget-fill); transition: width .3s; }
body.dashboard-reference .reference-budget-indicator:focus-visible,
body.dashboard-reference .reference-budget-save:focus-visible { outline: 3px solid #6366f1; outline-offset: 3px; }
body.dashboard-reference .reference-new { min-height: 48px; min-width: 172px; padding: 12px 20px; gap: 10px; font-size: 15px; font-weight: 800; color: #fff; background: #047857; border-color: #047857; border-radius: 12px; box-shadow: 0 4px 12px rgb(4 120 87 / 20%); transition: background .15s, box-shadow .15s; }
body.dashboard-reference .reference-new:hover { background: #065f46; border-color: #065f46; box-shadow: 0 6px 16px rgb(4 120 87 / 25%); }
body.dashboard-reference .reference-new > span { font-size: 24px; line-height: 1; }
body.dashboard-reference .reference-theme-toggle { min-height: 44px; padding: 8px 12px; }
body.dashboard-reference .reference-actions-menu { position: relative; }
body.dashboard-reference .reference-actions-menu summary { display: grid; place-items: center; list-style: none; width: 44px; height: 44px; border: 1px solid #e2e8f0; border-radius: 8px; background: #fff; color: #64748b; cursor: pointer; }
body.dashboard-reference .reference-actions-menu summary::-webkit-details-marker { display: none; }
body.dashboard-reference .reference-actions-dropdown { position: absolute; right: 0; top: calc(100% + 6px); z-index: 50; width: 230px; display: flex; flex-direction: column; gap: 4px; padding: 6px; background: #fff; border: 1px solid #e2e8f0; border-radius: 12px; box-shadow: 0 8px 24px rgb(15 23 42 / 12%); }
body.dashboard-reference .reference-actions-dropdown .btn-action,
body.dashboard-reference .reference-actions-dropdown .btn-logout { width: 100%; min-height: 32px; height: auto; margin: 0; padding: 6px 8px; border: 0; border-radius: 6px; background: #f8fafc; text-align: left; color: #334155; font-size: 11px; box-shadow: none; }
body.dashboard-reference .reference-actions-dropdown .btn-admin { display: none; }
body.dashboard-reference .reference-workspace { flex: 1 1 0; min-height: 0; width: 100%; max-width: none; margin: 0; padding: 14px; overflow: hidden; position: relative; }
body.dashboard-reference .screen-view { height: 100%; width: 100%; min-height: 0; min-width: 0; gap: 14px; }
body.dashboard-reference .reference-overview { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); }
body.dashboard-reference .reference-panel { background: #fff; border: 1px solid rgb(226 232 240 / 90%); border-radius: 16px; padding: 14px; min-height: 0; min-width: 0; box-shadow: 0 1px 2px rgb(0 0 0 / 3%); }
body.dashboard-reference .reference-panel-heading { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding-bottom: 8px; border-bottom: 1px solid #f1f5f9; flex-shrink: 0; }
body.dashboard-reference .reference-panel-heading h2,
body.dashboard-reference .reference-panel-heading h3 { margin: 0; font-size: 12px; font-weight: 800; letter-spacing: 1.2px; text-transform: uppercase; color: #1e293b; }
body.dashboard-reference .reference-panel-heading p { margin: 0; font-size: 11px; color: #94a3b8; }
body.dashboard-reference .reference-tag { padding: 2px 8px; border-radius: 6px; background: #f1f5f9; color: #475569; font-size: 10px; font-weight: 700; white-space: nowrap; }
body.dashboard-reference .reference-tag-emerald { color: #047857; background: #ecfdf5; }
body.dashboard-reference .reference-category-panel { display: flex; flex-direction: column; height: 100%; overflow: hidden; }
body.dashboard-reference .reference-donut-container { position: relative; height: 176px; flex-shrink: 0; margin: 4px 0; display: flex; align-items: center; justify-content: center; }
body.dashboard-reference .reference-rankings { flex: 1 1 0; min-height: 0; overflow-y: auto; padding-right: 4px; margin-top: 4px; }
body.dashboard-reference .reference-rankings > * + * { margin-top: 6px; }
body.dashboard-reference .reference-ranking-row,
body.dashboard-reference .ranking-item { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; padding: 8px; border: 1px solid #f1f5f9; border-radius: 12px; background: #f8fafc; font-size: 12px; color: #1e293b; }
body.dashboard-reference .reference-ranking-row:hover { background: #f1f5f9; }
body.dashboard-reference .reference-ranking-label { display: flex; align-items: center; gap: 8px; min-width: 0; font-weight: 700; }
body.dashboard-reference .reference-ranking-label > span:not(.reference-dot) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body.dashboard-reference .reference-ranking-values { flex-shrink: 0; text-align: right; }
body.dashboard-reference .reference-ranking-values strong { color: #0f172a; font-weight: 800; }
body.dashboard-reference .reference-ranking-row small { color: #94a3b8; font-size: 10px; }
body.dashboard-reference .reference-overview-right { display: flex; flex-direction: column; height: 100%; min-height: 0; gap: 14px; overflow: hidden; }
body.dashboard-reference .reference-timeline-panel { display: flex; flex-direction: column; flex: 1 1 0; min-height: 0; }
body.dashboard-reference .reference-timeline-panel .reference-panel-heading { padding-bottom: 6px; }
body.dashboard-reference .reference-timeline-container { flex: 1 1 0; min-height: 0; position: relative; padding-top: 8px; }
body.dashboard-reference .reference-timeline-container canvas,
body.dashboard-reference .reference-donut-container canvas { max-width: 100%; max-height: 100%; }
body.dashboard-reference .reference-quick-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; height: 112px; flex-shrink: 0; }
body.dashboard-reference .reference-quick-card { display: flex; flex-direction: column; justify-content: space-between; padding: 12px; }
body.dashboard-reference .reference-quick-card > div:first-child { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
body.dashboard-reference .reference-quick-card h3 { font-size: 10px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: #64748b; }
body.dashboard-reference .reference-quick-card p { color: #0f172a; font-size: 16px; font-weight: 800; white-space: nowrap; }
body.dashboard-reference .reference-quick-card p.rose { color: #e11d48; }
body.dashboard-reference .reference-quick-card > span { font-size: 10px; color: #94a3b8; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body.dashboard-reference .reference-mini-track { height: 6px; width: 100%; border-radius: 99px; overflow: hidden; background: #f1f5f9; }
body.dashboard-reference .reference-mini-track > div { height: 100%; background: currentColor; }
body.dashboard-reference .reference-empty { padding: 20px 8px; font-size: 12px; color: #64748b; text-align: center; }
body.dashboard-reference .custom-scroll { scrollbar-width: thin; scrollbar-color: #cbd5e1 #f1f5f9; }
body.dashboard-reference .custom-scroll::-webkit-scrollbar { width: 5px; height: 5px; }
body.dashboard-reference .custom-scroll::-webkit-scrollbar-track { background: #f1f5f9; border-radius: 4px; }
body.dashboard-reference .custom-scroll::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; }
body.dashboard-reference .custom-scroll::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* Dynamic details: three equally sized panels with their own scrolling list. */
body.dashboard-reference .reference-details { display: flex; overflow: hidden; }
body.dashboard-reference .reference-detail-panels { width: 100%; height: 100%; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; min-height: 0; }
body.dashboard-reference .reference-detail-panel { display: flex; flex-direction: column; height: 100%; padding: 16px; overflow: hidden; }
body.dashboard-reference .reference-detail-heading { display: flex; align-items: center; gap: 8px; min-width: 0; }
body.dashboard-reference .reference-detail-icon { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; background: #d1fae5; color: #047857; flex-shrink: 0; }
body.dashboard-reference .reference-detail-panel .reference-panel-heading h3 { letter-spacing: .6px; }
body.dashboard-reference .reference-detail-total { font-weight: 800; font-size: 12px; white-space: nowrap; }
body.dashboard-reference .reference-detail-list { flex: 1 1 0; min-height: 0; overflow-y: auto; padding: 8px 0; }
body.dashboard-reference .reference-detail-item { padding: 10px; background: #f8fafc; border: 1px solid #f1f5f9; border-radius: 12px; }
body.dashboard-reference .reference-detail-item + .reference-detail-item { margin-top: 8px; }
body.dashboard-reference .reference-detail-item > div { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-weight: 700; }
body.dashboard-reference .reference-detail-item strong { color: #0f172a; font-weight: 800; white-space: nowrap; }
body.dashboard-reference .reference-detail-item p { color: #94a3b8; font-size: 10px; margin-top: 2px; }
body.dashboard-reference .reference-detail-impact { flex-shrink: 0; padding: 10px; border-radius: 12px; border: 1px solid #d1fae5; background: rgb(236 253 245 / 60%); color: #064e3b; font-size: 11px; }
body.dashboard-reference .reference-placeholder { display: flex; align-items: center; justify-content: center; }

/* Dynamic statement. */
body.dashboard-reference .reference-statement { display: flex; flex-direction: column; overflow: hidden; border: 1px solid rgb(226 232 240 / 90%); border-radius: 16px; background: #fff; box-shadow: 0 1px 2px rgb(0 0 0 / 3%); }
body.dashboard-reference .reference-table-toolbar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; flex-shrink: 0; padding: 12px; border-bottom: 1px solid #e2e8f0; background: rgb(248 250 252 / 70%); }
body.dashboard-reference .reference-table-search { position: relative; flex: 1 1 200px; max-width: 384px; }
body.dashboard-reference .reference-table-search .reference-icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 13px; height: 13px; color: #94a3b8; }
body.dashboard-reference .reference-table-search input { width: 100%; padding: 6px 12px 6px 32px; border: 1px solid #e2e8f0; border-radius: 12px; background: #fff; color: #334155; font-size: 12px; }
body.dashboard-reference .reference-filter-chips { display: flex; align-items: center; gap: 6px; overflow-x: auto; }
body.dashboard-reference .reference-payment-filters { display: flex; align-items: center; gap: 6px; }
body.dashboard-reference .reference-payment-filters > span { color: #64748b; font-size: 11px; font-weight: 700; white-space: nowrap; }
body.dashboard-reference .reference-payment-filters .payment-chip-paid.active,
body.dashboard-reference .reference-payment-filters .payment-chip-paid[aria-pressed="true"] { background: #ecfdf5; border-color: #a7f3d0; color: #047857; }
body.dashboard-reference .reference-payment-filters .payment-chip-pending.active,
body.dashboard-reference .reference-payment-filters .payment-chip-pending[aria-pressed="true"] { background: #fff1f2; border-color: #fecdd3; color: #be123c; }
body.dashboard-reference .filter-chip { padding: 4px 10px; border: 1px solid #e2e8f0; border-radius: 8px; background: #fff; color: #334155; font-size: 11px; font-weight: 500; white-space: nowrap; }
body.dashboard-reference .filter-chip.active,
body.dashboard-reference .filter-chip[aria-pressed="true"] { background: #1e293b; border-color: #1e293b; color: #fff; font-weight: 700; }
body.dashboard-reference #tableAccountSelect { max-width: 190px; padding: 4px 10px; border: 1px solid #e2e8f0; border-radius: 12px; background: #fff; color: #334155; font-size: 12px; }
body.dashboard-reference #btnToggleLixeira { font-size: 11px; padding: 4px 8px; }
body.dashboard-reference .reference-table-scroll { flex: 1 1 0; min-height: 0; overflow: auto; }
body.dashboard-reference .reference-table { width: 100%; border-collapse: collapse; text-align: left; font-size: 12px; }
body.dashboard-reference .reference-table thead { position: sticky; top: 0; z-index: 10; background: #f8fafc; color: #475569; box-shadow: 0 1px 2px rgb(0 0 0 / 4%); }
body.dashboard-reference .reference-table th { padding: 10px 16px; border-bottom: 1px solid #e2e8f0; font-weight: 700; }
body.dashboard-reference .reference-table td { padding: 8px 16px; border-bottom: 1px solid #f1f5f9; color: #1e293b; }
body.dashboard-reference .reference-table tbody tr:hover { background: #f8fafc; }
body.dashboard-reference .reference-table td:first-child { color: #64748b; font-weight: 600; white-space: nowrap; }
body.dashboard-reference .reference-table td:nth-child(3) { font-weight: 700; }
body.dashboard-reference .reference-amount { text-align: right; white-space: nowrap; font-weight: 800; }
body.dashboard-reference .reference-category-badge { display: inline-flex; align-items: center; gap: 6px; padding: 2px 8px; border-radius: 6px; font-size: 11px; font-weight: 700; background: #f1f5f9; color: #334155; }
body.dashboard-reference .reference-account-badge { padding: 2px 8px; border-radius: 4px; background: #f1f5f9; color: #334155; font-size: 10px; font-weight: 700; }
body.dashboard-reference .reference-account-badge.card { background: #fef3c7; color: #92400e; }
body.dashboard-reference .reference-row-actions { display: inline-flex; gap: 4px; }
body.dashboard-reference .reference-row-actions button { border: 1px solid #e2e8f0; border-radius: 6px; padding: 3px 6px; background: #fff; color: #475569; font-size: 10px; }
body.dashboard-reference .reference-status { white-space: nowrap; text-align: center; }
body.dashboard-reference .reference-table .tx-status-badge { min-height: 30px; padding: 5px 10px; border: 1px solid; border-radius: 8px; font-size: 11px; font-weight: 700; }
body.dashboard-reference .reference-table span.tx-status-badge { cursor: default; }
body.dashboard-reference .reference-table .tx-status-badge.pago { color: #047857; background: #ecfdf5; border-color: #a7f3d0; }
body.dashboard-reference .reference-table .tx-status-badge.pago:hover { color: #065f46; background: #d1fae5; border-color: #34d399; }
body.dashboard-reference .reference-table .tx-status-badge.pendente { color: #be123c; background: #fff1f2; border-color: #fecdd3; }
body.dashboard-reference .reference-table .tx-status-badge.pendente:hover { color: #9f1239; background: #ffe4e6; border-color: #fb7185; }
body.dashboard-reference .reference-table-footer { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-shrink: 0; padding: 8px 16px; border-top: 1px solid #e2e8f0; background: #f8fafc; color: #64748b; font-size: 12px; }
body.dashboard-reference .reference-table-footer > div { display: flex; align-items: center; gap: 8px; }
body.dashboard-reference .reference-table-footer strong { padding: 2px 10px; border: 1px solid #e2e8f0; border-radius: 8px; background: #fff; color: #0f172a; font-size: 14px; font-weight: 800; white-space: nowrap; }

/* Budget thermometer and stacked scenarios. */
body.dashboard-reference .reference-budget { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); overflow: hidden; }
body.dashboard-reference .reference-budget-panel { display: flex; flex-direction: column; justify-content: space-between; height: 100%; padding: 16px; overflow-y: auto; }
body.dashboard-reference .reference-budget-input { margin-top: 16px; }
body.dashboard-reference .reference-budget-input label { display: block; margin-bottom: 4px; color: #334155; font-size: 12px; font-weight: 700; }
body.dashboard-reference .reference-budget-input > div { display: flex; align-items: center; gap: 8px; }
body.dashboard-reference #budgetInputNumber { width: 100%; min-width: 0; padding: 8px 12px; border: 1px solid #e2e8f0; border-radius: 12px; color: #0f172a; background: #fff; font-size: 16px; font-weight: 800; }
body.dashboard-reference .reference-budget-preset { padding: 8px 10px; border: 0; border-radius: 12px; background: #f1f5f9; color: #334155; font-size: 12px; font-weight: 700; white-space: nowrap; }
body.dashboard-reference .reference-budget-preset:hover { background: #e2e8f0; }
body.dashboard-reference .reference-budget-save { margin-top: 12px; min-height: 44px; padding: 10px 18px; background: #047857; color: #fff; border-color: #047857; font-weight: 800; }
body.dashboard-reference .reference-budget-save:hover { background: #065f46; }
body.dashboard-reference .reference-budget-save:disabled { opacity: .7; cursor: wait; }
body.dashboard-reference #budgetSaveStatus { min-height: 2.5em; margin: 8px 0 0; color: var(--text-secondary, #475569); font-size: 12px; overflow-wrap: anywhere; }
body.dashboard-reference #budgetSaveStatus[data-state="saved"] { color: #047857; font-weight: 700; }
body.dashboard-reference #budgetSaveStatus[data-state="error"] { color: #b91c1c; font-weight: 700; }
body.dashboard-reference .reference-budget-gauge { margin-top: 24px; }
body.dashboard-reference .reference-gauge-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; color: #334155; font-size: 12px; font-weight: 700; }
body.dashboard-reference .reference-gauge-heading strong { color: #0f172a; font-size: 14px; font-weight: 800; }
body.dashboard-reference .reference-gauge-track { height: 16px; padding: 2px; border: 1px solid #e2e8f0; border-radius: 99px; overflow: hidden; background: #f1f5f9; }
body.dashboard-reference #budgetGaugeBar { height: 100%; border-radius: 99px; background: #10b981; transition: width .3s; }
body.dashboard-reference .reference-gauge-summary { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-top: 12px; color: #64748b; font-size: 12px; }
body.dashboard-reference #budgetRemainingLabel { color: #047857; font-weight: 800; }
body.dashboard-reference .reference-budget-tip { margin-top: 24px; padding: 12px; border: 1px solid #f1f5f9; border-radius: 12px; background: #f8fafc; color: #64748b; font-size: 12px; }
body.dashboard-reference .reference-scenario-panels { display: flex; flex-direction: column; min-height: 0; height: 100%; gap: 12px; overflow-y: auto; }
body.dashboard-reference .reference-scenario-panel { flex: 1 0 0; display: flex; flex-direction: column; justify-content: space-between; gap: 12px; min-height: 130px; }
body.dashboard-reference .reference-scenario-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: #1e293b; font-size: 12px; font-weight: 700; }
body.dashboard-reference .reference-scenario-panel p { color: #64748b; font-size: 12px; }
body.dashboard-reference .reference-scenario-footer { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-top: 8px; border-top: 1px solid #f1f5f9; color: #64748b; font-size: 12px; }
body.dashboard-reference .reference-scenario-footer strong { font-size: 14px; font-weight: 800; color: #047857; }

/* Existing dialogs retain all hooks and behavior, with opaque reference colors. */
body.dashboard-reference .modal { background: #fff; color: #1e293b; box-shadow: 0 16px 48px rgb(15 23 42 / 18%); }
body.dashboard-reference .modal-overlay { background: rgb(15 23 42 / 45%); }
body.dashboard-reference .type-selector { grid-template-columns: 1fr; }
body.dashboard-reference .form-group input,
body.dashboard-reference .form-group select { color: #0f172a; background: #fff; border-color: #cbd5e1; }
body.dashboard-reference .toast { background: #fff; color: #334155; }

body.dashboard-reference .account-field-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
body.dashboard-reference .account-field-heading label { margin-bottom: 0; }
body.dashboard-reference .account-add-button { flex-shrink: 0; border: 0; border-radius: 6px; padding: 5px 8px; color: #047857; background: #ecfdf5; font-weight: 700; font-size: 12px; }
body.dashboard-reference .account-editor { padding: 12px; margin-top: 10px; border: 1px solid #d1fae5; border-radius: 12px; background: #f0fdf4; }
body.dashboard-reference .account-editor label { font-size: 12px; text-transform: none; letter-spacing: 0; }
body.dashboard-reference .account-editor-controls { display: flex; gap: 8px; align-items: center; }
body.dashboard-reference .account-editor-controls input { min-width: 0; flex: 1; }
body.dashboard-reference .account-editor-controls button { flex-shrink: 0; padding: 12px; border: 0; border-radius: 10px; background: #047857; color: #fff; font-weight: 700; }
body.dashboard-reference .account-editor-controls button:disabled { opacity: .5; cursor: wait; }
body.dashboard-reference .account-message { margin-top: 8px; font-size: 12px; color: #475569; }
body.dashboard-reference .account-message:empty { display: none; }
body.dashboard-reference .account-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
body.dashboard-reference .account-list:empty { display: none; }
body.dashboard-reference .account-list-empty { font-size: 12px; color: #64748b; }
body.dashboard-reference .account-chip { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; padding: 4px 4px 4px 10px; border: 1px solid #a7f3d0; border-radius: 99px; background: #fff; color: #065f46; font-size: 12px; font-weight: 700; }
body.dashboard-reference .account-chip > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body.dashboard-reference .account-chip button { display: grid; place-items: center; width: 22px; height: 22px; flex-shrink: 0; border: 0; border-radius: 50%; background: #fee2e2; color: #be123c; font-size: 14px; font-weight: 800; line-height: 1; }
body.dashboard-reference .account-chip button:hover { background: #fecaca; }
[data-theme="dark"] body.dashboard-reference .account-chip { background: var(--bg-input); border-color: #245c4d; color: var(--income); }
[data-theme="dark"] body.dashboard-reference .account-chip button { background: #54253a; color: #fecdd3; }
[data-theme="dark"] body.dashboard-reference .account-chip button:hover { background: #743247; }
[data-theme="dark"] body.dashboard-reference .account-list-empty { color: var(--text-muted); }

@media (max-width: 1250px) {
    body.dashboard-reference .reference-header { flex-wrap: wrap; }
    body.dashboard-reference .reference-screen-nav { order: 3; width: 100%; justify-content: center; }
    body.dashboard-reference .reference-kpi-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    body.dashboard-reference .reference-panel-heading h2 { letter-spacing: .6px; }
    body.dashboard-reference .reference-payment-summary { display: none; }
}
@media (max-width: 767px) {
    body.dashboard-reference { height: auto; min-height: 100dvh; overflow: auto; }
    body.dashboard-reference .reference-header { padding: 10px 12px; gap: 10px; }
    body.dashboard-reference .reference-header-tools { margin-left: auto; }
    body.dashboard-reference .reference-screen-nav { justify-content: flex-start; overflow-x: auto; }
    body.dashboard-reference .screen-btn { flex-shrink: 0; padding: 8px 10px; min-height: 40px; }
    body.dashboard-reference .reference-mode-toggle { display: none; }
    body.dashboard-reference .reference-no-scroll { display: none; }
    body.dashboard-reference .reference-kpi-strip { padding: 8px 12px; gap: 8px 12px; }
    body.dashboard-reference .reference-kpi-strip > div { flex-wrap: wrap; gap: 3px 6px; font-size: 10px; }
    body.dashboard-reference .reference-kpi-strip strong { padding-left: 14px; width: 100%; }
    body.dashboard-reference .reference-period-toolbar { flex-wrap: wrap; padding: 6px 12px; gap: 6px; }
    body.dashboard-reference .reference-period-controls { flex-wrap: wrap; gap: 4px; width: 100%; }
    body.dashboard-reference .month-navigator .nav-btn { width: 32px; height: 36px; }
    body.dashboard-reference .period-tab { min-height: 36px; padding: 6px 9px; }
    body.dashboard-reference .reference-account-actions { margin-left: 0; width: 100%; flex-wrap: wrap; }
    body.dashboard-reference .reference-budget-indicator { flex: 1 1 170px; }
    body.dashboard-reference .reference-payment-summary { flex: 1 1 auto; text-align: right; }
    body.dashboard-reference .reference-new { flex: 1; min-height: 52px; font-size: 16px; }
    body.dashboard-reference .reference-actions-menu summary { min-height: 44px; }
    body.dashboard-reference .reference-workspace { flex: none; padding: 12px; overflow: visible; }
    body.dashboard-reference .screen-view { height: auto; }
    body.dashboard-reference .reference-overview { grid-template-columns: 1fr; }
    body.dashboard-reference .reference-category-panel { height: auto; }
    body.dashboard-reference .reference-rankings { flex: none; max-height: 320px; }
    body.dashboard-reference .reference-overview-right { height: auto; overflow: visible; }
    body.dashboard-reference .reference-timeline-panel { flex: none; height: 300px; }
    body.dashboard-reference .reference-panel-heading { flex-wrap: wrap; }
    body.dashboard-reference .reference-quick-cards { gap: 8px; }
    body.dashboard-reference .reference-quick-card { padding: 10px; }
    body.dashboard-reference .reference-quick-card h3 { letter-spacing: .2px; font-size: 9px; }
    body.dashboard-reference .reference-quick-card p { font-size: 14px; }
    body.dashboard-reference .reference-detail-panels { grid-template-columns: 1fr; height: auto; }
    body.dashboard-reference .reference-detail-panel { height: auto; min-height: 280px; }
    body.dashboard-reference .reference-detail-list { flex: none; max-height: 320px; }
    body.dashboard-reference .reference-statement { height: min(75dvh, 720px); min-height: 430px; }
    body.dashboard-reference .reference-table-search { max-width: none; flex-basis: 100%; }
    body.dashboard-reference .reference-table-search input { min-height: 40px; }
    body.dashboard-reference .reference-filter-chips { order: 3; width: 100%; }
    body.dashboard-reference .reference-payment-filters { order: 4; width: 100%; overflow-x: auto; }
    body.dashboard-reference .reference-payment-filters .filter-chip { min-height: 36px; }
    body.dashboard-reference .filter-chip { min-height: 36px; }
    body.dashboard-reference #tableAccountSelect,
    body.dashboard-reference #btnToggleLixeira { min-height: 36px; }
    body.dashboard-reference .reference-table { min-width: 760px; }
    body.dashboard-reference .reference-table-footer { flex-wrap: wrap; font-size: 11px; padding: 8px 12px; }
    body.dashboard-reference .reference-budget { grid-template-columns: 1fr; overflow: visible; }
    body.dashboard-reference .reference-budget-panel { height: auto; min-height: 360px; }
    body.dashboard-reference .reference-scenario-panels { height: auto; }
    body.dashboard-reference .reference-scenario-panel { flex: none; min-height: 150px; }
}

/* O tema claro mantém o HTML de referência; o escuro cobre todas as superfícies. */
[data-theme="dark"] body.dashboard-reference {
    color-scheme: dark;
    --bg-base: #0b1220;
    --bg-card: #131e30;
    --bg-card-hover: #1c2b40;
    --bg-input: #0f192a;
    --bg-glass: #131e30;
    --bg-nav: #0f192a;
    --border: #263449;
    --border-strong: #41536b;
    --text-primary: #f1f5f9;
    --text-secondary: #dbe4ef;
    --text-muted: #a3b3c9;
    --primary: #34d399;
    --primary-glow: rgb(52 211 153 / 18%);
    --income: #6ee7b7;
    --income-bg: #123b32;
    --expense: #fda4af;
    --expense-bg: #3b1c2c;
    --warning: #fcd34d;
    --warning-bg: #3b3020;
}
[data-theme="dark"] body.dashboard-reference :is(.reference-header, .reference-kpi-strip, .reference-panel, .reference-statement, .reference-actions-dropdown, .modal, .toast) { background: var(--bg-card); color: var(--text-secondary); border-color: var(--border); }
[data-theme="dark"] body.dashboard-reference :is(.reference-period-toolbar, .reference-screen-nav, .reference-mode-toggle, .reference-ranking-row, .ranking-item, .reference-detail-item, .reference-table-toolbar, .reference-table thead, .reference-table-footer, .reference-budget-tip, .reference-budget-preset, .reference-category-badge, .reference-account-badge, .reference-tag, .reference-mini-track, .reference-gauge-track) { background: var(--bg-input); color: var(--text-secondary); border-color: var(--border); }
[data-theme="dark"] body.dashboard-reference :is(.reference-button:not(.reference-new), .reference-actions-menu summary, .reference-row-actions button, .filter-chip, .reference-table-search input, #tableAccountSelect, #budgetInputNumber, .reference-table-footer strong, .form-group input, .form-group select) { background: var(--bg-input); color: var(--text-secondary); border-color: var(--border-strong); }
[data-theme="dark"] body.dashboard-reference .reference-actions-dropdown :is(.btn-action, .btn-logout) { background: var(--bg-input); color: var(--text-secondary); }
[data-theme="dark"] body.dashboard-reference :is(.reference-brand h1, .reference-brand p strong, .reference-kpi-strip strong, .reference-panel-heading h2, .reference-panel-heading h3, .reference-ranking-values strong, .reference-detail-item strong, .reference-quick-card p:not(.rose), .reference-gauge-heading strong, .reference-scenario-heading, .reference-table-footer strong) { color: var(--text-primary); }
[data-theme="dark"] body.dashboard-reference :is(.reference-brand p, .reference-kpi-strip > div, .reference-panel-heading p, .reference-ranking-row small, .reference-detail-item p, .reference-quick-card h3, .reference-quick-card > span, .reference-empty, .reference-table td:first-child, .reference-table-search .reference-icon, .reference-gauge-summary, .reference-scenario-panel p, .reference-scenario-footer, .reference-payment-summary, .account-message) { color: var(--text-muted); }
[data-theme="dark"] body.dashboard-reference :is(.screen-btn, .period-tab, #currentMonth, .reference-payment-summary strong, .reference-table td, .reference-budget-input label, .reference-gauge-heading) { color: var(--text-secondary); }
[data-theme="dark"] body.dashboard-reference .reference-budget-indicator { --budget-ink: #cbd5e1; --budget-bg: #1e293b; }
[data-theme="dark"] body.dashboard-reference .reference-budget-indicator[data-level="safe"] { --budget-ink: #6ee7b7; --budget-bg: #052e25; }
[data-theme="dark"] body.dashboard-reference .reference-budget-indicator[data-level="warning"] { --budget-ink: #fcd34d; --budget-bg: #38250b; }
[data-theme="dark"] body.dashboard-reference .reference-budget-indicator[data-level="danger"] { --budget-ink: #fca5a5; --budget-bg: #3f151b; }
[data-theme="dark"] body.dashboard-reference #budgetSaveStatus[data-state="saved"] { color: #6ee7b7; }
[data-theme="dark"] body.dashboard-reference #budgetSaveStatus[data-state="error"] { color: #fca5a5; }
[data-theme="dark"] body.dashboard-reference #budgetSaveButton { background: #047857; color: #fff; border-color: #059669; }
[data-theme="dark"] body.dashboard-reference #budgetSaveButton:hover { background: #065f46; }
[data-theme="dark"] body.dashboard-reference :is(.reference-panel-heading, .reference-table th, .reference-table td, .reference-scenario-footer, .reference-detail-impact) { border-color: var(--border); }
[data-theme="dark"] body.dashboard-reference :is(.screen-btn:hover, .reference-ranking-row:hover, .reference-table tbody tr:hover, .reference-button:not(.reference-new):hover, .reference-budget-preset:hover, .reference-row-actions button:hover, .reference-actions-dropdown button:hover) { background: var(--bg-card-hover); color: var(--text-primary); }
[data-theme="dark"] body.dashboard-reference :is(.screen-btn.active, .screen-btn[aria-pressed="true"], .reference-mode-toggle button.active, .reference-mode-toggle button[aria-pressed="true"], .period-tab.active, .reference-tag-emerald, .reference-detail-icon, .reference-detail-impact, .reference-no-scroll, .account-add-button, .account-editor) { color: var(--income); background: var(--income-bg); border-color: #245c4d; }
[data-theme="dark"] body.dashboard-reference .reference-mode-toggle button { color: var(--text-muted); }
[data-theme="dark"] body.dashboard-reference :is(.filter-chip.active, .filter-chip[aria-pressed="true"]) { background: #dbe4ef; color: #0f172a; border-color: #dbe4ef; }
[data-theme="dark"] body.dashboard-reference .reference-payment-filters > span { color: var(--text-muted); }
[data-theme="dark"] body.dashboard-reference .reference-payment-filters .payment-chip-paid.active,
[data-theme="dark"] body.dashboard-reference .reference-payment-filters .payment-chip-paid[aria-pressed="true"] { background: #123b32; border-color: #245c4d; color: #6ee7b7; }
[data-theme="dark"] body.dashboard-reference .reference-payment-filters .payment-chip-pending.active,
[data-theme="dark"] body.dashboard-reference .reference-payment-filters .payment-chip-pending[aria-pressed="true"] { background: #3b1c2c; border-color: #743247; color: #fda4af; }
[data-theme="dark"] body.dashboard-reference .reference-account-badge.card { color: var(--warning); background: var(--warning-bg); }
[data-theme="dark"] body.dashboard-reference :is(.reference-quick-card p.rose, .rose) { color: var(--expense); }
[data-theme="dark"] body.dashboard-reference :is(#budgetRemainingLabel, .reference-scenario-footer strong, [data-clear-category]) { color: var(--income); }
[data-theme="dark"] body.dashboard-reference .reference-new { background: #34d399; border-color: #34d399; color: #052e23; box-shadow: 0 4px 16px rgb(52 211 153 / 15%); }
[data-theme="dark"] body.dashboard-reference .reference-new:hover { background: #6ee7b7; border-color: #6ee7b7; }
[data-theme="dark"] body.dashboard-reference .account-editor-controls button { background: #34d399; color: #052e23; }
[data-theme="dark"] body.dashboard-reference .reference-table .tx-status-badge.pago { color: var(--income); background: var(--income-bg); border-color: #245c4d; }
[data-theme="dark"] body.dashboard-reference .reference-table .tx-status-badge.pago:hover { color: #a7f3d0; background: #195244; border-color: #34d399; }
[data-theme="dark"] body.dashboard-reference .reference-table .tx-status-badge.pendente { color: var(--expense); background: var(--expense-bg); border-color: #743247; }
[data-theme="dark"] body.dashboard-reference .reference-table .tx-status-badge.pendente:hover { color: #fecdd3; background: #54253a; border-color: #fb7185; }
[data-theme="dark"] body.dashboard-reference .modal-overlay { background: rgb(2 6 23 / 75%); }

/* Nova despesa: todos os campos no mesmo painel, com duas colunas compactas. */
body.dashboard-reference #modalOverlay .modal { width: 90%; max-width: 540px; max-height: min(94vh, 680px); max-height: min(94dvh, 680px); padding: 16px 18px 20px; overscroll-behavior: contain; }
body.dashboard-reference #modalOverlay .modal-header { align-items: flex-start; gap: 12px; margin-bottom: 10px; }
body.dashboard-reference #modalOverlay .expense-intro { margin-top: 4px; color: #475569; font-size: 13px; line-height: 1.45; }
body.dashboard-reference #modalOverlay .expense-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 12px; }
body.dashboard-reference #modalOverlay .expense-fields > .form-group { min-width: 0; margin: 0; }
body.dashboard-reference #modalOverlay .expense-fields > :is(.expense-account-group, .switch-group) { grid-column: 1 / -1; }
body.dashboard-reference #modalOverlay .expense-fields .form-group label { margin-bottom: 4px; font-size: 12px; }
body.dashboard-reference #modalOverlay .expense-fields .form-group :is(input, select) { min-width: 0; min-height: 44px; padding: 10px 12px; }
body.dashboard-reference #modalOverlay #data { font-size: 14px; }
body.dashboard-reference #modalOverlay #btnSubmit { min-height: 48px; margin-top: 12px; }
/* O cadastro é uma tarefa auxiliar: ao abri-lo, preserve os valores da despesa sem empilhar outro formulário. */
body.dashboard-reference #modalOverlay #transactionForm.account-editor-open .expense-fields > .form-group:not(.expense-account-group),
body.dashboard-reference #modalOverlay #transactionForm.account-editor-open :is(#conta, #contaHint, #contaError, #btnSubmit) { display: none; }
body.dashboard-reference #modalOverlay .account-manage { margin-top: 8px; font-size: 12px; }
body.dashboard-reference #modalOverlay .account-manage summary { min-height: 36px; display: flex; align-items: center; color: #047857; font-weight: 700; cursor: pointer; }
body.dashboard-reference #modalOverlay .modal-close { flex: 0 0 44px; width: 44px; height: 44px; }
body.dashboard-reference #modalOverlay .account-add-button { min-height: 44px; padding: 8px 12px; text-align: center; }
body.dashboard-reference #modalOverlay .account-chip button { width: 36px; height: 36px; font-size: 20px; }
body.dashboard-reference #modalOverlay .form-error { display: block; margin-top: 6px; color: #b91c1c; font-size: 13px; font-weight: 700; line-height: 1.35; }
body.dashboard-reference #modalOverlay .form-error[hidden], body.dashboard-reference #modalOverlay .transaction-message[hidden] { display: none; }
body.dashboard-reference #modalOverlay [aria-invalid="true"] { border-color: #b91c1c; }
body.dashboard-reference #modalOverlay .transaction-message { margin: 10px 0; padding: 10px 12px; border-radius: 8px; background: #fef2f2; color: #991b1b; font-size: 13px; font-weight: 700; }
body.dashboard-reference #modalOverlay .switch-group { padding: 12px; border: 1px solid #d1fae5; border-radius: 10px; background: #f0fdf4; }
body.dashboard-reference #modalOverlay .switch-container { position: relative; display: flex; align-items: center; min-height: 44px; }
body.dashboard-reference #modalOverlay .switch-container input { display: block; position: absolute; width: 44px; height: 44px; margin: 0; opacity: 0; cursor: pointer; }
body.dashboard-reference #modalOverlay .switch-container input:focus-visible + .switch-slider { outline: 3px solid #047857; outline-offset: 3px; }
body.dashboard-reference #modalOverlay .switch-text { color: #0f172a; font-size: 14px; font-weight: 700; }
body.dashboard-reference #modalOverlay .btn-submit { min-height: 48px; font-size: 16px; }
[data-theme="dark"] body.dashboard-reference #modalOverlay :is(.expense-intro, .switch-text) { color: var(--text-secondary); }
[data-theme="dark"] body.dashboard-reference #modalOverlay .switch-group { background: var(--income-bg); border-color: #245c4d; }
[data-theme="dark"] body.dashboard-reference #modalOverlay .account-manage summary { color: var(--income); }
[data-theme="dark"] body.dashboard-reference #modalOverlay .form-error { color: #fda4af; }
[data-theme="dark"] body.dashboard-reference #modalOverlay [aria-invalid="true"] { border-color: #fda4af; }
[data-theme="dark"] body.dashboard-reference #modalOverlay .transaction-message { background: #3b1727; color: #fecdd3; }
@media (max-width: 560px) {
    body.dashboard-reference #modalOverlay .modal { width: 96%; max-height: 94vh; max-height: 94dvh; padding: 12px 14px calc(12px + env(safe-area-inset-bottom)); }
    body.dashboard-reference #modalOverlay .modal-header { margin-bottom: 6px; }
    body.dashboard-reference #modalOverlay .expense-intro { display: none; }
    body.dashboard-reference #modalOverlay .expense-fields { gap: 6px 8px; }
    body.dashboard-reference #modalOverlay .expense-fields > .form-group > .form-hint,
    body.dashboard-reference #modalOverlay #pagoText { display: none; }
    body.dashboard-reference #modalOverlay .expense-fields > .form-group:nth-child(-n+4) > label { min-height: 36px; }
    body.dashboard-reference #modalOverlay .expense-fields .form-group :is(input, select) { padding: 8px; }
    body.dashboard-reference #modalOverlay #data { font-size: 13px; }
    body.dashboard-reference #modalOverlay .account-field-heading { gap: 6px; }
    body.dashboard-reference #modalOverlay .account-field-heading label { flex: 1; min-width: 0; line-height: 1.25; }
    body.dashboard-reference #modalOverlay .account-add-button { width: auto; max-width: 48%; }
    body.dashboard-reference #modalOverlay #transactionForm.account-editor-open #accountEditor > .form-hint { display: none; }
    body.dashboard-reference #modalOverlay .account-editor-controls { flex-direction: column; align-items: stretch; }
    body.dashboard-reference #modalOverlay .account-editor-controls button { min-height: 44px; }
    body.dashboard-reference #modalOverlay .switch-group { padding: 6px 10px; }
    body.dashboard-reference #modalOverlay #btnSubmit { margin-top: 8px; margin-bottom: env(safe-area-inset-bottom); }
}
[data-theme="dark"] body.dashboard-reference .custom-scroll { scrollbar-color: #41536b #0f192a; }
[data-theme="dark"] body.dashboard-reference .custom-scroll::-webkit-scrollbar-track { background: var(--bg-input); }
[data-theme="dark"] body.dashboard-reference .custom-scroll::-webkit-scrollbar-thumb { background: var(--border-strong); }
[data-theme="dark"] body.dashboard-reference :is(button, input, select, summary, [tabindex]):focus-visible { outline-color: var(--primary); }
/* Mobile: all four screens visible, clear hierarchy and comfortable touch targets. */
@media (max-width: 767px) {
    body.dashboard-reference .reference-header { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px 8px; padding: 14px 12px 12px; }
    body.dashboard-reference .reference-brand { min-width: 0; gap: 8px; flex-shrink: 1; }
    body.dashboard-reference .reference-brand > div:last-child { min-width: 0; }
    body.dashboard-reference .reference-brand-icon { width: 32px; height: 32px; border-radius: 10px; flex-shrink: 0; }
    body.dashboard-reference .reference-brand h1 { font-size: clamp(.8rem, 3.3vw, .95rem); line-height: 1.3; overflow-wrap: anywhere; }
    body.dashboard-reference .reference-brand p { font-size: .625rem; line-height: 1.5; margin: 2px 0 0; }
    body.dashboard-reference .reference-header-tools { gap: 6px; margin: 0; }
    body.dashboard-reference .reference-theme-toggle,
    body.dashboard-reference #btnExportCSV { width: 44px; height: 44px; min-height: 44px; padding: 0; border-radius: 12px; }
    body.dashboard-reference .reference-theme-toggle { font-size: 0; }
    body.dashboard-reference .reference-theme-toggle::before { content: '☾'; font-size: 1.25rem; }
    body.dashboard-reference .reference-theme-toggle[aria-pressed="true"]::before { content: '☀'; }
    body.dashboard-reference #btnExportCSV span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
    body.dashboard-reference .reference-screen-nav { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; padding: 4px; overflow: visible; width: 100%; }
    body.dashboard-reference .screen-btn { width: 100%; min-width: 0; min-height: 44px; justify-content: flex-start; padding: 8px; font-size: .6875rem; white-space: normal; line-height: 1.35; }
    body.dashboard-reference .screen-btn span { min-width: 0; }
    body.dashboard-reference .reference-kpi-strip { padding: 10px 12px; gap: 10px 12px; }
    body.dashboard-reference .reference-kpi-strip > div { font-size: .625rem; }
    body.dashboard-reference .reference-kpi-strip strong { font-size: .6875rem; }
    body.dashboard-reference .reference-period-toolbar { padding: 8px 12px 12px; gap: 10px; }
    body.dashboard-reference .reference-period-controls { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; }
    body.dashboard-reference .month-navigator { justify-content: space-between; width: 100%; }
    body.dashboard-reference .month-navigator .nav-btn { min-width: 44px; min-height: 44px; border: 1px solid var(--border); border-radius: 10px; }
    body.dashboard-reference #currentMonth { font-size: .8125rem; }
    body.dashboard-reference .period-tabs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); width: 100%; padding: 3px; border: 1px solid var(--border); background: var(--bg-card); border-radius: 12px; }
    body.dashboard-reference .period-tab { min-width: 0; min-height: 44px; padding: 8px 3px; font-size: .6875rem; border-radius: 9px; white-space: normal; overflow-wrap: anywhere; }
    body.dashboard-reference .reference-account-actions { display: grid; grid-template-columns: minmax(0, 1fr) 48px; gap: 8px; }
    body.dashboard-reference .reference-budget-indicator { grid-column: 1 / -1; min-height: 56px; padding: 10px 12px; font-size: .8125rem; white-space: normal; overflow-wrap: anywhere; }
    body.dashboard-reference .reference-budget-indicator-detail { font-size: .6875rem; justify-content: space-between; }
    body.dashboard-reference .reference-budget-indicator-track { width: 35%; height: 5px; }
    body.dashboard-reference .reference-payment-summary { grid-column: 1 / -1; display: block; padding: 6px 2px; text-align: left; font-size: .6875rem; white-space: normal; overflow-wrap: anywhere; }
    body.dashboard-reference .reference-new { min-width: 0; min-height: 48px; padding: 10px 14px; font-size: .875rem; white-space: normal; }
    body.dashboard-reference .reference-actions-menu summary { width: 48px; height: 48px; border-radius: 12px; }
    body.dashboard-reference .reference-workspace { padding: 12px; }
    body.dashboard-reference .reference-panel { border-radius: 16px; }
    body.dashboard-reference .reference-budget-panel { min-height: 0; padding: 16px; justify-content: flex-start; }
    body.dashboard-reference .reference-budget-input { margin-top: 16px; }
    body.dashboard-reference .reference-budget-input label { margin-bottom: 8px; font-size: .8125rem; }
    body.dashboard-reference .reference-budget-input > div { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
    body.dashboard-reference #budgetInputNumber { grid-column: 1 / -1; min-height: 52px; padding: 12px 14px; font-size: 1.25rem; border-radius: 12px; }
    body.dashboard-reference .reference-budget-preset { min-height: 44px; padding: 10px 6px; font-size: .8125rem; border: 1px solid var(--border); border-radius: 10px; }
    body.dashboard-reference .reference-budget-save { width: 100%; min-height: 48px; margin-top: 12px; font-size: .875rem; border-radius: 12px; }
    body.dashboard-reference #budgetSaveStatus { min-height: 1.5em; font-size: .75rem; line-height: 1.5; }
    body.dashboard-reference .reference-budget-gauge { margin-top: 20px; }
    body.dashboard-reference .reference-gauge-heading { font-size: .8125rem; flex-wrap: wrap; gap: 8px; }
    body.dashboard-reference .reference-gauge-summary { align-items: flex-start; flex-wrap: wrap; font-size: .75rem; }
    body.dashboard-reference .reference-budget-tip { margin-top: 20px; font-size: .75rem; line-height: 1.65; }
    body.dashboard-reference .reference-scenario-panels { gap: 10px; }
    body.dashboard-reference .reference-scenario-panel { flex: none; min-height: 0; gap: 14px; padding: 16px; }
    body.dashboard-reference .reference-scenario-heading { font-size: .8125rem; line-height: 1.5; }
    body.dashboard-reference .reference-scenario-panel p { font-size: .75rem; line-height: 1.6; }
    body.dashboard-reference .reference-table-toolbar :is(input, select) { min-height: 44px; font-size: 1rem; }
    body.dashboard-reference .reference-row-actions button { min-width: 44px; min-height: 44px; }
}
@media (prefers-reduced-motion: reduce) {
    body.dashboard-reference *, body.dashboard-reference *::before, body.dashboard-reference *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* Mobile paginado: uma tarefa por tela; desktop mantém os painéis lado a lado. */
body.dashboard-reference .mobile-only { display: none; }
body.dashboard-reference .mobile-controls-dialog { margin: auto; width: min(94vw, 440px); max-height: 90dvh; padding: 16px; border: 1px solid var(--border); border-radius: 20px; background: var(--bg-card); color: var(--text-primary); overflow: auto; }
body.dashboard-reference .mobile-controls-dialog::backdrop { background: rgb(2 6 23 / 65%); }
body.dashboard-reference .mobile-dialog-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 16px; }
body.dashboard-reference .mobile-dialog-heading h2 { font-size: 1rem; margin: 0; }
body.dashboard-reference .mobile-dialog-heading button { min-height: 44px; }

@media (max-width: 767px) {
    body.dashboard-reference.mobile-paged { height: 100dvh; min-height: 0; overflow: hidden; }
    body.dashboard-reference.mobile-paged .mobile-only { display: block; }
    body.dashboard-reference.mobile-paged .desktop-label,
    body.dashboard-reference.mobile-paged .mobile-page-hidden { display: none !important; }
    body.dashboard-reference.mobile-paged .reference-header { flex: 0 0 auto; padding: calc(8px + env(safe-area-inset-top)) 12px 8px; gap: 8px; }
    body.dashboard-reference.mobile-paged .reference-brand p { font-size: .625rem; }
    body.dashboard-reference.mobile-paged #mobileSettingsButton { min-height: 44px; font-size: .75rem; }
    body.dashboard-reference.mobile-paged .reference-period-toolbar { padding: 4px 12px 8px; gap: 4px; }
    body.dashboard-reference.mobile-paged .month-navigator .nav-btn { min-height: 36px; height: 36px; border: 0; }
    body.dashboard-reference.mobile-paged .reference-account-actions { gap: 4px 8px; grid-template-columns: minmax(0, 1fr) 44px; }
    body.dashboard-reference.mobile-paged .reference-budget-indicator { min-height: 40px; padding: 5px 10px; gap: 1px; font-size: .75rem; }
    body.dashboard-reference.mobile-paged .reference-budget-indicator-detail { font-size: .625rem; }
    body.dashboard-reference.mobile-paged .reference-payment-summary { padding: 2px; font-size: .625rem; }
    body.dashboard-reference.mobile-paged .reference-new { min-height: 44px; padding: 8px 12px; font-size: .8125rem; }
    body.dashboard-reference.mobile-paged .reference-actions-menu summary { width: 44px; height: 44px; }
    body.dashboard-reference.mobile-paged .reference-actions-dropdown { max-height: 55dvh; overflow-y: auto; }
    body.dashboard-reference.mobile-paged .reference-actions-dropdown :is(.btn-action, .btn-logout) { min-height: 44px; }
    body.dashboard-reference.mobile-paged .reference-workspace { flex: 1 1 0; min-height: 0; padding: 8px 12px; overflow-y: auto; overscroll-behavior: contain; }
    body.dashboard-reference.mobile-paged .screen-view { height: 100%; min-height: min-content; gap: 8px; }
    body.dashboard-reference.mobile-paged :is(.reference-overview, .reference-details, .reference-budget) { display: flex; flex-direction: column; overflow: visible; }
    body.dashboard-reference.mobile-paged .mobile-subnav { display: flex; flex: 0 0 auto; gap: 4px; padding: 3px; background: var(--bg-input); border: 1px solid var(--border); border-radius: 12px; }
    body.dashboard-reference.mobile-paged .mobile-subnav button { flex: 1; min-width: 0; min-height: 44px; padding: 4px; border: 0; border-radius: 9px; background: transparent; color: var(--text-secondary); font-size: .6875rem; font-weight: 700; overflow-wrap: anywhere; }
    body.dashboard-reference.mobile-paged .mobile-subnav button[aria-pressed="true"] { background: var(--income-bg); color: var(--income); }
    body.dashboard-reference.mobile-paged .reference-panel { padding: 12px; }
    body.dashboard-reference.mobile-paged .reference-panel-heading { gap: 4px; }
    body.dashboard-reference.mobile-paged .reference-panel-heading :is(h2, h3) { font-size: .6875rem; letter-spacing: .3px; }
    body.dashboard-reference.mobile-paged .reference-panel-heading p { color: var(--text-muted); }
    body.dashboard-reference.mobile-paged .reference-category-panel { flex: 1 0 auto; height: auto; }
    body.dashboard-reference.mobile-paged .reference-donut-container { height: clamp(120px, 26dvh, 240px); margin: auto 0; }
    body.dashboard-reference.mobile-paged #screen-1[data-mobile-view="distribution"] :is(.reference-rankings, #mobileRankingPager, .reference-overview-right),
    body.dashboard-reference.mobile-paged #screen-1[data-mobile-view="ranking"] :is(.reference-donut-container, .reference-overview-right),
    body.dashboard-reference.mobile-paged #screen-1[data-mobile-view="timeline"] :is(.reference-category-panel, .reference-quick-cards),
    body.dashboard-reference.mobile-paged #screen-1[data-mobile-view="accounts"] :is(.reference-category-panel, .reference-timeline-panel) { display: none; }
    body.dashboard-reference.mobile-paged .reference-rankings { flex: 1 0 auto; max-height: none; padding: 12px 0; overflow: visible; }
    body.dashboard-reference.mobile-paged .reference-ranking-row { flex-direction: column; align-items: flex-start; justify-content: center; min-height: 140px; padding: 16px; gap: 20px; }
    body.dashboard-reference.mobile-paged .reference-ranking-label { font-size: .875rem; }
    body.dashboard-reference.mobile-paged .reference-ranking-label > span:not(.reference-dot) { white-space: normal; overflow-wrap: anywhere; }
    body.dashboard-reference.mobile-paged .reference-ranking-values strong { font-size: 1.5rem; }
    body.dashboard-reference.mobile-paged .reference-ranking-row small { color: var(--text-muted); }
    body.dashboard-reference.mobile-paged .reference-overview-right { flex: 1 0 auto; height: auto; overflow: visible; }
    body.dashboard-reference.mobile-paged .reference-timeline-panel { flex: 1; height: auto; min-height: 240px; }
    body.dashboard-reference.mobile-paged .reference-timeline-container { min-height: 170px; }
    body.dashboard-reference.mobile-paged .reference-quick-cards { height: auto; grid-template-columns: 1fr; gap: 8px; }
    body.dashboard-reference.mobile-paged .reference-quick-card { min-height: 76px; gap: 4px; }
    body.dashboard-reference.mobile-paged .reference-quick-card h3 { font-size: .6875rem; }
    body.dashboard-reference.mobile-paged .reference-quick-card p { font-size: 1.125rem; }
    body.dashboard-reference.mobile-paged .reference-quick-card > span { white-space: normal; color: var(--text-muted); overflow-wrap: anywhere; }
    body.dashboard-reference.mobile-paged .mobile-pager { display: flex; align-items: center; justify-content: space-between; flex: 0 0 auto; gap: 8px; padding: 8px 0 0; }
    body.dashboard-reference.mobile-paged .mobile-pager button { min-height: 44px; padding: 6px 10px; border: 1px solid var(--border-strong); border-radius: 10px; color: var(--text-secondary); background: var(--bg-input); font-size: .75rem; font-weight: 700; }
    body.dashboard-reference.mobile-paged .mobile-pager button[aria-disabled="true"] { color: var(--text-muted); background: var(--bg-base); cursor: default; }
    body.dashboard-reference.mobile-paged .mobile-pager span { font-size: .6875rem; color: var(--text-muted); }
    body.dashboard-reference.mobile-paged .mobile-group-control { flex: 0 0 auto; }
    body.dashboard-reference.mobile-paged .mobile-group-control label { display: block; font-size: .6875rem; font-weight: 700; color: var(--text-muted); margin-bottom: 4px; }
    body.dashboard-reference.mobile-paged .mobile-group-control select { width: 100%; min-height: 44px; border: 1px solid var(--border-strong); border-radius: 12px; padding: 8px; background: var(--bg-input); color: var(--text-primary); font-size: .8125rem; }
    body.dashboard-reference.mobile-paged .reference-detail-panels { display: flex; flex: 1 0 auto; height: auto; }
    body.dashboard-reference.mobile-paged .reference-detail-panel { width: 100%; min-height: 0; height: auto; }
    body.dashboard-reference.mobile-paged .reference-detail-list { flex: 1 0 auto; max-height: none; overflow: visible; }
    body.dashboard-reference.mobile-paged .reference-detail-item { margin-top: 8px; }
    body.dashboard-reference.mobile-paged .reference-detail-item > div { flex-wrap: wrap; font-size: .875rem; }
    body.dashboard-reference.mobile-paged .reference-detail-item p { color: var(--text-muted); font-size: .6875rem; overflow-wrap: anywhere; }
    body.dashboard-reference.mobile-paged .reference-statement { min-height: min-content; height: 100%; gap: 4px; overflow: visible; }
    body.dashboard-reference.mobile-paged .mobile-statement-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 4px 12px; }
    body.dashboard-reference.mobile-paged .mobile-statement-heading h2 { font-size: .8125rem; margin: 0; }
    body.dashboard-reference.mobile-paged #mobileFiltersButton { min-height: 44px; }
    body.dashboard-reference.mobile-paged .reference-table-scroll { flex: 1 0 auto; overflow: visible; }
    body.dashboard-reference.mobile-paged .reference-table { min-width: 0; display: block; }
    body.dashboard-reference.mobile-paged .reference-table thead { display: none; }
    body.dashboard-reference.mobile-paged .reference-table tbody { display: block; }
    body.dashboard-reference.mobile-paged .reference-table tr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 0 12px; }
    body.dashboard-reference.mobile-paged .reference-table td { display: block; min-width: 0; padding: 3px 0; border: 0; text-align: left; white-space: normal; overflow-wrap: anywhere; }
    body.dashboard-reference.mobile-paged .reference-table td::before { display: block; color: var(--text-muted); font-size: .625rem; font-weight: 500; }
    body.dashboard-reference.mobile-paged .reference-table td:nth-child(1)::before { content: 'Data'; }
    body.dashboard-reference.mobile-paged .reference-table td:nth-child(2)::before { content: 'Categoria'; }
    body.dashboard-reference.mobile-paged .reference-table td:nth-child(4)::before { content: 'Conta'; }
    body.dashboard-reference.mobile-paged .reference-table td:nth-child(5)::before { content: 'Valor'; }
    body.dashboard-reference.mobile-paged .reference-table td:nth-child(3) { grid-column: 1 / -1; grid-row: 1; font-size: .9375rem; }
    body.dashboard-reference.mobile-paged .reference-table td:nth-child(5) { font-size: 1rem; }
    body.dashboard-reference.mobile-paged .reference-table .reference-category-badge { max-width: 100%; white-space: normal; padding-left: 0; border: 0; }
    body.dashboard-reference.mobile-paged .reference-table :is(.tx-status-badge, .reference-row-actions button) { min-height: 44px; }
    body.dashboard-reference.mobile-paged #mobileStatementPager { padding: 4px 12px 8px; }
    body.dashboard-reference.mobile-paged .reference-table-footer { padding: 8px 12px; font-size: .625rem; gap: 4px; }
    body.dashboard-reference.mobile-paged .reference-table-footer strong { padding: 2px 4px; font-size: .8125rem; }
    body.dashboard-reference.mobile-paged .reference-budget-panel { height: auto; flex: 1 0 auto; overflow: visible; }
    body.dashboard-reference.mobile-paged #screen-4[data-mobile-view="budget"] :is(.reference-scenario-panels, #mobileScenarioPager),
    body.dashboard-reference.mobile-paged #screen-4[data-mobile-view="consumption"] :is(.reference-scenario-panels, #mobileScenarioPager),
    body.dashboard-reference.mobile-paged #screen-4[data-mobile-view="budget"] :is(.reference-budget-gauge, .reference-budget-tip),
    body.dashboard-reference.mobile-paged #screen-4[data-mobile-view="consumption"] :is(.reference-budget-input, .reference-budget-save, #budgetSaveStatus),
    body.dashboard-reference.mobile-paged #screen-4[data-mobile-view="scenarios"] .reference-budget-panel { display: none; }
    body.dashboard-reference.mobile-paged .reference-budget-input { margin-top: 8px; }
    body.dashboard-reference.mobile-paged .reference-budget-input label { font-size: .75rem; margin-bottom: 4px; }
    body.dashboard-reference.mobile-paged .reference-budget-input > div { gap: 4px; }
    body.dashboard-reference.mobile-paged #budgetInputNumber { min-height: 44px; padding: 8px 12px; font-size: 1rem; }
    body.dashboard-reference.mobile-paged .reference-budget-preset { padding: 6px; font-size: .75rem; }
    body.dashboard-reference.mobile-paged .reference-budget-save { min-height: 44px; margin-top: 8px; padding: 8px; }
    body.dashboard-reference.mobile-paged #budgetSaveStatus { margin-top: 4px; font-size: .6875rem; }
    body.dashboard-reference.mobile-paged .reference-budget-gauge { margin-top: 8px; }
    body.dashboard-reference.mobile-paged .reference-gauge-summary { padding-top: 4px; font-size: .6875rem; }
    body.dashboard-reference.mobile-paged .reference-budget-tip { margin-top: 8px; padding: 8px; font-size: .625rem; line-height: 1.5; }
    body.dashboard-reference.mobile-paged .reference-scenario-panels { flex: 1 0 auto; height: auto; overflow: visible; }
    body.dashboard-reference.mobile-paged .reference-scenario-panel { flex: 1; min-height: 220px; }
    body.dashboard-reference.mobile-paged #mobileNavigation { flex: 0 0 auto; padding: 4px 12px calc(4px + env(safe-area-inset-bottom)); background: var(--bg-card); border-top: 1px solid var(--border); }
    body.dashboard-reference.mobile-paged #mobileNavigation .reference-screen-nav { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); padding: 0; border: 0; gap: 4px; background: transparent; }
    body.dashboard-reference.mobile-paged #mobileNavigation .screen-btn { min-height: 56px; flex-direction: column; justify-content: center; gap: 4px; padding: 6px 2px; font-size: .6875rem; color: var(--text-secondary); }
    body.dashboard-reference.mobile-paged #mobileNavigation .screen-btn .reference-icon { width: 20px; height: 20px; }
    body.dashboard-reference.mobile-paged #mobileNavigation .screen-btn.active { background: var(--income-bg); color: var(--income); box-shadow: none; }
    body.dashboard-reference.mobile-paged #mobileSettingsContent .reference-header-tools { flex-wrap: wrap; gap: 8px; }
    body.dashboard-reference.mobile-paged #mobileSettingsContent .reference-mode-toggle { display: flex; }
    body.dashboard-reference.mobile-paged #mobileSettingsContent .reference-mode-toggle button { min-height: 44px; }
    body.dashboard-reference.mobile-paged #mobileSettingsContent .period-tabs { margin-top: 16px; }
    body.dashboard-reference.mobile-paged #mobileSettingsContent .reference-kpi-strip { margin-top: 16px; grid-template-columns: 1fr; padding: 12px 0; }
    body.dashboard-reference.mobile-paged #mobileFiltersContent .reference-table-toolbar { flex-direction: column; align-items: stretch; padding: 0; border: 0; background: none; }
    body.dashboard-reference.mobile-paged #mobileFiltersContent .reference-table-search { flex: none; }
    body.dashboard-reference.mobile-paged #mobileFiltersContent .reference-filter-chips { flex-wrap: wrap; overflow: visible; }
    body.dashboard-reference.mobile-paged #mobileFiltersContent .reference-payment-filters { flex-wrap: wrap; overflow: visible; }
    body.dashboard-reference.mobile-paged #mobileFiltersContent :is(.filter-chip, #btnToggleLixeira, #tableAccountSelect) { min-height: 44px; max-width: 100%; }
}

/* Paisagem/teclado: prioriza acesso ao conteúdo em vez de cortar campos. */
@media (max-width: 767px) and (max-height: 560px) {
    body.dashboard-reference.mobile-paged { height: auto; min-height: 100dvh; overflow-y: auto; }
    body.dashboard-reference.mobile-paged .reference-workspace { flex: none; height: auto; overflow: visible; }
    body.dashboard-reference.mobile-paged .screen-view { height: auto; }
    body.dashboard-reference.mobile-paged #mobileNavigation { position: sticky; bottom: 0; z-index: 30; }
}
