* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Prevent initial zoom flash and ensure stable viewport */
html {
    -webkit-text-size-adjust: 100% !important;
    -ms-text-size-adjust: 100% !important;
    text-size-adjust: 100% !important;
    /* Ensure viewport stability */
    overflow-x: auto;
    overflow-y: auto;
}

/* Force immediate zoom application to prevent flash */
@media screen and (max-width: 768px) {
    html {
        /* Stabilize viewport during load */
        -webkit-text-size-adjust: none !important;
        -ms-text-size-adjust: none !important;
        text-size-adjust: none !important;
        zoom: 1 !important;
    }
}

body {
    font-family: 'Inter', sans-serif;
    min-height: 100vh;
    color: #333;
    line-height: 1.6;
    position: relative;
    overflow: auto; /* Allow scrolling in both directions */
    /* Enhanced mobile touch support */
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: auto; /* Better mobile scrolling */
    /* Ensure scrolling always works */
    touch-action: auto;
}

/* Desktop zoom - restore for PC users */
@media screen and (min-width: 769px) {
    body {
        zoom: 67%;
    }
}

/* Ship tracking styles */
.ship-info {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
    padding: 8px 12px;
    background: rgba(52, 152, 219, 0.1);
    border-radius: 6px;
    border-left: 3px solid #3498db;
}

.ship-info i {
    color: #3498db;
    font-size: 16px;
}

.ship-info strong {
    color: #2c3e50;
    font-size: 14px;
}

.ship-status-indicator {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    font-weight: 600;
}

.ship-status-loading {
    color: #95a5a6;
    font-size: 12px;
    font-style: italic;
}

.ship-status-unknown {
    color: #95a5a6;
    font-size: 12px;
}

/* Prevent body scrolling when modal is open - desktop only */
@media screen and (min-width: 769px) {
    body.modal-open {
        overflow: hidden;
        position: fixed;
        width: 100%;
        height: 100%;
    }
}

/* Mobile: Enhanced scrolling with modals open */
@media screen and (max-width: 768px) {
    body.modal-open {
        overflow: auto !important;
        position: relative !important;
        width: 100% !important;
        height: auto !important;
        /* Enhanced mobile touch scrolling */
        touch-action: auto !important;
        -webkit-overflow-scrolling: touch !important;
        overscroll-behavior: auto !important;
        /* Keep momentum scrolling working */
        -ms-overflow-style: -ms-autohiding-scrollbar !important;
        scroll-behavior: smooth !important;
    }
    
    /* Essential mobile scrolling fixes */
    html, body {
        touch-action: auto !important;
        -webkit-overflow-scrolling: touch !important;
        overflow-x: auto !important;
        overflow-y: auto !important;
    }
    
    /* Mobile horizontal scrolling for containers */
    .container, .main, .orders-cards-grid {
        touch-action: auto !important;
        -webkit-overflow-scrolling: touch !important;
        overflow-x: auto !important;
    }
      
    /* Fix all modals on mobile (except port lookup which has its own styling) */
    .worker-orders-modal,
    .port-lookup-results {
        /* Force modal to cover actual viewport, not zoomed body */
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        width: 100vw !important;
        height: 100vh !important;
        /* Reset any zoom/transform effects */
        zoom: 1 !important;
        transform: none !important;
        -webkit-transform: none !important;
        /* Center content properly */
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        /* Ensure modal is on top of everything */
        z-index: 10000 !important;
    }
    
    /* Fix modal content for all modals (except port lookup which has its own styling) */
    .worker-orders-modal .modal-content,
    .port-lookup-results .modal-content {
        /* Reset zoom effects for modal content */
        zoom: 1 !important;
        transform: none !important;
        -webkit-transform: none !important;
        /* Proper mobile modal sizing */
        width: 95vw !important;
        max-width: 95vw !important;
        max-height: 90vh !important;
        height: auto !important;
        border-radius: 15px !important;
        margin: 0 !important;
        /* Enhanced mobile scrolling */
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
        /* Ensure modal content is properly visible */
        background: rgba(255, 255, 255, 0.98) !important;
        backdrop-filter: blur(20px) !important;
        box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3) !important;
    }
}

/* Mobile desktop mode - force desktop layout on mobile */
@media screen and (max-width: 768px) {
    html {
        /* Allow mobile to behave like desktop */
        overflow: visible !important;
        -webkit-text-size-adjust: none !important; /* Prevent text scaling */
        -webkit-overflow-scrolling: touch;
        touch-action: auto !important;
        height: auto !important;
        position: static !important;
    }
    
    body {
        /* Force desktop-like appearance on mobile - better readability */
        zoom: 0.55 !important; /* Restored for smooth behavior */
        transform: none !important;
        -webkit-transform: none !important;
        width: 182% !important; /* Compensate for zoom (100% / 0.55) */
        min-width: 1200px !important; /* Force desktop width */
        max-width: none !important;
        font-size: 16px !important; /* Increased from 14px for better readability */
        overflow: visible !important;
        -webkit-overflow-scrolling: touch !important;
        touch-action: auto !important;
        /* Prevent initial zoom flash */
        -webkit-text-size-adjust: none !important;
        -ms-text-size-adjust: none !important;
        text-size-adjust: none !important;
        position: static !important;
        height: auto !important;
        min-height: 100vh !important;
        margin: 0 !important;
        padding: 0 !important;
        left: auto !important;
        top: auto !important;
        right: auto !important;
        bottom: auto !important;
    }
    
    /* Force desktop container layout */
    .container {
        width: 100% !important;
        max-width: 1600px !important; /* Desktop max-width */
        padding: 0 20px !important; /* Desktop padding */
        margin: 0 auto !important; /* Desktop centering */
        box-sizing: border-box !important;
        overflow: visible !important;
        height: auto !important;
        position: static !important;
        /* Ensure container is properly centered within the zoomed body */
        display: block !important;
        min-height: 100vh !important;
    }
    
    /* Force desktop main content area */
    .main {
        overflow: visible !important;
        height: auto !important;
        position: static !important;
    }
    
    /* Enhanced typography for better mobile readability */
    .header {
        font-size: 1.1em !important; /* Slightly larger for readability */
    }
    
    .stat-card {
        font-size: 1.05em !important; /* Slightly larger for readability */
        padding: 14px !important; /* Increased padding */
        line-height: 1.4 !important; /* Better line spacing */
    }
    
    .order-card {
        font-size: 1.05em !important; /* Slightly larger for readability */
        margin: 12px 0 !important; /* Increased margin */
        line-height: 1.5 !important; /* Better line spacing */
        padding: 16px !important; /* Increased padding */
    }
    
    /* Enhance specific text elements */
    .worker-name {
        font-size: 1.1em !important;
        font-weight: 600 !important;
    }
    
    .position-name {
        font-size: 1.05em !important;
        font-weight: 500 !important;
    }
    
    .company-name {
        font-size: 1.05em !important;
        font-weight: 500 !important;
    }
    
    .time-info {
        font-size: 1.02em !important;
    }
    
    /* Force desktop grid layouts with better spacing */
    .orders-grid {
        display: grid !important;
        grid-template-columns: repeat(auto-fit, minmax(400px, 1fr)) !important;
        gap: 22px !important; /* Increased gap for better spacing */
    }
    
    .stats {
        display: flex !important;
        gap: 22px !important; /* Increased gap */
        margin-bottom: 32px !important; /* Increased margin */
    }
    
    /* Enhanced button and input readability */
    button {
        font-size: 1.05em !important;
        padding: 12px 18px !important;
        min-height: 44px !important; /* Better touch target */
    }
    
    input[type="text"],
    input[type="number"],
    select {
        font-size: 1.05em !important;
        padding: 12px 16px !important;
        min-height: 44px !important; /* Better touch target */
        line-height: 1.4 !important;
    }
    

    
    /* Enhanced filter section */
    .filters-container {
        padding: 18px !important;
        margin-bottom: 22px !important;
    }
    
    .search-box {
        margin-bottom: 16px !important;
    }
    
    .port-lookup-section {
        margin: 16px 0 !important;
    }
    
    /* Enhanced zoom stability for extreme zoom levels */
    * {
        /* Ensure all elements remain stable during zoom */
        box-sizing: border-box !important;
    }
    
    /* Enhanced mobile touch for interactive elements */
    input, textarea, button {
        /* Ensure proper touch scrolling at all zoom levels */
        touch-action: manipulation !important;
        -webkit-overflow-scrolling: touch !important;
        /* Prevent zoom interference with user interactions */
        -webkit-tap-highlight-color: transparent !important;
    }
    
    /* Prevent layout breaks at extreme zoom levels */
    .orders-grid {
        /* Flexible grid that adapts to zoom */
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)) !important;
    }
    
    .order-card {
        /* Ensure cards remain readable at all zoom levels */
        min-width: 300px !important;
        max-width: 100% !important;
    }
    
    /* Ensure text remains readable at extreme zoom out */
    .worker-name,
    .position-name,
    .company-name {
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }
    
    /* IMPORTANT: Don't override toast styles here - let the dedicated mobile toast section handle it */
    /* This forces desktop layout on mobile with proper scrolling and enhanced zoom support */
}

/* Mobile devices - ensure consistent scrolling behavior */
@media screen and (max-width: 768px) {
    html {
        -webkit-text-size-adjust: 100% !important;
        -ms-text-size-adjust: 100% !important;
        text-size-adjust: 100% !important;
        -webkit-overflow-scrolling: touch !important;
        /* Ensure HTML allows scrolling */
        overflow: auto !important;
        touch-action: auto !important;
    }
    
    body {
        margin: 0 !important;
        position: static !important;
        left: auto !important;
        top: auto !important;
        -webkit-touch-callout: none;
        -webkit-tap-highlight-color: rgba(52, 152, 219, 0.2);
        touch-action: auto !important;
        /* Ensure body always scrolls */
        overflow: auto !important;
        -webkit-overflow-scrolling: touch !important;
        overscroll-behavior: auto !important;
    }
    
    /* Force scrolling on mobile - override any other styles */
    body {
        overflow: auto !important;
        -webkit-overflow-scrolling: touch !important;
        overscroll-behavior: auto !important;
        touch-action: auto !important;
    }
}

/* High-quality background GIF */
.background-gif {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: -2;
    /* Remove any image processing */
    image-rendering: auto;
}

/* Fix for worker search results - ensure names are always visible */
.worker-profile-card h3,
.worker-profile-card .worker-info h3,
.worker-search-header h2,
.worker-search-header p {
    color: white !important;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5) !important;
}

.worker-profile-card {
    background: white !important;
    color: #2c3e50 !important;
}

/* Ensure worker header has proper contrast */
.worker-header {
    background: #2c3e50 !important;
    color: white !important;
    padding: 15px !important;
    border-radius: 8px !important;
    margin-bottom: 20px !important;
}

.worker-header h3 {
    color: white !important;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5) !important;
}

/* SPECIFIC FIX: Only target input fields, not buttons or backgrounds */
input[type="number"]#portNumberInput,
input#portNumberInput,
.port-lookup-modal input[type="number"],
.port-lookup-content input[type="number"] {
    color: #000000 !important;
    background: white !important;
    font-weight: bold !important;
}

/* Restore original button and background styling */
.port-lookup-btn,
button[class*="port"]:not(input) {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    color: white !important;
    font-weight: 600 !important;
}

.port-lookup-modal {
    background: rgba(0, 0, 0, 0.7) !important;
    backdrop-filter: blur(8px) !important;
}

.port-lookup-content {
    background: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(20px) !important;
}

/* Ensure port badges are always visible in modal */
.port-lookup-modal .port-badge,
.worker-header .port-badge,
.worker-info .port-badge,
span.port-badge {
    background: #3498db !important;
    color: white !important;
    font-weight: bold !important;
    padding: 6px 12px !important;
    border-radius: 20px !important;
    font-size: 0.8rem !important;
    border: 1px solid #2980b9 !important;
}

/* Animation for "Could I Work Today?" loading spinner */
.could-work-today-section .loading-spinner-small div {
    animation: spin 1s linear infinite !important;
}

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

/* Overlay for better text readability */
body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(1px);
    z-index: -1;
    pointer-events: none;
}

.container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header Styles */
.main-header {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    color: white;
    padding: 20px 0;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    margin-bottom: 30px;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.title {
    font-size: 1.8rem;
    font-weight: 700;
    color: #2c3e50;
    display: flex;
    align-items: center;
    gap: 10px;
}

.title i {
    color: #3498db;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.last-updated {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    color: #7f8c8d;
    background: #f8f9fa;
    padding: 8px 12px;
    border-radius: 8px;
}

.btn {
    padding: 8px 16px;
    border: none;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
}

.btn-primary {
    background: #3498db;
    color: white;
}

.btn-primary:hover {
    background: #2980b9;
    transform: translateY(-1px);
}

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

/* Filters */
.filters {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 15px;
}

.search-input, .filter-select {
    width: 100%;
    padding: 10px 15px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    background: white;
}

.search-input:focus, .filter-select:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.1);
}

/* Stats */
.main {
    margin-bottom: 40px;
}

