:root {
  --bg-deep: #0a192f;
  --bg-deeper: #050d1f;
  --gold: #c9a050;
  --blue-accent: #1e3a8a;
  --navy: #0b1f4a;
  --navy-soft: #1e3a8a;
  --navy-bright: #6b8cff;
  --accent: #3b6bff;
  --cyan: #1fd5b6;
  --panel: #112240;
  --panel-glass: rgba(10, 25, 47, 0.62);
  --text: #e6f1ff;
  --muted: #8892b0;
  --sidebar-w: 272px;
  --topbar-h: 96px;
  --dashboard-footer-h: 48px;
}

/* Scrollbar azul global (paginas + modais) */
* {
  scrollbar-width: thin;
  scrollbar-color: #3b6bff #071327;
}

*::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

*::-webkit-scrollbar-track {
  background: linear-gradient(180deg, #061125, #071327);
  border-radius: 999px;
}

*::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #4c8cff, #2b59d1);
  border-radius: 999px;
  border: 2px solid #071327;
}

*::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #6aa6ff, #3b6bff);
}

* {
  box-sizing: border-box;
}

html.dashboard-html {
  height: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  background:
    linear-gradient(rgba(76, 134, 184, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(76, 134, 184, 0.07) 1px, transparent 1px),
    radial-gradient(circle at 12% 18%, rgba(31, 213, 182, 0.12), transparent 30%),
    radial-gradient(circle at 82% 8%, rgba(43, 89, 136, 0.36), transparent 34%),
    radial-gradient(circle at 50% 100%, rgba(40, 117, 183, 0.22), transparent 48%),
    linear-gradient(140deg, #071327 0%, #040a19 100%);
  background-size: 52px 52px, 52px 52px, auto, auto, auto, auto;
  color: var(--text);
  line-height: 1.5;
  overflow-x: hidden;
}

body.auth-page {
  overflow: hidden;
}

body.dashboard-page {
  --topbar-h: 104px;
  --dashboard-footer-h: 62px;
  --dashboard-tagline-h: 0px;
  --dashboard-bottom-stack-h: var(--dashboard-footer-h);
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 100vh;
  max-height: 100vh;
  overflow: hidden;
  background:
    linear-gradient(rgba(30, 58, 138, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(30, 58, 138, 0.055) 1px, transparent 1px),
    radial-gradient(circle at 18% 12%, rgba(59, 107, 255, 0.09), transparent 42%),
    radial-gradient(circle at 88% 0%, rgba(30, 58, 138, 0.2), transparent 38%),
    linear-gradient(165deg, #050a14 0%, #02050c 100%);
  background-size: 44px 44px, 44px 44px, auto, auto, auto;
}

@supports (height: 100dvh) {
  body.dashboard-page {
    min-height: 100dvh;
    max-height: 100dvh;
  }
}

.dashboard-shell {
  display: flex;
  flex: 1;
  flex-direction: row;
  width: 100%;
  min-width: 0;
  min-height: 0;
  margin: 0;
  padding: 0;
  overflow: hidden;
}

.page-wrap {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
  position: relative;
}

body.auth-page .page-wrap {
  min-height: calc(100vh - 72px);
  padding-top: 1.2rem;
  padding-bottom: 0.6rem;
}

.page-wrap::before {
  content: "";
  position: absolute;
  width: min(60vw, 760px);
  height: min(60vw, 760px);
  background: radial-gradient(circle, rgba(31, 213, 182, 0.15), transparent 65%);
  filter: blur(12px);
  top: -20%;
  left: -10%;
  pointer-events: none;
}

.page-wrap::after {
  content: "";
  position: absolute;
  width: min(60vw, 780px);
  height: min(60vw, 780px);
  background: radial-gradient(circle, rgba(201, 160, 80, 0.12), transparent 65%);
  filter: blur(20px);
  bottom: -26%;
  right: -12%;
  pointer-events: none;
}

.brand {
  text-align: center;
  margin-bottom: 1.4rem;
  position: relative;
  z-index: 1;
}

/* Vai-e-volta leve no wrapper: não usa transform na <img> (evita conflito com scale no login/cadastro) */
@keyframes nemesis-logo-sway {
  0%,
  100% {
    transform: translateX(-4px);
  }
  50% {
    transform: translateX(4px);
  }
}

.brand-logo {
  display: block;
  margin: 0 auto;
  max-width: min(300px, 90vw);
  width: auto;
  height: auto;
  max-height: clamp(2.6rem, 11vw, 4.35rem);
  object-fit: contain;
  filter: drop-shadow(0 4px 16px rgba(8, 23, 45, 0.42));
}

body.auth-page .brand {
  animation: nemesis-logo-sway 2.85s ease-in-out infinite;
}

/* Login (index.php): logo maior; PNG pode ter muito alpha — scale ajuda o desenho útil */
body.auth-login .brand-logo {
  max-width: min(560px, 92vw);
  max-height: clamp(4.75rem, 26vw, 8.5rem);
  transform: scale(1.12);
  transform-origin: center center;
}

body.auth-login .brand {
  margin-bottom: 1.55rem;
}

/* Cadastro: logo um pouco maior que o padrão, menos que o login */
body.auth-cadastro .brand-logo {
  max-width: min(440px, 90vw);
  max-height: clamp(3.65rem, 17vw, 6.25rem);
  transform: scale(1.07);
  transform-origin: center center;
}

body.auth-cadastro .brand {
  margin-bottom: 1.48rem;
}

.brand::before {
  content: "";
  position: absolute;
  width: 220px;
  height: 220px;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(55, 131, 183, 0.16), rgba(31, 213, 182, 0.05) 52%, transparent 72%);
  filter: blur(22px);
  pointer-events: none;
}

.brand.compact {
  margin-bottom: 1rem;
}

.brand-title {
  font-family: "Segoe UI", system-ui, sans-serif;
  font-size: clamp(2.3rem, 5vw, 3.3rem);
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  background: linear-gradient(90deg, #f2d292 0%, #dcb566 38%, #c99b4e 62%, #f0d79c 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin: 0;
  text-shadow:
    0 0 10px rgba(214, 167, 78, 0.22),
    0 0 24px rgba(183, 134, 45, 0.18),
    0 0 42px rgba(201, 160, 80, 0.08);
  filter: drop-shadow(0 6px 14px rgba(8, 23, 45, 0.38));
  background-size: 220% 220%;
  animation: titleGlow 5.5s ease-in-out infinite;
}

.brand-sub {
  font-size: clamp(0.86rem, 1.5vw, 1.02rem);
  font-weight: 600;
  letter-spacing: 0.5em;
  text-transform: uppercase;
  color: #9ad3ff;
  margin-top: 0.28rem;
  opacity: 0.96;
  text-shadow: 0 0 8px rgba(69, 154, 220, 0.2);
  position: relative;
  display: inline-block;
  padding: 0 0.45rem;
}

.brand-sub::before,
.brand-sub::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 44px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(126, 206, 255, 0.8), transparent);
}

.brand-sub::before {
  right: 100%;
  margin-right: 0.35rem;
}

.brand-sub::after {
  left: 100%;
  margin-left: 0.35rem;
}

.card {
  width: 100%;
  max-width: 450px;
  background: linear-gradient(180deg, rgba(15, 38, 70, 0.86), rgba(5, 18, 39, 0.9));
  border: 1px solid rgba(91, 154, 204, 0.32);
  border-radius: 16px;
  padding: 1.55rem;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 26px 60px rgba(0, 0, 0, 0.52),
    0 0 0 1px rgba(31, 213, 182, 0.08);
  backdrop-filter: blur(8px);
  position: relative;
  z-index: 1;
  overflow: hidden;
}

.card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 16px;
  padding: 1px;
  background: linear-gradient(145deg, rgba(120, 205, 255, 0.65), rgba(31, 213, 182, 0.25), rgba(201, 160, 80, 0.35));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

.card::after {
  content: "";
  position: absolute;
  width: 220px;
  height: 120px;
  right: -80px;
  top: -30px;
  background: radial-gradient(circle, rgba(110, 196, 255, 0.32), transparent 70%);
  filter: blur(6px);
  pointer-events: none;
}

.card-wide {
  max-width: 1100px;
}

label {
  display: block;
  font-size: 0.72rem;
  color: var(--muted);
  margin-bottom: 0.38rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.field {
  position: relative;
}

.field-icon {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.78rem;
  color: rgba(159, 201, 236, 0.75);
  pointer-events: none;
}

.password-field input[type="password"],
.password-field input[type="text"] {
  padding-right: 2.7rem;
  margin-bottom: 0.9rem;
}

.toggle-password {
  position: absolute;
  right: 0.55rem;
  top: 50%;
  transform: translateY(calc(-50% - 0.45rem));
  width: 30px;
  height: 30px;
  border: 1px solid rgba(85, 150, 199, 0.5);
  border-radius: 7px;
  background: rgba(11, 31, 58, 0.9);
  color: #9fd6ff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: border-color 0.2s ease, filter 0.2s ease, transform 0.15s ease;
}

.toggle-password:hover {
  border-color: rgba(126, 205, 255, 0.8);
  filter: brightness(1.08);
}

.toggle-password:active {
  transform: translateY(-50%) scale(0.96);
}

.toggle-password svg {
  width: 14px;
  height: 14px;
}

input[type="text"],
input[type="password"] {
  width: 100%;
  padding: 0.82rem 1rem 0.82rem 2.25rem;
  margin-bottom: 1rem;
  border: 1px solid rgba(68, 136, 184, 0.45);
  border-radius: 9px;
  background: linear-gradient(180deg, rgba(8, 21, 44, 0.85), rgba(9, 26, 50, 0.75));
  color: var(--text);
  font-size: 0.95rem;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.15s;
}

.admin-select {
  width: 100%;
  padding: 0.82rem 1rem 0.82rem 2.25rem;
  margin-bottom: 1rem;
  border: 1px solid rgba(68, 136, 184, 0.45);
  border-radius: 9px;
  background: linear-gradient(180deg, rgba(8, 21, 44, 0.95), rgba(9, 26, 50, 0.9));
  color: var(--text);
}

input:focus {
  outline: none;
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px rgba(31, 213, 182, 0.15), 0 0 24px rgba(31, 213, 182, 0.18);
  transform: translateY(-1px);
}

.btn {
  display: inline-block;
  width: 100%;
  padding: 0.88rem 1.25rem;
  border: none;
  border-radius: 9px;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  letter-spacing: 0.02em;
  transition: transform 0.15s ease, box-shadow 0.2s ease, filter 0.2s ease;
  position: relative;
  overflow: hidden;
}

.btn:active {
  transform: scale(0.98);
}

.btn-gold {
  background: linear-gradient(180deg, #d9b86f, #b18a40);
  color: #081631;
}

.btn-gold:hover {
  box-shadow: 0 14px 28px rgba(201, 160, 80, 0.3);
  filter: brightness(1.04);
}

.btn-outline {
  background: transparent;
  color: var(--gold);
  border: 2px solid var(--gold);
}

.btn-outline:hover {
  background: rgba(201, 160, 80, 0.12);
}

.btn-blue {
  background: linear-gradient(180deg, #2d6fa8, #214a74);
  color: var(--text);
}

.btn-blue:hover {
  box-shadow: 0 14px 28px rgba(43, 89, 136, 0.42);
  filter: brightness(1.06);
}

.btn::before {
  content: "";
  position: absolute;
  top: 0;
  left: -35%;
  width: 30%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.28), transparent);
  transform: skewX(-18deg);
  transition: left 0.45s ease;
}

.btn:hover::before {
  left: 120%;
}

.links-row {
  text-align: center;
  margin-top: 1rem;
  font-size: 0.84rem;
  color: var(--muted);
  display: flex;
  justify-content: center;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.links-row a {
  color: #c9f8ee;
  text-decoration: none;
  padding: 0.48rem 0.82rem;
  border: 1px solid rgba(77, 159, 212, 0.45);
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(19, 60, 103, 0.8), rgba(10, 34, 63, 0.78));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 8px 18px rgba(0, 0, 0, 0.2);
  transition: transform 0.15s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.links-row a:first-child {
  border-color: rgba(86, 183, 245, 0.62);
  background: linear-gradient(180deg, rgba(26, 96, 154, 0.88), rgba(13, 50, 89, 0.88));
}

.links-row a:last-child {
  border-color: rgba(201, 160, 80, 0.62);
  background: linear-gradient(180deg, rgba(107, 86, 44, 0.85), rgba(80, 62, 27, 0.85));
}

.links-row a:hover {
  border-color: rgba(31, 213, 182, 0.72);
  box-shadow: 0 10px 22px rgba(31, 213, 182, 0.2);
  transform: translateY(-1px);
}

.links-row .buy-key-btn {
  padding: 0.62rem 1.2rem;
  border: 1px solid rgba(224, 186, 104, 0.72);
  background: linear-gradient(180deg, rgba(95, 73, 30, 0.95), rgba(63, 47, 18, 0.95));
  color: #f5e2b2;
  font-weight: 700;
  letter-spacing: 0.02em;
  box-shadow:
    inset 0 1px 0 rgba(255, 231, 179, 0.25),
    0 10px 22px rgba(0, 0, 0, 0.26);
}

.links-row .buy-key-btn:hover {
  border-color: rgba(255, 214, 124, 0.92);
  box-shadow:
    inset 0 1px 0 rgba(255, 231, 179, 0.32),
    0 12px 26px rgba(201, 160, 80, 0.3);
  filter: brightness(1.06);
}

.remember-row {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0.1rem 0 0.9rem;
  color: #a4c4df;
  font-size: 0.84rem;
}

.remember-row input[type="checkbox"] {
  accent-color: #58b1f7;
  width: 15px;
  height: 15px;
}

.turnstile-wrap {
  display: flex;
  justify-content: center;
  margin-top: 0.85rem;
  min-height: 65px;
}

.signup-block {
  text-align: center;
  margin-top: 1rem;
  color: var(--muted);
  font-size: 0.88rem;
}

.signup-block p {
  margin: 0 0 0.6rem;
}

.signup-block .btn {
  max-width: 190px;
}

.inline-login-link {
  color: #8fd6ff;
  text-decoration: none;
  font-weight: 700;
}

.inline-login-link:hover {
  color: #b6e5ff;
  text-decoration: underline;
}

.alert {
  padding: 0.75rem 1rem;
  border-radius: 8px;
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

.alert-error {
  background: rgba(220, 53, 69, 0.15);
  border: 1px solid rgba(220, 53, 69, 0.45);
  color: #ffb4bc;
}

.alert-success {
  background: rgba(40, 167, 69, 0.12);
  border: 1px solid rgba(40, 167, 69, 0.4);
  color: #9ee6b0;
}

/* Dashboard / comprar top bar */
.topbar {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 0.22rem;
  padding: calc(1.05rem + env(safe-area-inset-top, 0px)) 1.25rem 0.55rem;
  background: linear-gradient(180deg, rgba(8, 18, 42, 0.96), rgba(4, 10, 26, 0.94));
  border-bottom: 1px solid rgba(30, 58, 138, 0.35);
  backdrop-filter: blur(10px);
  position: relative;
  overflow: visible;
  z-index: 40;
  min-height: var(--topbar-h);
  flex-shrink: 0;
}

.topbar::after {
  content: "";
  position: absolute;
  top: 0;
  left: -30%;
  width: 30%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(130, 208, 255, 0.16), transparent);
  animation: topbarSweep 6.5s linear infinite;
  pointer-events: none;
  z-index: 0;
}

.topbar-brand {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.65rem;
  text-decoration: none;
  color: inherit;
  position: relative;
  z-index: 1;
}

.topbar-center-title {
  margin: 0.12rem auto 0;
  font-weight: 800;
  font-size: 1.22rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #d6e4ff;
  text-shadow: 0 0 18px rgba(59, 107, 255, 0.22);
  position: relative;
  z-index: 1;
}

.topbar-logo-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
}

.topbar-logo {
  display: block;
  width: auto;
  height: auto;
  max-width: min(320px, 85vw);
  object-fit: contain;
  filter: drop-shadow(0 2px 12px rgba(8, 23, 45, 0.45));
}

.topbar-logo-wrap.topbar-center-title {
  font-size: 0;
  letter-spacing: 0;
  text-transform: none;
  text-shadow: none;
}

/* Dashboard: topbar compacta + logo à esquerda */
body.dashboard-page .topbar {
  flex-direction: row;
  justify-content: flex-start;
  align-items: center;
  gap: 0;
  padding: calc(0.78rem + env(safe-area-inset-top, 0px)) 1rem 0.32rem max(1rem, env(safe-area-inset-left, 0px));
}

body.dashboard-page .topbar-logo-wrap {
  justify-content: flex-start;
}

body.dashboard-page .topbar-logo-wrap.topbar-center-title {
  margin: 0;
  margin-right: auto;
  align-self: center;
  animation: nemesis-logo-sway 2.85s ease-in-out infinite;
}

body.dashboard-page .topbar-logo {
  max-height: calc(var(--topbar-h) - 0.88rem);
  max-width: min(520px, 50vw);
  width: auto;
}

@media (prefers-reduced-motion: reduce) {
  body.auth-page .brand,
  body.dashboard-page .topbar-logo-wrap.topbar-center-title {
    animation: none;
  }
}

.topbar-subtitle {
  margin: 0 auto;
  color: var(--muted);
  font-weight: 600;
  font-size: 0.98rem;
  letter-spacing: 0.02em;
  position: relative;
  z-index: 1;
}

.topbar-title {
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-size: 0.98rem;
  color: #8fd6ff;
  text-shadow: 0 0 18px rgba(93, 172, 229, 0.32);
}

.topbar-main {
  font-weight: 800;
  letter-spacing: 0.2em;
  color: #d6e4ff;
  line-height: 1;
  font-size: 0.95rem;
}

.topbar-sub {
  font-weight: 700;
  letter-spacing: 0.34em;
  color: var(--muted);
  line-height: 1;
  font-size: 0.6rem;
  margin-top: -0.35rem;
}

.topbar nav a {
  color: var(--muted);
  text-decoration: none;
  margin-left: 1.25rem;
  font-size: 0.9rem;
  position: relative;
  z-index: 1;
}

.topbar nav a:hover,
.topbar nav a.active {
  color: var(--navy-bright);
}

.action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.35rem 0.78rem;
  border-radius: 999px;
  border: 1px solid rgba(84, 148, 196, 0.55);
  background: rgba(10, 34, 63, 0.82);
  color: #d4eeff !important;
  font-weight: 700;
}

.action-buy {
  border-color: rgba(201, 160, 80, 0.72);
  background: linear-gradient(180deg, rgba(107, 86, 44, 0.95), rgba(80, 62, 27, 0.95));
  color: #f5e2b2 !important;
}

.action-logout {
  border-color: rgba(76, 164, 226, 0.68);
  background: linear-gradient(180deg, rgba(33, 100, 154, 0.9), rgba(16, 60, 101, 0.9));
}

.key-menu {
  position: relative;
  display: inline-block;
}

.key-menu-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  min-width: 190px;
  background: linear-gradient(180deg, rgba(10, 31, 57, 0.97), rgba(5, 19, 39, 0.98));
  border: 1px solid rgba(93, 165, 218, 0.55);
  border-radius: 12px;
  box-shadow: 0 16px 30px rgba(0, 0, 0, 0.42);
  padding: 0.4rem;
  display: none;
  z-index: 30;
}

.key-menu-panel.open {
  display: block;
}

.key-menu-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.6rem 0.75rem;
  margin-left: 0 !important;
  border: 0;
  color: #d8eeff;
  font-weight: 600;
  background: rgba(15, 45, 77, 0.55);
  text-decoration: none;
  border-radius: 8px;
  cursor: pointer;
  margin-bottom: 0.28rem;
}

