/* 15q: ⚙ «Агенты» (public/agents.js). Цвета — переменные темы. */
.ag-stats { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-bottom: 10px; }
.ag-stat { border: 1px solid var(--border); background: transparent; color: inherit; border-radius: 8px; padding: 4px 10px; cursor: pointer; font: inherit; }
.ag-stat:hover { border-color: var(--primary, #2563eb); }
.ag-err-t { color: var(--danger, #c0392b); border-color: var(--danger, #c0392b); }
.ag-filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.ag-filters select, .ag-filters input { min-width: 0; flex: 1 1 160px; max-width: 260px; }
.ag-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.ag-table th { position: sticky; top: 0; background: var(--card, #fff); z-index: 1; text-align: left; font-weight: 600; }
.ag-table th, .ag-table td { padding: 6px 8px; border-bottom: 1px solid var(--border); vertical-align: top; }
.ag-row.notbuilt td { color: var(--muted, #6b7280); }
.ag-row.off td.ag-name b { color: var(--muted, #6b7280); }
.ag-row.error td.ag-name b { color: var(--danger, #c0392b); }
.ag-num { width: 32px; text-align: right; color: var(--muted, #6b7280); }
.ag-task { max-width: 340px; }
.ag-kind { text-align: center; font-size: 16px; }
.ag-sum { max-width: 220px; overflow: hidden; text-overflow: ellipsis; }
.ag-acts { white-space: nowrap; }
.ag-acts button { margin: 0 4px 4px 0; }
.ag-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; vertical-align: middle; background: var(--muted, #9ca3af); }
.ag-ok { background: var(--success, #16a34a); }
.ag-warn { background: #d97706; }
.ag-err { background: var(--danger, #dc2626); }
.ag-skip { background: #9ca3af; }
.ag-badge { display: inline-block; padding: 0 6px; border-radius: 10px; font-size: 11px; background: color-mix(in srgb, var(--muted, #6b7280) 18%, transparent); color: var(--muted, #6b7280); }
.ag-crit { background: color-mix(in srgb, #d97706 20%, transparent); color: #b45309; }
.ag-mail { margin-top: 16px; }
.ag-mail-row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px 12px; }
.ag-mail-row label { display: flex; flex-direction: column; gap: 2px; font-size: 13px; flex: 1 1 220px; max-width: 320px; }
.ag-modal { max-width: 640px; max-height: 90vh; overflow: auto; }
.ag-mh { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ag-mh h3 { margin: 0; }
.ag-cfg { margin: 10px 0; padding: 8px 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.ag-cfg summary { cursor: pointer; font-weight: 600; }
.ag-f { display: flex; flex-direction: column; gap: 6px; margin: 10px 0; }
.ag-f > span { font-weight: 600; }
.ag-f label { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.ag-f input[type=number] { width: 80px; }
.ag-f input[type=text] { flex: 1 1 200px; min-width: 0; }
.ag-dows { display: flex; flex-wrap: wrap; gap: 4px 10px; padding-left: 22px; }
.ag-pend { padding: 6px 10px; border-left: 3px solid #d97706; background: color-mix(in srgb, #d97706 10%, transparent); }
.ag-log-h { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin: 8px 0 4px; flex-wrap: wrap; }
.ag-runs { width: 100%; border-collapse: collapse; font-size: 13px; }
.ag-runs td { padding: 4px 6px; border-bottom: 1px solid var(--border); vertical-align: top; }
.ag-runs td:first-child { white-space: nowrap; }
@media (max-width: 760px) {
  .ag-table thead { display: none; }
  .ag-table, .ag-table tbody, .ag-table tr, .ag-table td { display: block; width: auto; }
  .ag-table tr { border: 1px solid var(--border); border-radius: 8px; margin-bottom: 10px; padding: 8px 10px; display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; }
  .ag-table td { border: 0; padding: 2px 0; max-width: none; }
  .ag-table td.ag-num, .ag-table td.ag-dept, .ag-table td.ag-kind { display: none; }
  .ag-table td.ag-name { grid-column: 1; grid-row: 1; }
  .ag-table td.ag-on { grid-column: 2; grid-row: 1; text-align: right; }
  .ag-table td.ag-task, .ag-table td.ag-sched, .ag-table td.ag-last, .ag-table td.ag-acts { grid-column: 1 / -1; }
  .ag-table td.ag-sched::before, .ag-table td.ag-last::before { content: attr(data-l) ': '; color: var(--muted, #6b7280); font-size: 12px; }
  .ag-acts { white-space: normal; }
  .ag-sum { max-width: none; }
}
/* шире не вылезать: действия — столбиком, отдел — только на широких экранах (есть фильтр) */
@media (min-width: 761px) {
  .ag-acts { white-space: normal; width: 130px; }
  .ag-acts button { display: block; width: 100%; margin: 0 0 4px; }
  .ag-task { max-width: 260px; }
}
@media (min-width: 761px) and (max-width: 1500px) { .ag-table th:nth-child(3), .ag-table td.ag-dept { display: none; } }
#agents-body .table-wrap { overflow-x: auto; max-width: 100%; }
.ag-on .switch { display: inline-block; width: 34px; vertical-align: middle; }
.ag-f label input[type=checkbox], .ag-f label input[type=radio] { width: auto; flex: 0 0 auto; margin: 0; }
@media (max-width: 760px) { .ag-filters select, .ag-filters input { flex: 1 1 45%; max-width: none; } .ag-stat { padding: 3px 8px; } }
.ops-to-row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px 12px; margin: 10px 0 4px; } .ops-to-row label { display: flex; flex-direction: column; gap: 2px; font-size: 13px; flex: 1 1 220px; max-width: 380px; } .ops-to-row label.ais-chk { flex-direction: row; align-items: center; flex: 0 1 auto; }
/* 15z: страница «Агенты» — список → карточка (боковая панель, на телефоне — весь экран), вкладки «Штат» | «Кадры» */
.ag-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.ag-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); }
.ag-tab { border: 0; background: transparent; color: inherit; font: inherit; padding: 6px 14px; cursor: pointer; border-bottom: 2px solid transparent; }
.ag-tab.active { border-bottom-color: var(--primary, #2563eb); font-weight: 600; }
.ag-row { cursor: pointer; }
.ag-row:hover td { background: color-mix(in srgb, var(--primary, #2563eb) 6%, transparent); }
.ag-row:focus-visible { outline: 2px solid var(--primary, #2563eb); outline-offset: -2px; }
.ag-row-attest td.ag-name { box-shadow: inset 3px 0 0 #d97706; }
.ag-prob { background: color-mix(in srgb, var(--primary, #2563eb) 14%, transparent); color: var(--primary, #2563eb); }
.ag-attest { background: color-mix(in srgb, #d97706 22%, transparent); color: #92400e; }
.ag-attest-t { color: #92400e; }
.ag-attest-plate { padding: 8px 10px; border-radius: 8px; background: #fef3c7; color: #92400e; border: 1px solid #fcd34d; }
.ag-drawer { justify-content: flex-end; align-items: stretch; padding: 0; }
.ag-drawer .ag-modal { max-width: 640px; width: min(640px, 100vw); max-height: none; height: 100vh; border-radius: 0; margin: 0; overflow: auto; }
.ag-dl { display: grid; grid-template-columns: minmax(130px, 34%) 1fr; gap: 4px 12px; margin: 8px 0; }
.ag-dl dt { color: var(--muted, #6b7280); font-size: 13px; }
.ag-dl dd { margin: 0; }
.ag-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 10px 0; }
.ag-h4 { margin: 14px 0 6px; font-size: 15px; }
.ag-metrics th, .ag-metrics td { text-align: right; }
.ag-metrics th:first-child, .ag-metrics td:first-child { text-align: left; }
.ag-prop { border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; margin-bottom: 8px; }
.ag-prop summary { cursor: pointer; }
.ag-prop-act { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.ag-prop-act input { flex: 1 1 220px; min-width: 0; }
.ag-settings-link { font-size: 14px; }
#agents-settings-body .ag-f label input[type=checkbox] { width: auto; }
@media (max-width: 600px) {
  .ag-drawer .ag-modal { width: 100vw; max-width: 100vw; }
  .ag-dl { grid-template-columns: 1fr; }
  .ag-dl dt { margin-top: 4px; }
}

/* 02.11.2026 (КИ-3): тёмная тема */
html[data-theme="dark"] :is(.ag-attest, .ag-attest-t) { color: #F0C25A; }
