﻿:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-light: #dbeafe;
  --bg: #f1f5f9;
  --card: #ffffff;
  --text: #0f172a;
  --text-2: #64748b;
  --border: #e2e8f0;
  --todo: #f59e0b;
  --doing: #2563eb;
  --done: #22c55e;
  --danger: #ef4444;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(15, 23, 42, .08), 0 4px 14px rgba(15, 23, 42, .06);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: "Microsoft YaHei", "PingFang SC", "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}
.hidden { display: none !important; }

/* 顶栏 */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 28px;
  background: linear-gradient(135deg, #eff6ff, #dbeafe 60%, #bfdbfe);
  border-bottom: 1px solid #bfdbfe;
}
.brand { display: flex; align-items: center; gap: 14px; }
.logo { font-size: 34px; }
.brand h1 { font-size: 22px; color: #1d4ed8; }
.sub { font-size: 13px; color: #3b82f6; }
.stats { display: flex; gap: 12px; }
.stat {
  background: #fff; border-radius: 10px; padding: 8px 18px;
  text-align: center; box-shadow: var(--shadow); min-width: 74px;
}
.stat b { display: block; font-size: 20px; color: #1d4ed8; }
.stat span { font-size: 12px; color: var(--text-2); }

/* 主区域 */
main { max-width: 1180px; margin: 0 auto; padding: 24px 20px 60px; }
.view-head {
  display: flex; align-items: center; gap: 14px;
  margin-bottom: 20px; flex-wrap: wrap;
}
.view-head h2 { font-size: 19px; }
.view-head .btn:last-child { margin-left: auto; }

/* 按钮 */
.btn {
  border: 1px solid transparent; border-radius: 8px;
  padding: 8px 16px; font-size: 14px; cursor: pointer;
  font-family: inherit; transition: all .15s; white-space: nowrap;
}
.btn.primary { background: var(--primary); color: #fff; }
.btn.primary:hover { background: var(--primary-dark); }
.btn.ghost { background: #fff; color: var(--text); border-color: var(--border); }
.btn.ghost:hover { border-color: var(--primary); color: var(--primary); }
.btn.danger { background: var(--danger); color: #fff; }
.btn.danger:hover { background: #dc2626; }
.btn.small { padding: 4px 10px; font-size: 12px; }

/* 项目卡片 */
.project-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}
.pcard {
  background: var(--card); border-radius: var(--radius);
  padding: 18px; box-shadow: var(--shadow); cursor: pointer;
  border: 1px solid transparent; transition: all .15s;
  position: relative;
}
.pcard:hover { border-color: var(--primary); transform: translateY(-2px); }
.pcard h3 { font-size: 16px; margin-bottom: 6px; padding-right: 64px; }
.pcard .desc {
  font-size: 13px; color: var(--text-2); min-height: 38px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; margin-bottom: 10px;
}
.pcard .dates { font-size: 12px; color: var(--text-2); margin-bottom: 12px; }
.pbar { height: 6px; background: var(--border); border-radius: 3px; overflow: hidden; }
.pbar i { display: block; height: 100%; background: linear-gradient(90deg, #3b82f6, #2563eb); border-radius: 3px; transition: width .3s; }
.pmeta { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; font-size: 12px; color: var(--text-2); }
.pcard .menu {
  position: absolute; top: 12px; right: 12px;
  background: none; border: none; font-size: 18px; cursor: pointer;
  color: var(--text-2); padding: 2px 6px; border-radius: 6px;
}
.pcard .menu:hover { background: var(--bg); color: var(--text); }
.dropdown {
  position: absolute; right: 8px; top: 38px; z-index: 30;
  background: #fff; border: 1px solid var(--border); border-radius: 8px;
  box-shadow: var(--shadow); overflow: hidden; min-width: 110px;
}
.dropdown button {
  display: block; width: 100%; text-align: left; border: none;
  background: none; padding: 9px 14px; font-size: 13px; cursor: pointer;
  font-family: inherit; color: var(--text);
}
.dropdown button:hover { background: var(--bg); }
.dropdown button.del { color: var(--danger); }

/* 徽章 */
.chip {
  display: inline-block; font-size: 12px; padding: 3px 10px;
  border-radius: 999px; background: var(--primary-light); color: var(--primary-dark);
}
.chip.high { background: #fee2e2; color: #b91c1c; }
.chip.low { background: #dcfce7; color: #15803d; }

/* 空状态 */
.empty { text-align: center; padding: 70px 0; color: var(--text-2); }
.empty-icon { font-size: 56px; margin-bottom: 12px; }

/* 看板 */
.board { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; align-items: start; }
.col {
  background: #e8edf5; border-radius: var(--radius); padding: 12px;
  min-height: 320px;
}
.col-head { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; margin-bottom: 12px; padding: 0 4px; }
.col-head .count { margin-left: auto; background: #fff; border-radius: 999px; padding: 1px 9px; font-size: 12px; color: var(--text-2); }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.dot-todo { background: var(--todo); }
.dot-doing { background: var(--doing); }
.dot-done { background: var(--done); }
.col-body { display: flex; flex-direction: column; gap: 10px; min-height: 200px; }
.col-body.drag-over { outline: 2px dashed var(--primary); outline-offset: -4px; border-radius: 8px; }

.tcard {
  background: var(--card); border-radius: 10px; padding: 12px 14px;
  box-shadow: var(--shadow); cursor: grab; position: relative;
  border-left: 4px solid var(--border);
  transition: box-shadow .15s;
}
.tcard:hover { box-shadow: 0 4px 12px rgba(15,23,42,.14); }
.tcard.dragging { opacity: .5; }
.tcard.p-low { border-left-color: var(--done); }
.tcard.p-medium { border-left-color: var(--todo); }
.tcard.p-high { border-left-color: var(--danger); }
.tcard .t-title { font-size: 14px; font-weight: 600; margin-bottom: 6px; padding-right: 56px; word-break: break-all; }
.tcard .t-desc { font-size: 12px; color: var(--text-2); margin-bottom: 8px; word-break: break-all; }
.tcard .t-foot { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-2); flex-wrap: wrap; }
.tcard .t-menu {
  position: absolute; top: 6px; right: 6px; background: none; border: none;
  font-size: 15px; color: var(--text-2); cursor: pointer; border-radius: 6px; padding: 1px 6px;
}
.tcard .t-menu:hover { background: var(--bg); }
.tag-priority { font-size: 11px; padding: 1px 8px; border-radius: 999px; }
.tag-priority.low { background: #dcfce7; color: #15803d; }
.tag-priority.medium { background: #fef3c7; color: #b45309; }
.tag-priority.high { background: #fee2e2; color: #b91c1c; }
.tag-due { background: var(--bg); border-radius: 999px; padding: 1px 8px; }
.tag-due.overdue { background: #fee2e2; color: #b91c1c; }
.tag-assignee { background: var(--primary-light); color: var(--primary-dark); border-radius: 999px; padding: 1px 8px; }

/* 弹窗 */
.modal-mask {
  position: fixed; inset: 0; background: rgba(15, 23, 42, .45);
  display: flex; align-items: center; justify-content: center; z-index: 100;
}
.modal {
  background: #fff; border-radius: 14px; padding: 24px; width: 460px; max-width: 92vw;
  max-height: 90vh; overflow-y: auto; box-shadow: 0 20px 50px rgba(15,23,42,.25);
}
.modal.small { width: 360px; }
.modal h3 { margin-bottom: 16px; }
.modal label { display: block; font-size: 13px; color: var(--text-2); margin: 12px 0 6px; }
.modal input, .modal select, .modal textarea {
  width: 100%; padding: 9px 12px; border: 1px solid var(--border);
  border-radius: 8px; font-size: 14px; font-family: inherit; background: #fff;
  outline: none; color: var(--text);
}
.modal input:focus, .modal select:focus, .modal textarea:focus { border-color: var(--primary); }
.form-row { display: flex; gap: 12px; }
.form-row > div { flex: 1; }
.req { color: var(--danger); }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }

/* Toast */
.toast {
  position: fixed; left: 50%; bottom: 32px; transform: translateX(-50%);
  background: var(--text); color: #fff; padding: 10px 20px; border-radius: 8px;
  font-size: 13px; z-index: 200; box-shadow: 0 8px 24px rgba(15,23,42,.25);
}
.toast.ok { background: var(--done); }
.toast.err { background: var(--danger); }

@media (max-width: 800px) {
  .topbar { flex-direction: column; gap: 12px; align-items: flex-start; }
  .board { grid-template-columns: 1fr; }
  .form-row { flex-direction: column; }
}


/* ===== 顶部导航与新增 UI（2026-08-07 仪表盘升级） ===== */
.top-right { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.tabs {
  display: flex; background: #fff; border-radius: 10px; padding: 4px;
  box-shadow: var(--shadow); gap: 2px;
}
.tab {
  border: none; background: none; padding: 8px 16px; border-radius: 8px;
  font-size: 14px; cursor: pointer; color: var(--text-2); font-family: inherit;
  transition: all .15s; white-space: nowrap;
}
.tab:hover { color: var(--primary); }
.tab.active { background: var(--primary); color: #fff; }

/* KPI 卡片 */
.kpi-row { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; margin-bottom: 18px; }
.kpi {
  background: var(--card); border-radius: var(--radius); padding: 14px 10px;
  text-align: center; box-shadow: var(--shadow);
}
.kpi b { display: block; font-size: 24px; color: var(--primary-dark); }
.kpi span { font-size: 12px; color: var(--text-2); }
.kpi.warn b { color: #b45309; }
.kpi.hot { background: #fef2f2; box-shadow: 0 1px 3px rgba(239,68,68,.15); }
.kpi.hot b { color: var(--danger); }

/* 图表网格 */
.chart-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.chart-card {
  background: var(--card); border-radius: var(--radius); padding: 18px;
  box-shadow: var(--shadow);
}
.chart-card.wide { grid-column: span 2; }
.chart-card h3 { font-size: 15px; margin-bottom: 14px; display: flex; align-items: center; gap: 8px; }
.chart-card .hint { font-size: 12px; color: var(--text-2); font-weight: normal; }
.chart-body { min-height: 40px; }
.empty-chart { text-align: center; color: var(--text-2); font-size: 13px; padding: 30px 0; }

/* 环形图 */
.donut-wrap { position: relative; display: inline-block; }
.donut-center {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; pointer-events: none;
}
.donut-center b { font-size: 26px; color: var(--text); }
.donut-center span { font-size: 11px; color: var(--text-2); }
.legend { margin-top: 12px; display: flex; flex-direction: column; gap: 6px; }
.legend-item { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-2); }
.legend-item i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.legend-item b { color: var(--text); }
.legend-item span { margin-left: auto; }

/* 水平条形（优先级） */
.hrow { margin-bottom: 14px; }
.hrow:last-child { margin-bottom: 0; }
.hrow-top { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 6px; }
.hrow-top b { color: var(--text); }
.hbar { height: 10px; background: #eef2f7; border-radius: 5px; overflow: hidden; }
.hbar i { display: block; height: 100%; border-radius: 5px; transition: width .4s; }

/* 项目进度行 */
.prow { display: grid; grid-template-columns: 150px 1fr 48px 64px; gap: 12px; align-items: center; padding: 8px 0; border-bottom: 1px dashed var(--border); }
.prow:last-child { border-bottom: none; }
.prow-name { font-size: 13px; font-weight: 600; cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prow-name:hover { color: var(--primary); }
.prow-pct { font-size: 13px; font-weight: 600; color: var(--primary-dark); text-align: right; }
.prow-n { font-size: 12px; color: var(--text-2); }

/* 趋势图 */
.trend-wrap { width: 100%; }

/* 仪表盘下半区两列 */
.dash-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* 到期提醒 */
.due-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px dashed var(--border); font-size: 13px; }
.due-row:last-child { border-bottom: none; }
.due-badge { font-size: 11px; padding: 2px 8px; border-radius: 999px; background: #fef3c7; color: #b45309; white-space: nowrap; }
.due-badge.due-today { background: #ffedd5; color: #c2410c; }
.due-badge.due-soon { background: #fef9c3; color: #a16207; }
.due-title { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.due-proj { color: var(--text-2); cursor: pointer; font-size: 12px; }
.due-proj:hover { color: var(--primary); text-decoration: underline; }

/* 最近动态 */
.act-row { display: flex; align-items: baseline; gap: 10px; padding: 8px 0; border-bottom: 1px dashed var(--border); font-size: 13px; }
.act-row:last-child { border-bottom: none; }
.act-icon { width: 22px; text-align: center; }
.act-text { flex: 1; color: var(--text); word-break: break-all; }
.act-time { font-size: 11px; color: var(--text-2); white-space: nowrap; }

/* 看板筛选栏 */
.filter-bar { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.filter-bar input[type="search"], .filter-bar select {
  padding: 8px 12px; border: 1px solid var(--border); border-radius: 8px;
  font-size: 13px; font-family: inherit; background: #fff; outline: none; color: var(--text);
}
.filter-bar input[type="search"] { flex: 1; min-width: 180px; max-width: 320px; }
.filter-bar input:focus, .filter-bar select:focus { border-color: var(--primary); }
.filter-count { font-size: 12px; color: var(--text-2); }

/* 任务到期徽标增强 */
.tag-due.due-today { background: #ffedd5; color: #c2410c; }
.tag-due.due-soon { background: #fef9c3; color: #a16207; }
.od { color: var(--danger); }
.col-empty { text-align: center; color: var(--text-2); font-size: 12px; padding: 18px 0; }

@media (max-width: 900px) {
  .kpi-row { grid-template-columns: repeat(3, 1fr); }
  .chart-grid, .dash-row { grid-template-columns: 1fr; }
  .chart-card.wide { grid-column: span 1; }
}

/* 登录页 */
.login-view { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #eff6ff 0%, #e0eaff 100%); z-index: 100; }
.login-card { background: #fff; border-radius: 16px; padding: 40px 44px; width: 360px; max-width: 90vw; box-shadow: 0 10px 40px rgba(30, 64, 175, .12); text-align: center; box-sizing: border-box; }
.login-logo { font-size: 42px; margin-bottom: 10px; }
.login-card h1 { font-size: 20px; color: var(--primary-dark); margin: 0 0 6px; }
.login-sub { font-size: 13px; color: var(--text-2); margin: 0 0 22px; }
.login-card input { width: 100%; padding: 10px 14px; border: 1px solid var(--border); border-radius: 10px; font-size: 14px; box-sizing: border-box; margin-bottom: 12px; outline: none; }
.login-card input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(59,130,246,.15); }
.login-btn { width: 100%; }
.login-err { color: var(--danger); font-size: 13px; margin: 10px 0 0; }
/* 负责人负载堆叠条 */
.stackbar { height: 12px; background: #eef2f7; border-radius: 6px; overflow: hidden; display: flex; }
.stackbar i { display: block; height: 100%; transition: width .4s; }
.stackbar i.open { background: linear-gradient(90deg, #f59e0b, #f97316); }
.stackbar i.done { background: linear-gradient(90deg, #22c55e, #16a34a); }
/* 环形图交互 */
.donut-seg { cursor: pointer; }
.donut-seg:hover { opacity: .85; }

/* ===== 甘特图 ===== */
.gantt-card {
  background: var(--card); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 16px 0; overflow: hidden;
}
.gantt-hint { font-size: 12px; color: var(--text-2); }
.gantt-body { overflow-x: auto; padding: 0 12px 12px; }
.gantt-scroll { position: relative; }
.g-row {
  display: flex; align-items: center; height: 34px;
  border-bottom: 1px solid #f1f5f9; font-size: 13px;
}
.g-row.g-head { height: 26px; border-bottom: 1px solid var(--border); }
.g-row.g-proj-row { height: 40px; background: #f8fafc; border-bottom: 1px solid var(--border); }
.g-name {
  flex-shrink: 0; padding: 0 10px; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; font-weight: 500;
}
.g-name-text { cursor: pointer; }
.g-name-text:hover { color: var(--primary); text-decoration: underline; }
.g-name-text.sub { font-weight: 400; color: var(--text); }
.g-track { position: relative; height: 100%; flex-shrink: 0; }
.g-cell {
  position: absolute; top: 0; height: 100%;
  border-left: 1px solid #f1f5f9; font-size: 10px;
  color: var(--text-2); padding: 6px 2px 0; white-space: nowrap;
  font-style: normal; box-sizing: border-box; overflow: hidden;
}
.g-cell.today { background: rgba(37, 99, 235, .08); color: var(--primary-dark); font-weight: 600; }
.g-today-line {
  position: absolute; top: 0; bottom: 0; width: 2px;
  background: #ef4444; opacity: .55; z-index: 5;
}
.g-bar {
  position: absolute; top: 50%; transform: translateY(-50%);
  border-radius: 6px; height: 16px; display: block;
}
.g-bar.g-proj { height: 26px; opacity: .9; }
.g-bar.g-proj.p-high { background: linear-gradient(90deg, #fca5a5, #ef4444); }
.g-bar.g-proj.p-medium { background: linear-gradient(90deg, #93c5fd, #3b82f6); }
.g-bar.g-proj.p-low { background: linear-gradient(90deg, #86efac, #22c55e); }
.g-bar.g-task { height: 12px; border: 1px solid rgba(255,255,255,.6); }
.g-bar.g-task.st-todo { background: #f59e0b; }
.g-bar.g-task.st-doing { background: #2563eb; }
.g-bar.g-task.st-done { background: #22c55e; }

.g-row.g-ms-row { height: 28px; background: rgba(245, 158, 11, .05); }
.g-name-text.ms { color: #b45309; font-weight: 500; }
.g-name-text.ms.done { color: var(--text-2); text-decoration: line-through; }
.g-ms-dia {
  position: absolute; top: 50%; width: 12px; height: 12px;
  background: #f59e0b; border: 1px solid #d97706; border-radius: 2px;
  transform: translateY(-50%) rotate(45deg);
  box-shadow: 0 1px 3px rgba(0, 0, 0, .18); z-index: 3;
}
.g-ms-dia.done { background: #22c55e; border-color: #16a34a; }

/* ===== 任务详情弹窗 ===== */
.modal.detail { width: 600px; max-width: 92vw; max-height: 86vh; overflow-y: auto; }
.detail-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.detail-head h3 { margin: 0; flex: 1; min-width: 0; word-break: break-all; }
.detail-head .btn { margin-left: auto; }
.dt-meta { font-size: 13px; color: var(--text-2); margin-bottom: 10px; }
.dt-desc {
  font-size: 14px; line-height: 1.6; background: #f8fafc;
  border: 1px dashed var(--border); border-radius: 10px;
  padding: 12px 14px; margin-bottom: 6px; word-break: break-all; white-space: pre-wrap;
}
.dt-section { margin-top: 18px; }
.dt-section h4 { font-size: 14px; margin-bottom: 10px; }
.sub-count { font-size: 12px; color: var(--text-2); font-weight: 400; }
.muted { color: var(--text-2); font-size: 13px; }
.sub-list, .cmt-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; }
.sub-row {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px;
  background: #f8fafc; border-radius: 8px; font-size: 13px;
}
.sub-row.done .sub-title { text-decoration: line-through; color: var(--text-2); }
.sub-check { width: 16px; height: 16px; accent-color: var(--done); cursor: pointer; flex-shrink: 0; }
.sub-title { flex: 1; word-break: break-all; }
.sub-del, .cmt-del {
  border: none; background: none; color: var(--text-2); cursor: pointer;
  font-size: 13px; padding: 2px 6px; border-radius: 6px; flex-shrink: 0;
}
.sub-del:hover, .cmt-del:hover { background: #fee2e2; color: var(--danger); }
.sub-add, .cmt-add { display: flex; gap: 8px; }
.sub-add input, .cmt-add input {
  padding: 8px 12px; border: 1px solid var(--border); border-radius: 8px;
  font-size: 13px; font-family: inherit; outline: none; flex: 1; min-width: 0;
}
.cmt-add input:first-child { flex: 0 0 84px; }
.sub-add input:focus, .cmt-add input:focus { border-color: var(--primary); }
.cmt-row {
  background: #f8fafc; border-radius: 8px; padding: 8px 12px;
}
.cmt-head { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-2); margin-bottom: 4px; }
.cmt-head b { color: var(--primary-dark); }
.cmt-head span { margin-right: auto; }
.cmt-body { font-size: 13px; line-height: 1.5; word-break: break-all; white-space: pre-wrap; }
/* ===== 新增：项目状态 ===== */
.pchip { font-size: 11px; padding: 2px 9px; border-radius: 999px; background: #e2e8f0; color: #475569; white-space: nowrap; }
.pstatus-planning { background: #ede9fe; color: #6d28d9; }
.pstatus-active { background: #dbeafe; color: #1d4ed8; }
.pstatus-completed { background: #dcfce7; color: #15803d; }
.pstatus-archived { background: #f1f5f9; color: #64748b; }
.pcard.archived { opacity: .62; }
.ptabs { display: flex; gap: 8px; margin: -6px 0 16px; flex-wrap: wrap; }
.ptab {
  border: 1px solid var(--border); background: #fff; color: var(--text-2);
  padding: 5px 14px; border-radius: 999px; font-size: 13px; cursor: pointer; font-family: inherit;
}
.ptab:hover { border-color: var(--primary); color: var(--primary); }
.ptab.active { background: var(--primary); border-color: var(--primary); color: #fff; }

/* ===== 新增：标签 ===== */
.t-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 6px; }
.t-tag { font-size: 11px; padding: 1px 8px; border-radius: 999px; font-weight: 500; }
.tag-hours { background: var(--bg); border-radius: 999px; padding: 1px 8px; color: var(--text-2); }
.dt-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.dt-tag { font-size: 12px; padding: 2px 10px; border-radius: 999px; font-weight: 500; }
.tag-cloud { display: flex; flex-wrap: wrap; gap: 8px; }
.tagchip {
  border: none; cursor: pointer; font-family: inherit; font-size: 12px;
  padding: 5px 12px; border-radius: 999px; font-weight: 500;
}
.tagchip b { margin-left: 4px; font-weight: 700; }

/* ===== 新增：工时 ===== */
.hours-total { font-size: 13px; color: var(--text-2); margin-bottom: 12px; }
.hours-total b { color: var(--text); }
.hours-bar { height: 12px; background: #eef2f7; border-radius: 6px; overflow: hidden; display: flex; }
.hours-bar i { display: block; height: 100%; transition: width .4s; }
.hours-bar i.est { background: linear-gradient(90deg, #93c5fd, #3b82f6); }
.hours-bar i.act { background: linear-gradient(90deg, #fca5a5, #ef4444); }

/* ===== 新增：日历 ===== */
.cal-nav { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.cal-title { font-size: 15px; font-weight: 600; min-width: 110px; text-align: center; color: var(--primary-dark); }
.cal-body { padding: 14px; overflow-x: auto; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; min-width: 640px; }
.cal-dow { text-align: center; font-size: 12px; color: var(--text-2); padding: 6px 0; font-weight: 600; }
.cal-cell {
  min-height: 92px; background: #f8fafc; border: 1px solid var(--border);
  border-radius: 10px; padding: 6px; display: flex; flex-direction: column; gap: 3px;
}
.cal-cell.cal-empty { background: transparent; border-color: transparent; }
.cal-cell.cal-today { background: #eff6ff; border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary) inset; }
.cal-num { font-size: 12px; color: var(--text-2); display: flex; align-items: center; gap: 6px; }
.cal-today .cal-num { color: var(--primary); font-weight: 700; }
.cal-od { font-size: 10px; color: var(--danger); background: #fee2e2; border-radius: 999px; padding: 0 6px; }
.cal-chip {
  border: none; cursor: pointer; text-align: left; font-family: inherit;
  font-size: 11px; padding: 2px 7px; border-radius: 6px; border-left: 3px solid var(--border);
  background: #fff; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.cal-chip:hover { box-shadow: var(--shadow); }
.cal-chip.st-todo { border-left-color: var(--todo); }
.cal-chip.st-doing { border-left-color: var(--doing); }
.cal-chip.st-done { border-left-color: var(--done); text-decoration: line-through; color: var(--text-2); }
.cal-more { font-size: 11px; color: var(--text-2); padding-left: 4px; }

@media (max-width: 760px) {
  .cal-nav { margin-left: 0; }
  .cal-body { padding: 8px; }
}


/* ===== v3：全局搜索 ===== */
.search-wrap { position: relative; }
#globalSearch {
  width: 220px; padding: 8px 14px; border: 1px solid var(--border);
  border-radius: 999px; font-size: 13px; font-family: inherit;
  background: #fff; outline: none; color: var(--text);
  box-shadow: var(--shadow); transition: all .15s;
}
#globalSearch:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37, 99, 235, .12); width: 260px; }
.search-drop {
  position: absolute; top: 42px; right: 0; width: 340px; max-height: 430px;
  overflow-y: auto; background: #fff; border: 1px solid var(--border);
  border-radius: 12px; box-shadow: 0 10px 34px rgba(15, 23, 42, .16);
  z-index: 60; padding: 6px;
}
.s-head { font-size: 11px; color: var(--text-2); padding: 8px 10px 4px; font-weight: 600; }
.s-item {
  display: flex; align-items: center; gap: 8px; width: 100%;
  border: none; background: none; text-align: left; cursor: pointer;
  padding: 8px 10px; border-radius: 8px; font-size: 13px; font-family: inherit; color: var(--text);
}
.s-item:hover { background: var(--bg); }
.s-ico { font-size: 14px; flex: none; }
.s-txt { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.s-side { font-size: 11px; color: var(--text-2); flex: none; }
.s-empty { padding: 18px 12px; text-align: center; color: var(--text-2); font-size: 13px; }

/* ===== v3：仪表盘工具条 ===== */
.dash-tools { display: flex; justify-content: flex-end; gap: 10px; margin-bottom: 14px; }

/* ===== v3：里程碑（看板） ===== */
.ms-section {
  background: var(--card); border-radius: var(--radius); padding: 14px 16px;
  box-shadow: var(--shadow); margin-bottom: 16px;
}
.ms-add { display: flex; gap: 10px; align-items: center; margin-bottom: 10px; }
.ms-add input[type="text"] {
  flex: 1; padding: 8px 12px; border: 1px solid var(--border);
  border-radius: 8px; font-size: 13px; font-family: inherit; outline: none; color: var(--text);
}
.ms-add input[type="date"] { padding: 7px 10px; border: 1px solid var(--border); border-radius: 8px; font-size: 13px; font-family: inherit; outline: none; color: var(--text); }
.ms-add input:focus { border-color: var(--primary); }
.ms-list { display: flex; flex-wrap: wrap; gap: 8px; }
.ms-empty { font-size: 12px; color: var(--text-2); padding: 4px 2px; }
.ms-item {
  display: flex; align-items: center; gap: 8px;
  background: #f8fafc; border: 1px solid var(--border); border-radius: 999px;
  padding: 5px 12px 5px 8px; font-size: 13px;
}
.ms-item.done { opacity: .62; }
.ms-item.done .ms-title { text-decoration: line-through; }
.ms-check { accent-color: var(--primary); width: 15px; height: 15px; cursor: pointer; }
.ms-title { font-weight: 600; }
.ms-due { font-size: 11px; color: var(--text-2); background: var(--bg); border-radius: 999px; padding: 1px 8px; }
.ms-due.overdue { background: #fee2e2; color: #b91c1c; }
.ms-del {
  border: none; background: none; color: var(--text-2); cursor: pointer;
  font-size: 12px; padding: 2px 4px; border-radius: 50%;
}
.ms-del:hover { background: #fee2e2; color: var(--danger); }
.ms-progress { display: flex; align-items: center; gap: 10px; margin-top: 12px; }
.ms-bar { flex: 1; height: 6px; background: var(--border); border-radius: 3px; overflow: hidden; }
.ms-bar i { display: block; height: 100%; background: linear-gradient(90deg, #8b5cf6, #6d28d9); border-radius: 3px; transition: width .3s; }
#msText { font-size: 12px; color: var(--text-2); white-space: nowrap; }
.ms-chip {
  display: inline-block; font-size: 11px; margin-bottom: 8px;
  background: #ede9fe; color: #6d28d9; border-radius: 999px; padding: 2px 9px;
}

/* ===== v3：近期里程碑（仪表盘） ===== */
.due-badge.ms { background: #ede9fe; color: #6d28d9; }
.due-badge.ms.due-today { background: #fef3c7; color: #b45309; }
.due-badge.ms.due-soon { background: #fef3c7; color: #b45309; }

/* ===== v3：周报 ===== */
.modal.report { width: 560px; }
.report-body { max-height: 56vh; overflow-y: auto; padding-right: 4px; }
.r-sec { margin: 12px 0 16px; }
.r-sec h4 { font-size: 14px; margin-bottom: 8px; color: var(--text); }
.r-sec ul { list-style: none; }
.r-sec li { font-size: 13px; padding: 4px 0 4px 16px; position: relative; color: var(--text); }
.r-sec li::before { content: "•"; position: absolute; left: 2px; color: var(--primary); }
.r-sec li.muted { color: var(--text-2); }
.r-sec li.muted::before { color: var(--text-2); }
.r-sec p { font-size: 13px; color: var(--text-2); }
.muted { color: var(--text-2); }
.r-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.r-table th, .r-table td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--border); }
.r-table th { color: var(--text-2); font-weight: 600; font-size: 12px; }
.r-bar { display: inline-block; width: 90px; height: 6px; background: var(--border); border-radius: 3px; overflow: hidden; vertical-align: middle; margin-right: 6px; }
.r-bar b { display: block; height: 100%; background: linear-gradient(90deg, #3b82f6, #2563eb); border-radius: 3px; }