.key-menu-item:hover {
  background: rgba(61, 137, 196, 0.28);
}

.key-menu-item:last-child {
  margin-bottom: 0;
}

.dashboard-main {
  max-width: 1100px;
  margin: 0;
  padding: 2.25rem 1.25rem;
  position: relative;
  z-index: 1;
  flex: 1;
}

.dashboard-shell .dashboard-main {
  max-width: none;
  flex: 1;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 0.85rem 1.15rem calc(var(--dashboard-footer-h) + 0.85rem);
  margin-left: var(--sidebar-w);
}

body.dashboard-page .dashboard-shell .dashboard-main {
  overflow-y: auto;
  overflow-x: hidden;
  padding-bottom: calc(var(--dashboard-bottom-stack-h) + 1.25rem);
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 200, 255, 0.35) rgba(4, 8, 18, 0.6);
}

.dashboard-shell .dashboard-main > .alert {
  flex-shrink: 0;
}

.sidebar-menu {
  position: fixed;
  left: 0;
  top: var(--topbar-h);
  bottom: var(--dashboard-footer-h);
  width: var(--sidebar-w);
  background: linear-gradient(180deg, rgba(5, 12, 28, 0.98), rgba(3, 8, 20, 0.98));
  border-right: 1px solid rgba(30, 58, 138, 0.45);
  border-radius: 0;
  padding: 0.75rem 0.65rem;
  overflow-y: auto;
  box-shadow: inset -1px 0 0 rgba(59, 107, 255, 0.06), 8px 0 24px rgba(0, 0, 0, 0.35);
  z-index: 20;
}

