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;
}
/* Shared by the plain-HTML sign-in forms (Login, LoginVerifyKey, ForgotPassword, ResetPassword,
   and the Security page's change-password form) - plain <input>s rather than MudTextFields
   because these forms post straight to /account/* endpoints; see Login.razor. */
.auth-form {
    display: flex;
    flex-direction: column;
}

.auth-form label {
    font-size: 0.8rem;
    margin-top: 12px;
    margin-bottom: 4px;
}

.auth-form input {
    padding: 10px 12px;
    border: 1px solid var(--mud-palette-lines-inputs, rgba(0, 0, 0, 0.3));
    background: transparent;
    color: var(--mud-palette-text-primary, inherit);
    border-radius: 4px;
    font-size: 1rem;
}

.auth-link {
    display: block;
    text-align: center;
    margin-top: 16px;
    font-size: 0.875rem;
}

/* The public sign-in pages: a small centered card and nothing else - deliberately no app name,
   description, or navigation for a visitor who isn't signed in (same as the travel app's login). */
.auth-card {
    max-width: 360px;
    margin: 80px auto;
}

.auth-hint {
    opacity: 0.7;
}

.auth-status {
    font-size: 0.875rem;
    margin-top: 8px;
    min-height: 1.2em;
}

/* ── App shell: black, gold and charcoal (2026-10-01) ─────────────────────── */
/* Colours match Components/Layout/AppTheme.cs; the bar and menu are dark in both modes. */
:root {
    --bt-gold: #C9A227;
    --bt-gold-soft: #E2C46A;
    --bt-gold-muted: #A8935A;
}

.app-bar {
    border-bottom: 2px solid var(--bt-gold);
}

.app-drawer {
    border-right: 0;
}

.app-brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.app-brand-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 6px;
    background: var(--bt-gold);
    color: #0E0E0F;
}

.app-brand-name {
    font-weight: 700;
    font-size: 0.95rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #F1EDE2;
}

.app-avatar-button {
    background: none;
    border: 0;
    padding: 4px;
    border-radius: 50%;
    cursor: pointer;
    display: inline-flex;
}

.app-avatar-button:focus-visible {
    outline: 2px solid var(--bt-gold);
}

.app-avatar {
    cursor: pointer;
    font-size: 0.85rem !important;
    font-weight: 700;
    background: var(--bt-gold) !important;
    color: #0E0E0F !important;
}

/* Menu: gold section labels, gold marker + text on the current page. */
.nav-section {
    padding: 18px 20px 6px;
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--bt-gold-muted);
}

.app-nav .mud-nav-link {
    margin: 1px 10px;
    width: calc(100% - 20px);
    border-radius: 6px;
    padding-top: 6px;
    padding-bottom: 6px;
    font-size: 0.9rem;
    border-left: 3px solid transparent;
}

.app-nav .mud-nav-link:hover {
    background: rgba(255, 255, 255, 0.05) !important;
}

.app-nav .mud-nav-link.active {
    background: rgba(201, 162, 39, 0.13) !important;
    color: var(--bt-gold-soft) !important;
    border-left-color: var(--bt-gold);
    font-weight: 600;
}

.app-nav .mud-nav-link.active .mud-nav-link-icon {
    color: var(--bt-gold) !important;
}

.nav-badge {
    background: var(--bt-gold);
    color: #0E0E0F;
    border-radius: 10px;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    font-size: 0.72rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Page titles get a short gold rule underneath. */
.mud-main-content .mud-typography-h4 {
    position: relative;
    padding-bottom: 8px;
    margin-bottom: 4px;
}

.mud-main-content .mud-typography-h4::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    width: 40px;
    height: 3px;
    border-radius: 2px;
    background: var(--bt-gold);
}

/* Numbers line up in columns (amounts, totals). */
body {
    font-feature-settings: "tnum" 1, "cv11" 1;
}


.money-good { color: var(--mud-palette-success); }
.money-bad { color: var(--mud-palette-error); font-weight: 600; }
.money-in { color: var(--mud-palette-success); font-weight: 600; }

/* Page header: title on the left, the page's main buttons on the right. */
.page-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 16px;
}

