:root {
  --bg: #071321;
  --bg-secondary: #0f172a;
  --surface: rgba(15, 23, 42, 0.72);
  --surface-strong: rgba(15, 23, 42, 0.92);
  --border: rgba(148, 163, 184, 0.2);
  --text: #f8fafc;
  --muted: #cbd5e1;
  --primary: #0ea5e9;
  --primary-dark: #0284c7;
  --success: #22c55e;
  --warning: #f59e0b;
  --danger: #ef4444;
}

body {
  color: var(--text);
  max-width: 100%;
  overflow-x: hidden;
}

.bg-aurora {
  background:
    radial-gradient(1200px 600px at 8% -10%, rgba(56, 189, 248, 0.24), transparent 50%),
    radial-gradient(900px 500px at 90% 10%, rgba(16, 185, 129, 0.2), transparent 52%),
    linear-gradient(160deg, #030712, #071a2d 45%, #10233d);
}

.bg-admin {
  background:
    radial-gradient(1200px 600px at 100% 0%, rgba(14, 165, 233, 0.2), transparent 55%),
    linear-gradient(180deg, #020617, #0b1120);
}

.glass {
  background: rgba(2, 6, 23, 0.55);
  backdrop-filter: blur(12px);
}

.brand {
  display: inline-flex;
  align-items: center;
  line-height: 1;
}

.brand-logo {
  display: block;
  width: auto;
  height: 2.15rem;
  max-width: min(230px, 52vw);
  object-fit: contain;
}

.admin-sidebar .brand-logo {
  height: 2.35rem;
  max-width: min(240px, 100%);
}

.header-main {
  position: relative;
}

.site-nav {
  margin-left: auto;
  position: relative;
}

.site-nav__desktop {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.site-nav__mobile {
  position: absolute;
  top: calc(100% + 0.65rem);
  right: 0;
  width: min(320px, calc(100vw - 2rem));
  padding: 0.85rem;
  border: 1px solid rgba(148, 163, 184, 0.26);
  border-radius: 0.9rem;
  background: rgba(2, 6, 23, 0.96);
  box-shadow: 0 18px 34px rgba(2, 6, 23, 0.55);
  z-index: 45;
}

.site-nav__mobile[hidden] {
  display: none;
}

.site-nav__mobile .nav-link,
.site-nav__mobile .btn {
  width: 100%;
}

.site-nav__mobile .nav-link {
  display: inline-flex;
  justify-content: flex-start;
}

.site-nav__mobile form {
  width: 100%;
}

.mobile-menu-toggle {
  display: none;
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 0.75rem;
  border: 1px solid rgba(148, 163, 184, 0.42);
  background: rgba(15, 23, 42, 0.72);
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 0.24rem;
}

.mobile-menu-toggle span {
  display: block;
  width: 1.08rem;
  height: 2px;
  border-radius: 999px;
  background: #e2e8f0;
}

.mobile-menu-toggle:hover,
.mobile-menu-toggle:focus-visible {
  border-color: rgba(14, 165, 233, 0.7);
}

.nav-link {
  padding: 0.4rem 0.75rem;
  border-radius: 999px;
  color: #cbd5e1;
  transition: 0.2s ease;
}

.nav-link:hover,
.nav-link.active {
  color: #fff;
  background: rgba(30, 41, 59, 0.95);
}

.hero-card,
.card,
.card-subtle,
.auth-card,
.stat-card,
.card-link,
.product-card {
  border: 1px solid var(--border);
  border-radius: 1rem;
}

.hero-card {
  padding: 2.25rem;
  background:
    linear-gradient(120deg, rgba(14, 165, 233, 0.14), rgba(16, 185, 129, 0.12)),
    var(--surface);
}

.card {
  background: var(--surface-strong);
}

.card-subtle,
.product-card {
  background: rgba(30, 41, 59, 0.52);
}

.product-card {
  padding: 1rem;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.product-card:hover {
  transform: translateY(-1px);
  border-color: rgba(14, 165, 233, 0.45);
}

.product-card.is-disabled {
  opacity: 0.6;
}

.metric-box {
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  padding: 0.65rem;
}

.metric-box span {
  display: block;
  color: #cbd5e1;
  font-size: 0.78rem;
}

.metric-box strong {
  display: block;
  margin-top: 0.25rem;
}

.countdown-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
}

.countdown-box {
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  padding: 0.8rem 0.6rem;
  text-align: center;
}

.countdown-box span {
  display: block;
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1;
}

.countdown-box small {
  display: block;
  margin-top: 0.25rem;
  color: #cbd5e1;
}

.badge,
.badge-success,
.badge-warning {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.2rem 0.7rem;
  font-size: 0.74rem;
  border: 1px solid rgba(148, 163, 184, 0.32);
  background: rgba(30, 41, 59, 0.8);
}

.badge-success {
  border-color: rgba(34, 197, 94, 0.45);
  background: rgba(34, 197, 94, 0.2);
}

.badge-warning {
  border-color: rgba(245, 158, 11, 0.45);
  background: rgba(245, 158, 11, 0.2);
}

.badge-danger {
  border-color: rgba(239, 68, 68, 0.45);
  background: rgba(239, 68, 68, 0.2);
}

.alert {
  border-radius: 0.9rem;
  padding: 0.8rem 1rem;
  border: 1px solid;
}

.alert-success {
  border-color: rgba(34, 197, 94, 0.42);
  background: rgba(22, 163, 74, 0.2);
}

.alert-error {
  border-color: rgba(239, 68, 68, 0.44);
  background: rgba(239, 68, 68, 0.2);
}

.alert-warning {
  border-color: rgba(245, 158, 11, 0.4);
  background: rgba(245, 158, 11, 0.2);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.55rem 1rem;
  border-radius: 0.75rem;
  border: 1px solid transparent;
  transition: 0.2s ease;
  font-weight: 600;
}

.btn-primary {
  background: linear-gradient(180deg, var(--primary), var(--primary-dark));
  color: #fff;
}

.btn-primary:hover {
  filter: brightness(1.08);
}

.btn-ghost {
  border-color: rgba(148, 163, 184, 0.35);
  color: #e2e8f0;
  background: rgba(15, 23, 42, 0.55);
}

.btn-ghost:hover {
  border-color: rgba(148, 163, 184, 0.65);
}

.btn-danger {
  background: rgba(239, 68, 68, 0.2);
  color: #fecaca;
  border-color: rgba(239, 68, 68, 0.45);
}

.btn-danger:hover {
  background: rgba(239, 68, 68, 0.28);
}

.btn-xs {
  padding: 0.35rem 0.6rem;
  font-size: 0.75rem;
}

.input {
  width: 100%;
  border-radius: 0.75rem;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(15, 23, 42, 0.65);
  color: var(--text);
  padding: 0.55rem 0.75rem;
  outline: none;
}

.input:focus {
  border-color: rgba(14, 165, 233, 0.6);
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.2);
}

.input-sm {
  padding: 0.4rem 0.6rem;
}

.mail-editor {
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 0.75rem;
  background: rgba(15, 23, 42, 0.65);
  overflow: hidden;
}

.mail-editor__toolbar {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  padding: 0.5rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
  background: rgba(2, 6, 23, 0.55);
}

.mail-editor__btn {
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(15, 23, 42, 0.7);
  color: #e2e8f0;
  border-radius: 0.55rem;
  padding: 0.3rem 0.5rem;
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1;
  min-width: 2.1rem;
  transition: 0.2s ease;
}

.mail-editor__btn:hover {
  border-color: rgba(14, 165, 233, 0.65);
  background: rgba(14, 165, 233, 0.2);
}

.mail-editor__content {
  min-height: 16rem;
  padding: 0.75rem;
  outline: none;
  color: var(--text);
  line-height: 1.55;
}

.mail-editor__content:focus {
  box-shadow: inset 0 0 0 1px rgba(14, 165, 233, 0.65);
}

.mail-editor__content p,
.mail-editor__content ul,
.mail-editor__content ol,
.mail-editor__content blockquote,
.mail-editor__content h2,
.mail-editor__content h3,
.mail-editor__content h4 {
  margin: 0 0 0.72rem;
}

.mail-editor__content ul,
.mail-editor__content ol {
  padding-left: 1.25rem;
}

.mail-editor__content blockquote {
  border-left: 3px solid rgba(14, 165, 233, 0.45);
  padding-left: 0.7rem;
  color: #cbd5e1;
}

.mail-editor__content a {
  color: #7dd3fc;
  text-decoration: underline;
}

.label {
  display: block;
  margin-bottom: 0.32rem;
  color: var(--muted);
  font-size: 0.84rem;
}

.switch {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.8rem;
  color: #e2e8f0;
}

.table-wrap {
  display: block;
  width: min(100%, 100dvw);
  max-width: 100%;
  min-width: 0;
  position: relative;
  box-sizing: border-box;
  overflow-x: auto;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  touch-action: pan-x pan-y;
}

.table {
  width: max-content;
  min-width: 100%;
  border-collapse: collapse;
  table-layout: auto;
  max-width: none;
}

.table th,
.table td {
  text-align: left;
  border-bottom: 1px solid rgba(148, 163, 184, 0.16);
  padding: 0.72rem 0.6rem;
  vertical-align: top;
  white-space: nowrap;
}

.table th {
  color: #cbd5e1;
  font-weight: 600;
  font-size: 0.82rem;
}

.table-compact th,
.table-compact td {
  padding: 0.55rem 0.5rem;
}

.auth-shell {
  display: grid;
  place-items: center;
  min-height: 70vh;
}

.auth-card {
  width: min(100%, 560px);
  background: rgba(2, 6, 23, 0.82);
  padding: 2rem;
}

.stat-card {
  background: rgba(2, 6, 23, 0.75);
  padding: 1rem;
}

.stat-card h3 {
  color: #cbd5e1;
  font-size: 0.88rem;
  margin-bottom: 0.35rem;
}

.stat-card .value {
  font-size: 1.8rem;
  font-weight: 700;
}

.admin-grid {
  display: grid;
  grid-template-columns: 280px 1fr;
  min-height: 100vh;
}

.admin-sidebar {
  border-right: 1px solid rgba(148, 163, 184, 0.2);
  padding: 1.2rem;
  background: rgba(2, 6, 23, 0.84);
  backdrop-filter: blur(12px);
}

.admin-content {
  padding: 1.5rem;
}

.admin-link {
  display: block;
  padding: 0.55rem 0.7rem;
  border-radius: 0.65rem;
  color: #cbd5e1;
}

.admin-link:hover,
.admin-link.active {
  color: #fff;
  background: rgba(14, 165, 233, 0.2);
}

.card-link {
  display: block;
  background: rgba(15, 23, 42, 0.85);
  padding: 1.1rem;
  font-weight: 600;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.card-link:hover {
  transform: translateY(-2px);
  border-color: rgba(14, 165, 233, 0.55);
}

.faq-list {
  display: grid;
  gap: 0.75rem;
}

.faq-item {
  border: 1px solid var(--border);
  border-radius: 0.85rem;
  background: rgba(15, 23, 42, 0.7);
  overflow: hidden;
}

.faq-item[open] {
  border-color: rgba(14, 165, 233, 0.5);
}

.faq-question {
  cursor: pointer;
  padding: 0.95rem 1rem;
  font-weight: 600;
  list-style: none;
}

.faq-question::-webkit-details-marker {
  display: none;
}

.faq-question::after {
  content: '+';
  float: right;
  color: #93c5fd;
  font-weight: 700;
}

.faq-item[open] .faq-question::after {
  content: '−';
}

.faq-answer {
  padding: 0 1rem 1rem;
  color: #cbd5e1;
  line-height: 1.6;
}

.faq-answer p {
  margin: 0;
}

.waitlist-product-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.35rem 0.5rem;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 0.7rem;
  background: rgba(15, 23, 42, 0.55);
  overflow: visible;
}

.waitlist-product-info-btn {
  width: 1.2rem;
  height: 1.2rem;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.55);
  background: rgba(30, 41, 59, 0.95);
  color: #e2e8f0;
  font-size: 0.7rem;
  font-weight: 700;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}

.waitlist-product-info-btn:hover,
.waitlist-product-info-btn:focus-visible {
  border-color: rgba(14, 165, 233, 0.75);
  color: #bae6fd;
}

.waitlist-product-tooltip {
  position: absolute;
  left: 0;
  top: calc(100% + 0.4rem);
  width: min(100%, 360px);
  padding: 0.7rem 0.75rem;
  border-radius: 0.7rem;
  border: 1px solid rgba(14, 165, 233, 0.55);
  background: rgba(2, 6, 23, 0.96);
  color: #e2e8f0;
  font-size: 0.78rem;
  line-height: 1.45;
  box-shadow: 0 14px 28px rgba(2, 6, 23, 0.55);
  z-index: 35;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transform: translateY(4px);
  transition: opacity 0.16s ease, transform 0.16s ease;
}

.waitlist-product-tooltip::before {
  content: '';
  position: absolute;
  left: 0.95rem;
  top: -0.35rem;
  width: 0.65rem;
  height: 0.65rem;
  background: rgba(2, 6, 23, 0.96);
  border-left: 1px solid rgba(14, 165, 233, 0.55);
  border-top: 1px solid rgba(14, 165, 233, 0.55);
  transform: rotate(45deg);
}

.waitlist-product-tooltip p {
  margin: 0 0 0.5rem;
}

.waitlist-product-item:hover .waitlist-product-tooltip,
.waitlist-product-item:focus-within .waitlist-product-tooltip,
.waitlist-product-item.is-open .waitlist-product-tooltip {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dashboard-balance-chart summary {
  list-style: none;
}

.dashboard-balance-chart summary::-webkit-details-marker {
  display: none;
}

.dashboard-balance-chart__summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  cursor: pointer;
}

.dashboard-balance-chart__meta {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 0.85rem;
  color: #cbd5e1;
  font-size: 0.86rem;
}

.dashboard-balance-chart__canvas {
  border: 1px solid var(--border);
  border-radius: 0.85rem;
  background: rgba(15, 23, 42, 0.7);
  padding: 0.75rem;
}

.dashboard-balance-chart__canvas svg {
  width: 100%;
  height: 300px;
  display: block;
}

body.modal-open {
  overflow: hidden;
}

.admin-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 1rem;
}

