:root {
    --message-color: #CCD5AE;
    --alert-color: #D4A373;
    --secondary-color: #688349;
    --sec1: #738349;
    --sec2: #788349;
    --sec3: #838349;
    --background-color: #FAFFF4;
    --button-color: #E9EDC9;
    --button-hover-color: #FAEDCD;
    --text-color: #17150C;
    --links-color: #025767;
    --input-color: #DDD;
    --block-color: #9fd264;
}


/* Подключение шрифтов Nunito и Amatic*/
/* @import url('https://fonts.googleapis.com/css2?family=Nunito:wght@200;400;600;800&display=swap'); */
@import url('https://fonts.googleapis.com/css2?family=Amatic+SC:wght@400;700&family=Nunito:ital,wght@0,200..1000;1,200..1000&display=swap');

/* Общие стили */
body,
a,
button {
    font-family: "Nunito", sans-serif;
}

html,
body {
    margin: 0;
    padding: 0;
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
}

/* Заголовки */
h1,
h2,
h3 {
    margin: 0 0 10px;
}

h1 {
    font-size: 24px;
    margin: 0 0 10px;
    display: block;
    padding: 18px 20px 20px;
    background: var(--message-color);
}

h2,
h3 {
    font-size: 18px;
}

/* Ссылки */
a {
    color: var(--links-color);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
    text-decoration-thickness: .5px;
    text-underline-offset: 2px;
}

/* Фиксированный хедер */
.main-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 30px;
    background-color: var(--secondary-color);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Основной контент с отступами, чтобы не перекрывался */
.main-content {
    padding-top: 80px;
    /* отступ на высоту хедера */
    padding-bottom: 50px;
    /* отступ на высоту футера */
}

/* Фиксированный футер */
.main-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 45px;
    background-color: var(--secondary-color);
    z-index: 1000;
}

/* Навигация */
header {
    background-color: var(--secondary-color);
    padding: 14px 0px;
}

header nav {
    display: flex;
    justify-content: flex-start;
    /* фикс опечатки */
    align-items: center;
}

header nav ul {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
}

header nav ul li {
    margin: 0 8px;
}

header nav ul li a {
    color: var(--background-color);
    padding: 16px 12px;
    transition: background-color 0.2s;
}

header nav ul li a:hover {
    background-color: var(--alert-color);
}

/* Кнопки */
button,
.button {
    background-color: var(--button-color);
    border: 1px solid var(--secondary-color);
    border-radius: 3px;
    padding: 6px 10px;
    font-size: 14px;
    text-align: center;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
}

button:hover,
.button:hover {
    background-color: var(--button-hover-color);
}

.form-button {
    margin: 35px 0 5px 20px;
}

/* Контейнеры */
.notification-container {
    margin: 20px auto;
    padding: 16px 23px;
    background-color: var(--message-color);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    text-align: left;
}

.auth-container {
    margin: 20px auto;
    position: relative;
    box-shadow: 0 7px 8px rgba(0, 0, 0, 0.15);
}

.notification-container a {
    margin-top: 10px;
    display: inline-block;
}

/* Основной контент */
main {
    padding: 20px;
    max-width: 100%;
    margin: 0 auto;
    height: 100%;
}

/* Формы */
form {
    padding: 20px 20px 20px 0;
    margin-bottom: 20px;
}

.play-column {
    width: 40px;
}

.last-column form {
    padding: 4px;
    margin-bottom: 0px;
}

form .form-group {
    margin: 20px;
}

form .form-group label {
    display: block;
    font-weight: bold;
}

form .form-group input {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--message-color);
    border-radius: 2px;
    font-size: 14px;
}

form .form-group input:focus {
    border: 1px solid var(--secondary-color);
    outline: none;
    box-shadow: 0 0 5px rgba(139, 201, 64, 0.5);
}

/* Контейнер страницы справочников */
.dict-wrap {
    max-width: 780px;
    margin: 0 auto;
}

.dict-title {
    margin: 0 0 12px;
}

/* Панель управления */
.dict-toolbar {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

.dict-toolbar__label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.dict-toolbar__label-text {
    font-size: 0.9rem;
    color: #666;
}

.dict-select {
    min-width: 220px;
}

.dict-search {
    flex: 1;
    min-width: 220px;
}

/* Кнопки (минимальный базовый стиль) */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 6px;
    cursor: pointer;
    text-decoration: none;
}

.btn-primary {
    background: #0b6;
    color: #fff;
    border: 1px solid #0a5;
}

