/* =========================================================
   GALAXYPAY MERCHANT PORTAL - ROYAL BLUE & ELECTRIC CYAN
   Clean Modern Light Design System
   ========================================================= */

:root,
body.merchant-body-layout,
html[data-theme="light"] body.merchant-body-layout,
body.merchant-body-layout.light-theme {
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-glow: rgba(37, 99, 235, 0.16);
  --cyan-accent: #06b6d4;
  --cyan-hover: #0891b2;
  --cyan-glow: rgba(6, 182, 212, 0.16);
  --bg-primary: #f8fafc;
  --bg-secondary: #ffffff;
  --bg-tertiary: #f1f5f9;
  --text-primary: #0f172a;
  --text-secondary: #334155;
  --text-muted: #64748b;
  --border-color: #e2e8f0;
  --border-subtle: #f1f5f9;
  --glass-bg: #ffffff;
  --glass-border: #e2e8f0;
  --glass-shadow: 0 4px 20px -2px rgba(15, 23, 42, 0.05), 0 2px 6px -1px rgba(15, 23, 42, 0.02);
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
}

body.merchant-body-layout {
  display: flex;
  min-height: 100vh;
  background-color: #f8fafc !important;
  color: #0f172a !important;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  overflow-x: hidden;
}

/* Sidebar */
.sidebar-navigation {
  width: 260px;
  background-color: #ffffff !important;
  border-right: 1px solid #e2e8f0 !important;
  display: flex;
  flex-direction: column;
  height: 100vh;
  position: fixed;
  left: 0;
  top: 0;
  z-index: 100;
  padding: 20px 14px;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  box-shadow: 2px 0 10px rgba(15, 23, 42, 0.02);
}

.sidebar-navigation::-webkit-scrollbar {
  width: 4px;
}

.sidebar-navigation::-webkit-scrollbar-thumb {
  background: rgba(37, 99, 235, 0.2);
  border-radius: 4px;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 20px;
  letter-spacing: 0.05em;
  color: #0f172a;
  margin-bottom: 20px;
  padding-left: 10px;
}

.merchant-switcher-wrapper {
  margin-bottom: 20px;
  padding: 0 10px;
}

.merchant-switcher-wrapper select {
  margin-top: 8px;
  background-color: #ffffff;
  border-color: #cbd5e1;
  color: #0f172a;
  cursor: pointer;
}

.sidebar-section {
  margin-bottom: 20px;
  flex: 1;
}

.section-title {
  display: block;
  font-size: 11px;
  font-weight: 800;
  color: #0284c7;
  letter-spacing: 0.1em;
  margin-bottom: 10px;
  padding-left: 10px;
  text-transform: uppercase;
}

.nav-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 10px;
  color: #475569;
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.nav-item i {
  font-size: 16px;
  width: 20px;
  text-align: center;
  color: #64748b;
  transition: color 0.2s ease;
}

.nav-item:hover {
  background-color: #eff6ff !important;
  color: #2563eb !important;
}

.nav-item:hover i {
  color: #2563eb !important;
}

.nav-item.active {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%) !important;
  color: #ffffff !important;
  font-weight: 600 !important;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35) !important;
}

.nav-item.active i {
  color: #38bdf8 !important;
}

.nav-item.active::before {
  display: none !important;
}

.sidebar-footer {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.admin-portal-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  background: rgba(6, 182, 212, 0.06);
  border: 1px dashed rgba(6, 182, 212, 0.25);
  color: #0891b2;
  font-size: 13px;
  font-weight: 500;
  transition: var(--transition);
}

.admin-portal-link:hover {
  background: rgba(6, 182, 212, 0.12);
  color: #0284c7;
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-top: 15px;
  border-top: 1px solid var(--border-color);
}

.merchant-avatar-placeholder {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
}

.user-info {
  display: flex;
  flex-direction: column;
}

.user-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

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

/* Main Layout Wrapper */
.main-layout-wrapper {
  margin-left: 260px;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Topbar */
.topbar {
  height: 72px;
  background-color: #ffffff !important;
  border-bottom: 1px solid #e2e8f0 !important;
  padding: 0 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 90;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.02);
}

.breadcrumbs {
  font-size: 12px;
  color: #64748b;
}

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

.merchant-status-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  color: #1e293b;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  padding: 6px 14px;
  border-radius: 20px;
}

.status-dot {
  width: 8px;
  height: 8px;
  background-color: #10b981;
  border-radius: 50%;
  animation: blink 1.5s infinite;
}

