.routes-section {
    padding: 40px 0;
    position: relative;
}

.page-bg {
    position: fixed; /* Фиксируем на весь экран */
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover; /* Растягиваем изображение */
    z-index: -2; /* Самый нижний слой */
}

.page-wrapper {
    position: relative;
    min-height: 100vh; /* Растягиваем на весь экран */
    overflow: hidden; /* Скрываем лишнее */
}

.overlay {
    position: fixed; /* Затемнение на весь экран */
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5); /* Затемнение, можно настроить прозрачность */
    z-index: -1; /* Слой между фоном и контентом */
}


.route-create-form,
.routes-table-container,
.modal {
    position: relative;
    z-index: 2; /* Контент поверх фона */
}

.routes-table-container {
    background: #222;
    padding: 20px 40px;
    border-radius: 20px;
    transition: height 0.3s ease;
    overflow: visible;
}

.routes-table-container .table-responsive {
    overflow-x: auto;
    width: 100%;
}

.route-form-title {
    font-family: 'DegularDemo', sans-serif;
    font-size: 1.5em;
    color: #7FEE64;
    margin-bottom: 15px;
}

.routes-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
    pointer-events: none;
}

.form-inline {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.form-control {
    background: #333;
    border: 1px solid #7FEE64;
    color: #DDFFDC;
    padding: 1vh 12px;
    border-radius: 5px;
    font-family: 'SpaceMono', monospace;
    flex-grow: 1;
}

.form-control::placeholder {
    color: #999;
}

.routes-table-title {
    font-family: 'DegularDemo', sans-serif;
    font-size: 1.8em;
    color: #7FEE64;
    margin-bottom: 20px;
}

.routes-table {
    width: 100%;
    border-collapse: collapse;
    font-family: 'SpaceMono', monospace;
    color: #DDFFDC;
    transition: all 0.3s ease;
}

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

.routes-table tbody {
    transition: height 0.3s ease;
}

.routes-table tr.route-row {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.routes-table tr.route-row.visible {
    opacity: 1;
    transform: translateY(0);
}

.routes-table th {
    background: #333;
    color: #7FEE64;
    font-weight: bold;
}

.routes-table td {
    vertical-align: middle;
}

.actions {
    display: flex;
    gap: 10px;
}

.action-btn {
    background: none;
    border: none;
    color: #7FEE64;
    font-size: 1.2em;
    cursor: pointer;
    padding: 5px;
    transition: color 0.3s ease;
}

.action-btn:hover {
    color: #65D64D;
}

.view-btn {
    text-decoration: none;
}

.edit-btn {
    color: #DDFFDC;
}

.delete-btn {
    color: #FF6B6B;
}

.text-center {
    text-align: center;
}

/* Стили для кастомного модального окна */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0);
    display: none; /* Изначально скрыто */
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease, background 0.3s ease;
}

.modal.active {
    background: rgba(0, 0, 0, 0.7);
    opacity: 1;
}

