/* для кастомных стилей */

.form-input.error {
    border: 1px solid #dc3545 !important;
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.1) !important;
}

/* ===== Форма заявки: длины и обязательные поля ===== */
.cable-lengths-fields {
    display: grid;
    grid-template-columns: 64px max-content 64px max-content;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.cable-lengths-fields .form-input {
    width: 64px;
    min-width: 64px;
}

.cable-lengths-fields .form-label {
    white-space: nowrap;
}

.js-cable-request-form .form-input.is-invalid,
.js-cable-request-form .form-select.is-invalid,
.js-cable-request-form .select2-selection.cable-required-invalid {
    border-color: #dc3545 !important;
    box-shadow: 0 0 0 2px rgba(220, 53, 69, 0.12) !important;
}

.cable-required-feedback {
    display: block;
    margin-top: 5px;
    color: #dc3545;
    font-size: 12px;
    line-height: 1.3;
}

/* Select2 «Конструкция жилы»: выбранные значения и курсор остаются в одной строке. */
.js-conductor-construction + .select2-container .select2-selection--multiple {
    overflow: hidden;
    white-space: nowrap;
}

.js-conductor-construction + .select2-container .select2-selection--multiple .select2-selection__rendered {
    display: inline;
    width: auto;
    padding-right: 0;
}

.js-conductor-construction + .select2-container .select2-selection--multiple .select2-search--inline {
    display: inline-block;
    float: none;
    vertical-align: top;
}

.js-conductor-construction + .select2-container .select2-selection--multiple .select2-search__field {
    height: 38px;
    min-width: 2px;
    margin: 0;
    padding: 0 !important;
    line-height: 38px;
    vertical-align: top;
}

/* В форме заявки выбранное значение можно очистить и снова оставить поле пустым. */
.js-cable-request-form .select2-selection__clear {
    position: absolute;
    z-index: 2;
    top: 50%;
    right: 30px;
    margin: 0 !important;
    padding: 0 4px;
    border: 0;
    background: transparent;
    color: #858d96;
    line-height: 1;
    transform: translateY(-50%);
    cursor: pointer;
}

.js-cable-request-form .select2-selection--multiple .select2-selection__choice__remove {
    position: static;
    display: inline-block;
    margin-right: 3px;
    padding: 0;
    border: 0;
    background: transparent;
    color: #858d96;
    vertical-align: baseline;
    cursor: pointer;
}

/* ===== Редактирование профиля: карта, описание и логотип ===== */
.profile-map-layout {
    display: flex;
    align-items: flex-start;
    gap: 18px;
}

.profile-map-actions {
    flex: 1 1 260px;
    min-width: 0;
}

.profile-map-coordinates {
    flex: 0 0 230px;
}

.profile-coordinates-card {
    position: relative;
    padding: 11px 34px 11px 13px;
    border: 1px solid #d8e0e8;
    border-radius: 8px;
    background: #f8f9fa;
    color: #4c5967;
    font-size: 14px;
    line-height: 1.45;
}

.profile-coordinates-card strong {
    color: var(--text-color, #262d35);
}

.profile-branding-row {
    align-items: stretch;
    margin-top: 8px;
}

.profile-company-description {
    min-height: 145px;
    resize: vertical;
}

.profile-logo-panel {
    min-height: 145px;
    padding: 16px;
    border: 1px solid #e2e7ec;
    border-radius: 10px;
    background: #fafbfc;
}

.profile-logo-preview {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 90px;
    margin-bottom: 14px;
    padding: 10px;
    border-radius: 8px;
    background: #fff;
}

.profile-logo-preview img {
    max-width: 240px;
    max-height: 110px;
    object-fit: contain;
}

.profile-branding-warning {
    margin-bottom: 14px;
    padding: 14px 15px;
    border: 1px solid #f0c36d;
    border-radius: 8px;
    background: #fff8e5;
    color: #6d5420;
    font-size: 14px;
    line-height: 1.45;
}

.profile-branding-warning strong {
    display: block;
    margin-bottom: 5px;
    color: #4f3b12;
    font-size: 15px;
}

.profile-branding-warning p {
    margin: 0 0 11px;
}

.profile-logo-delete {
    margin-bottom: 14px;
}

.profile-logo-message {
    display: none;
    margin-bottom: 12px;
    padding: 10px 12px;
    border-radius: 7px;
    font-size: 14px;
    line-height: 1.35;
}

.profile-logo-message--success {
    display: block;
    border: 1px solid #abd7b8;
    background: #edf9f0;
    color: #256d38;
}

.profile-logo-message--error {
    display: block;
    border: 1px solid #efb3b3;
    background: #fff0f0;
    color: #a22626;
}

@media (max-width: 767px) {
    .profile-map-layout {
        flex-direction: column;
    }

    .profile-map-actions,
    .profile-map-coordinates {
        width: 100%;
        flex-basis: auto;
    }
}

/* Мои контрагенты */
.counterparty-guide {
    display: flex;
    gap: 16px;
    margin-bottom: 28px;
    padding: 20px;
    border: 1px solid #cfe1ee;
    border-radius: 12px;
    background: #f4f9fc;
}

.counterparty-guide__icon {
    flex: 0 0 30px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #5c8fb4;
    color: #fff;
    font-size: 18px;
    font-weight: 700;
    line-height: 30px;
    text-align: center;
}

.counterparty-guide h2,
.counterparty-section h2 {
    margin: 0 0 8px;
    font-size: 22px;
}

.counterparty-guide p,
.counterparty-section__heading p {
    margin: 0;
    color: #6f7782;
    font-size: 14px;
    line-height: 1.5;
}

.counterparty-guide p + p {
    margin-top: 7px;
}

.counterparty-section {
    margin-bottom: 32px;
}

.counterparty-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 22px;
    padding-bottom: 10px;
    border-bottom: 1px solid #dfe5ea;
}

.counterparty-tabs__link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border: 1px solid #d7dfe6;
    border-radius: 9px;
    background: #fff;
    color: #4a5158;
    font-size: 15px;
    font-weight: 600;
}

.counterparty-tabs__link:hover {
    border-color: #e86851;
    color: #e86851;
}

.counterparty-tabs__link.is-active {
    border-color: #e86851;
    background: #e86851;
    color: #fff;
}

.counterparty-tabs__count {
    min-width: 23px;
    padding: 2px 7px;
    border-radius: 999px;
    background: #eef2f5;
    color: #65717c;
    font-size: 12px;
    text-align: center;
}

.counterparty-tabs__link.is-active .counterparty-tabs__count {
    background: rgba(255, 255, 255, .24);
    color: #fff;
}

.counterparty-tab-panel {
    min-height: 220px;
}

