/* Sub2API custom theme for sub.feige520.com */
:root {
  --feige-primary: #14b8a6;
  --feige-primary-dark: #0f766e;
  --feige-accent: #2563eb;
  --feige-purple: #8b5cf6;
  --feige-ink: #0f172a;
  --feige-muted: #64748b;
  --feige-card: rgba(255, 255, 255, 0.76);
  --feige-border: rgba(148, 163, 184, 0.22);
  --feige-shadow: 0 24px 70px rgba(15, 23, 42, 0.12);
  --feige-shadow-soft: 0 16px 38px rgba(15, 118, 110, 0.16);
}

html {
  scroll-behavior: smooth;
}

body {
  color: var(--feige-ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(circle at 12% 18%, rgba(20, 184, 166, 0.22), transparent 30%),
    radial-gradient(circle at 86% 10%, rgba(37, 99, 235, 0.16), transparent 28%),
    radial-gradient(circle at 82% 84%, rgba(139, 92, 246, 0.14), transparent 28%),
    linear-gradient(135deg, #f8fafc 0%, #eefcf9 42%, #f5f7ff 100%);
}

.dark body::before {
  background:
    radial-gradient(circle at 12% 18%, rgba(20, 184, 166, 0.18), transparent 34%),
    radial-gradient(circle at 86% 10%, rgba(37, 99, 235, 0.18), transparent 30%),
    radial-gradient(circle at 82% 84%, rgba(139, 92, 246, 0.16), transparent 30%),
    linear-gradient(135deg, #020617 0%, #071d22 52%, #0f172a 100%);
}

.bg-gradient-to-br {
  background:
    linear-gradient(rgba(20, 184, 166, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(20, 184, 166, 0.035) 1px, transparent 1px),
    radial-gradient(circle at 16% 20%, rgba(20, 184, 166, 0.18), transparent 34%),
    radial-gradient(circle at 86% 12%, rgba(37, 99, 235, 0.12), transparent 31%),
    linear-gradient(135deg, #f8fafc 0%, #effffb 42%, #f6f8ff 100%) !important;
  background-size: 72px 72px, 72px 72px, auto, auto, auto !important;
}

.dark .bg-gradient-to-br {
  background:
    linear-gradient(rgba(45, 212, 191, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(45, 212, 191, 0.05) 1px, transparent 1px),
    radial-gradient(circle at 16% 20%, rgba(20, 184, 166, 0.16), transparent 34%),
    radial-gradient(circle at 86% 12%, rgba(37, 99, 235, 0.16), transparent 31%),
    linear-gradient(135deg, #020617 0%, #071d22 48%, #111827 100%) !important;
}

.text-gradient,
h1 {
  letter-spacing: -0.045em;
}

.text-gradient {
  background: linear-gradient(135deg, var(--feige-primary-dark), var(--feige-accent), var(--feige-purple)) !important;
  -webkit-background-clip: text !important;
  background-clip: text !important;
  color: transparent !important;
}

.card-glass,
[class*="bg-white/60"],
[class*="bg-white/80"],
[class*="bg-white/40"] {
  border: 1px solid var(--feige-border) !important;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.86), rgba(255, 255, 255, 0.62)) !important;
  box-shadow: var(--feige-shadow) !important;
  backdrop-filter: blur(20px) saturate(145%) !important;
}

.dark .card-glass,
.dark [class*="dark:bg-dark-800"],
.dark [class*="dark:bg-dark-900"] {
  border-color: rgba(45, 212, 191, 0.16) !important;
  background: linear-gradient(145deg, rgba(15, 23, 42, 0.82), rgba(17, 24, 39, 0.62)) !important;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.34) !important;
}

[class*="rounded-2xl"],
[class*="rounded-xl"] {
  border-radius: 22px !important;
}

.btn,
button,
a {
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease, background 180ms ease !important;
}

.btn-primary,
[class*="bg-primary-"],
[class*="from-primary-"] {
  background: linear-gradient(135deg, #2dd4bf 0%, #14b8a6 42%, #2563eb 100%) !important;
  box-shadow: 0 14px 30px rgba(20, 184, 166, 0.30) !important;
}

.btn-primary:hover,
a.btn:hover,
button:hover {
  transform: translateY(-1px);
}

.btn-primary:hover {
  box-shadow: 0 18px 40px rgba(37, 99, 235, 0.26) !important;
}

.input,
input,
textarea,
select {
  border-radius: 14px !important;
  border-color: rgba(148, 163, 184, 0.34) !important;
  background: rgba(255, 255, 255, 0.78) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7) !important;
}

.input:focus,
input:focus,
textarea:focus,
select:focus {
  border-color: rgba(20, 184, 166, 0.78) !important;
  box-shadow: 0 0 0 4px rgba(20, 184, 166, 0.14) !important;
  outline: none !important;
}

.terminal-window {
  border: 1px solid rgba(45, 212, 191, 0.18) !important;
  border-radius: 18px !important;
  box-shadow: 0 30px 80px rgba(15, 23, 42, 0.26), 0 0 0 1px rgba(255, 255, 255, 0.05) inset !important;
}

.terminal-header {
  background: linear-gradient(90deg, rgba(15, 23, 42, 0.96), rgba(30, 41, 59, 0.96)) !important;
}

.terminal-body {
  background:
    radial-gradient(circle at 90% 0%, rgba(20, 184, 166, 0.08), transparent 36%),
    #111827 !important;
}

.code-success {
  box-shadow: 0 8px 18px rgba(34, 197, 94, 0.22);
}

aside,
[role="complementary"] {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(240, 253, 250, 0.86)) !important;
  border-right: 1px solid rgba(148, 163, 184, 0.2) !important;
  box-shadow: 18px 0 55px rgba(15, 23, 42, 0.06) !important;
  backdrop-filter: blur(18px) saturate(145%) !important;
}

.dark aside,
.dark [role="complementary"] {
  background:
    linear-gradient(180deg, rgba(15, 23, 42, 0.94), rgba(8, 47, 73, 0.56)) !important;
  border-right-color: rgba(45, 212, 191, 0.12) !important;
}

nav a,
nav button {
  border-radius: 14px !important;
}

nav a:hover,
nav button:hover {
  background: rgba(20, 184, 166, 0.10) !important;
}

header,
[role="banner"] {
  backdrop-filter: blur(16px) saturate(150%);
}

main [class*="shadow"],
main [class*="border"] {
  border-color: rgba(148, 163, 184, 0.20) !important;
}

table {
  border-collapse: separate !important;
  border-spacing: 0 !important;
}

thead {
  background: rgba(20, 184, 166, 0.06) !important;
}

tbody tr {
  transition: background 160ms ease, transform 160ms ease;
}

tbody tr:hover {
  background: rgba(20, 184, 166, 0.055) !important;
}

[role="dialog"],
dialog,
.modal {
  border-radius: 22px !important;
  border: 1px solid rgba(148, 163, 184, 0.24) !important;
  box-shadow: 0 34px 90px rgba(15, 23, 42, 0.24) !important;
}

.navigation-progress-bar {
  background: linear-gradient(90deg, #2dd4bf, #2563eb, #8b5cf6) !important;
}

img[alt="Logo"] {
  filter: drop-shadow(0 12px 22px rgba(20, 184, 166, 0.22));
}

@media (max-width: 768px) {
  .card-glass {
    padding: 1.5rem !important;
  }

  h1 {
    letter-spacing: -0.035em;
  }
}

.feige-recharge-card {
  display: flex;
  align-items: center;
  gap: 18px;
  margin: 0 0 24px;
  padding: 22px;
  border: 1px solid rgba(20, 184, 166, 0.22);
  border-radius: 24px;
  background:
    radial-gradient(circle at 92% 10%, rgba(37, 99, 235, 0.14), transparent 28%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.92), rgba(240, 253, 250, 0.78));
  box-shadow: 0 22px 55px rgba(15, 23, 42, 0.10);
  backdrop-filter: blur(18px) saturate(145%);
}

.dark .feige-recharge-card {
  border-color: rgba(45, 212, 191, 0.20);
  background:
    radial-gradient(circle at 92% 10%, rgba(37, 99, 235, 0.18), transparent 28%),
    linear-gradient(145deg, rgba(15, 23, 42, 0.88), rgba(17, 24, 39, 0.66));
}

.feige-recharge-card-icon {
  display: inline-flex;
  width: 54px;
  height: 54px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  border-radius: 18px;
  color: white;
  background: linear-gradient(135deg, #2dd4bf, #2563eb);
  box-shadow: 0 16px 32px rgba(20, 184, 166, 0.28);
}

.feige-recharge-card-body {
  flex: 1 1 auto;
  min-width: 0;
}

.feige-recharge-card h3 {
  margin: 0 0 6px;
  font-size: 18px;
  font-weight: 800;
  color: #0f172a;
}

.dark .feige-recharge-card h3 {
  color: #f8fafc;
}

.feige-recharge-card p {
  margin: 0 0 14px;
  color: #64748b;
  font-size: 14px;
  line-height: 1.6;
}

.dark .feige-recharge-card p {
  color: #cbd5e1;
}

.feige-recharge-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 20px;
  border: 0;
  border-radius: 999px !important;
  color: #fff;
  font-weight: 700;
  cursor: pointer;
  background: linear-gradient(135deg, #14b8a6, #2563eb) !important;
  box-shadow: 0 14px 30px rgba(37, 99, 235, 0.24) !important;
}

.feige-modal-open {
  overflow: hidden;
}

.feige-recharge-modal {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: none;
}

.feige-recharge-modal.is-open {
  display: block;
}

.feige-recharge-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 6, 23, 0.62);
  backdrop-filter: blur(10px);
}

.feige-recharge-panel {
  position: absolute;
  inset: 4vh 4vw;
  display: flex;
  min-height: 520px;
  overflow: hidden;
  flex-direction: column;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 26px;
  background: #fff;
  box-shadow: 0 32px 100px rgba(0, 0, 0, 0.35);
}

.feige-recharge-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 16px 18px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.18);
  background: linear-gradient(135deg, rgba(240, 253, 250, 0.96), rgba(239, 246, 255, 0.96));
}

