h1:focus {
    outline: none;
}

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

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

.validation-message {
    color: #e50000;
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

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

.darker-border-checkbox.form-check-input {
    border-color: #929292;
}

.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;
}

/* ===== NDIS Pricing Tool theme ===== */

:root {
    --navy: #14224d;
    --navy-dark: #0e1938;
    --navy-light: #1b2c5e;
    --gold: #c9962f;
    --gold-light: #e0b24a;
    --blue-accent: #2952d6;
    --blue-accent-light: #dbe4fb;
    --page-bg: #f4f6fb;
    --card-border: #e7eaf3;
    --text-muted: #6b7280;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: var(--page-bg);
    color: var(--navy);
}

a {
    text-decoration: none;
    color: inherit;
}

/* ---- App shell (MainLayout) ---- */

.app-shell {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.app-header {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    background: var(--navy-dark);
    color: #fff;
    padding: 0.85rem 1.5rem;
    flex-shrink: 0;
}

.app-header .brand {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-weight: 700;
    font-size: 1.05rem;
    white-space: nowrap;
}

.app-header .brand-icon {
    color: var(--gold-light);
    font-size: 1.3rem;
}

.app-header .user-menu {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.9rem;
    white-space: nowrap;
}

.app-header .user-menu a,
.app-header .user-menu button {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border: none;
    border-radius: 0.4rem;
    padding: 0.4rem 0.8rem;
    cursor: pointer;
    font-size: 0.85rem;
}

.app-body {
    display: flex;
    flex: 1;
}

.app-sidebar {
    width: 230px;
    flex-shrink: 0;
    background: var(--navy);
    padding: 1.25rem 0.9rem;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.app-sidebar .nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 0.9rem;
    border-radius: 0.6rem;
    color: var(--gold-light);
    font-weight: 500;
    font-size: 0.95rem;
    cursor: pointer;
}

.app-sidebar .nav-item .nav-icon {
    color: var(--gold);
    font-size: 1.05rem;
    width: 1.4rem;
    text-align: center;
}

.app-sidebar .nav-item.active {
    background: var(--blue-accent);
    color: #fff;
}

.app-sidebar .nav-item.active .nav-icon {
    color: #fff;
}

.app-sidebar .nav-item:hover:not(.active) {
    background: rgba(255, 255, 255, 0.06);
}

.app-main {
    flex: 1;
    padding: 1.75rem 2rem;
    min-width: 0;
}

.section-title {
    color: var(--navy);
    font-weight: 700;
    font-size: 0.9rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    margin: 0 0 1rem;
}

/* ---- Cards / grid ---- */

.card-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.1rem;
    margin-bottom: 1.5rem;
}

