:root {
  --bg: #edf6ff;
  --bg-soft: rgba(232, 243, 255, 0.82);
  --panel: rgba(255, 255, 255, 0.88);
  --panel-border: rgba(90, 145, 210, 0.14);
  --text: #17324d;
  --muted: #6d89a6;
  --blue: #5da9ff;
  --blue-deep: #2d6fcc;
  --cyan: #74d7ff;
  --mint: #7de3cf;
  --danger: #ff718d;
  --shadow: 0 20px 50px rgba(62, 106, 160, 0.14);
}

body[data-theme="dark"] {
  --bg: #0b1220;
  --bg-soft: rgba(13, 21, 36, 0.82);
  --panel: rgba(15, 23, 38, 0.88);
  --panel-border: rgba(146, 181, 228, 0.14);
  --text: #e7f2ff;
  --muted: #a3b7cf;
  --blue: #4c95f0;
  --blue-deep: #8dc2ff;
  --cyan: #58d5ff;
  --mint: #7de3cf;
  --danger: #ff718d;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.34);
}

* { box-sizing: border-box; }

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100%;
  color: var(--text);
  font-family: "Manrope", sans-serif;
  background: transparent;
}

body[data-theme="dark"] {
  background: transparent;
}

body {
  position: relative;
  overflow-x: hidden;
}

.bg-orb {
  position: fixed;
  border-radius: 999px;
  filter: blur(28px);
  opacity: 0.55;
  pointer-events: none;
}

.page-bg {
  position: fixed;
  inset: 0;
  z-index: -3;
  background:
    radial-gradient(circle at top left, rgba(93, 169, 255, 0.24), transparent 30%),
    radial-gradient(circle at 84% 16%, rgba(116, 215, 255, 0.20), transparent 24%),
    radial-gradient(circle at 18% 82%, rgba(125, 227, 207, 0.16), transparent 26%),
    linear-gradient(180deg, #f7fbff 0%, #eaf4ff 100%);
}

body[data-theme="dark"] .page-bg {
  background:
    radial-gradient(circle at top left, rgba(76, 149, 240, 0.18), transparent 30%),
    radial-gradient(circle at 84% 16%, rgba(88, 213, 255, 0.15), transparent 24%),
    radial-gradient(circle at 18% 82%, rgba(125, 227, 207, 0.12), transparent 26%),
    linear-gradient(180deg, #07101c 0%, #0e1727 100%);
}

.orb-a {
  width: 240px;
  height: 240px;
  background: rgba(93, 169, 255, 0.24);
  top: -60px;
  right: -40px;
}

.orb-b {
  width: 280px;
  height: 280px;
  background: rgba(125, 227, 207, 0.20);
  left: -70px;
  bottom: 10%;
}

.page-shell {
  width: min(1180px, calc(100% - 28px));
  margin: 0 auto;
  padding: 86px 0 40px;
  position: relative;
  z-index: 1;
}

.hero {
  position: relative;
  margin-bottom: 12px;
  padding: 28px;
  border: 1px solid var(--panel-border);
  border-radius: 30px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(241, 248, 255, 0.82)),
    linear-gradient(140deg, rgba(93, 169, 255, 0.12), rgba(125, 227, 207, 0.10));
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

body[data-theme="dark"] .hero {
  background:
    linear-gradient(135deg, rgba(15, 23, 38, 0.96), rgba(12, 18, 31, 0.90)),
    linear-gradient(140deg, rgba(76, 149, 240, 0.12), rgba(88, 213, 255, 0.08));
}

.hero-topline, .eyebrow {
  font-family: "Space Grotesk", sans-serif;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--blue-deep);
}

.hero h1, .panel h2 {
  margin: 8px 0 0;
  font-family: "Space Grotesk", sans-serif;
  letter-spacing: -0.03em;
}

.hero h1 {
  font-size: clamp(34px, 7vw, 58px);
  line-height: 0.96;
}

.hero-copy {
  max-width: 680px;
  margin: 16px 0 0;
  font-size: 15px;
  line-height: 1.7;
  color: var(--muted);
}

.hero-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.badge {
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(93, 169, 255, 0.10);
  border: 1px solid rgba(93, 169, 255, 0.14);
  color: #245182;
  font-size: 13px;
}

.top-nav {
  position: fixed;
  top: 22px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 60;
  width: min(1180px, calc(100% - 28px));
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.74);
  border: 1px solid rgba(93, 169, 255, 0.12);
  box-shadow: 0 18px 44px rgba(62, 106, 160, 0.12);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  overflow: hidden;
}