.page-head-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* Compact filter bar. */
.filter-bar {
    border: 1px solid var(--mud-palette-lines-default);
    border-radius: 8px;
    padding: 10px 12px 6px;
    background: var(--mud-palette-surface);
}

.filter-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.filter-row-2 {
    margin-top: 4px;
}

.filter-row .f-search { flex: 2 1 240px; }
.filter-row .f-pick { flex: 1 1 170px; }
.filter-row .f-date { flex: 0 1 140px; }
.filter-row .f-amount { flex: 0 1 110px; }

.filter-summary {
    margin-left: auto;
    display: flex;
    align-items: baseline;
    gap: 10px;
    white-space: nowrap;
}

.filter-count {
    font-size: 0.8rem;
    color: var(--mud-palette-text-secondary);
}

.filter-total {
    font-weight: 700;
    font-size: 1.05rem;
}

/* Inbox cards: gold edge while there is something to do. */
.receipt-card {
    border-left: 3px solid var(--bt-gold) !important;
}

.receipt-card.receipt-done {
    border-left-color: var(--mud-palette-lines-default) !important;
    opacity: 0.85;
}

.receipt-actions {
    flex: 0 0 210px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* A selected chip in a chip set is solid, not faint text. */
.mud-chip.mud-chip-selected.mud-chip-color-primary {
    background-color: var(--mud-palette-primary);
    color: var(--mud-palette-primary-text);
    font-weight: 600;
}


/* ══ Responsive layout (2026-10-01) ══════════════════════════════════════════════════════════
   Targets: 15-16" laptops (1440-1728px wide), 13" iPad (1032px upright / 1376px sideways) and
   iPhone Pro Max (430-440px). The menu is pinned from 1280px up and slides over the page below
   that (MainLayout, Breakpoint.Lg), so an upright iPad gets the full width. */

/* Page padding: roomy on laptops, tighter on tablets and phones. */
.app-content {
    padding-top: 28px;
    padding-bottom: 40px;
}

@media (min-width: 1280px) {
    .app-content {
        padding-left: 32px !important;
        padding-right: 32px !important;
    }
}

@media (max-width: 599.98px) {
    .app-content {
        padding-top: 18px;
        padding-left: 12px !important;
        padding-right: 12px !important;
    }

    .mud-main-content .mud-typography-h4 {
        font-size: 1.45rem;
    }

    /* "Contractor" only on the narrowest phones - the full name does not fit beside the icons. */
    .app-brand-name {
        font-size: 0.85rem;
        letter-spacing: 0.1em;
    }
}

@media (max-width: 379.98px) {
    .app-brand-name-rest {
        display: none;
    }
}



/* Touch screens (iPad, iPhone). */
@media (pointer: coarse) {
    /* Safari zooms the whole page into any text box under 16px when you tap it. */
    input,
    select,
    textarea,
    .mud-input > input,
    .mud-input-slot {
        font-size: 16px !important;
    }

    /* Small icon buttons get a finger-sized hit area. */
    .mud-icon-button.mud-icon-button-size-small {
        min-width: 40px;
        min-height: 40px;
    }

    /* Hover-only hints don't exist on touch; keep rows from looking "stuck" after a tap. */
    .mud-table-hover .mud-table-body .mud-table-row:hover {
        background-color: inherit;
    }
}


/* iPhone / iPad Safari enlarges text on its own when the device is turned sideways ("text size
   adjust"), which pushed button labels like "Customize" out of their space. Keep sizes as designed. */
html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

/* Header buttons never squeeze or wrap their label - whatever is next to them gives way instead. */
.page-head-actions .mud-button-root {
    flex-shrink: 0;
    white-space: nowrap;
    max-width: 100%;
}

.page-head-actions {
    flex-wrap: wrap;
    justify-content: flex-end;
    min-width: 0;
    max-width: 100%;
}

/* ══ Rolodex ══════════════════════════════════════════════════════════════════════════════════ */

/* Contractor cards: an index card - trade label, name over a red rule, then the facts. */
.rolo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.rolo-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 14px 16px 22px;
    border-radius: 6px;
    background: var(--mud-palette-surface);
    border: 1px solid var(--mud-palette-lines-default);
    color: inherit;
    text-decoration: none;
    min-width: 0;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.rolo-card:hover,
.rolo-card:focus-visible {
    border-color: var(--bt-gold);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
}

/* The notch at the bottom of a Rolodex card. */
.rolo-card::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: -1px;
    width: 34px;
    height: 10px;
    transform: translateX(-50%);
    border-radius: 10px 10px 0 0;
    background: var(--mud-palette-background);
    border: 1px solid var(--mud-palette-lines-default);
    border-bottom: 0;
}

