/* ============================================
   BC INVESTMENT GROUP — DESIGN SYSTEM
   Premium dark theme with glassmorphism
   ============================================ */

/* --- CSS Custom Properties --- */
:root {
  /* Colors */
  --bg-primary: #06080f;
  --bg-secondary: #0c1220;
  --bg-card: rgba(15, 23, 42, 0.7);
  --bg-card-hover: rgba(20, 30, 55, 0.8);
  --bg-glass: rgba(15, 23, 42, 0.5);
  --bg-input: rgba(15, 23, 42, 0.6);

  --border-color: rgba(99, 120, 255, 0.12);
  --border-glow: rgba(99, 120, 255, 0.3);

  --text-primary: #e8eaed;
  --text-secondary: #8b95a5;
  --text-muted: #5a6578;

  --accent-primary: #6378ff;
  --accent-primary-hover: #7b8dff;
  --accent-secondary: #00d4aa;
  --accent-warning: #ffaa2c;
  --accent-danger: #ff4d6a;
  --accent-info: #3abff8;

  --gradient-primary: linear-gradient(135deg, #6378ff 0%, #a855f7 100%);
  --gradient-success: linear-gradient(135deg, #00d4aa 0%, #00b894 100%);
  --gradient-danger: linear-gradient(135deg, #ff4d6a 0%, #ff2d55 100%);
  --gradient-warning: linear-gradient(135deg, #ffaa2c 0%, #ff8c00 100%);
  --gradient-card: linear-gradient(135deg, rgba(99, 120, 255, 0.05) 0%, rgba(168, 85, 247, 0.05) 100%);
  --gradient-bg: radial-gradient(ellipse at 20% 50%, rgba(99, 120, 255, 0.08) 0%, transparent 50%),
                 radial-gradient(ellipse at 80% 20%, rgba(168, 85, 247, 0.06) 0%, transparent 50%),
                 radial-gradient(ellipse at 50% 80%, rgba(0, 212, 170, 0.04) 0%, transparent 50%);

  /* Typography */
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-xs: 0.7rem;
  --font-sm: 0.8rem;
  --font-base: 0.9rem;
  --font-md: 1rem;
  --font-lg: 1.15rem;
  --font-xl: 1.4rem;
  --font-2xl: 1.8rem;
  --font-3xl: 2.4rem;

  /* Spacing */
  --space-xs: 0.35rem;
  --space-sm: 0.6rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;

  /* Border Radius */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.4);
  --shadow-glow: 0 0 30px rgba(99, 120, 255, 0.15);

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-base: 250ms ease;
  --transition-slow: 400ms ease;
}

/* Light Theme Variables */
.light-theme {
  --bg-primary: #f8fafc;
  --bg-secondary: #ffffff;
  --bg-card: rgba(255, 255, 255, 0.9);
  --bg-card-hover: rgba(255, 255, 255, 1);
  --bg-glass: rgba(255, 255, 255, 0.7);
  --bg-input: #ffffff;

  --border-color: rgba(99, 120, 255, 0.15);
  --border-glow: rgba(99, 120, 255, 0.4);

  --text-primary: #1e293b;
  --text-secondary: #475569;
  --text-muted: #64748b;

  --gradient-bg: radial-gradient(ellipse at 20% 50%, rgba(99, 120, 255, 0.05) 0%, transparent 50%),
                 radial-gradient(ellipse at 80% 20%, rgba(168, 85, 247, 0.04) 0%, transparent 50%),
                 radial-gradient(ellipse at 50% 80%, rgba(0, 212, 170, 0.03) 0%, transparent 50%);
}

/* --- Reset & Base --- */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-family);
  font-size: var(--font-base);
  color: var(--text-primary);
  background-color: var(--bg-primary);
  background-image: var(--gradient-bg);
  background-attachment: fixed;
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: var(--accent-primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--accent-primary-hover);
}

/* --- Scrollbar --- */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(99, 120, 255, 0.2);
  border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(99, 120, 255, 0.35);
}

/* ============================================
   NAVBAR
   ============================================ */

