:root {
    --bg: #f6f8fb;
    --card: #ffffff;
    --muted: #6b7280;
    --brand: #2563eb;
    --brand-2: #7c3aed;
    --success: #16a34a;
    --danger: #dc2626;
    --warning: #d97706;
    --border: #e5e7eb;
    --ring: rgba(37, 99, 235, .25);
}

/* Defaults: desktop-first */
.mobile-actions {
    display: none;
}

.mobile-cards {
    display: none;
}

.desktop-table {
    display: block;
}

.page.page-shop-orders {
    background: linear-gradient(180deg, #f8fafc 0%, #eef2ff 100%);
    min-height: 100vh;
    padding-bottom: 24px;
}

.pageheader {
    background: linear-gradient(135deg, var(--brand), var(--brand-2));
    border: 0;
    border-radius: 16px;
    padding: 18px 20px;
    color: #fff;
    box-shadow: 0 10px 24px rgba(37, 99, 235, .25);
}

    .pageheader h2 {
        font-weight: 700;
        letter-spacing: .2px;
        margin: 0 0 8px 0;
    }

.page-breadcrumb {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

    .page-breadcrumb a {
        color: #e0e7ff;
    }

    .page-breadcrumb i {
        opacity: .9;
    }

.tile {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 6px 20px rgba(2,6,23,.06);
    position: relative; /* Allow dropdowns to escape */
}

.tile-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    background: linear-gradient(180deg, #fff, #f8fafc);
    border-bottom: 1px solid var(--border);
    overflow: visible !important; /* Fix: Allow dropdowns to show */
    position: relative;
    z-index: 100; /* Fix: Ensure header is above other content */
}

    .tile-header .custom-font {
        font-size: 18px;
        margin: 0;
    }

    .tile-header .controls {
        display: flex;
        align-items: center;
        gap: 8px;
        flex-wrap: wrap;
        margin: 0;
        padding: 0;
        list-style: none;
        overflow: visible !important; /* Fix: Prevent clipping */
        position: relative;
        z-index: 100;
    }

        .tile-header .controls > li > a,
        .tile-header .controls > li > button {
            border-radius: 10px !important;
        }

.p-15.bg-white.b-b {
    border-bottom: 1px solid var(--border);
    background: #fff;
}

.btn-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 14px;
    align-items: center;
}

.btn-group .lbl {
    background: #eef2ff;
    color: #334155;
    border: 0;
}

.checkbox.checkbox-custom-alt i {
    border-radius: 6px;
}

.btn {
    border-radius: 10px;
}

    .btn.btn-default {
        border: 1px solid var(--border);
        background: #fff;
    }

        .btn.btn-default:hover {
            box-shadow: 0 0 0 4px var(--ring);
        }

.btn-gradient {
    background: linear-gradient(135deg, var(--brand), var(--brand-2));
    border: 0;
    color: #fff;
}

    .btn-gradient:hover {
        filter: brightness(.98);
    }

.badge {
    border-radius: 999px;
    padding: 6px 10px;
    font-weight: 600;
    letter-spacing: .2px;
}

.badge-primary {
    background: #dbeafe;
    color: #1e40af;
}

.badge-info {
    background: #cffafe;
    color: #155e75;
}

.badge-success {
    background: #dcfce7;
    color: #166534;
}

.badge-danger {
    background: #fee2e2;
    color: #991b1b;
}

.badge-dark {
    background: #e5e7eb;
    color: #111827;
}

.badge-secondary {
    background: #f1f5f9;
    color: #334155;
}

.table-modern {
    border-collapse: separate;
    border-spacing: 0;
    overflow: hidden;
}

    .table-modern thead th {
        position: sticky;
        top: 0;
        z-index: 1;
        background: linear-gradient(135deg, #2563eb 0%, #1e40af 100%) !important;
        color: #ffffff !important;
        border-bottom: 2px solid #1e40af !important;
        text-transform: uppercase;
        font-size: 12px;
        letter-spacing: .4px;
        font-weight: 600 !important;
        padding: 12px 10px !important;
    }

    .table-modern tbody tr {
        transition: all 0.2s ease;
        background: #ffffff;
        border-bottom: 1px solid #e5e7eb;
    }

        .table-modern tbody tr:hover {
            background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%) !important;
            transform: scale(1.01);
            box-shadow: 0 4px 12px rgba(37, 99, 235, 0.1);
        }

    .table-modern tbody tr:nth-child(even) {
        background: #f8fafc;
    }

    .table-modern tbody tr:nth-child(even):hover {
        background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%) !important;
    }

    .table-modern td, .table-modern th {
        vertical-align: middle !important;
        padding: 16px 12px !important;
        font-size: 14px !important;
        line-height: 1.6 !important;
    }

    /* Table cell specific styling */
    .table-cell-customer {
        font-size: 15px !important;
        font-weight: 500 !important;
    }

    .customer-name-link {
        font-weight: 600 !important;
        color: #1e40af !important;
        font-size: 15px !important;
        text-decoration: none !important;
        transition: color 0.2s ease;
    }

    .customer-name-link:hover {
        color: #2563eb !important;
        text-decoration: underline !important;
    }

    .customer-avatar {
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    }

    .order-number-badge {
        display: inline-block;
        padding: 6px 12px;
        background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
        color: #ffffff;
        border-radius: 8px;
        font-weight: 600;
        font-size: 13px;
        box-shadow: 0 2px 6px rgba(59, 130, 246, 0.3);
    }

    .status-badge {
        display: inline-block;
        padding: 6px 12px;
        background: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%);
        color: #ffffff;
        border-radius: 8px;
        font-weight: 600;
        font-size: 13px;
        box-shadow: 0 2px 6px rgba(6, 182, 212, 0.3);
    }

    .cod-badge {
        display: inline-block;
        padding: 6px 12px;
        background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
        color: #ffffff;
        border-radius: 8px;
        font-weight: 600;
        font-size: 13px;
        box-shadow: 0 2px 6px rgba(239, 68, 68, 0.3);
    }

    .receiver-badge {
        display: inline-block;
        padding: 6px 12px;
        background: linear-gradient(135deg, #10b981 0%, #059669 100%);
        color: #ffffff;
        border-radius: 8px;
        font-weight: 600;
        font-size: 13px;
        box-shadow: 0 2px 6px rgba(16, 185, 129, 0.3);
    }

    .contact-badge {
        display: inline-block;
        padding: 6px 12px;
        background: linear-gradient(135deg, #6b7280 0%, #4b5563 100%);
        color: #ffffff;
        border-radius: 8px;
        font-weight: 600;
        font-size: 13px;
        box-shadow: 0 2px 6px rgba(107, 114, 128, 0.3);
    }

    .route-badge {
        display: inline-block;
        padding: 6px 12px;
        background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
        color: #ffffff;
        border-radius: 8px;
        font-weight: 600;
        font-size: 13px;
        box-shadow: 0 2px 6px rgba(139, 92, 246, 0.3);
    }

    .charges-badge {
        display: inline-block;
        padding: 6px 12px;
        background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
        color: #ffffff;
        border-radius: 8px;
        font-weight: 600;
        font-size: 13px;
        box-shadow: 0 2px 6px rgba(245, 158, 11, 0.3);
    }

    .date-text {
        color: #475569;
        font-weight: 500;
        font-size: 14px;
    }

    .date-text i {
        color: #64748b;
        margin-right: 4px;
    }

#ordersTable .btn {
    padding: 8px 12px !important;
    font-size: 13px !important;
    border-radius: 8px !important;
    font-weight: 500 !important;
    transition: all 0.2s ease !important;
}

#ordersTable .btn:hover {
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15) !important;
}

