/* ===========================
   TRO – Global Design System
   Dark luxury + 3D aesthetic
   =========================== */

:root {
  /* Brand Colors */
  --gold: #FFD166;
  --gold-light: #FFE5A0;
  --gold-dark: #C9A227;
  --orbit-blue: #0A1628;
  --orbit-navy: #0D1F3C;
  --orbit-deep: #060D1A;
  --accent-cyan: #00D4FF;
  --accent-purple: #7B2FBE;
  --accent-green: #06D6A0;
  --accent-red: #EF233C;

  /* Glassmorphism */
  --glass-bg: rgba(255,255,255,0.04);
  --glass-border: rgba(255,209,102,0.15);
  --glass-blur: blur(20px);
  --page-bg: #060D1A;
  --page-bg-accent:
    radial-gradient(circle at top right, rgba(255,209,102,0.16), transparent 30%),
    radial-gradient(circle at left bottom, rgba(0,212,255,0.12), transparent 28%),
    linear-gradient(180deg, rgba(10,22,40,0.38), transparent 40%);
  --surface-1: rgba(12, 19, 36, 0.76);
  --surface-2: rgba(15, 24, 43, 0.88);
  --surface-3: rgba(255,255,255,0.05);
  --surface-solid: rgba(7, 12, 24, 0.88);
  --field-bg: rgba(255,255,255,0.04);
  --soft-fill: rgba(255,255,255,0.03);
  --line-soft: rgba(255,255,255,0.06);
  --grid-line: rgba(255,209,102,0.03);
  --toggle-shell: rgba(7, 12, 24, 0.88);

  /* Text */
  --text-primary: #F0F4FF;
  --text-secondary: #97A2B6;
  --text-muted: #5D6C81;

  /* Shadows */
  --shadow-gold: 0 0 40px rgba(255,209,102,0.15);
  --shadow-card: 0 8px 32px rgba(0,0,0,0.4);
  --shadow-glow: 0 0 60px rgba(0,212,255,0.1);

  /* Spacing */
  --radius: 14px;
  --radius-sm: 10px;
  --radius-lg: 22px;

  /* Font */
  --font-display: 'Inter Tight', sans-serif;
  --font-body: 'Manrope', sans-serif;

  /* Transitions */
  --trans: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --trans-fast: 0.15s ease;
}

:root[data-theme='light'] {
  --glass-bg: rgba(255,255,255,0.74);
  --glass-border: rgba(15, 23, 42, 0.1);
  --page-bg: #f6f1e7;
  --page-bg-accent:
    radial-gradient(circle at top right, rgba(255,209,102,0.3), transparent 34%),
    radial-gradient(circle at left bottom, rgba(0,126,255,0.12), transparent 26%),
    linear-gradient(180deg, rgba(255,255,255,0.3), transparent 44%);
  --surface-1: rgba(255,255,255,0.78);
  --surface-2: rgba(255,255,255,0.92);
  --surface-3: rgba(15,23,42,0.04);
  --surface-solid: rgba(249, 245, 237, 0.92);
  --field-bg: rgba(255,255,255,0.95);
  --soft-fill: rgba(15,23,42,0.035);
  --line-soft: rgba(15,23,42,0.08);
  --grid-line: rgba(15,23,42,0.055);
  --toggle-shell: rgba(255,255,255,0.88);
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #7c879b;
  --shadow-gold: 0 14px 34px rgba(255,209,102,0.18);
  --shadow-card: 0 16px 44px rgba(148,163,184,0.16);
  --shadow-glow: 0 0 50px rgba(59,130,246,0.08);
}

/* ===========================
   RESET & BASE
   =========================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-body);
  background: var(--page-bg-accent), var(--page-bg);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.52;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-variant-numeric: tabular-nums lining-nums;
  font-feature-settings: 'tnum' 1, 'lnum' 1;
  transition: background 0.35s ease, color 0.35s ease;
}

img { max-width: 100%; display: block; }
a { text-decoration: none; color: inherit; }
button { cursor: pointer; font-family: inherit; border: none; outline: none; }
input, textarea, select, table { font-family: inherit; outline: none; font-variant-numeric: tabular-nums lining-nums; }

/* ===========================
   LAYOUT
   =========================== */
.container {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
}

.container-sm {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 24px;
}

.page {
  min-height: 100vh;
  display: none;
}

.page.active {
  display: block;
}

/* ===========================
   BACKGROUND EFFECTS
   =========================== */
.bg-grid {
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 60px 60px;
  pointer-events: none;
  z-index: 0;
}

.bg-orbs {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.15;
  animation: drift 20s infinite alternate ease-in-out;
}

