
/* --- 1. AVATAR STACK (NHÂN SỰ DỰ ÁN) --- */
.avatar-stack {
    display: flex;
    flex-direction: row-reverse; 
    justify-content: flex-end;
    margin-top: 4px;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    min-height: 30px;
}

.avatar-stack .avatar-item {
    position: relative;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: 2px solid #fff;
    margin-left: -8px; /* Mặc định xếp chồng */
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 700;
    color: #fff;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    background-size: cover;
}

/* Ẩn các avatar vượt quá số lượng khống chế */
.avatar-stack .hidden-avatar {
    display: none;
}

/* Khi nhấn vào để bung ra (Expanded) */
.avatar-stack.expanded {
    flex-direction: row; /* Dàn hàng ngang xuôi */
    justify-content: flex-start;
    flex-wrap: wrap; /* Cho phép xuống hàng nếu quá nhiều */
    gap: 4px;
}

.avatar-stack.expanded .avatar-item {
    margin-left: 0 !important; /* Bỏ xếp chồng */
    transform: scale(1.1);
}

.avatar-stack.expanded .hidden-avatar {
    display: flex !important;
}

.avatar-stack.expanded .avatar-more {
    display: none !important; /* Ẩn nút +X khi đã bung */
}

.avatar-stack .avatar-item:hover {
    transform: translateY(-5px) scale(1.2);
    z-index: 10;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.avatar-stack .avatar-more {
    background: #f1f1f1 !important;
    color: #666 !important;
    border: 2px solid #fff;
    z-index: 5;
}

/* --- 2. PROGRESS BAR SIÊU MẢNH (GIÁ TRỊ) --- */
.progress-mini-container {
    width: 100%;
    height: 4px;
    background-color: #eee;
    border-radius: 2px;
    margin-top: 8px;
    overflow: hidden;
}

.progress-mini-bar {
    height: 100%;
    border-radius: 2px;
    transition: width 0.6s ease;
}

/* --- 3. PILL BADGES (THỜI GIAN & TRẠNG THÁI) --- */
.badge-pill-modern {
    border-radius: 50px !important;
    padding: 4px 12px !important;
    font-size: 11px !important;
    font-weight: 600 !important;
    letter-spacing: 0.3px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.badge-pill-modern.bg-success { background-color: #2ecc71 !important; }
.badge-pill-modern.bg-danger { background-color: #e74c3c !important; }
.badge-pill-modern.bg-warning { background-color: #f39c12 !important; color: #fff !important; }
.badge-pill-modern.bg-info { background-color: #3498db !important; }

/* --- 4. GROUP HEADER (TIÊU ĐỀ ĐƠN VỊ) --- */
tr.group-header td {
    background: linear-gradient(to right, #ebf5ff, #ffffff) !important;
    border-left: 5px solid #3498db !important;
    padding: 12px 20px !important;
    font-size: 14px;
    color: #2c3e50;
    box-shadow: inset 0 1px 0 rgba(0,0,0,0.05);
}

tr.group-header .badge {
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* --- 5. ROW HOVER & INTERACTION --- */
#datatable_project tbody tr:not(.group-header) {
    transition: background-color 0.2s;
}

#datatable_project tbody tr:not(.group-header):hover {
    background-color: #f8fbff !important;
}

/* Tối ưu cột thông tin dự án */
.project-info-container {
    display: flex;
    flex-direction: column;
    gap: 1px; /* Sát nhất có thể */
}

.project-title-link {
    font-size: 14px;
    font-weight: 700;
    color: #2c3e50 !important;
    transition: color 0.2s;
    margin: 0 !important; /* Triệt tiêu margin */
    line-height: 1.2;
}

.project-title-link:hover {
    color: #3498db !important;
}

.project-owner-text {
    font-size: 12px;
    color: #7f8c8d;
    margin: 0 !important; /* Triệt tiêu margin */
    line-height: 1.2;
}

/* Tối ưu các icon thao tác */
/* Tối ưu các icon thao tác - Chống nhảy khung tuyệt đối */
.action-cell-container {
    text-align: center;
    white-space: nowrap;
    width: 120px !important;
    min-width: 120px !important;
    max-width: 120px !important;
    display: flex;
    justify-content: flex-start; /* Căn lề trái để checkbox cố định */
    align-items: center;
    gap: 10px;
    height: 32px;
    padding: 0 5px;
    position: relative;
}

/* Các nút ẩn khi không hover */
.action-cell-container .action-hover {
    opacity: 0;
    visibility: hidden;
    transform: translateX(5px);
    transition: all 0.3s ease;
    display: flex;
    gap: 8px;
}

tr:hover .action-cell-container .action-hover {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
}

.action-cell-container .fa {
    font-size: 14px;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    transition: all 0.2s;
    cursor: pointer;
    background: #fdfdfd;
    border: 1px solid #eef0f2;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.action-cell-container .fa-eye { color: #3498db; }
.action-cell-container .fa-edit { color: #2ecc71; }
.action-cell-container .fa-minus-square { color: #e74c3c; }

.action-cell-container .fa:hover {
    transform: scale(1.15);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    background: #fff;
}

