/* CSS Variables - Brand Colors */
:root {
  /* Brand Primary (Meiwa Blue) */
  --brand-primary: #3b82f6;
  --brand-primary-hover: #2563eb;
  --brand-primary-light: #dbeafe;

  /* Bootstrap token override */
  --bs-primary: var(--brand-primary);
  --bs-primary-rgb: 59, 130, 246;
}

html {
  font-size: 14px;
  position: relative;
  min-height: 100%;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

/* Typography improvements - Headings */
h1, h2, h3, h4, h5, h6 {
  font-weight: 600; /* Giảm từ default 700 xuống 600 */
  line-height: 1.3;
  margin-bottom: 0.5rem;
}

/* Card headers */
.card-header h5,
.card-header h4,
.card-header h3 {
  font-weight: 500; /* Giảm xuống 500 */
  line-height: 1.4;
}

/* Form labels */
.form-label {
  font-weight: 500; /* Medium weight */
  line-height: 1.5;
}

/* Sidebar text improvements */
.sidebar-text {
  line-height: 20px; /* Theo guideline */
  font-weight: 400; /* Normal weight cho menu items */
  font-size: 14px; /* Theo guideline */
}

body {
  margin: 0;
  padding: 0;
  background-color: #f3f4f6;
  overflow-x: hidden;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
  font-weight: 400;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Sidebar Styles */
#sidebar {
  position: fixed;
  left: 0;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: visible; /* Allow toggle button to be visible outside sidebar */
  transition: width 0.3s ease, transform 0.3s ease;
  z-index: 1000;
}

#mobile-sidebar-toggle {
  display: none;
}

/* Ensure modals are above sidebar */
.modal {
  z-index: 1055 !important;
}

.modal-backdrop {
  z-index: 1050 !important;
}

/* Fixed modal size with scroll */
.modal-dialog {
  max-width: 800px;
  margin: 1.75rem auto;
}

.modal-dialog.modal-lg {
  max-width: 900px;
}

.modal-content {
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.modal-header {
  flex-shrink: 0;
  border-bottom: 1px solid #dee2e6;
}

.modal-body {
  flex: 1 1 auto;
  overflow-y: auto;
  overflow-x: hidden;
  max-height: calc(90vh - 120px);
  padding: 1rem;
}

.modal-footer {
  flex-shrink: 0;
  border-top: 1px solid #dee2e6;
}

/* Custom scrollbar for modal body */
.modal-body::-webkit-scrollbar {
  width: 8px;
}

.modal-body::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 4px;
}

.modal-body::-webkit-scrollbar-thumb {
  background: #888;
  border-radius: 4px;
}

.modal-body::-webkit-scrollbar-thumb:hover {
  background: #555;
}

/* Sidebar collapse functionality */
#sidebar.collapsed {
  width: 4rem !important;
}

#sidebar.collapsed .sidebar-title {
  display: none;
}

#sidebar.collapsed .sidebar-text {
  display: none;
}

#sidebar.collapsed .nav-item {
  justify-content: center;
  padding-left: 0.75rem;
  padding-right: 0.75rem;
  display: flex !important;
}

#sidebar.collapsed .nav-item i {
  display: inline-block !important;
  margin: 0 !important;
  margin-right: 0 !important;
  width: auto !important;
  font-size: 1.25rem;
}

/* Sidebar header - reduced height */
.sidebar-header {
  min-height: auto;
  padding: 0.5rem 1rem !important;
}

/* Sidebar title adjustments - reduce font sizes and weight */
.sidebar-title h1 {
  font-size: 1rem !important;
  font-weight: 500 !important; /* Giảm từ 700 xuống 500 */
  line-height: 1.3;
  margin-bottom: 0.125rem;
}

.sidebar-title p {
  font-size: 0.75rem !important;
  line-height: 1.2;
  margin-top: 0;
}

/* Sidebar toggle button - circular button on right edge, centered in header */
#sidebar-toggle-btn {
  position: absolute;
  right: -16px;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  background: #ffffff !important;
  border: none !important;
  border-radius: 50%;
  color: var(--brand-primary) !important;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  transition: all 0.2s ease;
  z-index: 1001;
  cursor: pointer;
}

#sidebar-toggle-btn:hover {
  background: #f8f9fa !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  transform: translateY(-50%) scale(1.1);
}