body[data-theme="dark"] .top-nav {
  background: rgba(12, 19, 32, 0.75);
  border-color: rgba(146, 181, 228, 0.12);
}

.top-nav-panel {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 10px 10px;
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transform: translateY(-8px);
  pointer-events: none;
  transition:
    max-height 260ms ease,
    opacity 220ms ease,
    transform 220ms ease,
    padding 220ms ease;
}

.top-nav-panel.is-open {
  max-height: 320px;
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
  padding: 10px;
}

.nav-toggle {
  width: 100%;
  border: 0;
  background: linear-gradient(135deg, var(--blue), var(--cyan));
  color: white;
  padding: 14px 16px;
  border-radius: 24px;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.nav-pill {
  border: 1px solid rgba(93, 169, 255, 0.18);
  background: rgba(255, 255, 255, 0.88);
  color: #245182;
  border-radius: 999px;
  padding: 10px 14px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(62, 106, 160, 0.06);
}

.nav-pill.active {
  background: linear-gradient(135deg, var(--blue), var(--cyan));
  color: white;
}

.nav-theme {
  margin-left: auto;
}

.gate {
  margin-top: 16px;
}

.gate.hidden { display: none; }

.gate-card {
  padding: 18px 20px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(93, 169, 255, 0.14);
  box-shadow: var(--shadow);
}

body[data-theme="dark"] .gate-card,
body[data-theme="dark"] .plan-card,
body[data-theme="dark"] .faq-card,
body[data-theme="dark"] .stat-card {
  background: rgba(14, 22, 37, 0.92);
  border-color: rgba(146, 181, 228, 0.12);
}

.gate-title {
  font-family: "Space Grotesk", sans-serif;
  font-weight: 700;
  font-size: 18px;
  margin-bottom: 8px;
  color: var(--text);
}

.gate-text {
  color: var(--muted);
  line-height: 1.6;
}

.dashboard {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 18px;
}

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

body[data-theme="dark"] .panel {
  background: rgba(15, 23, 38, 0.88);
}

.nav-section { grid-column: span 12; }

.nav-section.hidden {
  display: none;
}

body.menu-open .page-shell {
  padding-top: 140px;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 22px 22px 0;
}

.panel h2 {
  font-size: clamp(24px, 4vw, 34px);
}

.panel-body, .link-box, .plans-grid, .faq-grid, .admin-stats {
  padding: 20px 22px 22px;
}

.loading-state, .empty-state { color: var(--muted); }

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

.stat-card {
  padding: 16px;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255,255,255,0.95), rgba(237,246,255,0.92));
  border: 1px solid rgba(93,169,255,0.10);
}

body[data-theme="dark"] .stat-card {
  background: rgba(14, 22, 37, 0.92);
}

.stat-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
}

.stat-value {
  margin-top: 8px;
  font-size: 21px;
  font-weight: 800;
}

.stat-value.online { color: #1f9a67; }
.stat-value.offline { color: var(--danger); }

.link-box label {
  display: block;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 13px;
}

textarea {
  width: 100%;
  min-height: 126px;
  resize: vertical;
  padding: 16px;
  border: 1px solid rgba(93, 169, 255, 0.16);
  border-radius: 18px;
  background: rgba(255,255,255,0.9);
  color: var(--text);
  font: inherit;
}

body[data-theme="dark"] textarea {
  background: rgba(10, 17, 30, 0.86);
  border-color: rgba(146, 181, 228, 0.16);
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.primary-button, .ghost-button, .plan-button {
  appearance: none;
  border: 0;
  border-radius: 16px;
  padding: 14px 18px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: transform 180ms ease, opacity 180ms ease, background 180ms ease;
  text-decoration: none;
  color: var(--text);
}

.primary-button:hover, .ghost-button:hover, .plan-button:hover, .nav-pill:hover {
  transform: translateY(-1px);
}

.primary-button {
  background: linear-gradient(135deg, var(--blue), var(--cyan));
  color: white;
}

body[data-theme="dark"] .ghost-button,
body[data-theme="dark"] .nav-pill {
  background: rgba(13, 22, 37, 0.84);
  color: #dcecff;
}

body[data-theme="dark"] .nav-pill.active {
  background: linear-gradient(135deg, var(--blue), var(--cyan));
  color: #06111d;
}

.ghost-button {
  background: rgba(93,169,255,0.08);
  border: 1px solid rgba(93,169,255,0.14);
}

.plans-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}

.plan-card {
  padding: 18px;
  border-radius: 20px;
  border: 1px solid rgba(93,169,255,0.12);
  background: linear-gradient(180deg, rgba(255,255,255,0.96), rgba(238,247,255,0.88));
}

body[data-theme="dark"] .plan-card {
  background: rgba(14, 22, 37, 0.92);
  border-color: rgba(146, 181, 228, 0.12);
}

.plan-title {
  font-family: "Space Grotesk", sans-serif;
  font-size: 20px;
  font-weight: 700;
}

.plan-meta {
  margin-top: 6px;
  color: var(--muted);
}

.plan-price {
  margin-top: 16px;
  font-size: 30px;
  font-weight: 800;
  color: #194d82;
}

body[data-theme="dark"] .plan-price {
  color: #8dc2ff;
}

.plan-button {
  margin-top: 14px;
  width: 100%;
  background: rgba(93,169,255,0.12);
  color: #1e568f;
  border: 1px solid rgba(93,169,255,0.18);
}

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

.faq-card {
  padding: 18px;
  border-radius: 20px;
  color: #17324d;
  background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(239,247,255,0.90));
  border: 1px solid rgba(93,169,255,0.12);
}

