/* ==========================================================================
   Order Profit Manager - v2.0.0 STYLES (Definitive Global Scroll Fix)
   ========================================================================== */

/* --- CORE LAYOUT & CONTAINER --- */
/* CRITICAL FIX: Only apply overflow:hidden when the plugin container exists */
body:has(#order-profit-manager) {
    overflow: hidden !important;
}

/* On mobile, always allow scrolling */
@media (max-width: 1024px) {
    html, body {
        overflow: auto !important;
    }
}

.opm-container {
    display: flex;
    margin-right: -20px;
    margin-top: -20px;
    margin-bottom: -20px;
    min-height: 100vh;
    background: #f8f9fa;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}
body.admin-bar .opm-container {
    min-height: calc(100vh - 32px);
}
.opm-container * {
    box-sizing: border-box;
}

/* --- DESKTOP SIDEBAR --- */
.opm-sidebar-desktop {
    width: 260px;
    background: #ffffff;
    border-right: 1px solid #e9ecef;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 1001;
    transition: width 0.3s ease-in-out;
}
body.admin-bar .opm-sidebar-desktop {
    height: calc(100vh - 32px);
    top: 32px;
}

/* Styles for nav items inside sidebar/dropdown */
.opm-sidebar-header { padding: 1.5rem; border-bottom: 1px solid #e9ecef; flex-shrink: 0; overflow: hidden; white-space: nowrap; }
.opm-brand-title { margin: 0; font-size: 1.275rem; font-weight: 510; color: #333; transition: opacity 0.2s ease; }
.opm-nav-menu { flex-grow: 1; overflow-y: auto; overflow-x: hidden; }
.opm-nav-list { list-style: none; padding: 0; margin: 0; }
.opm-nav-section-title { padding: 1rem 1.5rem 0.5rem; font-size: 0.637rem; font-weight: 595; color: #888; text-transform: uppercase; letter-spacing: 1px; overflow: hidden; white-space: nowrap; transition: opacity 0.2s ease; }
.opm-nav-link {
    display: flex;
    align-items: center;
    padding: 0.9rem 1.5rem;
    text-decoration: none;
    color: #555;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
    font-weight: 425;
    white-space: nowrap;
    overflow: hidden;
    font-size: 0.875rem; /* Add this line */
}
.opm-nav-link:hover { background-color: #f8f9ff; color: #667eea; }
.opm-nav-link.active { background-color: #f0f2ff; color: #667eea; border-left-color: #667eea; font-weight: 510; }
.opm-nav-link span { transition: opacity 0.2s ease, width 0.2s ease; }
.opm-nav-icon { width: 20px; height: 20px; margin-right: 1rem; stroke-width: 2; color: #888; flex-shrink: 0; }
.opm-nav-link.active .opm-nav-icon { color: #667eea; }
.opm-badge { margin-left: auto; font-size: 0.637rem; padding: 2px 8px; border-radius: 12px; font-weight: 510; transition: opacity 0.2s ease, width 0.2s ease; }
.opm-badge-primary { background-color: #667eea; color: white; }
.opm-badge-danger { background-color: #ef4444; color: white; }
.opm-sidebar-footer { padding: 1rem; border-top: 1px solid #e9ecef; flex-shrink: 0; }
.opm-sidebar-toggle-btn { width: 100%; background: #f8f9fa; border: 1px solid #e9ecef; border-radius: 8px; padding: 0.75rem; display: flex; align-items: center; justify-content: center; cursor: pointer; color: #555; font-weight: 425; }
.opm-sidebar-toggle-btn:hover { background: #e9ecef; }
.opm-sidebar-toggle-btn svg { width: 20px; height: 20px; transition: transform 0.3s ease; }
.opm-sidebar-toggle-btn span { margin-left: 0.5rem; transition: opacity 0.2s ease, width 0.2s ease; }

/* --- CONTENT AREA (DESKTOP) --- */
.opm-content-wrapper { flex-grow: 1; display: flex; flex-direction: column; margin-left: 260px; transition: margin-left 0.3s ease-in-out; }
.opm-main-content { flex-grow: 1; padding: 2rem; }
@media (min-width: 1025px) {
    .opm-content-wrapper { height: 100vh; overflow: hidden; }
    body.admin-bar .opm-content-wrapper { height: calc(100vh - 32px); }
    .opm-main-content { overflow-y: auto; }
}

/* --- COLLAPSED SIDEBAR STYLES (DESKTOP) --- */
.opm-container.sidebar-collapsed .opm-sidebar-desktop { width: 80px; }
.opm-container.sidebar-collapsed .opm-content-wrapper { margin-left: 80px; }
.opm-container.sidebar-collapsed .opm-brand-title, .opm-container.sidebar-collapsed .opm-nav-section-title, .opm-container.sidebar-collapsed .opm-nav-link span, .opm-container.sidebar-collapsed .opm-badge, .opm-container.sidebar-collapsed .opm-sidebar-toggle-btn span { opacity: 0; width: 0; visibility: hidden; }
.opm-container.sidebar-collapsed .opm-sidebar-toggle-btn svg { transform: rotate(180deg); }
.opm-container.sidebar-collapsed .opm-nav-link { justify-content: center; }
.opm-container.sidebar-collapsed .opm-nav-icon { margin-right: 0; }

/* --- RESPONSIVE & NEW MOBILE MENU --- */
.opm-main-header { display: none; }
.opm-nav-mobile { display: none !important; }

@media (max-width: 1024px) {
    .opm-sidebar-desktop { display: none; }
    .opm-container { display: block; }
    .opm-content-wrapper { margin-left: 0 !important; }
    .opm-main-content { padding: 1rem; overflow-y: visible; }
    
    /* Mobile Header */
    .opm-main-header { display: flex; align-items: center; justify-content: space-between; background: #fff; padding: 0.75rem 1rem; border-bottom: 1px solid #e9ecef; position: sticky; top: 0; z-index: 1000; min-height: 60px; }
    body.admin-bar .opm-main-header { top: 46px; }
    .opm-header-title { order: 1; color: #333; font-weight: 510; font-size: 1.02rem; }
    .opm-hamburger { display: flex; flex-direction: column; background: none; border: none; cursor: pointer; padding: 0.5rem; z-index: 1002; order: 2; }
    .opm-hamburger span { width: 25px; height: 3px; background-color: #333; margin: 3px 0; transition: 0.3s ease; border-radius: 2px; }
    .opm-hamburger.active span:nth-child(1) { transform: rotate(-45deg) translate(-5px, 6px); }
    .opm-hamburger.active span:nth-child(2) { opacity: 0; }
    .opm-hamburger.active span:nth-child(3) { transform: rotate(45deg) translate(-5px, -6px); }

    /* NEW MOBILE DROPDOWN MENU */
    .opm-nav-mobile {
        display: block !important;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: #ffffff;
        border-bottom: 1px solid #e9ecef;
        box-shadow: 0 8px 16px rgba(0,0,0,0.1);
        max-height: 0;
        opacity: 0;
        overflow: hidden;
        visibility: hidden;
        transition: max-height 0.4s ease-in-out, opacity 0.3s ease, visibility 0s 0.4s;
        z-index: 999;
    }
    .opm-nav-mobile.show {
        max-height: 80vh;
        opacity: 1;
        visibility: visible;
        overflow-y: auto;
        transition: max-height 0.4s ease-in-out, opacity 0.3s ease, visibility 0s;
    }
    .opm-nav-mobile .opm-nav-list { flex-direction: column; padding: 0.5rem 0; }
    .opm-nav-mobile .opm-nav-link { padding: 0.9rem 1.5rem; border-left: 3px solid transparent; border-bottom: 1px solid #f3f4f6; }
    .opm-nav-mobile .opm-nav-link.active { background-color: #f0f2ff; border-left-color: #667eea; }
    .opm-nav-mobile .opm-nav-item:last-child .opm-nav-link { border-bottom: none; }
}

/* Other existing styles for sections, forms, tables, etc. should go here */
.opm-section {
    background: #ffffff;
    border-radius: 12px;
    padding: 32px;
    margin-bottom: 24px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    border: 1px solid #e5e7eb;
}

/* Main Content */
.opm-main-content {
    flex: 1;
    max-width: 1600px;
    margin: 0 auto;
    width: 100%;
    padding: 2rem;
}

/* Desktop Tabs (hidden on mobile) */
.opm-desktop-tabs {
    display: none;
}

/* Icons */
.opm-icon {
    font-style: normal;
    margin-right: 8px;
}

/* Sections */
.opm-section {
    background: #ffffff;
    border-radius: 12px;
    padding: 32px;
    margin-bottom: 24px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    border: 1px solid #e5e7eb;
    transition: all 0.3s ease;
}

.opm-section:hover {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* Navigation Tabs */
.opm-nav-tabs {
    display: flex;
    border-bottom: 2px solid #e5e7eb;
    margin-bottom: 32px;
    gap: 4px;
}

.opm-nav-tab {
    padding: 12px 24px;
    background: #f3f4f6;
    border: none;
    border-radius: 8px 8px 0 0;
    cursor: pointer;
    font-weight: 510;
    color: #6b7280;
    transition: all 0.3s ease;
    font-size: 0.744rem;
    border-bottom: 3px solid transparent;
}

.opm-nav-tab:hover {
    background: #e5e7eb;
    color: #374151;
}

.opm-nav-tab.active {
    background: #ffffff;
    color: #3b82f6;
    border-bottom: 3px solid #3b82f6;
    transform: translateY(2px);
}

/* Tab Content */
.opm-tab-content {
    display: none;
}

.opm-tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Header Styles */
.opm-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 2px solid #f3f4f6;
}

.opm-header-left h2 {
    margin: 0 0 8px 0;
    color: #1f2937;
    font-size: 1.912rem;
    font-weight: 595;
    line-height: 1.2;
}

.opm-header-subtitle {
    color: #6b7280;
    font-size: 0.935rem;
    margin: 0;
}

.opm-header-controls {
    display: flex;
    gap: 16px;
    align-items: center;
    flex-wrap: wrap;
}

/* Profile Header */
.opm-profile-header {
    text-align: center;
    margin-bottom: 32px;
}

.opm-profile-header h2 {
    color: #1f2937;
    font-size: 1.7rem;
    margin-bottom: 8px;
}

.opm-profile-header p {
    color: #6b7280;
    font-size: 0.935rem;
    margin: 0;
}

/* Auto-reload Toggle */
.opm-auto-reload-control {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 16px;
    background: #f9fafb;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

.opm-toggle {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 24px;
}

.opm-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.opm-toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #d1d5db;
    transition: 0.3s;
    border-radius: 24px;
}

.opm-toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.opm-toggle input:checked + .opm-toggle-slider {
    background-color: #10b981;
}

.opm-toggle input:checked + .opm-toggle-slider:before {
    transform: translateX(24px);
}

.opm-toggle-label {
    font-size: 0.744rem;
    color: #374151;
    font-weight: 425;
}

/* Statistics Grid */
.opm-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

.opm-stat-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    padding: 24px;
    color: white;
    display: flex;
    align-items: center;
    gap: 20px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    overflow: hidden;
}

.opm-stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.opm-stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0.05) 100%);
    pointer-events: none;
}

.opm-stat-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.opm-stat-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.opm-stat-warning {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

.opm-stat-info {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
}

.opm-stat-icon {
    font-size: 2.125rem;
    opacity: 0.9;
}

.opm-stat-content h3 {
    margin: 0 0 8px 0;
    font-size: 0.85rem;
    font-weight: 510;
    opacity: 0.9;
}

.opm-stat-number {
    margin: 0;
    font-size: 1.7rem;
    font-weight: 595;
    line-height: 1;
}

/* Reports Styles */
.opm-reports-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

.opm-report-card {
    background: #ffffff;
    border-radius: 12px;
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 20px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    border: 1px solid #e5e7eb;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    overflow: hidden;
}

.opm-report-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.opm-report-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--report-color);
}

.opm-report-primary {
    --report-color: #3b82f6;
}

.opm-report-dispatched {
    --report-color: #f59e0b;
}

.opm-report-success {
    --report-color: #10b981;
}

.opm-report-danger {
    --report-color: #ef4444;
}

.opm-report-revenue {
    --report-color: #059669;
}

.opm-report-cost {
    --report-color: #dc2626;
}

.opm-report-item-cost {
    --report-color: #7c3aed;
}

.opm-report-profit {
    --report-color: #16a34a;
}

.opm-report-icon {
    font-size: 2.125rem;
    color: var(--report-color);
    opacity: 0.8;
}

.opm-report-content {
    flex: 1;
}

.opm-report-content h3 {
    margin: 0 0 4px 0;
    font-size: 0.935rem;
    font-weight: 595;
    color: #1f2937;
}

.opm-report-subtitle {
    margin: 0 0 8px 0;
    font-size: 0.744rem;
    color: #6b7280;
    line-height: 1.2;
}

.opm-report-number {
    margin: 0;
    font-size: 1.594rem;
    font-weight: 595;
    color: var(--report-color);
    line-height: 1;
}

.opm-currency {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
}

/* Profit Breakdown */
.opm-report-breakdown {
    background: #ffffff;
    border-radius: 12px;
    padding: 32px;
    margin-bottom: 24px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    border: 1px solid #e5e7eb;
}

.opm-report-breakdown h3 {
    margin: 0 0 24px 0;
    color: #1f2937;
    font-size: 1.275rem;
    font-weight: 595;
}

.opm-breakdown-formula {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.opm-breakdown-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: #f9fafb;
    border-radius: 8px;
    border-left: 4px solid #e5e7eb;
}

.opm-breakdown-item.breakdown-minus {
    border-left-color: #ef4444;
    background: #fef2f2;
}

.opm-breakdown-item.breakdown-result {
    border-left-color: #10b981;
    background: #f0fdf4;
    border: 2px solid #10b981;
    font-size: 0.935rem;
}

.opm-breakdown-label {
    color: #374151;
    font-weight: 425;
}

.opm-breakdown-value {
    color: #1f2937;
    font-weight: 595;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
}

/* Report Info */
.opm-report-info {
    background: #f8fafc;
    border-radius: 8px;
    padding: 20px;
    border-left: 4px solid #3b82f6;
}

.opm-report-note {
    margin: 0;
    color: #374151;
    line-height: 1.6;
}

/* Filter Label */
.opm-filter-label {
    font-weight: 510;
    color: #374151;
    margin-right: 8px;
    white-space: nowrap;
}

/* Fake Customer Warning */
.opm-fake-customer-warning {
    background: linear-gradient(135deg, #fee2e2, #fecaca);
    border: 2px solid #ef4444;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 24px;
    animation: warningPulse 2s ease-in-out infinite;
}

@keyframes warningPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4); }
    50% { box-shadow: 0 0 0 10px rgba(239, 68, 68, 0); }
}

.opm-warning-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    font-size: 0.935rem;
    font-weight: 595;
    color: #991b1b;
}

.opm-warning-icon {
    font-size: 1.275rem;
    animation: warningShake 0.5s ease-in-out infinite;
}

@keyframes warningShake {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(-5deg); }
    75% { transform: rotate(5deg); }
}

.opm-warning-content {
    color: #991b1b;
}

.opm-warning-content p {
    margin: 0 0 12px 0;
    line-height: 1.5;
}

.opm-warning-advice {
    font-weight: 510;
    background: rgba(239, 68, 68, 0.1);
    padding: 12px;
    border-radius: 8px;
    border-left: 4px solid #ef4444;
}

.opm-failed-order-item {
    background: rgba(255, 255, 255, 0.8);
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 8px;
    border-left: 4px solid #ef4444;
}

.opm-failed-order-item:last-child {
    margin-bottom: 0;
}

.opm-failed-order-header {
    font-weight: 510;
    color: #991b1b;
    margin-bottom: 4px;
}

.opm-failed-order-details {
    font-size: 0.744rem;
    color: #7c2d12;
    line-height: 1.4;
}

/* Tracking Status Styles */
.opm-tracking-status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.637rem;
    font-weight: 510;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
    transition: all 0.3s ease;
}

.opm-tracking-status.pending {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #f59e0b;
}

.opm-tracking-status.picked-up {
    background: #dbeafe;
    color: #1e40af;
    border: 1px solid #3b82f6;
}

.opm-tracking-status.in-transit {
    background: #e0e7ff;
    color: #3730a3;
    border: 1px solid #6366f1;
}

.opm-tracking-status.out-for-delivery {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #f59e0b;
}

.opm-tracking-status.delivered {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #10b981;
}

.opm-tracking-status.failed {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #ef4444;
}

.opm-tracking-status.rescheduled {
    background: #f3e8ff;
    color: #7c3aed;
    border: 1px solid #8b5cf6;
}

.opm-tracking-status.return-to-client {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #f59e0b;
}

.opm-tracking-status.return-to-origin {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #ef4444;
}

.opm-tracking-status.received-origin-failed {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #ef4444;
}

.opm-tracking-status.received-failed-order {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #ef4444;
}

.opm-tracking-status.return-to-destination {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #f59e0b;
}

.opm-tracking-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
    animation: trackingPulse 2s ease-in-out infinite;
}

@keyframes trackingPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(1.2); }
}

/* Tracking Sync Button */
.opm-tracking-sync-btn {
    position: relative;
    overflow: hidden;
}

.opm-tracking-sync-btn.syncing {
    color: #3b82f6;
    pointer-events: none;
}

.opm-tracking-sync-btn.syncing::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(59, 130, 246, 0.2), transparent);
    animation: trackingSyncShine 1.5s ease-in-out infinite;
}

@keyframes trackingSyncShine {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* Tracking Results Modal */
.opm-tracking-results-summary {
    background: #f0fdf4;
    border: 1px solid #10b981;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 16px;
    font-weight: 510;
    color: #065f46;
}

.opm-tracking-results-details {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #f9fafb;
}

.opm-tracking-result-item {
    padding: 12px 16px;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background-color 0.3s ease;
}

.opm-tracking-result-item:hover {
    background: #f3f4f6;
}

.opm-tracking-result-item:last-child {
    border-bottom: none;
}

.opm-tracking-result-success {
    border-left: 4px solid #10b981;
}

.opm-tracking-result-failed {
    border-left: 4px solid #ef4444;
}

.opm-tracking-result-details {
    flex: 1;
}

.opm-tracking-result-order {
    font-weight: 510;
    color: #1f2937;
    margin-bottom: 4px;
}

.opm-tracking-result-info {
    font-size: 0.744rem;
    color: #6b7280;
}

.opm-tracking-result-status {
    text-align: right;
    font-size: 0.744rem;
}

.opm-tracking-success {
    color: #10b981;
    font-weight: 510;
}

.opm-tracking-failed {
    color: #ef4444;
    font-weight: 510;
}

/* Tracking History Table */
.opm-tracking-history-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 16px;
}

.opm-tracking-history-table th,
.opm-tracking-history-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
}

.opm-tracking-history-table th {
    background: #f9fafb;
    font-weight: 510;
    color: #374151;
    text-transform: uppercase;
    font-size: 0.637rem;
    letter-spacing: 0.05em;
}

.opm-tracking-history-table tr:hover {
    background: #f9fafb;
}

/* Tracking Timeline */
.opm-tracking-timeline {
    position: relative;
    padding: 20px 0;
}

.opm-tracking-timeline::before {
    content: '';
    position: absolute;
    left: 20px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #e5e7eb;
}

.opm-tracking-timeline-item {
    position: relative;
    padding-left: 60px;
    margin-bottom: 20px;
}

.opm-tracking-timeline-item::before {
    content: '';
    position: absolute;
    left: 14px;
    top: 8px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #3b82f6;
    border: 3px solid #ffffff;
    box-shadow: 0 0 0 3px #3b82f6;
}

.opm-tracking-timeline-item.active::before {
    background: #10b981;
    box-shadow: 0 0 0 3px #10b981;
}

.opm-tracking-timeline-item.failed::before {
    background: #ef4444;
    box-shadow: 0 0 0 3px #ef4444;
}

.opm-tracking-timeline-content {
    background: #ffffff;
    border-radius: 8px;
    padding: 16px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.opm-tracking-timeline-status {
    font-weight: 510;
    color: #1f2937;
    margin-bottom: 4px;
}

.opm-tracking-timeline-time {
    font-size: 0.744rem;
    color: #6b7280;
    margin-bottom: 8px;
}

.opm-tracking-timeline-details {
    font-size: 0.744rem;
    color: #4b5563;
}

/* SMS Styles */
.opm-sms-preview {
    background: #f8fafc;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 16px;
    font-family: 'Courier New', monospace;
    white-space: pre-wrap;
    line-height: 1.5;
}

.opm-sms-preview-content {
    background: #ffffff;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    padding: 12px;
    min-height: 80px;
    color: #1f2937;
}

.opm-selected-orders-info {
    background: #dbeafe;
    border: 1px solid #3b82f6;
    border-radius: 6px;
    padding: 12px;
    margin-bottom: 16px;
}

.opm-selected-orders-info p {
    margin: 4px 0;
    color: #1e40af;
}

.opm-sms-results-summary {
    background: #f0fdf4;
    border: 1px solid #10b981;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 16px;
}

.opm-sms-results-details {
    max-height: 400px;
    overflow-y: auto;
}

.opm-sms-result-item {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 12px;
    margin-bottom: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.opm-sms-result-success {
    border-left: 4px solid #10b981;
    background: #f0fdf4;
}

.opm-sms-result-failed {
    border-left: 4px solid #ef4444;
    background: #fef2f2;
}

.opm-sms-logs-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 16px;
}

.opm-sms-logs-table th,
.opm-sms-logs-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
}

.opm-sms-logs-table th {
    background: #f9fafb;
    font-weight: 510;
    color: #374151;
    text-transform: uppercase;
    font-size: 0.637rem;
    letter-spacing: 0.05em;
}

.opm-sms-status-sent {
    color: #059669;
    font-weight: 510;
}

.opm-sms-status-failed {
    color: #dc2626;
    font-weight: 510;
}

.opm-sms-message-preview {
    max-width: 300px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-family: 'Courier New', monospace;
    font-size: 0.744rem;
    background: #f3f4f6;
    padding: 4px 8px;
    border-radius: 4px;
}

/* SMS Sending Results Popup */
.opm-sms-results-summary {
    margin-bottom: 24px;
    padding: 16px;
    font-size: 0.85rem;
}

.opm-sms-results-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 16px;
    background: #f9fafb;
}

.opm-sms-result-item {
    background: #ffffff;
    padding: 12px 16px;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.opm-sms-result-details {
    display: flex;
    flex-direction: column;
}

.opm-sms-result-customer {
    font-weight: 510;
    color: #1f2937;
}

.opm-sms-result-order {
    font-size: 0.744rem;
    color: #6b7280;
}

.opm-sms-result-status {
    font-weight: 510;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.68rem;
}

.opm-sms-result-success {
    color: #065f46;
    background-color: #d1fae5;
}

.opm-sms-result-failed {
    color: #991b1b;
    background-color: #fee2e2;
}

/* Curfox Dispatch Styles */
.opm-dispatch-preview {
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 16px;
    margin: 16px 0;
    max-height: 400px;
    overflow-y: auto;
}

.opm-dispatch-preview h4 {
    margin: 0 0 16px 0;
    color: #1f2937;
    font-size: 0.935rem;
}

.opm-dispatch-orders-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.opm-dispatch-order-item {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 12px;
    transition: all 0.3s ease;
}

.opm-dispatch-order-item:hover {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.opm-dispatch-order-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    padding-bottom: 8px;
    border-bottom: 1px solid #f3f4f6;
}

.opm-dispatch-order-header strong {
    color: #1f2937;
    font-size: 0.85rem;
}

.opm-dispatch-order-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 8px;
    font-size: 0.744rem;
    color: #4b5563;
}

.opm-dispatch-order-details > div {
    padding: 2px 0;
}

.opm-dispatch-order-details strong {
    color: #374151;
    font-weight: 510;
}

.opm-dispatch-results-summary {
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 16px;
}

.opm-dispatch-results-summary h4 {
    margin: 0 0 8px 0;
    font-size: 0.935rem;
}

.opm-dispatch-results-summary p {
    margin: 0;
    line-height: 1.5;
}

.opm-dispatch-waybills {
    background: #f0fdf4;
    border: 1px solid #10b981;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 16px;
}

.opm-dispatch-waybills h4 {
    margin: 0 0 12px 0;
    color: #065f46;
    font-size: 0.85rem;
}

.opm-waybill-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.opm-waybill-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: #ffffff;
    border: 1px solid #d1fae5;
    border-radius: 4px;
}