#sidebar-toggle-btn:focus {
  background: #f8f9fa !important;
  box-shadow: 0 0 0 0.2rem rgba(59, 130, 246, 0.25) !important;
  outline: none !important;
  transform: translateY(-50%);
}

#sidebar-toggle-btn:active {
  background: #e9ecef !important;
  transform: translateY(-50%) scale(0.95);
}

#sidebar-toggle-btn i {
  font-size: 1rem;
  display: inline-block;
  transition: transform 0.3s ease;
  line-height: 1;
}

#sidebar.collapsed #sidebar-toggle-btn {
  right: -16px;
}

#sidebar.collapsed #sidebar-toggle-btn i {
  transform: rotate(180deg);
}

#sidebar.collapsed .menu-group-header {
  display: none;
}

/* Sidebar dividers */
.sidebar-divider {
  height: 1px;
  background-color: rgba(255, 255, 255, 0.2);
  margin: 0.5rem 1rem;
  list-style: none;
}

/* Menu group styles */
.menu-group-header {
  margin-top: 0.5rem;
}

/* Menu group toggle button styles */
.menu-group-toggle {
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.menu-group-toggle {
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.menu-group-toggle:hover {
  background-color: #374151 !important;
}

/* Light theme hover */
#sidebar.bg-light .menu-group-toggle:hover {
  background-color: #e5e7eb !important;
}

/* Green theme hover */
#sidebar.bg-success .menu-group-toggle:hover {
  background-color: rgba(255, 255, 255, 0.1) !important;
}

/* Gray theme hover */
#sidebar.bg-secondary .menu-group-toggle:hover {
  background-color: rgba(255, 255, 255, 0.1) !important;
}

/* Blue theme hover */
#sidebar.bg-primary .menu-group-toggle:hover {
  background-color: rgba(255, 255, 255, 0.1) !important;
}

.menu-group-icon {
  transition: transform 0.3s ease;
  color: rgba(255, 255, 255, 0.9) !important;
  font-size: 0.875rem !important;
  display: inline-block !important;
  visibility: visible !important;
  opacity: 1 !important;
  width: auto !important;
  height: auto !important;
  line-height: 1 !important;
  font-family: "bootstrap-icons" !important;
  font-style: normal !important;
  font-weight: normal !important;
  font-variant: normal !important;
  text-transform: none !important;
  -webkit-font-smoothing: antialiased !important;
  -moz-osx-font-smoothing: grayscale !important;
}

/* Green theme menu group icon */
#sidebar.bg-success .menu-group-icon {
  color: rgba(255, 255, 255, 0.7);
}

/* Gray theme menu group icon */
#sidebar.bg-secondary .menu-group-icon {
  color: rgba(255, 255, 255, 0.7);
}

/* Blue theme menu group icon - Improved contrast */
#sidebar.bg-primary .menu-group-icon {
  color: rgba(255, 255, 255, 0.9) !important;
  display: inline-block !important;
  visibility: visible !important;
  opacity: 1 !important;
  font-size: 0.875rem !important;
}

.menu-group-toggle.active .menu-group-icon {
  transform: rotate(180deg);
  color: rgba(255, 255, 255, 1) !important;
}

/* Highlight menu group header when it contains active item */
.menu-group-toggle.has-active {
  background-color: rgba(255, 255, 255, 0.1) !important;
  border-left: 2px solid rgba(255, 255, 255, 0.3);
  transition: all 0.2s ease;
}

/* Green theme highlight */
#sidebar.bg-success .menu-group-toggle.has-active {
  background-color: rgba(255, 255, 255, 0.15) !important;
  border-left: 2px solid rgba(255, 255, 255, 0.4);
  transition: all 0.2s ease;
}

/* Gray theme highlight */
#sidebar.bg-secondary .menu-group-toggle.has-active {
  background-color: rgba(255, 255, 255, 0.15) !important;
  border-left: 2px solid rgba(255, 255, 255, 0.4);
  transition: all 0.2s ease;
}

/* Blue theme highlight */
#sidebar.bg-primary .menu-group-toggle.has-active {
  background-color: rgba(255, 255, 255, 0.12) !important;
  border-left: 2px solid rgba(255, 255, 255, 0.4);
  transition: all 0.2s ease;
}

