/* Merchant Area Custom Dashboard Styles */

body.merchant-body-layout {
  display: flex;
  min-height: 100vh;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-main);
  overflow-x: hidden;
}

/* Sidebar */
.sidebar-navigation {
  width: 260px;
  background-color: var(--bg-secondary);
  border-right: 1px solid var(--border-color);
  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;
}

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

.sidebar-navigation::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}

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

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

.merchant-switcher-wrapper select {
  margin-top: 8px;
  background-color: var(--bg-primary);
  border-color: rgba(99, 102, 241, 0.2);
  cursor: pointer;
}

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

.section-title {
  display: block;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.1em;
  margin-bottom: 10px;
  padding-left: 10px;
}

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

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
}

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

.nav-item:hover {
  background-color: rgba(255, 255, 255, 0.03);
  color: var(--text-primary);
}

.nav-item.active {
  background-color: rgba(99, 102, 241, 0.08);
  color: var(--primary);
  font-weight: 600;
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 20%;
  height: 60%;
  width: 4px;
  background-color: var(--primary);
  border-radius: 0 4px 4px 0;
}

.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(14, 211, 198, 0.05);
  border: 1px dashed rgba(14, 211, 198, 0.2);
  color: #0ed3c6;
  font-size: 13px;
  font-weight: 500;
  transition: var(--transition);
}

.admin-portal-link:hover {
  background: rgba(14, 211, 198, 0.12);
  color: white;
}

.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: 80px;
  background-color: var(--bg-primary);
  border-bottom: 1px solid var(--border-color);
  padding: 0 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 90;
}

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

.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: var(--text-secondary);
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  padding: 8px 16px;
  border-radius: var(--radius-sm);
}

.status-dot {
  width: 8px;
  height: 8px;
  background-color: var(--success);
  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: var(--bg-secondary);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}

.action-icon-btn:hover {
  background-color: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
}

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

.tab-pane {
  display: none;
}

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

/* Premium Stat Cards */
.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-bottom: 24px;
}

.stat-card-premium {
  padding: 24px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background-color: var(--bg-secondary);
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: var(--transition);
}

.stat-card-premium:hover {
  border-color: rgba(99, 102, 241, 0.3);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
}

.stat-card-left {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.stat-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.05em;
}

.stat-number {
  font-size: 26px;
  font-weight: 800;
  font-family: var(--font-heading);
}

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

.icon-teal {
  background-color: rgba(16, 185, 129, 0.1);
  color: var(--success);
}

.icon-cyan {
  background-color: rgba(99, 102, 241, 0.1);
  color: var(--primary);
}

.icon-yellow {
  background-color: rgba(255, 179, 0, 0.1);
  color: #ffb300;
}

.icon-orange {
  background-color: rgba(245, 158, 11, 0.1);
  color: #f59e0b;
}

/* 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(14, 211, 198, 0.15);
  color: #0ed3c6;
  border: 1px solid #0ed3c6;
}

.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(99, 102, 241, 0.3);
  border-color: #6366f1;
  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: #6366f1;
  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);
}

/* ==========================================================================
   LPAY 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(99, 102, 241, 0.15);
  border-color: #6366f1;
  color: #6366f1;
}

.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;
  }
}