.modal-content {
    background: #222;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    color: #DDFFDC;
    font-family: 'SpaceMono', monospace;
    max-width: 400px;
    width: 100%;
    border: 2px solid #FF6B6B;
    box-shadow: 0 0 10px #FF6B6B;
    transform: scale(0.8);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.modal.active .modal-content {
    transform: scale(1);
    opacity: 1;
}

.modal-content h3 {
    font-family: 'DegularDemo', sans-serif;
    color: #7FEE64;
    margin-bottom: 15px;
}

.modal-content p {
    margin-bottom: 20px;
}

.modal-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.button-danger {
    background: #FF6B6B;
    color: #0B0B0B;
}

.button-danger:hover {
    background: #E55A5A;
}


        /* Общие стили для страницы */
        body {
        }


        .routes-section {
            position: relative;
            z-index: 1;
            padding: 40px 0;
        }

        /* Стили для формы */
.route-create-form {
    margin-bottom: 40px;
    padding: 20px;
    background: #222;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

        .route-form-title {
            font-family: 'Plus Jakarta Sans', sans-serif;
            color: #7FEE64;
            font-size: 1.8rem;
            font-weight: 700;
            margin-bottom: 20px;
        }

        .form-inline {
            display: flex;
            gap: 10px;
            flex-wrap: wrap;
        }

        .form-control {
            background: #333;
            border: 1px solid #7FEE64;
            color: #DDFFDC;
            padding: 10px 12px;
            border-radius: 5px;
            font-family: 'SpaceMono', monospace;
            box-sizing: border-box;
            width: auto;
        }

        .form-control::placeholder {
            color: #999;
        }

        /* Кастомизация календаря */
        input[type="datetime-local"] {
            background: #333;
            border: 1px solid #7FEE64;
            color: #DDFFDC;
            position: relative;
        }

        input[type="datetime-local"]::-webkit-calendar-picker-indicator {
            filter: invert(80%) sepia(50%) saturate(200%) hue-rotate(60deg); /* Зелёная иконка */
            cursor: pointer;
        }

        input[type="datetime-local"]::-webkit-datetime-edit {
            color: #DDFFDC;
            font-family: 'SpaceMono', monospace;
        }

        /* Стили для таблицы */
        .routes-table-container {
            padding: 20px;
            background: #222;
            border-radius: 10px;
            box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
            transition: height 0.3s ease;
        }

        .routes-table-title {
            font-family: 'Plus Jakarta Sans', sans-serif;
            color: #7FEE64;
            font-size: 1.8rem;
            font-weight: 700;
            margin-bottom: 20px;
        }

        .routes-table {
            width: 100%;
            border-collapse: separate;
            border-spacing: 0;
            font-family: 'Plus Jakarta Sans', sans-serif;
            color: #fff;
        }

        .routes-table th,
        .routes-table td {
            padding: 12px 15px;
            text-align: left;
            border-bottom: 1px solid #444;
        }

        .routes-table th {
            background: #333;
            color: #7FEE64;
            font-weight: 700;
            font-size: 1rem;
            text-transform: uppercase;
        }

        .routes-table td {
            background: #222;
            color: #fff;
            font-size: 0.95rem;
        }

        .routes-table tr:hover td {
            background: #333;
            transition: background 0.2s ease;
        }

        .routes-table .actions {
            display: flex;
            gap: 10px;
            align-items: center;
        }

        .action-btn {
            background: none;
            border: none;
            cursor: pointer;
            padding: 5px;
        }

        .action-icon {
            width: 2rem;
            height: 2rem;
            transition: transform 0.2s ease;
        }

        .action-btn:hover .action-icon {
            transform: scale(1.1);
        }

        /* Модальные окна */
        .modal {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.7);
            align-items: center;
            justify-content: center;
            z-index: 1000; /* Выше всего контента */
            opacity: 0;
            transition: opacity 0.3s ease;
        }

        .modal.active {
            display: flex;
            opacity: 1;
        }

        .modal-content {
            background: #222;
            padding: 20px;
            border-radius: 10px;
            max-width: 400px;
            width: 90%;
            color: #fff;
            font-family: 'Plus Jakarta Sans', sans-serif;
            box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
        }

        .modal-content h3 {
            color: #7FEE64;
            font-size: 1.5rem;
            margin-bottom: 15px;
        }

        .modal-content p {
            font-size: 1rem;
            margin-bottom: 20px;
        }

        .modal-buttons {
            display: flex;
            gap: 10px;
            justify-content: flex-end;
        }

        .button {
            padding: 10px 20px;
            border-radius: 50px;
            font-family: 'Plus Jakarta Sans', sans-serif;
            font-size: 0.9rem;
            font-weight: 600;
            text-decoration: none;
            cursor: pointer;
            transition: background-color 0.3s ease, color 0.3s ease;
        }

        .button-primary {
            background: #7FEE64;
            color: #0B0B0B;
            border: none;
        }

        .button-primary:hover {
            background: #6FD056;
        }

        .button-secondary {
            color: #7FEE64;
            border: 2px solid #7FEE64;
            background: none;
        }

        .button-secondary:hover {
            background: #7FEE64;
            color: #0B0B0B;
        }

        .button-danger {
            background: #FF4D4D;
            color: #fff;
            border: none;
        }

        .button-danger:hover {
            background: #E64444;
        }

        /* Анимация строк таблицы */
        .route-row {
            opacity: 0;
            transform: translateY(10px);
            transition: opacity 0.3s ease, transform 0.3s ease;
        }

        .route-row.visible {
            opacity: 1;
            transform: translateY(0);
        }

        /* Адаптивность */
        @media (max-width: 768px) {

            .route-create-form {
                display: list-item;
            }
            .form-inline {
                flex-direction: column;
            }

            .form-control {
                width: 100%;
            }

            .button-primary {
                width: 100%;
                text-align: center;
            }

            .routes-table-container {
                overflow-x: auto;
            }

        }

        @media (max-width: 400px) {
            .page-bg {
            }
        }

/* ========================================================================== */
/* OTTO batch process page */
.otto-batch .route-create-form,
.otto-batch .routes-table-container {
    border-radius: 18px;
}

.otto-batch .otto-page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.otto-batch .otto-page-title {
    min-width: 240px;
}

.otto-batch .otto-subtitle {
    margin: 6px 0 0;
    color: rgba(255, 255, 255, 0.75);
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 0.95rem;
    line-height: 1.35;
}

.otto-batch .otto-actions {
    justify-content: flex-end;
    gap: 10px;
}

.otto-batch .otto-tools {
    margin-top: 14px;
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}

.otto-batch .otto-tools-label {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-weight: 600;
    color: #7FEE64;
}

.otto-batch .otto-bulk {
    width: 100%;
    resize: vertical;
    min-height: 92px;
}

.otto-batch .otto-tools-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.otto-batch .otto-tools-meta {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: 'SpaceMono', monospace;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.85);
}

