/* ================================================================= */
/* CUSTOM CSS: Tinh chỉnh giao diện bảng trên Mobile (Duy trì cấu trúc bảng) */
/* ================================================================= */

/* Media Query để chỉ áp dụng cho màn hình có chiều rộng <= 767.98px (điện thoại) */
@media (max-width: 767.98px) {

    /* 1. Giảm kích thước chữ cho toàn bộ bảng */
    .table-responsive .table {
        font-size: 0.8rem; /* Có thể điều chỉnh: ví dụ 0.8rem (12.8px) */
    }

    /* 2. Giảm padding (đệm) cho các ô tiêu đề và ô dữ liệu */
    .table-responsive .table th,
    .table-responsive .table td {
        padding: 0.5rem; /* Giảm padding từ 0.75rem mặc định của Bootstrap */
        white-space: nowrap; /* NGĂN KHÔNG CHO CHỮ XUỐNG DÒNG */
    }

    /* 3. Giảm kích thước các nút trong bảng */
    .table-responsive .table .btn-sm {
        padding: 0.25rem 0.5rem; /* Giảm padding nút */
        font-size: 0.75rem;      /* Giảm kích thước chữ nút */
    }

    /* 4. Điều chỉnh khoảng cách giữa các cột nếu cần (thêm padding) */
    .table-responsive .table td:nth-child(4) {
        /* Ví dụ: Điều chỉnh padding cho cột thứ 4 (cột Thao tác) */
        padding-left: 0.3rem;
        padding-right: 0.3rem;
    }
}

/* tu_code.css */
body {
    color: #333;
    background-color: #f8f9fc; /* hoặc màu sáng hơn nếu muốn nổi */
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* Ensure proper Vietnamese character display */
.table th,
.table td,
.form-control,
.btn,
label {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.btn-primary {
    background-color: #007bff !important;
    border-color: #007bff !important;
    color: #fff;
}

.bg-success {
    background-color: #28a745 !important;
    color: #fff;
}

.table th,
.table td {
    color: #212529;
}

.card-header {
    background-color: #4e73df !important;
    color: white;
}

/* CSS cho form thêm chi phí mới */
#chiPhiTable {
    border: 1px solid #dee2e6;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

#chiPhiTable thead th {
    background-color: #343a40;
    color: white;
    border-color: #454d55;
    font-weight: 600;
    text-align: center;
    vertical-align: middle;
}

#chiPhiTable tbody tr:hover {
    background-color: #f8f9fa;
}

.chi-phi-row td {
    vertical-align: middle;
    border-color: #dee2e6;
}

.chi-phi-row:nth-child(even) {
    background-color: #f8f9fa;
}

.ngay-input,
.danh-muc-select,
.so-tien-input {
    border-radius: 4px;
    border: 1px solid #ced4da;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.ngay-input:focus,
.danh-muc-select:focus,
.so-tien-input:focus {
    border-color: #80bdff;
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.remove-row {
    border-radius: 50%;
    width: 32px;
    height: 32px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.remove-row:hover {
    background-color: #dc3545;
    border-color: #dc3545;
}

#addRowBtn {
    border-radius: 25px;
    padding: 10px 25px;
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

#addRowBtn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

/* Responsive cho mobile */
@media (max-width: 767.98px) {
    #chiPhiTable {
        font-size: 0.8rem;
    }
    
    #chiPhiTable th,
    #chiPhiTable td {
        padding: 0.5rem 0.3rem;
    }
    
    .remove-row {
        width: 28px;
        height: 28px;
    }
    
    #addRowBtn {
        padding: 8px 20px;
        font-size: 0.9rem;
    }
    
    /* Ẩn một số cột trên mobile để dễ nhìn */
    #chiPhiTable th:nth-child(5),
    #chiPhiTable td:nth-child(5) {
        display: none;
    }
}

