/* ===========================
   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-disabled'] {
  --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: clip;
  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 - PREMIUM ANIMATED
   =========================== */
.bg-grid {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}
.bg-grid::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,209,102,0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,209,102,0.045) 1px, transparent 1px);
  background-size: 72px 72px;
  animation: gridPulse 8s ease-in-out infinite alternate;
}
.bg-grid::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(0,212,255,0.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,212,255,0.018) 1px, transparent 1px);
  background-size: 360px 360px;
  animation: gridPulse 12s ease-in-out infinite alternate-reverse;
}
@keyframes gridPulse {
  0%   { opacity: 0.6; background-position: 0 0; }
  100% { opacity: 1;   background-position: 4px 4px; }
}
.bg-orbs {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}
.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 1;
  animation: orbFloat 30s infinite ease-in-out;
}
.orb-1 {
  width: 700px; height: 700px;
  background: radial-gradient(circle at 40% 40%, rgba(255,209,102,0.22), rgba(255,160,30,0.08) 60%, transparent 80%);
  top: -220px; right: -180px;
  animation-duration: 28s;
  animation-delay: 0s;
}
.orb-2 {
  width: 500px; height: 500px;
  background: radial-gradient(circle at 40% 40%, rgba(0,212,255,0.18), rgba(0,180,220,0.06) 60%, transparent 80%);
  bottom: -120px; left: -80px;
  animation-duration: 34s;
  animation-delay: -12s;
}
.orb-3 {
  width: 380px; height: 380px;
  background: radial-gradient(circle at 40% 40%, rgba(123,47,190,0.16), rgba(100,40,160,0.05) 60%, transparent 80%);
  top: 38%; left: 38%;
  animation-duration: 22s;
  animation-delay: -6s;
}
@keyframes orbFloat {
  0%   { transform: translate(0px, 0px)     scale(1);    filter: blur(90px); }
  20%  { transform: translate(30px, -20px)  scale(1.05); filter: blur(95px); }
  40%  { transform: translate(-15px, 30px)  scale(0.97); filter: blur(85px); }
  60%  { transform: translate(25px, 15px)   scale(1.08); filter: blur(100px); }
  80%  { transform: translate(-20px, -10px) scale(1.02); filter: blur(88px); }
  100% { transform: translate(0px, 0px)     scale(1);    filter: blur(90px); }
}
.bg-streaks {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}
.bg-streaks::before {
  content: '';
  position: absolute;
  top: 15%;
  left: -100%;
  width: 60%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,209,102,0.12), rgba(255,209,102,0.3), rgba(255,209,102,0.12), transparent);
  animation: streakMove 9s ease-in-out infinite;
}
.bg-streaks::after {
  content: '';
  position: absolute;
  top: 65%;
  left: -100%;
  width: 45%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(0,212,255,0.08), rgba(0,212,255,0.2), rgba(0,212,255,0.08), transparent);
  animation: streakMove 13s ease-in-out infinite;
  animation-delay: -4s;
}
@keyframes streakMove {
  0%   { left: -60%;  opacity: 0; }
  10%  { opacity: 1; }
  90%  { opacity: 1; }
  100% { left: 110%; opacity: 0; }
}
.bg-dots {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image: radial-gradient(circle, rgba(255,209,102,0.07) 1px, transparent 1px);
  background-size: 120px 120px;
  animation: dotsShift 25s linear infinite;
}
@keyframes dotsShift {
  0%   { background-position: 0 0; }
  100% { background-position: 120px 120px; }
}
.bg-corner-tl {
  position: fixed;
  top: 0; left: 0;
  width: 320px; height: 320px;
  pointer-events: none;
  z-index: 0;
  background: radial-gradient(circle at 0% 0%, rgba(255,209,102,0.08), transparent 70%);
  animation: cornerPulse 6s ease-in-out infinite alternate;
}
.bg-corner-br {
  position: fixed;
  bottom: 0; right: 0;
  width: 280px; height: 280px;
  pointer-events: none;
  z-index: 0;
  background: radial-gradient(circle at 100% 100%, rgba(0,212,255,0.08), transparent 70%);
  animation: cornerPulse 8s ease-in-out infinite alternate-reverse;
}
@keyframes cornerPulse {
  0%   { opacity: 0.5; transform: scale(1); }
  100% { opacity: 1;   transform: scale(1.2); }
}
@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: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.3);
  color: #ffffff;
  font-weight: 600;
}

.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: #111827;
}

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: #111827;
  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: #111827;
  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: 0;
  padding: 8px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 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: 8px 16px 4px;
}

.sidebar-footer {
  padding: 12px 12px;
  padding-bottom: calc(12px + env(safe-area-inset-bottom, 16px));
  border-top: 1px solid var(--glass-border);
  position: sticky;
  bottom: 0;
  background: var(--surface-solid);
  margin-top: auto;
}