@keyframes blink {
  0% {
    opacity: 0.5;
  }

  50% {
    opacity: 1;
  }

  100% {
    opacity: 0.5;
  }
}

.action-icon-btn {
  background-color: #ffffff;
  border: 1px solid #e2e8f0;
  color: #64748b;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.action-icon-btn:hover {
  background-color: #f8fafc;
  color: #2563eb;
  border-color: #cbd5e1;
}

/* Content Container */
.content-container {
  padding: 28px 32px;
  flex-grow: 1;
  overflow-y: auto;
}

.tab-pane {
  display: none;
}

.tab-pane.active {
  display: block;
}

/* =========================================================
   MERCHANT DASHBOARD HERO BANNER & QUICK ACTIONS
   ========================================================= */
.merchant-hero-banner {
  background: linear-gradient(135deg, #ffffff 0%, #f0fdfa 60%, #eff6ff 100%);
  border: 1px solid #e2e8f0;
  border-radius: 18px;
  padding: 24px 28px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  box-shadow: 0 4px 20px -2px rgba(15, 23, 42, 0.04);
  position: relative;
  overflow: hidden;
}

.merchant-hero-banner::after {
  content: '';
  position: absolute;
  top: -60px;
  right: -60px;
  width: 180px;
  height: 180px;
  background: radial-gradient(circle, rgba(6, 182, 212, 0.15) 0%, transparent 70%);
  pointer-events: none;
}

.hero-content {
  flex: 1;
  min-width: 0;
}

.hero-tag-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.hero-live-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  color: #059669;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 20px;
  letter-spacing: 0.02em;
}

.live-dot-pulse {
  width: 7px;
  height: 7px;
  background-color: #10b981;
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  animation: pulseGreen 2s infinite;
}

@keyframes pulseGreen {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.hero-subpill {
  display: inline-block;
  background: #f1f5f9;
  color: #475569;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 20px;
}

.hero-title {
  font-size: 24px;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.02em;
  margin: 0 0 6px 0;
  font-family: var(--font-heading);
}

.gradient-text {
  background: linear-gradient(135deg, #2563eb 0%, #06b6d4 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-description {
  font-size: 13px;
  color: #64748b;
  margin: 0;
  line-height: 1.5;
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.btn-hero-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, #2563eb 0%, #06b6d4 100%);
  color: #ffffff !important;
  text-decoration: none;
  font-weight: 600;
  font-size: 13px;
  padding: 10px 18px;
  border-radius: 10px;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.25);
  transition: all 0.2s ease;
}

.btn-hero-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.35);
  color: #ffffff !important;
}

.btn-hero-secondary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  color: #334155 !important;
  text-decoration: none;
  font-weight: 600;
  font-size: 13px;
  padding: 10px 16px;
  border-radius: 10px;
  transition: all 0.2s ease;
}

.btn-hero-secondary:hover {
  background: #f8fafc;
  border-color: #2563eb;
  color: #2563eb !important;
  transform: translateY(-1px);
}

@media (max-width: 900px) {
  .merchant-hero-banner {
    flex-direction: column;
    align-items: flex-start;
  }
  .hero-actions {
    width: 100%;
    flex-wrap: wrap;
  }
}

/* =========================================================
   ENHANCED STAT CARDS
   ========================================================= */
.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 20px;
  margin-bottom: 24px;
}

.stat-card-premium {
  padding: 20px 22px;
  border-radius: 16px;
  border: 1px solid #e2e8f0 !important;
  background-color: #ffffff !important;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 4px 20px -2px rgba(15, 23, 42, 0.04);
  position: relative;
  overflow: hidden;
}

.stat-card-premium::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
}

