/* ==========================================================================
   APEX DIGITAL BANK - CORE DESIGN SYSTEM & STYLES
   ========================================================================== */

:root {
  /* Dark Theme Palette (Default) */
  --bg-base: #070a11;
  --bg-sidebar: #0d121f;
  --bg-panel: rgba(16, 23, 38, 0.75);
  --bg-panel-hover: rgba(22, 32, 54, 0.85);
  --bg-card-glass: rgba(255, 255, 255, 0.04);
  --border-color: rgba(255, 255, 255, 0.08);
  --border-highlight: rgba(0, 245, 155, 0.3);

  /* Typography Colors */
  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
  --text-dark: #64748b;

  /* Brand Accents */
  --accent-emerald: #00f59b;
  --accent-emerald-glow: rgba(0, 245, 155, 0.25);
  --accent-cyan: #00d2ff;
  --accent-cyan-glow: rgba(0, 210, 255, 0.25);
  --accent-gold: #ffb800;
  --accent-red: #ff4757;

  /* Card Gradients */
  --grad-primary: linear-gradient(135deg, #0a192f 0%, #00f59b 150%);
  --grad-card-metal: linear-gradient(135deg, #111827 0%, #1f2937 50%, #111827 100%);
  --grad-gold: linear-gradient(135deg, #2a1f00 0%, #ffb800 150%);

  /* UI Tokens */
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;
  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --shadow-panel: 0 10px 30px -5px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 20px rgba(0, 245, 155, 0.15);
}

/* Light Theme Override */
[data-theme="light"] {
  --bg-base: #f8fafc;
  --bg-sidebar: #ffffff;
  --bg-panel: rgba(255, 255, 255, 0.9);
  --bg-panel-hover: #ffffff;
  --bg-card-glass: rgba(0, 0, 0, 0.03);
  --border-color: rgba(0, 0, 0, 0.08);
  --border-highlight: rgba(0, 180, 110, 0.4);

  --text-main: #0f172a;
  --text-muted: #475569;
  --text-dark: #94a3b8;

  --shadow-panel: 0 10px 30px -5px rgba(0, 0, 0, 0.06);
}

/* Global Reset */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Plus Jakarta Sans', sans-serif;
  -webkit-font-smoothing: antialiased;
}

body {
  background-color: var(--bg-base);
  color: var(--text-main);
  min-height: 100vh;
  overflow-x: hidden;
}

.font-mono {
  font-family: 'JetBrains Mono', monospace;
}

/* Utility Colors */
.text-emerald { color: var(--accent-emerald) !important; }
.text-cyan { color: var(--accent-cyan) !important; }
.text-gold { color: var(--accent-gold) !important; }
.text-red { color: var(--accent-red) !important; }

.bg-emerald { background-color: var(--accent-emerald) !important; }
.bg-cyan { background-color: var(--accent-cyan) !important; }
.bg-gold { background-color: var(--accent-gold) !important; }

/* Main App Grid Layout */
.app-container {
  display: grid;
  grid-template-columns: 270px 1fr;
  min-height: 100vh;
}

/* ==========================================================================
   LOGIN SCREEN OVERLAY
   ========================================================================== */
/* ---- Glassmorphism Login ---- */
.login-overlay {
  position: fixed;
  top: 0; left: 0; width: 100vw; height: 100vh;
  background: radial-gradient(circle at 20% 10%, #0a1622 0%, #060b12 45%, #030609 100%);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 3000;
  overflow: hidden;
}

.login-overlay.active {
  display: flex;
  animation: fadeIn 0.3s ease-out;
}

/* Animated glow orbs behind the glass card */
.login-bg-decor {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.5;
}

.orb-1 {
  width: 420px; height: 420px;
  background: radial-gradient(circle, rgba(0, 245, 155, 0.35), transparent 70%);
  top: -80px; left: -60px;
  animation: orbFloat 14s ease-in-out infinite alternate;
}

.orb-2 {
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(0, 210, 255, 0.28), transparent 70%);
  bottom: -140px; right: -100px;
  animation: orbFloat 18s ease-in-out infinite alternate-reverse;
}

.orb-3 {
  width: 260px; height: 260px;
  background: radial-gradient(circle, rgba(168, 85, 247, 0.22), transparent 70%);
  bottom: 15%; left: 12%;
  animation: orbFloat 11s ease-in-out infinite alternate;
}

@keyframes orbFloat {
  from { transform: translate(0, 0) scale(1); }
  to   { transform: translate(60px, -50px) scale(1.15); }
}

.login-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(circle at 50% 45%, black 0%, transparent 75%);
  -webkit-mask-image: radial-gradient(circle at 50% 45%, black 0%, transparent 75%);
}

/* Frosted glass card */
.login-box {
  position: relative;
  background: rgba(255, 255, 255, 0.045);
  backdrop-filter: blur(28px) saturate(160%);
  -webkit-backdrop-filter: blur(28px) saturate(160%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 28px;
  padding: 46px 42px 34px;
  width: 460px;
  max-width: 90vw;
  box-shadow:
    0 30px 80px rgba(0, 0, 0, 0.65),
    inset 0 1px 0 rgba(255, 255, 255, 0.14);
  animation: loginCardIn 0.55s cubic-bezier(0.175, 0.885, 0.32, 1.1);
}

/* Gradient sheen across the top edge of the glass */
.login-box::before {
  content: '';
  position: absolute;
  top: 0; left: 12%;
  width: 76%; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(0, 245, 155, 0.7), rgba(0, 210, 255, 0.7), transparent);
}

@keyframes loginCardIn {
  from { opacity: 0; transform: translateY(26px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.login-brand {
  text-align: center;
  margin-bottom: 30px;
}

.login-logo {
  filter: drop-shadow(0 0 18px rgba(0, 245, 155, 0.45));
  animation: logoPulse 3.2s ease-in-out infinite;
}

@keyframes logoPulse {
  0%, 100% { filter: drop-shadow(0 0 12px rgba(0, 245, 155, 0.35)); }
  50%      { filter: drop-shadow(0 0 24px rgba(0, 245, 155, 0.6)); }
}

.login-brand h1 {
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: 2px;
  margin-top: 14px;
  background: linear-gradient(135deg, var(--accent-emerald), var(--accent-cyan));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.login-brand p {
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.45);
  margin-top: 4px;
}

/* Glass inputs with icons */
.login-field { margin-bottom: 18px; }

.login-field label {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.5);
  margin-bottom: 8px;
}

.login-input-wrap {
  position: relative;
}

.login-box .login-input-wrap i {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: rgba(255, 255, 255, 0.3);
  font-size: 0.85rem;
  transition: color 0.25s;
}

.login-box .login-input-wrap input {
  width: 100%;
  padding: 14px 16px 14px 44px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  color: #fff;
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.25s, background 0.25s, box-shadow 0.25s;
}

.login-box .login-input-wrap input::placeholder { color: rgba(255, 255, 255, 0.25); }

.login-box .login-input-wrap input:focus {
  border-color: rgba(0, 245, 155, 0.6);
  background: rgba(0, 245, 155, 0.05);
  box-shadow: 0 0 0 4px rgba(0, 245, 155, 0.1);
}

.login-box .login-input-wrap input:focus + i,
.login-box .login-input-wrap:focus-within i { color: var(--accent-emerald); }

.login-form .btn-primary,
.login-box .btn-primary {
  margin-top: 6px;
  background: linear-gradient(135deg, #00f59b, #00c9ff);
  border: none;
  box-shadow: 0 10px 30px rgba(0, 245, 155, 0.3);
  transition: transform 0.2s, box-shadow 0.2s;
}

.login-box .btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 40px rgba(0, 245, 155, 0.45);
}

.login-footer {
  margin-top: 26px;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  text-align: center;
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.3);
  letter-spacing: 0.03em;
}

.login-footer i { color: rgba(0, 245, 155, 0.4); margin-right: 4px; }

@media (max-width: 520px) {
  .login-box { padding: 34px 26px 26px; border-radius: 22px; }
}

/* ==========================================================================
   BITCOIN IMPORT MODAL
   ========================================================================== */
.btc-import-card { width: 500px; }
.btc-modal-icon {
  width: 50px; height: 50px;
  border-radius: 50%;
  background: rgba(255, 184, 0, 0.15);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem; margin-bottom: 12px;
}

.import-type-selector {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
  background: var(--bg-base);
  padding: 4px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.type-btn {
  flex: 1;
  text-align: center;
  padding: 8px 12px;
  font-size: 0.8rem;
  font-weight: 700;
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: var(--text-muted);
  transition: var(--transition);
}

.type-btn input { display: none; }

.type-btn.active {
  background: var(--bg-sidebar);
  color: var(--accent-gold);
  box-shadow: 0 0 10px rgba(255, 184, 0, 0.2);
}

#btc-seed-input {
  background: var(--bg-base);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px;
  color: var(--text-main);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85rem;
  width: 100%;
  outline: none;
  resize: none;
}

#btc-seed-input:focus { border-color: var(--accent-gold); }

.seed-word-count {
  font-size: 0.72rem;
  color: var(--accent-gold);
  text-align: right;
  margin-top: 4px;
}

.derived-wallet-box {
  background: var(--bg-base);
  border: 1px solid var(--border-highlight);
  border-radius: var(--radius-md);
  padding: 14px;
  margin: 16px 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 0.82rem;
}

.d-line { display: flex; justify-content: space-between; }

/* ==========================================================================
   SIDEBAR NAVIGATION
   ========================================================================== */
.sidebar {
  background-color: var(--bg-sidebar);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  padding: 24px 18px;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 100;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 24px;
}

.brand-name {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: 1px;
  background: linear-gradient(135deg, var(--accent-emerald), var(--accent-cyan));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-tag {
  display: block;
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 1.5px;
}

.nav-menu {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  color: var(--text-muted);
  text-decoration: none;
  border-radius: var(--radius-md);
  font-weight: 500;
  font-size: 0.92rem;
  transition: var(--transition);
}

.nav-item i {
  font-size: 1.1rem;
  width: 20px;
  text-align: center;
}

.nav-item:hover {
  color: var(--text-main);
  background-color: var(--bg-card-glass);
}

.nav-item.active {
  color: var(--accent-emerald);
  background: var(--accent-emerald-glow);
  font-weight: 700;
  box-shadow: 0 0 15px rgba(0, 245, 155, 0.1);
}

/* Sidebar Widget */
.sidebar-widget {
  background: var(--bg-card-glass);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 20px;
}

.widget-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.widget-balance {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-main);
}

.widget-footer {
  font-size: 0.72rem;
  color: var(--accent-emerald);
  margin-top: 6px;
}

/* User Card in Sidebar */
.user-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-top: 16px;
  border-top: 1px solid var(--border-color);
}

.user-avatar {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-full);
  object-fit: cover;
  border: 2px solid var(--accent-emerald);
}

