:root {
  --bg: #fbf7f0;
  --surface: #fff;
  --ink: #1c1917;
  --muted: #6b625a;
  --accent: #c1462f;
  --rule: #e4dbcd;
  --ok: #2f7d54;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14110f;
    --surface: #1c1917;
    --ink: #f5efe6;
    --muted: #a1948a;
    --accent: #e2705a;
    --rule: #2e2823;
    --ok: #5fbd8a;
  }
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  line-height: 1.5;
}

header {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--rule);
  background: var(--surface);
}
header strong { font-family: ui-serif, Georgia, serif; font-size: 1.15rem; }
header .muted { margin-left: auto; }

main { max-width: 56rem; margin: 0 auto; padding: 2rem 1.5rem 4rem; }

h1 { font-family: ui-serif, Georgia, serif; font-size: 1.6rem; margin: 0 0 1rem; }
h2 { font-size: 1.05rem; margin: 0 0 1rem; }

.card {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

label { display: block; margin-bottom: 1rem; font-size: 0.85rem; font-weight: 600; color: var(--muted); }
input, select {
  display: block;
  width: 100%;
  margin-top: 0.35rem;
  padding: 0.6rem 0.7rem;
  font: inherit;
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--rule);
  border-radius: 8px;
}
input:focus, select:focus { outline: 2px solid var(--accent); outline-offset: 1px; }

button {
  font: inherit;
  font-weight: 600;
  padding: 0.6rem 1.1rem;
  border: 1px solid transparent;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
}
button:disabled { opacity: 0.5; cursor: default; }
button.ghost { background: transparent; color: var(--ink); border-color: var(--rule); }
button.small { padding: 0.3rem 0.75rem; font-size: 0.8rem; }

.grid { display: grid; gap: 0 1rem; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); }
.row { display: flex; gap: 0.75rem; align-items: center; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.muted { color: var(--muted); }
.small { font-size: 0.82rem; }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 0.65rem 0.5rem; border-bottom: 1px solid var(--rule); }
th { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
tr:last-child td { border-bottom: 0; }
td.actions { text-align: right; white-space: nowrap; }

.pill {
  display: inline-block;
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  border: 1px solid var(--rule);
}
.pill.inactive { color: var(--muted); }
.pill.owner { color: var(--accent); border-color: currentColor; }

.status {
  padding: 0.8rem 1rem;
  border-radius: 8px;
  border: 1px solid var(--accent);
  color: var(--accent);
}
.status.ok { border-color: var(--ok); color: var(--ok); }