body.dashboard-page .sidebar-menu {
  bottom: var(--dashboard-bottom-stack-h);
}

.sidebar-title {
  margin: 0 0 0.65rem;
  font-size: 0.78rem;
  color: var(--muted);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  opacity: 0.92;
}

.sidebar-link-start {
  display: inline-flex;
  align-items: center;
  gap: 0.62rem;
  min-width: 0;
}

.sidebar-svg {
  width: 1.35rem;
  height: 1.35rem;
  flex-shrink: 0;
  color: var(--navy-bright);
}

.sidebar-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  text-decoration: none;
  text-align: left;
  padding: 0.58rem 0.65rem;
  border-radius: 9px;
  border: 1px solid rgba(30, 58, 138, 0.35);
  background: rgba(8, 18, 42, 0.72);
  color: #d8e4ff;
  margin-bottom: 0.42rem;
  font-weight: 600;
  font-size: 0.95rem;
  box-shadow: none;
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.15s ease;
}

button.sidebar-link {
  font: inherit;
  cursor: pointer;
  appearance: none;
}

.sidebar-link:hover {
  border-color: rgba(59, 107, 255, 0.55);
  background: rgba(30, 58, 138, 0.22);
  transform: translateX(1px);
  box-shadow: none;
}

.sidebar-link:hover .sidebar-svg {
  color: #9eb6ff;
}

