* { box-sizing: border-box; }
body { font-family: "Segoe UI", Arial, sans-serif; margin: 0; background: #ffffff; font-size: 13px; color: #000000; }

/* Полосы прокрутки — всегда видимые, в стиле интерфейса.
   Собственные ::-webkit-scrollbar отключают «плавающие» полосы Windows 11,
   которые появляются только при наведении или во время прокрутки. */
::-webkit-scrollbar { width: 14px; height: 14px; background: #f0f0f0; }
::-webkit-scrollbar-track { background: #f0f0f0; }
::-webkit-scrollbar-thumb { background: #000000; border: 3px solid #f0f0f0; }
::-webkit-scrollbar-thumb:hover { background: #444444; }
::-webkit-scrollbar-corner { background: #f0f0f0; }

#toolbar { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 8px; background: #ffffff; color: #000000; border-bottom: 1px solid #000000; position: sticky; top: 0; z-index: 50; }

/* Баннер TurboFlyERP.ru (флаг «Грузить Баннер» в «Параметрах») */
.tf-banner { display: block; }
.tf-banner-link { position: relative; display: flex; align-items: center; gap: 14px;
  padding: 9px 16px; text-decoration: none; color: #fff; overflow: hidden;
  background: linear-gradient(90deg, #0d47a1, #1565c0 60%, #1e88e5); }
.tf-banner-mark { font-weight: 800; font-size: 17px; letter-spacing: .4px;
  white-space: nowrap; }
.tf-banner-text { font-size: 12px; opacity: .92; white-space: nowrap; }
.tf-banner-cta { margin-left: auto; font-size: 12px; white-space: nowrap;
  border: 1px solid rgba(255,255,255,.75); padding: 3px 9px; border-radius: 3px; }
.tf-banner-img { position: absolute; right: 0; top: 0; height: 100%; max-height: 46px;
  opacity: .28; pointer-events: none; }
.tf-banner-link > span { position: relative; z-index: 1; }
@media (max-width: 760px) { .tf-banner-text { display: none; } }
.tb-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; flex: 1 0 100%; }
#toolbar label { font-size: 12px; font-weight: 600; }
#toolbar select, #toolbar input, #toolbar button { padding: 4px 8px; border-radius: 0; border: 1px solid #000000; background: #ffffff; color: #000000; font-size: 12px; cursor: pointer; }
#toolbar button:hover { background: #000000; color: #ffffff; }
.btn-acc { background: #000000 !important; color: #ffffff !important; font-weight: bold; }
.btn-warn { background: #333333 !important; color: #ffffff !important; }
.btn-ai { background: #000000 !important; color: #ffffff !important; font-weight: bold; padding: 4px 12px !important; margin-left: auto !important; }
.btn-ai:hover { background: #333333 !important; color: #ffffff !important; }
.btn-ai.active { background: #333333 !important; box-shadow: inset 0 0 0 2px #ffffff; }
.btn-help { background: #ffffff !important; color: #000000 !important; font-weight: bold; padding: 4px 10px !important; }
.btn-help:hover { background: #000000 !important; color: #ffffff !important; }

#toasts { position: fixed; right: 12px; top: 52px; z-index: 9999; display: flex; flex-direction: column; gap: 6px; max-width: 480px; pointer-events: none; }
.toast { padding: 10px 14px; border-radius: 0; border: 1px solid #000000; color: #000000; background: #ffffff; box-shadow: 4px 4px 0 rgba(0,0,0,1); font-size: 12px; font-weight: 600; }

.tabs { display: flex; gap: 0; background: #ffffff; border-bottom: 1px solid #000000; flex-wrap: wrap; }
.tab { padding: 8px 16px; background: #ffffff; color: #000000; cursor: pointer; font-size: 12px; user-select: none; border: 1px solid #000000; border-bottom: none; margin-bottom: -1px; }
.tab:hover { background: #e0e0e0; }
.tab.active { background: #000000; color: #ffffff; font-weight: bold; }
.tab .badge { background: #ffffff; color: #000000; padding: 1px 6px; border-radius: 0; font-size: 10px; margin-left: 4px; border: 1px solid #000000; }

.tab-content { display: none; padding: 8px; }
.tab-content.active { display: block; }

.panel { background: #ffffff; border: 1px solid #000000; border-radius: 0; margin-bottom: 8px; }
.panel-h { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 4px; padding: 6px 10px; background: #f0f0f0; border-bottom: 1px solid #000000; font-weight: 600; }
.panel-b { padding: 8px; overflow: auto; }

#logPanel .panel-b { max-height: 400px; background: #ffffff; color: #000000; font-family: Consolas, monospace; font-size: 11px; white-space: pre-wrap; border: 1px solid #000000; }
/* Строка лога: время, сообщение и подпись «длительность · токены» (v7.10.25) */
#logPanel .panel-b .log-line { white-space: pre-wrap; }
.log-line .log-time { color: #777; }
.log-line .log-meta { color: #555; }
body.skin-dark .log-line .log-time { color: #9a9a9a; }
body.skin-dark .log-line .log-meta { color: #b0b0b0; }
#errorsPanel .panel-b { max-height: 400px; cursor: default; }
.err-item { padding: 4px 8px; margin: 2px 0; border-radius: 0; border: 1px solid #000000; font-size: 12px; }
.err-item.e { background: #ffffff; color: #000000; border-left: 4px solid #000000; }
.err-item.w { background: #f0f0f0; color: #000000; border-left: 4px solid #666666; }
.err-item.i { background: #e3f2fd; color: #0d47a1; border-left: 4px solid #1a73e8; }

table { border-collapse: collapse; width: 100%; }
th, td { border: 1px solid #000000; padding: 4px 6px; font-size: 12px; text-align: left; }
th { background: #f0f0f0; font-weight: bold; }
th.sortable { cursor: pointer; user-select: none; }
th.sortable:hover { background: #e0e7ef; }
th.sort-asc::after { content: ' ▲'; font-size: 10px; }
th.sort-desc::after { content: ' ▼'; font-size: 10px; }
#opsTableWrap td, #opsTableWrap th { white-space: nowrap; }

#bufferZone { min-height: 46px; border: 2px dashed #000000; border-radius: 0; padding: 6px; background: #ffffff; }
.buf-chip { display: inline-flex; gap: 6px; align-items: center; background: #ffffff; border: 1px solid #000000; border-radius: 0; padding: 3px 10px; margin: 2px; font-size: 12px; cursor: grab; }
.buf-chip button { cursor: pointer; border: 1px solid #000000; background: #ffffff; color: #000000; border-radius: 0; padding: 1px 6px; font-weight: bold; }
.buf-chip button:hover { background: #000000; color: #ffffff; }

#ganttWrap, #eqWrap, #scheduleWrap { overflow: auto; overflow-x: scroll; position: relative; }

.gheader { display: flex; border-bottom: 1px solid #000000; height: 24px; background: #ffffff; }
.gheader-label { flex: 0 0 280px; padding: 8px 6px; font-size: 11px; font-weight: 600; border-right: 1px solid #000000; background: #f0f0f0; text-align: center; position: sticky; left: 0; z-index: 20; box-shadow: 2px 0 4px rgba(0,0,0,0.15); word-wrap: break-word; white-space: normal; line-height: 1.3; min-height: 34px; }
.gheader-axis { position: relative; height: 24px; background: #ffffff; }

.gaxis { position: sticky; top: 0; background: #ffffff; z-index: 5; border-bottom: 1px solid #000000; height: 24px; margin-left: 0; padding-left: 6px; }
.gtick { position: absolute; top: 2px; font-size: 10px; color: #000000; border-left: 1px solid #000000; padding-left: 4px; padding-right: 12px; white-space: nowrap; font-weight: 600; line-height: 20px; overflow: visible; min-width: 120px; z-index: 10; }
.grow { display: flex; border-bottom: 1px solid #000000; min-height: 34px; }
.glabel { flex: 0 0 280px; padding: 8px 6px; font-size: 11px; background: #ffffff; border-right: 1px solid #000000; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; position: sticky; left: 0; z-index: 20; font-weight: 600; box-shadow: 2px 0 4px rgba(0,0,0,0.15); line-height: 1.3; min-height: 34px; }
#ganttWrap.ml .glabel { white-space: normal; text-overflow: clip; word-wrap: break-word; }
.gtrack { position: relative; background: #ffffff; flex: 1; }

.gblock { position: absolute; top: 5px; height: 24px; border-radius: 4px; background: #64b5f6; border: 1px solid #1976d2; color: #06263f; font-size: 10px; overflow: hidden; cursor: grab; user-select: none; padding: 0 3px; line-height: 22px; font-weight: 600; z-index: 6; }
.gblock:hover { filter: brightness(1.08); }
.reconf-seg { position: absolute; top: 0; bottom: 0; background: #86a4cc; opacity: 1; pointer-events: none; z-index: 1; border-radius: 3px 0 0 3px; }
.gblock .opnum { position: relative; z-index: 2; }
/* Название операции рисуется поверх сегмента переналадки, чтобы подпись читалась */
.gblock .gname { position: relative; z-index: 2; }
/* На красном/зелёном блоке подпись белая — там сегмент остаётся тёмным */
.gblock.done .reconf-seg, .gblock.overdue .reconf-seg { background: #2f5596; }
.gblock.nowc { background: #ffb74d !important; border-color: #ef6c00 !important; color: #3e2723 !important; }
.gblock.fixed { outline: 2px solid #e91e63; outline-offset: -2px; }
.gblock.overdue { background: #ef5350 !important; border-color: #b71c1c !important; color: #fff !important; }
.gblock.done { background: #66bb6a !important; border-color: #2e7d32 !important; color: #fff !important; }
.gblock.changed { border-color: #ff9800 !important; border-width: 2px !important; }
.gblock .opnum { display: inline-block; min-width: 12px; text-align: center; background: rgba(255,255,255,.6); border-radius: 3px; font-weight: 600; margin-right: 4px; }

.now-line { position: absolute; top: 0; width: 2px; background: #e91e63; z-index: 15; pointer-events: none; box-shadow: 0 0 4px rgba(233,30,99,0.6); }

.downtime-overlay { position: absolute; top: 0; height: 100%; background: repeating-linear-gradient(45deg, rgba(239,83,80,0.25), rgba(239,83,80,0.25) 6px, rgba(183,28,28,0.35) 6px, rgba(183,28,28,0.35) 12px); z-index: 1; pointer-events: none; }
.orig-marker { position: absolute; top: -2px; width: 0; height: 0; border-left: 5px solid transparent; border-right: 5px solid transparent; border-top: 7px solid #ff9800; z-index: 12; pointer-events: none; }

.dep-svg { position: absolute; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none; z-index: 5; overflow: visible; }
.dep-svg path { stroke: #607d8b; stroke-width: 1.2; fill: none; stroke-dasharray: 3,3; }
.dep-svg .arr { fill: #607d8b; }

.techdep-svg { position: absolute; top: 0; left: 0; pointer-events: none; z-index: 4; overflow: visible; }
.techdep-svg path { stroke: #e65100; stroke-width: 1.6; fill: none; opacity: 0.85; }
.techdep-svg .arr { fill: #e65100; opacity: 0.85; }

.opdep-svg { position: absolute; top: 0; left: 0; pointer-events: none; z-index: 3; overflow: visible; }
.opdep-svg path { stroke-width: 1.4; fill: none; opacity: 0.8; }
.opdep-svg .arr { opacity: 0.8; }

.eqday { position: absolute; top: 5px; height: 24px; border-radius: 3px; background: #fff; border: 1px solid #e0e0e0; cursor: pointer; font-size: 9px; color: #333; text-align: center; line-height: 22px; font-weight: bold; }
.eqday.free { background: #c8e6c9; border-color: #a5d6a7; }
.eqday.part { background: #ffecb3; border-color: #ffe082; }
.eqday.full { background: #ffcdd2; border-color: #ef9a9a; }
.eqday.over { background: #ef5350; border-color: #c62828; color: #fff; }
.eqop { position: absolute; top: 7px; height: 20px; background: #64b5f6; border: 1px solid #1976d2; border-radius: 3px; color: #06263f; font-size: 9px; line-height: 18px; text-align: center; cursor: pointer; overflow: hidden; }
.eqop:hover { filter: brightness(1.1); }
/* Статусы операций — те же цвета, что в Ганте и в общей легенде */
.eqop.nowc { background: #ffb74d; border-color: #ef6c00; color: #3e2723; }
.eqop.overdue { background: #ef5350; border-color: #b71c1c; color: #fff; }
.eqop.done { background: #66bb6a; border-color: #2e7d32; color: #fff; }
.eqop.changed { border: 2px solid #ff9800; }
.eqreconf { position: absolute; left: 0; top: 0; bottom: 0; background: #86a4cc; opacity: 1; border-radius: 2px 0 0 2px; pointer-events: none; }
.eqop .eqnum { position: relative; z-index: 2; }
.eqop.done .eqreconf, .eqop.overdue .eqreconf { background: #2f5596; }

.lg { display: inline-flex; align-items: center; gap: 3px; font-weight: 400; font-size: 11px; color: #37474f; }
.sw { width: 12px; height: 12px; border-radius: 2px; display: inline-block; border: 1px solid #90a4ae; }
.sw.op { background: #64b5f6; border-color: #1976d2; }
.sw.free { background: #c8e6c9; } .sw.part { background: #ffecb3; } .sw.full { background: #ffcdd2; } .sw.over { background: #ef5350; border-color: #c62828; }
.sw.nowork { background: #fff; }
.sw.overdue { background: #ef5350; border-color: #b71c1c; }
.sw.nowc { background: #ffb74d; border-color: #ef6c00; }
.sw.done { background: #66bb6a; border-color: #2e7d32; }
.sw.changed { background: #fff; border: 2px solid #ff9800; }
.sw.downtime { background: repeating-linear-gradient(45deg, #ef5350, #ef5350 3px, #fff 3px, #fff 6px); }
.sw.reconf { background: #86a4cc; border-color: #0c3d91; }
/* Бейдж статуса операции в «ТехКартах» */
.tcStatusCell { white-space: nowrap; }
/* Подсветка строк «Календаря» и «ТехКарт» по статусу — цвета как в общей легенде */
#opsTable tr.row-done > td, #techWrap tr.row-done > td { background: #e8f5e9; }
#opsTable tr.row-overdue > td, #techWrap tr.row-overdue > td { background: #ffe5e5; }
#opsTable tr.row-nowc > td, #techWrap tr.row-nowc > td { background: #fff3e0; }
#opsTable tr.row-changed > td, #techWrap tr.row-changed > td { background: #fff7e0; }
#opsTable tr.row-done > td:first-child, #techWrap tr.row-done > td:first-child { box-shadow: inset 4px 0 0 #2e7d32; }
#opsTable tr.row-overdue > td:first-child, #techWrap tr.row-overdue > td:first-child { box-shadow: inset 4px 0 0 #ef5350; }
#opsTable tr.row-nowc > td:first-child, #techWrap tr.row-nowc > td:first-child { box-shadow: inset 4px 0 0 #ef6c00; }
#opsTable tr.row-changed > td:first-child, #techWrap tr.row-changed > td:first-child { box-shadow: inset 4px 0 0 #ff9800; }
.st-badge { display: inline-block; padding: 1px 6px; border-radius: 3px; border: 1px solid #90a4ae; font-size: 10px; font-weight: 600; white-space: nowrap; }
/* Цвета бейджа «Статус» — как в легенде: красный / зелёный / оранжевый */
.st-badge.st-overdue { background: #ef5350; border-color: #b71c1c; color: #fff; }
.st-badge.st-done { background: #66bb6a; border-color: #2e7d32; color: #fff; }
.st-badge.st-nowc { background: #ffb74d; border-color: #ef6c00; color: #3e2723; }
.st-badge.st-work { background: #e3f2fd; border-color: #1976d2; color: #0d47a1; }
.st-badge.st-wait { background: #f5f5f5; border-color: #b0bec5; color: #455a64; }
.st-badge.st-none { background: #fff; border-color: #cfd8dc; color: #90a4ae; }

#popup, #ctxMenu { position: fixed; z-index: 9999; background: #ffffff; border: 1px solid #000000; border-radius: 0; box-shadow: 6px 6px 0 rgba(0,0,0,1); display: none; font-size: 12px; }
#popup { padding: 10px; max-width: 420px; max-height: calc(100vh - 20px); overflow: auto; }
/* Всплывающая подсказка при наведении — то же содержимое, что в окне операции, без кнопок */
#opTip { position: fixed; z-index: 9998; background: #ffffff; border: 1px solid #000000; border-radius: 0; box-shadow: 6px 6px 0 rgba(0,0,0,1); display: none; font-size: 12px; padding: 10px; max-width: 420px; pointer-events: none; }
#opTip h4 { margin: 0 0 6px 0; border-bottom: 1px solid #000000; padding-bottom: 4px; }
#ctxMenu { padding: 4px 0; min-width: 180px; }
#ctxMenu div { padding: 8px 16px; cursor: pointer; font-weight: 600; }
#ctxMenu div:hover { background: #000000; color: #ffffff; }
#popup h4 { margin: 0 0 6px 0; border-bottom: 1px solid #000000; padding-bottom: 4px; }
#popup button { margin: 2px; padding: 4px 8px; border-radius: 0; border: 1px solid #000000; background: #ffffff; cursor: pointer; font-weight: 600; }
#popup button:hover { background: #000000; color: #ffffff; }
#popup select { width: 100%; padding: 6px; border: 1px solid #000000; border-radius: 0; margin: 6px 0; font-size: 12px; }
#popup .pp-wc-row { display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 2px 0; border-bottom: 1px dotted #dddddd; }
#popup .pp-wc-row:last-child { border-bottom: 0; }
#popup .pp-wc-del { margin: 0 !important; padding: 0 6px !important; line-height: 18px; font-weight: 700; }
#popup #ppWcAdd { flex: 1; min-width: 120px; }
.pp-bom, .pp-hist { width: 100%; border-collapse: collapse; font-size: 11px; margin-top: 3px; }
.pp-bom th, .pp-hist th { font-weight: 600; text-align: left; border-bottom: 1px solid #dddddd; padding: 2px 3px; white-space: nowrap; }
.pp-bom td, .pp-hist td { padding: 2px 3px; border-bottom: 1px dotted #eeeeee; vertical-align: top; }
.pp-bom td.num, .pp-hist td.num { text-align: right; white-space: nowrap; }
.pp-bom td.short, .pp-hist td.short { color: #b71c1c; font-weight: 700; }
.pp-hist-wrap { max-height: 240px; overflow: auto; }

.hint-panel { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; background: #ffffff; border: 1px solid #000000; padding: 10px 14px; border-radius: 0; margin: 8px; font-size: 12px; line-height: 1.5; }

.sched-op { background: #bbdefb; border: 1px solid #90caf9; border-radius: 3px; padding: 2px 4px; margin-bottom: 2px; font-size: 10px; cursor: pointer; }
.sched-op.fixed { background: #f8bbd0; border-color: #f48fb1; }
.sched-op.nowc { background: #ffb74d; border-color: #ef6c00; }
/* Статусы операций — те же цвета, что в Ганте и в общей легенде */
.sched-op.overdue { background: #ef5350; border-color: #b71c1c; color: #fff; }
.sched-op.done { background: #66bb6a; border-color: #2e7d32; color: #fff; }
.sched-op.changed { border: 2px solid #ff9800; }

.dropdown-menu { display: none; position: absolute; top: 100%; left: 0; background: #ffffff; border: 1px solid #000000; padding: 6px; z-index: 100; min-width: 250px; max-height: 300px; overflow-y: auto; }
.dropdown-menu label { font-weight: normal; font-size: 12px; }
.dropdown-menu input[type="checkbox"] { margin-right: 4px; }
.dropdown-menu .search-input { width: 100%; padding: 2px 4px; border: 1px solid #000000; margin-bottom: 4px; font-size: 12px; }
.filter-item { display: flex; align-items: center; }

.tech-info-btn { margin-left: auto; padding: 0 5px; cursor: pointer; color: #555; font-size: 12px; user-select: none; }
.tech-info-btn:hover { color: #000; background: #eee; }

#aiChatPanel { display: none; position: fixed; right: 10px; top: 55px; width: 560px; max-width: calc(100vw - 24px); max-height: 78vh; background: #fff; border: 1px solid #000000; border-radius: 0; box-shadow: 4px 4px 0 rgba(0,0,0,1); z-index: 1000; flex-direction: column; }
#aiChatHeader { display: flex; justify-content: space-between; align-items: center; padding: 10px; background: #f0f0f0; border-bottom: 1px solid #000000; font-weight: 600; cursor: move; }
#aiChatMessages { height: 430px; max-height: 64vh; overflow-y: auto; padding: 10px; background: #ffffff; font-size: 12px; line-height: 1.5; }
.ai-message { margin: 8px 0; padding: 10px; border-radius: 0; border: 1px solid #000000; max-width: 90%; word-wrap: break-word; overflow-wrap: break-word; white-space: pre-wrap; font-size: 12px; line-height: 1.5; }
.ai-message.user { background: #f0f0f0; margin-left: auto; text-align: left; white-space: pre-wrap; }
.ai-message.assistant { background: #fff; margin-right: auto; text-align: left; max-width: 100%; }
.ai-message.assistant.ai-md { white-space: normal; }
.ai-md p { margin: 4px 0; }
.ai-md h3, .ai-md h4, .ai-md h5, .ai-md h6 { margin: 8px 0 4px; line-height: 1.25; }
.ai-md h3 { font-size: 15px; } .ai-md h4 { font-size: 14px; }
.ai-md h5 { font-size: 13px; } .ai-md h6 { font-size: 12px; }
.ai-md ul, .ai-md ol { margin: 4px 0 4px 18px; padding: 0; }
.ai-md li { margin: 2px 0; }
.ai-md code { background: #f2f2f2; border: 1px solid #ddd; padding: 0 3px; font-family: Consolas, monospace; font-size: 11px; }
.ai-md a.ai-help-link { color: #0b57d0; font-weight: 600; text-decoration: underline; }
.ai-md a.ai-help-link:hover { background: #e8f0fe; }
.ai-md pre.ai-pre { background: #f7f7f7; border: 1px solid #ddd; padding: 6px 8px; margin: 6px 0; overflow-x: auto; white-space: pre; }
.ai-md blockquote { border-left: 3px solid #999; margin: 6px 0; padding: 2px 8px; color: #444; background: #fafafa; }
.ai-md hr { border: 0; border-top: 1px solid #ddd; margin: 8px 0; }
/* Подпись под ответом ИИ: израсходованные ИИ-токены и длительность ответа (v7.10.24) */
.ai-usage { margin-top: 6px; padding-top: 5px; border-top: 1px dashed #d6d6d6;
  font-size: 11px; line-height: 1.4; color: #666; white-space: normal;
  font-variant-numeric: tabular-nums; }
body.skin-dark .ai-usage { border-top-color: #444; color: #aaa; }
.ai-table-wrap { overflow-x: auto; margin: 6px 0; border: 1px solid #ddd; }
.ai-table { width: 100%; border-collapse: collapse; font-size: 11px; line-height: 1.35; }
.ai-table th, .ai-table td { border-bottom: 1px solid #eee; padding: 3px 5px; vertical-align: top; }
.ai-table th { background: #f3f4f6; font-weight: 600; }
.ai-table tbody tr:nth-child(even) { background: #fafafa; }
.ai-table td.ai-heat { background: hsl(var(--ai-heat) 75% 90%); }
.ai-val { display: block; font-weight: 600; white-space: nowrap; }
.ai-cellbar { display: block; height: 3px; background: #e5e7eb; margin-top: 2px; }
.ai-cellbar i { display: block; height: 100%; background: hsl(var(--ai-heat) 65% 45%); }
.ai-table caption { caption-side: top; text-align: left; font-weight: 600; padding: 4px; background: #f7f7f7; }
.ai-chart { border: 1px solid #ddd; padding: 6px 8px; margin: 6px 0; background: #fafafa; }
.ai-chart-title { font-weight: 600; margin-bottom: 4px; }
.ai-chart-row { display: flex; align-items: center; gap: 6px; margin: 2px 0; font-size: 11px; }
.ai-chart-label { width: 40%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ai-chart-track { flex: 1; height: 9px; background: #e5e7eb; }
.ai-chart-track i { display: block; height: 100%; background: #1a73e8; }
.ai-chart-val { width: 48px; text-align: right; font-variant-numeric: tabular-nums; }
#aiChatInput { padding: 10px; background: #fff; border-top: 1px solid #000000; display: flex; gap: 8px; }
#aiChatInput input { flex: 1; padding: 8px; border: 1px solid #000000; border-radius: 0; font-size: 13px; }
#aiChatInput button { padding: 8px 16px; background: #000000; color: #fff; border: none; border-radius: 0; cursor: pointer; font-weight: 600; }
#aiChatInput button:hover { background: #333333; }

#balancePopup { display:none; position:fixed; top:50%; left:50%; transform:translate(-50%,-50%); background:#fff; border:1px solid #000; padding:20px; z-index:10000; min-width:380px; width:820px; max-width:calc(100vw - 24px); box-shadow:6px 6px 0 rgba(0,0,0,1); }
#balancePopup h3 { margin:0 0 12px 0; border-bottom:1px solid #000; padding-bottom:6px; }
#balancePopup label { font-weight:600; }
#balancePopup input[type=range] { width:100%; margin:4px 0 8px; }
#balancePopup .val { float:right; }

#highsPopup { display:none; position:fixed; top:50%; left:50%; transform:translate(-50%,-50%); background:#fff; border:1px solid #000; padding:20px; z-index:10001; min-width:560px; max-width:90vw; max-height:90vh; overflow:auto; box-shadow:6px 6px 0 rgba(0,0,0,1); }
#paramsPopup { display:none; position:fixed; top:50%; left:50%; transform:translate(-50%,-50%); background:#fff; border:1px solid #000; padding:20px; z-index:10003; min-width:620px; max-width:90vw; max-height:90vh; overflow:auto; box-shadow:6px 6px 0 rgba(0,0,0,1); }
#paramsPopup h3 { margin:0 0 12px 0; border-bottom:1px solid #000; padding-bottom:6px; }
#paramsPopup label { display:block; font-weight:600; font-size:12px; }
#paramsPopup input, #paramsPopup select { width:100%; padding:4px 6px; border:1px solid #000; font-size:12px; margin-top:2px; }
#paramsPopup .grid { display:grid; grid-template-columns:1fr 1fr; gap:10px 14px; }
#highsPopup h3 { margin:0 0 12px 0; border-bottom:1px solid #000; padding-bottom:6px; }
#highsPopup label { display:block; font-weight:600; font-size:12px; }
#highsPopup input, #highsPopup select { width:100%; padding:4px 6px; border:1px solid #000; font-size:12px; margin-top:2px; }
#highsPopup .grid { display:grid; grid-template-columns:1fr 1fr; gap:10px 14px; }
#hPreview { background:#f5f5f5; border:1px solid #000; padding:8px; font-size:11px; font-family:Consolas, monospace; white-space:pre; margin-top:10px; }

#completeDialog { display:none; position:fixed; top:50%; left:50%; transform:translate(-50%,-50%); background:#fff; border:1px solid #000; padding:20px; z-index:10002; min-width:520px; max-width:90vw; max-height:85vh; overflow:auto; box-shadow:6px 6px 0 rgba(0,0,0,1); }
#completeDialog h3 { margin:0 0 12px 0; border-bottom:1px solid #000; padding-bottom:6px; }
#completeDialog p { margin:8px 0; font-size:13px; }
#completeDialog ul { margin:8px 0; padding-left:20px; font-size:12px; line-height:1.6; }
#completeDialog li { margin:2px 0; }
#completeDialog .cd-item { padding:4px 8px; border-left:3px solid #ff9800; background:#fff7e0; margin:3px 0; list-style:none; }
#completeDialog .cd-item b { color:#000; }

#helpContent { max-width: 1100px; margin: 0 auto; padding: 12px; line-height: 1.55; font-size: 13px; }
#helpContent h1 { font-size: 20px; margin: 4px 0 12px; border-bottom: 2px solid #000; padding-bottom: 6px; }
#helpContent h2 { font-size: 16px; margin: 20px 0 8px; border-bottom: 1px solid #000; padding-bottom: 4px; }
#helpContent h3 { font-size: 14px; margin: 14px 0 6px; }
#helpContent p { margin: 6px 0; }
#helpContent ul, #helpContent ol { margin: 6px 0 6px 20px; padding: 0; }
#helpContent li { margin: 3px 0; }
#helpContent code { background: #f0f0f0; border: 1px solid #ddd; padding: 1px 5px; font-family: Consolas, monospace; font-size: 12px; }
#helpContent pre { background: #f5f5f5; border: 1px solid #ddd; padding: 8px; overflow-x: auto; }
#helpContent table.help-tbl { width: 100%; margin: 8px 0 12px; border-collapse: collapse; }
#helpContent table.help-tbl th, #helpContent table.help-tbl td { border: 1px solid #000; padding: 5px 8px; font-size: 12px; vertical-align: top; }
#helpContent table.help-tbl th { background: #f0f0f0; }
#helpContent .need-input { display: inline-block; margin-top: 6px; padding: 3px 8px;
  border-left: 3px solid #d97706; background: #fff7e6; color: #7c2d12;
  border-radius: 3px; line-height: 1.45; }
#helpContent .need-input b { color: #b45309; }
#helpContent .box { border: 1px solid #000; background: #fafafa; padding: 10px 14px; margin: 10px 0; }
#helpContent .box.info { background: #e3f2fd; border-left: 4px solid #1a73e8; }
#helpContent .box.warn { background: #fff7e0; border-left: 4px solid #b8860b; }
#helpContent .toc { border: 1px solid #000; background: #fafafa; padding: 10px 14px; }
#helpContent .toc a { color: #000; text-decoration: underline; }
#helpContent .toc a:hover { background: #000; color: #fff; text-decoration: none; }
/* Раздел справки «Отчетность»: каталог отчётов и переходы */
.rep-table-wrap { overflow-x: auto; margin: 6px 0 14px; }
.rep-catalog { width: 100%; border-collapse: collapse; font-size: 12px; }
.rep-catalog th, .rep-catalog td { border: 1px solid #ccc; padding: 5px 8px;
  vertical-align: top; text-align: left; }
.rep-catalog thead th { background: #f0f0f0; font-weight: 600; }
.rep-catalog td:first-child { width: 27%; font-weight: 600; }
/* «Переход» — предпоследний столбец; последний — флаг «Отключить» (добавляет app.js) */
.rep-catalog td:nth-last-child(2) { width: 110px; white-space: nowrap; }
.rep-catalog th.rep-off-h, .rep-catalog td.rep-off-cell { width: 92px; text-align: center; white-space: nowrap; }
.rep-off-lbl { display: inline-flex; align-items: center; gap: 4px; cursor: pointer;
  font-size: 11px; color: #444; }
.rep-off-row td { background: #f6f6f6; color: #777; }
.rep-off-row td:first-child { text-decoration: line-through; }
.rep-off-note { margin: 2px 0 12px; }
.rep-off-sec { float: right; margin-left: 12px; font-weight: 400; font-size: 12px; color: #555; }
.rep-off-sec-lbl { display: inline-flex; align-items: center; gap: 5px; cursor: pointer; }
.rep-off-sec-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 14px;
  margin: 0 0 12px; padding: 6px 10px; border: 1px dashed #999; background: #fafafa;
  font-size: 12px; }
.rep-off-sec-count { font-weight: 600; }
.rep-off-show-lbl { display: inline-flex; align-items: center; gap: 5px; cursor: pointer; }
.rep-off-locked { opacity: .55; cursor: not-allowed; }
.rep-off-locked input { cursor: not-allowed; }
.aps-rep-off { display: none !important; }
.rep-link { color: #1565c0; font-weight: 600; text-decoration: underline; cursor: pointer; }
.rep-link:hover { color: #0d47a1; }
.aps-goto-flash { outline: 3px solid #1565c0; outline-offset: 2px; }
body.skin-dark .rep-catalog th, body.skin-dark .rep-catalog td { border-color: #3f3f3f; }
body.skin-dark .rep-catalog thead th { background: #2a2a2a; }
body.skin-dark .rep-off-row td { background: #242424; color: #aaa; }
body.skin-dark .rep-off-lbl { color: #bbb; }
body.skin-dark .rep-off-sec { color: #bbb; }
body.skin-dark .rep-off-sec-bar { background: #242424; border-color: #555; }
/* Мини-справочник */
.help-browser { display: flex; gap: 8px; align-items: center; flex-wrap: wrap;
  border: 1px solid #000; background: #fafafa; padding: 8px 10px; margin: 0 0 12px; position: sticky; top: 0; z-index: 5; }
.help-browser #helpSearch { flex: 1 1 260px; min-width: 180px; padding: 6px 8px;
  border: 1px solid #000; font-size: 13px; }
.help-browser #helpNav { padding: 6px 8px; border: 1px solid #000; font-size: 13px; max-width: 340px; }
.help-browser #helpHint { font-size: 12px; }
#helpContent .help-section { display: block; }
#helpContent .help-section.hidden { display: none; }
#helpContent .help-section mark { background: #ffe58a; padding: 0 1px; }

/* Мини-справка (кнопка «?») */
.mini-help { display: none; position: fixed; top: 96px; right: 16px; width: 460px; max-width: calc(100vw - 32px);
  max-height: calc(100vh - 140px); background: #fff; border: 2px solid #000; z-index: 300;
  box-shadow: 4px 4px 0 rgba(0,0,0,.25); font-size: 13px; }
.mini-help .mh-head { display: flex; justify-content: space-between; align-items: center;
  border-bottom: 1px solid #000; background: #f0f0f0; padding: 6px 10px; }
.mini-help .mh-head .mh-actions button { padding: 2px 8px; border: 1px solid #000; background: #fff;
  cursor: pointer; font-size: 12px; margin-left: 6px; }
.mini-help .mh-head .mh-actions button:hover { background: #000; color: #fff; }
.mini-help .mh-body { padding: 10px 12px; overflow-y: auto; max-height: calc(100vh - 200px); line-height: 1.5; }
.mini-help .mh-body h2 { font-size: 15px; margin: 0 0 8px; border-bottom: 1px solid #000; padding-bottom: 4px; }
.mini-help .mh-body h3 { font-size: 13px; margin: 10px 0 4px; }
.mini-help .mh-body p { margin: 5px 0; }
.mini-help .mh-body ul, .mini-help .mh-body ol { margin: 5px 0 5px 18px; padding: 0; }
.mini-help .mh-body li { margin: 2px 0; }
.mini-help .mh-body table.help-tbl { width: 100%; border-collapse: collapse; margin: 6px 0; }
.mini-help .mh-body table.help-tbl th, .mini-help .mh-body table.help-tbl td { border: 1px solid #000; padding: 4px 6px; font-size: 12px; vertical-align: top; }
.mini-help .mh-body table.help-tbl th { background: #f0f0f0; }
.mini-help .mh-body code { background: #f0f0f0; border: 1px solid #ddd; padding: 0 4px; font-family: Consolas, monospace; font-size: 12px; }
.mini-help .mh-body pre { background: #f5f5f5; border: 1px solid #ddd; padding: 6px; overflow-x: auto; }

/* Перетаскиваемые окна (балансировка, HiGHS) */
.dragwin { display: none; position: fixed; top: 90px; left: 120px; width: 520px; max-width: calc(100vw - 24px);
  max-height: calc(100vh - 120px); background: #fff; border: 2px solid #000; z-index: 280;
  box-shadow: 4px 4px 0 rgba(0,0,0,.25); font-size: 13px; }
.dragwin .win-head { display: flex; justify-content: space-between; align-items: center;
  border-bottom: 1px solid #000; background: #f0f0f0; padding: 6px 10px; cursor: move; user-select: none; }
.dragwin .win-body { padding: 10px 12px; overflow-y: auto; max-height: calc(100vh - 190px); }
.dragwin .win-btn { padding: 4px 12px; border: 1px solid #000; background: #fff; cursor: pointer; font-size: 12px; margin-left: 6px; }
.dragwin .win-btn:hover { background: #000; color: #fff; }
.dragwin .win-primary { background: #000; color: #fff; }
.dragwin .win-primary:hover { background: #444; }
.dragwin .grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 12px; }
.dragwin .grid label { display: flex; flex-direction: column; font-size: 12px; gap: 2px; }
.dragwin .grid input, .dragwin .grid select { padding: 4px 6px; border: 1px solid #000; font-size: 12px; }
.dragwin pre { background: #f5f5f5; border: 1px solid #ddd; padding: 6px; font-size: 11px; white-space: pre-wrap; }

/* Балансировка: ползунки + ввод, два режима */
.bal-coefs { display: flex; flex-direction: column; gap: 6px; }
.bal-row { display: grid; grid-template-columns: 230px 1fr 74px; gap: 8px; align-items: center; }
.bal-row label { font-size: 12px; }
.bal-row .bal-slider { width: 100%; }
.bal-row .bal-num { width: 70px; padding: 3px 5px; border: 1px solid #000; font-size: 12px; }
#balancePopup.mode-input .bal-slider { display: none; }
#balancePopup.mode-input .bal-row { grid-template-columns: 230px 1fr; }
#balancePopup.mode-input .bal-num { width: 100%; }
#balancePopup:not(.mode-input) .bal-num { display: none; }

/* Мини-справка перетаскивается за заголовок */
.mini-help .mh-head { cursor: move; user-select: none; }

/* Закладки внутри окна «Параметры» */
.bal-tabs { display: flex; gap: 2px; border-bottom: 1px solid #000; margin-bottom: 10px; }
.bal-tab { padding: 5px 14px; border: 1px solid #000; border-bottom: none; background: #eee; cursor: pointer; font-size: 12px; }
.bal-tab.active { background: #fff; font-weight: bold; }

/* Версии APS: таблица «дата / пользователь / имя / URL / действия» */
#versionsWrap table.versions-tbl { width: 100%; border-collapse: collapse; }
#versionsWrap table.versions-tbl th,
#versionsWrap table.versions-tbl td { border: 1px solid #000; padding: 5px 8px; font-size: 12px; vertical-align: top; text-align: left; }
#versionsWrap table.versions-tbl th { background: #f0f0f0; font-weight: 600; }
#versionsWrap table.versions-tbl td a { color: #000; }
#versionsWrap table.versions-tbl td a:hover { background: #000; color: #fff; }
#versionsWrap table.versions-tbl button { padding: 2px 10px; border: 1px solid #000; background: #fff; cursor: pointer; font-size: 12px; }
#versionsWrap table.versions-tbl button:hover { background: #000; color: #fff; }

/* ============================================================
   Лицензия (ТЗ v1.1): баннер, водяной знак, вкладка «Лицензия»
   ============================================================ */
#licenseBanner { display: flex; align-items: center; gap: 10px; margin: 6px 0;
  padding: 6px 12px; border: 1px solid #000; background: #fff7e0; font-size: 12px; }
#licenseBanner.demo { background: #ffe3e3; }
#licenseBanner.expired { background: #ffd6d6; }
#licenseBanner.warn { background: #fff7e0; }
#licenseBanner button { padding: 2px 10px; border: 1px solid #000; background: #fff;
  cursor: pointer; font-size: 12px; margin-left: auto; }
#licenseBanner button:hover { background: #000; color: #fff; }

.demo-watermark { position: fixed; left: 0; right: 0; top: 42%; text-align: center;
  pointer-events: none; z-index: 4; font-size: 110px; font-weight: 800;
  letter-spacing: 16px; color: rgba(0, 0, 0, 0.06); transform: rotate(-20deg); }

#licenseWrap .lic-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 10px; }
#licenseWrap .lic-card { border: 1px solid #000; padding: 10px 12px; background: #fafafa; }
#licenseWrap .lic-k { font-size: 11px; text-transform: uppercase; color: #555; letter-spacing: .5px; }
#licenseWrap .lic-v { font-size: 15px; font-weight: 600; margin: 2px 0 4px; }
#licenseWrap .lic-row { margin: 10px 0; }
#licenseWrap .lic-row-h { display: flex; justify-content: space-between; font-size: 12px;
  margin-bottom: 4px; }
#licenseWrap .lic-num { font-variant-numeric: tabular-nums; color: #333; }
#licenseWrap .lic-bar { height: 10px; border: 1px solid #000; background: #fff; }
#licenseWrap .lic-fill { height: 100%; background: #000; }
#licenseWrap .lic-fill.ok { background: #2e7d32; }
#licenseWrap .lic-fill.warn { background: #b8860b; }
#licenseWrap .lic-fill.bad { background: #b00020; }
#licenseWrap button { padding: 4px 14px; border: 1px solid #000; background: #000; color: #fff;
  cursor: pointer; font-size: 12px; }
#licenseWrap button:hover { background: #fff; color: #000; }

#licenseWrap table.sessions-tbl { width: 100%; border-collapse: collapse; }
#licenseWrap table.sessions-tbl th,
#licenseWrap table.sessions-tbl td { border: 1px solid #000; padding: 5px 8px;
  font-size: 12px; vertical-align: top; text-align: left; }
#licenseWrap table.sessions-tbl th { background: #f0f0f0; font-weight: 600; }
#licenseWrap table.sessions-tbl button { padding: 2px 10px; border: 1px solid #000;
  background: #fff; color: #000; cursor: pointer; font-size: 12px; }
#licenseWrap table.sessions-tbl button:hover { background: #000; color: #fff; }
#userBadge { color: #333; }

/* Админ: добавление пользователя и таблица на вкладке «Лицензия» */
#licenseWrap .u-form { display: flex; flex-wrap: wrap; gap: 6px; align-items: center;
  margin: 6px 0 4px; }
#licenseWrap .u-form input, #licenseWrap .u-form select { padding: 4px 8px;
  border: 1px solid #999; font-size: 12px; }
#licenseWrap .u-form input#nuLogin { width: 130px; }
#licenseWrap .u-form input#nuName { width: 160px; }
#licenseWrap .u-form input#nuToken { width: 300px; }
#licenseWrap .u-form input#nuDays { width: 80px; }
#licenseWrap .u-form button { padding: 4px 14px; border: 1px solid #000; background: #000;
  color: #fff; cursor: pointer; font-size: 12px; }
#licenseWrap .u-form button:hover { background: #fff; color: #000; }

/* Кнопка-значение лимита в таблице пользователей */
#licenseWrap button.ai-limit { border: 1px dashed #000; background: #fff; padding: 2px 6px;
  font-size: 12px; cursor: pointer; text-decoration: underline; }
#licenseWrap button.ai-limit:hover { background: #000; color: #fff; }

/* Модальное окно (увеличение лимита ИИ-токенов) */
.dlg-back { position: fixed; inset: 0; background: rgba(0, 0, 0, .35); display: flex;
  align-items: center; justify-content: center; z-index: 3000; }
.dlg { background: #fff; border: 1px solid #000; width: 540px; max-width: 92vw; }
.dlg-h { font-weight: 700; padding: 10px 14px; border-bottom: 1px solid #000;
  background: #f0f0f0; }
.dlg-b { padding: 14px; }
/* Конфликт при переносе: названия техкарты, операции и РЦ под сообщением */
.dlg-ops { margin-top: 4px; }
.dlg-op { margin-top: 8px; }
.dlg-op-h { font-weight: 700; font-size: 12px; margin-bottom: 2px; }
.dlg-op-c { font-weight: 400; color: #666; }
.dlg-op table { border-collapse: collapse; width: 100%; font-size: 12px; }
.dlg-op td { border: 0; padding: 1px 0; vertical-align: top; }
.dlg-op td.dlg-op-l { color: #666; padding-right: 12px; white-space: nowrap; }
.dlg-f { padding: 10px 14px; border-top: 1px solid #000; display: flex;
  justify-content: flex-end; gap: 8px; background: #fafafa; }
.dlg-f button { padding: 5px 16px; border: 1px solid #000; background: #fff;
  cursor: pointer; font-size: 12px; }
.dlg-f button.primary { background: #000; color: #fff; }
.dlg-f button.primary:hover { background: #fff; color: #000; }
.dlg .u-form { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.dlg .u-form input { padding: 4px 8px; border: 1px solid #999; font-size: 12px; }
.dlg .u-form input#limAmount { width: 230px; }
.dlg .u-form button { padding: 4px 10px; border: 1px solid #000; background: #fff;
  cursor: pointer; font-size: 12px; }
.dlg .u-form button:hover { background: #000; color: #fff; }

/* Все логи (администратор): фильтры, таблица, удаление */
.dlg.logs-dlg { width: 1240px; max-width: 96vw; }
.logs-dlg .dlg-b { max-height: 74vh; overflow: auto; }
.logs-filters { display: flex; flex-wrap: wrap; gap: 8px 12px;
  align-items: flex-end; margin-bottom: 10px; }
.logs-filters label { display: flex; flex-direction: column; gap: 3px;
  font-size: 11px; color: #555; }
.logs-filters select, .logs-filters input { padding: 4px 6px; border: 1px solid #999;
  font-size: 12px; min-width: 130px; background: #fff; }
.logs-filters button { padding: 4px 10px; border: 1px solid #000; background: #fff;
  cursor: pointer; font-size: 12px; }
.logs-filters button:hover { background: #000; color: #fff; }
.logs-actions { display: flex; gap: 6px; margin-left: auto; align-self: flex-end; }
.logs-filters button.logs-danger { border-color: #b00020; color: #b00020; }
.logs-filters button.logs-danger:hover { background: #b00020; color: #fff; }
.logs-filters button.logs-export { border-color: #1565c0; color: #1565c0; }
.logs-filters button.logs-export:hover { background: #1565c0; color: #fff; }
.logs-table-wrap { overflow: auto; max-height: 52vh; border: 1px solid #ccc; }
.logs-tbl { width: 100%; border-collapse: collapse; font-size: 11.5px; }
.logs-tbl th, .logs-tbl td { border: 1px solid #ddd; padding: 4px 6px;
  vertical-align: top; text-align: left; }
.logs-tbl thead th { background: #f0f0f0; position: sticky; top: 0; z-index: 1; }
.logs-tbl .logs-msg { white-space: pre-wrap; word-break: break-word; max-width: 620px; }
.logs-tbl .logs-nowrap { white-space: nowrap; }
.logs-tbl th.logs-metric, .logs-tbl td.logs-metric { text-align: right;
  white-space: nowrap; font-variant-numeric: tabular-nums; }
.log-lvl { display: inline-block; padding: 1px 6px; border-radius: 8px;
  font-size: 10px; border: 1px solid #999; background: #fafafa; }
.log-lvl.info { color: #1565c0; border-color: #90caf9; background: #e3f2fd; }
.log-lvl.warning { color: #e65100; border-color: #ffcc80; background: #fff3e0; }
.log-lvl.error { color: #b00020; border-color: #ef9a9a; background: #ffebee; }
.logs-pager { display: flex; gap: 10px; align-items: center; margin-top: 8px;
  font-size: 12px; }
.logs-pager button { padding: 3px 10px; border: 1px solid #000; background: #fff;
  cursor: pointer; font-size: 12px; }
.logs-pager button:disabled { opacity: .45; cursor: default; }
body.skin-dark .logs-tbl th, body.skin-dark .logs-tbl td { border-color: #3f3f3f; }
body.skin-dark .logs-tbl thead th { background: #2a2a2a; }
body.skin-dark .logs-table-wrap { border-color: #3f3f3f; }

/* ============================================================
   Дашборд: метрики плана, диаграмма выпуска, загрузка РЦ
   ============================================================ */
.dash-section { margin-top: 18px; }
.dash-h { font-weight: 700; font-size: 14px; margin-bottom: 8px; }
.dash-metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 4px 22px; }
.dash-metric { display: flex; align-items: baseline; gap: 12px;
  border-bottom: 1px solid #e6e6e6; padding: 6px 2px; }
.dash-metric-v { min-width: 66px; font-size: 19px; font-weight: 700; text-align: right;
  font-variant-numeric: tabular-nums; }
.dash-metric-l { font-size: 12px; color: #444; line-height: 1.3; }
.dash-metric.good .dash-metric-v { color: #2e7d32; }
.dash-metric.bad .dash-metric-v { color: #b00020; }
.dash-chart { border: 1px solid #000; padding: 8px; background: #fff; overflow-x: auto; }
.dash-chart svg { display: block; }
.dash-legend { display: flex; flex-wrap: wrap; gap: 12px; font-size: 11px; margin-top: 8px; }
.dash-legend i { display: inline-block; width: 11px; height: 11px; margin-right: 5px;
  vertical-align: -1px; border: 1px solid #000; }
.dash-hbars { display: flex; flex-direction: column; gap: 7px; }
.dash-hbar { display: grid; grid-template-columns: 240px 1fr 160px; gap: 10px;
  align-items: center; font-size: 12px; }
.dash-hbar-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-hbar-track { height: 14px; border: 1px solid #000; background: #fff; }
.dash-hbar-fill { height: 100%; }
.dash-hbar-val { text-align: right; color: #333; font-variant-numeric: tabular-nums; }

/* Кольцевая диаграмма и теплокарта дашборда */
.dash-donut-wrap { display: flex; gap: 30px; align-items: center; flex-wrap: wrap; }
.dash-donut { flex: 0 0 auto; }
.dash-donut-legend { display: flex; flex-direction: column; gap: 8px; font-size: 13px; }
.dash-donut-row { display: flex; align-items: center; gap: 8px; }
.dash-donut-row i { width: 12px; height: 12px; border: 1px solid #000; }
.dash-donut-row .n { font-weight: 700; min-width: 44px; text-align: right;
  font-variant-numeric: tabular-nums; }
.dash-donut-row .l { color: #333; }
.dash-heat { overflow-x: auto; }
.hm-tbl { border-collapse: collapse; font-size: 11px; }
.hm-tbl th, .hm-tbl td { border: 1px solid #ccc; padding: 3px 5px; text-align: center; }
.hm-tbl th { background: #f0f0f0; font-weight: 600; }
.hm-tbl th.hm-name, .hm-tbl td.hm-name { text-align: left; max-width: 240px; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; }
.hm-cell { min-width: 34px; }

/* Проектный дашборд: графики портфеля */
.proj-charts { display: grid; grid-template-columns: repeat(auto-fit, minmax(420px, 1fr));
  gap: 12px; }
.proj-charts .dash-chart { min-width: 0; }
.port-gantt { padding: 2px 0; }
.port-row { display: grid; grid-template-columns: 220px 1fr; gap: 8px; align-items: center;
  margin: 3px 0; font-size: 12px; }
.port-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.port-track { position: relative; height: 18px; background: #f4f6f8;
  border: 1px solid #ddd; }
.port-bar { position: absolute; top: 3px; bottom: 3px; border-radius: 2px; }
.port-fc { position: absolute; top: -2px; bottom: -2px; width: 0;
  border-left: 2px solid #000; }
.port-axis { display: flex; justify-content: space-between; font-size: 11px;
  color: #555; margin: 2px 0 0 228px; }
.proj-hist { display: flex; align-items: flex-end; gap: 14px; height: 150px;
  padding: 6px 4px 0; border-bottom: 1px solid #000; }
.proj-hist-col { flex: 1; display: flex; align-items: flex-end; justify-content: center;
  height: 100%; }
.proj-hist-bar { width: 70%; background: #1565c0; min-height: 2px; }
.proj-hist-labels { display: flex; gap: 14px; margin-top: 4px; }
.proj-hist-labels span { flex: 1; text-align: center; font-size: 11px; color: #333; }

/* Дашборд: переключатели, таблицы, список предупреждений */
.dash-toolbar { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; }
.dash-tg { border: 1px solid #000; background: #fff; padding: 3px 10px; font-size: 12px;
  cursor: pointer; }
.dash-tg.active { background: #000; color: #fff; }
.dash-tg-sep { width: 14px; }
.dash-table { border-collapse: collapse; font-size: 11px; width: 100%; }
.dash-table th, .dash-table td { border: 1px solid #ccc; padding: 4px 6px; }
.dash-table thead th { background: #f0f0f0; }
.dash-table td.num, .dash-table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.dash-table tfoot td { background: #fafafa; }
.dash-search { width: 100%; max-width: 420px; padding: 5px 8px; border: 1px solid #999;
  font-size: 12px; margin-bottom: 8px; }
.dash-warn-list { display: flex; flex-direction: column; gap: 2px; max-height: 420px;
  overflow-y: auto; }
.dash-warn-item { display: flex; gap: 8px; align-items: baseline; font-size: 12px;
  padding: 4px 6px; border-bottom: 1px solid #eee; }
.dash-warn-item .ic { font-weight: 700; }
.dash-warn-item.e .ic { color: #b00020; }
.dash-warn-item.w .ic { color: #e08a00; }

/* Сравнение версий плана */
.dlg-wide { width: 1000px; }
.cmp-sel { display: flex; gap: 18px; margin-bottom: 10px; font-size: 12px; flex-wrap: wrap; }
.cmp-sel select { margin-left: 6px; padding: 3px 6px; font-size: 12px; }
.cmp-body { display: flex; gap: 16px; flex-wrap: wrap; }
.cmp-card { flex: 1 1 420px; border: 1px solid #000; padding: 10px; }
.cmp-title { font-weight: 700; margin-bottom: 8px; }
.cmp-kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 10px; }
.cmp-kpi { border-top: 1px solid #e5e5e5; padding-top: 6px; }
.cmp-kpi .v { font-size: 16px; font-weight: 700; font-variant-numeric: tabular-nums; }
.cmp-kpi .l { font-size: 11px; color: #666; }

/* Демо-режим: недоступные кнопки и пояснение на вкладке «Лицензия» */
button.demo-disabled { opacity: .45; cursor: not-allowed; }
.lic-demo-note { margin-top: 10px; padding: 8px 10px; border: 1px dashed #b00020;
  background: #fff5f5; font-size: 12px; color: #7a0016; }

/* «Техкарта»/«Операция» — не шире 2× «Начало»; «Предыдущие…» — не шире 3× */
table .col-clip, table .col-clip3 { display: inline-block; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom; }
table .col-clip { max-width: var(--col-cap, 280px); }
table .col-clip3 { max-width: var(--col-cap3, 420px); }
/* ===== MRP charts ===== */
.mrp-charts { display: grid; grid-template-columns: repeat(auto-fit, minmax(430px, 1fr));
  gap: 12px; margin: 6px 0 18px; }
.mrp-card { border: 1px solid #000; background: #fff; display: flex; flex-direction: column; }
.mrp-card-h { font-weight: 700; font-size: 13px; padding: 7px 10px; background: #f0f0f0;
  border-bottom: 1px solid #000; }
.mrp-card-h .muted { font-weight: normal; font-size: 11px; }
.mrp-card-b { padding: 10px; }
.mrp-track { display: flex; }
.mrp-seg { height: 100%; }
.mrp-donut { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.mrp-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 6px; }
.mrp-tile { border: 1px solid #000; padding: 6px; display: flex; flex-direction: column;
  gap: 2px; min-height: 44px; }
.mrp-tile b { font-size: 14px; }
.mrp-tile span { font-size: 10px; color: #333; overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; }
.mrp-charts-h { font-weight: 700; font-size: 14px; margin: 2px 0 8px; }
.mrp-card .dash-hbar { grid-template-columns: 300px 1fr 118px; }
/* ===== /MRP charts ===== */

/* Канбан техкарт (вкладка «Канбан») */
.kb-board { display: flex; gap: 12px; align-items: flex-start; overflow-x: auto; padding-bottom: 8px; }
.kb-col { min-width: 260px; max-width: 320px; flex: 0 0 auto; border: 1px solid #000; background: #fafafa; }
.kb-head { padding: 8px 10px; font-weight: 700; font-size: 13px; border-bottom: 1px solid #000;
  background: #f0f0f0; display: flex; justify-content: space-between; gap: 8px; }
.kb-count { font-weight: normal; color: #555; }
.kb-body { max-height: 70vh; overflow-y: auto; padding: 8px; display: flex; flex-direction: column; gap: 8px; }
.kb-card { border: 1px solid #999; background: #fff; padding: 8px; font-size: 12px; }
.kb-card.kb-late { border-color: #c62828; box-shadow: inset 3px 0 0 #c62828; }
.kb-code { font-weight: 700; font-size: 12px; }
.kb-name { margin: 2px 0 4px; }
.kb-meta { color: #555; font-size: 11px; }
.kb-empty { color: #777; font-size: 12px; padding: 4px; }

/* Заголовок группы проектов на диаграмме Ганта */
.ggroup { display: flex; align-items: center; gap: 8px; background: #e8eef7;
  border-top: 1px solid #000; border-bottom: 1px solid #000; padding: 6px 8px;
  font-size: 12px; font-weight: 700; cursor: pointer; user-select: none; }
.ggroup:hover { background: #dfe7f4; }
.ggroup-arrow { width: 12px; color: #333; }
.ggroup-count { font-weight: normal; color: #555; margin-left: auto; }

/* Готовность операции в блоке Ганта */
.gblock .gprog { float: right; margin-left: 4px; padding: 0 3px; border-radius: 3px;
  background: rgba(255,255,255,0.7); font-size: 9px; font-weight: 700; }

/* Дорожная карта проектов (Дашборды → Метрики) */
.proj-road { position: relative; }
.proj-row { display: grid; grid-template-columns: 210px 1fr 150px 90px; gap: 8px;
  align-items: center; font-size: 11px; padding: 3px 0; border-bottom: 1px solid #eee; }
.proj-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.proj-track { position: relative; height: 16px; background: #f2f2f2; border: 1px solid #ccc; }
.proj-bar { position: absolute; top: 0; bottom: 0; background: #90a4ae; border: 1px solid #607d8b; }
.proj-bar.active { background: #90caf9; border-color: #1565c0; }
.proj-bar.late { background: #ef9a9a; border-color: #c62828; }
.proj-bar.plan { background: #c5cae9; border-color: #5c6bc0; }
.proj-fill { position: absolute; left: 0; top: 0; bottom: 0; background: rgba(21,101,192,0.45); }
.proj-dates { color: #555; text-align: right; white-space: nowrap; }
.proj-state { text-align: right; }
.proj-state.active { color: #1565c0; }
.proj-state.late { color: #c62828; font-weight: 600; }
.proj-state.plan { color: #5c6bc0; }
.proj-today { position: absolute; top: 0; bottom: 0; width: 0; border-left: 2px solid #e91e63; }

/* Диаграмма Перта (Дашборды → Метрики) */
.pert-sum { font-size: 12px; color: #333; margin-bottom: 6px; }
.pert-sum b { font-variant-numeric: tabular-nums; }
.pert-sum .bad { color: #b00020; font-weight: 600; }
.pert-legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 11px;
  color: #444; margin-bottom: 6px; }
.pert-legend i { display: inline-block; margin-right: 5px; vertical-align: -1px; }
.pert-legend .pl-box { width: 12px; height: 10px; background: #fff; border: 1px solid #333; }
.pert-legend .pl-box.crit { background: #fdecea; border: 2px solid #c62828; }
.pert-legend .pl-line { width: 16px; height: 0; border-top: 1px solid #8a9099;
  vertical-align: 2px; }
.pert-legend .pl-line.crit { border-top: 2px solid #c62828; }
.pert-wrap { display: flex; align-items: flex-start; max-height: 640px;
  overflow-y: auto; border: 1px solid #000; background: #fff; }
.pert-side { flex: 0 0 205px; position: sticky; left: 0; z-index: 2;
  background: #fafafa; border-right: 1px solid #bbb; }
.pert-side-head { height: 24px; line-height: 24px; padding: 0 8px; box-sizing: border-box;
  font-size: 11px; font-weight: 700; border-bottom: 1px solid #bbb; background: #f0f0f0; }
.pert-side-row { height: 44px; box-sizing: border-box; padding: 5px 8px;
  border-bottom: 1px solid #eee; overflow: hidden; }
.pert-side-row b { display: block; font-size: 10.5px; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pert-side-row span { display: block; font-size: 10px; color: #555;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pert-scroll { flex: 1 1 auto; overflow-x: auto; }
.pert-scroll svg { display: block; }
.pert-note { font-size: 11px; color: #666; margin-top: 6px; line-height: 1.4; }
.pert-note code { font-size: 10.5px; }
.pert-table-wrap { max-height: 420px; overflow: auto; margin-top: 10px; }
.pert-tbl td, .pert-tbl th { white-space: nowrap; }
.pert-tbl td:nth-child(3) { max-width: 340px; overflow: hidden; text-overflow: ellipsis; }
.pert-tbl tr.pert-crit-row td { background: #fdecea; }
.pert-scope { font-size: 12px; color: #444; }
.pert-scope select { margin-left: 4px; max-width: 320px; padding: 2px 4px; font-size: 12px; }
body.skin-dark .pert-wrap, body.skin-dark .pert-side {
  background: #1e1e1e !important; color: #e8e8e8 !important; border-color: #3f3f3f !important; }
body.skin-dark .pert-side-head { background: #2a2a2a !important; }

/* ---------- Скины интерфейса (выбор в «Параметрах») ---------- */
body.skin-dark { background: #141414 !important; color: #e8e8e8 !important; }
body.skin-dark .panel, body.skin-dark .panel-b, body.skin-dark .tab-content,
body.skin-dark .tab, body.skin-dark .tabs, body.skin-dark .dragwin,
body.skin-dark .dash-chart, body.skin-dark .mrp-card, body.skin-dark .kb-col {
  background: #1e1e1e !important; color: #e8e8e8 !important; border-color: #3f3f3f !important; }
body.skin-dark .panel-h, body.skin-dark th, body.skin-dark .win-head,
body.skin-dark .kb-head { background: #2a2a2a !important; color: #f2f2f2 !important;
  border-color: #3f3f3f !important; }
body.skin-dark th, body.skin-dark td { border-color: #3f3f3f !important; }
body.skin-dark .tab.active { background: #3b82f6 !important; color: #ffffff !important;
  border-color: #3b82f6 !important; }
body.skin-dark button, body.skin-dark select, body.skin-dark input, body.skin-dark textarea {
  background: #262626 !important; color: #e8e8e8 !important; border-color: #555 !important; }
body.skin-dark .kb-card { background: #232323 !important; border-color: #4a4a4a !important; }
body.skin-dark .muted, body.skin-dark .kb-meta, body.skin-dark .proj-dates { color: #9aa0a6 !important; }

body.skin-sea { background: #eaf4f6 !important; color: #0f2f35 !important; }
body.skin-sea .panel, body.skin-sea .panel-b, body.skin-sea .tab-content,
body.skin-sea .dragwin, body.skin-sea .dash-chart, body.skin-sea .mrp-card,
body.skin-sea .kb-col { background: #ffffff !important; border-color: #2c6b74 !important; }
body.skin-sea .panel-h, body.skin-sea th, body.skin-sea .win-head,
body.skin-sea .kb-head { background: #d9edf1 !important; border-color: #2c6b74 !important;
  color: #0f2f35 !important; }
body.skin-sea .tabs, body.skin-sea .tab { background: #ffffff !important;
  border-color: #2c6b74 !important; color: #0f2f35 !important; }
body.skin-sea .tab.active { background: #2c6b74 !important; color: #ffffff !important; }
body.skin-sea button, body.skin-sea select, body.skin-sea input, body.skin-sea textarea {
  background: #f4fbfc !important; border-color: #2c6b74 !important; color: #0f2f35 !important; }
body.skin-sea th, body.skin-sea td { border-color: #2c6b74 !important; }

body.skin-warm { background: #f6efe2 !important; color: #3a2c1c !important; }
body.skin-warm .panel, body.skin-warm .panel-b, body.skin-warm .tab-content,
body.skin-warm .dragwin, body.skin-warm .dash-chart, body.skin-warm .mrp-card,
body.skin-warm .kb-col { background: #fffdf7 !important; border-color: #7a5a38 !important; }
body.skin-warm .panel-h, body.skin-warm th, body.skin-warm .win-head,
body.skin-warm .kb-head { background: #efe0c4 !important; border-color: #7a5a38 !important;
  color: #3a2c1c !important; }
body.skin-warm .tabs, body.skin-warm .tab { background: #fffdf7 !important;
  border-color: #7a5a38 !important; color: #3a2c1c !important; }
body.skin-warm .tab.active { background: #a9743f !important; color: #ffffff !important; }
body.skin-warm button, body.skin-warm select, body.skin-warm input, body.skin-warm textarea {
  background: #fffaf0 !important; border-color: #7a5a38 !important; color: #3a2c1c !important; }
body.skin-warm th, body.skin-warm td { border-color: #7a5a38 !important; }

body.skin-contrast { background: #ffffff !important; color: #000000 !important; }
body.skin-contrast .panel, body.skin-contrast .panel-b, body.skin-contrast .tab-content,
body.skin-contrast .dragwin, body.skin-contrast .dash-chart, body.skin-contrast .mrp-card,
body.skin-contrast .kb-col { border: 2px solid #000000 !important; background: #ffffff !important; }
body.skin-contrast .panel-h, body.skin-contrast th, body.skin-contrast .win-head,
body.skin-contrast .kb-head { background: #ffffff !important; border: 2px solid #000000 !important;
  font-weight: 700 !important; }
body.skin-contrast th, body.skin-contrast td { border: 2px solid #000000 !important; }
body.skin-contrast .tab { border: 2px solid #000000 !important; font-weight: 700 !important; }
body.skin-contrast .tab.active { background: #ffd400 !important; color: #000000 !important;
  border-color: #000000 !important; }
body.skin-contrast button, body.skin-contrast select, body.skin-contrast input,
body.skin-contrast textarea { border: 2px solid #000000 !important; font-weight: 700 !important; }

/* Скины: диаграмма Ганта и служебные панели */
body.skin-dark .glabel, body.skin-dark .gtrack, body.skin-dark .grow,
body.skin-dark .gheader, body.skin-dark .gheader-label, body.skin-dark .gheader-axis,
body.skin-dark .gaxis, body.skin-dark .ops-subtab, body.skin-dark .dash-subtab,
body.skin-dark .win-btn, body.skin-dark .badge {
  background: #1e1e1e !important; color: #e8e8e8 !important; border-color: #3f3f3f !important; }
body.skin-dark .ggroup { background: #26303c !important; color: #e8e8e8 !important;
  border-color: #3f3f3f !important; }
body.skin-dark .gtick { color: #cfd8dc !important; }
body.skin-dark .dash-subtab.active, body.skin-dark .ops-subtab.active {
  background: #3b82f6 !important; color: #fff !important; }

body.skin-sea .glabel, body.skin-sea .gtrack, body.skin-sea .grow,
body.skin-sea .gheader, body.skin-sea .gheader-label, body.skin-sea .gheader-axis,
body.skin-sea .gaxis, body.skin-sea .ops-subtab, body.skin-sea .dash-subtab,
body.skin-sea .win-btn, body.skin-sea .badge {
  background: #ffffff !important; color: #0f2f35 !important; border-color: #2c6b74 !important; }
body.skin-sea .ggroup { background: #d9edf1 !important; color: #0f2f35 !important;
  border-color: #2c6b74 !important; }
body.skin-sea .dash-subtab.active, body.skin-sea .ops-subtab.active {
  background: #2c6b74 !important; color: #fff !important; }

body.skin-warm .glabel, body.skin-warm .gtrack, body.skin-warm .grow,
body.skin-warm .gheader, body.skin-warm .gheader-label, body.skin-warm .gheader-axis,
body.skin-warm .gaxis, body.skin-warm .ops-subtab, body.skin-warm .dash-subtab,
body.skin-warm .win-btn, body.skin-warm .badge {
  background: #fffdf7 !important; color: #3a2c1c !important; border-color: #7a5a38 !important; }
body.skin-warm .ggroup { background: #efe0c4 !important; color: #3a2c1c !important;
  border-color: #7a5a38 !important; }
body.skin-warm .dash-subtab.active, body.skin-warm .ops-subtab.active {
  background: #a9743f !important; color: #fff !important; }

body.skin-contrast .glabel, body.skin-contrast .gtrack, body.skin-contrast .grow,
body.skin-contrast .gheader, body.skin-contrast .gheader-label, body.skin-contrast .gheader-axis,
body.skin-contrast .gaxis, body.skin-contrast .ops-subtab, body.skin-contrast .dash-subtab,
body.skin-contrast .win-btn, body.skin-contrast .badge {
  background: #ffffff !important; color: #000 !important; border-color: #000 !important; }
body.skin-contrast .dash-subtab.active, body.skin-contrast .ops-subtab.active {
  background: #ffd400 !important; color: #000 !important; }body.skin-dark #toolbar, body.skin-dark .tb-row, body.skin-dark #legend { background: #1e1e1e !important; color: #e8e8e8 !important; }
body.skin-sea #toolbar, body.skin-sea .tb-row, body.skin-sea #legend { background: #eaf4f6 !important; color: #0f2f35 !important; }
body.skin-warm #toolbar, body.skin-warm .tb-row, body.skin-warm #legend { background: #f6efe2 !important; color: #3a2c1c !important; }
body.skin-contrast #toolbar, body.skin-contrast .tb-row, body.skin-contrast #legend { background: #ffffff !important; color: #000 !important; }
/* Канбан: перетаскивание карточек */
.kb-card { cursor: grab; }
.kb-card.kb-dragging { opacity: 0.45; cursor: grabbing; }
.kb-body.kb-over { outline: 2px dashed #1565c0; outline-offset: -4px; background: #eef4ff; }

/* Ссылка на аналоги материала в таблице остатков */
.analogs-link { color: #1565c0; text-decoration: underline; cursor: pointer; font-weight: 600; }
.analogs-link:hover { color: #0d47a1; }
#analogsPopup .win-body { max-height: 60vh; }
#analogsPopup table { width: 100%; }

/* Полоса прогресса операции в карточке */
.op-progress { display: inline-block; width: 90px; height: 7px; background: #d9d9d9;
  border: 1px solid #999; vertical-align: middle; margin-left: 4px; }
.op-progress i { display: block; height: 100%; background: #1565c0; }

/* Причина просрочки в карточке операции */
.op-overdue-why { font-size: 11px; color: #8e1b1b; }

/* Прогресс-бар пересчёта плана (v7.10.10) */
.recalc-prog { position: fixed; inset: 0; background: rgba(0,0,0,.42);
  z-index: 10050; display: flex; align-items: center; justify-content: center; }
.recalc-prog .rp-box { background: #fff; border: 1px solid #000; border-radius: 6px;
  padding: 18px 20px 14px; min-width: 380px; max-width: 560px;
  box-shadow: 0 12px 40px rgba(0,0,0,.35); font: 13px/1.4 system-ui, Segoe UI, sans-serif; }
.recalc-prog .rp-head { font-weight: 700; font-size: 15px; margin-bottom: 2px; }
.recalc-prog .rp-sub { color: #555; margin-bottom: 12px; }
.recalc-prog .rp-bar { height: 14px; border: 1px solid #000; background: #ececec;
  border-radius: 7px; overflow: hidden; }
.recalc-prog .rp-fill { height: 100%; width: 0; border-radius: 7px;
  background: linear-gradient(90deg, #1565c0, #4aa3ff);
  transition: width .5s linear; }
.recalc-prog .rp-foot { display: flex; justify-content: space-between;
  align-items: baseline; margin-top: 8px; gap: 12px;
  font-variant-numeric: tabular-nums; }
.recalc-prog .rp-hint { color: #666; font-size: 12px; text-align: right; }
.recalc-prog .rp-hide { margin-top: 12px; padding: 6px 14px; border: 1px solid #000;
  background: #fff; border-radius: 4px; cursor: pointer; font: inherit; }
.recalc-prog .rp-hide:hover { background: #f2f2f2; }


/* Полоса пересчёта внизу страницы (после «Свернуть», v7.10.11) */
.recalc-mini { position: fixed; left: 0; right: 0; bottom: 0; z-index: 10040;
  background: #fff; border-top: 2px solid #000; box-shadow: 0 -4px 14px rgba(0,0,0,.25);
  font: 12px/1.3 system-ui, Segoe UI, sans-serif; }
.recalc-mini .rm-bar { height: 6px; background: #dcdcdc; overflow: hidden; }
.recalc-mini .rm-fill { height: 100%; width: 0;
  background: linear-gradient(90deg, #1565c0, #4aa3ff); transition: width .5s linear; }
.recalc-mini .rm-row { display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 6px 12px; }
.recalc-mini .rm-text { font-variant-numeric: tabular-nums; color: #222; }
.recalc-mini button { padding: 4px 10px; border: 1px solid #000; background: #fff;
  border-radius: 4px; cursor: pointer; font: inherit; }
.recalc-mini button:hover { background: #f2f2f2; }

/* ============================================================
   Оценки «Верно» / «Неверно» и Журнал Разбора (v7.10.20)
   ============================================================ */
.rate-bar { display: flex; align-items: center; flex-wrap: wrap; gap: 6px;
  margin-top: 8px; padding-top: 6px; border-top: 1px dashed #c9c9c9;
  white-space: normal; font-size: 11px; }
.rate-bar .rate-lbl { color: #666; margin-right: 2px; }
.rate-btn { padding: 2px 9px; border: 1px solid #000; background: #fff; color: #000;
  font: inherit; font-size: 11px; line-height: 1.55; cursor: pointer; border-radius: 0; }
.rate-btn:hover { background: #f0f0f0; }
.rate-btn.active.ok { background: #1b5e20; border-color: #1b5e20; color: #fff; }
.rate-btn.active.no { background: #b00020; border-color: #b00020; color: #fff; }
.rate-btn:disabled { cursor: default; opacity: .55; }
.rate-btn.active:disabled { opacity: 1; }
.rate-badge { color: #555; }

.err-item { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: flex-start; }
.err-item .err-txt { flex: 1 1 360px; white-space: pre-wrap; word-break: break-word; }
.err-item .rate-bar { margin: 0; padding: 0; border: 0; flex: 0 0 auto; }

.rj-filters { display: flex; flex-wrap: wrap; gap: 8px 12px;
  padding: 8px; border: 1px solid #ccc; background: #fafafa; margin-bottom: 8px; }
.rj-filters label { display: flex; flex-direction: column; gap: 3px;
  font-size: 11px; color: #555; }
.rj-filters label.rj-flag { flex-direction: row; align-items: center; gap: 6px;
  align-self: flex-end; padding-bottom: 4px; font-size: 12px; color: #333;
  white-space: nowrap; }
.rj-filters label.rj-flag input { min-width: 0; }
.rj-filters select, .rj-filters input { padding: 4px 6px; border: 1px solid #999;
  font: inherit; font-size: 12px; min-width: 130px; background: #fff; color: #000; }
.rj-filters input[type="date"] { min-width: 128px; }
.rj-actions { display: flex; gap: 6px; align-items: flex-end; margin-left: auto; }
.rj-actions button, .rj-actions-cell button, #rjRefresh { padding: 4px 10px;
  border: 1px solid #000; background: #fff; color: #000; font: inherit;
  font-size: 12px; cursor: pointer; }
.rj-actions button:hover, .rj-actions-cell button:hover, #rjRefresh:hover {
  background: #000; color: #fff; }
.rj-actions-cell { white-space: nowrap; }
.rj-actions-cell button { font-size: 11px; padding: 3px 8px; margin: 1px 2px; }
.rj-actions-cell button:disabled { opacity: .4; cursor: default; }
.rj-actions-cell button:disabled:hover { background: #fff; color: #000; }
.rj-tbl .rj-title { max-width: 340px; word-break: break-word; white-space: normal; }
.rj-tbl .rj-dur { white-space: nowrap; font-variant-numeric: tabular-nums; }
.rj-verdict { display: inline-block; padding: 1px 7px; border: 1px solid #000;
  font-size: 11px; white-space: nowrap; }
.rj-verdict.correct { background: #e8f5e9; border-color: #1b5e20; color: #1b5e20; }
.rj-verdict.incorrect { background: #ffebee; border-color: #b00020; color: #b00020; }
.rj-arch-badge { display: inline-block; margin-left: 6px; padding: 1px 6px;
  border: 1px dashed #777; color: #555; font-size: 10px; white-space: nowrap; }
.rj-tbl tr.rj-archived-row td { background: #f4f4f4; }
.rj-tbl tr.rj-archived-row .rj-title { color: #666; }

.review-view { display: flex; flex-direction: column; gap: 8px; }
.review-view .rv-meta { display: flex; flex-wrap: wrap; gap: 4px 14px;
  font-size: 11px; color: #555; }
.review-view .rv-meta b { color: #222; }
.review-view .rv-h { font-weight: 700; font-size: 12px; margin-top: 2px; }
.review-view .rv-pre { white-space: pre-wrap; word-break: break-word;
  max-height: 46vh; overflow: auto; border: 1px solid #ccc; background: #fafafa;
  padding: 8px; font: 12px/1.5 Consolas, "Segoe UI", monospace; }

body.skin-dark .rate-btn { background: #2a2a2a; color: #eee; border-color: #888; }
body.skin-dark .rate-btn:hover { background: #3a3a3a; }
body.skin-dark .rate-bar { border-top-color: #444; }
body.skin-dark .rate-bar .rate-lbl, body.skin-dark .rate-badge { color: #aaa; }
body.skin-dark .rj-filters { background: #222; border-color: #444; }
body.skin-dark .rj-filters label { color: #aaa; }
body.skin-dark .rj-filters select, body.skin-dark .rj-filters input {
  background: #1e1e1e; color: #eee; border-color: #666; }
body.skin-dark .rj-actions button, body.skin-dark .rj-actions-cell button,
body.skin-dark #rjRefresh { background: #2a2a2a; color: #eee; border-color: #888; }
body.skin-dark .review-view .rv-pre { background: #1e1e1e; color: #eee; border-color: #444; }
body.skin-dark .review-view .rv-meta { color: #aaa; }
body.skin-dark .review-view .rv-meta b { color: #eee; }

/* ---------- Планировщик заданий ИИ-помощника (Операции → Планировщик) ---------- */
.ai-sched-head { display: flex; align-items: flex-start; justify-content: space-between;
  gap: 12px; margin-bottom: 8px; flex-wrap: wrap; }
.ai-sched-hint { font-size: 12px; color: #444; max-width: 940px; line-height: 1.45; }
.ai-sched-meta { display: flex; align-items: center; gap: 8px; }
.ai-sched-meta button, .ai-task-actions button, #btnAddAiTask {
  padding: 4px 12px; border: 1px solid #000; background: #fff; color: #000;
  font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; }
.ai-sched-meta button:hover, .ai-task-actions button:hover, #btnAddAiTask:hover {
  background: #000; color: #fff; }
.ai-sched-tbl td { vertical-align: top; }
.ai-sched-tbl .as-title { font-weight: 600; white-space: normal; max-width: 200px; }
.ai-sched-tbl .as-prompt { max-width: 250px; white-space: normal; word-break: break-word;
  color: #444; font-size: 11px; }
.ai-sched-tbl .as-when { white-space: nowrap; font-variant-numeric: tabular-nums; }
.ai-sched-tbl .as-answer { max-width: 360px; white-space: pre-wrap; word-break: break-word;
  font-size: 11px; color: #333; }
.ai-sched-tbl tr.as-off > td { opacity: .62; }
.ai-sched-badge { display: inline-block; padding: 1px 7px; border: 1px solid #000;
  font-size: 11px; white-space: nowrap; }
.ai-sched-badge.on { background: #e8f5e9; border-color: #1b5e20; color: #1b5e20; }
.ai-sched-badge.off { background: #f0f0f0; border-color: #777; color: #555; }
.ai-sched-badge.ok { background: #e8f5e9; border-color: #1b5e20; color: #1b5e20; }
.ai-sched-badge.err { background: #ffebee; border-color: #b00020; color: #b00020; }
.ai-sched-badge.blocked { background: #fff8e1; border-color: #8d6e00; color: #6d5200; }
.ai-sched-badge.done { background: #e3f2fd; border-color: #0d47a1; color: #0d47a1; }
.ai-sched-actions-cell { white-space: nowrap; }
.ai-sched-actions-cell button { font-size: 11px; padding: 3px 8px; margin: 1px 2px;
  border: 1px solid #000; background: #fff; color: #000; cursor: pointer; }
.ai-sched-actions-cell button:hover { background: #000; color: #fff; }
.ai-sched-actions-cell button:disabled { opacity: .4; cursor: default; }
.ai-sched-actions-cell button:disabled:hover { background: #fff; color: #000; }
.ai-sched-empty { padding: 18px; text-align: center; color: #555; font-size: 12px; }
.ai-sched-run { border: 1px solid #ccc; padding: 8px 10px; margin: 0 0 8px;
  background: #fafafa; }
.ai-sched-run .ar-head { display: flex; flex-wrap: wrap; gap: 4px 12px;
  font-size: 11px; color: #555; margin-bottom: 4px; }
.ai-sched-run .ar-answer { white-space: pre-wrap; word-break: break-word;
  font-size: 12px; color: #222; max-height: 30vh; overflow: auto; }
.ai-task-dlg { background: #fff; border: 2px solid #000; padding: 16px;
  width: 740px; max-width: 94vw; box-sizing: border-box; max-height: 90vh; overflow: auto; }
.ai-task-dlg h3 { margin: 0 0 10px; font-size: 14px; }
.ai-task-field { display: flex; flex-direction: column; gap: 4px; font-size: 12px;
  color: #333; min-width: 0; margin-bottom: 10px; }
.ai-task-field input, .ai-task-field textarea, .ai-task-field select {
  width: 100%; box-sizing: border-box; padding: 5px 6px; border: 1px solid #000;
  font: inherit; font-size: 12px; background: #fff; color: #000; }
.ai-task-field textarea { resize: vertical; min-height: 82px; }
.ai-task-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.ai-task-inline { display: flex; gap: 6px; }
.ai-task-inline input { width: 110px; }
.ai-task-inline select { width: auto; }
.ai-task-weekdays { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px;
  font-size: 12px; color: #333; margin: 2px 0 10px; }
.ai-task-weekdays label { display: inline-flex; align-items: center; gap: 4px; }
.ai-task-checks { display: flex; flex-direction: column; gap: 5px; font-size: 12px;
  color: #333; margin-bottom: 8px; }
.ai-task-checks label { display: inline-flex; align-items: flex-start; gap: 6px; }
.ai-task-hint { font-size: 12px; color: #b00020; min-height: 16px; margin-bottom: 4px; }
.ai-task-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 8px; }
.ai-task-runs-dlg { width: 820px; }
body.skin-dark .ai-sched-hint, body.skin-dark .ai-sched-tbl .as-prompt,
body.skin-dark .ai-sched-tbl .as-answer { color: #b8b8b8; }
body.skin-dark .ai-sched-run { background: #1e1e1e; border-color: #444; }
body.skin-dark .ai-sched-run .ar-answer { color: #e8e8e8; }


/* ---------- Коннекторы («Операции → Коннекторы») ---------- */
.conn-head { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 10px 18px;
  justify-content: space-between; margin-bottom: 10px; }
.conn-hint { font-size: 12px; color: #333; line-height: 1.45; max-width: 980px; }
.conn-meta { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.conn-meta button { font-size: 11px; padding: 4px 10px; border: 1px solid #000;
  background: #fff; color: #000; cursor: pointer; }
.conn-meta button:hover { background: #000; color: #fff; }
.conn-empty { padding: 18px; text-align: center; color: #555; font-size: 12px; }
.conn-tbl { width: 100%; border-collapse: collapse; font-size: 12px; }
.conn-tbl th, .conn-tbl td { border-bottom: 1px solid #d0d0d0; padding: 5px 6px;
  text-align: left; vertical-align: top; }
.conn-tbl th { background: #f2f2f2; font-weight: bold; white-space: nowrap; }
.conn-tbl tr.conn-off td { color: #888; }
.conn-name { font-weight: bold; }
.conn-last-cell { max-width: 260px; }
.conn-last { color: #555; font-size: 11px; margin-top: 2px; }
.conn-actions { white-space: nowrap; }
.conn-actions button { font-size: 11px; padding: 3px 8px; margin: 1px 2px;
  border: 1px solid #000; background: #fff; color: #000; cursor: pointer; }
.conn-actions button:hover { background: #000; color: #fff; }
.conn-actions button:disabled { opacity: .4; cursor: default; }
.conn-actions button:disabled:hover { background: #fff; color: #000; }
.conn-badge { display: inline-block; font-size: 10px; padding: 1px 6px;
  border: 1px solid #999; color: #555; background: #f5f5f5; white-space: nowrap; }
.conn-badge.ok { border-color: #1b7f3a; color: #1b7f3a; background: #eef8f1; }
.conn-badge.err { border-color: #b00020; color: #b00020; background: #fdeef0; }
.conn-badge.off { border-color: #777; color: #777; background: #eee; }
.conn-dlg { background: #fff; border: 2px solid #000; padding: 16px;
  width: 780px; max-width: 94vw; box-sizing: border-box; max-height: 92vh;
  overflow: auto; }
.conn-dlg h3 { margin: 0 0 10px; font-size: 14px; }
.conn-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 16px;
  margin: 4px 0 8px; }
.conn-field { display: flex; flex-direction: column; gap: 4px; font-size: 12px;
  color: #333; min-width: 0; }
.conn-field input, .conn-field select { width: 100%; box-sizing: border-box;
  padding: 5px 6px; border: 1px solid #000; font: inherit; font-size: 12px;
  background: #fff; color: #000; }
.conn-field .conn-hint { font-size: 11px; color: #666; line-height: 1.35; }
.conn-check { flex-direction: row; align-items: center; gap: 6px;
  grid-column: 1 / -1; }
.conn-check input { width: auto; }
.conn-req { color: #b00020; }
.conn-dlg-note { border-top: 1px dashed #ccc; padding-top: 8px; margin: 4px 0 8px;
  font-size: 12px; color: #333; }
.conn-enabled { display: inline-flex; align-items: flex-start; gap: 6px;
  font-size: 12px; color: #333; margin: 2px 0 8px; }
.conn-dlg-actions { display: flex; gap: 8px; justify-content: flex-end;
  margin-top: 10px; }
.conn-dlg-actions button { font-size: 12px; padding: 4px 12px; border: 1px solid #000;
  background: #fff; color: #000; cursor: pointer; }
.conn-dlg-actions button:hover { background: #000; color: #fff; }
.conn-sync-dlg, .conn-runs-dlg { width: 900px; }
.conn-sync-opts { display: flex; flex-direction: column; gap: 2px; }
.conn-sync-hint { font-size: 12px; color: #555; margin: 2px 0 8px; }
.conn-sync-result { max-height: 46vh; overflow: auto; margin: 6px 0; }
.conn-summary { border-left: 4px solid #1b7f3a; background: #eef8f1;
  padding: 6px 10px; font-size: 12px; margin-bottom: 8px; }
.conn-summary.err { border-left-color: #b00020; background: #fdeef0; }
.conn-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.conn-chip { font-size: 11px; border: 1px solid #bbb; background: #f7f7f7;
  padding: 2px 8px; color: #333; }
.conn-warn { border-left: 4px solid #b8860b; background: #fff8e1; padding: 6px 10px;
  font-size: 12px; margin-bottom: 8px; }
.conn-warn ul, .conn-error ul { margin: 4px 0 0 18px; padding: 0; }
.conn-error { border-left: 4px solid #b00020; background: #fdeef0; padding: 6px 10px;
  font-size: 12px; margin-bottom: 8px; color: #7a0016; }
.conn-applied { border: 1px dashed #1b7f3a; background: #f2fbf5; padding: 6px 10px;
  font-size: 12px; margin: 8px 0; }
.conn-applied button { margin-left: 8px; font-size: 11px; padding: 2px 8px;
  border: 1px solid #000; background: #fff; cursor: pointer; }
.conn-preview { margin: 6px 0 10px; }
.conn-preview h4 { margin: 6px 0 4px; font-size: 12px; }
.conn-preview table { width: 100%; border-collapse: collapse; font-size: 11px; }
.conn-preview th, .conn-preview td { border-bottom: 1px solid #e0e0e0;
  padding: 3px 5px; text-align: left; vertical-align: top; }
.conn-preview th { background: #f2f2f2; white-space: nowrap; }
.conn-preview td { max-width: 240px; }
.conn-aps-card { border: 1px solid #000; background: #fafafa; padding: 8px 10px;
  font-size: 12px; margin: 6px 0 10px; }
.conn-aps-card h4 { margin: 0 0 6px; font-size: 12px; }
.conn-aps-card code { word-break: break-all; }
.conn-runs td { font-size: 11px; }
body.skin-dark .conn-hint, body.skin-dark .conn-field,
body.skin-dark .conn-dlg-note, body.skin-dark .conn-enabled,
body.skin-dark .conn-sync-hint, body.skin-dark .conn-last { color: #c8c8c8; }
body.skin-dark .conn-tbl th { background: #222; }
body.skin-dark .conn-tbl th, body.skin-dark .conn-tbl td { border-color: #444; }
body.skin-dark .conn-dlg { background: #1b1b1b; border-color: #777; }
body.skin-dark .conn-field input, body.skin-dark .conn-field select { background: #111;
  color: #eee; border-color: #777; }
body.skin-dark .conn-empty { color: #aaa; }
body.skin-dark .conn-aps-card, body.skin-dark .conn-chip { background: #222;
  border-color: #555; color: #ddd; }
body.skin-dark .conn-summary { background: #17301f; color: #ddd; }
body.skin-dark .conn-summary.err, body.skin-dark .conn-error { background: #35141a; }
body.skin-dark .conn-warn { background: #33290a; }
body.skin-dark .conn-applied { background: #17301f; color: #ddd; }
body.skin-dark .conn-preview th { background: #222; }
body.skin-dark .conn-preview td, body.skin-dark .conn-preview th { border-color: #444; }
