/* ==========================================================================
   排班管理系统 · 组件样式
   ========================================================================== */

/* ---------------------------------------------------------------- 卡片 */
.card {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  margin-bottom: 16px;
  overflow: hidden;
}

.card__head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--c-border);
  background: var(--c-surface);
  /* 挤不下时换行。不换行的话，长描述 + 多个按钮会把标题压到
     只剩一个字宽（中文的 min-content 就是一个字），落成一字一行。 */
  flex-wrap: wrap;
}

.card__title {
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  /* 标题不参与收缩：宁可让描述换到下一行 */
  flex: none;
}

.card__title::before {
  content: "";
  width: 3px;
  height: 14px;
  border-radius: 2px;
  background: var(--c-primary);
}

.card__desc {
  font-size: 12px;
  color: var(--c-text-mute);
  min-width: 0;
}

.card__actions {
  margin-left: auto;
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.card__body {
  padding: 16px;
}

.card__body--flush {
  padding: 0;
}

.card__foot {
  padding: 11px 16px;
  border-top: 1px solid var(--c-border);
  background: var(--c-surface-2);
  display: flex;
  gap: 8px;
  align-items: center;
}

/* ---------------------------------------------------------------- 栅格 */
.grid {
  display: grid;
  gap: 14px;
}

.grid--2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.grid--3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.grid--4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
/* 排班页有虚拟员工时会多出「人员缺口」一张卡 */
.grid--5 {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}
.grid--auto {
  grid-template-columns: repeat(auto-fill, minmax(215px, 1fr));
}

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

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 0 16px;
}

.form-grid--tight {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

/* 多选清单（账号管理里的「可用模块 / 可管辖门店」） */
.check-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 6px 14px;
  padding: 8px 10px;
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  background: var(--c-surface-2);
}

/* ---------------------------------------------------------------- 统计卡 */
.stat {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}

.stat__label {
  font-size: 12.5px;
  color: var(--c-text-sub);
  display: flex;
  align-items: center;
  gap: 6px;
}

.stat__value {
  font-size: 24px;
  font-weight: 700;
  margin-top: 5px;
  letter-spacing: -0.4px;
  line-height: 1.25;
}

.stat__unit {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--c-text-sub);
  margin-left: 3px;
}

.stat__foot {
  font-size: 11.5px;
  color: var(--c-text-mute);
  margin-top: 5px;
}

.stat--primary {
  border-top: 3px solid var(--c-primary);
}
.stat--success {
  border-top: 3px solid var(--c-success);
}
.stat--warn {
  border-top: 3px solid var(--c-warn);
}
.stat--danger {
  border-top: 3px solid var(--c-danger);
}

/* ---------------------------------------------------------------- 工具条 */
.toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 11px 16px;
  background: var(--c-surface-2);
  border-bottom: 1px solid var(--c-border);
}

.toolbar__spacer {
  flex: 1;
}

.toolbar__label {
  font-size: 12.5px;
  color: var(--c-text-sub);
}

.toolbar .input,
.toolbar .select {
  width: auto;
  min-width: 130px;
}

/* ---------------------------------------------------------------- 表格 */
.table-wrap {
  width: 100%;
  overflow: auto;
}

.table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
}

.table th {
  position: sticky;
  top: 0;
  z-index: 3;
  background: var(--c-surface-2);
  text-align: left;
  font-weight: 600;
  font-size: 12.5px;
  color: var(--c-text-sub);
  padding: 9px 12px;
  border-bottom: 1px solid var(--c-border);
  white-space: nowrap;
}

.table td {
  padding: 9px 12px;
  border-bottom: 1px solid var(--c-border);
  vertical-align: middle;
}

.table tbody tr:hover td {
  background: #f8fafd;
}

.table tbody tr.is-selected td {
  background: var(--c-primary-soft);
}

/* 不可选中的行（如指派员工弹窗里条件不符的员工） */
.table tbody tr.mute-row td {
  background: var(--c-surface-2);
  color: var(--c-text-mute);
}

.table--compact th,
.table--compact td {
  padding: 6px 10px;
}

.table--bordered th,
.table--bordered td {
  border-right: 1px solid var(--c-border);
}

.table__empty {
  padding: 40px 16px !important;
  text-align: center;
  color: var(--c-text-mute);
}

.table__actions {
  display: flex;
  gap: 4px;
  white-space: nowrap;
}

.col-num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* ---------------------------------------------------------------- 徽章 */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 11.5px;
  line-height: 1.7;
  border: 1px solid transparent;
  white-space: nowrap;
}

.badge--gray {
  background: var(--c-surface-3);
  color: var(--c-text-sub);
  border-color: var(--c-border);
}
.badge--blue {
  background: var(--c-primary-soft);
  color: #1d4ed8;
  border-color: var(--c-primary-border);
}
.badge--green {
  background: var(--c-success-soft);
  color: #047857;
  border-color: #a7f3d0;
}
.badge--amber {
  background: var(--c-warn-soft);
  color: #b45309;
  border-color: #fde68a;
}
.badge--red {
  background: var(--c-danger-soft);
  color: var(--c-danger);
  border-color: #fecaca;
}
.badge--cyan {
  background: var(--c-info-soft);
  color: #0e7490;
  border-color: #a5f3fc;
}