#ordersTable .btn.btn-info {
    background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%) !important;
    border: none !important;
    color: #ffffff !important;
}

#ordersTable .btn.btn-secondary {
    background: linear-gradient(135deg, #64748b 0%, #475569 100%) !important;
    border: none !important;
    color: #ffffff !important;
}

#ordersTable .btn.btn-success {
    border: none !important;
}

.table-responsive {
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

@media (max-width: 991.98px) {
    .tile-header {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }
}

@media (max-width: 767.98px) {
    .pageheader {
        border-radius: 12px;
    }

    .btn-toolbar {
        gap: 8px 10px;
    }

    .p-15.bg-white.b-b {
        padding: 12px !important;
    }
    /* Ensure list area occupies full width on small screens */
    .tbox .tcol {
        width: 100%;
        display: block;
    }
    /* Fallback: disable sticky head on very small screens to avoid clipping */
    .table-modern thead th {
        position: static;
        background: linear-gradient(135deg, #2563eb 0%, #1e40af 100%) !important;
        color: #ffffff !important;
    }
    /* Show mobile actions explicitly */
    .mobile-actions {
        display: grid;
        grid-template-columns: 1fr;
        gap: 8px;
        width: 100%;
        margin-top: 10px;
    }
}

}

/* Make header controls wrap and remain visible */
.tile-header .controls {
    flex-wrap: wrap;
    overflow: visible;
}

@media (max-width: 767.98px) {
    .tile-header .controls {
        width: 100%;
        gap: 8px;
    }

        .tile-header .controls > li {
            flex: 1 1 100%;
        }

            .tile-header .controls > li > a,
            .tile-header .controls > li > button {
                display: inline-flex;
                width: 100%;
                justify-content: center;
                align-items: center;
                padding: 10px 14px;
                border: 1px solid var(--border);
                background: #fff;
            }
}

/* Mobile: turn table into cards */
@media (max-width: 767.98px) {
    /* Prefer explicit mobile cards for reliability */
    .desktop-table {
        display: none !important;
    }

    .mobile-cards {
        display: block !important;
    }

        .mobile-cards .card-modern {
            border: 1px solid var(--border);
            border-radius: 12px;
            background: linear-gradient(135deg, #ffffff, #f8fafc);
            padding: 12px 14px;
            margin: 12px 0;
            box-shadow: 0 8px 20px rgba(2,6,23,.06);
        }
        /* Add colorful accents */
        .mobile-cards .card-modern {
            border-left: 6px solid #2563eb;
        }

            .mobile-cards .card-modern:nth-child(2n) {
                border-left-color: #7c3aed;
            }

            .mobile-cards .card-modern:nth-child(3n) {
                border-left-color: #16a34a;
            }

            .mobile-cards .card-modern:nth-child(4n) {
                border-left-color: #dc2626;
            }
    /* Force table -> cards with high specificity */
    #ordersTable.table-modern {
        border: 0 !important;
    }

        #ordersTable.table-modern thead {
            display: none !important;
        }

        #ordersTable.table-modern tbody {
            display: block !important;
            width: 100% !important;
        }

            #ordersTable.table-modern tbody tr {
                display: block !important;
                margin: 12px 0 !important;
                border: 1px solid var(--border) !important;
                border-radius: 12px !important;
                background: #fff !important;
                box-shadow: 0 8px 20px rgba(2,6,23,.06) !important;
                overflow: hidden !important;
            }

                #ordersTable.table-modern tbody tr:hover {
                    background: #fff !important;
                }

            #ordersTable.table-modern tbody td {
                display: flex !important;
                align-items: center !important;
                justify-content: space-between !important;
                padding: 10px 14px !important;
                border-bottom: 1px solid var(--border) !important;
                width: 100% !important;
            }

                #ordersTable.table-modern tbody td:last-child {
                    border-bottom: 0 !important;
                }

                #ordersTable.table-modern tbody td::before {
                    content: attr(data-label);
                    font-weight: 600;
                    color: #334155;
                    margin-right: 12px;
                }
            /* Auto labels per column */
            #ordersTable.table-modern tbody tr td:nth-child(1)::before {
                content: 'Select';
            }

            #ordersTable.table-modern tbody tr td:nth-child(2)::before {
                content: 'Customer';
            }

            #ordersTable.table-modern tbody tr td:nth-child(3)::before {
                content: 'Order#';
            }

            #ordersTable.table-modern tbody tr td:nth-child(4)::before {
                content: 'Status';
            }

            #ordersTable.table-modern tbody tr td:nth-child(5)::before {
                content: 'COD Amount';
            }

            #ordersTable.table-modern tbody tr td:nth-child(6)::before {
                content: 'Receiver';
            }

            #ordersTable.table-modern tbody tr td:nth-child(7)::before {
                content: 'Rec. Contact';
            }

            #ordersTable.table-modern tbody tr td:nth-child(8)::before {
                content: 'Route';
            }

            #ordersTable.table-modern tbody tr td:nth-child(9)::before {
                content: 'Srv. Charges';
            }

            #ordersTable.table-modern tbody tr td:nth-child(10)::before {
                content: 'Date';
            }

            #ordersTable.table-modern tbody tr td:nth-child(11)::before {
                content: 'Actions';
            }

            /* Make action buttons wrap nicely */
            #ordersTable.table-modern tbody tr td:last-child {
                flex-wrap: wrap;
                gap: 4px;
            }

    #ordersTable .btn {
        margin: 2px 2px;
    }
}

