@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;600;700&display=swap');

html, body {
    height: 100%;
    min-height: 100vh;
    background: #fff;
    
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Montserrat', Arial, sans-serif;
    background: #fff;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none;  /* IE и Edge */
}
body::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
}

.header {
    background: #fff;
    padding: 48px 0 12px 0; /* увеличен верхний отступ с 24px до 48px */
    text-align: left;
    padding-left: 1cm;
    padding-bottom: 0; /* убираем нижний внутренний отступ */
}

.header-title {
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: 0; /* убираем нижний отступ */
    /* можно добавить margin-top: 0; если нужно */
}

.header-rate {
    font-size: 1rem;
    color: #333;
}

.rate-value {
    font-weight: 700;
    color: #222;
}

.main-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
    margin-top: 0;
    gap: 18px;
    padding: 0 1cm; /* одинаковый отступ слева и справа */
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.main-content::-webkit-scrollbar {
    display: none;
}

.main-content-main {
    margin-top: 32px; /* отступ для главной страницы */
}

.main-content-car {
    margin-top: 24px; /* уменьшенный отступ от шапки */
    padding-bottom: 32px; /* ← добавьте эту строку */
}

.main-btn {
    width: 100%;
    max-width: 400px;
    padding: 18px 0;
    background: #111;
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 500;
    font-family: 'Montserrat', Arial, sans-serif;
    box-shadow: 0 2px 8px rgba(0,0,0,0.07);
    transition: background 0.2s;
    text-align: center;
    text-decoration: none;   /* убирает подчёркивание */
    cursor: pointer;         /* курсор как у кнопки */
    display: block;          /* чтобы занимала всю ширину */
    margin: 0;
}

.main-btn:active,
.main-btn:hover {
    background: #222;
}

.car-select-block {
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.07);
    padding: 24px 12px;         /* как на мобильной */
    max-width: 100vw;           /* ширина на всю область */
    width: 90%;
    margin-left: 0.5cm;
    margin-right: 0.5cm;
    margin-top: 0;
    margin-bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: stretch;
}

.car-label {
    font-size: 1.05rem;
    font-weight: 500;
    margin-bottom: 4px;
    color: #222;
    text-align: left;
}

.car-select {
    margin-bottom: 0;
}

.main-btn.car-select {
    font-size: 0.85rem;
    text-align: left;         /* изменено с center на left */
    /* text-align-last: center;  <-- эту строку можно удалить или закомментировать */
    padding: 10px 0 10px 16px; /* ← добавлен отступ слева */
    background: transparent !important;
    color: rgba(34,34,34,0.7);
    border: 1px solid #ccc;
    box-shadow: none !important;
    outline: none;
    width: 100%;           /* занимает всю ширину родителя */
    min-width: 0;          /* убираем минимальную ширину */
    max-width: none;       /* убираем максимальную ширину */
    box-sizing: border-box;
    appearance: none;
}

.main-btn.car-select:focus,
.main-btn.car-select:active,
.main-btn.car-select:hover {
    background: transparent !important; /* убирает фон при любых состояниях */
    color: rgba(34,34,34,0.7);
    border-color: #888;
    box-shadow: none !important;
    outline: none;
}

.main-btn.car-select option {
    font-size: 0.85rem;
    text-align: left; /* добавьте это */
    color: rgba(34,34,34,0.7);
    font-family: 'Montserrat', Arial, sans-serif;
    padding-left: 16px; /* ← добавлен отступ слева для option */
}

.back-btn {
    display: inline-block;
    font-size: 1.5rem;
    font-weight: 700;
    color: #222;
    text-decoration: none;
    margin-right: 16px;
    vertical-align: middle;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0 8px 0 0;
}

.car-info-block {
    border: 1px solid #ccc;
    border-radius: 10px;
    margin-top: 12px;
    background: #fafafa;
    overflow: hidden;
    padding: 0; /* убираем внутренние отступы */
    max-width: 600px; /* шире на ПК */
    width: 100%;
    margin-left: auto;
    margin-right: auto;
}

