:root {
  --navy: #142638;
  --navy-2: #203549;
  --blue: #176b87;
  --blue-soft: #e7f2f6;
  --text: #17212b;
  --muted: #5d6874;
  --faint: #87929e;
  --line: #d8e0e7;
  --soft-line: #e8edf2;
  --surface: #ffffff;
  --band: #f1f5f7;
  --page: #f7f9fb;
  --green: #2d754c;
  --green-soft: #e8f3ec;
  --amber: #a96314;
  --amber-soft: #fff4e2;
  --red: #a33f3f;
  --red-soft: #f8e9e9;
  --shadow: 0 1px 2px rgba(20, 34, 48, 0.08);
  --modal-shadow: 0 18px 48px rgba(20, 34, 48, 0.24);
  --radius: 6px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 1180px;
  background: var(--page);
  color: var(--text);
  font-family: Inter, Arial, sans-serif;
  font-size: 14px;
  line-height: 1.35;
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 190px 1fr;
}

.sidebar {
  background: var(--nav);
  color: #dce6ee;
  padding: 18px 14px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.brand {
  color: #fff;
  padding: 4px 8px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 24px;
  font-weight: 650;
  letter-spacing: 0;
}

.brand span {
  color: #64a4ff;
}

.nav-item,
.help {
  width: 100%;
  border: 0;
  color: #d6e8ff;
  background: transparent;
  border-radius: 6px;
  text-align: left;
  padding: 9px 10px;
  margin: 2px 0;
}

.nav-item.active,
.nav-item:hover,
.help:hover {
  background: var(--nav-2);
  color: #fff;
  box-shadow: inset 3px 0 0 var(--blue);
}

.help {
  margin-top: auto;
}

.bluevue-page {
  padding: 0 24px 28px;
}

.topbar {
  height: 76px;
  display: grid;
  grid-template-columns: 1fr 340px auto;
  gap: 24px;
  align-items: center;
  border-bottom: 1px solid var(--line);
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

h1,
h2,
h3,
h4,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: 24px;
  letter-spacing: -0.02em;
}

h1 span {
  margin-left: 8px;
  color: #0b5cab;
  background: #dbeafe;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  vertical-align: middle;
}

.search {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 12px;
}

.search input {
  width: 100%;
  border: 0;
  outline: 0;
}

.user {
  font-weight: 700;
  color: var(--navy);
}

.case-layout {
  display: grid;
  grid-template-columns: 270px 1fr 260px;
  gap: 18px;
  padding-top: 22px;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--soft-line);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
}

.panel h2 {
  margin-bottom: 14px;
  font-size: 17px;
}

.member-avatar {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #dbeafe;
  color: #0b55a1;
  font-weight: 800;
  margin-bottom: 14px;
}

dl {
  margin: 0;
}

.member-panel dl div,
.source-summary div,
.source-record dl div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 9px 0;
  border-bottom: 1px solid #eef2f7;
}

dt {
  color: var(--muted);
}

dd {
  margin: 0;
  text-align: right;
  font-weight: 600;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.overview-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin: 16px 0 24px;
}

.overview-grid > div {
  background: var(--band);
  border: 1px solid var(--soft-line);
  border-radius: var(--radius);
  padding: 14px;
}

.label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 12px;
}

.risk {
  color: var(--red);
}

.activity-list {
  border-top: 1px solid var(--line);
}

.activity-list div,
.metric-row {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 13px 0;
  border-bottom: 1px solid #eef2f7;
}

.activity-list span,
.note-line {
  color: var(--muted);
}

.right-rail {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.primary,
.secondary,
.ghost,
.icon-button {
  border-radius: var(--radius);
  min-height: 40px;
  padding: 0 16px;
  font-weight: 650;
}

.primary {
  border: 1px solid var(--blue);
  background: var(--blue);
  color: white;
}

.primary:disabled {
  border-color: #c9d3e2;
  background: #d7dee8;
  color: #738399;
  cursor: not-allowed;
}

.secondary {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
}

.ghost {
  border: 0;
  background: transparent;
  color: var(--blue);
}

.wide {
  width: 100%;
}

.actions-panel {
  display: grid;
  gap: 10px;
}

.modal-layer {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(12, 23, 38, 0.55);
  padding: 24px;
}

.modal-layer.hidden {
  display: none;
}

.summary-modal {
  width: min(1240px, calc(100vw - 48px));
  height: calc(100vh - 48px);
  max-height: calc(100vh - 48px);
  display: grid;
  grid-template-rows: auto auto auto 1fr auto;
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--modal-shadow);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 24px 28px 12px;
}

.modal-header h2 {
  margin-bottom: 6px;
  font-size: 23px;
}

.modal-header p {
  margin-bottom: 0;
  color: var(--muted);
}

.icon-button {
  border: 0;
  background: transparent;
  color: var(--muted);
}

