:root {
  --ink: #1f2933;
  --ink-soft: #52606d;
  --border: #d9dee3;
  --surface: #ffffff;
  --surface-alt: #f4f6f8;
  --accent: #2f6fed;
  --pass: #1a7a3c;
  --pass-bg: #e6f4ea;
  --fail: #b3261e;
  --fail-bg: #fdecea;
  --warn: #8a6d00;
  --warn-bg: #fff6da;
  --radius: 8px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  background: var(--surface-alt);
  line-height: 1.5;
}

.topbar {
  background: var(--ink);
  color: white;
  padding: 14px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

.topbar .brand {
  color: white;
  text-decoration: none;
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 0.01em;
}

.topbar nav a {
  color: #cbd2d9;
  text-decoration: none;
  margin-left: 20px;
  font-size: 0.9rem;
}

.topbar nav a:hover { color: white; }

.container {
  max-width: 980px;
  margin: 0 auto;
  padding: 28px 24px 64px;
}

h1 { font-size: 1.5rem; margin: 0 0 4px; }
h2 { font-size: 1.15rem; margin: 32px 0 12px; border-top: 1px solid var(--border); padding-top: 20px; }
h2:first-of-type { border-top: none; padding-top: 0; }
.subtitle { color: var(--ink-soft); margin: 0 0 24px; font-size: 0.92rem; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin-bottom: 20px;
}

.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table-wrap table { width: 100%; border-collapse: collapse; font-size: 0.9rem; white-space: nowrap; }
.table-wrap th, .table-wrap td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--border); }
.table-wrap td { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.table-wrap th:first-child,
.table-wrap td:first-child {
  position: sticky;
  left: 0;
  z-index: 1;
  background: var(--surface);
  border-right: 2px solid var(--border);
}
.table-wrap th:first-child {
  z-index: 2;
  background: var(--ink);
}
.table-wrap tbody tr:nth-child(even) td:first-child {
  background: var(--surface-alt);
}
th { background: var(--ink); color: white; font-weight: 600; font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.02em; }
tr:nth-child(even) td { background: var(--surface-alt); }
tfoot td { font-weight: 700; border-top: 2px solid var(--ink); }

.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
}
.badge-pass { color: var(--pass); background: var(--pass-bg); }
.badge-fail { color: var(--fail); background: var(--fail-bg); }
.badge-warn { color: var(--warn); background: var(--warn-bg); }
.badge-weight-missing { color: #5b3f8e; background: #efe7fb; border: 1px solid #d9c8f2; }

.flash-stack { margin-bottom: 20px; display: flex; flex-direction: column; gap: 8px; }
.flash { padding: 10px 14px; border-radius: var(--radius); font-size: 0.9rem; border: 1px solid transparent; }
.flash-success { background: var(--pass-bg); color: var(--pass); border-color: #bfe3c9; }
.flash-error { background: var(--fail-bg); color: var(--fail); border-color: #f3c6c2; }
.flash-warning { background: var(--warn-bg); color: var(--warn); border-color: #ecdd9c; }

.compliance-banner {
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 24px;
  border: 1px solid transparent;
}
.compliance-banner.pass { background: var(--pass-bg); border-color: #bfe3c9; color: var(--pass); }
.compliance-banner.fail { background: var(--fail-bg); border-color: #f3c6c2; color: var(--fail); }
.compliance-banner h3 { margin: 0 0 8px; font-size: 1rem; }
.compliance-banner ul { margin: 6px 0 0; padding-left: 20px; }

form.stacked label { display: block; font-size: 0.85rem; font-weight: 600; margin: 14px 0 5px; color: var(--ink-soft); }
form.stacked label:first-of-type { margin-top: 0; }
form.stacked input[type="text"],
form.stacked input[type="file"],
form.stacked select,
form.stacked textarea {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.92rem;
  font-family: inherit;
  background: white;
  color: var(--ink);
}
form.stacked textarea { min-height: 70px; resize: vertical; }
form.stacked .hint { font-size: 0.78rem; color: var(--ink-soft); margin-top: 3px; font-weight: 400; }

.btn {
  display: inline-block;
  padding: 9px 18px;
  border-radius: 6px;
  border: none;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  margin-top: 16px;
}
.btn-primary { background: var(--accent); color: white; }
.btn-primary:hover { background: #2557c4; }
.btn-secondary { background: var(--ink); color: white; }
.btn-secondary:hover { background: #10171d; }
.btn-download { background: var(--pass); color: white; }
.btn-danger { background: var(--fail); color: white; }
.btn-danger:hover { background: #8b1a14; }

.empty-state { text-align: center; padding: 48px 20px; color: var(--ink-soft); }
.empty-state .btn { margin-top: 20px; }

.meta-row { color: var(--ink-soft); font-size: 0.88rem; margin-bottom: 6px; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
@media (max-width: 760px) { .two-col { grid-template-columns: 1fr; } }
