/* ==========================================
   MODERN 2-TIER HEADER DESIGN
   ========================================== */

/* ===== WRAPPER ===== */
.modern-header-wrapper {
  margin: 10px auto 25px;
  max-width: 1300px;
}

/* ===== TIER 1: TOP BAR ===== */
.header-topbar {
  background: linear-gradient(135deg, 
    rgba(255, 255, 255, 0.95) 0%, 
    rgba(248, 250, 252, 0.95) 100%);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 20px 20px 0 0;
  box-shadow: 
    0 4px 20px rgba(0, 0, 0, 0.06),
    0 0 40px rgba(100, 149, 237, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);
  padding: 1rem 1.5rem;
  position: relative;
  z-index: 1000;
}

/* ===== DARK MODE TOP BAR ===== */
body.dark-mode .header-topbar {
  background: linear-gradient(135deg, 
    rgba(15, 23, 42, 0.95) 0%, 
    rgba(30, 41, 59, 0.95) 100%);
  border: 1px solid rgba(51, 65, 85, 0.3);
  box-shadow: 
    0 4px 20px rgba(0, 0, 0, 0.3),
    0 0 40px rgba(59, 130, 246, 0.1),
    inset 0 1px 0 rgba(71, 85, 105, 0.3);
}

/* ===== LIGHT MODE TOP BAR ===== */
body.light-mode .header-topbar {
  background: linear-gradient(135deg, 
    rgba(255, 255, 255, 0.95) 0%, 
    rgba(248, 250, 252, 0.95) 100%);
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 
    0 4px 20px rgba(0, 0, 0, 0.04),
    0 0 40px rgba(100, 149, 237, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.header-topbar-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

/* ===== BRAND ===== */
.header-brand {
  flex-shrink: 0;
}

.brand-link {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  transition: all 0.3s ease;
}

.brand-link:hover {
  transform: translateY(-2px);
}

.brand-avatar,
.brand-logo {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  object-fit: cover;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transition: all 0.3s ease;
}

.brand-link:hover .brand-avatar,
.brand-link:hover .brand-logo {
  box-shadow: 0 6px 20px rgba(100, 149, 237, 0.4);
  transform: scale(1.05);
}

.brand-name {
  font-size: 1.5rem;
  font-weight: 800;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.5px;
  text-shadow: 0 2px 10px rgba(102, 126, 234, 0.3);
}

/* ===== DARK MODE BRAND NAME ===== */
body.dark-mode .brand-name {
  background: linear-gradient(135deg, #60a5fa 0%, #a78bfa 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: 0 2px 10px rgba(96, 165, 250, 0.4);
}

/* ===== LIGHT MODE BRAND NAME ===== */
body.light-mode .brand-name {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: 0 2px 10px rgba(102, 126, 234, 0.2);
}

/* ===== HEADER ACTIONS ===== */
.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

/* ===== ICON BUTTONS (Language & Theme) ===== */
.btn-icon {
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(102, 126, 234, 0.2);
  border-radius: 10px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  color: #4a5568;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  backdrop-filter: blur(10px);
}

/* ===== DARK MODE ICON BUTTONS ===== */
body.dark-mode .btn-icon {
  background: rgba(30, 41, 59, 0.8);
  border: 1px solid rgba(96, 165, 250, 0.3);
  color: #cbd5e1;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* ===== LIGHT MODE ICON BUTTONS ===== */
body.light-mode .btn-icon {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(102, 126, 234, 0.15);
  color: #4a5568;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.btn-icon:hover {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border-color: transparent;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(102, 126, 234, 0.4);
}

.btn-icon i {
  font-size: 14px;
}

.theme-toggle-compact {
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(251, 146, 60, 0.2);
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 18px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  backdrop-filter: blur(10px);
}

/* ===== DARK MODE THEME TOGGLE ===== */
body.dark-mode .theme-toggle-compact {
  background: rgba(30, 41, 59, 0.8);
  border: 1px solid rgba(251, 146, 60, 0.3);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  font-size: 13px;
}

/* ===== LIGHT MODE THEME TOGGLE ===== */
body.light-mode .theme-toggle-compact {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(251, 146, 60, 0.15);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  font-size: 13px;
}

.theme-toggle-compact:hover {
  background: linear-gradient(135deg, #fb923c 0%, #f97316 100%);
  border-color: transparent;
  transform: translateY(-2px) rotate(15deg);
  box-shadow: 0 6px 16px rgba(251, 146, 60, 0.4);
}

/* ===== USER INFO CARD ===== */
.user-info-card {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: 14px;
  padding: 10px 18px;
  box-shadow: 
    0 4px 16px rgba(16, 185, 129, 0.3),
    0 0 30px rgba(16, 185, 129, 0.15);
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
}

.user-info-card:hover {
  transform: translateY(-3px);
  box-shadow: 
    0 8px 25px rgba(16, 185, 129, 0.4),
    0 0 40px rgba(16, 185, 129, 0.25);
}

/* ===== DARK MODE USER INFO CARD ===== */
body.dark-mode .user-info-card {
  background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
  border: 1px solid rgba(71, 85, 105, 0.3);
  box-shadow: 
    0 4px 16px rgba(0, 0, 0, 0.3),
    0 0 30px rgba(59, 130, 246, 0.1);
  padding: 10px 18px; /* Ensure same padding as light mode */
}

body.dark-mode .user-info-card:hover {
  background: linear-gradient(135deg, #334155 0%, #475569 100%);
  box-shadow: 
    0 8px 25px rgba(0, 0, 0, 0.4),
    0 0 40px rgba(59, 130, 246, 0.15);
}

/* ===== LIGHT MODE USER INFO CARD ===== */
body.light-mode .user-info-card {
  background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
  border: 1px solid rgba(148, 163, 184, 0.2);
  box-shadow: 
    0 4px 16px rgba(0, 0, 0, 0.08),
    0 0 30px rgba(59, 130, 246, 0.05);
  padding: 10px 18px; /* Ensure same padding as dark mode */
}

body.light-mode .user-info-card:hover {
  background: linear-gradient(135deg, #e2e8f0 0%, #cbd5e1 100%);
  box-shadow: 
    0 8px 25px rgba(0, 0, 0, 0.12),
    0 0 40px rgba(59, 130, 246, 0.08);
}



.user-name {
  font-size: 12px; /* Desktop default */
  font-weight: 700;
  color: #ffffff;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  /* margin-bottom: 4px; */
  white-space: nowrap;
}

/* ===== DARK MODE USER NAME ===== */
body.dark-mode .user-name {
  color: #f1f5f9;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
  font-size: 12px; /* Ensure same font-size as light mode */
}

/* ===== LIGHT MODE USER NAME ===== */
body.light-mode .user-name {
  color: #1e293b;
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.8);
  font-size: 12px; /* Ensure same font-size as dark mode */
}

.user-balance {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px; /* Desktop default */
  color: #d1fae5;
}

.user-balance i {
  color: #86efac;
  filter: drop-shadow(0 0 8px rgba(134, 239, 172, 0.6));
  font-size: 12px;
}

.balance-amount {
  font-weight: 800;
  font-size: 12px; /* Desktop default */
  color: #ffffff;
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

/* ===== DARK MODE USER BALANCE ===== */
body.dark-mode .user-balance {
  color: #cbd5e1;
  font-size: 12px; /* Ensure same font-size as light mode */
}

body.dark-mode .user-balance i {
  color: #60a5fa;
  filter: drop-shadow(0 0 8px rgba(96, 165, 250, 0.6));
  font-size: 12px; /* Ensure same font-size as light mode */
}

body.dark-mode .balance-amount {
  color: #f1f5f9;
  text-shadow: 0 0 10px rgba(241, 245, 249, 0.3);
  font-size: 12px; /* Ensure same font-size as light mode */
}

/* ===== LIGHT MODE USER BALANCE ===== */
body.light-mode .user-balance {
  color: #475569;
  font-size: 12px; /* Ensure same font-size as dark mode */
}

body.light-mode .user-balance i {
  color: #3b82f6;
  filter: drop-shadow(0 0 8px rgba(59, 130, 246, 0.4));
  font-size: 12px; /* Ensure same font-size as dark mode */
}

body.light-mode .balance-amount {
  color: #1e293b;
  text-shadow: 0 0 10px rgba(30, 41, 59, 0.2);
  font-size: 12px; /* Ensure same font-size as dark mode */
}

/* ===== DEPOSIT BUTTON ===== */
.btn-deposit {
  background: linear-gradient(135deg, #10b981 0%, #3b82f6 100%);
  border: 1px solid rgba(59, 130, 246, 0.3);
  border-radius: 12px;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 700;
  color: #ffffff;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 
    0 4px 16px rgba(59, 130, 246, 0.3),
    0 0 25px rgba(16, 185, 129, 0.2);
  display: flex;
  align-items: center;
  gap: 8px;
  position: relative;
  overflow: visible;
}

.btn-deposit:hover {
  background: linear-gradient(135deg, #059669 0%, #2563eb 100%);
  transform: translateY(-3px) scale(1.03);
  box-shadow: 
    0 8px 30px rgba(59, 130, 246, 0.5),
    0 0 40px rgba(16, 185, 129, 0.35);
}

/* ===== DARK MODE DEPOSIT BUTTON ===== */
body.dark-mode .btn-deposit {
  background: linear-gradient(135deg, #1a5a3a 0%, #1e40af 100%);
  border: 1px solid rgba(30, 64, 175, 0.4);
  box-shadow: 
    0 4px 16px rgba(30, 64, 175, 0.4),
    0 0 25px rgba(26, 90, 58, 0.3);
}

body.dark-mode .btn-deposit:hover {
  background: linear-gradient(135deg, #0f4c2a 0%, #1e3a8a 100%);
  box-shadow: 
    0 8px 30px rgba(30, 64, 175, 0.6),
    0 0 40px rgba(26, 90, 58, 0.4);
}

/* ===== LIGHT MODE DEPOSIT BUTTON ===== */
body.light-mode .btn-deposit {
  background: linear-gradient(135deg, #10b981 0%, #3b82f6 100%);
  border: 1px solid rgba(59, 130, 246, 0.2);
  box-shadow: 
    0 4px 16px rgba(59, 130, 246, 0.2),
    0 0 25px rgba(16, 185, 129, 0.15);
}

body.light-mode .btn-deposit:hover {
  background: linear-gradient(135deg, #059669 0%, #2563eb 100%);
  box-shadow: 
    0 8px 30px rgba(59, 130, 246, 0.4),
    0 0 40px rgba(16, 185, 129, 0.25);
}

.btn-deposit i {
  filter: drop-shadow(0 0 6px rgba(255, 255, 255, 0.6));
  font-size: 16px;
}

/* Badge +30% - Keep existing styles */
.badge-popup {
  position: absolute;
  top: -9px;
  right: -5px;
  background: linear-gradient(135deg, #ea580c 0%, #f59e0b 100%);
  padding: 2px 4px;
  border-radius: 50px;
  font-size: 8px;
  font-weight: 900;
  color: #ffffff;
  box-shadow: 0 0 20px rgba(251, 146, 60, 0.7);
  animation: pulse-badge 2s ease-in-out infinite;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  border: 2px solid rgba(255, 255, 255, 0.5);
}

/* Invoice badge - Red color for unpaid invoices */
#invoice-badge, #invoice-badge-mobile {
  background: linear-gradient(135deg, #ff4757 0%, #ff3838 100%) !important;
  box-shadow: 0 0 20px rgba(255, 71, 87, 0.7) !important;
  border: 2px solid rgba(255, 255, 255, 0.5) !important;
  position: absolute !important;
  top: -6px !important;
  font-size: 8px;
  right: 4px !important;
  z-index: 9999 !important;
}

@keyframes pulse-badge {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 0 20px rgba(251, 146, 60, 0.7);
  }
  50% {
    transform: scale(1.08);
    box-shadow: 0 0 30px rgba(251, 146, 60, 0.9);
  }
}

/* ===== LOGOUT BUTTON ===== */
.btn-logout {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.15) 0%, rgba(220, 38, 38, 0.15) 100%);
  border: 2px solid #ef4444;
  border-radius: 12px;
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 600;
  color: #ef4444;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.2);
  backdrop-filter: blur(10px);
}

.btn-logout:hover {
  background: linear-gradient(135deg, #dc2626 0%, #991b1b 100%);
  color: #ffffff;
  border-color: #dc2626;
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(239, 68, 68, 0.4);
}

.btn-logout i {
  filter: drop-shadow(0 0 6px rgba(239, 68, 68, 0.6));
}

.btn-logout:hover i {
  filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.8));
}

/* ===== LOGIN BUTTON ===== */
.btn-login {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  border: none;
  border-radius: 12px;
  padding: 12px 24px;
  font-size: 15px;
  font-weight: 700;
  color: #ffffff;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 4px 16px rgba(59, 130, 246, 0.4);
}

.btn-login:hover {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  transform: translateY(-3px) scale(1.03);
  box-shadow: 0 8px 30px rgba(59, 130, 246, 0.6);
  color: #ffffff;
}

.btn-login i {
  filter: drop-shadow(0 0 6px rgba(255, 255, 255, 0.6));
}

/* ===== MOBILE MENU BUTTON ===== */
.btn-mobile-menu {
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(102, 126, 234, 0.2);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 24px;
  color: #4a5568;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.btn-mobile-menu:hover {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border-color: transparent;
  transform: scale(1.05);
  box-shadow: 0 6px 16px rgba(102, 126, 234, 0.4);
}

/* ===== TIER 2: NAVIGATION BAR ===== */
.header-navbar {
  background: linear-gradient(135deg, 
    rgba(102, 126, 234, 0.08) 0%, 
    rgba(118, 75, 162, 0.08) 100%);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(102, 126, 234, 0.15);
  border-top: none;
  border-radius: 0 0 20px 20px;
  box-shadow: 
    0 6px 20px rgba(0, 0, 0, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.5);
  padding: 0.75rem 1.5rem;
  position: relative;
  z-index: 999;
}

/* ===== DARK MODE NAVIGATION BAR ===== */
body.dark-mode .header-navbar {
  background: linear-gradient(135deg, 
    rgba(30, 41, 59, 0.15) 0%, 
    rgba(51, 65, 85, 0.15) 100%);
  border: 1px solid rgba(71, 85, 105, 0.2);
  box-shadow: 
    0 6px 20px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(71, 85, 105, 0.3);
}

/* ===== LIGHT MODE NAVIGATION BAR ===== */
body.light-mode .header-navbar {
  background: linear-gradient(135deg, 
    rgba(102, 126, 234, 0.06) 0%, 
    rgba(118, 75, 162, 0.06) 100%);
  border: 1px solid rgba(102, 126, 234, 0.1);
  box-shadow: 
    0 6px 20px rgba(0, 0, 0, 0.04),
    inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.navbar-content {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: center;
}

/* ===== NAVIGATION LINKS ===== */
.navbar-content .nav-link {
  color: #4a5568;
  font-weight: 600;
  font-size: 14.5px;
  padding: 10px 20px;
  border-radius: 10px;
  text-decoration: none;
  transition: all 0.3s ease;
  position: relative;
  white-space: nowrap;
}

.navbar-content .nav-link::before {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%) scaleX(0);
  width: 70%;
  height: 3px;
  background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
  border-radius: 2px 2px 0 0;
  transition: transform 0.3s ease;
}

.navbar-content .nav-link:hover {
  color: #667eea;
  background: rgba(102, 126, 234, 0.08);
}

.navbar-content .nav-link:hover::before {
  transform: translateX(-50%) scaleX(1);
}

.navbar-content .nav-link.active {
  color: #ffffff;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.35);
}

.navbar-content .nav-link.active::before {
  display: none;
}

/* Highlight nav link (Quản Lý Dịch Vụ) */
.navbar-content .nav-link-highlight {
  color: #ef4444;
  font-weight: 700;
}

.navbar-content .nav-link-highlight:hover {
  color: #dc2626;
  background: rgba(239, 68, 68, 0.08);
}

.navbar-content .nav-link-highlight.active {
  color: #ffffff;
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.35);
}

/* ===== DROPDOWN MENU ===== */
.navbar-content .dropdown-menu {
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(102, 126, 234, 0.2);
  border-radius: 14px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
  padding: 8px;
  margin-top: 8px;
  min-width: 220px;
}

.navbar-content .dropdown-item {
  border-radius: 10px;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 500;
  color: #4a5568;
  transition: all 0.2s ease;
}

.navbar-content .dropdown-item:hover {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #ffffff;
  transform: translateX(4px);
}

.navbar-content .dropdown-item i {
  color: #667eea;
  transition: all 0.2s ease;
}

.navbar-content .dropdown-item:hover i {
  color: #ffffff;
}

/* ===== LANGUAGE DROPDOWN (in topbar) ===== */
.language-switcher-compact .dropdown-menu {
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(102, 126, 234, 0.2);
  border-radius: 12px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
  padding: 6px;
  min-width: 180px;
  margin-top: 8px;
}

.language-switcher-compact .dropdown-item {
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 500;
  color: #4a5568;
  transition: all 0.2s ease;
}

.language-switcher-compact .dropdown-item:hover {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #ffffff;
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 991.98px) {
  .header-topbar {
    border-radius: 16px;
  }
  
  .header-navbar {
    display: none;
  }
}

/* ===== HEADER ROW WRAPPERS ===== */
.header-row-1,
.header-row-2,
.header-row-3 {
  display: flex;
  align-items: center;
}

/* Row 1: Logo + Controls */
.header-row-1 {
  gap: 12px;
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Row 2: User Info */
.header-row-2 {
  justify-content: center;
}

/* Row 3: Action Buttons */
.header-row-3 {
  gap: 8px;
}

/* ===== DESKTOP LAYOUT (> 899px) - 3 ZONES ===== */
@media (min-width: 900px) {
  .header-topbar-content {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 0;
    flex-wrap: nowrap;
  }
  
  /* ZONE LEFT: Logo only */
  .header-row-1 {
    order: 1;
    flex: 0 0 auto;
    padding-right: 30px;
  }
  
  .header-row-1 .header-brand {
    display: flex;
  }
  
  /* Hide mobile controls on desktop */
  .header-controls-mobile {
    display: none !important;
  }
  
  /* ZONE CENTER: Language + Theme + User Info */
  .header-row-2 {
    order: 2;
    flex: 1 1 auto;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
  }
  
  /* Show desktop controls in center */
  .header-controls-desktop {
    display: flex !important;
    align-items: center;
    gap: 10px;
  }
  
  .header-row-2 .user-info-card {
    text-align: center;
    /* font-size: 12px; */
    /* padding: 6px 12px; */
    white-space: nowrap;
  }
  
  /* ZONE RIGHT: Action Buttons (when not logged in, show in row-3) */
  .header-row-3 {
    order: 3;
    flex: 0 0 auto;
    gap: 10px;
    padding-left: 30px;
  }
  
  /* Guest deposit button (same styling as regular deposit) */
  /* .btn-deposit-guest inherits from .btn-deposit */
}

/* ===== MOBILE 3-ROW LAYOUT (< 900px) ===== */
@media (max-width: 899px) {
  .header-topbar {
    border-radius: 16px;
  }
  
  .header-topbar-content {
    display: flex;
    flex-direction: column;
    gap: 10px;
  }
  
  /* Hide desktop controls on mobile */
  .header-controls-desktop {
    display: none !important;
  }
  
  /* Show mobile controls */
  .header-controls-mobile {
    display: flex !important;
  }
  
  /* Row 1: Logo + Controls (full width) */
  .header-row-1 {
    width: 100%;
    justify-content: space-between;
  }
  
  /* Row 2: User Info (show and center) */
  .header-row-2 {
    display: flex;
    width: 100%;
    justify-content: center;
  }
  
  .header-row-2 .user-info-card {
    flex: 1;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
  }
  
  /* Row 3: Action Buttons (show) */
  .header-row-3 {
    display: flex;
    width: 100%;
    gap: 8px;
  }
  
  /* Logged in: Deposit + Logout */
  .header-row-3 .btn-deposit,
  .header-row-3 .btn-logout,
  /* Not logged in: Deposit Guest + Login */
  .header-row-3 .btn-deposit-guest,
  .header-row-3 .btn-login {
    flex: 1;
    padding: 10px 16px;
    justify-content: center;
  }
  
  .header-row-3 .btn-deposit span:not(.badge-popup):not(.badge-popup span),
  .header-row-3 .btn-logout span,
  .header-row-3 .btn-deposit-guest span,
  .header-row-3 .btn-login span {
    display: inline;
  }
  
  .header-row-3 .btn-deposit i,
  .header-row-3 .btn-logout i,
  .header-row-3 .btn-deposit-guest i,
  .header-row-3 .btn-login i {
    margin-right: 6px;
  }
}

@media (max-width: 768px) {
  .header-topbar {
    padding: 0.875rem 1rem;
  }
  
  .brand-name {
    font-size: 1.15rem;
  }
  
  .brand-avatar,
  .brand-logo {
    width: 42px;
    height: 42px;
  }
  
  .btn-deposit,
  .btn-logout {
    padding: 10px 16px;
    font-size: 14px;
  }
  
  .btn-icon {
    padding: 7px 11px;
    font-size: 12px;
  }
  
  .theme-toggle-compact {
    padding: 7px 10px;
    font-size: 16px;
  }
  
  .badge-popup {
    top: -10px;
    right: -6px;
    font-size: 9px;
    padding: 3px 8px;
  }
}

@media (max-width: 576px) {
  .header-topbar {
    padding: 0.75rem;
    border-radius: 14px;
  }
  
  .header-topbar-content {
    gap: 10px;
  }
  
  .brand-avatar,
  .brand-logo {
    width: 38px;
    height: 38px;
    border-radius: 10px;
  }
  
  .brand-name {
    font-size: 1rem;
  }
  
  .user-info-card {
    padding: 6px 10px;
  }
  
  /* .user-name {
    margin-bottom: 2px;
    font-size: 11px;
  }
  
  .user-balance {
    gap: 4px;
    font-size: 11px;
  } */
  
  .balance-amount {
    font-size: 12px;
  }
  
  .btn-deposit,
  .btn-logout {
    padding: 9px 14px;
    font-size: 13px;
    border-radius: 10px;
  }
  
  .btn-icon {
    padding: 6px 9px;
    font-size: 11px;
    border-radius: 8px;
  }
  
  .theme-toggle-compact {
    padding: 6px 8px;
    font-size: 13px;
  }
  
  .btn-mobile-menu {
    padding: 8px 11px;
    font-size: 20px;
    border-radius: 8px;
  }
  
  .login-text {
    display: none;
  }
  
  .btn-login {
    padding: 10px 16px;
  }
  
  .badge-popup {
    top: -8px;
    right: -5px;
    font-size: 8px;
    padding: 2px 6px;
  }
  
  .header-actions {
    gap: 6px;
  }
}

@media (max-width: 450px) {
  .header-topbar {
    padding: 0.625rem;
  }
  
  .header-topbar-content {
    gap: 8px;
  }
  
  .header-brand {
    flex: 0 0 auto;
  }
  
  .brand-avatar,
  .brand-logo {
    width: 36px;
    height: 36px;
  }
  
  .brand-name {
    font-size: 0.95rem;
  }
  
  .user-info-card {
    padding: 5px 8px;
  }
  
  /* Keep user name visible but smaller */
  /* .user-name {
    font-size: 10px;
  } */
  
  /* .user-balance {
    font-size: 10px;
  } */
  
  .balance-amount {
    font-size: 11px;
  }
  
  .btn-deposit,
  .btn-logout {
    padding: 8px 12px;
    font-size: 12px;
  }
  
  .btn-icon {
    padding: 5px 8px;
  }
  
  .theme-toggle-compact {
    padding: 5px 7px;
    font-size: 14px;
  }
  
  .btn-mobile-menu {
    padding: 7px 10px;
    font-size: 18px;
  }
  
  .header-actions {
    gap: 5px;
  }
}

@media (max-width: 380px) {
  .header-topbar {
    padding: 0.5rem;
  }
  
  .brand-name {
    font-size: 0.875rem;
  }
  
  .brand-avatar,
  .brand-logo {
    width: 32px;
    height: 32px;
  }
  
  /* Very compact layout */
  .user-info-card {
    min-width: auto;
    padding: 4px 7px;
  }
  
  .user-balance {
    font-size: 9px;
  }
  
  .balance-amount {
    font-size: 10px;
  }
  
  .btn-deposit,
  .btn-logout {
    padding: 7px 10px;
    font-size: 11px;
  }
  
  .btn-icon {
    padding: 4px 7px;
    font-size: 10px;
  }
  
  .theme-toggle-compact {
    padding: 4px 6px;
    font-size: 13px;
  }
  
  .btn-mobile-menu {
    padding: 6px 9px;
    font-size: 16px;
  }
  
  .badge-popup {
    top: -6px;
    right: -4px;
    font-size: 7px;
    padding: 2px 5px;
  }
}

