/* ============================================================
   团队任务管理器 — Notion 模板风格
   ============================================================ */

/* ---------- 设计令牌 ---------- */
:root {
  --bg: #ffffff;
  --bg-sidebar: #f7f7f5;
  --bg-column: #f7f7f5;
  --bg-card: #ffffff;
  --bg-hover: rgba(55, 53, 47, 0.06);
  --bg-active: rgba(55, 53, 47, 0.1);
  --bg-input: #ffffff;

  --text: #37352f;
  --text-secondary: #787774;
  --text-faint: #9b9a97;

  --border: rgba(55, 53, 47, 0.14);
  --border-soft: rgba(55, 53, 47, 0.08);
  --card-shadow: rgba(15, 15, 15, 0.06) 0 0 0 1px, rgba(15, 15, 15, 0.06) 0 2px 4px;
  --card-shadow-hover: rgba(15, 15, 15, 0.1) 0 0 0 1px, rgba(15, 15, 15, 0.12) 0 4px 10px;
  --modal-shadow: rgba(15, 15, 15, 0.08) 0 0 0 1px, rgba(15, 15, 15, 0.15) 0 8px 32px;

  --accent: #2383e2;
  --accent-soft: rgba(35, 131, 226, 0.12);
  --danger: #d44c47;

  /* Notion 标签色 — 优先级 */
  --chip-urgent-bg: #ffe2dd;  --chip-urgent-fg: #5d1715;
  --chip-high-bg:   #fadec9;  --chip-high-fg:   #49290e;
  --chip-medium-bg: #fdecc8;  --chip-medium-fg: #402c1b;
  --chip-low-bg:    #dbeddb;  --chip-low-fg:    #1c3829;

  /* Notion 标签色 — 状态 */
  --st-todo-bg:       #e3e2e0; --st-todo-fg:       #32302c;
  --st-inprogress-bg: #d3e5ef; --st-inprogress-fg: #183347;
  --st-review-bg:     #e8deee; --st-review-fg:     #412454;
  --st-done-bg:       #dbeddb; --st-done-fg:       #1c3829;

  --overdue: #d44c47;
  --due-soon: #d9730d;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #191919;
    --bg-sidebar: #202020;
    --bg-column: #202020;
    --bg-card: #262626;
    --bg-hover: rgba(255, 255, 255, 0.055);
    --bg-active: rgba(255, 255, 255, 0.09);
    --bg-input: #2c2c2c;

    --text: #d4d4d4;
    --text-secondary: #9b9b9b;
    --text-faint: #6f6f6f;

    --border: rgba(255, 255, 255, 0.14);
    --border-soft: rgba(255, 255, 255, 0.07);
    --card-shadow: rgba(255, 255, 255, 0.075) 0 0 0 1px;
    --card-shadow-hover: rgba(255, 255, 255, 0.14) 0 0 0 1px, rgba(0, 0, 0, 0.3) 0 4px 10px;
    --modal-shadow: rgba(255, 255, 255, 0.1) 0 0 0 1px, rgba(0, 0, 0, 0.5) 0 8px 32px;

    --accent: #529cca;
    --accent-soft: rgba(82, 156, 202, 0.16);
    --danger: #df5452;

    --chip-urgent-bg: #522e2a;  --chip-urgent-fg: #ffc9c2;
    --chip-high-bg:   #49290e;  --chip-high-fg:   #fdd8b5;
    --chip-medium-bg: #402c1b;  --chip-medium-fg: #fce8b3;
    --chip-low-bg:    #243d30;  --chip-low-fg:    #b7dfc7;

    --st-todo-bg:       #373737; --st-todo-fg:       #cfcfcf;
    --st-inprogress-bg: #1f3a4d; --st-inprogress-fg: #b3d7ef;
    --st-review-bg:     #3b2b4d; --st-review-fg:     #dcc7f0;
    --st-done-bg:       #243d30; --st-done-fg:       #b7dfc7;

    --overdue: #ff8a85;
    --due-soon: #f0a35e;
  }
}

/* 手动主题切换覆盖系统偏好(两个方向都要赢) */
:root[data-theme="light"] {
  --bg: #ffffff; --bg-sidebar: #f7f7f5; --bg-column: #f7f7f5; --bg-card: #ffffff;
  --bg-hover: rgba(55, 53, 47, 0.06); --bg-active: rgba(55, 53, 47, 0.1); --bg-input: #ffffff;
  --text: #37352f; --text-secondary: #787774; --text-faint: #9b9a97;
  --border: rgba(55, 53, 47, 0.14); --border-soft: rgba(55, 53, 47, 0.08);
  --card-shadow: rgba(15, 15, 15, 0.06) 0 0 0 1px, rgba(15, 15, 15, 0.06) 0 2px 4px;
  --card-shadow-hover: rgba(15, 15, 15, 0.1) 0 0 0 1px, rgba(15, 15, 15, 0.12) 0 4px 10px;
  --modal-shadow: rgba(15, 15, 15, 0.08) 0 0 0 1px, rgba(15, 15, 15, 0.15) 0 8px 32px;
  --accent: #2383e2; --accent-soft: rgba(35, 131, 226, 0.12); --danger: #d44c47;
  --chip-urgent-bg: #ffe2dd;  --chip-urgent-fg: #5d1715;
  --chip-high-bg:   #fadec9;  --chip-high-fg:   #49290e;
  --chip-medium-bg: #fdecc8;  --chip-medium-fg: #402c1b;
  --chip-low-bg:    #dbeddb;  --chip-low-fg:    #1c3829;
  --st-todo-bg:       #e3e2e0; --st-todo-fg:       #32302c;
  --st-inprogress-bg: #d3e5ef; --st-inprogress-fg: #183347;
  --st-review-bg:     #e8deee; --st-review-fg:     #412454;
  --st-done-bg:       #dbeddb; --st-done-fg:       #1c3829;
  --overdue: #d44c47; --due-soon: #d9730d;
}

:root[data-theme="dark"] {
  --bg: #191919; --bg-sidebar: #202020; --bg-column: #202020; --bg-card: #262626;
  --bg-hover: rgba(255, 255, 255, 0.055); --bg-active: rgba(255, 255, 255, 0.09); --bg-input: #2c2c2c;
  --text: #d4d4d4; --text-secondary: #9b9b9b; --text-faint: #6f6f6f;
  --border: rgba(255, 255, 255, 0.14); --border-soft: rgba(255, 255, 255, 0.07);
  --card-shadow: rgba(255, 255, 255, 0.075) 0 0 0 1px;
  --card-shadow-hover: rgba(255, 255, 255, 0.14) 0 0 0 1px, rgba(0, 0, 0, 0.3) 0 4px 10px;
  --modal-shadow: rgba(255, 255, 255, 0.1) 0 0 0 1px, rgba(0, 0, 0, 0.5) 0 8px 32px;
  --accent: #529cca; --accent-soft: rgba(82, 156, 202, 0.16); --danger: #df5452;
  --chip-urgent-bg: #522e2a;  --chip-urgent-fg: #ffc9c2;
  --chip-high-bg:   #49290e;  --chip-high-fg:   #fdd8b5;
  --chip-medium-bg: #402c1b;  --chip-medium-fg: #fce8b3;
  --chip-low-bg:    #243d30;  --chip-low-fg:    #b7dfc7;
  --st-todo-bg:       #373737; --st-todo-fg:       #cfcfcf;
  --st-inprogress-bg: #1f3a4d; --st-inprogress-fg: #b3d7ef;
  --st-review-bg:     #3b2b4d; --st-review-fg:     #dcc7f0;
  --st-done-bg:       #243d30; --st-done-fg:       #b7dfc7;
  --overdue: #ff8a85; --due-soon: #f0a35e;
}

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

