/* ═══ PM-Core · Soft Sage Theme ═══ */
:root {
  /* CSS 鐵則：顏色/圓角/z-index/陰影一律走 :root 變數，禁止在規則裡直接寫 hex/數字。
     要用色從下方變數挑；缺的先在此新增變數再用。違反會造成跨 session 改動衝突。
     合理例外：rgba 透明衍生（變數無法帶 alpha）、膠囊 99px / 圓點 50% 慣用語。 */
  --sage-50: #F0F4ED; --sage-100: #DCE6D2; --sage-200: #B8CCA5;
  --sage-300: #93B17A; --sage-400: #6F8E5C; --sage-500: #4A7C5C;
  --sage-600: #3A6B4E; --sage-700: #2D4A3A; --sage-800: #1E3326;

  --paper: #FAFAF8; --cream: #F5F2EC;
  --stone-50: #F5F1E8; --stone-100: #E8E4D8; --stone-200: #D6D1C2;
  --stone-300: #B5B0A0; --stone-400: #7E796D; --stone-500: #5A5346;
  --stone-600: #3A332A; --stone-900: #1A1612;
  --gray-mid: #9CA3AF;   /* 中性冷灰：甘特 manual 錨點底 */
  --sidebar-ink2: #7FA08C;      /* sidebar 次要字 */
  --sidebar-rule: rgba(255,255,255,.1);   /* 深底分隔線/邊框/虛線框 */
  --sidebar-card: rgba(255,255,255,.08);  /* 深底半透明卡 */
  --kpi-task-l: #EDF1E8;        /* KPI TASKS 淺底 */
  --kpi-done-l: #E1F0E4;        /* KPI DONE 淺底 */
  --kpi-wip-l: #E8EFF5;         /* KPI IN-PROGRESS 淺底 */
  --kpi-delayed-l: #FBE9E0;     /* KPI DELAYED 淺底 */
  --kpi-overall-l: #E8EDE0;   /* OVERALL 淺 sage 底 */
  --kpi-days-l: #FAEEDA;      /* WORKDAYS LEFT 淺琥珀底 */
  --head-band: #E8EDE0;         /* 待辦表頭橫槓底 */
  --head-band-strong: var(--sage-700);  /* 待辦任務表頭:深 sage 反白底 */

  --terracotta: #C4633E; --terracotta-l: #FAE8DC;
  --amber: #C4956C; --amber-l: #F5E8DC;
  --slate: #5C7A8B; --slate-l: #DDE6EC;
  --plum: #8B5E73; --plum-l: #EDDFE5;
  --rose: #B8504D; --rose-l: #F5DEDD; --rose-ink: #7A2E2C;   /* rose-l 淺底上的深字（與 -l 成對） */
  --amber-ink: #6B4423; --slate-ink: #2E3F4D;   /* -l 淺底上的深字(與 -l 成對) */
  /* 待辦篩選膠囊選中底（中淺階，比各色 -l 深一階）*/
  --sage-chip: #C7DDB8; --slate-chip: #BBCEDB; --terracotta-chip: #EBC79E; --rose-chip: #EBBBBA;

  /* 行事曆事件語意色族(漸層 from/to、邊框、字;-ink 為其上深字) */
  --navy: #4A6B85; --navy-from: #DCE7EF; --navy-to: #C8D8E4; --navy-ink: #1F3848;   /* 會議 meeting/auto-meeting */
  --khaki: #BA7517; --khaki-bg: #FAEEDA; --khaki-ink: #854F0B;                       /* 午休 lunch-band */
  --clay: #8B7355; --clay-from: #E8E1D4; --clay-to: #D4C9B5; --clay-ink: #4A3B2B;    /* 清潔 cleaning */
  --terracotta-d: #A85230; --terracotta-ink: #8B3A1D; --terracotta-l-hover: #F5DDC8; /* terracotta hover深色 / -l底深字 / -l hover */
  --amber-border: #E8C794;                                                           /* report-next amber 邊框 */

  --memo-y: #FFF4B8; --memo-p: #FFD9E0; --memo-b: #C8E4F0;
  --memo-g: #D9EBC8; --memo-o: #FFD8B5;

  --bg: var(--paper); --surface: #FFFFFF; --surface2: var(--cream);
  --rule: #E8E4D8; --rule2: #D6D1C2;
  --ink: var(--stone-900); --ink2: var(--stone-600); --ink3: var(--stone-500); --ink4: var(--stone-400);
  --ink-inverse: #FFFFFF;   /* 彩色底上的反白前景字(深色主題時仍須為白,勿與 --surface 混用) */

  --sans: 'Inter', 'Noto Sans TC', system-ui, sans-serif;
  --mono: 'JetBrains Mono', monospace;
  --hand: 'Caveat', 'Noto Sans TC', cursive;

  --r4:4px; --r6:6px; --r8:8px; --r10:10px; --r12:12px; --r16:16px;
  --shadow-sm: 0 1px 2px rgba(58,51,42,.04);
  --shadow: 0 1px 3px rgba(58,51,42,.06), 0 4px 12px rgba(58,51,42,.04);
  --shadow-lg: 0 8px 24px rgba(58,51,42,.10);

  /* 全域層級階梯(元件內部相對疊序不在此列,維持就地寫死) */
  --z-sticky: 10; --z-dropdown: 50; --z-modal: 500;
  --z-tooltip: 550; --z-toast: 600; --z-overlay: 1000;   /* tooltip 蓋 modal、不蓋 toast */
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { background: var(--bg); color: var(--ink); font-family: var(--sans); font-size: 14px; min-height: 100vh; }
button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
button { cursor: pointer; }

/* ─── LOGIN ─── */
.login-overlay {
  position: fixed; inset: 0;
  background: linear-gradient(160deg, var(--sage-700) 0%, var(--sage-800) 100%);
  z-index: var(--z-overlay); display: flex; align-items: center; justify-content: center;
  opacity: 1; transition: opacity .4s;
}
.login-overlay.hidden { opacity: 0; pointer-events: none; }
.login-box {
  background: var(--paper); border-radius: var(--r16); padding: 42px;
  width: 380px; box-shadow: var(--shadow-lg); text-align: center;
  position: relative; overflow: hidden;
}
.login-box::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--sage-500), var(--amber), var(--terracotta));
}
.login-logo {
  font-family: var(--sans); font-weight: 600; font-size: 24px;
  color: var(--sage-700); margin-bottom: 4px; letter-spacing: -.01em;
}
.login-sub {
  font-family: var(--mono); font-size: 11px; color: var(--ink3);
  letter-spacing: .08em; margin-bottom: 28px;
}
.login-form { display: flex; flex-direction: column; gap: 10px; }
.login-form input {
  padding: 12px 14px; border: 1px solid var(--rule); border-radius: var(--r8);
  background: var(--surface); outline: none; transition: border-color .2s;
}
.login-form input:focus { border-color: var(--sage-500); box-shadow: 0 0 0 3px rgba(74,124,92,.1); }
.login-form button {
  padding: 12px; background: var(--sage-500); color: var(--ink-inverse); border: none;
  border-radius: var(--r8); font-weight: 500; transition: background .2s;
}
.login-form button:hover { background: var(--sage-600); }
.login-hint { font-size: 11px; color: var(--ink3); margin-top: 18px; line-height: 1.6; }
.login-hint code { background: var(--surface2); padding: 1px 6px; border-radius: var(--r4); font-family: var(--mono); }
.login-view-only {
  margin-top: 10px; padding: 8px; background: var(--surface2);
  border-radius: var(--r8); font-size: 11px; color: var(--ink3); border: none; width: 100%;
}
.login-view-only:hover { background: var(--stone-100); }

.login-google-hint { font-size: 12px; color: var(--ink3); margin-bottom: 12px; }
.login-divider {
  text-align: center; margin: 14px 0 12px; position: relative;
  color: var(--ink4); font-size: 11px;
}
.login-divider::before, .login-divider::after {
  content: ""; position: absolute; top: 50%; width: 38%; height: 1px; background: var(--rule);
}
.login-divider::before { left: 0; }
.login-divider::after { right: 0; }
.login-divider span { background: var(--paper); padding: 0 8px; position: relative; z-index: 1; }

.login-error {
  margin-top: 12px; padding: 10px 12px; background: var(--terracotta-l);
  border-left: 3px solid var(--terracotta); border-radius: var(--r6);
  font-size: 12px; color: var(--terracotta-ink); line-height: 1.5; text-align: left;
}

/* ─── APP SHELL ─── */
.app { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }

.sidebar {
  background: var(--sage-800); color: var(--sage-100);
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column; overflow-y: auto;
  border-right: 1px solid var(--sidebar-rule);
}
.sb-brand { padding: 22px 18px 16px; }
.sb-brand-mark {
  font-family: var(--sans); font-weight: 600; font-size: 18px;
  color: var(--sage-100); line-height: 1; margin-bottom: 4px; letter-spacing: -.01em;
}
.sb-brand-sub { font-family: var(--mono); font-size: 10px; color: var(--sidebar-ink2); letter-spacing: .04em; }
.sb-user-badge {
  margin-top: 16px; display: flex; align-items: center; gap: 9px;
  padding: 8px 10px; background: var(--sidebar-card); border-radius: var(--r8);
  font-size: 12px; box-shadow: var(--shadow-sm);
}
.sb-user-avatar {
  width: 26px; height: 26px; border-radius: 50%;
  background: linear-gradient(135deg, var(--sage-500), var(--sage-300));
  color: var(--ink-inverse); display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 500;
}
.sb-user-mode {
  font-family: var(--mono); font-size: 9px; color: var(--sidebar-ink2);
  text-transform: uppercase; letter-spacing: .1em; margin-top: 1px;
}

.sb-section { padding: 14px 8px 0; }
.sb-label {
  font-family: var(--mono); font-size: 9px; letter-spacing: .14em;
  color: var(--sidebar-ink2); text-transform: uppercase;
  padding: 0 10px; margin-bottom: 6px;
}
.sb-nav, .sb-proj-list { display: flex; flex-direction: column; gap: 1px; }
.sb-item {
  display: flex; align-items: center; gap: 10px; padding: 8px 12px;
  border: none; background: none; color: var(--sage-100);
  border-radius: var(--r8); text-align: left; font-size: 13px;
  transition: all .15s; width: 100%;
}
.sb-item:hover { background: rgba(255,255,255,.06); color: var(--sage-100); }
.sb-item.active { background: var(--sage-600); color: var(--sage-100); font-weight: 500; box-shadow: var(--shadow-sm); }
.sb-item .ico { width: 16px; opacity: .65; }
.sb-item.active .ico { opacity: 1; color: var(--sage-100); }

.sb-proj {
  display: flex; align-items: center; gap: 10px; padding: 7px 12px;
  border: none; background: none; color: var(--sage-100);
  border-radius: var(--r8); text-align: left; font-size: 12.5px;
  transition: all .15s; width: 100%; cursor: pointer;
}
.sb-proj:hover { background: rgba(255,255,255,.06); color: var(--sage-100); }
.sb-proj.active { background: var(--sage-600); color: var(--sage-100); font-weight: 500; box-shadow: var(--shadow-sm); }
.sb-proj .dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.sb-proj .count { margin-left: auto; font-family: var(--mono); font-size: 10px; color: var(--sidebar-ink2); }
.sb-proj .sync-ico { font-size: 10px; color: var(--sage-500); }

.sb-add-proj {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 12px; margin: 4px 8px 0;
  border: 1px dashed var(--sidebar-rule); background: none;
  color: var(--sage-100); border-radius: var(--r8);
  text-align: left; font-size: 12px; transition: all .15s;
  width: calc(100% - 16px); font-weight: 500;
}
.sb-add-proj:hover { border-color: var(--sage-500); color: var(--sage-100); background: rgba(255,255,255,.06); }

