* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --blue: #2d7af0;
  --blue-dark: #1f66d8;
  --blue-light: #eaf2ff;
  --text: #1f2937;
  --text-2: #6b7280;
  --text-3: #9ca3af;
  --border: #e5e7eb;
  --bg: #f5f7fa;
  --green: #16a34a;
  --green-bg: #e8f7ee;
  --red: #dc2626;
  --red-bg: #fdecec;
  --orange: #ea8c1f;
  --orange-bg: #fff4e5;
  --gray-bg: #f1f3f5;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(16,24,40,.06), 0 1px 2px rgba(16,24,40,.04);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
  background: var(--bg); color: var(--text); font-size: 14px; line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

button { font-family: inherit; cursor: pointer; border: none; background: none; font-size: 14px; }
input, select, textarea { font-family: inherit; font-size: 14px; }
a { color: var(--blue); text-decoration: none; }

/* ---------- 登录页 ---------- */
.login-page {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #eef4ff 0%, #f7f9fc 100%); padding: 20px;
}
.login-card {
  width: 380px; max-width: 100%; background: #fff; border-radius: 16px;
  padding: 40px 36px 32px; box-shadow: 0 10px 40px rgba(45,122,240,.12);
}
.login-logo { display: flex; align-items: center; gap: 10px; justify-content: center; margin-bottom: 6px; }
.login-logo .mark {
  width: 40px; height: 40px; border-radius: 10px; background: var(--blue);
  display: flex; align-items: center; justify-content: center; color: #fff; font-size: 20px;
}
.login-logo h1 { font-size: 20px; font-weight: 600; }
.login-sub { text-align: center; color: var(--text-2); font-size: 13px; margin-bottom: 26px; }
.login-btn { width: 100%; justify-content: center; padding: 11px; font-weight: 500; }
.login-tip { margin-top: 18px; font-size: 12px; color: var(--text-3); text-align: center; line-height: 1.8; }

/* ---------- 布局 ---------- */
.layout { display: flex; min-height: 100vh; }
.sidebar {
  width: 216px; background: #fff; border-right: 1px solid var(--border);
  display: flex; flex-direction: column; flex-shrink: 0;
}
.brand { padding: 18px 20px; display: flex; align-items: center; gap: 10px; border-bottom: 1px solid var(--border); }
.brand .mark {
  width: 32px; height: 32px; border-radius: 8px; background: var(--blue);
  display: flex; align-items: center; justify-content: center; color: #fff; font-size: 17px;
}
.brand span { font-weight: 600; font-size: 15px; }
.nav { padding: 10px; flex: 1; overflow-y: auto; }
.nav-group { font-size: 11px; color: var(--text-3); padding: 12px 10px 6px; letter-spacing: .5px; }
.nav-item {
  display: flex; align-items: center; gap: 9px; padding: 9px 10px; border-radius: 8px;
  color: var(--text-2); font-size: 13.5px; margin-bottom: 2px;
  transition: background .12s, color .12s; text-decoration: none;
}
.nav-item:hover { background: var(--gray-bg); color: var(--text); }
.nav-item.router-link-active { background: var(--blue-light); color: var(--blue); font-weight: 500; }
.nav-item .ico { width: 16px; text-align: center; font-size: 14px; }
.nav-badge {
  margin-left: auto; background: var(--red); color: #fff; font-size: 11px;
  min-width: 18px; height: 18px; border-radius: 9px; padding: 0 5px;
  display: flex; align-items: center; justify-content: center; font-weight: 500;
}
.sidebar-foot { border-top: 1px solid var(--border); padding: 12px 14px; }
.user-box { display: flex; align-items: center; gap: 8px; }
.avatar {
  width: 32px; height: 32px; border-radius: 50%; background: var(--blue-light);
  color: var(--blue); display: flex; align-items: center; justify-content: center;
  font-weight: 600; font-size: 13px; flex-shrink: 0;
}
.user-info { flex: 1; min-width: 0; }
.user-info .n { font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-info .d { font-size: 11px; color: var(--text-3); }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: 56px; background: #fff; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; padding: 0 24px; gap: 14px;
  flex-shrink: 0; position: relative;
}
.topbar h2 { font-size: 16px; font-weight: 600; }
.topbar .spacer { flex: 1; }
.menu-btn { display: none; }
.icon-btn {
  width: 34px; height: 34px; border-radius: 8px; display: flex; align-items: center;
  justify-content: center; position: relative; color: var(--text-2); font-size: 16px;
}
.icon-btn:hover { background: var(--gray-bg); }
.icon-btn .dot {
  position: absolute; top: 2px; right: 2px; min-width: 16px; height: 16px;
  background: var(--red); border-radius: 8px; color: #fff; font-size: 10px;
  display: flex; align-items: center; justify-content: center; padding: 0 4px;
}
.content { flex: 1; padding: 20px 24px 40px; overflow-y: auto; }

