/* File: css/style.css */

/* ===========================================
   Общие настройки
   =========================================== */
body {
    margin: 0;
    font-family: Arial, sans-serif;
    background-color: #f7f6f2;
    color: #333;
}

/* ===========================================
   Верхняя панель (header)
   =========================================== */
.header {
    display: flex;
    justify-content: flex-end;
    padding-top: 1rem;
    padding-bottom: 1rem;
    padding-right: 1rem;
    background-color: #cccccc; /* Отличается от панели вкладок */
}

/* Контейнер для сообщений */
#messageArea {
    flex: 1;                  /* Занимает всё свободное пространство слева от кнопок */
    display: flex;
    flex-direction: column;
    padding-left: 1rem;       /* Отступ слева как у контента таблицы */
    padding-right: 1rem;
    box-sizing: border-box;
    width: 100%;
    background-color: transparent;
}

/* ===========================================
   Кнопки в header («Войти» и «Выйти»)
   =========================================== */
/* Высота = 2rem (половина от панели лога 4rem) */
.header button {
    height: 2rem;
    line-height: 2rem;
    padding: 0 0.5rem;
    background-color: #c8d6e5;
    border: none;
    border-radius: 0.25rem;
    cursor: pointer;
    font-size: 0.8rem;
    transition: background-color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 0.5rem;
}

.header button:hover {
    background-color: #d4ddee;
}

#logoutBtn {
    width: 30px;
    padding: 0; /* высота уже задана, горизонтальный padding не нужен */
}

#logoutBtn svg {
    width: 1rem;
    height: 1rem;
}

/* ===========================================
   UIManager: Плашки успеха и ошибки
   =========================================== */
.ui-success {
    background-color: #d4edda;
    color: #155724;
    font-size: 12pt;
    border: 1px solid #c3e6cb;
    border-radius: 4px;
    padding: 0.5rem 1rem;
    margin-bottom: 0.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    box-sizing: border-box;
}

.ui-error {
    background-color: #f8d7da;
    color: #721c24;
    font-size: 12pt;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
    padding: 0.5rem 1rem;
    margin-bottom: 0.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    box-sizing: border-box;
}

.ui-success .close-btn,
.ui-error .close-btn {
    background: transparent;
    border: none;
    font-size: 12pt;
    cursor: pointer;
    color: inherit;
    padding: 0;
}

/* ===========================================
   UIManager: Панель логов
   =========================================== */
.ui-log {
    background-color: #f1f1f1;
    color: #333;
    font-size: 7pt;         /* 7pt */
    border: 1px solid #ccc;
    border-radius: 4px;
    padding: 0.2rem;        /* 0.2rem */
    overflow-y: auto;
    max-height: 4rem;       /* 4rem */
    width: 100%;
    box-sizing: border-box;
    display: none;          /* отображается, когда есть сообщения в логе */
}

.ui-log .log-entry {
    margin-bottom: 0.25rem;
}

.ui-log .log-entry.success {
    color: #155724;
    font-weight: bold;
}

.ui-log .log-entry.error {
    color: #721c24;
    font-weight: bold;
}

.ui-log .log-entry.info {
    color: #555;
}

/* ===========================================
   UIManager: Overlay для загрузки
   =========================================== */
