.summary-segment-link {
    text-decoration: underline;
}

.summary-segment-link:hover {
    text-decoration: none;
}

.summary-fragment-pre {
    background-color: #1e1e1e;
    color: #d4d4d4;
    font-family: "Courier New", monospace;
    font-size: 0.9em;
    line-height: 1.2;
}

.summary-fragment-line {
    display: flex;
    align-items: stretch;
    white-space: pre;
    padding: 0;
    border-radius: 0;
    position: relative;
    z-index: 0;
}

/* Stack above neighbors so outlines / context rail are not covered by adjacent row backgrounds */
.summary-fragment-pre code .summary-diff-row-z-context {
    z-index: 1;
}

.summary-fragment-pre code .summary-diff-row-z-boundary {
    z-index: 2;
}

.summary-fragment-pre code .summary-diff-row-z-hit {
    z-index: 3;
}

.summary-fragment-line-match {
    background-color: rgba(245, 158, 11, 0.25);
    outline: 1px solid rgba(245, 158, 11, 0.6);
    outline-offset: 0;
}

.summary-fragment-line-diff-added {
    color: #b5cea8;
    background-color: #2d5016;
}

.summary-fragment-line-diff-removed {
    color: #f48771;
    background-color: #5a1d1d;
}

.summary-fragment-line-diff-context {
    color: #cbd5e1;
}

/* Legacy meta bucket; @@ / --- / +++ use .diff-hunk / .diff-header like main diff */
.summary-fragment-line-diff-meta {
    color: #9cdcfe;
    background-color: #264f78;
}

.summary-fragment-line > .diff-line.diff-hunk,
.summary-fragment-line > .diff-line.diff-header {
    display: inline-block;
    flex: 1 1 auto;
    min-width: 0;
    min-height: 1.2em;
    vertical-align: top;
    box-sizing: border-box;
}

.summary-fragment-line-object-boundary {
    color: #fde68a;
    background-color: rgba(120, 53, 15, 0.35);
    outline: 1px dashed rgba(251, 191, 36, 0.8);
    outline-offset: 0;
}

.summary-fragment-line-with-severity {
    font-weight: 500;
}

.summary-diff-gutter {
    display: inline-flex;
    align-items: stretch;
    min-width: 22em;
    flex-shrink: 0;
    border-right: 1px solid #555;
    margin-right: 0;
    user-select: none;
}

/* Context bar: one column; yellow only on rows from first [] boundary to last [] (see GetSummaryDiffBoundaryRailSpan) */
.summary-diff-context-rail-slot {
    display: inline-block;
    width: 0.35em;
    min-width: 6px;
    flex-shrink: 0;
    align-self: stretch;
    margin-right: 0.45em;
    border-left: 3px solid transparent;
    box-sizing: border-box;
}

.summary-fragment-line-with-context-rail .summary-diff-context-rail-slot {
    border-left-color: #fbbf24;
}

.summary-diff-old-num,
.summary-diff-new-num {
    display: inline-block;
    width: 4.8em;
    text-align: right;
    padding-right: 0.5em;
    color: #6a737d;
}

.summary-diff-boundary-marker {
    display: inline-block;
    width: 2ch;
    text-align: center;
    color: #fde68a;
    flex-shrink: 0;
}

.summary-diff-hit-marker {
    display: inline-block;
    width: 2ch;
    text-align: center;
    color: #f59e0b;
    flex-shrink: 0;
}

.summary-diff-hit-ordinal {
    display: inline-block;
    min-width: 3.5ch;
    text-align: right;
    color: #fbbf24;
    font-weight: 600;
    flex-shrink: 0;
    padding-right: 0.2em;
}

.summary-diff-severity-col {
    display: inline-block;
    min-width: 5.5em;
    max-width: 10em;
    padding-left: 0.25em;
    padding-right: 0.35em;
    font-size: inherit;
    flex-shrink: 0;
}
/* Custom styles for Config Drift Monitor */

