/* ============================================
   PREMIUM WHATSAPP GATEWAY THEME
   Exclusive Modern Design - 2026
   ============================================ */

/* ---- Google Fonts ---- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=Cairo:wght@300;400;500;600;700;800;900&display=swap');

/* ---- CSS Variables ---- */
:root {
  --primary: #6C5CE7;
  --primary-light: #A29BFE;
  --primary-dark: #4834D4;
  --secondary: #00CEC9;
  --accent: #25D366;
  --accent-dark: #128C7E;
  --success: #00B894;
  --warning: #FDCB6E;
  --danger: #FF7675;
  --info: #74B9FF;

  --bg-dark: #0A0E27;
  --bg-darker: #060918;
  --bg-card: #111540;
  --bg-card-hover: #161B4D;
  --bg-sidebar: linear-gradient(180deg, #0D1137 0%, #0A0E27 50%, #060918 100%);
  --bg-header: rgba(10, 14, 39, 0.85);
  --bg-glass: rgba(17, 21, 64, 0.6);
  --bg-glass-light: rgba(108, 92, 231, 0.08);

  --text-primary: #FFFFFF;
  --text-secondary: #8B8FAE;
  --text-muted: #5A5E7A;
  --text-accent: #A29BFE;

  --border-color: rgba(108, 92, 231, 0.15);
  --border-light: rgba(255, 255, 255, 0.06);

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.15);
  --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.25);
  --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.35);
  --shadow-glow: 0 0 30px rgba(108, 92, 231, 0.15);
  --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.2), 0 0 0 1px rgba(108, 92, 231, 0.08);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 50px;

  --sidebar-width: 280px;
  --sidebar-collapsed: 80px;
  --header-height: 72px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ---- Reset & Base ---- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', 'Cairo', sans-serif;
  background: var(--bg-dark);
  color: var(--text-primary);
  overflow-x: hidden;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Animated background pattern */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background:
    radial-gradient(ellipse at 20% 50%, rgba(108, 92, 231, 0.08) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 20%, rgba(0, 206, 201, 0.05) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 80%, rgba(37, 211, 102, 0.04) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
}

::selection {
  background: var(--primary);
  color: white;
}

::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: var(--bg-darker);
}
::-webkit-scrollbar-thumb {
  background: var(--primary-dark);
  border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--primary);
}

a {
  text-decoration: none !important;
  transition: var(--transition);
}

/* ============================================
   WRAPPER
   ============================================ */
.premium-wrapper {
  display: flex;
  min-height: 100vh;
  position: relative;
  /* z-index removed to avoid creating a stacking context that traps Bootstrap modals */
}

/* ============================================
   SIDEBAR
   ============================================ */
.premium-sidebar {
  width: var(--sidebar-width);
  height: 100vh;
  position: fixed;
  left: 0;
  top: 0;
  z-index: 1040;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-color);
  transition: var(--transition);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.premium-sidebar::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 1px;
  height: 100%;
  background: linear-gradient(180deg, var(--primary) 0%, transparent 50%, var(--secondary) 100%);
  opacity: 0.3;
}

/* Sidebar Brand */
.sidebar-brand {
  height: var(--header-height);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 14px;
  border-bottom: 1px solid var(--border-light);
  flex-shrink: 0;
}

.sidebar-brand .brand-icon {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: white;
  flex-shrink: 0;
  box-shadow: 0 4px 15px rgba(37, 211, 102, 0.3);
}

.sidebar-brand .brand-text {
  font-size: 18px;
  font-weight: 800;
  background: linear-gradient(135deg, #fff 0%, var(--primary-light) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.5px;
}

.sidebar-brand .brand-text span {
  font-weight: 400;
  opacity: 0.7;
}

/* Sidebar Navigation */
.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 16px 12px;
}

.sidebar-nav::-webkit-scrollbar {
  width: 3px;
}

.nav-section-title {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-muted);
  padding: 20px 16px 8px;
  margin-top: 8px;
}

.nav-item-premium {
  margin-bottom: 2px;
}

.nav-link-premium {
  display: flex;
  align-items: center;
  padding: 11px 16px;
  border-radius: var(--radius-md);
  color: var(--text-secondary) !important;
  font-size: 13.5px;
  font-weight: 500;
  gap: 12px;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.nav-link-premium i {
  font-size: 18px;
  width: 22px;
  text-align: center;
  transition: var(--transition);
}

.nav-link-premium:hover {
  color: var(--text-primary) !important;
  background: var(--bg-glass-light);
}

.nav-link-premium:hover i {
  color: var(--primary-light);
  transform: scale(1.1);
}

.nav-link-premium.active {
  color: var(--text-primary) !important;
  background: linear-gradient(135deg, rgba(108, 92, 231, 0.2) 0%, rgba(108, 92, 231, 0.05) 100%);
  font-weight: 600;
}

.nav-link-premium.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 60%;
  background: linear-gradient(180deg, var(--primary) 0%, var(--primary-light) 100%);
  border-radius: 0 4px 4px 0;
}