/* hidden 属性必须能盖过 .modal-overlay / .board / .member-view 的 display:flex */
[hidden] { display: none !important; }

html, body { height: 100%; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
input, select, textarea { font: inherit; color: var(--text); }

button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* ---------- 应用框架 ---------- */
.app {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* ---------- 侧栏 ---------- */
.sidebar {
  width: 240px;
  flex-shrink: 0;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-soft);
  display: flex;
  flex-direction: column;
  padding: 12px 8px;
  gap: 14px;
  overflow: hidden;
}

.ws-title {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  font-weight: 600;
  font-size: 14px;
}

.ws-icon { font-size: 18px; }

.side-label {
  padding: 0 10px 4px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.side-nav, .side-section { display: flex; flex-direction: column; gap: 1px; }

.ws-title,
.side-nav,
.side-footer {
  flex-shrink: 0;
}

.side-section {
  flex: 1;
  min-height: 0;
}

.side-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 14px;
  color: var(--text-secondary);
  text-align: left;
  transition: background 0.1s;
}

.side-item:hover { background: var(--bg-hover); }
.side-item.active { background: var(--bg-active); color: var(--text); font-weight: 500; }
.side-emoji { width: 20px; text-align: center; flex-shrink: 0; }

/* 成员列表 */
.member-list { display: flex; flex-direction: column; gap: 1px; }

.member-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 5px 10px;
  border-radius: 6px;
  color: var(--text-secondary);
  text-align: left;
  transition: background 0.1s;
}

.member-item:hover { background: var(--bg-hover); }
.member-item.active { background: var(--accent-soft); color: var(--text); }

.member-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.member-count {
  font-size: 12px;
  color: var(--text-faint);
  font-variant-numeric: tabular-nums;
}

.avatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 600;
  color: #fff;
}

.side-footer { margin-top: 0; border-top: 1px solid var(--border-soft); padding-top: 8px; }

/* ---------- 主区 ---------- */
.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.page-head { padding: 36px 40px 0; }

.page-title {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

.page-emoji { font-size: 34px; }

.page-sub { margin-top: 6px; color: var(--text-secondary); font-size: 14px; }

/* 统计条 */
.stat-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.stat-chip {
  display: flex;
  align-items: baseline;
  gap: 7px;
  padding: 8px 14px;
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  background: var(--bg-card);
}

.stat-num {
  font-size: 20px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.stat-num.is-overdue { color: var(--overdue); }
.stat-label { font-size: 12px; color: var(--text-secondary); }

/* ---------- 工具栏 ---------- */
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding: 18px 40px 12px;
  border-bottom: 1px solid var(--border-soft);
}

.view-tabs { display: flex; gap: 2px; }

.view-tab {
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 14px;
  color: var(--text-secondary);
  transition: background 0.1s;
}

.view-tab:hover { background: var(--bg-hover); }
.view-tab.active {
  color: var(--text);
  font-weight: 500;
  box-shadow: inset 0 -2px 0 var(--text);
  border-radius: 6px 6px 0 0;
}

.toolbar-right { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.search-input {
  width: 200px;
  padding: 5px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg-input);
  font-size: 13px;
}

.search-input::placeholder { color: var(--text-faint); }

.select-filter, .field select, .field input[type="date"] {
  padding: 5px 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg-input);
  font-size: 13px;
  cursor: pointer;
}

.primary-btn {
  padding: 6px 14px;
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  font-size: 13.5px;
  font-weight: 500;
  transition: opacity 0.1s;
}

.primary-btn:hover { opacity: 0.88; }

.ghost-btn {
  padding: 6px 12px;
  border-radius: 6px;
  color: var(--text-secondary);
  font-size: 13.5px;
  transition: background 0.1s;
}

.ghost-btn:hover { background: var(--bg-hover); }

.danger-btn {
  padding: 6px 12px;
  border-radius: 6px;
  color: var(--danger);
  font-size: 13.5px;
}

.danger-btn:hover { background: rgba(212, 76, 71, 0.1); }

.icon-btn {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  color: var(--text-faint);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.icon-btn:hover { background: var(--bg-hover); color: var(--text); }

.filter-notice {
  margin: 10px 40px 0;
  padding: 6px 12px;
  border-radius: 6px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 13px;
  width: fit-content;
}

/* ---------- 看板 ---------- */
.board {
  flex: 1;
  display: flex;
  gap: 16px;
  padding: 20px 40px 32px;
  overflow-x: auto;
  align-items: flex-start;
}

.board-col {
  width: 280px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 100%;
}

.col-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 2px 4px;
  position: sticky;
  top: 0;
}

.col-chip {
  padding: 2px 10px;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 500;
}

.col-count {
  color: var(--text-faint);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.col-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 60px;
  border-radius: 8px;
  padding: 2px;
  overflow-y: auto;
  transition: background 0.15s;
}

.col-body.drag-over { background: var(--accent-soft); }

.col-empty {
  padding: 14px 10px;
  color: var(--text-faint);
  font-size: 13px;
  text-align: center;
  border: 1px dashed var(--border);
  border-radius: 8px;
}

/* ---------- 任务卡片 ---------- */
.task-card {
  background: var(--bg-card);
  border-radius: 8px;
  box-shadow: var(--card-shadow);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  cursor: pointer;
  transition: box-shadow 0.12s;
}

.task-card:hover { box-shadow: var(--card-shadow-hover); }
.task-card.dragging { opacity: 0.4; }

.card-title { font-size: 14px; font-weight: 500; line-height: 1.4; }
.card-title.is-done { text-decoration: line-through; color: var(--text-faint); }

