/* ==========================================================================
   PLAYPAYMENTS — Premium Fintech Dashboard
   Modern, sophisticated design with gold accents
   ========================================================================== */

/* ==========================================================================
   CSS Variables
   ========================================================================== */
:root {
  /* Brand Colors */
  --gold-primary: #D4AF37;
  --gold-dark: #b8860b;
  --gold-light: #f0d758;
  --gold-glow: rgba(212, 175, 55, 0.08);
  --gold-dim: rgba(212, 175, 55, 0.15);

  /* Semantic Colors */
  --color-success: #10B981;
  --color-success-light: #22c55e;
  --color-danger: #EF4444;
  --color-danger-dark: #dc2626;
  --color-warning: #F59E0B;
  --color-info: #3B82F6;
  --color-purple: #8B5CF6;
  --color-cyan: #06b6d4;

  /* Dark Theme */
  --bg-primary: #000000;
  --bg-secondary: #0a0a0a;
  --bg-tertiary: #111111;
  --bg-card: #0a0a0a;
  --bg-card-hover: #111111;
  --bg-sidebar: #050505;
  --bg-header: rgba(5, 5, 5, 0.8);

  /* Text */
  --text-primary: #ffffff;
  --text-secondary: #a1a1aa;
  --text-muted: #71717a;

  /* Borders */
  --border-primary: #1a1a1a;
  --border-secondary: #2a2a2a;
  --border-accent: rgba(212, 175, 55, 0.2);

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.5);
  --shadow-gold: 0 0 20px rgba(212, 175, 55, 0.15);

  /* Typography */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-display: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  /* Spacing */
  --sidebar-width: 260px;
  --sidebar-collapsed: 72px;
  --header-height: 64px;

  /* Radius */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;

  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition-base: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Light Mode */
.light-mode {
  --bg-primary: #f9fafb;
  --bg-secondary: #ffffff;
  --bg-tertiary: #f3f4f6;
  --bg-card: #ffffff;
  --bg-card-hover: #f9fafb;
  --bg-sidebar: #ffffff;
  --bg-header: rgba(255, 255, 255, 0.8);
  --text-primary: #111827;
  --text-secondary: #6b7280;
  --text-muted: #9ca3af;
  --border-primary: #e5e7eb;
  --border-secondary: #d1d5db;
}

/* ==========================================================================
   Base Styles
   ========================================================================== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  background: var(--bg-primary);
  color: var(--text-primary);
  font-size: 14px;
  line-height: 1.6;
  overflow-x: hidden;
  min-height: 100vh;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.02em;
}

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

a:hover {
  color: var(--gold-light);
}

/* ==========================================================================
   Animated Background
   ========================================================================== */
.bg-animation {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.bg-gradient {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at top, rgba(212, 175, 55, 0.03) 0%, transparent 50%),
              radial-gradient(ellipse at bottom, rgba(139, 92, 246, 0.02) 0%, transparent 50%);
}

.bg-grid {
  position: absolute;
  inset: 0;
  background-image: 
    linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  background-size: 50px 50px;
  mask-image: radial-gradient(ellipse at center, black 0%, transparent 70%);
}

.bg-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.1;
  animation: float 20s ease-in-out infinite;
}

.orb-1 {
  width: 400px;
  height: 400px;
  background: var(--gold-primary);
  top: -100px;
  right: -100px;
  animation-delay: 0s;
}

.orb-2 {
  width: 300px;
  height: 300px;
  background: var(--color-purple);
  bottom: -50px;
  left: -50px;
  animation-delay: -7s;
}

.orb-3 {
  width: 250px;
  height: 250px;
  background: var(--color-cyan);
  top: 50%;
  left: 50%;
  animation-delay: -14s;
}

@keyframes float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(30px, -30px) scale(1.1); }
  66% { transform: translate(-20px, 20px) scale(0.9); }
}

/* ==========================================================================
   Login Screen
   ========================================================================== */
.login-screen {
  position: relative;
  z-index: 10;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.login-container {
  width: 100%;
  max-width: 420px;
}

.login-card {
  background: var(--bg-card);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-xl);
  padding: 40px;
  box-shadow: var(--shadow-lg);
  animation: slideUp 0.5s ease;
}

.login-header {
  text-align: center;
  margin-bottom: 32px;
}

.login-logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.login-logo img {
  width: 64px;
  height: 64px;
  object-fit: contain;
}

.login-brand {
  font-family: 'Michroma', sans-serif;
  font-size: 18px;
  background: linear-gradient(90deg, #d4af37 0%, #fff8dc 50%, #d4af37 100%);
  background-size: 200% 100%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: shine 3s ease-in-out infinite;
}

@keyframes shine {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.login-subtitle {
  color: var(--text-secondary);
  font-size: 13px;
}

.login-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
  padding: 4px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
}

.login-tab {
  flex: 1;
  padding: 10px 16px;
  background: none;
  border: none;
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

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

.login-tab.active {
  background: var(--bg-card);
  color: var(--gold-primary);
  box-shadow: var(--shadow-sm);
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.login-switch {
  text-align: center;
  margin-top: 8px;
  font-size: 13px;
  color: var(--text-secondary);
}

.login-switch a {
  color: var(--gold-primary);
  text-decoration: none;
  font-weight: 600;
}

.login-switch a:hover {
  text-decoration: underline;
}

.login-footer {
  text-align: center;
  margin-top: 20px;
  font-size: 13px;
  color: var(--text-secondary);
}

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

/* ==========================================================================
   Dashboard App
   ========================================================================== */
.dashboard-app {
  display: flex;
  min-height: 100vh;
  position: relative;
  z-index: 10;
}

/* ==========================================================================
   Main Content
   ========================================================================== */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding-bottom: 96px; /* Space for dock */
}

/* ==========================================================================
   MacOS Dock
   ========================================================================== */
.dock {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border-primary);
  border-radius: 16px 16px 0 0;
  box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.4);
  z-index: 200;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.dock-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px 14px;
  background: none;
  border: none;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
  position: relative;
}

.dock-item i {
  font-size: 20px;
  transition: transform var(--transition-fast);
}

.dock-item span {
  display: none;
}

.dock-item:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.dock-item:hover i {
  transform: translateY(-2px);
}

.dock-item.active {
  background: var(--gold-dim);
  color: var(--gold-primary);
}

.dock-item.admin-only {
  display: none;
}

.dock-item.admin-only.visible {
  display: flex;
}

.dock-divider {
  width: 1px;
  height: 32px;
  background: var(--border-primary);
  margin: 0 8px;
}

.dock-logout {
  color: var(--color-danger);
}

.dock-logout:hover {
  background: rgba(239, 68, 68, 0.1);
  color: var(--color-danger);
}

/* Action buttons in dock */
.dock-item.action-btn {
  background: var(--bg-tertiary);
}

.dock-item.action-btn:hover {
  background: var(--gold-dim);
  color: var(--gold-primary);
}

.dock-item.action-btn i {
  font-size: 18px;
}

/* Show labels on hover for dock items */
.dock-item:hover span {
  display: block;
  animation: fadeInUp 0.15s ease;
}

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

/* ==========================================================================
   Top Bar
   ========================================================================== */
.top-bar {
  height: var(--header-height);
  padding: 0 32px;
  background: var(--bg-header);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-primary);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
}

.top-bar-left,
.top-bar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.page-title {
  font-size: 20px;
  font-weight: 700;
}

.notification-badge {
  position: relative;
}

.badge-dot {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 8px;
  height: 8px;
  background: var(--color-danger);
  border-radius: 50%;
  border: 2px solid var(--bg-primary);
}

/* ==========================================================================
   Content Area
   ========================================================================== */
.content-area {
  padding: 32px;
}

.view {
  display: none;
  animation: fadeIn 0.3s ease;
}

.view.active {
  display: block;
  animation: fadeIn 0.25s ease;
}

/* Used by switchView() to hide non-active views */
.view-hidden {
  display: none !important;
}

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

/* ==========================================================================
   Stats Grid
   ========================================================================== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
  margin-bottom: 32px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: all var(--transition-base);
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--stat-color);
  opacity: 0;
  transition: opacity var(--transition-base);
}

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

.stat-card:hover::before {
  opacity: 1;
}

.stat-gold { --stat-color: var(--gold-primary); }
.stat-green { --stat-color: var(--color-success); }
.stat-red { --stat-color: var(--color-danger); }
.stat-purple { --stat-color: var(--color-purple); }

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background: var(--gold-dim);
  color: var(--gold-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

.stat-gold .stat-icon { background: var(--gold-dim); color: var(--gold-primary); }
.stat-green .stat-icon { background: rgba(16, 185, 129, 0.15); color: var(--color-success); }
.stat-red .stat-icon { background: rgba(239, 68, 68, 0.15); color: var(--color-danger); }
.stat-purple .stat-icon { background: rgba(139, 92, 246, 0.15); color: var(--color-purple); }

.stat-content {
  flex: 1;
}

.stat-label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.stat-value {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
}

.stat-value .currency {
  font-size: 14px;
  color: var(--text-secondary);
  margin-right: 4px;
}

.stat-trend {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}

.stat-trend.positive { color: var(--color-success); }
.stat-trend.negative { color: var(--color-danger); }

/* ==========================================================================
   Cards
   ========================================================================== */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 20px;
  transition: all var(--transition-base);
}

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

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.card-title {
  font-size: 16px;
  font-weight: 600;
}

.card-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.card-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 500;
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-muted);
}

.status-dot.active {
  background: var(--color-success);
  box-shadow: 0 0 8px var(--color-success);
}

/* ==========================================================================
   Balance Card Premium
   ========================================================================== */
.balance-card-premium {
  background: linear-gradient(135deg, var(--bg-card) 0%, rgba(212, 175, 55, 0.03) 100%);
  border-color: var(--border-accent);
}

.balance-amount {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 16px 0;
}

.balance-currency {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-secondary);
}

.balance-value {
  font-family: var(--font-display);
  font-size: 36px;
  font-weight: 700;
  background: linear-gradient(135deg, var(--gold-primary) 0%, var(--gold-light) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.balance-details {
  display: flex;
  gap: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--border-primary);
}

.balance-detail {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.detail-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* ==========================================================================
   Quick Actions
   ========================================================================== */
.quick-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 12px;
}

.action-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 16px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 500;
}

.action-btn:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-accent);
  color: var(--text-primary);
  transform: translateY(-2px);
}

.action-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: var(--gold-dim);
  color: var(--gold-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}

.action-pay .action-icon { background: rgba(239, 68, 68, 0.15); color: var(--color-danger); }
.action-charge .action-icon { background: rgba(16, 185, 129, 0.15); color: var(--color-success); }
.action-transfer .action-icon { background: rgba(59, 130, 246, 0.15); color: var(--color-info); }
.action-history .action-icon { background: rgba(139, 92, 246, 0.15); color: var(--color-purple); }

/* ==========================================================================
   Dashboard Grid
   ========================================================================== */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 400px;
  gap: 24px;
}

.grid-column {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* ==========================================================================
   Widget Cards
   ========================================================================== */
.widget-card {
  position: relative;
  transition: all 0.3s ease;
}

.widget-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(0,0,0,0.3);
}

.widget-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.widget-card:hover::before {
  opacity: 1;
}

.widget-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}

.widget-icon.green { background: rgba(16, 185, 129, 0.15); color: var(--color-success); }
.widget-icon.gold { background: var(--gold-dim); color: var(--gold-primary); }

.widget-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.charge-result {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--border-primary);
}

.qr-container {
  display: flex;
  justify-content: center;
  margin-bottom: 16px;
}

.qr-container img {
  width: 200px;
  height: 200px;
  border-radius: var(--radius-md);
  background: white;
  padding: 12px;
}

.copy-code {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.copy-code label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-muted);
}

.input-with-button {
  display: flex;
  gap: 8px;
}

.input-with-button input {
  flex: 1;
  font-family: var(--font-mono);
  font-size: 11px;
}

.fee-info,
.fee-display {
  display: flex;
  justify-content: space-between;
  padding: 12px;
  background: var(--gold-dim);
  border-radius: var(--radius-sm);
  font-size: 12px;
  color: var(--text-secondary);
  flex-wrap: wrap;
  gap: 8px;
}

.fee-info strong,
.fee-display strong {
  color: var(--gold-primary);
}

/* Hover effect on primary buttons inside widget forms */
.widget-form .btn-primary.btn-full:hover {
  filter: brightness(1.15);
  transform: scale(1.01);
  box-shadow: 0 4px 20px rgba(212,168,83,0.3);
}

.widget-form .btn-primary.btn-full:active {
  transform: scale(0.98);
  filter: brightness(0.95);
}

/* ==========================================================================
   Monitor
   ========================================================================== */
.monitor-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  padding: 4px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
}

.monitor-tab {
  flex: 1;
  padding: 8px 12px;
  background: none;
  border: none;
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

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

.monitor-tab.active {
  background: var(--bg-card);
  color: var(--gold-primary);
}

.tab-count {
  padding: 2px 6px;
  background: var(--bg-tertiary);
  border-radius: 10px;
  font-size: 10px;
}

.monitor-content {
  max-height: 280px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border-primary) transparent;
}

.monitor-content::-webkit-scrollbar {
  width: 4px;
}

.monitor-content::-webkit-scrollbar-thumb {
  background: var(--border-primary);
  border-radius: 4px;
}

.monitor-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px;
  color: var(--text-muted);
  text-align: center;
  background: rgba(255,255,255,0.02);
  border-radius: var(--radius-sm);
  border: 1px dashed var(--border-primary);
}

.monitor-empty i {
  font-size: 28px;
  margin-bottom: 10px;
  opacity: 0.25;
}

.monitor-empty span {
  font-size: 13px;
}

/* ==========================================================================
   Tables
   ========================================================================== */
.table-container {
  overflow-x: auto;
  border-radius: var(--radius-md);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.data-table th {
  padding: 12px 16px;
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  background: var(--bg-tertiary);
  border-bottom: 1px solid var(--border-primary);
}

.data-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-primary);
}

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

.data-table tr:hover td {
  background: var(--bg-tertiary);
}

.empty-state {
  text-align: center;
  padding: 40px 20px !important;
  color: var(--text-muted);
}

.empty-state i {
  display: block;
  font-size: 32px;
  margin-bottom: 12px;
  opacity: 0.3;
}

/* ==========================================================================
   Forms
   ========================================================================== */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 6px;
}

.form-group label i {
  font-size: 11px;
  color: var(--text-muted);
}

.form-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.input-with-prefix {
  position: relative;
}

.input-with-prefix .prefix {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-weight: 600;
  font-size: 13px;
  pointer-events: none;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
textarea,
select {
  width: 100%;
  padding: 10px 12px;
  background: var(--bg-tertiary);
}

.input-with-prefix input {
  padding-left: 36px !important;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
textarea,
select {
  width: 100%;
  padding: 12px 14px;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--border-secondary);
  border-radius: 0;
  color: var(--gold-primary);
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 500;
  transition: all var(--transition-fast);
}

input::placeholder,
textarea::placeholder {
  color: var(--text-muted);
  font-weight: 400;
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-bottom-color: var(--gold-primary);
  background: var(--gold-dim);
}

input:focus::placeholder,
textarea:focus::placeholder {
  color: transparent;
}

textarea {
  resize: vertical;
  min-height: 80px;
  padding-top: 12px;
}

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.btn:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-secondary);
}

.btn-primary {
  background: linear-gradient(135deg, var(--gold-primary) 0%, var(--gold-dark) 100%);
  border-color: var(--gold-primary);
  color: #000;
  box-shadow: var(--shadow-gold);
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--gold-light) 0%, var(--gold-primary) 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(212, 175, 55, 0.3);
}

.btn-secondary {
  background: var(--bg-tertiary);
}

.btn-full {
  width: 100%;
}

