:root {
  --bg: #f3efe5;
  --panel: rgba(255, 252, 246, 0.88);
  --panel-strong: #fffaf0;
  --ink: #1e1c18;
  --muted: #6a6458;
  --line: rgba(30, 28, 24, 0.12);
  --accent: #0b6e4f;
  --accent-soft: #d9f0e6;
  --shadow: 0 18px 45px rgba(43, 37, 27, 0.12);
  --radius: 24px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(222, 185, 116, 0.35), transparent 28%),
    radial-gradient(circle at top right, rgba(11, 110, 79, 0.16), transparent 22%),
    linear-gradient(180deg, #f7f2e7 0%, #efe6d6 100%);
}

a {
  color: inherit;
}

.page-shell {
  width: min(1200px, calc(100% - 32px));
  margin: 32px auto 64px;
}

.hero {
  display: grid;
  grid-template-columns: 1.8fr 0.8fr;
  gap: 18px;
  padding: 20px 24px;
  border-radius: 26px;
  background: linear-gradient(135deg, rgba(255, 250, 240, 0.96), rgba(244, 235, 217, 0.92));
  box-shadow: var(--shadow);
  border: 1px solid rgba(255, 255, 255, 0.75);
}

.eyebrow,
.meta-label,
.history-label {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.78rem;
  color: var(--muted);
}

.hero h1,
.empty-state h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.7rem, 2.2vw, 2.4rem);
  line-height: 1;
}

.hero-copy {
  max-width: 42rem;
  color: var(--muted);
  font-size: 0.96rem;
  margin: 8px 0 0;
}

.hero-meta {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 16px 18px;
  border-radius: var(--radius);
  background: rgba(11, 110, 79, 0.08);
  border: 1px solid rgba(11, 110, 79, 0.14);
}

.hero-meta strong {
  font-size: 1.35rem;
  margin-top: 4px;
}

.meta-count {
  margin-top: 4px;
  color: var(--muted);
}

.category-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 24px 0;
}

.category-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  border-radius: 999px;
  text-decoration: none;
  background: rgba(255, 250, 240, 0.7);
  border: 1px solid var(--line);
  box-shadow: 0 8px 22px rgba(43, 37, 27, 0.08);
}

.category-pill strong {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 34px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(30, 28, 24, 0.08);
}

.category-pill.is-active {
  background: var(--ink);
  color: #fffaf0;
}

.category-pill.is-active strong {
  background: rgba(255, 250, 240, 0.16);
}

.toolbar,
.empty-state {
  margin-top: 24px;
  padding: 24px 28px;
  border-radius: var(--radius);
  background: var(--panel);
  border: 1px solid rgba(255, 255, 255, 0.78);
  box-shadow: var(--shadow);
}

.filters {
  display: grid;
  grid-template-columns: minmax(240px, 1.3fr) minmax(180px, 0.7fr) auto auto auto;
  gap: 14px;
  align-items: end;
}

.field {
  display: grid;
  gap: 8px;
  color: var(--muted);
}

.field input,
.field select,
.btn-primary,
.btn-secondary {
  min-height: 48px;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid var(--line);
  font: inherit;
}

.field input,
.field select {
  background: rgba(255, 255, 255, 0.85);
}

.check-field {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.7);
  color: var(--ink);
}

.check-field input {
  width: 18px;
  height: 18px;
  margin: 0;
}

.btn-primary,
.btn-secondary {
  text-decoration: none;
  cursor: pointer;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  border-color: transparent;
}

.btn-secondary {
  background: transparent;
  color: var(--ink);
}

.empty-state p,
.description {
  margin-bottom: 0;
  color: var(--muted);
}

.table-shell {
  margin-top: 18px;
  overflow-x: auto;
  border-radius: 24px;
  background: var(--panel-strong);
  border: 1px solid rgba(255, 255, 255, 0.88);
  box-shadow: var(--shadow);
}

.pagination {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.pagination-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  min-height: 42px;
  padding: 8px 14px;
  border-radius: 999px;
  text-decoration: none;
  background: rgba(255, 250, 240, 0.78);
  border: 1px solid var(--line);
  box-shadow: 0 8px 22px rgba(43, 37, 27, 0.08);
}

.pagination-link.is-active {
  background: var(--ink);
  border-color: transparent;
  color: #fffaf0;
}

.listing-table {
  width: 100%;
  min-width: 1320px;
  border-collapse: collapse;
}

.listing-table th,
.listing-table td {
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.listing-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: rgba(247, 242, 231, 0.96);
  backdrop-filter: blur(8px);
}

.listing-table tbody tr:nth-child(even) {
  background: rgba(30, 28, 24, 0.025);
}

.listing-table tbody tr:hover {
  background: rgba(11, 110, 79, 0.06);
}

.listing-table tbody tr:last-child td {
  border-bottom: 0;
}

.sort-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--muted);
  white-space: nowrap;
}

.sort-link.is-active,
.sort-link:hover {
  color: var(--ink);
}

.sort-link strong {
  font-size: 0.9rem;
}

.favorite-cell {
  width: 84px;
  text-align: center;
}

.favorite-cell form {
  margin: 0;
}

.favorite-button {
  min-width: 42px;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 250, 240, 0.9);
  color: var(--muted);
  font: inherit;
  font-size: 1.2rem;
  cursor: pointer;
}

.favorite-button.is-active {
  background: #f5c451;
  border-color: rgba(30, 28, 24, 0.16);
  color: #5a3b00;
}

.favorite-button:hover {
  color: var(--ink);
}

.title-cell {
  min-width: 280px;
}

.note-cell {
  min-width: 260px;
}

.note-form {
  display: grid;
  gap: 8px;
}

.note-input,
.note-button {
  border-radius: 14px;
  border: 1px solid var(--line);
  font: inherit;
}

.note-input {
  width: 100%;
  min-height: 92px;
  padding: 10px 12px;
  resize: vertical;
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
}

.note-button {
  min-height: 40px;
  padding: 8px 12px;
  background: rgba(11, 110, 79, 0.1);
  color: var(--ink);
  cursor: pointer;
}

.title-cell > a {
  font-weight: 700;
  text-decoration: none;
}

.title-cell > a:hover {
  text-decoration: underline;
}

.description {
  margin-top: 8px;
  line-height: 1.42;
  font-size: 0.95rem;
}

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

  .filters {
    grid-template-columns: 1fr;
  }

  .pagination {
    justify-content: center;
  }
}
