:root {
  --navy-950: #0c1445;
  --navy-900: #15216e;
  --indigo-600: #3b38f5;
  --violet-600: #7c2ae8;
  --emerald-500: #10b981;
  --blue-600: #2563eb;
  --orange-500: #f97316;
  --rose-600: #e11d48;
  --canvas: #eef2ff;
  --card: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --border: #e0e7ff;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: linear-gradient(180deg, #eef2ff 0%, #f8faff 55%, #e6ecff 100%);
  color: var(--text);
  min-height: 100vh;
}

.hidden { display: none !important; }
.tabular { font-variant-numeric: tabular-nums; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }

/* Auth Screen */
.pay-auth-wrap {
  min-height: 100vh;
  min-height: 100dvh;
  background: linear-gradient(135deg, #0d164f 0%, #2432a5 52%, #6b21a8 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.pay-auth-card {
  width: 100%;
  max-width: 400px;
  background: #ffffff;
  border-radius: 26px;
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(10, 18, 65, 0.4);
}

.pay-auth-head {
  background: linear-gradient(90deg, var(--indigo-600), var(--violet-600));
  padding: 20px 22px;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 12px;
}

.pay-auth-title { min-width: 0; }
.pay-auth-head h1 { margin: 0; font-size: 18px; font-weight: 800; line-height: 1.2; }
.pay-auth-head p { margin: 2px 0 0; font-size: 11px; color: #e0e7ff; }

.pay-logo-box {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 800;
  flex-shrink: 0;
}

.pay-auth-body {
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.auth-foot-row {
  border-top: 1px solid #f1f5f9;
  padding-top: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  color: #64748b;
}

.auth-link {
  color: var(--indigo-600);
  font-weight: 700;
  text-decoration: none;
}

.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field span { font-size: 12px; font-weight: 700; color: #475569; }
.field input {
  width: 100%;
  min-width: 0;
  padding: 11px 14px;
  border-radius: 12px;
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  font-size: 14px;
  color: var(--text);
  outline: none;
}
.field input:focus { border-color: var(--indigo-600); background: #fff; }

.btn {
  border: none;
  border-radius: 12px;
  padding: 11px 16px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 42px;
}
.btn:disabled { opacity: 0.48; cursor: not-allowed; }
.btn-gradient {
  background: linear-gradient(90deg, var(--indigo-600), var(--violet-600));
  color: #fff;
  box-shadow: 0 8px 20px rgba(59, 56, 245, 0.28);
}
.btn-emerald { background: var(--emerald-500); color: #fff; }
.btn-soft { background: #f1f5f9; color: #334155; }
.btn-danger { background: #ef4444; color: #fff; }
.btn-full { width: 100%; }

.err-banner {
  background: #fff1f2;
  color: var(--rose-600);
  border: 1px solid #fecdd3;
  padding: 9px 12px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 600;
}

/* App Shell */
.pay-shell {
  min-height: 100vh;
  display: flex;
}

.pay-sidebar {
  width: 256px;
  background: linear-gradient(180deg, var(--navy-950) 0%, #152375 55%, #1e3296 100%);
  color: #fff;
  padding: 22px 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  flex-shrink: 0;
}

.side-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
  padding: 0 4px;
}
.side-brand .title { font-size: 19px; font-weight: 800; line-height: 1.1; }
.side-brand .sub { font-size: 11px; color: #c7d2fe; }

.side-nav { display: flex; flex-direction: column; gap: 6px; }
.nav-item {
  width: 100%;
  border: none;
  background: transparent;
  color: #dbeafe;
  padding: 11px 14px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
}
.nav-item:hover { background: rgba(255, 255, 255, 0.1); color: #fff; }
.nav-item.active {
  background: linear-gradient(90deg, #4f46e5, #7c3aed);
  color: #fff;
  box-shadow: 0 8px 18px rgba(15, 23, 84, 0.35);
}
.nav-item.nav-logout { color: #fda4af; }

.support-card {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 16px;
  padding: 14px;
  text-align: center;
  font-size: 12px;
}
.support-card .gold { color: #fde047; font-weight: 700; margin-top: 4px; }

.pay-main { flex: 1; display: flex; flex-direction: column; min-width: 0; }

.pay-topbar {
  position: relative;
  z-index: 30;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.agent-chip { display: flex; align-items: center; gap: 11px; min-width: 0; }
.agent-avatar {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--indigo-600), var(--violet-600));
  color: #fff;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.agent-chip-text { min-width: 0; }
.agent-name-row { display: flex; align-items: center; gap: 6px; min-width: 0; }
.agent-chip h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.verified-dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: var(--emerald-500);
  flex-shrink: 0;
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.25);
}
.agent-chip p {
  margin: 1px 0 0;
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.desktop-topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.mobile-menu-wrap { display: none; position: relative; flex-shrink: 0; }

.online-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
  font-size: 12px;
  font-weight: 700;
}
.online-dot { width: 8px; height: 8px; border-radius: 999px; background: var(--emerald-500); }

.pay-content {
  padding: 22px 24px 92px;
  max-width: 1180px;
  width: 100%;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.kpi-grid {
  display: grid;
  grid-template-columns: 1.15fr 3fr;
  gap: 14px;
}

.kpi-hero {
  background: linear-gradient(135deg, #2b33e6 0%, #4f3df5 55%, #7b2ae8 100%);
  color: #fff;
  border-radius: 20px;
  padding: 16px 18px;
  box-shadow: 0 14px 28px rgba(59, 56, 245, 0.25);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
}
.kpi-hero-left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.kpi-wallet-badge {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.16);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #bae6fd;
}
.kpi-hero-text { min-width: 0; }
.kpi-hero .label { font-size: 11px; color: #e0e7ff; font-weight: 600; }
.kpi-hero .val {
  font-size: 24px;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.kpi-send-cta {
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 12px;
  min-height: 36px;
  flex-shrink: 0;
}

.kpi-pastel-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  min-width: 0;
}

.kpi-pastel {
  border-radius: 20px;
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid transparent;
  min-width: 0;
}
.kpi-mint { background: linear-gradient(135deg, #ecfdf5, #d1fae5); border-color: #a7f3d0; }
.kpi-sky { background: linear-gradient(135deg, #eff6ff, #dbeafe); border-color: #bfdbfe; }
.kpi-peach { background: linear-gradient(135deg, #fff7ed, #ffedd5); border-color: #fed7aa; }

.kpi-icon {
  width: 38px;
  height: 38px;
  border-radius: 999px;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  flex-shrink: 0;
}
.kpi-mint .kpi-icon { background: var(--emerald-500); }
.kpi-sky .kpi-icon { background: var(--blue-600); }
.kpi-peach .kpi-icon { background: var(--orange-500); }

.kpi-pastel-text { min-width: 0; flex: 1; }
.kpi-pastel .label {
  font-size: 11px;
  font-weight: 600;
  color: #475569;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.kpi-pastel .val {
  font-size: 19px;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.workspace-grid {
  margin-top: 18px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  align-items: start;
}

#agent-tab-dashboard.mode-send-only .kpi-grid,
#agent-tab-dashboard.mode-send-only #recent-txn-card,
#agent-tab-dashboard.mode-send-only .promo-banner {
  display: none;
}

#agent-tab-dashboard.mode-send-only .workspace-grid {
  margin-top: 0;
  grid-template-columns: 1fr;
  max-width: 520px;
  margin-left: auto;
  margin-right: auto;
}

.pay-card {
  background: var(--card);
  border-radius: 22px;
  border: 1px solid var(--border);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
  overflow: hidden;
}

.pay-card-head {
  padding: 15px 18px;
  border-bottom: 1px solid #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.pay-card-head h3 { margin: 0; font-size: 15px; font-weight: 800; color: #1e1b4b; }

.view-all-pill {
  border-radius: 999px;
  padding: 6px 12px;
  min-height: 30px;
  font-size: 11px;
  color: var(--indigo-600);
}

.empty-state {
  padding: 28px 18px;
  text-align: center;
  font-size: 12px;
  color: #94a3b8;
}

.send-head {
  background: linear-gradient(90deg, var(--indigo-600), var(--violet-600));
  color: #fff;
  padding: 15px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.send-head h3 { margin: 0; font-size: 15px; font-weight: 800; }
.send-body { padding: 18px; display: flex; flex-direction: column; gap: 14px; }

.bal-strip {
  background: #eef2ff;
  border: 1px solid #c7d2fe;
  border-radius: 12px;
  padding: 10px 14px;
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  font-weight: 700;
}

.search-row { display: flex; gap: 8px; min-width: 0; }
.search-row input { flex: 1; min-width: 0; }
.search-row button { flex-shrink: 0; padding: 0 14px; }

.match-box {
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  border-radius: 14px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.match-info { min-width: 0; }
.match-name {
  font-size: 14px;
  font-weight: 800;
  color: #0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.match-user { font-size: 12px; font-weight: 700; color: #047857; }
.match-tag {
  font-size: 11px;
  font-weight: 700;
  background: #fff;
  color: #047857;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid #a7f3d0;
  flex-shrink: 0;
}

.transfer-form { display: flex; flex-direction: column; gap: 12px; }

.preset-row { display: flex; flex-wrap: wrap; gap: 6px; }
.preset-btn {
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.preset-btn:hover { border-color: var(--indigo-600); color: var(--indigo-600); }

.txn-row {
  padding: 12px 16px;
  border-bottom: 1px solid #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.txn-row:last-child { border-bottom: none; }
.txn-left { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1; }
.txn-badge {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: #dcfce7;
  color: #16a34a;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  flex-shrink: 0;
}
.txn-left > div:last-child { min-width: 0; }
.txn-title {
  font-size: 13px;
  font-weight: 700;
  color: #0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.txn-sub {
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.txn-amt { font-size: 13px; font-weight: 800; color: var(--rose-600); text-align: right; white-space: nowrap; }
.txn-time { font-size: 10px; color: #94a3b8; text-align: right; white-space: nowrap; }

.promo-banner {
  margin-top: 14px;
  border-radius: 20px;
  padding: 18px 20px;
  background: linear-gradient(90deg, #1d2b9a, #3d35e8, #7c2ae8);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.promo-title { font-size: 15px; font-weight: 800; }
.promo-sub { font-size: 12px; color: #e0e7ff; margin-top: 2px; }

.settings-card { max-width: 440px; margin: 0 auto; }

.toast {
  padding: 12px 16px;
  border-radius: 14px;
  font-size: 13px;
  font-weight: 700;
  background: #ecfdf5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}
.toast.error { background: #fff1f2; color: #9f1239; border-color: #fecdd3; }

/* Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 90;
}
.modal-card {
  max-width: 390px;
  width: 100%;
  background: #fff;
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.4);
}

/* Mobile Bottom Nav */
.mobile-nav { display: none; }

@media (max-width: 1120px) {
  .kpi-grid { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  .workspace-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .pay-sidebar { display: none; }
  .desktop-topbar-actions { display: none; }
  .mobile-menu-wrap { display: block; }

  .pay-topbar {
    background: linear-gradient(90deg, #2d35d9, #4f39f6, #6b21a8);
    color: #fff;
    border-bottom: none;
    padding: 12px 14px;
  }
  .agent-avatar {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.25);
  }
  .agent-chip p { color: #e0e7ff; }

  .mobile-dots-btn {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    border: none;
    background: rgba(255, 255, 255, 0.16);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
  }

  .mobile-menu-backdrop {
    position: fixed;
    inset: 0;
    z-index: 60;
  }

  .mobile-menu-dropdown {
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    width: 210px;
    background: #ffffff;
    border-radius: 18px;
    border: 1px solid var(--border);
    box-shadow: 0 18px 42px rgba(15, 23, 42, 0.22);
    padding: 6px;
    z-index: 70;
    display: flex;
    flex-direction: column;
    gap: 2px;
  }

  .menu-drop-item {
    width: 100%;
    border: none;
    background: transparent;
    color: #1e293b;
    padding: 10px 12px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    text-align: left;
  }
  .menu-drop-item:hover { background: #eef2ff; }
  .menu-drop-item.danger { color: var(--rose-600); }
  .menu-drop-item.danger:hover { background: #fff1f2; }
  .menu-drop-divider { height: 1px; background: #f1f5f9; margin: 4px 6px; }

  .pay-content { padding: 14px 12px 84px; gap: 14px; }

  .kpi-grid { gap: 10px; }
  .kpi-hero { padding: 14px 16px; border-radius: 18px; }
  .kpi-hero .val { font-size: 22px; }

  .kpi-pastel-row { gap: 8px; }
  .kpi-pastel {
    border-radius: 16px;
    padding: 10px;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }
  .kpi-icon { width: 30px; height: 30px; font-size: 13px; }
  .kpi-pastel .label { font-size: 10px; }
  .kpi-pastel .val { font-size: 14px; }

  .workspace-grid { margin-top: 12px; gap: 14px; }
  .send-body { padding: 15px; }
  .promo-banner { display: none; }

  .mobile-nav {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 64px;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(12px);
    border-top: 1px solid var(--border);
    padding: 4px 6px calc(4px + env(safe-area-inset-bottom, 0px));
    box-shadow: 0 -6px 22px rgba(15, 23, 42, 0.08);
    z-index: 45;
  }

  .mobile-nav-btn {
    position: relative;
    border: none;
    background: transparent;
    color: #94a3b8;
    font-size: 10px;
    font-weight: 700;
    padding: 4px 2px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
  }
  .mobile-nav-btn svg { flex-shrink: 0; }
  .mobile-nav-btn.active { color: #4338ca; }
  .nav-indicator {
    position: absolute;
    bottom: 2px;
    width: 28px;
    height: 3px;
    border-radius: 999px;
    background: transparent;
  }
  .mobile-nav-btn.active .nav-indicator {
    background: linear-gradient(90deg, var(--indigo-600), var(--violet-600));
  }
}