.card-accent-blue::before {
  background: linear-gradient(90deg, #2563eb 0%, #06b6d4 100%);
}

.card-accent-cyan::before {
  background: linear-gradient(90deg, #06b6d4 0%, #0ea5e9 100%);
}

.card-accent-emerald::before {
  background: linear-gradient(90deg, #10b981 0%, #059669 100%);
}

.card-accent-indigo::before {
  background: linear-gradient(90deg, #6366f1 0%, #2563eb 100%);
}

.stat-card-premium:hover {
  border-color: #2563eb !important;
  box-shadow: 0 12px 28px -4px rgba(37, 99, 235, 0.12);
  transform: translateY(-2px);
}

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

.stat-label {
  font-size: 11px;
  font-weight: 700;
  color: #64748b;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.stat-pill {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.pill-blue { background: #eff6ff; color: #2563eb; border: 1px solid #bfdbfe; }
.pill-cyan { background: #ecfeff; color: #0891b2; border: 1px solid #a5f3fc; }
.pill-emerald { background: #ecfdf5; color: #059669; border: 1px solid #a7f3d0; }
.pill-indigo { background: #eef2ff; color: #4f46e5; border: 1px solid #c7d2fe; }

.stat-card-body {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.stat-number-wrapper {
  display: flex;
  flex-direction: column;
}

.stat-number {
  font-size: 26px;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.02em;
  font-family: var(--font-heading);
  line-height: 1.1;
  margin: 0;
}

.text-blue { color: #2563eb !important; }
.text-emerald { color: #059669 !important; }
.text-indigo { color: #4f46e5 !important; }

.stat-subtext {
  font-size: 11.5px;
  color: #64748b;
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 500;
}

.stat-card-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.icon-blue {
  background: rgba(37, 99, 235, 0.1);
  color: #2563eb;
}

.icon-cyan {
  background: rgba(6, 182, 212, 0.12);
  color: #0891b2;
}

.icon-emerald {
  background: rgba(16, 185, 129, 0.12);
  color: #059669;
}

.icon-indigo {
  background: rgba(99, 102, 241, 0.12);
  color: #4f46e5;
}

/* Dashboard Grid Layout */
.dashboard-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 24px;
  margin-bottom: 24px;
}

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

.chart-tag {
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  color: #475569;
  font-size: 11.5px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.top-tx-view-all {
  color: #2563eb;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s;
}

.top-tx-view-all:hover {
  color: #1d4ed8;
  gap: 8px;
}

/* Empty State Box */
.empty-state-box {
  padding: 32px 16px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.empty-state-icon {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: rgba(37, 99, 235, 0.08);
  color: #2563eb;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  margin-bottom: 12px;
}

.empty-state-box h4 {
  font-size: 14px;
  font-weight: 700;
  color: #0f172a;
  margin: 0 0 6px 0;
}

.empty-state-box p {
  font-size: 12px;
  color: #64748b;
  margin: 0 0 16px 0;
  max-width: 240px;
  line-height: 1.4;
}

.btn-empty-action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #2563eb !important;
  text-decoration: none;
  font-size: 12px;
  font-weight: 600;
  padding: 7px 14px;
  border-radius: 8px;
  transition: all 0.2s;
}

.btn-empty-action:hover {
  background: #2563eb;
  color: #ffffff !important;
  border-color: #2563eb;
}

/* Top Transactions Items */
.top-tx-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid #f1f5f9;
}

.top-tx-item:last-child {
  border-bottom: none;
}

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

.tx-rank-badge {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 12px;
}

.tx-id-text {
  font-weight: 600;
  font-size: 13px;
  color: #0f172a;
}

.tx-date-text {
  font-size: 11px;
  color: #64748b;
}

.tx-amount-badge {
  font-weight: 700;
  color: #059669;
  font-size: 14px;
}

/* Feature Grid at Bottom */
.merchant-feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin-top: 8px;
}

.feature-item-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 20px;
  display: flex;
  gap: 16px;
  align-items: flex-start;
  transition: all 0.2s ease;
  box-shadow: 0 4px 16px -2px rgba(15, 23, 42, 0.03);
}

.feature-item-card:hover {
  border-color: rgba(37, 99, 235, 0.3);
  box-shadow: 0 8px 24px -4px rgba(37, 99, 235, 0.08);
}

.feature-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.feature-content {
  flex: 1;
}

.feature-title {
  font-weight: 700;
  font-size: 14px;
  color: #0f172a;
  margin-bottom: 4px;
}

.feature-desc {
  font-size: 12px;
  color: #64748b;
  line-height: 1.45;
}

.feature-link {
  display: inline-block;
  margin-top: 8px;
  font-size: 12px;
  font-weight: 600;
  color: #2563eb;
  text-decoration: none;
}

.feature-link:hover {
  text-decoration: underline;
}

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

@media (max-width: 1100px) {
  .dashboard-split-grid {
    grid-template-columns: 1fr;
  }
}

.chart-card-large {
  padding: 24px;
}

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

.chart-wrapper-main {
  height: 280px;
  position: relative;
}

/* Copy Input Field group */
.copy-input-wrapper {
  display: flex;
  gap: 8px;
}

.copy-input-wrapper input {
  flex-grow: 1;
}

.copy-input-wrapper button {
  width: 44px;
  height: 44px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.divider {
  height: 1px;
  background-color: var(--border-color);
  width: 100%;
}

.text-teal {
  color: #10b981 !important;
}

.text-rose {
  color: #f43f5e !important;
}

.btn-block {
  width: 100%;
}

/* Filters */
.filter-bar-wrapper {
  display: flex;
  gap: 12px;
  margin-top: 15px;
  align-items: center;
}

@media (max-width: 768px) {
  .filter-bar-wrapper {
    flex-direction: column;
    align-items: stretch;
  }
}

/* --- Light Theme Overrides --- */
body.light-theme .nav-item:hover {
  background-color: rgba(0, 0, 0, 0.03);
}

body.light-theme .merchant-status-badge {
  background-color: rgba(0, 0, 0, 0.02);
}

body.light-theme .merchant-avatar-placeholder {
  background-color: rgba(0, 0, 0, 0.05);
  color: var(--text-secondary);
}

body.light-theme .action-icon-btn:hover {
  background-color: rgba(0, 0, 0, 0.04);
}

body.light-theme .admin-portal-link {
  background: rgba(14, 211, 198, 0.05);
  color: #0b9a90;
  /* Darker teal for accessibility contrast in light mode */
  border-color: rgba(14, 211, 198, 0.3);
}

body.light-theme .admin-portal-link:hover {
  background: rgba(14, 211, 198, 0.12);
  color: #088077;
}

body.light-theme .merchant-switcher-wrapper select {
  background-color: #ffffff;
  border-color: #cbd5e1;
  color: var(--text-primary);
}

/* Leaderboard Rank Styles */
.merchant-rank-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 16px;
  background-color: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.merchant-rank-item:hover {
  background-color: rgba(255, 255, 255, 0.04);
}

.rank-badge {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 14px;
}

.rank-1 {
  background-color: rgba(37, 99, 235, 0.12);
  color: #2563eb;
  border: 1px solid rgba(37, 99, 235, 0.3);
}

.rank-2 {
  background-color: rgba(255, 179, 0, 0.15);
  color: #ffb300;
  border: 1px solid #ffb300;
}

.rank-3 {
  background-color: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
  border: 1px solid #f59e0b;
}

.rank-other {
  background-color: rgba(255, 255, 255, 0.05);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
}

.merchant-rank-info {
  flex-grow: 1;
}

.merchant-rank-name {
  font-size: 14px;
  font-weight: 600;
  display: block;
}

.merchant-rank-txs {
  font-size: 11px;
  color: var(--text-muted);
}

.merchant-rank-volume {
  font-size: 16px;
  font-weight: 700;
  font-family: var(--font-heading);
}

body.light-theme .merchant-rank-item {
  background-color: #ffffff;
}

body.light-theme .merchant-rank-item:hover {
  background-color: rgba(0, 0, 0, 0.01);
}

/* Integration Guide Styles */
.docs-nav-tabs {
  display: flex;
  gap: 8px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  padding: 4px;
  border-radius: var(--radius-sm);
}

.docs-nav-tab-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-weight: 600;
  font-size: 13px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
  display: flex;
  align-items: center;
}

.docs-nav-tab-btn.active {
  color: var(--primary);
  background-color: rgba(99, 102, 241, 0.1);
}

.code-snippet-pre-wrapper {
  position: relative;
}

.code-snippet-pre-wrapper pre {
  background: #08090e;
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 20px 22px;
  border-radius: var(--radius-sm);
  overflow-x: auto;
  font-family: 'Consolas', 'Courier New', Courier, monospace;
  font-size: 13px;
  line-height: 1.6;
  color: #f1f5f9;
  max-height: 480px;
}

.code-snippet-copy-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #cbd5e1;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 6px;
}

.code-snippet-copy-btn:hover {
  background: rgba(37, 99, 235, 0.3);
  border-color: #2563eb;
  color: #ffffff;
}

.api-method-badge {
  display: inline-block;
  padding: 4px 10px;
  font-weight: 800;
  font-size: 11px;
  border-radius: 4px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.api-method-post {
  background-color: rgba(16, 185, 129, 0.18);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.35);
}

.api-url-text {
  font-family: 'Consolas', monospace;
  font-size: 13px;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.04);
  color: #38bdf8;
  padding: 6px 14px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  word-break: break-all;
}

/* Quick Jump Anchors in Docs */
.docs-jump-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  transition: var(--transition);
  text-decoration: none;
}

.docs-jump-btn:hover {
  background: rgba(99, 102, 241, 0.15);
  border-color: var(--primary);
  color: var(--primary);
}

/* Parameter Table Styling */
.doc-param-table th {
  padding: 12px 14px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: rgba(255, 255, 255, 0.02);
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-color);
}

.doc-param-table td {
  padding: 12px 14px;
  font-size: 13px;
  line-height: 1.5;
  border-bottom: 1px solid var(--border-color);
}

.doc-param-code {
  font-family: 'Consolas', monospace;
  font-size: 13px;
  font-weight: 600;
  color: #a5b4fc;
  background: rgba(99, 102, 241, 0.15);
  border: 1px solid rgba(99, 102, 241, 0.3);
  padding: 2px 7px;
  border-radius: 4px;
}

.doc-type-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.05);
  padding: 2px 8px;
  border-radius: 4px;
  border: 1px solid var(--border-color);
}

.doc-req-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  color: #f87171;
  background: rgba(239, 68, 68, 0.18);
  border: 1px solid rgba(239, 68, 68, 0.35);
  padding: 2px 8px;
  border-radius: 4px;
  text-transform: uppercase;
}

.doc-opt-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  padding: 2px 8px;
  border-radius: 4px;
  text-transform: uppercase;
}

.doc-cond-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  color: #fbbf24;
  background: rgba(245, 158, 11, 0.18);
  border: 1px solid rgba(245, 158, 11, 0.35);
  padding: 2px 8px;
  border-radius: 4px;
}

