:root {
  --bg: #f4f6f8;
  --sidebar: #111827;
  --sidebar-soft: #1f2937;
  --sidebar-line: #374151;
  --panel: #ffffff;
  --ink: #1f2937;
  --muted: #667085;
  --line: #d8dee8;
  --accent: #0f766e;
  --accent-strong: #115e59;
  --focus: #2563eb;
  --warn: #b45309;
  --danger: #b91c1c;
  --good: #15803d;
  --soft: #eaf4f2;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .08);
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 14px/1.45 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
a { color: var(--accent-strong); text-decoration: none; }
a:hover { text-decoration: underline; }
.shell { min-height: 100vh; display: grid; grid-template-columns: 248px minmax(0, 1fr); }
.sidebar { background: var(--sidebar); border-right: 1px solid var(--sidebar-line); color: #f9fafb; padding: 18px 14px; }
.brand { display: flex; align-items: center; gap: 10px; font-size: 20px; font-weight: 800; margin: 4px 8px 20px; }
.brand-mark { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 6px; background: #14b8a6; color: #052e2b; font-weight: 900; }
.nav { display: grid; gap: 4px; }
.nav a { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 10px; border-radius: 6px; color: #d1d5db; font-weight: 600; }
.nav a.active, .nav a:hover { background: var(--sidebar-soft); color: #ffffff; text-decoration: none; }
.nav a.active::after { content: ""; width: 7px; height: 7px; border-radius: 999px; background: #2dd4bf; }
.main { min-width: 0; padding: 24px; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
h1 { margin: 0; font-size: 28px; line-height: 1.15; }
h2 { margin: 0 0 12px; font-size: 18px; }
h3 { margin: 0 0 10px; font-size: 15px; }
.subtle { color: var(--muted); }
.grid { display: grid; gap: 16px; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.section { margin-top: 16px; }
.section-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 16px; box-shadow: var(--shadow); }
.subpanel { border: 1px solid var(--line); border-radius: 6px; padding: 12px; background: #f8fafc; }
.flash { background: #ecfdf3; border: 1px solid #bbf7d0; color: #166534; padding: 10px 12px; border-radius: 6px; margin-bottom: 16px; }
.flash.error { background: #fef2f2; border-color: #fecaca; color: var(--danger); }
.flash.warn { background: #fffbeb; border-color: #fde68a; color: var(--warn); }
.actions, .row-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; margin-bottom: 14px; }
form.inline { display: inline-flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0; }
form.stack { display: grid; gap: 12px; }
form.compact-form { margin-top: 8px; }
.logs { margin: 8px 0 12px; padding-left: 18px; color: var(--ink); }
.logs li { margin-bottom: 6px; overflow-wrap: anywhere; }
label { display: grid; gap: 5px; font-weight: 600; }
label.check { display: inline-flex; grid-template-columns: none; gap: 6px; align-items: center; font-weight: 600; }
input, select, textarea { width: 100%; min-height: 36px; border: 1px solid var(--line); border-radius: 6px; padding: 7px 9px; color: var(--ink); background: #fff; }
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus, button:focus-visible, .button:focus-visible, a:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
input[type="checkbox"] { width: auto; min-height: auto; }
button, .button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 34px; border: 1px solid var(--accent); border-radius: 6px; padding: 7px 12px; background: var(--accent); color: #fff; font-weight: 700; cursor: pointer; line-height: 1.2; white-space: nowrap; }
button:hover, .button:hover { background: var(--accent-strong); text-decoration: none; }
button.secondary, .button.secondary { background: #fff; color: var(--accent-strong); }
button.secondary:hover, .button.secondary:hover { background: var(--soft); }
button.danger { border-color: var(--danger); background: var(--danger); }
button.danger:hover { background: #991b1b; }
.table-wrap { width: 100%; overflow-x: auto; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); box-shadow: var(--shadow); }
table { width: 100%; border-collapse: collapse; background: var(--panel); min-width: 760px; }
th, td { text-align: left; padding: 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { background: #f8fafc; color: #475467; font-size: 12px; text-transform: uppercase; }
tbody tr:hover { background: #fbfcfe; }
tr:last-child td { border-bottom: 0; }
.badge { display: inline-block; padding: 3px 7px; border-radius: 999px; background: #edf2f7; color: #344054; font-weight: 700; font-size: 12px; }
.badge.good { background: #dcfce7; color: var(--good); }
.badge.warn { background: #fef3c7; color: var(--warn); }
.badge.bad { background: #fee2e2; color: var(--danger); }
.metric { font-size: 30px; font-weight: 800; line-height: 1.1; margin-top: 4px; }
.metric-card { display: grid; gap: 8px; }
.metric-card a { font-weight: 700; }
.empty { color: var(--muted); padding: 18px; background: #fff; border: 1px dashed var(--line); border-radius: 8px; }
dl.details { display: grid; grid-template-columns: max-content 1fr; gap: 8px 16px; margin: 0; }
dl.details dt { color: var(--muted); font-weight: 700; }
dl.details dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.mono, code, pre { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.truncate { overflow-wrap: anywhere; }
pre.guide { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 16px; }
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: linear-gradient(180deg, rgba(17, 24, 39, .05), transparent 240px), var(--bg); }
.login .card { width: min(420px, 100%); }
.home-shell {
  min-height: 100vh;
  padding: 24px;
  background:
    radial-gradient(circle at top left, rgba(20, 184, 166, .12), transparent 34%),
    linear-gradient(180deg, rgba(17, 24, 39, .05), transparent 240px),
    var(--bg);
}
.home-hero {
  max-width: 1080px;
  margin: 0 auto 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.home-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 20px;
  font-weight: 800;
}
.home-main {
  max-width: 1080px;
  margin: 0 auto;
  display: grid;
  gap: 16px;
}
.home-lede {
  background: var(--panel);
}
.home-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: static; border-right: 0; border-bottom: 1px solid var(--sidebar-line); }
  .nav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid.two, .grid.three { grid-template-columns: 1fr; }
  .topbar { align-items: flex-start; flex-direction: column; }
  .main { padding: 18px; }
  .home-hero { align-items: flex-start; flex-direction: column; }
  .home-grid { grid-template-columns: 1fr; }
}
@media (max-width: 540px) {
  .nav { grid-template-columns: 1fr; }
  .toolbar, .section-header { align-items: flex-start; flex-direction: column; }
  form.inline { display: grid; width: 100%; }
  button, .button { width: 100%; }
  .home-shell { padding: 18px; }
}
