:root {
  --bg: #FAF7EF;
  --green: #1B5E3B;
  --green-dark: #14532D;
  --sage: #E4F2D8;
  --sage-2: #DCEFCB;
  --card: #FFFFFF;
  --text: #22301F;
  --muted: #6B7A64;
  --line: #E3E0D2;
  --danger: #C0392B;
  --radius: 14px;
  --shadow: 0 2px 4px rgba(20, 60, 35, .06), 0 4px 14px rgba(20, 60, 35, .08);
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: "Poppins", "Quicksand", system-ui, -apple-system, "Segoe UI", sans-serif;
  min-height: 100vh;
  display: flex; flex-direction: column;
}

.fa-solid { vertical-align: -0.125em; }
.nav-icon .fa-solid, .mobile-nav .fa-solid { font-size: 1.2rem; }
h1 .fa-solid, h2 .fa-solid { margin-right: 4px; }
.thumb-empty .fa-solid { font-size: 2.6rem; opacity: .35; }
.hero-art .fa-solid { font-size: 3rem; color: var(--green); }

/* ── header ── */
.site-header {
  display: flex; align-items: center; gap: 22px;
  padding: 14px 22px; background: var(--card);
  border-bottom: 1px solid var(--line);
}
.brand { font-weight: 700; font-size: 1.15rem; color: var(--green-dark); text-decoration: none; }
.brand .recycle { color: var(--green); }
.brand .tld { color: var(--muted); font-weight: 500; }
.main-nav { display: flex; gap: 16px; }
.main-nav a { color: var(--text); text-decoration: none; font-weight: 500; }
.main-nav a:hover { color: var(--green); }
.mobile-nav { display: none; }
.header-actions { margin-left: auto; display: flex; gap: 10px; align-items: center; }
.inline { display: inline; }

/* ── buttons & inputs ── */
.btn {
  display: inline-block; border-radius: 999px; padding: 8px 18px;
  border: 1.5px solid var(--green); cursor: pointer;
  text-decoration: none; font-weight: 600; font-size: .92rem;
  background: var(--card); color: var(--green-dark); font-family: inherit;
}
.btn.primary { background: var(--green-dark); color: #fff; }
.btn.primary:hover { background: var(--green); }
.btn.big { padding: 12px 26px; font-size: 1.05rem; }
.btn.ghost { border-color: var(--line); }
.input {
  width: 100%; padding: 9px 12px; border: 1.5px solid var(--line);
  border-radius: 10px; font-family: inherit; font-size: .95rem; background: #fff;
}
.input:focus { outline: 2px solid var(--sage-2); border-color: var(--green); }

/* ── panels & cards ── */
.panel { border-radius: var(--radius); padding: 30px 34px; background: var(--sage); }
.banner { padding: 26px 30px; margin-bottom: 22px; }
.card {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 24px 28px; margin-bottom: 20px;
}
.card.narrow { max-width: 460px; margin: 30px auto; }
.page { max-width: 1080px; width: 100%; margin: 0 auto; padding: 26px 20px; flex: 1; }

/* ── hero ── */
.hero { display: flex; align-items: center; gap: 30px; flex-wrap: wrap; }
.hero-text { flex: 1 1 340px; }
.hero h1 { margin: 0 0 8px; font-size: 2.6rem; line-height: 1.1; color: var(--green-dark); }
.hero h1 .swap { color: var(--green); font-size: 3.2rem; }
.hero-art { font-size: 4rem; text-align: center; }
.hero-art .badge {
  display: block; margin-top: 14px; font-size: .78rem; font-weight: 600;
  background: var(--card); border-radius: 999px; padding: 6px 14px;
}

/* ── features / sections ── */
.features {
  display: flex; gap: 10px; margin: 22px 0;
  padding: 14px 10px; background: var(--card); border-radius: var(--radius);
  border: 1px solid var(--line);
}
.feature {
  flex: 1; text-align: center; padding: 8px 6px; font-weight: 500;
}
.feature span { display: block; margin-top: 6px; }
.feature:not(:first-child) { border-left: 1px solid var(--line); }
.section { margin: 34px 0; }
.section h2 { color: var(--green-dark); }

/* ── school cards ── */
.school-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 14px; }
.school-card {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 18px 12px; text-align: center; text-decoration: none; color: var(--text);
}
.school-card:hover { outline: 2px solid var(--sage-2); }
.badge-initials {
  display: inline-flex; align-items: center; justify-content: center;
  width: 46px; height: 46px; border-radius: 50%;
  background: var(--bg); border: 2px solid var(--sage-2);
  color: var(--green); font-weight: 700; font-size: 1.05rem;
}
.school-name { display: block; margin-top: 10px; font-size: .85rem; font-weight: 500; }