.nav-link-premium.active i {
  color: var(--primary-light);
}

/* Submenu */
.nav-submenu {
  list-style: none;
  padding-left: 50px;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.nav-submenu.show {
  max-height: 200px;
}

.nav-submenu .nav-link-premium {
  font-size: 13px;
  padding: 8px 16px;
}

.nav-submenu .nav-link-premium::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-muted);
  margin-right: 8px;
  flex-shrink: 0;
  transition: var(--transition);
}

.nav-submenu .nav-link-premium:hover::before,
.nav-submenu .nav-link-premium.active::before {
  background: var(--primary-light);
  width: 6px;
  height: 6px;
  left: auto;
  top: auto;
  transform: none;
  position: static;
  border-radius: 50%;
}

/* Arrow for submenu parent */
.has-submenu::after {
  content: '\F285';
  font-family: 'bootstrap-icons';
  font-size: 12px;
  margin-left: auto;
  transition: var(--transition);
}

.has-submenu.open::after {
  transform: rotate(90deg);
}

/* Sidebar User */
.sidebar-user {
  padding: 16px 20px;
  border-top: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.sidebar-user-avatar {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 700;
  color: white;
  flex-shrink: 0;
}

.sidebar-user-info {
  flex: 1;
  min-width: 0;
}

.sidebar-user-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-user-role {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: capitalize;
}

/* ============================================
   HEADER
   ============================================ */
.premium-header {
  height: var(--header-height);
  position: fixed;
  top: 0;
  left: var(--sidebar-width);
  right: 0;
  z-index: 1030;
  background: var(--bg-header);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  padding: 0 28px;
  transition: var(--transition);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.mobile-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 22px;
  cursor: pointer;
  padding: 8px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.mobile-toggle:hover {
  background: var(--bg-glass-light);
  color: var(--text-primary);
}

.header-search {
  position: relative;
  width: 320px;
}

.header-search input {
  width: 100%;
  padding: 10px 16px 10px 42px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-color);
  background: var(--bg-glass);
  color: var(--text-primary);
  font-size: 13px;
  transition: var(--transition);
  outline: none;
}

.header-search input::placeholder {
  color: var(--text-muted);
}

.header-search input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(108, 92, 231, 0.15);
  background: var(--bg-card);
}

.header-search .search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 15px;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.header-action-btn {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-secondary);
  font-size: 18px;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
}

.header-action-btn:hover {
  background: var(--bg-glass-light);
  color: var(--text-primary);
  border-color: var(--border-color);
}

.header-action-btn .badge-dot {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--danger);
  border: 2px solid var(--bg-dark);
}

/* Header User Dropdown */
.header-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 12px 6px 6px;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: var(--transition);
  border: 1px solid transparent;
  margin-left: 8px;
}

.header-user:hover {
  background: var(--bg-glass-light);
  border-color: var(--border-color);
}

.header-user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  color: white;
}

.header-user-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.header-user-level {
  font-size: 11px;
  color: var(--text-muted);
}

/* Language Selector */
.lang-selector {
  padding: 8px 14px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-color);
  background: var(--bg-glass);
  color: var(--text-secondary);
  font-size: 13px;
  cursor: pointer;
  transition: var(--transition);
}

.lang-selector:hover {
  border-color: var(--primary);
  color: var(--text-primary);
}

/* Dropdown custom */
.premium-dropdown {
  background: var(--bg-card) !important;
  border: 1px solid var(--border-color) !important;
  border-radius: var(--radius-lg) !important;
  box-shadow: var(--shadow-lg) !important;
  padding: 8px !important;
  backdrop-filter: blur(20px);
  min-width: 220px;
}

.premium-dropdown .dropdown-item {
  color: var(--text-secondary) !important;
  border-radius: var(--radius-sm) !important;
  padding: 10px 14px !important;
  font-size: 13px !important;
  transition: var(--transition) !important;
}

.premium-dropdown .dropdown-item:hover {
  background: var(--bg-glass-light) !important;
  color: var(--text-primary) !important;
}

.premium-dropdown .dropdown-divider {
  border-color: var(--border-light) !important;
  margin: 4px 0 !important;
}

/* ============================================
   MAIN CONTENT
   ============================================ */
.premium-content {
  margin-left: var(--sidebar-width);
  padding-top: var(--header-height);
  min-height: 100vh;
  transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  flex: 1;
}

