/* ═══════════════════════════════════════════════════════════
   Fabula — пользовательские стили поверх Tailwind
   ═══════════════════════════════════════════════════════════ */

/* ── Битрикс: убираем стандартную панель редактирования ── */
#bx-panel { display: none !important; }

/* ── Tabulator: перекраска под тему ── */
.tabulator {
    border: none;
    border-radius: 0;
    font-size: 0.8125rem; /* 13px */
}

.tabulator .tabulator-header {
    background: #1e293b;   /* slate-800 */
    border-bottom: 2px solid #334155;
}

.tabulator .tabulator-header .tabulator-col {
    background: #1e293b;
    border-right: 1px solid #334155;
    color: #cbd5e1;         /* slate-300 */
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.tabulator .tabulator-header .tabulator-col:hover {
    background: #334155;   /* slate-700 */
}

.tabulator .tabulator-header .tabulator-col .tabulator-col-title {
    padding: 0.5rem 0.625rem;
}

.tabulator .tabulator-row {
    border-bottom: 1px solid #f1f5f9;  /* slate-100 */
    transition: background 0.1s;
}

.tabulator .tabulator-row:hover {
    background: #f8fafc !important;    /* slate-50 */
}

.tabulator .tabulator-row {
    height: auto !important;
    min-height: unset !important;
}

.tabulator .tabulator-row .tabulator-cell {
    padding: 0.4rem 0.625rem;
    border-right: 1px solid #f1f5f9;
    height: auto !important;
    min-height: unset !important;
}

/* ── Цвета строк ── */
.tabulator .tabulator-row.row-needs-update {
    background-color: #e0e7ff !important;  /* indigo-100 */
}
.tabulator .tabulator-row.row-booklet-overridden {
    background-color: #fed7aa !important;  /* orange-200 */
}

/* ── Чекбоксы в ячейках ── */
.tabulator .tabulator-col-resize-handle {
    height: auto !important;
}

.cell-checkbox {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    height: auto;
    cursor: pointer;
}

/* Ссылка на товар — абсолютно у правого края, не смещает чекбокс */
.cell-link {
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
}

/* Товар не найден на реципиенте — жёлтая подсветка только этой ячейки */
.tabulator .tabulator-cell.cell-not-found {
    background-color: #fde047 !important; /* yellow-300 */
}

.cell-checkbox input[type="checkbox"] {
    width: 15px;
    height: 15px;
    cursor: pointer;
    accent-color: #4f46e5;  /* brand-600 */
    flex-shrink: 0;
}

.cell-checkbox.loading {
    pointer-events: none;
    opacity: 0.45;
}

/* ── Строка-категория жирная ── */
.tabulator-row[data-row-type="section"] > .tabulator-cell:first-child {
    font-weight: 600;
    color: #1e293b;
}

/* ── DataTree: кнопка раскрытия / свёртки ── */
.tabulator .tabulator-data-tree-control {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
    margin-right: 4px;
}

/* Базовая кнопка (свёрнуто) — серый шеврон вправо */
.tree-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 4px;
    background: #f1f5f9;   /* slate-100 */
    color: #64748b;         /* slate-500 */
    flex-shrink: 0;
    transition: background 0.12s, color 0.12s;
}
.tabulator .tabulator-data-tree-control:hover .tree-btn {
    background: #e0e7ff;   /* indigo-100 */
    color: #4f46e5;         /* brand-600 */
}

/* Кнопка в раскрытом состоянии — индиго шеврон вниз */
.tree-btn--open {
    background: #e0e7ff;   /* indigo-100 */
    color: #4f46e5;         /* brand-600 */
}
.tabulator .tabulator-data-tree-control:hover .tree-btn--open {
    background: #c7d2fe;   /* indigo-200 */
}

/* ── Точка статуса ── */
.status-dot {
    display: inline-block;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    flex-shrink: 0;
}
.status-online  { background: #22c55e; box-shadow: 0 0 0 2px #dcfce7; }
.status-offline { background: #ef4444; box-shadow: 0 0 0 2px #fee2e2; }
.status-unknown { background: #94a3b8; box-shadow: 0 0 0 2px #f1f5f9; }

/* ── Скроллбар тонкий ── */
::-webkit-scrollbar       { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: #f1f5f9; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }
