/* Design tokens — mirror the marketplace mockup. GlassBidTheme.cs feeds the same
   palette to MudBlazor so hand-rolled shell CSS and Mud components stay in sync. */
:root {
    --ink: #17202a;
    --muted: #607080;
    --line: #d8e0e6;
    --panel: #ffffff;
    --bg: #f5f7f8;
    --steel: #415768;
    --teal: #0f766e;
    --green: #15803d;
    --amber: #b45309;
    --red: #b91c1c;
    --blue: #2563eb;
    --shadow: 0 12px 30px rgba(24, 38, 50, .08);
}

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

body {
    background: var(--bg);
    color: var(--ink);
}

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

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
    box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

/* App shell — dark sidebar + main column (topbar / content / footer). */
.app {
    display: grid;
    grid-template-columns: 260px 1fr;
    min-height: 100vh;
}

.sidebar {
    background: #23313d;
    color: white;
    padding: 22px 18px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 48px;
}

.brand-mark {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    background: #d8f3ef;
    color: var(--teal);
    border-radius: 8px;
    font-weight: 800;
}

.brand strong {
    display: block;
    font-size: 18px;
    line-height: 1.1;
}

.brand span {
    color: #b8c6d1;
    font-size: 12px;
}

.nav {
    display: grid;
    gap: 8px;
}

.nav .nav-link {
    color: #e7edf1;
    background: transparent;
    border-radius: 8px;
    padding: 12px;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    font-size: 14px;
}

.nav .nav-link.active,
.nav .nav-link:hover {
    background: rgba(255, 255, 255, .12);
    color: white;
}

.sidebar-note {
    margin-top: auto;
    background: rgba(255, 255, 255, .1);
    border-radius: 8px;
    padding: 14px;
    color: #d9e5eb;
    font-size: 13px;
    line-height: 1.45;
}

main {
    min-width: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.topbar {
    min-height: 74px;
    background: white;
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
    gap: 18px;
}

.topbar h1 {
    margin: 0;
    font-size: 22px;
    letter-spacing: 0;
}

.topbar p {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 14px;
}

.content {
    flex: 1;
    padding: 24px 28px 40px;
}

/* Reusable surfaces from the mockup — panels, metrics, tables, status pills.
   Pages restyle onto these as they migrate off the centered-card layout. */
.metrics {
    display: grid;
    /* auto-fit so a row of 3 (Home) or 4 cards fills its width evenly instead
       of leaving an empty column when there are fewer cards than the grid. */
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 14px;
}

.metric {
    background: white;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 16px;
    min-height: 100px;
}

.metric span {
    color: var(--muted);
    font-size: 13px;
}

.metric strong {
    display: block;
    margin-top: 8px;
    font-size: 28px;
    line-height: 1;
}

.metric small {
    display: block;
    margin-top: 8px;
    color: var(--green);
}

/* Vendor directory — a responsive grid of vendor-organization cards. */
.vendor-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px;
}

