/* 桌面端 Web 后台。中性灰为底；品牌黄用于主操作，蓝色用于内部借调姓名和班表变更 */
:root {
  --bg: #fff; --side: #f7f7f5; --hover: #f4f4f2; --press: #ebebe8;
  --line: #e5e5e2; --line-soft: #efefec;
  --text: #1f1f1f; --sub: #5c5f66; --muted: #6e7178;
  --brand: #ffd21e; --brand-press: #f2c200; --brand-ink: #3b2f00;
  --change-soft: #eef5ff; --change-hover: #e3efff; --change-line: #9cbee8; --change-ink: #245a96;
  --bad: #cf3a2f; --bad-soft: #fdefee; --warn: #9a5b00; --warn-soft: #fff5e3; --ok: #217a4d; --event: #b45309;
  --add: #ca6f63; --leave: #62656c;
  --bar: #eef0f3; --bar-line: #d9dde3;
  --r: 8px;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; min-width: 1200px; font: 13px/1.55 -apple-system, "PingFang SC", "Helvetica Neue", "Microsoft YaHei", sans-serif; color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }
button, select, input { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }
h1, h2, h3, h4 { font-weight: 600; letter-spacing: 0; }
p { margin: 0 0 8px; }
.muted { color: var(--muted); } .small { font-size: 12px; } .spacer { flex: 1; } .num { font-variant-numeric: tabular-nums; }
.bad { color: var(--bad); } .warn { color: var(--warn); } .leave { color: var(--leave); }
[hidden] { display: none !important; }
input[type=checkbox] { accent-color: var(--text); }
input:focus-visible, select:focus-visible { outline: 2px solid var(--sub); outline-offset: 1px; }
button:focus-visible, a:focus-visible { outline: 2px solid var(--sub); outline-offset: 2px; }

