/* ═══════════════════════════════════════════════════════════════════
   PayFlow Overdraft — Clean Light Design System
   Simple, solid, fully readable on white backgrounds
   ═══════════════════════════════════════════════════════════════════ */

/* ─── CSS Custom Properties ──────────────────────────────────────── */
:root {
  /* Brand Colors */
  --pp-blue: #003087;
  --pp-blue-light: #0070ba;
  --pp-gold: #e6a800;
  --pp-gold-dark: #cc8800;

  /* Backgrounds */
  --bg-deep: #f4f6f9;
  --bg-surface: #ffffff;
  --bg-card: #ffffff;
  --bg-card-hover: #f0f4ff;
  --border-glass: #d1d9e6;

  /* Text — solid, always visible */
  --text-primary: #111827;
  --text-secondary: #374151;
  --text-muted: #6b7280;

  /* Status Colors */
  --success: #059669;
  --success-bg: #ecfdf5;
  --warning: #b45309;
  --warning-bg: #fffbeb;
  --danger: #dc2626;
  --danger-bg: #fef2f2;
  --info: #0070ba;
  --info-bg: #eff6ff;

  /* Gradients (buttons only) */
  --grad-brand: linear-gradient(135deg, #003087 0%, #0070ba 100%);
  --grad-gold: linear-gradient(135deg, #ffc439 0%, #e6a800 100%);
  --grad-success: linear-gradient(135deg, #059669 0%, #0d9488 100%);
  --grad-danger: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);

  /* Spacing */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;

  /* Radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-full: 9999px;

  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition-base: 0.2s ease;
  --transition-slow: 0.35s ease;

  /* Shadows — simple, not glowy */
  --shadow-card: 0 1px 4px rgba(0, 0, 0, 0.08), 0 0 0 1px rgba(0,0,0,0.04);
  --shadow-card-hover: 0 4px 16px rgba(0, 0, 0, 0.12);
}

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

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg-deep);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* Hide animated orbs — not needed for clean design */
.bg-orbs { display: none; }

/* ─── Navigation ─────────────────────────────────────────────────── */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: #ffffff;
  border-bottom: 1px solid var(--border-glass);
  padding: 0 var(--space-xl);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.nav-container {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: var(--space-xl);
  height: 64px;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  text-decoration: none;
  flex-shrink: 0;
}

.brand-icon {
  width: 36px; height: 36px;
  background: var(--grad-brand);
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem;
}

.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-name { font-family: 'Outfit', sans-serif; font-weight: 800; font-size: 1.1rem; color: var(--pp-blue); }
.brand-sub { font-size: 0.6rem; font-weight: 600; color: var(--pp-gold-dark); letter-spacing: 0.1em; text-transform: uppercase; }

.nav-links {
  display: flex;
  gap: 4px;
  flex: 1;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.nav-link:hover {
  color: var(--pp-blue);
  background: #eff6ff;
}

.nav-link.active {
  background: #dbeafe;
  color: var(--pp-blue);
  font-weight: 600;
}

.nav-icon { font-size: 1rem; }

.nav-user { margin-left: auto; }
.user-badge { display: flex; align-items: center; gap: var(--space-sm); }

.user-avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--grad-brand);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.75rem; font-weight: 700; color: white;
  border: 2px solid #bfdbfe;
}

.user-info { display: flex; flex-direction: column; line-height: 1.1; }
.user-name { font-size: 0.8rem; font-weight: 600; color: var(--text-primary); }
.user-tier {
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: var(--radius-full);
}
.risk-low    { background: #dcfce7; color: #15803d; }
.risk-medium { background: #fef3c7; color: #b45309; }
.risk-high   { background: #fee2e2; color: #dc2626; }

/* ─── Mobile Hamburger ──────────────────────────────────────────── */
.mobile-menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  background: transparent;
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
  cursor: pointer;
  padding: 8px;
  transition: all var(--transition-base);
  flex-shrink: 0;
  margin-left: var(--space-sm);
}

.mobile-menu-toggle:hover {
  background: #f0f4ff;
}

.hamburger-line {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--text-secondary);
  border-radius: 2px;
  transition: all var(--transition-base);
}

.mobile-menu-toggle.active .hamburger-line:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.mobile-menu-toggle.active .hamburger-line:nth-child(2) {
  opacity: 0;
}
.mobile-menu-toggle.active .hamburger-line:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ─── Mobile Backdrop ──────────────────────────────────────────── */
.mobile-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 98;
  background: rgba(0, 0, 0, 0.3);
  opacity: 0;
  transition: opacity var(--transition-base);
}

