/* Reset and Base Styles */
* {
        margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f5f7fa;
    color: #2d3748;
    line-height: 1.6;
}

/* Main Layout */
.main-container {
    display: flex;
    min-height: 100vh;
    background-color: #fff;
}

/* Sidebar */
.sidebar {
    display: flex;
    padding: 4px;
    width: 94px;
    background-color: #FFF;
    padding: var(--16, 16px);
    flex-direction: column;
    align-items: center;
    gap: var(--8, 8px);
    flex-shrink: 0;
    height: 100vh;
    border-right: 1px solid #e2e8f0;
}

.logo-section {
    padding: 0 0 20px 0;
    width: 100%;
    display: flex;
    justify-content: center;
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 20px;
}

.logo {
    background: transparent;
    padding: 0;
    border-radius: 8px;
    text-align: center;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.logo-image {
    width: 60px;
    height: auto;
    max-width: 100%;
    object-fit: contain;
}

.dashboard-icon-section {
    padding: 20px 0;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.dashboard-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.dashboard-icon:hover {
    transform: scale(1.05);
}

.dashboard-icon svg {
    width: 32px;
    height: 32px;
    color: #4a5568;
}

/* Main Content */
.main-content {
    flex: 1;
    padding: 40px;
    overflow-y: auto;
    background: white;
    margin-left: 10px;
    margin-right:60px
}

/* Header */
.header {
    margin-bottom: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-width: 0; /* Allow flex items to shrink */
}



.breadcrumb {
    font-size: 16px;
    color: #718096;
    display: flex;
    align-items: center;
    gap: 8px;
}

.breadcrumb-icon {
    color: #718096;
    flex-shrink: 0;
}

.breadcrumb strong {
    color: #2d3748;
    font-weight: 600;
}

/* Header Actions */
.header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-right: -30px; /* Negative margin to counteract main-content padding */
    flex-shrink: 0;
}

.logout-btn {
    background: #ef4444;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    white-space: nowrap;
}

.logout-btn:hover {
    background: #dc2626;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

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

.logout-btn i {
    font-size: 16px;
}

/* Tab Navigation */
.tab-navigation {
    display: flex;
    background: transparent;
    margin-bottom: 30px;
    border: 1px solid #e2e8f0;
    gap: 8px;
    justify-content: flex-start;
    align-items: center;
    border-top: none;
    border-right: none;
    border-left: none;
}

.tab {
    flex: none;
    width: auto;
    min-width: 180px;
    padding: 12px 20px;
    text-align: center;
    cursor: pointer;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    color: #7e7e7e;
    transition: all 0.3s ease;
    border: 1px solid #e2e8f0;
    background: white;
}

.tab:hover {
    color: #202224;
    background: #f7fafc;
    border-color: #cbd5e0;
}

.tab.active {
    background: #f1f5f9;
    color: #202224;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    border: 1px solid #e2e8f0;
}

/* Authentication loader spinner animation */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Authentication error notifications */
.auth-error {
    animation: slideInRight 0.3s ease-out;
}

.auth-error.error {
    background: #ef4444 !important;
}

.auth-error.warning {
    background: #f59e0b !important;
}

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

/* Disabled tab styling */
.tab.disabled {
    background: #f8fafc;
    border-color: #cbd5e1;
    color: #94a3b8;
    cursor: not-allowed;
    opacity: 0.6;
    position: relative;
}



.tab.disabled:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    transform: none;
    box-shadow: none;
}

.tab.disabled::after {
    content: '🔒';
    position: absolute;
    top: 50%;
    right: 12px;
    transform: translateY(-50%);
    opacity: 0.7;
    font-size: 12px;
}

/* Tab Loading Overlay */
.tab-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 100;
    border-radius: 12px;
}

.tab-loading-overlay .loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #e2e8f0;
    border-top: 4px solid #338AF3;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 15px;
}

.tab-loading-overlay p {
    color: #4a5568;
    font-size: 16px;
    font-weight: 500;
    margin: 0;
}

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

/* Anomalies Section */
.anomalies-section {
    margin-bottom: 30px;
}

.section-header {
    margin-bottom: 25px;
}

.section-header h2 {
    font-size: 28px;
    font-weight: 700;
    color: #2d3748;
}

/* Cards */
.card {
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    border: 1px solid #cbd5e0;
    margin-bottom: 25px;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    background: transparent;
    color: #7e7e7e;
    font-size: 14px;
    cursor: pointer;
}

/* Collapse Button */
.collapse-btn {
    background: none;
    border: none;
    color: #7e7e7e;
    cursor: pointer;
    padding: 8px;
    border-radius: 4px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    position: relative;
    overflow: hidden;
}

.collapse-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(59, 130, 246, 0.1);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.collapse-btn:hover::before {
    width: 32px;
    height: 32px;
}

.collapse-btn:hover {
    background: rgba(59, 130, 246, 0.05);
    color: #3b82f6;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15);
}

.collapse-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.2);
}

.collapse-btn i {
    font-size: 14px;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    z-index: 1;
}

/* Card Content Animation */
.card-content {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    max-height: 2000px; /* Large enough to accommodate content */
    opacity: 1;
    transform: translateY(0);
}

/* Collapsed Card State */
.card.collapsed .card-content {
    max-height: 0;
    opacity: 0;
    transform: translateY(-10px);
    margin: 0;
    padding: 0;
    /* Ensure no content spacing affects collapsed state */
}

.card.collapsed .collapse-btn i {
    transform: rotate(-90deg);
}

/* Card Header Animation */
.card-header {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.card.collapsed .card-header {
    margin-bottom: 0;
    /* Ensure uniform padding when collapsed */
    padding: 16px 20px 16px 20px; /* top right bottom left */
}

/* Smooth collapse indicator */
.card.collapsed::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, #e5e7eb 0%, #d1d5db 50%, #e5e7eb 100%);
    opacity: 0.6;
    transition: opacity 0.3s ease;
}

/* Hover effects for collapsed cards */
.card.collapsed:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
}