.sb-bottom { margin-top: auto; padding: 12px 8px 14px; border-top: 1px solid var(--sidebar-rule); }
.sb-foot { font-family: var(--mono); font-size: 9px; color: var(--sidebar-ink2); text-align: center; padding: 8px 0; letter-spacing: .08em; }
.sb-sync-info {
  font-family: var(--mono); font-size: 10px; color: var(--sidebar-ink2);
  padding: 8px 10px; background: var(--sidebar-card); border-radius: var(--r6);
  margin: 0 4px 6px; display: flex; align-items: center; gap: 8px;
}
.sb-sync-info .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--sage-500); box-shadow: 0 0 0 3px rgba(74,124,92,.2); flex-shrink: 0; }
.sb-sync-info .sync-time { font-size: 9px; opacity: .7; margin-top: 1px; }

/* ─── MAIN ─── */
.main { display: flex; flex-direction: column; min-height: 100vh; }

.topbar {
  padding: 18px 28px;
  display: flex; align-items: center; gap: 14px;
  border-bottom: 1px solid var(--rule);
  background: var(--bg);
  position: sticky; top: 0; z-index: var(--z-sticky);
}
.topbar.topbar-hidden { display: none; }
.tb-crumb { font-family: var(--mono); font-size: 11px; color: var(--ink3); letter-spacing: .04em; }
.tb-crumb b { color: var(--ink2); font-weight: 500; }
.tb-title { font-family: var(--sans); font-weight: 600; font-size: 22px; letter-spacing: -.01em; margin-top: 2px; }
.tb-spacer { flex: 1; }
.tb-meta-info { font-size: 11px; color: var(--ink3); font-family: var(--mono); }

.tb-action {
  padding: 7px 14px; background: var(--sage-500); color: var(--ink-inverse); border: none;
  border-radius: var(--r8); font-size: 13px; transition: all .15s;
  display: inline-flex; align-items: center; gap: 6px; font-weight: 500;
}
.tb-action:hover { background: var(--sage-600); }
.tb-action.ghost { background: transparent; color: var(--ink2); border: 1px solid var(--rule); }
.tb-action.ghost:hover { background: var(--surface2); }
.tb-action.danger { background: var(--terracotta); }
.tb-action.danger:hover { background: var(--terracotta-d); }
.tb-action:disabled,
.tb-action:disabled:hover {
  background: var(--stone-200);
  color: var(--stone-400);
  cursor: not-allowed;
}

.tabs { display: inline-flex; padding: 4px; background: var(--surface2); border-radius: var(--r10); gap: 2px; }
.tab-btn { padding: 9px 20px; border: none; background: none; border-radius: var(--r8); font-size: 14px; color: var(--ink3); transition: all .15s; font-weight: 500; cursor: pointer; }
.tab-btn.active { background: var(--sage-500); color: var(--ink-inverse); }
.tab-btn:hover:not(.active) { color: var(--ink2); }
/* 設定頁子分頁：CSS display 切換（4 個 panel 全留 DOM，避免 saveSettings 跨 tab 讀不到元素而 crash） */
.tab-panel { display: none; }
.tab-panel.active { display: block; }
.view-tabs-bar { display: flex; justify-content: flex-end; margin-bottom: var(--r12); }

.content { padding: 22px 24px 60px; flex: 1; }
.page { display: none; animation: fadeIn .2s ease both; }
.page.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(2px); } to { opacity: 1; transform: translateY(0); } }

.viewonly-banner {
  background: var(--amber-l); border-left: 3px solid var(--amber);
  padding: 10px 14px; margin-bottom: 14px; border-radius: 0 var(--r8) var(--r8) 0;
  font-size: 12px; color: var(--amber-ink); display: none; align-items: center; gap: 8px;
}
body.viewonly .viewonly-banner { display: flex; }
body.viewonly [data-edit] { opacity: .35; pointer-events: none; }
body.viewonly .cloud-sync-sec { display: none; }
body.viewonly .editpw-sec { display: none; }   /* 變更編輯密碼：解鎖後才顯示（同 cloud-sync-sec 機制） */

/* ─── STATS ─── */
.stats-row {
  display: flex; align-items: stretch;
  background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r12);
  overflow: hidden; margin-bottom: 14px;
}
.stat {
  flex: 1; display: flex; align-items: baseline; gap: 6px;
  padding: 8px 14px; position: relative;
  border-right: 1px solid var(--rule);
}
.stat:last-child { border-right: none; }
.stat.stat-urgent { cursor: pointer; transition: background .15s; }
.stat.stat-urgent:hover { background: var(--surface2); }
.stat-num { font-family: var(--sans); font-weight: 600; font-size: 20px; line-height: 1.2; color: var(--ink); letter-spacing: -.02em; }
.stat.stat-urgent .stat-num { color: var(--terracotta); }
.stat-label { font-family: var(--mono); font-size: 12px; color: var(--ink3); }

/* ─── 專案 KPI 卡片排(專案頁頂部,沿用 .stats-row/.stat)─── */
.proj-kpi .stat { cursor: help; }                                              /* 有 data-tip tooltip 的提示 */
.proj-kpi .stat-pct { font-family: var(--mono); font-size: 11px; color: var(--ink3); }  /* 副標:%/降級數字常駐 */
.proj-kpi .stat.kpi-warn .stat-num { color: var(--terracotta); }               /* 延遲>0 / 已逾期 警示色 */
.proj-kpi .stat.kpi-stack { flex-wrap: wrap; }                                 /* stack 模式:副標換獨立第二行 */
.proj-kpi .stat-sub { flex-basis: 100%; font-family: var(--mono); font-size: 11px; color: var(--ink3); margin-top: 1px; }

/* ─── M2 視覺對齊:KPI 改獨立小卡(PM-Core 卡片語言 surface/rule/r10/shadow-sm;只 override .proj-kpi 作用域,不動通用 .stats-row/.stat) ─── */
.stats-row.proj-kpi { background: none; border: none; overflow: visible; gap: 10px; }   /* 長條容器→透明,卡距用 gap */
.proj-kpi .stat {
  background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r10);
  box-shadow: var(--shadow-sm);
  padding: 12px 14px;
  flex-direction: column; align-items: flex-start; gap: 2px;   /* 直排:標題上、大數字、說明下 */
  border-left: 3px solid var(--rule);                          /* 左彩條:預設中性,warn 覆蓋 */
}
.proj-kpi .stat.kpi-warn { border-left-color: var(--terracotta); }
.proj-kpi .stat.kpi-tone-task    { background: var(--kpi-task-l); }
.proj-kpi .stat.kpi-tone-done    { background: var(--kpi-done-l); }
.proj-kpi .stat.kpi-tone-wip     { background: var(--kpi-wip-l); }
.proj-kpi .stat.kpi-tone-delayed { background: var(--kpi-delayed-l); }
.proj-kpi .stat.kpi-tone-overall { background: var(--kpi-overall-l); }
.proj-kpi .stat.kpi-tone-days    { background: var(--kpi-days-l); }
/* DOM 序是 num→label→sub,用 order 反轉成 label→num→sub,不動 app.js */
.proj-kpi .stat-label { order: 1; }
.proj-kpi .stat-num { order: 2; }
.proj-kpi .stat-sub { order: 3; flex-basis: auto; }

/* ─── 專案階段進度卡(專案頁,圖1 第二塊)─── */
.proj-stages-card { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r12); padding: 14px 16px; margin-bottom: 14px; }
.proj-stages-head { font-size: 15px; font-weight: 600; color: var(--ink); margin-bottom: 12px; }
.proj-stages-count { font-family: var(--mono); font-size: 12px; color: var(--ink4); margin-left: 6px; }

/* 分組膠囊標題 + 分隔線 */
.stage-group-cap { display: flex; align-items: center; gap: 8px; margin: 14px 0 4px; }
.stage-group-cap:first-of-type { margin-top: 2px; }
.stage-cap-pill { font-size: 12.5px; font-weight: 500; padding: 3px 12px; border-radius: 99px; }
.stage-cap-pill.cap-0 { color: var(--sage-700); background: var(--sage-50); border: 1px solid var(--sage-100); }
.stage-cap-pill.cap-1 { color: var(--khaki-ink); background: var(--khaki-bg); border: 1px solid var(--khaki); }
.stage-cap-pill.cap-2 { color: var(--clay-ink); background: var(--clay-from); border: 1px solid var(--clay); }
.stage-pick-row { display: flex; flex-wrap: wrap; gap: 6px; }
.stage-pick { font-size: 12.5px; font-weight: 500; padding: 4px 12px; border-radius: 99px; cursor: pointer; border: 1px dashed var(--rule2); background: var(--surface2); color: var(--ink3); transition: background .12s, color .12s, border-color .12s; }
.stage-pick:hover { border-color: var(--ink4); }
.stage-pick.on { background: var(--sage-50); color: var(--sage-700); border: 1px solid var(--sage-100); }
.stage-cap-rule { flex: 1; height: 0; border-top: 1px solid var(--rule); }

/* 表頭小字 */
.stage-colhead { display: flex; align-items: center; gap: 10px; padding: 2px 0 4px; }
.stage-bar-spacer { flex: 1; }
.stage-pct-h { width: 46px; text-align: right; font-size: 10.5px; color: var(--ink4); }
.stage-cnt-h { width: 64px; text-align: right; font-size: 10.5px; color: var(--ink4); }