.vendor-card {
    background: white;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 16px;
    min-height: 120px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Tiles are links to the vendor's details page — keep the card look, add an
   affordance on hover instead of the default link styling. */
a.vendor-card {
    color: inherit;
    text-decoration: none;
    transition: border-color .15s ease, box-shadow .15s ease;
}

a.vendor-card:hover, a.vendor-card:focus-visible {
    border-color: var(--teal);
    box-shadow: var(--shadow);
}

.vendor-card h3 {
    margin: 0;
    font-size: 16px;
}

/* Footer pinned to the card's base so cards line up regardless of name length. */
.vendor-card footer {
    margin-top: auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.panel {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.panel-header {
    padding: 16px 18px;
    border-bottom: 1px solid var(--line);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.panel-header h2 {
    margin: 0;
    font-size: 16px;
    letter-spacing: 0;
}

/* The subtitle only — a direct grandchild of the header. A plain `.panel-header span`
   also matched the label span inside a MudButton placed in the header (e.g. the RFQ
   list's "New request"), graying it out; scope it so button labels keep their colour. */
.panel-header > div > span {
    color: var(--muted);
    font-size: 13px;
}

.status {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 4px 8px;
    font-size: 12px;
    font-weight: 700;
}

.status.open { background: #e7f6f4; color: var(--teal); }
.status.priced { background: #ecfdf3; color: var(--green); }
.status.pending { background: #fff7ed; color: var(--amber); }
.status.awarded { background: #eff6ff; color: var(--blue); }
.status.declined { background: #fef2f2; color: var(--red); }

/* Tables live inside panels — scoped so the rules never leak onto MudBlazor's
   own tables elsewhere. */
.panel table {
    width: 100%;
    border-collapse: collapse;
}

.panel th, .panel td {
    padding: 13px 18px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: middle;
    font-size: 14px;
}

.panel tbody tr:last-child td {
    border-bottom: 0;
}

.panel th {
    color: #506578;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .04em;
    background: #fafbfc;
    font-weight: 700;
}

.panel td .muted {
    color: var(--muted);
    font-size: 13px;
}

.panel tbody tr.row {
    cursor: pointer;
}

.panel tbody tr.row:hover {
    background: #f7fafb;
}

.panel td.chevron {
    text-align: right;
    color: var(--muted);
    width: 44px;
}

.panel td.actions {
    text-align: right;
    white-space: nowrap;
}

.row-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

/* Danger-zone panel — red heading to signal a destructive area. */
.panel.danger .panel-header h2 {
    color: var(--red);
}

/* Panel body helpers for non-table content (padding, empty and loading states). */
.panel-pad {
    padding: 16px 18px;
}

.panel-empty {
    padding: 40px 18px;
    text-align: center;
    color: var(--muted);
    font-size: 14px;
}

.panel-loading {
    display: flex;
    justify-content: center;
    padding: 64px 0;
}

/* Stack of panels for the narrower detail pages (Home/Dashboard). */
.panel-stack {
    display: grid;
    gap: 20px;
    max-width: 760px;
}

.account-identity {
    display: flex;
    align-items: center;
    gap: 16px;
}

.account-name {
    font-size: 18px;
    font-weight: 600;
}

.org-name {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 10px;
}

.pills {
    display: flex;
    gap: 8px;
    margin-bottom: 18px;
}

.pill {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 700;
    background: #eef2f4;
    color: var(--steel);
}

.pill.accent {
    background: #e7f6f4;
    color: var(--teal);
}

.panel-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.onboarding-text {
    margin: 0 0 16px;
    color: var(--muted);
}

/* RFQ detail — back link above the panel stack. */
.rfq-back {
    margin-bottom: -4px;
}

/* Labelled detail rows inside a panel body (RFQ detail). */
.detail-block {
    margin-bottom: 16px;
}

.detail-block:last-child {
    margin-bottom: 0;
}

.detail-label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: #506578;
    font-weight: 700;
    margin-bottom: 4px;
}

.detail-value {
    font-size: 14px;
    white-space: pre-wrap;
}

.detail-value.muted {
    color: var(--muted);
}

.chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

/* Vendor responses as bid cards (RFQ detail, contractor view) — from the mockup. */
.bid-card-list {
    padding: 16px 18px;
    display: grid;
    gap: 12px;
}

.bid-card {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 14px;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px;
    align-items: start;
}

.bid-card h3 {
    margin: 0;
    font-size: 15px;
}

.bid-card p {
    margin: 7px 0 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.45;
}

.bid-right {
    text-align: right;
    white-space: nowrap;
}

.bid-amount {
    font-weight: 800;
    font-size: 18px;
}

.bid-amount span {
    display: block;
    margin-top: 6px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
}

@media (max-width: 700px) {
    .bid-card {
        grid-template-columns: 1fr;
    }
    .bid-right {
        text-align: left;
    }
}

.app-footer {
    text-align: center;
    padding: 0.6rem;
    font-size: 0.8rem;
    color: var(--muted);
    border-top: 1px solid var(--line);
    background: white;
}

.app-footer-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 4px 14px;
    margin-bottom: 4px;
}

.app-footer-links a {
    color: var(--steel);
    text-decoration: none;
}

.app-footer-links a:hover {
    color: var(--teal);
    text-decoration: underline;
}

/* Public shell — the signed-out pages (about / pricing / support / legal). Plain
   document styling rather than the app's panel grid: these are read, not worked in,
   and they render statically so they can't rely on MudBlazor components. */
.public {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.public-topbar {
    background: white;
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
    padding: 14px 28px;
}

.public-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: inherit;
}

.public-brand-text strong {
    display: block;
    font-size: 18px;
    line-height: 1.1;
}

.public-brand-text small {
    color: var(--muted);
    font-size: 12px;
}

.public-nav {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 18px;
    font-size: 14px;
}

.public-nav a {
    color: var(--steel);
    text-decoration: none;
}

.public-nav a:hover {
    color: var(--teal);
    text-decoration: underline;
}

.public-nav-cta {
    background: var(--teal);
    color: white !important;
    border-radius: 8px;
    padding: 8px 14px;
    font-weight: 600;
}

.public-nav-cta:hover {
    background: #0d635c;
    text-decoration: none !important;
}

.public-main {
    flex: 1;
    padding: 32px 28px 56px;
}

/* A policy page reads as one column of prose — capped so lines stay legible. */
.public-doc {
    max-width: 760px;
    margin: 0 auto;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
    padding: 32px 36px 40px;
    font-size: 15px;
    line-height: 1.6;
}

.public-doc h1 {
    margin: 0 0 8px;
    font-size: 28px;
}

.public-doc h2 {
    margin: 32px 0 10px;
    font-size: 18px;
}

.public-doc p, .public-doc ul, .public-doc ol {
    margin: 0 0 14px;
}

.public-doc ul, .public-doc ol {
    padding-left: 22px;
}

.public-doc li {
    margin-bottom: 8px;
}

.public-lede {
    color: var(--muted);
    font-size: 16px;
}

/* The privacy policy's category-disclosure table. Scrolls inside its own box rather
   than widening the page — four columns don't fit a phone. */
.public-table-scroll {
    overflow-x: auto;
    margin-bottom: 14px;
}

.public-doc table {
    border-collapse: collapse;
    width: 100%;
    min-width: 560px;
    font-size: 14px;
}

.public-doc th, .public-doc td {
    border: 1px solid var(--line);
    padding: 10px 12px;
    text-align: left;
    vertical-align: top;
}

.public-doc th {
    background: #fafbfc;
    color: #506578;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .04em;
}

/* Multi-line postal addresses come from a single string — keep their newlines. */
.public-address {
    white-space: pre-line;
}

/* Flags a section that still needs a business decision or legal review before the
   Stripe account goes live. Loud on purpose. */
.public-callout {
    background: #fff7ed;
    border-left: 4px solid var(--amber);
    border-radius: 4px;
    padding: 12px 14px;
    color: #7c3f07;
    font-size: 14px;
}

.public-contact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 14px;
    margin-bottom: 24px;
}

.public-contact-card {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 16px;
}

.public-contact-card h2 {
    margin: 0 0 8px;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: #506578;
}

.public-contact-card .muted {
    color: var(--muted);
    font-size: 13px;
}

.public-plan {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 20px 22px;
    background: #fafbfc;
}

.public-plan h2 {
    margin-top: 0;
}

.public-price {
    font-size: 30px;
    font-weight: 800;
    line-height: 1.2;
}

.public-price span {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--muted);
}

.public-cta {
    display: inline-block;
    background: var(--teal);
    color: white;
    border-radius: 8px;
    padding: 10px 18px;
    font-weight: 600;
    text-decoration: none;
}

.public-index {
    list-style: none;
    padding-left: 0;
}

.public-index li {
    border-bottom: 1px solid var(--line);
    padding-bottom: 12px;
    margin-bottom: 12px;
}

.public-index span {
    display: block;
    color: var(--muted);
    font-size: 14px;
}

/* Shared by the public pages and /login — the only company/legal links a signed-out
   visitor can reach. */
.public-footer {
    border-top: 1px solid var(--line);
    background: white;
    padding: 18px 28px 22px;
    text-align: center;
    font-size: 13px;
}

.public-footer-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px 18px;
}

.public-footer-links a {
    color: var(--steel);
    text-decoration: none;
}

.public-footer-links a:hover {
    color: var(--teal);
    text-decoration: underline;
}

.public-footer-legal {
    margin: 10px 0 0;
    color: var(--muted);
}

@media (max-width: 700px) {
    .public-main { padding: 18px 14px 40px; }
    .public-doc { padding: 22px 18px 28px; }
    .public-topbar { padding: 14px 18px; }
}

/* Sidebar collapses to a sticky horizontal strip on narrow viewports. */
@media (max-width: 1060px) {
    .app { grid-template-columns: 1fr; }
    .sidebar {
        position: sticky;
        top: 0;
        z-index: 10;
        flex-direction: row;
        align-items: center;
        overflow-x: auto;
    }
    .nav { grid-auto-flow: column; }
    .sidebar-note { display: none; }
    .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 700px) {
    .topbar {
        align-items: flex-start;
        flex-direction: column;
        padding: 18px;
    }
    .content { padding: 18px; }
    .metrics { grid-template-columns: 1fr; }
}

.profile-menu {
    position: relative;
}

.profile-menu__dropdown {
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    min-width: 200px;
    z-index: 1300;
}

.profile-menu__backdrop {
    position: fixed;
    inset: 0;
    z-index: 1200;
}

h1:focus {
    outline: none;
}

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

.invalid {
    outline: 1px solid #e50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0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) 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;
}