:root {
    --cdm-font-body: 0.875rem;
    --cdm-line-height-body: 1.5;
    --cdm-font-h1: 1.5rem;
    --cdm-font-h2: 1.2rem;
    --cdm-font-h3: 1.1rem;
    --cdm-font-h4: 1rem;
    --cdm-font-kpi-value: 1.25rem;
    --cdm-font-kpi-label: 0.95rem;
    --cdm-font-kpi-secondary: 1.1rem;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* Бейджи Bootstrap: светлый текст на всех стандартных цветных фонах (единый вид; text-dark в разметке не нужен) */
.badge.bg-primary,
.badge.bg-secondary,
.badge.bg-success,
.badge.bg-danger,
.badge.bg-warning,
.badge.bg-info,
.badge.bg-dark {
    color: #fff !important;
}

/* Основной контент приложения: единая базовая типографика (main в MainLayout) */
.cdm-data-page {
    font-size: var(--cdm-font-body);
    line-height: var(--cdm-line-height-body);
}

.cdm-data-page h1,
.cdm-data-page .h1 {
    font-size: var(--cdm-font-h1);
    line-height: 1.25;
    font-weight: 600;
}

.cdm-data-page h2,
.cdm-data-page .h2 {
    font-size: var(--cdm-font-h2);
    line-height: 1.3;
    font-weight: 600;
}

.cdm-data-page h3,
.cdm-data-page .h3 {
    font-size: var(--cdm-font-h3);
    line-height: 1.35;
    font-weight: 600;
}

.cdm-data-page h4,
.cdm-data-page .h4 {
    font-size: var(--cdm-font-h4);
    line-height: 1.4;
    font-weight: 600;
}

/* Документация: чуть крупнее для длинного чтения */
.cdm-data-page .cdm-docs-reading {
    font-size: 1rem;
    line-height: 1.6;
}

/* Таблицы: один размер текста во всех ячейках (в т.ч. при class="small" на отдельных td) */
.cdm-data-page table.table th,
.cdm-data-page table.table td {
    font-size: 1em;
}

.cdm-data-page table.table th.small,
.cdm-data-page table.table td.small,
.cdm-data-page table.table.small th,
.cdm-data-page table.table.small td {
    font-size: 1em;
}

.cdm-data-page table.table th code,
.cdm-data-page table.table td code {
    font-size: inherit;
}

.cdm-data-page .form-label,
.cdm-data-page .form-check-label {
    font-size: inherit;
}

.cdm-data-page .form-control,
.cdm-data-page .form-select {
    font-size: inherit;
}

/* Не даём вложенному .small снова уменьшать шрифт (0.875em от уже уменьшенного родителя) */
.cdm-data-page .small,
.cdm-data-page small {
    font-size: inherit;
}

/* Навигация в одном масштабе с основным контентом */
.navbar .navbar-nav .nav-link {
    font-size: var(--cdm-font-body);
}

.navbar .navbar-nav .dropdown-item {
    font-size: var(--cdm-font-body);
}

/* KPI-плитки (дашборд + executive report): одни и те же числа и отступы */
.cdm-kpi-deck .card-body.py-3 {
    padding-top: 0.55rem !important;
    padding-bottom: 0.55rem !important;
}

.cdm-kpi-deck .fs-3 {
    font-size: var(--cdm-font-kpi-value) !important;
    line-height: 1.15;
}

.cdm-kpi-deck .fs-6.fw-semibold {
    font-size: var(--cdm-font-kpi-label) !important;
    line-height: 1.25;
}

.cdm-kpi-deck .fs-4 {
    font-size: var(--cdm-font-kpi-secondary) !important;
    line-height: 1;
}

/* Remove outline/border from page headers */
h1,
h2,
h3,
h4,
h5,
h6 {
    outline: none !important;
    border: none !important;
    box-shadow: none !important;
}

h1:focus,
h2:focus,
h3:focus,
h4:focus,
h5:focus,
h6:focus,
h1:focus-visible,
h2:focus-visible,
h3:focus-visible,
h4:focus-visible,
h5:focus-visible,
h6:focus-visible {
    outline: none !important;
    border: none !important;
    box-shadow: none !important;
}

/* Remove outline/border from elements containing headers */
h1 *,
h2 *,
h3 *,
h4 *,
h5 *,
h6 * {
    outline: none !important;
}

/* Remove outline from page title containers */
.page-title,
[class*="page-title"],
[class*="header"] {
    outline: none !important;
    border: none !important;
}

/* Remove focus outline from all elements except interactive ones */
*:focus:not(button):not(input):not(select):not(textarea):not(a):not([tabindex]):not([role="button"]) {
    outline: none !important;
}

/* But keep focus outline for interactive elements (accessibility) */
/* Exclude nav links and navbar-brand links from blue outline */
button:focus,
input:focus,
select:focus,
textarea:focus,
a:focus:not(.nav-link):not(.list-group-item):not(.docs-toc-link):not(.navbar-logo-link):not(.navbar-brand-external):not(.navbar-brand-internal):not([class*="navbar-brand"]),
[tabindex]:focus:not(.nav-link):not(.list-group-item):not(#docs-page-top),
[role="button"]:focus {
    outline: 2px solid #0d6efd !important;
    outline-offset: 2px;
}

/* No outline for any link inside navbar-brand (logo block) */
nav .navbar-brand a:focus,
nav .navbar-brand a:focus-visible,
nav .navbar-brand a:active {
    outline: none !important;
    outline-offset: unset !important;
    box-shadow: none !important;
    border: none !important;
}

/* Logo link: NO blue frame on focus/active/click — never */
a.navbar-logo-link,
a.navbar-logo-link:link,
a.navbar-logo-link:visited,
a.navbar-logo-link:hover,
a.navbar-logo-link:focus,
a.navbar-logo-link:focus-visible,
a.navbar-logo-link:active {
    outline: none !important;
    outline-offset: 0 !important;
    box-shadow: none !important;
    border: none !important;
    -webkit-tap-highlight-color: transparent;
}

a.navbar-logo-link * {
    outline: none !important;
    box-shadow: none !important;
}

/* Version on logo: horizontal — indent from logo right edge; vertical — slightly below menu level */
.navbar-brand-with-version {
    position: relative;
}

.navbar-version {
    position: absolute;
    right: 15px;
    top: calc(50% + 15px);
    transform: translateY(0);
    font-size: 0.49rem;
    line-height: 1;
    color: rgba(255, 255, 255, 0.75);
    white-space: nowrap;
    pointer-events: none;
}

.modal {
    background-color: rgba(0, 0, 0, 0.5);
}

.modal.show {
    display: block !important;
}

/* Profile version modal: YAML block and spacing */
.profile-version-modal .modal-header {
    flex-wrap: wrap;
    padding: 1rem 1.25rem;
}

.profile-version-modal .modal-header .btn-close {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
}

.profile-version-modal .modal-body {
    padding: 0 1.25rem 1rem;
}

.profile-version-modal .modal-footer {
    padding: 0.75rem 1.25rem;
}

.profile-version-yaml-box {
    font-family: ui-monospace, "Cascadia Code", "Source Code Pro", Menlo, Consolas, monospace;
    font-size: 0.8125rem;
    line-height: 1.45;
    padding: 1rem 1.25rem;
    margin: 0;
    background: #f8f9fa;
    border: none;
    border-radius: 0.25rem;
    max-height: 70vh;
    overflow: auto;
    white-space: pre-wrap;
    word-break: break-all;
}

.profile-version-yaml-box code {
    background: transparent;
    padding: 0;
    color: #212529;
}

.profile-version-yaml-with-lines {
    white-space: pre;
    word-break: normal;
}

/* Same idea as .diff-pre: fixed line box so gutter border reads as one vertical rule */
.profile-version-yaml-with-lines .profile-version-yaml-line {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    line-height: 1.45;
    min-height: 1.45em;
    box-sizing: border-box;
}

.profile-version-yaml-line-number {
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    width: 4.5em;
    padding-right: 0.9em;
    margin-right: 0.65em;
    color: #6a737d;
    user-select: none;
    border-right: 1px solid #ced4da;
    flex-shrink: 0;
}

.profile-version-yaml-line-content {
    white-space: pre;
    flex: 1 1 auto;
    min-width: 0;
    line-height: inherit;
}

/* NavLink active state */
.nav-link.active {
    font-weight: bold;
}

/* Remove outline from navigation links */
.nav-link,
.nav-link:focus,
.nav-link:focus-visible,
.nav-link.active,
.nav-link.active:focus,
.nav-link.active:focus-visible {
    outline: none !important;
    border: none !important;
    box-shadow: none !important;
}

/* Also for list-group items used in navigation */
.list-group-item,
.list-group-item:focus,
.list-group-item:focus-visible,
.list-group-item.active,
.list-group-item.active:focus,
.list-group-item.active:focus-visible {
    outline: none !important;
}

/* Blazor error UI - hidden by default, shown only on errors */
#blazor-error-ui {
    display: none;
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}

/* Diff display styles */
.diff-container {
    border: 1px solid #dee2e6;
    border-radius: 0.25rem;
    background-color: #1e1e1e;
}

.diff-pre {
    margin: 0;
    padding: 1rem;
    background-color: #1e1e1e;
    color: #d4d4d4;
    font-family: "Courier New", monospace;
    font-size: 0.9em;
    line-height: 1.2;
    white-space: pre;
    width: max-content;
    min-width: 100%;
}

/* Same line height for every row so gutter vertical lines stay continuous */
.diff-pre .diff-gutter,
.diff-pre .diff-line {
    line-height: 1.2;
    min-height: 1.2em;
    box-sizing: border-box;
}

/* One visual row per logical line; no literal newlines inside <pre> (avoids double spacing / fold gaps). */
.diff-pre .cdm-fold-line,
.snapshot-pre .cdm-fold-line {
    display: block;
    line-height: 1.2;
    min-height: 1.2em;
    white-space: pre;
    width: max-content;
    min-width: 100%;
    box-sizing: border-box;
}

.diff-pre .cdm-fold-line.cdm-fold-hidden,
.snapshot-pre .cdm-fold-line.cdm-fold-hidden {
    display: none !important;
}

.snapshot-pre .snapshot-line-text {
    display: inline;
    white-space: pre;
}

.cdm-fold-preview {
    display: none;
    color: #6a737d;
    user-select: none;
}

.cdm-fold-line.cdm-fold-collapsed > .cdm-fold-preview {
    display: inline;
}

.cdm-fold-toggle-slot {
    display: inline-block;
    width: 1.15em;
    min-width: 1.15em;
    height: 1.15em;
    margin-right: 0.35em;
    vertical-align: baseline;
    text-align: center;
    user-select: none;
}

/* Inline-block + min-height so background fills full line and no vertical gap between consecutive added/deleted lines */
.diff-added {
    display: inline-block;
    min-height: 1.2em;
    box-sizing: border-box;
    background-color: #2d5016 !important;
    color: #b5cea8 !important;
}

.diff-deleted {
    display: inline-block;
    min-height: 1.2em;
    box-sizing: border-box;
    background-color: #5a1d1d !important;
    color: #f48771 !important;
}

.diff-hunk {
    background-color: #264f78 !important;
    color: #9cdcfe !important;
    font-weight: normal;
}

.diff-header {
    background-color: #3c3c3c !important;
    color: #cccccc !important;
    font-weight: normal;
}

.diff-change-active {
    position: relative;
    z-index: 1;
    outline: 2px solid #ffc107;
    outline-offset: -1px;
}

/* Unified style for command boundaries (=== ... ===) and JSON section boundaries */
.diff-command-boundary,
.snapshot-command-boundary,
.diff-json-section-boundary,
.snapshot-json-section-boundary {
    box-shadow: inset 4px 0 0 #0dcaf0;
    background-color: #2a2f33;
    color: #e6f7ff !important;
    font-weight: normal;
}

.diff-command-boundary,
.snapshot-command-boundary {
    /* Keep boundary on the SAME visual row as the gutter line numbers. */
    display: inline-block;
    margin: 0;
}

.diff-json-section-boundary,
.snapshot-json-section-boundary {
    display: inline-block;
    margin-top: 0;
    margin-left: 0;
    margin-right: 0;
}

.cdm-fold-toggle {
    display: inline-block;
    width: 1.15em;
    min-width: 1.15em;
    height: 1.15em;
    padding: 0;
    margin-right: 0.35em;
    border: 1px solid #555;
    border-radius: 2px;
    background: #2d2d2d;
    color: #d4d4d4;
    font-family: "Courier New", monospace;
    font-size: 0.85em;
    line-height: 1;
    cursor: pointer;
    vertical-align: baseline;
    text-align: center;
}

.cdm-fold-toggle:hover {
    background: #3d3d3d;
    color: #fff;
}

/* Markdown documentation styling */
.markdown-body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.6;
    font-size: 0.95rem;
    color: #212529;
    background-color: #ffffff;
    padding: 1rem;
    border-radius: 0.25rem;
}