.card-desc {
  font-size: 12.5px;
  color: var(--text-secondary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }

.chip {
  padding: 1px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}

.chip-urgent { background: var(--chip-urgent-bg); color: var(--chip-urgent-fg); }
.chip-high   { background: var(--chip-high-bg);   color: var(--chip-high-fg); }
.chip-medium { background: var(--chip-medium-bg); color: var(--chip-medium-fg); }
.chip-low    { background: var(--chip-low-bg);    color: var(--chip-low-fg); }

.chip-todo       { background: var(--st-todo-bg);       color: var(--st-todo-fg); }
.chip-inprogress { background: var(--st-inprogress-bg); color: var(--st-inprogress-fg); }
.chip-review     { background: var(--st-review-bg);     color: var(--st-review-fg); }
.chip-done       { background: var(--st-done-bg);       color: var(--st-done-fg); }

.due {
  font-size: 12px;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.due.is-overdue { color: var(--overdue); font-weight: 600; }
.due.is-soon { color: var(--due-soon); font-weight: 500; }

.card-foot { display: flex; align-items: center; gap: 8px; }

.card-foot .avatar { width: 20px; height: 20px; font-size: 10px; }
.assignee-name { font-size: 12px; color: var(--text-secondary); flex: 1; }

/* 进度条 */
.progress-track {
  height: 4px;
  border-radius: 2px;
  background: var(--bg-active);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: 2px;
  background: var(--accent);
  transition: width 0.2s;
}

.progress-fill.is-done { background: #448361; }

.progress-num {
  font-size: 11px;
  color: var(--text-faint);
  font-variant-numeric: tabular-nums;
}

/* ---------- 按成员视图 ---------- */
.member-view {
  flex: 1;
  overflow-y: auto;
  padding: 20px 40px 40px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.organization-view {
  flex: 1;
  overflow-y: auto;
  padding: 20px 40px 56px;
  display: flex;
  flex-direction: column;
  gap: 28px;
  scroll-padding-bottom: 56px;
}

.projects-view {
  flex: 1;
  overflow-y: auto;
  padding: 20px 40px 40px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.budget-view {
  flex: 1;
  overflow-y: auto;
  padding: 20px 40px 40px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.worktime-view {
  flex: 1;
  overflow-y: auto;
  padding: 20px 40px 40px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.analysis-view {
  flex: 1;
  overflow-y: auto;
  padding: 20px 40px 40px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.org-summary-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.org-summary-card,
.org-panel,
.org-detail-card {
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  box-shadow: var(--card-shadow);
}

.org-summary-card {
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.org-summary-num {
  font-size: 28px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.org-summary-label {
  font-size: 14px;
  font-weight: 600;
}

.org-summary-sub,
.org-panel-sub,
.org-detail-sub {
  color: var(--text-secondary);
  font-size: 12.5px;
}

.org-flow-card {
  background: #1f2430;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  box-shadow: var(--card-shadow);
  overflow: hidden;
  height: min(620px, calc(100vh - 230px));
  min-height: 520px;
  display: flex;
  flex-direction: column;
}

.org-flow-card.is-expanded {
  position: fixed;
  inset: 18px;
  z-index: 180;
  height: auto;
  min-height: 0;
  border-radius: 14px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.48);
}

.org-flow-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  padding: 18px 20px 12px;
  color: #f4f7fb;
}

.org-flow-head .org-panel-sub {
  color: rgba(244, 247, 251, 0.62);
}

.org-flow-legend {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  color: rgba(244, 247, 251, 0.68);
  font-size: 12px;
}

.org-flow-tools {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
}

.org-flow-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.org-flow-control {
  min-width: 34px;
  height: 30px;
  padding: 0 10px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.08);
  color: #f4f7fb;
  font-size: 12px;
  font-weight: 600;
}

.org-flow-control:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.28);
}

.org-flow-control.is-primary {
  background: #529cca;
  border-color: #529cca;
  color: #fff;
}

.org-flow-zoom-val {
  min-width: 46px;
  color: rgba(244, 247, 251, 0.78);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  text-align: center;
}

.org-flow-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.org-flow-legend i {
  width: 18px;
  height: 3px;
  border-radius: 999px;
}

.org-flow-scroll {
  flex: 1;
  overflow: auto;
  padding: 14px 22px 24px;
  scrollbar-color: rgba(255, 255, 255, 0.24) transparent;
  min-height: 0;
  cursor: grab;
  user-select: none;
  touch-action: none;
}

.org-flow-scroll.is-dragging {
  cursor: grabbing;
}

.org-flow-stage {
  position: relative;
  min-width: 100%;
  min-height: 100%;
}

.org-flow-canvas {
  position: relative;
  min-width: 100%;
  transform-origin: left top;
  border-radius: 10px;
  background:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    #1f2430;
  background-size: 28px 28px;
}

.org-flow-card.is-expanded .org-flow-scroll {
  min-height: 0;
  padding: 12px 24px 24px;
}

.org-flow-svg {
  position: absolute;
  inset: 0;
  overflow: visible;
  pointer-events: none;
}

.org-flow-path {
  fill: none;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.92;
  filter: drop-shadow(0 0 7px rgba(95, 168, 255, 0.28));
}

.org-flow-label {
  font-size: 11px;
  font-weight: 700;
  paint-order: stroke;
  stroke: #1f2430;
  stroke-width: 4px;
  stroke-linejoin: round;
}

.org-flow-node {
  position: absolute;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 8px;
  padding: 14px 16px;
  border-radius: 8px;
  background: #10151d;
  color: #eef4ff;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.24);
  text-align: left;
  overflow: hidden;
}

button.org-flow-node {
  transition: border-color 0.12s, background 0.12s, transform 0.12s;
}

button.org-flow-node:hover {
  background: #151c27;
  border-color: rgba(95, 168, 255, 0.48);
  transform: translateY(-1px);
}

.org-flow-node.active {
  border-color: #b56cff;
  box-shadow: 0 0 0 1px rgba(181, 108, 255, 0.34), 0 14px 32px rgba(0, 0, 0, 0.3);
}

.org-flow-root {
  background: #123252;
  border-color: rgba(95, 168, 255, 0.26);
}

.org-flow-top {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  width: 100%;
}

.org-flow-dot {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #5fa8ff, #b56cff);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
}

.org-flow-main {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
  font-weight: 700;
}

.org-flow-sub,
.org-flow-code {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: rgba(238, 244, 255, 0.68);
  font-size: 12px;
  line-height: 1.45;
  width: 100%;
}

.org-flow-code {
  color: #6ee7d8;
}

.organization-layout {
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  gap: 22px;
  height: min(760px, calc(100vh - 190px));
  min-height: 620px;
  align-items: stretch;
}

.projects-layout {
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  gap: 18px;
  min-height: 520px;
}

.org-panel {
  min-height: 0;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.org-panel-detail {
  gap: 16px;
}

.organization-view .org-panel {
  overflow: hidden;
}

.organization-view .org-panel-detail {
  overflow-y: auto;
  padding-right: 12px;
}

.org-panel-head,
.org-detail-head {
  flex-shrink: 0;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.org-panel-title,
.org-detail-title {
  font-size: 16px;
  font-weight: 600;
}

.org-tree {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.organization-view .org-tree {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding-right: 4px;
}

.org-tree-node,
.org-tree-children {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.org-tree-row {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  padding-left: calc(12px + var(--depth, 0) * 18px);
  border-radius: 8px;
  text-align: left;
  color: var(--text);
  transition: background 0.12s;
}

.org-tree-row:hover {
  background: var(--bg-hover);
}

.org-tree-row.active {
  background: var(--accent-soft);
  color: var(--accent);
}

.org-tree-indent {
  width: 10px;
  height: 10px;
  border-left: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.org-tree-name {
  font-weight: 600;
}

.org-tree-meta {
  margin-left: auto;
  font-size: 12px;
  color: var(--text-secondary);
}

.org-detail-card {
  flex-shrink: 0;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.org-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.org-form-actions {
  display: flex;
  gap: 8px;
  padding-top: 4px;
}

.org-member-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.org-member-row {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  text-align: left;
  background: var(--bg-column);
}

.org-member-row:hover {
  background: var(--bg-hover);
}

.org-member-row.active {
  background: var(--accent-soft);
}

.org-member-main {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
}

.org-member-tags {
  font-size: 12px;
  color: var(--text-secondary);
}

.org-brief-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.org-brief-item {
  border: 1px solid var(--border-soft);
  border-radius: 10px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.org-brief-item span {
  font-size: 12px;
  color: var(--text-secondary);
}

.org-brief-item strong {
  font-size: 14px;
}

.org-empty {
  padding: 18px;
  border: 1px dashed var(--border);
  border-radius: 10px;
  color: var(--text-faint);
  text-align: center;
}

.project-list,
.project-task-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.timeline-list {
  position: relative;
}

.timeline-list::before {
  content: "";
  position: absolute;
  left: 15px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: var(--border-soft);
}

.project-row {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: left;
  padding: 12px;
  border-radius: 10px;
  background: var(--bg-column);
  transition: background 0.12s, box-shadow 0.12s;
}

.project-row:hover {
  background: var(--bg-hover);
}

.project-row.active {
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 1px rgba(35, 131, 226, 0.2);
}

.project-row-main,
.project-row-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.project-code {
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
}

.project-name {
  font-size: 14px;
  font-weight: 600;
}

.project-row-sub,
.project-task-sub {
  font-size: 12px;
  color: var(--text-secondary);
}

.project-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.project-member-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.project-member-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid var(--border-soft);
  border-radius: 10px;
  background: var(--bg-column);
}

.project-member-option input {
  accent-color: var(--accent);
}

.project-member-option-sub {
  margin-left: auto;
  font-size: 12px;
  color: var(--text-secondary);
}

.project-inline-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
  border-radius: 10px;
  border: 1px solid var(--border-soft);
  background: var(--bg-column);
  position: relative;
  margin-left: 22px;
}

.timeline-head {
  display: flex;
  align-items: center;
  gap: 8px;
}

.timeline-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  position: absolute;
  left: -28px;
  top: 16px;
  box-shadow: 0 0 0 4px var(--bg);
}

.timeline-caption {
  margin-left: auto;
  font-size: 12px;
  color: var(--text-secondary);
}

.timeline-milestone-done .timeline-dot { background: #448361; }
.timeline-milestone-inprogress .timeline-dot { background: var(--accent); }
.timeline-milestone-todo .timeline-dot { background: #9b9a97; }
.timeline-risk-low .timeline-dot { background: #448361; }
.timeline-risk-medium .timeline-dot { background: #d9730d; }
.timeline-risk-high .timeline-dot { background: #d44c47; }

.budget-link-card {
  width: 100%;
  text-align: left;
  padding: 12px;
  border-radius: 10px;
  border: 1px solid var(--border-soft);
  background: var(--bg-column);
}

.budget-link-card:hover {
  background: var(--bg-hover);
}

.project-inline-grid {
  display: grid;
  gap: 10px;
}

.project-inline-grid-milestone {
  grid-template-columns: minmax(0, 2fr) 150px 130px 150px;
}

.project-inline-grid-risk {
  grid-template-columns: minmax(0, 2fr) 120px 130px 150px;
}

.project-inline-grid input,
.project-inline-grid select,
.project-inline-form textarea {
  width: 100%;
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-input);
}

.project-inline-actions {
  display: flex;
  gap: 8px;
}

.project-task-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--bg-column);
}

.project-task-title {
  font-size: 14px;
  font-weight: 500;
}

.project-task-progress {
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
}

.chip-project {
  background: var(--accent-soft);
  color: var(--accent);
}

.chip-project-status-planning,
.chip-project-status-active,
.chip-project-status-completed,
.chip-project-status-paused,
.chip-risk-low,
.chip-risk-medium,
.chip-risk-high {
  font-size: 12px;
}

.chip-project-status-planning { background: #e3e2e0; color: #32302c; }
.chip-project-status-active { background: #d3e5ef; color: #183347; }
.chip-project-status-completed { background: #dbeddb; color: #1c3829; }
.chip-project-status-paused { background: #fdecc8; color: #402c1b; }
.chip-risk-low { background: #dbeddb; color: #1c3829; }
.chip-risk-medium { background: #fdecc8; color: #402c1b; }
.chip-risk-high { background: #ffe2dd; color: #5d1715; }
.row-project { justify-self: start; }

.member-group { display: flex; flex-direction: column; gap: 8px; }

.group-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border-soft);
}

.group-name { font-size: 15px; font-weight: 600; }

.group-meta {
  font-size: 12.5px;
  color: var(--text-faint);
  font-variant-numeric: tabular-nums;
}

.group-progress {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 160px;
}

.group-progress .progress-track { flex: 1; }

.task-row {
  display: grid;
  grid-template-columns: minmax(200px, 1fr) 120px 90px 84px 110px 130px;
  align-items: center;
  gap: 12px;
  padding: 7px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.1s;
}

.task-row:hover { background: var(--bg-hover); }

.row-title { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-title.is-done { text-decoration: line-through; color: var(--text-faint); }

.row-progress { display: flex; align-items: center; gap: 8px; }
.row-progress .progress-track { flex: 1; }

.rows-scroll { overflow-x: auto; }
.rows-inner { min-width: 680px; display: flex; flex-direction: column; gap: 2px; }

.group-empty { color: var(--text-faint); font-size: 13px; padding: 8px 10px; }

/* ---------- 弹窗 ---------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 15, 15, 0.55);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 8vh 16px 16px;
  z-index: 100;
}

.modal {
  width: 520px;
  max-width: 100%;
  max-height: 84vh;
  overflow-y: auto;
  background: var(--bg);
  border-radius: 10px;
  box-shadow: var(--modal-shadow);
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px 0;
}

.modal-head h2 { font-size: 18px; font-weight: 600; }

.modal-body {
  padding: 14px 20px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.field { display: flex; flex-direction: column; gap: 5px; flex: 1; }

.field-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: 0.02em;
}

.field input[type="text"], .field textarea {
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg-input);
  font-size: 14px;
  resize: vertical;
}

.field input::placeholder, .field textarea::placeholder { color: var(--text-faint); }

.field select { width: 100%; padding: 7px 8px; font-size: 14px; }
.field input[type="date"] { width: 100%; padding: 6px 8px; font-size: 14px; }

.field input[type="range"] { accent-color: var(--accent); cursor: pointer; }

.field-row { display: flex; gap: 12px; }

.progress-val { color: var(--accent); font-variant-numeric: tabular-nums; }

.modal-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-top: 4px;
  border-top: 1px solid var(--border-soft);
}

.spacer { flex: 1; }

.dept-drag-over > .dept-header,
.dept-drag-over > .dept-header-plain {
  background: var(--accent-soft);
  outline: 2px dashed var(--accent);
  outline-offset: -2px;
  border-radius: 6px;
}

.dept-drag-over > .dept-members {
  background: var(--accent-soft);
  border-radius: 0 0 6px 6px;
  min-height: 36px;
}

.dept-drop-hint {
  padding: 6px 10px;
  font-size: 12px;
  color: var(--text-faint);
  font-style: italic;
}

.member-item .drag-handle {
  font-size: 12px;
  color: var(--text-faint);
  opacity: 0;
  cursor: grab;
  flex-shrink: 0;
  transition: opacity 0.1s;
  user-select: none;
}

.member-item:hover .drag-handle { opacity: 1; }
.member-item.member-dragging { opacity: 0.4; cursor: grabbing; }

/* ---------- 部门分组 ---------- */
.dept-list {
  display: flex;
  flex: 1;
  min-height: 0;
  flex-direction: column;
  gap: 2px;
  overflow-y: auto;
  padding-right: 2px;
}

.dept-group { display: flex; flex-direction: column; }

.dept-header {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  text-align: left;
  transition: background 0.1s;
  cursor: pointer;
}

.dept-header:hover { background: var(--bg-hover); }
.dept-header.active { background: var(--accent-soft); color: var(--accent); }

.dept-header-plain {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-faint);
  letter-spacing: 0.02em;
}

.dept-icon { font-size: 13px; flex-shrink: 0; }
.dept-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.dept-count {
  font-size: 11px;
  color: var(--text-faint);
  font-variant-numeric: tabular-nums;
  background: var(--bg-active);
  border-radius: 10px;
  padding: 0 5px;
  line-height: 16px;
}

.dept-members {
  padding-left: 10px;
  display: flex;
  flex-direction: column;
  gap: 1px;
  margin-bottom: 4px;
}

.dept-empty {
  padding: 3px 10px;
  font-size: 12px;
  color: var(--text-faint);
  font-style: italic;
}

/* 添加成员表单（带部门选择） */
.add-member-form {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 2px 4px 0;
}

.dept-select-mini {
  flex-shrink: 0;
  width: 74px;
  padding: 4px 4px;
  border: 1px solid var(--border-soft);
  border-radius: 6px;
  background: var(--bg-input);
  font-size: 11px;
  color: var(--text-secondary);
  cursor: pointer;
}

.add-member-form input {
  flex: 1;
  min-width: 0;
  padding: 5px 8px;
  border: none;
  border-radius: 6px;
  background: transparent;
  font-size: 13px;
  color: var(--text-secondary);
}

.add-member-form input:hover { background: var(--bg-hover); }
.add-member-form input::placeholder { color: var(--text-faint); }

/* 添加部门表单 */
.add-dept-form { padding: 2px 4px 0; }

.add-dept-form input {
  width: 100%;
  padding: 5px 8px;
  border: none;
  border-radius: 6px;
  background: transparent;
  font-size: 13px;
  color: var(--text-secondary);
}

.add-dept-form input:hover { background: var(--bg-hover); }
.add-dept-form input::placeholder { color: var(--text-faint); }

/* ---------- 右键菜单 ---------- */
.ctx-menu {
  position: fixed;
  z-index: 200;
  min-width: 148px;
  padding: 4px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--modal-shadow);
}

.ctx-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 6px 10px;
  border-radius: 5px;
  font-size: 13.5px;
  color: var(--text);
  text-align: left;
  transition: background 0.1s;
}

.ctx-item:hover { background: var(--bg-hover); }
.ctx-item.ctx-danger { color: var(--danger); }
.ctx-item.ctx-danger:hover { background: rgba(212, 76, 71, 0.08); }

.ctx-icon { font-size: 13px; width: 18px; text-align: center; flex-shrink: 0; }

.ctx-divider {
  height: 1px;
  background: var(--border-soft);
  margin: 3px 0;
}

/* ---------- 重命名弹窗 ---------- */
.rename-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 15, 15, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 300;
}

.rename-popup {
  width: 320px;
  background: var(--bg);
  border-radius: 10px;
  box-shadow: var(--modal-shadow);
  padding: 18px 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.rename-title {
  font-size: 15px;
  font-weight: 600;
}

.rename-input {
  width: 100%;
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg-input);
  font-size: 14px;
  color: var(--text);
}

.rename-input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }

.rename-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

/* ---------- 响应式 ---------- */
@media (max-width: 900px) {
  .sidebar { display: none; }
  .page-head, .toolbar, .board, .member-view, .organization-view, .projects-view, .budget-view, .worktime-view, .analysis-view { padding-left: 20px; padding-right: 20px; }
  .filter-notice { margin-left: 20px; margin-right: 20px; }
  .task-row { grid-template-columns: minmax(160px, 1fr) 120px 80px 76px 100px 120px; }
  .organization-layout,
  .org-summary-row,
  .org-brief-grid,
  .projects-layout,
  .project-kpi-grid,
  .project-member-grid,
  .project-inline-grid-milestone,
  .project-inline-grid-risk { grid-template-columns: 1fr; }
  .organization-layout { height: auto; min-height: 520px; }
  .organization-view .org-panel,
  .organization-view .org-panel-detail,
  .organization-view .org-tree { overflow: visible; }
  .org-flow-head { flex-direction: column; }
  .org-flow-scroll { padding-left: 14px; padding-right: 14px; }
}

/* ---------- 登录页 ---------- */
.login-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    radial-gradient(1200px 600px at 20% -10%, var(--accent-soft), transparent 60%),
    var(--bg-sidebar);
}

.login-card {
  width: 360px;
  max-width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-radius: 14px;
  box-shadow: var(--modal-shadow);
  padding: 32px 28px 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.login-logo { font-size: 40px; line-height: 1; }
.login-title { font-size: 22px; font-weight: 700; letter-spacing: -0.01em; }
.login-sub { color: var(--text-secondary); font-size: 13.5px; margin-bottom: 6px; }

.login-field { display: flex; flex-direction: column; gap: 5px; }
.login-field span { font-size: 12px; font-weight: 600; color: var(--text-secondary); }
.login-field input {
  padding: 9px 11px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-input);
  font-size: 14px;
}

.login-error {
  min-height: 18px;
  color: var(--danger);
  font-size: 12.5px;
}

.login-btn { padding: 10px; font-size: 15px; border-radius: 8px; margin-top: 2px; }

.login-hint {
  margin-top: 4px;
  font-size: 12px;
  color: var(--text-faint);
  text-align: center;
}
.login-hint a { color: var(--accent); text-decoration: none; }
.login-hint a:hover { text-decoration: underline; }

/* ---------- 侧栏用户信息 ---------- */
.user-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  font-size: 13.5px;
  color: var(--text);
}
.user-role {
  margin-left: auto;
  font-size: 11px;
  padding: 1px 7px;
  border-radius: 4px;
  background: var(--accent-soft);
  color: var(--accent);
}

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%) translateY(12px);
  z-index: 300;
  padding: 10px 18px;
  border-radius: 8px;
  background: #2c2c2c;
  color: #fff;
  font-size: 13.5px;
  box-shadow: rgba(0, 0, 0, 0.25) 0 6px 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- 用户信息按钮 ---------- */
.user-chip {
  width: 100%;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.1s;
}
.user-chip:hover { background: var(--bg-hover); }

/* ---------- 抽屉(公告列表) ---------- */
.drawer-overlay {
  position: fixed; inset: 0; z-index: 150;
  background: rgba(15, 15, 15, 0.4);
  display: flex; justify-content: flex-end;
}
.drawer {
  width: 400px; max-width: 100%; height: 100%;
  background: var(--bg); box-shadow: var(--modal-shadow);
  display: flex; flex-direction: column;
}
.drawer-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 20px; border-bottom: 1px solid var(--border-soft);
}
.drawer-head h2 { font-size: 17px; font-weight: 600; }
.drawer-hint { padding: 10px 20px 0; font-size: 12px; color: var(--text-faint); }
.msg-list { flex: 1; overflow-y: auto; padding: 16px 20px; display: flex; flex-direction: column; gap: 12px; }
.msg-item {
  padding: 14px 16px; border-radius: 10px;
  background: var(--bg-column); border: 1px solid var(--border-soft);
}
.msg-item-head { display: flex; align-items: center; gap: 8px; }
.msg-title { font-size: 14.5px; font-weight: 600; flex: 1; }
.msg-body { font-size: 13px; color: var(--text-secondary); margin-top: 6px; white-space: pre-wrap; }
.msg-meta { font-size: 11.5px; color: var(--text-faint); margin-top: 8px; }
.msg-empty, .msg-loading { text-align: center; color: var(--text-faint); font-size: 13px; padding: 40px 0; }

/* ---------- 个人设置:分隔标题 ---------- */
.field-divider {
  margin: 2px 0 -2px;
  padding-top: 12px;
  border-top: 1px solid var(--border-soft);
  font-size: 12px; font-weight: 600; color: var(--text-faint);
}

/* ============================================================
   首页仪表盘
   ============================================================ */

/* 图表配色(经数据可视化校验:CVD + 对比度) */
:root {
  --c-status-todo:#898781; --c-status-doing:#2a78d6; --c-status-review:#eb6834; --c-status-done:#008300;
  --c-prio-urgent:#e34948; --c-prio-high:#eb6834; --c-prio-medium:#eda100; --c-prio-low:#008300;
  --c-seq:#2a78d6; --c-seq2:#1baf7a; --chart-track:rgba(55,53,47,0.09);
}
@media (prefers-color-scheme: dark) {
  :root {
    --c-status-doing:#3987e5; --c-status-review:#d95926;
    --c-prio-urgent:#e66767; --c-prio-high:#d95926; --c-prio-medium:#c98500;
    --c-seq:#3987e5; --c-seq2:#199e70; --chart-track:rgba(255,255,255,0.10);
  }
}
:root[data-theme="light"] {
  --c-status-todo:#898781; --c-status-doing:#2a78d6; --c-status-review:#eb6834; --c-status-done:#008300;
  --c-prio-urgent:#e34948; --c-prio-high:#eb6834; --c-prio-medium:#eda100; --c-prio-low:#008300;
  --c-seq:#2a78d6; --c-seq2:#1baf7a; --chart-track:rgba(55,53,47,0.09);
}
:root[data-theme="dark"] {
  --c-status-todo:#898781; --c-status-doing:#3987e5; --c-status-review:#d95926; --c-status-done:#008300;
  --c-prio-urgent:#e66767; --c-prio-high:#d95926; --c-prio-medium:#c98500; --c-prio-low:#008300;
  --c-seq:#3987e5; --c-seq2:#199e70; --chart-track:rgba(255,255,255,0.10);
}

.home { flex: 1; overflow-y: auto; padding: 20px 32px 48px; }

.home-summary-row {
  margin-bottom: 26px;
}

.org-summary-num.is-overdue {
  color: var(--overdue);
}

.home-template {
  display: grid;
  grid-template-columns: minmax(620px, 1.55fr) minmax(340px, 0.75fr);
  align-items: start;
  gap: 34px;
  padding: 10px 6px 20px;
}

.home-donut-panel,
.home-list-panel,
.home-timeline-panel {
  min-width: 0;
}

.home-section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.timeline-actions {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.timeline-new-btn {
  height: 30px;
  padding: 0 12px;
  border-radius: 6px;
  font-weight: 700;
}

.home-donut-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
  padding: 26px 8px 6px;
}

.home-donut .donut {
  width: 238px;
  height: 238px;
}

.home-donut .donut-num {
  font-size: 33px;
  letter-spacing: 0;
}

.home-donut .donut-cap {
  font-size: 12px;
}

.home-donut-labels {
  max-width: 520px;
}

.timeline-shell {
  margin-top: 14px;
  overflow-x: auto;
  overflow-y: hidden;
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  box-shadow: rgba(15, 15, 15, 0.04) 0 1px 2px;
}

.timeline-scroll {
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  scrollbar-width: thin;
}

.timeline-canvas {
  position: relative;
  min-width: 100%;
}

.timeline-header {
  position: sticky;
  top: 0;
  z-index: 4;
  height: 68px;
  background: var(--bg);
  border-bottom: 1px solid var(--border-soft);
}

.timeline-groups,
.timeline-days {
  position: relative;
  height: 34px;
}

.timeline-groups span,
.timeline-days span {
  position: absolute;
  top: 0;
  display: grid;
  place-items: center;
  height: 100%;
  border-right: 1px solid var(--border-soft);
  color: var(--text-secondary);
  font-size: 12px;
  white-space: nowrap;
}

.timeline-groups span {
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
}

.timeline-days {
  border-top: 1px solid var(--border-soft);
}

.timeline-days .is-today {
  color: #fff;
  font-weight: 700;
}

.timeline-days .is-today::before {
  content: "";
  position: absolute;
  width: 26px;
  height: 22px;
  border-radius: 999px;
  background: var(--danger);
  z-index: -1;
}

.timeline-days .is-weekend,
.timeline-col.is-weekend {
  background: rgba(55, 53, 47, 0.035);
}

.timeline-grid {
  position: relative;
  min-height: 220px;
}

.timeline-grid.is-drop-target {
  outline: 2px solid rgba(35, 131, 226, 0.35);
  outline-offset: -2px;
}

.timeline-col {
  position: absolute;
  top: 0;
  bottom: 0;
  border-right: 1px solid rgba(55, 53, 47, 0.06);
}

.timeline-links {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: visible;
}

.timeline-dependency-group {
  pointer-events: none;
}

.timeline-dependency-path {
  fill: none;
  stroke: #e0a93b;
  stroke-width: 2;
  opacity: 0.9;
  marker-end: url(#timeline-arrow);
  pointer-events: stroke;
}

.timeline-links marker path {
  fill: #e0a93b;
}

.timeline-dependency-group.is-muted .timeline-dependency-path {
  opacity: 0.18;
}

.timeline-dependency-group.is-active .timeline-dependency-path,
.timeline-dependency-path.is-temp {
  opacity: 1;
  stroke-width: 2.6;
}

.timeline-dependency-delete,
.timeline-dependency-delete-text {
  opacity: 0;
  pointer-events: all;
  cursor: pointer;
  transition: opacity 0.12s;
}

.timeline-dependency-delete {
  fill: var(--danger);
  stroke: var(--bg);
  stroke-width: 2;
}

.timeline-dependency-delete-text {
  fill: #fff;
  font-size: 13px;
  font-weight: 800;
  text-anchor: middle;
  user-select: none;
}

.timeline-dependency-group:hover .timeline-dependency-delete,
.timeline-dependency-group:hover .timeline-dependency-delete-text {
  opacity: 1;
}

.timeline-task {
  position: absolute;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  height: 30px;
  padding: 0 10px;
  border: 1px solid rgba(55, 53, 47, 0.12);
  border-radius: 6px;
  background: var(--bg-card);
  color: var(--text);
  box-shadow: rgba(15, 15, 15, 0.05) 0 1px 2px;
  font-size: 13px;
  cursor: grab;
  user-select: none;
  touch-action: none;
  container-type: inline-size;
  transform: translate3d(var(--drag-x, 0), var(--drag-y, 0), 0);
  will-change: transform, width;
}

.timeline-task:hover {
  background: var(--bg-hover);
}

.timeline-task.timeline-dragging {
  opacity: 0.48;
  cursor: grabbing;
}

.timeline-task.is-selected {
  background: var(--accent-soft);
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent);
}

.timeline-task.is-dependency-target {
  border-color: #e0a93b;
  box-shadow: inset 0 0 0 1px #e0a93b;
}

.timeline-caret {
  color: #787774;
  font-size: 11px;
}

.timeline-title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 500;
}

.timeline-tag {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 7px;
  border-radius: 4px;
  font-size: 12px;
  line-height: 1;
  white-space: nowrap;
}

@container (max-width: 120px) {
  .timeline-tag { display: none; }
}

.timeline-resize-handle {
  position: absolute;
  top: 3px;
  bottom: 3px;
  width: 14px;
  border-radius: 999px;
  opacity: 0;
  background: color-mix(in srgb, var(--accent) 70%, transparent);
  transition: opacity 0.12s;
  z-index: 5;
}

.timeline-resize-handle.is-left {
  left: -7px;
  cursor: ew-resize;
}

.timeline-resize-handle.is-right {
  right: -7px;
  cursor: ew-resize;
}

.timeline-task:hover .timeline-resize-handle,
.timeline-task.is-selected .timeline-resize-handle {
  opacity: 0.7;
}

.timeline-dependency-handle {
  position: absolute;
  top: 50%;
  width: 10px;
  height: 10px;
  border: 2px solid #e0a93b;
  border-radius: 50%;
  background: var(--bg-card);
  opacity: 0;
  transform: translateY(-50%);
  transition: opacity 0.12s;
  z-index: 4;
}

.timeline-dependency-handle.is-left {
  left: -20px;
}

.timeline-dependency-handle.is-right {
  right: -20px;
  cursor: crosshair;
}

.timeline-task:hover .timeline-dependency-handle,
.timeline-task.is-selected .timeline-dependency-handle {
  opacity: 1;
}

.timeline-today-line {
  position: absolute;
  top: 0;
  bottom: 0;
  z-index: 2;
  width: 2px;
  background: var(--danger);
  transform: translateX(-1px);
  pointer-events: none;
}

.timeline-empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--text-faint);
  font-size: 13px;
}

.timeline-scale-select {
  height: 30px;
  padding: 0 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg-input);
  color: var(--text);
  font-size: 13px;
}

.timeline-nav-btn,
.timeline-today-btn {
  height: 30px;
  padding-top: 0;
  padding-bottom: 0;
}

.timeline-dependency-box {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  background: var(--bg-column);
}

.timeline-dependency-title {
  font-size: 13px;
  font-weight: 700;
}

.timeline-dependency-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  color: var(--text-secondary);
  font-size: 12.5px;
}

.timeline-dependency-group > span {
  min-width: 58px;
}

.timeline-dependency-group em {
  color: var(--text-faint);
  font-style: normal;
}

.timeline-dependency-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 220px;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--bg-active);
  color: var(--text);
  font-size: 12px;
}

.timeline-dependency-chip b {
  color: var(--danger);
}

.home-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, auto);
  align-items: center;
  gap: 16px;
  width: 100%;
  min-height: 29px;
  padding: 3px 6px;
  border-radius: 6px;
  color: inherit;
  font: inherit;
  text-align: left;
}

