/**
 * ZexiPay - Commercial Fintech Design System & Master UI Stylesheet
 * Version: 5.0.0 (Complete Frontend Architecture & Redesign)
 * High-performance, fully responsive (320px - 1920px), WCAG 2.1 AA compliant.
 */

/* ==========================================================================
   1. Design Tokens & CSS Variables
   ========================================================================== */
:root {
  /* Brand Primary & Accents */
  --zx-primary: #2563eb;
  --zx-primary-hover: #1d4ed8;
  --zx-primary-active: #1e40af;
  --zx-primary-light: #eff6ff;
  --zx-primary-glow: rgba(37, 99, 235, 0.22);
  --zx-accent-cyan: #06b6d4;
  --zx-accent-cyan-glow: rgba(6, 182, 212, 0.2);
  --zx-accent-blue: #3b82f6;

  /* Surfaces & Backgrounds */
  --zx-bg-page: #f8fafc;
  --zx-bg-surface: #ffffff;
  --zx-bg-muted: #f1f5f9;
  --zx-bg-elevated: #ffffff;
  --zx-border: #e2e8f0;
  --zx-border-light: #f1f5f9;
  --zx-border-focus: #93c5fd;
  --zx-border-hover: #cbd5e1;

  /* Typography Colors */
  --zx-text-main: #0f172a;
  --zx-text-secondary: #334155;
  --zx-text-muted: #64748b;
  --zx-text-light: #94a3b8;

  /* Deep Space Fintech Surfaces (Sidebars, Dark Cards, Command Hubs) */
  --zx-navy-950: #070d18;
  --zx-navy-900: #0a1120;
  --zx-navy-850: #0e172a;
  --zx-navy-800: #131f38;
  --zx-navy-750: #182642;
  --zx-navy-700: #1e293b;
  --zx-navy-border: rgba(255, 255, 255, 0.08);
  --zx-navy-border-hover: rgba(255, 255, 255, 0.16);
  --zx-navy-text: #f1f5f9;
  --zx-navy-muted: #94a3b8;

  /* Semantic State Colors */
  --zx-success: #10b981;
  --zx-success-hover: #059669;
  --zx-success-bg: #ecfdf5;
  --zx-success-border: #a7f3d0;
  --zx-success-text: #065f46;
  --zx-success-glow: rgba(16, 185, 129, 0.2);

  --zx-warning: #f59e0b;
  --zx-warning-hover: #d97706;
  --zx-warning-bg: #fffbeb;
  --zx-warning-border: #fde68a;
  --zx-warning-text: #92400e;

  --zx-danger: #ef4444;
  --zx-danger-hover: #dc2626;
  --zx-danger-bg: #fef2f2;
  --zx-danger-border: #fecaca;
  --zx-danger-text: #991b1b;

  --zx-info: #3b82f6;
  --zx-info-bg: #eff6ff;
  --zx-info-border: #bfdbfe;
  --zx-info-text: #1e40af;

  /* 4-in-1 Gateway Brand Colors */
  --zx-brand-phonepe: #5f259f;
  --zx-brand-bharatpe: #00a272;
  --zx-brand-fampay: #ff9900;
  --zx-brand-paytm: #00b9f1;

  /* Dimensions & Spacing */
  --zx-sidebar-width: 270px;
  --zx-topbar-height: 68px;
  --zx-radius-xs: 6px;
  --zx-radius-sm: 8px;
  --zx-radius-md: 12px;
  --zx-radius-lg: 16px;
  --zx-radius-xl: 20px;
  --zx-radius-2xl: 24px;
  --zx-radius-pill: 9999px;

  /* Elevated Shadows */
  --zx-shadow-xs: 0 1px 2px 0 rgba(15, 23, 42, 0.05);
  --zx-shadow-sm: 0 1px 3px 0 rgba(15, 23, 42, 0.06), 0 1px 2px -1px rgba(15, 23, 42, 0.04);
  --zx-shadow-md: 0 4px 12px -2px rgba(15, 23, 42, 0.08), 0 2px 6px -1px rgba(15, 23, 42, 0.04);
  --zx-shadow-lg: 0 12px 28px -6px rgba(15, 23, 42, 0.12), 0 4px 10px -2px rgba(15, 23, 42, 0.05);
  --zx-shadow-card: 0 1px 3px rgba(15, 23, 42, 0.04), 0 8px 24px -4px rgba(15, 23, 42, 0.05);
  --zx-shadow-modal: 0 24px 60px -12px rgba(15, 23, 42, 0.28), 0 0 1px rgba(15, 23, 42, 0.12);

  /* Transitions */
  --zx-transition-fast: all 0.15s cubic-bezier(0.16, 1, 0.3, 1);
  --zx-transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  --zx-transition-slow: all 0.32s cubic-bezier(0.16, 1, 0.3, 1);

  /* Typography */
  --zx-font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --zx-font-mono: 'Fira Code', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;

  /* ========================================================================
     Backwards-Compatible Aliases (For Legacy Templates & Panels)
     ======================================================================== */
  --primary: var(--zx-primary);
  --primary-dark: var(--zx-primary-hover);
  --primary-light: var(--zx-primary-light);
  --primary-glow: var(--zx-primary-glow);
  --dark: var(--zx-navy-950);
  --dark-soft: var(--zx-navy-850);
  --dark-lighter: var(--zx-navy-800);
  --dark-surface: var(--zx-navy-900);
  --dark-green: var(--zx-navy-950);
  --dark-green-light: var(--zx-navy-850);
  --dark-green-darker: var(--zx-navy-950);

  --bg-light: var(--zx-bg-page);
  --bg-white: #ffffff;
  --bg-subtle: var(--zx-bg-muted);
  --bg-card: var(--zx-bg-surface);
  --text-primary: var(--zx-text-main);
  --text-secondary: var(--zx-text-secondary);
  --text-muted: var(--zx-text-muted);
  --border-color: var(--zx-border);

  --success: var(--zx-success);
  --warning: var(--zx-warning);
  --danger: var(--zx-danger);
  --info: var(--zx-info);

  /* Dashboard.css Aliases */
  --pi-primary: var(--zx-primary);
  --pi-primary-hover: var(--zx-primary-hover);
  --pi-primary-light: var(--zx-primary-light);
  --pi-primary-glow: var(--zx-primary-glow);
  --pi-dark: var(--zx-navy-950);
  --pi-dark-hover: var(--zx-navy-850);
  --pi-dark-light: var(--zx-navy-800);
  --pi-dark-lighter: var(--zx-navy-750);
  --pi-bg: var(--zx-bg-page);
  --pi-white: #ffffff;
  --pi-card: var(--zx-bg-surface);
  --pi-border: var(--zx-border);
  --pi-border-light: var(--zx-border-light);
  --pi-text: var(--zx-text-main);
  --pi-text-secondary: var(--zx-text-secondary);
  --pi-text-muted: var(--zx-text-muted);
  --pi-success: var(--zx-success);
  --pi-success-bg: var(--zx-success-bg);
  --pi-warning: var(--zx-warning);
  --pi-warning-bg: var(--zx-warning-bg);
  --pi-danger: var(--zx-danger);
  --pi-danger-bg: var(--zx-danger-bg);
  --pi-info: var(--zx-info);
  --pi-info-bg: var(--zx-info-bg);
  --pi-sidebar-width: var(--zx-sidebar-width);
  --pi-topbar-height: var(--zx-topbar-height);
  --pi-radius: var(--zx-radius-md);
  --pi-radius-sm: var(--zx-radius-sm);
  --pi-radius-lg: var(--zx-radius-lg);
  --pi-shadow: var(--zx-shadow-card);
  --pi-shadow-md: var(--zx-shadow-md);
  --pi-shadow-lg: var(--zx-shadow-lg);
  --pi-transition: var(--zx-transition);
}

