/* ============ 目标管理工作台 · 样式 ============ */
:root {
  --bg: #f4f5f7;
  --card: #ffffff;
  --line: #e7e8ea;
  --text: #1f2937;
  --muted: #6b7280;
  --blue: #3b82f6;
  --indigo: #6366f1;
  --aqua: #14b8a6;
  --good: #16a34a;
  --warn: #f59e0b;
  --bad: #ef4444;
  --critical: #dc2626;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(0, 0, 0, .06);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  overflow: hidden;
}
.hidden { display: none !important; }
#app-view { height: 100vh; display: flex; flex-direction: column; }
.btn {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  padding: 8px 16px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  transition: all .15s;
}
.btn:hover { border-color: var(--blue); color: var(--blue); }
.btn-primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn-primary:hover { background: #2563eb; color: #fff; }
.btn-ghost { border: none; background: transparent; color: var(--muted); }
.btn-block { width: 100%; margin-top: 12px; }
.icon-btn {
  border: none; background: transparent; color: var(--muted); cursor: pointer;
  font-size: 13px; padding: 2px 6px; border-radius: 6px;
}
.icon-btn:hover { background: #eef2ff; color: var(--blue); }
.icon-btn.danger:hover { background: #fee2e2; color: var(--bad); }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 20px; margin-bottom: 16px; box-shadow: var(--shadow);
}
.card h3 { margin: 0 0 12px; font-size: 15px; }
.empty { color: var(--muted); text-align: center; padding: 40px 0; }

/* ---------- 登录 ---------- */
.login-view {
  position: fixed; inset: 0; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #eef2ff, #e0e7ff);
}
.login-card {
  background: #fff; border-radius: 16px; padding: 40px; width: 360px;
  text-align: center; box-shadow: 0 8px 30px rgba(0, 0, 0, .08);
}
.login-brand { font-size: 48px; }
.login-card h1 { margin: 8px 0 4px; font-size: 22px; }
.login-sub { color: var(--muted); margin: 0 0 20px; font-size: 13px; }
.login-form { text-align: left; }
.login-form label { display: block; margin: 10px 0 4px; font-size: 13px; color: var(--muted); }
.login-form input {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; font-size: 14px;
}
.login-form input:focus { outline: none; border-color: var(--blue); }
.login-error { color: var(--critical); font-size: 13px; margin-top: 10px; }
.login-hint { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 18px; }
.hint-pill {
  border: 1px solid var(--line); background: #f9fafb; border-radius: 20px;
  padding: 5px 12px; font-size: 12px; cursor: pointer; color: var(--text);
}
.hint-pill:hover { border-color: var(--blue); color: var(--blue); }

/* ---------- 顶栏 ---------- */
.topbar {
  display: flex; align-items: center; gap: 24px; height: 56px; padding: 0 20px;
  background: #fff; border-bottom: 1px solid var(--line);
  flex-shrink: 0; z-index: 60;
}
.logo { font-weight: 700; font-size: 16px; }
.nav { display: flex; gap: 4px; }
.nav-btn {
  border: none; background: transparent; padding: 8px 14px; cursor: pointer;
  color: var(--muted); font-size: 14px; border-radius: 8px;
}
.nav-btn.active { background: #eef2ff; color: var(--blue); font-weight: 600; }
.user-box { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.user-avatar {
  width: 30px; height: 30px; border-radius: 50%; background: var(--indigo); color: #fff;
  display: inline-flex; align-items: center; justify-content: center; font-size: 14px;
}
.user-role { font-size: 12px; color: var(--muted); }

.main {
  flex: 1; min-height: 0; overflow-y: auto;
  align-self: center; width: 100%; max-width: 1500px;
  padding: 0 20px 20px;
}
.page-head {
  position: sticky; top: 0; z-index: 50; background: var(--bg);
  padding: 16px 0 12px;
}
.page-head h2 { margin: 0; }
.page-desc { color: var(--muted); margin: 4px 0 16px; font-size: 13px; }

/* ---------- 目标页：左侧菜单 + 列表 ---------- */
.goals-page { display: grid; grid-template-columns: 220px 1fr; gap: 20px; align-items: start; }
.time-menu {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px; box-shadow: var(--shadow); position: sticky; top: 20px;
}
.menu-title { font-weight: 700; margin-bottom: 10px; }
.menu-quarter {
  padding: 8px 10px; border-radius: 8px; cursor: pointer; font-weight: 600; color: var(--text);
}
.menu-quarter:hover { background: #f3f4f6; }
.menu-quarter.active { background: #eef2ff; color: var(--blue); }
.menu-months { margin-left: 12px; border-left: 2px solid var(--line); padding-left: 8px; }
.menu-month {
  padding: 6px 10px; border-radius: 8px; cursor: pointer; color: var(--muted); font-size: 13px;
}
.menu-month:hover { background: #f3f4f6; }
.menu-month.active { background: #eef2ff; color: var(--blue); font-weight: 600; }
.menu-empty { color: var(--muted); padding: 10px; font-size: 13px; }

.filter-bar {
  display: flex; gap: 10px; align-items: center; margin-bottom: 14px;
}
.filter-select {
  padding: 8px 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff;
  font-size: 14px; color: var(--text);
}
.filter-bar .btn { margin-left: auto; }

.goal-list { display: flex; flex-direction: column; gap: 8px; }
.goal-row { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 16px; box-shadow: var(--shadow); }
.goal-node { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.goal-icon { font-size: 15px; }
.tree-arrow { color: var(--muted); font-size: 12px; width: 14px; }
.goal-title { font-weight: 600; }
.goal-children { margin-left: 26px; padding-left: 12px; border-left: 2px solid #eef0f3; margin-top: 8px; display: flex; flex-direction: column; gap: 6px; }

.level-tag {
  font-size: 11px; padding: 1px 7px; border-radius: 4px; color: #fff; white-space: nowrap;
}
.level-quarter { background: var(--indigo); }
.level-month { background: var(--blue); }
.level-strategy { background: var(--aqua); }
.level-action { background: #9ca3af; }

.dept-chip {
  font-size: 12px; padding: 1px 8px; border-radius: 12px; background: #f0fdf4; color: #15803d; white-space: nowrap;
}
.owner-chip { font-size: 12px; color: var(--muted); }
.hour-chip { font-size: 12px; color: var(--muted); }
.ta-chip { font-size: 12px; color: var(--indigo); font-weight: 500; }
.goal-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-left: auto; }
.goal-actions { display: flex; gap: 2px; }

.status-tag { font-size: 12px; padding: 2px 9px; border-radius: 12px; white-space: nowrap; }
.status-not_started { background: #f3f4f6; color: #6b7280; }
.status-in_progress { background: #eff6ff; color: #2563eb; }
.status-done { background: #f0fdf4; color: #16a34a; }
.status-paused { background: #fffbeb; color: #d97706; }
.status-overdue { background: #fef2f2; color: #dc2626; }

.progress-row { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.progress-bar { flex: 1; height: 8px; background: #eef0f3; border-radius: 4px; overflow: hidden; }
.progress-fill { height: 100%; border-radius: 4px; transition: width .3s; }
.progress-fill.good { background: var(--good); }
.progress-fill.warn { background: var(--warn); }
.progress-fill.bad { background: var(--bad); }
.progress-pct { font-size: 12px; color: var(--muted); min-width: 36px; text-align: right; }

.tree-toolbar { display: flex; align-items: center; color: var(--muted); font-size: 13px; margin-bottom: 8px; }

/* ---------- 日报 ---------- */
.report-wrap { }
.report-head-sticky {
  position: sticky; top: 0; z-index: 50; background: var(--bg);
  padding: 16px 0 12px;
}
.report-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: stretch; }
.report-left, .report-right { min-width: 0; }
.report-right .card { height: 100%; }
.report-head { margin-bottom: 12px; }
.report-head h2 { margin: 0; }
.report-info-bar {
  display: flex; align-items: center; gap: 24px; flex-wrap: wrap;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 20px; margin-bottom: 16px; box-shadow: var(--shadow);
}
.info-item { display: flex; align-items: center; gap: 8px; }
.info-item label { font-size: 15px; color: var(--text); font-weight: 600; white-space: nowrap; }
.info-val { font-weight: 600; background: #eef2ff; color: #1f2937; padding: 4px 12px; border-radius: 6px; }
.report-info-bar .filter-select, .report-info-bar input[type="date"] {
  background: #eef2ff; color: #1f2937; font-weight: 600; padding: 6px 12px; border-radius: 6px; border: 1px solid #c7d2fe; font-size: 15px;
}
.report-info-bar .filter-select { width: 140px; }
.info-item input[type="date"] { padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; }
.report-info-bar .filter-select { padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; }
.rpt-hint { color: var(--muted); font-size: 12px; margin: -6px 0 12px; }
.rpt-goal-row {
  display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid #f3f4f6;
}
.rpt-goal-title { flex: 1; font-weight: 500; }
.rpt-goal-meta { font-size: 12px; color: var(--muted); white-space: nowrap; }
.rpt-hours { width: 120px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; }
.rpt-acc { font-size: 12px; color: var(--muted); white-space: nowrap; }
.result-row { display: flex; align-items: flex-start; gap: 6px; }
.result-row textarea { flex: 1; }

.field { margin-bottom: 12px; }
.field label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.field input, .field select, .field textarea {
  width: 100%; padding: 9px 12px; border: 1px solid var(--line); border-radius: 8px; font-size: 14px;
}
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--blue); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* ---------- 看板 ---------- */
.kpi-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 16px; }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow); }
.kpi-label { color: var(--muted); font-size: 13px; }
.kpi-value { font-size: 32px; font-weight: 700; margin: 6px 0 2px; }
.kpi-sub { color: var(--muted); font-size: 12px; }
.dash-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

.dept-progress .dp-row { margin-bottom: 14px; }
.dash-tabs { display: flex; gap: 8px; margin-bottom: 16px; }
.dash-tab { border: 1px solid var(--line); background: #fff; color: var(--muted); padding: 6px 18px; border-radius: 8px; cursor: pointer; font-size: 14px; }
.dash-tab.active { background: var(--blue); color: #fff; border-color: var(--blue); }
.gantt-row { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px solid #f3f4f6; }
.gantt-title { flex: 1; font-weight: 600; }
.gantt-range { font-size: 12px; color: var(--muted); }
.hour-item { display: flex; justify-content: space-between; padding: 6px 0; border-bottom: 1px solid #f3f4f6; }
.warn-item { display: flex; align-items: center; gap: 8px; padding: 6px 0; }
.warn-dot { width: 8px; height: 8px; border-radius: 50%; }
.warn-dot.red { background: var(--bad); }
.warn-dot.yellow { background: var(--warn); }
.warn-dot.green { background: var(--good); }
.dp-head { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 4px; }
.dp-head span:last-child { color: var(--muted); }

.time-row { margin-bottom: 16px; }
.time-head { display: flex; justify-content: space-between; align-items: center; font-size: 13px; margin-bottom: 4px; }
.time-stack { display: flex; height: 10px; border-radius: 5px; overflow: hidden; }
.seg-deep { background: var(--blue); }
.seg-manage { background: var(--aqua); }
.time-legend { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-top: 4px; }

/* ---------- 复盘 ---------- */
.review-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.auto-box { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 8px; padding: 10px 12px; margin-bottom: 12px; }
.auto-box h4 { margin: 0 0 6px; font-size: 13px; color: var(--muted); }
.auto-item { font-size: 13px; padding: 2px 0; }
.review-item { padding: 12px 0; border-bottom: 1px solid #f3f4f6; }
.rv-head { display: flex; justify-content: space-between; margin-bottom: 6px; }
.rv-time { color: var(--muted); font-size: 12px; }
.rv-content { font-size: 13px; line-height: 1.6; color: #374151; }

/* ---------- 弹窗 ---------- */
.modal-mask {
  position: fixed; inset: 0; background: rgba(0, 0, 0, .4); display: flex;
  align-items: center; justify-content: center; z-index: 100;
}
.modal {
  background: #fff; border-radius: 12px; padding: 24px; width: 560px; max-height: 90vh; overflow: auto;
}
.modal .field textarea { resize: none; min-height: 44px; overflow: hidden; line-height: 1.5; }
.modal h3 { margin: 0 0 16px; }
.btn-row { display: flex; justify-content: flex-end; gap: 10px; margin-top: 16px; }

/* ---------- OKR 总表 ---------- */
.okr-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.okr-period-box { display: flex; align-items: center; gap: 10px; }
.okr-period-box label { font-size: 13px; color: var(--muted); }

#okr-table { display: flex; flex-direction: column; gap: 20px; }
.o-card {
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: var(--shadow); overflow: hidden;
}
.o-head { display: flex; align-items: flex-start; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); background: #1e40af; }
.o-index {
  background: var(--indigo); color: #fff; font-weight: 700; border-radius: 8px;
  padding: 4px 12px; font-size: 15px; white-space: nowrap;
}
.o-body { flex: 1; }
.o-title { font-size: 16px; font-weight: 700; color: #fff; }
.o-note { color: #dbeafe; font-size: 13px; margin-top: 4px; }
.o-weight { font-size: 12px; color: #fff; background: rgba(255,255,255,0.22); padding: 2px 10px; border-radius: 12px; white-space: nowrap; }
.o-hours { font-size: 12px; color: #dbeafe; font-weight: 600; white-space: nowrap; }
.o-progress { font-size: 12px; color: #dbeafe; white-space: nowrap; }
.status-select { padding: 3px 8px; border-radius: 12px; border: 1px solid var(--line); font-size: 12px; cursor: pointer; outline: none; flex-shrink: 0; }
.status-select.status-not_started { background: #9ca3af; color: #fff; border-color: #9ca3af; }
.status-select.status-in_progress { background: #3b82f6; color: #fff; border-color: #3b82f6; }
.status-select.status-done { background: #16a34a; color: #fff; border-color: #16a34a; }
.status-select.status-paused { background: #f59e0b; color: #fff; border-color: #f59e0b; }
.status-select.status-cancelled { background: #ef4444; color: #fff; border-color: #ef4444; }
.status-select option { background: #fff; color: #333; }
.o-actions { display: flex; gap: 2px; }

.kr-list { padding: 8px 20px; }
.kr-block { padding: 12px 0; border-bottom: 1px dashed #eef0f3; }
.kr-block:last-child { border-bottom: none; }
.kr-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 6px 10px; border-radius: 6px; background: #bfdbfe; }
.kr-index { background: var(--blue); color: #fff; border-radius: 6px; padding: 2px 9px; font-size: 12px; font-weight: 600; }
.kr-title { font-weight: 600; }
.kr-metric { font-size: 12px; color: var(--indigo); cursor: pointer; padding: 1px 6px; border-radius: 4px; border: 1px dashed transparent; font-weight: 600; }
.kr-metric:hover { border-color: var(--indigo); background: #f5f3ff; }
.kr-metric input { font-size: 12px; border: 1px solid var(--indigo); border-radius: 4px; padding: 2px 6px; width: 130px; }

/* PDCA 多行 + 月度最新动态 */
.kr-pdca-wrap { display: flex; gap: 12px; margin-top: 10px; align-items: stretch; }
.pdca-main { flex: 1; }
.pdca-table { width: 100%; border-collapse: collapse; }
.pdca-table th, .pdca-table td { padding: 6px 8px; text-align: left; vertical-align: top; }
.pdca-table th { background: #f5f7fa; font-size: 12px; font-weight: 600; border-bottom: 1px solid var(--line); }
.pdca-table td { border-bottom: 1px solid #eef0f3; }
.pdca-table th:first-child, .pdca-table td:first-child { width: 50px; text-align: center; }
.pdca-table th:last-child, .pdca-table td:last-child { width: 28px; text-align: center; }
.pdca-table td.pdca-index { text-align: center; font-weight: 700; color: var(--indigo); font-size: 12px; vertical-align: middle; }
.pdca-table textarea { width: 100%; border: none; background: transparent; padding: 4px 2px; font-size: 13px; outline: none; border-bottom: none; resize: none; line-height: 1.5; overflow: hidden; font-family: inherit; display: block; }
.pdca-del-cell { text-align: center; }

/* PDCA 列颜色区分 */
.pdca-table th.h-index { background: #eef2ff; color: #6366f1; }
.pdca-table th.h-p { background: #eff6ff; color: #3b82f6; }
.pdca-table th.h-d { background: #f0fdfa; color: #0d9488; }
.pdca-table th.h-c { background: #fff7ed; color: #ea580c; }
.pdca-table th.h-a { background: #fef2f2; color: #dc2626; }
.pdca-del { align-self: center; }
.pdca-empty { color: var(--muted); font-size: 12px; padding: 8px 10px; }
.add-pdca-btn { border: 1px dashed var(--line); background: #fff; color: var(--blue); border-radius: 6px; padding: 5px 12px; cursor: pointer; font-size: 12px; margin-top: 6px; }
.add-pdca-btn:hover { border-color: var(--blue); background: #eef2ff; }
.month-latest { width: 170px; flex-shrink: 0; background: #f0fdf4; border: 1px solid #d1fae5; border-radius: 8px; padding: 10px 12px; cursor: pointer; display: flex; flex-direction: column; justify-content: center; }
.month-latest:hover { background: #dcfce7; }
.ml-label { font-size: 11px; color: #15803d; font-weight: 600; margin-bottom: 4px; }
.ml-content { font-size: 12px; color: #166534; line-height: 1.5; }
.kr-weight { font-size: 12px; color: var(--muted); font-weight: 600; }
.kr-actions { margin-left: auto; display: flex; gap: 2px; }
.kr-note { color: var(--muted); font-size: 12px; margin-top: -4px; padding: 0 10px 6px; background: #bfdbfe; border-radius: 0 0 6px 6px; }

.pdca-block { margin-top: 10px; background: #f8fafc; border-radius: 8px; padding: 10px 12px; }
.pdca-row { display: flex; gap: 8px; padding: 3px 0; font-size: 13px; }
.pdca-tag { flex-shrink: 0; font-size: 11px; font-weight: 600; border-radius: 4px; padding: 1px 7px; color: #fff; }
.tag-p { background: var(--blue); }
.tag-d { background: var(--aqua); }
.tag-a { background: var(--warn); }
.pdca-val { color: #374151; }

.kr-foot { display: flex; align-items: center; justify-content: space-between; padding: 10px 20px; background: #fafbfc; border-top: 1px solid var(--line); }
.kr-sum { color: var(--muted); font-size: 12px; }
.weight-warn { color: var(--warn); margin-left: 6px; }
.add-kr-btn { border: 1px dashed var(--line); background: #fff; color: var(--blue); border-radius: 8px; padding: 6px 14px; cursor: pointer; font-size: 13px; }
.add-kr-btn:hover { border-color: var(--blue); background: #eef2ff; }

/* 多行文本换行显示 */
.o-title, .o-note, .kr-title, .kr-note, .pdca-val { white-space: pre-wrap; }

/* 展开/收缩箭头 */
.o-arrow, .kr-arrow { cursor: pointer; font-size: 22px; width: 26px; line-height: 1; user-select: none; flex-shrink: 0; }
.o-arrow { color: #8b5cf6; }
.o-arrow:hover { color: #7c3aed; }
.kr-arrow { color: #f59e0b; }
.kr-arrow:hover { color: #ea580c; }

/* ---------- 月度 PDCA 追踪卡 ---------- */
.mt-card {
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: var(--shadow); overflow: hidden; margin-bottom: 20px;
}
.mt-head { display: flex; align-items: center; gap: 12px; padding: 14px 20px; border-bottom: 1px solid var(--line); background: #1e40af; }
.mt-kr { font-weight: 700; font-size: 15px; color: #fff; }
.mt-metric { font-size: 12px; color: #dbeafe; }
.mt-hours { margin-left: auto; font-size: 12px; color: #dbeafe; font-weight: 600; }
.mt-quarter-ref { padding: 8px 20px; background: #fffbeb; border-bottom: 1px solid #fde68a; font-size: 12px; color: #92400e; line-height: 1.6; }
.mt-table { overflow-x: auto; }
.mt-row { display: grid; grid-template-columns: 0.6fr 1fr 1fr 0.7fr 1.6fr 1.6fr 1.6fr; min-width: 980px; }
.mt-month { text-align: center; font-weight: 600; color: var(--muted); display: flex; align-items: center; justify-content: center; }
.mt-th { background: #f5f7fa; font-size: 12px; color: var(--muted); font-weight: 600; }
.mt-th > div { padding: 10px 12px; border-right: 1px solid var(--line); text-align: center; }
.mt-th > div:last-child { border-right: none; }
.mt-row:not(.mt-th) > div { padding: 8px 10px; border-right: 1px solid var(--line); border-top: 1px solid #f3f4f6; }
.mt-row:not(.mt-th) > div:last-child { border-right: none; }
.mt-row input, .mt-row textarea {
  width: 100%; border: none; background: transparent; padding: 4px 2px; font-size: 13px;
  outline: none; border-bottom: 1px dashed transparent; resize: none; line-height: 1.5;
  overflow: hidden; font-family: inherit;
}
.mt-row input:focus, .mt-row textarea:focus { border-bottom-color: var(--blue); }
.mt-dash { color: #cbd5e1; display: flex; align-items: center; justify-content: center; }
.mt-num { text-align: center; font-variant-numeric: tabular-nums; font-weight: 600; color: var(--text); }

/* 下月计划格子的备注附件 */
.mt-nextplan { display: flex; align-items: flex-start; gap: 4px; }
.mt-nextplan textarea { flex: 1; }
.mt-attach-btn {
  border: none; background: transparent; cursor: pointer; font-size: 16px;
  padding: 2px 4px; border-radius: 6px; flex-shrink: 0;
}
.mt-attach-btn:hover { background: #eef2ff; }
.att-list { margin-bottom: 12px; max-height: 240px; overflow-y: auto; }
.att-item { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px dashed #eef0f3; }
.att-img { max-width: 120px; max-height: 80px; border-radius: 6px; cursor: pointer; border: 1px solid var(--line); }
.att-link { font-size: 13px; flex: 1; }
.att-link a { color: var(--blue); text-decoration: none; }
.att-link a:hover { text-decoration: underline; }
.att-link-row { display: flex; gap: 8px; }
.att-link-row select { width: 110px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; }
.att-link-row input { flex: 1; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; }
.att-link-row .btn { white-space: nowrap; }

/* ---------- 周度执行仪表盘 ---------- */
.wk-table { background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); overflow: hidden; }
.wk-row { display: grid; grid-template-columns: 1.2fr 1.1fr 0.7fr 0.7fr 0.5fr 1.2fr 0.5fr 0.5fr 0.7fr 28px; min-width: 1050px; }
.wk-th { background: #f5f7fa; font-size: 12px; color: var(--muted); font-weight: 600; align-items: center; }
.wk-th > div { padding: 10px 12px; border-right: 1px solid var(--line); text-align: center; }
.wk-th > div:last-child { border-right: none; }
.wk-row:not(.wk-th) > div { padding: 8px 10px; border-right: 1px solid var(--line); border-top: 1px solid #f3f4f6; }
.wk-row:not(.wk-th) > div:last-child { border-right: none; }
.wk-week { text-align: center; font-size: 12px; }
.wk-range { color: var(--muted); font-size: 11px; }
.wk-row textarea, .wk-row input { width: 100%; border: none; background: transparent; padding: 4px 2px; font-size: 13px; outline: none; border-bottom: 1px dashed transparent; resize: none; line-height: 1.5; overflow: hidden; font-family: inherit; }
.wk-row textarea:focus, .wk-row input:focus { border-bottom-color: var(--blue); }
.wk-num { text-align: center; font-variant-numeric: tabular-nums; }
.wk-kr { width: 100%; border: none; background: transparent; font-size: 13px; padding: 4px 2px; outline: none; font-family: inherit; }
.wk-dev { text-align: center; font-size: 13px; height: 100%; display: flex; align-items: flex-start; justify-content: center; }
.wk-status { text-align: center; font-size: 20px; cursor: pointer; display: flex; align-items: center; justify-content: center; user-select: none; }
.wk-status:hover { background: #f0fdf4; }
.wk-block { margin-bottom: 4px; }
.wk-block-head { display: flex; align-items: center; justify-content: space-between; padding: 8px 12px; background: #bfdbfe; border-bottom: 1px solid var(--line); }
.wk-block-head .wk-week { color: #1e3a8a; }
.wk-block-head .wk-range { color: #1e40af; }
.add-wk-task { display: inline-block; border: 1px dashed var(--line); background: #fff; color: var(--blue); border-radius: 8px; padding: 6px 14px; cursor: pointer; font-size: 13px; margin-top: 6px; }
.add-wk-task:hover { border-color: var(--blue); background: #eef2ff; }
.wk-empty { color: var(--muted); font-size: 12px; padding: 10px 12px; }
.wk-del { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; }
.wk-status-select { width: 100%; padding: 4px 6px; border: 1px solid var(--line); border-radius: 8px; font-size: 13px; cursor: pointer; outline: none; background: #fff; font-family: inherit; }

/* 周度表头彩色标题标签 */
.wk-th .h-task, .wk-th .h-kr, .wk-th .h-exp, .wk-th .h-act, .wk-th .h-dev, .wk-th .h-adj, .wk-th .h-plan, .wk-th .h-hour, .wk-th .h-status {
  display: inline-block; padding: 14px 12px; border-radius: 4px; color: #fff; font-size: 15px; font-weight: 600;
}
.wk-th .h-task { background: #8b5cf6; }
.wk-th .h-kr { background: #3b82f6; }
.wk-th .h-exp { background: #14b8a6; }
.wk-th .h-act { background: #f59e0b; }
.wk-th .h-dev { background: #ef4444; }
.wk-th .h-adj { background: #6366f1; }
.wk-th .h-hour { background: #0ea5e9; }
.wk-th .h-plan { background: #06b6d4; }
.wk-th .h-status { background: #10b981; }
.mt-rate { text-align: center; font-weight: 700; font-size: 14px; color: var(--blue); display: flex; align-items: center; justify-content: center; }

@media (max-width: 900px) {
  .goals-page { grid-template-columns: 1fr; }
  .time-menu { position: static; }
  .kpi-row { grid-template-columns: repeat(2, 1fr); }
  .dash-grid, .review-layout { grid-template-columns: 1fr; }
}

/* ---------- 权限管理 ---------- */
.tip { background: #fffbeb; border: 1px solid #fde68a; border-radius: 8px; padding: 10px 14px; font-size: 12px; color: #92400e; margin-bottom: 16px; }
.tip b { font-weight: 700; }
.u-table { width: 100%; border-collapse: collapse; }
.u-table th { background: #f5f7fa; font-size: 12px; font-weight: 600; color: var(--muted); text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.u-table td { padding: 12px 14px; border-bottom: 1px solid #eef0f3; font-size: 13px; vertical-align: top; }
.u-table tr:last-child td { border-bottom: none; }
.u-account { color: var(--muted); font-size: 12px; }
.u-actions { display: flex; gap: 4px; flex-wrap: wrap; }
.badge { font-size: 11px; padding: 2px 9px; border-radius: 12px; white-space: nowrap; font-weight: 600; }
.badge-admin { background: #eef2ff; color: #4f46e5; }
.badge-user { background: #f0fdf4; color: #15803d; }
.badge-off { background: #f3f4f6; color: #9ca3af; }
.perm-tags { display: flex; flex-wrap: wrap; gap: 5px; max-width: 460px; }
.perm-tag { font-size: 12px; padding: 2px 9px; border-radius: 12px; white-space: nowrap; }
.perm-edit { background: #eef2ff; color: #4f46e5; border: 1px solid #c7d2fe; }
.perm-view { background: #f8fafc; color: #64748b; border: 1px solid #e2e8f0; }
.perm-all { background: #fef3c7; color: #92400e; border: 1px solid #fde68a; font-weight: 600; }
.legend { font-size: 12px; color: var(--muted); margin-top: 8px; }
.perm-table { width: 100%; border-collapse: collapse; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; margin-top: 4px; }
.perm-table th { background: #f5f7fa; font-size: 12px; font-weight: 600; color: var(--muted); text-align: center; padding: 8px; border-bottom: 1px solid var(--line); }
.perm-table td { padding: 7px 10px; border-bottom: 1px solid #f0f2f5; font-size: 13px; text-align: center; }
.perm-table td.dept { text-align: left; font-weight: 500; }
.perm-table tr:last-child td { border-bottom: none; }
.perm-table input[type="checkbox"] { width: 16px; height: 16px; cursor: pointer; accent-color: var(--blue); }

/* ---------- K目标行动计划 ---------- */
.kplan-filter { display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 12px 14px; margin-bottom: 16px; box-shadow: var(--shadow); }
.kplan-filter label { color: var(--muted); font-size: 13px; }
.kplan-spacer { flex: 1; }

.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.k-grid3 { display: grid; grid-template-columns: 1fr 1fr 2fr; gap: 12px; margin-bottom: 12px; }
.k-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 4px; }
.k-val { background: #f9fafb; border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; min-height: 34px; white-space: pre-wrap; }
.k-val.hl { background: #eef2ff; border-color: #c7d2fe; font-weight: 600; }
/* K目标字段：标签在左、框在右（水平排，多行时标签顶部对齐） */
.k-grid3 .field, .k-grid2 .field { display: flex; align-items: flex-start; gap: 8px; margin-bottom: 0; }
.k-grid3 .field > label, .k-grid2 .field > label { margin: 5px 0 0; white-space: nowrap; flex-shrink: 0; font-size: 13px; color: var(--muted); }
.k-field-in { flex: 1 1 0; width: auto; min-width: 0; border: 1px solid transparent; background: #f9fafb; border-radius: 8px; padding: 6px 10px; font-size: 13px; line-height: 1.5; resize: none; overflow: hidden; outline: none; font-family: inherit; display: block; }
.k-field-in:hover { border-color: #e5e7eb; }
.k-field-in:focus { border-color: var(--blue); background: #fff; }
.k-field-in.hl { background: #eef2ff; border-color: #c7d2fe; }
.k-field-in.tall { min-height: 92px; }
.k-grid3 .k-val, .k-grid2 .k-val { flex: 1 1 0; width: auto; min-width: 0; }
/* 头部目标描述就地编辑 */
.k-title-input { flex: 1; border: 1px solid transparent; background: transparent; color: #fff; font-size: 15px; font-weight: 600; padding: 4px 6px; border-radius: 6px; resize: none; overflow: hidden; outline: none; font-family: inherit; line-height: 1.4; min-width: 0; }
.k-title-input::placeholder { color: #dbeafe; }
.k-title-input:hover { border-color: rgba(255,255,255,.4); background: rgba(255,255,255,.08); }
.k-title-input:focus { border-color: #fff; background: rgba(255,255,255,.14); }

.k-card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; margin-bottom: 16px; box-shadow: var(--shadow); overflow: hidden; }
.k-head { display: flex; align-items: center; gap: 10px; padding: 14px 20px; border-bottom: 1px solid var(--line); background: #1e40af; }
.k-tag { background: var(--indigo); color: #fff; font-weight: 700; padding: 3px 12px; border-radius: 20px; font-size: 14px; white-space: nowrap; }
.k-title { font-weight: 600; font-size: 15px; flex: 1; color: #fff; }
.k-ops { display: flex; gap: 2px; white-space: nowrap; }
.k-head .icon-btn { color: #dbeafe; }
.k-head .icon-btn:hover { background: rgba(255,255,255,.15); color: #fff; }
.k-head .icon-btn.danger:hover { background: rgba(255,255,255,.2); color: #fff; }
.k-body { padding: 16px 20px; }

.k-action-block { margin-top: 16px; }
.k-action-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.k-action-head h4 { margin: 0; font-size: 14px; }
.k-hint { color: var(--muted); font-size: 12px; }

.kplan-table { width: 100%; border-collapse: collapse; }
.kplan-table th { text-align: center; color: var(--text); font-weight: 700; font-size: 12px;
  padding: 8px; border-bottom: 1px solid var(--line); white-space: nowrap; background: #dbeafe; }
.kplan-table td { padding: 6px 8px; border-bottom: 1px solid #f0f1f3; vertical-align: top; }
.kplan-table tr:last-child td { border-bottom: none; }
.k-lvl { display: inline-block; font-size: 11px; padding: 2px 9px; border-radius: 12px; margin-bottom: 4px;
  font-weight: 600; white-space: nowrap; color: #fff; }
.k-lvl.action { background: var(--indigo); }
.k-lvl.step { background: var(--blue); }
.k-lvl.substep { background: var(--aqua); }
.kplan-table tr.k-row-action td { background: #eff6ff; }
.kplan-table tr.k-row-step td { background: #eef2ff; }
.kplan-table tr.k-row-substep td { background: #e0f2f1; }
.k-ind1 .k-cell-title { padding-left: 24px; }
.k-ind2 .k-cell-title { padding-left: 44px; }
.k-cell { width: 100%; border: 1px solid #e5e7eb; background: #fff; padding: 4px 6px;
  font-size: 13px; outline: none; resize: none; line-height: 1.5; overflow: hidden;
  font-family: inherit; display: block; border-radius: 6px; color: var(--text); }
.k-cell:hover { border-color: #e5e7eb; }
.k-cell:focus { border-color: var(--blue); background: #f0f7ff; }
.k-cell-text { display: block; padding: 4px 6px; font-size: 13px; line-height: 1.5; white-space: pre-wrap; word-break: break-word; }
.k-ops .icon-btn { white-space: nowrap; }
.k-date { width: 100%; padding: 4px 6px; border: 1px solid #e5e7eb; border-radius: 6px; font-size: 13px;
  background: #fff; font-family: inherit; color: #333; outline: none; }
.k-date:focus { border-color: var(--blue); background: #f0f7ff; }
.k-completion { width: 100%; padding: 4px 6px; border: 1px solid #e5e7eb; border-radius: 6px; font-size: 13px;
  background: #fff; font-family: inherit; cursor: pointer; outline: none; }
.k-completion:focus { border-color: var(--blue); background: #f0f7ff; }
.k-attach-cell { display: flex; align-items: flex-start; gap: 4px; }
.k-attach-cell .k-cell { flex: 1; }
.k-attach-btn { flex-shrink: 0; font-size: 14px; }