.content-area {
  padding: 28px;
}

/* Page Header */
.page-header {
  margin-bottom: 28px;
}

.page-title {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, #fff 0%, var(--text-secondary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.page-subtitle {
  font-size: 14px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Breadcrumb */
.premium-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.premium-breadcrumb a {
  color: var(--text-accent) !important;
}

.premium-breadcrumb .separator {
  font-size: 10px;
}

/* ============================================
   CARDS
   ============================================ */
.premium-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  transition: var(--transition);
  overflow: hidden;
  position: relative;
}

.premium-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, var(--primary) 50%, transparent 100%);
  opacity: 0;
  transition: var(--transition);
}

.premium-card:hover {
  border-color: rgba(108, 92, 231, 0.25);
  transform: translateY(-2px);
  box-shadow: var(--shadow-card), var(--shadow-glow);
}

.premium-card:hover::before {
  opacity: 1;
}

.premium-card .card-body {
  padding: 24px;
}

.premium-card .card-header {
  background: transparent;
  border-bottom: 1px solid var(--border-light);
  padding: 18px 24px;
}

.premium-card .card-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}

/* Stats Cards */
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  position: relative;
  overflow: hidden;
  transition: var(--transition);
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  border-radius: 3px 3px 0 0;
}

.stat-card.stat-primary::before { background: linear-gradient(90deg, var(--primary), var(--primary-light)); }
.stat-card.stat-success::before { background: linear-gradient(90deg, var(--accent), var(--success)); }
.stat-card.stat-warning::before { background: linear-gradient(90deg, var(--warning), #e17055); }
.stat-card.stat-info::before { background: linear-gradient(90deg, var(--info), var(--secondary)); }

.stat-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(108, 92, 231, 0.25);
}

.stat-card .stat-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  color: white;
}

.stat-primary .stat-icon { background: linear-gradient(135deg, var(--primary), var(--primary-light)); box-shadow: 0 4px 15px rgba(108, 92, 231, 0.3); }
.stat-success .stat-icon { background: linear-gradient(135deg, var(--accent), var(--success)); box-shadow: 0 4px 15px rgba(37, 211, 102, 0.3); }
.stat-warning .stat-icon { background: linear-gradient(135deg, var(--warning), #e17055); box-shadow: 0 4px 15px rgba(253, 203, 110, 0.3); }
.stat-info .stat-icon { background: linear-gradient(135deg, var(--info), var(--secondary)); box-shadow: 0 4px 15px rgba(116, 185, 255, 0.3); }

.stat-card .stat-label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.stat-card .stat-value {
  font-size: 28px;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.5px;
  line-height: 1;
}

.stat-card .stat-desc {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 8px;
}

/* ============================================
   TABLES
   ============================================ */
.premium-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.premium-table thead th {
  background: rgba(108, 92, 231, 0.06);
  padding: 14px 16px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
}

.premium-table thead th:first-child {
  border-radius: var(--radius-md) 0 0 0;
}

.premium-table thead th:last-child {
  border-radius: 0 var(--radius-md) 0 0;
}

.premium-table tbody td {
  padding: 14px 16px;
  font-size: 13.5px;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-light);
  transition: var(--transition);
  vertical-align: middle;
}

.premium-table tbody tr:hover td {
  background: rgba(108, 92, 231, 0.04);
  color: var(--text-primary);
}

.premium-table tbody tr:last-child td {
  border-bottom: none;
}

/* ============================================
   FORMS
   ============================================ */
.premium-input {
  width: 100%;
  padding: 11px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background: var(--bg-glass);
  color: var(--text-primary);
  font-size: 13.5px;
  font-family: 'Inter', 'Cairo', sans-serif;
  transition: var(--transition);
  outline: none;
}

.premium-input::placeholder {
  color: var(--text-muted);
}

.premium-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(108, 92, 231, 0.15);
  background: var(--bg-card);
}

.premium-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
  display: block;
}

/* Override Bootstrap form-control in dark theme */
.form-control {
  background: var(--bg-glass) !important;
  border-color: var(--border-color) !important;
  color: var(--text-primary) !important;
  border-radius: var(--radius-md) !important;
}

.form-control:focus {
  border-color: var(--primary) !important;
  box-shadow: 0 0 0 3px rgba(108, 92, 231, 0.15) !important;
  background: var(--bg-card) !important;
}

.form-control::placeholder {
  color: var(--text-muted) !important;
}

.form-label {
  color: var(--text-secondary) !important;
  font-weight: 600 !important;
  font-size: 13px !important;
}

/* Select */
.form-select {
  background-color: var(--bg-glass) !important;
  border-color: var(--border-color) !important;
  color: var(--text-primary) !important;
  border-radius: var(--radius-md) !important;
}