.orb-1 {
  width: 600px; height: 600px;
  background: var(--gold);
  top: -200px; right: -200px;
  animation-duration: 25s;
}

.orb-2 {
  width: 400px; height: 400px;
  background: var(--accent-cyan);
  bottom: -100px; left: -100px;
  animation-duration: 30s;
  animation-delay: -10s;
}

.orb-3 {
  width: 300px; height: 300px;
  background: var(--accent-purple);
  top: 40%; left: 40%;
  animation-duration: 20s;
  animation-delay: -5s;
}

@keyframes drift {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(40px, 40px) scale(1.1); }
}

/* ===========================
   GLASSMORPHISM CARD
   =========================== */
.card {
  background: linear-gradient(180deg, var(--glass-bg), rgba(255,255,255,0.02));
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  box-shadow: var(--shadow-card);
  transition: transform var(--trans), box-shadow var(--trans), border-color var(--trans), background var(--trans);
}

.card:hover {
  transform: translateY(-2px);
  border-color: rgba(255,209,102,0.26);
  box-shadow: var(--shadow-card), var(--shadow-gold);
}

.card-3d {
  transform-style: preserve-3d;
  perspective: 1000px;
}

/* ===========================
   BUTTONS
   =========================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 28px;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1;
  transition: all var(--trans);
  position: relative;
  overflow: hidden;
}

.btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0.1);
  opacity: 0;
  transition: opacity var(--trans-fast);
}

.btn:hover::before { opacity: 1; }

.btn-primary {
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  color: var(--orbit-deep);
  box-shadow: 0 4px 20px rgba(255,209,102,0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(255,209,102,0.5);
}

.btn-secondary {
  background: var(--soft-fill);
  border: 1px solid var(--glass-border);
  color: var(--text-primary);
}

.btn-secondary:hover {
  border-color: var(--gold);
  color: var(--gold);
  background: rgba(255,209,102,0.08);
}

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

.btn-outline-gold:hover {
  background: var(--gold);
  color: var(--orbit-deep);
}

.btn-danger {
  background: linear-gradient(135deg, var(--accent-red), #b91c1c);
  color: white;
}

.btn-success {
  background: linear-gradient(135deg, var(--accent-green), #059669);
  color: var(--orbit-deep);
}

.btn-sm {
  padding: 8px 16px;
  font-size: 0.79rem;
}

.btn-lg {
  padding: 15px 36px;
  font-size: 0.95rem;
  border-radius: var(--radius);
}

.btn-full { width: 100%; }

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

/* ===========================
   FORMS
   =========================== */
.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 8px;
  letter-spacing: 0.015em;
}

.form-label .required { color: var(--accent-red); margin-left: 2px; }

.form-input {
  width: 100%;
  padding: 12px 16px;
  background: var(--field-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.92rem;
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: 0;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.03);
  transition: border-color var(--trans-fast), box-shadow var(--trans-fast), background var(--trans-fast);
}

.form-input:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(255,209,102,0.1);
}

.form-input::placeholder { color: var(--text-muted); }

.form-input.error {
  border-color: var(--accent-red);
  box-shadow: 0 0 0 3px rgba(239,35,60,0.1);
}

.form-error {
  font-size: 0.8rem;
  color: var(--accent-red);
  margin-top: 4px;
}

.form-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 4px;
}

select.form-input option {
  background: var(--surface-solid);
  color: var(--text-primary);
}

/* ===========================
   NAVIGATION
   =========================== */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  padding: 16px 0;
  transition: background var(--trans), backdrop-filter var(--trans);
}

.navbar.scrolled {
  background: var(--surface-solid);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--glass-border);
  box-shadow: 0 16px 44px rgba(0,0,0,0.16);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
}

.nav-logo {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: -0.045em;
  background: linear-gradient(135deg, var(--gold), var(--accent-cyan));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  cursor: pointer;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 32px;
  list-style: none;
}

.nav-links a {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text-secondary);
  transition: color var(--trans-fast);
}

.nav-links a:hover { color: var(--gold); }

.nav-actions { display: flex; gap: 12px; align-items: center; }

#theme-dock {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 1100;
}

.theme-dock-shell {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border-radius: 999px;
  background: var(--toggle-shell);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-card);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.theme-option {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 92px;
  justify-content: center;
  padding: 10px 14px;
  border-radius: 999px;
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 700;
  transition: all var(--trans-fast);
}

.theme-option:hover {
  color: var(--text-primary);
  background: var(--soft-fill);
}