/* Menu group toggle hover - subtle */
.menu-group-toggle:hover {
  background-color: rgba(255, 255, 255, 0.08) !important;
  transition: background-color 0.2s ease;
}

.menu-group-toggle.has-active:hover {
  background-color: rgba(255, 255, 255, 0.15) !important;
}

/* Improved text contrast for menu group headers */
#sidebar.bg-primary .menu-group-toggle .sidebar-text {
  color: #ffffff !important;
  font-weight: 500 !important; /* Giảm từ 600 xuống 500 */
  letter-spacing: 0.02em;
  line-height: 1.5;
}

/* Improved text contrast for sub-menu items */
#sidebar.bg-primary .menu-group-items .nav-item:not(.active) {
  color: #ffffff !important;
}

#sidebar.bg-primary .menu-group-items .nav-item:hover:not(.active) {
  color: #ffffff !important;
  background-color: rgba(255, 255, 255, 0.15) !important;
  transition: background-color 0.2s ease;
}

#sidebar.bg-primary .menu-group-items .nav-item.active {
  color: #0F172A !important; /* Slate 900 - tối hơn để tăng contrast */
  background-color: #E8F1FF !important;
  border-left: 3px solid #2563EB !important;
}

#sidebar.bg-primary .menu-group-items .nav-item.active:hover {
  background-color: #D4E4FF !important;
  box-shadow: inset 0 0 0 1px rgba(37, 99, 235, 0.1);
}

.menu-group-items {
  list-style: none;
  padding: 0;
  margin: 0;
  overflow: hidden;
}

/* Bootstrap collapse integration */
.menu-group-items.collapse:not(.show) {
  display: none;
}

.menu-group-items.collapse.show {
  display: block;
  max-height: 1000px;
  opacity: 1;
  transition: max-height 0.3s ease, opacity 0.3s ease;
}

/* Add border between menu items within a group */
.menu-group-items li:not(:last-child) .nav-item {
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

/* Add border after last item in menu group */
.menu-group-items li:last-child .nav-item {
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
  margin-bottom: 0.25rem;
}

.menu-group-items li {
  margin: 0;
}

/* When collapsed, show menu group items as icon-only */
#sidebar.collapsed .menu-group-items {
  display: block !important;
  max-height: none !important;
  opacity: 1 !important;
  visibility: visible !important;
}

#sidebar.collapsed .menu-group-items li {
  display: block !important;
}

#sidebar.collapsed .menu-group-items .nav-item {
  display: flex !important;
  visibility: visible !important;
  justify-content: center;
  align-items: center;
  padding-left: 0.75rem;
  padding-right: 0.75rem;
}

#sidebar.collapsed .menu-group-toggle {
  display: none !important;
}

#sidebar.collapsed .menu-group-icon {
  display: none;
}

/* Ensure standalone nav items (like Dashboard) are visible when collapsed */
#sidebar.collapsed > nav > ul > li:not(.menu-group-header) > .nav-item {
  display: flex !important;
  visibility: visible !important;
}

/* Ensure icons are visible when sidebar is collapsed */
#sidebar.collapsed .nav-item .fas,
#sidebar.collapsed .nav-item .fa,
#sidebar.collapsed .nav-item i,
#sidebar.collapsed .nav-item .bi {
  display: inline-block !important;
  margin: 0 !important;
  margin-right: 0 !important;
  width: auto !important;
  font-size: 1.25rem;
  visibility: visible !important;
  opacity: 1 !important;
}

/* Ensure menu group items icons are visible when sidebar is collapsed */
#sidebar.collapsed .menu-group-items .nav-item i,
#sidebar.collapsed .menu-group-items .nav-item .bi,
#sidebar.collapsed .menu-group-items .sidebar-icon {
  display: inline-block !important;
  visibility: visible !important;
  opacity: 1 !important;
  margin: 0 !important;
  font-size: 1.25rem !important;
}

/* Sidebar scrollbar */
#sidebar nav::-webkit-scrollbar {
  width: 6px;
}

#sidebar nav::-webkit-scrollbar-track {
  background: #1f2937;
}

#sidebar nav::-webkit-scrollbar-thumb {
  background: #4b5563;
  border-radius: 3px;
}

#sidebar nav::-webkit-scrollbar-thumb:hover {
  background: #9ca3af;
}