/* 資料列（兩行高：階段名 + 日期） */
.stage-row { display: flex; align-items: center; gap: 10px; padding: 7px 0; cursor: help; border-top: 1px solid var(--surface2); }
.stage-name { width: 150px; flex-shrink: 0; }
.stage-name-txt { font-size: 13.5px; color: var(--ink2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stage-date { font-family: var(--mono); font-size: 11px; color: var(--ink3); margin-top: 2px; }
.stage-date-lbl { color: var(--ink4); margin-right: 3px; }
.stage-date-empty { color: var(--ink4); }
.stage-bar { flex: 1; height: 9px; background: var(--surface2); border-radius: 99px; overflow: hidden; }
.stage-bar-fill { height: 100%; border-radius: 99px; }
.stage-bar-fill.s100 { background: var(--sage-500); }
.stage-bar-fill.s50  { background: var(--slate); }
.stage-bar-fill.s1   { background: var(--amber); }
.stage-bar-fill.s0   { background: var(--rule2); }
.stage-pct { width: 46px; text-align: right; font-family: var(--mono); font-size: 14px; font-weight: 600; color: var(--ink2); }
.stage-pct.s0 { color: var(--ink4); }
.stage-cnt { width: 64px; text-align: right; font-family: var(--mono); font-size: 12.5px; color: var(--ink3); }
.proj-stages-empty { font-size: 12px; color: var(--ink3); padding: 6px 0; }
.proj-stages-formula { font-size: 11px; color: var(--ink3); margin-top: 12px; padding-top: 8px; border-top: 1px solid var(--rule); line-height: 1.4; }

/* ─── 專案部門負荷卡(專案頁,圖1 第三塊;卡框/標題/公式複用 .proj-stages-*)─── */
.dept-row { display: flex; align-items: center; gap: 10px; padding: 5px 0; cursor: help; }
.dept-name { width: 150px; flex-shrink: 0; font-size: 13.5px; color: var(--ink2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dept-bar { flex: 1; height: 14px; background: var(--surface2); border-radius: var(--r6); overflow: hidden; display: flex; }
.dept-seg { height: 100%; }
/* 色票共選擇器:堆疊條段與標題列圖例同源,改色只改一處 */
.dept-seg.done,    .dept-legend-dot.done    { background: var(--sage-500); }    /* 完成:綠 */
.dept-seg.delayed, .dept-legend-dot.delayed { background: var(--terracotta); }  /* 延遲:紅 */
.dept-seg.wip,     .dept-legend-dot.wip     { background: var(--slate); }       /* 進行中:藍灰 */
.dept-seg.todo,    .dept-legend-dot.todo    { background: var(--rule2); }       /* 待辦(未開始+擱置):灰 */
.dept-cnt { width: 48px; text-align: right; font-family: var(--mono); font-size: 12.5px; color: var(--ink3); }
.dept-head { display: flex; align-items: center; justify-content: space-between; }  /* 只掛在部門負荷標題列,不污染共用 .proj-stages-head */
.dept-legend { display: flex; align-items: center; gap: 10px; }
.dept-legend-item { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--ink3); font-weight: 400; }
.dept-legend-dot { width: 11px; height: 11px; border-radius: 2px; flex-shrink: 0; }

/* 部門卡逾期迷你清單(buildProjDeptHtml overdueHtml) */
.dept-overdue { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--rule); }
.dept-overdue-head { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; }
.dept-overdue-title { font-size: 13px; font-weight: 600; color: var(--ink); }
.dept-overdue-count { font-family: var(--mono); font-size: 11px; color: var(--surface); background: var(--terracotta); padding: 1px 7px; border-radius: 99px; }
.dept-overdue-row { display: flex; align-items: center; gap: 10px; padding: 7px 0; border-top: 1px solid var(--surface2); cursor: pointer; }
.dept-overdue-row:hover { background: var(--surface2); }
.dept-overdue-name { flex: 1; min-width: 0; }
.dept-overdue-name > div:first-child { font-size: 13.5px; color: var(--ink2); }
.dept-overdue-sub { font-size: 12px; color: var(--ink3); margin-top: 1px; }
.dept-overdue-days { font-family: var(--mono); font-size: 11px; color: var(--terracotta); flex-shrink: 0; }

/* ─── CARDS ─── */
.card { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r12); padding: 18px 20px; margin-bottom: 18px; }
.card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.card-title { font-family: var(--sans); font-weight: 600; font-size: 16px; color: var(--ink); }
.card-sub { font-size: 11px; color: var(--ink3); font-family: var(--mono); margin-left: auto; }

.week-nav-mini {
  display: inline-flex; align-items: center; gap: 4px;
  margin-left: 14px;
}
.week-nav-mini .rw-arrow {
  padding: 4px 8px; background: var(--surface2);
  border: 1px solid var(--rule); border-radius: var(--r6);
  font-size: 11px; color: var(--ink2); min-width: 26px;
  cursor: pointer;
}
.week-nav-mini .rw-arrow:hover { background: var(--stone-100); }
.rw-select-mini {
  padding: 4px 8px; border: 1px solid var(--rule);
  border-radius: var(--r6); background: var(--surface);
  font-size: 11.5px; color: var(--ink); outline: none;
  font-family: var(--mono); min-width: 220px; font-weight: 500;
  cursor: pointer;
}
.rw-select-mini:focus { border-color: var(--sage-500); }

/* ─── DASHBOARD GRID ─── */
.dash-grid { display: grid; grid-template-columns: 1fr 240px; gap: 22px; }

/* ─── WEEK SCHEDULE ─── */
.week-schedule { display: grid; grid-template-columns: 64px repeat(5, 1fr); gap: 4px; }
.ws-time-col { font-family: var(--mono); font-size: 11px; color: var(--ink3); text-align: right; padding-right: 8px; align-self: center; padding-top: 0; line-height: 24px; }
.ws-time-col.ws-time-lunch { align-self: start; padding-top: 8px; }
.ws-day-header { font-family: var(--mono); font-size: 11px; color: var(--ink3); text-align: center; padding: 7px 0; font-weight: 500; }
.ws-day-header .date { font-family: var(--sans); font-weight: 600; font-size: 20px; display: block; color: var(--ink2); margin-bottom: 2px; }
.ws-day-header.today .date { color: var(--sage-600); }
.ws-day-header.today { background: var(--sage-50); border-radius: var(--r6); }
.ws-cell { background: var(--surface2); border-radius: var(--r6); height: 24px; position: relative; }
.ws-lunch-band {
  grid-column: span 5;
  height: 24px; margin: 8px 0;
  background: var(--khaki-bg); border: 1px solid var(--khaki); border-radius: var(--r6);
  color: var(--khaki-ink);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--mono); font-size: 11px; font-weight: 500; letter-spacing: 1.5px;
  cursor: not-allowed;
}
.ws-event {
  position: absolute; left: 2px; right: 2px;
  border-radius: var(--r4); padding: 6px 8px;
  font-size: 11px; line-height: 1.2;
  overflow: hidden; cursor: pointer;
  border-left: 3px solid; transition: transform .1s;
  z-index: 1;
}
.ws-event.ws-ev-task { display: flex; align-items: flex-start; padding: 5px 8px; }
.ws-event.ws-ev-task b { display: inline; padding-left: 0; }
.ws-event .ws-ev-line { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-left: 6px; padding-right: 14px; }
.ws-event b { font-size: 12px; font-weight: 600; display: block; }
.ws-event .ev-meta { font-size: 10.5px; color: var(--ink3); margin-top: 1px; font-family: var(--mono); }
.ws-event:hover { transform: scale(1.02); z-index: 2; }
.ws-event.deep { background: var(--sage-50); border-color: var(--sage-500); color: var(--sage-800); }
.ws-event.admin { background: var(--amber-l); border-color: var(--amber); color: var(--amber-ink); }
.ws-event.meeting { 
  background: linear-gradient(135deg, var(--navy-from) 0%, var(--navy-to) 100%);
  border-color: var(--navy);
  color: var(--navy-ink);
}
.ws-event.auto-meeting {
  background: linear-gradient(135deg, var(--navy-from) 0%, var(--navy-to) 100%);
  border-left: 4px solid var(--navy);
  cursor: default;
  font-weight: 500;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  text-align: left;
  padding-left: 10px;
}
.ws-event.cleaning {
  background: linear-gradient(135deg, var(--clay-from) 0%, var(--clay-to) 100%);
  border-left: 4px solid var(--clay);
  color: var(--clay-ink);
  cursor: default;
  font-weight: 500;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  text-align: left;
  padding-left: 10px;
}
.ws-event.auto-meeting b, .ws-event.cleaning b { padding-left: 0; }
.ws-event.auto-meeting .ev-meta, .ws-event.cleaning .ev-meta { padding-left: 0; }
.ws-event.auto-meeting:hover, .ws-event.cleaning:hover { transform: none; }
.ws-event.other { background: var(--stone-100); border-color: var(--stone-300); color: var(--stone-600); }
.ws-event.milestone { background: var(--terracotta-l); border-color: var(--terracotta); color: var(--terracotta-ink); }  /* M2-T3：taskType 里程碑週卡，同甘特菱形 terracotta */
.ws-event.locked { border-left-style: double; border-left-width: 5px; }
.ws-event.overdue { box-shadow: 0 0 0 1.5px var(--terracotta); }
.ws-event.completed {
  background: repeating-linear-gradient(
    -45deg,
    var(--sage-50),
    var(--sage-50) 4px,
    rgba(74, 124, 92, 0.12) 4px,
    rgba(74, 124, 92, 0.12) 8px
  );
  opacity: 0.85;
  cursor: pointer;
}
.ws-event.completed b { text-decoration: line-through; text-decoration-color: var(--sage-600); }
.ws-event .done-badge {
  position: absolute; top: 2px; right: 4px;
  font-size: 12px; color: var(--sage-700); font-weight: 700;
}
.ws-event.dragging { opacity: 0.4; }
.ws-event .lock-ico { position: absolute; top: 2px; right: 4px; font-size: 9px; opacity: .7; }
.ws-event .overdue-badge {
  position: absolute; top: 2px; left: 4px;
  font-size: 9px; color: var(--terracotta);
}
.ws-event .sync-badge {
  position: absolute; top: 2px; left: 4px;
  font-size: 8.5px; color: var(--sage-600);
}
.ws-event.overdue .sync-badge { left: 14px; }
.ws-event b { display: block; font-weight: 600; font-size: 13px; line-height: 1.2; padding-left: 10px; }
.ws-event .ev-meta { font-size: 10px; opacity: .85; font-family: var(--mono); margin-top: 0; line-height: 1.15; padding-left: 10px; color: var(--ink3); }
.ws-event .ws-ev-proj { font-size: 11px; font-weight: 500; }

.ws-cell.drag-over {
  background: var(--sage-100) !important;
  outline: 2px dashed var(--sage-500);
  outline-offset: -2px;
}

.legend-row { display: flex; gap: 16px; padding: 12px 0 0; font-size: 11px; color: var(--ink3); border-top: 1px dashed var(--rule); margin-top: 12px; flex-wrap: wrap; }
.legend-item { display: flex; align-items: center; gap: 5px; }
.legend-sw { display: inline-block; width: 10px; height: 10px; border-radius: 3px; }

/* ─── SCHEDULE SORT RULES（摺疊說明，純顯示） ─── */
.sched-rules { margin-top: 10px; font-size: 11.5px; color: var(--ink2); }
.sched-rules summary { cursor: pointer; color: var(--sage-700); font-weight: 600; padding: 4px 0; list-style: none; }
.sched-rules summary::-webkit-details-marker { display: none; }
.sched-rules summary::before { content: '▸ '; }
.sched-rules[open] summary::before { content: '▾ '; }
.sched-rules-body { padding: 6px 2px 2px; line-height: 1.7; }
.sched-rules-body p { margin: 0 0 6px; }
.sched-rules-body .sr-sink { color: var(--ink); background: var(--surface2); border-left: 3px solid var(--terracotta); border-radius: var(--r6); padding: 7px 10px; }
.sched-rules-body .sr-intro { color: var(--ink2); }
.sched-rules-body ul { margin: 0 0 6px; padding-left: 18px; }
.sched-rules-body li { margin: 3px 0; }
.sched-rules-body .sr-note { color: var(--ink3); font-size: 11px; }

/* ─── NEXT-WEEK TODO（下週待辦 + 釘選） ─── */
.next-week-todo { margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--rule); }
.nwt-head { font-size: 12.5px; font-weight: 600; color: var(--ink); margin-bottom: 8px; }
.nwt-hint { font-size: 10.5px; font-weight: 400; color: var(--ink3); }
.nwt-subtitle { font-size: 11.5px; font-weight: 600; color: var(--sage-700); margin: 10px 0 6px; }
.nwt-row { display: flex; align-items: center; gap: 10px; padding: 5px 0; font-size: 12px; border-bottom: 1px solid var(--rule); }
.nwt-row:last-child { border-bottom: none; }
.nwt-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink); }
.nwt-proj { font-size: 11px; color: var(--ink3); white-space: nowrap; }
.nwt-date { font-family: var(--mono); font-size: 11px; color: var(--ink3); white-space: nowrap; }
.nwt-pin, .nwt-unpin { font-size: 11px; border: 1px solid var(--rule); border-radius: var(--r6); padding: 3px 8px; cursor: pointer; white-space: nowrap; background: var(--surface); color: var(--sage-700); }
.nwt-pin:hover { background: var(--sage-50); border-color: var(--sage-500); }
.nwt-unpin { color: var(--ink3); }
.nwt-unpin:hover { background: var(--surface2); }
.nwt-row.nwt-pinned { background: var(--sage-50); border-radius: var(--r6); padding: 5px 8px; border-bottom: none; margin-bottom: 3px; }
.nwt-empty { font-size: 11.5px; color: var(--ink3); font-style: italic; padding: 4px 0; }
.nwt-proj-group { margin-bottom: 8px; }
.nwt-proj-title { font-size: 12px; font-weight: 600; color: var(--ink); margin: 6px 0 4px; }
.nwt-proj-count { font-size: 10.5px; font-weight: 400; color: var(--ink3); }
.nwt-more > summary, .nwt-far > summary { cursor: pointer; font-size: 11px; color: var(--sage-700); padding: 3px 0; list-style: none; }
.nwt-more > summary::-webkit-details-marker, .nwt-far > summary::-webkit-details-marker { display: none; }
.nwt-more > summary::before, .nwt-far > summary::before { content: '▸ '; }
.nwt-more[open] > summary::before, .nwt-far[open] > summary::before { content: '▾ '; }
.nwt-far { margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--rule); }
.nwt-far-body { padding-top: 4px; }

