:root {
  color-scheme: light;
  --bg: #f3f2f1;
  --card: #ffffff;
  --text: #201f1e;
  --muted: #605e5c;
  --border: #e1dfdd;
  --border-dark: #c8c6c4;
  --accent: #0078d4;
  --accent-dark: #106ebe;
  --mint: #52bcb4;
  --navy: #0b3a5b;
  --ok: #107c10;
  --danger: #a4262c;
  --side: #0b3a5b;
  --font: "Segoe UI", "Segoe UI Variable", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font-family: var(--font);
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Public landing */
.landing {
  min-height: 100%;
  display: flex;
  flex-direction: column;
}
.landing-top {
  background: #fff;
  border-bottom: 1px solid var(--border);
  padding: 14px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.landing-top img { height: 36px; width: auto; }
.landing-hero {
  max-width: 720px;
  margin: 56px auto;
  background: #fff;
  border: 1px solid var(--border);
  box-shadow: 0 2px 8px rgba(0,0,0,.06);
  padding: 40px 44px;
}
.landing-hero h1 {
  margin: 0 0 10px;
  font-size: 28px;
  font-weight: 600;
  color: var(--navy);
}
.landing-hero p { color: var(--muted); line-height: 1.5; }
.landing-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 22px; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 36px;
  padding: 0 16px;
  border: 1px solid var(--border-dark);
  background: #fff;
  color: var(--text);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  border-radius: 2px;
}
.btn:hover { background: #edebe9; text-decoration: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-dark); }
.btn.mint { background: var(--mint); border-color: var(--mint); color: #0b3a5b; }
code, .mono {
  font-family: Consolas, "Cascadia Mono", monospace;
  font-size: 12px;
  background: #f3f2f1;
  padding: 1px 6px;
  border-radius: 2px;
}

/* Login */
.login-wrap {
  min-height: 100%;
  display: grid;
  place-items: center;
  padding: 32px 16px;
  background: linear-gradient(160deg, #0b3a5b 0%, #0f4c6e 45%, #52bcb4 160%);
}
.login-card {
  width: 420px;
  max-width: 100%;
  background: #fff;
  border: 1px solid var(--border);
  box-shadow: 0 8px 28px rgba(0,0,0,.18);
  padding: 36px 40px 28px;
}
.login-card img { height: 40px; margin-bottom: 20px; }
.login-card h1 { margin: 0 0 6px; font-size: 22px; }
.login-card .lead { margin: 0 0 20px; color: var(--muted); font-size: 13px; }

/* App shell */
.app { display: flex; min-height: 100%; }
.side {
  width: 240px;
  flex-shrink: 0;
  background: var(--side);
  color: #fff;
  display: flex;
  flex-direction: column;
  padding: 16px 0;
}
.brand {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px 20px 20px;
  color: #fff;
  text-decoration: none;
}
.brand img {
  height: 28px;
  width: auto;
  filter: brightness(0) invert(1);
}
.brand span { font-size: 12px; opacity: .8; }
.side nav { display: flex; flex-direction: column; gap: 2px; padding: 0 10px; flex: 1; }
.side nav a {
  color: #dce9f2;
  text-decoration: none;
  padding: 10px 12px;
  border-radius: 4px;
  font-weight: 600;
  font-size: 13px;
}
.side nav a:hover { background: rgba(255,255,255,.08); text-decoration: none; }
.side nav a.is-on { background: rgba(82,188,180,.28); color: #fff; }
.side-foot {
  padding: 16px 20px;
  border-top: 1px solid rgba(255,255,255,.12);
  font-size: 12px;
}
.side-foot .who { font-weight: 600; margin-bottom: 6px; }
.side-foot a { color: #9fd9d3; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.top {
  height: 56px;
  background: #fff;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
}
.top h1 { margin: 0; font-size: 18px; font-weight: 600; }
.top .ghost { color: var(--muted); font-size: 12px; }
.content { padding: 24px 28px 40px; max-width: 980px; }

.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 20px; }
@media (max-width: 900px) {
  .app { flex-direction: column; }
  .side { width: 100%; }
  .grid { grid-template-columns: 1fr; }
}
.kpi {
  background: #fff;
  border: 1px solid var(--border);
  padding: 16px;
  border-radius: 4px;
}
.kpi span { display: block; color: var(--muted); font-size: 12px; font-weight: 600; }
.kpi b { display: block; margin-top: 6px; font-size: 18px; }
.kpi.ok b { color: var(--ok); }
.kpi.warn b { color: #8a6914; }
.kpi.bad b { color: var(--danger); }

.card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 20px 22px;
  margin-bottom: 16px;
  box-shadow: 0 1px 2px rgba(0,0,0,.03);
}
.card h2 {
  margin: 0 0 6px;
  font-size: 16px;
  font-weight: 600;
}
.card .hint { margin: 0 0 16px; color: var(--muted); font-size: 13px; line-height: 1.45; }

.fields { display: grid; gap: 14px; }
.fields.two { grid-template-columns: 1fr 1fr; }
@media (max-width: 700px) { .fields.two { grid-template-columns: 1fr; } }

.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 12px; font-weight: 600; color: var(--text); }
.field input, .field select, .field textarea {
  border: 1px solid var(--border-dark);
  border-radius: 2px;
  padding: 8px 10px;
  font: inherit;
  color: var(--text);
  background: #fff;
  min-height: 36px;
}
.field textarea { min-height: 90px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}
.field .help { font-size: 12px; color: var(--muted); }
.chk {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  cursor: pointer;
}
.chk input { width: 16px; height: 16px; accent-color: var(--accent); }

.actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; align-items: center; }
.flash {
  padding: 10px 12px;
  border-left: 3px solid;
  margin: 0 0 16px;
  font-size: 13px;
}
.flash.ok { background: #dff6dd; border-color: var(--ok); color: #0b6a0b; }
.flash.err { background: #fde7e9; border-color: var(--danger); color: var(--danger); }

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.table th, .table td {
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.table th { color: var(--muted); font-weight: 600; font-size: 12px; background: #faf9f8; }
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 2px;
  font-size: 12px;
  font-weight: 600;
  background: #deecf9;
  color: #004578;
}
.badge.ok { background: #dff6dd; color: #0b6a0b; }
.badge.warn { background: #fff4ce; color: #6c5700; }
.badge.bad { background: #fde7e9; color: #a4262c; }

.endpoint {
  font-family: Consolas, monospace;
  font-size: 12px;
  background: #f3f2f1;
  padding: 2px 6px;
  border-radius: 2px;
  white-space: nowrap;
}
.method {
  display: inline-block;
  min-width: 52px;
  font-weight: 700;
  font-size: 11px;
  color: var(--accent);
}
.toc { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.toc a {
  background: #fff;
  border: 1px solid var(--border);
  padding: 6px 10px;
  border-radius: 2px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
}
.toc a:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }
