/* ==========================================================================
   Монитор — таблица стилей
   Файл разбит по областям интерфейса. Правила внутри каждой секции
   применяются в порядке каскада (как в браузере).

   О !important: их 105. Это НЕ случайность и НЕ то, что нужно массово
   удалять. Таблица расписания (`.shift-cell`, `.date-head`) перебивается
   более специфичными правилами (`.schedule th`, `.schedule td`,
   `.schedule tbody tr:hover ...`), потому что базовые размеры ячеек
   задаются на уровне таблицы, а конкретные — на уровне ячейки.
   Убранный !important там сразу теряет ширину и выравнивание
   (проверено: `.date-head` терял width 256px -> 62px).
   Переписывать эти места нужно через снижение специфичности базовых
   правил, а не через удаление !important.
   ========================================================================== */
html{scrollbar-color:#2e405a #0b111b;scrollbar-width:thin}*{scrollbar-color:#2e405a #0f1724;scrollbar-width:thin}::-webkit-scrollbar{width:10px;height:10px}::-webkit-scrollbar-track{background:#0b111b}::-webkit-scrollbar-thumb{background:#2e405a;border:2px solid #0b111b;border-radius:8px}::-webkit-scrollbar-thumb:hover{background:#456184}:root{font-family:Inter,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;color:#e8edf5;background:#0c111b;--bg:#0b111c;--bg-alt:#0c111b;--panel:#121a28;--panel-alt:#101a29;--border:#253249;--border-strong:#2a3b54;--border-input:#34445d;--border-field:#2d425c;--text:#e8edf5;--text-bright:#e5eef9;--muted:#7d90a8;--muted-alt:#9fb2c9;--accent:#9fc5ff;--danger-text:#ffb8c2;--warn-text:#ffd47b}*{box-sizing:border-box}body{margin:0;display:flex;min-height:100vh;background:radial-gradient(circle at 80% 0,#182743 0,var(--bg-alt) 42%)}aside{width:240px;padding:28px 18px;border-right:1px solid #273247;background:var(--bg)}aside h1{font-size:20px;margin:0 0 22px}nav{display:grid;gap:6px;margin-top:28px}nav a{padding:11px 12px;border-radius:8px;color:#9aa9bf;text-decoration:none}nav a:hover{background:#172237;color:#fff}.mode{display:inline-block;color:#57d3a0;border:1px solid #27654f;background:#10271f;border-radius:99px;padding:5px 9px;font-size:11px;letter-spacing:.08em;font-weight:700}main{flex:1;padding:42px;max-width:1500px}header{display:flex;justify-content:space-between;align-items:flex-start;margin-bottom:28px}.eyebrow{color:#69a7ff;font-weight:700;letter-spacing:.15em;font-size:11px;margin:0 0 8px}h2{font-size:32px;margin:0 0 8px}h3{margin:0 0 18px}.muted{color:#91a0b5}.cards{display:grid;grid-template-columns:repeat(4,1fr);gap:14px;margin-bottom:18px}.cards>div,.panel{background:var(--panel);border:1px solid var(--border);border-radius:12px;padding:18px}.cards span{display:block;color:#8291a8;font-size:12px;margin-bottom:10px}.cards strong{font-size:17px}.panel{margin-bottom:18px}.panel-title{display:flex;justify-content:space-between;align-items:center}.inline{display:flex;align-items:end;gap:14px;flex-wrap:wrap}label{display:grid;gap:6px;color:#9aa9bf;font-size:13px}input{width:130px;background:var(--bg);border:1px solid var(--border-input);color:#fff;border-radius:7px;padding:10px}button{background:#23334d;border:1px solid #3b5276;color:#f5f8fc;border-radius:7px;padding:10px 15px;cursor:pointer;font-weight:700}button:hover{background:#30486d}.primary{background:#2878dc;border-color:#4d96ec}.danger{border-color:#74404a;background:#281820;color:var(--danger-text)}.table-wrap{overflow:auto}table{width:100%;border-collapse:collapse;font-size:14px}th{text-align:left;color:#8798b1;font-size:12px;font-weight:600;text-transform:uppercase;letter-spacing:.04em}th,td{padding:13px 10px;border-bottom:1px solid var(--border);vertical-align:top}tbody tr:hover{background:#182235}.badge,.ok,.warn{display:inline-block;padding:4px 8px;border-radius:99px;background:#1d2d45;color:var(--accent);font-size:11px}.ok{background:#113629;color:#63d6a4}.warn{background:#46351b;color:#ffd27a}.mono,code{font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:12px;color:#a9bad1}.empty{text-align:center;color:#8291a8;padding:34px}.log-list{display:grid;gap:8px}.log-row{display:grid;grid-template-columns:170px 110px 1fr;gap:12px;align-items:start;padding:10px;border-bottom:1px solid var(--border)}.log-row code{grid-column:3;white-space:pre-wrap;word-break:break-word;color:#71829b}@media(max-width:900px){aside{width:190px}main{padding:24px}.cards{grid-template-columns:repeat(2,1fr)}}@media(max-width:600px){body{display:block}aside{width:auto;border-right:0;border-bottom:1px solid #273247}main{padding:18px}header{display:block}.cards{grid-template-columns:1fr}.log-row{grid-template-columns:1fr}.log-row code{grid-column:1}}
.legend{display:flex;gap:8px;flex-wrap:wrap;margin:0 0 14px}.legend span{font-size:11px;padding:4px 8px;border-radius:5px}.legend .day{background:#173f66;color:#8cc7ff}.legend .night{background:#352454;color:#d5b5ff}.legend .off{background:#26313d;color:#9aa9b9}.legend .assignment{background:#2d5c42;color:#a5e9bb}.schedule-wrap{overflow:auto;max-height:70vh}.schedule{min-width:1050px;border-collapse:separate;border-spacing:0;font-size:11px}.schedule th,.schedule td{min-width:62px;width:62px;text-align:center;padding:7px 4px;border-right:1px solid #27364b;border-bottom:1px solid #27364b}.schedule th{background:#19253a;color:#9eb0c7;position:sticky;top:0;z-index:2}.schedule th small{display:block;color:#6f9dd0;font-size:9px;margin-top:3px}.schedule .sticky{position:sticky;left:0;z-index:3;min-width:220px;width:220px;text-align:left;background:#121d2c}.schedule th.sticky{z-index:4}.schedule .employee small{display:block;color:#7d91aa;margin-top:4px;font-size:10px}.schedule td:not(.empty-cell){background:#1d4b3a;color:#b9f2cc;border-radius:2px}.schedule td.dayoff{background:#b42332;color:#fff0f0;font-weight:800}.schedule td.empty-cell{background:#101824}.schedule td span{display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.schedule tbody tr:hover td{filter:brightness(1.2)}
.controls{display:flex;justify-content:space-between;align-items:end;gap:24px}.schedule-panel{padding:0;overflow:hidden}.schedule-panel>.panel-title{padding:20px 22px 16px}.schedule-panel .legend{margin:0}.date-head{min-width:128px!important;width:128px!important;text-align:center!important}.date-head small{font-weight:400;color:#8397b0!important}.date-head div{display:flex;justify-content:space-around;margin-top:8px;color:#6f9dd0;font-size:9px}.date-head i{font-style:normal}.shift-cell{min-width:64px!important;width:64px!important;height:48px;padding:4px!important}.shift-cell .project{font-weight:800;color:#d9f7e3}.shift-cell small{display:block;font-size:9px;color:#9bc6aa;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.shift-cell:not(.empty-cell){background:#1b4938!important}.shift-cell.dayoff{background:#b42332!important;color:#fff0f0!important;font-weight:800}.shift-cell.empty-cell{background:#101824!important}.schedule .sticky{background:#111c2b}.schedule tbody tr:hover .sticky{background:#1b2b42}.schedule-wrap{max-height:calc(100vh - 290px);overflow:auto}.schedule thead th{top:0}.schedule thead th.sticky{left:0}
@media(max-width:800px){.controls{display:block}.controls form{margin-top:16px}.schedule-panel>.panel-title{display:block}.schedule-panel .legend{margin-top:12px}}

/* === РАСПИСАНИЕ ============================================================== */

.shift-cell.is-new{outline:2px solid #ffd166;outline-offset:-2px;box-shadow:inset 0 0 0 1px #ffd166,0 0 8px #ffd16666}.shift-cell .project{display:-webkit-box;font-size:10px;line-height:1.05;white-space:normal;overflow:hidden;overflow-wrap:anywhere;word-break:break-word;-webkit-line-clamp:3;-webkit-box-orient:vertical;max-height:32px}.shift-cell small{display:block;font-size:8px!important;line-height:1;margin-top:2px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.shift-cell[style]{color:#17202b}
.zoom-hint{margin:10px 22px 16px;color:#71839b;font-size:12px}.zoom-hint kbd{padding:2px 6px;border:1px solid #42536d;border-radius:4px;background:#1a2638;color:#d9e6f7;font-family:inherit}
[data-schedule-zoom]{--schedule-scale:1}.schedule{transform-origin:top left;transform:scale(var(--schedule-scale));width:calc(100% / var(--schedule-scale));margin-bottom:calc((var(--schedule-scale) - 1) * 100%)}

/* === ШАБЛОНЫ ================================================================= */

.notice{display:flex;gap:14px;align-items:center;color:#9bb3d0}.notice b{color:#64d3a2;white-space:nowrap}.template-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px;margin-bottom:18px}.template-card{background:var(--panel);border:1px solid var(--border);border-radius:12px;padding:18px}.template-card-head{display:flex;justify-content:space-between;align-items:start}.template-card h3{margin:12px 0 0}.template-card pre{white-space:pre-wrap;word-break:break-word;line-height:1.55;color:#d9e4f2;background:var(--bg);border-radius:8px;padding:14px;min-height:105px}.template-footer{display:flex;justify-content:space-between;color:#7d91aa;font-size:12px}.variables{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}.variable{display:grid;grid-template-columns:auto 1fr auto;gap:10px;align-items:center;background:#0e1623;border:1px solid var(--border);border-radius:7px;padding:9px}.variable code{color:#84b9ff}.variable span{color:#9aa9bf;font-size:13px}.variable button{padding:2px 8px}@media(max-width:800px){.template-grid,.variables{grid-template-columns:1fr}.notice{align-items:start;flex-direction:column}}
/* Keep the calendar readable while preserving its height. */
.date-head{min-width:256px!important;width:256px!important}.shift-cell{min-width:128px!important;width:128px!important;white-space:normal!important;vertical-align:middle!important}.schedule{min-width:2100px;table-layout:fixed}.shift-cell .project{display:-webkit-box!important;font-size:11px;line-height:1.08;max-height:42px;white-space:normal!important;overflow:hidden;overflow-wrap:anywhere;word-break:break-word;-webkit-line-clamp:3;-webkit-box-orient:vertical}.shift-cell small{display:block;font-size:9px!important;line-height:1.05;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
/* Final project label fit: use the full value, wrap aggressively, and keep the cell fixed. */
.shift-cell .project{display:block!important;font-size:9px!important;line-height:1.08;height:34px;max-height:34px;white-space:normal!important;overflow:hidden!important;overflow-wrap:anywhere!important;word-break:break-word!important;-webkit-line-clamp:unset!important}.shift-cell small{font-size:8px!important;height:9px;line-height:9px}
/* Employees stay neutral; project color belongs only to assignment cells and directory swatches. */
.schedule td.employee{background:#121d2c!important;color:var(--text)!important}.schedule tbody tr:hover td.employee{background:#1b2b42!important}.project-swatch{display:inline-block;width:24px;height:18px;border-radius:4px;border:1px solid #506078;vertical-align:middle;margin-right:8px}.projects-table td:first-child{white-space:nowrap}.bitrix-search{display:flex;gap:8px;align-items:center;margin-top:12px;max-width:620px}.bitrix-search input{width:260px}.bitrix-results{display:grid;gap:6px;margin-top:10px;padding:10px 12px;border:1px solid #2d425d;background:#0f1b2a;border-radius:8px;max-width:700px;color:#bfd0e5}.bitrix-results small{color:#879bb4}.bitrix-results span{font-size:12px;color:#dbe7f6}.bitrix-match{display:grid;gap:6px;min-width:180px}.bitrix-match small{font-size:10px;margin-left:4px}.bitrix-picker{display:grid;gap:5px;min-width:190px}.bitrix-selected-link{display:block;line-height:1.3}.bitrix-picker>a{color:var(--accent);text-decoration:none}.bitrix-picker>a:hover{text-decoration:underline}.bitrix-picker select{width:190px;max-width:100%;background:var(--bg);border:1px solid var(--border-input);color:#fff;border-radius:7px;padding:7px;font-size:11px}.bitrix-picker small{font-size:10px;color:#91a0b5;min-height:12px}.small-button{font-size:10px;padding:5px 8px}.bitrix-manual{display:flex;gap:5px}.bitrix-manual input{width:90px;padding:5px;font-size:10px}.tester-toggle{display:flex;align-items:center;gap:5px}.tester-toggle label{display:flex;align-items:center;gap:5px;white-space:nowrap}.tester-toggle input{width:auto;padding:0}.tester-toggle span{font-size:11px;color:#c9d8ea}.tester-state{font-size:10px;color:#72d7a5;min-height:12px}

/* === ТАБЛИЦЫ ================================================================= */

.group-row td{background:#1a2940!important;border-top:2px solid #355174;padding:10px 12px!important}.group-title{color:#b9d7ff;font-size:13px;font-weight:800;letter-spacing:.04em;text-transform:uppercase}.schedule .group-row td{background:#1a2940!important;color:#b9d7ff}.schedule .group-row td.sticky{background:#1a2940!important}
.category-row td{background:var(--panel-alt)!important;color:#8fb8e8!important;font-size:11px;text-transform:uppercase;letter-spacing:.08em;font-weight:700;padding:7px 12px!important}.group-row td{background:#213653!important;border-top:3px solid #4b79aa!important}.group-title{font-size:14px!important;color:#d1e6ff!important}
.category-row td{background:var(--panel-alt)!important;color:#8fb8e8!important;font-size:12px;text-transform:uppercase;letter-spacing:.08em;font-weight:800;padding:9px 12px!important;border-left:4px solid #568bc2}.category-title{display:block;padding-left:8px}.group-row td{background:#213653!important;border-top:3px solid #4b79aa!important;padding:14px 12px!important}.group-title{font-size:16px!important;color:#d1e6ff!important}
.integration-status{display:flex;gap:8px;flex-wrap:wrap;margin-top:14px}.health-pill{display:inline-flex;align-items:center;gap:7px;background:#111b29;border:1px solid #283950;border-radius:99px;padding:6px 10px;font-size:11px;color:#bdcbe0}.health-pill small{color:#8092aa}.health-dot{width:9px;height:9px;border-radius:50%;display:inline-block;background:#687789;box-shadow:0 0 0 3px #ffffff0d}.health-dot.up{background:#39d98a;box-shadow:0 0 8px #39d98a99}.health-dot.down{background:#ff657a;box-shadow:0 0 8px #ff657a66}

/* === СТОП-КРАН =============================================================== */

.stopcock-panel{max-width:880px}.current-state{display:flex;align-items:center;gap:16px;padding:16px 18px;margin-bottom:18px;border-radius:10px;background:#0c1420;border:1px solid var(--border-strong)}.current-state .health-dot{width:16px;height:16px}.current-state h3{margin:4px 0 0;font-size:21px}.stopcock-options{display:grid;gap:12px}.stopcock-option{position:relative;display:flex;align-items:flex-start;gap:14px;padding:16px;border-radius:10px;background:#111a27;border:1px solid #2a3a50;cursor:pointer}.stopcock-option:has(input:checked){border-color:#4b83c5;background:#17263b;box-shadow:0 0 0 1px #4b83c555}.stopcock-option input{position:absolute;opacity:0;pointer-events:none}.switch-indicator{flex:0 0 20px;width:20px;height:20px;margin-top:1px;border:2px solid #6e819b;border-radius:50%}.stopcock-option input:checked+.switch-indicator{border:6px solid #55a1f3;background:#e8f3ff}.stopcock-option div{display:grid;gap:5px}.stopcock-option b{color:#e6effa}.stopcock-option small{font-size:13px;line-height:1.5;color:#96a9c1}.stopcock-option:nth-child(1):has(input:checked){border-color:#fa6778}.stopcock-option:nth-child(1):has(input:checked) .switch-indicator{border-color:#fa6778}.stopcock-option:nth-child(2):has(input:checked){border-color:#ffc857}.stopcock-option:nth-child(2):has(input:checked) .switch-indicator{border-color:#ffc857}.stopcock-option:nth-child(3):has(input:checked){border-color:#45d495}.stopcock-option:nth-child(3):has(input:checked) .switch-indicator{border-color:#45d495}.safety-note{max-width:880px;color:#9aadc5;line-height:1.6}.safety-note b{color:#ffd166}
.legacy-tester-panel{display:none}.stopcock-panel{max-width:900px}.safety-note{max-width:900px;color:#9aadc5;line-height:1.6}
.snapshot-warning{display:grid;gap:4px;margin-top:12px;padding:11px 14px;border:1px solid #b54957;background:#351b24;color:#ffdce0;border-radius:8px;max-width:900px}.snapshot-warning small{color:#f5aab4;overflow-wrap:anywhere}

/* === ЖУРНАЛ И ТОСТЫ ========================================================== */

.live-toast-region{position:fixed;right:22px;top:18px;z-index:10000;display:grid;gap:10px;width:min(430px,calc(100vw - 32px));pointer-events:none}.live-toast{pointer-events:auto;background:#142235;border:1px solid #3a587d;border-left:4px solid #51d49a;border-radius:10px;padding:13px 15px;box-shadow:0 12px 36px #0008;color:#e7f0fc;animation:toast-in .25s ease-out}.live-toast .toast-head{display:flex;justify-content:space-between;gap:12px;font-size:12px;color:#9eb4cf}.live-toast b{display:block;margin:5px 0}.live-toast small{color:#9eafc4}.live-toast.removing{animation:toast-out .35s ease-in forwards}@keyframes toast-in{from{transform:translateX(20px);opacity:0}to{transform:translateX(0);opacity:1}}@keyframes toast-out{to{transform:translateX(20px);opacity:0}}.activity-list{display:grid;gap:10px}.activity-event{display:grid;grid-template-columns:110px 150px 1fr;gap:12px;padding:14px;border:1px solid var(--border-strong);border-radius:9px;background:var(--panel-alt)}.activity-event .event-type{color:#8dc2ff;font-weight:700}.activity-event time{font-size:12px;color:#7f93ad}.activity-event p{margin:4px 0 0;color:#9aacc1}.sound-toggle{margin-left:auto}
/* Keep event timestamps inside the compact first column on narrower viewports. */
.activity-event time{display:block;min-width:0;max-width:110px;white-space:normal;overflow-wrap:anywhere;word-break:break-word;font-variant-numeric:tabular-nums;line-height:1.25}
.activity-event{grid-template-columns:minmax(82px,110px) minmax(120px,150px) minmax(180px,1fr);min-width:0}.activity-event>div{min-width:0;overflow-wrap:anywhere}.activity-event p{margin:4px 0 0;overflow-wrap:anywhere}.live-toast .toast-head{min-width:0;flex-wrap:wrap}.live-toast .toast-head span{overflow-wrap:anywhere}
.event-detail{display:block;color:#8fa1b8;font-size:11px;line-height:1.4;margin-top:4px;max-width:420px;white-space:normal}.review-actions{display:flex;gap:5px;flex-wrap:wrap}.review-actions button{font-size:11px;padding:6px 8px}.confirm-button{border-color:#2c795c;background:#173c30}.cancel-button{border-color:#74404a;background:#321d26}.status-detected{background:#43351b;color:#ffd27a}.status-cooling{background:#273d5c;color:#a9d0ff}.status-confirmed{background:#143d30;color:#6ce0a9}.status-cancelled{background:#303b49;color:#a6b4c3}.timestamp{white-space:nowrap;font-variant-numeric:tabular-nums}
/* Assignment cells inherit the project color captured from the source Site. */
.shift-cell:not(.empty-cell):not(.dayoff){background:var(--project-color,#1b4938)!important;color:#101923!important;border-color:#ffffff36}.shift-cell:not(.empty-cell):not(.dayoff) .project{color:#101923!important;text-shadow:0 1px 0 #ffffff55}.shift-cell:not(.empty-cell):not(.dayoff) small{color:#1b2632!important}.schedule tbody tr:hover .shift-cell:not(.empty-cell):not(.dayoff){filter:brightness(1.12)}
.message-preview{display:block;min-width:220px;max-width:340px;white-space:normal;line-height:1.45;color:#d8e6f7;background:#111b29;border:1px solid var(--border-strong);border-radius:7px;padding:8px}.situation-header{align-items:center}.cooling-settings{margin-bottom:18px}.settings-card{max-width:900px}.situation-summary-frame{margin-bottom:18px}.frame-toggle{font-size:11px;padding:6px 10px}.frame-body{min-width:0}.situation-panel .frame-body{max-height:360px;overflow:auto;padding-right:4px}.situation-panel.collapsed .frame-body,.situation-summary-frame.collapsed .frame-body{display:none}.situation-panel.collapsed,.situation-summary-frame.collapsed{min-height:0;padding-bottom:12px}.cooling-form{display:flex;align-items:end;gap:14px;flex-wrap:wrap}.cooling-form label{min-width:220px}.cooling-form input{width:180px}.cooling-form small{font-size:10px;color:#8295ae;line-height:1.3}.cooling-settings .panel-title{margin-bottom:12px}.situation-live{display:grid;grid-template-columns:auto auto;column-gap:10px;align-items:center;padding:12px 16px;background:#101b29;border:1px solid var(--border-field);border-radius:10px}.situation-live small{grid-column:2;color:#8295ae;font-size:11px}.live-dot{width:10px;height:10px;border-radius:50%;background:#42d392;box-shadow:0 0 10px #42d39288}.situation-live strong{font-size:12px}.situation-metrics{margin-bottom:18px}.situation-metrics>div{min-width:0}.situation-metrics strong{font-size:20px}.situation-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px;align-items:start}.situation-panel .frame-body{max-height:330px;overflow:auto}.situation-panel{min-width:0;margin:0;padding:18px}.situation-panel h3{margin:0 0 5px}.situation-panel .panel-title{gap:12px;margin-bottom:14px}.situation-panel .panel-title .eyebrow{margin-bottom:4px}.situation-panel .panel-title .muted{font-size:12px;margin:0}.parser-panel{grid-column:1}.queue-panel{grid-column:2;grid-row:1 / span 2}.delivery-panel{grid-column:1}.notices-panel{grid-column:1 / -1}.status-pill{display:inline-flex;align-items:center;border-radius:99px;padding:4px 9px;font-size:10px;font-weight:800;white-space:nowrap;border:1px solid #364963;background:#18263a;color:#abc6e8}.status-pill.success{background:#123628;border-color:#27664c;color:#72e0ab}.status-pill.failure,.status-pill.blocked{background:#351b24;border-color:#824251;color:#ffacb7}.status-pill.pending{background:#3d301a;border-color:#745b27;color:var(--warn-text)}.status-pill.cooling{background:#192c45;border-color:#396391;color:#a8d1ff}.process-list,.queue-list,.notice-list{display:grid;gap:10px}.process-row,.queue-card,.notice-card{background:#0e1622;border:1px solid #273950;border-radius:9px;padding:12px}.process-row{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:7px 12px;align-items:start}.process-row b,.queue-card strong{font-size:13px;color:var(--text-bright)}.process-row small{display:block;margin-top:4px;color:#8498b1;font-size:10px}.process-row p{grid-column:1/-1;margin:0;color:#9aadc4;font-size:11px;overflow-wrap:anywhere}.queue-card{border-left:3px solid #648fc4}.queue-card:has(.status-pill.cooling){border-left-color:#f0b84f}.queue-heading{display:flex;justify-content:space-between;align-items:start;gap:10px}.queue-meta{margin:6px 0 10px;color:#91a4bc;font-size:11px;overflow-wrap:anywhere}.queue-details{display:flex;flex-wrap:wrap;gap:6px 14px;color:#a8bad0;font-size:10px;margin-bottom:11px}.queue-details b{color:var(--warn-text)}.delivery-preview{padding:10px;background:#131f2e;border:1px solid #2c4059;border-radius:7px}.preview-head{display:flex;justify-content:space-between;gap:8px}.delivery-preview p{margin:7px 0 3px;color:#bfd0e5;font-size:11px}.delivery-preview small{display:block;min-height:12px;color:#8296ae;font-size:10px}.delivery-preview pre{margin:8px 0;background:#0a111a;border-radius:5px;padding:8px;color:#dbe8f8;font:11px/1.45 ui-monospace,monospace;white-space:pre-wrap;overflow-wrap:anywhere}.delivery-preview em{font-style:normal;color:#f7a7b0;font-size:9px;font-weight:900;letter-spacing:.08em}.notice-card{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:8px;align-items:start}.notice-card>div{display:flex;align-items:center;gap:8px;flex-wrap:wrap}.notice-card small{color:#8397b0;font-size:10px}.notice-card p{grid-column:1;margin:0;color:#9bacc1;font-size:11px;overflow-wrap:anywhere}.notice-card button{grid-column:2;grid-row:1/3;padding:3px 9px;color:#ffbec6;border-color:#71414a}.compact-empty{padding:16px 5px;margin:0;font-size:12px}.notices-panel #clear-notices{font-size:10px;padding:7px 10px}.situation-live.connected .live-dot{animation:live-pulse 2s infinite}@keyframes live-pulse{50%{opacity:.45;box-shadow:none}}@media(max-width:1050px){.situation-grid{grid-template-columns:1fr}.parser-panel,.queue-panel,.delivery-panel,.notices-panel{grid-column:1;grid-row:auto}}@media(max-width:800px){.situation-header{display:block}.situation-live{margin-top:14px;width:max-content}.situation-metrics{grid-template-columns:repeat(2,minmax(0,1fr))}.situation-panel{padding:14px}.queue-heading{flex-wrap:wrap}}
.event-detail{display:block;color:#869ab3;font-size:11px;line-height:1.4;margin-top:4px;white-space:normal;max-width:330px}.changes-table td{vertical-align:top}.changes-table .badge.status-detected{background:#4a391c;color:#ffe09a}

/* ===== Situation Center — compact 2x2 dashboard (2026-10-22) ===== */

/* === SITUATION CENTER ======================================================== */

.sit-wrap{display:flex;flex-direction:column;height:calc(100vh - 84px);min-height:0;gap:10px};max-width:100%;overflow:hidden
.sit-top{display:flex;justify-content:space-between;align-items:center;gap:16px;margin:0;flex:0 0 auto;flex-wrap:nowrap}
.sit-top-title{flex:0 0 auto}
.sit-top-title .eyebrow{margin:0 0 1px}
.sit-top-title h2{margin:0;font-size:20px;line-height:1.15;white-space:nowrap}
.sit-top-meta{display:flex;flex-wrap:nowrap;gap:5px;justify-content:flex-end;overflow:hidden;min-width:0};flex:1 1 auto
.sit-chip{display:inline-flex;align-items:center;gap:5px;padding:4px 9px;background:#101b29;border:1px solid var(--border-field);border-radius:8px;font-size:10.5px;color:var(--muted-alt);white-space:nowrap;flex:0 1 auto;min-width:0;overflow:hidden}
.sit-chip b{color:var(--text-bright);font-weight:700;max-width:170px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.sit-chip small{color:var(--muted);font-size:9.5px;max-width:150px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.sit-chip .live-dot{width:8px;height:8px;box-shadow:none}
.sit-chip.connected .live-dot{animation:live-pulse 2s infinite}

.sit-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));grid-template-rows:repeat(2,minmax(0,1fr));gap:12px;flex:1 1 auto;min-height:0}
/* Channel panels always sit in the right-hand column, so the two message
   feeds line up on the right regardless of source order. */
.sit-panel[data-channel]{grid-column:3}
.sit-panel{display:flex;flex-direction:column;min-width:0;min-height:0;margin:0;padding:12px 14px;background:var(--panel);border:1px solid var(--border);border-radius:12px;overflow:hidden}
.sit-head{display:flex;justify-content:space-between;align-items:flex-start;gap:10px;flex:0 0 auto;margin-bottom:8px}
.sit-head h3{margin:0;font-size:15px;line-height:1.2}
.sit-head .eyebrow{margin:0 0 2px;font-size:10px}
.sit-head-right{display:flex;align-items:center;gap:6px;flex-shrink:0}
.frame-toggle{font-size:10px;padding:4px 9px;border-radius:6px}
.sit-body{flex:1 1 auto;min-height:0;overflow:auto;margin:0 -4px;padding:0 4px;scrollbar-width:thin;scrollbar-color:#3a5170 #0d1520}.sit-body::-webkit-scrollbar{width:9px}.sit-body::-webkit-scrollbar-thumb{background:#3a5170;border-radius:6px;border:2px solid var(--panel)}.sit-body::-webkit-scrollbar-track{background:#0d1520}
.sit-panel.collapsed .sit-body{display:none}
.sit-panel.collapsed{flex:0 0 auto}

.sit-grid .sit-table{
font-size:11px}
.sit-table{width:100%;border-collapse:collapse;font-size:12px}
.sit-table thead th{position:sticky;top:0;z-index:1;background:var(--panel);text-align:left;padding:5px 8px;font-size:9px;letter-spacing:.06em;text-transform:uppercase;color:var(--muted);font-weight:700;border-bottom:1px solid var(--border);white-space:nowrap}
.sit-table td{padding:6px 8px;border-bottom:1px solid #1c2739;vertical-align:top;color:#c6d5e6;line-height:1.35}
.sit-table tbody tr:hover{background:#182235}
.sit-table td b{color:#e8f0fa;font-weight:600;font-size:12px}
.sit-sub{display:block;color:var(--muted);font-size:10px;margin-top:1px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:260px}
.sit-event-list{margin:3px 0 0;padding-left:14px;list-style:disc;white-space:normal;max-width:340px}
.sit-event-list li{color:var(--muted);font-size:10px;line-height:1.35}
.sit-dim{color:var(--muted)}
.col-status{width:1%;white-space:nowrap}
/* In the message tiles the last column is the message itself; let it take
   all remaining width instead of leaving it to the status badge. */
.sit-panel[data-channel] .sit-table th:last-child,
.sit-panel[data-channel] .sit-table td:last-child{width:auto}
.sit-panel[data-channel] .sit-table .col-status{max-width:120px;overflow:hidden;text-overflow:ellipsis}
.col-num{width:1%;white-space:nowrap;text-align:right;color:var(--muted-alt)}
.col-time{white-space:nowrap;font-variant-numeric:tabular-nums}
/* Date above, clock below: one narrower column, more room for the message. */
.time-date{display:block;font-size:10px;color:var(--muted-alt);line-height:1.2}
.time-clock{display:block;font-size:11px;line-height:1.2}
.sit-empty{text-align:center;color:var(--muted);padding:18px 8px!important;font-size:12px}
.sit-x{padding:1px 7px;line-height:1.2;font-size:13px;color:#ffbec6;border-color:#71414a;border-radius:6px}
.status-pill{display:inline-flex;align-items:center;border-radius:99px;padding:2px 7px;font-size:9px;font-weight:800;white-space:nowrap;border:1px solid #364963;background:#18263a;color:#abc6e8}
.status-pill.success{background:#123628;border-color:#27664c;color:#72e0ab}
.status-pill.failure,.status-pill.blocked{background:#351b24;border-color:#824251;color:#ffacb7}
.status-pill.pending{background:#3d301a;border-color:#745b27;color:var(--warn-text)}
.status-pill.cooling{background:#192c45;border-color:#396391;color:#a8d1ff}

@media(max-width:1000px){.sit-wrap{height:auto}.sit-grid{grid-template-columns:1fr;grid-template-rows:none}.sit-panel{min-height:260px}}

/* Situation header chips: final overrides */
.sit-top .sit-chip{display:inline-flex!important;align-items:center!important;gap:5px!important;padding:4px 9px!important;background:#101b29!important;border:1px solid var(--border-field)!important;border-radius:8px!important;font-size:10.5px!important;color:var(--muted-alt)!important;white-space:nowrap!important;flex:0 1 auto!important;min-width:0!important;overflow:hidden!important}
.sit-top .sit-chip b{color:var(--text-bright)!important;font-weight:700!important;max-width:170px!important;overflow:hidden!important;text-overflow:ellipsis!important;white-space:nowrap!important}
.sit-top .sit-chip small{color:var(--muted)!important;font-size:9.5px!important;max-width:150px!important;overflow:hidden!important;text-overflow:ellipsis!important;white-space:nowrap!important}

/* Compact delivery mode and stopcock lights in Situation Center header */
.sit-top .delivery-controls,.sit-top .stopcock-controls{gap:6px;padding:4px 8px}
.delivery-control-label{font-size:10px;color:var(--muted-alt);white-space:nowrap}
.light-switch{display:inline-flex;align-items:center;gap:4px;margin:0;padding:0}
.light-dot{width:15px;height:15px;min-width:15px;padding:0;border-radius:50%;border:1px solid #42516a;background:#1a2433;box-shadow:inset 0 0 0 2px #0c1420;cursor:pointer}
.light-dot.red{background:#752b37}.light-dot.yellow{background:#705b21}.light-dot.green{background:#236244}
.light-dot.active{box-shadow:0 0 0 2px #d8e7f7,0 0 9px currentColor}
.light-dot.red.active{color:#ff697b;background:#ed4055}.light-dot.yellow.active{color:#ffd35a;background:#f1bd32}.light-dot.green.active{color:#4de098;background:#30c77c}

/* === ФОРМЫ И КНОПКИ ========================================================== */

.light-switch input[type=hidden]{display:none}
@media(max-width:1150px){.sit-top{align-items:flex-start}.sit-top-meta{flex-wrap:wrap}.sit-top .delivery-controls,.sit-top .stopcock-controls{flex:0 0 auto}}
.sit-top-meta{max-width:100%;box-sizing:border-box}.sit-top .sit-chip{max-width:100%}.sit-top .stopcock-controls,.sit-top .delivery-controls{flex-shrink:1}.sit-top .sit-chip small{min-width:0}
main{min-width:0;overflow-x:hidden}
.sit-wrap{width:100%;min-width:0}

/* Situation Center: three live tiles below the 2x2 grid */
.sit-grid{grid-template-rows:repeat(2,minmax(0,1fr)) auto}
.sit-grid>.sit-panel:nth-child(n+5){grid-column:span 1}
@media(min-width:1400px){.sit-grid{grid-template-columns:repeat(3,minmax(0,1fr))}.sit-grid>.sit-panel:nth-child(n+5){grid-column:span 1}}
.sit-grid>.sit-panel:nth-child(1),.sit-grid>.sit-panel:nth-child(2){grid-row:1}
.sit-grid>.sit-panel:nth-child(3),.sit-grid>.sit-panel:nth-child(4){grid-row:2}
.sit-grid>.sit-panel:nth-child(n+5){min-height:230px;max-height:300px}

/* Collapsible sidebar */
aside{transition:width .18s ease}
.side-top{display:flex;align-items:center;justify-content:space-between;gap:8px;margin:0 0 18px}
.side-top h1{margin:0;font-size:20px;white-space:nowrap}
.side-toggle{padding:2px 8px;font-size:13px;line-height:1.3;border-radius:6px;flex:0 0 auto}
nav a{display:flex;align-items:center;gap:9px}
.nav-ico{width:18px;text-align:center;flex:0 0 18px;font-size:13px;opacity:.85}
aside.collapsed{width:64px;padding:28px 8px}
aside.collapsed .side-text{display:none}
aside.collapsed .side-top{justify-content:center;margin-bottom:14px}
aside.collapsed .mode{display:none}
aside.collapsed nav a{justify-content:center;padding:11px 4px}
aside.collapsed nav a .nav-ico{width:auto;flex:0 0 auto}

/* Message templates editor */
.template-section{margin-bottom:16px}
.template-card{margin-bottom:12px;border:1px solid #273950;border-radius:9px;padding:14px;background:#0e1622}
.template-card.locked{background:#0c131d;border-style:dashed}
.template-card h4{margin:2px 0 10px;font-size:14px}
.template-form textarea{width:100%;box-sizing:border-box;background:var(--bg);border:1px solid var(--border-input);color:var(--text);border-radius:7px;padding:10px;font:12px/1.5 ui-monospace,monospace;resize:vertical}
.template-actions{display:flex;align-items:center;gap:12px;margin-top:9px}
.template-actions .small{font-size:11px}
.ok-note{border-color:#27664c;background:#10271f}
.err-note{border-color:#824251;background:#2a1720}
.required-hint{margin:0 0 9px;padding:8px 10px;border:1px solid #745b27;background:#2a2213;border-radius:7px;font-size:11px;color:var(--warn-text);line-height:1.5}
.required-hint code{color:#ffe9b0;background:#3a2f18;padding:1px 5px;border-radius:4px}

/* Situation Center: full-width layout, uniform tile sizing */
main{max-width:none!important}
.sit-grid{grid-template-rows:repeat(3,minmax(0,1fr))!important}
.sit-grid>.sit-panel:nth-child(n+5){min-height:0!important;max-height:none!important;grid-column:span 1!important}
@media(max-width:1000px){.sit-grid{grid-template-rows:none!important}}
.sit-wrap{width:100%!important;max-width:none!important}
.purge-form{margin:0;padding:0;background:none;border:0}
.purge-button{font-size:10.5px;padding:4px 9px;border-radius:8px;border:1px solid #824251;background:#351b24;color:var(--danger-text);font-weight:700;cursor:pointer;white-space:nowrap}
.purge-button:hover{background:#4a2431}
.purge-button b{color:#fff;margin-left:3px}

/* Telegram invite controls in /employees */

/* === СОТРУДНИКИ ============================================================== */

.tg-cell{display:grid;gap:5px;min-width:170px}
.tg-link{width:100%;font-size:10px;padding:4px 6px;background:var(--bg);border:1px solid var(--border-input);color:var(--accent);border-radius:6px}
.tg-actions{display:flex;gap:5px;flex-wrap:wrap}
.tg-actions form{margin:0}

/* Global status bar shown on every page */

/* === ГЛОБАЛЬНЫЙ СТАТУС-БАР =================================================== */

.global-status{display:flex;flex-wrap:wrap;gap:6px;margin:0 0 14px;padding:8px 10px;background:#0e1622;border:1px solid var(--border);border-radius:10px}
.gs-chip{display:inline-flex;align-items:center;gap:5px;padding:3px 8px;background:#101b29;border:1px solid var(--border-field);border-radius:7px;font-size:10.5px;color:var(--muted-alt);white-space:nowrap}
.gs-chip b{color:var(--text-bright);font-weight:700}
.gs-chip small{color:var(--muted);font-size:9.5px}
.gs-chip .live-dot{width:7px;height:7px;box-shadow:none}
.gs-chip .live-dot.connected{animation:live-pulse 2s infinite}
.gs-chip .health-dot{width:9px;height:9px;box-shadow:none}
.gs-chip .health-dot.up{background:#39d98a}
.gs-chip .health-dot.down{background:#ff657a}

/* Channel kill switches */
.channel-switches{display:grid;gap:10px;margin-top:12px}
.channel-row{display:flex;align-items:center;gap:14px;padding:12px 14px;background:#0e1622;border:1px solid #273950;border-radius:9px}
.channel-row>div{display:grid;gap:2px;flex:1;min-width:0}
.channel-row small{color:#8291a8;font-size:11px}
.channel-row form{margin:0}

/* Header live switches and channel toggles */
.gs-switch{gap:7px}
.gs-toggle{display:inline-flex;align-items:center;cursor:pointer;margin:0;padding:0}
.gs-toggle input{position:absolute;opacity:0;width:0;height:0}
.gs-track{position:relative;display:inline-block;width:34px;height:18px;background:#2a3648;border:1px solid #3b5276;border-radius:99px;transition:background .15s}
.gs-thumb{position:absolute;top:2px;left:18px;width:12px;height:12px;border-radius:50%;background:#8fa5c0;transition:transform .15s,background .15s}
.gs-toggle input:checked+.gs-track{background:#1f5b41;border-color:#2f8a63}
.gs-toggle input:checked+.gs-track .gs-thumb{transform:translateX(-16px);background:#68e3a8}
.gs-toggle.small .gs-track{width:28px;height:15px}
.gs-toggle.small .gs-thumb{width:9px;height:9px;left:15px}
.gs-toggle.small input:checked+.gs-track .gs-thumb{transform:translateX(-13px)}
.gs-channel{gap:6px}
.gs-stopcock{display:inline-flex;gap:3px}
.gs-mode{padding:2px 7px;font-size:9px;font-weight:800;border-radius:6px;background:#1a2433;border:1px solid #364963;color:#8fa5c0;cursor:pointer}
.gs-mode:hover{background:#243248}
.gs-mode.active[data-mode="off"]{background:#ed4055;border-color:#ff697b;color:#fff}
.gs-mode.active[data-mode="test"]{background:#f1bd32;border-color:#ffd35a;color:#3a2c00}
.gs-mode.active[data-mode="on"]{background:#30c77c;border-color:#4de098;color:#062a1b}
.sit-grid{grid-template-rows:repeat(4,minmax(0,1fr))!important}

/* Situation Center: double tile height (page scrolls instead of squeezing) */
.sit-wrap{height:auto!important;min-height:calc(100vh - 84px)!important}
.sit-grid{grid-template-rows:repeat(auto-fill,minmax(420px,auto))!important;flex:0 0 auto!important}
.sit-panel{min-height:420px!important}
.sit-body{flex:1 1 auto!important}

/* Fix tile height: strict 420px rows */
.sit-grid{grid-auto-rows:420px!important;grid-template-rows:none!important;align-items:stretch!important}
.sit-panel{height:420px!important;min-height:420px!important;max-height:420px!important}
.sit-body{overflow:auto!important}
.sit-msg{max-width:420px;white-space:normal;line-height:1.4;font-size:11px;color:#c6d5e6}

/* Message preview with tooltip-style full text on hover */
.msg-preview{display:-webkit-box;max-width:100%;font-size:11px;line-height:1.35;color:#c6d5e6;white-space:normal;overflow:hidden;-webkit-line-clamp:3;-webkit-box-orient:vertical;cursor:help}
.msg-preview:hover{color:#fff}
.gs-pending-wrap{position:relative;padding:0!important;overflow:visible!important}
.gs-pending-toggle{border:0;background:transparent;color:#dbe7f6;font-size:10.5px;padding:5px 9px;cursor:pointer;font-weight:600}
.gs-pending-toggle b{color:var(--danger-text)}
.gs-pending-menu{position:absolute;right:0;top:calc(100% + 8px);z-index:1000;width:min(540px,calc(100vw - 32px));max-height:min(70vh,650px);overflow:auto;background:var(--panel-alt);border:1px solid #415777;border-radius:10px;box-shadow:0 16px 40px #000a;padding:10px}
.gs-pending-menu[hidden]{display:none}
.gs-pending-head{display:flex;justify-content:space-between;align-items:center;padding:2px 3px 9px;font-size:13px;font-weight:800;color:#e8eef7;border-bottom:1px solid var(--border-strong);position:sticky;top:-10px;background:var(--panel-alt)}
.gs-pending-head button{padding:1px 7px;font-size:18px}
.gs-pending-item{padding:9px 4px;border-bottom:1px solid #26364c}
.gs-pending-title{display:flex;justify-content:space-between;gap:12px;font-size:12px;color:var(--text-bright)}
.gs-pending-title time{color:#8da1ba;font:11px ui-monospace,monospace;white-space:nowrap}
.gs-pending-meta{margin-top:3px;font-size:11px;color:#b9cae0}
.gs-pending-reason{margin-top:3px;color:#ffcf76;font-size:10px}
.gs-pending-item details{margin-top:5px;color:#a7bdd6;font-size:10px}
.gs-pending-item summary{cursor:pointer}
.gs-pending-item details p{margin:4px 0 0;color:#d5e1ef;white-space:pre-wrap;line-height:1.4}
.gs-pending-empty{margin:12px 4px;color:#91a0b5;font-size:12px}
.gs-switch small,.gs-channel small{font-size:9px;color:#8fa5c0;font-weight:700}

/* Colour rule for the two delivery gates, agreed 2026-10-23:
   GREEN = sending is allowed, RED = sending is blocked.
   .gs-delivery   -> red when "Без отправки" is ON
   .gs-stopcock-chip -> red when the stopcock is OFF (delivery stopped)
   Yellow states (stopcock TEST) stay neutral: sending is limited, not blocked. */
.gs-delivery.is-blocked,.gs-stopcock-chip.is-blocked{background:#3a1820;border-color:#8c3542}
.gs-delivery.is-blocked b,.gs-stopcock-chip.is-blocked .gs-mode{color:#ffb8c2}
.gs-delivery.is-live,.gs-stopcock-chip.is-live{background:#122a20;border-color:#2f7a58}
.gs-delivery.is-live b{color:#7fe3b0}
.gs-delivery.is-blocked .gs-toggle input:checked+.gs-track{background:#8c3542;border-color:#c0505f}
.gs-delivery.is-blocked .gs-toggle input:checked+.gs-track .gs-thumb{background:#ffb8c2}
.gs-delivery.is-live .gs-toggle input+.gs-track{background:#1f5b41;border-color:#2f8a63}
.gs-delivery.is-live .gs-toggle input+.gs-track .gs-thumb{background:#68e3a8}
.gs-mode[aria-pressed="true"]{outline:1px solid #dbe7f6}
.auth-page{display:flex;min-height:100vh;align-items:center;justify-content:center;background:var(--bg-alt);padding:20px}.auth-card{width:min(430px,100%);padding:28px;background:var(--panel);border:1px solid var(--border-field);border-radius:12px;color:var(--text)}.auth-card h1{margin-top:0}.auth-card form{display:grid;gap:14px}.auth-card label{display:grid;gap:6px}.auth-card input{width:100%;box-sizing:border-box}.auth-card small{display:block;margin-top:18px;color:#8798b1;line-height:1.5}.auth-card a{display:block;margin-top:18px;color:var(--accent)}.auth-error{margin:12px 0;padding:10px;border:1px solid #824251;border-radius:7px;background:#351b24;color:var(--danger-text)}

/* === СВОИ ПЕРЕМЕННЫЕ (/templates) ============================================== */
.custom-vars{display:grid;gap:12px;margin-bottom:18px}
.custom-var{display:flex;gap:12px;align-items:flex-start;background:#0e1623;border:1px solid var(--border);border-radius:9px;padding:14px}
.custom-var-edit{flex:1;display:grid;gap:10px}
.custom-var-head{display:flex;align-items:center;gap:10px;flex-wrap:wrap}
.custom-var-head code{color:var(--accent);font-size:12px}
.custom-var-actions{display:flex;gap:8px;flex-wrap:wrap}
.custom-var-delete{align-self:flex-end}
.custom-var-add{display:grid;gap:12px;border-top:1px solid var(--border);padding-top:16px}
.custom-var-add-fields{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}
.custom-var-add-fields input{width:100%}
.custom-var label{display:grid;gap:6px;color:var(--muted-alt);font-size:12px}
.custom-var input{width:100%;background:var(--bg);border:1px solid var(--border-input);color:#fff;border-radius:7px;padding:8px;font-size:13px}
@media(max-width:800px){.custom-var-add-fields{grid-template-columns:1fr}.custom-var{flex-direction:column}}

/* === ВКЛАДКИ КАНАЛОВ В ШАБЛОНАХ ============================================== */
.channel-tabs{display:flex;gap:6px;margin:12px 0 10px;flex-wrap:wrap}
.channel-tab{background:#16202f;border:1px solid var(--border-input);color:var(--muted-alt);border-radius:99px;padding:6px 14px;font-size:12px;font-weight:600;cursor:pointer}
.channel-tab:hover{background:#1d2b3f;color:var(--text)}
.channel-tab.active{background:#1d4b8f;border-color:#4d96ec;color:#fff}
.channel-tab.has-override{border-color:#45d495}
.channel-tab.active.has-override{background:#17603f;border-color:#45d495;color:#dcffee}
.channel-panel[hidden]{display:none}

/* === ПОЯСНЕНИЯ НА СТРАНИЦЕ ШАБЛОНОВ ========================================== */
.how-it-works{margin:14px 0 20px;padding:14px 18px;background:#0e1623;border:1px solid var(--border);border-left:3px solid #4b83c5;border-radius:9px}
.how-it-works h4{margin:0 0 8px;font-size:13px;color:#b9d7ff;text-transform:uppercase;letter-spacing:.04em}
.how-it-works h4:not(:first-child){margin-top:16px}
.how-it-works ul{margin:0;padding-left:20px;color:var(--muted-alt);font-size:13px;line-height:1.6}
.how-it-works li{margin-bottom:6px}
.how-it-works code{background:#0b111c;padding:1px 5px;border-radius:4px;color:var(--accent);font-size:12px}
.how-it-works b{color:var(--text)}
.how-it-works p{margin:6px 0 0;line-height:1.6}

/* === ТЕСТОВАЯ ОТПРАВКА ШАБЛОНА =============================================== */
.test-actions{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin-top:10px;padding-top:10px;border-top:1px dashed var(--border)}
.test-form{display:inline;margin:0}
.test-actions .small-button{background:#1d3a5c;border-color:#3f6d9e;color:#cfe4fb}
.test-actions .small-button:hover{background:#264a73}

/* === МОДАЛЬНЫЕ ОКНА В СТИЛЕ САЙТА ============================================ */
/* Replaces the browser's native confirm()/alert(), which ignores the dark theme. */
.ui-dialog-host{position:fixed;inset:0;z-index:20000}
.ui-dialog-backdrop{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;padding:24px;background:#050810cc;backdrop-filter:blur(2px);animation:ui-dialog-fade .16s ease-out}
.ui-dialog{width:min(460px,100%);background:var(--panel);border:1px solid var(--border-strong);border-radius:14px;padding:22px 24px;box-shadow:0 24px 64px #0009;animation:ui-dialog-rise .18s ease-out}
.ui-dialog-danger{border-color:#8c3542}
.ui-dialog h3{margin:0 0 10px;font-size:17px;color:var(--text)}
.ui-dialog-message{margin:0 0 20px;color:var(--muted-alt);line-height:1.6;white-space:pre-wrap}
.ui-dialog-actions{display:flex;justify-content:flex-end;gap:10px;flex-wrap:wrap}
.ui-dialog-actions .primary{min-width:120px}
.ui-dialog-actions .danger-button{background:#8c3542;border-color:#c0505f}
.ui-dialog-actions .danger-button:hover{background:#a53f4e}
@keyframes ui-dialog-fade{from{opacity:0}to{opacity:1}}
@keyframes ui-dialog-rise{from{opacity:0;transform:translateY(8px) scale(.98)}to{opacity:1;transform:none}}
@media(max-width:600px){.ui-dialog{padding:18px}.ui-dialog-actions .primary,.ui-dialog-actions .small-button{flex:1}}

/* === ХРАНЕНИЕ ДАННЫХ И ЛОГИРОВАНИЕ (/settings) ============================== */
.retention-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px;margin:14px 0}
.retention-card{background:#0e1623;border:1px solid var(--border);border-radius:9px;padding:14px}
.retention-card h4{margin:0 0 8px;font-size:13px;color:#b9d7ff}
.retention-value{margin:0 0 6px;font-size:18px;font-weight:700;color:var(--text)}
.retention-action{display:flex;align-items:center;gap:12px;flex-wrap:wrap;margin-top:12px}
.logging-state{display:flex;align-items:center;gap:12px;margin:12px 0;flex-wrap:wrap}
.logging-badge{display:inline-block;padding:5px 12px;border-radius:99px;font-size:11px;font-weight:800;letter-spacing:.06em;background:#26313d;color:#9aa9b9}
.logging-badge.on{background:#46351b;color:#ffd27a}
.logging-button{width:100%;padding:16px;font-size:15px;border-radius:10px}
.logging-button-off{background:#3a1820;border-color:#8c3542;color:#ffb8c2}
.logging-button-off:hover{background:#4a1f29}
.logging-on-panel{border-color:#8c3542}
.logging-details{margin-top:16px}
.logging-details summary{cursor:pointer;color:var(--muted-alt);font-size:13px}
.logging-kinds{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px;margin-top:12px}
.logging-kinds h4{margin:0 0 8px;font-size:12px;color:var(--muted)}
@media(max-width:800px){.retention-grid,.logging-kinds{grid-template-columns:1fr}}

/* === ИСТЁКШАЯ СЕССИЯ И ВЫХОД ================================================ */
.session-expired{display:flex;align-items:center;gap:12px;flex-wrap:wrap;margin:0 0 12px;padding:12px 16px;background:#3a1820;border:1px solid #8c3542;border-radius:9px;color:#ffd9de}
.session-expired b{color:#ffb8c2;white-space:nowrap}
.session-expired span{color:#f0c6cd;font-size:13px}
.session-expired-link{margin-left:auto;padding:6px 16px;background:#8c3542;color:#fff;border-radius:7px;text-decoration:none;font-weight:700;font-size:13px;white-space:nowrap}
.session-expired-link:hover{background:#a53f4e}
/* Logout sits at the end of the status bar and must stay easy to find */
.gs-logout{margin-left:auto;text-decoration:none;color:#c8d4e2;border-color:#3b5276;font-weight:700}
.gs-logout::before{content:'⏻';margin-right:6px;opacity:.85}
.gs-logout:hover{background:#3a1820;border-color:#8c3542;color:#ffb8c2}

/* === АТРИБУТ hidden ДОЛЖЕН РАБОТАТЬ ВСЕГДА ================================== */
/* display:flex и другие значения в правилах выше перебивают браузерное
   [hidden]{display:none}. Без этого правила элемент с hidden=true остаётся
   видимым — именно так два баннера висели на экране, хотя в разметке и в
   коде стояло hidden. */
[hidden]{display:none!important}

/* === ХРАНЕНИЕ СООБЩЕНИЙ В ЧАТАХ ============================================= */
.retention-form{margin-top:14px;padding-top:14px;border-top:1px solid var(--border)}
.retention-form label{display:block;margin-bottom:8px;font-size:13px;color:var(--muted-alt)}
.retention-input-row{display:flex;align-items:center;gap:10px;flex-wrap:wrap}
.retention-input-row input[type=number]{width:110px;padding:9px 12px;background:#0b111c;border:1px solid var(--border-field);border-radius:8px;color:var(--text);font-size:15px;font-weight:700}
.retention-hint{padding:5px 12px;background:#122a20;border:1px solid #2f8a63;border-radius:99px;color:#68e3a8;font-size:12px;font-weight:700}

/* === ОБРАТНЫЙ ОТСЧЁТ ДО ОБНОВЛЕНИЯ ========================================== */
/* Sits inside the «Обновлено» chip and counts down to the next refresh; the
   interval comes from the interface_refresh_seconds setting. */
.gs-countdown{margin-left:6px;padding:1px 7px;border-radius:99px;background:#16212f;border:1px solid var(--border-field);color:var(--muted-alt);font-size:10.5px;font-weight:700;font-variant-numeric:tabular-nums;white-space:nowrap}
.gs-countdown.is-soon{background:#3a2f18;border-color:#8c6a35;color:#ffd27a}

/* === ЛЕГЕНДА ПРИЧИН В СИТУАЦИОННОМ ЦЕНТРЕ =================================== */
.reason-legend{flex:0 0 auto;background:var(--panel);border:1px solid var(--border);border-radius:12px;padding:10px 14px}
.reason-legend summary{cursor:pointer;color:var(--muted-alt);font-size:12px;font-weight:600}
.reason-legend-body{display:grid;grid-template-columns:repeat(auto-fit,minmax(240px,1fr));gap:14px;margin-top:12px}
.reason-group h4{margin:0 0 6px;font-size:11px;text-transform:uppercase;letter-spacing:.05em;color:#b9d7ff}
.reason-item{margin-bottom:7px;font-size:11.5px;line-height:1.45}
.reason-item b{display:block;color:var(--text)}
.reason-item span{color:var(--muted)}

/* === СТАТУС СОХРАНЕНИЯ ГАЛОЧКИ «НЕ ТРЕБОВАТЬ BITRIX» ======================== */
.bitrix-requirement{display:flex;flex-direction:column;gap:2px;margin-top:6px}
.bitrix-requirement label{display:inline-flex;align-items:center;gap:6px;font-size:11.5px;color:var(--muted-alt);cursor:pointer}
.bitrix-requirement input[type=checkbox]{accent-color:#4b83c5;cursor:pointer}
.bitrix-requirement-state{font-size:10.5px;color:var(--muted);min-height:13px}
.bitrix-requirement label:hover{color:var(--text)}

/* === НЕСКОЛЬКО СМЕН В ОДИН ДЕНЬ ============================================= */
/* An employee with two or three projects on the same date gets one sub-row per
   shift, each with its own project colour. The name cell spans those rows. */
.schedule tr.shift-continuation td{border-top:1px dashed rgba(120,150,190,.25)}
.schedule tr.shift-continuation td.sticky{display:none}
.schedule td.sticky.employee{vertical-align:top}
.schedule td.sticky.employee small{display:block}

/* === ОЖИДАНИЕ ПОДТВЕРЖДЕНИЯ ВХОДА ПО КНОПКЕ ================================= */
.auth-await{display:flex;align-items:center;gap:8px;margin:12px 0;padding:10px 14px;background:#12202f;border:1px solid var(--border-field);border-radius:8px;color:var(--muted-alt);font-size:13px}
.auth-await-dot{width:8px;height:8px;border-radius:50%;background:#4b83c5;animation:auth-pulse 1.2s ease-in-out infinite}
@keyframes auth-pulse{0%,100%{opacity:.35}50%{opacity:1}}

/* === ВЫБОР КАНАЛА ВТОРОГО ФАКТОРА =========================================== */
.auth-channel-list{display:flex;flex-direction:column;gap:10px;margin-top:18px}
.auth-channel{display:flex;flex-direction:column;align-items:flex-start;gap:3px;width:100%;padding:16px 18px;background:#0e1623;border:1px solid var(--border-field);border-radius:10px;color:var(--text);text-align:left;cursor:pointer;transition:border-color .15s,background .15s}
.auth-channel:hover:not(.is-disabled){background:#14212f;border-color:#4b83c5}
.auth-channel.is-disabled{opacity:.5;cursor:not-allowed}
.auth-channel-name{font-size:15px;font-weight:700}
.auth-channel-hint{font-size:12px;color:var(--muted)}
.auth-channel form{margin:0}

/* === ВОЗВРАТ К ВЫБОРУ СПОСОБА =============================================== */
.auth-back{margin-top:14px;padding-top:14px;border-top:1px solid var(--border)}
.auth-back button{width:100%}