.counterparty-section__heading,
.counterparty-card__heading,
.counterparty-card__footer {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.counterparty-section__heading {
    margin-bottom: 16px;
}

.counterparty-section__count,
.counterparty-card__status {
    flex: 0 0 auto;
    padding: 5px 11px;
    border-radius: 999px;
    background: #e8f5ee;
    color: #237b4b;
    font-size: 13px;
    font-weight: 600;
}

.counterparty-card {
    margin-bottom: 16px;
    padding: 20px;
    border: 1px solid #dce2e8;
    border-radius: 12px;
    background: #fff;
}

.counterparty-card__heading {
    margin-bottom: 18px;
}

.counterparty-card__title {
    margin: 0 0 4px;
    font-size: 19px;
}

.counterparty-card--accordion > .counterparty-card__summary {
    align-items: center;
    flex-direction: row;
    margin: -20px;
    padding: 20px;
    border-radius: 12px;
    list-style: none;
    cursor: pointer;
}

.counterparty-card__summary::-webkit-details-marker {
    display: none;
}

.counterparty-card__summary:hover {
    background: #f7f9fb;
}

.counterparty-card__summary:focus-visible {
    outline: 2px solid #e86851;
    outline-offset: 3px;
}

.counterparty-card__summary > div {
    min-width: 0;
    overflow-wrap: anywhere;
}

.counterparty-card__summary .counterparty-card__title {
    color: #e86851;
}

.counterparty-card__actions {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 16px;
}

.counterparty-card__chevron {
    width: 10px;
    height: 10px;
    margin: 0 3px 5px;
    border-right: 2px solid #7b828a;
    border-bottom: 2px solid #7b828a;
    transform: rotate(45deg);
}

.counterparty-card--accordion[open] > .counterparty-card__summary {
    margin-bottom: 18px;
    border-bottom: 1px solid #dce2e8;
    border-radius: 12px 12px 0 0;
}

.counterparty-card--accordion[open] .counterparty-card__chevron {
    margin-bottom: -5px;
    transform: rotate(225deg);
}

.counterparty-card__meta,
.counterparty-card__help,
.counterparty-card__remove-hint {
    color: #7b828a;
    font-size: 13px;
}

.counterparty-departments {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.counterparty-department {
    padding: 14px;
    border-radius: 10px;
    background: #f7f9fb;
}

.counterparty-department__title {
    margin: 0 0 10px;
    font-size: 16px;
}

.counterparty-contact {
    display: flex;
    gap: 10px;
    margin: 0 0 8px;
    padding: 11px;
    border: 1px solid #dfe5ea;
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
}

.counterparty-contact:has(input:checked) {
    border-color: #e86851;
    box-shadow: 0 0 0 1px #e86851;
}

.counterparty-contact.is-disabled {
    opacity: .62;
    cursor: not-allowed;
}

.counterparty-contact input {
    flex: 0 0 auto;
    margin-top: 3px;
}

.counterparty-contact__body,
.counterparty-contact__source,
.counterparty-contact__email,
.counterparty-contact__phone,
.counterparty-contact__missing {
    display: block;
}

.counterparty-contact__body {
    min-width: 0;
}

.counterparty-contact__source,
.counterparty-contact__phone {
    color: #7b828a;
    font-size: 12px;
}

.counterparty-contact__email {
    margin-top: 3px;
    overflow-wrap: anywhere;
    color: #3d5364;
    font-size: 13px;
}

.counterparty-contact__missing {
    color: #b04a3a;
    font-size: 12px;
}

.counterparty-department__empty,
.counterparty-empty {
    margin: 0;
    color: #7b828a;
    font-size: 14px;
}

.counterparty-card__footer {
    align-items: center;
    margin-top: 14px;
}

.counterparty-card__remove-hint {
    margin: 8px 0 0;
    text-align: right;
}

.counterparty-empty {
    padding: 20px;
    border: 1px dashed #ccd5dc;
    border-radius: 10px;
    background: #fafbfc;
}

.counterparty-search {
    margin-bottom: 18px;
    padding: 16px;
    border-radius: 10px;
    background: #f4f6f8;
}

.counterparty-search__controls {
    display: flex;
    gap: 10px;
}

.counterparty-search__controls .form-input {
    flex: 1 1 auto;
}

@media (max-width: 767px) {
    .counterparty-card__actions {
        flex-direction: column-reverse;
        align-items: flex-end;
        gap: 12px;
    }

    .counterparty-card__actions .counterparty-card__status {
        padding: 4px 7px;
        font-size: 11px;
    }

    .counterparty-guide,
    .counterparty-section__heading,
    .counterparty-card__heading,
    .counterparty-card__footer,
    .counterparty-search__controls {
        align-items: stretch;
        flex-direction: column;
    }

    .counterparty-guide {
        gap: 10px;
    }

    .counterparty-departments {
        grid-template-columns: 1fr;
    }

    .counterparty-tabs {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    .counterparty-tabs__link {
        justify-content: center;
        padding: 9px 10px;
        text-align: center;
    }

    .counterparty-card__remove-hint {
        text-align: left;
    }
}

/* ===== Благотворительность ===== */
.footer__charity {
    margin: 0;
}

.footer__social-block {
    display: flex;
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
}

.footer__charity-link {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 10px 18px;
    border: 1px solid var(--accent-base-color, #e86851);
    border-radius: 8px;
    background: var(--accent-base-color, #e86851);
    color: #fff;
    font-weight: 600;
    line-height: 1.2;
    transition: transform .15s ease, box-shadow .15s ease, opacity .15s ease;
}

.footer__charity-link:hover {
    color: #fff;
    opacity: .92;
    transform: translateY(-1px);
    box-shadow: 0 8px 18px rgba(232, 104, 81, .22);
}

.footer__charity-icon {
    font-size: 18px;
    line-height: 1;
}

.charity-page {
    padding-bottom: 30px;
}

.charity-intro {
    display: flex;
    align-items: flex-start;
    gap: 24px;
    margin-bottom: 36px;
    padding: 32px;
    background: linear-gradient(135deg, #fff 0%, #fff7f4 100%);
    border: 1px solid rgba(232, 104, 81, .16);
}

.charity-intro__mark {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    flex: 0 0 64px;
    border-radius: 50%;
    background: var(--accent-base-color, #e86851);
    color: #fff;
    font-size: 29px;
    box-shadow: 0 10px 24px rgba(232, 104, 81, .22);
}

.charity-section-title {
    margin: 0 0 16px;
    font-size: 28px;
    line-height: 1.25;
    font-weight: 600;
}

.charity-heading-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
}

.charity-grid {
    gap: 24px 0;
    margin-bottom: 30px;
}

.charity-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 8px 28px rgba(18, 35, 61, .08);
    transition: transform .18s ease, box-shadow .18s ease;
}

.charity-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 14px 34px rgba(18, 35, 61, .13);
}

.charity-card__image {
    display: block;
    height: 210px;
    overflow: hidden;
    background: #f4f6f8;
}

.charity-card__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .35s ease;
}

.charity-card:hover .charity-card__image img {
    transform: scale(1.035);
}

.charity-card__placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    color: var(--accent-base-color, #e86851);
    font-size: 48px;
    background: linear-gradient(135deg, #fff7f4, #f1f4f7);
}

.charity-card__body {
    display: flex;
    flex: 1;
    flex-direction: column;
    padding: 20px;
}

.charity-card__meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
    color: #8b949e;
    font-size: 14px;
}

.charity-card__title {
    margin: 0 0 12px;
    font-size: 20px;
    line-height: 1.3;
}

.charity-card__title a {
    color: var(--text-color, #262d35);
}

.charity-card__title a:hover,
.charity-card__more:hover {
    color: var(--accent-base-color, #e86851);
}

.charity-card__more {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: auto;
    color: var(--accent-base-color, #e86851);
    font-weight: 600;
}

.charity-help {
    margin-top: 40px;
    padding: 32px;
}

.charity-help__item {
    display: flex;
    align-items: flex-start;
    gap: 18px;
    height: 100%;
    padding: 22px;
    border-radius: 10px;
    background: #f7f9fb;
}

.charity-help__number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    border-radius: 50%;
    background: var(--accent-base-color, #e86851);
    color: #fff;
    font-size: 20px;
    font-weight: 700;
}

.charity-help__item h3 {
    margin: 0 0 8px;
    font-size: 20px;
}

.charity-help__cta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid #e7ebef;
}

.charity-transparency {
    max-width: 900px;
    margin: 24px auto 0;
    color: #6f7882;
    text-align: center;
}

.charity-article {
    padding: 36px;
}

.charity-article__date {
    display: block;
    margin-bottom: 8px;
    color: #8b949e;
}

.charity-article__title {
    margin-bottom: 26px;
}

.charity-article__cover {
    display: block;
    width: 100%;
    height: 480px;
    margin-bottom: 30px;
    border-radius: 12px;
    object-fit: cover;
}

.charity-article__text {
    max-width: 960px;
    font-size: 18px;
    line-height: 1.7;
}

.charity-gallery {
    margin-top: 42px;
    padding-top: 32px;
    border-top: 1px solid #e7ebef;
}

.charity-gallery .row {
    gap: 20px 0;
}

.charity-gallery__item {
    position: relative;
    display: block;
    height: 230px;
    overflow: hidden;
    border-radius: 10px;
    background: #f4f6f8;
}

.charity-gallery__item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .25s ease;
}

.charity-gallery__item:hover img {
    transform: scale(1.04);
}

.charity-gallery__item span {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    padding: 28px 12px 10px;
    color: #fff;
    font-size: 14px;
    background: linear-gradient(transparent, rgba(0, 0, 0, .72));
}

.charity-article__footer {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    margin-top: 36px;
    padding-top: 28px;
    border-top: 1px solid #e7ebef;
}

@media (max-width: 767px) {
    .charity-intro,
    .charity-help,
    .charity-article {
        padding: 22px;
    }

    .charity-intro {
        gap: 16px;
    }

    .charity-intro__mark {
        width: 48px;
        height: 48px;
        flex-basis: 48px;
        font-size: 22px;
    }

    .charity-section-title {
        font-size: 24px;
    }

    .charity-card__image {
        height: 220px;
    }

    .charity-help__cta,
    .charity-article__footer {
        align-items: stretch;
        flex-direction: column;
    }

    .charity-gallery__item {
        height: 160px;
    }

    .charity-article__cover {
        height: 260px;
    }
}
.error-message {
    font-size: 0.875em;
    display: block;
}
.form-input.error {
    border-color: #dc3545 !important;
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25);
}
.input-error {
    border: 1px solid red !important;
}
.error-message {
    color: red;
    font-size: 13px;
    margin-top: 3px;
    display: none;
}

.suggestions-container {
    position: absolute;
    z-index: 1000;
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    max-height: 400px;
    overflow-y: auto;
    width: 500px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.suggestion-item {
    padding: 10px 15px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
}

.suggestion-item:hover {
    background-color: #f8f9fa;
}

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

.loading-suggestion {
    padding: 10px 15px;
    color: #6c757d;
    font-style: italic;
}

.suggestions-container {
    position: absolute;
    z-index: 1000;
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    max-height: 200px;
    overflow-y: auto;
    width: 100%;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-top: 2px;
}

.suggestion-item {
    padding: 10px 15px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    font-size: 14px;
}

.suggestion-item:hover {
    background-color: #f8f9fa;
}

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

.loading-suggestion {
    padding: 10px 15px;
    color: #6c757d;
    font-style: italic;
    font-size: 14px;
}

/* Для disabled полей */
.form-input:disabled {
    background-color: #f8f9fa;
    cursor: not-allowed;
}



#mapModal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
}

#mapModal > div {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    padding: 20px;
    border-radius: 8px;
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    overflow: auto;
}


/*.block-orders-grid__item.item-screen, .block-orders-grid__item.item-pair, .block-orders-grid__item.item-conductor_count {*/
/*    width: 60px;*/
/*}*/

/*.block-orders-grid__item.item-first {width: 250px;}*/


/* Добавьте в ваш CSS файл */
.alert-success {
    animation: slideDown 0.3s ease-out;
}

.close-btn {
    transition: opacity 0.2s;
}

.close-btn:hover {
    opacity: 0.7;
}

@keyframes slideDown {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Стили для выбранного файла */
.file-selected {
    background-color: #e8f0fe !important;
    border-color: #007bff !important;
}

.file-selected label {
    color: #007bff !important;
}

/* В ваш основной CSS файл */
.expiration-date {
    text-align: center;
}

.expiration-date small {
    font-size: 0.75em;
    margin-top: 2px;
}

.text-success {
    color: #28a745;
}

.datepicker.loading {
    opacity: 0.6;
    pointer-events: none;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" preserveAspectRatio="xMidYMid"><circle cx="50" cy="50" fill="none" stroke="%23007bff" stroke-width="10" r="35" stroke-dasharray="164.93361431346415 56.97787143782138"><animateTransform attributeName="transform" type="rotate" repeatCount="indefinite" dur="1s" values="0 50 50;360 50 50" keyTimes="0;1"/></circle></svg>');
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 20px;
}

/* Анимация для сообщения */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}

.expiration-date small {
    animation: fadeIn 0.3s ease-in-out;
}

.expiration-date small {
    display: block;
    font-size: 11px;
    color: #28a745;
    margin-top: 2px;
    animation: fadeIn 0.3s;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* В ваш основной CSS файл */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.invoice-success-message {
    animation: fadeIn 0.3s ease-out;
}

.request-invoice-btn:disabled {
    cursor: not-allowed;
    pointer-events: none;
}

.td-warning {
    background-color: #fff3cd !important;
}

.restore-datepicker, .delivery-datepicker {
    background-color: #fff;
    border: 1px solid #ffc107;
}

.restore-datepicker:focus, .delivery-datepicker:focus {
    border-color: #ffc107;
    box-shadow: 0 0 0 0.2rem rgba(255, 193, 7, 0.25);
}

.invalid-feedback
{
    color: red;
}

.submit-btn:disabled {
    cursor: not-allowed;
    opacity: 0.5 !important;
}

.submit-btn:disabled:hover {
    background-color: initial;
    transform: none;
}

.label-info {
    background-color: #5bc0de;
}

.label-warning {
    background-color: #f0ad4e;
}

.status-select option[value="new"] {
    background-color: #fff3cd;
}

.status-select option[value="processed"] {
    background-color: #d4edda;
}

.status-select option[value="rejected"] {
    background-color: #f8d7da;
}


/* ===== Select2: подсветка выбранных пунктов в выпадающем списке ===== */
/* select2 v4.1 помечает выбранные классом --selected, v4.0 — атрибутом aria-selected */
.select2-results__option--selected,
.select2-results__option[aria-selected="true"] {
    background-color: #e8f5e9;
    font-weight: 600;
}

.select2-results__option--selected::after,
.select2-results__option[aria-selected="true"]::after {
    content: "\2713";
    color: #4caf50;
    font-weight: 700;
    float: right;
    margin-left: 8px;
}

/* Наведение на уже выбранный пункт — чуть темнее зелёный вместо синего */
.select2-results__option--highlighted.select2-results__option--selected,
.select2-results__option--highlighted[aria-selected="true"] {
    background-color: #c8e6c9;
    color: inherit;
}

/* ===== ЛК: удаление складских остатков и продукции ===== */
.lk-stock-management .stock-bulk-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px 15px;
    margin-top: 20px;
}

.lk-stock-management .stock-bulk-actions .btn:disabled {
    opacity: .55;
    cursor: not-allowed;
}

.lk-stock-management .stock {
    margin-top: 15px;
}

.lk-stock-management .stock-table-grid__select {
    width: 22px;
    text-align: center;
}

.lk-stock-management .stock-table-grid__select input {
    width: 16px;
    height: 16px;
    accent-color: var(--accent-base-color, #E86851);
    cursor: pointer;
}

.lk-stock-management .stock-table-grid__actions {
    width: 70px;
    text-align: center;
}

.lk-stock-management .stock-table-grid__actions .btn {
    padding: 5px 8px;
}

@media (min-width: 1800px) {
    .lk-stock-management .stock-table-grid__filed3 {
        width: 125px;
    }

    .lk-stock-management .stock-table-grid__filed7 {
        width: 230px;
    }
}

@media (min-width: 1600px) and (max-width: 1799px) {
    .lk-stock-management .stock-table-grid__filed3 {
        width: 105px;
    }

    .lk-stock-management .stock-table-grid__filed7 {
        width: 130px;
    }
}

@media (min-width: 768px) and (max-width: 1599px) {
    .lk-stock-management .stock-table-grid__filed3 {
        width: 7.5%;
    }

    .lk-stock-management .stock-table-grid__filed7 {
        width: 6.3%;
    }
}

@media (min-width: 768px) {
    .lk-stock-management .stock-table__head .stock-table-grid__filed3 {
        overflow: visible;
        overflow-wrap: normal;
        word-break: normal;
    }
}

@media (max-width: 767px) {
    .lk-stock-management .stock-table-grid__select,
    .lk-stock-management .stock-table-grid__actions {
        width: auto !important;
        display: flex;
        align-items: center;
    }

    .lk-stock-management .stock-table-grid__actions::before {
        content: 'Действия';
        width: 100px;
        flex-shrink: 0;
        opacity: .7;
    }

    .lk-stock-management .stock-table-grid__select {
        align-items: center;
    }

    .lk-stock-management .stock-table-grid__select::before {
        content: 'Выбрать';
        width: 100px;
        flex-shrink: 0;
        opacity: .7;
    }
}

/* ===== Заявки на ЭТП (applications/index): читаемость «таблицы» ===== */
@media (min-width: 1366px) and (max-width: 1599px) {
    .applications-orders {
        --applications-column-gap: 8px;
        --applications-info-width: 180px;
        --applications-data-columns:
            15px minmax(0, 1fr) 38px 38px 35px 40px 48px
            50px 70px 32px 35px 60px 50px;
    }

    /* Одна сетка для заголовков и значений исключает сдвиг столбцов. */
    .applications-orders > .block-white > .block-orders-grid {
        display: grid;
        grid-template-columns: var(--applications-info-width) var(--applications-data-columns);
        column-gap: var(--applications-column-gap);
    }

    .applications-orders .block-orders__item > .block-white > .block-orders-grid {
        display: grid;
        grid-template-columns: var(--applications-info-width) minmax(0, 1fr);
        column-gap: var(--applications-column-gap);
    }

    .applications-orders .block-orders__item > .block-white > .block-orders-grid > .item-content {
        width: auto;
        min-width: 0;
    }

    .applications-orders .block-orders-grid__item.item-content > .block-orders-grid {
        display: grid;
        grid-template-columns: var(--applications-data-columns);
        column-gap: var(--applications-column-gap);
    }

    .applications-orders > .block-white > .block-orders-grid > .block-orders-grid__item,
    .applications-orders .block-orders-grid__item.item-content > .block-orders-grid > .block-orders-grid__item {
        width: auto;
        min-width: 0;
    }

    /* Действия заявки остаются внутри левой колонки и имеют единый размер. */
    .applications-orders .block-orders-grid__btns {
        width: 100%;
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    .applications-orders .block-orders-grid__btns .btn-email,
    .applications-orders .block-orders-grid__btns .btn-export-excel {
        width: 100%;
        min-height: 36px;
        padding: 6px 12px;
        line-height: 18px;
        text-align: center;
    }

    .applications-orders .block-orders-grid__btns .btn span {
        white-space: nowrap;
    }

    .applications-orders .block-orders-grid__btns .btn-export-excel img {
        margin: 0;
        flex-shrink: 0;
    }
}

@media (min-width: 1366px) {
    /* Шапка со столбцами не отрывается от строк при прокрутке списка */
    .block-orders > .block-white:first-child {
        position: sticky;
        top: 0;
        z-index: 5;
        margin-bottom: 0;
        box-shadow: 0 4px 10px -6px rgba(0, 0, 0, .15);
    }

    /* Заголовки столбцов прижаты к верху — ровнее читаются над значениями */
    .block-orders__head.block-orders-grid {
        align-items: flex-start;
    }

    /* Подсветка строки-позиции при наведении — глаз ведёт значение к заголовку */
    .block-orders-grid__item.item-content .block-orders-grid:hover {
        background: #f5f9ff;
    }
}

.application-response__hint {
    margin: -4px 0 18px;
    padding: 10px 12px;
    border-left: 3px solid var(--accent-base-color, #E86851);
    border-radius: 0 8px 8px 0;
    background: #F8FAFB;
    color: #626A72;
    font-size: 13px;
    line-height: 1.45;
}

/* ===== Заявки на ЭТП: удобный мобильный список и форма ответа ===== */
@media (max-width: 767px) {
    .applications-index-page .page__title,
    .application-response-page .page__title {
        margin-bottom: 18px;
        font-size: 27px;
        line-height: 1.18;
    }

    .applications-filters {
        margin-bottom: 20px;
        padding: 12px;
        border-radius: 13px;
    }

    .applications-filters__toggle {
        display: flex;
        align-items: center;
        width: 100%;
        min-height: 44px;
        padding: 8px 10px;
        border: 0;
        border-radius: 9px;
        background: #F5F7F9;
        color: var(--text-color, #363738);
        font-size: 14px;
        font-weight: 600;
        text-align: left;
    }

    .applications-filters__toggle > span:first-child {
        display: inline-flex;
        align-items: center;
        gap: 8px;
        min-width: 0;
    }

    .applications-filters__toggle > span:first-child svg {
        flex: 0 0 18px;
        color: var(--accent-base-color, #E86851);
    }

    .applications-filters__active {
        margin-left: auto;
        padding: 3px 7px;
        border-radius: 7px;
        background: rgba(232, 104, 81, .12);
        color: var(--accent-base-color, #E86851);
        font-size: 10px;
        font-weight: 600;
    }

    .applications-filters__caret {
        flex: 0 0 10px;
        margin-left: 9px;
        transition: transform .2s ease;
    }

    .applications-filters__toggle[aria-expanded="true"] .applications-filters__caret {
        transform: rotate(180deg);
    }

    .applications-filters__form {
        padding-top: 12px;
    }

    .applications-filters .form-item {
        margin-bottom: 12px;
    }

    .applications-filters .form-input,
    .applications-filters .form-select,
    .applications-filters .select2-container {
        width: 100% !important;
        min-height: 44px;
        font-size: 16px;
    }

    .applications-filters .block-sort__btns {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    .applications-filters .block-sort__btns .btn {
        width: 100%;
        min-width: 0;
        padding: 9px 8px;
    }

    .applications-orders > .block-white {
        display: none;
    }

    .applications-orders .block-orders__list {
        display: grid;
        gap: 14px;
        margin-bottom: 24px;
    }

    .applications-orders .block-orders__item,
    .application-response .block-orders__item {
        margin-top: 0;
    }

    .applications-orders .block-orders__item > .block-white,
    .application-response .block-orders__item > .block-white {
        padding: 14px;
        border-radius: 14px;
    }

    .applications-orders .block-orders__item > .block-white > .block-orders-grid,
    .application-response .block-orders__item > .block-white > .block-orders-grid {
        display: block;
    }

    .application-card__summary {
        display: block !important;
        width: 100% !important;
        padding: 0 0 14px !important;
        border-bottom: 1px solid #DFE7EF !important;
    }

    .application-card__summary h5 {
        margin-bottom: 5px !important;
        font-size: 19px;
    }

    .application-card__summary .block-orders-grid__user {
        margin-bottom: 12px;
    }

    .application-card__summary .block-orders-grid__user .name {
        font-size: 14px;
        font-weight: 600;
        line-height: 1.35;
    }

    .application-card__meta {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    .application-card__meta .block-orders-grid__text {
        min-width: 0;
        margin: 0;
        padding: 8px 9px;
        border-radius: 9px;
        background: #F5F7F9;
        font-size: 12px;
        line-height: 1.35;
    }

    .application-card__meta .block-orders-grid__text span,
    .application-card__meta .block-orders-grid__text strong {
        display: block;
    }

    .application-card__meta .block-orders-grid__text span {
        margin-bottom: 3px;
        color: #818E9C;
        font-size: 10px;
    }

    .application-card__meta .block-orders-grid__text strong {
        overflow-wrap: anywhere;
        font-weight: 500;
    }

    .applications-orders .block-orders-grid__btns {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        width: 100%;
        gap: 8px;
        margin-top: 12px;
    }

    .applications-orders .block-orders-grid__btns > .btn-primary,
    .applications-orders .block-orders-grid__btns > .btn-xs {
        grid-column: 1 / -1;
    }

    .applications-orders .block-orders-grid__btns .btn,
    .applications-orders .block-orders-grid__btns .btn-xs {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 100%;
        min-width: 0;
        min-height: 40px;
        margin: 0;
        padding: 7px 8px;
        border-radius: 9px;
        line-height: 1.2;
        text-align: center;
    }

    .applications-orders .block-orders-grid__btns br {
        display: none;
    }

    .applications-orders .block-orders-grid__btns .btn-export-excel img {
        flex: 0 0 auto;
        width: 16px;
        margin-left: 5px;
    }

    .applications-orders .block-orders-grid__item.item-content,
    .application-response .block-orders-grid__item.item-content {
        width: 100%;
        overflow: visible;
    }

    .application-position-card {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px !important;
        margin: 0 !important;
        padding: 14px 0 !important;
        border-bottom: 1px solid #DFE7EF;
    }

    .application-position-card:last-child {
        border-bottom: 0;
        padding-bottom: 0 !important;
    }

    .application-position-card > .block-orders-grid__item {
        display: block;
        width: auto !important;
        min-width: 0;
        padding: 8px 9px;
        border-radius: 8px;
        background: #F8FAFB;
        font-size: 13px !important;
        line-height: 1.35 !important;
        overflow: visible;
        text-transform: none !important;
    }

    .application-position-card > .item-num {
        display: none;
    }

    .application-position-card > .item-title,
    .application-position-card > .item-producer {
        grid-column: 1 / -1;
    }

    .application-position-card > .item-title {
        padding: 10px 11px;
        border: 1px solid #DFE7EF;
        background: #fff;
        font-size: 15px !important;
        font-weight: 600;
    }

    .application-position-card .block-orders-grid__label {
        display: block;
        width: auto !important;
        margin: 0 0 4px;
        color: #818E9C;
        font-size: 10px;
        line-height: 1.2;
        opacity: 1;
    }

    .application-position-card .block-orders-grid__stock {
        margin-top: 4px;
        font-weight: 400;
    }

    .application-position-card .block-orders-grid__desc {
        max-width: none !important;
        margin-top: 5px;
        color: #555D65;
        font-weight: 400;
        line-height: 1.35;
    }

    .application-position-card > .item-colors,
    .application-position-card > .item-pack,
    .application-position-card > .item-producer,
    .application-position-card > .item-sertif {
        display: block;
        padding-top: 8px !important;
    }

    .application-position-card .colors-grid {
        display: flex;
        flex-wrap: wrap;
        gap: 5px;
    }

    .application-position-card .colors-grid > div {
        width: 12px !important;
        height: 12px !important;
        border-radius: 50%;
    }

    .applications-pagination {
        gap: 10px;
        margin: 18px 0 40px;
    }

    .applications-pagination__info {
        width: 100%;
        text-align: center;
    }

    .applications-pagination .pagination {
        max-width: 100%;
        overflow-x: auto;
        padding-bottom: 3px;
    }

    .application-response > .block-white:first-child {
        padding: 14px;
        border-radius: 14px;
    }

    .application-response > .block-white:first-child .block-orders__head {
        display: none;
    }

    .application-response > .block-white:first-child .block-white__title {
        margin-bottom: 10px;
        font-size: 20px;
    }

    .application-response__hint {
        margin: 0;
        font-size: 12px;
    }

    .application-response .block-orders__list {
        margin: 12px 0 30px;
    }

    .application-response .application-card__summary {
        margin-bottom: 0;
    }

    .application-response .application-position-card:last-of-type {
        padding-bottom: 14px !important;
        border-bottom: 1px solid #DFE7EF;
    }

    .application-response .block-orders-grid__collapse {
        margin: 0 0 14px;
        border: 1px solid #DFE7EF;
        border-radius: 10px;
        background: #F5F7F9;
    }

    .application-response .block-orders-grid__collapse > .btn {
        min-height: 46px;
        justify-content: space-between;
        width: 100%;
        padding: 10px 12px;
        color: var(--text-color, #363738);
        font-weight: 600;
    }

    .application-response .block-orders-grid__collapse > .btn[aria-expanded="true"] svg {
        transform: rotate(180deg);
    }

    .application-response .block-orders-grid__collapse .collapse__body {
        padding: 12px;
        border-top: 1px solid #DFE7EF;
        background: #fff;
    }

    .application-response .collapse__body .form-item.d-flex {
        display: block !important;
    }

    .application-response .collapse__body .form-item {
        margin-bottom: 12px;
    }

    .application-response .collapse__body .form-input,
    .application-response .collapse__body .form-select,
    .application-response .collapse__body .select2-container {
        width: 100% !important;
        min-height: 44px;
        font-size: 16px;
    }

    .application-response .collapse__body .form-label {
        margin-bottom: 5px;
    }

    .application-response .collapse__btns,
    .application-response .input-file,
    .application-response .input-file > .btn {
        width: 100%;
    }

    .application-response .input-file > .btn {
        justify-content: flex-start;
        min-height: 44px;
        overflow: hidden;
    }

    .application-response .input-file .form-label {
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .application-response #comment {
        min-height: 100px;
        font-size: 16px;
    }

    .application-response .block-orders-grid__btns {
        display: grid;
        grid-template-columns: 1fr;
        gap: 8px;
        margin-top: 14px;
    }

    .application-response .block-orders-grid__btns .btn {
        justify-content: center;
        width: 100%;
        min-height: 44px;
    }
}

@media (max-width: 389px) {
    .application-card__meta,
    .applications-filters .block-sort__btns {
        grid-template-columns: 1fr;
    }
}
/* Загрузка складских разделов */
.stock-upload-card {
    padding: 28px;
}

.stock-upload-tabs {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    border-bottom: 1px solid #e3e8ed;
}

.stock-upload-tabs .nav-item,
.stock-upload-tabs .nav-link {
    width: 100%;
}

.stock-upload-tabs .nav-link {
    min-height: 48px;
    padding: 10px 12px;
    border: 1px solid #dce2e8;
    border-radius: 10px 10px 0 0;
    background: #f5f7f9;
    color: #39424c;
    font-weight: 600;
}

.stock-upload-tabs .nav-link.active {
    border-color: #e86851 #e86851 #fff;
    background: #fff;
    color: #e86851;
}

.stock-upload-content {
    padding-top: 28px;
}

.stock-upload-pane__heading {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 14px;
}

.stock-upload-pane__heading h5,
.stock-upload-help h5 {
    margin: 0 0 5px;
}

.stock-upload-pane__heading p,
.stock-upload-help p {
    margin: 0;
}

.stock-upload-pane__step {
    display: inline-flex;
    flex: 0 0 30px;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #e86851;
    color: #fff;
    font-weight: 700;
}

.stock-upload-help {
    height: 100%;
    padding: 22px;
    border: 1px solid #e3e8ed;
    border-radius: 12px;
    background: #f7f9fa;
    overflow-wrap: anywhere;
}

.stock-upload-help hr {
    margin: 20px 0;
}

.stock-imports-card__heading,
.stock-import-status__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
}

.stock-imports-card__heading {
    margin-bottom: 16px;
}

.stock-imports-card__active,
.stock-import-status__badge {
    flex: 0 0 auto;
    padding: 5px 9px;
    border-radius: 999px;
    background: rgba(1, 160, 226, .12);
    color: #0179aa;
    font-size: 12px;
    font-weight: 600;
}

.stock-import-status {
    padding: 14px;
    border: 1px solid #DFE7EF;
    border-radius: 10px;
    background: #F8FAFB;
}

.stock-import-status + .stock-import-status {
    margin-top: 10px;
}

.stock-import-status--completed {
    border-color: rgba(45, 157, 95, .28);
    background: rgba(45, 157, 95, .06);
}

.stock-import-status--completed .stock-import-status__badge {
    background: rgba(45, 157, 95, .14);
    color: #247d4c;
}

.stock-import-status--failed {
    border-color: rgba(213, 18, 42, .25);
    background: rgba(213, 18, 42, .05);
}

.stock-import-status--failed .stock-import-status__badge {
    background: rgba(213, 18, 42, .12);
    color: #a90e22;
}

.stock-import-status__file {
    display: block;
    max-width: 680px;
    margin-top: 2px;
    overflow: hidden;
    color: #667788;
    font-size: 13px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.stock-import-status__meta,
.stock-import-status__details {
    margin-top: 7px;
    color: #667788;
    font-size: 13px;
}

.stock-import-progress {
    height: 8px;
    margin-top: 11px;
    overflow: hidden;
    border-radius: 999px;
    background: #E4EAF0;
}

.stock-import-progress span {
    display: block;
    min-width: 2%;
    height: 100%;
    border-radius: inherit;
    background: var(--accent-base-color, #E86851);
    transition: width .3s ease;
}

.stock-upload-form-row > .col,
.stock-upload-form-row .form-item,
.stock-upload-pane > .col {
    min-width: 0;
}

.stock-upload-file {
    width: 100%;
    min-width: 0;
    gap: 10px;
}

.stock-upload-file__button {
    flex: 0 0 auto;
    max-width: 58%;
}

.stock-upload-file__button span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.stock-upload-file__button img {
    flex: 0 0 auto;
}

.stock-upload-file__name {
    flex: 1 1 auto;
    min-width: 0;
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@media (max-width: 1199px) {
    .stock-upload-help {
        height: auto;
        margin-top: 24px;
    }
}

@media (max-width: 767px) {
    .stock-imports-card__heading,
    .stock-import-status__header {
        flex-direction: column;
        gap: 8px;
    }

    .stock-import-status__file {
        max-width: calc(100vw - 80px);
    }

    .stock-upload-card {
        padding: 18px 14px;
    }

    .stock-upload-tabs {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .stock-upload-tabs .nav-link {
        border-radius: 8px;
    }

    .stock-upload-file__button {
        max-width: 62%;
    }
}

.stock-badge--sale {
    background: #fff0d7;
    color: #a86600;
}

.stock-badge--illiquid {
    background: #eee8ff;
    color: #6847a8;
}

/* ===== Поиск складских позиций ===== */
.stock-search-page .stock-search-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    width: 100%;
}

.stock-search-page .stock-search-form .form-input {
    width: 100%;
    max-width: none;
}

.stock-search-page .stock-header {
    align-items: center;
    margin: 14px 0 12px;
}

.stock-search-page .stock-header__aside {
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 18px;
    margin-left: auto;
}

.stock-search-page .stock-header-sort .dropdown-modal {
    width: 310px;
    max-width: calc(100vw - 30px);
}

.stock-search-page .stock-header-city .dropdown-modal {
    width: min(680px, calc(100vw - 30px));
    max-width: 680px;
    padding: 24px;
}

.stock-sort-trigger {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 36px;
    padding: 5px 9px;
    border: 1px solid #BFCCD8;
    border-radius: 9px;
    background: #fff;
    color: var(--text-color, #363738);
}

.stock-sort-trigger:hover,
.stock-sort-trigger.show {
    border-color: var(--accent-base-color, #E86851);
    color: var(--accent-base-color, #E86851);
}

.stock-sort-trigger__icon {
    flex: 0 0 auto;
}

.stock-sort-trigger__text {
    font-size: 13px;
    white-space: nowrap;
}

.stock-sort-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 7px 9px;
    border-radius: 7px;
    color: var(--text-color, #363738);
    text-decoration: none;
}

.stock-sort-option:hover {
    background: #F2F5F7;
    color: var(--accent-base-color, #E86851);
}

.stock-sort-option.is-active {
    background: rgba(232, 104, 81, .1);
    color: var(--accent-base-color, #E86851);
    font-weight: 600;
}

.stock-search-results {
    margin-top: 0;
    padding-bottom: 72px;
}

.stock-search-results .stock__table {
    overflow-x: auto;
    overflow-y: visible;
}

.stock-search-results .stock-request-bar {
    position: fixed;
    left: 50%;
    bottom: max(16px, env(safe-area-inset-bottom));
    z-index: 1040;
    justify-content: space-between;
    width: min(680px, calc(100vw - 32px));
    padding: 12px 14px;
    border: 1px solid #DFE7EF;
    border-radius: 12px;
    background: rgba(255, 255, 255, .96);
    box-shadow: 0 8px 28px rgba(42, 54, 68, .18);
    transform: translateX(-50%);
    backdrop-filter: blur(8px);
}

.stock-search-results .stock__table-items {
    padding-top: 0;
}

.stock-search-results .stock-table-grid__standard-value {
    margin-top: 3px;
    color: #697987;
    font-size: 12px;
    line-height: 1.25;
    overflow-wrap: anywhere;
}

@media (min-width: 768px) {
    .stock-search-results .stock__table-items {
        min-width: 1050px;
    }

    .stock-search-results .stock-table-grid {
        display: grid;
        grid-template-columns:
            minmax(140px, 1.55fr)
            68px
            94px
            minmax(70px, .68fr)
            minmax(62px, .58fr)
            minmax(110px, .86fr)
            minmax(70px, .62fr)
            minmax(120px, 1.15fr)
            minmax(76px, .72fr)
            minmax(140px, 1.25fr)
            var(--stock-badge-columns, 28px 24px) 52px 28px;
        gap: 8px;
        align-items: center;
    }

    .stock-search-results .stock-table-grid > div {
        width: auto !important;
        min-width: 0;
        overflow: visible;
        flex: initial;
    }

    .stock-search-results .stock-table-grid__value,
    .stock-search-results .stock-table__head > div {
        line-height: 1.3;
        overflow-wrap: anywhere;
        word-break: normal;
    }

    .stock-search-results .stock-table__head .stock-table-grid__filed3 {
        overflow-wrap: normal;
        word-break: normal;
    }

    .stock-search-results .stock-table__row {
        overflow: visible;
    }

    .stock-search-results .stock-table-grid__colors .stock-table-grid__value {
        display: flex;
        flex-wrap: wrap;
        align-content: center;
        gap: 4px;
        width: 66px;
    }

    .stock-search-results .stock-table-grid__colors .stock-table-grid__value > div {
        flex: 0 0 10px;
    }

    .stock-search-results .stock-table-grid__filed10 span {
        white-space: nowrap;
    }

    .stock-search-results .stock-table-grid__filed11 .form-checkbox,
    .stock-search-results .stock-table-grid__filed11 .form-checkbox label {
        width: 27px;
    }
}

@media (min-width: 768px) and (max-width: 1599px) {
    .stock-search-results {
        --stock-honest-width: 24px;
        --stock-electrocable-width: 20px;
    }

    .stock-search-results .stock__table-items {
        min-width: 1000px;
    }

    .stock-search-results .stock-table-grid {
        grid-template-columns:
            minmax(120px, 1.45fr)
            54px 86px 62px 52px 110px 62px
            minmax(96px, 1.05fr)
            66px
            minmax(112px, 1.15fr)
            var(--stock-badge-columns, 24px 20px) 52px 28px;
        gap: 6px;
    }

    .stock-search-results .stock-table-grid__colors .stock-table-grid__value {
        width: 52px;
    }
}

@media (min-width: 768px) and (max-width: 1399px) {
    .stock-search-results .stock__table-items {
        min-width: 1050px;
    }
}

@media (max-width: 767px) {
    .stock-search-page {
        padding: 16px 12px;
        border-radius: 14px;
    }

    .stock-search-page .stock-search-form {
        grid-template-columns: 1fr;
        gap: 8px;
        margin-bottom: 14px;
    }

    .stock-search-page .stock-search-form .form-input {
        min-height: 46px;
        font-size: 16px;
    }

    .stock-search-page .stock-search-form .btn {
        width: 100%;
    }

    .stock-search-page > h5 {
        margin: 12px 0;
        font-size: 16px;
    }

    .stock-search-page .stock-header,
    .stock-search-page .stock-header__aside {
        align-items: stretch;
    }

    .stock-search-page .stock-header {
        flex-direction: column;
        gap: 12px;
        margin: 12px 0 16px;
    }

    .stock-search-page .stock-header > div:first-child {
        max-width: 100%;
        overflow-x: auto;
        padding-bottom: 3px;
    }

    .stock-search-page .stock-header__aside {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        width: 100%;
        gap: 8px;
        margin-left: 0;
    }

    .stock-search-page .stock-header-city,
    .stock-search-page .stock-header-sort {
        min-width: 0;
    }

    .stock-search-page .stock-header__aside > .stock-header-sort:last-child {
        grid-column: 1 / -1;
    }

    .stock-search-page .stock-header-city__btn,
    .stock-search-page .stock-sort-trigger {
        justify-content: center;
        width: 100%;
        min-height: 42px;
        padding: 7px 9px;
        border: 1px solid #DFE7EF;
        border-radius: 9px;
        background: #F8FAFB;
        line-height: 1.2;
    }

    .stock-search-page .stock-sort-trigger__text {
        display: inline;
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .stock-search-page .stock-header-city .dropdown-modal,
    .stock-search-page .stock-header-sort .dropdown-modal {
        width: calc(100vw - 30px);
        max-width: calc(100vw - 30px);
        padding: 18px;
    }

    .stock-search-results {
        margin-top: 12px;
    }

    .stock-search-results .stock__table {
        overflow: visible;
    }

    .stock-search-results .stock__table-items {
        display: grid;
        gap: 10px;
        padding: 0;
        border-top: 0;
    }

    .stock-search-results .stock-table__row {
        display: grid;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 12px 8px;
        padding: 14px;
        border: 1px solid #DFE7EF;
        border-radius: 12px;
        background: #fff;
        box-shadow: 0 4px 14px rgba(42, 54, 68, .06);
    }

    .stock-search-results .stock-table .stock-table-grid > div {
        display: block;
        width: auto !important;
        min-width: 0;
        overflow: visible;
    }

    .stock-search-results .stock-table .stock-table-grid__title,
    .stock-search-results .stock-table .stock-table-grid__filed5,
    .stock-search-results .stock-table .stock-table-grid__filed6,
    .stock-search-results .stock-table .stock-table-grid__filed7 {
        grid-column: 1 / -1;
    }

    .stock-search-results .stock-table .stock-table-grid__colors,
    .stock-search-results .stock-table .stock-table-grid__availability,
    .stock-search-results .stock-table .stock-table-grid__filed1,
    .stock-search-results .stock-table .stock-table-grid__filed2,
    .stock-search-results .stock-table .stock-table-grid__filed3,
    .stock-search-results .stock-table .stock-table-grid__filed4 {
        grid-column: span 2;
    }

    .stock-search-results .stock-table .stock-table-grid__label {
        display: block;
        width: auto;
        margin-bottom: 3px;
        color: #818E9C;
        font-size: 10px;
        line-height: 1.2;
        opacity: 1;
    }

    .stock-search-results .stock-table .stock-table-grid__value {
        overflow-wrap: anywhere;
        font-size: 13px;
        line-height: 1.35;
    }

    .stock-search-results .stock-table .stock-table-grid__title .stock-table-grid__value {
        font-size: 15px;
        font-weight: 600;
    }

    .stock-search-results .stock-table .stock-table-grid__colors .stock-table-grid__value {
        display: flex;
        flex-wrap: wrap;
        gap: 5px;
    }

    .stock-search-results .stock-table .stock-table-grid__filed8,
    .stock-search-results .stock-table .stock-table-grid__filed9,
    .stock-search-results .stock-table .stock-table-grid__filed10,
    .stock-search-results .stock-table .stock-table-grid__filed11 {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: flex-end;
        gap: 4px;
        text-align: center;
    }

    .stock-search-results .stock-table .stock-table-grid__filed8 .stock-table-grid__label,
    .stock-search-results .stock-table .stock-table-grid__filed9 .stock-table-grid__label,
    .stock-search-results .stock-table .stock-table-grid__filed10 .stock-table-grid__label {
        display: flex;
        min-height: 18px;
        align-items: center;
        justify-content: center;
    }

    .stock-search-results .stock-table .stock-table-grid__filed8 .stock-table-grid__value,
    .stock-search-results .stock-table .stock-table-grid__filed9 .stock-table-grid__value {
        height: auto;
    }

    .stock-search-results .stock-table .stock-table-grid__filed11::before {
        content: 'Выбрать';
        min-height: 18px;
        color: #818E9C;
        font-size: 10px;
        line-height: 1.2;
    }

    .stock-search-results .stock-table .stock-table-grid__filed11 .form-checkbox,
    .stock-search-results .stock-table .stock-table-grid__filed11 .form-checkbox label {
        width: 27px;
    }

    .stock-search-results .stock-request-bar {
        bottom: max(8px, env(safe-area-inset-bottom));
        justify-content: space-between;
        gap: 8px;
        padding: 10px;
        border-radius: 11px;
    }

    .stock-search-results .stock__selected {
        font-size: 12px;
    }

    .stock-search-results .stock__footer .btn {
        padding: 9px 12px;
        font-size: 12px;
    }
}

@media (max-width: 389px) {
    .stock-search-page .stock-header__aside {
        grid-template-columns: 1fr;
    }

    .stock-search-page .stock-header__aside > .stock-header-sort:last-child {
        grid-column: auto;
    }
}
/* Контакты отделов в профиле и карточке организации */
.department-contacts {
    margin-top: 40px;
}

.department-contacts__heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 18px;
}

.department-contacts__hint {
    max-width: 760px;
    margin: 0;
    color: #6f7782;
    font-size: 14px;
    line-height: 1.45;
}

.department-contacts__count {
    flex: 0 0 auto;
    padding: 6px 12px;
    border-radius: 999px;
    background: #f1f4f7;
    color: #59616b;
    font-size: 13px;
    font-weight: 600;
}

.department-contact-editor {
    margin-bottom: 16px;
    padding: 20px 20px 4px;
    border: 1px solid #dce2e8;
    border-radius: 12px;
    background: #fbfcfd;
}

.department-contact-editor__heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}

.department-contact-editor__title {
    margin: 0;
    font-size: 17px;
    font-weight: 600;
}

.department-contact-editor__remove {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 5px 0;
    border: 0;
    background: transparent;
    color: #c63e3e;
    font-size: 14px;
    cursor: pointer;
}

.department-contact-editor__remove:disabled {
    opacity: .35;
    cursor: not-allowed;
}

.department-contact-editor__options {
    min-height: 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 4px;
}

.department-contact-editor .form-input.is-linked {
    background: #f1f4f7;
}

.department-contacts__add {
    margin-top: 2px;
}

.branch-departments {
    padding-top: 20px;
    border-top: 1px solid #e1e6eb;
}

.branch-departments__heading {
    margin-bottom: 16px;
}

.branch-department {
    padding: 18px;
    border: 1px solid #dce2e8;
    border-radius: 12px;
    background: #fff;
}

.branch-department + .branch-department {
    margin-top: 16px;
}

.branch-department__title {
    margin-bottom: 14px;
    color: #363738;
    font-size: 17px;
    font-weight: 600;
}

.branch-department .department-contact-editor {
    background: #f7f9fb;
}

.branch-department .btn {
    white-space: normal;
}

.organization-contact-section + .organization-contact-section {
    margin-top: 28px;
}

.branch-card-departments .organization-contact-section {
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid #edf0f3;
}

.branch-card-departments .organization-contact-section + .organization-contact-section {
    margin-top: 20px;
}

.branch-card-departments .organization-contact-section .block-white__title {
    margin-bottom: 12px;
    font-size: 17px;
}

.organization-contact-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.organization-contact-card {
    min-width: 0;
    padding: 18px;
    border: 1px solid #e0e5ea;
    border-radius: 12px;
    background: #fbfcfd;
}

.organization-contact-card__name {
    margin: 0 0 12px;
    font-size: 17px;
    font-weight: 600;
}

.organization-contact-card__meta {
    margin: -6px 0 12px;
    color: #747b84;
    font-size: 13px;
}

.organization-contact-card__details {
    display: grid;
    gap: 8px;
}

.organization-contact-card__row {
    display: grid;
    grid-template-columns: 100px minmax(0, 1fr);
    gap: 10px;
    align-items: baseline;
}

.organization-contact-card__label {
    color: #858b93;
    font-size: 13px;
}

.organization-contact-card__value {
    min-width: 0;
    overflow-wrap: anywhere;
}

@media (max-width: 767px) {
    .department-contacts__heading {
        align-items: flex-start;
        flex-direction: column;
        gap: 10px;
    }

    .department-contact-editor {
        padding: 16px 14px 2px;
    }

    .department-contact-editor__remove span {
        display: none;
    }

    .branch-department {
        padding: 14px;
    }

    .organization-contact-grid {
        grid-template-columns: 1fr;
    }
}
