:root {
  --bg: #f8f7f4;
  --surface: #ffffff;
  --text: #2c2a27;
  --muted: #6b665e;
  --border: #e3dfd7;
  --primary: #4a6345;
  --primary-hover: #3b5037;
  --accent: #7a6348;
  --accent-hover: #624f39;
  --wood-dark: #4e331d;
  --danger: #9e2a2b;
  --radius: 14px;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
}
a { color: var(--primary); text-decoration: none; }
.container { max-width: 1180px; margin: 0 auto; padding: 0 20px; }

.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 18px 0;
}
.header-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}
.brand-sub { font-size: 0.85rem; color: var(--muted); }
.brand-title { margin: 2px 0 0; font-size: 1.5rem; font-weight: 700; color: var(--text); }
.brand-title a { color: inherit; }

.insert-box {
  background: #f3f1ec;
  border: 1px solid #dcd6ca;
  border-radius: 14px;
  padding: 10px 14px;
}
.insert-box-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.insert-box-buttons { display: flex; flex-wrap: wrap; gap: 8px; }

.btn {
  display: inline-block;
  padding: 10px 18px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.94rem;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}
.btn-primary,
button[type="submit"],
input[type="submit"] {
  background: #2d5a27;
  color: #ffffff;
  font-weight: 600;
  border-radius: 8px;
  padding: 12px 22px;
  border: none;
  cursor: pointer;
}
.btn-primary:hover,
button[type="submit"]:hover,
input[type="submit"]:hover {
  background: #1f411b;
  color: #ffffff;
}
.btn-accent { background: var(--accent); color: #fff; }
.btn-accent:hover { background: var(--accent-hover); }
.btn-secondary,
.btn-back {
  background: #efe9dc;
  color: #4e331d;
  border: 1px solid #d5cab8;
  border-radius: 8px;
  padding: 11px 20px;
  font-weight: 600;
  cursor: pointer;
}
.btn-secondary:hover,
.btn-back:hover {
  background: #e4dac6;
  color: #3a2618;
}
.btn-danger {
  background: #f8dede;
  color: #9e2a2b;
  border: 1px solid #e6b8b8;
  border-radius: 8px;
  padding: 11px 18px;
  font-weight: 600;
  cursor: pointer;
}
.btn-danger:hover { background: #f2c9c9; }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 14px; }
.main-nav {
  background: #edeae3;
  border-bottom: 1px solid var(--border);
  padding: 8px 0;
}
.main-nav .container,
.main-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
}
.main-nav a { color: var(--text); font-weight: 500; padding: 6px 10px; border-radius: 8px; }
.main-nav a:hover { background: rgba(0,0,0,0.05); }
.main-nav a.admin-link { color: var(--muted); font-size: 0.9rem; }

.page-head {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 26px 0;
  margin-bottom: 26px;
}
.page-head h1 { margin: 0 0 6px; font-size: 1.7rem; }
.page-head p { margin: 0; color: var(--muted); }

.grid-cats {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}
@media (max-width: 960px) {
  .grid-cats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 580px) {
  .grid-cats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.cat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 10px;
  text-align: center;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.cat-card:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(0,0,0,0.06); }
.cat-card.cat-empty { opacity: 0.72; }
.cat-card h3 { margin: 0 0 6px; font-size: 0.98rem; color: var(--text); }
.cat-card .count { font-size: 0.84rem; color: var(--muted); }

.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 18px;
}
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.card-img { width: 100%; height: 210px; object-fit: cover; background: #eae6de; display: block; }
.card-body { padding: 16px; flex: 1; display: flex; flex-direction: column; }
.card-body h3 { margin: 8px 0 6px; font-size: 1.15rem; }
.card-meta { font-size: 0.88rem; color: var(--muted); margin-bottom: 10px; }
.card-actions { margin-top: auto; padding-top: 12px; }

.badge {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 700;
  background: #ece8df;
  color: var(--text);
}
.badge-urgent { background: #f8dede; color: var(--danger); }
.badge-ok { background: #e1eedf; color: #2d5a27; }
.badge-warn { background: #fbf1d8; color: #8a5a00; }
.badge-found { background: #d4edda; color: #1e5631; }

.form-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  max-width: 960px;
}
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}
label { display: block; font-weight: 600; margin: 12px 0 5px; font-size: 0.94rem; }
input[type="text"], input[type="email"], input[type="password"], select, textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #cfc9be;
  border-radius: 10px;
  font: inherit;
  background: #fff;
}
textarea { min-height: 110px; resize: vertical; }
.checkbox-row { display: flex; align-items: flex-start; gap: 10px; margin: 12px 0; cursor: pointer; }
.checkbox-row input { width: auto; margin-top: 4px; }
.form-hint { font-size: 0.85rem; color: var(--muted); margin: 4px 0 10px; }

.alert { padding: 14px 16px; border-radius: 10px; margin-bottom: 18px; }
.alert-success { background: #e1eedf; border: 1px solid #b8d6b4; color: #244820; }
.alert-error { background: #f8dede; border: 1px solid #e6b8b8; color: #7a1c1d; }
.info-box {
  background: #f3f1ec;
  border-left: 4px solid var(--primary);
  padding: 14px 16px;
  border-radius: 8px;
  margin-bottom: 18px;
  font-size: 0.94rem;
}

.site-footer {
  margin-top: 46px;
  border-top: 1px solid var(--border);
  background: var(--surface);
  padding: 24px 0;
  color: var(--muted);
  font-size: 0.9rem;
}
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; }