.home-row:hover {
  background: var(--bg-hover);
}

.home-row-main,
.home-row-side {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.home-row-main {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
}

.home-row-side {
  justify-content: flex-end;
  color: var(--text-secondary);
  font-size: 12.5px;
}

.home-row-side strong {
  min-width: 58px;
  color: var(--text);
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.home-metrics {
  padding-top: 30px;
}

.home-metric-card {
  cursor: default;
}

.home-metric-card:hover {
  background: var(--bg-card);
  border-color: var(--border-soft);
}

.kpi-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 14px; }
.kpi-tile {
  background: var(--bg-card); border: 1px solid var(--border-soft);
  border-radius: 12px; padding: 16px 18px; box-shadow: var(--card-shadow);
}
.kpi-num { font-size: 30px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; }
.kpi-num.danger { color: var(--overdue); }
.kpi-label { font-size: 13px; font-weight: 600; margin-top: 6px; }
.kpi-sub { font-size: 12px; color: var(--text-faint); margin-top: 2px; }

.chart-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.chart-card {
  background: var(--bg-card); border: 1px solid var(--border-soft);
  border-radius: 12px; padding: 18px 20px; box-shadow: var(--card-shadow); min-width: 0;
}
.chart-title { font-size: 14px; font-weight: 600; margin-bottom: 16px; }

.sales-table-card {
  grid-column: 1 / -1;
}

.sales-table-wrap {
  overflow-x: auto;
}

.sales-table {
  width: 100%;
  min-width: 980px;
  border-collapse: collapse;
  font-size: 12.5px;
}

.sales-table th,
.sales-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-soft);
  text-align: left;
  white-space: nowrap;
}