.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-xl);
  background: rgba(6, 8, 15, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-color);
  z-index: 1000;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  cursor: pointer;
}

.nav-logo {
  font-size: 1.6rem;
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}

.nav-title {
  font-size: var(--font-lg);
  font-weight: 700;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.02em;
}

.nav-title-short {
  display: none;
}


.nav-menu {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

.nav-link {
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-md);
  font-size: var(--font-sm);
  font-weight: 500;
  color: #8b95a5; /* Fixed light-ish color for dark navbar */
  cursor: pointer;
  transition: all var(--transition-fast);
  user-select: none;
}

.nav-link:hover {
  color: var(--text-primary);
  background: rgba(99, 120, 255, 0.08);
}

.nav-link.active {
  color: var(--accent-primary);
  background: rgba(99, 120, 255, 0.12);
}

.nav-user {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.nav-user-info {
  text-align: right;
}

.nav-user-name {
  font-size: var(--font-sm);
  font-weight: 600;
  color: #fff; /* Static white for readability on dark navbar */
}

.nav-user-role {
  font-size: var(--font-xs);
  color: rgba(255, 255, 255, 0.6); /* Semi-transparent white for secondary info */
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.nav-avatar {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: var(--gradient-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--font-sm);
  font-weight: 700;
  color: white;
  cursor: pointer;
}

/* ============================================
   MAIN CONTENT
   ============================================ */

.main-content {
  margin-top: 64px;
  min-height: calc(100vh - 64px);
  padding: var(--space-xl);
  max-width: 1400px;
  margin-left: auto;
  margin-right: auto;
  animation: fadeIn 0.4s ease;
}

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

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

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

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

/* ============================================
   LOGIN PAGE
   ============================================ */

.login-container {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 64px);
  padding: var(--space-xl);
}

.login-card {
  width: 100%;
  max-width: 420px;
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: var(--space-2xl);
  box-shadow: var(--shadow-lg), var(--shadow-glow);
  animation: scaleIn 0.5s ease;
}

.login-header {
  text-align: center;
  margin-bottom: var(--space-2xl);
}

.login-icon {
  font-size: 3rem;
  margin-bottom: var(--space-md);
  display: block;
  animation: float 3s ease-in-out infinite;
}

.login-header h1 {
  font-size: var(--font-2xl);
  font-weight: 800;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: var(--space-xs);
}

.login-header p {
  color: var(--text-secondary);
  font-size: var(--font-sm);
}

/* ============================================
   FORM ELEMENTS
   ============================================ */

.form-group {
  margin-bottom: var(--space-lg);
}

.form-label {
  display: block;
  font-size: var(--font-sm);
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: var(--space-xs);
}

.form-input {
  width: 100%;
  padding: 12px 16px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: var(--font-family);
  font-size: var(--font-base);
  transition: all var(--transition-fast);
  outline: none;
}

.form-input:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(99, 120, 255, 0.15);
}

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

.form-select {
  width: 100%;
  padding: 12px 16px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: var(--font-family);
  font-size: var(--font-base);
  transition: all var(--transition-fast);
  outline: none;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238b95a5' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
}

.form-select:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(99, 120, 255, 0.15);
}

