.view-salary-config {
  background: #F2F2F7;
  overflow: hidden;
}

.sc-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: #fff;
  border-bottom: 1px solid #E5E5EA;
  flex-shrink: 0;
}

.sc-title { font-size: 17px; font-weight: 700; color: #1C1C1E; }

.sc-header {
  padding: 16px 16px 8px;
  flex-shrink: 0;
}

.sc-header-title {
  font-size: 22px;
  font-weight: 800;
  color: #1C1C1E;
  display: block;
}

.sc-header-sub {
  font-size: 12px;
  color: #8E8E93;
  margin-top: 6px;
  display: block;
}

.sc-person-bar-wrap {
  flex-shrink: 0;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
}

.sc-person-bar {
  display: flex;
  flex-wrap: nowrap;
  align-items: stretch;
  gap: 8px;
  overflow-x: auto;
  overflow-y: hidden;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  padding: 0 16px 12px;
  flex-shrink: 0;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  touch-action: pan-x;
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 0, 0, 0.18) transparent;
}

.sc-person-bar-wrap.hidden {
  display: none;
}

.sc-person-bar::-webkit-scrollbar {
  height: 4px;
}

.sc-person-bar::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.18);
  border-radius: 999px;
}

.sc-person-bar::-webkit-scrollbar-track {
  background: transparent;
}

.sc-person-chip {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 10px 14px;
  border-radius: 14px;
  border: 1px solid #E5E5EA;
  background: #fff;
  cursor: pointer;
  min-width: 88px;
  max-width: 140px;
}

.sc-person-chip.active {
  border-color: #007AFF;
  background: #EBF5FF;
  box-shadow: 0 0 0 1px rgba(0, 122, 255, 0.2);
}

.sc-person-name {
  font-size: 14px;
  font-weight: 800;
  color: #1C1C1E;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.sc-person-role {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 6px;
}

.sc-person-role.sales { background: #EBF5FF; color: #007AFF; }
.sc-person-role.inspector { background: #E6FFF1; color: #07C160; }
.sc-person-role.admin { background: #FFF4E6; color: #FF9500; }

.sc-flex-hint {
  font-size: 12px;
  color: #8E8E93;
  line-height: 1.45;
  margin: -4px 0 10px;
}

.sc-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding-bottom: 24px;
  -webkit-overflow-scrolling: touch;
}

.sc-card {
  background: #FFF;
  margin: 0 16px 16px;
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.03);
}

.sc-user-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid #F2F2F7;
}

.sc-user-main {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
}

.sc-delete-btn {
  flex-shrink: 0;
  border: none;
  background: #FFF0F0;
  color: #FF3B30;
  font-size: 12px;
  font-weight: 700;
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
}

