:root {
  --ink: #101820;
  --ink-soft: #4c5964;
  --paper: #f4f6f5;
  --white: #ffffff;
  --line: #d9dfdd;
  --cyan: #00a9c7;
  --cyan-dark: #007c92;
  --gold: #b58a37;
  --coral: #c95842;
  --green: #23805b;
  --sidebar: #07151b;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: var(--paper); font-family: "Aptos", "Franklin Gothic Medium", sans-serif; letter-spacing: 0; }
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid rgba(0, 169, 199, .35); outline-offset: 2px; }

.public-shell { min-height: 100vh; background: #08151a; color: var(--white); }
.public-header { height: 74px; display: flex; align-items: center; justify-content: space-between; padding: 0 clamp(24px, 6vw, 92px); border-bottom: 1px solid rgba(255,255,255,.12); }
.brand, .portal-brand { display: flex; align-items: center; gap: 14px; color: inherit; text-decoration: none; font-weight: 700; }
.brand img, .portal-brand img { width: 92px; height: 42px; object-fit: contain; object-position: left center; }
.public-header nav { display: flex; gap: 30px; }
.public-header nav a { color: #d5dee1; text-decoration: none; font-size: 14px; }
.access-stage { min-height: calc(100vh - 130px); display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(340px, .65fr); align-items: center; gap: clamp(40px, 7vw, 110px); padding: 54px clamp(24px, 7vw, 110px); position: relative; isolation: isolate; overflow: hidden; }
.access-stage::before { content: ""; position: absolute; inset: 0; z-index: -2; background: linear-gradient(90deg, rgba(5,18,23,.96) 0%, rgba(5,18,23,.74) 52%, rgba(5,18,23,.4) 100%), url('assets/institutional-network.jpg') center/cover; }
.access-stage::after { content: ""; position: absolute; inset: 0; z-index: -1; background-image: linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px); background-size: 52px 52px; mask-image: linear-gradient(90deg, #000, transparent 75%); }
.stage-copy { max-width: 720px; }
.eyebrow { margin: 0 0 11px; color: var(--cyan); font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: 1.6px; }
.stage-copy h1 { margin: 0; max-width: 700px; font: 700 clamp(44px, 5.7vw, 78px)/.98 Georgia, serif; letter-spacing: 0; }
.lede { max-width: 650px; margin: 28px 0; color: #c3ced1; font: 400 19px/1.6 Georgia, serif; }
.trust-row { display: flex; flex-wrap: wrap; gap: 10px; }
.trust-row span { border-left: 2px solid var(--gold); padding: 7px 13px; color: #dbe3e5; font-size: 13px; background: rgba(255,255,255,.055); }
.login-panel { align-self: center; background: rgba(250,252,251,.97); color: var(--ink); border-top: 4px solid var(--gold); padding: 34px; box-shadow: 0 26px 80px rgba(0,0,0,.28); max-width: 450px; }
.panel-heading h2 { margin: 0; font: 700 34px/1.1 Georgia, serif; }
.panel-heading > p:last-child { color: var(--ink-soft); font-size: 14px; }
.account-type { display: grid; grid-template-columns: .8fr 1.2fr; margin: 20px 0 18px; border: 1px solid #b8c4c2; border-radius: 3px; background: #e8eceb; }
.account-type button { min-height: 42px; border: 0; border-right: 1px solid #b8c4c2; padding: 8px 10px; background: transparent; color: var(--ink-soft); cursor: pointer; font-size: 12px; font-weight: 800; }
.account-type button:last-child { border-right: 0; }
.account-type button.active { background: var(--cyan-dark); color: var(--white); }
form { display: grid; gap: 16px; }
label { display: grid; gap: 7px; color: var(--ink-soft); font-size: 12px; font-weight: 700; }
input, select { width: 100%; min-height: 44px; border: 1px solid #bcc6c4; border-radius: 3px; padding: 10px 12px; background: var(--white); color: var(--ink); }
.primary-button { min-height: 46px; border: 0; border-radius: 3px; background: var(--cyan-dark); color: var(--white); font-weight: 800; cursor: pointer; }
.primary-button:hover { background: #006b7d; }
.request-link { display: block; margin-top: 20px; color: var(--cyan-dark); text-align: center; font-size: 13px; font-weight: 700; }
.form-error { min-height: 18px; margin: -4px 0; color: #a92e21; font-size: 13px; }
.framework-band { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: rgba(255,255,255,.1); }
.framework-band > div { display: grid; gap: 8px; padding: 28px clamp(24px, 5vw, 72px); background: #0b2028; }
.framework-band strong { color: #fff; font: 700 18px Georgia, serif; }
.framework-band span { color: #9fb0b5; font-size: 13px; line-height: 1.5; }
.public-footer { padding: 26px; color: #82959b; text-align: center; font-size: 12px; background: #061116; }

.portal-shell { min-height: 100vh; display: grid; grid-template-columns: 248px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; color: #dbe4e6; background: var(--sidebar); border-right: 1px solid #18313a; }
.portal-brand { min-height: 72px; padding: 14px 22px; border-bottom: 1px solid #19323b; }
.portal-brand span { color: var(--gold); }
.menu-toggle { display: none; }
#portal-nav { padding: 18px 10px; overflow-y: auto; }
#portal-nav p { margin: 20px 12px 7px; color: #688089; font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: 1.4px; }
#portal-nav button { width: 100%; min-height: 36px; border: 0; border-left: 3px solid transparent; padding: 8px 12px; color: #b7c5c9; background: transparent; text-align: left; cursor: pointer; font-size: 13px; }
#portal-nav button:hover, #portal-nav button.active { color: #fff; background: #112831; border-left-color: var(--cyan); }
.sidebar-foot { margin-top: auto; display: grid; gap: 8px; padding: 18px 20px; border-top: 1px solid #19323b; color: #8ba0a6; font-size: 11px; }
.sidebar-foot button { border: 0; padding: 0; color: #dce6e8; background: transparent; text-align: left; cursor: pointer; font-weight: 700; }
.workspace { min-width: 0; }
.workspace-header { min-height: 84px; display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 18px clamp(22px, 4vw, 56px); background: var(--white); border-bottom: 1px solid var(--line); }
.workspace-header h1 { margin: 0; font: 700 27px/1.1 Georgia, serif; }
.workspace-header .eyebrow { margin-bottom: 6px; }
.user-block { display: grid; justify-items: end; gap: 4px; font-size: 13px; font-weight: 700; }
.live-dot { color: var(--green); font-size: 11px; }
#content { padding: 30px clamp(22px, 4vw, 56px) 56px; }
.notice { margin: 18px clamp(22px, 4vw, 56px) 0; border-left: 4px solid var(--cyan); padding: 12px 16px; background: #e5f5f7; color: #164f5b; font-size: 13px; }
.status-strip { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--line); background: var(--white); }
.status-strip > div { display: grid; gap: 9px; padding: 20px; border-right: 1px solid var(--line); }
.status-strip > div:last-child { border-right: 0; }
.status-strip span { color: var(--ink-soft); font-size: 11px; text-transform: uppercase; font-weight: 800; }
.status-strip strong { font: 700 16px Georgia, serif; }
.qualification { margin: 14px 0 24px; border-left: 3px solid var(--gold); padding: 10px 14px; color: var(--ink-soft); background: #f0ede4; font-size: 12px; line-height: 1.5; }
.dashboard-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.module-panel { background: var(--white); border: 1px solid var(--line); padding: 22px; }
.module-panel.wide { grid-column: 1 / -1; }
.module-panel h2 { margin: 0 0 18px; font: 700 21px Georgia, serif; }
.section-heading { display: flex; justify-content: space-between; gap: 20px; align-items: start; }
.section-heading > span { color: var(--ink-soft); font-size: 11px; }
.category-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); }
.category-item { min-height: 96px; border: 0; padding: 16px; background: var(--white); text-align: left; cursor: pointer; }
.category-item:hover { background: #e9f5f6; }
.category-item strong { display: block; margin-bottom: 16px; font: 700 28px Georgia, serif; color: var(--cyan-dark); }
.category-item span { color: var(--ink-soft); font-size: 11px; font-weight: 800; }
.metric-row { display: grid; grid-template-columns: 1fr auto; gap: 16px; padding: 11px 0; border-bottom: 1px solid #e9eceb; font-size: 13px; }
.metric-row:last-child { border-bottom: 0; }
.metric-row span { color: var(--ink-soft); }
.risk-badge { align-self: center; border-radius: 2px; padding: 3px 7px; background: #edf2e9; color: #3e653c; font-size: 10px; font-weight: 800; text-transform: uppercase; }
.risk-badge.medium { background: #f5ead7; color: #805923; }
.toolbar { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 18px; }
.search-field { width: min(460px, 100%); }
.toolbar > span { color: var(--ink-soft); font-size: 12px; }
.table-wrap { overflow-x: auto; background: var(--white); border: 1px solid var(--line); }
table { width: 100%; border-collapse: collapse; }
th, td { border-bottom: 1px solid #e6e6e6; padding: 13px 15px; text-align: left; vertical-align: middle; }
th { background-color: #f5f5f5; color: var(--ink-soft); font-size: 10px; text-transform: uppercase; letter-spacing: 1px; }
td { font-size: 13px; }
td:first-child { min-width: 300px; font-weight: 700; }
.doc-meta { display: block; margin-top: 4px; color: #758187; font-size: 10px; font-weight: 400; }
.actions { display: flex; gap: 7px; }
.action-button { border: 1px solid #b8c4c2; border-radius: 3px; padding: 7px 10px; background: #fff; color: var(--ink); cursor: pointer; font: 800 11px "Aptos", "Franklin Gothic Medium", sans-serif; text-decoration: none; white-space: nowrap; }
.action-button:hover { border-color: var(--cyan-dark); color: var(--cyan-dark); }
.action-button[aria-disabled="true"] { opacity: .4; pointer-events: none; }
.empty-state { border: 1px dashed #aeb9b6; padding: 50px 24px; text-align: center; background: #fff; }
.empty-state h2 { font: 700 21px Georgia, serif; }
.empty-state p { color: var(--ink-soft); }
.split-view { display: grid; grid-template-columns: minmax(0, 1fr) minmax(320px, .7fr); gap: 18px; }
.admin-form { display: grid; gap: 14px; }
.admin-form .primary-button { width: max-content; padding: 0 22px; }
.code-output { overflow-wrap: anywhere; border: 1px solid var(--line); padding: 12px; background: #f4f6f5; font-family: Consolas, monospace; font-size: 11px; }
.document-viewer { width: min(1180px, calc(100vw - 28px)); height: min(850px, calc(100vh - 28px)); border: 1px solid #31434a; padding: 0; background: #101a1e; color: #fff; }
.document-viewer::backdrop { background: rgba(2, 10, 13, .88); }
.viewer-heading { height: 52px; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 0 16px; border-bottom: 1px solid #31434a; }
.viewer-heading strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.viewer-heading button { width: 34px; height: 34px; border: 0; background: transparent; color: #fff; cursor: pointer; font-size: 25px; }
.viewer-stage { position: relative; height: calc(100% - 52px); overflow: hidden; background: #263238; }
.viewer-stage iframe { width: 100%; height: 100%; border: 0; background: #fff; }
.viewer-watermark { position: absolute; inset: 0; display: grid; grid-template-columns: repeat(3, 1fr); pointer-events: none; overflow: hidden; opacity: .22; }
.viewer-watermark span { align-self: center; color: #b00020; font: 800 12px/1.4 Consolas, monospace; text-align: center; transform: rotate(-24deg); }
.restricted-session { user-select: none; -webkit-user-select: none; }
.restricted-session .workspace::after { content: "RESTRICTED VIEW · ACTIVITY AUDITED"; position: fixed; right: 18px; bottom: 14px; z-index: 20; color: rgba(140, 0, 20, .62); font: 800 10px Consolas, monospace; pointer-events: none; }

@media print {
  .restricted-session * { display: none !important; }
  .restricted-session::after { content: "Printing is disabled for this restricted session."; display: block; padding: 40px; color: #000; }
}

@media (max-width: 1050px) {
  .category-grid { grid-template-columns: repeat(3, 1fr); }
  .status-strip { grid-template-columns: repeat(2, 1fr); }
  .status-strip > div:nth-child(2) { border-right: 0; }
  .status-strip > div:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
}

@media (max-width: 760px) {
  .public-header nav { display: none; }
  .access-stage { grid-template-columns: 1fr; align-items: start; padding-top: 48px; }
  .stage-copy h1 { font-size: 42px; }
  .lede { font-size: 17px; }
  .login-panel { width: 100%; max-width: none; }
  .framework-band { grid-template-columns: 1fr; }
  .portal-shell { display: block; }
  .sidebar { position: relative; width: 100%; height: auto; }
  .portal-brand { min-height: 62px; }
  .menu-toggle { display: block; position: absolute; top: 14px; right: 18px; width: 38px; height: 34px; border: 1px solid #36505a; background: transparent; color: #fff; }
  #portal-nav { display: none; max-height: 68vh; }
  .sidebar.open #portal-nav { display: block; }
  .sidebar-foot { display: none; }
  .sidebar.open .sidebar-foot { display: grid; }
  .workspace-header { min-height: 74px; }
  .user-block { display: none; }
  #content { padding-top: 22px; }
  .dashboard-grid, .split-view { grid-template-columns: 1fr; }
  .category-grid { grid-template-columns: repeat(2, 1fr); }
  .status-strip { grid-template-columns: 1fr; }
  .status-strip > div { border-right: 0; border-bottom: 1px solid var(--line); }
  .status-strip > div:last-child { border-bottom: 0; }
  .toolbar { align-items: stretch; flex-direction: column; }
}

@media (max-width: 420px) {
  .access-stage, .public-header { padding-left: 18px; padding-right: 18px; }
  .login-panel { padding: 25px 20px; }
  .category-grid { grid-template-columns: 1fr; }
}