/* ============================================================
   ARM SWISS BANK — DASHBOARD CSS (Mobile-First, Premium)
   ============================================================ */

:root {
  --sidebar-width: 260px;
  --primary: #0FA958;
  --primary-light: #12C966;
  --primary-dark: #0A7A3E;
  --bg-sidebar: #0b1f14;
  --text-sidebar: #94a3b8;
  --text-active: #ffffff;
  --border-dashboard: rgba(15, 169, 88, 0.08);
  --mobile-nav-h: 68px;
}

/* ============================================================
   BASE LAYOUT
   ============================================================ */
.dashboard-container {
  display: flex;
  min-height: 100vh;
  background: #f0f4f8;
}

/* ============================================================
   SIDEBAR — Desktop
   ============================================================ */
.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-sidebar);
  color: var(--text-sidebar);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0;
  height: 100vh;
  z-index: 200;
  border-right: 1px solid rgba(255,255,255,0.04);
  transition: transform 0.3s cubic-bezier(0.4,0,0.2,1);
  overflow-y: auto;
}

.sidebar-header {
  padding: 22px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  display: flex; align-items: center; justify-content: space-between;
  flex-shrink: 0;
}

.sidebar-brand {
  display: flex; align-items: center; gap: 10px;
  font-weight: 800; font-size: 1.2rem; color: #fff;
  text-decoration: none;
}

.sidebar-brand .logo-dot {
  width: 7px; height: 7px;
  background: var(--primary-light);
  border-radius: 50%;
}

.sidebar-profile {
  padding: 20px;
  text-align: center;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  flex-shrink: 0;
}

.sidebar-avatar {
  width: 58px; height: 58px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: #fff;
  font-size: 1.4rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 10px;
  box-shadow: 0 4px 12px rgba(15,169,88,0.3);
}

.sidebar-profile h4 { color: #fff; font-size: 0.92rem; font-weight: 600; margin-bottom: 4px; }
.sidebar-profile span {
  font-size: 0.72rem;
  background: rgba(16,185,129,0.15); color: #10b981;
  padding: 2px 8px; border-radius: 50px; font-weight: 600;
}

.sidebar-menu { list-style: none; padding: 12px 0; flex-grow: 1; overflow-y: auto; }

.sidebar-menu li a {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 20px;
  color: var(--text-sidebar);
  font-size: 0.88rem; font-weight: 500;
  border-left: 3px solid transparent;
  transition: all 0.2s;
  cursor: pointer;
  text-decoration: none;
}

.sidebar-menu li a:hover,
.sidebar-menu li.active a {
  color: #fff;
  background: rgba(15,169,88,0.08);
  border-left-color: var(--primary-light);
}

.sidebar-menu li a i { width: 18px; flex-shrink: 0; }

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid rgba(255,255,255,0.06);
  flex-shrink: 0;
}

.sidebar-logout {
  display: flex; align-items: center; gap: 12px;
  color: #ef4444 !important; font-size: 0.88rem; font-weight: 600; cursor: pointer;
  text-decoration: none;
}

/* ============================================================
   SIDEBAR OVERLAY (Mobile)
   ============================================================ */
.sidebar-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 199;
  backdrop-filter: blur(2px);
}
.sidebar-overlay.active { display: block; }

/* ============================================================
   MAIN PANEL
   ============================================================ */
.main-panel {
  margin-left: var(--sidebar-width);
  flex-grow: 1;
  padding: 28px 28px 28px;
  background: #f0f4f8;
  min-height: 100vh;
}

/* ============================================================
   TOPBAR
   ============================================================ */
.topbar {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 28px;
  background: #fff;
  padding: 16px 24px;
  border-radius: 16px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}

.topbar-left { display: flex; align-items: center; gap: 14px; }

