@import url('https://fonts.googleapis.com/css2?family=Instrument+Serif:ital@0;1&family=Space+Grotesk:wght@400;500;600&display=swap');

:root {
  --bg: #f6efe5;
  --bg-alt: #efe3d1;
  --card: #fffaf4;
  --ink: #1f1a14;
  --muted: #6c6157;
  --accent: #c1673e;
  --accent-dark: #8f4a2b;
  --accent-2: #3d7a6d;
  --border: #e2d5c5;
  --shadow: rgba(27, 19, 14, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Space Grotesk', sans-serif;
  color: var(--ink);
  background: radial-gradient(circle at top, #fff4e6 0%, var(--bg) 55%, #efe4d6 100%);
}

.page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 24px clamp(16px, 4vw, 48px) 48px;
}

.login-page {
  align-items: center;
  justify-content: center;
}

.site-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 20px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--card);
  box-shadow: 0 10px 30px var(--shadow);
}

.brand-title {
  font-family: 'Instrument Serif', serif;
  font-size: 1.8rem;
  display: block;
}

.brand {
  text-decoration: none;
  color: inherit;
}

.brand-sub {
  color: var(--muted);
  font-size: 0.95rem;
}

.nav {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.nav a {
  color: inherit;
  text-decoration: none;
  font-weight: 500;
}

.nav a.nav-alert {
  font-weight: 700;
}

.notification-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  padding: 2px 6px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 0.75rem;
  line-height: 1;
}

.inline {
  display: inline;
}