.user-info {
  flex: 1;
  overflow: hidden;
}

.user-name {
  font-size: 0.88rem;
  font-weight: 700;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.user-role {
  font-size: 0.72rem;
  color: var(--accent-emerald);
}

/* ==========================================================================
   HEADER BAR
   ========================================================================== */
.main-content {
  display: flex;
  flex-direction: column;
  background-color: var(--bg-base);
}

.header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 32px;
  background: var(--bg-sidebar);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 90;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-base);
  border: 1px solid var(--border-color);
  padding: 10px 16px;
  border-radius: var(--radius-full);
  width: 320px;
  transition: var(--transition);
}

.search-box:focus-within {
  border-color: var(--accent-emerald);
  box-shadow: 0 0 12px var(--accent-emerald-glow);
}

.search-box input {
  background: none;
  border: none;
  outline: none;
  color: var(--text-main);
  font-size: 0.88rem;
  width: 100%;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.header-icon-group {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-left: 14px;
  border-left: 1px solid var(--border-color);
}

/* Buttons System */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
  border: none;
  transition: var(--transition);
  outline: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-emerald), #00c87e);
  color: #05101a;
  box-shadow: 0 4px 15px rgba(0, 245, 155, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 245, 155, 0.45);
}

.btn-secondary {
  background: var(--bg-card-glass);
  color: var(--text-main);
  border: 1px solid var(--border-color);
}

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

.btn-emerald {
  background: var(--accent-emerald);
  color: #05101a;
}

.btn-sm {
  padding: 8px 14px;
  font-size: 0.82rem;
}

.btn-lg {
  padding: 14px 28px;
  font-size: 1rem;
}

.btn-block {
  width: 100%;
}

.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  background: var(--bg-card-glass);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
}

.icon-btn:hover {
  background: var(--bg-panel-hover);
  color: var(--accent-emerald);
}

.badge-dot::after {
  content: '';
  position: absolute;
  top: 8px;
  right: 8px;
  width: 8px;
  height: 8px;
  background: var(--accent-emerald);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--accent-emerald);
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-emerald {
  background: rgba(0, 245, 155, 0.15);
  color: var(--accent-emerald);
  border: 1px solid rgba(0, 245, 155, 0.3);
}

.badge-cyan {
  background: rgba(0, 210, 255, 0.15);
  color: var(--accent-cyan);
  border: 1px solid rgba(0, 210, 255, 0.3);
}

.badge-gold {
  background: rgba(255, 184, 0, 0.15);
  color: var(--accent-gold);
  border: 1px solid rgba(255, 184, 0, 0.3);
}

.badge-glass {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
}

/* Notification Panel Dropdown */
.dropdown-wrapper {
  position: relative;
}

.dropdown-panel {
  position: absolute;
  right: 0;
  top: 50px;
  width: 360px;
  background: var(--bg-sidebar);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-panel);
  padding: 16px;
  display: none;
  z-index: 200;
}

.dropdown-panel.show {
  display: block;
  animation: fadeIn 0.2s ease-out;
}

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

.panel-header h3 {
  font-size: 0.95rem;
}

.text-btn {
  background: none;
  border: none;
  color: var(--accent-cyan);
  font-size: 0.78rem;
  cursor: pointer;
}

.notif-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.notif-item {
  display: flex;
  gap: 12px;
  padding: 10px;
  border-radius: var(--radius-md);
  background: var(--bg-card-glass);
  transition: var(--transition);
}

.notif-item.unread {
  border-left: 3px solid var(--accent-emerald);
}

.notif-icon {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
}

.icon-emerald { background: rgba(0, 245, 155, 0.15); color: var(--accent-emerald); }
.icon-cyan { background: rgba(0, 210, 255, 0.15); color: var(--accent-cyan); }
.icon-gold { background: rgba(255, 184, 0, 0.15); color: var(--accent-gold); }

