/**
 * Global CSS for Mobile Phone Management System
 * Header, Sidebar, and Main Layout Styles
 */

/* ================================
   CSS Variables (Custom Properties)
   Soft Professional Color Palette for Long-Term Comfort
   ================================ */
:root {
  /* UNIFIED THEME SYSTEM - All pages will use these variables */

  /* Soft Primary Colors - Easy on Eyes */
  --primary-color: #5a67d8;
  --primary-light: #667eea;
  --primary-dark: #4c51bf;
  --secondary-color: #718096;
  --success-color: #10b981;
  --warning-color: #f59e0b;
  --danger-color: #dc2626;
  --info-color: #0891b2;

  /* Neutral Background Colors */
  --light-color: #f7fafc;
  --lighter-color: #fbfcfd;
  --dark-color: #2d3748;
  --darker-color: #1a202c;

  /* THEME BACKGROUND VARIABLES */
  --body-bg: #ffffff;
  --content-bg: #ffffff;
  --card-bg: #ffffff;
  --page-header-bg: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
  --stats-card-bg: #ffffff;
  --form-bg: #ffffff;
  --modal-bg: #ffffff;

  /* THEME TEXT COLORS */
  --text-primary: #2d3748;
  --text-secondary: #4a5568;
  --text-muted: #718096;
  --text-light: #a0aec0;

  /* THEME BORDER COLORS */
  --border-color: rgba(0, 0, 0, 0.06);
  --border-color-light: rgba(0, 0, 0, 0.03);
  --border-color-medium: rgba(0, 0, 0, 0.1);

  /* THEME SHADOW COLORS */
  --shadow-light: 0 2px 15px rgba(0, 0, 0, 0.08);
  --shadow-medium: 0 4px 20px rgba(0, 0, 0, 0.15);
  --shadow-heavy: 0 10px 25px rgba(0, 0, 0, 0.15);

  /* THEME BUTTON GRADIENTS */
  --btn-primary-bg: linear-gradient(135deg, #5a67d8 0%, #667eea 100%);
  --btn-primary-hover: linear-gradient(135deg, #4c51bf 0%, #5a67d8 100%);
  --btn-success-bg: linear-gradient(135deg, #10b981 0%, #34d399 100%);
  --btn-success-hover: linear-gradient(135deg, #059669 0%, #10b981 100%);
  --btn-warning-bg: linear-gradient(135deg, #f59e0b 0%, #fbbf24 100%);
  --btn-warning-hover: linear-gradient(135deg, #d97706 0%, #f59e0b 100%);
  --btn-danger-bg: linear-gradient(135deg, #dc2626 0%, #ef4444 100%);
  --btn-danger-hover: linear-gradient(135deg, #b91c1c 0%, #dc2626 100%);
  --btn-info-bg: linear-gradient(135deg, #0891b2 0%, #06b6d4 100%);
  --btn-info-hover: linear-gradient(135deg, #0e7490 0%, #0891b2 100%);
  --btn-secondary-bg: linear-gradient(135deg, #6b7280 0%, #9ca3af 100%);
  --btn-secondary-hover: linear-gradient(135deg, #4b5563 0%, #6b7280 100%);

  /* THEME STATS CARD GRADIENTS */
  --stats-primary: linear-gradient(135deg, #5a67d8 0%, #667eea 100%);
  --stats-success: linear-gradient(135deg, #10b981 0%, #34d399 100%);
  --stats-warning: linear-gradient(135deg, #f59e0b 0%, #fbbf24 100%);
  --stats-danger: linear-gradient(135deg, #dc2626 0%, #ef4444 100%);
  --stats-info: linear-gradient(135deg, #0891b2 0%, #06b6d4 100%);

  /* THEME ICON BACKGROUND COLORS */
  --icon-primary-bg: rgba(90, 103, 216, 0.1);
  --icon-success-bg: rgba(16, 185, 129, 0.1);
  --icon-warning-bg: rgba(245, 158, 11, 0.1);
  --icon-danger-bg: rgba(220, 38, 38, 0.1);
  --icon-info-bg: rgba(8, 145, 178, 0.1);

  /* THEME TABLE COLORS */
  --table-bg: #ffffff;
  --table-header-bg: #f8f9fa;
  --table-border: rgba(0, 0, 0, 0.06);
  --table-hover: rgba(90, 103, 216, 0.05);

  /* THEME FORM COLORS */
  --input-bg: #ffffff;
  --input-border: rgba(0, 0, 0, 0.15);
  --input-focus-border: #5a67d8;
  --input-focus-shadow: 0 0 0 3px rgba(90, 103, 216, 0.1);

  /* Header Soft Colors */
  --header-bg: #ffffff;
  --header-border: #e2e8f0;
  --header-text: #4a5568;
  --header-text-muted: #718096;
  --header-accent: #667eea;

  /* Sidebar Comfortable Colors */
  --sidebar-width: 280px;
  --header-height: 70px;
  --sidebar-bg: #f8fafc;
  --sidebar-text: #4a5568;
  --sidebar-hover: #edf2f7;
  --sidebar-active: #e6fffa;
  --sidebar-active-text: #319795;

  /* Soft UI Elements */
  --border-radius: 0.5rem;
  --border-radius-sm: 0.25rem;
  --border-radius-lg: 0.75rem;
  --box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
  --box-shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1),
    0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --box-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1),
    0 4px 6px -2px rgba(0, 0, 0, 0.05);

  /* Comfortable Transitions */
  --transition: all 0.2s ease-in-out;
  --transition-fast: all 0.15s ease-out;
}

/* ================================
   Base Styles
   ================================ */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  line-height: 1.6;
  color: var(--dark-color);
  background-color: #ffffff;
}

/* ================================
   Enhanced Header Styles - Soft Professional Design
   Preserving Bootstrap functionality with comfort improvements
   ================================ */
.header-main {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1030;
  height: var(--header-height);
  background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
  box-shadow: 0 2px 15px rgba(0, 0, 0, 0.08);
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

/* Override Bootstrap navbar classes for light theme */
.header-main .navbar-dark,
.header-main .bg-primary,
.header-main .navbar {
  background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
  background-color: #ffffff;
}

.header-main .navbar-toggler {
  border-color: rgba(0, 0, 0, 0.1);
}

.header-main .navbar-toggler-icon {
  background-image: url("data:image/svg+xml;charset=utf8,%3Csvg viewBox='0 0 30 30' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath stroke='rgba(45, 55, 72, 0.8)' stroke-width='2' stroke-linecap='round' stroke-miterlimit='10' d='M4 7h22M4 15h22M4 23h22'/%3E%3C/svg%3E");
}

.header-main .navbar {
  height: var(--header-height);
  padding: 0 1rem;
  background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
  background-color: #ffffff;
}

/* Enhanced Brand Styling - Light Theme */
.header-main .navbar-brand {
  font-size: 1.25rem;
  font-weight: 700;
  color: #2d3748;
  text-decoration: none;
  transition: var(--transition);
}

.header-main .navbar-brand:hover {
  color: var(--primary-color);
  transform: translateY(-1px);
}

.brand-icon {
  width: 36px;
  height: 36px;
  background: rgba(90, 103, 216, 0.1);
  border-radius: var(--border-radius);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 0.5rem;
}

.brand-icon i {
  font-size: 1.3rem;
  color: var(--primary-color);
}

.brand-text {
  color: #2d3748;
  font-weight: 700;
}

/* Enhanced Search - Light Theme */
.search-enhanced {
  border-radius: var(--border-radius-lg);
  overflow: hidden;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.search-icon-wrapper {
  background: #f8f9fa;
  border: 1px solid rgba(0, 0, 0, 0.1);
  color: #718096;
}

.search-input-enhanced {
  border: 1px solid rgba(0, 0, 0, 0.1);
  background: #ffffff;
  color: #2d3748;
  transition: var(--transition);
}

.search-input-enhanced:focus {
  background: #ffffff;
  border-color: var(--primary-color);
  color: #2d3748;
  box-shadow: 0 0 0 0.2rem rgba(90, 103, 216, 0.25);
}

.search-input-enhanced::placeholder {
  color: #a0aec0;
}

/* Navigation Links - Light Theme */
.header-main .nav-link {
  color: #4a5568;
  padding: 0.5rem 1rem;
  border-radius: var(--border-radius);
  transition: var(--transition);
}

.header-main .nav-link:hover {
  color: var(--primary-color);
  background: rgba(90, 103, 216, 0.1);
}

/* Enhanced Notification Link - Light Theme */
.notification-link-enhanced:hover {
  background: rgba(90, 103, 216, 0.1);
  border-radius: var(--border-radius);
}

.notification-badge-enhanced {
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.8;
  }
}

/* Enhanced Quick Action Link - Light Theme */
.quick-action-link-enhanced:hover {
  background: rgba(90, 103, 216, 0.1);
  border-radius: var(--border-radius);
}

/* Enhanced Notification Dropdown */
.notification-dropdown {
  min-width: 300px;
  max-height: 400px;
  overflow-y: auto;
  border-radius: var(--border-radius-lg);
  box-shadow: var(--box-shadow-lg);
}

.notification-header-enhanced {
  background: var(--light-color);
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
  font-weight: 600;
  color: var(--dark-color);
}

.notification-item-enhanced {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.875rem 1rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  transition: var(--transition-fast);
}

.notification-item-enhanced:hover {
  background: var(--light-color);
}

.notification-content-enhanced {
  flex: 1;
}

.notification-empty-enhanced {
  text-align: center;
  padding: 1.5rem 1rem;
}

/* Enhanced Quick Actions */
.quick-actions-header-enhanced {
  background: var(--light-color);
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
  font-weight: 600;
  color: var(--dark-color);
}

.quick-action-item-enhanced {
  transition: var(--transition-fast);
}

.quick-action-item-enhanced:hover {
  background: var(--light-color);
}

/* Enhanced User Profile - Light Theme */
.user-profile-enhanced:hover {
  background: rgba(90, 103, 216, 0.1);
  border-radius: var(--border-radius);
}

.user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(90, 103, 216, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  overflow: hidden;
  border: 2px solid rgba(90, 103, 216, 0.2);
}

.user-avatar i {
  color: #5a67d8;
}

.avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.user-name {
  font-size: 0.9rem;
  font-weight: 600;
  color: #2d3748;
}

.user-role {
  font-size: 0.75rem;
  color: #718096;
}

/* User Dropdown */
.user-dropdown {
  min-width: 280px;
  border: 1px solid var(--header-border);
  border-radius: var(--border-radius-lg);
  box-shadow: var(--box-shadow-lg);
  overflow: hidden;
}

.user-dropdown-header {
  padding: 1.25rem;
  background: linear-gradient(
    135deg,
    var(--primary-color) 0%,
    var(--primary-light) 100%
  );
  color: white;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.user-avatar-large {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 3px solid rgba(255, 255, 255, 0.3);
}

.user-avatar-large i {
  font-size: 2rem;
  color: white;
}

.user-details .user-name {
  font-size: 1rem;
  font-weight: 600;
  color: white;
  margin-bottom: 0.25rem;
}

.user-details .user-email {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.8);
  margin-bottom: 0.25rem;
}

.user-details .user-role {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.7);
  background: rgba(255, 255, 255, 0.2);
  padding: 0.2rem 0.5rem;
  border-radius: var(--border-radius-sm);
  display: inline-block;
}

.user-menu-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1.25rem;
  transition: var(--transition-fast);
}

.user-menu-item:hover {
  background: var(--light-color);
}

.user-menu-item i {
  width: 20px;
  color: var(--header-text-muted);
}

.user-menu-item.logout-item {
  color: var(--danger-color);
}

.user-menu-item.logout-item:hover {
  background: rgba(245, 101, 101, 0.1);
}

.user-menu-item.logout-item i {
  color: var(--danger-color);
}

/* Enhanced User Dropdown */
.user-dropdown-enhanced {
  min-width: 220px;
  border-radius: var(--border-radius-lg);
  box-shadow: var(--box-shadow-lg);
}

.user-menu-item-enhanced {
  transition: var(--transition-fast);
}

.user-menu-item-enhanced:hover {
  background: var(--light-color);
}

.logout-item-enhanced {
  color: var(--danger-color);
}

.logout-item-enhanced:hover {
  background: rgba(220, 53, 69, 0.1);
  color: var(--danger-color);
}

/* ================================
   Main Container
   ================================ */
.main-container {
  display: flex;
  margin-top: var(--header-height);
  min-height: calc(100vh - var(--header-height));
}

/* ================================
   Enhanced Sidebar Styles - Soft Professional Design
   ================================ */
.sidebar {
  width: var(--sidebar-width);
  background: #ffffff;
  color: var(--dark-color);
  position: fixed;
  top: var(--header-height);
  left: 0;
  height: calc(100vh - var(--header-height));
  overflow-y: auto;
  z-index: 1020;
  transition: var(--transition);
  box-shadow: 2px 0 15px rgba(0, 0, 0, 0.08);
  border-right: 1px solid rgba(0, 0, 0, 0.06);
}

.sidebar-enhanced {
  background: linear-gradient(180deg, #ffffff 0%, #f8f9fa 100%);
  backdrop-filter: blur(10px);
}

.sidebar-content {
  padding: 1.5rem 0;
}

.sidebar-nav {
  padding: 0 1.25rem;
}

.sidebar-nav .nav {
  list-style: none;
}

.sidebar-nav .nav-item {
  margin-bottom: 0.375rem;
}

/* Enhanced Navigation Links - Light Theme */
.nav-link-enhanced {
  display: flex;
  align-items: center;
  padding: 0.875rem 1.25rem;
  color: #4a5568;
  text-decoration: none;
  border-radius: var(--border-radius-lg);
  transition: var(--transition);
  position: relative;
  font-weight: 500;
  border: 1px solid transparent;
}

.nav-link-enhanced:hover {
  background: #f7fafc;
  color: var(--primary-color);
  border-color: rgba(90, 103, 216, 0.15);
  transform: translateX(4px);
  box-shadow: 0 2px 8px rgba(90, 103, 216, 0.1);
}

.nav-link-enhanced.active {
  background: linear-gradient(
    135deg,
    var(--primary-color) 0%,
    var(--primary-dark) 100%
  );
  color: white;
  border-color: var(--primary-color);
  box-shadow: 0 4px 12px rgba(90, 103, 216, 0.3);
}

.nav-link-enhanced i {
  width: 22px;
  margin-right: 0.875rem;
  font-size: 1.1rem;
  transition: var(--transition);
}

.nav-link-enhanced:hover i {
  transform: scale(1.1);
}

.nav-link-enhanced span {
  flex: 1;
  font-size: 0.95rem;
}

/* Enhanced Chevron */
.chevron-enhanced {
  transition: transform 0.3s ease;
  font-size: 0.8rem;
  opacity: 0.7;
}

.nav-link-enhanced[aria-expanded="true"] .chevron-enhanced {
  transform: rotate(180deg);
  opacity: 1;
}

/* Enhanced Submenu Styles - Light Theme */
.submenu-enhanced {
  margin-left: 1.5rem;
  margin-top: 0.5rem;
  padding-left: 1rem;
  border-left: 2px solid rgba(90, 103, 216, 0.15);
}

.submenu-link {
  padding: 0.625rem 1rem;
  font-size: 0.9rem;
  margin-bottom: 0.25rem;
  border-radius: var(--border-radius);
  color: #718096;
}

.submenu-link:hover {
  background: #f1f5f9;
  color: var(--primary-color);
  transform: translateX(2px);
}

.submenu-link i {
  width: 18px;
  font-size: 0.9rem;
  margin-right: 0.625rem;
}

/* Enhanced Badge */
.badge-enhanced {
  font-size: 0.7rem;
  padding: 0.25rem 0.5rem;
  border-radius: 12px;
  font-weight: 600;
  animation: pulse 2s infinite;
}

/* Enhanced Navigation Divider - Light Theme */
.nav-divider-enhanced {
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(0, 0, 0, 0.1) 50%,
    transparent 100%
  );
  margin: 1.5rem 0;
  position: relative;
}

.nav-divider-enhanced::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 50%;
  transform: translateX(-50%);
  width: 40px;
  height: 3px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(90, 103, 216, 0.3) 50%,
    transparent 100%
  );
  border-radius: 2px;
}

/* Enhanced Sidebar Stats - Light Theme */
.sidebar-stats-enhanced {
  padding: 1.5rem 1.25rem;
  border-top: 1px solid rgba(0, 0, 0, 0.1);
  margin-top: 1.5rem;
  background: rgba(90, 103, 216, 0.03);
  backdrop-filter: blur(5px);
}

.stats-header {
  text-align: center;
  margin-bottom: 1.25rem;
}

.stats-title {
  font-size: 1rem;
  font-weight: 600;
  color: #2d3748;
  margin-bottom: 0.25rem;
}

.stats-subtitle {
  font-size: 0.8rem;
  color: #718096;
  margin-bottom: 0;
}

.stats-grid {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.stat-item-enhanced {
  display: flex;
  align-items: center;
  padding: 1rem;
  background: #ffffff;
  border-radius: var(--border-radius-lg);
  border: 1px solid rgba(0, 0, 0, 0.08);
  transition: var(--transition);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
}

.stat-item-enhanced:hover {
  background: #f8f9fa;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(90, 103, 216, 0.15);
  border-color: rgba(90, 103, 216, 0.2);
}

.stat-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(
    135deg,
    var(--primary-color) 0%,
    var(--primary-dark) 100%
  );
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 1rem;
  flex-shrink: 0;
}

.stat-icon i {
  font-size: 1.2rem;
  color: white;
}

.stat-content {
  flex: 1;
}

.stat-value {
  font-size: 1.25rem;
  font-weight: 700;
  color: #2d3748;
  margin-bottom: 0.25rem;
}

.stat-label {
  font-size: 0.8rem;
  color: #718096;
  margin-bottom: 0;
}

/* ================================
   Main Content Area
   ================================ */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  padding: 2rem;
  background: #ffffff;
  min-height: calc(100vh - var(--header-height));
}

/* ================================
   Enhanced Responsive Design
   ================================ */
@media (max-width: 991.98px) {
  .sidebar {
    transform: translateX(-100%);
    width: var(--sidebar-width);
  }

  .sidebar.show {
    transform: translateX(0);
    box-shadow: 2px 0 20px rgba(0, 0, 0, 0.3);
  }

  .main-content {
    margin-left: 0;
    padding: 1rem;
  }

  .header-main .navbar-brand {
    font-size: 1.1rem;
  }

  .user-name,
  .user-role {
    display: none;
  }

  /* Enhanced mobile sidebar */
  .sidebar-enhanced {
    backdrop-filter: blur(20px);
  }

  .stats-grid {
    gap: 0.75rem;
  }

  .stat-item-enhanced {
    padding: 0.75rem;
  }

  .stat-icon {
    width: 36px;
    height: 36px;
  }

  .stat-value {
    font-size: 1.1rem;
  }
}

@media (max-width: 767.98px) {
  .main-content {
    padding: 0.75rem;
  }

  .header-main .navbar {
    padding: 0 0.5rem;
  }

  .notification-dropdown {
    min-width: 250px;
  }

  /* Mobile sidebar adjustments */
  .sidebar-nav {
    padding: 0 1rem;
  }

  .nav-link-enhanced {
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
  }

  .nav-link-enhanced i {
    width: 20px;
    margin-right: 0.75rem;
  }

  .submenu-enhanced {
    margin-left: 1rem;
    padding-left: 0.75rem;
  }

  .submenu-link {
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
  }

  .sidebar-stats-enhanced {
    padding: 1rem;
  }

  .stats-title {
    font-size: 0.9rem;
  }

  .stats-subtitle {
    font-size: 0.75rem;
  }
}

/* ================================
   Utility Classes
   ================================ */
.page-header {
  background: #ffffff;
  padding: 1.5rem 2rem;
  margin: -2rem -2rem 2rem -2rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: var(--border-radius);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.page-title {
  font-size: 1.75rem;
  font-weight: 600;
  color: var(--dark-color);
  margin-bottom: 0.5rem;
}

.page-subtitle {
  color: var(--secondary-color);
  margin-bottom: 0;
}

.card {
  border: none;
  border-radius: var(--border-radius);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
  transition: var(--transition);
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.05);
}

.card:hover {
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.12);
  transform: translateY(-2px);
}

.btn {
  border-radius: var(--border-radius);
  transition: var(--transition);
}

.btn:hover {
  transform: translateY(-1px);
}

.table {
  border-radius: var(--border-radius);
  overflow: hidden;
}

.table th {
  background: #f8f9fa;
  font-weight: 600;
  border-bottom: 2px solid rgba(0, 0, 0, 0.1);
  color: #2d3748;
}

.badge {
  font-size: 0.75rem;
  padding: 0.35em 0.65em;
  font-weight: 500;
  border-radius: 0.375rem;
}

/* ================================
   Enhanced Status Badges - Proper Specificity
   ================================ */
.badge.badge-success {
  background-color: #198754;
  color: #ffffff;
}

.badge.badge-warning {
  background-color: #ffc107;
  color: #000000;
}

.badge.badge-danger {
  background-color: #dc3545;
  color: #ffffff;
}

.badge.badge-info {
  background-color: #0dcaf0;
  color: #000000;
}

.badge.badge-primary {
  background-color: #0d6efd;
  color: #ffffff;
}

.badge.badge-secondary {
  background-color: #6c757d;
  color: #ffffff;
}

.badge.badge-light {
  background-color: #f8f9fa;
  color: #212529;
  border: 1px solid rgba(0, 0, 0, 0.125);
}

.badge.badge-dark {
  background-color: #212529;
  color: #ffffff;
}

/* ================================
   Bootstrap 5 Utility Classes for Badges
   ================================ */
.badge.bg-success {
  background-color: #198754;
  color: #ffffff;
}

.badge.bg-warning {
  background-color: #ffc107;
  color: #000000;
}

.badge.bg-danger {
  background-color: #dc3545;
  color: #ffffff;
}

.badge.bg-info {
  background-color: #0dcaf0;
  color: #000000;
}

.badge.bg-primary {
  background-color: #0d6efd;
  color: #ffffff;
}

.badge.bg-secondary {
  background-color: #6c757d;
  color: #ffffff;
}

.badge.bg-light {
  background-color: #f8f9fa;
  color: #212529;
  border: 1px solid rgba(0, 0, 0, 0.125);
}

.badge.bg-dark {
  background-color: #212529;
  color: #ffffff;
}

.alert {
  border: none;
  border-radius: var(--border-radius);
}

/* ================================
   Loading States
   ================================ */
.loading {
  opacity: 0.6;
  pointer-events: none;
}

.spinner-border-sm {
  width: 1rem;
  height: 1rem;
}

/* ================================
   Form Styles
   ================================ */
.form-control,
.form-select {
  border-radius: var(--border-radius);
  border: 1px solid rgba(0, 0, 0, 0.1);
  transition: var(--transition);
  background: #ffffff;
  color: #2d3748;
}

.form-control:focus,
.form-select:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
  background: #ffffff;
}

.form-label {
  font-weight: 500;
  color: var(--dark-color);
}

.invalid-feedback {
  font-size: 0.875rem;
}

/* ================================
   Mobile Sidebar Toggle
   ================================ */
.sidebar-toggle {
  position: fixed;
  top: calc(var(--header-height) + 1rem);
  left: 1rem;
  z-index: 1021;
  background: var(--primary-color);
  color: white;
  border: none;
  border-radius: 50%;
  width: 50px;
  height: 50px;
  display: none;
  align-items: center;
  justify-content: center;
  box-shadow: var(--box-shadow-lg);
  transition: var(--transition);
}

.sidebar-toggle:hover {
  background: #0056b3;
  transform: scale(1.1);
}

@media (max-width: 991.98px) {
  .sidebar-toggle {
    display: flex;
  }
}

/* ================================
   Light Theme Support (Soft & Comfortable)
   ================================ */
@media (prefers-color-scheme: dark) {
  body {
    background-color: #ffffff;
    color: #2d3748;
  }

  .main-content {
    background: #ffffff;
  }

  .card {
    background: #ffffff;
    color: #2d3748;
    border: 1px solid rgba(0, 0, 0, 0.1);
  }

  .page-header {
    background: #ffffff;
    border-bottom-color: rgba(0, 0, 0, 0.1);
  }

  .table {
    color: #2d3748;
  }

  .table th {
    background: #f8f9fa;
    border-bottom-color: rgba(0, 0, 0, 0.1);
  }

  .form-control,
  .form-select {
    background: #ffffff;
    border-color: rgba(0, 0, 0, 0.1);
    color: #2d3748;
  }

  .form-control:focus,
  .form-select:focus {
    background: #ffffff;
    border-color: var(--primary-color);
    color: #2d3748;
  }
}

/* ================================
   UNIFIED THEME SYSTEM - GLOBAL OVERRIDES
   These rules ensure consistent theming across all pages
   ================================ */

/* Body and main content theme */
body {
  background-color: var(--body-bg);
  color: var(--text-primary);
}

.main-content {
  background-color: var(--content-bg);
  color: var(--text-primary);
}

/* Page headers across all pages */
.page-header {
  background: var(--page-header-bg);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-light);
}

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

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

/* Cards across all pages */
.card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-light);
  color: var(--text-primary);
}

.card-header {
  color: var(--text-primary);
  border-bottom: 1px solid var(--border-color);
}

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

.card-body {
  background: var(--card-bg);
  color: var(--text-primary);
}

/* Forms across all pages */
.form-control,
.form-select {
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  color: var(--text-primary);
}

.form-control:focus,
.form-select:focus {
  border-color: var(--input-focus-border);
  box-shadow: var(--input-focus-shadow);
  background: var(--input-bg);
  color: var(--text-primary);
}

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

/* Modals across all pages */
.modal-content {
  background: var(--modal-bg);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

.modal-header {
  border-bottom: 1px solid var(--border-color);
  color: var(--text-primary);
}

.modal-body {
  background: var(--modal-bg);
  color: var(--text-primary);
}

.modal-footer {
  border-top: 1px solid var(--border-color);
  background: var(--modal-bg);
}

/* Filters and search sections */
.suppliers-filters,
.search-section {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-light);
  color: var(--text-primary);
}

/* Specific page elements */
.supplier-card,
.sale-form,
.customer-form,
.product-form {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-light);
  color: var(--text-primary);
}

/* Page-specific table styles */
.suppliers-table,
.customers-table,
.sales-table {
  background: var(--table-bg);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-light);
  color: var(--text-primary);
}

/* Alerts across all pages */
.alert {
  border: 1px solid var(--border-color);
}

/* ================================
   Print Styles
   ================================ */
@media print {
  .header-main,
  .sidebar {
    display: none;
  }

  .main-content {
    margin-left: 0;
    padding: 0;
  }

  .btn,
  .dropdown,
  .nav-tabs {
    display: none;
  }

  .card {
    border: 1px solid #000;
    box-shadow: none;
  }
}

/* Force header search input to always use soft white style */
header .search-input-enhanced,
.header-main .search-input-enhanced {
  background: #fff;
  color: #2d3748;
  border: 1px solid rgba(0, 0, 0, 0.1);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  transition: var(--transition);
}
header .search-input-enhanced:focus,
.header-main .search-input-enhanced:focus {
  background: #fff;
  color: #2d3748;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 0.2rem rgba(90, 103, 216, 0.25);
}
header .search-input-enhanced::placeholder,
.header-main .search-input-enhanced::placeholder {
  color: #a0aec0;
}
