*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: system-ui, sans-serif;
  background: #f5f5f0;
  color: #222;
  min-height: 100vh;
}

nav {
  background: #2d6a4f;
  color: #fff;
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}
nav .nav-brand { font-size: 1.25rem; font-weight: 700; color: #fff; text-decoration: none; }
nav .nav-links { display: flex; gap: 1rem; align-items: center; margin-left: auto; flex-wrap: wrap; }
nav a { color: #d8f3dc; text-decoration: none; }
nav a:hover { color: #fff; }

.btn-link {
  background: none; border: none; color: #d8f3dc; cursor: pointer;
  font-size: 1rem; font-family: inherit; padding: 0;
}
.btn-link:hover { color: #fff; }

main { max-width: 900px; margin: 2rem auto; padding: 0 1rem; }

.flash {
  padding: 0.75rem 1rem;
  border-radius: 6px;
  margin-bottom: 1rem;
}
.flash-success { background: #d8f3dc; color: #1b4332; }
.flash-error { background: #ffe0e0; color: #7f1d1d; }
.flash-info { background: #dbeafe; color: #1e3a5f; }

h1, h2, h3 { margin-bottom: 0.75rem; }
h1 { font-size: 1.75rem; }
h2 { font-size: 1.35rem; }

a { color: #2d6a4f; }
a:hover { color: #1b4332; }

.btn {
  display: inline-block;
  padding: 0.5rem 1.25rem;
  border-radius: 5px;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  font-family: inherit;
  text-decoration: none;
  transition: background 0.15s;
}
.btn-primary { background: #2d6a4f; color: #fff; }
.btn-primary:hover { background: #1b4332; color: #fff; }
.btn-secondary { background: #e8e8e0; color: #222; }
.btn-secondary:hover { background: #d0d0c8; }
.btn-danger { background: #dc2626; color: #fff; }
.btn-danger:hover { background: #b91c1c; }
.btn-sm { padding: 0.3rem 0.75rem; font-size: 0.875rem; }

.card {
  background: #fff;
  border-radius: 8px;
  padding: 1.25rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  margin-bottom: 1rem;
}

.listing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
}
.listing-card {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.listing-card img { width: 100%; height: 180px; object-fit: cover; }
.listing-card .card-body { padding: 1rem; flex: 1; display: flex; flex-direction: column; gap: 0.5rem; }
.listing-card .card-title { font-weight: 600; font-size: 1.05rem; }
.listing-card .card-meta { font-size: 0.8rem; color: #666; }
.listing-card .card-actions { margin-top: auto; display: flex; gap: 0.5rem; flex-wrap: wrap; }

.badge {
  display: inline-block;
  padding: 0.15rem 0.6rem;
  border-radius: 99px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.badge-give { background: #d8f3dc; color: #1b4332; }
.badge-lend { background: #dbeafe; color: #1e3a5f; }

.filter-bar { display: flex; gap: 0.5rem; margin-bottom: 1.25rem; align-items: center; flex-wrap: wrap; }
.filter-bar a { padding: 0.35rem 1rem; border-radius: 99px; background: #e8e8e0; color: #222; text-decoration: none; font-size: 0.9rem; }
.filter-bar a.active, .filter-bar a:hover { background: #2d6a4f; color: #fff; }

form .field { margin-bottom: 1rem; }
form label { display: block; font-weight: 500; margin-bottom: 0.3rem; }
form input[type=text], form input[type=password], form input[type=email],
form input[type=tel], form textarea, form select {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1px solid #ccc;
  border-radius: 5px;
  font-size: 1rem;
  font-family: inherit;
  background: #fff;
}
form textarea { min-height: 100px; resize: vertical; }
form .hint { font-size: 0.8rem; color: #666; margin-top: 0.2rem; }
form .error { color: #dc2626; font-size: 0.85rem; margin-top: 0.2rem; }

/* Honeypot: hidden from humans */
.hp-field { display: none !important; }

table { width: 100%; border-collapse: collapse; }
th, td { padding: 0.6rem 0.75rem; text-align: left; border-bottom: 1px solid #eee; }
th { background: #f5f5f0; font-weight: 600; }

.empty-state { text-align: center; color: #888; padding: 3rem 1rem; }

.page-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.25rem; flex-wrap: wrap; gap: 0.5rem; }