/* ==========================================================================
   2. Reset & Typography Foundations
   ========================================================================== */
*, *::before, *::after {
  box-sizing: border-box;
}

html {
  font-family: var(--zx-font-sans);
  background-color: var(--zx-bg-page);
  color: var(--zx-text-main);
  scroll-behavior: smooth;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body.dashboard-body,
body.admin-body {
  background-color: var(--zx-bg-page);
  color: var(--zx-text-main);
  margin: 0;
  padding: 0;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Tabular numbers for fintech stats */
.font-monospace,
.stat-value,
.stat-metric,
.amount-value,
td.amount-col,
.code-inline,
.tabular-nums {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
}

/* Custom Smooth Scrollbar */
::-webkit-scrollbar {
  width: 7px;
  height: 7px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* Global Focus Ring (Accessibility WCAG 2.1 AA) */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--zx-primary);
  outline-offset: 2px;
}

/* ==========================================================================
   3. Main Application Shell: Sidebar, Topbar, Content
   ========================================================================== */
.dashboard-wrapper,
.admin-wrapper {
  display: flex;
  min-height: 100vh;
  position: relative;
  background-color: var(--zx-bg-page);
}

/* Sidebar Container */
.dashboard-sidebar,
.admin-sidebar {
  width: var(--zx-sidebar-width);
  min-width: var(--zx-sidebar-width);
  height: 100vh;
  position: fixed;
  top: 0;
  left: 0;
  background: linear-gradient(180deg, var(--zx-navy-950) 0%, var(--zx-navy-900) 100%);
  border-right: 1px solid var(--zx-navy-border);
  display: flex;
  flex-direction: column;
  z-index: 1040;
  transition: transform .22s cubic-bezier(.16,1,.3,1);
  overflow: hidden;
  box-shadow: 4px 0 24px rgba(0, 0, 0, 0.12);
}

/* Main Area offset by fixed sidebar */
.dashboard-main,
.admin-main {
  flex: 1;
  margin-left: var(--zx-sidebar-width);
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background-color: var(--zx-bg-page);
}

.dashboard-content,
.admin-content {
  flex: 1;
  padding: 28px 32px 48px;
  max-width: 1600px;
  width: 100%;
  margin: 0 auto;
}

/* Mobile Overlay */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(7, 13, 24, 0.65);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 1030;
  opacity: 0;
  transition: opacity .18s ease;
}
.sidebar-overlay.show,
.sidebar-overlay.active {
  display: block;
  opacity: 1;
}

