/* Main Layout Styles */
body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background-color: #f8f9fa;
  overflow-x: hidden;
}

.wrapper {
  display: flex;
  width: 100%;
  min-height: 100vh;
}

/* Sidebar Styles */
.sidebar {
  width: 250px;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  z-index: 999;
  background: #343a40;
  color: #fff;
  transition: all 0.3s;
}

.sidebar.collapsed {
  margin-left: -250px;
}

.sidebar .sidebar-header {
  padding: 20px;
  background: #212529;
}

.sidebar ul.components {
  padding: 20px 0;
  border-bottom: 1px solid #4b545c;
}

.sidebar ul p {
  color: #fff;
  padding: 10px;
}

.sidebar ul li a {
  padding: 10px 20px;
  font-size: 1.1em;
  display: block;
  color: #adb5bd;
  text-decoration: none;
  transition: all 0.3s;
}

.sidebar ul li a:hover {
  color: #fff;
  background: #495057;
}

.sidebar ul li a.active {
  color: #fff;
  background: #0d6efd;
}

.sidebar ul li a i {
  margin-right: 10px;
}

/* Modern Sidebar Styles with Glass Morphism and Fixed Bottom Layout */
.sidebar.modern-sidebar {
  background: linear-gradient(180deg, rgba(52, 58, 64, 0.95) 0%, rgba(33, 37, 41, 0.9) 100%);
  backdrop-filter: blur(20px);
  border-right: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 4px 0 20px rgba(0, 0, 0, 0.15);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
}

.sidebar.modern-sidebar::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(180deg, rgba(102, 126, 234, 0.08) 0%, rgba(118, 75, 162, 0.08) 100%);
  pointer-events: none;
}

/* Sidebar Content Area - Flexible */
.sidebar.modern-sidebar .sidebar-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
  z-index: 2;
}

/* Sidebar Navigation - Scrollable */
.sidebar.modern-sidebar .sidebar-navigation {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  position: relative;
}

/* Custom scrollbar for navigation */
.sidebar.modern-sidebar .sidebar-navigation::-webkit-scrollbar {
  width: 4px;
}

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

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

.sidebar.modern-sidebar .sidebar-navigation::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.5);
}

/* Fixed Footer Section */
.sidebar.modern-sidebar .sidebar-footer-fixed {
  position: sticky;
  bottom: 0;
  background: linear-gradient(180deg, rgba(33, 37, 41, 0.95) 0%, rgba(33, 37, 41, 1) 100%);
  backdrop-filter: blur(15px);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  z-index: 3;
  margin-top: auto;
  flex-shrink: 0;
}

/* Ensure footer stays at bottom even with minimal content */
.sidebar.modern-sidebar .sidebar-footer-fixed::before {
  content: '';
  position: absolute;
  top: -10px;
  left: 0;
  right: 0;
  height: 10px;
  background: linear-gradient(to bottom, transparent, rgba(33, 37, 41, 0.3));
  pointer-events: none;
}

/* Smooth transitions for footer interactions */
.sidebar.modern-sidebar .sidebar-footer-fixed {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Ensure proper spacing and layout */
.sidebar.modern-sidebar .sidebar-navigation {
  padding-bottom: 10px;
  min-height: 0;
}

/* Handle very long navigation lists */
.sidebar.modern-sidebar .modern-nav-components {
  padding-bottom: 20px;
}

/* Modern Sidebar Header - High Specificity to Override Page-Specific Styles */
.sidebar.modern-sidebar .sidebar-header.modern-sidebar-header {
  padding: 24px 20px !important;
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.15) 0%, rgba(118, 75, 162, 0.15) 100%) !important;
  backdrop-filter: blur(10px) !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
  position: relative !important;
  z-index: 2 !important;
  display: block !important;
  justify-content: initial !important;
  align-items: initial !important;
}

.sidebar.modern-sidebar .logo-container {
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
  margin-bottom: 20px !important;
  padding: 0 20px !important;
  width: 100% !important;
}

.sidebar.modern-sidebar .sidebar-logo {
  max-width: 140px !important;
  max-height: 70px !important;
  width: auto !important;
  height: auto !important;
  object-fit: contain !important;
  border-radius: 12px !important;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25) !important;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
  display: block !important;
  margin: 0 auto !important;
}

.sidebar.modern-sidebar .sidebar-logo:hover {
  transform: scale(1.08) !important;
  box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4) !important;
}

.sidebar.modern-sidebar .user-info-container {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  text-align: center !important;
  width: 100% !important;
  padding: 0 20px !important;
}

.sidebar.modern-sidebar .user-welcome-text,
.sidebar.modern-sidebar .user-role-text {
  color: white !important;
  text-align: center !important;
  font-weight: 500 !important;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4) !important;
  display: block !important;
  width: 100% !important;
  margin: 0 !important;
  line-height: 1.4 !important;
}

.sidebar.modern-sidebar .user-welcome-text {
  font-size: 0.9rem !important;
  opacity: 0.95 !important;
  margin-bottom: 4px !important;
}

.sidebar.modern-sidebar .user-role-text {
  font-size: 0.8rem !important;
  opacity: 0.85 !important;
  font-style: italic !important;
  text-transform: capitalize !important;
}

/* Fallback styles for backward compatibility */
.modern-sidebar-header {
  padding: 24px 20px;
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.15) 0%, rgba(118, 75, 162, 0.15) 100%);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  position: relative;
  z-index: 2;
}

.logo-container {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 20px;
  padding: 0 20px;
  width: 100%;
}

.sidebar-logo {
  max-width: 140px;
  max-height: 70px;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 12px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: block;
  margin: 0 auto;
}

.sidebar-logo:hover {
  transform: scale(1.08);
  box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

.user-info-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  width: 100%;
  padding: 0 20px;
}

.user-welcome-text,
.user-role-text {
  color: white !important;
  text-align: center;
  font-weight: 500;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
  display: block;
  width: 100%;
  margin: 0;
  line-height: 1.4;
}

.user-welcome-text {
  font-size: 0.9rem;
  opacity: 0.95;
  margin-bottom: 4px;
}

.user-role-text {
  font-size: 0.8rem;
  opacity: 0.85;
  font-style: italic;
  text-transform: capitalize;
}

/* Modern Navigation Components - High Specificity */
.sidebar.modern-sidebar .modern-nav-components {
  padding: 16px 0 !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
  position: relative !important;
  z-index: 2 !important;
}

.sidebar.modern-sidebar .modern-nav-components li a {
  padding: 14px 20px !important;
  font-size: 1rem !important;
  display: block !important;
  color: rgba(255, 255, 255, 0.8) !important;
  text-decoration: none !important;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
  border-radius: 0 25px 25px 0 !important;
  margin: 2px 0 !important;
  position: relative !important;
  overflow: hidden !important;
}

.sidebar.modern-sidebar .modern-nav-components li a::before {
  content: '' !important;
  position: absolute !important;
  top: 0 !important;
  left: -100% !important;
  width: 100% !important;
  height: 100% !important;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent) !important;
  transition: left 0.5s ease !important;
}

.sidebar.modern-sidebar .modern-nav-components li a:hover {
  color: white !important;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%) !important;
  transform: translateX(8px) !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2) !important;
}

.sidebar.modern-sidebar .modern-nav-components li a:hover::before {
  left: 100% !important;
}

.sidebar.modern-sidebar .modern-nav-components li a.active {
  color: white !important;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
  transform: translateX(12px) !important;
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4) !important;
  font-weight: 600 !important;
}

.sidebar.modern-sidebar .modern-nav-components li a.active::after {
  content: '' !important;
  position: absolute !important;
  top: 50% !important;
  right: -2px !important;
  width: 4px !important;
  height: 60% !important;
  background: linear-gradient(to bottom, #667eea, #764ba2) !important;
  border-radius: 2px 0 0 2px !important;
  transform: translateY(-50%) !important;
  animation: pulse-glow 2s ease-in-out infinite !important;
}

.sidebar.modern-sidebar .modern-nav-components li a i {
  margin-right: 12px !important;
  font-size: 1.1rem !important;
  width: 20px !important;
  text-align: center !important;
}

/* Fallback styles for backward compatibility */
.modern-nav-components {
  padding: 16px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  position: relative;
  z-index: 2;
}

.modern-nav-components li a {
  padding: 14px 20px;
  font-size: 1rem;
  display: block;
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 0 25px 25px 0;
  margin: 2px 0;
  position: relative;
  overflow: hidden;
}

.modern-nav-components li a::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
  transition: left 0.5s ease;
}