.car-info-header {
    padding: 12px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.95rem; /* уменьшили размер текста комплектации */
}

.car-info-details {
    padding-left: 0; /* убираем отступ слева у всего блока */
    padding-right: 0;
    padding-top: 12px;
    padding-bottom: 0;
    border-top: 1px solid #eee;
    color: #444;
    font-size: 0.85rem;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s cubic-bezier(0.4,0,0.2,1), padding 0.35s;
}
.config-info {
    padding-left: 12px;
}

.car-info-block.open .car-info-details {
    max-height: 200px;
    padding-top: 12px;
    padding-bottom: 0; /* не нужен отступ снизу */
}

.arrow {
    font-size: 1.2em;
    margin-left: 8px;
    display: inline-block;
    transition: transform 0.3s;
}

.car-info-block.open .arrow {
    transform: rotate(180deg);
}

.select-filter-wrapper {
    position: relative;
    width: 100%;
    display: flex;
    align-items: center;
}

.select-filter-wrapper select {
    width: 100%;
    padding-right: 36px; /* место для иконки */
}

.filter-icon {
    position: absolute;
    right: 12px;
    pointer-events: none;
    font-size: 1.1em;
    color: #000; /* или уберите color, если используете stroke="black" в SVG */
    top: 50%;
    transform: translateY(-50%);
}

.add-client-btn {
    display: block;
    width: 100%;
    margin: 24px 0 0 0; /* увеличили верхний отступ до 24px */
    padding: 16px 0;
    background: #111;
    color: #fff;
    border: none;
    border-radius: 0 0 10px 10px;
    font-size: 1.08rem;
    font-family: 'Montserrat', Arial, sans-serif;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    text-align: center;
    box-shadow: none;
}

.add-client-btn:hover {
    background: #222;
    color: #fff;
}

.skeleton-block {
    background: #f3f3f3;
    color: #aaa;
    border-radius: 10px;
    padding: 32px;
    text-align: center;
    font-size: 1.1rem;
    margin-top: 12px;
}

.car-select-block,
.car-info-block {
    max-width: 600px;
    width: 100%;
    margin-left: auto;
    margin-right: auto;
}

.main-content-entrance {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 80vh;
    gap: 18px;
    padding: 0 1cm;
}

.entrance-block {
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.07);
    padding: 32px 12px;
    max-width: 600px;
    width: 90%;
    margin-left: 0.5cm;
    margin-right: 0.5cm;
    display: flex;
    flex-direction: column;
    gap: 18px;
    align-items: stretch;
}

.entrance-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #222;
    margin-bottom: 18px;
    text-align: center;
}

.entrance-label {
    font-size: 1rem;
    font-weight: 500;
    color: #222;
    margin-bottom: 12px;
}

.entrance-input {
    padding: 12px;
    border: 1px solid #ccc;
    border-radius: 8px;
    font-size: 1rem;
    font-family: 'Montserrat', Arial, sans-serif;
    margin-bottom: 8px;
    width: 100%;
    box-sizing: border-box;
}

.entrance-btn {
    padding: 14px 0;
    background: #111;
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 1.08rem;
    font-family: 'Montserrat', Arial, sans-serif;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    text-align: center;
    width: 100%;
    text-decoration: none;
}

.entrance-btn:hover {
    background: #222;
}

.filter-title {
    font-size: 1.05rem;
    font-weight: 600;
    color: #222;
    margin-bottom: 6px;
    margin-top: 10px;
    text-align: left;
}

/* Адаптация для мобильных */
@media (max-width: 600px) {
    .main-btn {
        font-size: 1rem;
        padding: 16px 0;
    }
    .header {
        padding: 40px 0 8px 0;
        padding-left: 1cm;
    }
    .main-content {
        margin-top: 10px;
        gap: 14px;
        padding-left: 6vw;
        padding-right: 6vw;
    }
    .main-content-main {
        margin-top: 18px; /* или 0, если нужен минимальный отступ */
    }
    .main-content-car {
        margin-top: 8px; /* ещё меньше на мобильных */
    }
    .car-select-block {
        padding: 24px 12px;
        max-width: 100vw;
        width: 90%;
       
    }
    .car-info-block {
        max-width: 100vw;
        width: 90%;
        
    }
    .entrance-block {
        max-width: 100vw;
        width: 90%;
        margin-left: 0.5cm;
        margin-right: 0.5cm;
        padding: 18px 6vw;
        border-radius: 12px;
        box-shadow: 0 2px 12px rgba(0,0,0,0.07);
    }
    .entrance-input {
        font-size: 1rem;
        padding: 12px 8px;
    }
    .entrance-btn {
        font-size: 1rem;
        padding: 12px 0;
    }
}