.sidebar-item .sidebar-link {
  margin-bottom: 0.35rem;
}

.sidebar-submenu {
  display: none;
  padding-left: 0.1rem;
}

.sidebar-submenu.open {
  display: block;
}

.sidebar-sublink {
  display: block;
  width: 100%;
  text-decoration: none;
  text-align: left;
  padding: 0.48rem 0.58rem;
  border-radius: 8px;
  border: 1px solid rgba(30, 58, 138, 0.28);
  background: rgba(6, 14, 32, 0.65);
  color: #d0dcff;
  margin-bottom: 0.32rem;
  font-weight: 600;
  font-size: 0.86rem;
}

.sidebar-sublink:hover {
  background: rgba(30, 58, 138, 0.28);
}

.sidebar-logout {
  margin-top: 0.35rem;
}

.sidebar-user-box {
  margin-top: 0.2rem;
  margin-bottom: 0.65rem;
  border: 1px solid rgba(30, 58, 138, 0.42);
  border-radius: 10px;
  background: rgba(6, 14, 32, 0.88);
  padding: 0.62rem 0.62rem;
  font-size: 0.88rem;
  color: #c8d6f5;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.sidebar-user-row {
  display: flex;
  align-items: flex-start;
  gap: 0.42rem;
  margin: 0.2rem 0;
}

