/* Staff profit bonus — dedicated page */
.staff-profit-bonus-page {
  background: linear-gradient(165deg, #fffbeb 0%, #f8fafc 45%, #f1f5f9 100%);
  min-height: 100vh;
}

.spb-top-link {
  text-decoration: none;
}

.spb-shell {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.25rem 1rem 2.5rem;
}

.spb-head {
  margin-bottom: 1.25rem;
}

.spb-head__badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  background: #fef3c7;
  color: #92400e;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.spb-head__title {
  margin: 0.5rem 0 0.35rem;
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #0f172a;
}

.spb-head__sub {
  margin: 0;
  max-width: 62ch;
  font-size: 0.9375rem;
  line-height: 1.55;
  color: #64748b;
}

.spb-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
  gap: 1rem;
  align-items: start;
}

.spb-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 1.1rem 1.2rem;
  box-shadow: 0 4px 18px rgba(15, 23, 42, 0.05);
}

.spb-card--rules {
  border-color: #fcd34d;
  background: linear-gradient(180deg, #fffbeb 0%, #fff 100%);
}

.spb-card--aside,
.spb-card--records {
  grid-column: 1 / -1;
}

.spb-run-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
  padding: 0.75rem 0.85rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid #fcd34d;
}

.spb-run-bar__main {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
  flex: 1 1 14rem;
}

.spb-field--start-month {
  display: grid;
  gap: 0.2rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: #92400e;
}

.spb-field--start-month input {
  padding: 0.45rem 0.55rem;
  border-radius: 10px;
  border: 1px solid #fcd34d;
  background: #fff;
  font: inherit;
  font-size: 0.875rem;
}

.spb-run-feedback {
  flex: 1 1 100%;
  margin: 0;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #b45309;
}

.spb-run-feedback--error {
  color: #b91c1c;
}

.spb-run-status {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.875rem;
  font-weight: 700;
}

.spb-run-status--running {
  color: #15803d;
}

.spb-run-status--stopped {
  color: #b45309;
}

.spb-run-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.spb-applied-staff {
  margin-bottom: 0.85rem;
}

.spb-applied-staff__title {
  margin: 0 0 0.5rem;
  font-size: 0.8125rem;
  font-weight: 700;
  color: #57534e;
}

.spb-records-empty {
  margin: 0.5rem 0 0;
  font-size: 0.875rem;
  color: #78716c;
}

.spb-records-table-wrap {
  overflow-x: auto;
}

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

.spb-records-table th,
.spb-records-table td {
  padding: 0.55rem 0.65rem;
  border-bottom: 1px solid #e7e5e4;
  text-align: left;
  vertical-align: top;
}

.spb-records-table th.num,
.spb-records-table td.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.spb-records-table th {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #92400e;
}

.spb-records-staff {
  max-width: 14rem;
  color: #57534e;
  line-height: 1.4;
}

.spb-records-actions {
  white-space: nowrap;
}

.spb-card__head h2 {
  margin: 0 0 0.25rem;
  font-size: 1rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  color: #92400e;
}

.spb-card__head p {
  margin: 0;
  font-size: 0.8125rem;
  color: #78716c;
}

.spb-form {
  margin-top: 1rem;
}

.spb-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.85rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: #78350f;
  cursor: pointer;
}

.spb-form__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem 1rem;
  margin-bottom: 1rem;
}

.spb-form__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 0.85rem;
}

.spb-tiers {
  display: grid;
  gap: 0.55rem;
}

.spb-tiers-head,
.spb-tier-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 6.5rem) minmax(0, 0.85fr) auto;
  gap: 0.55rem;
  align-items: center;
}

.spb-tiers-head {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #92400e;
  padding: 0 0.1rem;
}

.spb-tier-row input {
  width: 100%;
  padding: 0.55rem 0.7rem;
  border-radius: 10px;
  border: 1px solid #fcd34d;
  background: #fff;
  font: inherit;
  font-size: 0.9375rem;
}

.spb-tier-row select.spb-tier-type {
  width: 100%;
  padding: 0.55rem 0.45rem;
  border-radius: 10px;
  border: 1px solid #fcd34d;
  background: #fff;
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #78350f;
}

.spb-tier-spacer {
  width: 2.25rem;
}

.spb-tier-add {
  justify-self: start;
  margin-top: 0.15rem;
}