.markdown-body * {
    color: inherit;
}

.markdown-body a {
    color: #0d6efd;
}

.markdown-body table {
    color: #212529;
    background-color: #ffffff;
}

.markdown-body h1,
.markdown-body h2,
.markdown-body h3,
.markdown-body h4 {
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
}

.markdown-body p {
    margin-bottom: 0.75rem;
}

.markdown-body code {
    font-family: Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: 0.9em;
    background-color: #f8f9fa;
    padding: 0.1rem 0.25rem;
    border-radius: 0.15rem;
}

.markdown-body pre {
    background-color: #f8f9fa;
    color: #212529;
    padding: 0.75rem 1rem;
    border-radius: 0.25rem;
    overflow-x: auto;
    font-size: 0.9em;
}

.markdown-body ul,
.markdown-body ol {
    padding-left: 1.5rem;
}

/* /docs и длинные формы: плавающие переходы в начало / конец прокрутки */
/* Левая колонка по умолчанию тянется по высоте строки — sticky остаётся в зоне прокрутки */
.docs-files-sidebar {
    font-size: 0.75rem;
    line-height: 1.28;
    border: 1px solid #dee2e6;
    border-radius: 0.35rem;
    background: #fff;
    overflow-x: hidden;
    overflow-y: auto;
    position: sticky;
    top: 0.75rem;
    max-height: calc(100vh - 1.25rem);
    z-index: 2;
}

