:root {
  /* Orange primary */
  --bs-primary: #ff6b35; /* vibrant orange */
  --bs-primary-rgb: 255, 107, 53;
  --bs-secondary: #331468; /* dark purple */
  --bs-secondary-rgb: 51, 20, 104;
  --bs-link-color: #ff6b35;
  --bs-link-hover-color: #e55a2b;
  
  /* Lime green for micro animations */
  --animation-color: #ccfc2f; /* bright lime green */
  --animation-color-rgb: 204, 252, 47;
  --animation-color-light: #b8e329;
  --animation-color-dark: #a4ca23;
}

/* Fallbacks in case some components don't use vars */
.btn-primary {
  --bs-btn-bg: #ff6b35;
  --bs-btn-border-color: #ff6b35;
  --bs-btn-hover-bg: #e55a2b;
  --bs-btn-hover-border-color: #e55a2b;
  --bs-btn-active-bg: #cc4a22;
  --bs-btn-active-border-color: #cc4a22;
}

.text-primary { color: #ff6b35 !important; }
.bg-primary { background-color: #ff6b35 !important; }
.border-primary { border-color: #ff6b35 !important; }
.text-secondary { color: #331468 !important; }
.bg-secondary { background-color: #331468 !important; }
.border-secondary { border-color: #331468 !important; }

a { color: var(--bs-link-color); }
a:hover { color: var(--bs-link-hover-color); }

/* --- Sidebar overrides --- */
/* Force Volt's gray sidebar to use our primary color */
.sidebar.bg-gray-800 {
  background-color: var(--bs-primary) !important;
}

/* Improve active/hover state readability in sidebar */
.sidebar .nav-link.active,
.sidebar .nav-link:focus,
.sidebar .nav-link:hover {
  color: #ffffff !important;
  background-color: rgba(var(--bs-primary-rgb), 0.18) !important;
}
.sidebar .nav-link {
  color: rgba(255, 255, 255, 0.9) !important;
}
.sidebar .nav-link .sidebar-icon svg,
.sidebar .nav-link .sidebar-icon {
  color: inherit;
}
.sidebar .nav-link.active .sidebar-icon svg,
.sidebar .nav-link:hover .sidebar-icon svg {
  color: var(--bs-primary) !important;
}

/* --- Button overrides --- */
/* Ensure primary buttons use the new palette regardless of theme internals */
.btn-primary {
  color: #ffffff;
  background-color: var(--bs-primary) !important;
  border-color: var(--bs-primary) !important;
}
.btn-primary:hover,
.btn-primary:focus {
  color: #ffffff;
  background-color: #e55a2b !important;
  border-color: #e55a2b !important;
  box-shadow: 0 0 12px rgba(var(--animation-color-rgb), 0.4);
}
.btn-primary:active,
.btn-primary.active,
.show > .btn-primary.dropdown-toggle {
  color: #ffffff;
  background-color: #cc4a22 !important;
  border-color: #cc4a22 !important;
}

/* Map Volt's gray-800 variant to primary tone (used widely in templates) */
.btn-gray-800 {
  color: #ffffff;
  background-color: var(--bs-primary) !important;
  border-color: var(--bs-primary) !important;
}
.btn-gray-800:hover,
.btn-gray-800:focus {
  color: #ffffff;
  background-color: #e55a2b !important;
  border-color: #e55a2b !important;
}
.btn-gray-800:active,
.btn-gray-800.active,
.show > .btn-gray-800.dropdown-toggle {
  color: #ffffff;
  background-color: #cc4a22 !important;
  border-color: #cc4a22 !important;
}

/* Map other common variants to the secondary palette */
.btn-secondary {
  color: #ffffff;
  background-color: var(--bs-secondary) !important;
  border-color: var(--bs-secondary) !important;
}
.btn-secondary:hover,
.btn-secondary:focus {
  color: #ffffff;
  background-color: #2a1155 !important;
  border-color: #2a1155 !important;
  box-shadow: 0 0 10px rgba(var(--animation-color-rgb), 0.3);
}
.btn-secondary:active,
.btn-secondary.active,
.show > .btn-secondary.dropdown-toggle {
  color: #ffffff;
  background-color: #210e42 !important;
  border-color: #210e42 !important;
}

.btn-outline-primary {
  color: var(--bs-primary) !important;
  border-color: var(--bs-primary) !important;
}
.btn-outline-primary:hover,
.btn-outline-primary:focus {
  color: #ffffff !important;
  background-color: var(--bs-primary) !important;
  border-color: var(--bs-primary) !important;
  box-shadow: 0 0 12px rgba(var(--animation-color-rgb), 0.4);
}
.btn-outline-primary:active,
.btn-outline-primary.active,
.show > .btn-outline-primary.dropdown-toggle {
  color: #ffffff !important;
  background-color: #cc4a22 !important;
  border-color: #cc4a22 !important;
}

.btn-link { color: var(--bs-link-color) !important; }
.btn-link:hover, .btn-link:focus { color: var(--bs-link-hover-color) !important; }

/* --- Icon shapes and badges --- */
.icon-shape-primary {
  color: #ffffff !important;
  background-color: var(--bs-primary) !important;
}
.icon-shape-secondary {
  color: #ffffff !important;
  background-color: var(--bs-secondary) !important;
}

/* Additional icon-shape color variants */
.icon-shape-success {
  color: #ffffff !important;
  background-color: #28a745 !important;
}
.icon-shape-info {
  color: #ffffff !important;
  background-color: #17a2b8 !important;
}
.icon-shape-warning {
  color: #000000 !important;
  background-color: #ffc107 !important;
}
.icon-shape-danger {
  color: #ffffff !important;
  background-color: #dc3545 !important;
}
.icon-shape-lime {
  color: #000000 !important;
  background-color: var(--animation-color) !important;
}
.icon-shape-orange {
  color: #ffffff !important;
  background-color: var(--bs-primary) !important;
}
.icon-shape-purple {
  color: #ffffff !important;
  background-color: #6f42c1 !important;
}
.icon-shape-pink {
  color: #ffffff !important;
  background-color: #e83e8c !important;
}
.icon-shape-teal {
  color: #ffffff !important;
  background-color: #20c997 !important;
}
.icon-shape-indigo {
  color: #ffffff !important;
  background-color: #6610f2 !important;
}
.icon-shape-cyan {
  color: #000000 !important;
  background-color: #17a2b8 !important;
}
.icon-shape-gray {
  color: #ffffff !important;
  background-color: #6c757d !important;
}
.icon-shape-dark {
  color: #ffffff !important;
  background-color: #343a40 !important;
}
.icon-shape-light {
  color: #000000 !important;
  background-color: #f8f9fa !important;
}

/* Icon-shape hover effects */
.icon-shape-primary:hover,
.icon-shape-secondary:hover,
.icon-shape-success:hover,
.icon-shape-info:hover,
.icon-shape-warning:hover,
.icon-shape-danger:hover,
.icon-shape-orange:hover,
.icon-shape-lime:hover,
.icon-shape-purple:hover,
.icon-shape-pink:hover,
.icon-shape-teal:hover,
.icon-shape-indigo:hover,
.icon-shape-cyan:hover,
.icon-shape-gray:hover,
.icon-shape-dark:hover,
.icon-shape-light:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15), 0 0 8px rgba(var(--animation-color-rgb), 0.3);
  transition: all 0.3s ease;
}
.badge.bg-primary,
.badge.text-bg-primary {
  background-color: var(--bs-primary) !important;
}

/* ========================================
   MODERN SIDEBAR STYLES
   ======================================== */

/* Main sidebar container */
.modern-sidebar {
  background: linear-gradient(180deg, var(--bs-secondary) 0%, #210e42 100%) !important;
  box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
  border-right: 1px solid rgba(255, 255, 255, 0.1);
}

/* Logo section */
.logo-section {
  padding: 1rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  margin-bottom: 1.5rem !important;
}

.logo-link {
  transition: transform 0.3s ease;
}

.logo-link:hover {
  transform: scale(1.05);
  filter: drop-shadow(0 0 8px var(--animation-color));
}

.sidebar-logo {
  max-width: 140px;
  height: auto;
  max-height: 50px;
  filter: brightness(1.1);
  background-color: rgba(255,255,255,0.45);
  padding-right: 6px;
  padding-left: 6px;
  border-radius: 30px;
}

/* User avatar placeholder */
.user-avatar-placeholder {
  width: 48px;
  height: 48px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid rgba(255, 255, 255, 0.2);
}

.user-greeting {
  color: rgba(255, 255, 255, 0.95) !important;
  font-weight: 600;
}

/* Modern navigation */
.modern-nav {
  gap: 0.25rem;
}

.modern-nav-link {
  display: flex !important;
  align-items: center;
  padding: 0.75rem 1rem !important;
  margin: 0.125rem 0;
  border-radius: 0.5rem;
  color: rgba(255, 255, 255, 0.85) !important;
  text-decoration: none;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.modern-nav-link::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: 0;
  background: rgba(255, 255, 255, 0.1);
  transition: width 0.3s ease;
  z-index: 0;
}

.modern-nav-link:hover::before {
  width: 100%;
}

.modern-nav-link:hover {
  color: #ffffff !important;
  background-color: rgba(255, 255, 255, 0.08) !important;
  transform: translateX(4px);
  box-shadow: 0 0 12px rgba(var(--animation-color-rgb), 0.3);
}

.modern-nav-link .nav-content {
  display: flex;
  align-items: center;
  flex: 1;
  position: relative;
  z-index: 1;
}

/* Active state */
.nav-item.active .modern-nav-link {
  background: rgba(255, 255, 255, 0.15) !important;
  color: #ffffff !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.nav-item.active .modern-nav-link::before {
  width: 100%;
  background: rgba(255, 255, 255, 0.1);
}

/* Sidebar icons */
.modern-nav-link .sidebar-icon {
  width: 20px;
  height: 20px;
  margin-right: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 1;
}

.modern-nav-link .sidebar-icon svg {
  width: 20px;
  height: 20px;
  transition: all 0.3s ease;
}

.modern-nav-link:hover .sidebar-icon svg {
  transform: scale(1.1);
  filter: drop-shadow(0 0 4px var(--animation-color));
}

/* Sidebar text */
.sidebar-text {
  font-weight: 500;
  font-size: 0.9rem;
  position: relative;
  z-index: 1;
}

/* Collapsible navigation */
.collapsible-nav {
  cursor: pointer;
  justify-content: space-between !important;
}

.collapsible-nav .link-arrow {
  transition: transform 0.3s ease;
  position: relative;
  z-index: 1;
}

.collapsible-nav[aria-expanded="true"] .link-arrow,
.collapsible-nav:not(.collapsed) .link-arrow {
  transform: rotate(90deg);
}

/* Submenu styles */
.submenu {
  margin-top: 0.5rem;
  padding-left: 0;
  background: rgba(0, 0, 0, 0.1);
  border-radius: 0.5rem;
  overflow: hidden;
}

.submenu-nav {
  padding: 0.5rem 0;
}

.submenu-link {
  padding: 0.5rem 1rem 0.5rem 2.5rem !important;
  margin: 0.125rem 0.5rem;
  border-radius: 0.375rem;
  color: rgba(255, 255, 255, 0.75) !important;
  font-size: 0.85rem;
  transition: all 0.3s ease;
}

.submenu-link:hover {
  color: rgba(255, 255, 255, 0.95) !important;
  background-color: rgba(255, 255, 255, 0.08) !important;
  transform: translateX(2px);
  box-shadow: 0 0 8px rgba(var(--animation-color-rgb), 0.2);
}

.submenu .nav-item.active .submenu-link {
  background: rgba(255, 255, 255, 0.12) !important;
  color: #ffffff !important;
}

.submenu-link .sidebar-icon {
  width: 16px;
  height: 16px;
  margin-right: 0.5rem;
}

.submenu-link .sidebar-icon svg {
  width: 16px;
  height: 16px;
}

/* External link indicator */
.external-link {
  justify-content: space-between !important;
}

.external-indicator {
  opacity: 0.6;
  transition: opacity 0.3s ease;
  position: relative;
  z-index: 1;
}

.external-link:hover .external-indicator {
  opacity: 1;
  filter: drop-shadow(0 0 3px var(--animation-color));
}

/* Sidebar divider */
.sidebar-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.15);
  margin: 1.5rem 0 !important;
  border: none;
}

/* Logout link special styling */
.logout-link {
  color: rgba(255, 255, 255, 0.8) !important;
}

.logout-link:hover {
  color: #ff6b6b !important;
  background-color: rgba(255, 107, 107, 0.1) !important;
}

/* Mobile specific styles */
@media (max-width: 991.98px) {
  .close-btn {
    padding: 0.5rem;
    border-radius: 0.375rem;
    transition: background-color 0.3s ease;
  }
  
  .close-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
    box-shadow: 0 0 8px rgba(var(--animation-color-rgb), 0.3);
  }
  
  .logout-btn {
    background-color: rgba(255, 255, 255, 0.15) !important;
    border-color: rgba(255, 255, 255, 0.2) !important;
    transition: all 0.3s ease;
  }
  
  .logout-btn:hover {
    background-color: rgba(255, 107, 107, 0.2) !important;
    border-color: rgba(255, 107, 107, 0.3) !important;
  }
}

/* Smooth scrolling for sidebar */
.modern-sidebar[data-simplebar] {
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.3) transparent;
}

.modern-sidebar[data-simplebar]::-webkit-scrollbar {
  width: 6px;
}

.modern-sidebar[data-simplebar]::-webkit-scrollbar-track {
  background: transparent;
}

.modern-sidebar[data-simplebar]::-webkit-scrollbar-thumb {
  background-color: rgba(255, 255, 255, 0.3);
  border-radius: 3px;
}

.modern-sidebar[data-simplebar]::-webkit-scrollbar-thumb:hover {
  background-color: rgba(255, 255, 255, 0.5);
}

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

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

/* Focus states for accessibility */
.modern-nav-link:focus,
.submenu-link:focus {
  outline: 2px solid rgba(255, 255, 255, 0.5);
  outline-offset: 2px;
}

/* Admin section special styling */
.admin-section .modern-nav-link {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.admin-section .modern-nav-link:hover {
  background: rgba(255, 255, 255, 0.12) !important;
  border-color: rgba(255, 255, 255, 0.2);
}

/* Ripple effect */
.ripple-effect {
  position: absolute;
  border-radius: 50%;
  background: rgba(var(--animation-color-rgb), 0.4);
  transform: scale(0);
  animation: ripple 0.6s linear;
  pointer-events: none;
}

@keyframes ripple {
  to {
    transform: scale(2);
    opacity: 0;
  }
}

/* Loading spinner animation */
.animate-spin {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* Enhanced focus indicators */
.modern-nav-link:focus-visible,
.submenu-link:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.8);
  outline-offset: 2px;
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.1);
}

