:root {
  --ink: #17201b;
  --muted: #66746c;
  --line: #d9e2dc;
  --panel: #ffffff;
  --soft: #f3f7f4;
  --soft-2: #edf2f6;
  --brand: #1f7a55;
  --brand-dark: #135f41;
  --warn: #b86d19;
  --bad: #b93d3d;
  --good: #238a63;
  --shadow: 0 16px 40px rgba(23, 32, 27, 0.1);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: #eef4f0;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

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

.sidebar {
  background: #18382b;
  color: #f8fbf9;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

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

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: #fff;
  color: #18382b;
  font-weight: 800;
}

.brand-title {
  margin: 0;
  font-size: 18px;
  line-height: 1.1;
}

.brand-subtitle {
  margin: 2px 0 0;
  color: #c9d8cf;
  font-size: 13px;
}

.nav {
  display: grid;
  gap: 8px;
}

.nav button {
  color: #eaf1ed;
  background: transparent;
  padding: 12px;
  border-radius: 8px;
  text-align: left;
}

.nav button.active,
.nav button:hover {
  background: rgba(255, 255, 255, 0.12);
}

.user-box {
  margin-top: auto;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.18);
  display: grid;
  gap: 10px;
  color: #d8e6de;
  font-size: 14px;
}

.content {
  padding: 28px;
  overflow: auto;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-bottom: 22px;
}

.topbar.compact {
  margin-bottom: 12px;
}

.page-title {
  margin: 0;
  font-size: 30px;
  line-height: 1.1;
}

.page-note {
  color: var(--muted);
  margin: 6px 0 0;
}

.toolbar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.toolbar input {
  min-width: 220px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  font: inherit;
}

.btn {
  background: var(--brand);
  color: white;
  padding: 11px 15px;
  border-radius: 8px;
  font-weight: 700;
}

.btn:hover {
  background: var(--brand-dark);
}

.btn:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

.btn.secondary {
  background: #e1ebe5;
  color: var(--ink);
}

.btn.small {
  padding: 7px 10px;
  font-size: 12px;
}

.btn.ghost {
  background: transparent;
  color: #f8fbf9;
  border: 1px solid rgba(255, 255, 255, 0.28);
}

.grid {
  display: grid;
  gap: 16px;
}

.grid.cols-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid.cols-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.metric,
.panel,
.item-card,
.login-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.metric {
  padding: 18px;
}

.metric-label {
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 8px;
}

.metric-value {
  font-size: 32px;
  font-weight: 800;
}

.panel {
  padding: 18px;
}

.panel h2,
.panel h3 {
  margin: 0 0 14px;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

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

.table th {
  color: var(--muted);
  font-weight: 700;
}

.status {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 5px 9px;
  font-size: 12px;
  font-weight: 800;
  background: #e8efe9;
  color: #315541;
}

.status.warn {
  background: #fff0d9;
  color: #87510f;
}

.status.bad {
  background: #ffe2e2;
  color: #8d2525;
}

.status.good {
  background: #dbf4e9;
  color: #176446;
}

.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: linear-gradient(135deg, #18382b 0%, #eef4f0 72%);
}

.login-card {
  width: min(100%, 440px);
  padding: 28px;
}

.login-card h1 {
  margin: 0 0 8px;
  font-size: 30px;
}

.form {
  display: grid;
  gap: 14px;
}

.field {
  display: grid;
  gap: 7px;
}

.field span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 12px;
  background: #fff;
  color: var(--ink);
}

.field textarea {
  resize: vertical;
  min-height: 82px;
}

.store-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}

.item-card {
  padding: 16px;
  display: grid;
  gap: 10px;
}

.item-card h3 {
  margin: 0;
  font-size: 17px;
}

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

.audit-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 16px;
  align-items: start;
}

.question {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  display: grid;
  gap: 12px;
}

.question-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
}

.question-title {
  font-weight: 800;
}

.segmented {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

.segmented.binary {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.segmented button {
  padding: 10px 6px;
  border-radius: 8px;
  background: var(--soft-2);
  color: var(--ink);
  font-weight: 700;
}

.segmented button.active {
  background: var(--brand);
  color: white;
}

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

.attachment {
  border: 1px solid var(--line);
  background: var(--soft);
  border-radius: 8px;
  padding: 7px;
  font-size: 12px;
  margin: 0;
  width: 116px;
}

.attachment img,
.attachment video {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 6px;
  display: block;
  background: #dfe8e2;
}

.attachment figcaption {
  margin-top: 6px;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.file-chip {
  min-height: 58px;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 6px;
}

.evidence {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.evidence-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.summary-box {
  position: sticky;
  top: 18px;
}

.score-ring {
  width: 136px;
  height: 136px;
  border-radius: 50%;
  margin: 8px auto 16px;
  display: grid;
  place-items: center;
  background: conic-gradient(var(--brand) var(--score), #e1ebe5 0);
}

.score-ring > div {
  width: 104px;
  height: 104px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: white;
  font-size: 30px;
  font-weight: 900;
}

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

.report-header {
  background: #18382b;
  color: white;
  border-radius: 8px;
  padding: 22px;
  display: flex;
  justify-content: space-between;
  gap: 18px;
}

.report-header h1 {
  margin: 0;
}

.hidden {
  display: none !important;
}

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

  .sidebar {
    position: static;
  }

  .audit-layout,
  .grid.cols-2,
  .grid.cols-3 {
    grid-template-columns: 1fr;
  }

  .topbar,
  .report-header {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media print {
  body {
    background: white;
  }

  .sidebar,
  .topbar .toolbar,
  .no-print {
    display: none !important;
  }

  .shell {
    display: block;
  }

  .content {
    padding: 0;
  }

  .panel,
  .metric,
  .item-card {
    box-shadow: none;
  }
}
