@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

:root {
  --bg: #07111f;
  --bg-soft: #0f1c32;
  --panel: rgba(8, 19, 39, 0.82);
  --panel-strong: rgba(5, 14, 30, 0.94);
  --panel-border: rgba(148, 163, 184, 0.16);
  --panel-border-strong: rgba(96, 165, 250, 0.28);
  --text-main: #e2e8f0;
  --text-muted: #93a4bd;
  --text-soft: #c7d2fe;
  --primary: #3b82f6;
  --primary-strong: #2563eb;
  --primary-soft: rgba(59, 130, 246, 0.18);
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 12px;
  --shadow-lg: 0 30px 80px rgba(2, 8, 23, 0.42);
  --shadow-md: 0 20px 50px rgba(2, 8, 23, 0.24);
  --shadow-sm: 0 12px 30px rgba(2, 8, 23, 0.18);
  --transition: 180ms ease;
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(18px);
  background: rgba(248, 251, 255, 0.82);
  border-bottom: 1px solid rgba(31, 99, 255, 0.08);
}

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

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.brand-logo {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.08);
}

.brand-copy {
  display: grid;
  gap: 4px;
}

.brand-copy strong {
  font-size: 18px;
  letter-spacing: -0.02em;
  color: #0f172a;
}

.brand-copy span {
  color: #516176;
  font-size: 13px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 18px;
  color: #516176;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.nav-links a {
  color: inherit;
}

.nav-links a:hover,
.nav-links a[aria-current='page'] {
  color: #0f172a;
}

