/* ==========================================================================
   DASHWORK ENTERPRISE — PRO ELITE COMMAND CENTER DESIGN SYSTEM (LIGHT THEME)
   ========================================================================== */

:root {
  /* Crisp Canvas & Surfaces */
  --bg-canvas: #f8fafc;
  --bg-surface: #ffffff;
  --bg-surface-elevated: #f1f5f9;
  --bg-surface-hover: #e2e8f0;
  --bg-glass: rgba(255, 255, 255, 0.94);

  /* Precision Enterprise Borders */
  --border-subtle: #e2e8f0;
  --border-focus: #0f172a;

  /* Executive Typography */
  --text-main: #0f172a;
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;

  /* Pro Elite Action Colors (Zero AI Neon / Zero Purple) */
  --color-primary: #0f172a;
  --color-primary-dark: #1e293b;
  --color-primary-glow: rgba(15, 23, 42, 0.08);

  /* Semantic Status Colors (Fintech Grade) */
  --color-emerald: #059669;
  --color-emerald-bg: #ecfdf5;
  --color-amber: #d97706;
  --color-amber-bg: #fffbeb;
  --color-crimson: #dc2626;
  --color-crimson-bg: #fef2f2;
  --color-cyan: #0284c7;
  --color-cyan-bg: #f0f9ff;
  --color-purple: #c2410c;
  --color-purple-bg: #fff7ed;

  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 1px 3px 0 rgba(0, 0, 0, 0.08), 0 1px 2px -1px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.03);

  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;

  --sidebar-width: 250px;
  --sidebar-collapsed-width: 68px;
}

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

body {
  font-family: var(--font-sans);
  background-color: var(--bg-canvas);
  color: var(--text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
}

/* Layout container */
.app-layout {
  display: flex;
  width: 100vw;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Sidebar navigation */
.app-sidebar {
  width: var(--sidebar-width);
  background-color: var(--bg-surface);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  transition: width 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 50;
}

.sidebar-header {
  padding: 18px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-surface);
}

.brand-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.brand-icon {
  width: 32px;
  height: 32px;
  background: #0f172a;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.brand-icon svg {
  width: 17px;
  height: 17px;
  color: #ffffff;
}

.brand-title {
  font-weight: 700;
  font-size: 0.98rem;
  letter-spacing: -0.02em;
  color: var(--text-main);
}

.brand-version {
  font-size: 0.65rem;
  font-weight: 600;
  padding: 2px 6px;
  background: #f1f5f9;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-family: var(--font-mono);
}

.sidebar-nav {
  flex: 1;
  padding: 16px 12px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.nav-label {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  padding: 14px 10px 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 500;
  border-radius: var(--radius-md);
  transition: all 0.15s ease;
  cursor: pointer;
  border: 1px solid transparent;
}

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

.nav-item.active {
  background-color: #f1f5f9;
  color: #0f172a;
  font-weight: 600;
  border-color: #e2e8f0;
}

.nav-item svg {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
  color: currentColor;
}

.nav-badge {
  margin-left: auto;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 12px;
  background: var(--bg-surface-elevated);
  color: var(--text-secondary);
}

.nav-badge.alert {
  background: var(--color-amber-bg);
  color: var(--color-amber);
  border: 1px solid rgba(217, 119, 6, 0.3);
}

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.system-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.pulse-dot {
  width: 8px;
  height: 8px;
  background-color: var(--color-emerald);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--color-emerald);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  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); }
}

/* Main Content Area */
.app-main {
  flex: 1;
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Top App Header */
.app-topbar {
  height: 64px;
  background-color: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(8px);
}

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

.topbar-title {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
}

.btn-primary {
  background-color: var(--color-primary);
  color: #ffffff;
  border: 1px solid var(--color-primary);
  box-shadow: var(--shadow-sm);
}
.btn-primary:hover {
  background-color: var(--color-primary-dark);
  border-color: var(--color-primary-dark);
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}
.btn-primary:active {
  background-color: #334155;
  border-color: #334155;
  transform: translateY(0);
}

.btn-secondary {
  background-color: var(--bg-surface);
  color: var(--text-main);
  border: 1px solid #cbd5e1;
  box-shadow: var(--shadow-sm);
}
.btn-secondary:hover {
  background-color: var(--bg-surface-elevated);
  border-color: #94a3b8;
  color: var(--text-main);
}
.btn-secondary:active {
  background-color: #e2e8f0;
}

.btn-success {
  background-color: var(--color-emerald);
  color: #ffffff;
  border: 1px solid var(--color-emerald);
  box-shadow: var(--shadow-sm);
}
.btn-success:hover {
  background-color: #047857;
  border-color: #047857;
  color: #ffffff;
}

.btn-danger {
  background-color: var(--bg-surface);
  color: var(--color-crimson);
  border: 1px solid #fecaca;
  box-shadow: var(--shadow-sm);
}
.btn-danger:hover {
  background-color: var(--color-crimson-bg);
  border-color: #fca5a5;
  color: var(--color-crimson);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.78rem;
}

/* Page Containers */
.page-content {
  padding: 32px;
  flex: 1;
}

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

/* Metrics Dashboard Cards Grid */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-bottom: 28px;
}