.mobile-backdrop.active { opacity: 1; }

body.mobile-nav-open { overflow: hidden; }

/* ─── Main Content ───────────────────────────────────────────────── */
.main-content {
  max-width: 1280px;
  margin: 0 auto;
  padding: var(--space-xl) var(--space-xl) var(--space-2xl);
}

/* ─── Page Header ────────────────────────────────────────────────── */
.page-header {
  margin-bottom: var(--space-xl);
}

.page-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.2;
}

.page-title span {
  color: var(--pp-blue);
}

.page-subtitle {
  font-size: 0.95rem;
  color: var(--text-secondary);
  margin-top: 4px;
}

/* ─── Cards ──────────────────────────────────────────────────────── */
.card {
  background: #ffffff;
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: var(--space-xl);
  box-shadow: var(--shadow-card);
  transition: box-shadow var(--transition-fast);
}

.card:hover {
  box-shadow: var(--shadow-card-hover);
}

.card-title {
  font-family: 'Outfit', sans-serif;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: var(--space-md);
}

.card-value {
  font-family: 'Outfit', sans-serif;
  font-size: 2.25rem;
  font-weight: 800;
  line-height: 1;
  color: var(--text-primary);
}

.card-value.success { color: var(--success); }
.card-value.warning { color: var(--warning); }
.card-value.danger  { color: var(--danger); }

.card-meta {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: var(--space-sm);
}

/* Stat cards grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-lg);
  margin-bottom: var(--space-xl);
}

/* ─── Status 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;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.badge-success { background: #dcfce7; color: #15803d; border: 1px solid #bbf7d0; }
.badge-warning { background: #fef3c7; color: #92400e; border: 1px solid #fde68a; }
.badge-danger  { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }
.badge-info    { background: #dbeafe; color: #1e40af; border: 1px solid #bfdbfe; }
.badge-muted   { background: #f3f4f6; color: var(--text-muted); border: 1px solid #e5e7eb; }

.badge-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* ─── Buttons ────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: 10px 20px;
  border: none;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background: var(--grad-brand);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(0, 48, 135, 0.25);
}
.btn-primary:hover {
  box-shadow: 0 4px 16px rgba(0, 48, 135, 0.4);
  transform: translateY(-1px);
}

.btn-gold {
  background: var(--grad-gold);
  color: #1a0f00;
  box-shadow: 0 2px 8px rgba(230, 168, 0, 0.3);
}
.btn-gold:hover {
  box-shadow: 0 4px 16px rgba(230, 168, 0, 0.5);
  transform: translateY(-1px);
}

.btn-success {
  background: var(--grad-success);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(5, 150, 105, 0.3);
}
.btn-success:hover { transform: translateY(-1px); }

.btn-ghost {
  background: #ffffff;
  color: var(--text-secondary);
  border: 1px solid var(--border-glass);
}
.btn-ghost:hover {
  background: #f9fafb;
  color: var(--text-primary);
  border-color: #9ca3af;
}

.btn-danger {
  background: var(--grad-danger);
  color: white;
  box-shadow: 0 2px 8px rgba(220, 38, 38, 0.3);
}

.btn-sm { padding: 7px 14px; font-size: 0.8rem; }
.btn-lg { padding: 14px 28px; font-size: 1rem; }
.btn-full { width: 100%; }

.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none !important; }

.btn-loading::before {
  content: '';
  width: 14px; height: 14px;
  border: 2px solid rgba(255,255,255,0.4);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  margin-right: 6px;
}

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

/* ─── Forms ──────────────────────────────────────────────────────── */
.form-group { margin-bottom: var(--space-lg); }

.form-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: var(--space-sm);
}

.form-input, .form-select {
  width: 100%;
  padding: 12px 14px;
  background: #ffffff;
  border: 1px solid #d1d5db;
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 1rem;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  outline: none;
}