.sales-table th {
  color: var(--text-secondary);
  font-weight: 600;
  background: var(--bg-column);
}

.sales-table td:nth-child(6),
.sales-table td:nth-child(7),
.sales-table td:nth-child(8) {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.sales-status {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--bg-active);
  color: var(--text-secondary);
  font-size: 12px;
}

.sales-status-audited,
.sales-status-locked {
  background: var(--st-done-bg);
  color: var(--st-done-fg);
}

.sales-status-confirmed {
  background: var(--st-inprogress-bg);
  color: var(--st-inprogress-fg);
}

.sales-status-draft {
  background: var(--st-review-bg);
  color: var(--st-review-fg);
}

.finance-template {
  display: grid;
  grid-template-columns: minmax(360px, 0.9fr) minmax(520px, 1.4fr);
  gap: 28px;
  padding: 20px 6px 10px;
}

.finance-section-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--text);
}

.finance-chip,
.finance-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: max-content;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
}

.finance-chip {
  padding: 7px 11px;
  background: var(--bg-active);
  color: var(--text);
}

.finance-chip-icon {
  color: var(--text-secondary);
  font-size: 13px;
}

.finance-donut-panel,
.finance-list-panel {
  min-width: 0;
}

.finance-donut-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
  padding: 30px 8px 6px;
}