.spb-tier-table {
  margin-top: 0.65rem;
  padding-top: 0.55rem;
  border-top: 1px dashed #d6d3d1;
}

.spb-tier-table__title {
  margin: 0 0 0.45rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: #57534e;
}

.spb-tier-line {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  font-size: 0.8125rem;
  padding: 0.2rem 0;
}

.spb-tier-line--active {
  color: #15803d;
  font-weight: 600;
}

.spb-tier-line--active strong {
  color: #15803d;
}

.spb-tier-line--muted {
  opacity: 0.72;
}

.spb-preview-note {
  margin: 0 0 0.65rem;
  font-size: 0.8125rem;
  color: #57534e;
  padding: 0.55rem 0.7rem;
  border-radius: 10px;
  background: #f5f5f4;
  border: 1px solid #e7e5e4;
}

.spb-field {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.spb-field span {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #92400e;
}

.spb-field input {
  width: 100%;
  padding: 0.55rem 0.7rem;
  border-radius: 10px;
  border: 1px solid #fcd34d;
  background: #fff;
  font: inherit;
  font-size: 0.9375rem;
}

.spb-field__hint {
  display: block;
  font-size: 0.8125rem;
  line-height: 1.45;
  color: #78716c;
  font-weight: 500;
  text-transform: none;
  letter-spacing: normal;
}

.spb-field__hint:empty {
  display: none;
}

.spb-breakdown--loading {
  min-height: 120px;
  display: grid;
  place-items: center;
  color: #78716c;
  background: #fafaf9;
}

.spb-breakdown--error {
  border-color: #fca5a5;
  background: #fef2f2;
  color: #b91c1c;
}

.spb-loading {
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
}

.spb-preview__toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.65rem 1rem;
  margin: 1rem 0 0.85rem;
}

.spb-field--month input {
  min-width: 170px;
}

.spb-breakdown {
  display: grid;
  gap: 0.35rem;
  padding: 0.9rem 1rem;
  border-radius: 12px;
  background: #fafaf9;
  border: 1px solid #e7e5e4;
  margin-bottom: 0.85rem;
}

.spb-breakdown--ok {
  border-color: #86efac;
  background: linear-gradient(180deg, #f0fdf4 0%, #fff 100%);
}

.spb-breakdown--applied {
  border-color: #93c5fd;
  background: linear-gradient(180deg, #eff6ff 0%, #fff 100%);
}

.spb-breakdown--preview {
  border-color: #fcd34d;
  background: linear-gradient(180deg, #fffbeb 0%, #fff 100%);
}

.spb-line {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.8125rem;
  color: #57534e;
}

.spb-line strong {
  color: #1c1917;
  font-variant-numeric: tabular-nums;
}

.spb-line--minus strong {
  color: #b45309;
}

.spb-line--total {
  margin-top: 0.25rem;
  padding-top: 0.45rem;
  border-top: 1px dashed #d6d3d1;
  font-weight: 600;
}

.spb-line--pool strong,
.spb-line--each strong,
.spb-line--rate strong {
  color: #15803d;
}

.spb-line--rate strong {
  color: #c2410c;
}

.spb-line--muted {
  opacity: 0.72;
}

.spb-line--muted strong {
  color: #78716c;
}

.spb-staff-list {
  margin: 0.5rem 0 0;
  font-size: 0.75rem;
  line-height: 1.45;
  color: #78716c;
}

.spb-staff-list--empty {
  color: #b45309;
}

.spb-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
}

.spb-status {
  margin: 0;
  font-size: 0.8125rem;
  color: #57534e;
}

.spb-help-list {
  margin: 0.75rem 0 0;
  padding-left: 1.2rem;
  font-size: 0.875rem;
  line-height: 1.55;
  color: #57534e;
}

.spb-help-list a {
  color: #b45309;
  font-weight: 600;
}

.spb-history {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid #e7e5e4;
}

.spb-history h3 {
  margin: 0 0 0.45rem;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #92400e;
}

.spb-history ul {
  margin: 0;
  padding-left: 1.1rem;
  font-size: 0.8125rem;
  color: #57534e;
}

.spb-rules-loading {
  margin: 0.5rem 0 0;
  font-size: 0.8125rem;
  color: #64748b;
}

@media (max-width: 900px) {
  .spb-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .spb-form__grid {
    grid-template-columns: 1fr;
  }
}