.card.collapsed:hover::after {
    opacity: 1;
    background: linear-gradient(90deg, #3b82f6 0%, #1d4ed8 50%, #3b82f6 100%);
}

/* Loading state for collapse button */
.collapse-btn.loading {
    pointer-events: none;
    opacity: 0.7;
}

.collapse-btn.loading i {
    animation: collapse-spin 1s linear infinite;
}

@keyframes collapse-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Smooth expand animation */
.card.expanding .card-content {
    animation: expand-content 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

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

/* Enhanced card animations */
.card {
    transform-origin: top center;
}

.card.collapsed {
    /* Removed scale transform to maintain uniform size */
}

.card.collapsed:hover {
    transform: translateY(-2px); /* Only move up, no scaling */
}

/* Smooth content reveal */
.card-content > * {
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.card.collapsed .card-content > * {
    opacity: 0;
    transform: translateY(-5px);
}

/* Professional button states */
.collapse-btn:focus-visible {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
    border-radius: 6px;
}

/* Smooth icon transitions */
.collapse-btn i.fa-chevron-down,
.collapse-btn i.fa-chevron-right {
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Card shadow transitions */
.card:not(.collapsed):hover {
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
}

.card.collapsed:hover {
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.1);
}

.card-title {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 18px;
    font-weight: 600;
    color: #2d3748;
}

.card-title-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #e3f2fd;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.card-title-icon svg {
    color: #1976d2;
    width: 24px;
    height: 24px;
}

.card-title-icon img {
    width: 32px;
    height: 32px;
    object-fit: contain;
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.1));
}

.card-content {
    padding: 25px;
    position: relative;
}

/* Anomaly Types Information Section - Full Width Above Filter */
.anomaly-types-info-top {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    border: 1px solid #cbd5e0;
    border-radius: 8px;
    padding: 8px 15px;
    margin-bottom: 15px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
    position: relative;
    width: 100%;
    z-index: 5;
}

.info-header {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 6px;
    padding-bottom: 4px;
    border-bottom: 1px solid #e2e8f0;
}

.info-header i {
    color: #3b82f6;
    font-size: 12px;
}

.info-header h4 {
    margin: 0;
    color: #2d3748;
    font-size: 11px;
    font-weight: 600;
}

/* Compact anomaly types layout - Full Width */
.anomaly-types-compact {
    display: flex;
    flex-direction: row;
    gap: 20px;
    justify-content: space-between;
}

.anomaly-type-compact {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 2px 0;
    flex: 1;
}

.anomaly-type-desc {
    font-size: 11px;
    color: #6b7280;
    font-style: italic;
    line-height: 1.4;
    flex: 1;
}

.anomaly-types-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.anomaly-type-item {
    background: white;
    border-radius: 6px;
    padding: 10px;
    border: 1px solid #e2e8f0;
    transition: all 0.2s ease;
}

.anomaly-type-item:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.anomaly-type-header {
    margin-bottom: 6px;
}

.anomaly-type-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.anomaly-type-badge.unknown {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #f59e0b;
}

.anomaly-type-badge.suspicious {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #f59e0b;
}

.anomaly-type-description {
    margin: 0;
    color: #4a5568;
    font-size: 12px;
    line-height: 1.4;
}

/* Responsive design for anomaly types info */
@media (max-width: 768px) {
    .anomaly-types-compact {
        flex-direction: column;
        gap: 8px;
    }
    
    .anomaly-type-compact {
        align-items: center;
    }
    
    .anomaly-types-info-top {
        padding: 6px 12px;
        margin-bottom: 12px;
    }
    
    .anomaly-types-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .anomaly-types-info {
        padding: 10px;
    }
    
    .anomaly-type-item {
        padding: 8px;
    }
}

/* Table Styles */
.table-container {
    margin-bottom: 30px;
    overflow-x: auto;
    overflow-y: auto;
    max-height: 350px;
    border: 1px solid #cbd5e0;
    border-radius: 8px;
    padding: 0;
    position: relative;
    /* Custom scrollbar styling */
    scrollbar-width: thin;
    scrollbar-color: #cbd5e0 #f7fafc;
    /* Ensure sticky headers work properly */
    contain: layout;
}

/* Webkit scrollbar styling for Chrome/Safari/Edge */
.table-container::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.table-container::-webkit-scrollbar-track {
    background: #f7fafc;
    border-radius: 4px;
}

.table-container::-webkit-scrollbar-thumb {
    background: #cbd5e0;
    border-radius: 4px;
    border: 1px solid #f7fafc;
}

.table-container::-webkit-scrollbar-thumb:hover {
    background: #a0aec0;
}

.riders-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    position: relative;
    margin: 20px;
}

.riders-table th {
    background: #f7fafc;
    padding: 15px 12px;
    text-align: left;
    font-weight: 600;
    color: #4a5568;
    border-bottom: 2px solid #e2e8f0;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
    /* Make headers sticky/fixed during scroll */
    position: sticky;
    top: -1px;
    z-index: 100;
    background-color: #f7fafc;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin: 0;
    border-top: 1px solid #cbd5e0;
}

.riders-table td {
    padding: 15px 12px;
    border-bottom: 1px solid #e2e8f0;
    vertical-align: middle;
    white-space: nowrap;
    overflow: visible;
    text-overflow: ellipsis;
}

/* Override for comments column */
.riders-table td.comments-cell {
    padding: 8px 4px !important;
    text-align: center !important;
    vertical-align: middle !important;
    white-space: normal !important;
    /* Ensure proper border alignment with other cells */
    border-bottom: 1px solid #e2e8f0 !important;
    position: relative; /* Required for absolute positioning of children */
    /* Ensure perfect vertical alignment of content */
    display: table-cell;
    line-height: 1;
    /* Force consistent cell height and alignment */
    height: 60px; /* Fixed height to ensure consistency */
    min-height: 60px;
    max-height: 60px;
}

.riders-table tbody tr {
    position: relative;
    /* Ensure consistent row height */
    height: 60px;
    min-height: 60px;
    max-height: 60px;
}

.riders-table tbody tr:hover {
    background: #f7fafc;
}



