.bookingRulesPanel {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.bookingRulesPanel[hidden] {
  display: none !important;
}

.bookingRulesHeadActions {
  flex: 0 1 auto;
  flex-wrap: nowrap;
  gap: 6px;
  max-width: min(64%, 720px);
  overflow-x: auto;
  scrollbar-width: thin;
}

.bookingRulesSectionHead {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 6px;
  padding: 6px 10px;
  border-radius: 12px;
  box-shadow: 0 8px 20px rgba(40, 56, 50, 0.05);
  grid-template-columns: none;
}

.bookingRulesSectionHead > div:first-child {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex: 1 1 auto;
  min-width: 0;
}

.bookingRulesSectionHead h2 {
  flex: 0 0 auto;
  font-size: 1rem;
  line-height: 1.2;
  white-space: nowrap;
}

.bookingRulesHeaderStatus {
  flex: 1 1 auto;
  display: block;
  max-width: none;
  margin: 0;
  overflow: hidden;
  color: var(--shell-accent);
  font-size: 0.7rem;
  font-weight: 700;
  line-height: 1.25;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow-wrap: normal;
  -webkit-line-clamp: unset;
  -webkit-box-orient: unset;
}

.bookingRulesHeaderStatus[data-state="error"] {
  color: #9b312e;
}

.bookingRulesHeaderStatus[data-state="stale"],
.bookingRulesHeaderStatus[data-state="empty"] {
  color: #7a5a19;
}

.bookingRulesRevisionBadge {
  flex: 0 0 auto;
  white-space: nowrap;
}

.bookingRulesHeadActions .jwtStatus {
  display: inline-block;
  max-width: 8.5rem;
  min-height: 28px;
  overflow: hidden;
  line-height: 28px;
  font-size: 0.7rem;
  white-space: nowrap;
  text-overflow: ellipsis;
  vertical-align: middle;
}

.bookingRulesHeadActions .shellBtn {
  flex: 0 0 auto;
  min-height: 30px;
  padding: 0.28rem 0.55rem;
  font-size: 0.75rem;
  white-space: nowrap;
}

.bookingRulesTabs {
  flex-wrap: nowrap;
  overflow-x: auto;
  padding: 7px;
  border: 1px solid var(--shell-border);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.86);
}

.bookingRulesTabs .metricRoleTab {
  flex: 0 0 auto;
}

.bookingRulesWorkspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  min-width: 0;
}

.bookingRulesMain {
  min-width: 0;
}

.bookingRulesDetail {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.bookingRulesDetail[hidden] {
  display: none !important;
}

.bookingRulesDetail input,
.bookingRulesDetail select,
.bookingRulesDetail textarea {
  min-width: 0;
  max-width: 100%;
}

.bookingRulesDetail input[type="datetime-local"],
.bookingRulesDetail input[type="date"] {
  min-width: 0;
  padding-right: 0.4rem;
  font-size: 0.74rem;
}

.bookingRulesChangeBar {
  position: sticky;
  bottom: 10px;
  z-index: 15;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid rgba(15, 107, 99, 0.26);
  border-radius: 12px;
  background: rgba(240, 248, 245, 0.97);
  box-shadow: 0 12px 30px rgba(39, 53, 48, 0.12);
}

.bookingRulesChangeBar[hidden] {
  display: none !important;
}

.bookingRulesChangeBar p,
.bookingRulesChangeBar strong,
.bookingRulesChangeBar span {
  display: block;
  margin: 0;
}

.bookingRulesChangeBar span {
  margin-top: 2px;
  color: var(--shell-muted);
  font-size: 0.74rem;
}

.bookingRulesDialogLayer {
  position: fixed;
  inset: 0;
  z-index: 320;
  box-sizing: border-box;
  display: grid;
  place-items: start center;
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden;
  padding: clamp(48px, 8vh, 72px) 24px 24px;
}

.bookingRulesDialogLayer[hidden] {
  display: none !important;
}

.bookingRulesDialogBackdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(10, 28, 24, 0.34);
  backdrop-filter: blur(8px);
}

.bookingRulesDialog {
  position: relative;
  box-sizing: border-box;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  width: min(720px, 100%);
  max-height: calc(100vh - 96px);
  overflow: hidden;
  padding: 16px;
  border: 1px solid var(--shell-border);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 28px 72px rgba(32, 48, 43, 0.24);
}

.bookingRulesDialog[data-variant="detail"] {
  width: min(1080px, 100%);
}

.bookingRulesDialogHead,
.bookingRulesDialogActions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.bookingRulesDialogHead {
  justify-content: space-between;
  min-height: 36px;
}

.bookingRulesDialogActions {
  justify-content: flex-end;
  padding-top: 12px;
  border-top: 1px solid var(--shell-border);
  background: #fff;
}

.bookingRulesDialogActions .shellBtn {
  min-width: 132px;
  justify-content: center;
}

.bookingRulesDialogHead h2 {
  margin: 0;
}

.bookingRulesDialogHead h2 {
  color: var(--shell-text);
  font-size: clamp(1.15rem, 2vw, 1.45rem);
  font-weight: 900;
  line-height: 1.25;
}

.bookingRulesDialogClose {
  width: 34px;
  height: 34px;
  border: 1px solid var(--shell-border);
  border-radius: 999px;
  background: #fff;
  color: var(--shell-text);
  cursor: pointer;
  font: inherit;
}

.bookingRulesDialogBody {
  min-width: 0;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  padding: 10px 0;
}

.bookingRulesDialogActions:empty {
  display: none;
}

@media (max-width: 1100px) {
  .bookingRulesTabs {
    scrollbar-width: thin;
  }
}

@media (max-width: 720px) {
  .bookingRulesSectionHead {
    align-items: stretch;
    flex-direction: column;
  }

  .bookingRulesHeadActions {
    max-width: none;
    flex-wrap: wrap;
  }

  .bookingRulesHeadActions,
  .bookingRulesChangeBar {
    align-items: stretch;
    flex-direction: column;
  }

  .bookingRulesHeadActions .shellBtn,
  .bookingRulesChangeBar .shellBtn {
    width: 100%;
  }

  .bookingRulesHeadActions .jwtStatus {
    max-width: none;
  }

  .bookingRulesDialogLayer {
    place-items: end center;
    padding: 10px;
  }

  .bookingRulesDialog {
    width: 100%;
    max-height: 88vh;
    overflow-x: hidden;
    padding: 16px;
  }

  .bookingRulesDialogActions {
    position: sticky;
    bottom: -16px;
    margin: 0 -16px -16px;
    padding: 12px 16px 16px;
    background: #fff;
  }

  .bookingRulesDetail .adminRuleBindingRow,
  .bookingRulesDetail .adminRuleRelationRow {
    grid-template-columns: minmax(0, 1fr);
  }

  .bookingRulesDetail .adminRuleDetailActions {
    align-items: stretch;
    flex-direction: column-reverse;
  }

  .bookingRulesDetail .adminRuleDetailActions .shellBtn {
    width: 100%;
  }
}


.bookingRulesToolbar {
  display: flex;
  align-items: end;
  flex-wrap: nowrap;
  gap: 6px;
  padding: 6px 8px;
  overflow-x: auto;
  scrollbar-width: thin;
  border: 1px solid var(--shell-border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.86);
}

/* 预约管理/全局预览等自带筛选条时，全局 toolbar 会被清空，勿留空壳占位 */
#bookingRulesToolbar:empty,
#bookingRulesToolbar[hidden] {
  display: none !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  min-height: 0 !important;
  overflow: hidden !important;
}

.bookingRulesSearch,
.bookingRulesFilter,
.adminRuleField {
  display: grid;
  gap: 4px;
  min-width: 150px;
  color: var(--shell-muted);
  font-size: 0.74rem;
  font-weight: 800;
}

.bookingRulesSearch { flex: 1 1 240px; }

/* 顶部筛选条：桌面优先单行，压缩搜索/下拉宽度 */
.bookingRulesToolbar > .bookingRulesSearch,
.bookingRulesToolbar > .bookingRulesFilter {
  gap: 2px;
  min-width: 0;
  font-size: 0.68rem;
}

.bookingRulesToolbar > .bookingRulesSearch {
  flex: 0 1 8.75rem;
  width: 8.75rem;
  max-width: 10.5rem;
}

.bookingRulesToolbar > .bookingRulesFilter {
  flex: 0 0 auto;
}

.bookingRulesToolbar > .bookingRulesSearch input,
.bookingRulesToolbar > .bookingRulesFilter select {
  min-height: 30px;
  padding: 0.22rem 0.4rem;
  font-size: 0.74rem;
}

.bookingRulesToolbar > .bookingRulesFilter select {
  width: auto;
  min-width: 5.25rem;
  max-width: 7.75rem;
  padding-right: 1.35rem;
  background-position:
    calc(100% - 11px) calc(50% - 1px),
    calc(100% - 6px) calc(50% - 1px);
}

.bookingRulesToolbar > .bookingRulesToolbarActions {
  flex: 0 0 auto;
  flex-wrap: nowrap;
  gap: 6px;
  margin-left: auto;
  white-space: nowrap;
}

.bookingRulesToolbar > .bookingRulesPeopleViewSwitch {
  flex: 0 0 auto;
}

.bookingRulesToolbar > .bookingRulesPeopleHint {
  flex: 1 1 100%;
}

.bookingRulesSearch input,
.bookingRulesFilter select,
.adminRuleField input,
.adminRuleField select,
.adminRuleField textarea,
.bookingRulesDetail input:not([type="radio"]):not([type="checkbox"]),
.bookingRulesDetail select,
.bookingRulesDetail textarea,
.adminRuleFieldCard input:not([type="radio"]):not([type="checkbox"]),
.adminRuleFieldCard select,
.adminRuleFieldCard textarea,
.adminRuleTriState input:not([type="radio"]):not([type="checkbox"]),
.adminRuleTriState select,
.adminRuleStructured input:not([type="radio"]):not([type="checkbox"]),
.adminRuleStructured select {
  box-sizing: border-box;
  width: 100%;
  min-height: var(--shell-control-h, 32px);
  margin: 0;
  padding: 0.35rem 0.65rem;
  border: 1px solid var(--shell-border);
  border-radius: var(--shell-control-radius, 8px);
  background: #fff;
  color: var(--shell-text);
  font: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1.3;
  appearance: none;
  -webkit-appearance: none;
}

.bookingRulesDetail select,
.adminRuleFieldCard select,
.adminRuleTriState select,
.adminRuleStructured select,
.bookingRulesFilter select {
  padding-right: 1.7rem;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--shell-muted) 50%),
    linear-gradient(135deg, var(--shell-muted) 50%, transparent 50%);
  background-position:
    calc(100% - 14px) calc(50% - 1px),
    calc(100% - 9px) calc(50% - 1px);
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  cursor: pointer;
}

.bookingRulesDetail input:focus,
.bookingRulesDetail select:focus,
.bookingRulesDetail textarea:focus,
.adminRuleFieldCard input:focus,
.adminRuleFieldCard select:focus,
.adminRuleFieldCard textarea:focus {
  outline: none;
  border-color: rgba(15, 107, 99, 0.55);
  box-shadow: 0 0 0 3px rgba(15, 107, 99, 0.12);
}

.adminRuleDetailForm {
  display: grid;
  gap: 10px;
  align-content: start;
}

.adminRuleDetailForm--stores {
  gap: 12px;
}

.adminRuleEditorSection--store {
  gap: 8px;
}

.adminRuleEditorSection--store .adminRuleEditorSectionBody {
  display: grid;
  gap: 9px;
}

.adminRuleStoreLimitGrid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.adminRuleDetailForm--stores .adminRuleFieldCard {
  gap: 6px;
  padding: 9px 10px 10px;
  background: #fff;
}

.adminRuleStoreScheduleNote,
.adminRuleItemScopeNote {
  border-color: rgba(15, 107, 99, 0.16);
  background: rgba(15, 107, 99, 0.055);
  color: #315e50;
}

.adminRuleFieldCard,
.adminRuleTriState,
.adminRuleStructured {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 10px 11px 11px;
  border: 1px solid var(--shell-border);
  border-radius: 12px;
  background: var(--shell-panel-soft, #f0f4f1);
  min-inline-size: 0;
}

.adminRuleFieldCard > legend,
.adminRuleTriState > legend,
.adminRuleStructured > legend {
  float: none;
  width: auto;
  margin: 0;
  padding: 0;
  color: var(--shell-muted);
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1.2;
}

.adminRuleFieldValue {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.adminRuleStateInputs {
  display: none !important;
}

.adminRuleStateBar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 26px;
}

.adminRuleStateStatus {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  padding: 1px 7px;
  border-radius: 999px;
  background: rgba(15, 107, 99, 0.08);
  color: #315e50;
  font-size: 0.68rem;
  font-weight: 800;
  line-height: 1.2;
}

.adminRuleStateStatus[data-state="override"] {
  background: rgba(15, 107, 99, 0.14);
  color: var(--shell-accent);
}

.adminRuleStateStatus[data-state="explicit_empty"] {
  background: #fff9eb;
  color: #7a5a19;
}

.adminRuleStateActions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}

.adminRuleStateAction {
  margin: 0;
  font-size: 0.7rem;
}

.adminRuleDetailForm--items {
  gap: 8px;
}

.adminRuleDetailForm--items .adminRuleFieldCard,
.adminRuleDetailForm--items .adminRuleTriState,
.adminRuleDetailForm--items .adminRuleStructured {
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 8px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.adminRuleDetailForm--items .adminRuleFieldCard > legend,
.adminRuleDetailForm--items .adminRuleTriState > legend,
.adminRuleDetailForm--items .adminRuleStructured > legend {
  grid-column: 1;
  grid-row: 1;
  align-self: center;
  color: var(--shell-text);
  font-size: 0.72rem;
}

.adminRuleDetailForm--items .adminRuleFieldCard > .adminRuleStateInputs,
.adminRuleDetailForm--items .adminRuleTriState > .adminRuleStateInputs,
.adminRuleDetailForm--items .adminRuleStructured > .adminRuleStateInputs {
  display: none !important;
}

.adminRuleDetailForm--items .adminRuleFieldCard > .adminRuleStateBar,
.adminRuleDetailForm--items .adminRuleTriState > .adminRuleStateBar,
.adminRuleDetailForm--items .adminRuleStructured > .adminRuleStateBar {
  grid-column: 2;
  grid-row: 1;
  min-height: 18px;
}

.adminRuleDetailForm--items .adminRuleFieldCard > .adminRuleFieldValue,
.adminRuleDetailForm--items .adminRuleTriState > .adminRuleFieldValue,
.adminRuleDetailForm--items .adminRuleStructured > .adminRuleFieldValue {
  grid-column: 1 / -1;
  grid-row: 2;
  gap: 4px;
}

.adminRulePendingRestore > .adminRuleFieldValue {
  opacity: 0.55;
  pointer-events: none;
}

.adminRulePendingRestore > .adminRuleStateBar {
  padding-top: 2px;
}

.adminRuleGroupRestoreLocked > .adminRuleFieldValue {
  opacity: 0.55;
  pointer-events: none;
}

.adminRuleBindingGrid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.adminRuleBindingGrid > .adminRuleInlineNote {
  grid-column: 1 / -1;
}

.adminRuleOccupancyWindowGrid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.adminRuleDetailForm--items .adminRuleOccupancyWindows {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  padding: 0;
  border: 0;
  background: transparent;
}

.adminRuleDetailForm--items .adminRuleOccupancyWindows > .adminRuleStateBar {
  grid-column: 1 / -1;
  grid-row: 1;
  justify-content: flex-end;
}

.adminRuleDetailForm--items .adminRuleOccupancyWindows > .adminRuleFieldValue {
  grid-column: 1 / -1;
  grid-row: 2;
}

.adminRuleOccupancyWindowCard {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) minmax(84px, 104px);
  align-items: end;
  gap: 6px;
  min-width: 0;
  padding: 7px 8px;
  border: 1px solid var(--shell-border);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.76);
}