/* Ensure the actions header group never collapses off-screen */
@media (max-width: 767.98px) {
    .tile-header {
        position: relative;
        z-index: 2;
    }
}

.custom-modal .modal-content {
    border: 0;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 24px 60px rgba(2,6,23,.25);
}

.custom-modal .modal-header {
    background: linear-gradient(135deg, var(--brand), var(--brand-2));
    color: #fff;
}

.custom-modal .modal-title {
    font-weight: 700;
}

/* Mobile-only: make modals scrollable without affecting desktop full screen */
@media (max-width: 767.98px) {
    .custom-modal .modal-dialog {
        width: auto;
        margin: 8px;
    }

    .custom-modal .modal-content {
        max-height: calc(100vh - 24px);
        display: flex;
        flex-direction: column;
    }

    .custom-modal .modal-body {
        overflow-y: auto;
    }

    .custom-modal .modal-header, .custom-modal .modal-footer {
        flex: 0 0 auto;
    }
}

.form-control, select.form-control, textarea.form-control {
    border-radius: 10px;
    border: 1px solid var(--border);
}

    .form-control:focus {
        box-shadow: 0 0 0 4px var(--ring);
        border-color: var(--brand);
    }

.woly-loader-overlay {
    position: fixed;
    inset: 0;
    z-index: 1055;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(15,23,42,.2);
    backdrop-filter: blur(2px);
}