.modern-nav-components li a:hover {
  color: white;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
  transform: translateX(8px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.modern-nav-components li a:hover::before {
  left: 100%;
}

.modern-nav-components li a.active {
  color: white;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  transform: translateX(12px);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
  font-weight: 600;
}

.modern-nav-components li a.active::after {
  content: '';
  position: absolute;
  top: 50%;
  right: -2px;
  width: 4px;
  height: 60%;
  background: linear-gradient(to bottom, #667eea, #764ba2);
  border-radius: 2px 0 0 2px;
  transform: translateY(-50%);
  animation: pulse-glow 2s ease-in-out infinite;
}

.modern-nav-components li a i {
  margin-right: 12px;
  font-size: 1.1rem;
  width: 20px;
  text-align: center;
}

/* Modern Sidebar Footer Sections - Fixed Bottom */
.sidebar.modern-sidebar .sidebar-whatsapp-section {
  padding: 16px 20px 12px !important;
  position: relative !important;
  z-index: 3 !important;
}

.sidebar.modern-sidebar .sidebar-logout-section {
  padding: 12px 20px 16px !important;
  border-top: 1px solid rgba(255, 255, 255, 0.1) !important;
  position: relative !important;
  z-index: 3 !important;
}

/* Modern Button Styles for Footer */
.sidebar.modern-sidebar .btn-modern.btn-outline-light {
  border: 2px solid rgba(255, 255, 255, 0.3) !important;
  color: white !important;
  background: rgba(255, 255, 255, 0.1) !important;
  backdrop-filter: blur(10px) !important;
  border-radius: 8px !important;
  font-weight: 500 !important;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
  padding: 10px 16px !important;
}

.sidebar.modern-sidebar .btn-modern.btn-outline-light:hover {
  background: rgba(255, 255, 255, 0.2) !important;
  border-color: rgba(255, 255, 255, 0.5) !important;
  transform: translateY(-2px) !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2) !important;
}

/* WhatsApp Status Button Styling */
.sidebar.modern-sidebar .btn-modern.btn-success {
  background: linear-gradient(135deg, #25d366 0%, #128c7e 100%) !important;
  border: 2px solid rgba(37, 211, 102, 0.3) !important;
  color: white !important;
  backdrop-filter: blur(10px) !important;
  border-radius: 8px !important;
  font-weight: 500 !important;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
  padding: 10px 16px !important;
}

.sidebar.modern-sidebar .btn-modern.btn-success:hover {
  background: linear-gradient(135deg, #128c7e 0%, #075e54 100%) !important;
  border-color: rgba(37, 211, 102, 0.5) !important;
  transform: translateY(-2px) !important;
  box-shadow: 0 4px 12px rgba(37, 211, 102, 0.3) !important;
}

/* Fallback styles for backward compatibility */
.sidebar-footer {
  position: relative;
  z-index: 2;
  border-top: 1px solid rgba(255, 255, 255, 0.1) !important;
}

.btn-modern.btn-outline-light {
  border: 2px solid rgba(255, 255, 255, 0.3);
  color: white;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border-radius: 8px;
  font-weight: 500;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-modern.btn-outline-light:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.5);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

@keyframes pulse-glow {
  0%, 100% {
    opacity: 0.8;
    box-shadow: 0 0 5px rgba(102, 126, 234, 0.5);
  }
  50% {
    opacity: 1;
    box-shadow: 0 0 15px rgba(102, 126, 234, 0.8);
  }
}

/* Modern Sidebar Responsive Design - High Specificity */
@media (max-width: 768px) {
  .sidebar.modern-sidebar {
    margin-left: -250px !important;
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.25) !important;
  }

  .sidebar.modern-sidebar.active {
    margin-left: 0 !important;
  }

  .sidebar.modern-sidebar .logo-container {
    padding: 0 16px !important;
    margin-bottom: 16px !important;
  }

  .sidebar.modern-sidebar .sidebar-logo {
    max-width: 120px !important;
    max-height: 60px !important;
  }

  .sidebar.modern-sidebar .user-info-container {
    padding: 0 16px !important;
  }

  .sidebar.modern-sidebar .modern-nav-components li a {
    padding: 12px 16px !important;
    font-size: 0.95rem !important;
  }

  .sidebar.modern-sidebar .user-welcome-text {
    font-size: 0.85rem !important;
  }

  .sidebar.modern-sidebar .user-role-text {
    font-size: 0.75rem !important;
  }

  /* Footer buttons responsive sizing */
  .sidebar.modern-sidebar .sidebar-whatsapp-section {
    padding: 12px 16px 10px !important;
  }

  .sidebar.modern-sidebar .sidebar-logout-section {
    padding: 10px 16px 12px !important;
  }

  .sidebar.modern-sidebar .btn-modern {
    padding: 8px 12px !important;
    font-size: 0.9rem !important;
  }
}

@media (max-width: 480px) {
  .sidebar.modern-sidebar .modern-sidebar-header {
    padding: 20px 16px !important;
  }

  .sidebar.modern-sidebar .logo-container {
    padding: 0 12px !important;
    margin-bottom: 12px !important;
  }

  .sidebar.modern-sidebar .sidebar-logo {
    max-width: 100px !important;
    max-height: 50px !important;
  }

  .sidebar.modern-sidebar .user-info-container {
    padding: 0 12px !important;
  }

  .sidebar.modern-sidebar .modern-nav-components li a {
    padding: 10px 14px !important;
    font-size: 0.9rem !important;
  }

  .sidebar.modern-sidebar .modern-nav-components li a i {
    margin-right: 10px !important;
    font-size: 1rem !important;
  }

  .sidebar.modern-sidebar .user-welcome-text {
    font-size: 0.8rem !important;
  }

  .sidebar.modern-sidebar .user-role-text {
    font-size: 0.7rem !important;
  }

  /* Mobile footer adjustments */
  .sidebar.modern-sidebar .sidebar-whatsapp-section {
    padding: 10px 12px 8px !important;
  }

  .sidebar.modern-sidebar .sidebar-logout-section {
    padding: 8px 12px 10px !important;
  }

  .sidebar.modern-sidebar .btn-modern {
    padding: 8px 10px !important;
    font-size: 0.85rem !important;
  }

  .sidebar.modern-sidebar .btn-modern i {
    margin-right: 6px !important;
  }
}

/* Accessibility improvements for reduced motion - High Specificity */
@media (prefers-reduced-motion: reduce) {
  .sidebar.modern-sidebar,
  .sidebar.modern-sidebar .modern-nav-components li a,
  .sidebar.modern-sidebar .sidebar-logo,
  .sidebar.modern-sidebar .btn-modern.btn-outline-light {
    transition: none !important;
    animation: none !important;
  }

  .sidebar.modern-sidebar .modern-nav-components li a:hover,
  .sidebar.modern-sidebar .modern-nav-components li a.active {
    transform: none !important;
  }

  .sidebar.modern-sidebar .sidebar-logo:hover {
    transform: none !important;
  }
}

/* High contrast mode support - High Specificity */
@media (prefers-contrast: high) {
  .sidebar.modern-sidebar {
    background: #000000 !important;
    border-right: 2px solid #ffffff !important;
  }

  .sidebar.modern-sidebar .modern-sidebar-header {
    background: #1a1a1a !important;
    border-bottom: 2px solid #ffffff !important;
  }

  .sidebar.modern-sidebar .user-welcome-text,
  .sidebar.modern-sidebar .user-role-text {
    color: #ffffff !important;
    text-shadow: none !important;
  }

  .sidebar.modern-sidebar .modern-nav-components li a {
    color: #ffffff !important;
    border: 1px solid transparent !important;
  }

  .sidebar.modern-sidebar .modern-nav-components li a:hover {
    background: #333333 !important;
    border-color: #ffffff !important;
  }

  .sidebar.modern-sidebar .modern-nav-components li a.active {
    background: #0066cc !important;
    border-color: #ffffff !important;
  }
}

/* Protection against page-specific style overrides */
.sidebar.modern-sidebar .sidebar-header.modern-sidebar-header h5,
.sidebar.modern-sidebar .sidebar-header.modern-sidebar-header h3,
.sidebar.modern-sidebar .sidebar-header.modern-sidebar-header h4,
.sidebar.modern-sidebar .sidebar-header.modern-sidebar-header h6 {
  display: none !important; /* Hide any text headers that might interfere with logo */
}

/* Ensure logo container and user text are always visible in modern sidebar */
.sidebar.modern-sidebar .logo-container,
.sidebar.modern-sidebar .user-welcome-text,
.sidebar.modern-sidebar .user-role-text {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
}

/* Override any conflicting flex or grid layouts in sidebar header */
.sidebar.modern-sidebar .sidebar-header.modern-sidebar-header {
  display: block !important;
  flex-direction: column !important;
  justify-content: flex-start !important;
  align-items: stretch !important;
}

/* Ensure fixed bottom layout is preserved across all pages */
.sidebar.modern-sidebar {
  min-height: 100vh !important;
  max-height: 100vh !important;
  overflow: hidden !important;
}

.sidebar.modern-sidebar .sidebar-content {
  min-height: 0 !important;
  flex: 1 !important;
}

.sidebar.modern-sidebar .sidebar-navigation {
  flex: 1 !important;
  min-height: 0 !important;
}

/* Prevent footer from being pushed up by page-specific styles */
.sidebar.modern-sidebar .sidebar-footer-fixed {
  position: sticky !important;
  bottom: 0 !important;
  margin-top: auto !important;
  flex-shrink: 0 !important;
}

/* Ensure buttons maintain proper styling across pages */
.sidebar.modern-sidebar .sidebar-footer-fixed .btn-modern {
  width: 100% !important;
  text-align: center !important;
  justify-content: center !important;
  display: flex !important;
  align-items: center !important;
}

/* Handle potential conflicts with page-specific CSS */
.sidebar.modern-sidebar .sidebar-whatsapp-section,
.sidebar.modern-sidebar .sidebar-logout-section {
  background: transparent !important;
  position: relative !important;
}

/* Ensure proper z-index stacking */
.sidebar.modern-sidebar .sidebar-footer-fixed {
  z-index: 1000 !important;
}

/* Content Styles */
.content {
  width: calc(100% - 250px);
  min-height: 100vh;
  transition: all 0.3s;
  position: absolute;
  top: 0;
  right: 0;
}

.content.expanded {
  width: 100%;
}

/* Header Styles */
.header {
  background-color: #fff;
  box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
  padding: 15px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.header .toggle-btn {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: #343a40;
}

/* Profile Dropdown Styles */
.profile-dropdown .profile-btn {
  background: white;
  border: 1px solid #e9ecef;
  padding: 8px 16px;
  border-radius: 12px;
  transition: all 0.3s ease;
  color: #343a40;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  display: flex;
  align-items: center;
  gap: 12px;
}

.profile-dropdown .profile-btn:hover {
  background-color: #f8f9fa;
  border-color: #dee2e6;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  transform: translateY(-1px);
}

.profile-dropdown .profile-btn:focus {
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
  border-color: #667eea;
  outline: none;
}

.profile-avatar-wrapper {
  position: relative;
  flex-shrink: 0;
}

.profile-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.2);
  border: 2px solid white;
}

.profile-avatar-large {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.2);
  border: 2px solid white;
}

.profile-initials {
  color: white;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.5px;
}

.profile-avatar-large .profile-initials {
  font-size: 16px;
}

.profile-info {
  text-align: left;
  flex: 1;
  min-width: 0;
}

.profile-name {
  font-weight: 600;
  font-size: 14px;
  color: #1a1a1a;
  line-height: 1.2;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.profile-status {
  font-size: 12px;
  color: #6b7280;
  text-transform: capitalize;
  margin: 0;
  line-height: 1.2;
  display: flex;
  align-items: center;
  gap: 4px;
}

.profile-status::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.profile-status.status-online::before {
  background-color: #10b981;
  box-shadow: 0 0 4px rgba(16, 185, 129, 0.3);
}

.profile-status.status-away::before {
  background-color: #f59e0b;
  box-shadow: 0 0 4px rgba(245, 158, 11, 0.3);
}

.profile-status.status-offline::before {
  background-color: #6b7280;
}

.profile-arrow {
  font-size: 12px;
  transition: transform 0.2s ease;
  color: #6b7280;
  flex-shrink: 0;
}

.profile-dropdown.show .profile-arrow {
  transform: rotate(180deg);
}

/* Status Indicators */
.status-indicator {
  position: absolute;
  bottom: 0px;
  right: 0px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid white;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.status-indicator-large {
  position: absolute;
  bottom: 2px;
  right: 2px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid white;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.status-online {
  background-color: #28a745;
  animation: pulse-green 2s infinite;
}

.status-away {
  background-color: #ffc107;
  animation: pulse-yellow 2s infinite;
}

.status-offline {
  background-color: #6c757d;
}

@keyframes pulse-green {
  0% {
    box-shadow: 0 0 0 0 rgba(40, 167, 69, 0.7);
  }
  70% {
    box-shadow: 0 0 0 6px rgba(40, 167, 69, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(40, 167, 69, 0);
  }
}

@keyframes pulse-yellow {
  0% {
    box-shadow: 0 0 0 0 rgba(255, 193, 7, 0.7);
  }
  70% {
    box-shadow: 0 0 0 6px rgba(255, 193, 7, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(255, 193, 7, 0);
  }
}

/* Profile Dropdown Menu */
.profile-dropdown-menu {
  border: 1px solid #e9ecef;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
  border-radius: 12px;
  padding: 0;
  min-width: 260px;
  margin-top: 8px;
  background: white;
  overflow: hidden;
}

.profile-dropdown-menu .dropdown-header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 16px 20px;
  border-radius: 0;
  border-bottom: none;
  margin: 0;
}

.profile-dropdown-menu .dropdown-item {
  padding: 10px 20px;
  transition: all 0.2s ease;
  border: none;
  color: #374151;
  font-size: 14px;
}

.profile-dropdown-menu .dropdown-item:hover {
  background-color: #f9fafb;
  color: #111827;
  transform: translateX(2px);
}

.profile-dropdown-menu .dropdown-item:active {
  background-color: #f3f4f6;
}

.profile-dropdown-menu .dropdown-item i {
  width: 18px;
  text-align: center;
  margin-right: 8px;
  font-size: 14px;
}

.profile-dropdown-menu .dropdown-item.text-danger {
  color: #dc2626;
}

.profile-dropdown-menu .dropdown-item.text-danger:hover {
  background-color: #fef2f2;
  color: #b91c1c;
}

.profile-dropdown-menu .dropdown-divider {
  margin: 8px 0;
  border-color: #f3f4f6;
}

/* Status Submenu */
.dropdown-submenu {
  position: relative;
}

.dropdown-submenu .dropdown-toggle::after {
  display: none;
}

.dropdown-submenu .dropdown-toggle::before {
  content: '\F285';
  font-family: 'bootstrap-icons';
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 11px;
  color: #9ca3af;
}

.status-submenu {
  position: absolute;
  top: 0;
  left: 100%;
  margin-left: 8px;
  border: 1px solid #e9ecef;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  border-radius: 8px;
  min-width: 140px;
  display: none;
  background: white;
  overflow: hidden;
}

.dropdown-submenu:hover .status-submenu {
  display: block;
}

.status-option {
  padding: 8px 16px;
  transition: all 0.2s ease;
  color: #374151;
  font-size: 13px;
}

.status-option:hover {
  background-color: #f9fafb;
  color: #111827;
  transform: translateX(2px);
}

.status-option i {
  font-size: 12px;
  margin-right: 6px;
}

/* User Status Badge Component Styles */
.user-status-badge {
  display: inline-flex;
  align-items: center;
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 50px;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.user-status-badge:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transform: translateY(-1px);
  border-color: #d1d5db;
}

.user-status-badge:active {
  transform: translateY(0);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

/* Size variations */
.user-status-badge-sm {
  padding: 6px 12px;
  gap: 8px;
  font-size: 12px;
}

.user-status-badge-md {
  padding: 8px 16px;
  gap: 12px;
  font-size: 14px;
}

.user-status-badge-lg {
  padding: 10px 20px;
  gap: 16px;
  font-size: 16px;
}

/* Dark theme */
.user-status-badge-dark {
  background: #1f2937;
  border-color: #374151;
  color: white;
}

.user-status-badge-dark:hover {
  background: #111827;
  border-color: #4b5563;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* Avatar Section */
.status-badge-avatar {
  position: relative;
  flex-shrink: 0;
}

.status-badge-avatar .avatar-image {
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid white;
}

.user-status-badge-sm .avatar-image {
  width: 28px;
  height: 28px;
}

.user-status-badge-md .avatar-image {
  width: 36px;
  height: 36px;
}

.user-status-badge-lg .avatar-image {
  width: 44px;
  height: 44px;
}

.status-badge-avatar .avatar-initials {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  font-weight: 700;
  letter-spacing: 0.5px;
  border: 2px solid white;
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.2);
}

.user-status-badge-sm .avatar-initials {
  width: 28px;
  height: 28px;
  font-size: 11px;
}

.user-status-badge-md .avatar-initials {
  width: 36px;
  height: 36px;
  font-size: 13px;
}

.user-status-badge-lg .avatar-initials {
  width: 44px;
  height: 44px;
  font-size: 16px;
}

/* Status Indicator on Avatar */
.status-badge-avatar .status-indicator {
  position: absolute;
  border-radius: 50%;
  border: 2px solid white;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.user-status-badge-sm .status-indicator {
  width: 8px;
  height: 8px;
  bottom: 0;
  right: 0;
}

.user-status-badge-md .status-indicator {
  width: 10px;
  height: 10px;
  bottom: 0;
  right: 0;
}

.user-status-badge-lg .status-indicator {
  width: 12px;
  height: 12px;
  bottom: 1px;
  right: 1px;
}

/* Animated status indicators */
.status-indicator.status-online {
  animation: pulse-green 2s infinite;
}

.status-indicator.status-away {
  animation: pulse-yellow 2s infinite;
}

/* User Info Section */
.status-badge-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.status-badge-info .user-role {
  font-weight: 600;
  color: #111827;
  line-height: 1.2;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-status-badge-dark .status-badge-info .user-role {
  color: white;
}

.status-badge-info .user-status {
  display: flex;
  align-items: center;
  gap: 4px;
  line-height: 1.2;
}

.user-status .status-icon {
  flex-shrink: 0;
}

.user-status-badge-sm .status-icon {
  font-size: 8px;
}

.user-status-badge-md .status-icon {
  font-size: 10px;
}

.user-status-badge-lg .status-icon {
  font-size: 12px;
}

.user-status .status-text {
  font-size: 0.85em;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Dropdown Arrow */
.status-badge-arrow {
  flex-shrink: 0;
  color: #9ca3af;
  transition: transform 0.2s ease, color 0.2s ease;
}

.user-status-badge:hover .status-badge-arrow {
  color: #6b7280;
}

.user-status-badge[aria-expanded="true"] .status-badge-arrow i {
  transform: rotate(180deg);
}

.user-status-badge-dark .status-badge-arrow {
  color: #d1d5db;
}

.user-status-badge-dark:hover .status-badge-arrow {
  color: white;
}

/* Dropdown Menu */
.user-status-dropdown {
  border: 1px solid #e5e7eb;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
  border-radius: 12px;
  padding: 8px 0;
  min-width: 200px;
  margin-top: 8px;
  background: white;
}

.user-status-dropdown .dropdown-item {
  padding: 12px 16px;
  display: flex;
  align-items: center;
  cursor: pointer;
  transition: all 0.2s ease;
  color: #374151;
  font-weight: 500;
  border-left: 3px solid transparent;
}

.user-status-dropdown .dropdown-item:hover {
  background-color: #f9fafb;
  color: #111827;
  transform: translateX(2px);
  border-left-color: #3b82f6;
}

.user-status-dropdown .dropdown-item:active {
  background-color: #f3f4f6;
}

.user-status-dropdown .dropdown-item i {
  margin-right: 10px;
  width: 18px;
  text-align: center;
  font-size: 16px;
}

/* Enhanced Status Items with Colors */
.user-status-dropdown .dropdown-item[data-action="status-online"] {
  color: #059669 !important;
}

.user-status-dropdown .dropdown-item[data-action="status-online"]:hover {
  background-color: rgba(5, 150, 105, 0.08) !important;
  border-left-color: #059669 !important;
  color: #047857 !important;
}

.user-status-dropdown .dropdown-item[data-action="status-online"] i {
  color: #10b981 !important;
}

.user-status-dropdown .dropdown-item[data-action="status-away"] {
  color: #d97706 !important;
}

.user-status-dropdown .dropdown-item[data-action="status-away"]:hover {
  background-color: rgba(217, 119, 6, 0.08) !important;
  border-left-color: #d97706 !important;
  color: #b45309 !important;
}

.user-status-dropdown .dropdown-item[data-action="status-away"] i {
  color: #f59e0b !important;
}

.user-status-dropdown .dropdown-item[data-action="status-offline"] {
  color: #6b7280 !important;
}

.user-status-dropdown .dropdown-item[data-action="status-offline"]:hover {
  background-color: rgba(107, 114, 128, 0.08) !important;
  border-left-color: #6b7280 !important;
  color: #4b5563 !important;
}

.user-status-dropdown .dropdown-item[data-action="status-offline"] i {
  color: #9ca3af !important;
}

.user-status-dropdown .dropdown-item[data-action="status-busy"] {
  color: #dc2626 !important;
}

.user-status-dropdown .dropdown-item[data-action="status-busy"]:hover {
  background-color: rgba(220, 38, 38, 0.08) !important;
  border-left-color: #dc2626 !important;
  color: #b91c1c !important;
}

.user-status-dropdown .dropdown-item[data-action="status-busy"] i {
  color: #ef4444 !important;
}

/* Profile and Action Items */
.user-status-dropdown .dropdown-item[data-action="profile"] i {
  color: #3b82f6;
}

.user-status-dropdown .dropdown-item[data-action="profile"]:hover {
  background-color: rgba(59, 130, 246, 0.08);
  border-left-color: #3b82f6;
  color: #2563eb;
}

.user-status-dropdown .dropdown-item[data-action="refresh"] i {
  color: #06b6d4;
}

.user-status-dropdown .dropdown-item[data-action="refresh"]:hover {
  background-color: rgba(6, 182, 212, 0.08);
  border-left-color: #06b6d4;
  color: #0891b2;
}

.user-status-dropdown .dropdown-item[data-action="logout"] {
  color: #dc2626;
}

.user-status-dropdown .dropdown-item[data-action="logout"]:hover {
  background-color: rgba(220, 38, 38, 0.08);
  border-left-color: #dc2626;
  color: #b91c1c;
}

.user-status-dropdown .dropdown-item[data-action="logout"] i {
  color: #ef4444;
}

/* Status icon colors in dropdown items */
.user-status-dropdown .dropdown-item[data-action="status-online"] .bi::before {
  color: #10b981 !important;
}

.user-status-dropdown .dropdown-item[data-action="status-away"] .bi::before {
  color: #f59e0b !important;
}

.user-status-dropdown .dropdown-item[data-action="status-offline"] .bi::before {
  color: #9ca3af !important;
}

.user-status-dropdown .dropdown-item[data-action="status-busy"] .bi::before {
  color: #ef4444 !important;
}

@keyframes pulse-red {
  0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); }
  70% { box-shadow: 0 0 0 6px rgba(239, 68, 68, 0); }
  100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

.user-status-dropdown .dropdown-divider {
  height: 1px;
  background-color: #e5e7eb;
  margin: 6px 0;
}

.user-status-dropdown .dropdown-header {
  padding: 8px 16px 4px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  color: #9ca3af;
  letter-spacing: 0.5px;
}

/* Responsive Design */
@media (max-width: 768px) {
  .user-status-badge-lg {
    padding: 8px 16px;
    gap: 12px;
    font-size: 14px;
  }
  
  .user-status-badge-lg .avatar-initials,
  .user-status-badge-lg .avatar-image {
    width: 36px;
    height: 36px;
  }
  
  .user-status-badge-lg .avatar-initials {
    font-size: 13px;
  }
  
  .status-badge-info .user-role,
  .status-badge-info .status-text {
    font-size: 13px;
  }
}

@media (max-width: 480px) {
  .user-status-badge {
    gap: 8px;
  }
  
  .status-badge-info .user-role {
    max-width: 80px;
  }
  
  .status-badge-info .status-text {
    max-width: 60px;
  }
}

/* Animation Keyframes */
@keyframes pulse-green {
  0% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  }
  70% {
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
  }
}

@keyframes pulse-yellow {
  0% {
    box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.7);
  }
  70% {
    box-shadow: 0 0 0 4px rgba(245, 158, 11, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(245, 158, 11, 0);
  }
}

/* Accessibility */
.user-status-badge:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
  border-color: #667eea;
}

.user-status-badge[aria-expanded="true"] {
  background-color: #f9fafb;
  border-color: #d1d5db;
}

.user-status-badge-dark[aria-expanded="true"] {
  background-color: #111827;
  border-color: #4b5563;
}

/* Responsive adjustments for existing profile dropdown */
@media (max-width: 768px) {
  .profile-info {
    display: none !important;
  }
  
  .profile-dropdown .profile-btn {
    padding: 8px 12px;
    gap: 8px;
  }
  
  .profile-dropdown-menu {
    min-width: 240px;
    margin-top: 4px;
  }
  
  .profile-dropdown-menu .dropdown-header {
    padding: 12px 16px;
  }
  
  .profile-dropdown-menu .dropdown-item {
    padding: 8px 16px;
    font-size: 13px;
  }
}

/* Footer Styles */
.footer {
  background-color: #fff;
  box-shadow: 0 -0.125rem 0.25rem rgba(0, 0, 0, 0.075);
  padding: 15px 20px;
  text-align: center;
  color: #6c757d;
  position: relative;
  bottom: 0;
  width: 100%;
}

/* Chat Page Styles */
.chat-container {
  display: flex;
  height: calc(100vh - 140px);
  background-color: #fff;
  border-radius: 0.25rem;
  box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
  overflow: hidden;
}

.contacts-list {
  width: 300px;
  border-right: 1px solid #dee2e6;
  overflow-y: auto;
}

.contacts-list .contact-item {
  padding: 15px;
  border-bottom: 1px solid #dee2e6;
  cursor: pointer;
  transition: background-color 0.2s;
}

.contacts-list .contact-item:hover {
  background-color: #f8f9fa;
}

.contacts-list .contact-item.active {
  background-color: #e9ecef;
}

.contacts-list .contact-item .contact-name {
  font-weight: bold;
  margin-bottom: 5px;
}

.contacts-list .contact-item .last-message {
  color: #6c757d;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 250px;
}

.chat-area {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.chat-header {
  background-color: #fff;
  box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
  padding: 15px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.header .toggle-btn {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: #343a40;
}

/* Profile Dropdown Styles */
.profile-dropdown .profile-btn {
  background: white;
  border: 1px solid #e9ecef;
  padding: 8px 16px;
  border-radius: 12px;
  transition: all 0.3s ease;
  color: #343a40;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  display: flex;
  align-items: center;
  gap: 12px;
}

.profile-dropdown .profile-btn:hover {
  background-color: #f8f9fa;
  border-color: #dee2e6;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  transform: translateY(-1px);
}

.profile-dropdown .profile-btn:focus {
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
  border-color: #667eea;
  outline: none;
}

.profile-avatar-wrapper {
  position: relative;
  flex-shrink: 0;
}

.profile-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.2);
  border: 2px solid white;
}

.profile-avatar-large {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.2);
  border: 2px solid white;
}

.profile-initials {
  color: white;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.5px;
}

.profile-avatar-large .profile-initials {
  font-size: 16px;
}

.profile-info {
  text-align: left;
  flex: 1;
  min-width: 0;
}

.profile-name {
  font-weight: 600;
  font-size: 14px;
  color: #1a1a1a;
  line-height: 1.2;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.profile-status {
  font-size: 12px;
  color: #6b7280;
  text-transform: capitalize;
  margin: 0;
  line-height: 1.2;
  display: flex;
  align-items: center;
  gap: 4px;
}

.profile-status::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.profile-status.status-online::before {
  background-color: #10b981;
  box-shadow: 0 0 4px rgba(16, 185, 129, 0.3);
}

.profile-status.status-away::before {
  background-color: #f59e0b;
  box-shadow: 0 0 4px rgba(245, 158, 11, 0.3);
}

.profile-status.status-offline::before {
  background-color: #6b7280;
}

.profile-arrow {
  font-size: 12px;
  transition: transform 0.2s ease;
  color: #6b7280;
  flex-shrink: 0;
}

.profile-dropdown.show .profile-arrow {
  transform: rotate(180deg);
}

/* Status Indicators */
.status-indicator {
  position: absolute;
  bottom: 0px;
  right: 0px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid white;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.status-indicator-large {
  position: absolute;
  bottom: 2px;
  right: 2px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid white;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.status-online {
  background-color: #28a745;
  animation: pulse-green 2s infinite;
}

.status-away {
  background-color: #ffc107;
  animation: pulse-yellow 2s infinite;
}

.status-offline {
  background-color: #6c757d;
}

@keyframes pulse-green {
  0% {
    box-shadow: 0 0 0 0 rgba(40, 167, 69, 0.7);
  }
  70% {
    box-shadow: 0 0 0 6px rgba(40, 167, 69, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(40, 167, 69, 0);
  }
}

@keyframes pulse-yellow {
  0% {
    box-shadow: 0 0 0 0 rgba(255, 193, 7, 0.7);
  }
  70% {
    box-shadow: 0 0 0 6px rgba(255, 193, 7, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(255, 193, 7, 0);
  }
}

/* Profile Dropdown Menu */
.profile-dropdown-menu {
  border: 1px solid #e9ecef;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
  border-radius: 12px;
  padding: 0;
  min-width: 260px;
  margin-top: 8px;
  background: white;
  overflow: hidden;
}

.profile-dropdown-menu .dropdown-header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 16px 20px;
  border-radius: 0;
  border-bottom: none;
  margin: 0;
}

.profile-dropdown-menu .dropdown-item {
  padding: 10px 20px;
  transition: all 0.2s ease;
  border: none;
  color: #374151;
  font-size: 14px;
}

.profile-dropdown-menu .dropdown-item:hover {
  background-color: #f9fafb;
  color: #111827;
  transform: translateX(2px);
}

.profile-dropdown-menu .dropdown-item:active {
  background-color: #f3f4f6;
}

.profile-dropdown-menu .dropdown-item i {
  width: 18px;
  text-align: center;
  margin-right: 8px;
  font-size: 14px;
}

.profile-dropdown-menu .dropdown-item.text-danger {
  color: #dc2626;
}

.profile-dropdown-menu .dropdown-item.text-danger:hover {
  background-color: #fef2f2;
  color: #b91c1c;
}

.profile-dropdown-menu .dropdown-divider {
  margin: 8px 0;
  border-color: #f3f4f6;
}

/* Status Submenu */
.dropdown-submenu {
  position: relative;
}

.dropdown-submenu .dropdown-toggle::after {
  display: none;
}

.dropdown-submenu .dropdown-toggle::before {
  content: '\F285';
  font-family: 'bootstrap-icons';
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 11px;
  color: #9ca3af;
}

.status-submenu {
  position: absolute;
  top: 0;
  left: 100%;
  margin-left: 8px;
  border: 1px solid #e9ecef;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  border-radius: 8px;
  min-width: 140px;
  display: none;
  background: white;
  overflow: hidden;
}

.dropdown-submenu:hover .status-submenu {
  display: block;
}

.status-option {
  padding: 8px 16px;
  transition: all 0.2s ease;
  color: #374151;
  font-size: 13px;
}

.status-option:hover {
  background-color: #f9fafb;
  color: #111827;
  transform: translateX(2px);
}

.status-option i {
  font-size: 12px;
  margin-right: 6px;
}

/* User Status Badge Component Styles */
.user-status-badge {
  display: inline-flex;
  align-items: center;
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 50px;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.user-status-badge:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transform: translateY(-1px);
  border-color: #d1d5db;
}

.user-status-badge:active {
  transform: translateY(0);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

/* Size variations */
.user-status-badge-sm {
  padding: 6px 12px;
  gap: 8px;
  font-size: 12px;
}

.user-status-badge-md {
  padding: 8px 16px;
  gap: 12px;
  font-size: 14px;
}

.user-status-badge-lg {
  padding: 10px 20px;
  gap: 16px;
  font-size: 16px;
}

/* Dark theme */
.user-status-badge-dark {
  background: #1f2937;
  border-color: #374151;
  color: white;
}

.user-status-badge-dark:hover {
  background: #111827;
  border-color: #4b5563;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* Avatar Section */
.status-badge-avatar {
  position: relative;
  flex-shrink: 0;
}

.status-badge-avatar .avatar-image {
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid white;
}

.user-status-badge-sm .avatar-image {
  width: 28px;
  height: 28px;
}

.user-status-badge-md .avatar-image {
  width: 36px;
  height: 36px;
}

.user-status-badge-lg .avatar-image {
  width: 44px;
  height: 44px;
}

.status-badge-avatar .avatar-initials {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  font-weight: 700;
  letter-spacing: 0.5px;
  border: 2px solid white;
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.2);
}

.user-status-badge-sm .avatar-initials {
  width: 28px;
  height: 28px;
  font-size: 11px;
}

.user-status-badge-md .avatar-initials {
  width: 36px;
  height: 36px;
  font-size: 13px;
}

.user-status-badge-lg .avatar-initials {
  width: 44px;
  height: 44px;
  font-size: 16px;
}

/* Status Indicator on Avatar */
.status-badge-avatar .status-indicator {
  position: absolute;
  border-radius: 50%;
  border: 2px solid white;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.user-status-badge-sm .status-indicator {
  width: 8px;
  height: 8px;
  bottom: 0;
  right: 0;
}

.user-status-badge-md .status-indicator {
  width: 10px;
  height: 10px;
  bottom: 0;
  right: 0;
}

.user-status-badge-lg .status-indicator {
  width: 12px;
  height: 12px;
  bottom: 1px;
  right: 1px;
}

/* Animated status indicators */
.status-indicator.status-online {
  animation: pulse-green 2s infinite;
}

.status-indicator.status-away {
  animation: pulse-yellow 2s infinite;
}

/* User Info Section */
.status-badge-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.status-badge-info .user-role {
  font-weight: 600;
  color: #111827;
  line-height: 1.2;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-status-badge-dark .status-badge-info .user-role {
  color: white;
}

.status-badge-info .user-status {
  display: flex;
  align-items: center;
  gap: 4px;
  line-height: 1.2;
}

.user-status .status-icon {
  flex-shrink: 0;
}

.user-status-badge-sm .status-icon {
  font-size: 8px;
}

.user-status-badge-md .status-icon {
  font-size: 10px;
}

.user-status-badge-lg .status-icon {
  font-size: 12px;
}

.user-status .status-text {
  font-size: 0.85em;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Dropdown Arrow */
.status-badge-arrow {
  flex-shrink: 0;
  color: #9ca3af;
  transition: transform 0.2s ease, color 0.2s ease;
}

.user-status-badge:hover .status-badge-arrow {
  color: #6b7280;
}

.user-status-badge[aria-expanded="true"] .status-badge-arrow i {
  transform: rotate(180deg);
}

.user-status-badge-dark .status-badge-arrow {
  color: #d1d5db;
}

.user-status-badge-dark:hover .status-badge-arrow {
  color: white;
}

/* Dropdown Menu */
.user-status-dropdown {
  border: 1px solid #e5e7eb;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
  border-radius: 12px;
  padding: 8px 0;
  min-width: 200px;
  margin-top: 8px;
  background: white;
}

.user-status-dropdown .dropdown-item {
  padding: 12px 16px;
  display: flex;
  align-items: center;
  cursor: pointer;
  transition: all 0.2s ease;
  color: #374151;
  font-weight: 500;
  border-left: 3px solid transparent;
}

.user-status-dropdown .dropdown-item:hover {
  background-color: #f9fafb;
  color: #111827;
  transform: translateX(2px);
  border-left-color: #3b82f6;
}

.user-status-dropdown .dropdown-item:active {
  background-color: #f3f4f6;
}

.user-status-dropdown .dropdown-item i {
  margin-right: 10px;
  width: 18px;
  text-align: center;
  font-size: 16px;
}

/* Enhanced Status Items with Colors */
.user-status-dropdown .dropdown-item[data-action="status-online"] {
  color: #059669 !important;
}

.user-status-dropdown .dropdown-item[data-action="status-online"]:hover {
  background-color: rgba(5, 150, 105, 0.08) !important;
  border-left-color: #059669 !important;
  color: #047857 !important;
}

.user-status-dropdown .dropdown-item[data-action="status-online"] i {
  color: #10b981 !important;
}

.user-status-dropdown .dropdown-item[data-action="status-away"] {
  color: #d97706 !important;
}

.user-status-dropdown .dropdown-item[data-action="status-away"]:hover {
  background-color: rgba(217, 119, 6, 0.08) !important;
  border-left-color: #d97706 !important;
  color: #b45309 !important;
}

.user-status-dropdown .dropdown-item[data-action="status-away"] i {
  color: #f59e0b !important;
}

.user-status-dropdown .dropdown-item[data-action="status-offline"] {
  color: #6b7280 !important;
}

.user-status-dropdown .dropdown-item[data-action="status-offline"]:hover {
  background-color: rgba(107, 114, 128, 0.08) !important;
  border-left-color: #6b7280 !important;
  color: #4b5563 !important;
}

.user-status-dropdown .dropdown-item[data-action="status-offline"] i {
  color: #9ca3af !important;
}

.user-status-dropdown .dropdown-item[data-action="status-busy"] {
  color: #dc2626 !important;
}

.user-status-dropdown .dropdown-item[data-action="status-busy"]:hover {
  background-color: rgba(220, 38, 38, 0.08) !important;
  border-left-color: #dc2626 !important;
  color: #b91c1c !important;
}

.user-status-dropdown .dropdown-item[data-action="status-busy"] i {
  color: #ef4444 !important;
}

/* Profile and Action Items */
.user-status-dropdown .dropdown-item[data-action="profile"] i {
  color: #3b82f6;
}

.user-status-dropdown .dropdown-item[data-action="profile"]:hover {
  background-color: rgba(59, 130, 246, 0.08);
  border-left-color: #3b82f6;
  color: #2563eb;
}

.user-status-dropdown .dropdown-item[data-action="refresh"] i {
  color: #06b6d4;
}

.user-status-dropdown .dropdown-item[data-action="refresh"]:hover {
  background-color: rgba(6, 182, 212, 0.08);
  border-left-color: #06b6d4;
  color: #0891b2;
}

.user-status-dropdown .dropdown-item[data-action="logout"] {
  color: #dc2626;
}

.user-status-dropdown .dropdown-item[data-action="logout"]:hover {
  background-color: rgba(220, 38, 38, 0.08);
  border-left-color: #dc2626;
  color: #b91c1c;
}

.user-status-dropdown .dropdown-item[data-action="logout"] i {
  color: #ef4444;
}

/* Status icon colors in dropdown items */
.user-status-dropdown .dropdown-item[data-action="status-online"] .bi::before {
  color: #10b981 !important;
}

.user-status-dropdown .dropdown-item[data-action="status-away"] .bi::before {
  color: #f59e0b !important;
}

.user-status-dropdown .dropdown-item[data-action="status-offline"] .bi::before {
  color: #9ca3af !important;
}

.user-status-dropdown .dropdown-item[data-action="status-busy"] .bi::before {
  color: #ef4444 !important;
}

@keyframes pulse-red {
  0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); }
  70% { box-shadow: 0 0 0 6px rgba(239, 68, 68, 0); }
  100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

.user-status-dropdown .dropdown-divider {
  height: 1px;
  background-color: #e5e7eb;
  margin: 6px 0;
}

.user-status-dropdown .dropdown-header {
  padding: 8px 16px 4px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  color: #9ca3af;
  letter-spacing: 0.5px;
}

/* Responsive Design */
@media (max-width: 768px) {
  .user-status-badge-lg {
    padding: 8px 16px;
    gap: 12px;
    font-size: 14px;
  }
  
  .user-status-badge-lg .avatar-initials,
  .user-status-badge-lg .avatar-image {
    width: 36px;
    height: 36px;
  }
  
  .user-status-badge-lg .avatar-initials {
    font-size: 13px;
  }
  
  .status-badge-info .user-role,
  .status-badge-info .status-text {
    font-size: 13px;
  }
}

@media (max-width: 480px) {
  .user-status-badge {
    gap: 8px;
  }
  
  .status-badge-info .user-role {
    max-width: 80px;
  }
  
  .status-badge-info .status-text {
    max-width: 60px;
  }
}

/* Animation Keyframes */
@keyframes pulse-green {
  0% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  }
  70% {
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
  }
}

@keyframes pulse-yellow {
  0% {
    box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.7);
  }
  70% {
    box-shadow: 0 0 0 4px rgba(245, 158, 11, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(245, 158, 11, 0);
  }
}

/* Accessibility */
.user-status-badge:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
  border-color: #667eea;
}

.user-status-badge[aria-expanded="true"] {
  background-color: #f9fafb;
  border-color: #d1d5db;
}

.user-status-badge-dark[aria-expanded="true"] {
  background-color: #111827;
  border-color: #4b5563;
}

/* Responsive adjustments for existing profile dropdown */
@media (max-width: 768px) {
  .profile-info {
    display: none !important;
  }
  
  .profile-dropdown .profile-btn {
    padding: 8px 12px;
    gap: 8px;
  }
  
  .profile-dropdown-menu {
    min-width: 240px;
    margin-top: 4px;
  }
  
  .profile-dropdown-menu .dropdown-header {
    padding: 12px 16px;
  }
  
  .profile-dropdown-menu .dropdown-item {
    padding: 8px 16px;
    font-size: 13px;
  }
}

/* Footer Styles */
.footer {
  background-color: #fff;
  box-shadow: 0 -0.125rem 0.25rem rgba(0, 0, 0, 0.075);
  padding: 15px 20px;
  text-align: center;
  color: #6c757d;
  position: relative;
  bottom: 0;
  width: 100%;
}

/* Chat Page Styles */
.chat-container {
  display: flex;
  height: calc(100vh - 140px);
  background-color: #fff;
  border-radius: 0.25rem;
  box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
  overflow: hidden;
}

.contacts-list {
  width: 300px;
  border-right: 1px solid #dee2e6;
  overflow-y: auto;
}

.contacts-list .contact-item {
  padding: 15px;
  border-bottom: 1px solid #dee2e6;
  cursor: pointer;
  transition: background-color 0.2s;
}

.contacts-list .contact-item:hover {
  background-color: #f8f9fa;
}

.contacts-list .contact-item.active {
  background-color: #e9ecef;
}

.contacts-list .contact-item .contact-name {
  font-weight: bold;
  margin-bottom: 5px;
}

.contacts-list .contact-item .last-message {
  color: #6c757d;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 250px;
}

.chat-area {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.chat-header {
  background-color: #fff;
  box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
  padding: 15px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.header .toggle-btn {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: #343a40;
}

/* Profile Dropdown Styles */
.profile-dropdown .profile-btn {
  background: white;
  border: 1px solid #e9ecef;
  padding: 8px 16px;
  border-radius: 12px;
  transition: all 0.3s ease;
  color: #343a40;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  display: flex;
  align-items: center;
  gap: 12px;
}

.profile-dropdown .profile-btn:hover {
  background-color: #f8f9fa;
  border-color: #dee2e6;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  transform: translateY(-1px);
}

.profile-dropdown .profile-btn:focus {
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
  border-color: #667eea;
  outline: none;
}

.profile-avatar-wrapper {
  position: relative;
  flex-shrink: 0;
}

.profile-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.2);
  border: 2px solid white;
}

.profile-avatar-large {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.2);
  border: 2px solid white;
}

.profile-initials {
  color: white;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.5px;
}

.profile-avatar-large .profile-initials {
  font-size: 16px;
}

.profile-info {
  text-align: left;
  flex: 1;
  min-width: 0;
}

.profile-name {
  font-weight: 600;
  font-size: 14px;
  color: #1a1a1a;
  line-height: 1.2;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.profile-status {
  font-size: 12px;
  color: #6b7280;
  text-transform: capitalize;
  margin: 0;
  line-height: 1.2;
  display: flex;
  align-items: center;
  gap: 4px;
}

.profile-status::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.profile-status.status-online::before {
  background-color: #10b981;
  box-shadow: 0 0 4px rgba(16, 185, 129, 0.3);
}

.profile-status.status-away::before {
  background-color: #f59e0b;
  box-shadow: 0 0 4px rgba(245, 158, 11, 0.3);
}

.profile-status.status-offline::before {
  background-color: #6b7280;
}

.profile-arrow {
  font-size: 12px;
  transition: transform 0.2s ease;
  color: #6b7280;
  flex-shrink: 0;
}

.profile-dropdown.show .profile-arrow {
  transform: rotate(180deg);
}

/* Status Indicators */
.status-indicator {
  position: absolute;
  bottom: 0px;
  right: 0px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid white;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.status-indicator-large {
  position: absolute;
  bottom: 2px;
  right: 2px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid white;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.status-online {
  background-color: #28a745;
  animation: pulse-green 2s infinite;
}

.status-away {
  background-color: #ffc107;
  animation: pulse-yellow 2s infinite;
}

.status-offline {
  background-color: #6c757d;
}

@keyframes pulse-green {
  0% {
    box-shadow: 0 0 0 0 rgba(40, 167, 69, 0.7);
  }
  70% {
    box-shadow: 0 0 0 6px rgba(40, 167, 69, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(40, 167, 69, 0);
  }
}

@keyframes pulse-yellow {
  0% {
    box-shadow: 0 0 0 0 rgba(255, 193, 7, 0.7);
  }
  70% {
    box-shadow: 0 0 0 6px rgba(255, 193, 7, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(255, 193, 7, 0);
  }
}

/* Profile Dropdown Menu */
.profile-dropdown-menu {
  border: 1px solid #e9ecef;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
  border-radius: 12px;
  padding: 0;
  min-width: 260px;
  margin-top: 8px;
  background: white;
  overflow: hidden;
}

.profile-dropdown-menu .dropdown-header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 16px 20px;
  border-radius: 0;
  border-bottom: none;
  margin: 0;
}

.profile-dropdown-menu .dropdown-item {
  padding: 10px 20px;
  transition: all 0.2s ease;
  border: none;
  color: #374151;
  font-size: 14px;
}

.profile-dropdown-menu .dropdown-item:hover {
  background-color: #f9fafb;
  color: #111827;
  transform: translateX(2px);
}

.profile-dropdown-menu .dropdown-item:active {
  background-color: #f3f4f6;
}

.profile-dropdown-menu .dropdown-item i {
  width: 18px;
  text-align: center;
  margin-right: 8px;
  font-size: 14px;
}

.profile-dropdown-menu .dropdown-item.text-danger {
  color: #dc2626;
}

.profile-dropdown-menu .dropdown-item.text-danger:hover {
  background-color: #fef2f2;
  color: #b91c1c;
}

.profile-dropdown-menu .dropdown-divider {
  margin: 8px 0;
  border-color: #f3f4f6;
}

/* Status Submenu */
.dropdown-submenu {
  position: relative;
}

.dropdown-submenu .dropdown-toggle::after {
  display: none;
}

.dropdown-submenu .dropdown-toggle::before {
  content: '\F285';
  font-family: 'bootstrap-icons';
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 11px;
  color: #9ca3af;
}

.status-submenu {
  position: absolute;
  top: 0;
  left: 100%;
  margin-left: 8px;
  border: 1px solid #e9ecef;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  border-radius: 8px;
  min-width: 140px;
  display: none;
  background: white;
  overflow: hidden;
}

.dropdown-submenu:hover .status-submenu {
  display: block;
}

.status-option {
  padding: 8px 16px;
  transition: all 0.2s ease;
  color: #374151;
  font-size: 13px;
}

.status-option:hover {
  background-color: #f9fafb;
  color: #111827;
  transform: translateX(2px);
}

.status-option i {
  font-size: 12px;
  margin-right: 6px;
}

/* User Status Badge Component Styles */
.user-status-badge {
  display: inline-flex;
  align-items: center;
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 50px;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.user-status-badge:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transform: translateY(-1px);
  border-color: #d1d5db;
}

.user-status-badge:active {
  transform: translateY(0);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

/* Size variations */
.user-status-badge-sm {
  padding: 6px 12px;
  gap: 8px;
  font-size: 12px;
}

.user-status-badge-md {
  padding: 8px 16px;
  gap: 12px;
  font-size: 14px;
}

.user-status-badge-lg {
  padding: 10px 20px;
  gap: 16px;
  font-size: 16px;
}

/* Dark theme */
.user-status-badge-dark {
  background: #1f2937;
  border-color: #374151;
  color: white;
}

.user-status-badge-dark:hover {
  background: #111827;
  border-color: #4b5563;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* Avatar Section */
.status-badge-avatar {
  position: relative;
  flex-shrink: 0;
}

.status-badge-avatar .avatar-image {
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid white;
}

.user-status-badge-sm .avatar-image {
  width: 28px;
  height: 28px;
}

.user-status-badge-md .avatar-image {
  width: 36px;
  height: 36px;
}

.user-status-badge-lg .avatar-image {
  width: 44px;
  height: 44px;
}

.status-badge-avatar .avatar-initials {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  font-weight: 700;
  letter-spacing: 0.5px;
  border: 2px solid white;
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.2);
}

.user-status-badge-sm .avatar-initials {
  width: 28px;
  height: 28px;
  font-size: 11px;
}

.user-status-badge-md .avatar-initials {
  width: 36px;
  height: 36px;
  font-size: 13px;
}

.user-status-badge-lg .avatar-initials {
  width: 44px;
  height: 44px;
  font-size: 16px;
}

/* Status Indicator on Avatar */
.status-badge-avatar .status-indicator {
  position: absolute;
  border-radius: 50%;
  border: 2px solid white;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.user-status-badge-sm .status-indicator {
  width: 8px;
  height: 8px;
  bottom: 0;
  right: 0;
}

.user-status-badge-md .status-indicator {
  width: 10px;
  height: 10px;
  bottom: 0;
  right: 0;
}

.user-status-badge-lg .status-indicator {
  width: 12px;
  height: 12px;
  bottom: 1px;
  right: 1px;
}

/* Animated status indicators */
.status-indicator.status-online {
  animation: pulse-green 2s infinite;
}

.status-indicator.status-away {
  animation: pulse-yellow 2s infinite;
}

/* User Info Section */
.status-badge-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.status-badge-info .user-role {
  font-weight: 600;
  color: #111827;
  line-height: 1.2;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-status-badge-dark .status-badge-info .user-role {
  color: white;
}

.status-badge-info .user-status {
  display: flex;
  align-items: center;
  gap: 4px;
  line-height: 1.2;
}

.user-status .status-icon {
  flex-shrink: 0;
}

.user-status-badge-sm .status-icon {
  font-size: 8px;
}

.user-status-badge-md .status-icon {
  font-size: 10px;
}

.user-status-badge-lg .status-icon {
  font-size: 12px;
}

.user-status .status-text {
  font-size: 0.85em;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Dropdown Arrow */
.status-badge-arrow {
  flex-shrink: 0;
  color: #9ca3af;
  transition: transform 0.2s ease, color 0.2s ease;
}

.user-status-badge:hover .status-badge-arrow {
  color: #6b7280;
}

.user-status-badge[aria-expanded="true"] .status-badge-arrow i {
  transform: rotate(180deg);
}

.user-status-badge-dark .status-badge-arrow {
  color: #d1d5db;
}

.user-status-badge-dark:hover .status-badge-arrow {
  color: white;
}

/* Dropdown Menu */
.user-status-dropdown {
  border: 1px solid #e5e7eb;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
  border-radius: 12px;
  padding: 8px 0;
  min-width: 200px;
  margin-top: 8px;
  background: white;
}

.user-status-dropdown .dropdown-item {
  padding: 12px 16px;
  display: flex;
  align-items: center;
  cursor: pointer;
  transition: all 0.2s ease;
  color: #374151;
  font-weight: 500;
  border-left: 3px solid transparent;
}

.user-status-dropdown .dropdown-item:hover {
  background-color: #f9fafb;
  color: #111827;
  transform: translateX(2px);
  border-left-color: #3b82f6;
}

.user-status-dropdown .dropdown-item:active {
  background-color: #f3f4f6;
}

.user-status-dropdown .dropdown-item i {
  margin-right: 10px;
  width: 18px;
  text-align: center;
  font-size: 16px;
}

/* Enhanced Status Items with Colors */
.user-status-dropdown .dropdown-item[data-action="status-online"] {
  color: #059669 !important;
}

.user-status-dropdown .dropdown-item[data-action="status-online"]:hover {
  background-color: rgba(5, 150, 105, 0.08) !important;
  border-left-color: #059669 !important;
  color: #047857 !important;
}

.user-status-dropdown .dropdown-item[data-action="status-online"] i {
  color: #10b981 !important;
}

.user-status-dropdown .dropdown-item[data-action="status-away"] {
  color: #d97706 !important;
}

.user-status-dropdown .dropdown-item[data-action="status-away"]:hover {
  background-color: rgba(217, 119, 6, 0.08) !important;
  border-left-color: #d97706 !important;
  color: #b45309 !important;
}

.user-status-dropdown .dropdown-item[data-action="status-away"] i {
  color: #f59e0b !important;
}

.user-status-dropdown .dropdown-item[data-action="status-offline"] {
  color: #6b7280 !important;
}

.user-status-dropdown .dropdown-item[data-action="status-offline"]:hover {
  background-color: rgba(107, 114, 128, 0.08) !important;
  border-left-color: #6b7280 !important;
  color: #4b5563 !important;
}

.user-status-dropdown .dropdown-item[data-action="status-offline"] i {
  color: #9ca3af !important;
}

.user-status-dropdown .dropdown-item[data-action="status-busy"] {
  color: #dc2626 !important;
}

.user-status-dropdown .dropdown-item[data-action="status-busy"]:hover {
  background-color: rgba(220, 38, 38, 0.08) !important;
  border-left-color: #dc2626 !important;
  color: #b91c1c !important;
}

.user-status-dropdown .dropdown-item[data-action="status-busy"] i {
  color: #ef4444 !important;
}

/* Profile and Action Items */
.user-status-dropdown .dropdown-item[data-action="profile"] i {
  color: #3b82f6;
}

.user-status-dropdown .dropdown-item[data-action="profile"]:hover {
  background-color: rgba(59, 130, 246, 0.08);
  border-left-color: #3b82f6;
  color: #2563eb;
}

.user-status-dropdown .dropdown-item[data-action="refresh"] i {
  color: #06b6d4;
}

.user-status-dropdown .dropdown-item[data-action="refresh"]:hover {
  background-color: rgba(6, 182, 212, 0.08);
  border-left-color: #06b6d4;
  color: #0891b2;
}

.user-status-dropdown .dropdown-item[data-action="logout"] {
  color: #dc2626;
}

.user-status-dropdown .dropdown-item[data-action="logout"]:hover {
  background-color: rgba(220, 38, 38, 0.08);
  border-left-color: #dc2626;
  color: #b91c1c;
}

.user-status-dropdown .dropdown-item[data-action="logout"] i {
  color: #ef4444;
}

/* Status icon colors in dropdown items */
.user-status-dropdown .dropdown-item[data-action="status-online"] .bi::before {
  color: #10b981 !important;
}

.user-status-dropdown .dropdown-item[data-action="status-away"] .bi::before {
  color: #f59e0b !important;
}

.user-status-dropdown .dropdown-item[data-action="status-offline"] .bi::before {
  color: #9ca3af !important;
}

.user-status-dropdown .dropdown-item[data-action="status-busy"] .bi::before {
  color: #ef4444 !important;
}

@keyframes pulse-red {
  0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); }
  70% { box-shadow: 0 0 0 6px rgba(239, 68, 68, 0); }
  100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

.user-status-dropdown .dropdown-divider {
  height: 1px;
  background-color: #e5e7eb;
  margin: 6px 0;
}

.user-status-dropdown .dropdown-header {
  padding: 8px 16px 4px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  color: #9ca3af;
  letter-spacing: 0.5px;
}

/* Responsive Design */
@media (max-width: 768px) {
  .user-status-badge-lg {
    padding: 8px 16px;
    gap: 12px;
    font-size: 14px;
  }
  
  .user-status-badge-lg .avatar-initials,
  .user-status-badge-lg .avatar-image {
    width: 36px;
    height: 36px;
  }
  
  .user-status-badge-lg .avatar-initials {
    font-size: 13px;
  }
  
  .status-badge-info .user-role,
  .status-badge-info .status-text {
    font-size: 13px;
  }
}

@media (max-width: 480px) {
  .user-status-badge {
    gap: 8px;
  }
  
  .status-badge-info .user-role {
    max-width: 80px;
  }
  
  .status-badge-info .status-text {
    max-width: 60px;
  }
}

/* Animation Keyframes */
@keyframes pulse-green {
  0% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  }
  70% {
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
  }
}

@keyframes pulse-yellow {
  0% {
    box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.7);
  }
  70% {
    box-shadow: 0 0 0 4px rgba(245, 158, 11, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(245, 158, 11, 0);
  }
}

/* Accessibility */
.user-status-badge:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
  border-color: #667eea;
}

.user-status-badge[aria-expanded="true"] {
  background-color: #f9fafb;
  border-color: #d1d5db;
}

.user-status-badge-dark[aria-expanded="true"] {
  background-color: #111827;
  border-color: #4b5563;
}

/* Responsive adjustments for existing profile dropdown */
@media (max-width: 768px) {
  .profile-info {
    display: none !important;
  }
  
  .profile-dropdown .profile-btn {
    padding: 8px 12px;
    gap: 8px;
  }
  
  .profile-dropdown-menu {
    min-width: 240px;
    margin-top: 4px;
  }
  
  .profile-dropdown-menu .dropdown-header {
    padding: 12px 16px;
  }
  
  .profile-dropdown-menu .dropdown-item {
    padding: 8px 16px;
    font-size: 13px;
  }
}

/* Footer Styles */
.footer {
  background-color: #fff;
  box-shadow: 0 -0.125rem 0.25rem rgba(0, 0, 0, 0.075);
  padding: 15px 20px;
  text-align: center;
  color: #6c757d;
  position: relative;
  bottom: 0;
  width: 100%;
}

/* Chat Page Styles */
.chat-container {
  display: flex;
  height: calc(100vh - 140px);
  background-color: #fff;
  border-radius: 0.25rem;
  box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
  overflow: hidden;
}

.contacts-list {
  width: 300px;
  border-right: 1px solid #dee2e6;
  overflow-y: auto;
}

.contacts-list .contact-item {
  padding: 15px;
  border-bottom: 1px solid #dee2e6;
  cursor: pointer;
  transition: background-color 0.2s;
}

.contacts-list .contact-item:hover {
  background-color: #f8f9fa;
}

.contacts-list .contact-item.active {
  background-color: #e9ecef;
}

.contacts-list .contact-item .contact-name {
  font-weight: bold;
  margin-bottom: 5px;
}

.contacts-list .contact-item .last-message {
  color: #6c757d;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 250px;
}

.chat-area {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.chat-header {
  background-color: #fff;
  border-bottom: 1px solid #e9ecef;
  position: sticky;
  top: 0;
  z-index: 1000;
}

.user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: #0d6efd;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 1.2rem;
}

.chat-messages {
  flex: 1;
  padding: 15px;
  overflow-y: auto;
  background-color: #f8f9fa;
}

.message {
  margin-bottom: 15px;
  max-width: 70%;
}

.message.incoming {
  align-self: flex-start;
}

.message.outgoing {
  align-self: flex-end;
  margin-left: auto;
  margin-right: 0; /* Ensure no right margin for proper alignment */
}

.message .message-content {
  padding: 10px 15px;
  border-radius: 1rem;
  display: inline-block;
}

.message.incoming .message-content {
  background-color: #e9ecef;
  color: #212529;
  border-top-left-radius: 0;
}

.message.outgoing .message-content {
  background-color: #0d6efd;
  color: #fff;
  border-top-right-radius: 0;
}

.message .message-time {
  font-size: 0.75rem;
  color: #6c757d;
  margin-top: 5px;
  text-align: right;
}

.chat-input {
  padding: 15px;
  border-top: 1px solid #dee2e6;
  background-color: #fff;
  display: flex;
}

.chat-input input {
  flex: 1;
  padding: 10px 15px;
  border: 1px solid #ced4da;
  border-radius: 1.5rem;
  margin-right: 10px;
}

.chat-input button {
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Contacts Page Styles */
.contacts-table-container {
  background-color: #fff;
  border-radius: 0.25rem;
  box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
  padding: 20px;
}

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

.contact-tag {
  display: inline-block;
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1;
  text-align: center;
  white-space: nowrap;
  vertical-align: baseline;
  border-radius: 0.25rem;
  background-color: #6c757d;
  color: #fff;
  margin-right: 5px;
  margin-bottom: 5px;
}

/* Logs Page Styles */
.logs-container {
  background-color: #fff;
  border-radius: 0.25rem;
  box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
  padding: 20px;
}

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

.logs-filters {
  background-color: #f8f9fa;
  padding: 15px;
  border-radius: 0.25rem;
  margin-bottom: 20px;
}

/* Settings Page Styles */
.settings-container {
  background-color: #fff;
  border-radius: 0.25rem;
  box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
  padding: 20px;
}

.settings-card {
  margin-bottom: 20px;
}

.settings-card .card-header {
  font-weight: bold;
}

.whatsapp-status {
  display: inline-block;
  padding: 0.25rem 0.5rem;
  font-size: 0.875rem;
  font-weight: 700;
  line-height: 1;
  text-align: center;
  white-space: nowrap;
  vertical-align: baseline;
  border-radius: 0.25rem;
  margin-left: 10px;
}

.whatsapp-status.connected {
  background-color: #198754;
  color: #fff;
}

.whatsapp-status.disconnected {
  background-color: #dc3545;
  color: #fff;
}

.whatsapp-status.connecting {
  background-color: #ffc107;
  color: #212529;
}

.whatsapp-status.error {
  background-color: #dc3545;
  color: #fff;
}

/* Responsive Styles */
@media (max-width: 768px) {
  .sidebar {
    margin-left: -250px;
  }
  
  .sidebar.active {
    margin-left: 0;
  }
  
  .content {
    width: 100%;
  }
  
  .chat-container {
    flex-direction: column;
    height: auto;
  }
  
  .contacts-list {
    width: 100%;
    max-height: 300px;
    border-right: none;
    border-bottom: 1px solid #dee2e6;
  }
  
  .chat-area {
    height: calc(100vh - 440px);
  }
}

/* Enhanced Team & Agent Management Styles */
:root {
  --border-radius: 12px;
  --shadow-sm: 0 2px 4px rgba(0,0,0,0.1);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.15);
  --transition: all 0.3s ease;
}

.team-card {
  background: #fff;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-sm);
  border: 1px solid #e9ecef;
  transition: var(--transition);
  overflow: hidden;
}

.team-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.team-header {
  padding: 1.25rem;
  background: #fff;
  transition: var(--transition);
  cursor: pointer;
}

.team-header:hover {
  background: #f8f9fa;
}

.team-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
}

.team-name {
  color: var(--dark-color);
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.team-stats .badge {
  font-size: 0.75rem;
  padding: 0.375rem 0.75rem;
  border-radius: 20px;
  font-weight: 500;
}

.expand-indicator {
  display: flex;
  align-items: center;
  color: #6c757d;
  transition: var(--transition);
}

.expand-indicator i {
  transition: transform 0.3s ease;
}

.team-actions {
  opacity: 0.7;
  transition: var(--transition);
}

.team-card:hover .team-actions {
  opacity: 1;
}

.team-content {
  border-top: 1px solid #e9ecef;
}

.team-body {
  padding: 1.5rem;
  background: #fafbfc;
}

.team-description {
  padding: 1rem;
  background: #fff;
  border-radius: 8px;
  border-left: 4px solid #e9ecef;
}

.section-title {
  color: var(--dark-color);
  font-weight: 600;
  font-size: 1rem;
}

/* Agent Cards */
.agents-grid {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.agent-card {
  background: #fff;
  border-radius: 10px;
  padding: 1rem;
  border: 1px solid #e9ecef;
  transition: var(--transition);
}

.agent-card:hover {
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
  border-color: #dee2e6;
}

.agent-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
}

.avatar-circle {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.9rem;
}

.agent-name {
  color: var(--dark-color);
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.agent-details {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.agent-details .username,
.agent-details .phone {
  font-size: 0.875rem;
  display: flex;
  align-items: center;
}

.agent-status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.status-badge {
  padding: 0.25rem 0.75rem;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
}

.message-count {
  font-size: 0.8rem;
  color: #6c757d;
  display: flex;
  align-items: center;
}

.agent-actions {
  opacity: 0.6;
  transition: var(--transition);
}

.agent-card:hover .agent-actions {
  opacity: 1;
}

/* Empty States */
.empty-agents-state {
  background: #fff;
  border-radius: 8px;
  border: 2px dashed #dee2e6;
  margin: 1rem 0;
}

.empty-agents-state:hover {
  border-color: #28a745;
  background: #f8fff9;
}

/* Button Enhancements */
.btn {
  border-radius: 8px;
  font-weight: 500;
  transition: var(--transition);
}

.btn-sm {
  padding: 0.375rem 0.75rem;
  font-size: 0.875rem;
}

.btn-group .btn {
  border-radius: 6px !important;
}

.btn-group .btn:not(:last-child) {
  margin-right: 0.25rem;
}

/* Utility classes */
.text-truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cursor-pointer {
  cursor: pointer !important;
}

/* Responsive Design */
@media (max-width: 768px) {
  .team-header {
    padding: 1rem;
  }
  
  .team-body {
    padding: 1rem;
  }
  
  .agent-details {
    flex-direction: column;
    gap: 0.25rem;
  }
  
  .agent-details .phone {
    margin-left: 0 !important;
  }
  
  .team-stats {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    align-items: flex-start;
  }
}

/* Animation for expand/collapse */
.collapse.show {
  animation: slideDown 0.3s ease-out;
}

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

/* Tooltip customization */
.tooltip {
  font-size: 0.8rem;
}

.tooltip .tooltip-inner {
  background-color: var(--dark-color);
  color: white;
  border-radius: 6px;
  padding: 0.5rem 0.75rem;
}

/* Modern Chat Interface Styles */

/* CSS Variables for Modern Chat */
:root {
  --chat-primary: #667eea;
  --chat-secondary: #764ba2;
  --chat-success: #00d4aa;
  --chat-warning: #ffb347;
  --chat-danger: #ff6b6b;
  --chat-dark: #2c3e50;
  --chat-light: #ecf0f1;
  --chat-white: #ffffff;
  --chat-border: #e1e8ed;
  --chat-shadow: 0 4px 25px rgba(0,0,0,0.1);
  --chat-shadow-lg: 0 8px 40px rgba(0,0,0,0.12);
  --chat-gradient: linear-gradient(135deg, var(--chat-primary), var(--chat-secondary));
  --chat-radius: 16px;
  --chat-radius-sm: 8px;
  --chat-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Emoji Picker Styles */
.emoji-picker {
  position: absolute;
  bottom: 60px;
  left: 10px;
  width: 320px;
  max-height: 400px;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  z-index: 1000;
  overflow: hidden;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.emoji-picker-header {
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  padding: 8px;
}

.emoji-categories {
  display: flex;
  justify-content: space-around;
  gap: 4px;
}

.emoji-category {
  background: none;
  border: none;
  padding: 8px;
  border-radius: 8px;
  font-size: 18px;
  cursor: pointer;
  transition: all 0.2s ease;
  min-width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-primary);
}

.emoji-category:hover {
  background: var(--hover-bg);
  transform: scale(1.05);
}

.emoji-category.active {
  background: var(--chat-primary, #667eea);
  color: white;
  box-shadow: var(--shadow-sm);
}

.emoji-picker-content {
  padding: 12px;
  max-height: 300px;
  overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 4px;
  background: var(--bg-primary);
}

.emoji-item {
  background: none;
  border: none;
  padding: 8px;
  border-radius: 6px;
  font-size: 20px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
}

.emoji-item:hover {
  background: var(--hover-bg);
  transform: scale(1.1);
  box-shadow: var(--shadow-sm);
}

.emoji-picker-content::-webkit-scrollbar {
  width: 6px;
}

.emoji-picker-content::-webkit-scrollbar-track {
  background: transparent;
}

.emoji-picker-content::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 3px;
}

.emoji-picker-content::-webkit-scrollbar-thumb:hover {
  background: var(--text-secondary);
}

/* Reply container positioning for emoji picker */
.reply-container {
  position: relative;
}

/* Modern File Attachment Styles (No Glass Morphism) */
.file-attachment-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.3s ease-out;
}

.file-attachment-modal {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  box-shadow:
    0 20px 40px rgba(0, 0, 0, 0.15),
    0 8px 16px rgba(0, 0, 0, 0.1);
  max-width: 500px;
  width: 100%;
  max-height: 80vh;
  overflow: hidden;
  animation: slideUp 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.file-attachment-header {
  padding: 24px 24px 16px;
  border-bottom: 1px solid #e2e8f0;
  background: #f8fafc;
}

.file-attachment-title {
  font-size: 20px;
  font-weight: 600;
  color: #1a1a1a;
  margin: 0 0 8px 0;
  display: flex;
  align-items: center;
  gap: 12px;
}

.file-attachment-subtitle {
  font-size: 14px;
  color: #666;
  margin: 0;
  opacity: 0.8;
}

.file-attachment-content {
  padding: 20px 24px;
  max-height: 400px;
  overflow-y: auto;
}

/* File preview items spacing (since container was removed) */
.file-attachment-content .file-preview-item {
  margin-bottom: 12px;
}

.file-attachment-content .file-preview-item:last-child {
  margin-bottom: 16px;
}



.file-preview-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  margin-bottom: 12px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.file-preview-item:last-child {
  margin-bottom: 0;
}

.file-preview-item:hover {
  background: #f1f5f9;
  transform: translateY(-1px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}

.file-preview-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #e0e7ff;
  border: 1px solid #c7d2fe;
  border-radius: 8px;
  color: #6366f1;
  font-size: 20px;
  flex-shrink: 0;
}

.file-preview-info {
  flex: 1;
  min-width: 0;
}

.file-preview-name {
  font-weight: 600;
  color: #1a1a1a;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 4px;
  line-height: 1.4;
  /* Support for RTL languages like Arabic */
  unicode-bidi: embed;
  direction: ltr; /* Default to LTR, will be overridden by inline styles for RTL */
}

/* RTL support for Arabic filenames */
.file-preview-name [dir="rtl"] {
  direction: rtl;
  text-align: right;
  unicode-bidi: embed;
}

.file-preview-size {
  font-size: 12px;
  color: #666;
  opacity: 0.8;
  font-weight: 500;
}

.file-preview-remove {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #ef4444;
  cursor: pointer;
  padding: 8px;
  border-radius: 6px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  flex-shrink: 0;
}

.file-preview-remove:hover {
  background: #fee2e2;
  transform: scale(1.05);
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.2);
}

.file-message-input {
  background: #ffffff;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  padding: 12px 16px;
  font-size: 14px;
  color: #1a1a1a;
  width: 100%;
  resize: none;
  outline: none;
  transition: all 0.3s ease;
  font-family: inherit;
  min-height: 44px;
  max-height: 120px;
}

.file-message-input::placeholder {
  color: #6b7280;
  opacity: 0.8;
}

.file-message-input:focus {
  background: #ffffff;
  border-color: #6366f1;
  box-shadow:
    0 0 0 3px rgba(99, 102, 241, 0.1),
    0 2px 8px rgba(0, 0, 0, 0.1);
}

.file-attachment-actions {
  padding: 16px 24px 24px;
  border-top: 1px solid #e2e8f0;
  background: #f8fafc;
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

.file-action-btn {
  padding: 12px 24px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: none;
  display: flex;
  align-items: center;
  gap: 8px;
  position: relative;
  overflow: hidden;
}

.file-action-btn.cancel {
  background: #f3f4f6;
  border: 1px solid #d1d5db;
  color: #6b7280;
}

.file-action-btn.cancel:hover {
  background: #e5e7eb;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(107, 114, 128, 0.2);
}

.file-action-btn.send {
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  border: 1px solid #6366f1;
  color: white;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

.file-action-btn.send:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.4);
}

.file-action-btn.send:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* Upload Progress Styles */
.upload-progress-container {
  position: fixed;
  top: 20px;
  right: 20px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  z-index: 2001;
  min-width: 300px;
  animation: slideInRight 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.upload-progress-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  color: #1a1a1a;
  font-weight: 600;
}

.upload-progress-header i {
  color: #6366f1;
  font-size: 18px;
}

.progress {
  height: 8px;
  background: rgba(0, 0, 0, 0.1);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 12px;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #6366f1, #8b5cf6);
  border-radius: 4px;
  transition: width 0.3s ease;
  position: relative;
  overflow: hidden;
}

.progress-bar::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  animation: shimmer 2s infinite;
}

.upload-progress-text {
  font-size: 12px;
  color: #666;
  text-align: center;
}

/* Enhanced Upload Progress Styling */
.upload-progress-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.upload-progress-header .text-primary {
  font-weight: 600;
  font-size: 0.95rem;
}

.upload-progress-header .text-muted {
  font-size: 0.85rem;
  font-weight: 500;
}

#campaign-progress-bar {
  transition: width 0.4s ease-in-out;
  background: linear-gradient(90deg, #28a745, #20c997);
}

#progress-details, #progress-file-info {
  font-size: 0.8rem;
  color: #6c757d;
}

/* Select All Controls Styling */
#select-all-controls {
  background: rgba(13, 110, 253, 0.05);
  border: 1px solid rgba(13, 110, 253, 0.15);
  border-radius: 6px;
  padding: 8px 12px;
}

#select-all-controls .form-check-input:indeterminate {
  background-color: #ffc107;
  border-color: #ffc107;
}

/* Phone Format Preview Styling */
#phone-format-preview .alert {
  border-left: 4px solid #17a2b8;
  background: rgba(23, 162, 184, 0.05);
}

#phone-format-preview .alert-heading {
  color: #17a2b8;
  font-size: 0.95rem;
  margin-bottom: 10px;
}

/* File Validation Results */
#file-validation-results .alert {
  margin-bottom: 8px;
  padding: 10px 15px;
  font-size: 0.9rem;
}

/* Contact Checkbox Styling */
.contact-checkbox {
  transform: scale(1.1);
  margin-right: 8px;
}

.contact-checkbox:checked {
  background-color: #28a745;
  border-color: #28a745;
}

/* Status Update Animation */
.status-updated {
  animation: statusPulse 0.6s ease-in-out;
}

@keyframes statusPulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); background-color: rgba(40, 167, 69, 0.1); }
  100% { transform: scale(1); }
}

/* Real-time Processing Modal Styles */
#processing-modal .modal-dialog {
  max-width: 800px;
}

#processing-modal .modal-header {
  background: linear-gradient(135deg, #007bff, #0056b3);
}

#overall-progress-bar {
  font-size: 0.8rem;
  font-weight: 600;
  transition: width 0.3s ease;
}

#live-contact-feed {
  font-size: 0.9rem;
}

#live-contact-feed .border-bottom:last-child {
  border-bottom: none !important;
}

.contact-success {
  border-left: 3px solid #28a745;
  background: rgba(40, 167, 69, 0.05);
}

.contact-error {
  border-left: 3px solid #dc3545;
  background: rgba(220, 53, 69, 0.05);
}

.processing-stats {
  background: rgba(0, 123, 255, 0.05);
  border: 1px solid rgba(0, 123, 255, 0.1);
  border-radius: 8px;
  padding: 15px;
}

.processing-stats .fw-bold {
  font-size: 1.2rem;
  color: #007bff;
}

#current-spinner {
  animation: spin 1s linear infinite;
}

/* Processing Modal Close Button */
#processing-modal .btn-close-white {
  opacity: 0.8;
  transition: opacity 0.2s ease;
}