.feige-recharge-header h2 {
  margin: 0 0 4px;
  color: #0f172a;
  font-size: 18px;
  font-weight: 800;
}

.feige-recharge-header p {
  margin: 0;
  color: #64748b;
  font-size: 13px;
}

.feige-recharge-actions {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
}

.feige-recharge-actions a,
.feige-recharge-actions button {
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 999px !important;
  color: #0f172a;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  background: rgba(255, 255, 255, 0.82) !important;
  cursor: pointer;
}

.feige-recharge-actions button {
  color: #fff;
  border-color: transparent;
  background: linear-gradient(135deg, #14b8a6, #2563eb) !important;
}

.feige-recharge-panel iframe {
  width: 100%;
  flex: 1 1 auto;
  border: 0;
  background: #fff;
}

@media (max-width: 768px) {
  .feige-recharge-card {
    align-items: flex-start;
    flex-direction: column;
  }

  .feige-recharge-panel {
    inset: 10px;
    min-height: 80vh;
    border-radius: 20px;
  }

  .feige-recharge-header {
    align-items: flex-start;
    flex-direction: column;
  }
}

/* Feige UI refresh v2: frontend + admin console */
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(20, 184, 166, 0.55) rgba(148, 163, 184, 0.16);
}

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

*::-webkit-scrollbar-track {
  background: rgba(148, 163, 184, 0.12);
}