.btn-ghost {
    background: transparent;
    color: #0a5260;
    border: 1px solid #cfd8d3;
}

.dict-edit-btn {
    margin-left: auto;
}

/* Таблица: разделители колонок, фиксация ширины, зебра и hover */
.dict-table-wrap {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: separate;
    /* чтобы работали вертикальные разделители */
    border-spacing: 0;
    /* table-layout: fixed; */
    /* инпуты и длинные строки не расталкивают таблицу */
}

.th,
.td {
    padding: 10px 12px;
    border-bottom: 1px solid #e8eddc;
    border-right: 1px solid #e8eddc;
    /* вертикальный разделитель между колонками */
    text-align: left;
    vertical-align: top;
}

.data-table thead .th {
    background: #f6f8ef;
}

.data-table tr>.th:last-child,
.data-table tr>.td:last-child {
    border-right: 0;
}

/* у последней колонки границу убираем */

.data-table--zebra tbody tr:nth-child(odd) {
    background: #f8fbf0;
}

.data-table--zebra tbody tr:nth-child(even) {
    background: #f2f7e6;
}

.data-table tbody tr:hover {
    background: #eef5e2;
}

.td--empty {
    color: #888;
    text-align: center;
}

/* Сортировка */
.th--sortable .th-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: inherit;
    text-decoration: none;
}

.th-caret {
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    opacity: .6;
}

.th-caret--asc {
    border-bottom: 7px solid currentColor;
}

.th-caret--desc {
    border-top: 7px solid currentColor;
}

.filters-bar label {
    padding-right: 20px;
    ;
}

/* Фильтры: не «липнут», не вылезают */
.filters-row .th {
    padding: 8px 10px;
    background: #f9fbf5;
    border-bottom: 1px solid #dde6cc;
}

.filter-input {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    /* критично: чтобы padding не раздувал ширину */
    padding: 6px 8px;
    border: 1px solid #dfe6d7;
    border-radius: 6px;
}

.filter-input:focus {
    outline: none;
    border-color: #8eb48a;
    box-shadow: 0 0 0 3px rgba(142, 180, 138, .18);
}

/* Длинные значения внутри ячеек не ломают макет */
.td span,
.td code {
    display: inline-block;
    max-width: 100%;
    /* overflow-wrap: anywhere;
    word-break: break-word; */
}

/* Просроченные сертификаты */
.row-expired {
    background: #ffeaea !important;
}

.row-expired>.td:first-child {
    border-left: 6px solid #c20000;
}

/* Свотч цвета через CSS-переменную */
.color-swatch {
    display: inline-block;
    width: 28px;
    height: 28px;
    border: 1px solid #ccc;
    border-radius: 2px;
    background-color: var(--color, transparent);
    vertical-align: middle;
    margin-right: 6px;
}

/* Пагинация: слева, компактно, стрелки нормального размера */
.pager {
    margin-top: 12px;
    display: flex;
    justify-content: flex-start;
}

.pager nav svg {
    width: 16px;
    height: 16px;
}

/* Bootstrap-верстка пагинации (если подключится) — компактнее */
.pager .pagination {
    display: flex;
    gap: 6px;
    margin: 0;
}

.pager .pagination .page-link {
    padding: 4px 8px;
    border-radius: 6px;
    border: 1px solid #dfe6d7;
}

.pager .pagination .page-item.active .page-link {
    background: #e7efe0;
    border-color: #c7d1c3;
    font-weight: 600;
}

/* --- Действия в справочниках (иконки) --- */
.th--actions {
    width: 90px;
    text-align: right;
}

.td--actions {
    text-align: right;
    white-space: nowrap;
}

.icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: 1px solid #cfd8d3;
    border-radius: 6px;
    background: #fff;
    color: #243;
    font-weight: 700;
    line-height: 1;
    text-decoration: none;
    cursor: pointer;
    vertical-align: middle;
    margin-left: 6px;
}

.icon-btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(142, 180, 138, .18);
}

.icon-btn:hover {
    background: #f4f8ef;
}

/* вариации (если понадобится чуть отличать) */
.icon-btn--add {
    border-color: #8abf7d;
}

.icon-btn--edit {
    border-color: #8aa9bf;
}

.icon-btn--del {
    border-color: #bf8a8a;
}

.inline-form {
    display: inline;
    margin: 0;
}

/* чуть упрямим высоту фильтр-строки под иконки */
.filters-row .th:last-child {
    text-align: right;
}


/* говностили от чатика */
/* ===== Модальное окно ===== */
.modal {
    position: fixed;
    inset: 0;
    display: none;
    z-index: 1000;
}

