@font-face {
    font-family: "Inter";
    src: url('/fonts/Inter_18pt-Regular.ttf');
    font-style: normal;
}
@font-face {
    font-family: "InterSemiBold";
    src: url('/fonts/Inter_18pt-SemiBold.ttf');
    font-style: normal;
}

/* Brand palette — dark navy + gold theme.
   These custom properties are the single source of truth for the theme; re-theme here.
   --brand-primary / --brand-primary-hover are kept (mapped to gold) so existing consumers
   pick up the accent without per-rule edits. */
:root {
    /* Shell (darkest navy) */
    --shell-900: #060b18;
    --shell-800: #0a1220;
    --shell-700: #0d1a2f;
    /* Raised content surfaces (data sits on these, lighter than the shell) */
    --surface: #101c30;
    --surface-raised: #13203a;
    --surface-hover: #16264a;
    /* Gold accent */
    --gold: #e8b84b;
    --gold-bright: #f5c542;
    /* Structural hairline */
    --hairline: rgba(90, 140, 180, 0.18);
    /* Status */
    --status-success: #4ade80;
    --status-danger: #f0677d;
    --status-warning: #e8b84b;
    --status-info: #5aa0d0;
    /* Text */
    --ink: #f4f7fb;
    --ink-muted: #9fb0c3;
    --ink-faint: #6b7d92;
    /* Shell gradient */
    --shell-gradient: radial-gradient(140% 120% at 15% 0%, #0d1a2f 0%, #060b18 60%);

    /* Accent aliases kept for existing rules */
    --brand-primary: var(--gold);
    --brand-primary-hover: var(--gold-bright);

    /* ── Align Radzen (material-dark) to the Lustro navy + gold palette ──────
       app.css loads after material-dark.css, so overriding these Radzen custom
       properties on :root re-themes every Radzen pop-up (Confirm dialogs,
       notifications, menus, spinners) to match the app chrome instead of the
       default Material purple-on-grey. */
    --rz-primary: var(--gold);
    --rz-primary-light: var(--gold-bright);
    --rz-primary-lighter: rgba(232, 184, 75, 0.14);
    --rz-primary-dark: #d3a63e;
    --rz-primary-darker: #b98f33;
    /* Dark text sits on the gold primary (light) surface */
    --rz-text-contrast-color: var(--shell-900);
    /* Remap the neutral-grey base surfaces to the navy scale */
    --rz-base-900: #060b18;
    --rz-base-800: #101c30;
    --rz-base-700: #13203a;
    --rz-base-600: #16264a;
    --rz-series-1: var(--gold);
}


html, body, #app {
    height: 100%;
    width: 100%;
    font-family: "Inter";
    font-size: 16px;
    background: var(--shell-900);
    color: var(--ink);
}

body {
    background: var(--shell-gradient);
    background-attachment: fixed;
    color: var(--ink);
}

h5 {
    font-family: InterSemiBold;
    font-size: 18px;
}

.main-content {
    height: 100%;
    padding: 20px;
    background: transparent;
    color: var(--ink);
}

.page-box {
    display: block;
    border: 1px solid var(--hairline);
    padding: 20px;
    background: var(--surface);
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.35);
}

/* ── Login split screen ─────────────────────────────────────────────────── */

.login-shell {
    display: flex;
    margin: -20px; /* counteract .main-content padding for a full-bleed layout */
    min-height: 100vh;
    background: var(--shell-gradient);
}

.login-showcase {
    flex: 1 1 60%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--shell-gradient);
    position: relative;
    overflow: hidden;
    border-right: 1px solid var(--hairline);
}

/* Faint decorative geometry behind the showcase */
.login-showcase::before,
.login-showcase::after {
    content: "";
    position: absolute;
    border: 1px solid var(--hairline);
    border-radius: 50%;
    opacity: 0.35;
    pointer-events: none;
}

.login-showcase::before {
    width: 760px;
    height: 760px;
    top: 8%;
    left: 6%;
}

.login-showcase::after {
    width: 520px;
    height: 520px;
    top: 24%;
    left: 22%;
    opacity: 0.5;
}

.login-slides {
    position: relative;
    width: 100%;
    max-width: 560px;
    height: 430px;
    z-index: 1;
}

.login-slide {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 0 30px;
    opacity: 0;
    transition: opacity 0.8s ease;
    pointer-events: none;
}

.login-slide.active {
    opacity: 1;
}

.login-slide-art {
    width: 160px;
    height: 160px;
    border-radius: 50%;
    background: rgba(19, 32, 58, 0.5);
    border: 1px solid var(--hairline);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gold);
    margin-bottom: 34px;
}