*::-webkit-scrollbar-thumb {
  border: 2px solid transparent;
  border-radius: 999px;
  background: linear-gradient(180deg, #2dd4bf, #2563eb) border-box;
}

#app {
  min-height: 100vh;
}

main {
  position: relative;
}

main::before {
  content: "";
  position: absolute;
  top: 18px;
  right: 24px;
  z-index: -1;
  width: 220px;
  height: 220px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(45, 212, 191, 0.18), transparent 68%);
  filter: blur(12px);
}

/* Frontend/login polish */
.feige-route-auth #app > div {
  position: relative;
}

.feige-route-auth #app > div::before {
  content: "";
  position: fixed;
  inset: 34px;
  z-index: -1;
  border: 1px solid rgba(20, 184, 166, 0.14);
  border-radius: 36px;
  background:
    linear-gradient(rgba(255, 255, 255, 0.14) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.14) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: radial-gradient(circle at 50% 35%, black, transparent 72%);
  pointer-events: none;
}

.feige-route-auth img[alt="Logo"] {
  padding: 10px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.74);
  box-shadow: 0 18px 46px rgba(20, 184, 166, 0.22);
}

.feige-route-auth h1 {
  background: linear-gradient(135deg, #0f766e, #2563eb, #8b5cf6);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent !important;
}

.feige-route-auth h2 {
  letter-spacing: -0.035em;
}

.feige-route-auth form,
.feige-route-auth [class*="space-y"] {
  isolation: isolate;
}

/* Backend/admin console polish */
aside nav,
[role="complementary"] nav {
  padding-inline: 10px;
}

aside nav > div,
[role="complementary"] nav > div {
  gap: 5px;
}

aside a,
aside button,
[role="complementary"] a,
[role="complementary"] button {
  position: relative;
  min-height: 42px;
  overflow: hidden;
  border: 1px solid transparent !important;
}

aside a::before,
aside button::before,
[role="complementary"] a::before,
[role="complementary"] button::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  border-radius: 999px;
  background: transparent;
}

aside a:hover,
aside button:hover,
[role="complementary"] a:hover,
[role="complementary"] button:hover {
  border-color: rgba(20, 184, 166, 0.18) !important;
  background:
    linear-gradient(90deg, rgba(20, 184, 166, 0.13), rgba(37, 99, 235, 0.06)) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5), 0 10px 24px rgba(15, 23, 42, 0.06);
}

aside a:hover::before,
aside button:hover::before,
[role="complementary"] a:hover::before,
[role="complementary"] button:hover::before {
  background: linear-gradient(180deg, #2dd4bf, #2563eb);
}

aside a[href^="/admin"] {
  --feige-nav-glow: rgba(37, 99, 235, 0.10);
}

header,
[role="banner"] {
  border-bottom: 1px solid rgba(148, 163, 184, 0.16);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.72), rgba(240, 253, 250, 0.56)) !important;
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.05);
}

.dark header,
.dark [role="banner"] {
  background:
    linear-gradient(135deg, rgba(15, 23, 42, 0.78), rgba(8, 47, 73, 0.36)) !important;
}

main > div > div,
main section,
main article {
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

main > div > div:hover,
main section:hover,
main article:hover {
  border-color: rgba(20, 184, 166, 0.26) !important;
}

main p:first-child:has(+ p),
main [class*="text-sm"]:has(+ [class*="text-"]) {
  color: #64748b;
}

main p:nth-child(2):not(:only-child) {
  letter-spacing: -0.025em;
}

main h1,
main h2,
main h3 {
  color: #0f172a;
}

.dark main h1,
.dark main h2,
.dark main h3 {
  color: #f8fafc;
}

main h1::after {
  content: "";
  display: block;
  width: 54px;
  height: 4px;
  margin-top: 10px;
  border-radius: 999px;
  background: linear-gradient(90deg, #2dd4bf, #2563eb);
}

table {
  overflow: hidden;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.72);
}

th {
  color: #334155 !important;
  font-weight: 800 !important;
  letter-spacing: 0.01em;
}

td,
th {
  border-bottom-color: rgba(148, 163, 184, 0.14) !important;
}

tbody tr:last-child td {
  border-bottom-color: transparent !important;
}

tbody td:first-child,
tbody th:first-child {
  padding-left: 18px !important;
}

[class*="badge"],
[class*="Badge"],
span[class*="rounded-full"],
div[class*="rounded-full"] {
  border: 1px solid rgba(20, 184, 166, 0.18);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55);
}

button[type="submit"],
button:has(svg) {
  will-change: transform;
}

button[type="submit"] {
  min-height: 42px;
  border-radius: 14px !important;
  font-weight: 800 !important;
}

select,
input[type="number"],
input[type="text"],
input[type="email"],
input[type="password"],
textarea {
  min-height: 42px;
}

label {
  color: #334155;
  font-weight: 700;
}

.dark label {
  color: #e2e8f0;
}

[role="dialog"] {
  overflow: hidden;
  background:
    radial-gradient(circle at 90% 0%, rgba(20, 184, 166, 0.16), transparent 26%),
    rgba(255, 255, 255, 0.96) !important;
}

.dark [role="dialog"] {
  background:
    radial-gradient(circle at 90% 0%, rgba(20, 184, 166, 0.18), transparent 26%),
    rgba(15, 23, 42, 0.96) !important;
}

