:root {
  color-scheme: light;
  --bg: #f4f6f8;
  --panel: #ffffff;
  --panel-muted: #f8fafc;
  --text: #172033;
  --muted: #667085;
  --line: #d8dee8;
  --accent: #0f766e;
  --accent-dark: #115e59;
  --danger: #b42318;
  --warning: #b54708;
  --ok: #027a48;
  --shadow: 0 12px 35px rgba(16, 24, 40, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 1080px;
  background: var(--bg);
  color: var(--text);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "PingFang SC", "Microsoft YaHei", sans-serif;
}

button,
input,
select,
textarea {
  font: inherit;
}

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

.sidebar {
  background: #101828;
  color: #fff;
  padding: 24px 16px;
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 0 8px 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: #14b8a6;
  color: #05201d;
  font-weight: 800;
}

.brand-title {
  font-size: 17px;
  font-weight: 750;
}

.brand-subtitle {
  margin-top: 2px;
  color: #98a2b3;
  font-size: 12px;
}

.nav {
  display: grid;
  gap: 6px;
  margin-top: 22px;
}

.nav-item {
  width: 100%;
  padding: 11px 12px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #cbd5e1;
  text-align: left;
  cursor: pointer;
}

.nav-item:hover,
.nav-item.active {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.main {
  min-width: 0;
  padding: 24px 28px 40px;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}

h1 {
  margin: 0;
  font-size: 26px;
  line-height: 1.2;
}

p {
  margin: 6px 0 0;
  color: var(--muted);
}

.key-panel,
.toolbar {
  display: flex;
  gap: 8px;
  align-items: center;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  padding: 10px 11px;
  outline: none;
}

textarea {
  min-height: 88px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.14);
}

.key-panel input {
  width: 320px;
}

button {
  border: 0;
  border-radius: 8px;
  padding: 10px 14px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  white-space: nowrap;
}

button:hover {
  background: var(--accent-dark);
}

button.ghost {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
}

button.ghost:hover {
  background: var(--panel-muted);
}

.alert {
  margin-bottom: 14px;
  padding: 12px 14px;
  border-radius: 8px;
  border: 1px solid #fedf89;
  background: #fffaeb;
  color: #7a2e0e;
}

.alert.error {
  border-color: #fecdca;
  background: #fffbfa;
  color: var(--danger);
}

.hidden {
  display: none;
}

.grid {
  display: grid;
  gap: 14px;
}

.grid.cols-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid.cols-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}

.panel-title {
  margin: 0;
  font-size: 16px;
  font-weight: 750;
}

.panel-body {
  padding: 18px;
}

.stat {
  padding: 18px;
}

.stat-label {
  color: var(--muted);
  font-size: 13px;
}

.stat-value {
  margin-top: 8px;
  font-size: 26px;
  font-weight: 800;
}

.status-ok {
  color: var(--ok);
}

.status-warning {
  color: var(--warning);
}

.status-error {
  color: var(--danger);
}

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

.form-grid .wide {
  grid-column: span 3;
}

.field label {
  display: block;
  margin-bottom: 6px;
  color: #344054;
  font-size: 13px;
  font-weight: 650;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

th,
td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  background: var(--panel-muted);
  color: #475467;
  font-weight: 700;
}

tr:hover td {
  background: #fbfcfe;
}

.table-wrap {
  overflow-x: auto;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #eef4ff;
  color: #3538cd;
  font-size: 12px;
  font-weight: 700;
}

.badge.ok {
  background: #ecfdf3;
  color: var(--ok);
}

.badge.warn {
  background: #fffaeb;
  color: var(--warning);
}

.muted {
  color: var(--muted);
}

.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.empty-state {
  padding: 36px;
  color: var(--muted);
  text-align: center;
}

.json-cell {
  max-width: 420px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