/* ============================================
   BUTTONS
   ============================================ */
.btn-premium {
  padding: 10px 24px;
  border-radius: var(--radius-md);
  font-size: 13.5px;
  font-weight: 600;
  font-family: 'Inter', 'Cairo', sans-serif;
  border: none;
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-premium-primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: white;
  box-shadow: 0 4px 15px rgba(108, 92, 231, 0.35);
}

.btn-premium-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 25px rgba(108, 92, 231, 0.45);
}

.btn-premium-success {
  background: linear-gradient(135deg, var(--accent) 0%, var(--success) 100%);
  color: white;
  box-shadow: 0 4px 15px rgba(37, 211, 102, 0.35);
}

.btn-premium-danger {
  background: linear-gradient(135deg, var(--danger) 0%, #d63031 100%);
  color: white;
  box-shadow: 0 4px 15px rgba(255, 118, 117, 0.35);
}

.btn-premium-outline {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
}

.btn-premium-outline:hover {
  border-color: var(--primary);
  color: var(--primary-light);
  background: var(--bg-glass-light);
}

/* Override Bootstrap buttons */
.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%) !important;
  border: none !important;
  box-shadow: 0 4px 15px rgba(108, 92, 231, 0.3) !important;
  border-radius: var(--radius-md) !important;
  font-weight: 600 !important;
  transition: var(--transition) !important;
}

.btn-primary:hover, .btn-primary:focus {
  transform: translateY(-1px) !important;
  box-shadow: 0 6px 25px rgba(108, 92, 231, 0.4) !important;
}

.btn-success {
  background: linear-gradient(135deg, var(--accent) 0%, var(--success) 100%) !important;
  border: none !important;
  box-shadow: 0 4px 15px rgba(37, 211, 102, 0.3) !important;
  border-radius: var(--radius-md) !important;
}