/* ─── MEMO ─── */
.memo-board {
  background: var(--surface); border: 1px solid var(--rule);
  border-radius: var(--r12); padding: 16px;
  position: relative; min-height: 540px;
  background-image:
    radial-gradient(circle at 15% 25%, rgba(74,124,92,.04) 0, transparent 40%),
    radial-gradient(circle at 85% 70%, rgba(196,99,62,.04) 0, transparent 40%);
}
.memo-head { display: flex; align-items: center; margin-bottom: 12px; }
.memo-title { font-family: var(--sans); font-weight: 600; font-size: 14px; }
.memo-add {
  margin-left: auto; padding: 4px 10px; background: var(--sage-50);
  border: 1px solid var(--sage-200); border-radius: var(--r6);
  font-size: 11px; color: var(--sage-700); font-weight: 500;
}
.memo-add:hover { background: var(--sage-100); }
.memo-list { position: relative; height: 480px; }
.memo {
  position: absolute; width: 130px; padding: 10px 12px 24px;
  font-family: var(--hand); font-size: 15px; line-height: 1.4;
  color: var(--stone-900); box-shadow: 1px 2px 4px rgba(58,51,42,.12);
  cursor: grab; transition: transform .15s, box-shadow .15s;
  border-radius: 1px 1px 4px 4px;
}
.memo:hover { transform: rotate(0deg) scale(1.05) !important; z-index: 5; box-shadow: 2px 4px 10px rgba(58,51,42,.15); }
.memo .memo-author { position: absolute; bottom: 5px; right: 8px; font-size: 9px; opacity: .55; font-family: var(--mono); }
.memo .memo-del { position: absolute; top: 2px; right: 4px; background: none; border: none; color: rgba(0,0,0,.3); font-size: 14px; padding: 0 4px; opacity: 0; transition: opacity .15s; }
.memo:hover .memo-del { opacity: 1; }

/* ─── PROJECT ─── */
.proj-header { display: flex; align-items: center; gap: 14px; margin-bottom: 22px; padding-bottom: 18px; border-bottom: 1px solid var(--rule); }
.proj-color { width: 44px; height: 44px; border-radius: var(--r12); flex-shrink: 0; }
.proj-name { font-family: var(--sans); font-weight: 600; font-size: 22px; line-height: 1.1; color: var(--ink); }
.proj-meta { font-size: 12px; color: var(--ink3); font-family: var(--mono); }
.proj-sync-badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 10.5px; padding: 3px 8px; background: var(--sage-50);
  color: var(--sage-700); border-radius: 99px; font-weight: 500; margin-left: 8px;
}

.proj-grid { display: grid; grid-template-columns: 1fr; gap: 22px; }

.proj-dash-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: start;
  gap: var(--r16);
  margin-bottom: 14px;
}

/* ─── TASK LIST ─── */
.task-list-card { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r12); overflow: hidden; }
.tlc-head { display: flex; align-items: center; gap: 10px; padding: 12px 16px; background: var(--head-band-strong); }
.tlc-title { font-family: var(--mono); font-size: 14px; color: var(--ink-inverse); letter-spacing: .08em; text-transform: uppercase; font-weight: 500; }
.tlc-count { font-family: var(--mono); font-size: 11px; color: var(--ink2); background: var(--stone-100); padding: 1px 8px; border-radius: 99px; }

.task-row, .task-row-header {
  display: grid; grid-template-columns: 0.5fr 1.2fr 2.6fr 1.4fr 0.9fr 0.9fr 1fr 1.6fr 0.8fr 0.8fr;
  gap: 14px; align-items: center; padding: 11px 16px;
}
.task-row {
  position: relative; border-bottom: 1px solid var(--rule); transition: background .12s; cursor: pointer;
}
.task-row-header {
  background: var(--head-band-strong); border-bottom: 1px solid var(--rule);
  font-family: var(--mono); font-size: 13px; letter-spacing: .04em; color: var(--ink-inverse); text-transform: uppercase;
}

/* ─── 待辦清單篩選列（§塊3 UI 殼：膠囊多選 + 展開面板，本批不接過濾）─── */
.task-filter-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 16px; background: var(--surface2); border-bottom: 1px solid var(--rule); }
.tf-chip-wrap { position: relative; }
.tf-chip { display: inline-flex; align-items: center; gap: 5px; padding: 4px 11px; border: 1.5px solid var(--rule2); border-radius: 99px; background: var(--surface); color: var(--ink3); font-size: 11.5px; font-weight: 500; cursor: pointer; white-space: nowrap; transition: background .12s, color .12s, border-color .12s; }
.tf-chip:hover { border-color: var(--ink4); }
.tf-caret { font-size: 9px; opacity: .7; }
/* 選中態 B+：中淺底（-chip 階）+ 1.5px 主色邊 + 最深階字（各膠囊語意色）*/
.tf-chip.tf-stages.active { background: var(--sage-chip); border-color: var(--sage-500); color: var(--sage-700); }
.tf-chip.tf-owners.active { background: var(--slate-chip); border-color: var(--slate); color: var(--slate-ink); }
.tf-chip.tf-urg.active { background: var(--terracotta-chip); border-color: var(--terracotta); color: var(--terracotta-ink); }
.tf-chip.tf-status.active { background: var(--rose-chip); border-color: var(--rose); color: var(--rose-ink); }
.tf-clear-all { margin-left: auto; border: none; background: none; color: var(--ink3); font-size: 11px; cursor: pointer; padding: 4px 6px; text-decoration: underline; }
.tf-clear-all:hover { color: var(--terracotta); }
/* 展開面板 */
.tf-panel { display: none; position: absolute; top: calc(100% + 6px); left: 0; min-width: 160px; max-height: 280px; overflow-y: auto; background: var(--surface); border: 1px solid var(--rule2); border-radius: var(--r10); box-shadow: var(--shadow-lg); z-index: var(--z-dropdown); padding: 6px; }
.tf-chip-wrap.open .tf-panel { display: block; }
.tf-opts { display: flex; flex-direction: column; gap: 1px; }
.tf-opt { display: flex; align-items: center; gap: 7px; padding: 5px 8px; border-radius: var(--r6); font-size: 12px; color: var(--ink2); cursor: pointer; }
.tf-opt:hover { background: var(--surface2); }
.tf-opt.on { background: var(--sage-50); color: var(--sage-700); font-weight: 500; }
.tf-opt input { accent-color: var(--sage-500); }
.tf-empty { padding: 8px; font-size: 11.5px; color: var(--ink4); text-align: center; }
.tf-panel-foot { display: flex; justify-content: space-between; gap: 6px; margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--rule); }
.tf-panel-foot button { flex: 1; border: 1px solid var(--rule2); background: var(--surface); border-radius: var(--r6); padding: 4px; font-size: 11px; color: var(--ink2); cursor: pointer; }
.tf-panel-foot button:hover { background: var(--surface2); }
.task-row:last-child { border-bottom: none; }
.task-row:nth-child(even) { background: var(--cream); }
.task-row:hover { background: var(--surface2); }
.task-row.synced { background: rgba(74,124,92,.02); }
.task-row.synced:hover { background: var(--sage-50); }
/* 列交界 hover 插入（§8b 中間插入 UI 殼；只在 active 清單開、末列不放）*/
.row-insert {
  position: absolute; left: 0; right: 0; bottom: -9px; height: 18px;
  align-items: center; justify-content: center;
  opacity: 0; transition: opacity .12s; z-index: var(--z-sticky);
  pointer-events: none;            /* 熱區不擋列點擊；只有➕按鈕可點 */
  display: none;                   /* 預設關（done 清單等情境）；只在 active 清單開 */
}
.row-insert::before {
  content: ''; position: absolute; left: 16px; right: 16px; top: 50%; transform: translateY(-50%);
  height: 2px; background: var(--sage-600); border-radius: 99px;
}
.row-insert-btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--sage-600); color: var(--ink-inverse); border: none;
  font-size: 14px; cursor: pointer; box-shadow: var(--shadow-sm); pointer-events: auto;
}
#activeTaskList .task-row .row-insert { display: flex; }
#activeTaskList .task-row:last-child .row-insert { display: none; }
#activeTaskList .task-row:hover .row-insert { opacity: 1; }
.task-check {
  width: 18px; height: 18px; border-radius: var(--r4); border: 1.5px solid var(--rule2);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: all .15s; background: var(--surface);
}
.task-check.done { background: var(--sage-500); border-color: var(--sage-500); color: var(--ink-inverse); font-size: 11px; }
.task-check.locked { background: var(--stone-100); cursor: not-allowed; }
.task-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.task-name { font-size: 13.5px; font-weight: 500; color: var(--ink); }
.task-row.done .task-name { text-decoration: line-through; color: var(--ink4); }
.task-name .sync-tag {
  display: inline-flex; align-items: center; gap: 3px;
  font-size: 9.5px; padding: 1px 6px; border-radius: 99px;
  background: var(--sage-50); color: var(--sage-700); font-weight: 500; margin-left: 6px;
}
.task-name .preview-tag {
  font-size: 9.5px; padding: 1px 6px; border-radius: 99px;
  background: var(--amber-l); color: var(--amber-ink); font-weight: 500; margin-left: 6px;
}
.task-desc { font-size: 11.5px; color: var(--ink3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.task-tag { font-size: 10px; font-family: var(--mono); padding: 2px 8px; border-radius: 99px; font-weight: 500; white-space: nowrap; }
.tag-deep { background: var(--sage-50); color: var(--sage-700); }
.tag-admin { background: var(--amber-l); color: var(--amber-ink); }
.tag-meeting { background: var(--slate-l); color: var(--slate-ink); }
.tag-other { background: var(--stone-100); color: var(--stone-600); }
.tag-milestone { background: var(--terracotta-l); color: var(--terracotta-ink); }  /* M2-T3：taskType 里程碑 tag，同甘特菱形 terracotta */
.task-urg { display: inline-block; width: 9px; height: 9px; border-radius: 50%; }
.task-urg.high { background: var(--terracotta); }
.task-urg.medium { background: var(--amber); }
.task-urg.low { background: var(--sage-400); }
.task-deadline { font-family: var(--mono); font-size: 10.5px; color: var(--ink3); white-space: nowrap; }
.task-deadline.near { color: var(--terracotta); font-weight: 600; }
.task-deadline.overdue { color: var(--rose); font-weight: 600; }

/* 看板視圖（§1.2 五欄 / §1.7 窄卡）；due 配色複用 .task-deadline，CSS 不另寫 due 顏色 */
.kanban-board {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  padding: 12px 0;
}
.kanban-col {
  background: var(--surface2);
  border-radius: var(--r8);
  padding: 8px;
}
.kanban-col-delayed {
  background: var(--terracotta-l);
}
.kanban-col-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 6px 8px;
  border-bottom: 1px solid var(--rule);
  margin-bottom: 8px;
  font-size: 13px;
  color: var(--ink3);
}
.kanban-col-delayed .kanban-col-head {
  color: var(--terracotta-ink);
  border-bottom-color: var(--terracotta);
}
.kanban-col-count { font-size: 12px; color: var(--ink4); }
.kanban-cards { display: flex; flex-direction: column; gap: 6px; }
.kanban-card {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--r6);
  padding: 8px;
  cursor: pointer;
  transition: background .12s;
}
.kanban-card:hover { background: var(--surface2); }
.kanban-col-delayed .kanban-card { border-color: var(--terracotta); }
.kanban-card-top { display: flex; gap: 6px; align-items: baseline; margin-bottom: 4px; }
.kanban-card-wbs { font-size: 11px; color: var(--ink4); font-family: var(--mono); }
.kanban-card-name { font-size: 13px; color: var(--ink); line-height: 1.3; }
.kanban-card-owner { font-size: 11px; color: var(--ink4); }
.kanban-card-progress { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; }
.kanban-prog-track { flex: 1; height: 6px; background: var(--surface2); border: 1px solid var(--rule); border-radius: 99px; overflow: hidden; }
.kanban-prog-fill { height: 100%; background: var(--sage-500); border-radius: 99px; }
.kanban-col-delayed .kanban-prog-fill { background: var(--terracotta); }
.kanban-prog-pct { font-size: 11px; color: var(--ink3); min-width: 28px; text-align: right; }
.kanban-card-pred { font-size: 11px; color: var(--ink3); margin-bottom: 6px; }
.kanban-card-dates { font-size: 11px; color: var(--ink4); }