/* Заголовок страницы /docs: без рамки при focus (перебивает глобальное правило [tabindex] с !important) */
#docs-page-top:focus,
#docs-page-top:focus-visible,
#profile-edit-modal-top:focus,
#profile-edit-modal-top:focus-visible {
    outline: none !important;
    box-shadow: none !important;
    border-color: transparent;
}

.docs-files-label {
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 0.3rem 0.45rem 0.2rem;
    border-bottom: 1px solid #e9ecef;
}

.docs-files-list .list-group-item {
    padding: 0.28rem 0.4rem;
    font-size: 0.75rem;
    border-left: none;
    border-right: none;
    word-break: break-word;
}

.docs-files-list .list-group-item:first-child {
    border-top: none;
}

/* Документация: пункты списка файлов — только подсветка Bootstrap active, без голубого кольца focus */
.docs-files-sidebar .list-group-item-action:focus,
.docs-files-sidebar .list-group-item-action:focus-visible,
.docs-files-sidebar .list-group-item-action:focus-within {
    outline: none !important;
    box-shadow: none !important;
}

.docs-back-to-top,
.docs-scroll-to-end,
.profile-modal-scroll-fab {
    position: fixed;
    right: 1rem;
    z-index: 1060;
    width: 2.5rem;
    height: 2.5rem;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.2s ease;
    transform: translateY(8px);
}

.docs-scroll-to-end {
    top: 5.25rem;
    transform: translateY(-8px);
}

.docs-scroll-to-end.cdm-scroll-fab--visible {
    transform: translateY(0);
}

.docs-back-to-top {
    bottom: 1rem;
}

.profile-modal-scroll-fab--down {
    top: 6.5rem;
    transform: translateY(-8px);
}

.profile-modal-scroll-fab--down.cdm-scroll-fab--visible {
    transform: translateY(0);
}

.profile-modal-scroll-fab--up {
    bottom: 6.5rem;
}

.cdm-scroll-fab--visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
}

.docs-back-to-top-icon,
.docs-scroll-to-end-icon {
    font-size: 1.1rem;
    line-height: 1;
}

/* /docs: main column (оглавление в боковом списке) */
.docs-reader {
    display: block;
}

.docs-reader-body {
    min-width: 0;
}

/* Текст документа: верх первого блока на уровне верхней границы левой колонки; тело чуть мельче, заголовки чуть крупнее основного текста */
.docs-reader .markdown-body {
    font-size: 0.9rem;
    padding-top: 0;
    padding-left: 1rem;
    padding-right: 1rem;
    padding-bottom: 1rem;
}

.docs-reader .markdown-body > :first-child {
    margin-top: 0;
}

.docs-reader .markdown-body h1,
.docs-reader .markdown-body h2,
.docs-reader .markdown-body h3,
.docs-reader .markdown-body h4,
.docs-reader .markdown-body h5,
.docs-reader .markdown-body h6 {
    line-height: 1.25;
    scroll-margin-top: 0.75rem;
}

.docs-reader .markdown-body h1 {
    font-size: 1.65rem;
    font-weight: 600;
}

.docs-reader .markdown-body h2 {
    font-size: 1.3rem;
    font-weight: 600;
}

.docs-reader .markdown-body h3 {
    font-size: 1.1rem;
    font-weight: 600;
}

.docs-reader .markdown-body h4 {
    font-size: 1rem;
    font-weight: 600;
}

.docs-reader .markdown-body h5 {
    font-size: 0.925rem;
    font-weight: 600;
}

.docs-reader .markdown-body h6 {
    font-size: 0.8625rem;
    font-weight: 600;
    color: #495057;
}

/* Оглавление встроено под активным файлом в sidebar */
.docs-file-outline {
    border-top: 1px solid #e9ecef;
    background: #f8f9fa;
    padding: 0.35rem 0.4rem 0.45rem;
}

.docs-sidebar-toc {
    overflow-x: hidden;
    overflow-y: visible;
    font-size: 0.78rem;
    line-height: 1.32;
}

/* Подпункты оглавления (вложенные заголовки) — чуть крупнее верхнего уровня */
.docs-sidebar-toc .docs-toc-item.docs-toc-level-2 .docs-toc-link,
.docs-sidebar-toc .docs-toc-item.docs-toc-level-3 .docs-toc-link,
.docs-sidebar-toc .docs-toc-item.docs-toc-level-4 .docs-toc-link,
.docs-sidebar-toc .docs-toc-item.docs-toc-level-5 .docs-toc-link,
.docs-sidebar-toc .docs-toc-item.docs-toc-level-6 .docs-toc-link {
    font-size: 0.86rem;
}

.docs-sidebar-toc.docs-toc-nav--empty {
    display: none !important;
}