.opm-waybill-item strong {
    color: #065f46;
}

.opm-waybill-item code {
    background: #065f46;
    color: #ffffff;
    padding: 4px 8px;
    border-radius: 4px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-weight: 510;
    letter-spacing: 0.5px;
}

/* Item Search Container */
.opm-item-search-container {
    position: relative;
}

.opm-item-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #ffffff;
    border: 2px solid #e5e7eb;
    border-top: none;
    border-radius: 0 0 8px 8px;
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.opm-item-suggestion {
    padding: 12px 16px;
    cursor: pointer;
    border-bottom: 1px solid #f3f4f6;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 12px;
}

.opm-item-suggestion:hover {
    background: #f9fafb;
}

.opm-item-suggestion:last-child {
    border-bottom: none;
}

.opm-item-suggestion-image {
    width: 40px;
    height: 40px;
    border-radius: 6px;
    object-fit: cover;
    background: #f3f4f6;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.02rem;
    color: #6b7280;
}

.opm-item-suggestion-details {
    flex: 1;
}

.opm-item-suggestion-name {
    font-weight: 510;
    color: #1f2937;
    margin-bottom: 4px;
}

.opm-item-suggestion-info {
    font-size: 0.744rem;
    color: #6b7280;
    display: flex;
    gap: 16px;
}