.sidebar-user-row:first-child {
  margin-top: 0;
}

.sidebar-user-icon {
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
  object-fit: contain;
  margin-top: 0.12rem;
  opacity: 0.95;
}

.sidebar-user-text {
  flex: 1;
  min-width: 0;
  line-height: 1.35;
}

.menu-caret {
  font-size: 0.9rem;
  opacity: 0.85;
}

.sidebar-activate-box {
  display: none;
  border: 1px solid rgba(30, 58, 138, 0.42);
  border-radius: 9px;
  background: rgba(5, 12, 28, 0.92);
  padding: 0.48rem;
  margin: 0.35rem 0 0.5rem;
}

.sidebar-activate-box.open {
  display: block;
}

.sidebar-activate-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.45rem;
}

.grid-modules {
  display: grid;
  grid-template-columns: repeat(4, minmax(140px, 1fr));
  gap: 0.65rem;
  margin-top: 1rem;
  width: min(920px, 100%);
  max-width: 920px;
  margin-left: auto;
  margin-right: auto;
  justify-content: center;
}

.dashboard-page .grid-modules {
  width: 100%;
  max-width: none;
  margin: 0.45rem 0 0;
  align-self: stretch;
  align-content: start;
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  grid-auto-rows: auto;
  gap: 0.62rem;
}