/* ==========================================================================
   4. Sidebar Interior Elements
   ========================================================================== */
.sidebar-logo,
.sidebar-brand {
  height: var(--zx-topbar-height);
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--zx-navy-border);
  background: rgba(7, 13, 24, 0.6);
  backdrop-filter: blur(8px);
}

.sidebar-logo .logo-link,
.sidebar-brand .logo-link {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.sidebar-logo .logo-icon,
.sidebar-brand .brand-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  filter: drop-shadow(0 2px 8px var(--zx-primary-glow));
}

.logo-text-group,
.brand-info {
  display: flex;
  flex-direction: column;
}

.logo-title,
.brand-info h5 {
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: #ffffff;
  margin: 0;
  line-height: 1.15;
}

.logo-badge,
.admin-badge-pill {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #93c5fd;
  margin-top: 2px;
  background: rgba(37, 99, 235, 0.15);
  padding: 2px 7px;
  border-radius: var(--zx-radius-pill);
  display: inline-block;
  border: 1px solid rgba(147, 197, 253, 0.2);
}

.sidebar-close-btn {
  background: transparent;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  padding: 8px;
  border-radius: var(--zx-radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--zx-transition-fast);
}
.sidebar-close-btn:hover {
  color: #ffffff;
  background: var(--zx-navy-800);
}

/* Sidebar Nav Body */
.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 18px 14px;
}

.nav-section-label,
.sidebar-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: #64748b;
  padding: 14px 14px 6px;
  margin-top: 6px;
}
.nav-section-label:first-child,
.sidebar-label:first-child {
  margin-top: 0;
  padding-top: 2px;
}