.woly-loader {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    border: 4px solid #e5e7eb;
    border-top-color: var(--brand);
    animation: spin 1s linear infinite;
}

.loader-text {
    margin-top: 10px;
    color: #111827;
    font-weight: 600;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.table-light.sticky-top {
    top: 0;
    z-index: 2;
}

.text-primary.text-truncate {
    max-width: 180px;
    display: inline-block;
    text-decoration: none;
}

    .text-primary.text-truncate:hover {
        text-decoration: underline;
    }

/* Quick loader used by Track button */
.quick-loader-overlay {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1060;
    background: rgba(15,23,42,.25);
}

.quick-loader {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 4px solid #e5e7eb;
    border-top-color: var(--brand-2);
    animation: spin 0.9s linear infinite;
}

.quick-loader-text {
    margin-top: 8px;
    color: #111827;
    font-weight: 600;
    position: absolute;
    top: calc(50% + 36px);
}

/* ============================================
   FIX: Dropdown Menus Visibility
   ============================================ */

/* Fix dropdown positioning and z-index */
.tile-header .dropdown {
    position: relative !important;
}

/* Ensure dropdown menus appear above everything */
.tile-header .dropdown-menu {
    z-index: 1050 !important;
    position: absolute !important;
    top: 100% !important;
    right: 0 !important;
    left: auto !important;
    margin-top: 5px !important;
    min-width: 180px !important;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2) !important;
    display: none !important;
    background-color: #fff !important;
    border: 1px solid var(--border) !important;
    border-radius: 8px !important;
    padding: 4px 0 !important;
    list-style: none !important;
}