.metric-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 20px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.metric-card:hover {
  border-color: #cbd5e1;
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

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

.metric-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

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

.metric-value {
  font-size: 1.85rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text-main);
}

.metric-footer {
  margin-top: 8px;
  font-size: 0.75rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.trend-up {
  color: var(--color-emerald);
  font-weight: 600;
}

/* Data Table Panels */
.data-panel {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  margin-bottom: 30px;
}

.panel-header {
  padding: 20px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-subtle);
  flex-wrap: wrap;
  gap: 16px;
  background-color: var(--bg-surface);
}

.panel-title-area h3 {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text-main);
}

.panel-title-area p {
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

.panel-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.search-input {
  background-color: var(--bg-surface);
  border: 1px solid #cbd5e1;
  color: var(--text-main);
  padding: 8px 14px;
  font-size: 0.84rem;
  border-radius: var(--radius-sm);
  min-width: 240px;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.search-input:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(15, 23, 42, 0.08);
}

.select-filter {
  background-color: var(--bg-surface);
  border: 1px solid #cbd5e1;
  color: var(--text-main);
  padding: 8px 12px;
  font-size: 0.84rem;
  border-radius: var(--radius-sm);
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.select-filter:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(15, 23, 42, 0.08);
}

/* Enterprise Data Table */
.table-responsive {
  width: 100%;
  overflow-x: auto;
}

.enterprise-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.86rem;
}

.enterprise-table th {
  background-color: #f8fafc;
  color: #64748b;
  font-weight: 600;
  padding: 12px 18px;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border-subtle);
}

.enterprise-table td {
  padding: 14px 18px;
  border-bottom: 1px solid #f1f5f9;
  color: var(--text-secondary);
}

.enterprise-table tr:hover td {
  background-color: #f8fafc;
}

.txn-code {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: #0f172a;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-weight: 600;
}

.txn-code:hover {
  background: #e2e8f0;
  text-decoration: none;
}

/* Status Pill Badges */
.badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  font-size: 0.74rem;
  font-weight: 600;
  border-radius: 20px;
  text-transform: capitalize;
  border: 1px solid transparent;
}

.badge-paid, .badge-delivered, .badge-active {
  background: #ecfdf5;
  color: #047857;
  border-color: #a7f3d0;
}

.badge-pending, .badge-processing {
  background: #fffbeb;
  color: #b45309;
  border-color: #fde68a;
}

.badge-abandoned_cart {
  background: #fff7ed;
  color: #c2410c;
  border-color: #fed7aa;
}

.badge-cancelled, .badge-refunded, .badge-inactive {
  background: #fef2f2;
  color: #b91c1c;
  border-color: #fecaca;
}

/* Switchboard Cards (Payment Methods) */
.switchboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 24px;
}

.switch-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
}

.switch-card:hover {
  border-color: #cbd5e1;
  box-shadow: var(--shadow-md);
}

.switch-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-subtle);
}

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

.switch-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
}

.switch-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-main);
}

.toggle-switch {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 26px;
}

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

.toggle-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: #cbd5e1;
  border: 1px solid #cbd5e1;
  transition: .3s;
  border-radius: 34px;
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
  transition: .3s;
  border-radius: 50%;
}

input:checked + .toggle-slider {
  background-color: var(--color-emerald);
  border-color: var(--color-emerald);
}

input:checked + .toggle-slider:before {
  transform: translateX(22px);
}

.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.form-input {
  width: 100%;
  background-color: var(--bg-surface);
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-sm);
  color: var(--text-main);
  padding: 10px 14px;
  font-size: 0.88rem;
  outline: none;
  font-family: var(--font-sans);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-input:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(15, 23, 42, 0.08);
}