.sidebar-menu {
  list-style: none;
  padding: 0;
  margin: 0 0 8px 0;
}

.sidebar-menu-item,
.nav-item {
  margin-bottom: 3px;
}

.sidebar-menu-link,
.nav-item .nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--zx-radius-md);
  color: #94a3b8;
  font-size: 13.5px;
  font-weight: 500;
  text-decoration: none;
  transition: var(--zx-transition-fast);
  position: relative;
}

.sidebar-menu-link:hover,
.nav-item .nav-link:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.06);
  transform: translateX(2px);
}

.sidebar-menu-item.active .sidebar-menu-link,
.nav-item .nav-link.active {
  color: #ffffff;
  background: linear-gradient(90deg, rgba(37, 99, 235, 0.22) 0%, rgba(37, 99, 235, 0.08) 100%);
  font-weight: 600;
  border-left: 3px solid #3b82f6;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.menu-icon,
.nav-item .nav-link i,
.sidebar-menu-link i {
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #64748b;
  transition: var(--zx-transition-fast);
}

.sidebar-menu-link:hover .menu-icon,
.sidebar-menu-item.active .menu-icon,
.nav-item .nav-link:hover i,
.nav-item .nav-link.active i,
.sidebar-menu-link:hover i,
.sidebar-menu-item.active i {
  color: #60a5fa;
}

.menu-label {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-badge,
.menu-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: var(--zx-radius-pill);
  background: var(--zx-primary);
  color: #ffffff;
  margin-left: auto;
}

/* Sidebar User Footer */
.sidebar-footer {
  padding: 14px 16px;
  border-top: 1px solid var(--zx-navy-border);
  background: rgba(7, 13, 24, 0.4);
}

.sidebar-user,
.admin-badge {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
  border-radius: var(--zx-radius-md);
  text-decoration: none;
  transition: var(--zx-transition-fast);
}
.sidebar-user:hover,
.admin-badge:hover {
  background: rgba(255, 255, 255, 0.05);
}

.user-avatar-sidebar,
.admin-avatar {
  width: 38px;
  height: 38px;
  border-radius: var(--zx-radius-md);
  background: linear-gradient(135deg, var(--zx-primary) 0%, #1d4ed8 100%);
  color: #ffffff;
  font-weight: 700;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.25);
}

.user-info-sidebar,
.admin-badge-details {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.user-name-sidebar,
.admin-name {
  font-size: 13.5px;
  font-weight: 600;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.25;
}

.user-plan-badge,
.admin-role {
  font-size: 11px;
  color: #94a3b8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}

.btn-icon-sidebar,
.admin-logout-btn {
  background: transparent;
  border: none;
  color: #64748b;
  cursor: pointer;
  padding: 8px;
  border-radius: var(--zx-radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--zx-transition-fast);
}
.btn-icon-sidebar:hover,
.admin-logout-btn:hover {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.1);
}

/* ==========================================================================
   5. Topbar Navigation
   ========================================================================== */
.dashboard-topbar,
.admin-topbar {
  height: var(--zx-topbar-height);
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--zx-border);
  position: sticky;
  top: 0;
  z-index: 1020;
}

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

.sidebar-toggle {
  background: transparent;
  border: 1px solid var(--zx-border);
  color: var(--zx-text-main);
  cursor: pointer;
  width: 40px;
  height: 40px;
  border-radius: var(--zx-radius-md);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: var(--zx-transition-fast);
}
.sidebar-toggle:hover {
  background: var(--zx-bg-muted);
  border-color: #cbd5e1;
}

.topbar-title .page-title,
.admin-topbar .page-title {
  font-size: 18px;
  font-weight: 800;
  color: var(--zx-text-main);
  margin: 0;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.topbar-title .page-subtitle,
.admin-topbar .page-subtitle {
  font-size: 12px;
  color: var(--zx-text-muted);
  margin: 2px 0 0;
}

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

/* Global Search */
.topbar-search {
  position: relative;
}
.search-input-group {
  position: relative;
  display: flex;
  align-items: center;
}
.search-input-group .search-icon {
  position: absolute;
  left: 12px;
  width: 16px;
  height: 16px;
  color: var(--zx-text-muted);
  pointer-events: none;
}
.search-input-group .search-input {
  background: var(--zx-bg-muted);
  border: 1px solid transparent;
  border-radius: var(--zx-radius-pill);
  padding: 8px 40px 8px 36px;
  font-size: 13px;
  width: 240px;
  color: var(--zx-text-main);
  transition: var(--zx-transition);
}
.search-input-group .search-input:focus {
  background: #ffffff;
  border-color: var(--zx-primary);
  box-shadow: 0 0 0 3px var(--zx-primary-glow);
  width: 300px;
  outline: none;
}
.search-shortcut {
  position: absolute;
  right: 12px;
  background: #ffffff;
  border: 1px solid var(--zx-border);
  color: var(--zx-text-muted);
  font-size: 10px;
  padding: 2px 5px;
  border-radius: 4px;
  font-family: var(--zx-font-mono);
  box-shadow: var(--zx-shadow-xs);
  pointer-events: none;
}

/* Environment Badge (Live / Test) */
.env-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--zx-radius-pill);
  background: rgba(16, 185, 129, 0.12);
  color: var(--zx-success-text);
  font-size: 12px;
  font-weight: 700;
  border: 1px solid rgba(16, 185, 129, 0.25);
}
.env-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--zx-success);
  display: inline-block;
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.25);
  animation: zxPulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes zxPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.85); }
}

