:root {
    font-size: 14px;
    font-family: "Inter", "Noto Sans Bengali", "Nirmala UI", Vrinda, sans-serif;
    color: #163b3b;
    background: #f9f7f7;
    font-synthesis: none;
    text-rendering: optimizeLegibility;
}

html,
body {
    min-height: 100%;
    margin: 0;
    font-family: "Inter", "Noto Sans Bengali", "Nirmala UI", Vrinda, sans-serif;
    font-size: 0.94rem;
    line-height: 1.5;
    background: #f9f7f7;
}

body,
button,
input,
select,
textarea {
    font-family: "Inter", "Noto Sans Bengali", "Nirmala UI", Vrinda, sans-serif;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    color: #007979;
    font-family: "Inter", "Noto Sans Bengali", "Nirmala UI", Vrinda, sans-serif;
    line-height: 1.3;
}

    h1:focus {
        outline: none;
    }

a,
.btn-link {
    color: #007979;
}

.btn {
    font-size: 0.92rem;
}

.btn-primary {
    color: #fff;
    background-color: #007979;
    border-color: #007979;
}

    .btn-primary:hover {
        color: #fff;
        background-color: #005f5f;
        border-color: #005f5f;
    }

.form-control,
.form-select {
    font-size: 0.94rem;
}

.form-label {
    font-size: 0.88rem;
}

.btn:focus,
.btn:active:focus,
.btn-link.nav-link:focus,
.form-control:focus,
.form-check-input:focus {
    box-shadow: 0 0 0 0.1rem #fff, 0 0 0 0.22rem rgba(36, 177, 177, 0.42);
}

.content {
    padding-top: 1rem;
}

.valid.modified:not([type="checkbox"]) {
    outline: 1px solid #24b1b1;
}

.invalid {
    outline: 1px solid #b54755;
}

.validation-message {
    color: #a33d4c;
    font-size: 0.82rem;
}

#blazor-error-ui {
    display: none;
    position: fixed;
    z-index: 1000;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 0.65rem 1.25rem;
    color: #fff;
    background: #007979;
    box-shadow: 0 -1px 5px rgba(0, 70, 70, 0.18);
    box-sizing: border-box;
}

    #blazor-error-ui .reload,
    #blazor-error-ui .dismiss {
        color: #ffe2af;
    }

    #blazor-error-ui .dismiss {
        position: absolute;
        top: 0.5rem;
        right: 0.75rem;
        cursor: pointer;
    }

.blazor-error-boundary {
    padding: 1rem 1rem 1rem 3rem;
    border-radius: 0.65rem;
    color: #fff;
    background: #007979;
}

    .blazor-error-boundary::after {
        content: "An error has occurred.";
    }

.loading-progress {
    position: absolute;
    display: block;
    width: 7rem;
    height: 7rem;
    inset: 20vh 0 auto;
    margin: 0 auto;
}

    .loading-progress circle {
        fill: none;
        stroke: #dbe2ef;
        stroke-width: 0.6rem;
        transform-origin: 50% 50%;
        transform: rotate(-90deg);
    }

        .loading-progress circle:last-child {
            stroke: #24b1b1;
            stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
            transition: stroke-dasharray 0.05s ease-in-out;
        }

.loading-progress-text {
    position: absolute;
    inset: calc(20vh + 2.85rem) 0 auto;
    text-align: center;
    font-size: 0.9rem;
    font-weight: 600;
}

    .loading-progress-text::after {
        content: var(--blazor-load-percentage-text, "Loading");
    }

code {
    color: #007979;
}

