:root {
  color-scheme: dark;
  --bg: #070a0f;
  --surface: rgba(17, 23, 30, 0.88);
  --surface-2: rgba(25, 33, 43, 0.82);
  --field: rgba(8, 12, 17, 0.82);
  --line: rgba(137, 159, 182, 0.18);
  --line-strong: rgba(215, 232, 255, 0.28);
  --text: #f7fbff;
  --muted: #93a7bb;
  --green: #4bf1a8;
  --red: #ff667f;
  --cyan: #58dfff;
  --yellow: #ffd46b;
  --shadow: 0 28px 80px rgba(0, 0, 0, 0.44);
  --soft-shadow: 0 14px 38px rgba(0, 0, 0, 0.24);
  --radius: 16px;
  --radius-sm: 12px;
  font-family: "Avenir Next", "Segoe UI", "SF Pro Text", ui-sans-serif, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at 10% 10%, rgba(75, 241, 168, 0.14), transparent 26%),
    radial-gradient(circle at 88% 0%, rgba(88, 223, 255, 0.12), transparent 30%),
    linear-gradient(145deg, #070a0f 0%, #0b1117 48%, #10131d 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.022) 1px, transparent 1px);
  background-size: 84px 84px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.88), transparent 74%);
}

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

button {
  border: 0;
  cursor: pointer;
}

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

h1 {
  margin-bottom: 6px;
  font-size: clamp(34px, 4vw, 48px);
  line-height: 1;
  letter-spacing: -0.03em;
}

h2 {
  margin-bottom: 8px;
  font-size: 22px;
  letter-spacing: -0.02em;
}

h3 {
  margin-bottom: 8px;
  font-size: 18px;
  letter-spacing: -0.02em;
}

.shell {
  width: min(1360px, 100%);
  margin: 0 auto;
  padding: 28px;
  position: relative;
}

.auth-layout {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.08fr 0.92fr;
  gap: 28px;
  align-items: center;
  padding: 28px;
}

.brand-panel {
  min-height: 640px;
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 40px;
  box-shadow: var(--shadow);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.015)),
    linear-gradient(145deg, rgba(8, 14, 18, 0.82), rgba(15, 23, 31, 0.88));
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}

.brand-panel::before,
.brand-panel::after {
  content: "";
  position: absolute;
  border-radius: 999px;
  filter: blur(24px);
  opacity: 0.8;
}

.brand-panel::before {
  inset: auto auto -70px -30px;
  width: 260px;
  height: 260px;
  background: rgba(75, 241, 168, 0.14);
}

.brand-panel::after {
  inset: -120px -40px auto auto;
  width: 260px;
  height: 260px;
  background: rgba(88, 223, 255, 0.12);
}

.brand-copy,
.hero-metrics {
  position: relative;
  z-index: 1;
}

.brand-copy {
  max-width: 680px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--green);
  text-transform: uppercase;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.18em;
}

.brand-copy h1 {
  font-size: clamp(48px, 7vw, 84px);
  line-height: 0.94;
}

.brand-copy p {
  max-width: 620px;
  color: #c7d4e1;
  font-size: 18px;
  line-height: 1.65;
}

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

.hero-metric {
  padding: 18px;
  border-radius: var(--radius);
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(11, 17, 24, 0.55);
  backdrop-filter: blur(16px);
}

.hero-metric span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.hero-metric strong {
  display: block;
  font-size: 20px;
  letter-spacing: -0.02em;
}

.auth-card,
.panel,
.metric,
.table-wrap,
.content-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--soft-shadow);
  backdrop-filter: blur(22px);
}

.auth-card {
  padding: 28px;
}

.auth-card h2 {
  font-size: 28px;
}

.field {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

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

.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 48px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--field);
  color: var(--text);
  padding: 0 14px;
  outline: none;
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease, transform 160ms ease;
}

.field textarea {
  min-height: 108px;
  padding: 12px 14px;
  resize: vertical;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: rgba(75, 241, 168, 0.65);
  background: rgba(7, 12, 16, 0.94);
  box-shadow: 0 0 0 4px rgba(75, 241, 168, 0.10);
}

.inline-fields {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 14px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.inline-fields label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.inline-fields input {
  width: 18px;
  height: 18px;
  accent-color: var(--green);
}

.primary,
.secondary,
.tab,
.mini-button,
.mini-select {
  border-radius: 12px;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease, box-shadow 160ms ease, color 160ms ease;
}

.primary,
.secondary,
.tab {
  min-height: 42px;
  padding: 0 14px;
  font-weight: 800;
}

.primary {
  width: 100%;
  margin-top: 16px;
  color: #07110d;
  background: linear-gradient(135deg, var(--green), var(--cyan));
  box-shadow: 0 14px 34px rgba(75, 241, 168, 0.18);
}

.secondary,
.tab,
.mini-button,
.mini-select {
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--line);
}