.notif-title { font-size: 0.82rem; font-weight: 700; }
.notif-desc { font-size: 0.75rem; color: var(--text-muted); margin: 2px 0; }
.notif-time { font-size: 0.68rem; color: var(--text-dark); }

/* ==========================================================================
   VIEWS CONTAINER & TABS
   ========================================================================== */
.views-wrapper {
  padding: 32px;
  flex: 1;
}

.tab-view {
  display: none;
}

.tab-view.active {
  display: block;
  animation: fadeIn 0.3s ease-in-out;
}

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

.view-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 28px;
}

.view-header h1 {
  font-size: 1.75rem;
  font-weight: 800;
  margin-bottom: 4px;
}

.view-header p {
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* ==========================================================================
   ROUTING NUMBER RECOGNITION BADGE
   ========================================================================== */
.routing-badge-box {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--bg-base);
  border: 1px solid var(--border-highlight);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  margin-bottom: 16px;
  animation: fadeIn 0.25s ease-out;
}

.routing-icon {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--accent-emerald-glow);
  color: var(--accent-emerald);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
}

.routing-details { flex: 1; }
.routing-title { font-size: 0.92rem; font-weight: 800; }
.routing-sub { font-size: 0.75rem; color: var(--text-muted); }

/* ==========================================================================
   DASHBOARD VIEW
   ========================================================================== */
.welcome-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: linear-gradient(135deg, rgba(0, 245, 155, 0.08), rgba(0, 210, 255, 0.04));
  border: 1px solid var(--border-highlight);
  border-radius: var(--radius-lg);
  padding: 24px 32px;
  margin-bottom: 28px;
}

.welcome-text h1 { font-size: 1.5rem; font-weight: 700; margin-bottom: 6px; }
.welcome-text p { color: var(--text-muted); font-size: 0.9rem; }

.quick-stats-row {
  display: flex;
  gap: 14px;
  align-items: center;
}

.stat-pill {
  background: var(--bg-sidebar);
  border: 1px solid var(--border-color);
  padding: 10px 18px;
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.stat-pill .label { font-size: 0.7rem; color: var(--text-muted); }
.stat-pill .val { font-size: 0.95rem; font-weight: 700; margin-top: 2px; }

/* Balance Cards Grid */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 28px;
}

.balance-card {
  background: var(--bg-panel);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 22px;
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow-panel);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.balance-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
}

.primary-card::before { background: var(--accent-emerald); }
.secondary-card::before { background: var(--accent-cyan); }
.tertiary-card::before { background: #a855f7; }
.crypto-card::before { background: var(--accent-gold); }

.balance-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-highlight);
}

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

.account-type {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-balance {
  font-size: 1.65rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  margin-bottom: 16px;
}

.card-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.75rem;
  color: var(--text-dark);
}

.trend {
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
}

.trend.positive { color: var(--accent-emerald); background: rgba(0, 245, 155, 0.1); }
.trend.negative { color: var(--accent-red); background: rgba(255, 71, 87, 0.1); }

/* Dashboard Chart & Quick Transfer Grid */
.dashboard-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 24px;
  margin-bottom: 28px;
}

.panel {
  background: var(--bg-panel);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow-panel);
}

.panel-header h2 { font-size: 1.15rem; font-weight: 700; }
.panel-sub { font-size: 0.78rem; color: var(--text-muted); margin-top: 2px; }

/* Chart Controls */
.timeframe-selector {
  display: flex;
  background: var(--bg-base);
  padding: 3px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.tf-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  padding: 4px 12px;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.tf-btn.active {
  background: var(--bg-sidebar);
  color: var(--accent-emerald);
}

.chart-summary-row {
  display: flex;
  gap: 24px;
  margin: 16px 0 20px;
}

.summary-item {
  font-size: 0.82rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 8px;
}

.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.dot-emerald { background: var(--accent-emerald); }
.dot-red { background: var(--accent-red); }
.dot-cyan { background: var(--accent-cyan); }

.canvas-container {
  width: 100%;
  position: relative;
}

/* Quick Contacts */
.contacts-scroll {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  padding: 16px 0;
}

.contact-bubble {
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  transition: var(--transition);
}

.contact-bubble img {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid transparent;
  transition: var(--transition);
}

.contact-bubble:hover img {
  border-color: var(--accent-emerald);
  transform: scale(1.08);
}

.contact-name {
  font-size: 0.72rem;
  margin-top: 6px;
  color: var(--text-muted);
}

.quick-transfer-form {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
}

.form-group input, .form-select {
  background: var(--bg-base);
  border: 1px solid var(--border-color);
  padding: 10px 14px;
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-size: 0.88rem;
  outline: none;
  transition: var(--transition);
}

.form-group input:focus, .form-select:focus {
  border-color: var(--accent-emerald);
  box-shadow: 0 0 10px var(--accent-emerald-glow);
}

.input-with-symbol {
  position: relative;
  display: flex;
  align-items: center;
}

.currency-sym {
  position: absolute;
  left: 14px;
  color: var(--text-muted);
  font-weight: 700;
}

.input-with-symbol input {
  padding-left: 30px;
  width: 100%;
}

/* Transactions Table */
.transactions-panel {
  margin-bottom: 28px;
}

.tx-filters {
  display: flex;
  gap: 14px;
  align-items: center;
}

.filter-pills {
  display: flex;
  gap: 6px;
}

.tx-filter-btn {
  background: var(--bg-base);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
}

.tx-filter-btn.active {
  background: var(--accent-emerald);
  color: #05101a;
  border-color: var(--accent-emerald);
}

.input-sm {
  padding: 6px 14px !important;
  font-size: 0.8rem !important;
  width: 180px;
}

.table-responsive {
  overflow-x: auto;
  margin-top: 18px;
}

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

.data-table th {
  padding: 12px 16px;
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border-color);
}

.data-table td {
  padding: 16px;
  font-size: 0.88rem;
  border-bottom: 1px solid var(--border-color);
}

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

.merchant-cell {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
}

.merchant-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  background: var(--bg-base);
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-emerald);
}

.text-right { text-align: right; }

/* ==========================================================================
   ACCOUNTS & CARDS VIEW (3D CREDIT CARD EFFECT & CUSTOM SKINS)
   ========================================================================== */
.cards-view-grid {
  display: grid;
  grid-template-columns: 420px 1fr;
  gap: 32px;
  margin-bottom: 32px;
}

.credit-card-container {
  perspective: 1000px;
  width: 100%;
  height: 240px;
}

.credit-card {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.credit-card.flipped {
  transform: rotateY(180deg);
}

.card-face {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.6);
  transition: background 0.5s ease;
}