@media (max-width: 640.98px) {
    :root {
        font-size: 13.5px;
    }

    html,
    body {
        font-size: 0.93rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Shared page sizing and heading system */
#app .page main > article.content .dashboard-page,
#app .page main > article.content .accounts-page,
#app .page main > article.content .add-account-page,
#app .page main > article.content .add-recurring-page,
#app .page main > article.content .add-transaction-page,
#app .page main > article.content .budgets-page,
#app .page main > article.content .categories-page,
#app .page main > article.content .family-page,
#app .page main > article.content .recurring-page,
#app .page main > article.content .reports-page,
#app .page main > article.content .transactions-page,
#app .page main > article.content .transfers-page {
    width: min(100%, 1680px);
    max-width: 1680px;
    margin-inline: auto;
}

#app .page main > article.content .accounts-hero,
#app .page main > article.content .budgets-hero,
#app .page main > article.content .categories-hero,
#app .page main > article.content .family-hero,
#app .page main > article.content .recurring-hero,
#app .page main > article.content .reports-hero,
#app .page main > article.content .transactions-hero,
#app .page main > article.content .transfers-hero,
#app .page main > article.content .add-recurring-hero,
#app .page main > article.content .add-transaction-hero {
    min-height: 144px;
    margin-bottom: 1rem;
    padding: 1.15rem clamp(1.1rem, 2.3vw, 1.8rem);
    border-radius: 1.1rem;
}

#app .page main > article.content .accounts-hero h1,
#app .page main > article.content .budgets-hero h1,
#app .page main > article.content .categories-hero h1,
#app .page main > article.content .family-hero h1,
#app .page main > article.content .recurring-hero h1,
#app .page main > article.content .reports-hero h1,
#app .page main > article.content .transactions-hero h1,
#app .page main > article.content .transfers-hero h1,
#app .page main > article.content .add-recurring-hero h1,
#app .page main > article.content .add-transaction-hero h1 {
    font-size: clamp(1.55rem, 2.45vw, 2.15rem);
}

#app .page main > article.content .accounts-hero p,
#app .page main > article.content .budgets-hero p,
#app .page main > article.content .categories-hero p,
#app .page main > article.content .family-hero p,
#app .page main > article.content .recurring-hero p,
#app .page main > article.content .reports-hero p,
#app .page main > article.content .transactions-hero p,
#app .page main > article.content .transfers-hero p,
#app .page main > article.content .add-recurring-hero p,
#app .page main > article.content .add-transaction-hero p {
    font-size: .9rem;
}

#app .page main > article.content .accounts-title-icon,
#app .page main > article.content .budgets-title-icon,
#app .page main > article.content .categories-title-icon,
#app .page main > article.content .family-title-icon,
#app .page main > article.content .recurring-title-icon,
#app .page main > article.content .reports-title-icon,
#app .page main > article.content .transactions-title-icon,
#app .page main > article.content .transfers-title-icon,
#app .page main > article.content .add-recurring-title-icon,
#app .page main > article.content .transaction-title-icon {
    width: 2.8rem;
    height: 2.8rem;
    flex-basis: 2.8rem;
    border-radius: .85rem;
    font-size: 1.2rem;
}

#app .page main > article.content .account-intro {
    min-height: 144px;
    align-items: center;
    margin: 0 auto 1rem;
    padding: 1.15rem clamp(1.1rem, 2.3vw, 1.8rem);
    border: 1px solid rgba(36, 177, 177, .42);
    border-radius: 1.1rem;
    background: linear-gradient(120deg, #006b6b 0%, #007979 54%, #159393 100%);
    box-shadow: 0 1rem 2.2rem rgba(0, 91, 91, .14);
}

#app .page main > article.content .account-eyebrow { color: #ffe2af; }
#app .page main > article.content .account-title-icon { width: 2.8rem; height: 2.8rem; flex-basis: 2.8rem; border-color: #ffe2af; background: #ffe2af; color: #007979; font-size: 1.25rem; }
#app .page main > article.content .account-intro h1 { color: #fff; font-size: clamp(1.55rem, 2.45vw, 2.15rem); }
#app .page main > article.content .account-intro p { color: rgba(255, 255, 255, .88); font-size: .9rem; }
#app .page main > article.content .account-back-link { border-color: rgba(255, 255, 255, .65); background: rgba(255, 255, 255, .1); color: #fff; }
#app .page main > article.content .account-back-link:hover { background: rgba(255, 255, 255, .2); color: #fff; }
#app .page main > article.content .account-form-card { max-width: 1180px; margin-inline: auto; }
#app .page main > article.content .recurring-form-card { max-width: 1320px; margin-inline: auto; }