.btn-small {
  padding: 6px 12px;
  font-size: 12px;
}

.btn-text {
  background: none;
  border: none;
  color: var(--gold-primary);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
}

.btn-text:hover {
  color: var(--gold-light);
}

.btn-icon {
  width: 36px;
  height: 36px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-icon:hover {
  background: var(--bg-card-hover);
  color: var(--gold-primary);
  border-color: var(--border-accent);
}

/* ==========================================================================
   Admin — Client Management
   ========================================================================== */
.admin-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Filter bar */
.admin-client-filter {
  display: flex;
  gap: 4px;
  padding: 12px 16px 0;
  border-bottom: 1px solid var(--border-primary);
  overflow-x: auto;
  scrollbar-width: none;
}
.admin-client-filter::-webkit-scrollbar { display: none; }

.admin-filter-btn {
  padding: 8px 16px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}
.admin-filter-btn:hover { color: var(--text-primary); }
.admin-filter-btn.active {
  color: var(--gold-primary);
  border-bottom-color: var(--gold-primary);
}

/* Status badges */
.badge-pending   { background: rgba(251, 191,  36, 0.15); color: #f59e0b; }
.badge-approved  { background: rgba( 16, 185, 129, 0.15); color: var(--color-success); }
.badge-suspended { background: rgba(239,  68,  68, 0.15); color: var(--color-danger); }

/* Admin hint text */
.admin-hint {
  font-size: 11px;
  color: var(--text-muted);
  font-style: italic;
}

/* Fees display in table */
.fees-cell {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
}
.fees-cell strong { color: var(--text-primary); }

/* Action buttons row in admin table */
.admin-row-actions {
  display: flex;
  gap: 6px;
  align-items: center;
}
.btn-config {
  background: var(--gold-dim);
  border-color: var(--gold-primary);
  color: var(--gold-primary);
}
.btn-config:hover {
  background: var(--gold-primary);
  color: #000;
}

/* Per-Client Config Modal */
.client-config-section {
  padding: 8px 0;
}

.config-section-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.config-section-title i { color: var(--gold-primary); }

.status-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.status-btn {
  flex: 1;
  min-width: 100px;
  justify-content: center;
}

.btn-approve {
  background: rgba(16, 185, 129, 0.15);
  border-color: var(--color-success);
  color: var(--color-success);
}
.btn-approve:hover {
  background: var(--color-success);
  color: #fff;
}
.btn-approve.current {
  background: var(--color-success);
  color: #fff;
}

.btn-suspend {
  background: rgba(239, 68, 68, 0.15);
  border-color: var(--color-danger);
  color: var(--color-danger);
}
.btn-suspend:hover {
  background: var(--color-danger);
  color: #fff;
}
.btn-suspend.current {
  background: var(--color-danger);
  color: #fff;
}

.status-btn.current {
  background: var(--gold-dim);
  border-color: var(--gold-primary);
  color: var(--gold-primary);
}

.config-status-info {
  font-size: 12px;
  color: var(--text-muted);
}

.config-status-info strong {
  color: var(--text-primary);
}

.status-confirmed {
  color: var(--color-success) !important;
  font-weight: 600;
}

.status-not-confirmed {
  color: var(--color-danger) !important;
  font-weight: 600;
}

.config-divider {
  height: 1px;
  background: var(--border-primary);
  margin: 16px 0;
}

/* ==========================================================================
   Toast
   ========================================================================== */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border-primary);
  border-left: 4px solid var(--gold-primary);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  z-index: 1000;
  animation: slideInRight 0.3s ease;
}

.toast-icon {
  color: var(--gold-primary);
  font-size: 18px;
}

.toast-content {
  font-size: 13px;
  font-weight: 500;
}

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

/* ==========================================================================
   Utilities
   ========================================================================== */
.hidden {
  display: none !important;
}

/* ==========================================================================
   Global Touch / Mobile UX
   ========================================================================== */
* {
  -webkit-tap-highlight-color: transparent;
  touch-action: pan-y;
}
button, a, [role="button"] {
  touch-action: manipulation; /* remove 300ms click delay */
}
input, textarea, select {
  touch-action: pan-y;
}

/* ==========================================================================
   Modals
   ========================================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 5000;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.modal-overlay.visible {
  opacity: 1;
}

.modal {
  background: var(--bg-card);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-xl);
  padding: 28px;
  width: 100%;
  max-width: 480px;
  box-shadow: var(--shadow-lg);
  transform: translateY(20px);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-overlay.visible .modal {
  transform: translateY(0);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-primary);
}

.modal-header h3 {
  font-size: 16px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
}

.modal-header h3 i {
  color: var(--gold-primary);
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 16px;
  cursor: pointer;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
  flex-shrink: 0;
}

.modal-close:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.modal-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.modal-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.modal-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 8px;
}

/* Activation modal specific */
.activation-info {
  text-align: center;
  padding: 8px 0;
}

/* ═══════════════════════════════════════════════════════════════
   Developer Bio Card
   ═══════════════════════════════════════════════════════════════ */

