/* ===== CARD ===== */
.chart-box {
    background: #fff;
    padding: 16px;
    box-shadow: 0 4px 12px rgba(0,0,0,.06);
}

/* ===== DEPARTMENT TABS ===== */
.dept-scroll-wrapper {
    display: flex;
    gap: 10px;
    overflow-x: auto;
}

.dept-tab {
    border: 1px solid #ddd;
    background: #f8f9fa;
    padding: 8px 18px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: all .15s ease;
}
.dept-tab.active {
    background: #0d6efd;
    color: #fff;
    border-color: #0d6efd;
}

/* ===== LEGEND ===== */
.chart-legend-extra {
    display: flex;
    gap: 16px;
    align-items: center;
    justify-content: center;
    font-size: 13px;
}

.legend-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.legend-color {
    width: 10px;
    height: 10px;
    }

.legend-quota {
    color: #d4af37;
    font-weight: bold;
}

/* ===== GOLD BUTTON ===== */
.btn-gold {
    background: #d4af37;
    border-color: #d4af37;
    color: #fff;
}

.btn-gold:hover {
    background: #c9a227;
    border-color: #c9a227;
    color: #000;
}
/* ===== POLISH UI ===== */
.dept-tab:hover {
    background: #e9ecef;
}

.btn {
    transition: all .15s ease;
}
/* ===== MOBILE FIX: CHART ===== */
#chartWrapper {
    width: 100%;
    overflow-x: hidden;
}

#chartWrapper canvas {
    max-width: 100% !important;
}
/* ===== MOBILE FIX: TABLE ===== */
#monthTableContainer {
    width: 100%;
}
@media (max-width: 768px) {
    body {
        overflow-x: hidden;
    }

    .chart-box {
        padding: 12px;
    }
}
/* ===== DAY BLOCK COLOR ===== */

#monthTable tbody tr.day-block-odd {
    --bs-table-bg: #f6e9ff !important;
    --bs-table-accent-bg: #f6e9ff !important;
}

#monthTable tbody tr.day-block-even {
    --bs-table-bg: #ffffff !important;
    --bs-table-accent-bg: #ffffff !important;
}

/* highlight khi click chart */
#monthTable tbody tr.row-highlight {
    --bs-table-bg: #ffe066 !important;
    --bs-table-accent-bg: #ffe066 !important;
    font-weight: bold;
}

/* ==============================
   MOBILE CARD VIEW – MONTH TABLE
   ============================== */
@media (max-width: 768px) {

    #monthTable {
        border: 0;
    }

    #monthTable thead {
        display: none;
    }

    #monthTable tbody,
    #monthTable tr,
    #monthTable td {
        display: block;
        width: 100%;
    }

    #monthTable tr {
        background: #fff;
        margin-bottom: 14px;
        border-radius: 12px;
        box-shadow: 0 4px 10px rgba(0,0,0,.06);
        padding: 12px 14px;
    }

    /* ===== DATE ===== */
    #monthTable tr td:nth-child(1) {
        font-weight: 600;
        color: #6f42c1;
        margin-bottom: 4px;
    }

    /* ===== NAME ===== */
    #monthTable tr td:nth-child(2) {
        font-weight: 600;
        font-size: 15px;
        margin-bottom: 8px;
    }

    /* ===== MERGE MORNING + AFTERNOON ===== */
    #monthTable tr td:nth-child(3),
    #monthTable tr td:nth-child(4) {
        display: inline-block;
        width: auto;
        margin-right: 12px;
        font-weight: 500;
    }

    #monthTable tr td:nth-child(3)::before {
        content: "Ca sáng: ";
        color: #666;
    }

    #monthTable tr td:nth-child(4)::before {
        content: "Ca chiều: ";
        color: #666;
    }

    /* ===== QLSR ===== */
    #monthTable tr td:nth-child(5) {
        margin-top: 6px;
        font-weight: 500;
    }
    #monthTable tr td:nth-child(5)::before {
        content: "QLSR: ";
        color: #666;
    }

    /* ===== CONTENT ===== */
    #monthTable tr td:nth-child(6) {
        margin-top: 8px;
        padding-top: 8px;
        border-top: 1px dashed #ddd;
        white-space: pre-line;
        font-size: 14px;
    }

    /* ===== ACTION ===== */
    #monthTable tr td:nth-child(7) {
        margin-top: 10px;
        text-align: right;
    }

    #monthTable .btn {
        padding: 4px 12px;
        font-size: 13px;
    }

    /* ===== DAY GROUP BACKGROUND ===== */
    #monthTable tr.day-block-odd {
        background: #faf7ff;
    }

    #monthTable tr.day-block-even {
        background: #ffffff;
    }
}
/* ===============================
   DESKTOP STICKY TABLE (>=992px)
   LÀM GIỐNG HỆT MOBILE
================================ */
@media (min-width: 992px) {

    /* Container scroll */
    #monthTableContainer {
        overflow: auto;              /* BẮT BUỘC */
        position: relative;
        max-height: 800px; /* Tăng chiều cao */
    }

    /* Khóa layout table */
    #monthTable {
        table-layout: fixed;
        border-collapse: separate;   /* QUAN TRỌNG */
        border-spacing: 0;
    }

    /* ===== STICKY HEADER ===== */
    #monthTable thead th {
        position: sticky;
        top: 0;
        z-index: 20;

        /* Bootstrap 5 chuẩn */
        --bs-table-bg: #ffffff;
        --bs-table-accent-bg: #ffffff;

        box-shadow: 0 2px 6px rgba(0,0,0,.12);
    }
    /* ===== DÒNG KẺ NGANG GIỮA CÁC Ô TRONG BẢNG ===== */
#monthTable td {
    border-bottom: 1px solid #ddd;  /* Thêm dòng kẻ ngang giữa các hàng */
}

    /* ===== WIDTH CỘT FULLNAME ===== */
    #monthTable th:nth-child(2),
    #monthTable td:nth-child(2) {
        width: 160px;
        min-width: 160px;
        max-width: 160px;
    }

    

    /* Bóng phân tách */
    #monthTable th:nth-child(2),
    #monthTable td:nth-child(2) {
        box-shadow: 2px 0 6px rgba(0,0,0,.12);
    }
}