.modal.open {
    display: block;
}

/* на случай, если показ идёт через inline style */
.modal[style*="display: block"] {
    display: block;
}

.modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(1px);
}

.modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    /*  width: min(1000px, 92vw); */
    max-height: 80vh;
    overflow: auto;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
    padding: 24px;
}

.modal-content h2 {
    margin: 0 0 12px 0;
    font-size: 18px;
    line-height: 1.3;
}

.modal-content .close {
    position: absolute;
    top: 10px;
    right: 12px;
    border: none;
    background: transparent;
    font-size: 22px;
    color: #666;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
}

.modal-content .close:hover {
    color: #111;
}

/* ===== Кнопка “Обработать” (иконка) ===== */
.button-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    border-radius: 6px;
    border: 1px solid #b8d190;
    background: #f0f7e8;
    cursor: pointer;
    font-weight: 700;
}

.button-icon:hover {
    background: #e7f2df;
}

.button-icon:active {
    transform: translateY(1px);
}



/* шапка действий (если есть) */
.orders-actions {
    margin: 12px auto 18px;
    display: flex;
    align-items: end;
    gap: 12px;
    width: fit-content;
}

/* ===== Адаптив для узких экранов ===== */
@media (max-width: 640px) {
    .modal-content {
        width: 95vw;
        max-height: 85vh;
        padding: 16px;
    }

    .data-table th,
    .data-table td {
        padding: 6px 8px;
    }
}

/* === Сам "селект" (закрытое состояние) === */
.select2-container .select2-selection--single {
    height: 32px;
    /* высота поля */
    line-height: 32px;
    /* вертикальное выравнивание текста */
    font-size: 14px;
    /* размер шрифта */
    padding: 0 8px;
    /* внутренние отступы */
    border: 1px solid #ccc;
    /* рамка */
    border-radius: 4px;
    background-color: #fff;
}

/* стрелочка справа */
.select2-container .select2-selection__arrow {
    height: 32px;
}

/* === Выпадающий список === */
.select2-dropdown {
    font-size: 14px;
    min-width: 200px;
    max-width: 300px;
    border: 1px solid #ccc;
    border-radius: 4px;
}

.select2-results__options {
    max-height: 500px !important;
    /* ключевой момент */
    overflow-y: auto !important;
}

/* отдельные элементы */
.select2-results__option {
    padding: 4px 8px;
    line-height: 1.4;
}

/* подсветка при наведении */
.select2-results__option--highlighted {
    background-color: #eee;
    color: #000;
}

.barcode input {
    height: 32px;
    line-height: 32px;
    font-size: 14px;
    padding: 0 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
}


.container {
    max-width: 100%;
    padding: 5px;
    font-family: Arial, sans-serif;
    font-weight: normal;
}

.orders-header {
    position: sticky;
    top: 0;
    z-index: 10;
    margin-bottom: 8px;
    border: 1px solid #999;
}

.header-row {
    display: grid;
    font-size: 12px;
}

.order-block {
    border: 1px solid #ccc;
    margin-bottom: 8px;
    font-size: 14px;
}


.order-header-top {
    background: #e6e6e6;
    grid-template-columns: 3% 8% 9% 5% 5% 6% 6% 6% 7% 11% 12% 15% 7%;
    text-align: center;
    line-height: 2.2;
}

.order-header-bottom {

    grid-template-columns: 6% 6% 6% 6% 6% 6% 6% 6% 43% 9%;
    text-align: center;

}

.order-header-bottom div {
    background: #ddffeb;
    border-right: 1px solid #d87;
    line-height: 1.6;
}

.order-row-top {
    display: grid;
    background: #cfe0eb;

    text-align: center;
    grid-template-columns: 3% 8% 9% 5% 5% 6% 6% 6% 7% 11% 12% 15% 7%;
}

.order-row-top div {
    padding: 4px;
    border-right: 1px solid #9abacb;
}


.order-row-bottom {
    display: grid;

    font-size: 16px;
    text-align: center;
    grid-template-columns: 6% 6% 6% 6% 6% 6% 6% 6% 43% 9%;

}

.order-row-bottom div {
    padding: 4px;
    border-right: 1px solid #d87;
    background: #fed;
}

.order-row-bottom div input {
    width: 70px;
}

.top-filters {
    background: #e9ece0;
    padding: 6px 9px;
    width: 100%;
}

.second-raw-filters {
    background: #dfe4d3;
    padding: 6px 9px;
    width: 100%;
}

