:root {
    --b24-blue:   #2fc6f6;
    --b24-blue-d: #1f9ed4;
    --b24-text:   #333840;
    --b24-muted:  #828b95;
    --b24-border: #e6e8ea;
    --b24-head:   #f4f6f8;
    --b24-hover:  #f0f8fd;
}
body { font-size: 13px; color: var(--b24-text); background: #fff; }
h5 { font-weight: 600; }

/* Таблицы в стиле Bitrix-грида */
.b24-grid { width: 100%; border-collapse: collapse; background: #fff; }
.b24-grid thead th {
    background: var(--b24-head);
    color: var(--b24-muted);
    font-weight: 500;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .3px;
    padding: 9px 12px;
    border-bottom: 1px solid var(--b24-border);
    text-align: left;
    white-space: nowrap;
}
.b24-grid tbody td {
    padding: 9px 12px;
    border-bottom: 1px solid var(--b24-border);
    vertical-align: middle;
}
.b24-grid tbody tr:hover { background: var(--b24-hover); }
.b24-grid .b24-empty { color: var(--b24-muted); text-align: center; padding: 18px; }

/* Оверлей-лоадер на время загрузки данных вкладки/раздела */
.app-loader {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, .6);
    z-index: 2000;
}
.app-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid var(--b24-border);
    border-top-color: var(--b24-blue);
    border-radius: 50%;
    animation: app-spin .7s linear infinite;
}
@keyframes app-spin { to { transform: rotate(360deg); } }

/* Предупреждение «нет прав доступа» в карточке базы */
.b24-alert-warning {
    background: #fdecea;
    border: 1px solid #f0a9a0;
    border-left: 4px solid #e0503a;
    color: #a32316;
    border-radius: 4px;
    padding: 10px 14px;
    margin-bottom: 14px;
    font-size: 13px;
    font-weight: 500;
}

/* Кнопки в стиле Bitrix — единая высота 30px */
.b24-btn, .b24-btn-link, .b24-btn-danger {
    display: inline-flex; align-items: center; justify-content: center;
    height: 30px; box-sizing: border-box;
    border: none; border-radius: 2px; cursor: pointer;
    font-size: 13px; line-height: 30px; padding: 0 16px;
    text-align: center; white-space: nowrap;
}
.b24-btn { background: var(--b24-blue); color: #fff; }
.b24-btn:hover { background: var(--b24-blue-d); }
.b24-btn-sm { padding: 0 12px; }
.b24-btn-link { background: none; color: var(--b24-blue-d); padding: 0 10px; }
.b24-btn-link:hover { background: none; text-decoration: underline; }
.b24-btn-danger { background: none; color: #f1361d; padding: 0 10px; }
.b24-btn-danger:hover { background: #fdecea; }

/* Бургер-меню в строке таблицы */
.b24-kebab {
    border: none; background: none; cursor: pointer; color: var(--b24-muted);
    font-size: 15px; line-height: 1; padding: 3px 7px; border-radius: 3px;
}
.b24-kebab:hover { background: var(--b24-head); color: var(--b24-text); }
.b24-grid td.b24-menu-cell { width: 36px; padding-right: 4px; padding-left: 6px; }
.dropdown-menu { font-size: 13px; }

.b24-link { color: var(--b24-blue-d); cursor: pointer; text-decoration: none; }
.b24-link:hover { text-decoration: underline; }

/* Тосты */
#b24-toasts { position: fixed; top: 16px; right: 16px; z-index: 3000; display: flex; flex-direction: column; gap: 8px; }
.b24-toast {
    min-width: 240px; max-width: 360px; padding: 11px 14px; border-radius: 3px;
    color: #fff; font-size: 13px; box-shadow: 0 2px 10px rgba(0,0,0,.18);
    opacity: 0; transform: translateX(20px); transition: opacity .2s, transform .2s;
}
.b24-toast.show { opacity: 1; transform: none; }
.b24-toast-error   { background: #f1361d; }
.b24-toast-success { background: #3a8a2a; }
.b24-toast-info    { background: #1f9ed4; }

/* Табы верхнего уровня */
.b24-tabs { display: flex; gap: 4px; list-style: none; padding: 0; margin: 0 0 18px; border-bottom: 1px solid var(--b24-border); }
.b24-tab { padding: 9px 18px; cursor: pointer; color: var(--b24-muted); border-bottom: 2px solid transparent; margin-bottom: -1px; font-size: 14px; }
.b24-tab:hover { color: var(--b24-text); }
.b24-tab.active { color: var(--b24-text); border-bottom-color: var(--b24-blue); font-weight: 600; }

/* Статусы документов */
.status-badge { font-size: 11px; padding: 3px 8px; border-radius: 2px; display: inline-block; }
.status-pending    { background:#fff4d6; color:#a06a00; }
.status-converting { background:#d6f0fb; color:#1f7da0; }
.status-indexing   { background:#d9e7ff; color:#1c5fc5; }
.status-indexed    { background:#e3f4e0; color:#3a8a2a; }
.status-error      { background:#fdecea; color:#c5341d; }

#disk-modal .list-group-item { cursor: pointer; }
#disk-modal .list-group-item:hover { background: var(--b24-hover); }