#ui-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(173, 216, 230, 0.4); /* пастельно-голубой, полупрозрачный */
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.ui-loading-content {
    background: #e0f7ff;
    padding: 1rem 1.5rem;
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.ui-loading-text {
    font-size: 12pt;
    color: #004d66;
}

.ui-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid #004d66;
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ===========================================
   Tabs (Вкладки)
   =========================================== */

/* Контейнер вкладок: общая граница снизу */
.tabs-container {
    display: flex;
    border-bottom: 1px solid #aaa;
    background-color: #e2e0dc; /* Цвет неактивных областей около вкладок */
}

/* Отдельная вкладка */
.tab {
    position: relative;
    padding: 0.75rem 1rem;
    cursor: pointer;
    user-select: none;
    border: 1px solid #aaa;
    border-bottom: none;              /* Чтобы сливалось с контентом */
    border-top-left-radius: 6px;
    border-top-right-radius: 6px;
    background-color: #e2e0dc;       /* Цвет неактивной вкладки */
    transition: background-color 0.2s;
    margin-right: -1px;               /* Сдвиг для «стыковки» границ */
    z-index: 1;                       /* Поверх соседних */
}

.tab:last-child {
    margin-right: 0;
}

.tab.active {
    background-color: #ffffff;       /* Цвет активной вкладки */
    z-index: 2;                       /* Поверх остальных */
}

.tab:not(.active):hover {
    background-color: #ecebe8;        /* Чуть светлее при наведении */
}

/* ===========================================
   Содержимое вкладок
   =========================================== */
.tab-content {
    padding: 1rem;
    display: none;
    border: 1px solid #aaa;
    border-top: none;
    border-bottom-left-radius: 6px;
    border-bottom-right-radius: 6px;
    background-color: #fff;
}

.tab-content.active {
    display: block;
}

/* ===========================================
   Общие стили кнопок
   =========================================== */
button {
    margin-left: 0.5rem;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 0.25rem;
    background-color: #c8d6e5;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background-color 0.2s;
}

button:hover {
    background-color: #d4ddee;
}

/* ===========================================
   Таблицы
   =========================================== */
table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 8px;
}

table th,
table td {
    border: 1px solid #ccc;
    padding: 4px 8px;
    text-align: left;
    font-size: 0.9rem;
}

table thead {
    background-color: #e2e0dc;
}

/* ===========================================
   Форма входа (loginModal)
   =========================================== */
#loginModal .content {
    position: relative;
    background: #fff;
    padding: 2rem 1.5rem 1rem 1.5rem;
    border-radius: 0.5rem;
    width: 400px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

#loginModal .content h3 {
    margin: 0;
    font-size: 1.4rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #ddd;
}

#loginModal .content input {
    display: block;
    width: 100%;
    height: 28px;
    margin-top: 1rem;
    padding: 4px 8px;
    font-size: 1rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
}

#loginModal .content .actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 1.5rem;
}

#loginModal .content .actions button {
    padding: 0.5rem 1rem;
    font-size: 1rem;
}

#loginModal .content .close-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    background: transparent;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: #888;
}

#loginModal .content .close-btn:hover {
    color: #000;
}

/* ===========================================
   Модальные окна (общие)
   =========================================== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.modal.hidden {
    display: none;
}

.modal .content {
    background: #fff;
    padding: 1.5rem;
    border-radius: 0.5rem;
    width: 400px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    position: relative;
}

.modal .content h3 {
    margin-top: 4px;
    margin-bottom: 4px;
    font-size: 1.2rem;
}

/* Кнопка закрытия формы (крестик) */
.modal .content .close-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    background: transparent;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: #888;
}

.modal .content .close-btn:hover {
    color: #000;
}

/* Кнопки в модалках */
.modal .content .actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 8px;
}

.modal .content .actions button {
    padding: 0.4rem 0.8rem;
    font-size: 0.9rem;
}

/* ===========================================
   Форма «Операции» (поле «Тип + Количество»)
   =========================================== */
.op-list {
    max-height: 200px;   /* вертикальный скролл, если длинно */
    overflow-y: auto;
    margin-bottom: 8px;
    border: 1px solid #ddd;
    padding: 4px;
    border-radius: 4px;
}

.op-item {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.op-item .type {
    flex: 1;
    height: 20px;
    font-size: 0.85rem;
    border: 1px solid #ccc;
    border-radius: 2px;
    padding-left: 4px;
    transition: border-color 0.2s, background-color 0.2s;
}

.op-item .qty {
    width: 80px;
    height: 20px;
    font-size: 0.85rem;
    border: 1px solid #ccc;
    border-radius: 2px;
    padding: 0 4px;
    transition: border-color 0.2s, background-color 0.2s;
}

.op-item .type:hover,
.op-item .qty:hover {
    border-color: #999;
    background-color: #fafafa;
}

/* Кнопка «Добавить новый товар» выровнена по левому краю */
#operationModal .content #addItem {
    display: block;
    margin: 8px 0 0 0;
}

/* ===========================================
   Стили для таблицы операций
   =========================================== */
#opsTable tbody tr {
    cursor: pointer;
    transition: background-color 0.2s;
}

#opsTable tbody tr:hover {
    background-color: #f0f0f0; /* чуть светлее при наведении */
}

#opsTable tbody tr.selected {
    background-color: #d0d0d0; /* более тёмный при выборе */
}

.table-buttons {
    margin-top: 8px;
}

.table-buttons button {
    margin-right: 8px;
}

/* ===========================================
   Стили для «Управление ассортиментом»
   =========================================== */
.assortment-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 8px;
}

.assortment-actions .download-link {
    text-decoration: none;
    padding: 0.5rem 1rem;
    border: 1px solid #ccc;
    border-radius: 0.25rem;
    background-color: #c8d6e5;
    font-size: 0.9rem;
    transition: background-color 0.2s;
}

.assortment-actions .download-link:hover {
    background-color: #d4ddee;
}


/* ===========================================
   Новые стили для панели синхронизации дат
   =========================================== */
.sync-panel {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    border: 1px solid #ccc;
    border-radius: 6px;
    margin-top: 8px;
    margin-bottom: 8px;
}

.sync-checkbox {
    margin-right: 0.5rem;
}

.sync-date {
    width: 100px;
    height: 2rem;
    padding: 4px 8px;
    border: 1px solid #ccc;
    border-radius: 0.25rem;
    background-color: #fff;
    box-sizing: border-box;
}

.date-buttons {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.sync-btn {
    height: 2rem;
    line-height: 2rem;
    padding: 0 0.75rem;
    border: none;
    border-radius: 0.25rem;
    background-color: #c8d6e5;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background-color 0.2s;
}

/* Кнопка Обновить   */
/* Обновлённые стили для кнопки «Обновить» */
#refreshBtn {
    float: left;
    margin: 8px 8px 0 0;   /* сверху 8px, справа 8px, снизу 0, слева 0 */
    height: 3rem;
    line-height: 3rem;
    background-color: #69a2ec;
    border: 2px solid #00008B;
    color: #fff;
    padding: 0 1rem;
}

#refreshBtn:hover {
    filter: brightness(1.15);
}

.sync-btn:hover {
    background-color: #d4ddee;
}


.outline-btn {
    border: 1px solid #ccc;
    background-color: transparent;
}

.sync-spacer {
    flex: 1 1 auto;
    margin: 0 1rem;
}

.stocks-table {
    width: 100%;
    border-collapse: collapse;
}

.stocks-table th,
.stocks-table td {
    border: 1px solid #ccc;
    padding: 4px 8px;
    text-align: left;
    font-size: 0.9rem;
}

.stocks-table thead {
    background-color: #e2e0dc;
}

.filter-input {
    width: 100%;
    height: 1.5rem;
    padding: 2px 4px;
    font-size: 0.9rem;
    border: 1px solid #ccc;
    border-radius: 0.25rem;
    box-sizing: border-box;
}

