:root {
    color-scheme: light;
    --ink: #182337;
    --muted: #647085;
    --line: #dbe2ea;
    --paper: #ffffff;
    --wash: #f3f6fa;
    --blue: #235a92;
    --blue-dark: #153d68;
    --blue-pale: #e9f2fb;
    --gold-pale: #fff5d9;
    --gold: #8c5c05;
    --red: #a23d3d;
    --shadow: 0 18px 48px rgb(24 35 55 / 10%);
    font-family:
        Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI",
        sans-serif;
}

* {
    box-sizing: border-box;
}
body [hidden] {
    display: none;
}
body {
    margin: 0;
    color: var(--ink);
    background: var(--wash);
}
button,
input,
select {
    font: inherit;
}
button {
    border: 0;
    border-radius: 9px;
    padding: 12px 18px;
    color: white;
    background: var(--blue);
    font-weight: 750;
    cursor: pointer;
}
button:hover:not(:disabled) {
    background: var(--blue-dark);
}
button:disabled {
    cursor: wait;
    opacity: 0.5;
}

.training-banner {
    padding: 8px 24px;
    color: var(--gold);
    background: var(--gold-pale);
    border-bottom: 1px solid #ead6a1;
    text-align: center;
    font-size: 13px;
    font-weight: 750;
}
.site-header {
    min-height: 76px;
    padding: 16px 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    color: white;
    background: var(--blue-dark);
}
.site-header strong {
    display: block;
    margin-top: 3px;
    font-size: 20px;
}
.staff-chip {
    display: grid;
    padding: 8px 14px;
    border: 1px solid rgb(255 255 255 / 20%);
    border-radius: 10px;
}
.staff-chip small,
.site-header .eyebrow {
    color: #c4d8ee;
}
main {
    width: min(1540px, 100%);
    margin: 0 auto;
}
.dashboard {
    padding: 44px 32px 80px;
}
.hero-card,
.queue-card,
.form-panel,
.source-panel,
.step-panel {
    background: var(--paper);
    box-shadow: var(--shadow);
}
.hero-card {
    padding: 34px;
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 32px;
    border-radius: 18px;
}
.hero-card h1,
.form-heading h1 {
    margin: 5px 0 10px;
    letter-spacing: -0.035em;
}
.hero-card h1 {
    font-size: clamp(30px, 4vw, 48px);
}
.hero-card p {
    max-width: 760px;
    margin: 0;
    color: var(--muted);
    line-height: 1.65;
}
.eyebrow {
    color: var(--blue);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}
.dashboard-actions {
    margin: 20px 0;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}
.dashboard-actions button,
.secondary {
    color: var(--blue-dark);
    background: var(--paper);
    border: 1px solid var(--line);
}
.dashboard-actions button:hover,
.secondary:hover {
    color: white;
}
.queue-card {
    border-radius: 14px;
    overflow: hidden;
}
.section-heading,
.form-heading {
    padding: 24px 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    border-bottom: 1px solid var(--line);
}
.section-heading h2,
.source-panel h2,
.step-panel h2 {
    margin: 4px 0 0;
}
.count,
.save-state {
    padding: 7px 10px;
    border-radius: 999px;
    color: var(--blue-dark);
    background: var(--blue-pale);
    font-size: 12px;
    font-weight: 750;
}
.table-wrap {
    overflow-x: auto;
}
table {
    width: 100%;
    border-collapse: collapse;
}
th,
td {
    padding: 16px 28px;
    border-bottom: 1px solid var(--line);
    text-align: left;
}
th {
    color: var(--muted);
    background: #fbfcfe;
    font-size: 12px;
    text-transform: uppercase;
}
.status-ready {
    color: var(--blue);
    font-weight: 800;
}

.application-shell {
    min-height: calc(100vh - 108px);
    display: grid;
    grid-template-columns: 230px minmax(520px, 1fr) 340px;
    gap: 18px;
    padding: 24px;
}
.step-panel,
.source-panel,
.form-panel {
    border: 1px solid var(--line);
    border-radius: 14px;
}
.step-panel,
.source-panel {
    align-self: start;
    position: sticky;
    top: 18px;
    padding: 22px;
}
#step-list {
    margin: 24px 0 0;
    padding: 0;
    list-style: none;
}
#step-list li {
    position: relative;
    padding: 11px 8px 11px 34px;
    color: var(--muted);
    border-left: 2px solid var(--line);
    font-size: 13px;
}
#step-list li::before {
    content: attr(data-number);
    position: absolute;
    left: 7px;
    color: #8190a3;
    font-size: 10px;
    font-weight: 800;
}
#step-list li.active {
    color: var(--blue-dark);
    background: var(--blue-pale);
    border-left-color: var(--blue);
    font-weight: 800;
}
#step-list li.complete {
    color: var(--blue);
}
.form-panel {
    min-height: 720px;
    overflow: hidden;
}
#application-form {
    padding: 28px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}
