body {
    background-color: #f8f9fa;
    color: #2d3748;
}

.btn-primary {
    background-color: #4a90e2;
    border-color: #4a90e2;
    padding: 0.5rem 1.25rem;
    font-weight: 500;
    border-radius: 0.5rem;
    transition: all 0.2s;
}

.btn-primary:hover {
    background-color: #357abd;
    border-color: #357abd;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.card {
    border: none;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    border-radius: 0.75rem;
    overflow: hidden;
    margin-bottom: 1.5rem;
}

.card-header {
    background-color: #fff;
    border-bottom: 1px solid #edf2f7;
    padding: 1.25rem 1.5rem;
}

.card-body {
    padding: 1.5rem;
}

.table {
    margin-bottom: 0;
}

.table thead th {
    background-color: #f8fafc;
    border-bottom-width: 1px;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    color: #718096;
    padding: 1rem 1.5rem;
}

.table tbody td {
    padding: 1rem 1.5rem;
    vertical-align: middle;
    border-top: 1px solid #edf2f7;
}

.form-control, .form-select {
    border-radius: 0.5rem;
    border: 1px solid #e2e8f0;
    padding: 0.625rem 0.75rem;
    transition: all 0.2s;
}

.form-control:focus, .form-select:focus {
    border-color: #4a90e2;
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
}

h2 {
    font-weight: 700;
    color: #1a202c;
    margin-bottom: 1.5rem;
    letter-spacing: -0.025em;
}

.badge {
    padding: 0.5em 0.75em;
    border-radius: 0.375rem;
    font-weight: 600;
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0i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NaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) 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;
}
/* Search surfaces share Bootstrap's palette and spacing conventions. */
:root {
    --search-link: var(--bs-link-color);
    --search-highlight-bg: var(--bs-warning);
    --search-highlight-text: var(--bs-dark);
    --search-border: var(--bs-border-color);
    --search-muted: var(--bs-secondary-color);
    --search-surface: var(--bs-body-bg);
    --search-focus: var(--bs-primary);
}

.search-highlight {
    background: var(--search-highlight-bg);
    color: var(--search-highlight-text);
    padding: 0.05em 0.12em;
    border-radius: 0.15em;
    box-decoration-break: clone;
    -webkit-box-decoration-break: clone;
}

.bid-search-filters {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--search-border);
}

.bid-proposal-filters { padding: 1.25rem 1.5rem; border-bottom: 1px solid var(--search-border); }
.bid-proposal-filter-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 23rem), 1fr)); gap: 1.5rem; }
.bid-proposal-filter-grid fieldset { min-width: 0; }
.bid-proposal-filter-grid legend { float: none; width: auto; font-size: 1rem; font-weight: 600; margin-bottom: 0.35rem; }
.bid-date-inputs { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 9rem), 1fr)); gap: 0.75rem; }
.bid-date-inputs > div { min-width: 0; }
.bid-date-inputs .form-control { min-width: 0; }
.bid-date-inputs .form-label { font-size: 0.875rem; }
.bid-date-inputs [aria-invalid="true"] { border-color: var(--bs-danger); }
.bid-proposal-dates { display: flex; flex-wrap: wrap; gap: 0.75rem 2rem; margin: 1rem 0; }
.bid-proposal-dates dt, .bid-details .bid-proposal-dates dt { font-size: 0.875rem; font-weight: 500; color: var(--search-muted); margin-bottom: 0.25rem; }
.bid-proposal-dates dd, .bid-details .bid-proposal-dates dd { font-size: 1rem; font-weight: 600; margin: 0; font-variant-numeric: tabular-nums; }

