:root {
  --green-900: #0f4f2f;
  --green-700: #1f6b43;
  --green-500: #2f8a56;
  --green-100: #eaf6ef;
  --gold-700: #b78b14;
  --gold-500: #e0b72f;
  --cream: #fffdf6;
  --text: #173023;
  --muted: #5f6f66;
  --line: #dbe7de;
  --white: #ffffff;
  --danger: #a04949;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", Tahoma, Arial, sans-serif;
  background: linear-gradient(180deg, var(--cream), #f7fbf4);
  color: var(--text);
}

.container {
  width: min(1150px, 94vw);
  margin: 1.2rem auto 2rem;
  display: grid;
  gap: 1rem;
}

.card {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--white);
  box-shadow: 0 7px 20px rgba(21, 63, 40, 0.08);
  padding: 1rem;
}

.hero {
  background: linear-gradient(115deg, var(--green-900), var(--green-700));
  color: #f6fff8;
  border: none;
}

.hero h1 {
  margin: 0;
  font-size: 1.5rem;
}

.hero p {
  margin: 0.45rem 0 0;
  color: #dff4e7;
}

.hero-badges {
  margin-top: 0.95rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.header-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  flex-wrap: wrap;
}

.top-actions {
  margin-left: auto;
  display: flex;
  gap: 0.55rem;
  flex-wrap: wrap;
}

.badge {
  background: rgba(255, 255, 255, 0.13);
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 999px;
  padding: 0.28rem 0.72rem;
  font-size: 0.85rem;
}

.top-nav {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}

h2 {
  margin: 0 0 0.8rem;
  font-size: 1.1rem;
  color: var(--green-900);
}

.small-note {
  margin: -0.2rem 0 0.9rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.field-grid {
  display: grid;
  gap: 0.72rem;
}

label {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--green-700);
  display: block;
  margin-bottom: 0.28rem;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid #cddfd3;
  border-radius: 9px;
  padding: 0.6rem 0.65rem;
  background: #fffeff;
  font: inherit;
  color: var(--text);
}

textarea {
  min-height: 90px;
  resize: vertical;
}

.split-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
}

@media (max-width: 640px) {
  .split-2 {
    grid-template-columns: 1fr;
  }
}

.btn {
  border: none;
  border-radius: 9px;
  padding: 0.58rem 0.9rem;
  cursor: pointer;
  font-weight: 700;
  font-size: 0.92rem;
  text-decoration: none;
  display: inline-block;
  transition: transform 0.12s ease, opacity 0.12s ease;
}

.btn:hover {
  transform: translateY(-1px);
  opacity: 0.96;
}

.btn-main {
  background: linear-gradient(90deg, var(--gold-700), var(--gold-500));
  color: #1a1406;
}

.btn-soft {
  background: #eff7f1;
  color: var(--green-700);
  border: 1px solid #d4e6d8;
}

.btn-danger {
  background: #fff2f2;
  color: var(--danger);
  border: 1px solid #f0d5d5;
}

.status-box {
  margin-top: 0.7rem;
  padding: 0.52rem 0.68rem;
  border-radius: 8px;
  border: 1px solid #d4ead8;
  background: var(--green-100);
  color: var(--green-700);
  font-size: 0.9rem;
}

.controls-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 0.9rem;
}

.pill {
  border: 1px solid #d6e6da;
  border-radius: 999px;
  padding: 0.3rem 0.65rem;
  font-size: 0.8rem;
  color: var(--green-700);
  background: #f4fbf6;
}

.layout {
  display: grid;
  grid-template-columns: minmax(290px, 380px) 1fr;
  gap: 1rem;
}

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

.listing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(255px, 1fr));
  gap: 0.85rem;
}

.listing-tile {
  border: 1px solid #dae9de;
  border-radius: 12px;
  background: #fff;
  overflow: hidden;
  display: grid;
  grid-template-rows: 150px auto;
}

.listing-image {
  width: 100%;
  height: 150px;
  object-fit: cover;
  background: #f0f6f2;
}

.tile-body {
  padding: 0.75rem;
}

.listing-facts {
  display: grid;
  gap: 0.22rem;
  font-size: 0.84rem;
  color: #2a503d;
  margin-bottom: 0.45rem;
}

.loaner-tag {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.24rem 0.58rem;
  font-size: 0.78rem;
  font-weight: 800;
  margin-bottom: 0.45rem;
  background: linear-gradient(90deg, var(--gold-700), var(--gold-500));
  color: #1b1303;
  border: 1px solid #a17c10;
}

.listing-title {
  margin: 0;
  font-size: 0.98rem;
  color: var(--green-900);
}

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

.status {
  display: inline-flex;
  border-radius: 999px;
  padding: 0.24rem 0.56rem;
  font-size: 0.78rem;
  font-weight: 700;
  margin-bottom: 0.45rem;
}

.status.open {
  color: #204f35;
  background: #daf3e2;
}

.status.claimed {
  color: #5b4a11;
  background: #f6e8ba;
}

.status.donated {
  color: #6f3f10;
  background: #f8dfbf;
}

.tile-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.58rem;
}

.empty {
  color: var(--muted);
  font-size: 0.92rem;
  font-style: italic;
  border: 1px dashed #d7e6da;
  border-radius: 9px;
  padding: 0.9rem;
  text-align: center;
  background: #fcfffd;
}

.log {
  margin: 0;
  padding-left: 1.1rem;
  color: #395846;
  line-height: 1.5;
  max-height: 230px;
  overflow: auto;
}

.center-links {
  text-align: center;
}

.link-row {
  display: flex;
  justify-content: center;
  gap: 0.7rem;
  flex-wrap: wrap;
}

dialog {
  border: 1px solid #cfe2d4;
  border-radius: 12px;
  width: min(450px, 90vw);
  box-shadow: 0 20px 45px rgba(11, 46, 26, 0.2);
  padding: 0;
}

dialog::backdrop {
  background: rgba(16, 36, 24, 0.4);
}

.modal-content {
  padding: 1rem;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 0.85rem;
}