.loader-bar {
    width: 200px;
    height: 8px;
    background: #eee;
    border-radius: 4px;
    overflow: hidden;
    margin-top: 24px;
    position: relative;
}
.loader-bar-inner {
    width: 0;
    height: 100%;
    background: #111;
    border-radius: 4px;
    transition: width 0.5s;
    position: absolute;
    left: 0; top: 0;
    animation: loader-bar-anim 1.2s linear forwards;
}
@keyframes loader-bar-anim {
    from { width: 0; }
    to   { width: 100%; }
}

input, textarea, select, button {
    font-size: 16px; /* чтобы не было зума */
}

@media (max-width: 600px) {
    body {
        min-height: 100svh;
        height: 100svh;
    }
    .main-content,
    .main-content-entrance {
        justify-content: flex-start;
        padding-top: 24px;
        min-height: unset;
        height: auto;
    }
}

.modal-overlay {
    position: fixed;
    z-index: 9999;
    left: 0; top: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.32);
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.18);
    padding: 20px 8px 18px 18px; /* top right bottom left */
    width: 100%;
    max-width: 400px;
    margin: 0 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    position: relative;
    overflow: visible;
    padding: 12px;
}

.modal-close {
    position: absolute;
    right: 0;
    top: 0;
    font-size: 1.5rem;
    color: #888;
    background: none;
    border: none;
    cursor: pointer;
    z-index: 2;
}

.body-modal-open {
    overflow: hidden !important;
    touch-action: none;
    overscroll-behavior: contain;
}

html, body {
    scrollbar-width: none;         /* Firefox */
    -ms-overflow-style: none;      /* IE и Edge */
}
body::-webkit-scrollbar,
html::-webkit-scrollbar {
    display: none;                 /* Chrome, Safari, Opera */
}

.main-content,
.main-content-car {
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.main-content::-webkit-scrollbar,
.main-content-car::-webkit-scrollbar {
    display: none;
}

/* Специальные стили для страницы заявок */
.applications-page .car-info-block {
    max-width: 800px; /* или любое другое значение */
    width: 95%;
}

.applications-page .entrance-block {
    max-width: 800px;
    width: 95%;
}

/* Делаем внутренние блоки с информацией шире */
/* Специальные стили для страницы заявок */
.applications-page .car-info-block {
    max-width: 900px;
    width: 95%;
    margin-bottom: 16px;
}

.application-block {
    border: 1px solid #ccc;
    border-radius: 10px;
    margin-top: 12px;
    background: #fafafa;
    overflow: hidden;
    padding: 0;
    max-width: 900px;
    width: 100%;
    margin-left: auto;
    margin-right: auto;
}

.application-block .car-info-header {
    padding: 12px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.95rem;
}

.application-block .car-info-details {
    padding-left: 0;
    padding-right: 0;
    padding-top: 12px;
    padding-bottom: 0;
    border-top: 1px solid #eee;
    color: #444;
    font-size: 0.85rem;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s cubic-bezier(0.4,0,0.2,1), padding 0.35s;
}

.application-block.open .car-info-details {
    max-height: 200px;
    padding-top: 12px;
    padding-bottom: 0;
    padding: 12px
}

.application-block .arrow {
    font-size: 1.2em;
    margin-left: 8px;
    display: inline-block;
    transition: transform 0.3s;
}

.application-block.open .arrow {
    transform: rotate(180deg);
}

.applications-page #applications-list {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    padding-bottom: 32px; /* отступ снизу */
}