/* Comments Column */
.comments-cell {
    text-align: center !important;
    vertical-align: middle !important;
    padding: 8px 4px;
    position: relative;
    /* Removed display: flex to fix table border alignment */
    /* display: flex; */
    /* align-items: center; */
    /* justify-content: center; */
    /* Debug: uncomment the line below to see the cell boundaries */
    /* border: 1px solid red; */
}

/* Investigator Comments Section - Read Only */
.comment-section {
    margin-top: 15px;
    padding: 15px;
    background-color: #f8fafc;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.comment-header h5 {
    margin: 0 0 10px 0;
    color: #374151;
    font-size: 14px;
    font-weight: 600;
}

.comments-display {
    min-height: 40px;
}

.comment-text {
    background-color: #ffffff;
    padding: 12px;
    border-radius: 6px;
    border: 1px solid #d1d5db;
    color: #374151;
    font-size: 14px;
    line-height: 1.5;
    word-wrap: break-word;
}

.no-comments-text {
    color: #9ca3af;
    font-style: italic;
    text-align: center;
    padding: 20px;
    font-size: 14px;
}

/* Comments Modal Styles */
.comments-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(1px);
    cursor: pointer;
}

.comments-modal-content {
    background-color: #f8fafc;
    position: absolute;
    padding: 0;
    border-radius: 12px;
    width: 400px;
    max-width: 90vw;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.15), 0 10px 10px -5px rgba(0, 0, 0, 0.1);
    animation: tooltipSlideIn 0.2s ease-out;
    overflow: hidden;
    border: 1px solid #e2e8f0;
}

/* Tooltip arrow/pointer */
.comments-modal-content::before {
    content: '';
    position: absolute;
    top: var(--arrow-top, -12px);
    bottom: var(--arrow-bottom, auto);
    left: 20px;
    width: 0;
    height: 0;
    border-left: 12px solid transparent;
    border-right: 12px solid transparent;
    border-bottom: var(--arrow-border-bottom, 12px solid #f8fafc);
    border-top: var(--arrow-border-top, none);
    z-index: 1;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.1));
}

.comments-modal-content::after {
    content: '';
    position: absolute;
    top: var(--arrow-after-top, -13px);
    bottom: var(--arrow-after-bottom, auto);
    left: 20px;
    width: 0;
    height: 0;
    border-left: 12px solid transparent;
    border-right: 12px solid transparent;
    border-bottom: var(--arrow-after-border-bottom, 12px solid #e2e8f0);
    border-top: var(--arrow-after-border-top, none);
    z-index: 0;
    filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.05));
}

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

.comments-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 20px 24px 16px 24px;
    border-bottom: 1px solid #e2e8f0;
}

.comment-header-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.commenter-name {
    font-weight: 600;
    color: #374151;
    font-size: 16px;
    margin: 0;
}

.comment-timestamp {
    color: #9ca3af;
    font-size: 12px;
    margin: 0;
}



.close-modal-btn {
    background: #f3f4f6;
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #6b7280;
}

.close-modal-btn:hover {
    background: #e5e7eb;
    color: #374151;
}

.comments-list {
    padding: 20px 24px 24px 24px;
    max-height: 300px;
    overflow-y: auto;
    background-color: #ffffff;
}

.comment-item {
    margin-bottom: 20px;
    padding: 16px;
    border-radius: 8px;
    background-color: #f8fafc;
    border: 1px solid #e2e8f0;
}

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



.comment-content {
    color: #374151;
    font-size: 14px;
    line-height: 1.6;
    word-wrap: break-word;
    margin: 0;
}



/* Empty state for no comments */
.no-comments-message {
    text-align: center;
    color: #9ca3af;
    font-style: italic;
    padding: 60px 20px;
    font-size: 14px;
    background-color: #f8fafc;
    border-radius: 8px;
    border: 1px dashed #d1d5db;
    margin: 20px 0;
}

/* Status Change Comment Modal Styles */
.status-change-modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
}

/* Disabled Modal State */
.status-change-modal.modal-disabled {
    pointer-events: none;
}

.status-change-modal.modal-disabled::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.1);
    z-index: 1;
    pointer-events: none;
}

.status-change-modal.modal-disabled .status-change-modal-content {
    opacity: 0.8;
    filter: grayscale(20%);
}

.status-change-modal-content {
    background-color: #ffffff;
    margin: 5% auto;
    padding: 0;
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    animation: modalSlideIn 0.3s ease-out;
    border: 1px solid #e2e8f0;
}

.status-change-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 24px 20px 24px;
    border-bottom: 1px solid #e2e8f0;
    background-color: #f8fafc;
    border-radius: 12px 12px 0 0;
}

.header-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-title i {
    color: #ef4444;
    font-size: 20px;
}

.header-title h3 {
    margin: 0;
    color: #1f2937;
    font-size: 18px;
    font-weight: 600;
}

.status-change-modal-body {
    padding: 24px;
}

.delivery-info-section {
    margin-bottom: 24px;
    padding: 20px;
    background-color: #ffffff;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.section-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.section-header i {
    color: #3b82f6;
    font-size: 18px;
}

.section-header h4 {
    margin: 0;
    color: #1f2937;
    font-size: 16px;
    font-weight: 600;
}

.delivery-info-grid {
    display: grid;
    gap: 12px;
}

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

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

.info-label {
    color: #6b7280;
    font-size: 14px;
    font-weight: 500;
}

.info-value {
    color: #1f2937;
    font-size: 14px;
    font-weight: 600;
}

.status-info-section {
    margin-bottom: 24px;
    padding: 16px;
    background-color: #f8fafc;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.status-info-item {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    font-size: 14px;
    color: #374151;
}

.status-info-item:last-child {
    margin-bottom: 0;
}

.status-info-item i {
    color: #6b7280;
    width: 16px;
}

.status-info-item strong {
    color: #1f2937;
    font-weight: 600;
}

.comment-section {
    margin-bottom: 24px;
}

.comment-section label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    font-weight: 600;
    color: #374151;
    font-size: 14px;
}

.comment-section label i {
    color: #3b82f6;
}