#processing-modal .btn-close-white:hover {
  opacity: 1;
}

/* Processing Modal Buttons */
#processing-modal .modal-footer .btn {
  min-width: 140px;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Contact highlight animation */
.contact-highlight {
  animation: contactAdded 0.8s ease-out;
}

@keyframes contactAdded {
  0% {
    background-color: #d4edda;
    transform: scale(1.02);
  }
  100% {
    background-color: transparent;
    transform: scale(1);
  }
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(100px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

/* Responsive Design */
@media (max-width: 768px) {
  .file-attachment-modal {
    margin: 20px;
    max-width: calc(100vw - 40px);
    border-radius: 20px;
  }

  .file-attachment-header,
  .file-attachment-content,
  .file-attachment-actions {
    padding-left: 20px;
    padding-right: 20px;
  }

  .file-preview-item {
    gap: 12px;
    padding: 10px;
  }

  .file-preview-icon {
    width: 40px;
    height: 40px;
    font-size: 18px;
  }

  .upload-progress-container {
    top: 10px;
    right: 10px;
    left: 10px;
    min-width: auto;
  }
}

/* Notification System */
.notification-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 10000;
  max-width: 400px;
}

.notification {
  background: var(--chat-white);
  border-radius: var(--chat-radius-sm);
  box-shadow: var(--chat-shadow);
  margin-bottom: 10px;
  opacity: 0;
  transform: translateX(100%);
  transition: var(--chat-transition);
  border-left: 4px solid var(--chat-primary);
}

.notification.show {
  opacity: 1;
  transform: translateX(0);
}

.notification.notification-success {
  border-left-color: var(--chat-success);
}

.notification.notification-warning {
  border-left-color: var(--chat-warning);
}

.notification.notification-error {
  border-left-color: var(--chat-danger);
}

.notification-content {
  display: flex;
  align-items: flex-start;
  padding: 16px;
}

.notification-icon {
  margin-right: 12px;
  color: var(--chat-primary);
  font-size: 1.2rem;
}

.notification-text h6 {
  margin: 0 0 4px 0;
  font-weight: 600;
  color: var(--chat-dark);
}

.notification-text p {
  margin: 0;
  color: #6c757d;
  font-size: 0.9rem;
}

.notification-close {
  background: none;
  border: none;
  color: #6c757d;
  cursor: pointer;
  margin-left: auto;
  padding: 4px;
  border-radius: 4px;
  transition: var(--chat-transition);
}

.notification-close:hover {
  background: #f8f9fa;
  color: var(--chat-dark);
}

/* Modern Chat Header */
.modern-chat-header {
  background: var(--chat-gradient);
  color: white;
  padding: 24px;
  border-radius: var(--chat-radius) var(--chat-radius) 0 0;
  margin-bottom: 24px;
  position: relative;
  overflow: hidden;
}

.modern-chat-header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="10" cy="10" r="1" fill="white" opacity="0.1"/><circle cx="30" cy="30" r="1" fill="white" opacity="0.1"/><circle cx="50" cy="50" r="1" fill="white" opacity="0.1"/><circle cx="70" cy="70" r="1" fill="white" opacity="0.1"/><circle cx="90" cy="90" r="1" fill="white" opacity="0.1"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
  pointer-events: none;
}

