@font-face {
    font-family: "Instrument Sans";
    src: url("/brand/instrument-sans.woff2") format("woff2");
    font-weight: 400 700;
    font-display: swap;
}
@font-face {
    font-family: "Instrument Serif";
    src: url("/brand/instrument-serif.woff2") format("woff2");
    font-weight: 400;
    font-display: swap;
}

:root {
    color-scheme: light;
    --navy: #12273c;
    --navy-deep: #0c2034;
    --navy-soft: #22394f;
    --gold: #d8b76d;
    --gold-dark: #73561d;
    --canvas: #f6f4ef;
    --surface: #fff;
    --ink: #172b40;
    --muted: #546374;
    --line: #e4e3df;
    --sidebar-width: 238px;
    --radius: 12px;
    --sans: "Instrument Sans", "Segoe UI", sans-serif;
    --serif: "Instrument Serif", Georgia, serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-padding-top: 18px; }
body { margin: 0; background: var(--canvas); color: var(--ink); font: 15px/1.5 var(--sans); }
a { color: inherit; text-decoration: none; }
a, button, summary { -webkit-tap-highlight-color: transparent; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible {
    outline: 3px solid #a97520;
    outline-offset: 3px;
}
button, input, select, textarea { font: inherit; }
button, summary { cursor: pointer; }
button:disabled { cursor: not-allowed; }
h1, h2, h3, p { margin: 0; }
h1 { font: 400 clamp(2.6rem, 4.5vw, 4rem)/1.02 var(--serif); letter-spacing: -.015em; overflow-wrap: anywhere; }
h2 { font-size: 1.12rem; line-height: 1.3; font-weight: 700; }
h3 { font-size: 1rem; line-height: 1.35; }
.icon { width: 19px; height: 19px; flex: 0 0 19px; vertical-align: middle; }
.muted { color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip-link { position: absolute; top: 6px; left: 10px; padding: 10px 16px; transform: translateY(-200%); z-index: 5; background: var(--surface); border-radius: 6px; }
.skip-link:focus { transform: translateY(0); }

.sidebar {
    display: flex;
    flex-direction: column;
    position: fixed;
    inset: 0 auto 0 0;
    width: var(--sidebar-width);
    z-index: 3;
    overflow-y: auto;
    scrollbar-color: #486073 var(--navy);
    background: var(--navy);
    color: #c6d1dc;
    padding: 25px 17px 15px;
}
.brand-link { display: block; padding: 0 4px; margin-bottom: 27px; }
.brand-image { display: block; aspect-ratio: 4.05; background: white; border-radius: 7px; overflow: hidden; }
.brand-image img { display: block; width: 100%; height: auto; transform: translateY(-24.9%); }
.sidebar-label { margin: 0 10px 9px; font-size: .68rem; font-weight: 700; letter-spacing: .13em; text-transform: uppercase; color: #a9bdcf; }
.nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    min-height: 44px;
    padding: 9px 10px;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: inherit;
    text-align: left;
    font-size: .9rem;
}
.nav-link:hover, .sub-link:hover { background: var(--navy-soft); color: white; }
.nav-link.current, .sub-link.current { background: var(--navy-soft); color: #f1cf83; }
.nav-link.current::after { content: ""; width: 6px; height: 6px; margin-left: auto; border-radius: 50%; background: var(--gold); }
.nav-group > summary { list-style: none; }
.nav-group > summary::-webkit-details-marker { display: none; }
.nav-group[open] > summary { color: white; }
.nav-chevron { margin-left: auto; font-size: 1.15rem; transition: transform .15s ease; }
.nav-group[open] .nav-chevron { transform: rotate(90deg); }
.sub-link { display: block; margin: 1px 0 1px 23px; padding: 7px 9px; border-radius: 6px; font-size: .83rem; }
.sidebar-footer { margin-top: auto; padding-top: 26px; }
.workspace-note { display: flex; gap: 11px; margin: 0 3px 11px; padding: 11px; border: 1px solid #30485f; border-radius: 8px; font-size: .81rem; }
.workspace-note .icon { color: #e6c37b; margin-top: 3px; }
.workspace-note strong, .workspace-note span { display: block; }
.workspace-note span { margin-top: 3px; color: #a9bdcf; font-size: .75rem; }
.sign-out { font-size: .82rem; }
.shell { margin-left: var(--sidebar-width); }
.topbar {
    min-height: 72px;
    padding: 13px clamp(20px, 3vw, 42px);
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.breadcrumbs, .staff-identity { display: flex; gap: 12px; align-items: center; }
.breadcrumbs { color: var(--muted); font-size: .84rem; }
.breadcrumbs a { color: var(--ink); font-weight: 600; }
.staff-identity { font-size: .85rem; }
.staff-identity strong, .staff-identity small { display: block; overflow-wrap: anywhere; }
.staff-identity small { color: var(--muted); font-size: .72rem; }
.avatar { display: grid; place-items: center; flex: 0 0 36px; width: 36px; height: 36px; background: #efe5ce; border-radius: 50%; color: var(--gold-dark); font-size: .78rem; font-weight: 700; }
.nav-toggle { display: none; place-items: center; background: transparent; color: var(--ink); border: 1px solid var(--line); border-radius: 7px; width: 40px; height: 40px; }
.content { max-width: 1510px; margin: 0 auto; padding: 31px clamp(20px, 3vw, 42px) 48px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 15px; margin-bottom: 23px; }
.page-head p { margin-top: 9px; color: var(--muted); }
.detail-head .pill { margin-top: 10px; }
.back-link { display: inline-flex; gap: 8px; margin-bottom: 12px; color: var(--muted); font-size: .9rem; font-weight: 600; }
.back-link:hover, .subtle-link:hover { text-decoration: underline; }

.overview-top { display: grid; grid-template-columns: minmax(0, 1.62fr) minmax(0, 1fr); gap: 20px; }
.panel { border: 1px solid var(--line); background: var(--surface); border-radius: var(--radius); }
.hero {
    isolation: isolate;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    padding: clamp(23px, 4vw, 43px);
    border-radius: var(--radius);
    min-height: 265px;
    background: var(--navy);
    color: white;
}
.hero::before {
    content: "";
    position: absolute;
    z-index: -1;
    right: -80px;
    top: -95px;
    width: 400px;
    aspect-ratio: 1;
    border: 1px solid #45617842;
    border-radius: 50%;
    box-shadow: 0 0 0 21px #45617814, 0 0 0 49px #4561780e, 0 0 0 75px #45617808;
}
.hero-label { color: #e1c17c; font-size: .72rem; letter-spacing: .13em; text-transform: uppercase; font-weight: 700; }
.hero h2 { font: 400 clamp(2.7rem, 4.6vw, 4.25rem)/.99 var(--serif); max-width: 540px; margin-top: 8px; }
.hero p:not(.hero-label) { margin-top: 14px; max-width: 420px; color: #c5d2df; }
.hero .button { margin-top: 20px; }
.queue, .activity, .record-panel, .edit-panel { padding: 20px 23px; min-width: 0; }
.panel-heading { display: flex; justify-content: space-between; gap: 12px; align-items: center; margin-bottom: 12px; }
.queue-row { display: grid; grid-template-columns: 10px 1fr auto 12px; gap: 9px; min-height: 34px; align-items: center; font-size: .87rem; }
.queue-row + .queue-row { border-top: 1px solid #f0efec; }
.queue-row:hover { color: var(--gold-dark); }
.queue-dot, .activity-dot { width: 8px; height: 8px; background: #c9d1d8; border-radius: 50%; }
.queue-dot.has-items { background: #b18837; }
.row-arrow { color: var(--muted); font-size: 1.05rem; }
.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; margin: 19px 0; }
.metric { padding: 15px 17px 16px; }
.metric:hover { border-color: #b79755; }
.metric > div { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; color: var(--muted); font-size: .82rem; }
.metric .icon { color: #728597; }
.metric > strong { display: block; font-size: 2rem; line-height: 1.2; margin: 9px 0 3px; font-weight: 600; }
.metric > small { color: var(--muted); }
.activity { margin-top: 18px; }
.activity-row { display: grid; grid-template-columns: 10px 1fr auto; gap: 11px; align-items: center; padding: 11px 0; border-top: 1px solid #f0efec; font-size: .87rem; }
.activity-row small, td small { display: block; margin-top: 3px; color: var(--muted); }
.activity-row time { color: var(--muted); font-size: .82rem; }

.button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 8px 15px; border: 1px solid transparent; border-radius: 7px; font-size: .87rem; line-height: 1.3; font-weight: 700; white-space: nowrap; }
.button .icon { width: 16px; height: 16px; flex-basis: 16px; }
.button-gold { background: var(--gold); color: #1c2330; border-color: #cbaa63; }
.button-gold:hover { background: #e6ca88; }
.button-outline { background: var(--surface); color: var(--ink); border-color: #cdd4da; }
.button-outline:hover { background: #f6f7f8; }
.subtle-link { color: #3b5267; font-weight: 600; font-size: .86rem; }
.pill { display: inline-flex; align-items: center; width: fit-content; padding: 3px 9px; border-radius: 999px; background: #f1f2f3; color: #4a5967; font-size: .76rem; font-weight: 650; white-space: nowrap; }
.pill-positive { background: #e8f4eb; color: #245a39; }
.pill-negative { background: #fae9e9; color: #8a3030; }
.pill-attention { background: #f8efd9; color: #72521b; }
.pill-neutral { background: #edf0f3; color: #475768; }
.notice { padding: 11px 15px; margin-bottom: 16px; border: 1px solid; border-radius: 8px; }
.notice-success { background: #edf7ee; border-color: #c4dfc9; color: #235439; }
.notice-error, .validation:not(.validation-summary-valid) { background: #fff3f2; border-color: #e7bcbc; color: #832f2f; }
.validation-summary-valid { display: none; }
.validation:not(.validation-summary-valid) { margin: 13px 0; padding: 10px 13px; border: 1px solid #e7bcbc; border-radius: 7px; }
.validation ul { margin: 0; padding-left: 18px; }

.filter-bar, .table-footer { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; padding: 15px 18px; }
.filter-bar input { width: min(100%, 280px); }
.filter-bar select { width: auto; min-width: 145px; }
.table-scroll { position: relative; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; }
th, td { padding: 13px 16px; border-bottom: 1px solid #ecece8; }
th { background: #f7f8f8; color: #4f6171; font-size: .77rem; letter-spacing: .025em; white-space: nowrap; }
td { font-size: .91rem; }
tbody tr:hover { background: #fcfbf8; }
.row-title { font-weight: 650; }
.row-title:hover { text-decoration: underline; }
.date { white-space: nowrap; color: var(--muted); }
.empty { text-align: center; color: var(--muted); padding: 35px 14px; }
.table-footer { justify-content: space-between; color: var(--muted); font-size: .84rem; }
.pager { display: flex; align-items: center; gap: 14px; }
.reason { max-width: 36rem; overflow-wrap: anywhere; white-space: pre-wrap; }

.detail-grid, .profile-grid { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); gap: 18px; }
.stack { display: grid; align-content: start; gap: 18px; min-width: 0; }
.record-panel > h2, .edit-panel > h2 { margin-bottom: 11px; }
.record-fields, .form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin: 13px 0 0; }
.record-fields dt { color: var(--muted); font-size: .81rem; font-weight: 600; }
.record-fields dd { margin: 4px 0 0; overflow-wrap: anywhere; white-space: pre-wrap; }
.field-wide { grid-column: 1 / -1; }
.field { display: grid; gap: 5px; align-content: start; }
label { font-size: .88rem; font-weight: 650; }
.required { color: #8a651e; }
input:not([type=checkbox]):not([type=hidden]), select, textarea { max-width: 100%; min-height: 40px; padding: 8px 10px; border: 1px solid #cbd3da; border-radius: 7px; background: var(--surface); color: var(--ink); }
.field input, .field select, .field textarea { width: 100%; }
textarea { resize: vertical; }
.check-field { display: flex; align-items: center; gap: 8px; min-height: 35px; }
.check-field input { width: 17px; height: 17px; accent-color: var(--navy); }
.field-static { background: #f5f6f7; border-radius: 6px; padding: 8px 10px; overflow-wrap: anywhere; }
.form-actions { display: flex; gap: 8px; margin-top: 18px; }
.decision-form, .upload-form { display: grid; gap: 8px; }
.decision-form .button, .upload-form .button { justify-self: start; }
.upload-form { grid-template-columns: minmax(0, 1fr); margin-top: 13px; }
.upload-form input[type="file"] { min-width: 0; }
.input-hint { font-size: .82rem; }
.attachment { display: flex; gap: 8px; align-items: center; padding: 9px 0; overflow-wrap: anywhere; }
.attachment:hover { text-decoration: underline; }
.attachment small { margin-left: auto; color: var(--muted); flex-shrink: 0; }
.history-item, .message { padding: 10px 0; border-top: 1px solid #ededea; overflow-wrap: anywhere; }
.history-item small, .message time { display: block; color: var(--muted); font-size: .78rem; }
.history-item p, .message p { margin-top: 5px; white-space: pre-wrap; }
.message > div { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.profile-action { display: flex; gap: 15px; align-items: center; flex-wrap: wrap; margin-top: 16px; }
.access-panel { margin: 30px auto; max-width: 660px; }
.access-panel p { margin: 12px 0; }

.login-layout { display: grid; grid-template-columns: 1.05fr 1fr; min-height: 100dvh; }
.login-brand { background: var(--navy); color: white; display: grid; gap: 14px; align-content: center; padding: 8vw; }
.login-brand p { color: #c7d4df; max-width: 380px; }
.login-logo { width: min(290px, 100%); margin-bottom: 12px; }
.login-main { display: grid; align-items: center; justify-items: center; padding: 24px; }
.login-card { max-width: 410px; width: 100%; padding: 26px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.login-card h2 { margin: 7px 0; font: 400 2.55rem/1.05 var(--serif); }
.login-card form { display: grid; gap: 13px; margin-top: 19px; }
.mobile-logo { display: none; }
.profile-page { max-width: 1050px; padding: 24px 22px 42px; margin: 0 auto; }
.profile-brand { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 18px; }
.profile-brand .brand-image { width: min(235px, 65%); }
.profile-hero { min-height: 190px; }
.verification-label { display: inline-flex; align-items: center; gap: 8px; color: #edd49f; margin-bottom: 9px; }
.profile-grid { margin-top: 16px; }
.profile-grid p { margin: 8px 0; }
.profile-grid h3 { margin: 15px 0 5px; }
.qualification-list { list-style: none; padding: 0; margin: 0; }
.qualification-list li { display: flex; align-items: center; gap: 8px; padding: 4px 0; }
.qualification-list .icon { color: #286947; }
.profile-qr { margin-top: 12px; }

@media (max-width: 1100px) {
    :root { --sidebar-width: 214px; }
    .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 870px) {
    .overview-top, .detail-grid { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
    .shell { margin-left: 0; }
    .sidebar { visibility: hidden; top: 61px; transform: translateX(-100%); width: min(270px, 87vw); }
    .nav-open .sidebar { visibility: visible; transform: translateX(0); }
    .nav-toggle { display: grid; }
    .topbar { min-height: 61px; padding: 8px 14px; }
    .content { padding: 19px 13px 28px; }
    .breadcrumbs > span { display: none; }
    .sidebar .brand-link { margin-bottom: 18px; }
    .page-head { align-items: flex-start; flex-direction: column; }
    .page-head h1 { font-size: 2.85rem; }
    .overview-top, .metric-grid { gap: 10px; }
    .queue, .activity, .record-panel, .edit-panel { padding: 14px; }
    .metric { padding: 12px; }
    .table-scroll .row-title { display: block; min-width: 8rem; }
    .profile-grid, .login-layout { grid-template-columns: 1fr; }
    .login-brand { display: none; }
    .mobile-logo { display: block; }
}
@media (max-width: 420px) {
    .record-fields, .form-grid { grid-template-columns: 1fr; }
    .staff-identity .avatar { display: none; }
    .topbar { gap: 8px; }
    .metric .icon { display: none; }
    .activity-row { grid-template-columns: 8px 1fr; }
    .activity-row time { grid-column: 2; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition: none !important; }
}