/* ---------------------------------------------------------------- 空状态 */
.empty {
  padding: 46px 20px;
  text-align: center;
  color: var(--c-text-mute);
}

.empty__icon {
  font-size: 32px;
  opacity: 0.45;
  margin-bottom: 8px;
}

.empty__text {
  font-size: 13px;
}

.empty__hint {
  font-size: 12px;
  margin-top: 4px;
  color: var(--c-text-mute);
}

/* ---------------------------------------------------------------- 加载 */
.loading {
  padding: 40px;
  text-align: center;
  color: var(--c-text-mute);
  display: grid;
  place-items: center;
  gap: 10px;
}

.skeleton {
  height: 14px;
  border-radius: 4px;
  background: linear-gradient(90deg, #eef1f6 25%, #e4e9f1 37%, #eef1f6 63%);
  background-size: 400% 100%;
  animation: shimmer 1.3s ease-in-out infinite;
  margin-bottom: 8px;
}

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

/* ---------------------------------------------------------------- 标签页 */
.tabs {
  display: flex;
  gap: 2px;
  border-bottom: 1px solid var(--c-border);
  padding: 0 16px;
  background: var(--c-surface);
  overflow-x: auto;
}

.tab {
  padding: 9px 14px;
  font-size: 13px;
  color: var(--c-text-sub);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  user-select: none;
  transition: color 0.12s;
}

.tab:hover {
  color: var(--c-primary);
}

.tab.is-active {
  color: var(--c-primary);
  border-bottom-color: var(--c-primary);
  font-weight: 600;
}

.tab__count {
  font-size: 11px;
  color: var(--c-text-mute);
  margin-left: 4px;
}

/* ---------------------------------------------------------------- 弹窗 */
.modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  display: grid;
  place-items: center;
  z-index: 1000;
  padding: 24px;
  /* 列宽必须锁死在容器内：留空会退化成隐式 auto 列，被弹窗里的宽表格
     （门店列表的 min-content 约 787px）撑宽，弹窗跟着溢出小屏。
     minmax(0, 1fr) 的 min 是 0，内容再宽也顶不动这一列。 */
  grid-template-columns: minmax(0, 1fr);
  animation: fadeIn 0.14s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
}

.modal {
  background: var(--c-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 520px;
  max-height: calc(100vh - 60px);
  /* 允许被压到比内容更窄（内容交给内部的 .table-wrap 横向滚动） */
  min-width: 0;
  display: flex;
  flex-direction: column;
  animation: popIn 0.16s ease;
}

@keyframes popIn {
  from {
    opacity: 0;
    transform: translateY(-8px) scale(0.985);
  }
}

.modal--wide {
  max-width: 720px;
}
.modal--xwide {
  max-width: 940px;
}
.modal--narrow {
  max-width: 400px;
}

.modal__head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--c-border);
}

.modal__title {
  font-size: 15px;
  font-weight: 600;
  flex: 1;
}

.modal__close {
  border: none;
  background: none;
  font-size: 19px;
  line-height: 1;
  color: var(--c-text-mute);
  cursor: pointer;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
}

.modal__close:hover {
  background: var(--c-surface-3);
  color: var(--c-text);
}

.modal__body {
  padding: 18px;
  overflow-y: auto;
}

.modal__foot {
  padding: 12px 18px;
  border-top: 1px solid var(--c-border);
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  background: var(--c-surface-2);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

.modal__msg {
  font-size: 13.5px;
  line-height: 1.7;
  color: var(--c-text);
  white-space: pre-wrap;
}

.modal__icon {
  font-size: 19px;
  flex: none;
}

/* ---------------------------------------------------------------- Toast */
.toast-host {
  position: fixed;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  border-radius: var(--radius);
  background: #1e2937;
  color: #fff;
  font-size: 13px;
  box-shadow: var(--shadow-lg);
  animation: toastIn 0.18s ease;
  max-width: 520px;
  pointer-events: auto;
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
}

.toast--success {
  background: #047857;
}
.toast--error {
  background: #b91c1c;
}
.toast--warn {
  background: #b45309;
}
.toast--info {
  background: #1d4ed8;
}

/* ---------------------------------------------------------------- 详情列表 */
.detail-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 1px;
  background: var(--c-border);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  overflow: hidden;
}

.detail-item {
  background: var(--c-surface);
  padding: 10px 13px;
}

.detail-item__label {
  font-size: 12px;
  color: var(--c-text-mute);
  margin-bottom: 3px;
}

.detail-item__value {
  font-size: 13.5px;
  font-weight: 500;
  word-break: break-all;
}