[role="dialog"] header,
[role="dialog"] [role="banner"] {
  box-shadow: none;
}

[class*="toast"],
[class*="Toast"],
[class*="notification"],
[class*="Notification"] {
  border: 1px solid rgba(20, 184, 166, 0.22) !important;
  border-radius: 18px !important;
  background: rgba(255, 255, 255, 0.92) !important;
  box-shadow: 0 20px 55px rgba(15, 23, 42, 0.16) !important;
  backdrop-filter: blur(18px) saturate(145%);
}

.dark [class*="toast"],
.dark [class*="Toast"],
.dark [class*="notification"],
.dark [class*="Notification"] {
  background: rgba(15, 23, 42, 0.92) !important;
}

/* Admin metric cards and quick actions */
main:has(table) > div,
main:has(button) > div {
  gap: 18px;
}

main button:has(p),
main a:has(p) {
  border: 1px solid rgba(148, 163, 184, 0.18) !important;
  border-radius: 20px !important;
  background:
    radial-gradient(circle at 94% 10%, rgba(20, 184, 166, 0.12), transparent 28%),
    rgba(255, 255, 255, 0.72) !important;
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.08) !important;
}

main button:has(p):hover,
main a:has(p):hover {
  transform: translateY(-2px);
  box-shadow: 0 22px 48px rgba(15, 23, 42, 0.12) !important;
}

.dark main button:has(p),
.dark main a:has(p) {
  background:
    radial-gradient(circle at 94% 10%, rgba(20, 184, 166, 0.16), transparent 28%),
    rgba(15, 23, 42, 0.68) !important;
}

/* Recharge modal polish */
.feige-recharge-panel {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.98)) !important;
}

.feige-recharge-panel::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: linear-gradient(90deg, #2dd4bf, #2563eb, #8b5cf6);
}

.feige-recharge-header {
  padding: 18px 22px;
}

.feige-recharge-header h2 {
  letter-spacing: -0.03em;
}

.feige-recharge-panel iframe {
  border-top: 1px solid rgba(148, 163, 184, 0.12);
}

/* Feige UI refresh v3: deeper frontend/backend refinement */
:root {
  --feige-surface-strong: rgba(255, 255, 255, 0.88);
  --feige-surface-soft: rgba(255, 255, 255, 0.62);
  --feige-ring: 0 0 0 4px rgba(20, 184, 166, 0.15);
}

body {
  background-attachment: fixed;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  opacity: 0.55;
  pointer-events: none;
  background:
    linear-gradient(rgba(15, 23, 42, 0.028) 1px, transparent 1px),
    linear-gradient(90deg, rgba(15, 23, 42, 0.028) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: linear-gradient(to bottom, black, transparent 78%);
}

.dark body::after {
  opacity: 0.42;
  background:
    linear-gradient(rgba(45, 212, 191, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(45, 212, 191, 0.06) 1px, transparent 1px);
}

/* Auth pages */
.feige-route-auth {
  min-height: 100vh;
  background:
    radial-gradient(circle at 50% -12%, rgba(45, 212, 191, 0.30), transparent 34%),
    radial-gradient(circle at 0% 100%, rgba(37, 99, 235, 0.18), transparent 32%),
    radial-gradient(circle at 100% 88%, rgba(139, 92, 246, 0.16), transparent 30%);
}

.feige-route-auth #app > div {
  min-height: 100vh;
}

.feige-route-auth h1 {
  font-size: clamp(34px, 5vw, 58px) !important;
}

.feige-route-auth h2 {
  font-size: clamp(26px, 3vw, 36px) !important;
}

.feige-route-auth input {
  height: 48px !important;
  border-radius: 16px !important;
}

.feige-route-auth button[type="submit"],
.feige-route-auth button:has(+ span),
.feige-route-auth button:has(svg) {
  border-radius: 16px !important;
}

.feige-route-auth a {
  color: #0f766e !important;
  font-weight: 800;
}

.feige-route-auth a:hover {
  color: #2563eb !important;
}

/* App shell */
.feige-has-sidebar aside,
.feige-has-sidebar [role="complementary"] {
  width: 272px;
}

.feige-has-sidebar aside > div:first-child,
.feige-has-sidebar [role="complementary"] > div:first-child {
  padding-top: 18px;
}

.feige-has-sidebar aside img[alt="Logo"] {
  width: 44px !important;
  height: 44px !important;
  padding: 8px;
  border-radius: 16px;
  background:
    radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0.42)),
    linear-gradient(135deg, rgba(45, 212, 191, 0.18), rgba(37, 99, 235, 0.14));
  box-shadow: 0 14px 30px rgba(20, 184, 166, 0.22);
}

.feige-has-sidebar nav > div > div:first-child,
.feige-has-sidebar nav [class*="uppercase"] {
  margin-top: 12px;
  padding: 0 12px;
  color: #0f766e !important;
  font-size: 11px !important;
  font-weight: 900 !important;
  letter-spacing: 0.08em !important;
}

.dark .feige-has-sidebar nav > div > div:first-child,
.dark .feige-has-sidebar nav [class*="uppercase"] {
  color: #5eead4 !important;
}

.feige-has-sidebar header,
.feige-has-sidebar [role="banner"] {
  position: sticky;
  top: 0;
  z-index: 30;
}

.feige-has-sidebar [role="banner"] h1,
.feige-has-sidebar header h1 {
  font-size: clamp(24px, 2.4vw, 34px) !important;
}

.feige-has-sidebar [role="banner"] p,
.feige-has-sidebar header p {
  color: #64748b !important;
}

