/* Персонал: стек недельных таблиц */

.cx-staff-weeks-stack {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.cx-staff-week-block {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.cx-staff-week-caption {
  font-size: 13px;
  font-weight: 700;
  color: #1c3d5a;
  letter-spacing: 0.02em;
}

.cx-staff-grid-wrap {
  overflow-x: auto;
  border: 1px solid var(--mantine-color-gray-3);
  border-radius: var(--mantine-radius-md);
  background: var(--mantine-color-body);
}

.cx-staff-grid {
  width: max-content;
  min-width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 12px;
}

.cx-staff-grid th,
.cx-staff-grid td {
  border-right: 1px solid var(--mantine-color-gray-3);
  border-bottom: 1px solid var(--mantine-color-gray-3);
  padding: 4px 6px;
  white-space: nowrap;
  vertical-align: middle;
}

.cx-staff-grid thead th {
  background: #e7f5ff;
  text-align: center;
  font-weight: 600;
}

.cx-staff-grid .cx-staff-week-head {
  background: #1c3d5a;
  color: #fff;
  font-weight: 700;
}

.cx-staff-grid .cx-staff-day-head {
  background: #dbeafe;
  font-weight: 600;
}

.cx-staff-grid .cx-staff-week-total-head {
  background: #bfdbfe;
  font-weight: 700;
}

.cx-staff-grid .cx-staff-num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.cx-staff-grid .cx-staff-hours {
  background: #eff6ff;
}

.cx-staff-grid .cx-staff-total {
  background: #dbeafe;
  font-weight: 600;
}

.cx-staff-grid .cx-staff-week-total {
  background: #93c5fd;
  font-weight: 700;
}

.cx-staff-grid tbody tr:nth-child(odd) td {
  background: var(--mantine-color-gray-0);
}

.cx-staff-grid tbody tr:nth-child(even) td {
  background: #fff;
}

/* Первая колонка (ФИО) — sticky при горизонтальном scroll */
.cx-staff-grid .cx-staff-s1 {
  position: sticky;
  left: 0;
  z-index: 2;
  min-width: 170px;
  background: inherit;
  box-shadow: 2px 0 0 #ced4da;
}

.cx-staff-grid thead .cx-staff-s1 {
  z-index: 3;
  background: #e7f5ff;
}

.cx-staff-grid .cx-staff-s2 { min-width: 110px; }
.cx-staff-grid .cx-staff-s3 { min-width: 90px; }
.cx-staff-grid .cx-staff-s4 { min-width: 130px; }
.cx-staff-grid .cx-staff-s5 { min-width: 72px; }
.cx-staff-grid .cx-staff-s6 { min-width: 88px; }

.cx-staff-grid tbody tr.cx-staff-row {
  cursor: pointer;
}

.cx-staff-grid tbody tr.cx-staff-row:hover td {
  background: #dbeafe !important;
}

.cx-staff-grid tbody tr.cx-staff-row--selected td {
  background: #bfdbfe !important;
}

.cx-staff-form-days {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.cx-staff-form-days th,
.cx-staff-form-days td {
  padding: 6px 8px;
  border-bottom: 1px solid var(--mantine-color-gray-3);
  vertical-align: middle;
}

.cx-staff-form-days th {
  text-align: left;
  font-weight: 600;
  color: var(--mantine-color-dimmed);
  font-size: 12px;
}

.cx-staff-form-num {
  font-variant-numeric: tabular-nums;
  text-align: right;
  display: block;
}

.cx-staff-grid .cx-staff-day-outside {
  background: #f8fafc;
  color: #64748b;
}

.cx-staff-grid thead .cx-staff-day-outside {
  background: #f1f5f9;
}

.cx-staff-grid tbody tr:nth-child(odd) td.cx-staff-day-outside {
  background: #f1f5f9;
}

.cx-staff-grid tbody tr:nth-child(even) td.cx-staff-day-outside {
  background: #f8fafc;
}

.rest-staff-grid-host {
  width: 100%;
  overflow: visible;
}

.rest-staff-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1.25rem;
  width: 100%;
}

.rest-staff-toolbar-switches {
  flex: 0 1 auto;
}

@media (max-width: 48em) {
  .rest-staff-toolbar {
    flex-direction: column;
    align-items: flex-start;
  }
}

.cx-staff-grid tfoot td {
  background: #e2e8f0 !important;
  font-weight: 700;
  border-top: 2px solid var(--mantine-color-gray-4);
}

.cx-staff-grid tfoot .cx-staff-s1 {
  z-index: 3;
  background: #e2e8f0 !important;
}

.cx-staff-grid .cx-staff-footer-label {
  font-weight: 700;
}