.login-slide-art svg {
    width: 84px;
    height: 84px;
}

.login-slide-title {
    font-family: InterSemiBold;
    font-size: 26px;
    color: var(--ink);
    margin-bottom: 10px;
}

.login-slide-caption {
    font-size: 15px;
    color: var(--ink-muted);
    max-width: 380px;
    margin: 0 auto;
}

.login-dots {
    display: flex;
    gap: 12px;
    margin-top: 26px;
    position: absolute;
    bottom: 36px;
    z-index: 1;
}

.login-dot {
    width: 9px;
    height: 9px;
    padding: 0;
    border-radius: 50%;
    background: var(--ink-faint);
    border: none;
    cursor: pointer;
    position: relative;
}

    .login-dot:hover, .login-dot:focus {
        background: var(--ink-muted);
    }

.login-dot.active {
    background: var(--gold);
}

.login-dot-progress {
    position: absolute;
    left: -2px;
    bottom: -7px;
    height: 2px;
    width: 0;
    background: var(--gold);
    animation: login-dot-progress 5s linear forwards;
}

@keyframes login-dot-progress {
    to {
        width: 13px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .login-slide {
        transition: none;
    }

    .login-dot-progress {
        animation: none;
    }
}

.login-panel {
    flex: 1 1 40%;
    min-width: 380px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--shell-800);
    box-shadow: rgba(0, 0, 0, 0.35) -8px 0 24px;
}

.login-card {
    width: 320px;
    padding: 28px;
    background: var(--surface);
    border: 1px solid var(--hairline);
    border-radius: 12px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
}

.login-wordmark {
    display: flex;
    flex-direction: column;
    margin-bottom: 28px;
}

.login-card .form-group label {
    font-size: 13px;
    color: var(--ink-muted);
}

.login-submit {
    width: 100%;
    padding: 10px 12px;
    margin-top: 12px;
    border-radius: 10px;
    background: var(--gold);
    color: var(--shell-900);
    font-weight: 600;
}

.login-submit:hover:not(:disabled),
.login-submit:focus:not(:disabled) {
    background: var(--gold-bright);
    color: var(--shell-900);
}

.login-note {
    margin-top: 22px;
    font-size: 12px;
    color: var(--ink-faint);
    text-align: center;
}

@media (max-width: 900px) {
    .login-showcase {
        display: none;
    }

    .login-panel {
        min-width: 0;
        box-shadow: none;
    }
}

.reference-data-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    border: 1px solid var(--hairline);
    border-radius: 8px;
    padding: 12px 16px;
    margin: 10px 0;
    background: var(--surface-raised);
}

.table-pager {
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: flex-end;
    margin-bottom: 6px;
}

/* ── Brand wordmark (login + sidebar) ──────────────────────────────────── */

.brand {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    text-decoration: none;
}

.brand-mark-circle {
    width: 54px;
    height: 54px;
    border-radius: 50%;
    background: var(--surface-raised);
    border: 1px solid var(--hairline);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.brand-mark {
    width: 36px;
    height: 36px;
    object-fit: contain;
}

.brand-words, .login-wordmark {
    line-height: 1.2;
}

.brand-name {
    display: block;
    font-family: InterSemiBold;
    font-size: 22px;
    color: var(--ink);
}

.brand-sub {
    display: block;
    font-size: 13px;
    color: var(--gold);
    letter-spacing: 3px;
    text-transform: uppercase;
}

.form-group {
    margin-bottom: 10px;
}

/* Form controls (Bootstrap override for the dark theme) */
.form-control {
    background: var(--surface-raised);
    border: 1px solid var(--hairline);
    color: var(--ink);
    border-radius: 8px;
}

.form-control:focus {
    background: var(--surface-raised);
    color: var(--ink);
    border-color: var(--gold);
    box-shadow: 0 0 0 2px rgba(232, 184, 75, 0.25);
}

.form-control::placeholder {
    color: var(--ink-faint);
}

/* Native file inputs: theme the browser's built-in "Choose File" button and the
   "No file chosen" text, which otherwise render in the browser's light default. */
input[type="file"] {
    color: var(--ink-muted);
}

input[type="file"]::file-selector-button {
    background: transparent;
    border: 1px solid var(--hairline);
    color: var(--ink);
    border-radius: 8px;
    padding: 6px 14px;
    margin-right: 10px;
    cursor: pointer;
    font-family: Inter;
    font-size: 14px;
}

input[type="file"]::file-selector-button:hover {
    background: var(--surface-hover);
}

/* Browser autofill paints its own white background and dark text, ignoring the dark theme.
   Force the fill to the dark surface and light text so autofilled fields match the theme. */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
input:-webkit-autofill:active,
textarea:-webkit-autofill,
select:-webkit-autofill {
    -webkit-text-fill-color: var(--ink);
    -webkit-box-shadow: 0 0 0 1000px var(--surface-raised) inset;
    box-shadow: 0 0 0 1000px var(--surface-raised) inset;
    caret-color: var(--ink);
    border: 1px solid var(--hairline);
    -webkit-transition: background-color 9999s ease-in-out 0s;
    transition: background-color 9999s ease-in-out 0s;
}

.form-control:disabled,
.form-control[readonly] {
    background: var(--surface);
    color: var(--ink-muted);
}

select.form-control option {
    background: var(--surface-raised);
    color: var(--ink);
}

#blazor-error-ui {
    background: #2a2410;
    color: var(--ink);
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.4);
    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;
    }

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #7a1f1f;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