/* Card Themes / Skins */
.theme-obsidian .card-front {
  background: linear-gradient(135deg, #0d1527 0%, #1e293b 50%, #091322 100%);
  border: 1px solid rgba(255, 255, 255, 0.15);
}
.theme-obsidian .card-logo-text { color: var(--accent-emerald); }

.theme-emerald .card-front {
  background: linear-gradient(135deg, #022c22 0%, #064e3b 50%, #022c22 100%);
  border: 1px solid rgba(0, 245, 155, 0.4);
}
.theme-emerald .card-logo-text { color: #5eead4; }

.theme-rose .card-front {
  background: linear-gradient(135deg, #4c0519 0%, #881337 50%, #4c0519 100%);
  border: 1px solid rgba(251, 113, 133, 0.4);
}
.theme-rose .card-logo-text { color: #fecdd3; }

.theme-titanium .card-front {
  background: linear-gradient(135deg, #334155 0%, #64748b 50%, #1e293b 100%);
  border: 1px solid rgba(255, 255, 255, 0.3);
}
.theme-titanium .card-logo-text { color: #f8fafc; }

.card-front::after {
  content: '';
  position: absolute;
  top: -50%;
  right: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(0, 245, 155, 0.1) 0%, transparent 60%);
  pointer-events: none;
}

.card-back {
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
  border: 1px solid rgba(255, 255, 255, 0.15);
  transform: rotateY(180deg);
  padding: 0;
}

.card-brand-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.card-logo-text {
  font-weight: 800;
  letter-spacing: 1.5px;
  font-size: 0.95rem;
}

.chip-graphic {
  width: 44px;
  height: 32px;
  background: linear-gradient(135deg, #ffd700, #b8860b);
  border-radius: 6px;
  position: relative;
  overflow: hidden;
}

.card-number {
  font-size: 1.25rem;
  letter-spacing: 2px;
  font-weight: 700;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.card-details-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
}

.card-label { display: block; font-size: 0.62rem; color: var(--text-muted); }
.card-val { font-size: 0.85rem; font-weight: 700; }

.mag-stripe {
  height: 44px;
  background: #05080f;
  margin-top: 24px;
}

.signature-strip {
  background: #cbd5e1;
  margin: 16px 24px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 0 12px;
  color: #0f172a;
}

.back-text {
  font-size: 0.62rem;
  color: var(--text-dark);
  padding: 0 24px 20px;
}

.card-customizer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 16px;
  padding: 12px 16px;
  background: var(--bg-panel);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
}

.customizer-label { font-size: 0.8rem; font-weight: 700; color: var(--text-muted); }
.skin-pickers { display: flex; gap: 10px; }

.skin-btn {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: var(--transition);
}

.skin-btn.active { border-color: #ffffff; transform: scale(1.15); }
.skin-obsidian { background: linear-gradient(135deg, #0d1527, #1e293b); }
.skin-emerald { background: linear-gradient(135deg, #022c22, #00f59b); }
.skin-rose { background: linear-gradient(135deg, #4c0519, #f43f5e); }
.skin-titanium { background: linear-gradient(135deg, #64748b, #cbd5e1); }

.card-actions-bar {
  display: flex;
  gap: 12px;
  margin-top: 14px;
}

/* Switch Toggle Styling */
.switch {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 24px;
}

.switch input { opacity: 0; width: 0; height: 0; }

.slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: #334155;
  transition: .4s;
  border-radius: 34px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .4s;
  border-radius: 50%;
}

input:checked + .slider { background-color: var(--accent-emerald); }
input:checked + .slider:before { transform: translateX(24px); }

.controls-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-top: 16px;
}

.control-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.control-title { font-size: 0.9rem; font-weight: 700; }
.control-desc { font-size: 0.75rem; color: var(--text-muted); }

/* Range Slider */
.limit-slider-box {
  background: var(--bg-base);
  padding: 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  margin-top: 10px;
}

.limit-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
  font-size: 0.82rem;
}

input[type=range] {
  width: 100%;
  accent-color: var(--accent-emerald);
}

.range-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.7rem;
  color: var(--text-dark);
  margin-top: 6px;
}

/* Multi-Currency Vaults */
.vaults-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  margin-top: 16px;
}

.vault-card {
  background: var(--bg-base);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 18px;
}

.vault-flag { font-size: 0.85rem; font-weight: 700; margin-bottom: 4px; }
.vault-title { font-size: 0.75rem; color: var(--text-muted); }
.vault-bal { font-size: 1.25rem; font-weight: 800; margin: 10px 0 4px; }
.vault-rate { font-size: 0.7rem; color: var(--text-dark); }

/* ==========================================================================
   APEX COPILOT AI DRAWER
   ========================================================================== */
.copilot-drawer {
  position: fixed;
  right: -420px;
  top: 0;
  width: 380px;
  height: 100vh;
  background: var(--bg-sidebar);
  border-left: 1px solid var(--border-highlight);
  box-shadow: -10px 0 30px rgba(0,0,0,0.7);
  z-index: 1200;
  display: flex;
  flex-direction: column;
  transition: right 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.copilot-drawer.show {
  right: 0;
}

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

.copilot-title {
  display: flex;
  align-items: center;
  gap: 12px;
}

.copilot-title h3 { font-size: 1rem; font-weight: 800; }
.status-sub { font-size: 0.72rem; color: var(--text-muted); display: block; }

.copilot-messages {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.chat-msg {
  display: flex;
  gap: 10px;
  max-width: 90%;
}

.msg-ai { align-self: flex-start; }
.msg-user { align-self: flex-end; flex-direction: row-reverse; }

.msg-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent-emerald-glow);
  color: var(--accent-emerald);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
}

.msg-bubble {
  background: var(--bg-base);
  border: 1px solid var(--border-color);
  padding: 12px 16px;
  border-radius: 14px;
  font-size: 0.85rem;
  line-height: 1.4;
}

.msg-user .msg-bubble {
  background: var(--accent-emerald);
  color: #05101a;
  border: none;
  font-weight: 600;
}

.copilot-quick-prompts {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 10px 20px;
  border-top: 1px solid var(--border-color);
}

.prompt-chip {
  background: var(--bg-base);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  padding: 6px 12px;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  white-space: nowrap;
  cursor: pointer;
  transition: var(--transition);
}

.prompt-chip:hover {
  border-color: var(--accent-emerald);
  color: var(--text-main);
}

.copilot-input-row {
  display: flex;
  gap: 10px;
  padding: 16px 20px;
  border-top: 1px solid var(--border-color);
}

.copilot-input-row input {
  flex: 1;
  background: var(--bg-base);
  border: 1px solid var(--border-color);
  padding: 10px 14px;
  border-radius: var(--radius-md);
  color: var(--text-main);
  outline: none;
  font-size: 0.85rem;
}

/* Statement Modal */
.statement-card { width: 520px; }
.statement-header { text-align: center; border-bottom: 1px solid var(--border-color); padding-bottom: 16px; }
.statement-logo { font-size: 1.1rem; font-weight: 800; letter-spacing: 1px; margin-bottom: 6px; }

.statement-body {
  margin: 20px 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  font-size: 0.9rem;
}

.s-row { display: flex; justify-content: space-between; }
.s-total { border-top: 1px dashed var(--border-color); padding-top: 12px; font-weight: 800; font-size: 1.05rem; }

/* ==========================================================================
   MODALS & TOAST NOTIFICATIONS
   ========================================================================== */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; width: 100vw; height: 100vh;
  background: rgba(4, 7, 13, 0.85);
  backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-overlay.show {
  display: flex;
  animation: fadeIn 0.25s ease-out;
}

.modal-card {
  background: var(--bg-sidebar);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 32px;
  width: 440px;
  max-width: 90vw;
  position: relative;
  box-shadow: 0 25px 50px rgba(0,0,0,0.8);
}

.modal-close {
  position: absolute;
  top: 18px; right: 18px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.2rem;
  cursor: pointer;
}

.lock-avatar, .success-icon {
  width: 60px; height: 60px;
  border-radius: 50%;
  margin: 0 auto 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
}

.lock-avatar { background: rgba(0, 210, 255, 0.15); color: var(--accent-cyan); }
.success-icon { background: rgba(0, 245, 155, 0.15); color: var(--accent-emerald); }

.pin-display {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin: 24px 0;
}

.pin-dot {
  width: 16px; height: 16px;
  border-radius: 50%;
  border: 2px solid var(--border-color);
  transition: var(--transition);
}

.pin-dot.filled {
  background: var(--accent-emerald);
  border-color: var(--accent-emerald);
  box-shadow: 0 0 10px var(--accent-emerald);
}

.pin-keypad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.key-btn {
  background: var(--bg-base);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 16px;
  border-radius: var(--radius-md);
  font-size: 1.2rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
}

.key-btn:hover {
  background: var(--bg-card-glass);
  border-color: var(--accent-emerald);
}

.key-submit {
  background: var(--accent-emerald) !important;
  color: #05101a !important;
}

/* Toast Container */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 2000;
}

.toast {
  background: var(--bg-sidebar);
  border: 1px solid var(--border-highlight);
  color: var(--text-main);
  padding: 14px 20px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-panel);
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.88rem;
  animation: slideInRight 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

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

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

/* Hamburger (hidden on desktop) */
.hamburger-btn {
  display: none;
  background: none;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm, 8px);
  color: var(--text-main);
  width: 38px;
  height: 38px;
  font-size: 1rem;
  cursor: pointer;
  flex-shrink: 0;
}

.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(2px);
  z-index: 498;
}

.sidebar {
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Tablet & below: sidebar becomes an off-canvas drawer */
@media (max-width: 1024px) {
  .app-container { grid-template-columns: 1fr; }

  .hamburger-btn { display: flex; align-items: center; justify-content: center; }

  .sidebar {
    display: flex !important;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 280px;
    max-width: 84vw;
    transform: translateX(-105%);
    z-index: 499;
    overflow-y: auto;
    box-shadow: 10px 0 40px rgba(0, 0, 0, 0.5);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .sidebar.open + .sidebar-backdrop,
  .sidebar-backdrop.show {
    display: block;
  }

  .cards-grid, .vaults-grid { grid-template-columns: repeat(2, 1fr); }
  .dashboard-grid, .cards-view-grid, .transfers-grid, .analytics-grid, .loans-grid, .security-grid {
    grid-template-columns: 1fr;
  }
  .admin-stats-grid { grid-template-columns: repeat(2, 1fr); }

  .header-bar { padding: 12px 16px; gap: 10px; }
  .search-box { flex: 1; min-width: 0; }
  .search-box input { min-width: 0; }
  .header-actions { display: none; }
  .view-header { flex-direction: column; align-items: flex-start; gap: 12px; padding: 18px 16px 0 !important; }
  .main-content { padding: 0 0 40px !important; }
  .panel { margin: 12px 12px 0 !important; }
  .view-header h1 { font-size: 1.3rem !important; }
}

/* Phones */
@media (max-width: 640px) {
  .cards-grid, .vaults-grid, .admin-stats-grid, .admin-bal-grid { grid-template-columns: 1fr; }

  .header-bar { flex-wrap: nowrap; }
  .header-bar .search-box input { font-size: 0.85rem; padding: 8px 10px 8px 30px; }

  .modal-card {
    width: 92vw !important;
    max-width: 92vw !important;
    max-height: 88vh;
    overflow-y: auto;
    padding: 24px 18px !important;
  }

  .credit-card { width: 100% !important; max-width: 340px; }

  .copilot-drawer { width: 100vw; right: -100vw; }

  .data-table th, .data-table td { padding: 10px 10px; font-size: 0.8rem; }
  .admin-table .client-cell { flex-direction: column; align-items: flex-start; gap: 4px; }
  .admin-table .row-actions { justify-content: flex-start; }

  .login-box { width: 92vw; padding: 32px 22px 24px; }
  .login-brand h1 { font-size: 1.15rem; }

  .quick-transfer-form .form-group { margin-bottom: 10px; }

  .toast { width: calc(100vw - 24px) !important; }

  .stat-cards, .stats-row { grid-template-columns: repeat(2, 1fr) !important; }
}

/* ==========================================================================
   ADMIN CONSOLE
   ========================================================================== */
.admin-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  margin: 18px 0;
}

.admin-stat-card {
  position: relative;
  overflow: hidden;
}
.admin-stat-card::before {
  content: '';
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: linear-gradient(90deg, #00f59b, #00d2ff);
  opacity: 0.85;
}

.admin-search {
  background: var(--bg-base);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm, 8px);
  color: var(--text-main);
  padding: 9px 14px;
  font-size: 0.85rem;
  min-width: 260px;
  outline: none;
}
.admin-search:focus { border-color: var(--accent-emerald); }

.admin-table .client-cell {
  display: flex;
  align-items: center;
  gap: 12px;
}
.admin-table .client-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(0,245,155,0.25), rgba(0,210,255,0.25));
  border: 1px solid var(--border-highlight);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.8rem;
  color: var(--accent-emerald);
  flex-shrink: 0;
}
.admin-table .client-name { font-weight: 700; font-size: 0.9rem; }
.admin-table .client-id {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace;
}

.admin-table .row-actions {
  display: flex;
  gap: 6px;
  justify-content: flex-end;
}
.admin-table .row-actions .icon-btn {
  width: 30px;
  height: 30px;
  font-size: 0.78rem;
}
.admin-table .row-actions .icon-btn.danger:hover { color: var(--accent-red); }

.admin-bal-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.admin-pin-result {
  margin-top: 16px;
  padding: 14px 16px;
  border: 1px solid var(--accent-emerald);
  border-radius: var(--radius-sm, 8px);
  background: rgba(0, 245, 155, 0.06);
  display: flex;
  gap: 12px;
  align-items: flex-start;
  font-size: 0.85rem;
  line-height: 1.5;
}

.admin-empty-row td {
  text-align: center;
  padding: 24px;
  color: var(--text-muted);
}

/* Security PIN Change Panel */
.change-pin-form { margin-top: 14px; }
.change-pin-form .form-group { margin-bottom: 14px; }
.change-pin-form .form-group label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.change-pin-form .form-group input {
  width: 100%;
}

/* ==========================================================================
   ADMIN: AUDIT LOG + CLIENT DRAWER
   ========================================================================== */
.audit-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 14px;
  max-height: 420px;
  overflow-y: auto;
}
.audit-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm, 8px);
  background: var(--bg-base);
  font-size: 0.82rem;
}
.audit-item .audit-time {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  color: var(--text-muted);
  flex-shrink: 0;
}
.audit-item .audit-action {
  font-weight: 700;
  color: var(--accent-emerald);
  text-transform: uppercase;
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  flex-shrink: 0;
}
.audit-item .audit-details {
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.client-drawer {
  position: fixed;
  right: -460px;
  top: 0;
  width: 440px;
  max-width: 100vw;
  height: 100vh;
  background: var(--bg-sidebar);
  border-left: 1px solid var(--border-highlight);
  box-shadow: -10px 0 30px rgba(0,0,0,0.7);
  z-index: 1200;
  display: flex;
  flex-direction: column;
  transition: right 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.client-drawer.show { right: 0; }

.client-drawer .drawer-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 20px 22px;
  border-bottom: 1px solid var(--border-color);
}
.client-drawer .drawer-header .client-avatar {
  width: 46px;
  height: 46px;
  font-size: 1rem;
}
.client-drawer .drawer-body {
  padding: 20px 22px;
  overflow-y: auto;
  flex: 1;
}
.client-drawer .drawer-section-title {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin: 18px 0 10px;
}
.client-drawer .drawer-section-title:first-child { margin-top: 0; }

.client-drawer .balance-chips {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.client-drawer .balance-chip {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm, 8px);
  padding: 10px 12px;
  background: var(--bg-base);
}
.client-drawer .balance-chip .b-label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}
.client-drawer .balance-chip .b-value {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  font-size: 0.92rem;
  margin-top: 2px;
}

.client-drawer .drawer-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.client-drawer .drawer-actions .btn { flex: 1 1 44%; }

.credit-row {
  display: flex;
  gap: 8px;
}
.credit-row select, .credit-row input { flex: 1; min-width: 0; }

@media (max-width: 640px) {
  .client-drawer { width: 100vw; right: -100vw; }
}

/* ==========================================================================
   LIVE MARKETS STRIP (dashboard)
   ========================================================================== */
.market-panel .panel-header h2 i { margin-right: 6px; }

.market-updated {
  font-size: 0.68rem;
  color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace;
}

.market-chips {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(165px, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.market-chip {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 14px;
  background: var(--bg-base);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.market-chip:hover {
  border-color: var(--border-highlight);
  transform: translateY(-2px);
}

.market-chip .m-top {
  display: flex;
  align-items: center;
  gap: 7px;
}

.market-chip .m-icon {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.55rem;
  font-weight: 800;
  flex-shrink: 0;
}

.market-chip .m-icon.crypto { background: rgba(247, 147, 26, 0.18); color: #f7931a; }
.market-chip .m-icon.stock { background: rgba(0, 210, 255, 0.15); color: var(--accent-cyan); }

.market-chip .m-symbol {
  font-weight: 800;
  font-size: 0.82rem;
}

.market-chip .m-name {
  font-size: 0.62rem;
  color: var(--text-muted);
  margin-left: auto;
  text-align: right;
}

.market-chip .m-price {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  font-size: 0.95rem;
}

.market-chip .m-change {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  font-weight: 700;
}

.market-chip .m-change.up { color: var(--accent-emerald); }
.market-chip .m-change.down { color: var(--accent-red); }

.market-chip .m-change::before { content: '▲ '; font-size: 0.6rem; }
.market-chip .m-change.down::before { content: '▼ '; }

.market-loading {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.8rem;
  padding: 14px;
}

@media (max-width: 768px) {
  .market-chips { grid-template-columns: repeat(2, 1fr); }
  .market-chip .m-name { display: none; }
}

/* ==========================================================================
   DESKTOP LARGE SCREEN POLISH
   ========================================================================== */
@media (min-width: 1600px) {
  .app-container {
    max-width: 1720px;
    margin: 0 auto;
    border-left: 1px solid var(--border-color);
    border-right: 1px solid var(--border-color);
  }
  .dashboard-grid { gap: 28px; }
  .panel { padding: 28px; }
  .view-header h1 { font-size: 1.7rem; }
}

/* Chart summary wraps on small screens */
@media (max-width: 768px) {
  .chart-summary-row { flex-wrap: wrap; gap: 10px; }
  .summary-item { font-size: 0.75rem; }
  .summary-item strong { display: block; margin-top: 2px; }
  .timeframe-selector { gap: 4px; }
  .tf-btn { padding: 5px 10px; font-size: 0.7rem; }
  .canvas-container canvas { height: 180px !important; }
}

/* 2FA enrollment */
.tfa-desc { font-size: 0.82rem; color: var(--text-muted); margin: 10px 0 14px; line-height: 1.5; }
.tfa-enroll-grid { display: flex; gap: 18px; align-items: flex-start; flex-wrap: wrap; }
.tfa-qr-box {
  background: #fff;
  padding: 10px;
  border-radius: 10px;
  width: 148px;
  height: 148px;
  flex-shrink: 0;
}
.tfa-qr-box img, .tfa-qr-box canvas { width: 128px !important; height: 128px !important; }
.tfa-secret {
  display: block;
  font-size: 0.78rem;
  background: var(--bg-base);
  border: 1px dashed var(--border-highlight);
  border-radius: 8px;
  padding: 8px 10px;
  word-break: break-all;
  color: var(--accent-gold);
}

/* Chrome/Edge autofill repaints inputs with an opaque background —
   force the glass look to survive autofill on the login form */
.login-box .login-input-wrap input:-webkit-autofill,
.login-box .login-input-wrap input:-webkit-autofill:hover,
.login-box .login-input-wrap input:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0 1000px #10161f inset;
  -webkit-text-fill-color: #ffffff;
  caret-color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: background-color 99999s ease-in-out 0s;
}

/* ==========================================================================
   GLASSMORPHISM SURFACES (dashboard-wide)
   ========================================================================== */
.panel {
  background: linear-gradient(155deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.018));
  backdrop-filter: blur(22px) saturate(150%);
  -webkit-backdrop-filter: blur(22px) saturate(150%);
  border: 1px solid rgba(255, 255, 255, 0.09);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  position: relative;
}

.vault-card, .admin-stat-card {
  background: linear-gradient(155deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02));
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.09);
}

.sidebar {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.01)), var(--bg-sidebar);
}

/* ==========================================================================
   LIVE MARKET TICKER (animated, scrolls under the header)
   ========================================================================== */
.market-ticker {
  overflow: hidden;
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid var(--border-color);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 89;
  display: flex;
  align-items: center;
}

.market-ticker-label {
  flex-shrink: 0;
  padding: 8px 14px;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent-emerald);
  border-right: 1px solid var(--border-color);
  background: rgba(0, 245, 155, 0.05);
  display: flex;
  align-items: center;
  gap: 6px;
  z-index: 2;
}