.theme-option.active {
  background: linear-gradient(135deg, rgba(255,209,102,0.22), rgba(0,212,255,0.14));
  color: var(--text-primary);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.06);
}

.theme-option-icon {
  font-size: 0.92rem;
  line-height: 1;
}

.nav-hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: transparent;
  padding: 4px;
}

.nav-hamburger span {
  width: 24px; height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: all var(--trans-fast);
}

/* ===========================
   SECTION HEADINGS
   =========================== */
.section-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,209,102,0.1);
  border: 1px solid rgba(255,209,102,0.3);
  color: var(--gold);
  padding: 4px 14px;
  border-radius: 100px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 16px;
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(1.96rem, 3.8vw, 3.12rem);
  font-weight: 800;
  line-height: 0.98;
  letter-spacing: -0.065em;
}

.section-title .highlight {
  background: linear-gradient(135deg, var(--gold), var(--accent-cyan));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.section-subtitle {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.5;
  max-width: 520px;
}

/* ===========================
   BADGES & CHIPS
   =========================== */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 100px;
  font-size: 0.72rem;
  font-weight: 700;
}

.badge-gold { background: rgba(255,209,102,0.15); color: var(--gold); }
.badge-green { background: rgba(6,214,160,0.15); color: var(--accent-green); }
.badge-red { background: rgba(239,35,60,0.15); color: var(--accent-red); }
.badge-cyan { background: rgba(0,212,255,0.15); color: var(--accent-cyan); }
.badge-purple { background: rgba(123,47,190,0.15); color: #B87FFF; }

/* ===========================
   TABLES
   =========================== */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius);
  border: 1px solid var(--glass-border);
  background: var(--surface-1);
}

table {
  width: 100%;
  border-collapse: collapse;
}

thead tr {
  background: rgba(255,209,102,0.08);
}

th {
  padding: 14px 20px;
  text-align: left;
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-secondary);
  white-space: nowrap;
}

td {
  padding: 14px 20px;
  font-size: 0.84rem;
  border-top: 1px solid var(--line-soft);
}

tbody tr {
  transition: background var(--trans-fast);
}

tbody tr:hover {
  background: var(--surface-3);
}

/* ===========================
   ALERTS / TOASTS
   =========================== */
#toast-container {
  position: fixed;
  top: 80px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 380px;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px 20px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  border-left: 3px solid;
  box-shadow: var(--shadow-card);
  animation: slideInRight 0.3s ease, fadeOut 0.3s ease 3.7s forwards;
  cursor: pointer;
}

.toast-success { border-color: var(--accent-green); }
.toast-error { border-color: var(--accent-red); }
.toast-warning { border-color: var(--gold); }
.toast-info { border-color: var(--accent-cyan); }

.toast-icon { font-size: 1.1rem; margin-top: 1px; }
.toast-title { font-weight: 700; font-size: 0.88rem; margin-bottom: 2px; letter-spacing: -0.01em; }
.toast-msg { font-size: 0.8rem; color: var(--text-secondary); line-height: 1.45; }