.loading-progress {
    position: relative;
    display: block;
    width: 8rem;
    height: 8rem;
    margin: 20vh auto 1rem auto;
}

    .loading-progress circle {
        fill: none;
        stroke: rgba(90, 140, 180, 0.18);
        stroke-width: 0.6rem;
        transform-origin: 50% 50%;
        transform: rotate(-90deg);
    }

        .loading-progress circle:last-child {
            stroke: var(--gold);
            stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
            transition: stroke-dasharray 0.05s ease-in-out;
        }

.loading-progress-text {
    position: absolute;
    text-align: center;
    font-weight: bold;
    color: var(--ink);
    inset: calc(20vh + 3.25rem) 0 auto 0.2rem;
}

    .loading-progress-text:after {
        content: var(--blazor-load-percentage-text, "Loading");
    }

.tabs {
    display: flex;
    gap: 5px;
    margin-bottom: 5px;
}

.tabs .tab {
    display: block;
    cursor: pointer;
    padding: 2px 5px;
    border-bottom: 2px solid transparent;
    color: var(--ink-muted);
}

    .tabs .tab.active {
        font-family: InterSemiBold;
        color: var(--ink);
        border-bottom: 2px solid var(--gold);
    }

    .tabs .tab:hover {
        color: var(--ink);
        border-bottom: 2px solid var(--gold);
    }

span.app-name {
    font-size: 20px;
    vertical-align: middle;
    font-family: 'InterSemiBold';
    top: -3px;
    position: relative;
}

.header-line {
    position: relative;
    padding-bottom: 10px;
    margin-bottom: 10px;
    border-bottom: 1px solid var(--hairline);
    color: var(--ink-muted);
}

.up-block {
    position: relative;
    padding-bottom: 10px;
    margin-bottom: 10px;
    border-bottom: 1px solid var(--hairline);
}

.up-block .export-btns, .box .export-btns {
    position: absolute;
    right: 20px;
    top: 10px;
}

button {
    /* Transparent 1px border so solid and .alt (bordered) buttons share the same
       box height and align on a row. Fixed font-size stops buttons shrinking to the
       inherited 13px when nested inside a data table. */
    border: 1px solid transparent;
    padding: 6px 14px;
    background: var(--gold);
    color: var(--shell-900);
    border-radius: 10px;
    font-weight: 600;
    font-size: 14px;
    line-height: 1.4;
    vertical-align: middle;
}

button.alt {
    padding: 6px 14px;
    background: transparent;
    color: var(--ink);
    border: 1px solid var(--hairline);
    border-radius: 10px;
    font-weight: 500;
}

/* :where() keeps these at element-level specificity so buttons with their own
   class (.admin-child tabs, .admin-card, .alt, .danger, etc.) are never overridden
   by the default gold hover/focus/disabled styling. */
button:where(:hover) {
    background: var(--gold-bright);
    color: var(--shell-900);
}

button:where(:focus) {
    background: var(--gold-bright);
    color: var(--shell-900);
}

button:where(:disabled) {
    background: rgba(232, 184, 75, 0.25);
    color: rgba(6, 11, 24, 0.6);
}


    button.alt:hover {
        background: var(--surface-hover);
        color: var(--ink);
        border: 1px solid var(--hairline);
    }

    button.alt:focus {
        background: var(--surface-hover);
        color: var(--ink);
        border: 1px solid var(--hairline);
    }
    button.alt:disabled {
        background: transparent;
        color: var(--ink-faint);
        border: 1px solid var(--hairline);
    }

