/* styles/style.css */
body {
    /* Đã cập nhật sang font chuẩn quốc tế hiện đại */
    font-family: "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: #f8f8f8;
    margin: 0;
    padding: 0;
}

/* Biến màu chính */
:root {
    --vnua-green: #1e8449; /* Xanh lá cây đậm cho tiêu đề và tab active */
    --vnua-light-blue: #f0f8ff; /* Nền xanh nhạt của Banner */
    --vnua-header-green: #0a7337; /* Màu xanh lá cây đậm cho top bar */
    --vnua-tab-bg: #2c975a; /* Màu nền tab mặc định */
    --vnua-tab-hover: #16693d; /* Màu nền tab khi hover */
}

/* KÍCH HOẠT VÀ TẠO KIỂU CHO TOP BAR */
.top-bar {
    background-color: var(--vnua-header-green); /* Màu xanh đậm cho top bar */
    color: white;
    padding: 5px 20px;
    text-align: right;
    font-size: 0.9rem;
    display: block; 
	font-weight: bold;
}
.top-bar a {
    color: white;
    text-decoration: none;
    margin-left: 10px;
	
}
/* Ẩn navigation bar cũ (nếu có) */
.main-nav-bar {
    display: none;
}

.container-fluid {
    padding: 20px;
}

/* Định kiểu cho Tiêu đề Banner chính */
.main-header {
    background-color: var(--vnua-light-blue); 
    padding: 20px 0;
    margin-bottom: 20px;
    border-bottom: 2px solid #ddd;
    text-align: center; 
    display: block; 
}
.main-header h1 {
    color: var(--vnua-green); 
    font-size: 1.8rem; 
    font-weight: 500;
    margin: 0;
    line-height: 1.2;
}
.main-header h2 {
    color: var(--vnua-green); 
    font-size: 2rem; 
    font-weight: bold;
    margin: 0;
    line-height: 1.2;
}


/* Tiêu đề từng danh sách (Tab Title) */
.list-title {
    color: var(--vnua-green) !important; 
    font-weight: bold;
    font-size: 1.5rem; 
}

/* PHONG CÁCH TABS NỔI BẬT DẠNG 3D */
.vnua-navbar {
    background-color: transparent; 
    padding: 0;
    margin-bottom: 0; 
    border: none;
    border-radius: 0;
    position: relative;
    z-index: 1;
}
.vnua-navbar .nav-link {
    color: white !important; 
    border: none;
    padding: 10px 15px;
    margin-right: 2px; 
    font-size: 1rem;
    font-weight: 500;
    background-color: var(--vnua-tab-bg); 
    border-radius: 5px 5px 0 0; 
    transition: all 0.2s;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2); 
    position: relative;
    top: 0;
}
.vnua-navbar .nav-link:focus {
    background-color: var(--vnua-tab-hover); 
    box-shadow: 0 6px 8px rgba(0, 0, 0, 0.3); 
    top: -2px; 
}
.vnua-navbar .nav-link.active {
    color: var(--vnua-green) !important; 
    background-color: white !important; 
    border: none;
    border-bottom: 3px solid white; 
    box-shadow: 0 -2px 5px rgba(0, 0, 0, 0.2); 
    z-index: 2; 
    top: 0;
}


.tab-content {
    background-color: #fff;
    border: 1px solid #dee2e6;
    border-top: 1px solid #dee2e6; 
    padding: 20px;
    border-radius: 0 0 .25rem .25rem;
    position: relative;
    z-index: 1;
}

/* ---------------------------------------------------------------- */
/* Định kiểu tiêu đề bảng & Căn lề dọc cho TẤT CẢ các bảng */
/* ---------------------------------------------------------------- */
.table-vnua-active th {
    /* Màu sắc và font cho tiêu đề bảng */
    color: white !important; 
    background-color: var(--vnua-tab-bg) !important; 
    font-weight: bold; 
    border-bottom: 2px solid var(--vnua-tab-bg) !important; 
    /* Căn giữa tiêu đề */
    text-align: center; 
}

