/* ===== СТРАНИЦА МАРШРУТОВ ===== */
.main-content {
    padding-top: 32px;
    padding-bottom: 60px;
    min-height: 70vh;
}

.page-title {
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    font-size: 45px;
    color: #3E3F38; /* заменён синий */
    margin: 0;
}

.routes-counter {
    font-size: 1rem;
    color: #888;
    font-weight: 500;
    margin-left: 12px;
}

/* ===== СКЕЛЕТОН ===== */
.skeleton-route {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 16px;
    border: 1px solid #eee;
}

.skeleton-line {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.4s infinite;
    border-radius: 6px;
    height: 18px;
    margin-bottom: 10px;
}

.skeleton-line.short { width: 40%; }
.skeleton-line.medium { width: 65%; }
.skeleton-line.long { width: 90%; }

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ===== КАРТОЧКА МАРШРУТА ===== */
.route-card {
    background: #fff;
    border-radius: 14px;
    border: 1px solid #e8e8e8;
    margin-bottom: 16px;
    overflow: hidden;
    transition: box-shadow 0.2s, border-color 0.2s;
}

.route-card:hover {
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    border-color: #d0d0d0;
}

/* Шапка маршрута — кликабельная для раскрытия */
.route-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px;
    cursor: pointer;
    user-select: none;
}

.route-header-left {
    display: flex;
    align-items: center;
    gap: 14px;
    flex: 1;
    min-width: 0;
}

.route-icon {
    width: 42px;
    height: 42px;
    background: #f5f5f5; /* светло-серый вместо светло-синего */
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #3E3F38; /* заменён синий */
    font-size: 16px;
    flex-shrink: 0;
}

.route-info {
    min-width: 0;
}

.route-name {
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    font-size: 1rem;
    color: #1a1a2e;
    margin: 0 0 3px 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.route-meta {
    font-size: 0.8rem;
    color: #999;
    margin: 0;
}

.route-header-right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
    margin-left: 12px;
}

.places-badge {
    background: #f5f5f5; /* светло-серый вместо светло-синего */
    color: #3E3F38; /* заменён синий */
    font-size: 0.78rem;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 20px;
}

.route-chevron {
    color: #bbb;
    font-size: 13px;
    transition: transform 0.25s;
}

.route-card.open .route-chevron {
    transform: rotate(180deg);
}

.btn-delete-route {
    background: none;
    border: none;
    color: #ccc;
    font-size: 15px;
    padding: 4px 6px;
    border-radius: 6px;
    cursor: pointer;
    transition: color 0.15s, background 0.15s;
    line-height: 1;
}

.btn-delete-route:hover {
    color: #e74c3c;
    background: #fff0ee;
}

/* ===== ТЕЛО МАРШРУТА (список мест) ===== */
.route-body {
    display: none;
    border-top: 1px solid #f0f0f0;
    padding: 0 20px 16px;
}

.route-card.open .route-body {
    display: block;
}

.route-places-list {
    list-style: none;
    padding: 0;
    margin: 14px 0 0 0;
}

.route-place-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid #f5f5f5;
}

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

.place-order-num {
    width: 26px;
    height: 26px;
    background: #f5f5f5; /* светло-серый вместо светло-синего */
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    color: #3E3F38; /* заменён синий */
    flex-shrink: 0;
}

.place-thumb {
    width: 110px;
    height: 100px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
    background: #f0f0f0;
}

.place-thumb-placeholder {
    width: 46px;
    height: 46px;
    border-radius: 8px;
    background: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ccc;
    flex-shrink: 0;
}

.place-item-info {
    flex: 1;
    min-width: 0;
}

.place-item-title {
    font-weight: 600;
    font-size: 0.9rem;
    color: #1a1a2e;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-decoration: none;
    display: block;
}

.place-item-title:hover {
    color: #3E3F38; /* заменён синий */
}

.place-item-address {
    font-size: 0.78rem;
    color: #aaa;
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.btn-remove-place {
    background: none;
    border: none;
    color: #ddd;
    font-size: 14px;
    padding: 4px 6px;
    border-radius: 6px;
    cursor: pointer;
    transition: color 0.15s, background 0.15s;
    flex-shrink: 0;
    line-height: 1;
}

.btn-remove-place:hover {
    color: #e74c3c;
    background: #fff0ee;
}

/* Пустой маршрут */
.route-empty {
    text-align: center;
    padding: 20px 0 8px;
    color: #bbb;
    font-size: 0.88rem;
}

/* ===== ПУСТОЕ СОСТОЯНИЕ ===== */
.no-results {
    text-align: center;
    padding: 80px 20px;
    color: #aaa;
}

.no-results-icon {
    font-size: 3.5rem;
    margin-bottom: 20px;
    color: #ddd;
}

.no-results h4 {
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    color: #888;
    margin-bottom: 10px;
}

.no-results p {
    color: #bbb;
    font-size: 0.9rem;
}

/* ===== УВЕДОМЛЕНИЯ ===== */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 14px 20px;
    border-radius: 8px;
    color: white;
    font-size: 0.9rem;
    font-weight: 500;
    z-index: 9999;
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    transform: translateX(120%);
    transition: transform 0.3s ease;
}