@media (max-width: 960px) {
    .card-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.card {
    background: #fff;
    border: 1px solid var(--card-border);
    border-radius: 0.9rem;
    padding: 1.4rem 1.2rem;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.1rem;
}

@media (max-width: 960px) {
    .two-col {
        grid-template-columns: 1fr;
    }
}

.card-heading {
    font-weight: 700;
    color: var(--navy);
    margin: 0 0 1rem;
    font-size: 1rem;
}

.estimate-amount {
    font-size: 2.1rem;
    font-weight: 800;
    color: var(--navy);
    margin: 0.3rem 0 0.2rem;
}

.estimate-of {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.stat-card {
    text-align: center;
}

.stat-icon {
    font-size: 1.5rem;
}

.stat-value {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--navy);
    margin: 0.3rem 0 0.2rem;
}

.stat-label {
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* Horizontal bar chart -- single series (this consumer's own spend), so no legend:
   the row label already names the category. Text stays in text tokens (navy/muted);
   only the fill itself carries the accent color. */
.bar-chart {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.bar-chart-row {
    display: grid;
    grid-template-columns: minmax(160px, 260px) 1fr auto;
    align-items: center;
    gap: 0.85rem;
}

.bar-chart-label {
    color: var(--navy);
    font-size: 0.85rem;
    font-weight: 500;
}

.bar-chart-track {
    background: var(--blue-accent-light);
    border-radius: 4px;
    height: 18px;
    overflow: hidden;
}

/* Square at the baseline (left, anchored to zero), rounded at the data-end (right). */
.bar-chart-fill {
    background: var(--blue-accent);
    height: 100%;
    border-radius: 0 4px 4px 0;
}

.bar-chart-value {
    color: var(--navy);
    font-size: 0.85rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    text-align: right;
    min-width: 5.5rem;
}

@media (max-width: 640px) {
    .bar-chart-row {
        grid-template-columns: 1fr;
        gap: 0.35rem;
    }

    .bar-chart-value {
        text-align: left;
    }
}

.progress-track {
    height: 0.55rem;
    background: var(--blue-accent-light);
    border-radius: 999px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--blue-accent);
    border-radius: 999px;
    transition: width 0.3s ease;
}

.progress-pct {
    color: var(--blue-accent);
    font-weight: 700;
    margin-top: 0.5rem;
}

.support-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
}

.support-list li {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.support-list .support-icon {
    color: var(--gold);
    font-size: 1.1rem;
    width: 1.5rem;
    text-align: center;
}

.support-list .support-name {
    flex: 1;
    color: var(--navy);
    font-weight: 500;
}

.support-list .support-price {
    color: var(--navy);
    font-weight: 700;
}

.empty-state {
    color: var(--text-muted);
    font-size: 0.9rem;
    padding: 0.5rem 0;
}

/* ---- Charts (Dashboard) ---- */

.period-toggle {
    display: inline-flex;
    gap: 0.3rem;
    background: #f3f5f9;
    border-radius: 0.6rem;
    padding: 0.25rem;
    margin-bottom: 1rem;
}

.period-toggle button {
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: 0.82rem;
    font-weight: 600;
    padding: 0.35rem 0.85rem;
    border-radius: 0.45rem;
    cursor: pointer;
}

.period-toggle button.active {
    background: #fff;
    color: var(--navy);
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}

.line-chart-svg {
    width: 100%;
    height: 200px;
    display: block;
}

.line-chart-axis {
    display: flex;
    justify-content: space-between;
    gap: 0.25rem;
    margin-top: 0.4rem;
    color: var(--text-muted);
    font-size: 0.7rem;
}

.donut-chart-wrap {
    display: flex;
    align-items: center;
    gap: 1.75rem;
    flex-wrap: wrap;
}

.donut-chart-svg {
    width: 160px;
    height: 160px;
    flex-shrink: 0;
}

.donut-chart-total-label {
    font-size: 6px;
    fill: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.donut-chart-total-value {
    font-size: 11px;
    font-weight: 700;
    fill: var(--navy);
}

.donut-legend {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    flex: 1;
    min-width: 200px;
}

.donut-legend li {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.85rem;
}

.donut-legend-swatch {
    width: 0.7rem;
    height: 0.7rem;
    border-radius: 50%;
    flex-shrink: 0;
}

.donut-legend-name {
    flex: 1;
    color: var(--navy);
    font-weight: 500;
}

.donut-legend-value {
    color: var(--navy);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

/* Wraps wide tables (e.g. .support-item-table) so they scroll horizontally on narrow
   viewports instead of squeezing columns or overflowing the page. */
.table-responsive {
    overflow-x: auto;
}

.support-item-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.support-item-table th {
    text-align: left;
    padding: 0.6rem 0.75rem;
    border-bottom: 2px solid var(--card-border);
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

.support-item-table td {
    padding: 0.6rem 0.75rem;
    border-bottom: 1px solid var(--card-border);
    color: var(--navy);
    vertical-align: middle;
}

.support-item-table tbody tr:hover {
    background: #f8fafc;
}

/* Grouped-table row kinds shared by EstimateTool's draft review and EstimateDetail's saved
   line items -- budget-type group header, category group header, per-category/per-budget-type
   subtotal, and the final grand-total row, all as in-table <tr>s rather than separate divs
   below each category's own table (see preview-estimate-ndis.html, the format this mirrors). */
.support-item-table tbody tr.budget-group-row td {
    padding-top: 1rem;
    color: var(--gold);
    font-weight: 700;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-bottom: 2px solid var(--gold);
}

.support-item-table tbody tr.category-group-row td {
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.82rem;
}

.support-item-table tbody tr.category-subtotal-row td {
    color: var(--gold);
    font-weight: 600;
    border-top: 1px solid var(--blue-accent-light);
    border-bottom: none;
}

.support-item-table tbody tr.budget-subtotal-row td {
    color: var(--navy);
    font-weight: 700;
    border-top: 2px solid var(--gold);
    border-bottom: none;
}

.support-item-table tbody tr.total-row td {
    color: var(--navy);
    font-weight: 700;
    font-size: 1rem;
    border-top: 2px solid var(--navy);
    border-bottom: none;
}

.estimate-summary {
    display: flex;
    gap: 2rem;
    background: var(--blue-accent-light);
    border-left: 4px solid var(--blue-accent);
    border-radius: 0.4rem;
    padding: 0.65rem 1.1rem;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    color: var(--navy);
}

.estimate-summary strong {
    color: var(--navy);
}

/* ---- Auth (login/register) ---- */

.auth-shell {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--navy-dark);
    padding: 1rem;
}

.auth-card {
    background: #fff;
    border-radius: 1rem;
    padding: 2.25rem 2rem;
    width: 100%;
    max-width: 380px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.25);
}

.auth-card h1 {
    font-size: 1.3rem;
    color: var(--navy);
    margin: 0 0 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.auth-card .auth-subtitle {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

.form-field {
    margin-bottom: 1rem;
}

.form-field label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--navy);
    margin-bottom: 0.35rem;
}

.form-field input {
    width: 100%;
    padding: 0.6rem 0.75rem;
    border: 1px solid var(--card-border);
    border-radius: 0.5rem;
    font-size: 0.95rem;
}

.form-field input:focus {
    outline: 2px solid var(--blue-accent-light);
    border-color: var(--blue-accent);
}

.form-field select {
    width: 100%;
    padding: 0.6rem 0.75rem;
    border: 1px solid var(--card-border);
    border-radius: 0.5rem;
    font-size: 0.95rem;
    background: #fff;
}

.form-field select:focus {
    outline: 2px solid var(--blue-accent-light);
    border-color: var(--blue-accent);
}

.filter-row {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}

.filter-row .form-field {
    flex: 1;
    min-width: 180px;
    margin-bottom: 0;
}

.btn-primary {
    width: 100%;
    background: var(--blue-accent);
    color: #fff;
    border: none;
    border-radius: 0.5rem;
    padding: 0.7rem;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    margin-top: 0.25rem;
}

.auth-error {
    background: #fdecea;
    color: #b3261e;
    border-radius: 0.5rem;
    padding: 0.6rem 0.8rem;
    font-size: 0.85rem;
    margin-bottom: 1rem;
}

.auth-success {
    background: #e6f4ea;
    color: #1e7a34;
    border-radius: 0.5rem;
    padding: 0.6rem 0.8rem;
    font-size: 0.85rem;
    margin-bottom: 1rem;
}

.auth-switch {
    margin-top: 1.25rem;
    text-align: center;
    font-size: 0.88rem;
    color: var(--text-muted);
}

.auth-switch a {
    color: var(--blue-accent);
    font-weight: 600;
}