/* Support Channel Cards */
.support-channel-card:hover {
  transform: translateY(-2px);
  border-color: rgba(34, 158, 217, 0.4);
  box-shadow: 0 10px 25px -5px rgba(34, 158, 217, 0.18);
}

/* Light Theme Overrides for Crystal Clear Legibility */
body.light-theme .code-snippet-pre-wrapper pre {
  background: #0f172a !important;
  /* Premium dark terminal in light mode for 100% text readability */
  border: 1px solid #334155 !important;
  color: #f8fafc !important;
}

body.light-theme .code-snippet-copy-btn {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
  color: #f1f5f9;
}

body.light-theme .code-snippet-copy-btn:hover {
  background: #2563eb;
  color: #ffffff;
}

body.light-theme .api-url-text {
  background: #f1f5f9;
  color: #0369a1;
  border-color: #cbd5e1;
}

body.light-theme .api-method-post {
  background-color: #d1fae5;
  color: #047857;
  border-color: #a7f3d0;
}

body.light-theme .docs-jump-btn {
  background: #ffffff;
  border-color: #cbd5e1;
  color: #334155;
}

body.light-theme .docs-jump-btn:hover {
  background: #eff6ff;
  border-color: #3b82f6;
  color: #2563eb;
}

body.light-theme .doc-param-table th {
  background: #f8fafc;
  color: #1e293b;
  border-bottom: 1px solid #cbd5e1;
}