.form-input:focus, .form-select:focus {
  border-color: var(--pp-blue-light);
  box-shadow: 0 0 0 3px rgba(0, 112, 186, 0.15);
}

.form-input::placeholder { color: #9ca3af; }

/* ─── Progress Bar ───────────────────────────────────────────────── */
.progress-bar {
  height: 8px;
  background: #e5e7eb;
  border-radius: var(--radius-full);
  overflow: hidden;
  margin: var(--space-sm) 0;
}

.progress-fill {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width 0.6s ease;
  background: var(--grad-success);
}

.progress-fill.warning { background: var(--grad-gold); }
.progress-fill.danger  { background: var(--grad-danger); }
.progress-fill.blue    { background: var(--grad-brand); }

/* ─── Tables ─────────────────────────────────────────────────────── */
.table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-glass);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

thead th {
  padding: 12px 16px;
  text-align: left;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  background: #f9fafb;
  border-bottom: 1px solid var(--border-glass);
}

tbody td {
  padding: 13px 16px;
  border-bottom: 1px solid #f3f4f6;
  color: var(--text-primary);
  font-size: 0.875rem;
}

tbody tr:last-child td { border-bottom: none; }

tbody tr:hover td { background: #f9fafb; }

.tx-amount { font-weight: 700; font-family: 'Outfit', sans-serif; }
.tx-in  { color: var(--success); }
.tx-out { color: var(--danger); }

/* ─── Alerts & Banners ───────────────────────────────────────────── */
.alert {
  display: flex;
  align-items: flex-start;
  gap: var(--space-md);
  padding: var(--space-lg);
  border-radius: var(--radius-md);
  border: 1px solid;
  margin-bottom: var(--space-lg);
}

.alert-icon { font-size: 1.25rem; flex-shrink: 0; margin-top: 1px; }
.alert-success { background: #ecfdf5; border-color: #a7f3d0; color: #065f46; }
.alert-warning { background: #fffbeb; border-color: #fde68a; color: #92400e; }
.alert-danger  { background: #fef2f2; border-color: #fecaca; color: #991b1b; }
.alert-info    { background: #eff6ff; border-color: #bfdbfe; color: #1e40af; }
.alert-text    { font-size: 0.875rem; color: var(--text-secondary); }
.alert-title   { font-weight: 700; margin-bottom: 2px; font-size: 0.9rem; }

/* ─── Toast ──────────────────────────────────────────────────────── */
.toast-container {
  position: fixed;
  top: 80px;
  right: var(--space-xl);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  max-width: 360px;
}

.toast {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md) var(--space-lg);
  background: #ffffff;
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
  font-size: 0.875rem;
  color: var(--text-primary);
  animation: toastIn 0.25s ease;
  border-left: 4px solid;
}

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

.toast-success { border-left-color: var(--success); }
.toast-error   { border-left-color: var(--danger); }
.toast-info    { border-left-color: var(--info); }
.toast-warning { border-left-color: var(--warning); }

/* ─── Shortfall Detector ─────────────────────────────────────────── */
.shortfall-alert {
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  margin: var(--space-lg) 0;
}

/* ─── Overdraft Hero Card ────────────────────────────────────────── */
.overdraft-hero {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: var(--radius-lg);
  padding: var(--space-2xl);
  position: relative;
}

.hero-amount {
  font-family: 'Outfit', sans-serif;
  font-size: 3rem;
  font-weight: 800;
  line-height: 1;
  color: var(--pp-blue);
}

/* ─── AI Chat ────────────────────────────────────────────────────── */
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-lg);
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  scrollbar-width: thin;
  scrollbar-color: #d1d5db transparent;
}

.chat-message {
  max-width: 78%;
  animation: messageIn 0.2s ease;
}

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

.chat-message.user { align-self: flex-end; }
.chat-message.bot  { align-self: flex-start; }

.message-bubble {
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  line-height: 1.6;
}

.message-bubble strong { color: var(--pp-blue); }

.user .message-bubble {
  background: var(--pp-blue);
  color: #ffffff;
  border-bottom-right-radius: 4px;
}

.bot .message-bubble {
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
  color: var(--text-primary);
  border-bottom-left-radius: 4px;
}

.message-time {
  font-size: 0.65rem;
  color: var(--text-muted);
  margin-top: 4px;
  padding: 0 4px;
}

.user .message-time { text-align: right; }

.chat-input-area {
  padding: var(--space-lg);
  border-top: 1px solid var(--border-glass);
  display: flex;
  gap: var(--space-sm);
  align-items: flex-end;
  background: #ffffff;
}

.chat-input {
  flex: 1;
  padding: 12px 16px;
  background: #f9fafb;
  border: 1px solid #d1d5db;
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.9rem;
  resize: none;
  max-height: 120px;
  outline: none;
  transition: border-color var(--transition-fast);
}

.chat-input:focus { border-color: var(--pp-blue-light); }
.chat-input::placeholder { color: #9ca3af; }

.suggestions-bar {
  display: flex;
  gap: var(--space-sm);
  flex-wrap: wrap;
  padding: 0 var(--space-lg) var(--space-sm);
  background: #ffffff;
}

.suggestion-chip {
  padding: 6px 12px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--pp-blue);
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
  user-select: none;
}

.suggestion-chip:hover {
  background: #dbeafe;
  border-color: #93c5fd;
}

.typing-indicator {
  display: flex;
  gap: 5px;
  align-items: center;
  padding: 12px 16px;
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
  border-radius: var(--radius-md);
  border-bottom-left-radius: 4px;
  width: fit-content;
}

.typing-dot {
  width: 7px; height: 7px;
  background: var(--pp-blue-light);
  border-radius: 50%;
  animation: typingBounce 1.2s ease-in-out infinite;
}

.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingBounce {
  0%, 60%, 100% { transform: translateY(0); }
  30% { transform: translateY(-5px); }
}

/* ─── PayPal Button Container ────────────────────────────────────── */
#paypal-button-container {
  margin: var(--space-lg) 0;
  min-height: 60px;
}

/* ─── Amount Display ─────────────────────────────────────────────── */
.amount-display {
  display: flex;
  align-items: baseline;
  gap: 4px;
}

.amount-currency { font-size: 1.2rem; font-weight: 700; color: var(--text-secondary); }
.amount-value { font-family: 'Outfit', sans-serif; font-size: 2.8rem; font-weight: 800; color: var(--text-primary); }

/* ─── Timeline ───────────────────────────────────────────────────── */
.timeline { position: relative; padding-left: var(--space-xl); }
.timeline::before {
  content: '';
  position: absolute;
  left: 7px;
  top: 0; bottom: 0;
  width: 2px;
  background: #e5e7eb;
}

.timeline-item {
  position: relative;
  padding-bottom: var(--space-lg);
}

.timeline-dot {
  position: absolute;
  left: -21px;
  top: 4px;
  width: 14px; height: 14px;
  border-radius: 50%;
  border: 2px solid var(--bg-deep);
}

.timeline-dot.success { background: var(--success); }
.timeline-dot.active  { background: var(--warning); animation: pulse 2s infinite; }
.timeline-dot.muted   { background: #9ca3af; }

.timeline-label { font-size: 0.78rem; font-weight: 700; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.05em; }
.timeline-desc  { font-size: 0.875rem; color: var(--text-secondary); margin-top: 2px; }
.timeline-date  { font-size: 0.75rem; color: var(--text-muted); margin-top: 2px; }

/* ─── Divider ────────────────────────────────────────────────────── */
.divider {
  height: 1px;
  background: var(--border-glass);
  margin: var(--space-xl) 0;
}

/* ─── Grid Layouts ───────────────────────────────────────────────── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-lg); }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: var(--space-lg); }
.grid-sidebar { display: grid; grid-template-columns: 1fr 380px; gap: var(--space-xl); }

/* ─── Responsive ─────────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .grid-sidebar { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
  .main-content { padding: var(--space-lg); }
  .nav-links { display: none; }
  .mobile-menu-toggle { display: flex; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .hero-amount { font-size: 2.2rem; }
  .page-title { font-size: 1.4rem; }
}

@media (max-width: 768px) {
  .nav-links.mobile-open {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 64px;
    left: 0; right: 0;
    background: #ffffff;
    border-bottom: 1px solid var(--border-glass);
    padding: var(--space-md);
    gap: 4px;
    z-index: 99;
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
  }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .main-content { padding: var(--space-md); }
}

/* ─── Demo Mode Banner ───────────────────────────────────────────── */
.demo-banner {
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: var(--radius-sm);
  padding: var(--space-md) var(--space-lg);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-xl);
  font-size: 0.875rem;
  color: #92400e;
  font-weight: 500;
}

/* ─── Footer ─────────────────────────────────────────────────────── */
.footer {
  border-top: 1px solid var(--border-glass);
  padding: var(--space-lg) var(--space-xl);
  background: #ffffff;
  margin-top: var(--space-2xl);
}

.footer-inner {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-md);
  font-size: 0.78rem;
  color: var(--text-muted);
  flex-wrap: wrap;
}