.otto-batch .otto-warning {
    color: #FF6B6B;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-weight: 600;
}

.otto-batch .otto-table-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.otto-batch .otto-table-hint {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
}

.otto-batch .table-responsive {
    margin-top: 8px;
    max-height: 560px;
    overflow: auto;
    border-radius: 12px;
}

.otto-batch .routes-table thead th {
    position: sticky;
    top: 0;
    z-index: 2;
}

.otto-batch .routes-table th:first-child,
.otto-batch .routes-table td:first-child {
    width: 56px;
    text-align: center;
    white-space: nowrap;
}

.otto-batch .routes-table td input.form-control {
    width: 100%;
}

.otto-batch .order_number.is-duplicate {
    border-color: #FF6B6B;
    box-shadow: 0 0 0 3px rgba(255, 107, 107, 0.15);
}

.otto-batch .button:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

.otto-batch .status-text.loading::after {
    content: '...';
    display: inline-block;
    width: 0ch;
    overflow: hidden;
    vertical-align: bottom;
    animation: ottoDots 1.1s steps(4, end) infinite;
}

@keyframes ottoDots {
    to { width: 3ch; }
}

@media (max-width: 768px) {
    .otto-batch .otto-tools-meta {
        margin-left: 0;
    }
}

.otto-batch .modal-content {
    border: 1px solid rgba(127, 238, 100, 0.35);
    box-shadow: 0 10px 35px rgba(0, 0, 0, 0.55);
}

.otto-batch #result-container {
    text-align: left;
}

.otto-batch #result-container h4 {
    margin: 14px 0 8px;
    color: rgba(255, 255, 255, 0.9);
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: 0.02em;
}

.otto-batch .result-list li {
    border: 1px solid rgba(255, 255, 255, 0.07);
}

.cargo-weight-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.field-hint {
    color: #c8d4c8;
    font-size: 13px;
    line-height: 1.35;
    max-width: 240px;
}

.fuel-estimate {
    margin-top: 4px;
    font-size: 1rem;
    color: #7FEE64;
    font-weight: 600;
}

.fuel-estimate.muted {
    color: #b8c4b8;
    font-weight: 400;
}

.route-fuel-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 12px 20px;
    margin: 12px 0 0;
}

.route-fuel-bar .cargo-weight-field input {
    max-width: 180px;
}

#edit-modal .cargo-weight-field {
    margin-top: 10px;
}

#edit-modal .field-hint {
    max-width: 100%;
}
