:root {
  --navy-950: #071a2b;
  --navy-900: #102a43;
  --navy-800: #243b53;
  --navy-700: #334e68;
  --slate-600: #486581;
  --slate-500: #627d98;
  --slate-400: #829ab1;
  --slate-300: #9fb3c8;
  --slate-200: #bcccdc;
  --slate-100: #d9e2ec;
  --slate-50: #f0f4f8;
  --paper: #ffffff;
  --canvas: #f6f8fb;
  --teal-700: #0e7490;
  --teal-600: #0891b2;
  --teal-100: #cffafe;
  --gold-600: #b9872f;
  --gold-100: #f9edcf;
  --green-700: #137333;
  --green-100: #e6f4ea;
  --amber-700: #9a6700;
  --amber-100: #fff4ce;
  --red-700: #b42318;
  --red-100: #fde7e5;
  --shadow-sm: 0 1px 2px rgb(16 42 67 / 6%), 0 3px 8px rgb(16 42 67 / 5%);
  --shadow-md: 0 10px 30px rgb(16 42 67 / 10%);
  --radius: 12px;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--canvas); }
body {
  min-height: 100vh;
  margin: 0;
  color: var(--navy-800);
  background: var(--canvas);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.5;
}
a { color: inherit; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 3px; font-size: 27px; line-height: 1.15; letter-spacing: -.03em; color: var(--navy-900); }
h2 { margin-bottom: 5px; font-size: 18px; line-height: 1.3; letter-spacing: -.015em; color: var(--navy-900); }
h3 { margin-bottom: 8px; font-size: 15px; color: var(--navy-900); }
.muted, .helper { color: var(--slate-500); }
.helper { margin-bottom: 18px; font-size: 13px; }
.eyebrow {
  margin: 0 0 5px;
  color: var(--teal-700);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.eyebrow.light { color: #98e5f0; }

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 20;
  display: flex;
  width: 238px;
  flex-direction: column;
  padding: 24px 16px 17px;
  color: #d9e8f2;
  background: var(--navy-950);
}
.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 0 9px 24px;
}
.brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 10px;
  color: var(--navy-950);
  background: #70d6e4;
  font-family: Georgia, serif;
  font-size: 23px;
  font-weight: 700;
}
.brand strong { display: block; color: white; font-family: Georgia, serif; font-size: 18px; letter-spacing: .01em; }
.brand small { display: block; margin-top: -2px; color: #7ea1bb; font-size: 10px; letter-spacing: .11em; text-transform: uppercase; }
.main-nav { display: grid; gap: 5px; }
.main-nav a {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 12px;
  border-radius: 8px;
  color: #a9c0d2;
  font-size: 13px;
  font-weight: 650;
  text-decoration: none;
  transition: background .15s ease, color .15s ease;
}
.main-nav a:hover { color: white; background: rgb(255 255 255 / 6%); }
.main-nav a.active { color: white; background: #123b58; box-shadow: inset 3px 0 #65d1df; }
.nav-icon { width: 18px; text-align: center; font-size: 17px; color: #69cedc; }
.sidebar-user {
  display: grid;
  grid-template-columns: 34px 1fr auto;
  align-items: center;
  gap: 9px;
  margin-top: auto;
  padding: 14px 8px 0;
  border-top: 1px solid rgb(255 255 255 / 9%);
}
.sidebar-user strong { display: block; overflow: hidden; color: white; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-user small { color: #7ea1bb; font-size: 10px; }
.avatar {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 50%;
  color: var(--navy-950);
  background: #7dd6df;
  font-weight: 800;
}
.icon-button { border: 0; color: #8fb0c5; background: transparent; font-size: 18px; }
.icon-button:hover { color: white; }

.app-shell { min-height: 100vh; margin-left: 238px; }
.topbar {
  display: flex;
  min-height: 92px;
  align-items: center;
  justify-content: space-between;
  padding: 20px 36px;
  border-bottom: 1px solid #e5eaf0;
  background: var(--paper);
}
.top-actions { display: flex; gap: 9px; align-items: center; }
.page-content { padding: 26px 36px 50px; }

.button {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 8px 14px;
  border: 1px solid transparent;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 750;
  line-height: 1;
  text-decoration: none;
  transition: transform .12s ease, box-shadow .12s ease, background .12s ease;
}
.button:hover { transform: translateY(-1px); }
.button-primary { color: white; background: var(--teal-700); box-shadow: 0 4px 10px rgb(14 116 144 / 18%); }
.button-primary:hover { background: #09667e; }
.button-secondary { border-color: var(--slate-100); color: var(--navy-800); background: white; }
.button-secondary:hover { border-color: var(--slate-300); box-shadow: var(--shadow-sm); }
.button-danger { border-color: #f6c8c3; color: var(--red-700); background: #fff; }
.button-ghost { color: var(--teal-700); background: transparent; }
.button-small { min-height: 30px; padding: 6px 10px; font-size: 11px; }
.button-block { width: 100%; }
.text-link { color: var(--teal-700); font-size: 12px; font-weight: 750; text-decoration: none; }
.text-link:hover { text-decoration: underline; }

.panel {
  overflow: hidden;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius);
  background: white;
  box-shadow: var(--shadow-sm);
}
.panel + .panel { margin-top: 20px; }
.panel-header {
  display: flex;
  min-height: 70px;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 16px 20px;
  border-bottom: 1px solid #e9eef3;
}
.panel-header h2, .panel-header p { margin-bottom: 0; }
.panel-body { padding: 20px; }
.panel-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 9px;
  padding: 14px 20px;
  border-top: 1px solid #e9eef3;
  background: #fbfcfd;
}
.narrow-panel { max-width: 620px; }
.narrow-panel .stack-form { padding: 20px; }

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 15px;
  margin-bottom: 20px;
}
.metric-card {
  display: flex;
  min-height: 102px;
  align-items: center;
  gap: 14px;
  padding: 18px;
  border: 1px solid #e1e8ee;
  border-radius: var(--radius);
  background: white;
  box-shadow: var(--shadow-sm);
}
.metric-card small { display: block; color: var(--slate-500); font-size: 11px; font-weight: 650; }
.metric-card strong { display: block; margin-top: 2px; color: var(--navy-900); font-size: 26px; line-height: 1; }
.metric-icon { display: grid; width: 44px; height: 44px; place-items: center; border-radius: 11px; font-size: 20px; font-weight: 700; }
.metric-icon.teal { color: var(--teal-700); background: var(--teal-100); }
.metric-icon.blue { color: #2e5ea5; background: #e9f0fd; }
.metric-icon.amber { color: var(--amber-700); background: var(--amber-100); }
.metric-icon.red { color: var(--red-700); background: var(--red-100); }
.two-column { display: grid; grid-template-columns: 1.25fr .75fr; gap: 20px; align-items: start; }
.record-list, .deadline-list { padding: 6px 0; }
.record-row {
  display: grid;
  grid-template-columns: 36px 1fr auto 16px;
  align-items: center;
  gap: 11px;
  padding: 11px 18px;
  border-bottom: 1px solid #eef2f5;
  text-decoration: none;
}
.record-row:last-child { border-bottom: 0; }
.record-row:hover, .deadline-row:hover { background: #f8fbfc; }
.record-mark { display: grid; width: 34px; height: 34px; place-items: center; border-radius: 9px; color: var(--teal-700); background: var(--teal-100); font-weight: 800; }
.record-main strong, .deadline-row strong { display: block; color: var(--navy-800); font-size: 12px; }
.record-main small, .deadline-row small { display: block; color: var(--slate-500); font-size: 10px; }
.chevron { color: var(--slate-300); font-size: 20px; }
.deadline-row { display: flex; align-items: center; gap: 12px; padding: 11px 18px; border-bottom: 1px solid #eef2f5; text-decoration: none; }
.deadline-row:last-child { border-bottom: 0; }
.date-block { display: grid; width: 43px; height: 43px; place-items: center; align-content: center; border-radius: 8px; color: var(--amber-700); background: var(--amber-100); }
.date-block strong { font-size: 16px; line-height: 1; }
.date-block small { font-size: 9px; }
.empty-mini { padding: 30px 20px; color: var(--slate-500); text-align: center; }
.compliance-pulse { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-top: 20px; padding: 20px 22px; border-left: 4px solid var(--teal-600); }
.compliance-pulse p:last-child { max-width: 820px; margin: 5px 0 0; color: var(--slate-500); font-size: 12px; }

.status {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 23px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.status-draft { color: var(--slate-600); background: var(--slate-50); }
.status-preparation { color: #21559a; background: #e7f0ff; }
.status-review { color: var(--amber-700); background: var(--amber-100); }
.status-approved, .status-final { color: var(--green-700); background: var(--green-100); }
.status-missing, .status-blocking, .status-open { color: var(--red-700); background: var(--red-100); }
.status-requested, .status-warning, .status-important { color: var(--amber-700); background: var(--amber-100); }
.status-received, .status-reviewed, .status-pass, .status-resolved { color: var(--green-700); background: var(--green-100); }
.status-not_applicable, .status-normal { color: var(--slate-600); background: var(--slate-50); }

.study-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 13px 36px;
  border-bottom: 1px solid #dfe7ed;
  background: #f0f7f9;
}
.study-banner-title { display: flex; align-items: center; gap: 9px; }
.study-banner-title strong { color: var(--navy-900); font-size: 13px; }
.study-banner small { color: var(--slate-500); font-size: 10px; }
.progress-line { display: flex; align-items: center; gap: 0; }
.progress-line span { position: relative; padding: 0 17px 0 22px; color: var(--slate-400); font-size: 9px; font-weight: 750; text-transform: uppercase; }
.progress-line span::before { position: absolute; left: 3px; top: 1px; width: 11px; height: 11px; border: 2px solid var(--slate-200); border-radius: 50%; background: #f0f7f9; content: ""; }
.progress-line span:not(:last-child)::after { position: absolute; left: 14px; top: 7px; width: 14px; height: 1px; background: var(--slate-200); content: ""; }
.progress-line span.done { color: var(--teal-700); }
.progress-line span.done::before { border-color: var(--teal-700); background: var(--teal-700); box-shadow: inset 0 0 0 2px #f0f7f9; }
.study-tabs {
  display: flex;
  overflow-x: auto;
  gap: 3px;
  padding: 0 31px;
  border-bottom: 1px solid #dfe7ed;
  background: white;
}
.study-tabs a { padding: 11px 8px 9px; border-bottom: 2px solid transparent; color: var(--slate-500); font-size: 10px; font-weight: 750; text-decoration: none; white-space: nowrap; }
.study-tabs a:hover { color: var(--navy-800); }
.study-tabs a.active { border-bottom-color: var(--teal-700); color: var(--teal-700); }

.flash {
  margin: 18px 36px -6px;
  padding: 11px 14px;
  border: 1px solid;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 650;
}
.flash-success { border-color: #b8dfc3; color: var(--green-700); background: var(--green-100); }
.flash-error { border-color: #f0beb8; color: var(--red-700); background: var(--red-100); }
.flash-info { border-color: #b6dbe4; color: var(--teal-700); background: var(--teal-100); }

.data-table { width: 100%; border-collapse: collapse; }
.data-table th {
  padding: 10px 14px;
  border-bottom: 1px solid #dfe7ed;
  color: var(--slate-500);
  background: #f8fafc;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .08em;
  text-align: left;
  text-transform: uppercase;
}
.data-table td { padding: 12px 14px; border-bottom: 1px solid #edf1f4; color: var(--navy-800); font-size: 11px; vertical-align: top; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover { background: #fbfdfd; }
.data-table strong { display: block; color: var(--navy-900); font-size: 12px; }
.data-table small { display: block; color: var(--slate-500); }
.actions { display: flex; justify-content: flex-end; gap: 6px; }
.numeric { font-variant-numeric: tabular-nums; text-align: right; }

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 18px; }
.form-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-grid.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.form-grid .full { grid-column: 1 / -1; }
label { display: block; color: var(--navy-700); font-size: 11px; font-weight: 700; }
input, select, textarea {
  width: 100%;
  margin-top: 5px;
  padding: 9px 10px;
  border: 1px solid #cbd6df;
  border-radius: 7px;
  outline: none;
  color: var(--navy-800);
  background: white;
  font-size: 12px;
  transition: border .12s ease, box-shadow .12s ease;
}
input, select { height: 38px; }
textarea { min-height: 100px; resize: vertical; line-height: 1.55; }
textarea.tall { min-height: 180px; }
input:focus, select:focus, textarea:focus { border-color: var(--teal-600); box-shadow: 0 0 0 3px rgb(8 145 178 / 12%); }
input[type="checkbox"] { width: 16px; height: 16px; margin: 0; accent-color: var(--teal-700); }
.check-label { display: flex; align-items: center; gap: 8px; min-height: 38px; padding-top: 19px; }
.stack-form { display: grid; gap: 15px; }
.section-card { padding: 20px; border-bottom: 1px solid #e9eef3; }
.section-card:last-child { border-bottom: 0; }
.section-title { display: flex; align-items: start; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.section-title p { max-width: 720px; margin: 3px 0 0; color: var(--slate-500); font-size: 11px; }
.inline-form { display: flex; align-items: end; gap: 9px; }
.inline-form > label { flex: 1; }
.field-note { display: block; margin-top: 4px; color: var(--slate-500); font-size: 9px; font-weight: 500; }
.required::after { color: var(--red-700); content: " *"; }

.summary-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 13px; }
.summary-card { padding: 16px; border: 1px solid #e2e8ef; border-radius: 10px; background: white; }
.summary-card small { display: block; color: var(--slate-500); font-size: 9px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; }
.summary-card strong { display: block; margin-top: 4px; color: var(--navy-900); font-size: 16px; }
.summary-card p { margin: 5px 0 0; color: var(--slate-500); font-size: 10px; }
.summary-card.risk { border-color: #f0c3bf; background: #fffafa; }
.summary-card.success { border-color: #bcdcc4; background: #fbfffc; }
.callout { padding: 14px 16px; border-left: 4px solid var(--teal-600); border-radius: 7px; color: var(--navy-700); background: #edf8fa; font-size: 11px; }
.callout.warning { border-left-color: var(--amber-700); background: var(--amber-100); }
.callout.danger { border-left-color: var(--red-700); background: var(--red-100); }
.callout.success { border-left-color: var(--green-700); background: var(--green-100); }
.callout strong { display: block; margin-bottom: 3px; color: inherit; }

.empty-state { max-width: 560px; margin: 60px auto; padding: 50px; border: 1px solid #e1e8ee; border-radius: 14px; background: white; text-align: center; box-shadow: var(--shadow-sm); }
.empty-icon { display: grid; width: 50px; height: 50px; margin: 0 auto 16px; place-items: center; border-radius: 50%; color: var(--red-700); background: var(--red-100); font-size: 22px; font-weight: 800; }
.empty-state p { color: var(--slate-500); }

.auth-body { min-height: 100vh; color: white; background: var(--navy-950); }
.auth-layout { display: grid; min-height: 100vh; grid-template-columns: 1.15fr .85fr; }
.auth-intro { position: relative; display: flex; flex-direction: column; justify-content: center; overflow: hidden; padding: 70px 9vw; background: radial-gradient(circle at 70% 20%, #15536d 0, transparent 34%), linear-gradient(145deg, #071a2b 0%, #0d3048 100%); }
.auth-intro::after { position: absolute; right: -120px; bottom: -180px; width: 460px; height: 460px; border: 1px solid rgb(106 213 226 / 20%); border-radius: 50%; box-shadow: 0 0 0 65px rgb(106 213 226 / 3%), 0 0 0 130px rgb(106 213 226 / 2%); content: ""; }
.auth-logo { margin-bottom: 70px; color: white; font-family: Georgia, serif; font-size: 22px; font-weight: 700; }
.auth-logo span { display: inline-grid; width: 34px; height: 34px; margin-right: 8px; place-items: center; border-radius: 9px; color: var(--navy-950); background: #6ed3df; }
.auth-intro h1 { max-width: 620px; margin: 8px 0 22px; color: white; font-size: clamp(38px, 5vw, 66px); font-weight: 650; line-height: 1.02; letter-spacing: -.055em; }
.auth-intro > p:not(.eyebrow) { max-width: 570px; color: #a9c4d6; font-size: 16px; }
.auth-feature-grid { display: grid; max-width: 530px; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 34px; }
.auth-feature-grid span { padding: 10px 12px; border: 1px solid rgb(151 216 225 / 16%); border-radius: 7px; color: #bbd2df; background: rgb(255 255 255 / 4%); font-size: 11px; font-weight: 650; }
.auth-card { width: min(430px, calc(100% - 42px)); margin: auto; padding: 38px; border-radius: 16px; color: var(--navy-800); background: white; box-shadow: var(--shadow-md); }
.auth-card h1, .auth-card h2 { color: var(--navy-900); }
.auth-card h2 { margin-bottom: 7px; font-size: 25px; }
.auth-brand { margin-bottom: 28px; color: var(--navy-900); font-family: Georgia, serif; font-size: 20px; font-weight: 700; }
.auth-brand span { color: var(--teal-700); font-family: Inter, sans-serif; font-size: 11px; text-transform: uppercase; }
.auth-card .flash { margin: 16px 0; }
.auth-note { margin: 18px 0 0; color: var(--slate-500); font-size: 9px; text-align: center; }

.file-picker { position: relative; display: flex; min-height: 72px; align-items: center; justify-content: center; padding: 12px; border: 1px dashed var(--slate-300); border-radius: 8px; color: var(--slate-500); background: #fbfcfd; text-align: center; }
.file-picker input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.range-strip { display: grid; grid-template-columns: repeat(5, 1fr); overflow: hidden; border: 1px solid #dfe6ec; border-radius: 9px; }
.range-strip div { padding: 13px 8px; border-right: 1px solid #dfe6ec; text-align: center; }
.range-strip div:last-child { border: 0; }
.range-strip small { display: block; color: var(--slate-500); font-size: 9px; text-transform: uppercase; }
.range-strip strong { display: block; margin-top: 3px; color: var(--navy-900); }
.range-strip .median { background: var(--teal-100); }
.review-note { padding: 14px 16px; border-bottom: 1px solid #e9eef3; }
.review-note:last-child { border: 0; }
.review-meta { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 6px; }
.review-note p { margin: 0; font-size: 12px; }
.review-note small { color: var(--slate-500); }
.workflow-actions { display: flex; flex-wrap: wrap; gap: 9px; }
.source-url { max-width: 340px; overflow: hidden; color: var(--teal-700); text-overflow: ellipsis; white-space: nowrap; }

@media (max-width: 1100px) {
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .two-column { grid-template-columns: 1fr; }
  .form-grid.four { grid-template-columns: repeat(2, 1fr); }
  .auth-layout { grid-template-columns: 1fr 480px; }
  .auth-intro { padding: 60px 6vw; }
}
@media (max-width: 820px) {
  .sidebar { position: static; width: 100%; height: auto; padding: 12px 15px; }
  .brand { padding: 0; }
  .main-nav { display: flex; overflow-x: auto; margin-top: 10px; }
  .sidebar-user { display: none; }
  .app-shell { margin-left: 0; }
  .topbar { padding: 18px 20px; }
  .page-content { padding: 20px; }
  .flash { margin: 15px 20px -4px; }
  .study-banner { padding: 12px 20px; }
  .progress-line { display: none; }
  .study-tabs { padding: 0 15px; }
  .form-grid, .form-grid.three, .form-grid.four { grid-template-columns: 1fr; }
  .summary-grid { grid-template-columns: 1fr 1fr; }
  .auth-layout { grid-template-columns: 1fr; }
  .auth-intro { display: none; }
}
@media (max-width: 520px) {
  .metric-grid, .summary-grid { grid-template-columns: 1fr; }
  .topbar { align-items: flex-start; }
  .topbar h1 { font-size: 22px; }
  .page-content { padding: 14px; }
  .panel { border-radius: 9px; }
  .data-table { min-width: 700px; }
  .panel:has(.data-table) { overflow-x: auto; }
  .auth-card { padding: 26px; }
}