/* Light theme sidebar scrollbar */
#sidebar.bg-light nav::-webkit-scrollbar-track {
  background: #f3f4f6;
}

#sidebar.bg-light nav::-webkit-scrollbar-thumb {
  background: #d1d5db;
}

#sidebar.bg-light nav::-webkit-scrollbar-thumb:hover {
  background: #9ca3af;
}

/* Green theme sidebar scrollbar */
#sidebar.bg-success nav::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.1);
}

#sidebar.bg-success nav::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.3);
}

#sidebar.bg-success nav::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.5);
}

/* Gray theme sidebar scrollbar */
#sidebar.bg-secondary nav::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.1);
}

#sidebar.bg-secondary nav::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.3);
}

#sidebar.bg-secondary nav::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.5);
}

/* Blue theme sidebar scrollbar */
#sidebar.bg-primary nav::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.1);
}

#sidebar.bg-primary nav::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.3);
}

#sidebar.bg-primary nav::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.5);
}

/* Nav item hover */
.nav-item.hover-bg-secondary:hover,
.nav-item.hover-bg-secondary:focus {
  background-color: #374151;
}

.nav-item.hover-bg-light:hover,
.nav-item.hover-bg-light:focus {
  background-color: #e5e7eb;
}

.nav-item.hover-bg-success-subtle:hover,
.nav-item.hover-bg-success-subtle:focus {
  background-color: rgba(255, 255, 255, 0.1);
}

.nav-item.hover-bg-secondary-subtle:hover,
.nav-item.hover-bg-secondary-subtle:focus {
  background-color: rgba(255, 255, 255, 0.1);
}

.nav-item.hover-bg-primary-subtle:hover,
.nav-item.hover-bg-primary-subtle:focus {
  background-color: #3B82F6; /* Blue 500 theo guideline */
}

/* Sidebar nav item hover - theo guideline (chỉ cho non-active items) */
#sidebar .nav-item:hover:not(.active) {
  background-color: rgba(255, 255, 255, 0.15) !important; /* Subtle white overlay */
  color: #ffffff !important;
  transition: background-color 0.2s ease, color 0.2s ease;
}

/* Smooth transition cho tất cả nav items */
#sidebar .nav-item {
  transition: background-color 0.2s ease, color 0.2s ease, border-left 0.2s ease;
}

/* Active nav item - theo guideline */
.nav-item.active {
  background-color: #E8F1FF !important; /* Light blue theo guideline */
  border-left: 3px solid #2563EB !important; /* Blue 600 border theo guideline */
  color: #0F172A !important; /* Slate 900 - tối hơn để tăng contrast với background #E8F1FF */
  font-weight: 600 !important; /* Bold cho active theo guideline */
  transition: all 0.2s ease;
}

.nav-item.active .sidebar-text {
  color: #0F172A !important; /* Slate 900 - tối hơn để tăng contrast, đảm bảo WCAG AA */
  font-weight: 600 !important;
}

.nav-item.active i,
.nav-item.active .sidebar-icon {
  color: #2563EB !important; /* Blue 600 icon theo guideline */
}

/* Active + Hover state - subtle darken để feedback */
.nav-item.active:hover {
  background-color: #D4E4FF !important; /* Slightly darker than active */
  box-shadow: inset 0 0 0 1px rgba(37, 99, 235, 0.1);
}

/* Active state cho các theme khác - giữ nguyên cho compatibility */
#sidebar.bg-success .nav-item.active,
#sidebar.bg-secondary .nav-item.active,
#sidebar.bg-primary .nav-item.active {
  background-color: #E8F1FF !important;
  border-left: 3px solid #2563EB !important;
  color: #0F172A !important; /* Slate 900 - tối hơn để tăng contrast */
  font-weight: 600 !important;
  transition: all 0.2s ease;
}

#sidebar.bg-success .nav-item.active:hover,
#sidebar.bg-secondary .nav-item.active:hover,
#sidebar.bg-primary .nav-item.active:hover {
  background-color: #D4E4FF !important;
  box-shadow: inset 0 0 0 1px rgba(37, 99, 235, 0.1);
}

#sidebar.bg-success .nav-item.active i,
#sidebar.bg-secondary .nav-item.active i,
#sidebar.bg-primary .nav-item.active i {
  color: #2563EB !important;
}