/* Smooth transitions for all interactive elements */
.modern-nav-link,
.submenu-link,
.collapsible-nav,
.logo-link,
.close-btn,
.logout-btn {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Enhanced hover effects */
.modern-nav-link:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15), 0 0 12px rgba(var(--animation-color-rgb), 0.2);
}

.submenu-link:hover {
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1), 0 0 8px rgba(var(--animation-color-rgb), 0.15);
}

/* Better visual hierarchy */
.sidebar-text {
  letter-spacing: 0.025em;
  line-height: 1.4;
}

/* Improved mobile responsiveness */
@media (max-width: 767.98px) {
  .modern-sidebar {
    transform: translateX(-100%);
    transition: transform 0.3s ease-in-out;
  }
  
  .modern-sidebar.show {
    transform: translateX(0);
  }
  
  .sidebar-logo {
    max-width: 120px;
    max-height: 40px;
  }
  
  .modern-nav-link {
    padding: 0.875rem 1rem !important;
  }
  
  .sidebar-text {
    font-size: 0.95rem;
  }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .modern-sidebar {
    background: #000000 !important;
    border-right: 2px solid #ffffff;
  }
  
  .modern-nav-link {
    color: #ffffff !important;
    border: 1px solid rgba(255, 255, 255, 0.3);
  }
  
  .modern-nav-link:hover,
  .nav-item.active .modern-nav-link {
    background: #333333 !important;
    border-color: #ffffff;
  }
}

