:root {
  /* Aligned with https://roskildebraendesalg.dk/ */
  --sidebar-w: 16rem;
  --bg: #f3f5f1;
  --bg-deep: #e9ede6;
  --surface: #fbfcf9;
  --surface-raised: #ffffff;
  --border: #d9ded3;
  --border-strong: #c5cdb8;
  --text: #292929;
  --muted: #5c6358;
  --brand: #61a229;
  --brand-dark: #4e8221;
  --brand-olive: #5e7001;
  --brand-soft: #e7f3d8;
  --brand-ink: #263b27;
  --sidebar-bg: #263b27;
  --sidebar-bg-2: #1c2c1e;
  --sidebar-text: #e8eee6;
  --sidebar-muted: #a3b39e;
  --ok: #4e8221;
  --ok-bg: #e8f4dc;
  --warn: #b45309;
  --warn-bg: #fff1e0;
  --fail: #b42318;
  --fail-bg: #fdeceb;
  --skip: #5c6358;
  --skip-bg: #e8ebe4;
  --pending: #2f6fed;
  --pending-bg: #e8f0ff;
  --shadow: 0 1px 2px rgba(38, 59, 39, 0.05), 0 8px 24px rgba(38, 59, 39, 0.06);
  --radius: 0.75rem;
  --pattern: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23263b27' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

* { box-sizing: border-box; }
html { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
body {
  margin: 0;
  font-family: "IBM Plex Sans", ui-sans-serif, system-ui, sans-serif;
  color: var(--text);
  background:
    radial-gradient(ellipse 90% 55% at 100% -10%, rgba(94, 112, 1, 0.10), transparent 50%),
    radial-gradient(ellipse 70% 45% at -5% 20%, rgba(97, 162, 41, 0.12), transparent 45%),
    var(--pattern),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-deep) 100%);
  background-attachment: fixed;
  font-size: 0.9375rem;
  line-height: 1.5;
}
a { color: var(--brand-ink); text-decoration: none; }
a:hover { text-decoration: underline; }
.muted { color: var(--muted); }
.text-xs { font-size: 0.75rem; }
.text-sm { font-size: 0.875rem; }
.text-right { text-align: right; }
.nowrap { white-space: nowrap; }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 0.35rem; }
.mb-2 { margin-bottom: 0.65rem; }
.mb-3 { margin-bottom: 1rem; }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.75rem; }
.mt-3 { margin-top: 1rem; }
.row-gap { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; }
.page-head-split {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  align-items: flex-end;
}
.pager { padding: 0.75rem 1.1rem; border-top: 1px solid var(--border); }
.toolbar-plain {
  margin: 0;
  box-shadow: none;
  border: 0;
  padding: 0;
  background: transparent;
}
.seg {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: 0.55rem;
  overflow: hidden;
  background: var(--surface-raised);
}
.seg-btn {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 0.4rem 0.75rem;
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--muted);
  cursor: pointer;
  border-right: 1px solid var(--border);
}
.seg-btn:last-child { border-right: 0; }
.seg-btn:hover { color: var(--text); background: rgba(97, 162, 41, 0.08); }
.seg-btn.is-active {
  color: #fff;
  background: var(--brand);
}
.w-check { width: 2.5rem; }
.mono, .tabular { font-family: "IBM Plex Mono", ui-monospace, monospace; font-variant-numeric: tabular-nums; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); border: 0;
}

/* —— Shell —— */
.dash {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  min-height: 100vh;
}
.dash-sidebar {
  background:
    linear-gradient(175deg, rgba(94, 112, 1, 0.22) 0%, transparent 32%),
    linear-gradient(180deg, var(--sidebar-bg) 0%, var(--sidebar-bg-2) 100%);
  border-right: 1px solid rgba(255,255,255,0.06);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 30;
  color: var(--sidebar-text);
}
.dash-brand {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.55rem;
  padding: 1.15rem 1.1rem 1rem;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  text-decoration: none;
  color: inherit;
}
.dash-brand:hover { text-decoration: none; }
.dash-logo {
  display: block;
  width: 100%;
  max-width: 11.5rem;
  height: auto;
  border-radius: 0.4rem;
}
.dash-brand-meta {
  display: block;
  padding-left: 0.1rem;
}
.dash-brand-meta strong {
  display: block;
  font-size: 0.88rem;
  line-height: 1.2;
  color: #f4faf6;
  letter-spacing: -0.01em;
}
.dash-brand-meta span {
  display: block;
  font-size: 0.72rem;
  color: var(--sidebar-muted);
  margin-top: 0.12rem;
}

