/* UA-ERP V2.9 ORGANIZATIONAL STAFFING */
.staff-v29-summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  margin: 0 0 16px;
  padding: 18px;
  border: 1px solid rgba(49, 86, 65, 0.3);
  background:
    linear-gradient(120deg, rgba(239, 247, 241, 0.99), rgba(252, 253, 252, 0.99)),
    linear-gradient(90deg, rgba(55, 104, 76, 0.09), transparent);
  box-shadow: 0 10px 28px rgba(31, 61, 44, 0.08);
}

.staff-v29-summary > div {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.staff-v29-summary strong {
  font-size: 17px;
}

.staff-v29-summary small {
  line-height: 1.5;
}

.staff-v29-center {
  display: grid;
  gap: 14px;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

.staff-v29-dashboard {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.staff-v29-dashboard > div {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 12px;
  border: 1px solid rgba(53, 78, 63, 0.2);
  background: linear-gradient(180deg, #fff, #f5f8f5);
}

.staff-v29-dashboard span {
  font-size: 12px;
  color: #5f6a63;
}

.staff-v29-dashboard b {
  font-size: 22px;
  color: #26352d;
  overflow-wrap: anywhere;
}

.staff-v29-dashboard .is-warning {
  border-color: rgba(151, 113, 32, 0.42);
  background: linear-gradient(180deg, #fffdf7, #faf4e7);
}

.staff-v29-dashboard .is-error {
  border-color: rgba(158, 73, 73, 0.45);
  background: linear-gradient(180deg, #fffafa, #faeeee);
}

.staff-v29-dashboard .is-ready {
  border-color: rgba(59, 112, 78, 0.42);
  background: linear-gradient(180deg, #f8fcf9, #edf7ef);
}

.staff-v29-acceptance {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 14px;
  border-left: 4px solid #98752d;
  background: #fffaf0;
}

.staff-v29-acceptance.is-ready {
  border-left-color: #4e775c;
  background: #f0f8f2;
}

.staff-v29-acceptance > div {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.staff-v29-acceptance small {
  overflow-wrap: anywhere;
}

.staff-v29-filters {
  display: grid;
  grid-template-columns:
    minmax(240px, 1.5fr)
    minmax(170px, 0.9fr)
    minmax(180px, 1fr)
    minmax(140px, 0.7fr)
    auto;
  gap: 8px;
  min-width: 0;
  padding: 12px;
  border: 1px solid rgba(53, 78, 63, 0.2);
  background: #fafcfb;
}

.staff-v29-filters > * {
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
}

.staff-v29-toolbar,
.staff-v29-actions,
.staff-v29-inline-metrics {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
}

.staff-v29-toolbar {
  padding: 10px 0;
  border-bottom: 1px solid rgba(53, 78, 63, 0.16);
}

.staff-v29-section {
  min-width: 0;
  border: 1px solid rgba(53, 78, 63, 0.2);
  background: #fff;
}

.staff-v29-section > summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 13px 14px;
  cursor: pointer;
  background:
    linear-gradient(180deg, #fbfdfb, #f4f8f5);
  border-bottom: 1px solid transparent;
}

.staff-v29-section[open] > summary {
  border-bottom-color: rgba(53, 78, 63, 0.16);
}

.staff-v29-section > summary span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  min-height: 28px;
  padding: 4px 8px;
  border: 1px solid rgba(53, 78, 63, 0.22);
  background: #fff;
  font-weight: 700;
}

.staff-v29-editions,
.staff-v29-units,
.staff-v29-slots,
.staff-v29-issues {
  display: grid;
  gap: 10px;
  min-width: 0;
  padding: 12px;
}

.staff-v29-edition,
.staff-v29-slot,
.staff-v29-issue {
  display: grid;
  gap: 10px;
  min-width: 0;
  padding: 13px;
  border: 1px solid rgba(53, 78, 63, 0.2);
  background: #fff;
}

.staff-v29-edition > header,
.staff-v29-slot > header,
.staff-v29-edition > footer,
.staff-v29-slot > footer {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  min-width: 0;
}

.staff-v29-edition > header > div,
.staff-v29-slot > header > div,
.staff-v29-issue > div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.staff-v29-edition strong,
.staff-v29-slot strong,
.staff-v29-unit strong,
.staff-v29-issue strong,
.staff-v29-edition small,
.staff-v29-slot small,
.staff-v29-unit small,
.staff-v29-issue small,
.staff-v29-edition p,
.staff-v29-slot p,
.staff-v29-issue p {
  overflow-wrap: anywhere;
}

.staff-v29-edition p,
.staff-v29-slot p,
.staff-v29-issue p {
  margin: 0;
}

.staff-v29-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 4px 8px;
  border: 1px solid rgba(53, 78, 63, 0.25);
  background: #f5f8f5;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.staff-v29-status.is-active,
.staff-v29-status.is-occupied {
  border-color: rgba(53, 111, 75, 0.45);
  background: #edf7ef;
  color: #28563a;
}

.staff-v29-status.is-vacant,
.staff-v29-status.is-draft,
.staff-v29-status.is-approved {
  border-color: rgba(154, 116, 43, 0.42);
  background: #fff9ec;
  color: #74561e;
}

.staff-v29-status.is-frozen,
.staff-v29-status.is-archived,
.staff-v29-status.is-cancelled {
  border-color: rgba(105, 105, 105, 0.36);
  background: #f3f3f3;
  color: #555;
}

.staff-v29-unit {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-width: 0;
  margin-left: var(--staff-depth, 0);
  padding: 11px 12px;
  border-left: 4px solid #68806f;
  background: linear-gradient(90deg, #f4f8f5, #fff);
}

.staff-v29-unit > div:first-child {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.staff-v29-unit > div:last-child {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.staff-v29-inline-metrics {
  color: #536158;
  font-size: 13px;
}

.staff-v29-slot.is-occupied {
  border-left: 4px solid #4e775c;
}

.staff-v29-slot.is-vacant {
  border-left: 4px solid #a17d32;
}

.staff-v29-slot.is-frozen {
  border-left: 4px solid #777;
  background: #f8f8f8;
}

.staff-v29-slot-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  min-width: 0;
}

.staff-v29-slot-grid p {
  display: grid;
  gap: 3px;
  min-width: 0;
  padding: 9px;
  border: 1px solid rgba(53, 78, 63, 0.15);
  background: #fafcfb;
}

.staff-v29-slot-grid span,
.staff-v29-occupant span {
  font-size: 11px;
  color: #667169;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.staff-v29-occupant {
  display: grid;
  gap: 3px;
  min-width: 0;
  padding: 10px;
  border-left: 3px solid #6c7f72;
  background: #f4f7f5;
}

.staff-v29-manning {
  display: grid;
  min-width: 0;
  padding: 12px;
  overflow-x: auto;
}

.staff-v29-manning-head,
.staff-v29-manning-row {
  display: grid;
  grid-template-columns:
    minmax(260px, 1fr)
    80px
    80px
    80px
    80px
    80px;
  gap: 8px;
  align-items: center;
  min-width: 720px;
  padding: 9px 10px;
  border-bottom: 1px solid rgba(53, 78, 63, 0.14);
}

.staff-v29-manning-head {
  background: #edf4ef;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.staff-v29-manning-row > div {
  padding-left: var(--staff-depth, 0);
  min-width: 0;
}

.staff-v29-manning-row:nth-child(even) {
  background: #fafcfb;
}

.staff-v29-issue {
  grid-template-columns: minmax(0, 1fr) minmax(220px, 0.8fr);
  border-left: 4px solid #9b7530;
}

.staff-v29-issue.is-error {
  border-left-color: #9e4949;
  background: #fffafa;
}

.staff-v29-issue.is-warning {
  border-left-color: #9b7530;
  background: #fffdf8;
}

.staff-v29-issue p {
  color: #5d625f;
}

@media (max-width: 1100px) {
  .staff-v29-filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .staff-v29-filters > button {
    grid-column: 1 / -1;
  }
}

@media (max-width: 760px) {
  .staff-v29-summary,
  .staff-v29-acceptance {
    grid-template-columns: 1fr;
  }

  .staff-v29-summary > button,
  .staff-v29-acceptance > button {
    width: 100%;
  }

  .staff-v29-dashboard,
  .staff-v29-slot-grid,
  .staff-v29-filters {
    grid-template-columns: 1fr;
  }

  .staff-v29-unit,
  .staff-v29-edition > header,
  .staff-v29-slot > header,
  .staff-v29-edition > footer,
  .staff-v29-slot > footer,
  .staff-v29-issue {
    grid-template-columns: 1fr;
  }

  .staff-v29-unit {
    margin-left: 0;
    padding-left: calc(12px + min(var(--staff-depth, 0), 32px));
  }

  .staff-v29-unit > div:last-child {
    justify-content: flex-start;
  }

  .staff-v29-toolbar,
  .staff-v29-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .staff-v29-toolbar .button,
  .staff-v29-actions .button {
    width: 100%;
  }
}
