
        :root {
            --nm-red: #e30613;
            --nm-black: #000;
            --nm-light-gray: #f8f8f8;
            --nm-dark-gray: #333;
            --nm-green: #28a745;
            --nm-blue: #007bff;
            --nm-yellow: #ffc107;
            --nm-purple: #6f42c1;
            --nm-orange: #fd7e14;
        }
        
        body {
            font-family: Arial, sans-serif;
            background: var(--nm-light-gray);
            margin: 0;
            padding: 0;
        }
        header {
            background: var(--nm-black);
            color: #fff;
            padding: 15px;
            text-align: center;
            font-size: 22px;
            font-weight: bold;
            border-bottom: 5px solid var(--nm-red);
            position: relative;
        }
        .db-status {
            position: absolute;
            top: 15px;
            right: 15px;
            padding: 5px 10px;
            border-radius: 4px;
            font-size: 12px;
        }
        .db-connected {
            background: var(--nm-green);
            color: white;
        }
        .db-disconnected {
            background: var(--nm-red);
            color: white;
        }
        .container {
            max-width: 1200px;
            margin: auto;
            background: white;
            padding: 20px;
            margin-top: 20px;
            border-radius: 8px;
            box-shadow: 0 0 10px rgba(0,0,0,0.1);
        }
        .tabs {
            display: flex;
            margin-bottom: 20px;
            border-bottom: 1px solid #ddd;
        }
        .tab {
            padding: 10px 20px;
            cursor: pointer;
            background: #f1f1f1;
            border: 1px solid #ddd;
            border-bottom: none;
            border-radius: 5px 5px 0 0;
            margin-right: 5px;
        }
        .tab.active {
            background: white;
            border-bottom: 1px solid white;
            margin-bottom: -1px;
            font-weight: bold;
            color: var(--nm-red);
        }
        .tab-content {
            display: none;
        }
        .tab-content.active {
            display: block;
        }
        .form-group {
            margin-bottom: 15px;
        }
        .form-group label {
            display: block;
            margin-bottom: 5px;
            font-weight: bold;
        }
        select, input {
            width: 100%;
            padding: 10px;
            margin: 8px 0;
            border: 1px solid #ccc;
            border-radius: 5px;
            font-size: 15px;
            box-sizing: border-box;
        }
        button {
            padding: 12px;
            width: 100%;
            margin-top: 10px;
            background: var(--nm-red);
            color: white;
            font-size: 16px;
            border: none;
            border-radius: 5px;
            cursor: pointer;
            font-weight: bold;
            transition: background 0.3s;
        }
        button:hover { 
            background: #b1040f; 
        }
        button.secondary {
            background: var(--nm-dark-gray);
        }
        button.secondary:hover {
            background: #555;
        }
        button.success {
            background: var(--nm-green);
        }
        button.success:hover {
            background: #218838;
        }
        button.info {
            background: var(--nm-blue);
        }
        button.info:hover {
            background: #0056b3;
        }
        button.warning {
            background: var(--nm-yellow);
            color: #000;
        }
        button.warning:hover {
            background: #e0a800;
        }
        .button-group {
            display: flex;
            gap: 10px;
        }
        .button-group button {
            flex: 1;
        }
        table {
            width: 100%;
            border-collapse: collapse;
            margin-top: 15px;
        }
        table, th, td {
            border: 1px solid #ccc;
        }
        th {
            background: var(--nm-black);
            color: white;
            padding: 8px;
            position: sticky;
            top: 0;
        }
        td {
            padding: 6px;
            font-size: 14px;
            text-align: center;
        }
        .delete-btn, .return-btn, .deliver-btn, .reassign-btn {
            padding: 5px 10px;
            border: none;
            border-radius: 4px;
            cursor: pointer;
            color: white;
            margin: 2px;
        }
        .delete-btn { background: var(--nm-red); }
        .return-btn { background: var(--nm-blue); }
        .deliver-btn { background: var(--nm-green); }
        .reassign-btn { background: var(--nm-orange); }
        .locked-row {
            background-color: #f8f9fa;
            opacity: 0.7;
        }
        .stats-container {
            display: flex;
            justify-content: space-between;
            margin: 15px 0;
            flex-wrap: wrap;
        }
        .stat-box {
            background: white;
            border-radius: 5px;
            padding: 10px;
            box-shadow: 0 2px 5px rgba(0,0,0,0.1);
            text-align: center;
            flex: 1;
            margin: 5px;
            min-width: 120px;
        }
        .stat-value {
            font-size: 24px;
            font-weight: bold;
            color: var(--nm-red);
        }
        .stat-label {
            font-size: 14px;
            color: var(--nm-dark-gray);
        }
        .notification {
            position: fixed;
            top: 20px;
            right: 20px;
            padding: 15px;
            border-radius: 5px;
            color: white;
            z-index: 1000;
            opacity: 0;
            transition: opacity 0.3s;
        }
        .notification.success { background: var(--nm-green); }
        .notification.error { background: var(--nm-red); }
        .notification.info { background: var(--nm-blue); }
        .notification.warning { background: var(--nm-yellow); color: #000; }
        .notification.show { opacity: 1; }
        .scan-animation {
            animation: scanPulse 0.5s;
        }
        .return-animation {
            animation: returnPulse 0.5s;
        }
        .cod-animation {
            animation: codPulse 0.5s;
        }
        .delivery-animation {
            animation: deliveryPulse 0.5s;
        }
        @keyframes scanPulse {
            0% { background-color: white; }
            50% { background-color: #e8f5e9; }
            100% { background-color: white; }
        }
        @keyframes returnPulse {
            0% { background-color: white; }
            50% { background-color: #e3f2fd; }
            100% { background-color: white; }
        }
        @keyframes codPulse {
            0% { background-color: white; }
            50% { background-color: #f3e5f5; }
            100% { background-color: white; }
        }
        @keyframes deliveryPulse {
            0% { background-color: white; }
            50% { background-color: #d4edda; }
            100% { background-color: white; }
        }
        .scan-section {
            border: 1px solid #ddd;
            border-radius: 8px;
            padding: 15px;
            margin-bottom: 20px;
        }
        .scan-section h3 {
            margin-top: 0;
            color: var(--nm-dark-gray);
            border-bottom: 1px solid #eee;
            padding-bottom: 10px;
        }
        .ready-scan-indicator {
            background: #d4edda;
            border-left: 4px solid var(--nm-green);
            padding: 10px;
            margin: 10px 0;
            border-radius: 4px;
            text-align: center;
            font-weight: bold;
        }
        .quick-actions {
            display: flex;
            gap: 10px;
            margin-bottom: 20px;
        }
        .quick-action-btn {
            flex: 1;
            padding: 15px;
            text-align: center;
            background: var(--nm-light-gray);
            border: 2px solid #ddd;
            border-radius: 8px;
            cursor: pointer;
            transition: all 0.3s;
        }
        .quick-action-btn:hover {
            background: white;
            border-color: var(--nm-red);
        }
        .quick-action-btn.active {
            background: white;
            border-color: var(--nm-red);
            box-shadow: 0 0 10px rgba(227, 6, 19, 0.2);
        }
        .quick-action-icon {
            font-size: 24px;
            margin-bottom: 5px;
        }
        .quick-action-label {
            font-weight: bold;
            font-size: 14px;
        }
        .cod-toggle {
            display: flex;
            align-items: center;
            gap: 10px;
            margin-bottom: 15px;
        }
        .toggle-switch {
            position: relative;
            display: inline-block;
            width: 60px;
            height: 34px;
        }
        .toggle-switch input {
            opacity: 0;
            width: 0;
            height: 0;
        }
        .toggle-slider {
            position: absolute;
            cursor: pointer;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background-color: #ccc;
            transition: .4s;
            border-radius: 34px;
        }
        .toggle-slider:before {
            position: absolute;
            content: "";
            height: 26px;
            width: 26px;
            left: 4px;
            bottom: 4px;
            background-color: white;
            transition: .4s;
            border-radius: 50%;
        }
        input:checked + .toggle-slider {
            background-color: var(--nm-purple);
        }
        input:checked + .toggle-slider:before {
            transform: translateX(26px);
        }
        .cod-amount-group {
            display: none;
            margin-top: 10px;
        }
        .cod-amount-group.show {
            display: block;
        }
        .status-badge {
            display: inline-block;
            padding: 3px 8px;
            border-radius: 12px;
            font-size: 12px;
            font-weight: bold;
        }
        .status-active { background: var(--nm-yellow); color: #000; }
        .status-returned { background: var(--nm-blue); color: white; }
        .status-cod { background: var(--nm-purple); color: white; }
        .status-delivered { background: var(--nm-green); color: white; }
        .loading {
            text-align: center;
            padding: 20px;
            color: var(--nm-dark-gray);
        }
        .search-container {
            margin: 15px 0;
        }
        .filter-controls {
            display: flex;
            gap: 10px;
            margin-bottom: 15px;
            flex-wrap: wrap;
        }
        .filter-controls select, .filter-controls input {
            flex: 1;
            min-width: 150px;
        }
        .empty-state {
            text-align: center;
            padding: 20px;
            color: var(--nm-dark-gray);
        }
        .driver-assignments {
            margin-top: 20px;
            border: 1px solid #ddd;
            border-radius: 8px;
            padding: 15px;
        }
        .driver-assignments h4 {
            margin-top: 0;
            color: var(--nm-dark-gray);
            border-bottom: 1px solid #eee;
            padding-bottom: 10px;
        }
        .assignment-item {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 8px 0;
            border-bottom: 1px solid #f0f0f0;
        }
        .assignment-item:last-child {
            border-bottom: none;
        }
        .assignment-info {
            flex: 1;
        }
        .assignment-actions {
            display: flex;
            gap: 5px;
        }
        .scan-mode-indicator {
            background: #fff3cd;
            border-left: 4px solid var(--nm-yellow);
            padding: 10px;
            margin: 10px 0;
            border-radius: 4px;
        }
        .return-mode-indicator {
            background: #e3f2fd;
            border-left: 4px solid var(--nm-blue);
            padding: 10px;
            margin: 10px 0;
            border-radius: 4px;
        }
        .delivery-mode-indicator {
            background: #d4edda;
            border-left: 4px solid var(--nm-green);
            padding: 10px;
            margin: 10px 0;
            border-radius: 4px;
        }
        .auto-assign-indicator {
            background: #e8f5e9;
            border-left: 4px solid var(--nm-green);
            padding: 10px;
            margin: 10px 0;
            border-radius: 4px;
        }
        .bulk-return-modal {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0,0,0,0.5);
            z-index: 1000;
            justify-content: center;
            align-items: center;
        }
        .bulk-return-modal.show {
            display: flex;
        }
        .bulk-return-content {
            background: white;
            padding: 20px;
            border-radius: 8px;
            width: 400px;
            max-width: 90%;
        }
        .courier-stats-container {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
            gap: 15px;
            margin-bottom: 20px;
        }
        .courier-stat-box {
            background: white;
            border-radius: 5px;
            padding: 15px;
            box-shadow: 0 2px 5px rgba(0,0,0,0.1);
            text-align: center;
            border-left: 4px solid var(--nm-red);
        }
        .courier-stat-value {
            font-size: 20px;
            font-weight: bold;
            color: var(--nm-red);
        }
        .courier-stat-label {
            font-size: 12px;
            color: var(--nm-dark-gray);
            margin-top: 5px;
        }
        .performance-metrics {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
            gap: 15px;
            margin-bottom: 20px;
        }
        .metric-card {
            background: white;
            border-radius: 8px;
            padding: 15px;
            box-shadow: 0 2px 5px rgba(0,0,0,0.1);
            text-align: center;
        }
        .metric-value {
            font-size: 24px;
            font-weight: bold;
            color: var(--nm-red);
            margin-bottom: 5px;
        }
        .metric-label {
            font-size: 14px;
            color: var(--nm-dark-gray);
        }
        .metric-trend {
            font-size: 12px;
            margin-top: 5px;
        }
        .trend-up {
            color: var(--nm-green);
        }
        .trend-down {
            color: var(--nm-red);
        }
        .trend-neutral {
            color: var(--nm-dark-gray);
        }
        .percentage-badge {
            display: inline-block;
            padding: 2px 6px;
            border-radius: 10px;
            font-size: 10px;
            font-weight: bold;
            margin-left: 5px;
        }
        .percentage-excellent {
            background: var(--nm-green);
            color: white;
        }
        .percentage-good {
            background: #28a745;
            color: white;
        }
        .percentage-average {
            background: var(--nm-yellow);
            color: #000;
        }
        .percentage-poor {
            background: var(--nm-orange);
            color: white;
        }
        .percentage-bad {
            background: var(--nm-red);
            color: white;
        }
        .performance-tabs {
            display: flex;
            margin-bottom: 15px;
            border-bottom: 1px solid #ddd;
        }
        .performance-tab {
            padding: 8px 16px;
            cursor: pointer;
            background: #f1f1f1;
            border: 1px solid #ddd;
            border-bottom: none;
            border-radius: 5px 5px 0 0;
            margin-right: 5px;
        }
        .performance-tab.active {
            background: white;
            border-bottom: 1px solid white;
            margin-bottom: -1px;
            font-weight: bold;
            color: var(--nm-red);
        }
        .performance-content {
            display: none;
        }
        .performance-content.active {
            display: block;
        }
        .top-courier-card {
            background: white;
            border-radius: 8px;
            padding: 15px;
            margin-bottom: 15px;
            box-shadow: 0 2px 5px rgba(0,0,0,0.1);
            border-left: 4px solid var(--nm-red);
        }
        .top-courier-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 10px;
        }
        .top-courier-name {
            font-size: 18px;
            font-weight: bold;
            color: var(--nm-dark-gray);
        }
        .top-courier-rank {
            background: var(--nm-red);
            color: white;
            padding: 4px 8px;
            border-radius: 12px;
            font-size: 12px;
            font-weight: bold;
        }
        .top-courier-stats {
            display: grid;
            grid-template-columns: repeat(4, 1fr);
            gap: 10px;
        }
        .top-courier-stat {
            text-align: center;
        }
        .top-courier-stat-value {
            font-size: 16px;
            font-weight: bold;
            color: var(--nm-red);
        }
        .top-courier-stat-label {
            font-size: 12px;
            color: var(--nm-dark-gray);
        }
        .performance-chart {
            height: 200px;
            margin: 20px 0;
            background: #f9f9f9;
            border-radius: 5px;
            padding: 10px;
            display: flex;
            align-items: flex-end;
            justify-content: space-around;
        }
        .chart-bar {
            width: 40px;
            background: var(--nm-red);
            margin: 0 5px;
            position: relative;
            border-radius: 3px 3px 0 0;
        }
        .chart-label {
            position: absolute;
            bottom: -25px;
            left: 0;
            right: 0;
            text-align: center;
            font-size: 12px;
        }
        .chart-value {
            position: absolute;
            top: -20px;
            left: 0;
            right: 0;
            text-align: center;
            font-size: 12px;
            font-weight: bold;
        }
        @media (max-width: 768px) {
            .stats-container {
                flex-direction: column;
            }
            .button-group {
                flex-direction: column;
            }
            .assignment-item {
                flex-direction: column;
                align-items: flex-start;
            }
            .assignment-actions {
                margin-top: 5px;
                width: 100%;
            }
            .assignment-actions button {
                flex: 1;
            }
            .quick-actions {
                flex-direction: column;
            }
            .courier-stats-container {
                grid-template-columns: 1fr;
            }
            .top-courier-stats {
                grid-template-columns: repeat(2, 1fr);
            }
            .performance-metrics {
                grid-template-columns: 1fr;
            }
        }

        /*pagination arae*/

        /* Pagination Styles */
/* Responsive Table Styles */
.table-container {
    width: 100%;
    overflow-x: auto;
    margin-bottom: 20px;
    border-radius: 8px;
    border: 1px solid #dee2e6;
    background: white;
}

#scanTable {
    min-width: 1000px; /* Minimum width for table */
    width: 100%;
    margin-bottom: 0;
}

/* Professional Pagination Styles */
.pagination-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    margin-top: 20px;
    padding: 20px;
    background: white;
    border-radius: 8px;
    border: 1px solid #dee2e6;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.pagination-nav {
    display: flex;
    align-items: center;
    gap: 5px;
}

.pagination-list {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 5px;
}

.pagination-item {
    display: inline-block;
}

.pagination-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    background: white;
    color: var(--nm-dark-gray);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    cursor: pointer;
}

.pagination-link:hover:not(.active, :disabled) {
    background: #f8f9fa;
    border-color: var(--nm-red);
    color: var(--nm-red);
}

.pagination-link.active {
    background: var(--nm-red);
    border-color: var(--nm-red);
    color: white;
    font-weight: bold;
}

.pagination-link:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #f8f9fa;
}