.form-select option {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

textarea.form-input {
  min-height: 80px;
  resize: vertical;
}

.form-hint {
  font-size: var(--font-xs);
  color: var(--text-muted);
  margin-top: var(--space-xs);
}

/* ============================================
   BUTTONS
   ============================================ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: 10px 20px;
  border: none;
  border-radius: var(--radius-md);
  font-family: var(--font-family);
  font-size: var(--font-sm);
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
  outline: none;
  text-decoration: none;
  white-space: nowrap;
}

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

.btn-primary {
  background: var(--gradient-primary);
  color: white;
  box-shadow: 0 2px 12px rgba(99, 120, 255, 0.3);
}

.btn-primary:hover {
  box-shadow: 0 4px 20px rgba(99, 120, 255, 0.45);
  transform: translateY(-1px);
}

.btn-success {
  background: var(--gradient-success);
  color: white;
  box-shadow: 0 2px 12px rgba(0, 212, 170, 0.3);
}

.btn-success:hover {
  box-shadow: 0 4px 20px rgba(0, 212, 170, 0.45);
  transform: translateY(-1px);
}

.btn-danger {
  background: var(--gradient-danger);
  color: white;
  box-shadow: 0 2px 12px rgba(255, 77, 106, 0.3);
}

.btn-danger:hover {
  box-shadow: 0 4px 20px rgba(255, 77, 106, 0.45);
  transform: translateY(-1px);
}

.btn-warning {
  background: var(--gradient-warning);
  color: white;
  box-shadow: 0 2px 12px rgba(255, 170, 44, 0.3);
}

.btn-warning:hover {
  box-shadow: 0 4px 20px rgba(255, 170, 44, 0.45);
  transform: translateY(-1px);
}

.btn-outline {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
}

.btn-outline:hover {
  color: var(--text-primary);
  border-color: var(--border-glow);
  background: rgba(99, 120, 255, 0.06);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  padding: 8px 12px;
}

.btn-ghost:hover {
  color: var(--text-primary);
  background: rgba(99, 120, 255, 0.08);
}

.btn-sm {
  padding: 6px 12px;
  font-size: var(--font-xs);
  border-radius: var(--radius-sm);
}

.btn-lg {
  padding: 14px 28px;
  font-size: var(--font-md);
  border-radius: var(--radius-lg);
}

.btn-block {
  width: 100%;
}

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

.btn-group {
  display: flex;
  gap: var(--space-sm);
  flex-wrap: wrap;
}

/* ============================================
   CARDS
   ============================================ */

.card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  margin-bottom: var(--space-xl);
  transition: all var(--transition-base);
}

.card:hover {
  border-color: var(--border-glow);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-lg);
}

.card-title {
  font-size: var(--font-lg);
  font-weight: 700;
  color: var(--text-primary);
}

.card-subtitle {
  font-size: var(--font-sm);
  color: var(--text-secondary);
  margin-top: 2px;
}

/* ============================================
   STAT CARDS
   ============================================ */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--space-lg);
  margin-bottom: var(--space-xl);
}

.stat-card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  transition: all var(--transition-base);
}

/* --- Rich Chart UI --- */
.chart-header {
  margin-bottom: var(--space-lg);
}

.chart-subtitle {
  font-size: var(--font-xs);
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: var(--space-xs);
}

.chart-title-row {
  display: flex;
  align-items: baseline;
  gap: var(--space-xs);
  margin-bottom: 2px;
}

.chart-price-large {
  font-size: var(--font-3xl);
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.03em;
}

.chart-currency {
  font-size: var(--font-lg);
  font-weight: 600;
  color: var(--text-secondary);
}

.chart-change-row {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: var(--font-sm);
  font-weight: 600;
}

.chart-meta {
  font-size: var(--font-xs);
  color: var(--text-muted);
  margin-top: var(--space-sm);
}

.timeframe-picker {
  display: flex;
  gap: var(--space-lg);
  margin: var(--space-md) 0 var(--space-lg);
  border-bottom: 1px solid var(--border-color);
  padding-bottom: var(--space-xs);
  overflow-x: auto;
}

.time-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: var(--font-xs);
  font-weight: 700;
  padding: var(--space-xs) 0;
  cursor: pointer;
  white-space: nowrap;
  position: relative;
  transition: all var(--transition-fast);
}

.time-btn:hover {
  color: var(--text-primary);
}

.time-btn.active {
  color: var(--accent-primary);
}

.time-btn.active::after {
  content: '';
  position: absolute;
  bottom: -9px;
  left: 0;
  width: 100%;
  height: 3px;
  background: var(--accent-primary);
  border-radius: 2px;
}

.chart-container-rich {
  height: 350px;
  width: 100%;
  position: relative;
}
  background-image: var(--gradient-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  position: relative;
  overflow: hidden;
  transition: all var(--transition-base);
  animation: slideUp 0.5s ease backwards;
}