/* Đảm bảo các đường viền xung quanh ô tiêu đề là màu xám */
.table-vnua-active th, .table-vnua-active td {
    border-color: #dee2e6 !important;
    vertical-align: middle !important; /* Căn giữa dọc cho tất cả */
}



/* ---------------------------------------------------------------- */
/* LUẬT CĂN LỀ NGANG CHO NỘI DUNG CÁC Ô (tbody) CỦA BẢNG CHUNG */
/* Áp dụng cho Giáo sư, Phó Giáo sư, Nhà giáo ND/UT (.table-vnua-active) */
/* ---------------------------------------------------------------- */

/* Mặc định, tất cả các ô dữ liệu <td> CĂN GIỮA */
.table-vnua-active tbody td {
    text-align: center !important;
    font-weight: normal; /* Đảm bảo chữ thường */
}

/* 1. Cột STT (Là <th> đầu tiên trong tbody) -> CĂN GIỮA */
.table-vnua-active tbody th {
    text-align: center !important;
}

/* GHI ĐÈ LUẬT CĂN GIỮA: Áp dụng CĂN TRÁI cho các cột được chọn */

/* 2. Cột Họ và tên: là <td> thứ 1 (Sau <th> STT) -> CĂN TRÁI */
.table-vnua-active tbody tr td:nth-child(1) { 
    text-align: left !important;
}
.table-vnua-active tbody tr td:nth-child(2) { 
    text-align: left !important;
}

.table-vnua-active tbody tr td:nth-child(5) { 
    text-align: left !important;
}

/* 3. Cột Khoa/Đơn vị: là <td> thứ 4 (Sau <th> STT, td1, td2, td3) -> CĂN TRÁI */
/* Cột thứ 4 là Khoa/Đơn vị theo cấu trúc: Họ tên (1), Giới tính (2), Năm sinh (3), Khoa/Đơn vị (4) */
.table-vnua-active tbody tr td:nth-child(10) { 
    text-align: left !important;
}

/* ---------------------------------------------------------------- */
/* LUẬT CĂN LỀ RIÊNG CHO BẢNG LÃNH ĐẠO ĐƠN VỊ (.table-lanhdaodonvi) */
/* Cấu hình cột hiển thị: STT | Họ và tên | Giới tính | Chức vụ | Khoa/Đơn vị | Điện thoại | Email */
/* ---------------------------------------------------------------- */

/* Thiết lập mặc định: Các cột trong bảng này sẽ căn TRÁI */
.table-lanhdaodonvi tbody td {
    text-align: left !important;
    font-weight: normal; 
}

/* 1. Cột STT (là <th> đầu tiên trong tbody) -> CĂN GIỮA */
.table-lanhdaodonvi tbody th {
    text-align: center !important;
}

/* 2. Cột Giới tính: là <td> thứ 3 -> CĂN GIỮA (Giả định: STT/Họ tên/Giới tính) */
.table-lanhdaodonvi tbody tr td:nth-child(3) { 
    text-align: center !important;
}

/* 3. CỘT ĐIỆN THOẠI: là <td> thứ 6 -> CĂN GIỮA và BÌNH THƯỜNG */
.table-lanhdaodonvi tbody tr td:nth-child(6) { 
    text-align: center !important;
    font-weight: normal !important; 
}

/* Đảm bảo link (a) trong ô Điện thoại không bị in đậm */
.table-lanhdaodonvi tbody tr td:nth-child(6) a {
    font-weight: normal !important;
}

/* 4. Cột Email: là <td> thứ 7 -> CĂN TRÁI */
.table-lanhdaodonvi tbody tr td:nth-child(7) { 
    text-align: left !important; 
}


/* ---------------------------------------------------------------- */
/* KIỂU CHO DÒNG TIÊU ĐỀ NHÓM */
/* ---------------------------------------------------------------- */
.table-lanhdaodonvi .table-group-header {
    background-color: #e9ecef !important; /* Màu xám nhạt */
    font-weight: bold !important; 
    text-align: left !important; /* Căn trái tên nhóm */
    border-top: 2px solid #dee2e6 !important;
    border-bottom: 2px solid #dee2e6 !important;
    padding: 0.5rem 0.75rem !important;
    color: var(--vnua-green);
}