.market-ticker-track {
  display: flex;
  gap: 0;
  width: max-content;
  animation: tickerScroll 45s linear infinite;
}

.market-ticker:hover .market-ticker-track { animation-play-state: paused; }

@keyframes tickerScroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

.ticker-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px;
  font-size: 0.76rem;
  white-space: nowrap;
  border-right: 1px solid var(--border-color);
}

.ticker-item .t-sym { font-weight: 800; color: var(--text-main); }
.ticker-item .t-price { font-family: 'JetBrains Mono', monospace; color: var(--text-muted); }
.ticker-item .t-change { font-family: 'JetBrains Mono', monospace; font-weight: 700; }
.ticker-item .t-change.up { color: var(--accent-emerald); }
.ticker-item .t-change.down { color: var(--accent-red); }
.ticker-item .t-change::before { content: '▲'; font-size: 0.55rem; margin-right: 3px; }
.ticker-item .t-change.down::before { content: '▼'; }

/* Price chip flash animation when a quote moves */
@keyframes flashUp {
  0%   { box-shadow: 0 0 0 rgba(0, 245, 155, 0); border-color: rgba(0, 245, 155, 0); }
  25%  { box-shadow: 0 0 22px rgba(0, 245, 155, 0.35); border-color: rgba(0, 245, 155, 0.8); }
  100% { box-shadow: 0 0 0 rgba(0, 245, 155, 0); border-color: var(--border-color); }
}
@keyframes flashDown {
  0%   { box-shadow: 0 0 0 rgba(255, 71, 87, 0); border-color: rgba(255, 71, 87, 0); }
  25%  { box-shadow: 0 0 22px rgba(255, 71, 87, 0.35); border-color: rgba(255, 71, 87, 0.8); }
  100% { box-shadow: 0 0 0 rgba(255, 71, 87, 0); border-color: var(--border-color); }
}
.market-chip.flash-up { animation: flashUp 1.4s ease-out; }
.market-chip.flash-down { animation: flashDown 1.4s ease-out; }

