:root {
  color-scheme: dark;
  --bg: #0b0b10;
  --surface: #121219;
  --surface-raised: #181821;
  --border: #292934;
  --text: #f6f5fb;
  --muted: #9695a6;
  --accent: #7c5cff;
  --accent-bright: #9f89ff;
  --success: #5ee6a8;
  --danger: #ff7285;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 15% -10%, rgba(124, 92, 255, 0.18), transparent 35%),
    var(--bg);
  color: var(--text);
}

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

button {
  border: 0;
  border-radius: 12px;
  padding: 11px 18px;
  color: white;
  background: linear-gradient(135deg, var(--accent), #5e43db);
  cursor: pointer;
  transition: transform 120ms ease, opacity 120ms ease;
}

button:hover {
  transform: translateY(-1px);
}

button:disabled {
  cursor: wait;
  opacity: 0.6;
}

code {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

.login-body {
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-card {
  width: min(460px, 100%);
  padding: 44px;
  border: 1px solid var(--border);
  border-radius: 24px;
  background: rgba(18, 18, 25, 0.92);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  margin-bottom: 28px;
  border-radius: 17px;
  color: white;
  font-size: 23px;
  font-weight: 800;
  background: linear-gradient(145deg, #ad9cff, #6848e8 70%);
  box-shadow: 0 12px 32px rgba(124, 92, 255, 0.35);
}

.brand-mark.small {
  width: 38px;
  height: 38px;
  margin: 0;
  border-radius: 12px;
  font-size: 17px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent-bright);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.14em;
}

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

h1 {
  margin-bottom: 10px;
  font-size: clamp(28px, 4vw, 38px);
  letter-spacing: -0.04em;
}

h2 {
  margin-bottom: 0;
  font-size: 20px;
  letter-spacing: -0.02em;
}

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

.compact {
  font-size: 14px;
  line-height: 1.6;
}

.alert {
  margin: 24px 0;
  padding: 12px 14px;
  border: 1px solid rgba(255, 114, 133, 0.35);
  border-radius: 10px;
  color: #ffc4cc;
  background: rgba(255, 114, 133, 0.08);
}

.login-form {
  display: grid;
  gap: 10px;
  margin-top: 30px;
}

.login-form label {
  color: #c9c8d3;
  font-size: 13px;
}

input,
textarea,
select {
  border: 1px solid var(--border);
  border-radius: 12px;
  outline: none;
  color: var(--text);
  background: #0e0e14;
}

input {
  padding: 13px 14px;
  margin-bottom: 8px;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(124, 92, 255, 0.12);
}

.topbar {
  position: sticky;
  z-index: 10;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 76px;
  padding: 0 max(24px, calc((100vw - 1240px) / 2));
  border-bottom: 1px solid var(--border);
  background: rgba(11, 11, 16, 0.86);
  backdrop-filter: blur(18px);
}

.brand,
.topbar-actions,
.hero,
.panel-heading,
.playground-options,
.playground-footer {
  display: flex;
  align-items: center;
}

.brand {
  gap: 12px;
}

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

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

.topbar-actions {
  gap: 16px;
}

.service-status {
  color: #c9c8d3;
  font-size: 13px;
}

.service-status span {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 7px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 14px rgba(94, 230, 168, 0.8);
}

.ghost-button,
.secondary-button {
  border: 1px solid var(--border);
  color: #d9d8e2;
  background: transparent;
}

.page-shell {
  width: min(1240px, calc(100% - 48px));
  margin: 0 auto;
  padding: 52px 0 80px;
}

.hero {
  justify-content: space-between;
  margin-bottom: 30px;
}

.hero p:last-child {
  margin-bottom: 0;
}

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

.metric-card,
.panel {
  border: 1px solid var(--border);
  background: linear-gradient(160deg, rgba(24, 24, 33, 0.92), rgba(16, 16, 23, 0.92));
  box-shadow: 0 14px 50px rgba(0, 0, 0, 0.16);
}

.metric-card {
  padding: 22px;
  border-radius: 18px;
}

.metric-card > span {
  color: var(--muted);
  font-size: 13px;
}

.metric-card strong {
  display: block;
  margin: 13px 0 8px;
  font-size: 30px;
  letter-spacing: -0.04em;
}

.metric-card small {
  color: #777687;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr);
  gap: 16px;
  margin-bottom: 16px;
}

.panel {
  padding: 24px;
  border-radius: 18px;
}

.panel-heading {
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}

.bar-chart {
  display: grid;
  grid-template-columns: repeat(14, minmax(12px, 1fr));
  align-items: end;
  gap: 8px;
  height: 210px;
  padding-top: 20px;
}

.bar-group {
  display: grid;
  grid-template-rows: 1fr auto;
  align-items: end;
  height: 100%;
  gap: 10px;
}

.bar {
  position: relative;
  min-height: 3px;
  border-radius: 6px 6px 2px 2px;
  background: linear-gradient(to top, #5d42d3, #a38fff);
}

.bar:hover::after {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 8px);
  transform: translateX(-50%);
  content: attr(data-value);
  padding: 5px 7px;
  border: 1px solid var(--border);
  border-radius: 7px;
  color: white;
  background: #09090d;
  font-size: 11px;
  white-space: nowrap;
}

.bar-label {
  overflow: hidden;
  color: #747383;
  font-size: 10px;
  text-align: center;
  white-space: nowrap;
}

.endpoint {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
  padding: 13px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #0d0d13;
}

.endpoint span {
  padding: 4px 7px;
  border-radius: 6px;
  color: #dcd5ff;
  background: rgba(124, 92, 255, 0.18);
  font-size: 10px;
  font-weight: 800;
}

.endpoint code {
  overflow: hidden;
  color: #dddce6;
  font-size: 12px;
  text-overflow: ellipsis;
}

.text-link {
  color: var(--accent-bright);
  font-size: 13px;
  text-decoration: none;
}

.playground-panel {
  margin-bottom: 16px;
}

.playground-options {
  gap: 18px;
}

select {
  padding: 9px 34px 9px 12px;
}

.checkbox {
  color: #bbb9c7;
  font-size: 13px;
}

.checkbox input {
  margin: 0 6px 0 0;
  accent-color: var(--accent);
}

textarea {
  display: block;
  width: 100%;
  min-height: 330px;
  padding: 18px;
  resize: vertical;
  color: #d7d5e4;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 12px;
  line-height: 1.55;
}

.playground-footer {
  justify-content: space-between;
  gap: 20px;
  margin-top: 16px;
  font-size: 13px;
}

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

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

th,
td {
  padding: 13px 12px;
  border-bottom: 1px solid #24242d;
  text-align: left;
  white-space: nowrap;
}

th {
  color: #747383;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

td {
  color: #c8c7d1;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 11px;
}

.status-success {
  color: #91f2c2;
  background: rgba(94, 230, 168, 0.1);
}

.status-failed {
  color: #ff9dab;
  background: rgba(255, 114, 133, 0.1);
}

.status-processing {
  color: #c4b8ff;
  background: rgba(124, 92, 255, 0.12);
}

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

@media (max-width: 900px) {
  .metric-grid {
    grid-template-columns: repeat(2, 1fr);
  }

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

@media (max-width: 620px) {
  .topbar {
    padding: 0 18px;
  }

  .brand span,
  .service-status {
    display: none;
  }

  .page-shell {
    width: min(100% - 28px, 1240px);
    padding-top: 32px;
  }

  .hero,
  .panel-heading,
  .playground-footer {
    align-items: flex-start;
    flex-direction: column;
  }

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

  .bar-chart {
    gap: 4px;
  }

  .bar-label {
    font-size: 8px;
  }
}
