:root {
  --bg: #07111f;
  --panel: rgba(8, 23, 43, 0.82);
  --panel-strong: rgba(12, 31, 56, 0.96);
  --line: rgba(120, 192, 255, 0.18);
  --text: #edf7ff;
  --muted: #9db7ce;
  --accent: #d0a95f;
  --accent-dark: #8b5f1c;
  --accent-soft: rgba(208, 169, 95, 0.14);
  --success: #60d7b4;
  --danger: #ff6a7d;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.38);
  --radius: 22px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  color: var(--text);
  background:
    radial-gradient(circle at 15% 20%, rgba(56, 164, 255, 0.2), transparent 18%),
    radial-gradient(circle at 85% 14%, rgba(245, 191, 94, 0.16), transparent 16%),
    radial-gradient(circle at 50% 0%, rgba(88, 146, 255, 0.1), transparent 28%),
    linear-gradient(180deg, #06101d 0%, #0a1830 38%, #091423 100%);
  min-height: 100vh;
  position: relative;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at center, transparent 0 58%, rgba(92, 173, 255, 0.05) 58.5%, transparent 59.5%),
    radial-gradient(circle at center, transparent 0 68%, rgba(208, 169, 95, 0.04) 68.5%, transparent 69.5%),
    radial-gradient(circle at center, transparent 0 80%, rgba(92, 173, 255, 0.03) 80.5%, transparent 81.5%);
  opacity: 0.7;
  transform: scale(1.4);
}

.page-shell {
  width: min(1380px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 28px 0 40px;
}

.callback-shell {
  max-width: 980px;
}

.hero {
  padding: 30px;
  border-radius: 30px;
  background:
    linear-gradient(135deg, rgba(9, 38, 74, 0.96), rgba(4, 16, 31, 0.96)),
    linear-gradient(135deg, #0b3665, #081221);
  color: #f4fbff;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(147, 210, 255, 0.18);
}

.hero::after {
  content: "";
  position: absolute;
  inset: -30% -8% auto auto;
  width: 360px;
  height: 360px;
  background:
    radial-gradient(circle, rgba(103, 196, 255, 0.35), transparent 44%),
    radial-gradient(circle, transparent 0 54%, rgba(242, 196, 111, 0.12) 54.5%, transparent 57%),
    radial-gradient(circle, transparent 0 70%, rgba(103, 196, 255, 0.1) 70.5%, transparent 73%);
}

.hero::before {
  content: "";
  position: absolute;
  inset: auto auto -70px -40px;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  background:
    radial-gradient(circle at center, rgba(242, 196, 111, 0.18), transparent 42%),
    radial-gradient(circle at center, transparent 0 60%, rgba(103, 196, 255, 0.12) 60.5%, transparent 63%);
}

.eyebrow {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.24em;
  font-size: 0.8rem;
  color: #f2c46f;
}

.hero h1 {
  margin: 12px 0 10px;
  font-size: clamp(2rem, 4vw, 3.6rem);
  line-height: 1.05;
}

.hero-copy {
  max-width: 720px;
  margin: 0;
  color: rgba(230, 245, 255, 0.9);
  font-size: 1.02rem;
}

.flash {
  margin-top: 18px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(97, 179, 255, 0.12);
  border: 1px solid rgba(133, 204, 255, 0.2);
}

.flash.hidden {
  display: none;
}

.flash.error {
  background: rgba(165, 29, 45, 0.18);
  border-color: rgba(255, 205, 211, 0.3);
}

.token-form {
  margin-top: 18px;
  padding: 16px;
  border-radius: 18px;
  background: rgba(6, 20, 37, 0.52);
  border: 1px solid rgba(133, 204, 255, 0.18);
  max-width: 620px;
}

.token-form.hidden {
  display: none;
}

.token-form label {
  display: block;
  margin-bottom: 10px;
  color: #d6ebff;
  font-size: 0.94rem;
}

.token-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-top: 18px;
}

.tab-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
  padding: 10px;
  border-radius: 999px;
  background: rgba(7, 24, 44, 0.78);
  border: 1px solid rgba(120, 192, 255, 0.14);
  box-shadow: var(--shadow);
  position: sticky;
  top: 14px;
  z-index: 5;
  backdrop-filter: blur(14px);
}

.tab-button {
  color: #dceeff;
  background: transparent;
  box-shadow: none;
  border: 1px solid transparent;
}

