/* Для элементов вне .app-wrapper (например модалки в конце body) */
:root {
    --lte-bar-height: 3.2rem;
    --lte-header-row-height: 3.2rem;
}

.app-wrapper {
    --lte-bar-height: calc(3.2rem);
    --lte-header-row-height: var(--lte-bar-height);
    grid-template-rows: var(--lte-header-row-height) 1fr min-content;
}

.app-header,
.sidebar-brand {
    box-sizing: border-box !important;
}

.app-header {
    height: var(--lte-header-row-height) !important;
    min-height: var(--lte-header-row-height) !important;
    max-height: none !important;
}

.sidebar-brand {
    height: var(--lte-header-row-height) !important;
    min-height: var(--lte-header-row-height) !important;
    padding-top: 0.8125rem;
    padding-bottom: 0.8125rem;
}

.layout-fixed .app-sidebar .sidebar-wrapper {
    height: calc(100vh - var(--lte-header-row-height));
}

.app-footer {
    box-sizing: border-box !important;
    min-height: var(--lte-bar-height) !important;
    height: var(--lte-bar-height) !important;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
}

.sidebar-brand {
    justify-content: left !important;
    padding-left: 1.4rem;
    padding-right: 0;
}

.sidebar-brand .brand-link {
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    color: #ffffffb3;
}

.sidebar-brand .brand-link .nav-icon {
    flex-shrink: 0;
    min-width: 1.5rem;
    max-width: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-brand .brand-link .brand-text {
    display: flex;
    align-items: center;
}
.sidebar-brand .brand-link .brand-text h3 {
    margin: 0;
    line-height: 1;
}

.table-header-border > thead > tr > th {
    border-bottom: 1px solid var(--bs-table-border-color);
}

.table-striped-from-second > tbody > tr:nth-of-type(odd) > * {
    background-color: #ffffff;
}

.table-striped-from-second > tbody > tr:nth-of-type(even) > * {
    background-color: #0000000a;
}

.table-striped-from-second > tbody > tr:hover > * {
    background-color: #00000013 !important;
}

[data-bs-theme="dark"] .table-striped-from-second > tbody > tr:nth-of-type(odd) > * {
    background-color: var(--bs-body-bg);
}

[data-bs-theme="dark"] .table-striped-from-second > tbody > tr:nth-of-type(even) > * {
    background-color: #ffffff0d;
}

[data-bs-theme="dark"] .table-striped-from-second > tbody > tr:hover > * {
    background-color: #ffffff1a !important;
}

.align-middle {
    vertical-align: middle !important;
}

.table-id-center th:first-child,
.table-id-center td:first-child {
    text-align: center;
}

.hr-text {
    line-height: 1em;
    position: relative;
    outline: 0;
    border: 0;
    color: var(--bs-body-color);
    text-align: left;
    height: 1.5em;
    font-size: 1rem;
    opacity: 1;
}

.hr-text::before {
    content: "";
    background: linear-gradient(to left, transparent, var(--bs-border-color));
    position: absolute;
    left: 0;
    top: 50%;
    width: 100%;
    height: 1px;
    opacity: 0.85;
}

.hr-text::after {
    content: attr(data-content);
    position: relative;
    display: inline-block;
    padding-left: 0;
    padding-right: 0.5em;
    line-height: 1.5em;
    color: #212529 !important;
    font-weight: bold;
    font-size: 11pt;
    background-color: var(--bs-body-bg);
    opacity: 1 !important;
}

[data-bs-theme="dark"] .hr-text::after {
    color: var(--bs-body-color) !important;
}

.image-preview-container {
    border: 1px solid var(--bs-border-color);
    border-radius: var(--bs-border-radius);
    padding: 0.5rem;
    background: var(--bs-body-bg);
    display: inline-block;
}

.image-preview-img {
    max-width: 100%;
    max-height: 280px;
    display: block;
    border-radius: var(--bs-border-radius);
}

/* Цвет в текстовом виде рядом с Pickr на форме шаблона */
.pickr-color-display {
    max-width: 10em;
}

/* Предпросмотр шаблона: разметка в {% block modals %} у body — 20px сверху и снизу */
#previewModal.modal {
    padding-top: 20px;
    padding-bottom: 20px;
}