/* обёртка для второй группы даты, чтобы она целиком переносилась */
.date-group2 {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.sync-spacer {
    flex: 0 0 auto;
}

.tab-content {
    background-color: #f3f2f0;
}

/* Панель синхронизации — светло-серый фон */
.sync-panel {
    background-color: #f0f0f0;
}

/* Белый фон только для ячеек таблицы и полей фильтра */
.stocks-table th,
.stocks-table td,
.filter-input {
    background-color: #ffffff;
}

/* Заголовок таблицы — фон и рамка как на скриншоте */
.stocks-table thead tr:first-child th {
    background-color: #d7d3ce;
    color: #333;
    font-weight: 600;
    border-bottom: 2px solid #aaa;
    padding: 0.5rem 0.75rem;
}

/* Фон ячеек с фильтрами — как у заголовка */
.stocks-table thead tr:nth-child(2) th {
    background-color: #d7d3ce;
    padding: 0.5rem 0.75rem;
}

/* Поля ввода фильтров — белые */
.stocks-table thead tr:nth-child(2) th .filter-input {
    background-color: #ffffff;
    border: 1px solid #ccc;
    box-sizing: border-box;
}

/* Бейдж на вкладке */
.ui-tab-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 6px;
    margin-left: 8px;
    border-radius: 999px;
    background: #e53935; /* красный */
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    line-height: 18px;
}

/* Бейдж внутри кнопок */
.ui-btn-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 16px;
    height: 16px;
    padding: 0 5px;
    margin-left: 8px;
    border-radius: 999px;
    background: #e53935;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    line-height: 16px;
    vertical-align: middle;
}

.min-dates {
    margin: 8px 0 12px;
    font-size: 14px;
    color: #333;
}

/* строка с минимальными датами */
.min-dates .warn {
    color: #e53935;        /* красный текст */
    font-weight: 600;
}
.min-dates .min-warn-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    margin-left: 6px;
    border-radius: 50%;
    background: #e53935;
    color: #fff;
    font-size: 11px;
    font-weight: 800;
    line-height: 16px;
    cursor: default;
}

.sync-row {
    display: flex;
    align-items: stretch;      /* чтобы кнопка по высоте как панель */
    gap: 10px;
    width: 100%;
    margin-top: 8px;
}
.sync-row .sync-panel { flex: 1; } /* панель растягивается, кнопка справа */
.reload-balance-btn { white-space: nowrap; }

.sync-row {
    display: flex;
    align-items: stretch;     /* дети тянутся по высоте строки */
    gap: 10px;
    width: 100%;
    margin-top: 8px;
}

.sync-row .sync-panel {
    flex: 1;                  /* панель занимает середину */
    display: flex;
    align-items: center;      /* вертикальная центровка содержимого панели */
    box-sizing: border-box;
}

.sync-row .sync-btn {       /* обе кнопки той же высоты, что строка */
    display: flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    margin: 0;
    box-sizing: border-box;
}

/* выровнять все элементы по середине строки */
.filters-row > *{ vertical-align: middle; }

/* подровнять кнопку по высоте, если у инпутов фиксированная высота */
.btn-balance{
    display:inline-flex;
    align-items:center;
    height:36px;
    line-height:36px;
    margin-top:0;
}

/* ============================
   FIX: выравнивание строки синхронизации и кнопки "Обновить баланс"
   ============================ */

/* делаем всю строку единой по вертикали */
.sync-row{
    align-items: center !important;   /* было stretch */
}

/* панель дат по центру, растягивается */
.sync-row .sync-panel{
    flex: 1 1 auto;
    display: flex;
    align-items: center;
}

/* сама кнопка "Обновить баланс" справа и по центру по вертикали */
.reload-balance-btn,
.btn-balance,
#refreshBalanceBtn{
    margin-left: auto;                /* увод вправо */
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 2rem;                     /* как у инпутов */
    line-height: 2rem;
    padding: 0 0.75rem;
    white-space: nowrap;
    float: none;                      /* на всякий случай */
    margin-top: 0 !important;         /* убираем возможные сдвиги */
}

/* кнопки "-1d/-3d/-7d" и прочие внутри панели тоже одинаковой высоты */
.sync-row .sync-btn,
.sync-panel input,
.sync-panel .sync-date{
    height: 2rem;
    line-height: 2rem;
}