/* 看板篩選列（§1.8：狀態 + 階段 + 搜尋；案別下拉待 variant 資料層） */
.kanban-filter-row {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.kanban-filter-status, .kanban-filter-stage, .kanban-filter-dept {
  height: 32px;
  padding: 0 8px;
  border: 1px solid var(--rule);
  border-radius: var(--r6);
  background: var(--surface);
  color: var(--ink);
  font-size: 13px;
}
.kanban-filter-search {
  flex: 1;
  min-width: 160px;
  height: 32px;
  padding: 0 10px;
  border: 1px solid var(--rule);
  border-radius: var(--r6);
  background: var(--surface);
  color: var(--ink);
  font-size: 13px;
}
.kanban-filter-search::placeholder { color: var(--ink4); }

.done-section { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r12); overflow: hidden; margin-top: 12px; opacity: .85; }
.done-section.collapsed .done-list, .done-section.collapsed .done-clear-tip { display: none; }
.done-head { padding: 11px 16px; background: var(--stone-50); display: flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; transition: background .15s; }
.done-head:hover { background: var(--stone-100); }
.done-head-title { font-family: var(--mono); font-size: 11px; color: var(--ink3); letter-spacing: .08em; text-transform: uppercase; font-weight: 500; }
.done-head-count { font-family: var(--mono); font-size: 11px; color: var(--ink2); background: var(--stone-100); padding: 1px 8px; border-radius: 99px; }
.done-head-chevron { margin-left: auto; transition: transform .2s; font-size: 12px; color: var(--ink3); }
.done-section.collapsed .done-head-chevron { transform: rotate(-90deg); }
.done-clear-tip { padding: 8px 16px; background: var(--surface2); font-size: 11px; color: var(--ink3); border-top: 1px dashed var(--rule); }

.deleted-section { border-color: var(--terracotta-l) !important; }
.deleted-section .done-head { background: rgba(196, 99, 62, 0.06); }
.deleted-section .done-head:hover { background: rgba(196, 99, 62, 0.12); }

/* commit2 C：done inline 原位 + 收合 toggle bar */
#activeTaskList.hide-done .task-row.done { display: none; }
#activeTaskList .task-row.done { opacity: .65; }
.done-toggle-bar { padding: 11px 14px 11px 11px; margin-top: 0; background: var(--sage-100); border: 1px solid var(--sage-200); border-left: 4px solid var(--sage-500); border-radius: var(--r12); display: flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; transition: background .15s; }
.done-toggle-bar:hover { background: var(--sage-200); }
.done-toggle-bar .done-head-chevron { margin-left: 0; color: var(--sage-600); }
.done-toggle-bar .done-head-title { color: var(--sage-800); font-weight: 600; }
.done-toggle-bar .done-head-count { color: var(--sage-50); background: var(--sage-700); }
.done-toggle-bar .done-toggle-note { color: var(--sage-600); }
.done-toggle-bar.collapsed .done-head-chevron { transform: rotate(-90deg); }
.done-toggle-note { font-size: 11px; color: var(--ink4); }
.deleted-row:last-child { border-bottom: none !important; }
.deleted-row:hover { background: var(--surface2); }

.list-foot { padding: 11px 14px; border-top: 1px solid var(--rule); background: var(--surface2); display: flex; align-items: center; gap: 8px; }
.list-foot input { flex: 1; border: none; background: transparent; outline: none; padding: 4px 8px; font-size: 13px; color: var(--ink); }
.list-foot input::placeholder { color: var(--ink4); }
.list-foot button { padding: 5px 12px; background: var(--sage-500); color: var(--ink-inverse); border: none; border-radius: var(--r6); font-size: 12px; font-weight: 500; }

.empty-task-list { padding: 40px 20px; text-align: center; color: var(--ink3); font-size: 13px; }
.empty-task-list-icon { font-size: 32px; margin-bottom: 8px; opacity: .4; }

/* ─── SIDE CARD (meetings, generate) ─── */
.side-card { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r12); padding: 14px 16px; margin-bottom: 14px; }
.side-card-title { font-family: var(--sans); font-weight: 600; font-size: 13px; color: var(--ink); margin-bottom: 4px; display: flex; align-items: center; gap: 6px; }
.side-card-sub { font-size: 11px; color: var(--ink3); margin-bottom: 12px; line-height: 1.5; }

.meeting-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.meeting-item { display: flex; align-items: center; gap: 8px; padding: 6px 10px; background: var(--slate-l); border-radius: var(--r6); font-size: 11.5px; color: var(--slate-ink); }
.meeting-item .m-time { font-family: var(--mono); font-weight: 500; }
.meeting-item .m-title { flex: 1; color: var(--slate-ink); min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.meeting-item .m-del { background: none; border: none; color: var(--ink3); font-size: 14px; padding: 0 2px; opacity: .5; }
.meeting-item .m-del:hover { color: var(--terracotta); opacity: 1; }

.add-meeting-tabs { display: flex; gap: 1px; background: var(--surface2); padding: 2px; border-radius: var(--r8); margin-bottom: 10px; }
.am-tab { flex: 1; padding: 5px; background: none; border: none; border-radius: var(--r6); font-size: 11px; color: var(--ink3); font-weight: 500; }
.am-tab.active { background: var(--surface); color: var(--sage-700); box-shadow: var(--shadow-sm); }

.am-form { display: flex; flex-direction: column; gap: 6px; }
.am-row { display: flex; gap: 6px; }
.am-row input, .am-row select { padding: 6px 8px; border: 1px solid var(--rule); border-radius: var(--r6); font-size: 11.5px; background: var(--surface2); outline: none; flex: 1; min-width: 0; }
.am-row input:focus, .am-row select:focus { background: var(--surface); border-color: var(--sage-500); }
.am-form textarea { width: 100%; min-height: 72px; padding: 8px 10px; border: 1px solid var(--rule); border-radius: var(--r6); font-family: var(--mono); font-size: 11px; resize: vertical; background: var(--surface2); outline: none; }
.am-form textarea:focus { background: var(--surface); border-color: var(--sage-500); }
.am-add-btn { background: var(--sage-500); color: var(--ink-inverse); border: none; border-radius: var(--r6); padding: 6px; font-size: 11.5px; font-weight: 500; transition: background .15s; }
.am-add-btn:hover { background: var(--sage-600); }
.am-add-btn:disabled { background: var(--stone-300); cursor: not-allowed; }
.am-drop { border: 1.5px dashed var(--rule2); border-radius: var(--r8); padding: 18px 12px; text-align: center; cursor: pointer; transition: all .2s; background: var(--surface2); }
.am-drop:hover { border-color: var(--sage-500); background: var(--sage-50); }
.am-drop.dragover { border-color: var(--sage-500); background: var(--sage-100); }
.am-drop .ic { font-size: 24px; opacity: .5; margin-bottom: 4px; }
.am-drop .tx { font-size: 11.5px; color: var(--ink2); }
.am-drop .sub { font-size: 10.5px; color: var(--ink3); margin-top: 2px; }

/* Screenshot list */
.shot-list { margin-top: 10px; display: flex; flex-direction: column; gap: 5px; }
.shot-list-head { font-size: 10.5px; color: var(--ink3); font-family: var(--mono); margin-bottom: 2px; letter-spacing: .04em; text-transform: uppercase; }
.shot-item { display: flex; align-items: center; gap: 6px; padding: 5px 8px; background: var(--surface2); border-radius: var(--r6); font-size: 11px; }
.shot-thumb { width: 24px; height: 24px; border-radius: var(--r4); object-fit: cover; }
.shot-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink2); }
.shot-week { padding: 2px 6px; border: 1px solid var(--rule); border-radius: var(--r4); background: var(--surface); font-size: 10.5px; color: var(--ink2); outline: none; }
.shot-progress { font-size: 10px; color: var(--sage-600); font-family: var(--mono); }
.shot-item .m-del { background: none; border: none; color: var(--ink3); font-size: 14px; padding: 0 2px; opacity: .6; }
.shot-item .m-del:hover { color: var(--terracotta); opacity: 1; }