.topbar-hamburger {
  display: none;
  background: none; border: none; cursor: pointer;
  color: var(--text-main); padding: 4px;
  border-radius: 8px;
}
.topbar-hamburger:hover { background: #f1f5f9; }

.topbar-title h2 { font-size: 1.35rem; font-weight: 700; color: #0f172a; }
.topbar-subtitle { font-size: 0.78rem; color: #64748b; margin-top: 2px; }

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

.topbar-notification {
  position: relative;
  background: #f8fafc; border: 1px solid #e2e8f0;
  width: 40px; height: 40px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: #64748b; transition: all 0.2s;
}
.topbar-notification:hover { background: #f1f5f9; }
.topbar-notification .dot {
  width: 8px; height: 8px; background: var(--primary-light);
  border-radius: 50%; position: absolute; top: 7px; right: 7px;
  border: 2px solid #fff;
}

.topbar-user { display: flex; align-items: center; gap: 10px; cursor: pointer; }

.topbar-avatar {
  width: 40px; height: 40px; border-radius: 12px;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: #fff; font-weight: 700; font-size: 0.9rem;
  display: flex; align-items: center; justify-content: center;
}

.topbar-name { font-weight: 600; font-size: 0.9rem; color: #0f172a; }
.topbar-role { font-size: 0.72rem; color: #64748b; }

/* ============================================================
   TAB SYSTEM
   ============================================================ */
.tab-content { display: none; }
.tab-content.active {
  display: block;
  animation: fadeInUp 0.3s ease;
}

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

/* ============================================================
   STATS GRID
   ============================================================ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px; margin-bottom: 24px;
}

.stat-card {
  background: #fff;
  padding: 20px;
  border-radius: 16px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
  display: flex; align-items: center; justify-content: space-between;
  transition: transform 0.2s, box-shadow 0.2s;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(0,0,0,0.08); }

.stat-card-info h4 {
  font-size: 0.72rem; color: #64748b;
  text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 6px;
}
.stat-card-info h3 { font-size: 1.5rem; color: #0f172a; font-weight: 800; }
.stat-card-trend {
  font-size: 0.72rem; margin-top: 4px;
  display: flex; align-items: center; gap: 3px;
}
.stat-card-trend.up { color: #10b981; }
.stat-card-trend.down { color: #ef4444; }

.stat-card-icon {
  width: 48px; height: 48px; border-radius: 50%;
  background: linear-gradient(135deg, rgba(15,169,88,0.1), rgba(18,201,102,0.15));
  color: var(--primary); display: flex; align-items: center; justify-content: center;
}

/* ============================================================
   HERO BALANCE CARD (Mobile Overview)
   ============================================================ */
.balance-hero-card {
  background: linear-gradient(135deg, #064E30 0%, #0FA958 60%, #12C966 100%);
  border-radius: 20px;
  padding: 28px;
  color: #fff;
  margin-bottom: 20px;
  position: relative; overflow: hidden;
  box-shadow: 0 8px 32px rgba(15,169,88,0.25);
}
.balance-hero-card::before {
  content: '';
  position: absolute; top: -40px; right: -40px;
  width: 140px; height: 140px;
  background: rgba(255,255,255,0.06);
  border-radius: 50%;
}
.balance-hero-card::after {
  content: '';
  position: absolute; bottom: -60px; right: 60px;
  width: 200px; height: 200px;
  background: rgba(255,255,255,0.04);
  border-radius: 50%;
}
.balance-hero-label { font-size: 0.75rem; opacity: 0.8; text-transform: uppercase; letter-spacing: 0.08em; }
.balance-hero-amount { font-size: 2.6rem; font-weight: 900; margin: 4px 0 16px; letter-spacing: -1px; }
.balance-hero-row { display: flex; gap: 24px; }
.balance-hero-sub { }
.balance-hero-sub-label { font-size: 0.7rem; opacity: 0.7; }
.balance-hero-sub-val { font-size: 0.9rem; font-weight: 700; }
.balance-hero-acc { font-size: 0.8rem; opacity: 0.75; margin-top: 12px; font-family: monospace; letter-spacing: 2px; }

/* Quick Actions Row */
.quick-actions-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}
.quick-action-btn {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 16px 8px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  color: #0f172a;
  font-size: 0.78rem;
  font-weight: 600;
}
.quick-action-btn:hover { background: #f0fdf4; border-color: var(--primary); color: var(--primary); transform: translateY(-2px); }
.quick-action-btn .qa-icon {
  width: 42px; height: 42px; border-radius: 12px;
  background: linear-gradient(135deg, rgba(15,169,88,0.1), rgba(18,201,102,0.15));
  color: var(--primary);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 8px;
  font-size: 1.1rem;
}

/* ============================================================
   DASHBOARD ROWS
   ============================================================ */
.dashboard-row {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 20px;
}

/* ============================================================
   TABLES
   ============================================================ */
.table-card {
  background: #fff;
  border-radius: 16px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
  overflow: hidden;
}

.table-header {
  padding: 18px 24px;
  border-bottom: 1px solid #f1f5f9;
  display: flex; justify-content: space-between; align-items: center;
}
.table-header h3 { font-size: 1rem; font-weight: 700; }

.table-responsive { width: 100%; overflow-x: auto; }

table { width: 100%; border-collapse: collapse; text-align: left; }

th {
  background: #f8fafc;
  padding: 12px 20px;
  font-size: 0.72rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.05em;
  color: #64748b;
  border-bottom: 1px solid #f1f5f9;
}

td {
  padding: 14px 20px;
  font-size: 0.86rem;
  border-bottom: 1px solid #f8fafc;
  color: #0f172a; vertical-align: middle;
}
tr:last-child td { border-bottom: none; }
tr:hover td { background: #fafafa; }

/* ============================================================
   BADGES
   ============================================================ */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px; border-radius: 50px;
  font-size: 0.72rem; font-weight: 700; text-transform: capitalize;
}
.badge-success { background: rgba(16,185,129,0.1); color: #10b981; }
.badge-warning { background: rgba(245,158,11,0.1); color: #f59e0b; }
.badge-danger { background: rgba(239,68,68,0.1); color: #ef4444; }
.badge-info { background: rgba(59,130,246,0.1); color: #3b82f6; }

/* ============================================================
   FORMS
   ============================================================ */
.form-card {
  background: #fff;
  padding: 28px;
  border-radius: 16px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
  max-width: 680px;
}
.form-card h3 { margin-bottom: 8px; font-size: 1.1rem; }
.form-card p { margin-bottom: 20px; font-size: 0.88rem; color: #64748b; }

/* ============================================================
   ATM CARD DISPLAY
   ============================================================ */
.atm-card-visual {
  background: linear-gradient(135deg, #1a1a2e, #16213e, #0f3460);
  border-radius: 20px;
  padding: 28px;
  color: #fff;
  width: 100%;
  max-width: 380px;
  aspect-ratio: 1.586;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.atm-card-visual.gold-card {
  background: linear-gradient(135deg, #7c4d03, #c9860c, #f5b042);
}
.atm-card-visual.platinum-card {
  background: linear-gradient(135deg, #2c3e50, #3d5a80, #718ca1);
}
.atm-card-visual.black-card {
  background: linear-gradient(135deg, #0a0a0a, #1a1a1a, #2d2d2d);
}


.atm-card-visual::after {
  content: '';
  position: absolute; bottom: -50px; left: 30px;
  width: 200px; height: 200px;
  border-radius: 50%;
  background: rgba(255,255,255,0.03);
}

.atm-card-top { display: flex; justify-content: space-between; align-items: flex-start; }
.atm-card-logo { font-weight: 800; font-size: 1rem; letter-spacing: 1px; }
.atm-card-chip {
  width: 40px; height: 32px; border-radius: 6px;
  background: linear-gradient(135deg, #d4af37, #f5d060);
  position: relative;
}
.atm-card-number {
  font-size: 1rem; letter-spacing: 3px; font-family: monospace;
  margin: 16px 0 8px;
}
.atm-card-bottom { display: flex; justify-content: space-between; align-items: flex-end; }
.atm-card-name { font-weight: 700; font-size: 0.88rem; text-transform: uppercase; letter-spacing: 1px; }
.atm-card-expiry { font-size: 0.75rem; opacity: 0.7; }
.atm-card-network { font-size: 1.4rem; font-weight: 900; letter-spacing: -1px; color: rgba(255,255,255,0.85); }

/* ATM Card Levels Grid */
.card-levels-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-top: 20px;
}
.card-level-option {
  border: 2px solid #e2e8f0;
  border-radius: 16px;
  padding: 20px;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
}
.card-level-option:hover { border-color: var(--primary); background: #f0fdf4; }
.card-level-option.selected { border-color: var(--primary); background: #f0fdf4; }
.card-level-option h4 { font-size: 0.95rem; font-weight: 700; margin-bottom: 4px; }
.card-level-option .card-fee { font-size: 0.8rem; color: #64748b; margin-top: 4px; }
.card-level-icon { font-size: 2rem; margin-bottom: 8px; }

/* Applied Card Status */
.applied-card-box {
  background: #fff;
  border-radius: 16px;
  padding: 20px;
  border: 1px solid #e2e8f0;
  display: flex; align-items: center; gap: 16px;
  margin-bottom: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
.applied-card-icon { font-size: 2rem; }
.applied-card-info h4 { font-size: 0.95rem; font-weight: 700; margin-bottom: 4px; }
.applied-card-info p { font-size: 0.8rem; color: #64748b; margin: 0; }

/* ============================================================
   WALLET BOX
   ============================================================ */
.wallet-box {
  background: #0f172a;
  border-radius: 14px; padding: 20px; color: #fff;
  margin-top: 16px; border: 1px solid rgba(255,255,255,0.06);
}
.wallet-label { font-size: 0.72rem; text-transform: uppercase; color: #94a3b8; margin-bottom: 8px; }
.wallet-address-container {
  display: flex; align-items: center; justify-content: space-between;
  background: rgba(255,255,255,0.05); padding: 10px 14px;
  border-radius: 8px; border: 1px solid rgba(255,255,255,0.08);
}
.wallet-address { font-family: monospace; font-size: 0.82rem; overflow-x: auto; white-space: nowrap; margin-right: 12px; }
.wallet-copy-btn { background: none; border: none; color: var(--primary-light); cursor: pointer; }

/* ============================================================
   CARD MANAGER LAYOUT
   ============================================================ */
.cards-tab-layout {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 24px; align-items: flex-start;
}
.card-settings-list {
  background: #fff; padding: 20px;
  border-radius: 16px; border: 1px solid #e2e8f0;
}
.card-setting-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 0; border-bottom: 1px solid #f1f5f9;
}
.card-setting-item:last-child { border-bottom: none; }
.card-setting-info h4 { font-size: 0.9rem; margin-bottom: 3px; }
.card-setting-info p { font-size: 0.78rem; margin-bottom: 0; color: #64748b; }

/* Switch */
.switch { position: relative; display: inline-block; width: 46px; height: 24px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; cursor: pointer; inset: 0; background: #cbd5e1; transition: .3s; border-radius: 34px; }
.slider:before { position: absolute; content: ''; height: 18px; width: 18px; left: 3px; bottom: 3px; background: #fff; transition: .3s; border-radius: 50%; }
input:checked + .slider { background: var(--primary-light); }
input:checked + .slider:before { transform: translateX(22px); }

/* ============================================================
   KYC / STATUS ALERTS
   ============================================================ */
.status-alert {
  padding: 16px 20px;
  border-radius: 14px;
  display: flex; align-items: flex-start; gap: 14px;
  margin-bottom: 20px;
}
.status-alert-success { background: rgba(16,185,129,0.08); border: 1px solid rgba(16,185,129,0.2); color: #065f46; }
.status-alert-success i { color: #10b981; }
.status-alert-warning { background: rgba(245,158,11,0.08); border: 1px solid rgba(245,158,11,0.2); color: #92400e; }
.status-alert-warning i { color: #f59e0b; }

/* ============================================================
   MOBILE BOTTOM NAVIGATION
   ============================================================ */
.mobile-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: var(--mobile-nav-h);
  background: #fff;
  border-top: 1px solid #e2e8f0;
  z-index: 150;
  box-shadow: 0 -4px 20px rgba(0,0,0,0.08);
  padding: 0 4px;
  padding-bottom: env(safe-area-inset-bottom);
}

.mobile-nav-items {
  display: flex;
  height: 100%;
  align-items: center;
}

.mobile-nav-item {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 6px 4px;
  cursor: pointer;
  border: none; background: none;
  color: #94a3b8;
  font-size: 0.65rem; font-weight: 600;
  transition: all 0.2s;
  border-radius: 12px;
  gap: 3px;
}

.mobile-nav-item.active { color: var(--primary); }
.mobile-nav-item.active .mobile-nav-icon { background: rgba(15,169,88,0.12); color: var(--primary); }

.mobile-nav-icon {
  width: 36px; height: 36px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s;
}

.mobile-nav-item.nav-center .mobile-nav-icon {
  width: 46px; height: 46px; border-radius: 14px;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: #fff;
  box-shadow: 0 4px 16px rgba(15,169,88,0.35);
  margin-top: -8px;
}
.mobile-nav-item.nav-center { color: var(--primary); }

/* ============================================================
   MOBILE HEADER OVERLAY MENU TRIGGER
   ============================================================ */
.mobile-menu-btn {
  display: none;
  background: none; border: none;
  width: 38px; height: 38px;
  border-radius: 10px; cursor: pointer;
  align-items: center; justify-content: center;
  color: #0f172a;
  transition: background 0.2s;
}
.mobile-menu-btn:hover { background: #f1f5f9; }

/* ============================================================
   TRANSACTION LIST (Mobile-style)
   ============================================================ */
.txn-list { padding: 0; }
.txn-list-item {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 20px;
  border-bottom: 1px solid #f8fafc;
  transition: background 0.15s;
}
.txn-list-item:hover { background: #fafafa; }
.txn-list-item:last-child { border-bottom: none; }
.txn-icon {
  width: 42px; height: 42px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem; flex-shrink: 0;
}
.txn-icon.deposit { background: rgba(16,185,129,0.1); color: #10b981; }
.txn-icon.withdraw { background: rgba(239,68,68,0.1); color: #ef4444; }
.txn-icon.transfer { background: rgba(59,130,246,0.1); color: #3b82f6; }
.txn-icon.debit { background: rgba(245,158,11,0.1); color: #f59e0b; }
.txn-details { flex: 1; min-width: 0; }
.txn-details h4 { font-size: 0.88rem; font-weight: 600; margin-bottom: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.txn-details p { font-size: 0.75rem; color: #94a3b8; margin: 0; }
.txn-amount { text-align: right; flex-shrink: 0; }
.txn-amount .amount { font-weight: 800; font-size: 0.92rem; }
.txn-amount .amount.credit { color: #10b981; }
.txn-amount .amount.debit { color: #ef4444; }
.txn-amount .status { font-size: 0.7rem; color: #94a3b8; }

/* ============================================================
   ADMIN SIDEBAR (Minimal override)
   ============================================================ */
.admin-sidebar-badge {
  background: rgba(239,68,68,0.15);
  color: #ef4444;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 50px;
  margin-left: auto;
}

/* ============================================================
   RESPONSIVE — TABLET (1024px)
   ============================================================ */
@media (max-width: 1024px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .dashboard-row { grid-template-columns: 1fr; }
  .cards-tab-layout { grid-template-columns: 1fr; }
  .quick-actions-row { grid-template-columns: repeat(4, 1fr); }
}

/* ============================================================
   RESPONSIVE — MOBILE (768px) — APP MODE
   ============================================================ */
@media (max-width: 768px) {

  /* Sidebar hidden off-screen on mobile */
  .sidebar {
    transform: translateX(-100%);
    width: 280px;
    z-index: 200;
  }
  .sidebar.active { transform: translateX(0); }

  /* Show mobile elements */
  .mobile-bottom-nav { display: flex; }
  .topbar-hamburger { display: flex; }
  .mobile-menu-btn { display: flex; }
  .topbar-name { display: none; }
  .topbar-user { display: none; }
  .theme-toggle-btn { display: none; }

  /* Adjust main panel for bottom nav */
  .main-panel {
    margin-left: 0;
    padding: 16px 8px calc(var(--mobile-nav-h) + 16px) 8px; /* Equal left/right padding */
  }

  /* Topbar mobile */
  .topbar {
    padding: 12px 16px;
    border-radius: 0;
    margin-bottom: 16px;
    margin-left: -8px;
    margin-right: -8px;
    border-radius: 0;
    position: sticky; top: 0; z-index: 100;
  }

  /* Stats grid 2-col on mobile */
  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; margin-bottom: 16px; }
  .stat-card { padding: 10px; border-radius: 12px; gap: 4px; }
  .stat-card-info { min-width: 0; flex: 1; }
  .stat-card-info h4 { font-size: 0.55rem; letter-spacing: 0; margin-bottom: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .stat-card-info h3 { font-size: 0.9rem; word-break: break-word; }
  .stat-card-icon { width: 28px; height: 28px; font-size: 0.8rem; border-radius: 8px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; }

  /* Quick actions 4 col */
  .quick-actions-row { grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 16px; }
  .quick-action-btn { padding: 12px 4px; border-radius: 12px; font-size: 0.68rem; }
  .quick-action-btn .qa-icon { width: 36px; height: 36px; border-radius: 10px; font-size: 0.95rem; }

  /* Table card */
  .table-card { border-radius: 14px; padding: 14px !important; }
  .form-card { padding: 16px; border-radius: 14px; max-width: 100%; }

  /* Card levels 1-col on mobile */
  .card-levels-grid { grid-template-columns: 1fr 1fr; gap: 10px; }

  /* Balance hero */
  .balance-hero-amount { font-size: 2rem; }

  /* Dashboard row single col */
  .dashboard-row { grid-template-columns: 1fr; gap: 14px; }
  .cards-tab-layout { grid-template-columns: 1fr; }

  /* ATM card narrower */
  .atm-card-visual { max-width: 100%; }
}

/* ============================================================
   RESPONSIVE — SMALL MOBILE (480px)
   ============================================================ */
@media (max-width: 480px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .quick-actions-row { grid-template-columns: repeat(4, 1fr); gap: 6px; }
  .main-panel { padding: 12px 12px calc(var(--mobile-nav-h) + 12px); }
  .balance-hero-card { padding: 20px; border-radius: 16px; }
  .balance-hero-amount { font-size: 1.8rem; }
  .card-levels-grid { grid-template-columns: 1fr; }
  table { font-size: 0.78rem; }
  th, td { padding: 10px 12px; }
  .mobile-bottom-nav { height: 60px; }
  .mobile-nav-item { font-size: 0.6rem; }
}

/* ============================================================
   ADMIN DASHBOARD — Mobile
   ============================================================ */
@media (max-width: 768px) {
  #tab-users .table-responsive,
  #tab-deposits .table-responsive,
  #tab-withdrawals .table-responsive,
  #tab-transactions .table-responsive { overflow-x: auto; }

  .settings-sub-btn { font-size: 0.72rem !important; padding: 6px 10px !important; }
  .theme-picker-grid { grid-template-columns: repeat(3, 1fr) !important; }

  .admin-action-btn { font-size: 0.68rem !important; padding: 4px 8px !important; }
  .dropdown-menu-list { min-width: 180px; }
}

/* Modals global styling */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}
.modal.active {
  display: flex;
}
.modal-content {
  background: white;
  padding: 32px;
  border-radius: 8px;
  border: 1px solid rgba(0,0,0,0.08);
  max-width: 450px;
  width: 90%;
  position: relative;
  color: #334155;
}
.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: none;
  border: none;
  font-size: 1.25rem;
  cursor: pointer;
  color: #64748b;
}
.modal-content h3 {
  margin-top: 0;
  color: #0f172a;
}

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

/* ============================================================
   RESPONSIVE — FIX INLINE LAYOUTS ON MOBILE (<=768px)
   Several dashboard blocks use inline flex/grid styles. Because
   inline styles outrank normal media-query rules, the layouts
   above never collapse on small screens and overflow. These
   !important overrides force them to stack properly on phones.
   ============================================================ */
@media (max-width: 768px) {
  /* Collapse any inline 2-column grid to a single column */
  [style*="grid-template-columns:1fr 1fr"] {
    grid-template-columns: 1fr !important;
    gap: 20px !important;
  }

  /* Profile info grid: remove the vertical divider + side padding */
  [style*="border-right:1px solid #f1f5f9; padding-right:32px"] {
    border-right: none !important;
    padding-right: 0 !important;
  }
  [style*="padding-left:32px"] {
    padding-left: 0 !important;
  }

  /* Profile header: stack avatar / name / action button */
  [style*="gap:24px"] {
    flex-direction: column !important;
    align-items: flex-start !important;
    text-align: left !important;
    gap: 16px !important;
  }

  /* Reduce oversized desktop padding on phones */
  [style*="padding:32px 40px"] {
    padding: 24px 20px !important;
  }

  /* Let space-between flex rows wrap instead of squeezing */
  [style*="justify-content:space-between; align-items:center"] {
    flex-wrap: wrap !important;
    gap: 12px !important;
  }

  /* Prevent tables/cards from being squeezed */
  .table-card {
    padding: 14px !important;
  }
  .form-card {
    padding: 18px 16px !important;
  }
}

@media (max-width: 480px) {
  /* Make the long welcome title comfortable on tiny screens */
  .topbar-title h2 {
    font-size: 1.1rem;
    line-height: 1.25;
  }
  /* Stack profile balance banner */
  [style*="justify-content:space-between; align-items:center"] {
    flex-direction: column !important;
    align-items: flex-start !important;
    text-align: left !important;
  }
  /* Transaction table: keep all columns but allow comfortable scroll */
  .table-responsive {
    margin: 0 -14px;
    padding: 0 14px;
  }

  /* --- ATM / PREMIUM CARD: stop content from overflowing the card ---
     The card uses overflow:hidden + fixed height/aspect-ratio, so on
     narrow screens the number / holder / expiry rows get clipped.
     Let the card size to its content and scale the text down. */
  .atm-card-visual {
    min-height: 110px;
    padding: 14px !important;
  }
  .atm-card-visual .atm-card-number {
    font-size: 1.05rem !important;
    letter-spacing: 1px !important;
    word-break: break-word;
  }
  .atm-card-visual .atm-card-name,
  .atm-card-visual .atm-card-expiry {
    font-size: 0.7rem !important;
  }

  /* Card manager mock card (Cards tab) */
  .mock-card#card-manager-display-widget {
    max-width: 100% !important;
    height: auto !important;
    min-height: 180px;
    padding: 18px !important;
  }
  #card-manager-display-widget .mock-card-num {
    font-size: 1.05rem !important;
    letter-spacing: 1px !important;
    word-break: break-word;
  }
}

/* Overview "Card & Account Info": 30% smaller card, fully centered */
#user-display-credit-card {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  text-align: center;
}
#user-display-credit-card .atm-card-top,
#user-display-credit-card .atm-card-bottom {
  justify-content: center;
  gap: 12px;
}
#user-display-credit-card .atm-card-middle { margin-top: 0; }
#user-display-credit-card .atm-card-bottom { margin-top: 0; }
#user-display-credit-card .atm-card-number { font-size: 0.9rem !important; }


