:root {
  --ink: #1d1a16;
  --muted: #6d655b;
  --paper: #f3efe6;
  --card: #fffdf8;
  --line: #e4d9c6;
  --sidebar: #1d1a16;
  --sidebar-soft: #2a251f;
  --accent: #d6f15c;
  --green: #1f6b45;
  --red: #8d2f2f;
  --amber: #8a5a12;
  --shadow: 0 16px 40px rgba(40, 30, 16, 0.06);
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  min-height: 100vh;
  background: var(--paper);
  color: var(--ink);
  font: 16px/1.5 "Segoe UI", system-ui, sans-serif;
}
h1, h2, h3 { font-family: Georgia, "Iowan Old Style", Palatino, serif; font-weight: 600; letter-spacing: -0.02em; }
h1 { font-size: 2rem; margin: 0 0 0.35rem; }
h2 { font-size: 1.25rem; margin: 0 0 0.75rem; }
p { margin: 0 0 0.8rem; }
a { color: inherit; }
code, .mono { font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; }

.app { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.side {
  background: var(--sidebar);
  color: #f6f1e7;
  padding: 22px 16px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}
.brand { display: flex; gap: 12px; align-items: center; text-decoration: none; color: inherit; }
.mark {
  width: 42px; height: 42px; border-radius: 11px;
  background: var(--accent); color: var(--ink);
  display: grid; place-items: center;
  font-family: Georgia, serif; font-weight: 700;
}
.brand strong { display: block; font-size: 0.95rem; }
.brand em { display: block; font-style: normal; color: #c9bfb0; font-size: 0.8rem; }
.nav { display: flex; flex-direction: column; gap: 4px; }
.nav a {
  text-decoration: none;
  padding: 9px 12px;
  border-radius: 9px;
  color: #efe8db;
}
.nav a.active, .nav a:hover { background: var(--sidebar-soft); }
.side-foot { margin-top: auto; padding-top: 12px; border-top: 1px solid #3a342c; }
.who { font-weight: 650; }
.role { color: #c9bfb0; font-size: 0.85rem; margin-bottom: 10px; text-transform: capitalize; }
.main { padding: 32px 36px 64px; max-width: 1100px; }
.banner, .flash {
  display: block;
  padding: 12px 14px;
  border-radius: 10px;
  margin-bottom: 16px;
  text-decoration: none;
}
.banner { background: #fff4cc; color: #5c4308; }
.flash-ok { background: #e5f6ec; color: #145233; }
.flash-bad { background: #fde8e6; color: #6f2420; }
.flash-warn { background: #fff4cc; color: #5c4308; }
.lead { color: var(--muted); max-width: 62ch; }
.page-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-end; margin-bottom: 22px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 18px;
  box-shadow: var(--shadow);
}
.stack { display: grid; gap: 16px; }
.grid-2 { display: grid; grid-template-columns: 1.2fr 0.8fr; gap: 16px; }
.checklist { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.checklist li { display: grid; grid-template-columns: 28px 1fr; gap: 10px; align-items: start; }
.tick {
  width: 22px; height: 22px; border-radius: 99px; display: grid; place-items: center;
  background: #efe8db; color: var(--muted); font-size: 0.8rem;
}
.tick.done { background: var(--green); color: white; }
.checklist a { font-weight: 650; }
.checklist p { margin: 0; color: var(--muted); font-size: 0.92rem; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 0.78rem; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); font-weight: 650; }
.pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 99px;
  font-size: 0.78rem;
  text-transform: capitalize;
  background: #efe8db;
}
.pill-ok { background: #e5f6ec; color: var(--green); }
.pill-bad { background: #fde8e6; color: var(--red); }
.pill-warn { background: #fff4cc; color: var(--amber); }
.pill-muted { background: #efe8db; color: var(--muted); }
.btn, button {
  appearance: none;
  border: 0;
  background: var(--accent);
  color: var(--ink);
  border-radius: 10px;
  padding: 10px 14px;
  font: inherit;
  font-weight: 650;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.btn-quiet, button.quiet {
  background: transparent;
  border: 1px solid var(--line);
}
.btn-danger, button.danger { background: var(--red); color: white; }
.btn-tiny, button.tiny { padding: 6px 10px; font-size: 0.88rem; }
label { display: block; font-size: 0.92rem; font-weight: 650; margin-bottom: 6px; }
fieldset { border: 1px solid var(--line); border-radius: 12px; margin: 0 0 14px; padding: 8px 14px 12px; }
legend { padding: 0 6px; font-weight: 650; }
.field { margin-bottom: 14px; }
input[type="text"], input[type="password"], input[type="number"], select, textarea {
  width: 100%;
  border: 1px solid #d9d0c0;
  background: white;
  border-radius: 10px;
  padding: 10px 12px;
  font: inherit;
  color: inherit;
}
textarea { min-height: 140px; resize: vertical; }
.help { color: var(--muted); font-size: 0.88rem; margin-top: 6px; }
.error { color: var(--red); margin-bottom: 12px; }
.check { display: flex; gap: 8px; align-items: flex-start; margin: 8px 0; font-weight: 500; }
.check input { margin-top: 4px; }
.kv { display: grid; grid-template-columns: 160px 1fr; gap: 6px 12px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
.log {
  background: #1d1a16;
  color: #f3efe6;
  border-radius: 12px;
  padding: 16px;
  min-height: 240px;
  max-height: 520px;
  overflow: auto;
  white-space: pre-wrap;
  font: 0.86rem/1.45 ui-monospace, Menlo, Consolas, monospace;
}
.status-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin: 12px 0; }
.status-grid label {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px;
  margin: 0;
  font-weight: 650;
  background: white;
}
.status-grid input { margin-right: 6px; }
.status-grid small { display: block; font-weight: 450; color: var(--muted); }
.tags { display: flex; gap: 6px; flex-wrap: wrap; }
.tag { background: #efe8db; border-radius: 99px; padding: 2px 8px; font-size: 0.82rem; }
.gate { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.gate main { width: min(460px, 100%); }
.gate .brand { margin-bottom: 18px; color: var(--ink); }
.gate .brand em { color: var(--muted); }
.split { display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.spaced { margin-top: 16px; }
.row-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
:focus-visible { outline: 2px solid #6d8a1f; outline-offset: 2px; }

@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .side { padding: 14px; }
  .nav { flex-direction: row; overflow: auto; }
  .side-foot { margin-top: 0; border-top: 0; padding-top: 0; }
  .main { padding: 20px 16px 48px; }
  .grid-2, .status-grid, .kv { grid-template-columns: 1fr; }
  .page-head { flex-direction: column; align-items: flex-start; }
}