.applications-page .main-content {
    padding-bottom: 64px; /* увеличиваем отступ */
}

/* Или используйте margin */
.applications-page .main-content {
    margin-bottom: 32px;
}

.applications-page .application-block:last-child {
    margin-bottom: 32px;
}

.admin-container {
    display: flex;
    gap: 20px;
    padding: 20px;
    max-width: 1400px;
    margin: 0 auto;
}

.admin-main-panel {
    flex: 1;
    min-width: 0;
}

.admin-sidebar {
    width: 300px;
    flex-shrink: 0;
}

.admin-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.tab-btn {
    padding: 10px 20px;
    border: 1px solid #ccc;
    background: #fff;
    cursor: pointer;
    border-radius: 5px;
}

.tab-btn.active {
    background: #111;
    color: #fff;
}

.admin-panel {
    display: none;
}

.admin-panel.active {
    display: block;
}

.admin-widget {
    background: #f9f9f9;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
}

.admin-section {
    background: #f9f9f9;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
}

.admin-section h3 {
    margin-top: 0;
    margin-bottom: 15px;
}

.admin-section form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.admin-section input,
.admin-section select {
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 5px;
}

.admin-section button {
    padding: 10px;
    background: #111;
    color: #fff;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

.admin-widget form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.admin-widget input {
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 5px;
}

.admin-widget button {
    padding: 10px;
    background: #111;
    color: #fff;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

.applications-filters {
    display: flex;
    gap: 12px;
    margin: 16px 0;
    flex-wrap: wrap;
}

.filter-circle {
    padding: 8px 16px;
    border-radius: 20px;
    background: #f0f0f0;
    border: 2px solid #ddd;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s;
    user-select: none;
}

.filter-circle:hover {
    background: #e0e0e0;
    border-color: #ccc;
}

.filter-circle.active {
    background: #111;
    color: white;
    border-color: #111;
}

.filter-circle.active:hover {
    background: #222;
    border-color: #222;
}

.manager-comment {
    width: calc(100% - 24px); /* учитываем padding родителя */
    min-height: 60px; /* уменьшаем высоту */
    max-height: 120px; /* ограничиваем максимальную высоту */
    padding: 8px 12px; /* уменьшаем padding */
    border: 1px solid #ddd;
    border-radius: 6px;
    font-family: 'Montserrat', Arial, sans-serif;
    font-size: 0.85rem; /* уменьшаем шрифт */
    resize: vertical;
    box-sizing: border-box;
    margin-bottom: 8px;
}

/* Для мобильных устройств */
@media (max-width: 600px) {
    .manager-comment {
        min-height: 50px;
        max-height: 80px;
        font-size: 0.8rem;
    }
}

.save-manager-btn {
    background: #111;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 8px 16px;
    font-family: 'Montserrat', Arial, sans-serif;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
    margin-top: 8px;
}

.save-manager-btn:hover {
    background: #222;
}

.save-manager-btn:active {
    background: #000;
}

.manager-answer-block {
    width: 100%;
    overflow-x: auto;
    box-sizing: border-box;
    padding-right: 2px;
    display: flex;
    flex-direction: column;
    align-items: stretch;
}

/* Специальные стили для блоков заявок в админ-панели */
.admin-application-block {
    border: 1px solid #ccc;
    border-radius: 10px;
    margin-top: 12px;
    background: #fafafa;
    overflow: hidden;
    padding: 0;
    max-width: 900px;
    width: 95%;
    margin-left: auto;
    margin-right: auto;
}

.admin-application-block .car-info-header {
    padding: 12px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.95rem;
}

.admin-application-block .car-info-details {
    padding-left: 12px;
    padding-right: 12px;
    padding-top: 12px;
    padding-bottom: 0;
    border-top: 1px solid #eee;
    color: #444;
    font-size: 0.85rem;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s cubic-bezier(0.4,0,0.2,1), padding 0.35s;
}

.admin-application-block.open .car-info-details {
    max-height: none;
    padding-top: 12px;
    padding-bottom: 12px;
    overflow: visible;
}

.admin-application-block .arrow {
    font-size: 1.2em;
    margin-left: 8px;
    display: inline-block;
    transition: transform 0.3s;
}

.admin-application-block.open .arrow {
    transform: rotate(180deg);
}

.close-application-btn {
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 8px 16px;
    font-family: 'Montserrat', Arial, sans-serif;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
    margin-top: 8px;
    margin-left: 8px;
}

.close-application-btn:hover {
    background: #c82333;
}

.close-application-btn:active {
    background: #bd2130;
}

.manager-buttons {
    display: flex;
    gap: 8px;
    align-items: center;
}

/* Мобильная адаптация для админки */
@media (max-width: 768px) {
    .admin-container {
        flex-direction: column;
        padding: 10px;
        gap: 15px;
    }
    
    .admin-main-panel {
        order: 2;
    }
    
    .admin-sidebar {
        width: 100%;
        order: 1;
    }
    
    .admin-tabs {
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .tab-btn {
        padding: 8px 16px;
        font-size: 0.9rem;
        flex: 1;
        min-width: 120px;
    }
    
    .admin-section {
        padding: 15px;
        margin-bottom: 15px;
    }
    
    .admin-widget {
        padding: 12px;
        margin-bottom: 10px;
        border-radius: 8px;
        background: #f5f5f5;
    }
    
    .admin-widget h3 {
        font-size: 1rem;
        margin-bottom: 8px;
        color: #333;
    }
    
    .admin-widget form {
        gap: 8px;
    }
    
    .admin-widget input {
        padding: 8px;
        font-size: 14px;
    }
    
    .admin-widget button {
        padding: 8px 12px;
        font-size: 0.9rem;
    }
    
    #create-code-btn {
        padding: 8px 12px;
        font-size: 0.9rem;
        background: #111;
        color: white;
        border: none;
        border-radius: 5px;
        cursor: pointer;
        width: 100%;
        margin-bottom: 8px;
    }
    
    #codes-list {
        font-size: 0.85rem;
    }
    
    #codes-list div {
        padding: 6px 8px;
        margin-bottom: 4px;
        border-radius: 4px;
        background: #fff;
        border: 1px solid #ddd;
    }
    
    .applications-filters {
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .filter-circle {
        padding: 6px 12px;
        font-size: 0.8rem;
    }
    
    .admin-application-block {
        width: 100%;
        max-width: none;
        margin: 8px 0;
    }
    
    .manager-comment {
        width: 100%;
        min-height: 80px;
        font-size: 16px; /* Предотвращает зум на iOS */
    }
    
    .manager-buttons {
        flex-direction: column;
        gap: 10px;
    }
    
    .save-manager-btn,
    .close-application-btn {
        width: 100%;
        padding: 12px;
        font-size: 1rem;
    }
    
    .admin-section input,
    .admin-section select,
    .admin-widget input {
        font-size: 16px; /* Предотвращает зум на iOS */
        padding: 12px;
    }
    
    .admin-section button,
    .admin-widget button {
        padding: 12px;
        font-size: 1rem;
        width: 100%;
    }
}

/* Указатель для открытия на полный экран */
.fullscreen-indicator {
    position: fixed;
    top: 15px;
    right: 15px;
    color: #666;
    font-size: 0.7rem;
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 4px;
    pointer-events: none; /* Не кликабельный */
    opacity: 0.7;
    animation: pulse-arrow 2s infinite;
}

.fullscreen-indicator .arrow {
    font-size: 1.2rem;
    animation: bounce-up 1.5s infinite;
}

.fullscreen-indicator .text {
    font-weight: 500;
    color: #888;
}

/* Анимация пульсации */
@keyframes pulse-arrow {
    0%, 100% { opacity: 0.7; }
    50% { opacity: 0.3; }
}

/* Анимация стрелки вверх */
@keyframes bounce-up {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-3px);
    }
    60% {
        transform: translateY(-2px);
    }
}

/* Скрываем указатель на больших экранах */
@media (min-width: 769px) {
    .fullscreen-indicator {
        display: none;
    }
}