:root {
    color-scheme: light;
    --navy: #102541;
    --nav-text: #dbe7f7;
    --blue: #135cc6;
    --blue-dark: #104ca4;
    --ink: #17263b;
    --muted: #52657e;
    --border: #dbe3ed;
    --surface: #fff;
    --background: #f3f6fa;
    --sidebar-width: 248px;
    font-family: "Segoe UI", system-ui, sans-serif;
    font-size: 18px;
    line-height: 1.5;
    color: var(--ink);
    background: var(--background);
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; }
[hidden] { display: none !important; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:focus-visible, a:focus-visible { outline: 3px solid #55a3ff; outline-offset: 3px; }
.skip-link { position: fixed; z-index: 5; top: 8px; left: 8px; transform: translateY(-150%); padding: 10px 15px; background: white; }
.skip-link:focus { transform: translateY(0); }

.sidebar {
    position: fixed;
    z-index: 3;
    inset: 0 auto 0 0;
    width: var(--sidebar-width);
    overflow-y: auto;
    background: var(--navy);
    color: var(--nav-text);
    --icon-background: var(--navy);
}
.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 83px;
    padding: 18px 20px;
    border-bottom: 1px solid #ffffff1c;
    color: white;
    font-size: 15px;
    font-weight: 750;
    line-height: 1.4;
    letter-spacing: .065em;
}
.brand-icon, .document-icon {
    display: grid;
    place-items: center;
    flex: none;
}
.brand-icon { width: 42px; height: 42px; border-radius: 12px; background: #1d4f8d; color: #eff7ff; }
.sidebar nav { display: grid; gap: 7px; padding: 23px 12px; }
.nav-link, .nav-caption {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 48px;
    padding: 11px 12px;
    border-radius: 8px;
    font-size: 17px;
    font-weight: 600;
    line-height: 1.35;
}
.nav-link svg, .nav-caption svg { flex: none; }
.nav-caption { color: #acc1da; }
.nav-child { margin-left: 15px; padding-left: 12px; }
.nav-link:hover { background: #ffffff12; }
.nav-link.is-active { background: #225b9e; color: white; --icon-background: #225b9e; }
.workspace { min-width: 0; margin-left: var(--sidebar-width); }
.topbar {
    min-height: 65px;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px clamp(18px, 3vw, 42px);
    background: var(--surface);
    border-bottom: 1px solid var(--border);
}
.location { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; min-width: 0; font-size: 18px; color: var(--muted); }
.location strong { color: var(--ink); }
.local-status { margin-left: auto; display: flex; align-items: center; gap: 7px; white-space: nowrap; font-size: 15px; color: var(--muted); }
.local-status > span { width: 7px; height: 7px; border-radius: 50%; background: #238064; }
.menu-toggle { display: none; width: 42px; height: 42px; place-items: center; flex: none; border: 1px solid var(--border); border-radius: 8px; background: white; color: var(--ink); }

.main-content { max-width: 1260px; margin-inline: auto; padding: 34px clamp(18px, 3vw, 42px) 48px; }
.page-heading { margin-bottom: 28px; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: 30px; line-height: 1.25; letter-spacing: -.035em; }
.page-heading p { margin-top: 9px; color: var(--muted); font-size: 15px; line-height: 1.55; }
.section-heading { margin: 0 0 14px; font-size: 21px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 13px; box-shadow: 0 2px 5px #112e5010; }
.document-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 330px), 390px)); gap: 18px; }
.document-card { display: flex; flex-direction: column; align-items: flex-start; padding: 24px; border-top: 3px solid var(--blue); }
.document-icon { width: 52px; height: 52px; border-radius: 12px; background: #eaf2ff; color: var(--blue); }
.document-card h3 { font-size: 21px; margin-top: 15px; letter-spacing: -.025em; }
.document-card p { margin: 7px 0 21px; color: var(--muted); font-size: 18px; line-height: 1.55; }
.document-card .button { margin-top: auto; }

.request-form { display: grid; grid-template-columns: minmax(0, 1fr); gap: 17px; }
.form-card { padding: clamp(16px, 2.5vw, 24px); }
.form-card h2, .clear-dialog h2 { font-size: 21px; }
.form-card h2 { margin-bottom: 16px; letter-spacing: -.015em; }
.fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 17px; }
.full-field { grid-column: 1 / -1; }
label { display: grid; min-width: 0; gap: 8px; font-weight: 650; font-size: 16px; line-height: 1.45; color: var(--ink); }
input, textarea, select {
    width: 100%;
    min-width: 0;
    min-height: 50px;
    padding: 11px 13px;
    border: 1px solid #c9d5e4;
    border-radius: 7px;
    background: white;
    color: var(--ink);
    font-size: 17px;
    font-weight: 400;
    line-height: 1.5;
}
input:focus, textarea:focus, select:focus { border-color: var(--blue); outline: 2px solid #135cc62b; }
textarea { display: block; resize: vertical; min-height: 110px; }
.identification-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) auto;
    align-items: end;
    gap: 12px;
}
.identification-row:has(label:nth-child(2):not([hidden])) { grid-template-columns: repeat(2, minmax(0, 1fr)) minmax(0, 1.4fr) auto; }
.identification-row + .identification-row { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); }
.add-button { margin-top: 14px; }
.add-button span { font-size: 20px; line-height: 1; }
.form-actions, .submit-actions, .dialog-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.form-actions { justify-content: space-between; }
.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 48px;
    max-width: 100%;
    padding: 11px 16px;
    border: 1px solid transparent;
    border-radius: 7px;
    font-weight: 650;
    font-size: 17px;
    line-height: 1.4;
}
.button-primary { background: var(--blue); color: white; }
.button-primary:hover { background: var(--blue-dark); }
.button-secondary { background: #fff; border-color: #b8cbe5; color: #134987; }
.button-secondary:hover { background: #edf5ff; }
.button-quiet { background: #fff; border-color: var(--border); color: var(--muted); }
.button-quiet:hover { background: #eaf0f7; color: var(--ink); }
.button-danger { color: #fff; background: #a62631; }
.button-danger:hover { background: #851d26; }
.clear-dialog { width: min(440px, calc(100% - 32px)); padding: 24px; border: 1px solid var(--border); border-radius: 14px; color: var(--ink); }
.clear-dialog::backdrop { background: #0c1d37a3; }
.clear-dialog p { margin: 8px 0 22px; color: var(--muted); font-size: 15px; }
.dialog-actions { justify-content: flex-end; }

.settings-card { max-width: 620px; }
.settings-card dl { margin: 0; }
.settings-card dl div { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 6px 18px; padding: 12px 0; border-top: 1px solid var(--border); }
.settings-card dt { font-weight: 650; }
.settings-card dd { margin: 0; color: var(--muted); }

@media (min-width: 851px) {
    .dashboard-workspace .main-content { margin-inline-start: 0; padding-inline-start: 20px; }
    .dashboard-workspace .topbar { padding-inline-start: 20px; }
}
@media (max-width: 1100px) {
    .identification-row:has(label:nth-child(2):not([hidden])) {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .identification-row .remove-button { justify-self: start; }
}
@media (max-width: 850px) {
    .sidebar { transform: translateX(-100%); visibility: hidden; }
    .sidebar.is-open { transform: none; visibility: visible; }
    .workspace { margin-left: 0; }
    .menu-toggle { display: grid; }
}
@media (max-width: 560px) {
    .main-content { padding-top: 25px; }
    .fields, .identification-row, .identification-row:has(label:nth-child(2):not([hidden])) { grid-template-columns: minmax(0, 1fr); }
    .identification-row .remove-button { justify-self: start; }
    .topbar .location > span, .local-status { display: none; }
}

.request-modes { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 18px; }
.bulk-upload { display: grid; justify-items: start; gap: 12px; }
.bulk-upload h2 { margin-bottom: 0; }
.bulk-upload label { width: 100%; }
.bulk-upload input[type="file"] { max-width: 100%; }
.bulk-table { overflow-x: auto; }
.bulk-table table { width: 100%; border-collapse: collapse; font-size: 15px; }
.bulk-table th, .bulk-table td { padding: 9px 12px; text-align: left; border-bottom: 1px solid var(--border); overflow-wrap: anywhere; }
.bulk-errors { color: #a62631; margin: 0; }
.button:disabled { opacity: .55; cursor: default; }

.login-page { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.login-card { width: min(100%, 480px); border-top: 4px solid var(--blue); padding: clamp(20px, 5vw, 36px); }
.login-card > p, .account-card > p { margin: 10px 0 16px; }
.auth-error { color: #a62631; }
.password-guidance { color: var(--muted); font-size: 15px; }
.account-card { max-width: 630px; }
.sidebar-account { display: grid; gap: 2px; padding: 16px 24px 0; overflow-wrap: anywhere; }
.sidebar-account span { font-size: 15px; color: #acc1da; }
.nav-button { width: 100%; background: transparent; border: 0; color: inherit; text-align: left; }
.account-heading, .account-actions, .account-actions form { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.account-heading { justify-content: space-between; }
.disable-confirm { display: flex; align-items: center; }
.disable-confirm input { width: auto; min-height: auto; }
.audit-pagination { margin-top: 16px; }

.social-entry { min-width: 0; margin: 14px 0; padding: 14px; border: 1px solid var(--border); border-radius: 8px; overflow-wrap: anywhere; }
.social-entry legend { padding-inline: 6px; font-weight: 650; }
.social-spacing, .social-settings-link { margin-top: 14px; }
.social-address { white-space: pre-line; }
.social-requirement { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: center; margin-bottom: 10px; }
.social-requirement label { display: flex; align-items: center; }
.social-requirement input[type="checkbox"] { width: auto; min-height: 0; }
@media (max-width: 650px) {
    .social-requirement { grid-template-columns: auto minmax(0, 1fr); }
    .social-requirement .submit-actions { grid-column: 2; }
}
.history-values dt { font-weight: 650; }
.history-values dd { margin: 0 0 8px; }
.history-value { white-space: pre-wrap; overflow-wrap: anywhere; }
.history-links a, .bulk-table td a { text-decoration: underline; }

.dashboard-workspace .main-content { max-width: none; }
.dashboard-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; }
.dashboard-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 190px), 1fr)); gap: 14px; }
.dashboard-stat { display: grid; grid-template-columns: auto minmax(0, 1fr); align-content: start; align-items: center; gap: 7px 10px; padding: 16px; }
.dashboard-stat:hover { background: #f5f9ff; border-color: #9bbde7; }
.dashboard-stat-icon { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 8px; background: #eaf2ff; color: var(--blue); }
.dashboard-stat-label { font-weight: 650; font-size: 16px; }
.dashboard-stat strong { grid-column: 1 / -1; font-size: 30px; line-height: 1.15; }
.dashboard-stat small { grid-column: 1 / -1; color: var(--muted); font-size: 15px; }
.dashboard-breakdown { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); gap: 20px; }
.dashboard-layout .form-card { min-width: 0; }
.dashboard-bars { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; }
.dashboard-bars a { display: flex; justify-content: space-between; gap: 12px; }
.dashboard-bars a:hover, .dashboard-table a:hover { color: var(--blue); text-decoration: underline; }
.dashboard-bar { height: 8px; margin-top: 5px; border-radius: 8px; overflow: hidden; background: #eaf2ff; }
.dashboard-bar span { display: block; height: 100%; border-radius: inherit; background: var(--blue); }
.dashboard-panel-heading { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; }
.dashboard-panel-heading h2 { margin: 0; }
.dashboard-table thead { background: #f3f6fa; }
.dashboard-table a { color: var(--blue); text-decoration: underline; }
.dashboard-table th, .dashboard-table td { overflow-wrap: anywhere; }
.dashboard-table tbody tr:hover { background: #f5f9ff; }
.dashboard-empty { color: var(--muted); }

.history-checkbox { width: 18px; min-height: 0; height: 18px; margin: 0; vertical-align: middle; }