.stat-card:nth-child(1) { animation-delay: 0.05s; }
.stat-card:nth-child(2) { animation-delay: 0.1s; }
.stat-card:nth-child(3) { animation-delay: 0.15s; }
.stat-card:nth-child(4) { animation-delay: 0.2s; }

.stat-card:hover {
  border-color: var(--border-glow);
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow);
}

.stat-card::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 80px;
  height: 80px;
  border-radius: 0 0 0 80px;
  opacity: 0.06;
}

.stat-card.accent-blue::after { background: var(--accent-primary); }
.stat-card.accent-green::after { background: var(--accent-secondary); }
.stat-card.accent-orange::after { background: var(--accent-warning); }
.stat-card.accent-red::after { background: var(--accent-danger); }

.stat-icon {
  font-size: 1.5rem;
  margin-bottom: var(--space-sm);
}

.stat-value {
  font-size: var(--font-2xl);
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 2px;
  animation: countUp 0.6s ease backwards;
  animation-delay: 0.3s;
}

.stat-label {
  font-size: var(--font-xs);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 500;
}

/* ============================================
   BALANCE HERO CARD
   ============================================ */

.balance-hero {
  background: var(--gradient-primary);
  border-radius: var(--radius-xl);
  padding: var(--space-2xl);
  position: relative;
  overflow: hidden;
  margin-bottom: var(--space-xl);
  animation: scaleIn 0.5s ease;
}

.balance-hero::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
}

.balance-hero::after {
  content: '';
  position: absolute;
  bottom: -30%;
  left: -10%;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.04);
}

.balance-label {
  font-size: var(--font-sm);
  color: rgba(255, 255, 255, 0.7);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 500;
  margin-bottom: var(--space-xs);
}

.balance-amount {
  font-size: var(--font-3xl);
  font-weight: 800;
  color: white;
  margin-bottom: var(--space-lg);
  position: relative;
  z-index: 1;
}

.balance-actions {
  display: flex;
  gap: var(--space-md);
  position: relative;
  z-index: 1;
}

.balance-actions .btn {
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: white;
}

.balance-actions .btn:hover {
  background: rgba(255, 255, 255, 0.25);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

/* ============================================
   TABLES
   ============================================ */

.table-container {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--font-sm);
}

.table th {
  text-align: left;
  padding: 14px 16px;
  background: rgba(99, 120, 255, 0.05);
  color: var(--text-muted);
  font-weight: 600;
  font-size: var(--font-xs);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
  border-bottom: 1px solid var(--border-color);
}

.table td {
  padding: 12px 16px;
  border-bottom: 1px solid rgba(99, 120, 255, 0.06);
  color: var(--text-primary);
  white-space: nowrap;
}

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

.table tbody tr:hover {
  background: rgba(99, 120, 255, 0.04);
}

.table tbody tr:last-child td {
  border-bottom: none;
}

/* ============================================
   BADGES
   ============================================ */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: var(--font-xs);
  font-weight: 600;
  letter-spacing: 0.02em;
}

.badge-pending {
  background: rgba(255, 170, 44, 0.12);
  color: var(--accent-warning);
}

.badge-completed {
  background: rgba(0, 212, 170, 0.12);
  color: var(--accent-secondary);
}

.badge-approved {
  background: rgba(0, 212, 170, 0.12);
  color: var(--accent-secondary);
}

.badge-rejected {
  background: rgba(255, 77, 106, 0.12);
  color: var(--accent-danger);
}

.badge-active {
  background: rgba(0, 212, 170, 0.12);
  color: var(--accent-secondary);
}

.badge-suspended {
  background: rgba(255, 77, 106, 0.12);
  color: var(--accent-danger);
}

.badge-deposit {
  background: rgba(0, 212, 170, 0.12);
  color: var(--accent-secondary);
}

.badge-withdrawal {
  background: rgba(255, 77, 106, 0.12);
  color: var(--accent-danger);
}

.badge-adjustment {
  background: rgba(99, 120, 255, 0.12);
  color: var(--accent-primary);
}

.badge-admin {
  background: rgba(168, 85, 247, 0.12);
  color: #a855f7;
}

.badge-user {
  background: rgba(58, 191, 248, 0.12);
  color: var(--accent-info);
}

