:root {
  color-scheme: light;
  --ink: #1f2937;
  --muted: #6b7280;
  --line: #d7dde8;
  --panel: #ffffff;
  --page: #f3f6fb;
  --sidebar: #111827;
  --sidebar-muted: #9ca3af;
  --accent: #2563eb;
  --accent-soft: #eaf1ff;
  --success: #0f766e;
  --warn: #b45309;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--page);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.admin-layout {
  display: grid;
  grid-template-columns: 244px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 20px 16px;
  color: #ffffff;
  background: var(--sidebar);
}

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

.brand-mark {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border-radius: 8px;
  color: #ffffff;
  background: var(--accent);
  font-weight: 800;
}

.brand strong,
.brand small {
  display: block;
}

.brand small {
  margin-top: 4px;
  color: var(--sidebar-muted);
}

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

.nav a {
  padding: 11px 12px;
  border-radius: 8px;
  color: #d1d5db;
  text-decoration: none;
  font-weight: 650;
}

.nav a:hover,
.nav a.active {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.1);
}

.content {
  width: min(1180px, calc(100% - 48px));
  margin: 0 auto;
  padding: 28px 0 48px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: center;
  padding-bottom: 20px;
}

.eyebrow {
  margin: 0 0 7px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
p,
dl {
  margin-top: 0;
}

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

h2 {
  margin-bottom: 0;
  font-size: 20px;
}

.top-actions {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--success);
  font-weight: 700;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
}

.toast,
.notice {
  border: 1px solid #fed7aa;
  border-radius: 8px;
  background: #fff7ed;
  color: #9a3412;
}

.toast {
  margin-bottom: 16px;
  padding: 12px 14px;
  font-weight: 700;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.summary-grid article,
.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.summary-grid article {
  min-width: 0;
  padding: 16px;
}

dt {
  color: var(--muted);
  font-size: 13px;
}

dd {
  margin: 7px 0 0;
  overflow-wrap: anywhere;
  font-weight: 750;
}

.panel {
  margin-top: 18px;
  padding: 20px;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
}

.hint {
  margin: 12px 0 0;
  color: var(--muted);
  line-height: 1.7;
}

.badge {
  min-width: 74px;
  padding: 7px 10px;
  border-radius: 6px;
  color: var(--warn);
  background: #ffedd5;
  font-size: 13px;
  font-weight: 800;
  text-align: center;
}

.badge-on {
  color: var(--success);
  background: #ccfbf1;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 18px;
}

label {
  display: grid;
  gap: 7px;
  min-width: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

input {
  width: 100%;
  min-height: 42px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  background: #ffffff;
  font: inherit;
}

input:focus {
  border-color: var(--accent);
  outline: 3px solid var(--accent-soft);
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  align-items: end;
}

button {
  min-height: 42px;
  padding: 0 18px;
  border: 0;
  border-radius: 6px;
  color: #ffffff;
  background: var(--accent);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.split {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.config-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 18px 0 0;
}

.config-list div {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.notice {
  margin-top: 14px;
  padding: 12px;
}

code {
  overflow-wrap: anywhere;
  color: #111827;
  font-size: 14px;
  font-weight: 750;
}

.endpoint-table {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.endpoint-row {
  display: grid;
  grid-template-columns: 84px minmax(180px, 1fr) 2fr;
  gap: 14px;
  align-items: center;
  padding: 13px 0;
  border-top: 1px solid var(--line);
}

.endpoint-row:first-child {
  border-top: 0;
}

.method {
  width: fit-content;
  min-width: 58px;
  padding: 5px 8px;
  border-radius: 6px;
  color: var(--accent);
  background: var(--accent-soft);
  font-size: 12px;
  font-weight: 800;
  text-align: center;
}

.endpoint-row p {
  margin: 0;
  color: var(--muted);
}

@media (max-width: 900px) {
  .admin-layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
  }

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

  .nav a {
    text-align: center;
  }

  .content {
    width: min(100% - 28px, 1180px);
  }

  .summary-grid,
  .split,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .endpoint-row {
    grid-template-columns: 1fr;
    align-items: start;
  }
}

@media (max-width: 560px) {
  .topbar,
  .panel-head {
    align-items: flex-start;
    flex-direction: column;
  }

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

  .config-list {
    grid-template-columns: 1fr;
  }
}
