:root {
  color-scheme: light;
  --bg: #f2f3f7;
  --panel: #ffffff;
  --text: #141821;
  --muted: #737b89;
  --line: rgba(22, 28, 38, .11);
  --blue: #1677ff;
  --green: #22a06b;
  --orange: #d97706;
  --red: #e95858;
  --shadow: 0 18px 46px rgba(38, 44, 58, .12);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Segoe UI", sans-serif;
  letter-spacing: 0;
}

body {
  padding: 28px;
}

a {
  color: inherit;
  text-decoration: none;
}

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

.shell {
  width: min(1320px, 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 244px minmax(0, 1fr);
  gap: 18px;
}

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

.sidebar {
  position: sticky;
  top: 28px;
  height: calc(100vh - 56px);
  padding: 16px;
  display: flex;
  flex-direction: column;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 4px 2px 18px;
}

.brand-icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #161b26;
  color: #fff;
  font-weight: 780;
}

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

.brand strong {
  font-size: 17px;
}

.brand span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.nav {
  display: grid;
  gap: 5px;
  overflow-y: auto;
  padding-right: 2px;
}

.nav a {
  min-height: 38px;
  display: flex;
  align-items: center;
  padding: 0 12px;
  border-radius: 8px;
  color: #555e6d;
  font-size: 14px;
  font-weight: 650;
}

.nav a.active {
  background: rgba(22, 119, 255, .1);
  color: var(--blue);
}

.side-note {
  margin-top: auto;
  padding: 12px;
  border-radius: 8px;
  background: #f4f6fa;
}

.side-note span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.side-note .mt {
  margin-top: 12px;
}

.side-note code {
  display: block;
  margin-top: 6px;
  color: #313947;
  white-space: normal;
  overflow-wrap: anywhere;
}

.content {
  min-width: 0;
}

.flash,
.form-error.wide {
  margin-bottom: 12px;
  padding: 11px 12px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 700;
}

.flash {
  background: rgba(34, 160, 107, .12);
  color: var(--green);
}

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

.page-head h1 {
  margin: 0;
  font-size: 34px;
  line-height: 1.05;
  font-weight: 780;
}

.page-head p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.head-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.button {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 8px;
  padding: 0 14px;
  background: var(--blue);
  color: #fff;
  font-size: 14px;
  font-weight: 720;
  cursor: pointer;
  white-space: nowrap;
}

.button.ghost {
  background: #e9edf4;
  color: #394253;
}

.button.danger {
  background: var(--red);
}

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

.card {
  overflow: hidden;
}

.card.metric {
  padding: 14px;
}

.metric span,
.metric small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.metric strong {
  display: block;
  margin: 9px 0 5px;
  font-size: 30px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.metric strong.small {
  font-size: 22px;
  line-height: 1.15;
}

.grid.two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}

.card-head {
  min-height: 54px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
  border-bottom: 1px solid var(--line);
}

.card-head.inline {
  margin: 0 -16px 12px;
  border-top: 1px solid var(--line);
  background: #fbfcff;
}

.agreement-block:first-child .card-head.inline {
  border-top: 0;
  margin-top: -16px;
}

.card-head h2 {
  margin: 0;
  font-size: 18px;
}

.card-head a {
  color: var(--blue);
  font-size: 14px;
  font-weight: 700;
}

.pill {
  min-height: 24px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  padding: 0 8px;
  background: #eef2f8;
  color: #667084;
  font-size: 12px;
  font-weight: 750;
  white-space: nowrap;
}

.pill.green {
  background: rgba(34, 160, 107, .12);
  color: var(--green);
}

.pill.orange {
  background: rgba(217, 119, 6, .12);
  color: var(--orange);
}

.pill.red {
  background: rgba(233, 88, 88, .12);
  color: var(--red);
}

.kv {
  margin: 0;
  padding: 4px 14px 14px;
}

.kv dt,
.kv dd {
  min-height: 38px;
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--line);
}

.kv dt {
  float: left;
  clear: left;
  width: 110px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}

.kv dd {
  margin-left: 110px;
  font-size: 14px;
  font-weight: 650;
}

.kv dt:last-of-type,
.kv dd:last-of-type {
  border-bottom: 0;
}

.endpoint-list {
  display: grid;
  gap: 8px;
  padding: 14px;
}

.endpoint-list code {
  padding: 9px 10px;
  border-radius: 7px;
  background: #f4f6fa;
  color: #263143;
  overflow-wrap: anywhere;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  font-size: 13px;
  white-space: nowrap;
}

th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

tr:last-child td {
  border-bottom: 0;
}

.mono {
  font-family: "SF Mono", ui-monospace, Menlo, Consolas, monospace;
  font-size: 12px;
}

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

.form {
  padding: 16px;
}

.form.narrow {
  width: min(560px, 100%);
  display: grid;
  gap: 14px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

label.full {
  display: block;
  margin-top: 14px;
}

label span {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

input[type="text"],
input[type="number"],
input[type="password"],
input:not([type]),
textarea,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  outline: none;
}

input[type="text"],
input[type="number"],
input[type="password"],
input:not([type]),
select {
  min-height: 42px;
  padding: 0 11px;
}

textarea {
  min-height: 128px;
  padding: 11px;
  resize: vertical;
  line-height: 1.55;
}

input:focus,
textarea:focus,
select:focus {
  border-color: rgba(22, 119, 255, .5);
  box-shadow: 0 0 0 3px rgba(22, 119, 255, .09);
}

input:disabled {
  background: #f4f6fa;
  color: var(--muted);
}

.switches {
  display: grid;
  gap: 10px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.check {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 650;
}

.check span {
  margin: 0;
  color: var(--text);
}

.check input {
  width: 18px;
  height: 18px;
}

.note {
  margin-top: 14px;
  padding: 12px;
  border-radius: 8px;
  background: #f4f6fa;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
  line-height: 1.6;
}

.actions {
  margin-top: 18px;
}

.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
}

.login-card {
  width: min(390px, 100%);
  padding: 20px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.login-brand {
  padding-bottom: 16px;
}

.login-card h1 {
  margin: 0;
  font-size: 28px;
  line-height: 1.1;
}

.login-card p {
  margin: 8px 0 18px;
  color: var(--muted);
  font-size: 14px;
}

.login-card form {
  display: grid;
  gap: 14px;
}

.login-button {
  width: 100%;
  margin-top: 2px;
}

.form-error {
  margin-bottom: 14px;
  padding: 10px 11px;
  border-radius: 8px;
  background: rgba(233, 88, 88, .11);
  color: var(--red);
  font-size: 13px;
  font-weight: 700;
}

@media (max-width: 1020px) {
  body {
    padding: 14px;
  }

  .shell {
    grid-template-columns: 1fr;
  }

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

  .cards,
  .grid.two,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .page-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .card {
    overflow-x: auto;
  }
}