.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.stat-card {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(15px);
    padding: 15px;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.stat-number {
    font-size: 1.8rem;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 2px;
}

.stat-label {
    font-size: 0.75rem;
    color: #7f8c8d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Loading and Error States */
.loading {
    text-align: center;
    padding: 40px 20px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

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

.error-message {
    background: #e74c3c;
    color: white;
    padding: 15px;
    border-radius: 10px;
    text-align: center;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

/* Modern Orders Cards Layout */
.orders-cards-grid {
    display: flex;
    flex-direction: column;
    gap: 40px; /* Increased from 20px to 40px for better separation */
    padding: 25px;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px);
    border-radius: 0 0 15px 15px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    counter-reset: order-counter; /* Initialize counter for order numbering */
    /* Allow scrolling when content overflows */
    overflow-y: auto;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: auto;
    /* Allow content to expand horizontally when needed */
    min-width: 100%;
    width: auto;
}

.modern-order-card {
    background: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.12);
    border: 3px solid #e1e8ed;
    transition: all 0.3s ease;
    position: relative;
    margin-bottom: 15px; /* Extra bottom margin for visual separation */
}

/* Alternating color scheme for better order distinction */
.modern-order-card:nth-child(odd) {
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border-color: #3498db;
    border-left: 6px solid #3498db;
}

.modern-order-card:nth-child(even) {
    background: linear-gradient(135deg, #f0f8ff 0%, #ffffff 100%);
    border-color: #27ae60;
    border-left: 6px solid #27ae60;
}

/* Strong visual divider between orders */
.modern-order-card::after {
    content: '';
    position: absolute;
    bottom: -20px;
    left: 50%;
    transform: translateX(-50%);
    width: 80%;
    height: 2px;
    background: linear-gradient(90deg, transparent 0%, #bdc3c7 50%, transparent 100%);
}

.modern-order-card:last-child::after {
    display: none; /* Hide divider on last card */
}

/* Large order number indicator on the left side */
.modern-order-card::before {
    counter-increment: order-counter;
    content: counter(order-counter);
    position: absolute;
    left: -15px;
    top: 20px;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #2c3e50, #34495e);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: bold;
    box-shadow: 0 4px 12px rgba(44, 62, 80, 0.3);
    border: 3px solid #ffffff;
    z-index: 10;
}

/* Different colors for odd/even order counters */
.modern-order-card:nth-child(odd)::before {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    box-shadow: 0 4px 12px rgba(231, 76, 60, 0.4);
}

.modern-order-card:nth-child(even)::before {
    background: linear-gradient(135deg, #8e44ad, #9b59b6);
    box-shadow: 0 4px 12px rgba(142, 68, 173, 0.4);
}

.modern-order-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
    border-width: 4px;
}

.order-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 3px solid #ecf0f1;
    background: rgba(52, 152, 219, 0.05);
    margin: -25px -25px 20px -25px;
    padding: 20px 25px;
    border-radius: 15px 15px 0 0;
}

/* Different header backgrounds for odd/even orders */
.modern-order-card:nth-child(odd) .order-card-header {
    background: rgba(231, 76, 60, 0.05);
    border-bottom-color: #e74c3c;
}

.modern-order-card:nth-child(even) .order-card-header {
    background: rgba(142, 68, 173, 0.05);
    border-bottom-color: #8e44ad;
}

/* Add "ORDER" label above each order number */
.order-number-badge::before {
    content: "ORDER";
    display: block;
    font-size: 0.7rem;
    font-weight: 500;
    opacity: 0.8;
    margin-bottom: 2px;
    letter-spacing: 2px;
}

.order-number-badge {
    background: linear-gradient(135deg, #2c3e50, #34495e);
    color: white;
    padding: 12px 20px;
    border-radius: 30px;
    font-weight: 700;
    font-size: 1.2rem;
    letter-spacing: 1px;
    box-shadow: 0 4px 12px rgba(44, 62, 80, 0.3);
    border: 2px solid #ffffff;
    text-transform: uppercase;
}

/* Different colors for odd/even order numbers */
.modern-order-card:nth-child(odd) .order-number-badge {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    box-shadow: 0 4px 12px rgba(231, 76, 60, 0.3);
}

.modern-order-card:nth-child(even) .order-number-badge {
    background: linear-gradient(135deg, #8e44ad, #9b59b6);
    box-shadow: 0 4px 12px rgba(142, 68, 173, 0.3);
}

.order-workers-badge {
    background: #27ae60;
    color: white;
    padding: 5px 12px;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 500;
}

.order-main-info {
    margin-bottom: 20px;
}

.company-name {
    font-size: 1.5rem;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 12px;
    line-height: 1.3;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.05);
    padding: 10px 15px;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 8px;
    border-left: 4px solid #3498db;
}

/* Different company name styling for odd/even orders */
.modern-order-card:nth-child(odd) .company-name {
    border-left-color: #e74c3c;
    background: rgba(231, 76, 60, 0.1);
}

.modern-order-card:nth-child(even) .company-name {
    border-left-color: #8e44ad;
    background: rgba(142, 68, 173, 0.1);
}

.location-info, .time-info, .updated-info {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 5px;
    font-size: 0.9rem;
    color: #666;
}

.location-info i {
    color: #e74c3c;
    width: 14px;
}

.time-info i {
    color: #f39c12;
    width: 14px;
}

.updated-info {
    font-size: 0.8rem;
    color: #95a5a6;
    margin-top: 5px;
}

.updated-info i {
    color: #95a5a6;
    width: 12px;
}

.positions-section {
    border-top: 3px solid #ecf0f1;
    padding-top: 20px;
    background: rgba(248, 249, 250, 0.5);
    margin: 20px -25px -25px -25px;
    padding: 20px 25px 25px 25px;
    border-radius: 0 0 15px 15px;
}

/* Different position section styling for odd/even orders */
.modern-order-card:nth-child(odd) .positions-section {
    background: rgba(231, 76, 60, 0.03);
    border-top-color: #e74c3c;
}

.modern-order-card:nth-child(even) .positions-section {
    background: rgba(142, 68, 173, 0.03);
    border-top-color: #8e44ad;
}

.positions-title {
    font-size: 1rem;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.positions-title i {
    color: #3498db;
}

.positions-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.modern-position-card {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 12px;
    border-left: 4px solid #3498db;
}

.position-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    flex-wrap: wrap;
    gap: 8px;
}

.position-name {
    font-weight: 600;
    color: #2c3e50;
    font-size: 0.9rem;
}

.position-count {
    background: #3498db;
    color: white;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 500;
}

.position-time {
    background: #f39c12;
    color: white;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 500;
}

.workers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 8px;
    align-items: start;
}

/* Force desktop layout on all devices - override mobile media queries */
.workers-grid {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)) !important;
}

.modern-worker-item {
    display: flex;
    flex-direction: column;
    padding: 10px 12px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #ddd;
    transition: all 0.2s ease;
    min-height: fit-content;
    width: 100%;
    box-sizing: border-box;
}

.modern-worker-item.has-seniority {
    border-left-color: #27ae60;
    background: #f0f9f4;
}

.modern-worker-item.no-seniority {
    border-left-color: #e74c3c;
    background: #fdf2f2;
}

.modern-worker-item.worker-replaced {
    opacity: 0.6;
    border-left-color: #e74c3c;
    background: rgba(231, 76, 60, 0.08);
}

.modern-worker-item.worker-replaced .worker-name.replaced-name {
    text-decoration: line-through !important;
    color: #e74c3c !important;
}

.modern-worker-item.worker-canceled {
    opacity: 0.5;
    border-left-color: #95a5a6;
    background: rgba(149, 165, 166, 0.08);
}

.modern-worker-item.worker-canceled .worker-name {
    text-decoration: line-through !important;
    color: #7f8c8d !important;
}

.modern-worker-item.worker-pending {
    opacity: 0.8;
    border-left-color: #f39c12;
    background: linear-gradient(135deg, rgba(243, 156, 18, 0.15) 0%, rgba(255, 235, 59, 0.1) 100%);
    border-style: dashed;
    border-width: 2px;
}

.modern-worker-item.worker-pending .worker-name {
    font-style: italic;
    color: #d68910 !important;
}

.modern-worker-item.worker-pending .worker-name.replaced-name {
    text-decoration: line-through;
    opacity: 0.85;
    color: #e67e22 !important;
    font-weight: 600;
}

.modern-worker-item.worker-pending .worker-name.pending-replacement-name {
    text-decoration: line-through !important;
    color: #e67e22 !important;
    font-weight: 600;
}

.worker-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: 100%;
}

.worker-name {
    font-weight: 600;
    color: #2c3e50;
    font-size: 0.9rem;
}

.seniority-info {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 4px;
    width: 100%;
}

.seniority-badge {
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: bold;
    text-transform: uppercase;
}

.seniority-badge.no-rank {
    background: #ffeb3b;
    color: #2c3e50;
    font-weight: 900;
    box-shadow: 0 2px 6px rgba(255, 235, 59, 0.4);
    animation: newWorkerGlow 2s ease-in-out infinite alternate;
}

@keyframes newWorkerGlow {
    0% {
        box-shadow: 0 2px 6px rgba(255, 235, 59, 0.4);
    }
    100% {
        box-shadow: 0 4px 12px rgba(255, 235, 59, 0.8);
    }
}

/* Seniority rank colors - higher seniority = better colors */
.seniority-badge.rank-e {
    background: #8e44ad;
    color: white;
}

.seniority-badge.rank-f {
    background: #9b59b6;
    color: white;
}

.seniority-badge.rank-g {
    background: #3498db;
    color: white;
}

.seniority-badge.rank-h {
    background: #2ecc71;
    color: white;
}

.seniority-badge.rank-i {
    background: #1abc9c;
    color: white;
}

.seniority-badge.rank-j {
    background: #f39c12;
    color: white;
}

.seniority-badge.rank-k {
    background: #e67e22;
    color: white;
}

.seniority-badge.rank-l {
    background: #d35400;
    color: white;
}

.seniority-badge.rank-m {
    background: #c0392b;
    color: white;
}

.seniority-badge.rank-n {
    background: #8c2f39;
    color: white;
}

.seniority-badge.rank-o {
    background: #7f8c8d;
    color: white;
}

.seniority-badge.rank-p {
    background: #95a5a6;
    color: white;
}

.seniority-badge.rank-q {
    background: #bdc3c7;
    color: #2c3e50;
}

.seniority-badge.rank-r {
    background: #ecf0f1;
    color: #2c3e50;
}

.port-number {
    font-size: 0.75rem;
    color: #7f8c8d;
    font-weight: 500;
}

.seniority-toggle-btn:hover {
    opacity: 0.8;
    transform: translateY(-1px);
}

.worker-status {
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 3px;
    font-weight: 500;
    text-transform: uppercase;
}

.replaced-status {
    background: #e74c3c;
    color: white;
    text-transform: none;
    font-size: 0.65rem;
    line-height: 1.2;
}

.replaced-status small {
    font-size: 0.55rem;
    opacity: 0.9;
}

.replacement-seniority-info {
    display: flex;
    flex-direction: column;
    gap: 6px;
    background: rgba(248, 249, 250, 0.9);
    padding: 8px;
    border-radius: 6px;
    border-left: 3px solid #e74c3c;
    margin-top: 6px;
    width: 100%;
    box-sizing: border-box;
}

.replaced-worker-seniority,
.replacement-worker-seniority {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px;
    border-radius: 4px;
    width: 100%;
    box-sizing: border-box;
    flex-wrap: wrap;
}

.replaced-worker-seniority {
    background: rgba(231, 76, 60, 0.1);
    border-left: 2px solid #e74c3c;
}

.replacement-worker-seniority {
    background: rgba(39, 174, 96, 0.1);
    border-left: 2px solid #27ae60;
}

.replaced-worker-seniority small,
.replacement-worker-seniority small {
    font-size: 0.6rem;
    color: #7f8c8d;
    font-weight: 500;
    min-width: 60px;
}

.replacement-name {
    font-size: 0.65rem;
    color: #2c3e50;
    font-weight: 600;
    margin-left: 4px;
    background: rgba(52, 152, 219, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
    border: 1px solid rgba(52, 152, 219, 0.2);
    display: inline-block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.replacement-time {
    font-size: 0.6rem;
    color: #7f8c8d;
    font-weight: 500;
    margin-left: 6px;
    background: rgba(127, 140, 141, 0.1);
    padding: 2px 5px;
    border-radius: 3px;
    border: 1px solid rgba(127, 140, 141, 0.2);
    display: inline-block;
    white-space: nowrap;
}

.status-relief {
    background: #f39c12;
    color: white;
}

.status-new {
    background: #27ae60;
    color: white;
}

.status-dispatched {
    background: #3498db;
    color: white;
    font-weight: 600;
}



.status-replacement {
    background: #9b59b6;
    color: white;
    font-weight: 600;
}

.status-addon {
    background: #16a085;
    color: white;
    font-weight: 600;
}

.status-canceled {
    background: #95a5a6;
    color: white;
    font-weight: 600;
    opacity: 0.7;
}

.status-pending {
    background: #f39c12;
    color: white;
    font-weight: 600;
    font-style: italic;
}

.status-pending-replacement {
    background: linear-gradient(135deg, #f39c12 0%, #e74c3c 100%);
    color: white;
    font-weight: 600;
    font-style: italic;
    text-transform: none;
    font-size: 0.6rem;
    line-height: 1.2;
    padding: 3px 6px;
    display: inline-block;
    margin-top: 2px;
}

.status-called-out {
    background: #e74c3c;
    color: white;
    font-weight: 600;
    text-decoration: line-through;
    opacity: 0.8;
}

.no-workers, .no-positions {
    color: #95a5a6;
    font-style: italic;
    text-align: center;
    padding: 15px;
    font-size: 0.9rem;
}



/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 0 10px;
    }

    .header-content {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }

    .title {
        font-size: 1.4rem;
    }

    .filters {
        grid-template-columns: 1fr;
    }

    .stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .stat-card {
        padding: 12px;
    }

    .stat-number {
        font-size: 1.5rem;
    }

    .orders-cards-grid {
        gap: 15px;
        padding: 10px;
    }

    .modern-order-card {
        padding: 15px;
    }

    .order-card-header {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }

    .order-number-badge {
        font-size: 0.45rem;
        padding: 6px 12px;
    }

    .order-number-badge::before {
        display: inline;
        margin-right: 6px;
        margin-bottom: 0;
        font-size: 0.35rem;
    }

    .order-workers-badge {
        font-size: 0.75rem;
        padding: 4px 10px;
        margin-top: 4px;
        display: inline-block;
    }

    .modern-order-card::before {
        width: 25px !important;
        height: 25px !important;
        font-size: 0.75rem !important;
        left: -12px !important;
        top: 15px !important;
    }

    /* Add touch feedback for interactive elements */
    .modern-order-card {
        transition: transform 0.1s ease !important;
    }

    .modern-order-card:active {
        transform: scale(0.98) !important;
    }

    .btn:active {
        transform: scale(0.95) !important;
    }

    .worker-name.clickable:active {
        transform: scale(0.97) !important;
    }

    .company-name {
        font-size: 1.1rem;
        line-height: 1.2;
    }

    .position-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }

    .workers-grid {
        grid-template-columns: 1fr;
        gap: 6px;
    }

    .modern-worker-item {
        padding: 8px 10px;
        font-size: 0.85rem;
        min-height: auto;
    }

    .worker-name {
        font-size: 0.85rem;
    }

    .seniority-badge {
        font-size: 0.7rem;
        padding: 2px 6px;
    }



    /* Make filters more mobile friendly */
    .filters-container {
        padding: 15px;
        margin-bottom: 20px;
    }

    .filters-row {
        flex-direction: column;
        gap: 10px;
    }

    .filters-row select {
        width: 100%;
        padding: 8px 12px;
    }

    /* Adjust main header for mobile */
    .main-header {
        padding: 15px 0;
        margin-bottom: 20px;
    }

    .header-actions {
        flex-direction: column;
        gap: 10px;
        width: 100%;
    }

    .last-updated {
        font-size: 0.75rem;
        padding: 6px 10px;
    }

    .btn {
        padding: 6px 12px;
        font-size: 0.8rem;
    }
}

.hidden {
    display: none;
}

/* Updated Filters Styles */
.filters-container {
    background: white;
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    margin-bottom: 30px;
}

.search-box {
    position: relative;
    margin-bottom: 15px;
}

.search-box i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #7f8c8d;
}

.search-box input {
    width: 100%;
    padding: 12px 15px 12px 45px;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.search-box input:focus {
    outline: none;
    border-color: #3498db;
}

.search-box input:not(:placeholder-shown) {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-color: #3498db;
    font-weight: 500;
}

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

.filters-row select {
    padding: 10px 15px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    background: white;
    font-size: 0.9rem;
    cursor: pointer;
    transition: border-color 0.3s ease;
}

.filters-row select:focus {
    outline: none;
    border-color: #3498db;
}

.admin-btn {
    padding: 10px 20px;
    background: #8e44ad;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.admin-btn:hover {
    background: #9b59b6;
    transform: translateY(-2px);
}

/* Seniority Admin Panel */
.seniority-admin-panel {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

.seniority-admin-panel .admin-header {
    background: #8e44ad;
    color: white;
    padding: 20px;
    border-radius: 15px 15px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.seniority-admin-panel .admin-content {
    background: white;
    width: 90%;
    max-width: 600px;
    border-radius: 0 0 15px 15px;
    overflow: hidden;
}

.close-btn {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 5px 10px;
    border-radius: 5px;
    transition: background 0.3s ease;
}

.close-btn:hover {
    background: rgba(255,255,255,0.2);
}

.upload-section {
    padding: 20px;
    border-bottom: 1px solid #e9ecef;
}

.upload-section h4 {
    margin: 0 0 10px 0;
    color: #2c3e50;
}

.upload-section p {
    margin: 0 0 15px 0;
    color: #7f8c8d;
    font-size: 0.9rem;
}

.upload-section textarea {
    width: 100%;
    height: 120px;
    padding: 15px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-family: monospace;
    font-size: 0.9rem;
    resize: vertical;
    margin-bottom: 15px;
}

.upload-section textarea:focus {
    outline: none;
    border-color: #3498db;
}

.upload-btn {
    background: #27ae60;
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background 0.3s ease;
}

.upload-btn:hover {
    background: #2ecc71;
}

.stats-section {
    padding: 20px;
    background: #f8f9fa;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #e9ecef;
}

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

.stat-item span:first-child {
    font-weight: 600;
    color: #2c3e50;
}

.stat-item span:last-child {
    color: #7f8c8d;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Toast Notification Styles - Less Intrusive */
.toast-container {
    position: fixed;
    top: 80px;
    right: 15px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 6px;
    pointer-events: auto;
    max-width: 320px;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
    overflow-x: visible;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE/Edge */
    transition: all 0.3s ease;
    /* Add padding for scroll area */
    padding-right: 5px;
}

/* Hide scrollbar for Chrome/Safari/Webkit */
.toast-container::-webkit-scrollbar {
    display: none;
}

/* Show scrollbar on hover for better UX */
.toast-container:hover {
    scrollbar-width: thin; /* Firefox */
    -ms-overflow-style: auto; /* IE/Edge */
}

.toast-container:hover::-webkit-scrollbar {
    display: block;
    width: 8px;
}

.toast-container:hover::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.15);
    border-radius: 4px;
}

.toast-container:hover::-webkit-scrollbar-thumb {
    background: rgba(52, 152, 219, 0.6);
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.toast-container:hover::-webkit-scrollbar-thumb:hover {
    background: rgba(52, 152, 219, 0.8);
}

/* Always show scrollbar when content overflows */
@media (min-width: 769px) {
    .toast-container {
        scrollbar-width: thin;
        scrollbar-color: rgba(52, 152, 219, 0.6) rgba(0, 0, 0, 0.1);
    }
    
    .toast-container::-webkit-scrollbar {
        width: 6px;
    }
    
    .toast-container::-webkit-scrollbar-track {
        background: rgba(0, 0, 0, 0.05);
        border-radius: 3px;
    }
    
    .toast-container::-webkit-scrollbar-thumb {
        background: rgba(52, 152, 219, 0.4);
        border-radius: 3px;
    }
}

.toast {
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.15);
    border-left: 4px solid #3498db;
    min-width: 300px;
    max-width: 450px;
    opacity: 1;
    transform: translateX(0);
    transition: all 0.3s ease;
    pointer-events: auto;
    position: relative;
    animation: slideInRight 0.3s ease;
}

.toast-success {
    border-left-color: #27ae60;
}

.toast-warning {
    border-left-color: #f39c12;
}

.toast-error {
    border-left-color: #e74c3c;
}

.toast-info {
    border-left-color: #3498db;
}

.toast-content {
    display: flex;
    flex-direction: column;
    padding: 16px 20px;
}

.toast-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
}

.toast-message {
    font-size: 0.9rem;
    color: #2c3e50;
    font-weight: 500;
    flex: 1;
    line-height: 1.4;
    max-width: 380px;
    word-wrap: break-word;
}

.toast-timestamp {
    font-size: 0.75rem;
    color: #7f8c8d;
    font-weight: 400;
    white-space: nowrap;
    margin-left: 10px;
    opacity: 0.8;
}

/* Support for HTML content in toast messages */
.toast-message br {
    margin: 2px 0;
    display: block;
}

.toast-close {
    background: none;
    border: none;
    font-size: 1.2rem;
    color: #7f8c8d;
    cursor: pointer;
    padding: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s ease;
    position: absolute;
    top: 8px;
    right: 8px;
}

.toast-close:hover {
    background: #ecf0f1;
    color: #2c3e50;
}

/* Clickable toast styling */
.toast-clickable {
    cursor: pointer;
    transition: all 0.3s ease;
}

.toast-clickable:hover {
    transform: translateX(-5px) scale(1.02);
    box-shadow: 0 8px 35px rgba(0, 0, 0, 0.25);
    border-left-width: 6px;
}

/* Make sure main areas remain clickable while expand button is not */
.toast-clickable .toast-header,
.toast-clickable .toast-details,
.toast-clickable .toast-click-hint {
    cursor: pointer;
    border-radius: 4px;
    transition: background 0.2s ease;
}

.toast-clickable .toast-header:hover,
.toast-clickable .toast-details:hover,
.toast-clickable .toast-click-hint:hover {
    background: rgba(52, 152, 219, 0.05);
}

.toast-clickable .toast-expand-toggle {
    cursor: pointer;
}

.toast-clickable .toast-close {
    cursor: pointer;
}

.toast-click-hint {
    font-size: 0.75rem;
    opacity: 0.7;
    font-style: italic;
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 8px;
    color: #7f8c8d;
    text-align: left;
}

.toast-click-hint i {
    font-size: 0.7rem;
}

/* Expandable toast details */
.toast-details {
    margin-top: 8px;
    font-size: 0.85rem;
    line-height: 1.4;
    max-height: 400px;
    overflow-y: auto;
    overflow-x: auto;
    /* Enable smooth scrolling */
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: auto;
    /* Allow content to expand horizontally when needed */
    min-width: 100%;
    width: auto;
}

.toast-preview {
    color: #34495e;
}

.toast-more-count {
    color: #7f8c8d;
    font-style: italic;
    margin-top: 4px;
}

.toast-full-details {
    color: #34495e;
    margin-top: 4px;
    animation: expandDetails 0.3s ease-out;
    max-height: 400px;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 4px; /* Space for scrollbar */
}

/* Custom scrollbar styling for notification details */
.toast-full-details::-webkit-scrollbar,
.toast-details::-webkit-scrollbar {
    width: 6px;
}

.toast-full-details::-webkit-scrollbar-track,
.toast-details::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 3px;
}