/* ============================================
   TABS
   ============================================ */

.tabs {
  display: flex;
  gap: 2px;
  margin-bottom: var(--space-xl);
  border-bottom: 1px solid var(--border-color);
  overflow-x: auto;
}

.tab {
  padding: 12px 20px;
  font-size: var(--font-sm);
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all var(--transition-fast);
  white-space: nowrap;
  user-select: none;
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
  font-family: var(--font-family);
}

.tab:hover {
  color: var(--text-secondary);
}

.tab.active {
  color: var(--accent-primary);
  border-bottom-color: var(--accent-primary);
}

.tab-content {
  animation: fadeIn 0.3s ease;
}

/* ============================================
   MODAL
   ============================================ */

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  padding: var(--space-xl);
}

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

.modal {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  animation: scaleIn 0.3s ease;
  box-shadow: var(--shadow-lg);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-lg) var(--space-xl);
  border-bottom: 1px solid var(--border-color);
}

.modal-title {
  font-size: var(--font-lg);
  font-weight: 700;
}

.modal-close {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 1.3rem;
  transition: all var(--transition-fast);
}

.modal-close:hover {
  background: rgba(255, 77, 106, 0.15);
  color: var(--accent-danger);
}

.modal-body {
  padding: var(--space-xl);
}

/* ============================================
   TOAST NOTIFICATIONS
   ============================================ */

.toast-container {
  position: fixed;
  top: 80px;
  right: 20px;
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  z-index: 3000;
  pointer-events: none;
}

.toast {
  padding: 14px 20px;
  border-radius: var(--radius-md);
  font-size: var(--font-sm);
  font-weight: 500;
  color: white;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: var(--shadow-md);
  animation: toastIn 0.4s ease;
  pointer-events: auto;
  max-width: 380px;
  border-left: 3px solid transparent;
}

.toast-success {
  background: rgba(0, 180, 148, 0.9);
  border-left-color: var(--accent-secondary);
}

.toast-error {
  background: rgba(220, 40, 70, 0.9);
  border-left-color: var(--accent-danger);
}

.toast-info {
  background: rgba(60, 100, 220, 0.9);
  border-left-color: var(--accent-primary);
}

.toast-warning {
  background: rgba(200, 140, 20, 0.9);
  border-left-color: var(--accent-warning);
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateX(40px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes toastOut {
  from {
    opacity: 1;
    transform: translateX(0);
  }
  to {
    opacity: 0;
    transform: translateX(40px);
  }
}

/* ============================================
   PAGE HEADER
   ============================================ */

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-xl);
  flex-wrap: wrap;
  gap: var(--space-md);
}

.page-title {
  font-size: var(--font-2xl);
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.page-subtitle {
  font-size: var(--font-sm);
  color: var(--text-secondary);
  margin-top: 2px;
}

/* ============================================
   FILTER BAR
   ============================================ */

.filter-bar {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
  flex-wrap: wrap;
}

.filter-bar .form-select,
.filter-bar .form-input {
  width: auto;
  min-width: 150px;
  padding: 8px 14px;
  font-size: var(--font-sm);
}

/* ============================================
   EMPTY STATE
   ============================================ */

.empty-state {
  text-align: center;
  padding: var(--space-2xl);
  color: var(--text-muted);
}

.empty-state-icon {
  font-size: 3rem;
  margin-bottom: var(--space-md);
  opacity: 0.5;
}

.empty-state-text {
  font-size: var(--font-base);
  color: var(--text-secondary);
}

/* ============================================
   LOADING
   ============================================ */

.loading-spinner {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-2xl);
}