/* ─── Utility ────────────────────────────────────────────────────── */
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-danger  { color: var(--danger); }
.text-info    { color: var(--info); }
.text-muted   { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }

.font-outfit { font-family: 'Outfit', sans-serif; }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }

.mt-sm { margin-top: var(--space-sm); }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }
.mt-xl { margin-top: var(--space-xl); }
.mb-lg { margin-bottom: var(--space-lg); }

.hidden { display: none !important; }
.text-right { text-align: right; }
.text-center { text-align: center; }

/* ─── Checkout specific ──────────────────────────────────────────── */
.balance-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  background: #f3f4f6;
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.balance-chip-value { font-weight: 700; color: var(--text-primary); font-family: 'Outfit', sans-serif; }

/* ─── Scrollbar ──────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: #f9fafb; }
::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #9ca3af; }

/* ─── Modal ──────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 10000;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: var(--space-md);
  overflow-y: auto;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-base);
}

.modal-overlay::before {
  content: '';
  flex: 1 0 auto;
  min-height: calc((100vh - 90dvh) / 2);
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  background: #ffffff;
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  max-width: 500px;
  max-height: 90dvh;
  overflow-y: auto;
  width: 100%;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
  transform: scale(0.95) translateY(16px);
  transition: transform var(--transition-slow);
}

.modal-overlay.active .modal-card {
  transform: scale(1) translateY(0);
}

.modal-header {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
}

.modal-icon-badge {
  width: 50px;
  height: 50px;
  border-radius: var(--radius-sm);
  background: #fef3c7;
  border: 1px solid #fde68a;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  flex-shrink: 0;
}

.modal-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.2;
}

.modal-subtitle {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

.modal-summary-box {
  background: #f9fafb;
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
  padding: var(--space-md);
  margin-bottom: var(--space-lg);
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.modal-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.9rem;
}

.modal-row-label { color: var(--text-secondary); }

.modal-row-value {
  font-weight: 600;
  font-family: 'Outfit', sans-serif;
  color: var(--text-primary);
}

.modal-terms-notice {
  display: flex;
  align-items: flex-start;
  gap: var(--space-sm);
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: var(--radius-sm);
  padding: var(--space-md);
  font-size: 0.82rem;
  color: #1e40af;
  margin-bottom: var(--space-lg);
  line-height: 1.4;
}

.modal-actions {
  display: flex;
  gap: var(--space-md);
}

.modal-actions .btn { flex: 1; }

/* ─── Activity / AG Grid Section ─────────────────────────────────── */
.activity-section {
  margin-bottom: var(--space-xl);
  background: #ffffff;
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: var(--space-xl);
  box-shadow: var(--shadow-card);
}