.toast-full-details::-webkit-scrollbar-thumb,
.toast-details::-webkit-scrollbar-thumb {
    background: rgba(52, 152, 219, 0.4);
    border-radius: 3px;
    transition: background 0.2s ease;
}

.toast-full-details::-webkit-scrollbar-thumb:hover,
.toast-details::-webkit-scrollbar-thumb:hover {
    background: rgba(52, 152, 219, 0.6);
}

.toast-expand-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin: 8px 0 4px 0;
    padding: 6px 12px;
    background: rgba(52, 152, 219, 0.1);
    border: 1px solid rgba(52, 152, 219, 0.3);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.8rem;
    color: #3498db;
    font-weight: 500;
    user-select: none;
    position: relative;
    z-index: 1;
}

.toast-expand-toggle:hover {
    background: rgba(52, 152, 219, 0.15);
    border-color: rgba(52, 152, 219, 0.4);
    transform: translateY(-1px);
}

.toast-expand-toggle.expanded {
    background: rgba(39, 174, 96, 0.1);
    border-color: rgba(39, 174, 96, 0.3);
    color: #27ae60;
}

.toast-expand-toggle.expanded:hover {
    background: rgba(39, 174, 96, 0.15);
    border-color: rgba(39, 174, 96, 0.4);
}

.expand-arrow {
    transition: transform 0.3s ease;
    font-size: 0.7rem;
}

