/* ============================================================================
 * HAXGate — Neutrine (светлая тема) · r2
 * ----------------------------------------------------------------------------
 * База: data-theme="light" (геометрия) + data-ui-theme="neutrine" (палитра).
 * Контракт из v14.46.2 сохранён: слой меняет только цвет/поверхности/границы.
 * Единственное намеренное исключение — «полосы секций» (.match-ctrl-title):
 * в FortiOS это full-bleed плашка, а не заголовок внутри карточки. Реализовано
 * отрицательным margin, внешние размеры блока не меняются.
 *
 * v19.13: палитра «Шалфей» — без чистого белого (выбор оператора).
 * Исходная палитра снята пипеткой со скриншотов из «Новая тема Neutrine.docx»
 * (страницы Local BGP Options, image12/13/14).
 * ============================================================================ */

html[data-ui-theme="neutrine"] {
    color-scheme: light;

    /* Хром: верхняя полоса, активный пункт навигации, активная вкладка */
    --ne-navy:        #3d4f47;
    --ne-navy-hover:  #47594f;
    --ne-navy-press:  #33433b;

    /* Рабочая область */
    --ne-page:        #e9ece6;
    --ne-shell:       #dde2da;
    --ne-strip:       #dce2d9;
    --ne-strip-hover: #d3dacf;
    --ne-zebra:       #e4e8e1;

    /* Границы: FortiOS-light использует ровно два веса */
    --ne-border:      #cfd6cb;
    --ne-border-str:  #b3bcaf;

    /* Текст */
    --ne-text:        #24302a;
    --ne-text-2:      #4f5b55;
    --ne-muted:       #7c8780;
    --ne-disabled:    #a5ada7;

    /* Семантика */
    --ne-link:        #2d6a86;
    --ne-red:         #c13a2e;
    --ne-red-hover:   #a93226;
    --ne-green:       #2a7349;
    --ne-amber:       #9c6816;
    --ne-attn:        #f1efd6;

    --ne-focus:       #5f7f70;
    --ne-card:        #f1f3ef;   /* карточки, модальные окна */
    --ne-field:       #f6f7f4;   /* поля ввода */
}

/* ── Оболочка ────────────────────────────────────────────────────────────── */
html[data-ui-theme="neutrine"] body,
html[data-ui-theme="neutrine"] .app-container,
html[data-ui-theme="neutrine"] .forti-shell {
    background-color: var(--ne-shell) !important;
    color: var(--ne-text) !important;
}

