/* Staff Ops — extends Console chrome */

.staff-denied__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.staff-denied__actions [hidden] {
  display: none !important;
}

.staff-content {
  max-width: none;
}

.staff-section {
  margin-bottom: 2rem;
}

.staff-section--tight {
  margin-bottom: 1.25rem;
}

.staff-h2 {
  font-size: 1.05rem;
  font-weight: 700;
  margin: 0 0 0.75rem;
}

.staff-muted {
  color: var(--bf-text-secondary, #57534e);
  font-size: 0.875rem;
}

.staff-error {
  color: #b91c1c;
  font-size: 0.9rem;
}

.staff-empty {
  margin: 0;
  padding: 1rem 0.85rem;
  color: var(--bf-text-secondary, #57534e);
  font-size: 0.875rem;
  background: var(--bf-surface, #fff);
  border: 1px dashed var(--bf-border, #e7e5e4);
  border-radius: 0.65rem;
}

.staff-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(8.5rem, 1fr));
  gap: 0.75rem;
}

.staff-kpi-grid--hero {
  grid-template-columns: repeat(auto-fit, minmax(10.5rem, 1fr));
  gap: 0.85rem;
  margin-bottom: 0.75rem;
}

.staff-kpi {
  padding: 0.85rem 1rem;
  background: var(--bf-surface, #fff);
  border: 1px solid var(--bf-border, #e7e5e4);
  border-radius: 0.75rem;
}

.staff-kpi--hero {
  display: block;
  width: 100%;
  text-align: left;
  cursor: pointer;
  font: inherit;
  color: inherit;
  text-decoration: none;
  padding: 1.1rem 1.15rem;
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}

.staff-kpi--hero:hover,
.staff-kpi--hero:focus-visible {
  border-color: var(--brand-accent, #e87d34);
  box-shadow: 0 0 0 3px rgb(232 125 52 / 0.15);
  outline: none;
}

.staff-kpi__value {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.1;
}

.staff-kpi--hero .staff-kpi__value {
  font-size: 1.85rem;
}

.staff-kpi__label {
  margin: 0.35rem 0 0;
  font-size: 0.75rem;
  color: var(--bf-text-secondary, #57534e);
}

.staff-kpi__hint {
  margin: 0.4rem 0 0;
  font-size: 0.7rem;
  color: var(--bf-text-secondary, #57534e);
}

.staff-inventory {
  margin: 0 0 1.25rem;
  font-size: 0.8125rem;
  color: var(--bf-text-secondary, #57534e);
  line-height: 1.5;
}

.staff-inventory a {
  color: inherit;
  font-weight: 600;
  text-underline-offset: 2px;
}

.staff-dash-nav {
  position: sticky;
  top: 0;
  z-index: 3;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  padding: 0.55rem 0;
  margin: 0 0 1.25rem;
  background: var(--bf-bg, #f5f1ea);
  border-bottom: 1px solid var(--bf-border, #e7e5e4);
}

.staff-dash-nav__pill {
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  border: 1px solid var(--bf-border, #e7e5e4);
  background: var(--bf-surface, #fff);
  font-size: 0.75rem;
  font-weight: 600;
  color: inherit;
  text-decoration: none;
}

.staff-dash-nav__pill:hover,
.staff-dash-nav__pill:focus-visible {
  border-color: var(--brand-accent, #e87d34);
  outline: none;
}

.staff-dash-section {
  margin-bottom: 2.25rem;
  scroll-margin-top: 3.25rem;
}

.staff-dash-section__head {
  margin-bottom: 0.85rem;
}

.staff-dash-section__head .staff-muted {
  margin-top: 0.25rem;
}

.staff-dash-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  gap: 1.25rem;
  margin-bottom: 1rem;
}

.staff-panel {
  padding: 1rem 1.1rem;
  background: var(--bf-surface, #fff);
  border: 1px solid var(--bf-border, #e7e5e4);
  border-radius: 0.75rem;
}

.staff-panel .staff-h2 {
  margin-bottom: 0.35rem;
}

.staff-panel__sub {
  margin: 0 0 0.85rem;
  font-size: 0.8rem;
  color: var(--bf-text-secondary, #57534e);
}

.staff-rate-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 0.85rem 0 1rem;
}

.staff-rate {
  flex: 1 1 10rem;
  padding: 0.75rem 0.9rem;
  border-radius: 0.65rem;
  background: rgb(0 0 0 / 0.03);
  border: 1px solid var(--bf-border, #e7e5e4);
}

.staff-rate__value {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 700;
}

.staff-rate__label {
  margin: 0.2rem 0 0;
  font-size: 0.75rem;
  color: var(--bf-text-secondary, #57534e);
}

.staff-chart {
  overflow-x: auto;
}

.staff-chart__bar {
  fill: var(--brand-accent, #e87d34);
}

.staff-chart__bar--click {
  cursor: pointer;
}

.staff-chart__bar--click:hover {
  fill: #d46b28;
}

.staff-chart__val {
  font-size: 10px;
  font-weight: 700;
  fill: var(--bf-text-secondary, #57534e);
}

.staff-chart__label {
  font-size: 10px;
  fill: var(--bf-text-secondary, #57534e);
}

.staff-hbar {
  display: grid;
  grid-template-columns: minmax(5rem, 7.5rem) 1fr 2.5rem;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 0.45rem;
  font-size: 0.75rem;
  color: inherit;
  text-decoration: none;
}

.staff-hbar--click {
  cursor: pointer;
  border-radius: 0.35rem;
  padding: 0.15rem 0.2rem;
}

.staff-hbar--click:hover,
.staff-hbar--click:focus-visible {
  background: rgb(0 0 0 / 0.04);
  outline: none;
}

.staff-hbar__label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--bf-text-secondary, #57534e);
  font-weight: 600;
}

.staff-hbar__track {
  height: 0.55rem;
  background: rgb(0 0 0 / 0.06);
  border-radius: 999px;
  overflow: hidden;
}

.staff-hbar__fill {
  height: 100%;
  background: var(--brand-accent, #e87d34);
  border-radius: 999px;
}

.staff-hbar__value {
  text-align: right;
  font-weight: 700;
}

.staff-funnel {
  display: grid;
  gap: 0.75rem;
}

.staff-funnel__steps {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.staff-funnel__step {
  position: relative;
  display: grid;
  grid-template-columns: 1.6rem 1fr;
  gap: 0.55rem;
  align-items: center;
  width: 100%;
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--bf-border, #e7e5e4);
  border-radius: 0.65rem;
  background: var(--bf-surface, #fff);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.staff-funnel__step:hover,
.staff-funnel__step:focus-visible,
.staff-funnel__step.is-active {
  border-color: var(--brand-accent, #e87d34);
  outline: none;
}

.staff-funnel__step.is-active {
  box-shadow: 0 0 0 2px rgb(232 125 52 / 0.2);
}

.staff-funnel__rank {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.4rem;
  height: 1.4rem;
  border-radius: 999px;
  background: rgb(0 0 0 / 0.06);
  font-size: 0.7rem;
  font-weight: 700;
}

.staff-funnel__meta {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  z-index: 1;
}

.staff-funnel__label {
  font-size: 0.8125rem;
  font-weight: 600;
}

.staff-funnel__value {
  font-size: 0.875rem;
  font-weight: 700;
}

.staff-funnel__bar {
  position: absolute;
  left: 0;
  bottom: 0;
  height: 3px;
  width: var(--funnel-w, 100%);
  max-width: 100%;
  background: var(--brand-accent, #e87d34);
  border-radius: 0 0 0.65rem 0.65rem;
}

.staff-funnel__abandon {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  padding: 0.65rem 0.85rem;
  border-radius: 0.65rem;
  border: 1px dashed #d97706;
  background: #fffbeb;
  color: #92400e;
  font: inherit;
  cursor: pointer;
}

.staff-funnel__abandon:hover,
.staff-funnel__abandon:focus-visible,
.staff-funnel__abandon.is-active {
  outline: none;
  box-shadow: 0 0 0 2px rgb(217 119 6 / 0.25);
}

.staff-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.75rem;
}

.staff-chip {
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  border: 1px solid var(--bf-border, #e7e5e4);
  background: var(--bf-surface, #fff);
  font: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
}

.staff-chip.is-active {
  background: var(--brand-accent, #e87d34);
  border-color: transparent;
  color: #fff;
}

.staff-secondary-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  margin-top: 0.85rem;
  font-size: 0.8125rem;
  color: var(--bf-text-secondary, #57534e);
}

.staff-secondary-stats strong {
  color: inherit;
  font-weight: 700;
}

.staff-disclosure {
  margin-top: 0.75rem;
}

.staff-disclosure > summary {
  cursor: pointer;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--bf-text-secondary, #57534e);
}

.staff-disclosure[open] > summary {
  margin-bottom: 0.65rem;
}

.staff-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.staff-list li {
  padding: 0.75rem 0.85rem;
  background: var(--bf-surface, #fff);
  border: 1px solid var(--bf-border, #e7e5e4);
  border-radius: 0.65rem;
  font-size: 0.875rem;
}

.staff-toolbar,
.staff-actions,
.staff-form-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 0.75rem;
}

.staff-toolbar--sticky {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 0.5rem 0;
  background: var(--bf-bg, #f5f1ea);
}

.staff-filter {
  flex: 1;
  min-width: 12rem;
  margin: 0;
}

.staff-input {
  min-width: 12rem;
  flex: 1;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--bf-border, #e7e5e4);
  border-radius: 0.5rem;
  background: var(--bf-surface, #fff);
  font: inherit;
}

.staff-input--filter {
  min-width: 10rem;
  width: 100%;
}

.staff-input--sm {
  min-width: 8rem;
  flex: 0 1 10rem;
}

select.staff-input {
  flex: 0 1 12rem;
}

.staff-btn {
  padding: 0.5rem 0.85rem;
  border-radius: 0.5rem;
  border: 1px solid var(--bf-border, #e7e5e4);
  background: var(--bf-surface, #fff);
  font: inherit;
  font-weight: 600;
  font-size: 0.8125rem;
  cursor: pointer;
}

.staff-btn--primary {
  background: var(--brand-accent, #e87d34);
  color: #fff;
  border-color: transparent;
}

.staff-btn--danger {
  background: #b91c1c;
  color: #fff;
  border-color: transparent;
}

.staff-btn--sm {
  padding: 0.25rem 0.55rem;
  font-size: 0.75rem;
}

.staff-btn--ghost {
  background: transparent;
  padding-inline: 0.5rem;
}

.staff-btn--ghost.staff-btn--danger {
  background: transparent;
  color: #b91c1c;
  border-color: transparent;
}

.staff-badge {
  display: inline-block;
  padding: 0.1rem 0.4rem;
  border-radius: 0.35rem;
  background: rgb(0 0 0 / 0.06);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  margin-right: 0.35rem;
}

.staff-badge--warn {
  background: #fef3c7;
  color: #92400e;
}

.staff-badge--ok {
  background: #dcfce7;
  color: #166534;
}

.staff-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 0.75rem;
  font-size: 0.8125rem;
  font-weight: 600;
}

.staff-form {
  max-width: 28rem;
}

.staff-msg {
  margin: 0.35rem 0;
  white-space: pre-wrap;
  word-break: break-word;
}

.staff-pre {
  margin-top: 1rem;
  padding: 0.85rem;
  background: #1c1917;
  color: #fafaf9;
  border-radius: 0.65rem;
  overflow: auto;
  font-size: 0.75rem;
}

.staff-pre.hidden {
  display: none !important;
}

.staff-secret-panel {
  margin-top: 0.75rem;
}

.staff-secret-panel .staff-actions {
  margin-top: 0.5rem;
  margin-bottom: 0;
}

.staff-table-wrap {
  overflow-x: auto;
  max-height: min(70vh, 40rem);
  border: 1px solid var(--bf-border, #e7e5e4);
  border-radius: 0.65rem;
  background: var(--bf-surface, #fff);
}

.staff-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8125rem;
}

.staff-table th,
.staff-table td {
  padding: 0.4rem 0.65rem;
  text-align: left;
  vertical-align: middle;
  border-bottom: 1px solid var(--bf-border, #e7e5e4);
}

.staff-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--bf-text-secondary, #57534e);
  background: var(--bf-surface, #fff);
  box-shadow: inset 0 -1px 0 var(--bf-border, #e7e5e4);
  white-space: nowrap;
}

.staff-table tr:last-child td {
  border-bottom: none;
}

.staff-table tr[hidden] {
  display: none;
}

.staff-table tr.staff-row--deleted td {
  background: rgb(120 53 15 / 0.04);
}

.staff-section--deleted {
  padding: 0.75rem 0.85rem;
  border: 1px dashed rgb(217 119 6 / 0.4);
  border-radius: 0.65rem;
  background: rgb(120 53 15 / 0.03);
}

.staff-section--nested {
  margin-top: 0.75rem;
}

.staff-h3 {
  margin: 0.65rem 0 0.4rem;
  font-size: 0.8125rem;
  font-weight: 700;
}

.staff-id-secondary {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  margin-left: 0.35rem;
  color: var(--bf-text-secondary, #57534e);
  font-size: 0.7rem;
  vertical-align: baseline;
}

.staff-id-secondary button {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 0;
  font: inherit;
  color: inherit;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.staff-id-secondary button:hover,
.staff-id-secondary button:focus-visible {
  color: var(--brand-accent, #e87d34);
  outline: none;
}

.staff-callout {
  margin: 0 0 0.75rem;
  padding: 0.55rem 0.75rem;
  border-radius: 0.55rem;
  border: 1px solid rgb(217 119 6 / 0.35);
  background: #fffbeb;
  font-size: 0.8125rem;
}

.staff-callout--warn {
  color: #92400e;
}

.staff-pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.5rem;
  font-size: 0.75rem;
  color: var(--bf-text-secondary, #57534e);
}

.staff-inv-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 0.65rem;
}

.staff-inv-panel[hidden] {
  display: none;
}

.staff-audit-diff {
  margin: 0.35rem 0 0;
  padding: 0.45rem 0.55rem;
  background: rgb(0 0 0 / 0.04);
  border-radius: 0.4rem;
  font-size: 0.7rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 8rem;
  overflow: auto;
}

.staff-org-picker {
  position: relative;
  flex: 1;
  min-width: 12rem;
}

.staff-org-picker__list {
  position: absolute;
  z-index: 5;
  left: 0;
  right: 0;
  top: calc(100% + 0.2rem);
  margin: 0;
  padding: 0.25rem;
  list-style: none;
  background: var(--bf-surface, #fff);
  border: 1px solid var(--bf-border, #e7e5e4);
  border-radius: 0.5rem;
  box-shadow: 0 8px 24px rgb(0 0 0 / 0.08);
  max-height: 14rem;
  overflow: auto;
}

.staff-org-picker__list button {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  padding: 0.45rem 0.55rem;
  border-radius: 0.35rem;
  font: inherit;
  cursor: pointer;
}

.staff-org-picker__list button:hover,
.staff-org-picker__list button:focus-visible {
  background: rgb(0 0 0 / 0.05);
  outline: none;
}

.console-modal__panel--wide {
  width: min(52rem, 100%);
}

.console-modal__form.staff-fields-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  gap: 0.65rem 0.85rem;
}

.console-modal__form.staff-fields-grid .console-modal__field--full,
.console-modal__form.staff-fields-grid .console-modal__actions {
  grid-column: 1 / -1;
}

.staff-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  margin: 0 0 0.45rem;
  font-size: 0.75rem;
  color: var(--bf-text-secondary, #57534e);
}

.staff-breadcrumb .staff-link {
  font-weight: 600;
}

.staff-inv-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0.85rem 0 0.65rem;
}

.staff-inv-nav__pill {
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  border: 1px solid var(--bf-border, #e7e5e4);
  background: var(--bf-surface, #fff);
  font-size: 0.75rem;
  font-weight: 600;
  color: inherit;
  text-decoration: none;
  cursor: pointer;
  font: inherit;
}

.staff-inv-nav__pill:hover,
.staff-inv-nav__pill:focus-visible,
.staff-inv-nav__pill.is-active {
  border-color: var(--brand-accent, #e87d34);
  outline: none;
}

.staff-inv-nav__pill.is-active {
  background: var(--brand-accent, #e87d34);
  color: #fff;
  border-color: transparent;
}

.staff-topbar-search {
  display: flex;
  gap: 0.4rem;
  align-items: center;
  margin-left: auto;
  min-width: 0;
  flex: 1;
  max-width: 22rem;
}

.staff-topbar-search .staff-input {
  min-width: 0;
  width: 100%;
}

.staff-topbar-search[hidden] {
  display: none !important;
}

@media (max-width: 900px) {
  .staff-topbar-search {
    display: none;
  }

  .staff-table-wrap {
    max-height: none;
  }
}

.staff-table td .staff-actions {
  margin: 0;
  gap: 0.25rem;
  justify-content: flex-end;
}

.staff-table .staff-msg {
  margin: 0;
  max-width: 28rem;
}

.staff-mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.75rem;
}

.staff-stepup-token {
  margin: 0 0 0.75rem;
  padding: 0.5rem 0.65rem;
  background: rgb(0 0 0 / 0.05);
  border-radius: 0.45rem;
  word-break: break-all;
}

.staff-link {
  color: inherit;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.m-0 {
  margin: 0 !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 640px) {
  .staff-hbar {
    grid-template-columns: 1fr;
    gap: 0.2rem;
  }

  .staff-hbar__value {
    text-align: left;
  }
}