/* Ensure dropdowns show when parent has 'open' or 'show' class (Bootstrap 3/4) */
.tile-header .dropdown.open > .dropdown-menu,
.tile-header .dropdown.show > .dropdown-menu {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Bootstrap 5+ uses 'show' class */
.tile-header .dropdown.show .dropdown-menu {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Fix for settings dropdown specifically - higher z-index */
.tile-header .dropdown.settings .dropdown-menu {
    z-index: 1051 !important;
}

/* Ensure Tools dropdown is visible */
.tile-header .dropdown:not(.settings) .dropdown-menu {
    z-index: 1050 !important;
}

/* Fix dropdown menu positioning for pull-right */
.tile-header .dropdown-menu.pull-right {
    right: 0 !important;
    left: auto !important;
}

/* Hover fallback for dropdowns (if Bootstrap JavaScript is not working) */
.tile-header .dropdown:hover > .dropdown-menu {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Ensure dropdown items are clickable and properly styled */
.tile-header .dropdown-menu li {
    list-style: none !important;
}

.tile-header .dropdown-menu li > a {
    display: block !important;
    padding: 8px 16px !important;
    clear: both !important;
    font-weight: normal !important;
    line-height: 1.42857143 !important;
    color: #333 !important;
    white-space: nowrap !important;
    text-decoration: none !important;
}

.tile-header .dropdown-menu li > a:hover,
.tile-header .dropdown-menu li > a:focus {
    text-decoration: none !important;
    color: #262626 !important;
    background-color: #f5f5f5 !important;
}

/* Fix divider in dropdown */
.tile-header .dropdown-menu .divider,
.tile-header .dropdown-menu [role="presentation"].divider {
    height: 1px !important;
    margin: 9px 0 !important;
    overflow: hidden !important;
    background-color: #e5e5e5 !important;
    border: 0 !important;
}

/* Ensure tile header doesn't clip dropdowns (already set above, but ensure it) */
.tile-header {
    overflow: visible !important;
}

/* Ensure tile body doesn't clip dropdowns if it exists */
.tile-body {
    overflow: visible !important;
}

/* Additional fix: Make sure dropdown toggle button is positioned correctly */
.tile-header .dropdown-toggle {
    position: relative;
    z-index: 101;
}

/* Fix for mobile dropdowns */
@media (max-width: 767.98px) {
    .tile-header .dropdown-menu {
        position: absolute !important;
        right: 0 !important;
        left: auto !important;
        z-index: 1050 !important;
    }
}

/* ============================================
   Professional Export to Excel Button Styles
   ============================================ */

/* Main Export Button in Header */
.export-excel-wrapper {
    margin: 0;
    padding: 0;
}

.btn-export-excel {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    padding: 10px 18px !important;
    font-weight: 600 !important;
    font-size: 14px !important;
    border-radius: 10px !important;
    border: none !important;
    background: linear-gradient(135deg, #1d6f42 0%, #28a745 50%, #34ce57 100%) !important;
    color: #ffffff !important;
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3) !important;
    transition: all 0.3s ease !important;
    cursor: pointer !important;
    position: relative !important;
    overflow: hidden !important;
}

.btn-export-excel::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.btn-export-excel:hover::before {
    left: 100%;
}

.btn-export-excel:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 20px rgba(40, 167, 69, 0.4) !important;
    background: linear-gradient(135deg, #155d32 0%, #218838 50%, #28a745 100%) !important;
}

.btn-export-excel:active {
    transform: translateY(0) !important;
    box-shadow: 0 2px 8px rgba(40, 167, 69, 0.3) !important;
}

.btn-export-excel:disabled {
    opacity: 0.7 !important;
    cursor: not-allowed !important;
    transform: none !important;
}

.btn-export-excel .export-icon {
    display: inline-flex;
    align-items: center;
    font-size: 18px;
    color: #ffffff;
}

.btn-export-excel .export-text {
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
}

.btn-export-excel .export-count {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    margin-left: 4px;
}

/* Toolbar Export Button (Smaller version) */
.btn-export-excel-toolbar {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px !important;
    padding: 8px 14px !important;
    font-weight: 600 !important;
    font-size: 13px !important;
    border-radius: 8px !important;
    border: none !important;
    background: linear-gradient(135deg, #1d6f42 0%, #28a745 50%, #34ce57 100%) !important;
    color: #ffffff !important;
    box-shadow: 0 3px 10px rgba(40, 167, 69, 0.25) !important;
    transition: all 0.3s ease !important;
    cursor: pointer !important;
    position: relative !important;
    overflow: hidden !important;
}

.btn-export-excel-toolbar::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.btn-export-excel-toolbar:hover::before {
    left: 100%;
}

.btn-export-excel-toolbar:hover {
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.35) !important;
    background: linear-gradient(135deg, #155d32 0%, #218838 50%, #28a745 100%) !important;
}

.btn-export-excel-toolbar:active {
    transform: translateY(0) !important;
    box-shadow: 0 2px 6px rgba(40, 167, 69, 0.25) !important;
}

.btn-export-excel-toolbar:disabled {
    opacity: 0.7 !important;
    cursor: not-allowed !important;
    transform: none !important;
}

.btn-export-excel-toolbar i {
    font-size: 16px;
    color: #ffffff;
}

/* Spinner animation for export button */
.btn-export-excel .fa-spinner,
.btn-export-excel-toolbar .fa-spinner {
    animation: spin 1s linear infinite;
}

/* Mobile responsive adjustments */
@media (max-width: 767.98px) {
    .btn-export-excel {
        padding: 8px 14px !important;
        font-size: 13px !important;
        width: 100%;
        justify-content: center;
    }
    
    .btn-export-excel .export-count {
        display: none; /* Hide count on mobile for cleaner look */
    }
    
    .btn-export-excel-toolbar {
        padding: 6px 12px !important;
        font-size: 12px !important;
    }
    
    .btn-export-excel-toolbar .ml-2 {
        display: none; /* Hide text on mobile, show only icon */
    }
}

/* Ensure button doesn't break layout */
.tile-header .controls .export-excel-wrapper {
    flex-shrink: 0;
}

/* Animation for export success */
@keyframes exportSuccess {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

.btn-export-excel.export-success {
    animation: exportSuccess 0.5s ease;
}

/* ============================================
   Professional Action Buttons (New Order, Edit, etc.)
   ============================================ */

/* Primary Action Button (New Order, New Bulk Order) */
.btn-action-primary {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    padding: 10px 18px !important;
    font-weight: 600 !important;
    font-size: 14px !important;
    border-radius: 10px !important;
    border: none !important;
    background: linear-gradient(135deg, #2563eb 0%, #1e40af 50%, #1e3a8a 100%) !important;
    color: #ffffff !important;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3) !important;
    transition: all 0.3s ease !important;
    cursor: pointer !important;
    position: relative !important;
    overflow: hidden !important;
    text-decoration: none !important;
}

.btn-action-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.btn-action-primary:hover::before {
    left: 100%;
}

.btn-action-primary:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.4) !important;
    background: linear-gradient(135deg, #1e40af 0%, #1e3a8a 50%, #1e3a8a 100%) !important;
    color: #ffffff !important;
    text-decoration: none !important;
}

.btn-action-primary:active {
    transform: translateY(0) !important;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3) !important;
}

.btn-action-primary:focus {
    outline: none !important;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.25) !important;
}

.btn-action-primary i {
    font-size: 16px;
    color: #ffffff;
}

.btn-action-primary span {
    white-space: nowrap;
}

/* Secondary Action Button (Edit) */
.btn-action-secondary {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    padding: 10px 18px !important;
    font-weight: 600 !important;
    font-size: 14px !important;
    border-radius: 10px !important;
    border: none !important;
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 50%, #b45309 100%) !important;
    color: #ffffff !important;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3) !important;
    transition: all 0.3s ease !important;
    cursor: pointer !important;
    position: relative !important;
    overflow: hidden !important;
    text-decoration: none !important;
}

.btn-action-secondary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.btn-action-secondary:hover::before {
    left: 100%;
}

.btn-action-secondary:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 20px rgba(245, 158, 11, 0.4) !important;
    background: linear-gradient(135deg, #d97706 0%, #b45309 50%, #92400e 100%) !important;
    color: #ffffff !important;
    text-decoration: none !important;
}

.btn-action-secondary:active {
    transform: translateY(0) !important;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.3) !important;
}

.btn-action-secondary:focus {
    outline: none !important;
    box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.25) !important;
}

.btn-action-secondary i {
    font-size: 16px;
    color: #ffffff;
}

.btn-action-secondary span {
    white-space: nowrap;
}

/* Mobile responsive for action buttons */
@media (max-width: 767.98px) {
    .btn-action-primary,
    .btn-action-secondary {
        width: 100% !important;
        padding: 10px 14px !important;
        font-size: 13px !important;
    }
    
    .tile-header .controls .btn-action-primary,
    .tile-header .controls .btn-action-secondary {
        width: auto;
    }
}

/* ============================================
   Professional Print Slips Button
   ============================================ */

.btn-print-slips {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px !important;
    padding: 8px 16px !important;
    font-weight: 600 !important;
    font-size: 13px !important;
    border-radius: 8px !important;
    border: none !important;
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 50%, #991b1b 100%) !important;
    color: #ffffff !important;
    box-shadow: 0 3px 10px rgba(220, 38, 38, 0.25) !important;
    transition: all 0.3s ease !important;
    cursor: pointer !important;
    position: relative !important;
    overflow: hidden !important;
    margin-left: 4px !important;
}

.btn-print-slips::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.btn-print-slips:hover::before {
    left: 100%;
}

.btn-print-slips:hover:not(:disabled) {
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 15px rgba(220, 38, 38, 0.35) !important;
    background: linear-gradient(135deg, #b91c1c 0%, #991b1b 50%, #7f1d1d 100%) !important;
}

.btn-print-slips:active:not(:disabled) {
    transform: translateY(0) !important;
    box-shadow: 0 2px 6px rgba(220, 38, 38, 0.25) !important;
}

.btn-print-slips:disabled {
    opacity: 0.5 !important;
    cursor: not-allowed !important;
    transform: none !important;
    background: linear-gradient(135deg, #9ca3af 0%, #6b7280 100%) !important;
}

.btn-print-slips .print-icon {
    display: inline-flex;
    align-items: center;
    font-size: 15px;
    color: #ffffff;
}

.btn-print-slips .print-text {
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
}

.btn-print-slips .print-count {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    background: rgba(255, 255, 255, 0.25);
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    margin-left: 2px;
    min-width: 32px;
    justify-content: center;
}

/* Mobile responsive for print button */
@media (max-width: 767.98px) {
    .btn-print-slips {
        padding: 6px 12px !important;
        font-size: 12px !important;
    }
    
    .btn-print-slips .print-text {
        display: none; /* Hide text on mobile, show only icon and count */
    }
}

/* ============================================
   Professional Refresh Button
   ============================================ */

.btn-refresh {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px !important;
    padding: 8px 16px !important;
    font-weight: 600 !important;
    font-size: 13px !important;
    border-radius: 8px !important;
    border: none !important;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 50%, #1e40af 100%) !important;
    color: #ffffff !important;
    box-shadow: 0 3px 10px rgba(59, 130, 246, 0.25) !important;
    transition: all 0.3s ease !important;
    cursor: pointer !important;
    position: relative !important;
    overflow: hidden !important;
}

.btn-refresh::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.btn-refresh:hover::before {
    left: 100%;
}

.btn-refresh:hover:not(:disabled) {
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.35) !important;
    background: linear-gradient(135deg, #2563eb 0%, #1e40af 50%, #1e3a8a 100%) !important;
}

.btn-refresh:active:not(:disabled) {
    transform: translateY(0) !important;
    box-shadow: 0 2px 6px rgba(59, 130, 246, 0.25) !important;
}

.btn-refresh:disabled {
    opacity: 0.7 !important;
    cursor: not-allowed !important;
    transform: none !important;
}

.btn-refresh .refresh-icon {
    display: inline-flex;
    align-items: center;
    font-size: 15px;
    color: #ffffff;
}

.btn-refresh .refresh-icon .fa-spinner {
    animation: spin 1s linear infinite;
}

.btn-refresh .refresh-text {
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Mobile responsive for refresh button */
@media (max-width: 767.98px) {
    .btn-refresh {
        padding: 6px 12px !important;
        font-size: 12px !important;
    }
    
    .btn-refresh .refresh-text {
        display: none; /* Hide text on mobile, show only icon */
    }
}

/* ============================================
   Beautiful Pagination Buttons
   ============================================ */

.btn-pagination {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 6px 12px !important;
    font-weight: 600 !important;
    font-size: 13px !important;
    border-radius: 6px !important;
    border: none !important;
    background: linear-gradient(135deg, #6b7280 0%, #4b5563 100%) !important;
    color: #ffffff !important;
    box-shadow: 0 2px 6px rgba(107, 114, 128, 0.2) !important;
    transition: all 0.2s ease !important;
    cursor: pointer !important;
    min-width: 36px !important;
}

.btn-pagination:hover:not(:disabled) {
    transform: translateY(-1px) !important;
    box-shadow: 0 3px 10px rgba(107, 114, 128, 0.3) !important;
    background: linear-gradient(135deg, #4b5563 0%, #374151 100%) !important;
}

.btn-pagination:active:not(:disabled) {
    transform: translateY(0) !important;
    box-shadow: 0 1px 4px rgba(107, 114, 128, 0.2) !important;
}

.btn-pagination:disabled {
    opacity: 0.4 !important;
    cursor: not-allowed !important;
    transform: none !important;
    background: linear-gradient(135deg, #9ca3af 0%, #6b7280 100%) !important;
}

.btn-pagination i {
    font-size: 14px;
}

.btn-pagination.br-2-l {
    border-top-left-radius: 8px !important;
    border-bottom-left-radius: 8px !important;
}

.btn-pagination.br-2-r {
    border-top-right-radius: 8px !important;
    border-bottom-right-radius: 8px !important;
}

/* ============================================
   Beautiful Filter Controls
   ============================================ */

.filter-label {
    display: inline-flex !important;
    align-items: center !important;
    padding: 6px 12px !important;
    font-weight: 600 !important;
    font-size: 12px !important;
    color: #374151 !important;
    background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%) !important;
    border-radius: 6px !important;
    margin: 0 !important;
    margin-top: 5px !important;
    white-space: nowrap;
}

.filter-select {
    display: inline-block !important;
    padding: 8px 14px !important;
    font-weight: 500 !important;
    font-size: 13px !important;
    color: #1f2937 !important;
    background: linear-gradient(135deg, #ffffff 0%, #f9fafb 100%) !important;
    border: 2px solid #e5e7eb !important;
    border-radius: 8px !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1) !important;
    transition: all 0.2s ease !important;
    cursor: pointer !important;
    min-width: 150px !important;
}

.filter-select:hover {
    border-color: #3b82f6 !important;
    box-shadow: 0 2px 6px rgba(59, 130, 246, 0.15) !important;
    background: linear-gradient(135deg, #ffffff 0%, #f0f9ff 100%) !important;
}

.filter-select:focus {
    outline: none !important;
    border-color: #2563eb !important;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1) !important;
    background: #ffffff !important;
}

.filter-date {
    display: inline-block !important;
    padding: 8px 14px !important;
    font-weight: 500 !important;
    font-size: 13px !important;
    color: #1f2937 !important;
    background: linear-gradient(135deg, #ffffff 0%, #f9fafb 100%) !important;
    border: 2px solid #e5e7eb !important;
    border-radius: 8px !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1) !important;
    transition: all 0.2s ease !important;
    cursor: pointer !important;
    min-width: 150px !important;
}

.filter-date:hover {
    border-color: #3b82f6 !important;
    box-shadow: 0 2px 6px rgba(59, 130, 246, 0.15) !important;
    background: linear-gradient(135deg, #ffffff 0%, #f0f9ff 100%) !important;
}

.filter-date:focus {
    outline: none !important;
    border-color: #2563eb !important;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1) !important;
    background: #ffffff !important;
}

.pagination-info {
    display: inline-flex !important;
    align-items: center !important;
    padding: 8px 14px !important;
    font-weight: 600 !important;
    font-size: 13px !important;
    color: #374151 !important;
    background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%) !important;
    border-radius: 8px !important;
    margin: 0 !important;
    margin-top: 5px !important;
    white-space: nowrap;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1) !important;
}

/* Mobile responsive for filter controls */
@media (max-width: 767.98px) {
    .filter-label,
    .filter-select,
    .filter-date {
        font-size: 12px !important;
        padding: 6px 10px !important;
    }
    
    .filter-select,
    .filter-date {
        min-width: 120px !important;
    }
}
