/* =====================================================
   3ncount.my - Mobile-First Design System (Fasa 9)
   ===================================================== */

/* === CSS Variables === */
:root {
  --bg-main:      #FBFBFF;
  --glass-bg:     rgba(255, 255, 255, 0.75);
  --glass-border: rgba(139, 126, 200, 0.15);
  --text-main:    #1e1b4b;
  --text-muted:   #64748B;
  --primary:      #8B7EC8;
  --primary-soft: rgba(139, 126, 200, 0.08);
  --primary-dark: #6C5DA8;
  --accent:       #A78BFA;
  --success:      #10B981;
  --danger:       #F43F5E;
  --warning:      #F59E0B;
  --border:       rgba(139, 126, 200, 0.1);
  --shadow-sm:    0 1px 2px rgba(0,0,0,0.1);
  --shadow:       0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
  --shadow-lg:    0 20px 25px -5px rgba(0,0,0,0.2), 0 10px 10px -5px rgba(0,0,0,0.1);
  --radius:       20px;
  --radius-sm:    12px;
  --sidebar-w:    260px;
  --bottomnav-h:  68px;
}

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

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg-main);
  background-image: url('../img/futuristic_bg.png');
  background-repeat: no-repeat;
  background-attachment: fixed;
  background-position: center;
  background-size: cover;
  color: var(--text-main);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}

/* Overlay for better readability */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background: rgba(255, 255, 255, 0.5);
  z-index: -1;
}

.layout {
  display: flex;
  min-height: 100vh;
}

/* === Sidebar === */
.sidebar {
  width: var(--sidebar-w);
  min-height: 100vh;
  background: rgba(240, 238, 255, 0.82);
  backdrop-filter: blur(25px);
  border-right: 1px solid var(--glass-border);
  padding: 1.5rem 1rem;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 1000;
  transition: transform 0.3s ease;
}

.sidebar-logo span { opacity: 1 !important; }
.nav-link span { opacity: 1 !important; }
.nav-label { opacity: 1 !important; }
.sidebar-user-text { opacity: 1 !important; }

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--text-main);
  padding: 0.5rem 0.5rem;
  margin-bottom: 0.75rem;
  letter-spacing: -0.5px;
  white-space: nowrap;
}
.sidebar-logo span { opacity: 0; transition: opacity 0.2s; }
.sidebar:hover .sidebar-logo span { opacity: 1; }

.sidebar-logo i { font-size: 1.8rem; color: var(--primary); }

.sidebar-nav { 
  display: flex; 
  flex-direction: column; 
  gap: 0.15rem; 
  flex: 1; 
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 0.5rem;
}

/* Custom Scrollbar for Sidebar */
.sidebar-nav::-webkit-scrollbar {
  width: 6px;
}
.sidebar-nav::-webkit-scrollbar-track {
  background: transparent;
}
.sidebar-nav::-webkit-scrollbar-thumb {
  background: rgba(139, 126, 200, 0.3);
  border-radius: 10px;
}
.sidebar-nav::-webkit-scrollbar-thumb:hover {
  background: rgba(139, 126, 200, 0.5);
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.65rem 1rem;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.nav-link:hover { 
  background: rgba(139, 126, 200, 0.05); 
  color: var(--primary); 
  transform: translateX(5px);
}

.nav-link.active { 
  background: var(--primary); 
  color: white; 
  box-shadow: 0 4px 15px rgba(139, 126, 200, 0.3);
}

.sidebar-bottom { 
  margin-top: auto; 
  padding-top: 0.75rem; 
  padding-bottom: 1.5rem; 
  border-top: 1px solid rgba(255,255,255,0.05); 
}

/* Label for grouping */
.nav-label {
  margin: 1rem 0 0.25rem 0.75rem;
  font-size: 0.65rem;
  font-weight: 800;
  color: #94A3B8;
  text-transform: uppercase;
  letter-spacing: 1px;
  white-space: nowrap;
  transition: opacity 0.2s;
}
.sidebar:hover .sidebar-user-text { opacity: 1 !important; }

/* === Main Content === */
.main-content {
  margin-left: var(--sidebar-w);
  padding: 0 2rem 2rem 2rem;
  min-height: 100vh;
  position: relative;
  background: var(--bg-main);
  z-index: 1;
  flex: 1;
  min-width: 0;
  overflow-x: hidden;
}

/* === Top Header === */
.top-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 -2rem 2rem -2rem;
  padding: 0.75rem 2rem;
  background: var(--glass-bg);
  backdrop-filter: blur(25px);
  border-bottom: 1px solid var(--glass-border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-business {
  text-align: right;
  line-height: 1.3;
}
.header-business strong { font-size: 0.9rem; font-weight: 700; }
.header-business span { font-size: 0.75rem; color: var(--text-muted); display: block; text-transform: capitalize; }

.avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid var(--primary-soft);
  object-fit: cover;
  flex-shrink: 0;
}

/* === Cards === */
.card {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(139, 126, 200, 0.2);
  border-radius: var(--radius);
  padding: 1.75rem;
  box-shadow: 0 8px 32px rgba(139, 126, 200, 0.05);
  color: var(--text-main);
}
.card:hover { border-color: rgba(255,255,255,0.2); }

.stat-card {
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(139, 126, 200, 0.15);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  box-shadow: 0 8px 24px rgba(139, 126, 200, 0.05);
}
.stat-card .stat-icon {
  width: 44px; height: 44px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem;
  background: var(--primary-soft);
  color: var(--primary-dark);
  margin-bottom: 0.5rem;
}
.stat-card .stat-value { font-size: 1.75rem; font-weight: 800; letter-spacing: -1px; }
.stat-card .stat-label { font-size: 0.8rem; color: var(--text-muted); font-weight: 500; }

/* === Buttons === */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.6rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
  -webkit-appearance: none;
  appearance: none;
}

