:root {
  --bg: #eef3fb;
  --card: #ffffff;
  --ink: #1f2a44;
  --muted: #5b6b85;
  --line: #d4e1f2;
  --brand: #2563eb;
  --brand-d: #1e40af;
  --header-bg: #dbe7fb;
  --ok: #2e9e6b;
  --warn: #d98b2b;
  --shadow: 0 2px 10px rgba(31,42,68,.08);
}
* { box-sizing: border-box; }
body {
  margin: 0; font-family: "PingFang SC","Microsoft YaHei",-apple-system,Segoe UI,sans-serif;
  background: var(--bg); color: var(--ink); font-size: 14px;
}
.hidden { display: none !important; }
button { font-family: inherit; cursor: pointer; border: none; border-radius: 8px; }
button.primary.alt { background: #2f9e44; }
.primary.alt:hover { background: #268a3a; }
.primary.alt2 { background: #6741d9; }
.primary.alt2:hover { background: #5f3dc4; }
.primary { background: var(--brand); color: #fff; padding: 9px 16px; font-size: 14px; font-weight: 600; }
button.primary:hover { background: var(--brand-d); }
button.ghost { background: #fff; border: 1px solid var(--line); color: var(--ink); padding: 9px 16px; }
button.link { background: none; color: var(--brand-d); text-decoration: underline; padding: 4px 8px; }
button.mini { background: #fff; border: 1px solid var(--line); padding: 5px 10px; font-size: 12px; }

/* 登录 */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; }
.login-card { background: var(--card); padding: 40px 48px; border-radius: 16px; box-shadow: var(--shadow); text-align: center; width: 420px; }
.login-card h1 { margin: 0 0 6px; font-size: 24px; letter-spacing: 2px; color: var(--brand-d); }
.login-card .sub { color: var(--muted); margin: 0 0 24px; }
.account-list { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.account-btn { background: var(--header-bg); border: 1px solid var(--line); padding: 16px; border-radius: 12px; font-size: 16px; font-weight: 600; color: var(--brand-d); }
.account-btn:hover { background: #c7d8f5; }
.account-btn .role { display: block; font-size: 11px; color: var(--muted); font-weight: 400; margin-top: 4px; }
.login-card .hint { color: var(--muted); font-size: 12px; margin-top: 20px; }

/* 顶栏 */
.topbar { display: flex; justify-content: space-between; align-items: center; padding: 14px 24px; background: var(--card); box-shadow: var(--shadow); position: sticky; top: 0; z-index: 10; }
.logo { font-weight: 700; color: var(--brand-d); font-size: 18px; letter-spacing: 1px; margin-right: 18px; }
.week-nav { display: inline-flex; align-items: center; gap: 8px; }
.week-label { min-width: 200px; text-align: center; font-weight: 600; }
.user-badge { background: var(--header-bg); padding: 6px 12px; border-radius: 20px; font-weight: 600; color: var(--brand-d); margin-right: 8px; }

.actions { padding: 16px 24px 0; display: flex; align-items: center; gap: 14px; }
.global-tip { color: var(--muted); font-size: 13px; }

/* 板块 */
.sections { padding: 16px 24px 48px; display: grid; gap: 18px; }
.section { background: var(--card); border-radius: 14px; box-shadow: var(--shadow); overflow: hidden; }
.section-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.section-head .title { font-size: 17px; font-weight: 700; }
.section-head .meta { color: var(--muted); font-size: 12px; margin-left: 10px; }
.badge { font-size: 12px; padding: 3px 10px; border-radius: 12px; font-weight: 600; }
.badge.done { background: #e3f5ea; color: var(--ok); }
.badge.todo { background: #e8f1fd; color: var(--brand-d); }
.badge.lock { background: #efefef; color: #999; }
.section-tools { display: flex; gap: 8px; align-items: center; }

table.sched { width: 100%; border-collapse: collapse; }
table.sched th, table.sched td { border: 1px solid var(--line); padding: 10px 8px; text-align: center; }
table.sched thead th { background: var(--header-bg); font-weight: 700; color: var(--brand-d); }
table.sched .date-col { background: #e8f1fd; font-weight: 600; white-space: nowrap; }
/* 老板巡店：浅蓝周整行（含数据单元格）统一着色，与日期列一致，便于识别一个周末排班 */
table.sched tr.week-blue > td { background-color: #e8f1fd; }
.cell { cursor: pointer; min-width: 90px; }
.cell:hover { background: #e8f1fd; }
.cell.empty { color: #c9c2b4; }
.cell.locked { cursor: not-allowed; background: #eef2f8; color: #b9b2a4; }
.cell.weekmeta { background: #f4f8fd; font-weight: 600; }
.cell.weekmeta.auto { background: #eef4fc; font-weight: 500; }
.tag { display: inline-block; padding: 3px 9px; border-radius: 12px; background: var(--header-bg); color: var(--brand-d); font-weight: 600; margin: 1px 2px; }
.lock-note { padding: 16px 18px; color: var(--brand-d); background: #eef4fc; font-size: 13px; border-left: 3px solid var(--brand); }
.readonly-note { padding: 8px 18px; color: var(--muted); font-size: 12px; }

/* 弹窗 */
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.4); display: flex; align-items: center; justify-content: center; z-index: 50; }
.modal-card { background: #fff; border-radius: 14px; width: 420px; max-width: 92vw; box-shadow: 0 10px 40px rgba(0,0,0,.25); }
.modal-card.wide { width: 760px; }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--line); font-weight: 700; }
.modal-body { padding: 18px; max-height: 60vh; overflow: auto; }
.modal-body.center { text-align: center; }
.modal-foot { padding: 14px 18px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 10px; }
.modal-foot.center { justify-content: center; }
.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chip { padding: 10px 16px; border: 1px solid var(--line); border-radius: 22px; background: #fff; font-size: 14px; }
.chip.active { background: var(--brand); color: #fff; border-color: var(--brand); }
.chip.disabled { background: #f1f3f5; color: #adb5bd; border-color: #e9ecef; cursor: not-allowed; text-decoration: line-through; }
.chip.conflict { background: #fff0f0; color: #c92a2a; border-color: #ffc9c9; }
.conflict-warn { margin: 2px 0 10px; padding: 8px 10px; background: #fff0f0; color: #c92a2a; border: 1px solid #ffc9c9; border-radius: 8px; font-size: 13px; }
.cell.rest-col { background: #fbfcfe; }
.copy-tip { text-align: center; color: var(--ok); font-size: 13px; padding: 0 0 12px; min-height: 18px; }
#mergeCanvas { max-width: 100%; border: 1px solid var(--line); border-radius: 8px; }
