:root {
  --bg: oklch(98% 0.005 250);
  --surface: oklch(100% 0 0);
  --surface-2: oklch(96% 0.006 250);
  --fg: oklch(22% 0.02 240);
  --muted: oklch(50% 0.018 240);
  --border: oklch(90% 0.008 240);
  --accent: oklch(58% 0.16 145);
  --accent-2: oklch(58% 0.15 245);
  --warn: oklch(68% 0.15 75);
  --danger: oklch(58% 0.18 28);
  --ok-bg: oklch(95% 0.035 145);
  --warn-bg: oklch(96% 0.04 80);
  --danger-bg: oklch(95% 0.035 28);
  --font: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", system-ui, sans-serif;
  --mono: "JetBrains Mono", "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

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

button, input { font: inherit; }
button, .btn { cursor: pointer; }
a { color: inherit; text-decoration: none; }
code {
  font-family: var(--mono);
  font-size: 12px;
  overflow-wrap: anywhere;
}

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

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 18px 14px;
  background: oklch(99% 0.003 250);
  border-right: 1px solid var(--border);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px 12px;
  border-bottom: 1px solid var(--border);
}

.brand-mark {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--fg);
  color: white;
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 700;
}

.brand strong { display: block; font-size: 15px; }
.brand span { display: block; color: var(--muted); font-size: 12px; }
.nav-group { display: grid; gap: 6px; }

.nav-item {
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 9px 10px;
  border-radius: 7px;
  color: var(--muted);
  background: transparent;
}

.nav-item:hover, .nav-item:focus-visible {
  background: var(--surface-2);
  color: var(--fg);
  outline: none;
}

.nav-item.is-active {
  color: var(--fg);
  background: var(--surface);
  box-shadow: 0 1px 0 var(--border), 0 10px 24px oklch(55% 0.03 250 / 8%);
}

.nav-label { display: inline-flex; align-items: center; gap: 9px; }
.nav-icon {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  background: var(--surface-2);
  font-family: var(--mono);
  font-size: 11px;
}

.sidebar-card {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
}

.line { display: flex; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 12px; }
.line strong { color: var(--fg); font-weight: 600; }
.sidebar-footer { margin-top: auto; padding: 0 8px; }
.text-button { border: 0; background: transparent; color: var(--muted); padding: 6px 0; }

.main { min-width: 0; padding: 28px; }
.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}
.eyebrow { margin: 0 0 3px; color: var(--muted); font-size: 12px; }
h1 { margin: 0; font-size: 28px; letter-spacing: 0; }

.metric-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}

.metric-card, .panel, .login-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 10px 28px oklch(55% 0.03 250 / 7%);
}

.metric-card { padding: 14px; display: grid; gap: 5px; min-width: 0; }
.metric-card strong { font-size: 15px; overflow-wrap: anywhere; }
.metric-card span { color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.metric-label { display: flex; align-items: center; justify-content: space-between; gap: 10px; }

.content-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 12px;
}
.panel { padding: 16px; min-width: 0; }
.col-5 { grid-column: span 5; }
.col-7 { grid-column: span 7; }
.col-12 { grid-column: span 12; }
.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}
.panel-title { margin: 0; font-size: 17px; }
.panel-note { margin: 3px 0 0; color: var(--muted); font-size: 13px; }

.form-stack { display: grid; gap: 13px; }
label { display: grid; gap: 6px; color: var(--fg); font-weight: 600; }
label small { color: var(--muted); font-weight: 400; }
input {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 9px 11px;
  background: white;
  color: var(--fg);
}
input:focus { outline: 2px solid oklch(78% 0.12 145 / 45%); border-color: var(--accent); }

.button-row, .inline-form { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.inline-form input { flex: 1 1 280px; }
.btn {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 8px 12px;
  background: var(--surface);
  color: var(--fg);
  font-weight: 650;
}
.btn:hover, .btn:focus-visible { border-color: oklch(78% 0.03 240); outline: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: white; }
.btn.small { min-height: 30px; padding: 5px 9px; font-size: 12px; }

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 3px 8px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}
.badge.ok { background: var(--ok-bg); color: oklch(36% 0.12 145); }
.badge.warn { background: var(--warn-bg); color: oklch(45% 0.12 75); }
.badge.danger { background: var(--danger-bg); color: oklch(45% 0.16 28); }

.host-list, .guardrail-list { display: grid; gap: 10px; }
.host-row, .copy-row {
  display: grid;
  grid-template-columns: 130px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: oklch(99% 0.003 250);
}
.host-row span, .copy-key { color: var(--muted); font-size: 12px; font-weight: 700; }
.copy-grid { display: grid; gap: 8px; }
.steps { margin: 0; padding-left: 22px; display: grid; gap: 18px; }
.steps p { color: var(--muted); margin: 4px 0 10px; }
.guardrail-list div { display: flex; align-items: center; gap: 10px; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 720px; }
th, td { padding: 12px 10px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
th { color: var(--muted); font-size: 12px; }

.notice {
  margin-bottom: 12px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
}
.notice.danger { border-color: oklch(84% 0.06 28); background: var(--danger-bg); }
.toast {
  position: fixed;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%) translateY(12px);
  opacity: 0;
  pointer-events: none;
  padding: 10px 13px;
  border-radius: 8px;
  background: var(--fg);
  color: white;
  transition: 160ms ease;
}
.toast.is-visible { opacity: 1; transform: translateX(-50%) translateY(0); }

.login-body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 18px;
}
.login-panel { width: min(420px, 100%); padding: 20px; }
.login-brand { padding-left: 0; }
.login-panel h1 { margin: 18px 0 4px; }

@media (max-width: 900px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar {
    position: static;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }
  .nav-group { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .sidebar-card, .sidebar-footer { display: none; }
  .main { padding: 18px; }
  .metric-grid { grid-template-columns: 1fr; }
  .col-5, .col-7 { grid-column: span 12; }
}

@media (max-width: 560px) {
  .nav-group { grid-template-columns: 1fr; }
  .topbar { align-items: stretch; flex-direction: column; }
  .host-row, .copy-row { grid-template-columns: 1fr; }
  .btn { width: 100%; }
}