.chat-header-icon {
  width: 56px;
  height: 56px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin-right: 16px;
  backdrop-filter: blur(10px);
}

.chat-title {
  margin: 0;
  font-size: 1.8rem;
  font-weight: 700;
}

.chat-subtitle {
  margin: 4px 0 0 0;
  opacity: 0.9;
  font-size: 1rem;
}

.btn-modern {
  border-radius: var(--chat-radius-sm);
  padding: 10px 16px;
  font-weight: 500;
  transition: var(--chat-transition);
  border: none;
  position: relative;
  overflow: hidden;
}

.btn-modern::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transition: left 0.5s;
}

.btn-modern:hover::before {
  left: 100%;
}

.btn-modern.btn-outline-light {
  border: 2px solid rgba(255, 255, 255, 0.3);
  color: white;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
}

.btn-modern.btn-outline-light:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.5);
  transform: translateY(-2px);
}

/* Modern Chat Container */
.modern-chat-container {
  display: flex;
  height: calc(100vh - 200px);
  background: var(--chat-white);
  border-radius: var(--chat-radius);
  overflow: hidden;
  box-shadow: var(--chat-shadow-lg);
}

/* Contacts Sidebar */
.contacts-sidebar {
  width: 380px;
  background: #fafbfc;
  border-right: 1px solid var(--chat-border);
  display: flex;
  flex-direction: column;
}