.primary:hover,
.secondary:hover,
.tab:hover,
.mini-button:hover,
.mini-select:hover {
  transform: translateY(-1px);
  border-color: var(--line-strong);
}

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

.topbar-copy {
  max-width: 780px;
}

.topbar-copy p {
  line-height: 1.6;
}

.topbar-actions {
  display: grid;
  gap: 12px;
  justify-items: end;
}

.chip-group,
.button-row,
.actions,
.tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.chip {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 11px;
  border-radius: 999px;
  border: 1px solid rgba(75, 241, 168, 0.22);
  background: rgba(75, 241, 168, 0.10);
  color: var(--green);
  font-size: 12px;
  font-weight: 800;
}

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

.metric {
  padding: 18px;
}

.metric span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.metric strong {
  display: block;
  margin-top: 8px;
  color: var(--green);
  font-size: 28px;
  letter-spacing: -0.04em;
}

.tabs {
  margin-bottom: 16px;
}

.tab.active {
  background: rgba(75, 241, 168, 0.12);
  border-color: rgba(75, 241, 168, 0.54);
  box-shadow: inset 0 0 0 1px rgba(75, 241, 168, 0.12);
}

.notice {
  border: 1px solid rgba(75, 241, 168, 0.22);
  background: rgba(75, 241, 168, 0.08);
  color: var(--green);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin: 0 0 14px;
}

.error {
  min-height: 22px;
  color: var(--red);
  margin-bottom: 0;
}

.error-note {
  border-color: rgba(255, 102, 127, 0.24);
  background: rgba(255, 102, 127, 0.10);
  color: #ffd6dd;
}

.content-panel,
.panel {
  overflow: hidden;
}

.content-panel {
  padding: 18px;
}

.panel {
  padding: 18px;
}

.panel-elevated {
  min-height: 100%;
}

.section-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.section-header p {
  margin-bottom: 0;
}

.section-meta {
  display: flex;
  align-items: center;
  justify-content: end;
}

.grid {
  display: grid;
  grid-template-columns: 0.92fr 1.08fr;
  gap: 16px;
}

.stack {
  display: grid;
  gap: 16px;
}

.table-wrap {
  overflow: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 840px;
}

th,
td {
  padding: 13px 14px;
  border-bottom: 1px solid rgba(143, 163, 184, 0.14);
  text-align: left;
  vertical-align: top;
  font-size: 13px;
}

tbody tr:hover {
  background: rgba(255, 255, 255, 0.02);
}

th {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.empty-state {
  padding: 18px 0;
  color: var(--muted);
}

.badge {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  border-radius: 999px;
  padding: 0 9px;
  background: rgba(88, 223, 255, 0.12);
  color: var(--cyan);
  font-size: 12px;
  font-weight: 800;
}

.badge.green {
  background: rgba(75, 241, 168, 0.12);
  color: var(--green);
}

.badge.red {
  background: rgba(255, 102, 127, 0.12);
  color: var(--red);
}

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

.actions {
  align-items: center;
}

.mini-button,
.mini-select {
  min-height: 34px;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 800;
}

.mini-select {
  padding-right: 30px;
}

.debug-note {
  margin: 0 0 14px;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid rgba(88, 223, 255, 0.18);
  background: rgba(88, 223, 255, 0.08);
  color: #d7f6ff;
  line-height: 1.5;
}

.debug-note code {
  color: var(--cyan);
  font-weight: 800;
}

.payload-details {
  display: grid;
  gap: 10px;
}

.payload-details summary {
  cursor: pointer;
  color: var(--cyan);
  font-weight: 800;
  list-style: none;
}

.payload-details summary::-webkit-details-marker {
  display: none;
}

.json-view {
  margin: 0;
  max-width: 100%;
  overflow: auto;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid rgba(143, 163, 184, 0.14);
  background: rgba(4, 8, 13, 0.72);
  color: #d7e4ee;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 12px;
  line-height: 1.55;
}

@media (max-width: 1120px) {
  .metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .grid,
  .auth-layout {
    grid-template-columns: 1fr;
  }

  .brand-panel {
    min-height: 500px;
  }

  .topbar {
    align-items: stretch;
    flex-direction: column;
  }

  .topbar-actions {
    justify-items: start;
  }
}

@media (max-width: 760px) {
  .shell,
  .auth-layout {
    padding: 16px;
  }

  .content-panel,
  .panel,
  .auth-card,
  .brand-panel {
    border-radius: 20px;
  }

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

  .section-header {
    flex-direction: column;
  }

  .section-meta {
    justify-content: start;
  }
}

@media (max-width: 560px) {
  .metrics {
    grid-template-columns: 1fr;
  }

  .hero-metrics {
    grid-template-columns: 1fr;
  }

  .tab,
  .secondary {
    width: 100%;
  }

  .button-row,
  .chip-group {
    width: 100%;
  }

  .button-row > *,
  .chip-group > * {
    flex: 1 1 auto;
  }
}