.ocr-result { margin-top: 10px; padding: 10px; background: var(--sage-50); border: 1px solid var(--sage-200); border-radius: var(--r8); }
.ocr-result-head { font-size: 11.5px; color: var(--sage-700); font-weight: 600; display: flex; align-items: center; margin-bottom: 8px; }
.ocr-row { display: flex; align-items: center; gap: 8px; padding: 5px 8px; margin: 2px 0; background: var(--surface); border-radius: var(--r6); font-size: 11px; cursor: pointer; }
.ocr-row.dim { opacity: .55; }
.ocr-row input[type=checkbox] { width: 14px; height: 14px; accent-color: var(--sage-500); flex-shrink: 0; }
.ocr-row .ocr-time { font-family: var(--mono); font-weight: 600; color: var(--slate); white-space: nowrap; }
.ocr-row .ocr-title { flex: 1; color: var(--ink2); min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.ocr-row .ocr-src { font-size: 9.5px; color: var(--ink3); font-family: var(--mono); white-space: nowrap; }
.ocr-tip { font-size: 10.5px; color: var(--ink3); padding: 6px 0 0; line-height: 1.5; }

/* Generate */
.generate-section { margin-top: 18px; }
.generate-cta {
  background: linear-gradient(135deg, var(--sage-500) 0%, var(--sage-600) 100%);
  color: var(--ink-inverse); border: none; border-radius: var(--r12);
  padding: 14px 18px; font-size: 14px; font-weight: 600;
  width: 100%; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  transition: all .2s; box-shadow: var(--shadow); position: relative; overflow: hidden;
}
.generate-cta:hover { transform: translateY(-1px); box-shadow: var(--shadow-lg); }
.generate-cta::before { content: ""; position: absolute; top: 0; left: -100%; width: 100%; height: 100%; background: linear-gradient(90deg, transparent, rgba(255,255,255,.18), transparent); transition: left .8s; }
.generate-cta:hover::before { left: 100%; }
.gen-sub { font-size: 11px; color: var(--ink3); text-align: center; margin-top: 6px; line-height: 1.5; }
.gen-result-card { background: var(--sage-50); border: 1px solid var(--sage-200); border-radius: var(--r12); padding: 14px 16px; margin-top: 14px; display: none; animation: slideUp .3s ease both; }
.gen-result-card.show { display: block; }
@keyframes slideUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.gen-result-title { font-family: var(--sans); font-weight: 600; font-size: 13px; color: var(--sage-700); margin-bottom: 6px; }
.gen-result-sub { font-size: 11.5px; color: var(--stone-600); line-height: 1.7; }
.gen-result-sub b { color: var(--sage-700); }

.tip { margin-top: 12px; padding: 12px 14px; background: var(--slate-l); border-radius: var(--r8); font-size: 12px; color: var(--slate-ink); line-height: 1.7; border-left: 3px solid var(--slate); }
.tip b { color: var(--slate-ink); }

/* ─── GANTT ─── */
.gantt-card { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r12); padding: 20px; overflow-x: auto; }
.gantt-header-row { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.gantt-filter { position: relative; display: inline-block; margin-bottom: 14px; }
.gantt-filter-field { display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; background: var(--surface2); border: 1px solid var(--rule); border-radius: var(--r6); color: var(--ink2); font-size: 12px; cursor: pointer; }
.gantt-filter-field:hover { background: var(--stone-100); }
.gantt-filter-summary { font-size: 12px; color: var(--ink3); }
.gantt-filter-chevron { font-size: 10px; color: var(--ink3); transition: transform .15s; }
.gantt-filter-field.open .gantt-filter-chevron { transform: rotate(180deg); }
.gantt-filter-menu { position: absolute; top: 100%; left: 0; margin-top: 4px; min-width: 200px; display: flex; flex-direction: column; gap: 6px; padding: 8px; background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r8); box-shadow: var(--shadow-lg); z-index: var(--z-dropdown); }
.gantt-filter-label { font-size: 12px; font-weight: 600; color: var(--ink2); margin-right: 2px; }
.gantt-filter-item { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--ink2); cursor: pointer; }
.gantt-filter-item input { width: auto; cursor: pointer; }
.gantt-filter-sw { display: inline-block; width: 10px; height: 10px; border-radius: 3px; }
.gantt-nav { display: flex; align-items: center; gap: 6px; }
.gantt-nav button { padding: 5px 10px; background: var(--surface2); border: 1px solid var(--rule); border-radius: var(--r6); font-size: 12px; color: var(--ink2); }
.gantt-nav button:hover { background: var(--stone-100); }
.gantt-period { font-family: var(--sans); font-weight: 600; font-size: 16px; color: var(--ink); }
.gantt { display: grid; grid-template-columns: 200px repeat(14, minmax(38px, 1fr)); gap: 0; min-width: 760px; }
.gantt-corner, .gantt-day-header { font-family: var(--mono); font-size: 9.5px; color: var(--ink3); padding: 6px 0; text-align: center; border-bottom: 2px solid var(--rule); background: var(--surface2); }
.gantt-corner { padding: 8px 6px; }
.gantt-day-header { border-left: 1px solid var(--rule); }
.gantt-day-header.weekend { background: var(--stone-50); color: var(--ink4); }
.gantt-day-header.today { color: var(--terracotta); background: var(--terracotta-l); }
.gantt-day-header .gd-day { font-family: var(--sans); font-weight: 600; font-size: 13px; color: var(--ink2); display: block; margin-bottom: 1px; }
.gantt-day-header.today .gd-day { color: var(--terracotta); }
.gantt-day-header.weekend .gd-day { color: var(--ink3); }
.gantt-row-label { padding: 8px 6px; font-size: 12px; display: flex; align-items: center; gap: 6px; border-bottom: 1px solid var(--rule); background: var(--surface); min-width: 0; }
.gantt-row-label .dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.gantt-row-label-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gantt-cell { border-bottom: 1px solid var(--rule); border-left: 1px solid var(--rule); min-height: 36px; position: relative; background: var(--surface); }
.gantt-cell.weekend { background: var(--stone-50); }
.gantt-cell.today { background: rgba(196,99,62,.04); }
.gantt-bar { position: absolute; top: 6px; bottom: 6px; border-radius: var(--r6); padding: 0 10px; display: flex; align-items: center; font-size: 11px; font-weight: 500; color: var(--ink-inverse); cursor: pointer; transition: filter .15s, transform .12s; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; z-index: 3; }
.gantt-bar:hover { filter: brightness(1.08); transform: translateY(-1px); }
.gantt-bar.bar-sage { background: var(--sage-500); }
.gantt-bar.bar-terracotta { background: var(--terracotta); }
.gantt-bar.bar-slate { background: var(--slate); }
.gantt-bar.bar-amber { background: var(--amber); }
.gantt-bar.bar-plum { background: var(--plum); }
.gantt-bar .pill { background: rgba(255,255,255,.22); padding: 1px 7px; border-radius: 99px; font-size: 9.5px; margin-left: 6px; font-family: var(--mono); }
.gantt-bar .progress { position: absolute; left: 0; top: 0; bottom: 0; background: rgba(255,255,255,.18); border-radius: var(--r6) 0 0 var(--r6); pointer-events: none; }
.gantt-bar.milestone { background: none; padding: 0; display: flex; align-items: center; }
.gantt-bar.milestone::before { content: ""; width: 14px; height: 14px; background: var(--terracotta); transform: rotate(45deg); margin: auto; }

/* ─── MONTH ─── */
.month-card { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r12); padding: 20px; }
.month-head-row { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; position: relative; }
.month-title-btn { font-family: var(--sans); font-weight: 600; font-size: 22px; color: var(--ink); background: none; border: none; padding: 4px 8px; border-radius: var(--r6); display: flex; align-items: center; gap: 6px; transition: background .15s; }
.month-title-btn:hover { background: var(--surface2); }
.month-title-btn .chevron { font-size: 12px; color: var(--ink3); }
.month-nav { display: flex; align-items: center; gap: 4px; }
.month-nav button { padding: 5px 10px; background: var(--surface2); border: 1px solid var(--rule); border-radius: var(--r6); font-size: 12px; color: var(--ink2); min-width: 28px; }
.month-nav button:hover { background: var(--stone-100); }
.month-spacer { flex: 1; }

.ym-picker { position: absolute; top: 100%; left: 0; margin-top: 6px; background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r12); box-shadow: var(--shadow-lg); padding: 14px; z-index: var(--z-dropdown); min-width: 280px; display: none; }
.ym-picker.open { display: block; animation: fadeIn .15s ease both; }
.ym-picker-year-row { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; padding-bottom: 10px; border-bottom: 1px solid var(--rule); }
.ym-picker-year-row select { flex: 1; padding: 6px 10px; border: 1px solid var(--rule); border-radius: var(--r6); background: var(--surface2); outline: none; font-weight: 500; }
.ym-picker-year-row button { padding: 5px 10px; background: var(--surface2); border: 1px solid var(--rule); border-radius: var(--r6); }
.ym-months { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.ym-months button { padding: 8px 4px; background: var(--surface2); border: none; border-radius: var(--r6); font-size: 12px; color: var(--ink2); transition: all .15s; }
.ym-months button:hover { background: var(--sage-100); color: var(--sage-700); }
.ym-months button.current { background: var(--sage-500); color: var(--ink-inverse); font-weight: 600; }

.month-weekday-row { display: grid; grid-template-columns: repeat(7, 1fr); border-bottom: 1px solid var(--rule); padding-bottom: 8px; margin-bottom: 4px; }
.month-weekday-row div { text-align: center; font-family: var(--mono); font-size: 10.5px; color: var(--ink3); letter-spacing: .04em; padding: 4px; font-weight: 500; }
.month-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }
.month-cell { min-height: 92px; padding: 6px 8px; background: var(--surface2); border-radius: var(--r8); font-size: 11px; display: flex; flex-direction: column; gap: 3px; cursor: pointer; transition: background .15s; }
.month-cell:hover { background: var(--stone-100); }
.month-cell.other-month { opacity: .4; }
.month-cell.today { background: var(--sage-50); border: 1.5px solid var(--sage-500); }
.month-cell .date { font-family: var(--sans); font-weight: 600; font-size: 13px; color: var(--ink2); }
.month-cell.today .date { color: var(--sage-700); }
.month-cell.weekend .date { color: var(--ink3); }
.month-evt { font-size: 10px; padding: 2px 6px; border-radius: var(--r4); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; }
.month-evt.deep { background: var(--sage-500); color: var(--ink-inverse); }
.month-evt.admin { background: var(--amber-l); color: var(--amber-ink); }
.month-evt.meeting { background: var(--slate); color: var(--ink-inverse); }
.month-evt.rust-evt { background: var(--terracotta); color: var(--ink-inverse); }
.month-evt.preview { background: transparent; color: var(--amber); border: 1px dashed var(--amber); }

/* ─── REPORT ─── */
.report-toolbar { display: flex; align-items: center; gap: 10px; padding: 14px 18px; background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r12); margin-bottom: 16px; flex-wrap: wrap; }
.report-week-nav { display: flex; align-items: center; gap: 4px; }
.rw-arrow { padding: 6px 10px; background: var(--surface2); border: 1px solid var(--rule); border-radius: var(--r6); font-size: 12px; color: var(--ink2); min-width: 32px; }
.rw-arrow:hover { background: var(--stone-100); }
.rw-select { padding: 6px 12px; border: 1px solid var(--rule); border-radius: var(--r6); background: var(--surface); font-size: 13px; color: var(--ink); outline: none; font-family: var(--mono); min-width: 280px; font-weight: 500; }
.rw-select:focus { border-color: var(--sage-500); }
.report-print-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r12); margin-bottom: 14px; border-top: 4px solid var(--sage-500); }
.rph-week { font-family: var(--sans); font-weight: 600; font-size: 18px; color: var(--ink); }
.rph-range { font-family: var(--mono); font-size: 11px; color: var(--ink3); margin-top: 2px; }
.rph-right { text-align: right; }
.rph-author { font-weight: 600; font-size: 13px; color: var(--ink2); }
.rph-dept { font-size: 11px; color: var(--ink3); margin-top: 2px; }

.report-summary { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; margin-bottom: 16px; }
.rs-stat { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r10); padding: 12px 14px; text-align: center; }
.rs-num { font-family: var(--sans); font-weight: 600; font-size: 22px; line-height: 1; color: var(--ink); }
.rs-label { font-family: var(--mono); font-size: 10px; color: var(--ink3); letter-spacing: .06em; text-transform: uppercase; margin-top: 4px; }

.report-highlights, .report-next, .report-notes { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r12); padding: 16px 20px; margin-bottom: 14px; }
.report-highlights { background: var(--sage-50); border-color: var(--sage-200); }
.report-next { background: var(--amber-l); border-color: var(--amber-border); }
.rh-title, .rn-title { font-family: var(--sans); font-weight: 600; font-size: 14px; color: var(--ink); margin-bottom: 8px; }
.report-highlights .rh-title { color: var(--sage-700); }
.report-next .rn-title { color: var(--amber-ink); }
.rh-list, .rn-list { list-style: none; padding: 0; margin: 0; font-size: 13px; line-height: 1.9; color: var(--ink2); }
.rh-list li::before, .rn-list li::before { content: "·"; display: inline-block; width: 18px; color: var(--ink3); font-weight: 700; }
.rh-list b, .rn-list b { color: var(--ink); font-weight: 600; }
.rn-textarea-wrap { background: var(--surface2); border-radius: var(--r8); padding: 4px; }
.rn-textarea { width: 100%; min-height: 80px; padding: 10px 12px; border: 1px solid transparent; border-radius: var(--r6); background: transparent; outline: none; resize: vertical; font-family: var(--sans); font-size: 13px; line-height: 1.7; color: var(--ink2); }
.rn-textarea:focus { border-color: var(--sage-500); background: var(--surface); }