/* Kiểu cho form đăng nhập và chế độ in giữ nguyên */
.wrapper { max-width: 400px; margin: 100px auto; padding: 30px; background: #fff; border-radius: 8px; box-shadow: 0 0 10px rgba(0,0,0,0.1); }

@media print {
    .top-bar, .admin-link, .nav-tabs, .print-options, .pagination, .action-buttons {
        display: none !important;
    }
    table {
        font-size: 9pt;
    }
    .table td, .table th {
        padding: 0.3rem;
    }
    .tab-content {
        border: none;
        padding: 0;
    }
}
/* Thêm class này để căn chỉnh nút Sửa/Xóa trong ô bảng */
.action-cell {
    /* Quan trọng: sử dụng flexbox để căn chỉnh nội dung trong ô */
    display: flex;
    justify-content: center; /* Căn giữa theo chiều ngang */
    align-items: center; /* Căn giữa theo chiều dọc */
    gap: 5px; /* Khoảng cách giữa nút Sửa và Xóa */
}

/* Đảm bảo bảng trong admin không bị tràn và các cột đều nhau */
.table-responsive {
    overflow-x: auto;
}

.action-cell {
    width: 120px;
    min-width: 120px;
    vertical-align: middle !important;
}

.table-group-header {
    padding: 10px !important;
    border-left: 5px solid #1e8449 !important;
}

/* Căn lề cho các nút bấm */
.btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.8rem;
}
/* Tối ưu bảng trong Admin */
.table thead th {
    background-color: #1e8449 !important;
    color: white !important;
    border: none;
    font-size: 0.90rem;
    text-transform: none; /* Đổi thành none hoặc xóa hẳn dòng này */
    font-weight: bold;    /* Đảm bảo chữ vẫn đậm */
}


/* HIỆU ỨNG DÒNG XEN KẼ (STRIPED) */
/* Đảm bảo các dòng có màu xám nhạt xen kẽ để dễ nhìn */
.table-striped tbody tr:nth-of-type(odd) {
    background-color: rgba(0, 0, 0, 0.02);
}

.table-hover tbody tr:hover {
    background-color: rgba(30, 132, 73, 0.05) !important;
}

/* Căn giữa cột Thao tác và STT */
.table td:first-child, .table td:last-child {
    background-color: rgba(0,0,0,0.01);
}

/* --- ĐÃ SỬA: Bỏ nền màu ở cột STT (first-child) --- */
.table td:first-child, .table td:last-child {
    background-color: transparent !important; /* Đổi về trong suốt */
}

/* Làm đẹp nút bấm */
.btn-sm {
    border-radius: 4px;
    font-weight: 500;
}

.form-control:focus {
    border-color: #1e8449;
    box-shadow: 0 0 0 0.25rem rgba(30, 132, 73, 0.25);
}

/* Tối ưu giao diện bảng Admin */
.table-vnua-active th {
    vertical-align: middle !important;
}

.action-cell div {
    display: flex;
    justify-content: center;
    gap: 4px;
}

/* Hiệu ứng khi di chuột qua hàng */
.table-hover tbody tr:hover {
    background-color: rgba(30, 132, 73, 0.05) !important;
}

/* Cố định độ rộng tối thiểu cho cột thao tác */
td:last-child {
    min-width: 140px;
}
/* CSS chuẩn hệ thống VNUA */
.vnua-btn-export {
    height: 40px; /* Độ cao chuẩn */
    padding: 0 20px;
    border-radius: 6px; /* Bo góc chuẩn */
    color: white !important;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    font-family: 'Segoe UI', sans-serif;
    font-size: 14px;
    font-weight: 500;
    transition: opacity 0.2s;
    border: none;
}
.vnua-btn-export:hover {
    opacity: 0.9;
}