button.danger {
    background: var(--status-danger);
    color: var(--shell-900);
}

button.danger:hover {
    background: #f3899a;
}

button.danger:disabled {
    background: rgba(240, 103, 125, 0.4);
}


.header-line .logo {
    width: auto;
    height: 80px;
    object-fit: contain;
}

    .header-line .nav {
        position: absolute;
        right: 0px;
        top: 15px;
    }

    .nav .sep, .export-btns .sep {
        margin-left: 10px;
        margin-right: 10px;
    }

.nav-item {
    margin-left: 10px;
    font-weight: 500;
    cursor: pointer;
    color: var(--ink-muted);
    text-decoration: none;
    padding: 2px 5px;
    border-bottom: 2px solid transparent;
}

    .nav-item.active, .nav-item:hover {
        text-decoration: none !important;
        color: var(--ink) !important;
        border-bottom: 2px solid var(--gold);
    }

    .nav-item.active {
        font-family: InterSemiBold;
    }

    .dialog-backdrop {
        position: fixed;
        left: 0;
        top: 0;
        width: 100%;
        height: 100%;
        background: rgba(0,0,0, 0.6);
    }

    .dialog {
        z-index: 99;
        position: fixed;
        width: 500px;
        left: calc(50% - 250px);
        top: calc(50% - 250px);
        background: var(--surface);
        border: 1px solid var(--hairline);
        color: var(--ink);
        padding: 20px;
        border-radius: 10px;
    }

    .nav-item:hover {
        text-decoration: underline;
    }
table {
    width: 100%;
    border-collapse: collapse;
    font: 13px/1.4 Inter, "Segoe UI", -apple-system, sans-serif;
    color: var(--ink);
}

table thead th, table > tbody > tr:first-child th {
    position: sticky; top: 0; z-index: 1; background: var(--surface-raised);
    padding: 8px 12px; text-align: left;
    font-size: 12px; font-weight: 600; color: var(--ink-muted);
    border-bottom: 1px solid var(--hairline); white-space: nowrap;
    text-transform: none; letter-spacing: 0;
}

table td, table th {
    padding: 6px 12px;
    border: 0;
    border-bottom: 1px solid var(--hairline);
    vertical-align: middle;
}

table tbody tr:hover td { background: var(--surface-hover); }

table td.num, table th.num { text-align: right; font-variant-numeric: tabular-nums; }

table td.neg { color: var(--status-danger); }

table td.id {
    font-family: ui-monospace, Consolas, monospace;
    font-size: 12px; color: var(--ink-faint);
    max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

table td.editable { cursor: pointer; position: relative; }

table td.editable:hover { background: var(--surface-hover); }

table td.editable:hover::after {
    content: "▾"; position: absolute; right: 8px; top: 50%;
    transform: translateY(-50%); color: var(--ink-faint); font-size: 10px;
}

table td.editable select {
    appearance: none;
    -webkit-appearance: none;
    display: block;
    width: 100%;
    background: transparent;
    border: 0;
    padding: 0;
    font: inherit;
    color: inherit;
    cursor: pointer;
}

table td.readonly { color: var(--ink-muted); }

table tr.modified td { background: rgba(232, 184, 75, 0.12); }

table tr.missing-fos td:first-child { box-shadow: inset 3px 0 0 var(--status-warning); }

/* A held row (F2): an amount could not be read as GBP pence. Danger accent, distinct from the
   warning accent used for a missing FOS category, so the two conditions are visually separable. */
table tr.held-amount td:first-child { box-shadow: inset 3px 0 0 var(--status-danger); }
.amount-unreadable { color: var(--status-danger); font-weight: 600; white-space: nowrap; }

table tr.selected td, table tr.selected:hover td { background: rgba(232, 184, 75, 0.12); }
table tr.selected td:first-child { box-shadow: inset 3px 0 0 var(--gold); }

    table.grayed {
        opacity: 0.5;
    }

    .mt-10 {
        margin-top: 10px;
    }

.mr-10 {
    margin-right: 10px;
}

.report-option {
    text-decoration: underline;
    color: var(--gold);
    cursor: pointer;
}

.error
{
    color: var(--status-danger);
}

span.clickable {
    cursor: pointer;
    text-decoration: underline;
    color: var(--ink-muted);
    margin-right: 10px;
}

span.clickable:hover {
    color: var(--ink);
}

label {
    font-weight: bold;
}

.small-download {
    margin-right: 10px;
}

.split-view {
    display: flex;
    gap: 20px;
}

.split-view > * {
    flex-grow: 1;
}

.details-view {
    display: none;
}

.details-view.expanded {
    display: block;
    min-width: 70%;
}

.up-block.hidden {
    display: none;
}

.box {
    border: 1px solid var(--hairline);
    border-radius: 12px;
    margin-top: 20px;
    padding: 20px;
    position: relative;
    background: var(--surface);
}

.import-export-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 0;
    border-bottom: 1px solid var(--hairline);
}