.feige-has-sidebar main {
  padding-bottom: 42px;
}

/* Route-specific accent strips */
.feige-route-dashboard main h1::after {
  width: 86px;
}

.feige-route-users main h1::after {
  background: linear-gradient(90deg, #2563eb, #8b5cf6);
}

.feige-route-accounts main h1::after,
.feige-route-channels main h1::after,
.feige-route-monitor main h1::after {
  background: linear-gradient(90deg, #14b8a6, #f59e0b);
}

/* Cards */
main > div > div > div {
  backdrop-filter: blur(18px) saturate(142%);
}

main > div > div > div:has(p:nth-child(2)) {
  position: relative;
  overflow: hidden;
}

main > div > div > div:has(p:nth-child(2))::after {
  content: "";
  position: absolute;
  top: -34px;
  right: -26px;
  width: 96px;
  height: 96px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(20, 184, 166, 0.18), transparent 68%);
  pointer-events: none;
}

main > div > div > div:has(p:nth-child(2)) p:nth-child(2) {
  color: #0f766e !important;
  font-weight: 900 !important;
}

.dark main > div > div > div:has(p:nth-child(2)) p:nth-child(2) {
  color: #5eead4 !important;
}

/* Tables and data pages */
.feige-route-admin table,
.feige-route-users table,
.feige-route-accounts table,
.feige-route-channels table {
  border: 1px solid rgba(148, 163, 184, 0.16);
  box-shadow: 0 18px 46px rgba(15, 23, 42, 0.08);
}

.feige-route-admin thead,
.feige-route-users thead,
.feige-route-accounts thead,
.feige-route-channels thead {
  position: sticky;
  top: 76px;
  z-index: 8;
  backdrop-filter: blur(14px) saturate(145%);
}

.feige-route-admin tbody tr:nth-child(even),
.feige-route-users tbody tr:nth-child(even),
.feige-route-accounts tbody tr:nth-child(even),
.feige-route-channels tbody tr:nth-child(even) {
  background: rgba(20, 184, 166, 0.025);
}

.feige-route-admin td button,
.feige-route-users td button,
.feige-route-accounts td button,
.feige-route-channels td button {
  min-height: 32px;
  border-radius: 12px !important;
}

/* Inputs/search bars */
.feige-route-admin input[placeholder],
.feige-route-admin textarea,
.feige-route-admin select {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0.72)) !important;
}

.feige-route-admin input[placeholder]:hover,
.feige-route-admin textarea:hover,
.feige-route-admin select:hover {
  border-color: rgba(20, 184, 166, 0.52) !important;
}

.feige-route-admin input[placeholder]:focus,
.feige-route-admin textarea:focus,
.feige-route-admin select:focus {
  box-shadow: var(--feige-ring) !important;
}

/* Buttons */
.feige-route-admin main button:not([disabled]),
.feige-route-admin main a:not([disabled]) {
  font-weight: 700;
}

.feige-route-admin main button[disabled] {
  opacity: 0.55;
  transform: none !important;
}

.feige-route-admin main button:not([disabled]):active {
  transform: translateY(0) scale(0.99);
}

/* Top balance/user pill */
.feige-has-sidebar [role="banner"] button,
.feige-has-sidebar header button,
.feige-has-sidebar [role="banner"] [class*="rounded"],
.feige-has-sidebar header [class*="rounded"] {
  border-color: rgba(148, 163, 184, 0.18) !important;
}

.feige-has-sidebar [role="banner"] button:hover,
.feige-has-sidebar header button:hover {
  background: rgba(20, 184, 166, 0.10) !important;
}

/* Channel and account pages */
.feige-route-channels main,
.feige-route-accounts main,
.feige-route-monitor main {
  background:
    radial-gradient(circle at 96% 4%, rgba(245, 158, 11, 0.10), transparent 22%),
    radial-gradient(circle at 0% 90%, rgba(20, 184, 166, 0.10), transparent 22%);
}

/* Dialogs/drawers */
[role="dialog"] input,
[role="dialog"] textarea,
[role="dialog"] select {
  background: rgba(255, 255, 255, 0.82) !important;
}

[role="dialog"] button {
  min-height: 38px;
}

[role="dialog"] h2,
[role="dialog"] h3 {
  letter-spacing: -0.025em;
}

/* Recharge modal v3 */
.feige-recharge-panel {
  inset: 3vh 3vw;
  border-radius: 30px;
}

.feige-recharge-header {
  background:
    radial-gradient(circle at 92% 10%, rgba(139, 92, 246, 0.14), transparent 24%),
    linear-gradient(135deg, rgba(240, 253, 250, 0.98), rgba(239, 246, 255, 0.98)) !important;
}

.feige-recharge-actions button {
  padding-inline: 18px;
}

@media (max-width: 1024px) {
  .feige-has-sidebar aside,
  .feige-has-sidebar [role="complementary"] {
    width: 248px;
  }

  .feige-route-admin thead,
  .feige-route-users thead,
  .feige-route-accounts thead,
  .feige-route-channels thead {
    top: 64px;
  }
}

@media (max-width: 768px) {
  body::after {
    background-size: 22px 22px;
  }

  .feige-route-auth #app > div::before {
    inset: 12px;
    border-radius: 24px;
  }

  .feige-has-sidebar [role="banner"],
  .feige-has-sidebar header {
    position: relative;
  }

  .feige-route-admin thead,
  .feige-route-users thead,
  .feige-route-accounts thead,
  .feige-route-channels thead {
    position: static;
  }

  .feige-recharge-panel {
    inset: 8px;
  }
}