.tab-button.active {
  color: #08111e;
  background: linear-gradient(135deg, #f2c46f, #bf8f3f);
  box-shadow: 0 10px 24px rgba(191, 143, 63, 0.22);
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
  position: relative;
  overflow: hidden;
}

.panel::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: linear-gradient(180deg, #69d1ff, #d0a95f);
  opacity: 0.9;
}

.panel-wide {
  grid-column: 1 / -1;
}

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

.panel h2 {
  margin: 0;
  font-size: 1.3rem;
  letter-spacing: 0.02em;
  color: #f5fbff;
}

.section-copy {
  margin-top: -4px;
  margin-bottom: 16px;
}

button {
  border: 0;
  border-radius: 999px;
  padding: 11px 16px;
  font: inherit;
  font-weight: 700;
  color: #08111e;
  background: linear-gradient(135deg, #f2c46f, #bf8f3f);
  cursor: pointer;
  transition: transform 120ms ease, opacity 120ms ease;
  box-shadow: 0 10px 24px rgba(191, 143, 63, 0.28);
}

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

button.secondary {
  color: #eef8ff;
  background: linear-gradient(135deg, #2f83d0, #13497c);
}

button.ghost {
  background: transparent;
  color: #a9d5ff;
  border: 1px solid rgba(121, 193, 255, 0.24);
  box-shadow: none;
}

button.danger {
  color: #fff6f8;
  background: linear-gradient(135deg, #cb4760, #861e31);
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid rgba(123, 195, 255, 0.18);
  border-radius: 16px;
  background: var(--panel-strong);
  color: var(--text);
  font: inherit;
  padding: 12px 14px;
}

textarea {
  resize: vertical;
}

label span,
.hint {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.94rem;
}

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

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

.compact-grid .wide {
  grid-column: span 2;
}

.action-cell {
  display: flex;
  align-items: end;
}

.checkbox {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 100%;
  padding: 10px 14px;
  border-radius: 18px;
  border: 1px solid rgba(123, 195, 255, 0.12);
  background: rgba(12, 31, 56, 0.84);
}

.checkbox input {
  width: auto;
  margin: 0;
}

.checkbox span {
  margin: 0;
}

.stacked-form,
.inline-form {
  display: grid;
  gap: 10px;
  margin-bottom: 16px;
}

.stacked-form:last-child,
.inline-form:last-child {
  margin-bottom: 0;
}

.inline-form {
  grid-template-columns: 1fr auto;
}

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

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

.status-card {
  border-radius: 18px;
  padding: 16px;
  background:
    linear-gradient(180deg, rgba(13, 38, 69, 0.95), rgba(8, 25, 47, 0.92)),
    linear-gradient(135deg, rgba(103, 196, 255, 0.08), rgba(242, 196, 111, 0.06));
  border: 1px solid rgba(123, 195, 255, 0.16);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.status-card strong {
  display: block;
  font-size: 1.5rem;
  margin-top: 8px;
  color: #f2c46f;
}

.status-card span {
  color: #9dd8ff;
}

.list {
  display: grid;
  gap: 10px;
}

.list-item {
  display: grid;
  gap: 10px;
  padding: 14px;
  border-radius: 18px;
  border: 1px solid rgba(123, 195, 255, 0.12);
  background: rgba(9, 28, 51, 0.86);
}

.list-item-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
}

.list-item-title {
  font-weight: 700;
  font-size: 1rem;
}

.list-item-meta,
.list-item pre {
  margin: 0;
  color: var(--muted);
  white-space: pre-wrap;
  word-break: break-word;
}

.chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 999px;
  background: var(--accent-soft);
  border: 1px solid rgba(242, 196, 111, 0.18);
}

.empty-state {
  padding: 18px;
  border-radius: 18px;
  border: 1px dashed rgba(123, 195, 255, 0.24);
  color: var(--muted);
  text-align: center;
}

code {
  font-family: "Courier New", monospace;
}

@media (max-width: 1100px) {
  .dashboard-grid,
  .form-grid,
  .compact-grid,
  .status-grid,
  .access-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .compact-grid .wide {
    grid-column: auto;
  }
}

@media (max-width: 720px) {
  .page-shell {
    width: min(100vw - 20px, 100%);
    padding-top: 12px;
  }

  .dashboard-grid,
  .form-grid,
  .compact-grid,
  .status-grid,
  .access-grid,
  .inline-form,
  .token-row {
    grid-template-columns: 1fr;
  }

  .panel {
    padding: 18px;
  }

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

  .tab-bar {
    border-radius: 22px;
    top: 8px;
  }
}