.import-export-row:last-of-type {
    border-bottom: none;
}

.import-warning {
    background: rgba(232, 184, 75, 0.1);
    border: 1px solid rgba(232, 184, 75, 0.4);
    border-radius: 6px;
    padding: 10px 12px;
    margin: 10px 0;
    font-size: 0.875rem;
    color: var(--ink);
}

.import-result {
    background: var(--surface);
    border: 1px solid var(--hairline);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
}

.block {
    display: inline-block;
}

.mb-10 {
    margin-bottom: 10px;
}

/* tr.missing-fos accent applied via the global table rules above */

.search-bar {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.search-bar > * {
    flex-grow: 1;
}

.search-bar > *:last-child {
    max-width: 200px;
}

.search-bar.error .form-control {
    border: 1px solid var(--status-danger);
}

.alert {
    margin-top: 10px;
    border-radius: 10px;
}

/* Dark-theme overrides for Bootstrap's light alert variants so status messages
   fit the theme instead of appearing as bright light boxes. */
.alert-danger {
    background: rgba(240, 103, 125, 0.12);
    border: 1px solid rgba(240, 103, 125, 0.4);
    color: var(--status-danger);
}

.alert-success {
    background: rgba(74, 222, 128, 0.12);
    border: 1px solid rgba(74, 222, 128, 0.4);
    color: var(--status-success);
}

.alert-warning {
    background: rgba(232, 184, 75, 0.12);
    border: 1px solid rgba(232, 184, 75, 0.4);
    color: var(--status-warning);
}

.alert-info {
    background: rgba(90, 160, 208, 0.12);
    border: 1px solid rgba(90, 160, 208, 0.4);
    color: var(--status-info);
}

/* Batch Parsing Styles */
.batch-parse-view {
    padding: 10px 0;
}

.batch-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.batch-header h5 {
    margin: 0;
}

.batch-actions {
    display: flex;
    gap: 20px;
    align-items: center;
    margin-bottom: 10px;
    padding: 10px;
    background: var(--surface-raised);
    border-radius: 8px;
}

.batch-actions label {
    display: flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    font-weight: normal;
}

.batch-actions input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.batch-results {
    border: 1px solid var(--hairline);
    border-radius: 12px;
    padding: 15px;
    background: var(--surface);
}

.batch-results h5 {
    margin-bottom: 10px;
}

.batch-results-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 10px;
}

.batch-result-item {
    border: 1px solid var(--hairline);
    border-radius: 8px;
    padding: 10px 15px;
    background: var(--surface-raised);
}

.batch-result-item.error {
    border-color: rgba(240, 103, 125, 0.5);
    background: rgba(240, 103, 125, 0.08);
}

.batch-result-item.success {
    border-color: rgba(74, 222, 128, 0.5);
    background: rgba(74, 222, 128, 0.08);
}

.batch-result-header {
    display: flex;
    align-items: center;
    gap: 15px;
}

.batch-result-header .report-date {
    font-weight: bold;
}

.batch-result-header .report-provider {
    color: var(--ink-muted);
}

.batch-result-header .status-badge {
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 12px;
    font-weight: bold;
}

.batch-result-header .status-badge.success {
    background: rgba(74, 222, 128, 0.15);
    color: var(--status-success);
}

.batch-result-header .status-badge.error {
    background: rgba(240, 103, 125, 0.15);
    color: var(--status-danger);
}

.batch-result-item .error-message {
    margin-top: 8px;
    color: var(--status-danger);
    font-size: 14px;
}

.batch-detail-view {
    border: 1px solid rgba(232, 184, 75, 0.4);
    border-radius: 12px;
    padding: 15px;
    background: rgba(232, 184, 75, 0.06);
}

.batch-detail-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.batch-detail-header h5 {
    margin: 0;
    color: var(--gold);
}

.mt-20 {
    margin-top: 20px;
}

button.small {
    padding: 2px 8px;
    font-size: 12px;
}

/* Manual Inputs Form */
.manual-inputs-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
    max-width: 600px;
}

.manual-inputs-form .form-group {
    margin-bottom: 0;
}

.manual-inputs-form .form-control {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid var(--hairline);
    border-radius: 8px;
    background: var(--surface-raised);
    color: var(--ink);
}

