/* ==========================================================================
   Sidebar Navigation Redesign
   Visual Reference: IMAGE 2
   Clean, Modern, Minimal, Education Theme
   ========================================================================== */

/* Container bọc ngoài */
.sidebar-left-custom {
  position: relative;
  z-index: 50;
}

.custom-sidebar-nav {
  position: relative;
  border-radius: 16px;
  border: 1px solid #e8ecea;
}

/* Biến sidebar menu wrapper thành một Card trắng hiện đại */
.custom-sidebar-nav .sidebar-menu-wrapper {
  font-family: inherit;
  background: #ffffff;
  border: 1px solid #e8ecea;
  border-top: none;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.04);
  padding: 0 12px 14px 12px;
  box-sizing: border-box;
  border-bottom-left-radius: 14px;
  border-bottom-right-radius: 14px;
}


/* Danh sách menu chính */
.custom-sidebar-nav .sidebar-list {
  width: 100%;
  background: transparent;
  border-radius: 0;
  list-style: none;
  margin: 0;
  padding: 0;
}

/* Từng menu item cấp 1 */
.custom-sidebar-nav .sidebar-list>li.menu-item {
  position: relative;
  list-style: none;
  margin: 0;
  border-bottom: 1px solid #f5f7f6;
}

.custom-sidebar-nav .sidebar-list>li.menu-item:last-child {
  border-bottom: none;
}

/* Link menu cấp 1 */
.custom-sidebar-nav .sidebar-list>li>a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #172033;
  padding: 10px 12px;
  text-decoration: none;
  font-weight: 500;
  font-size: 13.5px;
  line-height: 1.4;
  background: transparent;
  border-radius: 10px;
  position: relative;
  transition: background-color .2s ease, color .2s ease, padding-left .2s ease;
}

/* Chevron arrow hiện đại cho mục có menu con (›) */
.custom-sidebar-nav .menu-item-has-children>a::after {
  content: '›';
  font-size: 18px;
  line-height: 1;
  font-weight: 600;
  color: #9ca3af;
  margin-left: auto;
  padding-left: 8px;
  transition: color .2s ease, transform .2s ease;
  float: none;
  opacity: 1;
  transform: none;
}

/* Hover trạng thái menu item cấp 1 */
.custom-sidebar-nav .sidebar-list>li>a:hover {
  background: #f1faf4;
  color: #08783a;
  padding-left: 15px;
}

.custom-sidebar-nav .sidebar-list>li>a:hover::after,
.custom-sidebar-nav .sidebar-list>li.menu-item:hover>a::after {
  color: #08783a;
  transform: translateX(3px);
}

/* Active / Current menu item cấp 1 */
.custom-sidebar-nav .sidebar-list>li.current-menu-item>a,
.custom-sidebar-nav .sidebar-list>li.current_page_item>a,
.custom-sidebar-nav .sidebar-list>li.current-menu-ancestor>a {
  background: #f1faf4;
  color: #08783a;
  font-weight: 700;
  border-left: 3.5px solid #159447;
  border-radius: 4px 10px 10px 4px;
}

.custom-sidebar-nav .sidebar-list>li.current-menu-item>a::after,
.custom-sidebar-nav .sidebar-list>li.current_page_item>a::after,
.custom-sidebar-nav .sidebar-list>li.current-menu-ancestor>a::after {
  color: #08783a;
}

/* ==========================================================================
   Submenu Level 1 (Floating Dropdown Panel)
   ========================================================================== */
.custom-sidebar-nav .sidebar-list .sub-menu {
  display: none;
  position: absolute;
  left: calc(100% + 6px);
  top: -4px;
  min-width: 220px;
  background: #ffffff;
  border: 1px solid #e8ecea;
  border-radius: 14px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
  padding: 8px;
  z-index: 1000;
  list-style: none;
  margin: 0;
  box-sizing: border-box;
}

/* Vùng đệm trong suốt để tránh mất hover khi di chuột qua khoảng hở */
.custom-sidebar-nav .sidebar-list .sub-menu::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: -10px;
  width: 10px;
}

/* Hiển thị submenu khi hover */
.custom-sidebar-nav .sidebar-list li.menu-item:hover>ul.sub-menu {
  display: block;
}

.custom-sidebar-nav .sub-menu li.menu-item {
  margin: 2px 0;
  list-style: none;
  position: relative;
}

/* Link submenu */
.custom-sidebar-nav .sub-menu li.menu-item>a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 14px;
  color: #1e293b;
  font-size: 13.5px;
  font-weight: 500;
  background: #ffffff;
  border-radius: 8px;
  text-decoration: none;
  transition: background-color .18s ease, color .18s ease, transform .18s ease;
}

.custom-sidebar-nav .sub-menu li.menu-item>a:hover {
  background: #f1faf4;
  color: #08783a;
  font-weight: 600;
  transform: translateX(2px);
}

/* Mục có submenu con trong cấp 1 */
.custom-sidebar-nav .sub-menu .menu-item-has-children>a::after {
  content: '›';
  font-size: 17px;
  font-weight: 600;
  color: #9ca3af;
  margin-left: auto;
  line-height: 1;
}

.custom-sidebar-nav .sub-menu .menu-item-has-children:hover>a {
  background: #f1faf4;
  color: #08783a;
  font-weight: 600;
}

.custom-sidebar-nav .sub-menu .menu-item-has-children:hover>a::after {
  color: #08783a;
  transform: translateX(2px);
}

/* ==========================================================================
   Submenu Level 2 (Nested Floating Panel - Xuất hiện bên phải Submenu 1)
   ========================================================================== */
.custom-sidebar-nav .sub-menu .sub-menu {
  left: calc(100% + 6px);
  top: -4px;
  min-width: 215px;
  background: #ffffff;
  border: 1px solid #e8ecea;
  border-radius: 14px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
  padding: 8px;
  border-left: none;
}

/* Focus style an toàn */
.custom-sidebar-nav a:focus {
  outline: none;
  box-shadow: 0 0 0 2px rgba(21, 148, 71, 0.2);
}

/* ==========================================================================
   Theme Layout Integration (Giữ nguyên cấu trúc theme hiện tại)
   ========================================================================== */
#primary:has(.custom-sidebar-nav) {
  display: flex;
}

#primary:has(.custom-sidebar-nav) #content {
  width: 75%;
  margin-left: auto;
  padding-left: 10px;
}