.btn-icon-topbar {
  background: transparent;
  border: 1px solid var(--zx-border);
  color: var(--zx-text-secondary);
  cursor: pointer;
  width: 40px;
  height: 40px;
  border-radius: var(--zx-radius-md);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: var(--zx-transition-fast);
}
.btn-icon-topbar:hover {
  background: var(--zx-bg-muted);
  color: var(--zx-text-main);
  border-color: #cbd5e1;
}

.topbar-avatar {
  width: 40px;
  height: 40px;
  border-radius: var(--zx-radius-md);
  background: linear-gradient(135deg, var(--zx-primary) 0%, #1d4ed8 100%);
  color: #ffffff;
  font-weight: 700;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: 2px solid #ffffff;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.25);
}

/* ==========================================================================
   6. Stat Cards / KPI Metric Cards (Commercial SaaS Grid)
   ========================================================================== */
.stat-card,
.stats-card {
  background: var(--zx-bg-surface);
  border: 1px solid var(--zx-border);
  border-radius: var(--zx-radius-lg);
  padding: 22px;
  box-shadow: var(--zx-shadow-card);
  transition: var(--zx-transition);
  position: relative;
  overflow: hidden;
}
.stat-card:hover,
.stats-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--zx-shadow-md);
  border-color: var(--zx-border-hover);
}

.stat-label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--zx-text-muted);
  display: block;
}

