:root {
  --bg: #fbf6ef;
  --card: #ffffff;
  --ink: #3f2412;
  --muted: rgba(63, 36, 18, 0.68);
  --line: #ead7c7;
  --soft: #f7efe8;
  --accent: #b36f3d;
  --accent-dark: #7a431f;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a { color: inherit; text-decoration: none; }

.app-shell {
  min-height: 100vh;
}

.topbar {
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.84);
}

.topbar-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 24px;
  color: var(--accent-dark);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 14px;
}

.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 28px 20px 56px;
}

.page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

.head-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.section-title {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 28px;
  line-height: 1.15;
  color: var(--accent-dark);
}

.subtle {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(91, 52, 28, 0.06);
}

.card-pad { padding: 24px; }

.stack { display: grid; gap: 24px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  border-radius: 6px;
  padding: 8px 14px;
  border: 1px solid transparent;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  background: transparent;
}

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

.btn-primary:hover { background: var(--accent-dark); }

.btn-secondary {
  background: #fff;
  border-color: var(--line);
  color: var(--ink);
}

.btn-secondary:hover { background: var(--soft); }

.btn-ghost {
  color: var(--accent-dark);
}

.btn-ghost:hover { background: var(--soft); }

.btn-danger {
  color: #a12f2f;
}

.input, textarea, select {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  padding: 9px 11px;
  font: inherit;
  font-size: 14px;
}

textarea { resize: vertical; }

.input:focus, textarea:focus, select:focus {
  outline: 2px solid rgba(179, 111, 61, 0.25);
  border-color: var(--accent);
}

.label {
  display: block;
  margin-bottom: 6px;
  font-size: 14px;
  font-weight: 650;
}

.form-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 20px;
}

.list {
  display: grid;
}

.list-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}

.list-row:last-child { border-bottom: 0; }
.list-row:hover { background: rgba(247, 239, 232, 0.58); }

.row-title {
  margin: 0 0 4px;
  font-weight: 700;
}

.row-meta {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.search {
  display: flex;
  gap: 10px;
  max-width: 560px;
  margin-bottom: 18px;
}

.pill-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pill {
  display: inline-flex;
  align-items: center;
  cursor: pointer;
}

.pill input { position: absolute; opacity: 0; pointer-events: none; }

.pill span {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 14px;
  background: #fff;
}

.pill input:checked + span {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.checks {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  font-size: 14px;
}

.check {
  display: flex;
  align-items: center;
  gap: 8px;
}

.alert {
  border: 1px solid #efcaca;
  background: #fff5f5;
  color: #9d2424;
  padding: 10px 12px;
  border-radius: 6px;
  font-size: 14px;
}

.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-card {
  width: min(448px, 100%);
  padding: 32px;
}

.login-title {
  margin: 0;
  text-align: center;
  font-family: Georgia, "Times New Roman", serif;
  color: var(--accent-dark);
  font-size: 42px;
}

.login-subtitle {
  margin: 0;
  text-align: center;
  color: var(--accent);
  font-family: Georgia, "Times New Roman", serif;
  font-style: italic;
}

@media (max-width: 760px) {
  .page-head, .topbar-inner, .form-actions { align-items: flex-start; flex-direction: column; }
  .grid-2, .grid-3, .checks { grid-template-columns: 1fr; }
  .search { flex-direction: column; }
}
