
:root {
  --bg: #f6f7f5; --panel: #ffffff; --text: #1d2420; --muted: #66706a; --line: #dfe3df;
  --brand: #2f6b3c; --ok: #2f7d3f; --ok-bg: #e5f3e8; --warn: #8a6100; --warn-bg: #fdf1d6;
  --bad: #a3271f; --bad-bg: #fbe4e2; --muted-bg: #eceeec;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #151a17; --panel: #1d2420; --text: #e6ebe7; --muted: #9aa59e; --line: #2f3833;
    --brand: #7cc68b; --ok: #8fd69c; --ok-bg: #1f3a25; --warn: #f0c060; --warn-bg: #3d3216;
    --bad: #f19a92; --bad-bg: #45201d; --muted-bg: #2a312d;
  }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text);
  font: 14px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: var(--brand); }
header.top { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px;
  padding: 10px 20px; background: var(--panel); border-bottom: 1px solid var(--line); }
.brand a { font-weight: 700; text-decoration: none; color: var(--text); font-size: 16px; }
.env { font-size: 11px; font-weight: 700; padding: 2px 6px; border-radius: 4px; margin-left: 6px; }
.env-prod { background: var(--bad-bg); color: var(--bad); }
.env-ua { background: var(--warn-bg); color: var(--warn); }
.db { color: var(--muted); font-size: 12px; margin-left: 4px; }
header.top { justify-content: space-between; }
.shell { display: grid; grid-template-columns: 210px minmax(0, 1fr); align-items: start; }
.shell.no-nav { display: block; }
nav.side { position: sticky; top: 0; max-height: 100vh; overflow-y: auto; padding: 12px 10px 24px;
  border-right: 1px solid var(--line); background: var(--panel); min-height: calc(100vh - 49px); }
.nav-group { margin-bottom: 10px; }
.nav-title { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
  color: var(--muted); padding: 6px 10px 2px; }
nav.side a { display: block; padding: 5px 10px; border-radius: 6px; text-decoration: none; color: var(--text); }
nav.side a.active, nav.side a:hover { background: var(--muted-bg); }
nav.side a.active { font-weight: 600; }
@media (max-width: 760px) {
  .shell { display: block; }
  nav.side { position: static; min-height: 0; max-height: none; border-right: 0;
    border-bottom: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 2px 10px; }
  .nav-group { margin: 0; }
  .nav-title { display: none; }
  nav.side a { display: inline-block; }
}
.who { display: flex; align-items: center; gap: 8px; color: var(--muted); margin: 0; }
main { padding: 16px 20px 48px; max-width: 1400px; min-width: 0; }
h1 { font-size: 22px; margin: 4px 0 16px; }
h2 { font-size: 16px; margin: 24px 0 8px; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; }
.card h3 { margin: 0 0 6px; font-size: 14px; }
.card .big { font-size: 22px; font-weight: 700; }
.muted { color: var(--muted); }
.table-wrap { overflow-x: auto; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; }
table { border-collapse: collapse; width: 100%; }
th, td { text-align: left; padding: 6px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 12px; color: var(--muted); font-weight: 600; white-space: nowrap; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
.badge { display: inline-block; padding: 1px 7px; border-radius: 10px; font-size: 12px; font-weight: 600; }
.badge-ok { background: var(--ok-bg); color: var(--ok); }
.badge-warn { background: var(--warn-bg); color: var(--warn); }
.badge-bad { background: var(--bad-bg); color: var(--bad); }
.badge-muted { background: var(--muted-bg); color: var(--muted); }
.flash { padding: 8px 12px; border-radius: 6px; }
.flash-ok { background: var(--ok-bg); color: var(--ok); }
.flash-bad { background: var(--bad-bg); color: var(--bad); }
form.inline { display: inline; }
input, select, button { font: inherit; }
input[type=email], input[type=text], select { padding: 5px 8px; border: 1px solid var(--line);
  border-radius: 6px; background: var(--panel); color: var(--text); }
button { padding: 5px 12px; border-radius: 6px; border: 1px solid var(--brand);
  background: var(--brand); color: #fff; cursor: pointer; }
button.secondary { background: transparent; color: var(--brand); }
button.link { background: none; border: 0; color: var(--brand); padding: 0; text-decoration: underline; }
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 8px 0 16px; }
ol.steps { margin: 6px 0 0 18px; padding: 0; }
.card.stack { margin-bottom: 12px; }
.card h3.sub { margin-top: 10px; }
.row.centered { justify-content: center; }
.sql textarea { width: 100%; min-height: 160px; padding: 8px; border: 1px solid var(--line);
  border-radius: 6px; background: var(--panel); color: var(--text);
  font: 13px/1.4 ui-monospace, Consolas, monospace; }
.results td { white-space: nowrap; max-width: 420px; overflow: hidden; text-overflow: ellipsis; }
.center { max-width: 420px; margin: 10vh auto; text-align: center; }
code { font-size: 12px; }
.small { font-size: 12px; }
pre.sql-view { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px;
  overflow-x: auto; font: 12px/1.45 ui-monospace, Consolas, monospace; white-space: pre; }
.notes textarea, .note-inline textarea { width: 100%; padding: 6px 8px; border: 1px solid var(--line);
  border-radius: 6px; background: var(--panel); color: var(--text); font: inherit; }
.note-inline { display: flex; gap: 6px; align-items: flex-start; min-width: 260px; }
.note-body { white-space: pre-wrap; }
label.setting { display: grid; grid-template-columns: 170px auto 1fr; gap: 8px; align-items: center; margin: 6px 0; }
label.setting > span:first-child { color: var(--muted); }
@media (max-width: 760px) { label.setting { grid-template-columns: 1fr; } }
ul.links { margin: 4px 0 8px 18px; padding: 0; }
ul.links li { margin: 2px 0; }