/* Slide-over Drawer / Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(4px);
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: flex-end;
}

.modal-drawer {
  width: 100%;
  max-width: 600px;
  height: 100vh;
  background-color: var(--bg-surface);
  border-left: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  box-shadow: -4px 0 24px rgba(15, 23, 42, 0.12);
  animation: slideDrawer 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideDrawer {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}

.drawer-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-surface);
}

.drawer-body {
  padding: 24px;
  flex: 1;
  overflow-y: auto;
  background: var(--bg-surface);
}

.drawer-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  background: var(--bg-surface-elevated);
}

/* Real-time Activity Feed */
.event-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px;
  border-bottom: 1px solid var(--border-subtle);
  transition: background 0.15s ease;
}

.event-item:hover {
  background-color: var(--bg-surface-elevated);
}

.event-badge-icon {
  font-size: 1.2rem;
  margin-top: 2px;
}

.event-content {
  flex: 1;
}

.event-msg {
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-main);
}

.event-time {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 4px;
}

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

.toast {
  background: #0f172a;
  border: 1px solid #1e293b;
  padding: 12px 20px;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  color: #ffffff;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.2);
  display: flex;
  align-items: center;
  gap: 10px;
  animation: toastIn 0.3s ease;
}

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

/* Neutral Gateway Domains */
.neutral-domain-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  background: var(--bg-surface);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
}

.neutral-domain-row:hover {
  border-color: #cbd5e1;
  box-shadow: var(--shadow-md);
}

.neutral-domain-row.active {
  border-color: var(--color-primary);
  background: #f8fafc;
}

/* =====================================================================
   MOBILE & PWA RESPONSIVE SYSTEM (100% Mobile Optimized)
   ===================================================================== */

/* Mobile Backdrop Overlay */
.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 95;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.sidebar-backdrop.open {
  display: block;
  opacity: 1;
}

/* Mobile Header Toggles */
.mobile-menu-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
  transition: all 0.15s ease;
}

.mobile-menu-toggle:active {
  background: var(--bg-surface-elevated);
  transform: scale(0.96);
}

.mobile-menu-toggle svg {
  width: 20px;
  height: 20px;
}

.mobile-close-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 1.1rem;
  cursor: pointer;
  padding: 0;
  transition: all 0.15s ease;
}

.mobile-close-btn:active {
  background: var(--color-crimson-bg);
  color: var(--color-crimson);
}

/* Mobile Bottom Navigation Bar */
.mobile-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--border-subtle);
  z-index: 90;
  padding: 6px 10px calc(6px + env(safe-area-inset-bottom, 8px)) 10px;
  justify-content: space-around;
  align-items: center;
  box-shadow: 0 -1px 3px rgba(0, 0, 0, 0.05);
}

.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  background: none;
  border: none;
  color: #64748b;
  cursor: pointer;
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  transition: all 0.15s ease;
  font-size: 0.68rem;
  font-weight: 500;
  min-width: 52px;
}

.bottom-nav-item svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
}

.bottom-nav-item.active {
  color: #0f172a;
}

.bottom-nav-item.active svg {
  stroke: #0f172a;
}

.bottom-icon-wrap {
  position: relative;
  display: inline-flex;
}

.bottom-nav-badge {
  position: absolute;
  top: -4px;
  right: -8px;
  background: var(--color-amber);
  color: #000;
  font-size: 0.62rem;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 8px;
  line-height: 1;
}

/* Mobile Table Swipe Hint */
.mobile-table-hint {
  display: none;
  align-items: center;
  justify-content: center;
  padding: 7px 12px;
  font-size: 0.72rem;
  font-weight: 600;
  color: #475569;
  background: #f1f5f9;
  border-radius: var(--radius-sm);
  margin-bottom: 10px;
  letter-spacing: 0.03em;
}

