/* Tùy chỉnh thanh cuộn */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* (*** CẬP NHẬT: XÓA 'body' và '#sidebar' ***) */


/* (*** CẬP NHẬT: XÓA HOÀN TOÀN KHỐI CSS '.shelf-grid' ***) */
/* Các thuộc tính grid-template-columns/rows sẽ được đặt bằng JS */
.shelf-grid {
    display: grid; 
    /* ĐÃ XÓA grid-template-columns */
    /* ĐÃ XÓA grid-template-rows */
    gap: 2px;
    max-width: 100%;
    overflow: auto;
    background-color: #f0f0f0;
    border: 1px solid #ccc;
    padding: 5px;
    border-radius: 8px;
}


.grid-cell {
    width: 100%;
    padding-bottom: 100%;
    /* Tạo ô vuông */
    position: relative;
    background-color: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.grid-cell-inner {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 500;
    color: #ffffff;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding: 2px;
}

.grid-cell.occupied {
    background-color: #4a90e2;
    color: white;
}

.grid-cell.expired {
    background-color: #d9534f;
    color: white;
}

.grid-cell.nearing-expiry {
    background-color: #f0ad4e;
    color: white;
}

.grid-cell:hover {
    transform: scale(1.05); /* Tinh chỉnh hiệu ứng hover */
    z-index: 10;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
}

.grid-cell.occupied:hover .grid-cell-inner {
    font-size: 0.8rem;
    font-weight: bold;
}

.grid-cell:not(.occupied):hover {
    background-color: #aeb2b3;
}

/* --- Cải tiến Modal --- */
.modal {
    display: flex; /* Luôn là flex để căn giữa */
    opacity: 0; /* Mặc định ẩn */
    pointer-events: none; /* Không cho phép click khi ẩn */
    transform: scale(0.95); /* Thu nhỏ một chút */
    transition: opacity 0.2s ease-out, transform 0.2s ease-out;
}

.modal.active {
    opacity: 1; /* Hiển thị */
    pointer-events: auto; /* Cho phép click */
    transform: scale(1); /* Kích thước thật */
}

/* Thêm hiệu ứng cho phần nội dung trắng bên trong modal */
.modal > div {
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    transform: translateY(20px);
}

.modal.active > div {
    transform: translateY(0);
}


/* --- Cải tiến Bảng (Table) --- */
/* Áp dụng cho cả 2 bảng (search & users) */
tbody tr {
    /* Sử dụng border-b thay vì divide-y */
    @apply border-b border-gray-200;
}
tbody tr:hover {
    /* Hiệu ứng hover đẹp mắt */
    @apply bg-blue-50 transition-colors duration-100;
}
tbody tr:last-child {
    /* Bỏ border cho hàng cuối cùng */
    @apply border-b-0;
}

/* --- Cải tiến Sắp Xếp Bảng --- */
th .sort-link {
    @apply flex items-center space-x-1 text-gray-600 hover:text-gray-900 transition-colors duration-150;
}
th .sort-link i {
    @apply text-gray-400; /* Màu icon mặc định */
}
th .sort-link.active i {
    @apply text-blue-600; /* Màu icon khi active */
}


/* --- Cải tiến Nav/Sidebar --- */
/* (Đã XÓA .nav-link.active) */