.dev-card {
  width: min(480px, 92%);
  background: linear-gradient(145deg, #121218, #0a0a0f);
  border-radius: 20px;
  padding: 36px 32px;
  position: relative;
  text-align: center;
  max-height: 85vh;
  overflow-y: auto;
  border: 1px solid rgba(212, 168, 83, 0.15);
  box-shadow: 0 0 40px rgba(212, 168, 83, 0.08), inset 0 1px 0 rgba(212, 168, 83, 0.06);
}

.dev-avatar {
  width: 80px;
  height: 80px;
  margin: 0 auto 20px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold-primary), #b8913a);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  box-shadow: 0 0 30px rgba(212, 168, 83, 0.25);
}

.dev-tags {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.dev-tags span {
  padding: 6px 16px;
  border-radius: 999px;
  background: rgba(212, 168, 83, 0.08);
  border: 1px solid rgba(212, 168, 83, 0.15);
  color: var(--gold-primary);
  font-size: 12px;
  font-weight: 600;
  transition: all 0.2s ease;
}

.dev-tags span:hover {
  background: rgba(212, 168, 83, 0.15);
  border-color: rgba(212, 168, 83, 0.3);
}

@media (max-width: 480px) {
  .dev-card {
    padding: 28px 20px;
  }
  .dev-avatar {
    width: 64px;
    height: 64px;
    font-size: 28px;
  }
  .dev-card h2 {
    font-size: 22px !important;
  }
  .dev-tags span {
    padding: 5px 12px;
    font-size: 11px;
  }
}

.activation-info p {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 8px;
  line-height: 1.6;
}

.activation-note {
  font-size: 12px !important;
  color: var(--text-muted) !important;
}

.activation-waiting {
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
  margin: 8px 0;
}

/* PIX Keys empty state */
.pix-keys-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  color: var(--text-muted);
  text-align: center;
  gap: 12px;
}

.pix-keys-empty i {
  font-size: 32px;
  opacity: 0.3;
}



/* ── 1200px: collapse two-column layouts ── */
@media (max-width: 1200px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
  .admin-grid {
    grid-template-columns: 1fr;
  }
}

/* ── 768px: tablets & large phones ── */
@media (max-width: 768px) {

  /* Content padding */
  .content-area {
    padding: 16px 12px 100px; /* extra bottom for dock */
  }

  /* Top bar */
  .top-bar {
    padding: 0 12px;
    height: 52px;
  }
  .page-title {
    font-size: 16px;
  }
  .user-info {
    display: none !important;
  }

  /* Stats grid — 2 columns on tablet */
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 16px;
  }
  .stat-card {
    padding: 16px 14px;
    gap: 12px;
  }
  .stats-grid .stat-card[style*="span 2"] {
    grid-column: 1 / -1 !important;
  }
  .stat-icon {
    width: 42px;
    height: 42px;
    font-size: 18px;
  }
  .stat-value {
    font-size: 20px;
  }
  .stat-label {
    font-size: 11px;
  }
  .stat-trend {
    display: none; /* hide trend % on small screens */
  }

  /* Balance card */
  .balance-value {
    font-size: 30px;
  }
  .balance-details {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 12px;
  }

  /* Quick actions — 4 cols on tablet */
  .quick-actions {
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
  }
  .action-btn {
    padding: 12px 8px;
    font-size: 11px;
  }
  .action-icon {
    width: 36px;
    height: 36px;
    font-size: 14px;
  }

  /* Cards */
  .card {
    padding: 16px;
    margin-bottom: 12px;
  }
  .card-header {
    margin-bottom: 14px;
  }

  /* Forms */
  .form-row-2 {
    grid-template-columns: 1fr;
  }

  /* Admin grid */
  .admin-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  /* Toast */
  .toast {
    bottom: 80px; /* above dock */
    right: 12px;
    left: 12px;
    width: auto;
    font-size: 13px;
  }

  /* PIX view grid */
  #view-pix .dashboard-grid {
    grid-template-columns: 1fr;
  }

  /* TX summary */
  .tx-summary-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
  .tx-sum-value {
    font-size: 15px;
  }

  /* Modal */
  .modal-overlay {
    padding: 0;
    align-items: flex-end;
  }
  .modal {
    border-radius: 20px 20px 0 0;
    width: 100%;
    max-width: 100%;
    max-height: 92vh;
    overflow-y: auto;
  }
}

