/* Расходы: сводная по месяцам (месяцы столбцами, фильтр цеховых, переключатель лет с итогами по годам), итого по зарплатам с премиями, внеплановые, история выплат аренды и света с пагинацией (js/fixed-costs-20261017c.js: строки СДЭК / Авито / Образцы, список платежей СДЭК), история ставок, «Уволить» и «Показать уволенных» в «Зарплатах» (js/salaries-20261017b.js). */

.fixed-costs {
  margin-top: 1rem;
}

.fixed-costs__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.6rem 1rem;
}

.fixed-costs__title {
  margin: 0;
  font-size: 1.05rem;
}

.fixed-costs__meta {
  margin: 0.45rem 0 0.8rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.fixed-costs-status {
  min-height: 1.2em;
  font-size: 0.85rem;
  color: #15803d;
}

.fixed-costs-status.is-bad {
  color: #b91c1c;
}

/* ---------- аренда ---------- */

.fixed-costs-rent {
  margin-top: 0.25rem;
}

.fixed-costs-rent + .powers-card {
  margin-top: 1rem;
}

.fixed-costs__subtitle {
  margin: 0 0 0.5rem;
  font-size: 1.05rem;
}

.fixed-costs-rent__top {
  display: flex;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
  margin-top: 0.75rem;
}

.fixed-costs-rent__amount {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  margin-right: auto;
}

.fixed-costs-rent__label {
  font-size: 0.9rem;
  color: var(--muted);
}

.fixed-costs-rent__money {
  font-size: 1.6rem;
  font-variant-numeric: tabular-nums;
}

.fixed-costs-rent__edit {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.8rem;
  color: var(--muted);
}

.fixed-costs-rent__input {
  width: 10rem;
  box-sizing: border-box;
  padding: 0.35rem 0.5rem;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.fixed-costs-rent__lines {
  margin: 0.85rem 0 0;
  padding: 0.75rem 1rem;
  list-style: none;
  border: 1px solid var(--border);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.9rem;
}

.fixed-costs-rent__note {
  color: var(--muted);
  font-size: 0.85rem;
}

.fixed-costs-rent__total {
  font-weight: 600;
}

/* ---------- история ---------- */

.fixed-costs-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.fixed-costs-table th {
  text-align: left;
  padding: 0.5rem 0.6rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.fixed-costs-table td {
  padding: 0.45rem 0.6rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

.fixed-costs-table th.fixed-costs-num,
.fixed-costs-num {
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.fixed-costs-num--total,
.fixed-costs-sum td {
  font-weight: 700;
}

.fixed-costs-table--months {
  max-width: 44rem;
}

.fixed-costs-month,
.fixed-costs-date {
  white-space: nowrap;
}

.fixed-costs-payee {
  min-width: 10rem;
}

.fixed-costs-purpose {
  min-width: 16rem;
  max-width: 34rem;
  color: var(--muted);
  font-size: 0.85rem;
}

.fixed-costs-kind {
  display: inline-block;
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  white-space: nowrap;
}

.fixed-costs-kind--rent {
  background: rgba(37, 99, 235, 0.12);
  color: #1d4ed8;
}

.fixed-costs-kind--electricity {
  background: rgba(217, 119, 6, 0.14);
  color: #b45309;
}

.fixed-costs-kind.is-inferred {
  font-weight: 500;
}

html[data-theme="dark"] .fixed-costs-kind--rent {
  color: #93c5fd;
}

html[data-theme="dark"] .fixed-costs-kind--electricity {
  color: #fbbf24;
}

.fixed-costs-payments {
  margin-top: 1rem;
}

.fixed-costs-payments > summary {
  cursor: pointer;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

/* ---------- зарплаты и премии ---------- */

.fixed-costs__tools {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem 0.75rem;
}

.fixed-costs-table--payroll {
  max-width: 60rem;
}

.fixed-costs-payroll-row.is-bonus-only td:first-child {
  color: var(--muted);
}

.fixed-costs-payroll__hint {
  font-size: 0.78rem;
  color: var(--muted);
}

.fixed-costs-shifts-input {
  width: 4.5rem;
  box-sizing: border-box;
  padding: 0.25rem 0.4rem;
  text-align: right;
}

.fixed-costs-bonus-input {
  width: 8.5rem;
  box-sizing: border-box;
  padding: 0.25rem 0.4rem;
  text-align: right;
}

.fixed-costs-bonus-name {
  width: 11rem;
  box-sizing: border-box;
  padding: 0.25rem 0.4rem;
}

.fixed-costs-payroll__grand {
  font-weight: 700;
  font-size: 0.95rem;
}

#fixed-costs-payroll-total {
  margin-top: 0.75rem;
}

#fixed-costs-bonus-sync {
  margin-top: -0.4rem;
}

.fixed-costs__meta.is-bad {
  color: #b91c1c;
}

html[data-theme="dark"] .fixed-costs__meta.is-bad {
  color: #f87171;
}

/* ---------- сводная по месяцам ---------- */

.fixed-costs-summary {
  margin-top: 0.25rem;
}

.fixed-costs-table--summary {
  width: max-content;
  min-width: 100%;
}

.fixed-costs-table--summary .fixed-costs-summary__label {
  position: sticky;
  left: 0;
  z-index: 1;
  min-width: 10.5rem;
  text-align: left;
  white-space: nowrap;
  background: var(--surface, #fff);
  box-shadow: inset -1px 0 0 var(--border);
}

.fixed-costs-table--summary tbody .fixed-costs-summary__label {
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  color: inherit;
  border-bottom: 1px solid var(--border);
}

.fixed-costs-table--summary .fixed-costs-sum .fixed-costs-summary__label {
  font-weight: 700;
}

.fixed-costs-summary__month {
  vertical-align: bottom;
}

.fixed-costs-summary__current {
  display: block;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  color: #1d4ed8;
}

html[data-theme="dark"] .fixed-costs-summary__current {
  color: #93c5fd;
}

.fixed-costs-summary__pick {
  cursor: pointer;
}

.fixed-costs-summary__pick:hover,
.fixed-costs-summary__pick:focus-visible {
  background: rgba(37, 99, 235, 0.06);
}

.fixed-costs-summary__pick:focus-visible {
  outline: 2px solid rgba(37, 99, 235, 0.5);
  outline-offset: -2px;
}

.fixed-costs-table--summary .is-selected {
  background: rgba(37, 99, 235, 0.1);
}

.fixed-costs-summary__all {
  border-left: 1px solid var(--border);
}

/* ---------- СДЭК, Авито, Образцы ---------- */

.fixed-costs-table td.is-missing {
  color: var(--muted);
  cursor: help;
}

.fixed-costs-summary__badge {
  display: inline-block;
  margin-left: 0.4rem;
  padding: 0.05rem 0.4rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 600;
  background: rgba(37, 99, 235, 0.12);
  color: #1d4ed8;
}

.fixed-costs-summary__cdek {
  padding: 0;
  border: 0;
  background: none;
  color: #1d4ed8;
  font: inherit;
  text-decoration: underline dotted;
  text-underline-offset: 3px;
  cursor: pointer;
}

.fixed-costs-summary__cdek.is-open {
  font-weight: 700;
}

html[data-theme="dark"] .fixed-costs-summary__cdek,
html[data-theme="dark"] .fixed-costs-summary__badge {
  color: #93c5fd;
}

.fixed-costs-cdek {
  margin-top: 0.75rem;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  max-width: 46rem;
}

.fixed-costs-cdek__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.4rem;
}

.fixed-costs-cdek__table tr.is-duplicate td {
  background: rgba(217, 119, 6, 0.1);
}

.fixed-costs-summary__extra {
  margin: 0.75rem 0 0;
  padding-left: 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.fixed-costs-summary__extra strong {
  color: var(--text, inherit);
}

.fixed-costs-summary__unpaid {
  color: #b45309;
}

html[data-theme="dark"] .fixed-costs-summary__unpaid {
  color: #fbbf24;
}

/* ---------- переключатель лет и итоги по годам ---------- */

.fixed-costs-summary__years {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0.6rem 0 0.5rem;
}

.fixed-costs-summary__year-btn {
  padding: 0.3rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: inherit;
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}

.fixed-costs-summary__year-btn:hover {
  border-color: #2563eb;
}

.fixed-costs-summary__year-btn.is-active {
  background: #2563eb;
  border-color: #2563eb;
  color: #fff;
}

.fixed-costs-table--summary .fixed-costs-summary__year {
  border-left: 2px solid rgba(124, 58, 237, 0.45);
  border-right: 2px solid rgba(124, 58, 237, 0.45);
  background: rgba(124, 58, 237, 0.08);
  font-weight: 600;
}

.fixed-costs-table--summary th.fixed-costs-summary__year {
  color: #6d28d9;
}

html[data-theme="dark"] .fixed-costs-table--summary th.fixed-costs-summary__year {
  color: #c4b5fd;
}

.fixed-costs-table--summary .fixed-costs-summary__all {
  border-left-width: 2px;
  background: rgba(15, 23, 42, 0.04);
  font-weight: 600;
}

html[data-theme="dark"] .fixed-costs-table--summary .fixed-costs-summary__all {
  background: rgba(255, 255, 255, 0.05);
}

.fixed-costs-table td.is-approx {
  color: var(--muted);
  font-style: italic;
  cursor: help;
}

.fixed-costs-summary__note {
  margin: 0.6rem 0 0;
}

/* ---------- фильтр «Только цеховые работники» ---------- */

.fixed-costs-summary__filter {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin-top: 0.1rem;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
}

.fixed-costs-summary__filter input {
  width: 1.05rem;
  height: 1.05rem;
  margin: 0;
}

.fixed-costs-summary__filter-note {
  margin: 0.5rem 0 0;
  padding: 0.45rem 0.7rem;
  border-radius: 10px;
  font-size: 0.85rem;
  background: rgba(217, 119, 6, 0.12);
  color: #92400e;
}

html[data-theme="dark"] .fixed-costs-summary__filter-note {
  color: #fbbf24;
}

.fixed-costs-summary.is-workshop-only {
  box-shadow: inset 4px 0 0 #d97706;
}

.fixed-costs-rate--split {
  color: #1d4ed8;
  cursor: help;
}

html[data-theme="dark"] .fixed-costs-rate--split {
  color: #93c5fd;
}

/* ---------- платежи по выписке: страницы по 10 ---------- */

.fixed-costs-pager {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-top: 0.6rem;
}

.fixed-costs-pager__info {
  min-width: 7.5rem;
  text-align: center;
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}

/* ---------- «Зарплаты»: кнопка в шапке карточки, цеховой, история ставок ---------- */

#section-salaries .salaries-department th {
  padding: 0.9rem 0.6rem 0.55rem;
  text-align: left;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: normal;
  text-transform: none;
  color: var(--text);
  border-bottom: 1px solid var(--border);
}

.salaries-card__head {
  margin-bottom: 0.5rem;
}

.salaries-card__head .fixed-costs__subtitle {
  margin: 0;
}

.salaries-input.salaries-input--workshop {
  width: 1.05rem;
  height: 1.05rem;
  padding: 0;
  margin: 0.45rem auto 0;
  display: block;
}

.salaries-rate__since {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  margin-top: 0.3rem;
  font-size: 0.78rem;
  color: var(--muted);
}

.salaries-input.salaries-input--since {
  width: 8.6rem;
  padding: 0.15rem 0.35rem;
  font-size: 0.8rem;
}

.salaries-rates {
  margin-top: 0.3rem;
  font-size: 0.8rem;
}

.salaries-rates > summary {
  cursor: pointer;
  color: var(--muted);
}

.salaries-rates__list {
  list-style: none;
  margin: 0.3rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.salaries-rates__item {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  white-space: nowrap;
}

.salaries-rates__money {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.salaries-rates__drop {
  margin-left: 0.15rem;
}

/* ---------- «Уволен с даты» ---------- */

/* Таблица «Зарплаты» помещается целиком (с «Уволить» и «×») на обычном мониторе. */
.salaries-table thead th {
  white-space: normal;
}

.salaries-table .salaries-input.salaries-input--name {
  width: 10.5rem;
}

.salaries-table .salaries-input.salaries-input--time {
  width: 5.8rem;
}

.salaries-table .salaries-input.salaries-input--small {
  width: 3.6rem;
}

.salaries-card__head {
  gap: 0.75rem;
}

.salaries-show-dismissed {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-left: auto;
  font-size: 0.85rem;
  color: var(--muted);
  cursor: pointer;
}

.salaries-show-dismissed[hidden] {
  display: none;
}

.salaries-actions .salaries-btn-dismiss,
.salaries-actions .salaries-btn-return {
  display: block;
  margin: 0.35rem 0 0 auto;
}

.salaries-row.is-dismissed > td {
  background: rgba(148, 163, 184, 0.12);
}

.salaries-row.is-dismissed > td:not(.salaries-who):not(.salaries-actions) {
  opacity: 0.55;
}

.salaries-row.is-dismissed .salaries-input--name {
  color: var(--muted);
}

.salaries-dismissed {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.3rem;
  font-size: 0.78rem;
  font-weight: 600;
  white-space: nowrap;
  color: #b45309;
}

html[data-theme="dark"] .salaries-dismissed {
  color: #fbbf24;
}

.salaries-input.salaries-input--dismissed {
  width: 8.6rem;
  padding: 0.15rem 0.35rem;
  font-size: 0.8rem;
}

.fixed-costs-payroll-row.is-dismissed > td {
  color: var(--muted);
}

.fixed-costs-payroll__dismissed {
  color: #b45309;
}

html[data-theme="dark"] .fixed-costs-payroll__dismissed {
  color: #fbbf24;
}