@keyframes expandDetails {
    from {
        opacity: 0;
        max-height: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        max-height: 400px;
        transform: translateY(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Live indicator */
.live-indicator {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.8rem;
    color: #27ae60;
    margin-left: 10px;
}

.live-dot {
    width: 8px;
    height: 8px;
    background: #27ae60;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.2); }
    100% { opacity: 1; transform: scale(1); }
}

/* Mobile responsive toasts - Scrollable like PC but touch-friendly */
@media (max-width: 768px) {
    .toast-container {
        position: fixed !important;
        top: 60px !important;
        right: 8px !important;
        left: auto !important;
        max-width: 300px !important;
        width: 300px !important;
        bottom: auto !important;
        max-height: calc(100vh - 100px) !important;
        height: auto !important;
        overflow-y: auto !important;
        overflow-x: visible !important;
        z-index: 10000 !important;
        pointer-events: auto !important;
        display: flex !important;
        flex-direction: column !important;
        gap: 6px !important;
        /* Mobile touch scrolling */
        -webkit-overflow-scrolling: touch !important;
        overscroll-behavior: contain !important;
        touch-action: pan-y !important;
        /* Mobile scrollbar - visible and functional */
        scrollbar-width: auto !important;
        scrollbar-color: rgba(52, 152, 219, 0.7) rgba(0, 0, 0, 0.1) !important;
        /* Add touch-friendly padding for scrollbar */
        padding-right: 10px !important;
        padding-bottom: 10px !important;
    }
    
    /* Mobile webkit scrollbar - always visible and functional */
    .toast-container::-webkit-scrollbar {
        width: 6px !important;
        background: rgba(0, 0, 0, 0.1) !important;
        border-radius: 3px !important;
    }
    
    .toast-container::-webkit-scrollbar-track {
        background: rgba(0, 0, 0, 0.1) !important;
        border-radius: 3px !important;
    }
    
    .toast-container::-webkit-scrollbar-thumb {
        background: rgba(52, 152, 219, 0.7) !important;
        border-radius: 3px !important;
        border: 1px solid rgba(255, 255, 255, 0.3) !important;
    }
    
    /* Show scrollbar more prominently during touch interaction */
    .toast-container:active::-webkit-scrollbar-thumb,
    .toast-container:hover::-webkit-scrollbar-thumb {
        background: rgba(52, 152, 219, 0.9) !important;
    }
    
    .toast {
        pointer-events: auto !important;
        width: auto !important;
        max-width: 280px !important;
        min-width: 240px !important;
        margin-bottom: 8px !important;
        border-radius: 8px !important;
        box-shadow: 0 2px 12px rgba(0, 0, 0, 0.12) !important;
        background: rgba(255, 255, 255, 0.92) !important;
        backdrop-filter: blur(8px) !important;
        opacity: 0.9 !important;
        padding: 8px 12px !important;
        font-size: 0.8rem !important;
        border-left-width: 3px !important;
        position: relative !important;
        box-sizing: border-box !important;
        flex-shrink: 0 !important;
        display: block !important;
        visibility: visible !important;
    }
    
    .toast .toast-message {
        font-size: 0.75rem !important;
        line-height: 1.3 !important;
        font-weight: 400 !important;
        color: #2c3e50 !important;
        max-width: 220px !important;
        overflow: hidden !important;
        display: -webkit-box !important;
        -webkit-line-clamp: 2 !important;
        -webkit-box-orient: vertical !important;
        white-space: normal !important;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
    
    .toast .toast-timestamp {
        font-size: 0.6rem !important;
        opacity: 0.6 !important;
        color: #7f8c8d !important;
        margin-left: 6px !important;
    }
    
    .toast .toast-close {
        width: 20px !important;
        height: 20px !important;
        font-size: 0.8rem !important;
        right: 4px !important;
        top: 4px !important;
        opacity: 0.6 !important;
        background: rgba(0, 0, 0, 0.05) !important;
        border-radius: 50%;
        position: absolute;
        z-index: 10;
    }
    
    .toast .toast-content {
        padding: 6px 8px !important;
    }
    
    /* Keep expand buttons but make them smaller on mobile */
    .toast .toast-expand-toggle {
        padding: 4px 8px !important;
        font-size: 0.7rem !important;
        margin: 4px 0 2px 0 !important;
    }
    
    .toast .toast-details {
        font-size: 0.7rem !important;
        max-height: 200px !important;
    }
    
    .toast .toast-click-hint {
        font-size: 0.65rem !important;
        margin-top: 4px !important;
    }
    
    .toast-mobile {
        min-height: auto !important;
        border-radius: 8px !important;
        box-shadow: 0 2px 12px rgba(0, 0, 0, 0.12) !important;
        backdrop-filter: blur(8px) !important;
        position: relative;
        z-index: 1;
    }
    
    .toast-mobile.toast-clickable {
        cursor: pointer;
        -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
        transition: transform 0.1s ease;
    }
    
    .toast-mobile.toast-clickable:active {
        transform: scale(0.98);
    }
    
    .toast-mobile .toast-expand-toggle {
        padding: 12px 16px; /* Larger touch target for expand button */
        margin-top: 10px;
        margin-bottom: 4px;
        font-size: 0.9rem;
        border-radius: 8px;
        background: rgba(255, 255, 255, 0.15);
        backdrop-filter: blur(10px);
        /* Ensure expand button is easily tappable */
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        transition: all 0.2s ease;
    }
    
    .toast-mobile .toast-expand-toggle:active {
        transform: scale(0.95);
        background: rgba(255, 255, 255, 0.25);
    }
    
    .toast-mobile .toast-timestamp {
        font-size: 0.8rem;
        font-weight: 600; /* Make timestamp more visible on mobile */
        margin-top: 4px;
    }
    
    /* FIXED: Mobile-specific scrolling for toast details */
    .toast-mobile .toast-full-details,
    .toast-mobile .toast-details {
        /* Dynamically adjust height based on viewport */
        max-height: calc(100vh - 200px);
        min-height: 100px;
        overflow-y: auto;
        overflow-x: auto;
        /* Enable smooth touch scrolling */
        -webkit-overflow-scrolling: touch;
        /* Ensure proper scrolling behavior */
        overscroll-behavior: auto;
        /* Firefox scrollbar styling */
        scrollbar-width: thin;
        scrollbar-color: rgba(52, 152, 219, 0.4) rgba(0, 0, 0, 0.05);
        /* Better spacing for touch interaction */
        padding: 8px 12px 8px 8px;
        margin: 8px 0;
        /* Ensure text wraps properly in scrollable area */
        word-wrap: break-word;
        overflow-wrap: break-word;
        /* Add subtle border to indicate scrollable area */
        border: 1px solid rgba(255, 255, 255, 0.1);
        border-radius: 8px;
        background: rgba(255, 255, 255, 0.05);
        backdrop-filter: blur(5px);
        /* Allow content to expand horizontally when needed */
        min-width: 100%;
        width: auto;
    }
    
    /* Enhanced scrollbar styling for mobile */
    .toast-mobile .toast-full-details::-webkit-scrollbar,
    .toast-mobile .toast-details::-webkit-scrollbar {
        width: 8px;
        border-radius: 4px;
    }
    
    .toast-mobile .toast-full-details::-webkit-scrollbar-track,
    .toast-mobile .toast-details::-webkit-scrollbar-track {
        background: rgba(0, 0, 0, 0.1);
        border-radius: 4px;
        margin: 4px 0;
    }
    
    .toast-mobile .toast-full-details::-webkit-scrollbar-thumb,
    .toast-mobile .toast-details::-webkit-scrollbar-thumb {
        background: rgba(52, 152, 219, 0.5);
        border-radius: 4px;
        border: 1px solid rgba(255, 255, 255, 0.2);
        /* Make scrollbar thumb more prominent on mobile */
        min-height: 30px;
    }
    
    .toast-mobile .toast-full-details::-webkit-scrollbar-thumb:hover,
    .toast-mobile .toast-details::-webkit-scrollbar-thumb:hover {
        background: rgba(52, 152, 219, 0.7);
    }
    
    /* Ensure expanded toasts don't get cut off */
    .toast-mobile .toast-full-details.expanded,
    .toast-mobile .toast-details.expanded {
        animation: expandDetailsSmooth 0.3s ease-out;
    }
    
    /* Smooth expand animation for mobile */
    @keyframes expandDetailsSmooth {
        from {
            opacity: 0;
            max-height: 0;
            transform: translateY(-10px);
        }
        to {
            opacity: 1;
            max-height: calc(100vh - 200px);
            transform: translateY(0);
        }
    }
    
    /* Fix for expanded toast positioning */
    .toast-mobile.expanded {
        /* Ensure expanded toasts don't overflow viewport */
        max-height: calc(100vh - 100px);
        overflow-y: visible;
    }
    
    /* Ensure toast content doesn't interfere with scrolling */
    .toast-mobile .toast-content {
        position: relative;
        z-index: 1;
    }
}

/* Search highlighting */
.search-highlight {
    background: linear-gradient(120deg, #f39c12 0%, #e67e22 100%);
    color: white;
    padding: 3px 6px;
    border-radius: 4px;
    font-weight: 700;
    animation: highlightPulse 2s ease-in-out infinite alternate;
    display: inline;
    word-break: normal;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(243, 156, 18, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

@keyframes highlightPulse {
    0% {
        background: linear-gradient(120deg, #f39c12 0%, #e67e22 100%);
        box-shadow: 0 0 5px rgba(243, 156, 18, 0.4);
    }
    100% {
        background: linear-gradient(120deg, #2c3e50 0%, #34495e 100%);
        box-shadow: 0 0 8px rgba(52, 73, 94, 0.6);
    }
}

/* Search target highlighting */
.search-target {
    animation: searchTargetGlow 3s ease-in-out;
    position: relative;
    z-index: 10;
}

@keyframes searchTargetGlow {
    0% {
        box-shadow: 0 0 0 0 rgba(52, 152, 219, 0.7);
        transform: scale(1);
    }
    25% {
        box-shadow: 0 0 0 10px rgba(52, 152, 219, 0.4);
        transform: scale(1.02);
    }
    50% {
        box-shadow: 0 0 0 15px rgba(52, 152, 219, 0.2);
        transform: scale(1.02);
    }
    75% {
        box-shadow: 0 0 0 10px rgba(52, 152, 219, 0.1);
        transform: scale(1.01);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(52, 152, 219, 0);
        transform: scale(1);
    }
}

/* Extra small mobile devices */
@media (max-width: 480px) {
    .container {
        padding: 0 5px;
    }

    .orders-cards-grid {
        padding: 5px;
        gap: 10px;
    }

    .modern-order-card {
        padding: 12px;
    }

    .title {
        font-size: 1.2rem;
    }

    .company-name {
        font-size: 1rem;
    }

    .stat-card {
        padding: 10px;
    }

    .stat-number {
        font-size: 1.3rem;
    }

    .filters-container {
        padding: 10px;
    }

    .modern-worker-item {
        padding: 5px 8px;
        font-size: 0.8rem;
    }

    .worker-name {
        font-size: 0.8rem;
    }

    .seniority-badge {
        font-size: 0.65rem;
        padding: 1px 4px;
    }

    .position-name {
        font-size: 0.85rem;
    }

    .position-count, .position-time {
        font-size: 0.7rem;
        padding: 1px 6px;
    }
}

/* Pending Section Styles for Order Cards */
.pending-section {
    margin: 15px 0;
    background: rgba(135, 206, 235, 0.1);
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid rgba(52, 152, 219, 0.3);
}

.pending-header {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: white;
    padding: 12px 15px;
    font-size: 0.95rem;
    font-weight: 600;
    text-align: left;
}

.pending-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0;
    padding: 0;
    /* Allow scrolling when content overflows */
    overflow-y: auto;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: auto;
    /* Allow grid to expand horizontally when needed */
    min-width: 100%;
    width: auto;
}

.pending-entry {
    padding: 12px 15px;
    border-right: 1px solid #e9ecef;
    border-bottom: 1px solid #e9ecef;
    font-size: 0.9rem;
    color: #2c3e50;
    background: #f8f9fa;
}

.pending-entry:nth-child(4n) {
    border-right: none;
}

.pending-entry:hover {
    background: #e3f2fd;
    color: #1976d2;
}

.pending-entry.pending-replacement {
    padding: 12px 15px;
    background: linear-gradient(135deg, #fff 0%, #fef5e7 100%);
    border: 1px solid #f9e79f;
}

.pending-job-type {
    font-weight: 600;
    color: #d68910;
    margin-bottom: 6px;
}

.pending-replaced-worker {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    padding-top: 6px;
    border-top: 1px dashed #f9e79f;
}

.replaced-indicator {
    color: #7f8c8d;
    font-weight: 500;
    font-size: 0.8rem;
    text-transform: uppercase;
}

.replaced-worker-name {
    color: #e74c3c;
    font-weight: 600;
    text-decoration: line-through;
    text-decoration-thickness: 2px;
    text-decoration-color: rgba(231, 76, 60, 0.6);
}

.pending-entry.pending-replacement:hover {
    background: linear-gradient(135deg, #fef5e7 0%, #fcf3cf 100%);
    border-color: #f7dc6f;
}

.pending-seniority-info {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 4px;
}

.pending-replaced-worker {
    flex-direction: column;
    align-items: flex-start;
}

.pending-replaced-worker .pending-seniority-info {
    margin-top: 6px;
    padding-left: 8px;
}

.replaced-worker-name.clickable {
    cursor: pointer;
    color: #e74c3c;
    font-weight: 600;
    text-decoration: line-through;
    transition: color 0.3s ease;
}

.replaced-worker-name.clickable:hover {
    color: #c0392b;
}

/* Remove the last row border */
.pending-entry:nth-last-child(-n+4) {
    border-bottom: none;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .pending-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .pending-entry:nth-child(4n) {
        border-right: 1px solid #e9ecef;
    }
    
    .pending-entry:nth-child(2n) {
        border-right: none;
    }
    
    .pending-entry:nth-last-child(-n+2) {
        border-bottom: none;
    }
}

@media (max-width: 480px) {
    .pending-grid {
        grid-template-columns: 1fr;
    }
    
    .pending-entry:nth-child(2n) {
        border-right: none;
    }
    
    .pending-entry:nth-last-child(-n+1) {
        border-bottom: none;
    }
}

/* Position Block Styles for Pending-Only View */
.position-block {
    margin-bottom: 30px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    overflow: hidden;
}

.order-info-header {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    color: white;
    padding: 15px 20px;
}

.order-details {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: center;
}

.order-number {
    background: rgba(255, 255, 255, 0.2);
    padding: 4px 12px;
    border-radius: 15px;
    font-weight: 600;
    font-size: 0.9rem;
}

.order-details .company-name {
    font-weight: 700;
    font-size: 1.1rem;
    color: #ecf0f1;
}

.location-info, .datetime-info, .updated-info {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    color: #bdc3c7;
}

.location-info i {
    color: #e74c3c;
}

.datetime-info i {
    color: #f39c12;
}

.updated-info i {
    color: #95a5a6;
}

.position-header-main {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: white;
    padding: 15px 20px;
    font-size: 1.1rem;
    font-weight: 600;
    text-align: left;
}

.no-pending {
    text-align: center;
    padding: 60px 20px;
    color: #7f8c8d;
    font-size: 1.2rem;
}

/* Mobile responsive for order details */
@media (max-width: 768px) {
    .order-details {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .order-details .company-name {
        font-size: 1rem;
    }
    
    .location-info, .datetime-info, .updated-info {
        font-size: 0.8rem;
    }
}

/* Conflict Indicator Styles */
.conflict-indicator {
    background: #ff6b6b;
    color: white;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 5px;
    font-weight: bold;
    animation: conflictPulse 2s infinite;
    cursor: help;
}

@keyframes conflictPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.conflict-details {
    margin-top: 4px;
    padding: 6px;
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 4px;
    font-size: 11px;
    color: #856404;
}

.conflict-details summary {
    cursor: pointer;
    font-weight: bold;
    color: #e17055;
    margin-bottom: 4px;
}

.conflict-details summary:hover {
    color: #d63031;
}

.conflict-details div {
    padding: 1px 0;
    border-bottom: 1px solid #f1c40f;
}

.conflict-details div:last-child {
    border-bottom: none;
}

/* Enhanced seniority info to accommodate conflict indicator */
.seniority-info {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
}

/* Worker Orders Modal */
.worker-orders-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 10000;
    display: flex;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.3s ease;
    /* Ensure modal is always on top and properly positioned */
    transform: none;
}

.worker-orders-modal .modal-content {
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    max-width: 90vw;
    max-height: 90vh;
    width: 900px;
    display: flex;
    flex-direction: column;
    animation: slideIn 0.3s ease;
}

.worker-orders-modal .modal-header {
    background: #2c5aa0;
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 8px 8px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.worker-orders-modal .modal-header h2 {
    margin: 0;
    font-size: 1.3rem;
}

.worker-orders-modal .modal-close {
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.worker-orders-modal .modal-close:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.worker-orders-modal .modal-body {
    padding: 1rem;
    flex: 1;
    overflow: hidden;
    position: relative;
}

.worker-orders-modal .loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 200px;
}

.worker-orders-modal .spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #2c5aa0;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

.worker-orders-modal .external-link {
    text-align: center;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #eee;
}

.worker-orders-modal .external-link a {
    color: #2c5aa0;
    text-decoration: none;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border: 1px solid #2c5aa0;
    border-radius: 4px;
    transition: all 0.2s;
}

.worker-orders-modal .external-link a:hover {
    background-color: #2c5aa0;
    color: white;
}

/* Clickable worker names */
.worker-name.clickable {
    cursor: pointer;
    transition: all 0.2s;
    border-radius: 4px;
    padding: 2px 4px;
    margin: -2px -4px;
}

.worker-name.clickable:hover {
    background-color: rgba(44, 90, 160, 0.1);
    color: #2c5aa0;
    text-decoration: underline;
}

.replacement-name.clickable {
    cursor: pointer;
    transition: all 0.2s;
    border-radius: 4px;
    padding: 2px 4px;
    margin: -2px -4px;
}

.replacement-name.clickable:hover {
    background-color: rgba(44, 90, 160, 0.1);
    color: #2c5aa0;
    text-decoration: underline;
}

/* Modal animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

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

/* Work Order Modal Content Styling */
.worker-orders-modal .work-order-content {
    overflow-y: auto;
    max-height: 70vh;
    padding: 0;
}

.work-order-card {
    background: linear-gradient(135deg, #fff 0%, #f8f9fa 100%);
    border: 1px solid #e9ecef;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}

.work-order-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
}

.work-order-card .order-header {
    border-bottom: 2px solid #e9ecef;
    padding-bottom: 1rem;
    margin-bottom: 1.5rem;
}

.work-order-card .worker-details {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.work-order-card .worker-details h3 {
    margin: 0;
    color: #2c3e50;
    font-size: 1.4rem;
    font-weight: 600;
}

.port-badge {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.9rem;
    box-shadow: 0 2px 8px rgba(52, 152, 219, 0.3);
}

.order-details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

.detail-item {
    display: flex;
    flex-direction: column;
    background: rgba(255, 255, 255, 0.7);
    padding: 0.75rem;
    border-radius: 8px;
    border-left: 4px solid #3498db;
    transition: all 0.2s ease;
}

.detail-item:hover {
    background: rgba(255, 255, 255, 0.9);
    border-left-color: #2980b9;
    transform: translateX(2px);
}

.detail-item.full-width {
    grid-column: 1 / -1;
}

.detail-item.port-note {
    border-left-color: #e74c3c;
    background: rgba(231, 76, 60, 0.05);
}

.detail-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #7f8c8d;
    margin-bottom: 0.25rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.detail-value {
    font-size: 1rem;
    color: #2c3e50;
    font-weight: 500;
    word-wrap: break-word;
}

.detail-value.start-time {
    font-size: 1.1rem;
    font-weight: 600;
    color: #27ae60;
}

.no-orders {
    text-align: center;
    padding: 3rem 1rem;
    color: #7f8c8d;
}

.no-orders-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.no-orders h3 {
    color: #2c3e50;
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.no-orders p {
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 0.5rem;
}

.no-orders small {
    opacity: 0.7;
    font-style: italic;
}

/* Mobile Responsive Design for Work Orders */
@media (max-width: 768px) {
    .worker-orders-modal {
        /* Full viewport modal on mobile */
        align-items: stretch;
        justify-content: stretch;
        padding: 0;
        /* Enhanced mobile touch support */
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
    }
    
    .worker-orders-modal .modal-content {
        max-width: 100vw;
        max-height: 100vh;
        height: 100vh;
        width: 100%;
        margin: 0;
        border-radius: 0;
        /* Enhanced mobile scrolling */
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
        /* Allow all touch gestures including horizontal scrolling */
        touch-action: auto;
    }
    
    .worker-orders-modal .modal-header {
        padding: 0.75rem 1rem;
        /* Sticky header */
        position: sticky;
        top: 0;
        z-index: 10;
        background: #2c5aa0;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    }
    
    .worker-orders-modal .modal-header h2 {
        font-size: 1.1rem;
    }
    
    .worker-orders-modal .modal-body {
        padding: 0.75rem;
        /* Ensure scrollable body in both directions */
        overflow-y: auto;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: auto;
        /* Add padding for safe scrolling */
        padding-bottom: 40px;
        /* Full remaining height */
        flex: 1;
        /* Allow content to expand horizontally */
        min-width: 100%;
        width: auto;
    }
    
    .worker-orders-modal .work-order-content {
        max-height: none;
        /* Enhanced scrolling in both directions */
        overflow-y: auto;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: auto;
        /* Smooth scrolling */
        scroll-behavior: smooth;
        /* Allow content to expand horizontally */
        min-width: 100%;
        width: auto;
    }
    
    .work-order-card {
        padding: 1rem;
        margin-bottom: 0.75rem;
        /* Prevent cards from being too cramped */
        min-height: auto;
    }
    
    .work-order-card .worker-details {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .work-order-card .worker-details h3 {
        font-size: 1.2rem;
    }
    
    .order-details-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    
    .detail-item {
        padding: 0.6rem;
    }
    
    .detail-label {
        font-size: 0.8rem;
    }
    
    .detail-value {
        font-size: 0.95rem;
    }
    
    .port-badge {
        padding: 0.4rem 0.8rem;
        font-size: 0.85rem;
    }
}

@media (max-width: 480px) {
    .worker-orders-modal .modal-content {
        max-width: 98vw;
        max-height: 98vh;
        margin: 1vh auto;
        border-radius: 6px;
    }
    
    .worker-orders-modal .modal-header {
        padding: 0.6rem 0.8rem;
        border-radius: 6px 6px 0 0;
    }
    
    .worker-orders-modal .modal-header h2 {
        font-size: 1rem;
    }
    
    .worker-orders-modal .modal-body {
        padding: 0.6rem;
    }
    
    .worker-orders-modal .work-order-content {
        max-height: 80vh;
    }
    
    .work-order-card {
        padding: 0.8rem;
        border-radius: 8px;
    }
    
    .work-order-card .worker-details h3 {
        font-size: 1.1rem;
    }
    
    .detail-item {
        padding: 0.5rem;
    }
    
    .detail-label {
        font-size: 0.75rem;
    }
    
    .detail-value {
        font-size: 0.9rem;
    }
    
    .no-orders {
        padding: 2rem 0.5rem;
    }
    
    .no-orders-icon {
        font-size: 3rem;
    }
    
    .no-orders h3 {
        font-size: 1.3rem;
    }
}

/* Port Lookup Styles */
.port-lookup-section {
    margin: 15px 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    padding: 1px;
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

.port-lookup-box {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 11px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.port-lookup-box i {
    color: #667eea;
    font-size: 1.2rem;
    min-width: 20px;
}

.port-lookup-box input {
    flex: 1;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.3s ease;
    background: white;
}

.port-lookup-box input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.port-lookup-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 12px 20px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.port-lookup-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.port-lookup-btn:active {
    transform: translateY(0);
}

.port-lookup-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}



/* Port Lookup Results Modal */
.port-lookup-results {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
    /* Ensure modal is always on top and properly positioned */
    transform: none;
}

.port-results-content {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow: hidden;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3);
    animation: slideIn 0.4s ease;
}

.port-results-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.port-results-header h3 {
    font-size: 1.3rem;
    font-weight: 600;
    margin: 0;
}

.close-results-btn {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.close-results-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

#portResultsBody {
    padding: 25px;
    max-height: 60vh;
    overflow-y: auto;
}

/* Worker Info Card */
.worker-info-card {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    border-left: 4px solid #667eea;
}

.worker-info-card h4 {
    color: #2c3e50;
    margin-bottom: 10px;
    font-size: 1.2rem;
}

.worker-details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.worker-detail-item {
    text-align: center;
    padding: 10px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.worker-detail-label {
    font-size: 0.75rem;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 5px;
}

.worker-detail-value {
    font-size: 1rem;
    font-weight: 600;
    color: #2c3e50;
}

/* Status Indicators */
.status-indicator {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 15px;
}

.status-working {
    background: linear-gradient(135deg, #27ae60 0%, #2ecc71 100%);
    color: white;
}

.status-waiting {
    background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%);
    color: white;
}

.status-unavailable {
    background: linear-gradient(135deg, #95a5a6 0%, #7f8c8d 100%);
    color: white;
}

/* Queue Position Card */
.queue-position-card {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: white;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    text-align: center;
}

.queue-position-card h4 {
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.position-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-bottom: 15px;
}

.position-stat {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    padding: 12px 8px;
}

.position-stat-number {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 2px;
}

.position-stat-label {
    font-size: 0.7rem;
    opacity: 0.9;
}

/* Job Prospects Card */
.job-prospects-card {
    background: linear-gradient(135deg, #9b59b6 0%, #8e44ad 100%);
    color: white;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
}

.job-prospects-card h4 {
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.prospects-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.prospect-item {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    padding: 12px;
    text-align: center;
}

.prospect-value {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 3px;
}

.prospect-label {
    font-size: 0.75rem;
    opacity: 0.9;
}

/* Analysis Message */
.analysis-message {
    background: rgba(255, 255, 255, 0.95);
    border-left: 4px solid #667eea;
    border-radius: 8px;
    padding: 20px;
    font-size: 1rem;
    line-height: 1.6;
    color: #2c3e50;
    margin-bottom: 20px;
}

/* Mobile Responsive for Port Lookup */
@media (max-width: 768px) {
    .port-lookup-box {
        flex-direction: column;
        gap: 12px;
        padding: 15px;
    }
    
    .port-lookup-box input {
        width: 100%;
    }
    
    .port-lookup-btn {
        width: 100%;
        justify-content: center;
    }
    
    .port-results-content {
        width: 95%;
        max-height: 90vh;
    }
    
    .worker-details-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .position-stats {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .prospects-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }
}

/* Port Lookup Modal Styles */
.port-lookup-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
    /* Enhanced mobile touch support */
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    /* Ensure modal is always on top and properly positioned */
    transform: none;
}

.port-lookup-content {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    max-width: 800px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    overflow-x: auto;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3);
    animation: slideIn 0.4s ease;
    /* Enhanced mobile scrolling */
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    /* Allow all touch gestures including horizontal scrolling */
    touch-action: auto;
}

.port-lookup-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 25px;
    position: relative;
}

.header-gradient h2 {
    margin: 0 0 8px 0;
    font-size: 1.5rem;
    font-weight: 700;
}

.header-gradient p {
    margin: 0;
    font-size: 1rem;
    opacity: 0.9;
}

.port-lookup-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    color: white;
    font-size: 1.8rem;
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.port-lookup-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

.port-lookup-body {
    padding: 30px;
}

.lookup-input-section {
    margin-bottom: 25px;
}

.input-group {
    display: flex;
    gap: 15px;
    align-items: stretch;
}

.port-input,
input.port-input,
#portNumberInput,
input[type="number"]#portNumberInput {
    flex: 1;
    padding: 15px 20px;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    background: white !important;
    color: #000000 !important;
    font-weight: 700 !important;
    text-shadow: none !important;
}

.port-input:focus,
input.port-input:focus,
#portNumberInput:focus,
input[type="number"]#portNumberInput:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    color: #000000 !important;
    background: white !important;
    font-weight: 700 !important;
}

.lookup-btn {
    padding: 15px 25px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.lookup-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.3);
}

.lookup-btn:active {
    transform: translateY(0);
}

.lookup-results {
    margin-top: 20px;
}

.lookup-loading {
    text-align: center;
    padding: 40px 20px;
    color: #6c757d;
}

.loading-spinner-small {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

.lookup-error, .lookup-success {
    animation: slideIn 0.4s ease;
}

.lookup-error {
    text-align: center;
    padding: 30px;
    color: #dc3545;
}

.error-icon {
    font-size: 3rem;
    margin-bottom: 15px;
}

.lookup-error h3 {
    color: #dc3545;
    margin-bottom: 10px;
}

.error-detail {
    color: #6c757d;
    font-size: 0.9rem;
}

.worker-card {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.worker-header {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    color: white;
    padding: 20px 25px;
}

.worker-info h3 {
    margin: 0 0 10px 0;
    font-size: 1.3rem;
    font-weight: 700;
}

.worker-details {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.port-badge, .seniority-badge, .company-badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.port-badge {
    background: #3498db !important;
    color: white !important;
    border: 1px solid #2980b9 !important;
    font-weight: bold !important;
}

.seniority-badge {
    background: rgba(52, 152, 219, 0.9);
    color: white;
}

.company-badge {
    background: rgba(46, 204, 113, 0.9);
    color: white;
}

.queue-stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    padding: 25px;
}

.stat-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-3px);
}

.stat-card.primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    grid-column: span 2;
}

.stat-icon {
    font-size: 2rem;
    margin-bottom: 10px;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 5px;
}

.stat-label {
    font-size: 0.9rem;
    opacity: 0.8;
}

.analysis-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    padding: 0 25px 25px;
}

.analysis-card, .prospects-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.analysis-card h4, .prospects-card h4 {
    margin: 0 0 15px 0;
    color: #2c3e50;
    font-size: 1.1rem;
}

.analysis-text, .prospects-text {
    color: #555;
    line-height: 1.6;
    margin: 0;
}

.footer-actions {
    display: flex;
    gap: 15px;
    padding: 20px 25px;
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
}

.action-btn {
    flex: 1;
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.action-btn.primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.action-btn.secondary {
    background: #6c757d;
    color: white;
}

.action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

/* Mobile Responsive for Port Lookup Modal */
/* 🚨 NUCLEAR MOBILE MODAL OVERRIDE - COMPLETE VIEWPORT TAKEOVER 🚨 */
@media screen and (max-width: 768px) {
    /* Allow scrolling even when modal is open on mobile */
    body.modal-open {
        overflow: auto !important;
        -webkit-overflow-scrolling: touch !important;
        overscroll-behavior: auto !important;
        touch-action: auto !important;
    }
    
    /* Ensure body scrolling is properly restored when modal is closed */
    body:not(.modal-open) {
        overflow: auto !important;
        -webkit-overflow-scrolling: touch !important;
        overscroll-behavior: auto !important;
        touch-action: auto !important;
    }
    
    /* 🔧 WORK HISTORY TABLES - MOBILE SCROLLING FIX */
    .work-history-section,
    .analysis-card {
        overflow-x: auto !important;
        max-width: none !important;
        width: 100% !important;
    }
    
    /* Ensure all table containers can scroll horizontally */
    .work-history-section > div,
    .analysis-card > div {
        overflow-x: auto !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch !important;
        width: 100% !important;
        max-width: none !important;
    }
    
    /* Force tables to be their natural width */
    .work-history-section table,
    .analysis-card table {
        min-width: 800px !important;
        width: max-content !important;
    }
    
    /* Ensure modal content doesn't constrain tables */
    .port-lookup-modal .modal-content,
    .worker-orders-modal .modal-content {
        overflow-x: auto !important;
        max-width: none !important;
        width: 100% !important;
    }
    
    /* Fix any remaining width constraints in modals */
    .port-lookup-modal *,
    .worker-orders-modal * {
        max-width: none !important;
    }
    
    /* Specifically target table containers in modals */
    .port-lookup-modal div[style*="overflow"],
    .worker-orders-modal div[style*="overflow"] {
        overflow-x: auto !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch !important;
        max-width: none !important;
        width: 100% !important;
    }
    
    /* 📊 CALL-OUT STATISTICS - MOBILE SCROLLING FIX */
    .port-lookup-modal div[style*="grid"],
    .worker-orders-modal div[style*="grid"] {
        overflow-x: auto !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch !important;
        max-width: none !important;
        width: 100% !important;
    }
    
    /* Ensure flex containers (12-month charts) can scroll */
    .port-lookup-modal div[style*="flex"],
    .worker-orders-modal div[style*="flex"] {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
        max-width: none !important;
        width: 100% !important;
    }
    
/* 💻 DESKTOP SPECIFIC FIXES - Outside mobile media query */
@media screen and (min-width: 769px) {
    /* NUCLEAR OVERRIDE - Remove ALL width constraints on desktop modals */
    html body div.port-lookup-modal .port-lookup-content,
    html body div.worker-orders-modal .modal-content {
        max-width: 99vw !important;
        width: 99vw !important;
        min-width: 99vw !important;
        /* Ensure proper centering and spacing */
        margin: 0.5vh auto !important;
        left: 50% !important;
        transform: translateX(-50%) !important;
        /* Force maximum available space */
        max-height: 99vh !important;
        height: auto !important;
    }
    
    /* NUCLEAR OVERRIDE - Force modal containers to full width */
    html body .port-lookup-content,
    html body .modal-content {
        max-width: 95vw !important;
        width: 95vw !important;
        min-width: 95vw !important;
    }
    
    /* NUCLEAR OVERRIDE - Ensure table containers use full available width */
    html body div.port-lookup-modal .work-history-section > div,
    html body div.port-lookup-modal .analysis-card > div,
    html body div.worker-orders-modal .work-history-section > div,
    html body div.worker-orders-modal .analysis-card > div {
        width: 100% !important;
        max-width: none !important;
        overflow-x: auto !important;
    }
    
    /* NUCLEAR OVERRIDE - Force tables to be their natural width on desktop */
    html body div.port-lookup-modal table,
    html body div.worker-orders-modal table {
        min-width: 1200px !important;
        width: max-content !important;
    }
    
    /* NUCLEAR OVERRIDE - Ensure work history sections don't constrain content */
    html body div.port-lookup-modal .work-history-section,
    html body div.port-lookup-modal .analysis-card,
    html body div.worker-orders-modal .work-history-section,
    html body div.worker-orders-modal .analysis-card {
        overflow-x: auto !important;
        max-width: none !important;
        width: 100% !important;
    }
    
    /* NUCLEAR OVERRIDE - Target specific modal classes */
    html body div#portLookupModal .port-lookup-content {
        max-width: 98vw !important;
        width: 98vw !important;
        min-width: 98vw !important;
        /* Ensure proper scrolling for desktop */
        overflow-x: auto !important;
        overflow-y: auto !important;
        /* Better desktop modal appearance */
        margin: 1vh auto !important;
        left: 50% !important;
        transform: translateX(-50%) !important;
    }
    
    /* DESKTOP SPECIFIC: Force all statistics sections to be scrollable */
    @media screen and (min-width: 769px) {
        .port-lookup-modal .callout-stats-section,
        .port-lookup-modal .work-history-section,
        .port-lookup-modal .analysis-card,
        .worker-orders-modal .callout-stats-section,
        .worker-orders-modal .work-history-section,
        .worker-orders-modal .analysis-card {
            overflow-x: auto !important;
            overflow-y: auto !important;
            -webkit-overflow-scrolling: touch !important;
            /* Ensure content isn't cut off on desktop */
            min-width: 100% !important;
            width: 100% !important;
            max-width: none !important;
        }
        
        /* Fix specific grid layouts that cause cut-offs */
        .port-lookup-modal .relief-analysis-grid,
        .port-lookup-modal [style*="grid-template-columns"],
        .worker-orders-modal .relief-analysis-grid,
        .worker-orders-modal [style*="grid-template-columns"] {
            /* Override problematic grid layouts */
            display: flex !important;
            flex-wrap: wrap !important;
            gap: 10px !important;
            overflow-x: auto !important;
            overflow-y: visible !important;
            min-width: 100% !important;
            width: max-content !important;
            max-width: none !important;
        }
        
        /* Fix specific chart containers that get cut off */
        .port-lookup-modal [style*="display: flex"],
        .port-lookup-modal [style*="justify-content: space-between"],
        .worker-orders-modal [style*="display: flex"],
        .worker-orders-modal [style*="justify-content: space-between"] {
            overflow-x: auto !important;
            min-width: 100% !important;
            width: max-content !important;
            max-width: none !important;
            flex-wrap: nowrap !important;
        }
        
        /* Desktop table improvements */
        .port-lookup-modal table,
        .worker-orders-modal table,
        .work-history-table table {
            min-width: 1000px !important;
            width: max-content !important;
        }
        
        /* Fix any remaining inline style containers */
        .port-lookup-modal div[style*="max-width"],
        .worker-orders-modal div[style*="max-width"] {
            max-width: none !important;
        }
        
        /* Ensure all stat items are properly sized */
        .port-lookup-modal .stat-item,
        .worker-orders-modal .stat-item {
            min-width: 150px !important;
            flex-shrink: 0 !important;
        }
        
        /* NUCLEAR OVERRIDE: Ensure modal body uses full width */
        .port-lookup-modal .port-lookup-body,
        .port-lookup-modal .lookup-results,
        .worker-orders-modal .modal-body {
            overflow-x: auto !important;
            overflow-y: auto !important;
            width: 100% !important;
            max-width: none !important;
            padding: 15px !important;
        }
        
        /* Force all containers to be scrollable instead of cut off */
        .port-lookup-modal *,
        .worker-orders-modal * {
            /* Override any max-width constraints */
            max-width: none !important;
        }
        
        /* Specific fix for call-out sections */
        .port-lookup-modal .callout-stats-section *,
        .worker-orders-modal .callout-stats-section * {
            max-width: none !important;
            overflow-x: auto !important;
        }
    }
    
    /* NUCLEAR OVERRIDE - Override any inline styles */
    html body div.port-lookup-modal div[style*="max-width"],
    html body div.worker-orders-modal div[style*="max-width"] {
        max-width: none !important;
    }
}

/* Nuclear modal override with maximum specificity */
    html body div.port-lookup-modal.port-lookup-modal.port-lookup-modal {
        /* 🎯 NUCLEAR VIEWPORT POSITIONING */
        position: fixed !important;
        top: 0px !important;
        left: 0px !important;
        right: 0px !important;
        bottom: 0px !important;
        width: 100vw !important;
        height: 100vh !important;
        min-width: 100vw !important;
        min-height: 100vh !important;
        max-width: 100vw !important;
        max-height: 100vh !important;
        
        /* 🔥 NUCLEAR ZOOM ESCAPE */
        zoom: 1 !important;
        transform: scale(1.818) translate(0, 0) !important; /* Compensate for 0.55 zoom */
        -webkit-transform: scale(1.818) translate(0, 0) !important;
        transform-origin: top left !important;
        -webkit-transform-origin: top left !important;
        
        /* ⚡ FORCE DISPLAY PROPERTIES */
        display: block !important;
        align-items: unset !important;
        justify-content: unset !important;
        flex-direction: unset !important;
        
        /* 🎨 FULL SCREEN BACKGROUND */
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
        
        /* 🚀 TOP LAYER */
        z-index: 2147483647 !important; /* Maximum z-index value */
        
        /* 📱 MOBILE OPTIMIZATIONS */
        margin: 0 !important;
        padding: 0 !important;
        border: none !important;
        border-radius: 0 !important;
        box-shadow: none !important;
        backdrop-filter: none !important;
        animation: none !important;
        
        /* 🎮 TOUCH SUPPORT - ALLOW ALL GESTURES INCLUDING HORIZONTAL SCROLL */
        -webkit-overflow-scrolling: touch !important;
        overscroll-behavior: auto !important;
        touch-action: auto !important;
        
        /* 📦 BOX MODEL */
        box-sizing: border-box !important;
        overflow: hidden !important;
    }
    
    /* Nuclear content container override */
    html body div.port-lookup-modal.port-lookup-modal.port-lookup-modal .port-lookup-content {
        /* 🎯 FULL SCREEN CONTENT */
        width: 100% !important;
        height: 100% !important;
        max-width: 100% !important;
        max-height: 100% !important;
        min-width: 100% !important;
        min-height: 100% !important;
        
        /* 🔥 RESET ALL MODAL STYLING */
        border-radius: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
        border: none !important;
        box-shadow: none !important;
        backdrop-filter: none !important;
        animation: none !important;
        
        /* 🎨 APP BACKGROUND */
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
        
        /* 📱 MOBILE LAYOUT */
        display: flex !important;
        flex-direction: column !important;
        position: relative !important;
        
        /* 🎮 SCROLLING - ALLOW BOTH DIRECTIONS WITH FULL TOUCH SUPPORT */
        overflow-y: auto !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
        overscroll-behavior: auto !important;
        scroll-behavior: smooth !important;
        touch-action: auto !important;
        /* 🔧 ENSURE NO WIDTH CONSTRAINTS */
        max-width: none !important;
        width: 100% !important;
        
        /* 📦 BOX MODEL */
        box-sizing: border-box !important;
        
        /* 🔄 RESET TRANSFORMS */
        zoom: 1 !important;
        transform: none !important;
        -webkit-transform: none !important;
    }
    
    .port-lookup-header {
        /* App-like header with safe area */
        padding: env(safe-area-inset-top, 20px) 20px 20px 20px;
        /* Sticky header for better UX */
        position: sticky;
        top: 0;
        z-index: 100;
        /* App-like header styling */
        background: rgba(255, 255, 255, 0.15) !important;
        backdrop-filter: blur(20px) !important;
        -webkit-backdrop-filter: blur(20px) !important;
        border-bottom: 1px solid rgba(255, 255, 255, 0.2);
        /* Flex layout for app header */
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        min-height: 60px;
    }
    
    .header-gradient {
        /* Reset gradient for app header */
        background: none !important;
        color: white !important;
        flex: 1;
        margin-right: 15px;
    }
    
    .header-gradient h2 {
        font-size: 1.4rem;
        font-weight: 600;
        margin: 0;
        color: white !important;
    }
    
    .header-gradient p {
        font-size: 0.9rem;
        color: rgba(255, 255, 255, 0.8) !important;
        margin: 0;
    }
    
    /* 🚨 NUCLEAR EXIT BUTTON OVERRIDE */
    html body div.port-lookup-modal span.port-lookup-close,
    html body div.port-lookup-modal .port-lookup-header span.port-lookup-close {
        /* 🎯 POSITIONING */
        position: absolute !important;
        top: 20px !important;
        right: 20px !important;
        
        /* 📏 SIZE */
        width: 50px !important;
        height: 50px !important;
        min-width: 50px !important;
        min-height: 50px !important;
        
        /* 🎨 STYLING */
        background: rgba(255, 255, 255, 0.25) !important;
        border: 2px solid rgba(255, 255, 255, 0.4) !important;
        border-radius: 50% !important;
        color: white !important;
        
        /* 🔤 TYPOGRAPHY - Let &times; show properly */
        font-family: Arial, sans-serif !important;
        font-size: 28px !important;
        font-weight: 400 !important;
        line-height: 50px !important;
        text-align: center !important;
        
        /* 🎮 INTERACTION */
        cursor: pointer !important;
        touch-action: auto !important;
        -webkit-tap-highlight-color: transparent !important;
        
        /* 📦 LAYOUT */
        display: block !important;
        margin: 0 !important;
        padding: 0 !important;
        
        /* 🚀 STACKING */
        z-index: 1000 !important;
        
        /* 🔄 RESET */
        transform: none !important;
        transition: all 0.2s ease !important;
        box-sizing: border-box !important;
        outline: none !important;
        
        /* 🧹 CLEAR ANY CONFLICTING STYLES */
        text-indent: 0 !important;
        letter-spacing: 0 !important;
        word-spacing: 0 !important;
        vertical-align: baseline !important;
        text-decoration: none !important;
        text-transform: none !important;
        
        /* 🎯 ENSURE CONTENT SHOWS PROPERLY */
        overflow: visible !important;
        white-space: nowrap !important;
    }
    
    /* Clear all pseudo-elements that might interfere */
    html body div.port-lookup-modal span.port-lookup-close:before,
    html body div.port-lookup-modal span.port-lookup-close:after {
        display: none !important;
        content: none !important;
    }
    
    /* Hover effect */
    html body div.port-lookup-modal span.port-lookup-close:hover,
    html body div.port-lookup-modal span.port-lookup-close:active {
        background: rgba(255, 255, 255, 0.4) !important;
        border-color: rgba(255, 255, 255, 0.7) !important;
        transform: scale(1.05) !important;
        color: white !important;
    }
    
    .port-lookup-body {
        /* App-like body with cards */
        padding: 20px;
        flex: 1;
        /* Ensure body content is scrollable in both directions */
        overflow-y: auto;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: auto;
        /* Add padding for safe scrolling */
        padding-bottom: env(safe-area-inset-bottom, 40px);
        /* Allow content to expand horizontally */
        min-width: 100%;
        width: auto;
    }
    
    .lookup-input-section {
        /* App-like card for input */
        background: rgba(255, 255, 255, 0.95) !important;
        backdrop-filter: blur(20px) !important;
        -webkit-backdrop-filter: blur(20px) !important;
        border-radius: 20px !important;
        padding: 24px !important;
        margin-bottom: 20px !important;
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1) !important;
        border: 1px solid rgba(255, 255, 255, 0.2) !important;
    }
    
    .lookup-results {
        /* App-like card for results */
        background: rgba(255, 255, 255, 0.95) !important;
        backdrop-filter: blur(20px) !important;
        -webkit-backdrop-filter: blur(20px) !important;
        border-radius: 20px !important;
        padding: 24px !important;
        margin-bottom: 20px !important;
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1) !important;
        border: 1px solid rgba(255, 255, 255, 0.2) !important;
        /* Ensure results area is properly scrollable in both directions */
        overflow-y: auto;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: auto;
        /* Allow content to expand horizontally */
        min-width: 100%;
        width: auto;
    }
    
    .input-group {
        flex-direction: column;
        gap: 12px;
    }
    
    .lookup-btn {
        width: 100%;
        justify-content: center;
        /* Larger touch target */
        padding: 15px 20px;
        font-size: 1rem;
    }
    
    .queue-stats-grid {
        grid-template-columns: 1fr;
        gap: 12px;
        padding: 20px;
    }
    
    .stat-card.primary {
        grid-column: span 1;
    }
    
    .analysis-section {
        grid-template-columns: 1fr;
        padding: 0 20px 20px;
    }
    
    .footer-actions {
        /* App-like footer */
        flex-direction: column;
        padding: 20px 20px env(safe-area-inset-bottom, 20px);
        /* Stick to bottom for better UX */
        position: sticky;
        bottom: 0;
        background: rgba(255, 255, 255, 0.95) !important;
        backdrop-filter: blur(20px) !important;
        -webkit-backdrop-filter: blur(20px) !important;
        border-top: 1px solid rgba(255, 255, 255, 0.2) !important;
        margin: 0 20px;
        border-radius: 20px 20px 0 0;
        box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.1) !important;
    }
    
    .worker-details {
        justify-content: center;
    }
    
    /* Enhanced scrollable areas */
    .lookup-results {
        /* Ensure results area is properly scrollable */
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
        /* Add some padding for comfortable scrolling */
        padding: 0 0 20px 0;
    }
    
    /* Fix for work history table scrolling */
    .work-history-table {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
        /* Ensure table doesn't break layout */
        width: 100%;
        display: block;
    }
    
    .work-history-table table {
        width: 100%;
        min-width: 600px; /* Ensure table doesn't get too cramped */
    }
}

@media screen and (max-width: 480px) {
    html body div.port-lookup-modal.port-lookup-modal.port-lookup-modal {
        /* 🔥 NUCLEAR ZOOM ESCAPE FOR SMALL SCREENS */
        padding: 0 !important;
        margin: 0 !important;
        /* Same zoom compensation as larger screens */
        transform: scale(1.818) translate(0, 0) !important;
        -webkit-transform: scale(1.818) translate(0, 0) !important;
        transform-origin: top left !important;
        -webkit-transform-origin: top left !important;
    }
    
    /* Vessel Schedules Modal - Same zoom behavior as port lookup */
    html body div.vessel-schedules-modal.vessel-schedules-modal.vessel-schedules-modal {
        /* 🔥 NUCLEAR ZOOM ESCAPE FOR VESSEL SCHEDULES */
        padding: 0 !important;
        margin: 0 !important;
        /* Same zoom compensation as port lookup */
        transform: scale(1.818) translate(0, 0) !important;
        -webkit-transform: scale(1.818) translate(0, 0) !important;
        transform-origin: top left !important;
        -webkit-transform-origin: top left !important;
    }
    
    html body div.port-lookup-modal.port-lookup-modal.port-lookup-modal .port-lookup-content {
        /* 🎯 FULL SCREEN FOR VERY SMALL DEVICES */
        width: 100% !important;
        height: 100% !important;
        max-width: 100% !important;
        max-height: 100% !important;
        min-width: 100% !important;
        min-height: 100% !important;
        border-radius: 0 !important;
        /* Reset content transforms */
        transform: none !important;
        -webkit-transform: none !important;
        /* Enhanced touch scrolling */
        -webkit-overflow-scrolling: touch !important;
        overscroll-behavior: contain !important;
        scroll-behavior: smooth !important;
        position: relative !important;
        box-sizing: border-box !important;
    }
    
    .port-lookup-header {
        /* Smaller padding for compact screens */
        padding: env(safe-area-inset-top, 15px) 15px 15px 15px;
        min-height: 50px;
    }
    
    .header-gradient h2 {
        font-size: 1.2rem;
    }
    
    .header-gradient p {
        font-size: 0.85rem;
    }
    
    /* Close button size already handled by nuclear override */
    
    .port-lookup-body {
        /* Smaller padding for compact screens */
        padding: 15px;
        /* Ensure smooth scrolling on small screens */
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
        /* Add safe area for scrolling */
        padding-bottom: env(safe-area-inset-bottom, 60px);
    }
    
    .lookup-input-section,
    .lookup-results {
        /* Smaller padding for compact screens */
        padding: 20px !important;
        border-radius: 16px !important;
    }
    
    .footer-actions {
        /* Smaller padding for compact screens */
        padding: 15px 15px env(safe-area-inset-bottom, 15px);
        margin: 0 15px;
        border-radius: 16px 16px 0 0;
    }
    
    .worker-header {
        padding: 15px 20px;
    }
    
    .worker-info h3 {
        font-size: 1.1rem;
    }
    
    .queue-stats-grid {
        padding: 15px;
        /* Single column on very small screens */
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .stat-value {
        font-size: 1.5rem;
    }
    
    .analysis-section {
        padding: 0 15px 15px;
    }
    
    /* Enhanced input handling for small screens */
    .port-input,
    input.port-input,
    #portNumberInput {
        /* Prevent zoom on input focus */
        font-size: 16px !important;
        /* Larger touch target */
        padding: 18px 20px;
        /* Better mobile appearance */
        border-radius: 8px;
        border: 2px solid #e9ecef;
        background: white;
        /* Prevent text selection issues */
        -webkit-user-select: text;
        user-select: text;
    }
    
    .lookup-btn {
        /* Larger touch target */
        padding: 18px 20px;
        font-size: 16px;
        /* Better mobile appearance */
        border-radius: 8px;
        min-height: 56px;
    }
    
    /* Work history table improvements */
.work-history-table {
    /* Better mobile scrolling in all directions */
    overflow-x: auto;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: auto;
    /* Add padding for better touch scrolling */
    padding: 0 0 10px 0;
    /* Ensure table container doesn't constrain width */
    width: 100%;
    max-width: 100%;
}

/* Call-out statistics scrolling improvements */
.callout-stats-section {
    /* Ensure call-out statistics sections are properly scrollable */
    overflow-x: auto;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: auto;
    /* Allow content to expand horizontally */
    min-width: 100%;
    width: 100%;
    max-width: 100%;
    /* Prevent content from being cut off */
    display: block;
    position: relative;
}

/* Fix all grid and flex containers inside statistics sections */
.callout-stats-section [style*="display: grid"],
.callout-stats-section [style*="display: flex"],
.work-history-section [style*="display: grid"],
.work-history-section [style*="display: flex"] {
    /* Force proper scrolling for all inline containers */
    overflow-x: auto !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
    overscroll-behavior: auto !important;
    /* Ensure content isn't cut off */
    min-width: 100% !important;
    width: max-content !important;
    max-width: none !important;
}

/* Ensure all inline grid containers in call-out stats are scrollable */
.port-lookup-modal [style*="display: grid"],
.port-lookup-modal [style*="display: flex"],
.worker-profile-card [style*="display: grid"],
.worker-profile-card [style*="display: flex"] {
    /* Force horizontal scrolling for all grid and flex containers */
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    overscroll-behavior: auto !important;
}

/* Mobile-specific call-out stats improvements */
@media (max-width: 768px) {
    /* Enhanced mobile scrolling for call-out stats */
    .callout-stats-section,
    .port-lookup-modal .callout-stats-section {
        overflow-x: auto !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch !important;
        touch-action: auto !important;
        overscroll-behavior: auto;
        /* Allow content to expand beyond viewport */
        min-width: 100%;
        width: auto;
        /* Better touch targets */
        padding: 10px;
        /* Ensure proper spacing */
        margin-bottom: 15px;
    }
    
    /* Fix work history table scrolling */
    .work-history-table {
        overflow-x: auto !important;
        overflow-y: visible !important;
        -webkit-overflow-scrolling: touch !important;
        touch-action: auto !important;
        /* Prevent lag */
        -webkit-transform: translate3d(0,0,0);
        transform: translate3d(0,0,0);
        width: 100% !important;
        max-width: 100% !important;
    }
    
    .work-history-table table {
        /* Ensure table is readable on small screens */
        min-width: 600px !important;
        font-size: 0.85rem;
        /* Allow table to expand naturally */
        width: auto !important;
        white-space: nowrap !important;
    }
    
    /* Fix all port lookup modal content scrolling */
    .port-lookup-modal [style*="display: grid"],
    .port-lookup-modal [style*="overflow"],
    .port-lookup-modal .work-history-section,
    .port-lookup-modal .callout-stats-section {
        overflow-x: auto !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch !important;
        touch-action: auto !important;
        /* Ensure content isn't cut off */
        min-width: 100% !important;
        width: max-content !important;
        max-width: none !important;
    }
    
    /* COMPREHENSIVE FIX: All inline styles in port lookup modals */
    .port-lookup-modal div[style*="grid"],
    .port-lookup-modal div[style*="flex"],
    .port-lookup-modal div[style*="display: grid"],
    .port-lookup-modal div[style*="display: flex"],
    .port-lookup-modal .relief-analysis-grid {
        overflow-x: auto !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch !important;
        touch-action: auto !important;
        /* Force proper width behavior */
        min-width: 100% !important;
        width: max-content !important;
        max-width: none !important;
        /* Ensure scrollbars are visible */
        scrollbar-width: thin !important;
        scrollbar-color: rgba(0, 0, 0, 0.3) transparent !important;
    }
    
    /* ULTRA-SPECIFIC OVERRIDE for relief analysis grid */
    .port-lookup-modal .analysis-card .relief-analysis-grid,
    .port-lookup-modal .analysis-card div[style*="grid-template-columns"],
    .worker-orders-modal .analysis-card .relief-analysis-grid,
    .worker-orders-modal .analysis-card div[style*="grid-template-columns"] {
        /* Force flex layout instead of problematic grid */
        display: flex !important;
        flex-wrap: wrap !important;
        grid-template-columns: none !important;
        /* Ensure horizontal scrolling */
        overflow-x: auto !important;
        overflow-y: visible !important;
        /* Force content to be visible */
        min-width: 100% !important;
        width: max-content !important;
        max-width: none !important;
        /* Proper gap */
        gap: 10px !important;
    }
    
    /* Fix the "Last 12 Months" chart specifically - UPDATED: Remove scrolling */
    .port-lookup-modal div[style*="justify-content: space-between"][style*="height: 60px"],
    .worker-orders-modal div[style*="justify-content: space-between"][style*="height: 60px"],
    .callout-stats-section div[style*="justify-content: space-between"][style*="height: 60px"],
    .port-lookup-modal div[style*="justify-content: space-between"][style*="height: 50px"],
    .worker-orders-modal div[style*="justify-content: space-between"][style*="height: 50px"],
    .callout-stats-section div[style*="justify-content: space-between"][style*="height: 50px"],
    .port-lookup-modal div[style*="justify-content: space-between"][style*="align-items: end"],
    .worker-orders-modal div[style*="justify-content: space-between"][style*="align-items: end"],
    .callout-stats-section div[style*="justify-content: space-between"][style*="align-items: end"],
    div[style*="display: flex"][style*="justify-content: space-between"][style*="align-items: end"][style*="height: 60px"],
    div[style*="display: flex"][style*="justify-content: space-between"][style*="align-items: end"][style*="height: 50px"],
    div[style*="display: flex"][style*="justify-content: space-between"][style*="align-items: end"][style*="border-bottom: 1px solid #dee2e6"] {
        overflow-x: visible !important;
        overflow-y: visible !important;
        flex-wrap: nowrap !important;
        min-width: auto !important;
        width: 100% !important;
        max-width: 100% !important;
        white-space: nowrap !important;
    }
    
    /* NUCLEAR FIX: Target any div that contains Last 12 Months chart */
    div:has(h5:contains("Last 12 Months")) div[style*="display: flex"],
    div:has(h5:contains("📊 Last 12 Months")) div[style*="display: flex"],
    h5:contains("Last 12 Months") + div[style*="display: flex"],
    h5:contains("📊 Last 12 Months") + div[style*="display: flex"] {
        overflow-x: visible !important;
        overflow-y: visible !important;
        width: 100% !important;
        max-width: 100% !important;
        flex-wrap: nowrap !important;
    }

    /* CLEAN CHART FIX: Proper chart display without horizontal scrolling */
    .last-12-months-chart,
    .callout-stats-section .last-12-months-chart,
    div[class*="last-12-months-chart"] {
        display: flex !important;
        justify-content: space-between !important;
        align-items: end !important;
        overflow: hidden !important;
        width: 100% !important;
        max-width: 100% !important;
        flex-wrap: nowrap !important;
    }

    .last-12-months-chart > div,
    .callout-stats-section .last-12-months-chart > div {
        flex: 1 !important;
        min-width: 0 !important;
        max-width: calc(100% / 12) !important;
        overflow: hidden !important;
    }
    
    /* TARGETED FIX: Only enable horizontal scrolling for work history tables */
    .work-history-table,
    .work-history-container,
    div[style*="work history"] table,
    .port-lookup-modal .analysis-card table,
    .worker-orders-modal .analysis-card table {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
    }
    
    .work-history-table table,
    .work-history-container table {
        min-width: 600px !important;
        width: max-content !important;
    }

    /* EXCLUDE CHARTS: No horizontal scrolling for chart sections */
    .callout-stats-section,
    .callout-stats-section *,
    div[class*="callout"],
    div[class*="chart"] {
        overflow-x: hidden !important;
    }
    
    /* Target the exact div structure we know exists */
    div[style*="height: 60px"][style*="justify-content: space-between"],
    div[style*="height: 50px"][style*="justify-content: space-between"] {
        overflow-x: visible !important;
        overflow-y: visible !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    /* SUPER SPECIFIC FIX: Target the month columns inside charts */
    .last-12-months-chart > div,
    .last-12-months-chart div[style*="flex: 1"],
    div[style*="justify-content: space-between"] > div[style*="flex: 1"],
    div[style*="height: 50px"] > div[style*="flex: 1"],
    div[style*="height: 60px"] > div[style*="flex: 1"] {
        min-width: 0 !important;
        flex: 1 !important;
        overflow-x: visible !important;
        width: auto !important;
        max-width: none !important;
    }

    /* MAXIMUM SPECIFICITY NUCLEAR OPTION */
    html body .port-lookup-modal .last-12-months-chart div,
    html body .worker-orders-modal .last-12-months-chart div,
    html body div.port-lookup-modal div.last-12-months-chart div,
    html body div.worker-orders-modal div.last-12-months-chart div,
    html body .port-lookup-modal div[style*="height: 50px"] div,
    html body .worker-orders-modal div[style*="height: 50px"] div,
    html body .port-lookup-modal div[style*="height: 60px"] div,
    html body .worker-orders-modal div[style*="height: 60px"] div {
        min-width: 0 !important;
        flex: 1 1 8.33% !important;
        overflow-x: visible !important;
        width: auto !important;
        max-width: 8.33% !important;
    }

    /* JAVASCRIPT-LEVEL SPECIFICITY: Replicate what the working JavaScript did */
    html body div.port-lookup-modal div.last-12-months-chart div[style],
    html body div.worker-orders-modal div.last-12-months-chart div[style],
    html body .port-lookup-modal .last-12-months-chart div[style*="display: flex"],
    html body .worker-orders-modal .last-12-months-chart div[style*="display: flex"],
    html body .callout-stats-section .last-12-months-chart div[style*="display: flex"],
    html body div[class*="modal"] div.last-12-months-chart div[style*="flex"],
    html body .last-12-months-chart div[style*="min-width"] {
        min-width: 0 !important;
        flex: 1 !important;
        overflow-x: visible !important;
        width: auto !important;
        max-width: none !important;
    }

    /* ABSOLUTE NUCLEAR OPTION - Override EVERYTHING */
    * div.last-12-months-chart div {
        min-width: 0 !important;
        flex: 1 !important;
        overflow-x: visible !important;
        width: auto !important;
        max-width: none !important;
    }
    
    /* ULTIMATE OVERRIDE - INLINE STYLE LEVEL SPECIFICITY */
    html body div div div.last-12-months-chart[style] {
        overflow-x: visible !important;
        width: 100% !important;
        max-width: 100% !important;
        min-width: auto !important;
    }
    
    html body div div div.last-12-months-chart[style] > div[style*="flex"],
    html body div div div.last-12-months-chart[style] > div[style*="min-width"],
    html body div div div.last-12-months-chart[style] > div[style*="display"],
    html body div div div.last-12-months-chart[style] > div {
        min-width: 0 !important;
        flex: 1 !important;
        overflow-x: visible !important;
        width: auto !important;
        max-width: none !important;
    }

    /* MOBILE AND DESKTOP FIX */
    @media screen and (max-width: 768px) {
        html body div div div.last-12-months-chart[style] > div {
            min-width: 0 !important;
            flex: 1 !important;
            overflow-x: visible !important;
            width: auto !important;
            max-width: none !important;
        }
    }
    
         @media screen and (min-width: 769px) {
         html body div div div.last-12-months-chart[style] > div {
             min-width: 0 !important;
             flex: 1 !important;
             overflow-x: visible !important;
             width: auto !important;
             max-width: none !important;
         }
     }

     /* TARGET THE EXACT PROBLEM FROM CONSOLE INSPECTION */
     div[style*="min-width: 100%"][style*="overflow-x: auto"][style*="flex: 1"] {
         min-width: 0 !important;
         flex: 1 !important;
         overflow-x: visible !important;
         width: auto !important;
         max-width: none !important;
     }
    
    /* Fix scrollbars on WebKit browsers */
    .port-lookup-modal div[style*="grid"]::-webkit-scrollbar,
    .port-lookup-modal div[style*="flex"]::-webkit-scrollbar,
    .callout-stats-section::-webkit-scrollbar,
    .work-history-section::-webkit-scrollbar {
        height: 8px !important;
        width: 8px !important;
    }
    
    .port-lookup-modal div[style*="grid"]::-webkit-scrollbar-track,
    .port-lookup-modal div[style*="flex"]::-webkit-scrollbar-track,
    .callout-stats-section::-webkit-scrollbar-track,
    .work-history-section::-webkit-scrollbar-track {
        background: rgba(0, 0, 0, 0.1) !important;
        border-radius: 4px !important;
    }
    
    .port-lookup-modal div[style*="grid"]::-webkit-scrollbar-thumb,
    .port-lookup-modal div[style*="flex"]::-webkit-scrollbar-thumb,
    .callout-stats-section::-webkit-scrollbar-thumb,
    .work-history-section::-webkit-scrollbar-thumb {
        background: rgba(0, 0, 0, 0.3) !important;
        border-radius: 4px !important;
    }
    
    .port-lookup-modal div[style*="grid"]::-webkit-scrollbar-thumb:hover,
    .port-lookup-modal div[style*="flex"]::-webkit-scrollbar-thumb:hover,
    .callout-stats-section::-webkit-scrollbar-thumb:hover,
    .work-history-section::-webkit-scrollbar-thumb:hover {
        background: rgba(0, 0, 0, 0.5) !important;
    }
}

/* =============================================================================
   MANUAL CORRECTION SYSTEM STYLES
   ============================================================================= */

.correction-admin-panel {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.3s ease;
}

.correction-admin-panel .admin-header {
    background: linear-gradient(135deg, #2c3e50 0%, #3498db 100%);
    color: white;
    padding: 1.5rem 2rem;
    border-radius: 15px 15px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.1);
}

.correction-admin-panel .admin-header h3 {
    margin: 0;
    font-size: 1.4rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.correction-admin-panel .admin-header h3 i {
    font-size: 1.2rem;
    color: #ecf0f1;
}

.header-buttons {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.correction-admin-panel .admin-content {
    background: white;
    width: 95vw;
    max-width: 1200px;
    max-height: 90vh;
    border-radius: 0 0 15px 15px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.correction-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    padding: 2rem;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-bottom: 1px solid #dee2e6;
}

.correction-stats .stat-card {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    border: 1px solid #e9ecef;
}

.correction-stats .stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
}

.correction-tabs {
    display: flex;
    background: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
    padding: 0 2rem;
}

.tab-btn {
    background: none;
    border: none;
    padding: 1rem 1.5rem;
    cursor: pointer;
    border-radius: 8px 8px 0 0;
    margin-right: 0.5rem;
    transition: all 0.2s ease;
    font-weight: 500;
    color: #6c757d;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.tab-btn.active {
    background: white;
    color: #2c3e50;
    border-bottom: 3px solid #3498db;
    transform: translateY(-1px);
}

.tab-btn:hover:not(.active) {
    background: rgba(52, 152, 219, 0.1);
    color: #3498db;
}

.tab-content {
    display: none;
    padding: 2rem;
    overflow-y: auto;
    flex: 1;
}

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

.section-header {
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #e9ecef;
}

.section-header h4 {
    margin: 0 0 0.5rem 0;
    color: #2c3e50;
    font-size: 1.3rem;
    font-weight: 600;
}

.section-header p {
    margin: 0;
    color: #6c757d;
    font-size: 0.95rem;
}

.cases-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.case-card {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.case-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
}

.case-card.suspicious {
    border-left: 4px solid #e74c3c;
}

.case-card.corrected {
    border-left: 4px solid #27ae60;
}

.case-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.case-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #2c3e50;
    margin: 0;
}

.case-status {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
}

.case-status.pending-review {
    background: #fff3cd;
    color: #856404;
}

.case-status.reviewed {
    background: #d4edda;
    color: #155724;
}

.case-status.corrected {
    background: #d1ecf1;
    color: #0c5460;
}

.case-details {
    margin-bottom: 1rem;
}

.case-detail-item {
    display: flex;
    margin-bottom: 0.5rem;
}

.case-detail-label {
    font-weight: 600;
    color: #495057;
    min-width: 120px;
}

.case-detail-value {
    color: #6c757d;
}

.case-reasons {
    background: rgba(231, 76, 60, 0.05);
    border: 1px solid rgba(231, 76, 60, 0.2);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.case-reasons h5 {
    margin: 0 0 0.5rem 0;
    color: #e74c3c;
    font-size: 0.95rem;
    font-weight: 600;
}

.case-reasons ul {
    margin: 0;
    padding-left: 1.2rem;
    color: #721c24;
}

.case-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.case-actions .btn {
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
}

.btn-secondary {
    background: #6c757d;
    color: white;
    border: none;
}

.btn-secondary:hover {
    background: #545b62;
    transform: translateY(-1px);
}

.btn-success {
    background: #28a745;
    color: white;
    border: none;
}

.btn-success:hover {
    background: #218838;
    transform: translateY(-1px);
}

.btn-danger {
    background: #dc3545;
    color: white;
    border: none;
}

.btn-danger:hover {
    background: #c82333;
    transform: translateY(-1px);
}

/* Enhanced Ship Tracking Button - Maximum Specificity */
.header-actions a.btn.btn-ship-tracking,
a.btn.btn-ship-tracking,
.btn.btn-ship-tracking {
    position: relative !important;
    background: linear-gradient(135deg, #2c5aa0 0%, #1e3a6f 50%, #0f2747 100%) !important;
    color: white !important;
    border: 2px solid #3498db !important;
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.3) !important;
    transition: all 0.3s ease !important;
    overflow: hidden !important;
    font-weight: 600 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    padding: 12px 20px !important;
    font-size: 14px !important;
    min-width: 160px !important;
    border-radius: 8px !important;
    text-decoration: none !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
}

.header-actions a.btn.btn-ship-tracking:hover,
a.btn.btn-ship-tracking:hover,
.btn.btn-ship-tracking:hover {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 50%, #1f5f99 100%) !important;
    border-color: #5dade2 !important;
    box-shadow: 0 6px 25px rgba(52, 152, 219, 0.5) !important;
    transform: translateY(-2px) !important;
    color: white !important;
    text-decoration: none !important;
}

.header-actions a.btn.btn-ship-tracking .fas,
a.btn.btn-ship-tracking .fas,
.btn.btn-ship-tracking .fas {
    margin-right: 8px !important;
    animation: pulse 2s infinite !important;
    color: white !important;
}

.header-actions a.btn.btn-ship-tracking .btn-glow,
a.btn.btn-ship-tracking .btn-glow,
.btn.btn-ship-tracking .btn-glow {
    position: absolute !important;
    top: -50% !important;
    left: -50% !important;
    width: 200% !important;
    height: 200% !important;
    background: radial-gradient(circle, rgba(52, 152, 219, 0.1) 0%, transparent 70%) !important;
    opacity: 0 !important;
    transition: opacity 0.3s ease !important;
    pointer-events: none !important;
}

.header-actions a.btn.btn-ship-tracking:hover .btn-glow,
a.btn.btn-ship-tracking:hover .btn-glow,
.btn.btn-ship-tracking:hover .btn-glow {
    opacity: 1 !important;
    animation: glow 1.5s ease-in-out infinite alternate !important;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

@keyframes glow {
    0% { opacity: 0.3; }
    100% { opacity: 0.8; }
}

/* Desktop shine effect */
.header-actions a.btn.btn-ship-tracking:before,
a.btn.btn-ship-tracking:before,
.btn.btn-ship-tracking:before {
    content: '' !important;
    position: absolute !important;
    top: 0 !important;
    left: -100% !important;
    width: 100% !important;
    height: 100% !important;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent) !important;
    transition: left 0.5s !important;
}

.header-actions a.btn.btn-ship-tracking:hover:before,
a.btn.btn-ship-tracking:hover:before,
.btn.btn-ship-tracking:hover:before {
    left: 100% !important;
}

/* Mobile adjustments */
@media (max-width: 768px) {
    .header-actions a.btn.btn-ship-tracking,
    a.btn.btn-ship-tracking,
    .btn.btn-ship-tracking {
        padding: 8px 12px !important;
        font-size: 12px !important;
        min-width: auto !important;
        border-radius: 6px !important;
    }
    
    /* Mobile: vessel schedules use full-screen modal approach */
    /* All styling handled via JavaScript for zoom compatibility */
}

.correction-form {
    max-width: 600px;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #495057;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ced4da;
    border-radius: 6px;
    font-size: 0.95rem;
    transition: all 0.2s ease;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.form-group textarea {
    min-height: 150px;
    resize: vertical;
    font-family: 'Courier New', monospace;
}

.form-group small {
    display: block;
    margin-top: 0.25rem;
    color: #6c757d;
    font-size: 0.85rem;
}

.loading-placeholder {
    text-align: center;
    padding: 3rem;
    color: #6c757d;
}

.admin-buttons {
    position: fixed;
    top: 50%;
    right: 20px;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    z-index: 1000;
}

.admin-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: white;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.3);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.admin-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(52, 152, 219, 0.4);
}

.admin-btn:active {
    transform: scale(0.95);
}

/* Responsive Design */
@media (max-width: 768px) {
    .correction-admin-panel .admin-content {
        width: 100vw;
        height: 100vh;
        border-radius: 0;
    }
    
    .correction-admin-panel .admin-header {
        border-radius: 0;
        padding: 1rem;
    }
    
    .correction-stats {
        grid-template-columns: repeat(2, 1fr);
        padding: 1rem;
        gap: 1rem;
    }
    
    .tab-content {
        padding: 1rem;
    }
    
    .case-header {
        flex-direction: column;
        gap: 0.5rem;
        align-items: flex-start;
    }
    
    .case-actions {
        flex-direction: column;
    }
    
    .admin-buttons {
        position: fixed;
        bottom: 20px;
        right: 20px;
        top: auto;
        transform: none;
        flex-direction: row;
    }
    
    .admin-btn {
        width: 45px;
        height: 45px;
        font-size: 1.1rem;
    }
}

@media (max-width: 480px) {
    .correction-stats {
        grid-template-columns: 1fr;
    }
    
    .tab-btn {
        padding: 0.75rem;
        font-size: 0.9rem;
    }
    
    .case-detail-item {
        flex-direction: column;
    }
    
    .case-detail-label {
        min-width: auto;
        margin-bottom: 0.25rem;
    }
}

/* Manual Override UI Styles */
.duplicate-name-indicator {
    position: relative;
    display: inline-block;
}

.duplicate-badge {
    background: linear-gradient(135deg, #ff6b6b, #ee5a24);
    color: white;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
    margin-left: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(255, 107, 107, 0.3);
    animation: duplicatePulse 2s infinite;
}

.duplicate-badge:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(255, 107, 107, 0.4);
}

@keyframes duplicatePulse {
    0%, 100% { 
        box-shadow: 0 2px 8px rgba(255, 107, 107, 0.3);
    }
    50% { 
        box-shadow: 0 2px 12px rgba(255, 107, 107, 0.6);
    }
}

.manual-override-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    border: 2px solid #3498db;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    min-width: 350px;
    max-width: 500px;
    padding: 16px;
    animation: dropdownSlideIn 0.3s ease-out;
}

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

.dropdown-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid #ecf0f1;
}

.dropdown-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: #2c3e50;
    display: flex;
    align-items: center;
    gap: 6px;
}

.dropdown-close {
    background: none;
    border: none;
    font-size: 1.2rem;
    color: #95a5a6;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.dropdown-close:hover {
    color: #e74c3c;
    background: #f8f9fa;
}

.candidates-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 12px;
}

.candidate-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    border: 2px solid #ecf0f1;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
}

.candidate-option:hover {
    border-color: #3498db;
    background: linear-gradient(135deg, #e3f2fd 0%, #ffffff 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.15);
}

.candidate-option.selected {
    border-color: #27ae60;
    background: linear-gradient(135deg, #d5f4e6 0%, #ffffff 100%);
    box-shadow: 0 4px 12px rgba(39, 174, 96, 0.2);
}

.candidate-option.manual-override {
    border-color: #f39c12;
    background: linear-gradient(135deg, #fef9e7 0%, #ffffff 100%);
    box-shadow: 0 4px 12px rgba(243, 156, 18, 0.2);
}

.candidate-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.candidate-name {
    font-weight: 600;
    color: #2c3e50;
    font-size: 0.85rem;
}

.candidate-details {
    display: flex;
    gap: 8px;
    font-size: 0.75rem;
    color: #7f8c8d;
}

.candidate-badge {
    padding: 2px 6px;
    border-radius: 8px;
    font-weight: 500;
    font-size: 0.7rem;
}

.candidate-badge.port {
    background: #3498db;
    color: white;
}

.candidate-badge.seniority {
    background: #9b59b6;
    color: white;
}

.candidate-badge.company {
    background: #34495e;
    color: white;
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.candidate-score {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.75rem;
    color: #27ae60;
    font-weight: 600;
}

.score-high {
    color: #27ae60;
}

.score-medium {
    color: #f39c12;
}

.score-low {
    color: #e74c3c;
}

.resolution-method {
    font-size: 0.65rem;
    color: #95a5a6;
    font-style: italic;
    margin-top: 2px;
}

.dropdown-actions {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    margin-top: 12px;
    padding-top: 8px;
    border-top: 1px solid #ecf0f1;
}

.action-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 4px;
}

.btn-save {
    background: linear-gradient(135deg, #27ae60, #2ecc71);
    color: white;
    flex: 1;
}

.btn-save:hover {
    background: linear-gradient(135deg, #219a52, #27ae60);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(39, 174, 96, 0.3);
}

.btn-save:disabled {
    background: #bdc3c7;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-cancel {
    background: #ecf0f1;
    color: #7f8c8d;
}

.btn-cancel:hover {
    background: #d5dbdb;
    color: #2c3e50;
}

.override-status {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.7rem;
    color: #f39c12;
    margin-top: 4px;
    font-weight: 500;
}

.confidence-indicator {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.7rem;
    margin-top: 2px;
}

.confidence-high {
    color: #27ae60;
}

.confidence-medium {
    color: #f39c12;
}

.confidence-low {
    color: #e74c3c;
}

/* Mobile responsive styles for manual override UI */
@media (max-width: 768px) {
    .manual-override-dropdown {
        min-width: 280px;
        max-width: 90vw;
        padding: 12px;
        font-size: 0.8rem;
    }
    
    .dropdown-title {
        font-size: 0.8rem;
    }
    
    .candidate-option {
        padding: 8px 10px;
    }
    
    .candidate-name {
        font-size: 0.8rem;
    }
    
    .candidate-details {
        font-size: 0.7rem;
        gap: 6px;
    }
    
    .candidate-badge {
        font-size: 0.65rem;
        padding: 2px 5px;
    }
    
    .candidate-badge.company {
        max-width: 100px;
    }
    
    .action-btn {
        padding: 6px 12px;
        font-size: 0.75rem;
    }
    
    .duplicate-badge {
        font-size: 0.65rem;
        padding: 2px 6px;
    }
}

@media (max-width: 480px) {
    .manual-override-dropdown {
        min-width: 260px;
        padding: 10px;
    }
    
    .candidate-option {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
    
    .candidate-score {
        align-self: flex-end;
    }
    
    .candidate-badge.company {
        max-width: 80px;
    }
    
    .dropdown-actions {
        flex-direction: column;
    }
    
    .action-btn {
        width: 100%;
        justify-content: center;
    }
}

/* Status cards styling */
.stat-card.status-working {
    background: linear-gradient(135deg, #4caf50, #2ecc71);
    color: white;
}

.stat-card.status-fresh {
    background: linear-gradient(135deg, #ffeb3b, #ffc107);
    color: #2c3e50;
}

.stat-card.status-worked {
    background: linear-gradient(135deg, #27ae60, #2ecc71);
    color: white;
}

.stat-card.status-future {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
}

/* Enhanced Mobile Touch Scrolling - Fix for diagonal and horizontal scrolling issues */
@media screen and (max-width: 768px) {
    /* Enhance all scrollable elements */
    * {
        /* Better touch scrolling for all elements */
        -webkit-overflow-scrolling: touch !important;
        scroll-behavior: smooth !important;
    }
    
    /* Fix modal scrolling interference */
    .worker-orders-modal,
    .port-lookup-modal {
        /* Enable momentum scrolling */
        -webkit-overflow-scrolling: touch !important;
        overscroll-behavior: contain !important;
        /* Allow natural touch gestures */
        touch-action: auto !important;
    }
    
    .worker-orders-modal .modal-content,
    .port-lookup-modal .modal-content {
        /* Ensure modal content scrolls naturally */
        overflow: auto !important;
        -webkit-overflow-scrolling: touch !important;
        overscroll-behavior: auto !important;
        touch-action: auto !important;
        /* Remove scroll blocking */
        -ms-overflow-style: -ms-autohiding-scrollbar !important;
    }
    
    /* Fix horizontal scrolling for wide content */
    .work-history-table,
    .callout-stats-section,
    .analysis-card {
        overflow-x: auto !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch !important;
        overscroll-behavior: auto !important;
        touch-action: auto !important;
        /* Keep momentum scrolling enabled */
        scroll-behavior: smooth !important;
    }
    
    /* Enhance general page scrolling */
    html, body {
        /* Remove any momentum blocking */
        -ms-overflow-style: -ms-autohiding-scrollbar !important;
        scroll-behavior: smooth !important;
        /* Ensure proper touch action */
        touch-action: auto !important;
        -webkit-overflow-scrolling: touch !important;
        overscroll-behavior: auto !important;
    }
    
    /* Fix for container scrolling */
    .container, .main {
        overflow: visible !important;
        touch-action: auto !important;
        -webkit-overflow-scrolling: touch !important;
    }
    
    /* Maximum touch freedom for ALL elements */
    button, input, select, textarea, a, .btn, .clickable {
        touch-action: auto !important;
    }
    
    /* Special fix for modal overlays */
    .worker-orders-modal::before,
    .port-lookup-modal::before {
        content: none !important;
    }
}

/* Additional momentum scrolling enhancement for all devices */
@supports (-webkit-overflow-scrolling: touch) {
    * {
        -webkit-overflow-scrolling: touch;
    }
}

/* ULTIMATE MOBILE TOUCH: Maximum freedom approach */
@media screen and (max-width: 768px) {
    /* Give maximum touch freedom to everything */
    html, body {
        touch-action: auto !important;
        overscroll-behavior: auto !important;
        -webkit-overflow-scrolling: touch !important;
        /* Remove any scroll blocking */
        overflow: auto !important;
    }
    
    /* Maximum touch freedom for modals */
    .port-lookup-modal,
    .worker-orders-modal {
        touch-action: auto !important;
        -webkit-overflow-scrolling: touch !important;
        overscroll-behavior: auto !important;
    }
    
    /* Maximum touch freedom for all containers */
    .container, .main, .orders-cards-grid, .orders-grid {
        touch-action: auto !important;
        -webkit-overflow-scrolling: touch !important;
        overscroll-behavior: auto !important;
        overflow: visible !important;
    }
}

/* SIMPLE BUT EFFECTIVE: Remove all touch blockers */
@media screen and (max-width: 768px) {
    /* Remove ALL restrictions - pure touch freedom */
    *, *::before, *::after {
        touch-action: auto !important;
        -webkit-overflow-scrolling: touch !important;
    }
    
    /* Ensure no modal interference */
    .worker-orders-modal::backdrop,
    .port-lookup-modal::backdrop,
    .modal-backdrop {
        pointer-events: none !important;
    }
    
    /* Force momentum scrolling everywhere */
    html, body, .container, .main, 
    .orders-grid, .orders-cards-grid,
    .modal-content, .port-lookup-content {
        -webkit-overflow-scrolling: touch !important;
        overscroll-behavior: auto !important;
    }
}

/* GLOBAL MOBILE PERFORMANCE OPTIMIZATION */
@media screen and (max-width: 768px) {
    /* Optimize body for smooth touch scrolling */
    body {
        -webkit-overflow-scrolling: touch;
        touch-action: auto;
        overscroll-behavior: auto;
    }
    
    /* Optimize scrollable containers */
    .modal-content,
    .port-lookup-content,
    .work-history-table {
        -webkit-transform: translate3d(0, 0, 0);
        transform: translate3d(0, 0, 0);
    }
}

/* ULTRA-FAST MOBILE MOMENTUM SCROLLING */
@media screen and (max-width: 768px) {
    /* Modal containers: Basic momentum scrolling */
    .worker-orders-modal,
    .port-lookup-modal {
        -webkit-overflow-scrolling: touch;
        touch-action: auto;
    }
    
    /* Work history tables: Enable horizontal scrolling */
    .work-history-table {
        overflow-x: auto;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        touch-action: auto;
        scroll-behavior: smooth;
    }
    
    /* Tables: Force minimum width for horizontal scroll */
    .work-history-table table {
        min-width: 600px;
        width: max-content;
        white-space: nowrap;
    }
    
    /* Call-out sections: NO horizontal scrolling */
    .callout-stats-section {
        overflow-x: visible;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    
         /* Modal content: Enable momentum scrolling */
     .modal-content,
     .port-lookup-content {
         -webkit-overflow-scrolling: touch;
         touch-action: auto;
     }
     
     /* CRITICAL: Force horizontal scrolling for work history in modals */
     .port-lookup-modal .work-history-table,
     .worker-orders-modal .work-history-table {
         overflow-x: auto !important;
         overflow-y: auto !important;
         -webkit-overflow-scrolling: touch !important;
         scroll-behavior: smooth !important;
         /* Ensure container allows horizontal expansion */
         width: 100% !important;
         max-width: 100% !important;
     }
     
           /* Force tables to require horizontal scrolling */
      .port-lookup-modal .work-history-table table,
      .worker-orders-modal .work-history-table table {
          min-width: 650px !important;
          width: max-content !important;
          table-layout: auto !important;
      }
      
      /* Override any problematic inline styles */
      .port-lookup-modal div[style*="overflow-x: hidden"],
      .worker-orders-modal div[style*="overflow-x: hidden"],
      .port-lookup-modal div[style*="overflow: hidden"],
      .worker-orders-modal div[style*="overflow: hidden"] {
          overflow-x: auto !important;
          overflow-y: auto !important;
      }
      
      /* Ensure maximum touch responsiveness */
      .port-lookup-modal,
      .worker-orders-modal {
          pointer-events: auto !important;
          touch-action: auto !important;
      }
}
  
  /* CALL-OUT CHARTS: Simple compact 12-month display */
  .last-12-months-chart {
      display: flex;
      justify-content: space-between;
      align-items: end;
      overflow: visible;
      width: 100%;
  }
  
  .last-12-months-chart > div {
      flex: 1;
      min-width: 0;
  }
 
  /* MOBILE APP STYLES - Full Screen Port Lookup Experience */
.port-lookup-mobile-app {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    z-index: 10001;
    display: flex;
    flex-direction: column;
    animation: slideInRight 0.3s ease-out;
    overflow: hidden;
}

.mobile-app-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
    overflow: hidden;
}

/* Mobile App Header */
.mobile-app-header {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    padding: env(safe-area-inset-top, 20px) 20px 20px 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    min-height: 80px;
}

.mobile-back-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 12px;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.mobile-back-btn:hover,
.mobile-back-btn:active {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(0.95);
}

.mobile-app-title h1 {
    color: white;
    font-size: 24px;
    font-weight: 700;
    margin: 0;
    line-height: 1.2;
}

.mobile-app-title p {
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
    margin: 2px 0 0 0;
    font-weight: 400;
}

/* Mobile Search Section */
.mobile-search-section {
    padding: 20px;
    flex-shrink: 0;
}

.mobile-search-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 24px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.search-input-wrapper {
    position: relative;
    margin-bottom: 20px;
}

.search-icon {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: #7f8c8d;
    font-size: 18px;
    z-index: 2;
}

.mobile-port-input {
    width: 100%;
    padding: 20px 20px 20px 55px;
    border: 2px solid #e9ecef;
    border-radius: 16px;
    font-size: 18px;
    font-weight: 600;
    background: white;
    color: #2c3e50;
    box-sizing: border-box;
    transition: all 0.3s ease;
    -webkit-appearance: none;
    appearance: none;
}

.mobile-port-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
    transform: translateY(-2px);
}

.mobile-port-input::placeholder {
    color: #bdc3c7;
    font-weight: 400;
}

.mobile-search-btn {
    width: 100%;
    padding: 20px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    border: none;
    border-radius: 16px;
    color: white;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.4);
}

.mobile-search-btn:active {
    transform: translateY(2px);
    box-shadow: 0 2px 10px rgba(102, 126, 234, 0.4);
}

/* Mobile Results Section */
.mobile-results-section {
    flex: 1;
    overflow-y: auto;
    padding: 0 20px 20px 20px;
    -webkit-overflow-scrolling: touch;
}

.mobile-worker-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    animation: slideInUp 0.4s ease-out;
}

.mobile-worker-header {
    background: linear-gradient(135deg, #2c5aa0, #3498db);
    color: white;
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.worker-avatar {
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: white;
}

.worker-info h2 {
    font-size: 24px;
    font-weight: 700;
    margin: 0;
    line-height: 1.2;
}

.worker-info .port-number {
    font-size: 16px;
    margin: 4px 0 0 0;
    opacity: 0.9;
    font-weight: 500;
}

/* Mobile Stats Grid */
.mobile-stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 1px;
    background: #e9ecef;
    margin: 0;
}

.mobile-stat-card {
    background: white;
    padding: 20px 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    transition: background 0.3s ease;
}

.mobile-stat-card.primary {
    background: #f8f9fa;
}

.mobile-stat-card .stat-icon {
    font-size: 24px;
    margin-bottom: 8px;
}

.mobile-stat-card .stat-value {
    font-size: 20px;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 4px;
    line-height: 1.2;
}

.mobile-stat-card .stat-label {
    font-size: 12px;
    color: #7f8c8d;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Mobile Work History */
.mobile-work-history {
    padding: 24px;
}

.mobile-work-history h3 {
    color: #2c3e50;
    font-size: 18px;
    font-weight: 700;
    margin: 0 0 16px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.mobile-history-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.mobile-history-item {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 16px;
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 12px;
    align-items: center;
}

.history-date {
    font-size: 14px;
    font-weight: 700;
    color: #3498db;
    text-align: center;
    min-width: 60px;
}

.history-details {
    flex: 1;
}

.history-company {
    font-size: 14px;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 2px;
}

.history-position {
    font-size: 13px;
    color: #7f8c8d;
    margin-bottom: 2px;
}

.history-vessel {
    font-size: 12px;
    color: #95a5a6;
    font-style: italic;
}

.history-time {
    font-size: 13px;
    font-weight: 600;
    color: #e67e22;
    text-align: right;
    min-width: 60px;
}

.mobile-show-more {
    background: #3498db;
    color: white;
    border: none;
    border-radius: 12px;
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 16px;
    width: 100%;
    transition: all 0.3s ease;
}

.mobile-show-more:active {
    transform: translateY(1px);
    background: #2980b9;
}

/* Mobile No History State */
.mobile-no-history {
    padding: 40px 24px;
    text-align: center;
}

.no-history-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.mobile-no-history h3 {
    color: #2c3e50;
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 8px 0;
}

.mobile-no-history p {
    color: #7f8c8d;
    font-size: 14px;
    margin: 0;
}

/* Mobile Action Buttons */
.mobile-action-buttons {
    padding: 20px 24px 24px 24px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    border-top: 1px solid #ecf0f1;
    background: #f8f9fa;
}

.mobile-action-btn {
    padding: 16px 20px;
    border: none;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.mobile-action-btn.primary {
    background: #27ae60;
    color: white;
}

.mobile-action-btn.secondary {
    background: white;
    color: #7f8c8d;
    border: 2px solid #e9ecef;
}

.mobile-action-btn:active {
    transform: translateY(1px);
}

/* Mobile Error Card */
.mobile-error-card {
    background: white;
    border-radius: 20px;
    padding: 40px 24px;
    text-align: center;
    animation: slideInUp 0.4s ease-out;
}

.error-icon {
    font-size: 64px;
    margin-bottom: 20px;
}

.mobile-error-card h3 {
    color: #e74c3c;
    font-size: 22px;
    font-weight: 700;
    margin: 0 0 12px 0;
}

.mobile-error-card p {
    color: #7f8c8d;
    font-size: 16px;
    margin: 0 0 24px 0;
    line-height: 1.5;
}

.mobile-retry-btn {
    background: #e74c3c;
    color: white;
    border: none;
    border-radius: 12px;
    padding: 16px 24px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.mobile-retry-btn:active {
    transform: translateY(1px);
    background: #c0392b;
}

/* Mobile Loading State */
.mobile-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    text-align: center;
    color: white;
}

.loading-spinner-mobile {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 255, 255, 0.2);
    border-top: 4px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 16px;
}

.mobile-loading p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 16px;
    font-weight: 500;
    margin: 0;
}

/* Mobile Toast */
.mobile-toast {
    position: fixed;
    top: env(safe-area-inset-top, 20px);
    left: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 16px 20px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 500;
    text-align: center;
    z-index: 10002;
    transform: translateY(-100px);
    opacity: 0;
    transition: all 0.3s ease;
}

.mobile-toast.show {
    transform: translateY(0);
    opacity: 1;
}

.mobile-toast-warning {
    background: rgba(243, 156, 18, 0.9);
}

.mobile-toast-error {
    background: rgba(231, 76, 60, 0.9);
}

.mobile-toast-success {
    background: rgba(39, 174, 96, 0.9);
}

/* Body state when mobile app is open */
body.mobile-app-open {
    overflow: hidden;
    position: fixed;
    width: 100%;
    height: 100%;
}

/* Animations */
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

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

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

/* Vessel Schedules Modal Styles - Based on Port Lookup Modal */
.vessel-schedules-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
    /* Enhanced mobile touch support */
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    transform: none;
}

.vessel-schedules-modal-content {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    overflow-x: hidden;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3);
    animation: slideIn 0.4s ease;
    /* Enhanced mobile scrolling */
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    touch-action: manipulation;
}

.vessel-schedules-modal-header {
    background: linear-gradient(135deg, #27ae60 0%, #2ecc71 100%);
    color: white;
    padding: 25px;
    position: relative;
    border-radius: 20px 20px 0 0;
}

.vessel-schedules-modal-header .header-gradient h2 {
    margin: 0 0 8px 0;
    font-size: 1.5rem;
    font-weight: 700;
}

.vessel-schedules-modal-header .header-gradient p {
    margin: 0;
    font-size: 1rem;
    opacity: 0.9;
}

.vessel-schedules-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    color: white;
    font-size: 1.8rem;
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.vessel-schedules-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

.vessel-schedules-modal-body {
    /* Enhanced mobile scrolling */
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}

/* Mobile responsive for Vessel Schedules Modal */
@media screen and (max-width: 768px) {
    .vessel-schedules-modal {
        /* Counter the body zoom like port lookup modal */
        transform: scale(1.818) translate(0, 0) !important;
        -webkit-transform: scale(1.818) translate(0, 0) !important;
        transform-origin: top left !important;
        -webkit-transform-origin: top left !important;
    }
    
    .vessel-schedules-modal-content {
        width: 95% !important;
        max-width: 95% !important;
        max-height: 90vh !important;
        /* Enhanced touch scrolling */
        -webkit-overflow-scrolling: touch !important;
        overscroll-behavior: contain !important;
        scroll-behavior: smooth !important;
    }
    
    .vessel-schedules-modal-header {
        padding: 20px 15px;
    }
    
    .vessel-schedules-modal-header .header-gradient h2 {
        font-size: 1.3rem;
    }
    
    .vessel-schedules-modal-header .header-gradient p {
        font-size: 0.9rem;
    }
    
    .vessel-schedules-close {
        top: 15px;
        right: 15px;
        width: 35px;
        height: 35px;
        font-size: 1.5rem;
    }
}

/* End of media query for vessel schedules modal */