.status-comment-textarea {
    width: 100%;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    padding: 16px;
    font-size: 14px;
    line-height: 1.5;
    resize: vertical;
    min-height: 100px;
    font-family: inherit;
    box-sizing: border-box;
    transition: border-color 0.2s ease;
}

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

.status-comment-textarea:invalid {
    border-color: #ef4444;
}

.status-change-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 20px 24px 24px 24px;
    border-top: 1px solid #e2e8f0;
    background-color: #f8fafc;
    border-radius: 0 0 12px 12px;
}

/* Status Messages */
.status-message {
    margin: 16px 0;
    padding: 16px;
    border-radius: 8px;
    border: 1px solid;
    animation: slideInDown 0.3s ease-out;
}

.status-message.success {
    background-color: #ecfdf5;
    border-color: #a7f3d0;
    color: #065f46;
}

.status-message.error {
    background-color: #fef2f2;
    border-color: #fecaca;
    color: #991b1b;
}

.status-message-content {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.status-message-icon {
    flex-shrink: 0;
    font-size: 20px;
    margin-top: 2px;
}

.status-message.success .status-message-icon {
    color: #059669;
}

.status-message.error .status-message-icon {
    color: #dc2626;
}

.status-message-text {
    flex: 1;
    line-height: 1.5;
}

.status-message-text strong {
    font-weight: 600;
}

/* Loading Spinner Animation */
@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Full-Screen Success Overlay */
.fullscreen-success-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100000;
    animation: fadeIn 0.3s ease-out;
}

.fullscreen-success-content {
    background: white;
    padding: 40px;
    border-radius: 16px;
    text-align: center;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: scaleIn 0.3s ease-out;
}

.success-icon {
    font-size: 80px;
    color: #059669;
    margin-bottom: 20px;
}

.success-title {
    font-size: 32px;
    font-weight: 700;
    color: #065f46;
    margin: 0 0 20px 0;
}

.success-message {
    font-size: 16px;
    line-height: 1.6;
    color: #374151;
    margin-bottom: 30px;
}

.success-message strong {
    font-weight: 600;
    color: #111827;
}