.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--border-color);
  border-top-color: var(--accent-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* ============================================
   SECTION DIVIDER
   ============================================ */

.section-divider {
  height: 1px;
  background: var(--border-color);
  margin: var(--space-xl) 0;
}

/* ============================================
   AMOUNT DISPLAY
   ============================================ */

.amount-positive {
  color: var(--accent-secondary);
  font-weight: 600;
}

.amount-negative {
  color: var(--accent-danger);
  font-weight: 600;
}

.amount-neutral {
  color: var(--accent-primary);
  font-weight: 600;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 768px) {
  .navbar {
    padding: 0 var(--space-md);
    height: 56px;
  }

  .nav-title-full {
    display: none;
  }

  .nav-title-short {
    display: inline;
  }

  .nav-logo {
    font-size: 1.2rem;
  }

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

  .stat-card {
    padding: var(--space-md);
  }

  .stat-value {
    font-size: var(--font-lg);
  }

  .balance-hero {
    padding: var(--space-lg);
  }

  .balance-amount {
    font-size: var(--font-2xl);
  }

  .balance-actions {
    flex-direction: column;
  }

  .page-header {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-sm);
  }

  .page-title {
    font-size: var(--font-lg);
  }

  .nav-menu {
    display: none;
  }

  .nav-link {
    font-size: var(--font-sm);
    padding: var(--space-xs) var(--space-sm);
  }

  .main-content {
    padding: var(--space-md);
    padding-top: calc(56px + var(--space-md));
    padding-bottom: var(--space-xl);
  }

  .login-card {
    padding: var(--space-lg);
  }

  .tabs {
    gap: 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .tab {
    padding: 10px 14px;
    font-size: var(--font-xs);
    white-space: nowrap;
  }

  .filter-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .filter-bar .form-select,
  .filter-bar .form-input {
    width: 100%;
  }

  /* Modal — full width on mobile */
  .modal-overlay {
    padding: var(--space-sm);
    align-items: flex-end;
  }

  .modal {
    max-width: 100%;
    max-height: 85vh;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  }

  .modal-header {
    padding: var(--space-md) var(--space-lg);
  }

  .modal-title {
    font-size: var(--font-base);
  }

  .modal-body {
    padding: var(--space-md) var(--space-lg);
  }

  /* Detail modal mobile fixes */
  .detail-header {
    flex-wrap: wrap;
    gap: var(--space-sm);
  }

  .detail-header > div:last-child {
    margin-left: 0;
    width: 100%;
    margin-top: var(--space-xs);
  }

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

  .detail-actions {
    flex-direction: column;
  }

  .detail-actions .btn {
    min-width: unset;
    font-size: var(--font-xs);
  }

  .detail-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
  }

  .detail-value {
    text-align: left;
    max-width: 100%;
  }

  /* Buttons */
  .btn {
    font-size: var(--font-xs);
    padding: 10px 14px;
  }

  .btn-sm {
    padding: 6px 10px;
    font-size: 11px;
  }

  .btn-group {
    gap: var(--space-xs);
  }

  /* Table mobile */
  .table th, .table td {
    padding: 8px 10px;
    font-size: var(--font-xs);
  }

  .flex-between {
    flex-wrap: wrap;
    gap: var(--space-sm);
  }

  .card-header {
    flex-wrap: wrap;
    gap: var(--space-sm);
  }

  /* Invoice preview iframe */
  .invoice-iframe {
    height: 50vh;
  }
}

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

  .nav-title {
    max-width: 100px;
    font-size: 12px;
  }

  .detail-stats {
    grid-template-columns: 1fr 1fr;
  }

  .modal-overlay {
    padding: 0;
  }

  .modal {
    max-height: 90vh;
    border-radius: var(--radius-md) var(--radius-md) 0 0;
  }
}

/* ============================================
   UTILITY CLASSES
   ============================================ */

.text-center { text-align: center; }
.text-right { text-align: right; }
.mt-sm { margin-top: var(--space-sm); }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }
.mt-xl { margin-top: var(--space-xl); }
.mb-sm { margin-bottom: var(--space-sm); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }
.mb-xl { margin-bottom: var(--space-xl); }
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }
.hidden { display: none !important; }

/* ============================================
   PROFILE DROPDOWN
   ============================================ */

.profile-dropdown-container {
  position: relative;
}

.profile-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 8px 0;
  min-width: 200px;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: all 0.2s ease;
  z-index: 1500;
}

.profile-dropdown.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.profile-dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  font-size: var(--font-sm);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.profile-dropdown-item:hover {
  background: rgba(99, 120, 255, 0.08);
  color: var(--text-primary);
}