.dashboard-page .grid-tools {
  flex: none;
  margin-bottom: 0;
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  width: 100%;
}

.module-tile {
  background: rgba(6, 14, 32, 0.82);
  border: 1px solid rgba(30, 58, 138, 0.38);
  border-radius: 11px;
  padding: 0.62rem 0.55rem 0.68rem;
  text-align: center;
  color: var(--text);
  text-decoration: none;
  transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
  animation: tileIn 0.45s ease both;
  position: relative;
  overflow: hidden;
}

.dashboard-page .module-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 0;
  padding: 0.52rem 0.45rem 0.58rem;
  border-radius: 11px;
}

.module-tile::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 12% 0%, rgba(59, 107, 255, 0.12), transparent 48%);
  pointer-events: none;
}

.module-tile:hover {
  border-color: rgba(59, 107, 255, 0.65);
  transform: translateY(-2px);
  box-shadow: 0 10px 22px rgba(11, 31, 74, 0.35);
}

.grid-modules .module-tile:nth-child(1) { animation-delay: 0.28s, 1.2s; }
.grid-modules .module-tile:nth-child(2) { animation-delay: 0.34s, 1.3s; }
.grid-modules .module-tile:nth-child(3) { animation-delay: 0.40s, 1.4s; }
.grid-modules .module-tile:nth-child(4) { animation-delay: 0.46s, 1.5s; }
.grid-modules .module-tile:nth-child(5) { animation-delay: 0.52s, 1.6s; }
.grid-modules .module-tile:nth-child(6) { animation-delay: 0.58s, 1.7s; }
.grid-modules .module-tile:nth-child(7) { animation-delay: 0.64s, 1.8s; }
.grid-modules .module-tile:nth-child(8) { animation-delay: 0.70s, 1.9s; }

.module-tile span {
  display: block;
  font-size: 0.68rem;
  color: var(--muted);
  margin-top: 0.22rem;
}

.dashboard-page .module-tile span {
  font-size: 0.78rem;
  margin-top: 0.28rem;
  line-height: 1.28;
}

.module-icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  margin-bottom: 0.28rem;
  font-size: 1.45rem;
  line-height: 1;
  filter: drop-shadow(0 3px 8px rgba(59, 107, 255, 0.22));
}

.module-icon-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  pointer-events: none;
}

.dashboard-page .module-icon {
  width: 4.1rem;
  height: 4.1rem;
  margin-bottom: 0.32rem;
  font-size: 2.85rem;
}

.module-status {
  position: absolute;
  top: 0.32rem;
  right: 0.42rem;
  font-size: 0.62rem;
  color: #8df1be;
  display: inline-flex;
  align-items: center;
  gap: 0.22rem;
}

.dashboard-page .module-status {
  top: 0.38rem;
  right: 0.45rem;
  font-size: 0.68rem;
  gap: 0.26rem;
}

.online-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: #49e08b;
  box-shadow: 0 0 10px rgba(73, 224, 139, 0.65);
}

.section-title {
  font-family: Georgia, serif;
  color: var(--gold);
  font-size: 1.5rem;
  margin: 0 0 0.5rem;
}

.section-title.center {
  text-align: center;
}

.page-subtitle {
  text-align: center;
  color: var(--muted);
  max-width: 620px;
  margin: 0 auto;
  font-size: 0.95rem;
}

.page-subtitle-left {
  text-align: left;
  margin: 0;
  max-width: none;
}

.meta-box {
  background: rgba(9, 28, 53, 0.62);
  border: 1px solid rgba(61, 132, 181, 0.28);
  border-radius: 10px;
  padding: 1rem;
  margin-top: 1rem;
  font-size: 0.9rem;
  color: var(--muted);
}

.meta-wrap {
  text-align: center;
  animation: softUp 0.55s ease both;
  animation-delay: 0.08s;
}

.meta-center {
  text-align: center;
  font-size: 0.95rem;
  color: #c4dbef;
  display: inline-block;
  width: auto;
  max-width: 380px;
  min-width: 0;
  padding: 0.7rem 0.95rem;
}

.meta-center div {
  margin: 0.2rem 0;
}

.dashboard-tagline {
  text-align: center;
  margin: 0.7rem 0 1rem;
  color: #9ed7ff;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-shadow: 0 0 16px rgba(93, 172, 229, 0.22);
  animation: softUp 0.55s ease both;
  animation-delay: 0.2s;
}

.key-activate-popover {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  width: 310px;
  background: linear-gradient(180deg, rgba(11, 31, 57, 0.98), rgba(7, 21, 41, 0.98));
  border: 1px solid rgba(96, 171, 227, 0.55);
  border-radius: 12px;
  box-shadow: 0 16px 30px rgba(0, 0, 0, 0.45);
  padding: 0.9rem;
  display: none;
  z-index: 35;
}

