.staff-page-head,
.staff-page-actions,
.staff-group-head,
.staff-group-label,
.staff-target,
.staff-person {
  display: flex;
  align-items: center;
  gap: 9px;
}

.staff-page-head {
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.staff-page-actions {
  flex-wrap: wrap;
  padding: 0 13px 12px;
}

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

.staff-shift {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: baseline;
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 15px;
  text-align: left;
  color: var(--text);
  transition: background-color 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.staff-shift:hover, .staff-shift[aria-pressed="true"] {
  border-color: var(--strong);
}

.staff-shift[aria-pressed="true"] {
  background: #f5f8fc;
  box-shadow: inset 0 0 0 1px var(--strong);
}

.staff-shift-title {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-weight: 750;
}

.staff-shift-title svg { width: 16px; height: 16px; }
.staff-shift small { color: var(--muted); font-size: 11px; font-weight: 500; }
.staff-shift strong {
  color: #243b57;
  font-size: 19px;
  font-variant-numeric: tabular-nums;
}

.staff-shift progress {
  grid-column: 1 / -1;
  width: 100%;
  height: 4px;
  border: 0;
  border-radius: 8px;
  background: #e6ebf2;
  accent-color: var(--strong);
  overflow: hidden;
}

.staff-shift progress::-webkit-progress-bar { background: #e6ebf2; }
.staff-shift progress::-webkit-progress-value { background: var(--strong); border-radius: 8px; }
.staff-shift progress::-moz-progress-bar { background: var(--strong); border-radius: 8px; }

.staff-data {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
}

.staff-data summary, .staff-applicants summary {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  list-style: none;
}

.staff-data summary { min-height: 40px; padding: 7px 13px; font-size: 12px; }
.staff-data summary strong { margin-inline-start: 4px; }
.staff-data summary small { color: var(--muted); }
.staff-data summary::-webkit-details-marker, .staff-applicants summary::-webkit-details-marker { display: none; }
.staff-data summary::after, .staff-applicants summary::after {
  content: "";
  width: 6px;
  height: 6px;
  border: solid currentColor;
  border-width: 0 1.5px 1.5px 0;
  transform: rotate(45deg);
  transition: transform 150ms ease;
  margin-inline-start: auto;
}

.staff-data[open] summary::after, .staff-applicants[open] summary::after { transform: rotate(225deg); }

.staff-import-status {
  margin: 0;
  padding: 0 13px 9px;
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.staff-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(290px, 1fr);
  align-items: start;
  gap: 16px;
}

.staff-board, .staff-people, .staff-group-head > div, .staff-candidate > div {
  min-width: 0;
}
.staff-board:only-child { grid-column: 1 / -1; }

.staff-role-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.staff-role {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 7px;
  padding: 7px 9px;
  min-height: 44px;
  text-align: start;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  transition: background-color 160ms ease, border-color 160ms ease;
}

.staff-role:hover, .staff-role[aria-pressed="true"] {
  border-color: var(--strong);
  background: #f2f6fb;
}

.staff-role-name { font-weight: 700; font-size: 13px; overflow-wrap: anywhere; }

.staff-tier-badge {
  display: inline-grid;
  place-items: center;
  min-width: 24px;
  padding: 2px 3px;
  border-radius: 4px;
  background: #edf1f6;
  color: #364b64;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .035em;
}

.staff-group {
  padding-top: 15px;
  margin-top: 16px;
  border-top: 1px solid var(--line);
}

.staff-group-head {
  align-items: flex-start;
}

.staff-group-head > div {
  flex: 1;
}

.staff-group-label h2, .staff-group-head p {
  overflow-wrap: anywhere;
}

.staff-group-label h2 { font-size: 17px; }
.staff-group-label { flex-wrap: wrap; gap: 4px 8px; }

.staff-group-head p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.staff-group-head .button {
  min-height: 28px;
  padding: 0 9px;
  border-radius: 7px;
  font-size: 12px;
}

.staff-count {
  min-height: 27px;
  display: inline-flex;
  align-items: center;
  flex: none;
  font-weight: 800;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  color: #485e76;
  white-space: nowrap;
}

.staff-count.full { color: #15624c; }
.staff-zero { color: var(--muted); margin-top: 8px; font-size: 12px; }
.staff-legacy {
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.staff-seats {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(125px, 100%), 1fr));
  gap: 7px;
  list-style: none;
  padding: 0;
  margin: 9px 0 0;
}

.staff-seat {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 36px;
  padding: 4px 7px;
  border: 1px solid var(--line);
  border-radius: 8px;
  min-width: 0;
  font-size: 12px;
  color: #435772;
}

.staff-seat-number {
  flex: none;
  font-variant-numeric: tabular-nums;
  color: #596d85;
}

.staff-seat-name {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
  font-weight: 750;
}

.staff-vacant {
  width: 100%;
  background: #fff;
  border-style: dashed;
  transition: background-color 150ms ease, border-color 150ms ease;
}

.staff-vacant svg {
  width: 14px;
  height: 14px;
  margin-left: auto;
}

.staff-vacant:hover, .staff-vacant[aria-pressed="true"] {
  background: #eaf3ff;
  border-color: #6d9ccc;
  color: #173f72;
}

.staff-vacant[aria-pressed="true"] {
  border-style: solid;
  font-weight: 800;
}

.staff-occupied {
  background: #edf8f3;
  border-color: #d5e9df;
  color: #214d40;
}

.staff-clear.icon-button {
  min-width: 24px;
  min-height: 24px;
  padding: 0;
  color: #355e53;
  margin: -1px -2px -1px 0;
}

.staff-clear.icon-button svg { width: 14px; height: 14px; }
.staff-clear.icon-button:hover { background: #fce8e6; color: #952e2b; }

.staff-people {
  position: sticky;
  top: 89px;
  display: grid;
  gap: 9px;
}

.staff-candidates {
  scroll-margin-top: 79px;
}

.staff-target {
  justify-content: space-between;
  flex-wrap: wrap;
  padding: 10px 11px;
  border-radius: 10px;
  background: #eef4fb;
  margin-bottom: 10px;
}

.staff-target span, .staff-target strong { display: block; }
.staff-target span { color: var(--muted); font-size: 11px; margin-bottom: 3px; }
.staff-target strong { color: #243b57; overflow-wrap: anywhere; }
.staff-target .button, .staff-candidate .button { min-height: 32px; padding-inline: 10px; font-size: 12px; }
.staff-empty { color: var(--muted); font-size: 13px; padding: 6px 0; line-height: 1.6; }

.staff-suggestions {
  max-height: max(185px, calc(100dvh - 258px));
  overflow-y: auto;
  scrollbar-width: thin;
}

.staff-applicants + .staff-applicants { margin-top: 10px; }
.staff-applicants h3, .staff-applicants summary {
  background: #f2f5f9;
  border-radius: 7px;
  color: #294561;
  padding: 6px 8px;
  font-size: 12px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 7px;
}

.staff-applicants summary span { margin-inline-start: auto; }
.staff-applicants summary::after { margin-inline-start: 2px; margin-inline-end: 2px; }

.staff-applicants > p { color: var(--muted); font-size: 12px; margin: 8px 2px 0; line-height: 1.55; }
.staff-candidate-list { margin: 0; padding: 0; list-style: none; }

.staff-candidate {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 3px;
}

.staff-candidate + .staff-candidate { border-top: 1px solid var(--line); }
.staff-person { align-items: baseline; gap: 6px; flex-wrap: wrap; overflow-wrap: anywhere; }
.staff-candidate p { margin-top: 4px; color: var(--muted); font-size: 12px; line-height: 1.45; overflow-wrap: anywhere; }

@media (max-width: 940px) {
  .staff-workspace { grid-template-columns: minmax(0, 1fr); }
  .staff-people { position: static; }
  .staff-suggestions { max-height: none; }
}

@media (max-width: 480px) {
  .staff-summary { gap: 7px; }
  .staff-shift { gap: 7px; padding: 9px; }
  .staff-shift-title { font-size: 12px; }
  .staff-shift strong { font-size: 16px; }
  .staff-role-list { grid-template-columns: minmax(0, 1fr); }
  .staff-seats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (prefers-reduced-motion: no-preference) {
  .staff-group, .staff-candidates { animation: staff-reveal 190ms ease-out both; }
  @keyframes staff-reveal { from { opacity: .55; transform: translateY(4px); } }
}

@media (prefers-reduced-motion: reduce) {
  .staff-shift, .staff-role, .staff-vacant, .staff-data summary::after, .staff-applicants summary::after { transition: none; }
}