.manual-inputs-form select.form-control {
    padding: 6px 8px;
}

.income-fields {
    display: flex;
    gap: 15px;
}

.income-fields > div {
    flex: 1;
}

.sub-label {
    font-weight: normal;
    font-size: 13px;
    color: var(--ink-muted);
}

.info-text {
    font-size: 14px;
    color: var(--ink-muted);
}

/* Review lifecycle status badges */
.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.02em;
    border: 1px solid transparent;
    white-space: nowrap;
}
.badge-draft { background: var(--surface-hover); color: var(--ink-muted); border-color: var(--hairline); }
.badge-approved { background: rgba(90, 160, 208, 0.15); color: var(--status-info); border-color: rgba(90, 160, 208, 0.3); }
.badge-submitted { background: rgba(232, 184, 75, 0.15); color: var(--status-warning); border-color: rgba(232, 184, 75, 0.3); }
.badge-processed { background: rgba(74, 222, 128, 0.15); color: var(--status-success); border-color: rgba(74, 222, 128, 0.3); }
.badge-deleted { background: rgba(240, 103, 125, 0.15); color: var(--status-danger); border-color: rgba(240, 103, 125, 0.3); }
/* Held (F2): a distinct class so Held and Deleted styling can diverge later. Shares the danger
   colour for now, but the two states must not be conflated behind a single class. */
.badge-held { background: rgba(240, 103, 125, 0.15); color: var(--status-danger); border-color: rgba(240, 103, 125, 0.3); }

/* Open Banking Upload */
.ob-upload-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Data Summary (Camunda tab) */
.data-summary {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.summary-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.summary-label {
    font-weight: 600;
    min-width: 140px;
}

.summary-value.ok {
    color: var(--status-success);
}

.summary-value.missing {
    color: var(--status-danger);
}

.ob-preview-list {
    margin-left: 148px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.ob-preview-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
}

.ob-file-name {
    font-family: monospace;
}

/* Camunda Loading Overlay */
.camunda-loading-overlay {
    position: absolute;
    inset: 0;
    background: rgba(6, 11, 24, 0.85);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 10;
    gap: 12px;
    padding: 20px;
}

.camunda-spinner {
    width: 48px;
    height: 48px;
    border: 5px solid rgba(90, 140, 180, 0.18);
    border-top-color: var(--gold);
    border-radius: 50%;
    animation: camunda-spin 0.9s linear infinite;
}

@keyframes camunda-spin {
    to {
        transform: rotate(360deg);
    }
}

.camunda-loading-message {
    font-family: InterSemiBold;
    font-size: 16px;
    color: var(--ink);
    margin: 0;
}

.camunda-loading-sub {
    font-size: 13px;
    color: var(--ink-muted);
    margin: 0;
    text-align: center;
}

/* ── Admin nav — card-style primary + contextual panel (LUSTRO-REVIEW-011) ── */

.admin-nav {
    margin-bottom: 16px;
}

/* Align the Save/Cancel row with the provider table's cell content (the Add provider
   button sits inside a <td>, which carries the global 12px cell padding). */
.provider-actions {
    padding-left: 12px;
}

.admin-nav__primary {
    display: flex;
    gap: 12px;
    align-items: stretch;
}

.admin-card {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: var(--surface);
    border: 1px solid var(--hairline);
    border-top: 3px solid transparent;
    border-radius: 8px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
    padding: 16px 20px;
    cursor: pointer;
    text-align: left;
    transition: box-shadow 0.15s ease, transform 0.15s ease, border-top-color 0.15s ease;
    min-width: 160px;
}

.admin-card:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
    background: var(--surface-raised);
}

.admin-card.is-active {
    border-top-color: var(--gold);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
    transform: translateY(-2px);
    background: var(--surface-raised);
}

.admin-card.is-active::after {
    content: "";
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 8px solid var(--hairline);
    pointer-events: none;
}

.admin-card__label {
    display: block;
    font-family: InterSemiBold;
    font-size: 14px;
    color: var(--ink);
}

.admin-card__hint {
    display: block;
    font-size: 12px;
    color: var(--ink-muted);
    margin-top: 4px;
}

.admin-nav__panel {
    display: flex;
    gap: 4px;
    background: var(--surface-raised);
    border: 1px solid var(--hairline);
    border-top: none;
    border-radius: 0 0 8px 8px;
    padding: 8px 12px;
    margin-top: 2px;
}