.opm-item-suggestion-price {
    font-weight: 510;
    color: #059669;
}

.opm-no-suggestions {
    padding: 16px;
    text-align: center;
    color: #6b7280;
    font-style: italic;
}

.opm-no-items-selected {
    padding: 24px;
    text-align: center;
    color: #6b7280;
    font-style: italic;
    background: #f9fafb;
    border-radius: 8px;
    border: 2px dashed #e5e7eb;
}

/* Selected Items Container */
.opm-selected-items-container {
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    background: #f9fafb;
    min-height: 120px;
}

.opm-selected-items-list {
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    padding: 1rem;
    min-height: 100px;
    max-height: 300px;
    overflow-y: auto;
    overflow-x: auto;
}

.opm-selected-item {
    display: flex;
    align-items: center;
    padding: 0.5rem;
    border-bottom: 1px solid #e5e7eb;
    gap: 1rem;
    min-width: 400px;
}

.opm-selected-item:hover {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.opm-selected-item:last-child {
    margin-bottom: 0;
}

.opm-selected-item-image {
    width: 40px;
    height: 40px;
    border-radius: 6px;
    object-fit: cover;
    background: #f3f4f6;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.02rem;
    color: #6b7280;
    flex-shrink: 0;
}

.opm-selected-item-details {
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.opm-selected-item-name {
    font-weight: 510;
    color: #1f2937;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    word-wrap: normal;
}

.opm-selected-item-info {
    font-size: 0.744rem;
    color: #6b7280;
    display: flex;
    gap: 16px;
    flex-wrap: nowrap;
}

.opm-selected-item-price {
    font-weight: 510;
    color: #059669;
}

.opm-selected-item-quantity {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
    flex-shrink: 0;
}

.opm-quantity-btn {
    width: 28px;
    height: 28px;
    border: 1px solid #d1d5db;
    background: #ffffff;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 510;
    color: #374151;
    transition: all 0.3s ease;
}

.opm-quantity-btn:hover {
    background: #f3f4f6;
    border-color: #9ca3af;
}

.opm-quantity-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.opm-quantity-input {
    width: 50px;
    text-align: center;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    padding: 4px;
    font-size: 0.744rem;
}

.opm-remove-item-btn {
    background: #ef4444;
    color: white;
    border: none;
    border-radius: 4px;
    width: 28px;
    height: 28px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.opm-remove-item-btn:hover {
    background: #dc2626;
    transform: scale(1.05);
}

.opm-selected-items-actions {
    padding: 16px;
    border-top: 1px solid #e5e7eb;
    background: #f8fafc;
    text-align: center;
}

/* Order Summary */
.opm-order-summary {
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 16px;
}

.opm-summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #e5e7eb;
}

.opm-summary-row:last-child {
    border-bottom: none;
    font-weight: 510;
    font-size: 0.935rem;
    color: #059669;
}

.omp-summary-value {
    font-weight: 510;
    color: #1f2937;
    font-size: 0.935rem;
}

.opm-summary-row span:first-child {
    color: #374151;
}

.opm-summary-row span:last-child {
    font-weight: 510;
    color: #1f2937;
}

/* Forms */
.opm-form {
    background: #f9fafb;
    padding: 32px;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
}

.opm-form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
    margin-bottom: 24px;
}

.opm-form-group {
    display: flex;
    flex-direction: column;
}

.opm-form-group label {
    font-weight: 510;
    margin-bottom: 8px;
    color: #374151;
    font-size: 0.744rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.opm-form-group input,
.opm-form-group select,
.opm-form-group textarea {
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 0.85rem;
    transition: all 0.3s ease;
    background: #ffffff;
    font-family: inherit;
}

.opm-form-group input:focus,
.opm-form-group select:focus,
.opm-form-group textarea:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    background: #ffffff;
}

.opm-form-group input:required:invalid {
    border-color: #ef4444;
}

.opm-form-group input:required:valid {
    border-color: #10b981;
}

.opm-form-group input::placeholder,
.opm-form-group textarea::placeholder {
    color: #9ca3af;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 11.9px;
}

/* Searchable dropdown styles */
.searchable-dropdown {
    position: relative;
    width: 100%;
}

.searchable-dropdown input {
    width: 100%;
    padding: 8px 30px 8px 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 11.9px;
    background-color: white;
    cursor: pointer;
}

.searchable-dropdown input:focus {
    outline: none;
    border-color: #007cba;
    box-shadow: 0 0 0 1px #007cba;
}

.searchable-dropdown .dropdown-arrow {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    color: #666;
    font-size: 10.2px;
}

.searchable-dropdown .dropdown-list {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #ddd;
    border-top: none;
    border-radius: 0 0 4px 4px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
}

.searchable-dropdown .dropdown-list.show {
    display: block;
}

.searchable-dropdown .dropdown-item {
    padding: 8px 12px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    font-size: 11.9px;
}

.searchable-dropdown .dropdown-item:hover {
    background-color: #f5f5f5;
}

.searchable-dropdown .dropdown-item.selected {
    background-color: #007cba;
    color: white;
}

.searchable-dropdown .dropdown-item:last-child {
    border-bottom: none;
}

.searchable-dropdown .no-results {
    padding: 8px 12px;
    color: #666;
    font-style: italic;
    text-align: center;
}

.form-group textarea {
    height: 100px;
    resize: vertical;
}

/* Buttons */
.opm-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 0.744rem;
    font-weight: 510;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-width: 120px;
    position: relative;
    overflow: hidden;
}