.key-activate-popover.open {
  display: block;
}

.key-activate-popover h3 {
  margin: 0 0 0.55rem;
  font-size: 1rem;
  color: #d9eeff;
}

.key-activate-popover .btn {
  margin-top: 0.15rem;
}

.popover-close {
  position: absolute;
  right: 0.5rem;
  top: 0.45rem;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  border: 1px solid rgba(112, 176, 226, 0.5);
  background: rgba(15, 45, 77, 0.9);
  color: #d3ecff;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
}

.status-active {
  color: #74f2a8;
  font-weight: 700;
}

.status-expired {
  color: #ff8f95;
  font-weight: 700;
}

/* Pricing */
.plans-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

.plan-card {
  background: linear-gradient(180deg, rgba(16, 39, 69, 0.88), rgba(8, 24, 45, 0.92));
  border-radius: 14px;
  padding: 1.5rem;
  border: 1px solid rgba(55, 125, 177, 0.58);
  display: flex;
  flex-direction: column;
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.28);
}

.plan-card.featured {
  border-color: var(--gold);
  box-shadow: 0 0 0 1px rgba(201, 160, 80, 0.2), 0 16px 40px rgba(0, 0, 0, 0.35);
}

.plan-card h3 {
  margin: 0 0 0.25rem;
  font-size: 1.1rem;
  color: var(--text);
}

.plan-price {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--gold);
  margin: 0.5rem 0;
}

.plan-badge {
  display: inline-block;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  background: rgba(31, 213, 182, 0.18);
  color: #81f6e4;
  margin-bottom: 0.75rem;
}

.plan-modules {
  list-style: none;
  padding: 0;
  margin: 1rem 0;
  flex-grow: 1;
  color: var(--muted);
  font-size: 0.9rem;
}

.plan-modules li {
  padding: 0.35rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.plan-modules li:last-child {
  border-bottom: none;
}

.auth-card-title {
  margin: 0 0 0.3rem;
  text-align: center;
  font-size: 1.35rem;
  font-weight: 700;
}

.auth-card-subtitle {
  margin: 0 0 1.25rem;
  text-align: center;
  font-size: 0.82rem;
  color: var(--muted);
}

.user-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  border: 1px solid rgba(65, 130, 175, 0.45);
  background: rgba(9, 27, 51, 0.75);
  border-radius: 999px;
  padding: 0.32rem 0.68rem;
  color: #9bc8ec;
  font-size: 0.74rem;
}

.alert-center {
  max-width: 800px;
  margin: 1rem auto 0;
}

.key-value {
  color: var(--gold);
  letter-spacing: 0.05em;
}

.key-link {
  color: var(--cyan);
}

.plan-note {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.plan-strong {
  color: var(--text);
}

.module-label {
  font-size: 0.82rem;
  color: #d6e4ff;
  letter-spacing: 0.03em;
  font-weight: 700;
}

.dashboard-page .module-label {
  font-size: 0.92rem;
  letter-spacing: 0.03em;
  line-height: 1.2;
}

.dashboard-page .online-dot {
  width: 7px;
  height: 7px;
}

body.dashboard-page .dashboard-bottom-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 26;
  pointer-events: none;
}

body.dashboard-page .dashboard-bottom-bar .dashboard-footer-bar {
  pointer-events: auto;
}

body.dashboard-page .dashboard-footer-bar {
  margin-top: 0;
  min-height: var(--dashboard-footer-h);
  padding: 0.45rem 1rem 0.55rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, rgba(7, 19, 39, 0.92), rgba(6, 16, 33, 0.98));
  backdrop-filter: blur(8px);
  border-top: 1px solid rgba(30, 58, 138, 0.42);
}

body.dashboard-page .dashboard-footer-stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.18rem;
  text-align: center;
}

body.dashboard-page .dashboard-footer-tagline {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: #9eb6d8;
  line-height: 1.25;
}

body.dashboard-page .dashboard-footer-copy-row {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
}

body.dashboard-page .dashboard-footer-copy {
  white-space: nowrap;
  color: #a8bce6;
  font-size: 0.74rem;
  letter-spacing: 0.04em;
}

body.dashboard-page .dashboard-bottom-bar .site-footer {
  position: relative;
  left: auto;
  right: auto;
  bottom: auto;
  margin-top: 0;
  flex-shrink: 0;
  background: linear-gradient(180deg, rgba(7, 19, 39, 0.35), rgba(6, 16, 33, 0.78));
  backdrop-filter: blur(6px);
}

@media (max-width: 900px) {
  body.dashboard-page {
    --dashboard-footer-h: 68px;
  }

  body.dashboard-page .dashboard-footer-tagline {
    font-size: 0.72rem;
    white-space: normal;
    max-width: min(92vw, 520px);
  }
}

.admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.plan-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 0.75rem;
  margin-top: 0.25rem;
}

.plan-actions .btn {
  width: 100%;
}