.site-body {
  background:
    radial-gradient(circle at top right, rgba(31, 99, 255, 0.12), transparent 30%),
    linear-gradient(180deg, #fbfdff 0%, #f3f8ff 100%);
}

.site-body .page-main {
  display: grid;
  gap: 24px;
}

.portal-main {
  padding-top: 16px;
  padding-bottom: 16px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: 'Plus Jakarta Sans', Inter, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background:
    radial-gradient(circle at top left, rgba(59, 130, 246, 0.18), transparent 26%),
    radial-gradient(circle at top right, rgba(16, 185, 129, 0.08), transparent 24%),
    linear-gradient(180deg, #08111f 0%, #0b1530 100%);
  color: var(--text-main);
  -webkit-font-smoothing: antialiased;
}

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

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

.dashboard-shell {
  width: min(1600px, calc(100% - 48px));
  margin: 24px auto 48px;
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  gap: 24px;
}

.sidebar,
.main-content {
  min-width: 0;
}

.sidebar {
  position: sticky;
  top: 24px;
  align-self: start;
  display: grid;
  gap: 20px;
}

.brand-card,
.panel,
.metric-card,
.source-card,
.subpanel {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow-sm);
}

.brand-card,
.panel,
.metric-card,
.source-card,
.subpanel,
.account-panel {
  border-radius: var(--radius-lg);
}

.brand-card {
  padding: 24px;
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.brand-mark {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  font-size: 26px;
  font-weight: 800;
  color: white;
  background: linear-gradient(135deg, #2563eb, #14b8a6);
  box-shadow: 0 16px 32px rgba(37, 99, 235, 0.28);
}

.eyebrow {
  margin: 0 0 6px;
  color: #8fb7ff;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.brand-card h1,
.hero h2,
.panel h3,
.panel h4,
.panel h5,
.account-panel h2 {
  margin: 0;
  letter-spacing: -0.03em;
}

.brand-card h1 {
  font-size: 26px;
}

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

.panel,
.account-panel {
  padding: 24px;
}

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

.panel-head h2,
.panel-head h3 {
  font-size: 24px;
}

.panel-head h4 {
  font-size: 18px;
}

.hero {
  padding: 28px;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: flex-start;
  background:
    linear-gradient(135deg, rgba(37, 99, 235, 0.18), rgba(15, 23, 42, 0.14)),
    var(--panel-strong);
  border-color: var(--panel-border-strong);
  box-shadow: var(--shadow-lg);
}

.hero-copy {
  max-width: 820px;
}

.hero-copy h2 {
  font-size: 34px;
  margin-bottom: 10px;
}

.hero-copy .muted {
  font-size: 14px;
  line-height: 1.65;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}

.beta-banner {
  padding: 22px 28px;
  background:
    linear-gradient(135deg, rgba(245, 158, 11, 0.16), rgba(37, 99, 235, 0.12)),
    var(--panel-strong);
  border-color: rgba(245, 158, 11, 0.28);
  box-shadow: var(--shadow-md);
}

.beta-banner h3 {
  font-size: 24px;
  margin-bottom: 8px;
}

.status-copy,
.field-note {
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.55;
}

.status-copy {
  margin: 0 0 18px;
}

.account-summary {
  display: grid;
  gap: 12px;
  margin-bottom: 18px;
  padding: 16px;
  border-radius: var(--radius-md);
  background: rgba(15, 23, 42, 0.45);
  border: 1px solid rgba(148, 163, 184, 0.12);
}

.summary-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
}

.summary-label {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

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

.auth-form label,
.trade-desk-grid label,
.inline-field,
.panel label {
  display: grid;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-soft);
}

input,
select,
textarea,
pre {
  width: 100%;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(15, 23, 42, 0.75);
  color: var(--text-main);
}

input,
select,
textarea {
  padding: 12px 14px;
  transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: rgba(59, 130, 246, 0.48);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.14);
  background: rgba(15, 23, 42, 0.92);
}

textarea {
  resize: vertical;
  min-height: 80px;
}

.sidebar-links {
  display: grid;
  gap: 10px;
  margin: 18px 0 12px;
}

.btn {
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  padding: 12px 18px;
  font-weight: 700;
  letter-spacing: -0.01em;
  transition: transform var(--transition), box-shadow var(--transition), background var(--transition), color var(--transition), opacity var(--transition);
}

.btn:hover:not(:disabled) {
  transform: translateY(-1px);
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn.primary {
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--primary-strong));
  box-shadow: 0 16px 28px rgba(37, 99, 235, 0.26);
}

.btn.ghost {
  color: var(--text-main);
  background: rgba(148, 163, 184, 0.12);
  border: 1px solid rgba(148, 163, 184, 0.16);
}

.btn.danger {
  color: #fff;
  background: linear-gradient(135deg, #ef4444, #dc2626);
  box-shadow: 0 16px 28px rgba(239, 68, 68, 0.18);
}

.btn.wide {
  width: 100%;
  justify-content: center;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(59, 130, 246, 0.18);
  border: 1px solid rgba(59, 130, 246, 0.25);
  color: #dbeafe;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.pill.subtle {
  background: rgba(148, 163, 184, 0.12);
  border-color: rgba(148, 163, 184, 0.18);
  color: var(--text-soft);
}

.pill.accent {
  background: rgba(16, 185, 129, 0.18);
  border-color: rgba(16, 185, 129, 0.24);
  color: #d1fae5;
}

.metrics-grid,
.control-grid,
.panel-grid,
.source-card-grid {
  display: grid;
  gap: 18px;
}

.metrics-grid {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  margin: 24px 0;
}

.metric-card {
  padding: 18px;
  display: grid;
  gap: 8px;
}

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

.metric-card strong {
  font-size: 20px;
  line-height: 1.15;
}

.metric-card small {
  color: var(--text-muted);
  font-size: 12px;
}

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

.control-card,
.subpanel {
  padding: 22px;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(148, 163, 184, 0.14);
  background: rgba(15, 23, 42, 0.42);
}

.control-card-head {
  margin-bottom: 14px;
}

.control-card h4,
.subpanel h4 {
  font-size: 18px;
  margin-bottom: 6px;
}

.subpanel h5 {
  margin: 18px 0 10px;
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

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

.inline-form {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: end;
}

.auth-helper-links {
  margin-top: 10px;
}

.auth-helper-links .btn {
  flex: 1 1 160px;
}

.inline-form + .inline-form,
.inline-form + .field-note,
.button-grid + .inline-form,
.trade-desk-grid + .button-grid {
  margin-top: 14px;
}

.inline-field {
  min-width: 180px;
}

.inline-field.grow,
.inline-form > input,
.inline-form > select {
  flex: 1 1 220px;
}

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

.source-card-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  margin-bottom: 18px;
}

.source-card {
  padding: 18px;
  display: grid;
  gap: 10px;
}

.source-card strong {
  font-size: 16px;
}

.source-card .source-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.mini-pill {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  background: rgba(148, 163, 184, 0.12);
  color: var(--text-soft);
}

.mini-pill.active {
  background: rgba(59, 130, 246, 0.18);
  color: #dbeafe;
}

.mini-pill.warning {
  background: rgba(245, 158, 11, 0.16);
  color: #fef3c7;
}

.mini-pill.success {
  background: rgba(16, 185, 129, 0.16);
  color: #d1fae5;
}

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

.table {
  width: 100%;
  border-collapse: collapse;
  overflow: hidden;
}

.table th,
.table td {
  padding: 12px 10px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
  text-align: left;
  font-size: 13px;
  vertical-align: top;
}

.table th {
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.compact-table th,
.compact-table td {
  padding-block: 10px;
}

.small-btn {
  border: 0;
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 700;
  color: #dbeafe;
  background: rgba(59, 130, 246, 0.18);
  cursor: pointer;
}

.runtime-payload {
  min-height: 320px;
  padding: 16px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 12px;
  line-height: 1.6;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
}

.checkbox-row input {
  width: 18px;
  height: 18px;
  margin: 0;
}

.admin-grid {
  margin-top: 18px;
}

.wide-card {
  margin-top: 18px;
}

.hidden {
  display: none !important;
}

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

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

  .sidebar {
    position: static;
  }

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

@media (max-width: 760px) {
  .dashboard-shell {
    width: min(100% - 24px, 100%);
    margin: 12px auto 24px;
    gap: 16px;
  }

  .brand-card,
  .panel,
  .account-panel,
  .metric-card,
  .subpanel,
  .source-card {
    padding: 18px;
  }

  .hero,
  .panel-head,
  .hero-actions,
  .inline-form {
    flex-direction: column;
    align-items: stretch;
  }

  .control-grid,
  .panel-grid,
  .metrics-grid,
  .trade-desk-grid {
    grid-template-columns: 1fr;
  }

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