.main-content {
  flex: 1;
  margin-left: 260px;
  min-height: 100vh;
  background: transparent;
}

.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(160px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.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-compact {
  border: 1px dashed rgba(255,209,102,0.3);
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.02);
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}

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

.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-disabled'] .orb {
  opacity: 0.11;
  filter: blur(96px);
}

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

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

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

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

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

:root[data-theme='light-disabled'] [style*="border-bottom:1px solid var(--glass-border)"],
:root[data-theme='light-disabled'] [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; }
}

/* ================================
   KYC – Real-time Processing Styles
   ================================ */

/* Processing rings */
.kyc-ring-outer {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 3px solid transparent;
  border-top-color: var(--gold);
  border-right-color: rgba(255,209,102,0.3);
  animation: kyc-spin 1.2s linear infinite;
}

.kyc-ring-inner {
  position: absolute;
  inset: 14px;
  border-radius: 50%;
  border: 2px solid transparent;
  border-top-color: var(--accent-cyan);
  border-left-color: rgba(0,212,255,0.3);
  animation: kyc-spin 0.8s linear infinite reverse;
}

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

/* Approved bounce */
@keyframes kyc-approved-bounce {
  0% { transform: scale(0.4); opacity: 0; }
  60% { transform: scale(1.15); }
  80% { transform: scale(0.95); }
  100% { transform: scale(1); opacity: 1; }
}

/* Confetti fall */
@keyframes confetti-fall {
  0% { transform: translateY(-10px) rotate(0deg); opacity: 1; }
  100% { transform: translateY(600px) rotate(720deg); opacity: 0; }
}

/* Liveness pulse dot */
@keyframes kyc-pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(1.6); }
}

/* Processing steps */
.proc-step {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: rgba(255,255,255,0.02);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  color: var(--text-secondary);
  transition: all 0.4s ease;
  border: 1px solid transparent;
}

.proc-step[style*="opacity:1"], .proc-step:not([style*="opacity:0.4"]) {
  color: var(--text-primary);
  border-color: rgba(6,214,160,0.15);
  background: rgba(6,214,160,0.04);
}

.proc-step-icon {
  font-size: 1rem;
  width: 20px;
  text-align: center;
  flex-shrink: 0;
}

/* OCR Scan Overlay */
#ocr-scan-overlay {
  border-radius: var(--radius);
}

/* Radar ring for OCR */
.kyc-radar-ring {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: 3px solid var(--gold);
  position: relative;
  animation: kyc-radar 1.5s ease-in-out infinite;
}

.kyc-radar-ring::after {
  content: '';
  position: absolute;
  inset: 8px;
  border-radius: 50%;
  border: 2px solid rgba(255,209,102,0.5);
  animation: kyc-radar 1.5s ease-in-out infinite 0.3s;
}

@keyframes kyc-radar {
  0% { transform: scale(0.8); opacity: 1; }
  100% { transform: scale(1.4); opacity: 0; }
}

/* Liveness step overlay */
#liveness-step-overlay {
  display: flex;
}

/* Stats grid – allow 6 cards wrap */
.stats-grid {
  flex-wrap: wrap;
}
#theme-dock { display:none !important; }

/* === STAT CARD REDESIGN === */
.stat-icon-box {
  width: 42px; height: 42px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 14px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}
.stat-card {
  position: relative;
  overflow: hidden;
}
.stat-card::before {
  content: '';
  position: absolute;
  top: -30px; right: -30px;
  width: 80px; height: 80px;
  border-radius: 50%;
  background: var(--accent-color, var(--gold));
  opacity: 0.05;
}
.stat-trend {
  font-size: 0.72rem;
  margin-top: 4px;
  opacity: 0.8;
}

/* === STAT ICON BOX === */
.stat-icon-box {
  width: 42px; height: 42px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 14px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}
.stat-card { position: relative; overflow: hidden; }
.stat-card::before {
  content: '';
  position: absolute;
  top: -30px; right: -30px;
  width: 80px; height: 80px;
  border-radius: 50%;
  background: var(--accent-color, var(--gold));
  opacity: 0.05;
}
.stat-trend { font-size: 0.72rem; margin-top: 4px; opacity: 0.8; }

/* ===========================
   MOBILE RESPONSIVE - GLOBAL FIXES
   =========================== */