.stat-icon {
  width: 42px;
  height: 42px;
  border-radius: var(--zx-radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: var(--zx-transition-fast);
}
.stat-icon.primary {
  background: rgba(37, 99, 235, 0.1);
  color: var(--zx-primary);
}
.stat-icon.success {
  background: rgba(16, 185, 129, 0.1);
  color: var(--zx-success);
}
.stat-icon.warning {
  background: rgba(245, 158, 11, 0.1);
  color: var(--zx-warning);
}
.stat-icon.info {
  background: rgba(6, 182, 212, 0.1);
  color: var(--zx-accent-cyan);
}
.stat-card:hover .stat-icon {
  transform: scale(1.08);
}

.stat-value,
.stat-metric {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.025em;
  color: var(--zx-text-main);
  line-height: 1.2;
  margin: 8px 0 6px;
  font-variant-numeric: tabular-nums;
}

.stat-trend {
  font-size: 12.5px;
  color: var(--zx-text-muted);
  display: flex;
  align-items: center;
  gap: 5px;
}
.stat-trend.up {
  color: var(--zx-success);
  font-weight: 600;
}
.stat-trend.down {
  color: var(--zx-danger);
  font-weight: 600;
}
.stat-trend i,
.stat-trend svg {
  width: 14px;
  height: 14px;
}

/* ==========================================================================
   7. Card System & Containers
   ========================================================================== */
.card-custom,
.chart-card,
.table-card {
  background: var(--zx-bg-surface);
  border: 1px solid var(--zx-border);
  border-radius: var(--zx-radius-lg);
  padding: 24px;
  box-shadow: var(--zx-shadow-card);
  transition: var(--zx-transition);
  position: relative;
}
.card-custom:hover {
  border-color: var(--zx-border-hover);
}

/* ==========================================================================
   8. Buttons System
   ========================================================================== */
.btn-primary-custom {
  background: linear-gradient(135deg, var(--zx-primary) 0%, #1d4ed8 100%);
  color: #ffffff !important;
  font-weight: 650;
  font-size: 13.5px;
  padding: 9px 18px;
  border-radius: var(--zx-radius-md);
  border: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 12px var(--zx-primary-glow);
  transition: var(--zx-transition-fast);
  cursor: pointer;
  text-decoration: none;
}
.btn-primary-custom:hover {
  background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px var(--zx-primary-glow);
  color: #ffffff !important;
}
.btn-primary-custom:active {
  transform: translateY(1px);
  box-shadow: 0 2px 6px var(--zx-primary-glow);
}

.btn-outline-custom {
  background: #ffffff;
  color: var(--zx-text-secondary) !important;
  font-weight: 600;
  font-size: 13.5px;
  padding: 9px 16px;
  border-radius: var(--zx-radius-md);
  border: 1px solid var(--zx-border);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  transition: var(--zx-transition-fast);
  cursor: pointer;
  text-decoration: none;
}
.btn-outline-custom:hover {
  background: var(--zx-bg-muted);
  border-color: var(--zx-border-hover);
  color: var(--zx-text-main) !important;
}

.btn-dark-custom {
  background: var(--zx-navy-950);
  color: #ffffff !important;
  font-weight: 600;
  font-size: 13.5px;
  padding: 9px 16px;
  border-radius: var(--zx-radius-md);
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  transition: var(--zx-transition-fast);
  cursor: pointer;
  text-decoration: none;
}
.btn-dark-custom:hover {
  background: var(--zx-navy-850);
  transform: translateY(-1px);
}

.btn-ghost {
  background: transparent;
  color: var(--zx-text-muted);
  font-weight: 600;
  font-size: 13px;
  padding: 8px 14px;
  border-radius: var(--zx-radius-sm);
  border: none;
  cursor: pointer;
  transition: var(--zx-transition-fast);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.btn-ghost:hover {
  color: var(--zx-text-main);
  background: var(--zx-bg-muted);
}

/* ==========================================================================
   9. Tables System & Mobile Card Adaptation
   ========================================================================== */
.table-responsive {
  border-radius: var(--zx-radius-md);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.table-custom,
.table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin: 0;
  font-size: 13.5px;
}

.table-custom th,
.table th {
  background: #f8fafc;
  color: #475569;
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 13px 16px;
  border-bottom: 1px solid var(--zx-border);
  white-space: nowrap;
}

.table-custom td,
.table td {
  padding: 14px 16px;
  border-bottom: 1px solid #f1f5f9;
  color: var(--zx-text-main);
  vertical-align: middle;
  transition: background-color var(--zx-transition-fast);
}

.table-custom tbody tr:hover,
.table tbody tr:hover {
  background-color: #f8fafc;
}

/* Badges & Status Pills */
.badge-status,
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: var(--zx-radius-pill);
  font-size: 12px;
  font-weight: 650;
  line-height: 1.2;
}

.badge-status::before,
.status-pill::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  display: inline-block;
}

.badge-success, .status-pill.success {
  background: var(--zx-success-bg);
  color: var(--zx-success-text);
  border: 1px solid var(--zx-success-border);
}
.badge-success::before, .status-pill.success::before {
  background: var(--zx-success);
}

.badge-warning, .status-pill.warning {
  background: var(--zx-warning-bg);
  color: var(--zx-warning-text);
  border: 1px solid var(--zx-warning-border);
}
.badge-warning::before, .status-pill.warning::before {
  background: var(--zx-warning);
}

.badge-danger, .status-pill.danger {
  background: var(--zx-danger-bg);
  color: var(--zx-danger-text);
  border: 1px solid var(--zx-danger-border);
}
.badge-danger::before, .status-pill.danger::before {
  background: var(--zx-danger);
}

.badge-neutral, .status-pill.neutral {
  background: var(--zx-bg-muted);
  color: var(--zx-text-muted);
  border: 1px solid var(--zx-border);
}
.badge-neutral::before, .status-pill.neutral::before {
  background: var(--zx-text-muted);
}

/* ==========================================================================
   10. Form Controls & Floating Inputs
   ========================================================================== */
.form-group {
  margin-bottom: 18px;
}
.form-label-custom,
.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--zx-text-main);
  margin-bottom: 7px;
}
.form-control-custom,
.form-control {
  width: 100%;
  padding: 10px 14px;
  font-size: 14px;
  color: var(--zx-text-main);
  background: #ffffff;
  border: 1px solid var(--zx-border);
  border-radius: var(--zx-radius-md);
  transition: var(--zx-transition-fast);
}
.form-control-custom:focus,
.form-control:focus {
  border-color: var(--zx-primary);
  box-shadow: 0 0 0 3px var(--zx-primary-glow);
  outline: none;
}
.input-icon-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}
.input-icon-wrapper .input-icon {
  position: absolute;
  pointer-events: none;
}