.bid-search-filters summary { cursor: pointer; font-weight: 500; width: fit-content; padding: 0.25rem 0; }
.bid-filter-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem), 1fr)); gap: 1rem; padding-top: 1.25rem; }
.bid-filter-grid .form-label { font-size: 0.875rem; }
.bid-filter-select { min-width: 0; }
.bid-filter-select .form-select { width: 100%; text-overflow: ellipsis; }
.bid-search-status { padding: 1rem 1.5rem; margin: 0; color: var(--search-muted); }
.bid-results { list-style: none; padding: 0; margin: 0; }
.bid-result { display: flex; gap: 2rem; justify-content: space-between; padding: 1.75rem 1.5rem; }
.bid-result + .bid-result { border-top: 1px solid var(--search-border); }
.bid-result-content { flex: 1; min-width: 0; }
.bid-result-title { font-size: 1.15rem; font-weight: 600; line-height: 1.55; margin: 0 0 0.5rem; overflow-wrap: anywhere; white-space: pre-line; }
.bid-result-title a { color: var(--search-link); text-decoration: none; }
.bid-result-title a:hover { text-decoration: underline; text-underline-offset: 0.2em; }
.bid-details-trigger { display: block; width: 100%; border: 0; padding: 0; background: transparent; color: var(--search-link); font: inherit; text-align: left; white-space: inherit; overflow-wrap: anywhere; }
.bid-details-trigger:hover { text-decoration: underline; text-underline-offset: 0.2em; }
.bid-details-trigger:focus-visible, .bid-new-tab:focus-visible { outline: 2px solid var(--search-focus); outline-offset: 4px; border-radius: 0.15rem; }
.bid-new-tab { font-size: 0.875rem; text-underline-offset: 0.2em; }
.bid-result-title a:focus-visible, .bid-back-link:focus-visible, .bid-search-filters summary:focus-visible { outline: 2px solid var(--search-focus); outline-offset: 4px; border-radius: 0.15rem; }
.bid-result-agency { font-size: 0.9rem; margin-bottom: 0.85rem; overflow-wrap: anywhere; }
.bid-result-location { color: var(--search-muted); }
.capag-badge { display: inline-block; padding: 0.2rem 0.5rem; border: 1px solid var(--search-border); border-radius: 0.375rem; font-size: 0.8rem; font-weight: 600; line-height: 1.5; color: var(--bs-body-color); background: var(--bs-tertiary-bg); white-space: nowrap; vertical-align: baseline; }
.bid-result-agency .capag-badge { margin-inline-start: 0.5rem; }
a.capag-badge { color: var(--search-link); text-decoration: none; }
a.capag-badge:hover { text-decoration: underline; text-underline-offset: 0.2em; border-color: var(--search-link); }
a.capag-badge:focus-visible { outline: 2px solid var(--search-focus); outline-offset: 3px; }
.capag-badge-unavailable { color: var(--search-muted); }
.bid-result-excerpt { font-size: 0.925rem; line-height: 1.65; margin: 0.45rem 0; overflow-wrap: anywhere; white-space: pre-line; }
.bid-result-label { color: var(--search-muted); font-size: 0.85rem; }
.bid-result-meta { display: flex; flex-wrap: wrap; gap: 0.4rem 1.15rem; margin-top: 0.85rem; color: var(--search-muted); font-size: 0.8rem; }
.bid-result-actions { display: flex; flex-direction: column; align-items: flex-end; gap: 1rem; flex-shrink: 0; padding-top: 0.25rem; }
.bid-result-value { font-weight: 600; font-size: 0.95rem; font-variant-numeric: tabular-nums; }
.bid-result-actions .btn { min-height: 2.5rem; }
.bid-back-link { display: inline-block; margin-bottom: 1.25rem; text-underline-offset: 0.2em; }
.bid-details-heading { font-size: 1.75rem; font-weight: 700; margin-bottom: 1.5rem; }
.bid-details { background: var(--search-surface); border-radius: 0.75rem; padding: clamp(1.25rem, 3vw, 2rem); }
.bid-details h2 { font-size: 1.2rem; margin-bottom: 1rem; color: inherit; }
.bid-details-object p { max-width: 80ch; line-height: 1.75; white-space: pre-line; overflow-wrap: anywhere; }
.bid-details-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr)); gap: 1.25rem 2rem; padding: 1.5rem 0; margin: 1.5rem 0 2rem; border-block: 1px solid var(--search-border); }
.bid-details dt { color: var(--search-muted); font-size: 0.8rem; font-weight: 500; margin-bottom: 0.35rem; }
.bid-details dd { margin: 0; font-size: 0.925rem; overflow-wrap: anywhere; }
.bid-detail-items { list-style: none; padding: 0; margin: 0; }
.bid-detail-items > li { padding: 1.5rem 0; }
.bid-detail-items > li + li { border-top: 1px solid var(--search-border); }
.bid-detail-items h3 { font-size: 0.9rem; font-weight: 600; margin-bottom: 0.65rem; }
.bid-detail-items p { line-height: 1.7; max-width: 80ch; overflow-wrap: anywhere; white-space: pre-line; }
.bid-item-values { display: flex; flex-wrap: wrap; gap: 1rem 2rem; margin: 1rem 0 0; }
.bid-capag { margin-bottom: 2rem; padding-bottom: 2rem; border-bottom: 1px solid var(--search-border); scroll-margin-top: 1.5rem; }
.bid-capag-heading { display: flex; align-items: center; flex-wrap: wrap; gap: 0.75rem; margin-bottom: 0.75rem; }
.bid-capag-heading h2 { margin: 0; }
.bid-capag-location { margin-bottom: 1.25rem; overflow-wrap: anywhere; }
.bid-capag-location span, .bid-capag-help { color: var(--search-muted); }
.bid-capag-indicators { width: 100%; max-width: 48rem; table-layout: fixed; font-size: 0.925rem; }
.bid-capag-indicators th, .bid-capag-indicators td { padding: 0.75rem 0.5rem; border-bottom: 1px solid var(--search-border); overflow-wrap: anywhere; vertical-align: top; }
.bid-capag-indicators thead th { color: var(--search-muted); font-size: 0.8rem; font-weight: 500; }
.bid-capag-indicators th:first-child { padding-left: 0; width: 42%; }
.bid-capag-indicators th:last-child, .bid-capag-indicators td:last-child { width: 15%; text-align: right; padding-right: 0; }
.bid-capag-indicators tbody th, .bid-capag-indicators td:last-child { font-weight: 600; }
.bid-capag-indicators td { font-variant-numeric: tabular-nums; }
.bid-capag-observation { margin: 1.25rem 0 0; max-width: 75ch; }
.bid-capag-observation dd { white-space: pre-line; line-height: 1.7; }
.bid-capag-help { margin: 1rem 0 0; font-size: 0.875rem; }