.activity-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
}

.activity-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text-primary);
  margin: 0 0 4px;
}

.activity-subtitle {
  font-size: 0.825rem;
  color: var(--text-muted);
  margin: 0;
}

/* ─── Search Bar ─────────────────────────────────────────────────── */
.activity-controls {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.activity-search-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 12px;
  font-size: 0.9rem;
  pointer-events: none;
  z-index: 1;
  color: var(--text-muted);
}

.activity-search {
  background: #f9fafb;
  border: 1px solid #d1d5db;
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: 'Inter', sans-serif;
  font-size: 0.875rem;
  padding: 9px 14px 9px 36px;
  width: 240px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.activity-search::placeholder { color: #9ca3af; }

.activity-search:focus {
  border-color: var(--pp-blue-light);
  box-shadow: 0 0 0 3px rgba(0, 112, 186, 0.12);
}

/* ─── Filter Tabs ────────────────────────────────────────────────── */
.ag-filter-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: var(--space-lg);
}

.ag-filter-tab {
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
  border-radius: 20px;
  color: var(--text-secondary);
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  font-size: 0.8rem;
  font-weight: 500;
  padding: 5px 14px;
  transition: all 0.15s;
  white-space: nowrap;
}

.ag-filter-tab:hover {
  background: #e5e7eb;
  color: var(--text-primary);
}

.ag-filter-tab.active {
  background: var(--pp-blue);
  border-color: var(--pp-blue);
  color: #ffffff;
  font-weight: 600;
}

/* ─── Activity Badge (inside grid cells) ────────────────────────── */
.ag-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}