/* ==========================================================================
   11. Modals & Popups
   ========================================================================== */
.modal-backdrop {
  background-color: rgba(7, 13, 24, 0.7);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.modal-content {
  border-radius: var(--zx-radius-xl);
  border: 1px solid var(--zx-border);
  box-shadow: var(--zx-shadow-modal);
  overflow: hidden;
  animation: zxModalZoom 0.24s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes zxModalZoom {
  from { opacity: 0; transform: scale(0.96) translateY(8px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}
.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--zx-border);
  background: #ffffff;
}
.modal-body {
  padding: 24px;
}
.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--zx-border);
  background: #f8fafc;
}

/* ==========================================================================
   12. Empty States & Skeletons
   ========================================================================== */
.empty-state {
  text-align: center;
  padding: 48px 20px;
}
.empty-icon {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--zx-bg-muted);
  color: var(--zx-text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  box-shadow: var(--zx-shadow-xs);
}
.empty-icon i,
.empty-icon svg {
  width: 26px;
  height: 26px;
}
.empty-state h4 {
  font-size: 18px;
  font-weight: 700;
  color: var(--zx-text-main);
  margin-bottom: 8px;
}
.empty-state p {
  font-size: 14px;
  color: var(--zx-text-muted);
  max-width: 440px;
  margin: 0 auto 20px;
  line-height: 1.5;
}

/* Skeleton Loading Shimmer */
.skeleton {
  background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
  background-size: 200% 100%;
  animation: zxShimmer 1.5s infinite;
  border-radius: 6px;
}
@keyframes zxShimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

/* ==========================================================================
   13. Subscription Plan Cards
   ========================================================================== */
