.report-employees-table th {
  text-align: left;
}

.report-close-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 17px;
  border-radius: 999px;
  padding: 0 8px;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
}

.report-close-badge.is-auto {
  color: #8a1e1e;
  background: #f9d9d9;
}

.report-close-badge.is-manual {
  color: #185f2b;
  background: #d6f0dd;
}

.report-close-badge.is-master {
  color: #7a5a09;
  background: #faebbf;
}

.report-emp-gear-col {
  width: 36px;
  min-width: 36px;
  text-align: center;
  position: relative;
}

.report-emp-gear-cell {
  width: 36px;
  min-width: 36px;
  background: #f4f7fb;
}

.report-emp-gear-wrap {
  position: relative;
  display: inline-flex;
}

.column-gear-btn {
  min-width: 30px;
  height: 18px;
  border: 1px solid #82a8cb;
  border-radius: 6px;
  background: linear-gradient(180deg, #f8fbff, #e8eff8);
  color: #2a5f8c;
  font-size: 11px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  cursor: pointer;
  padding: 0 5px;
}

.column-gear-icon {
  font-size: 11px;
  line-height: 1;
}

.column-gear-caret {
  font-size: 8px;
  line-height: 1;
  margin-top: 1px;
}

.report-acc-gear-wrap {
  position: relative;
  display: inline-flex;
}

.report-emp-gear-btn {
  width: 30px;
}

.report-acc-gear-btn {
  width: 30px;
}

.report-acc-gear-col {
  width: 36px;
  min-width: 36px;
  text-align: center;
}

.report-acc-gear-cell {
  width: 36px;
  min-width: 36px;
  background: #f4f7fb;
}

.report-acc-col-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  width: 220px;
  max-height: 350px;
  overflow: auto;
  padding: 10px 10px 8px;
  border: 1px solid #b8c7d8;
  border-radius: 10px;
  background: #f5f8fc;
  box-shadow: 0 12px 24px rgba(18, 34, 56, 0.25);
  display: none;
  z-index: 30;
}

.report-acc-col-menu.open {
  display: block;
}

.is-col-hidden {
  display: none !important;
}

.report-emp-col-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  width: 220px;
  max-height: 350px;
  overflow: auto;
  padding: 10px 10px 8px;
  border: 1px solid #b8c7d8;
  border-radius: 10px;
  background: #f5f8fc;
  box-shadow: 0 12px 24px rgba(18, 34, 56, 0.25);
  display: none;
  z-index: 30;
}

.report-emp-col-menu.open {
  display: block;
}

.report-emp-col-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 11px;
  font-weight: 400;
  line-height: 1.2;
  color: #23384f;
  padding: 3px 2px;
}

.accounting-sheet {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.accounting-table-wrap {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
}

.report-accounting-toolbar,
.plan-toolbar:has(.plan-filter-wrap),
.plan-toolbar:has(.fact-filter-wrap),
.plan-toolbar:has(.startstop-filter-wrap),
.plan-toolbar:has(.archive-filter-wrap),
.plan-toolbar:has(.brigade-filter-wrap) {
  align-items: flex-start;
}

.report-accounting-filter-wrap,
.plan-filter-wrap,
.fact-filter-wrap,
.startstop-filter-wrap,
.archive-filter-wrap,
.brigade-filter-wrap {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  flex: 1 1 auto;
  min-width: 0;
}

.report-accounting-filter-wrap > #reportAccountingFilterBtn,
.plan-filter-wrap > #planFilterBtn,
.fact-filter-wrap > #factFilterBtn,
.startstop-filter-wrap > #startStopFilterBtn,
.archive-filter-wrap > #archiveFilterBtn,
.brigade-filter-wrap > #brigadeFilterBtn {
  flex: 0 0 auto;
  min-width: 118px;
}

.report-accounting-filters,
.plan-filters,
.fact-filters,
.startstop-filters,
.archive-filters,
.brigade-filters {
  min-width: 0;
  width: clamp(760px, 62vw, 980px);
  max-width: 980px;
  flex: 1 1 auto;
  border: 1px solid #7ea2c4;
  border-radius: 10px;
  background: linear-gradient(180deg, #f6f9fd, #edf3fa);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45);
  padding: 10px;
  display: none;
}

.report-accounting-filters.open,
.plan-filters.open,
.fact-filters.open,
.startstop-filters.open,
.archive-filters.open,
.brigade-filters.open {
  display: grid;
  gap: 8px;
}

.report-acc-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
}

.report-acc-left {
  display: grid;
  gap: 8px;
}