/* Keep the built-in onboarding popover usable after global header styling. */
.driver-popover-title {
  position: static !important;
  pointer-events: none !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
}

.driver-popover-close-btn {
  position: absolute !important;
  top: 10px !important;
  right: 10px !important;
  z-index: 5 !important;
}

/* Admin typography normalization: keep backend console compact. */
.feige-route-admin {
  font-size: 14px !important;
}

.feige-route-admin aside,
.feige-route-admin [role="complementary"] {
  font-size: 14px !important;
}

.feige-route-admin aside a,
.feige-route-admin aside button,
.feige-route-admin [role="complementary"] a,
.feige-route-admin [role="complementary"] button {
  font-size: 14px !important;
  line-height: 1.35 !important;
}

.feige-route-admin aside > div:first-child,
.feige-route-admin [role="complementary"] > div:first-child {
  font-size: 16px !important;
}

.feige-route-admin header h1,
.feige-route-admin [role="banner"] h1,
.feige-route-admin main h1 {
  font-size: 24px !important;
  line-height: 1.18 !important;
  letter-spacing: -0.025em !important;
}

.feige-route-admin header p,
.feige-route-admin [role="banner"] p {
  font-size: 14px !important;
  line-height: 1.45 !important;
}

.feige-route-admin main h2 {
  font-size: 18px !important;
  line-height: 1.25 !important;
  letter-spacing: -0.015em !important;
}

.feige-route-admin main h3 {
  font-size: 16px !important;
  line-height: 1.3 !important;
}

.feige-route-admin main p,
.feige-route-admin main span,
.feige-route-admin main label,
.feige-route-admin main input,
.feige-route-admin main textarea,
.feige-route-admin main select,
.feige-route-admin main button,
.feige-route-admin main a,
.feige-route-admin table {
  font-size: 14px !important;
}

.feige-route-admin table th {
  font-size: 13px !important;
  line-height: 1.35 !important;
}

.feige-route-admin table td {
  font-size: 13px !important;
  line-height: 1.45 !important;
}

.feige-route-admin [class*="text-2xl"],
.feige-route-admin [class*="text-3xl"],
.feige-route-admin [class*="text-4xl"],
.feige-route-admin [class*="text-5xl"],
.feige-route-admin [class*="text-6xl"] {
  font-size: 24px !important;
  line-height: 1.2 !important;
}

.feige-route-admin main [class*="text-xl"] {
  font-size: 18px !important;
  line-height: 1.25 !important;
}

.feige-route-admin main [class*="text-lg"] {
  font-size: 16px !important;
  line-height: 1.3 !important;
}

.feige-route-admin [role="dialog"] h1,
.feige-route-admin [role="dialog"] h2 {
  font-size: 20px !important;
}

.feige-route-admin [role="dialog"] h3 {
  font-size: 16px !important;
}

/* Compact admin typography override. */
.feige-route-admin header h1,
.feige-route-admin [role="banner"] h1,
.feige-route-admin main h1 {
  font-size: 18px !important;
  line-height: 1.25 !important;
  letter-spacing: -0.01em !important;
}

.feige-route-admin main h1::after {
  width: 36px !important;
  height: 3px !important;
  margin-top: 6px !important;
}

.feige-route-admin header p,
.feige-route-admin [role="banner"] p {
  font-size: 13px !important;
}

.feige-route-admin main h2,
.feige-route-admin [role="dialog"] h1,
.feige-route-admin [role="dialog"] h2 {
  font-size: 16px !important;
}

.feige-route-admin main h3,
.feige-route-admin [role="dialog"] h3 {
  font-size: 15px !important;
}

.feige-route-admin [class*="text-2xl"],
.feige-route-admin [class*="text-3xl"],
.feige-route-admin [class*="text-4xl"],
.feige-route-admin [class*="text-5xl"],
.feige-route-admin [class*="text-6xl"] {
  font-size: 20px !important;
  line-height: 1.22 !important;
}

.feige-route-admin main [class*="text-xl"] {
  font-size: 16px !important;
}

.feige-route-admin main [class*="text-lg"] {
  font-size: 15px !important;
}

.feige-route-admin table th,
.feige-route-admin table td {
  font-size: 13px !important;
}

/* Frontend/user UI polish: scoped away from admin console. */
.feige-route-auth #app {
  position: relative;
  overflow: hidden;
}

.feige-route-auth #app::before,
.feige-route-auth #app::after {
  content: "";
  position: fixed;
  z-index: -1;
  width: 420px;
  height: 420px;
  border-radius: 999px;
  pointer-events: none;
  filter: blur(14px);
}

.feige-route-auth #app::before {
  top: -140px;
  left: -120px;
  background: radial-gradient(circle, rgba(20, 184, 166, 0.28), transparent 66%);
}

.feige-route-auth #app::after {
  right: -130px;
  bottom: -160px;
  background: radial-gradient(circle, rgba(37, 99, 235, 0.22), transparent 68%);
}

.feige-route-auth img[alt="Logo"] {
  width: 72px !important;
  height: 72px !important;
}

.feige-route-auth #app > div > div {
  animation: feige-auth-rise 520ms ease both;
}

.feige-route-auth input {
  font-size: 15px !important;
  letter-spacing: 0.01em;
}

.feige-route-auth input::placeholder {
  color: rgba(100, 116, 139, 0.72) !important;
}

.feige-route-auth button {
  min-height: 46px;
}