/* ==========================================================================
   WITHDRAWALS & PAYOUT METHODS
   ========================================================================== */
.withdraw-panel { grid-column: 1 / -1; }

.payout-methods-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 14px 0;
}

.payout-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--bg-base);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: 0.82rem;
}

.payout-chip .p-icon {
  width: 34px;
  height: 24px;
  border-radius: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  flex-shrink: 0;
}
.payout-chip .p-icon.bank { background: rgba(0, 210, 255, 0.14); color: var(--accent-cyan); }
.payout-chip .p-icon.card { background: rgba(247, 147, 26, 0.15); color: #f7931a; }

.payout-chip .p-label { font-weight: 700; }
.payout-chip .p-holder { font-size: 0.68rem; color: var(--text-muted); }
.payout-chip .p-remove {
  background: none; border: none; color: var(--text-muted);
  cursor: pointer; padding: 4px; margin-left: 4px;
}
.payout-chip .p-remove:hover { color: var(--accent-red); }

.payout-empty {
  color: var(--text-muted);
  font-size: 0.8rem;
  padding: 12px 0;
}

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

.method-type-selector {
  display: flex;
  gap: 8px;
  margin-bottom: 4px;
}
.method-type-selector .type-btn {
  flex: 1;
  text-align: center;
}

/* ==========================================================================
   HOTFIX: grid blowout from marquee track + proper transfers grid
   ========================================================================== */
.main-content, .views-wrapper, .header-bar { min-width: 0; }
.market-ticker { max-width: 100%; }

.transfers-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 20px;
  align-items: start;
}
@media (max-width: 1024px) {
  .transfers-grid { grid-template-columns: 1fr; }
}