/* Tablet & Mobile Breakpoint (<= 900px) */
@media (max-width: 900px) {
  /* Transform Sidebar to Off-Canvas Drawer */
  .app-sidebar {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    bottom: 0 !important;
    width: 280px !important;
    max-width: 82vw !important;
    z-index: 100 !important;
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 4px 0 24px rgba(15, 23, 42, 0.15);
    display: flex !important;
    flex-direction: column !important;
  }

  .app-sidebar.open {
    transform: translateX(0) !important;
  }

  /* Show labels and titles in drawer */
  .brand-title, .brand-version, .nav-label, .sidebar-nav span:not(.nav-badge) {
    display: inline !important;
  }

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

  /* Give full screen width to main workspace */
  .app-main {
    margin-left: 0 !important;
    width: 100% !important;
    min-width: 0 !important;
    overflow-x: hidden;
  }

  .mobile-menu-toggle {
    display: flex !important;
  }

  /* Top App Bar adjustments */
  .app-topbar {
    padding: 0 16px;
    height: 60px;
    padding-top: env(safe-area-inset-top, 0px);
  }

  .topbar-title {
    font-size: 1rem;
    max-width: 200px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}

/* Mobile Smartphone Breakpoint (<= 768px) */
@media (max-width: 768px) {
  /* Show Mobile Bottom Nav */
  .mobile-bottom-nav {
    display: flex;
  }

  .mobile-table-hint {
    display: flex;
  }

  /* Space for bottom navigation */
  .page-content {
    padding: 16px 12px calc(80px + env(safe-area-inset-bottom, 8px)) 12px !important;
  }

  /* Topbar Buttons Compact */
  .app-topbar {
    padding: 0 12px;
  }

  .topbar-left {
    gap: 10px;
    flex: 1;
    min-width: 0;
  }

  .topbar-title {
    font-size: 0.95rem;
    max-width: 160px;
  }

  .topbar-right {
    gap: 8px;
    flex-shrink: 0;
  }

  .btn-icon-mobile {
    padding: 8px 10px;
    font-size: 0.78rem;
  }

  @media (max-width: 500px) {
    .btn-icon-mobile .btn-label {
      display: none;
    }
    .btn-icon-mobile {
      width: 36px;
      height: 36px;
      padding: 0;
      border-radius: 50%;
    }
  }

  /* Full Width Header Rows */
  .pane-header-group, .panel-header {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 14px !important;
    padding: 16px 14px !important;
  }

  .pane-header-group > button, 
  .pane-header-group > .btn, 
  .panel-header > .btn,
  #btnSavePaymentSettings,
  #btnAddDomain {
    width: 100% !important;
    justify-content: center !important;
    padding: 12px 18px !important;
    font-size: 0.92rem !important;
  }

  .btn-group-mobile {
    width: 100%;
    display: flex;
    gap: 8px;
  }

  .btn-group-mobile .btn {
    flex: 1;
    justify-content: center;
    padding: 10px;
    font-size: 0.85rem;
  }

  /* Form Inputs (16px to prevent iOS auto-zoom) */
  .form-input, .search-input, .select-filter, 
  input[type="text"], input[type="email"], input[type="url"], input[type="password"], input[type="number"], select {
    font-size: 16px !important;
    box-sizing: border-box;
  }

  /* Metrics Grid (2 columns on mobile, 1 on narrow) */
  .metrics-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px !important;
    margin-bottom: 20px !important;
  }

  @media (max-width: 400px) {
    .metrics-grid {
      grid-template-columns: 1fr !important;
    }
  }

  .metric-card {
    padding: 14px 12px !important;
  }

  .metric-value {
    font-size: 1.35rem !important;
    margin: 8px 0 !important;
  }

  .metric-label {
    font-size: 0.72rem !important;
  }

  .metric-footer {
    font-size: 0.72rem !important;
  }

  /* Switchboard Grid (1 column on mobile) */
  .switchboard-grid {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
  }

  .switch-card {
    padding: 16px 14px !important;
  }

  .switch-card-header {
    margin-bottom: 16px !important;
    padding-bottom: 12px !important;
  }

  /* Orders Filter Bar */
  .order-status-tabs-wrapper {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 6px;
    width: 100%;
  }

  .order-status-tabs-wrapper::-webkit-scrollbar {
    display: none;
  }

  .order-status-tab {
    white-space: nowrap;
    flex-shrink: 0;
    padding: 8px 14px;
    font-size: 0.82rem;
  }

  .panel-controls {
    width: 100%;
    flex-direction: column;
    gap: 10px;
    align-items: stretch;
  }

  .panel-controls .search-input,
  .panel-controls .select-filter {
    width: 100% !important;
  }

  /* Enterprise Table Smooth Scrolling */
  .table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: var(--radius-sm);
  }

  .table-responsive::-webkit-scrollbar {
    height: 4px;
  }

  .table-responsive::-webkit-scrollbar-thumb {
    background: var(--border-focus);
    border-radius: 4px;
  }

  .enterprise-table th, 
  .enterprise-table td {
    padding: 10px 12px !important;
    font-size: 0.8rem !important;
    white-space: nowrap !important;
  }

  /* Neutral Gateway Domains Row */
  .neutral-domain-row {
    flex-wrap: wrap !important;
    padding: 12px 14px !important;
    gap: 10px !important;
  }

  .neutral-domain-row .neutral-domain-input {
    width: 100% !important;
    order: 2 !important;
  }

  .neutral-domain-actions {
    width: 100% !important;
    order: 3 !important;
    display: flex !important;
    gap: 6px !important;
  }

  .neutral-domain-actions .btn,
  .neutral-domain-actions a.btn {
    flex: 1 !important;
    justify-content: center !important;
    padding: 8px 4px !important;
    font-size: 0.78rem !important;
  }

  /* Bottom Sheet Modal Drawer on Mobile */
  .modal-overlay {
    align-items: flex-end !important;
  }

  .modal-drawer {
    width: 100% !important;
    max-width: 100% !important;
    max-height: 88vh !important;
    border-radius: 20px 20px 0 0 !important;
    border-left: none !important;
    border-top: 1px solid var(--border-subtle) !important;
    animation: slideUpModal 0.25s cubic-bezier(0.16, 1, 0.3, 1) !important;
  }

  @keyframes slideUpModal {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
  }

  .drawer-header {
    padding: 16px 20px !important;
  }

  .drawer-body {
    padding: 18px 16px !important;
  }

  .drawer-footer {
    padding: 14px 20px !important;
  }

  /* Event Item in Activity Feed */
  .event-item {
    padding: 12px 14px !important;
    gap: 12px !important;
  }

  .event-item .event-badge-icon {
    font-size: 1.15rem !important;
  }
}