/* ─── Details Button ─────────────────────────────────────────────── */
.ag-detail-btn {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: var(--radius-sm);
  color: var(--pp-blue);
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 4px 10px;
  transition: background 0.15s;
  white-space: nowrap;
}

.ag-detail-btn:hover { background: #dbeafe; }

/* ─── Loading / Empty States ─────────────────────────────────────── */
.activity-loading {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-lg);
  color: var(--text-muted);
  font-size: 0.875rem;
}

.activity-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid #e5e7eb;
  border-top-color: var(--pp-blue-light);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  flex-shrink: 0;
}

.activity-empty {
  padding: var(--space-2xl);
  text-align: center;
  color: var(--text-muted);
}

/* ─── AG Grid Theme Overrides (light) ────────────────────────────── */
.payflow-grid {
  --ag-background-color: #ffffff;
  --ag-foreground-color: var(--text-primary);
  --ag-secondary-foreground-color: var(--text-secondary);
  --ag-header-background-color: #f9fafb;
  --ag-header-foreground-color: var(--text-secondary);
  --ag-odd-row-background-color: #fafafa;
  --ag-row-hover-color: #f0f4ff;
  --ag-selected-row-background-color: #dbeafe;
  --ag-border-color: #e5e7eb;
  --ag-row-border-color: #f3f4f6;
  --ag-font-family: 'Inter', sans-serif;
  --ag-font-size: 13px;
  --ag-cell-horizontal-padding: 16px;
  --ag-input-focus-border-color: var(--pp-blue-light);
  --ag-checkbox-checked-color: var(--pp-blue-light);
  --ag-pagination-button-color: var(--text-secondary);
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid #e5e7eb;
}

.payflow-grid .ag-header-cell-label {
  font-weight: 700;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.payflow-grid .ag-paging-panel {
  border-top: 1px solid #e5e7eb;
  color: var(--text-muted);
  font-size: 0.8rem;
  padding: 8px 16px;
}

.payflow-grid .ag-icon { color: var(--text-muted); }

/* ─── Detail Panel ───────────────────────────────────────────────── */
.activity-detail-panel {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease, opacity 0.2s ease, margin-top 0.2s ease;
  opacity: 0;
  margin-top: 0;
}

.activity-detail-panel.visible {
  max-height: 600px;
  opacity: 1;
  margin-top: var(--space-lg);
}

.detail-panel-inner {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: var(--radius-sm);
  padding: var(--space-lg);
}

.detail-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-lg);
  gap: var(--space-md);
}

.detail-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.detail-ref {
  font-size: 0.8rem;
  color: var(--pp-blue);
  font-family: monospace;
  background: #dbeafe;
  padding: 2px 8px;
  border-radius: 6px;
}

.detail-close {
  background: #f3f4f6;
  border: 1px solid var(--border-glass);
  border-radius: 50%;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 0.875rem;
  height: 28px;
  line-height: 1;
  padding: 0;
  transition: background 0.15s, color 0.15s;
  width: 28px;
  flex-shrink: 0;
}

.detail-close:hover {
  background: #fee2e2;
  color: var(--danger);
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: var(--space-md);
}

.detail-item {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: var(--radius-sm);
  padding: var(--space-sm) var(--space-md);
}

.detail-item--full { grid-column: 1 / -1; }

.detail-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}

.detail-value {
  font-size: 0.875rem;
  color: var(--text-primary);
  font-weight: 500;
  word-break: break-word;
}