html[data-ui-theme="neutrine"] .forti-top {
    background: var(--ne-navy) !important;
    color: #fff !important;
    border-bottom: 1px solid var(--ne-navy-press) !important;
    box-shadow: none !important;
}
html[data-ui-theme="neutrine"] .forti-logo,
html[data-ui-theme="neutrine"] .forti-crumbs b { color: #fff !important; }
html[data-ui-theme="neutrine"] .forti-logo .device,
html[data-ui-theme="neutrine"] .forti-crumbs { color: rgba(255,255,255,.74) !important; }
html[data-ui-theme="neutrine"] .forti-crumbs i { color: rgba(255,255,255,.42) !important; }
html[data-ui-theme="neutrine"] .forti-logo,
html[data-ui-theme="neutrine"] .forti-ta,
html[data-ui-theme="neutrine"] .forti-admin {
    border-color: rgba(255,255,255,.16) !important;
    color: rgba(255,255,255,.88) !important;
}
html[data-ui-theme="neutrine"] .forti-ta:hover,
html[data-ui-theme="neutrine"] .forti-admin:hover,
html[data-ui-theme="neutrine"] .forti-admin.open {
    background: rgba(0,0,0,.16) !important;
    color: #fff !important;
}
html[data-ui-theme="neutrine"] .forti-node-select {
    background: rgba(255,255,255,.12) !important;
    color: #fff !important;
    border-color: rgba(255,255,255,.24) !important;
}

/* ── Левая навигация ─────────────────────────────────────────────────────── */
html[data-ui-theme="neutrine"] .forti-nav,
html[data-ui-theme="neutrine"] .forti-nav-scroll {
    background-color: var(--ne-shell) !important;
    border-right: 1px solid var(--ne-border) !important;
}
html[data-ui-theme="neutrine"] .nav-group > summary,
html[data-ui-theme="neutrine"] .nav-group .nav-item-sub {
    color: var(--ne-text) !important;
    background: transparent !important;
    border-bottom: 1px solid var(--ne-border) !important;
}
/* Базовый слой ставит на hover color:#fff вместе с фоном var(--bg-rail-hover),
   которого в светлой теме нет — фон схлопывался в прозрачный, а белый текст
   оставался. Задаём здесь и фон, и цвет. */
html[data-ui-theme="neutrine"] .nav-group > summary:hover,
html[data-ui-theme="neutrine"] .nav-group[open] > summary,
html[data-ui-theme="neutrine"] .nav-group.has-active > summary,
html[data-ui-theme="neutrine"] .nav-group .nav-item-sub:hover,
html[data-ui-theme="neutrine"] .nav-item:hover {
    background-color: #ececec !important;
    color: var(--ne-text) !important;
}
html[data-ui-theme="neutrine"] .nav-group > summary:hover i,
html[data-ui-theme="neutrine"] .nav-group[open] > summary i,
html[data-ui-theme="neutrine"] .nav-group .nav-item-sub:hover i,
html[data-ui-theme="neutrine"] .nav-group .nav-item-sub:hover span { color: var(--ne-text) !important; }

/* Тот же дефект в мелких контролах. */
html[data-ui-theme="neutrine"] .forti-widget-refresh:hover,
html[data-ui-theme="neutrine"] .iface-ref-btn:hover,
html[data-ui-theme="neutrine"] .ct-filter-field:hover { color: var(--ne-text) !important; }
html[data-ui-theme="neutrine"] .ct-filter-field:hover { background-color: var(--ne-strip) !important; }

/* Паритет с Dark Matter: тот прячет обе панели, светлая тема их показывала. */
html[data-ui-theme="neutrine"] .sidebar-live-panel,
html[data-ui-theme="neutrine"] .sidebar-user-panel { display: none !important; }
html[data-ui-theme="neutrine"] .forti-nav-footer { padding: 6px 10px !important; gap: 5px !important; }
html[data-ui-theme="neutrine"] .sidebar-meta-bottom {
    border-top: 0 !important; padding-top: 2px !important; gap: 2px !important; font-size: 9.5px !important;
}
html[data-ui-theme="neutrine"] .nav-group .nav-item-sub.active {
    background-color: var(--ne-navy) !important;
    color: #fff !important;
    border-color: var(--ne-navy) !important;
}
html[data-ui-theme="neutrine"] .nav-item-sub.active i,
html[data-ui-theme="neutrine"] .nav-item-sub.active span { color: #fff !important; }
html[data-ui-theme="neutrine"] .nav-group .grp-ico,
html[data-ui-theme="neutrine"] .nav-group .grp-chevron { color: #5c6165 !important; }
html[data-ui-theme="neutrine"] .forti-nav-footer,
html[data-ui-theme="neutrine"] .sidebar-footer,
html[data-ui-theme="neutrine"] .nav-utility-body {
    background-color: var(--ne-shell) !important;
    color: var(--ne-text-2) !important;
    border-color: var(--ne-border) !important;
}
html[data-ui-theme="neutrine"] .sidebar-live-title,
html[data-ui-theme="neutrine"] .sidebar-live-label,
html[data-ui-theme="neutrine"] .sidebar-user-role { color: var(--ne-text-2) !important; }
html[data-ui-theme="neutrine"] .sidebar-live-value,
html[data-ui-theme="neutrine"] .sidebar-user-name { color: var(--ne-text) !important; }

/* ── Рабочая область ─────────────────────────────────────────────────────── */
html[data-ui-theme="neutrine"] .main-content,
html[data-ui-theme="neutrine"] .tab-pane,
html[data-ui-theme="neutrine"] .subtab-pane {
    background-color: var(--ne-page) !important;
    color: var(--ne-text) !important;
}
html[data-ui-theme="neutrine"] .section-header {
    background-color: var(--ne-page) !important;
    border-color: var(--ne-border) !important;
    box-shadow: none !important;
}
html[data-ui-theme="neutrine"] .section-header h2,
html[data-ui-theme="neutrine"] .section-header h3 { color: var(--ne-text) !important; }
html[data-ui-theme="neutrine"] .section-header h2 i { color: var(--ne-text-2) !important; }
html[data-ui-theme="neutrine"] .hint-muted { color: var(--ne-text-2) !important; }

/* Секции: FortiOS не рисует карточки с тенью — только плашка + линейка.
   Плашка тянется на всю ширину блока за счёт отрицательного margin. */
html[data-ui-theme="neutrine"] .match-ctrl-section,
html[data-ui-theme="neutrine"] .fg-chain-card,
html[data-ui-theme="neutrine"] .collapsible-section,
html[data-ui-theme="neutrine"] .pl-card,
html[data-ui-theme="neutrine"] .pa-card {
    background-color: var(--ne-page) !important;
    color: var(--ne-text) !important;
    border-color: var(--ne-border) !important;
    border-radius: 2px !important;
    box-shadow: none !important;
}
html[data-ui-theme="neutrine"] .match-ctrl-section > .match-ctrl-title:first-child {
    margin: -12px -12px 12px !important;
    padding: 7px 12px !important;
    background-color: var(--ne-strip) !important;
    color: var(--ne-text) !important;
    border-bottom: 1px solid var(--ne-border) !important;
    border-radius: 2px 2px 0 0 !important;
    font-weight: 600 !important;
}
html[data-ui-theme="neutrine"] .modal .match-ctrl-section > .match-ctrl-title:first-child {
    margin: -10px -12px 8px !important;
}
html[data-ui-theme="neutrine"] .match-ctrl-title,
html[data-ui-theme="neutrine"] .fg-chain-header,
html[data-ui-theme="neutrine"] .iface-monitor-header,
html[data-ui-theme="neutrine"] .vpn-pane-heading {
    background-color: var(--ne-strip) !important;
    color: var(--ne-text) !important;
    border-color: var(--ne-border) !important;
}
html[data-ui-theme="neutrine"] .match-ctrl-title i { color: var(--ne-text-2) !important; }

html[data-ui-theme="neutrine"] .workspace-context {
    background-color: var(--ne-strip) !important;
    border-left-color: var(--ne-navy) !important;
    color: var(--ne-text-2) !important;
}
html[data-ui-theme="neutrine"] .workspace-context b { color: var(--ne-text) !important; }

/* ── Таблицы ─────────────────────────────────────────────────────────────── */
html[data-ui-theme="neutrine"] .table-wrap,
html[data-ui-theme="neutrine"] .data-table-wrapper,
html[data-ui-theme="neutrine"] table.data-table,
html[data-ui-theme="neutrine"] .data-table {
    background-color: var(--ne-page) !important;
    color: var(--ne-text) !important;
    border-color: var(--ne-border) !important;
}
html[data-ui-theme="neutrine"] table.data-table thead,
html[data-ui-theme="neutrine"] table.data-table th,
html[data-ui-theme="neutrine"] .data-table-head,
html[data-ui-theme="neutrine"] .data-th {
    background-color: var(--ne-strip) !important;
    color: var(--ne-text) !important;
    border-color: var(--ne-border) !important;
    font-weight: 600 !important;
}
html[data-ui-theme="neutrine"] table.data-table td {
    background-color: transparent !important;
    color: var(--ne-text) !important;
    border-color: var(--ne-border) !important;
}
html[data-ui-theme="neutrine"] table.data-table tbody tr:nth-child(even) td { background-color: var(--ne-zebra) !important; }
html[data-ui-theme="neutrine"] table.data-table tbody tr:hover td { background-color: #eef2f7 !important; }
html[data-ui-theme="neutrine"] table.data-table tbody tr.selected td,
html[data-ui-theme="neutrine"] table.data-table tbody tr[aria-selected="true"] td {
    background-color: #dfe6f0 !important;
}
html[data-ui-theme="neutrine"] .tbl-empty-cell {
    background-color: var(--ne-page) !important;
    color: var(--ne-muted) !important;
}

/* ── Формы ───────────────────────────────────────────────────────────────── */
html[data-ui-theme="neutrine"] input,
html[data-ui-theme="neutrine"] select,
html[data-ui-theme="neutrine"] textarea,
html[data-ui-theme="neutrine"] .log-select,
html[data-ui-theme="neutrine"] .config-editor-area-v503,
html[data-ui-theme="neutrine"] .raw-config-editor {
    background-color: var(--ne-card) !important;
    color: var(--ne-text) !important;
    border-color: var(--ne-border-str) !important;
    box-shadow: none !important;
}
html[data-ui-theme="neutrine"] input::placeholder,
html[data-ui-theme="neutrine"] textarea::placeholder { color: var(--ne-disabled) !important; }
html[data-ui-theme="neutrine"] input:focus,
html[data-ui-theme="neutrine"] select:focus,
html[data-ui-theme="neutrine"] textarea:focus {
    border-color: var(--ne-focus) !important;
    outline: 2px solid rgba(91,123,168,.28) !important;
    outline-offset: -1px !important;
}
html[data-ui-theme="neutrine"] input:disabled,
html[data-ui-theme="neutrine"] select:disabled,
html[data-ui-theme="neutrine"] textarea:disabled,
html[data-ui-theme="neutrine"] input[readonly] {
    background-color: var(--ne-strip) !important;
    color: var(--ne-text-2) !important;
}
/* Обязательное и ещё не заполненное поле — как «Local AS» на скриншоте BGP */
html[data-ui-theme="neutrine"] input[required]:invalid,
html[data-ui-theme="neutrine"] input.field-required-empty {
    background-color: var(--ne-attn) !important;
    border-color: #d8b23a !important;
}
html[data-ui-theme="neutrine"] .form-group label { color: var(--ne-text-2) !important; }

/* ── Кнопки ──────────────────────────────────────────────────────────────── */
html[data-ui-theme="neutrine"] .btn-primary {
    background-color: var(--ne-card) !important;
    color: #30507a !important;
    border: 1px solid #7c93b5 !important;
    box-shadow: none !important;
}
html[data-ui-theme="neutrine"] .btn-primary:hover:not(:disabled) {
    background-color: #eef3f9 !important;
    border-color: var(--ne-navy) !important;
}
html[data-ui-theme="neutrine"] .btn-secondary,
html[data-ui-theme="neutrine"] .icon-btn,
html[data-ui-theme="neutrine"] .forti-widget-select,
html[data-ui-theme="neutrine"] .forti-widget-refresh,
html[data-ui-theme="neutrine"] .forti-widget-more {
    background-color: var(--ne-card) !important;
    color: var(--ne-text-2) !important;
    border: 1px solid var(--ne-border-str) !important;
    box-shadow: none !important;
}
html[data-ui-theme="neutrine"] .btn-secondary:hover:not(:disabled),
html[data-ui-theme="neutrine"] .icon-btn:hover,
html[data-ui-theme="neutrine"] .forti-widget-select:hover,
html[data-ui-theme="neutrine"] .forti-widget-refresh:hover,
html[data-ui-theme="neutrine"] .forti-widget-more:hover {
    background-color: var(--ne-strip-hover) !important;
    color: var(--ne-text) !important;
}
html[data-ui-theme="neutrine"] .btn-danger {
    background-color: var(--ne-card) !important;
    color: #b02b1f !important;
    border: 1px solid #dda49e !important;
    box-shadow: none !important;
}
html[data-ui-theme="neutrine"] .btn-danger:hover:not(:disabled) {
    background-color: #fdf0ee !important;
    border-color: var(--ne-red) !important;
}
/* Единственная заливка в теме — Apply, ровно как в FortiOS */
html[data-ui-theme="neutrine"] #pol-apply-btn:not(:disabled),
html[data-ui-theme="neutrine"] button[id$="-apply-btn"]:not(:disabled),
html[data-ui-theme="neutrine"] button[id$="-apply"]:not(:disabled),
html[data-ui-theme="neutrine"] .btn-apply:not(:disabled) {
    background-color: var(--ne-red) !important;
    color: #fff !important;
    border-color: var(--ne-red) !important;
}
html[data-ui-theme="neutrine"] #pol-apply-btn:not(:disabled):hover,
html[data-ui-theme="neutrine"] button[id$="-apply-btn"]:not(:disabled):hover,
html[data-ui-theme="neutrine"] button[id$="-apply"]:not(:disabled):hover,
html[data-ui-theme="neutrine"] .btn-apply:not(:disabled):hover {
    background-color: var(--ne-red-hover) !important;
    border-color: var(--ne-red-hover) !important;
}
html[data-ui-theme="neutrine"] button:disabled { opacity: .5 !important; filter: none !important; }
html[data-ui-theme="neutrine"] :focus-visible {
    outline: 2px solid var(--ne-focus) !important;
    outline-offset: 1px !important;
}

/* ── Вкладки ─────────────────────────────────────────────────────────────── */
html[data-ui-theme="neutrine"] .subtabs-header,
html[data-ui-theme="neutrine"] .tabs-header {
    background-color: var(--ne-page) !important;
    border-color: var(--ne-border) !important;
}
html[data-ui-theme="neutrine"] .subtab-btn,
html[data-ui-theme="neutrine"] .tab-btn,
html[data-ui-theme="neutrine"] .pol-view-btn {
    background-color: transparent !important;
    color: var(--ne-text-2) !important;
    border-color: var(--ne-border) !important;
}
html[data-ui-theme="neutrine"] .subtab-btn:hover,
html[data-ui-theme="neutrine"] .tab-btn:hover,
html[data-ui-theme="neutrine"] .pol-view-btn:hover { background-color: var(--ne-strip) !important; }
html[data-ui-theme="neutrine"] .subtab-btn.active,
html[data-ui-theme="neutrine"] .tab-btn.active,
html[data-ui-theme="neutrine"] .pol-view-btn.active {
    background-color: var(--ne-navy) !important;
    color: #fff !important;
    border-color: var(--ne-navy) !important;
}
html[data-ui-theme="neutrine"] .settings-workspace-nav {
    background-color: var(--ne-strip) !important;
    border-color: var(--ne-border) !important;
}
html[data-ui-theme="neutrine"] .settings-workspace-btn {
    background-color: var(--ne-card) !important;
    color: var(--ne-text-2) !important;
    border-color: var(--ne-border-str) !important;
}
html[data-ui-theme="neutrine"] .settings-workspace-btn.active {
    background-color: var(--ne-navy) !important;
    color: #fff !important;
    border-color: var(--ne-navy) !important;
}

/* ── Переключатели ───────────────────────────────────────────────────────── */
html[data-ui-theme="neutrine"] .ios-toggle-slider,
html[data-ui-theme="neutrine"] .toggle-slider { background-color: #c3c7cb !important; }
html[data-ui-theme="neutrine"] .ios-toggle input:checked + .ios-toggle-slider,
html[data-ui-theme="neutrine"] .toggle-switch input:checked + .toggle-slider {
    background-color: var(--ne-navy) !important;
}
html[data-ui-theme="neutrine"] .fv-column h3 {
    background-color: var(--ne-strip) !important;
    color: var(--ne-text) !important;
    border-bottom-color: var(--ne-border) !important;
}
html[data-ui-theme="neutrine"] .fv-item {
    background-color: var(--ne-card) !important;
    border-color: var(--ne-border) !important;
    color: var(--ne-text) !important;
}
html[data-ui-theme="neutrine"] .fv-item:hover { background-color: var(--ne-strip) !important; }

/* ── Оверлеи ─────────────────────────────────────────────────────────────── */
html[data-ui-theme="neutrine"] .forti-dropdown,
html[data-ui-theme="neutrine"] .forti-dd-sub-menu,
html[data-ui-theme="neutrine"] .fortios-widget-menu {
    background-color: var(--ne-card) !important;
    color: var(--ne-text) !important;
    border: 1px solid var(--ne-border-str) !important;
    box-shadow: 0 6px 18px rgba(20,30,40,.16) !important;
}
html[data-ui-theme="neutrine"] .forti-dd-header {
    background-color: var(--ne-strip) !important;
    border-color: var(--ne-border) !important;
}
html[data-ui-theme="neutrine"] .forti-dd-device { color: var(--ne-text) !important; }
html[data-ui-theme="neutrine"] .forti-dd-version { color: var(--ne-text-2) !important; }
html[data-ui-theme="neutrine"] .forti-dd-item,
html[data-ui-theme="neutrine"] .fortios-widget-menu button { color: var(--ne-text) !important; }
html[data-ui-theme="neutrine"] .forti-dd-item:hover,
html[data-ui-theme="neutrine"] .fortios-widget-menu button:hover {
    background-color: var(--ne-strip) !important;
    color: var(--ne-text) !important;
}
html[data-ui-theme="neutrine"] .forti-dd-item.danger { color: var(--ne-red) !important; }
html[data-ui-theme="neutrine"] .modal { background-color: rgba(27,34,42,.35) !important; }
html[data-ui-theme="neutrine"] .modal-content {
    background-color: var(--ne-card) !important;
    color: var(--ne-text) !important;
    border-color: var(--ne-border-str) !important;
    box-shadow: 0 12px 32px rgba(20,27,34,.22) !important;
}
html[data-ui-theme="neutrine"] .modal-header,
html[data-ui-theme="neutrine"] .modal-footer,
html[data-ui-theme="neutrine"] .vpn-modal-footer {
    background-color: var(--ne-strip) !important;
    color: var(--ne-text) !important;
    border-color: var(--ne-border) !important;
}
html[data-ui-theme="neutrine"] .modal-body { background-color: var(--ne-card) !important; color: var(--ne-text) !important; }
html[data-ui-theme="neutrine"] .modal-header h2,
html[data-ui-theme="neutrine"] .modal-header h3 { color: var(--ne-text) !important; }
html[data-ui-theme="neutrine"] .modal-close { color: var(--ne-text-2) !important; }

/* ── Виджеты дашборда ────────────────────────────────────────────────────── */
html[data-ui-theme="neutrine"] .fortios-dashboard-overview { background-color: var(--ne-page) !important; }
html[data-ui-theme="neutrine"] .metric-card,
html[data-ui-theme="neutrine"] .metric-card.dashboard-widget,
html[data-ui-theme="neutrine"] .hs-panel,
html[data-ui-theme="neutrine"] .iface-monitor-panel,
html[data-ui-theme="neutrine"] .metrics-panel,
html[data-ui-theme="neutrine"] .forti-history-widget,
html[data-ui-theme="neutrine"] .iface-monitor-card,
html[data-ui-theme="neutrine"] .iface-card {
    background-color: var(--ne-card) !important;
    color: var(--ne-text) !important;
    border-color: var(--ne-border) !important;
    box-shadow: none !important;
}
html[data-ui-theme="neutrine"] .metric-card.dashboard-widget:hover { border-color: var(--ne-border-str) !important; }
html[data-ui-theme="neutrine"] .forti-history-head {
    background-color: var(--ne-strip) !important;
    color: var(--ne-text) !important;
    border-color: var(--ne-border) !important;
}
html[data-ui-theme="neutrine"] .forti-history-title,
html[data-ui-theme="neutrine"] .forti-history-meta,
html[data-ui-theme="neutrine"] .forti-history-caption { color: var(--ne-text-2) !important; }
html[data-ui-theme="neutrine"] .forti-history-body { background-color: var(--ne-card) !important; }
html[data-ui-theme="neutrine"] .forti-history-svg text { fill: var(--ne-text-2) !important; }
html[data-ui-theme="neutrine"] .forti-history-svg .grid line,
html[data-ui-theme="neutrine"] .forti-history-svg .grid-line { stroke: var(--ne-border) !important; }
html[data-ui-theme="neutrine"] .hs-resource {
    background-color: var(--ne-strip) !important;
    color: var(--ne-text) !important;
    border-color: var(--ne-border) !important;
}
html[data-ui-theme="neutrine"] .hs-title,
html[data-ui-theme="neutrine"] .hs-resource strong { color: var(--ne-text) !important; }
html[data-ui-theme="neutrine"] .metric-icon { background-color: var(--ne-strip) !important; color: var(--ne-navy) !important; }
html[data-ui-theme="neutrine"] .metric-label { color: var(--ne-text-2) !important; }
html[data-ui-theme="neutrine"] .metric-value { color: var(--ne-text) !important; }
html[data-ui-theme="neutrine"] .metric-drag-handle { color: var(--ne-disabled) !important; }
html[data-ui-theme="neutrine"] .wan-util-track { background-color: #e4e6e9 !important; }

/* ── Вывод команд, логи ──────────────────────────────────────────────────── */
html[data-ui-theme="neutrine"] pre,
html[data-ui-theme="neutrine"] .svc-output-box,
html[data-ui-theme="neutrine"] .settings-output,
html[data-ui-theme="neutrine"] .terminal-output,
html[data-ui-theme="neutrine"] .config-preview {
    background-color: #fbfbfb !important;
    color: var(--ne-text) !important;
    border-color: var(--ne-border) !important;
}
html[data-ui-theme="neutrine"] code {
    background-color: var(--ne-strip) !important;
    color: #294665 !important;
    border-color: var(--ne-border) !important;
}

/* ── Семантика состояний ─────────────────────────────────────────────────── */
html[data-ui-theme="neutrine"] .state-up,
html[data-ui-theme="neutrine"] .text-success { color: var(--ne-green) !important; }
html[data-ui-theme="neutrine"] .state-down,
html[data-ui-theme="neutrine"] .text-danger { color: var(--ne-red) !important; }
html[data-ui-theme="neutrine"] .state-unknown,
html[data-ui-theme="neutrine"] .text-warning { color: var(--ne-amber) !important; }
html[data-ui-theme="neutrine"] a { color: var(--ne-link) !important; }

/* ── Полосы прокрутки ────────────────────────────────────────────────────── */
html[data-ui-theme="neutrine"] ::-webkit-scrollbar { width: 10px; height: 10px; }
html[data-ui-theme="neutrine"] ::-webkit-scrollbar-track { background: var(--ne-shell); }
html[data-ui-theme="neutrine"] ::-webkit-scrollbar-thumb {
    background: #c6cace; border-radius: 5px; border: 2px solid var(--ne-shell);
}
html[data-ui-theme="neutrine"] ::-webkit-scrollbar-thumb:hover { background: #a9aeb3; }

@media (prefers-reduced-motion: reduce) {
    html[data-ui-theme="neutrine"] *,
    html[data-ui-theme="neutrine"] *::before,
    html[data-ui-theme="neutrine"] *::after { transition: none !important; animation: none !important; }
}

/* Переключатели .switch в светлой теме. */
html[data-ui-theme="neutrine"] .switch .slider { background-color: #c3c7cb !important; border-color: #b4b9be !important; }
html[data-ui-theme="neutrine"] .switch .slider:before { background-color: #fbfcfa !important; }
html[data-ui-theme="neutrine"] .switch input:checked + .slider { background-color: var(--ne-navy) !important; border-color: var(--ne-navy) !important; }
html[data-ui-theme="neutrine"] .fortios-ref-toggleline .switch input:checked + .slider { background-color: var(--ne-red) !important; border-color: var(--ne-red) !important; }

/* v14.51 — новые блоки BGP, модалка соседа и панель фильтров логов. */
html[data-ui-theme="neutrine"] .fbn-item .fbn-x,
html[data-ui-theme="neutrine"] .fbn-col .fbn-add {
    background-color: var(--ne-field) !important; color: var(--ne-text-2) !important; border-color: var(--ne-border-str) !important;
}
html[data-ui-theme="neutrine"] .fbn-item .fbn-x:hover,
html[data-ui-theme="neutrine"] .fbn-col .fbn-add:hover { background-color: var(--ne-strip-hover) !important; color: var(--ne-text) !important; }
html[data-ui-theme="neutrine"] .fbn-label,
html[data-ui-theme="neutrine"] .fbr-row,
html[data-ui-theme="neutrine"] .fnb-row > label { color: var(--ne-text) !important; }
html[data-ui-theme="neutrine"] .fnb-strip {
    background-color: var(--ne-strip) !important; color: var(--ne-text) !important; border-color: var(--ne-border) !important;
}
html[data-ui-theme="neutrine"] .forti-log-toolbar {
    background-color: var(--ne-strip) !important; border-color: var(--ne-border) !important;
}
html[data-ui-theme="neutrine"] .forti-log-toolbar .flt-icon {
    background-color: var(--ne-field) !important; color: var(--ne-text-2) !important; border-color: var(--ne-border-str) !important;
}
html[data-ui-theme="neutrine"] .forti-log-toolbar .flt-icon:hover { background-color: var(--ne-strip-hover) !important; color: var(--ne-text) !important; }
html[data-ui-theme="neutrine"] .forti-log-toolbar .flt-search {
    background-color: var(--ne-field) !important; border-color: var(--ne-border-str) !important;
}
html[data-ui-theme="neutrine"] .forti-log-toolbar .flt-search input { color: var(--ne-text) !important; }

/* v14.49.2RC-NFT — Local In Policy и Recent decisions в светлой теме. */
html[data-ui-theme="neutrine"] .localin-group-row td,
html[data-ui-theme="neutrine"] .iface-group-row td {
    background-color: var(--ne-navy) !important; color: #fff !important; border-color: var(--ne-navy) !important;
}
html[data-ui-theme="neutrine"] .li-tag {
    background-color: var(--ne-strip) !important; color: var(--ne-text-2) !important; border-color: var(--ne-border) !important;
}
html[data-ui-theme="neutrine"] .localin-meta { color: var(--ne-text-2) !important; }
html[data-ui-theme="neutrine"] #appctl-decisions-tbody .security-host-link {
    color: #2b4a6f !important; text-decoration-color: rgba(43, 74, 111, .35);
}
html[data-ui-theme="neutrine"] #appctl-decisions-tbody .security-host-link:hover { color: #14293f !important; }

/* v14.49.3RC — сетка Status, полосы групп политик и Local In в светлой теме. */
html[data-ui-theme="neutrine"] .fortios-dashboard-overview .dashboard-widget-grid {
    background-color: var(--ne-border) !important; border-color: var(--ne-border) !important;
}
html[data-ui-theme="neutrine"] .fortios-dashboard-overview .dashboard-widget-grid .metric-card {
    background-color: var(--ne-card) !important;
}
html[data-ui-theme="neutrine"] .fortios-dashboard-overview .dashboard-widget-grid .metric-card:hover {
    background-color: var(--ne-strip) !important;
}
html[data-ui-theme="neutrine"] .pol-group-head {
    background-color: var(--ne-navy) !important; border-color: var(--ne-navy) !important;
}
html[data-ui-theme="neutrine"] .pol-group-head:hover { background-color: var(--ne-navy-hover) !important; }
html[data-ui-theme="neutrine"] .localin-row.selected td { background-color: #dfe6f0 !important; }

/* v14.66.1 — Local In Policy в светлой теме. */
html[data-ui-theme="neutrine"] .li-ord button,
html[data-ui-theme="neutrine"] .li-pick input {
    background-color: var(--ne-card) !important; color: var(--ne-text-2) !important;
    border-color: var(--ne-border-str) !important;
}
html[data-ui-theme="neutrine"] .li-ord button:hover { background-color: var(--ne-strip-hover) !important; }
html[data-ui-theme="neutrine"] .seg-mode { border-color: var(--ne-border-str) !important; }
html[data-ui-theme="neutrine"] .seg-mode button { color: var(--ne-text-2) !important; }
html[data-ui-theme="neutrine"] .seg-mode button.on {
    background-color: var(--ne-navy) !important; color: #fff !important;
}
html[data-ui-theme="neutrine"] .li-chips {
    background-color: var(--ne-field) !important; border-color: var(--ne-border-str) !important;
}
html[data-ui-theme="neutrine"] .li-chip {
    background-color: var(--ne-strip) !important; border-color: var(--ne-border) !important;
    color: var(--ne-text) !important;
}
html[data-ui-theme="neutrine"] .li-drop {
    background-color: var(--ne-field) !important; border-color: var(--ne-border-str) !important;
    box-shadow: 0 6px 18px rgba(20,30,40,.16) !important;
}
html[data-ui-theme="neutrine"] .li-drop div:hover { background-color: var(--ne-strip) !important; }
html[data-ui-theme="neutrine"] .li-sum {
    background-color: #fbfbfb !important; border-color: var(--ne-border) !important;
    border-left-color: var(--ne-link) !important; color: var(--ne-text) !important;
}

/* v19.13: базовые токены светлой геометрии — тоже без чистого белого */
html[data-ui-theme="neutrine"][data-theme="light"] {
    --bg-primary: var(--ne-page); --bg-secondary: var(--ne-card); --bg-tertiary: var(--ne-strip);
    --bg-elevated: var(--ne-card); --bg-input: var(--ne-field); --bg-rail: var(--ne-shell); --bg-topbar: var(--ne-card);
    --accent: var(--ne-link);
}
html[data-ui-theme="neutrine"] .forti-history-widget { background: var(--ne-card) !important; border-color: var(--ne-border-str) !important; }
html[data-ui-theme="neutrine"] .forti-widget-select option { background: var(--ne-field) !important; color: var(--ne-text) !important; }
html[data-ui-theme="neutrine"] .tab-content, html[data-ui-theme="neutrine"] .main-content { background-color: var(--ne-page) !important; }