.admin-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 6, 23, 0.72);
  backdrop-filter: blur(2px);
}

.admin-modal__panel {
  position: relative;
  z-index: 1;
  width: min(960px, 100%);
  max-height: calc(100vh - 2rem);
  overflow: auto;
  background: var(--surface-strong);
  border: 1px solid var(--border);
  border-radius: 1rem;
  padding: 1.25rem;
}

.app-popup {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  padding: 1rem;
}

.app-popup__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 6, 23, 0.76);
  backdrop-filter: blur(4px);
}

.app-popup__panel {
  position: relative;
  z-index: 1;
  width: min(520px, 100%);
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 1.15rem;
  background:
    radial-gradient(circle at top right, rgba(14, 165, 233, 0.14), transparent 38%),
    linear-gradient(180deg, rgba(15, 23, 42, 0.98), rgba(2, 6, 23, 0.98));
  box-shadow: 0 30px 80px rgba(2, 6, 23, 0.55);
  padding: 1.35rem;
}

.app-popup__top {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}

.app-popup__icon {
  flex: 0 0 auto;
  width: 3rem;
  height: 3rem;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-size: 1.25rem;
  font-weight: 700;
  color: #f8fafc;
  background: rgba(148, 163, 184, 0.16);
  border: 1px solid rgba(148, 163, 184, 0.24);
}

