:root {
  --bg: #f4f7f9;
  --surface: #ffffff;
  --surface-alt: #f8fafc;
  --text: #0f172a;
  --ink: #14231f;
  --muted: #64748b;
  --border: #dbe3ea;
  --line: rgba(20, 35, 31, 0.12);
  --brand: #0f766e;
  --brand-soft: #d8f3f1;
  --danger: #b91c1c;
  --warning: #d97706;
  --good: #15803d;
  --critical-soft: #fee2e2;
  --radius: 10px;
  --shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  font-family: "Segoe UI", Tahoma, sans-serif;
  color: var(--text);
  background: var(--bg);
}

body {
  min-height: 100vh;
}

.shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
}

.sidebar {
  background:
    linear-gradient(180deg, #113629 0%, #174d39 100%);
  color: #f6f8f5;
  padding: 24px 18px 28px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.brand {
  display: grid;
  gap: 10px;
}

.brand h1 {
  margin: 0;
  font-size: 28px;
  line-height: 1.05;
  color: #f8fbf8;
}

.brand p {
  margin: 0;
  color: rgba(246, 248, 245, 0.84);
}

.dashboard-nav {
  display: grid;
  gap: 8px;
}

.dashboard-link {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 2px 0;
  color: rgba(246, 248, 245, 0.78);
  text-decoration: none;
  font-size: 15px;
  line-height: 1.4;
  border-bottom: 1px solid transparent;
}

.dashboard-link:hover,
.dashboard-link:focus-visible {
  color: #ffffff;
  border-bottom-color: rgba(255, 255, 255, 0.55);
}

.dashboard-link.active {
  color: #ffffff;
  font-weight: 700;
  border-bottom-color: rgba(255, 255, 255, 0.72);
}

.sidebar .eyebrow,
.sidebar .metric-label {
  color: rgba(222, 235, 230, 0.72);
}

.sidebar .metric-card,
.sidebar .sidebar-section {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 14px 14px 16px;
  box-shadow: none;
}

.sidebar .metric-card strong,
.sidebar .sidebar-section strong {
  color: #ffffff;
}

.main {
  min-width: 0;
  background:
    radial-gradient(circle at top center, rgba(104, 170, 205, 0.12), transparent 28%),
    linear-gradient(180deg, #f4f7fa 0%, #eef2f5 100%);
  padding: 0;
}

.topbar {
  padding: 22px 28px 24px;
  border-bottom: 1px solid rgba(20, 35, 31, 0.1);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.topbar h2 {
  margin: 6px 0 0;
  font-size: 44px;
  line-height: 1.02;
  letter-spacing: -0.04em;
  color: #0c3352;
}

.topbar .eyebrow {
  color: #4f6a80;
}

.topbar .muted {
  color: #5f7488;
}

.app-header {
  height: 64px;
  background: var(--brand);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 16px;
}

.app-header h1 {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
}

.app-header-title {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.app-header-subtitle {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.82);
}

.app-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.view-switch {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn,
input,
select,
textarea,
button {
  font: inherit;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  border-radius: 8px;
  padding: 7px 12px;
  font-size: 12px;
  cursor: pointer;
  text-decoration: none;
}

.btn.primary {
  background: #fff;
  color: var(--brand);
  border-color: #b2dfdb;
  font-weight: 700;
}

.switch-btn {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.35);
}

.switch-btn.active {
  background: #fff;
  color: var(--brand);
  border-color: #fff;
  font-weight: 700;
}

.filter-bar {
  min-height: 52px;
  background: #f1f5f9;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 14px;
  flex-wrap: wrap;
}

.filter-select {
  min-width: 220px;
  padding: 0.65rem 0.85rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--ink);
  font: inherit;
}

.filter-block {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.filter-grow {
  flex: 1 1 320px;
}

.filter-label,
.eyebrow {
  font-size: 12px;
  color: var(--muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.filter-meta,
.muted,
.queue-item small,
.queue-item p,
.card p,
.data-list dt {
  color: var(--muted);
}

.filter-divider {
  width: 1px;
  height: 24px;
  background: #cbd5e1;
  margin: 0 2px;
}

.status-pill,
.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  border: 1px solid transparent;
}

.status-pill.live,
.pill.low {
  background: var(--brand-soft);
  color: var(--brand);
}

.status-pill.version {
  background: #fff;
  color: #334155;
  border-color: #cbd5e1;
}

.pill.medium {
  background: #fff1da;
  color: var(--warning);
}

.pill.high {
  background: #fee2e2;
  color: var(--danger);
}

.pill.critical {
  background: var(--critical-soft);
  color: var(--danger);
}

.check-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  border: 1px solid transparent;
}

.check-pill.pass {
  background: var(--brand-soft);
  color: var(--brand);
}

.check-pill.fail {
  background: #fee2e2;
  color: var(--danger);
}

.check-pill.na {
  background: #f1f5f9;
  color: #475569;
  border-color: #cbd5e1;
}

.stats-inline {
  gap: 10px;
}

.stat-chip {
  display: inline-flex;
  align-items: baseline;
  gap: 7px;
  padding: 6px 10px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--border);
  color: #334155;
}

.stat-chip strong {
  font-size: 13px;
  color: var(--text);
}

.stat-chip span {
  font-size: 12px;
}

.collections-layout {
  display: flex;
  height: calc(100vh - 64px - 52px);
}

.feed-col {
  width: 390px;
  min-width: 320px;
  border-right: 1px solid var(--border);
  overflow-y: auto;
  background: var(--surface);
}

.detail-col {
  flex: 1;
  min-width: 0;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.feed-header,
.case-header,
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.feed-header {
  padding: 14px 16px;
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.feed-header h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
}

.queue-list {
  padding: 0;
}

.queue-item {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  background: var(--surface);
}

.queue-item:hover,
.queue-item.active {
  background: #eef6f5;
}

.queue-item-head,
.case-title,
.version-row-head,
.finding-actions,
.topbar-right,
.legend {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.queue-item p,
.card p,
.queue-item small {
  margin: 6px 0 0;
}

.queue-empty {
  padding: 18px 16px;
  color: var(--muted);
}

.case-header {
  padding: 18px 20px;
}

.collections-header {
  min-height: 148px;
}

.case-title h3 {
  margin: 4px 0 0;
  font-size: 28px;
  line-height: 1.05;
}

.case-title {
  align-items: flex-start;
}

.case-title-copy {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.case-subtitle,
.case-meta {
  color: var(--muted);
}

.case-subtitle {
  font-size: 15px;
}

.case-meta {
  font-size: 13px;
  line-height: 1.45;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.collections-score-strip,
.score-strip {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
}

.score-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px 16px;
}

.metric-label {
  display: block;
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.score-box strong {
  display: block;
  margin-top: 8px;
  font-size: 30px;
  line-height: 1.05;
  overflow-wrap: anywhere;
}

.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.grid.notes-grid {
  align-items: start;
}

.grid > .card:only-child,
.grid > .card:nth-child(3):last-child {
  grid-column: span 2;
}

.card {
  padding: 14px 16px;
}

.card h3 {
  margin: 0 0 12px;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.data-list {
  display: grid;
  grid-template-columns: 190px 1fr;
  gap: 8px 12px;
  margin: 0;
}

.data-list dd {
  margin: 0;
  color: var(--text);
  font-weight: 600;
}

.domain-scores,
.findings,
.notes-list,
.plain-list,
.checks-stack,
.check-list {
  display: grid;
  gap: 12px;
}

.domain-row,
.finding,
.note,
.pathway-card {
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-alt);
}

.domain-row strong,
.finding h4,
.note h4,
.check-name {
  color: var(--text);
}

.domain-row ul,
.finding ul,
.note ul,
.plain-list {
  margin: 8px 0 0 18px;
  padding: 0;
}

.finding-status {
  font-size: 12px;
  color: var(--muted);
  margin-top: 8px;
}

.finding-actions {
  margin-top: 12px;
  flex-wrap: wrap;
  justify-content: flex-start;
}

input,
select,
textarea,
button {
  width: 100%;
}

input,
select,
textarea {
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  border-radius: 8px;
  padding: 10px 12px;
}

textarea {
  resize: vertical;
}

label {
  display: block;
  margin-top: 10px;
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
}

.pathway-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.check-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.check-row:first-child {
  padding-top: 0;
  border-top: 0;
}

.check-name {
  font-weight: 700;
  margin-bottom: 4px;
}

.check-matrix,
.matrix-header {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.matrix-header {
  margin: 12px 0 0;
  font-size: 12px;
  color: var(--muted);
}

.matrix-pill {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  padding: 8px 10px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--border);
  font-size: 12px;
  text-align: center;
}

.checks-layout {
  padding: 16px;
  display: grid;
  gap: 14px;
}

@media (max-width: 1200px) {
  .collections-score-strip,
  .score-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 1100px) {
  .shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    border-right: 0;
    border-bottom: 1px solid rgba(20, 35, 31, 0.1);
  }

  .collections-layout,
  .grid,
  .pathway-grid,
  .check-row,
  .check-matrix,
  .matrix-header {
    grid-template-columns: 1fr;
  }

  .collections-layout {
    display: block;
    height: auto;
  }

  .feed-col {
    width: 100%;
    min-width: 0;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }
}

@media (max-width: 760px) {
  .topbar {
    padding: 18px 14px;
    flex-direction: column;
  }

  .topbar h2 {
    font-size: 34px;
  }

  .app-header,
  .filter-bar {
    height: auto;
    padding: 12px;
    align-items: flex-start;
  }

  .app-header,
  .app-header-actions,
  .filter-bar,
  .filter-block,
  .view-switch {
    flex-direction: column;
    width: 100%;
  }

  .filter-divider {
    display: none;
  }

  .severity-filters.horizontal {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
}

.severity-filters.horizontal {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.severity-filter {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: #fff;
  border: 1px solid var(--border);
  color: #334155;
  border-radius: 999px;
  padding: 8px 12px;
  min-width: 112px;
}

.severity-filter:hover,
.severity-filter.active {
  background: var(--brand-soft);
  border-color: #5bb5ac;
  color: #115e59;
}

.severity-filter-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.severity-filter-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

.severity-filter-dot.all {
  background: #94a3b8;
}

.severity-filter-dot.low {
  background: var(--good);
}

.severity-filter-dot.medium {
  background: var(--warning);
}

.severity-filter-dot.high {
  background: #ef4444;
}

.severity-filter-dot.critical {
  background: #f87171;
}

.severity-filter-count {
  font-size: 12px;
  color: var(--muted);
}