.docs-toc-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.docs-toc-item {
    margin: 0;
    padding: 0;
}

.docs-toc-item.docs-toc-level-2 {
    padding-left: 0.5rem;
}

.docs-toc-item.docs-toc-level-3 {
    padding-left: 1rem;
}

.docs-toc-item.docs-toc-level-4 {
    padding-left: 1.5rem;
}

.docs-toc-item.docs-toc-level-5 {
    padding-left: 2rem;
}

.docs-toc-item.docs-toc-level-6 {
    padding-left: 2.5rem;
}

.docs-toc-link {
    display: block;
    padding: 0.2rem 0.25rem;
    border-radius: 0.2rem;
    color: #495057;
    text-decoration: none;
    word-break: break-word;
}

.docs-toc-link:hover {
    background: rgba(13, 110, 253, 0.08);
    color: #0d6efd;
}

.docs-toc-link--active {
    font-weight: 600;
    color: #0d6efd;
    background: rgba(13, 110, 253, 0.1);
}

/* Оглавление в сайдбаре: без синей рамки при клике — остаётся только .docs-toc-link--active */
.docs-toc-link:focus,
.docs-toc-link:focus-visible,
.docs-toc-link:active {
    outline: none !important;
    box-shadow: none !important;
}

/* Заголовок в тексте при переходе по якорю — без рамки :target / focus */
.docs-reader .markdown-body h1:target,
.docs-reader .markdown-body h2:target,
.docs-reader .markdown-body h3:target,
.docs-reader .markdown-body h4:target,
.docs-reader .markdown-body h5:target,
.docs-reader .markdown-body h6:target {
    outline: none !important;
    box-shadow: none !important;
}

.diff-context {
    color: #d4d4d4;
}

/* Snapshot display styles */
.snapshot-container {
    border: 1px solid #dee2e6;
    border-radius: 0.25rem;
    background-color: #1e1e1e;
}

.snapshot-pre {
    margin: 0;
    padding: 1rem;
    background-color: #1e1e1e;
    color: #d4d4d4;
    font-family: "Courier New", monospace;
    font-size: 0.9em;
    line-height: 1.2;
    white-space: pre;
    width: max-content;
    min-width: 100%;
}

/* Profile test: editable content with line gutter (dark theme; gutter + textarea share exact px metrics) */
.snapshot-content-editor-with-line-numbers {
    background-color: #1e1e1e;
    border: 1px solid #dee2e6;
    border-radius: 0.25rem;
    align-items: stretch;
    max-height: 420px;
    overflow: hidden;
    font-size: 13px;
    line-height: 16px;
}

.snapshot-content-editor-with-line-numbers .snapshot-content-line-gutter {
    flex-shrink: 0;
    text-align: right;
    /* bottom padding reserves space for textarea horizontal scrollbar */
    padding: 8px 8px 24px 6px;
    background-color: #252526;
    border-right: 1px solid #444;
    color: #6a737d;
    user-select: none;
    font-family: "Courier New", Consolas, monospace;
    font-size: 13px;
    line-height: 16px;
    overflow-y: scroll;
    overflow-x: hidden;
    max-height: 420px;
    scrollbar-width: none; /* hide gutter scrollbar (scroll synced with textarea) */
    -ms-overflow-style: none;
    box-sizing: border-box;
}

.snapshot-content-editor-with-line-numbers .snapshot-content-line-gutter::-webkit-scrollbar {
    width: 0;
    height: 0;
}