.field {
    display: grid;
    align-content: start;
    gap: 7px;
}
.field.wide {
    grid-column: 1 / -1;
}
.field label,
legend {
    font-size: 13px;
    font-weight: 750;
}
.field input,
.field select {
    width: 100%;
    min-height: 44px;
    padding: 10px 12px;
    color: var(--ink);
    background: white;
    border: 1px solid #bac6d4;
    border-radius: 8px;
}
fieldset.field {
    margin: 0;
    padding: 0;
    border: 0;
}
.radio-row {
    min-height: 44px;
    display: flex;
    align-items: center;
    gap: 18px;
}
.radio-row label {
    display: flex;
    align-items: center;
    gap: 7px;
    font-weight: 500;
}
.radio-row input {
    width: auto;
    min-height: auto;
}
.branch-note,
.form-error {
    margin: 20px 28px 0;
    padding: 13px 15px;
    border-radius: 9px;
    font-size: 13px;
    line-height: 1.5;
}
.branch-note {
    color: var(--blue-dark);
    background: var(--blue-pale);
    border: 1px solid #c9def2;
}
.form-error {
    display: none;
    color: var(--red);
    background: #fff0f0;
    border: 1px solid #edc4c4;
}
.form-error:not(:empty) {
    display: block;
}
.form-actions {
    padding: 22px 28px;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    border-top: 1px solid var(--line);
}
#back-button {
    margin-right: auto;
}

.source-panel {
    color: var(--ink);
}
.source-card {
    margin-top: 16px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fbfcfe;
}
.source-card strong {
    display: block;
    margin-bottom: 9px;
    font-size: 13px;
}
.source-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 12px;
    padding: 6px 0;
    border-top: 1px solid #edf1f5;
    font-size: 12px;
}
.source-row span:first-child {
    color: var(--muted);
}
.source-row span:last-child {
    max-width: 170px;
    text-align: right;
    font-weight: 650;
    overflow-wrap: anywhere;
}

#document-list,
#review-panel {
    padding: 28px;
}
.document-intro {
    margin: 0 0 20px;
    color: var(--muted);
    line-height: 1.6;
}
.document-item {
    margin-bottom: 12px;
    padding: 18px;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 18px;
    align-items: center;
    border: 1px solid var(--line);
    border-radius: 10px;
}
.document-item h3 {
    margin: 0 0 5px;
    font-size: 15px;
}
.document-item p {
    margin: 0;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.45;
}
.document-item.prepared {
    border-color: #9fc3e7;
    background: var(--blue-pale);
}
.document-status {
    color: var(--blue);
    font-size: 12px;
    font-weight: 800;
}
.review-hero {
    padding: 24px;
    color: white;
    background: var(--blue-dark);
    border-radius: 12px;
}
.review-hero h2 {
    margin: 5px 0 8px;
    font-size: 28px;
}
.review-hero p {
    margin: 0;
    color: #d3e3f3;
    line-height: 1.55;
}
.metric-grid {
    margin: 18px 0;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}
.metric {
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 10px;
}
.metric strong {
    display: block;
    font-size: 24px;
}
.metric span {
    color: var(--muted);
    font-size: 12px;
}
.stop-card {
    padding: 17px;
    color: #684604;
    background: var(--gold-pale);
    border: 1px solid #e9d294;
    border-radius: 10px;
    line-height: 1.55;
}
.receipt-note {
    margin-top: 14px;
    padding: 15px;
    color: var(--muted);
    background: #f8fafc;
    border-left: 3px solid var(--blue);
    font-size: 13px;
    line-height: 1.55;
}

@media (max-width: 1100px) {
    .application-shell {
        grid-template-columns: 210px 1fr;
    }
    .source-panel {
        grid-column: 1 / -1;
        position: static;
    }
}
@media (max-width: 760px) {
    .site-header,
    .hero-card {
        align-items: stretch;
        flex-direction: column;
    }
    .dashboard {
        padding: 24px 14px;
    }
    .dashboard-actions {
        grid-template-columns: 1fr 1fr;
    }
    .application-shell {
        display: block;
        padding: 12px;
    }
    .step-panel,
    .source-panel {
        position: static;
        margin-bottom: 12px;
    }
    #application-form {
        grid-template-columns: 1fr;
    }
    .field.wide {
        grid-column: auto;
    }
    .metric-grid {
        grid-template-columns: 1fr;
    }
    th,
    td {
        padding: 12px;
    }
}