.opm-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

.opm-btn-primary {
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    color: white;
    box-shadow: 0 4px 6px -1px rgba(59, 130, 246, 0.3);
}

.opm-btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, #1d4ed8, #3b82f6);
    transform: translateY(-2px);
    box-shadow: 0 8px 15px -3px rgba(59, 130, 246, 0.4);
}

.opm-btn-secondary {
    background: #6b7280;
    color: white;
    box-shadow: 0 4px 6px -1px rgba(107, 114, 128, 0.3);
}

.opm-btn-secondary:hover:not(:disabled) {
    background: #4b5563;
    transform: translateY(-2px);
    box-shadow: 0 8px 15px -3px rgba(107, 114, 128, 0.4);
}

.opm-btn-danger {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
    box-shadow: 0 4px 6px -1px rgba(239, 68, 68, 0.3);
}

.opm-btn-danger:hover:not(:disabled) {
    background: linear-gradient(135deg, #dc2626, #ef4444);
    transform: translateY(-2px);
    box-shadow: 0 8px 15px -3px rgba(239, 68, 68, 0.4);
}

.opm-btn-success {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    box-shadow: 0 4px 6px -1px rgba(16, 185, 129, 0.3);
}

.opm-btn-success:hover:not(:disabled) {
    background: linear-gradient(135deg, #059669, #10b981);
    transform: translateY(-2px);
    box-shadow: 0 8px 15px -3px rgba(16, 185, 129, 0.4);
}

.opm-btn-loading {
    display: none;
}

.opm-btn.loading .opm-btn-text {
    display: none;
}

.opm-btn.loading .opm-btn-loading {
    display: inline;
}

.btn-primary:hover {
    background-color: #0056b3;
    border-color: #0056b3;
}

.btn-success {
    background-color: #28a745;
    border-color: #28a745;
    color: white;
    padding: 8px 16px;
    border-radius: 4px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 11.9px;
    transition: all 0.2s ease;
}

.btn-success:hover {
    background-color: #218838;
    border-color: #1e7e34;
    color: white;
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.btn-success:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.ms-2 {
    margin-left: 0.5rem;
}

/* Form Actions */
.opm-form-actions {
    display: flex;
    gap: 16px;
    justify-content: flex-end;
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid #e5e7eb;
}

/* Form Sections */
.opm-form-section {
    margin-bottom: 32px;
    padding: 32px;
    background: #ffffff;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
}

.opm-form-section h3 {
    margin-top: 0;
    margin-bottom: 24px;
    color: #1f2937;
    font-size: 1.275rem;
    font-weight: 595;
}

/* Filters Section */
.opm-filters-section {
    background: #ffffff;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
}

.opm-filters-row {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.opm-search-group {
    display: flex;
    flex: 1;
    min-width: 300px;
    position: relative;
}

.opm-search-input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 8px 0 0 8px;
    font-size: 0.85rem;
    transition: all 0.3s ease;
}

.opm-search-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.opm-search-btn {
    padding: 12px 16px;
    background: #3b82f6;
    color: white;
    border: none;
    border-radius: 0 8px 8px 0;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.85rem;
}

.opm-search-btn:hover {
    background: #1d4ed8;
}

.opm-filter-group {
    display: flex;
    align-items: center;
}

.opm-filter-select {
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 0.744rem;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
}

.opm-filter-select:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Date Filter Styles */
.opm-filter-group input[type="date"] {
    padding: 8px 12px;
    border: 2px solid #e5e7eb;
    border-radius: 6px;
    font-size: 0.744rem;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #374151;
}

.opm-filter-group input[type="date"]:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.opm-filter-group input[type="date"]::-webkit-calendar-picker-indicator {
    cursor: pointer;
    filter: invert(0.5);
}

.opm-filter-group input[type="date"]:hover::-webkit-calendar-picker-indicator {
    filter: invert(0.3);
}

/* Active Date Filter Indicator */
#active-date-filter {
    animation: slideDown 0.3s ease;
}

#active-date-filter button:hover {
    background: rgba(59, 130, 246, 0.1) !important;
    border-radius: 4px;
}

/* Orders/Items Table */
.opm-orders-table-container,
.opm-items-table-container {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    border: 1px solid #e5e7eb;
    margin-bottom: 24px;
    position: relative;
}

.opm-orders-table-scroll,
.opm-items-table-scroll {
    overflow-x: auto;
    overflow-y: hidden;
    max-width: 100%;
    position: relative;
    border-radius: 12px;
}

.opm-orders-table,
.opm-items-table {
    width: auto;
    min-width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.744rem;
    table-layout: auto;
    white-space: nowrap;
}

.opm-orders-table th,
.opm-items-table th {
    background: linear-gradient(135deg, #f8fafc, #f1f5f9);
    color: #374151;
    font-weight: 595;
    padding: 12px 8px;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
    border-right: 1px solid #e5e7eb;
    position: sticky;
    top: 0;
    z-index: 10;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 0.637rem;
    min-width: fit-content;
}

.opm-orders-table th.sortable {
    cursor: pointer;
    transition: all 0.3s ease;
}

.opm-orders-table th.sortable:hover {
    background: linear-gradient(135deg, #f1f5f9, #e2e8f0);
}

.opm-orders-table td,
.opm-items-table td {
    padding: 12px 8px;
    border-bottom: 1px solid #f3f4f6;
    border-right: 1px solid #f3f4f6;
    vertical-align: middle;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
}

/* Allow text wrapping for content-heavy columns */
.opm-orders-table td:nth-child(4), /* ITEM */
.opm-orders-table td:nth-child(10), /* CUSTOMER */
.opm-orders-table td:nth-child(11), /* ADDRESS */
.opm-orders-table td:nth-child(15) /* NOTE */ {
    white-space: normal;
    word-wrap: break-word;
    overflow-wrap: break-word;
    line-height: 1.3;
    max-width: 150px;
}

/* Actions column styles */
.opm-orders-table td:last-child,
.opm-items-table td:last-child {
    display: flex;
    flex-direction: column;
    gap: 4px;
    justify-content: center;
    align-items: stretch;
    padding: 8px;
    min-width: 120px;
    overflow: visible;
}

.opm-orders-table td:last-child .opm-btn,
.opm-items-table td:last-child .opm-btn {
    margin: 0 !important; /* override inline margin-right */
    width: 100%;
    min-width: auto;
}

/* Status column styling */
.opm-orders-table td:nth-child(18) { /* STATUS column */
    min-width: 120px;
    text-align: center;
}

.opm-orders-table tr:hover,
.opm-items-table tr:hover {
    background-color: #f9fafb;
}

.opm-orders-table tr:last-child td,
.opm-items-table tr:last-child td {
    border-bottom: none;
}

/* Delivery Failed Row Highlighting */
.opm-delivery-failed-row {
    background-color: #fee2e2 !important;
    border-left: 4px solid #ef4444;
}

.opm-delivery-failed-row:hover {
    background-color: #fecaca !important;
}

/* Items specific styles */
.opm-no-image {
    width: 40px;
    height: 40px;
    background: #f3f4f6;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.02rem;
    color: #6b7280;
}

.text-success {
    color: #059669 !important;
}

.text-danger {
    color: #dc2626 !important;
}

/* Status Badges */
.opm-status-badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.637rem;
    font-weight: 510;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
    display: inline-block;
    transition: all 0.3s ease;
}

.opm-status-pending {
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    color: #92400e;
    border: 1px solid #f59e0b;
}

.opm-status-confirmed {
    background: linear-gradient(135deg, #d1fae5, #a7f3d0);
    color: #065f46;
    border: 1px solid #10b981;
}

.opm-status-delivered {
    background: linear-gradient(135deg, #d1fae5, #a7f3d0);
    color: #065f46;
    border: 1px solid #10b981;
}

.opm-status-Cancelled,
.opm-status-no-answer-Cancelled,
.opm-status-delivery-failed {
    background: linear-gradient(135deg, #fee2e2, #fecaca);
    color: #991b1b;
    border: 1px solid #ef4444;
}

.opm-status-dispatched {
    background: linear-gradient(135deg, #dbeafe, #bfdbfe);
    color: #1e40af;
    border: 1px solid #3b82f6;
}

.opm-status-default {
    background: linear-gradient(135deg, #f3f4f6, #e5e7eb);
    color: #374151;
    border: 1px solid #9ca3af;
}

/* Inline Editing */
.opm-inline-edit {
    cursor: pointer;
    position: relative;
    padding: 8px;
    border-radius: 6px;
    transition: all 0.3s ease;
    min-height: 32px;
    display: inline-block;
    width: 100%;
}

.opm-inline-edit:hover {
    background-color: #f3f4f6;
    border: 2px dashed #3b82f6;
}

.opm-inline-edit.editing {
    background-color: #ffffff;
    border: 2px solid #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.opm-inline-edit input,
.opm-inline-edit select,
.opm-inline-edit textarea {
    width: 100%;
    border: none;
    background: transparent;
    padding: 4px;
    font-size: 0.744rem;
    font-family: inherit;
    resize: none;
}

.opm-inline-edit input:focus,
.opm-inline-edit select:focus,
.opm-inline-edit textarea:focus {
    outline: none;
}

.opm-empty-value {
    color: #9ca3af;
    font-style: italic;
    font-size: 0.637rem;
}

/* Pagination */
.opm-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 24px;
    padding: 24px;
}

.opm-pagination .opm-btn {
    padding: 8px 16px;
    min-width: auto;
    font-size: 0.744rem;
}

.opm-pagination .opm-btn.active {
    background: #3b82f6;
    color: white;
}

/* Modal */
.opm-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.opm-modal-content {
    background-color: #ffffff;
    margin: 2% auto;
    padding: 0;
    border-radius: 12px;
    width: 90%;
    max-width: 900px;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalSlideIn 0.3s ease;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.opm-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 32px;
    border-bottom: 1px solid #e5e7eb;
    background: linear-gradient(135deg, #f8fafc, #f1f5f9);
    border-radius: 12px 12px 0 0;
}

.opm-modal-header h3 {
    margin: 0;
    color: #1f2937;
    font-size: 1.062rem;
    font-weight: 595;
}

.opm-error-messages {
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 4px;
}

.opm-success-messages {
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 4px;
}

.opm-error-messages h4,
.opm-success-messages h4 {
    margin: 0 0 10px 0;
    font-size: 11.9px;
    font-weight: bold;
}

.opm-error-messages ul,
.opm-success-messages ul {
    margin: 0;
    padding-left: 20px;
}

.opm-error-messages li,
.opm-success-messages li {
    margin-bottom: 5px;
    font-size: 11.05px;
}

.opm-close {
    font-size: 20.4px;
    font-weight: bold;
    cursor: pointer;
    color: #9ca3af;
    transition: color 0.3s ease;
    padding: 4px;
    border-radius: 4px;
}

.opm-close:hover {
    color: #374151;
    background: #f3f4f6;
}

.opm-modal-body {
    padding: 32px;
}

/* Loading States */
.opm-loading {
    text-align: center;
    padding: 48px;
    color: #6b7280;
    font-size: 0.935rem;
}

.opm-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    backdrop-filter: blur(2px);
}

.opm-loading-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid #e5e7eb;
    border-top: 4px solid #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 16px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Alerts */
.opm-alert {
    padding: 16px 20px;
    margin-bottom: 24px;
    border-radius: 8px;
    font-weight: 425;
    border-left: 4px solid;
}

.opm-alert-success {
    color: #065f46;
    background-color: #d1fae5;
    border-color: #10b981;
}

.opm-alert-error {
    color: #991b1b;
    background-color: #fee2e2;
    border-color: #ef4444;
}

.opm-alert-info {
    color: #1e40af;
    background-color: #dbeafe;
    border-color: #3b82f6;
}

.opm-alert-warning {
    color: #92400e;
    background-color: #fef3c7;
    border-color: #f59e0b;
}

/* Login Notice */
.opm-login-notice {
    text-align: center;
    padding: 48px;
    background: #ffffff;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.opm-login-notice p {
    color: #6b7280;
    font-size: 0.935rem;
    margin: 0;
}

/* Admin Styles */
.opm-admin-wrap {
    background: #f8fafc;
    min-height: 100vh;
    padding: 20px;
}

.opm-admin-header {
    background: #ffffff;
    padding: 32px;
    border-radius: 12px;
    margin-bottom: 24px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    border: 1px solid #e5e7eb;
}

.opm-admin-header h1 {
    margin: 0 0 8px 0;
    color: #1f2937;
    font-size: 1.912rem;
    font-weight: 595;
}

.opm-admin-subtitle {
    color: #6b7280;
    font-size: 0.935rem;
    margin: 0;
}

/* Admin Tabs */
.opm-admin-tabs {
    display: flex;
    background: #ffffff;
    border-radius: 12px;
    padding: 8px;
    margin-bottom: 24px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    border: 1px solid #e5e7eb;
    gap: 4px;
}

.opm-tab-button {
    flex: 1;
    padding: 12px 20px;
    background: transparent;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 510;
    color: #6b7280;
    transition: all 0.3s ease;
    font-size: 0.744rem;
}

.opm-tab-button:hover {
    background: #f3f4f6;
    color: #374151;
}

.opm-tab-button.active {
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    color: white;
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.3);
}

.opm-admin-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

.opm-admin-stat-card {
    background: #ffffff;
    border-radius: 12px;
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 20px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    border: 1px solid #e5e7eb;
    transition: all 0.3s ease;
}

.opm-admin-stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.opm-admin-controls {
    background: #ffffff;
    padding: 24px;
    border-radius: 12px;
    margin-bottom: 24px;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
    border: 1px solid #e5e7eb;
}

.opm-admin-filters {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.opm-admin-section {
    background: #ffffff;
    padding: 32px;
    border-radius: 12px;
    margin-bottom: 24px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    border: 1px solid #e5e7eb;
}

.opm-admin-section h2 {
    margin: 0 0 24px 0;
    color: #1f2937;
    font-size: 1.275rem;
    font-weight: 595;
}

.opm-recent-table {
    margin-top: 16px;
}

.opm-recent-table th,
.opm-recent-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
}

.opm-recent-table th {
    background: #f9fafb;
    font-weight: 510;
    color: #374151;
    text-transform: uppercase;
    font-size: 0.637rem;
    letter-spacing: 0.05em;
}

.opm-no-orders {
    text-align: center;
    padding: 48px;
    color: #6b7280;
}

/* Delete All Orders Modal Styles */
.opm-delete-all-info {
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
}

.opm-delete-all-info h4 {
    color: #991b1b;
    margin: 0 0 12px 0;
    font-size: 0.935rem;
}

.opm-delete-all-info ul {
    margin: 0;
    padding-left: 20px;
    color: #7c2d12;
}

.opm-delete-all-info li {
    margin-bottom: 8px;
    line-height: 1.4;
}

.opm-confirmation-section {
    background: #fff7ed;
    border: 2px solid #fed7aa;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
}

.opm-confirmation-section h4 {
    color: #9a3412;
    margin: 0 0 12px 0;
    font-size: 0.935rem;
}

.opm-confirmation-section p {
    color: #7c2d12;
    margin: 8px 0;
    line-height: 1.5;
}

.opm-checkbox-group {
    margin: 16px 0;
}

.opm-checkbox-group label {
    color: #7c2d12;
    font-weight: 425;
    cursor: pointer;
    user-select: none;
}

.opm-checkbox-group input[type="checkbox"] {
    margin-right: 8px;
    cursor: pointer;
}

#deleteAllConfirmation {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-weight: 510;
    text-transform: uppercase;
    letter-spacing: 1px;
}

#deleteAllConfirmation:focus {
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2) !important;
}

#confirmDeleteAllBtn:disabled {
    background: #9ca3af !important;
    cursor: not-allowed !important;
    transform: none !important;
    box-shadow: none !important;
}

/* Bulk Actions */
.opm-bulk-actions {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: #f9fafb;
    border-top: 1px solid #e5e7eb;
}

.opm-bulk-info {
    color: #6b7280;
    font-size: 0.744rem;
    font-style: italic;
}

/* Checkbox styling */
.order-checkbox,
.item-checkbox,
.dispatch-checkbox,
#select-all-orders,
#select-all-items,
#select-all-dispatch {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

/* Checkbox styling for dispatched orders table */
.dispatched-order-checkbox,
#select-all-dispatched {
    cursor: pointer;
}

#select-all-dispatched:indeterminate {
    opacity: 0.6;
}