/* ── 480px: phones ── */
@media (max-width: 480px) {

  /* ─ Dock: full-width scrollable bottom nav bar — ALL items visible ─ */
  .dock {
    left: 0;
    right: 0;
    bottom: 0;
    transform: none;
    width: 100%;
    border-radius: 0;
    /* Horizontal scroll to fit all items */
    overflow-x: auto;
    overflow-y: visible;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    flex-wrap: nowrap;
    justify-content: flex-start;
    gap: 0;
    padding: 4px 4px env(safe-area-inset-bottom);
    border-top: 1px solid var(--border-primary);
    border-left: none;
    border-right: none;
    border-bottom: none;
    border-radius: 0;
    box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.6);
  }
  .dock::-webkit-scrollbar { display: none; }

  /* Hide dividers — waste of space on mobile */
  .dock-divider {
    display: none !important;
  }

  /* All dock items visible, equal width, scroll-snap */
  .dock-item:not(.admin-only),
  .dock-item.admin-only.visible,
  .dock-item.action-btn,
  .dock-item.dock-action {
    display: flex !important;
    flex: 0 0 auto;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 68px;
    padding: 6px 4px;
    gap: 3px;
    scroll-snap-align: start;
    border-radius: var(--radius-md);
  }

  .dock-item i {
    font-size: 20px;
  }

  /* Labels always visible */
  .dock-item span {
    display: block !important;
    animation: none;
    font-size: 9px;
    font-weight: 600;
    text-align: center;
    white-space: nowrap;
  }

  /* Active state: gold underline */
  .dock-item.active {
    background: var(--gold-dim);
    color: var(--gold-primary);
    border-bottom: 2px solid var(--gold-primary);
    padding-bottom: 4px;
  }

  /* Action items: subtle teal tint */
  .dock-item.dock-action {
    color: var(--text-muted);
  }
  .dock-item.dock-action:hover,
  .dock-item.dock-action:active {
    background: var(--bg-tertiary);
    color: var(--text-primary);
  }



  /* Space for dock at bottom */
  .main-content {
    padding-bottom: calc(72px + env(safe-area-inset-bottom));
  }

  /* Content area padding */
  .content-area {
    padding: 12px 10px calc(84px + env(safe-area-inset-bottom));
  }

  /* ─ Top bar ─ */
  .top-bar {
    padding: 0 10px;
    height: 48px;
  }
  .page-title {
    font-size: 15px;
  }
  .btn-icon {
    width: 32px;
    height: 32px;
    font-size: 13px;
  }

  /* ─ Login card ─ */
  .login-card {
    padding: 24px 20px;
    border-radius: 16px;
  }
  .login-logo img {
    width: 52px;
    height: 52px;
  }
  .login-brand {
    font-size: 16px;
  }

  /* ─ Stats grid — 2 cols on phone ─ */
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-bottom: 12px;
  }
  .stat-card {
    padding: 14px 12px;
    gap: 10px;
  }
  .stat-icon {
    width: 36px;
    height: 36px;
    font-size: 15px;
  }
  .stat-value {
    font-size: 17px;
  }
  .stat-value .currency {
    font-size: 12px;
  }

  /* ─ Balance card ─ */
  .balance-card-premium {
    padding: 16px;
  }
  .balance-currency {
    font-size: 16px;
  }
  .balance-value {
    font-size: 28px;
  }
  .balance-details {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 12px;
  }
  .detail-label {
    font-size: 10px;
  }

  /* ─ Quick Actions — 2x2 grid ─ */
  .quick-actions {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }
  .action-btn {
    padding: 14px 10px;
    font-size: 11px;
    gap: 6px;
  }
  .action-icon {
    width: 36px;
    height: 36px;
    font-size: 14px;
  }

  /* ─ Cards ─ */
  .card {
    padding: 14px;
    border-radius: 12px;
    margin-bottom: 10px;
  }
  .card-title {
    font-size: 14px;
  }

  /* ─ Tables: horizontal scroll with touch momentum ─ */
  .table-container {
    -webkit-overflow-scrolling: touch;
    overflow-x: auto;
    margin: 0 -14px;
    padding: 0 14px;
  }
  .data-table th,
  .data-table td {
    padding: 10px 12px;
    font-size: 12px;
    white-space: nowrap;
  }
  .data-table th {
    font-size: 10px;
  }

  /* ─ Inputs & forms ─ */
  input[type="text"],
  input[type="email"],
  input[type="password"],
  input[type="number"],
  textarea,
  select {
    font-size: 16px; /* prevents iOS auto-zoom */
    padding: 12px 14px;
  }
  .form-group label {
    font-size: 11px;
  }
  .form-row-2 {
    grid-template-columns: 1fr;
  }

  /* ─ Buttons ─ */
  .btn {
    padding: 12px 18px;
    font-size: 13px;
    min-height: 44px; /* Apple HIG minimum tap target */
  }
  .btn-small {
    padding: 8px 12px;
    font-size: 12px;
    min-height: 36px;
  }

  /* ─ QR code ─ */
  .qr-container img {
    width: 180px;
    height: 180px;
  }

  /* ─ Toast: anchored above dock ─ */
  .toast {
    bottom: calc(68px + env(safe-area-inset-bottom));
    right: 10px;
    left: 10px;
    padding: 12px 16px;
    font-size: 13px;
  }

  /* ─ Modals: full-screen bottom sheet ─ */
  .modal-overlay {
    align-items: flex-end;
    padding: 0;
  }
  .modal {
    width: 100%;
    max-width: 100%;
    border-radius: 20px 20px 0 0;
    max-height: 90vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 20px 16px calc(16px + env(safe-area-inset-bottom));
  }
  .modal-activation,
  .modal-qr {
    width: 100%;
    max-width: 100%;
    border-radius: 20px 20px 0 0;
  }
  .modal-header {
    padding-bottom: 16px;
    margin-bottom: 16px;
  }
  .modal-actions {
    flex-direction: column;
    gap: 10px;
  }
  .modal-actions .btn {
    width: 100%;
  }

  /* ─ Transaction view ─ */
  .tx-page-header {
    flex-direction: column;
    align-items: flex-start;
    margin-bottom: 14px;
    gap: 10px;
  }
  .tx-page-title {
    font-size: 18px;
  }
  .tx-header-actions {
    width: 100%;
    gap: 8px;
  }
  .tx-header-actions .btn {
    flex: 1;
    justify-content: center;
  }

  .tx-summary-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-bottom: 12px;
  }
  .tx-summary-card {
    padding: 12px;
    gap: 10px;
  }
  .tx-sum-icon {
    width: 36px;
    height: 36px;
    font-size: 15px;
  }
  .tx-sum-label {
    font-size: 10px;
  }
  .tx-sum-value {
    font-size: 14px;
  }

  .tx-filter-tabs {
    padding: 0;
    gap: 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .tx-tab {
    padding: 12px 14px;
    font-size: 12px;
    gap: 6px;
    flex-shrink: 0;
  }
  .tx-tab span:first-of-type {
    display: none; /* hide text, show only icon + count on very small screens */
  }
  .tx-tab-count {
    font-size: 10px;
    min-width: 18px;
    height: 18px;
  }

  .tx-search-row {
    flex-direction: column;
    gap: 10px;
    padding: 12px 14px;
  }
  .tx-search-box {
    min-width: unset;
  }
  .tx-search-box input {
    font-size: 16px;
  }
  .tx-period-group {
    width: 100%;
    flex-direction: row;
    justify-content: space-between;
  }
  .tx-period-group select,
  .tx-sort-group select {
    font-size: 13px;
    padding: 8px 10px;
  }

  .tx-table-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    padding: 12px 14px;
  }
  .tx-sort-group {
    width: 100%;
    justify-content: space-between;
  }
  .tx-sort-group select {
    flex: 1;
  }

  .tx-data-table {
    min-width: 640px;
  }

  .tx-pagination {
    padding: 12px 14px;
    gap: 4px;
  }
  .tx-page-btn {
    width: 28px;
    height: 28px;
    font-size: 11px;
  }

  /* ─ Admin stats ─ */
  #view-admin .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  /* ─ PIX keys list ─ */
  .pix-keys-empty {
    padding: 30px 16px;
  }

  /* ─ Monitor ─ */
  .monitor-content {
    max-height: 200px;
  }

  /* ─ Fee display ─ */
  .fee-display {
    flex-direction: column;
    gap: 6px;
    font-size: 12px;
  }

  /* ─ Input prefix ─ */
  .input-with-prefix .prefix {
    font-size: 14px !important;
    padding-left: 10px !important;
  }
  .input-with-prefix input {
    font-size: 16px !important;
    padding: 10px 8px !important;
  }

  /* ─ Scan button ─ */
  #btn-scan-qr,
  #btn-scan-qr-2,
  #btn-scan-qr-modal {
    min-width: 44px !important;
  }
  #btn-scan-qr span,
  #btn-scan-qr-2 span,
  #btn-scan-qr-modal span {
    display: none !important;
  }
  #btn-scan-qr i,
  #btn-scan-qr-2 i,
  #btn-scan-qr-modal i {
    font-size: 18px !important;
  }

  /* ─ Modals ─ */
  .modal {
    padding: 20px !important;
    margin: 10px;
  }

  /* ─ Admin stats grid on small screens ─ */
  .stats-grid .stat-card[style*="span 2"],
  .stats-grid .stat-card[style*="span 2"] {
    grid-column: span 2 !important;
  }
}