.profile-dropdown-item.text-danger:hover {
  background: rgba(255, 77, 106, 0.08);
  color: var(--accent-danger);
}

.profile-dropdown-divider {
  height: 1px;
  background: var(--border-color);
  margin: 6px 0;
}

/* ============================================
   LANGUAGE SWITCHER
   ============================================ */

.lang-switcher {
  position: relative;
  margin-right: var(--space-md);
}

.lang-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: rgba(99, 120, 255, 0.08);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  color: var(--text-secondary);
  font-family: var(--font-family);
  font-size: var(--font-xs);
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.lang-btn:hover {
  background: rgba(99, 120, 255, 0.15);
  border-color: var(--border-glow);
  color: var(--text-primary);
}

.lang-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 4px;
  min-width: 160px;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: all 0.2s ease;
  z-index: 1500;
}

.lang-dropdown.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* --- Theme Toggle --- */
.theme-toggle {
  cursor: pointer;
  user-select: none;
}

.theme-toggle-track {
  width: 54px;
  height: 28px;
  background: rgba(99, 120, 255, 0.1);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  position: relative;
  transition: all var(--transition-base);
}

.theme-toggle:hover .theme-toggle-track {
  border-color: var(--border-glow);
  background: rgba(99, 120, 255, 0.15);
}

.theme-toggle-thumb {
  width: 22px;
  height: 22px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 50%;
  position: absolute;
  top: 2px;
  left: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  transition: all var(--transition-base);
  box-shadow: var(--shadow-sm);
}

.light-theme .theme-toggle-thumb {
  transform: translateX(26px);
  background: #fff;
}

.light-theme .theme-toggle-track {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
}

.light-theme .theme-toggle-thumb {
  border-color: transparent;
}


.lang-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: var(--font-sm);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.lang-option:hover {
  background: rgba(99, 120, 255, 0.1);
  color: var(--text-primary);
}

.lang-option.active {
  background: rgba(99, 120, 255, 0.15);
  color: var(--accent-primary);
  font-weight: 600;
}

/* ============================================
   CLICKABLE ROWS
   ============================================ */

.clickable-row {
  cursor: pointer;
}

.clickable-row:hover {
  background: rgba(99, 120, 255, 0.08) !important;
}

/* ============================================
   DETAIL MODAL COMPONENTS
   ============================================ */

.detail-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
}

.detail-header {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding-bottom: var(--space-lg);
  border-bottom: 1px solid var(--border-color);
}

.detail-avatar {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-full);
  background: var(--gradient-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  font-size: var(--font-base);
  flex-shrink: 0;
}

.detail-name {
  font-size: var(--font-lg);
  font-weight: 700;
  color: var(--text-primary);
}

.detail-email {
  font-size: var(--font-sm);
  color: var(--text-muted);
}

.detail-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  gap: var(--space-md);
  padding: var(--space-md) 0;
  border-bottom: 1px solid var(--border-color);
}

.detail-stat {
  text-align: center;
}

.detail-stat-value {
  font-size: var(--font-lg);
  font-weight: 700;
  color: var(--text-primary);
}

.detail-stat-label {
  font-size: var(--font-xs);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-top: 2px;
}

.detail-info {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.detail-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid rgba(99, 120, 255, 0.06);
}

.detail-row:last-child {
  border-bottom: none;
}

.detail-label {
  font-size: var(--font-sm);
  color: var(--text-muted);
  font-weight: 500;
}

.detail-value {
  font-size: var(--font-sm);
  color: var(--text-primary);
  font-weight: 500;
  text-align: right;
  max-width: 60%;
  word-break: break-word;
}

.detail-section-title {
  font-size: var(--font-sm);
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.detail-actions {
  display: flex;
  gap: var(--space-sm);
  padding-top: var(--space-md);
  border-top: 1px solid var(--border-color);
  flex-wrap: wrap;
}

.detail-actions .btn {
  flex: 1;
  min-width: 100px;
}

.table-compact td,
.table-compact th {
  padding: 8px 12px;
  font-size: var(--font-xs);
}

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

/* Invoice iframe preview */
.invoice-iframe {
  width: 100%;
  height: 60vh;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: #fff;
}

/* Bitcoin chart widget */
.chart-container {
  width: 100%;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border-color);
  background: var(--bg-card);
}

