/* pages-settings-center.css —— 设置中心四页：房型信息 / 房间管理 / 班次设置 / 赔偿设置
 *
 * 作用域：所有规则以 .pages-sc / .pages-sc-* 开头，复用 pages.css 的 .pages / .pages-*
 * 与 styles.css 的 .panel / .table / .btn / .empty-state 视觉，不修改任何既有类名。
 *
 * 依赖：必须排在 css/pages.css 之后（.pages 提供 --pg-* 品牌变量；本文件同时给兜底）。
 * 断点：宿主 ≥900px 才挂载；≤899px 提供单列兜底（筛选逐行、抽屉全宽、表单单列），
 * 表格保持横向滚动，避免窄窗挤压。
 *
 * 视觉基准：13px 正文、#087c61 主色、#dbe7f2 描边、14px 圆角面板、表格行 hover 浅底。
 */

/* ========================================================================== */
/* 1. 变量 / 外壳                                                              */
/* ========================================================================== */
.pages-sc {
  --sc-brand: var(--pg-brand, #087c61);
  --sc-brand-deep: var(--pg-brand-deep, #0b3d66);
  --sc-ink: var(--pg-ink, #193b34);
  --sc-ink-soft: var(--pg-ink-soft, #31546e);
  --sc-muted: var(--pg-muted, #7c9188);
  --sc-line: var(--pg-line, #dbe7f2);
  --sc-line-soft: var(--pg-line-soft, #edf3f9);
  --sc-surface: var(--pg-surface, #ffffff);
  --sc-ok: #0b8968;
  --sc-ok-bg: #e6f5ee;
  --sc-bad: #c0392b;
  --sc-bad-bg: #fbeae7;
  --sc-warn: #a26a1d;
  --sc-warn-bg: #fdf2e2;
  position: relative;
  min-width: 0;
}

.pages-sc *,
.pages-sc *::before,
.pages-sc *::after {
  box-sizing: border-box;
}

/* 空 region 不占 flex gap（flash/drawer/confirm 常态为空） */
.pages-sc [data-pages-region]:empty {
  display: none;
}

/* ========================================================================== */
/* 2. 筛选区 / 面板头                                                          */
/* ========================================================================== */
.pages-sc-filters {
  align-items: flex-end;
}

.pages-sc-filters .pages-field {
  flex: 1 1 180px;
  max-width: 300px;
}

.pages-sc-filters .pages-filter-actions {
  margin-left: auto;
}

.pages-sc-filter-hint {
  flex: 1 1 100%;
}

.pages-sc-panel {
  padding: 18px 20px 20px;
}

.pages-sc-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px 20px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.pages-sc-head-main {
  min-width: 0;
  flex: 1 1 420px;
}

.pages-sc-head-main .section-title {
  margin: 0 0 5px;
  font-size: 16px;
}

.pages-sc-sub {
  margin: 0;
  color: var(--sc-muted);
  font-size: 11px;
  line-height: 1.7;
}

.pages-sc-sub strong {
  color: var(--sc-ink-soft);
  font-variant-numeric: tabular-nums;
}

.pages-sc-head-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  flex: 0 0 auto;
}

.pages-sc-sorthint {
  margin: -4px 0 12px;
  padding: 8px 10px;
  border: 1px dashed #cfe1d9;
  border-radius: 8px;
  background: #f7fbf9;
}

/* ========================================================================== */
/* 3. 表格                                                                     */
/* ========================================================================== */
.pages-sc-table-wrap {
  position: relative;
  max-height: 62vh;
  overflow: auto;
  border: 1px solid var(--sc-line-soft);
  border-radius: 10px;
  background: #fff;
}

.pages-sc-table-wrap.is-loading {
  opacity: .62;
  pointer-events: none;
}

.pages-sc-table {
  width: 100%;
  min-width: 1040px;
  border-collapse: collapse;
}

.pages-sc-rooms-table { min-width: 1220px; }
.pages-sc-shift-table { min-width: 820px; }

.pages-sc-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 10px 12px;
  border-bottom: 1px solid var(--sc-line);
  background: #f7faf9;
  color: #6d857c;
  font-size: 11px;
  font-weight: 800;
  text-align: left;
  white-space: nowrap;
}

.pages-sc-table tbody td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--sc-line-soft);
  color: var(--sc-ink);
  font-size: 12px;
  vertical-align: middle;
}

.pages-sc-table tbody tr:last-child td {
  border-bottom: 0;
}

.pages-sc-table tbody tr:hover td {
  background: #fbfdfc;
}

.pages-sc-table .pages-num {
  text-align: right;
}

.pages-sc-strong {
  color: var(--sc-ink);
  font-weight: 800;
}

.pages-sc-code {
  display: inline-block;
  padding: 2px 6px;
  border: 1px solid #dbe7f2;
  border-radius: 5px;
  background: #f7faff;
  color: #2f5f8a;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
  letter-spacing: .3px;
}

.pages-sc-mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
  color: #45657c;
  font-variant-numeric: tabular-nums;
}

.pages-sc-muted {
  color: #9aa9a3;
}

.pages-sc-roomno {
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  letter-spacing: .3px;
}

.pages-sc-remark {
  max-width: 180px;
}

.pages-sc-remark > span {
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: bottom;
}

/* —— 状态 / 来源 pill —— */
.pages-sc-pill {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 8px;
  border-radius: 5px;
  background: #eef2f7;
  color: #5b7186;
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
}

.pages-sc-pill.is-on { background: var(--sc-ok-bg); color: #0b7a5c; }
.pages-sc-pill.is-off { background: #eef2f7; color: #6f8298; }
.pages-sc-pill.is-store { background: #eef4fb; color: #2f6b9e; }
.pages-sc-pill.is-direct { background: #f1ecfb; color: #6a51a8; }
.pages-sc-pill.is-all { background: #eef2f7; color: #5b7186; }

/* —— 排序 / 操作 —— */
.pages-sc-sortcol { width: 150px; }
.pages-sc-sortcell {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}
.pages-sc-sortcell input {
  width: 62px;
  height: 30px;
  padding: 0 8px;
  border: 1px solid var(--sc-line);
  border-radius: 7px;
  font: inherit;
  font-size: 12px;
  color: var(--sc-ink);
  outline: 0;
}
.pages-sc-sortcell input:focus {
  border-color: var(--sc-brand);
  box-shadow: 0 0 0 3px #087c611a;
}
.pages-sc-sortcell .pages-field-error {
  flex: 1 1 100%;
  max-width: 160px;
}

.pages-sc-actions { flex-wrap: wrap; }

.pages-sc-move {
  min-width: 26px;
  padding: 2px 0 !important;
  font-size: 12px;
  line-height: 1;
}

.pages-sc-actions-col { width: 210px; }

/* —— 房间特色标签 —— */
.pages-sc-tags {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
  max-width: 230px;
}

.pages-sc-tag {
  display: inline-block;
  padding: 2px 6px;
  border: 1px solid #d9e6f0;
  border-radius: 5px;
  background: #f6fafd;
  color: #38617f;
  font-size: 10px;
  line-height: 1.5;
  white-space: nowrap;
}

.pages-sc-tag.is-more {
  border-color: #e5e1f1;
  background: #f7f5fc;
  color: #6a51a8;
}

.pages-sc-photo {
  display: inline-block;
  max-width: 150px;
  overflow: hidden;
  color: #2f6b9e;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-decoration: none;
  vertical-align: bottom;
}
.pages-sc-photo:hover { text-decoration: underline; }
.pages-sc-photocol { max-width: 160px; }

/* —— 空态 / 骨架 / 降级 —— */
.pages-sc-empty {
  padding: 44px 18px;
  border: 1px dashed #dbe7f2;
  border-radius: 12px;
  background: linear-gradient(180deg, #fbfdfe, #fff);
}

.pages-sc-empty span { font-size: 26px; margin-bottom: 8px; }

.pages-sc-empty strong { color: var(--sc-ink-soft); }

.pages-sc-empty p {
  margin: 6px auto 14px;
  max-width: 52ch;
  color: var(--sc-muted);
  font-size: 11px;
  line-height: 1.7;
}

.pages-sc-skeleton-bar {
  display: block;
  height: 18px;
  border-radius: 7px;
  background: linear-gradient(90deg, #eef2f7 25%, #f9fbfd 37%, #eef2f7 63%);
  background-size: 400% 100%;
  animation: pagesScShimmer 1.25s ease-in-out infinite;
}

@keyframes pagesScShimmer {
  0% { background-position: 100% 50%; }
  100% { background-position: 0 50%; }
}

.pages-sc-degrade {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 20px 22px;
  border: 1px dashed #c9d9e8;
  border-radius: 12px;
  background: linear-gradient(180deg, #f8fbfe, #fff);
}

.pages-sc-degrade.is-error {
  border-color: #efd3cd;
  background: linear-gradient(180deg, #fdf8f7, #fff);
}

.pages-sc-degrade-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #eaf2fa;
  color: #4a7195;
  font-size: 18px;
  font-weight: 800;
}

.pages-sc-degrade.is-error .pages-sc-degrade-icon {
  background: var(--sc-bad-bg);
  color: var(--sc-bad);
}

.pages-sc-degrade > div {
  flex: 1 1 320px;
  min-width: 0;
}

.pages-sc-degrade strong {
  display: block;
  margin-bottom: 4px;
  color: var(--sc-ink);
  font-size: 13px;
}

.pages-sc-degrade p {
  margin: 0 0 5px;
  color: var(--sc-ink-soft);
  font-size: 11px;
  line-height: 1.75;
}

.pages-sc-degrade code {
  padding: 1px 5px;
  border-radius: 4px;
  background: #eef4fb;
  color: #2f6b9e;
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 10px;
}

.pages-sc-degrade > .btn { flex: 0 0 auto; align-self: center; }

/* ========================================================================== */
/* 4. 班次行内编辑                                                             */
/* ========================================================================== */
.pages-sc-shift-table td {
  vertical-align: middle;
}

.pages-sc-sortinput,
.pages-sc-textinput {
  height: 34px;
  padding: 0 9px;
  border: 1px solid var(--sc-line);
  border-radius: 8px;
  background: #fff;
  color: var(--sc-ink);
  font: inherit;
  font-size: 12px;
  outline: 0;
}

.pages-sc-sortinput { width: 76px; font-variant-numeric: tabular-nums; }
.pages-sc-textinput { width: 100%; min-width: 170px; }

.pages-sc-sortinput:focus,
.pages-sc-textinput:focus,
.pages-sc-time input:focus {
  border-color: var(--sc-brand);
  box-shadow: 0 0 0 3px #087c611a;
}

.pages-sc-sortinput:disabled,
.pages-sc-textinput:disabled,
.pages-sc-time input:disabled {
  background: #f5f8f7;
  color: var(--sc-muted);
}

.pages-sc-time {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.pages-sc-time input[type="time"] {
  width: 116px;
  height: 34px;
  padding: 0 6px;
  border: 1px solid var(--sc-line);
  border-radius: 8px;
  background: #fff;
  color: var(--sc-ink);
  font: inherit;
  font-size: 12px;
  outline: 0;
}

.pages-sc-time-dash {
  color: var(--sc-muted);
  font-weight: 800;
}

.pages-sc-overnight {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 6px;
  border-radius: 4px;
  background: var(--sc-warn-bg);
  color: var(--sc-warn);
  font-size: 9px;
  font-weight: 800;
  white-space: nowrap;
}

.pages-sc-overnight[hidden] { display: none; }

.pages-sc-overnight-hint {
  display: block;
  min-height: 14px;
  margin-top: 3px;
  color: var(--sc-warn);
  font-size: 10px;
  line-height: 1.4;
}

.pages-sc-newrow td {
  background: #f6fcf8;
}

.pages-sc-newrow td:first-child {
  box-shadow: inset 3px 0 0 var(--sc-brand);
}

.pages-sc-table tbody tr[data-dirty="true"] td:first-child {
  box-shadow: inset 3px 0 0 #d9b06a;
}

.pages-sc-rowerror td {
  padding: 6px 12px 10px !important;
  background: #fdf8f7 !important;
  border-bottom: 1px solid #f3ded9 !important;
}

.pages-sc-rowerror .pages-hint {
  margin-left: 8px;
}

.pages-sc-table-foot {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.pages-sc-table-foot .pages-hint {
  flex: 1 1 300px;
}

/* ========================================================================== */
/* 5. 抽屉 / 对话框                                                            */
/* ========================================================================== */
.pages-sc-overlay {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: flex;
  align-items: stretch;
  justify-content: flex-end;
  background: #102f2866;
  backdrop-filter: blur(1px);
}

.pages-sc-overlay.is-center {
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.pages-sc-drawer {
  display: flex;
  flex-direction: column;
  width: 540px;
  max-width: 96vw;
  height: 100%;
  min-height: 0;
  background: #fff;
  border-left: 1px solid #dce8e3;
  box-shadow: -18px 0 50px #102f2824;
  animation: pagesScSlideIn .18s ease-out;
}

.pages-sc-drawer.is-wide { width: 620px; }

@keyframes pagesScSlideIn {
  from { transform: translateX(24px); opacity: .6; }
  to { transform: translateX(0); opacity: 1; }
}

.pages-sc-drawer-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--sc-line-soft);
}

.pages-sc-drawer-head h3 {
  margin: 0 0 3px;
  color: var(--sc-ink);
  font-size: 16px;
}

.pages-sc-drawer-head p {
  margin: 0;
  max-width: 58ch;
  color: var(--sc-muted);
  font-size: 11px;
  line-height: 1.6;
}

.pages-sc-drawer-form {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.pages-sc-drawer-body {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 18px 20px;
}

.pages-sc-drawer-foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
  padding: 14px 20px;
  border-top: 1px solid var(--sc-line-soft);
  background: #fcfdfd;
}

.pages-sc-foot-spacer { flex: 1 1 auto; }

.pages-sc-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.pages-sc-form-grid > .pages-field {
  flex: initial;
}

.pages-sc-form-grid .pages-field > span:first-child {
  color: var(--sc-ink-soft);
}

.pages-sc-dialog {
  width: 440px;
  max-width: 100%;
  padding: 22px 24px 20px;
  background: #fff;
  border-radius: 15px;
  box-shadow: 0 24px 70px #092f2b45;
  animation: pagesScPop .16s ease-out;
}

@keyframes pagesScPop {
  from { transform: translateY(6px) scale(.985); opacity: .7; }
  to { transform: translateY(0) scale(1); opacity: 1; }
}

.pages-sc-dialog h3 {
  margin: 0 0 8px;
  color: var(--sc-ink);
  font-size: 16px;
}

.pages-sc-dialog > p {
  margin: 0 0 6px;
  color: var(--sc-ink-soft);
  font-size: 12px;
  line-height: 1.75;
}

.pages-sc-dialog-foot {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 18px;
}

.pages-sc-dialog .pages-error {
  margin: 10px 0 0;
}

/* —— 只读详情 —— */
.pages-sc-viewgrid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin: 0;
}

.pages-sc-viewgrid > div {
  padding: 10px 12px;
  border: 1px solid var(--sc-line-soft);
  border-radius: 9px;
  background: #fbfdfc;
}

.pages-sc-viewgrid dt {
  margin-bottom: 4px;
  color: var(--sc-muted);
  font-size: 10px;
  font-weight: 800;
}

.pages-sc-viewgrid dd {
  margin: 0;
  color: var(--sc-ink);
  font-size: 13px;
  font-weight: 700;
  word-break: break-all;
}

/* —— 房间特色多选 —— */
.pages-sc-tagpicker {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.pages-sc-tagpick {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border: 1px solid var(--sc-line);
  border-radius: 8px;
  background: #fff;
  color: var(--sc-ink-soft);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  user-select: none;
}

.pages-sc-tagpick:hover { border-color: #b9d6c9; background: #f7fbf9; }

.pages-sc-tagpick input {
  margin: 0;
  accent-color: var(--sc-brand);
}

.pages-sc-tagpick:has(input:checked) {
  border-color: #9ed3bd;
  background: #f1faf5;
  color: #0b7a5c;
}

/* ========================================================================== */
/* 6. 窄窗兜底（≤899px）                                                       */
/* ========================================================================== */
@media (max-width: 899px) {
  .pages-sc-filters {
    flex-direction: column;
    align-items: stretch;
  }

  .pages-sc-filters .pages-field {
    flex: 1 1 auto;
    max-width: none;
  }

  .pages-sc-filters .pages-filter-actions {
    width: 100%;
    margin-left: 0;
  }

  .pages-sc-panel-head {
    flex-direction: column;
    align-items: stretch;
  }

  .pages-sc-head-actions {
    justify-content: flex-start;
  }

  .pages-sc-form-grid,
  .pages-sc-viewgrid {
    grid-template-columns: minmax(0, 1fr);
  }

  .pages-sc-drawer,
  .pages-sc-drawer.is-wide {
    width: 100%;
    max-width: none;
  }

  .pages-sc-table-wrap { max-height: none; }
}

@media (prefers-reduced-motion: reduce) {
  .pages-sc-drawer,
  .pages-sc-dialog { animation: none; }
  .pages-sc-skeleton-bar { animation: none; }
}
