@font-face {
  font-family: 'Onest';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url('/fonts/onest-cyrillic-ext-wght-normal.woff2') format('woff2-variations');
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}
@font-face {
  font-family: 'Onest';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url('/fonts/onest-cyrillic-wght-normal.woff2') format('woff2-variations');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'Onest';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url('/fonts/onest-latin-wght-normal.woff2') format('woff2-variations');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --font: 'Onest', system-ui, sans-serif;
  --bg: #F2F2EE;
  --card-bg: #FFFFFF;
  --radius: 16px;
  --header-bg: #20211F;
  --surface-dark: #2A2C28;
  --line-dark: #44483E;
  --text-main: #20211F;
  --text-main-dark: #F7F8F5;
  --text-secondary: #5C5F55;
  --text-secondary-dark: #B6BBAE;
  --divider: #ECEDE8;
  --border: #E3E4DE;
  --border-strong: #D6D8D0;
  --accent: #D5F75A;
  --bar-inactive: #55594E;
  --better: #127A3F;
  --worse: #B42318;
  --no-data: #767970;
  --current-week-bg: #F2F8D8;
}

@media (min-width: 900px) {
  :root { --radius: 18px; }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text-main);
  font-size: 16px;
  line-height: 1.45;
}

a { color: inherit; }

.container {
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 16px;
}

/* ---- Login page ---- */

.login-body { background: var(--bg); }
.login-main { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 16px; }
.login-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 28px 24px;
  width: 100%;
  max-width: 360px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.logo--center { justify-content: center; margin-bottom: 6px; }
.logo--on-light { color: var(--text-main); }
.logo--on-light .logo__name { color: var(--text-main); }
.logo--on-light .logo__tagline { color: var(--text-secondary); }
.login-field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--text-secondary); }
.login-field input {
  font: inherit;
  min-height: 44px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text-main);
}
.login-field input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.login-submit {
  font: inherit;
  font-weight: 600;
  min-height: 44px;
  border-radius: 10px;
  border: none;
  background: var(--accent);
  color: var(--text-main);
  cursor: pointer;
  margin-top: 4px;
}
.login-error { color: var(--worse); font-size: 13px; margin: 0; }

/* ---- Header (7.2) ---- */

.site-header {
  background: var(--header-bg);
  color: var(--text-main-dark);
}

.site-header__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 16px;
  max-width: 1160px;
  margin: 0 auto;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text-main-dark);
}

.logo__mark {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--accent);
  color: var(--text-main);
  font-weight: 800;
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.logo__text { display: flex; flex-direction: column; line-height: 1.1; }
.logo__name { font-weight: 700; font-size: 14px; letter-spacing: 0.02em; }
.logo__tagline { font-size: 11px; color: var(--text-secondary-dark); }

.profile-button {
  font: inherit;
  color: var(--text-main-dark);
  background: var(--surface-dark);
  border: 1px solid var(--line-dark);
  border-radius: 10px;
  min-width: 44px;
  min-height: 44px;
  padding: 0 16px;
  cursor: pointer;
}

.site-header__actions { display: flex; align-items: center; gap: 8px; }
.profile-button--link { display: inline-flex; align-items: center; text-decoration: none; }

.header-subbar {
  background: var(--card-bg);
  border-bottom: 1px solid var(--divider);
}

.header-subbar__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
  max-width: 1160px;
  margin: 0 auto;
  flex-wrap: wrap;
}

.project-name {
  font-weight: 600;
  font-size: 15px;
}

.tabs {
  display: flex;
  gap: 4px;
  background: var(--bg);
  border-radius: 10px;
  padding: 4px;
}

.tabs a {
  display: flex;
  align-items: center;
  min-height: 36px;
  padding: 0 14px;
  border-radius: 8px;
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
}

.tabs a[aria-current="page"] {
  background: var(--card-bg);
  color: var(--text-main);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

main { padding: 20px 0 48px; }

/* ---- Week nav ---- */

.week-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 16px 16px;
}

.week-nav__title { font-weight: 700; font-size: 18px; }
.week-nav__dates { color: var(--text-secondary); font-size: 14px; }

.week-nav__arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--card-bg);
  text-decoration: none;
  color: var(--text-main);
  font-size: 18px;
}

.week-nav__arrow[aria-disabled="true"] {
  color: var(--no-data);
  pointer-events: none;
  border-color: var(--divider);
}

/* ---- Cards ---- */

.card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 16px;
  margin: 0 16px 16px;
}

.card--dark {
  background: var(--header-bg);
  color: var(--text-main-dark);
}

.card h2 {
  font-size: 15px;
  font-weight: 700;
  margin: 0 0 12px;
}

.project-pick-list { display: flex; flex-direction: column; gap: 8px; }
.project-pick-card {
  display: block;
  padding: 16px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  color: var(--text-main);
  text-decoration: none;
  font-weight: 600;
}
.project-pick-card:hover { border-color: var(--accent); }

.card--dark h2 { color: var(--text-main-dark); }

.card__hint {
  font-size: 13px;
  color: var(--text-secondary);
  margin: -8px 0 12px;
}

/* ---- Tiles ---- */

.tiles {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin: 0 16px 16px;
}

.tile {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 14px;
}

.tile__label { font-size: 13px; color: var(--text-secondary); margin: 0 0 6px; }
.tile__value { font-size: 26px; font-weight: 700; line-height: 1.1; }
.tile__prev { font-size: 12px; color: var(--text-secondary); margin-top: 6px; }

/* ---- Comparison badge ---- */

.cmp { font-size: 13px; font-weight: 600; white-space: nowrap; }
.cmp--better { color: var(--better); }
.cmp--worse { color: var(--worse); }
.cmp--neutral { color: var(--text-secondary); font-weight: 500; }
.cmp--none { color: var(--no-data); font-weight: 500; }

/* ---- Weekly conclusions ---- */

.conclusions__list { margin: 0; padding-left: 20px; display: grid; gap: 8px; }
.conclusions__item--green::marker { color: var(--better); }
.conclusions__item--yellow::marker { color: #B54708; }
.conclusions__item--red { color: var(--worse); }
.conclusions__item--red::marker { color: var(--worse); }

.toggle-input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }

/* ---- Actions / goals list ---- */

.metric-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--divider);
}
.metric-row:last-child { border-bottom: none; }
.metric-row__label { font-size: 14px; }
.metric-row__right { display: flex; align-items: baseline; gap: 10px; }
.metric-row__value { font-weight: 700; font-size: 15px; }

/* ---- Positions ---- */

.positions-grid { display: grid; grid-template-columns: 1fr; gap: 12px; }
.positions-engine { border: 1px solid var(--border); border-radius: 12px; padding: 12px; }
.positions-engine h3 { margin: 0 0 8px; font-size: 14px; }
.positions-engine dl { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; margin: 0; font-size: 14px; }
.positions-engine dt { color: var(--text-secondary); }
.positions-engine dd { margin: 0; font-weight: 700; text-align: right; }
.positions-engine .card__hint { margin: 10px 0 0; line-height: 1.4; }

/* ---- Table: all weeks ---- */

.table-scroll { overflow-x: auto; }
table.weeks-table { width: 100%; border-collapse: collapse; min-width: 480px; font-size: 13px; }
table.weeks-table th, table.weeks-table td { text-align: right; padding: 8px 10px; border-bottom: 1px solid var(--divider); white-space: nowrap; }
table.weeks-table th:first-child, table.weeks-table td:first-child { text-align: left; }
table.weeks-table th { color: var(--text-secondary); font-weight: 600; }
table.weeks-table tr.is-current td { background: var(--current-week-bg); }
.pos-dyn { margin-top: 12px; }
table.ai-table { min-width: 0; margin-bottom: 8px; }
table.ai-table td .card__hint { margin: 2px 0 0; font-size: 12px; white-space: normal; }
/* Телефон: строка таблицы нейросетей — карточка «подпись — значение», без горизонтальной прокрутки; пустые «—» скрыты. */
@media (max-width: 600px) {
  table.ai-table, table.ai-table tbody, table.ai-table tr, table.ai-table td { display: block; width: 100%; }
  table.ai-table thead { display: none; }
  table.ai-table tr { padding: 8px 0; border-bottom: 1px solid var(--divider); }
  table.ai-table td { border: 0; padding: 2px 0; text-align: right; white-space: normal; display: flex; justify-content: space-between; gap: 12px; }
  table.ai-table td::before { content: attr(data-label); color: var(--text-secondary); text-align: left; }
  table.ai-table td.ai-table__name { display: block; text-align: left; font-weight: 600; }
  table.ai-table td.ai-table__name::before { content: none; }
  table.ai-table td.is-empty { display: none; }
}
table.pos-dyn__table { min-width: 0; }
table.pos-dyn__table caption { text-align: left; font-size: 13px; font-weight: 600; color: var(--text-secondary); padding: 0 0 4px; }
table.pos-dyn__table th, table.pos-dyn__table td { padding: 6px 8px; }
.pos-dyn__delta { font-size: 12px; font-weight: 600; }
.pos-dyn__delta--up { color: var(--better); }
.pos-dyn__delta--down { color: var(--worse); }

/* ---- Footer ---- */

.page-footer { font-size: 12px; color: var(--text-secondary); margin: 0 16px 24px; }
.page-footer p { margin: 0 0 6px; }

/* ---- Banner (раздел 11 — "данные не самые свежие") ---- */

.page-banner {
  margin: 0 16px 16px;
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--current-week-bg);
  border: 1px solid #D8E0A8;
  color: var(--text-main);
  font-size: 13px;
}

@media (min-width: 900px) {
  .page-banner { margin-left: 24px; margin-right: 24px; }
}

/* ---- Months page ---- */

.month-card { background: var(--card-bg); border-radius: var(--radius); margin: 0 16px 12px; padding: 14px; }
.month-card summary { list-style: none; cursor: pointer; display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.month-card summary::-webkit-details-marker { display: none; }
.month-card__title { font-weight: 700; font-size: 15px; }
.month-card__sub { font-size: 12px; color: var(--text-secondary); }
.month-card__total { font-weight: 700; font-size: 15px; }
.month-card__body { margin-top: 12px; }
.month-card__section { margin-bottom: 14px; }
.month-card__section h4 { font-size: 13px; color: var(--text-secondary); margin: 0 0 6px; font-weight: 600; }

.months-table-wrap { display: none; }

/* ---- Months: mobile accordion ---- */

.month-card table.weeks-mini { width: 100%; border-collapse: collapse; font-size: 13px; margin-top: 6px; }
.month-card table.weeks-mini th, .month-card table.weeks-mini td { padding: 6px 4px; text-align: right; border-bottom: 1px solid var(--divider); }
.month-card table.weeks-mini th:first-child, .month-card table.weeks-mini td:first-child { text-align: left; }

/* ---- Months: desktop pivot table ---- */

.cell-better { background: #E3F3E8; color: var(--better); }
.cell-worse { background: #FBE7E4; color: var(--worse); }

.month-toggle-bar { display: flex; gap: 8px; margin: 0 0 10px; flex-wrap: wrap; }
.month-toggle-bar label {
  display: flex; align-items: center; min-height: 36px; padding: 0 12px;
  border-radius: 8px; border: 1px solid var(--border); background: var(--card-bg);
  font-size: 13px; font-weight: 600; cursor: pointer; color: var(--text-secondary);
}

.months-legend { display: flex; gap: 16px; align-items: center; font-size: 12px; color: var(--text-secondary); margin: 0 0 10px; }
.months-legend__swatch { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 5px; vertical-align: middle; }
.months-legend__swatch--better { background: #E3F3E8; }
.months-legend__swatch--worse { background: #FBE7E4; }

.table-scroll table.months-pivot { border-collapse: collapse; font-size: 13px; min-width: 600px; width: 100%; }
table.months-pivot th, table.months-pivot td { padding: 7px 10px; border-bottom: 1px solid var(--divider); text-align: right; white-space: nowrap; }
table.months-pivot th:first-child, table.months-pivot td:first-child { text-align: left; position: sticky; left: 0; background: var(--card-bg); }
table.months-pivot thead th { color: var(--text-secondary); font-weight: 600; }
table.months-pivot tr.section-row td { background: var(--divider); font-weight: 700; color: var(--text-main); }
table.months-pivot td.week-col, table.months-pivot th.week-col { display: none; }

/* Раскрытие недель месяца (по позиции, не по ключу — см. комментарий в months.ts,
   MAX_EXPANDABLE_MONTHS). Статика, а не инлайновый <style> на страницу — чтобы
   работал CSP style-src 'self' без 'unsafe-inline' (раздел 8.2 ТЗ). Сгенерировано. */
#expand-month-0:checked ~ .months-table-wrap .month-pos-0-week { display: table-cell; }
#expand-month-1:checked ~ .months-table-wrap .month-pos-1-week { display: table-cell; }
#expand-month-2:checked ~ .months-table-wrap .month-pos-2-week { display: table-cell; }
#expand-month-3:checked ~ .months-table-wrap .month-pos-3-week { display: table-cell; }
#expand-month-4:checked ~ .months-table-wrap .month-pos-4-week { display: table-cell; }
#expand-month-5:checked ~ .months-table-wrap .month-pos-5-week { display: table-cell; }
#expand-month-6:checked ~ .months-table-wrap .month-pos-6-week { display: table-cell; }
#expand-month-7:checked ~ .months-table-wrap .month-pos-7-week { display: table-cell; }
#expand-month-8:checked ~ .months-table-wrap .month-pos-8-week { display: table-cell; }
#expand-month-9:checked ~ .months-table-wrap .month-pos-9-week { display: table-cell; }
#expand-month-10:checked ~ .months-table-wrap .month-pos-10-week { display: table-cell; }
#expand-month-11:checked ~ .months-table-wrap .month-pos-11-week { display: table-cell; }
#expand-month-12:checked ~ .months-table-wrap .month-pos-12-week { display: table-cell; }
#expand-month-13:checked ~ .months-table-wrap .month-pos-13-week { display: table-cell; }
#expand-month-14:checked ~ .months-table-wrap .month-pos-14-week { display: table-cell; }
#expand-month-15:checked ~ .months-table-wrap .month-pos-15-week { display: table-cell; }
#expand-month-16:checked ~ .months-table-wrap .month-pos-16-week { display: table-cell; }
#expand-month-17:checked ~ .months-table-wrap .month-pos-17-week { display: table-cell; }
#expand-month-18:checked ~ .months-table-wrap .month-pos-18-week { display: table-cell; }
#expand-month-19:checked ~ .months-table-wrap .month-pos-19-week { display: table-cell; }
#expand-month-20:checked ~ .months-table-wrap .month-pos-20-week { display: table-cell; }
#expand-month-21:checked ~ .months-table-wrap .month-pos-21-week { display: table-cell; }
#expand-month-22:checked ~ .months-table-wrap .month-pos-22-week { display: table-cell; }
#expand-month-23:checked ~ .months-table-wrap .month-pos-23-week { display: table-cell; }
#expand-month-24:checked ~ .months-table-wrap .month-pos-24-week { display: table-cell; }
#expand-month-25:checked ~ .months-table-wrap .month-pos-25-week { display: table-cell; }
#expand-month-26:checked ~ .months-table-wrap .month-pos-26-week { display: table-cell; }
#expand-month-27:checked ~ .months-table-wrap .month-pos-27-week { display: table-cell; }
#expand-month-28:checked ~ .months-table-wrap .month-pos-28-week { display: table-cell; }
#expand-month-29:checked ~ .months-table-wrap .month-pos-29-week { display: table-cell; }
#expand-month-30:checked ~ .months-table-wrap .month-pos-30-week { display: table-cell; }
#expand-month-31:checked ~ .months-table-wrap .month-pos-31-week { display: table-cell; }
#expand-month-32:checked ~ .months-table-wrap .month-pos-32-week { display: table-cell; }
#expand-month-33:checked ~ .months-table-wrap .month-pos-33-week { display: table-cell; }
#expand-month-34:checked ~ .months-table-wrap .month-pos-34-week { display: table-cell; }
#expand-month-35:checked ~ .months-table-wrap .month-pos-35-week { display: table-cell; }

@media (min-width: 900px) {
  .container { padding: 0 24px; }

  .tiles { grid-template-columns: repeat(4, 1fr); margin: 0 24px 16px; }
  .card { margin: 0 24px 16px; }
  .week-nav, .page-footer { margin-left: 24px; margin-right: 24px; }
  .site-header__row, .header-subbar__row { padding: 14px 24px; }

  .positions-grid { grid-template-columns: 1fr 1fr; }


  /* Months: show the metrics table instead of accordion cards on desktop */
  .month-card { display: none; }
  .months-table-wrap { display: block; margin: 0 24px 16px; }
}

/* ==== Admin (раздел 10) ==== */

.admin-page { margin: 0 16px 24px; }
.admin-page h2 { font-size: 18px; margin: 0 0 4px; }
.admin-page__intro { color: var(--text-secondary); font-size: 13px; margin: 0 0 16px; }

.admin-actions { display: flex; justify-content: flex-end; margin-bottom: 12px; gap: 10px; flex-wrap: wrap; }
.admin-actions--between { justify-content: space-between; }
.admin-actions__group { display: flex; gap: 10px; flex-wrap: wrap; }
.admin-notice { color: var(--better); font-size: 13px; margin: 0 0 12px; }
.admin-filter-form { display: flex; gap: 8px; align-items: center; }
.admin-filter-form select { font: inherit; min-height: 36px; padding: 0 10px; border-radius: 8px; border: 1px solid var(--border); background: var(--card-bg); color: var(--text-main); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 16px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--card-bg);
  color: var(--text-main);
  font: inherit;
  font-weight: 600;
  font-size: 13px;
  text-decoration: none;
  cursor: pointer;
}
.btn--primary { background: var(--accent); border-color: var(--accent); }
.btn--danger { color: var(--worse); border-color: var(--worse); }
.btn--small { min-height: 32px; padding: 0 12px; font-size: 12px; }

table.admin-table { width: 100%; border-collapse: collapse; background: var(--card-bg); border-radius: var(--radius); overflow: hidden; font-size: 13px; }
table.admin-table th, table.admin-table td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--divider); vertical-align: middle; }
table.admin-table th { color: var(--text-secondary); font-weight: 600; background: var(--bg); }
table.admin-table tr:last-child td { border-bottom: none; }
table.admin-table td.nowrap { white-space: nowrap; }
.admin-table-wrap { overflow-x: auto; border-radius: var(--radius); }

.badge { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 600; }
.badge--ok { background: #E3F3E8; color: var(--better); }
.badge--warn { background: #FBE7E4; color: var(--worse); }
.badge--neutral { background: var(--divider); color: var(--text-secondary); }

.admin-form { background: var(--card-bg); border-radius: var(--radius); padding: 20px; max-width: 560px; display: flex; flex-direction: column; gap: 14px; }
.admin-form__field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--text-secondary); }
.admin-form__field input, .admin-form__field select {
  font: inherit;
  min-height: 42px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text-main);
}
.admin-form__hint { font-size: 12px; color: var(--text-secondary); margin: -4px 0 0; }
/* Этап 31: чекбоксы клиентов исполнителя на «Админах» */
.admin-checks { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 4px 0 8px; }
.admin-checks__item { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; }
.admin-details > summary { cursor: pointer; color: var(--text-secondary); font-size: 13px; }
.admin-details[open] > summary { margin-bottom: 6px; }
.admin-form__check { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-secondary); margin-top: 4px; }
.admin-form__check input { width: auto; }
.admin-form__actions { display: flex; gap: 10px; margin-top: 4px; }
.admin-form__error { color: var(--worse); font-size: 13px; margin: 0; }
.admin-form__success { color: var(--better); font-size: 13px; margin: 0; }

.password-reveal {
  background: var(--surface-dark);
  color: var(--text-main-dark);
  border-radius: 10px;
  padding: 16px;
  font-family: monospace;
  font-size: 16px;
  letter-spacing: 0.04em;
  word-break: break-all;
}
.password-reveal__hint { color: var(--worse); font-size: 13px; font-weight: 600; margin: 10px 0 0; }

.inline-form { display: inline; }

.trial-read-box { background: var(--bg); border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; font-size: 13px; margin: 0 0 14px; }
.trial-read-box--error { color: var(--worse); }
.trial-read-box--ok { color: var(--better); }

.admin-form--secondary { margin-top: 16px; }
.admin-form__subheading { margin: 0; font-size: 14px; }
.admin-form__actions--wrap { flex-wrap: wrap; }

/* ==== Admin — сайдбар + дашборд (этап 17, "рабочая среда") ==== */

.admin-shell {
  max-width: 1480px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
}

.admin-sidebar {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  background: var(--card-bg);
  border-bottom: 1px solid var(--divider);
  padding: 10px 16px;
}

.admin-sidebar a {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 0 14px;
  border-radius: 8px;
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
}

.admin-sidebar a[aria-current="page"] {
  background: transparent;
  color: var(--text-main);
  border-radius: 0;
  box-shadow: inset 0 -3px 0 var(--text-main); /* телефон: подчёркивание в горизонтальной ленте */
}

.admin-sidebar__badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--worse);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
}

.admin-main { flex: 1; min-width: 0; padding-top: 4px; }

@media (min-width: 900px) {
  .admin-shell { flex-direction: row; align-items: flex-start; gap: 24px; padding: 0 24px; }

  .admin-sidebar {
    flex-direction: column;
    align-items: stretch;
    width: 220px;
    flex-shrink: 0;
    position: sticky;
    top: 24px;
    background: transparent;
    border-bottom: none;
    padding: 20px 0;
    gap: 2px;
  }

  .admin-sidebar a { justify-content: space-between; }
  .admin-sidebar a[aria-current="page"] { background: var(--accent); border-radius: 8px; box-shadow: inset 3px 0 0 var(--text-main); }
  .admin-sidebar-wrap { display: contents; }
  .admin-main { padding-top: 24px; }
  .admin-main .admin-page { margin: 0 0 24px; }
}

.dash-tiles {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin: 0 16px 16px;
}

.dash-tile {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 14px 16px;
}

.dash-tile--warn .dash-tile__value { color: var(--worse); }
.dash-tile__value { font-size: 24px; font-weight: 700; }
.dash-tile__label { font-size: 12px; color: var(--text-secondary); margin-top: 2px; }

.dash-grid { display: grid; gap: 16px; margin: 0 16px 16px; }
.dash-card { background: var(--card-bg); border-radius: var(--radius); padding: 16px; }
.dash-card h3 { margin: 0 0 10px; font-size: 14px; }

@media (min-width: 900px) {
  .dash-tiles { grid-template-columns: repeat(4, 1fr); margin: 0 0 20px; }
  .dash-grid { grid-template-columns: 1fr 1fr; margin: 0 0 20px; }
}