/* Bulk action button styling */
#bulk-shipping-label-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Table header checkbox alignment */
.table th:first-child {
    width: 80px;
    text-align: center;
}

.table td:first-child {
    text-align: center;
}

/* Tab styles */
.opm-tabs {
    display: flex;
    border-bottom: 2px solid #e9ecef;
    margin-bottom: 20px;
}

.opm-tab {
    padding: 10px 20px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-bottom: none;
    cursor: pointer;
    margin-right: 2px;
    border-radius: 5px 5px 0 0;
    transition: all 0.3s ease;
}

.opm-tab:hover {
    background: #e9ecef;
}

.opm-tab.active {
    background: #fff;
    border-bottom: 2px solid #fff;
    margin-bottom: -2px;
    font-weight: bold;
}

.opm-tab-content {
    display: none;
}

.opm-tab-content.active {
    display: block;
}

/* SMS Log Styles */
.opm-sms-log {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid #dee2e6;
    border-radius: 5px;
    padding: 15px;
    background: #f8f9fa;
}

.opm-sms-log .log-entry {
    padding: 10px;
    margin-bottom: 10px;
    border-left: 4px solid #007bff;
    background: #fff;
    border-radius: 3px;
}

.opm-sms-log .log-entry.success {
    border-left-color: #28a745;
    background-color: #d4edda;
}

