/* ===============================
   Kéo–thả row trong bảng
   =============================== */

#scheduleOrders tbody tr.schedule-row {
    cursor: move;
}

#scheduleOrders tbody tr.schedule-row.dragging {
    opacity: 0.6;
    background-color: #fff8e1;
}

/* ===============================
   Responsive Container
   =============================== */

.table-responsive-mobile {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* ===============================
   Desktop chỉnh nhẹ
   =============================== */

@media (min-width: 769px) {

    #scheduleOrders th,
    #scheduleOrders td {
        font-size: 0.875rem;
        padding: 6px 8px;
    }

    #scheduleOrders .progress {
        height: 10px;
    }
}

/* ===============================
   MOBILE — tối ưu mạnh cho iPhone
   <= 768px
   =============================== */

@media (max-width: 768px) {

    /* Font & padding nhỏ lại */
    #scheduleOrders th,
    #scheduleOrders td {
        font-size: 12px !important;
        padding: 4px 6px !important;
        white-space: nowrap;
    }

    /* Tiêu đề group ngày */
    #scheduleOrders tr.table-secondary td {
        font-size: 12px !important;
        font-weight: 600;
    }

    /* Progress bar thấp hơn */
    #scheduleOrders .progress {
        height: 8px;
    }

    /* Badge NCC, Sóng: nhỏ hơn */
    #scheduleOrders .badge {
        font-size: 10px;
        padding: 2px 5px;
    }

    /* Nút ↑ ↓ nhỏ lại */
    .btn-group-sm .btn {
        padding: 2px 6px;
        font-size: 11px;
    }

    /* Ghi chú rộng + dễ bấm */
    td.note-col textarea {
        min-height: 48px;
        font-size: 12px;
    }

    /* Filter form chia 2 cột để đỡ dài */
    form.row.g-2.mb-3.small .col-md-2,
    form.row.g-2.mb-3.small .col-md-3 {
        flex: 0 0 50%;
        max-width: 50%;
    }

    /* Nút Lọc / Reset 100% chiều ngang */
    form.row.g-2.mb-3.small .col-md-3.d-flex {
        flex: 0 0 100%;
        max-width: 100%;
        margin-top: 6px;
        justify-content: flex-start;
    }

    /* ===============================
       ẨN CÁC CỘT ÍT QUAN TRỌNG TRÊN MOBILE
       =============================== */

    /* Ẩn cột Pallet (cột số thứ 9 tùy bảng) */
    #scheduleOrders th:nth-child(9),
    #scheduleOrders td:nth-child(9) {
        display: none;
    }

    /* Ẩn cột “Mã phần mềm” nếu cần gọn */
    #scheduleOrders th:nth-child(8),
    #scheduleOrders td:nth-child(8) {
        display: none;
    }
}

/* ===============================
   Class Hidden dùng JS toggle
   =============================== */

.hidden {
    display: none !important;
}

/* Highlight group header if it is today */
.today-group {
    background: #ffe9a8 !important;
    border-left: 5px solid #ff9800 !important;
}

.today-group td {
    font-weight: 700 !important;
    color: #000 !important;
}