/* ---------------------------------------------------------------- 键值行 */
.kv {
  display: flex;
  gap: 10px;
  padding: 6px 0;
  font-size: 13px;
  border-bottom: 1px dashed var(--c-border);
}

.kv:last-child {
  border-bottom: none;
}

.kv__k {
  color: var(--c-text-sub);
  min-width: 88px;
  flex: none;
}

.kv__v {
  flex: 1;
  word-break: break-all;
}

/* ---------------------------------------------------------------- 提示条 */
.alert {
  display: flex;
  gap: 9px;
  padding: 10px 13px;
  border-radius: var(--radius);
  font-size: 12.5px;
  line-height: 1.65;
  border: 1px solid transparent;
  margin-bottom: 14px;
}

.alert--info {
  background: var(--c-primary-soft);
  color: #1e40af;
  border-color: var(--c-primary-border);
}
.alert--warn {
  background: var(--c-warn-soft);
  color: #92400e;
  border-color: #fde68a;
}
.alert--danger {
  background: var(--c-danger-soft);
  color: #991b1b;
  border-color: #fecaca;
}
.alert--success {
  background: var(--c-success-soft);
  color: #065f46;
  border-color: #a7f3d0;
}

.alert__icon {
  flex: none;
}

/* ---------------------------------------------------------------- 分段控件 */
.segmented {
  display: inline-flex;
  border: 1px solid var(--c-border-strong);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--c-surface);
}

.segmented__item {
  padding: 5px 13px;
  font-size: 12.5px;
  cursor: pointer;
  color: var(--c-text-sub);
  border-right: 1px solid var(--c-border);
  user-select: none;
  transition: all 0.12s;
}

.segmented__item:last-child {
  border-right: none;
}

.segmented__item:hover {
  background: var(--c-surface-3);
}

.segmented__item.is-active {
  background: var(--c-primary);
  color: #fff;
}

/* ---------------------------------------------------------------- 周切换 */
.week-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 12px 16px;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-lg);
  margin-bottom: 16px;
}

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

.week-day {
  min-width: 74px;
  padding: 6px 10px;
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  text-align: center;
  cursor: pointer;
  background: var(--c-surface);
  transition: all 0.12s;
  user-select: none;
}

.week-day:hover {
  border-color: var(--c-primary);
}

.week-day.is-active {
  border-color: var(--c-primary);
  background: var(--c-primary-soft);
}

.week-day__w {
  font-size: 11.5px;
  color: var(--c-text-mute);
}

.week-day.is-active .week-day__w {
  color: var(--c-primary);
}

.week-day__d {
  font-size: 13px;
  font-weight: 600;
  margin-top: 1px;
}

.week-day__dot {
  height: 12px;
  font-size: 10px;
  color: var(--c-success);
  line-height: 1;
}

/* ---------------------------------------------------------------- 甘特图排班 */
.gantt-wrap {
  overflow: auto;
  min-height: 160px;
  max-height: calc(100vh - 520px);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

.gantt {
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
  /* 左侧固定列宽度：抽成变量，响应式里只改变量即可整列联动
     （宽度与 sticky 的 left 偏移必须同步，否则列会互相压住） */
  --gantt-emp-w: 152px;
  --gantt-pos-w: 114px;
  --gantt-hrs-w: 106px;
}

.gantt th,
.gantt td {
  border-right: 1px solid var(--c-border);
  border-bottom: 1px solid var(--c-border);
  padding: 4px 6px;
  vertical-align: middle;
  background: var(--c-surface);
  white-space: nowrap;
  box-sizing: border-box;
}

.gantt thead th {
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--c-surface-2);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--c-text-sub);
  height: 32px;
  padding: 0 6px;
}

/* 左侧固定列 */
.gantt .sticky-emp,
.gantt .sticky-pos,
.gantt .sticky-hrs,
.gantt .sticky-act {
  position: sticky;
  z-index: 4;
}

.gantt thead .sticky-emp,
.gantt thead .sticky-pos,
.gantt thead .sticky-hrs {
  z-index: 7;
}

.gantt .sticky-emp {
  left: 0;
  /* 放得下「待定 + 选择员工」两个控件 */
  width: var(--gantt-emp-w);
  min-width: var(--gantt-emp-w);
  max-width: var(--gantt-emp-w);
}
.gantt .sticky-pos {
  left: var(--gantt-emp-w);
  width: var(--gantt-pos-w);
  min-width: var(--gantt-pos-w);
  max-width: var(--gantt-pos-w);
}
.gantt .sticky-hrs {
  left: calc(var(--gantt-emp-w) + var(--gantt-pos-w));
  width: var(--gantt-hrs-w);
  min-width: var(--gantt-hrs-w);
  max-width: var(--gantt-hrs-w);
  overflow: hidden;
  text-align: left;
}

/* 时段文本：每段一行，确保多段班次的时间完整可读（不截断）。
   现仅用于发布输出视图；排班编辑页的工时列只显示总工时 */