.finance-donut {
  position: relative;
  width: 238px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: conic-gradient(var(--donut));
}

.finance-donut::after {
  content: "";
  position: absolute;
  inset: 30px;
  border-radius: 50%;
  background: var(--bg);
}

.finance-donut-center {
  position: absolute;
  inset: 56px;
  z-index: 1;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  text-align: center;
}

.finance-donut-center strong {
  font-size: 34px;
  line-height: 1;
  letter-spacing: 0;
}

.finance-donut-center span {
  color: var(--text-secondary);
  font-size: 12px;
}

.finance-donut-labels {
  display: flex;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
}

.finance-donut-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-secondary);
  font-size: 12px;
}

.finance-donut-label strong {
  color: var(--text);
  font-weight: 600;
}

.finance-donut-label em {
  color: var(--text-faint);
  font-style: normal;
}

.finance-dot {
  width: 8px;
  height: 8px;
  border-radius: 2px;
}

.finance-list-panel {
  display: grid;
  grid-template-columns: 1fr;
  gap: 34px;
}

.finance-list-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
}

.finance-tools {
  color: var(--accent);
  font-size: 12px;
  letter-spacing: 0;
  word-spacing: 8px;
}

.finance-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
}

.finance-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-height: 29px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  padding: 3px 6px;
  cursor: pointer;
}