.opm-sms-log .log-entry.error {
    border-left-color: #dc3545;
    background-color: #f8d7da;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .opm-hamburger {
    display: flex;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 0.75rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}
	
    .opm-nav-menu {
    position: fixed;
    top: 0;
    left: 0;
    width: 80%; /* Use 100% to span the full viewport width */
    height: 100%; /* Use 100% to span the full viewport height */
    background: white;
    transform: translateX(-100%); /* Keeps the menu hidden off-screen to the left */
    transition: transform 0.3s ease;
    z-index: 999;
    overflow-y: auto; /* Allows scrolling for content taller than the screen */
    
    /* Optional: remove styles that don't fit a full-screen look */
    box-shadow: none;
    border-radius: 0;
}
    
    .opm-nav-menu.show {
        transform: translateX(0);
    }
    
    .opm-nav-list {
        flex-direction: column;
    }
    
    .opm-nav-link {
    padding: 1.25rem 1.50rem 1.00rem 1rem; /* Apply left padding */
    border-bottom: 1px solid #e9ecef;
    border-left: 3px solid transparent;
}
    
    .opm-nav-link.active {
        border-left-color: #667eea;
        border-bottom-color: transparent;
    }
    
    .opm-main-content {
        padding: 1rem;
    }
    
    .opm-nav-header {
        padding: 1rem;
    }
    
    .opm-nav-brand h2 {
        font-size: 1.062rem;
    }
}