.adminRuleOccupancyWindowCard > strong {
  align-self: center;
  color: var(--shell-text);
  font-size: 0.76rem;
  font-weight: 850;
}

.adminRuleDerivedWritePlan {
  grid-column: 1 / -1;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
}

.adminRuleDerivedWritePlan > legend,
.adminRuleDerivedWritePlan > .adminRuleStateInputs,
.adminRuleDerivedWritePlan > .adminRuleStateBar {
  grid-column: 1 / -1;
}

.adminRuleDerivedWritePlan > .adminRuleFieldValue {
  grid-column: 1 / -1;
}

.adminRuleDerivedWritePlan .adminRuleInlineNote {
  padding-block: 6px;
}

.adminRuleDerivedWriteSummary {
  min-width: 0;
  color: var(--shell-accent);
  font-size: 0.78rem;
  line-height: 1.35;
}

.adminRuleDetailForm--items .adminRuleDerivedWritePlan {
  grid-column: auto;
  display: flex;
  align-items: flex-end;
  align-self: end;
  min-height: var(--shell-control-h, 32px);
  padding: 0 2px 7px;
  border: 0;
  background: transparent;
}

.adminRuleDetailForm--items .adminRuleDerivedWritePlan > legend,
.adminRuleDetailForm--items .adminRuleDerivedWritePlan > .adminRuleStateInputs {
  display: none !important;
}

.adminRuleDetailForm--items .adminRuleDerivedWritePlan > .adminRuleFieldValue {
  display: block;
}

.adminRuleAdvancedSettings {
  grid-column: 1 / -1;
  overflow: hidden;
  border: 1px solid var(--shell-border);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.72);
}

.adminRuleAdvancedSettings > summary {
  padding: 8px 10px;
  color: var(--shell-muted);
  font-size: 0.72rem;
  font-weight: 800;
  cursor: pointer;
  list-style-position: inside;
}

.adminRuleAdvancedSettings[open] > summary {
  border-bottom: 1px solid var(--shell-border);
}

.adminRuleAdvancedSettingsBody {
  display: grid;
  gap: 8px;
  padding: 10px;
}

.adminRuleTriStateChoices {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  padding: 3px;
  border: 1px solid var(--shell-border);
  border-radius: 10px;
  background: #fff;
}

.adminRuleTriStateChoice {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  min-height: 30px;
  padding: 0.28rem 0.3rem;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--shell-muted);
  font-size: 0.7rem;
  font-weight: 700;
  line-height: 1.15;
  text-align: center;
  cursor: pointer;
}

.adminRuleTriStateChoice:has(input:checked) {
  background: rgba(15, 107, 99, 0.12);
  color: #0f6b63;
  box-shadow: inset 0 0 0 1px rgba(15, 107, 99, 0.28);
}

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

.adminRuleDetailEyebrow {
  margin: 0 0 4px;
  color: var(--shell-muted);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0;
}

.bookingRulesDetail .adminRuleDetailHead h3 {
  margin: 0;
  color: var(--shell-text);
  font-size: 1rem;
  font-weight: 800;
  line-height: 1.35;
  word-break: break-word;
}

.adminRuleWritePlanPreview {
  margin: 0;
  padding: 8px 10px;
  border-radius: 9px;
  background: #fff;
  border: 1px solid var(--shell-border);
  color: var(--shell-text);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  white-space: normal;
  word-break: break-word;
}

.bookingRulesToolbarActions,
.bookingRulesMatrixHead {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
}

.adminRuleDetailActions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 -14px -14px;
  padding: 12px 14px;
  border-top: 1px solid var(--shell-border);
  background: #fff;
}

.bookingRulesDialogBody > .bookingRulesDetail .adminRuleDetailActions {
  margin: 0;
  padding: 12px 0 0;
}

.bookingRulesDialogBody .adminRuleDetailHead,
.bookingRulesDialogBody .adminRuleDetailHead > [data-booking-rules-action="close-detail"] {
  display: none;
}

.adminRuleDetailActions .shellBtn {
  flex: 1 1 auto;
  justify-content: center;
}

.bookingRulesPager {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--shell-muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.bookingRulesPager input[type="number"],
.bookingRulesPager select {
  box-sizing: border-box;
  min-height: 30px;
  height: 30px;
  margin: 0;
  padding: 0 0.55rem;
  border: 1px solid var(--shell-border);
  border-radius: var(--shell-control-radius, 9px);
  background: #fff;
  color: var(--shell-text);
  font: inherit;
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1.2;
  appearance: none;
  -webkit-appearance: none;
}

.bookingRulesPager input[type="number"] {
  width: 3.2rem;
  text-align: center;
  /* hide native spinners so height matches buttons */
  -moz-appearance: textfield;
}

.bookingRulesPager input[type="number"]::-webkit-outer-spin-button,
.bookingRulesPager input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.bookingRulesPager select {
  min-width: 7.5rem;
  padding-right: 1.7rem;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--shell-muted) 50%),
    linear-gradient(135deg, var(--shell-muted) 50%, transparent 50%);
  background-position:
    calc(100% - 14px) 12px,
    calc(100% - 9px) 12px;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  cursor: pointer;
}

.bookingRulesPager input[type="number"]:focus,
.bookingRulesPager select:focus {
  outline: none;
  border-color: rgba(15, 107, 99, 0.55);
  box-shadow: 0 0 0 3px rgba(15, 107, 99, 0.12);
}

.bookingRulesPager .shellBtn--sm {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.bookingRulesCrumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 8px;
  padding: 8px 10px;
  border: 1px solid var(--shell-border);
  border-radius: 10px;
  background: rgba(15, 107, 99, 0.05);
  color: var(--shell-muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.bookingRulesTableWrap {
  max-width: 100%;
  overflow: auto;
  border: 1px solid var(--shell-border);
  border-radius: 12px;
  background: #fff;
}

#bookingRulesPanel-items > .bookingRulesTableWrap {
  max-height: min(72vh, calc(100vh - 280px));
}

.bookingRulesTable {
  width: 100%;
  min-width: 0;
  table-layout: auto;
}

.bookingRulesTable[data-booking-rules-table="releases"],
.bookingRulesTable[data-booking-rules-table="templates"] {
  min-width: 920px;
}

.bookingRulesTable th,
.bookingRulesTable td {
  height: 40px;
  padding: 6px 9px;
  font-size: 0.82rem;
  line-height: 1.25;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.bookingRulesTable th {
  white-space: nowrap;
}

.bookingRulesTable[data-booking-rules-table="items"][data-booking-rules-items-view="family"] {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
}

.bookingRulesTable[data-booking-rules-table="items"][data-booking-rules-items-view="family"]
  > :is(thead, tbody) > tr > :is(th, td):first-child {
  width: 18%;
}

.bookingRulesTable[data-booking-rules-table="items"][data-booking-rules-items-view="family"]
  > :is(thead, tbody) > tr > :is(th, td):is(:nth-child(2), :nth-child(3)) {
  width: 68px;
}

.bookingRulesTable[data-booking-rules-table="items"][data-booking-rules-items-view="family"]
  > :is(thead, tbody) > tr > :is(th, td):nth-child(4) {
  width: 27%;
}

.bookingRulesTable[data-booking-rules-table="items"][data-booking-rules-items-view="family"]
  > :is(thead, tbody) > tr > :is(th, td):nth-child(5) {
  width: 19%;
}

.bookingRulesTable[data-booking-rules-table="items"][data-booking-rules-items-view="family"]
  > :is(thead, tbody) > tr > :is(th, td):nth-child(6) {
  width: 64px;
}

.bookingRulesTable[data-booking-rules-table="items"][data-booking-rules-items-view="family"]
  > :is(thead, tbody) > tr > :is(th, td):last-child {
  width: 118px;
  white-space: normal;
}

.bookingRulesTable[data-booking-rules-table="items"][data-booking-rules-items-view="family"]
  > tbody > tr:not(.bookingRulesStoreColumnsRow) > .bookingRulesActionCell .btnLink {
  margin-left: 6px;
  font-size: 0.76rem;
}

.bookingRulesTable[data-booking-rules-table="items"][data-booking-rules-items-view="family"]
  > tbody > tr:not(.bookingRulesStoreColumnsRow) > .bookingRulesActionCell .btnLink:first-child {
  margin-left: 0;
}

.bookingRulesTable[data-booking-rules-table="items"][data-booking-rules-items-view="family"]
  > :is(thead, tbody) > tr > :is(th, td):is(:nth-child(1), :nth-child(4), :nth-child(5)) {
  white-space: normal;
  overflow-wrap: anywhere;
}

.bookingRulesTable[data-booking-rules-table="items"][data-booking-rules-items-view="item"] {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
}

.bookingRulesTable[data-booking-rules-table="items"][data-booking-rules-items-view="item"]
  > :is(thead, tbody) > tr > :is(th, td):first-child {
  width: 40%;
}

.bookingRulesTable[data-booking-rules-table="items"][data-booking-rules-items-view="item"]
  > :is(thead, tbody) > tr > :is(th, td):nth-child(2) {
  width: 20%;
}

.bookingRulesTable[data-booking-rules-table="items"][data-booking-rules-items-view="item"]
  > :is(thead, tbody) > tr > :is(th, td):nth-child(3) {
  width: 18%;
  min-width: 7.5rem;
}

.bookingRulesTable[data-booking-rules-table="items"][data-booking-rules-items-view="item"]
  > :is(thead, tbody) > tr > :is(th, td):nth-child(4) {
  width: 62px;
}

.bookingRulesTable[data-booking-rules-table="items"][data-booking-rules-items-view="item"]
  > :is(thead, tbody) > tr > :is(th, td):last-child {
  width: 82px;
}

.bookingRulesTable[data-booking-rules-table="items"][data-booking-rules-items-view="item"]
  > :is(thead, tbody) > tr > :is(th, td):is(:nth-child(1), :nth-child(2), :nth-child(3)) {
  white-space: normal;
  overflow-wrap: anywhere;
}

.bookingRulesTable[data-booking-rules-table="stores"] {
  width: 100%;
  min-width: 720px;
  table-layout: fixed;
}

.bookingRulesTable[data-booking-rules-table="stores"]
  > :is(thead, tbody) > tr > :is(th, td):first-child {
  width: 27%;
}

.bookingRulesTable[data-booking-rules-table="stores"]
  > :is(thead, tbody) > tr > :is(th, td):nth-child(2) {
  width: 12%;
}

.bookingRulesTable[data-booking-rules-table="stores"]
  > :is(thead, tbody) > tr > :is(th, td):nth-child(3) {
  width: 25%;
}

.bookingRulesTable[data-booking-rules-table="stores"]
  > :is(thead, tbody) > tr > :is(th, td):is(:nth-child(4), :nth-child(5)) {
  width: 12%;
}

.bookingRulesTable[data-booking-rules-table="stores"]
  > :is(thead, tbody) > tr > :is(th, td):last-child {
  width: 112px;
}

.bookingRulesStoreItemMetric {
  display: grid;
  gap: 2px;
  white-space: normal;
}

.bookingRulesStoreItemMetric strong {
  color: var(--shell-text);
  font-size: 0.82rem;
}

.bookingRulesStoreItemMetric small {
  color: var(--shell-muted);
  font-size: 0.7rem;
  font-weight: 700;
}

.bookingRulesStoreAssociationSwitch {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  min-height: 30px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--shell-muted);
  font: inherit;
  font-size: 0.76rem;
  font-weight: 800;
  cursor: pointer;
}

.bookingRulesStoreAssociationTrack {
  position: relative;
  width: 32px;
  height: 18px;
  border-radius: 999px;
  background: #b8c8c1;
  transition: background 0.16s ease;
}

.bookingRulesStoreAssociationTrack::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px rgba(20, 35, 31, 0.2);
  transition: transform 0.16s ease;
}

.bookingRulesStoreAssociationSwitch.is-active {
  color: var(--shell-accent);
}

.bookingRulesStoreAssociationSwitch.is-active .bookingRulesStoreAssociationTrack {
  background: var(--shell-accent);
}

.bookingRulesStoreAssociationSwitch.is-active .bookingRulesStoreAssociationTrack::after {
  transform: translateX(14px);
}

.bookingRulesStoreAssociationSwitch:focus-visible {
  outline: 3px solid rgba(15, 107, 99, 0.16);
  outline-offset: 3px;
  border-radius: 999px;
}

.bookingRulesStoreAssociationSwitch:disabled {
  opacity: 0.55;
  cursor: wait;
}

.bookingRulesRuleSummary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  min-width: 0;
}

.bookingRulesRuleSummaryTag {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 2px 7px;
  border: 1px solid rgba(15, 107, 99, 0.14);
  border-radius: 999px;
  background: rgba(15, 107, 99, 0.07);
  color: #315d57;
  font-size: 0.74rem;
  font-weight: 750;
  line-height: 1.15;
  white-space: nowrap;
}

.bookingRulesRuleSummarySeparator {
  display: none;
}

.bookingRulesTable thead th {
  position: sticky;
  top: 0;
  z-index: 3;
  background: #f6f8f7;
}

.bookingRulesActionCell {
  width: 1%;
  min-width: 9.5rem;
  white-space: nowrap;
  text-align: right;
  overflow: visible;
}

.bookingRulesActionCell .btnLink {
  display: inline-block;
  margin-left: 8px;
  white-space: nowrap;
  vertical-align: middle;
}

/* 门店行操作列：「营业时间」按钮 + 启停开关水平对齐、间距一致 */
.bookingRulesStoreActionCell {
  min-width: 13rem;
}

.bookingRulesStoreActionCell > * {
  vertical-align: middle;
}

.bookingRulesStoreActionCell > .shellBtn {
  margin-right: 12px;
}

.bookingRulesActionCell .btnLink:first-child {
  margin-left: 0;
}

.bookingRulesStatusCell { font-weight: 800; white-space: nowrap; }

