/* ============================================
   MOKABOT - UNIFIED CSS
   All styles in one file
   ============================================ */

/* ============================================
   CSS VARIABLES
   ============================================ */
:root {
  --primary-50: #eef2ff;
  --primary-100: #e0e7ff;
  --primary-200: #c7d2fe;
  --primary-300: #a5b4fc;
  --primary-400: #818cf8;
  --primary-500: #667eea;
  --primary-600: #5a67d8;
  --primary-700: #4c51bf;
  --primary-800: #434190;
  --primary-900: #3c366b;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;
  --success-500: #10b981;
  --warning-500: #f59e0b;
  --danger-500: #ef4444;
  --info-500: #3b82f6;
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.25rem;
  --text-2xl: 1.5rem;
  --rounded-sm: 0.125rem;
  --rounded: 0.25rem;
  --rounded-md: 0.375rem;
  --rounded-lg: 0.5rem;
  --rounded-xl: 0.75rem;
  --rounded-2xl: 1rem;
  --rounded-full: 9999px;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1);
  --transition: 200ms ease;
  --sidebar-width: 260px;
  --header-height: 64px;
}

[data-theme=dark] {
  --bg-primary: #0f172a;
  --bg-secondary: #020617;
  --bg-card: #1e293b;
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --border-color: rgba(255, 255, 255, 0.05);
  --primary-glow: rgba(99, 102, 241, 0.15);
}

[data-theme=light],
:root {
  --bg-primary: #ffffff;
  --bg-secondary: #f8fafc;
  --bg-card: #ffffff;
  --text-primary: #1e293b;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --border-color: #f1f5f9;
  --primary-glow: rgba(99, 102, 241, 0.05);
}

/* ============================================
   BASE RESET
   ============================================ */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: inherit;
  /* Handled by app.blade.php for LTR/RTL switching */
  font-size: var(--text-base);
  line-height: 1.6;
  color: var(--text-primary);
  background: var(--bg-secondary);
  margin: 0;
  padding: 0;
  transition: all 0.3s ease;
}

/* ============================================
   LAYOUT - APP WRAPPER
   ============================================ */
.app-wrapper {
  min-height: 100vh;
  display: flex;
}

/* ============================================
   SIDEBAR
   ============================================ */
.main-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background: var(--bg-card);
  border-right: 1px solid var(--border-color);
  z-index: 100;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  flex-shrink: 0;
}

[dir=rtl] .main-sidebar {
  left: auto;
  right: 0;
  border-right: none;
  border-left: 1px solid var(--border-color);
}

.sidebar-brand {
  padding: var(--space-5);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
}

.sidebar-menu {
  list-style: none;
  margin: 0;
  padding: var(--space-4);
  flex: 1;
  overflow-y: auto;
}

.sidebar-menu li {
  margin-bottom: var(--space-1);
}

.sidebar-menu .nav-link {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  color: var(--text-secondary);
  text-decoration: none;
  border-radius: var(--rounded-lg);
  transition: all var(--transition);
  font-size: var(--text-sm);
  font-weight: 500;
}

.sidebar-menu .nav-link:hover {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

.sidebar-menu li.active>.nav-link {
  background: rgba(102, 126, 234, 0.1);
  color: var(--primary-500);
}

.sidebar-menu .dropdown-menu {
  list-style: none;
  margin: 0;
  padding: 0 0 0 var(--space-4);
  background: transparent !important;
  display: none;
}

[dir="rtl"] .sidebar-menu .dropdown-menu {
  padding: 0 var(--space-4) 0 0;
}

.sidebar-menu li.active>.dropdown-menu {
  display: block;
}

.sidebar-menu .dropdown-menu .nav-link {
  padding: var(--space-2) var(--space-4);
  font-size: var(--text-xs);
  opacity: 0.8;
}

.sidebar-menu .dropdown-menu .nav-link:hover {
  opacity: 1;
  background: rgba(255, 255, 255, 0.05);
}

.sidebar-menu .dropdown-menu .nav-link i {
  width: 20px;
  text-align: center;
}

MAIN CONTENT============================================*/ .main-content {
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg-secondary);
  width: calc(100% - var(--sidebar-width));
}

/* Mobile - remove sidebar margin */
@media (max-width: 1023px) {
  .main-content {
/* DUPLICATE */    margin-left: 0;
  }
}

[dir=rtl] .main-content {
  margin-left: 0;
  margin-right: var(--sidebar-width);
}

/* ============================================
   MAIN CONTENT BODY
   ============================================ */
.main-content-body {
  flex: 1;
  padding: var(--space-6);
  overflow-x: hidden;
  max-width: 100%;
  margin: 0 !important;
}

/* ============================================
   SECTION & PAGE HEADER
   ============================================ */
.section {
  background: transparent;
  padding: 0;
  width: 100%;
  max-width: 1000px;
  margin: 0 !important;
}

.page-header {
  margin-bottom: var(--space-6);
  padding-bottom: var(--space-4);
  border-bottom: 1px solid var(--border-color);
}

.page-title {
  font-size: var(--text-2xl);
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 var(--space-1);
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.page-title i {
  color: var(--primary-500);
  font-size: var(--text-xl);
}

.page-subtitle {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  margin: 0;
}

/* ============================================
   CARDS
   ============================================ */
.card,
.card-modern {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--rounded-2xl);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.card:hover,
.card-modern:hover {
  transform: translateY(-5px);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  border-color: var(--primary-400);
}

.card-header,
.card-modern-header {
  padding: var(--space-4) var(--space-6);
  border-bottom: 1px solid var(--border-color);
}

.card-body,
.card-modern-body {
  padding: var(--space-6);
}

.card-footer,
.card-modern-footer {
  padding: var(--space-4) var(--space-6);
  border-top: 1px solid var(--border-color);
  background: var(--bg-secondary);
}

.card-title,
.card-modern-title {
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

/* ============================================
   BUTTONS
   ============================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  font-size: var(--text-sm);
  font-weight: 500;
  line-height: 1.5;
  border: 1px solid transparent;
  border-radius: var(--rounded-lg);
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-sm {
  padding: var(--space-1) var(--space-3);
  font-size: var(--text-xs);
}

.btn-lg {
  padding: var(--space-3) var(--space-6);
  font-size: var(--text-base);
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary-500), var(--primary-600));
  color: white;
  border-color: var(--primary-500);
}

.btn-primary:hover:not(:disabled) {
  background: linear-gradient(135deg, var(--primary-600), var(--primary-700));
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-secondary {
  background: var(--bg-secondary);
  color: var(--text-primary);
  border-color: var(--border-color);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--gray-100);
}

.btn-danger {
  background: var(--danger-500);
  color: white;
}

.btn-success {
  background: var(--success-500);
  color: white;
}

/* ============================================
   TABLES
   ============================================ */
.table-container {
  overflow-x: auto;
  border-radius: var(--rounded-lg);
  border: 1px solid var(--border-color);
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
}

.table th {
  padding: var(--space-3) var(--space-4);
  text-align: left;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
}

.table td {
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border-color);
  color: var(--text-primary);
}

.table tbody tr:hover {
  background: var(--bg-secondary);
}

/* ============================================
   BADGES & STATUS
   ============================================ */
.badge {
  display: inline-flex;
  align-items: center;
  padding: var(--space-1) var(--space-2);
  font-size: var(--text-xs);
  font-weight: 500;
  border-radius: var(--rounded-full);
}

.badge-primary {
  background: var(--primary-100);
  color: var(--primary-700);
}

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

.badge-warning {
  background: rgba(245, 158, 11, 0.1);
  color: var(--warning-500);
}

.badge-danger {
  background: rgba(239, 68, 68, 0.1);
  color: var(--danger-500);
}

.status {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-1) var(--space-3);
  font-size: var(--text-xs);
  font-weight: 500;
  border-radius: var(--rounded-full);
}

.status-active,
.status-success {
  background: rgba(16, 185, 129, 0.1);
  color: var(--success-500);
}

.status-inactive,
.status-danger {
  background: rgba(239, 68, 68, 0.1);
  color: var(--danger-500);
}

.status-pending,
.status-warning {
  background: rgba(245, 158, 11, 0.1);
  color: var(--warning-500);
}

.status::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

/* ============================================
   ALERTS
   ============================================ */
.alert {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-4);
  border-radius: var(--rounded-lg);
  font-size: var(--text-sm);
}

.alert-success {
  background: rgba(16, 185, 129, 0.1);
  color: var(--success-500);
  border: 1px solid var(--success-500);
}

.alert-warning {
  background: rgba(245, 158, 11, 0.1);
  color: var(--warning-500);
  border: 1px solid var(--warning-500);
}

.alert-danger {
  background: rgba(239, 68, 68, 0.1);
  color: var(--danger-500);
  border: 1px solid var(--danger-500);
}

.alert-info {
  background: rgba(59, 130, 246, 0.1);
  color: var(--info-500);
  border: 1px solid var(--info-500);
}

/* ============================================
   GRID UTILITIES
   ============================================ */
.grid {
  display: grid;
}

.grid-cols-1 {
  grid-template-columns: repeat(1, minmax(0, 1fr));
}

.grid-cols-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid-cols-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid-cols-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-6);
  margin-bottom: var(--space-6);
}

.modules-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-6);
}

/* ============================================
   FLEX UTILITIES
   ============================================ */
.flex {
  display: flex;
}

.flex-col {
  flex-direction: column;
}

.flex-wrap {
  flex-wrap: wrap;
}

.flex-1 {
  flex: 1 1 0%;
}

.items-start {
  align-items: flex-start;
}

.items-center {
  align-items: center;
}

.items-end {
  align-items: flex-end;
}

.justify-start {
  justify-content: flex-start;
}

.justify-center {
  justify-content: center;
}

.justify-end {
  justify-content: flex-end;
}

.justify-between {
  justify-content: space-between;
}

.gap-1 {
  gap: var(--space-1);
}

.gap-2 {
  gap: var(--space-2);
}

.gap-3 {
  gap: var(--space-3);
}

.gap-4 {
  gap: var(--space-4);
}

.gap-6 {
  gap: var(--space-6);
}

/* ============================================
   SPACING UTILITIES
   ============================================ */
.m-0 {
  margin: 0;
}

.m-auto {
  margin-left: var(--sidebar-width);
}

.mx-auto {
  margin-left: auto;
  margin-right: auto;
}

.my-4 {
  margin-top: var(--space-4);
  margin-bottom: var(--space-4);
}

.mt-0 {
  margin-top: 0;
}

.mt-4 {
  margin-top: var(--space-4);
}

.mt-6 {
  margin-top: var(--space-6);
}

.mb-0 {
  margin-bottom: 0;
}

.mb-4 {
  margin-bottom: var(--space-4);
}

.mb-6 {
  margin-bottom: var(--space-6);
}

.p-0 {
  padding: 0;
}

.p-4 {
  padding: var(--space-4);
}

.p-6 {
  padding: var(--space-6);
}

.px-4 {
  padding-left: var(--space-4);
  padding-right: var(--space-4);
}

.py-4 {
  padding-top: var(--space-4);
  padding-bottom: var(--space-4);
}

/* ============================================
   TYPOGRAPHY
   ============================================ */
.text-xs {
  font-size: var(--text-xs);
}

.text-sm {
  font-size: var(--text-sm);
}

.text-base {
  font-size: var(--text-base);
}

.text-lg {
  font-size: var(--text-lg);
}

.text-xl {
  font-size: var(--text-xl);
}

.text-2xl {
  font-size: var(--text-2xl);
}

.font-medium {
  font-weight: 500;
}

.font-semibold {
  font-weight: 600;
}

.font-bold {
  font-weight: 700;
}

.text-left {
  text-align: left;
}

.text-center {
  text-align: center;
}

.text-right {
  text-align: right;
}

.text-primary {
  color: var(--text-primary);
}

.text-secondary {
  color: var(--text-secondary);
}

.text-muted {
  color: var(--text-muted);
}

.text-white {
  color: white;
}

/* ============================================
   WIDTH UTILITIES
   ============================================ */
.w-full {
  width: 100%;
}

.w-auto {
  width: auto;
}

/* ============================================
   MOBILE RESPONSIVE (< 1024px)
   ============================================ */
@media (max-width: 1023px) {
  .main-sidebar {
    transform: translateX(-100%);
    z-index: 1000;
  }

  [dir=rtl] .main-sidebar {
    transform: translateX(100%);
  }

  .main-sidebar.open {
    transform: translateX(0);
  }

  .main-content {
/* DUPLICATE */    margin-left: 0 !important;
    margin-right: 0 !important;
    width: 100% !important;
  }

  .dashboard-header-inner {
    padding-left: 70px;
    padding-right: var(--space-4);
  }

  [dir=rtl] .dashboard-header-inner {
    padding-left: var(--space-4);
    padding-right: 70px;
  }

  .main-content-body {
    padding: var(--space-4);
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .mobile-menu-toggle {
    display: flex !important;
    position: fixed;
    top: 12px;
    left: 12px;
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, #667eea, #5a67d8);
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    z-index: 1100;
    align-items: center;
    justify-content: center;
    font-size: 1.125rem;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
    transition: all 0.3s ease;
  }

  [dir=rtl] .mobile-menu-toggle {
    left: auto;
    right: 12px;
  }

  .mobile-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s ease;
  }

  .mobile-overlay.active {
    display: block;
    opacity: 1;
  }

  .form-row {
    flex-direction: column;
    gap: 0;
  }

  .form-row .form-group {
    margin-bottom: var(--space-5);
  }
}

/* ============================================
   DESKTOP (>= 1024px)
   ============================================ */
@media (min-width: 1024px) {
  .mobile-menu-toggle {
    display: none !important;
  }

  .mobile-overlay {
    display: none !important;
  }

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

/* ============================================
   SMALL MOBILE (< 640px)
   ============================================ */
@media (max-width: 639px) {
  .dashboard-header {
    height: 56px;
  }

  .dashboard-header-inner {
    padding-left: 60px;
    padding-right: var(--space-3);
  }

  [dir=rtl] .dashboard-header-inner {
    padding-left: var(--space-3);
    padding-right: 60px;
  }

  .main-content-body {
    padding: var(--space-3);
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

  .modules-grid {
    grid-template-columns: 1fr;
  }

  .mobile-menu-toggle {
    width: 40px;
    height: 40px;
    font-size: 1rem;
    top: 8px;
    left: 8px;
  }

  [dir=rtl] .mobile-menu-toggle {
    left: auto;
    right: 8px;
  }
}

/* ============================================
   THEME TOGGLE
   ============================================ */
.theme-icon {
  display: none;
}

[data-theme=light] .theme-icon-moon,
[data-theme=dark] .theme-icon-sun {
  display: block;
}

/* ============================================
   DARK MODE ENHANCEMENTS
   ============================================ */
[data-theme=dark] .sidebar-menu .nav-link:hover {
  background: rgba(255, 255, 255, 0.05);
}

[data-theme=dark] .sidebar-menu li.active>.nav-link {
  background: rgba(102, 126, 234, 0.15);
}

[data-theme=dark] .dashboard-header-icon-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

[data-theme=dark] .form-input,
[data-theme=dark] .form-select,
[data-theme=dark] .form-textarea {
  background-color: var(--bg-secondary);
  border-color: var(--border-color);
  color: var(--text-primary);
}

[data-theme=dark] .form-input::placeholder {
  color: var(--text-muted);
}

[data-theme=dark] .btn-secondary:hover:not(:disabled) {
  background: var(--gray-700);
}

/* ============================================
   RTL SUPPORT
   ============================================ */
[dir=rtl] .text-left {
  text-align: right;
}

[dir=rtl] .text-right {
  text-align: left;
}

[dir=rtl] .table th {
  text-align: right;
}

/* ============================================
   MODERN HEADER REDESIGN
   Sleek, Glass-morphism inspired design
   ============================================ */

/* Base Header */
.dashboard-header {
  position: sticky !important;
  top: 0 !important;
  z-index: 50 !important;
  background: rgba(255, 255, 255, 0.85) !important;
  backdrop-filter: blur(20px) saturate(180%) !important;
  -webkit-backdrop-filter: blur(20px) saturate(180%) !important;
  border-bottom: 1px solid rgba(229, 231, 235, 0.5) !important;
  height: 72px !important;
  flex-shrink: 0 !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
  width: 100% !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05) !important;
}

/* Dark Mode Header */
[data-theme="dark"] .dashboard-header,
.dark .dashboard-header {
  background: rgba(15, 23, 42, 0.85) !important;
  border-bottom: 1px solid rgba(51, 65, 85, 0.5) !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2) !important;
}

.dashboard-header-inner {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  height: 100% !important;
  padding: 0 32px !important;
  max-width: none !important;
  margin: 0 !important;
}

.dashboard-header-start {
  display: flex !important;
  align-items: center !important;
  gap: 16px !important;
}

.dashboard-header-end {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
}

/* Header Items */
.dashboard-header-item {
  position: relative;
}

/* Icon Buttons - Modern Style */
.dashboard-header-icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: 12px;
  color: var(--text-secondary, #6b7280);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.dashboard-header-icon-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.1), rgba(118, 75, 162, 0.1));
  opacity: 0;
  transition: opacity 0.2s ease;
  border-radius: 12px;
}

.dashboard-header-icon-btn:hover {
  color: var(--primary-500, #667eea);
  transform: translateY(-1px);
}

.dashboard-header-icon-btn:hover::before {
  opacity: 1;
}

.dashboard-header-icon-btn:active {
  transform: translateY(0) scale(0.95);
}

.dashboard-header-icon-btn i {
  font-size: 18px;
  position: relative;
  z-index: 1;
}

/* Notification Badge */
.dashboard-header-badge {
  position: absolute;
  top: 6px;
  right: 6px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  font-size: 11px;
  font-weight: 600;
  line-height: 18px;
  text-align: center;
  color: white;
  background: linear-gradient(135deg, #ef4444, #dc2626);
  border-radius: 9px;
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.4);
  animation: badge-pulse 2s ease-in-out infinite;
}

.dashboard-header-badge-zero {
  display: none;
}

@keyframes badge-pulse {

  0%,
  100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.1);
  }
}

/* User Menu - Enhanced */
.dashboard-user-wrap {
  margin-left: 8px;
}

.dashboard-user-trigger {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 12px 6px 6px;
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.05), rgba(118, 75, 162, 0.05));
  border: 1px solid rgba(102, 126, 234, 0.1);
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.dashboard-user-trigger::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.1), rgba(118, 75, 162, 0.1));
  opacity: 0;
  transition: opacity 0.2s ease;
}

.dashboard-user-trigger:hover {
  border-color: rgba(102, 126, 234, 0.3);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
}

.dashboard-user-trigger:hover::before {
  opacity: 1;
}