/* 按钮 */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 32px; padding: 0 12px; border: 1px solid var(--line); background: #fff; border-radius: 6px; cursor: pointer; white-space: nowrap; font-weight: 500; }
.btn:hover { background: var(--hover); } .btn:disabled { opacity: .4; cursor: default; background: #fff; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); font-weight: 600; } .btn.primary:hover { background: var(--brand-press); border-color: var(--brand-press); } .btn.primary:disabled { background: var(--brand); }
.btn.dark { background: var(--text); border-color: var(--text); color: #fff; } .btn.dark:hover { background: #000; }
.btn.ghost { border-color: transparent; background: transparent; color: var(--sub); } .btn.ghost:hover { background: var(--hover); color: var(--text); } .btn.ghost:disabled { background: transparent; }
.btn.sm { height: 26px; padding: 0 9px; font-size: 12px; }
.btn.block { width: 100%; height: 38px; margin: 22px 0 14px; }
.link { border: 0; background: none; padding: 0; color: var(--sub); cursor: pointer; text-decoration: underline; text-decoration-color: #cfd1d4; text-underline-offset: 3px; }
.link:hover { color: var(--text); text-decoration-color: currentColor; }
.icon-btn { display: inline-grid; place-items: center; width: 28px; height: 28px; border: 0; background: none; border-radius: 6px; cursor: pointer; color: var(--sub); } .icon-btn:hover { background: var(--press); color: var(--text); }
.seg { display: inline-flex; align-items: stretch; height: 32px; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; background: #fff; flex: none; }
.seg > * { display: inline-flex; align-items: center; justify-content: center; min-width: 32px; padding: 0 12px; border: 0; background: none; cursor: pointer; color: var(--sub); }
.seg > * + * { border-left: 1px solid var(--line); }
.seg > button:hover { background: var(--hover); color: var(--text); } .seg > button.on { background: var(--press); color: var(--text); font-weight: 600; } .seg > button:disabled { opacity: .4; cursor: default; background: none; }
.seg > [data-step], .seg > [data-week], .seg > [data-month] { padding: 0; font-size: 16px; }
.seg .lbl { cursor: default; color: var(--text); font-weight: 500; min-width: 120px; font-variant-numeric: tabular-nums; }
.tag { display: inline-block; font-size: 11px; line-height: 15px; padding: 0 4px; border-radius: 3px; border: 1px solid var(--line); color: var(--sub); font-weight: 400; white-space: nowrap; vertical-align: 1px; margin-left: 4px; }
.tag.new { color: var(--sub); border-color: var(--line); }
.tag.ot { color: var(--warn); border-color: #e7cfa4; }
.st { white-space: nowrap; } .st.bad { color: var(--bad); } .st.warn { color: var(--warn); } .st.ok { color: var(--ok); } .st.leave { color: var(--leave); } .st.new, .st.off { color: var(--muted); }

/* 登录 */
body:has(#login:not([hidden])) { min-width: 0; }
.login {
  min-height: 100vh; display: grid; place-items: center; padding: 24px;
  background:
    radial-gradient(900px 420px at 12% -10%, rgba(255, 210, 30, .28), transparent 60%),
    radial-gradient(700px 380px at 100% 0%, rgba(36, 90, 150, .08), transparent 55%),
    linear-gradient(180deg, #fbfbf8 0%, var(--side) 100%);
}
.login-panel {
  width: min(920px, 100%);
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 18px 50px rgba(31, 31, 31, .06);
}
.login-hero {
  padding: 48px 40px;
  background:
    linear-gradient(160deg, rgba(255, 210, 30, .55), rgba(255, 210, 30, .12) 42%, transparent 70%),
    linear-gradient(200deg, #1f1f1f 0%, #2c2c2c 100%);
  color: #fff;
  display: flex; flex-direction: column; justify-content: flex-end; gap: 8px; min-height: 360px;
}
.login-hero-mark .logo { width: 40px; height: 40px; border-radius: 10px; font-size: 18px; margin-bottom: 18px; }
.login-hero-title { margin: 0; font-size: 28px; font-weight: 700; letter-spacing: .02em; }
.login-hero-sub { margin: 0; color: rgba(255,255,255,.72); font-size: 14px; }
.login-card { padding: 40px 36px 28px; display: flex; flex-direction: column; justify-content: center; }
.login-card h2 { margin: 0 0 6px; font-size: 22px; }
.login-card #login-help { margin-bottom: 8px; }
.login-card label { display: block; margin: 16px 0 6px; font-size: 12px; color: var(--sub); }
.login-card select, .login-card input {
  width: 100%; height: 40px; padding: 0 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff;
}
.login-card input:focus { border-color: #c9c9c4; outline: none; box-shadow: 0 0 0 3px rgba(255, 210, 30, .28); }
.login-card .btn.block { margin-top: 24px; height: 42px; }
.login-card #login-err { min-height: 18px; margin: 0; }
@media (max-width: 760px) {
  .login-panel { grid-template-columns: 1fr; }
  .login-hero { min-height: 160px; padding: 28px 24px; }
  .login-card { padding: 28px 24px 22px; }
}

/* 骨架 */
.shell { display: grid; grid-template-columns: 208px minmax(0, 1fr); min-height: 100vh; }
.shell.nav-off { grid-template-columns: 56px minmax(0, 1fr); }
.side { position: sticky; top: 0; z-index: 4; height: 100vh; display: flex; flex-direction: column; padding: 16px 10px 10px; background: var(--side); border-right: 1px solid var(--line); }
.rail-toggle { position: absolute; z-index: 6; width: 22px; height: 22px; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: 50%; background: #fff; color: var(--sub); display: grid; place-items: center; cursor: pointer; }
.rail-toggle:hover { background: var(--hover); color: var(--text); }
.rail-toggle svg { width: 14px; height: 14px; }
.side > .rail-toggle { top: 50%; right: -11px; transform: translateY(-50%); }
.shell.nav-off .nav-txt, .shell.nav-off .region, .shell.nav-off #data-note { display: none; }
.shell.nav-off .side { padding: 16px 6px 10px; }
.shell.nav-off .brand { justify-content: center; padding: 0; }
.shell.nav-off nav { margin-top: 14px; align-items: center; }
.shell.nav-off nav button { position: relative; justify-content: center; width: 36px; height: 36px; padding: 0; }
.shell.nav-off .side-foot { justify-content: center; padding: 8px 0 0; }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 14px; padding: 0 8px; }
.logo { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 5px; background: var(--brand); color: var(--brand-ink); font-size: 12px; font-weight: 700; }
.region { margin: 18px 8px 12px; padding-bottom: 14px; border-bottom: 1px solid var(--line); line-height: 1.6; }
.region b { display: block; font-size: 14px; } .region span { display: block; color: var(--muted); font-size: 12px; }
nav { display: flex; flex-direction: column; gap: 1px; }
nav button { display: flex; align-items: center; gap: 10px; width: 100%; height: 32px; padding: 0 8px; border: 0; background: none; border-radius: 6px; cursor: pointer; color: var(--sub); text-align: left; }
nav button:hover { background: var(--press); color: var(--text); } nav button.on { background: var(--press); color: var(--text); font-weight: 600; }

/* 待处理 */
.issues { border: 1px solid var(--line); border-radius: var(--r); margin-bottom: 14px; }
.issues.ok { padding: 8px 12px; color: var(--ok); }
.iss-h { display: flex; align-items: center; gap: 12px; padding: 8px 12px; } .iss-h span { font-size: 12.5px; }
.iss { list-style: none; margin: 0; padding: 2px 0 4px; border-top: 1px solid var(--line-soft); display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.iss li { display: flex; align-items: center; gap: 8px; padding: 6px 12px; cursor: pointer; min-width: 0; } .iss li:hover { background: var(--hover); }
.iss li i { width: 6px; height: 6px; border-radius: 50%; flex: none; background: #e2a73a; } .iss li.i-bad i { background: var(--bad); } .iss li.i-bad span { color: var(--bad); }
.iss li span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.iss li em { margin-left: auto; padding-left: 8px; font-style: normal; font-size: 12px; color: var(--muted); white-space: nowrap; } .iss li:hover em { color: var(--text); }
.status.jev { color: var(--sub); }
.side-foot { display: flex; align-items: center; margin-top: 8px; padding: 8px 4px 0 8px; border-top: 1px solid var(--line); font-size: 11.5px; color: var(--muted); }
main { padding: 18px 28px 60px; min-width: 0; }

/* 页面头 */
.head, .page-head { display: flex; align-items: center; gap: 8px; min-height: 36px; margin-bottom: 14px; }
.head h1 { margin: 0 4px 0 6px; font-size: 20px; font-variant-numeric: tabular-nums; } .head h1 span { margin-left: 8px; font-size: 14px; font-weight: 400; color: var(--muted); }
.head h2 { margin: 0 0 0 6px; font-size: 15px; }
.page-head h1 { margin: 0; font-size: 20px; } .page-head p { margin: 2px 0 0; color: var(--muted); }
.vsep { width: 1px; height: 18px; background: var(--line); margin: 0 4px; }
.status { font-size: 12.5px; color: var(--muted); padding: 0 4px; white-space: nowrap; }
.status::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: currentColor; margin-right: 6px; vertical-align: 1px; }
.status.draft { color: var(--warn); } .status.ok { color: var(--ok); }

/* 周条 */
.strip { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; margin-bottom: 14px; }
.strip button { position: relative; display: flex; flex-direction: column; align-items: flex-start; padding: 7px 12px 8px; border: 0; border-right: 1px solid var(--line-soft); background: #fff; cursor: pointer; text-align: left; min-width: 0; }
.strip button:last-child { border-right: 0; } .strip button:hover { background: var(--hover); }
.strip button.on { background: var(--side); box-shadow: inset 0 -2px 0 var(--text); }
.strip span { font-size: 12px; color: var(--muted); } .strip b { font-size: 17px; line-height: 1.35; font-variant-numeric: tabular-nums; }
.strip small { font-size: 12px; color: var(--sub); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; } .strip small em { font-style: normal; color: var(--bad); }
.strip .ev { font-style: normal; font-size: 11.5px; color: var(--event); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.strip .chg { position: absolute; top: 9px; right: 10px; width: 7px; height: 7px; border-radius: 50%; background: var(--change-ink); }

/* 待确认 / 提示 */
.pending { border: 1px solid var(--change-line); background: var(--change-soft); border-radius: var(--r); padding: 10px 14px 12px; margin-bottom: 14px; }
.pending-top { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; } .pending-top b { margin-right: 6px; }
.pending-stats { display: flex; gap: 18px; margin: 8px 0 2px; font-variant-numeric: tabular-nums; color: var(--sub); }
.pending-stats b { color: var(--text); font-weight: 600; }
.chglist { list-style: none; margin: 8px 0 6px; padding: 0; max-height: 240px; overflow: auto; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
.chglist li { display: grid; grid-template-columns: 40px minmax(0, 1fr); column-gap: 8px; padding: 7px 10px; border-bottom: 1px solid var(--line-soft); }
.chglist li:last-child { border-bottom: 0; }
.chglist li[data-day] { cursor: pointer; } .chglist li[data-day]:hover { background: var(--hover); }
.chglist li.muted { display: block; cursor: default; color: var(--muted); }
.chglist .chg-k { grid-row: 1 / span 2; align-self: center; font-size: 12px; }
.chglist .chg-add .chg-k { color: var(--ok); } .chglist .chg-mod .chg-k { color: var(--warn); } .chglist .chg-del .chg-k { color: var(--muted); }
.chglist .chg-who { font-weight: 500; }
.chglist .chg-pair { display: flex; align-items: baseline; gap: 8px; min-width: 0; color: var(--sub); font-variant-numeric: tabular-nums; }
.chglist .chg-from, .chglist .chg-to { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chglist .chg-arrow { flex: none; color: var(--muted); } .chglist .chg-del .chg-to { color: var(--muted); }
.note { display: flex; align-items: center; gap: 10px; padding: 8px 12px; margin-bottom: 14px; border-left: 3px solid var(--warn); border-radius: 6px; background: var(--side); color: #5e3a00; }
.note.bad { border-left-color: var(--bad); background: var(--bad-soft); color: #7a1f18; }

/* 日视图 */
.sched { display: grid; grid-template-columns: minmax(0, 1fr) 264px; gap: 20px; align-items: start; }
.tl { border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.tl-row { display: grid; grid-template-columns: 148px minmax(0, 1fr); border-bottom: 1px solid var(--line-soft); }
.tl-row:last-child { border-bottom: 0; }
.tl-name { position: relative; padding: 9px 12px; border-right: 1px solid var(--line-soft); cursor: pointer; }
.tl-name b { display: block; }
.addbtn { position: absolute; top: 6px; right: 6px; width: 22px; height: 22px; border: 1px solid var(--line); border-radius: 5px; background: #fff; color: var(--sub); cursor: pointer; opacity: .4; line-height: 1; }
.tl-row:hover .addbtn { opacity: 1; } .addbtn:hover { background: var(--hover); color: var(--text); } .tl-name small { font-size: 12px; color: var(--muted); } .tl-name:hover { background: var(--hover); }
.tl-track { position: relative; padding: 7px 0 11px; background-image: linear-gradient(to right, var(--line-soft) 1px, transparent 1px); background-size: calc(100% / var(--gn, 12)) 100%; }
.tl-off { position: absolute; top: 0; bottom: 0; background: repeating-linear-gradient(135deg, #f4f4f2 0 4px, transparent 4px 8px); pointer-events: none; }
.tl-head { background: var(--side); border-bottom-color: var(--line); } .tl-head .tl-name { cursor: default; color: var(--muted); font-size: 12px; padding: 7px 12px; } .tl-head .tl-name:hover { background: none; }
.tl-head .tl-track { height: 32px; padding: 0; background: none; }
.tl-head .tl-track span { position: absolute; top: 7px; font-size: 11.5px; color: var(--muted); transform: translateX(5px); font-variant-numeric: tabular-nums; }
.tl-head .tl-track span.end { left: auto !important; right: 6px; transform: none; }
.lane { position: relative; height: 40px; margin-bottom: 4px; }
.lane .none { position: absolute; left: 10px; top: 10px; color: var(--muted); }
.sb { position: absolute; top: 0; bottom: 0; padding: 3px 8px; border-radius: 5px; background: var(--bar); border: 1px solid var(--bar-line); overflow: hidden; white-space: nowrap; cursor: pointer; line-height: 1.4; }
.sb:hover { border-color: #b5bbc4; } .sb b { font-weight: 600; } .sb .t { display: block; font-size: 12px; color: var(--sub); font-variant-numeric: tabular-nums; overflow: hidden; text-overflow: ellipsis; }
.sb.app { background: #fff; border-style: dashed; }
.sb.chg { background: var(--change-soft); border-color: var(--change-line); }
.sb.gone { background: #fff; border-style: dashed; color: var(--muted); cursor: default; } .sb.gone b { font-weight: 500; text-decoration: line-through; } .sb.gone .t { color: var(--muted); }
.sb.gap { background: var(--bad-soft); border: 1px dashed var(--bad); color: #b42318; cursor: pointer; } .sb.gap .t { color: #b42318; }
.cov { position: absolute; left: 0; right: 0; bottom: 4px; display: flex; gap: 2px; padding: 0 2px; }
.cov i { flex: 1; height: 3px; border-radius: 2px; } .cov i.short { background: #f2c3be; } .cov i.short2 { background: #de5a4f; } .cov i.closed { background: none; }
.tl-foot { display: flex; align-items: center; gap: 16px; padding: 9px 2px 0; font-size: 12px; color: var(--muted); }
.tl-foot i { display: inline-block; width: 14px; height: 8px; border-radius: 2px; margin-right: 5px; vertical-align: 0; }
.tl-foot i.k-app { border: 1px dashed #aab0b8; } .tl-foot i.k-chg { background: var(--change-soft); border: 1px solid var(--change-line); }

/* 右侧栏 */
.card { border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; margin-bottom: 12px; }
.card h4 { display: flex; justify-content: space-between; margin: 0 0 8px; font-size: 13px; } .card h4 span { font-weight: 400; color: var(--muted); }
.grp { padding: 8px 0; border-top: 1px solid var(--line-soft); } .card h4 + .grp { border-top: 0; padding-top: 2px; }
.grp-h { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-bottom: 3px; } .grp-h b { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }
.names { display: flex; flex-wrap: wrap; gap: 1px 12px; } .names.dim a { color: var(--muted); }
a[data-profile] { cursor: pointer; } a[data-profile]:hover { text-decoration: underline; text-underline-offset: 3px; }
.lrow { display: flex; justify-content: space-between; gap: 8px; padding: 1px 0; } .lrow span { font-size: 12px; text-align: right; }
[data-revoke].link { margin-left: 6px; font-size: 12px; }
.mini { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.mini th { padding: 0 0 4px; font-size: 11.5px; font-weight: 400; color: var(--muted); text-align: right; }
.mini td { padding: 4px 0; text-align: right; border-top: 1px solid var(--line-soft); } .mini td:first-child { text-align: left; color: var(--sub); } .mini td:nth-child(2) { font-weight: 600; } .mini td:nth-child(3) { color: var(--muted); width: 64px; }
.card-links { display: flex; gap: 14px; margin-top: 10px; font-size: 12.5px; }

/* 周视图 */
.weekline { display: flex; align-items: center; gap: 16px; margin-bottom: 12px; color: var(--sub); }
.weekline b { color: var(--text); font-variant-numeric: tabular-nums; } .weekline b.bad { color: var(--bad); } .weekline b.warnb { color: var(--warn); } .weekline .vs { color: var(--muted); } .weekline .ok { color: var(--ok); }
.hbar { position: relative; margin: 3px 0 5px; }
.hb-track { display: flex; height: 10px; border-radius: 3px; background: var(--line-soft); overflow: hidden; }
.hbar i, .hlegend i { display: block; height: 100%; flex: none; box-sizing: border-box; }
.hbar i + i { border-left: 1px solid #fff; }
i.work { background: #5f6670; } i.trip { background: #d9a33f; } i.leave { background: #a5a0a8; }
i.plan { background: repeating-linear-gradient(-45deg, #dfe2e6 0 2px, #f6f7f8 2px 5px); border: 1px dashed #8d939c; border-radius: 0 3px 3px 0; }
.hbar i.plan { border-left-style: dashed; }
.hbar b, .hlegend b { position: absolute; top: -3px; bottom: -3px; width: 2px; margin-left: -1px; border-radius: 1px; } b.tgt { background: var(--ok); } b.max { background: var(--bad); opacity: .6; }
.hlegend { display: inline-flex; flex-wrap: wrap; gap: 4px 12px; font-size: 11.5px; color: var(--muted); }
.hlegend > span { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.hlegend i { width: 12px; height: 8px; border-radius: 2px; } .hlegend b { position: relative; top: 0; bottom: 0; height: 11px; margin: 0 2px; }
.list td.hcell { width: 210px; min-width: 210px; } .nowrap { white-space: nowrap; } .list td .small b.warn { color: var(--warn); } .list td .small b.bad { color: var(--bad); }
table { border-collapse: collapse; width: 100%; }
.wk, .list { border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.wk th, .wk td { padding: 7px 9px; border-right: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); text-align: left; vertical-align: top; }
.wk th:last-child, .wk td:last-child { border-right: 0; } .wk tbody tr:last-child td { border-bottom: 0; }
.wk thead th { background: var(--side); font-weight: 400; border-bottom-color: var(--line); cursor: pointer; } .wk thead th:hover { background: var(--press); }
.wk thead th:first-child { cursor: default; color: var(--muted); font-size: 12px; vertical-align: middle; } .wk thead th:first-child:hover { background: var(--side); }
.dh span { color: var(--muted); font-size: 12px; margin-right: 4px; } .dh b { font-size: 15px; font-variant-numeric: tabular-nums; } .dh .today { color: var(--text); margin-left: 4px; }
.dsub { font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 128px; } .dsub em { font-style: normal; color: var(--event); }
.wk td.rh { width: 156px; min-width: 156px; } .wk td.rh b { display: block; } .wk td.rh small { display: block; color: var(--muted); font-size: 11.5px; line-height: 1.5; } .wk td.rh small.bad { color: var(--bad); }
.cg { display: grid; grid-template-columns: max-content minmax(0, 1fr); column-gap: 6px; }
.cg .ln { display: contents; } .cg .ln > * { padding: 1px 0; } .cg .ln .t { width: auto; white-space: nowrap; }
.cg .ln.off { display: block; grid-column: 1 / -1; }
.wk td.c { cursor: pointer; } .wk td.c:hover { background: var(--hover); } .wk td.chg { background: var(--change-soft); } .wk td.c.chg:hover { background: var(--change-hover); }
.ln { display: flex; gap: 6px; padding: 1px 0; font-size: 12.5px; line-height: 1.5; }
.ln .t { flex: none; width: 38px; color: var(--muted); font-variant-numeric: tabular-nums; } .ln i { font-style: normal; font-size: 11.5px; color: var(--muted); margin-left: 4px; white-space: nowrap; }
.ln.gap, .ln.gap .t { color: var(--bad); } .ln.leave, .ln.leave .t { color: var(--leave); } .ln.train, .ln.train .t { color: var(--warn); } .ln.off { color: var(--muted); }

/* 通用列表 */
.list th { padding: 8px 14px; background: var(--side); border-bottom: 1px solid var(--line); font-size: 12px; font-weight: 400; color: var(--muted); text-align: left; white-space: nowrap; }
.list td { padding: 10px 14px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; } .list tbody tr:last-child td { border-bottom: 0; }
.list tbody tr[data-profile] { cursor: pointer; } .list tbody tr:hover td { background: var(--hover); }
.empty { border: 1px dashed var(--line); border-radius: var(--r); padding: 72px 20px; text-align: center; color: var(--sub); }
.empty h2 { margin: 0 0 6px; font-size: 17px; color: var(--text); } .empty .btn { margin-top: 12px; }

/* 区经维护固定店、轮班店与备选员工 */
.staffing-tip { padding: 10px 14px; margin-bottom: 18px; border: 1px solid var(--line); border-radius: var(--r); background: var(--side); }
.staffing-tip.warn { color: #5e3a00; background: var(--warn-soft); border-color: #e7cfa4; }
.staffing-group { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line-soft); }
.staffing-group:last-child { border-bottom: 0; }
.staffing-group b { min-width: 185px; }
.staffing-group label { margin-left: auto; white-space: nowrap; }
.staffing-group select, .staffing-count input, .staffing-group input, .staffing-table select { height: 30px; padding: 0 8px; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
.staffing-group input, .staffing-count input { width: 58px; }
.staffing-counts { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.staffing-count { display: inline-flex; align-items: center; gap: 8px; }
.staffing-table { overflow-x: auto; }
.staffing-table td { vertical-align: top; }
.staffing-table td:first-child { min-width: 120px; }
.staffing-table td:nth-child(2) { min-width: 135px; }
.staffing-table td:nth-child(3) { min-width: 140px; }
.staffing-table td:last-child { min-width: 340px; }
.staffing-options { display: flex; flex-wrap: wrap; gap: 5px 14px; }
.staffing-check { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; cursor: pointer; }
.staffing-check input { margin: 0; }

/* 客流 / 记录 */
.block { margin-bottom: 22px; } .block h3 { margin: 0 0 8px; font-size: 14px; }
.hm { border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.hm th { padding: 7px 4px; background: var(--side); font-size: 12px; font-weight: 400; color: var(--muted); text-align: center; border-bottom: 1px solid var(--line); }
.hm td { padding: 7px 4px; text-align: center; font-size: 12px; font-variant-numeric: tabular-nums; border-bottom: 1px solid #fff; } .hm tbody tr:last-child td { border-bottom: 0; }
.hm th:first-child, .hm td:first-child { text-align: left; padding-left: 12px; white-space: nowrap; }
.logitem { padding: 12px 16px; border-bottom: 1px solid var(--line-soft); } .logitem:last-child { border-bottom: 0; }
.logitem time { color: var(--muted); margin-right: 10px; font-variant-numeric: tabular-nums; } .logitem .wkno { color: var(--muted); margin-right: 8px; }
.logitem ul { margin: 4px 0 0; padding-left: 0; color: var(--sub); list-style: none; } .logitem li { padding: 1px 0; }

/* 抽屉 / 弹窗 */
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: 440px; z-index: 20; padding: 20px 24px 40px; overflow: auto; background: #fff; border-left: 1px solid var(--line); box-shadow: -10px 0 30px rgba(0, 0, 0, .06); }
.drawer h3 { margin: 0 36px 2px 0; font-size: 17px; } .drawer .close, .modal .close { position: absolute; top: 14px; right: 14px; }
.sec { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line-soft); }
.sec-h { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; font-weight: 600; } .sec-h span { font-weight: 400; font-size: 12px; color: var(--muted); }
.plain { margin: 0; padding-left: 18px; color: var(--sub); } .plain li { margin: 3px 0; } .plain b { color: var(--text); font-weight: 600; }
.kv { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0; } .kv > span:first-child { color: var(--sub); white-space: nowrap; } .kv > span:last-child { text-align: right; }
.param input[type=number] { width: 52px; height: 26px; margin: 0 4px; padding: 0 6px; border: 1px solid var(--line); border-radius: 5px; }
.param input[type=checkbox] { vertical-align: -2px; margin: 0 4px 0 0; }
.cmp th, .cmp td { padding: 6px 4px; text-align: right; font-variant-numeric: tabular-nums; border-bottom: 1px solid var(--line-soft); white-space: nowrap; }
.cmp th { font-size: 11.5px; font-weight: 400; color: var(--muted); } .cmp td:first-child, .cmp th:first-child { text-align: left; } .cmp tbody tr:first-child td { font-weight: 600; }
.dayrow { display: flex; align-items: baseline; gap: 10px; padding: 3px 0; } .dayrow > span:first-child { width: 72px; color: var(--muted); font-variant-numeric: tabular-nums; flex: none; }
.hrow { align-items: center; gap: 6px; } .hrow .param { margin-left: 8px; color: var(--sub); }
.sub-h { margin: 12px 0 4px; font-size: 12px; color: var(--muted); }
.list tbody tr[data-store] { cursor: pointer; }
.tk { display: flex; justify-content: space-between; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--line-soft); } .tk:last-child { border-bottom: 0; }
select.inline { height: 28px; padding: 0 6px; border: 1px solid var(--line); border-radius: 6px; background: #fff; max-width: 170px; }
.seg.wide { display: flex; } .seg.wide > * { flex: 1; }

.modal { position: fixed; inset: 0; z-index: 30; display: grid; place-items: center; background: rgba(20, 20, 20, .3); }
.modal .box { position: relative; width: 440px; padding: 20px 24px; background: #fff; border-radius: 10px; box-shadow: 0 20px 60px rgba(0, 0, 0, .18); }
.modal .box.wide { width: 540px; } .modal .box.review { width: 560px; max-height: min(86vh, 740px); overflow: auto; }
.modal h3 { margin: 0 0 14px; font-size: 16px; }
.opt { display: flex; align-items: flex-start; gap: 8px; margin-top: 14px; padding: 10px 12px; border-radius: 6px; background: var(--side); cursor: pointer; }
.opt input { margin: 3px 0 0; } .opt .opt-t { display: block; font-weight: 500; }
.opt .opt-h { display: block; font-size: 12px; color: var(--muted); font-weight: 400; margin-top: 2px; }
.form { display: grid; grid-template-columns: 76px 1fr; gap: 12px; align-items: center; } .form > label { color: var(--sub); }
.form input, .form select { width: 100%; height: 34px; padding: 0 10px; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
.form .row2 { display: grid; grid-template-columns: 1fr 104px; gap: 8px; } .form .row2.eq { grid-template-columns: 1fr 1fr; }
.modal .actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }
.ticket-head { display: flex; align-items: baseline; gap: 10px; margin: 0 30px 16px 0; padding-bottom: 12px; border-bottom: 1px solid var(--line-soft); } .ticket-head h3 { margin: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; } .chips button { height: 28px; padding: 0 10px; border: 1px solid var(--line); border-radius: 6px; background: #fff; cursor: pointer; } .chips button:hover { background: var(--hover); } .chips button.on { border-color: var(--text); background: var(--press); font-weight: 600; }
.dur b { font-size: 16px; font-variant-numeric: tabular-nums; }
.impact { margin-top: 16px; padding: 10px 12px; border-radius: 6px; background: var(--side); color: var(--sub); } .impact b { color: var(--text); font-weight: 600; } .impact .ln { color: var(--text); }

.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 40; padding: 8px 14px; border-radius: 6px; background: var(--text); color: #fff; font-size: 12.5px; }

/* 人手不够的小时：时间轴底色铺浅红（班次条盖在上面） */
.tl-track .lane { position: relative; z-index: 1; pointer-events: none; } .tl-track .lane > * { pointer-events: auto; }
/* 组合店：组头 + 左侧细线把同组门店连起来 */
.tl-grp { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 14px; padding: 7px 12px; background: var(--side); border-bottom: 1px solid var(--line-soft); font-size: 12.5px; color: var(--sub); text-align: left; }
.tl-grp b { color: var(--text); font-size: 13px; } .tl-grp .rot { color: var(--muted); font-variant-numeric: tabular-nums; } .tl-grp .rot a { color: var(--sub); }
.tl-grp em { color: var(--warn); font-style: normal; }
.tl-row.grp-m .tl-name, tr.grp-m td.rh { box-shadow: inset 3px 0 0 var(--line); }
tr.grp-row td { padding: 0 !important; }
.note.fc { background: var(--side); color: var(--sub); border: 1px solid var(--line-soft); }
.log-meta { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 12px; color: var(--muted); margin-bottom: 2px; font-variant-numeric: tabular-nums; }
.log-meta .sys { color: var(--muted); } .log-meta span:not(.sys):nth-child(2) { color: var(--sub); }

/* 店员列表：每行的操作按钮只在悬停 / 聚焦时出现；状态只在非在岗时用标签标出 */
.list.staff td.rowact { text-align: right; width: 1%; white-space: nowrap; }
.list.staff td.rowact .btn { visibility: hidden; }
.list.staff tr:hover td.rowact .btn, .list.staff tr:focus-within td.rowact .btn { visibility: visible; }
.list.staff .num b.bad { color: var(--bad); } .list.staff .num.warn { color: var(--warn); }
.limits { border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px 16px; margin-bottom: 14px; }
.limits h2 { margin: 0 0 4px; font-size: 15px; }
.limit-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; margin-top: 12px; }
.limit h3 { margin: 0 0 4px; font-size: 13px; }
.limit .chips { display: flex; flex-wrap: wrap; gap: 6px; min-height: 26px; margin: 8px 0; }
.chip { display: inline-flex; align-items: center; gap: 4px; height: 26px; padding: 0 4px 0 8px; border: 1px solid var(--line); border-radius: 13px; background: var(--side); font-size: 12px; }
.chip button { border: 0; background: none; color: var(--muted); cursor: pointer; padding: 0 4px; line-height: 1; }
.chip button:hover { color: var(--text); }
.limit-add { display: flex; gap: 6px; } .limit-add select { flex: 1; min-width: 0; height: 28px; border: 1px solid var(--line); border-radius: 6px; background: #fff; padding: 0 6px; }
.pairlist { display: flex; flex-direction: column; gap: 6px; margin: 8px 0; }
.pair { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; padding: 7px 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--side); }
.pair .pair-to { display: block; color: var(--sub); font-size: 12px; }
.pair-acts { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; flex: none; }
#ns-home:disabled { color: var(--muted); background: var(--side); }
.tag.lv { color: var(--leave); border-color: #c9cbd0; } .tag.tr { color: var(--warn); border-color: #e7cfa4; }

/* 管理员：全部区域 */
.admin-tag { font-size: 11px; color: var(--muted); }
.region-pick { width: 100%; height: 30px; margin: 2px 0 4px; padding: 0 6px; border: 1px solid var(--line); border-radius: 6px; background: #fff; font-weight: 600; }
.region-q { width: 200px; height: 32px; padding: 0 10px; border: 1px solid var(--line); border-radius: 6px; }
.list.regions tbody tr { cursor: pointer; } .list.regions tr.cur td { background: var(--press); }
.list.regions td.num, .list.regions th { white-space: nowrap; }
.boot { min-height: 100vh; display: grid; place-items: center; color: var(--muted); background: var(--side); }
/* 可执行的补人建议 */
.tl-lv { position: absolute; top: 0; bottom: 0; pointer-events: auto; }
.tl-lv.add { background: #fbe0dc; }
.tl-foot i.k-lv.add { background: #f3c1bb; }
/* 规则参数表 */
table.rules { width: 100%; border-collapse: collapse; font-size: 13px; }
table.rules td { padding: 6px 4px 2px; vertical-align: top; } table.rules td.num { text-align: right; white-space: nowrap; } table.rules td.muted { text-align: right; white-space: nowrap; width: 72px; }
table.rules tr.ref td { padding: 0 4px 6px; font-size: 12px; color: var(--muted); border-bottom: 1px solid var(--line-soft); }
table.rules tr:not(.ref) + tr:not(.ref) td { border-top: 1px solid var(--line-soft); }
.rule-edit { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-top: 2px; }
.rule-edit input, .rule-edit select { height: 26px; border: 1px solid var(--line); border-radius: 6px; padding: 0 6px; font-size: 12px; background: #fff; }
.rule-edit input { width: 64px; }

/* ================= 排班页改版（archive/2026-10-09/设计稿/周视图改版稿.html）：顶部状态栏 + 问题标签，中间周 / 日视图，右侧面板 ================= */
main.sch-mode { padding: 0; height: 100vh; display: flex; flex-direction: column; overflow: hidden; }
.sch-empty { padding: 40px; }
.sch-top { display: flex; align-items: center; gap: 8px; padding: 14px 20px 10px; flex: none; }
.sch-top h1 { margin: 0 2px 0 6px; font-size: 18px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.sch-top .wkn { color: var(--muted); font-size: 12px; white-space: nowrap; margin-right: 4px; }
.sch-top .seg, .sch-bar .seg { height: 28px; } .seg.sm > * { padding: 0 10px; font-size: 12px; }
.sch-bar { display: flex; align-items: center; gap: 8px; padding: 0 20px 10px; border-bottom: 1px solid var(--line); flex: none; flex-wrap: wrap; min-height: 37px; }
.fchip { height: 26px; padding: 0 10px; border: 1px solid var(--line); border-radius: 13px; background: #fff; font-size: 12px; color: var(--sub); display: inline-flex; align-items: center; gap: 4px; cursor: pointer; white-space: nowrap; }
.fchip b { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }
.fchip.bad { border-color: #dca6a1; background: var(--bad-soft); } .fchip.bad b { color: var(--bad); }
.fchip.warn b { color: var(--warn); }
.fchip:hover { background: var(--hover); } .fchip.on { border-color: var(--text); color: var(--text); background: var(--hover); }
.fchip.bad.on { border-color: var(--bad); background: var(--bad-soft); }
.fchip.warn.on { border-color: var(--warn); background: var(--warn-soft); }
.sch-kpi { font-size: 12px; color: var(--sub); display: flex; gap: 14px; white-space: nowrap; } .sch-kpi b { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }
.sch-notes { padding: 10px 20px 0; flex: none; max-height: 40vh; overflow: auto; } .sch-notes > * { margin-bottom: 10px; }
.sch-body { flex: 1; display: flex; min-height: 0; }
.sch-main { flex: 1; min-width: 0; overflow: auto; padding-bottom: 20px; }
.sch-main .empty { margin: 20px; }
.sch-side { position: relative; z-index: 3; width: 300px; flex: none; min-width: 0; min-height: 0; display: flex; flex-direction: column; border-left: 1px solid var(--line); overflow: visible; }
.sch-side .side-body { flex: 1; min-height: 0; overflow: auto; padding: 16px 18px 30px; }
.sch-side > .rail-toggle { top: 50%; left: -11px; transform: translateY(-50%); }
.sch-side.off { width: 0; border-left: 0; }
.sch-side.off .side-body { display: none; }
.sch-side.off > .rail-toggle { width: 20px; height: 64px; left: auto; right: 0; border-radius: 8px 0 0 8px; border-right: 0; background: var(--side); color: var(--sub); }
.sch-side.off > .rail-toggle svg { width: 16px; height: 16px; }
.sch-side.off > .rail-toggle:hover { background: var(--press); color: var(--text); }

/* 周视图 */
table.wg { border-collapse: separate; border-spacing: 0; width: 100%; table-layout: fixed; }
table.wg th, table.wg td { border-bottom: 1px solid var(--line-soft); border-right: 1px solid var(--line-soft); vertical-align: top; text-align: left; }
table.wg thead th { position: sticky; top: 0; background: #fff; z-index: 2; font-weight: 400; padding: 9px 10px 7px; border-bottom: 1px solid var(--line); cursor: pointer; }
table.wg thead th:hover { background: var(--hover); }
table.wg thead th .dow { color: var(--sub); } table.wg thead th .d { font-size: 15px; font-weight: 600; margin-left: 3px; }
table.wg thead th .tg { display: block; font-size: 11px; color: var(--muted); height: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
table.wg thead th.today .d { color: var(--text); text-decoration: underline; text-underline-offset: 3px; }
table.wg th.store { width: 136px; padding: 9px 10px 9px 18px; font-weight: 400; cursor: default; background: #fff; }
table.wg.emp th.store { width: 168px; }
table.wg thead th.store { color: var(--muted); font-size: 12px; vertical-align: bottom; } table.wg thead th.store:hover { background: #fff; }
table.wg tbody th.store b { display: block; font-weight: 600; } table.wg tbody th.store span { display: block; font-size: 11.5px; color: var(--muted); }
table.wg tbody th.store span.bad { color: var(--bad); }
.hol { background-image: repeating-linear-gradient(135deg, transparent 0 6px, rgba(0, 0, 0, .03) 6px 7px); }
table.wg td.cell { padding: 7px 8px 8px; cursor: pointer; height: 76px; transition: opacity .12s; }
table.wg td.cell:hover { background-color: var(--hover); }
table.wg td.cell.sel, .tl-row.sel { box-shadow: inset 0 0 0 1.5px var(--text); }
table.wg td.cell.dimmed, .tl-row.dimmed { opacity: .28; }
table.wg td.cell.chg { background-color: var(--change-soft); }
table.wg.emp td.cell { height: auto; }
.sh { display: flex; gap: 5px; font-size: 12px; line-height: 18px; white-space: nowrap; overflow: hidden; }
.sh .n { flex: none; color: var(--text); } .sh a.n:hover { text-decoration: underline; }
.sh .t { color: var(--muted); font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
.sh .x { color: var(--muted); font-size: 11px; flex: none; }
.sh.gap .n, .sh.gap .t { color: var(--bad); } .sh.off { color: var(--muted); } .sh.leave .n { color: var(--leave); } .sh.train .n { color: var(--warn); }
/* 逐小时色条 */
.hstrip { display: flex; gap: 2px; margin-top: 6px; height: 6px; }
.hstrip i { flex: 1; border-radius: 1px; background: #eceef1; }
.hstrip i.two { background: #b9bec6; }
.hstrip i.add { background: repeating-linear-gradient(90deg, var(--add) 0 4px, #f6dedb 4px 7px); } .hstrip i.none { background: var(--bad); } .hstrip i.off { background: transparent; }
.sch-legend { display: flex; flex-wrap: wrap; gap: 14px; padding: 10px 20px 0; font-size: 11.5px; color: var(--muted); }
.sch-legend i { display: inline-block; width: 12px; height: 7px; border-radius: 1px; margin-right: 5px; background: #eceef1; vertical-align: 0; }
.sch-legend i.two { background: #b9bec6; } .sch-legend i.add { background: repeating-linear-gradient(90deg, var(--add) 0 4px, #f6dedb 4px 7px); } .sch-legend i.none { background: var(--bad); }

/* 日视图 */
.daytabs { display: flex; border-bottom: 1px solid var(--line); padding-left: 148px; position: sticky; top: 0; background: #fff; z-index: 3; }
.daytabs button { border: 0; background: none; padding: 9px 12px; color: var(--sub); border-bottom: 2px solid transparent; cursor: pointer; white-space: nowrap; font-size: 12.5px; }
.daytabs button:hover { color: var(--text); } .daytabs button.on { color: var(--text); font-weight: 600; border-color: var(--text); }
.sch-day { padding: 12px 20px 0; }
.sch-day .tl-track { position: relative; }
.sch-day .tl-track .hstrip { margin: 2px 2px 0; }
.tl-track.hol { background-color: transparent; background-image: repeating-linear-gradient(135deg, transparent 0 6px, rgba(0, 0, 0, .03) 6px 7px), linear-gradient(to right, var(--line-soft) 1px, transparent 1px); background-size: auto, calc(100% / var(--gn, 12)) 100%; }
.nowline { position: absolute; top: 0; bottom: 0; width: 0; border-left: 1.5px solid var(--bad); z-index: 2; pointer-events: none; }
.tl-head .nowtag { color: var(--bad) !important; font-weight: 600; }

/* 右侧面板 */
.sch-side h2 { font-size: 15px; margin: 0; } .sch-side h2 .tag { margin-left: 6px; }
.sch-side .meta { font-size: 12px; color: var(--muted); margin: 2px 0 12px; }
.sch-side h3 { display: flex; align-items: baseline; gap: 8px; font-size: 12px; color: var(--muted); font-weight: 500; margin: 18px 0 6px; }
.sch-side h3 span { margin-left: auto; font-weight: 400; }
.sback { margin-bottom: 8px; }
.srow { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 12.5px; padding: 4px 0; }
.srow .t { color: var(--muted); } .srow.bad, .srow.bad .t { color: var(--bad); } .srow.warn { color: var(--warn); }
.srow.click { cursor: pointer; border-radius: 4px; margin: 0 -6px; padding: 4px 6px; } .srow.click:hover { background: var(--hover); }
.sacts { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; }
.sstrip .hstrip { height: 10px; margin-top: 2px; }
.sstrip .hrs { position: relative; height: 16px; font-size: 10.5px; color: var(--muted); }
.sstrip .hrs span { position: absolute; top: 2px; }
.siss { list-style: none; margin: 0; padding: 0; }
.siss li { display: flex; gap: 8px; align-items: baseline; padding: 5px 6px; margin: 0 -6px; border-radius: 4px; cursor: pointer; font-size: 12.5px; }
.siss li:hover { background: var(--hover); } .siss li.i-bad span { color: var(--bad); } .siss li.i-add span { color: var(--warn); }
.siss li em { margin-left: auto; font-style: normal; font-size: 12px; color: var(--muted); white-space: nowrap; }
.sch-side .grp { margin-bottom: 8px; } .sch-side .card-links { margin-top: 16px; display: flex; gap: 14px; }
.loglist .logitem { padding: 8px 0; border-bottom: 1px solid var(--line-soft); }
.srow .click, span.click { cursor: pointer; } span.click:hover b { text-decoration: underline; }
.srow .link, .srow .btn { white-space: nowrap; flex: none; }
/* 人员规则草稿与变更预览。 */
.staffing-toolbar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 18px; padding: 14px 0 6px; }
.staffing-search { display: flex; flex-direction: column; gap: 4px; color: var(--sub); font-size: 12px; }
.staffing-search input { width: 260px; max-width: 100%; height: 34px; padding: 0 10px; border: 1px solid var(--line); border-radius: 6px; background: #fff; color: var(--text); }
.staffing-draft-note { margin: 3px 0 16px; }
.staffing-editor { min-width: 0; margin: 0; padding: 0; border: 0; }
.staffing-editor:disabled { opacity: .6; }
.staffing-table th:nth-child(4), .staffing-table td:nth-child(4) { min-width: 280px; }
.staffing-table th:last-child, .staffing-table td:last-child { min-width: 94px; white-space: nowrap; }
.staffing-dirty { display: inline-block; margin-left: 6px; padding: 0 5px; border-radius: 4px; background: var(--change-soft); color: var(--sub); font-size: 11px; }
.staffing-empty { padding: 24px !important; text-align: center; color: var(--muted); }
.staffing-change-list { padding-left: 20px; max-height: 320px; overflow: auto; }
.staffing-change-list li, .staffing-initial li { margin: 8px 0; }
.staffing-initial summary { cursor: pointer; color: var(--sub); }
.staffing-tip .actions { display: flex; gap: 8px; margin-top: 8px; }

/* 排班操作与版本核对 */
.basis-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; padding: 8px 20px; border-bottom: 1px solid var(--line-soft); background: #fafaf8; flex: none; }
.basis-label { font-weight: 600; color: var(--change-ink); }
.profile-basis { margin: 12px 0; padding: 8px 10px; border-radius: 6px; background: var(--change-soft); color: var(--change-ink); }
.profile-basis > div { margin-top: 3px; font-variant-numeric: tabular-nums; }
.pending-compact { display: flex; align-items: center; gap: 14px; padding: 10px 12px; }
.pending-compact b { margin-right: 12px; }
.pending-compact .small { margin-top: 3px; }
.pending-compact > .btn { flex: none; }
.sch-top { flex-wrap: wrap; gap: 6px; }
.sch-top > .spacer { min-width: 0; }
.sch-top .btn { white-space: nowrap; }
.sch-notes { max-height: 25vh; }
.sch-side { width: 268px; }
.sch-main table.wg { min-width: 790px; }
table.wg th.store { width: 126px; }
table.wg .sh { display: flex; flex-wrap: wrap; column-gap: 4px; row-gap: 0; margin-bottom: 5px; overflow: visible; white-space: normal; }
table.wg .sh .t { display: block; flex-basis: 100%; white-space: nowrap; overflow: visible; text-overflow: clip; font-size: 12px; color: var(--sub); }
table.wg .sh .n { font-size: 13px; }
.operation-note { display: flex; flex: none; align-items: center; gap: 10px; padding: 10px 20px; border-bottom: 1px solid var(--line); background: var(--change-soft); }
.operation-note.failed { background: var(--warn-soft); color: #6b4200; }
.operation-note.success { background: #eff8f1; color: var(--ok); }
.operation-note .btn { white-space: nowrap; }
.spinner { width: 15px; height: 15px; border: 2px solid #aac5e8; border-top-color: #245a96; border-radius: 50%; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation: none; } }
.task-link { display: flex; width: 100%; text-align: left; justify-content: space-between; gap: 10px; padding: 9px 0; border: 0; border-bottom: 1px solid var(--line-soft); background: none; cursor: pointer; }
.task-link span { color: var(--change-ink); white-space: nowrap; }
.filter-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 8px; }
.filter-head h2 { font-size: 14px; }
.issue-result { display: flex; flex-direction: column; gap: 4px; width: 100%; margin-top: 10px; padding: 10px; border: 1px solid var(--line); border-radius: 6px; text-align: left; background: #fff; cursor: pointer; }
.issue-result:hover { background: var(--hover); }
.issue-result span { color: var(--sub); }
.issue-result em { font-style: normal; font-size: 12px; color: var(--change-ink); }
.inline-link { padding: 0; border: 0; background: none; cursor: pointer; text-align: left; }
.inline-link:hover { text-decoration: underline; }
[role="button"]:focus-visible { outline: 2px solid var(--change-ink); outline-offset: -2px; }
.version-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line-soft); }
.review-summary { font-weight: 600; margin: 12px 0; }
.modal .box { max-width: calc(100vw - 24px); max-height: 88vh; overflow-y: auto; }
.modal .box.review { width: 680px; }
.modal .box.review .chglist { max-height: 42vh; }
.modal .chg-from, .modal .chg-to { white-space: normal; overflow: visible; }
.modal .actions { flex-wrap: wrap; }
#lv-impact { max-height: 220px; overflow-y: auto; }
.schedule-policy { display: flex; flex-wrap: wrap; gap: 4px 12px; padding: 8px 20px; flex: none; font-size: 12px; color: var(--sub); background: #f6f7f8; border-bottom: 1px solid var(--line-soft); }
.schedule-policy.readonly { background: var(--warn-soft); }
.schedule-locked { cursor: default !important; }
.trip-section { margin-top: 18px; }
.trip-section p { margin: 5px 0 9px; }
.trip-interval { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.trip-interval input { min-width: 0; width: 112px; padding: 7px; border: 1px solid var(--line); border-radius: 5px; }
.trip-interval input[data-trip-credit] { width: 92px; }
#trip-preview { overflow-wrap: anywhere; }
@media (max-width: 560px) {
  .modal .box { padding: 18px 16px; }
  .modal .form { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .modal .form > label { margin-top: 6px; }
  .modal .form > * { min-width: 0; }
  .modal .form .row2 { grid-template-columns: minmax(0, 1fr) 96px; }
  .modal .ticket-head { flex-wrap: wrap; gap: 4px; }
  .modal .actions { justify-content: flex-start; }
  .modal .trip-interval { flex-wrap: wrap; }
  .modal .version-row { flex-wrap: wrap; gap: 8px; }
}
/* Keep table semantics while exposing separate keyboard actions for dates and cells. */
.date-open { display: block; width: 100%; padding: 0; border: 0; background: none; color: inherit; font: inherit; text-align: inherit; cursor: pointer; }
table.wg td.cell { position: relative; }
.cell-open { position: absolute; width: 1px; height: 1px; padding: 0; border: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.cell-open:focus-visible { top: 2px; right: 2px; z-index: 2; width: auto; height: auto; padding: 3px 6px; clip-path: none; background: #fff; border-radius: 4px; color: var(--change-ink); }

/* 周视图：每人一条班次时间轴，取代汇总色条。 */
.sch-main table.wg.week-timeline { min-width: 1162px; }
table.week-timeline th.store { position: sticky; left: 0; z-index: 1; width: 126px; padding: 10px 12px; }
table.week-timeline thead th.store { z-index: 3; }
table.week-timeline thead th { padding: 8px 8px 5px; }
table.week-timeline td.cell { height: auto; padding: 7px 8px; }
.week-axis { position: relative; height: 20px; margin-top: 4px; border-bottom: 1px solid var(--line); }
.week-axis span { position: absolute; top: 0; transform: translateX(-50%); font-size: 10px; color: var(--muted); font-variant-numeric: tabular-nums; }
.week-axis span:first-child { transform: none; }
.week-axis span:last-child { transform: translateX(-100%); }
.week-shifts { display: flex; flex-direction: column; gap: 3px; }
.week-shift { display: block; width: 100%; padding: 3px 0; margin: 0; border: 0; background: transparent; text-align: left; cursor: pointer; border-radius: 3px; }
.week-shift:hover { background: var(--change-soft); }
.week-shift:focus-visible { outline: 2px solid var(--change-ink); outline-offset: 2px; }
.week-shift-label { display: flex; align-items: baseline; justify-content: space-between; gap: 4px; line-height: 17px; }
.week-who { min-width: 0; font-size: 12px; font-weight: 600; white-space: nowrap; }
.borrowed-name { color: var(--change-ink); }
.week-shift.absent .borrowed-name, .srow.bad .borrowed-name { color: var(--bad); }
.week-who small { margin-left: 3px; font-size: 10px; font-weight: 400; color: var(--change-ink); }
.week-time { flex: none; font-size: 11.5px; font-weight: 500; color: #3b3e43; font-variant-numeric: tabular-nums; white-space: nowrap; }
.week-track { display: block; position: relative; height: 7px; margin-top: 1px; background: repeating-linear-gradient(to right, #eceeec 0 1px, transparent 1px calc(100% / var(--week-gn))); border-bottom: 1px solid #eceeec; }
.week-net-hours { display: block; font-size: 10px; line-height: 16px; color: var(--muted); font-variant-numeric: tabular-nums; }
.week-bar { position: absolute; top: 1px; height: 5px; background: #b9c5ca; border-left: 2px solid #637f8a; border-right: 2px solid #637f8a; border-radius: 2px; }
.week-shift.cross .week-bar { background: #c6dcf6; border-color: var(--change-ink); }
.week-shift.apprentice .week-bar { background: #fff; border: 1px dashed #637f8a; }
.week-shift.apprentice .week-shift-label { flex-wrap: wrap; gap: 0 4px; }
.week-shift.absent .week-bar, .week-gap .week-bar { background: #f1b7b0; border-color: var(--bad); }
.week-shift.absent .week-who, .week-gap { color: var(--bad); }
.week-gap { padding: 2px 0; font-size: 12px; }
.week-gap .week-time { color: var(--bad); }
.week-empty { padding: 10px 0; color: var(--muted); font-size: 12px; }
.week-demand { margin-top: 3px; padding: 0 4px; border-radius: 3px; background: #fff8e8; color: #815100; font-size: 10px; line-height: 16px; }
.week-demand.add { background: var(--bad-soft); color: #a13329; }
.week-legend { gap: 12px; padding: 8px 12px; }
.week-legend i.duty { background: #b9c5ca; border-left: 2px solid #637f8a; }
.week-legend i.support { background: #c6dcf6; border-left: 2px solid var(--change-ink); }
.week-legend i.apprentice { background: #fff; border: 1px dashed #637f8a; }
@media (max-width: 1100px) {
  .week-time { font-size: 11.5px; }
}

/* 月度排班规划与账本 */
.month-body { flex: 1; overflow: auto; padding: 16px 20px 40px; }
.month-container { max-width: 1400px; margin: 0 auto; display: flex; flex-direction: column; gap: 20px; }
.month-section { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 16px 20px; }
.month-sec-header { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 12px; gap: 12px; flex-wrap: wrap; }
.month-sec-header h3 { margin: 0; font-size: 15px; font-weight: 600; color: var(--text); }
.month-weeks-table table, .month-ledger-table table { width: 100%; border-collapse: collapse; }
.month-weeks-table th, .month-ledger-table th { padding: 8px 10px; font-size: 12px; color: var(--muted); text-align: left; border-bottom: 1px solid var(--line); font-weight: 500; }
.month-weeks-table td, .month-ledger-table td { padding: 10px 10px; font-size: 13px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.month-weeks-table th.num, .month-ledger-table th.num,
.month-weeks-table td.num, .month-ledger-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.triple-col { color: #b45309; font-weight: 600; }
.tag.triple-pay { background: #fef3c7; color: #92400e; border-color: #fde68a; font-weight: 500; }
.tag.warn { color: var(--warn); border-color: #e7cfa4; background: #fffdf5; }
.tag.bad { color: var(--bad); border-color: #f8b4b4; background: #fff5f5; }
.tag.ok { color: var(--ok); border-color: #a7f3d0; background: #f0fdf4; }
.tag.muted { color: var(--muted); border-color: var(--line); background: #f9fafb; }
.month-pending-weeks { border: 1px solid var(--line); border-radius: 6px; padding: 8px; background: #fafafa; }
.month-pending-week { background: #fff; }

/* 月页保持页面宽度，宽表在各自区域内滚动。 */
body:has(.month-body) { min-width: 0; }
body:has(.month-body) .sch-top { flex-wrap: wrap; }
.month-body { min-width: 0; min-height: 0; }
.month-container, .month-section { min-width: 0; }
.month-weeks-table, .month-ledger-table { overflow-x: auto; }
.month-weeks-table table { min-width: 560px; }
.month-ledger-table table { min-width: 850px; }
.month-change { padding: 6px 0; border-top: 1px solid var(--line); overflow-wrap: anywhere; }
@media (max-width: 700px) {
  body:has(.month-body) .shell { grid-template-columns: 56px minmax(0, 1fr); }
  body:has(.month-body) .side { padding: 16px 6px 10px; }
  body:has(.month-body) .nav-txt, body:has(.month-body) .region,
  body:has(.month-body) #data-note { display: none; }
  body:has(.month-body) .brand { justify-content: center; padding: 0; }
  body:has(.month-body) nav button { padding: 0; width: 36px; height: 36px; justify-content: center; position: relative; }
  body:has(.month-body) .sch-top { padding: 12px; }
  body:has(.month-body) .sch-top .wkn { white-space: normal; }
  body:has(.month-body) .month-body { padding: 12px 12px 30px; }
  body:has(.month-body) .month-section { padding: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  body:has(.month-body) *, .modal * { scroll-behavior: auto; animation: none; transition: none; }
}

/* Staffing rules share the existing editor; advanced constraints open on demand. */
.staffing-store-rule { border: 1px solid var(--line); border-radius: var(--r); margin: 8px 0; padding: 10px 12px; }
.staffing-store-rule > summary { display: flex; align-items: center; gap: 20px; cursor: pointer; }
.staffing-store-rule > summary::before { content: '›'; color: var(--muted); font-size: 18px; }
.staffing-store-rule[open] > summary::before { transform: rotate(90deg); }
.staffing-store-rule > summary span { color: var(--sub); font-size: 12px; }
.staffing-rule-fields, .staffing-day-main { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 20px; margin: 12px 0; }
.staffing-rule-fields label, .staffing-day-main label { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; }
.staffing-day-main > b { width: 90px; }
.staffing-rule-fields input, .staffing-day-main input, .staffing-rule-fields select, .staffing-day-main select { height: 30px; padding: 0 8px; border: 1px solid var(--line); border-radius: 6px; background: #fff; color: var(--text); }
.staffing-rule-fields input[type=number], .staffing-day-main input[type=number] { width: 76px; }
.staffing-day-rule { border-top: 1px solid var(--line-soft); padding-bottom: 10px; }
.staffing-rule-advanced > summary, .staffing-person-rule > summary { cursor: pointer; color: var(--sub); font-size: 12px; }
.staffing-rule-advanced { margin: 10px 0; }
.staffing-shift-options { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 14px; margin: 10px 0; }
.staffing-shift-options > span { flex-basis: 100%; }
.staffing-lines { display: flex; flex-direction: column; gap: 5px; margin: 10px 0; font-size: 12px; }
.staffing-lines textarea { width: 100%; max-width: 650px; min-height: 58px; padding: 8px; border: 1px solid var(--line); border-radius: 6px; color: var(--text); resize: vertical; font: inherit; }
.staffing-person-options td { background: var(--side); padding-top: 8px; padding-bottom: 8px; }
.staffing-person-options .staffing-person-rule { white-space: normal; }
.staffing-person-options td:last-child { white-space: normal; }
.staffing-backup-order { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 8px; color: var(--sub); font-size: 12px; }
.staffing-backup-order .btn { margin-left: 5px; padding: 1px 6px; }
.staffing-support-date { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin: 10px 0; }
.schedule-rule-issues { border: 1px solid var(--line); border-radius: var(--r); padding: 10px 14px; background: var(--side); }
.schedule-rule-issues summary { cursor: pointer; }
.schedule-rule-issues ul { max-height: 260px; overflow: auto; padding-left: 20px; }
.schedule-rule-issues li { margin: 6px 0; }
.staffing-share-summary { margin: 10px 0; padding: 8px 10px; border-radius: 6px; background: #fff; border: 1px solid var(--line-soft); }

/* 门店人员：按任务分区，日常列表保持紧凑，编辑时再展开细节。 */
body:has(.staffing-module-nav) { min-width: 760px; }
body:has(.staffing-module-nav) .page-head { flex-wrap: wrap; align-items: flex-start; gap: 12px 20px; }
body:has(.staffing-module-nav) .page-head > div:first-child { flex: 1; min-width: 280px; }
body:has(.staffing-module-nav) .page-head > .spacer { display: none; }
.staffing-status { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 18px; color: var(--sub); font-size: 12px; margin: 0 0 16px; }
.staffing-status [data-staffing-change-count] { font-weight: 500; color: var(--text); }
.staffing-module-nav { display: flex; flex-direction: row; gap: 24px; border-bottom: 1px solid var(--line); margin-bottom: 22px; }
.staffing-module-nav button { position: relative; width: auto; min-height: 42px; height: auto; padding: 0 2px 12px; border: 0; border-radius: 0; background: transparent; color: var(--sub); font-weight: 500; white-space: nowrap; cursor: pointer; }
.staffing-module-nav button:hover { background: transparent; color: var(--text); }
.staffing-module-nav button[aria-pressed=true] { background: transparent; color: var(--text); font-weight: 600; }
.staffing-module-nav button[aria-pressed=true]::after { content: ''; position: absolute; right: 0; bottom: -1px; left: 0; height: 3px; border-radius: 3px 3px 0 0; background: var(--brand); }
.staffing-module-panel > .sec:first-child { margin-top: 0; border-top: 0; padding-top: 0; }
.staffing-people-toolbar { display: flex; align-items: flex-end; flex-wrap: wrap; gap: 12px 18px; margin: 0 0 16px; }
.staffing-people-toolbar > label, .staffing-store-select { display: inline-flex; flex-direction: column; gap: 5px; color: var(--sub); font-size: 12px; }
.staffing-people-toolbar select, .staffing-store-select select { min-width: 150px; height: 34px; border: 1px solid var(--line); border-radius: 6px; background: #fff; padding: 0 10px; color: var(--text); }
.staffing-people-toolbar > span { margin-left: auto; padding-bottom: 7px; }
.staffing-store-select { margin-bottom: 10px; }
.staffing-compact-table { overflow-x: auto; }
.staffing-compact-table table { width: 100%; table-layout: auto; }
.staffing-compact-table th, .staffing-compact-table td { min-width: 0 !important; padding: 10px 12px; vertical-align: middle; }
.staffing-compact-table th:last-child, .staffing-compact-table td:last-child { width: 76px; min-width: 76px !important; text-align: right; }
.staffing-compact-table td:nth-child(4) { white-space: normal; }
.staffing-compact-table tr:has([aria-expanded=true]) > td { background: var(--hover); }
.staffing-compact-table td:has(.staffing-person-editor) { padding: 0; white-space: normal; text-align: left; }
.staffing-person-editor { padding: 16px 20px 20px; background: #fafaf8; border-top: 1px solid var(--line-soft); border-bottom: 1px solid var(--line); }
.staffing-person-editor > .sec-h { justify-content: space-between; }
.staffing-person-editor select { height: 32px; padding: 0 9px; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
.staffing-person-editor .staffing-options { margin: 10px 0; }
.staffing-person-editor .staffing-person-rule { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--line); }
.staffing-person-editor .staffing-person-rule > summary { font-size: 13px; }
.staffing-person-editor .staffing-person-rule[open] > summary { margin-bottom: 14px; color: var(--text); }
.staffing-person-editor .staffing-rule-fields { align-items: flex-start; }
.staffing-reference { margin-top: 20px; padding: 14px 0; border-top: 1px solid var(--line); color: var(--sub); }
.staffing-reference > summary { cursor: pointer; font-size: 12px; }
.staffing-reference > summary + * { margin-top: 12px; }
.staffing-reference .staffing-group { font-size: 12px; }
.staffing-person-editor .staffing-reference { margin-top: 12px; padding-bottom: 0; }
.staffing-pagination { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 12px; padding-top: 14px; color: var(--sub); font-size: 12px; }
.staffing-module-panel .staffing-counts { display: grid; grid-template-columns: repeat(auto-fit, minmax(235px, 1fr)); gap: 12px; }
.staffing-module-panel .staffing-count { display: flex; align-items: center; gap: 8px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r); }
.staffing-module-panel .staffing-count input { margin-left: auto; }
@media (max-width: 1000px) {
  body:has(.staffing-module-nav) .shell { grid-template-columns: 180px minmax(0, 1fr); }
  body:has(.staffing-module-nav) .shell.nav-off { grid-template-columns: 56px minmax(0, 1fr); }
  body:has(.staffing-module-nav) main { padding: 18px 20px 24px; }
  .staffing-compact-table th, .staffing-compact-table td { padding: 7px 8px; }
  .staffing-person-editor { padding: 14px; }
}
