:root {
  color-scheme: light;
  --bg: #f6f8fb;
  --surface: #ffffff;
  --surface-2: #eef4f8;
  --text: #182534;
  --muted: #667586;
  --border: #d8e1ea;
  --accent: #0f766e;
  --accent-2: #1d4e89;
  --shadow: 0 10px 28px rgba(25, 43, 62, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input {
  font: inherit;
}

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

.sidebar {
  background: #102033;
  color: #e8eef5;
  padding: 24px 18px;
}

.brand-mark {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 30px;
}

.brand-symbol {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 8px;
  background: #163554;
  font-weight: 800;
  letter-spacing: 0;
}

.brand-mark strong,
.brand-mark span {
  display: block;
}

.brand-mark span:last-child {
  margin-top: 2px;
  color: #aab8c7;
  font-size: 13px;
}

nav {
  display: grid;
  gap: 5px;
}

nav a {
  color: #c8d4e1;
  text-decoration: none;
  padding: 10px 11px;
  border-radius: 8px;
  font-size: 14px;
}

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

main {
  padding: 22px 26px 34px;
}

.topbar,
.hero,
.metrics,
.workspace,
.tools-row {
  max-width: 1220px;
}

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

.search {
  display: flex;
  align-items: center;
  gap: 12px;
  width: min(620px, 100%);
  color: var(--muted);
  font-size: 13px;
}

.search input,
.inline-form input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 11px 12px;
  background: var(--surface);
  color: var(--text);
}

.status {
  display: flex;
  gap: 8px;
  align-items: center;
  color: var(--muted);
  font-size: 13px;
}

.dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #10b981;
}

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

h1 {
  margin: 0;
  font-size: 34px;
  line-height: 1.12;
  letter-spacing: 0;
}

h2 {
  margin: 0;
  font-size: 16px;
  line-height: 1.25;
}

p {
  max-width: 790px;
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.primary-action,
.inline-form button {
  border: 0;
  border-radius: 8px;
  padding: 11px 14px;
  background: var(--accent);
  color: #ffffff;
  font-weight: 700;
  cursor: pointer;
}

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

.metrics article,
.panel {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.metrics article {
  padding: 16px;
}

.metrics span,
.panel-header span {
  color: var(--muted);
  font-size: 12px;
}

.metrics strong {
  display: block;
  margin-top: 8px;
  font-size: 26px;
}

.workspace,
.tools-row {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 16px;
  margin-bottom: 16px;
}

.panel {
  padding: 16px;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
  margin-bottom: 13px;
}

.list,
.brand-list,
.template-list {
  display: grid;
  gap: 8px;
}

.row,
.brand-row,
.template-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 11px;
  background: #fbfdff;
}

.row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
}

.row strong,
.brand-row strong,
.template-card strong {
  display: block;
  margin-bottom: 4px;
}

.row span,
.brand-row span,
.template-card span {
  color: var(--muted);
  font-size: 12px;
}

.json-panel {
  margin: 12px 0 0;
  overflow: auto;
  max-height: 330px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  background: #0f1c2b;
  color: #dbeafe;
  font-size: 12px;
  line-height: 1.45;
}

.json-panel.compact {
  max-height: 220px;
}

.inline-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.api-panel {
  max-width: 1220px;
}

.endpoint-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

code {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
  background: var(--surface-2);
  color: #12334f;
  font-size: 12px;
}

@media (max-width: 920px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
  }

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

  .hero,
  .topbar,
  .workspace,
  .tools-row {
    display: grid;
    grid-template-columns: 1fr;
  }

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

@media (max-width: 560px) {
  main {
    padding: 18px 14px 28px;
  }

  nav,
  .metrics,
  .inline-form {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: 28px;
  }
}