.chart-container iframe {
  width: 100%;
  border: none;
}

/* ============================================
   LANDING PAGE
   ============================================ */
.landing-hero {
  text-align: center;
  padding: var(--space-2xl) 0;
  max-width: 800px;
  margin: 0 auto;
}

.landing-hero h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: var(--space-md);
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.landing-hero p {
  font-size: var(--font-lg);
  color: var(--text-secondary);
  margin-bottom: var(--space-xl);
}

.landing-benefits {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-lg);
  margin: var(--space-2xl) 0;
}

.benefit-card {
  background: var(--bg-card);
  padding: var(--space-xl);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  transition: all var(--transition-base);
}

.benefit-card:hover {
  transform: translateY(-5px);
  border-color: var(--border-glow);
  box-shadow: var(--shadow-md);
}

.benefit-icon {
  font-size: 2.5rem;
  margin-bottom: var(--space-md);
}

.benefit-card h3 {
  font-size: var(--font-lg);
  margin-bottom: var(--space-sm);
  color: var(--text-primary);
}

.landing-faq {
  max-width: 800px;
  margin: var(--space-2xl) auto;
}

.faq-item {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-md);
  padding: var(--space-md) var(--space-lg);
}

.faq-item h4 {
  margin-bottom: var(--space-xs);
  color: var(--accent-primary);
}

@media (max-width: 768px) {
  .landing-hero {
    padding: var(--space-xl) var(--space-md);
  }
}


/* ============================================
   ADMIN PORTAL & CARDS
   ============================================ */

.admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: var(--space-xl);
  margin-top: var(--space-lg);
}

.admin-card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: var(--space-xl);
  cursor: pointer;
  transition: all var(--transition-base);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.admin-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--gradient-primary);
  opacity: 0.6;
}

.admin-card:hover {
  transform: translateY(-8px) scale(1.02);
  border-color: var(--accent-primary);
  box-shadow: var(--shadow-lg), 0 0 25px rgba(99, 120, 255, 0.2);
  background: rgba(255, 255, 255, 0.08);
}

.admin-card:active {
  transform: translateY(-4px) scale(0.98);
  box-shadow: var(--shadow-md);
  transition: all 0.1s ease;
}

.admin-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.admin-card-name {
  font-size: var(--font-lg);
  font-weight: 800;
  color: #fff;
}

.admin-card-email {
  font-size: var(--font-xs);
  color: var(--text-muted);
  margin-top: 2px;
}

.admin-card-stats {
  display: flex;
  align-items: flex-end;
  gap: var(--space-sm);
  margin-top: var(--space-sm);
}

.admin-card-count {
  font-size: var(--font-3xl);
  font-weight: 800;
  color: var(--accent-primary);
  line-height: 1;
}

.admin-card-label {
  font-size: var(--font-xs);
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
  margin-bottom: 4px;
}

.admin-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
  padding-top: var(--space-md);
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.admin-card-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: var(--font-xs);
  font-weight: 700;
  text-transform: uppercase;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.status-dot.active { background: var(--accent-secondary); box-shadow: 0 0 10px var(--accent-secondary); }
.status-dot.inactive { background: var(--accent-danger); box-shadow: 0 0 10px var(--accent-danger); }

.portal-indicator {
  background: var(--gradient-warning);
  padding: var(--space-sm) var(--space-xl);
  margin-bottom: var(--space-lg);
  border-radius: var(--radius-lg);
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #fff;
  font-weight: 700;
  box-shadow: 0 4px 15px rgba(255, 170, 44, 0.3);
  animation: slideInDown 0.4s ease;
}

@keyframes slideInDown {
  from { transform: translateY(-20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.portal-text {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.portal-badge {
  background: rgba(255, 255, 255, 0.2);
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: var(--font-xs);
  text-transform: uppercase;
}