/* ==========================================================================
   SELF-SERVICE SIGNUP + ADMIN-CONTROLLED SITE POPUP
   ========================================================================== */

.login-signup-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 16px;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.55);
}
.login-signup-link {
  background: none;
  border: none;
  padding: 4px 6px;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  color: #00f59b;
  cursor: pointer;
  transition: color 0.2s ease, text-shadow 0.2s ease;
}
.login-signup-link:hover {
  color: #00d2ff;
  text-shadow: 0 0 12px rgba(0, 245, 155, 0.5);
}

.signup-box {
  max-height: 92vh;
  overflow-y: auto;
  max-width: 560px;
}
.signup-box .login-brand h1 { font-size: 1.35rem; }
.signup-box .login-brand p { font-size: 0.85rem; }

.signup-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
@media (max-width: 520px) {
  .signup-grid { grid-template-columns: 1fr; }
}

.signup-success-box {
  text-align: center;
  padding: 28px 16px 8px;
}
.signup-success-icon {
  font-size: 3rem;
  color: #00f59b;
  filter: drop-shadow(0 0 18px rgba(0, 245, 155, 0.55));
  margin-bottom: 12px;
}
.signup-success-box h3 {
  margin: 0 0 8px;
  font-size: 1.15rem;
  letter-spacing: 0.04em;
}
.signup-success-box p {
  margin: 0 0 10px;
  color: rgba(255, 255, 255, 0.65);
  font-size: 0.9rem;
  line-height: 1.5;
}
.signup-success-id {
  font-family: 'JetBrains Mono', monospace;
  color: #00d2ff;
  font-size: 0.85rem;
}

/* --- Admin-controlled site popup --- */
.site-popup-overlay {
  position: fixed;
  inset: 0;
  z-index: 4000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(4, 8, 14, 0.72);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
.site-popup-overlay.show {
  opacity: 1;
  pointer-events: auto;
}
.site-popup-card {
  position: relative;
  width: 100%;
  max-width: 460px;
  padding: 28px 28px 26px;
  border-radius: 22px;
  background: linear-gradient(150deg, rgba(19, 27, 38, 0.92), rgba(10, 15, 24, 0.95));
  border: 1px solid rgba(0, 245, 155, 0.28);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.6), 0 0 42px rgba(0, 245, 155, 0.12);
  transform: translateY(14px) scale(0.97);
  transition: transform 0.28s cubic-bezier(0.2, 0.9, 0.3, 1.2);
}
.site-popup-overlay.show .site-popup-card {
  transform: translateY(0) scale(1);
}
.site-popup-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  font-size: 0.95rem;
  transition: all 0.2s ease;
}
.site-popup-close:hover {
  background: rgba(255, 71, 87, 0.2);
  border-color: rgba(255, 71, 87, 0.5);
  color: #ff6b81;
}
.site-popup-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #00f59b;
  background: rgba(0, 245, 155, 0.1);
  border: 1px solid rgba(0, 245, 155, 0.3);
  margin-bottom: 14px;
}
.site-popup-text {
  margin: 0;
  color: rgba(255, 255, 255, 0.92);
  font-size: 0.95rem;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
}

/* ==========================================================================
   BITCOIN DEPOSIT PANEL
   ========================================================================== */
