.auth-page {
    -ms-flex-align: center;
    align-items: center;
    background-color: #7d849a;
    display: -ms-flexbox;
    display: flex;
    -ms-flex-direction: column;
    flex-direction: column;
    height: 100vh;
    -ms-flex-pack: center;
    justify-content: center;
}
.form-group.has-error .help-block {
    color: red;
}
label {
    font-weight: 600;
}
.form-group {
    margin-bottom: 10px;
}
hr {
    margin: 1rem 0;
    color: inherit;
    border-style: inset;
    border-width: 1px;
    border-top: 1px solid var(--bs-hr-border-color);
    opacity: .8;
}
input[readonly] {
}
html body textarea.disabled,
html body select.disabled,
html body input.disabled {
    user-select: none !important;
    -moz-user-select: none !important;
    -webkit-user-select: none !important;
    cursor: pointer !important;
    background-color: #eff2f7;
}

.navbar-nav .menu-icon {
    margin-right: 6px;
    min-width: 16px;
}
.form-switch.form-switch-onoff {
    padding-left: 2.5rem;
    min-height: 20px;
    line-height: 20px;
}
.form-switch.form-switch-onoff .form-check-input {
    width: 34px;
    height: 17px;
    left: -0.5rem;
    position: relative;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%23fff'/%3e%3c/svg%3e");
    --bs-bg-opacity: 1;
    background-color: rgba(var(--bs-danger-rgb),var(--bs-bg-opacity))!important;
}
.form-switch.form-switch-onoff .form-check-input:checked {
    --bs-bg-opacity: 1;
    background-color: rgba(var(--bs-success-rgb),var(--bs-bg-opacity))!important;
}
.title-required:after,
.form-group.required label:after {
    content: '*';
    color: red;
    margin-left: 5px;
}
.admin100 {
    min-height: -moz-calc(100vh - 100px);
    min-height: -webkit-calc(100vh - 100px);
    min-height: calc(100vh - 100px);
}
.badge-lng {
    min-width: 25px;
    text-transform: uppercase;
}
.file-input .btn {
    border: 1px solid var(--bs-input-border-color);
}
.file-input .btn:hover {
    border-color: var(--bs-btn-hover-border-color);
}

.datepicker {
    z-index: 1200!important;
}
.login-bg {
    background-repeat: no-repeat;
    background-position: center center;
    background-size: cover;
}
/*select.form-control {*/
/*    -webkit-appearance: auto;*/
/*    -moz-appearance: auto;*/
/*    appearance: auto;*/
/*}*/
.select2-container .select2-dropdown {
    border-color: #ccc;
}

.actionSeparator {
    display: inline-block;
    width: 5px;
}

/* ======== Mobile / touch enhancements (v5) ======== */
/* 1. Тач-таргеты: минимальная высота 40px для кнопок/пагинации на тач-устройствах */
@media (hover: none) and (pointer: coarse) {
    .table-responsive .btn,
    .table-responsive .page-link,
    .table-responsive a[title] {
        min-height: 40px;
        min-width: 40px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        padding-left: .55rem;
        padding-right: .55rem;
    }
    /* иконки-кнопки в ActionColumn не должны сплющиваться */
    .table-responsive .btn.btn-sm {
        margin: 2px 0;
    }
    /* 2. Визуальный фокус для тач-клавиатурной навигации */
    .table-responsive .btn:focus {
        outline: 3px solid rgba(13, 110, 253, .35);
        outline-offset: 1px;
    }
    /* 3. Пагинация: расстояние между кнопками */
    .pagination .page-item { margin: 0 1px; }
}
/* 4. iOS-зум: шрифт 16px в инпутах на мобильных (иначе Safari зумит при фокусе) */
@media (max-width: 767.98px) {
    .form-control, .form-select,
    .input-group-text,
    select.form-control,
    textarea.form-control {
        font-size: 16px;
    }
    /* логотип-ссылка в шапке */
    .navbar-header .logo { font-size: 1rem; }
    /* тайтл страницы компактнее */
    .page-title-box h4 { font-size: 1.05rem; }
    /* фильтры-таблицы не растягивают страницу */
    .grid-view .filters input, .grid-view .filters select {
        max-width: 100%;
    }
    /* контент без лишних отступов */
    .page-content { padding-left: .65rem; padding-right: .65rem; }
    .container-fluid { padding-left: .5rem; padding-right: .5rem; }
    /* карточка логина: минимальная ширина, если карта не влезает */
    .auth-page .card { min-width: 0; }
    .auth-page .row > [class*="col-"] { min-width: 0; }
    /* bootbox/alerts по ширине экрана */
    .bootbox.alert { max-width: calc(100vw - 2rem); }
    .bootbox.alert { word-break: break-word; }
}
/* 5. Горизонтальный скролл: страховка от случайного растяжения */
body { overflow-x: hidden; }
/* 6. Иконки в кнопках ActionColumn: не перехватывать клики и не сжиматься */
.table-responsive .btn .bi, .table-responsive .btn i {
    pointer-events: none;
    flex-shrink: 0;
}

/* ======== Mobile cards for tables (v6) ======== */
/* Таблицы GridView на мобильных превращаются в карточки label:value,
 * чтобы не крутить таблицу по горизонтали. */
@media (max-width: 767.98px) {
    /* скрываем строку заголовков и фильтры в карточном режиме */
    .table-responsive thead, .table-responsive .filters {
        display: none !important;
    }
    .table-responsive table, .table-responsive tbody {
        display: block;
        width: 100%;
    }
    .table-responsive table {
        border: 0;
    }
    /* карточка = строка таблицы */
    .table-responsive tr {
        display: block;
        border: 1px solid #e3e6f0;
        border-radius: .4rem;
        margin-bottom: .35rem;
        background: #fff;
        padding: .3rem .5rem .35rem;
        box-shadow: 0 1px 2px rgba(56, 65, 90, .06);
    }
    /* поля карточки — компактные «чипы» label:value, переносятся строками */
    .table-responsive td {
        display: inline-block;
        border: 0;
        padding: .1rem .45rem .1rem 0;
        width: auto;
        max-width: 100%;
        font-size: .84rem;
        line-height: 1.35;
        text-align: left;
        vertical-align: top;
    }
    .table-responsive td[data-label]:not(:empty)::before {
        content: attr(data-label) ':';
        color: #7a869a;
        font-weight: 600;
        font-size: .72rem;
        margin-right: .28rem;
    }
    /* пустые ячейки не занимают место */
    .table-responsive td:empty { display: none; }
    /* кнопки действий — одной компактной строкой внизу карточки */
    .table-responsive td:last-child {
        display: block;
        width: 100%;
        padding: .25rem 0 0;
        margin-top: .2rem;
        border-top: 1px dashed #edf0f7;
    }
    .table-responsive td:last-child .btn {
        padding: .12rem .5rem;
        font-size: .78rem;
    }
    /* чекбоксы (массовые операции) */
    .table-responsive td input[type="checkbox"] {
        margin: .25rem .35rem .25rem 0;
    }
}
/* планшеты и выше — обычные таблицы */
@media (min-width: 768px) {
    .m-cards-restore { display: revert; }
}