body.light-theme .doc-param-table td {
  color: #0f172a;
  border-bottom: 1px solid #e2e8f0;
}

body.light-theme .doc-param-code {
  color: #312e81;
  background: #e0e7ff;
  border-color: #c7d2fe;
}

body.light-theme .doc-type-badge {
  color: #475569;
  background: #f1f5f9;
  border-color: #cbd5e1;
}

body.light-theme .doc-req-badge {
  color: #991b1b;
  background: #fee2e2;
  border-color: #fca5a5;
}

body.light-theme .doc-opt-badge {
  color: #64748b;
  background: #f8fafc;
  border-color: #cbd5e1;
}

body.light-theme .doc-cond-badge {
  color: #92400e;
  background: #fef3c7;
  border-color: #fcd34d;
}

body.light-theme .support-channel-card {
  background: #ffffff;
  border-color: #cbd5e1;
}

body.light-theme .support-channel-card:hover {
  border-color: #38bdf8;
  box-shadow: 0 10px 25px -5px rgba(56, 189, 248, 0.2);
}

/* ==========================================================================
   GALAXYPAY MERCHANT PORTAL - PC & PHONE RESPONSIVE STYLES
   ========================================================================== */

/* Mobile Sidebar Toggle Button & Backdrop Base */
.mobile-sidebar-toggle-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid var(--border-color);
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-size: 16px;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.mobile-sidebar-toggle-btn:hover {
  background: rgba(37, 99, 235, 0.12);
  border-color: #2563eb;
  color: #2563eb;
}

.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 99998;
  background: rgba(5, 6, 11, 0.72);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