.third-raw-filters {
    background: #cfd5c3;
    padding: 6px 9px;
    width: 100%;
}

/* Таблицы заказов */
.orders_data_table {
    width: auto;
    margin: 0 auto;
}

.orders_data_table th,
.orders_data_table td {
    text-align: center;
    white-space: nowrap;
    padding: 6px 10px;
}

.orders_data_table td:first-child,
.orders_data_table th:first-child {
    text-align: left;
}

.orders_data_table td:nth-child(4),
.orders_data_table th:nth-child(4) {
    text-align: left;
}

.dyna-table td {
    padding: 0 15px 0 0;
}

.dynamic-value {
    text-align: right;
    padding-right: 35px !important;
}

.dynamic-month {
    font-size: 10px;
    color: #0a5260;
}

.muted {
    background: #ccd5ae !important;
    color: #8a8a8a;
}

.filters-block {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.filters-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 16px;
}

.filters-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 4px;
}

.filters-row .dict-toolbar__label input,
.filters-row .dict-toolbar__label .filter-input {
    width: 140px;
    /* подбери по вкусу: 130–180 */
}

.filters-row .dict-toolbar__label input[type="date"] {
    width: 140px;
    padding: 6px 8px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 14px;
    background-color: #fff;
}

.stock_data_table {
    margin: auto;
    width: 100%;

}

.dyn-filters {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.dyn-row {
    display: flex;
    gap: 40px;
    align-items: flex-start;
}

.dyn-col {
    flex: 1 1 50%;
}

.dyn-full-orders-row {
    display: flex;
    gap: 10px;
    align-items: center;
}

.dyn-actions {
    margin-top: 16px;
}

.dyn-limited-orders {
    max-height: 220px;
    overflow-y: auto;
    border: 1px solid #ccc;
    padding: 5px;
}

.dyn-hidden {
    display: none;
}

.dyn-layout {
    display: flex;
    flex-wrap: wrap;
    column-gap: 32px;
    row-gap: 24px;
    align-items: flex-start;
}

.dyn-col {
    display: flex;
    flex-direction: column;
}

.dyn-col-left {
    max-width: 240px;
}

.dyn-col-right {
    flex: 1;
}

.dyn-full-orders-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
}

.dyn-actions {
    margin: 25px 0;
}

.dyn-limited-orders {
    max-height: 620px;
    overflow-y: auto;
    border: 1px solid #ccc;
    padding: 2px 10px;
    max-width: 580px;
    border-radius: 3px;
}

.dyn-hidden {
    display: none;
}

/* Динамика: селект заказов */
#full-orders {
    min-width: 360px;
}

/* Дропдаун Select2 — ширина по самой длинной строке */
.select2-container .select2-dropdown {
    width: auto !important;
    /* под содержимое */
    min-width: 360px;
    /* не уже, чем селект */
}

#filter-date {
    width: 174px;
    height: 25px;
    padding: 3px 8px;
    border: 1px solid #ccc;
    border-radius: 3px;
    font-size: 14px;
    background-color: #fff;
}

/* Опции: всегда в одну строку, без переноса, без троеточий */
.select2-results__option {
    white-space: nowrap;
}

/* Отрисованное выбранное значение — тоже в одну строку */
.select2-container--default .select2-selection--single .select2-selection__rendered {
    white-space: nowrap;
}

.dyn-filter-select {
    line-height: 115%;
    padding-bottom: 19px;
}

#filter-order-num {
    border-radius: 3px;
    height: 25px;
    padding: 3px 8px;
    border: 1px solid #ccc;
    font-size: 14px;
    background-color: #fff;
}

#btn-show {
    margin-right: 50px;
}

.hint {
    display: inline-block;
    width: 14px;
    height: 14px;
    line-height: 14px;
    text-align: center;
    font-size: 10px;
    border-radius: 50%;
    cursor: default;
    margin-left: 6px;
    position: relative;
    border: 1px gray solid;
    top: -23px;
}

.hint-popup {
    display: none;
    position: absolute;
    top: 22px;
    left: 0;
    background: #fff;
    border: 1px solid #ccc;
    padding: 18px 20px;
    font-size: 13px;
    width: 620px;
    color: #333;
    z-index: 20;
    border-radius: 4px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    text-align: left;
    line-height: 200%;

    bgi {
        background: #9fa;
        border: 1px solid rgb(219, 219, 219);
        padding: 1px 7px;
        margin: 0 2px 0 12px;
    }
}

.hint:hover .hint-popup,
.hint:focus-within .hint-popup {
    display: block;
}