/* ============================
   FIX: кнопки = высоте панели в .sync-row
   ============================ */

/* растягиваем детей строки по высоте самой "высокой" колонки (панели) */
.sync-row{
    align-items: stretch !important;    /* было center/стоит два раза — перекрываем */
}

/* внутри панель остаётся флексом и центрирует своё содержимое */
.sync-row .sync-panel{
    display: flex;
    align-items: center;
}

/* левая синяя и правая "Обновить баланс" — растянуть до высоты строки */
.sync-row > .sync-btn,
.sync-row > button,
.sync-row .reload-balance-btn,
.sync-row .btn-balance,
.sync-row #refreshBtn{
    align-self: stretch;                /* ключ: растянуть по высоте */
    display: flex;                      /* не inline-flex — чтобы тянулась */
    align-items: center;                /* текст по центру по вертикали */
    justify-content: center;
    height: auto !important;            /* убрать фикс. 2rem/3rem */
    line-height: 1 !important;          /* без влияния line-height */
    padding: 0 14px;                    /* только горизонтальные отступы */
    margin: 0 !important;               /* никакого margin-top */
    border-radius: 6px;                 /* визуально ближе к панели */
    float: none !important;             /* на случай старых стилей */
}

/* элементы внутри панели — по-прежнему 2rem */
.sync-row .sync-panel .sync-btn,
.sync-row .sync-panel input,
.sync-row .sync-panel .sync-date{
    height: 2rem;
    line-height: 2rem;
}

/* если остались старые правила с фикс-высотой кнопки баланса — гасим их */
.filters-row .btn-balance{
    height: auto !important;
    line-height: 1 !important;
    margin-top: 0 !important;
}

/* ============================
   FIX v2: кнопки = высоте серой панели
   ============================ */

/* настраиваем единый расчёт высоты */
:root{
    --control-h: 32px;  /* высота инпутов/мини-кнопок внутри панели (2rem) */
    --panel-py: 8px;    /* вертикальные паддинги .sync-panel (0.5rem) */
    --panel-bw: 1px;    /* толщина рамки .sync-panel */
}

/* строка не растягивает детей, центр по вертикали */
.sync-row{
    align-items: center !important;
}

/* сама панель дат */
.sync-row .sync-panel{
    display: flex;
    align-items: center;
    padding-block: var(--panel-py);
    border-width: var(--panel-bw);
    box-sizing: border-box;
}

/* элементы внутри панели */
.sync-row .sync-panel .sync-btn,
.sync-row .sync-panel input,
.sync-row .sync-panel .sync-date{
    height: var(--control-h);
    line-height: var(--control-h);
}

/* большие кнопки слева/справа — ровно по внешней высоте панели */
.sync-row > .sync-btn,
.sync-row > button,
.sync-row .reload-balance-btn,
.sync-row .btn-balance,
.sync-row #refreshBtn{
    align-self: center !important;  /* отменяем прежний stretch */
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: calc(var(--control-h) + 2*var(--panel-py) + 2*var(--panel-bw)) !important;
    line-height: calc(var(--control-h) + 2*var(--panel-py) + 2*var(--panel-bw)) !important;
    padding: 0 14px;
    margin: 0;
    white-space: nowrap;
    float: none !important;
    border-radius: 6px;
}

/* если кнопку баланса уводим вправо */
.sync-row .btn-balance,
.sync-row .reload-balance-btn{
    margin-left: auto;
}

/* ===== FIX: выровнять высоту больших кнопок с высотой .sync-panel ===== */
:root{
    --control-h: 32px;  /* высота полей/малых кнопок в панели */
    --panel-py: 8px;    /* вертикальные паддинги .sync-panel */
    --panel-bw: 1px;    /* толщина рамки .sync-panel */
    --panel-fix: 2px;   /* микро-компенсация на субпиксели (поиграй 1–3px) */
}

.sync-row{
    align-items: center !important;
}