/* Search Section */
.search-section {
  padding: 20px;
  border-bottom: 1px solid var(--chat-border);
}

.search-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  background: var(--chat-white);
  border-radius: var(--chat-radius-sm);
  border: 2px solid transparent;
  transition: var(--chat-transition);
  overflow: hidden;
}

.search-wrapper:focus-within {
  border-color: var(--chat-primary);
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.search-icon {
  position: absolute;
  left: 16px;
  color: #6c757d;
  font-size: 1.1rem;
  z-index: 2;
}

.search-input {
  flex: 1;
  border: none;
  padding: 14px 16px 14px 48px;
  font-size: 1rem;
  background: transparent;
  outline: none;
  color: var(--chat-dark);
}

.search-input::placeholder {
  color: #6c757d;
}

.search-btn {
  background: none;
  border: none;
  padding: 14px 16px;
  color: #6c757d;
  cursor: pointer;
  transition: var(--chat-transition);
}

.search-btn:hover {
  color: var(--chat-primary);
}

/* Quick Actions */
.quick-actions {
  display: flex;
  padding: 16px 20px;
  gap: 8px;
  border-bottom: 1px solid var(--chat-border);
}

.quick-action-btn {
  flex: 1;
  background: var(--chat-white);
  border: 2px solid transparent;
  border-radius: var(--chat-radius-sm);
  padding: 12px 8px;
  text-align: center;
  cursor: pointer;
  transition: var(--chat-transition);
  color: #6c757d;
  font-size: 0.85rem;
  font-weight: 500;
}

.quick-action-btn i {
  display: block;
  font-size: 1.2rem;
  margin-bottom: 4px;
}

.quick-action-btn:hover {
  border-color: var(--chat-primary);
  color: var(--chat-primary);
  transform: translateY(-2px);
}

.quick-action-btn.active {
  background: var(--chat-primary);
  color: white;
  border-color: var(--chat-primary);
}

/* Contacts Scroll */
.contacts-scroll {
  flex: 1;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #cbd5e0 transparent;
}

.contacts-scroll::-webkit-scrollbar {
  width: 6px;
}

.contacts-scroll::-webkit-scrollbar-track {
  background: transparent;
}

.contacts-scroll::-webkit-scrollbar-thumb {
  background: #cbd5e0;
  border-radius: 3px;
}

/* Contact Items */
.contact-item-modern {
  position: relative;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
  border-radius: 12px;
  margin: 4px 8px;
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.contact-item-modern:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: translateY(-1px);
}

.contact-item-modern.selected {
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.2), rgba(118, 75, 162, 0.2));
  border: 1px solid rgba(102, 126, 234, 0.3);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.1);
}

.contact-item-modern.selected::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: 4px;
  background: linear-gradient(135deg, #667eea, #764ba2);
  border-radius: 4px 0 0 4px;
}

.contact-avatar-modern {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, #667eea, #764ba2);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.2);
  border: 2px solid rgba(255, 255, 255, 0.8);
}

.contact-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.contact-name-modern {
  font-weight: 600;
  font-size: 14px;
  color: #1a1a1a;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.contact-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  color: #6b7280;
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
  .contact-item-modern {
    background: rgba(0, 0, 0, 0.2);
    border-color: rgba(255, 255, 255, 0.05);
  }

  .contact-item-modern:hover {
    background: rgba(0, 0, 0, 0.3);
  }

  .contact-item-modern.selected {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.15), rgba(118, 75, 162, 0.15));
    border-color: rgba(102, 126, 234, 0.2);
  }

  .contact-name-modern {
    color: #f3f4f6;
  }

  .contact-meta {
    color: #9ca3af;
  }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .contact-item-modern {
    background: #ffffff;
    border: 2px solid #000000;
  }

  .contact-item-modern.selected {
    background: #e0e7ff;
    border-color: #4f46e5;
  }

  .contact-name-modern {
    color: #000000;
  }

  .contact-meta {
    color: #374151;
  }
}

.online-indicator {
  position: absolute;
  bottom: 2px;
  right: 2px;
  width: 14px;
  height: 14px;
  background: var(--chat-success);
  border: 3px solid var(--chat-white);
  border-radius: 50%;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.1); opacity: 0.8; }
  100% { transform: scale(1); opacity: 1; }
}

.contact-content {
  flex: 1;
  min-width: 0;
}

.contact-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 4px;
}

.contact-name-modern {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: var(--chat-dark);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.contact-meta {
  display: flex;
  align-items: center;
  gap: 8px;
}

.contact-time {
  font-size: 0.75rem;
  color: #6c757d;
  white-space: nowrap;
}

.unread-badge {
  background: var(--chat-primary);
  color: white;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 10px;
  min-width: 18px;
  text-align: center;
}

.contact-preview {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.message-preview {
  flex: 1;
  display: flex;
  align-items: center;
}

.preview-text {
  color: #6c757d;
  font-size: 0.85rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.contact-info-btn {
  background: none;
  border: none;
  color: #6c757d;
  padding: 4px;
  border-radius: 4px;
  cursor: pointer;
  transition: var(--chat-transition);
  opacity: 0;
}

.contact-item-modern:hover .contact-info-btn {
  opacity: 1;
}

.contact-info-btn:hover {
  background: rgba(102, 126, 234, 0.1);
  color: var(--chat-primary);
}

/* Loading and Empty States */
.loading-state, .empty-contacts-state, .error-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  text-align: center;
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid #f3f3f3;
  border-top: 3px solid var(--chat-primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 16px;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.empty-icon, .error-icon {
  font-size: 3rem;
  color: #6c757d;
  margin-bottom: 16px;
}

.empty-contacts-state h5, .error-state h5 {
  color: var(--chat-dark);
  margin-bottom: 8px;
}

.empty-contacts-state p, .error-state p {
  color: #6c757d;
  margin-bottom: 20px;
}

/* Main Chat Area */
.main-chat-area {
  flex: 1;
  display: flex;
  position: relative;
}

/* Contact Info Panel */
.contact-info-panel {
  width: 320px;
  background: var(--chat-white);
  border-left: 1px solid var(--chat-border);
  position: absolute;
  right: -320px;
  top: 0;
  bottom: 0;
  z-index: 100;
  transition: var(--chat-transition);
  display: flex;
  flex-direction: column;
}

.contact-info-panel.show {
  right: 0;
}

.contact-info-panel.animate-in {
  transform: translateX(0);
}

.chat-interface.info-panel-open {
  margin-right: 320px;
}

.contact-info-header {
  padding: 24px;
  background: var(--chat-gradient);
  color: white;
  text-align: center;
  position: relative;
}

.close-info-btn {
  position: absolute;
  top: 16px;
  right: 16px;
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  transition: var(--chat-transition);
}

.close-info-btn:hover {
  background: rgba(255, 255, 255, 0.3);
}

.contact-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  backdrop-filter: blur(10px);
}

.contact-avatar span {
  font-size: 1.8rem;
  font-weight: 700;
}

.contact-info-header h4 {
  margin: 0 0 8px 0;
  font-size: 1.3rem;
  font-weight: 600;
}

.contact-info-header p {
  margin: 0;
  opacity: 0.9;
}

.contact-info-body {
  flex: 1;
  padding: 24px;
  overflow-y: auto;
}

.info-section {
  margin-bottom: 24px;
}

.info-section h6 {
  color: var(--chat-dark);
  font-weight: 600;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
}

.info-section p {
  color: #6c757d;
  margin: 0;
}

.message-history-preview {
  max-height: 200px;
  overflow-y: auto;
}

.history-message {
  padding: 8px 12px;
  margin-bottom: 8px;
  border-radius: var(--chat-radius-sm);
  font-size: 0.85rem;
}

.history-message.incoming {
  background: #f1f3f4;
  margin-right: 20px;
}

.history-message.outgoing {
  background: rgba(102, 126, 234, 0.1);
  margin-left: 20px;
  text-align: right;
}

.history-content {
  margin-bottom: 4px;
}

.history-time {
  font-size: 0.75rem;
  color: #6c757d;
}

.contact-actions {
  display: flex;
  gap: 12px;
}

.contact-actions .btn-modern {
  flex: 1;
}

/* Chat Interface */
.chat-interface {
  flex: 1;
  display: flex;
  flex-direction: column;
  transition: var(--chat-transition);
}

/* Chat Header */
.chat-header-modern {
  padding: 20px 24px;
  border-bottom: 1px solid var(--chat-border);
  background: var(--chat-white);
  min-height: 80px;
  display: flex;
  align-items: center;
}

.chat-welcome {
  text-align: center;
  width: 100%;
}

.welcome-icon {
  font-size: 3rem;
  color: var(--chat-primary);
  margin-bottom: 16px;
}

.chat-welcome h3 {
  color: var(--chat-dark);
  margin-bottom: 8px;
}

.chat-welcome p {
  color: #6c757d;
  margin: 0;
}

.chat-header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.chat-contact-info {
  display: flex;
  align-items: center;
}

.chat-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--chat-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 16px;
  position: relative;
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.chat-initials {
  color: white;
  font-weight: 600;
  font-size: 0.9rem;
}

.online-indicator-small {
  position: absolute;
  bottom: 2px;
  right: 2px;
  width: 12px;
  height: 12px;
  background: var(--chat-success);
  border: 2px solid var(--chat-white);
  border-radius: 50%;
}

.chat-contact-name {
  margin: 0 0 4px 0;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--chat-dark);
}

.chat-contact-status {
  margin: 0;
  font-size: 0.85rem;
  color: #6c757d;
  display: flex;
  align-items: center;
}

.chat-actions {
  display: flex;
  gap: 8px;
}

.chat-action-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: transparent;
  border: 2px solid var(--chat-border);
  color: #6c757d;
  cursor: pointer;
  transition: var(--chat-transition);
  display: flex;
  align-items: center;
  justify-content: center;
}

.chat-action-btn:hover {
  border-color: var(--chat-primary);
  color: var(--chat-primary);
  background: rgba(102, 126, 234, 0.05);
}

/* Chat Messages */
.chat-messages-modern {
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px;
  background: #fafbfc;
  scrollbar-width: thin;
  scrollbar-color: #cbd5e0 transparent;
}

.chat-messages-modern::-webkit-scrollbar {
  width: 6px;
}

.chat-messages-modern::-webkit-scrollbar-track {
  background: transparent;
}

.chat-messages-modern::-webkit-scrollbar-thumb {
  background: #cbd5e0;
  border-radius: 3px;
}

.empty-chat-state, .empty-messages-state, .loading-messages {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  text-align: center;
}

.empty-chat-state .empty-icon, .empty-messages-state .empty-icon {
  font-size: 4rem;
  color: #6c757d;
  margin-bottom: 20px;
}

.empty-chat-state h4, .empty-messages-state h4 {
  color: var(--chat-dark);
  margin-bottom: 12px;
}

.empty-chat-state p, .empty-messages-state p {
  color: #6c757d;
  margin-bottom: 24px;
}

/* Modern Messages */
.date-separator {
  text-align: center;
  margin: 24px 0;
  position: relative;
}

.date-separator::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--chat-border);
}