/* Form input animations */
.form-control:focus,
.form-select:focus {
  box-shadow: 0 0 0 0.2rem rgba(var(--animation-color-rgb), 0.25) !important;
  border-color: var(--animation-color) !important;
}

/* Link animations */
a:not(.btn):hover {
  text-shadow: 0 0 4px rgba(var(--animation-color-rgb), 0.3);
}

/* Badge animations */
.badge:hover {
  transform: scale(1.05);
  box-shadow: 0 0 8px rgba(var(--animation-color-rgb), 0.4);
  transition: all 0.2s ease;
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  .modern-nav-link,
  .submenu-link,
  .collapsible-nav,
  .logo-link,
  .link-arrow,
  .modern-nav-link::before {
    transition: none;
  }
  
  .ripple-effect {
    display: none;
  }
  
  @keyframes slideDown {
    from { opacity: 0; }
    to { opacity: 1; }
  }
}


.breadcrumb-item + .breadcrumb-item::before{
  content: "/" !important;
}

li.breadcrumb-item.active::before{
  content: "" !important;
}

/* Sortable Table Styles */
table.table thead th.sortable {
    position: relative;
    user-select: none;
}

table.table thead th.sortable:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

table.table thead th.sortable .sort-indicator {
    display: inline-block;
    font-size: 0.75rem;
    opacity: 0.5;
    transition: opacity 0.2s;
}

table.table thead th.sortable:hover .sort-indicator {
    opacity: 1;
}

table.table thead th.sorted-asc,
table.table thead th.sorted-desc {
    background-color: rgba(0, 123, 255, 0.1);
}

table.table thead th.sorted-asc .sort-indicator,
table.table thead th.sorted-desc .sort-indicator {
    opacity: 1;
}

table.table thead th.sorted-asc .sort-indicator i,
table.table thead th.sorted-desc .sort-indicator i {
    color: var(--bs-primary, #0d6efd);
}