@keyframes slideInRight {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

@keyframes fadeOut {
  to { opacity: 0; transform: translateX(20px); }
}

/* ===========================
   MODAL
   =========================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(8px);
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.2s ease;
}

.modal-overlay.open {
  display: flex;
}

.modal {
  background: var(--surface-2);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5), var(--shadow-gold);
  animation: scaleIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 28px 0;
}

.modal-title {
  font-family: var(--font-display);
  font-size: 1.18rem;
  font-weight: 700;
  letter-spacing: -0.04em;
}

.modal-close {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: rgba(255,255,255,0.06);
  color: var(--text-secondary);
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--trans-fast);
}

.modal-close:hover {
  background: rgba(239,35,60,0.15);
  color: var(--accent-red);
}

.modal-body { padding: 24px 28px; }

.modal-footer {
  padding: 0 28px 24px;
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

@keyframes scaleIn {
  from { transform: scale(0.92); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ===========================
   LOADER
   =========================== */
.loader {
  width: 40px; height: 40px;
  border: 3px solid rgba(255,209,102,0.2);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.loader-sm {
  width: 20px; height: 20px;
  border-width: 2px;
}

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

.page-loader {
  position: fixed;
  inset: 0;
  background: var(--page-bg);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  transition: opacity 0.3s ease;
}

.page-loader.hidden {
  opacity: 0;
  pointer-events: none;
}

/* ===========================
   SIDEBAR (Admin & User)
   =========================== */
.app-layout {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 260px;
  background: var(--surface-solid);
  border-right: 1px solid var(--glass-border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
  transition: transform var(--trans);
  overflow-y: auto;
}

.sidebar-logo {
  padding: 24px 20px;
  font-family: var(--font-display);
  font-size: 1.28rem;
  font-weight: 800;
  letter-spacing: -0.045em;
  background: linear-gradient(135deg, var(--gold), var(--accent-cyan));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  border-bottom: 1px solid var(--glass-border);
}

.sidebar-nav {
  flex: 1;
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.87rem;
  font-weight: 600;
  color: var(--text-secondary);
  transition: all var(--trans-fast);
  cursor: pointer;
}

.nav-item:hover {
  background: var(--soft-fill);
  color: var(--text-primary);
}

.nav-item.active {
  background: rgba(255,209,102,0.1);
  color: var(--gold);
  border-left: 3px solid var(--gold);
}

.nav-item .nav-icon {
  width: 20px;
  text-align: center;
  font-size: 1rem;
}

.nav-section-label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 16px 16px 4px;
}

.sidebar-footer {
  padding: 16px 12px;
  border-top: 1px solid var(--glass-border);
}

.admin-layout {
  display: flex;
  min-height: 100vh;
  position: relative;
}
.main-content {
  flex: 1;
  margin-left: 260px;
  min-height: 100vh;
  background: transparent;
  width: calc(100% - 260px);
  overflow-x: hidden;
}

.topbar {
  position: sticky;
  top: 0;
  background: var(--surface-solid);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--glass-border);
  padding: 14px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 50;
  box-shadow: 0 12px 30px rgba(0,0,0,0.08);
}

.topbar-title {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.035em;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.content-area { padding: 32px; }

/* ===========================
   STATS CARDS
   =========================== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px;
  margin-bottom: 32px;
}

.stat-card {
  padding: 24px;
  background: linear-gradient(180deg, var(--glass-bg), rgba(255,255,255,0.02));
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-card);
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--accent-color, var(--gold));
}

.stat-icon {
  width: 44px; height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  margin-bottom: 16px;
  background: rgba(255,209,102,0.1);
}

.stat-value {
  font-family: var(--font-display);
  font-size: 1.76rem;
  font-weight: 800;
  line-height: 1;
  margin-bottom: 4px;
  letter-spacing: -0.055em;
  font-variant-numeric: tabular-nums lining-nums;
}

.stat-label {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.stat-change {
  font-size: 0.8rem;
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.stat-change.up { color: var(--accent-green); }
.stat-change.down { color: var(--accent-red); }

/* ===========================
   PLAN CARDS
   =========================== */
.plan-card {
  position: relative;
  padding: 28px;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, rgba(255,209,102,0.08), rgba(0,212,255,0.04));
  border: 1px solid rgba(255,209,102,0.2);
  overflow: hidden;
  transition: all var(--trans);
}

.plan-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, transparent 60%, rgba(255,209,102,0.05));
  pointer-events: none;
}

.plan-card:hover {
  border-color: var(--gold);
  transform: translateY(-4px);
  box-shadow: 0 20px 60px rgba(0,0,0,0.3), 0 0 40px rgba(255,209,102,0.1);
}

/* ===========================
   KYC STEPS
   =========================== */
.kyc-steps {
  display: flex;
  align-items: center;
  gap: 0;
  margin-bottom: 40px;
  overflow-x: auto;
}

.kyc-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  min-width: 100px;
}

.kyc-step-num {
  width: 40px; height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.9rem;
  background: rgba(255,255,255,0.05);
  border: 2px solid rgba(255,255,255,0.1);
  color: var(--text-muted);
  transition: all var(--trans);
}

.kyc-step.active .kyc-step-num {
  background: var(--gold);
  border-color: var(--gold);
  color: var(--orbit-deep);
}

.kyc-step.done .kyc-step-num {
  background: var(--accent-green);
  border-color: var(--accent-green);
  color: white;
}

.kyc-step-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  text-align: center;
}

.kyc-step.active .kyc-step-label { color: var(--gold); }
.kyc-step.done .kyc-step-label { color: var(--accent-green); }

.kyc-connector {
  flex: 1;
  height: 2px;
  background: rgba(255,255,255,0.08);
  margin-top: -20px;
  min-width: 40px;
}

.kyc-connector.done { background: var(--accent-green); }

/* ===========================
   TOGGLE SWITCH
   =========================== */
.toggle-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.toggle-switch {
  position: relative;
  width: 44px;
  height: 24px;
  cursor: pointer;
}

.toggle-switch input {
  opacity: 0;
  width: 0; height: 0;
  position: absolute;
}

.toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--surface-3);
  border-radius: 100px;
  transition: all var(--trans);
}

