:root {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #1f2937;
  background: #f5f7fa;
  font-synthesis: none;
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: linear-gradient(180deg, #f8fafc 0%, #eef2f7 100%); }
button, input, textarea, select { font: inherit; }
.shell { width: min(1040px, calc(100% - 32px)); margin: 0 auto; padding: 28px 0 38px; }
.shell.narrow { width: min(860px, calc(100% - 32px)); }
.topbar { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 20px; }
.eyebrow { font-size: 12px; font-weight: 800; letter-spacing: .12em; color: #667085; }
h1 { margin: 5px 0 4px; font-size: clamp(28px, 4vw, 42px); line-height: 1.05; color: #101828; }
h2 { margin: 0 0 14px; font-size: 18px; color: #101828; }
.subtitle, .help { margin: 0; color: #667085; line-height: 1.5; }
.grid.two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.card { background: rgba(255,255,255,.94); border: 1px solid #e4e7ec; border-radius: 16px; padding: 20px; margin-bottom: 16px; box-shadow: 0 8px 26px rgba(16,24,40,.05); }
.status-list { margin: 0; }
.status-list > div { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid #f0f2f5; }
.status-list > div:last-child { border-bottom: 0; }
.status-list .stack { display: block; }
dt { color: #667085; } dd { margin: 0; text-align: right; font-weight: 600; }
.status-list .stack dd { margin-top: 7px; text-align: left; font-weight: 500; }
.pill { display: inline-flex; align-items: center; border-radius: 999px; padding: 5px 10px; background: #eef2f6; font-size: 13px; }
.pill[data-kind="ok"], .save-status[data-kind="ok"] { color: #067647; background: #ecfdf3; }
.pill[data-kind="warn"] { color: #b54708; background: #fffaeb; }
.pill[data-kind="error"], .save-status[data-kind="error"] { color: #b42318; background: #fef3f2; }
.codebox { margin-top: 8px; background: #101828; color: #e6edf3; border-radius: 10px; padding: 13px 14px; overflow: auto; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; line-height: 1.45; }
.pre { white-space: pre-wrap; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; }
.wrap { overflow-wrap: anywhere; }
.actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 40px; padding: 9px 14px; border-radius: 9px; border: 1px solid transparent; text-decoration: none; cursor: pointer; font-weight: 700; }
.button.primary { background: #1570ef; color: #fff; }
.button.primary:hover { background: #175cd3; }
.button.secondary { background: #fff; color: #344054; border-color: #d0d5dd; }
.button.secondary:hover { background: #f9fafb; }
.test-row { display: grid; grid-template-columns: 1fr auto; gap: 10px; margin-top: 14px; }
input, textarea, select { width: 100%; border: 1px solid #d0d5dd; border-radius: 9px; padding: 10px 12px; background: #fff; color: #101828; outline: none; }
input:focus, textarea:focus, select:focus { border-color: #84adff; box-shadow: 0 0 0 3px #eff4ff; }
textarea { resize: vertical; }
.log { min-height: 120px; max-height: 260px; overflow: auto; border-radius: 10px; background: #0c111d; padding: 10px 12px; color: #d0d5dd; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; }
.log-row { padding: 5px 0; border-bottom: 1px solid rgba(255,255,255,.05); }
.log-row.ok { color: #75e0a7; } .log-row.warn { color: #fec84b; } .log-row.error { color: #fda29b; }
.form-card { display: grid; gap: 18px; }
.field { display: grid; gap: 6px; }
.field label { font-weight: 700; color: #344054; }
.field small { color: #667085; line-height: 1.4; }
.inline-field { display: block; }
.inline-field label { display: flex; align-items: center; gap: 9px; }
.inline-field input { width: auto; }
.hidden { display: none !important; }
.save-status { padding: 7px 10px; border-radius: 8px; font-size: 13px; }
.note-card { border-left: 4px solid #1570ef; }
footer { color: #98a2b3; text-align: center; font-size: 12px; padding-top: 8px; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
@media (max-width: 720px) {
  .grid.two { grid-template-columns: 1fr; }
  .topbar { flex-direction: column; }
  .test-row { grid-template-columns: 1fr; }
  .shell, .shell.narrow { width: min(100% - 20px, 1040px); padding-top: 16px; }
}

/* Multi-tenant administration */
.topbar.compact { margin-bottom: 12px; align-items: center; }
.tenant-list { display: grid; gap: 8px; }
.tenant-row { width: 100%; border: 1px solid #d0d5dd; background: #fff; border-radius: 10px; padding: 12px 14px; display: flex; justify-content: space-between; align-items: center; gap: 14px; text-align: left; cursor: pointer; color: #344054; }
.tenant-row:hover { border-color: #98a2b3; }
.tenant-row.active { border-color: #1570ef; box-shadow: 0 0 0 2px rgba(21,112,239,.10); }
.button.danger { background: #b42318; color: white; border-color: #b42318; }
.button.danger:hover { background: #912018; }

/* v1.2 workflow/security additions */
.top-space { margin-top: 12px; }
.workflow-card { border-left: 4px solid #12b76a; }
.button.danger-outline { background: #fff; color: #b42318; border-color: #fda29b; }
.button.danger-outline:hover { background: #fef3f2; }