.notification.show {
    transform: translateX(0);
}

.notification.success { background: #2ecc71; }
.notification.error { background: #e74c3c; }

/* ===== МОДАЛКИ ПОДТВЕРЖДЕНИЯ ===== */
.confirm-modal .modal-content {
    border-radius: 14px;
    border: none;
}

.confirm-modal .modal-header {
    border-bottom: 1px solid #f0f0f0;
    padding: 18px 20px;
}

.confirm-modal .modal-footer {
    border-top: 1px solid #f0f0f0;
    padding: 14px 20px;
}

/* ===== ПЕРЕОПРЕДЕЛЕНИЕ СИНИХ КНОПОК ===== */
.btn-primary,
.btn-outline-primary {
    transition: all 0.2s;
}

.btn-primary {
    background-color: #3E3F38 !important;
    border-color: #3E3F38 !important;
    color: #fff !important;
}

.btn-primary:hover,
.btn-primary:active,
.btn-primary:focus {
    background-color: #2d2e2a !important;
    border-color: #2d2e2a !important;
    box-shadow: none !important;
}

.btn-outline-primary {
    color: #3E3F38 !important;
    border-color: #3E3F38 !important;
    background-color: transparent !important;
}

.btn-outline-primary:hover,
.btn-outline-primary:active,
.btn-outline-primary:focus {
    background-color: #3E3F38 !important;
    color: #fff !important;
    border-color: #3E3F38 !important;
    box-shadow: none !important;
}
.fw-bold{
    color: black;
}
.btn-success{
    font-weight: 500;
    color: #555;
    background: #fff;
    border: 1.5px solid #e0e0e0;
}
.btn-success:hover {
    font-weight: 500;
    color: #555;
    background: #f0f0f0;
    border: 1.5px solid #e0e0e0;
}
/* ===== АДАПТАЦИЯ ЗАГОЛОВКА ===== */


@media (max-width: 1024px) {
    .page-title {
        font-size: 45px; /* по заданию */
    }
}

@media (max-width: 992px) {
    .page-title {
        font-size: 45px; /* по заданию */
    }
}

@media (max-width: 768px) {
    .page-title {
        font-size: 39px;
    }
}

@media (max-width: 576px) {
    .page-title {
        font-size: 35px;
    }
}

@media (max-width: 500px) {
    .page-title {
        font-size: 34px;
    }
}

@media (max-width: 425px) {
    .page-title {
        font-size: 33px;
    }
}

@media (max-width: 375px) {
    .page-title {
        font-size: 30px;
    }
}

@media (max-width: 360px) {
    .page-title {
        font-size: 28px;
    }
}
/* ============================================================
   МОДАЛКИ: СОЗДАТЬ МАРШРУТ / ДОБАВИТЬ МЕСТО
   ============================================================ */
.crm-modal {
    border-radius: 20px;
    border: none;
    box-shadow: 0 24px 48px rgba(0,0,0,0.18);
    overflow: hidden;
    font-family: 'Montserrat', sans-serif;
    display: flex;
    flex-direction: column;
    max-height: 90vh;
}
.crm-header {
    background: #3E3F38;
    border-bottom: none;
    padding: 1.25rem 1.5rem;
    flex-shrink: 0;
}
.crm-title-wrap { display: flex; align-items: center; gap: 10px; }
.crm-title-icon { color: rgba(255,255,255,0.65); font-size: 1rem; }
.crm-title { color: #fff; font-weight: 600; font-size: 1.15rem; margin: 0; }
.crm-close { filter: invert(1); opacity: 0.7; transition: opacity .2s, transform .2s; }
.crm-close:hover { opacity: 1; transform: rotate(90deg); }

.crm-body {
    background: #f8fafc;
    padding: 1.25rem 1.5rem;
    overflow-y: auto;
    flex: 1 1 auto;
    min-height: 0;
}
.crm-section { margin-bottom: 0; }
.crm-label {
    font-size: .82rem; font-weight: 600; color: #70716E;
    text-transform: uppercase; letter-spacing: .06em; margin-bottom: .55rem;
}
.crm-input-wrap { position: relative; display: block; }
.crm-search-wrap { margin-bottom: 10px; }
.crm-input-icon {
    position: absolute; left: 1rem; top: 50%; transform: translateY(-50%);
    color: #adb5bd; font-size: .8rem; pointer-events: none; z-index: 1;
}
.crm-input {
    width: 100%; background: #fff; border: 1.5px solid #dee2e6;
    border-radius: 12px; padding: .65rem 1rem .65rem 2.4rem;
    font-size: .95rem; color: #3E3F38; font-family: 'Montserrat', sans-serif;
    transition: border-color .2s, box-shadow .2s; outline: none; box-sizing: border-box;
}
.crm-input::placeholder { color: #adb5bd; }
.crm-input:focus { border-color: #3E3F38; box-shadow: 0 0 0 3px rgba(62,63,56,.12); }
.crm-error { font-size: .82rem; color: #e74c3c; margin-top: .4rem; padding-left: .2rem; }
.crm-divider-label {
    display: flex; align-items: center; font-size: .82rem; font-weight: 600;
    color: #70716E; text-transform: uppercase; letter-spacing: .06em; margin: 1.1rem 0 .55rem;
}
.crm-divider-label::after { content:''; flex:1; height:1px; background:#dee2e6; margin-left:10px; }

/* Список мест — фиксированная высота */
.crm-places-list {
    height: 300px; overflow-y: auto;
    border: 1.5px solid #dee2e6; border-radius: 12px;
    background: #fff; padding: 4px;
    scrollbar-width: thin; scrollbar-color: #ccc transparent;
}
.crm-places-list::-webkit-scrollbar { width: 5px; }
.crm-places-list::-webkit-scrollbar-thumb { background: #ccc; border-radius: 3px; }

.cr-place-row {
    border-radius: 8px; transition: background .15s;
    border-bottom: 1px solid #f5f5f5; margin: 0;
}
.cr-place-row:last-child { border-bottom: none; }
.cr-place-row:hover { background: #f8fafc !important; }
.cr-place-selected { background: #f0f4f0 !important; }

.crm-counter { font-size: .82rem; color: #adb5bd; margin-top: .5rem; }
.crm-counter strong { color: #3E3F38; }

/* Футер — всегда виден */
.crm-footer {
    background: #fff; border-top: 1px solid #e9ecef;
    padding: 1rem 1.5rem; gap: 10px; flex-shrink: 0;
    display: flex; justify-content: flex-end; align-items: center;
}
.crm-btn-cancel {
    background: #f1f3f5; border: 1.5px solid #dee2e6; color: #495057;
    font-weight: 500; padding: .6rem 1.4rem; border-radius: 40px; font-size: .9rem;
    cursor: pointer; font-family: 'Montserrat', sans-serif; transition: background .2s;
}
.crm-btn-cancel:hover { background: #e9ecef; }
.crm-btn-confirm {
    background: #3E3F38; border: none; color: #fff; font-weight: 600;
    padding: .6rem 1.6rem; border-radius: 40px; font-size: .9rem;
    cursor: pointer; font-family: 'Montserrat', sans-serif;
    transition: background .2s, transform .15s; display: flex; align-items: center;
}
.crm-btn-confirm:hover { background: #2d2e2a; transform: translateY(-1px); }
.crm-btn-confirm:active { transform: translateY(0); }
.crm-btn-confirm:disabled { opacity: .6; cursor: not-allowed; transform: none; }

/* Кнопка "Добавить место" в карточке */
.btn-add-place-to-route {
    display: flex; align-items: center; justify-content: center;
    width: 100%; margin-top: 12px; padding: 9px 0;
    background: transparent; border: 1.5px dashed #d0d0d0; border-radius: 10px;
    color: #aaa; font-size: .88rem; font-weight: 500;
    font-family: 'Montserrat', sans-serif; cursor: pointer;
    transition: border-color .2s, color .2s, background .2s;
}
.btn-add-place-to-route:hover { border-color: #3E3F38; color: #3E3F38; background: #f8f8f8; }

/* Бейдж и заблокированная строка */
.apm-already-badge {
    flex-shrink: 0; font-size: .75rem; font-weight: 600; color: #3E3F38;
    background: #f0f4f0; border-radius: 20px; padding: 3px 10px; white-space: nowrap;
}
.apm-row-disabled { cursor: default !important; }
.apm-row-disabled:hover { background: transparent !important; }

/* Название маршрута в шапке модалки добавления */
.apm-route-name-wrap {
    display: flex; align-items: center; font-size: .9rem; font-weight: 600;
    color: #3E3F38; background: #f0f4f0; border-radius: 10px; padding: 8px 14px;
}
.apm-route-name-wrap i { color: #70716E; }

@media (max-width: 576px) {
    .crm-modal { border-radius: 16px; max-height: 95vh; }
    .crm-header, .crm-body, .crm-footer { padding: 1rem; }
    .crm-title { font-size: 1rem; }
    .crm-btn-cancel, .crm-btn-confirm { padding: .55rem 1.1rem; font-size: .85rem; }
    .crm-places-list { height: 240px; }
}