html, body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

@supports (padding: env(safe-area-inset-top)) {
    body {
        padding-top: env(safe-area-inset-top);
        padding-right: env(safe-area-inset-right);
        padding-bottom: env(safe-area-inset-bottom);
        padding-left: env(safe-area-inset-left);
    }
}

a, .btn-link {
    color: #006bb7;
}

.btn-primary {
    color: #fff;
    background-color: #1b6ec2;
    border-color: #1861ac;
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

.content {
    padding-top: 1.1rem;
}

h1:focus {
    outline: none;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #e52830;
}

.validation-message {
    color: #e52830;
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE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b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
    text-align: start;
}

/* Preserve newlines only when explicitly requested (avoid breaking layout for alerts containing HTML lists) */
.alert.hfm-prewrap {
    white-space: pre-wrap;
}

/* Make all Bootstrap modals look more polished/consistent */
.modal .modal-content {
    border: 0;
    border-radius: var(--bs-border-radius-lg);
    box-shadow: var(--bs-box-shadow-lg);
}

.modal .modal-header,
.modal .modal-footer {
    padding: 0.75rem 1rem;
}

.modal .modal-body {
    padding: 1rem;
}

.modal .modal-title {
    font-weight: 600;
}

/* Confirm dialog: add subtle themed header + accent based on action tone */
.hfm-confirm-modal .modal-header {
    background-color: var(--bs-tertiary-bg);
}

.hfm-confirm-modal .modal-title {
    color: var(--bs-body-color);
}

.hfm-confirm-modal.hfm-tone-primary .modal-header {
    background-color: var(--bs-primary-bg-subtle);
}

.hfm-confirm-modal.hfm-tone-primary .modal-title {
    color: var(--bs-primary-text-emphasis);
}

.hfm-confirm-modal.hfm-tone-danger .modal-header {
    background-color: var(--bs-danger-bg-subtle);
}

.hfm-confirm-modal.hfm-tone-danger .modal-title {
    color: var(--bs-danger-text-emphasis);
}

.hfm-confirm-modal.hfm-tone-warning .modal-header {
    background-color: var(--bs-warning-bg-subtle);
}

.hfm-confirm-modal.hfm-tone-warning .modal-title {
    color: var(--bs-warning-text-emphasis);
}

.hfm-confirm-modal.hfm-tone-success .modal-header {
    background-color: var(--bs-success-bg-subtle);
}

.hfm-confirm-modal.hfm-tone-success .modal-title {
    color: var(--bs-success-text-emphasis);
}

.hfm-confirm-modal.hfm-tone-info .modal-header {
    background-color: var(--bs-info-bg-subtle);
}

.hfm-confirm-modal.hfm-tone-info .modal-title {
    color: var(--bs-info-text-emphasis);
}

/* Header icon accents (FontAwesome) */
/* Applies to headings like: <h2><i class="fas fa-wallet"></i> Accounts</h2> */
h1 i.fas,
h2 i.fas,
h3 i.fas,
h4 i.fas,
h5 i.fas,
h6 i.fas,
h1 i.far,
h2 i.far,
h3 i.far,
h4 i.far,
h5 i.far,
h6 i.far {
    margin-right: 0.5rem;
}

/* If an icon already has a Bootstrap `text-*` class, Bootstrap uses `!important` and will win. */
h1 i.fa-wallet,
h2 i.fa-wallet,
h3 i.fa-wallet,
h4 i.fa-wallet,
h5 i.fa-wallet,
h6 i.fa-wallet,
h1 i.fa-university,
h2 i.fa-university,
h3 i.fa-university,
h4 i.fa-university,
h5 i.fa-university,
h6 i.fa-university,
h1 i.fa-piggy-bank,
h2 i.fa-piggy-bank,
h3 i.fa-piggy-bank,
h4 i.fa-piggy-bank,
h5 i.fa-piggy-bank,
h6 i.fa-piggy-bank {
    color: var(--bs-success-text-emphasis);
}

h1 i.fa-home,
h2 i.fa-home,
h3 i.fa-home,
h4 i.fa-home,
h5 i.fa-home,
h6 i.fa-home,
h1 i.fa-building,
h2 i.fa-building,
h3 i.fa-building,
h4 i.fa-building,
h5 i.fa-building,
h6 i.fa-building {
    color: var(--bs-primary-text-emphasis);
}

h1 i.fa-chart-pie,
h2 i.fa-chart-pie,
h3 i.fa-chart-pie,
h4 i.fa-chart-pie,
h5 i.fa-chart-pie,
h6 i.fa-chart-pie,
h1 i.fa-chart-line,
h2 i.fa-chart-line,
h3 i.fa-chart-line,
h4 i.fa-chart-line,
h5 i.fa-chart-line,
h6 i.fa-chart-line,
h1 i.fa-coins,
h2 i.fa-coins,
h3 i.fa-coins,
h4 i.fa-coins,
h5 i.fa-coins,
h6 i.fa-coins {
    color: var(--bs-warning-text-emphasis);
}

h1 i.fa-info-circle,
h2 i.fa-info-circle,
h3 i.fa-info-circle,
h4 i.fa-info-circle,
h5 i.fa-info-circle,
h6 i.fa-info-circle,
h1 i.fa-lightbulb,
h2 i.fa-lightbulb,
h3 i.fa-lightbulb,
h4 i.fa-lightbulb,
h5 i.fa-lightbulb,
h6 i.fa-lightbulb {
    color: var(--bs-info-text-emphasis);
}

h1 i.fa-exclamation-triangle,
h2 i.fa-exclamation-triangle,
h3 i.fa-exclamation-triangle,
h4 i.fa-exclamation-triangle,
h5 i.fa-exclamation-triangle,
h6 i.fa-exclamation-triangle,
h1 i.fa-times-circle,
h2 i.fa-times-circle,
h3 i.fa-times-circle,
h4 i.fa-times-circle,
h5 i.fa-times-circle,
h6 i.fa-times-circle {
    color: var(--bs-danger-text-emphasis);
}

/* Dark theme: neutralize light-only utility classes (avoid white blocks) */
[data-bs-theme="dark"] .bg-light,
[data-bs-theme="dark"] .bg-white,
[data-bs-theme="dark"] .table-light,
[data-bs-theme="dark"] .sticky-top.bg-light {
    background-color: var(--bs-tertiary-bg) !important;
    color: var(--bs-body-color) !important;
}

[data-bs-theme="dark"] .card-header.bg-white,
[data-bs-theme="dark"] .card-header.bg-light,
[data-bs-theme="dark"] .card-footer.bg-white,
[data-bs-theme="dark"] .card-footer.bg-light {
    background-color: var(--bs-tertiary-bg) !important;
    border-color: var(--bs-border-color) !important;
    color: var(--bs-body-color) !important;
}

/* Tables: keep readable and consistent in dark mode */
[data-bs-theme="dark"] .table {
    --bs-table-color: var(--bs-body-color);
    --bs-table-bg: transparent;
    --bs-table-border-color: var(--bs-border-color);
    --bs-table-striped-bg: rgba(var(--bs-emphasis-color-rgb), 0.04);
    --bs-table-hover-bg: rgba(var(--bs-emphasis-color-rgb), 0.06);
}

/* Badges: light badges should not be white-on-white in dark mode */
[data-bs-theme="dark"] .badge.bg-light,
[data-bs-theme="dark"] .badge.text-bg-light {
    background-color: var(--bs-tertiary-bg) !important;
    color: var(--bs-body-color) !important;
    border: 1px solid var(--bs-border-color) !important;
}

/* ApexCharts: make legend text readable in dark mode (and consistent in light mode) */
.apexcharts-legend-text {
    color: var(--bs-body-color) !important;
    fill: var(--bs-body-color) !important;
}

/* ApexCharts: dark theme needs higher contrast for legend/axis labels */
[data-bs-theme="dark"] .apexcharts-legend-text,
[data-bs-theme="dark"] .apexcharts-xaxis text,
[data-bs-theme="dark"] .apexcharts-yaxis text,
[data-bs-theme="dark"] .apexcharts-title-text,
[data-bs-theme="dark"] .apexcharts-subtitle-text {
    color: var(--bs-emphasis-color) !important;
    fill: var(--bs-emphasis-color) !important;
    opacity: 1 !important;
}

[data-bs-theme="dark"] .apexcharts-legend-series {
    opacity: 1 !important;
}

/* ApexCharts: tooltip readability in dark theme */
[data-bs-theme="dark"] .apexcharts-tooltip,
[data-bs-theme="dark"] .apexcharts-xaxistooltip,
[data-bs-theme="dark"] .apexcharts-yaxistooltip {
    background: var(--bs-tertiary-bg) !important;
    border: 1px solid var(--bs-border-color) !important;
    color: var(--bs-body-color) !important;
    box-shadow: var(--bs-box-shadow) !important;
}

[data-bs-theme="dark"] .apexcharts-tooltip .apexcharts-tooltip-title,
[data-bs-theme="dark"] .apexcharts-xaxistooltip .apexcharts-xaxistooltip-text {
    background: transparent !important;
    border-bottom: 1px solid var(--bs-border-color) !important;
    color: var(--bs-emphasis-color) !important;
}

[data-bs-theme="dark"] .apexcharts-tooltip-text,
[data-bs-theme="dark"] .apexcharts-tooltip-text-y-label,
[data-bs-theme="dark"] .apexcharts-tooltip-text-y-value,
[data-bs-theme="dark"] .apexcharts-tooltip-text-z-label,
[data-bs-theme="dark"] .apexcharts-tooltip-text-z-value {
    color: var(--bs-body-color) !important;
}