.toggle-slider::before {
  content: '';
  position: absolute;
  width: 18px; height: 18px;
  background: white;
  border-radius: 50%;
  top: 3px; left: 3px;
  transition: transform var(--trans);
}

.toggle-switch input:checked + .toggle-slider {
  background: var(--gold);
}

.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(20px);
}

/* ===========================
   AVATAR
   =========================== */
.avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold), var(--accent-cyan));
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--orbit-deep);
  flex-shrink: 0;
  overflow: hidden;
}

.avatar img {
  width: 100%; height: 100%;
  object-fit: cover;
}

/* ===========================
   LIVE CAMERA / KYC
   =========================== */
.camera-box {
  width: 100%;
  aspect-ratio: 4/3;
  background: #000;
  border-radius: var(--radius);
  overflow: hidden;
  position: relative;
  border: 2px solid var(--glass-border);
}

.camera-box video, .camera-box canvas {
  width: 100%; height: 100%;
  object-fit: cover;
}

.camera-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.camera-frame {
  width: 200px; height: 200px;
  border: 3px solid var(--gold);
  border-radius: 12px;
  box-shadow: 0 0 0 9999px rgba(0,0,0,0.5);
  position: relative;
}

.camera-frame::before, .camera-frame::after {
  content: '';
  position: absolute;
  width: 24px; height: 24px;
  border-color: var(--gold);
  border-style: solid;
}

.camera-frame::before {
  top: -3px; left: -3px;
  border-width: 4px 0 0 4px;
  border-radius: 4px 0 0 0;
}

.camera-frame::after {
  bottom: -3px; right: -3px;
  border-width: 0 4px 4px 0;
  border-radius: 0 0 4px 0;
}

/* ===========================
   PLAN TOGGLE (Dark/White)
   =========================== */
.plan-toggle-bar {
  display: inline-flex;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--glass-border);
  border-radius: 100px;
  padding: 4px;
  margin-bottom: 40px;
}

.plan-toggle-btn {
  padding: 8px 24px;
  border-radius: 100px;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-secondary);
  background: transparent;
  transition: all var(--trans);
}

.plan-toggle-btn.active {
  background: var(--gold);
  color: var(--orbit-deep);
  box-shadow: 0 4px 16px rgba(255,209,102,0.3);
}

/* ===========================
   UPLOAD ZONE
   =========================== */
.upload-zone {
  border: 2px dashed rgba(255,209,102,0.3);
  border-radius: var(--radius);
  padding: 32px;
  text-align: center;
  cursor: pointer;
  transition: all var(--trans);
  background: var(--soft-fill);
}

.upload-zone:hover, .upload-zone.drag-over {
  border-color: var(--gold);
  background: rgba(255,209,102,0.05);
}

.upload-zone .upload-icon {
  font-size: 2.5rem;
  margin-bottom: 12px;
  opacity: 0.6;
}

.upload-preview {
  position: relative;
  display: inline-block;
}

.upload-preview img {
  width: 120px; height: 120px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 2px solid var(--glass-border);
}