@media (max-width: 640px) {
  /* Prevent any element from causing horizontal overflow */
  body, html {
    overflow-x: hidden;
    max-width: 100vw;
  }

  /* Stat cards / icon boxes - tighten padding on small phones */
  .stat-card {
    padding: 16px !important;
  }
  .stat-icon-box {
    width: 36px !important;
    height: 36px !important;
    margin-bottom: 10px !important;
  }
  .stat-value, .stat-value.text-gold {
    font-size: 1.5rem !important;
  }

  /* Cards generally - reduce side padding */
  .card {
    padding: 16px !important;
  }
  .content-area {
    padding: 14px !important;
  }

  /* Deposit modal + any fixed-position modal - fit within viewport */
  #deposit-modal > div,
  #blockchain-modal > div,
  #success-modal > div {
    max-width: 94vw !important;
    width: 94vw !important;
    max-height: 88vh !important;
    overflow-y: auto !important;
    border-radius: 18px !important;
  }
  #deposit-modal, #blockchain-modal, #success-modal {
    padding: 10px !important;
  }

  /* Inline padding reduction for hero/plan cards used in invest.js */
  .invest-hero-card, .plan-card {
    padding: 20px 16px !important;
  }

  /* Force any 2-3 column inline-style grids to stack on very small screens */
  [style*="grid-template-columns:repeat(3"],
  [style*="grid-template-columns: repeat(3"] {
    grid-template-columns: 1fr !important;
  }

  /* Wallet address / hash boxes - allow wrapping, shrink font */
  [id="dep-addr"], [id="wallet-addr"] {
    font-size: 0.68rem !important;
  }

  /* Buttons - full width by default on mobile inside cards */
  .btn-lg {
    padding: 13px !important;
    font-size: 0.88rem !important;
  }

  /* Reduce big display numbers that may overflow */
  [style*="font-size:2.6rem"],
  [style*="font-size:2.2rem"],
  [style*="font-size:2rem"] {
    font-size: 1.6rem !important;
  }
  [style*="font-size:3.4rem"] {
    font-size: 2.2rem !important;
  }
}

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

/* ===== MOBILE RESPONSIVE FIX ===== */
@media (max-width: 768px) {
  .app-layout { flex-direction: column; }
  .main-content { margin-left: 0 !important; width: 100% !important; }
  .sidebar { position: fixed; left: -280px; top: 0; height: 100vh; z-index: 1000; transition: left 0.3s ease; background: var(--surface-solid) !important; overflow-y: auto; }
  .sidebar.open { left: 0; }
  #sidebar-toggle { display: flex !important; }
  .content-area { padding: 12px !important; }
  .topbar { padding: 12px 16px !important; position: sticky; top: 0; z-index: 100; background: var(--bg-primary); }

  /* Stat cards - 2 column grid */
  .stats-grid {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 10px !important;
  }
  .stat-card {
    padding: 14px !important;
  }
  .stat-icon-box {
    width: 34px !important;
    height: 34px !important;
    margin-bottom: 10px !important;
  }
  .stat-value {
    font-size: 1.2rem !important;
  }
  .stat-label {
    font-size: 0.72rem !important;
  }
  .stat-trend {
    font-size: 0.68rem !important;
  }

  /* Wallet card */
  .dash-wallet-card {
    padding: 18px !important;
  }

  /* Cards */
  .card, .dash-card {
    border-radius: 14px !important;
    padding: 16px !important;
  }

  /* Invest page */
  .invest-wrap {
    padding: 0 !important;
    max-width: 100% !important;
  }

  /* Tables */
  .table-wrap {
    overflow-x: auto !important;
  }
  table {
    min-width: 500px !important;
  }

  /* Buttons */
  .btn-lg {
    padding: 12px 16px !important;
    font-size: 0.88rem !important;
  }

  /* Modal */
  .modal, .card[style*="max-width:500px"] {
    width: 95% !important;
    max-width: 95% !important;
    padding: 18px !important;
  }

  /* Dashboard pension/group cards */
  #pension-card, #group-card {
    padding: 0 !important;
  }

  /* Topbar title */
  .topbar-title {
    font-size: 1rem !important;
  }

  /* Hide sidebar overlay */
  .sidebar-overlay {
    display: none;
  }
  .sidebar.open ~ .main-content::before {
    content: '';
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 999;
  }
}

@media (max-width: 400px) {
  .stats-grid {
    grid-template-columns: 1fr 1fr !important;
    gap: 8px !important;
  }
  .stat-card {
    padding: 12px !important;
  }
  .stat-value {
    font-size: 1.1rem !important;
  }
  .content-area {
    padding: 10px !important;
  }
}

/* Fix 2fr 1fr grid on mobile */
@media (max-width: 768px) {
  div[style*="grid-template-columns:2fr 1fr"],
  div[style*="grid-template-columns: 2fr 1fr"] {
    grid-template-columns: 1fr !important;
  }
}

/* Community Progress Card Fix */
#group-card {
  padding: 20px !important;
}
#group-card > div:first-child > div:first-child {
  font-size: 0.72rem !important;
  font-weight: 700 !important;
  letter-spacing: 0.08em !important;
  text-transform: uppercase !important;
  color: var(--text-muted) !important;
}
:root[data-theme='light-disabled'] #group-card {
  background: #ffffff !important;
}

/* Group card solid background fix */
:root[data-theme='light-disabled'] #group-card,
:root[data-theme='light-disabled'] #pension-card {
  background: #ffffff !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}
