:root {
  color-scheme: light;
  --bg: #f7f8fa;
  --surface: #ffffff;
  --surface-muted: #f2f5f6;
  --text: #162025;
  --muted: #66737c;
  --border: #dfe5e8;
  --border-strong: #c8d1d6;
  --teal: #0f9b8e;
  --amber: #c98212;
  --red: #cf3f35;
  --slate: #5f6f7a;
  --green-bg: #e6f5ef;
  --green-text: #146b45;
  --red-bg: #fae8e6;
  --red-text: #9c2d25;
  --shadow: 0 12px 36px rgba(27, 39, 49, 0.06);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

a {
  color: inherit;
}

button,
input {
  font: inherit;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 252px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 24px 18px;
  background: #fbfcfd;
  border-right: 1px solid var(--border);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 8px 24px;
}

.brand-title {
  font-weight: 720;
  letter-spacing: 0;
}

.brand-subtitle {
  margin-top: 2px;
  color: var(--muted);
  font-size: 13px;
}

.nav-list {
  display: grid;
  gap: 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 0 10px;
  border-radius: 8px;
  color: #314047;
  text-decoration: none;
  font-size: 15px;
}

.nav-item:hover,
.nav-item.active {
  background: #edf3f4;
}

.dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  flex: 0 0 auto;
}

.dot-teal {
  background: var(--teal);
}

.dot-amber {
  background: var(--amber);
}

.dot-red {
  background: var(--red);
}

.dot-slate {
  background: var(--slate);
}

.main {
  min-width: 0;
  padding: 28px 32px 56px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  margin-bottom: 28px;
}

.topbar h1 {
  max-width: 900px;
  margin: 3px 0 0;
  font-size: 26px;
  line-height: 1.2;
  letter-spacing: 0;
}

.topbar-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
  color: var(--muted);
  font-size: 13px;
}

.topbar-meta span {
  padding: 6px 9px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
}

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

.view {
  display: none;
}

.view.active {
  display: block;
}

.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 18px;
}

.section-heading h2 {
  margin: 4px 0 0;
  font-size: 30px;
  line-height: 1.16;
  letter-spacing: 0;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 20px;
  margin-bottom: 18px;
}

.panel-header {
  margin-bottom: 16px;
}

.panel-header h3 {
  margin: 0;
  font-size: 18px;
  letter-spacing: 0;
}

.panel-header p,
.muted {
  margin: 6px 0 0;
  color: var(--muted);
}

.metric-grid,
.score-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.metric-card,
.score-card {
  min-height: 116px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 10px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fbfcfd;
}

.metric-card strong,
.score-card strong {
  font-size: 26px;
  line-height: 1.12;
  letter-spacing: 0;
}

.metric-card span:last-child,
.score-card span {
  color: var(--muted);
  font-size: 13px;
}

.task-summary {
  margin: 16px 0 0;
  padding: 12px 14px;
  border-left: 3px solid var(--teal);
  background: #f0f7f7;
  color: #25343a;
}

.workflow {
  display: grid;
  grid-template-columns: 1.2fr auto 1.2fr auto 1.2fr auto 1.2fr auto 1fr auto 1fr;
  align-items: center;
  gap: 10px;
}

.workflow-step {
  min-height: 78px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fbfcfd;
}

.arrow {
  color: var(--muted);
  font-weight: 720;
}

.two-column {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(380px, 1.1fr);
  gap: 18px;
  align-items: start;
}

.stack {
  display: grid;
  gap: 18px;
}

blockquote {
  margin: 0;
  padding: 16px;
  border-left: 3px solid var(--amber);
  background: #fff8ed;
  border-radius: 0 8px 8px 0;
  color: #2c2a24;
}

.plain-list {
  margin: 0;
  padding-left: 20px;
}

.plain-list li {
  margin: 10px 0;
}

.document-list {
  display: grid;
  gap: 6px;
  max-height: 390px;
  margin: 0 0 16px;
  padding: 0;
  overflow: auto;
  list-style: none;
}

.document-list li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.document-button {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  width: 100%;
  min-height: 40px;
  padding: 9px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.document-button:hover,
.document-button.active {
  border-color: #b8c7cc;
  background: #edf7f6;
}

.document-button .dot {
  margin-top: 6px;
}

.document-original {
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted);
  font-size: 12px;
  text-decoration: none;
}

.document-original:hover {
  border-color: var(--border-strong);
  color: var(--text);
}

.document-preview-shell {
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}

.preview-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  background: #f7f9fa;
}

.original-link,
.deliverable-link {
  color: #0b6f87;
  text-decoration: none;
  font-weight: 650;
}

.original-link:hover,
.deliverable-link:hover {
  text-decoration: underline;
}

#document-preview {
  display: block;
  width: 100%;
  height: 560px;
  border: 0;
  background: #fff;
}

.score-card:first-child strong {
  color: var(--red);
}

.toolbar {
  display: grid;
  grid-template-columns: minmax(260px, 360px) minmax(0, 1fr);
  gap: 14px;
  align-items: end;
  margin-bottom: 14px;
}

.search {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}

.search input {
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.filter {
  min-height: 34px;
  padding: 0 11px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #fff;
  color: #314047;
  cursor: pointer;
}

.filter:hover,
.filter.active {
  border-color: #b8c7cc;
  background: #edf3f4;
}

.table-panel {
  padding-bottom: 14px;
}

.table-wrap {
  overflow: auto;
  max-height: calc(100vh - 310px);
  border: 1px solid var(--border);
  border-radius: 8px;
}

table {
  width: 100%;
  min-width: 1280px;
  border-collapse: separate;
  border-spacing: 0;
  background: #fff;
}

th,
td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--border);
  border-right: 1px solid var(--border);
  vertical-align: top;
  text-align: left;
  font-size: 13px;
}

th:last-child,
td:last-child {
  border-right: 0;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f5f7f8;
  color: #425059;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

tbody tr:hover {
  background: #fbfcfd;
}

.col-id {
  width: 74px;
  font-weight: 720;
}

.col-category {
  width: 138px;
}

.col-issue {
  width: 230px;
  font-weight: 650;
}

.col-deliverable {
  width: 170px;
}

.col-condition {
  min-width: 270px;
}

.col-verdict {
  width: 96px;
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 58px;
  height: 26px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 720;
}

.badge-pass {
  background: var(--green-bg);
  color: var(--green-text);
}

.badge-fail {
  background: var(--red-bg);
  color: var(--red-text);
}

.category-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
}

.table-note {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.empty-row td {
  padding: 28px;
  text-align: center;
  color: var(--muted);
}

@media (max-width: 1020px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 18px;
  }

  .nav-list {
    display: flex;
    flex-wrap: wrap;
  }

  .main {
    padding: 20px;
  }

  .metric-grid,
  .score-grid,
  .two-column,
  .toolbar {
    grid-template-columns: 1fr;
  }

  .workflow {
    grid-template-columns: 1fr;
  }

  .arrow {
    display: none;
  }

  .topbar {
    flex-direction: column;
  }
}
