  /* Giữ cùng 1 hàng trên màn laptop */
  .header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: nowrap;
    /* không cho xuống dòng */
  }

  .header-left {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1 1 auto;
    /* chiếm phần còn lại bên trái */
    min-width: 0;
    /* CHỐT: cho phép co để không đẩy nút sang dòng 2 */
    white-space: nowrap;
  }

  .header-search {
    width: clamp(220px, 28vw, 460px);
    /* responsive cho laptop */
  }

  .header-row .input-group-text {
    border-right: 0;
  }

  .header-row .form-control {
    min-width: 0;
  }

  /* tránh đẩy vỡ layout */
  .header-create-btn {
    flex: 0 0 auto;
  }

  /* không cho co và không rớt dòng */

  /* Panel chung */
  .floating-panel {
    position: absolute;
    z-index: 1055;
    width: 260px;
    background: #fff;
    border: 1px solid rgba(0, 0, 0, .08);
    box-shadow: 0 8px 24px rgba(0, 0, 0, .12);
    border-radius: 10px;
    padding: 10px;
  }

  .floating-panel.small {
    width: 180px;
  }

  .floating-panel .title {
    font-weight: 600;
    font-size: .9rem;
    margin-bottom: .25rem;
  }

  .floating-panel .subtle {
    color: #6c757d;
    font-size: .85rem;
  }

  .floating-panel .sep {
    height: 1px;
    background: #f1f3f5;
    margin: .5rem 0;
  }

  .floating-panel .form-check {
    margin: .2rem 0;
  }

  /* Panel actions (ba chấm) */
  .action-menu .list-group-item {
    border: 0;
    padding: .55rem .75rem;
    cursor: pointer;
  }

  .action-menu .list-group-item:hover {
    background: #f8f9fa;
  }

  .action-menu .list-group-item i {
    width: 18px;
  }

  .action-menu .list-group-item.text-danger i {
    color: #dc3545;
  }

  /* Ảnh trong modal chi tiết: co giãn hợp lý theo viewport */
  .detail-img {
    width: 100%;
    max-height: 60vh;
    /* giới hạn chiều cao để không tràn */
    object-fit: contain;
    /* hiển thị đầy đủ ảnh, không crop */
  }

  .floating-panel {
    position: absolute;
    z-index: 1055;
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: .75rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .08);
    padding: 12px;
    min-width: 280px;
  }

  .floating-panel .title {
    font-weight: 600;
    margin-bottom: 6px;
  }

  .floating-panel .sep {
    height: 1px;
    background: #eee;
    margin: 10px 0;
  }

  .action-menu .list-group-item {
    cursor: pointer;
  }

  /* Thu nhỏ modal chi tiết xuống ~720px, vẫn responsive */
  #viewDetailModal .modal-dialog {
    --bs-modal-width: 720px;
  }

  /* Giảm tỉ lệ cover để modal thấp hơn, đỡ “choán” */
  #viewDetailModal .ratio.ratio-21x9 {
    padding-top: 0;
  }

  #viewDetailModal .ratio.ratio-21x9 {
    aspect-ratio: 16 / 9;
  }

  /* dùng aspect-ratio thay padding hack */
  #viewDetailModal .ratio img {
    display: block;
    width: 100%;
    height: auto;
    object-fit: cover;
  }

  /* Trên màn nhỏ, để Bootstrap tự co lại */
  @media (max-width: 576px) {
    #viewDetailModal .modal-dialog {
      --bs-modal-width: 100%;
      margin: .5rem;
    }
  }

  /* Nếu hẹp hơn laptop (tablets), lúc này CHỦ ĐỘNG cho xuống 2 hàng đẹp */
  @media (max-width: 992px) {
    .header-row {
      flex-wrap: wrap;
    }

    .header-left {
      width: 100%;
      order: 1;
    }

    .header-create-btn {
      order: 2;
    }
  }

  /* Share Modal Styles */
  #shareCommunityModal .modal-content {
    border-radius: 16px;
    border: none;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  }

  #shareCommunityModal .modal-header {
    border-bottom: 1px solid #f0f0f0;
    padding: 1.5rem;
  }

  #shareCommunityModal .modal-title {
    font-weight: 700;
  }

  #shareCommunityModal .modal-body {
    padding: 2rem;
  }

  #shareCommunityModal .input-group {
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    border-radius: 8px;
    overflow: hidden;
  }

  #shareCommunityModal .form-control {
    border: 1px solid #e0e0e0;
    padding: 0.75rem 1rem;
    font-size: 1rem;
  }

  #shareCommunityModal .form-control:focus {
    box-shadow: none;
    border-color: #8D4DF3;
  }

  #shareCommunityModal #copyShareLink {
    border-color: #e0e0e0;
    background: #f8f9fa;
    color: #333;
    font-weight: 600;
    transition: all 0.2s;
  }

  #shareCommunityModal #copyShareLink:hover {
    background: #e9ecef;
    border-color: #d0d0d0;
  }

  #shareCommunityModal #openShareLink {
    background: linear-gradient(119.16deg, #8D4DF3 0%, #0120D4 100%);
    border: none;
    padding: 0.8rem;
    font-weight: 600;
    border-radius: 8px;
    transition: opacity 0.2s;
  }

  #shareCommunityModal #openShareLink:hover {
    opacity: 0.9;
  }

  /* Pending Members Styles */
  .bg-warning-soft {
    background-color: rgba(255, 193, 7, 0.2);
  }

  .btn-view-pending:hover {
    background-color: rgba(255, 193, 7, 0.3);
  }

  .cursor-pointer {
    cursor: pointer;
  }

  #pendingMembersModal .modal-content {
    border-radius: 12px;
    border: none;
    overflow: hidden;
  }

  #pendingMembersModal .modal-header {
    padding: 1rem 1.5rem;
    background: #fff;
  }

  .custom-scrollbar::-webkit-scrollbar {
    width: 6px;
  }

  .custom-scrollbar::-webkit-scrollbar-track {
    background: #f1f1f1;
  }

  .custom-scrollbar::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
  }

  .custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: #aaa;
  }

  .bg-light-danger {
    background: rgba(220, 53, 69, 0.1);
    color: #dc3545;
  }

  .bg-light-danger:hover {
    background: rgba(220, 53, 69, 0.2);
    color: #dc3545;
  }