main {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.hero {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
  padding: 28px;
  border-radius: 24px;
  background: linear-gradient(135deg, #fff8ef 0%, #f6e8d6 100%);
  border: 1px solid var(--border);
  box-shadow: 0 18px 40px rgba(60, 41, 29, 0.12);
}

.hero h1 {
  font-family: 'Instrument Serif', serif;
  font-size: clamp(2rem, 4vw, 3rem);
  margin: 0 0 12px;
}

.hero p {
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.6;
}

.hero-actions {
  display: flex;
  gap: 12px;
  margin-top: 20px;
  flex-wrap: wrap;
}

.hero-panel {
  display: grid;
  gap: 16px;
  background: var(--card);
  border-radius: 20px;
  padding: 20px;
  border: 1px solid var(--border);
}

.stat {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.stat-label {
  color: var(--muted);
}

.stat-value {
  font-size: 1.5rem;
  font-weight: 600;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.section-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.filter-control {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
}

.filter-control input {
  width: 220px;
  max-width: 100%;
  flex: 1 1 220px;
}

@media (max-width: 600px) {
  .filter-control {
    flex-wrap: wrap;
  }
}

.view-toggle {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  padding: 6px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #fffaf4;
}

.view-toggle .btn {
  box-shadow: none;
}

.view-toggle .btn.is-active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.items-grid {
  display: grid;
  gap: 24px;
}

.items-grid.grid {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.items-grid.compact {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.items-grid.grid .item-card {
  grid-template-columns: 1fr;
}

.items-grid.grid .item-image img {
  height: 220px;
}

.items-grid.compact .item-card {
  padding: 14px;
  gap: 12px;
}

.items-grid.compact .item-image img {
  height: 160px;
}

.items-grid.compact .item-description,
.items-grid.compact .comments,
.items-grid.compact .interest-list {
  display: none;
}

.items-grid.compact .item-meta {
  font-size: 0.75rem;
}

.items-grid.compact .item-actions {
  gap: 8px;
}

.items-grid.compact .btn {
  padding: 6px 12px;
  font-size: 0.85rem;
}

.item-card {
  display: grid;
  grid-template-columns: minmax(220px, 0.9fr) 1.1fr;
  gap: 20px;
  padding: 20px;
  border-radius: 24px;
  background: var(--card);
  border: 1px solid var(--border);
  box-shadow: 0 12px 25px var(--shadow);
}

.item-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 18px;
  border: 1px solid var(--border);
}

.image-button {
  display: block;
  padding: 0;
  border: none;
  background: none;
  width: 100%;
  cursor: zoom-in;
}

.image-button img {
  display: block;
}

.image-modal {
  position: fixed;
  inset: 0;
  background: rgba(24, 18, 14, 0.7);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 1000;
}

.image-modal.open {
  display: flex;
}

.image-modal-content {
  position: relative;
  max-width: 95vw;
  max-height: 95vh;
  overflow: auto;
  background: #fffaf4;
  border-radius: 20px;
  padding: 24px;
  border: 1px solid var(--border);
}

.image-modal-content img {
  display: block;
  max-width: none;
  height: auto;
}

.image-modal-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: none;
  background: var(--card);
  color: var(--ink);
  font-size: 1.4rem;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(27, 19, 14, 0.2);
}

.item-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.item-header {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.item-header h3 {
  margin: 0;
  font-size: 1.4rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--bg-alt);
  color: var(--muted);
  font-size: 0.85rem;
}

.badge.category {
  background: #efe7dc;
  color: #5a4b40;
}

.badge.recycling {
  background: #e4f0e6;
  color: #2f6d5d;
}

.badge.claim {
  background: #f3e4d6;
  color: #8a4f2a;
}

.category-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.category-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: #efe7dc;
  color: #5a4b40;
  font-size: 0.85rem;
}

.tag-remove {
  border: none;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  padding: 0;
}

.item-description {
  color: var(--muted);
  white-space: pre-wrap;
  margin: 0;
}

.item-meta {
  display: flex;
  gap: 16px;
  color: var(--muted);
  font-size: 0.85rem;
  flex-wrap: wrap;
}

.claim {
  display: flex;
  align-items: center;
  gap: 10px;
}

.claim-status {
  font-weight: 600;
  color: var(--accent-dark);
}

.claim-status.open {
  color: var(--accent-2);
}

.item-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.interest-list {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 0.9rem;
}

.interest-label {
  font-weight: 600;
  color: var(--ink);
}

.interest-tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.interest-tag {
  padding: 4px 10px;
  border-radius: 999px;
  background: #efe4d6;
  color: var(--muted);
  font-size: 0.85rem;
}

.comments {
  grid-column: 1 / -1;
  border-top: 1px dashed var(--border);
  padding-top: 16px;
}

.comments h4 {
  margin: 0 0 10px;
}

.comment {
  padding: 10px 12px;
  background: #fffdf9;
  border: 1px solid var(--border);
  border-radius: 14px;
  margin-bottom: 10px;
}

.comment-head {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--muted);
}

.comment-body {
  margin: 6px 0 0;
  white-space: pre-wrap;
}

.comment-delete {
  margin-top: 6px;
}

.comment-delete .link {
  font-size: 0.85rem;
  color: var(--muted);
}

.upload-options {
  display: grid;
  gap: 12px;
}

.upload-options label {
  width: 100%;
}

.comment-form {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: flex-start;
}

textarea,
input,
select {
  width: 100%;
  border-radius: 12px;
  border: 1px solid var(--border);
  padding: 10px 12px;
  font-family: inherit;
  font-size: 1rem;
  background: #fffdf9;
}

textarea {
  flex: 1;
}

label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-weight: 500;
}

.checkbox {
  flex-direction: row;
  align-items: center;
  gap: 10px;
}

.checkbox input {
  width: auto;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 999px;
  border: none;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  box-shadow: 0 8px 18px rgba(193, 103, 62, 0.2);
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 20px rgba(193, 103, 62, 0.25);
}

.btn:disabled {
  background: #c7b8aa;
  cursor: not-allowed;
  box-shadow: none;
}

.btn.small {
  padding: 8px 14px;
  font-size: 0.9rem;
}

.btn.ghost {
  background: transparent;
  color: var(--accent-dark);
  border: 1px solid var(--accent-dark);
  box-shadow: none;
}

.btn.accent {
  background: var(--accent-2);
  box-shadow: 0 8px 18px rgba(61, 122, 109, 0.25);
}

.btn.danger {
  background: #b4462a;
  box-shadow: 0 8px 18px rgba(180, 70, 42, 0.25);
}

.btn.danger:hover {
  box-shadow: 0 12px 20px rgba(180, 70, 42, 0.3);
}

.link {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  color: var(--muted);
  cursor: pointer;
}

.count {
  background: rgba(255, 255, 255, 0.25);
  padding: 2px 8px;
  border-radius: 999px;
}

.flash {
  padding: 12px 16px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--card);
  font-weight: 500;
}