/* =====================================================================
   Sidebar & Tab Badges for Orders Center (Edits 1, 2, 3)
   ===================================================================== */
.nav-badge-group {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 5px;
}

.nav-badge.nav-badge-orange {
  background: #ea580c !important;
  color: #ffffff !important;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 10px;
  font-size: 0.72rem;
  line-height: 1.1;
  box-shadow: 0 1px 2px rgba(234, 88, 12, 0.25);
}

.nav-badge.nav-badge-green {
  background: #059669 !important;
  color: #ffffff !important;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 10px;
  font-size: 0.72rem;
  line-height: 1.1;
  box-shadow: 0 1px 2px rgba(5, 150, 105, 0.25);
}

.bottom-nav-badge-orange {
  position: absolute;
  top: -4px;
  right: 6px;
  background: #ea580c !important;
  color: #ffffff !important;
  font-weight: 700;
  font-size: 0.65rem;
  padding: 1px 5px;
  border-radius: 8px;
  line-height: 1;
}

.bottom-nav-badge-green {
  position: absolute;
  top: -4px;
  right: -10px;
  background: #059669 !important;
  color: #ffffff !important;
  font-weight: 700;
  font-size: 0.65rem;
  padding: 1px 5px;
  border-radius: 8px;
  line-height: 1;
}

/* Orders Center Status Tabs Badges (Edit 3) */
.order-status-tabs-wrapper {
  background: #f1f5f9;
  padding: 4px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  display: inline-flex;
  gap: 4px;
}

.order-status-tab {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 14px !important;
  border-radius: var(--radius-sm) !important;
  background: transparent !important;
  color: var(--text-secondary) !important;
  border: 1px solid transparent !important;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
  box-shadow: none !important;
}

.order-status-tab:hover {
  color: var(--text-main) !important;
  background: rgba(255, 255, 255, 0.6) !important;
}

.order-status-tab.active {
  background: #ffffff !important;
  color: var(--text-main) !important;
  border-color: #cbd5e1 !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06) !important;
}

.tab-order-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 19px;
  height: 19px;
  padding: 0 6px;
  border-radius: 10px;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1;
}

.badge-pending-cnt {
  background: #fef3c7;
  color: #b45309;
  border: 1px solid #fde68a;
}

.badge-paid-cnt {
  background: #dcfce7;
  color: #15803d;
  border: 1px solid #bbf7d0;
}

.badge-delivered-cnt {
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
}

.badge-recovery-cnt {
  background: #ffedd5;
  color: #c2410c;
  border: 1px solid #fed7aa;
}

.badge-cancelled-cnt {
  background: #fee2e2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}

.badge-refunded-cnt {
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #cbd5e1;
}

/* Active tab highlighted badges */
.order-status-tab.active .badge-pending-cnt {
  background: #d97706;
  color: #ffffff;
  border-color: #d97706;
}

.order-status-tab.active .badge-paid-cnt {
  background: #059669;
  color: #ffffff;
  border-color: #059669;
}

.order-status-tab.active .badge-delivered-cnt {
  background: #2563eb;
  color: #ffffff;
  border-color: #2563eb;
}

.order-status-tab.active .badge-recovery-cnt {
  background: #ea580c;
  color: #ffffff;
  border-color: #ea580c;
}

.order-status-tab.active .badge-cancelled-cnt {
  background: #dc2626;
  color: #ffffff;
  border-color: #dc2626;
}

.order-status-tab.active .badge-refunded-cnt {
  background: #64748b;
  color: #ffffff;
  border-color: #64748b;
}