#app .page main > article.content .dashboard-heading {
    min-height: 144px;
    padding: 1.15rem clamp(1.1rem, 2.3vw, 1.8rem);
    border-color: rgba(36, 177, 177, .42);
    border-radius: 1.1rem;
    background: linear-gradient(120deg, #006b6b 0%, #007979 54%, #159393 100%);
    box-shadow: 0 1rem 2.2rem rgba(0, 91, 91, .14);
}

#app .page main > article.content .dashboard-eyebrow { color: #ffe2af; }
#app .page main > article.content .dashboard-heading h2 { color: #fff; font-size: clamp(1.55rem, 2.45vw, 2.15rem); }
#app .page main > article.content .dashboard-heading p { color: rgba(255, 255, 255, .9); }

#app .page main > article.content > .row.justify-content-center { width: min(100%, 1680px); max-width: 1680px; margin-inline: auto; }
#app .page main > article.content > .row.justify-content-center > div > .d-flex.justify-content-between {
    min-height: 144px;
    align-items: center !important;
    margin-bottom: 1rem !important;
    padding: 1.15rem clamp(1.1rem, 2.3vw, 1.8rem);
    border: 1px solid rgba(36, 177, 177, .42);
    border-radius: 1.1rem;
    background: linear-gradient(120deg, #006b6b 0%, #007979 54%, #159393 100%);
    box-shadow: 0 1rem 2.2rem rgba(0, 91, 91, .14);
}

#app .page main > article.content > .row.justify-content-center > div > .d-flex.justify-content-between h1 { margin: 0; color: #fff; font-size: clamp(1.55rem, 2.45vw, 2.15rem); }
#app .page main > article.content > .row.justify-content-center > div > .d-flex.justify-content-between p { margin-top: .4rem !important; color: rgba(255, 255, 255, .9) !important; }
#app .page main > article.content > .row.justify-content-center > div > .d-flex.justify-content-between a.btn { border-color: rgba(255, 255, 255, .68); color: #fff; }
#app .page main > article.content > .row.justify-content-center > div > .d-flex.justify-content-between a.btn:hover { background: rgba(255, 255, 255, .16); color: #fff; }

@media (max-width: 767.98px) {
    #app .page main > article.content .accounts-hero,
    #app .page main > article.content .budgets-hero,
    #app .page main > article.content .categories-hero,
    #app .page main > article.content .family-hero,
    #app .page main > article.content .recurring-hero,
    #app .page main > article.content .reports-hero,
    #app .page main > article.content .transactions-hero,
    #app .page main > article.content .transfers-hero,
    #app .page main > article.content .add-recurring-hero,
    #app .page main > article.content .add-transaction-hero,
    #app .page main > article.content .account-intro,
    #app .page main > article.content .dashboard-heading,
    #app .page main > article.content > .row.justify-content-center > div > .d-flex.justify-content-between {
        min-height: 0;
        padding: 1rem;
    }

    #app .page main > article.content .account-intro,
    #app .page main > article.content > .row.justify-content-center > div > .d-flex.justify-content-between {
        align-items: flex-start !important;
        flex-direction: column;
        gap: .8rem;
    }
}
#app .page main > article.content .dashboard-heading .btn-primary {
    border-color: #ffe2af;
    background: #ffe2af;
    color: #075f5e;
}

#app .page main > article.content .dashboard-heading .btn-primary:hover {
    border-color: #ffd58a;
    background: #ffd58a;
    color: #075f5e;
}