/* Avatar */
.dashboard-user-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, #667eea, #764ba2);
  border-radius: 10px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.dashboard-user-initials {
  font-size: 14px;
  font-weight: 600;
  color: white;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.dashboard-user-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary, #1f2937);
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-user-chevron {
  font-size: 12px;
  color: var(--text-muted, #9ca3af);
  transition: transform 0.2s ease;
}

.dashboard-user-wrap.open .dashboard-user-chevron {
  transform: rotate(180deg);
}

/* Dropdowns - Modern Style */
.dashboard-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 280px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(229, 231, 235, 0.5);
  border-radius: 16px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15), 0 0 1px rgba(0, 0, 0, 0.1);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px) scale(0.95);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 1000;
  overflow: hidden;
}

[data-theme="dark"] .dashboard-dropdown,
.dark .dashboard-dropdown {
  background: rgba(30, 41, 59, 0.95);
  border-color: rgba(51, 65, 85, 0.5);
}

.dashboard-dropdown.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

/* Dropdown Header */
.dashboard-dropdown-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.05), rgba(118, 75, 162, 0.05));
  border-bottom: 1px solid rgba(229, 231, 235, 0.3);
}

.dashboard-dropdown-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary, #1f2937);
}

.dashboard-dropdown-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 24px;
  padding: 0 8px;
  font-size: 12px;
  font-weight: 600;
  color: white;
  background: linear-gradient(135deg, #667eea, #764ba2);
  border-radius: 12px;
}

/* Dropdown Body */
.dashboard-dropdown-body {
  max-height: 400px;
  overflow-y: auto;
  padding: 8px;
}

/* Dropdown Items */
.dashboard-dropdown-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  color: var(--text-primary, #1f2937);
  text-decoration: none;
  border-radius: 10px;
  transition: all 0.15s ease;
  font-size: 14px;
  font-weight: 500;
}

.dashboard-dropdown-item:hover {
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.08), rgba(118, 75, 162, 0.08));
  color: var(--primary-500, #667eea);
  transform: translateX(4px);
}