.finance-row:hover {
  background: var(--bg-hover);
}

.sales-record-row {
  cursor: pointer;
}

.sales-record-row:hover td {
  background: var(--bg-hover);
}

.finance-row-main,
.finance-row-side {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.finance-row-main {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
}

.finance-row-side {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.finance-tag {
  padding: 4px 7px;
}

.tag-product,
.tag-brown {
  background: #6f4b35;
  color: #f4dfcd;
}

.tag-purple {
  background: #5b4275;
  color: #eadbff;
}

.tag-green {
  background: #2f6b54;
  color: #d4f1e4;
}

.tag-orange {
  background: #885437;
  color: #ffe0ca;
}

.tag-gray {
  background: #5d5d5a;
  color: #eeeeeb;
}

.finance-metrics {
  padding-top: 24px;
}

.metric-columns {
  display: grid;
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  gap: 22px;
}

.metric-column {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.metric-column-head {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-secondary);
  font-size: 12px;
}

.metric-card {
  min-height: 94px;
  width: 100%;
  padding: 12px;
  border-radius: 8px;
  color: inherit;
  font: inherit;
  text-align: left;
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  box-shadow: var(--card-shadow);
  cursor: pointer;
}

.metric-card:hover {
  background: var(--bg-hover);
  border-color: var(--border);
}

.metric-card-title {
  display: flex;
  align-items: center;
  gap: 7px;
  font-weight: 700;
  margin-bottom: 8px;
}

.metric-card-title span {
  color: var(--text-secondary);
}

.metric-card strong {
  display: block;
  margin-bottom: 7px;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.metric-track {
  height: 4px;
  border-radius: 999px;
  background: rgba(67, 148, 106, 0.22);
  overflow: hidden;
  margin-bottom: 10px;
}

.metric-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #2f9b6c;
}

.sales-detail-overlay {
  position: fixed;
  inset: 0;
  z-index: 180;
  display: flex;
  justify-content: flex-end;
  background: rgba(10, 10, 10, 0.34);
}

.sales-detail-drawer {
  width: min(720px, 52vw);
  min-width: 520px;
  height: 100%;
  overflow-y: auto;
  background: var(--bg);
  border-left: 1px solid var(--border);
  box-shadow: -18px 0 50px rgba(0, 0, 0, 0.28);
}

.sales-detail-actions {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  justify-content: flex-end;
  padding: 14px 18px 2px;
  background: linear-gradient(var(--bg) 78%, rgba(0, 0, 0, 0));
}

.sales-detail-body {
  max-width: 620px;
  padding: 26px 56px 64px;
}

.sales-page-icon {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  margin-bottom: 10px;
  background: var(--bg-hover);
  color: var(--text-secondary);
  font-size: 18px;
  font-weight: 800;
}

.sales-page-title {
  margin: 0;
  color: var(--text);
  font-size: 30px;
  line-height: 1.18;
  letter-spacing: 0;
}

.sales-page-sub {
  margin-top: 8px;
  color: var(--text-secondary);
  font-size: 13px;
}

.sales-props {
  display: grid;
  gap: 14px;
  margin-top: 24px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--border-soft);
}

.sales-prop-row {
  display: grid;
  grid-template-columns: 126px minmax(0, 1fr);
  gap: 18px;
  align-items: center;
  min-height: 24px;
  color: var(--text-secondary);
  font-size: 13px;
}

.sales-prop-row strong {
  min-width: 0;
  color: var(--text);
  font-weight: 600;
}

.sales-prop-row em {
  font-style: normal;
}

.sales-detail-section {
  margin-top: 30px;
}

.sales-detail-section-title {
  margin-bottom: 12px;
  color: var(--text);
  font-size: 17px;
  font-weight: 800;
}

.sales-amount-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.sales-amount-grid div {
  min-height: 78px;
  padding: 12px;
  border-radius: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
}

.sales-amount-grid span {
  display: block;
  margin-bottom: 10px;
  color: var(--text-secondary);
  font-size: 12px;
}

.sales-amount-grid strong {
  color: var(--text);
  font-size: 18px;
  font-variant-numeric: tabular-nums;
}

.sales-detail-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sales-detail-list-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  min-height: 34px;
  padding: 5px 8px;
  border-radius: 6px;
}