body:has(.bid-details-dialog[open]) { overflow: hidden; }
.bid-details-dialog { width: min(72rem, calc(100% - 2rem)); max-width: none; max-height: calc(100dvh - 2rem); padding: 0; border: 1px solid var(--search-border); border-radius: 0.75rem; color: var(--bs-body-color); background: var(--search-surface); }
.bid-details-dialog[open] { display: flex; flex-direction: column; }
.bid-details-dialog::backdrop { background: rgba(var(--bs-dark-rgb), 0.5); }
.bid-dialog-header { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; padding: 1.25rem 1.5rem; border-bottom: 1px solid var(--search-border); }
.bid-dialog-header h2 { margin: 0; font-size: 1.25rem; color: inherit; }
.bid-dialog-actions { display: flex; align-items: center; gap: 1.25rem; }
.bid-dialog-actions .btn-close { padding: 0.75rem; }
.bid-dialog-body { overflow-y: auto; overscroll-behavior: contain; padding: 1rem; }
.bid-dialog-body .bid-details { padding: 0.5rem; }
.bid-files { margin-bottom: 2rem; padding-bottom: 2rem; border-bottom: 1px solid var(--search-border); }
.bid-file-list { list-style: none; padding: 0; margin: 0; }
.bid-file-list li { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1rem 0; }
.bid-file-list li + li { border-top: 1px solid var(--search-border); }
.bid-file-info { min-width: 0; overflow-wrap: anywhere; }
.bid-file-list .btn { flex-shrink: 0; }

@media (max-width: 767.98px) {
    .bid-result { flex-direction: column; gap: 1rem; padding: 1.25rem; }
    .bid-result-actions { flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: space-between; }
    .bid-result-title { font-size: 1.05rem; }
    .bid-search-filters { padding: 1rem 1.25rem; }
    .bid-details-dialog { width: calc(100% - 1rem); max-height: calc(100dvh - 1rem); }
    .bid-dialog-header { padding: 1rem; }
    .bid-file-list li { flex-direction: column; align-items: flex-start; }
}