.btn-danger {
  background: linear-gradient(135deg, var(--danger) 0%, #d63031 100%) !important;
  border: none !important;
  box-shadow: 0 4px 15px rgba(255, 118, 117, 0.3) !important;
  border-radius: var(--radius-md) !important;
}

.btn-secondary {
  background: var(--bg-glass) !important;
  border: 1px solid var(--border-color) !important;
  color: var(--text-secondary) !important;
  border-radius: var(--radius-md) !important;
}

.btn-warning {
  background: linear-gradient(135deg, var(--warning) 0%, #e17055 100%) !important;
  border: none !important;
  border-radius: var(--radius-md) !important;
}

/* ============================================
   BADGES
   ============================================ */
.badge {
  border-radius: var(--radius-full) !important;
  font-weight: 600 !important;
  font-size: 11px !important;
  padding: 5px 12px !important;
  letter-spacing: 0.3px;
}

.badge.bg-success, .bg-success {
  background: linear-gradient(135deg, var(--accent), var(--success)) !important;
}

.badge.bg-danger, .bg-danger {
  background: linear-gradient(135deg, var(--danger), #d63031) !important;
}

.badge.bg-warning, .bg-warning {
  background: linear-gradient(135deg, var(--warning), #e17055) !important;
  color: #2d3436 !important;
}

.badge.bg-info, .bg-info {
  background: linear-gradient(135deg, var(--info), var(--secondary)) !important;
}

.badge.bg-primary, .bg-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-light)) !important;
}

.badge.bg-orange {
  background: linear-gradient(135deg, #e17055, #d63031) !important;
}

/* ============================================
   SWITCH / TOGGLE
   ============================================ */
.form-check-input {
  background-color: var(--bg-glass) !important;
  border-color: var(--border-color) !important;
}

.form-check-input:checked {
  background-color: var(--primary) !important;
  border-color: var(--primary) !important;
}

.form-check-input:focus {
  box-shadow: 0 0 0 3px rgba(108, 92, 231, 0.15) !important;
}

.form-check-label {
  color: var(--text-secondary) !important;
  font-size: 13px;
}

/* ============================================
   MODALS
   ============================================ */
.modal-content {
  background: var(--bg-card) !important;
  border: 1px solid var(--border-color) !important;
  border-radius: var(--radius-xl) !important;
  box-shadow: var(--shadow-lg) !important;
}

.modal-header {
  border-bottom: 1px solid var(--border-light) !important;
  padding: 20px 24px !important;
}

.modal-title {
  color: var(--text-primary) !important;
  font-weight: 700 !important;
}

.modal-body {
  padding: 24px !important;
}

.modal-footer {
  border-top: 1px solid var(--border-light) !important;
  padding: 16px 24px !important;
}

.btn-close {
  filter: invert(1) !important;
  opacity: 0.5 !important;
  transition: opacity 0.2s ease !important;
}

.btn-close:hover {
  opacity: 0.9 !important;
}

.modal {
  z-index: 1055 !important;
}

.modal-backdrop {
  z-index: 1050 !important;
  backdrop-filter: blur(4px);
}

/* ============================================
   ALERTS
   ============================================ */
.alert {
  border-radius: var(--radius-md) !important;
  border: none !important;
  padding: 14px 20px !important;
  font-size: 13.5px;
}

.alert-danger {
  background: rgba(255, 118, 117, 0.1) !important;
  color: var(--danger) !important;
  border-left: 3px solid var(--danger) !important;
}

.alert-success {
  background: rgba(37, 211, 102, 0.1) !important;
  color: var(--accent) !important;
  border-left: 3px solid var(--accent) !important;
}

.alert-warning {
  background: rgba(253, 203, 110, 0.1) !important;
  color: var(--warning) !important;
  border-left: 3px solid var(--warning) !important;
}

.alert-info {
  background: rgba(116, 185, 255, 0.1) !important;
  color: var(--info) !important;
  border-left: 3px solid var(--info) !important;
}

/* ============================================
   GENERIC DROPDOWN MENU (Dark Override)
   ============================================ */
.dropdown-menu {
  background: var(--bg-card) !important;
  border: 1px solid var(--border-color) !important;
  border-radius: var(--radius-lg) !important;
  box-shadow: var(--shadow-lg) !important;
  padding: 6px !important;
}

.dropdown-menu .dropdown-item {
  color: var(--text-secondary) !important;
  border-radius: var(--radius-sm) !important;
  padding: 8px 14px !important;
  font-size: 13px !important;
  transition: var(--transition) !important;
}

.dropdown-menu .dropdown-item:hover,
.dropdown-menu .dropdown-item:focus {
  background: var(--bg-glass-light) !important;
  color: var(--text-primary) !important;
}

.dropdown-menu .dropdown-divider {
  border-color: var(--border-light) !important;
}

/* ============================================
   SELECT2 (Dark Override)
   ============================================ */
.select2-container--default .select2-selection--single,
.select2-container--default .select2-selection--multiple {
  background-color: var(--bg-glass) !important;
  border-color: var(--border-color) !important;
  color: var(--text-primary) !important;
  border-radius: var(--radius-md) !important;
  min-height: 38px !important;
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
  color: var(--text-primary) !important;
}

.select2-container--default .select2-selection--single .select2-selection__placeholder {
  color: var(--text-muted) !important;
}

.select2-container--default .select2-results__option {
  color: var(--text-secondary) !important;
  background: var(--bg-card) !important;
}

.select2-container--default .select2-results__option--highlighted[aria-selected] {
  background-color: var(--primary) !important;
  color: #fff !important;
}

.select2-container--default .select2-results__option[aria-selected=true] {
  background-color: var(--bg-glass-light) !important;
  color: var(--primary-light) !important;
}

.select2-dropdown {
  background-color: var(--bg-card) !important;
  border-color: var(--border-color) !important;
  border-radius: var(--radius-md) !important;
  box-shadow: var(--shadow-lg) !important;
}

.select2-container--default .select2-search--dropdown .select2-search__field {
  background: var(--bg-glass) !important;
  border-color: var(--border-color) !important;
  color: var(--text-primary) !important;
  border-radius: var(--radius-sm) !important;
}

.select2-container--default .select2-selection--multiple .select2-selection__choice {
  background: var(--primary) !important;
  border: none !important;
  color: #fff !important;
  border-radius: var(--radius-sm) !important;
  padding: 2px 8px !important;
}

/* ============================================
   DATATABLES (Dark Override)
   ============================================ */
table.dataTable thead th,
table.dataTable thead td {
  border-bottom-color: var(--border-color) !important;
  color: var(--text-muted) !important;
  font-weight: 700 !important;
  font-size: 12px !important;
  text-transform: uppercase !important;
  letter-spacing: 0.8px !important;
}

table.dataTable tbody td {
  color: var(--text-secondary) !important;
  border-bottom-color: var(--border-light) !important;
}

table.dataTable tbody tr:hover {
  background-color: rgba(108, 92, 231, 0.04) !important;
}

.dataTables_wrapper .dataTables_length select,
.dataTables_wrapper .dataTables_filter input {
  background: var(--bg-glass) !important;
  border: 1px solid var(--border-color) !important;
  color: var(--text-primary) !important;
  border-radius: var(--radius-sm) !important;
  padding: 6px 10px !important;
}

.dataTables_wrapper .dataTables_info,
.dataTables_wrapper .dataTables_length label,
.dataTables_wrapper .dataTables_filter label {
  color: var(--text-muted) !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button {
  background: var(--bg-glass) !important;
  border: 1px solid var(--border-color) !important;
  color: var(--text-secondary) !important;
  border-radius: var(--radius-sm) !important;
  margin: 0 2px !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current {
  background: linear-gradient(135deg, var(--primary), var(--primary-light)) !important;
  border-color: var(--primary) !important;
  color: white !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
  background: var(--bg-glass-light) !important;
  border-color: var(--primary) !important;
  color: var(--primary-light) !important;
}

/* ============================================
   PAGINATION
   ============================================ */
.pagination .page-item .page-link {
  background: var(--bg-glass) !important;
  border: 1px solid var(--border-color) !important;
  color: var(--text-secondary) !important;
  border-radius: var(--radius-sm) !important;
  margin: 0 2px;
  font-size: 13px;
  padding: 8px 14px;
  transition: var(--transition);
}

.pagination .page-item.active .page-link {
  background: linear-gradient(135deg, var(--primary), var(--primary-light)) !important;
  border-color: var(--primary) !important;
  color: white !important;
  box-shadow: 0 2px 10px rgba(108, 92, 231, 0.3);
}

.pagination .page-item .page-link:hover {
  background: var(--bg-glass-light) !important;
  border-color: var(--primary) !important;
  color: var(--primary-light) !important;
}

.pagination .page-item.disabled .page-link {
  opacity: 0.4;
}

/* ============================================
   AUTH PAGES
   ============================================ */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  position: relative;
  overflow: hidden;
}

.auth-page::before {
  content: '';
  position: absolute;
  width: 800px;
  height: 800px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(108, 92, 231, 0.12) 0%, transparent 70%);
  top: -200px;
  right: -200px;
  animation: float-auth 8s ease-in-out infinite;
}

.auth-page::after {
  content: '';
  position: absolute;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(37, 211, 102, 0.08) 0%, transparent 70%);
  bottom: -200px;
  left: -200px;
  animation: float-auth 10s ease-in-out infinite reverse;
}

@keyframes float-auth {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(30px, -30px) scale(1.05); }
}

