:root {
  --ink: #1c1915;
  --muted: #5e584f;
  --paper: #f3efe6;
  --card: #fffdf8;
  --line: #ddd4c4;
  --red: #9f1d1d;
  --red-bg: #f8e4e1;
  --yellow: #8a5a00;
  --yellow-bg: #f8efd2;
  --green: #1d6b3a;
  --green-bg: #e3f3e7;
  --gray: #5c6570;
  --gray-bg: #eceff2;
  --accent: #9f1d1d;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font: 16px/1.45 "Segoe UI", "Helvetica Neue", sans-serif;
  color: var(--ink);
  background: var(--paper);
}
a { color: inherit; }
.top {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  padding: 14px 18px;
  background: #221e1a;
  color: #f6f1e8;
}
.brand { font-weight: 700; text-decoration: none; letter-spacing: 0.01em; }
nav { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
nav a, button.link {
  color: #f6f1e8;
  text-decoration: none;
  background: none;
  border: 0;
  font: inherit;
  cursor: pointer;
  padding: 0;
}
main { padding: 18px; max-width: 980px; margin: 0 auto; }
h1 { font-size: 1.6rem; margin: 0 0 8px; }
h2 { font-size: 1.15rem; margin: 22px 0 8px; }
.muted { color: var(--muted); }
.narrow { max-width: 460px; }
.stack { display: grid; gap: 12px; }
label { display: grid; gap: 4px; font-weight: 600; }
input, select, textarea, button {
  font: inherit;
  color: var(--ink);
}
input, select, textarea {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}
button, .button {
  display: inline-block;
  padding: 12px 16px;
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: white;
  text-decoration: none;
  font-weight: 700;
  cursor: pointer;
}
.error { background: var(--red-bg); color: var(--red); padding: 10px 12px; border-radius: 8px; }
.note { background: var(--yellow-bg); color: #5c3b00; padding: 10px 12px; border-radius: 8px; }
.stats { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin: 14px 0; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 10px; }
.stat b { display: block; font-size: 1.4rem; }
.stat span { color: var(--muted); font-size: 0.85rem; }
.stat.red b { color: var(--red); }
.stat.yellow b { color: var(--yellow); }
.stat.green b { color: var(--green); }
.stat.gray b { color: var(--gray); }
.filters { display: flex; gap: 8px; margin-bottom: 14px; }
.filters input, .filters select { flex: 1; }
.list { display: grid; gap: 8px; }
.item {
  display: block;
  background: var(--card);
  border: 1px solid var(--line);
  border-left: 6px solid var(--gray);
  border-radius: 10px;
  padding: 12px;
  text-decoration: none;
}
.item.red { border-left-color: var(--red); }
.item.yellow { border-left-color: var(--yellow); }
.item.green { border-left-color: var(--green); }
.item-top { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.badge { border-radius: 999px; padding: 2px 8px; font-size: 0.8rem; background: var(--gray-bg); color: var(--gray); }
.badge.red { background: var(--red-bg); color: var(--red); }
.badge.yellow { background: var(--yellow-bg); color: var(--yellow); }
.badge.green { background: var(--green-bg); color: var(--green); }
fieldset { border: 1px solid var(--line); border-radius: 10px; padding: 8px; display: grid; gap: 6px; }
legend { font-weight: 700; padding: 0 4px; }
.choice { font-weight: 500; }
.choice input { width: auto; margin-right: 8px; }
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 16px; }
.facts div { background: var(--card); border-radius: 8px; padding: 8px 10px; }
dt { color: var(--muted); font-size: 0.8rem; }
dd { margin: 0; font-weight: 650; }
.reasons { margin: 8px 0 16px; }
.journal { background: var(--card); border-radius: 10px; padding: 10px 12px; margin-bottom: 8px; }
.row-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 8px 0 16px; }
.row-actions form { margin: 0; }
a.button.secondary, button.secondary { background: #3d3832; }
.back { margin-top: 0; }
.sheet { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.sticker {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  border: 1px dashed #8a8175;
  border-radius: 8px;
  padding: 10px;
  background: white;
  min-height: 150px;
}
.sticker svg { width: 116px; height: 116px; }
.scan { margin-top: 8px; font-weight: 700; }
.kicker { text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); font-size: 0.75rem; margin-bottom: 0; }
@media (max-width: 720px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .filters, .facts, .sheet { display: grid; grid-template-columns: 1fr; }
  .top { align-items: flex-start; flex-direction: column; }
}
@media print {
  .top, .screen-only { display: none !important; }
  body, main { background: white; margin: 0; padding: 0; max-width: none; }
  .sheet { grid-template-columns: 1fr 1fr; }
  .sticker { break-inside: avoid; }
}