/* Hover cho non-active items trong các theme */
#sidebar.bg-success .nav-item:hover:not(.active),
#sidebar.bg-secondary .nav-item:hover:not(.active),
#sidebar.bg-primary .nav-item:hover:not(.active) {
  background-color: rgba(255, 255, 255, 0.15) !important;
  transition: background-color 0.2s ease;
}

/* Main content */
.main-content {
  transition: margin-left 0.3s ease;
  padding: 0;
  margin-top: 0;
}

#sidebar.collapsed {
  width: 4rem !important; /* 64px khi collapsed */
}

#sidebar.collapsed ~ .main-content {
  margin-left: 4rem !important;
}

/* Table styles */
.data-table {
  border-collapse: separate;
  border-spacing: 0;
}

.data-table thead th {
  border-right: 1px solid #dee2e6;
  border-left: 1px solid #dee2e6;
  background-color: #f8f9fa;
}

.data-table tbody td {
  border-right: 1px solid #e9ecef;
  border-left: 1px solid #e9ecef;
}

.data-table tbody tr:hover td {
  background-color: #f8f9fa;
}

/* Status badges */
.status-tag {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  font-weight: 500;
}

/* Statistics cards */
.stat-card {
  border-radius: 0.5rem;
  padding: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
}

.stat-card-primary {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  color: white;
}

.stat-card-success {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white;
}

.stat-card-danger {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: white;
}

.stat-card-warning {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: white;
}

.stat-card-secondary {
  background: linear-gradient(135deg, #64748b 0%, #475569 100%);
  color: white;
}

.stat-card-info {
  background: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%);
  color: white;
}

.stat-card-icon {
  font-size: 2rem;
  opacity: 0.8;
}

.stat-card-value {
  font-size: 2rem;
  font-weight: 600; /* Semi-bold instead of bold */
  margin: 0;
}

.stat-card-label {
  font-size: 0.875rem;
  opacity: 0.9;
  margin: 0;
}

/* Responsive */
@media (max-width: 767.98px) {
  #sidebar {
    transform: translateX(-100%);
    transition: transform 0.3s ease;
  }
  
  #sidebar.mobile-open {
    transform: translateX(0);
    width: 16rem !important;
    z-index: 1050;
  }
  
  .main-content {
    margin-left: 0 !important;
    position: relative;
  }
  
  /* Overlay when sidebar is open on mobile */
  body.sidebar-open::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1049;
  }
  
  #mobile-sidebar-toggle {
    display: block !important;
  }
}

/* Form styles */
.form-actions {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
  margin-top: 1rem;
}

/* Detail divider */
.detail-divider {
  border: 0;
  border-top: 1px solid #e5e7eb;
  margin: 1rem 0;
}

/* Table minimum height - ensure at least 5 rows height for dropdown visibility */
/* Each table row is approximately 50px, so 5 rows = 250px */
/* Add padding-bottom to ensure dropdown menus are not cut off by pagination */
.card-body .table-responsive {
  padding-bottom: 250px;
  margin-bottom: -250px;
}

.section-divider {
  border: 0;
  border-top: 2px solid #d1d5db;
  margin: 2rem 0;
}

/* Improved badge contrast - reduced font weight */
.badge.bg-info {
  background-color: #0dcaf0 !important;
  color: #fff !important;
  font-weight: 500; /* Giảm từ 600 xuống 500 */
}

.badge.bg-warning {
  background-color: #ffc107 !important;
  color: #000 !important;
  font-weight: 500; /* Giảm từ 600 xuống 500 */
}

.badge.bg-secondary {
  background-color: #6c757d !important;
  color: #fff !important;
  font-weight: 500; /* Giảm từ 600 xuống 500 */
}

.badge.bg-success {
  background-color: #198754 !important;
  color: #fff !important;
  font-weight: 500; /* Giảm từ 600 xuống 500 */
}

.badge.bg-danger {
  background-color: #dc3545 !important;
  color: #fff !important;
  font-weight: 500; /* Giảm từ 600 xuống 500 */
}

.badge.bg-primary {
  background-color: #0d6efd !important;
  color: #fff !important;
  font-weight: 500; /* Giảm từ 600 xuống 500 */
}

.badge.bg-dark {
  background-color: #212529 !important;
  color: #fff !important;
  font-weight: 500; /* Giảm từ 600 xuống 500 */
}