.sc-name { font-size: 17px; font-weight: 800; color: #1C1C1E; }

.sc-role-tag {
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 6px;
  margin-left: 10px;
  font-weight: 700;
}

.sc-role-tag.sales { background: #EBF5FF; color: #007AFF; }
.sc-role-tag.inspector { background: #E6FFF1; color: #07C160; }
.sc-role-tag.admin { background: #FFF4E6; color: #FF9500; }

.sc-self-tag {
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 6px;
  margin-left: 10px;
  font-weight: 700;
  background: #007AFF;
  color: #fff;
}

.sc-card.sc-self {
  box-shadow: 0 0 0 2px rgba(0, 122, 255, 0.35), 0 2px 10px rgba(0,0,0,0.03);
}

/* 覆盖 app.css 全局 input 的 width/padding/margin，避免行高错位 */
.view-salary-config input,
.view-salary-config textarea,
.view-salary-config select {
  width: auto;
  margin: 0;
  padding: 0;
  background: transparent;
  border-radius: 0;
  font-size: inherit;
  font-family: inherit;
  box-sizing: border-box;
}

.sc-input-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 44px;
  padding: 10px 0;
  border-bottom: 1px solid #F9F9F9;
}

.sc-label {
  flex-shrink: 0;
  font-size: 14px;
  color: #3A3A3C;
  font-weight: 600;
  line-height: 1.3;
}

.sc-label.warn { color: #FF9500; }

.sc-input-wrap {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  min-width: 0;
  flex: 1;
}

.sc-input-item > .sc-input-wrap > input {
  display: block;
  text-align: right;
  font-size: 15px;
  font-weight: 700;
  color: #007AFF;
  width: 120px;
  max-width: 45vw;
  height: 28px;
  line-height: 28px;
  padding: 0;
  margin: 0;
  border: none;
  background: transparent;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}

.sc-input-item > .sc-input-wrap > input.wide {
  width: 180px;
  max-width: 58vw;
  text-align: left;
}

.sc-unit {
  flex-shrink: 0;
  font-size: 12px;
  color: #AEAEB2;
  line-height: 28px;
}

.sc-group-title {
  font-size: 11px;
  color: #AEAEB2;
  font-weight: 800;
  margin-top: 20px;
  margin-bottom: 10px;
  text-transform: uppercase;
}

.sc-tier-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.sc-tier-cell {
  background: #F8F8F9;
  padding: 10px 6px;
  border-radius: 10px;
  text-align: center;
}

.sc-tier-cell span {
  font-size: 10px;
  color: #8E8E93;
  display: block;
  font-weight: 700;
}

.sc-tier-cell input {
  font-size: 14px;
  font-weight: 800;
  color: #1C1C1E;
  margin: 4px 0 0;
  width: 100%;
  height: 28px;
  line-height: 28px;
  text-align: center;
  border: none;
  background: transparent;
  outline: none;
}

.sc-save-btn {
  margin-top: 20px;
  width: 100%;
  background: #007AFF;
  color: #FFF;
  font-size: 14px;
  border-radius: 10px;
  font-weight: 800;
  height: 44px;
  border: none;
  cursor: pointer;
}

.sc-loading, .sc-empty {
  padding: 40px;
  text-align: center;
  color: #8E8E93;
}

.sc-custom-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.sc-add-custom-btn {
  border: none;
  background: #EBF5FF;
  color: #007AFF;
  font-size: 12px;
  font-weight: 700;
  padding: 6px 10px;
  border-radius: 8px;
  cursor: pointer;
}

.sc-custom-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 4px;
}

.sc-custom-row {
  display: grid;
  grid-template-columns: 1.2fr 0.7fr 0.8fr 32px;
  gap: 6px;
  align-items: center;
}

.sc-custom-row input,
.sc-sourcing-row input,
.sc-insp-std-row input,
.sc-milestone-row input,
.sc-milestone-label {
  width: 100%;
  height: 40px;
  line-height: 20px;
  padding: 10px 12px;
  margin: 0;
  border: 1px solid #E5E5EA;
  border-radius: 8px;
  font-size: 14px;
  background: #FAFAFC;
  color: #1C1C1E;
  font-weight: 500;
}

.sc-custom-row input {
  font-size: 13px;
  padding: 8px 10px;
}

.sc-custom-remove {
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 8px;
  background: #FFF0F0;
  color: #FF3B30;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

.sc-milestone-row {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr 32px;
  gap: 6px;
  align-items: center;
  margin-bottom: 8px;
}

.sc-milestone-row .sc-input-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.sc-milestone-row .sc-milestone-amount input {
  flex: 1;
  min-width: 0;
  text-align: right;
  font-weight: 700;
  color: #007AFF;
}

.sc-milestone-rule {
  margin-top: 4px;
  margin-bottom: 8px;
}

.sc-milestone-list {
  margin-bottom: 4px;
}

.sc-milestone-rule textarea {
  width: 100%;
  margin-top: 8px;
  border: 1px solid #E5E5EA;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 13px;
  line-height: 1.5;
  background: #FAFAFC;
  resize: vertical;
  min-height: 56px;
  font-family: inherit;
}

.sc-sourcing-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 4px;
}

.sc-sourcing-row {
  display: grid;
  grid-template-columns: 1fr 1fr auto 32px;
  gap: 6px;
  align-items: center;
}

.sc-sourcing-row .sc-unit {
  white-space: nowrap;
  line-height: 40px;
}

.sc-insp-std-list {
  margin-bottom: 4px;
}

.sc-insp-std-row {
  display: grid;
  grid-template-columns: 1.2fr 0.75fr 0.65fr 32px;
  gap: 6px;
  align-items: center;
  margin-bottom: 8px;
}


.sc-danger-btn {
  margin-top: 10px;
  width: 100%;
  background: #fff;
  color: #ff3b30;
  font-size: 13px;
  border-radius: 10px;
  font-weight: 700;
  height: 42px;
  border: 1px solid rgba(255, 59, 48, 0.35);
  cursor: pointer;
}

.sc-clear-all-btn {
  margin-top: 12px;
  background: #ff3b30;
  color: #fff;
  border-color: #ff3b30;
}

.sc-danger-btn:disabled {
  opacity: 0.5;
}