/* === Floating AI Orb === */
.ai-fab {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 64px;
  height: 64px;
  background: transparent;
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  box-shadow: 0 8px 25px rgba(139, 126, 200, 0.4);
  z-index: 2000;
  text-decoration: none;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  animation: ai-pulse 2s infinite;
}
@keyframes ai-pulse {
  0% { box-shadow: 0 0 0 0 rgba(139, 126, 200, 0.4); }
  70% { box-shadow: 0 0 0 15px rgba(139, 126, 200, 0); }
  100% { box-shadow: 0 0 0 0 rgba(139, 126, 200, 0); }
}
.ai-fab:hover { transform: scale(1.1) rotate(5deg); box-shadow: 0 12px 30px rgba(139, 126, 200, 0.5); }
.ai-fab::before {
  content: '';
  position: absolute;
  top: -2px; left: -2px; right: -2px; bottom: -2px;
  background: var(--primary);
  border-radius: 50%;
  z-index: -1;
  filter: blur(10px);
  opacity: 0.6;
  animation: pulse-glow 2s infinite alternate;
}
@keyframes pulse-glow {
  0% { transform: scale(0.9); opacity: 0.4; }
  100% { transform: scale(1.1); opacity: 0.8; }
}

.btn-primary {
  background: var(--primary);
  color: white;
}
.btn-primary:hover, .btn-primary:active { background: var(--primary-dark); transform: translateY(-1px); }

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

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
}
.btn-ghost:hover { background: #F8FAFC; color: var(--text-main); }

.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover { filter: brightness(0.9); }

.btn-dark { background: #1e293b; color: white; }
.btn-dark:hover { background: #0f172a; }

.btn-icon {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  padding: 0;
  border: 1px solid var(--border);
  background: white;
  color: var(--text-muted);
  font-size: 1.1rem;
}
.btn-icon:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }

.btn-lg { padding: 0.875rem 1.75rem; font-size: 1rem; border-radius: 10px; }
.btn-sm { padding: 0.375rem 0.875rem; font-size: 0.8rem; }
.btn-block { width: 100%; }

/* === Forms === */
.form-group { display: flex; flex-direction: column; gap: 0.4rem; margin-bottom: 1.25rem; }
.form-label { font-size: 0.85rem; font-weight: 600; color: var(--text-main); }
.form-control {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  color: var(--text-main);
  background: #F8FAFC;
  transition: border-color 0.2s;
  outline: none;
  -webkit-appearance: none;
}
.form-control:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(139,126,200,0.15); }
.form-control::placeholder { color: #CBD5E1; }

/* === Alerts / Badges === */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.65rem;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 600;
}
.badge-success { background: #D1FAE5; color: #065F46; }
.badge-warning { background: #FEF3C7; color: #92400E; }
.badge-danger  { background: #FFE4E6; color: #9F1239; }
.badge-info    { background: #EDE9FE; color: #5B21B6; }
.badge-primary { background: var(--primary-soft); color: var(--primary-dark); }

.alert { padding: 1rem 1.25rem; border-radius: var(--radius-sm); font-size: 0.875rem; margin-bottom: 1rem; }
.alert-success { background: #D1FAE5; color: #065F46; border: 1px solid #6EE7B7; }
.alert-danger  { background: #FFE4E6; color: #9F1239; border: 1px solid #FCA5A5; }
.alert-warning { background: #FEF3C7; color: #92400E; border: 1px solid #FCD34D; }

/* === Tables === */
.table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
th { padding: 0.875rem 1rem; font-size: 0.8rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.4px; color: var(--text-muted); background: #F8FAFC; text-align: left; }
td { padding: 0.875rem 1rem; border-bottom: 1px solid #F8FAFC; vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: #FAFEFF; }

/* === Chat Styles === */
.chat-container {
  display: flex; flex-direction: column;
  height: calc(100dvh - 5rem);
  background: white; border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden;
}
.chat-header {
  padding: 1rem 1.5rem; background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white; font-weight: 700; display: flex; align-items: center; gap: 0.75rem;
  flex-shrink: 0;
}
.chat-messages {
  flex: 1; padding: 1.25rem; overflow-y: auto; display: flex; flex-direction: column; gap: 0.875rem;
  scroll-behavior: smooth;
}
.msg { max-width: 80%; padding: 0.875rem 1.125rem; border-radius: 16px; font-size: 0.9rem; line-height: 1.5; animation: msgFadeIn 0.25s ease; }
.msg-ai { background: #F1F5F9; color: var(--text-main); align-self: flex-start; border-bottom-left-radius: 4px; }
.msg-user { background: var(--primary); color: white; align-self: flex-end; border-bottom-right-radius: 4px; }
@keyframes msgFadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

.chat-input-area {
  padding: 0.875rem 1rem; border-top: 1px solid var(--border);
  display: flex; gap: 0.5rem; align-items: flex-end;
  background: white; flex-shrink: 0;
}
.chat-input {
  flex: 1; 
  padding: 0.875rem 1.25rem; 
  border: 1.5px solid #E2E8F0; 
  border-radius: 28px;
  outline: none; 
  font-size: 0.95rem; 
  resize: none; 
  max-height: 120px;
  transition: all 0.2s ease; 
  background: #F8FAFC;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.02);
}
.chat-input:focus { 
  border-color: var(--primary); 
  background: white; 
  box-shadow: 0 0 0 4px rgba(139, 126, 200, 0.12);
}

.chat-send-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  box-shadow: 0 4px 10px rgba(139, 126, 200, 0.3);
}
.chat-send-btn:hover { transform: scale(1.1) rotate(-10deg); filter: brightness(1.1); }
.chat-send-btn:active { transform: scale(0.95); }
.chat-send-btn i { font-size: 1.4rem; }

/* === Bottom Nav (Mobile Only) === */
.bottom-nav {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: var(--bottomnav-h);
  background: white;
  border-top: 1px solid var(--border);
  z-index: 90;
  padding: 0 0.5rem;
  padding-bottom: env(safe-area-inset-bottom);
  box-shadow: 0 -4px 20px rgba(0,0,0,0.07);
}
.bottom-nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-around;
  height: 100%;
  max-width: 480px;
  margin: 0 auto;
}
.bnav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  text-decoration: none;
  color: var(--text-muted);
  padding: 0.4rem 0.75rem;
  border-radius: 10px;
  transition: all 0.2s;
  min-width: 52px;
  -webkit-tap-highlight-color: transparent;
}
.bnav-item i { font-size: 1.35rem; transition: transform 0.2s; }
.bnav-item span { font-size: 0.65rem; font-weight: 600; }
.bnav-item.active { color: var(--primary); }
.bnav-item.active i { transform: translateY(-2px); }
.bnav-item.bnav-pos {
  background: var(--primary);
  color: white;
  border-radius: 16px;
  width: 56px; height: 56px;
  margin-top: -18px;
  box-shadow: 0 4px 14px rgba(139,126,200,0.45);
}
.bnav-item.bnav-pos i { font-size: 1.5rem; }

/* === Mobile Sidebar Overlay === */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 999;
  backdrop-filter: blur(4px);
}

/* === Toast Notification === */
.toast-container {
  position: fixed; top: 1.25rem; right: 1.25rem;
  z-index: 9999; display: flex; flex-direction: column; gap: 0.5rem;
  pointer-events: none;
}
.toast {
  background: var(--text-main); color: white;
  padding: 0.875rem 1.25rem; border-radius: var(--radius-sm);
  font-size: 0.875rem; font-weight: 500;
  box-shadow: var(--shadow-lg);
  display: flex; align-items: center; gap: 0.5rem;
  animation: toastIn 0.3s ease, toastOut 0.3s 2.7s ease forwards;
  pointer-events: all;
}
.toast.success { background: var(--success); }
.toast.danger { background: var(--danger); }
@keyframes toastIn  { from { opacity: 0; transform: translateX(100%); } to { opacity: 1; transform: translateX(0); } }
@keyframes toastOut { from { opacity: 1; } to { opacity: 0; transform: translateX(100%); } }

/* === Install PWA Banner === */
.pwa-install-bar {
  display: none;
  position: fixed; bottom: calc(var(--bottomnav-h) + 0.5rem); left: 1rem; right: 1rem;
  background: white; border: 1px solid var(--border); border-radius: var(--radius);
  padding: 0.875rem 1.25rem;
  box-shadow: var(--shadow-lg);
  z-index: 9999 !important;
  align-items: center; justify-content: space-between; gap: 1rem;
  font-size: 0.875rem;
}
.pwa-install-bar.show { display: flex; animation: slideUp 0.4s ease; }
@keyframes slideUp { from { transform: translateY(100%); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* === Utility classes === */
.text-success { color: var(--success); }
.text-danger  { color: var(--danger); }
.text-muted   { color: var(--text-muted); }
.text-primary { color: var(--primary); }
.text-center  { text-align: center; }
.text-right   { text-align: right; }
.fw-bold { font-weight: 700; }
.fw-600  { font-weight: 600; }
.d-flex  { display: flex; }
.align-center { align-items: center; }
.align-items-center { align-items: center !important; }
.align-items-start { align-items: flex-start !important; }
.align-items-end { align-items: flex-end !important; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 0.5rem; } .gap-2 { gap: 1rem; } .gap-3 { gap: 1.5rem; }
.mt-1 { margin-top: 0.5rem; } .mt-2 { margin-top: 1rem; } .mt-3 { margin-top: 1.5rem; } .mt-4 { margin-top: 2rem; }
.mb-1 { margin-bottom: 0.5rem; } .mb-2 { margin-bottom: 1rem; } .mb-3 { margin-bottom: 1.5rem; }
.w-100 { width: 100%; }
.flex-wrap { flex-wrap: wrap !important; }
.divider { border: none; border-top: 1px solid var(--border); margin: 1.5rem 0; }

/* === Loading Spinner === */
.spinner {
  width: 20px; height: 20px; border-radius: 50%;
  border: 2.5px solid rgba(255,255,255,0.3);
  border-top-color: white;
  animation: spin 0.6s linear infinite;
  display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Removed old Bottom Nav styles (now handled by mobile-specific views) */

/* === Wallet Dashboard (Mobile) === */
.wallet-header {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  border-radius: var(--radius);
  padding: 2rem 1.5rem;
  color: white;
  margin: 1rem 0;
  box-shadow: 0 10px 25px rgba(139, 126, 200, 0.4);
  position: relative;
  overflow: hidden;
}
.wallet-header::after {
  content: '';
  position: absolute;
  top: -50%; right: -20%;
  width: 200px; height: 200px;
  background: rgba(255,255,255,0.1);
  border-radius: 50%;
}
.wallet-balance-label {
  font-size: 0.85rem;
  opacity: 0.85;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 0.25rem;
}
.wallet-balance {
  font-size: 2.25rem;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -1px;
}
.wallet-quick-actions {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}
.quick-action-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: var(--text-main);
}
.quick-action-icon {
  width: 54px;
  height: 54px;
  border-radius: 16px;
  background: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: var(--primary);
  box-shadow: 0 4px 12px rgba(139, 126, 200, 0.1);
  transition: all 0.2s;
}
.quick-action-btn:active .quick-action-icon {
  transform: scale(0.95);
}
.quick-action-label {
  font-size: 0.7rem;
  font-weight: 600;
  text-align: center;
  line-height: 1.1;
}

/* =====================================================
   RESPONSIVE: Tablet (≤ 1024px)
   ===================================================== */
@media (max-width: 1024px) {
  .layout { display: block; }
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); box-shadow: var(--shadow-lg); }
  .sidebar-overlay.open { display: block; }
  .main-content { margin-left: 0; padding: 0 1rem 1rem 1rem; }
  .top-header { margin: 0 -1rem; padding: 0.75rem 1rem; }
}

/* Desktop-only view: Removed mobile responsive block */

/* === Settings Layout (Consolidated) === */
.settings-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 2rem;
  align-items: flex-start;
}

.settings-nav-container {
  position: sticky;
  top: 2rem;
}

.settings-nav {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  background: white;
  padding: 1rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.settings-nav-btn {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.9rem 1.5rem;
  border: none;
  background: #F8FAFC; /* Light gray background */
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.95rem;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  text-align: left;
  width: 100%;
  box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}

.settings-nav-btn i { 
  font-size: 1.3rem; 
  color: var(--primary);
  transition: transform 0.3s;
}

.settings-nav-btn:hover { 
  background: white; 
  color: var(--primary); 
  box-shadow: var(--shadow);
}

.settings-nav-btn.active { 
  background: var(--primary);
  color: white; 
  font-weight: 700; 
  box-shadow: 0 10px 20px -5px rgba(139, 126, 200, 0.4);
}
.settings-nav-btn.active i { color: white; transform: scale(1.1); }

@media (max-width: 992px) {
  .settings-layout {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  
  .settings-nav-container {
    position: sticky;
    top: 0;
    margin: -1.25rem -1rem 1.5rem -1rem;
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(226, 232, 240, 0.6);
    z-index: 100;
  }

  .settings-nav {
    flex-direction: row;
    overflow-x: auto;
    background: transparent;
    border: none;
    padding: 0;
    gap: 0.75rem;
    scrollbar-width: none;
  }
  .settings-nav::-webkit-scrollbar { display: none; }

  .settings-nav-btn {
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.7rem 1.25rem;
    min-width: fit-content;
    font-size: 0.875rem;
    text-align: center;
    flex-shrink: 0;
    border-radius: 100px; /* Pill shape */
    background: white;
    border: 1.5px solid #E2E8F0;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05);
    color: var(--text-main);
  }
  .settings-nav-btn span { white-space: nowrap; }
  .settings-nav-btn i { font-size: 1.1rem; color: var(--primary); }
  
  .settings-nav-btn.active {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    border: none;
    box-shadow: 0 8px 16px rgba(139, 126, 200, 0.35);
  }
  .settings-nav-btn.active i { color: white; }
}

/* =====================================================
   RESPONSIVE: Small Mobile (≤ 480px)
   ===================================================== */
@media (max-width: 480px) {
  .main-content { padding: 0 0.875rem; padding-bottom: calc(var(--bottomnav-h) + 1.5rem); }
  .top-header { margin: 0 -0.875rem; padding: 0.75rem 0.875rem; }
  .bnav-item span { display: none; }
  .bnav-item { min-width: 44px; }
  
  /* Shrink settings buttons for small mobile */
  .settings-nav .btn {
    padding: 0.5rem 0.8rem !important;
    font-size: 0.72rem !important;
    gap: 0.25rem !important;
    min-width: auto !important;
  }
  .settings-nav .btn i { font-size: 0.9rem !important; }
}

/* === PWA Safe Area (iPhone notch etc) === */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
  .bottom-nav { padding-bottom: env(safe-area-inset-bottom); height: calc(var(--bottomnav-h) + env(safe-area-inset-bottom)); }
  .main-content { padding-bottom: calc(var(--bottomnav-h) + env(safe-area-inset-bottom) + 1rem); }
  .pwa-install-bar { bottom: calc(var(--bottomnav-h) + env(safe-area-inset-bottom) + 0.75rem); }
}

/* === Settings Navigation (Scrollable) === */
.settings-nav-container {
  width: 100%;
  overflow: hidden;
  margin-bottom: 1.5rem;
}
.settings-nav {
  display: flex !important;
  flex-wrap: nowrap !important;
  overflow-x: auto !important;
  gap: 0.5rem;
  padding-bottom: 0.75rem !important;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.settings-nav::-webkit-scrollbar {
  display: none;
}
.settings-nav .btn {
  flex: 0 0 auto !important;
}

/* === Global Print Styles === */
@media print {
  .no-print {
    display: none !important;
    height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    visibility: hidden !important;
  }
}

/* PREMIUM BLUR OVERLAY */
.premium-blur-container {
    position: relative;
    width: 100%;
    min-height: 400px;
    overflow: hidden;
}
.premium-blur-container .premium-blur-content {
    filter: blur(8px) grayscale(50%);
    pointer-events: none;
    user-select: none;
    opacity: 0.6;
    transition: all 0.3s ease;
}
.premium-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(2px);
}
.premium-overlay-content {
    background: white;
    padding: 3rem 2rem;
    border-radius: 24px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    text-align: center;
    max-width: 450px;
    border: 1px solid rgba(226, 232, 240, 0.8);
    transform: translateY(0);
    animation: floatPremium 3s ease-in-out infinite;
}
@keyframes floatPremium {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
    100% { transform: translateY(0px); }
}

/* MAGIC GLOBAL MOBILE FIXES removed as desktop view is no longer responsive. */