/* ── 360px: very small phones (Galaxy A series etc) ── */
@media (max-width: 360px) {
  .stats-grid {
    grid-template-columns: 1fr 1fr;
    gap: 6px;
  }
  .stat-card {
    padding: 10px;
    gap: 8px;
  }
  .stat-icon {
    width: 32px;
    height: 32px;
    font-size: 13px;
  }
  .stat-value {
    font-size: 15px;
  }
  .balance-value {
    font-size: 24px;
  }
  .dock-item {
    padding: 6px 2px;
  }
  .dock-item i {
    font-size: 17px;
  }
  .dock-item span {
    font-size: 8px;
  }
  .content-area {
    padding: 10px 8px calc(80px + env(safe-area-inset-bottom));
  }
  .card {
    padding: 12px;
  }
}

/* ── Landscape phones: horizontal mode ── */
@media (max-width: 768px) and (orientation: landscape) {
  .dock {
    top: 0;
    bottom: auto;
    left: 0;
    right: auto;
    width: 60px;
    height: 100vh;
    flex-direction: column;
    border-radius: 0;
    border-right: 1px solid var(--border-primary);
    border-top: none;
    padding: 12px 4px;
    justify-content: flex-start;
    gap: 4px;
  }
  .dock-divider {
    display: block !important;
    width: 32px;
    height: 1px;
    margin: 4px auto;
  }
  .dock-item.action-btn {
    display: none !important;
  }
  .dock-item {
    width: 100%;
    padding: 10px 4px;
  }
  .dock-item span {
    font-size: 8px;
  }
  .main-content {
    padding-bottom: 0;
    padding-left: 60px;
  }
  .content-area {
    padding: 12px;
  }
  .stats-grid {
    grid-template-columns: repeat(4, 1fr);
  }
  .quick-actions {
    grid-template-columns: repeat(4, 1fr);
  }
  .toast {
    bottom: 16px;
    right: 16px;
    left: auto;
  }
}

/* ── Safe area insets for notched iPhones ── */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
  .dock {
    padding-bottom: calc(8px + env(safe-area-inset-bottom));
  }
}



/* ==========================================================================
   Transactions View — Full Featured
   ========================================================================== */

/* Page Header */
.tx-page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 24px;
  gap: 16px;
  flex-wrap: wrap;
}

.tx-page-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.tx-page-sub {
  font-size: 13px;
  color: var(--text-muted);
}

.tx-header-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

/* Summary Cards */
.tx-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}

.tx-summary-card {
  background: var(--bg-card);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  transition: all var(--transition-base);
  position: relative;
  overflow: hidden;
}