.bookingRulesResourceDirectory {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.bookingRulesResourceDirectoryControls {
  display: flex;
  align-items: end;
  flex-wrap: wrap;
  gap: 8px;
}

.bookingRulesResourceDirectoryControls .bookingRulesSearch {
  flex: 1 1 300px;
  min-width: min(300px, 100%);
}

.bookingRulesResourceDirectoryControls .bookingRulesFilter {
  flex: 0 1 220px;
}

.bookingRulesResourceDirectoryControls .bookingRulesTotal {
  margin-left: auto;
  align-self: center;
  white-space: nowrap;
}

.bookingRulesResourceDirectoryTableWrap {
  max-height: min(64vh, 620px);
  overflow: auto;
  border: 1px solid var(--shell-border);
  border-radius: 10px;
}

.bookingRulesResourceDirectoryTable.bookingRulesTable {
  width: 100%;
  min-width: 820px;
  table-layout: fixed;
}

.bookingRulesResourceDirectoryTable.bookingRulesTable th,
.bookingRulesResourceDirectoryTable.bookingRulesTable td {
  height: 36px;
  padding-top: 5px;
  padding-bottom: 5px;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.bookingRulesResourceDirectoryTable thead th {
  position: sticky;
  top: 0;
  z-index: 2;
}

.bookingRulesResourceDirectoryName {
  display: table-cell;
  vertical-align: middle;
}

.bookingRulesResourceDirectoryName > strong,
.bookingRulesResourceDirectoryName > .bookingRulesResourceDirectoryId {
  display: block;
}

.bookingRulesResourceDirectoryId {
  font-size: 0.69rem;
  font-weight: 600;
}

.bookingRulesResourceDirectoryColumns {
  max-width: 360px;
  white-space: normal;
}

.bookingRulesResourceDirectoryTable th:first-child,
.bookingRulesResourceDirectoryTable td:first-child {
  width: 25%;
}

.bookingRulesResourceDirectoryTable th:nth-child(2),
.bookingRulesResourceDirectoryTable td:nth-child(2) {
  width: 18%;
}

.bookingRulesResourceDirectoryTable th:nth-child(3),
.bookingRulesResourceDirectoryTable td:nth-child(3) {
  width: 31%;
}

.bookingRulesResourceDirectoryTable th:nth-child(4),
.bookingRulesResourceDirectoryTable td:nth-child(4) {
  width: 18%;
}

.bookingRulesResourceDirectoryTable th:last-child,
.bookingRulesResourceDirectoryTable td:last-child {
  width: 68px;
}

.bookingRulesAppointmentColumnsInfo {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  padding: 9px 12px;
  border: 1px solid var(--shell-border);
  border-radius: 10px;
  background: var(--shell-panel-soft, #f0f4f1);
  color: var(--shell-muted);
  font-size: 0.76rem;
  line-height: 1.35;
}

.bookingRulesAppointmentColumnsInfo strong {
  flex: 0 0 auto;
  color: var(--shell-text);
}

.bookingRulesAppointmentColumnsTableWrap {
  max-height: min(72vh, 760px);
  overflow: auto;
  border: 1px solid var(--shell-border);
  border-radius: 10px;
}

.bookingRulesAppointmentColumnsTable.bookingRulesTable {
  width: 100%;
  min-width: 720px;
  table-layout: fixed;
}

.bookingRulesAppointmentColumnsTable th,
.bookingRulesAppointmentColumnsTable td {
  height: 42px;
  padding: 7px 10px;
  white-space: normal;
  overflow-wrap: anywhere;
}

.bookingRulesAppointmentColumnsTable th:first-child,
.bookingRulesAppointmentColumnsTable td:first-child { width: 24%; }
.bookingRulesAppointmentColumnsTable th:nth-child(2),
.bookingRulesAppointmentColumnsTable td:nth-child(2) { width: 18%; }
.bookingRulesAppointmentColumnsTable th:nth-child(3),
.bookingRulesAppointmentColumnsTable td:nth-child(3) { width: 14%; }
.bookingRulesAppointmentColumnsTable th:nth-child(4),
.bookingRulesAppointmentColumnsTable td:nth-child(4) { width: 36%; }
.bookingRulesAppointmentColumnsTable th:last-child,
.bookingRulesAppointmentColumnsTable td:last-child { width: 88px; }

.bookingRulesAppointmentColumnName > :is(strong, small) {
  display: block;
}

.bookingRulesAppointmentColumnName small {
  margin-top: 2px;
  color: var(--shell-muted);
  font-size: 0.66rem;
}

.bookingRulesAppointmentColumnState,
.bookingRulesAppointmentColumnTag,
.bookingRulesAppointmentColumnTransitionBadge {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.69rem;
  font-style: normal;
  font-weight: 800;
  line-height: 1.2;
}

.bookingRulesAppointmentColumnState--synced,
.bookingRulesAppointmentColumnTag {
  background: rgba(15, 107, 99, 0.1);
  color: #315e50;
}

.bookingRulesAppointmentColumnState--pending,
.bookingRulesAppointmentColumnTag--transition,
.bookingRulesAppointmentColumnTransitionBadge {
  background: #fff4df;
  color: #7a5a19;
}

.bookingRulesAppointmentColumnState--closed {
  background: rgba(83, 99, 95, 0.1);
  color: var(--shell-muted);
}

.bookingRulesAppointmentColumnSourceState > * {
  margin: 2px 5px 2px 0;
}

.bookingRulesAppointmentColumnAssociations {
  display: table-cell;
}

.bookingRulesAppointmentColumnAssociations > * {
  margin: 2px 5px 2px 0;
}

.bookingRulesAppointmentColumnEmpty {
  color: var(--shell-muted);
}

.bookingRulesAppointmentColumnEditorSummary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.bookingRulesAppointmentColumnEditorSummary > div {
  display: grid;
  gap: 4px;
  padding: 12px 14px;
  border: 1px solid var(--shell-border);
  border-radius: 10px;
  background: var(--shell-panel-soft, #f0f4f1);
}

.bookingRulesAppointmentColumnEditorSummary span {
  color: var(--shell-muted);
  font-size: 0.72rem;
  font-weight: 750;
}

.bookingRulesAppointmentColumnEditorNote {
  margin: 10px 0;
}

.bookingRulesAppointmentColumnResourceEditor {
  min-width: 0;
  margin: 0;
  padding: 12px;
  border: 1px solid var(--shell-border);
  border-radius: 10px;
}

.bookingRulesAppointmentColumnResourceEditor legend {
  padding: 0 6px;
  font-weight: 850;
}

.bookingRulesAppointmentColumnResourceList {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.bookingRulesAppointmentColumnResourceOption {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--shell-border);
  border-radius: 9px;
  background: #fff;
  cursor: pointer;
}

.bookingRulesAppointmentColumnResourceOption > span,
.bookingRulesAppointmentColumnResourceOption > span > :is(strong, small) {
  display: block;
  min-width: 0;
}

.bookingRulesAppointmentColumnResourceOption small {
  margin-top: 2px;
  color: var(--shell-muted);
  font-size: 0.66rem;
  overflow-wrap: anywhere;
}

.bookingRulesAppointmentColumnTransitionNote {
  margin: 10px 0 0;
  padding: 9px 12px;
  border-radius: 9px;
  background: #fff9eb;
  color: #7a5a19;
  font-size: 0.73rem;
}

.bookingRulesFamilyName {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  white-space: normal;
}

.bookingRulesFamilyNameText {
  min-width: 0;
  overflow-wrap: anywhere;
}

.bookingRulesItemRowToggle {
  display: inline-grid;
  width: 22px;
  height: 22px;
  padding: 0;
  place-items: center;
  border: 1px solid var(--shell-border);
  border-radius: 6px;
  background: #fff;
  color: var(--shell-accent);
  font: inherit;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
}

.bookingRulesItemRowToggle[aria-expanded="true"] {
  border-color: rgba(15, 107, 99, 0.35);
  background: rgba(15, 107, 99, 0.08);
}

.bookingRulesStoreColumnsCell {
  height: auto !important;
  padding: 0 !important;
  border-top: 0 !important;
  background: var(--shell-panel-soft, #f0f4f1);
  white-space: normal !important;
}

.bookingRulesStoreColumnsInset {
  padding: 7px 10px 9px 20px;
}

.bookingRulesFamilyCanonicalCoverage {
  margin: 0 0 8px;
  padding: 6px 8px;
  border-radius: 8px;
  background: #edf4f1;
  color: var(--shell-text);
  font-size: 0.78rem;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.bookingRulesStoreColumnsTable {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
  border: 1px solid var(--shell-border);
  border-collapse: separate;
  border-spacing: 0;
  border-radius: 9px;
  overflow: hidden;
  background: #fff;
}

.bookingRulesStoreColumnsTable th,
.bookingRulesStoreColumnsTable td {
  height: 34px;
  padding: 5px 8px;
  border-bottom: 1px solid var(--shell-border);
  font-size: 0.76rem;
  line-height: 1.25;
  text-align: left;
  vertical-align: middle;
  white-space: normal;
}

.bookingRulesStoreColumnsTable thead th {
  position: static;
  z-index: auto;
  background: #edf4f1;
  color: var(--shell-muted);
  font-weight: 800;
}

.bookingRulesStoreColumnsTable tbody tr:last-child td {
  border-bottom: 0;
}

.bookingRulesStoreColumnsTable th:first-child,
.bookingRulesStoreColumnsTable td:first-child {
  width: 28%;
}

.bookingRulesStoreColumnsTable th:nth-child(2),
.bookingRulesStoreColumnsTable td:nth-child(2) {
  width: 32%;
}

.bookingRulesStoreColumnsTable th:nth-child(3),
.bookingRulesStoreColumnsTable td:nth-child(3) {
  width: 24%;
}

.bookingRulesStoreColumnsTable th:last-child,
.bookingRulesStoreColumnsTable td:last-child {
  width: 16%;
  text-align: right;
}

.bookingRulesStoreName,
.bookingRulesStoreOperatorDoctors {
  font-weight: 800;
}

.bookingRulesStoreOperatorDoctors {
  color: var(--shell-text);
  overflow-wrap: anywhere;
}

.bookingRulesStoreOperatorDoctors--pending {
  color: #7a5a19;
}

.bookingRulesStoreOperatorDoctors--notApplicable {
  color: var(--shell-muted);
}

.bookingRulesStoreName > :is(strong, span) {
  display: block;
}

.bookingRulesStoreItemCount {
  margin-top: 3px;
  color: var(--shell-muted);
  font-size: 0.68rem;
  font-weight: 700;
}

.bookingRulesOrganizationState {
  width: fit-content;
  margin-top: 4px;
  padding: 2px 7px;
  border-radius: 999px;
  background: #f1f3f2;
  color: var(--shell-muted);
  font-size: 0.66rem;
  font-weight: 850;
}

.bookingRulesOrganizationState--classified {
  background: rgba(15, 107, 99, 0.1);
  color: #315e50;
}

.bookingRulesOrganizationState--items_pending_adoption,
.bookingRulesOrganizationState--store_pending_adoption {
  background: #fff4df;
  color: #7a5a19;
}

.bookingRulesOrganizationState--sync_error {
  background: #fff0ed;
  color: #a3462f;
}

.bookingRulesRuleApplicability {
  display: block;
  margin-bottom: 3px;
  color: var(--shell-muted);
  font-size: 0.67rem;
  font-weight: 800;
}

.bookingRulesRuleApplicability--active {
  color: #315e50;
}

.bookingRulesStoreEffectiveRule {
  color: var(--shell-text);
  font-weight: 750;
}

.bookingRulesStoreEffectiveRuleText {
  display: block;
}

.bookingRulesItemExceptionNote {
  display: inline-flex;
  margin-top: 5px;
  padding: 2px 7px;
  border-radius: 999px;
  background: #fff4df;
  color: #7a5a19;
  font-size: 0.66rem;
  font-weight: 800;
}

.bookingRulesConfigurationState--complete {
  color: #315e50;
}

.bookingRulesConfigurationState--pending {
  color: #7a5a19;
}

.bookingRulesConfigurationState--warning {
  color: #a3462f;
}

.bookingRulesConfigurationState--neutral,
.bookingRulesEmptyMapping,
.bookingRulesEmptyStoreColumns {
  color: var(--shell-muted);
}

.bookingRulesMappedColumnsList {
  display: grid;
  gap: 4px;
}

.bookingRulesMappedColumn {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
  min-width: 0;
}

.bookingRulesMappedResourceName {
  color: var(--shell-muted);
  font-weight: 700;
}

.bookingRulesMappedResourceName::after {
  content: "→";
  margin-left: 5px;
  color: var(--shell-muted);
}

.bookingRulesMappedColumnName {
  color: var(--shell-text);
  font-weight: 800;
}

.bookingRulesMappingState {
  display: inline-flex;
  align-items: center;
  min-height: 19px;
  padding: 1px 6px;
  border-radius: 999px;
  background: #f1f3f2;
  color: var(--shell-muted);
  font-size: 0.68rem;
  font-weight: 800;
  white-space: nowrap;
}

.bookingRulesMappingEvidence {
  display: inline-flex;
  align-items: center;
  min-height: 19px;
  padding: 1px 6px;
  border-radius: 999px;
  background: #fff4df;
  color: #7a5a19;
  font-size: 0.66rem;
  font-weight: 800;
}

.bookingRulesStoreColumnsAction {
  white-space: normal;
}

.bookingRulesStoreColumnsAction .btnLink {
  margin-left: 7px;
  font-size: 0.72rem;
}

.bookingRulesStoreColumnsAction .btnLink:first-child {
  margin-left: 0;
}

.bookingRulesMappingState--active {
  background: rgba(15, 107, 99, 0.1);
  color: #315e50;
}

.bookingRulesMappingState--transition {
  background: #fff9eb;
  color: #7a5a19;
}

.bookingRulesMappingState--disabled {
  background: #f1f3f2;
  color: var(--shell-muted);
}

/* 人员表：角色列易被长角色串撑开，固定布局并截断 */
.bookingRulesTable[data-booking-rules-table="people"] {
  table-layout: fixed;
  min-width: 920px;
  width: 100%;
}
.bookingRulesTable[data-booking-rules-table="people"] th:nth-child(1),
.bookingRulesTable[data-booking-rules-table="people"] td:nth-child(1) { width: 22%; } /* 人员 */
.bookingRulesTable[data-booking-rules-table="people"] th:nth-child(2),
.bookingRulesTable[data-booking-rules-table="people"] td:nth-child(2) { width: 8rem; max-width: 8rem; } /* 角色 */
.bookingRulesTable[data-booking-rules-table="people"] th:nth-child(3),
.bookingRulesTable[data-booking-rules-table="people"] td:nth-child(3) { width: 22%; } /* 所属门店 */
.bookingRulesTable[data-booking-rules-table="people"] th:nth-child(4),
.bookingRulesTable[data-booking-rules-table="people"] td:nth-child(4) { width: 7rem; } /* 状态（在职） */
.bookingRulesTable[data-booking-rules-table="people"] th:nth-child(5),
.bookingRulesTable[data-booking-rules-table="people"] td:nth-child(5) { width: 10rem; } /* 操作 */

.bookingRulesPeopleHint,
.bookingRulesToolbarHint {
  margin: 0;
  flex: 1 1 100%;
  font-size: 0.72rem;
  line-height: 1.35;
  color: var(--shell-muted, #64748b);
}

.bookingRulesToolbarHint {
  max-width: 100%;
}
.bookingRulesTable[data-booking-rules-table="people"] .bookingRulesRoleCell,
.bookingRulesTable[data-booking-rules-table="people"] .bookingRulesStableIdCell {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.adminRuleDetailHead,
.adminRuleSourceChain,
.adminRuleDiffList,
.adminRulePublishForm,
.adminRuleCheckboxList {
  display: grid;
  gap: 8px;
}

.adminRuleDetailHead {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 10px;
}

.adminRuleSourceChain {
  margin: 0;
  padding: 10px 11px;
  border: 1px solid var(--shell-border);
  border-radius: 12px;
  background: var(--shell-panel-soft, #f0f4f1);
}

.adminRuleSourceChain > strong {
  color: var(--shell-muted);
  font-size: 0.72rem;
  font-weight: 800;
}

.adminRuleSourceChain > div {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.adminRuleSourceChain .tag {
  margin: 0;
  border: 1px solid rgba(15, 107, 99, 0.16);
  background: #fff;
}

.adminRuleContextSummary {
  display: grid;
  grid-template-columns: repeat(2, minmax(150px, auto)) minmax(240px, 1fr);
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--shell-border);
  border-radius: 11px;
  background: var(--shell-border);
}

.adminRuleContextSummary--compact {
  grid-template-columns: max-content max-content minmax(220px, 1fr);
  border-radius: 9px;
}

.adminRuleContextSummary--compact .adminRuleContextFact {
  padding: 6px 9px;
}

.adminRuleContextSummary--compact .adminRuleContextFact--source strong {
  font-family: inherit;
  font-size: inherit;
}

.adminRuleContextFact {
  min-width: 0;
  padding: 8px 10px;
  background: var(--shell-panel-soft, #f0f4f1);
  color: var(--shell-muted);
  font-size: 0.72rem;
  line-height: 1.35;
}

.adminRuleContextFact strong {
  color: var(--shell-text);
  font-weight: 800;
  overflow-wrap: anywhere;
}

.adminRuleContextFact--source {
  min-width: 0;
}

.adminRuleContextFact--source strong {
  color: var(--shell-accent);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.69rem;
}

.adminRuleEditorSection {
  display: grid;
  gap: 6px;
}

.adminRuleEditorSection + .adminRuleEditorSection,
.adminRuleEditorSection + .adminRuleRelationSection {
  margin-top: 0;
  padding-top: 9px;
  border-top: 1px solid var(--shell-border);
}

.adminRuleEditorSectionHead {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px 8px;
}

.adminRuleEditorSectionHead h4,
.adminRuleEditorSectionHead p {
  margin: 0;
}

.adminRuleEditorSectionHead h4 {
  color: var(--shell-text);
  font-size: 0.82rem;
  font-weight: 900;
}

.adminRuleEditorSectionHead p {
  color: var(--shell-muted);
  font-size: 0.72rem;
  line-height: 1.35;
}

.adminRuleEditorSectionBody {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.adminRuleEditorSection--two .adminRuleEditorSectionBody {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.adminRuleEditorSection--three .adminRuleEditorSectionBody {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.adminRuleEditorSection--booking .adminRuleEditorSectionBody {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.adminRuleEditorSection--booking {
  position: relative;
}

.adminRuleEditorSection--booking .adminRuleAppointmentModeField > .adminRuleStateBar {
  position: absolute;
  top: -1px;
  right: 0;
  z-index: 1;
  width: max-content;
  min-width: max-content;
  white-space: nowrap;
}

.adminRuleEditorSection--booking .adminRuleAppointmentModeField > .adminRuleStateBar .adminRuleStateActions {
  flex-wrap: nowrap;
}

.adminRuleAppointmentModeField,
.adminRuleAllowedDurationsField {
  grid-column: span 2;
}

.adminRuleFullWidthField {
  grid-column: 1 / -1;
}

.adminRuleEditorSectionBody > * {
  min-width: 0;
}

.adminRuleInlineNote,
.adminRuleBlockingNote {
  margin: 0;
  padding: 6px 8px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: #fff;
  color: var(--shell-muted);
  font-size: 0.72rem;
  line-height: 1.35;
}

.adminRuleBindingSection,
.adminRuleRelationSection,
.adminRuleCheckSection {
  display: grid;
  gap: 8px;
}

.adminRuleFamilyStoreResourceList {
  display: grid;
  gap: 14px;
}

.adminRuleFamilyStoreResource {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--shell-border);
  border-radius: 14px;
  background: var(--shell-panel-soft, #f7faf8);
}

.adminRuleFamilyStoreResourceHead {
  display: grid;
  gap: 2px;
}

.adminRuleFamilyStoreResourceHead h3 {
  margin: 0;
  color: var(--shell-text);
  font-size: 0.96rem;
  line-height: 1.35;
}

.adminRuleFamilyStoreResourceEditor {
  min-width: 0;
}

.adminRuleFamilyStoreEmpty {
  padding: 18px;
  border-style: dashed;
  text-align: center;
}

.adminRuleBindingSection > strong,
.adminRuleRelationSection > strong,
.adminRuleCheckSection > strong {
  color: var(--shell-muted);
  font-size: 0.72rem;
  font-weight: 800;
}

.adminRuleBindingList {
  display: grid;
  gap: 8px;
}

.adminRuleBindingRow {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 10px 11px 11px;
  border: 1px solid var(--shell-border);
  border-radius: 12px;
  background: var(--shell-panel-soft, #f0f4f1);
}

.adminRuleMiniField {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.adminRuleMiniField > span {
  color: var(--shell-muted);
  font-size: 0.68rem;
  font-weight: 800;
  line-height: 1.2;
}

.adminRuleMiniField--wide {
  grid-column: 1 / -1;
}

.adminRuleBindingWrite {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: var(--shell-control-h, 32px);
  padding: 0.3rem 0.65rem;
  border: 1px solid var(--shell-border);
  border-radius: var(--shell-control-radius, 8px);
  background: #fff;
  color: var(--shell-text);
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
}

.adminRuleBindingWrite input {
  width: auto !important;
  min-height: 0 !important;
  margin: 0;
  padding: 0 !important;
  accent-color: #0f6b63;
  appearance: auto !important;
  -webkit-appearance: auto !important;
}

.adminRuleBindingDelete {
  grid-column: 1 / -1;
  justify-self: end;
  margin: 0;
  color: var(--shell-danger, #c2413d);
}

.adminRuleRelationList {
  display: grid;
  gap: 6px;
}

.adminRuleRelationRow {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border: 1px solid var(--shell-border);
  border-radius: 10px;
  background: #fff;
  font-size: 0.8rem;
  font-weight: 600;
}

.adminRuleRelationRow select,
.adminRuleRelationRow input {
  width: auto;
  min-width: 96px;
}

.adminRuleRelationSection:not(:has(.adminRuleRelationRow))::after {
  content: "暂无可配置对象（待睿美云实体同步）";
  padding: 8px 10px;
  border: 1px dashed var(--shell-border);
  border-radius: 9px;
  color: var(--shell-faint, #8a9893);
  font-size: 0.76rem;
}

.bookingRulesDetail .adminRuleInlineNote {
  border-color: var(--shell-border);
}

.adminRuleBlockingNote {
  border: 1px solid rgba(184, 67, 67, 0.25);
  background: #fff5f3;
  color: #9b312e;
}

/* tri-state layout defined with adminRuleFieldCard above */

.bookingRulesPreviewSummary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}

.bookingRulesPreviewMetric,
.bookingRulesIssue,
.bookingRulesMatrixSection {
  border: 1px solid var(--shell-border);
  border-radius: 10px;
  background: #fff;
}

.bookingRulesPreviewMetric {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 10px;
}

.bookingRulesPreviewMetric > span {
  color: var(--shell-muted);
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.2;
}

.bookingRulesPreviewMetric > strong {
  font-size: 0.95rem;
  line-height: 1.2;
  white-space: nowrap;
}

.bookingRulesIssues {
  display: grid;
  gap: 6px;
  margin-top: 0;
  padding: 8px 10px;
  border: 1px solid var(--shell-border);
  border-radius: 10px;
  background: #fff;
}

.bookingRulesIssues > h3 {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.25;
}

.bookingRulesIssuesEmpty,
.bookingRulesIssues > .emptyCell {
  margin: 0;
  padding: 2px 0;
  text-align: left;
  font-size: 0.78rem;
  line-height: 1.35;
}

.bookingRulesIssue {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  padding: 8px;
}

.bookingRulesIssue[data-severity="blocker"] { border-left: 4px solid #b84343; }

.bookingRulesIssue p {
  margin: 2px 0 0;
  font-size: 0.78rem;
  line-height: 1.35;
}

.bookingRulesMatrixSection {
  margin-top: 0;
  padding: 8px 10px;
}

.bookingRulesMatrixHead {
  align-items: flex-start;
  gap: 6px;
  margin-bottom: 2px;
}

.bookingRulesMatrixHead > div:first-child {
  flex: 1 1 auto;
  min-width: 0;
}

.bookingRulesMatrixHead h3 {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.25;
}

.bookingRulesMatrixHead p {
  margin: 2px 0 0;
  color: var(--shell-muted);
  font-size: 0.72rem;
  line-height: 1.3;
}

.bookingRulesMatrixFilters {
  margin: 4px 0 6px;
  padding: 6px 8px;
}

.bookingRulesMatrixFilters .bookingRulesSearch {
  flex: 0 1 8.5rem;
  width: 8.5rem;
  max-width: 10rem;
  min-width: 0;
  gap: 2px;
  font-size: 0.68rem;
}

.bookingRulesMatrixFilters .bookingRulesSearch input {
  min-height: 30px;
  padding: 0.22rem 0.4rem;
  font-size: 0.74rem;
}

.bookingRulesMatrixViewport {
  position: relative;
  width: 100%;
  height: min(70vh, 820px);
  min-height: 420px;
  overflow: auto;
  border: 1px solid var(--shell-border);
  border-radius: 10px;
  background: #fff;
}

#bookingRulesPanel-preview {
  display: grid;
  gap: 8px;
  min-width: 0;
}

#bookingRulesPanel-preview > .adminRuleInlineNote {
  margin: 0;
  font-size: 0.74rem;
  line-height: 1.35;
}

#bookingRulesPanel-preview > [data-booking-rules-open-preview] {
  margin-top: 0;
}

.bookingRulesMatrixCanvas { position: relative; min-width: 100%; min-height: 100%; }

.bookingRulesMatrixCorner,
.bookingRulesMatrixColumn,
.bookingRulesMatrixRow,
.bookingRulesMatrixCell {
  position: absolute;
  box-sizing: border-box;
  overflow: hidden;
  border: 0 solid var(--shell-border);
  background: #fff;
  color: var(--shell-text);
  font: inherit;
  font-size: 0.76rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bookingRulesMatrixCorner {
  z-index: 8;
  width: 156px;
  height: 40px;
  padding: 11px 9px;
  border-right-width: 1px;
  border-bottom-width: 1px;
  background: #edf4f1;
  font-weight: 900;
}

.bookingRulesMatrixColumn {
  z-index: 6;
  height: 40px;
  padding: 11px 8px;
  border-right-width: 1px;
  border-bottom-width: 1px;
  background: #f3f7f5;
  font-weight: 800;
}

.bookingRulesMatrixRow {
  z-index: 5;
  width: 156px;
  padding: 10px 8px;
  border-right-width: 1px;
  border-bottom-width: 1px;
  background: #f8faf9;
  font-weight: 800;
}

.bookingRulesMatrixCell {
  z-index: 1;
  padding: 6px 7px;
  border-right-width: 1px;
  border-bottom-width: 1px;
  text-align: left;
  cursor: pointer;
}

.bookingRulesMatrixCellTags {
  display: flex;
  align-items: center;
  align-content: center;
  flex-wrap: wrap;
  gap: 4px;
  width: 100%;
  min-width: 0;
  max-height: 56px;
  overflow: hidden;
}

.bookingRulesMatrixCellTag {
  flex: 0 0 auto;
  max-width: 100%;
  margin: 0;
  padding: 1px 5px;
  overflow: hidden;
  appearance: none;
  border: 1px solid #cfe1da;
  border-radius: 999px;
  background: #eaf4f0;
  color: #315e50;
  font: inherit;
  font-size: 0.64rem;
  font-weight: 800;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
}

.bookingRulesMatrixCellTag[data-state="on"] {
  border-color: #b7d6ca;
  background: #e8f5ef;
  color: #1f6b57;
}

.bookingRulesMatrixCellTag[data-state="missing"] {
  border-color: #edd9a9;
  background: #fff5dd;
  color: #795918;
}

.bookingRulesMatrixCellTag[data-state="off"] {
  border-color: #f0c7c3;
  background: #fff1f0;
  color: #b42318;
}

.bookingRulesMatrixCellTag[data-state="family"] {
  border-color: #d4c4ee;
  background: #f3e8ff;
  color: #6b21a8;
}

.bookingRulesMatrixCell[data-state="error"] { background: #fff5f3; color: #9b312e; }
.bookingRulesMatrixCell[data-state="warning"] { background: #fff9eb; color: #7a5a19; }
.bookingRulesMatrixCell[data-state="missing"] { background: #f7f7f7; color: var(--shell-muted); }
.bookingRulesMatrixCell[data-state="loading"] { background: #fafcfc; color: var(--shell-muted); }
.bookingRulesMatrixCell[data-state="ready"] { background: #f4faf7; color: #315e50; }
.bookingRulesMatrixCell[data-booking="closed"] {
  background: #c5c8c9;
  color: #3f4543;
}
.bookingRulesMatrixCell[data-booking="closed"][data-state="error"] { background: #c3bdbd; }
.bookingRulesMatrixCell[data-booking="closed"][data-state="warning"] { background: #c7c2b6; }
.bookingRulesMatrixCell[data-changed="true"] { box-shadow: inset 3px 0 0 var(--shell-accent); }

.bookingRulesPanel :focus-visible {
  outline: 2px solid var(--shell-accent);
  outline-offset: 2px;
}

html.booking-rules-dialog-open,
body.booking-rules-dialog-open { overflow: hidden; }

.bookingRulesDialog[data-variant="detail"]:has(.adminRuleSimpleEditor) {
  width: min(1280px, 100%);
}

.adminRuleSimpleInternals[hidden] {
  display: none !important;
}

.adminRuleSimpleEditor {
  display: grid;
  grid-template-columns: minmax(360px, 0.88fr) minmax(480px, 1.12fr);
  gap: 12px;
  min-width: 0;
}

.adminRuleSimpleSettings,
.adminRuleOccupancyPreview {
  min-width: 0;
  border: 1px solid var(--shell-border);
  border-radius: 14px;
}

.adminRuleSimpleSettings {
  display: grid;
  align-content: start;
  gap: 10px;
  overflow: hidden;
  padding: 0 10px 10px;
  background: #f4f8f6;
}

.adminRuleSimpleSettings > .adminRuleSimplePaneHead {
  margin: 0 -10px;
}

.adminRuleOccupancyPreview {
  align-self: start;
  overflow: hidden;
  background: #f7faf8;
}

.adminRuleSimplePaneHead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--shell-border);
  background: #f4f8f6;
}

.adminRuleSimplePaneHead h4,
.adminRuleSimplePaneHead p {
  margin: 0;
}

.adminRuleSimplePaneHead h4 {
  color: var(--shell-text);
  font-size: 0.92rem;
  font-weight: 900;
}

.adminRuleSimplePaneHead p {
  margin-top: 2px;
  color: var(--shell-muted);
  font-size: 0.7rem;
  line-height: 1.35;
}

.adminRuleSimplePaneHead select {
  width: auto;
  min-width: 132px;
}

.adminRuleSimpleSection {
  display: grid;
  gap: 8px;
  min-width: 0;
  margin: 0;
  padding: 10px 11px 11px;
  border: 1px solid var(--shell-border);
  border-radius: 10px;
  background: #fff;
}

.adminRuleSimpleSection:last-child {
  border-bottom: 1px solid var(--shell-border);
}

.adminRuleSimpleSection > legend {
  float: none;
  width: 100%;
  margin: 0 0 1px;
  padding: 0 2px 2px;
  color: var(--shell-text);
  font-size: 0.78rem;
  font-weight: 900;
  line-height: 1.35;
}

.adminRuleSimpleModeOptions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.adminRuleSimpleModeOption {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 44px;
  padding: 6px 8px;
  border: 1px solid var(--shell-border);
  border-radius: 9px;
  background: #fff;
  color: var(--shell-text);
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1.25;
  text-align: center;
  cursor: pointer;
}

.adminRuleSimpleModeOption input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.adminRuleSimpleModeOption.isSelected {
  border-color: rgba(15, 107, 99, 0.55);
  background: rgba(15, 107, 99, 0.1);
  color: var(--shell-accent);
  box-shadow: inset 0 0 0 1px rgba(15, 107, 99, 0.12);
}

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

.adminRuleSimpleOccupancyCard {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(82px, 0.7fr);
  gap: 6px;
  align-items: end;
  min-width: 0;
  padding: 8px;
  border: 1px solid var(--shell-border);
  border-radius: 9px;
  background: #f8faf9;
}

.adminRuleSimpleOccupancyCard > strong {
  grid-column: 1 / -1;
  color: var(--shell-text);
  font-size: 0.72rem;
}

.adminRuleSimpleOccupancyCard select,
.adminRuleSimpleOccupancyCard input {
  min-width: 0;
  width: 100%;
}

.adminRuleSimpleOccupancyCard > .adminRuleSimpleMinutes {
  grid-column: 1 / -1;
}

.adminRuleSimpleOccupancyCard > .adminRuleSimpleMinutes[hidden] {
  display: none;
}

.adminRuleSimpleOccupancyCard > select:only-of-type {
  grid-column: 1 / -1;
}

.adminRuleSimpleMinutes {
  min-width: 0;
}

.adminRuleSimpleMinutes span {
  font-size: 0.66rem;
}

.adminRuleSimpleSectionHint {
  margin: 0;
  color: var(--shell-muted);
  font-size: 0.66rem;
  line-height: 1.4;
}

.adminRuleSimpleDoctors.isDisabled {
  background: #f5f7f6;
  color: var(--shell-muted);
}

.adminRuleSimpleDoctors.isDisabled .adminRuleSimpleDoctorList {
  opacity: 0.55;
}

.adminRuleSimpleResourceTools {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.adminRuleSimpleResourceTools input {
  min-width: 0;
  width: 100%;
}

.adminRuleSimpleSelectedCount,
.adminRulePreviewStoreLabel {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(15, 107, 99, 0.08);
  color: var(--shell-accent);
  font-size: 0.68rem;
  font-weight: 850;
  white-space: nowrap;
}

.adminRuleSimpleResourceList,
.adminRuleSimpleDoctorList {
  display: flex;
  flex-direction: column;
  gap: 7px;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior-x: contain;
  overscroll-behavior-y: auto;
  padding-right: 3px;
  scrollbar-width: thin;
}

.adminRuleSimpleResourceList {
  max-height: 270px;
}

.adminRuleSimpleDoctorList {
  max-height: 190px;
}

.adminRuleSimpleResourceStore,
.adminRuleSimpleDoctorStore {
  flex: 0 0 auto;
  overflow: hidden;
  border: 1px solid var(--shell-border);
  border-radius: 9px;
  background: #fff;
}

.adminRuleSimpleResourceStore > summary,
.adminRuleSimpleDoctorStore > summary {
  display: flex;
  align-items: center;
  gap: 8px;
  list-style: none;
  padding: 6px 8px;
  background: #f4f8f6;
  color: var(--shell-text);
  font-size: 0.7rem;
  cursor: pointer;
}

.adminRuleSimpleResourceStore > summary::-webkit-details-marker,
.adminRuleSimpleDoctorStore > summary::-webkit-details-marker {
  display: none;
}

.adminRuleSimpleResourceStore > summary::before,
.adminRuleSimpleDoctorStore > summary::before {
  content: "›";
  flex: 0 0 auto;
  color: var(--shell-accent);
  font-size: 0.86rem;
  font-weight: 900;
  transform: rotate(0);
  transition: transform 0.16s ease;
}

.adminRuleSimpleResourceStore[open] > summary::before,
.adminRuleSimpleDoctorStore[open] > summary::before {
  transform: rotate(90deg);
}

.adminRuleSimpleResourceStore[open] > summary,
.adminRuleSimpleDoctorStore[open] > summary {
  border-bottom: 1px solid var(--shell-border);
}

.adminRuleSimpleResourceStore > summary strong,
.adminRuleSimpleDoctorStore > summary strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.adminRuleSimpleResourceStore > summary span,
.adminRuleSimpleDoctorStore > summary span {
  margin-left: auto;
  color: var(--shell-muted);
  font-size: 0.65rem;
  white-space: nowrap;
}

.adminRuleSimpleResourceChecks,
.adminRuleSimpleDoctorChecks {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  padding: 4px;
}

.adminRuleSimpleResourceCheck,
.adminRuleSimpleDoctorCheck {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 5px;
  min-width: 0;
  padding: 5px 6px;
  border-radius: 6px;
  color: var(--shell-text);
  font-size: 0.68rem;
  cursor: pointer;
}

.adminRuleSimpleResourceCheck:hover,
.adminRuleSimpleDoctorCheck:hover {
  background: rgba(15, 107, 99, 0.06);
}

.adminRuleSimpleResourceCheck span,
.adminRuleSimpleDoctorCheck span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.adminRuleSimpleResourceCheck small,
.adminRuleSimpleDoctorCheck small {
  padding: 1px 5px;
  border-radius: 999px;
  background: #fff4d9;
  color: #7a5a19;
  font-size: 0.58rem;
  font-weight: 800;
}

.adminRulePreviewHead {
  background: #eef5f2;
}

.adminRulePreviewSummary {
  padding: 8px 12px;
  border-bottom: 1px solid var(--shell-border);
  background: #fff;
  color: var(--shell-muted);
  font-size: 0.7rem;
  font-weight: 750;
  line-height: 1.35;
}

.adminRulePreviewCanvas {
  padding: 12px;
}

.adminRulePreviewEmpty {
  display: grid;
  min-height: 300px;
  place-items: center;
  margin: 0;
  padding: 20px;
  color: var(--shell-muted);
  font-size: 0.74rem;
  text-align: center;
}

.adminRulePreviewSchedule {
  overflow: hidden;
  border: 1px solid var(--shell-border);
  border-radius: 11px;
  background: #fff;
  box-shadow: 0 8px 22px rgba(32, 48, 43, 0.06);
}

.adminRulePreviewScheduleHead,
.adminRulePreviewScheduleBody {
  display: grid;
  grid-template-columns:
    52px
    repeat(var(--admin-rule-preview-columns), minmax(0, 1fr));
  min-width: 0;
}

.adminRulePreviewScheduleHead {
  min-height: 40px;
  border-bottom: 1px solid var(--shell-border);
  background: #edf4f1;
}

.adminRulePreviewCorner,
.adminRulePreviewColumnHead {
  display: grid;
  min-width: 0;
  place-items: center;
  padding: 5px;
  border-right: 1px solid var(--shell-border);
  color: var(--shell-text);
  font-size: 0.68rem;
  font-weight: 850;
  line-height: 1.2;
  text-align: center;
  overflow-wrap: anywhere;
}

.adminRulePreviewColumnHead:last-child {
  border-right: 0;
}

.adminRulePreviewScheduleBody {
  position: relative;
  height: 360px;
}

.adminRulePreviewTimeAxis,
.adminRulePreviewTrack {
  position: relative;
  min-width: 0;
  border-right: 1px solid var(--shell-border);
}

.adminRulePreviewTrack:last-child {
  border-right: 0;
}

.adminRulePreviewTimeAxis {
  z-index: 2;
  background: #fbfdfc;
}

.adminRulePreviewTimeTick {
  position: absolute;
  right: 6px;
  z-index: 3;
  transform: translateY(-50%);
  color: var(--shell-muted);
  font-size: 0.62rem;
  font-weight: 800;
}

.adminRulePreviewGridLine {
  position: absolute;
  left: 52px;
  right: 0;
  z-index: 1;
  height: 1px;
  background: rgba(32, 48, 43, 0.09);
  pointer-events: none;
}

.adminRulePreviewAppointment,
.adminRulePreviewBlock {
  position: absolute;
  left: 7px;
  right: 7px;
  min-height: 24px;
  border-radius: 7px;
}

.adminRulePreviewAppointment {
  z-index: 1;
  border: 1px dashed rgba(15, 107, 99, 0.25);
  background: rgba(15, 107, 99, 0.025);
}

.adminRulePreviewBlock {
  z-index: 3;
  display: grid;
  align-content: center;
  gap: 1px;
  overflow: hidden;
  padding: 6px 7px;
  border: 1px solid rgba(15, 107, 99, 0.26);
  border-left: 4px solid var(--shell-accent);
  background: #dceee8;
  color: #234a42;
  box-shadow: 0 4px 12px rgba(32, 48, 43, 0.1);
}

.adminRulePreviewBlock--person {
  border-color: rgba(57, 105, 146, 0.28);
  border-left-color: #39729a;
  background: #e2edf5;
  color: #274e69;
}

.adminRulePreviewBlock strong,
.adminRulePreviewBlock span,
.adminRulePreviewBlock small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.adminRulePreviewBlock strong {
  font-size: 0.69rem;
  font-weight: 900;
}

.adminRulePreviewBlock span,
.adminRulePreviewBlock small {
  font-size: 0.61rem;
  font-weight: 750;
}

@media (prefers-reduced-motion: reduce) {
  .bookingRulesPanel *,
  .bookingRulesDialogLayer * {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}


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

@media (max-width: 900px) {
  .bookingRulesMatrixViewport { height: min(62vh, 640px); min-height: 320px; }
  #bookingRulesPanel-items > .bookingRulesTableWrap {
    max-height: min(108vh, 930px);
  }
  .adminRuleSimpleEditor {
    grid-template-columns: minmax(0, 1fr);
  }
  .adminRuleOccupancyPreview {
    order: 2;
  }
  .adminRuleContextSummary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .adminRuleContextFact--source {
    grid-column: 1 / -1;
  }
  .adminRuleEditorSection--three .adminRuleEditorSectionBody {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .bookingRulesTabs { width: 100%; max-width: 100%; overflow-x: auto; }
  .bookingRulesTabs .metricRoleTab { min-width: max-content; white-space: nowrap; }
  .bookingRulesToolbar {
    align-items: stretch;
    flex-wrap: wrap;
    overflow-x: visible;
  }
  .bookingRulesToolbar > .bookingRulesSearch,
  .bookingRulesToolbar > .bookingRulesFilter,
  .bookingRulesToolbar > .bookingRulesToolbarActions {
    flex: 1 1 calc(50% - 6px);
    width: auto;
    max-width: none;
    min-width: 0;
  }
  .bookingRulesToolbar > .bookingRulesSearch {
    flex: 1 1 100%;
    width: 100%;
  }
  .bookingRulesToolbar > .bookingRulesFilter select {
    width: 100%;
    max-width: none;
  }
  .bookingRulesToolbar > .bookingRulesToolbarActions {
    margin-left: 0;
    flex: 1 1 100%;
  }
  .bookingRulesToolbarActions .shellBtn { flex: 1 1 auto; }
  .bookingRulesTable[data-booking-rules-table="releases"],
  .bookingRulesTable[data-booking-rules-table="templates"] {
    min-width: 920px;
  }
  .bookingRulesTable[data-booking-rules-table="stores"] { min-width: 720px; }
  .bookingRulesTable[data-booking-rules-table="resources"],
  .bookingRulesTable[data-booking-rules-table="assets"] {
    min-width: 720px;
  }
  .bookingRulesTable[data-booking-rules-table="items"][data-booking-rules-items-view="family"] {
    min-width: 760px;
  }
  .bookingRulesTable[data-booking-rules-table="items"][data-booking-rules-items-view="item"] {
    min-width: 680px;
  }
  .bookingRulesPreviewSummary { grid-template-columns: 1fr 1fr; }
  .bookingRulesIssue { grid-template-columns: 1fr; }
  .adminRuleTriState { grid-template-columns: 1fr; }
  .bookingRulesDialog { width: calc(100vw - 20px); max-width: none; }
  .bookingRulesDialogActions { align-items: stretch; flex-direction: column-reverse; }
  .bookingRulesDialogActions .shellBtn { width: 100%; }
  .bookingRulesResourceDirectoryControls { align-items: stretch; }
  .bookingRulesResourceDirectoryControls .bookingRulesSearch,
  .bookingRulesResourceDirectoryControls .bookingRulesFilter,
  .bookingRulesResourceDirectoryControls .shellBtn {
    flex: 1 1 100%;
    width: 100%;
    min-width: 0;
  }
  .bookingRulesResourceDirectoryControls .bookingRulesTotal { margin-left: 0; }
  .bookingRulesAppointmentColumnsInfo {
    align-items: flex-start;
    flex-direction: column;
  }
  .bookingRulesAppointmentColumnEditorSummary,
  .bookingRulesAppointmentColumnResourceList {
    grid-template-columns: minmax(0, 1fr);
  }
  .adminRuleContextSummary,
  .adminRuleStoreLimitGrid,
  .adminRuleEditorSection--two .adminRuleEditorSectionBody,
  .adminRuleEditorSection--three .adminRuleEditorSectionBody,
  .adminRuleEditorSection--booking .adminRuleEditorSectionBody,
  .adminRuleBindingGrid,
  .adminRuleOccupancyWindowGrid,
  .adminRuleDerivedWritePlan {
    grid-template-columns: minmax(0, 1fr);
  }
  .adminRuleOccupancyWindowCard {
    grid-template-columns: minmax(0, 1fr);
  }
  .adminRuleAppointmentModeField,
  .adminRuleAllowedDurationsField,
  .adminRuleFullWidthField {
    grid-column: auto;
  }
  .adminRuleStateBar {
    align-items: flex-start;
    flex-direction: column;
  }
  .adminRuleStateActions {
    justify-content: flex-start;
  }
  .adminRuleContextFact--source,
  .adminRuleBindingGrid > .adminRuleInlineNote {
    grid-column: auto;
  }
  .adminRuleSimpleEditor {
    gap: 10px;
  }
  .adminRuleSimpleModeOptions,
  .adminRuleSimpleOccupancyGrid,
  .adminRuleSimpleResourceChecks,
  .adminRuleSimpleDoctorChecks {
    grid-template-columns: minmax(0, 1fr);
  }
  .adminRuleSimpleModeOption {
    min-height: 38px;
  }
  .adminRuleSimplePaneHead {
    align-items: flex-start;
  }
  .adminRulePreviewHead {
    align-items: stretch;
    flex-direction: column;
  }
  .adminRulePreviewHead select {
    width: 100%;
  }
  .adminRuleSimpleResourceList {
    max-height: 240px;
  }
  .adminRulePreviewCanvas {
    padding: 8px;
  }
  .adminRulePreviewScheduleBody {
    height: 300px;
  }
  .adminRulePreviewScheduleHead,
  .adminRulePreviewScheduleBody {
    grid-template-columns:
      46px
      repeat(var(--admin-rule-preview-columns), minmax(0, 1fr));
  }
  .adminRulePreviewGridLine {
    left: 46px;
  }
}

#bookingRulesPublishBtn.shellBtn--primary:not(:disabled) {
  background: #0f6b63;
  background-color: #0f6b63;
  color: #fff;
  border-color: #0f6b63;
}

.bookingRulesPanel .bookingRulesTabs.metricRoleTabs,
.bookingRulesTabs {
  overflow-x: auto !important;
  flex-wrap: nowrap !important;
}

#bookingRulesTabs.bookingRulesTabs {
  display: flex;
  flex-wrap: nowrap !important;
  overflow-x: auto !important;
  width: 100%;
  max-width: 100%;
}
#bookingRulesTabs.bookingRulesTabs > * {
  flex: 0 0 auto !important;
  min-width: max-content !important;
  white-space: nowrap !important;
}

#bookingRulesTabs.bookingRulesTabs > [data-booking-rules-tab],
#bookingRulesTabs.bookingRulesTabs > .metricRoleTab {
  min-width: 120px !important;
  padding-inline: 14px !important;
}

/* ---------- 仪器管理 ---------- */

.bookingRulesAssets {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.bookingRulesAssetsListHost {
  min-width: 0;
}

.bookingRulesAssets .bookingRulesActionCell .btnLink + .btnLink {
  margin-left: 10px;
}

/* ---------- 人员管理：范围切换与排班弹窗 ---------- */

.bookingRulesPeopleViewSwitch {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.bookingRulesPeopleViewBtn.is-active {
  background: var(--shell-accent-soft, #e0f2e9);
  color: var(--shell-accent-strong, #14532d);
  border-color: var(--shell-accent, #16a34a);
  font-weight: 700;
}

.bookingRulesPeopleSchedule {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.bookingRulesPeopleSchedule h3 {
  margin: 0;
  font-size: 0.85rem;
}

.bookingRulesPeopleWeekGridWrap,
.bookingRulesPeopleScheduleList {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.bookingRulesPeopleWeekGrid {
  table-layout: fixed;
}

.bookingRulesPeopleWeekCell {
  vertical-align: top;
  font-size: 0.75rem;
}

.bookingRulesPeopleWeekChip {
  display: block;
  margin: 0 0 4px;
  padding: 4px 6px;
  border-radius: 6px;
  background: #e0f2e9;
  color: #14532d;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.bookingRulesPeopleWeekChip--planned {
  background: #fef3c7;
  color: #92400e;
}

.bookingRulesPeopleConflict[hidden] {
  display: none;
}

.bookingRulesPeopleConflict ul {
  margin: 6px 0 0;
  padding-left: 18px;
}

/* 按内容自适应高度：0 条记录的调机弹窗就该是小的，不能写死 760px 撑满屏。
   max-height 必须与遮罩层的上下内边距（最多 48+24）对齐，否则遮罩层自己会滚。 */
.bookingRulesDialog[data-variant="people-schedule"],
.bookingRulesDialog[data-variant="schedule"] {
  width: min(900px, calc(100vw - 24px));
  max-width: none;
  height: auto;
  max-height: calc(100vh - 96px);
  padding: 14px 16px;
}

.bookingRulesDialog[data-variant="people-schedule"] .bookingRulesDialogHead h2,
.bookingRulesDialog[data-variant="schedule"] .bookingRulesDialogHead h2 {
  font-size: 1.12rem;
}

/* 弹窗体是唯一的滚动容器：内部一律不再嵌套滚动区，
   放不下时只有这里滚一条（内容够短时完全不出现）。 */
.bookingRulesDialog[data-variant="people-schedule"] .bookingRulesDialogBody,
.bookingRulesDialog[data-variant="schedule"] .bookingRulesDialogBody {
  overflow-y: auto;
  overflow-x: hidden;
  padding: 8px 0;
  min-height: 0;
}

.bookingRulesDialog[data-variant="people-schedule"] .bookingRulesDialogActions,
.bookingRulesDialog[data-variant="schedule"] .bookingRulesDialogActions {
  padding-top: 10px;
}

.bookingRulesDialog[data-variant="people-schedule"] .bookingRulesDialogActions .shellBtn,
.bookingRulesDialog[data-variant="schedule"] .bookingRulesDialogActions .shellBtn {
  min-width: 96px;
}

/* ---------- 排班月历 ---------- */

.bookingRulesMonthCalendar,
.bookingRulesAssetsSchedule,
.bookingRulesPeopleSchedule {
  display: grid;
  gap: 8px;
  min-width: 0;
  min-height: 0;
}

/* 内容按自然高度铺开（顶部提示行 0～3 条都不影响），由弹窗体统一滚动 */
.bookingRulesDialog[data-variant="people-schedule"] .bookingRulesAssetsSchedule,
.bookingRulesDialog[data-variant="people-schedule"] .bookingRulesPeopleSchedule {
  height: auto;
  display: flex;
  flex-direction: column;
}

.bookingRulesDialog[data-variant="people-schedule"] .bookingRulesAssetsSchedule > *,
.bookingRulesDialog[data-variant="people-schedule"] .bookingRulesPeopleSchedule > * {
  flex: 0 0 auto;
  min-width: 0;
}

.bookingRulesDialog[data-variant="people-schedule"] .bookingRulesAssetsSchedule > .adminRuleInlineNote,
.bookingRulesDialog[data-variant="people-schedule"] .bookingRulesAssetsSchedule > .adminRuleBlockingNote,
.bookingRulesDialog[data-variant="people-schedule"] .bookingRulesPeopleSchedule > .adminRuleInlineNote,
.bookingRulesDialog[data-variant="people-schedule"] .bookingRulesPeopleSchedule > .adminRuleBlockingNote {
  margin: 0;
  font-size: 0.78rem;
  line-height: 1.3;
}

/* 左日历 / 右设置，互不遮挡 */
.bookingRulesScheduleSplit {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(272px, 0.8fr);
  gap: 12px;
  align-items: start;
  min-width: 0;
  min-height: 0;
  height: auto;
}

.bookingRulesScheduleSplitMain,
.bookingRulesScheduleSplitSide {
  display: grid;
  gap: 8px;
  min-width: 0;
  min-height: 0;
}

.bookingRulesScheduleSplitMain {
  grid-template-rows: auto;
}

.bookingRulesScheduleSplitMain .bookingRulesMonthCalendar {
  height: auto;
  grid-template-rows: auto;
}

.bookingRulesMonthDowRow {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 4px;
}

/* 右栏卡片数不定（调机 2 个、人员排班 4 个）。
   整列是「唯一」的滚动容器：卡片一律按内容自然高度铺开、自身都不滚，
   放不下时只由这一列滚动——避免嵌套滚动区叠出多条滚动条。
   每次点日期都会重建右栏 DOM，滚动位置自然回到顶部的门店卡片。 */
.bookingRulesScheduleSplitSide {
  display: flex;
  flex-direction: column;
  overflow: visible;
}

.bookingRulesScheduleSplitSide > * {
  flex: 0 0 auto;
  min-width: 0;
  overflow: visible;
}

.bookingRulesScheduleSplitMain > .bookingRulesScheduleMoves,
.bookingRulesScheduleSplitSide > .bookingRulesScheduleMoves {
  max-height: none;
}

/* 放在日历下方时列宽有 500px 富余，自适应铺成多列，整体高度减半 */
.bookingRulesScheduleSplitMain > .bookingRulesScheduleMoves .bookingRulesScheduleMoveList {
  grid-template-columns: repeat(auto-fill, minmax(212px, 1fr));
  column-gap: 12px;
}

.bookingRulesMonthToolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.bookingRulesMonthTitle {
  font-size: 0.92rem;
}

.bookingRulesMonthLegend {
  margin: 0;
  font-size: 0.72rem;
  line-height: 1.25;
}

/* 日期格按固定紧凑高度排，不再 1fr 拉伸填满弹窗 */
.bookingRulesMonthGrid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  grid-auto-rows: minmax(38px, auto);
  gap: 4px;
  min-height: 0;
  height: auto;
  align-content: start;
}

.bookingRulesMonthDow {
  text-align: center;
  font-size: 0.7rem;
  color: var(--shell-muted, #64748b);
  padding: 0;
  align-self: end;
}

.bookingRulesMonthCell {
  display: grid;
  align-content: start;
  gap: 1px;
  min-height: 38px;
  height: auto;
  margin: 0;
  padding: 3px 4px;
  border: 1px solid var(--shell-border, #d8e0d9);
  border-radius: 8px;
  background: #fff;
  text-align: left;
  cursor: pointer;
}

.bookingRulesMonthCell.is-empty {
  border: none;
  background: transparent;
  cursor: default;
  min-height: 0;
  padding: 0;
}

.bookingRulesMonthCell.is-default {
  background: #f8faf8;
}

.bookingRulesMonthCell.is-override {
  border-color: #86efac;
  background: #f0fdf4;
}

.bookingRulesMonthCell.is-maintenance {
  border-color: #fda4af;
  background: #fff1f2;
}

.bookingRulesMonthCell.is-selected {
  outline: 2px solid var(--shell-accent, #16a34a);
  outline-offset: 1px;
}

.bookingRulesMonthDayNum {
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.1;
}

/* 当日状态按时间比例铺的迷你时间轴（刻度尺 08:00~22:00，见 schedule-calendar.js）。
   放在日期数字下方，只占 5px 高，格子仍守 38px 基线。 */
.bookingRulesMonthTrack {
  position: relative;
  display: block;
  width: 100%;
  height: 5px;
  margin-top: 1px;
  border-radius: 3px;
  background: #eef2f6;
  overflow: hidden;
}

.bookingRulesMonthTrackSeg {
  position: absolute;
  top: 0;
  bottom: 0;
  border-radius: 3px;
}

.bookingRulesMonthTrackSeg.is-override,
.bookingRulesMonthTrackSeg.is-default {
  background: #4ade80;
}

.bookingRulesMonthTrackSeg.is-maintenance {
  background: #fb7185;
}

.bookingRulesMonthChip {
  display: block;
  font-size: 0.65rem;
  line-height: 1.15;
  color: #14532d;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bookingRulesMonthChip.is-default {
  color: #64748b;
}

.bookingRulesMonthChip.is-override {
  color: #166534;
  font-weight: 600;
}

.bookingRulesMonthChip.is-maintenance {
  color: #be123c;
  font-weight: 700;
}

.bookingRulesScheduleMoveList {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 4px;
  font-size: 0.72rem;
  color: #334155;
  align-content: start;
}

.bookingRulesScheduleMoveList li {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

/* 目的地标签占满中间、超长省略；「取消」固定钉在行尾不换行 */
.bookingRulesScheduleMoveList li .bookingRulesScheduleMoveTag {
  flex: 1 1 auto;
  min-width: 0;
  display: inline-block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bookingRulesScheduleMoveList li > .btnLink:last-child {
  flex: 0 0 auto;
  margin-left: auto;
}

.bookingRulesScheduleMoveTag {
  display: inline-flex;
  align-items: center;
  padding: 1px 6px;
  border-radius: 999px;
  font-size: 0.68rem;
}

.bookingRulesScheduleMoveTag.is-override {
  background: #f0fdf4;
  color: #166534;
  border: 1px solid #86efac;
}

.bookingRulesScheduleMoveTag.is-maintenance {
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fca5a5;
}

.bookingRulesMonthChip.is-default {
  color: #64748b;
}

.bookingRulesMonthChip.is-override {
  color: #166534;
  font-weight: 700;
}

.bookingRulesScheduleMoves {
  display: grid;
  align-content: start;
  gap: 4px;
  margin: 0;
  padding: 8px 10px;
  border: 1px solid var(--shell-border, #e2e8f0);
  border-radius: 8px;
  background: #fff;
}

.bookingRulesScheduleMoves > strong {
  font-size: 0.72rem;
  color: #0f172a;
}

.bookingRulesScheduleMoves .adminRuleInlineNote {
  margin: 0;
  font-size: 0.7rem;
}

.bookingRulesScheduleFeedback.is-ready {
  color: #166534;
  font-weight: 600;
}

.bookingRulesScheduleFeedback.is-error,
.bookingRulesScheduleWriteBlocked {
  color: #b91c1c;
  font-weight: 600;
}

.bookingRulesDayPickerPlan {
  font-weight: 600;
  color: #14532d;
}

.bookingRulesDayPicker {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 10px;
  border: 1px solid #86efac;
  border-radius: 10px;
  background: #f0fdf4;
  min-height: 0;
  align-content: start;
}

.bookingRulesDayPicker.is-compact {
  gap: 6px;
  padding: 8px;
}

.bookingRulesDayPicker.is-compact .bookingRulesDayPickerOrigin .adminRuleInlineNote {
  margin: 0;
  font-size: 0.72rem;
  line-height: 1.25;
}

.bookingRulesDayPicker.is-compact .bookingRulesScheduleWriteBlocked,
.bookingRulesDayPicker.is-compact .bookingRulesScheduleFeedback {
  margin: 0;
  font-size: 0.72rem;
  line-height: 1.25;
}

.bookingRulesDayPickerTitle {
  font-size: 0.86rem;
  color: #14532d;
}

.bookingRulesDayPickerStores,
.bookingRulesDayPickerExtras {
  display: flex;
  flex-direction: column;
  flex-wrap: nowrap;
  gap: 5px;
}

/* 营业时间预设档：双列铺开，选中态高亮 */
.bookingRulesStoreHoursPresets {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px;
}

.bookingRulesStoreHoursPresets .shellBtn.is-active {
  background: var(--shell-accent-soft, #e0f2e9);
  border-color: var(--shell-accent, #16a34a);
  font-weight: 700;
}

/* 紧凑模式（排班/调机弹窗）：门店双列铺开省高度，动作按钮横排 */
.bookingRulesDayPicker.is-compact .bookingRulesDayPickerStores {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px;
}

.bookingRulesDayPicker.is-compact .bookingRulesDayPickerExtras {
  flex-direction: row;
  flex-wrap: wrap;
}

.bookingRulesDayPicker.is-compact .bookingRulesDayPickerExtras .shellBtn {
  flex: 1 1 auto;
  min-width: 0;
}

.bookingRulesDayPickerStoreBtn {
  width: 100%;
  min-width: 0;
  min-height: 30px;
  justify-content: flex-start;
  padding: 4px 8px;
  font-size: 0.78rem;
}

.bookingRulesDayPickerExtras .shellBtn {
  min-height: 30px;
  font-size: 0.78rem;
}

@media (max-width: 900px) {
  .bookingRulesDialog[data-variant="people-schedule"] .bookingRulesDialogBody,
  .bookingRulesDialog[data-variant="schedule"] .bookingRulesDialogBody {
    overflow: auto;
  }

  .bookingRulesDialog[data-variant="people-schedule"] .bookingRulesAssetsSchedule,
  .bookingRulesDialog[data-variant="people-schedule"] .bookingRulesPeopleSchedule,
  .bookingRulesDialog[data-variant="schedule"] .bookingRulesAssetsSchedule,
  .bookingRulesDialog[data-variant="schedule"] .bookingRulesPeopleSchedule {
    height: auto;
    grid-template-rows: auto;
  }

  .bookingRulesScheduleSplit {
    grid-template-columns: 1fr;
    height: auto;
  }

  .bookingRulesScheduleSplitMain .bookingRulesMonthCalendar {
    height: auto;
    grid-template-rows: auto;
  }

  .bookingRulesMonthGrid {
    height: auto;
    grid-auto-rows: minmax(48px, auto);
  }

  .bookingRulesMonthCell {
    min-height: 48px;
  }

  .bookingRulesScheduleSplitSide {
    overflow: visible;
  }

  .bookingRulesScheduleMoves {
    max-height: none;
  }

  .bookingRulesDayPickerStores,
  .bookingRulesDayPickerExtras {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .bookingRulesDayPickerStoreBtn {
    width: auto;
    min-width: 7.5rem;
  }
}

.bookingRulesDayPickerStores .shellBtn.is-active,
.bookingRulesDayPickerExtras .shellBtn.is-active {
  background: var(--shell-accent-soft, #e0f2e9);
  border-color: var(--shell-accent, #16a34a);
  font-weight: 700;
}

/* ---------- 值班表 ---------- */

.bookingRulesRoster {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.bookingRulesRosterCard,
.bookingRulesRosterSection {
  display: grid;
  gap: 9px;
  min-width: 0;
  margin: 0;
  padding: 10px 11px 11px;
  border: 1px solid var(--shell-border);
  border-radius: 12px;
  background: var(--shell-panel-soft, #f0f4f1);
}

.bookingRulesRosterCard h3,
.bookingRulesRosterPreviewResult h4 {
  margin: 0;
  font-size: 0.85rem;
}

.bookingRulesRosterSectionTabs {
  overflow-x: auto;
  flex-wrap: nowrap;
}

.bookingRulesRosterSectionTabs .metricRoleTab {
  flex: 0 0 auto;
  white-space: nowrap;
}

.bookingRulesRosterForm,
.bookingRulesRosterToolbar {
  align-items: end;
}

/* 预约管理筛选：强制单行（覆盖 admin.css 三列 grid，避免搜索掉到第二行） */
.bookingRulesColumnsDirectory > .bookingRulesRosterToolbar {
  display: flex;
  flex-wrap: nowrap;
  align-items: end;
  gap: 8px;
  margin: 0 0 8px;
  padding: 8px 10px;
  overflow-x: auto;
  grid-template-columns: none;
}

.bookingRulesColumnsDirectory > .bookingRulesRosterToolbar .bookingRulesColumnsKindField {
  flex: 0 0 auto;
  min-width: 0;
}

.bookingRulesColumnsDirectory > .bookingRulesRosterToolbar .adminRuleField:not(.bookingRulesColumnsKindField) {
  flex: 0 0 7.5rem;
  min-width: 7rem;
  max-width: 8.5rem;
}

.bookingRulesColumnsDirectory > .bookingRulesRosterToolbar .bookingRulesSearch {
  flex: 1 1 12rem;
  min-width: 10rem;
  max-width: none;
}

.bookingRulesColumnsDirectory > .bookingRulesRosterToolbar .bookingRulesSearch input,
.bookingRulesColumnsDirectory > .bookingRulesRosterToolbar .adminRuleField select {
  min-height: 34px;
  padding: 0.35rem 0.55rem;
}

.bookingRulesColumnsDirectory > .bookingRulesRosterToolbar .bookingRulesColumnsKindChip {
  padding: 7px 10px;
  white-space: nowrap;
}

@media (max-width: 720px) {
  .bookingRulesColumnsDirectory > .bookingRulesRosterToolbar {
    flex-wrap: wrap;
  }

  .bookingRulesColumnsDirectory > .bookingRulesRosterToolbar .adminRuleField:not(.bookingRulesColumnsKindField),
  .bookingRulesColumnsDirectory > .bookingRulesRosterToolbar .bookingRulesSearch {
    flex: 1 1 calc(50% - 8px);
    max-width: none;
  }
}

.bookingRulesRosterFormGrid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 9px;
  align-items: end;
  min-width: 0;
}

.bookingRulesRosterFormActions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.bookingRulesRosterConflict[hidden] {
  display: none;
}

.bookingRulesRosterConflict ul {
  margin: 6px 0 0;
  padding-left: 18px;
}

.bookingRulesRosterPreviewResult {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.bookingRulesRosterDutyList {
  margin: 0;
  padding-left: 18px;
  font-size: 0.78rem;
}

.bookingRulesRosterLinkCell {
  display: grid;
  gap: 4px;
}

.bookingRulesRosterLinkItem {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.bookingRulesRosterLinkTag--confirmed {
  background: #e0f2e9;
  color: #14532d;
}

.bookingRulesRosterLinkTag--pending {
  background: #fef3c7;
  color: #92400e;
}

.bookingRulesRosterLinkTag--rejected {
  background: #e5e7eb;
  color: #4b5563;
}

.bookingRulesRosterDriftList > li.bookingRulesRosterDriftReport {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
  padding: 6px 0;
}

.bookingRulesRosterDriftSummary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.bookingRulesRosterDriftIssues[hidden] {
  display: none;
}

.bookingRulesRosterDriftReportHead {
  font-weight: 800;
  color: var(--shell-text);
}

.bookingRulesRosterDriftIssues {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.bookingRulesRosterDriftIssue {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.bookingRulesRosterDriftColumn {
  font-weight: 700;
}

.bookingRulesRosterDriftReason {
  color: var(--shell-muted);
  overflow-wrap: anywhere;
}

.bookingRulesRosterDriftTag--high {
  background: #fee2e2;
  color: #991b1b;
}

.bookingRulesRosterDriftTag--medium {
  background: #fef3c7;
  color: #92400e;
}

@media (max-width: 480px) {
  .bookingRulesRosterFormGrid {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* ---------- 预约列 Tab：全集团统一列目录 ---------- */

.bookingRulesColumnsKindField {
  display: grid;
  gap: 6px;
  align-content: start;
  min-width: 0;
}

.bookingRulesColumnsKindFilter {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0;
  min-width: 0;
  border: 1px solid var(--border, #d1d5db);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}

.bookingRulesColumnsKindChip {
  appearance: none;
  border: 0;
  margin: 0;
  padding: 6px 12px;
  background: transparent;
  color: #374151;
  font: inherit;
  font-size: 13px;
  line-height: 1.2;
  cursor: pointer;
  border-right: 1px solid var(--border, #d1d5db);
}

.bookingRulesColumnsKindChip:last-child {
  border-right: 0;
}

.bookingRulesColumnsKindChip:hover {
  background: #f3f4f6;
}

.bookingRulesColumnsKindChip.is-active {
  background: #111827;
  color: #fff;
}

.bookingRulesColumnsKindChip:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: -2px;
  z-index: 1;
}

.bookingRulesColumnFamilies {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.bookingRulesColumnsList {
  min-width: 0;
}

.bookingRulesColumnsTable--compact {
  table-layout: fixed;
  width: 100%;
}

/* 旧 6 列资源列目录（无设备列时） */
.bookingRulesColumnsTable--compact:not(.bookingRulesColumnsTable--booking) th:nth-child(1),
.bookingRulesColumnsTable--compact:not(.bookingRulesColumnsTable--booking) td:nth-child(1) {
  width: 16%;
}

.bookingRulesColumnsTable--compact:not(.bookingRulesColumnsTable--booking) th:nth-child(2),
.bookingRulesColumnsTable--compact:not(.bookingRulesColumnsTable--booking) td:nth-child(2) {
  width: 9%;
}

.bookingRulesColumnsTable--compact:not(.bookingRulesColumnsTable--booking) th:nth-child(3),
.bookingRulesColumnsTable--compact:not(.bookingRulesColumnsTable--booking) td:nth-child(3) {
  width: 9%;
}

.bookingRulesColumnsTable--compact:not(.bookingRulesColumnsTable--booking) th:nth-child(4),
.bookingRulesColumnsTable--compact:not(.bookingRulesColumnsTable--booking) td:nth-child(4) {
  width: 22%;
}

.bookingRulesColumnsTable--compact:not(.bookingRulesColumnsTable--booking) th:nth-child(5),
.bookingRulesColumnsTable--compact:not(.bookingRulesColumnsTable--booking) td:nth-child(5) {
  width: 24%;
}

.bookingRulesColumnsTable--compact:not(.bookingRulesColumnsTable--booking) th:last-child,
.bookingRulesColumnsTable--compact:not(.bookingRulesColumnsTable--booking) td:last-child {
  width: 120px;
}

.bookingRulesColumnsTable--compact:not(.bookingRulesColumnsTable--booking) [data-column-coverage] {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bookingRulesColumnsTable--compact .bookingRulesColumnsFamiliesCell,
.bookingRulesColumnsTable--compact [data-column-families] {
  white-space: normal;
  overflow: visible;
  overflow-wrap: anywhere;
  word-break: break-word;
  text-overflow: clip;
  line-height: 1.35;
}

.bookingRulesColumnsTable--compact .bookingRulesColumnsFamiliesCell .bookingRulesColumnsFamilyLink {
  display: inline;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.bookingRulesColumnsTable--compact [data-column-paused] {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 预约管理 6 列：名称 / 类型 / 启用(窄) / 门店 / 品项族 / 操作(固定宽) */
.bookingRulesColumnsTable--booking.rosterTable {
  min-width: 920px;
}

.bookingRulesColumnsTable--booking th:nth-child(1),
.bookingRulesColumnsTable--booking td:nth-child(1) {
  width: 15%;
}

.bookingRulesColumnsTable--booking th:nth-child(2),
.bookingRulesColumnsTable--booking td:nth-child(2) {
  width: 4.5rem;
}

.bookingRulesColumnsTable--booking th:nth-child(3),
.bookingRulesColumnsTable--booking td:nth-child(3) {
  /* 仅开关：必须 max-width，否则 fixed 布局剩余宽度会灌进这一列 */
  width: 3rem;
  max-width: 3rem;
  padding-left: 4px;
  padding-right: 4px;
  text-align: center;
  overflow: hidden;
}

.bookingRulesColumnsTable--booking th:nth-child(4),
.bookingRulesColumnsTable--booking td:nth-child(4) {
  width: 26%;
}

.bookingRulesColumnsTable--booking th:nth-child(5),
.bookingRulesColumnsTable--booking td:nth-child(5) {
  width: 22%;
}

.bookingRulesColumnsTable--booking th:nth-child(6),
.bookingRulesColumnsTable--booking td:nth-child(6) {
  width: 11.5rem;
  max-width: 11.5rem;
  text-align: left;
}

.bookingRulesColumnsNameCell {
  white-space: normal !important;
}

.bookingRulesColumnsNameCell .bookingRulesColumnsExpandBtn,
.bookingRulesColumnsNameCell .bookingRulesColumnsExpandSpacer {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.25rem;
  height: 1.25rem;
  margin-right: 4px;
  padding: 0;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--shell-text-secondary, #475569);
  font-size: 0.7rem;
  line-height: 1;
  vertical-align: top;
  cursor: pointer;
}

.bookingRulesColumnsNameCell .bookingRulesColumnsExpandBtn:hover {
  background: var(--shell-fill-tertiary, #eef2f6);
  color: var(--shell-text, #0f172a);
}

.bookingRulesColumnsNameCell .bookingRulesColumnsNameText {
  display: inline-block;
  vertical-align: top;
  max-width: calc(100% - 1.5rem);
  white-space: normal;
  overflow-wrap: anywhere;
}

.bookingRulesSwitch {
  position: relative;
  display: inline-flex;
  width: 2.25rem;
  height: 1.25rem;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: #cbd5e1;
  cursor: pointer;
  vertical-align: middle;
  transition: background 0.15s ease;
}

.bookingRulesSwitch.is-on {
  background: #2563eb;
}

.bookingRulesSwitch:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.bookingRulesSwitchThumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 1rem;
  height: 1rem;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.2);
  transition: transform 0.15s ease;
}

.bookingRulesSwitch.is-on .bookingRulesSwitchThumb {
  transform: translateX(1rem);
}

.bookingRulesColumnsAssetPresenceCell {
  color: var(--shell-muted, #64748b);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

tr.bookingRulesColumnsAssetGroup .bookingRulesStoreEnableCell,
tr.bookingRulesColumnsAssetMachine .bookingRulesStoreEnableCell {
  text-align: center;
}

.bookingRulesColumnsFamilyLink {
  padding: 0;
  font: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.bookingRulesColumnsFamilyLink.is-empty {
  color: var(--shell-muted, #64748b);
  text-decoration: none;
}

.bookingRulesColumnsFamilyLink.is-empty:hover {
  text-decoration: underline;
}

/* 同名序列组：同组差异提示 / 待核实标签 / 新建统一列 */
.bookingRulesColumnGroupGap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
  margin-top: 4px;
  font-size: 12px;
  color: var(--shell-warn-text, #9a6700);
}

.bookingRulesColumnGroupGapText::before {
  content: "⚠ ";
}

.bookingRulesColumnGroupPendingTag {
  background: var(--shell-warn-bg, #fff4d6);
  color: var(--shell-warn-text, #9a6700);
}

.bookingRulesColumnsCreateButton {
  flex: 0 0 auto;
  align-self: flex-end;
  margin-left: auto;
}

.bookingRulesColumnCreateCandidate {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
}

.bookingRulesColumnsParallelField {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 10px 0 6px;
  cursor: pointer;
}

.bookingRulesColumnsParallelField input[type="checkbox"] {
  width: auto !important;
  min-width: 16px;
  min-height: 16px !important;
  margin: 0;
  padding: 0 !important;
  flex: 0 0 auto;
  accent-color: #0f6b63;
  appearance: auto !important;
  -webkit-appearance: checkbox !important;
  cursor: pointer;
}

.bookingRulesColumnEdit .tag.bookingRulesColumnsTag--on,
.bookingRulesColumnSwitches .tag.bookingRulesColumnsTag--on {
  background: #edf4f1;
  color: var(--shell-accent, #1f6b57);
}

.bookingRulesColumnEdit .tag.bookingRulesColumnsTag--warn,
.bookingRulesColumnSwitches .tag.bookingRulesColumnsTag--warn {
  background: #fff6e5;
  color: #9a6700;
}

.bookingRulesColumnEdit .tag.bookingRulesColumnsTag--off,
.bookingRulesColumnSwitches .tag.bookingRulesColumnsTag--off,
.bookingRulesRosterPausedList .tag.bookingRulesColumnsPausedTag {
  background: #fff1f0;
  color: #b42318;
}

.bookingRulesColumnsEditSection {
  margin: 16px 0 8px;
  font-size: 0.85rem;
  font-weight: 600;
}

.bookingRulesColumnsEditFeedback {
  margin: 0 0 10px;
  padding: 8px 10px;
  border-radius: 8px;
  background: #f4faf7;
  color: #315e50;
}

.bookingRulesColumnsEditFeedback[data-state="loading"] {
  background: #f7fafc;
  color: var(--shell-muted, #64748b);
}

.bookingRulesColumnsEditFeedback.is-error,
.bookingRulesColumnsEditFeedback[data-state="error"] {
  background: #fff5f3;
  color: #9b312e;
}

.bookingRulesColumnsHistory {
  margin: 0 0 8px;
}

.bookingRulesColumnsHistoryList {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 180px;
  overflow: auto;
  padding: 8px 10px;
  border: 1px solid var(--shell-border, #e2e8f0);
  border-radius: 8px;
  background: #fafbfc;
}

.bookingRulesColumnsHistoryRow {
  display: grid;
  grid-template-columns: 132px 72px minmax(0, 1fr);
  gap: 8px;
  align-items: baseline;
  font-size: 0.78rem;
  line-height: 1.35;
}

.bookingRulesColumnsHistoryTime {
  color: var(--shell-muted, #64748b);
  font-variant-numeric: tabular-nums;
}

.bookingRulesColumnsHistoryActor {
  color: #315e50;
  font-weight: 600;
}

.bookingRulesColumnsHistorySummary {
  color: var(--shell-ink, #0f172a);
  min-width: 0;
  overflow-wrap: anywhere;
}

@media (max-width: 720px) {
  .bookingRulesColumnsHistoryRow {
    grid-template-columns: 1fr;
    gap: 2px;
    padding-bottom: 6px;
    border-bottom: 1px solid #edf0f3;
  }

  .bookingRulesColumnsHistoryRow:last-child {
    border-bottom: 0;
    padding-bottom: 0;
  }
}

.bookingRulesMuted {
  color: var(--shell-muted, #64748b);
  font-size: 0.75rem;
}

tr.bookingRulesColumnsAssetRow td {
  background: #eef8f1;
  font-size: 0.72rem;
}

tr.bookingRulesColumnsAssetGroup td {
  background: #e5f4ea;
  padding-top: 8px;
  padding-bottom: 4px;
  border-bottom: none;
  font-weight: 600;
  color: var(--shell-text-secondary, #475569);
}

tr.bookingRulesColumnsAssetGroup .bookingRulesColumnsAssetGroupTitle::before {
  content: "";
  display: inline-block;
  width: 0.45em;
  height: 0.45em;
  margin-right: 6px;
  border-left: 2px solid var(--shell-muted, #94a3b8);
  border-bottom: 2px solid var(--shell-muted, #94a3b8);
  transform: translateY(-2px);
  vertical-align: middle;
}

tr.bookingRulesColumnsAssetMachine td {
  border-top: none;
}

tr.bookingRulesColumnsAssetMachine .bookingRulesColumnsAssetMachineLabel {
  padding-left: 28px;
}

tr.is-family-focus > td {
  background: #eef7f2;
}

.bookingRulesColumnsTable--compact th,
.bookingRulesColumnsTable--compact td {
  height: 34px;
  padding: 5px 8px;
  font-size: 0.76rem;
  line-height: 1.25;
  vertical-align: middle;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bookingRulesColumnsTable--booking th,
.bookingRulesColumnsTable--booking td {
  height: auto;
  min-height: 34px;
}

.bookingRulesColumnsTable--booking [data-column-coverage] {
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.bookingRulesColumnsTable--booking td.bookingRulesColumnsStoresCell {
  cursor: pointer;
  color: var(--shell-link, #2563eb);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.bookingRulesColumnsTable--booking td.bookingRulesColumnsStoresCell:hover {
  color: var(--shell-link-hover, #1d4ed8);
}

.bookingRulesColumnsTable--compact td.bookingRulesActionCell {
  width: 168px;
  min-width: 168px;
  white-space: nowrap;
  overflow: visible;
  text-overflow: clip;
  text-align: right;
}

.bookingRulesColumnsTable--booking td.bookingRulesActionCell,
.bookingRulesColumnsTable--booking th:last-child {
  width: 14.5rem;
  min-width: 14.5rem;
  max-width: 16rem;
  white-space: nowrap;
  overflow: visible;
  text-overflow: clip;
  text-align: right;
}

.bookingRulesColumnsTable--booking td.bookingRulesActionCell .btnLink {
  display: inline-block;
  margin-left: 8px;
  margin-right: 0;
  white-space: nowrap;
  vertical-align: middle;
}

.bookingRulesColumnsTable--booking td.bookingRulesActionCell .btnLink:first-child {
  margin-left: 0;
}

.bookingRulesColumnsTable--booking .bookingRulesSwitch {
  width: 2rem;
  height: 1.1rem;
}

.bookingRulesColumnsTable--booking .bookingRulesSwitchThumb {
  width: 0.85rem;
  height: 0.85rem;
}

.bookingRulesColumnsTable--booking .bookingRulesSwitch.is-on .bookingRulesSwitchThumb {
  transform: translateX(0.85rem);
}

.bookingRulesColumnSwitches {
  display: grid;
  gap: 8px;
  min-width: 0;
}

/* ---------- 品项族详情：所需预约列（全集团统一映射） ---------- */

.adminRuleFamilyMapList,
.adminRuleFamilyMapResults {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.adminRuleFamilyMapRow {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border: 1px solid var(--shell-border);
  border-radius: 8px;
  background: #fff;
  font-size: 0.8rem;
}

.adminRuleFamilyMapRow small {
  color: #6b7280;
}

.adminRuleFamilyMapRow .btnLink {
  margin-left: auto;
}

.bookingRulesRosterPausedList li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
}

/* ── 预约测试台 ── */
.testDrive {
  display: grid;
  gap: 10px;
  font-size: 0.82rem;
}

.testDriveNote {
  margin: 0;
  color: #4b5563;
}

.testDriveNote--muted {
  color: #9ca3af;
  font-size: 0.76rem;
}

.testDriveForm {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.testDriveLabel {
  color: #6b7280;
  font-size: 0.76rem;
}

.testDriveSelect,
.testDriveInput {
  min-height: 32px;
  padding: 0 8px;
  border: 1px solid var(--shell-border);
  border-radius: 8px;
  background: #fff;
  font-size: 0.8rem;
}

.testDriveSearch {
  width: 100%;
  max-width: 420px;
}

.testDriveRun {
  min-height: 32px;
  padding: 0 14px;
  border: 0;
  border-radius: 8px;
  background: rgb(15, 107, 99);
  color: #fff;
  font-size: 0.8rem;
  cursor: pointer;
}

.testDriveRun:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.testDriveReadiness {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.testDriveChip {
  padding: 2px 8px;
  border: 1px solid var(--shell-border);
  border-radius: 999px;
  background: #f9fafb;
  font-size: 0.72rem;
  color: #4b5563;
}

.testDriveProjects {
  display: grid;
  gap: 4px;
  max-height: 220px;
  overflow: auto;
}

.testDriveProject {
  text-align: left;
  padding: 6px 10px;
  border: 1px solid var(--shell-border);
  border-radius: 8px;
  background: #fff;
  font-size: 0.78rem;
  cursor: pointer;
}

.testDriveProject.is-active {
  border-color: rgb(15, 107, 99);
  background: #ecfdf5;
}

.testDriveVerdict {
  margin: 6px 0 0;
  font-size: 0.92rem;
}

.testDriveVerdict--pass { color: rgb(15, 107, 99); }
.testDriveVerdict--warn { color: #b45309; }
.testDriveVerdict--fail { color: #b91c1c; }

.testDriveSteps {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: testDriveStep;
}

.testDriveStep {
  padding: 8px 10px;
  border: 1px solid var(--shell-border);
  border-radius: 8px;
  background: #fff;
}

.testDriveStep--fail { border-color: #fecaca; background: #fef2f2; }
.testDriveStep--warn { border-color: #fde68a; background: #fffbeb; }

.testDriveStepHead {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}

.testDriveStepHead strong {
  font-size: 0.8rem;
}

.testDriveStepBadge {
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 0.7rem;
}

.testDriveStepBadge--pass { background: #d1fae5; color: #065f46; }
.testDriveStepBadge--warn { background: #fef3c7; color: #92400e; }
.testDriveStepBadge--fail { background: #fee2e2; color: #991b1b; }
.testDriveStepBadge--skip { background: #f3f4f6; color: #6b7280; }

.testDriveStepSummary {
  color: #4b5563;
  font-size: 0.76rem;
}

.testDriveStepDetails summary {
  cursor: pointer;
  color: #6b7280;
  font-size: 0.74rem;
}

.testDriveStepDetails pre {
  max-height: 260px;
  overflow: auto;
  margin: 6px 0 0;
  padding: 8px;
  border-radius: 6px;
  background: #f9fafb;
  font-size: 0.72rem;
}

/* ── 测试台 · 当日预约面板 ── */
.testDriveBoardHead {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 8px 0 0;
}

.testDriveBoardTitle {
  margin: 0;
  font-size: 0.86rem;
}

.testDriveBoardMode {
  display: inline-flex;
  border: 1px solid var(--shell-border);
  border-radius: 999px;
  overflow: hidden;
}

.testDriveBoardModeBtn {
  border: 0;
  background: #fff;
  padding: 3px 10px;
  font-size: 0.74rem;
  cursor: pointer;
}

.testDriveBoardModeBtn.is-active {
  background: #111827;
  color: #fff;
}

.testDriveBoardModeBtn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.testDriveBoardReshuffle {
  border: 1px solid var(--shell-border);
  background: #fff;
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 0.74rem;
  cursor: pointer;
}

.testDriveBoard {
  overflow-x: auto;
  padding-bottom: 6px;
}

.testDriveBoardGrid {
  display: flex;
  gap: 6px;
  min-width: min-content;
}

.testDriveBoardAxis {
  width: 44px;
  flex: none;
}

.testDriveBoardAxisBody {
  position: relative;
}

.testDriveBoardTick {
  position: absolute;
  left: 0;
  transform: translateY(-50%);
  font-size: 0.66rem;
  color: #9ca3af;
}

.testDriveBoardLanes {
  display: flex;
  gap: 14px;
}

.testDriveBoardGroupLabel {
  font-size: 0.72rem;
  color: #6b7280;
  margin-bottom: 4px;
}

.testDriveBoardGroupLanes {
  display: flex;
  gap: 4px;
}

.testDriveBoardLane {
  width: 92px;
  flex: none;
}

.testDriveBoardLane.is-closed {
  opacity: 0.42;
}

.testDriveBoardLaneHead {
  position: sticky;
  top: 0;
  z-index: 2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 2px 4px;
  border-radius: 6px 6px 0 0;
  background: #f3f4f6;
  border: 1px solid var(--shell-border);
  border-bottom: 0;
  font-size: 0.68rem;
  text-align: center;
}

.testDriveBoardLaneBody {
  position: relative;
  border: 1px solid var(--shell-border);
  border-radius: 0 0 6px 6px;
  background:
    repeating-linear-gradient(
      to bottom,
      #fff 0,
      #fff 39px,
      #f3f4f6 39px,
      #f3f4f6 40px
    );
}

.testDriveBoardCell {
  position: absolute;
  left: 0;
  width: calc(100% - 3px);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 1px 4px;
  border-radius: 4px;
  background: #dbeafe;
  border: 1px solid #93c5fd;
  color: #1e3a8a;
  font-size: 0.66rem;
  line-height: 1.4;
}

.testDriveBoardCell--test {
  background: #d1fae5;
  border-color: rgb(15, 107, 99);
  color: #065f46;
  font-weight: 600;
  z-index: 1;
  cursor: pointer; /* 点击已选块 = 取消该程 */
}

.testDriveBoardCell--test:hover {
  background: #a7f3d0;
}

.testDriveBoardCell--sim {
  background: #fef3c7;
  border-color: #f59e0b;
  color: #92400e;
}

/* ── 测试台 · 空档挑选 ── */
.testDriveSlotPick {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.testDriveSlotPick > h3 {
  flex-basis: 100%;
}

.testDriveSlot {
  padding: 3px 8px;
  border: 1px solid var(--shell-border);
  border-radius: 999px;
  background: #fff;
  font-size: 0.74rem;
  cursor: pointer;
  white-space: nowrap;
}

.testDriveSlot.is-active {
  border-color: rgb(15, 107, 99);
  background: #ecfdf5;
  font-weight: 600;
}

/* ── 测试台 · 交互精简化 ── */
.testDriveRelink {
  border: 0;
  background: none;
  padding: 2px 0;
  color: #6b7280;
  font-size: 0.76rem;
  text-decoration: underline;
  cursor: pointer;
}

.testDrivePassChips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 4px 0;
}

.testDrivePassChip {
  padding: 2px 8px;
  border-radius: 999px;
  background: #d1fae5;
  color: #065f46;
  font-size: 0.7rem;
  cursor: default;
}

.testDriveBoardCell--candidate {
  background: rgba(209, 250, 229, 0.35);
  border: 1px dashed rgb(15, 107, 99);
  color: #065f46;
  cursor: pointer;
}

.testDriveBoardCell--candidate:hover {
  background: rgba(209, 250, 229, 0.75);
}

.testDriveBoardCell--candidate.is-dim {
  opacity: 0.35;
  cursor: default;
  border-style: dotted;
  pointer-events: none; /* 预告块垫在可点块下方，不拦截点击 */
}

.testDriveBoardCell--candidate.is-dim:hover {
  background: rgba(209, 250, 229, 0.35);
}

/* 第二程可衔接起点（ep1.end + gap） */
.testDriveBoardCell--next {
  background: rgba(254, 243, 199, 0.55);
  border: 1px dashed #b45309;
  color: #92400e;
  cursor: pointer;
}

.testDriveBoardCell--next:hover {
  background: rgba(253, 230, 138, 0.85);
}

.testDriveBoardLaneRole {
  display: inline-block;
  margin-left: 4px;
  padding: 0 5px;
  border-radius: 4px;
  background: #0f6b63;
  color: #fff;
  font-size: 0.62rem;
  line-height: 1.5;
  vertical-align: middle;
}

.testDriveManualBar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.testDriveManualText {
  font-size: 0.86rem;
  font-weight: 600;
  color: #065f46;
}

.testDrivePresets {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin: 8px 0;
}

.testDrivePreset {
  padding: 4px 12px;
  border: 1px solid #0f6b63;
  border-radius: 999px;
  background: #fff;
  color: #0f6b63;
  font-size: 0.8rem;
  cursor: pointer;
}

.testDrivePreset:hover {
  background: #0f6b63;
  color: #fff;
}

/* ── 测试台 · 项目规则识别卡片 ── */
.testDriveRuleCard {
  padding: 10px 12px;
  border: 1px solid var(--shell-border);
  border-radius: 10px;
  background: #f8fafc;
}

.testDriveRuleCard h3 {
  margin: 0 0 6px;
}

.testDriveRuleGrid {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 4px 14px;
  margin: 0;
  font-size: 0.78rem;
}

.testDriveRuleGrid dt {
  color: #6b7280;
  white-space: nowrap;
}

.testDriveRuleGrid dd {
  margin: 0;
  color: #1f2937;
}

/* ── 测试台 · 未治疗项目 ── */
.testDriveUntreated {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.testDriveUntreatedChip {
  padding: 3px 10px;
  border: 1px solid #93c5fd;
  border-radius: 999px;
  background: #eff6ff;
  color: #1e40af;
  font-size: 0.74rem;
  cursor: pointer;
}

.testDriveUntreatedChip:hover {
  background: #dbeafe;
}

/* ── 测试台 · 排版收紧 ── */
.testDriveSearches {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.testDriveSearches .testDriveSearch {
  flex: 1 1 200px;
  width: auto;
  max-width: none;
}

/* ── 测试台 · 客户确认胶囊 ── */
.testDriveCustomerChip {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 3px 10px;
  border: 1px solid rgb(15, 107, 99);
  border-radius: 999px;
  background: #ecfdf5;
  color: #065f46;
  font-size: 0.76rem;
  cursor: pointer;
}

/* ── 统一回写 ── */
.writebackPage {
  display: grid;
  gap: 16px;
}

.writebackSummary {
  margin: 0;
  font-size: 0.82rem;
}

.writebackBlock {
  display: grid;
  gap: 8px;
}

.writebackBlock .bookingRulesTable {
  width: 100%;
}

/* 数据同步 · 同步健康与对账（后台勾选 vs 睿美云开班） */
.dataSyncHealth {
  display: grid;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid var(--adminRuleBorder, #d9dee7);
  border-radius: 8px;
  background: #fff;
}
.dataSyncHealthCards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 8px;
}
.dataSyncHealthCard {
  display: grid;
  gap: 2px;
  padding: 8px 10px;
  border-radius: 6px;
  border-left: 4px solid #9ca3af;
  background: #f8fafc;
  font-size: 0.76rem;
  color: #4b5563;
}
.dataSyncHealthCard > strong {
  font-size: 0.82rem;
  color: #0f172a;
}
.dataSyncHealthCard--ok { border-left-color: #16a34a; }
.dataSyncHealthCard--danger { border-left-color: #dc2626; background: #fef2f2; }
.dataSyncHealthCard--muted { border-left-color: #9ca3af; color: #6b7280; }
.dataSyncHealthError { color: #b91c1c; }
.dataSyncReconcileTitle {
  margin: 4px 0 0;
  font-size: 0.82rem;
  color: #0f172a;
}
.dataSyncIssue--high td:first-child { color: #b91c1c; font-weight: 600; }
.dataSyncIssue--warn td:first-child { color: #b45309; font-weight: 600; }
.dataSyncIssue--info td:first-child { color: #6b7280; }
.testDriveNote--danger { color: #b91c1c; }
.dataSyncIssueDetails { margin-top: 4px; font-size: 0.72rem; color: #6b7280; }
.dataSyncIssueDetails summary { cursor: pointer; color: #2563eb; }
