h1:focus {
    outline: none;
}

* { box-sizing: border-box; }
body { font-family: system-ui, sans-serif; margin: 0; background: #f1f7fb; color: #1d3443; }
a { color: #245ea5; }
a:hover { color: #174979; }
.app-header { background: #0c2637; border-bottom: 3px solid #0f766e; box-shadow: 0 3px 16px #1234491a; }
.app-nav { position: relative; padding: .65rem 1.5rem; display: flex; flex-wrap: wrap; align-items: center; gap: .4rem 1.5rem; }
.brand { display: inline-flex; align-items: center; gap: .65rem; color: #fff; font-size: 1.2rem; font-weight: 700; text-decoration: none; letter-spacing: -.025em; }
.brand img { display: block; flex: none; }
.brand:hover, .nav-links a:hover, .nav-menu summary:hover { color: #b7ece3; }
.nav-links { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem .4rem; }
.nav-primary { margin-right: auto; }
.nav-account { margin-left: auto; }
.nav-links > a, .nav-menu summary { display: flex; align-items: center; min-height: 44px; padding: .5rem .75rem; border-radius: .45rem; color: #e5f2f1; font-size: .9rem; text-decoration: none; }
.nav-links > a[aria-current="page"], .nav-menu[open] > summary { background: #ffffff1a; color: #fff; }
.nav-menu { position: relative; }
.nav-menu summary { cursor: pointer; list-style: none; }
.nav-menu summary::-webkit-details-marker { display: none; }
.nav-menu summary::after { content: ""; margin-left: .5rem; border: .3rem solid transparent; border-top-color: currentColor; transform: translateY(.15rem); }
.nav-menu summary:focus-visible { outline: 3px solid #55aaa1; outline-offset: 2px; }
.nav-dropdown { position: absolute; z-index: 20; top: 100%; left: 0; min-width: 12rem; padding: .35rem; border: 1px solid #dceaf0; border-radius: .55rem; background: #fff; box-shadow: 0 8px 24px #12344933; }
.nav-dropdown-end { left: auto; right: 0; }
.nav-dropdown a { display: block; padding: .65rem .75rem; border-radius: .35rem; color: #1d3443; font-size: .9rem; text-decoration: none; white-space: nowrap; }
.nav-dropdown a:hover, .nav-dropdown a[aria-current="page"] { background: #eaf5f3; color: #0b5d57; }
.app-content { max-width: 1200px; min-height: calc(100vh - 10rem); margin: 0 auto; padding: 2rem 1.5rem; }
.app-footer { border-top: 1px solid #dceaf0; color: #526876; padding: 1.25rem 1.5rem; text-align: center; font-size: .875rem; }
h1, h2 { color: #123449; line-height: 1.2; }
h1 { font-size: 1.85rem; margin: 0 0 1rem; }
h2 { font-size: 1.2rem; margin: 0 0 1rem; }
.page-heading p, .form-hint { color: #526876; }
.card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 1rem; align-items: start; }
.card, .auth-card { background: #fff; border: 1px solid #dceaf0; border-radius: .8rem; box-shadow: 0 4px 18px #1234490d; padding: 1.5rem; }
.auth-card { max-width: 30rem; padding: 0; overflow: hidden; margin: 1.5rem auto; }
.auth-header { background: #0f766e; color: #fff; text-align: center; padding: 1.5rem; }
.auth-header h1 { color: #fff; font-size: 1.4rem; }
.auth-header p { margin: 0; color: #d7f0ec; }
.card-body { padding: 1.5rem; }
form { display: grid; gap: .65rem; max-width: 32rem; margin-bottom: 1.5rem; }
.app-content > form { padding: 1.5rem; border: 1px solid #dceaf0; border-radius: .8rem; background: #fff; box-shadow: 0 4px 18px #1234490d; }
label { font-weight: 600; }
input, select, textarea, button { font: inherit; }
input:not([type=checkbox]), select, textarea { width: 100%; min-height: 44px; padding: .6rem .75rem; color: #1d3443; border: 1px solid #b8cbd3; border-radius: .45rem; background: #fff; }
input[type=checkbox] { width: 1.1rem; height: 1.1rem; vertical-align: middle; accent-color: #0f766e; }
button, .button-link { display: inline-block; min-height: 44px; padding: .65rem 1rem; border: 1px solid #0f766e; border-radius: .45rem; background: #0f766e; color: #fff; font-weight: 600; cursor: pointer; text-decoration: none; text-align: center; }
button:hover, .button-link:hover { background: #0b5d57; color: #fff; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid #55aaa1; outline-offset: 2px; }
.form-hint { font-size: .875rem; margin: .25rem 0; }
.category-color { display: inline-block; width: .9rem; height: .9rem; border-radius: 50%; background: var(--category-color); border: 1px solid #526876; vertical-align: middle; }
[role=alert], .notice { padding: .8rem 1rem; border-radius: .45rem; background: #eaf5f3; color: #123449; }
[role=alert] { background: #fff0ef; color: #8d2922; }
.app-content > ul { list-style: none; margin: 0 0 1rem; padding: 0; max-width: 55rem; }
.app-content > ul li { background: #fff; border: 1px solid #dceaf0; padding: .9rem 1rem; overflow-wrap: anywhere; }
.app-content > ul li:first-child { border-radius: .6rem .6rem 0 0; }
.app-content > ul li:last-child { border-radius: 0 0 .6rem .6rem; }
.app-content > nav a { margin-right: 1rem; }
@media (max-width: 600px) {
    .app-nav { padding: .8rem 1rem; }
    .brand { width: 100%; }
    .nav-primary .nav-menu { position: static; }
    .nav-primary .nav-dropdown { left: 1rem; right: 1rem; min-width: 0; }
    .app-content { padding: 1.5rem 1rem; }
}

.app-content:has(.expenses-page), .app-content:has(.expense-edit-page),
.app-content:has([data-pdf-preview-page]) { max-width: none; }
.expenses-heading, .expenses-actions, .expenses-filter-actions, .expenses-pagination, .expense-dialog-heading, .expense-dialog-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .6rem;
}
.expenses-heading { justify-content: space-between; gap: 1rem; margin-bottom: 1.5rem; }
.expenses-heading h1, .expense-dialog-heading h2 { margin: 0; }
.expenses-actions { justify-content: flex-end; }
.expense-button-secondary { background: #fff; color: #0f766e; }
.expense-button-secondary:hover { background: #eaf5f3; color: #0b5d57; }
.expenses-page[aria-busy="true"] { cursor: progress; }
.expenses-page button:disabled, .expenses-page [aria-disabled="true"] { opacity: .6; cursor: wait; }
.expenses-filters { margin-bottom: 1.5rem; }
.expenses-filter-form { max-width: none; margin: 0; grid-template-columns: minmax(12rem, 18rem) auto; gap: .85rem; align-items: end; }
.expense-field { display: grid; gap: .35rem; min-width: 0; }
.expenses-filter-actions { grid-column: auto; }
.expenses-results h2 { margin-bottom: .75rem; }
.expenses-table-wrap { width: 100%; overflow-x: auto; border: 1px solid #dceaf0; border-radius: .8rem; background: #fff; }
.expenses-table { width: 100%; min-width: 70rem; table-layout: fixed; border-collapse: collapse; text-align: left; }
.expenses-table th, .expenses-table td { padding: .85rem 1rem; border-bottom: 1px solid #dceaf0; vertical-align: top; }
.expenses-table th { background: #f5fafb; color: #526876; font-size: .85rem; }
.expenses-table th:nth-child(1) { width: 12rem; }
.expenses-table th:nth-child(3) { width: 11rem; }
.expenses-table th:nth-child(4) { width: 10rem; }
.expenses-table th:nth-child(5) { width: 8rem; }
.expenses-table th:nth-child(6) { width: 9rem; }
.expenses-table th:nth-child(7) { width: 8rem; }
.expenses-header-filters th { padding-top: 0; }
.expenses-header-filters input, .expenses-header-filters select { font-size: .85rem; padding: .4rem; }
.expenses-header-filters input + input { margin-top: .3rem; }
.expenses-table tbody tr:hover { background: #f8fbfc; }
.expenses-table tbody tr:last-child td { border-bottom: 0; }
.expense-description { overflow-wrap: anywhere; }
.expense-description summary { cursor: pointer; }
.expense-description summary strong { display: inline-block; max-width: calc(100% - 1.5rem); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom; }
.expense-description div { margin-top: .2rem; color: #526876; font-size: .85rem; white-space: pre-wrap; }
.expense-date, .expense-amount { white-space: nowrap; }
.expense-amount { text-align: right; }
.expense-visibility { display: inline-block; padding: .25rem .55rem; border-radius: 999px; background: #eaf5f3; color: #0b5d57; font-size: .85rem; }
.expense-row-actions { display: flex; flex-wrap: wrap; gap: .4rem; }
.expense-icon-action { display: inline-flex; align-items: center; justify-content: center; width: 44px; padding: .6rem; }
.expense-icon-action svg { width: 1.2rem; height: 1.2rem; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.expenses-pagination { margin-top: 1rem; }
.expense-dialog { position: fixed; inset: 0; width: min(42rem, calc(100% - 2rem)); max-width: none; max-height: calc(100dvh - 2rem); margin: auto; padding: 1.5rem; border: 1px solid #dceaf0; border-radius: .8rem; background: #fff; color: #1d3443; box-shadow: 0 0 0 100vmax #12344980; overflow-y: auto; }
.expense-dialog::backdrop { background: #12344980; }
.expense-dialog-heading { justify-content: space-between; margin-bottom: 1.25rem; }
.expense-dialog-close { display: inline-flex; align-items: center; justify-content: center; width: 2.75rem; height: 2.75rem; border-radius: .45rem; color: #526876; font-size: 1.6rem; text-decoration: none; }
.expense-dialog-close:hover { background: #eaf5f3; color: #0b5d57; }
.expense-create-form { max-width: none; margin: 0; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .85rem; }
.expense-edit-form { max-width: none; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .85rem; align-items: end; }
.expense-edit-form button, .expense-delete-form button { justify-self: start; }
.expense-delete-form { max-width: none; }
.expense-attachment { margin-bottom: 1.5rem; }
.expense-attachment .button-link { margin: 0 .5rem .5rem 0; }
.expense-document-details { margin-bottom: 1.5rem; }
.expense-document-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr)); gap: .85rem; margin-bottom: 0; }
.expense-document-fields div { min-width: 0; }
.expense-document-fields dt { font-weight: 600; color: #526876; }
.expense-document-fields dd { margin: .2rem 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.expense-create-form textarea:focus-visible { outline: 3px solid #55aaa1; outline-offset: 2px; }
.expense-field-wide { grid-column: 1 / -1; }
.expense-dialog-actions { justify-content: flex-end; }
input.pdf-file-input:not([type=checkbox]) { position: absolute; width: 1px; min-height: 0; height: 1px; margin: -1px; padding: 0; border: 0; overflow: hidden; clip-path: inset(50%); }
.pdf-file-button { justify-self: start; }
.pdf-file-input:focus-visible + .pdf-file-button { outline: 3px solid #55aaa1; outline-offset: 2px; }
.pdf-file-input:invalid ~ .pdf-file-status .pdf-file-selected { display: none; }
.pdf-file-input:valid ~ .pdf-file-status .pdf-file-empty,
.pdf-file-input:disabled ~ .pdf-file-status .pdf-file-empty { display: none; }
.pdf-file-status { overflow-wrap: anywhere; }
.pdf-file-input:disabled + .pdf-file-button { opacity: .6; cursor: wait; }
.pdf-preview-result { margin-bottom: 1rem; overflow-wrap: anywhere; }
[data-pdf-preview-form], [data-pdf-confirm-form] { max-width: none; }
.pdf-preview-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr)); gap: 1rem; }
.pdf-review-field { min-width: 0; }
.pdf-review-field label { display: block; font-weight: 600; }
.pdf-review-field input[type=text] { width: 100%; }
.pdf-review-field .expense-visibility { margin-left: .4rem; }
.pdf-confirm-fields { margin: 1rem 0; }
[data-pdf-preview-page][aria-busy="true"] { cursor: progress; }
@media (max-width: 600px) {
    .expenses-filter-form { grid-template-columns: 1fr; }
    .expenses-heading { align-items: stretch; }
    .expenses-actions { justify-content: flex-start; }
    .expense-create-form, .expense-edit-form { grid-template-columns: 1fr; }
    .expense-field-wide { grid-column: auto; }
    .expense-dialog { padding: 1rem; }
    .pdf-preview-fields { grid-template-columns: 1fr; }
}

.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+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1ID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ZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

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