:root {
  color-scheme: light;
  --bg: #f7f4ec;
  --surface: #fffdf8;
  --surface-strong: #fff6de;
  --ink: #1f1c16;
  --ink-soft: #5d5548;
  --line: #d7cab0;
  --accent: #0d6a57;
  --accent-soft: #d8efe8;
  --danger: #8a2b2b;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  background: radial-gradient(circle at top, #fff6de 0%, var(--bg) 48%, #efe5d5 100%);
  color: var(--ink);
}

a {
  color: var(--accent);
}

button,
input,
select,
textarea {
  font: inherit;
}

.app-shell__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.5rem;
  background: rgba(255, 253, 248, 0.95);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  backdrop-filter: blur(14px);
}

.app-shell__nav {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.app-shell__main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.5rem;
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.page-header h1,
.page-header h2,
.page-header h3 {
  margin: 0;
}

.card,
.table-card,
.form-card,
.stat-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 1rem 1.2rem;
  box-shadow: 0 12px 28px rgba(60, 44, 16, 0.06);
}

.grid {
  display: grid;
  gap: 1rem;
}

.grid--stats {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  margin-bottom: 1.5rem;
}

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

.table-card table {
  width: 100%;
  border-collapse: collapse;
}

.table-card th,
.table-card td {
  padding: 0.7rem 0;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.table-card tr:last-child th,
.table-card tr:last-child td {
  border-bottom: 0;
}

.pill {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.88rem;
}

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

.stack {
  display: grid;
  gap: 0.8rem;
}

.field {
  display: grid;
  gap: 0.35rem;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 0.7rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

.actions {
  display: flex;
  gap: 0.7rem;
  align-items: center;
  flex-wrap: wrap;
}

.button,
.actions input[type="submit"],
.actions button,
.link-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.65rem 0.95rem;
  border-radius: 999px;
  border: 1px solid transparent;
  background: var(--accent);
  color: white;
  text-decoration: none;
  cursor: pointer;
}

.button--secondary {
  background: transparent;
  color: var(--accent);
  border-color: var(--line);
}

.link-button {
  appearance: none;
}

.flash {
  margin-bottom: 1rem;
  padding: 0.85rem 1rem;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface-strong);
}

.flash--alert {
  border-color: #e4b6b6;
  background: #fff2f2;
  color: var(--danger);
}

.errors {
  padding: 0.8rem 1rem;
  border-radius: 12px;
  border: 1px solid #e4b6b6;
  background: #fff2f2;
  color: var(--danger);
}
