:root {
  --ink: #1c1915;
  --paper: #f4efe6;
  --card: #fffaf3;
  --line: #ddd4c6;
  --muted: #6f675c;
  --terracotta: #c45c26;
  --forest: #2f5d50;
  --gold: #c4a574;
  --ok: #2f5d50;
  --bad: #9b2c2c;
  --shadow: 0 18px 40px rgba(28, 25, 21, 0.08);
  --radius: 18px;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: "IBM Plex Sans", sans-serif;
  background:
    radial-gradient(1200px 500px at 90% -10%, rgba(196, 92, 38, 0.12), transparent 50%),
    var(--paper);
  color: var(--ink);
  display: grid;
  grid-template-columns: 250px 1fr;
}

.sidebar {
  min-height: 100vh;
  background: var(--ink);
  color: #f7f1e8;
  padding: 28px 20px;
  display: flex;
  flex-direction: column;
  gap: 28px;
  position: sticky;
  top: 0;
}
.brand { display: flex; gap: 12px; align-items: center; }
.brand strong { display: block; font-size: 20px; letter-spacing: -0.03em; }
.brand small { color: var(--gold); }
.pulse {
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--terracotta);
  box-shadow: 0 0 0 6px rgba(196, 92, 38, 0.25);
}
.sidebar nav { display: flex; flex-direction: column; gap: 6px; }
.sidebar a {
  color: #f7f1e8;
  text-decoration: none;
  padding: 10px 12px;
  border-radius: 12px;
  opacity: 0.78;
}
.sidebar a.is-active, .sidebar a:hover {
  background: rgba(255, 250, 243, 0.08);
  opacity: 1;
}
.sidebar-foot { margin-top: auto; }

.content { padding: 36px 40px 64px; max-width: 1180px; }
.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 12px;
  color: var(--terracotta);
  margin: 0 0 8px;
}
h1 {
  font-family: "IBM Plex Serif", serif;
  font-size: 40px;
  letter-spacing: -0.03em;
  margin: 0 0 10px;
}
h2 { margin: 0 0 12px; font-size: 20px; }
.lede { color: var(--muted); max-width: 640px; line-height: 1.5; }
.hero, .page-head {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: flex-start;
  margin-bottom: 28px;
}
.page-head.tight { margin-bottom: 12px; align-items: center; }
.page-actions, .action-stack, .inline { display: flex; gap: 10px; flex-wrap: wrap; }

.btn {
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink);
  border-radius: 999px;
  padding: 10px 16px;
  cursor: pointer;
  text-decoration: none;
  font: inherit;
}
.btn-primary {
  background: var(--terracotta);
  border-color: var(--terracotta);
  color: white;
}
.btn:disabled { opacity: 0.55; cursor: wait; }

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}
.kpi, .card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.kpi { padding: 18px; }
.kpi span { color: var(--muted); font-size: 13px; }
.kpi strong { display: block; font-size: 28px; margin-top: 8px; }
.card { padding: 22px; }
.card-row { display: grid; grid-template-columns: 1.2fr 0.8fr; gap: 16px; }
.steps { margin: 0; padding-left: 18px; color: var(--muted); line-height: 1.7; }
.path, code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  background: #efe7d8;
  padding: 2px 6px;
  border-radius: 6px;
}
.path { display: block; padding: 10px; margin: 8px 0; overflow-wrap: anywhere; }

.toolbar {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
}
input, select, textarea {
  font: inherit;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  background: white;
  color: var(--ink);
  width: 100%;
}
.toolbar input, .toolbar select { width: auto; min-width: 180px; }
.toolbar select { max-width: 320px; }
.table-wrap {
  overflow: auto;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--line); font-size: 14px; }
th { color: var(--muted); font-weight: 600; }
.row-actions { display: flex; gap: 8px; }
.row-actions button { padding: 6px 10px; font-size: 12px; }

.pill {
  display: inline-flex;
  padding: 6px 10px;
  border-radius: 999px;
  background: #3a342c;
  color: #f7f1e8;
  font-size: 12px;
}
.pill-ok { background: var(--forest); }
.muted { color: var(--muted); }
.banner {
  padding: 12px 16px;
  border-radius: 12px;
  margin-bottom: 18px;
}
.banner-ok { background: #e4efe8; color: var(--forest); }
.banner-bad { background: #f8e4e0; color: var(--bad); }
.stack { display: grid; gap: 12px; }
.inline input { flex: 1; }

.modal {
  border: 0;
  border-radius: 20px;
  padding: 0;
  width: min(520px, 92vw);
  box-shadow: var(--shadow);
}
.modal::backdrop { background: rgba(28, 25, 21, 0.45); }
.modal form { display: grid; gap: 10px; padding: 22px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; }
.check { display: flex; align-items: center; gap: 8px; }
.check input { width: auto; }

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  background: var(--ink);
  color: #fffaf3;
  padding: 14px 16px;
  border-radius: 14px;
  max-width: 360px;
  z-index: 20;
}
.toast a { color: var(--gold); }

@media (max-width: 980px) {
  body { grid-template-columns: 1fr; }
  .sidebar { min-height: auto; position: static; }
  .kpi-grid, .card-row { grid-template-columns: 1fr; }
  .content { padding: 24px 18px 48px; }
  h1 { font-size: 30px; }
}