/* ── misc ── */
.muted { color: var(--muted); }
.center { text-align: center; }
.small { font-size: .82rem; }
.nowrap { white-space: nowrap; }
.block { display: block; text-align: center; margin-top: 10px; }
.flashes { max-width: 1080px; margin: 12px auto 0; padding: 0 20px; }
.flash {
  background: var(--sage); border-radius: 10px; padding: 10px 16px; margin-bottom: 8px;
  font-size: .9rem;
}
.flash.error { background: #FBEAE7; color: var(--danger); }
.flash.info { background: var(--sage-2); }
.site-footer {
  text-align: center; padding: 18px; color: var(--muted); font-size: .85rem;
  border-top: 1px solid var(--line); background: var(--card);
}

/* ── item grid & cards ── */
.item-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 16px;
}
.item-card {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  overflow: hidden; text-decoration: none; color: var(--text); display: block;
}
.item-card:hover { outline: 2px solid var(--sage-2); }
.thumb { position: relative; display: block; aspect-ratio: 1; background: var(--sage); }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb-empty {
  display: flex; align-items: center; justify-content: center;
  width: 100%; height: 100%; font-size: 2.6rem; color: var(--muted);
}
.thumb-empty.big { min-height: 180px; }
.thumb.sold img { filter: grayscale(.9); opacity: .75; }
.sold-badge, .pending-badge, .rejected-badge {
  position: absolute; top: 8px; left: 8px; padding: 3px 10px;
  border-radius: 999px; font-size: .72rem; font-weight: 700; color: #fff;
}
.sold-badge { background: var(--danger); }
.pending-badge { background: #C98A1B; }
.rejected-badge { background: #8B4444; }
.heart-form { position: absolute; top: 6px; right: 6px; }
.heart {
  background: #fff; border: none; border-radius: 50%; width: 32px; height: 32px;
  font-size: 1rem; cursor: pointer; color: #C4C4C4; box-shadow: var(--shadow);
}
.heart.active { color: var(--danger); }
.card-body { display: block; padding: 10px 12px 14px; }
.card-title { display: block; font-weight: 600; font-size: .9rem; }
.card-meta { display: block; color: var(--muted); font-size: .78rem; margin-top: 2px; }
.card-price { display: block; color: var(--green); font-weight: 700; margin-top: 6px; }

/* ── filter bar & pagination ── */
.filterbar { padding: 14px 18px; margin-bottom: 18px; }
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.filters .input { width: auto; min-width: 150px; flex: 1 1 150px; }
.pagination { display: flex; gap: 12px; align-items: center; justify-content: center; margin: 24px 0; }

/* ── detail page ── */
.detail { display: flex; gap: 26px; flex-wrap: wrap; }
.detail-gallery { flex: 1 1 320px; padding: 12px; }
.detail-gallery img { width: 100%; border-radius: 10px; margin-bottom: 10px; }
.detail-info { flex: 1 1 300px; }
.detail-info h1 { margin: 4px 0; font-size: 1.5rem; color: var(--green-dark); }
.price-row { display: flex; gap: 12px; align-items: center; margin-bottom: 14px; }
.big-price { font-size: 1.9rem; font-weight: 700; color: var(--green); }
.big-price + .sold-badge, .big-price + .pending-badge, .big-price + .rejected-badge { position: static; }
.meta-list { list-style: none; padding: 0; margin: 0 0 18px; }
.meta-list li { padding: 4px 0; font-size: .95rem; }
.detail-actions { display: flex; gap: 10px; flex-wrap: wrap; margin: 14px 0; }
.reject-form { display: flex; gap: 8px; flex: 1; }
.reject-form .input { flex: 1; min-width: 180px; }
.btn.danger { border-color: var(--danger); color: var(--danger); }
.btn.danger:hover { background: var(--danger); color: #fff; }

/* ── dashboard ── */
.dash { display: flex; gap: 22px; align-items: flex-start; flex-wrap: wrap; }
.dash-side { flex: 0 0 210px; }
.dash-main { flex: 1 1 420px; }
.avatar {
  width: 56px; height: 56px; border-radius: 50%; background: var(--green-dark);
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem; font-weight: 700; margin: 0 auto;
}
.dash-name { text-align: center; font-weight: 600; margin: 8px 0 14px; }
.side-link {
  display: block; padding: 7px 4px; color: var(--text); text-decoration: none;
  font-weight: 500; border-bottom: 1px solid var(--line);
}
.side-link:hover { color: var(--green); }
.rows { width: 100%; border-collapse: collapse; background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); }
.rows td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.rows tr:last-child td { border-bottom: none; }
.row-thumb { width: 64px; }
.row-thumb img { width: 56px; height: 56px; object-fit: cover; border-radius: 8px; }
.row-thumb .thumb-empty { width: 56px; height: 56px; font-size: 1.4rem; border-radius: 8px; background: var(--sage); }
.status-pill { padding: 3px 10px; border-radius: 999px; font-size: .72rem; font-weight: 700; }
.status-pill.approved { background: var(--sage-2); color: var(--green-dark); }
.status-pill.pending { background: #FBEFD9; color: #9A6B0C; }
.status-pill.rejected { background: #FBEAE7; color: var(--danger); }
.status-pill.sold { background: var(--green-dark); color: #fff; }
.status-pill.used { background: var(--sage-2); color: var(--green-dark); }
.status-pill.revoked { background: #FBEAE7; color: var(--danger); }
.status-pill.expired { background: #ECEAE0; color: var(--muted); }
.tree ul { list-style: none; padding-left: 22px; border-left: 2px solid var(--sage-2); margin-left: 8px; }
.tree > ul { border-left: none; padding-left: 0; margin-left: 0; }
.tree li { padding: 5px 0; }
.rejected-note { color: var(--danger); font-size: .78rem; }
.mini {
  background: var(--card); border: 1px solid var(--line); border-radius: 8px;
  padding: 4px 10px; font-size: .78rem; cursor: pointer; text-decoration: none;
  color: var(--text); font-family: inherit;
}
.mini.danger { color: var(--danger); border-color: var(--danger); }

/* ── moderation ── */
.filter-chips { display: flex; gap: 8px; flex-wrap: wrap; margin: 14px 0 20px; }
.chip {
  padding: 6px 14px; border-radius: 999px; background: var(--card);
  border: 1.5px solid var(--line); font-size: .82rem; font-weight: 600;
  text-decoration: none; color: var(--text);
}
.chip.active { background: var(--green-dark); color: #fff; border-color: var(--green-dark); }
.mod-card { display: flex; gap: 20px; flex-wrap: wrap; }
.mod-photos { display: flex; gap: 10px; }
.mod-photos img { width: 170px; height: 170px; object-fit: cover; border-radius: 10px; }
.mod-info { flex: 1 1 300px; }
.mod-info h3 { margin: 2px 0 8px; }

/* ── requests & messaging ── */
.thread-list { padding: 4px 0; }
.thread-row {
  display: flex; gap: 12px; align-items: center; padding: 12px 16px;
  text-decoration: none; color: var(--text); border-bottom: 1px solid var(--line);
}
.thread-row:last-child { border-bottom: none; }
.thread-row:hover { background: var(--sage); }
.thread-body { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.thread-body strong { color: var(--green-dark); }
.avatar.small { width: 36px; height: 36px; font-size: .95rem; }
.contact-card { border-left: 5px solid var(--green); }
.contact-card.locked { border-left-color: #C98A1B; }
.chat {
  display: flex; flex-direction: column; gap: 8px; max-height: 420px;
  overflow-y: auto; padding: 16px;
}
.chat-msg {
  max-width: 75%; padding: 8px 14px; border-radius: 14px;
  background: var(--sage); align-self: flex-start; font-size: .93rem;
}
.chat-msg.mine { background: var(--green-dark); color: #fff; align-self: flex-end; }
.chat-msg .chat-body { display: block; white-space: pre-wrap; word-break: break-word; }
.chat-msg .chat-meta {
  display: block; font-size: .68rem; opacity: .65; margin-top: 3px;
}
.chat-form { display: flex; gap: 10px; margin-top: 12px; align-items: flex-end; }
.chat-form textarea { flex: 1; resize: vertical; }
.req-msg { width: auto; flex: 1 1 260px; }
.dash-main.full { flex: 1 1 100%; }

/* ── nav badges ── */
.nav-icon {
  position: relative; font-size: 1.15rem; text-decoration: none;
  padding: 4px 6px;
}
.nav-badge {
  position: absolute; top: -4px; right: -6px;
  background: var(--danger); color: #fff; font-size: .62rem; font-weight: 700;
  border-radius: 999px; padding: 1px 5px; min-width: 15px; text-align: center;
}
.side-badge {
  background: var(--danger); color: #fff; font-size: .68rem; font-weight: 700;
  border-radius: 999px; padding: 1px 7px; margin-left: 6px;
}

/* ── mobile ── */
@media (max-width: 700px) {
  .main-nav { display: none; }
  .mobile-nav {
    display: flex;
    position: fixed;
    bottom: 0; left: 0; right: 0;
    z-index: 50;
    background: var(--card);
    border-top: 1px solid var(--line);
    box-shadow: 0 -2px 10px rgba(20, 60, 35, .08);
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
    justify-content: space-around;
  }
  .mobile-nav a {
    display: flex; flex-direction: column; align-items: center; gap: 2px;
    flex: 1;
    color: var(--text); text-decoration: none;
    font-size: .72rem; font-weight: 600;
    padding: 4px 2px; border-radius: 10px;
  }
  .mobile-nav a.active { color: var(--green); }
  .mobile-nav .m-ico { font-size: 1.25rem; line-height: 1; }
  body { padding-bottom: 68px; }
  .hero h1 { font-size: 2rem; }
  .hero h1 .swap { font-size: 2.5rem; }
  .features { flex-direction: column; }
  .feature:not(:first-child) { border-left: none; border-top: 1px solid var(--line); }
  .page { padding: 18px 14px; }
}