/* ==========================================================================
   Mobile Responsive Adjustments for Module Action Buttons
   ========================================================================== */
@media (max-width: 767px) {
    /* Container tab & header adjustments */
    .nav-tabs.title {
        display: flex !important;
        flex-wrap: wrap !important;
        align-items: center !important;
        position: relative !important;
    }

    /* Tab title containing action buttons */
    .tab-title,
    .nav-tabs.title .tab-title,
    .page-title {
        width: 100% !important;
        border: none !important;
        padding: 6px 12px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: flex-end !important;
    }

    /* Action buttons group styling */
    .title-button-group,
    .tab-title .title-button-group,
    .page-title .title-button-group {
        display: inline-flex !important;
        flex-wrap: wrap !important;
        align-items: center !important;
        justify-content: flex-end !important;
        gap: 6px !important;
        width: 100% !important;
        margin: 4px 0 !important;
        float: none !important;
    }

    /* Compact & touch-friendly button style */
    .title-button-group .btn {
        margin: 2px 0 !important;
        padding: 6px 12px !important;
        font-size: 13px !important;
        font-weight: 500 !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        white-space: nowrap !important;
        border-radius: 6px !important;
        line-height: 1.4 !important;
        min-height: 34px !important;
        box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05) !important;
    }

    .title-button-group .btn svg,
    .title-button-group .btn i {
        margin-right: 5px !important;
        width: 15px !important;
        height: 15px !important;
        vertical-align: middle !important;
    }

    /* Highlight primary Add button */
    .title-button-group a[data-act="ajax-modal"]:last-child {
        background-color: #2196f3 !important;
        color: #ffffff !important;
        border-color: #2196f3 !important;
    }

    .title-button-group a[data-act="ajax-modal"]:last-child svg {
        stroke: #ffffff !important;
    }

    .title-button-group a[data-act="ajax-modal"]:last-child:hover,
    .title-button-group a[data-act="ajax-modal"]:last-child:focus {
        background-color: #1976d2 !important;
        color: #ffffff !important;
        border-color: #1976d2 !important;
    }
}

/* Extra small devices (< 480px) */
@media (max-width: 480px) {
    .title-button-group .btn {
        padding: 5px 8px !important;
        font-size: 12px !important;
    }

    .title-button-group .btn svg,
    .title-button-group .btn i {
        margin-right: 3px !important;
        width: 13px !important;
        height: 13px !important;
    }
}

/* Thu gọn thanh Bottom Menu trên Mobile */
@media (max-width: 767px) {
    /* Ép chiều cao tổng thể và giảm padding trên/dưới */
    .mobile-bottom-menu {
        padding-top: 5px !important;
        padding-bottom: env(safe-area-inset-bottom, 5px) !important; /* Tránh đè vạch home trên iPhone */
        max-height: 35px !important; 
        height: auto !important;
    }

    /* Thu gọn khoảng đệm của các nút bấm bên trong */
    .mobile-bottom-menu .menu-item {
        padding-top: 8px !important;
        padding-bottom: 8px !important;
        height: auto !important;
    }

    /* (Tùy chọn) Thu nhỏ icon một chút nếu cần */
    .mobile-bottom-menu .menu-item svg {
        width: 20px !important;
        height: 20px !important;
    }
}