.date-text {
  background: #fafbfc;
  color: #6c757d;
  padding: 8px 16px;
  border-radius: 16px;
  font-size: 0.8rem;
  font-weight: 500;
  position: relative;
  z-index: 1;
}

.message-modern {
  display: flex;
  margin-bottom: 4px;
  opacity: 0;
  transform: translateY(20px);
  transition: var(--chat-transition);
}

.message-modern.animate-in {
  opacity: 1;
  transform: translateY(0);
}

.message-modern.first-in-group {
  margin-top: 16px;
}

.message-modern.last-in-group {
  margin-bottom: 16px;
}

.message-modern.incoming {
  justify-content: flex-start;
}

.message-modern.outgoing {
  justify-content: flex-end;
}

.message-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--chat-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 12px;
  margin-top: auto;
  flex-shrink: 0;
}

.message-initials {
  color: white;
  font-size: 0.75rem;
  font-weight: 600;
}

.message-bubble {
  max-width: 70%;
  position: relative;
}

.message-content-modern {
  padding: 12px 16px;
  border-radius: 18px;
  word-wrap: break-word;
  line-height: 1.4;
  position: relative;
}

.message-modern.incoming .message-content-modern {
  background: var(--chat-white);
  color: var(--chat-dark);
  border-bottom-left-radius: 6px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.message-modern.outgoing .message-content-modern {
  background: var(--chat-gradient);
  color: white;
  border-bottom-right-radius: 6px;
  box-shadow: 0 1px 2px rgba(102, 126, 234, 0.3);
}

.message-link {
  color: inherit;
  text-decoration: underline;
}

.message-meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  margin-top: 4px;
  gap: 6px;
}

.message-time-modern {
  font-size: 0.75rem;
  opacity: 0.7;
}

.message-modern.incoming .message-time-modern {
  color: #6c757d;
}

.message-modern.outgoing .message-time-modern {
  color: white;
}

.message-status {
  font-size: 0.8rem;
}

/* Chat Input */
.chat-input-modern {
  padding: 20px 24px;
  background: var(--chat-white);
  border-top: 1px solid var(--chat-border);
  opacity: 0;
  transform: translateY(20px);
  transition: var(--chat-transition);
}

.chat-input-modern.slide-up {
  opacity: 1;
  transform: translateY(0);
}

.input-wrapper {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  background: #f8f9fa;
  border-radius: 24px;
  padding: 8px;
  border: 2px solid transparent;
  transition: var(--chat-transition);
}

.input-wrapper:focus-within {
  border-color: var(--chat-primary);
  background: var(--chat-white);
}

.input-actions-left, .input-actions-right {
  display: flex;
  gap: 4px;
}

.input-action-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: none;
  border: none;
  color: #6c757d;
  cursor: pointer;
  transition: var(--chat-transition);
  display: flex;
  align-items: center;
  justify-content: center;
}

.input-action-btn:hover {
  background: rgba(102, 126, 234, 0.1);
  color: var(--chat-primary);
}

.message-input-wrapper {
  flex: 1;
}

.message-input-wrapper textarea {
  width: 100%;
  border: none;
  background: none;
  resize: none;
  outline: none;
  font-size: 1rem;
  line-height: 1.4;
  padding: 8px 12px;
  color: var(--chat-dark);
  max-height: 120px;
  min-height: 20px;
}

.message-input-wrapper textarea::placeholder {
  color: #6c757d;
}

.send-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--chat-gradient);
  border: none;
  color: white;
  cursor: pointer;
  transition: var(--chat-transition);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.send-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.send-btn:active {
  transform: scale(0.95);
}

/* Responsive Design */
@media (max-width: 1024px) {
  .contacts-sidebar {
    width: 300px;
  }
  
  .contact-info-panel {
    width: 280px;
  }
  
  .chat-interface.info-panel-open {
    margin-right: 280px;
  }
}

@media (max-width: 768px) {
  .modern-chat-container {
    flex-direction: column;
    height: calc(100vh - 150px);
  }
  
  .contacts-sidebar {
    width: 100%;
    height: 250px;
    border-right: none;
    border-bottom: 1px solid var(--chat-border);
  }
  
  .contact-info-panel {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    z-index: 1000;
    background: var(--chat-white);
  }
  
  .chat-interface.info-panel-open {
    margin-right: 0;
  }
  
  .quick-actions {
    padding: 12px 16px;
  }
  
  .quick-action-btn {
    padding: 8px 4px;
    font-size: 0.8rem;
  }
  
  .contact-item-modern {
    padding: 12px 16px;
  }
  
  .chat-messages-modern {
    padding: 16px;
  }
  
  .chat-input-modern {
    padding: 16px;
  }
  
  .message-bubble {
    max-width: 85%;
  }
}

@media (max-width: 480px) {
  .modern-chat-header {
    padding: 16px;
  }
  
  .chat-title {
    font-size: 1.5rem;
  }
  
  .contacts-sidebar {
    height: 200px;
  }
  
  .search-section {
    padding: 16px;
  }
  
  .quick-action-btn span {
    display: none;
  }
  
  .contact-name-modern {
    font-size: 0.9rem;
  }
  
  .message-content-modern {
    padding: 10px 14px;
    font-size: 0.9rem;
  }
}

/* Robust Dark Mode Support - Browser Agnostic */
:root {
  /* Light theme (default) */
  --bg-primary: #ffffff;
  --bg-secondary: #f8fafc;
  --bg-tertiary: #f1f5f9;
  --text-primary: #1e293b;
  --text-secondary: #64748b;
  --text-muted: #94a3b8;
  --border-color: #e2e8f0;
  --border-light: #f1f5f9;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  --hover-bg: #f8fafc;
  --active-bg: #e2e8f0;
}

/* Dark theme override - only when explicitly set */
[data-theme="dark"] {
  --bg-primary: #0f172a;
  --bg-secondary: #1e293b;
  --bg-tertiary: #334155;
  --text-primary: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;
  --border-color: #334155;
  --border-light: #475569;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
  --hover-bg: #1e293b;
  --active-bg: #334155;
}

/* Conditional dark mode - only if user hasn't set explicit preference */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-tertiary: #334155;
    --text-primary: #f8fafc;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;
    --border-color: #334155;
    --border-light: #475569;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
    --hover-bg: #1e293b;
    --active-bg: #334155;
  }
}
  
  .message-modern.incoming .message-content-modern {
    background: #2d2d2d;
    color: #ffffff;
  }
}

/* Animation keyframes */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

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

/* Utility animations */
.fade-in-up {
  animation: fadeInUp 0.6s ease-out;
}

.slide-in-left {
  animation: slideInLeft 0.4s ease-out;
}

.slide-in-right {
  animation: slideInRight 0.4s ease-out;
}

/* Typing Indicator Animation */
.typing-animation {
  display: flex !important;
  align-items: center;
  gap: 4px;
  padding: 12px 16px !important;
}

.typing-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #6c757d;
  animation: typing 1.4s infinite ease-in-out;
}

.typing-dot:nth-child(1) {
  animation-delay: 0s;
}

.typing-dot:nth-child(2) {
  animation-delay: 0.2s;
}

.typing-dot:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes typing {
  0%, 80%, 100% {
    transform: scale(0.8);
    opacity: 0.5;
  }
  40% {
    transform: scale(1);
    opacity: 1;
  }
}

/* Message Status Icons */
.message-status {
  display: flex;
  align-items: center;
}

.message-status i {
  font-size: 0.75rem;
}

/* Enhanced Button Styles for Modern Interface */
.btn-modern.btn-primary {
  background: var(--chat-gradient);
  color: white;
  border: 2px solid transparent;
}

.btn-modern.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.btn-modern.btn-outline-secondary {
  border: 2px solid var(--chat-border);
  color: #6c757d;
  background: transparent;
}

.btn-modern.btn-outline-secondary:hover {
  border-color: var(--chat-primary);
  color: var(--chat-primary);
  background: rgba(102, 126, 234, 0.05);
}

.btn-modern.btn-outline-primary {
  border: 2px solid var(--chat-primary);
  color: var(--chat-primary);
  background: transparent;
}

.btn-modern.btn-outline-primary:hover {
  background: var(--chat-primary);
  color: white;
}

/* Accessibility Improvements */
@media (prefers-reduced-motion: reduce) {
  .message-modern,
  .contact-item-modern,
  .btn-modern,
  .chat-input-modern,
  .typing-dot {
    animation: none !important;
    transition: none !important;
  }
  
  .message-modern.animate-in,
  .contact-item-modern.animate-in {
    opacity: 1 !important;
    transform: none !important;
  }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  :root {
    --chat-border: #000000;
    --chat-primary: #0000ff;
    --chat-success: #008000;
    --chat-danger: #ff0000;
    --chat-warning: #ff8000;
  }
  
  .message-modern.incoming .message-content-modern {
    border: 2px solid var(--chat-border);
  }
  
  .message-modern.outgoing .message-content-modern {
    border: 2px solid #000000;
  }
}

/* Team and Agent Assignment Styles */

.assignment-filters {
  padding: 15px;
  border-bottom: 1px solid #e0e0e0;
  background-color: #f8f9fa;
}

.filter-section {
  margin: 0;
}

.filter-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: #495057;
  margin-bottom: 8px;
  display: block;
}

.filter-select {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #ced4da;
  border-radius: 6px;
  background-color: #fff;
  font-size: 0.875rem;
  color: #495057;
  transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.filter-select:focus {
  border-color: #80bdff;
  outline: 0;
  box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.filter-actions {
  margin-top: 10px;
}

.filter-actions .btn {
  padding: 6px 12px;
  font-size: 0.875rem;
}

/* Active Chat Header Styles */
.active-chat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 20px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border-bottom: 1px solid #e0e0e0;
}

.chat-contact-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.contact-avatar-small {
  width: 45px;
  height: 45px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  color: white;
  border: 2px solid rgba(255, 255, 255, 0.3);
}

.contact-details h5 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
  color: white;
}

.contact-details p {
  margin: 0;
  font-size: 0.875rem;
  opacity: 0.9;
  color: white;
}

.assignment-info {
  margin-top: 4px;
}

.assignment-controls {
  display: flex;
  gap: 8px;
}

.assignment-controls .btn {
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: white;
  backdrop-filter: blur(10px);
  transition: all 0.3s ease;
}

.assignment-controls .btn:hover {
  background: rgba(255, 255, 255, 0.25);
  border-color: rgba(255, 255, 255, 0.5);
  color: white;
  transform: translateY(-1px);
}

/* Assignment Badge Styles */
.assignment-badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 500;
  margin-right: 4px;
  margin-top: 2px;
}

.team-badge {
  background-color: #e3f2fd;
  color: #1565c0;
  border: 1px solid #bbdefb;
}

.agent-badge {
  background-color: #f3e5f5;
  color: #7b1fa2;
  border: 1px solid #e1bee7;
}

.unassigned-badge {
  background-color: #fafafa;
  color: #616161;
  border: 1px solid #e0e0e0;
}

.assignment-badges {
  margin-top: 6px;
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
}

/* Dark theme for assignment badges */
@media (prefers-color-scheme: dark) {
  .team-badge {
    background-color: #1a237e;
    color: #90caf9;
    border-color: #3949ab;
  }
  
  .agent-badge {
    background-color: #4a148c;
    color: #ce93d8;
    border-color: #8e24aa;
  }
  
  .unassigned-badge {
    background-color: #424242;
    color: #bdbdbd;
    border-color: #616161;
  }
}

/* Contact List Assignment Info */
.contact-item .assignment-badges {
  margin-top: 4px;
}

.contact-item .assignment-badge {
  font-size: 0.7rem;
  padding: 2px 6px;
}

/* Empty/Error States for Filtered Messages */
.empty-state, .error-state {
  text-align: center;
  padding: 40px 20px;
  color: #6c757d;
}

.empty-state .empty-icon, .error-state .error-icon {
  font-size: 3rem;
  margin-bottom: 20px;
  opacity: 0.5;
}

.empty-state h4, .error-state h4 {
  font-size: 1.25rem;
  margin-bottom: 10px;
  color: #495057;
}

.empty-state p, .error-state p {
  font-size: 0.95rem;
  color: #6c757d;
}

/* Assignment Modal Styles */
.modal-header h5 {
  display: flex;
  align-items: center;
}

.modal-header h5 i {
  margin-right: 8px;
  color: #007bff;
}

.alert.alert-info {
  background-color: #d1ecf1;
  border-color: #bee5eb;
  color: #0c5460;
  border-radius: 8px;
  margin-bottom: 0;
}

/* Responsive adjustments for assignment features */
@media (max-width: 768px) {
  .assignment-filters {
    padding: 10px;
  }
  
  .active-chat-header {
    padding: 12px 15px;
  }
  
  .chat-contact-info {
    gap: 8px;
  }
  
  .contact-avatar-small {
    width: 40px;
    height: 40px;
  }
  
  .contact-details h5 {
    font-size: 1rem;
  }
  
  .assignment-controls {
    gap: 6px;
  }
  
  .assignment-controls .btn {
    padding: 6px 10px;
    font-size: 0.8rem;
  }
  
  .assignment-badge {
    font-size: 0.7rem;
    padding: 2px 6px;
  }
}

/* Agent role and status styling for auto-assignment features */
.agent-status .status-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.5rem;
  border-radius: 0.375rem;
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: capitalize;
  white-space: nowrap;
}

.agent-actions .btn-group-sm .btn {
  padding: 0.25rem 0.4rem;
  font-size: 0.75rem;
}

.agent-actions .btn-group-sm .btn i {
  font-size: 0.7rem;
}

.agent-card {
  transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

.agent-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.agents-grid .col-md-6 {
  margin-bottom: 1rem;
}

/* Auto-assignment indicator */
.auto-assigned-indicator {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  background: linear-gradient(45deg, #28a745, #20c997);
  color: white;
  font-size: 0.7rem;
  padding: 0.2rem 0.4rem;
  border-radius: 0.25rem;
  font-weight: 600;
}

.auto-assigned-indicator i {
  margin-right: 0.25rem;
}

/* Status indicator tooltips */
.status-indicator {
  position: relative;
  display: inline-block;
}

.status-indicator::after {
  content: attr(data-status);
  position: absolute;
  bottom: -1.5rem;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.8);
  color: white;
  padding: 0.25rem 0.5rem;
  border-radius: 0.25rem;
  font-size: 0.7rem;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s, visibility 0.2s;
  z-index: 1000;
}

.status-indicator:hover::after {
  opacity: 1;
  visibility: visible;
}

/* Role-based styling */
.role-admin {
  border-left: 4px solid #dc3545;
}

.role-supervisor {
  border-left: 4px solid #6f42c1;
}

.role-agent {
  border-left: 4px solid #007bff;
}

/* Quick status buttons */
.quick-status-buttons {
  display: flex;
  gap: 0.25rem;
  margin-bottom: 0.5rem;
}

.quick-status-buttons .btn {
  flex: 1;
  min-width: auto;
  padding: 0.25rem 0.3rem;
}

/* Agent workload indicators */
.workload-indicator {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.workload-bar {
  width: 40px;
  height: 4px;
  background: #e9ecef;
  border-radius: 2px;
  overflow: hidden;
  margin-left: 0.5rem;
}

.workload-fill {
  height: 100%;
  transition: width 0.3s ease;
}

.workload-light .workload-fill {
  background: #28a745;
  width: 30%;
}

.workload-moderate .workload-fill {
  background: #ffc107;
  width: 70%;
}

.workload-heavy .workload-fill {
  background: #dc3545;
  width: 100%;
}

/* Dark mode updates for auto-assignment features */
@media (prefers-color-scheme: dark) {
  .agent-card {
    background-color: #2a2a2a;
    border-color: #444;
  }
  
  .agent-card:hover {
    background-color: #333;
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.1);
  }
  
  .status-indicator::after {
    background: rgba(255, 255, 255, 0.9);
    color: #000;
  }
  
  .workload-bar {
    background: #495057;
  }
}

/* Enhanced Status Dropdown Colors - Override Bootstrap */
.dropdown-menu.user-status-dropdown .dropdown-item[data-action="status-online"] {
  color: #059669 !important;
  font-weight: 500 !important;
}

.dropdown-menu.user-status-dropdown .dropdown-item[data-action="status-online"]:hover,
.dropdown-menu.user-status-dropdown .dropdown-item[data-action="status-online"]:focus {
  background-color: rgba(5, 150, 105, 0.08) !important;
  border-left-color: #059669 !important;
  color: #047857 !important;
}

.dropdown-menu.user-status-dropdown .dropdown-item[data-action="status-online"] i,
.dropdown-menu.user-status-dropdown .dropdown-item[data-action="status-online"] .bi {
  color: #10b981 !important;
}

.dropdown-menu.user-status-dropdown .dropdown-item[data-action="status-away"] {
  color: #d97706 !important;
  font-weight: 500 !important;
}

.dropdown-menu.user-status-dropdown .dropdown-item[data-action="status-away"]:hover,
.dropdown-menu.user-status-dropdown .dropdown-item[data-action="status-away"]:focus {
  background-color: rgba(217, 119, 6, 0.08) !important;
  border-left-color: #d97706 !important;
  color: #b45309 !important;
}

.dropdown-menu.user-status-dropdown .dropdown-item[data-action="status-away"] i,
.dropdown-menu.user-status-dropdown .dropdown-item[data-action="status-away"] .bi {
  color: #f59e0b !important;
}

.dropdown-menu.user-status-dropdown .dropdown-item[data-action="status-offline"] {
  color: #6b7280 !important;
  font-weight: 500 !important;
}

.dropdown-menu.user-status-dropdown .dropdown-item[data-action="status-offline"]:hover,
.dropdown-menu.user-status-dropdown .dropdown-item[data-action="status-offline"]:focus {
  background-color: rgba(107, 114, 128, 0.08) !important;
  border-left-color: #6b7280 !important;
  color: #4b5563 !important;
}

.dropdown-menu.user-status-dropdown .dropdown-item[data-action="status-offline"] i,
.dropdown-menu.user-status-dropdown .dropdown-item[data-action="status-offline"] .bi {
  color: #9ca3af !important;
}

.dropdown-menu.user-status-dropdown .dropdown-item[data-action="status-busy"] {
  color: #dc2626 !important;
  font-weight: 500 !important;
}

.dropdown-menu.user-status-dropdown .dropdown-item[data-action="status-busy"]:hover,
.dropdown-menu.user-status-dropdown .dropdown-item[data-action="status-busy"]:focus {
  background-color: rgba(220, 38, 38, 0.08) !important;
  border-left-color: #dc2626 !important;
  color: #b91c1c !important;
}

.dropdown-menu.user-status-dropdown .dropdown-item[data-action="status-busy"] i,
.dropdown-menu.user-status-dropdown .dropdown-item[data-action="status-busy"] .bi {
  color: #ef4444 !important;
}

/* Force override Bootstrap icon colors */
.dropdown-menu.user-status-dropdown .dropdown-item[data-action="status-online"] .bi-circle-fill::before {
  color: #10b981 !important;
}

.dropdown-menu.user-status-dropdown .dropdown-item[data-action="status-away"] .bi-circle-fill::before {
  color: #f59e0b !important;
}

.dropdown-menu.user-status-dropdown .dropdown-item[data-action="status-offline"] .bi-circle-fill::before {
  color: #9ca3af !important;
}

.dropdown-menu.user-status-dropdown .dropdown-item[data-action="status-busy"] .bi-circle-fill::before {
  color: #ef4444 !important;
}

/* Collapsible INBOX sidebar styles (NOT main navigation sidebar) */
.sidebar-toggle {
  background: none;
  border: none;
  color: #007bff;
  font-size: 1.2rem;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  transition: all 0.3s ease;
}

.sidebar-toggle:hover {
  background-color: rgba(0, 123, 255, 0.1);
  color: #0056b3;
}

/* Specific styles for inbox-sidebar collapse (not affecting main nav sidebar) */
#inbox-sidebar.collapsed {
  width: 60px !important;
  min-width: 60px !important;
}