.tx-summary-card::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--tx-card-color, var(--border-primary));
  opacity: 0;
  transition: opacity var(--transition-base);
}

.tx-summary-card:hover::after { opacity: 1; }
.tx-summary-card:hover {
  border-color: var(--border-secondary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.tx-sum-all  { --tx-card-color: var(--gold-primary); }
.tx-sum-in   { --tx-card-color: var(--color-success); }
.tx-sum-out  { --tx-card-color: var(--color-danger); }
.tx-sum-fees { --tx-card-color: var(--color-purple); }

.tx-sum-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.tx-sum-all  .tx-sum-icon { background: var(--gold-dim);                     color: var(--gold-primary); }
.tx-sum-in   .tx-sum-icon { background: rgba(16, 185, 129, 0.15);            color: var(--color-success); }
.tx-sum-out  .tx-sum-icon { background: rgba(239, 68, 68, 0.15);             color: var(--color-danger); }
.tx-sum-fees .tx-sum-icon { background: rgba(139, 92, 246, 0.15);            color: var(--color-purple); }

.tx-sum-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.tx-sum-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.tx-sum-value {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
}

/* Controls Card */
.tx-controls-card {
  padding: 0;
  overflow: hidden;
  margin-bottom: 20px;
}

/* Filter Tabs */
.tx-filter-tabs {
  display: flex;
  align-items: center;
  gap: 0;
  padding: 0 4px;
  border-bottom: 1px solid var(--border-primary);
  overflow-x: auto;
  scrollbar-width: none;
}

.tx-filter-tabs::-webkit-scrollbar { display: none; }

.tx-tab {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 18px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.tx-tab i {
  font-size: 12px;
}

.tx-tab:hover {
  color: var(--text-primary);
  background: var(--bg-tertiary);
}

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

.tx-tab-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  background: var(--bg-tertiary);
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  transition: all var(--transition-fast);
}

.tx-tab.active .tx-tab-count {
  background: var(--gold-dim);
  color: var(--gold-primary);
}

/* Search & Period Row */
.tx-search-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  flex-wrap: wrap;
}

.tx-search-box {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  min-width: 200px;
  transition: border-color var(--transition-fast);
}

.tx-search-box:focus-within {
  border-color: var(--gold-primary);
}

.tx-search-box i {
  color: var(--text-muted);
  font-size: 13px;
  flex-shrink: 0;
}

.tx-search-box input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 13px;
}

.tx-search-box input::placeholder {
  color: var(--text-muted);
}

.tx-period-group {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.tx-period-group label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  white-space: nowrap;
}

.tx-period-group select,
.tx-sort-group select {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-md);
  padding: 8px 12px;
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  outline: none;
  transition: border-color var(--transition-fast);
}

.tx-period-group select:hover,
.tx-sort-group select:hover,
.tx-period-group select:focus,
.tx-sort-group select:focus {
  border-color: var(--gold-primary);
}

/* Table Card */
.tx-table-card {
  padding: 0;
  overflow: hidden;
}

.tx-table-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-primary);
  flex-wrap: wrap;
  gap: 12px;
}

.tx-result-count {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
}

.tx-sort-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.tx-sort-group label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  white-space: nowrap;
}

/* Enhanced Table */
.tx-data-table {
  min-width: 780px;
}

.tx-data-table tbody tr {
  cursor: default;
  transition: background var(--transition-fast);
}

.tx-data-table tbody tr:hover {
  background: var(--bg-tertiary);
}

/* Transaction row type indicators */
.tx-type-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
}

.tx-type-in {
  background: rgba(16, 185, 129, 0.12);
  color: var(--color-success);
}

.tx-type-out {
  background: rgba(239, 68, 68, 0.12);
  color: var(--color-danger);
}

/* Amount styling */
.tx-amount-in  { color: var(--color-success); font-weight: 600; }
.tx-amount-out { color: var(--color-danger);  font-weight: 600; }

.tx-amount-in::before  { content: '+'; }
.tx-amount-out::before { content: '-'; }

/* Row number */
.tx-row-num {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
}

/* Date/time cell */
.tx-date-cell {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.tx-date {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
}

.tx-time {
  font-size: 11px;
  color: var(--text-muted);
}

/* Description cell */
.tx-desc-cell {
  max-width: 200px;
}

.tx-desc-text {
  font-size: 13px;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}

.tx-id-text {
  font-size: 10px;
  color: var(--text-muted);
  font-family: monospace;
}

/* Fee cell */
.tx-fee {
  font-size: 12px;
  color: var(--text-muted);
}

/* Pagination */
.tx-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 16px 20px;
  border-top: 1px solid var(--border-primary);
  flex-wrap: wrap;
}

.tx-page-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.tx-page-btn:hover {
  border-color: var(--gold-primary);
  color: var(--gold-primary);
}

.tx-page-btn.active {
  background: var(--gold-dim);
  border-color: var(--gold-primary);
  color: var(--gold-primary);
}

.tx-page-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* Responsive */
@media (max-width: 900px) {
  .tx-summary-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .tx-summary-grid {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  .tx-page-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .tx-search-row {
    flex-direction: column;
    align-items: stretch;
  }

  .tx-period-group {
    width: 100%;
  }

  .tx-period-group select {
    width: 100%;
  }

  .tx-filter-tabs {
    gap: 0;
    overflow-x: auto;
  }
}