.upload-preview .remove-btn {
  position: absolute;
  top: -8px; right: -8px;
  width: 24px; height: 24px;
  border-radius: 50%;
  background: var(--accent-red);
  color: white;
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ===========================
   NOTIFICATION BELL
   =========================== */
.notif-bell {
  position: relative;
  cursor: pointer;
}

.notif-badge {
  position: absolute;
  top: -4px; right: -4px;
  width: 18px; height: 18px;
  background: var(--accent-red);
  border-radius: 50%;
  font-size: 0.65rem;
  font-weight: 700;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ===========================
   RESPONSIVE
   =========================== */
@media (max-width: 1024px) {
  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .main-content {
    margin-left: 0;
  }

  .nav-hamburger {
    display: flex;
  }
}

@media (max-width: 768px) {
  .nav-links { display: none; }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .content-area { padding: 20px; }

  .modal { border-radius: var(--radius); }
}

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

  .container { padding: 0 16px; }
}

.hero-grid {
  position: relative;
}

.hero-content {
  max-width: 620px;
}

.hero-actions {
  align-items: center;
}

.hero-stat {
  background: linear-gradient(180deg, var(--surface-1), rgba(255,255,255,0.02));
}

.hero-ticker {
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.auth-shell {
  isolation: isolate;
}

.auth-card {
  background: linear-gradient(180deg, var(--surface-1), rgba(255,255,255,0.02));
}

:root[data-theme='light'] .orb {
  opacity: 0.11;
  filter: blur(96px);
}

:root[data-theme='light'] .hero-ticker,
:root[data-theme='light'] .stat-pill,
:root[data-theme='light'] .card,
:root[data-theme='light'] .stat-card,
:root[data-theme='light'] .plan-card,
:root[data-theme='light'] .auth-card {
  box-shadow: var(--shadow-card);
}

:root[data-theme='light'] .badge-gold {
  background: rgba(255,209,102,0.2);
  color: #8a6500;
}

:root[data-theme='light'] .nav-item.active,
:root[data-theme='light'] .section-tag {
  color: #8a6500;
}

:root[data-theme='light'] .hero-ticker,
:root[data-theme='light'] [style*="background:rgba(255,255,255,0.03)"],
:root[data-theme='light'] [style*="background:rgba(255,255,255,0.04)"] {
  background: rgba(255,255,255,0.72) !important;
}

:root[data-theme='light'] [style*="background:rgba(255,255,255,0.01)"],
:root[data-theme='light'] [style*="background:rgba(255,255,255,0.02)"] {
  background: rgba(255,255,255,0.52) !important;
}

:root[data-theme='light'] [style*="border-bottom:1px solid var(--glass-border)"],
:root[data-theme='light'] [style*="border-top:1px solid var(--glass-border)"] {
  border-color: var(--glass-border) !important;
}

@media (max-width: 960px) {
  #theme-dock {
    top: auto;
    bottom: 18px;
    right: 14px;
    left: 14px;
    display: flex;
    justify-content: center;
  }

  .theme-dock-shell {
    width: min(100%, 320px);
    justify-content: space-between;
  }

  .theme-option {
    flex: 1;
    min-width: 0;
  }
}

/* ===========================
   SCROLLBAR
   =========================== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: rgba(255,209,102,0.2);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(255,209,102,0.4);
}

/* ===========================
   UTILITIES
   =========================== */
.hidden { display: none !important; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-4 { gap: 4px; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.gap-20 { gap: 20px; }
.gap-24 { gap: 24px; }
.w-full { width: 100%; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-gold { color: var(--gold); }
.text-green { color: var(--accent-green); }
.text-red { color: var(--accent-red); }
.text-cyan { color: var(--accent-cyan); }
.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.font-display { font-family: var(--font-display); }
.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.text-sm { font-size: 0.85rem; }
.text-xs { font-size: 0.75rem; }
.text-lg { font-size: 1.1rem; }
.text-xl { font-size: 1.25rem; }
.text-2xl { font-size: 1.5rem; }
.mt-4 { margin-top: 4px; }
.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-20 { margin-top: 20px; }
.mt-24 { margin-top: 24px; }
.mt-32 { margin-top: 32px; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.mb-32 { margin-bottom: 32px; }
.p-16 { padding: 16px; }
.p-24 { padding: 24px; }
.p-32 { padding: 32px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }

@media (max-width: 768px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
}

/* 3D Card Hover */
.card-3d-hover {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card-3d-hover:hover {
  transform: perspective(800px) rotateX(2deg) rotateY(-2deg) translateY(-4px);
  box-shadow: 12px 20px 40px rgba(0,0,0,0.4), var(--shadow-gold);
}

/* Shimmer loading */
.shimmer {
  background: linear-gradient(90deg,
    rgba(255,255,255,0.04) 25%,
    rgba(255,255,255,0.08) 50%,
    rgba(255,255,255,0.04) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
  to { background-position: -200% 0; }
}

/* ===========================
   PATCH v2.1 — Fixes
   =========================== */

/* Light mode — premium clean look */
:root[data-theme='light'] {
  --page-bg: #F8FAFC;
  --page-bg-accent:
    radial-gradient(circle at top right, rgba(255,209,102,0.12), transparent 30%),
    radial-gradient(circle at left bottom, rgba(59,130,246,0.06), transparent 26%),
    linear-gradient(180deg, rgba(255,255,255,0.8), transparent 44%);
  --surface-1: rgba(255,255,255,0.95);
  --surface-2: rgba(255,255,255,1);
  --surface-3: rgba(15,23,42,0.02);
  --surface-solid: rgba(248,250,252,0.98);
  --field-bg: rgba(255,255,255,1);
  --soft-fill: rgba(15,23,42,0.02);
  --line-soft: rgba(15,23,42,0.06);
  --glass-bg: rgba(255,255,255,0.9);
  --glass-border: rgba(226,232,240,0.8);
  --text-primary: #0F172A;
  --text-secondary: #64748B;
  --text-muted: #94A3B8;
  --accent-cyan: #2563EB;
  --accent-green: #059669;
  --accent-red: #DC2626;
  --shadow-gold: 0 8px 32px rgba(217,119,6,0.15);
  --shadow-card: 0 2px 16px rgba(15,23,42,0.06);
  --toggle-shell: rgba(255,255,255,0.96);
}

/* CTA section overflow fix */
.container { overflow: visible; }
section > .container { overflow: visible; }

/* Mobile overflow global fix */
@media (max-width: 768px) {

  .container {
    padding-left: 20px !important;
    padding-right: 20px !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box;
  }
}

/* CTA Section Fix */
#app > section:last-of-type .container > div,
#app > section .container > div[style*="linear-gradient"] {
  margin-left: auto !important;
  margin-right: auto !important;
  box-sizing: border-box !important;
}

@media (max-width: 1024px) {
  #app > section .container > div[style*="linear-gradient"] {
    padding: 60px 28px !important;
  }
}

@media (max-width: 768px) {
  #app > section .container > div[style*="linear-gradient"] {
    padding: 52px 24px !important;
    margin: 0 !important;
    border-radius: 16px !important;
  }
  #app > section .container > div[style*="linear-gradient"] p,
  #app > section .container > div[style*="linear-gradient"] h2 {
    text-align: center !important;
  }
}

/* Global body overflow fix */
body { overflow-x: clip; }
#app { width: 100%; }
#app:has(.sidebar) { display: flex; min-height: 100vh; }

/* Dark Mode — Midnight Navy (Theme B) */
:root[data-theme='dark'] {
  --gold: #A78BFA;
  --gold-light: #C4B5FD;
  --gold-dark: #7C3AED;
  --orbit-blue: #0F172A;
  --orbit-navy: #1E1B4B;
  --orbit-deep: #0D1117;
  --accent-cyan: #34D399;
  --accent-purple: #7C3AED;
  --accent-green: #10B981;
  --page-bg: #0D1117;
  --page-bg-accent:
    radial-gradient(circle at top right, rgba(139,92,246,0.14), transparent 30%),
    radial-gradient(circle at left bottom, rgba(16,185,129,0.08), transparent 28%),
    linear-gradient(180deg, rgba(15,23,42,0.5), transparent 40%);
  --surface-1: rgba(30,27,75,0.6);
  --surface-2: rgba(15,23,42,0.9);
  --surface-3: rgba(139,92,246,0.04);
  --surface-solid: rgba(13,17,23,0.95);
  --glass-bg: rgba(30,27,75,0.3);
  --glass-border: rgba(139,92,246,0.2);
  --text-primary: #F8FAFC;
  --text-secondary: #94A3B8;
  --text-muted: #475569;
  --shadow-gold: 0 0 40px rgba(139,92,246,0.15);
  --shadow-card: 0 8px 32px rgba(0,0,0,0.4);
  --shadow-glow: 0 0 60px rgba(16,185,129,0.08);
}

/* ===========================
   THEME FINAL — Dark + Light
   =========================== */

/* Remove old 3D orb backgrounds */
.bg-orbs { display: none !important; }
.bg-grid { display: none !important; }
.orb { display: none !important; }

/* Dark Mode — Midnight Navy */
:root, :root[data-theme='dark'] {
  --page-bg: #080C14;
  --page-bg-accent: none;
  --surface-1: rgba(20,16,50,0.7);
  --surface-2: rgba(15,23,42,0.92);
  --surface-solid: rgba(8,12,20,0.97);
  --glass-bg: rgba(30,27,75,0.35);
  --glass-border: rgba(139,92,246,0.18);
  --text-primary: #F8FAFC;
  --text-secondary: #94A3B8;
  --text-muted: #475569;
  --gold: #A78BFA;
  --gold-light: #C4B5FD;
  --gold-dark: #7C3AED;
  --accent-cyan: #34D399;
  --accent-green: #10B981;
  --accent-purple: #7C3AED;
  --shadow-card: 0 8px 32px rgba(0,0,0,0.5);
  --shadow-gold: 0 0 40px rgba(139,92,246,0.2);
}

/* Light Mode — Clean White + Blue */
:root[data-theme='light'] {
  --page-bg: #F0F4FF;
  --page-bg-accent: none;
  --surface-1: rgba(255,255,255,0.92);
  --surface-2: rgba(255,255,255,0.98);
  --surface-solid: rgba(248,250,252,0.98);
  --glass-bg: rgba(255,255,255,0.88);
  --glass-border: rgba(29,78,216,0.12);
  --text-primary: #0F172A;
  --text-secondary: #64748B;
  --text-muted: #94A3B8;
  --gold: #FFD166;
  --gold-light: #FFE5A0;
  --gold-dark: #D97706;
  --accent-cyan: #1D4ED8;
  --accent-green: #059669;
  --accent-purple: #4F46E5;
  --shadow-card: 0 4px 20px rgba(15,23,42,0.08);
  --shadow-gold: 0 8px 32px rgba(255,209,102,0.2);
}

/* Particle canvas behind everything */
#tro-particles {
  position: fixed !important;
  inset: 0 !important;
  z-index: 0 !important;
  pointer-events: none !important;
}

/* All sections above particles */
#app > * { position: relative; z-index: 1; }
nav.navbar { z-index: 100 !important; }

/* Card borders match theme */
:root[data-theme='light'] .card {
  background: rgba(255,255,255,0.88) !important;
  border-color: rgba(29,78,216,0.1) !important;
  box-shadow: 0 2px 16px rgba(15,23,42,0.06) !important;
}

:root[data-theme='light'] .plan-card {
  background: rgba(255,255,255,0.92) !important;
  border-color: rgba(29,78,216,0.12) !important;
}

/* Highlight color per theme */
:root[data-theme='light'] .highlight {
  color: #1D4ED8 !important;
  -webkit-text-fill-color: #1D4ED8 !important;
  background: none !important;
}

/* Navbar light mode */
:root[data-theme='light'] .navbar {
  background: rgba(240,244,255,0.92) !important;
  border-bottom: 1px solid rgba(29,78,216,0.08) !important;
}

/* Section tag light */
:root[data-theme='light'] .section-tag {
  background: rgba(29,78,216,0.07) !important;
  border-color: rgba(29,78,216,0.15) !important;
  color: #1D4ED8 !important;
}

/* Buttons light */
:root[data-theme='light'] .btn-primary {
  background: #FFD166 !important;
  color: #0F172A !important;
  border: none !important;
}

:root[data-theme='light'] .btn-secondary {
  background: white !important;
  color: #0F172A !important;
  border: 1px solid rgba(15,23,42,0.12) !important;
}

/* Force all content above particles */
#app { position: relative; z-index: 1; }
#app > * { position: relative; z-index: 1; }
#tro-particles { z-index: 0 !important; }
body { background: var(--page-bg) !important; }


/* ===== ADMIN LAYOUT — CLEAN FINAL ===== */

/* When sidebar present, make app flex */
#app:has(.sidebar) {
  display: flex !important;
  min-height: 100vh;
  position: relative;
}

/* Sidebar */
.sidebar {
  width: 260px !important;
  min-width: 260px !important;
  flex-shrink: 0;
  position: fixed !important;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 200;
  overflow-y: auto;
}

/* Main content - always push right of sidebar */
.main-content {
  margin-left: 260px !important;
  flex: 1;
  min-width: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Topbar */
.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
}

/* Content area */
.content-area {
  flex: 1;
  padding: 28px 32px;
  max-width: 100%;
  overflow-x: hidden;
}

/* Stats grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 24px;
}

/* Table responsive */
.table-wrap {
  overflow-x: auto;
  width: 100%;
}

/* Mobile */
@media (max-width: 1024px) {
  .sidebar {
    transform: translateX(-100%) !important;
    transition: transform 0.3s ease !important;
  }
  .sidebar.open {
    transform: translateX(0) !important;
    box-shadow: 4px 0 32px rgba(0,0,0,0.5) !important;
  }
  .main-content {
    margin-left: 0 !important;
  }
  #sidebar-toggle {
    display: flex !important;
  }
  .content-area {
    padding: 20px 16px !important;
  }
  .stats-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}

@media (max-width: 480px) {
  .stats-grid {
    grid-template-columns: 1fr 1fr !important;
  }
}

/* ===== ADMIN MOBILE FINAL ===== */
@media (max-width: 1024px) {
  #app { display: block !important; }
  .sidebar {
    position: fixed !important;
    top: 0; left: 0; bottom: 0;
    width: 260px !important;
    transform: translateX(-100%) !important;
    z-index: 9999 !important;
    transition: transform 0.28s ease !important;
  }
  .sidebar.open {
    transform: translateX(0) !important;
    box-shadow: 6px 0 40px rgba(0,0,0,0.6) !important;
  }
  .main-content {
    margin-left: 0 !important;
    width: 100% !important;
  }
  #sidebar-toggle { display: flex !important; }
  .topbar { padding: 12px 16px !important; }
  .content-area { padding: 16px !important; }
  .stats-grid { grid-template-columns: 1fr 1fr !important; gap: 12px !important; }
  .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  table { min-width: 600px; }
}
@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr 1fr !important; }
  .card { padding: 16px !important; }
  .content-area { padding: 12px !important; }
}
