/* Поверх Metronic style.bundle.css. Только то, чего нет в теме. */

/* Системные шрифты вместо Inter с CDN — страница работает без интернета. */
body, .form-control, .btn, .table {
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.login-aside {
    background: linear-gradient(135deg, #1e1e2d 0%, #1b84ff 100%);
    min-height: 220px;
}

/* Тёмная тема: Metronic делает акцент темнее (#006AE6), на тёмном фоне он
   бьёт по глазам. Берём более светлый голубой — контраст мягче, читаемость выше. */
[data-bs-theme="dark"] {
    --bs-primary: #4da3ff;
    --bs-primary-rgb: 77, 163, 255;
    --bs-primary-active: #6fb5ff;
    --bs-primary-light: #16283f;
    --bs-link-color: #6fb5ff;
    --bs-link-color-rgb: 111, 181, 255;
    --bs-link-hover-color: #9cccff;
    --bs-link-hover-color-rgb: 156, 204, 255;
    --bs-text-primary: #6fb5ff;
    --bs-primary-text-emphasis: #9cccff;
}

/* Заливки кнопок и бейджей идут не через переменные — задаём явно. */
[data-bs-theme="dark"] .btn.btn-primary {
    --bs-btn-bg: #3d8fe0;
    --bs-btn-border-color: #3d8fe0;
    --bs-btn-hover-bg: #5aa3ea;
    --bs-btn-hover-border-color: #5aa3ea;
    --bs-btn-active-bg: #5aa3ea;
    --bs-btn-active-border-color: #5aa3ea;
    --bs-btn-color: #0b1220;
    --bs-btn-hover-color: #0b1220;
    --bs-btn-active-color: #0b1220;
}

[data-bs-theme="dark"] .text-primary {
    color: #6fb5ff !important;
}

[data-bs-theme="dark"] .login-aside {
    background: linear-gradient(135deg, #16202e 0%, #2f6fa8 100%);
}

/* Числа в таблицах — по правому краю и моноширинные цифры. */
.num {
    text-align: right;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.table td.code, .table th.code, code.code {
    font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
    font-size: 0.85rem;
}

.table-compact > :not(caption) > * > * {
    padding-top: 0.45rem;
    padding-bottom: 0.45rem;
}

.badge-status {
    font-weight: 600;
}

.stat-card .stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1.2;
    font-variant-numeric: tabular-nums;
}

.stat-card .stat-label {
    color: var(--bs-gray-600);
    font-size: 0.925rem;
}

.text-pre {
    white-space: pre-wrap;
}

tr.row-total td {
    font-weight: 700;
    border-top: 2px solid var(--bs-gray-400);
}

/* Подсветка строки: через rgb/alpha — читается и на светлом, и на тёмном фоне. */
tr.row-unmapped td {
    background: rgba(var(--bs-warning-rgb), 0.12);
}

.dataTables_wrapper .dataTables_filter input {
    min-width: 220px;
}