.feige-route-auth button[type="submit"],
.feige-route-auth button:has(svg):not([aria-label]) {
  background: linear-gradient(135deg, #14b8a6 0%, #2563eb 62%, #7c3aed 100%) !important;
  box-shadow: 0 18px 42px rgba(37, 99, 235, 0.26) !important;
}

.feige-route-auth button[type="submit"]:hover,
.feige-route-auth button:has(svg):not([aria-label]):hover {
  box-shadow: 0 24px 54px rgba(37, 99, 235, 0.32) !important;
}

body:not(.feige-route-admin).feige-has-sidebar {
  background:
    radial-gradient(circle at 2% 12%, rgba(20, 184, 166, 0.16), transparent 28%),
    radial-gradient(circle at 94% 14%, rgba(37, 99, 235, 0.12), transparent 30%),
    linear-gradient(135deg, #f8fafc 0%, #f0fdfa 48%, #eff6ff 100%);
}

body:not(.feige-route-admin).feige-has-sidebar aside,
body:not(.feige-route-admin).feige-has-sidebar [role="complementary"] {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(236, 253, 245, 0.88)) !important;
}

body:not(.feige-route-admin).feige-has-sidebar [role="banner"],
body:not(.feige-route-admin).feige-has-sidebar header {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.80), rgba(240, 253, 250, 0.68)) !important;
}

body:not(.feige-route-admin).feige-has-sidebar main {
  position: relative;
}

body:not(.feige-route-admin).feige-has-sidebar main > div {
  animation: feige-panel-in 420ms ease both;
}

body:not(.feige-route-admin).feige-has-sidebar main h1 {
  font-size: 24px !important;
  line-height: 1.22 !important;
  letter-spacing: -0.02em !important;
}

body:not(.feige-route-admin).feige-has-sidebar main h2 {
  font-size: 19px !important;
  line-height: 1.3 !important;
}

body:not(.feige-route-admin).feige-has-sidebar main h3 {
  font-size: 17px !important;
  line-height: 1.35 !important;
}

body:not(.feige-route-admin).feige-has-sidebar main p {
  line-height: 1.65;
}

body:not(.feige-route-admin).feige-has-sidebar main section,
body:not(.feige-route-admin).feige-has-sidebar main article,
body:not(.feige-route-admin).feige-has-sidebar main > div > div {
  border-radius: 24px !important;
}

body:not(.feige-route-admin).feige-has-sidebar main button,
body:not(.feige-route-admin).feige-has-sidebar main a {
  border-radius: 14px !important;
}

body:not(.feige-route-admin).feige-has-sidebar input,
body:not(.feige-route-admin).feige-has-sidebar textarea,
body:not(.feige-route-admin).feige-has-sidebar select {
  min-height: 44px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(255, 255, 255, 0.76)) !important;
}

body:not(.feige-route-admin).feige-route-profile main,
body:not(.feige-route-admin).feige-route-keys main,
body:not(.feige-route-admin).feige-route-usage main,
body:not(.feige-route-admin).feige-route-monitor main {
  background:
    radial-gradient(circle at 88% 0%, rgba(20, 184, 166, 0.10), transparent 24%),
    radial-gradient(circle at 0% 100%, rgba(37, 99, 235, 0.08), transparent 26%);
}

body:not(.feige-route-admin).feige-route-keys main button,
body:not(.feige-route-admin).feige-route-profile main button {
  font-weight: 800;
}

body:not(.feige-route-admin) table {
  border: 1px solid rgba(148, 163, 184, 0.16);
  box-shadow: 0 16px 42px rgba(15, 23, 42, 0.08);
}

body:not(.feige-route-admin) table th {
  font-size: 13px !important;
}

body:not(.feige-route-admin) table td {
  font-size: 13px !important;
}

/* Hide dashboard subtitle requested by site owner. */
[role="banner"] h1 + p,
header h1 + p {
  display: none !important;
}

/* Mobile adaptation for user/frontend pages. */
@media (max-width: 768px) {
  body {
    overflow-x: hidden;
  }

  #app {
    width: 100%;
    overflow-x: hidden;
  }

  .feige-route-auth #app > div {
    padding: 18px !important;
  }

  .feige-route-auth img[alt="Logo"] {
    width: 58px !important;
    height: 58px !important;
  }

  .feige-route-auth h1 {
    font-size: 30px !important;
  }

  .feige-route-auth h2 {
    font-size: 22px !important;
  }

  .feige-route-auth input,
  .feige-route-auth button {
    min-height: 44px !important;
  }

  .feige-has-sidebar aside,
  .feige-has-sidebar [role="complementary"] {
    max-width: 82vw !important;
  }

  .feige-has-sidebar [role="banner"],
  .feige-has-sidebar header {
    padding: 12px 14px !important;
  }

  .feige-has-sidebar [role="banner"] h1,
  .feige-has-sidebar header h1,
  body:not(.feige-route-admin).feige-has-sidebar main h1 {
    font-size: 20px !important;
    line-height: 1.25 !important;
  }

  body:not(.feige-route-admin).feige-has-sidebar main h2 {
    font-size: 17px !important;
  }

  body:not(.feige-route-admin).feige-has-sidebar main h3 {
    font-size: 15px !important;
  }

  body:not(.feige-route-admin).feige-has-sidebar main {
    padding: 14px !important;
  }

  body:not(.feige-route-admin).feige-has-sidebar main > div {
    gap: 14px !important;
  }

  body:not(.feige-route-admin).feige-has-sidebar main section,
  body:not(.feige-route-admin).feige-has-sidebar main article,
  body:not(.feige-route-admin).feige-has-sidebar main > div > div {
    border-radius: 18px !important;
  }

  body:not(.feige-route-admin) table {
    display: block !important;
    max-width: calc(100vw - 28px);
    overflow-x: auto !important;
    white-space: nowrap;
    border-radius: 16px !important;
  }

  body:not(.feige-route-admin) table th,
  body:not(.feige-route-admin) table td {
    padding: 10px 12px !important;
    font-size: 12px !important;
  }

  body:not(.feige-route-admin).feige-has-sidebar input,
  body:not(.feige-route-admin).feige-has-sidebar textarea,
  body:not(.feige-route-admin).feige-has-sidebar select,
  body:not(.feige-route-admin).feige-has-sidebar button {
    max-width: 100%;
  }

  #feige-recharge-nav-item {
    min-height: 40px !important;
  }

  .feige-recharge-panel {
    inset: 6px !important;
    min-height: calc(100vh - 12px) !important;
    border-radius: 18px !important;
  }

  .feige-recharge-header {
    gap: 10px !important;
    padding: 14px !important;
  }

  .feige-recharge-header h2 {
    font-size: 16px !important;
  }

  .feige-recharge-header p {
    font-size: 12px !important;
  }

  .feige-recharge-actions {
    width: 100%;
    justify-content: flex-end;
  }

  .feige-recharge-actions button {
    min-height: 34px !important;
    padding: 0 12px !important;
    font-size: 12px !important;
  }

  [role="dialog"] {
    max-width: calc(100vw - 18px) !important;
  }
}

@media (max-width: 420px) {
  .feige-route-auth #app > div {
    padding: 12px !important;
  }

  .feige-route-auth h1 {
    font-size: 26px !important;
  }

  .feige-route-auth h2 {
    font-size: 20px !important;
  }

  .feige-has-sidebar [role="banner"],
  .feige-has-sidebar header {
    padding: 10px 12px !important;
  }

  body:not(.feige-route-admin).feige-has-sidebar main {
    padding: 10px !important;
  }

  body:not(.feige-route-admin) table {
    max-width: calc(100vw - 20px);
  }
}

@keyframes feige-auth-rise {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.99);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes feige-panel-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}


/* feige-disable-driver-overlay */
.driver-overlay,
.driver-popover,
.driver-popover-arrow {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
}
.driver-active-element {
  position: static !important;
  z-index: auto !important;
  pointer-events: auto !important;
}
html.driver-active,
body.driver-active {
  overflow: auto !important;
  pointer-events: auto !important;
}

/* Admin-only background image approved on 2026-07-19. */
body.feige-route-admin::before {
  background:
    linear-gradient(90deg, rgba(248, 250, 252, 0.66) 0%, rgba(248, 250, 252, 0.48) 58%, rgba(15, 23, 42, 0.08) 100%),
    url("/sub2api-admin-background-v3.webp?v=20260719bg1") center center / cover no-repeat !important;
}

.dark body.feige-route-admin::before {
  background:
    linear-gradient(90deg, rgba(2, 6, 23, 0.72) 0%, rgba(2, 6, 23, 0.52) 58%, rgba(2, 6, 23, 0.16) 100%),
    url("/sub2api-admin-background-v3.webp?v=20260719bg1") center center / cover no-repeat !important;
}

body.feige-route-admin::after {
  opacity: 0.18;
}

.dark body.feige-route-admin::after {
  opacity: 0.14;
}

body.feige-route-admin #app > .min-h-screen {
  background-color: transparent !important;
}

body.feige-route-admin .bg-mesh-gradient {
  opacity: 0.16 !important;
}

.dark body.feige-route-admin .bg-mesh-gradient {
  opacity: 0.1 !important;
}

@media (max-width: 900px) {
  body.feige-route-admin::before,
  .dark body.feige-route-admin::before {
    background-position: 68% center !important;
  }
}

/* Settings page embedded tables must stay in normal flow. */
body.feige-route-admin.feige-route-settings thead {
  position: static !important;
  top: auto !important;
  z-index: auto !important;
}

/* Authenticated user frontend background; public/auth pages stay unchanged. */
body.feige-has-sidebar:not(.feige-route-admin):not(.feige-route-auth)::before {
  background:
    linear-gradient(90deg, rgba(248, 250, 252, 0.66) 0%, rgba(248, 250, 252, 0.48) 58%, rgba(15, 23, 42, 0.08) 100%),
    url("/sub2api-admin-background-v3.webp?v=20260719bg1") center center / cover no-repeat !important;
}

.dark body.feige-has-sidebar:not(.feige-route-admin):not(.feige-route-auth)::before {
  background:
    linear-gradient(90deg, rgba(2, 6, 23, 0.72) 0%, rgba(2, 6, 23, 0.52) 58%, rgba(2, 6, 23, 0.16) 100%),
    url("/sub2api-admin-background-v3.webp?v=20260719bg1") center center / cover no-repeat !important;
}

body.feige-has-sidebar:not(.feige-route-admin):not(.feige-route-auth)::after {
  opacity: 0.18;
}

.dark body.feige-has-sidebar:not(.feige-route-admin):not(.feige-route-auth)::after {
  opacity: 0.14;
}

body.feige-has-sidebar:not(.feige-route-admin):not(.feige-route-auth) #app > .min-h-screen {
  background-color: transparent !important;
}

body.feige-has-sidebar:not(.feige-route-admin):not(.feige-route-auth) .bg-mesh-gradient {
  opacity: 0.16 !important;
}

.dark body.feige-has-sidebar:not(.feige-route-admin):not(.feige-route-auth) .bg-mesh-gradient {
  opacity: 0.1 !important;
}

@media (max-width: 900px) {
  body.feige-has-sidebar:not(.feige-route-admin):not(.feige-route-auth)::before,
  .dark body.feige-has-sidebar:not(.feige-route-admin):not(.feige-route-auth)::before {
    background-position: 68% center !important;
  }
}