.gantt .sticky-hrs .seg-text {
  max-width: 100%;
  font-size: 10.5px;
  line-height: 1.35;
  color: var(--c-text-mute);
}

.gantt .sticky-hrs .seg-text > span {
  display: block;
  white-space: nowrap;
}

/* 工时数字与时段文本分层显示，行高统一，避免出现参差不齐的行 */
.gantt .sticky-hrs [data-cell="hours"] {
  display: block;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.25;
}

/* 打印 / 发布输出视图：行高按「1 行工时 + 2 行时段」统一，多段班次也能完整展示 */
.gantt tbody tr {
  height: 52px;
}

/* 排班编辑页（.gantt--edit）：工时列只显示总工时数字，
   行高按单行内容收紧，避免时段多的班次把行越撑越高；
   完整时段改由工时单元格的悬停提示（title）查看 */
.gantt.gantt--edit tbody tr {
  height: 40px;
}

.gantt.gantt--edit {
  --gantt-hrs-w: 76px;
}

.gantt tbody tr:hover .sticky-emp,
.gantt tbody tr:hover .sticky-pos,
.gantt tbody tr:hover .sticky-hrs {
  background: #f8fafd;
}

/* 员工列：姓名/待定标记 + 「选择员工·更换」按钮（待定班次的指派入口） */
.gantt .sticky-emp {
  overflow: hidden;
}