/* Floating particles */
.auth-particles {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  pointer-events: none;
}

.auth-particles span {
  position: absolute;
  display: block;
  width: 4px;
  height: 4px;
  background: var(--primary-light);
  border-radius: 50%;
  opacity: 0;
  animation: particle-float 6s ease-in-out infinite;
}

.auth-particles span:nth-child(1) { left: 10%; animation-delay: 0s; animation-duration: 8s; }
.auth-particles span:nth-child(2) { left: 20%; animation-delay: 1s; animation-duration: 6s; }
.auth-particles span:nth-child(3) { left: 35%; animation-delay: 2s; animation-duration: 9s; }
.auth-particles span:nth-child(4) { left: 50%; animation-delay: 0.5s; animation-duration: 7s; }
.auth-particles span:nth-child(5) { left: 65%; animation-delay: 3s; animation-duration: 5s; }
.auth-particles span:nth-child(6) { left: 80%; animation-delay: 1.5s; animation-duration: 8s; }
.auth-particles span:nth-child(7) { left: 90%; animation-delay: 2.5s; animation-duration: 6s; }

@keyframes particle-float {
  0% { transform: translateY(100vh); opacity: 0; }
  10% { opacity: 0.6; }
  90% { opacity: 0.6; }
  100% { transform: translateY(-100px); opacity: 0; }
}

.auth-card {
  width: 100%;
  max-width: 440px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg), var(--shadow-glow);
  padding: 48px 40px;
  position: relative;
  z-index: 10;
  overflow: hidden;
}

.auth-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--secondary), var(--accent));
}

.auth-brand {
  text-align: center;
  margin-bottom: 36px;
}

.auth-brand-icon {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  color: white;
  margin-bottom: 16px;
  box-shadow: 0 8px 30px rgba(37, 211, 102, 0.3);
}

.auth-brand h2 {
  font-size: 22px;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.auth-brand p {
  font-size: 14px;
  color: var(--text-muted);
}

.auth-input-group {
  margin-bottom: 20px;
}

.auth-input-group label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
  display: block;
}

.auth-input-wrapper {
  position: relative;
}

.auth-input-wrapper i {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 16px;
  z-index: 5;
}

.auth-input {
  width: 100%;
  padding: 13px 16px 13px 48px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background: var(--bg-glass);
  color: var(--text-primary);
  font-size: 14px;
  font-family: 'Inter', 'Cairo', sans-serif;
  transition: var(--transition);
  outline: none;
}

.auth-input::placeholder {
  color: var(--text-muted);
}