.sync-row .sync-panel{
    display: flex;
    align-items: center;
    padding-block: var(--panel-py);
    border-width: var(--panel-bw);
    box-sizing: border-box;
}

/* большие кнопки слева/справа — точно как внешняя высота панели */
.sync-row > .sync-btn,
.sync-row > button,
.sync-row .reload-balance-btn,
.sync-row .btn-balance,
.sync-row #refreshBtn{
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: calc(var(--control-h) + 2*var(--panel-py) + 2*var(--panel-bw) + var(--panel-fix)) !important;
    line-height: calc(var(--control-h) + 2*var(--panel-py) + 2*var(--panel-bw) + var(--panel-fix)) !important;
    padding: 0 14px;
    margin: 0;
    white-space: nowrap;
    border-width: var(--panel-bw);
}

/* правая кнопка вправо */
.sync-row .btn-balance,
.sync-row .reload-balance-btn{
    margin-left: auto;
}


.tab-label{
    display:inline-flex;
    align-items:center;
    gap:8px;
}
.tab-refresh-icon{
    display:inline-flex;
    align-items:center;
    opacity:.8;
}
.tab-refresh-icon svg{
    fill: currentColor;
}

/* --- Config tab --- */
#config {
    padding: 10px;
}

.config-wrap {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.config-richtext{
    width: 100%;
    max-width: 100%;
    height: 35vh;              /* было 70vh */
    overflow: auto;
    padding: 0.2rem;

    background-color: #f1f1f1; /* как .ui-log */
    color: #333;

    border: 1px solid #ccc;
    border-radius: 4px;

    font-size: 7pt;            /* как верхний лог */
    line-height: 1.35;

    white-space: pre-wrap;
    word-break: break-word;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

.config-line.unread {
    font-weight: 700;
}

.config-actions {
    display: flex;
    justify-content: flex-start;
}

.config-actions .btn-ack{
    margin-left: 0;               /* чтобы не уезжала вправо из-за общего button margin */
    height: 3rem;
    line-height: 3rem;
    background-color: #69a2ec;
    border: 2px solid #00008B;
    color: #fff;
    padding: 0 1rem;
    border-radius: 6px;
}
.config-actions .btn-ack:hover{
    filter: brightness(1.15);
}

/* Бейдж "!" на вкладке Конфиг — как .ui-tab-badge (красный кружок) */
.tab-badge{
    display: none;                 /* скрыт по умолчанию */
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    margin-left: 8px;
    border-radius: 999px;
    background: #e53935;
    color: #fff;
    font-size: 12px;
    font-weight: 800;
    line-height: 18px;
}
.tab-badge.on{
    display: inline-flex;
}

/* токен-область */
.tokens-wrap{
    margin-top: 6px;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 6px;
    background: #f0f0f0;
}

.token-row{
    display:flex;
    align-items:center;
    gap:10px;
    padding: 6px 0;
}

.token-label{
    min-width: 220px;
    font-size: 12px;
    color: #333;
    white-space: nowrap;
}

.token-input{
    flex: 1 1 auto;
    height: 32px;
    padding: 4px 8px;
    border: 1px solid #bbb;
    border-radius: 4px;
    background: #fff;
    box-sizing: border-box;
}

.token-actions{
    display:flex;
    gap:6px;
    min-width: 70px;
    justify-content: flex-end;
}

/* ✓ ✕ невидимы пока нет фокуса */
.token-actions button{
    display:none;
    height: 32px;
    line-height: 32px;
    padding: 0 10px;
    border-radius: 6px;
    background-color:#c8d6e5;
    border: 1px solid #aab;
    margin-left:0;
}
.token-row.focused .token-actions button{ display:inline-flex; }

/* маленькая корректировка визуала */
.token-actions button:hover{ background-color:#d4ddee; }

/* Подсветка критичных слов в логе auth */
.log-alert {
    color: #ff0000;      /* бордовый */
    font-weight: 700;
}