.rolo-head {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding-bottom: 8px;
    border-bottom: 1.5px solid #C2453B;
}

.rolo-trade {
    font-size: 0.7rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--mud-palette-text-secondary);
}

.rolo-name {
    font-size: 1.15rem;
    font-weight: 700;
    line-height: 1.2;
    overflow-wrap: anywhere;
}

.rolo-facts {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 3px 10px;
    margin: 0;
    font-size: 0.86rem;
}

.rolo-facts dt {
    color: var(--mud-palette-text-secondary);
}

.rolo-facts dd {
    margin: 0;
    min-width: 0;
    overflow-wrap: anywhere;
}

.rolo-line {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 10px;
}

/* "Would hire again" chips. */
.rehire-chip {
    display: inline-block;
    padding: 1px 8px;
    border-radius: 10px;
    font-size: 0.74rem;
    font-weight: 600;
    white-space: nowrap;
}

.rehire-Yes { background: rgba(46, 125, 80, 0.14); color: var(--mud-palette-success); }
.rehire-Maybe { background: rgba(201, 162, 39, 0.18); color: var(--mud-palette-warning); }
.rehire-No { background: rgba(198, 40, 40, 0.12); color: var(--mud-palette-error); }

/* A job in a contractor's history. */
.job-entry {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 14px 0;
    border-top: 1px solid var(--mud-palette-lines-default);
}

.job-entry:first-child {
    border-top: 0;
    padding-top: 0;
}

.job-items {
    margin: 0;
    padding-left: 18px;
    font-size: 0.86rem;
    color: var(--mud-palette-text-secondary);
}

/* Inbox: the document preview beside the form. */
.inbox-body {
    display: grid;
    grid-template-columns: minmax(0, 300px) minmax(0, 1fr);
    gap: 20px;
}

@media (max-width: 899.98px) {
    .inbox-body {
        grid-template-columns: minmax(0, 1fr);
    }
}

.inbox-preview {
    border-radius: 6px;
    overflow: hidden;
    background: var(--mud-palette-background-gray);
    min-height: 140px;
}

.inbox-preview img {
    display: block;
    width: 100%;
    height: auto;
}

.inbox-preview iframe {
    display: block;
    width: 100%;
    height: 420px;
    border: 0;
}

.form-section-label {
    font-size: 0.72rem;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: var(--mud-palette-text-secondary);
    border-bottom: 1px solid var(--mud-palette-lines-default);
    padding-bottom: 4px;
    margin: 18px 0 10px;
}

.form-section-label:first-child {
    margin-top: 0;
}

/* The upload drop area. */
.drop-zone {
    position: relative;
    border: 2px dashed var(--mud-palette-lines-default);
    border-radius: 12px;
    padding: 28px 20px;
    text-align: center;
    transition: border-color 0.15s, background 0.15s;
}

.drop-zone:hover,
.drop-zone.drop-over {
    border-color: var(--bt-gold);
}

/* The real file input covers the whole area, so a drop or a tap anywhere picks files. */
.drop-zone input[type=file] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

/* Field widths in a wrapping row (MudBlazor puts Style on the inner element, so sizing goes on Class). */
.fx-1 { flex: 1 1 120px; min-width: 0; }
.fx-2 { flex: 2 1 160px; min-width: 0; }
.fx-4 { flex: 4 1 220px; min-width: 0; }
.fx-qty { flex: 0 1 90px; min-width: 0; }
.fx-wide { flex: 1 1 280px; min-width: 0; }

/* A person in the document check form: name/role, direct contacts, then the checkboxes. */
.person-row {
    padding: 10px 12px;
    border: 1px solid var(--mud-palette-lines-default);
    border-radius: 8px;
}