.auth-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(108, 92, 231, 0.15);
  background: var(--bg-card);
}

.auth-input:focus ~ i,
.auth-input:focus + i {
  color: var(--primary-light);
}

.auth-btn {
  width: 100%;
  padding: 14px;
  border: none;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: white;
  font-size: 15px;
  font-weight: 700;
  font-family: 'Inter', 'Cairo', sans-serif;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 4px 20px rgba(108, 92, 231, 0.35);
  margin-top: 8px;
}

.auth-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(108, 92, 231, 0.45);
}

.auth-btn:active {
  transform: translateY(0);
}

.auth-footer {
  text-align: center;
  margin-top: 24px;
  font-size: 14px;
  color: var(--text-muted);
}

.auth-footer a {
  color: var(--primary-light) !important;
  font-weight: 600;
}

.auth-footer a:hover {
  color: var(--primary) !important;
}

/* ============================================
   WIDGET ICON (Dashboard stats)
   ============================================ */
.widget-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
}

.widget-icon.bg-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-light)) !important;
  box-shadow: 0 4px 15px rgba(108, 92, 231, 0.3);
}

.widget-icon.bg-success {
  background: linear-gradient(135deg, var(--accent), var(--success)) !important;
  box-shadow: 0 4px 15px rgba(37, 211, 102, 0.3);
}

.widget-icon.bg-orange {
  background: linear-gradient(135deg, #e17055, var(--danger)) !important;
  box-shadow: 0 4px 15px rgba(225, 112, 85, 0.3);
}

.widget-icon.bg-info {
  background: linear-gradient(135deg, var(--info), var(--secondary)) !important;
  box-shadow: 0 4px 15px rgba(116, 185, 255, 0.3);
}

/* ============================================
   CARD OVERRIDES
   ============================================ */
.card {
  background: var(--bg-card) !important;
  border: 1px solid var(--border-color) !important;
  border-radius: var(--radius-lg) !important;
  box-shadow: var(--shadow-card) !important;
  color: var(--text-primary) !important;
  transition: var(--transition) !important;
}

.card:hover {
  border-color: rgba(108, 92, 231, 0.2) !important;
}

.card-body {
  background: transparent !important;
}

.card-title {
  color: var(--text-primary) !important;
}

.card-text {
  color: var(--text-secondary) !important;
}

h1, h2, h3, h4, h5, h6 {
  color: var(--text-primary);
}

p {
  color: var(--text-secondary);
}

/* TABLE overrides */
.table {
  color: var(--text-secondary) !important;
}

.table > :not(caption) > * > * {
  background-color: transparent !important;
  border-bottom-color: var(--border-light) !important;
  color: var(--text-secondary) !important;
}

.table thead th {
  background: rgba(108, 92, 231, 0.06) !important;
  color: var(--text-muted) !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.8px !important;
  border-bottom: 1px solid var(--border-color) !important;
}

.table tbody tr:hover > * {
  background-color: rgba(108, 92, 231, 0.04) !important;
  color: var(--text-primary) !important;
}

/* ============================================
   TOASTR OVERRIDES
   ============================================ */
.toast-success {
  background-color: rgba(37, 211, 102, 0.9) !important;
  border-radius: var(--radius-md) !important;
}

.toast-error {
  background-color: rgba(255, 118, 117, 0.9) !important;
  border-radius: var(--radius-md) !important;
}

.toast-info {
  background-color: rgba(116, 185, 255, 0.9) !important;
  border-radius: var(--radius-md) !important;
}

.toast-warning {
  background-color: rgba(253, 203, 110, 0.9) !important;
  border-radius: var(--radius-md) !important;
}

/* ============================================
   NAV TABS
   ============================================ */
.nav-tabs {
  border-bottom: 1px solid var(--border-light) !important;
}

.nav-tabs .nav-link {
  color: var(--text-muted) !important;
  border: none !important;
  padding: 12px 20px !important;
  font-weight: 600 !important;
  transition: var(--transition) !important;
}

.nav-tabs .nav-link.active {
  color: var(--primary-light) !important;
  background: transparent !important;
  border-bottom: 2px solid var(--primary) !important;
}

.nav-tabs .nav-link:hover {
  color: var(--text-primary) !important;
}

/* ============================================
   SMART WIZARD (Dark Override)
   ============================================ */
.sw-theme-default {
  border-color: var(--border-color) !important;
  background: transparent !important;
}

.sw-theme-default .nav-link {
  color: var(--text-muted) !important;
  background: var(--bg-glass) !important;
  border-color: var(--border-color) !important;
}

.sw-theme-default .nav-link.active {
  color: #fff !important;
  background: var(--primary) !important;
  border-color: var(--primary) !important;
}

.sw-theme-default .nav-link.done {
  color: var(--accent) !important;
  background: rgba(37, 211, 102, 0.1) !important;
  border-color: var(--accent) !important;
}

.sw-theme-default .tab-content {
  background: transparent !important;
  border-color: var(--border-color) !important;
  color: var(--text-primary) !important;
}

.sw-theme-default .sw-toolbar {
  background: transparent !important;
  border-color: var(--border-color) !important;
}

/* ============================================
   TOOLTIPS & POPOVERS
   ============================================ */
.tooltip-inner {
  background-color: var(--bg-card) !important;
  color: var(--text-primary) !important;
  border: 1px solid var(--border-color) !important;
  border-radius: var(--radius-sm) !important;
  font-size: 12px !important;
  padding: 6px 12px !important;
  box-shadow: var(--shadow-md) !important;
}

.bs-tooltip-top .tooltip-arrow::before,
.bs-tooltip-auto[data-popper-placement^="top"] .tooltip-arrow::before {
  border-top-color: var(--bg-card) !important;
}

.bs-tooltip-bottom .tooltip-arrow::before,
.bs-tooltip-auto[data-popper-placement^="bottom"] .tooltip-arrow::before {
  border-bottom-color: var(--bg-card) !important;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1199.98px) {
  .premium-sidebar {
    transform: translateX(-100%);
  }

  .premium-sidebar.show {
    transform: translateX(0);
  }

  .premium-content {
    margin-left: 0;
  }

  .premium-header {
    left: 0;
  }

  .premium-sidebar {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  }

  .mobile-toggle {
    display: flex;
  }

  .sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1035;
    backdrop-filter: blur(4px);
  }

  .sidebar-overlay.show {
    display: block;
  }
}

