:root {
    --navy: #0f172a;
    --blue: #2563eb;
    --cyan: #06b6d4;
    --surface: #fff;
    --muted: #64748b;
    --border: #dbe3ee;
    --background: #f3f7fb;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; color: var(--navy); background: var(--background); }
a { color: var(--blue); }
.site-header { min-height: 72px; padding: 0 5vw; display: flex; align-items: center; justify-content: space-between; gap: 24px; background: var(--navy); color: #fff; }
.brand { color: #fff; text-decoration: none; font-weight: 800; font-size: 1.2rem; }
.brand span { color: var(--cyan); }
nav { display: flex; gap: 20px; flex-wrap: wrap; }
nav a { color: #e2e8f0; text-decoration: none; }
.page-shell { width: min(1080px, 92vw); margin: 48px auto; }
.auth-shell { width: min(480px, 100%); margin: 20px auto; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: clamp(24px, 4vw, 42px); box-shadow: 0 18px 50px rgba(15, 23, 42, .08); }
.card h1 { margin-top: 0; }
.muted { color: var(--muted); }
.form-row { margin-bottom: 18px; }
.form-section { margin: 28px 0 0; padding: 24px; border: 1px solid var(--border); border-radius: 14px; }
.form-section legend { padding: 0 10px; font-size: 1.08rem; font-weight: 900; }
.form-section .form-grid > div { margin-bottom: 18px; }
.postal-code-hint { display: block; margin-top: 6px; font-size: .8rem; }
.municipality-autocomplete, .postal-code-autocomplete { position: relative; }
.municipality-results, .postal-code-results {
    position: absolute;
    z-index: 30;
    top: calc(100% + 5px);
    right: 0;
    left: 0;
    overflow-y: auto;
    max-height: 290px;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 16px 35px rgba(15, 23, 42, .16);
}
.municipality-result, .municipality-result-empty, .postal-code-result, .postal-code-result-empty { padding: 11px 14px; }
.municipality-result, .postal-code-result { cursor: pointer; }
.municipality-result + .municipality-result, .postal-code-result + .postal-code-result { border-top: 1px solid #e2e8f0; }
.municipality-result:hover, .municipality-result.is-active, .postal-code-result:hover, .postal-code-result.is-active { background: #e0f2fe; color: #075985; }
.municipality-result-empty, .postal-code-result-empty { color: var(--muted); }
input[readonly] { background: #f1f5f9; color: #475569; }
label { display: block; margin-bottom: 7px; font-weight: 700; }
input, select, textarea { width: 100%; padding: 12px 14px; border: 1px solid #cbd5e1; border-radius: 9px; font: inherit; background: #fff; }
input[type="checkbox"] { width: auto; }
.checkbox-row label { display: flex; gap: 10px; align-items: flex-start; font-weight: 500; }
button, .button { display: inline-block; border: 0; border-radius: 9px; padding: 12px 20px; color: #fff; background: linear-gradient(135deg, var(--blue), var(--cyan)); font: inherit; font-weight: 800; cursor: pointer; text-decoration: none; }
.button-secondary { background: #e2e8f0; color: var(--navy); }
.button-danger { background: #b91c1c; color: #fff; }
.button-small { padding: 8px 12px; font-size: .88rem; }
.autocomplete-results {
    position: absolute;
    z-index: 30;
    overflow-y: auto;
    width: min(100%, 680px);
    max-height: 290px;
    margin-top: 5px;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 16px 35px rgba(15, 23, 42, .16);
}
.autocomplete-option {
    display: block;
    width: 100%;
    border-radius: 0;
    padding: 11px 14px;
    color: var(--navy);
    background: #fff;
    text-align: left;
}
.autocomplete-option + .autocomplete-option { border-top: 1px solid #e2e8f0; }
.autocomplete-option:hover, .autocomplete-option:focus { color: #075985; background: #e0f2fe; }
.actions { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-top: 22px; }
.alert { margin-bottom: 20px; padding: 14px 16px; border-radius: 9px; background: #e0f2fe; border: 1px solid #7dd3fc; }
.alert-error, .alert-danger { background: #fee2e2; border-color: #fca5a5; }
.alert-success { background: #dcfce7; border-color: #86efac; }
.alert-warning { background: #fff7ed; border-color: #fb923c; color: #7c2d12; }
.flash-stack {
    position: fixed;
    z-index: 100;
    top: 88px;
    right: max(24px, 4vw);
    width: min(440px, calc(100vw - 32px));
    pointer-events: none;
}
.flash-stack .alert {
    margin-bottom: 10px;
    box-shadow: 0 18px 45px rgba(15, 23, 42, .18);
    pointer-events: auto;
}
section[id], article[id] { scroll-margin-top: 24px; }
.quote-validity-warning { margin-top: 24px; font-size: 1.02rem; line-height: 1.55; }
.dashboard-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; margin-top: 28px; }
.dashboard-grid .card { padding: 26px; }
.status { display: inline-flex; padding: 6px 10px; border-radius: 999px; font-weight: 700; background: #fef3c7; color: #92400e; transition: background-color .2s ease, color .2s ease; }
.status-ok { background: #dcfce7; color: #166534; }
.form-errors, .form-error-message { color: #b91c1c; margin: 6px 0; }
.form-error-summary { margin: 10px 0 0; padding-left: 22px; }
.form-error-summary a { color: #991b1b; }
.field-errors ul { margin: 7px 0 0; padding: 0; list-style: none; }
.field-errors li { color: #b91c1c; font-size: .9rem; }
.direct-file-input {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
}
.direct-file-input:focus + .alert + .actions label.button,
.direct-file-input:focus + .actions label.button,
.direct-file-input:focus + label.button { outline: 3px solid rgba(37, 99, 235, .3); outline-offset: 2px; }
.file-upload-status { font-size: .85rem; }
.supporting-review-feedback { width: min(360px, 100%); margin: 0; }
.button.is-disabled { opacity: .55; pointer-events: none; }
.form-row-select select[aria-invalid="true"] { border-color: #dc2626; }
.password-requirements {
    margin-top: 10px;
    padding: 14px 16px;
    border: 1px solid #fecaca;
    border-radius: 10px;
    background: #fef2f2;
}
.password-requirements p { margin: 0 0 8px; font-size: .9rem; font-weight: 800; }
.password-requirements ul { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.password-requirements li { color: #b91c1c; font-size: .86rem; transition: color .15s ease; }
.password-requirements li span { display: inline-block; width: 18px; font-weight: 900; }
.password-requirements li.is-satisfied { color: #15803d; }
.password-requirements.is-complete { border-color: #86efac; background: #f0fdf4; }
@media (max-width: 680px) {
    .site-header { align-items: flex-start; padding-block: 20px; flex-direction: column; }
    .page-shell { margin-top: 26px; }
}

.page-shell { width: min(1180px, 92vw); min-height: calc(100vh - 210px); }
.site-footer { width: min(1180px, 92vw); margin: 30px auto; padding-top: 20px; border-top: 1px solid var(--border); display: flex; justify-content: space-between; gap: 20px; color: var(--muted); font-size: .88rem; }
.form-shell { width: min(900px, 100%); margin: 0 auto; }
.narrow-shell { width: min(680px, 100%); }
.eyebrow { margin: 0 0 8px; color: var(--blue); font-size: .78rem; font-weight: 900; letter-spacing: .12em; text-transform: uppercase; }
.page-heading, .section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; margin-bottom: 28px; }
.page-heading h1, .section-heading h2 { margin: 0 0 8px; }
.page-heading .muted, .section-heading .muted { margin: 0; }
.section-block { margin-top: 38px; }
.button-small { padding: 8px 12px; font-size: .88rem; }
.status-muted { background: #e2e8f0; color: #475569; }
.status-info { background: #dbeafe; color: #1d4ed8; }
.status-warning { background: #fef3c7; color: #92400e; }
.status-danger { background: #fee2e2; color: #b91c1c; }
.metric { margin: 12px 0 0; font-size: 2.3rem; font-weight: 900; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 22px; }
.checkbox-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin: 10px 0 20px; }
.checkbox-grid > div, .choice-panel { padding: 14px; border: 1px solid var(--border); border-radius: 12px; background: #f8fafc; }
.choice-panel > div > div { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 18px; }
.choice-panel label { display: inline; font-weight: 500; }
.policy-selection { display: grid; gap: 14px; margin-bottom: 24px; }
.policy-selection-row {
    display: grid;
    grid-template-columns: minmax(0, 1.7fr) minmax(220px, .8fr);
    gap: 22px;
    align-items: start;
    padding: 18px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #f8fafc;
}
.policy-choice label { display: flex; gap: 10px; align-items: flex-start; }
.policy-choice input { margin-top: 4px; }
.policy-amount > div, .pricing-row > div { margin-bottom: 0; }
.pricing-row { display: grid; gap: 5px; margin-bottom: 18px; padding-bottom: 18px; border-bottom: 1px solid var(--border); }
.pricing-row small { color: var(--muted); }
.table-wrap tfoot th { background: #eff6ff; color: var(--navy); font-size: .9rem; text-transform: none; letter-spacing: 0; }
.list-card, .table-wrap { overflow: hidden; background: #fff; border: 1px solid var(--border); border-radius: 16px; box-shadow: 0 12px 35px rgba(15, 23, 42, .06); }
.quote-row, .notification-row, .document-row { display: flex; align-items: center; justify-content: space-between; gap: 22px; padding: 20px 22px; border-bottom: 1px solid var(--border); text-decoration: none; color: inherit; }
.quote-row:last-child, .notification-row:last-child, .document-row:last-child { border-bottom: 0; }
.quote-row:hover { background: #f8fafc; }
.quote-row strong, .quote-row span { display: block; }
.quote-row-meta, .document-actions { display: flex; align-items: center; justify-content: flex-end; gap: 12px; flex-wrap: wrap; }
.quote-row time, .notification-row time { color: var(--muted); font-size: .86rem; }
.notification-row.is-unread { border-left: 4px solid var(--blue); background: #f8fbff; }
.notification-row p { margin: 6px 0; }
.empty-state, .empty-inline { text-align: center; }
.empty-inline { padding: 28px; border: 1px dashed #cbd5e1; border-radius: 14px; color: var(--muted); }
.detail-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); gap: 22px; align-items: start; }
.compact-card { padding: 26px; }
.detail-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.detail-list div { padding-bottom: 12px; border-bottom: 1px solid var(--border); }
.detail-list dt { color: var(--muted); font-size: .84rem; }
.detail-list dd { margin: 5px 0 0; font-weight: 800; }
.tag-list { display: flex; gap: 8px; flex-wrap: wrap; padding: 0; list-style: none; }
.tag-list li { padding: 7px 10px; background: #e0f2fe; color: #075985; border-radius: 999px; font-size: .88rem; font-weight: 700; }
.callout { margin-top: 24px; padding: 24px; display: flex; align-items: center; justify-content: space-between; gap: 20px; border: 1px solid #93c5fd; border-radius: 16px; background: #eff6ff; }
.callout h2, .callout p { margin: 0 0 5px; }
.document-icon { flex: 0 0 48px; height: 56px; display: grid; place-items: center; border-radius: 8px; background: #fee2e2; color: #991b1b; font-size: .78rem; font-weight: 900; }
.document-main { flex: 1; min-width: 180px; }
.document-main p { margin: 5px 0; color: var(--muted); }
.document-main small { color: var(--muted); }
.security-note { margin: 20px 0; padding: 14px; background: #ecfeff; border: 1px solid #a5f3fc; border-radius: 10px; color: #155e75; }
.steps { padding-left: 22px; line-height: 1.7; }
.stack { display: grid; gap: 20px; }
.form-card { margin-top: 22px; padding: 26px; }
.file-proof { overflow-wrap: anywhere; font-size: .78rem; }
.timeline { border-left: 2px solid var(--border); margin-left: 9px; padding-left: 25px; }
.timeline-item { position: relative; display: grid; grid-template-columns: 130px minmax(160px, 1fr) minmax(160px, 1fr); gap: 14px; padding: 0 0 22px; }
.timeline-item::before { content: ""; position: absolute; left: -32px; top: 4px; width: 12px; height: 12px; border-radius: 50%; background: var(--blue); border: 3px solid #fff; box-shadow: 0 0 0 1px var(--blue); }
.timeline-item time, .timeline-item span { color: var(--muted); font-size: .86rem; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 16px 18px; text-align: left; border-bottom: 1px solid var(--border); }
th { background: #f8fafc; color: var(--muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; }
tbody tr:last-child td { border-bottom: 0; }
.staff-dashboard-tools {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(420px, 1fr);
    gap: 24px;
    margin-bottom: 22px;
    padding: 22px;
}
.staff-search-form { display: flex; align-items: flex-end; gap: 10px; }
.staff-sort-form { display: grid; grid-template-columns: minmax(210px, 1fr) auto; align-items: end; gap: 10px; }
.staff-search-form > div, .staff-sort-form > div { flex: 1; }
.staff-search-form label, .staff-sort-form label { font-size: .86rem; }
.staff-completed-filter {
    display: flex;
    align-items: center;
    align-self: center;
    grid-column: 1 / -1;
    gap: 8px;
    min-width: 175px;
    margin: 0;
    font-weight: 600;
}
.staff-completed-filter input { flex: 0 0 auto; }
.staff-results-summary { margin: 0 0 10px; color: var(--muted); font-size: .9rem; }

@media (max-width: 680px) {
    .site-footer, .page-heading, .section-heading, .callout, .document-row { align-items: stretch; flex-direction: column; }
    .form-grid, .detail-grid, .detail-list, .checkbox-grid, .choice-panel > div > div, .policy-selection-row { grid-template-columns: 1fr; }
    .quote-row { align-items: flex-start; flex-direction: column; }
    .quote-row-meta, .document-actions { justify-content: flex-start; }
    .table-wrap { overflow-x: auto; }
    .timeline-item { grid-template-columns: 1fr; gap: 3px; }
    .staff-dashboard-tools { grid-template-columns: 1fr; }
    .staff-search-form { align-items: stretch; flex-direction: column; }
    .staff-sort-form { grid-template-columns: 1fr; }
    .staff-completed-filter { grid-column: 1; }
}