.btc-deposit-panel {
  margin-bottom: 22px;
  border: 1px solid rgba(255, 184, 0, 0.18);
  background: linear-gradient(150deg, rgba(24, 21, 12, 0.55), rgba(12, 16, 24, 0.6));
}
.btc-deposit-grid {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 22px;
  align-items: center;
  margin-top: 6px;
}
@media (max-width: 640px) {
  .btc-deposit-grid { grid-template-columns: 1fr; }
  .btc-qr-holder { margin: 0 auto; }
}
.btc-qr-holder {
  background: #ffffff;
  border-radius: 18px;
  padding: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35), 0 0 26px rgba(255, 184, 0, 0.12);
  width: fit-content;
}
.btc-qr-holder img, .btc-qr-holder canvas { display: block; }
.btc-qr-off {
  min-width: 176px;
  min-height: 176px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.8rem;
}
.btc-qr-off i { font-size: 1.6rem; }
.btc-deposit-label {
  display: block;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.5);
  font-weight: 700;
  margin-bottom: 8px;
}
.btc-addr-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.btc-addr-row code {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  font-size: 0.78rem;
  color: #ffd86b;
}
.btc-deposit-note {
  margin: 12px 0 0;
  font-size: 0.76rem;
  color: rgba(255, 255, 255, 0.45);
  line-height: 1.5;
}
.btc-deposit-note i { color: #00f59b; margin-right: 4px; }
.btc-deposit-history { margin-top: 18px; }
.btc-deposit-history-title {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.5);
  font-weight: 700;
  margin-bottom: 8px;
}
.btc-deposit-row {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  padding: 10px 14px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  margin-bottom: 8px;
  font-size: 0.82rem;
}
.btc-deposit-row-id { color: #ffd86b; }
.btc-deposit-row-amt { margin-left: auto; color: rgba(255, 255, 255, 0.9); }
.btc-deposit-row-date { color: rgba(255, 255, 255, 0.4); font-size: 0.74rem; }
.badge-danger { background: rgba(255, 71, 87, 0.15); color: #ff6b81; border: 1px solid rgba(255, 71, 87, 0.35); }

/* ==========================================================================
   ADMIN CONSOLE SUB-TABS & PANELS
   ========================================================================== */
.admin-subnav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}
.admin-subtab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  color: rgba(255, 255, 255, 0.65);
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}
.admin-subtab:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  transform: translateY(-1px);
}
.admin-subtab.active {
  background: linear-gradient(135deg, rgba(0, 245, 155, 0.16), rgba(0, 210, 255, 0.12));
  border-color: rgba(0, 245, 155, 0.45);
  color: #00f59b;
  box-shadow: 0 4px 18px rgba(0, 245, 155, 0.12);
}
.admin-count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: #ffb800;
  color: #0b0f16;
  font-size: 0.68rem;
  font-weight: 800;
}
.admin-pane { display: none; }
.admin-pane.active { display: block; animation: adminFadeIn 0.25s ease; }
@keyframes adminFadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.admin-duo-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-bottom: 18px;
}
@media (max-width: 900px) {
  .admin-duo-grid { grid-template-columns: 1fr; }
}
.admin-form-body { padding: 18px 20px 20px; }
.admin-btn-row {
  display: flex;
  gap: 10px;
  margin-top: 14px;
  flex-wrap: wrap;
}
.admin-form-note {
  margin: 12px 0 0;
  font-size: 0.76rem;
  color: var(--text-muted);
}
.admin-form-note i { color: #00d2ff; margin-right: 4px; }
.admin-transfer-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.admin-transfer-grid .btn-block { grid-column: 1 / -1; }
@media (max-width: 640px) {
  .admin-transfer-grid { grid-template-columns: 1fr; }
}
.admin-routing-result {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.82rem;
  line-height: 1.6;
}
.admin-cell-sub {
  color: var(--text-muted);
  font-size: 0.72rem;
  margin-top: 2px;
}
.admin-cell-clamp {
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.admin-actions-cell { white-space: nowrap; }
.admin-actions-cell .btn { padding: 6px 10px; margin-left: 4px; }
.btn-success {
  background: rgba(0, 245, 155, 0.14);
  border: 1px solid rgba(0, 245, 155, 0.4);
  color: #00f59b;
}
.btn-success:hover { background: rgba(0, 245, 155, 0.24); }
.btn-danger {
  background: rgba(255, 71, 87, 0.14);
  border: 1px solid rgba(255, 71, 87, 0.4);
  color: #ff6b81;
}
.btn-danger:hover { background: rgba(255, 71, 87, 0.26); }

/* ==========================================================================
   MOBILE RESPONSIVENESS — admin console & headers
   ========================================================================== */

/* Tablets: 4-across stat cards are too cramped at 641–1024px */
@media (max-width: 1100px) and (min-width: 641px) {
  .admin-stats-grid { grid-template-columns: repeat(2, 1fr); }
  .cards-grid { grid-template-columns: repeat(2, 1fr); }
}

/* Phones: stack the view header and let the button go full width */
@media (max-width: 640px) {
  .view-header {
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
  }
  .view-header .btn { width: 100%; }

  /* Admin tab bar: single scrollable row instead of wrapping into 3 lines */
  .admin-subnav {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 4px;
  }
  .admin-subtab { flex: 0 0 auto; white-space: nowrap; }

  /* Tables: keep horizontal scroll but let them breathe */
  .table-responsive { margin-top: 12px; }
  .data-table th, .data-table td { padding: 10px 8px; font-size: 0.78rem; }
}

/* ==========================================================================
   INTERNAL MAILER — EMAIL COMPOSER
   ========================================================================== */
.admin-email-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
@media (max-width: 640px) {
  .admin-email-grid { grid-template-columns: 1fr; }
  .admin-email-grid [style*="grid-column"] { grid-column: auto !important; }
}

.email-composer {
  margin-top: 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.03);
}
.email-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.05);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.email-tool-btn {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  border: 1px solid transparent;
  background: none;
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.82rem;
  cursor: pointer;
  transition: all 0.15s ease;
}
.email-tool-btn:hover {
  background: rgba(0, 245, 155, 0.12);
  color: #00f59b;
  border-color: rgba(0, 245, 155, 0.3);
}
.email-tool-sep {
  width: 1px;
  height: 20px;
  background: rgba(255, 255, 255, 0.12);
  margin: 0 6px;
}
.email-editor {
  min-height: 180px;
  max-height: 420px;
  overflow-y: auto;
  padding: 16px 18px;
  color: rgba(255, 255, 255, 0.92);
  font-size: 0.9rem;
  line-height: 1.7;
  outline: none;
}
.email-editor:empty::before {
  content: attr(data-placeholder);
  color: rgba(255, 255, 255, 0.35);
}
.email-editor h2 { font-size: 1.05rem; margin: 8px 0; }
.email-editor a { color: #00d2ff; }
.email-editor ul, .email-editor ol { padding-left: 22px; margin: 8px 0; }

.email-preview-toggle { margin-top: 12px; }
.email-preview { margin-top: 12px; }
.email-preview-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.email-preview-box {
  background: #ffffff;
  color: #0f172a;
  border-radius: 12px;
  padding: 18px;
  font-size: 0.88rem;
  line-height: 1.65;
  min-height: 60px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}
.email-preview-box h2 { margin: 4px 0 8px; }
.email-preview-box a { color: #00a8d2; }
.admin-email-sent-note {
  align-self: center;
  color: var(--text-muted);
  font-size: 0.78rem;
}

/* AI email generator row */
.ai-email-row { margin-bottom: 14px; }
.ai-email-row .admin-btn-row { flex-wrap: nowrap; }
@media (max-width: 520px) {
  .ai-email-row .admin-btn-row { flex-wrap: wrap; }
  .ai-email-row .admin-btn-row .btn { width: 100%; }
}

/* Device fingerprint chips in the visitor log */
.admin-device-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.74rem;
  color: rgba(255, 255, 255, 0.75);
  background: rgba(0, 210, 255, 0.08);
  border: 1px solid rgba(0, 210, 255, 0.22);
  padding: 3px 9px;
  border-radius: 999px;
  white-space: nowrap;
}
.admin-device-bot {
  color: #ff6b81;
  background: rgba(255, 71, 87, 0.1);
  border-color: rgba(255, 71, 87, 0.3);
}

/* ==========================================================================
   MOBILE POLISH — dashboard header, banner, quick stats, chart
   ========================================================================== */

/* Phones: stack the welcome banner and make its stat pills wrap */
@media (max-width: 640px) {
  .welcome-banner {
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
    padding: 18px 16px;
  }
  .welcome-banner .welcome-text h1 { font-size: 1.2rem; }
  .welcome-banner .welcome-text p { font-size: 0.85rem; }
  .quick-stats-row {
    flex-wrap: wrap;
    width: 100%;
    gap: 8px;
  }
  .quick-stats-row .btn { flex: 1 1 100%; }
  .stat-pill { flex: 1 1 45%; padding: 8px 12px; }
  .stat-pill .val { font-size: 0.8rem; }

  /* Chart summary numbers wrap instead of overflowing */
  .chart-summary-row { flex-wrap: wrap; gap: 12px; }

  /* Panel headers stack when they carry actions */
  .panel-header { flex-wrap: wrap; gap: 10px; }
}

/* Very small phones: drop the search bar (hamburger + brand stay) */
@media (max-width: 480px) {
  .header-bar { padding: 14px 16px; gap: 10px; }
  .header-bar .search-box { display: none; }
  .header-bar .header-actions .icon-btn { width: 36px; height: 36px; }
}
