:root {
  color-scheme: light;
  --bg: #f6f8fa;
  --surface: #ffffff;
  --surface-subtle: #f9fafb;
  --text: #111827;
  --muted: #667085;
  --line: #d9e0e7;
  --accent: #0f766e;
  --accent-soft: #dff7f3;
  --ok: #16803c;
  --warn: #b7791f;
  --bad: #c81e1e;
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); }
button, input, select { font: inherit; }
button { cursor: pointer; }

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 240px minmax(720px, 1fr) 360px;
}

.sidebar, .inspector {
  background: var(--surface);
  border-color: var(--line);
}
.sidebar {
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
}
.brand {
  height: 72px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 20px;
  border-bottom: 1px solid var(--line);
}
.brand-mark {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--accent);
  color: white;
  display: grid;
  place-items: center;
  font-weight: 800;
}
.brand strong { display: block; text-transform: uppercase; letter-spacing: 0.08em; }
.brand span:last-child { color: var(--muted); font-size: 12px; text-transform: uppercase; }

.nav { display: grid; gap: 4px; padding: 16px 12px; }
.nav-item {
  border: 0;
  background: transparent;
  color: #344054;
  text-align: left;
  padding: 10px 12px;
  border-radius: 8px;
}
.nav-item.active, .nav-item:hover {
  background: var(--accent-soft);
  color: #075e57;
}
.sidebar-footer {
  margin-top: auto;
  padding: 16px 20px;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}

.workspace { padding: 22px 24px 32px; min-width: 0; }
.topbar {
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}
h1, h2, p { margin: 0; }
h1 { font-size: 25px; line-height: 1.2; }
h2 { font-size: 15px; }
.topbar p { color: var(--muted); margin-top: 4px; }
.topbar-actions { display: flex; gap: 10px; align-items: center; color: var(--muted); font-size: 13px; }
.health-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--warn);
}
.health-dot.ok { background: var(--ok); }
.icon-button, .panel button, form button {
  border: 1px solid var(--line);
  background: var(--surface);
  color: #1f2937;
  border-radius: 8px;
  padding: 8px 12px;
}
form button { background: var(--accent); color: white; border-color: var(--accent); }

.handoff-panel {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
  margin-bottom: 16px;
}
.handoff-panel.hidden { display: none; }
.handoff-panel span { display: block; color: var(--muted); font-size: 13px; margin-top: 2px; }
.handoff-panel form { display: flex; gap: 8px; min-width: 420px; }
input, select {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 8px;
  padding: 8px 10px;
  color: var(--text);
}

.section { display: none; }
.section.active { display: grid; gap: 16px; }
.grid { display: grid; gap: 16px; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.panel-header {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  border-bottom: 1px solid var(--line);
}
.panel-header button {
  padding: 4px 8px;
  font-size: 12px;
  color: var(--accent);
  border: 0;
  background: transparent;
}

.metric-strip {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 1px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--line);
  overflow: hidden;
}
.metric {
  background: var(--surface);
  padding: 16px;
}
.metric span { color: var(--muted); font-size: 12px; }
.metric strong { display: block; margin-top: 6px; font-size: 25px; }
.metric small { color: var(--muted); }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
th, td {
  padding: 10px 16px;
  border-bottom: 1px solid #edf0f3;
  text-align: left;
  vertical-align: top;
}
th { color: var(--muted); font-weight: 600; background: var(--surface-subtle); }
tr:last-child td { border-bottom: 0; }
.empty { padding: 18px 16px; color: var(--muted); }
.status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.status::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--muted);
}
.status.online::before, .status.ok::before, .status.active::before { background: var(--ok); }
.status.warning::before, .status.pending::before, .status.degraded::before { background: var(--warn); }
.status.offline::before, .status.error::before { background: var(--bad); }
.status-pill {
  font-size: 12px;
  color: var(--ok);
  background: #ecfdf3;
  border: 1px solid #c8f2d7;
  border-radius: 8px;
  padding: 3px 7px;
}

.form-grid {
  padding: 16px;
  display: grid;
  gap: 12px;
}
.form-grid label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
}
.result-block {
  margin: 0;
  padding: 16px;
  min-height: 112px;
  background: #0f172a;
  color: #d1fae5;
  overflow: auto;
  font-size: 12px;
}
.definition-list {
  margin: 0;
  padding: 16px;
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 12px;
}
.definition-list dt { color: var(--muted); }
.definition-list dd { margin: 0; }

.inspector {
  border-left: 1px solid var(--line);
  display: flex;
  flex-direction: column;
}
.inspector-header {
  min-height: 72px;
  padding: 18px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}
.inspector-body { padding: 16px 20px; display: grid; gap: 14px; font-size: 13px; }
.inspector-body dl { display: grid; grid-template-columns: 110px 1fr; gap: 10px; margin: 0; }
.inspector-body dt { color: var(--muted); }
.inspector-body dd { margin: 0; }

@media (max-width: 1180px) {
  .app-shell { grid-template-columns: 220px minmax(0, 1fr); }
  .inspector { display: none; }
}
@media (max-width: 820px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { border-right: 0; border-bottom: 1px solid var(--line); }
  .nav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .metric-strip, .grid.two { grid-template-columns: 1fr; }
  .handoff-panel, .handoff-panel form { display: grid; min-width: 0; }
}