#app .page main > article.content .dashboard-heading .btn-outline-secondary {
    border-color: rgba(255, 255, 255, .7);
    background: rgba(255, 255, 255, .1);
    color: #fff;
}

#app .page main > article.content .dashboard-heading .btn-outline-secondary:hover {
    background: rgba(255, 255, 255, .2);
    color: #fff;
}
/* Compact spacing for non-dashboard pages */
#app .page main > article.content:has(> .accounts-page, > .visibility-page, > .add-account-page, > .add-recurring-page, > .add-transaction-page, > .budgets-page, > .categories-page, > .family-page, > .recurring-page, > .reports-page, > .transactions-page, > .transfers-page, > .row.justify-content-center) {
    padding: .55rem 1rem 1.25rem !important;
}

#app .page main > article.content .accounts-page,
#app .page main > article.content .visibility-page,
#app .page main > article.content .add-account-page,
#app .page main > article.content .add-recurring-page,
#app .page main > article.content .add-transaction-page,
#app .page main > article.content .budgets-page,
#app .page main > article.content .categories-page,
#app .page main > article.content .family-page,
#app .page main > article.content .recurring-page,
#app .page main > article.content .reports-page,
#app .page main > article.content .transactions-page,
#app .page main > article.content .transfers-page {
    margin: .35rem auto 1.15rem !important;
    padding: .2rem clamp(.25rem, .8vw, .75rem) !important;
}

#app .page main > article.content .accounts-hero,
#app .page main > article.content .budgets-hero,
#app .page main > article.content .categories-hero,
#app .page main > article.content .family-hero,
#app .page main > article.content .recurring-hero,
#app .page main > article.content .reports-hero,
#app .page main > article.content .transactions-hero,
#app .page main > article.content .transfers-hero,
#app .page main > article.content .add-recurring-hero,
#app .page main > article.content .add-transaction-hero,
#app .page main > article.content .account-intro,
#app .page main > article.content > .row.justify-content-center > div > .d-flex.justify-content-between {
    min-height: 126px;
    margin-bottom: .75rem !important;
    padding: .85rem clamp(.9rem, 1.8vw, 1.4rem);
}

@media (max-width: 767.98px) {
    #app .page main > article.content:has(> .accounts-page, > .visibility-page, > .add-account-page, > .add-recurring-page, > .add-transaction-page, > .budgets-page, > .categories-page, > .family-page, > .recurring-page, > .reports-page, > .transactions-page, > .transfers-page, > .row.justify-content-center) {
        padding: .4rem .55rem 1rem !important;
    }

    #app .page main > article.content .accounts-hero,
    #app .page main > article.content .budgets-hero,
    #app .page main > article.content .categories-hero,
    #app .page main > article.content .family-hero,
    #app .page main > article.content .recurring-hero,
    #app .page main > article.content .reports-hero,
    #app .page main > article.content .transactions-hero,
    #app .page main > article.content .transfers-hero,
    #app .page main > article.content .add-recurring-hero,
    #app .page main > article.content .add-transaction-hero,
    #app .page main > article.content .account-intro,
    #app .page main > article.content > .row.justify-content-center > div > .d-flex.justify-content-between {
        min-height: 0;
        padding: .8rem;
    }

    #app .page main > article.content .accounts-page,
    #app .page main > article.content .visibility-page,
    #app .page main > article.content .add-account-page,
    #app .page main > article.content .add-recurring-page,
    #app .page main > article.content .add-transaction-page,
    #app .page main > article.content .budgets-page,
    #app .page main > article.content .categories-page,
    #app .page main > article.content .family-page,
    #app .page main > article.content .recurring-page,
    #app .page main > article.content .reports-page,
    #app .page main > article.content .transactions-page,
    #app .page main > article.content .transfers-page {
        margin-top: .25rem !important;
        padding-inline: .15rem !important;
    }
}