.success-close-btn {
    background: #059669;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

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

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

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.cancel-btn {
    background: #f3f4f6;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    cursor: pointer;
    transition: all 0.2s ease;
}

.cancel-btn:hover {
    background: #e5e7eb;
    border-color: #9ca3af;
}

.confirm-btn {
    background: #10b981;
    border: none;
    border-radius: 8px;
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 500;
    color: #ffffff;
    cursor: pointer;
    transition: all 0.2s ease;
}

.confirm-btn:hover {
    background: #059669;
}

.confirm-btn:disabled {
    background: #9ca3af;
    cursor: not-allowed;
}

/* Status-specific styling */
.status-new {
    color: #ef4444 !important;
}

.status-working_progress {
    color: #f59e0b !important;
}

.status-closed {
    color: #059669 !important;
}

.status-under-review {
    color: #3b82f6 !important;
}

/* Disabled new status option */
.status-option.new.disabled {
    opacity: 0.6;
    cursor: not-allowed;
    background-color: #f8f9fa;
    color: #6c757d;
}

.status-option.new.disabled:hover {
    background-color: #f8f9fa;
    color: #6c757d;
}

/* New status error message */
.new-status-error {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #fff;
    border: 2px solid #ff6b6b;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 10000;
    animation: slideInRight 0.3s ease-out;
}

.error-content {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    font-size: 14px;
    color: #333;
    max-width: 400px;
}

.error-close-btn {
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    padding: 4px 8px;
    margin-left: 12px;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.error-close-btn:hover {
    background-color: #f0f0f0;
    color: #666;
}

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

/* No new anomalies message */
.no-new-anomalies {
    text-align: center;
    padding: 40px 20px;
    color: #6c757d;
    font-style: italic;
    background: #f8f9fa;
    border-radius: 8px;
    margin: 20px 0;
}

/* Center align the Comments column header */
.riders-table th:last-child {
    text-align: center !important;
}

/* Global rule to ensure table headers are sticky/fixed during scroll */
table th,
.riders-table th,
thead th {
    position: sticky;
    top: -1px;
    z-index: 100;
    background-color: #f7fafc;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    border-top: 1px solid #cbd5e0;
}

.comment-icon-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 6px 8px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    min-width: 32px;
    height: 32px;
    width: fit-content;
    /* Ensure perfect centering within table cell */
    margin: 0 auto; /* Center horizontally in table cell */
    flex-shrink: 0;
    z-index: 5;
    /* Ensure consistent vertical alignment */
    line-height: 1;
    vertical-align: middle;
    /* Force consistent positioning within fixed-height cell */
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.comment-icon-wrapper.no-comments {
    background-color: #f3f4f6;
    color: #9ca3af;
    border: 1px solid #e5e7eb;
    /* Ensure perfect vertical alignment */
    align-items: center;
    justify-content: center;
}

.comment-icon-wrapper.has-comments {
    background-color: #ecfdf5;
    color: #059669;
    border: 1px solid #a7f3d0;
    /* Ensure perfect vertical alignment */
    align-items: center;
    justify-content: center;
}

/* Hover animations removed for comment icons */

.comment-icon {
    flex-shrink: 0;
    /* Ensure consistent icon alignment */
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.comment-count {
    font-size: 11px;
    font-weight: 600;
    line-height: 1;
    min-width: 16px;
    text-align: center;
    /* Ensure consistent text alignment */
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
}

/* Status Dropdown */
.status-dropdown {
    position: relative;
    display: inline-block;
    z-index: 50;
    /* Ensure proper positioning context for absolute dropdowns */
    overflow: visible;
}

.status-dropdown:hover {
    z-index: 60;
}

/* Ensure dropdown container doesn't clip content */
.status-dropdown {
    overflow: visible !important;
}

.status-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.3s ease;
    min-width: 120px;
    justify-content: space-between;
}

.status-toggle.new {
    background: #F46346;
    color: #fff;
}

.status-toggle.under-review {
    background: #fef5e7;
    color: #d69e2e;
}

.status-toggle.resolved {
    background: #e6fffa;
    color: #2f855a;
}

.status-toggle.no-action {
    background: #338AF3;
    color: #fff;
}

.status-toggle.closed {
    background: #ecfdf5;
    color: #059669;
    border: 1px solid #a7f3d0;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.status-dot.new {
    background: #F46346;
}

.status-dot.under-review {
    background: #d69e2e;
}

.status-dot.resolved {
    background: #2f855a;
}

.status-dot.no-action {
    background: #338AF3;
}

.status-dot.closed {
    background: #059669;
}

.status-menu {
    position: absolute;
    top: auto;
    left: auto;
    right: auto;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    z-index: 70;
    margin-top: 0; /* Remove margin-top as positioning is handled by JavaScript */
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    overflow: hidden;
    min-width: 200px;
    /* Ensure proper positioning */
    transform-origin: top left;
    /* When moved to body, these styles will be overridden by JavaScript */
}

.status-menu.active {
    /* JavaScript handles all positioning and visibility */
    z-index: 80;
}

.status-option {
    padding: 12px 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 12px;
    font-weight: 500;
    transition: background 0.2s ease;
    border-bottom: 1px solid #f1f5f9;
}

.status-option:last-child {
    border-bottom: none;
}

.status-option:hover {
    background: #fef5e7;
}

.status-option:first-child {
    border-radius: 8px 8px 0 0;
    background: #F46346;
    color: #fff;
    font-weight: 600;
}

.status-option:first-child .status-dot {
    background: #fff;
}

.status-option:last-child {
    border-radius: 0 0 8px 8px;
}

/* Non-clickable status dropdowns for non-new riders */
.status-dropdown.non-clickable {
    cursor: default;
    user-select: none;
}

.status-dropdown.non-clickable .status-toggle {
    cursor: default;
    /* Keep the same visual appearance as clickable dropdowns */
    background: #338AF3;
    border: 1px solid #338AF3;
    color: #fff;
    /* Remove interactive effects */
    transform: none;
    transition: none;
}

.status-dropdown.non-clickable .status-toggle:hover {
    background: #338AF3;
    border-color: #338AF3;
    transform: none;
}

.status-dropdown.non-clickable .status-toggle:active {
    transform: none;
}

/* Chart Section - Now uses full width since anomaly descriptions removed */
.chart-descriptions-section {
    display: block;
    margin-bottom: 30px;
}

/* Chart Section */
.chart-section {
    width: 100%;
    margin-bottom: 0;
    max-height: 350px;
    overflow-y: auto;
    /* Custom scrollbar styling */
    scrollbar-width: thin;
    scrollbar-color: #cbd5e0 #f7fafc;
}

/* Webkit scrollbar styling for Chrome/Safari/Edge */
.chart-section::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.chart-section::-webkit-scrollbar-track {
    background: #f7fafc;
    border-radius: 4px;
}

.chart-section::-webkit-scrollbar-thumb {
    background: #cbd5e0;
    border-radius: 4px;
    border: 1px solid #f7fafc;
}

.chart-section::-webkit-scrollbar-thumb:hover {
    background: #a0aec0;
}

.chart-section h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 20px;
    color: #2d3748;
    margin-top: 0; /* Ensure no top margin for better alignment */
}

.bar-chart {
    background: #f7fafc;
    border-radius: 12px;
    padding: 25px;
    border: 1px solid #e2e8f0;
    margin-bottom: 20px; /* Add space between chart and legend */
}

.chart-bars {
    margin-bottom: 20px;
    padding: 0 40px 15px 40px; /* Reduced bottom padding for more compact look */
    max-height: 300px;
    overflow-y: auto;
    /* Custom scrollbar styling for chart bars */
    scrollbar-width: thin;
    scrollbar-color: #cbd5e0 #f7fafc;
}

/* Webkit scrollbar styling for chart bars */
.chart-bars::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

.chart-bars::-webkit-scrollbar-track {
    background: #f7fafc;
    border-radius: 3px;
}

.chart-bars::-webkit-scrollbar-thumb {
    background: #cbd5e0;
    border-radius: 3px;
    border: 1px solid #f7fafc;
}

.chart-bars::-webkit-scrollbar-thumb:hover {
    background: #a0aec0;
}

/* Empty state styling for when no distance anomalies with excessive deliveries are found */
.no-excessive-deliveries {
    text-align: center;
    padding: 40px 20px;
    color: #718096;
    font-size: 16px;
    font-style: italic;
    background: #f7fafc;
    border: 2px dashed #e2e8f0;
    border-radius: 8px;
    margin: 20px 0;
}

/* Professional Filter Section Styling */
.filter-section {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    margin-bottom: 24px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.filter-section:hover {
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
}

.filter-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 16px 24px;
    color: white;
}

.filter-subtitle {
    font-size: 14px;
    opacity: 0.9;
    font-weight: 400;
    text-align: center;
}

.filter-content {
    padding: 16px 24px;
}

.filter-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr auto;
    gap: 20px;
    align-items: end;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.filter-group label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 8px;
    font-weight: 600;
    color: #374151;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.filter-group label i {
    color: #6b7280;
    font-size: 14px;
}

.filter-select {
    padding: 10px 16px;
    padding-right: 36px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 12px;
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 500;
    color: #374151;
    cursor: pointer;
    position: relative;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6,9 12,15 18,9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 12px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
}

.filter-select:hover {
    border-color: #d1d5db;
    background: linear-gradient(135deg, #ffffff 0%, #f1f5f9 100%);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.08);
    transform: translateY(-1px);
}

.filter-select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1), 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
    background: linear-gradient(135deg, #ffffff 0%, #f0f4ff 100%);
}

.filter-select:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Custom option styling */
.filter-select option {
    padding: 12px 16px;
    background: white;
    color: #374151;
    font-weight: 500;
    border: none;
}

.filter-select option:hover {
    background: #f3f4f6;
    color: #1f2937;
}

.filter-select option:checked {
    background: #667eea;
    color: white;
    font-weight: 600;
}

.date-range-group {
    position: relative;
}

.date-range-input {
    position: relative;
    display: flex;
    align-items: center;
}

.filter-date-range {
    width: 100%;
    padding: 10px 16px;
    padding-right: 36px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 12px;
    background: white;
    transition: all 0.3s ease;
    font-weight: 500;
    color: #374151;
    cursor: pointer;
}

.filter-date-range:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
    transform: translateY(-1px);
}

.date-range-input i {
    position: absolute;
    right: 12px;
    color: #9ca3af;
    font-size: 14px;
    pointer-events: none;
    transition: color 0.3s ease;
}

.filter-date-range:focus + i {
    color: #667eea;
}

/* Specific styling for overall anomaly tab filter section */
#overall-section .filter-row {
    grid-template-columns: 1fr 1fr 1.2fr auto;
    gap: 16px;
    align-items: end;
}

#overall-section .filter-group {
    min-width: 0; /* Allow grid items to shrink below their content size */
}

#overall-section .filter-select,
#overall-section .filter-date-range {
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

/* Date Range Picker Overrides */
.daterangepicker {
    z-index: 9999 !important;
    font-family: inherit !important;
    border-radius: 12px !important;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15) !important;
    border: 1px solid #e5e7eb !important;
}

.daterangepicker .ranges li {
    border-radius: 8px !important;
    margin: 4px !important;
    padding: 8px 12px !important;
    font-weight: 500 !important;
    transition: all 0.2s ease !important;
}

.daterangepicker .ranges li:hover {
    background-color: #667eea !important;
    color: white !important;
}

.daterangepicker .ranges li.active {
    background-color: #667eea !important;
    color: white !important;
}

.daterangepicker .drp-buttons {
    border-top: 1px solid #e5e7eb !important;
    padding: 12px !important;
}

.daterangepicker .drp-selected {
    font-weight: 500 !important;
    color: #374151 !important;
}

.daterangepicker .cancelBtn,
.daterangepicker .applyBtn {
    border-radius: 8px !important;
    padding: 8px 16px !important;
    font-weight: 600 !important;
    transition: all 0.2s ease !important;
}

.daterangepicker .applyBtn {
    background-color: #667eea !important;
    border-color: #667eea !important;
}

.daterangepicker .applyBtn:hover {
    background-color: #5a67d8 !important;
    border-color: #5a67d8 !important;
}

.daterangepicker .cancelBtn {
    background-color: #f3f4f6 !important;
    border-color: #d1d5db !important;
    color: #6b7280 !important;
}

.daterangepicker .cancelBtn:hover {
    background-color: #e5e7eb !important;
    border-color: #9ca3af !important;
    color: #374151 !important;
}

.filter-actions {
    display: flex;
    gap: 12px;
    align-items: end;
}

.filter-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    border: none;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    min-width: 140px;
    justify-content: center;
}

.filter-btn.apply {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}

.filter-btn.apply:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(16, 185, 129, 0.4);
}

.filter-btn.clear {
    background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
    color: #6b7280;
    border: 2px solid #e5e7eb;
}

.filter-btn.clear:hover {
    background: linear-gradient(135deg, #e5e7eb 0%, #d1d5db 100%);
    color: #374151;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.filter-btn.download-btn {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
}

.filter-btn.download-btn:hover {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.4);
}

.filter-btn i {
    font-size: 16px;
}

/* Loading states for filter buttons */
.filter-btn.loading {
    opacity: 0.7;
    cursor: not-allowed;
    position: relative;
}

.filter-btn.loading i {
    animation: spin 1s linear infinite;
}

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