.flash.error {
  border-color: #d7a296;
  color: #8f3e2e;
}

.flash.success {
  border-color: #9bc5b6;
  color: #2f6d5d;
}

.form-section {
  display: flex;
  justify-content: center;
}

.form-card {
  width: min(520px, 100%);
  background: var(--card);
  border-radius: 20px;
  padding: 28px;
  border: 1px solid var(--border);
  box-shadow: 0 14px 30px var(--shadow);
}

.form-card.wide {
  width: min(720px, 100%);
}

.form-card h1 {
  margin-top: 0;
  font-family: 'Instrument Serif', serif;
}

.category-picker {
  display: grid;
  gap: 10px;
}

.category-picker-input {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.divider {
  height: 1px;
  background: var(--border);
  margin: 24px 0;
}

.user-card {
  background: var(--card);
  border-radius: 20px;
  padding: 20px;
  border: 1px solid var(--border);
  box-shadow: 0 14px 30px var(--shadow);
  overflow-x: auto;
}

.activity-card {
  background: var(--card);
  border-radius: 20px;
  padding: 20px;
  border: 1px solid var(--border);
  box-shadow: 0 14px 30px var(--shadow);
}

.activity-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 16px;
}

.activity-list li {
  padding: 14px 16px;
  border-radius: 16px;
  background: #fffdf9;
  border: 1px solid var(--border);
}

.notification-item.unread {
  border-color: #e2b69a;
  background: #fff2e1;
}

.activity-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.activity-label {
  font-weight: 600;
}

.activity-time {
  color: var(--muted);
  font-size: 0.85rem;
}

.activity-meta {
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.9rem;
}

.activity-note {
  margin: 10px 0 0;
  white-space: pre-wrap;
}

.user-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 600px;
}

.user-table th,
.user-table td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}

.user-table th {
  font-size: 0.85rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.stack {
  display: grid;
  gap: 16px;
  margin: 16px 0;
}

.form-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.invite-note {
  padding: 10px 12px;
  border-radius: 12px;
  background: #fff2e1;
  color: var(--accent-dark);
  font-weight: 500;
}

.invite-list {
  display: grid;
  gap: 16px;
  margin-top: 20px;
}

.invite-card {
  display: grid;
  gap: 12px;
  padding: 16px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: #fffdf9;
}

.invite-label {
  font-weight: 600;
  margin: 0 0 4px;
}

.invite-meta,
.invite-used,
.invite-open {
  margin: 0;
  font-size: 0.85rem;
  color: var(--muted);
}

.invite-open {
  color: var(--accent-2);
  font-weight: 600;
}

.invite-actions {
  display: grid;
  gap: 10px;
}

.invite-actions input {
  font-size: 0.9rem;
}

.owner-panel {
  margin-top: 24px;
  padding: 18px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: #fff7ec;
  display: grid;
  gap: 12px;
}

.owner-panel h2 {
  margin: 0;
  font-size: 1.2rem;
}

.muted {
  color: var(--muted);
}

.empty-state {
  text-align: center;
  padding: 30px;
  border-radius: 20px;
  border: 1px dashed var(--border);
  background: #fff9f0;
}

.site-footer {
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
}

@media (max-width: 900px) {
  .item-card {
    grid-template-columns: 1fr;
  }

  .comment-form {
    flex-direction: column;
  }
}