.report-acc-filter-row.is-period {
  display: grid;
  grid-template-columns: auto auto auto;
  gap: 8px;
  align-items: center;
}

.report-acc-quick-group {
  display: inline-flex;
  gap: 6px;
  flex-wrap: wrap;
}

.report-acc-quick {
  min-height: 24px;
  border: 1px solid #a8bfd9;
  border-radius: 999px;
  background: #f1f6fc;
  color: #2e537c;
  font-size: 10px;
  font-weight: 700;
  text-transform: lowercase;
  padding: 0 9px;
  cursor: pointer;
}

.report-acc-quick.is-active {
  border-color: #6b97c9;
  background: #dbe9f9;
}

.report-acc-date {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  color: #2a4768;
  font-weight: 700;
}

.report-acc-date input,
.report-acc-filter-grid select {
  min-height: 24px;
  border: 1px solid #b6c9df;
  border-radius: 7px;
  background: #ffffff;
  color: #1d3553;
  font-size: 10px;
  padding: 0 8px;
}

.report-acc-filter-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

/* Справочник операций: 5 фильтров в один ряд — ширину панели не меняем, блоки чуть уже */
.archive-filters .report-acc-filter-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.report-acc-filter-grid label {
  display: grid;
  gap: 4px;
}

.report-acc-filter-grid label > span {
  color: #2a4768;
  font-size: 10px;
  font-weight: 700;
}

/* План/Факт: фильтр на 6 блоков (4 + 2 внизу). Блоки делаем компактнее,
   чтобы вторая строка почти не увеличивала высоту выпадашки. Ширина не меняется.
   Скоуп только plan/fact — у остальных вкладок по 4 блока в одну строку. */
.plan-filters .report-acc-filter-grid,
.fact-filters .report-acc-filter-grid {
  gap: 6px 8px;
}

.plan-filters .report-acc-filter-grid label,
.fact-filters .report-acc-filter-grid label {
  gap: 2px;
}

.plan-filters .report-acc-filter-grid select,
.fact-filters .report-acc-filter-grid select {
  min-height: 22px;
}

.report-acc-filter-actions {
  display: inline-flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: stretch;
  gap: 8px;
}

.report-acc-filter-actions .plan-btn {
  min-width: 96px;
}

/* Найти — зелёный (теперь внутри grid) */
.report-acc-btn-grid #reportAccountingFilterApply {
  border-color: rgba(96, 201, 128, 0.68);
  background: rgba(50, 146, 84, 0.72);
  color: #f1fff7;
}

/* «Найти» в фильтрах-справочниках (операции/бригады/номенклатура/старт-стоп) —
   яркий зелёный, как в Бухгалтерии: иначе кнопка тусклая и неясно, активен ли фильтр */
.report-acc-filter-actions .plan-btn.green {
  border-color: rgba(96, 201, 128, 0.68);
  background: rgba(50, 146, 84, 0.72);
  color: #f1fff7;
}

/* Очистить — серо-голубой, достаточно видимый */
.report-acc-filter-actions .plan-btn.blue {
  border-color: rgba(110, 145, 185, 0.65);
  background: rgba(42, 68, 108, 0.58);
  color: #c4dcf2;
}

.report-acc-filter-actions .plan-btn.red {
  border-color: rgba(221, 172, 196, 0.66);
  background: rgba(134, 82, 109, 0.65);
  color: #fff2f8;
}

/* Кнопки 2×2: [Найти][Печать▾] / [Очистить][Экспорт1С] */
.report-acc-btn-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  align-items: stretch;
}

.report-acc-btn-grid .plan-btn {
  width: 100%;
  min-width: 0;
}

/* Print dropdown button */
.report-acc-print-wrap {
  position: relative;
}

/* Печать — тёплый оранжевый */
.report-acc-print-btn {
  width: 100%;
  min-width: 74px;
  border-color: rgba(255, 138, 31, 0.48);
  background: rgba(155, 75, 12, 0.70);
  color: #ffe8cc;
}

.report-acc-print-btn:hover:not(:disabled) {
  background: rgba(175, 90, 18, 0.82);
}

.report-acc-print-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  pointer-events: none;
}

/* Экспорт 1С — синий */
.report-acc-export1c-btn {
  border-color: #2e5fa8;
  background: #3d7fd4;
  color: #fff;
}
.report-acc-export1c-btn:hover:not(:disabled) {
  background: #2e6bc0;
}
.report-acc-export1c-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  pointer-events: none;
}