.dashboard-dropdown-item i {
  width: 20px;
  text-align: center;
  font-size: 16px;
  color: var(--text-muted, #9ca3af);
  transition: color 0.15s ease;
}

.dashboard-dropdown-item:hover i {
  color: var(--primary-500, #667eea);
}

.dashboard-dropdown-item-danger {
  color: var(--error, #ef4444);
}

.dashboard-dropdown-item-danger:hover {
  background: rgba(239, 68, 68, 0.1);
  color: #dc2626;
}

.dashboard-dropdown-item-danger i {
  color: var(--error, #ef4444);
}

/* User Info in Dropdown */
.dashboard-dropdown-user-info {
  padding: 16px 20px;
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.05), rgba(118, 75, 162, 0.05));
}

.dashboard-dropdown-user-name {
  display: block;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary, #1f2937);
  margin-bottom: 4px;
}

.dashboard-dropdown-user-email {
  display: block;
  font-size: 13px;
  color: var(--text-muted, #9ca3af);
}

/* Dropdown Divider */
.dashboard-dropdown-divider {
  height: 1px;
  background: rgba(229, 231, 235, 0.5);
  margin: 8px 0;
}

/* Dropdown Footer */
.dashboard-dropdown-footer {
  padding: 12px 16px;
  border-top: 1px solid rgba(229, 231, 235, 0.3);
  text-align: center;
}

.dashboard-dropdown-link {
  font-size: 13px;
  font-weight: 500;
  color: var(--primary-500, #667eea);
  text-decoration: none;
  transition: color 0.15s ease;
}

.dashboard-dropdown-link:hover {
  color: var(--primary-600, #5a67d8);
  text-decoration: underline;
}

/* Empty State */
.dashboard-empty-notice {
  padding: 40px 20px;
  text-align: center;
  color: var(--text-muted, #9ca3af);
}

.dashboard-empty-notice i {
  font-size: 32px;
  margin-bottom: 12px;
  opacity: 0.5;
}

.dashboard-empty-notice p {
  font-size: 14px;
  margin: 0;
}

/* Theme Toggle */
.dashboard-theme-toggle-wrap .theme-icon {
  display: none;
}

.dashboard-theme-toggle-wrap:not(.dark-mode) .theme-icon-moon {
  display: block;
}

.dashboard-theme-toggle-wrap.dark-mode .theme-icon-sun {
  display: block;
  color: #fbbf24;
}

/* Mobile Responsive */
@media (max-width: 1023px) {
  .dashboard-header-inner {
    padding-left: 70px !important;
    padding-right: 20px !important;
  }

  [dir="rtl"] .dashboard-header-inner {
    padding-left: 20px !important;
    padding-right: 70px !important;
  }

  .dashboard-user-name {
    display: none;
  }

  .dashboard-header-end {
    gap: 4px;
  }

  .dashboard-header-icon-btn {
    width: 40px;
    height: 40px;
  }
}

@media (max-width: 640px) {
  .dashboard-header {
    height: 64px !important;
  }

  .dashboard-header-inner {
    padding: 0 16px 0 60px !important;
  }

  [dir="rtl"] .dashboard-header-inner {
    padding: 0 60px 0 16px !important;
  }

  .dashboard-dropdown {
    min-width: 260px;
    right: -10px;
  }
}

/* ============================================
   MODERN FORMS REDESIGN
   Clean, accessible, beautiful forms
   ============================================ */

/* Form Container */
.form-container {
  max-width: 800px;
  margin: 0 auto;
}

/* Form Section */
.form-section {
  margin-bottom: 2rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid rgba(229, 231, 235, 0.5);
}

.form-section:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.form-section-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary, #1f2937);
  margin-bottom: 1.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid rgba(102, 126, 234, 0.2);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.form-section-title i {
  color: var(--primary-500, #667eea);
  font-size: 1.125rem;
}

/* Form Group */
.form-group {
  margin-bottom: 1.5rem;
}

.form-group:last-child {
  margin-bottom: 0;
}

/* Form Labels */
.form-label,
.form-group label,
label {
  display: block;
  margin-bottom: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-primary, #1f2937);
  letter-spacing: -0.01em;
}

.form-label.required::after,
.form-group label.required::after {
  content: '*';
  color: var(--error, #ef4444);
  margin-left: 4px;
  font-weight: 600;
}

/* Form Inputs - Modern Style */
.form-input,
.form-control,
.form-select,
.form-textarea,
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="tel"],
input[type="url"],
input[type="search"],
input[type="date"],
input[type="time"],
input[type="datetime-local"],
select,
textarea {
  display: block;
  width: 100%;
  padding: 0.875rem 1rem;
  font-size: 0.9375rem;
  font-weight: 400;
  line-height: 1.5;
  color: var(--text-primary, #1f2937);
  background-color: var(--bg-primary, #ffffff);
  background-clip: padding-box;
  border: 2px solid rgba(229, 231, 235, 0.8);
  border-radius: 12px;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  appearance: none;
  position: relative;
}

/* Input Hover State */
.form-input:hover,
.form-control:hover,
.form-select:hover,
.form-textarea:hover,
input:hover,
select:hover,
textarea:hover {
  border-color: rgba(102, 126, 234, 0.3);
  background-color: rgba(102, 126, 234, 0.02);
}

/* Input Focus State */
.form-input:focus,
.form-control:focus,
.form-select:focus,
.form-textarea:focus,
input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--primary-500, #667eea);
  background-color: var(--bg-primary, #ffffff);
  box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1), 0 2px 8px rgba(102, 126, 234, 0.1);
  transform: translateY(-1px);
}

/* Placeholder */
.form-input::placeholder,
.form-control::placeholder,
.form-textarea::placeholder,
input::placeholder,
textarea::placeholder {
  color: var(--text-muted, #9ca3af);
  opacity: 1;
}

/* Disabled State */
.form-input:disabled,
.form-control:disabled,
.form-select:disabled,
.form-textarea:disabled,
input:disabled,
select:disabled,
textarea:disabled {
  background-color: var(--bg-secondary, #f9fafb);
  color: var(--text-muted, #9ca3af);
  cursor: not-allowed;
  opacity: 0.7;
  border-color: rgba(229, 231, 235, 0.5);
}

/* Textarea */
textarea,
.form-textarea {
  min-height: 120px;
  resize: vertical;
  font-family: inherit;
}

/* Select Dropdown */
.form-select,
select {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3e%3cpath fill='none' stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M7 7l3 3 3-3'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  background-size: 20px;
  padding-right: 2.5rem;
  cursor: pointer;
}

[dir="rtl"] .form-select,
[dir="rtl"] select {
  background-position: left 1rem center;
  padding-right: 1rem;
  padding-left: 2.5rem;
}

/* Input Sizes */
.form-input-sm,
input.input-sm {
  padding: 0.625rem 0.875rem;
  font-size: 0.8125rem;
  border-radius: 10px;
}

.form-input-lg,
input.input-lg {
  padding: 1rem 1.25rem;
  font-size: 1.0625rem;
  border-radius: 14px;
}

/* Input with Icon */
.input-with-icon {
  position: relative;
}

.input-with-icon .form-input,
.input-with-icon .form-control {
  padding-left: 2.75rem;
}

[dir="rtl"] .input-with-icon .form-input,
[dir="rtl"] .input-with-icon .form-control {
  padding-left: 1rem;
  padding-right: 2.75rem;
}

.input-with-icon .input-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted, #9ca3af);
  pointer-events: none;
  transition: color 0.2s ease;
}

[dir="rtl"] .input-with-icon .input-icon {
  left: auto;
  right: 1rem;
}

.input-with-icon:focus-within .input-icon {
  color: var(--primary-500, #667eea);
}

/* Input Group */
.input-group {
  display: flex;
  align-items: stretch;
}

.input-group .form-input,
.input-group .form-control {
  flex: 1;
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}

[dir="rtl"] .input-group .form-input,
[dir="rtl"] .input-group .form-control {
  border-top-right-radius: 12px;
  border-bottom-right-radius: 12px;
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
}

.input-group-addon {
  display: flex;
  align-items: center;
  padding: 0 1rem;
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.05), rgba(118, 75, 162, 0.05));
  border: 2px solid rgba(229, 231, 235, 0.8);
  border-left: none;
  border-radius: 0 12px 12px 0;
  color: var(--text-muted, #9ca3af);
  font-size: 0.875rem;
  font-weight: 500;
}

[dir="rtl"] .input-group-addon {
  border-left: 2px solid rgba(229, 231, 235, 0.8);
  border-right: none;
  border-radius: 12px 0 0 12px;
}

/* Checkbox & Radio */
.form-check {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
  cursor: pointer;
}

.form-check:last-child {
  margin-bottom: 0;
}

.form-check-input {
  width: 20px;
  height: 20px;
  margin-top: 0.125rem;
  cursor: pointer;
  appearance: none;
  background-color: var(--bg-primary, #ffffff);
  border: 2px solid rgba(229, 231, 235, 0.8);
  border-radius: 6px;
  transition: all 0.15s ease;
  position: relative;
  flex-shrink: 0;
}

.form-check-input[type="radio"] {
  border-radius: 50%;
}

.form-check-input:hover {
  border-color: rgba(102, 126, 234, 0.5);
}

.form-check-input:checked {
  background-color: var(--primary-500, #667eea);
  border-color: var(--primary-500, #667eea);
}

.form-check-input:checked::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 10px;
  height: 10px;
  background: white;
  border-radius: 3px;
}

.form-check-input[type="radio"]:checked::after {
  border-radius: 50%;
  width: 8px;
  height: 8px;
}

.form-check-label {
  font-size: 0.875rem;
  color: var(--text-primary, #1f2937);
  cursor: pointer;
  user-select: none;
}

/* Switch Toggle */
.form-switch {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
}

.form-switch-input {
  width: 48px;
  height: 26px;
  appearance: none;
  background-color: rgba(229, 231, 235, 0.8);
  border-radius: 13px;
  position: relative;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.form-switch-input::before {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  background: white;
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.form-switch-input:checked {
  background: linear-gradient(135deg, #667eea, #764ba2);
}

.form-switch-input:checked::before {
  transform: translateX(22px);
}

[dir="rtl"] .form-switch-input::before {
  left: auto;
  right: 3px;
}

[dir="rtl"] .form-switch-input:checked::before {
  transform: translateX(-22px);
}

/* Validation States */
.form-input.is-invalid,
.form-input.error,
.form-control.is-invalid,
.form-control.error {
  border-color: var(--error, #ef4444);
  background-color: rgba(239, 68, 68, 0.02);
}

.form-input.is-invalid:focus,
.form-input.error:focus,
.form-control.is-invalid:focus,
.form-control.error:focus {
  box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.1);
}

.form-input.is-valid,
.form-control.is-valid {
  border-color: var(--success, #10b981);
  background-color: rgba(16, 185, 129, 0.02);
}

.form-input.is-valid:focus,
.form-control.is-valid:focus {
  box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.1);
}

/* Error Message */
.form-error,
.invalid-feedback {
  display: block;
  margin-top: 0.5rem;
  font-size: 0.8125rem;
  color: var(--error, #ef4444);
  font-weight: 500;
}

/* Help Text */
.form-help,
.form-text {
  display: block;
  margin-top: 0.5rem;
  font-size: 0.8125rem;
  color: var(--text-muted, #9ca3af);
  line-height: 1.5;
}

/* File Input */
.form-file {
  position: relative;
  display: inline-block;
}

.form-file-input {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
}

.form-file-label {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1.25rem;
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.05), rgba(118, 75, 162, 0.05));
  border: 2px dashed rgba(102, 126, 234, 0.3);
  border-radius: 12px;
  color: var(--primary-500, #667eea);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.form-file-label:hover {
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.1), rgba(118, 75, 162, 0.1));
  border-color: rgba(102, 126, 234, 0.5);
  transform: translateY(-1px);
}

/* Range Input */
.form-range {
  width: 100%;
  height: 8px;
  background: rgba(229, 231, 235, 0.8);
  border-radius: 4px;
  outline: none;
  appearance: none;
  cursor: pointer;
}

.form-range::-webkit-slider-thumb {
  appearance: none;
  width: 20px;
  height: 20px;
  background: linear-gradient(135deg, #667eea, #764ba2);
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
  transition: transform 0.2s ease;
}

.form-range::-webkit-slider-thumb:hover {
  transform: scale(1.1);
}

/* Grid Layout for Forms */
.form-row {
  display: grid;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.form-row-2 {
  grid-template-columns: repeat(2, 1fr);
}

.form-row-3 {
  grid-template-columns: repeat(3, 1fr);
}

.form-row-4 {
  grid-template-columns: repeat(4, 1fr);
}

/* Mobile Responsive */
@media (max-width: 1023px) {

  .form-row-3,
  .form-row-4 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {

  .form-row-2,
  .form-row-3,
  .form-row-4 {
    grid-template-columns: 1fr;
  }

  .form-input,
  .form-control,
  .form-select,
  .form-textarea {
    padding: 0.75rem 0.875rem;
    font-size: 1rem;
    /* Prevent zoom on iOS */
  }

  .form-section {
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
  }
}

/* Dark Mode Adjustments */
[data-theme="dark"] .form-input,
[data-theme="dark"] .form-control,
[data-theme="dark"] .form-select,
[data-theme="dark"] .form-textarea,
.dark .form-input,
.dark .form-control,
.dark .form-select,
.dark .form-textarea {
  background-color: rgba(30, 41, 59, 0.5);
  border-color: rgba(51, 65, 85, 0.8);
  color: var(--text-primary, #f1f5f9);
}

[data-theme="dark"] .form-input:hover,
[data-theme="dark"] .form-control:hover,
.dark .form-input:hover,
.dark .form-control:hover {
  background-color: rgba(30, 41, 59, 0.7);
  border-color: rgba(102, 126, 234, 0.4);
}

[data-theme="dark"] .form-input:focus,
[data-theme="dark"] .form-control:focus,
.dark .form-input:focus,
.dark .form-control:focus {
  background-color: rgba(30, 41, 59, 0.8);
  border-color: var(--primary-500, #667eea);
}

[data-theme="dark"] .form-select,
[data-theme="dark"] select,
.dark .form-select,
.dark select {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3e%3cpath fill='none' stroke='%2394a3b8' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M7 7l3 3 3-3'/%3e%3c/svg%3e");
}

[data-theme="dark"] .input-group-addon,
.dark .input-group-addon {
  background: rgba(30, 41, 59, 0.5);
  border-color: rgba(51, 65, 85, 0.8);
  color: var(--text-muted, #94a3b8);
}

[data-theme="dark"] .form-check-input,
.dark .form-check-input {
  background-color: rgba(30, 41, 59, 0.5);
  border-color: rgba(51, 65, 85, 0.8);
}

[data-theme="dark"] .form-switch-input,
.dark .form-switch-input {
  background-color: rgba(51, 65, 85, 0.8);
}

/* ============================================
   CAMPAIGN PAGES - MODERN DESIGN
   For Instagram, Facebook, and other campaigns
   ============================================ */

/* ============================================
   MODERN BUTTONS
   ============================================ */
.btn-modern {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  font-size: 0.9375rem;
  font-weight: 600;
  border-radius: 12px;
  border: 2px solid transparent;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  text-decoration: none;
  position: relative;
  overflow: hidden;
}

.btn-modern::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), transparent);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.btn-modern:hover::before {
  opacity: 1;
}

.btn-modern:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
}

.btn-modern:active {
  transform: translateY(0) scale(0.98);
}

.btn-modern-primary {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.btn-modern-primary:hover {
  box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
}

.btn-modern-secondary {
  background: var(--bg-secondary, #f9fafb);
  color: var(--text-primary, #1f2937);
  border-color: var(--border-color, #e5e7eb);
}

.btn-modern-secondary:hover {
  background: var(--bg-primary, #ffffff);
  border-color: var(--primary-500, #667eea);
  color: var(--primary-500, #667eea);
}

.btn-modern-success {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.btn-modern-danger {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: white;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.btn-modern-sm {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  border-radius: 10px;
}

.btn-modern-lg {
  padding: 1rem 2rem;
  font-size: 1.0625rem;
  border-radius: 14px;
}

/* ============================================
   MODERN MODAL
   ============================================ */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 9999;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  animation: fadeIn 0.2s ease;
}

.modal-overlay.active {
  display: flex;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.modal-container {
  background: var(--bg-card, #ffffff);
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  max-width: 600px;
  width: 100%;
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: slideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.95);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem 2rem;
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.05), rgba(118, 75, 162, 0.05));
  border-bottom: 1px solid var(--border-color, #e5e7eb);
}

.modal-title {
  font-size: 1.375rem;
  font-weight: 700;
  color: var(--text-primary, #1f2937);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.modal-title i {
  color: var(--primary-500, #667eea);
  font-size: 1.5rem;
}

.modal-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: transparent;
  border: none;
  border-radius: 10px;
  color: var(--text-muted, #9ca3af);
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 1.25rem;
}

.modal-close:hover {
  background: var(--bg-secondary, #f9fafb);
  color: var(--text-primary, #1f2937);
  transform: rotate(90deg);
}

.modal-body {
  padding: 2rem;
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 1rem;
  padding: 1.5rem 2rem;
  border-top: 1px solid var(--border-color, #e5e7eb);
  background: var(--bg-secondary, #f9fafb);
}

/* ============================================
   CAMPAIGNS GRID
   ============================================ */
.campaigns-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

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

/* ============================================
   CAMPAIGN CARD
   ============================================ */
.campaign-card {
  background: var(--bg-card, #ffffff);
  border: 2px solid var(--border-color, #e5e7eb);
  border-radius: 16px;
  padding: 1.5rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.campaign-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  transform: scaleX(0);
  transition: transform 0.3s ease;
}

.campaign-card:hover {
  border-color: var(--primary-500, #667eea);
  box-shadow: 0 8px 24px rgba(102, 126, 234, 0.15);
  transform: translateY(-4px);
}

.campaign-card:hover::before {
  transform: scaleX(1);
}

.campaign-card.active {
  border-color: var(--success, #10b981);
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.02) 0%, rgba(16, 185, 129, 0.05) 100%);
}

.campaign-card.active::before {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  transform: scaleX(1);
}

.campaign-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.campaign-title {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text-primary, #1f2937);
  margin: 0 0 0.25rem;
}

.campaign-status {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.25rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 8px;
}

.campaign-status.active {
  background: rgba(16, 185, 129, 0.1);
  color: #10b981;
}

.campaign-status.inactive {
  background: rgba(107, 114, 128, 0.1);
  color: #6b7280;
}

.campaign-description {
  font-size: 0.875rem;
  color: var(--text-secondary, #6b7280);
  line-height: 1.6;
  margin-bottom: 1rem;
}

.campaign-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-color, #e5e7eb);
}

.campaign-stat {
  text-align: center;
}

.campaign-stat-value {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary-500, #667eea);
  display: block;
}

.campaign-stat-label {
  font-size: 0.75rem;
  color: var(--text-muted, #9ca3af);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.campaign-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-color, #e5e7eb);
}

/* ============================================
   EMPTY STATE
   ============================================ */
.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.02) 0%, rgba(118, 75, 162, 0.02) 100%);
  border-radius: 16px;
  border: 2px dashed var(--border-color, #e5e7eb);
}

.empty-state-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.1), rgba(118, 75, 162, 0.1));
  border-radius: 50%;
  font-size: 2.5rem;
  color: var(--primary-500, #667eea);
}

.empty-state h3 {
  font-size: 1.375rem;
  font-weight: 700;
  color: var(--text-primary, #1f2937);
  margin: 0 0 0.75rem;
}

.empty-state p {
  font-size: 0.9375rem;
  color: var(--text-secondary, #6b7280);
  margin: 0 0 1.5rem;
  max-width: 400px;
  margin-left: auto;
  margin-right: auto;
}

/* ============================================
   INTEGRATION GRID
   ============================================ */
.integration-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1.5rem;
}

.integration-grid.cols-4 {
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
}

@media (max-width: 768px) {

  .integration-grid,
  .integration-grid.cols-4 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {

  .integration-grid,
  .integration-grid.cols-4 {
    grid-template-columns: 1fr;
  }
}

/* ============================================
   INTEGRATION CARD
   ============================================ */
.integration-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 2rem 1.5rem;
  background: var(--bg-card, #ffffff);
  border: 2px solid var(--border-color, #e5e7eb);
  border-radius: 16px;
  text-decoration: none;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
}

.integration-card:hover {
  border-color: var(--primary-500, #667eea);
  box-shadow: 0 8px 24px rgba(102, 126, 234, 0.15);
  transform: translateY(-4px);
}

.integration-icon {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  margin-bottom: 1rem;
  transition: transform 0.3s ease;
}

.integration-card:hover .integration-icon {
  transform: scale(1.1) rotate(5deg);
}

.integration-icon.blue {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(59, 130, 246, 0.2));
  color: #2563eb;
}

.integration-icon.pink {
  background: linear-gradient(135deg, rgba(228, 64, 95, 0.1), rgba(228, 64, 95, 0.2));
  color: #e4405f;
}

.integration-icon.purple {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.1), rgba(139, 92, 246, 0.2));
  color: #7c3aed;
}

.integration-icon.green {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.1), rgba(16, 185, 129, 0.2));
  color: #10b981;
}

.integration-icon.orange {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.1), rgba(245, 158, 11, 0.2));
  color: #f59e0b;
}

.integration-icon.red {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.1), rgba(239, 68, 68, 0.2));
  color: #ef4444;
}

.integration-card h4,
.integration-card h5 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary, #1f2937);
  margin: 0 0 0.5rem;
}

.integration-card p {
  font-size: 0.8125rem;
  color: var(--text-secondary, #6b7280);
  margin: 0;
  line-height: 1.5;
}

/* ============================================
   HOW IT WORKS SECTION
   ============================================ */
.how-it-works {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
}

.how-it-works-item {
  text-align: center;
  padding: 2rem 1.5rem;
  background: var(--bg-card, #ffffff);
  border: 1px solid var(--border-color, #e5e7eb);
  border-radius: 16px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.how-it-works-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
  border-color: var(--primary-500, #667eea);
}

.how-it-works-icon {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.5rem;
  font-size: 2rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease;
}

.how-it-works-item:hover .how-it-works-icon {
  transform: scale(1.1);
}

.how-it-works-icon.pink {
  background: linear-gradient(135deg, rgba(228, 64, 95, 0.1), rgba(228, 64, 95, 0.2));
  color: #e4405f;
}

.how-it-works-icon.purple {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.1), rgba(139, 92, 246, 0.2));
  color: #7c3aed;
}

.how-it-works-icon.blue {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(59, 130, 246, 0.2));
  color: #2563eb;
}

/* ============================================
   TOOLBAR REMOVAL
   ============================================ */
.page-toolbar,
.toolbar,
.action-toolbar {
  display: none !important;
}

/* Direct action buttons in header */
.card-modern-header .btn-modern {
  margin-left: auto;
}

[dir="rtl"] .card-modern-header .btn-modern {
  margin-left: 0;
  margin-right: auto;
}

/* ============================================
   DARK MODE
   ============================================ */
[data-theme="dark"] .modal-container,
.dark .modal-container {
  background: var(--bg-card, #1e293b);
}

[data-theme="dark"] .campaign-card,
.dark .campaign-card {
  background: var(--bg-card, #1e293b);
  border-color: var(--border-color, #334155);
}

[data-theme="dark"] .integration-card,
.dark .integration-card {
  background: var(--bg-card, #1e293b);
  border-color: var(--border-color, #334155);
}

[data-theme="dark"] .how-it-works-item,
.dark .how-it-works-item {
  background: var(--bg-card, #1e293b);
  border-color: var(--border-color, #334155);
}

[data-theme="dark"] .empty-state,
.dark .empty-state {
  background: rgba(30, 41, 59, 0.5);
  border-color: var(--border-color, #334155);
}

/* ============================================
   FLOW BUILDER PAGE - MODERN DESIGN
   Clean, organized, beautiful
   ============================================ */

/* Page Container */
.flow-builder-page {
  max-width: 100%;
  width: 100%;
  margin: 0;
  padding: 0;
}

/* Page Header */
.flow-builder-page .page-header {
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 2px solid rgba(102, 126, 234, 0.1);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.flow-builder-page .page-header h1 {
  font-size: 2rem;
  font-weight: 800;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin: 0;
  letter-spacing: -0.02em;
}

.flow-builder-page .page-header p {
  font-size: 0.9375rem;
  color: var(--text-secondary, #6b7280);
  margin: 0.5rem 0 0;
  width: 100%;
}

/* Action Buttons */
.flow-builder-page .btn-modern-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  border-radius: 12px;
  font-size: 0.9375rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.flow-builder-page .btn-modern-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
  color: white;
}

.flow-builder-page .btn-outline-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  background: transparent;
  color: var(--primary-500, #667eea);
  border: 2px solid var(--primary-500, #667eea);
  border-radius: 12px;
  font-size: 0.9375rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.flow-builder-page .btn-outline-primary:hover {
  background: var(--primary-500, #667eea);
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

/* Flows Card */
.flow-builder-page .flows-card {
  background: var(--bg-card, #ffffff);
  border: 1px solid var(--border-color, #e5e7eb);
  border-radius: 16px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  overflow: hidden;
}

/* Modern Table */
.flow-builder-page .modern-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.flow-builder-page .modern-table thead {
  background: linear-gradient(180deg, rgba(102, 126, 234, 0.05) 0%, rgba(102, 126, 234, 0.02) 100%);
}

.flow-builder-page .modern-table thead th {
  padding: 1rem 1.5rem;
  text-align: left;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-secondary, #6b7280);
  border-bottom: 1px solid var(--border-color, #e5e7eb);
}

.flow-builder-page .modern-table tbody tr {
  transition: background-color 0.2s ease;
  border-bottom: 1px solid var(--border-color, #e5e7eb);
}

.flow-builder-page .modern-table tbody tr:last-child {
  border-bottom: none;
}

.flow-builder-page .modern-table tbody tr:hover {
  background-color: rgba(102, 126, 234, 0.04);
}

.flow-builder-page .modern-table tbody td {
  padding: 1rem 1.5rem;
  vertical-align: middle;
}

/* Flow Name Cell */
.flow-builder-page .flow-name-cell strong {
  display: block;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text-primary, #1f2937);
  margin-bottom: 0.25rem;
}

.flow-builder-page .flow-name-cell strong a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s ease;
}

.flow-builder-page .flow-name-cell strong a:hover {
  color: var(--primary-500, #667eea);
}

.flow-builder-page .flow-name-cell small {
  display: block;
  font-size: 0.8125rem;
  color: var(--text-muted, #9ca3af);
}

/* Status Badge */
.flow-builder-page .status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.375rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 8px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.flow-builder-page .status-badge.active {
  background: rgba(16, 185, 129, 0.1);
  color: #10b981;
}

.flow-builder-page .status-badge.inactive {
  background: rgba(107, 114, 128, 0.1);
  color: #6b7280;
}

.flow-builder-page .status-badge.draft {
  background: rgba(245, 158, 11, 0.1);
  color: #f59e0b;
}

/* Action Buttons in Table */
.flow-builder-page .action-buttons {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
}

.flow-builder-page .action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  background: transparent;
  border: 1px solid var(--border-color, #e5e7eb);
  border-radius: 8px;
  color: var(--text-secondary, #6b7280);
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
}

.flow-builder-page .action-btn:hover {
  background: var(--bg-secondary, #f9fafb);
  border-color: var(--primary-500, #667eea);
  color: var(--primary-500, #667eea);
  transform: translateY(-1px);
}

.flow-builder-page .action-btn.danger:hover {
  border-color: var(--error, #ef4444);
  color: var(--error, #ef4444);
}

/* Empty State */
.flow-builder-page .empty-state {
  text-align: center;
  padding: 4rem 2rem;
}

.flow-builder-page .empty-state-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.1), rgba(118, 75, 162, 0.1));
  border-radius: 50%;
  font-size: 2.5rem;
  color: var(--primary-500, #667eea);
}

.flow-builder-page .empty-state h3 {
  font-size: 1.375rem;
  font-weight: 700;
  color: var(--text-primary, #1f2937);
  margin: 0 0 0.5rem;
}

.flow-builder-page .empty-state p {
  font-size: 0.9375rem;
  color: var(--text-secondary, #6b7280);
  margin: 0 0 1.5rem;
}

/* Modal Improvements */
.flow-builder-page .modal-content {
  border: none;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.flow-builder-page .modal-header {
  padding: 1.5rem 2rem;
  border-bottom: 1px solid var(--border-color, #e5e7eb);
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.05), rgba(118, 75, 162, 0.05));
}

.flow-builder-page .modal-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary, #1f2937);
}

.flow-builder-page .modal-body {
  padding: 2rem;
}

.flow-builder-page .modal-footer {
  padding: 1.5rem 2rem;
  border-top: 1px solid var(--border-color, #e5e7eb);
  background: var(--bg-secondary, #f9fafb);
}

/* Tabs */
.flow-builder-page .nav-tabs {
  border-bottom: 2px solid var(--border-color, #e5e7eb);
  margin-bottom: 1.5rem;
}

.flow-builder-page .nav-tabs .nav-link {
  border: none;
  padding: 0.75rem 1.25rem;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text-secondary, #6b7280);
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all 0.2s ease;
}

.flow-builder-page .nav-tabs .nav-link:hover {
  color: var(--primary-500, #667eea);
  border-color: transparent;
}

.flow-builder-page .nav-tabs .nav-link.active {
  color: var(--primary-500, #667eea);
  border-bottom-color: var(--primary-500, #667eea);
  background: transparent;
}

/* Dark Mode */
[data-theme=dark] .flow-builder-page .page-header,
.dark .flow-builder-page .page-header {
  border-bottom-color: rgba(102, 126, 234, 0.2);
}

[data-theme=dark] .flow-builder-page .flows-card,
.dark .flow-builder-page .flows-card {
  background: var(--bg-card, #1e293b);
  border-color: var(--border-color, #334155);
}

[data-theme=dark] .flow-builder-page .modern-table thead,
.dark .flow-builder-page .modern-table thead {
  background: rgba(51, 65, 85, 0.4);
}

[data-theme=dark] .flow-builder-page .modern-table thead th,
.dark .flow-builder-page .modern-table thead th {
  color: #94a3b8;
  border-bottom-color: rgba(255, 255, 255, 0.08);
}

[data-theme=dark] .flow-builder-page .modern-table tbody tr,
.dark .flow-builder-page .modern-table tbody tr {
  border-bottom-color: rgba(255, 255, 255, 0.04);
}

[data-theme=dark] .flow-builder-page .modern-table tbody tr:hover,
.dark .flow-builder-page .modern-table tbody tr:hover {
  background-color: rgba(102, 126, 234, 0.1);
}

/* Responsive */
@media (max-width: 768px) {
  .flow-builder-page .page-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .flow-builder-page .page-header .d-flex {
    width: 100%;
  }

  .flow-builder-page .btn-modern-primary,
  .flow-builder-page .btn-outline-primary {
    width: 100%;
    justify-content: center;
  }

  .flow-builder-page .modern-table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }

  .flow-builder-page .action-buttons {
    flex-wrap: wrap;
  }
}

/* ============================================
   CYBERPANEL-STYLE SIDEBAR
   Modern, dark, professional design
   ============================================ */

/* Main Sidebar Container */
.main-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-width, 260px);
  height: 100vh;
  background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
  border-right: none;
  z-index: 100;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  flex-shrink: 0;
  box-shadow: 2px 0 8px rgba(0, 0, 0, 0.1);
}

[dir="rtl"] .main-sidebar {
  left: auto;
  right: 0;
  border-right: none;
  border-left: none;
  box-shadow: -2px 0 8px rgba(0, 0, 0, 0.1);
}

/* Sidebar Brand/Logo */
.sidebar-brand {
  padding: 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.2);
}

.sidebar-brand a {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--text-primary);
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.sidebar-brand img {
  height: 40px;
  width: auto;
}

.sidebar-brand i {
  font-size: 1.5rem;
  background: linear-gradient(135deg, #667eea, #764ba2);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Sidebar Menu Container */
.sidebar-menu {
  list-style: none;
  margin: 0;
  padding: 1rem 0.75rem;
  flex: 1 1 auto;
  overflow-y: auto;
  overflow-x: hidden;
  min-height: 0;
  /* Important for flex scrolling */
  max-height: calc(100vh - 80px);
  /* Account for brand header */
}

/* Custom Scrollbar */
.sidebar-menu::-webkit-scrollbar {
  width: 4px;
}

.sidebar-menu::-webkit-scrollbar-track {
  background: transparent;
}

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

.sidebar-menu::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* Menu Items */
.sidebar-menu li {
  margin-bottom: 0.25rem;
}

/* Navigation Links */
.sidebar-menu .nav-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  color: var(--text-secondary);
  text-decoration: none;
  border-radius: 8px;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  font-size: 0.875rem;
  font-weight: 500;
  position: relative;
  overflow: hidden;
}

.sidebar-menu .nav-link::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: 3px;
  background: linear-gradient(135deg, #667eea, #764ba2);
  transform: scaleY(0);
  transition: transform 0.2s ease;
}

[dir="rtl"] .sidebar-menu .nav-link::before {
  left: auto;
  right: 0;
}

/* Menu Icons */
.sidebar-menu .nav-link i {
  width: 20px;
  text-align: center;
  font-size: 1rem;
  transition: all 0.2s ease;
}

/* Hover State */
.sidebar-menu .nav-link:hover {
  background: var(--bg-secondary);
  color: var(--text-primary);
  transform: translateX(4px);
}

[dir="rtl"] .sidebar-menu .nav-link:hover {
  transform: translateX(-4px);
}

.sidebar-menu .nav-link:hover::before {
  transform: scaleY(1);
}

.sidebar-menu .nav-link:hover i {
  transform: scale(1.1);
  color: #667eea;
}

/* Active State */
.sidebar-menu li.active>.nav-link {
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.2), rgba(118, 75, 162, 0.15));
  color: var(--text-primary);
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.2);
}

.sidebar-menu li.active>.nav-link::before {
  transform: scaleY(1);
}

.sidebar-menu li.active>.nav-link i {
  color: #667eea;
}

/* Dropdown Menu */
.sidebar-menu .dropdown-menu {
  list-style: none;
  margin: 0;
  padding: 0.25rem 0 0.25rem 2rem;
  display: none;
  border-left: 2px solid rgba(102, 126, 234, 0.3);
  margin-left: 1rem;
  margin-top: 0.25rem;
}

[dir="rtl"] .sidebar-menu .dropdown-menu {
  padding-left: 0;
  padding-right: 2rem;
  border-left: none;
  border-right: 2px solid rgba(102, 126, 234, 0.3);
  margin-left: 0;
  margin-right: 1rem;
}

.sidebar-menu li.active>.dropdown-menu {
  display: block;
  animation: slideDown 0.2s ease;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Dropdown Items */
.sidebar-menu .dropdown-menu .nav-link {
  padding: 0.5rem 0.75rem;
  font-size: 0.8125rem;
  color: rgba(255, 255, 255, 0.6);
}

.sidebar-menu .dropdown-menu .nav-link:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}

.sidebar-menu .dropdown-menu li.active>.nav-link {
  color: #667eea;
  background: rgba(102, 126, 234, 0.1);
}

/* Menu Divider */
.sidebar-menu .menu-divider {
  height: 1px;
  background: var(--bg-secondary);
  margin: 1rem 0;
}

/* Menu Section Title */
.sidebar-menu .menu-section {
  padding: 0.75rem 1rem;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.4);
  margin-top: 0.5rem;
}

/* Badge */
.sidebar-menu .badge {
  margin-left: auto;
  padding: 0.25rem 0.5rem;
  font-size: 0.6875rem;
  font-weight: 600;
  border-radius: 6px;
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: var(--text-primary);
}

[dir="rtl"] .sidebar-menu .badge {
  margin-left: 0;
  margin-right: auto;
}

/* User Profile Section (if exists) */
.sidebar-user {
  padding: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.2);
  flex-shrink: 0;
  /* Don't shrink */
  margin-top: auto;
  /* Push to bottom */
}

.sidebar-user-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  border-radius: 8px;
  transition: background 0.2s ease;
  cursor: pointer;
}

.sidebar-user-info:hover {
  background: var(--bg-secondary);
}

.sidebar-user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #667eea, #764ba2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-primary);
  font-weight: 600;
  font-size: 1rem;
}

.sidebar-user-details {
  flex: 1;
  min-width: 0;
}

.sidebar-user-name {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-user-role {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.5);
}

/* Mobile Responsive */
@media (max-width: 1023px) {
  .main-sidebar {
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 4px 0 16px rgba(0, 0, 0, 0.3);
  }

  [dir="rtl"] .main-sidebar {
    transform: translateX(100%);
  }

  .main-sidebar.open {
    transform: translateX(0);
  }

  .sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 99;
  }

  .sidebar-overlay.active {
    display: block;
  }
}

@media (min-width: 1024px) {
  .main-sidebar {
    transform: translateX(0) !important;
  }
}

/* ===== DARK MODE ADJUSTMENTS ===== */

/* When in dark mode, keep the same style (already dark) */
[data-theme="dark"] .main-sidebar,
.dark .main-sidebar {
  background: linear-gradient(180deg, #0f172a 0%, #020617 100%);
}

[data-theme="dark"] .sidebar-brand,
.dark .sidebar-brand {
  border-bottom-color: rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] .sidebar-menu .nav-link:hover,
.dark .sidebar-menu .nav-link:hover {
  background: rgba(255, 255, 255, 0.1);
}

/* ============================================
   GLOBAL DARK MODE
   Applies to ALL elements on the page
   ============================================ */

/* ===== ROOT VARIABLES FOR DARK MODE ===== */
[data-theme="dark"],
.dark {
  /* Background Colors */
  --bg-primary: #0f172a;
  --bg-secondary: #1e293b;
  --bg-tertiary: #334155;
  --bg-card: #1e293b;
  --bg-hover: rgba(255, 255, 255, 0.05);

  /* Text Colors */
  --text-primary: #f1f5f9;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;
  --text-disabled: #64748b;

  /* Border Colors */
  --border-color: #334155;
  --border-color-light: #1e293b;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.5);

  /* Primary Colors (adjusted for dark mode) */
  --primary-50: rgba(102, 126, 234, 0.1);
  --primary-100: rgba(102, 126, 234, 0.2);
  --primary-500: #667eea;
  --primary-600: #5a67d8;

  /* Status Colors */
  --success: #10b981;
  --warning: #f59e0b;
  --error: #ef4444;
  --info: #3b82f6;
}

/* ===== BODY & APP WRAPPER ===== */
[data-theme="dark"] body,
.dark body,
[data-theme="dark"] .app-wrapper,
.dark .app-wrapper {
  background-color: var(--bg-primary, #0f172a);
  color: var(--text-primary, #f1f5f9);
}

/* ===== MAIN CONTENT ===== */
[data-theme="dark"] .main-content,
.dark .main-content {
  background-color: var(--bg-secondary, #1e293b);
}

/* ===== SECTION ===== */
[data-theme="dark"] .section,
.dark .section {
  background: transparent;
}

/* ===== CARDS ===== */
[data-theme="dark"] .card,
.dark .card,
[data-theme="dark"] .card-modern,
.dark .card-modern,
[data-theme="dark"] .info-card,
.dark .info-card {
  background: var(--bg-card, #1e293b);
  border-color: var(--border-color, #334155);
  box-shadow: var(--shadow-sm, 0 1px 2px rgba(0, 0, 0, 0.3));
}

/* ===== FORMS ===== */
[data-theme="dark"] input[type="text"],
.dark input[type="text"],
[data-theme="dark"] input[type="email"],
.dark input[type="email"],
[data-theme="dark"] input[type="password"],
.dark input[type="password"],
[data-theme="dark"] input[type="number"],
.dark input[type="number"],
[data-theme="dark"] input[type="tel"],
.dark input[type="tel"],
[data-theme="dark"] input[type="url"],
.dark input[type="url"],
[data-theme="dark"] input[type="search"],
.dark input[type="search"],
[data-theme="dark"] input[type="date"],
.dark input[type="date"],
[data-theme="dark"] input[type="time"],
.dark input[type="time"],
[data-theme="dark"] input[type="datetime-local"],
.dark input[type="datetime-local"],
[data-theme="dark"] select,
.dark select,
[data-theme="dark"] textarea,
.dark textarea,
[data-theme="dark"] .form-input,
.dark .form-input,
[data-theme="dark"] .form-control,
.dark .form-control {
  background-color: var(--bg-tertiary, #334155);
  border-color: var(--border-color, #334155);
  color: var(--text-primary, #f1f5f9);
}

[data-theme="dark"] input::placeholder,
.dark input::placeholder,
[data-theme="dark"] textarea::placeholder,
.dark textarea::placeholder {
  color: var(--text-muted, #94a3b8);
}

[data-theme="dark"] input:focus,
.dark input:focus,
[data-theme="dark"] select:focus,
.dark select:focus,
[data-theme="dark"] textarea:focus,
.dark textarea:focus {
  background-color: var(--bg-tertiary, #334155);
  border-color: var(--primary-500, #667eea);
  box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.2);
}

/* ===== SELECT DROPDOWN ===== */
[data-theme="dark"] select,
.dark select {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3e%3cpath fill='none' stroke='%2394a3b8' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M7 7l3 3 3-3'/%3e%3c/svg%3e");
}

/* ===== BUTTONS ===== */
[data-theme="dark"] .btn,
.dark .btn,
[data-theme="dark"] .btn-modern,
.dark .btn-modern {
  /* Already have gradient backgrounds, just adjust shadows */
}

[data-theme="dark"] .btn-modern-secondary,
.dark .btn-modern-secondary {
  background: var(--bg-tertiary, #334155);
  border-color: var(--border-color, #334155);
  color: var(--text-primary, #f1f5f9);
}

[data-theme="dark"] .btn-modern-secondary:hover,
.dark .btn-modern-secondary:hover {
  background: var(--bg-hover, rgba(255, 255, 255, 0.05));
  border-color: var(--primary-500, #667eea);
  color: var(--primary-500, #667eea);
}

/* ===== TABLES ===== */
[data-theme="dark"] table,
.dark table,
[data-theme="dark"] .table,
.dark .table,
[data-theme="dark"] .modern-table,
.dark .modern-table {
  background: var(--bg-card, #1e293b);
  color: var(--text-primary, #f1f5f9);
}

[data-theme="dark"] thead,
.dark thead,
[data-theme="dark"] .modern-table thead,
.dark .modern-table thead {
  background: rgba(51, 65, 85, 0.4);
}

[data-theme="dark"] th,
.dark th,
[data-theme="dark"] .modern-table th,
.dark .modern-table th {
  color: var(--text-secondary, #cbd5e1);
  border-bottom-color: var(--border-color, #334155);
}

[data-theme="dark"] td,
.dark td,
[data-theme="dark"] .modern-table td,
.dark .modern-table td {
  border-bottom-color: rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] tbody tr:hover,
.dark tbody tr:hover,
[data-theme="dark"] .modern-table tbody tr:hover,
.dark .modern-table tbody tr:hover {
  background: rgba(102, 126, 234, 0.1);
}

/* ===== TYPOGRAPHY ===== */
[data-theme="dark"] h1,
.dark h1,
[data-theme="dark"] h2,
.dark h2,
[data-theme="dark"] h3,
.dark h3,
[data-theme="dark"] h4,
.dark h4,
[data-theme="dark"] h5,
.dark h5,
[data-theme="dark"] h6,
.dark h6 {
  color: var(--text-primary, #f1f5f9);
}

[data-theme="dark"] p,
.dark p,
[data-theme="dark"] span,
.dark span,
[data-theme="dark"] div,
.dark div {
  color: var(--text-primary, #f1f5f9);
}

[data-theme="dark"] .text-muted,
.dark .text-muted,
[data-theme="dark"] .text-gray-500,
.dark .text-gray-500,
[data-theme="dark"] .text-gray-600,
.dark .text-gray-600 {
  color: var(--text-muted, #94a3b8) !important;
}

/* ===== MODALS ===== */
[data-theme="dark"] .modal,
.dark .modal,
[data-theme="dark"] .modal-content,
.dark .modal-content,
[data-theme="dark"] .modal-container,
.dark .modal-container {
  background: var(--bg-card, #1e293b);
  border-color: var(--border-color, #334155);
}

[data-theme="dark"] .modal-header,
.dark .modal-header,
[data-theme="dark"] .modal-footer,
.dark .modal-footer {
  border-color: var(--border-color, #334155);
  background: rgba(0, 0, 0, 0.2);
}

[data-theme="dark"] .modal-title,
.dark .modal-title {
  color: var(--text-primary, #f1f5f9);
}

/* ===== DROPDOWNS ===== */
[data-theme="dark"] .dropdown-menu,
.dark .dropdown-menu {
  background: var(--bg-card, #1e293b);
  border-color: var(--border-color, #334155);
  box-shadow: var(--shadow-lg, 0 10px 15px rgba(0, 0, 0, 0.5));
}

[data-theme="dark"] .dropdown-item,
.dark .dropdown-item {
  color: var(--text-primary, #f1f5f9);
}

[data-theme="dark"] .dropdown-item:hover,
.dark .dropdown-item:hover {
  background: var(--bg-hover, rgba(255, 255, 255, 0.05));
  color: var(--primary-500, #667eea);
}

/* ===== BADGES ===== */
[data-theme="dark"] .badge,
.dark .badge {
  /* Keep gradient backgrounds */
}

/* ===== ALERTS ===== */
[data-theme="dark"] .alert,
.dark .alert {
  background: var(--bg-card, #1e293b);
  border-color: var(--border-color, #334155);
}

/* ===== TABS ===== */
[data-theme="dark"] .nav-tabs,
.dark .nav-tabs {
  border-bottom-color: var(--border-color, #334155);
}

[data-theme="dark"] .nav-tabs .nav-link,
.dark .nav-tabs .nav-link {
  color: var(--text-secondary, #cbd5e1);
}

[data-theme="dark"] .nav-tabs .nav-link:hover,
.dark .nav-tabs .nav-link:hover {
  color: var(--primary-500, #667eea);
  border-color: transparent;
}

[data-theme="dark"] .nav-tabs .nav-link.active,
.dark .nav-tabs .nav-link.active {
  color: var(--primary-500, #667eea);
  background: transparent;
  border-bottom-color: var(--primary-500, #667eea);
}

/* ===== PAGINATION ===== */
[data-theme="dark"] .pagination,
.dark .pagination {
  /* Adjust as needed */
}

[data-theme="dark"] .page-link,
.dark .page-link {
  background: var(--bg-card, #1e293b);
  border-color: var(--border-color, #334155);
  color: var(--text-primary, #f1f5f9);
}

[data-theme="dark"] .page-link:hover,
.dark .page-link:hover {
  background: var(--bg-hover, rgba(255, 255, 255, 0.05));
  border-color: var(--primary-500, #667eea);
  color: var(--primary-500, #667eea);
}

[data-theme="dark"] .page-item.active .page-link,
.dark .page-item.active .page-link {
  background: var(--primary-500, #667eea);
  border-color: var(--primary-500, #667eea);
  color: var(--text-primary);
}

/* ===== EMPTY STATES ===== */
[data-theme="dark"] .empty-state,
.dark .empty-state {
  background: rgba(30, 41, 59, 0.5);
  border-color: var(--border-color, #334155);
}

/* ===== PRE/CODE ===== */
[data-theme="dark"] pre,
.dark pre,
[data-theme="dark"] code,
.dark code {
  background: var(--bg-tertiary, #334155);
  color: var(--text-primary, #f1f5f9);
}

/* ===== HR/DIVIDERS ===== */
[data-theme="dark"] hr,
.dark hr,
[data-theme="dark"] .divider,
.dark .divider {
  border-color: var(--border-color, #334155);
}

/* ===== SCROLLBARS ===== */
[data-theme="dark"] ::-webkit-scrollbar,
.dark ::-webkit-scrollbar {
  background: var(--bg-secondary, #1e293b);
}

[data-theme="dark"] ::-webkit-scrollbar-thumb,
.dark ::-webkit-scrollbar-thumb {
  background: var(--border-color, #334155);
}

[data-theme="dark"] ::-webkit-scrollbar-thumb:hover,
.dark ::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted, #94a3b8);
}

/* ===== SPECIFIC COMPONENTS ===== */

/* Integration Cards */
[data-theme="dark"] .integration-card,
.dark .integration-card {
  background: var(--bg-card, #1e293b);
  border-color: var(--border-color, #334155);
}

/* Campaign Cards */
[data-theme="dark"] .campaign-card,
.dark .campaign-card {
  background: var(--bg-card, #1e293b);
  border-color: var(--border-color, #334155);
}

/* How It Works */
[data-theme="dark"] .how-it-works-item,
.dark .how-it-works-item {
  background: var(--bg-card, #1e293b);
  border-color: var(--border-color, #334155);
}

/* Status Badges */
[data-theme="dark"] .status-badge.active,
.dark .status-badge.active {
  background: rgba(16, 185, 129, 0.2);
  color: #10b981;
}

[data-theme="dark"] .status-badge.inactive,
.dark .status-badge.inactive {
  background: rgba(107, 114, 128, 0.2);
  color: #9ca3af;
}

/* Chat Components */
[data-theme="dark"] .chat-sidebar,
.dark .chat-sidebar,
[data-theme="dark"] .chat-window,
.dark .chat-window {
  background: var(--bg-card, #1e293b);
  border-color: var(--border-color, #334155);
}

[data-theme="dark"] .chat-item,
.dark .chat-item {
  border-color: var(--border-color, #334155);
}

[data-theme="dark"] .chat-item:hover,
.dark .chat-item:hover {
  background: var(--bg-hover, rgba(255, 255, 255, 0.05));
}

/* Stat Cards */
[data-theme="dark"] .stat-card,
.dark .stat-card {
  background: var(--bg-card, #1e293b);
  border-color: var(--border-color, #334155);
}

/* Page Headers */
[data-theme="dark"] .page-header,
.dark .page-header {
  border-bottom-color: var(--border-color, #334155);
}

/* Dashboard Sections */
[data-theme="dark"] .dashboard-section-header,
.dark .dashboard-section-header {
  border-bottom-color: var(--border-color, #334155);
}

/* Action Buttons */
[data-theme="dark"] .action-btn,
.dark .action-btn {
  background: transparent;
  border-color: var(--border-color, #334155);
  color: var(--text-secondary, #cbd5e1);
}

[data-theme="dark"] .action-btn:hover,
.dark .action-btn:hover {
  background: var(--bg-hover, rgba(255, 255, 255, 0.05));
  border-color: var(--primary-500, #667eea);
  color: var(--primary-500, #667eea);
}

/* Labels/Tags */
[data-theme="dark"] .label,
.dark .label,
[data-theme="dark"] .tag,
.dark .tag {
  background: rgba(102, 126, 234, 0.2);
  color: #a5b4fc;
}

/* Tooltips */
[data-theme="dark"] .tooltip,
.dark .tooltip {
  /* Dark tooltips already look good */
}

/* Loading States */
[data-theme="dark"] .spinner,
.dark .spinner,
[data-theme="dark"] .loading,
.dark .loading {
  border-color: var(--border-color, #334155);
  border-top-color: var(--primary-500, #667eea);
}

/* ============================================
   LANGUAGE SWITCHER MODAL
   Modern, accessible language selector
   ============================================ */

.ecosystem-lang-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  align-items: center;
  justify-content: center;
}

.ecosystem-lang-modal.ecosystem-lang-modal-open {
  display: flex;
}

.ecosystem-lang-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.ecosystem-lang-modal-box {
  position: relative;
  background: var(--bg-card, #ffffff);
  border-radius: 20px;
  padding: 2rem;
  max-width: 500px;
  width: 90%;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  animation: langModalSlideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes langModalSlideUp {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.95);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.ecosystem-lang-modal-header {
  text-align: center;
  margin-bottom: 2rem;
}

.ecosystem-lang-modal-title-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.ecosystem-lang-modal-globe {
  width: 32px;
  height: 32px;
  color: var(--primary-500, #667eea);
}

.ecosystem-lang-modal-globe svg {
  width: 100%;
  height: 100%;
}

.ecosystem-lang-modal-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary, #1f2937);
  margin: 0;
}

.ecosystem-lang-modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  font-size: 1.5rem;
  color: var(--text-muted, #9ca3af);
  cursor: pointer;
  border-radius: 8px;
  transition: all 0.2s ease;
}

.ecosystem-lang-modal-close:hover {
  background: var(--bg-secondary, #f9fafb);
  color: var(--text-primary, #1f2937);
  transform: rotate(90deg);
}

.ecosystem-lang-modal-subtitle {
  font-size: 0.9375rem;
  color: var(--text-secondary, #6b7280);
  margin: 0;
}

.ecosystem-lang-modal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

.ecosystem-lang-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  background: var(--bg-secondary, #f9fafb);
  border: 2px solid var(--border-color, #e5e7eb);
  border-radius: 12px;
  text-decoration: none;
  color: var(--text-primary, #1f2937);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.ecosystem-lang-card:hover {
  border-color: var(--primary-500, #667eea);
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.05), rgba(118, 75, 162, 0.05));
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
}

.ecosystem-lang-card-selected {
  border-color: var(--primary-500, #667eea);
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.1), rgba(118, 75, 162, 0.1));
}

.ecosystem-lang-card-check {
  width: 24px;
  height: 24px;
  color: var(--primary-500, #667eea);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.ecosystem-lang-card-selected .ecosystem-lang-card-check {
  opacity: 1;
}

.ecosystem-lang-card-check svg {
  width: 100%;
  height: 100%;
}

.ecosystem-lang-card-flag {
  font-size: 2rem;
  line-height: 1;
}

.ecosystem-lang-card-name {
  flex: 1;
  font-size: 1rem;
  font-weight: 600;
}

.ecosystem-lang-card-code {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted, #9ca3af);
  text-transform: uppercase;
}

/* Dark Mode */
[data-theme="dark"] .ecosystem-lang-modal-box,
.dark .ecosystem-lang-modal-box {
  background: var(--bg-card, #1e293b);
}

[data-theme="dark"] .ecosystem-lang-modal-title,
.dark .ecosystem-lang-modal-title {
  color: var(--text-primary, #f1f5f9);
}

[data-theme="dark"] .ecosystem-lang-modal-subtitle,
.dark .ecosystem-lang-modal-subtitle {
  color: var(--text-secondary, #cbd5e1);
}

[data-theme="dark"] .ecosystem-lang-card,
.dark .ecosystem-lang-card {
  background: var(--bg-tertiary, #334155);
  border-color: var(--border-color, #334155);
  color: var(--text-primary, #f1f5f9);
}

[data-theme="dark"] .ecosystem-lang-card:hover,
.dark .ecosystem-lang-card:hover {
  background: rgba(102, 126, 234, 0.1);
  border-color: var(--primary-500, #667eea);
}

[data-theme="dark"] .ecosystem-lang-modal-close,
.dark .ecosystem-lang-modal-close {
  color: var(--text-muted, #94a3b8);
}

[data-theme="dark"] .ecosystem-lang-modal-close:hover,
.dark .ecosystem-lang-modal-close:hover {
  background: var(--bg-tertiary, #334155);
  color: var(--text-primary, #f1f5f9);
}

/* Mobile Responsive */
@media (max-width: 640px) {
  .ecosystem-lang-modal-box {
    padding: 1.5rem;
    margin: 1rem;
  }

  .ecosystem-lang-modal-grid {
    grid-template-columns: 1fr;
  }

  .ecosystem-lang-modal-title {
    font-size: 1.25rem;
  }
}

/* ============================================
   FLOW BUILDER PAGE - FULL WIDTH FIX
   Ensure flow builder uses full available width
   ============================================ */

/* Main content layout for flow builder pages */
body.flow-builder-page .main-content,
body.flow-builder-page .main-content-body {
  margin-left: 0 !important;
  padding: 0 !important;
  width: 100% !important;
  max-width: 100% !important;
}

/* Flow builder should span full width */
.flow-builder-page-wrapper,
#flow-builder-page-wrapper {
  width: 100% !important;
  max-width: none !important;
  margin: 0 !important;
  border-radius: 0 !important;
  min-height: calc(100vh - 72px) !important;
  /* Account for header */
}

/* Ensure container takes full width */
#flow-builder-container,
#flow-builder-app {
  width: 100% !important;
  height: calc(100vh - 72px) !important;
}

/* Fix sidebar overlap issue */
.main-content {
  margin-left: var(--sidebar-width, 260px) !important;
  width: calc(100% - var(--sidebar-width, 260px)) !important;
}

.main-content-body {
  margin-left: 0 !important;
  padding: 0 !important;
  width: 100% !important;
}

/* Flow builder specific adjustments */
.flow-builder-edit-page .section {
  max-width: none !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* Action buttons at top */
.flow-builder-edit-page .d-flex.gap-2 {
  padding: 1rem 1.5rem;
  background: var(--bg-card, #ffffff);
  border-bottom: 1px solid var(--border-color, #e5e7eb);
}

/* Loading state */
#flow-builder-loading {
  min-height: calc(100vh - 200px) !important;
}

/* Error state */
#flow-builder-error {
  padding: 2rem !important;
}

/* Modal improvements */
.flow-builder-edit-page .modal-content {
  border-radius: 16px;
  border: none;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.flow-builder-edit-page .modal-header {
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.05), rgba(118, 75, 162, 0.05));
  border-bottom: 1px solid var(--border-color, #e5e7eb);
}

.flow-builder-edit-page .modal-footer {
  background: var(--bg-secondary, #f9fafb);
  border-top: 1px solid var(--border-color, #e5e7eb);
}

/* Button improvements */
.flow-builder-edit-page .btn-outline-secondary {
  border: 2px solid var(--border-color, #e5e7eb);
  border-radius: 10px;
  padding: 0.5rem 1rem;
  font-weight: 500;
  transition: all 0.2s ease;
}

.flow-builder-edit-page .btn-outline-secondary:hover {
  border-color: var(--primary-500, #667eea);
  color: var(--primary-500, #667eea);
  transform: translateY(-1px);
}

.flow-builder-edit-page .btn-outline-primary {
  border: 2px solid var(--primary-500, #667eea);
  border-radius: 10px;
  padding: 0.5rem 1rem;
  font-weight: 500;
  transition: all 0.2s ease;
}

.flow-builder-edit-page .btn-outline-primary:hover {
  background: var(--primary-500, #667eea);
  color: white;
  transform: translateY(-1px);
}

/* Mobile responsive */
@media (max-width: 1023px) {
  .main-content {
/* DUPLICATE */    margin-left: 0 !important;
    width: 100% !important;
  }

  .flow-builder-page-wrapper,
  #flow-builder-page-wrapper {
    min-height: calc(100vh - 64px) !important;
  }

  #flow-builder-container,
  #flow-builder-app {
    height: calc(100vh - 64px) !important;
  }

  .flow-builder-edit-page .d-flex.gap-2 {
    padding: 0.75rem 1rem;
    flex-wrap: wrap;
  }
}

/* Dark mode */
[data-theme=dark] .flow-builder-page-wrapper,
.dark .flow-builder-page-wrapper,
[data-theme=dark] #flow-builder-page-wrapper,
.dark #flow-builder-page-wrapper {
  background: var(--bg-secondary, #1e293b) !important;
  border-color: var(--border-color, #334155) !important;
}

[data-theme=dark] .flow-builder-edit-page .d-flex.gap-2,
.dark .flow-builder-edit-page .d-flex.gap-2 {
  background: var(--bg-card, #1e293b);
  border-color: var(--border-color, #334155);
}

[data-theme=dark] #flow-builder-loading p,
.dark #flow-builder-loading p {
  color: var(--text-secondary, #cbd5e1) !important;
}

/* ============================================
   RTL COMPLETE FIX - دعم كامل للعربية
   ============================================ */

/* ===== ROOT VARIABLES FOR RTL ===== */
[dir="rtl"] {
  --sidebar-margin: 0;
  --sidebar-margin-right: var(--sidebar-width, 260px);
}

[dir="ltr"] {
  --sidebar-margin: var(--sidebar-width, 260px);
  --sidebar-margin-right: 0;
}

/* ===== HEADER - 100% WIDTH FIX ===== */
.dashboard-header {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  width: 100% !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
  z-index: 1000 !important;
}

/* ===== MAIN CONTENT - RTL FIX ===== */
[dir="rtl"] .main-content {
  margin-left: 0 !important;
  margin-right: var(--sidebar-width, 260px) !important;
}

[dir="ltr"] .main-content {
  margin-left: var(--sidebar-width, 260px) !important;
  margin-right: 0 !important;
}

[dir="rtl"] .main-content-body {
  margin-left: 0 !important;
  margin-right: var(--sidebar-width, 260px) !important;
}

[dir="ltr"] .main-content-body {
  margin-left: var(--sidebar-width, 260px) !important;
  margin-right: 0 !important;
}

/* ===== SIDEBAR - RTL POSITION ===== */
[dir="rtl"] .main-sidebar {
  left: auto !important;
  right: 0 !important;
  border-right: none !important;
  border-left: 1px solid rgba(255, 255, 255, 0.08) !important;
  box-shadow: -2px 0 8px rgba(0, 0, 0, 0.1) !important;
}

[dir="rtl"] .main-sidebar.open {
  transform: translateX(0) !important;
}

@media (max-width: 1023px) {
  [dir="rtl"] .main-sidebar {
    transform: translateX(100%) !important;
  }

  [dir="rtl"] .main-sidebar.open {
    transform: translateX(0) !important;
  }
}

/* ===== SIDEBAR MENU - RTL ===== */
[dir="rtl"] .sidebar-menu .nav-link::before {
  left: auto !important;
  right: 0 !important;
}

[dir="rtl"] .sidebar-menu .nav-link:hover {
  transform: translateX(-4px) !important;
}

[dir="rtl"] .sidebar-menu .dropdown-menu {
  border-left: none !important;
  border-right: 2px solid rgba(102, 126, 234, 0.3) !important;
  margin-left: 0 !important;
  margin-right: 1rem !important;
  padding-left: 0 !important;
  padding-right: 2rem !important;
}

[dir="rtl"] .sidebar-menu .badge {
  margin-left: 0 !important;
  margin-right: auto !important;
}

/* ===== HEADER DROPDOWNS - RTL ===== */
[dir="rtl"] .dashboard-dropdown {
  left: 0 !important;
  right: auto !important;
}

[dir="rtl"] .dashboard-user-trigger {
  flex-direction: row-reverse !important;
}

[dir="rtl"] .dashboard-user-chevron {
  margin-left: 0 !important;
  margin-right: 0.5rem !important;
}

/* ===== BUTTONS - RTL ===== */
[dir="rtl"] .btn-modern,
[dir="rtl"] .btn {
  flex-direction: row-reverse !important;
}

[dir="rtl"] .btn-modern i,
[dir="rtl"] .btn i {
  margin-left: 0.5rem !important;
  margin-right: 0 !important;
}

/* ===== FORM INPUTS - RTL ===== */
[dir="rtl"] .input-with-icon .form-input,
[dir="rtl"] .input-with-icon .form-control {
  padding-left: 1rem !important;
  padding-right: 2.75rem !important;
}

[dir="rtl"] .input-with-icon .input-icon {
  left: auto !important;
  right: 1rem !important;
}

[dir="rtl"] .input-group .form-input,
[dir="rtl"] .input-group .form-control {
  border-radius: 12px 0 0 12px !important;
}

[dir="rtl"] .input-group-addon {
  border-left: 2px solid rgba(229, 231, 235, 0.8) !important;
  border-right: none !important;
  border-radius: 12px 0 0 12px !important;
}

/* ===== CARDS - RTL ===== */
[dir="rtl"] .card-modern-header,
[dir="rtl"] .info-card {
  text-align: right !important;
}

[dir="rtl"] .card-modern-actions {
  margin-left: 0 !important;
  margin-right: auto !important;
}

/* ===== TABLES - RTL ===== */
[dir="rtl"] .modern-table thead th,
[dir="rtl"] .modern-table tbody td {
  text-align: right !important;
}

[dir="rtl"] .action-buttons {
  justify-content: flex-start !important;
}

/* ===== MODALS - RTL ===== */
[dir="rtl"] .modal-header {
  flex-direction: row-reverse !important;
}

[dir="rtl"] .modal-footer {
  flex-direction: row-reverse !important;
}

[dir="rtl"] .modal-close {
  right: auto !important;
  left: 1rem !important;
}

/* ===== NAV TABS - RTL ===== */
[dir="rtl"] .nav-tabs {
  flex-direction: row-reverse !important;
}

[dir="rtl"] .nav-tabs .nav-link {
  margin-left: 0.5rem !important;
  margin-right: 0 !important;
}

/* ===== PAGINATION - RTL ===== */
[dir="rtl"] .pagination {
  flex-direction: row-reverse !important;
}

/* ===== INTEGRATION GRID - RTL ===== */
[dir="rtl"] .integration-card {
  text-align: center !important;
}

[dir="rtl"] .integration-icon {
  margin-left: auto !important;
  margin-right: auto !important;
}

/* ===== CAMPAIGN CARDS - RTL ===== */
[dir="rtl"] .campaign-header {
  flex-direction: row-reverse !important;
}

[dir="rtl"] .campaign-stats {
  direction: ltr !important;
}

/* ===== FLOW BUILDER - RTL ===== */
[dir="rtl"] .flow-builder-page-wrapper {
  direction: ltr !important;
}

[dir="rtl"] .flow-sidebar {
  left: 0 !important;
  right: auto !important;
  border-right: 1px solid rgba(255, 255, 255, 0.8) !important;
  border-left: none !important;
}

/* ===== EMPTY STATES - RTL ===== */
[dir="rtl"] .empty-state {
  text-align: center !important;
}

/* ===== SECTION - RTL ===== */
[dir="rtl"] .section {
  text-align: right !important;
}

[dir="rtl"] .section-title {
  text-align: right !important;
}

/* ===== DASHBOARD HEADER - RTL ===== */
[dir="rtl"] .dashboard-header-inner {
  flex-direction: row-reverse !important;
}

[dir="rtl"] .dashboard-header-start {
  order: 2 !important;
}

[dir="rtl"] .dashboard-header-end {
  order: 1 !important;
  flex-direction: row-reverse !important;
}

/* ===== MOBILE RESPONSIVE - RTL ===== */
@media (max-width: 1023px) {

  [dir="rtl"] .main-content,
  [dir="rtl"] .main-content-body {
    margin-left: 0 !important;
    margin-right: 0 !important;
  }

  [dir="rtl"] .dashboard-header-inner {
    padding-left: 16px !important;
    padding-right: 60px !important;
  }
}

/* ===== TEXT ALIGNMENT - RTL ===== */
[dir="rtl"] .text-left {
  text-align: right !important;
}

[dir="rtl"] .text-right {
  text-align: left !important;
}

[dir="rtl"] .ml-auto,
[dir="rtl"] .ms-auto {
  margin-left: 0 !important;
  margin-right: auto !important;
}

[dir="rtl"] .mr-auto,
[dir="rtl"] .me-auto {
  margin-right: 0 !important;
  margin-left: auto !important;
}

/* ===== FLEX DIRECTION - RTL ===== */
[dir="rtl"] .flex-row {
  flex-direction: row-reverse !important;
}

[dir="rtl"] .d-flex {
  flex-direction: row-reverse !important;
}

[dir="rtl"] .d-flex.keep-ltr {
  flex-direction: row !important;
}

/* ===== FLOAT - RTL ===== */
[dir="rtl"] .float-left {
  float: right !important;
}

[dir="rtl"] .float-right {
  float: left !important;
}

/* ===== PADDING/MARGIN - RTL ===== */
[dir="rtl"] .pl-3,
[dir="rtl"] .ps-3 {
  padding-left: 0 !important;
  padding-right: 1rem !important;
}

[dir="rtl"] .pr-3,
[dir="rtl"] .pe-3 {
  padding-right: 0 !important;
  padding-left: 1rem !important;
}

[dir="rtl"] .ml-3,
[dir="rtl"] .ms-3 {
  margin-left: 0 !important;
  margin-right: 1rem !important;
}

[dir="rtl"] .mr-3,
[dir="rtl"] .me-3 {
  margin-right: 0 !important;
  margin-left: 1rem !important;
}

/* ===== BORDER - RTL ===== */
[dir="rtl"] .border-left,
[dir="rtl"] .border-start {
  border-left: none !important;
  border-right: 1px solid var(--border-color, #e5e7eb) !important;
}

[dir="rtl"] .border-right,
[dir="rtl"] .border-end {
  border-right: none !important;
  border-left: 1px solid var(--border-color, #e5e7eb) !important;
}

/* ===== LIST ITEMS - RTL ===== */
[dir="rtl"] ul,
[dir="rtl"] ol {
  padding-left: 0 !important;
  padding-right: 2rem !important;
}

/* ===== CHECKBOX/RADIO - RTL ===== */
[dir="rtl"] .form-check {
  padding-left: 0 !important;
  padding-right: 1.75rem !important;
}

[dir="rtl"] .form-check-input {
  margin-left: 0 !important;
  margin-right: -1.75rem !important;
}

/* ===== SWITCH TOGGLE - RTL ===== */
[dir="rtl"] .form-switch {
  padding-left: 0 !important;
  padding-right: 2.5rem !important;
}

[dir="rtl"] .form-switch-input {
  margin-left: 0 !important;
  margin-right: -2.5rem !important;
}

/* ===== ICON MARGINS - RTL ===== */
[dir="rtl"] i.fas,
[dir="rtl"] i.far,
[dir="rtl"] i.fab {
  margin-left: 0.5rem !important;
  margin-right: 0 !important;
}

[dir="rtl"] i.fas:last-child,
[dir="rtl"] i.far:last-child,
[dir="rtl"] i.fab:last-child {
  margin-left: 0 !important;
  margin-right: 0 !important;
}

/* ===== SPECIFIC FIXES ===== */

/* Subscriber page */
[dir="rtl"] .subscriber-header {
  text-align: center !important;
}

[dir="rtl"] .info-card {
  text-align: right !important;
}

/* Language modal */
[dir="rtl"] .ecosystem-lang-modal-close {
  right: auto !important;
  left: 1rem !important;
}

[dir="rtl"] .ecosystem-lang-card {
  text-align: right !important;
}

/* Toast notifications */
[dir="rtl"] .toast-container {
  left: 1rem !important;
  right: auto !important;
}

[dir="rtl"] .toast {
  flex-direction: row-reverse !important;
}

/* ============================================
   RESPONSIVE COMPLETE FIX - All Devices
   ============================================ */

/* ===== MOBILE FIRST - Base Styles ===== */
* {
  box-sizing: border-box;
}

/* ===== SIDEBAR - Mobile Responsive ===== */
.main-sidebar {
  position: fixed !important;
  top: 0 !important;
  bottom: 0 !important;
  width: 260px !important;
  z-index: 1001 !important;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
}

/* LTR Sidebar */
[dir=ltr] .main-sidebar {
  left: 0 !important;
  right: auto !important;
  transform: translateX(-100%) !important;
}

[dir=ltr] .main-sidebar.open {
  transform: translateX(0) !important;
}

/* RTL Sidebar */
[dir=rtl] .main-sidebar {
  left: auto !important;
  right: 0 !important;
  transform: translateX(100%) !important;
}

[dir=rtl] .main-sidebar.open {
  transform: translateX(0) !important;
}

/* ===== OVERLAY FOR MOBILE SIDEBAR ===== */
.sidebar-overlay {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  background: rgba(0, 0, 0, 0.5) !important;
  z-index: 1000 !important;
  opacity: 0 !important;
  visibility: hidden !important;
  transition: all 0.3s ease !important;
}

.sidebar-overlay.active {
  opacity: 1 !important;
  visibility: visible !important;
}

/* ===== HEADER - Mobile Responsive ===== */
.dashboard-header {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  width: 100% !important;
  z-index: 999 !important;
  padding: 0 !important;
}

.dashboard-header-inner {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  padding: 0 1rem !important;
  height: 64px !important;
  width: 100% !important;
}

/* Mobile Header Adjustments */
@media (max-width: 1023px) {
  .dashboard-header-inner {
    padding: 0 0.75rem !important;
  }

  .dashboard-header-start {
    flex: 0 0 auto !important;
  }

  .dashboard-header-end {
    flex: 0 0 auto !important;
  }
}

@media (max-width: 640px) {
  .dashboard-header-inner {
    padding: 0 0.5rem !important;
    height: 56px !important;
  }

  .dashboard-header-start h1,
  .dashboard-header-start .page-title {
    font-size: 1rem !important;
  }
}

/* ===== MAIN CONTENT - Mobile Responsive ===== */
.main-content {
  min-height: 100vh !important;
  padding-top: 64px !important;
  transition: margin 0.3s ease !important;
}

@media (max-width: 640px) {
  .main-content {
    padding-top: 56px !important;
  }
}

/* Desktop: Add margin for sidebar */
@media (min-width: 1024px) {
  [dir=ltr] .main-content {
    margin-left: 260px !important;
    margin-right: 0 !important;
  }

  [dir=rtl] .main-content {
    margin-left: 0 !important;
    margin-right: 260px !important;
  }
}

/* Mobile: No sidebar margin */
@media (max-width: 1023px) {
  .main-content {
/* DUPLICATE */    margin-left: 0 !important;
    margin-right: 0 !important;
    width: 100% !important;
  }
}

/* ===== MAIN CONTENT BODY - Responsive ===== */
.main-content-body {
  width: 100% !important;
  padding: 1rem !important;
}

@media (min-width: 1024px) {
  [dir=ltr] .main-content-body {
    margin-left: 0 !important;
    margin-right: 0 !important;
  }

  [dir=rtl] .main-content-body {
    margin-left: 0 !important;
    margin-right: 0 !important;
  }
}

@media (max-width: 1023px) {
  .main-content-body {
    margin-left: 0 !important;
    margin-right: 0 !important;
    padding: 0.75rem !important;
  }
}

@media (max-width: 640px) {
  .main-content-body {
    padding: 0.5rem !important;
  }
}

/* ===== HAMBURGER MENU BUTTON ===== */
.sidebar-toggle,
.mobile-menu-toggle {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 40px !important;
  height: 40px !important;
  border: none !important;
  background: transparent !important;
  cursor: pointer !important;
  padding: 0 !important;
  z-index: 1002 !important;
}

@media (min-width: 1024px) {

  .sidebar-toggle,
  .mobile-menu-toggle {
    display: none !important;
  }
}

/* ===== SECTIONS - Mobile Responsive ===== */
.section {
  width: 100% !important;
  margin-bottom: 1.5rem !important;
}

@media (max-width: 1023px) {
  .section {
    margin-bottom: 1rem !important;
  }
}

@media (max-width: 640px) {
  .section {
    margin-bottom: 0.75rem !important;
  }
}

/* ===== CARDS - Mobile Responsive ===== */
.card-modern,
.info-card {
  width: 100% !important;
  margin-bottom: 1rem !important;
}

@media (max-width: 640px) {

  .card-modern,
  .info-card {
    margin-bottom: 0.75rem !important;
  }

  .card-modern-header {
    padding: 0.75rem !important;
    flex-direction: column !important;
    align-items: flex-start !important;
  }

  .card-modern-body {
    padding: 0.75rem !important;
  }
}

/* ===== BUTTONS - Mobile Responsive ===== */
.btn-modern {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 0.625rem 1.25rem !important;
  white-space: nowrap !important;
}

@media (max-width: 640px) {
  .btn-modern {
    padding: 0.5rem 1rem !important;
    font-size: 0.875rem !important;
  }

  .btn-modern i {
    font-size: 1rem !important;
  }
}

/* Button Groups */
@media (max-width: 640px) {

  .btn-group,
  .action-buttons {
    flex-direction: column !important;
    width: 100% !important;
  }

  .btn-group .btn-modern,
  .action-buttons .btn-modern {
    width: 100% !important;
    margin: 0.25rem 0 !important;
  }
}

/* ===== FORMS - Mobile Responsive ===== */
.form-group {
  margin-bottom: 1rem !important;
}

@media (max-width: 640px) {
  .form-group {
    margin-bottom: 0.75rem !important;
  }

  .form-input,
  .form-control {
    font-size: 16px !important;
    /* Prevents iOS zoom */
  }

  .input-group {
    flex-direction: column !important;
  }

  .input-group .form-input,
  .input-group .form-control {
    width: 100% !important;
    border-radius: 12px !important;
    margin-bottom: 0.5rem !important;
  }

  .input-group-addon {
    width: 100% !important;
    border-radius: 12px !important;
  }
}

/* ===== GRIDS - Mobile Responsive ===== */
.grid-modern {
  display: grid !important;
  gap: 1rem !important;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)) !important;
}

@media (max-width: 1023px) {
  .grid-modern {
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)) !important;
    gap: 0.75rem !important;
  }
}

@media (max-width: 640px) {
  .grid-modern {
    grid-template-columns: 1fr !important;
    gap: 0.5rem !important;
  }
}

/* Integration Grid */
.integration-grid {
  display: grid !important;
  gap: 1rem !important;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)) !important;
}

@media (max-width: 768px) {
  .integration-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)) !important;
    gap: 0.75rem !important;
  }
}

@media (max-width: 640px) {
  .integration-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.5rem !important;
  }
}

/* ===== TABLES - Mobile Responsive ===== */
@media (max-width: 768px) {

  .modern-table-wrapper,
  .table-responsive {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
  }

  .modern-table {
    min-width: 600px !important;
  }

  .modern-table thead th,
  .modern-table tbody td {
    padding: 0.75rem 0.5rem !important;
    font-size: 0.875rem !important;
  }
}

@media (max-width: 640px) {

  .modern-table thead th,
  .modern-table tbody td {
    padding: 0.5rem 0.375rem !important;
    font-size: 0.8125rem !important;
  }

  .action-buttons {
    flex-direction: row !important;
    flex-wrap: wrap !important;
  }
}

/* ===== MODALS - Mobile Responsive ===== */
.modal-modern {
  padding: 0 !important;
}

.modal-modern-content {
  width: 95% !important;
  max-width: 500px !important;
  max-height: 90vh !important;
  margin: 2.5vh auto !important;
}

@media (max-width: 640px) {
  .modal-modern-content {
    width: 100% !important;
    max-width: 100% !important;
    max-height: 100vh !important;
    margin: 0 !important;
    border-radius: 0 !important;
    min-height: 100vh !important;
  }

  .modal-modern-header {
    padding: 1rem !important;
  }

  .modal-modern-body {
    padding: 1rem !important;
    max-height: calc(100vh - 140px) !important;
    overflow-y: auto !important;
  }

  .modal-modern-footer {
    padding: 1rem !important;
    flex-direction: column !important;
  }

  .modal-modern-footer .btn-modern {
    width: 100% !important;
    margin: 0.25rem 0 !important;
  }
}

/* ===== NAV TABS - Mobile Responsive ===== */
.nav-tabs {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 0.5rem !important;
}

@media (max-width: 640px) {
  .nav-tabs {
    flex-direction: column !important;
  }

  .nav-tabs .nav-link {
    width: 100% !important;
    text-align: center !important;
  }
}

/* ===== PAGINATION - Mobile Responsive ===== */
.pagination {
  display: flex !important;
  flex-wrap: wrap !important;
  justify-content: center !important;
  gap: 0.25rem !important;
}

@media (max-width: 640px) {
  .pagination {
    gap: 0.125rem !important;
  }

  .pagination .page-item {
    flex: 0 0 auto !important;
  }

  .pagination .page-link {
    padding: 0.5rem 0.75rem !important;
    font-size: 0.875rem !important;
  }
}

/* ===== DROPDOWNS - Mobile Responsive ===== */
@media (max-width: 640px) {
  .dashboard-dropdown {
    position: fixed !important;
    top: 56px !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    max-height: calc(100vh - 56px) !important;
    border-radius: 0 !important;
    overflow-y: auto !important;
  }
}

/* ===== FLOW BUILDER - Mobile Responsive ===== */
@media (max-width: 1023px) {
  .flow-builder-page-wrapper {
    margin-left: 0 !important;
    margin-right: 0 !important;
  }

  .flow-builder-edit-page .d-flex.gap-2 {
    flex-wrap: wrap !important;
    padding: 0.5rem !important;
  }

  .flow-builder-edit-page .btn-modern {
    flex: 1 1 auto !important;
    min-width: 120px !important;
  }
}

@media (max-width: 640px) {
  .flow-builder-edit-page .d-flex.gap-2 {
    padding: 0.375rem !important;
  }

  .flow-builder-edit-page .btn-modern {
    font-size: 0.75rem !important;
    padding: 0.375rem 0.75rem !important;
  }
}

/* ===== EMPTY STATES - Mobile Responsive ===== */
.empty-state {
  padding: 2rem 1rem !important;
}

@media (max-width: 640px) {
  .empty-state {
    padding: 1.5rem 0.75rem !important;
  }

  .empty-state-icon {
    font-size: 3rem !important;
  }

  .empty-state-title {
    font-size: 1.125rem !important;
  }

  .empty-state-description {
    font-size: 0.875rem !important;
  }
}

/* ===== STAT CARDS - Mobile Responsive ===== */
.stat-card-grid {
  display: grid !important;
  gap: 1rem !important;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)) !important;
}

@media (max-width: 768px) {
  .stat-card-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}

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

/* ===== LANGUAGE MODAL - Mobile Responsive ===== */
.ecosystem-lang-modal-content {
  width: 95% !important;
  max-width: 500px !important;
}

@media (max-width: 640px) {
  .ecosystem-lang-modal-content {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    max-height: 100vh !important;
  }

  .ecosystem-lang-modal-header {
    padding: 1rem !important;
  }

  .ecosystem-lang-modal-body {
    padding: 1rem !important;
  }

  .ecosystem-lang-grid {
    grid-template-columns: 1fr !important;
  }
}

/* ===== NOTIFICATIONS - Mobile Responsive ===== */
@media (max-width: 640px) {
  .notification-dropdown {
    position: fixed !important;
    top: 56px !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    max-height: calc(100vh - 56px) !important;
  }
}

/* ===== UTILITY CLASSES - Mobile ===== */
@media (max-width: 1023px) {
  .hide-mobile {
    display: none !important;
  }
}

@media (min-width: 1024px) {
  .show-mobile-only {
    display: none !important;
  }
}

/* ===== TOUCH TARGETS - Accessibility ===== */
@media (max-width: 1023px) {

  button,
  .btn,
  .btn-modern,
  a.nav-link,
  .clickable {
    min-height: 44px !important;
    min-width: 44px !important;
  }
}

/* ===== SAFE AREA - iOS ===== */
@supports (padding: max(0px)) {
  .main-content {
    padding-left: max(1rem, env(safe-area-inset-left)) !important;
    padding-right: max(1rem, env(safe-area-inset-right)) !important;
  }

  .dashboard-header {
    padding-top: max(0px, env(safe-area-inset-top)) !important;
  }

  .main-sidebar {
    padding-bottom: max(1rem, env(safe-area-inset-bottom)) !important;
  }
}

/* ===== PRINT STYLES ===== */
@media print {

  .main-sidebar,
  .dashboard-header,
  .sidebar-toggle,
  .sidebar-overlay {
    display: none !important;
  }

  .main-content {
/* DUPLICATE */    margin-left: 0 !important;
    margin-right: 0 !important;
    padding-top: 0 !important;
  }
}

/* ===== MOBILE OVERLAY FIX ===== */
.mobile-overlay {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  background: rgba(0, 0, 0, 0.5) !important;
  z-index: 1000 !important;
  opacity: 0 !important;
  visibility: hidden !important;
  transition: all 0.3s ease !important;
}

.mobile-overlay.active {
  opacity: 1 !important;
  visibility: visible !important;
}

/* ===== MOBILE MENU TOGGLE BUTTON ===== */
.mobile-menu-toggle {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 40px !important;
  height: 40px !important;
  border: none !important;
  background: transparent !important;
  cursor: pointer !important;
  padding: 0 !important;
  z-index: 1002 !important;
  color: inherit !important;
  font-size: 1.25rem !important;
}

.mobile-menu-toggle:hover {
  background: rgba(0, 0, 0, 0.05) !important;
}

[data-theme=dark] .mobile-menu-toggle:hover {
  background: rgba(255, 255, 255, 0.05) !important;
}

@media (min-width: 1024px) {
  .mobile-menu-toggle {
    display: none !important;
  }
}

/* ===== RESPONSIVE FIXES FOR SPECIFIC PAGES ===== */

/* Subscriber Page */
@media (max-width: 1023px) {
  .subscriber-page .info-card {
    margin-bottom: 0.75rem !important;
  }

  .subscriber-page .info-card-header {
    flex-direction: column !important;
    align-items: flex-start !important;
  }

  .subscriber-page .info-card-stats {
    width: 100% !important;
    grid-template-columns: repeat(2, 1fr) !important;
  }
}

@media (max-width: 640px) {
  .subscriber-page .info-card-stats {
    grid-template-columns: 1fr !important;
  }
}

/* Campaign Page */
@media (max-width: 1023px) {
  .campaign-page .campaign-header {
    flex-direction: column !important;
    align-items: flex-start !important;
  }

  .campaign-page .campaign-actions {
    width: 100% !important;
    margin-top: 1rem !important;
  }
}

/* Integration Page */
@media (max-width: 640px) {
  .integration-page .integration-card {
    padding: 1rem !important;
  }

  .integration-page .integration-icon {
    width: 48px !important;
    height: 48px !important;
  }
}

/* Dashboard Page */
@media (max-width: 1023px) {
  .dashboard-stats-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}

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

  .dashboard-quick-actions {
    flex-direction: column !important;
  }

  .dashboard-quick-actions .btn-modern {
    width: 100% !important;
  }
}

/* ===== FIX: Prevent horizontal scroll ===== */
html,
body {
  overflow-x: hidden !important;
  max-width: 100vw !important;
}

.main-content,
.main-content-body,
.section {
  max-width: 100% !important;
  overflow-x: hidden !important;
}

/* ===== FIX: Images responsive ===== */
img {
  max-width: 100% !important;
  height: auto !important;
}

/* ===== FIX: Iframes responsive ===== */
iframe {
  max-width: 100% !important;
}

/* ===== FIX: Pre/code responsive ===== */
pre,
code {
  max-width: 100% !important;
  overflow-x: auto !important;
}

/* ============================================
   COMPLETE RESPONSIVE FIX FOR ALL PAGES
   ============================================ */

/* ===== PAGE HEADERS - Responsive ===== */
.page-header {
  margin-bottom: 1.5rem !important;
}

@media (max-width: 640px) {
  .page-header {
    margin-bottom: 1rem !important;
  }

  .page-title {
    font-size: 1.5rem !important;
  }

  .page-subtitle {
    font-size: 0.875rem !important;
  }
}

/* ===== FLEX UTILITIES - Responsive ===== */
@media (max-width: 640px) {
  .flex {
    flex-direction: column !important;
  }

  .flex.wrap-mobile {
    flex-wrap: wrap !important;
  }

  .flex.justify-between {
    justify-content: flex-start !important;
  }

  .flex.items-center {
    align-items: flex-start !important;
  }

  .flex.gap-2,
  .flex.gap-3,
  .flex.gap-4 {
    gap: 0.5rem !important;
  }

  .flex>* {
    width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }
}

/* Keep some flex items inline */
@media (max-width: 640px) {
  .flex.keep-inline {
    flex-direction: row !important;
  }

  .flex.keep-inline>* {
    width: auto !important;
  }
}

/* ===== TABS - Responsive ===== */
.tabs {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 0.5rem !important;
  border-bottom: 2px solid var(--border-color, #e5e7eb) !important;
  margin-bottom: 1.5rem !important;
}

@media (max-width: 640px) {
  .tabs {
    flex-direction: column !important;
    border-bottom: none !important;
    gap: 0.25rem !important;
  }

  .tab {
    width: 100% !important;
    text-align: center !important;
    border-bottom: 1px solid var(--border-color, #e5e7eb) !important;
    border-radius: 0 !important;
  }
}

/* ===== TABLE CONTAINERS - Responsive ===== */
.table-container {
  width: 100% !important;
  overflow-x: auto !important;
  -webkit-overflow-scrolling: touch !important;
}

@media (max-width: 1023px) {
  .table-container {
    margin: 0 -1rem !important;
    padding: 0 1rem !important;
  }
}

@media (max-width: 640px) {
  .table-container {
    margin: 0 -0.5rem !important;
    padding: 0 0.5rem !important;
  }

  .table {
    min-width: 600px !important;
    font-size: 0.875rem !important;
  }

  .table thead th,
  .table tbody td {
    padding: 0.75rem 0.5rem !important;
    white-space: nowrap !important;
  }
}

/* ===== SUBSCRIBER PAGE - Responsive ===== */
@media (max-width: 640px) {
  .subscriber-avatar {
    width: 32px !important;
    height: 32px !important;
    font-size: 0.875rem !important;
  }

  .subscriber-platform {
    padding: 0.25rem 0.5rem !important;
    font-size: 0.75rem !important;
  }

  .badge {
    font-size: 0.75rem !important;
    padding: 0.125rem 0.5rem !important;
  }
}

/* ===== INTEGRATION GRID - Responsive ===== */
.integration-grid {
  display: grid !important;
  gap: 1rem !important;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)) !important;
}

.integration-grid.cols-4 {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)) !important;
}

@media (max-width: 768px) {
  .integration-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.75rem !important;
  }
}

@media (max-width: 480px) {
  .integration-grid {
    grid-template-columns: 1fr !important;
    gap: 0.5rem !important;
  }

  .integration-card {
    padding: 1rem !important;
  }

  .integration-icon {
    width: 48px !important;
    height: 48px !important;
    font-size: 1.5rem !important;
  }
}

/* ===== ALERTS - Responsive ===== */
.alert {
  padding: 1rem !important;
  display: flex !important;
  gap: 1rem !important;
}

@media (max-width: 640px) {
  .alert {
    flex-direction: column !important;
    padding: 0.75rem !important;
  }

  .alert-icon {
    width: 40px !important;
    height: 40px !important;
  }

  .alert-title {
    font-size: 1rem !important;
  }

  .alert-message {
    font-size: 0.875rem !important;
  }
}

/* ===== BUTTON GROUPS - Responsive ===== */
@media (max-width: 640px) {
  .btn-group {
    flex-direction: column !important;
    width: 100% !important;
  }

  .btn-group .btn {
    width: 100% !important;
    margin: 0.25rem 0 !important;
  }

  .btn {
    padding: 0.5rem 1rem !important;
    font-size: 0.875rem !important;
  }

  .btn i {
    margin-right: 0.5rem !important;
  }

  [dir=rtl] .btn i {
    margin-right: 0 !important;
    margin-left: 0.5rem !important;
  }
}

/* ===== FORM ROWS - Responsive ===== */
.form-row {
  display: flex !important;
  gap: 1rem !important;
  margin-bottom: 1rem !important;
}

@media (max-width: 768px) {
  .form-row {
    flex-direction: column !important;
    gap: 0.75rem !important;
  }

  .form-row>* {
    width: 100% !important;
  }
}

/* ===== STATS GRID - Responsive ===== */
.stats-grid {
  display: grid !important;
  gap: 1rem !important;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)) !important;
}

@media (max-width: 768px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}

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

/* ===== ACTIVITY LIST - Responsive ===== */
.activity-list {
  display: flex !important;
  flex-direction: column !important;
  gap: 0.75rem !important;
}

.activity-item {
  display: flex !important;
  gap: 1rem !important;
  padding: 0.75rem !important;
  background: var(--bg-secondary, #f8fafc) !important;
  border-radius: 0.75rem !important;
}

@media (max-width: 640px) {
  .activity-item {
    flex-direction: column !important;
    gap: 0.5rem !important;
    padding: 0.5rem !important;
  }

  .activity-icon {
    width: 36px !important;
    height: 36px !important;
  }

  .activity-title {
    font-size: 0.875rem !important;
  }

  .activity-time {
    font-size: 0.75rem !important;
  }
}

/* ===== LIVECHAT - Responsive ===== */
@media (max-width: 1023px) {
  .livechat-container {
    flex-direction: column !important;
  }

  .livechat-sidebar {
    width: 100% !important;
    max-height: 300px !important;
    overflow-y: auto !important;
  }

  .livechat-main {
    width: 100% !important;
  }
}

/* ===== BROADCAST PAGE - Responsive ===== */
@media (max-width: 640px) {
  .broadcast-header {
    flex-direction: column !important;
    align-items: flex-start !important;
  }

  .broadcast-actions {
    width: 100% !important;
    margin-top: 1rem !important;
  }

  .broadcast-stats {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}

/* ===== SETTINGS PAGE - Responsive ===== */
@media (max-width: 1023px) {
  .settings-layout {
    flex-direction: column !important;
  }

  .settings-nav {
    width: 100% !important;
    margin-bottom: 1.5rem !important;
  }

  .settings-nav ul {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 0.5rem !important;
  }

  .settings-nav li {
    flex: 1 1 auto !important;
  }

  .settings-content {
    width: 100% !important;
  }
}

/* ===== COMMENT AUTOMATION - Responsive ===== */
@media (max-width: 768px) {
  .campaign-card {
    flex-direction: column !important;
  }

  .campaign-info {
    width: 100% !important;
  }

  .campaign-stats {
    width: 100% !important;
    flex-direction: row !important;
    flex-wrap: wrap !important;
  }
}

/* ===== MESSAGE TEMPLATES - Responsive ===== */
@media (max-width: 768px) {
  .template-grid {
    grid-template-columns: 1fr !important;
  }

  .template-card {
    padding: 1rem !important;
  }
}

/* ===== TEAM PAGE - Responsive ===== */
@media (max-width: 640px) {
  .team-member-card {
    flex-direction: column !important;
    text-align: center !important;
  }

  .team-member-avatar {
    margin: 0 auto 1rem !important;
  }

  .team-member-actions {
    width: 100% !important;
    justify-content: center !important;
  }
}

/* ===== PACKAGES PAGE - Responsive ===== */
@media (max-width: 768px) {
  .packages-grid {
    grid-template-columns: 1fr !important;
  }

  .package-card {
    margin-bottom: 1rem !important;
  }

  .package-features {
    font-size: 0.875rem !important;
  }
}

/* ===== ANALYTICS PAGE - Responsive ===== */
@media (max-width: 768px) {
  .analytics-header {
    flex-direction: column !important;
  }

  .date-range-picker {
    width: 100% !important;
    margin-top: 1rem !important;
  }

  .chart-container {
    height: 250px !important;
  }
}

@media (max-width: 640px) {
  .chart-container {
    height: 200px !important;
  }

  .chart-legend {
    flex-direction: column !important;
    align-items: flex-start !important;
  }
}

/* ===== BLOG PAGE - Responsive ===== */
@media (max-width: 768px) {
  .blog-post-card {
    flex-direction: column !important;
  }

  .blog-post-image {
    width: 100% !important;
    height: 200px !important;
  }
}

/* ===== ADDONS PAGE - Responsive ===== */
@media (max-width: 768px) {
  .addons-grid {
    grid-template-columns: 1fr !important;
  }

  .addon-card {
    padding: 1rem !important;
  }
}

/* ===== EMPTY STATES - Responsive ===== */
.empty-state {
  padding: 3rem 1.5rem !important;
  text-align: center !important;
}

@media (max-width: 640px) {
  .empty-state {
    padding: 2rem 1rem !important;
  }

  .empty-state-icon {
    font-size: 3rem !important;
    margin-bottom: 1rem !important;
  }

  .empty-state-title {
    font-size: 1.25rem !important;
    margin-bottom: 0.5rem !important;
  }

  .empty-state-text {
    font-size: 0.875rem !important;
    margin-bottom: 1.5rem !important;
  }

  .empty-state .btn {
    width: 100% !important;
  }
}

/* ===== PAGINATION - Responsive ===== */
@media (max-width: 640px) {
  .pagination {
    justify-content: center !important;
  }

  .pagination .page-item {
    display: none !important;
  }

  .pagination .page-item:first-child,
  .pagination .page-item:last-child,
  .pagination .page-item.active {
    display: block !important;
  }

  .pagination .page-link {
    padding: 0.5rem 0.75rem !important;
    font-size: 0.875rem !important;
  }
}

/* ===== SEARCH BAR - Responsive ===== */
@media (max-width: 640px) {
  .search-bar {
    width: 100% !important;
    margin-bottom: 1rem !important;
  }

  .search-input {
    font-size: 16px !important;
    /* Prevent iOS zoom */
  }
}

/* ===== FILTER BAR - Responsive ===== */
.filter-bar {
  display: flex !important;
  gap: 1rem !important;
  flex-wrap: wrap !important;
  margin-bottom: 1.5rem !important;
}

@media (max-width: 640px) {
  .filter-bar {
    flex-direction: column !important;
    gap: 0.75rem !important;
  }

  .filter-bar>* {
    width: 100% !important;
  }
}

/* ===== FIX: Prevent content overflow ===== */
.section,
.card-modern,
.card-modern-body {
  max-width: 100% !important;
  overflow-wrap: break-word !important;
  word-wrap: break-word !important;
}

/* ===== FIX: Images in content ===== */
.card-modern-body img {
  max-width: 100% !important;
  height: auto !important;
}

/* ===== FIX: Long text/URLs ===== */
.card-modern-body {
  overflow-x: auto !important;
}

/* ===== RTL FIXES FOR MOBILE ===== */
@media (max-width: 1023px) {
  [dir=rtl] .flex {
    flex-direction: column !important;
  }

  [dir=rtl] .btn i {
    margin-left: 0.5rem !important;
    margin-right: 0 !important;
  }
}

/* ===== SPECIFIC PAGE FIXES ===== */

/* Flow Builder List Page */
@media (max-width: 768px) {
  .flow-list-item {
    flex-direction: column !important;
    align-items: flex-start !important;
  }

  .flow-list-actions {
    width: 100% !important;
    margin-top: 1rem !important;
    justify-content: flex-end !important;
  }
}

/* User Management Page */
@media (max-width: 640px) {
  .user-card {
    flex-direction: column !important;
    text-align: center !important;
  }

  .user-avatar {
    margin: 0 auto 1rem !important;
  }

  .user-info {
    width: 100% !important;
  }

  .user-actions {
    width: 100% !important;
    justify-content: center !important;
  }
}

/* Email/SMS Pages */
@media (max-width: 640px) {
  .message-compose {
    padding: 1rem !important;
  }

  .message-recipients {
    max-height: 200px !important;
  }
}

/* ===== SIDEBAR VISIBILITY FIX ===== */
@media (min-width: 1024px) {

  /* Desktop: Always show sidebar */
  .main-sidebar {
    transform: translateX(0) !important;
  }

  [dir=ltr] .main-sidebar {
    transform: translateX(0) !important;
  }

  [dir=rtl] .main-sidebar {
    transform: translateX(0) !important;
  }
}

/* Ensure sidebar is visible */
.main-sidebar {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
}

/* ===== SIDEBAR FINAL FIX - Desktop Always Visible ===== */
@media (min-width: 1024px) {

  .main-sidebar,
  [dir=ltr] .main-sidebar,
  [dir=rtl] .main-sidebar {
    transform: translateX(0) !important;
    left: 0 !important;
    right: auto !important;
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
  }

  [dir=rtl] .main-sidebar {
    left: auto !important;
    right: 0 !important;
  }
}

/* Make sure sidebar is visible on all screens */
.main-sidebar {
  display: flex !important;
  visibility: visible !important;
  opacity: 1 !important;
}

/* ===== PASSWORD FIELD - Eye Icon Inside ===== */
.input-wrapper {
  position: relative !important;
  display: flex !important;
  align-items: center !important;
}

.input-wrapper>.form-input,
.input-wrapper>.form-control {
  padding-right: 2.75rem !important;
  padding-left: 2.75rem !important;
}

[dir="rtl"] .input-wrapper>.form-input,
[dir="rtl"] .input-wrapper>.form-control {
  padding-right: 2.75rem !important;
  padding-left: 2.75rem !important;
}

/* Icon on the left */
.input-wrapper>i:first-child {
  position: absolute !important;
  left: 1rem !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  color: #94a3b8 !important;
  pointer-events: none !important;
}

[dir="rtl"] .input-wrapper>i:first-child {
  left: auto !important;
  right: 1rem !important;
}

/* Toggle button on the right */
.input-wrapper>.toggle-password {
  position: absolute !important;
  right: 0.5rem !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  background: none !important;
  border: none !important;
  cursor: pointer !important;
  color: #94a3b8 !important;
  padding: 0.5rem !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  z-index: 10 !important;
}

[dir="rtl"] .input-wrapper>.toggle-password {
  right: auto !important;
  left: 0.5rem !important;
}

.input-wrapper>.toggle-password:hover {
  color: #667eea !important;
}

.input-wrapper>.toggle-password i {
  font-size: 1rem !important;
}

/* Fix for login page specifically */
.login-card .input-wrapper>.form-input,
.login-card .input-wrapper>.form-control {
  padding-right: 3rem !important;
}

.login-card .input-wrapper>.toggle-password {
  right: 0.75rem !important;
}

[dir="rtl"] .login-card .input-wrapper>.toggle-password {
  right: auto !important;
  left: 0.75rem !important;
}

/* ===== UNIFIED DESIGN SYSTEM APPLIED ===== */
/* ============================================
   UNIFIED DESIGN SYSTEM - All Pages
   ============================================ */

/* ===== ROOT VARIABLES ===== */
:root {
  --sidebar-width: 260px;
  --header-height: 64px;
  --content-max-width: 1400px;
  --spacing-base: 1.5rem;
  --spacing-mobile: 1rem;
}

/* ===== GLOBAL RESET ===== */
* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  overflow-x: hidden;
}

/* ===== APP WRAPPER ===== */
.app-wrapper {
  display: flex;
  min-height: 100vh;
  width: 100%;
}

/* ===== SIDEBAR - Consistent Across All Pages ===== */
.main-sidebar {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  width: var(--sidebar-width) !important;
  height: 100vh !important;
  z-index: 1001 !important;
  flex-shrink: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%) !important;
  box-shadow: 2px 0 8px rgba(0, 0, 0, 0.1) !important;
}

[dir=rtl] .main-sidebar {
  left: auto !important;
  right: 0 !important;
  box-shadow: -2px 0 8px rgba(0, 0, 0, 0.1) !important;
}

/* Desktop: Always show sidebar */
@media (min-width: 1024px) {
  .main-sidebar {
    transform: translateX(0) !important;
  }
}

/* Mobile: Hide sidebar by default */
@media (max-width: 1023px) {
  .main-sidebar {
    transform: translateX(-100%) !important;
  }

  [dir=rtl] .main-sidebar {
    transform: translateX(100%) !important;
  }

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

/* ===== MAIN CONTENT - Consistent Layout ===== */
.main-content {
  width: 100% !important;
  min-height: 100vh !important;
  padding-top: var(--header-height) !important;
  display: flex !important;
  flex-direction: column !important;
}

/* Desktop: Add margin for sidebar */
@media (min-width: 1024px) {
  [dir=ltr] .main-content {
    margin-left: var(--sidebar-width) !important;
    margin-right: 0 !important;
  }

  [dir=rtl] .main-content {
    margin-left: 0 !important;
    margin-right: var(--sidebar-width) !important;
  }
}

/* Mobile: Full width */
@media (max-width: 1023px) {
  .main-content {
/* DUPLICATE */    margin-left: 0 !important;
    margin-right: 0 !important;
  }
}

/* ===== MAIN CONTENT BODY - Consistent Padding ===== */
.main-content-body {
  flex: 1 !important;
  width: 100% !important;
  max-width: var(--content-max-width) !important;
  margin: 0 auto !important;
  padding: var(--spacing-base) !important;
}

@media (max-width: 1023px) {
  .main-content-body {
    padding: var(--spacing-mobile) !important;
  }
}

@media (max-width: 640px) {
  .main-content-body {
    padding: 0.75rem !important;
  }
}

/* ===== SECTIONS - Consistent Container ===== */
.section {
  width: 100% !important;
  max-width: 100% !important;
  margin-bottom: var(--spacing-base) !important;
}

@media (max-width: 1023px) {
  .section {
    margin-bottom: var(--spacing-mobile) !important;
  }
}

/* ===== HEADER - Fixed Position ===== */
.dashboard-header {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  height: var(--header-height) !important;
  z-index: 1000 !important;
  display: flex !important;
  align-items: center !important;
  padding: 0 var(--spacing-base) !important;
  background: rgba(255, 255, 255, 0.95) !important;
  backdrop-filter: blur(10px) !important;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05) !important;
}

[data-theme=dark] .dashboard-header {
  background: rgba(15, 23, 42, 0.95) !important;
  border-bottom-color: rgba(255, 255, 255, 0.05) !important;
}

/* Desktop: Add margin for sidebar */
@media (min-width: 1024px) {
  [dir=ltr] .dashboard-header {
    left: var(--sidebar-width) !important;
  }

  [dir=rtl] .dashboard-header {
    right: var(--sidebar-width) !important;
  }
}

/* Mobile: Full width */
@media (max-width: 1023px) {
  .dashboard-header {
    left: 0 !important;
    right: 0 !important;
    padding: 0 1rem !important;
  }
}

@media (max-width: 640px) {
  .dashboard-header {
    height: 56px !important;
    padding: 0 0.75rem !important;
  }
}

/* ===== PAGE HEADER - Consistent Title Area ===== */
.page-header {
  margin-bottom: var(--spacing-base) !important;
  padding-bottom: 1rem !important;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05) !important;
}

[data-theme=dark] .page-header {
  border-bottom-color: rgba(255, 255, 255, 0.05) !important;
}

.page-title {
  font-size: 1.75rem !important;
  font-weight: 700 !important;
  margin: 0 0 0.5rem 0 !important;
  display: flex !important;
  align-items: center !important;
  gap: 0.75rem !important;
}

@media (max-width: 640px) {
  .page-title {
    font-size: 1.5rem !important;
  }
}

.page-subtitle {
  font-size: 0.9375rem !important;
  color: #64748b !important;
  margin: 0 !important;
}

/* ===== CARDS - Consistent Component ===== */
.card-modern {
  background: #ffffff !important;
  border-radius: 12px !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05) !important;
  border: 1px solid rgba(0, 0, 0, 0.05) !important;
  margin-bottom: var(--spacing-base) !important;
  overflow: hidden !important;
}

[data-theme=dark] .card-modern {
  background: #1e293b !important;
  border-color: rgba(255, 255, 255, 0.05) !important;
}

.card-modern-header {
  padding: 1.25rem 1.5rem !important;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  flex-wrap: wrap !important;
  gap: 1rem !important;
}

[data-theme=dark] .card-modern-header {
  border-bottom-color: rgba(255, 255, 255, 0.05) !important;
}

.card-modern-title {
  font-size: 1.125rem !important;
  font-weight: 600 !important;
  margin: 0 !important;
  display: flex !important;
  align-items: center !important;
  gap: 0.5rem !important;
}

.card-modern-body {
  padding: 1.5rem !important;
}

@media (max-width: 640px) {

  .card-modern-header,
  .card-modern-body {
    padding: 1rem !important;
  }
}

/* ===== FORMS - Consistent Inputs ===== */
.form-group {
  margin-bottom: 1.25rem !important;
}

.form-label {
  display: block !important;
  font-size: 0.875rem !important;
  font-weight: 600 !important;
  margin-bottom: 0.5rem !important;
  color: #374151 !important;
}

[data-theme=dark] .form-label {
  color: #cbd5e1 !important;
}

.form-input,
.form-control {
  width: 100% !important;
  padding: 0.75rem 1rem !important;
  border: 2px solid #e2e8f0 !important;
  border-radius: 10px !important;
  font-size: 0.9375rem !important;
  background: #ffffff !important;
  transition: all 0.2s ease !important;
}

[data-theme=dark] .form-input,
[data-theme=dark] .form-control {
  background: #0f172a !important;
  border-color: #334155 !important;
  color: #f1f5f9 !important;
}

.form-input:focus,
.form-control:focus {
  outline: none !important;
  border-color: #667eea !important;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1) !important;
}

/* ===== BUTTONS - Consistent Actions ===== */
.btn-modern,
.btn {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 0.5rem !important;
  padding: 0.75rem 1.5rem !important;
  font-size: 0.9375rem !important;
  font-weight: 600 !important;
  border-radius: 10px !important;
  border: none !important;
  cursor: pointer !important;
  transition: all 0.2s ease !important;
  text-decoration: none !important;
  white-space: nowrap !important;
}

.btn-modern-primary,
.btn-primary {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
  color: white !important;
}

.btn-modern-secondary,
.btn-secondary {
  background: #f1f5f9 !important;
  color: #475569 !important;
  border: 1px solid #e2e8f0 !important;
}

[data-theme=dark] .btn-modern-secondary,
[data-theme=dark] .btn-secondary {
  background: #334155 !important;
  color: #cbd5e1 !important;
  border-color: #475569 !important;
}

/* ===== GRID SYSTEM - Consistent Layouts ===== */
.grid-modern {
  display: grid !important;
  gap: 1.5rem !important;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)) !important;
}

@media (max-width: 768px) {
  .grid-modern {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)) !important;
    gap: 1rem !important;
  }
}

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

/* ===== RESPONSIVE UTILITIES ===== */
@media (max-width: 1023px) {
  .hide-mobile {
    display: none !important;
  }
}

@media (min-width: 1024px) {
  .show-mobile-only {
    display: none !important;
  }
}

/* ===== FLEX UTILITIES ===== */
.flex {
  display: flex !important;
}

.flex-wrap {
  flex-wrap: wrap !important;
}

.items-center {
  align-items: center !important;
}

.justify-between {
  justify-content: space-between !important;
}

.gap-2 {
  gap: 0.5rem !important;
}

.gap-3 {
  gap: 0.75rem !important;
}

.gap-4 {
  gap: 1rem !important;
}

/* Mobile: Stack flex items */
@media (max-width: 640px) {
  .flex {
    flex-direction: column !important;
  }

  .flex>* {
    width: 100% !important;
  }

  .keep-row {
    flex-direction: row !important;
  }

  .keep-row>* {
    width: auto !important;
  }
}

/* ========================================
   HEADER FIX
   ======================================== */
.dashboard-header {
  display: flex !important;
  visibility: visible !important;
  opacity: 1 !important;
  position: fixed !important;
  top: 0 !important;
  right: 0 !important;
  left: 260px !important;
  height: 64px !important;
  background: #ffffff !important;
  border-bottom: 1px solid #e5e7eb !important;
  z-index: 100 !important;
  padding: 0 1.5rem !important;
  align-items: center !important;
}

[dir="rtl"] .dashboard-header {
  left: 0 !important;
  right: 260px !important;
}

/* ========================================
   PASSWORD EYE ICON FIX
   ======================================== */
.input-wrapper {
  position: relative !important;
  display: block !important;
}

.input-wrapper .form-input {
  padding-right: 45px !important;
}

.input-wrapper .toggle-password {
  position: absolute !important;
  right: 12px !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  background: transparent !important;
  border: none !important;
  cursor: pointer !important;
  padding: 8px !important;
  z-index: 10 !important;
  color: #6b7280 !important;
  display: flex !important;
}

[dir="rtl"] .input-wrapper .toggle-password {
  right: auto !important;
  left: 12px !important;
}

/* ========================================
   LAYOUT FIX
   ======================================== */
.main-content {
  margin-left: 0 !important;
  margin-right: 0 !important;
  padding-top: 64px !important;
}

[dir="rtl"] .main-content {
  margin-right: 260px !important;
  margin-left: 0 !important;
}

[dir="ltr"] .main-content {
  margin-left: 260px !important;
  margin-right: 0 !important;
}

.main-content-body {
  padding: 1.5rem !important;
  max-width: 1400px !important;
  margin: 0 auto !important;
}


.dashboard-header {
  display: flex !important;
  position: fixed !important;
  top: 0 !important;
  height: 64px !important;
  background: #fff !important;
  z-index: 100 !important;
  padding: 0 1.5rem !important;
  align-items: center !important
}

[dir=rtl] .dashboard-header {
  right: 260px !important;
  left: 0 !important
}

.input-wrapper {
  position: relative !important
}

.input-wrapper .form-input {
  padding-right: 48px !important
}

.input-wrapper .toggle-password {
  position: absolute !important;
  right: 12px !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  z-index: 10 !important;
  cursor: pointer !important
}

[dir=rtl] .input-wrapper .toggle-password {
  right: auto !important;
  left: 12px !important
}

.main-content {
  margin-left: 0 !important;
  padding-top: 64px !important
}

[dir=rtl] .main-content {
  margin-right: 260px !important
}

[dir=ltr] .main-content {
  margin-left: 260px !important
}


/* Design System Variables */
:root {
  --spacing-xs: 0.25rem;
  --spacing-sm: 0.5rem;
  --spacing-md: 1rem;
  --spacing-lg: 1.5rem;
  --spacing-xl: 2rem;
  --sidebar-width: 260px;
  --header-height: 64px;
  --content-max-width: 1400px;
  --z-index-header: 100;
}

/* Header Component */
.dashboard-header {
  display: flex;
  align-items: center;
  position: fixed;
  top: 0;
  inset-inline-start: var(--sidebar-width);
  inset-inline-end: 0;
  height: var(--header-height);
  background: #ffffff;
  border-bottom: 1px solid #e5e7eb;
  z-index: var(--z-index-header);
  padding: 0 var(--spacing-lg);
}

/* Layout */
.main-content {
  margin-inline-start: 0;
  padding-top: var(--header-height);
  min-height: calc(100vh - var(--header-height));
}

[dir="rtl"] .main-content {
  margin-inline-end: var(--sidebar-width);
}

[dir="ltr"] .main-content {
  margin-inline-start: var(--sidebar-width);
}

.main-content-body {
  padding: var(--spacing-lg);
  max-width: var(--content-max-width);
  margin: 0 auto;
}

/* Form Input with Icon */
.input-wrapper {
  position: relative;
}

.input-wrapper .form-input {
  padding-inline-end: 3rem;
}

.input-wrapper .toggle-password {
  position: absolute;
  inset-inline-end: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  z-index: 10;
  color: #6b7280;
  display: flex;
  align-items: center;
  justify-content: center;
}

.input-wrapper .toggle-password:hover {
  color: #667eea;
}


/* ========================================
   Dashboard Header - Ensure Visibility
   ======================================== */
.dashboard-header {
  display: flex !important;
  visibility: visible !important;
  opacity: 1 !important;
  position: fixed !important;
  top: 0 !important;
  right: 0 !important;
  left: 260px !important;
  width: calc(100% - 260px) !important;
  height: 64px !important;
  background: #ffffff !important;
  border-bottom: 1px solid #e5e7eb !important;
  z-index: 100 !important;
  padding: 0 1.5rem !important;
  align-items: center !important;
  box-sizing: border-box !important;
}

[dir="rtl"] .dashboard-header {
  left: 0 !important;
  right: 260px !important;
}

/* ========================================
   Main Content Layout
   ======================================== */
.main-content {
  margin-left: 0 !important;
  margin-right: 0 !important;
  padding-top: 64px !important;
  min-height: calc(100vh - 64px) !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

[dir="rtl"] .main-content {
  margin-right: 260px !important;
  margin-left: 0 !important;
}

[dir="ltr"] .main-content {
  margin-left: 260px !important;
  margin-right: 0 !important;
}

.main-content-body {
  padding: 1.5rem !important;
  max-width: 1400px !important;
  margin: 0 auto !important;
  width: 100% !important;
  box-sizing: border-box !important;
}


/* Dashboard Header */
.dashboard-header {
  display: flex !important;
  position: fixed !important;
  top: 0 !important;
  left: 260px !important;
  right: 0 !important;
  width: calc(100% - 260px) !important;
  height: 64px !important;
  background: #fff !important;
  z-index: 100 !important;
  align-items: center !important;
}

[dir="rtl"] .dashboard-header {
  left: 0 !important;
  right: 260px !important;
}

/* Main Content */
.main-content {
  padding-top: 64px !important;
}

[dir="rtl"] .main-content {
  margin-right: 260px !important;
}

[dir="ltr"] .main-content {
  margin-left: 260px !important;
}
/* ============================================
   COMPREHENSIVE FIXES - 2026-03-05
   ============================================ */

/* ============================================
   1. SIDEBAR GRADIENT - LIGHT MODE
   ============================================ */
[data-theme="light"],
:root:not([data-theme="dark"]) {
  --sidebar-bg: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
  --sidebar-border: #e2e8f0;
}

.main-sidebar {
  background: var(--sidebar-bg, linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%));
  border-right: 1px solid var(--sidebar-border, #e2e8f0);
}

/* Alternative gradient sidebar option */
.sidebar-gradient-purple {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
}

.sidebar-gradient-mixed {
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 50%, #db2777 100%) !important;
}

/* ============================================
   2. DARK MODE COMPLETE FIX
   ============================================ */
[data-theme="dark"] {
  --bg-primary: #0f172a;
  --bg-secondary: #020617;
  --bg-card: #1e293b;
  --bg-sidebar: #1e293b;
  --text-primary: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;
  --border-color: #334155;
  --primary-glow: rgba(99, 102, 241, 0.15);
}

[data-theme="dark"] body {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

[data-theme="dark"] .main-sidebar {
  background: var(--bg-sidebar);
  border-color: var(--border-color);
}

[data-theme="dark"] .sidebar-brand {
  border-color: var(--border-color);
}

[data-theme="dark"] .sidebar-menu .nav-link {
  color: var(--text-secondary);
}

[data-theme="dark"] .sidebar-menu .nav-link:hover {
  background: rgba(99, 102, 241, 0.1);
  color: var(--text-primary);
}

[data-theme="dark"] .sidebar-menu li.active > .nav-link {
  background: rgba(99, 102, 241, 0.2);
  color: #818cf8;
}

[data-theme="dark"] .dashboard-header {
  background: var(--bg-card) !important;
  border-color: var(--border-color) !important;
}

[data-theme="dark"] .dashboard-header-title,
[data-theme="dark"] .header-title,
[data-theme="dark"] .page-title {
  color: var(--text-primary) !important;
}

[data-theme="dark"] .dashboard-header-icon-btn {
  color: var(--text-secondary) !important;
  background: transparent !important;
}

[data-theme="dark"] .dashboard-header-icon-btn:hover {
  background: rgba(99, 102, 241, 0.1) !important;
  color: var(--primary-400) !important;
}

/* ============================================
   3. DROPDOWN SOLID BACKGROUND FIX
   ============================================ */
.dashboard-dropdown,
.navbar-dropdown,
.user-dropdown,
.header-dropdown {
  background: #ffffff !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  border: 1px solid #e5e7eb !important;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15) !important;
}

[data-theme="dark"] .dashboard-dropdown,
[data-theme="dark"] .navbar-dropdown,
[data-theme="dark"] .user-dropdown,
[data-theme="dark"] .header-dropdown {
  background: #1e293b !important;
  border-color: #334155 !important;
}

/* Dropdown items visibility */
.dashboard-dropdown-item,
.dropdown-item {
  color: #1f2937 !important;
}

[data-theme="dark"] .dashboard-dropdown-item,
[data-theme="dark"] .dropdown-item {
  color: #f8fafc !important;
}

.dashboard-dropdown-item:hover,
.dropdown-item:hover {
  background: rgba(102, 126, 234, 0.1) !important;
  color: #667eea !important;
}

[data-theme="dark"] .dashboard-dropdown-item:hover,
[data-theme="dark"] .dropdown-item:hover {
  background: rgba(99, 102, 241, 0.2) !important;
  color: #818cf8 !important;
}

/* ============================================
   4. CARDS IN DARK MODE
   ============================================ */
[data-theme="dark"] .card,
[data-theme="dark"] .card-modern {
  background: var(--bg-card);
  border-color: var(--border-color);
}

[data-theme="dark"] .card-header,
[data-theme="dark"] .card-modern-header {
  border-color: var(--border-color);
}

[data-theme="dark"] .card-title,
[data-theme="dark"] .card-modern-title {
  color: var(--text-primary);
}

[data-theme="dark"] .card-body,
[data-theme="dark"] .card-modern-body {
  background: transparent;
}

/* ============================================
   5. FORM ELEMENTS DARK MODE
   ============================================ */
[data-theme="dark"] .form-input,
[data-theme="dark"] .form-select,
[data-theme="dark"] .form-textarea,
[data-theme="dark"] input[type="text"],
[data-theme="dark"] input[type="email"],
[data-theme="dark"] input[type="password"],
[data-theme="dark"] input[type="number"],
[data-theme="dark"] select,
[data-theme="dark"] textarea {
  background: #1e293b !important;
  border-color: #334155 !important;
  color: var(--text-primary) !important;
}

[data-theme="dark"] .form-input::placeholder,
[data-theme="dark"] input::placeholder,
[data-theme="dark"] textarea::placeholder {
  color: var(--text-muted) !important;
}

[data-theme="dark"] .form-label,
[data-theme="dark"] label {
  color: var(--text-secondary) !important;
}

/* ============================================
   6. TABLE DARK MODE
   ============================================ */
[data-theme="dark"] .table {
  background: var(--bg-card);
}

[data-theme="dark"] .table th {
  background: rgba(99, 102, 241, 0.1);
  color: var(--text-secondary);
  border-color: var(--border-color);
}

[data-theme="dark"] .table td {
  border-color: var(--border-color);
  color: var(--text-primary);
}

[data-theme="dark"] .table tbody tr:hover {
  background: rgba(99, 102, 241, 0.05);
}

/* ============================================
   7. STAT CARDS & DASHBOARD
   ============================================ */
[data-theme="dark"] .stat-card {
  background: var(--bg-card);
  border-color: var(--border-color);
}

[data-theme="dark"] .stat-label {
  color: var(--text-secondary);
}

[data-theme="dark"] .stat-value {
  color: var(--text-primary);
}

[data-theme="dark"] .integration-alert {
  background: rgba(245, 158, 11, 0.1);
  border-color: rgba(245, 158, 11, 0.3);
}

[data-theme="dark"] .integration-alert-title {
  color: #fbbf24;
}

[data-theme="dark"] .integration-alert-text {
  color: #fcd34d;
}

/* ============================================
   8. BUTTONS DARK MODE
   ============================================ */
[data-theme="dark"] .btn-secondary {
  background: #334155;
  color: var(--text-primary);
  border-color: #475569;
}

[data-theme="dark"] .btn-secondary:hover {
  background: #475569;
}

/* ============================================
   9. CHARTS PLACEHOLDER
   ============================================ */
.chart-container {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--rounded-2xl);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

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

.chart-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-primary);
}

.chart-canvas {
  width: 100%;
  height: 300px;
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.05), rgba(118, 75, 162, 0.05));
  border-radius: var(--rounded-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
}

/* ============================================
   10. FEATURE CARDS
   ============================================ */
.feature-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--rounded-2xl);
  padding: 1.5rem;
  transition: all 0.3s ease;
  cursor: pointer;
  text-decoration: none;
  display: block;
}

.feature-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
  border-color: var(--primary-500);
}

.feature-card-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  margin-bottom: 1rem;
}

.feature-card-icon.purple {
  background: rgba(102, 126, 234, 0.1);
  color: #667eea;
}

.feature-card-icon.green {
  background: rgba(16, 185, 129, 0.1);
  color: #10b981;
}

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

.feature-card-icon.red {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
}

.feature-card-icon.blue {
  background: rgba(59, 130, 246, 0.1);
  color: #3b82f6;
}

.feature-card-icon.pink {
  background: rgba(236, 72, 153, 0.1);
  color: #ec4899;
}

.feature-card-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.feature-card-desc {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

[data-theme="dark"] .feature-card {
  background: var(--bg-card);
  border-color: var(--border-color);
}

/* ============================================
   11. AI PROVIDER SETTINGS
   ============================================ */
.ai-provider-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--rounded-xl);
  padding: 1.25rem;
  margin-bottom: 1rem;
}

.ai-provider-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.ai-provider-logo {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.875rem;
}

.ai-provider-logo.openai { background: #10a37f; color: white; }
.ai-provider-logo.claude { background: #d97706; color: white; }
.ai-provider-logo.deepseek { background: #3b82f6; color: white; }
.ai-provider-logo.qwen { background: #8b5cf6; color: white; }
.ai-provider-logo.openrouter { background: #6366f1; color: white; }
.ai-provider-logo.minimax { background: #ec4899; color: white; }
.ai-provider-logo.glm { background: #14b8a6; color: white; }

.ai-provider-name {
  font-weight: 600;
  color: var(--text-primary);
}

.ai-provider-status {
  font-size: 0.75rem;
  padding: 0.25rem 0.5rem;
  border-radius: 9999px;
  margin-left: auto;
}

.ai-provider-status.active {
  background: rgba(16, 185, 129, 0.1);
  color: #10b981;
}

.ai-provider-status.inactive {
  background: rgba(107, 114, 128, 0.1);
  color: #6b7280;
}

/* ============================================
   12. RESPONSIVE FIXES
   ============================================ */
@media (max-width: 1023px) {
  .dashboard-header {
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
  }
  
  [dir="rtl"] .dashboard-header {
    left: 0 !important;
    right: 0 !important;
  }
  
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .feature-cards-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }
  
  .dashboard-hero {
    padding: 1.5rem;
  }
  
  .dashboard-hero-title {
    font-size: 1.5rem;
  }
}

/* ============================================
   13. BADGE & STATUS DARK MODE
   ============================================ */
[data-theme="dark"] .badge {
  border: none;
}

[data-theme="dark"] .badge-primary {
  background: rgba(99, 102, 241, 0.2);
  color: #818cf8;
}

[data-theme="dark"] .badge-success {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
}

[data-theme="dark"] .badge-warning {
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
}

[data-theme="dark"] .badge-danger {
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
}

/* ============================================
   14. ALERT DARK MODE
   ============================================ */
[data-theme="dark"] .alert {
  border: none;
}

[data-theme="dark"] .alert-info {
  background: rgba(59, 130, 246, 0.1);
  color: #60a5fa;
}

[data-theme="dark"] .alert-success {
  background: rgba(16, 185, 129, 0.1);
  color: #34d399;
}

[data-theme="dark"] .alert-warning {
  background: rgba(245, 158, 11, 0.1);
  color: #fbbf24;
}

[data-theme="dark"] .alert-danger {
  background: rgba(239, 68, 68, 0.1);
  color: #f87171;
}

/* ============================================
   15. MODAL DARK MODE
   ============================================ */
[data-theme="dark"] .modal-content {
  background: var(--bg-card);
  border-color: var(--border-color);
}

[data-theme="dark"] .modal-header {
  border-color: var(--border-color);
}

[data-theme="dark"] .modal-footer {
  border-color: var(--border-color);
}

[data-theme="dark"] .modal-title {
  color: var(--text-primary);
}

[data-theme="dark"] .btn-close {
  filter: invert(1);
}

/* ============================================
   ADDITIONAL FIXES - Dashboard Complete
   ============================================ */

/* Activity List */
.activity-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.activity-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 0.75rem 1rem;
    background: var(--bg-secondary);
    border-radius: var(--rounded-lg);
    transition: all 0.2s ease;
}

.activity-item:hover {
    background: rgba(102, 126, 234, 0.05);
}

.activity-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    flex-shrink: 0;
}

.activity-icon.info { background: rgba(59, 130, 246, 0.1); color: #3b82f6; }
.activity-icon.success { background: rgba(16, 185, 129, 0.1); color: #10b981; }
.activity-icon.warning { background: rgba(245, 158, 11, 0.1); color: #f59e0b; }
.activity-icon.danger { background: rgba(239, 68, 68, 0.1); color: #ef4444; }

.activity-content {
    flex: 1;
}

.activity-title {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.activity-time {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Quick Action Buttons */
.quick-action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    padding: 1.25rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--rounded-xl);
    color: var(--text-primary);
    text-decoration: none;
    transition: all 0.3s ease;
}

.quick-action-btn:hover {
    transform: translateY(-3px);
    border-color: var(--primary-500);
    box-shadow: 0 10px 20px rgba(102, 126, 234, 0.15);
}

.quick-action-btn i {
    font-size: 1.5rem;
    color: var(--primary-500);
}

.quick-action-btn span {
    font-size: 0.875rem;
    font-weight: 500;
}

/* Light Mode Sidebar - Neutral Background */
[data-theme=light],
:root:not([data-theme=dark]) {
    --sidebar-bg: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
}

.main-sidebar {
    background: var(--sidebar-bg, #ffffff) !important;
}

/* Ensure dropdown solid background */
.sidebar-menu .dropdown-menu {
    background: var(--bg-card, #ffffff) !important;
    border-radius: var(--rounded-lg);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    margin-top: 0.5rem;
}

[data-theme=dark] .sidebar-menu .dropdown-menu{
    background: var(--bg-card, #1e293b) !important;
}