.snapshot-content-editor-with-line-numbers .snapshot-content-line-num-row {
    height: 16px;
    min-height: 16px;
    max-height: 16px;
    line-height: 16px;
    box-sizing: border-box;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

.snapshot-content-editor-with-line-numbers .snapshot-content-line-num-row--changed {
    background-color: rgba(201, 162, 39, 0.22);
    color: #f0e6a8;
    border-radius: 2px;
}

/* Narrow strip: warm bar per changed line (scroll-synced with gutter + textarea) */
.snapshot-content-editor-with-line-numbers .profile-test-change-strip {
    flex-shrink: 0;
    width: 10px;
    /* bottom padding reserves space for textarea horizontal scrollbar */
    padding: 8px 0 24px;
    background-color: #252526;
    border-right: 1px solid #444;
    overflow-y: scroll;
    overflow-x: hidden;
    max-height: 420px;
    scrollbar-width: none; /* hide strip scrollbar (scroll synced with textarea) */
    -ms-overflow-style: none;
    box-sizing: border-box;
}

.snapshot-content-editor-with-line-numbers .profile-test-change-strip::-webkit-scrollbar {
    width: 0;
    height: 0;
}

.snapshot-content-editor-with-line-numbers .profile-test-change-strip-row {
    height: 16px;
    min-height: 16px;
    max-height: 16px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
}

.snapshot-content-editor-with-line-numbers .profile-test-change-strip-row--changed {
    background: linear-gradient(90deg, transparent 0%, rgba(201, 162, 39, 0.75) 35%, rgba(240, 200, 90, 0.9) 100%);
    border-radius: 2px;
    margin: 0 1px;
}

.snapshot-content-editor-with-line-numbers .snapshot-content-textarea-wrap textarea.snapshot-content-textarea.form-control {
    border: none !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    box-sizing: border-box;
    overflow-x: auto;
    overflow-y: auto;
    background-color: #1e1e1e;
    color: #d4d4d4;
    max-height: 420px;
    font-family: "Courier New", Consolas, monospace !important;
    font-size: 13px !important;
    line-height: 16px !important;
    padding: 8px 10px !important;
    margin: 0 !important;
    vertical-align: top;
}

/* Profile test editor: suppress Bootstrap blue focus ring */
.snapshot-content-editor-with-line-numbers .snapshot-content-textarea-wrap textarea.snapshot-content-textarea.form-control:focus,
.snapshot-content-editor-with-line-numbers .snapshot-content-textarea-wrap textarea.snapshot-content-textarea.form-control:focus-visible {
    outline: none !important;
    box-shadow: none !important;
}

.snapshot-content-editor-with-line-numbers.profile-test-has-edits .snapshot-content-textarea-wrap textarea.snapshot-content-textarea.form-control {
    /* Change strip already indicates edits; avoid a second vertical bar */
    box-shadow: none !important;
}

/* Cron help icon styling */
.cron-help-icon {
    display: inline-flex;
    align-items: center;
    cursor: help;
    transition: all 0.2s ease-in-out;
    vertical-align: middle;
}

.cron-help-icon i {
    font-size: 1.1em;
    opacity: 0.7;
    transition: all 0.2s ease-in-out;
}

.cron-help-icon:hover {
    transform: scale(1.15);
}

.cron-help-icon:hover i {
    opacity: 1;
    color: #0d6efd;
}

/* Editable profile YAML: gutter + textarea (regex overlay stays position-relative to textarea only) */
.profile-yaml-editor-with-line-numbers {
    background-color: #fff;
    border: 1px solid #ced4da;
    border-radius: 0.375rem;
    align-items: stretch;
    /* Horizontal scroll only on the textarea (nested overflow-x: auto); outer overflow-x would duplicate the bar. */
    overflow-x: hidden;
    overflow-y: visible;
}

.profile-yaml-editor-with-line-numbers .profile-yaml-line-numbers-gutter {
    flex-shrink: 0;
    text-align: right;
    padding: 0.375rem 0.35rem 0.375rem 0.25rem;
    background-color: #f8f9fa;
    border-right: 1px solid #ced4da;
    color: #6a737d;
    user-select: none;
    font-family: "Courier New", monospace;
    font-size: 0.9em;
    line-height: 1.5;
    overflow: hidden;
    min-width: 3.25rem;
}

.profile-yaml-editor-with-line-numbers .profile-yaml-line-num-row {
    line-height: 1.5;
    min-height: 1.5em;
    box-sizing: border-box;
}

.profile-yaml-editor-with-line-numbers .profile-yaml-textarea-wrap textarea.form-control {
    border: none !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    box-sizing: border-box;
    /* rows track line count; subpixel/border mismatch otherwise yields a 1-line-tall vertical scrollbar */
    overflow-x: auto;
    overflow-y: hidden;
}

/* Regex icons overlay for YAML editor */
.regex-icons-overlay {
    position: absolute;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: 10;
    overflow: visible;
}

/* Summary rule details — profile fragment: dark underlay (hit line highlight) + transparent textarea for regex overlay */
.summary-rule-details-profile-fragment-stack {
    position: relative;
    background-color: #1e1e1e;
    border: 1px solid var(--bs-border-color);
    border-radius: var(--bs-border-radius);
    overflow: hidden;
}

.summary-rule-details-profile-fragment-stack .profile-fragment-underlay {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: 0;
    /* Match Bootstrap .form-control padding so underlay lines align with textarea text */
    padding: 0.375rem 0.75rem;
}

.summary-rule-details-profile-fragment-stack .profile-fragment-underlay-inner {
    min-width: 100%;
    width: max-content;
    will-change: transform;
}

.summary-rule-details-profile-fragment-stack .profile-fragment-underlay-line {
    white-space: pre;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
    line-height: 1.5;
    color: #d4d4d4;
    margin: 0;
    padding: 0;
}

.summary-rule-details-profile-fragment-stack .profile-fragment-underlay-line-hit {
    box-shadow: inset 4px 0 0 rgba(245, 158, 11, 0.95);
}

.summary-rule-details-profile-fragment-stack textarea.summary-rule-details-profile-fragment-ta {
    position: relative;
    z-index: 1;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
    line-height: 1.5;
    white-space: pre;
    overflow-x: auto;
    overflow-y: auto;
    resize: vertical;
    min-height: 8rem;
    background-color: transparent !important;
    color: transparent;
    caret-color: #f59e0b;
    border: none !important;
    box-shadow: none !important;
    border-radius: 0 !important;
}

.summary-rule-details-profile-fragment-stack .regex-icons-overlay {
    z-index: 10;
}

/* Regex hint chip: fixed box + flex centering (avoid hover scale — it shifts hit area / looks like “jumping”) */
.regex-help-icon {
    pointer-events: auto;
    cursor: help;
    box-sizing: border-box;
    width: 22px;
    height: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    line-height: 1;
    background-color: rgba(255, 255, 255, 0.95);
    border-radius: 4px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    z-index: 20;
    transition: background-color 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.regex-help-icon:hover {
    background-color: #fff;
    border-color: rgba(13, 110, 253, 0.35);
    box-shadow: 0 0 0 2px rgba(13, 110, 253, 0.2);
}

.regex-help-icon i.bi {
    display: block;
    margin: 0;
    font-size: 0.8125rem;
    line-height: 1;
    color: #0d6efd;
}

/* Tooltip styling for regex explanations */
.tooltip.regex-tooltip {
    /* Bootstrap tooltip default is ~1080; our nested modals can go выше (e.g. 1090). */
    z-index: 2000;
}

.regex-tooltip .tooltip-inner {
    max-width: 1000px;
    min-width: 400px;
    text-align: left;
    padding: 12px;
    font-size: 0.9em;
    line-height: 1.5;
}

.regex-tooltip .tooltip-inner code {
    background-color: #f8f9fa;
    padding: 2px 4px;
    border-radius: 3px;
    font-size: 0.9em;
    color: #d63384;
}

/* Make the pattern display larger and brighter */
.regex-tooltip .tooltip-inner>div:first-child code {
    font-size: 1.1em;
    font-weight: 600;
    color: #c2185b;
    background-color: #fff3f8;
    padding: 4px 6px;
    border: 1px solid #f8d7da;
}

.regex-tooltip .tooltip-inner ul {
    margin: 8px 0;
    padding-left: 20px;
}

.regex-tooltip .tooltip-inner li {
    margin: 4px 0;
}

/* Tooltip styling for unacked events breakdown */
.unacked-events-tooltip .tooltip-inner {
    text-align: left;
    padding: 8px 12px;
}

/* Targets list: row with failed last collection run */
.last-run-failed-row {
    /*--bs-table-bg: rgba(255, 193, 7, 0.25);*/
    --bs-table-hover-bg: rgba(255, 193, 7, 0.35);
    border-left: 3px solid #dc3545;
}

/*.last-run-failed-row td {
    background-color: var(--bs-table-bg);
}
.last-run-failed-row:hover td {
    background-color: var(--bs-table-hover-bg);
}*/

/*
 * Unified button styling across all forms:
 * - Primary action (View, Create, Save, Run): btn-primary (filled)
 * - Edit in tables: btn-outline-primary
 * - Delete in tables: btn-outline-danger; confirm in modal: btn-danger
 * - Cancel / Back / Close: btn-outline-secondary
 * - Clear filters, Copy, utility: btn-outline-secondary btn-sm
 * - Approve: btn-success; Deny: btn-outline-danger
 */
.btn + .btn {
    margin-left: 0.25rem; /* consistent spacing between buttons */
}

/* Pagination: фиксированная ширина и слот "… номер …" одной ширины */
.pagination-nav {
    min-width: 28rem;
}
.pagination-middle-slot .page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 10ch; /* влезает "… 99999 …" */
}
.pagination-middle-slot .pagination-current-slot {
    min-width: 5ch;
    display: inline-block;
    text-align: center;
}
.pagination-middle-slot .pagination-ellipsis {
    margin: 0 0.15rem;
}

/* Targets list: выключенные — без фона, только бледный текст */
.table tbody tr.cdm-target-row-disabled td {
    color: var(--bs-secondary-color);
    color: color-mix(in srgb, var(--bs-body-color) 42%, var(--bs-body-bg));
}

/*
 * Едва заметный розовый фон: ошибка последнего сбора (Targets / Last run) или ошибка компиляции профиля (Profiles).
 * Bootstrap td: сбрасываем inset box-shadow.
 */
.table tbody tr.cdm-target-row-last-run-failed > td,
.table tbody tr.cdm-profile-row-compile-failed > td {
    background-color: rgba(220, 53, 69, 0.07) !important;
    box-shadow: none !important;
}

.table tbody tr.cdm-target-row-last-run-failed:hover > td,
.table tbody tr.cdm-profile-row-compile-failed:hover > td {
    background-color: rgba(220, 53, 69, 0.11) !important;
}

[data-bs-theme="dark"] .table tbody tr.cdm-target-row-last-run-failed > td,
[data-bs-theme="dark"] .table tbody tr.cdm-profile-row-compile-failed > td {
    background-color: rgba(255, 120, 130, 0.09) !important;
}

[data-bs-theme="dark"] .table tbody tr.cdm-target-row-last-run-failed:hover > td,
[data-bs-theme="dark"] .table tbody tr.cdm-profile-row-compile-failed:hover > td {
    background-color: rgba(255, 120, 130, 0.14) !important;
}

[data-bs-theme="dark"] .table tbody tr.cdm-target-row-disabled td {
    color: var(--bs-secondary-color);
    color: color-mix(in srgb, var(--bs-body-color) 55%, var(--bs-body-bg));
}

.table tbody tr.cdm-target-row-peer-compare > td:first-child {
    box-shadow: inset 3px 0 0 0 var(--bs-info);
}

[data-bs-theme="dark"] .table tbody tr.cdm-target-row-peer-compare > td:first-child {
    box-shadow: inset 3px 0 0 0 color-mix(in srgb, var(--bs-info) 75%, white);
}

/* Dashboard: collection schedule (global — scoped Razor CSS может не применяться к меткам в foreach) */
.collection-calendar-wrap {
    overflow-x: hidden;
    overflow-y: auto;
    max-height: 28rem;
    width: 100%;
    max-width: 100%;
}

.collection-calendar-wrap > .d-flex {
    min-width: 0;
}

/* Колонка имён: на узком экране уже 14rem, чтобы шкала оставалась в строке без горизонтального скролла */
.cdm-calendar-label-col {
    flex: 0 0 auto;
    width: min(14rem, 40vw);
    max-width: 14rem;
    overflow: hidden;
}

.cdm-time-axis {
    position: relative;
    min-height: 1.35rem;
    flex: 1 1 auto;
    min-width: 0;
    width: 100%;
    box-sizing: border-box;
}

.cdm-collection-strip {
    position: relative;
    min-height: 22px;
    height: 22px;
    flex: 1 1 auto;
    min-width: 0;
    width: 100%;
    box-sizing: border-box;
    --cdm-axis-divs: 12;
    background: repeating-linear-gradient(
        90deg,
        #dee2e6 0,
        #dee2e6 1px,
        transparent 1px,
        transparent calc(100% / var(--cdm-axis-divs, 12))
    );
}

.cdm-now-marker {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 2px;
    background: rgba(25, 135, 84, 0.75);
    z-index: 2;
    pointer-events: none;
    box-shadow: 1px 0 0 rgba(255, 255, 255, 0.45);
}

.cdm-collection-tick {
    position: absolute;
    top: 2px;
    width: 6px;
    height: 18px;
    margin: 0;
    padding: 0;
    background: #0d6efd;
    border-radius: 2px;
    transform: translateX(-50%);
    z-index: 3;
    box-sizing: border-box;
    cursor: help;
}

/* --- Framed cards (dashboard, reports): 1px border, header tint matches border --- */
.cdm-framed-card {
    border-width: 1px;
    border-style: solid;
    --cdm-frame-border: var(--bs-border-color);
    --cdm-frame-header-bg: var(--bs-secondary-bg);
    border-color: var(--cdm-frame-border) !important;
}

.cdm-framed-card > .card-header {
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
    font-weight: 600;
    background-color: var(--cdm-frame-header-bg);
    border-bottom: 1px solid var(--cdm-frame-border);
    color: var(--bs-body-color);
}

.cdm-framed-card--neutral {
    --cdm-frame-border: var(--bs-border-color);
    --cdm-frame-header-bg: var(--bs-secondary-bg);
}

.cdm-framed-card--primary {
    --cdm-frame-border: var(--bs-primary);
    --cdm-frame-header-bg: rgba(var(--bs-primary-rgb), 0.1);
}

.cdm-framed-card--success {
    --cdm-frame-border: var(--bs-success);
    --cdm-frame-header-bg: rgba(var(--bs-success-rgb), 0.1);
}

.cdm-framed-card--danger {
    --cdm-frame-border: var(--bs-danger);
    --cdm-frame-header-bg: rgba(var(--bs-danger-rgb), 0.1);
}

.cdm-framed-card--warning {
    --cdm-frame-border: var(--bs-warning);
    --cdm-frame-header-bg: rgba(var(--bs-warning-rgb), 0.1);
}

.cdm-framed-card--info {
    --cdm-frame-border: var(--bs-info);
    --cdm-frame-header-bg: rgba(var(--bs-info-rgb), 0.1);
}

.cdm-framed-card--secondary {
    --cdm-frame-border: var(--bs-secondary);
    --cdm-frame-header-bg: rgba(var(--bs-secondary-rgb), 0.12);
}

.cdm-framed-card--dark {
    --cdm-frame-border: var(--bs-dark);
    --cdm-frame-header-bg: rgba(var(--bs-dark-rgb), 0.12);
}

.cdm-framed-card--dashed {
    border-style: dashed;
}

[data-bs-theme="dark"] .cdm-framed-card--secondary {
    --cdm-frame-header-bg: rgba(var(--bs-secondary-rgb), 0.2);
}

[data-bs-theme="dark"] .cdm-framed-card--dark {
    --cdm-frame-header-bg: rgba(var(--bs-dark-rgb), 0.25);
}

/* --- Executive report --- */
.exec-report-nav-sticky {
    position: sticky;
    top: 0.75rem;
    z-index: 1020;
    background-color: var(--bs-body-bg);
}

.exec-report-anchor {
    scroll-margin-top: 4.5rem;
}

.exec-report-section-title {
    font-size: var(--cdm-font-h2);
    font-weight: 600;
    letter-spacing: 0.02em;
    color: var(--bs-secondary-color);
    border-bottom: 1px solid var(--bs-border-color);
    padding-bottom: 0.35rem;
    margin-bottom: 1rem;
}

.exec-report-section-title .bi {
    opacity: 0.85;
}

.exec-report-kpi-card {
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.exec-report-kpi-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 0.35rem 0.85rem rgba(0, 0, 0, 0.08) !important;
}

[data-bs-theme="dark"] .exec-report-kpi-card:hover {
    box-shadow: 0 0.35rem 0.85rem rgba(0, 0, 0, 0.35) !important;
}

.exec-report-empty-icon {
    font-size: 3.5rem;
    opacity: 0.35;
}

@media (min-width: 992px) {
    .exec-report-split > .col-lg-6:first-child {
        border-right: 1px solid var(--bs-border-color);
    }
}

/* Severity donut: use most of the column (was ~220px when styles were missing). */
.exec-report-severity-col {
    max-width: 100%;
}

.exec-report-donut-wrap {
    display: flex;
    justify-content: center;
    width: 100%;
}

.exec-report-donut-ring {
    box-sizing: border-box;
    width: min(100%, 22rem);
    max-width: 100%;
    aspect-ratio: 1;
    position: relative;
    flex-shrink: 0;
}

@media (min-width: 576px) {
    .exec-report-donut-ring {
        width: min(100%, 26rem);
    }
}

@media (min-width: 992px) {
    .exec-report-donut-ring {
        width: min(100%, 30rem);
    }
}

.exec-report-donut-hole {
    position: absolute;
    inset: 18%;
    background-color: var(--bs-body-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1.25;
}

.exec-report-donut-total {
    font-size: clamp(1.35rem, 4.5vmin, 2rem);
    font-weight: 600;
    line-height: 1.1;
}

.exec-report-severity-legend {
    max-width: min(30rem, 100%);
    margin-left: auto;
    margin-right: auto;
}

.exec-report-legend-swatch {
    display: inline-block;
    width: 0.7rem;
    height: 0.7rem;
    vertical-align: middle;
}

.exec-report-cat-bar-label {
    min-width: 6.5rem;
    max-width: 40%;
}

.exec-report-cat-bar-track {
    height: 14px;
}

.exec-report-category-table {
    max-height: 300px;
    overflow-y: auto;
}

.exec-report-category-table thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background-color: var(--bs-body-bg);
    box-shadow: 0 1px 0 var(--bs-border-color);
}

.exec-report-top-table-wrap {
    overflow-x: auto;
}

.exec-report-top-table-wrap thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background-color: var(--bs-body-bg);
    box-shadow: 0 1px 0 var(--bs-border-color);
}

.exec-report-risk-bar {
    height: 6px;
    min-width: 4rem;
}

/* Risk / Significance column header tooltips (Executive + Period changes) */
.tooltip.exec-report-wide-tooltip .tooltip-inner {
    max-width: min(32rem, 96vw);
    text-align: left;
}