/* Custom styles for Sonha Logistics - Bootstrap Compatible */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* App Content - Full width within main content area */
.app-content {
    width: 100%;
    max-width: none;
}

/* Extracted timeline styles from inline modal templates */
.timeline-item {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
    position: relative;
    padding-left: 30px;
}
.timeline-item::before {
    content: '';
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid #dee2e6;
}
.timeline-item.completed::before { background-color: #28a745; border-color: #28a745; }
.timeline-item.pending::before { background-color: #ffc107; border-color: #ffc107; }
.timeline-item.not-started::before { background-color: #6c757d; border-color: #6c757d; }
.timeline-item:not(:last-child)::after {
    content: '';
    position: absolute;
    left: 15px;
    top: calc(50% + 6px);
    width: 2px;
    height: 25px;
    background-color: #dee2e6;
}
.timeline-content { flex: 1; }
.timeline-status { font-weight: 600; margin-bottom: 2px; }
.timeline-date { font-size: 0.875rem; color: #6c757d; }

/* Readonly input appearance used in edit modals */
.readonly-field { background-color: #f8f9fa !important; }

/* Choices.js height matching Bootstrap form-control */
.choices__inner {
    min-height: 38px !important;
    padding: 0.375rem 0.75rem !important;
    font-size: 1rem !important;
    line-height: 1.5 !important;
}

.choices__list--multiple .choices__item {
    font-size: 1rem !important;
    line-height: 1.5 !important;
}

/* History timeline styles */
.history-timeline { position: relative; max-height: 40vh; overflow-y: auto; }
/* .history-timeline::before { content: ''; position: absolute; left: 15px; top: 0; bottom: 0; width: 2px; background: #e9ecef; } */
.timeline-step { position: relative; margin-bottom: 10px; padding-left: 10px; }
/* .timeline-step::before { content: ''; position: absolute; left: -22px; top: 6px; width: 12px; height: 12px; border-radius: 50%; border: 3px solid #dee2e6; background: white; }
.timeline-step.completed::before { background: #28a745; border-color: #28a745; }
.timeline-step.pending::before { background: #ffc107; border-color: #ffc107; }
.timeline-step.not-started::before { background: #6c757d; border-color: #6c757d; } */
.timeline-content { background: #f8f9fa; border-radius: 8px; padding: 15px; border-left: 4px solid #dee2e6; }
.timeline-step.completed .timeline-content { background: #d4edda; border-left-color: #28a745; }
.timeline-step.pending .timeline-content { background: #fff3cd; border-left-color: #ffc107; }
.timeline-title { font-weight: 600; margin-bottom: 5px; color: #495057; }
.timeline-step.completed .timeline-title { color: #155724; }
.timeline-step.pending .timeline-title { color: #856404; }
.timeline-meta { font-size: 0.875rem; color: #6c757d; margin-bottom: 5px; }
.timeline-user { font-size: 0.875rem; color: #007bff; font-weight: 500; }
.no-history { text-align: center; padding: 40px 20px; color: #6c757d; }
.no-history i { font-size: 3rem; margin-bottom: 15px; opacity: 0.5; }

/* Mobile responsive fixes for app-content */
@media (max-width: 767.98px) {
    .app-content {
        overflow-x: hidden; /* Prevent horizontal overflow */
        word-wrap: break-word; /* Break long words if necessary */
        padding-left: 0.25rem; /* Small padding to prevent edge touching */
        padding-right: 0.25rem; /* Small padding to prevent edge touching */
    }
}

.tabulator {
    font-size: 14px;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
}

.tabulator-header {
    background-color: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
}

/* Loading spinner */
.loading-spinner {
    animation: spin 1s linear infinite;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    width: 1rem;
    height: 1rem;
}

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

/* Persistent Sidebar Styles */
.sidebar-persistent {
    width: 80px;
    min-height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
    transition: width 0.3s ease;
}

.sidebar-persistent.expanded {
    width: 250px;
}

/* Desktop hover expansion */
@media (min-width: 769px) {
    .sidebar-persistent:not(.expanded):hover {
        width: 250px;
    }
    
    .sidebar-persistent:not(.expanded):hover .menu-text {
        opacity: 1;
        max-width: 200px;
        display: inline-block !important;
    }
    
    .sidebar-persistent:not(.expanded):hover .logo-container {
        flex-direction: row;
        justify-content: flex-start;
        padding-left: 1rem;
    }
    
    .sidebar-persistent:not(.expanded):hover .logo-container img {
        margin-right: 0.5rem;
        margin-bottom: 0 !important;
    }
    
    .sidebar-persistent:not(.expanded):hover .sidebar-menu-item {
        justify-content: flex-start;
    }
    
    .sidebar-persistent:not(.expanded):hover .sidebar-menu-item i {
        margin-right: 0.75rem;
    }
    
    .sidebar-persistent:not(.expanded):hover .sidebar-footer .btn {
        justify-content: flex-start;
    }

    .sidebar-persistent:not(.expanded):hover .sidebar-logo-img {
        max-width: 120px;
        height: 32px;
    }
}

.main-content {
    margin-left: 80px;
    transition: margin-left 0.3s ease;
    min-height: 100vh;
}

/* Mobile responsive fixes for main-content */
@media (max-width: 768px) {
    .main-content {
        margin-left: 0 !important;
        max-width: 100vw;
        overflow-x: hidden;
    }
}

.main-content.expanded {
    margin-left: 250px;
}

/* Logo Section */
.sidebar-logo {
    position: relative;
    overflow: hidden;
}

.logo-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.sidebar-persistent.expanded .logo-container {
    flex-direction: column;  /* Keep vertical layout */
    justify-content: center;  /* Keep centered */
    padding-left: 0;  /* Remove left padding */
}

.sidebar-persistent.expanded .logo-container img {
    margin-right: 0;  /* Remove right margin */
    margin-bottom: 0.5rem;  /* Keep bottom margin */
}

.sidebar-logo-img {
    height: 32px;
    width: auto;
    max-width: 32px;
    margin-bottom: 0.5rem;
    border-radius: 50%; /* Make logo circular */
    object-fit: fill; /* Ensure logo fits properly in circle */
}

.sidebar-persistent.expanded .sidebar-logo-img {
    max-width: 120px;
    height: 32px;
}

/* Sidebar Menu Items */
.sidebar-menu-item {
    transition: all 0.2s ease-in-out;
    border-radius: 0.375rem;
    margin: 0.25rem 0.5rem;
    color: #212529 !important;
    text-decoration: none !important;
    border: none;
    padding: 0.75rem 1rem !important;
    position: relative;
    justify-content: center;
}

.sidebar-persistent.expanded .sidebar-menu-item {
    justify-content: flex-start;
}

.sidebar-menu-item:hover {
    background-color: #e9ecef !important;
    color: #0d6efd !important;
    text-decoration: none !important;
}

.sidebar-menu-item.active {
    background-color: #0d6efd !important;
    color: #ffffff !important;
    font-weight: 600;
}

.sidebar-menu-item i {
    width: 1.25rem;
    height: 1.25rem;
    font-size: 1.1rem;
    flex-shrink: 0;
    margin-right: 0;
}

.sidebar-persistent.expanded .sidebar-menu-item i {
    margin-right: 0.75rem;
}

/* Menu Text Animation */
.menu-text {
    opacity: 0;
    max-width: 0;
    overflow: hidden;
    transition: opacity 0.2s ease-in-out, max-width 0.2s ease-in-out;
    white-space: nowrap;
}

.sidebar-persistent.expanded .menu-text {
    opacity: 1;
    max-width: 200px;
    display: inline-block !important;
}

/* Sidebar Footer */
.sidebar-footer {
    margin-top: auto;
}

.sidebar-footer .btn {
    max-height: 40px;
}

.sidebar-footer .btn i {
    margin-right: 0;
    font-size: 1.2rem;
}

.sidebar-persistent.expanded .sidebar-footer .btn {
    justify-content: flex-start;
}

.sidebar-persistent.expanded .sidebar-footer .btn i {
    margin-right: 0.5rem;
}

/* Toggle Button Animation */
#toggleSidebarBtn i {
    transition: transform 0.3s ease;
}

.sidebar-persistent.expanded #toggleSidebarBtn i {
    transform: rotate(180deg);
}

/* Modal Footer Fix */
.modal-footer {
    background-color: #ffffff !important;
    border-top: 1px solid #dee2e6 !important;
}

/* Responsive Design */
@media (max-width: 768px) {
    .sidebar-persistent {
        transform: translateX(-100%);
        width: 80px;
    }
    
    .sidebar-persistent.mobile-open {
        transform: translateX(0);
        width: 250px;
        z-index: 1001;
    }
    
    .sidebar-persistent.mobile-open .menu-text {
        opacity: 1;
        max-width: 200px;
    }
    
    .sidebar-persistent.mobile-open .d-none {
        display: inline-block !important;
    }
    
    /* Keep logo centered even when expanded */
    .sidebar-persistent.mobile-open .logo-container {
        flex-direction: column;  /* Keep vertical layout */
        justify-content: center;  /* Keep centered */
        padding-left: 0;  /* Remove left padding */
    }
    
    .sidebar-persistent.mobile-open .logo-container img {
        margin-right: 0;  /* Remove right margin */
        margin-bottom: 0.5rem;  /* Keep bottom margin */
    }
    
    .sidebar-persistent.mobile-open .sidebar-menu-item {
        justify-content: flex-start;
    }
    
    .sidebar-persistent.mobile-open .sidebar-menu-item i {
        margin-right: 0.75rem;
    }
    
    .sidebar-persistent.mobile-open .sidebar-footer .btn {
        justify-content: flex-start;
    }
    
    .sidebar-persistent.mobile-open .sidebar-footer .btn i {
        margin-right: 0.5rem;
    }
    
    .main-content {
        margin-left: 0;
        padding-top: 4rem; /* Account for mobile menu button */
    }
    
    .main-content.mobile-sidebar-open {
        margin-left: 0;
    }
    
    /* Overlay effect when sidebar is open */
    .main-content.mobile-sidebar-open::before {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background-color: rgba(0, 0, 0, 0.5);
        z-index: 1000;
        pointer-events: none;
    }
    
    /* Mobile menu toggle */
    .mobile-menu-toggle {
        position: fixed;
        top: 1rem;
        left: 1rem;
        z-index: 1002;
        background: #0d6efd;
        color: white;
        border: none;
        border-radius: 0.375rem;
        padding: 0.5rem;
        width: 40px;
        height: 40px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .main-content main {
        padding-top: 1rem !important;
    }
}

/* Bootstrap Navbar improvements */
.navbar {
    backdrop-filter: blur(10px);
    border-bottom: 1px solid #dee2e6;
}

/* Bootstrap Card improvements */
.card {
    border: 1px solid #dee2e6;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

/* Loading state */
.loading {
    border: 2px solid #f3f3f3;
    border-top: 2px solid #111827;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    display: inline-block;
}

.loading-lg {
    width: 60px;
    height: 60px;
}

/* Step content transitions */
.step-content {
    transition: opacity 0.3s ease-in-out;
}

/* Preview table styling */
#preview-table .tabulator {
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
}

#preview-table .tabulator-header {
    background-color: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
}

/* Bootstrap Button enhancements */
.btn {
    transition: all 0.2s ease-in-out;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 0.25rem 0.75rem rgba(0, 0, 0, 0.15);
}

/* Custom button size for extra small */
.btn-xs {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    border-radius: 0.25rem;
}

/* Responsive Table Styles */
@media (max-width: 768px) {
    .tabulator {
        font-size: 12px;
    }
    
    .tabulator .tabulator-header-filter input {
        font-size: 12px;
        padding: 0.25rem;
    }
    
    .tabulator .tabulator-cell {
        padding: 0.25rem 0.5rem;
    }
    
    .tabulator .tabulator-row .tabulator-cell {
        border-right: none;
    }
    
    .tabulator .tabulator-row {
        border-bottom: 1px solid #dee2e6;
    }
    
    /* Responsive action buttons */
    .tabulator .tabulator-cell .btn {
        padding: 0.125rem 0.25rem;
        font-size: 0.75rem;
    }
    
    .tabulator .tabulator-cell .btn i {
        font-size: 0.75rem;
    }
}

/* Responsive filter section */
@media (max-width: 576px) {
    .card-body .row.g-3 {
        --bs-gutter-x: 0.5rem;
        --bs-gutter-y: 0.5rem;
    }
    
    .card-body .form-label {
        font-size: 0.875rem;
        margin-bottom: 0.25rem;
    }
    
    .card-body .form-control {
        font-size: 0.875rem;
        padding: 0.375rem 0.5rem;
    }
    
    /* Stack date inputs vertically on very small screens */
    .card-body .row.g-2 .col-6 {
        flex: 0 0 100%;
        max-width: 100%;
    }
    
    /* Prevent filters collapse from overflowing */
    #filtersCollapse {
        overflow-x: hidden;
    }
    
    #filtersCollapse .row {
        margin-left: -0.25rem;
        margin-right: -0.25rem;
    }
    
    #filtersCollapse .col-12 {
        padding-left: 0.25rem;
        padding-right: 0.25rem;
    }
}

/* Additional mobile responsive fixes */
@media (max-width: 768px) {
    /* Ensure filter section doesn't overflow container */
    .card-body {
        overflow-x: hidden;
    }
    
    /* Adjust filter button on mobile */
    .d-md-none .btn {
        font-size: 0.875rem;
        padding: 0.5rem 1rem;
    }
    
    /* Fix any potential overflow in filter inputs */
    #filtersCollapse .form-control,
    #filtersCollapse .form-select {
        min-width: 0;
        word-wrap: break-word;
    }
    
    /* Ensure date inputs don't cause overflow */
    #fromDate, #toDate {
        max-width: 100%;
    }
}

/* Tabulator responsive collapse styles */
.tabulator-responsive-collapse-toggle {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 0.25rem;
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    color: #6c757d;
    cursor: pointer;
    margin: 0.25rem 0;
}

.tabulator-responsive-collapse-toggle:hover {
    background: #e9ecef;
}

.tabulator-responsive-collapse-toggle.open .tabulator-responsive-collapse-toggle-close,
.tabulator-responsive-collapse-toggle:not(.open) .tabulator-responsive-collapse-toggle-open {
    display: inline-block;
}

.tabulator-responsive-collapse-toggle .tabulator-responsive-collapse-toggle-close,
.tabulator-responsive-collapse-toggle .tabulator-responsive-collapse-toggle-open {
    display: none;
}

/* Improve mobile table scrolling */
@media (max-width: 768px) {
    .tabulator {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .tabulator .tabulator-tableholder {
        /* Allow the tableholder to shrink on small screens to avoid forcing horizontal overflow.
           Previously a fixed min-width caused an extra horizontal scrollbar on mobile. */
        min-width: 0;
        width: 100%;
    }
}

/* Bootstrap Alert customizations */
.alert {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.alert-custom-success {
    background-color: #d1edff;
    border-color: #bee5eb;
    color: #0c5460;
}

.alert-custom-error {
    background-color: #f8d7da;
    border-color: #f5c6cb;
    color: #721c24;
}

/* Unsaved Changes Highlighting */
.tabulator-row.unsaved-changes {
    background-color: #fff3cd !important; /* Light yellow background */
    border-left: 4px solid #ffc107 !important; /* Yellow left border */
    transition: background-color 0.3s ease;
}

.tabulator-row.unsaved-changes:hover {
    background-color: #ffeaa7 !important; /* Slightly darker yellow on hover */
}

/* Unsaved changes indicator */
.unsaved-indicator {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 8px;
    height: 8px;
    background-color: #ffc107;
    border-radius: 50%;
    border: 1px solid #ffffff;
    box-shadow: 0 0 4px rgba(255, 193, 7, 0.5);
    z-index: 10;
}

/* AI Processing specific styles */
.ai-processing-container {
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    padding: 1rem;
}

.ai-step-indicator {
    background-color: #e9ecef;
    border-radius: 50%;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

.ai-step-indicator.active {
    background-color: #0d6efd;
    color: #ffffff;
}

.ai-step-indicator.completed {
    background-color: #198754;
    color: #ffffff;
}

/* Mobile responsive fixes for filter section */
@media (max-width: 767.98px) {
    .filtersCollapse {
        overflow-x: hidden !important;
        max-width: 100% !important;
        padding-left: 0.5rem !important;
        padding-right: 0.5rem !important;
    }

    .filtersCollapse .row {
        margin-left: 0 !important;
        margin-right: 0 !important;
    }

    .filtersCollapse .col-12,
    .filtersCollapse .col-md-4,
    .filtersCollapse .col-md-6,
    .filtersCollapse .col-md-2 {
        padding-left: 0.25rem !important;
        padding-right: 0.25rem !important;
    }

    /* Ensure form controls don't overflow */
    .filtersCollapse .form-control,
    .filtersCollapse .choicejs-select {
        max-width: 100% !important;
        min-width: 0 !important;
    }

    /* Stack date inputs vertically on very small screens */
    .filtersCollapse .row.g-2 .col-12.col-sm-6 {
        margin-bottom: 0.5rem;
    }
}

/* Truck List Component Styles */
.truck-list-item {
    transition: all 0.2s ease-in-out;
    padding: 0.5rem 0.75rem !important; /* More compact padding */
    margin-bottom: 0.25rem; /* Reduced margin between items */
    border: 1px solid #dee2e6 !important;
    border-radius: 0.375rem !important;
}

.truck-list-item:hover {
    background-color: #f8f9fa !important;
    transform: translateY(-1px);
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

/* Prominent License Plate Header */
.truck-license-header {
    border-bottom: 1px solid #e9ecef;
    padding-bottom: 0.25rem;
}

/* Compact Layout with Vertical Separators */
.truck-compact-layout {
    display: flex;
    align-items: flex-start;
    gap: 0;
    margin-top: 0.5rem;
}

.truck-column-compact {
    flex: 1;
    padding: 0.25rem 0.5rem;
    min-width: 0; /* Allow flex shrinking */
}

.truck-separator {
    width: 1px;
    background-color: #dee2e6;
    margin: 0.25rem 0;
    flex-shrink: 0;
}

.column-row-compact {
    font-size: 0.8rem;
    line-height: 1.3;
    margin-bottom: 0.25rem;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.column-row-compact:last-child {
    margin-bottom: 0;
}

.column-label-compact {
    font-weight: 600;
    color: #495057;
    margin-right: 0.25rem;
}

/* Workflow buttons in compact layout */
.workflow-buttons-compact {
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid #e9ecef;
}

.workflow-buttons-compact .d-flex {
    gap: 0.125rem !important;
}

.workflow-buttons-compact .btn {
    font-size: 0.75rem !important;
    padding: 0.125rem 0.25rem !important;
    margin-bottom: 0.125rem !important;
}

/* Responsive adjustments for compact layout */
@media (max-width: 768px) {
    .truck-compact-layout {
        display: grid;
        gap: 0.5rem 1rem;
        margin-top: 0.5rem;
    }

    .truck-column-compact {
        padding: 0.25rem 0;
        border-bottom: 1px solid #e9ecef;
        margin-bottom: 0.25rem;
    }

    .truck-column-compact:last-child {
        border-bottom: none;
        margin-bottom: 0;
    }

    /* Add vertical separator between the 2 columns */
    .truck-column-compact:nth-child(odd) {
        border-right: 1px solid #dee2e6;
        padding-right: 0.5rem;
    }

    .truck-column-compact:nth-child(even) {
        padding-left: 0.5rem;
    }

    .truck-separator {
        display: none; /* Hide vertical separators on mobile */
    }

    .column-row-compact {
        font-size: 0.75rem;
        margin-bottom: 0.2rem;
    }

    .workflow-buttons-compact {
        margin-top: 0.25rem;
        padding-top: 0.25rem;
    }
}

/* Badge size adjustments */
.badge-sm {
    font-size: 0.7rem !important;
    padding: 0.15rem 0.3rem !important;
}

/* Single row layout for desktop */
@media (min-width: 769px) {
    .truck-row {
        flex-wrap: nowrap !important;
        align-items: flex-start !important; /* Align to top instead of center */
        gap: 1rem !important; /* Add gap between sections */
    }

    .truck-main-info {
        flex: 1 !important;
        min-width: 0; /* Allow flex item to shrink below content size */
        display: flex !important;
        flex-wrap: wrap !important;
        align-items: flex-start !important;
        gap: 0.5rem !important;
    }

    .truck-license-plate {
        flex-shrink: 0;
        font-size: 1rem !important;
        font-weight: 600;
        color: #0d6efd;
        margin: 0;
        white-space: nowrap;
        align-self: flex-start !important;
    }

    .truck-details,
    .truck-address,
    .truck-timestamps {
        font-size: 0.85rem !important;
        margin-bottom: 0 !important;
        padding: 0.2rem 0.4rem !important;
        border-radius: 0.2rem !important;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        max-width: 200px; /* Limit width to prevent overflow */
        flex-shrink: 1; /* Allow shrinking */
        align-self: flex-start !important;
    }

    .truck-details {
        background-color: #f8f9fa;
        border: 1px solid #dee2e6;
    }

    .truck-address {
        background-color: #e9ecef;
        border-left: 3px solid #6c757d;
    }

    .truck-timestamps {
        background-color: #f8f9fa;
        border-left: 3px solid #17a2b8;
    }

    .truck-actions {
        flex-shrink: 0;
        margin-left: auto; /* Push to the right */
        align-self: flex-start !important;
    }

    .workflow-buttons {
        margin-top: 0 !important;
        padding-top: 0 !important;
        border-top: none !important;
    }

    .workflow-buttons .d-flex {
        margin: 0 !important;
        gap: 0.25rem !important;
    }
}

/* Mobile responsive layout */
@media (max-width: 768px) {
    .truck-row {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 0.5rem !important;
    }

    .truck-main-info {
        flex-direction: column !important;
        align-items: flex-start !important;
        width: 100% !important;
        gap: 0.5rem !important;
        display: flex !important;
    }

    .truck-license-plate {
        font-size: 1rem !important;
        font-weight: 600;
        color: #0d6efd;
        margin: 0;
        align-self: flex-start !important;
    }

    .truck-details,
    .truck-address,
    .truck-timestamps {
        font-size: 0.85rem !important;
        margin-bottom: 0 !important;
        padding: 0.25rem 0.5rem !important;
        width: 100% !important;
        max-width: none !important;
        white-space: normal !important;
        align-self: flex-start !important;
    }

    .truck-actions {
        width: 100% !important;
        align-self: flex-start !important;
    }

    .workflow-buttons {
        margin-top: 0.5rem !important;
        padding-top: 0.5rem !important;
        width: 100% !important;
    }

    .workflow-buttons .d-flex {
        justify-content: center !important;
        flex-wrap: wrap !important;
        gap: 0.25rem !important;
    }
}

.truck-list-item .badge-sm {
    font-size: 0.7rem !important; /* Smaller badges */
    padding: 0.2rem 0.4rem !important;
}

.truck-list-item .workflow-buttons .btn {
    font-size: 0.8rem !important; /* Smaller buttons */
    padding: 0.2rem 0.4rem !important; /* Reduced button padding */
    margin-bottom: 0.25rem !important; /* Reduced margin between buttons */
}

/* Compact truck listview layout with new column order */
.truck-details-column-left {
    min-width: 150px;
    flex-shrink: 0;
    padding-right: 1rem;
    border-right: 1px solid #dee2e6;
}

.truck-info-column {
    min-width: 200px;
    flex-shrink: 0;
    padding-right: 1rem;
    border-right: 1px solid #dee2e6;
}

.truck-timestamps-right {
    min-width: 120px;
    flex-shrink: 0;
    padding-right: 1rem;
}

.truck-details-split {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

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

.trailer-info {
    color: #6c757d;
    font-size: 0.85rem;
}

.container-type-info,
.border-gate-info {
    color: #6c757d;
    font-size: 0.85rem;
    margin-bottom: 2px;
}

/* Create your own purple theme */
.btn-purple {
  background-color: #6f42c1; /* Bootstrap’s "purple" shade */
  color: white;
}

.btn-purple:hover {
  background-color: #5a32a3;
  color: white;
}

/* Optional background utility like bg-purple */
.bg-purple {
  background-color: #6f42c1 !important;
  color: white !important;
}

/* Mobile responsive - stack vertically */
@media (max-width: 768px) {
    .truck-details-column-left {
        order: 1;
        min-width: auto;
        width: 100%;
        border-right: none;
        border-bottom: 1px solid #dee2e6;
        padding-right: 0;
        padding-bottom: 0.5rem;
        margin-bottom: 0.5rem;
    }

    .truck-info-column {
        order: 2;
        width: 100%;
        border-right: none;
        border-bottom: 1px solid #dee2e6;
        padding-right: 0;
        padding-bottom: 0.5rem;
        margin-bottom: 0.5rem;
    }

    .truck-timestamps-right {
        order: 3;
        min-width: auto;
        width: 100%;
        border-right: none;
        padding-right: 0;
    }

    .truck-actions {
        order: 4;
        align-self: flex-end;
        margin-top: 0.5rem;
        width: 100%;
    }
}

/* ========================================
   INVENTORY TREE STYLES (Material Icons)
   ======================================== */

/* Material Icons in jsTree */
.jstree-default .jstree-icon.material-icons {
    width: 24px;
    height: 24px;
    line-height: 24px;
    font-size: 20px;
    text-align: center;
    display: inline-block;
    vertical-align: middle;
}

/* Gate icons - Blue */
.jstree-default .jstree-icon.icon-gate {
    color: #2196F3;
}

/* Country/Flag icons - Green */
.jstree-default .jstree-icon.icon-country {
    color: #4CAF50;
}

/* Customer icons - Orange */
.jstree-default .jstree-icon.icon-customer {
    color: #FF9800;
}

/* Route/Location icons - Red */
.jstree-default .jstree-icon.icon-route {
    color: #F44336;
}

/* Login page logo styling - make logo circular */
.logo-container img {
    border-radius: 50% !important;
    object-fit: fill;
}