/* ---- Навигация внутри проекта (крошки + вкладки) ---- */
.breadcrumbs-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 0 16px 8px; }
.breadcrumbs-row__aside { display: flex; gap: 14px; font-size: 13px; }
.breadcrumbs-row__aside a { color: var(--text-secondary); text-decoration: none; }
.breadcrumbs-row__aside a:hover { color: var(--text-main); text-decoration: underline; }
.breadcrumbs { display: flex; gap: 8px; align-items: center; font-size: 13px; color: var(--text-secondary); }
.breadcrumbs a { color: var(--text-secondary); text-decoration: none; }
.breadcrumbs a:hover { color: var(--text-main); text-decoration: underline; }
.breadcrumbs span:last-child { color: var(--text-main); font-weight: 600; }
.project-nav { display: flex; align-items: center; gap: 12px; margin: 0 16px 16px; background: var(--card-bg); border-radius: 14px; padding: 4px; overflow-x: auto; }
.project-nav__tabs { display: flex; gap: 2px; flex-wrap: nowrap; }
.project-nav a { padding: 9px 14px; border-radius: 10px; font-size: 14px; font-weight: 600; color: var(--text-secondary); text-decoration: none; white-space: nowrap; }
.project-nav a:hover { color: var(--text-main); background: var(--bg); }
.project-nav a[aria-current="page"] { background: var(--accent); color: #1f1f1f; }
.project-subnav { margin: -8px 16px 16px; overflow-x: auto; }
.project-subnav__tabs { display: flex; gap: 4px; flex-wrap: nowrap; border-bottom: 1px solid var(--border, rgba(0,0,0,.08)); }
.project-subnav a { padding: 8px 12px; font-size: 13px; font-weight: 600; color: var(--text-secondary); text-decoration: none; white-space: nowrap; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.project-subnav a:hover { color: var(--text-main); }
.project-subnav a[aria-current="page"] { color: var(--text-main); border-bottom-color: var(--accent); }
.overview-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.overview-more { margin: -8px 0 16px; font-size: 13px; }
.report-hub-grid, .settings-hub-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; margin-bottom: 16px; }
.report-hub-card, .settings-hub-card { display: flex; flex-direction: column; gap: 6px; padding: 16px; background: var(--card-bg); border-radius: var(--radius); color: inherit; text-decoration: none; border: 1px solid transparent; }
.report-hub-card:hover, .settings-hub-card:hover { border-color: var(--accent); }
.report-hub-card__title, .settings-hub-card__title { font-weight: 700; font-size: 15px; display: flex; align-items: center; gap: 8px; }
.report-hub-card__text, .settings-hub-card__text { font-size: 13px; color: var(--text-secondary); }
.report-hub-card__status { font-size: 12px; color: var(--text-main); overflow-wrap: anywhere; }
.admin-form--danger { border: 1px solid #f0c9c4; }
@media (min-width: 900px) {
  .admin-main .breadcrumbs-row, .admin-main .project-nav, .admin-main .project-subnav { margin-left: 0; margin-right: 0; }
}


/* ==== Взаимодействие: фокус, отклик, зоны нажатия (аудит 08.11) ==== */

:where(a, button, input, select, textarea, summary, label[for]):focus-visible {
  outline: 2px solid var(--text-main);
  outline-offset: 2px;
  border-radius: 6px;
}
.site-header :where(a, button):focus-visible { outline-color: var(--accent); }

.btn, .profile-button, .admin-sidebar a, .project-nav a, .tabs a {
  transition: background-color 0.15s ease-out, border-color 0.15s ease-out, color 0.15s ease-out, opacity 0.15s ease-out;
}
.btn:hover { background: var(--bg); border-color: var(--border-strong); }
.btn--primary:hover { background: #C8EB48; border-color: #C8EB48; }
.btn--danger:hover { background: #FBE7E4; border-color: var(--worse); }
.btn:active { opacity: 0.8; }
.btn:disabled, .btn[aria-busy="true"] { opacity: 0.55; cursor: progress; }
.admin-sidebar a:hover:not([aria-current="page"]) { background: var(--bg); color: var(--text-main); }
.admin-sidebar a[aria-current="page"]:hover { color: var(--text-main); }

/* Отступ между соседними кнопками в ячейках таблиц */
table.admin-table td .btn + .btn, table.admin-table td form + form, table.admin-table td form + .btn { margin-left: 8px; }

/* Таблицы: первая колонка закреплена, прокрутка по горизонтали видна */
.admin-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.admin-table-wrap table.admin-table { min-width: 640px; }
.admin-table-wrap table.admin-table--cards { min-width: 0; }
.admin-table-wrap table.admin-table td:first-child,
.admin-table-wrap table.admin-table th:first-child { position: sticky; left: 0; background: var(--card-bg); z-index: 1; }
.admin-table-wrap table.admin-table th:first-child { background: var(--bg); }
.admin-table-wrap table.admin-table td:first-child { min-width: 120px; }

/* Многострочные поля выглядят так же, как однострочные */
.admin-form__field textarea {
  font: inherit; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--bg); color: var(--text-main); resize: vertical; min-height: 84px;
}

/* Сенсорные экраны: зона нажатия не меньше 44px, зазор 8px */
@media (pointer: coarse) {
  .btn, .btn--small, .admin-sidebar a, .project-nav a, .tabs a, .admin-filter-form select,
  .admin-form__field input, .admin-form__field select { min-height: 44px; }
  .project-nav a { display: inline-flex; align-items: center; }
  .admin-actions, .admin-actions__group, .admin-form__actions { gap: 8px; }
  table.admin-table td .btn + .btn, table.admin-table td form + form { margin-left: 8px; margin-top: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; scroll-behavior: auto !important; }
}

/* Плитки дашборда — ссылки */
a.dash-tile { display: block; color: inherit; text-decoration: none; transition: box-shadow 0.15s ease-out; }
a.dash-tile:hover { box-shadow: 0 0 0 2px var(--border-strong); }
.dash-ok { margin: 0; color: var(--better); font-size: 13px; font-weight: 600; }

/* Действия в строке: друг под другом, чтобы таблица помещалась */
td.row-actions { white-space: nowrap; }
td.row-actions .btn--small { width: auto; }
td.row-actions .btn { display: flex; }
td.row-actions form { display: block; }
td.row-actions .btn + form, td.row-actions form + form { margin: 6px 0 0; }
td.row-actions .btn { width: 100%; }

/* Телефон: таблицы-карточки вместо горизонтальной прокрутки */
@media (max-width: 1100px) {
  .admin-table-wrap table.admin-table--cards { min-width: 0; }
  .admin-table--cards thead { display: none; }
  .admin-table--cards, .admin-table--cards tbody, .admin-table--cards tr, .admin-table--cards td { display: block; width: 100%; box-sizing: border-box; }
  .admin-table--cards tr { padding: 10px 14px; border-bottom: 1px solid var(--divider); }
  .admin-table--cards tr:last-child { border-bottom: none; }
  table.admin-table--cards td { border: none; padding: 4px 0; display: flex; justify-content: space-between; gap: 12px; text-align: right; }
  table.admin-table--cards td::before { content: attr(data-label); color: var(--text-secondary); font-weight: 600; text-align: left; flex-shrink: 0; }
  table.admin-table--cards td:first-child { position: static; font-size: 15px; }
  table.admin-table--cards td[data-label="Проект"]:first-child::before,
  table.admin-table--cards td[data-label="Задача"]::before { display: none; }
  table.admin-table--cards td.row-actions { display: flex; gap: 8px; padding-top: 8px; }
  table.admin-table--cards td.row-actions::before { display: none; }
  td.row-actions .btn, td.row-actions form { flex: 1; display: block; margin: 0; }
}

[hidden] { display: none !important; }
@media (max-width: 1100px) { table.admin-table--cards td:empty { display: none; } }

/* Дашборд: узкие таблицы внутри карточек не раздвигают страницу; без двойного отступа плиток */
.dash-card .admin-table-wrap table.admin-table { min-width: 0; }
.admin-page .dash-tiles, .admin-page .dash-grid { margin-left: 0; margin-right: 0; }

/* Воздух между формой и таблицей */
.admin-form + .admin-table-wrap, .admin-table-wrap + .admin-form, .admin-form + .admin-form { margin-top: 16px; }

/* Быстрая смена статуса в списке задач */
.quick-status { display: block; margin-top: 6px; }
@media (max-width: 1100px) { .quick-status { margin: 0 0 0 8px; } }
.quick-status .btn { white-space: nowrap; }

/* Окна подключений */
.connector-card { background: var(--card-bg); border-radius: var(--radius); padding: 16px 20px; margin: 0 0 16px; max-width: 640px; }
.connector-card h3 { margin: 0 0 6px; font-size: 16px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.connector-card .admin-form { padding: 0; margin-top: 12px; max-width: none; }
.sa-email { user-select: all; word-break: break-all; background: var(--bg); padding: 2px 6px; border-radius: 6px; }

/* Админка шире, а таблицы-карточки переносят текст — без горизонтальной прокрутки */
.site-header__row--admin { max-width: 1480px; }
table.admin-table--cards td.nowrap { white-space: normal; }
table.admin-table--cards td .badge { margin: 1px 0; }
@media (min-width: 1101px) {
  table.admin-table--cards td:first-child { min-width: 0; }
  .admin-table-wrap table.admin-table--cards td:first-child, .admin-table-wrap table.admin-table--cards th:first-child { position: static; }
}

/* ---- Этап 29a: «Задачи агентам» ---- */
.agents-page { max-width: 1180px; }
.agents-card { background: var(--card-bg); border-radius: var(--radius); padding: 20px 22px; border: 1px solid var(--border); }
.agents-card__title { margin: 0 0 14px; font-size: 16px; }
.agents-section-title { margin: 28px 0 12px; font-size: 16px; display: flex; align-items: center; gap: 8px; }
.agents-alert { margin: 0 0 14px; }
.agents-top { display: block; margin-bottom: 8px; }
.agents-top__main { min-width: 0; }
.agents-new { display: flex; flex-direction: column; gap: 14px; }
.agents-new__row { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 12px; }
.agents-new textarea, .agents-reply textarea { width: 100%; min-height: 96px; resize: vertical; font: inherit; font-size: 14px; color: var(--text-main);
  padding: 10px 12px; border: 1px solid var(--border-strong); border-radius: 10px; background: var(--card-bg); box-sizing: border-box; }
.agents-new__footer { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.agents-new__footer .admin-form__hint { margin: 0; }
.agents-how ol { list-style: none; margin: 0; padding: 0; counter-reset: step; display: flex; flex-direction: column; gap: 12px; }
.agents-how li { counter-increment: step; display: grid; grid-template-columns: 26px 1fr; column-gap: 10px; font-size: 13px; }
.agents-how li::before { content: counter(step); grid-row: span 2; width: 24px; height: 24px; border-radius: 50%; background: var(--accent);
  color: var(--text-main); font-weight: 700; font-size: 12px; display: flex; align-items: center; justify-content: center; }
.agents-how li span { color: var(--text-secondary); font-size: 12px; margin-top: 2px; }
.agents-count { background: var(--worse); color: #fff; font-size: 11px; border-radius: 999px; padding: 1px 8px; }
.agents-attention__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.agents-attn { display: flex; flex-direction: column; gap: 6px; padding: 16px 18px; border-radius: var(--radius); background: var(--card-bg);
  border: 1px solid var(--border); border-left: 4px solid var(--better); text-decoration: none; color: var(--text-main); transition: border-color .15s, transform .15s; }
.agents-attn:hover { transform: translateY(-1px); border-color: var(--border-strong); }
.agents-attn--ask { border-left-color: #E8833A; }
.agents-attn__kind { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--text-secondary); }
.agents-attn--ask .agents-attn__kind { color: #B9580F; }
.agents-attn--review .agents-attn__kind { color: var(--better); }
.agents-attn__title { font-weight: 600; font-size: 14px; line-height: 1.35; }
.agents-attn__meta { font-size: 12px; color: var(--text-secondary); }
.agents-attn__cta { font-size: 13px; font-weight: 600; margin-top: 4px; }
.agents-section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.agents-section-head select { font: inherit; font-size: 13px; padding: 7px 10px; border-radius: 10px; border: 1px solid var(--border-strong); background: var(--card-bg); }
.agents-list { background: var(--card-bg); border-radius: var(--radius); border: 1px solid var(--border); overflow: hidden; }
.agents-row { display: grid; grid-template-columns: 76px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 14px 18px;
  border-bottom: 1px solid var(--divider); text-decoration: none; color: var(--text-main); }
.agents-row:last-child { border-bottom: none; }
.agents-row:hover { background: #FAFBF7; }
.agents-row__id { font-size: 12px; font-weight: 600; color: var(--text-secondary); font-variant-numeric: tabular-nums; }
.agents-row__main { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.agents-row__title { font-weight: 600; font-size: 14px; overflow-wrap: anywhere; }
.agents-row__meta { font-size: 12px; color: var(--text-secondary); }
.agents-empty { background: var(--card-bg); border: 1px dashed var(--border-strong); border-radius: var(--radius); padding: 22px; text-align: center;
  color: var(--text-secondary); font-size: 13px; }
.agents-settings { margin-top: 32px; }
.agents-settings summary { cursor: pointer; font-size: 13px; color: var(--text-secondary); font-weight: 600; }
.agents-settings[open] summary { margin-bottom: 10px; }
.agents-link-form { display: flex; gap: 8px; align-items: center; }
.agents-link-form input { flex: 1; min-width: 0; font: 12px ui-monospace, monospace; padding: 7px 10px; border: 1px solid var(--border-strong); border-radius: 8px; }
.badge--info { background: #E6EEF9; color: #1F4F96; }
.badge--attention { background: #FDEBD9; color: #B9580F; }
.badge--accepted { background: var(--accent); color: var(--text-main); }
.agents-back { margin: 0 0 12px; font-size: 13px; }
.agents-back a { color: var(--text-secondary); text-decoration: none; }
.agents-back a:hover { color: var(--text-main); }
.agents-head__top { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; }
.agents-head__id { font-size: 12px; font-weight: 600; color: var(--text-secondary); }
.agents-head__title { margin: 4px 0 8px; font-size: 22px; line-height: 1.25; overflow-wrap: anywhere; }
.agents-head__meta { margin: 0; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 13px; color: var(--text-secondary); }
.agents-head__actions { display: flex; gap: 8px; flex-shrink: 0; }
.agents-progress { list-style: none; margin: 18px 0 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); }
.agents-progress li { position: relative; display: flex; flex-direction: column; gap: 6px; font-size: 12px; color: var(--no-data); }
.agents-progress li::before { content: ''; position: absolute; top: 5px; left: 0; right: 0; height: 2px; background: var(--divider); }
.agents-progress li:first-child::before { left: 6px; }
.agents-progress li.is-done::before, .agents-progress li.is-current::before { background: var(--better); }
.agents-progress__dot { position: relative; width: 12px; height: 12px; border-radius: 50%; background: var(--card-bg); border: 2px solid var(--border-strong); box-sizing: border-box; }
.agents-progress li.is-done { color: var(--text-secondary); }
.agents-progress li.is-done .agents-progress__dot { background: var(--better); border-color: var(--better); }
.agents-progress li.is-current { color: var(--text-main); font-weight: 600; }
.agents-progress li.is-current .agents-progress__dot { border-color: var(--better); box-shadow: 0 0 0 4px #E3F3E8; }
.agents-progress li.is-ask .agents-progress__dot { border-color: #E8833A; box-shadow: 0 0 0 4px #FDEBD9; }
.agents-progress li.is-ask { color: #B9580F; }
.agents-detail { margin-top: 16px; border-top: 1px solid var(--divider); padding-top: 12px; }
.agents-detail summary { cursor: pointer; font-size: 13px; font-weight: 600; color: var(--text-secondary); }
.agents-detail__body { white-space: pre-wrap; font-size: 14px; margin-top: 8px; overflow-wrap: anywhere; }
.agents-question { margin-top: 16px; border-color: #F4C9A4; background: #FFF8F1; }
.agents-question .md { font-size: 14px; }
.agents-judge { margin-top: 24px; border-color: #BFE0CA; background: #F5FBF7; }
.agents-judge__grid { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 20px; align-items: start; margin-top: 12px; }
.agents-reply { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.agents-judge .agents-reply { margin-top: 0; }
.agents-files { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.agents-file { display: grid; grid-template-columns: 34px minmax(0, 1fr); column-gap: 10px; align-items: center; padding: 12px 14px;
  background: var(--card-bg); border: 1px solid var(--border); border-radius: 12px; text-decoration: none; color: var(--text-main); }
.agents-file:hover { border-color: var(--border-strong); }
.agents-file__icon { grid-row: span 2; width: 34px; height: 34px; border-radius: 9px; background: var(--current-week-bg); display: flex;
  align-items: center; justify-content: center; font-weight: 700; }
.agents-file__name { font-weight: 600; font-size: 13px; overflow-wrap: anywhere; }
.agents-file__meta { font-size: 12px; color: var(--text-secondary); }
.agents-thread { display: flex; flex-direction: column; gap: 10px; }
.agents-msg { max-width: 760px; background: var(--card-bg); border: 1px solid var(--border); border-radius: 14px 14px 14px 4px; padding: 12px 16px; }
.agents-msg--mine { align-self: flex-end; background: var(--current-week-bg); border-color: #DCEBA8; border-radius: 14px 14px 4px 14px; }
.agents-msg--note { opacity: .85; }
.agents-msg__head { display: flex; gap: 10px; align-items: baseline; font-size: 12px; color: var(--text-secondary); margin-bottom: 4px; }
.agents-msg__head strong { color: var(--text-main); }
.agents-page .md { font-size: 14px; line-height: 1.55; overflow-wrap: anywhere; }
.agents-page .md > :first-child { margin-top: 0; }
.agents-page .md > :last-child { margin-bottom: 0; }
.agents-page .md table { border-collapse: collapse; margin: 10px 0; display: block; overflow-x: auto; }
.agents-page .md th, .agents-page .md td { border: 1px solid var(--border); padding: 6px 10px; text-align: left; }
.agents-page .md pre { background: var(--bg); padding: 10px 12px; border-radius: 8px; overflow-x: auto; font-size: 12px; }
.agents-page .md code { background: var(--bg); padding: 1px 5px; border-radius: 4px; font-size: 12px; }
.agents-page .md pre code { background: none; padding: 0; }
.agents-page .md blockquote { margin: 10px 0; padding-left: 12px; border-left: 3px solid var(--border-strong); color: var(--text-secondary); }
.agents-page .md .md-image { color: var(--text-secondary); font-style: italic; }
.agents-doc h2 { margin-top: 0; }
@media (max-width: 1000px) {
  .agents-top { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .agents-card { padding: 16px; }
  .agents-new__row { grid-template-columns: 1fr; }
  .agents-new__footer { flex-direction: column; align-items: stretch; }
  .agents-row { grid-template-columns: minmax(0, 1fr); gap: 6px; padding: 12px 14px; }
  .agents-row__id { order: 0; }
  .agents-head__top { flex-direction: column; }
  .agents-head__title { font-size: 19px; }
  .agents-progress li span:last-child { font-size: 11px; }
  .agents-judge__grid { grid-template-columns: 1fr; }
  .agents-msg { max-width: 100%; }
}

/* Этап 34: «Диалог с агентами» — метка «новое», переписка в задаче, окно «Чат с командой» */
.agents-badge-new { display: inline-block; padding: 1px 7px; border-radius: 999px; background: #E8833A; color: #fff; font-size: 11px; font-weight: 700; line-height: 1.5; }
.agents-dot { display: inline-block; width: 9px; height: 9px; margin-right: 8px; border-radius: 50%; background: #E8833A; vertical-align: middle; }
.agents-msg--new { border-color: #F4C9A4; box-shadow: 0 0 0 2px #FFF1E3; }
.agents-message { margin-top: 16px; }
.agents-message textarea, .chat-form textarea { width: 100%; min-height: 80px; resize: vertical; font: inherit; font-size: 14px; color: var(--text-main);
  background: var(--card-bg); border: 1px solid var(--border-strong); border-radius: 10px; padding: 10px 12px; }
.agents-closed { margin-top: 16px; }
.chat-row { grid-template-columns: minmax(0, 1fr); }
.chat-head { margin-bottom: 12px; }
.chat-feed { display: flex; flex-direction: column; gap: 10px; min-height: 160px; max-height: calc(100vh - 380px); overflow-y: auto;
  padding: 14px; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); }
.chat-feed .agents-thread { gap: 10px; }
.chat-feed .agents-empty { margin: auto; text-align: center; }
.chat-form { margin-top: 12px; display: flex; flex-direction: column; gap: 8px; }
@media (max-width: 640px) {
  .chat-feed { max-height: calc(100vh - 430px); min-height: 200px; padding: 10px; }
}

/* Этап 28b: разбор документа «результат проверки» */
.review-item { background: var(--card-bg); border-radius: var(--radius); padding: 14px 16px; margin: 0 0 12px; border: 0; min-width: 0; }
.review-item__head { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 0 0 8px; }
.review-item__head label { display: flex; gap: 8px; align-items: center; font-weight: 600; }
.review-evidence { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 13px; color: var(--text-secondary); background: var(--bg); border-radius: 8px; padding: 10px 12px; margin: 0 0 10px; }
.review-item__controls { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 10px; }
.review-item__controls select { width: 100%; min-height: 36px; }
.review-comment { border-top: 1px solid var(--divider); padding: 10px 0; font-size: 13px; }
.review-comment__meta { color: var(--text-secondary); font-size: 12px; margin: 0 0 4px; }
.review-comment__body { white-space: pre-wrap; overflow-wrap: anywhere; margin: 0; }
@media (max-width: 640px) {
  .review-item__controls { grid-template-columns: minmax(0, 1fr); }
}

/* Этап 29b: ТЗ на статью */
.agents-tabs { display: flex; gap: 6px; margin: 0 0 12px; }
.agents-tabs__tab { padding: 7px 14px; border-radius: 999px; border: 1px solid var(--border-strong); background: var(--card-bg); color: var(--text-secondary);
  font-size: 13px; font-weight: 600; text-decoration: none; }
.agents-tabs__tab:hover { color: var(--text-main); }
.agents-tabs__tab.is-active { background: var(--header-bg); border-color: var(--header-bg); color: var(--text-main-dark); }
.agents-kind { display: inline-block; padding: 1px 7px; margin-right: 4px; border-radius: 6px; background: var(--current-week-bg); color: var(--text-main);
  font-size: 11px; font-weight: 700; letter-spacing: .03em; vertical-align: 1px; }
.agents-new input[type="text"] { width: 100%; box-sizing: border-box; font: inherit; font-size: 14px; padding: 9px 12px; border: 1px solid var(--border-strong);
  border-radius: 10px; background: var(--card-bg); color: var(--text-main); }
.agents-engine { border: 0; margin: 0; padding: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; font-size: 14px; }
.agents-engine legend { float: left; width: 100%; padding: 0; margin-bottom: 4px; font-size: 13px; color: var(--text-secondary); }
.agents-radio { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.agents-ask { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 8px 14px; margin: 8px 0 0; font-size: 14px; }
.agents-ask dt { color: var(--text-secondary); }
.agents-ask dd { margin: 0; overflow-wrap: anywhere; }
.agents-ask__text { white-space: pre-wrap; }
.agents-tz-ready { margin-bottom: 12px; border-color: #BFE0CA; background: #F5FBF7; }
.agents-tz-ready__actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
@media (max-width: 640px) { .agents-ask { grid-template-columns: 1fr; gap: 2px; } .agents-ask dd { margin-bottom: 8px; } }

/* Этап 29c: статья по ТЗ */
.agents-article-offer__line { margin: 0; font-size: 14px; }
.agents-check-field { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.agents-accept { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.agents-check { margin-top: 16px; }
.agents-check__total { margin: 0 0 10px; font-weight: 700; font-size: 15px; }
.agents-check__total--ok { color: var(--better); }
.agents-check__total--warn { color: #B9580F; }
.agents-check__total--fail { color: var(--worse); }
.agents-check__list { list-style: none; margin: 0 0 10px; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.agents-check__item { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 8px; font-size: 14px; overflow-wrap: anywhere; }
.agents-check__mark { font-weight: 700; text-align: center; }
.agents-check__item--ok .agents-check__mark { color: var(--better); }
.agents-check__item--warn .agents-check__mark { color: #B9580F; }
.agents-check__item--fail .agents-check__mark { color: var(--worse); }
.agents-check__details { margin: 4px 0 0; padding-left: 18px; font-size: 13px; color: var(--text-secondary); }
.agents-imgs { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.agents-img { margin: 0; background: var(--card-bg); border: 1px solid var(--border); border-radius: 12px; padding: 10px; min-width: 0; }
.agents-img img { display: block; width: 100%; max-height: 180px; object-fit: contain; background: var(--bg); border-radius: 8px; }
.agents-img figcaption { margin-top: 6px; font-size: 12px; color: var(--text-secondary); overflow-wrap: anywhere; }
.agents-img__name { font-weight: 600; color: var(--text-main); }
.agents-cms__head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 10px; }
.agents-cms__head .agents-card__title { margin: 0; }
.agents-cms__src { width: 100%; box-sizing: border-box; font: 12px/1.45 ui-monospace, monospace; padding: 10px 12px; border: 1px solid var(--border-strong); border-radius: 10px; background: var(--bg); color: var(--text-main); resize: vertical; }
.agents-article-offer { margin-top: 16px; }

/* Этап 30: «Новый клиент» */
.onb-fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.onb-card { display: grid; gap: 14px; }
.onb-form { display: grid; gap: 14px; }
.onb-section h4 { margin: 0 0 8px; font-size: 14px; }
.onb-audit { margin: 0; padding-left: 20px; display: grid; gap: 8px; }
.onb-tasks { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.onb-task { display: grid; gap: 6px; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius); }
.onb-task input[type="text"] { width: 100%; }
.onb-banner { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius); }
.onb-errors { margin: 0; padding-left: 20px; }
.onb-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* Этап 29d: аудит сайта */
.agents-audit-warn { background: #FDEBD9; color: #3A2305; border: 1px solid #E8B98A; border-left-width: 5px; border-radius: var(--radius); padding: 14px 16px; font-size: 14px; }
.agents-audit-warn p { margin: 0; }
.agents-audit-last { margin: 0; padding-left: 18px; font-size: 13px; color: var(--text-secondary); }
.agents-audit-areas { border: 0; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.agents-audit-areas legend { font-size: 14px; font-weight: 600; padding: 0; margin-bottom: 6px; }
.agents-audit-areas small { color: var(--text-secondary); }
.agents-findings__counts { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 12px; }
.agents-findings__list { list-style: none; margin: 0 0 14px; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.agents-finding { border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; overflow-wrap: anywhere; font-size: 14px; }
.agents-finding__head { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.agents-finding__title { font-weight: 600; }
.agents-finding__meta { font-size: 12px; color: var(--text-secondary); }
.agents-finding__urls { margin: 6px 0 0; padding-left: 18px; font-size: 13px; }
.agents-finding details { margin-top: 6px; }
.agents-finding__text { white-space: pre-wrap; margin: 4px 0 8px; }

/* План v2 (11.11.2026): «Сегодня» — одна очередь того, что ждёт человека. */
.today-head { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-start; justify-content: space-between; margin-bottom: 8px; }
.today-head h2 { margin-bottom: 4px; }
.today-section { background: var(--card-bg); border-radius: var(--radius); padding: 16px; margin-bottom: 16px; }
.today-section__title { margin: 0 0 4px; font-size: 15px; display: flex; align-items: center; gap: 8px; }
.today-section .admin-form__hint { margin: 0 0 10px; }
.today-empty { margin: 4px 0 0; font-size: 13px; color: var(--text-secondary); }
.today-list { list-style: none; margin: 0; padding: 0; }
.today-row { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; justify-content: space-between; padding: 10px 0 10px 12px; border-top: 1px solid var(--border); border-left: 3px solid transparent; }
.today-list .today-row:first-child { border-top: 0; }
.today-row--ask { border-left-color: #E8A33D; }
.today-row--review { border-left-color: var(--better); }
.today-row--stuck, .today-row--late { border-left-color: var(--worse); }
.today-row__main { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1 1 320px; }
.today-row__title { font-weight: 600; font-size: 14px; color: inherit; text-decoration: none; overflow-wrap: anywhere; }
.today-row__title:hover { text-decoration: underline; }
.today-row__meta { font-size: 12px; color: var(--text-secondary); display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.today-row__actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.today-archived { margin: 0 0 16px; }
.btn--ghost { background: transparent; border-color: transparent; color: var(--text-secondary); }
.btn--ghost:hover { border-color: var(--border-strong); color: inherit; }
.agents-lead { margin: 0 0 8px; }
.agents-judge__queue { margin: 12px 0 0; font-size: 12px; color: var(--text-secondary); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.agents-attn .badge { align-self: flex-start; }
.agents-attention__archived { margin-top: 10px; }
@media (max-width: 899px) {
  .today-row__actions { width: 100%; }
}
.today-row__why { color: var(--text-secondary); font-style: italic; }
.today-more { margin-top: 4px; border-top: 1px solid var(--border); }
.today-more > summary, .today-more__summary {
  display: flex; align-items: center; min-height: 44px; cursor: pointer; list-style: none;
  font-size: 14px; font-weight: 600; color: var(--text-main); text-decoration: underline; text-underline-offset: 3px;
  transition: color 0.15s ease-out, opacity 0.15s ease-out;
}
.today-more > summary::-webkit-details-marker, .today-more__summary::-webkit-details-marker { display: none; }
.today-more > summary::before, .today-more__summary::before { content: ''; flex: none; width: 6px; height: 6px; margin: 0 10px 0 4px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(-45deg); transition: transform 0.15s ease-out; }
.today-more[open] > summary::before, .today-working[open] > .today-more__summary::before { transform: rotate(45deg); }
.today-more > summary:active, .today-more__summary:active { opacity: 0.7; }
.today-more > summary:focus-visible, .today-more__summary:focus-visible { outline: 2px solid var(--text-main); outline-offset: 2px; }
.today-working .today-list { margin-top: 4px; }
@media (prefers-reduced-motion: reduce) {
  .today-more > summary::before, .today-more__summary::before { transition: none; }
}

/* Мобильное меню: затухание у правого края показывает, что список прокручивается */
@media (max-width: 899px) {
  .admin-sidebar {
    scroll-snap-type: x proximity;
    scroll-padding: 0 16px;
    -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 32px), transparent);
    mask-image: linear-gradient(to right, #000 calc(100% - 32px), transparent);
  }
  .admin-sidebar a { scroll-snap-align: center; scroll-margin: 0 24px; }
  .admin-sidebar a:last-child { margin-right: 24px; }
  /* Явный признак «дальше есть ещё»: стрелка поверх затухающего края ленты (не ловит нажатия) */
  .admin-sidebar-wrap { position: relative; }
  .admin-sidebar-wrap::after {
    content: '›'; position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
    font-size: 22px; line-height: 1; font-weight: 700; color: var(--text-main); pointer-events: none;
  }
}

/* План v2: страница задачи — статья на странице, служебные заметки и ранние сообщения свёрнуты. */
.agents-preview__head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 10px; }
.agents-preview__head .agents-card__title { margin: 0; }
.agents-preview__meta { display: grid; gap: 6px; padding: 10px 12px; background: var(--divider); border-radius: 10px; margin-bottom: 12px; }
.agents-preview__meta-row { display: grid; grid-template-columns: 96px 1fr; gap: 2px 10px; font-size: 13px; }
.agents-preview__meta-row span { color: var(--text-secondary); }
.agents-preview__meta-row em { grid-column: 2; font-style: normal; font-size: 11px; color: var(--text-secondary); }
.agents-preview__meta-row--missing strong { color: var(--worse); }
.agents-preview__body { max-height: 70vh; overflow: auto; padding-right: 8px; overscroll-behavior: contain; }
.agents-preview__note { margin: 10px 0 0; }
.agents-older > summary, .agents-msg--internal > summary { cursor: pointer; list-style: none; }
.agents-older > summary::-webkit-details-marker, .agents-msg--internal > summary::-webkit-details-marker { display: none; }
.agents-older { margin-bottom: 10px; }
.agents-older > summary { font-size: 13px; font-weight: 600; color: var(--text-secondary); padding: 8px 0; }
.agents-older > summary::before { content: '▸ '; }
.agents-older[open] > summary::before { content: '▾ '; }
.agents-msg--internal { opacity: 0.75; padding-top: 6px; padding-bottom: 6px; }
.agents-msg--internal > summary.agents-msg__head { margin: 0; }
.agents-msg__tag { font-size: 11px; color: var(--text-secondary); border: 1px solid var(--border); border-radius: 999px; padding: 0 6px; }

/* План v2: «Спринт-задачи» по неделям. */
.task-project { margin-bottom: 16px; }
.task-block { margin-top: 12px; }
.task-block__title { margin: 0 0 4px; font-size: 13px; font-weight: 700; display: flex; flex-wrap: wrap; gap: 8px; align-items: baseline; }
details.task-block > summary.task-block__title { cursor: pointer; list-style: none; padding: 6px 0; color: var(--text-secondary); }
details.task-block > summary.task-block__title::-webkit-details-marker { display: none; }
details.task-block > summary.task-block__title::before { content: '▸'; }
details.task-block[open] > summary.task-block__title::before { content: '▾'; }
.task-block__count { font-size: 12px; font-weight: 500; color: var(--text-secondary); }
.task-block--warn > .task-block__title { color: var(--worse); }
.task-block--warn .today-row { border-left-color: var(--worse); }
.task-block--past { margin-top: 16px; border-top: 1px solid var(--border); padding-top: 4px; }
.task-block--past .task-block { margin-left: 12px; }
.task-row--done .today-row__title, .task-row--excluded .today-row__title { color: var(--text-secondary); font-weight: 500; }
.task-done { margin-top: 4px; }
.task-done > summary { cursor: pointer; font-size: 12px; color: var(--text-secondary); padding: 4px 0 4px 12px; }
.task-row .quick-status .btn { white-space: nowrap; }

/* План v2, шаг 4: контент-доска клиента и страница «Поручить». */
.content-board-cols { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; align-items: start; }
.content-board-col { background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px; min-width: 0; }
.content-board-col__title { margin: 0 0 8px; font-size: 13px; font-weight: 700; display: flex; gap: 8px; align-items: baseline; }
.content-board-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.content-board-card { display: flex; flex-direction: column; gap: 4px; padding: 10px; border: 1px solid var(--border); border-radius: 8px; min-width: 0; }
.content-board-card__title { font-weight: 600; font-size: 14px; overflow-wrap: anywhere; }
.content-board-card__meta { font-size: 12px; color: var(--text-secondary); }
.content-board-card__badges { display: flex; flex-wrap: wrap; gap: 4px; }
.content-board-empty { margin: 0; font-size: 13px; color: var(--text-secondary); }
@media (max-width: 1100px) { .content-board-cols { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .content-board-cols { grid-template-columns: minmax(0, 1fr); } }
.assign-form { display: flex; flex-direction: column; gap: 14px; max-width: 720px; }
.assign-form input[type="text"], .assign-form textarea, .assign-form select { width: 100%; box-sizing: border-box; font: inherit; font-size: 14px; }
.assign-form textarea { min-height: 120px; resize: vertical; }
.assign-form__footer { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; }
.assign-form__footer .admin-form__hint { margin: 0; }
.assign-templates { margin-top: 24px; max-width: 720px; }
.assign-templates__list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 8px; }
.assign-templates__link { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; text-decoration: none; color: inherit; }
.assign-templates__link span { font-size: 12px; color: var(--text-secondary); }
.team-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; margin-top: 16px; }
.team-card { background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.team-card__head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.team-card__name { margin: 0; font-size: 16px; overflow-wrap: anywhere; }
.team-card__sub { margin: 0; font-size: 12px; color: var(--text-secondary); }
.team-card__meta { margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 6px 12px; font-size: 13px; }
.team-card__meta dt { font-size: 11px; color: var(--text-secondary); }
.team-card__meta dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.team-card__actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.team-action { margin: 0; }
.team-card__guard { margin: 0; font-size: 12px; color: var(--worse); }
.team-quota { margin-top: 12px; }
.team-quota__list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.team-quota__item { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; font-size: 13px; }
.team-quota__bar { width: 160px; max-width: 100%; height: 10px; }
.team-quota__reset { font-size: 12px; color: var(--text-secondary); }
.team-runs { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.team-run { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; font-size: 13px; }
.team-run__error { color: var(--worse); overflow-wrap: anywhere; }
.team-ins, .team-page .agents-card + .agents-card { margin-top: 12px; }
.team-instructions__text { white-space: pre-wrap; overflow-wrap: anywhere; max-height: 480px; overflow: auto; font-size: 12px; margin: 8px 0 0; }
.team-limit-banner { margin: 0 0 12px; padding: 10px 14px; border-radius: 8px; background: #FDEBD9; color: #B9580F; font-size: 14px; border: 1px solid #F0C9A3; }
.agents-card > .agents-section-title:first-child { margin-top: 0; }

/* Раздел «Счета»: форма плана клиента в одну строку */
.admin-form--inline { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.admin-form--inline input[type="text"] { min-width: 160px; }

/* «Статус работ»: реестр результатов для клиентов. Цвета статусов заданы владельцем. */
.deliv-counts { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 12px; }
.deliv-count { display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 10px; border: 2px solid transparent; color: #20211F; text-decoration: none; font-size: 13px; font-weight: 600; }
.deliv-count b { font-size: 16px; }
.deliv-count[aria-current="true"] { border-color: #20211F; }
.deliv-count--all { background: var(--card-bg); border-color: var(--border); }
.deliv-count--all[aria-current="true"] { border-color: #20211F; }
.deliv-bg--ready { background: #D9EAD3; }
.deliv-bg--needs { background: #F4CCCC; }
.deliv-bg--waiting { background: #FFF2CC; }
.deliv-bg--todo { background: #CFE2F3; }
.deliv-bg--done { background: #EFEFEF; }
.deliv-filter { margin: 0 0 16px; flex-wrap: wrap; }
.deliv-group { border-radius: var(--radius); margin-bottom: 16px; overflow: hidden; background: var(--card-bg); }
.deliv-group__title { margin: 0; padding: 10px 16px; font-size: 14px; color: #20211F; display: flex; gap: 8px; align-items: center; }
details.deliv-group > summary { cursor: pointer; list-style: none; }
details.deliv-group > summary::-webkit-details-marker { display: none; }
.deliv-list { list-style: none; margin: 0; padding: 0; }
.deliv-item { padding: 12px 16px; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.deliv-item__head { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; }
.deliv-item__project { font-size: 12px; font-weight: 700; color: var(--text-secondary); }
.deliv-item__title { font-weight: 600; font-size: 14px; overflow-wrap: anywhere; }
.deliv-item__line { margin: 0; font-size: 13px; overflow-wrap: anywhere; }
.deliv-item__meta { margin: 0; font-size: 12px; color: var(--text-secondary); display: flex; flex-wrap: wrap; gap: 4px 12px; }
.deliv-quick { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 0; }
.deliv-quick input[type="text"] { flex: 1 1 160px; min-width: 0; font: inherit; font-size: 12px; min-height: 32px; padding: 0 10px; border-radius: 8px; border: 1px solid var(--border); background: var(--bg); color: var(--text-main); }
.deliv-edit { margin-top: 4px; }
.deliv-edit .admin-form { max-width: none; padding: 12px 0 0; background: transparent; }
.deliv-history { margin: 8px 0 0; padding: 0; list-style: none; font-size: 12px; color: var(--text-secondary); display: flex; flex-direction: column; gap: 3px; }
.deliv-add { background: var(--card-bg); border-radius: var(--radius); padding: 12px 16px; margin-bottom: 16px; }
.deliv-add .admin-form { max-width: none; padding: 12px 0 0; }
.deliv-today { margin: 0 0 12px; font-size: 13px; }

/* Этап 35: «Вопросы людям» */
.ask-item { padding: 12px 16px; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.ask-q { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; font-size: 13px; overflow-wrap: anywhere; }
.ask-q__text { font-weight: 600; }
.ask-q__none { color: var(--text-secondary); }
.ask-q__answer { white-space: pre-wrap; }
.ask-q__meta { color: var(--text-secondary); font-size: 12px; }
.ask-acts { display: flex; flex-wrap: wrap; gap: 6px; }
.ask-act { margin: 0; }
.ask-answer { margin-top: 0; }
.deliv-ask { padding: 2px 8px; border-radius: 8px; font-weight: 600; color: #20211F; text-decoration: none; }
.deliv-ask--wait { background: #FFF2CC; }
.deliv-ask--done { background: #D9EAD3; }
.today-working > .today-more__summary { text-decoration: none; font-size: 15px; margin: -4px 0; }
.today-working[open] > .today-more__summary { margin-bottom: 4px; }
.today-more[open] > summary { margin-bottom: 2px; }
.today-row__why { font-size: 12px; }

/* ==== Раунд 2 ==== */

/* Общая плашка-отклик (src/views/admin/flash.ts) */
.flash { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin: 0 0 16px; padding: 12px 16px; border-radius: 12px;
  border: 1px solid #BFE0CA; border-left: 4px solid var(--better); background: #F1FAF4; color: var(--text-main); font-size: 14px; font-weight: 500; }
.flash--error { border-color: #F0C2BC; border-left-color: var(--worse); background: #FDF1EF; animation: flash-in 0.2s ease-out; }
.flash__text { flex: 1 1 240px; min-width: 0; overflow-wrap: anywhere; }
.flash__action { display: inline-flex; flex: none; }
/* Успех — toast внизу экрана: не двигает контент; сам уходит через 8 с, на паузе при наведении/фокусе. */
.flash--success { position: fixed; z-index: 60; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom, 0px)); margin: 0;
  flex-wrap: nowrap; padding-right: 8px; box-shadow: 0 6px 24px rgba(0, 0, 0, 0.16);
  animation: flash-toast-in 0.22s ease-out, flash-toast-out 0.25s ease-in 15s forwards; }
.flash--success:hover, .flash--success:focus-within { animation-play-state: running, paused; }
.flash--success .flash__text { flex: 1 1 auto; }
.flash__close { flex: none; width: 32px; height: 32px; border: 0; border-radius: 8px; background: transparent; color: var(--text-secondary); font-size: 22px; line-height: 1; cursor: pointer; }
.flash__close:hover { background: rgba(0, 0, 0, 0.06); color: var(--text-main); }
.flash__close[hidden] { display: none; }
@media (pointer: coarse) { .flash__close { width: 44px; height: 44px; } }
@media (min-width: 900px) { .flash--success { left: auto; right: 24px; bottom: 24px; max-width: 460px; } }
@keyframes flash-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
@keyframes flash-toast-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes flash-toast-out { to { opacity: 0; transform: translateY(8px); visibility: hidden; pointer-events: none; } }
@media (prefers-reduced-motion: reduce) {
  .flash--error { animation: none; }
  .flash--success { animation: flash-toast-out-instant 0.01s linear 15s forwards; }
  .flash--success:hover, .flash--success:focus-within { animation-play-state: paused; }
}
@keyframes flash-toast-out-instant { to { visibility: hidden; pointer-events: none; } }
/* Пока плашка на экране, внизу страницы запас под неё: плашка не закрывает кнопки в последних строках списка. */
body:has(.flash--success) .admin-main { padding-bottom: 104px; }

.req { color: var(--worse); font-weight: 700; }

/* Шапка раздела: заголовок слева, главное действие справа (не приклеено к тексту) */
.page-head { display: flex; flex-wrap: wrap; gap: 12px 16px; align-items: flex-start; justify-content: space-between; margin-bottom: 8px; }
.page-head h2 { margin-bottom: 4px; }
.page-head > div { flex: 1 1 320px; min-width: 0; }
.page-head > .btn { flex: none; }
.page-head > .page-head__actions { flex: none; display: flex; flex-wrap: wrap; gap: 8px; }

/* Страница задачи: одно главное действие */
.agents-judge__grid { grid-template-columns: minmax(0, 1fr); gap: 10px; }
.agents-judge__accept { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.agents-judge__note { margin: 0; font-size: 12px; color: #B9580F; font-weight: 600; }
.agents-judge__rework { margin: 0; }
.agents-judge__queue { justify-content: flex-end; border-top: 1px solid var(--divider); padding-top: 10px; margin-top: 14px; }

/* «Статус работ»: кнопки, комментарий по требованию, «Закрыть» отдельно */
.deliv-quick { flex-direction: column; align-items: stretch; gap: 8px; }
.deliv-quick__row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.deliv-quick__close { margin-left: auto; }
.deliv-comment > summary { cursor: pointer; list-style: none; display: inline-flex; align-items: center; min-height: 28px; font-size: 12px; font-weight: 600; color: var(--text-secondary); }
.deliv-comment > summary::-webkit-details-marker { display: none; }
.deliv-comment > summary:hover { color: var(--text-main); }
.deliv-comment[open] > summary { margin-bottom: 6px; }
.deliv-comment input[type="text"] { width: 100%; box-sizing: border-box; font: inherit; font-size: 13px; min-height: 36px; padding: 0 10px; border-radius: 8px; border: 1px solid var(--border); background: var(--bg); color: var(--text-main); }

/* «Вопросы людям» */
.ask-acts { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; justify-content: space-between; }
.ask-acts__main, .ask-acts__risky { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.ask-acts__risky { margin-left: auto; }
/* «Ответить в панели» — первая кнопка ряда; раскрытая форма занимает всю ширину, ряд не разъезжается */
.ask-acts__main > .ask-answer[open] { flex: 1 1 100%; }
.ask-acts:has(.ask-answer[open]) .ask-acts__main { flex: 1 1 100%; }
@media (max-width: 899px) { .ask-acts__risky { margin-left: 0; } }
.ask-answer > summary { list-style: none; cursor: pointer; }
.ask-answer > summary::-webkit-details-marker { display: none; }
.ask-answer[open] > summary { margin-bottom: 10px; }
.ask-answer .admin-form { max-width: none; padding: 0; background: transparent; }

/* «Поручить задачу»: шаблоны сверху одной высоты, свободная форма ниже */
.assign-section-title { margin: 0 0 6px; font-size: 16px; }
.assign-templates { margin: 0 0 32px; }
.assign-templates__list { align-items: stretch; margin-top: 10px; }
.assign-templates__list > li { display: flex; }
.assign-templates__link { flex: 1; background: var(--card-bg); transition: border-color 0.15s ease-out; }
.assign-templates__link:hover { border-color: var(--text-main); }
.assign-free { max-width: 720px; }
.assign-free .admin-form__hint { margin: 0 0 12px; }

/* «Сегодня»: чипы-счётчики, раскрытие «Показать ещё / Свернуть», «Дальше» в одну строку */
.today-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 16px; }
.today-chip { display: inline-flex; align-items: center; min-height: 32px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--border-strong); background: var(--card-bg);
  color: var(--text-main); font-size: 13px; font-weight: 600; text-decoration: none; transition: background-color 0.15s ease-out, border-color 0.15s ease-out; }
.today-chip:hover { border-color: var(--text-main); }
.today-chip--ask { background: #FFF1E0; border-color: #E8A33D; }
.today-chip--late { background: #FDF1EF; border-color: var(--worse); color: var(--worse); }
.today-more__hide { display: none; }
.today-more[open] > summary .today-more__hide { display: inline; }
.today-more[open] > summary .today-more__show { display: none; }
.today-row__next { display: block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.today-section:has(.today-row--ask) { border-left: 4px solid #E8A33D; }
@media (pointer: coarse) { .today-chip { min-height: 44px; } }

/* Раунд 2.1: «Сегодня» — управление раскрытым списком внизу; на телефоне — 2–3 главных чипа */
.today-more[open] { display: flex; flex-direction: column-reverse; }
.today-more[open] > summary { margin: 6px 0 0; }
.today-chip--more { display: none; cursor: pointer; font-family: inherit; color: var(--text-secondary); border-style: dashed; }
@media (max-width: 899px) {
  .today-chip--minor { display: none; }
  .today-chips--expanded .today-chip--minor { display: inline-flex; }
  .today-chip--more { display: inline-flex; }
  .today-chips--expanded .today-chip--more { display: none; }
}
.today-chip--more[hidden] { display: none !important; }

/* ==== Раунд 3: «Клиенты», карточка клиента, «Отчёт клиенту» ==== */
.page-head > .overview-actions { flex: none; }
.agents-count--neutral { background: var(--divider); color: var(--text-main); font-weight: 600; }

/* Список клиентов: строка-карточка, слева цветная кромка (красный — горит, жёлтый — ждёт вас). Цвет не единственный признак: есть текст статуса. */
.clients-head, .client-row { display: grid; grid-template-columns: minmax(0, 1fr) 80px 80px 96px 120px 280px; gap: 8px 16px; align-items: center; }
.clients-head { padding: 0 16px 6px 20px; /* 4px кромки строки + 16px отступа */ font-size: 12px; font-weight: 600; color: var(--text-secondary); }
.clients-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.client-row { background: var(--card-bg); border-radius: var(--radius); padding: 12px 16px; border-left: 4px solid var(--divider); }
.client-row--hot { border-left-color: var(--worse); background: #FDF6F5; }
.client-row--wait { border-left-color: #E8A33D; }
.client-cell { min-width: 0; font-size: 14px; }
.client-cell--num { padding-left: 0; }
.client-count, .client-count--zero { margin-left: -8px; }
.client-cell--name { display: flex; flex-direction: column; gap: 3px; }
.client-name { font-weight: 700; font-size: 15px; color: inherit; text-decoration: none; overflow-wrap: anywhere; }
.client-name:hover { text-decoration: underline; }
.client-status { font-size: 12px; color: var(--text-secondary); }
.client-status--hot { color: var(--worse); font-weight: 600; }
.client-status--wait { color: #8A5300; font-weight: 600; }
.client-badges { display: flex; flex-wrap: wrap; gap: 4px; }
.client-count { font-weight: 700; font-size: 16px; font-variant-numeric: tabular-nums; text-decoration: none; padding: 2px 8px; border-radius: 8px; color: var(--text-main); }
a.client-count:hover { background: var(--bg); }
.client-count--wait { color: #8A5300; }
.client-count--late { color: var(--worse); }
.client-count--zero { color: var(--text-secondary); font-weight: 400; padding: 2px 8px; }
.client-muted { color: var(--text-secondary); font-size: 12px; }
.client-chips { display: none; }
.client-actions { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.client-actions .btn { white-space: nowrap; }
.client-actions .inline-form { display: inline-flex; }
@media (max-width: 1000px) {
  .clients-head { display: none; }
  .client-row { grid-template-columns: 1fr; gap: 10px; padding: 14px; }
  .client-cell--num, .client-cell--report { display: none; }
  .client-chips { display: flex; flex-wrap: wrap; gap: 6px; }
  .client-chip { display: inline-flex; align-items: center; min-height: 32px; padding: 0 12px; border-radius: 999px; font-size: 13px; font-weight: 600; text-decoration: none; background: var(--divider); color: var(--text-main); }
  .client-chip--wait { background: #FDEBD9; color: #7A4700; }
  .client-chip--late { background: #FBE7E4; color: var(--worse); }
  .client-chip--quiet { font-weight: 500; color: var(--text-secondary); background: transparent; padding: 0; }
  .client-actions { justify-content: flex-start; }
  .client-actions .btn { display: inline-flex; align-items: center; justify-content: center; }
  .client-actions .btn--ghost { border-color: var(--border); }
}

/* Карточка клиента: «Ждёт вас» и спринт */
.overview-waiting { margin-bottom: 16px; }
.overview-waiting__title { margin: 0 0 8px; font-size: 16px; display: flex; align-items: center; gap: 8px; }
.overview-waiting .today-section { margin-bottom: 12px; }
.overview-waiting .agents-count { background: var(--divider); color: var(--text-main); font-weight: 600; }
.sprint-summary { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; margin: 0 0 8px; font-size: 13px; }
.sprint-progress { color: var(--text-secondary); font-weight: 600; }
.sprint-late { background: #FBE7E4; color: var(--worse); font-weight: 700; border-radius: 999px; padding: 2px 10px; }

/* «Отчёт клиенту» */
.report-last { display: flex; flex-wrap: wrap; gap: 12px 24px; align-items: center; justify-content: space-between; background: var(--card-bg); border-radius: var(--radius); padding: 16px 20px; margin-bottom: 16px; }
.report-last__main { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1 1 280px; }
.report-last__label { font-size: 12px; color: var(--text-secondary); font-weight: 600; }
.report-last__value { font-size: 18px; }
.report-facts { margin: 0 0 16px; padding-left: 18px; font-size: 14px; color: var(--text-secondary); display: flex; flex-direction: column; gap: 4px; }

/* Вкладки клиента: на телефоне — та же обёртка с затуханием и «›», что у главного меню, но лёгкие «таблетки» вместо подчёркивания */
.project-nav-wrap { position: relative; }
@media (max-width: 899px) {
  .project-nav-wrap { margin-bottom: 12px; }
  .project-nav { margin-bottom: 0; background: transparent; padding: 0; border-radius: 0; scroll-snap-type: x proximity; scroll-padding: 0 16px;
    -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 36px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 36px), transparent); }
  .project-nav__tabs { gap: 6px; padding-right: 28px; }
  .project-nav a { font-size: 13px; padding: 0 12px; min-height: 40px; display: inline-flex; align-items: center; border: 1px solid var(--border); border-radius: 999px; scroll-snap-align: center; }
  .project-nav a[aria-current="page"] { border-color: transparent; }
  .project-nav-wrap::after { content: '›'; position: absolute; right: 20px; top: 50%; transform: translateY(-50%); font-size: 22px; line-height: 1; font-weight: 700; color: var(--text-main); pointer-events: none; }
  .project-subnav { margin-top: 0; }
}

/* ---- Раунд 4: «Задачи агентам», «Чат», «Команда» ---- */
/* Единое «не подключено»: спокойная плашка, не красная ошибка */
.not-connected { margin: 0 0 16px; padding: 14px 16px; border: 1px dashed var(--border-strong); border-radius: var(--radius); background: var(--card-bg); color: var(--text-main); font-size: 14px; line-height: 1.45; }
.not-connected--block { margin-top: 4px; }
.not-connected--below { margin: 12px 0 0; }

/* «Как это работает»: свёрнуто, раскрывается при первом визите (admin.js) */
.agents-how { background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 0 18px; margin-bottom: 16px; }
.agents-how__summary { display: flex; align-items: center; min-height: 44px; cursor: pointer; list-style: none; font-weight: 600; font-size: 14px; }
.agents-how__summary::-webkit-details-marker { display: none; }
.agents-how__summary::before { content: ''; flex: none; width: 6px; height: 6px; margin: 0 10px 0 2px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(-45deg); transition: transform 0.15s ease-out; }
.agents-how[open] > .agents-how__summary::before { transform: rotate(45deg); }
.agents-how__summary:focus-visible { outline: 2px solid var(--text-main); outline-offset: 2px; border-radius: 6px; }
.agents-how__short { color: var(--text-secondary); font-weight: 500; margin-left: 6px; }
.agents-how ol { list-style: none; margin: 0; padding: 4px 0 16px; counter-reset: step; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px 18px; }
.agents-how li { counter-increment: step; display: grid; grid-template-columns: 26px 1fr; column-gap: 10px; font-size: 13px; align-content: start; }
.agents-how li::before { content: counter(step); grid-row: span 2; width: 24px; height: 24px; border-radius: 50%; background: var(--accent); color: var(--text-main); font-weight: 700; font-size: 12px; display: flex; align-items: center; justify-content: center; }
.agents-how li span { color: var(--text-secondary); font-size: 12px; margin-top: 2px; }
@media (max-width: 1000px) { .agents-how ol { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .agents-how { padding: 0 14px; } .agents-how ol { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) { .agents-how__summary::before { transition: none; } }

/* «Ждут вас» на странице задач — тот же компактный вид, что на «Сегодня» */
.agents-attention.overview-waiting { margin: 20px 0 8px; }
.agents-attention .today-section { margin-bottom: 12px; }
.agents-section-head { margin-top: 8px; }

/* Фильтр «Все задачи» */
.agents-filter { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 12px; }
.agents-filter select, .agents-filter input[type="search"] { font: inherit; font-size: 14px; min-height: 40px; padding: 7px 12px; border-radius: 10px; border: 1px solid var(--border-strong); background: var(--card-bg); color: var(--text-main); box-sizing: border-box; }
.agents-filter input[type="search"] { flex: 1 1 220px; max-width: 340px; min-width: 0; }
.agents-filter select:focus-visible, .agents-filter input:focus-visible { outline: 2px solid var(--text-main); outline-offset: 1px; }
.agents-filter__reset { font-size: 13px; font-weight: 600; color: var(--text-main); text-underline-offset: 3px; padding: 10px 4px; }
.agents-filter__count { font-size: 12px; color: var(--text-secondary); margin-left: auto; font-variant-numeric: tabular-nums; }
.agents-empty a { color: inherit; font-weight: 600; }
@media (max-width: 640px) {
  .agents-filter select { flex: 1 1 140px; }
  .agents-filter input[type="search"] { flex: 1 1 100%; max-width: none; font-size: 16px; }
  .agents-filter__count { margin-left: 0; flex: 1 1 100%; }
}
/* Старый план спринта, заменённый новым: приглушён, но читается (не только прозрачность) */
.agents-row--muted .agents-row__title { color: var(--text-secondary); font-weight: 500; }
.agents-row--muted:hover { background: transparent; }

/* «Команда»: пустое состояние */
.team-empty--rich { display: flex; flex-direction: column; gap: 8px; }
.team-empty__lead { margin: 0; font-weight: 600; font-size: 15px; }
.team-empty__line { margin: 0; font-size: 14px; color: var(--text-secondary); line-height: 1.5; max-width: 62ch; }

/* «Клиенты»: пояснение к метке статуса — только на ноутбуке (на узком экране то же самое говорят чипы) */
@media (max-width: 1000px) { .client-status__detail { display: none; } }

/* «План»: «Отметить выполненной» — второстепенная кнопка, не похожая на статус */
.quick-status__btn { color: var(--text-secondary); border-color: var(--border); }
.quick-status__btn:hover { color: var(--text-main); border-color: var(--border-strong); }

/* Ленты на телефоне: стрелка «›» и затухание уходят, когда лента докручена до конца (admin.js ставит .is-end) */
.admin-sidebar-wrap::after, .project-nav-wrap::after { transition: opacity 0.15s ease-out; }
.admin-sidebar-wrap.is-end::after, .project-nav-wrap.is-end::after { opacity: 0; }
@media (max-width: 899px) {
  .admin-sidebar-wrap.is-end .admin-sidebar, .project-nav-wrap.is-end .project-nav { -webkit-mask-image: none; mask-image: none; }
  /* «Отчёт клиенту»: подвкладки — один select вместо третьей полосы (без JS остаются ссылки) */
  .js .project-subnav__tabs { display: none; }
  .js .project-subnav { overflow: visible; margin: 0 0 12px; padding: 0 16px; }
  .js .project-subnav__select { display: block; }
}
.project-subnav__select { display: none; width: 100%; min-height: 44px; font: inherit; font-size: 15px; font-weight: 600; padding: 8px 36px 8px 14px; border-radius: 12px; border: 1px solid var(--border-strong); background: var(--card-bg); color: var(--text-main); box-sizing: border-box; }
.project-subnav__select:focus-visible { outline: 2px solid var(--text-main); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { .admin-sidebar-wrap::after, .project-nav-wrap::after { transition: none; } }


/* ==== Раунд 5 ==== */

/* «Добавить …»: кнопка в шапке раздела раскрывает форму; раскрытая форма занимает всю строку под заголовком. */
.add-panel { flex: none; }
.add-panel > summary { list-style: none; cursor: pointer; user-select: none; }
.add-panel > summary::-webkit-details-marker { display: none; }
.add-panel__hide, .add-panel[open] .add-panel__show { display: none; }
.add-panel[open] .add-panel__hide { display: inline; }
.add-panel[open] > summary { background: var(--card-bg); border-color: var(--border-strong); }
.page-head > .add-panel[open] { flex: 1 1 100%; order: 5; }
.add-panel__body { margin-top: 12px; animation: flash-in 0.16s ease-out; }
.add-panel__body .admin-form { max-width: 560px; }
.add-panel__lead { margin: 0 0 12px; font-size: 13px; color: var(--text-secondary); max-width: 560px; }
@media (prefers-reduced-motion: reduce) { .add-panel__body { animation: none; } }

.crumbs-row { margin-left: 0; margin-right: 0; }
.admin-page .crumbs-row { margin: 0 0 8px; }

/* «Настройки»: карточка целиком кликабельна, стрелка «→» сдвигается при наведении */
.settings-hub-card { position: relative; padding-right: 40px; transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease; }
.settings-hub-card::after { content: "→"; position: absolute; right: 16px; top: 16px; font-size: 18px; line-height: 1; color: var(--text-secondary); transition: transform 0.15s ease, color 0.15s ease; }
.settings-hub-card:hover { box-shadow: 0 4px 16px rgba(0, 0, 0, 0.07); }
.settings-hub-card:hover::after, .settings-hub-card:focus-visible::after { transform: translateX(4px); color: var(--text-main); }
.settings-hub-card:active { transform: translateY(1px); }
@media (prefers-reduced-motion: reduce) { .settings-hub-card, .settings-hub-card::after { transition: none; } }

/* Админы: после «Включить/Отключить» подсвечиваем строку, чтобы было видно, что изменилось */
.admin-table tr.row-changed td { animation: row-changed 1.6s ease-out 1; }
@keyframes row-changed { from { background: #F6FBD8; } to { background: transparent; } }
@media (prefers-reduced-motion: reduce) { .admin-table tr.row-changed td { animation: none; background: #F6FBD8; } }

/* «Как устроено» — короткая справка внутри раздела */
.kind-note { margin: 0 0 16px; padding: 10px 14px; border-left: 3px solid var(--accent); background: var(--card-bg); border-radius: 0 10px 10px 0; font-size: 13px; color: var(--text-main); max-width: 720px; }
.kind-note b { font-weight: 700; }

/* Интеграции клиента: сводка и чипы-якоря */
.int-summary { margin: 0 0 16px; max-width: 640px; }
.int-summary__count { margin: 0 0 8px; font-size: 14px; font-weight: 600; }
.int-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.int-chip { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 12px; border-radius: 999px; background: var(--card-bg); border: 1px solid var(--border); color: var(--text-main); font-size: 13px; font-weight: 600; text-decoration: none; }
.int-chip:hover { border-color: var(--border-strong); }
.int-chip__mark { font-size: 12px; font-weight: 700; }
.int-chip--on { border-color: #BFE0CA; background: #F1FAF4; }
.int-chip--on .int-chip__mark { color: var(--better); }
.int-chip--off .int-chip__mark { color: var(--text-secondary); }
.int-chip--warn { border-color: #F0C2BC; background: #FDF1EF; }
.int-chip--warn .int-chip__mark { color: var(--worse); }
.connector-card:target { box-shadow: 0 0 0 2px var(--accent); }
.connector-card__edit { margin-top: 10px; }
.connector-card__edit > summary { display: inline-flex; cursor: pointer; }
.connector-card__edit[open] > summary { margin-bottom: 4px; }
.connector-card__edit > summary { list-style: none; }
.connector-card__edit > summary::-webkit-details-marker { display: none; }
.connector-card .connector-card__edit .admin-form { margin-top: 8px; }

/* «Мой профиль» */
.profile-card { max-width: 560px; margin-bottom: 16px; }
.profile-card h3 { margin: 0 0 8px; font-size: 16px; }
.profile-card > .admin-form { padding: 0; }

/* Входящие: пояснение вместо действий у чужих материалов */
.inbox-note { font-size: 12px; color: var(--text-secondary); }
.inbox-hint { margin: 0 0 12px; }

/* Этап 36b: карточки AI-выдачи по движкам */
.ai-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; margin-bottom: 12px; }
.ai-card h3 { margin: 0 0 8px; }
.ai-metric { margin-bottom: 10px; }
.ai-metric__value strong { font-size: 1.5rem; }
.admin-table tr.is-client td { font-weight: 600; }

/* Сводный недельный отчёт по клиенту (экран) */
.sum-toolbar { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; margin: 0 0 16px; }
.sum-weeknav { display: flex; gap: 16px; margin: 0 0 12px; font-size: 14px; }
.sum-clients { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.sum-report { background: var(--card-bg); border-radius: var(--radius); padding: 20px 24px; margin: 0 0 24px; }
.sum-head__title { font-size: 22px; margin: 0 0 4px; }
.sum-head__meta, .sum-note { color: var(--text-secondary); font-size: 13px; margin: 0 0 8px; }
.sum-section { margin: 20px 0 0; }
.sum-section__title { font-size: 17px; margin: 0 0 8px; border-bottom: 1px solid var(--divider); padding-bottom: 4px; }
.sum-sub { font-size: 14px; margin: 12px 0 6px; }
.sum-empty { color: var(--text-secondary); font-style: italic; margin: 4px 0 8px; }
.sum-table { width: 100%; border-collapse: collapse; font-size: 13px; margin: 0 0 8px; }
.sum-table th, .sum-table td { text-align: left; padding: 5px 8px; border-bottom: 1px solid var(--divider); vertical-align: top; }
.sum-table th { font-weight: 600; color: var(--text-secondary); }
.sum-list { margin: 0 0 8px; padding-left: 18px; font-size: 13px; }
.sum-card { margin: 0 0 12px; }
.sum-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.sum-delta { color: var(--text-secondary); font-size: 12px; }
.sum-delta--up { color: #1E7A46; font-weight: 600; }
.sum-delta--down { color: #B3261E; font-weight: 600; }
@media (max-width: 700px) { .sum-cols { grid-template-columns: 1fr; } .sum-table { display: block; overflow-x: auto; } }

/* Печать (Сохранить как PDF): только отчёт, A4, поля 12 мм */
@page { size: A4; margin: 12mm; }
@media print {
  .no-print, .site-header, .admin-sidebar-wrap, .breadcrumbs-row, .project-nav-wrap, .project-subnav { display: none !important; }
  html, body { background: #fff !important; color: #000; font-size: 10.5pt; }
  .admin-shell { display: block !important; padding: 0 !important; margin: 0 !important; }
  .admin-main { padding: 0 !important; margin: 0 !important; max-width: none !important; width: auto !important; }
  .sum-report { background: #fff; border-radius: 0; padding: 0; margin: 0; box-shadow: none; }
  .sum-report--break { break-before: page; page-break-before: always; }
  .sum-head__title { font-size: 16pt; }
  .sum-section__title { font-size: 12.5pt; break-after: avoid; }
  .sum-sub { break-after: avoid; }
  .sum-table, .sum-table th, .sum-table td, .sum-list, .sum-list li, .sum-head__meta, .sum-note { font-size: 10pt; color: #000; }
  .sum-table tr, .sum-card, .sum-list li, .sum-cols > div { break-inside: avoid; page-break-inside: avoid; }
  .sum-table thead { display: table-header-group; }
  .sum-cols { display: grid; grid-template-columns: 1fr 1fr; }
  .sum-delta--up { color: #1E7A46; } .sum-delta--down { color: #B3261E; }
  a { color: inherit; text-decoration: none; }
}

/* ===== Фирменный стиль BKR: отчёты (экран + печать) ===== */
.sum-report, .bkr-banner, .bkr-kpi { font-family: Arial, Helvetica, sans-serif; }
.bkr-banner { background: #1F2120; color: #fff; padding: 20px 24px; border-radius: 10px; margin: 0 0 16px; }
.bkr-banner__brand { color: #D4F75A; font-size: 11px; font-weight: 700; letter-spacing: 0.28em; margin: 0 0 8px; }
.bkr-banner__title { color: #fff; font-size: 26px; line-height: 1.2; margin: 0 0 6px; }
.bkr-banner__sub { color: #D9DBD4; font-size: 13px; margin: 0; }
.bkr-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; margin: 0 0 16px; }
.bkr-kpi { background: #EDF2E4; color: #1F2120; border-radius: 8px; padding: 14px 16px; }
.bkr-kpi:nth-child(even) { background: #E3EBCE; }
.bkr-kpi__value { font-size: 30px; font-weight: 700; line-height: 1.1; }
.bkr-kpi__label { font-size: 13px; margin: 4px 0 6px; }
.bkr-kpi__delta { font-size: 12px; color: #55584f; display: block; }
.bkr-kpi__delta--up { color: #1E7A46; font-weight: 700; }
.bkr-kpi__delta--down { color: #B3261E; font-weight: 700; }
.bkr-kpi__hint { font-size: 11px; color: #55584f; margin-top: 4px; }
.bkr-legend { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 8px; font-size: 12px; }
.bkr-chip { padding: 2px 10px; border-radius: 10px; color: #1F2120; }
.bkr-chip--green, .sum-row--green { background: #D9EAD3; }
.bkr-chip--yellow, .sum-row--yellow { background: #FFF2CC; }
.bkr-chip--red, .sum-row--red { background: #F4CCCC; }
.sum-report .sum-section__title { background: #F7F8F5; color: #1F2120; border: 0; padding: 7px 12px; border-radius: 4px; }
.sum-report .sum-table th { border-bottom: 1px solid #C9CCC3; background: transparent; }
.sum-report .sum-table td { border-bottom: 1px solid #E6E8E1; }
.sum-num { text-align: right !important; font-variant-numeric: tabular-nums; white-space: nowrap; }
.sum-list--status { list-style: none; padding-left: 0; }
.sum-list--status li { padding: 6px 10px; margin: 0 0 3px; border-radius: 4px; }
.sum-list--status li:not([class]) { background: transparent; }
.brief-list { font-size: 14px; }
.brief-foot { color: #6b6e66; font-size: 11px; margin: 20px 0 0; }
@media print {
  .sum-report, .sum-report * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .bkr-banner { border-radius: 0; padding: 14px 16px; margin: 0 0 10px; }
  .bkr-banner__title { font-size: 18pt; color: #fff; }
  .bkr-banner__sub { color: #D9DBD4; font-size: 10pt; }
  .bkr-kpis { gap: 6px; }
  .bkr-kpi { break-inside: avoid; page-break-inside: avoid; }
  .bkr-kpi__value { font-size: 20pt; }
  .sum-report .sum-section__title { background: #F7F8F5 !important; }
  .sum-list--status li { break-inside: avoid; }
  .brief-list { font-size: 11pt; }
}

/* ---- Этап B1: «Мои задачи» ---- */
.my-counts { display: flex; flex-wrap: wrap; gap: 8px 12px; list-style: none; margin: 12px 0; padding: 0; }
.my-count { display: flex; align-items: baseline; gap: 8px; background: var(--card-bg); border-radius: var(--radius); padding: 10px 14px; }
.my-count__n { font-size: 22px; font-weight: 700; }
.my-count__label { font-size: 13px; color: var(--text-secondary); }
.my-count--attn .my-count__n { color: #B9580F; }
.my-count--late .my-count__n { color: var(--worse); }
.my-chips { display: flex; gap: 6px; overflow-x: auto; margin: 0 0 12px; padding-bottom: 4px; }
.my-chip { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 12px; border-radius: 999px; background: var(--card-bg); color: var(--text-secondary); font-size: 13px; font-weight: 600; text-decoration: none; white-space: nowrap; }
.my-chip[aria-current="page"] { background: var(--text-main); color: var(--card-bg); }
.my-chip__n { opacity: 0.75; }
.my-table td:first-child { min-width: 200px; }
.my-task__link { font-weight: 600; }
.my-ai { margin-left: 4px; }
.agents-confirm { margin: 0 0 12px; }

/* Этап B2: единая карточка задачи */
.tc-back { margin: 0 0 4px; font-size: 14px; }
.tc-head { margin: 4px 0 14px; }
.tc-ref { font-size: 13px; color: var(--text-secondary); }
.tc-title { margin: 2px 0 8px; font-size: 24px; line-height: 1.25; overflow-wrap: anywhere; }
.tc-status { margin: 0; }
.tc-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; align-items: start; }
@media (min-width: 900px) { .tc-grid { grid-template-columns: minmax(0, 1fr) 320px; } }
.tc-main, .tc-side { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.tc-sec { padding: 16px; }
.tc-h { margin: 0 0 10px; font-size: 13px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-secondary); }
.tc-count { font-weight: 400; margin-left: 4px; }
.tc-empty { margin: 0; }
.tc-props { margin: 0; display: flex; flex-direction: column; gap: 10px; }
.tc-prop { display: flex; flex-direction: column; gap: 2px; margin: 0; }
.tc-prop dt { font-size: 12px; color: var(--text-secondary); }
.tc-prop dd { margin: 0; font-size: 14px; overflow-wrap: anywhere; }
.tc-person { display: inline-flex; align-items: center; gap: 6px; }
.tc-av { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 50%; background: var(--divider); font-size: 12px; font-weight: 700; flex: none; }
.tc-av--ai { background: var(--text-main); color: var(--card-bg); }
.tc-ai { margin-left: 2px; }
.tc-thread { display: flex; flex-direction: column; gap: 10px; margin-bottom: 12px; }
.tc-cm { border: 1px solid var(--border); border-radius: 12px; padding: 10px 14px; background: var(--card-bg); min-width: 0; }
.tc-cm p { margin: 4px 0; }
.tc-cm--mine { background: var(--current-week-bg); border-color: #DCEBA8; }
.tc-cm--note { opacity: 0.85; }
.tc-cm--new { border-color: #F4C9A4; box-shadow: 0 0 0 2px #FFF1E3; }
.tc-cm--internal { opacity: 0.8; }
.tc-cm__head { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; font-size: 13px; margin-bottom: 4px; }
.tc-when { font-size: 12px; color: var(--text-secondary); }
.tc-answer { margin: 4px 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.tc-qlist { margin: 4px 0 0; padding-left: 20px; font-size: 14px; }
.tc-confirm { margin: 12px 0; padding: 12px 14px; border-radius: 12px; background: #FDEBD9; border: 1px solid #F4C9A4; }
.tc-confirm .agents-confirm { margin: 0; }
.agents-qcard .admin-form__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.agents-qcard .agents-q { margin: 0 0 12px; padding: 10px 14px; border: 1px solid var(--border); border-radius: 10px; }
.agents-qcard .agents-q__prompt { font-weight: 600; padding: 0 4px; }
.agents-qcard .agents-q__opt { display: flex; gap: 8px; align-items: flex-start; margin: 8px 0; cursor: pointer; }
.agents-qcard .agents-q__opt input { margin-top: 3px; flex: none; }
.agents-qcard .agents-q__text { display: block; margin-top: 8px; }
.agents-qcard .agents-q__text textarea { width: 100%; font: inherit; font-size: 14px; }
.tc-more { margin: 8px 0; }
.tc-more > summary { cursor: pointer; font-weight: 600; padding: 6px 0; }
.agents-confirm__help { padding-left: 18px; }
.tc-nothing { font-size: 1.05em; }
.tc-form { margin-top: 12px; }
.tc-form textarea, .tc-return textarea { width: 100%; min-height: 72px; resize: vertical; font: inherit; font-size: 14px; }
.tc-actions { display: flex; flex-direction: column; gap: 10px; }
.tc-act { margin: 0; display: flex; flex-direction: column; gap: 8px; }
.tc-act .tc-btn, .tc-btn { width: 100%; min-height: 44px; }
.tc-status-form__row { display: flex; flex-wrap: wrap; gap: 8px; }
.tc-status-form__row .tc-btn { width: auto; flex: 1 1 140px; }
.tc-accept { display: flex; flex-direction: column; gap: 8px; }

/* Этап 39: предложения системы в «Моих задачах» */
.my-proposal__reason { margin: 6px 0 0; color: var(--text-secondary); font-size: 14px; line-height: 1.45; }
.my-proposal__meta { margin: 4px 0 0; color: var(--text-secondary); font-size: 13px; }
.my-proposal__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 10px; }
.my-proposal__actions form { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0; }
.my-proposal__actions select,
.my-proposal__actions input[type="text"] {
  font: inherit; font-size: 14px; min-height: 36px; padding: 6px 10px;
  border: 1px solid var(--border-strong); border-radius: 10px; background: var(--card-bg); color: var(--text-main);
  max-width: 100%;
}
.my-proposal__actions input[type="text"] { flex: 1 1 180px; min-width: 0; }
.my-refresh { margin: 0 0 12px; }

/* ==== Этап B3: левое меню — клиенты и «⚙ Ещё» (.side-*) ==== */
.site-header__actions { display: flex; align-items: center; gap: 10px; }
.side-add { white-space: nowrap; }
.side-sep { flex: 0 0 auto; width: 1px; align-self: stretch; margin: 6px 4px; background: var(--divider); }
.side-title { display: none; }
.side-client { max-width: 220px; }
.side-client__name { overflow: hidden; text-overflow: ellipsis; }
.side-more > summary {
  display: flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 14px; border-radius: 8px; cursor: pointer;
  list-style: none; font-size: 14px; font-weight: 600; color: var(--text-secondary); white-space: nowrap;
}
.side-more > summary::-webkit-details-marker { display: none; }
.side-more > summary:hover { background: var(--bg); color: var(--text-main); }
.side-more > summary:focus-visible { outline: 2px solid var(--text-main); outline-offset: 2px; }
/* телефон: лента прокручивается вбок, раскрытое «Ещё» продолжает ту же ленту */
.side-more[open] { display: flex; gap: 4px; }
@media (min-width: 900px) {
  .side-sep { width: auto; height: 1px; margin: 8px 0; }
  .side-title { display: block; padding: 4px 14px 2px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--text-secondary); }
  .side-client { max-width: none; padding-left: 22px; font-weight: 500; }
  .side-more[open] { display: block; }
  .side-more > summary { justify-content: space-between; }
  .side-more a { padding-left: 22px; display: flex; }
}

/* ==== Этап B3: карточка клиента — таймлайн, задачи, документы (.ct-*) ==== */
.ct-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 16px 12px; }
.ct-page .ct-block { margin-bottom: 20px; }
.ct-block__title { margin: 0 0 8px; font-size: 16px; }
.ct-grid { display: grid; gap: 20px; grid-template-columns: minmax(0, 1fr); }
.ct-props { background: var(--card-bg); border-radius: var(--radius); padding: 16px; align-self: start; }
.ct-stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-bottom: 14px; }
.ct-stat { background: var(--bg); border-radius: 10px; padding: 8px 10px; display: flex; flex-direction: column; gap: 2px; }
.ct-stat b { font-size: 20px; line-height: 1; color: var(--text-secondary); }
.ct-stat--on b { color: var(--text-main); }
.ct-stat span { font-size: 12px; color: var(--text-secondary); }
.ct-dl { margin: 0; display: grid; gap: 4px; font-size: 13px; }
.ct-dl dt { color: var(--text-secondary); margin-top: 8px; }
.ct-dl dd { margin: 0; overflow-wrap: anywhere; }
.ct-events { list-style: none; margin: 0; padding: 0; border-left: 2px solid var(--divider); }
.ct-event { display: grid; gap: 2px 12px; padding: 8px 0 8px 14px; position: relative; font-size: 14px; }
.ct-event::before { content: ''; position: absolute; left: -6px; top: 14px; width: 10px; height: 10px; border-radius: 50%; background: var(--card-bg); border: 2px solid var(--text-secondary); }
.ct-event--report::before { border-color: var(--better); }
.ct-event__when { font-size: 12px; color: var(--text-secondary); }
.ct-event__body { display: flex; flex-wrap: wrap; gap: 2px 10px; align-items: baseline; }
.ct-actor { font-weight: 600; }
.ct-actor--system { color: var(--text-secondary); font-weight: 500; }
.ct-ai { display: inline-block; padding: 0 5px; border-radius: 4px; font-size: 10px; font-weight: 700; background: #E6EEF9; color: #1F4F96; vertical-align: 1px; }
.ct-src { display: block; font-size: 12px; color: var(--text-secondary); }
.ct-chips { display: flex; gap: 6px; overflow-x: auto; margin-bottom: 16px; }
.ct-chips a { padding: 6px 12px; border-radius: 999px; border: 1px solid var(--border); font-size: 13px; font-weight: 600; color: var(--text-secondary); text-decoration: none; white-space: nowrap; }
.ct-chips a[aria-current="page"] { background: var(--accent); border-color: transparent; color: var(--text-main); }
.ct-chip__n { opacity: .7; }
.ct-table td:first-child { min-width: 200px; }
@media (min-width: 900px) {
  .ct-grid { grid-template-columns: minmax(0, 1fr) 280px; }
  .ct-event { grid-template-columns: 110px 1fr; }
  .ct-actions { margin-left: 0; margin-right: 0; }
}

/* Этап B4: мессенджер «Чаты» — список веток слева, переписка справа; на телефоне друг под другом. */
.chat-split { display: grid; grid-template-columns: minmax(260px, 340px) minmax(0, 1fr); gap: 16px; align-items: start; }
.chat-side { display: flex; flex-direction: column; gap: 4px; }
.chat-side__h { margin: 12px 0 4px; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--text-secondary); }
.chat-side__h:first-child { margin-top: 0; }
.chat-side__empty { font-size: 13px; color: var(--text-secondary); padding: 4px 2px; }
.chat-thread { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; border-radius: 10px; border: 1px solid transparent; text-decoration: none; color: var(--text-main); }
.chat-thread:hover { background: var(--surface-2, rgba(127,127,127,.08)); }
.chat-thread--active { border-color: var(--border); background: var(--surface-2, rgba(127,127,127,.12)); }
.chat-thread__top, .chat-thread__bottom { display: flex; justify-content: space-between; align-items: center; gap: 8px; min-width: 0; }
.chat-thread__title { font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-thread--unread .chat-thread__title { font-weight: 700; }
.chat-thread__when { font-size: 11px; color: var(--text-secondary); white-space: nowrap; }
.chat-thread__preview { font-size: 12px; color: var(--text-secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.chat-unread { flex: none; min-width: 20px; padding: 0 6px; border-radius: 999px; background: #E8833A; color: #fff; font-size: 11px; font-weight: 700; line-height: 20px; text-align: center; }
.chat-contacts { margin-top: 8px; font-size: 13px; }
.chat-contacts summary { cursor: pointer; color: var(--text-secondary); padding: 4px 2px; }
.chat-contacts__list { display: flex; flex-direction: column; gap: 2px; padding: 4px 0; }
.chat-contacts__list a { padding: 5px 10px; border-radius: 8px; text-decoration: none; color: var(--text-main); }
.chat-contacts__list a:hover { background: var(--surface-2, rgba(127,127,127,.08)); }
.chat-contacts__role { font-size: 11px; color: var(--text-secondary); }
.chat-main { min-width: 0; }
.chat-main--empty { padding: 40px 0; }
.chat-msg__text { white-space: normal; overflow-wrap: anywhere; font-size: 14px; }
.chat-form__agents { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; }
@media (max-width: 800px) {
  .chat-split { grid-template-columns: minmax(0, 1fr); }
  .chat-split--open .chat-side { display: none; }
  .chat-split--list .chat-main { display: none; }
}

/* ==== Этап B5: визуальный проход по макету v3 (тёмное меню, статусы, мои задачи) ==== */

.admin-main { word-break: normal; overflow-wrap: anywhere; letter-spacing: 0.01em; }
.admin-main h1, .admin-main h2, .admin-main h3 { letter-spacing: 0; }

/* Тёмное левое меню: на телефоне — компактная горизонтальная лента */
.admin-sidebar-wrap { background: var(--surface-dark); }
.admin-sidebar { background: var(--surface-dark); border-bottom: 1px solid var(--line-dark); padding: 8px 12px; gap: 6px; align-items: center; }
.admin-sidebar a { color: #E6E8E1; min-height: 44px; border-radius: 10px; font-weight: 500; font-size: 15px; letter-spacing: 0.01em; }
.admin-sidebar a:hover:not([aria-current="page"]) { background: #363932; color: var(--text-main-dark); }
.admin-sidebar a[aria-current="page"] { background: var(--accent); color: var(--text-main); font-weight: 600; box-shadow: none; border-radius: 10px; }
.admin-sidebar a[aria-current="page"]:hover { background: var(--accent); color: var(--text-main); }
.admin-sidebar a[aria-current="page"] .admin-sidebar__badge { background: var(--text-main); color: var(--accent); }
.admin-sidebar .side-sep { flex: none; width: 1px; height: 24px; background: var(--line-dark); margin: 0 4px; }
.admin-sidebar .side-title { display: none; }
.admin-sidebar .side-more summary { color: #E6E8E1; min-height: 44px; display: flex; align-items: center; padding: 0 12px; cursor: pointer; white-space: nowrap; }
.admin-sidebar .side-more[open] { display: contents; }
.admin-sidebar .side-more[open] > summary { display: none; }
.admin-sidebar__badge { background: var(--worse); color: #fff; font-size: 12px; min-width: 20px; height: 20px; }
.admin-sidebar-wrap::after { color: var(--accent); }
@media (min-width: 900px) {
  .admin-shell { max-width: none; padding: 0; gap: 0; align-items: stretch; min-height: calc(100vh - 72px); }
  .admin-sidebar-wrap { display: block; flex: 0 0 232px; width: 232px; }
  .admin-sidebar { position: sticky; top: 0; width: 100%; max-height: 100vh; overflow-y: auto; align-items: stretch; background: transparent; border: 0; padding: 16px 10px; gap: 2px; }
  .admin-sidebar a { padding: 0 12px; justify-content: space-between; gap: 10px; }
  .admin-sidebar a[aria-current="page"] { box-shadow: none; }
  .admin-sidebar .side-sep { width: auto; height: 1px; margin: 10px 6px; }
  .admin-sidebar .side-title { display: block; font-size: 12px; color: #9DA394; padding: 4px 12px; text-transform: uppercase; letter-spacing: 0.06em; }
  .admin-sidebar .side-client { min-height: 40px; }
  .admin-sidebar .side-more { display: block; }
  .admin-sidebar .side-more[open] { display: block; }
  .admin-sidebar .side-more[open] > summary { display: flex; }
  .admin-main { padding: 24px 28px; max-width: 1280px; }
}
.side-client__name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 899px) { .admin-sidebar .side-client { padding: 0 12px; } .admin-main { padding: 12px 0 0; } }

/* Статусные плашки как в макете */
.badge { white-space: nowrap; font-size: 12px; padding: 4px 8px; border-radius: 6px; font-weight: 600; letter-spacing: 0.01em; }
.badge--info { background: #DCEBFF; color: #0B3D80; }
.badge--attention { background: #FFF1D6; color: #7A4100; }
.badge--warn { background: #FDE7E5; color: #8A1C12; }
.badge--ok { background: #DFF3E6; color: #0E5C30; }
.badge--neutral { background: #E9EAE4; color: var(--text-main); }
.ai-pill, .my-ai, .ct-ai { display: inline-block; font-size: 10px; font-weight: 700; line-height: 1.3; background: var(--accent); color: var(--text-main); border-radius: 4px; padding: 1px 4px; margin-left: 4px; vertical-align: 1px; letter-spacing: 0.02em; }
.badge.my-ai { padding: 1px 4px; font-size: 10px; border-radius: 4px; }

/* Мои задачи */
.my-page h2 { font-size: 28px; margin: 0 0 4px; }
.my-counts .my-count { border: 1px solid var(--border); border-radius: 10px; padding: 8px 12px; }
.my-count__n { font-size: 15px; }
.my-count--attn { background: #FFF1D6; border-color: #F0D49A; }
.my-count--attn .my-count__n, .my-count--attn .my-count__label { color: #7A4100; font-weight: 600; }
.my-count--late { background: #fff; }
.my-count--late .my-count__n { color: var(--text-secondary); }
.my-chip { min-height: 44px; border: 1px solid var(--border-strong); font-weight: 500; font-size: 14px; padding: 0 14px; }
.my-chip[aria-current="page"] { background: var(--text-main); border-color: var(--text-main); color: #fff; }
.my-table-wrap { background: var(--card-bg); border: 1px solid var(--border); border-radius: 14px; }
.my-table { border-radius: 0; font-size: 14px; }
.my-table th { white-space: nowrap; background: transparent; border-bottom: 1px solid var(--border); padding: 10px 12px; }
.my-table td { padding: 12px; vertical-align: top; border-bottom: 1px solid var(--divider); }
.admin-table-wrap table.my-table td:first-child, .admin-table-wrap table.my-table th:first-child { position: static; min-width: 0; background: transparent; }
.my-table td:first-child { width: 44%; }
.my-table td:nth-child(2) { width: 14%; }
.my-table td:nth-child(3) { white-space: nowrap; }
.my-table td:nth-child(4) { white-space: nowrap; }
.my-table td:nth-child(5) { white-space: nowrap; color: var(--text-secondary); }
.my-task__link { font-weight: 600; color: var(--text-main); text-decoration: none; }
.my-task__link:hover { text-decoration: underline; }
@media (max-width: 640px) {
  .my-page h2 { font-size: 24px; }
  .admin-table-wrap table.my-table { min-width: 0; }
  .my-table thead { display: none; }
  .my-table, .my-table tbody { display: block; width: 100%; }
  .my-table tr { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; padding: 12px 14px; border-bottom: 1px solid var(--divider); }
  .my-table td, .my-table td:first-child, .my-table td:nth-child(n) { display: block; width: auto; border: 0; padding: 0; font-size: 13px; color: var(--text-secondary); white-space: normal; }
  .my-table td:first-child { flex: 1 0 100%; font-size: 15px; color: var(--text-main); margin-bottom: 2px; }
  .my-table td:nth-child(3) { order: 3; }
  .my-table td:nth-child(2) { order: 2; }
  .my-table td:nth-child(4) { order: 4; }
  .my-table td:nth-child(5) { order: 5; }
  .my-table td:nth-child(n+4)::before { content: '·'; margin-right: 8px; color: var(--text-secondary); }
  .my-table td:nth-child(3)::before { content: '·'; margin-right: 8px; color: var(--text-secondary); }
  .my-table td:nth-child(2) { order: 2; }
}

/* Карточка клиента: шапка → вкладки → две колонки (макет v3) */
.ct-head { margin: 0 0 12px; }
.ct-head .breadcrumbs { margin: 0 0 6px; }
.ct-head .breadcrumbs a { color: var(--text-secondary); font-size: 14px; text-decoration: none; display: inline-flex; align-items: center; min-height: 32px; }
.ct-head__row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; }
.ct-head__title { flex: 999 1 300px; min-width: 0; }
.ct-title { margin: 0; font-size: 28px; line-height: 1.2; }
.ct-sub { margin: 2px 0 0; color: var(--text-secondary); font-size: 14px; letter-spacing: 0.01em; }
.ct-head .ct-actions { margin: 0; flex: 0 0 auto; }
.ct-head .btn { min-height: 40px; border-radius: 10px; background: #fff; border: 1px solid var(--border-strong); font-weight: 600; font-size: 14px; }
.ct-head .btn--primary { background: var(--accent); border-color: var(--accent); }
.admin-main .project-nav-wrap { margin: 0 0 16px; }
.admin-main .project-nav { background: transparent; border-radius: 0; padding: 0; margin: 0; border-bottom: 1px solid var(--border); gap: 4px; }
.admin-main .project-nav__tabs { display: flex; gap: 4px; }
.admin-main .project-nav a { border-radius: 0; background: transparent; border: 0; border-bottom: 3px solid transparent; padding: 10px 12px; font-size: 15px; color: var(--text-secondary); margin-bottom: -1px; min-height: 44px; display: inline-flex; align-items: center; }
.admin-main .project-nav a:hover { background: transparent; color: var(--text-main); }
.admin-main .project-nav a[aria-current="page"] { background: transparent; color: var(--text-main); border-bottom-color: var(--text-main); }
@media (max-width: 899px) {
  .ct-head, .admin-main .project-nav-wrap, .admin-main .project-subnav, .ct-page { margin-left: 16px; margin-right: 16px; }
  .admin-main .project-nav a { border: 0; border-bottom: 3px solid transparent; border-radius: 0; }
  .admin-main .project-nav a[aria-current="page"] { border-bottom-color: var(--text-main); }
  .ct-title { font-size: 24px; }
  .ct-head .ct-actions { width: 100%; }
  .ct-head .btn { flex: 1 1 auto; }
}
.ct-props, .ct-block, .ct-page .ct-main > section { border-radius: 14px; }
.ct-main { display: flex; flex-direction: column; gap: 16px; }
.ct-page .ct-block { background: var(--card-bg); border: 1px solid var(--border); padding: 16px; margin: 0; }
.ct-block__title { font-size: 13px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-secondary); font-weight: 600; }
.ct-props { border: 1px solid var(--border); }
.ct-dl dt { font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; margin-top: 12px; }
.ct-dl dd { font-size: 14px; }
.ct-stat b { font-size: 20px; }
.ct-links { display: flex; flex-direction: column; gap: 4px; margin: 14px 0 0; padding-top: 12px; border-top: 1px solid var(--divider); font-size: 14px; }
.ct-links a { display: inline-flex; align-items: center; min-height: 32px; }
.ct-overdue { margin: 0; padding: 10px 14px; border-radius: 10px; background: #fff; border: 1px solid var(--border); color: var(--text-secondary); font-size: 14px; }
.ct-overdue__n { font-weight: 700; color: var(--text-main); }
.ct-events { border-left: 2px solid var(--border); margin-left: 6px; }
.ct-event::before { background: var(--dot, #9DA394); border: 0; width: 10px; height: 10px; left: -6px; top: 14px; }
.ct-event--deliverable { --dot: #E8A33D; }
.ct-event--job { --dot: #0B3D80; }
.ct-event--ask { --dot: #7A4100; }
.ct-event--report { --dot: #127A3F; }
.ct-event--site { --dot: #9DA394; }
.ct-client { font-size: 12px; font-weight: 600; background: #E9EAE4; border-radius: 6px; padding: 1px 8px; color: var(--text-main); text-decoration: none; }
.ct-event--group .ct-event__text { color: var(--text-secondary); }
.ct-event a { color: var(--text-main); }

/* Сотрудники и агенты, Лента, Документы (B5) */
.team-roster h2, .feed-page h2, .docs-page h2 { font-size: 28px; margin: 0 0 4px; }
.team-group { margin: 22px 0 10px; font-size: 13px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-secondary); font-weight: 600; display: flex; align-items: center; gap: 8px; }
.team-people { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.team-person { background: var(--card-bg); border: 1px solid var(--border); border-radius: 14px; padding: 16px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.team-person__head { display: flex; gap: 12px; align-items: center; }
.team-person__who { min-width: 0; }
.team-person__name { margin: 0; font-size: 16px; line-height: 1.25; }
.team-person__role { margin: 2px 0 0; font-size: 13px; color: var(--text-secondary); letter-spacing: 0.01em; }
.team-person__status { margin: 0; font-size: 14px; flex: 1; display: flex; align-items: baseline; }
.team-person .btn { align-self: flex-start; background: #fff; border: 1px solid var(--border-strong); min-height: 40px; border-radius: 10px; }
.av { display: inline-flex; flex: none; width: 36px; height: 36px; border-radius: 999px; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; background: #E9EAE4; color: var(--text-main); }
.av--bot { background: var(--text-main); color: var(--accent); }
.dot { display: inline-block; flex: none; width: 9px; height: 9px; border-radius: 999px; margin-right: 8px; background: #9DA394; }
.dot--run { background: #127A3F; }
.dot--wait { background: #E8A33D; }
.dot--free { background: #9DA394; }
.team-board__title { margin: 28px 0 8px; font-size: 13px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-secondary); }
.team-page .team-grid { margin-top: 8px; }
.docs-table td:first-child { width: 36%; }
.feed-page .ct-block { background: var(--card-bg); border: 1px solid var(--border); border-radius: 14px; padding: 16px; }
.ct-event a { text-decoration: none; } .ct-event a:hover { text-decoration: underline; }

/* Карточка задачи и чаты по макету v3 (B5) */
.tc-page .tc-back, .tc-back { font-size: 14px; }
.tc-back a { color: var(--text-secondary); text-decoration: none; }
.tc-back a:hover { text-decoration: underline; }
.tc-title { font-size: 28px; line-height: 1.2; margin: 4px 0 8px; }
.tc-ref { letter-spacing: 0.02em; }
.tc-sec { border: 1px solid var(--border); border-radius: 14px; background: var(--card-bg); }
.tc-h { font-size: 12px; font-weight: 500; letter-spacing: 0.06em; }
.tc-prop dt { font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; }
.tc-prop dd { font-size: 14px; }
.tc-prop dd a { color: var(--text-main); }
.tc-av { width: 28px; height: 28px; background: #E9EAE4; color: var(--text-main); }
.tc-av--ai { background: var(--text-main); color: var(--accent); }
.badge.tc-ai { background: var(--accent); color: var(--text-main); font-size: 10px; padding: 1px 4px; border-radius: 4px; }
.tc-cm { border: 0; border-top: 1px solid var(--divider); border-radius: 0; background: transparent; padding: 12px 0; }
.tc-thread { gap: 0; }
.tc-thread .tc-cm:first-child { border-top: 0; }
.tc-cm--mine { background: transparent; border-color: var(--divider); }
.tc-cm__head { font-size: 13px; color: var(--text-secondary); }
.tc-actions .btn--primary, .tc-btn.btn--primary, .tc-accept .btn--primary { background: var(--text-main); border-color: var(--text-main); color: var(--text-main-dark); }
.tc-actions .btn, .tc-btn { min-height: 44px; border-radius: 10px; font-weight: 600; }
@media (max-width: 899px) { .tc-title { font-size: 22px; } .tc-page { margin-left: 16px; margin-right: 16px; } }

.chat-page h2 { font-size: 28px; }
.chat-split { gap: 0; background: var(--card-bg); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; align-items: stretch; }
.chat-side { border-right: 1px solid var(--border); gap: 0; min-width: 0; }
.chat-side__h { margin: 0; padding: 10px 14px 6px; }
.chat-thread { border-radius: 0; border: 0; border-bottom: 1px solid var(--divider); padding: 12px 14px; min-height: 56px; }
.chat-thread:hover { background: #FAFAF7; }
.chat-thread--active { background: #F2F8D8; border-color: var(--divider); }
.chat-thread__title { font-size: 15px; }
.chat-unread { background: var(--worse); }
.chat-main { padding: 0; display: flex; flex-direction: column; }
.chat-main .agents-card { border: 0; border-radius: 0; border-bottom: 1px solid var(--border); }
.chat-main .chat-feed { background: #FAFAF7; border: 0; border-radius: 0; padding: 16px; gap: 10px; }
.chat-main .agents-msg { max-width: 80%; border-radius: 12px; background: #fff; border: 1px solid var(--border); }
.chat-main .agents-msg--mine { align-self: flex-end; background: var(--text-main); color: var(--text-main-dark); border-color: var(--text-main); }
.chat-main .agents-msg--mine .agents-msg__head, .chat-main .agents-msg--mine .agents-msg__head strong { color: #D6D8D0; }
.chat-main .chat-form { margin: 0; border-top: 1px solid var(--border); border-bottom: 0; }
@media (max-width: 899px) { .chat-page { margin-left: 12px; margin-right: 12px; } .chat-main .agents-msg { max-width: 92%; } }

/* Этап B6: спринт */
.spr-page { display: flex; flex-direction: column; gap: 16px; }
.spr-top { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px 16px; }
.spr-top h1 { margin: 0; }
.spr-lead { margin: 4px 0 0; color: var(--text-secondary); font-size: 14px; max-width: 640px; }
.spr-wk { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.spr-wk b { font-size: 16px; }
.spr-banner { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; background: var(--current-week-bg); border: 1px solid #C9E36A; border-radius: 14px; padding: 14px 16px; }
.spr-banner > div { flex: 999 1 300px; font-size: 14px; line-height: 1.45; }
.spr-bar-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.spr-top-acts { display: flex; flex-wrap: wrap; gap: 8px; }
.spr-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.spr-chip { border: 1px solid var(--border-strong); background: var(--card-bg); border-radius: 999px; padding: 8px 14px; font-size: 14px; font-weight: 500; text-decoration: none; color: var(--text-main); min-height: 36px; display: inline-flex; align-items: center; }
.spr-chip--on { background: var(--header-bg); color: var(--text-main-dark); border-color: var(--header-bg); }
.spr-cards { display: flex; flex-direction: column; gap: 14px; }
.spr-card { background: var(--card-bg); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; }
.spr-h { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding: 14px 16px; border-bottom: 1px solid var(--divider); }
.spr-client { font-weight: 700; font-size: 17px; text-decoration: none; color: var(--text-main); }
.spr-week, .spr-muted { color: var(--text-secondary); font-size: 14px; }
.spr-draft { font-size: 12px; font-weight: 700; padding: 3px 8px; border-radius: 6px; background: #FFF1D6; color: #7A4100; }
.spr-bar { flex: 1 1 140px; min-width: 100px; height: 8px; background: var(--divider); border-radius: 99px; overflow: hidden; }
.spr-bar i { display: block; height: 100%; background: var(--better); }
.spr-p0 { width: 0%; }
.spr-p5 { width: 5%; }
.spr-p10 { width: 10%; }
.spr-p15 { width: 15%; }
.spr-p20 { width: 20%; }
.spr-p25 { width: 25%; }
.spr-p30 { width: 30%; }
.spr-p35 { width: 35%; }
.spr-p40 { width: 40%; }
.spr-p45 { width: 45%; }
.spr-p50 { width: 50%; }
.spr-p55 { width: 55%; }
.spr-p60 { width: 60%; }
.spr-p65 { width: 65%; }
.spr-p70 { width: 70%; }
.spr-p75 { width: 75%; }
.spr-p80 { width: 80%; }
.spr-p85 { width: 85%; }
.spr-p90 { width: 90%; }
.spr-p95 { width: 95%; }
.spr-p100 { width: 100%; }
.spr-cnt { font-size: 14px; }
.spr-list { list-style: none; margin: 0; padding: 0; }
.spr-it, .spr-prop { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 10px 16px; border-bottom: 1px solid var(--divider); }
.spr-it:last-child, .spr-prop:last-child { border-bottom: 0; }
.spr-c { flex: 0 0 24px; display: inline-flex; }
.spr-c input[type=checkbox] { width: 20px; height: 20px; margin: 0; }
.spr-check { width: 20px; height: 20px; border: 2px solid var(--border-strong); border-radius: 5px; display: inline-flex; align-items: center; justify-content: center; font-size: 13px; line-height: 1; }
.spr-check--on { background: var(--better); border-color: var(--better); color: #fff; }
.spr-tt { flex: 999 1 280px; min-width: 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; font-size: 15px; }
.spr-title { flex: 1 1 100%; overflow-wrap: anywhere; }
.spr-it--done .spr-title { text-decoration: line-through; color: var(--text-secondary); }
.spr-it--gone { opacity: .5; }
.spr-why { flex: 1 1 100%; font-size: 13px; color: var(--text-secondary); }
.spr-why a { color: inherit; }
.spr-loop { font-weight: 600; font-size: 12px; padding: 1px 6px; border-radius: 6px; }
.spr-loop--gone { background: #DFF3E6; color: #0E5C30; }
.spr-loop--bad { background: #FDE7E5; color: #8A1C12; }
.spr-loop--wait { background: var(--divider); color: var(--text-secondary); }
.spr-dev, .spr-due, .spr-job { font-size: 12px; color: var(--text-secondary); }
.spr-src { font-size: 11px; font-weight: 700; padding: 3px 7px; border-radius: 6px; white-space: nowrap; background: var(--divider); color: var(--text-secondary); }
.spr-src--proposal { background: #E6EEF9; color: #1F4F96; }
.spr-src--agent_plan { background: #F2F8D8; color: #3B5A00; }
.spr-src--carryover { background: #FFF1D6; color: #7A4100; }
.spr-who { display: inline-flex; align-items: center; font-size: 14px; white-space: nowrap; }
.spr-who--none { color: var(--no-data); }
.spr-av { display: inline-flex; width: 28px; height: 28px; border-radius: 999px; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; background: #E9EAE4; margin-right: 6px; }
.spr-av--bot { background: #20211F; color: var(--accent); }
.spr-ai { font-size: 10px; font-weight: 700; background: var(--accent); color: var(--text-main); border-radius: 4px; padding: 1px 4px; margin-left: 4px; }
.spr-st { font-size: 12px; font-weight: 600; padding: 4px 8px; border-radius: 6px; white-space: nowrap; }
.spr-st--neutral { background: #E9EAE4; color: #20211F; }
.spr-st--run { background: #E9EAE4; color: #20211F; }
.spr-st--wait, .spr-st--q { background: #FFF1D6; color: #7A4100; }
.spr-st--q { background: #FDE7E5; color: #8A1C12; }
.spr-st--ctl { background: #DCEBFF; color: #0B3D80; }
.spr-st--ok { background: #DFF3E6; color: #0E5C30; }
.spr-st--bad { background: #FDE7E5; color: #8A1C12; }
.spr-acts { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-left: auto; }
.spr-form { display: inline-flex; gap: 6px; align-items: center; margin: 0; }
.spr-ib { min-width: 36px; min-height: 36px; border: 1px solid var(--border-strong); background: var(--card-bg); border-radius: 8px; font: inherit; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; list-style: none; }
.spr-edit > summary::-webkit-details-marker { display: none; }
.spr-edit[open] { flex: 1 1 100%; display: flex; gap: 6px; align-items: center; }
.spr-edit[open] .spr-form { flex: 1 1 auto; }
.spr-edit[open] .spr-input { flex: 1 1 auto; }
.spr-add { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 16px; background: #FAFAF7; border-top: 1px solid var(--divider); }
.spr-input, .spr-select { font: inherit; font-size: 15px; border: 1px solid var(--border-strong); border-radius: 10px; padding: 8px 10px; min-height: 40px; background: var(--card-bg); color: var(--text-main); min-width: 0; }
.spr-add .spr-input { flex: 999 1 220px; }
.spr-empty { padding: 14px 16px; color: var(--text-secondary); margin: 0; }
.spr-notice { margin: 0; padding: 10px 16px; font-size: 14px; }
.spr-notice--error { background: #FDE7E5; color: #8A1C12; }
.spr-notice--ok { background: #DFF3E6; color: #0E5C30; }
.spr-sub { margin: 8px 0 0; font-size: 16px; }
.spr-all { margin-top: 18px; }
.spr-all > summary { cursor: pointer; font-weight: 600; padding: 8px 0; }
@media (max-width: 640px) {
  .spr-it, .spr-prop { padding: 12px; }
  .spr-acts { margin-left: 0; flex: 1 1 100%; }
  .spr-h { padding: 12px; }
}
.spr-tails { border-top: 1px solid var(--divider); }
.spr-tails > summary { cursor: pointer; padding: 12px 16px; font-weight: 600; font-size: 14px; color: var(--text-secondary); }
.spr-tails__bulk { padding: 0 16px 10px; }

/* Этап B7: «сами» / «нужно подтверждение», «Итог» агента */
.spr-auto { font-size: 11px; font-weight: 700; padding: 3px 7px; border-radius: 6px; white-space: nowrap; }
.spr-auto--auto { background: #DFF3E6; color: #0E5C30; }
.spr-auto--human { background: #FFF1D6; color: #7A4100; }
.spr-sum { flex: 1 1 100%; font-size: 13px; }
.spr-sum > summary { cursor: pointer; color: #0E5C30; font-weight: 600; list-style: none; padding: 2px 0; }
.spr-sum > summary::-webkit-details-marker { display: none; }
.spr-sum__t { white-space: pre-line; color: var(--text-secondary); padding: 6px 10px; margin-top: 4px; border-left: 3px solid var(--better); background: #F6F8F2; border-radius: 0 8px 8px 0; overflow-wrap: anywhere; }
.ra-week { margin: 20px 0 8px; font-size: 16px; }
.ra-list { list-style: none; margin: 0; padding: 0; background: var(--card-bg); border: 1px solid var(--divider); border-radius: 12px; overflow: hidden; }
.ra-it { padding: 10px 16px; border-bottom: 1px solid var(--divider); }
.ra-it:last-child { border-bottom: 0; }
.ra-head { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; }
.ra-title { font-weight: 600; overflow-wrap: anywhere; }
.ra-meta { font-size: 12px; color: var(--text-secondary); }
.ra-docs { font-size: 13px; margin: 6px 0 0; display: flex; flex-wrap: wrap; gap: 4px 12px; }
.tc-review { border: 1px solid var(--divider); border-radius: 12px; padding: 12px 16px; background: #F6F8F2; }
.tc-review__btns { display: grid; gap: 12px; margin-top: 10px; justify-items: start; }
.tc-review__btns .tc-return { width: 100%; max-width: 560px; }
.tc-review__btns textarea { width: 100%; }
.tc-auto-note { margin: 0 0 12px; padding: 10px 14px; border-radius: 10px; background: #FFF1D6; color: #7A4100; font-size: 14px; }
.tc-auto-note--ok { background: #DFF3E6; color: #0E5C30; }

/* ---- Этап B8: аудит → проблемы → спринт ---- */
.audit-block { margin-top: 24px; }
.audit-block > h2 { margin: 0 0 4px; font-size: 20px; }
.audit-group { margin-top: 16px; }
.audit-group > h3 { margin: 0 0 8px; font-size: 16px; }
.problem__task { margin: 6px 0; font-size: 14px; }
.problem__task > summary { cursor: pointer; font-weight: 600; }
.problem__detail { white-space: pre-line; margin-top: 6px; padding: 8px 12px; border-left: 3px solid var(--divider); color: var(--text-secondary); overflow-wrap: anywhere; }
.problem__verify { margin: 4px 0; }
.problem__verified { margin: 6px 0; padding: 4px 10px; border-radius: 8px; font-size: 14px; font-weight: 600; width: fit-content; max-width: 100%; overflow-wrap: anywhere; }
.problem__verified--ok { background: #DFF3E6; color: #0E5C30; }
.problem__verified--fail { background: #FDE7E5; color: #8A1C12; }
.problem__verified--manual { background: var(--divider); color: var(--text-secondary); }
.ai-alias-hint { margin: 0 0 8px; }
.spr-tz__t { max-height: 260px; overflow: auto; }
.spr-verify, .spr-handed { flex: 1 1 100%; }

/* ---- Этап B9: самопроверка сайтов ---- */
.selfcheck-block { margin-top: 24px; }
.selfcheck-block > h2 { margin: 0 0 4px; font-size: 20px; }
.selfcheck-group { margin-top: 16px; }
.selfcheck-group > h3 { margin: 0 0 8px; font-size: 16px; }
.selfcheck__sites { margin: 12px 0; }
.selfcheck__site { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; padding: 8px 0; overflow-wrap: anywhere; }
.selfcheck__stop { flex: 1 1 100%; margin: 0; color: #8A1C12; font-weight: 600; }

/* Правки агентов в скриптах («Команда») */
.script-change { margin-top: 12px; }
.script-change__path { margin: 0 0 6px; overflow-wrap: anywhere; }
.script-change__meta { margin: 0 0 8px; color: var(--text-secondary); }
.script-change__actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.script-change__form { margin: 0; }
.script-diff { margin: 8px 0 0; padding: 8px; max-height: 420px; overflow: auto; background: var(--divider); border-radius: 6px; font-size: 12px; line-height: 1.45; }
.script-diff .diff-line { display: block; white-space: pre-wrap; overflow-wrap: anywhere; }
.script-diff .diff-add { background: #E3F3E8; color: #1B5E32; }
.script-diff .diff-del { background: #FBE7E4; color: #8A1C12; }
.script-diff .diff-hunk, .script-diff .diff-head { color: #1F4F96; font-weight: 600; }

/* «Статус работ» с этапами (18.11) */
.deliv-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; }
.deliv-tab { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; min-height: 40px; border-radius: 999px; border: 2px solid var(--border); background: var(--card-bg); color: var(--text-main); text-decoration: none; font-size: 14px; font-weight: 600; }
.deliv-tab[aria-current="true"] { border-color: var(--text-main); }
.deliv-tab--red { border-color: #D93025; }
.deliv-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin: 0 0 14px; }
.deliv-card { background: var(--card-bg); border-radius: var(--radius); padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; border: 2px solid transparent; }
.deliv-card b { font-size: 24px; }
.deliv-card span { font-size: 12px; color: var(--text-secondary); }
.deliv-card--red { background: #F4CCCC; border-color: #D93025; color: #20211F; }
.deliv-card--red span { color: #20211F; }
.deliv-summary { margin: 0 0 14px; background: var(--card-bg); border-radius: var(--radius); padding: 10px 14px; }
.deliv-summary > summary { cursor: pointer; font-weight: 700; font-size: 14px; }
.deliv-scroll { overflow-x: auto; }
.deliv-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.deliv-table th, .deliv-table td { text-align: left; vertical-align: top; padding: 10px 12px; border-top: 1px solid var(--border); }
.deliv-table thead th { font-size: 12px; color: var(--text-secondary); border-top: 0; white-space: nowrap; }
.deliv-cell-title { min-width: 220px; }
.deliv-cell-title > span { display: block; overflow-wrap: anywhere; }
.deliv-cell-title .deliv-item__meta { display: flex; margin-top: 4px; }
.deliv-row--red { background: #FDECEA; }
.deliv-red { color: #B3261E; font-weight: 700; }
.deliv-note { margin: 4px 0 0; font-size: 12px; color: var(--text-secondary); overflow-wrap: anywhere; }
.deliv-note--red { color: #B3261E; font-weight: 600; }
.deliv-hint { font-size: 12px; color: var(--text-secondary); }
.deliv-stage { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; color: #20211F; white-space: nowrap; }
.deliv-stage--in_work { background: #CFE2F3; }
.deliv-stage--ready { background: #D9EAD3; }
.deliv-stage--sent { background: #FFF2CC; }
.deliv-stage--approved { background: #FCE5CD; }
.deliv-stage--published { background: #D9D2E9; }
.deliv-stage--verified { background: #B6D7A8; }
.deliv-stage--closed, .deliv-stage--dropped { background: #EFEFEF; }
.deliv-stage--failed { background: #F4CCCC; }
h3.deliv-group__title.deliv-stage, summary.deliv-group__title.deliv-stage { border-radius: 0; white-space: normal; padding: 10px 16px; }
.deliv-links, .deliv-actions { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.deliv-links { flex-direction: row; flex-wrap: wrap; }
.deliv-table td.deliv-links, .deliv-table td.deliv-actions { display: table-cell; }
.deliv-table td.deliv-actions > *, .deliv-table td.deliv-links > * { margin: 0 6px 6px 0; }
.deliv-act { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.deliv-act input[type="text"], .deliv-act input[type="url"], .deliv-act select { font: inherit; font-size: 12px; min-height: 32px; padding: 0 8px; border-radius: 8px; border: 1px solid var(--border); background: var(--bg); color: var(--text-main); min-width: 0; max-width: 100%; }
.deliv-act input[type="text"], .deliv-act input[type="url"] { flex: 1 1 150px; }
.deliv-more > summary { cursor: pointer; font-size: 12px; font-weight: 600; color: var(--text-secondary); min-height: 28px; display: inline-flex; align-items: center; }
.deliv-more[open] { width: 100%; }
.deliv-edit-form { max-width: none; padding: 10px 0 0; }
@media (max-width: 760px) {
  .deliv-table thead { display: none; }
  .deliv-table, .deliv-table tbody, .deliv-table tr, .deliv-table td, .deliv-table th { display: block; width: 100%; box-sizing: border-box; }
  .deliv-table tr { border-top: 1px solid var(--border); padding: 8px 0; }
  .deliv-table td, .deliv-table th { border-top: 0; padding: 4px 14px; }
  .deliv-table td[data-label]::before { content: attr(data-label) ": "; font-size: 11px; color: var(--text-secondary); }
  .deliv-table td.deliv-cell-title::before { content: none; }
  .deliv-table td.deliv-links, .deliv-table td.deliv-actions { display: block; }
  .deliv-act input[type="text"], .deliv-act input[type="url"] { flex: 1 1 100%; }
  .deliv-cards { grid-template-columns: repeat(2, 1fr); }
}

/* W16: новая система для людей (внутри «Мои задачи», карточки клиента, «Статуса работ») */
.ns-block .deliv-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.ns-block .deliv-actions form { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.ns-block .deliv-actions input[type="url"] { min-width: 180px; max-width: 100%; }
.ns-plan-summary p { margin: 0 0 4px; }
.ns-cancelled { opacity: 0.55; }

/* Ссылки в «Статусе работ» не рвутся по буквам; число старого плана в списке клиентов — нейтральное. */
.deliv-links a { white-space: nowrap; }
.client-count--late { color: var(--text-main); }

/* 23.11: «Мои дела» — карточки «Проблема → Решение» вместо таблицы. */
.mt-list { display: grid; gap: 12px; }
.mt-card { background: var(--card-bg); border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; }
.mt-card--answer { border-left: 4px solid #E8A15A; }
.mt-card--control { border-left: 4px solid #7FA6DB; }
.mt-card--proposal { border-left: 4px solid var(--border-strong); }
.mt-card__head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 10px; font-size: 13px; }
.mt-card__client { font-weight: 700; }
.mt-card__wait { color: var(--text-secondary); margin-left: auto; }
.mt-card__pr { display: grid; grid-template-columns: 96px 1fr; gap: 6px 12px; margin: 0 0 12px; font-size: 15px; line-height: 1.4; }
.mt-card__pr dt { color: var(--text-secondary); font-size: 13px; padding-top: 2px; }
.mt-card__pr dd { margin: 0; }
.mt-card__pr dd:first-of-type { font-weight: 600; }
.mt-card__actions { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 8px; }
.mt-card__actions form { margin: 0; }
.mt-reject > summary { list-style: none; cursor: pointer; }
.mt-reject > summary::-webkit-details-marker { display: none; }
.mt-reject[open] > summary { margin-bottom: 8px; }
.mt-reject__form { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.mt-card__more { margin-top: 10px; font-size: 13px; }
.mt-card__more > summary { cursor: pointer; color: var(--text-secondary); }
.mt-card__more[open] > summary { margin-bottom: 8px; }
.mt-card__more p { margin: 6px 0; }
@media (max-width: 600px) {
  .mt-card__pr { grid-template-columns: 1fr; gap: 2px; }
  .mt-card__pr dd + dt { margin-top: 6px; }
  .mt-card__wait { margin-left: 0; width: 100%; }
}

/* 23.11: «Статус работ» — журнал «помогло ли» одной свёрнутой строкой под работами. */
.deliv-journal { margin-top: 16px; }
.deliv-journal > summary { cursor: pointer; list-style: none; display: flex; flex-wrap: wrap; gap: 8px; align-items: baseline; }
.deliv-journal > summary::-webkit-details-marker { display: none; }
.deliv-journal > summary::before { content: '▸'; }
.deliv-journal[open] > summary::before { content: '▾'; }
.deliv-journal__sum { font-weight: 400; font-size: 13px; color: var(--text-secondary); }
.deliv-journal__h { margin: 14px 0 6px; font-size: 14px; }

/* 23.11: «Вопросы людям» — суть вопроса, «Что предлагаем», «Если не ответить», контекст по клику. */
.ask-q__main { font-weight: 600; margin-bottom: 4px; }
.ask-q__line { font-size: 13px; margin: 2px 0; }
.ask-q__more { font-size: 13px; color: var(--text-secondary); margin: 2px 0 4px; }
.ask-q__more > summary { cursor: pointer; }

/* 23.11: «Документы» — название не сжимается в столбик по слову: фиксированная раскладка колонок. */
.docs-table { table-layout: fixed; width: 100%; }
.docs-table th:nth-child(1), .docs-table td:nth-child(1) { width: 44%; }
.docs-table th:nth-child(2), .docs-table td:nth-child(2) { width: 14%; }
.docs-table th:nth-child(3), .docs-table td:nth-child(3) { width: 18%; }
.docs-table th:nth-child(4), .docs-table td:nth-child(4) { width: 12%; }
.docs-table th:nth-child(5), .docs-table td:nth-child(5) { width: 12%; }
.docs-table td { overflow-wrap: anywhere; }
.docs-table .badge { white-space: normal; display: inline-block; max-width: 100%; }

/* 23.11: «Сотрудники и агенты» — технический блок свёрнут. */
.team-dev { margin-top: 16px; }
.team-dev > summary { cursor: pointer; color: var(--text-secondary); font-size: 14px; }

/* 23.11: «Задачи» клиента — название задачи шире, статус и ответственный не сжимаются в столбик по слову. */
.ct-table { table-layout: fixed; width: 100%; }
.ct-table th:nth-child(1), .ct-table td:nth-child(1) { width: 52%; }
.ct-table th:nth-child(2), .ct-table td:nth-child(2) { width: 20%; }
.ct-table th:nth-child(3), .ct-table td:nth-child(3) { width: 16%; }
.ct-table th:nth-child(4), .ct-table td:nth-child(4) { width: 12%; }
.ct-table td { overflow-wrap: anywhere; }
@media (max-width: 700px) { .ct-table { table-layout: auto; } .ct-table th, .ct-table td { width: auto !important; } }

/* 23.11: перепроверка техпунктов в «Техническом состоянии сайта». */
.ct-block__sub { margin: 10px 0 4px; font-size: 13px; color: var(--text-secondary); }
.today-row--ok { border-left-color: var(--better); }
.today-row--muted { opacity: 0.75; }

/* 23.11: единая подсказка под заголовком блока/страницы (views/admin/hint.ts). */
.block-hint { margin: 4px 0 12px; font-size: 13px; line-height: 1.45; color: var(--text-secondary); max-width: 900px; }
.block-hint__need { font-weight: 600; white-space: nowrap; }
.block-hint__need--act, .block-hint__need--answer { color: #B9580F; }
.block-hint__need--none { color: var(--better); }
.block-hint__need--optional { color: var(--text-secondary); }

/* 23.11: «Готово» — пометка «Передано клиенту» в строке вместо отдельного блока. */
.deliv-sent { display: block; margin-top: 4px; font-size: 12px; color: var(--text-secondary); }
.deliv-sent--late { color: var(--worse); font-weight: 600; }

/* 23.11: «Сегодня» — светофор по клиентам и список «Решить». */
.hm-h { margin: 24px 0 4px; font-size: 17px; display: flex; gap: 8px; align-items: baseline; }
.hm-h__sub { font-size: 13px; font-weight: 400; color: var(--text-secondary); }
.hm-health { display: grid; gap: 8px; }
.hm-row { display: grid; grid-template-columns: 160px minmax(0, 1fr) auto; gap: 14px; align-items: center; background: var(--card-bg); border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; color: inherit; text-decoration: none; }
.hm-row:hover { border-color: var(--text-main); }
.hm-row__name { display: flex; gap: 8px; align-items: center; font-weight: 700; }
.hm-row__more { display: block; font-size: 13px; color: var(--text-secondary); margin-top: 2px; }
.hm-row__nums { display: flex; gap: 12px; font-size: 13px; color: var(--text-secondary); white-space: nowrap; font-variant-numeric: tabular-nums; }
.hm-up { color: var(--better); font-weight: 600; } .hm-down { color: var(--worse); font-weight: 600; }
.hm-dot { width: 10px; height: 10px; border-radius: 999px; flex: none; }
.hm-dot--bad { background: var(--worse); } .hm-dot--warn { background: #E8A15A; } .hm-dot--ok { background: var(--better); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
@media (max-width: 700px) { .hm-row { grid-template-columns: 1fr; gap: 4px; } .hm-row__nums { white-space: normal; flex-wrap: wrap; } }

/* 23.11: страница клиента одним экраном — светофор, «Как дела», три колонки. */
.cl-health { display: flex; gap: 10px; align-items: baseline; background: var(--card-bg); border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; margin: 0 0 8px; }
.cl-health .hm-dot { align-self: center; }
.cl-health__more { color: var(--text-secondary); font-size: 13px; }
.cl-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.cl-kpi { background: var(--card-bg); border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; }
.cl-kpi b { display: block; font-size: 22px; font-variant-numeric: tabular-nums; }
.cl-kpi span { color: var(--text-secondary); font-size: 13px; }
.cl-cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.cl-col { background: var(--card-bg); border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; min-width: 0; }
.cl-col--decide { border-top: 4px solid #E8A15A; } .cl-col--work { border-top: 4px solid #7FA6DB; } .cl-col--done { border-top: 4px solid var(--better); }
.cl-col h3 { margin: 0 0 2px; font-size: 15px; display: flex; gap: 8px; align-items: center; }
.cl-col__hint { margin: 0 0 8px; font-size: 12px; color: var(--text-secondary); }
.cl-col ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.cl-col li a { font-weight: 600; text-decoration: none; color: inherit; } .cl-col li a:hover { text-decoration: underline; }
.cl-col li span { display: block; font-size: 12px; color: var(--text-secondary); margin-top: 1px; }
.cl-col li.cl-col__late span { color: var(--worse); font-weight: 600; }
.cl-col__more { margin: 8px 0 0; font-size: 13px; color: var(--text-secondary); }
.ct-fold { background: var(--card-bg); border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; margin-top: 12px; }
.ct-fold > summary { cursor: pointer; font-weight: 600; }
.ct-fold[open] > summary { margin-bottom: 10px; }
@media (max-width: 900px) { .cl-cols { grid-template-columns: 1fr; } .cl-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.cl-below { margin-top: 12px; }
.cl-col li a { font-size: 14px; line-height: 1.35; }

/* 23.11, этап 3: страница «Система». */
.sys-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.sys-card { display: block; background: var(--card-bg); border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; color: inherit; text-decoration: none; }
.sys-card:hover { border-color: var(--text-main); }
.sys-card b { display: flex; gap: 8px; align-items: center; margin-bottom: 4px; font-size: 15px; }
.sys-card span { color: var(--text-secondary); font-size: 13px; }
@media (max-width: 700px) { .sys-grid { grid-template-columns: 1fr; } }

/* 23.11: карточка клиента — три вкладки, «Подробнее по клиенту», обратная ссылка на подробных страницах. */
.ct-more { margin-top: 16px; }
.ct-more__grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.ct-more__grid .sys-card { padding: 10px 12px; }
.ct-more__grid .sys-card b { font-size: 14px; margin-bottom: 2px; }
.project-detail-back { margin: 4px 0 12px; font-size: 14px; color: var(--text-secondary); }
.project-detail-back a { font-weight: 600; }
@media (max-width: 900px) { .ct-more__grid { grid-template-columns: 1fr; } }
/* 23.11: «Спросить систему» (.ask-box). */
.ask-box { background: var(--card-bg); border: 2px solid var(--border-strong); border-radius: var(--radius); padding: 16px 18px; margin: 0 0 16px; }
.ask-box__title { margin: 0 0 4px; font-size: 18px; }
.ask-box__form { display: grid; gap: 10px; margin-top: 8px; }
.ask-box__input { width: 100%; min-height: 64px; max-height: 40vh; resize: vertical; field-sizing: content; font: inherit; font-size: 18px; line-height: 1.4; padding: 12px 14px; border: 2px solid var(--border-strong); border-radius: 12px; background: #fff; color: var(--text-main); }
.ask-box__input:focus { outline: none; border-color: var(--text-main); }
.ask-box__actions { display: flex; gap: 12px; align-items: center; }
.ask-box__btn { font: inherit; font-weight: 600; padding: 10px 22px; border: 0; border-radius: 999px; background: var(--accent); color: var(--text-main); cursor: pointer; }
.ask-box__btn:hover { filter: brightness(0.95); }
.ask-box__wait { color: var(--text-secondary); font-size: 14px; display: none; }
.ask-box__wait.htmx-request { display: inline; }
.ask-box__presets { display: flex; flex-wrap: wrap; gap: 8px; }
.ask-box__preset { font: inherit; font-size: 14px; padding: 6px 12px; border: 1px solid var(--border-strong); border-radius: 999px; background: var(--bg); color: var(--text-main); cursor: pointer; }
.ask-box__preset:hover { border-color: var(--text-main); }
.ask-box__out:not(:empty) { margin-top: 14px; }
.ask-box__q { margin: 0 0 6px; font-weight: 600; }
.ask-box__answer { white-space: pre-wrap; line-height: 1.5; font-size: 16px; background: var(--bg); border-radius: 12px; padding: 12px 14px; }
.ask-box__meta { margin: 6px 0 0; font-size: 12px; color: var(--text-secondary); }
@media (max-width: 700px) { .ask-box { padding: 12px; } .ask-box__actions, .ask-box__presets { flex-direction: column; align-items: stretch; } .ask-box__btn { width: 100%; } .ask-box__preset { text-align: left; } }

/* 23.11: подсказки тише — мелкий серый текст. */
.block-hint { font-size: 12px; line-height: 1.4; margin: 2px 0 10px; color: var(--text-secondary); }
.block-hint__need { font-weight: 600; }
.cl-cols { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.cl-col--wait { border-top: 4px solid #B08BD8; }
@media (max-width: 1100px) { .cl-cols { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 700px) { .cl-cols { grid-template-columns: 1fr; } }
.project-detail-back [aria-current="page"] { font-weight: 600; color: var(--text-main); }

/* 23.11: «Решить» на «Сегодня» — как почта: по клиентам, строка раскрывается в карточку. */
.hm-groups { display: grid; gap: 12px; }
.hm-group { background: var(--card-bg); border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; }
.hm-group__h { margin: 0 0 6px; font-size: 15px; display: flex; gap: 8px; align-items: center; }
.hm-rows { list-style: none; margin: 0; padding: 0; }
.hm-rows > li { border-top: 1px solid var(--divider); }
.hm-rows > li:first-child { border-top: 0; }
.hm-item > summary { list-style: none; cursor: pointer; display: grid; grid-template-columns: 130px minmax(0, 1fr) auto; gap: 10px; align-items: baseline; padding: 8px 4px; }
.hm-item > summary::-webkit-details-marker { display: none; }
.hm-item > summary:hover { background: var(--bg); }
.hm-item[open] > summary { font-weight: 600; }
.hm-item__kind { font-size: 12px; font-weight: 700; color: var(--text-secondary); }
.hm-item--urgent .hm-item__kind { color: #B9580F; }
.hm-item__title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hm-item[open] .hm-item__title { white-space: normal; }
.hm-item__wait { font-size: 12px; color: var(--text-secondary); white-space: nowrap; }
.hm-item .mt-card { margin: 4px 0 10px; }
@media (max-width: 700px) { .hm-item > summary { grid-template-columns: 1fr; gap: 2px; } .hm-item__title { white-space: normal; } }

/* 23.11 аудит: колонки таблиц админов, счетов и документов клиента не сжимаются в столбик по букве. */
.admins-table td:nth-child(2), .admins-table td:nth-child(3) { white-space: nowrap; }
.billing-table th, .billing-table td:nth-child(-n+5) { white-space: nowrap; }
.billing-table input[type="file"] { max-width: 180px; font-size: 12px; }
.ct-table td:nth-child(3) .ct-src, .ct-table td:nth-child(3) { font-size: 12px; }
.ct-table td { vertical-align: top; }

/* 23.11 аудит: «⋯ Ещё» в строке «Статуса работ» — короткое меню, пункты раскрываются по одному. */
.deliv-menu > summary { cursor: pointer; font-size: 13px; color: var(--text-secondary); list-style: none; }
.deliv-menu > summary::-webkit-details-marker { display: none; }
.deliv-menu[open] > summary { color: var(--text-main); font-weight: 600; }
.deliv-menu__list { display: grid; gap: 4px; margin-top: 6px; padding: 6px 8px; border: 1px solid var(--border); border-radius: 8px; background: var(--card-bg); min-width: 220px; }
.deliv-menu__item > summary { cursor: pointer; font-size: 13px; padding: 4px 2px; }
.deliv-menu__item > summary:hover { text-decoration: underline; }
.deliv-menu__item[open] > summary { font-weight: 600; }
.deliv-actions .btn { white-space: nowrap; }

/* 23.11: решения по сайту — «что станет» после одобрения. */
.ns-after { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 2px 10px; margin: 6px 0 0; font-size: 13px; }
.ns-after dt { color: var(--text-secondary); }
.ns-after dd { margin: 0; }

/* 23.11 редизайн: подсказка — одна строка «что сделать», только когда нужно действие. */
.block-hint { font-size: 12.5px; margin: 0 0 8px; color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.block-hint--act, .block-hint--answer { color: #9A4A0B; }
.block-hint--act::before, .block-hint--answer::before { content: '→ '; }

/* 23.11 редизайн «Обзора клиента»: плотно, без пояснений. */
.cl-health { font-size: 15px; font-weight: 600; margin: 0 0 10px; }
.cl-health__week { margin-left: auto; font-size: 12px; font-weight: 400; color: var(--text-secondary); white-space: nowrap; padding-left: 12px; }
.cl-kpis { margin-bottom: 12px; }
.cl-kpi { padding: 10px 12px; }
.cl-kpi b { font-size: 20px; }
.cl-col { padding: 10px 12px; }
.cl-col h3 { font-size: 14px; margin-bottom: 8px; justify-content: space-between; }
.cl-col__n { font-size: 12px; font-weight: 700; color: var(--text-secondary); background: var(--bg); border-radius: 999px; padding: 1px 8px; }
.cl-col ul { gap: 6px; }
.cl-col li a { font-weight: 500; font-size: 13.5px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cl-col li.cl-col__late a { font-weight: 600; }
.cl-col li span { font-size: 12px; }
.cl-col__empty { margin: 0; font-size: 13px; color: var(--text-secondary); }
.cl-col__more { display: inline-block; margin-top: 8px; font-size: 12.5px; font-weight: 600; }
.cl-links { display: flex; flex-wrap: wrap; gap: 6px; margin: 14px 0 4px; }
.cl-links a { font-size: 13px; padding: 5px 10px; border: 1px solid var(--border); border-radius: 999px; background: var(--card-bg); color: inherit; text-decoration: none; }
.cl-links a:hover { border-color: var(--text-main); }
/* «Спросить систему» в обзоре — одной строкой. */
.ask-compact { margin: 12px 0 0; }
.ask-compact .ask-box { padding: 8px 10px; }
.ask-compact .ask-box__title, .ask-compact .ask-box__presets { display: none; }
.ask-compact .ask-box__form { display: flex; gap: 8px; align-items: center; }
.ask-compact .ask-box__input { flex: 1; min-height: 38px; height: 38px; resize: none; }
.ask-compact .ask-box__actions { margin: 0; }
/* 23.11 редизайн: длинные заметки — одной строкой, полный текст в подсказке. */
.deliv-cell-title > .deliv-item__line--clamp, .deliv-item__line--clamp { display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.hm-row__say { font-weight: 500; }

/* 23.11 редизайн: агенты списком. */
.team-group--row { display: flex; align-items: center; gap: 10px; }
.team-group__sub { font-size: 12px; font-weight: 400; color: var(--text-secondary); text-transform: none; letter-spacing: 0; }
.team-group--row .btn { margin-left: auto; text-transform: none; letter-spacing: 0; }
.team-agents { list-style: none; margin: 0; padding: 0; background: var(--card-bg); border: 1px solid var(--border); border-radius: 12px; }
.team-agent { display: grid; grid-template-columns: 14px 170px 220px minmax(0, 1fr); gap: 10px; align-items: center; padding: 9px 14px; border-top: 1px solid var(--divider); font-size: 13.5px; }
.team-agent:first-child { border-top: 0; }
.team-agent__role { color: var(--text-secondary); font-size: 12.5px; }
.team-agent__status { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 800px) { .team-agent { grid-template-columns: 14px 1fr; } .team-agent__role, .team-agent__status { grid-column: 2; } }

/* ==== 23.11 Набор компонентов панели (ui-kit). Новые и переделанные страницы собираются только из него. ==== */
:root {
  --sev-high: #B42318; --sev-high-bg: #FDECEA;
  --sev-med: #B54708; --sev-med-bg: #FEF3E2;
  --sev-low: #5C5F55; --sev-low-bg: #EFF0EB;
  --info: #175CD3; --info-bg: #EAF1FB;
  --ok: #127A3F; --ok-bg: #E6F4EB;
  --focus: #20211F;
}
/* Заголовок страницы/раздела: слева название и строка-мета, справа одно главное действие. */
.pg-head { display: flex; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin: 4px 0 14px; }
.pg-head__main { flex: 1 1 320px; min-width: 0; }
.pg-head__title { font-size: 22px; line-height: 1.2; font-weight: 650; margin: 0; letter-spacing: -0.01em; }
.pg-head__meta { margin: 4px 0 0; font-size: 13px; color: var(--text-secondary); }
.pg-head__actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* Полоса ключевых цифр: число крупно, подпись мелко. */
.kpis { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; padding: 0; list-style: none; }
.kpi { background: var(--card-bg); border: 1px solid var(--border); border-radius: 12px; padding: 10px 14px; min-width: 120px; }
.kpi__num { display: block; font-size: 22px; font-weight: 650; line-height: 1.1; font-variant-numeric: tabular-nums; }
.kpi__label { display: block; font-size: 12.5px; color: var(--text-secondary); margin-top: 2px; }
.kpi--high .kpi__num { color: var(--sev-high); }
.kpi--ok .kpi__num { color: var(--ok); }

/* Фильтры-чипы. */
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 12px; }
.chip { appearance: none; font: inherit; font-size: 13px; display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--border-strong); background: var(--card-bg); color: var(--text-main); cursor: pointer; }
.chip:hover { border-color: var(--text-secondary); }
.chip[aria-pressed="true"] { background: var(--text-main); border-color: var(--text-main); color: #fff; }
.chip__n { font-variant-numeric: tabular-nums; color: var(--text-secondary); }
.chip[aria-pressed="true"] .chip__n { color: #C9CCC2; }

/* Таблица данных. */
.dt-wrap { background: var(--card-bg); border: 1px solid var(--border); border-radius: 14px; overflow-x: auto; margin: 0 0 18px; }
table.dt { width: 100%; border-collapse: collapse; font-size: 14px; }
table.dt th { text-align: left; font-size: 12px; font-weight: 600; color: var(--text-secondary); padding: 10px 14px; border-bottom: 1px solid var(--border); white-space: nowrap; background: #FAFAF7; }
table.dt td { padding: 11px 14px; border-top: 1px solid var(--divider); vertical-align: top; }
table.dt tbody:first-of-type tr:first-child td, table.dt tr.dt-group + tr td { border-top: 0; }
table.dt .num, table.dt .date { white-space: nowrap; font-variant-numeric: tabular-nums; color: var(--text-secondary); font-size: 13px; }
table.dt tr.dt-group td { background: #F6F6F2; border-top: 1px solid var(--border); padding: 9px 14px; font-weight: 650; font-size: 13.5px; }
table.dt tr.dt-group .dt-group__n { color: var(--text-secondary); font-weight: 500; margin-left: 6px; }
.dt-group__aside { float: right; font-weight: 400; font-size: 12.5px; color: var(--text-secondary); display: inline-flex; gap: 10px; align-items: center; }
table.dt tbody.dt-item:hover > tr:first-child td { background: #FBFBF8; }
table.dt .dt-actions { white-space: nowrap; text-align: right; width: 1%; }
.dt-actions__in { display: inline-flex; gap: 6px; align-items: center; }
.dt-title { display: block; font-weight: 550; line-height: 1.35; }
.dt-sub { display: block; font-size: 13px; color: var(--text-secondary); margin-top: 2px; }
.dt-tag { display: inline-block; font-size: 11.5px; font-weight: 500; color: var(--text-secondary); background: var(--sev-low-bg); border-radius: 6px; padding: 1px 6px; margin-left: 6px; vertical-align: 1px; white-space: nowrap; }
/* Раскрытие строки: заголовок — кнопка, под строкой — подробности. */
.dt-toggle { appearance: none; background: none; border: 0; padding: 0; margin: 0; font: inherit; color: inherit; text-align: left; cursor: pointer; display: flex; gap: 8px; align-items: flex-start; width: 100%; }
.dt-toggle::before { content: ''; flex: none; width: 7px; height: 7px; margin-top: 7px; border-right: 1.6px solid var(--text-secondary); border-bottom: 1.6px solid var(--text-secondary); transform: rotate(-45deg); transition: transform .15s ease-out; }
.dt-toggle[aria-expanded="true"]::before { transform: rotate(45deg); }
.dt-toggle:hover .dt-title { text-decoration: underline; text-underline-offset: 3px; }
tr.dt-detail td { border-top: 0; padding: 0 14px 16px 37px; background: #FBFBF8; }
.dt-detail__grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px 28px; font-size: 13.5px; }
.dt-detail__grid > * { margin: 0; }
.dt-detail h4 { font-size: 12px; font-weight: 600; color: var(--text-secondary); margin: 10px 0 4px; }
.dt-detail ul { margin: 0; padding-left: 18px; }
.dt-detail li { margin: 2px 0; overflow-wrap: anywhere; }
.dt-detail p { margin: 0 0 4px; }
.dt-empty { padding: 28px 14px; text-align: center; color: var(--text-secondary); }
@media (max-width: 800px) {
  .dt-detail__grid { grid-template-columns: 1fr; }
  table.dt .hide-sm { display: none; }
  tr.dt-detail td { padding-left: 14px; }
}

/* Важность: точка + слово (цвет не единственный признак). */
.sev { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; white-space: nowrap; }
.sev::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.sev--high { color: var(--sev-high); font-weight: 600; }
.sev--medium { color: var(--sev-med); }
.sev--low { color: var(--sev-low); }

/* Статус — плашка. */
.pill { display: inline-flex; align-items: center; min-height: 22px; padding: 0 8px; border-radius: 6px; font-size: 12.5px; font-weight: 500; white-space: nowrap; background: var(--sev-low-bg); color: var(--text-secondary); }
.pill--info { background: var(--info-bg); color: var(--info); }
.pill--ok { background: var(--ok-bg); color: var(--ok); }
.pill--warn { background: var(--sev-med-bg); color: var(--sev-med); }
.pill--bad { background: var(--sev-high-bg); color: var(--sev-high); }

/* Кнопки: единые размеры и фокус. */
.btn { font-family: inherit; }
.btn--ghost { background: transparent; border-color: transparent; }
.btn--ghost:hover { background: var(--divider); border-color: transparent; }
.btn--sm { min-height: 32px; padding: 0 12px; font-size: 13px; border-radius: 9px; }
.btn:focus-visible, .chip:focus-visible, .dt-toggle:focus-visible, .menu > summary:focus-visible, .menu__item:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
select { font: inherit; font-size: 14px; min-height: 36px; padding: 0 30px 0 10px; border: 1px solid var(--border-strong); border-radius: 9px; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%235C5F55' stroke-width='1.6'/%3E%3C/svg%3E") no-repeat right 10px center; appearance: none; color: var(--text-main); }

/* Меню «⋯»: редкие и опасные действия. */
.menu { position: relative; display: inline-block; }
.menu > summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; min-width: 32px; min-height: 32px; border-radius: 9px; border: 1px solid var(--border-strong); background: #fff; font-size: 16px; line-height: 1; color: var(--text-main); }
.menu > summary::-webkit-details-marker { display: none; }
.menu > summary:hover { background: var(--bg); }
.menu[open] > summary { background: var(--divider); }
.menu__panel { position: absolute; right: 0; top: calc(100% + 4px); z-index: 40; min-width: 220px; background: #fff; border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 8px 24px rgba(32, 33, 31, .14); padding: 6px; text-align: left; }
.menu__label { font-size: 12px; color: var(--text-secondary); padding: 6px 10px 4px; margin: 0; white-space: nowrap; }
.menu__panel form { margin: 0; }
.menu__item { appearance: none; display: block; width: 100%; text-align: left; font: inherit; font-size: 14px; padding: 8px 10px; border: 0; border-radius: 8px; background: none; color: var(--text-main); cursor: pointer; white-space: nowrap; text-decoration: none; }
.menu__item:hover { background: var(--bg); }
.menu__sep { height: 1px; background: var(--divider); margin: 5px 4px; }

/* Свёрнутый раздел («Решённые», «Архив»). */
.fold { margin: 0 0 18px; }
.fold > summary { cursor: pointer; font-weight: 600; font-size: 14px; padding: 8px 0; color: var(--text-secondary); }
.fold > summary:hover { color: var(--text-main); }
.fold[open] > summary { margin-bottom: 6px; }
table.dt col.c-sev { width: 128px; }
table.dt col.c-date { width: 76px; }
table.dt col.c-st { width: 150px; }
table.dt col.c-act { width: 1%; }
.dt-sub { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 62ch; }
.dt-title { font-weight: 600; }
table.dt col.c-sev { width: 112px; }
table.dt col.c-st { width: 128px; }
table.dt td.dt-main { max-width: 0; }
.dt-sub { max-width: none; }
.dt-tag--lead { margin: 0 6px 0 0; }
.dt-group__notes { clear: both; margin: 6px 0 0; padding-left: 18px; font-weight: 400; font-size: 12.5px; color: var(--sev-med); }
@media (max-width: 700px) {
  table.dt, table.dt > tbody, table.dt tr, table.dt td { display: block; }
  table.dt > thead, table.dt > colgroup, table.dt td.hide-sm { display: none; }
  table.dt tbody.dt-item > tr:first-child { display: grid; grid-template-columns: 1fr auto; gap: 8px 10px; padding: 12px 14px; border-top: 1px solid var(--divider); }
  table.dt tbody.dt-item > tr:first-child > td { padding: 0; border: 0; }
  table.dt td.dt-main { max-width: none; grid-column: 1 / -1; }
  table.dt td.dt-actions { width: auto; text-align: right; }
  table.dt tbody.dt-item > tr:first-child > td:empty { display: none; }
  .dt-sub { white-space: normal; }
  .dt-group__aside { float: none; display: flex; flex-wrap: wrap; margin-top: 6px; }
  tr.dt-detail td { padding: 0 14px 14px; }
  .kpis { display: grid; grid-template-columns: 1fr 1fr; }
  .kpi { min-width: 0; }
}

/* 23.11 «Сегодня» и «Спросить систему»: поле в одну строку. */
.ask-box { padding: 14px 16px; }
.ask-box__title { font-size: 14px; margin: 0 0 8px; }
.ask-box__form { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: start; }
.ask-box__input { min-height: 42px; resize: vertical; font: inherit; font-size: 15px; }
.ask-box__actions { margin: 0; }
.ask-box__btn { min-height: 42px; }
.ask-box__presets { grid-column: 1 / -1; margin: 0; }
.hm-page .hm-h { margin-top: 22px; }
/* 23.11 asks/my-tasks */
.asks-page .ask-q, .ask-d .ask-q { margin: 0 0 10px; padding-left: 20px; display: flex; flex-direction: column; gap: 10px; font-size: 13.5px; }
.ask-d { padding-top: 6px; max-width: 880px; }
.ask-d__line { margin: 0 0 6px; font-size: 13px; color: var(--text-secondary); }
.ask-d__meta { margin: 10px 0 0; font-size: 12.5px; color: var(--text-secondary); }
.ask-d .ask-answer { margin: 8px 0 0; max-width: none; padding: 0; background: transparent; }
.ask-d .ask-q__more summary { cursor: pointer; color: var(--text-secondary); font-size: 12.5px; }
.ask-d .ask-q__main { font-weight: 600; }
table.dt .btn.dt-toggle { width: auto; display: inline-flex; align-items: center; justify-content: center; gap: 0; }
table.dt .btn.dt-toggle::before { display: none; }
table.dt .btn.dt-toggle { border: 1px solid var(--border-strong); background: var(--card-bg); padding: 0 12px; min-height: 32px; border-radius: 9px; font-size: 13px; }
table.dt .btn.btn--primary.dt-toggle { background: var(--accent); border-color: var(--accent); }
table.dt .btn.dt-toggle:hover { text-decoration: none; }
table.dt td.ask-client { font-size: 13px; color: var(--text-secondary); overflow-wrap: anywhere; }
.asks-table col.c-client, .my-page col.c-client { width: 170px; }
.asks-table col.c-st { width: 110px; }
.asks-table col.c-wait, .my-page col.c-wait { width: 100px; }
.asks-table .menu__panel form.ask-act--danger .menu__item { color: var(--sev-high); }
.my-page .mt-more { margin-top: 10px; font-size: 13.5px; max-width: 880px; }
.my-page .mt-more p { margin: 0 0 6px; }
.my-page .mt-reject__form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 8px; }
.my-page .mt-reject > summary { display: inline-flex; cursor: pointer; list-style: none; }
.tc-menu { align-self: flex-start; }
.pg-head__meta .pill { vertical-align: 1px; }
@media (max-width: 700px) {
  table.dt td.ask-client { grid-column: 1 / -1; order: -1; font-size: 12.5px; }
  table.dt td.dt-actions { grid-column: 1 / -1; text-align: left; }
  .dt-actions__in { flex-wrap: wrap; }
}
.tc-actions .tc-menu > summary { width: 100%; min-height: 44px; border-radius: 10px; font-size: 14px; font-weight: 600; }
/* 23.11 deliverables/docs/feed */
a.chip { text-decoration: none; }
a.chip[aria-pressed="true"] { color: #fff; }
.dv-chip-red { color: var(--sev-high); font-weight: 600; }
.chips + .chips { margin-top: -4px; }
.dv-bar { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 8px 16px; margin: 0 0 12px; }
.dv-bar .chips { margin: 0; flex: 1 1 520px; }
.dv-search { display: flex; gap: 6px; align-items: center; margin-left: auto; }
.dv-search input[type="search"] { font: inherit; font-size: 14px; min-height: 34px; padding: 0 12px; width: 220px; border-radius: 9px; border: 1px solid var(--border-strong); background: var(--card-bg); color: var(--text-main); box-sizing: border-box; }
.dv-add > summary { background: var(--accent); border-color: var(--accent); min-height: 40px; padding: 0 16px; font-size: 14px; font-weight: 600; border-radius: 10px; }
.dv-add > summary:hover { background: #C8EB48; }
.dv-add__panel { width: 360px; max-width: calc(100vw - 32px); padding: 12px; }
.dv-add__panel .admin-form { margin: 0; padding: 0; max-width: none; }
table.dt col.c-days { width: 64px; }
table.dt col.c-time { width: 64px; }
table.dt col.c-client { width: 200px; }
table.dt col.c-who { width: 180px; }
table.dt col.c-type { width: 100px; }
table.dt col.c-origin { width: 28%; }
table.dt col.c-date { width: 110px; }
.dv-late { color: var(--sev-high); font-weight: 600; }
.dv-red > tr:first-child td { background: var(--sev-high-bg); }
.dv-links { display: block; font-size: 12.5px; margin: 3px 0 0 15px; color: var(--text-secondary); }
.dv-links a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.dv-links .deliv-ask { text-decoration: none; padding: 1px 7px; }
.dv-days-sm { display: none; }
.btn.dt-toggle.dv-open { background: var(--accent); border: 1px solid var(--accent); border-radius: 9px; min-height: 32px; font-size: 13px; font-weight: 600; display: inline-flex; width: auto; gap: 0; align-items: center; justify-content: center; padding: 0 12px; text-align: center; }
.btn.dt-toggle.dv-open::before { display: none; }
.dv-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0; }
.dv-form input[type="text"], .dv-form input[type="url"] { font: inherit; font-size: 14px; min-height: 34px; padding: 0 10px; border-radius: 9px; border: 1px solid var(--border-strong); background: #fff; flex: 1 1 200px; min-width: 0; box-sizing: border-box; }
.dv-form label { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; }
.dv-fold { margin: 6px 0 0; }
.dv-fold > summary { cursor: pointer; font-size: 13px; font-weight: 600; padding: 6px 0; }
.dv-fold[open] > summary { margin-bottom: 6px; }
.dv-fold .admin-form { max-width: none; padding: 0; margin: 0; }
.dt-detail .deliv-history { margin: 0; }
.dt-detail .dv-links { margin: 0; font-size: 13px; }
.dv-ellip { max-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-secondary); font-size: 13px; }
table.dv-feed td.date { padding-right: 4px; }
table.dv-feed .ct-client { font-weight: 550; }
table.dv-feed .ct-actor { white-space: nowrap; }
table.dv-feed .dt-title { font-weight: 500; }
.dv-mobile-only { display: none; }
a.dt-title { color: inherit; text-decoration: none; }
a.dt-title:hover { text-decoration: underline; text-underline-offset: 3px; }
@media (max-width: 700px) {
  .dv-search { width: 100%; margin-left: 0; }
  .dv-search input[type="search"] { flex: 1 1 auto; width: auto; min-width: 0; font-size: 16px; }
  .dv-days-sm { display: inline; margin-left: 8px; font-size: 13px; color: var(--text-secondary); }
  .dv-add__panel { position: fixed; left: 16px; right: 16px; top: auto; width: auto; max-width: none; }
  .dv-links { margin-left: 0; }
  .dv-mobile-only { display: block; }
  table.dv-feed tbody.dt-item > tr:first-child { grid-template-columns: auto 1fr; }
  table.dv-feed td.dt-main { grid-column: auto; order: 1; }
  table.dv-docs tbody.dt-item > tr:first-child { grid-template-columns: auto auto 1fr; }
  table.dv-docs td.dt-main { order: -1; }
  .dv-ellip { max-width: none; white-space: normal; }
  .dv-form input[type="text"], .dv-form input[type="url"] { font-size: 16px; flex-basis: 100%; }
}
table.dv-feed .dt-main .dt-title { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.dv-days-sm { white-space: nowrap; }
/* 23.11 agents/tasks/plan */
.legacy-off-banner { margin: 0 0 12px; padding: 6px 12px; border-radius: 8px; background: var(--sev-med-bg); color: var(--sev-med); font-size: 13px; }
table.dt col.c-id { width: 92px; }
table.dt col.c-kind { width: 190px; }
.agents-dt td.dt-main { max-width: 0; }
.agents-dt .dt-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.agents-dt .dt-title .badge { margin-right: 6px; }
.agents-sub-id { display: none; }
.agents-row--muted .dt-title, .agents-row--muted .dt-sub { opacity: .65; }
.agents-quiet { margin: 0 0 14px; font-size: 13px; color: var(--text-secondary); }
.agents-attention { margin: 0 0 18px; }
.agents-attention .fold { margin: -8px 0 0; }
.agents-section-title { margin: 22px 0 10px; }
.agents-filter select { min-height: 36px; padding: 0 30px 0 10px; font-size: 14px; }
.agents-filter input[type="search"] { min-height: 36px; border-radius: 9px; }
.agents-filter { margin-bottom: 10px; }
.dt-actions__in form.inline-form { margin: 0; }
@media (max-width: 700px) {
  .agents-sub-id { display: inline; }
  .agents-dt .dt-title { white-space: normal; }
  .agents-dt tbody.dt-item > tr:first-child > td:last-child { grid-column: 1 / -1; }
  table.dt tbody.dt-item > tr:first-child > td.dt-actions { grid-column: 1 / -1; text-align: left; }
}
table.dt col.c-who { width: 180px; }
.agents-attention .dt-wrap, .spr-card, .spr-dtwrap, #ct-tasks { overflow: visible; }
.spr-card { overflow: visible; }
.spr-card > .spr-h { border-radius: 14px 14px 0 0; }
.spr-dtwrap { border: 0; border-radius: 0; margin: 0; background: transparent; }
table.dt.spr-dt col.c-chk { width: 40px; }
table.dt.spr-dt col.c-src { width: 120px; }
table.dt.spr-dt col.c-who { width: 150px; }
table.dt.spr-dt col.c-st { width: 130px; }
.spr-dt td.spr-chk { padding-right: 0; }
.spr-dt .spr-chk .spr-form { display: inline-flex; }
.spr-dt .dt-title { font-weight: 550; }
.spr-row--done .dt-title { text-decoration: line-through; color: var(--text-secondary); }
.spr-subs { display: flex; flex-wrap: wrap; gap: 2px 10px; font-size: 12.5px; color: var(--text-secondary); margin-top: 2px; }
.spr-subs .spr-why { flex: 0 1 auto; }
.spr-dt .spr-sum, .spr-dt .spr-why { flex: 0 1 auto; margin-top: 3px; display: block; }
.spr-dt .dt-actions .spr-form { margin: 0; }
.spr-dt .menu__panel .spr-form { display: flex; padding: 4px 6px; }
.spr-dt .menu__panel .spr-input { min-height: 34px; font-size: 14px; flex: 1 1 auto; min-width: 150px; }
.spr-dt .spr-who { font-size: 13.5px; }
.spr-dt .spr-av { width: 22px; height: 22px; font-size: 11px; }
.spr-dt .dt-tag { margin: 0; }
.spr-add { flex-wrap: nowrap; align-items: center; border-radius: 0 0 14px 14px; }
.spr-add .spr-input, .spr-add .spr-select { min-height: 36px; font-size: 14px; border-radius: 9px; }
.spr-add .spr-select { flex: 0 0 160px; }
.spr-tails > .dt-wrap { margin: 0; }
.spr-dt--tails td.dt-main { max-width: none; }
@media (max-width: 700px) {
  .spr-add { flex-wrap: wrap; }
  .spr-add .spr-select { flex: 1 1 120px; }
  .spr-dt tbody.dt-item > tr:first-child { grid-template-columns: 28px 1fr auto; }
  .spr-dt tbody.dt-item > tr:first-child > td.dt-main { grid-column: 2 / -1; }
  .spr-dt tbody.dt-item > tr:first-child > td.spr-who-td { grid-column: 2; }
  .spr-dt tbody.dt-item > tr:first-child > td.dt-actions { grid-column: 1 / -1; text-align: right; }
  .spr-dt--tails tbody.dt-item > tr:first-child { grid-template-columns: 1fr; }
}
table.dt a.dt-title { color: inherit; text-decoration: none; }
table.dt a.dt-title:hover { text-decoration: underline; text-underline-offset: 3px; }
.agents-dt .dt-sub { white-space: nowrap; }
.spr-row--gone { opacity: .5; }
.spr-chk input[type=checkbox] { width: 20px; height: 20px; margin: 0; }
@media (max-width: 700px) {
  .spr-dt tbody.dt-item > tr:first-child > td:nth-child(1) { grid-row: 1; grid-column: 1; }
  .spr-dt tbody.dt-item > tr:first-child > td.dt-main { grid-row: 1; }
  .spr-dt tbody.dt-item > tr:first-child > td.spr-who-td { grid-row: 2; grid-column: 2; }
  .spr-dt tbody.dt-item > tr:first-child > td:nth-child(5) { grid-row: 2; grid-column: 3; justify-self: end; }
  .spr-dt tbody.dt-item > tr:first-child > td.dt-actions { grid-row: 3; }
  .spr-dt tbody.dt-item > tr:first-child > td.dt-actions:has(.dt-actions__in:empty) { display: none; }
}
.aiv-dt th[scope="row"] { text-align: left; font-weight: 550; font-size: 14px; color: var(--text-main); background: transparent; white-space: nowrap; border-bottom: 0; border-top: 1px solid var(--divider); }
.aiv-dt .aiv-n { font-variant-numeric: tabular-nums; }
.aiv-dt .aiv-n strong { font-size: 17px; }
.aiv-of { font-size: 12.5px; color: var(--text-secondary); margin-left: 4px; }
.aiv-d { font-size: 12px; margin-left: 6px; color: var(--text-secondary); }
.aiv-d--up { color: var(--ok); }
.aiv-d--down { color: var(--sev-high); }
table.dt tr.aiv-client td { font-weight: 600; background: var(--info-bg); }
table.dt .row-actions { text-align: right; white-space: nowrap; width: 1%; }
table.dt tr.is-muted td { opacity: .6; }
.aiv-q td, .aiv-q th { vertical-align: top; }
@media (max-width: 700px) {
  table.dt.aiv-dt { display: table; }
  table.dt.aiv-dt > thead { display: table-header-group; }
  table.dt.aiv-dt > tbody { display: table-row-group; }
  table.dt.aiv-dt tr { display: table-row; }
  table.dt.aiv-dt td, table.dt.aiv-dt th { display: table-cell; padding: 9px 8px; }
  .aiv-dt th[scope="row"] { white-space: normal; font-size: 13px; }
  .aiv-dt .aiv-of { display: block; margin: 0; }
}
@media (max-width: 700px) {
  .aiv-dt th[scope="row"] { overflow-wrap: normal !important; word-break: normal !important; hyphens: none !important; font-size: 12px; min-width: 104px; }
  .aiv-dt td:first-child { white-space: nowrap; }
}

/* 23.11 ui-kit: меню «⋯» последних строк не обрезается краем таблицы; углы шапки повторяют скругление. */
.dt-wrap { overflow: visible; }
table.dt thead th:first-child { border-top-left-radius: 14px; }
table.dt thead th:last-child { border-top-right-radius: 14px; }
.dt-wrap--scroll { overflow-x: auto; }
input[type="checkbox"], input[type="radio"] { accent-color: var(--text-main); }
/* 23.11 settings/clients */
/* Форма «подпись слева / поле справа»; на телефоне в столбик. Карточка-секция с заголовком и одной кнопкой «Сохранить». */
.admin-form.form-grid { max-width: 880px; width: 100%; gap: 0; padding: 2px 18px 16px; border: 1px solid var(--border); border-radius: 14px; margin: 0 0 14px; box-sizing: border-box; }
.admin-form.form-grid--flat { border: 0; padding: 0; margin: 0; max-width: none; background: transparent; }
.form-grid > h3, .form-grid > .fsec__title { font-size: 15px; font-weight: 650; margin: 0; padding: 14px 0 8px; color: var(--text-main); }
.form-grid .admin-form__field { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 2px 16px; align-items: start; padding: 10px 0; border-top: 1px solid var(--divider); font-size: 14px; color: var(--text-main); margin: 0; border-left: 0; border-right: 0; border-bottom: 0; min-width: 0; }
.form-grid > .fsec__title + .admin-form__field, .form-grid > h3 + .admin-form__field { border-top: 0; }
.form-grid .admin-form__field > span:first-child, .form-grid .admin-form__field > legend { grid-column: 1; padding-top: 9px; font-size: 13.5px; color: var(--text-secondary); line-height: 1.3; float: none; padding-left: 0; padding-right: 0; }
.form-grid .admin-form__field > :not(:first-child) { grid-column: 2; min-width: 0; }
.form-grid .admin-form__field input[type="text"], .form-grid .admin-form__field input[type="password"], .form-grid .admin-form__field input[type="date"], .form-grid .admin-form__field select, .form-grid .admin-form__field textarea { width: 100%; box-sizing: border-box; max-width: 520px; }
.form-grid .admin-form__hint { margin: 0; font-size: 12.5px; color: var(--text-secondary); line-height: 1.35; }
.form-grid .admin-form__static { grid-column: 2; padding-top: 9px; font-size: 14px; }
.form-grid .admin-form__actions { justify-content: flex-end; margin: 0; padding-top: 14px; border-top: 1px solid var(--divider); }
.form-grid .admin-form__check { margin: 0; }
.form-grid .admin-form__field .admin-form__check { padding-top: 8px; }
@media (max-width: 700px) {
  .admin-form.form-grid { padding: 2px 14px 14px; }
  .form-grid .admin-form__field { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .form-grid .admin-form__field > span:first-child, .form-grid .admin-form__field > legend { padding-top: 0; }
  .form-grid .admin-form__field > :not(:first-child), .form-grid .admin-form__static { grid-column: 1; padding-top: 0; }
  .form-grid .admin-form__field input[type="text"], .form-grid .admin-form__field input[type="password"], .form-grid .admin-form__field input[type="date"], .form-grid .admin-form__field select, .form-grid .admin-form__field textarea { max-width: none; }
  .form-grid .admin-form__actions { justify-content: stretch; }
  .form-grid .admin-form__actions .btn { flex: 1 1 auto; text-align: center; }
}
/* Список «название — значение — действия» (доставка, опасные действия). */
.setlist { max-width: 880px; background: var(--card-bg); border: 1px solid var(--border); border-radius: 14px; margin: 0 0 14px; padding: 2px 18px; box-sizing: border-box; }
.setlist__title { font-size: 15px; font-weight: 650; margin: 0; padding: 14px 0 8px; }
.setrow { display: flex; align-items: center; gap: 12px 16px; flex-wrap: wrap; padding: 10px 0; border-top: 1px solid var(--divider); }
.setlist__title + .setrow { border-top: 0; }
.setrow__main { flex: 1 1 260px; min-width: 0; }
.setrow__name { display: block; font-weight: 550; font-size: 14px; }
.setrow__val { display: block; font-size: 13px; color: var(--text-secondary); }
.setrow__act { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.setrow__act form { margin: 0; }
.set-note { max-width: 880px; font-size: 13px; margin: 0 0 12px; }
/* Меню с текстом в summary. */
.menu--text > summary { padding: 0 12px; font-size: 13px; min-height: 36px; white-space: nowrap; border-radius: 9px; }
.menu__item--danger { color: var(--sev-high); }
.menu__panel .menu__item[disabled] { opacity: .5; cursor: default; }
/* Таблицы настроек: поле выбора и числа. */
table.dt td.dt-field { width: 48%; }
table.dt td.dt-field select { width: 100%; max-width: 420px; }
table.dt td.dt-count { white-space: nowrap; font-variant-numeric: tabular-nums; width: 1%; text-align: right; }
table.dt td.dt-count a { font-weight: 600; }
.dt-zero { color: var(--text-secondary); }
table.dt col.c-num { width: 96px; }
table.dt col.c-rep { width: 150px; }
table.dt col.c-state { width: 130px; }
.dt-detail .form-grid { max-width: 760px; }
.dt-detail .setrow { border-top: 0; padding: 6px 0; }
.dt-detail .admin-notice, .dt-detail .admin-form__error { margin: 8px 0; }
.dt-detail__stack { display: flex; flex-direction: column; gap: 14px; padding-top: 10px; }
.dt-detail__stack > * { margin: 0; }
.dt-detail__line { font-size: 13px; color: var(--text-secondary); margin: 0; }
.dt-detail code.sa-email { overflow-wrap: anywhere; }
.save-row { display: flex; justify-content: flex-end; max-width: 880px; margin: 0 0 14px; }
/* Список разделов: название + одна строка, вся строка — ссылка. */
.navlist { list-style: none; margin: 0 0 18px; padding: 0; max-width: 880px; background: var(--card-bg); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; }
.navlist li + li { border-top: 1px solid var(--divider); }
.navlist__item { display: grid; grid-template-columns: 230px minmax(0, 1fr) auto; gap: 4px 16px; align-items: center; padding: 12px 16px; color: var(--text-main); text-decoration: none; }
.navlist__item:hover { background: #FBFBF8; }
.navlist__name { font-weight: 600; font-size: 14.5px; }
.navlist__what { font-size: 13px; color: var(--text-secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.navlist__go { color: var(--text-secondary); }
@media (max-width: 700px) {
  .navlist__item { grid-template-columns: minmax(0, 1fr) auto; }
  .navlist__what { grid-column: 1; white-space: normal; }
  .navlist__go { grid-row: 1; grid-column: 2; }
  .setlist { padding: 2px 14px; }
  table.dt td.dt-field { width: auto; grid-column: 1 / -1; }
  table.dt td.dt-count { text-align: left; width: auto; }
  table.dt td.dt-field select { max-width: none; }
}
/* Люди и агенты: статус-точка в таблице. */
.dt-who { display: flex; gap: 10px; align-items: center; min-width: 0; }
.dt-who .av { flex: none; }
.dt-dot { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; white-space: nowrap; }
.dt-sub--wrap { white-space: normal; }
.form-grid > .fsec__title:not(:first-child) { margin-top: 6px; border-top: 1px solid var(--divider); padding-top: 16px; }
.form-grid > input[type="hidden"] + .fsec__title { margin-top: 0; border-top: 0; padding-top: 14px; }
table.dt.dt--mid td { vertical-align: middle; }
.form-grid .admin-form__checks { display: flex; flex-wrap: wrap; gap: 4px 20px; padding-top: 8px; }
.form-grid .admin-form__checks .admin-form__check { padding-top: 0; margin: 0; }
.form-grid .admin-form__checks--col { flex-direction: column; }
table.dt td.dt-count a { text-decoration: none; }
table.dt td.dt-count a:hover { text-decoration: underline; }
.team-roster h2.pg-head__title { font-size: 22px; margin: 0; }
.form-grid .admin-form__field .admin-form__check { padding-top: 4px; }
.form-grid .admin-form__field > textarea + .admin-form__hint { margin-top: 2px; }
.only-sm { display: none; }
@media (max-width: 700px) { .only-sm { display: inline; } }
.setrow .admin-list { font-size: 13px; margin: 6px 0 0; padding-left: 18px; }
.setrow .admin-form__error, .setrow .admin-notice { margin: 2px 0 0; }

/* 24.11: служебные классы вместо встроенных стилей (CSP style-src 'self' их выбрасывает). */
.dt-toggle__body { min-width: 0; }
.u-mw980 { max-width: 980px; }
.u-mw880 { max-width: 880px; }
.u-mwnone { max-width: none; }
.u-m0 { margin: 0; }
.u-p0 { padding: 0; }
p.dt-empty.u-emptyleft { text-align: left; padding: 4px 0 14px; font-size: 14px; }

/* ==== 24.11 Рабочее место: панели-блоки, реестр «Задачи», «Сегодня» ==== */
.muted { color: var(--text-secondary); }
.pill--client { background: #F1EAFB; color: #6B3FA0; }

/* Панель — отдельный блок с полосой-заголовком: граница блока видна сразу. */
.board { display: grid; gap: 18px; margin-top: 18px; }
.panel { background: var(--card-bg); border: 1px solid var(--border-strong); border-radius: 14px; overflow: hidden; }
.panel--warn { border-left: 4px solid var(--sev-med); }
.panel--bad { border-left: 4px solid var(--sev-high); }
.panel__head { display: flex; align-items: center; gap: 12px; padding: 11px 16px; background: #F4F4EF; border-bottom: 1px solid var(--border); }
.panel__title { margin: 0; font-size: 15px; font-weight: 650; display: flex; align-items: center; gap: 8px; }
.panel__n { display: inline-flex; min-width: 24px; height: 22px; padding: 0 7px; align-items: center; justify-content: center; border-radius: 999px; background: var(--text-main); color: #fff; font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; }
.panel__more { margin-left: auto; font-size: 13px; color: var(--text-secondary); white-space: nowrap; }
.panel__more:hover { color: var(--text-main); }
.panel__lead { margin: 0; padding: 10px 16px 0; font-size: 13.5px; color: var(--sev-med); font-weight: 500; }
.panel__empty { margin: 0; padding: 16px; color: var(--text-secondary); font-size: 14px; }
.panel__raw { padding: 8px 16px 12px; }

/* Компактная таблица внутри панели. */
table.ptable { width: 100%; border-collapse: collapse; font-size: 14px; }
table.ptable td { padding: 10px 16px; border-top: 1px solid var(--divider); vertical-align: top; }
table.ptable tr:first-child td { border-top: 0; }
table.ptable tr:hover td { background: #FAFAF7; }
.ptable__client { width: 150px; color: var(--text-secondary); font-size: 13px; white-space: nowrap; }
.ptable__main a { font-weight: 550; text-decoration: none; color: var(--text-main); }
.ptable__main a:hover { text-decoration: underline; text-underline-offset: 3px; }
.ptable__sub { display: block; font-size: 12.5px; color: var(--text-secondary); margin-top: 2px; }
.ptable__state { width: 150px; }
.ptable__num { width: 90px; text-align: right; white-space: nowrap; }
.ptable__row--mine td { background: #FFF8EC; }
.idle { font-size: 13px; color: var(--text-secondary); font-variant-numeric: tabular-nums; }
.idle--stale { color: var(--sev-high); font-weight: 600; }

/* Вкладки статусов реестра. */
.stabs { display: flex; gap: 2px; overflow-x: auto; border-bottom: 1px solid var(--border-strong); margin: 0 0 12px; scrollbar-width: thin; }
.stab { display: inline-flex; align-items: center; gap: 6px; padding: 9px 12px; font-size: 14px; color: var(--text-secondary); text-decoration: none; white-space: nowrap; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.stab:hover { color: var(--text-main); }
.stab--on { color: var(--text-main); font-weight: 650; border-bottom-color: var(--text-main); }
.stab__n { font-size: 12px; font-variant-numeric: tabular-nums; color: var(--text-secondary); background: var(--divider); border-radius: 999px; padding: 1px 7px; }
.stab--on .stab__n { background: var(--text-main); color: #fff; }

/* Панель фильтров. */
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 10px 12px; background: var(--card-bg); border: 1px solid var(--border-strong); border-radius: 12px; margin: 0 0 12px; }
.toolbar select { min-height: 34px; font-size: 13.5px; }
.toolbar__check { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; color: var(--text-main); padding: 0 4px; }
.toolbar__search { flex: 1 1 200px; }
.toolbar__search input { width: 100%; min-height: 34px; font: inherit; font-size: 14px; padding: 0 10px; border: 1px solid var(--border-strong); border-radius: 9px; background: #fff; }

/* Реестр — таблица как в Google Таблицах: шапка прилипает, строки плотные. */
table.wtable { font-size: 13.5px; }
table.wtable thead th { position: sticky; top: 0; z-index: 2; }
table.wtable td { padding: 8px 12px; vertical-align: middle; }
table.wtable th { padding: 9px 12px; }
table.wtable tbody tr:hover td { background: #FAFAF7; }
table.wtable tr.wrow--stale td:first-child { box-shadow: inset 3px 0 0 var(--sev-high); }
table.wtable col.wc-client { width: 130px; }
table.wtable col.wc-state { width: 130px; }
table.wtable col.wc-who { width: 120px; }
table.wtable col.wc-week { width: 56px; }
table.wtable col.wc-idle { width: 100px; }
table.wtable col.wc-res { width: 190px; }
.wcol-client a { color: var(--text-secondary); text-decoration: none; }
.wcol-client a:hover { color: var(--text-main); text-decoration: underline; }
table.wtable .dt-title { font-weight: 550; text-decoration: none; color: var(--text-main); display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
table.wtable a.dt-title:hover { text-decoration: underline; text-underline-offset: 3px; }
.th-sort { color: inherit; text-decoration: none; }
.th-sort:hover, .th-sort--on { color: var(--text-main); }
.rlink { display: inline-block; font-size: 12.5px; padding: 1px 7px; margin: 1px 4px 1px 0; border: 1px solid var(--border-strong); border-radius: 6px; text-decoration: none; color: var(--text-main); background: #fff; }
.rlink:hover { border-color: var(--text-secondary); }
.work-foot { font-size: 12.5px; margin: -6px 0 0; }
@media (max-width: 700px) {
  table.wtable > tbody > tr { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; padding: 10px 14px; border-top: 1px solid var(--divider); }
  table.wtable > tbody > tr > td { padding: 0; border: 0; }
  table.wtable td.dt-main { grid-column: 1 / -1; order: -1; }
  .ptable__client { display: none; }
  .ptable__state { width: auto; }
  table.ptable td { padding: 9px 12px; }
}
.panel__raw > .ns-block > .ct-block__title { display: none; } .panel__raw > .ns-block { margin: 0; padding: 0; border: 0; background: none; box-shadow: none; }
table.wtable col.wc-client { width: 112px; }
table.wtable col.wc-state { width: 140px; }
table.wtable col.wc-who { width: 96px; }
table.wtable col.wc-week { width: 48px; }
table.wtable col.wc-idle { width: 92px; }
table.wtable col.wc-res { width: 150px; }
table.wtable .dt-title { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.stab { padding: 9px 10px; font-size: 13.5px; }
table.wtable { table-layout: fixed; }
table.wtable col.wc-who { width: 108px; }
table.wtable col.wc-res { width: 168px; }
table.wtable td { overflow: hidden; }
.wcol-res { white-space: nowrap; }
table.wtable .ai-pill { margin-left: 2px; }
@media (max-width: 700px) { table.wtable { table-layout: auto; } }
table.wtable col.wc-who { width: 100px; }
table.wtable col.wc-idle { width: 80px; }
table.wtable col.wc-res { width: 132px; }

/* 24.11 «Обзор клиента» панелями. */
.board--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
@media (max-width: 1000px) { .board--2 { grid-template-columns: 1fr; } }
.client-board .kpis { margin-top: 4px; }
.cb-health { display: flex; align-items: center; gap: 8px; margin: 4px 0 12px; font-size: 15px; font-weight: 600; }
.cb-health__week { margin-left: auto; font-size: 12.5px; font-weight: 400; color: var(--text-secondary); white-space: nowrap; }
.client-board > .panel { margin-top: 18px; }
.ptable__sev { width: 130px; }
.ptable__links { width: 120px; white-space: nowrap; }
.cb-dl { display: grid; grid-template-columns: 110px 1fr; gap: 8px 12px; margin: 0; padding: 14px 16px; font-size: 14px; }
.cb-dl dt { color: var(--text-secondary); }
.cb-dl dd { margin: 0; }
.panel__raw .ask-box { border: 0; padding: 0; box-shadow: none; background: none; margin: 0; }
.panel__raw .ask-box__title { display: none; }
.cb-foot { margin-top: 18px; }
.menu__panel--wide { min-width: 340px; }
.menu__form { display: flex; gap: 6px; padding: 2px 6px 6px; }
.menu__form input { flex: 1; min-height: 32px; font: inherit; font-size: 13.5px; padding: 0 8px; border: 1px solid var(--border-strong); border-radius: 8px; }
.panel__form { padding: 12px 16px 16px; margin: 0; background: none; border: 0; box-shadow: none; }
.pill--bad { background: var(--sev-high-bg); color: var(--sev-high); }
.panel__raw .ct-block { margin: 0; padding: 0; border: 0; background: none; box-shadow: none; }
.panel__raw .ct-block > .ct-block__title { display: none; }
.ns-panel .panel__raw { font-size: 14px; line-height: 1.5; }
.ns-panel + .ns-panel, .board > .ns-panel { margin: 0; }
.client-board ~ *, .board + .spr-wrap { margin-top: 18px; }
@media (max-width: 700px) {
  table.ptable tr { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; padding: 10px 12px; border-top: 1px solid var(--divider); }
  table.ptable tr:first-child { border-top: 0; }
  table.ptable td { padding: 0; border: 0; width: auto; }
  table.ptable td.ptable__main { grid-column: 1 / -1; }
  .ptable__sev { width: auto; }
  .kpis { grid-template-columns: 1fr 1fr; }
}
/* 24.11 карточка пункта плана: сводка сверху. */
.task-view .board { margin: 0 0 16px; }
.task-view__report { white-space: pre-line; font-size: 14.5px; line-height: 1.55; margin: 0 0 6px; overflow-wrap: anywhere; }
.task-view__when { font-size: 12.5px; margin: 0; }
.task-view .panel__raw { padding: 12px 16px 14px; }
.task-view .panel__raw p { margin: 0 0 6px; }
.tc-final { border: 1px solid var(--ok); background: var(--ok-bg); border-radius: 12px; padding: 10px 14px; margin: 0 0 12px; }
.tc-final__h { margin: 0 0 4px; font-weight: 650; font-size: 13px; color: var(--ok); }
.tc-final .md { font-size: 14px; overflow-wrap: anywhere; }
.tc-final__when { margin: 4px 0 0; font-size: 12px; }
/* 24.11 «Изменения на сайте»: форма сеткой «подпись — поле». */
.sc-form { max-width: 760px; display: grid; gap: 10px; }
.sc-form > label { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 12px; align-items: start; font-size: 14px; color: var(--text-secondary); }
.sc-form > label input:not([type="checkbox"]), .sc-form > label select, .sc-form > label textarea { width: 100%; font: inherit; font-size: 14px; color: var(--text-main); }
.sc-form > label:has(input[type="checkbox"]) { display: flex; gap: 8px; align-items: center; color: var(--text-main); }
.sc-form > .btn { justify-self: start; }
@media (max-width: 700px) { .sc-form > label { grid-template-columns: 1fr; gap: 4px; } }
/* 24.11 QA телефона: подписи кнопок не ломаются по слогам; «Спросить систему» — поле и кнопка друг под другом. */
.btn { white-space: nowrap; }
@media (max-width: 700px) {
  .ask-box__form { grid-template-columns: 1fr; }
  .ask-box__btn { width: 100%; }
}
.tb-mine { color: var(--sev-med); font-weight: 650; }
/* 24.11 «Обзор» клиента: динамика за 8 недель в плитках. */
.kpi--trend { min-width: 170px; }
.spark { display: block; margin-top: 6px; color: var(--text-secondary); }
.spark--up { color: var(--ok); }
.spark--down { color: var(--sev-high); }
.spark__cap { display: block; font-size: 11px; color: var(--text-secondary); }

/* 24.11 единая карточка работы: шаги план → агенты → результат. */
.work-card .breadcrumbs { margin-bottom: 6px; }
.wc-state { font-size: 14px; min-height: 28px; padding: 0 12px; }
.wc-summary .kpi { min-width: 220px; }
.wc-summary__v { display: block; font-size: 15px; font-weight: 550; margin-top: 4px; }
.wc-steps { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 14px; }
.wc-step { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 12px; align-items: start; }
.wc-step__mark { width: 30px; height: 30px; border-radius: 50%; background: var(--text-main); color: #fff; display: grid; place-items: center; font-weight: 650; font-size: 14px; margin-top: 8px; }
.wc-step__panel .panel__head { flex-wrap: wrap; }
.wc-step__when { font-size: 12.5px; }
.wc-step__panel .panel__raw { padding: 12px 16px 14px; font-size: 14px; }
.wc-step__panel .panel__raw p { margin: 0 0 6px; overflow-wrap: anywhere; }
.wc-report { border-left: 3px solid var(--ok); background: var(--ok-bg); border-radius: 8px; padding: 8px 12px; margin: 8px 0 4px; white-space: pre-line; }
.wc-report__h { font-size: 12px; font-weight: 650; color: var(--text-secondary); margin: 6px 0 2px !important; }
.wc-report .wc-report__h { color: var(--ok); margin-top: 0 !important; }
.wc-links { margin-top: 6px !important; }
.wc-ok { color: var(--ok); font-weight: 600; }
.wc-bad { color: var(--sev-high); font-weight: 600; }
.wc-history { margin: 0; padding-left: 18px; font-size: 13px; }
@media (max-width: 700px) { .wc-step { grid-template-columns: 1fr; } .wc-step__mark { display: none; } }

/* ==== 24.11: канбан-доска «Задачи» — правила только под kb-* и body.admin-ui (клиентские страницы /p/ не затронуты) ==== */
body.admin-ui { --bg: #EEF2F4; }
.kb { --kb-s0: #8a99ad; --kb-s1: #2f6fe4; --kb-s2: #7c4ddb; --kb-s3: #e39a12; --kb-s4: #0f9aa8; --kb-s5: #1f9d55;
  --kb-amber: #c27a00; --kb-amberbg: #fff4dc; --kb-red: #e5484d; --kb-blue: #2f6fe4; --kb-blue-bg: #e8f0ff; --kb-line: #e3e8ec; --kb-muted: #6b7280; }
.kb-slider, .kb-toast { --kb-s0: #8a99ad; --kb-s1: #2f6fe4; --kb-s2: #7c4ddb; --kb-s3: #e39a12; --kb-s4: #0f9aa8; --kb-s5: #1f9d55;
  --kb-amber: #c27a00; --kb-amberbg: #fff4dc; --kb-red: #e5484d; --kb-blue: #2f6fe4; --kb-blue-bg: #e8f0ff; --kb-line: #e3e8ec; --kb-muted: #6b7280; }
.kb-views { display: inline-flex; gap: 2px; background: #fff; border: 1px solid #e3e8ec; border-radius: 8px; padding: 2px; margin-right: 8px; }
.kb-view { padding: 5px 12px; border-radius: 6px; font-size: 13px; color: #5b6470; text-decoration: none; }
.kb-view--on { background: #1f2328; color: #fff; }
.kb-counters { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0 4px; }
.kb-cnt { display: inline-flex; align-items: center; gap: 6px; background: #fff; border: 1px solid var(--kb-line); border-radius: 999px; padding: 4px 12px 4px 5px; font-size: 13px; text-decoration: none; color: inherit; }
.kb-cnt b { min-width: 20px; height: 20px; border-radius: 10px; display: grid; place-items: center; color: #fff; font-size: 12px; padding: 0 6px; }
.kb-cnt--on { outline: 2px solid #1f2328; }
.kb-n--amber { background: #c27a00; } .kb-n--red { background: #e5484d; } .kb-n--violet { background: #7c4ddb; } .kb-n--green { background: #1f9d55; }
.kb-filters { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin: 8px 0 12px; }
.kb-lbl { color: var(--kb-muted); font-size: 12px; margin: 0 2px 0 8px; }
.kb-lbl:first-child { margin-left: 0; }
.kb-chip { border: 1px solid var(--kb-line); background: #fff; border-radius: 999px; padding: 3px 11px; font-size: 13px; text-decoration: none; color: inherit; }
.kb-chip--on { background: #1f2328; color: #fff; border-color: #1f2328; }
.kb-search { margin-left: auto; }
.kb-search input { border: 1px solid var(--kb-line); border-radius: 8px; padding: 5px 10px; font: inherit; font-size: 13px; background: #fff; }

.kb-board { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 16px; align-items: flex-start; }
.kb-col { flex: 1 1 0; min-width: 160px; display: flex; flex-direction: column; }
/* 24.11: доска на всю ширину — общий потолок .admin-main 1280px обрезал «Постпродакшен» */
body.admin-ui .admin-main:has(.kb-board) { max-width: none; }
.kb-chead { position: relative; height: 38px; color: #fff; display: flex; align-items: center; gap: 8px; padding: 0 22px 0 12px; font-weight: 600; font-size: 13px;
  clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 50%, calc(100% - 12px) 100%, 0 100%); border-radius: 6px 0 0 6px; }
.kb-num { flex: none; white-space: nowrap; background: rgba(255, 255, 255, .28); border-radius: 10px; padding: 0 7px; font-size: 12px; line-height: 20px; }
.kb-st-0 { background: #8a99ad; } .kb-st-1 { background: #2f6fe4; } .kb-st-2 { background: #7c4ddb; }
.kb-st-3 { background: #e39a12; } .kb-st-4 { background: #0f9aa8; } .kb-st-5 { background: #1f9d55; }
.kb-hint { font-size: 12px; color: var(--kb-muted); padding: 6px 4px 4px; min-height: 24px; }
.kb-cards { min-height: 80px; padding: 2px 2px 12px; border-radius: 8px; transition: background .15s; }
.kb-cards--over { background: rgba(47, 111, 228, .08); outline: 2px dashed #2f6fe4; }
.kb-empty { color: var(--kb-muted); font-size: 12px; text-align: center; margin: 12px 0; }
.kb-card { background: #fff; border-radius: 8px; padding: 10px 11px 9px; margin-bottom: 8px; box-shadow: 0 1px 2px rgba(16, 24, 40, .08); cursor: pointer; border-left: 3px solid transparent; transition: box-shadow .15s; }
.kb-card:hover { box-shadow: 0 4px 12px rgba(16, 24, 40, .14); }
.kb-card--dragging { opacity: .45; }
.kb-card--ask { border-left-color: #c27a00; }
.kb-card--stale { border-left-color: #e5484d; }
.kb-cl { font-size: 12px; color: var(--kb-muted); display: flex; align-items: center; }
.kb-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-right: 6px; flex: none; }
.kb-cl-0 { background: #2f5fd0; } .kb-cl-1 { background: #d97a00; } .kb-cl-2 { background: #1d7a46; } .kb-cl-3 { background: #c2338a; }
.kb-cl-4 { background: #0f9aa8; } .kb-cl-5 { background: #7c4ddb; } .kb-cl-6 { background: #8a6d1d; } .kb-cl-7 { background: #5b6470; }
.kb-t { display: block; font-weight: 600; margin: 3px 0 7px; line-height: 1.3; font-size: 14px; color: inherit; text-decoration: none; overflow-wrap: anywhere; }
.kb-askline { font-size: 12px; background: #fff4dc; color: #8a5600; border-radius: 6px; padding: 4px 7px; margin-bottom: 7px; font-weight: 600; }
.kb-note { font-size: 11.5px; color: var(--kb-muted); margin: -3px 0 7px; }
.kb-meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.kb-dl { font-size: 11px; border-radius: 10px; padding: 1px 8px; font-weight: 600; background: #e0f6f8; color: #0b7380; }
.kb-dl--stale { background: #e5484d; color: #fff; }
.kb-ic { font-size: 12px; color: var(--kb-muted); display: inline-flex; align-items: center; gap: 3px; text-decoration: none; }
.kb-ic svg { width: 14px; height: 14px; }
.kb-ic--doc { color: #2f6fe4; } .kb-ic--dir { color: #d99a00; } .kb-ic--site { color: #1f9d55; }
.kb-who { margin-left: auto; display: flex; }
.kb-av { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 700; color: #fff; background: #7c4ddb; flex: none; }
.kb-av--ai { background: #111; color: #d8f55a; }
.kb-av--none { background: #cbd2d9; }
.kb-av svg { width: 14px; height: 14px; }
.kb-foot { color: var(--kb-muted); font-size: 13px; margin: 4px 0 0; }

.kb-shade { position: fixed; inset: 0; background: rgba(15, 23, 42, .45); opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 1000; }
.kb-shade--on { opacity: 1; pointer-events: auto; }
.kb-slider { position: fixed; top: 0; right: 0; bottom: 0; width: min(1180px, 94vw); background: var(--bg); z-index: 1001; transform: translateX(102%); visibility: hidden; transition: transform .25s ease, visibility .25s; display: flex; flex-direction: column; }
.kb-slider--on { transform: none; visibility: visible; }
.kb-sclose { position: absolute; left: -44px; top: 14px; width: 34px; height: 34px; border-radius: 50%; border: 0; background: #fff; cursor: pointer; font-size: 18px; }
.kb-sbody { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.kb-panel { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.kb-shd { background: #fff; padding: 14px 20px 0; border-bottom: 1px solid var(--kb-line); }
.kb-shd h2 { margin: 2px 0 10px; font-size: 20px; }
.kb-steps { display: flex; gap: 3px; margin: 0 0 12px; padding: 0; list-style: none; }
.kb-step { flex: 1; font-size: 11px; padding: 6px 8px 6px 14px; background: #eef0f2 !important; color: #5b6470; clip-path: polygon(0 0, calc(100% - 8px) 0, 100% 50%, calc(100% - 8px) 100%, 0 100%, 8px 50%); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kb-step:first-child { clip-path: polygon(0 0, calc(100% - 8px) 0, 100% 50%, calc(100% - 8px) 100%, 0 100%); padding-left: 10px; }
.kb-step--done, .kb-step--cur { color: #fff; }
.kb-step--done.kb-st-0, .kb-step--cur.kb-st-0 { background: #8a99ad !important; } .kb-step--done.kb-st-1, .kb-step--cur.kb-st-1 { background: #2f6fe4 !important; }
.kb-step--done.kb-st-2, .kb-step--cur.kb-st-2 { background: #7c4ddb !important; } .kb-step--done.kb-st-3, .kb-step--cur.kb-st-3 { background: #e39a12 !important; }
.kb-step--done.kb-st-4, .kb-step--cur.kb-st-4 { background: #0f9aa8 !important; } .kb-step--done.kb-st-5, .kb-step--cur.kb-st-5 { background: #1f9d55 !important; }
.kb-step--done { opacity: .55; } .kb-step--cur { font-weight: 700; }
.kb-actions { display: flex; gap: 8px; flex-wrap: wrap; padding-bottom: 12px; align-items: flex-start; }
.kb-act { display: flex; gap: 6px; margin: 0; }
.kb-act--inline { flex-wrap: wrap; }
.kb-in { border: 1px solid var(--kb-line); border-radius: 8px; padding: 5px 9px; font: inherit; font-size: 13px; min-width: 200px; background: #fff; }
.kb-btn { border: 1px solid var(--kb-line); border-radius: 8px; padding: 5px 12px; cursor: pointer; font: inherit; font-size: 13px; font-weight: 600; background: #fff; color: inherit; text-decoration: none; display: inline-flex; align-items: center; }
.kb-btn--blue { background: #2f6fe4; color: #fff; border-color: #2f6fe4; }
.kb-btn--ghost:hover { border-color: #b9c2cb; }
.kb-pbody { flex: 1; display: flex; min-height: 0; }
.kb-left { flex: 1 1 55%; overflow: auto; padding: 16px 18px 40px; min-width: 0; }
.kb-right { flex: 1 1 45%; display: flex; flex-direction: column; background: #fff; min-width: 300px; border-left: 1px solid var(--kb-line); }
.kb-blk { background: #fff; border: 1px solid var(--kb-line); border-radius: 10px; padding: 12px 14px; margin-bottom: 12px; }
.kb-blk h4 { margin: 0 0 8px; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--kb-muted); }
.kb-desc p { margin: 0 0 6px; font-size: 13px; overflow-wrap: anywhere; }
.kb-muted { color: var(--kb-muted); font-size: 12px; }
.kb-people { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 16px; }
.kb-person { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.kb-person small { display: block; color: var(--kb-muted); font-size: 11px; }
.kb-chk { list-style: none; padding: 0; margin: 0; }
.kb-chk li { display: flex; gap: 8px; align-items: center; padding: 4px 0; font-size: 13px; }
.kb-chk small { margin-left: auto; color: var(--kb-muted); font-size: 11px; }
.kb-bx { width: 16px; height: 16px; border-radius: 4px; border: 1.5px solid #b9c2cb; display: grid; place-items: center; flex: none; font-size: 11px; color: #fff; }
.kb-chk--ok .kb-bx { background: #1f9d55; border-color: #1f9d55; }
.kb-chk--ok span:nth-child(2) { color: var(--kb-muted); text-decoration: line-through; }
.kb-chk--now .kb-bx { border-color: #2f6fe4; background: #e8f0ff; }
.kb-main-doc { display: flex; align-items: center; gap: 10px; border: 1.5px solid #2f6fe4; background: #e8f0ff; border-radius: 10px; padding: 10px 12px; margin-bottom: 10px; }
.kb-main-doc > div { flex: 1; font-size: 13px; }
.kb-files { display: flex; gap: 8px; flex-wrap: wrap; }
.kb-file { display: flex; align-items: center; gap: 8px; border: 1px solid var(--kb-line); border-radius: 8px; padding: 7px 10px; text-decoration: none; font-size: 13px; color: inherit; }
.kb-fi { width: 22px; height: 22px; border-radius: 6px; flex: none; display: inline-block; }
.kb-fi--doc { background: #2f6fe4; } .kb-fi--dir { background: #e8a400; } .kb-fi--site { background: #1f9d55; }
.kb-hist { margin: 0; padding-left: 18px; font-size: 13px; }
.kb-links { font-size: 13px; }

.kb-chathd { padding: 12px 16px; border-bottom: 1px solid var(--kb-line); display: flex; align-items: center; gap: 8px; }
.kb-chathd small { color: var(--kb-muted); }
.kb-pin { display: block; font-size: 12px; background: #fff4dc; border-bottom: 1px solid #f1dcae; padding: 6px 16px; color: #8a5600; text-decoration: none; }
.kb-msgs { flex: 1; overflow: auto; padding: 14px 16px; background: #f6f8fa; }
.kb-sys { text-align: center; font-size: 12px; color: var(--kb-muted); margin: 10px 0; }
.kb-sys span { background: #e9edf1; border-radius: 10px; padding: 2px 10px; display: inline-block; }
.kb-msg { display: flex; gap: 8px; margin: 10px 0; align-items: flex-end; }
.kb-msg--me { flex-direction: row-reverse; }
.kb-bub { background: #fff; border-radius: 12px 12px 12px 4px; padding: 8px 11px; max-width: 82%; box-shadow: 0 1px 1px rgba(0, 0, 0, .05); font-size: 13px; min-width: 0; }
.kb-msg--me .kb-bub { background: #dff3cf; border-radius: 12px 12px 4px 12px; }
.kb-bub--q, .kb-msg--me .kb-bub--q { border: 1.5px solid #c27a00; background: #fff4dc; }
.kb-nm { font-size: 11px; font-weight: 700; color: #2f6fe4; margin-bottom: 2px; }
.kb-bub--q .kb-nm { color: #8a5600; }
.kb-msg--me .kb-nm { color: #2f7a12; }
.kb-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.kb-tm { font-size: 10px; color: var(--kb-muted); text-align: right; margin-top: 3px; }
.kb-compose { border-top: 1px solid var(--kb-line); padding: 10px 12px; display: flex; gap: 8px; align-items: flex-end; }
.kb-compose textarea { flex: 1; border: 1px solid var(--kb-line); border-radius: 10px; padding: 8px 10px; font: inherit; font-size: 13px; resize: none; }
.kb-compose-off { border-top: 1px solid var(--kb-line); padding: 12px 16px; margin: 0; color: var(--kb-muted); font-size: 13px; }
.kb-toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(120px); background: #1f2328; color: #fff; border-radius: 10px; padding: 10px 16px; font-size: 13px; transition: transform .25s; z-index: 1100; max-width: 90vw; }
.kb-toast--on { transform: translateX(-50%); }
@media (max-width: 760px) {
  .kb-slider { width: 100vw; }
  .kb-sclose { left: auto; right: 10px; top: 10px; z-index: 2; }
  .kb-panel { overflow: auto; }
  .kb-pbody { flex-direction: column; flex: none; }
  .kb-right { min-height: 70vh; border-left: 0; }
  .kb-people { grid-template-columns: 1fr; }
  .kb-col { flex: 0 0 260px; }
  .kb-search { margin-left: 0; }
}
/* 24.11: заголовки столбцов доски на ноутбуках — без разрыва слов, высота по тексту */
.kb-chead { overflow-wrap: normal; word-break: normal; hyphens: none; }
@media (max-width: 1500px) { .kb-chead { font-size: 12px; gap: 6px; padding: 4px 16px 4px 10px; line-height: 1.15; height: auto; min-height: 42px; } }
/* 24.11: окно «Почему возвращаем работу?» на доске */
.kb-modal { position: fixed; inset: 0; z-index: 60; background: rgba(15, 23, 42, .45); display: grid; place-items: center; padding: 16px; }
.kb-modal__box { background: #fff; border-radius: 14px; padding: 18px 20px; width: min(460px, 100%); box-shadow: 0 20px 50px rgba(15, 23, 42, .25); }
.kb-modal__box h3 { margin: 0 0 4px; font-size: 17px; }
.kb-modal__t { margin: 0 0 10px; color: var(--text-secondary); font-size: 13px; }
.kb-modal__in { width: 100%; border: 1px solid var(--border-strong); border-radius: 10px; padding: 8px 10px; font: inherit; resize: vertical; }
.kb-modal__err { color: #c0392b; font-size: 13px; margin: 6px 0 0; }
.kb-modal__act { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }

/* ==== 24.11: CRM-оболочка админки (макет BKR_crm_v1) — только body.admin-ui / crm-*, клиентские страницы /p/ и PDF не затронуты ==== */
.crm-ic { width: 18px; height: 18px; flex: none; }
.crm-top { gap: 12px; }
.crm-top__actions { margin-left: auto; gap: 10px; }
.crm-burger { display: none; background: none; border: 0; color: var(--text-main-dark); padding: 6px; border-radius: 8px; cursor: pointer; }
.crm-burger:hover { background: #363932; }
.crm-search { flex: 1 1 auto; max-width: 560px; display: flex; align-items: center; gap: 8px; background: #33362f; border: 1px solid var(--line-dark); border-radius: 10px; padding: 0 10px; color: #B6BBAE; min-width: 0; }
.crm-search:focus-within { border-color: var(--accent); }
.crm-search__in { flex: 1; min-width: 0; border: 0; background: none; outline: 0; font: inherit; font-size: 14px; color: var(--text-main-dark); padding: 9px 0; }
.crm-search__in::placeholder { color: #9DA394; }
.crm-search__icon { display: none; }
.crm-search__go { background: none; border: 0; color: inherit; padding: 4px; cursor: pointer; display: inline-flex; border-radius: 6px; }
.crm-search__go:hover { color: var(--accent); }
.crm-search .crm-ic { width: 16px; height: 16px; }
.crm-create, .crm-bell { position: relative; }
.crm-create > summary, .crm-bell > summary { list-style: none; cursor: pointer; }
.crm-create > summary::-webkit-details-marker, .crm-bell > summary::-webkit-details-marker { display: none; }
.crm-create__btn { display: inline-flex; align-items: center; gap: 6px; background: var(--accent); color: var(--text-main); font-weight: 650; font-size: 14px; border-radius: 10px; padding: 8px 14px; white-space: nowrap; }
.crm-create__btn:hover { filter: brightness(.95); }
.crm-bell__btn { position: relative; width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line-dark); display: grid; place-items: center; color: var(--text-main-dark); }
.crm-bell__btn:hover { background: #363932; }
.crm-bell__n { position: absolute; top: -4px; right: -4px; background: var(--worse); color: #fff; font-style: normal; font-size: 11px; font-weight: 700; border-radius: 9px; min-width: 18px; padding: 0 5px; line-height: 18px; text-align: center; }
.crm-create > summary:focus-visible, .crm-bell > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.crm-pop { display: none; position: absolute; right: 0; top: 46px; z-index: 50; background: #fff; color: var(--text-main); border: 1px solid #e3e8ec; border-radius: 12px; box-shadow: 0 10px 30px rgba(0, 0, 0, .18); padding: 6px; width: 290px; max-width: calc(100vw - 24px); }
.crm-create[open] > .crm-pop, .crm-bell[open] > .crm-pop { display: block; }
.crm-pop--bell { width: 340px; }
.crm-pop__item { display: flex; gap: 10px; align-items: flex-start; padding: 8px 10px; border-radius: 8px; text-decoration: none; color: inherit; font-size: 14px; }
.crm-pop__item:hover { background: #eef2f4; }
.crm-pop__item small { display: block; color: #6b7280; font-size: 12px; }
.crm-pop__item .crm-ic { margin-top: 2px; color: #5b6470; }
.crm-pop__head { margin: 4px 10px 4px; font-size: 12px; color: #6b7280; text-transform: uppercase; letter-spacing: .05em; }
.crm-pop__empty { margin: 8px 10px; color: #6b7280; font-size: 13px; }
.crm-pop__all { display: block; text-align: center; padding: 8px; margin-top: 4px; border-top: 1px solid #e3e8ec; font-size: 13px; color: #1c4fb0; text-decoration: none; }
.crm-menu-shade { display: none; }
/* Меню: иконка, подпись, счётчик справа */

.admin-sidebar a > .crm-ic { opacity: .85; }
.admin-sidebar a[aria-current="page"] > .crm-ic { opacity: 1; }
.admin-sidebar__badge--new { background: #1f9d55; }
.admin-sidebar .side-more > summary { justify-content: space-between; }
.admin-sidebar .side-more a { font-size: 14px; }
.crm-me { display: flex; align-items: center; gap: 10px; margin-top: 14px; padding: 12px 10px 4px; border-top: 1px solid var(--line-dark); color: #E6E8E1; }
.crm-me__av { width: 32px; height: 32px; border-radius: 50%; background: var(--accent); color: var(--text-main); display: grid; place-items: center; font-weight: 700; flex: none; }
.crm-me__who { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; flex: 1; font-size: 13px; }
.crm-me__who small { color: #9DA394; }
.crm-me__who b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crm-me form { margin: 0; }
.crm-me__out { font-size: 13px; padding: 6px 10px; }
/* Страница поиска */
.crm-found__form { display: flex; gap: 8px; margin: 0 0 16px; max-width: 560px; }
.crm-found__form input { flex: 1; min-width: 0; border: 1px solid var(--border-strong); border-radius: 10px; padding: 9px 12px; font: inherit; background: #fff; }
.crm-found { margin-bottom: 14px; }
@media (max-width: 899px) {
  .crm-search { max-width: none; }
  .crm-create__btn span { display: none; }
  .crm-create__btn { padding: 8px 10px; }
  .crm-top .logo__text { display: none; }
  /* С JS: меню прячется под бургер, поиск — в иконку. Без JS остаётся прокручиваемая лента. */
  html.js .crm-burger { display: inline-flex; }
  html.js .admin-sidebar-wrap { display: none; }
  html.js .crm-search { flex: 0 0 auto; background: none; border-color: transparent; padding: 0; }
  html.js .crm-search__in, html.js .crm-search__go { display: none; }
  html.js .crm-search__icon { display: inline-flex; background: none; border: 0; color: var(--text-main-dark); padding: 8px; border-radius: 8px; cursor: pointer; }
  html.js .crm-search--open { position: absolute; left: 0; right: 0; top: 0; z-index: 40; height: 100%; max-width: none; background: #20211F; padding: 0 12px; border-color: transparent; border-radius: 0; }
  html.js .crm-search--open .crm-search__in, html.js .crm-search--open .crm-search__go { display: inline-flex; }
  html.js .crm-search--open .crm-search__in { display: block; }
  html.js .crm-search--open .crm-search__icon { display: none; }
  html.js .crm-top { position: relative; }
  html.js body.crm-menu-open .admin-sidebar-wrap { display: block; position: fixed; z-index: 70; top: 0; left: 0; bottom: 0; width: min(300px, 86vw); overflow-y: auto; box-shadow: 0 0 40px rgba(0, 0, 0, .4); }
  html.js body.crm-menu-open .admin-sidebar-wrap::after { display: none; }
  html.js body.crm-menu-open .crm-menu-shade { display: block; position: fixed; inset: 0; z-index: 60; background: rgba(15, 23, 42, .5); }
  html.js body.crm-menu-open .admin-sidebar { flex-direction: column; align-items: stretch; overflow: visible; -webkit-mask-image: none; mask-image: none; padding: 14px 10px 24px; border: 0; }
  html.js body.crm-menu-open .admin-sidebar a { justify-content: flex-start; margin-right: 0; }
  html.js body.crm-menu-open .admin-sidebar .side-sep { width: auto; height: 1px; margin: 10px 6px; }
  html.js body.crm-menu-open .admin-sidebar .side-title { display: block; font-size: 12px; color: #9DA394; padding: 4px 12px; text-transform: uppercase; letter-spacing: .06em; }
  html.js body.crm-menu-open .admin-sidebar .side-more, html.js body.crm-menu-open .admin-sidebar .side-more[open] { display: block; }
  html.js body.crm-menu-open .admin-sidebar .side-more[open] > summary { display: flex; }
  html.js body.crm-menu-open .admin-sidebar .side-more a { padding-left: 22px; display: flex; }
  html.js body.crm-menu-open .admin-sidebar .side-client { padding-left: 22px; max-width: none; }
  html.js body.crm-menu-open { overflow: hidden; }
}

/* ==== 24.11: «Сегодня» по макету CRM — только crm-* (чат, план, события) ==== */
.crm-today { --kb-line: #e3e8ec; --kb-muted: #6b7280; }
.crm-counters { margin: 4px 0 14px; }
.crm-today__grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 14px; align-items: start; margin-bottom: 14px; }
.crm-today__right > .panel, .crm-today__right > .crm-more { margin-bottom: 14px; }
@media (max-width: 1100px) { .crm-today__grid { grid-template-columns: minmax(0, 1fr); } .crm-chat { min-height: 0; } .crm-chat__msgs { min-height: 140px; } }
.crm-chat { background: #fff; border: 1px solid #e3e8ec; border-radius: 12px; display: flex; flex-direction: column; min-height: 520px; overflow: hidden; }
.crm-chat__hd { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid #e3e8ec; }
.crm-chat__hd h3 { margin: 0; font-size: 15px; }
.crm-chat__hd small { color: #6b7280; font-size: 12px; }
.crm-chat__av { width: 28px; height: 28px; border-radius: 50%; background: #111; color: #d8f55a; display: grid; place-items: center; flex: none; }
.crm-chat__av .crm-ic { width: 16px; height: 16px; }
.crm-chat__msgs { flex: 1; padding: 14px 16px; background: #f6f8fa; overflow-y: auto; max-height: 520px; display: flex; flex-direction: column; gap: 6px; }
.crm-chat__empty { color: #6b7280; font-size: 13.5px; margin: auto; text-align: center; max-width: 36ch; }
.crm-chat .ask-box__result { display: flex; flex-direction: column; gap: 6px; }
.crm-chat .ask-box__q { align-self: flex-end; margin: 0; background: #dff3cf; border-radius: 12px 12px 4px 12px; padding: 9px 12px; max-width: 86%; font-weight: 400; font-size: 13.5px; overflow-wrap: anywhere; }
.crm-chat .ask-box__answer { align-self: flex-start; background: #fff; border-radius: 12px 12px 12px 4px; padding: 9px 12px; max-width: 92%; font-size: 13.5px; box-shadow: 0 1px 1px rgba(0, 0, 0, .05); overflow-wrap: anywhere; }
.crm-chat .ask-box__meta { align-self: flex-start; margin: 0 0 8px 4px; font-size: 11px; }
.crm-chat__form { border-top: 1px solid #e3e8ec; padding: 10px 16px 14px; position: relative; }
.crm-chat__chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.crm-chat__chip { border: 1px solid #e3e8ec; background: #fff; border-radius: 999px; padding: 4px 11px; font: inherit; font-size: 12.5px; cursor: pointer; color: inherit; }
.crm-chat__chip:hover { border-color: #b9c2cb; }
.crm-chat__compose { display: flex; gap: 8px; align-items: flex-end; }
.crm-chat__in { flex: 1; min-width: 0; border: 1px solid #e3e8ec; border-radius: 10px; padding: 9px 11px; font: inherit; font-size: 14px; resize: none; height: 44px; }
.crm-chat__wait { display: none; position: absolute; right: 16px; top: -22px; font-size: 12px; color: #6b7280; }
.crm-chat__wait.htmx-request { display: inline; }
.crm-plan { display: flex; flex-direction: column; }
.crm-plan__row { display: flex; gap: 10px; align-items: center; padding: 9px 16px; border-top: 1px solid #e3e8ec; text-decoration: none; color: inherit; }
.crm-plan__row:first-child { border-top: 0; }
.crm-plan__row:hover .crm-plan__tt { color: #2f6fe4; }
.crm-plan__ic { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; flex: none; color: #fff; }
.crm-plan__ic .crm-ic { width: 15px; height: 15px; }
.crm-plan__ic--amber { background: #c27a00; } .crm-plan__ic--red { background: #e5484d; } .crm-plan__ic--violet { background: #7c4ddb; } .crm-plan__ic--blue { background: #2f6fe4; }
.crm-plan__txt { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.crm-plan__tt { font-weight: 600; font-size: 13.5px; overflow-wrap: anywhere; }
.crm-plan__mm { font-size: 12px; color: #6b7280; display: flex; align-items: center; }
.crm-plan__act { flex: none; font-size: 12px; font-weight: 600; border-radius: 999px; padding: 2px 10px; white-space: nowrap; }
.crm-plan__act--amber { background: #fff4dc; color: #8a5600; } .crm-plan__act--red { background: #fdecec; color: #b42318; } .crm-plan__act--violet { background: #f1eaff; color: #5a35b0; } .crm-plan__act--blue { background: #e8f0ff; color: #1c4fb0; }
.crm-plan__sub { border-top: 1px solid #e3e8ec; margin-top: 8px; padding: 8px 16px 4px; }
.crm-plan__subh { margin: 0 0 6px; font-size: 13px; color: #5b6470; }
.crm-more { background: #fff; border: 1px solid #e3e8ec; border-radius: 12px; padding: 10px 16px; }
.crm-more > summary { cursor: pointer; font-weight: 600; font-size: 14px; }
.crm-ev { display: flex; gap: 10px; align-items: flex-start; padding: 7px 16px; border-top: 1px solid #e3e8ec; font-size: 13px; }
.crm-ev:first-of-type { border-top: 0; }
.crm-ev__ic { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; flex: none; color: #fff; }
.crm-ev__ic .crm-ic { width: 14px; height: 14px; }
.crm-ev__ic--green { background: #1f9d55; } .crm-ev__ic--blue { background: #2f6fe4; } .crm-ev__ic--red { background: #e5484d; } .crm-ev__ic--dark { background: #111; color: #d8f55a; } .crm-ev__ic--violet { background: #7c4ddb; }
.crm-ev__t { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.crm-ev__t a { color: inherit; text-decoration: none; }
.crm-ev__t a:hover { text-decoration: underline; }
.crm-ev__tm { color: #6b7280; font-size: 12px; white-space: nowrap; }
/* Меню CRM: иконка и подпись слева, счётчик справа */
body.admin-ui .admin-sidebar a, body.admin-ui .admin-sidebar .side-more > summary { justify-content: flex-start; }
body.admin-ui .admin-sidebar a .admin-sidebar__badge { margin-left: auto; }
body.admin-ui .admin-sidebar .admin-sidebar__badge + .admin-sidebar__badge { margin-left: 4px; }
.crm-plan__sub .panel__raw { padding: 0; }