#inbox-sidebar.collapsed .sidebar-content {
  overflow: hidden;
}

#inbox-sidebar.collapsed .section-title,
#inbox-sidebar.collapsed .team-item span,
#inbox-sidebar.collapsed .custom-section span,
#inbox-sidebar.collapsed .search-bar,
#inbox-sidebar.collapsed .status-filter,
#inbox-sidebar.collapsed .filter-item span {
  display: none;
}

#inbox-sidebar.collapsed .filter-item {
  justify-content: center;
  padding: 0.5rem;
}

#inbox-sidebar.collapsed .team-item {
  justify-content: center;
  padding: 0.5rem;
}

/* Smooth transition only for inbox-sidebar */
#inbox-sidebar {
  transition: width 0.3s ease, min-width 0.3s ease;
}

/* Tooltips for collapsed inbox-sidebar */
#inbox-sidebar.collapsed .filter-item,
#inbox-sidebar.collapsed .team-item {
  position: relative;
}

#inbox-sidebar.collapsed .filter-item:hover::after,
#inbox-sidebar.collapsed .team-item:hover::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 70px;
  top: 50%;
  transform: translateY(-50%);
  background: #333;
  color: white;
  padding: 5px 10px;
  border-radius: 4px;
  white-space: nowrap;
  z-index: 1000;
  font-size: 0.875rem;
}

/* Inbox-specific mobile optimizations */
@media (max-width: 768px) {
  #inbox-sidebar {
    position: fixed;
    left: -250px;
    z-index: 1050;
    background: #fff;
    box-shadow: 2px 0 8px rgba(0,0,0,0.1);
  }
  
  #inbox-sidebar.show {
    left: 0;
  }
  
  #inbox-sidebar.collapsed {
    left: -60px;
  }
  
  #inbox-sidebar.collapsed.show {
    left: 0;
    width: 60px !important;
  }
}

/* Conversation Info Panel Styles */
.conversation-info-panel {
  position: fixed;
  top: 0;
  right: -450px;
  width: 400px;
  height: 100vh;
  background: white;
  border-left: 1px solid #e9ecef;
  box-shadow: -4px 0 20px rgba(0, 0, 0, 0.1);
  z-index: 1060;
  transition: right 0.3s ease;
  overflow-y: auto;
}

.conversation-info-panel.show {
  right: 0;
}

.info-panel-header {
  position: sticky;
  top: 0;
  background: white;
  padding: 20px 24px;
  border-bottom: 1px solid #e9ecef;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 1;
}

.info-panel-header h5 {
  margin: 0;
  color: #2c3e50;
  font-weight: 600;
  display: flex;
  align-items: center;
}

.info-panel-header button {
  border: 1px solid #dee2e6;
  background: white;
  color: #6c757d;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.info-panel-header button:hover {
  background: #f8f9fa;
  border-color: #adb5bd;
  color: #495057;
}

.info-panel-content {
  padding: 0 24px 24px;
}

.info-section {
  margin-bottom: 32px;
}

.info-section-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 2px solid #f8f9fa;
}

.info-section-header i {
  color: #007bff;
  font-size: 1.1rem;
}

.info-section-header h6 {
  margin: 0;
  color: #2c3e50;
  font-weight: 600;
  font-size: 0.95rem;
}

.info-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 8px 0;
  border-bottom: 1px solid #f8f9fa;
}

.info-item:last-child {
  border-bottom: none;
}

.info-item label {
  font-weight: 500;
  color: #6c757d;
  font-size: 0.85rem;
  min-width: 120px;
  margin: 0;
}

.info-item span {
  color: #2c3e50;
  font-size: 0.9rem;
  text-align: right;
  flex: 1;
}

.info-item.unassigned {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #f39c12;
  font-style: italic;
}

.agent-info {
  display: flex;
  align-items: center;
  gap: 8px;
}

.agent-avatar-small {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: linear-gradient(135deg, #007bff, #0056b3);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 0.7rem;
  font-weight: 600;
}

.last-message-preview {
  background: #f8f9fa;
  padding: 8px 12px;
  border-radius: 8px;
  border-left: 3px solid #007bff;
  font-style: italic;
  color: #495057;
  font-size: 0.85rem;
  margin-top: 4px;
  max-width: 100%;
  word-wrap: break-word;
}

/* Assignment Timeline */
.assignment-timeline {
  position: relative;
}

.timeline-item {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
  position: relative;
}

.timeline-item:not(:last-child)::after {
  content: '';
  position: absolute;
  left: 11px;
  top: 32px;
  bottom: -16px;
  width: 2px;
  background: #e9ecef;
}

.timeline-icon {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #007bff;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 0.75rem;
  flex-shrink: 0;
  z-index: 1;
  position: relative;
}

.timeline-content {
  flex: 1;
}

.timeline-action {
  font-weight: 600;
  color: #2c3e50;
  font-size: 0.9rem;
  margin-bottom: 2px;
}

.timeline-time {
  color: #6c757d;
  font-size: 0.75rem;
  margin-bottom: 4px;
}

.timeline-details {
  color: #495057;
  font-size: 0.8rem;
  font-style: italic;
}

/* Metrics Grid */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.metric-item {
  text-align: center;
  padding: 16px 12px;
  background: #f8f9fa;
  border-radius: 8px;
  border: 1px solid #e9ecef;
  transition: all 0.2s ease;
}

.metric-item:hover {
  background: #e3f2fd;
  border-color: #007bff;
}

.metric-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: #007bff;
  margin-bottom: 4px;
}

.metric-label {
  font-size: 0.75rem;
  color: #6c757d;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Quick Actions Grid */
.quick-actions-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.quick-actions-grid .btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 12px 8px;
  font-size: 0.8rem;
  border-radius: 8px;
  transition: all 0.2s ease;
}

.quick-actions-grid .btn i {
  font-size: 1rem;
}

.quick-actions-grid .btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* Badge Styles for Info Panel */
.info-section .badge {
  font-size: 0.75rem;
  padding: 4px 8px;
  border-radius: 12px;
  font-weight: 500;
}

/* Responsive Design for Info Panel */
@media (max-width: 768px) {
  .conversation-info-panel {
    width: 320px;
    right: -320px;
  }
  
  .info-panel-header,
  .info-panel-content {
    padding-left: 16px;
    padding-right: 16px;
  }
  
  .metrics-grid,
  .quick-actions-grid {
    grid-template-columns: 1fr;
  }
  
  .info-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }
  
  .info-item label {
    min-width: auto;
  }
  
  .info-item span {
    text-align: left;
  }
}

@media (max-width: 480px) {
  .conversation-info-panel {
    width: 100vw;
    right: -100vw;
  }
}

/* Animation for smooth transitions */
@keyframes slideInRight {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.conversation-info-panel.show {
  animation: slideInRight 0.3s ease-out;
}

/* Scrollbar styling for info panel */
.conversation-info-panel::-webkit-scrollbar {
  width: 6px;
}

.conversation-info-panel::-webkit-scrollbar-track {
  background: #f8f9fa;
}

.conversation-info-panel::-webkit-scrollbar-thumb {
  background: #dee2e6;
  border-radius: 3px;
}

.conversation-info-panel::-webkit-scrollbar-thumb:hover {
  background: #adb5bd;
}

/* Status Dropdown Styles */
.dropdown-menu {
  min-width: 200px;
  padding: 0.5rem 0;
  margin: 0;
  border: 1px solid rgba(0,0,0,.15);
  border-radius: 0.375rem;
  box-shadow: 0 0.5rem 1rem rgba(0,0,0,.15);
}

.dropdown-item {
  padding: 0.5rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.dropdown-item:hover {
  background-color: #f8f9fa;
}

.dropdown-item.active {
  background-color: #e9ecef;
  color: #000;
}

/* Status Colors */
.btn-success {
  background-color: #198754;
  border-color: #198754;
}

.btn-warning {
  background-color: #ffc107;
  border-color: #ffc107;
  color: #000;
}

.btn-secondary {
  background-color: #6c757d;
  border-color: #6c757d;
}

/* Assignment Badge */
.badge {
  padding: 0.5rem 0.75rem;
  font-weight: 500;
  font-size: 0.875rem;
}

.badge i {
  font-size: 1rem;
}

/* Message Input States */
.message-input:disabled {
  background-color: #f8f9fa;
  cursor: not-allowed;
}

.message-input::placeholder {
  color: #6c757d;
  font-style: italic;
}

/* Toast Notifications */
.swal2-toast {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
}

/* Button Icons */
.btn-icon {
  width: 36px;
  height: 36px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

.btn-icon i {
  font-size: 1.2rem;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
  .chat-header {
    padding: 0.5rem !important;
  }
  
  .badge {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
  }
  
  .user-avatar {
    width: 32px;
    height: 32px;
    font-size: 1rem;
  }
}

/* Message styles */
.messages-container {
  height: calc(100vh - 200px);
  overflow-y: auto;
  padding: 0.75rem 0.25rem 0.75rem 0.75rem; /* Further reduced padding for better outgoing message alignment */
}

.message {
  display: flex;
  margin-bottom: 0.5rem; /* Reduced margin for tighter spacing */
}

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

.message-right {
  justify-content: flex-end !important;
  margin-right: 0 !important;
  padding-right: 0 !important;
}

.message-bubble-incoming {
  background-color: #f8f9fa;
  border-radius: 15px 15px 15px 5px;
  max-width: 70%;
}

.message-bubble-outgoing {
  background-color: #e3f2fd;
  border-radius: 15px 15px 5px 15px;
  max-width: 70%;
  margin-left: auto;
  margin-right: 0 !important; /* Force no right margin for proper alignment */
  padding-right: 0 !important; /* Ensure no right padding */
}

/* Error message styling */
.message-error .message-bubble-outgoing,
.message-error .message-bubble-incoming {
  border: 1px solid #dc3545;
  background-color: #fff8f8;
}

.message-error-details {
  font-size: 0.8rem;
  color: #dc3545;
  margin-top: 4px;
  padding: 2px 0;
}

.message-date-separator {
  text-align: center;
  color: #6c757d;
  font-size: 0.875rem;
  margin: 1rem 0;
  position: relative;
}

.message-date-separator::before,
.message-date-separator::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 45%;
  height: 1px;
  background-color: #dee2e6;
}

.message-date-separator::before {
  left: 0;
}

.message-date-separator::after {
  right: 0;
}

.message-meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.25rem;
}

/* Message status icons */
.message-status {
  font-size: 0.875rem;
}

.message-status.sent {
  color: #6c757d;
}

.message-status.delivered {
  color: #0d6efd;
}

.message-status.read {
  color: #198754;
}

/* Chat Interface Layout */
.conversation-active {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

.conversation-header {
  flex-shrink: 0;
  padding: 1rem;
  background: #fff;
  border-bottom: 1px solid #e9ecef;
  z-index: 10;
}

.messages-container {
  flex: 1;
  overflow: hidden;
  position: relative;
  background: #f8f9fa;
}

.messages-scroll {
  height: 100%;
  overflow-y: auto;
  padding: 0.75rem 0.25rem 0.75rem 0.75rem; /* Further reduced padding for better outgoing message alignment */
  scrollbar-width: thin;
  scrollbar-color: #dee2e6 transparent;
}

.messages-scroll::-webkit-scrollbar {
  width: 6px;
}

.messages-scroll::-webkit-scrollbar-track {
  background: transparent;
}

.messages-scroll::-webkit-scrollbar-thumb {
  background-color: #dee2e6;
  border-radius: 3px;
}

.reply-container {
  flex-shrink: 0;
  padding: 1rem;
  background: #fff;
  border-top: 1px solid #e9ecef;
  z-index: 10;
}

.reply-box {
  display: flex;
  align-items: flex-end;
  gap: 0.5rem;
  background: #fff;
  border-radius: 0.5rem;
  padding: 0.5rem;
}

.reply-input-wrapper {
  flex: 1;
  display: flex;
  align-items: flex-end;
  gap: 0.5rem;
  background: #f8f9fa;
  border-radius: 0.375rem;
  padding: 0.5rem;
}

.reply-input {
  flex: 1;
  border: none;
  background: transparent;
  resize: none;
  min-height: 40px;
  max-height: 120px;
  padding: 0.5rem;
  font-size: 0.9375rem;
  line-height: 1.5;
  color: #495057;
}

.reply-input:focus {
  outline: none;
}

.reply-btn {
  background: none;
  border: none;
  padding: 0.5rem;
  color: #6c757d;
  cursor: pointer;
  transition: color 0.2s;
}

.reply-btn:hover {
  color: #0d6efd;
}

.send-btn {
  background: #0d6efd;
  border: none;
  color: #fff;
  padding: 0.625rem 1rem;
  border-radius: 0.375rem;
  cursor: pointer;
  transition: background-color 0.2s;
}

.send-btn:hover {
  background: #0b5ed7;
}

.send-btn:disabled {
  background: #e9ecef;
  cursor: not-allowed;
}

/* =============================================
   CAMPAIGNS PAGE STYLES
   ============================================= */

.campaigns-container {
  padding: 20px;
}

.campaigns-container .nav-tabs {
  border-bottom: 2px solid #dee2e6;
}

.campaigns-container .nav-tabs .nav-link {
  border: none;
  color: #6c757d;
  font-weight: 500;
  padding: 12px 20px;
  margin-right: 5px;
  border-radius: 8px 8px 0 0;
  transition: all 0.3s ease;
}

.campaigns-container .nav-tabs .nav-link:hover {
  background-color: #f8f9fa;
  color: #495057;
}

.campaigns-container .nav-tabs .nav-link.active {
  background-color: #007bff;
  color: white;
  border-bottom: 2px solid #007bff;
}

.campaigns-container .card {
  border: none;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  border-radius: 8px;
  transition: box-shadow 0.3s ease;
}

.campaigns-container .card:hover {
  box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.campaigns-container .card-header {
  background-color: #f8f9fa;
  border-bottom: 1px solid #dee2e6;
  font-weight: 600;
  color: #495057;
}

/* Template Builder Styles */
.template-builder {
  background: #fff;
  border-radius: 8px;
  padding: 20px;
}

.message-preview {
  background: #f8f9fa;
  border: 1px solid #dee2e6;
  border-radius: 8px;
  padding: 15px;
  font-family: 'Segoe UI', sans-serif;
  line-height: 1.5;
  max-height: 200px;
  overflow-y: auto;
}

.media-upload-area {
  border: 2px dashed #dee2e6;
  border-radius: 8px;
  padding: 20px;
  text-align: center;
  transition: border-color 0.3s ease;
}

.media-upload-area:hover {
  border-color: #007bff;
}

.media-upload-area.dragover {
  border-color: #007bff;
  background-color: #f8f9fa;
}

/* Contact Selector Styles */
.contact-selector {
  background: #fff;
  border-radius: 8px;
  padding: 20px;
}

.selection-method {
  transition: all 0.3s ease;
}

.filtered-contacts {
  max-height: 300px;
  overflow-y: auto;
  border: 1px solid #dee2e6;
  border-radius: 8px;
  padding: 10px;
}

.contact-item {
  padding: 10px;
  border-bottom: 1px solid #f1f3f4;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.contact-item:hover {
  background-color: #f8f9fa;
}

.contact-item:last-child {
  border-bottom: none;
}

.contact-item.selected {
  background-color: #e3f2fd;
  border-left: 3px solid #007bff;
}

.selected-contacts {
  max-height: 200px;
  overflow-y: auto;
  border: 1px solid #dee2e6;
  border-radius: 8px;
  padding: 10px;
}

.selected-contact-item {
  display: flex;
  justify-content: between;
  align-items: center;
  padding: 8px 12px;
  background: #f8f9fa;
  border-radius: 6px;
  margin-bottom: 8px;
}

.selected-contact-item:last-child {
  margin-bottom: 0;
}

/* Campaign Preview Styles */
.campaign-preview {
  background: #fff;
  border-radius: 8px;
  padding: 20px;
}

.preview-section {
  background: #f8f9fa;
  border-radius: 8px;
  padding: 15px;
  margin-bottom: 15px;
}

.campaign-summary {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border-radius: 8px;
  padding: 20px;
}

.campaign-summary h6 {
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 15px;
}

.campaign-summary p {
  margin-bottom: 8px;
  font-size: 14px;
}

.campaign-summary strong {
  color: rgba(255, 255, 255, 0.9);
}

/* WhatsApp Preview Styles */
.whatsapp-preview {
  background: #e5ddd5;
  border-radius: 8px;
  padding: 20px;
  min-height: 300px;
  position: relative;
  background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="chat-bg" x="0" y="0" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="50" cy="50" r="2" fill="%23ffffff" opacity="0.1"/></pattern></defs><rect width="100" height="100" fill="url(%23chat-bg)"/></svg>');
}

.message-bubble {
  max-width: 80%;
  margin-bottom: 10px;
  border-radius: 8px;
  padding: 8px 12px;
  position: relative;
  word-wrap: break-word;
}

.message-bubble.outgoing {
  background: #dcf8c6;
  margin-left: auto;
  border-bottom-right-radius: 2px;
}

.message-bubble.incoming {
  background: #ffffff;
  margin-right: auto;
  border-bottom-left-radius: 2px;
}

.message-media {
  max-width: 100%;
  border-radius: 8px;
  margin-bottom: 5px;
}

.message-text {
  font-size: 14px;
  line-height: 1.4;
  color: #303030;
}

.message-time {
  font-size: 11px;
  color: #667781;
  text-align: right;
  margin-top: 5px;
}

/* Agent name styling for outgoing messages */
.message-agent-name {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 4px;
  opacity: 0.8;
}

/* Campaign Status Badges */
.status-badge {
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
}

.status-draft {
  background: #6c757d;
  color: white;
}

.status-running {
  background: #007bff;
  color: white;
}

.status-paused {
  background: #ffc107;
  color: #212529;
}

.status-completed {
  background: #28a745;
  color: white;
}

.status-failed {
  background: #dc3545;
  color: white;
}

.status-stopped {
  background: #343a40;
  color: white;
}

/* Progress Bars */
.campaign-progress {
  height: 8px;
  background: #e9ecef;
  border-radius: 4px;
  overflow: hidden;
}

.campaign-progress .progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #007bff, #0056b3);
  transition: width 0.3s ease;
}

/* Template Cards */
.template-card {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.template-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.template-type-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(0, 123, 255, 0.1);
  color: #007bff;
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 500;
}

/* Campaign Table */
.campaigns-table {
  background: white;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.campaigns-table th {
  background: #f8f9fa;
  border: none;
  font-weight: 600;
  color: #495057;
  padding: 15px;
}

.campaigns-table td {
  border: none;
  padding: 15px;
  vertical-align: middle;
}

.campaigns-table tbody tr {
  border-bottom: 1px solid #f1f3f4;
  transition: background-color 0.2s ease;
}

.campaigns-table tbody tr:hover {
  background-color: #f8f9fa;
}

/* Action Buttons */
.action-buttons .btn {
  margin-right: 5px;
  margin-bottom: 5px;
}

.action-buttons .btn:last-child {
  margin-right: 0;
}

/* Responsive Design */
@media (max-width: 768px) {
  .campaigns-container {
    padding: 10px;
  }

  .campaigns-container .row > div {
    margin-bottom: 20px;
  }

  .message-bubble {
    max-width: 90%;
  }

  .whatsapp-preview {
    min-height: 200px;
  }

  .campaigns-table {
    font-size: 14px;
  }

  .campaigns-table th,
  .campaigns-table td {
    padding: 10px 8px;
  }
}

/* Loading States */
.loading-spinner {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 200px;
}

.loading-spinner .spinner-border {
  width: 3rem;
  height: 3rem;
}

/* Empty States */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: #6c757d;
}

.empty-state i {
  font-size: 4rem;
  margin-bottom: 20px;
  opacity: 0.5;
}

.empty-state h5 {
  margin-bottom: 10px;
  color: #495057;
}

.empty-state p {
  margin-bottom: 20px;
  font-size: 14px;
}

/* Animation Classes */
.fade-in {
  animation: fadeIn 0.3s ease-in;
}

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

.slide-in {
  animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
  from { transform: translateX(-20px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* Session Status Indicators */
.session-status-indicator {
  min-width: 140px;
  max-width: 180px;
}

.session-status-indicator .spinner-border-sm {
  width: 16px !important;
  height: 16px !important;
  border-width: 2px;
}

.session-status-indicator i {
  font-size: 16px;
}

.session-status-indicator small {
  font-weight: 500;
  white-space: nowrap;
}

.session-status-indicator .d-flex {
  align-items: center;
}

.session-status-indicator .text-muted {
  font-size: 0.75rem !important;
  line-height: 1.2;
  word-break: break-all;
}

/* Session status colors */
.text-success {
  color: #198754 !important;
}

.text-warning {
  color: #ffc107 !important;
}

.text-danger {
  color: #dc3545 !important;
}

.text-secondary {
  color: #6c757d !important;
}

/* Campaign Action Buttons */
.btn-group-sm .btn {
  margin-right: 2px;
}

.btn-group-sm .btn:last-child {
  margin-right: 0;
}

/* Stop button specific styling */
.btn-outline-danger .bi-stop {
  font-size: 14px;
}

/* Status indicator pulse animation for loading state */
@keyframes pulse {
  0%, 100% {
    opacity: 0.6;
    transform: scale(1);
  }
  50% {
    opacity: 1;
    transform: scale(1.1);
  }
}

/* Enhanced dropdown active state for status items */
.dropdown-item.active {
  background-color: #e3f2fd !important;
  color: #1976d2 !important;
  font-weight: 500;
}

.dropdown-item.active::before {
  content: '✓ ';
  margin-right: 5px;
  color: #4caf50;
  font-weight: bold;
}

/* Enhanced status change animations */
.status-indicator {
  transition: all 0.3s ease;
}

.status-indicator.loading {
  animation: pulse 1.5s ease-in-out infinite;
  opacity: 0.6;
}

/* Better status colors in dropdown */
.dropdown-item .text-success {
  color: #28a745 !important;
}

.dropdown-item .text-warning {
  color: #ffc107 !important;
}

.dropdown-item .text-secondary {
  color: #6c757d !important;
}

/* Modern Dropdown Enhancements */
.modern-dropdown {
  border: none !important;
  border-radius: 16px !important;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15), 0 8px 16px rgba(0, 0, 0, 0.1) !important;
  padding: 12px 0 !important;
  min-width: 280px !important;
  backdrop-filter: blur(10px);
  background: rgba(255, 255, 255, 0.95) !important;
  animation: dropdownFadeIn 0.3s ease-out;
  transform-origin: top right;
}

@keyframes dropdownFadeIn {
  0% {
    opacity: 0;
    transform: scale(0.95) translateY(-10px);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* Modern Dropdown Items */
.modern-dropdown-item {
  padding: 12px 20px !important;
  border-radius: 12px !important;
  margin: 2px 8px !important;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
  border: none !important;
  background: transparent !important;
  position: relative;
  overflow: hidden;
}

.modern-dropdown-item:hover {
  background: linear-gradient(135deg, #f8f9ff 0%, #e8f2ff 100%) !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.modern-dropdown-item:active {
  transform: translateY(0);
  transition: transform 0.1s ease;
}

.modern-dropdown-item.active {
  background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%) !important;
  color: #1976d2 !important;
  font-weight: 600 !important;
}

/* Dropdown Item Content Layout */
.dropdown-item-content {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
}

.dropdown-text {
  flex: 1;
  font-weight: 500;
  font-size: 14px;
}

.dropdown-icon {
  font-size: 16px;
  opacity: 0.7;
  transition: opacity 0.2s ease;
}

.modern-dropdown-item:hover .dropdown-icon {
  opacity: 1;
}

/* Status Dots in Dropdown */
.status-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid white;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  flex-shrink: 0;
}

.status-dot.online {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  animation: statusPulse 2s infinite;
}

.status-dot.away {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

.status-dot.offline {
  background: linear-gradient(135deg, #6b7280 0%, #4b5563 100%);
}

@keyframes statusPulse {
  0%, 100% {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1), 0 0 0 0 rgba(16, 185, 129, 0.4);
  }
  50% {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1), 0 0 0 8px rgba(16, 185, 129, 0);
  }
}

/* Active Check Icon */
.active-check {
  color: #4caf50;
  font-size: 16px;
  font-weight: bold;
  animation: checkBounce 0.3s ease-out;
}

@keyframes checkBounce {
  0% {
    transform: scale(0);
  }
  50% {
    transform: scale(1.2);
  }
  100% {
    transform: scale(1);
  }
}

/* Modern Headers and Dividers */
.modern-header {
  color: #6b7280 !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.5px !important;
  padding: 8px 20px 4px !important;
  margin: 0 !important;
}

.modern-divider {
  margin: 8px 16px !important;
  border-color: #e5e7eb !important;
  opacity: 0.6 !important;
}

/* Enhanced Status Indicator in Badge */
.user-status-badge .status-indicator {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.user-status-badge .status-indicator.online {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
}

.user-status-badge .status-indicator.away {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.2);
}

.user-status-badge .status-indicator.offline {
  background: linear-gradient(135deg, #6b7280 0%, #4b5563 100%);
  box-shadow: 0 0 0 3px rgba(107, 114, 128, 0.2);
}

/* Responsive Design for Dropdown */
@media (max-width: 768px) {
  .modern-dropdown {
    min-width: 260px !important;
    margin-right: 8px !important;
  }

  .modern-dropdown-item {
    padding: 14px 16px !important;
  }

  .dropdown-text {
    font-size: 15px;
  }
}

/* Focus States for Accessibility */
.user-status-badge:focus {
  outline: none !important;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.5) !important;
  border-color: #3b82f6 !important;
}

.modern-dropdown-item:focus {
  outline: none !important;
  background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%) !important;
  color: #1e40af !important;
  box-shadow: inset 0 0 0 2px rgba(59, 130, 246, 0.3);
}

.modern-dropdown-item:focus:not(:hover) {
  transform: none;
}

/* Dropdown Arrow Animation */
.user-status-badge[aria-expanded="true"] .dropdown-arrow {
  transform: rotate(180deg);
  transition: transform 0.2s ease;
}

.dropdown-arrow {
  transition: transform 0.2s ease;
}

/* Loading State Enhancements */
.user-status-badge .status-indicator.loading {
  position: relative;
}

.user-status-badge .status-indicator.loading::after {
  content: '';
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  border: 2px solid transparent;
  border-top: 2px solid currentColor;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
  .modern-dropdown {
    background: rgba(31, 41, 55, 0.95) !important;
    border: 1px solid rgba(75, 85, 99, 0.3) !important;
  }

  .modern-dropdown-item:hover {
    background: linear-gradient(135deg, #374151 0%, #4b5563 100%) !important;
  }

  .modern-dropdown-item.active {
    background: linear-gradient(135deg, #1e40af 0%, #1d4ed8 100%) !important;
    color: #e5e7eb !important;
  }

  .modern-dropdown-item:focus {
    background: linear-gradient(135deg, #1e3a8a 0%, #1e40af 100%) !important;
    color: #f3f4f6 !important;
  }

  .modern-header {
    color: #9ca3af !important;
  }

  .modern-divider {
    border-color: #4b5563 !important;
  }

  .dropdown-text {
    color: #e5e7eb;
  }

  .user-status-badge:focus {
    box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.5) !important;
    border-color: #60a5fa !important;
  }
}

/* Anti-Ban Management Styles */
:root {
    /* Primary color palette - Professional blue-purple gradient */
    --primary-gradient: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    --primary-color: #6366f1;
    --primary-light: #a5b4fc;
    --primary-dark: #4f46e5;

    /* Success colors - Green palette */
    --success-gradient: linear-gradient(135deg, #10b981 0%, #059669 100%);
    --success-color: #10b981;
    --success-light: #6ee7b7;
    --success-dark: #047857;

    /* Warning colors - Amber palette */
    --warning-gradient: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    --warning-color: #f59e0b;
    --warning-light: #fcd34d;
    --warning-dark: #b45309;

    /* Danger colors - Red palette */
    --danger-gradient: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    --danger-color: #ef4444;
    --danger-light: #fca5a5;
    --danger-dark: #b91c1c;

    /* Info colors - Cyan palette */
    --info-gradient: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%);
    --info-color: #06b6d4;
    --info-light: #67e8f9;
    --info-dark: #0e7490;

    /* Secondary gradient */
    --secondary-gradient: linear-gradient(135deg, #6c757d 0%, #495057 100%);

    /* Light theme colors */
    --light-bg: #f8fafc;
    --card-bg: #ffffff;
    --card-bg-secondary: #f1f5f9;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --border-color: #e2e8f0;
    --border-light: #f1f5f9;

    /* Shadows for light theme */
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-hover: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.dashboard-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.dashboard-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
    border-color: var(--primary-light);
}

.metric-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.metric-card:hover {
    border-color: var(--primary-light);
    box-shadow: var(--shadow-hover);
}

.metric-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--primary-gradient);
}

.metric-card.success::before { background: var(--success-gradient); }
.metric-card.warning::before { background: var(--warning-gradient); }
.metric-card.danger::before { background: var(--danger-gradient); }
.metric-card.info::before { background: var(--info-gradient); }

.glass-effect {
    background: var(--card-bg-secondary);
    border: 1px solid var(--border-light);
}

.modern-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-light);
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    animation: modernSpin 1s linear infinite;
}

@keyframes modernSpin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.status-badge {
    font-size: 0.75rem;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: 1px solid transparent;
}

.status-badge.bg-success {
    background: var(--success-gradient) !important;
    color: white;
}

.status-badge.bg-warning {
    background: var(--warning-gradient) !important;
    color: white;
}

.status-badge.bg-danger {
    background: var(--danger-gradient) !important;
    color: white;
}

.status-badge.bg-info {
    background: var(--info-gradient) !important;
    color: white;
}

.status-badge.bg-primary {
    background: var(--primary-gradient) !important;
    color: white;
}

.risk-indicator {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 12px;
    box-shadow: var(--shadow);
}

.risk-low { background: var(--success-gradient); }
.risk-medium { background: var(--warning-gradient); }
.risk-high { background: var(--info-gradient); }
.risk-critical { background: var(--danger-gradient); }

/* =============================================
   ENHANCED CONTACT IMPORT BUTTON STYLING
   ============================================= */

/* Primary action buttons group */
.btn-group[aria-label="Primary contact actions"] {
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  border-radius: 6px;
}

.btn-group[aria-label="Primary contact actions"] .btn {
  font-weight: 500;
  padding: 8px 16px;
  border: none;
  position: relative;
  transition: all 0.3s ease;
}

/* Import button specific styling */
#import-toggle-btn {
  background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
  color: white;
  border: 1px solid #0056b3 !important;
  box-shadow: 0 2px 4px rgba(0, 123, 255, 0.3);
}

#import-toggle-btn:hover {
  background: linear-gradient(135deg, #0056b3 0%, #004085 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0, 123, 255, 0.4);
}

#import-toggle-btn.btn-outline-secondary {
  background: linear-gradient(135deg, #6c757d 0%, #495057 100%);
  color: white;
  border: 1px solid #495057 !important;
}

#import-toggle-btn.btn-outline-secondary:hover {
  background: linear-gradient(135deg, #495057 0%, #343a40 100%);
  transform: translateY(-1px);
}

/* Secondary action buttons group */
.btn-group[aria-label="Contact management actions"] {
  margin-left: 8px;
}

.btn-group[aria-label="Contact management actions"] .btn {
  padding: 8px 12px;
  font-size: 14px;
  transition: all 0.2s ease;
}

.btn-group[aria-label="Contact management actions"] .btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}

/* Responsive button text */
@media (max-width: 576px) {
  .btn-group[aria-label="Primary contact actions"] .btn {
    padding: 6px 12px;
    font-size: 14px;
  }

  .btn-group[aria-label="Contact management actions"] .btn {
    padding: 6px 8px;
    font-size: 12px;
  }
}

@media (max-width: 992px) {
  .btn-group[aria-label="Contact management actions"] .btn span {
    display: none !important;
  }
}

/* Tooltip enhancements */
.tooltip {
  font-size: 12px;
}

.tooltip-inner {
  background-color: #212529;
  border-radius: 4px;
  padding: 6px 10px;
  max-width: 250px;
}

/* Import interface enhancements */
#import-interface {
  animation: slideDown 0.3s ease-out;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

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

#import-interface .card {
  border: none;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

#import-interface .card-header {
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  border-bottom: 1px solid #dee2e6;
}