body[data-theme="dark"] .faq-card {
  background: rgba(14, 22, 37, 0.92);
  border-color: rgba(146, 181, 228, 0.12);
}

.faq-card h3 {
  margin: 0 0 10px;
  font-size: 18px;
}

.faq-card p {
  margin: 0;
  line-height: 1.65;
  color: var(--muted);
}

body[data-theme="dark"] .faq-card p,
body[data-theme="dark"] .gate-text,
body[data-theme="dark"] .hero-copy,
body[data-theme="dark"] .plan-meta {
  color: var(--muted);
}

body[data-theme="dark"] .badge {
  background: rgba(13, 22, 37, 0.84);
  border-color: rgba(146, 181, 228, 0.12);
  color: #dcecff;
}

.accent-gold { border-color: rgba(93,169,255,0.14); }
.accent-blue { border-color: rgba(116,215,255,0.24); }
.accent-red { border-color: rgba(125,227,207,0.20); }

.hidden { display: none; }

.subscriptions-page .page-shell {
  width: min(560px, calc(100% - 24px));
  padding-top: 18px;
}

.subscriptions-shell {
  min-height: 100vh;
}

.subscriptions-bg {
  background:
    radial-gradient(circle at top left, rgba(84, 114, 154, 0.10), transparent 28%),
    radial-gradient(circle at 78% 14%, rgba(48, 72, 102, 0.12), transparent 24%),
    linear-gradient(180deg, #05070a 0%, #080c12 100%);
}

.subscriptions-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 28px;
  padding: 18px 20px;
  border-radius: 22px;
  background: rgba(10, 13, 19, 0.98);
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.22);
}

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

.subscriptions-title {
  font-family: "Space Grotesk", sans-serif;
  font-size: 22px;
  font-weight: 700;
  color: #f4f7ff;
}

.subscriptions-subtitle {
  color: #8f9bad;
  font-size: 13px;
}

.subscriptions-icon-btn {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.08);
  color: #76d8ff;
  background: rgba(255,255,255,0.04);
  text-decoration: none;
  font-size: 20px;
}

.subscription-name {
  font-size: clamp(28px, 7vw, 46px);
  font-weight: 800;
  color: #f7faff;
  margin-bottom: 8px;
}

.subscription-expiry {
  margin-top: 6px;
  color: #9ba7b7;
  font-size: 15px;
}

.subscription-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.subscription-chip {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(123, 207, 255, 0.08);
  border: 1px solid rgba(123, 207, 255, 0.16);
  color: #9ad9ff;
  font-size: 12px;
}

.subscriptions-layout {
  display: grid;
  gap: 14px;
}

.subscriptions-actions {
  display: grid;
  gap: 10px;
}

.subscriptions-action-row {
  display: flex;
  gap: 10px;
  align-items: end;
}

.subscriptions-client-actions {
  display: flex;
  gap: 10px;
  flex: 0 0 auto;
}

.subscriptions-select-wrap {
  display: grid;
  gap: 8px;
  flex: 1 1 auto;
}

.subscriptions-select-title {
  color: #9ba7b7;
  font-size: 13px;
}