/* Table Responsiveness Base */
.table-container,
.responsive-table {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.table-container table,
.responsive-table table,
table.data-table {
  width: 100%;
}

/* =========================================================
   DESKTOP PC RULES (min-width: 992px)
   ========================================================= */
@media (min-width: 992px) {
  html, body {
    overflow-x: hidden;
  }

  body.merchant-body-layout,
  body.dashboard-body-layout {
    display: flex !important;
    min-height: 100vh !important;
    width: 100% !important;
  }

  .sidebar-navigation {
    position: fixed !important;
    left: 0 !important;
    top: 0 !important;
    width: 260px !important;
    height: 100vh !important;
    transform: none !important;
    display: flex !important;
    flex-direction: column !important;
    z-index: 100 !important;
    box-shadow: none !important;
  }

  /* Agent sidebar is 250px */
  body.dashboard-body-layout .sidebar-navigation {
    width: 250px !important;
  }

  .main-layout-wrapper {
    margin-left: 260px !important;
    width: calc(100% - 260px) !important;
    min-width: 0 !important;
    flex: 1 !important;
    display: flex !important;
    flex-direction: column !important;
    min-height: 100vh !important;
  }

  body.dashboard-body-layout .main-layout-wrapper {
    margin-left: 250px !important;
    width: calc(100% - 250px) !important;
  }

  .mobile-sidebar-toggle-btn,
  .topbar-toggle-btn,
  .mobile-sidebar-close-btn,
  .sidebar-mobile-close-row,
  .sidebar-backdrop {
    display: none !important;
  }
}

/* =========================================================
   MOBILE & TABLET PHONE RULES (max-width: 991px)
   ========================================================= */
@media (max-width: 991px) {
  html, body {
    overflow-x: hidden !important;
    width: 100% !important;
    max-width: 100vw !important;
  }

  body.merchant-body-layout,
  body.dashboard-body-layout {
    display: block !important;
    width: 100% !important;
    max-width: 100vw !important;
    overflow-x: hidden !important;
  }

  /* Main Wrapper takes full width on mobile */
  .main-layout-wrapper {
    margin-left: 0 !important;
    width: 100% !important;
    max-width: 100vw !important;
    min-width: 0 !important;
    overflow-x: hidden !important;
  }

  /* Off-canvas Drawer Navigation */
  .sidebar-navigation,
  aside.sidebar {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    bottom: 0 !important;
    width: 280px !important;
    max-width: 82vw !important;
    height: 100vh !important;
    height: 100dvh !important;
    z-index: 99999 !important;
    transform: translateX(-100%) !important;
    transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1) !important;
    box-shadow: none !important;
    display: flex !important;
    flex-direction: column !important;
  }

  .sidebar-navigation.open,
  .sidebar-navigation.mobile-open,
  aside.sidebar.open,
  aside.sidebar.mobile-open {
    transform: translateX(0) !important;
    box-shadow: 0 0 60px rgba(0, 0, 0, 0.85) !important;
  }

  .mobile-sidebar-close-btn {
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05) !important;
    color: var(--text-muted) !important;
    cursor: pointer;
  }

  .sidebar-mobile-close-row {
    display: flex !important;
  }

  .mobile-sidebar-toggle-btn,
  .topbar-toggle-btn {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: var(--bg-secondary);
    color: var(--text-primary);
    cursor: pointer;
    font-size: 16px;
    flex-shrink: 0;
  }

  .sidebar-backdrop {
    display: block !important;
    position: fixed !important;
    inset: 0 !important;
    background: rgba(0, 0, 0, 0.65) !important;
    z-index: 99998 !important;
    backdrop-filter: blur(4px) !important;
    -webkit-backdrop-filter: blur(4px) !important;
    opacity: 0 !important;
    pointer-events: none !important;
    transition: opacity 0.25s ease !important;
  }

  .sidebar-backdrop.active {
    opacity: 1 !important;
    pointer-events: auto !important;
  }

  body.sidebar-mobile-locked {
    overflow: hidden !important;
  }

  /* Topbar on Mobile */
  .topbar {
    height: auto !important;
    min-height: 56px !important;
    padding: 10px 14px !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
  }

  .page-title-area h2,
  .topbar h2,
  #current-tab-title {
    font-size: 16px !important;
  }

  .breadcrumbs,
  #current-breadcrumbs {
    font-size: 11px !important;
  }

  .topbar-actions,
  .topbar-right {
    gap: 8px !important;
  }

  /* Content Padding on Phone */
  .content-container,
  .content-body,
  main.content-container {
    padding: 14px 10px !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  /* Stat / Metric Cards Grid on Mobile: 2 Compact Columns */
  .stats-row,
  .agent-metrics-grid,
  div[style*="repeat(auto-fit, minmax(235px, 1fr))"],
  div[style*="repeat(auto-fit, minmax(240px, 1fr))"],
  div[style*="repeat(auto-fit, minmax(230px, 1fr))"],
  div[style*="repeat(auto-fit, minmax(220px, 1fr))"] {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px !important;
    margin-bottom: 16px !important;
  }

  /* Compact Metric Cards for Mobile */
  .stat-card-premium,
  .metric-card,
  .agent-metrics-grid .glass-card {
    padding: 12px 10px !important;
    border-radius: 12px !important;
  }

  .stat-label,
  .card-label {
    font-size: 10px !important;
    letter-spacing: 0.3px !important;
  }

  .stat-number,
  .card-value,
  div[id^="dash-"] {
    font-size: 18px !important;
    margin: 4px 0 2px !important;
  }

  .stat-card-icon,
  .metric-card div[style*="width: 44px; height: 44px"],
  .metric-card div[style*="width: 40px; height: 40px"] {
    width: 32px !important;
    height: 32px !important;
    font-size: 13px !important;
    border-radius: 8px !important;
  }

  /* Dashboard 2-column Grid & Split Grids stack into 1 column */
  .dashboard-grid,
  .dashboard-split-grid,
  .agent-split-grid,
  .settlement-grid,
  .credentials-layout,
  .paylink-grid,
  div[style*="grid-template-columns: 2fr 1fr"],
  div[style*="grid-template-columns: 1fr 1fr"],
  div[style*="grid-template-columns: 1.2fr 1fr"],
  div[style*="grid-template-columns: 1fr 380px"],
  div[style*="minmax(360px, 1fr)"],
  div[style*="minmax(340px, 1fr)"],
  div[style*="minmax(320px, 1fr)"],
  div[style*="minmax(280px, 1fr)"] {
    grid-template-columns: 1fr !important;
    gap: 14px !important;
  }

  .credentials-layout>div,
  .paylink-grid>div {
    grid-column: span 1 !important;
  }

  .chart-wrapper {
    height: 220px !important;
  }

  /* Banners / Top Controls */
  div[style*="justify-content: space-between"][style*="border-radius: 12px"],
  div[style*="justify-content: space-between"][style*="border-radius: 14px"] {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 12px !important;
    padding: 14px 14px !important;
  }

  /* Glass Cards */
  .glass-card,
  .card {
    padding: 14px 12px !important;
    border-radius: 14px !important;
    margin-bottom: 14px !important;
  }

  .card-header {
    flex-wrap: wrap !important;
    gap: 10px !important;
  }

  /* Table Scrolling on Mobile */
  .table-container,
  .table-wrapper,
  .responsive-table,
  div[style*="overflow-x: auto"] {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    width: 100% !important;
    border-radius: 8px !important;
    margin-top: 10px !important;
  }

  .table-container table,
  .responsive-table table,
  table.data-table,
  table.table,
  table {
    min-width: 600px !important;
  }

  /* Form & Filters on Mobile */
  .filter-controls-row,
  .filter-row,
  .form-row,
  .grid-2 {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 8px !important;
  }

  .filter-controls-row>div {
    width: 100% !important;
    min-width: 100% !important;
  }

  /* Modals */
  .modal-overlay {
    padding: 10px !important;
  }

  .modal-content,
  .modal-card,
  .modal-dialog {
    width: 95% !important;
    max-width: 480px !important;
    max-height: 90vh !important;
    overflow-y: auto !important;
    padding: 16px 14px !important;
    border-radius: 14px !important;
  }
}

