:root {
  --graphite: #26292d;
  --burgundy: #970026;
  --burgundy-dark: #72001d;
  --surface: #ffffff;
  --soft: #f4f5f6;
  --border: #d9dde1;
  --muted: #626970;
  --danger: #a4001f;
  --shadow: 0 16px 45px rgba(38, 41, 45, .12);
}
* { box-sizing: border-box; }
body { margin: 0; color: var(--graphite); background: var(--soft); font: 16px/1.5 Arial, sans-serif; }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
input { width: 100%; border: 1px solid var(--border); border-radius: 8px; padding: 11px 12px; background: var(--surface); color: var(--graphite); }
select { border: 1px solid var(--border); border-radius: 8px; padding: 11px 12px; background: var(--surface); color: var(--graphite); }
textarea { width: 100%; min-height: 92px; resize: vertical; border: 1px solid var(--border); border-radius: 8px; padding: 11px 12px; }
input:focus, button:focus, a:focus { outline: 3px solid rgba(151, 0, 38, .22); outline-offset: 2px; }
label { display: block; margin: 14px 0 6px; font-weight: 700; }
h1, h2 { line-height: 1.2; }
h1 { margin-top: 0; }
.primary, .secondary { border: 0; border-radius: 8px; padding: 10px 16px; font-weight: 700; }
.primary { color: white; background: var(--burgundy); }
.primary:hover { background: var(--burgundy-dark); }
.secondary { color: var(--graphite); background: var(--soft); border: 1px solid var(--border); }
.small { padding: 9px 12px; }
.full { width: 100%; margin-top: 18px; }
.error { color: var(--danger); font-weight: 700; }
.hint, .help, .subtitle { color: var(--muted); }
.login-page { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card { width: min(100%, 420px); padding: 34px; background: var(--surface); border-radius: 14px; box-shadow: var(--shadow); }
.login-logo { display: block; width: 190px; max-width: 100%; margin: 0 auto 20px; }
.login-card h1, .login-card .subtitle { text-align: center; }
.password-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.help { margin: 22px 0 0; text-align: center; font-size: 14px; }
.topbar { min-height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 10px 24px; background: var(--surface); border-bottom: 1px solid var(--border); }
.identity { display: flex; align-items: center; gap: 14px; color: var(--graphite); text-decoration: none; font-size: 20px; }
.identity img { width: 116px; height: 44px; object-fit: contain; }
.account { display: flex; align-items: center; gap: 14px; }
.count-badge { display: inline-grid; min-width: 21px; height: 21px; place-items: center; margin-left: 5px; padding: 0 5px; border-radius: 999px; color: white; background: var(--burgundy); font-size: 12px; }
.layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); min-height: calc(100vh - 72px); }
.sidebar { padding: 24px 14px; background: var(--graphite); }
.sidebar a { display: block; margin: 3px 0; padding: 11px 13px; border-radius: 8px; color: white; text-decoration: none; }
.sidebar a:hover, .sidebar a.active { background: var(--burgundy); }
.content { width: min(100%, 1080px); padding: 34px; }
.panel { max-width: 600px; padding: 28px; background: var(--surface); border-radius: 12px; box-shadow: var(--shadow); }
.compact-form { max-width: 480px; }
.welcome { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; }
.welcome h1, .welcome p { margin-bottom: 6px; }
.controlled { padding: 7px 10px; border: 1px solid var(--burgundy); border-radius: 999px; color: var(--burgundy); font-size: 13px; font-weight: 700; text-transform: uppercase; }
.search-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.search { max-width: 620px; margin: 24px 0; padding: 14px; }
.category { width: min(100%, 320px); display: flex; justify-content: space-between; gap: 10px; padding: 18px; text-align: left; color: var(--graphite); background: var(--surface); border: 1px solid var(--border); border-radius: 10px; }
.category span { color: var(--muted); }
.category.selected { border-color: var(--burgundy); box-shadow: 0 0 0 2px rgba(151, 0, 38, .12); }
.empty-state { padding: 24px; background: var(--surface); border: 1px dashed var(--border); border-radius: 10px; color: var(--muted); }
.library-controls { display: grid; grid-template-columns: minmax(220px, 620px) auto auto; align-items: center; gap: 10px; margin: 24px 0; }
.library-controls .search { margin: 0; }
.library-controls label:not(.search-label) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.document-list { display: grid; gap: 10px; }
.document-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 18px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; }
.document-row h3, .document-row p { margin: 0; }
.document-row p { margin-top: 5px; color: var(--muted); }
.attention-row { border-left: 4px solid var(--burgundy); }
.button-link { display: inline-block; text-decoration: none; }
.document-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 22px; margin: 28px 0 18px; }
.document-heading h1 { margin-bottom: 8px; }
.eyebrow { margin-bottom: 7px; color: var(--burgundy); font-weight: 700; text-transform: uppercase; }
.metadata { display: flex; gap: 34px; margin: 0 0 18px; }
.metadata div { display: grid; gap: 3px; }
.metadata dt { color: var(--muted); font-size: 13px; }
.metadata dd { margin: 0; font-weight: 700; }
.control-notice { display: flex; justify-content: space-between; gap: 20px; margin: 18px 0 10px; padding: 12px 14px; border-left: 4px solid var(--burgundy); background: var(--surface); }
.control-notice strong { color: var(--burgundy); }
.pdf-viewer { display: block; width: 100%; height: 760px; border: 1px solid var(--border); background: var(--surface); }
.download-warning { padding: 12px 14px; background: var(--surface); border: 1px solid var(--border); }
.acknowledgement { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin: 10px 0; padding: 15px; background: var(--surface); border: 2px solid var(--burgundy); }
.acknowledgement p { margin: 4px 0 0; color: var(--muted); }
.section-title, .dialog-title, .dialog-actions, .admin-tabs, .row-actions { display: flex; align-items: center; gap: 10px; }
.section-title, .dialog-title { justify-content: space-between; }
.admin-tabs { flex-wrap: wrap; margin: 22px 0; }
.admin-module-tabs { display: flex; gap: 9px; margin-bottom: 26px; }
.admin-tabs .selected { color: white; background: var(--burgundy); border-color: var(--burgundy); }
.admin-document-row { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 17px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; }
.admin-document-row h3, .admin-document-row p { margin: 0; }
.admin-document-row p { margin-top: 5px; color: var(--muted); }
.row-actions { justify-content: flex-end; flex-wrap: wrap; }
dialog { width: min(92vw, 620px); max-height: 88vh; overflow: auto; border: 0; border-radius: 14px; padding: 26px; color: var(--graphite); box-shadow: var(--shadow); }
dialog::backdrop { background: rgba(38, 41, 45, .62); }
.dialog-title h2 { margin: 0; }
.dialog-actions { justify-content: flex-end; margin-top: 22px; }
.icon-button { border: 0; padding: 5px 9px; background: transparent; color: var(--graphite); font-size: 26px; }
.check-row { display: flex; align-items: center; gap: 9px; margin-top: 18px; }
.check-row input { width: auto; }
.temporary-password { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 15px; background: var(--soft); border: 1px solid var(--border); }
.temporary-password code { overflow-wrap: anywhere; font-size: 18px; font-weight: 700; }
.report-row { display: flex; justify-content: space-between; gap: 18px; padding: 12px 0; border-bottom: 1px solid var(--border); }
[hidden] { display: none !important; }
@media (max-width: 760px) {
  .topbar, .account, .welcome { align-items: flex-start; }
  .topbar { flex-direction: column; }
  .layout { grid-template-columns: 1fr; }
  .sidebar { display: flex; gap: 4px; overflow-x: auto; padding: 9px; }
  .sidebar a { white-space: nowrap; }
  .content { padding: 22px 16px; }
  .welcome { flex-direction: column; }
  .library-controls { grid-template-columns: 1fr; }
  .document-row, .document-heading, .control-notice, .admin-document-row, .section-title, .acknowledgement { align-items: stretch; flex-direction: column; }
  .metadata { flex-wrap: wrap; }
  .pdf-viewer { height: 540px; }
}
@media print {
  body * { visibility: hidden; }
  #read-report-dialog, #read-report-dialog * { visibility: visible; }
  #read-report-dialog { position: absolute; inset: 0; width: 100%; max-height: none; box-shadow: none; }
  #read-report-dialog .dialog-actions, #read-report-dialog .icon-button { display: none; }
}