.subscriptions-select {
  width: 100%;
  min-height: 44px;
  padding: 0 16px;
  border-radius: 16px;
  border: 1px solid rgba(123, 207, 255, 0.20);
  background: linear-gradient(180deg, rgba(18, 23, 31, 0.98), rgba(12, 16, 22, 0.98));
  color: #edf4fb;
  font: inherit;
  outline: none;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.03);
}

.subscription-link-hint {
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.04);
  color: #c2d0de;
  font-size: 13px;
  word-break: break-word;
}

.subscription-client-note {
  margin-top: 10px;
  color: #8f9bad;
  font-size: 12px;
  line-height: 1.5;
}

.subscriptions-info-card {
  display: grid;
  gap: 12px;
}

.subscription-info-grid {
  display: grid;
  gap: 10px;
}

.subscription-info-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.subscription-info-label {
  color: #7bcfff;
  font-size: 13px;
  font-weight: 700;
}

.subscription-info-value {
  text-align: right;
  color: #edf4fb;
  font-size: 14px;
  word-break: break-word;
}

.subscriptions-card {
  padding: 20px;
  border-radius: 24px;
  background: rgba(10, 13, 19, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.05);
  box-shadow: 0 18px 38px rgba(0, 0, 0, 0.18);
}

.subscriptions-kicker {
  margin-bottom: 10px;
  color: #7bcfff;
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-family: "Space Grotesk", sans-serif;
}

.subscription-content {
  display: grid;
  gap: 12px;
  color: #d5e2f0;
}

.subscription-empty,
.subscription-loading,
.subscription-raw {
  margin: 0;
  padding: 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  color: #d5e2f0;
  line-height: 1.6;
  overflow: auto;
}

.subscription-raw {
  white-space: pre-wrap;
  word-break: break-word;
}

.subscription-link-card,
.subscription-note-card {
  display: grid;
  gap: 10px;
  padding: 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.subscription-link-card--muted {
  background: rgba(255, 255, 255, 0.025);
}

.subscription-link-label {
  font-family: "Space Grotesk", sans-serif;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #7bcfff;
}

.subscription-link-value {
  word-break: break-word;
  line-height: 1.6;
  color: #edf4fb;
  font-size: 14px;
}

.subscription-link-copy {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 20px;
  border-radius: 999px;
  border: 0;
  font: inherit;
  font-weight: 800;
  background: linear-gradient(135deg, #31bfd0, #1693c4);
  color: white;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(20, 146, 184, 0.22);
}

.primary-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 20px;
  border-radius: 16px;
  border: 1px solid rgba(123, 207, 255, 0.18);
  font: inherit;
  font-weight: 800;
  background: linear-gradient(135deg, #31bfd0, #1693c4);
  color: white;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(20, 146, 184, 0.22);
}

.secondary-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 18px;
  border-radius: 16px;
  border: 1px solid rgba(123, 207, 255, 0.16);
  background: rgba(255, 255, 255, 0.03);
  color: #edf4fb;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

body[data-theme="dark"] .secondary-action {
  background: rgba(255, 255, 255, 0.04);
}

.subscription-note-list {
  display: grid;
  gap: 8px;
}

.subscription-note-item {
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.04);
  color: #d5e2f0;
}

@media (max-width: 920px) {
  .stat-grid, .faq-grid { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .page-shell { width: min(100% - 16px, 1180px); padding-top: 92px; }
  .hero { padding: 20px; border-radius: 24px; }
  .panel-header { padding: 18px 16px 0; flex-direction: column; align-items: flex-start; }
  .panel-body, .link-box, .plans-grid, .faq-grid, .admin-stats { padding: 16px; }
  .hero-badges, .cta-row { gap: 8px; }
  .nav-pill, .ghost-button, .primary-button { width: 100%; }
  .top-nav {
    top: 10px;
    width: calc(100% - 16px);
  }
  .top-nav-panel {
    padding: 0 8px 8px;
  }
  .top-nav-panel.is-open {
    padding: 8px;
  }

  .subscriptions-page .page-shell {
    width: min(100% - 16px, 520px);
    padding-top: 12px;
  }

  .subscriptions-topbar {
    padding: 14px 16px;
    margin-bottom: 18px;
  }

  .subscriptions-card {
    padding: 16px;
    border-radius: 20px;
  }

  .subscriptions-action-row {
    flex-direction: column;
    align-items: stretch;
  }

  .subscriptions-client-actions {
    width: 100%;
  }

  .subscriptions-client-actions > button {
    flex: 1 1 0;
  }

  .subscription-info-row {
    flex-direction: column;
    gap: 6px;
  }

  .subscription-info-value {
    text-align: left;
  }
}