/* =========================================================
   SMALL PHONES (max-width: 480px)
   ========================================================= */
@media (max-width: 480px) {
  .topbar {
    padding: 8px 10px !important;
  }

  .breadcrumbs,
  #current-breadcrumbs {
    display: none !important;
  }

  .page-title-area h2,
  .topbar h2,
  #current-tab-title {
    font-size: 14px !important;
  }

  .merchant-status-badge {
    padding: 4px 8px !important;
    font-size: 11px !important;
  }

  .merchant-status-badge #status-api-badge {
    display: none;
  }

  .merchant-status-badge::after {
    content: "API";
    font-size: 11px;
    font-weight: 700;
  }

  .stats-row,
  .agent-metrics-grid,
  div[style*="repeat(auto-fit, minmax(235px, 1fr))"],
  div[style*="repeat(auto-fit, minmax(240px, 1fr))"],
  div[style*="repeat(auto-fit, minmax(230px, 1fr))"],
  div[style*="repeat(auto-fit, minmax(220px, 1fr))"] {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px !important;
  }

  .stat-card-premium,
  .metric-card,
  .agent-metrics-grid .glass-card {
    padding: 10px 8px !important;
  }

  .stat-number,
  .card-value,
  div[id^="dash-"] {
    font-size: 15px !important;
  }

  .content-container,
  .content-body,
  main.content-container {
    padding: 10px 8px !important;
  }

  .btn {
    font-size: 12px !important;
    padding: 8px 12px !important;
  }
}

