@import url("design-system/styles.css");

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

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: var(--focus-ring);
}

.content {
    padding-top: 1.1rem;
}

.admin-header {
    align-items: flex-start;
    display: flex;
    gap: 1rem;
    justify-content: space-between;
    margin-bottom: 1.25rem;
}

.admin-header h1 {
    font-size: 1.75rem;
    margin-bottom: 0.25rem;
}

.admin-section {
    border-top: 1px solid #dee2e6;
    margin-top: 1.5rem;
    padding-top: 1.25rem;
}

.admin-section h2,
.section-header h2 {
    font-size: 1.15rem;
    margin-bottom: 1rem;
}

.section-header {
    align-items: center;
    display: flex;
    justify-content: space-between;
}

.dashboard-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
}

.dashboard-card {
    border: 1px solid #d7dde5;
    border-radius: 8px;
    color: inherit;
    display: block;
    min-height: 118px;
    padding: 1rem;
    text-decoration: none;
}

.dashboard-card-title {
    display: block;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.dashboard-card-text {
    color: #6c757d;
    display: block;
    font-size: 0.95rem;
}

.detail-list dd {
    min-height: 1.5rem;
    /* A long email address or reference wraps instead of widening the page (ClickUp 869f6vpe0). */
    overflow-wrap: anywhere;
}

.finance-summary-grid {
    display: grid;
    gap: 0.75rem;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.finance-summary-item {
    border: 1px solid #d7dde5;
    border-radius: 8px;
    color: inherit;
    display: block;
    min-height: 88px;
    padding: 0.85rem;
    text-decoration: none;
}

.finance-summary-label {
    color: #6c757d;
    display: block;
    font-size: 0.85rem;
    margin-bottom: 0.35rem;
}

.finance-summary-value {
    display: block;
    font-size: 1.25rem;
}

.form-actions {
    border-top: 1px solid #dee2e6;
    margin-top: 1.5rem;
    padding-top: 1rem;
}

.toolbar-row {
    align-items: center;
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    max-width: 720px;
}

.billing-choice-list {
    display: grid;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.billing-choice {
    align-items: center;
    border: 1px solid #d7dde5;
    border-radius: 8px;
    display: flex;
    gap: 0.5rem;
    max-width: 720px;
    padding: 0.75rem;
}

.lookup-panel {
    margin-top: 1rem;
    max-width: 760px;
}

.lookup-results {
    display: grid;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.lookup-result {
    align-items: center;
    background: #fff;
    border: 1px solid #d7dde5;
    border-radius: 8px;
    color: inherit;
    display: flex;
    gap: 1rem;
    justify-content: space-between;
    padding: 0.75rem;
    text-align: left;
    width: 100%;
}

.lookup-result span {
    display: block;
}

.searchable-select {
    position: relative;
}

.searchable-select-results {
    background: #fff;
    border: 1px solid #d7dde5;
    border-radius: 8px;
    display: grid;
    gap: 0.25rem;
    margin-top: 0.35rem;
    max-height: 18rem;
    overflow-y: auto;
    padding: 0.35rem;
    width: 100%;
}

.searchable-select-option {
    background: #fff;
    border: 1px solid transparent;
    border-radius: 6px;
    color: inherit;
    padding: 0.5rem 0.65rem;
    text-align: left;
    width: 100%;
}

.searchable-select-label,
.searchable-select-description {
    display: block;
}

.searchable-select-description,
.searchable-select-empty {
    color: #6c757d;
    font-size: 0.875rem;
}

.searchable-select-empty {
    padding: 0.5rem 0.65rem;
}

.login-shell {
    align-items: center;
    display: flex;
    justify-content: center;
    min-height: calc(100vh - 4rem);
}

.login-panel {
    border: 1px solid #d7dde5;
    border-radius: 8px;
    max-width: 420px;
    padding: 2rem;
    width: 100%;
}

.public-page {
    background: #f6f8fb;
    min-height: 100vh;
    padding: 2rem 1rem;
}

.public-page__inner {
    background: #fff;
    border: 1px solid #d7dde5;
    border-radius: 8px;
    margin: 0 auto;
    max-width: 860px;
    padding: 1.5rem;
}

.public-form-header {
    border-bottom: 1px solid #dee2e6;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
}

.public-form-header h1,
.public-confirmation h1 {
    font-size: 1.75rem;
}

.public-checkbox-group {
    border: 1px solid #d7dde5;
    border-radius: 6px;
    display: grid;
    gap: 0.4rem;
    padding: 0.75rem;
}

.public-checkbox-group.is-invalid {
    border-color: #dc3545;
}

#blazor-error-ui {
    color-scheme: light only;
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    box-sizing: border-box;
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}

h1:focus {
    outline: none;
}

h1:focus-visible {
    border-radius: 0;
    box-shadow: 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;
}

/* Kolevia UI: Bootstrap-compatible implementation of the supplied design system. */
:root {
    --bs-body-bg: var(--surface-page);
    --bs-body-color: var(--text-primary);
    --bs-body-font-family: var(--font-sans);
    --bs-body-font-size: var(--text-base);
    --bs-body-line-height: var(--leading-normal);
    --bs-border-color: var(--border-subtle);
    --bs-border-radius: var(--radius-md);
    --bs-border-radius-sm: var(--radius-sm);
    --bs-border-radius-lg: var(--radius-lg);
    --bs-primary: var(--brand-600);
    /* Mirrors --brand-600 (oklch(42% 0.115 258)) as sRGB, because Bootstrap needs a plain triple. */
    --bs-primary-rgb: 32, 76, 138;
    --bs-secondary-color: var(--text-secondary);
    --bs-link-color: var(--text-link);
    --bs-link-hover-color: var(--text-link-hover);
    --bs-danger: var(--danger-600);
    --bs-success: var(--success-600);
    --bs-warning: var(--warning-600);
}

html {
    background: var(--surface-page);
}

html,
body {
    color: var(--text-primary);
    font-family: var(--font-sans);
    min-height: 100%;
}

body {
    background: var(--surface-page);
    font-size: var(--text-base);
    line-height: var(--leading-normal);
}

h1 {
    font-size: clamp(var(--text-xl), 2vw, var(--text-2xl));
}

h2 {
    font-size: var(--text-xl);
}

h3 {
    font-size: var(--text-lg);
}

h4,
.h4 {
    font-size: var(--text-md);
}

a,
.btn-link {
    color: var(--text-link);
}

a:hover,
.btn-link:hover {
    color: var(--text-link-hover);
}

.text-muted {
    color: var(--text-secondary) !important;
}

.text-secondary {
    color: var(--text-secondary) !important;
}

.text-danger {
    color: var(--danger-700) !important;
}

.bg-light {
    background-color: var(--surface-sunken) !important;
}

.border,
.border-top,
.border-bottom,
.border-start,
.border-end {
    border-color: var(--border-subtle) !important;
}

.content {
    padding: var(--space-8) var(--space-6) var(--space-16);
}

.content-container {
    margin: 0 auto;
    max-width: var(--container-max);
    width: 100%;
}

.page-eyebrow {
    color: var(--brand-700);
    display: block;
    font-size: var(--text-xs);
    font-weight: var(--weight-semibold);
    letter-spacing: var(--tracking-eyebrow);
    margin-bottom: var(--space-2);
    text-transform: uppercase;
}

.admin-header {
    align-items: flex-start;
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-4);
    justify-content: space-between;
    margin-bottom: var(--space-6);
}

.admin-header h1 {
    font-size: clamp(var(--text-xl), 2vw, var(--text-2xl));
    margin-bottom: var(--space-1);
}

.admin-header > .btn,
.admin-header > div:last-child:not(:first-child) {
    flex: 0 0 auto;
}

.admin-section {
    background: var(--surface-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xs);
    margin-top: var(--space-6);
    padding: var(--space-6);
}

.admin-section h2,
.section-header h2 {
    font-size: var(--text-md);
    margin-bottom: var(--space-4);
}

.section-header {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-3);
    justify-content: space-between;
}

.btn {
    align-items: center;
    border-radius: var(--radius-md);
    display: inline-flex;
    font-size: var(--text-sm);
    font-weight: var(--weight-semibold);
    gap: var(--space-2);
    justify-content: center;
    min-height: 40px;
    padding: 8px 15px;
    transition:
        background-color var(--duration-fast) var(--ease-standard),
        border-color var(--duration-fast) var(--ease-standard),
        color var(--duration-fast) var(--ease-standard),
        box-shadow var(--duration-fast) var(--ease-standard);
}

.btn:hover {
    text-decoration: none;
}

.btn:focus-visible,
.btn-check:focus-visible + .btn {
    box-shadow: var(--focus-ring);
    outline: 0;
}

.btn:disabled,
.btn.disabled {
    cursor: not-allowed;
    opacity: 0.55;
}

.btn-sm {
    font-size: var(--text-xs);
    min-height: 32px;
    padding: 5px 10px;
}

.btn-lg {
    font-size: var(--text-base);
    min-height: 46px;
    padding: 10px 20px;
}

.btn-primary {
    background: var(--action-primary-bg);
    border-color: var(--action-primary-bg);
    color: var(--text-on-brand);
}

.btn-primary:hover {
    background: var(--action-primary-bg-hover);
    border-color: var(--action-primary-bg-hover);
    color: var(--text-on-brand);
}

.btn-primary:active,
.btn-primary.active,
.btn-primary:first-child:active {
    background: var(--action-primary-bg-active);
    border-color: var(--action-primary-bg-active);
    color: var(--text-on-brand);
}

.btn-secondary,
.btn-outline-secondary,
.btn-outline-primary {
    background: var(--surface-card);
    border-color: var(--action-secondary-border);
    color: var(--text-primary);
}

.btn-secondary:hover,
.btn-outline-secondary:hover,
.btn-outline-primary:hover {
    background: var(--action-secondary-bg-hover);
    border-color: var(--border-strong);
    color: var(--text-primary);
}

.btn-danger {
    background: var(--danger-600);
    border-color: var(--danger-600);
}

.btn-danger:hover {
    background: var(--danger-700);
    border-color: var(--danger-700);
}

.btn-outline-danger {
    background: var(--surface-card);
    border-color: var(--danger-500);
    color: var(--danger-700);
}

.btn-outline-danger:hover {
    background: var(--danger-50);
    border-color: var(--danger-600);
    color: var(--danger-700);
}

.btn-success {
    background: var(--success-600);
    border-color: var(--success-600);
}

.form-label {
    color: var(--text-primary);
    font-size: var(--text-sm);
    font-weight: var(--weight-semibold);
    margin-bottom: var(--space-2);
}

.form-control,
.form-select {
    background-color: var(--surface-card);
    border: 1.5px solid var(--border-default);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: var(--text-base);
    min-height: 40px;
    padding: 8px 11px;
    transition:
        border-color var(--duration-fast) var(--ease-standard),
        box-shadow var(--duration-fast) var(--ease-standard);
}

textarea.form-control {
    min-height: 96px;
}

.form-control::placeholder {
    color: var(--text-tertiary);
}

.form-control:hover,
.form-select:hover {
    border-color: var(--border-strong);
}

.form-control:focus,
.form-select:focus,
.form-check-input:focus {
    background-color: var(--surface-card);
    border-color: var(--border-focus);
    box-shadow: var(--focus-ring);
    color: var(--text-primary);
}

.form-control:disabled,
.form-select:disabled,
.form-control[readonly] {
    background: var(--surface-sunken);
    color: var(--text-disabled);
}

.form-text {
    color: var(--text-secondary);
    font-size: var(--text-xs);
    margin-top: var(--space-1);
}

.form-label-row {
    align-items: center;
    display: flex;
    gap: var(--space-3);
    justify-content: space-between;
}

.form-label-row .form-label {
    margin-bottom: 0;
}

.optional-label {
    color: var(--text-tertiary);
    font-size: var(--text-xs);
    font-weight: 400;
}

.inline-create-link {
    align-items: center;
    display: inline-flex;
    gap: var(--space-1);
    padding: 0 0 var(--space-1);
    text-decoration: none;
}

.inline-success {
    align-items: center;
    color: var(--status-success-text);
    display: flex;
    font-size: var(--text-xs);
    gap: var(--space-1);
    margin-top: var(--space-2);
}

.inline-create-panel {
    background: var(--surface-sunken);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    padding: var(--space-5);
}

.inline-create-panel__header {
    align-items: flex-start;
    display: flex;
    gap: var(--space-4);
    justify-content: space-between;
    margin-bottom: var(--space-4);
}

.inline-create-panel__header h2 {
    font-size: var(--text-lg);
    margin: 0 0 var(--space-1);
}

.inline-create-panel__header p {
    color: var(--text-secondary);
    font-size: var(--text-sm);
    margin: 0;
}

.inline-create-panel__header .btn,
.inline-create-panel__actions .btn {
    align-items: center;
    display: inline-flex;
    gap: var(--space-1);
}

.inline-create-panel__advanced {
    border-top: 1px solid var(--border-subtle);
    margin-top: var(--space-4);
    padding-top: var(--space-3);
}

.inline-create-panel__advanced summary {
    color: var(--text-link);
    cursor: pointer;
    font-size: var(--text-sm);
    font-weight: 600;
}

.inline-create-panel__advanced[open] summary {
    margin-bottom: var(--space-2);
}

.inline-create-panel__actions {
    align-items: center;
    display: flex;
    gap: var(--space-2);
    margin-top: var(--space-5);
}

.future-feature-card {
    background: var(--surface-sunken);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: var(--space-5);
}

.future-feature-card__header {
    align-items: flex-start;
    display: flex;
    justify-content: space-between;
    margin-bottom: var(--space-4);
}

.future-feature-card__header > div {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
}

.future-feature-card__header h2 {
    font-size: var(--text-md);
    margin: 0;
}

.future-feature-card fieldset {
    opacity: 0.68;
}

.future-feature-card__help {
    align-items: flex-start;
    color: var(--text-secondary);
    display: flex;
    font-size: var(--text-sm);
    gap: var(--space-2);
    margin: var(--space-4) 0 0;
}

.future-feature-card__help svg {
    flex: 0 0 auto;
    margin-top: 0.15em;
}

.form-check {
    min-height: 24px;
}

.form-check-input {
    border: 1.5px solid var(--border-strong);
    height: 18px;
    margin-top: 0.16em;
    width: 18px;
}

.form-check-input:checked {
    background-color: var(--brand-600);
    border-color: var(--brand-600);
}

.form-check-label {
    color: var(--text-primary);
    padding-left: var(--space-1);
}

.input-group > .form-control,
.input-group > .form-select,
.input-group > .btn {
    min-height: 40px;
}

.card {
    background: var(--surface-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xs);
    color: var(--text-primary);
}

.card-header,
.card-footer {
    background: transparent;
    border-color: var(--border-subtle);
    padding: var(--space-4) var(--space-5);
}

.card-body {
    padding: var(--space-5);
}

.table-responsive {
    /* Contains absolutely positioned content, such as a visually-hidden column heading, so it
       scrolls with the table instead of widening the page on a phone (ClickUp 869f6vpd8). */
    position: relative;
    background: var(--surface-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xs);
}

.table {
    --bs-table-bg: transparent;
    --bs-table-color: var(--text-primary);
    --bs-table-hover-bg: var(--neutral-50);
    border-color: var(--border-subtle);
    font-size: var(--text-sm);
    margin-bottom: 0;
    vertical-align: middle;
}

.table > :not(caption) > * > * {
    border-bottom-color: var(--border-subtle);
    padding: 12px 16px;
}

.table > thead {
    background: var(--surface-sunken);
}

.table > thead th {
    color: var(--text-secondary);
    font-size: var(--text-xs);
    font-weight: var(--weight-semibold);
    letter-spacing: var(--tracking-wide);
    white-space: nowrap;
}

.table > tbody > tr:last-child > * {
    border-bottom-width: 0;
}

.table-striped > tbody > tr:nth-of-type(odd) > * {
    --bs-table-accent-bg: color-mix(in oklch, var(--neutral-50) 75%, transparent);
}

.table-hover > tbody > tr:hover > * {
    --bs-table-accent-bg: var(--neutral-50);
    color: var(--text-primary);
}

.badge {
    border-radius: var(--radius-pill);
    font-size: var(--text-xs);
    font-weight: var(--weight-semibold);
    letter-spacing: var(--tracking-normal);
    padding: 5px 9px;
}

.badge.bg-secondary,
.badge.text-bg-secondary {
    background: var(--status-draft-bg) !important;
    color: var(--status-draft-text) !important;
}

.badge.bg-primary,
.badge.text-bg-primary {
    background: var(--status-brand-bg) !important;
    color: var(--status-brand-text) !important;
}

.badge.bg-info,
.badge.text-bg-info {
    background: var(--status-info-bg) !important;
    color: var(--status-info-text) !important;
}

.badge.bg-warning,
.badge.text-bg-warning {
    background: var(--status-pending-bg) !important;
    color: var(--status-pending-text) !important;
}

.badge.bg-success,
.badge.text-bg-success {
    background: var(--status-success-bg) !important;
    color: var(--status-success-text) !important;
}

.badge.bg-danger,
.badge.text-bg-danger {
    background: var(--status-danger-bg) !important;
    color: var(--status-danger-text) !important;
}

.alert {
    align-items: flex-start;
    border: 1px solid;
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: var(--text-sm);
    padding: 12px 14px;
}

.alert-secondary,
.alert-light {
    background: var(--surface-sunken);
    border-color: var(--border-default);
    color: var(--text-secondary);
}

.alert-info {
    background: var(--status-info-bg);
    border-color: var(--teal-200);
    color: var(--status-info-text);
}

.alert-success {
    background: var(--status-success-bg);
    border-color: var(--success-500);
    color: var(--status-success-text);
}

.alert-warning {
    background: var(--status-pending-bg);
    border-color: var(--warning-500);
    color: var(--status-pending-text);
}

.alert-danger {
    background: var(--status-danger-bg);
    border-color: var(--danger-500);
    color: var(--status-danger-text);
}

.list-group {
    border-radius: var(--radius-lg);
}

.list-group-item {
    background: var(--surface-card);
    border-color: var(--border-subtle);
    color: var(--text-primary);
    padding: 12px 16px;
}

.nav-tabs {
    border-color: var(--border-subtle);
    gap: var(--space-1);
}

.nav-tabs .nav-link {
    border: 0;
    border-bottom: 2px solid transparent;
    border-radius: 0;
    color: var(--text-secondary);
    font-size: var(--text-sm);
    font-weight: var(--weight-medium);
    padding: 10px 12px;
}

.nav-tabs .nav-link:hover {
    border-bottom-color: var(--border-strong);
    color: var(--text-primary);
}

.nav-tabs .nav-link.active {
    background: transparent;
    border-bottom-color: var(--brand-600);
    color: var(--brand-700);
}

.breadcrumb {
    font-size: var(--text-sm);
    margin-bottom: var(--space-4);
}

.breadcrumb-item + .breadcrumb-item::before {
    color: var(--text-tertiary);
}

.modal-content {
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
}

.modal-header,
.modal-footer {
    border-color: var(--border-subtle);
    padding: var(--space-5);
}

.modal-body {
    padding: var(--space-5);
}

.dashboard-grid {
    display: grid;
    gap: var(--space-4);
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.dashboard-primary {
    margin-bottom: var(--space-6);
}

.dashboard-section-heading {
    align-items: flex-end;
    display: flex;
    gap: var(--space-4);
    justify-content: space-between;
    margin-bottom: var(--space-4);
}

.dashboard-section-heading h2,
.dashboard-section-heading h3 {
    color: var(--text-primary);
    margin-bottom: var(--space-1);
}

.dashboard-section-heading h2 {
    font-size: var(--text-lg);
}

.dashboard-section-heading h3 {
    font-size: var(--text-md);
}

.dashboard-section-heading p {
    color: var(--text-secondary);
    font-size: var(--text-sm);
    margin: 0;
}

.dashboard-section-heading--compact {
    margin-bottom: var(--space-3);
}

.dashboard-advanced {
    background: var(--surface-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xs);
}

.dashboard-advanced__summary {
    align-items: center;
    border-radius: var(--radius-lg);
    cursor: pointer;
    display: flex;
    gap: var(--space-4);
    list-style: none;
    min-height: 84px;
    padding: var(--space-5);
    transition: background-color var(--duration-fast) var(--ease-standard);
}

.dashboard-advanced__summary::-webkit-details-marker {
    display: none;
}

.dashboard-advanced__summary:hover,
.dashboard-advanced[open] > .dashboard-advanced__summary {
    background: var(--surface-sunken);
}

.dashboard-advanced__summary:focus-visible {
    box-shadow: var(--focus-ring);
    outline: 0;
}

.dashboard-advanced__summary-icon {
    align-items: center;
    background: var(--surface-sunken);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    display: inline-flex;
    flex: 0 0 auto;
    height: 42px;
    justify-content: center;
    width: 42px;
}

.dashboard-advanced__summary-content {
    flex: 1;
    min-width: 0;
}

.dashboard-advanced__title,
.dashboard-advanced__description {
    display: block;
}

.dashboard-advanced__title {
    color: var(--text-primary);
    font-size: var(--text-base);
    font-weight: var(--weight-semibold);
    margin-bottom: var(--space-1);
}

.dashboard-advanced__description {
    color: var(--text-secondary);
    font-size: var(--text-sm);
}

.dashboard-advanced__chevron {
    color: var(--text-tertiary);
    transition: transform var(--duration-base) var(--ease-out);
}

.dashboard-advanced[open] .dashboard-advanced__chevron {
    transform: rotate(180deg);
}

.dashboard-advanced__content {
    border-top: 1px solid var(--border-subtle);
    padding: var(--space-6);
}

.dashboard-tool-group + .dashboard-tool-group {
    border-top: 1px solid var(--border-subtle);
    margin-top: var(--space-6);
    padding-top: var(--space-6);
}

.dashboard-grid--compact {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.dashboard-card--compact {
    min-height: 96px;
    padding: var(--space-4);
}

.dashboard-card {
    align-items: center;
    background: var(--surface-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xs);
    color: inherit;
    display: flex;
    gap: var(--space-4);
    min-height: 112px;
    padding: var(--space-5);
    text-decoration: none;
    transition:
        border-color var(--duration-base) var(--ease-standard),
        box-shadow var(--duration-base) var(--ease-standard),
        transform var(--duration-base) var(--ease-out);
}

.dashboard-card:hover {
    border-color: var(--brand-300);
    box-shadow: var(--shadow-sm);
    color: inherit;
    text-decoration: none;
    transform: translateY(-1px);
}

.dashboard-card:focus-visible {
    border-color: var(--border-focus);
    box-shadow: var(--focus-ring);
}

.dashboard-card-icon {
    align-items: center;
    background: var(--surface-brand-subtle);
    border-radius: var(--radius-md);
    color: var(--brand-700);
    display: inline-flex;
    flex: 0 0 auto;
    height: 42px;
    justify-content: center;
    width: 42px;
}

.dashboard-card-content {
    flex: 1;
    min-width: 0;
}

.dashboard-card-title {
    color: var(--text-primary);
    display: block;
    font-size: var(--text-base);
    font-weight: var(--weight-semibold);
    margin-bottom: var(--space-1);
}

.dashboard-card-text {
    color: var(--text-secondary);
    display: block;
    font-size: var(--text-sm);
}

.dashboard-card-arrow {
    color: var(--text-tertiary);
}

.finance-summary-grid {
    display: grid;
    gap: var(--space-3);
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.finance-summary-item {
    background: var(--surface-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xs);
    color: inherit;
    display: block;
    min-height: 96px;
    padding: var(--space-4);
    text-decoration: none;
}

a.finance-summary-item:hover {
    border-color: var(--brand-300);
    box-shadow: var(--shadow-sm);
    color: inherit;
    text-decoration: none;
}

.finance-summary-label {
    color: var(--text-secondary);
    display: block;
    font-size: var(--text-sm);
    margin-bottom: var(--space-2);
}

.finance-summary-value {
    color: var(--text-primary);
    display: block;
    font-family: var(--font-mono);
    font-size: var(--text-lg);
    font-weight: var(--weight-semibold);
}

.form-actions {
    align-items: center;
    border-top: 1px solid var(--border-subtle);
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    margin-top: var(--space-6);
    padding-top: var(--space-4);
}

.toolbar-row {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    margin-bottom: var(--space-4);
    max-width: var(--content-max);
}

.billing-choice-list {
    display: grid;
    gap: var(--space-2);
    margin-bottom: var(--space-3);
}

.billing-choice {
    align-items: center;
    background: var(--surface-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    display: flex;
    gap: var(--space-2);
    max-width: var(--content-max);
    padding: var(--space-3);
}

.lookup-panel {
    margin-top: var(--space-4);
    max-width: var(--content-max);
}

.lookup-results {
    display: grid;
    gap: var(--space-2);
    margin-top: var(--space-3);
}

.lookup-result {
    align-items: center;
    background: var(--surface-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    color: inherit;
    display: flex;
    gap: var(--space-4);
    justify-content: space-between;
    padding: var(--space-3);
    text-align: left;
    transition:
        background-color var(--duration-fast) var(--ease-standard),
        border-color var(--duration-fast) var(--ease-standard);
    width: 100%;
}

.lookup-result:hover,
.lookup-result.selected {
    background: var(--surface-brand-subtle);
    border-color: var(--brand-400);
}

.searchable-select {
    position: relative;
}

.searchable-select-results {
    background: var(--surface-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    display: grid;
    gap: var(--space-1);
    margin-top: var(--space-1);
    max-height: 18rem;
    overflow-y: auto;
    padding: var(--space-1);
    position: absolute;
    width: 100%;
    z-index: 50;
}

.searchable-select-option {
    background: var(--surface-card);
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    color: inherit;
    padding: 8px 10px;
    text-align: left;
    width: 100%;
}

.searchable-select-option:hover,
.searchable-select-option[aria-selected="true"] {
    background: var(--surface-brand-subtle);
    border-color: var(--brand-300);
}

.searchable-select-description,
.searchable-select-empty {
    color: var(--text-secondary);
    font-size: var(--text-xs);
}

.login-shell {
    align-items: center;
    display: flex;
    justify-content: center;
    min-height: 480px;
}

.login-card {
    max-width: 430px;
    width: 100%;
}

.login-brand {
    display: none;
}

.login-panel {
    background: var(--surface-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-sm);
    padding: var(--space-8);
    width: 100%;
}

/* The sign-in page is the one signature surface: a flat navy panel beside the form. */
@media (min-width: 900px) {
    .login-card {
        background: var(--surface-card);
        border: 1px solid var(--border-subtle);
        border-radius: var(--radius-xl);
        box-shadow: var(--shadow-sm);
        display: grid;
        grid-template-columns: 42% 1fr;
        max-width: 860px;
        overflow: hidden;
    }

    .login-brand {
        align-items: flex-end;
        background: var(--brand-ink);
        display: flex;
        padding: var(--space-10);
    }

    .login-brand__statement {
        color: var(--neutral-0);
        font-size: var(--text-2xl);
        font-weight: var(--weight-semibold);
        letter-spacing: var(--tracking-tight);
        line-height: var(--leading-tight);
        margin: 0;
        text-wrap: balance;
    }

    .login-card .login-panel {
        border: 0;
        border-radius: 0;
        box-shadow: none;
    }

    /* The two-column card stands alone rather than nested inside the public page card. */
    .public-page__inner:has(.login-shell) {
        background: transparent;
        border: 0;
        box-shadow: none;
        max-width: 860px;
        padding: 0;
    }
}

.login-panel h1 {
    font-size: var(--text-xl);
    margin-bottom: var(--space-2);
}

.login-panel > p {
    margin-bottom: var(--space-6);
}

.login-panel__icon {
    align-items: center;
    background: var(--surface-brand-subtle);
    border-radius: var(--radius-md);
    color: var(--brand-700);
    display: flex;
    height: 44px;
    justify-content: center;
    margin-bottom: var(--space-5);
    width: 44px;
}

.public-shell {
    background: var(--surface-page);
    min-height: 100vh;
}

.public-brand {
    align-items: center;
    background: var(--surface-card);
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    gap: var(--space-3);
    min-height: 64px;
    padding: 18px max(var(--space-6), calc((100vw - var(--content-max)) / 2));
}

.public-brand__logo {
    display: block;
    flex: 0 0 auto;
    height: 30px;
    width: auto;
}

.public-brand__descriptor {
    color: var(--text-secondary);
    font-size: var(--text-sm);
}

@media (max-width: 479.98px) {
    .public-brand__descriptor {
        display: none;
    }
}

.public-page {
    background: var(--surface-page);
    min-height: calc(100vh - 64px);
    padding: var(--space-8) var(--space-4) var(--space-16);
}

.public-page__inner {
    background: var(--surface-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xs);
    margin: 0 auto;
    max-width: var(--content-max);
    padding: clamp(var(--space-5), 5vw, var(--space-8));
}

.public-form-header {
    border-bottom: 1px solid var(--border-subtle);
    margin-bottom: var(--space-8);
    padding-bottom: var(--space-5);
}

.public-form-header h1,
.public-confirmation h1 {
    font-size: clamp(var(--text-xl), 4vw, var(--text-2xl));
    margin-bottom: var(--space-2);
}

.public-checkbox-group {
    background: var(--surface-card);
    border: 1.5px solid var(--border-default);
    border-radius: var(--radius-md);
    display: grid;
    gap: var(--space-2);
    padding: var(--space-3);
}

.public-checkbox-group.is-invalid {
    border-color: var(--danger-500);
}

.valid.modified:not([type="checkbox"]) {
    border-color: var(--success-500);
    outline: 0;
}

.invalid {
    border-color: var(--danger-500);
    outline: 0;
}

.validation-message {
    color: var(--danger-700);
    font-size: var(--text-xs);
    margin-top: var(--space-1);
}

.darker-border-checkbox.form-check-input {
    border-color: var(--border-strong);
}

#blazor-error-ui {
    background: var(--warning-100);
    border-top: 1px solid var(--warning-500);
    box-shadow: var(--shadow-md);
    color: var(--warning-700);
    display: none;
    font-size: var(--text-sm);
    padding: 12px 48px 12px 16px;
}

#blazor-error-ui .dismiss {
    align-items: center;
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: flex;
    height: 30px;
    justify-content: center;
    right: var(--space-3);
    top: 7px;
    width: 30px;
}

@media (max-width: 640.98px) {
    .content {
        padding: var(--space-6) var(--space-4) var(--space-10);
    }

    .admin-header {
        align-items: stretch;
        flex-direction: column;
    }

    .admin-header .btn {
        width: 100%;
    }

    .admin-section {
        padding: var(--space-4);
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-card {
        min-height: 96px;
        padding: var(--space-4);
    }

    .dashboard-advanced__summary {
        align-items: flex-start;
        min-height: 0;
        padding: var(--space-4);
    }

    .dashboard-advanced__summary-icon {
        height: 38px;
        width: 38px;
    }

    .dashboard-advanced__description {
        font-size: var(--text-xs);
    }

    .dashboard-advanced__content {
        padding: var(--space-4);
    }

    .dashboard-grid--compact {
        grid-template-columns: 1fr;
    }

    .public-brand {
        padding: var(--space-4);
    }

    .public-page {
        padding: var(--space-4) var(--space-3) var(--space-8);
    }

    .public-page__inner {
        border-radius: var(--radius-lg);
        padding: var(--space-5);
    }

    .login-panel {
        border: 0;
        box-shadow: none;
        padding: 0;
    }

    .toolbar-row > .form-control,
    .toolbar-row > .form-select,
    .toolbar-row > .input-group {
        flex-basis: 100%;
    }

    .form-label-row,
    .inline-create-panel__header,
    .inline-create-panel__actions {
        align-items: stretch;
        flex-direction: column;
    }

    .form-label-row {
        gap: var(--space-1);
    }

    .inline-create-link {
        align-self: flex-start;
    }

    .inline-create-panel {
        padding: var(--space-4);
    }

    .inline-create-panel__header .btn,
    .inline-create-panel__actions .btn {
        justify-content: center;
        width: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
    }
}

/* Printing. An invoice a requester keeps or forwards should not carry the application's
   navigation, and neither should anything else somebody bothers to print. */
@media print {
    .sidebar,
    .top-row,
    .no-print,
    #blazor-error-ui {
        display: none !important;
    }

    .page,
    .content,
    .content-container {
        display: block;
        margin: 0;
        padding: 0;
    }

    .admin-section {
        border: 0;
        box-shadow: none;
        padding: 0;
    }
}