.pagination-nav-btn {
    min-width: 100px;
    font-weight: 500;
}

.pagination-nav-btn:hover:not(:disabled) {
    background: var(--nm-red);
    color: white;
}

.pagination-info {
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 14px;
    color: var(--nm-dark-gray);
}

.page-size-selector {
    display: flex;
    align-items: center;
    gap: 8px;
}

.page-size-selector select {
    padding: 6px 12px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    background: white;
    color: var(--nm-dark-gray);
    font-size: 14px;
}

.records-info {
    font-weight: bold;
    color: var(--nm-red);
}

.pagination-ellipsis {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    color: #6c757d;
    font-weight: bold;
}

/* Mobile-specific styles */
@media (max-width: 768px) {
    .table-container {
        border-radius: 0;
        border-left: none;
        border-right: none;
        margin-left: -20px;
        margin-right: -20px;
        width: calc(100% + 40px);
    }
    
    #scanTable th,
    #scanTable td {
        padding: 8px 4px;
        font-size: 12px;
    }
    
    #scanTable th {
        font-size: 11px;
        padding: 8px 2px;
    }
    
    /* Hide less important columns on mobile */
    #scanTable th:nth-child(6), /* COD Amount */
    #scanTable td:nth-child(6) {
        display: none;
    }
    
    /* Adjust status badges for mobile */
    .status-badge {
        font-size: 10px;
        padding: 2px 6px;
    }
    
    /* Action buttons on mobile */
    .delete-btn,
    .deliver-btn,
    .return-btn,
    .reassign-btn {
        padding: 3px 6px;
        font-size: 10px;
        margin: 1px;
        min-width: 55px;
    }
    
    /* Pagination mobile optimization */
    .pagination-container {
        padding: 15px 10px;
        margin-left: -20px;
        margin-right: -20px;
        width: calc(100% + 40px);
        border-radius: 0;
        border-left: none;
        border-right: none;
    }
    
    .pagination-nav {
        flex-wrap: wrap;
        justify-content: center;
        gap: 3px;
    }
    
    .pagination-link {
        min-width: 35px;
        height: 35px;
        padding: 0 8px;
        font-size: 14px;
    }
    
    .pagination-nav-btn {
        min-width: 80px;
        font-size: 14px;
    }
    
    .pagination-info {
        flex-direction: column;
        gap: 10px;
        text-align: center;
        font-size: 13px;
    }
    
    .page-size-selector {
        justify-content: center;
    }
    
    /* Mobile: Show ellipsis and fewer page numbers */
    .pagination-item.mobile-hidden {
        display: none;
    }
}

@media (max-width: 480px) {
    /* Further hide columns on very small screens */
    #scanTable th:nth-child(2), /* Courier */
    #scanTable td:nth-child(2),
    #scanTable th:nth-child(7), /* Date & Time */
    #scanTable td:nth-child(7) {
        display: none;
    }
    
    .pagination-link {
        min-width: 30px;
        height: 30px;
        padding: 0 6px;
        font-size: 12px;
    }
    
    .pagination-nav-btn {
        min-width: 70px;
        font-size: 12px;
    }
    
    .pagination-list {
        gap: 2px;
    }
}

/* Responsive table cell content */
@media (max-width: 768px) {
    /* Truncate long text in table cells */
    #scanTable td {
        max-width: 100px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    
    /* Make barcode more prominent */
    #scanTable td:nth-child(4) { /* Barcode column */
        font-weight: bold;
        color: var(--nm-red);
    }
}

/* Mobile table header sticky positioning */
@media (max-width: 768px) {
    .table-container {
        position: relative;
    }
    
    #scanTable thead th {
        position: -webkit-sticky;
        position: sticky;
        top: 0;
        z-index: 10;
    }
}

.action-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    justify-content: center;
}
    