.vehicles-page-modal-overlay {
    padding: 8px;
    overflow: hidden;
    display: flex;
    justify-content: center;
    top: 5vh;
    position: absolute;
    justify-self: center;
    z-index: 1000;
}

.vehicle-map {
    margin-top: 0.5rem;
    height: 320px;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid var(--border-color, #2b3240);
}

/* Vehicles: Stop Name Autocomplete Dropdown */
.vehicle-stop-search__dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 1050;
    max-height: 200px;
    overflow-y: auto;
    background-color: var(--panel-bg);
    border: 1px solid var(--panel-border);
    border-radius: 6px;
    margin-top: 2px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.vehicle-stop-search__item {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 6px;
    padding: 8px 12px !important;
    color: var(--text-primary);
    cursor: pointer;
    border: none;
    background: transparent;
    width: 100%;
    text-align: left;
}

    .vehicle-stop-search__item:hover {
        background-color: var(--bs-dropdown-link-hover-bg);
        color: var(--text-primary);
    }

.vehicle-stop-search__name {
    font-weight: 500;
}

.vehicle-stop-search__address {
    font-size: 12px;
    color: var(--text-secondary);
}
/* Vehicles view modal sizing */
.vehicle-modal {
    max-width: 720px;
    padding-left: 12px;
    padding-right: 12px;
}

.lp-form__title {
    margin: 0 0 8px 0;
}

.lp-form__required {
    color: #ff6b6b;
}

.lp-form__error {
    color: #ff6b6b;
    font-size: 12px;
}

.lp-form__nowrap {
    display: inline;
    white-space: nowrap;
}

/* Vehicles: main section */
.vehicle-main__grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.vehicle-main__label {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.vehicle-main__planning-row {
    display: flex;
    gap: 8px;
    align-items: flex-start;
    flex-wrap: wrap;
}

.vehicle-main__planning-label {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.vehicle-main__planning-label--code {
    min-width: 120px;
}

/* Vehicles: standard driver dropdown */
.vehicle-main__standard-driver {
    max-width: calc((100% - 24px) / 3); /* Match one column of the 3-column grid */
}

.vehicle-main__standard-driver-btn {
    position: relative;
    text-align: left;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding-right: 2.5rem; /* Space for the arrow */
}

    .vehicle-main__standard-driver-btn::after {
        position: absolute;
        top: 50%;
        right: 1rem;
        transform: translateY(-50%);
        margin-left: 0;
    }

.vehicle-main__standard-driver-text {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.vehicle-main__standard-driver-menu {
    max-height: 200px;
    overflow-y: auto;
    min-width: 100%;
    background-color: var(--panel-bg);
    border-color: var(--panel-border);
}

.vehicle-main__standard-driver-item {
    cursor: pointer;
    padding: 4px 12px !important;
    margin: 0;
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    width: 100%;
    flex-wrap: nowrap !important;
    gap: 8px;
    color: var(--text-primary);
}

    .vehicle-main__standard-driver-item:hover {
        background-color: var(--bs-dropdown-link-hover-bg);
        color: var(--text-primary);
    }

    .vehicle-main__standard-driver-item input[type="checkbox"] {
        margin-top: 0;
        margin-right: 0;
        cursor: pointer;
        flex-shrink: 0;
        width: 14px;
        height: 14px;
    }

.vehicle-main__planning-label--name {
    min-width: 200px;
    flex: 1 1 auto;
}

.vehicle-main__planning-input--code {
    min-width: 120px;
}

.vehicle-main__planning-input--name {
    min-width: 200px;
}

/* Vehicles: list */
.vehicles-list__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 20px 8px 12px;
    margin-top: -2px;
    border-bottom: 1px solid var(--panel-border);
}

.vehicles-list-wrapper {
}

.vehicles-list__subtitle {
    font-size: 14px;
    color: var(--text-secondary, #aab4c3);
}

.vehicles-list__filter-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.vehicles-list__filter-icon--active {
    color: #5893ff;
    opacity: 1;
}

.vehicles-list__filter-icon--inactive {
    color: var(--text-secondary);
    opacity: 0.9;
}

.vehicles-list__filter-input {
    width: 350px;
    min-width: 300px;
}

.vehicles-list-settings-section {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
}



/* Settings page/editor */
.vehicles-page .data-table th {
    position: sticky;
    top: 0;
    z-index: 1;
}

/* On the Working Sets page, keep the table header non-sticky so the subtitle
   appears clearly above the list header and is not covered when scrolling. */
.vehicles-page.vehicles-page--no-top-padding .data-table th {
    position: static;
    top: auto;
}

.vehicles-page .modal-content {
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    border-radius: 8px;
    max-height: calc(100vh - 16px);
    display: flex;
    flex-direction: column;
}

.vehicles-page .modal-overlay {
    padding: 8px;
    overflow: hidden;
}
/* When a full-screen settings page opens a modal overlay as a sibling (e.g. Working Sets editor),
   reduce outer padding and allow the modal to span nearly the full viewport width. */
.vehicles-page + .modal-overlay {
    padding: 8px;
}

    .vehicles-page + .modal-overlay .ws-editor-modal {
        /* Popup-style editor: centered panel with max width/height */
        width: 100%;
        max-width: 1180px;
        max-height: calc(100vh - 40px);
        box-shadow: var(--shadow-3d-lg);
    }


.vehicles-page .config-header {
    border-bottom: 1px solid var(--panel-border);
    padding: 12px;
}

.vehicles-page .config-body {
    padding: 12px;
    flex: 1 1 auto;
    overflow: auto;
}

.vehicles-page .config-footer {
    border-top: 1px solid var(--panel-border);
    padding: 12px;
}

.vehicles-page .form-section {
    background: var(--dashboard-bg);
    border: 1px solid var(--panel-border);
    border-radius: 8px;
    padding: 12px;
}

.vehicles-page label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 12px;
    color: var(--text-secondary);
}

.vehicles-page label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 12px;
    color: var(--text-secondary);
}

.vehicles-page input, .vehicles-page select {
    background-color: var(--panel-bg);
    border: 1px solid var(--panel-border);
    color: var(--text-primary);
    border-radius: 6px;
}

.vehicles-page input,
.vehicles-page select {
    padding: 6px 10px;
}

    /* Override Bootstrap form-select arrow to be white for dark theme */
    .vehicles-page select.form-select {
        background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23ffffff' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
        padding-right: 32px;
    }

    .vehicles-page input::placeholder,
    .vehicles-page select::placeholder,
    .vehicles-page textarea::placeholder,
    .vehicles-page .form-control::placeholder {
        /* Ensure placeholders are visible even when the input is not focused */
        color: var(--text-secondary);
        opacity: 0.85;
    }

.vehicles-page .form-section label > span:first-child {
    color: var(--text-primary);
    font-weight: 600;
}

.vehicles-page .icon-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.vehicles-page .icon-preview {
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    border-radius: 6px;
}

    .vehicles-page .icon-preview i {
        color: var(--text-secondary);
    }

.vehicles-page .icon-select {
    flex: 1;
}

.vehicles-page .icon-picker {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(44px, 1fr));
    gap: 8px;
    max-height: 220px;
    overflow: auto;
    padding-top: 8px;
}

.vehicles-page .icon-choice {
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    border-radius: 6px;
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

    .vehicles-page .icon-choice.selected, .vehicles-page .icon-choice:hover {
        outline: 2px solid var(--accent-blue);
    }

/* Compartments designer */
.vehicles-page .cmp-designer {
    display: flex;
    gap: 0;
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    border-radius: 8px;
    overflow: hidden;
    height: 48px;
}

.vehicles-page .cmp-segment {
    display: flex;
    align-items: center;
    justify-content: center;
    background: color-mix(in srgb, var(--panel-bg) 94%, #000 6%);
    color: var(--text-secondary);
    font-size: 13px;
}

.vehicles-page .cmp-divider {
    width: 6px;
    cursor: col-resize;
    background: color-mix(in srgb, var(--panel-bg) 88%, #000 12%);
    border-left: 1px solid var(--panel-border);
    border-right: 1px solid var(--panel-border);
}

.vehicles-page .cmp-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-top: 10px;
}

.vehicles-page .cmp-row {
    display: contents;
}

.vehicles-page .cmp-header-row {
    display: flex;
    align-items: center;
    gap: 12px;
    justify-content: space-between;
}

.vehicles-page .cmp-subrow {
    display: flex;
    align-items: center;
    gap: 16px;
}

.vehicles-page--no-top-padding {
    padding-top: 0;
}

.vehicles-page .switch {
    position: relative;
    display: inline-block;
    width: 38px;
    height: 22px;
}

    .vehicles-page .switch input {
        opacity: 0;
        width: 0;
        height: 0;
    }

.vehicles-page .slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #6b7280;
    transition: .2s;
    border-radius: 22px;
}

    .vehicles-page .slider:before {
        position: absolute;
        content: "";
        height: 18px;
        width: 18px;
        left: 2px;
        bottom: 2px;
        background: white;
        transition: .2s;
        border-radius: 50%;
    }

.vehicles-page .switch input:checked + .slider {
    background: var(--accent-blue);
}

    .vehicles-page .switch input:checked + .slider:before {
        transform: translateX(16px);
    }

/* Vehicles: depot opening hours table */
.vehicle-depot-hours__table {
    /* Bootstrap table uses CSS variables; override to match dark portal theme */
    --bs-table-bg: transparent;
    --bs-table-color: var(--text-primary);
    --bs-table-striped-bg: transparent;
    --bs-table-hover-bg: color-mix(in srgb, var(--dashboard-bg) 92%, #ffffff 8%);
    --bs-table-border-color: transparent;
}

    .vehicle-depot-hours__table thead th {
        color: var(--text-secondary);
        font-weight: 600;
    }

    .vehicle-depot-hours__table tbody td {
        padding-top: 4px;
        padding-bottom: 4px;
        color: #fff;
    }


/* ===== VEHICLE IMPORT MODAL ===== */
.vehicle-import-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 9999; /* High z-index to be on top of everything */
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.vehicle-import-modal {
    max-width: 900px;
    width: 90%;
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    border-radius: 8px;
    box-shadow: var(--shadow-3d-lg);
    display: flex;
    flex-direction: column;
    max-height: 90vh;
}

    .vehicle-import-modal .modal-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 16px;
        border-bottom: 1px solid var(--panel-border);
    }

    .vehicle-import-modal .modal-title {
        margin: 0;
        font-size: 1.1rem;
        font-weight: 600;
        color:white
    }

    .vehicle-import-modal .modal-body {
        padding: 0;
        overflow-y: auto;
    }

    .vehicle-import-modal .modal-footer {
        padding: 16px;
        border-top: 1px solid var(--panel-border);
        display: flex;
        justify-content: flex-end;
        gap: 8px;
    }

.vehicle-import__upload {
    text-align: center;
    padding: 24px;
}

.vehicle-import__dropzone {
    border: 2px dashed var(--panel-border);
    border-radius: 8px;
    padding: 40px 24px;
    background: color-mix(in srgb, var(--panel-bg) 95%, var(--accent-blue) 5%);
    transition: all 0.2s ease;
}
    .vehicle-import__dropzone p{
        color:white
    }

    .vehicle-import__dropzone:hover {
        border-color: var(--accent-blue);
        background: color-mix(in srgb, var(--panel-bg) 90%, var(--accent-blue) 10%);
    }

.vehicle-import__template {
    border-top: 1px solid var(--panel-border);
    padding-top: 16px;
}

.vehicle-import__processing {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    color: var(--text-secondary);
}

.vehicle-import__result {
    padding: 16px;
}

.vehicle-import__result-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    margin-top: 16px;
    padding: 16px;
    background: var(--panel-bg);
    border-radius: 8px;
}

    .vehicle-import__result-stats .stat {
        display: flex;
        flex-direction: column;
        align-items: center;
        min-width: 80px;
    }

    .vehicle-import__result-stats .stat-value {
        font-size: 24px;
        font-weight: 600;
    }

    .vehicle-import__result-stats .stat-label {
        font-size: 12px;
        color: var(--text-secondary);
        text-transform: uppercase;
    }

/* ===== VEHICLE IMPORT PREVIEW ===== */
.vehicle-import-preview__summary {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 16px;
    padding: 12px 16px;
    background: var(--panel-bg);
    border-radius: 8px;
}

    .vehicle-import-preview__summary .summary-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        min-width: 70px;
    }

    .vehicle-import-preview__summary .summary-value {
        font-size: 20px;
        font-weight: 600;
        color: var(--text-primary);
    }

    .vehicle-import-preview__summary .summary-label {
        font-size: 11px;
        color: var(--text-secondary);
        text-transform: uppercase;
    }

    .vehicle-import-preview__summary .summary-item--success .summary-value {
        color: #28a745;
    }

    .vehicle-import-preview__summary .summary-item--danger .summary-value {
        color: #dc3545;
    }

    .vehicle-import-preview__summary .summary-item--info .summary-value {
        color: var(--accent-blue);
    }

    .vehicle-import-preview__summary .summary-item--warning .summary-value {
        color: #ffc107;
    }

.vehicle-import-preview__table-wrapper {
    max-height: 350px;
    overflow-y: auto;
    border: 1px solid var(--panel-border);
    border-radius: 6px;
}

.vehicle-import-preview__table {
    --bs-table-bg: transparent;
    --bs-table-color: var(--text-primary);
    margin-bottom: 0;
}

    .vehicle-import-preview__table thead th {
        position: sticky;
        top: 0;
        background: var(--dashboard-bg);
        border-bottom: 2px solid var(--panel-border);
        font-size: 12px;
        font-weight: 600;
        color: var(--text-secondary);
        padding: 8px;
        z-index: 1;
    }

    .vehicle-import-preview__table tbody td {
        padding: 6px 8px;
        font-size: 13px;
        border-bottom: 1px solid var(--panel-border);
    }

    .vehicle-import-preview__table .badge {
        font-size: 10px;
        font-weight: 500;
    }

.vehicle-import-preview__actions {
    display: flex;
    justify-content: space-between;
    gap: 12px;
}