:root {
  --brand: #2563eb;
  --brand-hover: #1d4ed8;
  --brand-soft: #eff4ff;
  --brand-border: #c7d7fe;
  --ink: #0f172a;
  --ink-2: #475569;
  --ink-3: #64748b;
  --ink-4: #94a3b8;
  --line: #e5e9f0;
  --line-strong: #d3dae5;
  --bg: #f5f7fa;
  --ok: #0f7a54;
  --ok-bg: #ddf2e9;
  --warn: #a35a09;
  --warn-bg: #fbeed7;
  --danger: #c81e1e;
  --danger-bg: #fbdcd9;
  --radius: 8px;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 13px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .55; }
button, .tag, .menu a, .seg button, .radios label { white-space: nowrap; }
.app { display: flex; height: 100vh; }
.sidebar { width: 232px; flex: none; background: #fff; border-right: 1px solid var(--line); display: flex; flex-direction: column; }
.brand { height: 56px; display: flex; align-items: center; gap: 10px; padding: 0 14px; border-bottom: 1px solid var(--line); }
.mark { width: 30px; height: 30px; border-radius: 8px; background: var(--brand); color: #fff; display: grid; place-items: center; font-weight: 700; }
.brand b { display: block; font-size: 13.5px; }
.brand span { display: block; font-size: 11px; color: var(--ink-3); font-weight: 400; }
.menu { flex: 1; overflow: auto; padding: 12px 8px; }
.group { margin: 14px 8px 6px; font-size: 12px; color: var(--ink-4); font-weight: 600; }
.menu a { position: relative; display: flex; align-items: center; margin: 0 0 2px; padding: 8px 10px 8px 12px; border-radius: 6px; color: var(--ink-2); text-decoration: none; }
.menu a:hover { background: #f2f5f9; color: var(--ink); }
.menu a.active { background: var(--brand-soft); color: var(--brand); font-weight: 600; }
.menu a.active::before { content: ""; position: absolute; left: 0; top: 8px; bottom: 8px; width: 3px; border-radius: 3px; background: var(--brand); }
.side-foot { padding: 10px 14px; border-top: 1px solid var(--line); }
.side-foot a { color: var(--ink-3); font-size: 12px; text-decoration: none; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.header { height: 56px; display: flex; align-items: center; gap: 8px; padding: 0 16px; background: #fff; border-bottom: 1px solid var(--line); }
.crumb { color: var(--ink-3); }
.crumb strong { color: var(--ink); }
.content { flex: 1; overflow: auto; padding: 16px; }
.desc { margin: 0 0 12px; color: var(--ink-3); font-size: 12.5px; }
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 1px 2px rgba(15,23,42,.04); }
.filters { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; padding: 12px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); }
.input, .select, .field input, .field textarea, .field select { border: 1px solid var(--line-strong); border-radius: 6px; background: #fff; padding: 0 10px; height: 32px; }
.field textarea { height: auto; min-height: 72px; padding: 8px 10px; resize: vertical; }
.search { width: 240px; }
.seg { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 6px; overflow: hidden; }
.seg button { height: 32px; border: 0; border-right: 1px solid var(--line); background: #fff; padding: 0 12px; color: var(--ink-2); }
.seg button:last-child { border-right: 0; }
.seg button.on { background: var(--brand-soft); color: var(--brand); font-weight: 600; }
.btn { height: 32px; padding: 0 14px; border-radius: 6px; border: 1px solid transparent; background: #fff; }
.btn.primary { background: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-hover); }
.btn.ghost { border-color: var(--line-strong); }
.btn.tiny { height: 24px; padding: 0 8px; color: var(--brand); border: 0; background: transparent; }
.btn.danger { color: var(--danger); border: 0; background: transparent; }
.table-wrap { overflow: auto; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; min-width: 980px; }
table.wide { min-width: 1480px; }
table.sched { min-width: 0; }
th { text-align: left; font-size: 12px; color: var(--ink-3); font-weight: 600; padding: 10px 12px; background: #f8fafc; border-bottom: 1px solid var(--line); }
td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; background: #fff; }
tr.pick { cursor: pointer; }
tr.pick.on td, tbody tr:hover td { background: #f4f7ff; }
.name { font-weight: 600; }
.sub, .hint { color: var(--ink-3); font-size: 12px; line-height: 1.6; }
.slotline { white-space: nowrap; line-height: 1.7; }
td.note { white-space: normal; min-width: 200px; max-width: 280px; vertical-align: top; }
.tag { display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 8px; border-radius: 4px; font-size: 12px; }
.tag i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.tag.ok { color: var(--ok); background: var(--ok-bg); }
.tag.wait { color: var(--warn); background: var(--warn-bg); }
.tag.off { color: var(--ink-2); background: #f1f5f9; }
.tag.no { color: var(--danger); background: var(--danger-bg); }
.day.warm { color: var(--warn); font-weight: 650; }
.day.hot { color: var(--danger); font-weight: 650; }
.day.next { color: var(--brand); font-weight: 650; }
.work { display: grid; grid-template-columns: minmax(320px, 420px) minmax(0, 1fr); gap: 12px; align-items: start; }
.pane { padding: 14px; }
.pane h3 { margin: 0 0 10px; font-size: 14px; }
.chart-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; padding-bottom: 12px; margin-bottom: 12px; border-bottom: 1px solid var(--line); }
.chart-head h3 { margin: 0; font-size: 16px; }
.fields { display: grid; gap: 12px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field span { font-size: 12px; font-weight: 650; color: var(--ink-2); }
.field input, .field textarea, .field select { width: 100%; }
.chart-form textarea { min-height: 52px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-actions { display: flex; justify-content: flex-end; align-items: center; gap: 12px; margin-top: 8px; }
.form-actions .hint { margin-right: auto; }
.radios { display: flex; gap: 20px; align-items: center; }
.radios label { display: inline-flex; align-items: center; gap: 6px; }
.visit-box { margin: 8px 0 12px; padding: 8px 10px; background: #f8fafc; border: 1px solid var(--line); border-radius: 6px; max-height: 180px; overflow: auto; }
.plist button { text-align: left; border: 1px solid var(--line); background: #fff; border-radius: 6px; padding: 8px 10px; }
.plist button.on { border-color: var(--brand); background: var(--brand-soft); }
.tl { border: 1px solid var(--line); border-radius: 6px; padding: 10px; margin-bottom: 8px; }
.row { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.ops { display: flex; gap: 4px; align-items: center; }
.empty { padding: 28px 8px; text-align: center; color: var(--ink-3); }
.mask { display: none; position: fixed; inset: 0; background: rgba(15,23,42,.45); z-index: 20; justify-content: flex-end; }
.mask.open { display: flex; }
.drawer { width: min(440px, 100%); height: 100%; background: #fff; display: flex; flex-direction: column; }
.drawer header { height: 56px; display: flex; align-items: center; justify-content: space-between; padding: 0 16px; border-bottom: 1px solid var(--line); }
.drawer h2 { margin: 0; font-size: 15px; }
.drawer .body { overflow: auto; padding: 16px; }
.toast { position: fixed; top: 68px; left: 50%; transform: translateX(-50%); background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: 8px 14px; box-shadow: 0 8px 24px rgba(15,23,42,.12); z-index: 40; }
@media (max-width: 960px) {
  .work, .two { grid-template-columns: 1fr; }
}