.app-popup__icon.is-success {
  background: rgba(34, 197, 94, 0.18);
  border-color: rgba(34, 197, 94, 0.32);
}

.app-popup__icon.is-warning {
  background: rgba(245, 158, 11, 0.18);
  border-color: rgba(245, 158, 11, 0.34);
}

.app-popup__icon.is-danger {
  background: rgba(239, 68, 68, 0.18);
  border-color: rgba(239, 68, 68, 0.34);
}

.app-popup__title {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 700;
}

.app-popup__message {
  margin: 0.5rem 0 0;
  color: #cbd5e1;
  line-height: 1.6;
  white-space: pre-line;
}

.app-popup__content {
  margin-top: 0.85rem;
}

.app-popup__actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 1.25rem;
}

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

  .admin-sidebar {
    border-right: 0;
    border-bottom: 1px solid rgba(148, 163, 184, 0.2);
  }
}

@media (max-width: 639px) {
  .countdown-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .table-wrap {
    width: min(100%, calc(100dvw - 1rem));
    max-width: calc(100dvw - 1rem);
  }

  .table th,
  .table td {
    padding: 0.56rem 0.45rem;
    font-size: 0.78rem;
  }

  .site-nav__desktop {
    display: none;
  }

  .mobile-menu-toggle {
    display: inline-flex;
  }

  .brand-logo {
    height: 1.95rem;
    max-width: min(190px, 55vw);
  }

  .waitlist-product-tooltip {
    width: 100%;
  }

  .app-popup__panel {
    padding: 1rem;
  }

  .app-popup__top {
    gap: 0.8rem;
  }

  .app-popup__icon {
    width: 2.7rem;
    height: 2.7rem;
  }

  .app-popup__actions {
    justify-content: stretch;
  }

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