/* Button loading state */
.btn[disabled] {
  opacity: 0.7;
  cursor: not-allowed;
}

/* Success/Error states */
.alert {
  border-radius: 6px;
  border: none;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.alert-success {
  background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
  color: #155724;
}

.alert-warning {
  background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
  color: #856404;
}

.alert-danger {
  background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
  color: #721c24;
}

/* Campaign Page Enhancements */
.campaigns-container {
  background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  padding: 2rem;
  overflow: hidden;
  margin: 1rem 0;
}

/* Enhanced Header Styles */
.campaign-header {
  background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
  border-radius: 12px;
  padding: 2rem;
  margin-bottom: 2rem;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.05);
}

.header-icon {
  width: 60px;
  height: 60px;
  background: linear-gradient(135deg, #007bff, #0056b3);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.5rem;
  box-shadow: 0 4px 16px rgba(0, 123, 255, 0.3);
}

.campaign-stats {
  margin-top: 1rem;
}

.stat-card {
  background: white;
  border-radius: 12px;
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  border: 1px solid #e9ecef;
  transition: all 0.2s ease;
  min-width: 140px;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.stat-icon {
  width: 40px;
  height: 40px;
  background: #f8f9fa;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 1rem;
  font-size: 1.2rem;
  color: #6c757d;
}

.stat-number {
  font-size: 1.5rem;
  font-weight: 700;
  color: #212529;
  line-height: 1;
}

.stat-label {
  font-size: 0.875rem;
  color: #6c757d;
  margin-top: 0.25rem;
}

.action-buttons .btn {
  border-radius: 10px;
  font-weight: 500;
  transition: all 0.2s ease;
}

.action-buttons .btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Enhanced Tab Styles */
.campaign-tabs-container {
  background: white;
  border-radius: 12px;
  padding: 0.5rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.nav-pills .nav-link {
  border-radius: 10px;
  padding: 1rem 1.5rem;
  margin: 0 0.25rem;
  transition: all 0.3s ease;
  border: 2px solid transparent;
  background: transparent;
  color: #6c757d;
}

.nav-pills .nav-link:hover {
  background: #f8f9fa;
  color: #007bff;
  transform: translateY(-1px);
}

.nav-pills .nav-link.active {
  background: linear-gradient(135deg, #007bff, #0056b3);
  color: white;
  box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
}

.tab-content-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
}

.tab-icon {
  font-size: 1.1rem;
  margin-right: 0.5rem;
}

.tab-text {
  font-weight: 500;
}

.nav-pills .nav-link.active .badge {
  background: rgba(255, 255, 255, 0.2) !important;
  color: white !important;
}

.nav-pills .nav-link .badge {
  font-size: 0.75rem;
  padding: 0.25rem 0.5rem;
}

.campaign-row {
  border-left: 4px solid transparent;
  transition: all 0.3s ease;
}

.campaign-row:hover {
  border-left-color: #007bff;
  background-color: #f8f9fa !important;
  transform: translateY(-2px) !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
}

.campaign-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 50px;
  height: 50px;
  background: linear-gradient(135deg, #007bff, #0056b3);
  border-radius: 12px;
  color: white;
  box-shadow: 0 2px 8px rgba(0, 123, 255, 0.3);
}

.template-icon .rounded-circle {
  border: 2px solid #e9ecef;
  transition: all 0.2s ease;
}

.template-icon .rounded-circle:hover {
  border-color: #007bff;
  transform: scale(1.1);
}

/* Fix dropdown z-index issue in campaign table */
.campaign-row .dropdown {
  position: relative;
}

.campaign-row .dropdown-menu {
  z-index: 1050 !important;
  position: absolute !important;
}

/* Ensure table rows don't interfere with dropdown positioning */
.table tbody tr {
  position: relative;
  z-index: 1;
}

.table tbody tr:hover {
  z-index: 2;
}

/* When dropdown is open, ensure it's above everything */
.dropdown.show {
  z-index: 1051 !important;
}

.dropdown.show .dropdown-menu {
  z-index: 1052 !important;
}

/* Campaign Modal Enhancements */
.campaign-details-modal .modal-content {
  border: none;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.campaign-details-modal .modal-header {
  background: linear-gradient(135deg, #007bff, #0056b3) !important;
  border-bottom: none;
  padding: 1.5rem;
}

.campaign-details-modal .modal-title {
  font-weight: 600;
  font-size: 1.25rem;
}

.campaign-details-modal .card {
  border: none;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
  border-radius: 12px;
}

.campaign-details-modal .card-header {
  background: linear-gradient(135deg, #f8f9fa, #e9ecef) !important;
  border-bottom: 1px solid #dee2e6;
  font-weight: 600;
  border-radius: 12px 12px 0 0 !important;
}

.campaign-details-modal .table {
  margin-bottom: 0;
}

.campaign-details-modal .table th {
  background-color: #f8f9fa;
  border-top: none;
  font-weight: 600;
  color: #495057;
  font-size: 0.875rem;
}

.campaign-details-modal .table td {
  vertical-align: middle;
  padding: 0.75rem;
}

.campaign-details-modal .recipient-row:hover {
  background-color: #f8f9fa;
  transform: translateY(-1px);
  transition: all 0.2s ease;
}

/* Pulse animation for pending/queued statuses */
@keyframes pulse {
  0% {
    opacity: 1;
  }
  50% {
    opacity: 0.7;
  }
  100% {
    opacity: 1;
  }
}

.pulse-animation {
  animation: pulse 2s infinite;
}

/* Enhanced status badges */
.badge {
  font-weight: 500;
  letter-spacing: 0.025em;
}

.badge i {
  font-size: 0.875em;
}

.session-status-indicator {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.2s ease;
}

.session-status-indicator:hover {
  transform: scale(1.05);
}

.progress {
  background-color: #f1f3f4;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
}

.progress-bar {
  transition: width 0.6s ease;
}

.table-dark th {
  background: linear-gradient(135deg, #343a40, #495057);
  border: none;
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.875rem;
  letter-spacing: 0.5px;
}

.btn-group .btn {
  border-radius: 6px;
  margin: 0 2px;
  transition: all 0.2s ease;
}

.btn-group .btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.dropdown-menu {
  border: none;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  border-radius: 8px;
  padding: 8px 0;
}

.dropdown-item {
  padding: 8px 16px;
  transition: all 0.2s ease;
}

.dropdown-item:hover {
  background-color: #f8f9fa;
  transform: translateX(4px);
}

.badge {
  font-weight: 500;
  letter-spacing: 0.3px;
  border-radius: 6px;
  padding: 6px 12px;
}

/* Campaign Status Badges */
.badge.bg-success {
  background: linear-gradient(135deg, #28a745, #20c997) !important;
}

.badge.bg-primary {
  background: linear-gradient(135deg, #007bff, #0056b3) !important;
}

.badge.bg-warning {
  background: linear-gradient(135deg, #ffc107, #e0a800) !important;
}

.badge.bg-danger {
  background: linear-gradient(135deg, #dc3545, #c82333) !important;
}

.badge.bg-dark {
  background: linear-gradient(135deg, #343a40, #23272b) !important;
}

.badge.bg-info {
  background: linear-gradient(135deg, #17a2b8, #138496) !important;
}

/* Animation for new campaigns */
@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.campaign-row {
  animation: slideInUp 0.3s ease-out;
}

/* Loading states */
.loading-skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: loading 1.5s infinite;
}

@keyframes loading {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

/* Refresh button animation */
@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

.spin {
  animation: spin 1s linear infinite;
}

/* Filter button active state */
.header-actions .btn.active {
  background-color: #007bff;
  color: white;
  border-color: #007bff;
}