.project-hub {
  display: grid;
  overflow: visible;
  align-items: start; /* 🔥 QUAN TRỌNG */
}

.project-hub-wrapper,
.project-hub,
.site,
.site-content,
#page,
#content {
  overflow: visible !important;
}

.project-sidebar {
  background: #fafafa;
  border-right: 1px solid #eee;
  padding: 16px;
}

/* ===== DESKTOP: STICKY SIDEBAR ===== */
@media (min-width: 769px) {
  .project-sidebar {
    position: sticky;
    top: calc(var(--project-toolbar-height, 64px) + 16px);

    align-self: start;
    height: fit-content; /* 🔥 CỰC KỲ QUAN TRỌNG */
    max-height: calc(100vh - 96px);
    overflow-y: auto;
  }
}



.sidebar-title {
  font-size: 16px;
  margin-bottom: 12px;
}

.project-structure-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.project-structure-list li {
  margin-bottom: 2px;
}

.project-structure-list a {
  display: flex;
  justify-content: space-between;
  text-decoration: none;
  color: #333;
}

.project-structure-list a:hover {
  color: #0073aa;
}



.project-structure-list .count {
  display: inline-flex;
  align-items: center;
  justify-content: center;

color: #2563eb;  
  background: rgba(0, 115, 170, 0.12);

  font-size: 12px;
  padding: 2px 8px;
  border-radius: 999px;
  min-width: 22px;
}

/* ===== MOBILE: SIDEBAR SLIDE-IN ===== */
@media (max-width: 768px) {
  .project-sidebar {
    position: fixed;
    top: calc(var(--project-toolbar-height, 84px));
    left: 0;

    height: calc(100vh - var(--project-toolbar-height, 84px));
    width: 280px;

    transform: translateX(-100%);
    transition: transform .25s ease;
    z-index: 9999;
  }

  .project-sidebar.is-open {
    transform: translateX(0);
  }
}


.project-sidebar-overlay {
  display: none;
}

@media (max-width: 991px) {
  .project-sidebar-overlay {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
  }

  .project-sidebar-overlay.is-active {
    opacity: 1;
    pointer-events: auto;
  }
}


/* ===== CSS cái thông tin dưới sidebar ===== */
/* ===== ẨN MẶC ĐỊNH ===== */
.sidebar-project-meta,
.sidebar-divider {
  display: none;
}

/* ===== STYLE (KHÔNG SET DISPLAY) ===== */
.sidebar-project-meta {
  margin-top: 12px;
  padding: 12px 12px;

  background: #86C9E8;
  border: 1px solid #eef0f3;
  border-radius: 8px;

  flex-direction: column;
  gap: 8px;
}

/* ===== CHỈ MOBILE MỚI HIỆN ===== */
@media (max-width: 640px) {
  .sidebar-project-meta,
  .sidebar-divider {
    display: flex;
  }
}


/* từng dòng */
.sidebar-project-meta .meta-row {
  display: flex;
  justify-content: space-between;
  align-items: center;

  font-size: 13px;
  line-height: 1.4;
}

/* label */
.sidebar-project-meta .meta-row .label {
  color: #6b7280;
  font-weight: 400;
}

/* số */
.sidebar-project-meta .meta-row strong {
  color: #111827;
  font-weight: 600;
  font-size: 13px;
}

@media (max-width: 768px) {
  .sidebar-project-meta,
  .sidebar-divider {
    display: block;
  }
}


/* ===== SIDEBAR FUNCTION HOVER + ACTIVE ===== */

.project-structure-list li a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 5px 10px;
  border-radius: 6px;
  text-decoration: none;
  color: inherit;
  transition: background .2s ease, color .2s ease;
}

/* Hover */
.project-structure-list li a:hover {
  background: #8BDCAA;
  color: #273955;
}

/* Active */
.project-structure-list li a.active {
  background: #8BDCAA;
  color: #273955;
  font-weight: 600;
}

/* Count đổi màu theo */
.project-structure-list li a:hover .count,
.project-structure-list li a.active .count {
  color: #273955;
}


/* ===== CC Sidebar Header, và nút Add Guides===== */

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.sidebar-title {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
}

.btn-add-guide {
  display: inline-flex;            /* QUAN TRỌNG */
  align-items: center;             /* căn giữa icon + text */
  gap: 4px;                        /* khoảng cách icon và chữ */
  white-space: nowrap;             /* không cho xuống hàng */

  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  color: #111827;
  padding: 4px 8px;
  border-radius: 6px;
  transition: all 0.2s ease;
}

.btn-add-guide:hover {
  background: #f3f4f6;
}