.admin-child {
    background: none;
    border: none;
    border-radius: 4px;
    padding: 6px 12px;
    cursor: pointer;
    font-size: 13px;
    color: var(--ink-muted);
    position: relative;
    transition: background 0.1s ease;
    font-weight: 500;
}

.admin-child:hover {
    background: var(--surface-hover);
    color: var(--ink);
}

.admin-child.is-active {
    font-family: InterSemiBold;
    color: var(--gold);
    background: rgba(232, 184, 75, 0.14);
}

.admin-child.is-active::before {
    content: "";
    display: inline-block;
    width: 6px;
    height: 6px;
    background: var(--gold);
    border-radius: 50%;
    margin-right: 6px;
    vertical-align: middle;
}

.admin-data-transfer-notice {
    font-size: 12px;
    color: var(--ink-muted);
    margin-bottom: 12px;
}

/* Audit-log filter bar — LUSTRO-REVIEW-008 */
.audit-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: flex-end;
    margin: 12px 0 16px;
}

.audit-filter label {
    display: flex;
    flex-direction: column;
    font-size: 13px;
    color: var(--ink-muted);
    gap: 4px;
}

.audit-filter input[type="date"],
.audit-filter select {
    padding: 6px 8px;
    border: 1px solid var(--hairline);
    border-radius: 8px;
    font-size: 13px;
    background: var(--surface-raised);
    color: var(--ink);
}

/* Provider chip — read-only pill displayed on the review header once a review is loaded */
.review-meta {
    margin-bottom: 10px;
}

.provider-chip {
    display: inline-block;
    background: var(--surface-hover);
    color: var(--gold);
    border: 1px solid var(--hairline);
    border-radius: 12px;
    padding: 2px 10px;
    font-size: 12px;
}

/* Mapping warning bar — amber expandable banner on the Category Mappings tab */
.mapping-warning-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: rgba(232, 184, 75, 0.1);
    border: 1px solid rgba(232, 184, 75, 0.4);
    border-radius: 6px;
    cursor: pointer;
    user-select: none;
    margin-bottom: 12px;
    font-size: 0.875rem;
    color: var(--ink);
}
.mapping-warning-bar .warning-icon { color: var(--status-warning); flex-shrink: 0; }
.mapping-warning-bar .warning-summary { flex: 1; }
.mapping-warning-bar .warning-chevron { font-size: 0.75rem; color: var(--gold); }

.mapping-warning-panel {
    background: rgba(232, 184, 75, 0.05);
    border: 1px solid rgba(232, 184, 75, 0.4);
    border-top: none;
    border-radius: 0 0 6px 6px;
    padding: 12px 16px;
    margin-top: -12px;
    margin-bottom: 12px;
    max-height: 320px;
    overflow-y: auto;
}
.mapping-warning-panel .warning-list {
    margin: 0 0 10px 0;
    padding-left: 18px;
    font-size: 0.875rem;
    color: var(--ink-muted);
}
.mapping-warning-panel .warning-list li { margin-bottom: 4px; }
.mapping-warning-panel .warning-fix-note {
    font-size: 0.8rem;
    color: var(--ink-faint);
    margin-bottom: 10px;
}
.mapping-warning-panel .warning-nav-btn {
    font-size: 0.8rem;
    padding: 5px 12px;
}

/* ── Jobs list page ── */

.jobs-count {
    font-family: Inter;
    font-size: 13px;
    color: var(--ink-muted);
    font-weight: normal;
    margin-left: 8px;
}

.section-divider {
    margin-top: 32px;
    margin-bottom: 16px;
}

.section-divider hr {
    border: 0;
    border-top: 1px solid var(--hairline);
    margin-bottom: 12px;
}

.section-divider h6 {
    font-family: InterSemiBold;
    font-size: 14px;
    color: var(--ink);
    margin: 0 0 2px 0;
}

.section-sub {
    font-size: 12px;
    color: var(--ink-faint);
    margin: 0 0 12px 0;
}

.job-status {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.job-status--pending {
    background: rgba(232, 184, 75, 0.15);
    color: var(--status-warning);
}

.job-status--running {
    background: rgba(90, 160, 208, 0.15);
    color: var(--status-info);
}

.job-status--completed {
    background: rgba(74, 222, 128, 0.15);
    color: var(--status-success);
}

.job-status--failed {
    background: rgba(240, 103, 125, 0.15);
    color: var(--status-danger);
}

.job-status--cancelled {
    background: var(--surface-hover);
    color: var(--ink-faint);
}

/* ── Recoverable error boundary panel (BUG-2) ──────────────────────────── */

.page-error-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 24px;
    text-align: center;
}