.report-acc-print-menu {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  background: #1a2d46;
  border: 1px solid rgba(100, 160, 220, 0.3);
  border-radius: 6px;
  z-index: 200;
  min-width: 148px;
  padding: 4px 0;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.45);
}

.report-acc-print-menu.is-open {
  display: block;
}

.report-acc-print-menu button {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  color: #c8dff4;
  padding: 8px 14px;
  font-size: 12px;
  cursor: pointer;
  white-space: nowrap;
}

.report-acc-print-menu button:hover {
  background: rgba(100, 160, 220, 0.18);
  color: #fff;
}

.report-acc-empty {
  text-align: center;
  color: #5f7ea3;
  font-size: 11px;
  padding: 14px 8px;
}

@media (max-width: 1200px) {
  .report-accounting-filters,
  .plan-filters,
  .fact-filters,
  .startstop-filters,
  .archive-filters,
  .brigade-filters {
    width: min(860px, calc(100vw - 340px));
  }

  .report-acc-filter-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 980px) {
  .report-accounting-filters,
  .plan-filters,
  .fact-filters,
  .startstop-filters,
  .archive-filters,
  .brigade-filters {
    width: 100%;
    max-width: none;
  }

  .report-acc-layout {
    grid-template-columns: 1fr;
  }

  .report-acc-filter-actions {
    flex-direction: row;
    justify-content: flex-end;
  }
}

/* ─────────────────────────────────────────────────────────────────────────────
   Бригадные группы — мягкое нейтральное оформление (без «пестрит»).
   Раньше: 10 ярких циклящих цветов (report-acc-group-1..10) + цветные заголовки.
   Теперь: единый еле заметный фон группы + серая строка-заголовок бригады с
   разделительной линией сверху + спокойные блоки на колонках оплаты.
   Классы report-acc-group-N всё ещё проставляются в разметке (логика не тронута),
   но по отдельности больше НЕ красятся.
   Зелёный закреплён за «сделка»/«завершен», синий — нейтральный акцент.
   ── Быстрый откат: вернуть прежний блок report-acc-group-1..10 (см. git history). ──
   ───────────────────────────────────────────────────────────────────────────── */

/* тело бригадной группы — единый мягкий нейтральный фон (чуть заметнее обычной
   строки #f9fbfe, чтобы группа читалась как лёгкая полоса) */
#reportAccountingTable tbody tr.report-acc-group td { background: #eef3fa; }

/* строка-заголовок бригады — серая полоса + разделительная линия сверху.
   Это и есть «разделение между бригадными заданиями» из макета. */
#reportAccountingTable tbody tr.is-brigade-header td {
  background: #dde7f3;
  font-weight: 600;
  border-top: 2px solid #b9cadf;
}

/* колонки оплаты — спокойные блоки (тип оплаты сразу читается).
   :not(:empty) — красим ТОЛЬКО ячейки с данными (где есть сумма). Пустые ячейки и
   пустые строки-заполнители остаются чистыми → цвет не «течёт» вниз по таблице.
   Идут ПОСЛЕ фоновых правил групп (выше по специфичности из-за :nth-child+:not) →
   перекрывают фон группы на колонках оплаты. Шапку (тёмный градиент) НЕ трогаем. */
#reportAccountingTable tbody tr td:nth-child(11):not(:empty) { background: #e6f4ea; }  /* оплата Сделка */
#reportAccountingTable tbody tr td:nth-child(12):not(:empty) { background: #e7eefb; }  /* оплата почасовая */

/* Brigade expand/collapse toggle */
.report-acc-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  margin-right: 4px;
  padding: 0;
  border: none;
  background: transparent;
  color: #2a4768;
  font-size: 10px;
  line-height: 1;
  cursor: pointer;
  vertical-align: middle;
}

.report-acc-toggle:hover {
  color: #0d2946;
}

#reportAccountingTable tbody tr.report-acc-member-hidden {
  display: none;
}

.report-acc-muted {
  opacity: 0.55;
  font-size: 10px;
  font-weight: 400;
}

.report-acc-muted-pill {
  display: inline-flex;
  opacity: 0.55;
}

.report-acc-master-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  margin-right: 4px;
  padding: 0;
  border: none;
  background: transparent;
  color: inherit;
  font-size: 10px;
  line-height: 1;
  cursor: pointer;
  vertical-align: middle;
  opacity: 0.75;
}

.report-acc-master-toggle:hover {
  opacity: 1;
}

/* Подсветка строк при переходе из листа Факт (клик по «брак/простой»). */
#reportLossesTable tbody tr.loss-row-focus > td {
  background: #fde68a !important;
  transition: background-color 0.5s ease;
}