#previewModal.modal .modal-dialog.modal-dialog-centered {
    margin-top: 0;
    margin-bottom: 0;
    margin-left: auto;
    margin-right: auto;
    /* Bootstrap: min-height: calc(100% - 2*--bs-modal-margin) — лишняя высота уезжает вниз, снизу кажется больший зазор */
    min-height: 0;
    height: 100%;
    max-height: none;
    /* Bootstrap .modal-dialog-centered использует align-items: center — из-за этого modal-content ниже диалога */
    align-items: stretch;
}

#previewModal.modal .modal-content {
    display: flex;
    flex-direction: column;
    min-height: 0;
    max-height: 100%;
    overflow: hidden;
}

#previewModal.modal .modal-body {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow-y: auto;
}

#previewModal.modal #previewFrame {
    flex: 1 1 auto;
    min-height: 0;
    width: 100%;
    border: 0;
}

/* --- Цвета из палитры AdminLTE 3 для AdminLTE 4 --- */

/* Indigo (Индиго) */
.bg-indigo { background-color: #6610f2 !important; color: #fff !important; }
.text-indigo { color: #6610f2 !important; }

/* Lightblue (Голубой) */
.bg-lightblue { background-color: #3c8dbc !important; color: #fff !important; }
.text-lightblue { color: #3c8dbc !important; }

/* Navy (Темно-синий) */
.bg-navy { background-color: #001f3f !important; color: #fff !important; }
.text-navy { color: #001f3f !important; }

/* Purple (Пурпурный) */
.bg-purple { background-color: #605ca8 !important; color: #fff !important; }
.text-purple { color: #605ca8 !important; }

/* Fuchsia (Фуксия) */
.bg-fuchsia { background-color: #f012be !important; color: #fff !important; }
.text-fuchsia { color: #f012be !important; }

/* Pink (Розовый) */
.bg-pink { background-color: #e83e8c !important; color: #fff !important; }
.text-pink { color: #e83e8c !important; }

/* Maroon (Бордовый) */
.bg-maroon { background-color: #d81b60 !important; color: #fff !important; }
.text-maroon { color: #d81b60 !important; }

/* Orange (Оранжевый) */
.bg-orange { background-color: #ff851b !important; color: #1f2d3d !important; }
.text-orange { color: #ff851b !important; }

/* Lime (Лайм) */
.bg-lime { background-color: #01ff70 !important; color: #1f2d3d !important; }
.text-lime { color: #01ff70 !important; }

/* Teal (Бирюзовый) */
.bg-teal { background-color: #39cccc !important; color: #fff !important; }
.text-teal { color: #39cccc !important; }

/* Olive (Оливковый) */
.bg-olive { background-color: #3d9970 !important; color: #fff !important; }
.text-olive { color: #3d9970 !important; }

/* Gray-dark (Темно-серый) */
.bg-gray-dark { background-color: #343a40 !important; color: #fff !important; }
.text-gray-dark { color: #343a40 !important; }

/* Gray (Серый) */
.bg-gray { background-color: #adb5bd !important; color: #1f2d3d !important; }
.text-gray { color: #adb5bd !important; }

.login-field {
    display: flex;
    align-items: stretch;
    border: var(--bs-border-width) solid var(--bs-border-color);
    border-radius: var(--bs-border-radius);
    overflow: hidden;
    background-color: var(--bs-body-bg);
}

.login-field:focus-within {
    border-color: var(--bs-primary);
    box-shadow: 0 0 0 0.25rem rgba(var(--bs-primary-rgb), 0.25);
}

.login-field > .form-control {
    border: 0;
    border-radius: 0;
    box-shadow: none;
    flex: 1 1 auto;
    min-width: 0;
}

.login-field > .form-control:focus {
    box-shadow: none;
    z-index: 1;
}

.login-field-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    padding-left: 0.75rem;
    padding-right: 0.75rem;
    color: var(--bs-secondary-color);
    background-color: var(--bs-tertiary-bg);
    border-left: var(--bs-border-width) solid var(--bs-border-color);
}

.login-field:has(.form-control.is-invalid) {
    border-color: var(--bs-danger);
}

.login-field:has(.form-control.is-invalid):focus-within {
    border-color: var(--bs-danger);
    box-shadow: 0 0 0 0.25rem rgba(var(--bs-danger-rgb), 0.25);
}

.login-field-msg {
    line-height: 1.25;
}