/* ---------- 通知面板 ---------- */
.notif-wrap { position: relative; }
.notif-panel {
  position: absolute; top: 44px; right: 0; width: 360px; max-height: 460px;
  background: #fff; border-radius: 12px; box-shadow: 0 12px 40px rgba(15,23,42,.18);
  z-index: 900; display: flex; flex-direction: column; overflow: hidden;
  border: 1px solid var(--border);
}
.notif-panel .nh {
  padding: 13px 16px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; font-weight: 600; font-size: 14px;
}
.notif-list { overflow-y: auto; flex: 1; }
.notif-item { padding: 12px 16px; border-bottom: 1px solid #f1f3f5; }
.notif-item.unread { background: #fbfdff; }
.notif-item .nt { font-size: 13px; font-weight: 500; margin-bottom: 3px; display: flex; gap: 6px; align-items: center; }
.notif-item .nc { font-size: 12px; color: var(--text-2); line-height: 1.5; }
.notif-item .nd { font-size: 11px; color: var(--text-3); margin-top: 4px; }
.notif-type {
  font-size: 10.5px; padding: 1px 6px; border-radius: 4px;
  background: var(--blue-light); color: var(--blue); font-weight: 500; white-space: nowrap;
}
.notif-type.逾期, .notif-type.逾期抄送 { background: var(--red-bg); color: var(--red); }
.notif-type.临期, .notif-type.今日到期 { background: var(--orange-bg); color: #b26a0a; }

/* ---------- 通用组件 ---------- */
.card { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 16px; }
.card-head { padding: 14px 18px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 10px; }
.card-head h3 { font-size: 14.5px; font-weight: 600; }
.card-head .spacer { flex: 1; }
.card-body { padding: 16px 18px; }
.card-body.p0 { padding: 0; }

.btn {
  padding: 7px 14px; border-radius: 7px; font-size: 13.5px; border: 1px solid var(--border);
  background: #fff; color: var(--text); transition: all .12s; white-space: nowrap;
  display: inline-flex; align-items: center; gap: 5px;
}
.btn:hover { border-color: #c9d2e0; background: #fafbfc; }
.btn.primary { background: var(--blue); color: #fff; border-color: var(--blue); }
.btn.primary:hover { background: var(--blue-dark); }
.btn.danger { color: var(--red); border-color: #f3c6c6; }
.btn.danger:hover { background: var(--red-bg); }
.btn.sm { padding: 4px 10px; font-size: 12.5px; border-radius: 6px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 14px; }
.toolbar .spacer { flex: 1; }
.toolbar input[type=text], .toolbar input[type=month], .toolbar select {
  padding: 7px 11px; border: 1px solid var(--border); border-radius: 7px; outline: none; background: #fff;
}
.toolbar input:focus, .toolbar select:focus { border-color: var(--blue); }

table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
thead th {
  text-align: left; padding: 11px 14px; background: #fafbfc; color: var(--text-2);
  font-weight: 500; font-size: 12.5px; border-bottom: 1px solid var(--border); white-space: nowrap;
}
tbody td { padding: 12px 14px; border-bottom: 1px solid #f1f3f5; vertical-align: middle; }
tbody tr:hover { background: #fafbfd; }
tbody tr:last-child td { border-bottom: none; }

.t-title { font-weight: 500; color: var(--text); cursor: pointer; }
.t-title:hover { color: var(--blue); }
.t-sub { font-size: 12px; color: var(--text-3); }

.tag {
  display: inline-block; padding: 2px 8px; border-radius: 5px;
  font-size: 12px; white-space: nowrap; font-weight: 500;
}
.tag.未开始 { background: var(--gray-bg); color: #5f6b7a; }
.tag.进行中 { background: #e8f0fe; color: #1f66d8; }
.tag.待验收 { background: var(--orange-bg); color: #b26a0a; }
.tag.已完成 { background: var(--green-bg); color: var(--green); }
.tag.已延期 { background: var(--red-bg); color: var(--red); }
.tag.已取消 { background: var(--gray-bg); color: var(--text-3); }
.tag.低 { background: var(--gray-bg); color: #5f6b7a; }
.tag.中 { background: #eef2f7; color: #475569; }
.tag.高 { background: var(--orange-bg); color: #b26a0a; }
.tag.紧急 { background: var(--red-bg); color: var(--red); }
.tag.overdue { background: var(--red-bg); color: var(--red); }

.progress-bar {
  height: 6px; background: #eef1f5; border-radius: 3px; overflow: hidden;
  width: 76px; display: inline-block; vertical-align: middle;
}
.progress-bar > i { display: block; height: 100%; background: var(--blue); border-radius: 3px; }
.progress-bar > i.done { background: var(--green); }

.due-overdue { color: var(--red); font-weight: 500; }
.due-today { color: var(--red); }
.due-soon { color: var(--orange); }

.empty { text-align: center; padding: 56px 20px; color: var(--text-3); }
.empty .big { font-size: 40px; margin-bottom: 10px; opacity: .5; }

.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat-card {
  background: #fff; border-radius: var(--radius); padding: 16px 18px;
  box-shadow: var(--shadow); border-left: 3px solid var(--blue);
}
.stat-card.green { border-left-color: var(--green); }
.stat-card.red { border-left-color: var(--red); }
.stat-card.orange { border-left-color: var(--orange); }
.stat-card .lbl { font-size: 12.5px; color: var(--text-2); margin-bottom: 6px; }
.stat-card .val { font-size: 26px; font-weight: 600; line-height: 1.2; }
.stat-card .val small { font-size: 13px; font-weight: 400; color: var(--text-3); margin-left: 3px; }

/* ---------- 表单 ---------- */
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-field { margin-bottom: 14px; }
.form-field > label { display: block; font-size: 12.5px; color: var(--text-2); margin-bottom: 5px; }
.form-field label .req { color: var(--red); }
.form-field > input, .form-field > select, .form-field > textarea {
  width: 100%; padding: 8px 11px; border: 1px solid var(--border);
  border-radius: 7px; outline: none; background: #fff;
}
.form-field > input:focus, .form-field > select:focus, .form-field > textarea:focus {
  border-color: var(--blue); box-shadow: 0 0 0 3px rgba(45,122,240,.08);
}
.form-field textarea { resize: vertical; min-height: 72px; }
.form-field .hint { font-size: 11.5px; color: var(--text-3); margin-top: 4px; }

/* 协办人标签 */
.helper-wrap { display: flex; flex-wrap: wrap; gap: 8px; padding: 4px 0; align-items: center; }
.helper-dept {
  flex: 0 0 100%; font-size: 12px; color: var(--text-2); font-weight: 600;
  margin-top: 6px; padding-left: 2px; letter-spacing: .3px;
}
.helper-dept:first-child { margin-top: 0; }
.helper-chip {
  display: inline-flex; align-items: center; gap: 6px; flex: 0 0 auto; width: auto;
  padding: 5px 12px; border: 1px solid var(--border); border-radius: 16px;
  font-size: 13px; line-height: 1.5; cursor: pointer; user-select: none;
  background: #fff; color: var(--text); margin: 0; white-space: nowrap; transition: all .12s;
}
.helper-chip:hover { border-color: #b9c8e4; background: #fafcff; }

/* ---- 选人字段（点击弹窗选择） ---- */
.picker-field {
  display: flex; align-items: center; gap: 8px;
  border: 1px solid var(--border); border-radius: 8px;
  padding: 8px 12px; cursor: pointer; background: #fff;
  min-height: 38px; transition: border-color .12s, background .12s;
}
.picker-field:hover { border-color: var(--blue); background: #fafcff; }
.picker-field .ph { color: var(--text-3); }
.picker-field span:first-child {
  flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: 14px; color: var(--text);
}
.picker-field .pf-arrow { color: var(--text-3); font-size: 12px; flex: 0 0 auto; }

/* ---- 选人弹窗（部门 + 成员） ---- */
.mp-search { margin-bottom: 12px; }
.mp-search input {
  width: 100%; box-sizing: border-box; border: 1px solid var(--border);
  border-radius: 8px; padding: 8px 12px; font-size: 14px; outline: none;
}
.mp-search input:focus { border-color: var(--blue); }
.mp-body {
  display: flex; gap: 0; border: 1px solid var(--border); border-radius: 8px;
  overflow: hidden; min-height: 320px; max-height: 420px;
}
.mp-depts {
  flex: 0 0 180px; overflow-y: auto; background: #f7f9fc;
  border-right: 1px solid var(--border); padding: 6px;
}
.mp-dept {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 10px; border-radius: 6px; cursor: pointer;
  font-size: 13px; color: var(--text); margin-bottom: 2px;
}
.mp-dept:hover { background: #eef3fb; }
.mp-dept.active { background: var(--blue); color: #fff; }
.mp-dept-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mp-dept-n { font-size: 12px; opacity: .7; flex: 0 0 auto; }
.mp-list { flex: 1; overflow-y: auto; padding: 6px; }
.mp-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: 6px; cursor: pointer; font-size: 14px;
}
.mp-item:hover { background: #f0f5fd; }
.mp-item.checked { background: #eaf2ff; }
.mp-item.disabled { opacity: .45; cursor: not-allowed; }
.mp-avatar {
  flex: 0 0 28px; height: 28px; border-radius: 50%;
  background: var(--blue); color: #fff; font-size: 13px;
  display: inline-flex; align-items: center; justify-content: center;
}
.mp-name { flex: 0 0 auto; color: var(--text); }
.mp-sub {
  flex: 1; color: var(--text-3); font-size: 12px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.mp-check { flex: 0 0 auto; width: 18px; color: var(--blue); font-weight: 700; }
.helper-chip input { margin: 0; cursor: pointer; accent-color: var(--blue); width: 14px; height: 14px; flex: 0 0 auto; }
.helper-chip span { white-space: nowrap; }
.helper-chip.checked { border-color: var(--blue); background: var(--blue-light); color: var(--blue); font-weight: 500; }

/* 开关 */
.switch { position: relative; display: inline-block; width: 42px; height: 23px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .slider {
  position: absolute; inset: 0; background: #ccd3dd; border-radius: 12px;
  cursor: pointer; transition: background .2s;
}
.switch .slider::before {
  content: ''; position: absolute; height: 17px; width: 17px; left: 3px; top: 3px;
  background: #fff; border-radius: 50%; transition: transform .2s;
  box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
.switch input:checked + .slider { background: var(--blue); }
.switch input:checked + .slider::before { transform: translateX(19px); }

.tip-box {
  background: #f8fafc; border: 1px solid #e6ebf2; border-radius: 8px;
  padding: 13px 15px; font-size: 13px; line-height: 1.9; margin-bottom: 18px; color: var(--text-2);
}
.tip-box b { color: var(--text); }

.result-box { margin-top: 12px; padding: 12px 14px; border-radius: 8px; font-size: 13px; line-height: 1.8; }
.result-box.ok { background: var(--green-bg); }
.result-box.err { background: var(--red-bg); color: var(--red); }

/* ---------- 弹窗 ---------- */
.modal-mask {
  position: fixed; inset: 0; background: rgba(15,23,42,.45);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 40px 20px; z-index: 2000; overflow-y: auto;
}
.modal {
  background: #fff; border-radius: 14px; width: 100%; max-width: 620px;
  box-shadow: 0 20px 60px rgba(15,23,42,.25); margin: auto 0;
}
.modal.wide { max-width: 820px; }
.modal-head {
  padding: 18px 22px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center;
}
.modal-head h3 { font-size: 16px; font-weight: 600; }
.modal-close { color: var(--text-3); font-size: 18px; line-height: 1; padding: 4px 8px; border-radius: 6px; }
.modal-close:hover { background: var(--gray-bg); color: var(--text); }
.modal-body { padding: 20px 22px; max-height: 62vh; overflow-y: auto; }
.modal-foot {
  padding: 14px 22px; border-top: 1px solid var(--border);
  display: flex; justify-content: flex-end; gap: 10px;
}

/* ---------- 任务详情 ---------- */
.detail-tags { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.detail-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px 20px; margin-bottom: 18px; }
.detail-item .k { font-size: 12px; color: var(--text-3); margin-bottom: 2px; }
.detail-item .v { font-size: 13.5px; }
.desc-box {
  background: #f8fafc; padding: 12px 14px; border-radius: 8px;
  font-size: 13.5px; line-height: 1.7; white-space: pre-wrap;
}
.timeline { border-left: 2px solid #eef1f5; padding-left: 16px; margin-left: 5px; }
.tl-item { position: relative; padding-bottom: 16px; }
.tl-item::before {
  content: ''; position: absolute; left: -22px; top: 5px; width: 8px; height: 8px;
  border-radius: 50%; background: var(--blue); border: 2px solid #fff;
}
.tl-item .tl-h { font-size: 13px; font-weight: 500; }
.tl-item .tl-b { font-size: 12.5px; color: var(--text-2); margin-top: 2px; }
.tl-item .tl-d { font-size: 11.5px; color: var(--text-3); margin-top: 3px; }
.section-title {
  font-size: 13px; font-weight: 600; color: var(--text-2);
  margin: 20px 0 12px; padding-bottom: 6px; border-bottom: 1px solid var(--border);
}

/* ---------- 父子任务 ---------- */
.tag.parent-tag { background: #ede9fe; color: #6d28d9; }
.parent-link {
  background: #f5f3ff; border: 1px solid #ddd6fe; border-radius: 8px;
  padding: 8px 12px; font-size: 12.5px; color: var(--text-2); margin-bottom: 14px;
}
.parent-link a { cursor: pointer; font-weight: 500; }

.child-list { display: flex; flex-direction: column; gap: 8px; }
.child-item {
  display: flex; align-items: center; gap: 10px;
  border: 1px solid var(--border); border-radius: 8px;
  padding: 10px 12px; cursor: pointer; transition: all .12s;
  background: #fff;
}
.child-item:hover { border-color: #b9c8e4; box-shadow: 0 2px 8px rgba(16,24,40,.06); }
.child-item.已完成 { background: #fafdfb; border-color: #d7ecdf; }
.ci-idx {
  width: 20px; height: 20px; border-radius: 50%; background: var(--gray-bg);
  color: var(--text-3); font-size: 11px; display: flex; align-items: center;
  justify-content: center; flex-shrink: 0;
}
.ci-main { flex: 1; min-width: 0; }
.ci-title {
  font-size: 13px; font-weight: 500; margin-bottom: 4px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ci-meta { display: flex; align-items: center; gap: 8px; font-size: 11.5px; color: var(--text-3); }
.ci-progress { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }

.btn.assign-btn { background: #6d28d9; color: #fff; border-color: #6d28d9; }
.btn.assign-btn:hover { background: #5b21b6; }

/* 表格操作列：多个按钮并排不换行 */
.row-actions { white-space: nowrap; }
.row-actions .btn { margin-right: 6px; }
.row-actions .btn:last-child { margin-right: 0; }

/* 分配弹窗 */
.asg-task {
  background: #f8fafc; border: 1px solid #e6ebf2; border-radius: 10px;
  padding: 12px 14px; margin-bottom: 16px;
}
.asg-task-label { font-size: 11.5px; color: var(--text-3); margin-bottom: 4px; }
.asg-task-title { font-size: 14.5px; font-weight: 600; margin-bottom: 4px; }
.asg-task-meta { font-size: 12px; }

.asg-modes { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 18px; }
.asg-mode {
  border: 1.5px solid var(--border); border-radius: 10px; padding: 12px 14px;
  cursor: pointer; transition: all .12s; background: #fff;
}
.asg-mode:hover { border-color: #c9d2e0; background: #fafcff; }
.asg-mode.active { border-color: #6d28d9; background: #f5f3ff; }
.am-title { font-size: 13.5px; font-weight: 600; margin-bottom: 4px; }
.am-desc { font-size: 11.5px; color: var(--text-2); line-height: 1.5; }

.asg-body { border-top: 1px solid var(--border); padding-top: 16px; }
.asg-hint {
  background: #f8fafc; border-radius: 8px; padding: 10px 12px;
  font-size: 12px; color: var(--text-2); line-height: 1.7; margin-bottom: 14px;
}
.asg-list { display: flex; flex-direction: column; gap: 12px; }
.asg-item {
  border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px;
  background: #fcfdfe;
}
.asg-item-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.asg-idx {
  width: 20px; height: 20px; border-radius: 50%; background: #6d28d9; color: #fff;
  font-size: 11px; display: flex; align-items: center; justify-content: center;
}
.asg-lbl { font-size: 12.5px; font-weight: 500; color: var(--text-2); }
.asg-del {
  width: 22px; height: 22px; border-radius: 6px; color: var(--text-3);
  font-size: 13px; display: flex; align-items: center; justify-content: center;
}
.asg-del:hover { background: var(--red-bg); color: var(--red); }
.asg-desc {
  width: 100%; padding: 7px 11px; border: 1px solid var(--border);
  border-radius: 7px; outline: none; font-size: 13px;
}
.asg-desc:focus { border-color: var(--blue); }
.asg-add {
  width: 100%; padding: 10px; margin-top: 12px;
  border: 1.5px dashed var(--border); border-radius: 10px;
  color: var(--text-2); font-size: 13px; background: #fff;
  transition: all .12s;
}
.asg-add:hover { border-color: #6d28d9; color: #6d28d9; background: #faf9ff; }

@media (max-width: 640px) {
  .asg-modes { grid-template-columns: 1fr; }
}

.bar-row { display: flex; align-items: center; gap: 10px; margin-bottom: 9px; font-size: 13px; }
.bar-row .nm { width: 76px; color: var(--text-2); flex-shrink: 0; text-align: right; }
.bar-row .bar { flex: 1; height: 20px; background: #f1f4f8; border-radius: 4px; overflow: hidden; }
.bar-row .bar > i { display: block; height: 100%; background: var(--blue); border-radius: 4px; }
.bar-row .nm2 { width: 52px; text-align: right; color: var(--text-2); font-size: 12.5px; flex-shrink: 0; }

/* ---------- 看板 ---------- */
.kanban {
  display: grid; gap: 14px; padding-bottom: 10px;
  grid-template-columns: repeat(4, minmax(0, 1fr)); align-items: start;
}
.kcol {
  background: #f7f9fc; border-radius: var(--radius); padding: 12px;
  display: flex; flex-direction: column; gap: 10px; min-width: 0;
}
.kcol-head { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; padding: 0 4px 6px; }
.kcol-head .cnt { color: var(--text-3); font-weight: 400; font-size: 12px; }
.kcard {
  background: #fff; border-radius: 8px; padding: 11px 12px;
  box-shadow: 0 1px 2px rgba(16,24,40,.05); cursor: pointer;
  border-left: 3px solid var(--border); transition: box-shadow .12s;
}
.kcard:hover { box-shadow: 0 4px 12px rgba(16,24,40,.1); }
.kcard .kt { font-size: 13px; font-weight: 500; margin-bottom: 6px; line-height: 1.4; }
.kcard .km { font-size: 11.5px; color: var(--text-3); }
.kcard .kdue { font-size: 11.5px; color: var(--text-3); margin-top: 5px; }
.kcard.overdue { border-left-color: var(--red); }
.kcard.urgent { border-left-color: var(--orange); }

/* ---------- 任务日历 ---------- */
.cal-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}
.cal-nav { display: flex; align-items: center; gap: 8px; }
.cal-month {
  font-size: 15px;
  font-weight: 600;
  min-width: 110px;
  text-align: center;
}
.cal-stats { display: flex; gap: 14px; font-size: 12.5px; color: var(--text-2); }
.cal-stats b { color: var(--text); font-weight: 600; }
.cal-stats .green b { color: var(--green); }
.cal-stats .red b { color: var(--red); }
.cal-toolbar .spacer { flex: 1; }
.cal-check {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12.5px;
  color: var(--text-2);
  cursor: pointer;
  white-space: nowrap;
}
.cal-check input { accent-color: var(--blue); cursor: pointer; }

.cal-wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 16px;
  align-items: start;
}
.cal-main {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.cal-weekhead {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  background: #fafbfc;
  border-bottom: 1px solid var(--border);
}
.cal-weekhead > div {
  padding: 10px 0;
  text-align: center;
  font-size: 12.5px;
  color: var(--text-2);
  font-weight: 500;
}
.cal-weekhead > div:first-child,
.cal-weekhead > div:last-child { color: var(--red); }

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  grid-auto-rows: minmax(118px, auto);
}
.cal-cell {
  border-right: 1px solid #f1f3f5;
  border-bottom: 1px solid #f1f3f5;
  padding: 5px 5px 6px;
  min-width: 0;
  cursor: pointer;
  transition: background .12s;
  position: relative;
  overflow: hidden;
}
.cal-cell:nth-child(7n) { border-right: none; }
.cal-cell.blank { background: #fcfcfd; cursor: default; }
.cal-cell.weekend:not(.blank) { background: #fdfefe; }
.cal-cell:hover:not(.blank) { background: #f7faff; }
.cal-cell.active { background: var(--blue-light) !important; box-shadow: inset 0 0 0 1.5px var(--blue); }
.cal-cell.today .cal-daynum > span:first-child {
  background: var(--blue);
  color: #fff;
  border-radius: 50%;
  width: 21px;
  height: 21px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.cal-daynum {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12.5px;
  color: var(--text-2);
  margin-bottom: 4px;
  min-height: 21px;
}
.cal-count {
  font-size: 10.5px;
  color: var(--text-3);
  background: var(--gray-bg);
  border-radius: 8px;
  padding: 0 5px;
  line-height: 15px;
}
.cal-items { display: flex; flex-direction: column; gap: 3px; }
.cal-item {
  display: flex;
  flex-direction: column;
  gap: 1px;
  font-size: 11.5px;
  line-height: 15px;
  padding: 2px 5px;
  border-radius: 4px;
  background: #eef4ff;
  color: #1f66d8;
  cursor: pointer;
  transition: background .1s;
  min-width: 0;
}
.cal-item:hover { background: #dce8ff; }
.cal-item .ci-line {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
}
.cal-item .dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--blue);
}
.cal-item-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
  flex: 1;
}
.ci-assignee {
  font-size: 10px;
  color: var(--text-3);
  padding-left: 9px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cal-item.overdue { background: var(--red-bg); color: var(--red); }
.cal-item.overdue .dot { background: var(--red); }
.cal-item.urgent { background: #ffeaea; color: #c02626; }
.cal-item.urgent .dot { background: #e11d1d; }
.cal-item.high { background: var(--orange-bg); color: #b26a0a; }
.cal-item.high .dot { background: var(--orange); }
.cal-item.pending { background: #fff7e8; color: #a8620a; }
.cal-item.pending .dot { background: var(--orange); }
.cal-item.done { background: var(--green-bg); color: var(--green); }
.cal-item.done .dot { background: var(--green); }
.cal-item.done .cal-item-title { text-decoration: line-through; opacity: .75; }
.cal-more { font-size: 10.5px; color: var(--text-3); padding-left: 4px; }

/* 侧栏 */
.cal-side {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 160px);
  position: sticky;
  top: 10px;
}
.cal-side-head {
  padding: 13px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13.5px;
  font-weight: 600;
}
.cal-side-body { padding: 12px; overflow-y: auto; flex: 1; }
.cal-empty { text-align: center; padding: 30px 10px; }
.cal-side-card {
  border: 1px solid var(--border);
  border-left: 3px solid var(--blue);
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: box-shadow .12s;
}
.cal-side-card:hover { box-shadow: 0 2px 10px rgba(16, 24, 40, .1); }
.cal-side-card.overdue { border-left-color: var(--red); }
.cal-side-card.urgent { border-left-color: #e11d1d; }
.cal-side-card.high { border-left-color: var(--orange); }
.cal-side-card.pending { border-left-color: var(--orange); }
.cal-side-card.done { border-left-color: var(--green); opacity: .8; }
.csc-title { font-size: 13px; font-weight: 500; margin-bottom: 6px; line-height: 1.4; }
.csc-meta { display: flex; gap: 5px; margin-bottom: 6px; }
.csc-row { font-size: 11.5px; color: var(--text-3); display: flex; flex-wrap: wrap; gap: 10px; }
.csc-progress { margin-top: 6px; }

.cal-nodate {
  border-top: 1px solid var(--border);
  padding: 10px 12px;
  background: #fcfcfd;
  max-height: 180px;
  overflow-y: auto;
}
.cal-nodate-head {
  font-size: 11.5px;
  color: var(--text-3);
  margin-bottom: 6px;
  font-weight: 500;
}
.cal-nodate-item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  padding: 3px 4px;
  border-radius: 4px;
  cursor: pointer;
}
.cal-nodate-item:hover { background: var(--gray-bg); }
.cal-nodate-item .dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #94a3b8;
  flex-shrink: 0;
}
.cal-nodate-item > span:nth-child(2) {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 1100px) {
  .cal-wrap { grid-template-columns: 1fr; }
  .cal-side { position: static; max-height: none; }
}
@media (max-width: 760px) {
  .cal-grid { grid-auto-rows: minmax(78px, auto); }
  .cal-item-title { display: none; }
  .cal-item { justify-content: center; padding: 2px; }
  .cal-stats { display: none; }
}

/* ---------- Toast ---------- */
.toast-host {
  position: fixed; top: 24px; left: 50%; transform: translateX(-50%);
  z-index: 3000; display: flex; flex-direction: column; gap: 8px;
  align-items: center; pointer-events: none;
}
.toast {
  background: #1f2937; color: #fff; padding: 10px 20px; border-radius: 8px;
  font-size: 13.5px; box-shadow: 0 8px 24px rgba(15,23,42,.25); max-width: 72vw;
}
.toast.ok { background: var(--green); }
.toast.err { background: var(--red); }

/* ---------- 周期循环任务 ---------- */
.seg-tabs { display: inline-flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; background: #fff; }
.seg-tabs.sm .seg-tab { padding: 5px 12px; font-size: 12.5px; }
.seg-tab { padding: 7px 16px; font-size: 13px; color: var(--text-2); border-right: 1px solid var(--border); background: #fff; }
.seg-tab:last-child { border-right: none; }
.seg-tab.active { background: var(--blue); color: #fff; font-weight: 500; }
.btn.xs { padding: 2px 7px; font-size: 12px; border-radius: 5px; }
.danger-ghost { color: var(--red); background: #fff; border-color: #f0c9c9; }
.danger-ghost:hover { background: var(--red-bg); }
.inline-check { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; color: var(--text-2); cursor: pointer; }

.recur-box {
  border: 1px solid #cfe0ff; background: #f7faff; border-radius: 10px;
  padding: 14px; display: flex; flex-direction: column; gap: 12px;
}
.recur-title { font-size: 13px; color: var(--blue-dark); font-weight: 500; }
.recur-hint { font-size: 12.5px; color: var(--text-2); }
.recur-hint b { color: var(--blue); font-size: 14px; }
.date-range { display: flex; align-items: center; gap: 6px; }
.date-range input { flex: 1; min-width: 0; }
.date-range span { color: var(--text-3); font-size: 12px; }
.custom-ranges { display: flex; flex-direction: column; gap: 8px; }
.custom-range-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.custom-range-row input { border: 1px solid var(--border); border-radius: 6px; padding: 5px 8px; outline: none; }
.custom-range-row .cr-label { width: 120px; }
.custom-range-row .cr-num { width: 60px; }
.custom-range-row span { font-size: 12.5px; color: var(--text-2); }

.recur-summary { border-bottom: 1px solid var(--border); padding-bottom: 12px; margin-bottom: 10px; }
.recur-summary-title { font-size: 16px; font-weight: 600; margin-bottom: 4px; }
.recur-inst-head { font-size: 13px; color: var(--text-2); margin: 8px 0; }
.recur-inst-list { display: flex; flex-direction: column; gap: 6px; max-height: 380px; overflow-y: auto; }
.recur-inst {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px;
  border: 1px solid var(--border); border-radius: 7px; font-size: 13px; flex-wrap: wrap;
}
.recur-inst .t-title { flex: 1; min-width: 140px; }
.recur-inst .t-sub { font-size: 12px; }

/* ---------- 响应式 ---------- */
@media (max-width: 1100px) {
  .kanban { grid-template-columns: repeat(4, minmax(200px, 1fr)); overflow-x: auto; }
}
@media (max-width: 860px) {
  .sidebar { position: fixed; left: -220px; top: 0; bottom: 0; z-index: 1500; transition: left .2s; }
  .sidebar.open { left: 0; box-shadow: 0 0 30px rgba(0,0,0,.15); }
  .sidebar-mask { position: fixed; inset: 0; background: rgba(0,0,0,.3); z-index: 1400; }
  .menu-btn { display: flex; }
  .content { padding: 14px; }
  .notif-panel { width: calc(100vw - 32px); right: -8px; }
  .form-row { grid-template-columns: 1fr; }
  .detail-grid { grid-template-columns: 1fr; }
}
