:root {
  --ink: #1c2832;
  --nav: #182936;
  --nav-muted: #afc1cc;
  --page: #f5f6f5;
  --surface: #fff;
  --muted: #556672;
  --line: #dce3e6;
  --blue: #205e75;
  --blue-deep: #173f55;
  --blue-ink: #16485e;
  --blue-tint: #e8f2f7;
  --brass: #887246;
  --warm: #f8f4eb;
  --amber: #745118;
  --amber-tint: #f8edda;
  --red: #903e35;
  --red-tint: #fbeeea;
  --radius: 12px;
  --shadow: 0 12px 36px #1d3b4a0a;
  color-scheme: light;
  font: 15px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--page); }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .5; }
a { color: var(--blue); text-underline-offset: 3px; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible, [tabindex="-1"]:focus-visible { outline: 3px solid #2a81a4; outline-offset: 3px; }
button, a { -webkit-tap-highlight-color: transparent; }
img { max-width: 100%; }
h1, h2, h3, p { margin-top: 0; }
h1 { font: 400 clamp(2.05rem, 4vw, 3.25rem)/1.07 Georgia, serif; letter-spacing: -.035em; margin-bottom: 13px; }
h2 { font: 400 1.6rem/1.18 Georgia, serif; letter-spacing: -.017em; margin-bottom: 10px; }
h3 { font-size: 1rem; line-height: 1.3; margin-bottom: 6px; }
p { margin-bottom: 14px; overflow-wrap: anywhere; }
[hidden] { display: none !important; }

.skip-link { position: fixed; z-index: 10; top: -100px; left: 15px; padding: 10px 16px; background: #fff; }
.skip-link:focus { top: 14px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; clip-path: inset(50%); overflow: hidden; white-space: nowrap; }
.initial-load { min-height: 65vh; display: grid; justify-items: center; align-content: center; gap: 12px; }
.initial-load p { color: var(--muted); margin: 0; }

.brand { display: inline-flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; }
.brand img { width: 43px; height: 43px; flex: none; }
.brand-word { display: block; font: 400 2rem/.98 Georgia, serif; letter-spacing: .025em; }
.brand-endorsement { display: block; font-size: .68rem; line-height: 1.3; margin-top: 5px; color: var(--muted); }
.eyebrow { font-size: .72rem; font-weight: 720; letter-spacing: .12em; text-transform: uppercase; color: var(--blue); margin-bottom: 12px; }
.muted { color: var(--muted); }
.compact { font-size: .86rem; }
.numbers { font-variant-numeric: tabular-nums; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.spacer-top { margin-top: 20px; }
.button { border: 1px solid #cdd9e0; border-radius: 7px; padding: 10px 15px; background: #fff; color: var(--blue-ink); min-height: 43px; line-height: 1.3; display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; font-weight: 650; }
.button:hover { background: #f1f7fa; border-color: #8cb0c0; }
.button-primary { color: #fff; background: var(--blue); border-color: var(--blue); }
.button-primary:hover { background: var(--blue-deep); border-color: var(--blue-deep); }
.button-small { min-height: 36px; font-size: .84rem; padding: 7px 11px; }
.text-button { background: transparent; border: 0; padding: 3px 0; color: var(--blue-ink); text-decoration: underline; text-underline-offset: 3px; text-align: left; font-weight: 650; }
.icon-button { padding: 0; background: #fff; border: 1px solid var(--line); border-radius: 7px; min-width: 36px; min-height: 36px; line-height: 1; color: var(--ink); font-size: 1.5rem; }
.icon-button:hover { background: #f1f7fa; }
.badge { display: inline-flex; align-items: center; border-radius: 5px; padding: 4px 8px; font-size: .75rem; font-weight: 670; line-height: 1.35; background: #edf0f2; color: #485a66; white-space: nowrap; }
.badge.blue { color: var(--blue-ink); background: var(--blue-tint); }
.badge.amber { color: var(--amber); background: var(--amber-tint); }
.badge.red { color: var(--red); background: var(--red-tint); }

.login-header { max-width: 1310px; margin: auto; padding: 24px 34px; border-bottom: 1px solid var(--line); }
.login-layout { max-width: 1310px; margin: auto; padding: clamp(40px, 8vw, 103px) 34px; display: grid; grid-template-columns: 1.28fr minmax(320px, .82fr); align-items: start; gap: clamp(35px, 8vw, 100px); }
.login-intro h1 { font-size: clamp(3rem, 6vw, 5.45rem); max-width: 690px; margin: 20px 0 24px; }
.login-intro h1 span { color: var(--blue); }
.login-intro > .lead { max-width: 535px; color: var(--muted); font-size: 1.12rem; line-height: 1.8; margin-bottom: 34px; }
.login-services { max-width: 535px; border-top: 1px solid var(--line); padding-top: 24px; display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.login-services p { margin: 0; font-size: .88rem; color: var(--muted); }
.login-card { border: 1px solid var(--line); border-top: 3px solid var(--blue); border-radius: var(--radius); box-shadow: var(--shadow); padding: clamp(22px, 4vw, 38px); background: #fff; }
.login-card h2 { font-size: 2.04rem; margin-bottom: 11px; }
.login-card .button { width: 100%; }
.mfa-qr { display: block; margin: 0 auto 17px; object-fit: contain; }
.mfa-key { overflow-wrap: anywhere; letter-spacing: .055em; font-family: ui-monospace, monospace; }
.login-footer { max-width: 1310px; margin: auto; padding: 22px 34px; color: var(--muted); font-size: .82rem; border-top: 1px solid var(--line); }

.shell { min-height: 100vh; display: grid; grid-template-columns: 244px minmax(0, 1fr); }
.sidebar { padding: 28px 18px 20px; background: var(--nav); color: #fff; height: 100vh; position: sticky; top: 0; display: flex; flex-direction: column; }
.sidebar .brand { margin: 0 9px 30px; }
.sidebar .brand-endorsement { color: #c3d3dc; }
.practice { padding: 13px 12px; border: 1px solid #b4d4e32e; background: #edf8ff07; border-radius: 8px; margin: 0 4px 19px; }
.practice strong { display: block; font-size: .87rem; font-weight: 640; overflow-wrap: anywhere; }
.practice small { display: block; color: var(--nav-muted); font-size: .75rem; margin-top: 2px; }
.sidebar nav { display: grid; gap: 4px; }
.nav-button { background: transparent; border: 0; color: #c9dae4; width: 100%; text-align: left; display: flex; align-items: center; gap: 11px; padding: 12px; border-radius: 6px; font-size: .93rem; min-height: 43px; }
.nav-button:hover { background: #5fa0bf21; }
.nav-button[aria-current="page"] { color: #fff; background: #35657d75; box-shadow: inset 3px 0 #93c8e0; }
.nav-glyph { display: inline-grid; width: 19px; place-items: center; color: #a9d0e1; font-size: 1rem; }
.sidebar-foot { margin-top: auto; border-top: 1px solid #afcbd72b; padding: 15px 7px 0; }
.sidebar-foot p { font-size: .76rem; color: #bfd0db; margin-bottom: 9px; }
.sidebar-foot .text-button { color: #e3f0f7; font-size: .83rem; }
.workspace-shell { min-width: 0; }
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 14px; min-height: 74px; border-bottom: 1px solid var(--line); background: #fbfcfb; padding: 16px clamp(20px, 4vw, 44px); }
.breadcrumb { color: var(--muted); font-size: .87rem; }
.breadcrumb strong { color: var(--ink); }
.topbar .badge { border: 1px solid #c9dde7; }
.workspace { max-width: 1520px; margin: auto; padding: 30px clamp(20px, 4vw, 44px) 52px; min-width: 0; }
.page-heading { display: flex; justify-content: space-between; align-items: center; gap: 22px; margin-bottom: 27px; }
.page-heading h1 { margin-bottom: 9px; }
.page-heading p:last-child { margin-bottom: 0; }
.focus-panel { background: var(--blue-deep); color: #f8fbfc; padding: 27px 29px; display: flex; align-items: center; justify-content: space-between; gap: 28px; border-radius: 12px; margin-bottom: 20px; }
.focus-panel .eyebrow, .focus-panel p { color: #cfe7f2; }
.focus-panel p:last-child { margin-bottom: 0; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); min-width: 0; }
.panel-head { padding: 22px 25px 16px; display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; }
.panel-head h2 { margin-bottom: 5px; }
.panel-head p { font-size: .88rem; color: var(--muted); margin: 0; }
.panel-body { padding: 0 25px 24px; }
.panel-standalone { padding: 23px 25px; }
.two-column { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(260px, 1fr); gap: 18px; align-items: start; }
.metric-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 13px; margin-bottom: 20px; }
.metric { border: 1px solid var(--line); background: #fff; border-radius: 10px; padding: 16px 20px; min-width: 0; }
.metric:first-child { border-top: 3px solid var(--blue); padding-top: 14px; }
.metric strong { display: block; font-size: 1.65rem; font-weight: 630; line-height: 1.24; margin: 7px 0 5px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.metric span, .metric small { color: var(--muted); display: block; font-size: .83rem; }
.context-strip { border: 1px solid #cfdfe6; border-radius: 8px; background: #edf5f9; color: var(--blue-ink); margin: 0 0 19px; padding: 12px 15px; display: flex; flex-wrap: wrap; gap: 9px 19px; align-items: center; font-size: .88rem; }
.context-strip button { color: var(--blue-ink); }
.note { border: 1px solid #ccdee7; border-radius: 8px; background: #edf5f9; color: #294a5a; padding: 12px 14px; font-size: .89rem; line-height: 1.6; overflow-wrap: anywhere; }
.note.warn { border-color: #eadbbd; background: var(--warm); color: #694a20; }
.note.error { border-color: #f0d0c8; background: var(--red-tint); color: var(--red); }
.note p:last-child { margin-bottom: 0; }
.inline-message { margin: 0 0 16px; }
.empty { text-align: center; padding: 32px 25px; color: var(--muted); }
.empty h2, .empty h3 { color: var(--ink); }
.empty p:last-child { margin-bottom: 0; }
.record-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; border-bottom: 1px solid #e6ecef; padding: 13px 0; }
.record-row:last-child { border-bottom: 0; }
.record-row strong { display: block; overflow-wrap: anywhere; }
.record-row small { color: var(--muted); display: block; margin-top: 2px; font-size: .79rem; }
.record-row .amount { white-space: nowrap; }
.panel + .panel, .two-column + .panel { margin-top: 19px; }
.two-column > .panel { margin-top: 0; }

.field { display: grid; gap: 6px; margin-bottom: 15px; }
.field label, .label { font-weight: 630; font-size: .89rem; }
.field small { font-size: .8rem; color: var(--muted); }
input:not([type="checkbox"]), select, textarea { border: 1px solid #bfcdd4; background: #fff; border-radius: 7px; color: var(--ink); padding: 10px 11px; width: 100%; min-height: 43px; }
input[type="file"] { font-size: .86rem; }
input[type="checkbox"] { width: 17px; height: 17px; accent-color: var(--blue); margin: 2px 0 0; flex: none; }
textarea { min-height: 90px; resize: vertical; }
.field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.check-row { display: flex; align-items: flex-start; gap: 10px; font-size: .89rem; margin: 12px 0; }
.table-wrap { overflow: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; }
th, td { padding: 12px 16px; vertical-align: top; overflow-wrap: anywhere; }
th { white-space: nowrap; color: #4f6572; background: #f2f7fa; font-size: .75rem; font-weight: 680; border-bottom: 1px solid var(--line); }
td { border-bottom: 1px solid #e6ecef; font-size: .88rem; }
tbody tr:last-child td { border-bottom: 0; }
td small { display: block; color: var(--muted); font-size: .77rem; margin-top: 3px; }
td.amount { white-space: nowrap; }
.filter-row { display: flex; align-items: flex-end; gap: 12px; margin-bottom: 13px; }
.filter-row .field { margin-bottom: 0; min-width: 165px; }
.file-card { border: 1px solid var(--line); border-radius: 9px; padding: 15px; margin-bottom: 11px; }
.file-card:last-child { margin-bottom: 0; }
.file-title { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; margin-bottom: 8px; }
.file-title h3 { margin: 0; }
.evidence-list { margin: 0; padding-left: 19px; font-size: .88rem; color: var(--muted); }
.evidence-list li { margin-bottom: 6px; }
.progress { width: 100%; height: 8px; accent-color: var(--blue); margin: 6px 0; }
pre { max-height: 240px; overflow: auto; background: #f0f5f8; border: 1px solid var(--line); padding: 12px; border-radius: 7px; font: .78rem/1.55 ui-monospace, monospace; white-space: pre-wrap; overflow-wrap: anywhere; }
.report-cover { padding: 25px 28px; background: var(--nav); color: #fff; border-radius: 9px; margin-bottom: 20px; }
.report-cover p { color: #d0e5ef; margin-bottom: 0; }
.report-cover h2 { font-size: 2rem; }
.workspace-footer { border-top: 1px solid var(--line); margin-top: 28px; padding-top: 15px; color: var(--muted); font-size: .77rem; }

@media print {
  .workspace:has(.printable-report) > :not(.printable-report),
  .shell:has(.printable-report) .sidebar,
  .shell:has(.printable-report) .topbar { display: none; }
  .shell:has(.printable-report) { display: block; }
  .workspace:has(.printable-report), .printable-report { padding: 0; border: 0; box-shadow: none; }
  .printable-report .report-cover { background: #fff; color: var(--ink); padding: 0 0 17px; border-bottom: 1px solid var(--line); }
  .printable-report .report-cover p { color: var(--muted); }
  .printable-report tr { break-inside: avoid; }
}

dialog { border: 0; border-radius: 14px; color: var(--ink); width: min(660px, calc(100vw - 30px)); max-height: calc(100dvh - 30px); padding: 0; box-shadow: 0 22px 80px #12263445; }
dialog::backdrop { background: #152d3b83; }
.modal-head { display: flex; justify-content: space-between; align-items: center; gap: 18px; padding: 20px 23px 15px; border-bottom: 1px solid var(--line); }
.modal-head h2 { margin: 0; }
.modal-body { padding: 21px 23px 25px; }
.modal-body .inline-message:empty { display: none; }

@media (max-width: 1020px) {
  .sidebar { padding: 22px 13px; }
  .shell { grid-template-columns: 200px minmax(0, 1fr); }
  .two-column { grid-template-columns: 1fr; }
  .page-heading { align-items: flex-start; }
}

@media (max-width: 730px) {
  .login-header { padding: 20px; }
  .login-layout { padding: 33px 20px 46px; grid-template-columns: 1fr; gap: 26px; }
  .login-intro h1 { margin: 10px 0 16px; }
  .login-intro > .lead { font-size: 1rem; margin-bottom: 20px; }
  .login-services { display: none; }
  .login-footer { padding: 18px 20px; }
  .shell { display: block; }
  .sidebar { height: auto; position: static; padding: 17px 14px 11px; }
  .sidebar .brand { margin: 0 6px 13px; }
  .sidebar .brand img { width: 36px; height: 36px; }
  .sidebar .brand-word { font-size: 1.73rem; }
  .practice, .sidebar-foot { display: none; }
  .sidebar nav { display: flex; overflow-x: auto; gap: 5px; padding: 2px 3px; }
  .nav-button { white-space: nowrap; width: auto; padding: 9px 11px; font-size: .84rem; }
  .nav-glyph { display: none; }
  .topbar { padding: 11px 17px; min-height: 58px; }
  .workspace { padding: 22px 16px 35px; }
  .page-heading, .focus-panel { display: block; }
  .page-heading .actions, .focus-panel .actions { margin-top: 15px; }
  .focus-panel { padding: 19px; }
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
  .metric { padding: 14px; }
  .metric strong { font-size: 1.32rem; }
  .panel-head { padding: 17px 16px 15px; }
  .panel-body { padding: 0 16px 17px; }
  .panel-standalone { padding: 16px; }
  .filter-row { flex-wrap: wrap; }
  .field-grid { grid-template-columns: 1fr; gap: 0; }
  input:not([type="checkbox"]), select, textarea { font-size: 16px; }
  th, td { padding: 11px 12px; }
}

@media (prefers-reduced-motion: no-preference) {
  button, a { transition: background-color .12s ease, border-color .12s ease; }
}