.dash-nav {
  padding: 0.95rem 0.7rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  flex: 1;
  overflow-y: auto;
}
.dash-nav-label {
  font-size: 0.6875rem;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--sidebar-muted);
  padding: 0.7rem 0.65rem 0.35rem;
}
.dash-link {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.58rem 0.75rem;
  border-radius: 0.6rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: #b8d0c2;
  text-decoration: none;
  transition: background .14s, color .14s, transform .14s;
}
.dash-link:hover {
  background: rgba(255,255,255,0.07);
  color: #fff;
  text-decoration: none;
}
.dash-link.is-active {
  background: linear-gradient(90deg, #61a229, #4e8221);
  color: #fff;
  font-weight: 650;
  box-shadow: 0 4px 14px rgba(0,0,0,0.18);
}
.dash-link svg { width: 1.1rem; height: 1.1rem; flex-shrink: 0; opacity: .85; }
.dash-link.is-active svg { opacity: 1; color: #fff; }
.dash-link .nav-count {
  margin-left: auto;
  background: rgba(180, 35, 24, 0.9);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.12rem 0.45rem;
  border-radius: 999px;
  min-width: 1.25rem;
  text-align: center;
}

.dash-foot {
  border-top: 1px solid rgba(255,255,255,0.08);
  padding: 1rem 1.1rem 1.15rem;
  background: rgba(0,0,0,0.12);
}
.dash-foot .name { font-size: 0.875rem; font-weight: 600; color: #f0f7f3; }
.dash-foot .email { font-size: 0.75rem; color: var(--sidebar-muted); margin-top: 0.1rem; word-break: break-all; }
.linkish {
  background: none; border: 0; padding: 0; margin-top: 0.5rem;
  color: #9dcc6a; font: inherit; font-size: 0.8rem; font-weight: 600; cursor: pointer;
}
.linkish:hover { text-decoration: underline; color: #fff; }

.dash-main { min-width: 0; display: flex; flex-direction: column; }
.dash-header {
  background: rgba(251, 252, 251, 0.82);
  backdrop-filter: blur(12px) saturate(1.2);
  border-bottom: 1px solid rgba(213, 221, 214, 0.9);
  padding: 0.95rem 1.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  position: sticky;
  top: 0;
  z-index: 20;
}
.dash-header h1 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--brand-ink);
}
.dash-header .crumb { font-size: 0.75rem; color: var(--muted); margin-top: 0.15rem; }
.dash-content { padding: 1.45rem 1.75rem 2.75rem; }

/* —— Page —— */
.page-head { margin-bottom: 1.25rem; }
.page-head-lede { margin-bottom: 1rem; }
.page-head-lede .page-sub { margin: 0; max-width: 40rem; }
.page-title {
  margin: 0;
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.page-sub { margin: 0.3rem 0 0; color: var(--muted); font-size: 0.9rem; max-width: 42rem; }
.page-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }

/* —— Cards / panels —— */
.panel {
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 1rem;
  overflow: hidden;
}
.panel-hd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.95rem 1.15rem;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, #f5f7f1 0%, #fbfcf9 100%);
}
.panel-hd h2 {
  margin: 0;
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--brand-ink);
}
.panel-bd { padding: 1rem 1.15rem; }
.panel-bd.flush { padding: 0; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }

/* —— KPI —— */
.kpis {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0.85rem;
  margin-bottom: 1.2rem;
}
.kpis-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.kpi-link {
  display: block;
  color: inherit;
  text-decoration: none;
  transition: border-color .15s ease, transform .15s ease, box-shadow .15s ease;
}
.kpi-link:hover {
  text-decoration: none;
  border-color: var(--border-strong);
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(38, 59, 39, 0.08);
}
.mode-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 0.95rem 1.15rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface-raised);
  margin-bottom: 1.2rem;
  box-shadow: var(--shadow);
}
.mode-strip.is-dry {
  border-color: #f0c090;
  background: linear-gradient(120deg, #fff8ef, #fff3e4);
}
.mode-strip.is-live {
  border-color: #a8d07a;
  background: linear-gradient(120deg, #f4faec, #eaf6dc);
}
.mode-strip-main { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
.adv-inline {
  border: 1px solid var(--border);
  border-radius: 0.65rem;
  background: #f3f6ee;
  padding: 0;
}
.adv-inline > summary {
  cursor: pointer;
  list-style: none;
  padding: 0.7rem 0.9rem;
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--muted);
  user-select: none;
}
.adv-inline > summary::-webkit-details-marker { display: none; }
.adv-inline[open] > summary { border-bottom: 1px solid var(--border); color: var(--text); }
.adv-inline-body {
  display: grid;
  gap: 1rem;
  padding: 0.9rem;
}
.adv-block {
  margin: 0 0 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-raised);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.adv-block > summary {
  cursor: pointer;
  list-style: none;
  padding: 0.85rem 1.1rem;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--muted);
  user-select: none;
}
.adv-block > summary::-webkit-details-marker { display: none; }
.adv-block[open] > summary {
  border-bottom: 1px solid var(--border);
  color: var(--text);
}
.adv-block .table-wrap,
.adv-block .code { border-radius: 0; }
.kpi {
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1rem 1.05rem;
  position: relative;
  overflow: hidden;
}
.kpi::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 4px;
  background: var(--border);
}
.kpi[data-tone="ok"]::before { background: linear-gradient(180deg, #78b83a, var(--brand-dark)); }
.kpi[data-tone="fail"]::before { background: linear-gradient(180deg, #e06b5c, var(--fail)); }
.kpi[data-tone="warn"]::before { background: linear-gradient(180deg, #e2a045, var(--warn)); }
.kpi[data-tone="skip"]::before { background: #94a3b8; }
.kpi[data-tone="pending"]::before { background: var(--pending); }
.kpi .label {
  font-size: 0.72rem;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}
.kpi .value {
  margin-top: 0.4rem;
  font-size: 1.7rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
  color: var(--brand-ink);
}

/* —— Status badges —— */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  border-radius: 999px;
  padding: 0.18rem 0.55rem;
  font-size: 0.72rem;
  font-weight: 650;
  line-height: 1.2;
  background: #f1f5f9;
  color: #334155;
  white-space: nowrap;
}
.badge::before {
  content: "";
  width: 0.4rem;
  height: 0.4rem;
  border-radius: 50%;
  background: currentColor;
  opacity: .85;
}
.badge-ok { background: var(--ok-bg); color: var(--ok); }
.badge-warn { background: var(--warn-bg); color: var(--warn); }
.badge-fail { background: var(--fail-bg); color: var(--fail); }
.badge-skip { background: var(--skip-bg); color: var(--skip); }
.badge-pending { background: var(--pending-bg); color: var(--pending); }
.tag {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.45rem;
  border-radius: 0.35rem;
  font-size: 0.72rem;
  font-weight: 600;
  background: #f1f5f9;
  color: #475569;
}
.tag-dry { background: #fef9c3; color: #854d0e; }

/* —— Tables —— */
.table-wrap { overflow-x: auto; }
table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}
table.data th {
  text-align: left;
  padding: 0.7rem 1.1rem;
  font-size: 0.7rem;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  background: linear-gradient(180deg, #f2f5ec, #eef2e8);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
table.data td {
  padding: 0.75rem 1.1rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
table.data tbody tr:hover { background: rgba(97, 162, 41, 0.06); }
table.data tbody tr:last-child td { border-bottom: 0; }
table.data .ref-link {
  font-weight: 650;
  color: var(--brand-ink);
  text-decoration: none;
}
table.data .ref-link:hover { color: var(--brand); text-decoration: underline; }
.empty {
  padding: 2rem 1.1rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
}

/* —— Toolbar / filters —— */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  align-items: center;
  margin-bottom: 0.85rem;
  padding: 0.8rem 0.95rem;
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.toolbar .spacer { flex: 1; min-width: 0.5rem; }
.field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: #334155;
  min-width: 0;
}
.field .hint { font-weight: 400; color: var(--muted); font-size: 0.75rem; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; align-items: start; }

/* Unified control surface — matches all text-like inputs (incl. bare <input>) */
.control,
input:not([type]),
input[type="text"],
input[type="email"],
input[type="password"],
input[type="search"],
input[type="number"],
input[type="url"],
input[type="tel"],
input[type="date"],
input[type="time"],
select,
textarea {
  display: block;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  padding: 0.55rem 0.75rem;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 400;
  line-height: 1.35;
  background: #fff;
  color: var(--text);
  min-height: 2.5rem;
  appearance: none;
  -webkit-appearance: none;
  transition: border-color .12s, box-shadow .12s;
}
select.control,
select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.7rem center;
  background-size: 1rem;
  padding-right: 2.25rem;
  cursor: pointer;
}
.control:focus,
input:not([type]):focus,
input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="search"]:focus,
input[type="number"]:focus,
input[type="url"]:focus,
input[type="tel"]:focus,
input[type="date"]:focus,
input[type="time"]:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(97, 162, 41, 0.22);
}
.control::placeholder,
input::placeholder,
textarea::placeholder {
  color: #94a3b8;
  opacity: 1;
}
textarea.control,
textarea {
  min-height: 5rem;
  resize: vertical;
  line-height: 1.45;
}
.control-inline {
  width: auto;
  min-width: 10rem;
  flex: 0 1 auto;
}
.control-grow {
  flex: 1 1 14rem;
  min-width: 12rem;
  width: auto;
}
.toolbar .control,
.toolbar input:not([type="checkbox"]),
.toolbar select {
  width: auto;
  min-width: 10rem;
  min-height: 2.5rem;
}
.toolbar .control-grow,
.toolbar input[type="search"].control-grow {
  flex: 1 1 14rem;
  min-width: 12rem;
  width: auto;
}
.input-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}
.input-pair .control,
.input-pair input {
  width: 100%;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  border: 1px solid transparent;
  border-radius: 0.45rem;
  padding: 0.6rem 1.1rem;
  font: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1.25;
  cursor: pointer;
  background: var(--brand);
  color: #fff;
  text-decoration: none;
  min-height: 2.55rem;
  box-shadow: none;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease, box-shadow .15s ease;
}
.btn:hover {
  background: var(--brand-dark);
  text-decoration: none;
  color: #fff;
}
.btn:active {
  background: #3f6a1b;
}
.btn:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}
.btn:disabled {
  opacity: .45;
  cursor: not-allowed;
  background: var(--brand);
  box-shadow: none;
}
.btn svg { width: 1rem; height: 1rem; flex-shrink: 0; }

/* —— Loading —— */
.spinner {
  width: 1rem;
  height: 1rem;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
  animation: spin 0.7s linear infinite;
  vertical-align: -0.15em;
}
.spinner-sm { width: 0.85rem; height: 0.85rem; border-width: 1.5px; }
@keyframes spin { to { transform: rotate(360deg); } }
.busy-banner {
  align-items: center;
  gap: 0.65rem;
  margin-top: 0.85rem;
  padding: 0.7rem 0.9rem;
  border-radius: 0.55rem;
  border: 1px solid #bfdbfe;
  background: #eff6ff;
  color: #1e40af;
  font-size: 0.875rem;
  font-weight: 500;
}
.modal-backdrop.is-busy {
  cursor: wait;
}

.btn-secondary {
  background: var(--surface-raised);
  color: var(--brand-ink);
  border-color: var(--border-strong);
}
.btn-secondary:hover {
  background: var(--brand-soft);
  border-color: #b7c9a3;
  color: var(--brand-ink);
}
.btn-secondary:active {
  background: #dce9cb;
}
.btn-ghost {
  background: transparent;
  color: var(--muted);
  border-color: transparent;
}
.btn-ghost:hover {
  background: rgba(97, 162, 41, 0.10);
  color: var(--brand-ink);
}
.btn-ghost:active {
  background: rgba(97, 162, 41, 0.16);
}
.btn-danger {
  background: var(--fail);
  color: #fff;
}
.btn-danger:hover { background: #9f1f15; color: #fff; }
.btn-danger:active { background: #8a1a12; }
.btn-sm {
  padding: 0.35rem 0.7rem;
  min-height: 2rem;
  font-size: 0.8rem;
  border-radius: 0.4rem;
}

/* —— Alerts —— */
.flash, .alert {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  padding: 0.8rem 1rem;
  border-radius: 0.65rem;
  margin-bottom: 1rem;
  border: 1px solid transparent;
  font-size: 0.9rem;
}
.flash, .alert-ok { background: #ecfdf5; border-color: #a7f3d0; color: #065f46; }
.alert-warn { background: #fffbeb; border-color: #fde68a; color: #92400e; }
.alert-fail { background: #fef2f2; border-color: #fecaca; color: #991b1b; }
.alert-info { background: #eff6ff; border-color: #bfdbfe; color: #1e40af; }

/* —— Modal —— */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  background: rgba(28, 44, 30, 0.45);
}
.modal {
  width: min(100%, 26rem);
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border-top: 3px solid var(--brand);
}
.modal-ok { border-top-color: var(--ok); }
.modal-warn { border-top-color: var(--warn); }
.modal-fail { border-top-color: var(--fail); }
.modal-info { border-top-color: var(--pending); }
.modal-hd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1rem 1.1rem 0.35rem;
}
.modal-hd h2 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--brand-ink);
}
.modal-close {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.15rem 0.35rem;
  border-radius: 0.35rem;
}
.modal-close:hover { background: var(--bg); color: var(--text); }
.modal-bd {
  padding: 0.35rem 1.1rem 1rem;
  color: var(--text);
  font-size: 0.925rem;
  line-height: 1.45;
}
.modal-bd p { margin: 0; }
.modal-ft {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  flex-wrap: wrap;
  padding: 0 1.1rem 1.1rem;
}

/* —— Connection / meta —— */
.status-list { display: grid; gap: 0.7rem; }
.status-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 0.65rem;
  background: linear-gradient(180deg, #f6f8f1, #f1f4eb);
}
.status-row .dot {
  width: 0.55rem; height: 0.55rem; border-radius: 50%; flex-shrink: 0;
}
.status-row .dot.ok { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-bg); }
.status-row .dot.bad { background: var(--fail); box-shadow: 0 0 0 3px var(--fail-bg); }
.status-row .meta { margin-left: auto; font-size: 0.75rem; color: var(--muted); }

/* —— Timeline —— */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li {
  position: relative;
  padding: 0 0 1rem 1.15rem;
  border-left: 2px solid var(--border);
  margin-left: 0.35rem;
}
.timeline li:last-child { padding-bottom: 0; }
.timeline li::before {
  content: "";
  position: absolute;
  left: -0.35rem;
  top: 0.25rem;
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: var(--brand);
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px var(--border);
}
.timeline .when { font-size: 0.75rem; color: var(--muted); margin-top: 0.15rem; }

/* —— Definition list —— */
.defs { display: grid; gap: 0; }
.defs .row {
  display: grid;
  grid-template-columns: 9rem 1fr;
  gap: 0.75rem;
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.875rem;
}
.defs .row:last-child { border-bottom: 0; }
.defs dt { color: var(--muted); font-weight: 500; }
.defs dd { margin: 0; font-weight: 500; word-break: break-word; }

pre.code {
  margin: 0;
  padding: 1rem 1.1rem;
  background: #0f172a;
  color: #e2e8f0;
  border-radius: 0;
  overflow: auto;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.75rem;
  line-height: 1.55;
  max-height: 28rem;
}

.form-stack { display: grid; gap: 1rem; max-width: 44rem; padding: 1.1rem; }
.form-section-title {
  margin: 0.5rem 0 0;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #94a3b8;
}
.check {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 500;
  font-size: 0.875rem;
}
.check input { width: 1rem; height: 1rem; accent-color: var(--brand); }

/* Pagination */
nav[role="navigation"][aria-label="Pagination Navigation"],
.pagination { margin: 1rem 1.1rem; }

/* —— Login —— */
.guest {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1.5rem;
  background:
    radial-gradient(ellipse 70% 45% at 20% 0%, rgba(97, 162, 41, 0.22), transparent 55%),
    radial-gradient(ellipse 55% 40% at 100% 100%, rgba(94, 112, 1, 0.18), transparent 50%),
    linear-gradient(165deg, var(--sidebar-bg) 0%, var(--sidebar-bg-2) 55%, #121a13 100%);
}
.login {
  width: min(420px, 100%);
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}
.login-brand {
  text-align: center;
  padding: 0.25rem 0.5rem 0;
}
.login-logo {
  display: block;
  width: min(16rem, 88%);
  height: auto;
  margin: 0 auto;
  /* Logo is white-on-black — blend into dark guest bg */
  mix-blend-mode: lighten;
}
.login-tag {
  margin: 0.85rem 0 0;
  color: var(--sidebar-muted);
  font-size: 0.82rem;
  letter-spacing: 0.01em;
}
.login-card {
  background: var(--surface-raised);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 1rem;
  box-shadow: 0 22px 50px rgba(0, 0, 0, 0.35);
  padding: 1.65rem 1.75rem 1.75rem;
}
.login-card h1 { margin: 0; font-size: 1.35rem; letter-spacing: -0.02em; color: var(--brand-ink); }
.login-card .lede { margin: 0.3rem 0 1.2rem; color: var(--muted); font-size: 0.9rem; }
.login-card .form-stack { max-width: none; padding: 0; }
.error { color: var(--fail); font-size: 0.8rem; font-weight: 500; }

@media (max-width: 1100px) {
  .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .kpis-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .dash { grid-template-columns: 1fr; }
  .dash-sidebar {
    position: relative;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid rgba(255,255,255,0.08);
  }
  .dash-nav { flex-direction: row; flex-wrap: wrap; }
  .dash-nav-label { width: 100%; }
  .grid-2, .grid-3, .field-row { grid-template-columns: 1fr; }
  .dash-content, .dash-header { padding-left: 1rem; padding-right: 1rem; }
  .kpis, .kpis-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .defs .row { grid-template-columns: 1fr; gap: 0.2rem; }
}