.tabs {
  display: flex;
  gap: 24px;
  padding: 0 28px;
  border-bottom: 1px solid var(--line);
}

.tab {
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 10px 0;
  font-weight: 650;
  border-bottom: 2px solid transparent;
}

.tab.active {
  color: var(--text);
  border-bottom-color: var(--blue);
}

.meta-strip {
  display: flex;
  gap: 22px;
  align-items: center;
  padding: 12px 28px;
  color: #34455c;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}

.ai-note {
  margin-left: auto;
}

.modal-body {
  min-height: 0;
  overflow: hidden;
}

.tab-panel {
  display: none;
  height: 100%;
  min-height: 0;
}

.tab-panel.active {
  display: grid;
}

#previewTab {
  grid-template-columns: 1fr 330px;
}

.note-sections {
  min-height: 0;
  overflow: auto;
  padding: 18px 22px 18px 28px;
  border-right: 1px solid var(--line);
}

.summary-section {
  position: relative;
  display: grid;
  grid-template-columns: 38px 1fr auto;
  gap: 14px;
  padding: 18px 18px 16px 0;
  border-bottom: 1px solid #e8eef6;
}

.summary-index {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  background: #f1f5fa;
  border: 1px solid #d9e2ef;
  border-radius: var(--radius);
  color: #41536b;
  font-weight: 800;
}

.small-label {
  margin: 0 0 8px;
  color: #34455c;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.summary-copy {
  margin: 0;
  color: #0f172a;
  font-size: 21px;
  font-weight: 680;
  line-height: 1.35;
  letter-spacing: -0.02em;
}

.section-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.mini-button {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--blue);
  padding: 0 10px;
  font-weight: 650;
}

.pill,
.status-pill,
.status {
  display: inline-flex;
  align-items: center;
  width: max-content;
  border-radius: 999px;
  padding: 4px 9px;
  font-size: 12px;
  font-weight: 800;
}

.status-pill {
  margin-top: 10px;
}

.status-pill::before,
.status::before {
  content: "";
  width: 7px;
  height: 7px;
  margin-right: 6px;
  border-radius: 50%;
  background: var(--faint);
}

.accepted {
  color: var(--green);
  background: var(--green-soft);
}

.accepted::before {
  background: var(--green);
}

.ready {
  color: var(--blue);
  background: var(--blue-soft);
}

.ready::before {
  background: var(--blue);
}

.partial,
.pending,
.edit {
  color: var(--amber);
  background: var(--amber-soft);
}

.partial::before,
.pending::before,
.edit::before {
  background: var(--amber);
}

.rejected {
  color: var(--red);
  background: var(--red-soft);
}

.rejected::before {
  background: var(--red);
}

.review-card {
  min-height: 0;
  padding: 22px;
  overflow: auto;
}

.review-card h3 {
  font-size: 17px;
}

.progress-counts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 14px;
}

.progress-counts div {
  border: 1px solid var(--soft-line);
  border-radius: var(--radius);
  padding: 12px;
  background: var(--surface);
}

.progress-counts strong {
  display: block;
  font-size: 22px;
}

.progress-counts span {
  color: var(--muted);
  font-size: 12px;
}

.progress-track {
  height: 8px;
  background: var(--soft-line);
  border-radius: 999px;
  overflow: hidden;
}

.progress-track span {
  display: block;
  height: 100%;
  width: 50%;
  background: var(--green);
}

.review-card h4 {
  margin: 24px 0 10px;
}

.source-summary {
  margin-bottom: 18px;
}

.source-gap-card {
  border: 1px solid #f0d4aa;
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 14px;
  background: #fff9ef;
}

.source-gap-card h4 {
  margin: 0 0 8px;
  color: #6f3d00;
}

.source-gap-card p {
  margin-bottom: 8px;
  color: #5f4a30;
  font-size: 13px;
  line-height: 1.45;
}

.source-gap-card ul {
  margin: 0;
  padding-left: 18px;
  color: #3f2f1a;
  line-height: 1.65;
  font-weight: 650;
}

.evidence-layout {
  grid-template-columns: 230px 1fr 330px;
}

.section-picker {
  min-height: 0;
  border-right: 1px solid var(--line);
  padding: 20px 14px;
  overflow: auto;
}

.picker-item {
  width: 100%;
  border: 1px solid transparent;
  background: transparent;
  border-radius: var(--radius);
  padding: 14px;
  text-align: left;
  margin-bottom: 10px;
}

.picker-item.active {
  border-color: var(--line);
  background: var(--blue-soft);
  box-shadow: inset 3px 0 0 var(--blue);
}

.picker-item strong {
  display: block;
  margin-bottom: 8px;
  line-height: 1.3;
}

.evidence-main,
.feedback-form,
.source-record {
  min-height: 0;
  padding: 22px;
  overflow: auto;
}

.evidence-main {
  border-right: 1px solid var(--line);
}