/* Responsive Design */
@media (max-width: 1024px) {
    .filter-row {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .filter-actions {
        justify-content: stretch;
    }
    
    .filter-btn {
        flex: 1;
    }
}

@media (max-width: 768px) {
    .filter-content {
        padding: 20px;
    }
    
    .filter-header {
        padding: 16px 20px;
    }
    
    .filter-title {
        font-size: 16px;
    }
}

.bar-item {
    display: flex;
    align-items: center;
    margin-bottom: 12px; /* Reduced from 15px to 12px for more compact spacing */
    gap: 15px;
    min-height: 20px; /* Reduced from 30px to 20px to match new bar height */
    transition: all 0.3s ease;
}

.bar-label {
    width: 80px;
    font-size: 14px;
    font-weight: 500;
    color: #4a5568;
}

.bar-container {
    flex: 1;
    position: relative;
    height: 20px; /* Reduced from 30px to 20px for more compact bars */
    background: #e2e8f0;
    border-radius: 10px; /* Adjusted border-radius to match new height */
    overflow: hidden;
    min-width: 0; /* Allow flex item to shrink below content size */
}

/* Ensure bar wrapper can use full available width */
.bar-wrapper {
    height: 100%;
    display: flex;
    min-width: 0; /* Allow flex item to shrink */
}

/* Ensure bar segments can use full available width */
.bar-average,
.bar-excess {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0; /* Allow flex item to shrink */
}

.bar {
    height: 100%;
    border-radius: 15px;
    transition: width 0.5s ease;
    position: relative;
}

.bar.high {
    background: linear-gradient(90deg, #fc8181, #f56565);
}

.bar.medium {
    background: linear-gradient(90deg, #f6e05e, #ed8936);
}

.bar.low {
    background: linear-gradient(90deg, #68d391, #38a169);
}

.bar-value {
            position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 12px;
    font-weight: 600;
    color: white;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
    white-space: nowrap;
}

.chart-axis {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    padding: 0 40px; /* Increase padding for better axis value distribution */
    gap: 80px; /* Add specific gap between axis values for better spacing */
}

.chart-axis span {
    font-size: 12px;
    color: #718096;
    font-weight: 500;
}

/* Chart Legend Styling */
.chart-legend {
    margin-top: 20px;
    padding: 20px;
    background: linear-gradient(135deg, #f8f9fa, #ffffff);
    border-radius: 12px;
    border: 2px solid #e9ecef;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    /* Ensure legend is always visible and not affected by scrolling */
    position: relative;
    z-index: 10;
    /* Add some visual separation from the chart */
    border-top: 3px solid #e2e8f0;
}

.legend-header {
    text-align: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e9ecef;
}

.legend-header h4 {
    margin: 0 0 5px 0;
    color: #2d3748;
    font-size: 18px;
    font-weight: 600;
}

.legend-header p {
    margin: 0;
    color: #718096;
    font-size: 14px;
    font-style: italic;
}

.legend-summary {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 20px;
    padding: 15px;
    background: linear-gradient(135deg, #f7fafc, #edf2f7);
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.summary-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: rgba(255,255,255,0.8);
    border-radius: 6px;
    border: 1px solid #e2e8f0;
}

.summary-label {
    font-size: 13px;
    color: #4a5568;
    font-weight: 500;
}

.summary-value {
    font-size: 14px;
    color: #2d3748;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 4px;
    background: #f7fafc;
}

.summary-value.anomaly {
    color: #c53030;
    background: #fed7d7;
}

.summary-value.normal {
    color: #38a169;
    background: #c6f6d5;
}

.legend-item {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    margin-bottom: 15px;
    padding: 10px;
    background: rgba(255,255,255,0.7);
    border-radius: 8px;
    transition: all 0.2s ease;
}

.legend-item:hover {
    background: rgba(255,255,255,0.9);
    transform: translateX(5px);
}

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

.legend-color {
    width: 20px;
    height: 20px;
    border-radius: 6px;
    flex-shrink: 0;
    margin-top: 2px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.legend-color.green {
    background: linear-gradient(135deg, #28a745, #20c997);
}

.legend-color.red {
    background: linear-gradient(135deg, #dc3545, #f46346);
}

.legend-content {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.legend-text {
    font-size: 15px;
    color: #2d3748;
    font-weight: 600;
}

.legend-description {
    font-size: 13px;
    color: #718096;
    font-style: italic;
    line-height: 1.4;
}

.legend-note {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 15px;
    padding: 12px;
    background: linear-gradient(135deg, #e6fffa, #f0fff4);
    border: 1px solid #9ae6b4;
    border-radius: 8px;
    color: #22543d;
    font-size: 13px;
}

.legend-note i {
    color: #38a169;
    font-size: 16px;
}

.chart-label {
    text-align: center;
    font-size: 14px;
    font-weight: 600;
    color: #4a5568;
    margin-top: 10px;
}

/* X-Axis Labels (Rider Names) */
.bar-label {
    width: 80px;
    font-size: 14px;
    font-weight: 500;
    color: #4a5568;
    text-align: center;
    margin-bottom: 8px;
}

/* Chart section now uses full width since anomaly descriptions removed */

/* Description items removed - chart section now uses full width */

/* Rider Info Section */
.rider-info {
    width: 100%;
    margin-bottom: 15px;
}

.rider-info h4 {
    margin: 0 0 8px 0;
    color: #2d3748;
    font-size: 16px;
    font-weight: 600;
}

.rider-info p {
    margin: 0;
    color: #4a5568;
    font-size: 14px;
    line-height: 1.4;
}

/* Comment Section Full Width */
.comment-section {
    width: 100%;
    min-width: 0; /* Allow flex shrinking */
}

.comment-form {
    width: 100%;
}

.comment-input {
    width: 100%;
    box-sizing: border-box;
}

.existing-comments {
    width: 100%;
    box-sizing: border-box;
}

.comment-item {
    width: 100%;
    box-sizing: border-box;
}

/* No Flags Message */
.no-flags-message {
  display: flex;
    align-items: center;
    gap: 20px;
    padding: 30px;
    background: linear-gradient(135deg, #e6fffa, #f0fff4);
    border: 1px solid #9ae6b4;
    border-radius: 12px;
    text-align: center; 
}

.info-icon {
    font-size: 48px;
    flex-shrink: 0;
}

.info-content h4 {
    margin: 0 0 10px 0;
    color: #22543d;
    font-size: 20px;
    font-weight: 600;
}

.info-content p {
    margin: 0;
    color: #38a169;
    font-size: 16px;
    line-height: 1.5;
}

/* Collapsible Cards */
.collapsible-cards {
  display: flex;
    flex-direction: column;
            gap: 15px;
}

.collapsible-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    border: 1px solid #e2e8f0;
    cursor: pointer;
    transition: all 0.3s ease;
}

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

.collapsible-card .card-header {
    background: white;
    padding: 20px 25px;
    display: flex;
      align-items: center;
    gap: 15px;
  font-size: 16px;
    font-weight: 500;
    color: #2d3748;
}

.collapsible-card .card-header i:first-child {
    color: #63b3ed;
    font-size: 18px;
}

.collapsible-card .card-header i:last-child {
    color: #a0aec0;
    margin-left: auto;
    transition: transform 0.3s ease;
}

.collapsible-card:hover .card-header i:last-child {
    transform: rotate(180deg);
}

/* Summary Cards */
.summary-cards {
  display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

.summary-card {
    background: white;
  border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    border: 1px solid #e2e8f0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

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

/* Ensure summary cards maintain uniform padding when collapsed */
.summary-card.collapsed .card-header {
    padding: 16px 20px 16px 20px; /* Uniform padding when collapsed */
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
    padding-left: 8px; /* Move content slightly to the right */
    padding-top: 4px; /* Move content slightly to the bottom */
}

.card-header-right {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-right: 20px;
}

/* Card Summary Styling */
.card-summary {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
    margin: 0 24px;
    padding: 12px 20px;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    font-size: 15px;
    font-weight: 500;
    color: #475569;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.card-summary::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    border-radius: 12px 12px 0 0;
}

.card-summary span {
    font-weight: 700;
    font-size: 16px;
    margin: 0 4px;
    padding: 2px 8px;
    border-radius: 6px;
    transition: all 0.2s ease;
}

#yesterday-anomaly-count {
    color: #ffffff;
    background: linear-gradient(135deg, #ef4444, #dc2626);
    box-shadow: 0 2px 4px rgba(239, 68, 68, 0.3);
}

#yesterday-total-deliveries {
    color: #ffffff;
    background: linear-gradient(135deg, #10b981, #059669);
    box-shadow: 0 2px 4px rgba(154, 158, 157, 0.3);
}

.card-summary:hover {
    transform: translateY(-1px);
    transition: all 0.2s ease;
}

.card-summary:hover span {
    transform: scale(1.05);
}

/* Responsive design for card summary */
@media (max-width: 768px) {
    .card-summary {
        margin: 0 16px;
        padding: 10px 16px;
        font-size: 14px;
        flex-direction: column;
        gap: 8px;
    }
    
    .card-summary span {
        font-size: 15px;
        margin: 0 2px;
        padding: 4px 6px;
    }
}

@media (max-width: 480px) {
    .card-summary {
        margin: 0 12px;
        padding: 8px 12px;
        font-size: 13px;
    }
    
    .card-summary span {
        font-size: 14px;
        padding: 3px 5px;
    }
}

.anomaly-time-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    border: 1px solid rgba(59, 130, 246, 0.2);
}

.anomaly-time-indicator i {
    font-size: 11px;
}

.card-icon {
  width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-right: 4px; /* Add slight right margin for better spacing */
}

.card-icon.blue {
    background: #e3f2fd;
    color: #1976d2;
}

.card-icon.green {
    background: #e8f5e8;
    color: #388e3c;
}

.card-icon.orange {
    background: #fff3e0;
    color: #f57c00;
}

.card-icon.purple {
    background: #f3e5f5;
    color: #7b1fa2;
}

.card-icon svg {
    width: 20px;
    height: 20px;
}

.card-content {
    padding-right: 60px;
}

.card-content h3 {
  font-size: 14px;
    font-weight: 700;
    color: #202224;
    margin-bottom: 20px;
    line-height: 1.3;
    white-space: pre-line;
    margin-left: 2px; /* Slight left margin for the title text */
}

.card-stats {
    display: flex;
    justify-content: space-between;
    gap: 20px;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    flex: 1;
}

.stat-value {
    font-size: 24px;
    font-weight: 800;
    color: #202224;
    margin-bottom: 4px;
    line-height: 1;
}

.stat-label {
  font-size: 12px;
    color: #718096;
    font-weight: 400;
    line-height: 1.2;
}

/* Summary Card Subtitle Styling */
.stat-subtitle {
    margin-top: 4px;
    text-align: center;
    font-size: 11px;
    color: #6b7280;
    line-height: 1.2;
}

.stat-subtitle small {
    display: block;
    margin-top: 2px;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .sidebar {
        width: 94px;
    }
    
    .main-content {
        padding: 40px;
    }
    
    .tab-navigation {
  flex-wrap: wrap;
}

    .tab {
        min-width: 150px;
    }
}

@media (max-width: 768px) {
    .main-container {
        flex-direction: row;
    }
    
    .sidebar {
        width: 94px;
        padding: 4px;
        padding: var(--16, 16px);
    }
    
    .main-content {
        padding: 20px 15px;
    }
    
    .tab-navigation {
        flex-direction: column;
        gap: 5px;
    }
    
    .tab {
  border-radius: 6px;
    }
    
    .card-content {
        padding: 20px 15px;
    }
    
    .riders-table {
      font-size: 12px;
    }

    .riders-table th,
    .riders-table td {
        padding: 10px 8px;
    }
    
    .bar-item {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }
    
    .bar-label {
        width: auto;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .sidebar {
        width: 94px;
        padding: 4px;
        padding: var(--16, 16px);
    }
    
    .logo-text {
        font-size: 16px;
    }
    
    .main-content {
        padding: 15px 10px;
    }
    
    .section-header h2 {
        font-size: 24px;
    }
    
    .card-header {
        padding: 15px 20px;
    }
    
    .card-content {
        padding: 15px 20px;
    }
    
    .description-item {
        padding: 12px;
    }
    
    .description-content {
        font-size: 13px;
    }
}

@media (max-width: 1200px) {
    .summary-cards {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .summary-cards {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .summary-card {
        padding: 15px;
    }
    
    .card-content h3 {
        font-size: 13px;
    }
    
    .stat-value {
        font-size: 18px;
    }
  }

  .dashboard-content
{
    width: 100%;
    background-color: #fff;
    overflow-y: hidden;
}

/* Pagination Controls */
.pagination-controls {
    margin: 20px 0;
    padding: 15px;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.pagination-info {
    color: #64748b;
    font-size: 14px;
}

.pagination-buttons {
    display: flex;
    align-items: center;
    gap: 10px;
}

.pagination-btn {
    padding: 8px 16px;
    border: 1px solid #d1d5db;
    background: #ffffff;
    color: #374151;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
}

.pagination-btn:hover:not(:disabled) {
    background: #f3f4f6;
    border-color: #9ca3af;
}

.pagination-btn:disabled {
    background: #f9fafb;
    color: #9ca3af;
    cursor: not-allowed;
    border-color: #e5e7eb;
}

.page-numbers {
    display: flex;
    gap: 5px;
}

.page-number {
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    background: #ffffff;
    color: #374151;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
    min-width: 40px;
    text-align: center;
}

.page-number:hover {
    background: #f3f4f6;
    border-color: #9ca3af;
}

.page-number.active {
    background: #3b82f6;
    color: #ffffff;
    border-color: #3b82f6;
}

.page-number.active:hover {
    background: #2563eb;
    border-color: #2563eb;
}

/* Global Loading Overlay */
.global-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 9998;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(3px);
    animation: fadeIn 0.3s ease-out;
}

.loading-content {
    background: white;
    border-radius: 20px;
    padding: 40px;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 400px;
    width: 90%;
    animation: slideUp 0.3s ease-out;
}

.loading-spinner {
    margin-bottom: 24px;
}

.loading-spinner i {
    font-size: 48px;
    color: #007bff;
    animation: spin 1s linear infinite;
}

.loading-text h3 {
    margin: 0 0 12px 0;
    color: #2d3748;
    font-size: 20px;
    font-weight: 600;
    font-family: inherit;
}

.loading-text p {
    margin: 0;
    color: #6b7280;
    font-size: 16px;
    line-height: 1.5;
    font-family: inherit;
}

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

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