.page-error-panel__icon {
    font-size: 48px;
    color: var(--status-warning);
    margin-bottom: 16px;
    line-height: 1;
}

.page-error-panel__heading {
    font-family: InterSemiBold;
    font-size: 22px;
    color: var(--ink);
    margin-bottom: 8px;
}

.page-error-panel__body {
    font-size: 15px;
    color: var(--ink-muted);
    max-width: 440px;
    margin-bottom: 24px;
}

.page-error-panel__actions {
    display: flex;
    gap: 12px;
    align-items: center;
    justify-content: center;
}

.page-error-panel__home-link {
    font-size: 14px;
    color: var(--gold);
    text-decoration: underline;
}

.page-error-panel__home-link:hover {
    color: var(--gold-bright);
}

/* ── App shell: left sidebar + slim top bar (dark rebrand) ─────────────── */

.app-shell {
    display: flex;
    min-height: 100vh;
}

.app-sidebar {
    width: 240px;
    flex-shrink: 0;
    background: var(--shell-900);
    border-right: 1px solid var(--hairline);
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
}

.app-sidebar__brand {
    display: flex;
    align-items: center;
    gap: 12px;
    height: 64px;
    padding: 0 20px;
    border-bottom: 1px solid var(--hairline);
    text-decoration: none;
}

.app-sidebar__brand-mark {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    /* White fill matches the Allegiant logo's own background so the mark reads as one piece */
    border: 1px solid #ffffff;
    background: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
}

.app-sidebar__brand-mark img {
    width: 22px;
    height: 22px;
    object-fit: contain;
}

.app-sidebar__brand-words {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.app-sidebar__brand-sub {
    font-size: 10px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--ink-muted);
}

.app-sidebar__brand-name {
    font-family: InterSemiBold;
    font-size: 15px;
    letter-spacing: 0.16em;
    color: var(--ink);
}

.app-sidebar__nav {
    flex: 1;
    padding: 18px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.app-nav-item {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 8px;
    color: var(--ink-muted);
    text-decoration: none;
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    cursor: pointer;
    transition: background 0.12s ease, color 0.12s ease;
}

.app-nav-item:hover {
    background: var(--surface-hover);
    color: var(--ink);
    text-decoration: none;
}

.app-nav-item.active {
    background: var(--surface);
    color: var(--ink);
}

.app-nav-item.active::before {
    content: "";
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 20px;
    background: var(--gold);
    border-radius: 0 3px 3px 0;
}

.app-nav-item .app-nav-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    color: var(--ink-faint);
}

.app-nav-item:hover .app-nav-icon,
.app-nav-item.active .app-nav-icon {
    color: var(--gold);
}

.app-sidebar__footer {
    padding: 16px 12px;
    border-top: 1px solid var(--hairline);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.app-user-chip {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border: 1px solid var(--hairline);
    border-radius: 10px;
    background: var(--surface);
}

.app-user-chip__avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--surface-hover);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--ink);
    flex-shrink: 0;
}

.app-user-chip__words {
    display: flex;
    flex-direction: column;
    line-height: 1.25;
}

.app-user-chip__name {
    font-size: 13px;
    font-weight: 500;
    color: var(--ink);
}

.app-user-chip__role {
    font-size: 10px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--ink-muted);
}

.app-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.app-topbar {
    height: 56px;
    flex-shrink: 0;
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 0 24px;
    border-bottom: 1px solid var(--hairline);
    background: rgba(6, 11, 24, 0.65);
    backdrop-filter: blur(8px);
}

.app-topbar__title {
    font-family: InterSemiBold;
    font-size: 14px;
    color: var(--ink);
}

.app-topbar__actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.app-content {
    flex: 1;
    padding: 24px;
    min-width: 0;
}

/* Custom scrollbars to match the dark theme */
*::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

*::-webkit-scrollbar-track {
    background: transparent;
}

*::-webkit-scrollbar-thumb {
    background: rgba(90, 140, 180, 0.22);
    border-radius: 8px;
}

*::-webkit-scrollbar-thumb:hover {
    background: rgba(90, 140, 180, 0.35);
}

@media (max-width: 720px) {
    .app-shell {
        flex-direction: column;
    }

    .app-sidebar {
        width: 100%;
        height: auto;
        position: static;
        flex-direction: row;
        align-items: center;
        overflow-x: auto;
    }

    .app-sidebar__nav {
        flex-direction: row;
        padding: 8px;
    }

    .app-sidebar__footer {
        border-top: none;
        border-left: 1px solid var(--hairline);
    }
}