.evidence-main > h3 {
  margin-bottom: 26px;
  font-size: 18px;
  line-height: 1.45;
}

table {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid var(--soft-line);
  border-radius: var(--radius);
  overflow: hidden;
  font-size: 12px;
}

th,
td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--soft-line);
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  background: #fafbfd;
  font-size: 12px;
}

.row-action {
  min-height: 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--blue);
  padding: 0 8px;
  font-size: 12px;
  font-weight: 800;
}

.highlight-row {
  background: var(--red-soft);
}

.verification-card,
.extract-card,
.evidence-card,
.info-strip {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  margin-top: 18px;
  background: #fafbfd;
}

.source-record {
  background: #fff;
  color: var(--text);
}

.source-mode {
  display: none;
}

.source-mode.active {
  display: block;
}

.source-record h3 {
  display: inline-block;
  margin-right: 10px;
}

.source-record dd {
  max-width: 180px;
  color: var(--text);
}

.source-record dt {
  color: #4b5d75;
}

.danger-text {
  color: var(--red);
}

.extract-card p,
.verification-card p {
  margin-bottom: 0;
  color: #34455c;
  line-height: 1.5;
}

.evidence-card {
  background: #fff;
}

.evidence-card span {
  float: right;
  color: var(--muted);
}

mark {
  background: var(--blue-soft);
  color: inherit;
  border-radius: 4px;
  padding: 1px 3px;
}

.info-strip {
  background: var(--blue-soft);
  color: var(--blue);
  font-weight: 650;
}

.feedback-form fieldset {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 14px;
  margin: 16px 0;
  padding: 0;
  border: 0;
}

.feedback-form legend,
.comment-label {
  display: block;
  margin-bottom: 10px;
  font-weight: 800;
}

.feedback-form label {
  color: #34455c;
}

textarea {
  display: block;
  width: 100%;
  min-height: 92px;
  margin-top: 8px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  line-height: 1.4;
}

.feedback-form .wide {
  margin-top: 10px;
}

.source-record .wide {
  margin-top: 12px;
}

.back-inline {
  min-height: 30px;
  padding: 0;
  margin-bottom: 14px;
}

.modal-footer {
  display: grid;
  grid-template-columns: 1fr auto auto auto;
  gap: 10px;
  align-items: center;
  padding: 14px 28px;
  border-top: 1px solid var(--line);
}

.push-status {
  color: #34455c;
  font-weight: 650;
}

.push-status.blocked {
  color: var(--amber);
}

.push-status.ready {
  color: var(--green);
}

.summary-editor-overlay {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: grid;
  place-items: center;
  padding: 26px;
  background: rgba(12, 23, 38, 0.48);
}

.summary-editor-overlay.hidden {
  display: none;
}

.summary-editor-dialog {
  width: min(980px, calc(100% - 28px));
  height: min(760px, calc(100% - 28px));
  display: grid;
  grid-template-rows: auto 1fr auto;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--modal-shadow);
}

.summary-editor-header {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 22px 24px 16px;
  border-bottom: 1px solid var(--line);
}

.summary-editor-header h3 {
  margin-bottom: 6px;
  font-size: 24px;
}

.summary-editor-header p:not(.eyebrow) {
  max-width: 760px;
  margin-bottom: 0;
  color: var(--muted);
}

.summary-editor-body {
  min-height: 0;
  display: grid;
  grid-template-columns: 250px 1fr;
  gap: 18px;
  padding: 20px 24px;
  overflow: hidden;
}

.editor-context {
  min-height: 0;
  overflow: auto;
}

.editor-context h4 {
  margin: 0 0 12px;
}

.coverage-block {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 13px;
  margin-bottom: 12px;
  background: #fafbfd;
}

.coverage-block strong,
.coverage-block span {
  display: block;
}

.coverage-block strong {
  margin-bottom: 6px;
}

.coverage-block span {
  color: #34455c;
  font-size: 13px;
  line-height: 1.5;
}

.coverage-block.available {
  border-color: #c8dfd0;
  background: var(--green-soft);
}

.coverage-block.missing {
  border-color: #f0d4aa;
  background: #fff9ef;
}

.member-summary-editor-label {
  min-height: 0;
  display: flex;
  flex-direction: column;
  color: var(--text);
  font-weight: 800;
}

.member-summary-editor-label textarea {
  flex: 1;
  min-height: 0;
  margin-top: 10px;
  font-size: 14px;
  line-height: 1.55;
}

.summary-editor-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 24px;
  border-top: 1px solid var(--line);
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  transform: translateY(20px);
  opacity: 0;
  pointer-events: none;
  background: #0f172a;
  color: white;
  border-radius: var(--radius);
  padding: 14px 18px;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.3);
  transition: 160ms ease;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

@media (max-width: 1180px) {
  body {
    min-width: 960px;
  }

  .summary-copy {
    font-size: 18px;
  }
}