.report-project { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r12); overflow: hidden; margin-bottom: 14px; }
.rp-head { display: flex; align-items: center; gap: 10px; padding: 12px 16px; background: var(--surface2); border-bottom: 1px solid var(--rule); }
.rp-dot { width: 10px; height: 10px; border-radius: 50%; }
.rp-name { font-family: var(--sans); font-weight: 600; font-size: 14px; }
.rp-sync-tag { font-size: 9.5px; padding: 2px 7px; border-radius: 99px; background: var(--sage-50); color: var(--sage-700); font-weight: 500; }
.rp-stats { margin-left: auto; font-family: var(--mono); font-size: 10.5px; color: var(--ink3); }
.rp-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.rp-table th { text-align: left; padding: 8px 12px; background: var(--surface); font-family: var(--mono); font-size: 10px; color: var(--ink3); letter-spacing: .06em; text-transform: uppercase; font-weight: 500; border-bottom: 1px solid var(--rule); }
.rp-table td { padding: 10px 12px; border-bottom: 1px solid var(--rule); vertical-align: top; font-size: 12px; }
.rp-table tr:last-child td { border-bottom: none; }
.rp-table tr:hover td { background: var(--surface2); }
.rp-task-name { font-weight: 500; color: var(--ink); font-size: 12.5px; }
.rp-task-name .sync-tag { font-size: 9px; padding: 1px 6px; background: var(--sage-50); color: var(--sage-700); border-radius: 99px; margin-left: 4px; font-weight: 500; font-family: var(--mono); }
.rp-task-desc { font-size: 11px; color: var(--ink3); margin-top: 2px; }
.rp-date { font-family: var(--mono); font-size: 11px; color: var(--ink3); white-space: nowrap; }
.rp-progress { display: inline-block; padding: 2px 9px; border-radius: 99px; font-family: var(--mono); font-size: 11px; font-weight: 600; }
.rp-progress.done { background: var(--sage-50); color: var(--sage-700); }
.rp-progress.wip { background: var(--amber-l); color: var(--amber-ink); }
.rp-progress.late { background: var(--terracotta-l); color: var(--terracotta); }
.rp-status { font-size: 11.5px; color: var(--ink2); }
.rp-status.done { color: var(--sage-600); }
.rp-status.wip { color: var(--amber-ink); }
.rp-status.late { color: var(--terracotta); font-weight: 600; }
.rp-note { font-size: 11px; color: var(--ink3); font-style: italic; }

.empty-report { text-align: center; padding: 40px 20px; color: var(--ink3); }

/* ─── SETTINGS ─── */
.settings-grid { display: grid; grid-template-columns: 1fr; gap: 16px; max-width: 760px; }
.settings-section { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r12); padding: 22px 24px; }
.ss-title { font-family: var(--sans); font-weight: 600; font-size: 16px; margin-bottom: 4px; }
.ss-desc { font-size: 12px; color: var(--ink3); margin-bottom: 16px; }
.ss-field { display: grid; grid-template-columns: 200px 1fr; gap: 16px; align-items: center; padding: 12px 0; border-top: 1px solid var(--rule); }
.ss-field:first-of-type { border-top: none; padding-top: 4px; }
.ss-field label { font-size: 13px; color: var(--ink2); font-weight: 500; }
.ss-field input, .ss-field select { padding: 7px 10px; border: 1px solid var(--rule); border-radius: var(--r8); background: var(--surface2); outline: none; font-size: 13px; width: 100%; transition: all .15s; }
.ss-field input:focus, .ss-field select:focus { border-color: var(--sage-500); background: var(--surface); box-shadow: 0 0 0 3px rgba(74,124,92,.1); }
.ss-field .help { font-size: 11px; color: var(--ink3); margin-top: 4px; line-height: 1.5; }
/* 工作日曆（公休/補班）匯入區（§之二.9 第3步） */
.cal-import { display: flex; flex-direction: column; gap: 10px; }
.cal-label { font-size: 12px; color: var(--ink2); font-weight: 500; }
.cal-textarea { width: 100%; min-height: 120px; padding: 8px 10px; border: 1px solid var(--rule); border-radius: var(--r6); font-family: var(--mono); font-size: 11px; resize: vertical; background: var(--surface2); outline: none; box-sizing: border-box; }
.cal-textarea:focus { background: var(--surface); border-color: var(--sage-500); }
.cal-btns { display: flex; gap: 8px; }
.cal-preview { padding: 10px 12px; background: var(--surface2); border-radius: var(--r8); font-size: 12px; display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.cal-preview:empty { display: none; }
.cal-result { color: var(--sage-700); font-weight: 600; }
.cal-hint { color: var(--terracotta-ink); }
.cal-loaded-head { font-size: 12px; color: var(--ink3); padding: 2px 0; }
.cal-loaded { border: 1px solid var(--rule); border-radius: var(--r8); max-height: 260px; overflow-y: auto; }
.cal-empty { padding: 16px; text-align: center; color: var(--ink4); font-size: 12px; }
.cal-year { padding: 6px 12px; background: var(--head-band-strong); color: var(--ink-inverse); font-size: 11px; font-weight: 600; position: sticky; top: 0; }
.cal-row { display: grid; grid-template-columns: 104px 1fr auto; gap: 10px; align-items: center; padding: 7px 12px; border-top: 1px solid var(--rule); font-size: 12px; }
.cal-row-date { font-family: var(--mono); color: var(--ink3); }
.cal-row-name { color: var(--ink); }
.cal-del { border: none; background: none; color: var(--ink4); cursor: pointer; font-size: 13px; padding: 2px 6px; border-radius: var(--r6); }
.cal-del:hover { background: var(--terracotta-chip); color: var(--terracotta-ink); }
.time-range { display: flex; align-items: center; gap: 8px; }
.time-range input { flex: 1; }
.time-range span { color: var(--ink3); font-family: var(--mono); font-size: 11px; }
.day-pills { display: flex; gap: 4px; }
.day-pill { padding: 5px 10px; background: var(--surface2); border: 1px solid var(--rule); border-radius: var(--r6); font-size: 12px; color: var(--ink2); cursor: pointer; transition: all .15s; min-width: 32px; }
.day-pill.on { background: var(--sage-500); color: var(--ink-inverse); border-color: var(--sage-500); font-weight: 500; }
.day-pill:hover:not(.on) { background: var(--stone-100); }
.sync-status { display: flex; align-items: center; gap: 10px; padding: 12px 14px; background: var(--sage-50); border: 1px solid var(--sage-200); border-radius: var(--r8); margin-bottom: 14px; }
.sync-status.error { background: var(--terracotta-l); border-color: var(--terracotta); }
.sync-pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--sage-500); box-shadow: 0 0 0 4px rgba(74,124,92,.2); animation: pulse 2s infinite; flex-shrink: 0; }
.sync-status.error .sync-pulse { background: var(--terracotta); box-shadow: 0 0 0 4px rgba(196,99,62,.2); }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 4px rgba(74,124,92,.2); } 50% { box-shadow: 0 0 0 8px rgba(74,124,92,.05); } }
.sync-status-text { flex: 1; font-size: 12.5px; }
.sync-status-text b { color: var(--sage-700); font-weight: 600; }
.sync-status.error b { color: var(--terracotta); }
.sync-status-time { font-family: var(--mono); font-size: 11px; color: var(--ink3); }

/* ─── MODAL ─── */
.modal-overlay { position: fixed; inset: 0; background: rgba(26,22,18,.5); z-index: var(--z-modal); display: none; align-items: center; justify-content: center; backdrop-filter: blur(2px); }
.modal-overlay.open { display: flex; animation: fadeIn .15s ease both; }
.modal { background: var(--surface); border-radius: var(--r16); width: 540px; max-width: calc(100vw - 32px); max-height: 85vh; overflow: hidden; box-shadow: var(--shadow-lg); display: flex; flex-direction: column; animation: modalIn .2s ease both; }
@keyframes modalIn { from { transform: scale(0.97); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.modal-head { display: flex; align-items: center; gap: 10px; padding: 18px 20px; border-bottom: 1px solid var(--rule); }
.modal-head h3 { font-size: 16px; font-weight: 600; flex: 1; }
.modal-close { background: none; border: none; color: var(--ink3); font-size: 20px; padding: 2px 8px; border-radius: var(--r6); }
.modal-close:hover { background: var(--surface2); }
.modal-body { padding: 18px 20px; overflow-y: auto; }
.modal-foot { padding: 14px 20px; border-top: 1px solid var(--rule); display: flex; gap: 8px; justify-content: flex-end; background: var(--surface2); }

/* Forms in modal */
.form-field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; }
.form-field label { font-size: 11px; color: var(--ink3); font-family: var(--mono); letter-spacing: .04em; text-transform: uppercase; font-weight: 500; }
.form-field input, .form-field select, .form-field textarea { padding: 8px 10px; border: 1px solid var(--rule); border-radius: var(--r8); background: var(--surface2); outline: none; font-size: 13px; transition: all .15s; }
.form-field input:focus, .form-field select:focus, .form-field textarea:focus { border-color: var(--sage-500); background: var(--surface); box-shadow: 0 0 0 3px rgba(74,124,92,.1); }
.form-field textarea { resize: vertical; min-height: 60px; font-family: var(--sans); line-height: 1.6; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
/* M2 表單改造：實際執行反向摺疊（DOM 永在、CSS 收合；new 預設收起、edit 預設展開） */
.form-collapse { border: 1px solid var(--rule); border-radius: var(--r8); margin-bottom: 12px; }
.form-collapse-head { display: flex; align-items: center; gap: 6px; padding: 8px 10px; cursor: pointer; font-size: 11px; color: var(--ink3); font-family: var(--mono); letter-spacing: .04em; text-transform: uppercase; font-weight: 500; user-select: none; }
.form-collapse-chevron { display: inline-block; transition: transform .15s; }
.form-collapse.open .form-collapse-chevron { transform: rotate(90deg); }
.form-collapse .collapse-body { display: none; padding: 0 10px 4px; }
.form-collapse.open .collapse-body { display: block; }

/* M2-§6.4：前置任務結構化（每條 = 三欄垂直堆疊卡片：接在誰後 / 銜接方式 / 緩衝天數） */
#tf-pred-list { display: flex; flex-direction: column; gap: var(--r8); }
.pred-row { display: flex; flex-direction: column; gap: var(--r8); padding: var(--r10); border: 1px solid var(--rule); border-radius: var(--r8); background: var(--surface); }
.pred-field { display: flex; flex-direction: column; gap: var(--r4); }
/* 彩色 label（info 色族，比照 .tip 的 --slate-ink）+ 行內 emoji icon */
.pred-field-label { font-size: 12px; font-weight: 500; color: var(--slate-ink); }
.pred-field-line { display: flex; align-items: center; gap: var(--r6); }
.pred-field-line .pred-search { flex: 1 1 auto; min-width: 0; }
.pred-row .pred-search, .pred-row .pred-rel, .pred-row .pred-lag { height: 36px; padding: 0 var(--r8); }
.pred-row .pred-lag { width: 96px; }
/* 刪鈕：比照 .dept-member-chip button（無框/透明/ink4，hover rose） */
.pred-del { flex: 0 0 auto; border: none; background: none; cursor: pointer; color: var(--ink4); font-size: 14px; line-height: 1; padding: 0 var(--r4); }
.pred-del:hover { color: var(--rose); }
/* 加列：text-link（比照 .pdca-expand-btn 慣例） */
.pred-add { margin-top: var(--r6); border: none; background: none; cursor: pointer; color: var(--sage-700); font-size: 12px; padding: 2px 0; }
.pred-add:hover { text-decoration: underline; }
/* 常駐說明小字（前置欄三 / 總說明 / 類型·緊急·狀態 共用，單一定義） */
.field-hint { font-size: 11px; color: var(--ink3); line-height: 1.5; }
.pred-intro { margin-bottom: var(--r4); }

/* 2-A：預計開始「自動／手動」雙態（data-mode 顯隱對應子區塊） */
.startmode { display: flex; flex-direction: column; gap: var(--r4); }
.startmode[data-mode="auto"] .startmode-manual { display: none; }
.startmode[data-mode="manual"] .startmode-auto { display: none; }
.startmode-auto, .startmode-manual { display: flex; flex-direction: column; gap: var(--r4); }
/* 自動態：灰底唯讀顯示列 */
.startmode-display { display: flex; align-items: center; gap: var(--r6); height: 36px; padding: 0 var(--r8); border: 1px solid var(--rule); border-radius: var(--r8); background: var(--surface2); }
/* 「自動」badge：比照 .tag-meeting 的 slate（info）配對 */
.startmode-badge { font-size: 11px; font-weight: 500; color: var(--slate-ink); background: var(--slate-l); padding: 2px var(--r6); border-radius: var(--r6); }
.startmode-value { font-size: 13px; color: var(--ink3); }
.startmode-manual-line { display: flex; align-items: center; gap: var(--r6); }
.startmode-manual-line input { flex: 1 1 auto; min-width: 0; height: 36px; padding: 0 var(--r8); }
/* 切換鈕：text-link（比照 .pred-add 慣例） */
.startmode-switch { flex: 0 0 auto; border: none; background: none; cursor: pointer; color: var(--sage-700); font-size: 12px; padding: 2px 0; white-space: nowrap; }
.startmode-switch:hover { text-decoration: underline; }

/* 計量方式切換（第27項，殼）：總開關在表單頂，data-measure 放 .task-form 遙控下方分散欄位 */
.task-form[data-measure="duration"] .mg-hours { display: none; }
.task-form[data-measure="hours"] .mg-duration { display: none; }
.task-form[data-measure="hours"] .dur-only { display: none; }
.task-form[data-measure="hours"] .measure-btn[data-measure="duration"] { display: none; }
.measure-toggle { display: flex; gap: 1px; background: var(--surface2); padding: 2px; border-radius: var(--r8); margin-bottom: 12px; }
.measure-btn { flex: 1; padding: 6px; background: none; border: 2px solid transparent; border-radius: var(--r6); font-size: 12px; color: var(--ink3); font-weight: 500; cursor: pointer; }
.measure-btn.active {
  background: var(--sage-50);
  color: var(--sage-700);
  border: 2px solid var(--sage-600);
  font-weight: 500;
}

/* Color picker */
.color-picker { display: flex; gap: 6px; flex-wrap: wrap; }
.cp-swatch { width: 28px; height: 28px; border-radius: 50%; cursor: pointer; border: 2px solid transparent; transition: transform .1s; }
.cp-swatch.on { border-color: var(--ink); transform: scale(1.1); }

/* Urgent modal rows */
.urgent-row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--r8); background: var(--terracotta-l); margin-bottom: 6px; border-left: 3px solid var(--terracotta); cursor: pointer; }
.urgent-row:hover { background: var(--terracotta-l-hover); }
.urgent-row .u-name { font-weight: 500; flex: 1; font-size: 13px; }
.urgent-row .u-deadline { font-family: var(--mono); font-size: 11px; color: var(--terracotta); font-weight: 600; }
.urgent-row .u-proj { font-size: 10.5px; font-family: var(--mono); background: rgba(196,99,62,.15); padding: 2px 7px; border-radius: 99px; color: var(--terracotta); }

