:root {
  --bg: #f3f0ea;
  --panel: #fffdf8;
  --ink: #1c1a16;
  --muted: #5c564c;
  --line: #d9d2c5;
  --accent: #0f5c4c;
  --accent-hover: #0a463a;
  --danger: #8b2e2e;
  --warn-bg: #fff4d6;
  --ok-bg: #e4f3ec;
  --multi-bg: #e8eef8;
  --disabled: #a8a29a;
  --font: "Segoe UI", "Candara", "Calibri", sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(circle at top left, #e7efe9 0, transparent 40%),
    linear-gradient(180deg, #efe9df, var(--bg));
  min-height: 100vh;
}

.wrap {
  width: min(1100px, calc(100% - 2rem));
  margin: 0 auto;
}

.site-header {
  border-bottom: 1px solid var(--line);
  background: rgba(255, 253, 248, 0.9);
  backdrop-filter: blur(6px);
  padding: 1rem 0;
  margin-bottom: 1.5rem;
}

.brand {
  color: var(--ink);
  text-decoration: none;
  font-size: 1.25rem;
  font-weight: 700;
}

.meta {
  margin: 0.25rem 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.25rem;
  box-shadow: 0 8px 24px rgba(28, 26, 22, 0.04);
}

.panel-secondary { background: #faf7f1; }

h1, h2 { margin-top: 0; }

.lead, .hint { color: var(--muted); }

.product-label {
  margin: -0.35rem 0 1.1rem;
  font-size: 1.05rem;
  line-height: 1.45;
  color: var(--muted);
}

.search-form label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.4rem;
}

.search-row {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

input[type="text"] {
  flex: 1 1 220px;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  font: inherit;
  background: #fff;
}

.btn {
  display: inline-block;
  border: none;
  border-radius: 8px;
  padding: 0.7rem 1rem;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-primary:hover { background: var(--accent-hover); }

.btn-danger {
  background: var(--danger);
  color: #fff;
}

.btn-small {
  padding: 0.35rem 0.7rem;
  font-size: 0.85rem;
}

.btn-disabled,
.btn:disabled {
  background: #e5e1d8;
  color: var(--disabled);
  cursor: not-allowed;
}

.banner {
  padding: 0.75rem 1rem;
  border-radius: 8px;
  font-weight: 600;
}

.banner-multi { background: var(--multi-bg); }
.banner-single { background: #f2efe8; }
.banner-ok { background: var(--ok-bg); }

.table-wrap { overflow-x: auto; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

th, td {
  text-align: left;
  padding: 0.7rem 0.55rem;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

th {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--muted);
}

code {
  font-family: Consolas, "Courier New", monospace;
  font-size: 0.9em;
}

.empty { font-size: 1.05rem; }

.flash-list, .warn-list {
  list-style: none;
  padding: 0;
}

.flash {
  padding: 0.65rem 0.85rem;
  border-radius: 8px;
  margin-bottom: 0.5rem;
}

.flash-warning, .flash-error { background: #fdeceb; }
.flash-ok { background: var(--ok-bg); }

.warn-list li {
  padding: 0.45rem 0;
  border-bottom: 1px dashed var(--line);
  color: var(--muted);
}

.back a { color: var(--accent); }
.actions { margin-top: 1.25rem; }

.lot-link {
  color: var(--accent);
  font-weight: 700;
  text-decoration: none;
}

.lot-link:hover { text-decoration: underline; }

.lot-row {
  cursor: pointer;
  transition: background 0.15s ease;
}

.lot-row:hover,
.lot-row:focus-visible {
  background: #f0ebe3;
}

.lot-row.lot-review-done {
  background: #e7f6ee;
}

.lot-row.lot-review-done:hover,
.lot-row.lot-review-done:focus-visible {
  background: #d9f0e4;
}

.lot-row:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.tag-multi,
.tag-single {
  display: inline-block;
  min-width: 1.75rem;
  padding: 0.15rem 0.45rem;
  border-radius: 6px;
  text-align: center;
  font-weight: 700;
  font-size: 0.9rem;
}

.tag-multi { background: var(--multi-bg); }
.tag-single { background: #f2efe8; color: var(--muted); }

.filter-toggle {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

.switch {
  position: relative;
  display: inline-block;
  width: 2.75rem;
  height: 1.5rem;
  flex-shrink: 0;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  inset: 0;
  cursor: pointer;
  background: #cfc8bb;
  border-radius: 999px;
  transition: background 0.2s ease;
}

.slider::before {
  content: "";
  position: absolute;
  width: 1.15rem;
  height: 1.15rem;
  left: 0.2rem;
  top: 0.175rem;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.2s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.switch input:checked + .slider {
  background: var(--accent);
}

.switch input:checked + .slider::before {
  transform: translateX(1.15rem);
}

.switch input:focus-visible + .slider {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.switch-text {
  color: var(--ink);
  cursor: pointer;
  font-size: 0.95rem;
  line-height: 1.35;
}

.lot-nav {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

.btn-nav {
  background: #efe9df;
  color: var(--ink);
  border: 1px solid var(--line);
}

.btn-nav:hover {
  background: #e4ddd1;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.rating-group {
  display: inline-flex;
  gap: 0.25rem;
  align-items: center;
}

.rating-option {
  position: relative;
  display: inline-flex;
  cursor: pointer;
}

.rating-option input {
  position: absolute;
  opacity: 0;
  inset: 0;
  margin: 0;
  cursor: pointer;
}

.rating-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.rating-icon svg {
  width: 1.2rem;
  height: 1.2rem;
}

.rating-option:hover .rating-icon {
  border-color: #b9b1a3;
}

.rating-option input:focus-visible + .rating-icon {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.rating-favorable input:checked + .rating-icon {
  color: #1d6fa5;
  background: #d9eefc;
  border-color: #8ec8ea;
  box-shadow: inset 0 0 0 1px #8ec8ea;
}

.rating-very input:checked + .rating-icon {
  color: #1f7a4d;
  background: #d9f5e6;
  border-color: #7dcca3;
  box-shadow: inset 0 0 0 1px #7dcca3;
}

.rating-negative input:checked + .rating-icon {
  color: #b42318;
  background: #fde8e6;
  border-color: #f0a8a0;
  box-shadow: inset 0 0 0 1px #f0a8a0;
}

.comment-form {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 0.6rem;
}

.comment-form label {
  font-weight: 600;
}

.comment-form textarea {
  width: 100%;
  padding: 0.75rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  font: inherit;
  resize: vertical;
  min-height: 6rem;
  background: #fff;
}

.comment-form .btn {
  justify-self: start;
}

.review-toggle {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}