.plan-card {
  background: var(--zx-bg-surface);
  border: 1px solid var(--zx-border);
  border-radius: var(--zx-radius-xl);
  padding: 32px 24px;
  box-shadow: var(--zx-shadow-card);
  transition: var(--zx-transition);
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
}
.plan-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--zx-shadow-lg);
  border-color: #cbd5e1;
}
.plan-card.popular {
  border: 2px solid var(--zx-primary);
  box-shadow: 0 10px 30px var(--zx-primary-glow);
}
.plan-badge-popular {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--zx-primary);
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 3px 14px;
  border-radius: var(--zx-radius-pill);
  box-shadow: 0 4px 10px var(--zx-primary-glow);
}
.plan-name {
  font-size: 18px;
  font-weight: 800;
  color: var(--zx-text-main);
  margin-bottom: 8px;
}
.plan-price {
  font-size: 34px;
  font-weight: 900;
  color: var(--zx-text-main);
  letter-spacing: -0.03em;
  margin-bottom: 20px;
}
.plan-price span {
  font-size: 14px;
  font-weight: 500;
  color: var(--zx-text-muted);
}
.plan-features {
  list-style: none;
  padding: 0;
  margin: 0 0 24px 0;
  flex: 1;
}
.plan-features li {
  font-size: 13.5px;
  color: var(--zx-text-secondary);
  margin-bottom: 11px;
  display: flex;
  align-items: center;
  gap: 9px;
}
.plan-features li i,
.plan-features li svg {
  color: var(--zx-success);
  flex-shrink: 0;
}
.current-plan-banner {
  background: var(--zx-success-bg);
  color: var(--zx-success);
  font-weight: 700;
  font-size: 13px;
  padding: 10px;
  border-radius: var(--zx-radius-md);
  text-align: center;
  border: 1px solid var(--zx-success-border);
}

/* ==========================================================================
   14. Complete Responsive Design Matrix (320px - 1920px)
   ========================================================================== */

/* Extra Small Phones: 320px - 375px */
@media (max-width: 375px) {
  .dashboard-content,
  .admin-content {
    padding: 14px 12px 32px !important;
  }
  .stat-card,
  .stats-card {
    padding: 16px 14px !important;
  }
  .stat-value,
  .stat-metric {
    font-size: 22px !important;
  }
  .card-custom {
    padding: 16px 14px !important;
  }
  .btn-group {
    display: flex !important;
    width: 100% !important;
  }
  .btn-group .btn {
    flex: 1 !important;
    padding: 6px 4px !important;
    font-size: 11px !important;
  }
  .table-custom th,
  .table-custom td {
    padding: 10px 8px !important;
    font-size: 12px !important;
  }
}

/* Standard Mobile: 376px - 576px */
@media (max-width: 576px) {
  .dashboard-topbar,
  .admin-topbar {
    padding: 0 14px !important;
    height: 60px !important;
  }
  .topbar-title .page-title,
  .admin-topbar .page-title {
    font-size: 16px !important;
  }
  .topbar-search {
    display: none !important;
  }
  .env-text {
    display: none !important;
  }
  .env-badge {
    padding: 6px !important;
  }
  .stat-value,
  .stat-metric {
    font-size: 24px;
  }
}

/* Tablets & Mobile Navigation: <= 991.98px */
@media (max-width: 991.98px) {
  .dashboard-sidebar,
  .admin-sidebar {
    transform: translateX(-100%);
    box-shadow: none;
  }
  .dashboard-sidebar.show,
  .admin-sidebar.show,
  .dashboard-sidebar.active,
  .admin-sidebar.active {
    transform: translateX(0);
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.5);
  }

  .dashboard-main,
  .admin-main {
    margin-left: 0 !important;
  }

  .dashboard-topbar,
  .admin-topbar {
    padding: 0 18px;
  }

  .dashboard-content,
  .admin-content {
    padding: 20px 18px 48px;
  }
}

/* Desktop: >= 992px */
@media (min-width: 992px) {
  .sidebar-toggle {
    display: none !important;
  }
  .sidebar-close-btn {
    display: none !important;
  }
  .sidebar-overlay {
    display: none !important;
  }
}

/* Ultra-Wide: >= 1441px */
@media (min-width: 1441px) {
  .dashboard-content,
  .admin-content {
    padding: 32px 48px 64px;
    max-width: 1680px;
  }
}

/* Accessibility: Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