/* ─── PDCA REPORT ─── */
.pdca-toolbar { display: flex; justify-content: flex-end; margin-bottom: 14px; }
.pdca-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.pdca-tab { display: inline-flex; align-items: center; gap: 7px; padding: 8px 14px; background: var(--surface2); border: 1px solid var(--rule); border-radius: var(--r8); font-size: 13px; color: var(--ink2); cursor: pointer; transition: background .15s; }
.pdca-tab:hover { background: var(--stone-100); }
.pdca-tab.active { background: var(--surface); border-color: var(--sage-500); color: var(--ink); font-weight: 600; }
.pdca-tab-dot { width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; }
.pdca-tab-light { font-size: 13px; }
.pdca-panel { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r12); padding: 20px; }
.pdca-timeline { display: flex; gap: 16px; margin-bottom: 16px; }
.pdca-field { flex: 1; }
.pdca-field label { display: block; font-size: 12px; font-weight: 600; color: var(--ink2); margin-bottom: 6px; }
.pdca-field input { width: 100%; box-sizing: border-box; border: 1px solid var(--rule); border-radius: var(--r6); padding: 7px 10px; font-size: 13px; font-family: var(--sans); color: var(--ink); outline: none; }
.pdca-field input:focus { border-color: var(--sage-500); }
.pdca-stats { margin-bottom: 16px; }
.pdca-stats .stat[title] { cursor: help; }
.pdca-stats .stat-formula { font-size: 9.5px; color: var(--ink3); margin-top: 3px; line-height: 1.3; }
.pdca-summary label { display: block; font-size: 12px; font-weight: 600; color: var(--ink2); margin-bottom: 6px; }
.pdca-summary textarea { width: 100%; box-sizing: border-box; border: 1px solid var(--rule); border-radius: var(--r6); padding: 8px 10px; font-size: 13px; font-family: var(--sans); color: var(--ink); resize: vertical; outline: none; line-height: 1.5; }
.pdca-summary textarea:focus { border-color: var(--sage-500); }
.pdca-groups { margin-top: 20px; }
.pdca-groups-head { font-size: 13px; font-weight: 600; color: var(--ink2); margin-bottom: 10px; }
.pdca-no-groups { font-size: 12px; color: var(--ink3); }
.pdca-group { border: 1px solid var(--rule); border-radius: var(--r8); padding: 12px 14px; margin-bottom: 10px; background: var(--surface2); }
.pdca-group-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.pdca-group-light { font-size: 15px; }
.pdca-group-name { font-weight: 600; font-size: 14px; color: var(--ink); flex: 1; min-width: 0; }
.pdca-group-progress { font-family: var(--mono); font-size: 12px; color: var(--ink2); background: var(--surface); padding: 2px 8px; border-radius: 99px; white-space: nowrap; }
.pdca-group-hint { font-size: 11.5px; color: var(--ink3); padding: 2px 0 8px; }
.pdca-group-meta { display: flex; flex-wrap: wrap; gap: 10px 14px; margin-bottom: 8px; }
.pdca-group-meta label { display: flex; flex-direction: column; font-size: 11px; font-weight: 600; color: var(--ink2); gap: 4px; }
.pdca-group-meta .pgm-recovery, .pdca-group-meta .pgm-work, .pdca-group-meta .pgm-reason { flex: 1 1 100%; }
.pdca-group-meta .pgm-affect { flex-direction: row; align-items: center; gap: 6px; }
.pdca-group-meta .pgm-affect input { min-width: 0; width: auto; }
.pdca-group-meta select, .pdca-group-meta input, .pdca-group-meta textarea { font-size: 12px; font-weight: 400; border: 1px solid var(--rule); border-radius: var(--r6); padding: 5px 8px; font-family: var(--sans); color: var(--ink); background: var(--surface); outline: none; box-sizing: border-box; }
.pdca-group-meta input { min-width: 130px; }
.pdca-group-meta textarea { resize: vertical; width: 100%; line-height: 1.4; }
.pdca-group-meta select:focus, .pdca-group-meta input:focus, .pdca-group-meta textarea:focus { border-color: var(--sage-500); }
.pdca-expand-btn { font-size: 11.5px; color: var(--sage-700); background: none; border: none; cursor: pointer; padding: 2px 0; }
.pdca-expand-btn:hover { text-decoration: underline; }
.pdca-subtasks { display: none; margin-top: 8px; border-top: 1px solid var(--rule); padding-top: 8px; }
.pdca-subtasks.open { display: block; }
.pdca-subtask { display: flex; align-items: center; gap: 10px; padding: 4px 0; }
.pst-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; color: var(--ink); }
.pst-deadline { font-family: var(--mono); font-size: 11px; color: var(--ink3); min-width: 84px; text-align: right; }
.pst-deadline.overdue { color: var(--terracotta); font-weight: 600; }
.pst-status { font-size: 11px; color: var(--ink2); min-width: 48px; }
.pst-owner { font-size: 11px; color: var(--ink3); min-width: 52px; }
.pst-regroup { font-size: 11px; font-family: var(--sans); color: var(--ink); background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r6); padding: 3px 6px; max-width: 140px; outline: none; cursor: pointer; }
.pst-regroup:focus { border-color: var(--sage-500); }
.pst-empty { font-size: 11px; color: var(--ink3); }

/* ─── TOOLTIP(data-tip 委派,JS 見 initTooltip)─── */
.pm-tooltip { position: fixed; max-width: 320px; padding: 8px 12px; background: var(--sage-800); color: var(--ink-inverse); border-radius: var(--r6); box-shadow: var(--shadow-lg); font-size: 12px; line-height: 1.6; z-index: var(--z-tooltip); pointer-events: none; opacity: 0; transition: opacity .12s ease; }
.pm-tooltip.show { opacity: 1; }
.pm-tooltip-title { font-weight: 600; color: var(--sage-200); padding-bottom: 4px; margin-bottom: 4px; border-bottom: 1px solid rgba(255,255,255,.18); } /* 分隔線 rgba 為合理例外:變數無法帶 alpha */
.pm-tooltip-body { white-space: pre-line; }

/* ─── TOAST ─── */
.toast-container { position: fixed; bottom: 24px; right: 24px; z-index: var(--z-toast); display: flex; flex-direction: column; gap: 8px; }
.toast { padding: 12px 18px; background: var(--surface); border: 1px solid var(--rule); border-left: 4px solid var(--sage-500); border-radius: var(--r8); box-shadow: var(--shadow-lg); font-size: 13px; min-width: 240px; animation: toastIn .25s ease both; }
.toast.error { border-left-color: var(--terracotta); }
.toast.warning { border-left-color: var(--amber); }
@keyframes toastIn { from { transform: translateX(20px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* ─── SCROLLBAR ─── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-thumb { background: var(--rule2); border-radius: 99px; }
::-webkit-scrollbar-track { background: transparent; }

/* ─── PRINT ─── */
@media print {
  .sidebar, .topbar, .report-toolbar { display: none !important; }
  body { background: white; }
  .app { grid-template-columns: 1fr; }
  .content { padding: 0; }
  .page { display: block !important; }
  #page-report ~ .page:not(#page-report) { display: none !important; }
}

@media (max-width: 980px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; }
  .dash-grid, .proj-grid, .proj-dash-grid { grid-template-columns: 1fr; }
  .report-summary { grid-template-columns: repeat(2, 1fr); }
}

/* ── D-2c-3 部門擔當表 ───────────────── */
.dept-edit-list { display: flex; flex-direction: column; gap: var(--r8); }

.dept-edit-row {
  display: flex; align-items: center; flex-wrap: wrap; gap: var(--r6);
  padding: var(--r8); border: 1px solid var(--rule);
  border-radius: var(--r8); background: var(--surface2);
}

.dept-edit-name {
  flex: 1 1 160px; padding: var(--r4) var(--r6);
  border: 1px solid var(--rule2); border-radius: var(--r4);
  background: var(--surface); color: var(--ink); font: inherit;
}

.dept-edit-members {
  display: flex; align-items: center; flex-wrap: wrap; gap: var(--r6);
  flex: 2 1 240px;
}

.dept-member-chip {
  display: inline-flex; align-items: center; gap: var(--r4);
  padding: var(--r4) var(--r8); border-radius: 99px;
  background: var(--surface); border: 1px solid var(--rule);
  color: var(--ink2); font-size: 13px;
}
.dept-member-chip button {
  border: none; background: none; cursor: pointer;
  color: var(--ink4); padding: 0; line-height: 1; font-size: 14px;
}
.dept-member-chip button:hover { color: var(--rose); }

.dept-member-add {
  padding: var(--r4) var(--r8); border-radius: 99px;
  border: 1px dashed var(--rule2); background: none;
  color: var(--ink3); cursor: pointer; font-size: 13px;
}
.dept-member-add:hover { border-color: var(--sage-400); color: var(--sage-600); }

.dept-edit-del:hover { color: var(--rose); }

/* ── D-2d-3 刪部門改派彈窗 ───────────── */
.reassign-list {
  display: flex; flex-direction: column; gap: var(--r6);
  max-height: 50vh; overflow-y: auto;
}
.reassign-row {
  display: flex; align-items: center; gap: var(--r8);
  padding: var(--r6) var(--r8); border-radius: var(--r6);
  background: var(--surface2);
}
.reassign-task { flex: 1 1 auto; font-size: 14px; color: var(--ink); }
.reassign-select {
  flex: 0 0 auto; min-width: 120px;
  padding: var(--r4) var(--r6);
  border: 1px solid var(--rule2); border-radius: var(--r4);
  background: var(--surface); color: var(--ink); font: inherit;
}