.sales-detail-list-row:hover {
  background: var(--bg-hover);
}

.sales-detail-list-row span,
.sales-detail-list-row strong {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.sales-detail-list-row span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
}

.sales-detail-list-row strong {
  justify-content: flex-end;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.worktime-mini-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.worktime-mini-card { padding: 14px 16px; }

.donut-wrap { display: flex; align-items: center; gap: 20px; }
.donut { width: 140px; height: 140px; flex-shrink: 0; }
.donut-num { font-size: 26px; font-weight: 700; fill: var(--text); text-anchor: middle; }
.donut-cap { font-size: 11px; fill: var(--text-faint); text-anchor: middle; }
.legend { display: flex; flex-direction: column; gap: 9px; flex: 1; min-width: 0; }
.legend-row { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.legend-dot { width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; }
.legend-label { color: var(--text-secondary); }
.legend-val { margin-left: auto; font-variant-numeric: tabular-nums; font-weight: 500; }

.bars { display: flex; flex-direction: column; gap: 12px; }
.bar-row { display: grid; grid-template-columns: 112px minmax(90px, 1fr) minmax(92px, 180px); align-items: center; gap: 10px; }
.bar-label { font-size: 12.5px; color: var(--text-secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-track { height: 10px; border-radius: 6px; background: var(--chart-track); overflow: hidden; }
.bar-fill { height: 100%; border-radius: 6px; min-width: 4px; transition: width 0.3s; }
.bar-val { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12.5px; font-variant-numeric: tabular-nums; text-align: right; }
.chart-empty { color: var(--text-faint); font-size: 13px; padding: 16px 0; text-align: center; }

@media (max-width: 900px) {
  .home { padding-left: 20px; padding-right: 20px; }
  .kpi-row { grid-template-columns: repeat(2, 1fr); }
  .chart-grid { grid-template-columns: 1fr; }
  .home-template,
  .finance-template,
  .metric-columns { grid-template-columns: 1fr; }
  .home-row { grid-template-columns: 1fr; }
  .home-row-side { justify-content: space-between; }
  .finance-row { grid-template-columns: 1fr; }
  .finance-row-side { justify-content: space-between; }
  .sales-detail-drawer {
    width: 100%;
    min-width: 0;
  }
  .sales-detail-body { padding: 24px 22px 48px; }
  .sales-page-title { font-size: 26px; }
  .sales-prop-row { grid-template-columns: 1fr; gap: 4px; }
  .sales-amount-grid { grid-template-columns: 1fr; }
  .sales-detail-list-row { grid-template-columns: 1fr; }
  .sales-detail-list-row strong { justify-content: flex-start; }
}