@media (max-width: 480px) {
    .opm-nav-link {
        padding: 0.5rem;
    }
    
    .opm-nav-icon {
        width: 18px;
        height: 18px;
        margin-right: 0.5rem;
    }
    
    .opm-main-content {
        padding: 0.75rem;
    }
}

/* Large screens - show desktop tabs */
@media (min-width: 1024px) {
    .opm-desktop-tabs {
        display: flex;
        margin-bottom: 2rem;
        border-radius: 8px;
        overflow: hidden;
    }
}

/* Responsive Design */
@media (max-width: 1024px) {
    .opm-container {
        padding: 16px;
    }
    
    .opm-section {
        padding: 24px;
    }
    
    .opm-header {
        flex-direction: column;
        gap: 16px;
        align-items: flex-start;
    }
    
    .opm-header-controls {
        width: 100%;
        justify-content: flex-start;
    }
    
    .opm-stats-grid,
    .opm-reports-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 16px;
    }
    
    .opm-form-row {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .opm-filters-row {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }
    
    .opm-filter-group {
        flex-direction: column;
        align-items: stretch;
    }
    
    .opm-search-group {
        min-width: auto;
    }
    
    .opm-nav-tabs {
        flex-wrap: wrap;
    }
    
    .opm-admin-tabs {
        flex-wrap: wrap;
    }
    
    .opm-filter-group input[type="date"] {
        width: 100%;
        margin-bottom: 8px;
    }
    
    .opm-filter-group span {
        display: none;
    }
}