.gantt .emp-cell {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.gantt .emp-cell .emp-name {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
  font-size: 13px;
  line-height: 1.3;
}

/* 待定班次：只定了时段、还没指派员工，用琥珀色底色与左侧色条提示 */
.gantt tbody tr.row--pending .sticky-emp,
.gantt tbody tr.row--pending .sticky-pos,
.gantt tbody tr.row--pending .sticky-hrs {
  background: var(--c-warn-soft);
}

.gantt tbody tr.row--pending .sticky-emp {
  box-shadow: inset 3px 0 0 var(--c-warn);
}

/* 虚拟员工行：人还没到位，用琥珀色左条区分于「待定」（待定连人都不算） */
.gantt tbody tr.row--virtual .sticky-emp {
  box-shadow: inset 3px 0 0 var(--c-warn);
}

.gantt tbody tr.row--virtual .sticky-hrs [data-cell="hours"] {
  color: #92400e;
}

/* 指派弹窗里的虚拟员工行（不在 .gantt 表格里，单独给底色） */
.table tbody tr.row--virtual td {
  background: var(--c-warn-soft);
}

/* 已锁定行：左侧蓝色色条 + 右侧「解锁」按钮，表示逐行确认过 */
.gantt tbody tr.row--locked .sticky-emp {
  box-shadow: inset 3px 0 0 var(--c-primary);
}

.gantt tbody tr.row--locked .gantt-timeline .gcell.is-on {
  background: var(--c-bar-locked);
  border-right-color: var(--c-bar-locked);
}

.gantt tbody tr.row--locked:hover .sticky-emp,
.gantt tbody tr.row--locked:hover .sticky-pos,
.gantt tbody tr.row--locked:hover .sticky-hrs {
  background: var(--c-surface);
}

/* 操作列：锁定 / 清空 / 移除 三个小按钮 */
.gantt .act-cell {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* 甘特图上方提示条 */
.gantt-alert {
  padding: 12px 14px 0;
}

/* 锁定失败时的问题清单 */
.issue-list {
  margin: 0;
  padding-left: 20px;
  font-size: 13px;
  line-height: 1.9;
}

.issue-block {
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  padding: 8px 12px;
  margin-bottom: 8px;
  background: var(--c-surface-2);
}

.issue-block__title {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 2px;
}

/* 工具栏里的锁定进度提示 */
.lock-hint {
  font-size: 12.5px;
  color: var(--c-text-mute);
  margin-right: 8px;
}

.lock-hint--ok {
  color: var(--c-success);
}

.gantt .gantt-timeline {
  padding: 0;
}
/* 让色块撑满整行高度（行高会因多段班次的文字折行而增高） */
.gantt tbody .gantt-timeline .track {
  height: 100%;
}

.gantt .sticky-act {
  padding: 4px 8px;
}

/* 时间刻度与格子 */
.gsrow,
.track {
  display: flex;
  align-items: stretch;
}

.gcell {
  position: relative;
  flex: none;
  min-height: 32px;
  border-right: 1px solid var(--c-slot-grid);
  background: var(--c-slot-empty);
  box-sizing: border-box;
  cursor: pointer;
  transition: background 0.08s;
}

.track .gcell:last-child {
  border-right: none;
}

.gcell:hover {
  background: #eef4ff;
}

/* 整点刻度线（2.0.1 需求 8）：每小时一条更粗更深的线，小时内的细线保留。
   15 / 30 分钟刻度时全靠这一条区分「几点」，否则满屏同粗竖线。 */
.gcell--hour {
  border-left: 2px solid var(--c-border);
}

.gcell--head.gcell--hour span {
  color: var(--c-text);
  font-weight: 600;
}

.gcell--head {
  cursor: default;
  background: transparent;
  font-size: 10.5px;
  color: var(--c-text-mute);
  overflow: visible;
}

.gcell--head span {
  position: absolute;
  left: 3px;
  top: 9px;
  white-space: nowrap;
  pointer-events: none;
}

.gcell.is-on {
  background: var(--c-bar);
  border-right-color: var(--c-bar);
}

.gcell.is-on:hover {
  background: var(--c-bar-hover);
}

.gcell.is-sel {
  background: #bfdbfe;
}

.gcell.is-locked {
  cursor: not-allowed;
  background: var(--c-slot-empty);
}

.track.locked .gcell.is-on {
  background: var(--c-bar-locked);
  border-right-color: var(--c-bar-locked);
}

@media print {
  .gantt-wrap {
    max-height: none;
    overflow: visible;
  }
  .gantt .is-on {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  /* 虚拟员工行（人员缺口）的底色与左色条要一起打出来 */
  .gantt tr.row--virtual td,
  .table tr.row--virtual td {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
}

/* ---------------------------------------------------------------- 周维度班表 */
.week-wrap {
  overflow: auto;
  max-height: calc(100vh - 430px);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

.table--week {
  border-collapse: separate;
  border-spacing: 0;
  font-size: 12.5px;
}

.table--week th,
.table--week td {
  border-right: 1px solid var(--c-border);
  border-bottom: 1px solid var(--c-border);
  padding: 5px 8px;
  white-space: nowrap;
  background: var(--c-surface);
}

.table--week thead th {
  background: var(--c-surface-2);
  font-size: 12px;
  font-weight: 600;
  color: var(--c-text-sub);
  text-align: center;
  border-bottom: 1px solid var(--c-border-strong);
}

.table--week thead th.is-muted,
.table--week thead th.is-muted div {
  color: var(--c-text-mute);
}

.table--week .sticky-emp {
  position: sticky;
  left: 0;
  z-index: 2;
  background: var(--c-surface);
  border-right: 1px solid var(--c-border-strong);
  min-width: 112px;
}

.table--week thead .sticky-emp {
  z-index: 4;
  background: var(--c-surface-2);
}

.table--week tfoot td {
  background: var(--c-surface-3);
  font-weight: 600;
}

/* 周表里的虚拟员工行：把「人员缺口」从真人里区分出来 */
.table--week tbody tr.row--virtual td {
  background: var(--c-warn-soft);
}

.table--week tbody tr.row--virtual .sticky-emp {
  box-shadow: inset 3px 0 0 var(--c-warn);
}

.week-cell {
  text-align: center;
}

/* 2.0.2：周几做主标题（加粗），日期做小字副行 */
.table--week .week-th__dow {
  font-weight: 700;
  font-size: 12.5px;
}

.table--week .week-th__date {
  font-size: 10.5px;
}

/* 2.0.2：单元格文字一律一行 —— 字体调小 + 不换行，
   之前 12px 的「09:30-16:30」在窄列里折成两三行，整行被撑高、参差不齐 */
.table--week tbody td,
.table--week tfoot td {
  font-size: 11px;
  white-space: nowrap;
  line-height: 1.5;
  padding-top: 4px;
  padding-bottom: 4px;
}

.table--week .sticky-emp {
  white-space: nowrap;
}

/* 周表里的次要小字（合计「N 天」/「人员缺口」/「缺口 N 小时」）：
   屏幕版 11px 换行排；打印版缩成一行（2.0.2：内联样式压不住导致行被撑高） */
.table--week .week-sub {
  font-size: 11px;
}

.table--week .week-gap {
  font-size: 11px;
  color: #92400e;
}

.week-cell--time {
  font-family: var(--font-mono);
  font-size: 12px;
  text-align: left;
  line-height: 1.45;
}

/* 岗位列（2.0.2 需求 3）：上班时间与休息之间，罗列该班次的岗位 */
.week-cell--pos {
  font-size: 11.5px;
  text-align: left;
  line-height: 1.45;
}

.week-cell.is-muted {
  background: var(--c-surface-2);
  color: var(--c-text-mute);
  text-align: center;
}

/* ---------------------------------------------------------------- 工时统计 */
.break-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.break-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.break-row .input {
  width: 124px;
}

.break-chip {
  display: inline-block;
  padding: 1px 7px;
  margin: 1px 3px 1px 0;
  border-radius: 999px;
  background: var(--c-surface-3);
  border: 1px solid var(--c-border);
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--c-text-sub);
}

/* 排班时段多于一段时分行展示，避免时间被从中间断开 */
.seg-time {
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.5;
}

/* ---------------------------------------------------------------- 关于软件 */
.about-hero {
  display: flex;
  align-items: center;
  gap: 16px;
}

.about-hero__logo {
  flex: none;
  width: 56px;
  height: 56px;
  border-radius: 14px;
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 1px;
}

.about-hero__title {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 18px;
  font-weight: 600;
}

.about-hero__ver {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--c-primary);
  background: var(--c-primary-soft);
  border: 1px solid var(--c-primary-border);
  border-radius: 999px;
  padding: 1px 10px;
}

.about-hero__sub {
  color: var(--c-text-sub);
  font-size: 12.5px;
  margin-top: 3px;
}

.about-hero__mail {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
  font-size: 12.5px;
}

.about-mail {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--c-primary);
  text-decoration: none;
  border-bottom: 1px dashed var(--c-primary-border);
  word-break: break-all;
}

.about-mail:hover {
  color: var(--c-primary-dark);
  border-bottom-style: solid;
}

.about-mods {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.about-mod {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.about-mod__no {
  flex: none;
  width: 20px;
  height: 20px;
  margin-top: 1px;
  border-radius: 50%;
  background: var(--c-primary-soft);
  color: var(--c-primary);
  font-size: 11.5px;
  font-weight: 700;
  display: grid;
  place-items: center;
}

.about-mod__name {
  font-weight: 600;
  font-size: 13.5px;
}

.about-mod__desc {
  color: var(--c-text-sub);
  font-size: 12.5px;
  line-height: 1.65;
  margin-top: 2px;
}

.about-notes {
  margin: 0;
  padding-left: 18px;
  color: var(--c-text-sub);
  font-size: 12.5px;
  line-height: 1.85;
}

@media (max-width: 1100px) {
  .about-hero {
    align-items: flex-start;
  }
}

/* ---------------------------------------------------------------- 打印视图 */
.print-root {
  display: none;
}

@media print {
  body.print-only-mode .app-shell,
  body.print-only-mode .modal-mask {
    display: none !important;
  }

  .print-root {
    display: block !important;
  }

  .print-title {
    font-size: 20px;
    font-weight: 700;
    text-align: center;
    color: #1f3864;
  }

  .print-sub {
    text-align: center;
    font-size: 12px;
    color: #475569;
    margin: 4px 0 12px;
  }

  .print-foot {
    margin-top: 12px;
    font-size: 11px;
    color: #94a3b8;
    text-align: right;
  }

  .print-block {
    margin-bottom: 12px;
  }

  .print-block .stat {
    box-shadow: none;
    border: 1px solid #d1d5db;
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }

  .print-block .card__actions,
  .print-block .page-head {
    display: none !important;
  }

  /* 单日班表：**A4 横向 + 一页宽**（2.0.1 需求 9；2.0.2 改为注入式 @page）。
     具名页面（`page: printDayLandscape`）会让浏览器在默认页与具名页之间
     强制分页 —— 表现为「第一页整页空白」。横向规则改由 publish.js 的
     emitPrint() 注入 `@page { size: A4 landscape }`，这里只管把内容压紧。 */
  body.print-only-mode .print-root .gantt-wrap {
    overflow: visible !important;
    max-height: none !important;
    border-radius: 0;
  }

  body.print-only-mode .print-root .gantt {
    width: 100%;
    table-layout: fixed;
    font-size: 10px;
  }

  /* 2.0.2：行高压成单行 —— 屏幕版是「1 行工时 + 2 行时段」52px，
     人数一多一页放不下几行；打印里工时与跨度并作一行，行高 ~20px */
  body.print-only-mode .print-root .gantt tbody tr {
    height: 20px;
  }

  body.print-only-mode .print-root .gantt thead th {
    /* 屏幕版是 sticky + 固定高；单页打印里 sticky 无意义，高度放开由内容决定 */
    position: static;
    height: auto;
    font-size: 9px;
    padding: 2px 3px;
  }

  /* 表头时间标签：屏幕版绝对定位（top:9px），行高压到 20px 后会溢出到
     数据行之间（「卡在两行之间」）—— 打印里改回文档流内 */
  body.print-only-mode .print-root .gantt .gcell--head span {
    position: static;
    font-size: 7.5px;
  }

  body.print-only-mode .print-root .gantt .gcell--head {
    font-size: 7.5px;
    min-height: 0;
    overflow: hidden;
  }

  body.print-only-mode .print-root .gantt .sticky-hrs [data-cell="hours"] {
    display: inline;
    font-size: 9px;
    font-weight: 700;
    line-height: 1.2;
    margin-right: 4px;
  }

  body.print-only-mode .print-root .gantt .sticky-hrs .seg-text {
    display: inline;
    font-size: 7.5px;
    line-height: 1.2;
    color: #64748b;
  }

  body.print-only-mode .print-root .gantt .sticky-hrs .seg-text > span {
    display: inline;
  }

  body.print-only-mode .print-root .gantt .gsrow,
  body.print-only-mode .print-root .gantt .track {
    display: flex;
    width: 100%;
  }

  body.print-only-mode .print-root .gantt .gcell {
    width: auto !important;
    flex: 1 1 0;
    min-width: 0;
    min-height: 12px;
  }

  body.print-only-mode .print-root .gantt th,
  body.print-only-mode .print-root .gantt td {
    padding: 1px 3px;
    line-height: 1.2;
  }

  body.print-only-mode .print-root .gantt .gcell.is-on,
  body.print-only-mode .print-root .gantt .gcell.is-locked {
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }

  /* 周维度班表：解除屏幕上的滚动容器限制（横向由注入的 @page 负责） */
  body.print-only-mode .print-root--week .week-wrap {
    overflow: visible !important;
    max-height: none !important;
    border-radius: 0;
  }

  body.print-only-mode .print-root--week .table--week {
    width: 100%;
    font-size: 8px;
    border-collapse: collapse;
  }

  body.print-only-mode .print-root--week .table--week th,
  body.print-only-mode .print-root--week .table--week td {
    padding: 1.5px 3px;
    white-space: nowrap;
    border: 1px solid #9aa8bb;
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }

  /* 每行统一一行文字的高度（2.0.2：之前字体大、格子文字折行，行高参差） */
  body.print-only-mode .print-root--week .table--week tbody td {
    font-size: 7.5px;
    line-height: 1.35;
  }

  /* 表头子列「上班时间 / 岗位 / 休息 / 工时」：屏幕版 thead th 的 12px 在打印里
     没被覆盖，比 7.5px 的数据行高出一截 —— 用户标红的就是这一行（2.0.2） */
  body.print-only-mode .print-root--week .table--week thead th {
    font-size: 8px;
    font-weight: 600;
    line-height: 1.35;
  }

  /* 次要小字（「N 天」/「人员缺口」/「缺口 N 小时」）打印里并回一行 ——
     之前是内联 11px，压不住，合计列永远两行高（2.0.2） */
  body.print-only-mode .print-root--week .week-sub,
  body.print-only-mode .print-root--week .week-gap {
    display: inline;
    font-size: 7px;
  }

  body.print-only-mode .print-root--week .week-th__dow {
    font-size: 9px;
    font-weight: 700;
    color: #1f2937;
  }

  body.print-only-mode .print-root--week .week-th__date {
    font-size: 7px;
  }

  body.print-only-mode .print-root--week .table--week .sticky-emp {
    position: static;
    min-width: 0;
  }

  body.print-only-mode .print-root--week .table--week tr {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  /* 单日打印（2.0.2 需求 2）：工时格只留一行「跨度」，把行高压下来，
     让甘特图跟信息区一起进第一页 */
  /* 单日打印（2.0.2 需求 2）：信息区压成 Excel 式紧凑表格（.print-info），
     统计大卡不再进打印 —— 一页装下「标题 + 信息 + 甘特图」 */
  body.print-only-mode .print-root .print-info {
    width: 100%;
    border-collapse: collapse;
    margin: 2px 0 8px;
    font-size: 10px;
    table-layout: fixed;
  }

  body.print-only-mode .print-root .print-info th {
    width: 13%;
    background: #eef3fb;
    border: 1px solid #c7d2e0;
    padding: 3px 5px;
    text-align: center;
    font-weight: 700;
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }

  body.print-only-mode .print-root .print-info td {
    border: 1px solid #c7d2e0;
    padding: 3px 5px;
    text-align: left;
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }

  body.print-only-mode .print-root .print-info .is-warn {
    color: #92400e;
    font-weight: 700;
  }

  body.print-only-mode .print-root .gantt-total td {
    background: #eef3fb;
    font-weight: 700;
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }

  body.print-only-mode .print-root .seg-text {
    font-size: 8.5px;
  }

  /* 卡片头（「排班甘特图 + 时间范围…」）与缺口提醒：字号压小、少占地方（2.0.2） */
  body.print-only-mode .print-root .card__head {
    padding: 3px 8px;
  }

  body.print-only-mode .print-root .card__title {
    font-size: 10.5px;
  }

  body.print-only-mode .print-root .card__desc {
    font-size: 8px;
  }

  body.print-only-mode .print-root .alert {
    padding: 3px 8px;
    font-size: 8.5px;
    line-height: 1.45;
    margin-bottom: 6px;
  }

  body.print-only-mode .print-root .alert__icon {
    display: none;
  }

  /* 虚拟员工等徽标：屏幕版的 11.5px + 8px 内边距会把 20px 的行撑破（2.0.2） */
  body.print-only-mode .print-root .badge {
    font-size: 7.5px;
    line-height: 1.4;
    padding: 0 4px;
  }
}

/* 打印（横向）由 publish.js 的 emitPrint() 注入 `@page { size: A4 landscape }`，
   不在这里写具名页面 —— 见上面打印视图一节的说明。 */

/* ---------------------------------------------------------------- 打印 */
@media print {
  .sidebar,
  .topbar,
  .brand,
  .no-print,
  .page-head__actions,
  .toast-host {
    display: none !important;
  }

  .app-shell {
    display: block;
    height: auto;
  }

  .content {
    padding: 0;
    overflow: visible;
  }

  .card {
    box-shadow: none;
    border-color: #d1d5db;
    break-inside: avoid;
  }

  body {
    background: #fff;
  }
}

/* --------------------------------------------------------------------------
   门店切换行（「切换主体 / 门店」弹窗，v1.0.5 需求 1）

   一行一家门店：左边名称 + 负责人（需求 6），右边「切到此门店」按钮。
   以前门店是一排按钮，门店一多就平铺成一片、也看不出负责人是谁。
   -------------------------------------------------------------------------- */

.store-pick {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 8px 10px;
  border: 1px solid var(--c-border);
  border-radius: 8px;
  background: var(--c-surface);
}

.store-pick.is-active {
  border-color: var(--c-primary);
  background: var(--c-primary-soft, #eef2ff);
}

.store-pick .btn {
  flex: none;
}

/* ==========================================================================
   班表排定 · 头部信息条（2.0.1 需求 8）
   原来是「班表信息」大卡片（6 项 × 上下两行），占掉半屏；压成一行稠密信息条，
   把纵向空间留给甘特图。信息一项不少，只是改成「小标签 + 值」横排。
   ========================================================================== */

.sch-head {
  display: flex;
  align-items: center;
  gap: 6px 18px;
  flex-wrap: wrap;
  padding: 8px 14px;
  margin-bottom: 10px;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-md);
  font-size: 12.5px;
}

.sch-head__item {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  white-space: nowrap;
}

.sch-head__item i {
  font-style: normal;
  color: var(--c-text-mute);
  font-size: 11.5px;
}

.sch-head__item b {
  font-weight: 600;
  color: var(--c-text);
}

.sch-head__warn {
  font-size: 11.5px;
  color: #b45309;
  background: #fef3c7;
  border-radius: 999px;
  padding: 1px 8px;
  cursor: help;
}

.sch-head__special {
  font-size: 12px;
  color: #92400e;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: var(--radius-md);
  padding: 6px 12px;
  margin-bottom: 10px;
}

/* 日期快捷条挂在上面的信息条下，间距收一点，别把甘特图往下顶 */
.week-bar--days {
  padding: 8px 12px;
  margin-bottom: 10px;
}

.week-bar--days .week-day {
  padding: 4px 10px;
}

/* ==========================================================================
   门店授权（账号页 · 2.0.1 需求 1）

   一个账号在不同门店可以是不同的角色与不同的权限，所以授权是「一行一店」：
   勾门店 → 管理权 / 查看权 → 管理权下再选这家店的角色与门店权限。
   查看权门店后面两栏直接置灰（服务端对查看权门店一律不给写权限）。
   ========================================================================== */

.grant {
  border: 1px solid var(--c-border);
  border-radius: var(--radius-md);
  background: var(--c-surface);
  padding: 8px 10px;
  margin-bottom: 8px;
}

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

/* 门店名要能一眼扫过去，给它一个稳定的宽度 */
.grant__pick {
  min-width: 132px;
  font-weight: 600;
  margin-right: auto;
}

.grant__mode {
  width: 96px;
  flex: 0 0 auto;
}

.grant__role {
  width: 150px;
  flex: 0 0 auto;
}

.grant__perms {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px dashed var(--c-border);
}

/* 账号列表里的「可管辖门店」：一店一个「管理 / 查看」标记 */
.grant-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin: 2px 8px 2px 0;
  white-space: nowrap;
}

/* 调动支援行里的改期申请（2.0.1 需求 4）：写在原时间下面，确认方一眼看到要确认哪个时间 */
.move-proposal {
  margin-top: 2px;
  font-size: 11.5px;
  color: #b45309;
}

/* 门店排班设置 · 启用的参数字段（2.0.2 需求 1）
   五类参数用页签分屏：一屏只看一类，页签上带「已启用 / 总数」，被裁剪过的那类
   一眼能看出来。平铺五组的结果是一屏放不下、勾选时来回滚还容易看串行。 */
.params-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--c-border);
}

.params-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--c-text-2);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}

.params-tab:hover {
  background: var(--c-surface-2);
  color: var(--c-text);
}

.params-tab.is-active {
  background: var(--c-primary-soft, #eef4ff);
  border-color: var(--c-primary, #2563eb);
  color: var(--c-primary, #2563eb);
  font-weight: 600;
}

.params-tab__count {
  font-size: 11.5px;
  font-weight: 400;
  color: var(--c-text-3, #94a3b8);
}

.params-tab__count.is-trimmed {
  color: #b45309;
}

.dict-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  align-items: center;
}

/* 班表排定 · 「当前行」（2.0.2 需求 2）
   「＋ 添加班次行」插到这一行的下方，所以要让人看得见插入点。 */
tr.row--focus > td:first-child {
  box-shadow: inset 3px 0 0 var(--c-primary, #2563eb);
}
tr.row--focus {
  background: var(--c-primary-soft, #f4f8ff);
}