@media (max-width: 767.98px) {
  .content-area {
    padding: 16px;
  }

  .header-search {
    display: none;
  }

  .stat-card .stat-value {
    font-size: 22px;
  }

  .auth-card {
    padding: 32px 24px;
  }

  .premium-header {
    padding: 0 16px;
  }
}

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(108, 92, 231, 0.2); }
  50% { box-shadow: 0 0 20px 5px rgba(108, 92, 231, 0.1); }
}

.animate-fadeInUp {
  animation: fadeInUp 0.5s ease forwards;
}

.animate-slideInLeft {
  animation: slideInLeft 0.4s ease forwards;
}

/* Stagger animation delays */
.delay-1 { animation-delay: 0.1s; opacity: 0; }
.delay-2 { animation-delay: 0.2s; opacity: 0; }
.delay-3 { animation-delay: 0.3s; opacity: 0; }
.delay-4 { animation-delay: 0.4s; opacity: 0; }

/* ============================================
   SELECT DEVICE COMPONENT
   ============================================ */
.device-selector {
  margin: 12px 0;
  padding: 12px 16px;
  background: linear-gradient(135deg, rgba(108, 92, 231, 0.1), rgba(0, 206, 201, 0.05));
  border-radius: var(--radius-md);
  border: 1px solid rgba(108, 92, 231, 0.15);
}

.device-selector label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  margin-bottom: 6px;
  display: block;
}

.device-selector select {
  width: 100%;
  padding: 8px 12px;
  background: var(--bg-glass);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 13px;
}

/* ============================================
   MISC UTILITIES
   ============================================ */
.text-gradient {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.glass-effect {
  background: var(--bg-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-color);
}

.glow-primary {
  box-shadow: 0 0 20px rgba(108, 92, 231, 0.2);
}

.glow-success {
  box-shadow: 0 0 20px rgba(37, 211, 102, 0.2);
}

/* Status indicator */
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 6px;
}

.status-dot.online {
  background: var(--accent);
  box-shadow: 0 0 8px rgba(37, 211, 102, 0.5);
}

.status-dot.offline {
  background: var(--danger);
  box-shadow: 0 0 8px rgba(255, 118, 117, 0.5);
}

/* Override existing style.css sidebar/header for premium */
.wrapper { background: transparent !important; }
.sidebar-wrapper { display: none !important; }
.top-header { display: none !important; }
.page-content { margin-left: 0 !important; padding-top: 0 !important; }

/* WhatsApp brand colors for specific elements */
.wa-green { color: var(--accent) !important; }
.wa-bg-green { background: var(--accent) !important; }

/* Card hover effect - WhatsApp icon pulse */
.wa-pulse {
  animation: pulse-glow 2s infinite;
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: 60px 20px;
}

.empty-state i {
  font-size: 48px;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.empty-state h5 {
  color: var(--text-secondary);
  font-weight: 600;
}

.empty-state p {
  color: var(--text-muted);
  font-size: 14px;
}