@media (max-width: 768px) {
    .opm-container {
        padding: 12px;
    }
    
    .opm-section {
        padding: 20px;
        margin-bottom: 16px;
    }
    
    .opm-header-left h2 {
        font-size: 1.488rem;
    }
    
    .opm-stats-grid,
    .opm-reports-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .opm-stat-card,
    .opm-report-card {
        padding: 20px;
        gap: 16px;
    }
    
    .opm-stat-icon,
    .opm-report-icon {
        font-size: 1.7rem;
    }
    
    .opm-stat-number,
    .opm-report-number {
        font-size: 1.275rem;
    }
    
    .opm-orders-table,
    .opm-items-table {
        min-width: 1200px;
        font-size: 0.637rem;
    }
    
    .opm-orders-table th,
    .opm-orders-table td,
    .opm-items-table th,
    .opm-items-table td {
        padding: 12px 8px;
    }
    
    .opm-form-actions {
        flex-direction: column;
        gap: 12px;
    }
    
    .opm-modal-content {
        width: 95%;
        margin: 5% auto;
    }
    
    .opm-modal-body {
        padding: 24px;
    }
    
    .opm-pagination {
        flex-wrap: wrap;
        gap: 4px;
    }
    
    .opm-nav-tabs {
        flex-direction: column;
    }
    
    .opm-nav-tab {
        border-radius: 8px;
        margin-bottom: 4px;
    }
    
    .opm-admin-tabs {
        flex-direction: column;
    }
    
    .opm-tab-button {
        margin-bottom: 4px;
    }
    
    .opm-breakdown-formula {
        gap: 12px;
    }
    
    .opm-breakdown-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .opm-filter-group {
        width: 100%;
    }
    
    .opm-filter-group button {
        width: 100%;
        margin-bottom: 4px;
        padding: 10px 12px;
        font-size: 0.68rem;
        gap: 8px;
    }
    
    .opm-dispatch-order-details {
        grid-template-columns: 1fr;
        gap: 4px;
    }
    
    .opm-waybill-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
}

@media (max-width: 480px) {
    .opm-container {
        padding: 8px;
    }
    
    .opm-section {
        padding: 16px;
        margin-bottom: 12px;
    }
    
    .opm-header-left h2 {
        font-size: 1.275rem;
    }
    
    .opm-header-subtitle {
        font-size: 0.85rem;
    }
    
    .opm-stat-card,
    .opm-report-card {
        padding: 16px;
        gap: 12px;
    }
    
    .opm-stat-icon,
    .opm-report-icon {
        font-size: 1.488rem;
    }
    
    .opm-stat-number,
    .opm-report-number {
        font-size: 1.062rem;
    }
    
    .opm-orders-table,
    .opm-items-table {
        min-width: 1000px;
        font-size: 0.595rem;
    }
    
    .opm-orders-table th,
    .opm-orders-table td,
    .opm-items-table th,
    .opm-items-table td {
        padding: 10px 6px;
    }
    
    .opm-form {
        padding: 20px;
    }
    
    .opm-form-row {
        gap: 12px;
        margin-bottom: 16px;
    }
    
    .opm-btn {
        padding: 10px 16px;
        font-size: 0.68rem;
    }
    
    .opm-dispatch-preview {
        padding: 12px;
    }
    
    .opm-dispatch-order-item {
        padding: 8px;
    }
}

/* Animation Classes */
.slide-down {
    animation: slideDown 0.3s ease;
}

.slide-up {
    animation: slideUp 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideUp {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(-20px);
    }
}

/* Scroll Indicator */
.opm-scroll-indicator {
    text-align: center;
    padding: 12px;
    background: #f9fafb;
    border-top: 1px solid #e5e7eb;
    font-size: 0.637rem;
    color: #6b7280;
    display: block;
    font-weight: 425;
    border-radius: 0 0 12px 12px;
}

/* Print Styles */
@media print {
    .opm-header-controls,
    .opm-filters-section,
    .opm-pagination,
    .opm-btn,
    .opm-modal,
    .opm-nav-tabs {
        display: none !important;
    }
    
    .opm-container {
        background: white;
        box-shadow: none;
    }
    
    .opm-section {
        box-shadow: none;
        border: 1px solid #ccc;
    }
    
    .opm-orders-table,
    .opm-items-table {
        font-size: 0.595rem;
    }
    
    .opm-orders-table th,
    .opm-orders-table td,
    .opm-items-table th,
    .opm-items-table td {
        padding: 8px 4px;
    }
}

/*
 * Final Mobile Filter Layout (to match 0002.jpg with corrected HTML)
 * This is the complete and final CSS needed.
 */
@media (max-width: 1024px) {

    /* 1. Main container setup */
    #filters-section .opm-filters-row {
        display: flex;
        flex-wrap: wrap;
        flex-direction: row;
        gap: 12px;
    }

    /* 2. Set the visual order to match the screenshot */
    #filters-section .opm-filters-row > .opm-filter-group:nth-of-type(3) { order: 1; } /* 10 per page */
    #filters-section .opm-filters-row > .opm-filter-group:nth-of-type(2) { order: 2; } /* All Statuses */
    #filters-section .opm-filters-row > .opm-filter-group:nth-of-type(4) { order: 3; } /* Date Range */
    #filters-section .opm-filters-row > .opm-filter-group:nth-of-type(5) { order: 4; } /* Date buttons */
    #filters-section .opm-filters-row > .opm-filter-group:nth-of-type(6) { order: 5; } /* Clear Dates button */
    #export-orders-btn { order: 6; }
    #import-orders-btn { order: 7; }
    #refresh-orders { order: 8; }
    #send-sms-btn { order: 9; }
    #add-order-btn { order: 10; } /* New button order */
    #filters-section .opm-search-group { order: 11; } /* Search Bar (last) */


    /* 3. Style each line precisely */

    /* Line 1: Per Page and Status Dropdowns */
    #filters-section .opm-filters-row > .opm-filter-group:nth-of-type(2),
    #filters-section .opm-filters-row > .opm-filter-group:nth-of-type(3) {
        flex-basis: calc(50% - 6px);
    }
    #filters-section .opm-filters-row > .opm-filter-group .opm-filter-select {
        width: 100%;
    }

    /* Line 2: Date Range label and inputs */
    #filters-section .opm-filters-row > .opm-filter-group:nth-of-type(4) {
        flex-basis: 100%;
        flex-direction: row;
        align-items: center;
        gap: 8px;
    }
     #filters-section .opm-filters-row > .opm-filter-group:nth-of-type(4) span {
        display: none;
    }
    #filters-section .opm-filters-row > .opm-filter-group:nth-of-type(4) input[type="date"] {
        flex-grow: 1; width: auto; margin-bottom: 0;
    }

    /* Line 3: All four Date Shortcut Buttons */
    #filters-section .opm-filters-row > .opm-filter-group:nth-of-type(5),
    #filters-section .opm-filters-row > .opm-filter-group:nth-of-type(6) {
        flex-grow: 1; flex-basis: 0;
    }
    #filters-section .opm-filters-row > .opm-filter-group button {
        flex-grow: 1; width: auto; margin-bottom: 0;
    }

    /* Line 4: Export, Import, and Refresh buttons */
    #export-orders-btn, #import-orders-btn, #refresh-orders {
        flex-basis: calc(33.33% - 8px);
        flex-grow: 1;
    }
    
    /* Line 5: Send SMS and Add New Order buttons */
    #send-sms-btn, #add-order-btn {
        flex-basis: calc(50% - 6px);
        flex-grow: 1;
    }

    /* Line 6: Search Bar */
    #filters-section .opm-search-group {
        flex-basis: 100%;
    }
}

.opm-summary-value-input {
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 0.85rem;
    transition: all 0.3s ease;
    background: #ffffff;
    font-family: inherit;
    font-weight: 510;
    color: #1f2937;
}

/* Duplicate Phone Number Highlight */
.opm-duplicate-phone-row {
    background-color: #FFFEE0 !important;
}

.opm-duplicate-phone-row:hover {
    background-color: #FAF9D2 !important; /* A slightly darker shade for hover */
}

/* Duplicate Phone Number Highlight with Failed Delivery */
.opm-duplicate-phone-failed-row {
    background: linear-gradient(135deg, #F5B0B0 0%, #FFFEE0 100%) !important;
}

.opm-duplicate-phone-failed-row:hover {
    background: linear-gradient(135deg, #F2A7A7 0%, #FAF9D2 100%) !important; /* Darker hover shade */
}