.table-wrap {
  overflow: auto;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.admin-table th,
.admin-table td {
  text-align: left;
  padding: 0.45rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  vertical-align: middle;
}

.admin-table th {
  color: #8fd6ff;
  font-weight: 600;
}

.btn-delete-key {
  border: 1px solid rgba(233, 101, 115, 0.6);
  background: linear-gradient(180deg, rgba(137, 42, 51, 0.9), rgba(95, 28, 35, 0.9));
  color: #ffd0d5;
  border-radius: 7px;
  padding: 0.3rem 0.6rem;
  font-size: 0.78rem;
  cursor: pointer;
}

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

.admin-tg-card code {
  font-size: 0.82em;
  color: #9ed7ff;
}

.admin-tg-status-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem 1rem;
  margin-bottom: 0.75rem;
}

.admin-tg-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.32rem 0.7rem;
  border-radius: 999px;
  border: 1px solid rgba(86, 173, 239, 0.45);
  background: rgba(10, 34, 63, 0.75);
  color: #d4eeff;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.admin-tg-badge[data-status="connected"] {
  border-color: rgba(52, 211, 153, 0.5);
  background: rgba(8, 40, 28, 0.75);
  color: #bbf7d0;
}

.admin-tg-user {
  color: #a8bce6;
  font-size: 0.86rem;
}

.admin-tg-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-bottom: 0.75rem;
}

.admin-tg-actions .btn {
  width: auto;
  min-width: 160px;
}

.admin-tg-qr-box {
  text-align: center;
  margin: 0.75rem 0;
  padding: 0.85rem;
  border: 1px dashed rgba(86, 173, 239, 0.4);
  border-radius: 10px;
  background: rgba(6, 16, 36, 0.55);
}

.admin-tg-qr-box img {
  display: block;
  margin: 0.5rem auto;
  border-radius: 8px;
  background: #fff;
  padding: 0.35rem;
}

.admin-tg-test-out {
  margin-top: 0.65rem;
  padding: 0.65rem 0.75rem;
  max-height: 220px;
  overflow: auto;
  border-radius: 8px;
  border: 1px solid rgba(68, 136, 184, 0.35);
  background: rgba(4, 12, 28, 0.85);
  color: #c8e8ff;
  font-size: 0.78rem;
  line-height: 1.4;
  white-space: pre-wrap;
  word-break: break-word;
}

.admin-tg-panel .query-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.55rem;
  align-items: center;
}

.admin-tg-panel input {
  width: 100%;
  padding: 0.72rem 0.85rem;
  margin-bottom: 0;
  border-radius: 8px;
  border: 1px solid rgba(68, 136, 184, 0.45);
  background: rgba(8, 21, 44, 0.9);
  color: var(--text);
}

.admin-tg-panel .btn {
  width: auto;
  white-space: nowrap;
}

.site-footer {
  width: 100%;
  margin-top: 2rem;
  padding: 0.65rem 1rem 0.75rem;
  border-top: 1px solid rgba(30, 58, 138, 0.32);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  color: #a8bce6;
  font-size: 0.76rem;
  letter-spacing: 0.04em;
}

.site-footer.fixed {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(180deg, rgba(7, 19, 39, 0.35), rgba(6, 16, 33, 0.78));
  backdrop-filter: blur(6px);
}

.page-wrap > .brand,
.page-wrap > .card,
.page-wrap > .site-footer,
.topbar,
.dashboard-main,
.site-footer {
  animation: pageRise 0.65s ease both;
}

.page-wrap > .card {
  animation-delay: 0.15s;
}

.page-wrap > .site-footer,
.site-footer {
  animation-delay: 0.26s;
}

.tg-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 1px solid rgba(86, 173, 239, 0.55);
  background: linear-gradient(180deg, rgba(29, 117, 181, 0.95), rgba(19, 81, 134, 0.95));
  color: #ecf7ff;
  text-decoration: none;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.24);
  transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
}

.tg-link:hover {
  transform: translateY(-2px);
  filter: brightness(1.08);
  box-shadow: 0 12px 24px rgba(41, 138, 212, 0.35);
}

.tg-link svg {
  width: 16px;
  height: 16px;
}

.page-loader {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 0.9rem;
  background: rgba(4, 12, 25, 0.72);
  backdrop-filter: blur(6px);
  z-index: 9999;
}

.page-loader.is-visible {
  display: flex;
}

.loader-ring {
  width: 56px;
  height: 56px;
  border-radius: 999px;
  border: 4px solid rgba(125, 194, 242, 0.24);
  border-top-color: #d3ab5c;
  animation: spin 0.9s linear infinite;
}

.loader-text {
  color: #d4e7f7;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.78rem;
}

@keyframes titleGlow {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

@keyframes pageRise {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.99);
    filter: blur(2px);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
  }
}

@keyframes topbarSweep {
  0% {
    left: -30%;
  }
  100% {
    left: 130%;
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes softUp {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes tileIn {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes tileFloat {
  0%, 100% {
    box-shadow: 0 8px 16px rgba(10, 30, 52, 0.2);
  }
  50% {
    box-shadow: 0 12px 22px rgba(18, 77, 122, 0.24);
  }
}