/* Enhanced badge styling for detail pages */
.detail-badge,
.card-body .badge,
dl .badge {
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  font-weight: 500; /* Giảm từ 600 xuống 500 */
  border-radius: 0.375rem;
  letter-spacing: 0.025em;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

/* SPA Navigation Styles */
.spa-loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9998;
  backdrop-filter: blur(2px);
}

.spa-loading-content {
  text-align: center;
}

.spa-loading-content .spinner-border {
  width: 3rem;
  height: 3rem;
}

/* Override các rules cũ - đảm bảo active state đúng */
#sidebar .nav-item.active {
  background-color: #E8F1FF !important;
  border-left: 3px solid #2563EB !important;
  color: #0F172A !important; /* Slate 900 - tối hơn để tăng contrast với background #E8F1FF */
  font-weight: 600 !important;
}

#sidebar .nav-item.active .sidebar-text {
  color: #0F172A !important; /* Slate 900 - tối hơn để tăng contrast */
  font-weight: 600 !important;
}

#sidebar .nav-item:hover:not(.active) {
  background-color: rgba(255, 255, 255, 0.15) !important; /* Subtle white overlay */
  color: #ffffff !important;
  transition: background-color 0.2s ease, color 0.2s ease;
}

/* Ensure text is always white and readable (except active) */
#sidebar.bg-primary .nav-item:not(.active),
#sidebar.bg-primary .nav-item:not(.active) .sidebar-text {
  color: #ffffff !important;
}

#sidebar.bg-primary .menu-group-items .nav-item:not(.active) {
  color: #ffffff !important;
}

#sidebar.bg-primary .menu-group-items .nav-item:not(.active) .sidebar-text {
  color: #ffffff !important;
}

/* Active items có màu riêng */
#sidebar.bg-primary .nav-item.active,
#sidebar.bg-primary .nav-item.active .sidebar-text {
  color: #0F172A !important; /* Slate 900 - tối hơn để tăng contrast */
}

#sidebar.bg-primary .menu-group-items .nav-item.active {
  color: #0F172A !important; /* Slate 900 - tối hơn để tăng contrast */
}

#sidebar.bg-primary .menu-group-items .nav-item.active .sidebar-text {
  color: #0F172A !important; /* Slate 900 - tối hơn để tăng contrast */
}

/* Custom button size - Medium */
.btn-mm {
  padding: 0.375rem 0.75rem;
  font-size: 0.875rem;
  line-height: 1.5;
  border-radius: 0.25rem;
}

/* UI/UX Rules v1.1 - Utility Classes */

/* Sidebar utility classes */
.app-sidebar {
  width: 15rem; /* 240px theo guideline */
  background-color: #2563EB !important; /* Blue 600 theo guideline */
  font-size: 14px; /* Theo guideline */
}

.sidebar-icon {
  width: 18px;
  font-size: 18px;
  flex-shrink: 0;
}

/* Menu group icon size - ensure it's visible */
.menu-group-icon {
  font-size: 0.875rem !important;
  display: inline-block !important;
  visibility: visible !important;
  opacity: 1 !important;
  color: rgba(255, 255, 255, 0.9) !important;
  width: auto !important;
  height: auto !important;
  line-height: 1 !important;
}

/* Container utility classes */
.container-fluid.p-0.m-0 {
  padding: 0 !important;
  margin: 0 !important;
}

/* Icon-only action button */
.btn-icon {
  width: 32px;
  height: 32px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.5rem;
}

/* Global icon alignment for Bootstrap Icons */
.bi {
  vertical-align: -0.125em;
  line-height: 1;
  display: inline-block;
}

/* Force menu group icons to be visible - High specificity */
#sidebar .menu-group-toggle .bi.menu-group-icon,
#sidebar .menu-group-toggle i.menu-group-icon,
.menu-group-toggle .menu-group-icon.bi,
.menu-group-toggle .menu-group-icon {
  display: inline-block !important;
  visibility: visible !important;
  opacity: 1 !important;
  color: rgba(255, 255, 255, 0.9) !important;
  font-size: 0.875rem !important;
  width: auto !important;
  height: auto !important;
  line-height: 1 !important;
  margin: 0 !important;
  padding: 0 !important;
}