/* =========================================================
   ROYAL BLUE & ELECTRIC CYAN ENHANCED FINTECH THEME
   ========================================================= */

body.merchant-body-layout .glass-card,
body.merchant-body-layout .card,
body.merchant-body-layout .chart-card,
body.merchant-body-layout .top-tx-card {
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 16px !important;
  box-shadow: 0 4px 20px -2px rgba(15, 23, 42, 0.04) !important;
  color: #0f172a !important;
}

body.merchant-body-layout .glass-card:hover,
body.merchant-body-layout .card:hover {
  border-color: rgba(37, 99, 235, 0.3) !important;
  box-shadow: 0 10px 25px -4px rgba(37, 99, 235, 0.08) !important;
}

body.merchant-body-layout .btn-primary,
body.merchant-body-layout button.btn-primary,
body.merchant-body-layout a.btn-primary {
  background: linear-gradient(135deg, #2563eb 0%, #06b6d4 100%) !important;
  color: #ffffff !important;
  border: none !important;
  font-weight: 600 !important;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.25) !important;
  border-radius: 8px !important;
  transition: all 0.2s ease !important;
}

body.merchant-body-layout .btn-primary:hover,
body.merchant-body-layout button.btn-primary:hover,
body.merchant-body-layout a.btn-primary:hover {
  background: linear-gradient(135deg, #1d4ed8 0%, #0891b2 100%) !important;
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.35) !important;
  transform: translateY(-1px);
}

body.merchant-body-layout .form-input,
body.merchant-body-layout input[type="text"],
body.merchant-body-layout input[type="number"],
body.merchant-body-layout input[type="password"],
body.merchant-body-layout select {
  background: #ffffff !important;
  border: 1px solid #cbd5e1 !important;
  border-radius: 8px !important;
  color: #0f172a !important;
  font-size: 13.5px;
  transition: all 0.2s ease;
}

body.merchant-body-layout .form-input:focus,
body.merchant-body-layout input:focus,
body.merchant-body-layout select:focus {
  border-color: #2563eb !important;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15) !important;
  outline: none !important;
}

body.merchant-body-layout table {
  background: #ffffff;
  border-collapse: separate;
  border-spacing: 0;
  width: 100%;
}

body.merchant-body-layout th {
  background: #f8fafc !important;
  color: #475569 !important;
  font-weight: 700 !important;
  font-size: 11px !important;
  text-transform: uppercase !important;
  letter-spacing: 0.05em !important;
  border-bottom: 1px solid #e2e8f0 !important;
  padding: 12px 16px !important;
}

body.merchant-body-layout td {
  border-bottom: 1px solid #f1f5f9 !important;
  color: #1e293b !important;
  font-size: 13.5px !important;
  padding: 13px 16px !important;
}

body.merchant-body-layout tr:hover td {
  background: #f8fafc !important;
}

body.merchant-body-layout .badge-paid,
body.merchant-body-layout .status-success {
  background: #ecfdf5 !important;
  color: #059669 !important;
  border: 1px solid #a7f3d0 !important;
  font-weight: 700;
  border-radius: 20px;
  padding: 3px 10px;
}

body.merchant-body-layout .badge-pending,
body.merchant-body-layout .status-pending {
  background: #fffbeb !important;
  color: #d97706 !important;
  border: 1px solid #fde68a !important;
  font-weight: 700;
  border-radius: 20px;
  padding: 3px 10px;
}

body.merchant-body-layout .badge-failed,
body.merchant-body-layout .status-failed {
  background: #fef2f2 !important;
  color: #dc2626 !important;
  border: 1px solid #fecaca !important;
  font-weight: 700;
  border-radius: 20px;
  padding: 3px 10px;
}
