/* ==========================================================================
   Nexus 项目管理 — 设计系统
   ========================================================================== */

:root {
  --font-sans: "Inter", "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, -apple-system, sans-serif;

  --bg: #f4f6fb;
  --bg-soft: #eef1f8;
  --surface: #ffffff;
  --surface-2: #f8f9fd;
  --surface-3: #eef1f8;
  --text: #171a26;
  --text-2: #4b5468;
  --muted: #7b849a;
  --border: #e6e9f2;
  --border-strong: #d6dbe8;

  --accent: #4f46e5;
  --accent-2: #8b5cf6;
  --accent-soft: rgba(79, 70, 229, .09);
  --accent-soft-2: rgba(79, 70, 229, .16);

  --green: #10b981;
  --green-soft: rgba(16, 185, 129, .12);
  --red: #ef4444;
  --red-soft: rgba(239, 68, 68, .12);
  --amber: #f59e0b;
  --amber-soft: rgba(245, 158, 11, .14);
  --blue: #3b82f6;
  --blue-soft: rgba(59, 130, 246, .12);
  --violet: #a855f7;
  --violet-soft: rgba(168, 85, 247, .12);
  --slate: #94a3b8;

  --sidebar-bg: linear-gradient(185deg, #191d2e 0%, #12151f 60%, #101219 100%);
  --sidebar-text: #a9b0c6;
  --sidebar-text-strong: #f2f4fb;
  --sidebar-line: rgba(255, 255, 255, .07);

  --shadow-xs: 0 1px 2px rgba(16, 24, 40, .05);
  --shadow-sm: 0 1px 3px rgba(16, 24, 40, .06), 0 1px 2px rgba(16, 24, 40, .04);
  --shadow-md: 0 10px 24px -12px rgba(16, 24, 40, .22);
  --shadow-lg: 0 28px 60px -22px rgba(16, 24, 40, .38);

  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 20px;

  --sidebar-w: 252px;
  --topbar-h: 70px;
}

html[data-theme="dark"] {
  --bg: #0c0e15;
  --bg-soft: #11141d;
  --surface: #151823;
  --surface-2: #1a1e2b;
  --surface-3: #222736;
  --text: #e9ecf5;
  --text-2: #b3bacd;
  --muted: #7f889e;
  --border: #262b3a;
  --border-strong: #333a4d;

  --accent: #7c7bff;
  --accent-2: #a78bfa;
  --accent-soft: rgba(124, 123, 255, .14);
  --accent-soft-2: rgba(124, 123, 255, .24);

  --green: #34d399;
  --red: #f87171;
  --amber: #fbbf24;
  --blue: #60a5fa;
  --violet: #c084fc;

  --sidebar-bg: linear-gradient(185deg, #12151f 0%, #0c0e15 100%);
  --sidebar-text: #929ab1;

  --shadow-xs: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, .45);
  --shadow-md: 0 12px 28px -14px rgba(0, 0, 0, .7);
  --shadow-lg: 0 30px 70px -20px rgba(0, 0, 0, .8);
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, p { margin: 0; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }

::selection { background: var(--accent-soft-2); }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border: 3px solid transparent;
  background-clip: content-box;
  border-radius: 99px;
}
::-webkit-scrollbar-thumb:hover { background: var(--muted); background-clip: content-box; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* --------------------------------------------------------------------------
   布局
   -------------------------------------------------------------------------- */
.app { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  flex: none;
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 22px 14px 16px;
  position: sticky;
  top: 0;
  height: 100vh;
  border-right: 1px solid var(--sidebar-line);
  z-index: 50;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 2px 8px 6px;
  color: var(--sidebar-text-strong);
}
.brand-mark {
  width: 38px; height: 38px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: linear-gradient(140deg, #6366f1, #a855f7);
  color: #fff;
  font-weight: 800;
  font-size: 18px;
  letter-spacing: -.5px;
  box-shadow: 0 6px 16px -6px rgba(99, 102, 241, .9), inset 0 1px 0 rgba(255, 255, 255, .3);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.25; }
.brand-text strong { font-size: 15.5px; letter-spacing: .2px; }
.brand-text small { font-size: 11.5px; color: #6f7893; letter-spacing: .6px; }

.nav { display: flex; flex-direction: column; gap: 3px; overflow-y: auto; padding: 0 2px; }
.nav-label {
  font-size: 10.5px;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: #5e6680;
  padding: 14px 12px 6px;
  font-weight: 600;
}
.nav-link {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 12px;
  border-radius: 10px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--sidebar-text);
  transition: background .16s ease, color .16s ease, transform .16s ease;
  position: relative;
}
.nav-link svg { width: 18px; height: 18px; flex: none; opacity: .9; }
.nav-link:hover { background: rgba(255, 255, 255, .055); color: var(--sidebar-text-strong); }
.nav-link.active {
  color: #fff;
  background: linear-gradient(100deg, rgba(99, 102, 241, .95), rgba(139, 92, 246, .78));
  box-shadow: 0 8px 20px -12px rgba(99, 102, 241, 1), inset 0 1px 0 rgba(255, 255, 255, .22);
}
.nav-link.active svg { opacity: 1; }

.sidebar-foot { margin-top: auto; display: flex; flex-direction: column; gap: 12px; padding: 0 2px; }

.theme-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 12px;
  border-radius: 10px;
  border: 1px solid var(--sidebar-line);
  background: rgba(255, 255, 255, .04);
  color: var(--sidebar-text);
  font-size: 12.5px;
}
.theme-toggle:hover { background: rgba(255, 255, 255, .07); color: var(--sidebar-text-strong); }
.theme-icon { width: 16px; height: 16px; border-radius: 50%; background: linear-gradient(140deg, #fbbf24, #f97316); box-shadow: 0 0 0 3px rgba(251, 191, 36, .14); flex: none; }
html[data-theme="dark"] .theme-icon { background: linear-gradient(140deg, #c7d2fe, #818cf8); box-shadow: 0 0 0 3px rgba(129, 140, 248, .16); }
.theme-label { flex: 1; text-align: left; }
.switch { width: 30px; height: 17px; border-radius: 99px; background: rgba(255, 255, 255, .14); position: relative; flex: none; transition: background .2s; }
.switch i { position: absolute; top: 2.5px; left: 2.5px; width: 12px; height: 12px; border-radius: 50%; background: #fff; transition: transform .2s; }
html[data-theme="dark"] .switch { background: var(--accent); }
html[data-theme="dark"] .switch i { transform: translateX(13px); }

.sidebar-tip {
  border-radius: 12px;
  padding: 11px 13px;
  background: rgba(255, 255, 255, .035);
  border: 1px solid var(--sidebar-line);
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 11.5px;
  color: #6f7893;
}
.sidebar-tip strong { color: #b9c0d4; font-size: 12px; }

.sidebar-scrim { display: none; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 14px;
  height: var(--topbar-h);
  padding: 0 28px;
  background: rgba(244, 246, 251, .82);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--border);
}
html[data-theme="dark"] .topbar { background: rgba(12, 14, 21, .82); }

.menu-btn { display: none; }
.topbar-spacer { flex: 1; }

.crumbs { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); min-width: 0; }
.crumbs-sep { color: var(--border-strong); }
.crumbs-current { color: var(--text); font-weight: 600; }

.search {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 250px;
  height: 38px;
  padding: 0 12px;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--muted);
  transition: border-color .16s, box-shadow .16s;
}
.search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.search svg { width: 16px; height: 16px; flex: none; }
.search input { border: 0; outline: 0; background: none; width: 100%; font-size: 13px; color: var(--text); }
.search input::placeholder { color: var(--muted); }
.search input::-webkit-search-cancel-button { display: none; }

.view {
  padding: 26px 28px 60px;
  width: 100%;
  max-width: 1560px;
  margin: 0 auto;
  flex: 1;
  outline: none;
  animation: viewIn .28s ease both;
}
@keyframes viewIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* --------------------------------------------------------------------------
   基础组件
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 38px;
  padding: 0 15px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: var(--surface);
  color: var(--text-2);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  transition: background .16s, border-color .16s, color .16s, transform .12s, box-shadow .16s;
}
.btn svg { width: 16px; height: 16px; }
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: linear-gradient(120deg, #5b5bf0, #7c5cf5);
  color: #fff;
  box-shadow: 0 8px 18px -10px rgba(91, 91, 240, .95);
}
.btn-primary:hover { box-shadow: 0 12px 22px -10px rgba(91, 91, 240, .95); filter: brightness(1.05); }
.btn-ghost { background: transparent; border-color: var(--border); }
.btn-ghost:hover { background: var(--surface-2); border-color: var(--border-strong); color: var(--text); }
.btn-soft { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.btn-soft:hover { background: var(--accent-soft-2); }
.btn-danger { background: var(--red-soft); color: var(--red); }
.btn-danger:hover { background: rgba(239, 68, 68, .2); }
.btn-sm { height: 32px; padding: 0 11px; font-size: 12.5px; border-radius: 9px; }
.btn-block { width: 100%; }

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 9px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  transition: background .15s, color .15s;
}
.icon-btn svg { width: 17px; height: 17px; }
.icon-btn:hover { background: var(--surface-3); color: var(--text); }
.icon-btn.danger:hover { background: var(--red-soft); color: var(--red); }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-xs);
}
.card-pad { padding: 20px 22px; }

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 22px 0;
}
.card-head h2 { font-size: 15px; font-weight: 650; letter-spacing: .1px; }
.card-head .sub { font-size: 12px; color: var(--muted); margin-top: 2px; }

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}
.page-head h1 { font-size: 25px; font-weight: 700; letter-spacing: -.4px; }
.page-head .sub { color: var(--muted); font-size: 13px; margin-top: 5px; }
.page-actions { display: flex; gap: 9px; align-items: center; flex-wrap: wrap; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 24px;
  padding: 0 9px;
  border-radius: 7px;
  font-size: 11.5px;
  font-weight: 600;
  background: var(--surface-3);
  color: var(--text-2);
  white-space: nowrap;
}
.chip .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.chip-soft { background: var(--accent-soft); color: var(--accent); }

.tag {
  display: inline-flex;
  align-items: center;
  height: 21px;
  padding: 0 7px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 500;
  background: var(--surface-3);
  color: var(--muted);
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 22px;
  padding: 0 8px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 600;
}
.pill::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }

.avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  color: #fff;
  font-size: 11.5px;
  font-weight: 700;
  flex: none;
  letter-spacing: .2px;
  user-select: none;
}
.avatar-lg { width: 42px; height: 42px; font-size: 14px; }
.avatar-sm { width: 24px; height: 24px; font-size: 10px; }
.avatar-stack { display: flex; align-items: center; }
.avatar-stack .avatar { margin-left: -8px; border: 2px solid var(--bg); }
.avatar-stack .avatar:first-child { margin-left: 0; }
.avatar-stack .more {
  margin-left: -8px;
  width: 30px; height: 30px;
  border-radius: 50%;
  border: 2px solid var(--bg);
  background: var(--surface-3);
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 700;
  display: grid;
  place-items: center;
}

.progress { height: 7px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.progress > i {
  display: block;
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, #6366f1, #a855f7);
  transition: width .6s cubic-bezier(.4, 0, .2, 1);
}

.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 52px 20px;
  color: var(--muted);
  text-align: center;
}
.empty svg { width: 40px; height: 40px; opacity: .55; margin-bottom: 4px; }
.empty strong { color: var(--text-2); font-size: 14px; }
.empty span { font-size: 12.5px; }

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

/* --------------------------------------------------------------------------
   概览
   -------------------------------------------------------------------------- */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 16px;
  margin-top: 16px;
  margin-bottom: 16px;
}
.kpi {
  position: relative;
  overflow: hidden;
  padding: 18px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-xs);
}
.kpi::after {
  content: "";
  position: absolute;
  right: -30px; top: -40px;
  width: 120px; height: 120px;
  border-radius: 50%;
  background: var(--accent-soft);
  opacity: .55;
}
.kpi-top { display: flex; align-items: center; justify-content: space-between; }
.kpi-label { font-size: 12.5px; color: var(--muted); font-weight: 500; }
.kpi-icon {
  width: 32px; height: 32px;
  border-radius: 9px;
  display: grid; place-items: center;
  background: var(--accent-soft);
  color: var(--accent);
}
.kpi-icon svg { width: 17px; height: 17px; }
.kpi-value { font-size: 30px; font-weight: 700; letter-spacing: -1px; margin-top: 8px; line-height: 1.1; }
.kpi-foot { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); margin-top: 6px; }
.kpi-foot b { color: var(--text-2); font-weight: 600; }
.kpi.warn .kpi-icon { background: var(--red-soft); color: var(--red); }
.kpi.warn .kpi-value { color: var(--red); }
.kpi.warn::after { background: var(--red-soft); }

.dash-grid { display: grid; grid-template-columns: minmax(0, 1.75fr) minmax(0, 1fr); gap: 16px; }
.dash-grid + .dash-grid { margin-top: 16px; }
.dash-grid .card { overflow: hidden; }

.project-rows { padding: 12px 12px 14px; display: flex; flex-direction: column; }
.project-row {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) 120px 64px 46px;
  align-items: center;
  gap: 14px;
  padding: 12px 10px;
  border-radius: 11px;
  transition: background .15s;
}
.project-row + .project-row { border-top: 1px solid var(--border); border-radius: 0; }
.project-row:hover { background: var(--surface-2); }
.project-row:hover + .project-row { border-top-color: transparent; }
.project-row .name { display: flex; align-items: center; gap: 9px; min-width: 0; }
.project-row .name b { font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.project-row .name .dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.project-row .count { font-size: 12px; color: var(--muted); text-align: right; }
.project-row .pct { font-size: 12.5px; font-weight: 650; text-align: right; color: var(--text-2); font-variant-numeric: tabular-nums; }

.donut-wrap { display: flex; align-items: center; gap: 18px; padding: 18px 22px 22px; }
.donut { position: relative; flex: none; }
.donut-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.donut-center b { font-size: 22px; font-weight: 700; letter-spacing: -.5px; line-height: 1.1; }
.donut-center span { font-size: 10.5px; color: var(--muted); }
.legend { display: flex; flex-direction: column; gap: 9px; flex: 1; min-width: 0; }
.legend-row { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text-2); }
.legend-row .dot { width: 8px; height: 8px; border-radius: 3px; flex: none; }
.legend-row .n { margin-left: auto; font-weight: 650; color: var(--text); font-variant-numeric: tabular-nums; }

.upcoming { padding: 10px 12px 14px; display: flex; flex-direction: column; }
.upcoming-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border-radius: 10px;
  transition: background .15s;
  cursor: pointer;
}
.upcoming-row:hover { background: var(--surface-2); }
.upcoming-row + .upcoming-row { border-top: 1px solid var(--border); border-radius: 0; }
.upcoming-row .t { font-size: 13px; font-weight: 550; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.upcoming-row .p { font-size: 11.5px; color: var(--muted); display: flex; align-items: center; gap: 6px; margin-top: 2px; }
.upcoming-row .t-main { min-width: 0; flex: 1; }
.due {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.due.soon { color: var(--amber); }
.due.late { color: var(--red); }

.team-list { padding: 8px 12px 14px; display: flex; flex-direction: column; gap: 2px; }
.team-row { display: flex; align-items: center; gap: 11px; padding: 9px 10px; border-radius: 10px; }
.team-row:hover { background: var(--surface-2); }
.team-row .meta { min-width: 0; flex: 1; }
.team-row .meta b { display: block; font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.team-row .meta span { font-size: 11.5px; color: var(--muted); }
.team-row .load { width: 84px; flex: none; }
.load-bar { height: 6px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.load-bar i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, #10b981, #84cc16); }
.load-bar i.mid { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.load-bar i.high { background: linear-gradient(90deg, #ef4444, #f97316); }
.team-row .load span { display: block; font-size: 10.5px; color: var(--muted); text-align: right; margin-top: 3px; font-variant-numeric: tabular-nums; }

/* --------------------------------------------------------------------------
   项目
   -------------------------------------------------------------------------- */
.project-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(310px, 1fr)); gap: 16px; }

.project-card {
  position: relative;
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-xs);
  overflow: hidden;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s;
  display: flex;
  flex-direction: column;
  gap: 13px;
}
.project-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: var(--border-strong); }
.project-card .accent-bar { position: absolute; left: 0; top: 0; height: 3px; width: 100%; }
.project-card .top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.project-card h3 { font-size: 15.5px; font-weight: 650; letter-spacing: -.1px; }
.project-card .desc {
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 40px;
}
.project-card .meta { display: flex; align-items: center; gap: 12px; font-size: 12px; color: var(--muted); flex-wrap: wrap; }
.project-card .meta .m { display: inline-flex; align-items: center; gap: 5px; }
.project-card .meta svg { width: 13px; height: 13px; }
.project-card .foot { display: flex; align-items: center; justify-content: space-between; margin-top: auto; padding-top: 3px; }
.project-card .foot .actions { display: flex; gap: 2px; opacity: 0; transition: opacity .16s; }
.project-card:hover .foot .actions { opacity: 1; }
.proj-ring { display: flex; align-items: center; gap: 8px; }
.proj-ring b { font-size: 12.5px; font-weight: 650; }
.proj-ring small { font-size: 10.5px; color: var(--muted); }

/* --------------------------------------------------------------------------
   筛选栏 / 表单控件
   -------------------------------------------------------------------------- */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.filter-bar .grow { flex: 1; }

.select, .input, .textarea {
  height: 36px;
  padding: 0 11px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 12.8px;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
  min-width: 0;
}
.select {
  appearance: none;
  padding-right: 30px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237b849a' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 9px center;
  background-size: 14px;
  cursor: pointer;
}
.select:hover, .input:hover, .textarea:hover { border-color: var(--border-strong); }
.select:focus, .input:focus, .textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.textarea { height: auto; padding: 9px 11px; resize: vertical; min-height: 74px; line-height: 1.6; }

.inline-search {
  display: flex;
  align-items: center;
  gap: 7px;
  height: 36px;
  padding: 0 11px;
  min-width: 200px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
}
.inline-search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.inline-search svg { width: 15px; height: 15px; flex: none; }
.inline-search input { border: 0; outline: 0; background: none; width: 100%; font-size: 12.8px; color: var(--text); }

.segmented {
  display: inline-flex;
  padding: 3px;
  gap: 2px;
  background: var(--surface-3);
  border-radius: 10px;
}
.segmented button {
  height: 28px;
  padding: 0 11px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  transition: background .15s, color .15s;
}
.segmented button.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-xs); }

/* --------------------------------------------------------------------------
   看板
   -------------------------------------------------------------------------- */
.kanban {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  align-items: start;
}
.kanban-col {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 10px;
  min-height: 220px;
  display: flex;
  flex-direction: column;
  transition: background .15s, border-color .15s, box-shadow .15s;
}
.kanban-col.drag-over { border-color: var(--accent); background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent); }
.kanban-col-head { display: flex; align-items: center; gap: 8px; padding: 4px 6px 12px; }
.kanban-col-head .dot { width: 8px; height: 8px; border-radius: 50%; }
.kanban-col-head b { font-size: 12.5px; font-weight: 650; letter-spacing: .2px; }
.kanban-col-head .cnt {
  margin-left: auto;
  min-width: 22px;
  height: 20px;
  padding: 0 6px;
  border-radius: 6px;
  background: var(--surface-3);
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
  display: grid;
  place-items: center;
  font-variant-numeric: tabular-nums;
}
.kanban-col-head .add { margin-left: 2px; }
.kanban-list { display: flex; flex-direction: column; flex: 1; min-height: 60px; }

.task-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 13px;
  margin-bottom: 9px;
  cursor: grab;
  box-shadow: var(--shadow-xs);
  transition: box-shadow .16s, border-color .16s, transform .16s;
}
.task-card:hover { border-color: var(--border-strong); box-shadow: var(--shadow-md); transform: translateY(-1px); }
.task-card:active { cursor: grabbing; }
.task-card.dragging { opacity: .45; transform: rotate(1deg); }
.task-card .tc-top { display: flex; align-items: center; gap: 7px; margin-bottom: 7px; }
.task-card .tc-title { font-size: 13px; font-weight: 600; line-height: 1.45; }
.task-card .tc-desc {
  font-size: 11.5px;
  color: var(--muted);
  margin-top: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.task-card .tc-tags { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 8px; }
.task-card .tc-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 10px; }
.task-card .tc-proj { font-size: 10.5px; color: var(--muted); display: flex; align-items: center; gap: 5px; min-width: 0; }
.task-card .tc-proj i { width: 6px; height: 6px; border-radius: 2px; flex: none; }
.task-card .tc-proj span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.task-card .tc-due { display: flex; align-items: center; gap: 4px; font-size: 10.5px; font-weight: 600; }
.task-card .tc-due svg { width: 11px; height: 11px; }
.task-card .tc-due.late { color: var(--red); }
.task-card .tc-due.soon { color: var(--amber); }
.task-card .tc-due.ok { color: var(--muted); }

.prio-bar { position: absolute; left: 0; top: 12px; bottom: 12px; width: 3px; border-radius: 0 3px 3px 0; }

/* --------------------------------------------------------------------------
   任务表格
   -------------------------------------------------------------------------- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th {
  text-align: left;
  font-size: 11px;
  font-weight: 650;
  letter-spacing: .5px;
  text-transform: uppercase;
  color: var(--muted);
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  background: var(--surface-2);
}
.table th:first-child { padding-left: 20px; }
.table td { padding: 12px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table td:first-child { padding-left: 20px; }
.table tbody tr { transition: background .13s; cursor: pointer; }
.table tbody tr:hover { background: var(--surface-2); }
.table tbody tr:last-child td { border-bottom: 0; }
.table .cell-title { display: flex; align-items: center; gap: 10px; min-width: 0; }
.table .cell-title .tt { font-weight: 550; }
.table .cell-title .tt.done { color: var(--muted); text-decoration: line-through; }
.table .cell-title .tags { display: flex; gap: 4px; }
.table .row-actions { display: flex; gap: 2px; justify-content: flex-end; opacity: 0; transition: opacity .15s; }
.table tbody tr:hover .row-actions { opacity: 1; }

.status-select {
  height: 28px;
  border-radius: 7px;
  border: 1px solid transparent;
  background: var(--surface-3);
  font-size: 11.5px;
  font-weight: 600;
  padding: 0 6px;
  cursor: pointer;
  outline: none;
}

/* --------------------------------------------------------------------------
   甘特图
   -------------------------------------------------------------------------- */
.gantt-scroll {
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: var(--surface);
  max-height: 72vh;
  position: relative;
}
.gantt { position: relative; min-width: max-content; }

.gantt-head { display: flex; position: sticky; top: 0; z-index: 6; background: var(--surface); border-bottom: 1px solid var(--border); }
.gantt-head-label {
  width: 244px;
  flex: none;
  position: sticky;
  left: 0;
  z-index: 7;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  align-items: flex-end;
  padding: 0 16px 10px;
  font-size: 11px;
  font-weight: 650;
  letter-spacing: .6px;
  text-transform: uppercase;
  color: var(--muted);
  height: 62px;
  box-sizing: border-box;
}
.gantt-axis { flex: none; }
.gantt-months { display: flex; height: 30px; }
.gantt-month {
  flex: none;
  font-size: 11px;
  font-weight: 650;
  color: var(--text-2);
  padding: 8px 0 0 9px;
  border-left: 1px solid var(--border);
  white-space: nowrap;
  overflow: hidden;
}
.gantt-days { display: flex; height: 32px; }
.gantt-day {
  flex: none;
  width: 28px;
  font-size: 10px;
  color: var(--muted);
  text-align: center;
  line-height: 32px;
  border-left: 1px solid var(--border);
  font-variant-numeric: tabular-nums;
}
.gantt-day.weekend { background: var(--surface-2); color: var(--border-strong); }
.gantt-day.today { background: var(--accent-soft); color: var(--accent); font-weight: 700; }

.gantt-body { position: relative; }
.gantt-group {
  display: flex;
  align-items: center;
  height: 36px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  font-size: 12px;
  font-weight: 650;
  color: var(--text-2);
}
.gantt-group .lbl {
  width: 244px;
  flex: none;
  padding: 0 16px;
  position: sticky;
  left: 0;
  z-index: 4;
  background: var(--surface-2);
  display: flex;
  align-items: center;
  gap: 7px;
  box-sizing: border-box;
}
.gantt-group .lbl i { width: 7px; height: 7px; border-radius: 2px; }
.gantt-group .lbl b { font-weight: 650; }
.gantt-group .lane { flex: none; }

.gantt-row { display: flex; align-items: center; height: 46px; border-bottom: 1px solid var(--border); }
.gantt-row:last-child { border-bottom: 0; }
.gantt-row:hover { background: var(--surface-2); }
.gantt-row:hover .gantt-label { background: var(--surface-2); }
.gantt-label {
  width: 244px;
  flex: none;
  position: sticky;
  left: 0;
  z-index: 4;
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 0 14px 0 16px;
  display: flex;
  align-items: center;
  gap: 9px;
  height: 100%;
  box-sizing: border-box;
}
.gantt-label .nm { font-size: 12.5px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gantt-lane {
  position: relative;
  height: 100%;
  flex: none;
  background-image: linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 28px 100%;
}
.gantt-bar {
  position: absolute;
  top: 12px;
  height: 22px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  padding: 0 7px;
  font-size: 10.5px;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  box-shadow: 0 3px 8px -4px rgba(0, 0, 0, .5);
  transition: filter .15s;
  cursor: default;
}
.gantt-bar:hover { filter: brightness(1.08); }
.gantt-bar > span { overflow: hidden; text-overflow: ellipsis; }
.gantt-today-line {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(180deg, var(--red), rgba(239, 68, 68, .15));
  z-index: 3;
  pointer-events: none;
}
.gantt-today-line::before {
  content: "今天";
  position: absolute;
  top: 4px;
  left: 4px;
  font-size: 9.5px;
  font-weight: 700;
  color: #fff;
  background: var(--red);
  border-radius: 4px;
  padding: 1px 5px;
  white-space: nowrap;
}

/* --------------------------------------------------------------------------
   成员
   -------------------------------------------------------------------------- */
.member-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 16px; }
.member-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 20px;
  box-shadow: var(--shadow-xs);
  transition: transform .18s, box-shadow .18s, border-color .18s;
}
.member-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: var(--border-strong); }
.member-top { display: flex; align-items: center; gap: 12px; }
.member-top .meta { min-width: 0; flex: 1; }
.member-top .meta b { display: block; font-size: 14.5px; font-weight: 650; }
.member-top .meta span { font-size: 12px; color: var(--muted); }
.member-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 16px; padding-top: 15px; border-top: 1px solid var(--border); }
.member-stats .s { text-align: center; }
.member-stats .s b { display: block; font-size: 17px; font-weight: 700; letter-spacing: -.3px; font-variant-numeric: tabular-nums; }
.member-stats .s span { font-size: 11px; color: var(--muted); }
.member-load { margin-top: 14px; }
.member-load .lh { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); margin-bottom: 5px; }

/* --------------------------------------------------------------------------
   数据管理
   -------------------------------------------------------------------------- */
.data-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.data-card { padding: 22px; display: flex; flex-direction: column; gap: 12px; }
.data-card h3 { font-size: 14.5px; font-weight: 650; display: flex; align-items: center; gap: 8px; }
.data-card h3 svg { width: 17px; height: 17px; color: var(--accent); }
.data-card p { font-size: 12.5px; color: var(--muted); line-height: 1.65; }
.data-actions { display: flex; gap: 9px; flex-wrap: wrap; margin-top: auto; padding-top: 4px; }
.stat-line { display: flex; justify-content: space-between; font-size: 12.5px; padding: 7px 0; border-bottom: 1px dashed var(--border); }
.stat-line:last-child { border-bottom: 0; }
.stat-line span { color: var(--muted); }
.stat-line b { font-weight: 600; font-variant-numeric: tabular-nums; }
kbd {
  display: inline-block;
  padding: 1px 5px;
  border-radius: 5px;
  border: 1px solid var(--border-strong);
  border-bottom-width: 2px;
  background: var(--surface-2);
  font-size: 10.5px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  color: var(--text-2);
}
.about-list { display: flex; flex-direction: column; gap: 8px; font-size: 12.5px; color: var(--muted); }
.about-list b { color: var(--text-2); font-weight: 600; }

/* --------------------------------------------------------------------------
   弹窗 / 提示
   -------------------------------------------------------------------------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(13, 17, 28, .48);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 22px;
  animation: fadeIn .16s ease both;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal {
  width: min(600px, 100%);
  max-height: calc(100vh - 44px);
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-lg);
  animation: popIn .2s cubic-bezier(.2, .9, .3, 1.2) both;
}
.modal.wide { width: min(760px, 100%); }
@keyframes popIn { from { opacity: 0; transform: translateY(10px) scale(.985); } to { opacity: 1; transform: none; } }
.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 22px 0;
}
.modal-head h2 { font-size: 17px; font-weight: 680; letter-spacing: -.2px; }
.modal-head .sub { font-size: 12.5px; color: var(--muted); margin-top: 3px; }
.modal-body { padding: 18px 22px; }
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  padding: 6px 22px 20px;
}
.modal-actions.split { justify-content: space-between; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.field.span-2 { grid-column: 1 / -1; }
.field .input, .field .select, .field .textarea { width: 100%; }
.field .hint { font-size: 11px; color: var(--muted); font-weight: 400; }
.field .input, .field .select { height: 38px; }
.form-error {
  display: none;
  margin-top: 4px;
  padding: 9px 12px;
  border-radius: 9px;
  background: var(--red-soft);
  color: var(--red);
  font-size: 12px;
  font-weight: 500;
}
.form-error.show { display: block; }

.confirm-text { font-size: 13.5px; color: var(--text-2); line-height: 1.7; }
.confirm-text b { color: var(--text); }

.toast-root {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 9px;
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 200px;
  max-width: 340px;
  padding: 11px 15px;
  border-radius: 11px;
  background: #1c2030;
  color: #f1f3fa;
  font-size: 12.8px;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  animation: toastIn .22s cubic-bezier(.2, .9, .3, 1.2) both;
  border: 1px solid rgba(255, 255, 255, .08);
}
.toast svg { width: 16px; height: 16px; flex: none; }
.toast.success svg { color: #34d399; }
.toast.error svg { color: #f87171; }
.toast.out { animation: toastOut .2s ease both; }
@keyframes toastIn { from { opacity: 0; transform: translateY(12px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateY(8px); } }

/* --------------------------------------------------------------------------
   响应式
   -------------------------------------------------------------------------- */
@media (max-width: 1240px) {
  .kanban { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 1080px) {
  .sidebar {
    position: fixed;
    left: 0; top: 0; bottom: 0;
    transform: translateX(-102%);
    transition: transform .25s cubic-bezier(.4, 0, .2, 1);
    box-shadow: 20px 0 60px rgba(0, 0, 0, .3);
    width: 268px;
  }
  .sidebar.open { transform: none; }
  .sidebar-scrim {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 45;
    background: rgba(10, 12, 20, .45);
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s;
  }
  .sidebar-scrim.show { opacity: 1; pointer-events: auto; }
  .menu-btn { display: inline-flex; }
  .dash-grid { grid-template-columns: 1fr; }
  .project-row { grid-template-columns: minmax(0, 1fr) 100px 54px 42px; }
  .kanban { display: flex; overflow-x: auto; padding-bottom: 10px; }
  .kanban-col { min-width: 272px; flex: 1 0 272px; }
}

@media (max-width: 820px) {
  :root { --topbar-h: 62px; }
  .view { padding: 18px 16px 48px; }
  .topbar { padding: 0 14px; gap: 10px; }
  .search { display: none; }
  .topbar .btn-primary { padding: 0 12px; }
  .topbar .btn-primary span { display: none; }
  .data-grid { grid-template-columns: 1fr; }
  .crumbs-root, .crumbs-sep { display: none; }
  .page-head h1 { font-size: 21px; }
  .kpi-grid { grid-template-columns: 1fr; gap: 12px; }
  .kpi-value { font-size: 26px; }
  .avatar-stack { display: none; }
  .form-grid { grid-template-columns: 1fr; }
  .modal { border-radius: 16px; }
  .donut-wrap { flex-direction: column; align-items: flex-start; }
  .project-grid { grid-template-columns: 1fr; }
  .gantt-head-label, .gantt-label, .gantt-group .lbl { width: 160px; }
}

@media (min-width: 1081px) {
  .sidebar-scrim { display: none; }
}

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

/* 色板选择器 */
.swatches { display: flex; gap: 8px; flex-wrap: wrap; padding-top: 2px; }
.swatch {
  width: 26px; height: 26px; border-radius: 8px;
  border: 2px solid transparent;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.08);
  transition: transform .12s ease, border-color .12s ease;
}
.swatch:hover { transform: scale(1.1); }
.swatch.active { border-color: var(--text); box-shadow: inset 0 0 0 2px var(--surface); }

/* 看板空列 */
.col-empty {
  padding: 26px 10px;
  text-align: center;
  font-size: 12px;
  color: var(--muted);
  border: 1px dashed var(--border-strong);
  border-radius: 10px;
  line-height: 1.8;
}
.col-empty span { font-size: 11px; opacity: .78; }

/* 组织架构 */
.member-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.org-stats { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.org-stat { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 14px 16px; box-shadow: var(--shadow-xs); display: flex; flex-direction: column; gap: 2px; }
.org-stat b { font-size: 22px; font-weight: 700; letter-spacing: -.5px; }
.org-stat span { font-size: 12px; color: var(--muted); }

.dept-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; margin-bottom: 16px; }
.dept-card { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 18px; box-shadow: var(--shadow-xs); display: flex; flex-direction: column; gap: 12px; transition: transform .18s, box-shadow .18s, border-color .18s; }
.dept-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: var(--border-strong); }
.dept-head { display: flex; gap: 11px; align-items: flex-start; }
.dept-mark { width: 38px; height: 38px; flex: none; border-radius: 11px; display: grid; place-items: center; font-size: 16px; font-weight: 700; }
.dept-title { min-width: 0; flex: 1; }
.dept-title h3 { font-size: 15px; font-weight: 650; }
.dept-title p { font-size: 12px; color: var(--muted); line-height: 1.55; margin-top: 2px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.dept-actions { display: flex; opacity: .55; transition: opacity .15s; }
.dept-card:hover .dept-actions { opacity: 1; }
.dept-meta { display: flex; align-items: center; gap: 14px; font-size: 12px; color: var(--text-2); padding-top: 10px; border-top: 1px dashed var(--border); }
.dept-meta .m { display: inline-flex; align-items: center; gap: 7px; min-width: 0; }
.dept-meta .m span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dept-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.dim { color: var(--muted); }
.small { font-size: 12px; }

.roster-card { overflow: hidden; }
.role-legend { display: flex; gap: 6px; flex-wrap: wrap; }
.role-chip { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 6px; font-size: 11px; font-weight: 600; }
.roster { margin-top: 12px; border-top: 1px solid var(--border); }
.roster-group + .roster-group { border-top: 1px solid var(--border); }
.roster-head { display: flex; align-items: center; gap: 8px; padding: 10px 20px; background: var(--surface-2); font-size: 12.5px; }
.roster-head .dot { width: 8px; height: 8px; border-radius: 50%; }
.roster-head .cnt { margin-left: 6px; color: var(--muted); font-size: 11.5px; }
.roster-row { display: grid; grid-template-columns: minmax(170px, 1.5fr) 120px minmax(150px, 1.2fr) 90px 48px; align-items: center; gap: 12px; padding: 10px 20px; border-top: 1px dashed var(--border); }
.roster-row:hover { background: var(--surface-2); }
.roster-row .who { display: flex; align-items: center; gap: 9px; min-width: 0; }
.roster-row .who b { display: block; font-size: 13px; font-weight: 600; }
.roster-row .who span { font-size: 11.5px; color: var(--muted); }
.form-hint { font-size: 11.5px; color: var(--muted); line-height: 1.6; padding: 9px 11px; border-radius: 9px; background: var(--surface-2); }

@media (max-width: 1080px) {
  .org-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 820px) {
  .org-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .roster-row { grid-template-columns: 1fr 96px 40px; padding: 10px 14px; }
  .roster-row > div:nth-child(3), .roster-row > div:nth-child(4) { display: none; }
}

/* 身份切换 / 超级管理员 */
.identity { border-radius: 12px; border: 1px solid var(--sidebar-line); background: rgba(255,255,255,.04); padding: 9px 10px; display: flex; flex-direction: column; gap: 7px; }
.identity-head { display: flex; align-items: center; justify-content: space-between; gap: 6px; font-size: 10.5px; letter-spacing: .4px; color: #7b849e; }
.admin-badge {
  display: inline-flex; align-items: center; height: 17px; padding: 0 6px;
  border-radius: 5px; background: linear-gradient(100deg, #6366f1, #a855f7);
  color: #fff; font-size: 9px; font-weight: 700; letter-spacing: .2px;
  margin-left: 6px; vertical-align: 2px; white-space: nowrap;
}
#identity-select {
  width: 100%; height: 30px; border-radius: 8px;
  border: 1px solid rgba(255,255,255,.12); background: rgba(255,255,255,.06);
  color: var(--sidebar-text-strong); font-size: 12px; padding: 0 6px; outline: none; cursor: pointer;
}
#identity-select:focus { border-color: rgba(139,92,246,.8); }
#identity-select option { color: #111827; background: #fff; }
.readonly-chip {
  display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px;
  border-radius: 9px; background: var(--surface-2); border: 1px dashed var(--border-strong);
  color: var(--muted); font-size: 12px; font-weight: 500;
}
.readonly-chip svg { width: 14px; height: 14px; }
.check-line {
  display: flex; align-items: center; gap: 9px; padding: 10px 12px;
  border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border);
  font-size: 12.5px; font-weight: 600; color: var(--text-2); cursor: pointer; flex-wrap: wrap;
}
.check-line input { width: 16px; height: 16px; accent-color: var(--accent); cursor: pointer; }
.check-line em { font-style: normal; font-weight: 400; color: var(--muted); font-size: 11.5px; }

/* 徽标在深色文字容器内的可读性覆盖 */
.member-top .meta b .admin-badge,
.roster-row .who b .admin-badge {
  font-size: 9px;
  color: #fff;
  height: 16px;
  line-height: 16px;
  letter-spacing: .2px;
  vertical-align: 1px;
  margin-left: 5px;
  padding: 0 5px;
}

/* 名册：成员统计与负载（成员页并入后） */
.roster-row { grid-template-columns: minmax(180px, 1.4fr) 108px minmax(140px, 1.1fr) 200px 116px 44px; }
.roster-nums { display: flex; gap: 12px; font-size: 11px; color: var(--muted); white-space: nowrap; }
.roster-nums b { color: var(--text); font-weight: 650; margin-right: 2px; font-variant-numeric: tabular-nums; }
.roster-nums .late b { color: var(--red); }
.roster-load { display: flex; align-items: center; gap: 7px; }
.roster-load .load-bar { flex: 1; height: 6px; }
.roster-load > span { font-size: 10.5px; color: var(--muted); width: 28px; text-align: right; font-variant-numeric: tabular-nums; }

@media (max-width: 1080px) {
  .roster-row { grid-template-columns: minmax(150px, 1.4fr) 100px minmax(120px, 1fr) 160px 96px 40px; }
  .roster-nums { gap: 8px; font-size: 10.5px; }
}
@media (max-width: 820px) {
  .roster-row { grid-template-columns: 1fr 92px 40px; }
  .roster-row > div:nth-child(3), .roster-row > div:nth-child(4), .roster-row > div:nth-child(5) { display: none; }
}

/* 组织架构：竖向树 + 成员表 */
.org-layout { display: grid; grid-template-columns: 258px minmax(0, 1fr); gap: 16px; align-items: start; }

.org-tree {
  background: var(--surface); border: 1px solid var(--border); border-radius: 16px;
  box-shadow: var(--shadow-xs); padding: 10px; position: sticky; top: 86px;
}
.tree-head { display: flex; align-items: center; justify-content: space-between; padding: 6px 8px 10px; font-size: 12.5px; font-weight: 650; color: var(--text-2); }
.tree-node {
  display: flex; align-items: center; gap: 9px; padding: 8px 9px; border-radius: 9px;
  font-size: 13px; color: var(--text-2); cursor: pointer; user-select: none;
  transition: background .15s, color .15s; position: relative;
}
.tree-node:hover { background: var(--surface-2); }
.tree-node.active { background: var(--accent-soft); color: var(--accent); font-weight: 650; }
.tree-node.root { margin-bottom: 6px; font-weight: 600; }
.tree-children { position: relative; padding-left: 14px; }
.tree-children::before { content: ""; position: absolute; left: 20px; top: 0; bottom: 8px; width: 1px; background: var(--border); }
.tree-children .tree-node { margin-bottom: 2px; }
.tn-icon { width: 24px; height: 24px; border-radius: 7px; display: grid; place-items: center; flex: none; }
.tn-icon svg { width: 14px; height: 14px; }
.tn-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tn-cnt { font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.tree-node.active .tn-cnt { color: var(--accent); }
.tn-ops { display: none; align-items: center; margin-right: -5px; background: inherit; }
.tree-node:hover .tn-ops { display: flex; }
.tn-ops .icon-btn { width: 24px; height: 24px; }
.tn-ops .icon-btn svg { width: 13px; height: 13px; }
.tree-foot { margin-top: 8px; padding: 10px 9px 4px; border-top: 1px dashed var(--border); font-size: 11px; color: var(--muted); }
.tree-empty { padding: 6px 9px; font-size: 12px; color: var(--muted); }

.org-main { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow-xs); overflow: hidden; }
.org-main-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.org-main-head h2 { font-size: 15px; font-weight: 650; }
.org-main-head .sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.org-main-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.org-main-actions .inline-search { min-width: 210px; }

.member-table th:first-child, .member-table td:first-child { padding-left: 18px; }
.member-table tbody tr { cursor: pointer; }
.who-cell { display: flex; align-items: center; gap: 9px; min-width: 0; }
.who-cell b { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; }
.who-cell > div > span { font-size: 11px; color: var(--muted); }
.member-table .num { font-variant-numeric: tabular-nums; font-weight: 600; }
.member-table .num.late { color: var(--red); }
.load-cell { display: flex; align-items: center; gap: 7px; min-width: 96px; }
.load-cell .load-bar { flex: 1; height: 6px; }
.load-cell > span { font-size: 10.5px; color: var(--muted); width: 28px; text-align: right; font-variant-numeric: tabular-nums; }

@media (max-width: 1180px) {
  .org-layout { grid-template-columns: 226px minmax(0, 1fr); }
}
@media (max-width: 1080px) {
  .org-layout { grid-template-columns: 1fr; }
  .org-tree { position: static; }
  .tree-children { display: flex; flex-wrap: wrap; gap: 4px; padding-left: 0; }
  .tree-children::before { display: none; }
  .tree-children .tree-node { width: auto; margin-bottom: 0; }
}
@media (max-width: 820px) {
  .member-table th:nth-child(4), .member-table td:nth-child(4),
  .member-table th:nth-child(7), .member-table td:nth-child(7) { display: none; }
  .org-main-head { padding: 14px; }
  .org-main-actions .inline-search { min-width: 0; flex: 1; }
}

/* 右上角当前登录账号 */
.account { position: relative; }
.account-btn {
  display: flex; align-items: center; gap: 8px; height: 42px; padding: 5px 12px 5px 6px;
  border-radius: 12px; border: 1px solid var(--border); background: var(--surface);
  box-shadow: var(--shadow-xs); cursor: pointer; transition: border-color .15s;
}
.account-btn:hover { border-color: var(--border-strong); }
.account-btn .ac-main { display: flex; flex-direction: column; line-height: 1.2; text-align: left; min-width: 0; }
.account-btn .ac-main b { font-size: 12.5px; font-weight: 650; white-space: nowrap; }
.account-btn .ac-main span { font-size: 10.5px; color: var(--muted); white-space: nowrap; }
.account-btn .pill { margin: 0 2px; }
.account-btn .chev { color: var(--muted); display: flex; }
.account-btn .chev svg { width: 14px; height: 14px; }

.account-pop {
  position: absolute; top: calc(100% + 8px); right: 0; width: 264px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  box-shadow: var(--shadow-lg); padding: 10px; z-index: 60; display: none;
}
.account.open .account-pop { display: block; }
.ac-head { display: flex; align-items: center; gap: 10px; padding: 6px 8px 12px; border-bottom: 1px solid var(--border); }
.ac-head > div { min-width: 0; }
.ac-head b { font-size: 13.5px; font-weight: 650; display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.ac-head span { font-size: 11.5px; color: var(--muted); display: block; margin-top: 2px; }
.ac-head b .admin-badge { color: #fff; }
.ac-label { font-size: 10.5px; letter-spacing: .6px; color: var(--muted); padding: 10px 8px 6px; }
.ac-item { display: flex; align-items: center; gap: 9px; width: 100%; padding: 7px 8px; border: 0; border-radius: 9px; background: transparent; text-align: left; cursor: pointer; transition: background .15s; }
.ac-item:hover { background: var(--surface-2); }
.ac-item.active { background: var(--accent-soft); }
.ac-item .ac-item-main { flex: 1; min-width: 0; }
.ac-item .ac-item-main b { display: flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 600; }
.ac-item .ac-item-main b .admin-badge { color: #fff; }
.ac-item .ac-item-main span { font-size: 11px; color: var(--muted); display: block; }
.ac-item > svg { width: 15px; height: 15px; color: var(--accent); flex: none; }

@media (max-width: 820px) {
  .account-btn .ac-main span, .account-btn .pill { display: none; }
  .account-btn { padding-right: 8px; }
}

/* 登录界面 */
.login-screen { position: fixed; inset: 0; z-index: 300; display: flex; align-items: center; justify-content: center; padding: 24px; background: var(--bg); overflow: auto; }
.login-screen.hidden { display: none; }
.login-bg { position: absolute; inset: 0; background:
  radial-gradient(600px 420px at 12% 8%, rgba(99,102,241,.18), transparent 62%),
  radial-gradient(720px 520px at 88% 92%, rgba(168,85,247,.16), transparent 62%),
  radial-gradient(520px 420px at 72% 10%, rgba(14,165,233,.10), transparent 60%); }
.login-card { position: relative; width: min(400px, 100%); background: var(--surface); border: 1px solid var(--border); border-radius: 22px; padding: 32px 30px 24px; box-shadow: var(--shadow-lg); }
.login-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 24px; }
.login-brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.login-brand-text strong { font-size: 15px; }
.login-brand-text span { font-size: 11.5px; color: var(--muted); }
.login-card h1 { font-size: 23px; font-weight: 700; letter-spacing: -.5px; }
.login-sub { font-size: 12.5px; color: var(--muted); margin: 5px 0 20px; }
.login-field { display: block; margin-bottom: 14px; }
.login-field > span { display: block; font-size: 12px; font-weight: 600; color: var(--text-2); margin-bottom: 6px; }
.login-field input { width: 100%; height: 44px; padding: 0 13px; border-radius: 11px; border: 1px solid var(--border); background: var(--surface-2); font-size: 13.5px; outline: none; transition: .15s; }
.login-field input:focus { border-color: var(--accent); background: var(--surface); box-shadow: 0 0 0 3px var(--accent-soft); }
.login-error { display: none; font-size: 12px; color: var(--red); background: var(--red-soft); padding: 8px 11px; border-radius: 9px; margin-bottom: 12px; }
.login-error.show { display: block; }
.login-submit { width: 100%; height: 44px; border-radius: 11px; font-size: 14px; letter-spacing: 4px; margin-top: 4px; }
.login-foot { font-size: 11px; color: var(--muted); text-align: center; margin-top: 18px; line-height: 1.6; }

/* 右上角账号 + 退出 */
.account { display: flex; align-items: center; gap: 8px; }
.account-chip { display: flex; align-items: center; gap: 8px; height: 42px; padding: 5px 12px 5px 6px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); box-shadow: var(--shadow-xs); }
.account-chip .ac-main { display: flex; flex-direction: column; line-height: 1.2; text-align: left; min-width: 0; }
.account-chip .ac-main b { font-size: 12.5px; font-weight: 650; white-space: nowrap; display: flex; align-items: center; gap: 5px; }
.account-chip .ac-main span { font-size: 10.5px; color: var(--muted); white-space: nowrap; }
.logout-btn { width: 40px; height: 40px; flex: none; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); color: var(--muted); display: grid; place-items: center; box-shadow: var(--shadow-xs); transition: .15s; }
.logout-btn:hover { color: var(--red); border-color: var(--red); }
.logout-btn svg { width: 17px; height: 17px; }

@media (max-width: 820px) {
  .account-chip .ac-main span, .account-chip .pill { display: none; }
}

/* 个人中心 */
.account-pop.pc-pop { width: 300px; padding: 14px; }
.pc-head { display: flex; align-items: center; gap: 11px; padding-bottom: 12px; border-bottom: 1px solid var(--border); }
.pc-title { min-width: 0; flex: 1; }
.pc-title b { font-size: 14px; font-weight: 650; display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.pc-title b .admin-badge { color: #fff; }
.pc-title span { font-size: 11.5px; color: var(--muted); display: block; margin-top: 3px; }
.pc-tag { font-size: 10.5px; color: var(--accent); background: var(--accent-soft); padding: 2px 7px; border-radius: 6px; font-weight: 600; flex: none; }
.pc-rows { display: flex; flex-direction: column; padding: 6px 0 12px; }
.pc-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 2px; border-bottom: 1px dashed var(--border); font-size: 12.5px; }
.pc-row:last-child { border-bottom: 0; }
.pc-row span { color: var(--muted); flex: none; }
.pc-row b { font-weight: 600; color: var(--text); text-align: right; word-break: break-all; font-variant-numeric: tabular-nums; }
.pc-pop .btn-block { margin-top: 2px; }

/* 头像上传 */
.avatar { overflow: hidden; }
.avatar-img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; display: block; }
.avatar-picker {
  display: flex; align-items: center; gap: 14px; padding: 14px;
  border: 1px dashed var(--border-strong); border-radius: 12px;
  background: var(--surface-2); margin-bottom: 16px;
}
.ap-preview { width: 52px; height: 52px; flex: none; display: grid; place-items: center; }
.ap-preview .avatar, .ap-preview .avatar-img { width: 52px; height: 52px; border-radius: 50%; }
.ap-preview .avatar { font-size: 18px; }
.ap-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ap-hint { font-size: 11.5px; color: var(--muted); }

/* 名字前的小头像 */
.who-mini { display: inline-flex; align-items: center; gap: 5px; }
.who-mini .avatar { width: 16px; height: 16px; font-size: 8px; }

/* 超级管理员固定提示 */
.admin-fixed {
  grid-column: 1 / -1;
  display: flex; align-items: center; gap: 7px;
  padding: 9px 12px; border-radius: 9px;
  background: var(--accent-soft); color: var(--accent);
  font-size: 12.5px; font-weight: 600;
}
.admin-fixed svg { width: 15px; height: 15px; }

/* 角色管理 */
.role-list { display: flex; flex-direction: column; }
.role-row { display: flex; align-items: center; gap: 10px; padding: 9px 2px; border-bottom: 1px dashed var(--border); }
.role-row:last-child { border-bottom: 0; }
.role-row .dim { margin-left: auto; }
.role-add { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.role-add .input { flex: 1; min-width: 200px; }

/* 项目列表 */
.project-table td { vertical-align: middle; }
.project-table .col-proj-name { min-width: 340px; }
.project-table .col-proj-code { width: 1%; white-space: nowrap; }
.proj-cell { display: flex; align-items: center; gap: 10px; min-width: 0; }
.proj-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.proj-cell > div { min-width: 0; }
.proj-cell b { display: block; font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 260px; }
.proj-cell span { display: block; font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 260px; }
.project-table .col-proj-name .proj-cell b,
.project-table .col-proj-name .proj-cell span { max-width: 480px; }
.proj-progress { display: flex; align-items: center; gap: 8px; min-width: 130px; }
.proj-progress .progress { flex: 1; height: 6px; }
.proj-progress > span { font-size: 11px; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.proj-due { display: flex; flex-direction: column; gap: 2px; }

/* 权限矩阵 */
.perm-table td { font-size: 12.5px; }
.perm-yes { color: var(--green); font-weight: 700; }
.perm-no { color: var(--muted); }

/* 客户管理 */
.cust-name { font-size: 13px; font-weight: 600; }
.customer-table td { vertical-align: top; }

/* 必填标记 */
.req-star { color: var(--red); margin-left: 3px; font-weight: 700; }

/* 客户编号 */
.cust-code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; color: var(--muted); letter-spacing: .3px; white-space: nowrap; }

/* 客户列表：仅名称可点击 */
.customer-table tbody tr { cursor: default; }
.customer-table tbody tr:hover { background: transparent; }
.cust-name-btn {
  background: none; border: 0; padding: 0; font: inherit;
  font-size: 13px; font-weight: 600; color: var(--text); cursor: pointer; text-align: left;
}
.cust-name-btn:hover { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }

/* 必填星号与字段标题同行 */
.field-label { display: inline-flex; align-items: center; gap: 2px; }
.req-star { color: var(--red); font-weight: 700; margin-left: 2px; }

/* 项目编号 */
.proj-code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; color: var(--muted); letter-spacing: .3px; white-space: nowrap; }

/* 概览：项目进度查看全部 */
.project-more { padding: 10px 10px 2px; font-size: 12px; color: var(--muted); }
.project-more a { color: var(--accent); font-weight: 600; text-decoration: none; }
.project-more a:hover { text-decoration: underline; }

/* 项目详情页 */
.detail-page { display: flex; flex-direction: column; gap: 16px; }
.detail-hero-card { overflow: hidden; }
.detail-hero { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; padding: 24px 24px 18px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.dh-code { display: block; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; color: var(--muted); letter-spacing: .4px; margin-top: 6px; }
.detail-hero h1 { font-size: 22px; font-weight: 700; letter-spacing: -.4px; }
.dh-sub { font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.dh-side { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.dh-actions { display: flex; gap: 8px; }
.info-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); padding: 6px 8px 10px; }
.info-item { padding: 12px 16px; border-bottom: 1px dashed var(--border); min-width: 0; }
.info-item > span { display: block; font-size: 11.5px; color: var(--muted); margin-bottom: 4px; }
.info-item b { font-size: 13px; font-weight: 600; color: var(--text); word-break: break-word; }
.detail-desc { padding: 4px 24px 18px; }
.detail-desc span { font-size: 11.5px; color: var(--muted); }
.detail-desc p { font-size: 13px; color: var(--text-2); margin-top: 4px; line-height: 1.7; }
.detail-section { overflow: hidden; }
.detail-pct { font-size: 20px; font-weight: 700; letter-spacing: -.5px; }
.detail-body { padding: 16px 22px 22px; display: flex; flex-direction: column; gap: 14px; }
.stat-pills { display: flex; gap: 10px; flex-wrap: wrap; }
.stat-pill { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 8px; background: var(--surface-2); font-size: 12px; color: var(--text-2); }
.stat-pill i { width: 8px; height: 8px; border-radius: 3px; }
.stat-pill b { font-weight: 700; color: var(--text); }
.detail-sub { font-size: 12.5px; font-weight: 650; color: var(--text-2); margin-top: 2px; }
.team-chips { display: flex; flex-wrap: wrap; gap: 10px; }
.team-chip { display: flex; align-items: center; gap: 9px; padding: 8px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
.team-chip b { display: block; font-size: 12.5px; font-weight: 600; }
.team-chip > div > span { font-size: 11px; color: var(--muted); }
.detail-task-table tbody tr { cursor: pointer; }
.detail-task-table th:first-child, .detail-task-table td:first-child { padding-left: 22px; }
.detail-task-table .tt { font-size: 13px; font-weight: 550; }
.detail-task-table .tt.done { color: var(--muted); text-decoration: line-through; }

@media (max-width: 1080px) {
  .info-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 820px) {
  .info-grid { grid-template-columns: 1fr; }
  .detail-hero { padding: 18px; }
}

/* 委托单位：客户搜索下拉 */
.combo { position: relative; }
.combo-list {
  position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 40;
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  box-shadow: var(--shadow-md); padding: 4px; max-height: 220px; overflow: auto;
}
.combo-item { display: flex; flex-direction: column; gap: 1px; padding: 7px 9px; border-radius: 7px; cursor: pointer; }
.combo-item:hover { background: var(--surface-2); }
.combo-item b { font-size: 12.5px; font-weight: 600; }
.combo-item span { font-size: 11px; color: var(--muted); }
.combo-empty { padding: 10px; font-size: 12px; color: var(--muted); }

/* 收款管理 */
/* 项目地点：省/市/区县 三级选择 */
.area-picker { display: flex; flex-direction: column; gap: 6px; }
.area-selects { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.area-selects .select { width: 100%; min-width: 0; }
@media (max-width: 720px) { .area-selects { grid-template-columns: 1fr; } }
.pay-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 16px; }
.pay-stat {
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  padding: 14px 16px; display: flex; flex-direction: column; gap: 4px; min-width: 0;
}
.pay-stat span { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pay-stat b { font-size: 18px; font-weight: 650; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 980px) { .pay-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .pay-stats { grid-template-columns: 1fr; } }
.pay-section-tools { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 10px; }
.pay-section-tools .input { max-width: 320px; }
.pay-more-hint { margin-top: 8px; font-size: 12px; color: var(--muted); }
/* 项目详情 · 底部项目管理 */
.detail-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.detail-actions .btn { gap: 6px; }
/* 角色排序 */
.role-row { display: flex; align-items: center; gap: 10px; }
.role-order { width: 16px; text-align: center; font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.role-ops { margin-left: auto; display: flex; gap: 2px; }
.role-ops .icon-btn[disabled] { pointer-events: none; }
/* 顶栏自定义链接按钮 */
.topbar-link { display: flex; align-items: center; }
.topbar-link-btn { white-space: nowrap; gap: 6px; }
@media (max-width: 860px) { .topbar-link { display: none; } }
/* 项目筛选栏 */
.filter-bar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.filter-bar .inline-search { flex: 1 1 220px; }
.filter-bar .select { width: auto; min-width: 156px; }
/* 消息通知 */
.notice-list { display: flex; flex-direction: column; gap: 12px; }
.notice-card { border: 1px solid var(--border); border-radius: 14px; padding: 16px 18px; background: var(--surface); }
.notice-card.pinned { border-color: rgba(245, 158, 11, .45); background: linear-gradient(0deg, var(--amber-soft), var(--amber-soft)), var(--surface); }
.notice-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.notice-head h3 { margin: 0; font-size: 15.5px; font-weight: 700; color: var(--text); }
.notice-pin { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 700; color: var(--amber); background: var(--amber-soft); }
.notice-pin svg { width: 12px; height: 12px; }
.notice-time { margin-left: auto; font-size: 12px; color: var(--muted); white-space: nowrap; }
.notice-body { margin-top: 9px; font-size: 13.5px; line-height: 1.75; color: var(--text); word-break: break-word; }
.notice-foot { margin-top: 11px; padding-top: 10px; border-top: 1px dashed var(--border); display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.checkline { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text); }
.checkline input { width: 16px; height: 16px; accent-color: var(--accent); }
/* 顶栏通知铃铛 */
.notice-bell { position: relative; flex: none; }
.notice-bell.has-unread { color: var(--accent); }
.notice-badge {
  position: absolute;
  top: -2px;
  right: -3px;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border-radius: 999px;
  background: #ef4444;
  color: #fff;
  font-size: 10.5px;
  font-weight: 700;
  line-height: 17px;
  text-align: center;
  box-shadow: 0 0 0 2px var(--surface);
}
.notice-badge[hidden] { display: none !important; }

/* 通知未读 / 已读 */
.notice-card { cursor: pointer; transition: border-color .15s ease, box-shadow .15s ease; }
.notice-card:hover { border-color: var(--border-strong); }
.notice-card.unread { border-left: 3px solid var(--accent); background: linear-gradient(90deg, rgba(79, 70, 229, .06), transparent 42%), var(--surface); }
.notice-state {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  flex: none;
}
.notice-state.read { color: var(--muted); background: var(--bg-soft); }
.notice-state.unread { color: #fff; background: var(--accent); }
.notice-state.unread i { width: 5px; height: 5px; border-radius: 50%; background: #fff; display: inline-block; }

/* 通知详情弹窗 */
.notice-view-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding-bottom: 10px;
  margin-bottom: 12px;
  border-bottom: 1px dashed var(--border);
  font-size: 12.5px;
  color: var(--muted);
}
.notice-view-body { font-size: 13.5px; line-height: 1.85; color: var(--text); word-break: break-word; }
/* 可视化权限矩阵 */
.perm-matrix { min-width: 640px; }
.perm-matrix th, .perm-matrix td { white-space: nowrap; }
.perm-matrix th { font-size: 12px; }
.perm-col-item { text-align: left !important; }
.perm-col-admin { text-align: center !important; color: var(--muted); }
.perm-fixed { color: #10b981; font-weight: 700; }
.perm-matrix td:not(.perm-col-item) { text-align: center; }
.perm-check { display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.perm-check input { position: absolute; opacity: 0; width: 0; height: 0; }
.perm-check span {
  width: 18px; height: 18px; border-radius: 5px;
  border: 1.5px solid var(--border-strong);
  background: var(--surface);
  display: inline-flex; align-items: center; justify-content: center;
  transition: background .12s ease, border-color .12s ease;
}
.perm-check span::after {
  content: ''; width: 9px; height: 5px;
  border-left: 2px solid #fff; border-bottom: 2px solid #fff;
  transform: rotate(-45deg) scale(0); transform-origin: center;
  transition: transform .12s ease;
  margin-top: -2px;
}
.perm-check input:checked + span { background: var(--accent); border-color: var(--accent); }
.perm-check input:checked + span::after { transform: rotate(-45deg) scale(1); }
.perm-check input:disabled + span { opacity: .55; cursor: not-allowed; }
.perm-actions { display: flex; align-items: center; gap: 12px; margin-top: 14px; flex-wrap: wrap; }
/* 系统设置只读视图：单卡片占满整行 */
.data-grid.single { grid-template-columns: minmax(0, 1fr); }
/* 概览·项目进度里的角色标签 */
.proj-tag {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 700;
  line-height: 16px;
  vertical-align: middle;
  flex: none;
}
.proj-tag.own { color: #4338ca; background: rgba(79, 70, 229, .13); }
.proj-tag.tech { color: #0369a1; background: rgba(14, 165, 233, .14); }
.proj-tag.join { color: #475569; background: rgba(100, 116, 139, .14); }
html[data-theme="dark"] .proj-tag.own { color: #c7d2fe; }
html[data-theme="dark"] .proj-tag.tech { color: #bae6fd; }
html[data-theme="dark"] .proj-tag.join { color: #cbd5e1; }

/* 概览·只有「近期截止」时占一半宽度 */
.dash-grid.half { grid-template-columns: repeat(2, minmax(0, 1fr)); }
/* 权限矩阵：表头文字与下方勾选框居中对齐 */
.perm-matrix thead th { text-align: center; vertical-align: middle; }
.perm-matrix thead th.perm-col-item { text-align: left; }
.perm-matrix tbody td { vertical-align: middle; }
.perm-matrix tbody td.perm-col-item { text-align: left; }
/* 内置角色标记 */
.role-builtin {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 700;
  color: #4338ca;
  background: rgba(79, 70, 229, .12);
  white-space: nowrap;
}
html[data-theme="dark"] .role-builtin { color: #c7d2fe; }
/* 必填项标记 */
.field .flabel { display: inline-flex; align-items: baseline; gap: 0; }
.field .req { color: var(--red, #ef4444); margin-left: 3px; font-weight: 700; line-height: 1; }
/* 项目搜索：输入框 + 搜索按钮 */
.search-group { display: flex; align-items: center; gap: 8px; flex: 1 1 260px; min-width: 0; }
.search-group .inline-search { flex: 1 1 auto; min-width: 0; }
.search-group .btn { flex: none; }

/* 参与人员选择器与展示 */
.participants-picker { border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface-2); max-height: 220px; overflow: auto; padding: 8px; }
.pp-group { margin-bottom: 8px; }
.pp-group:last-child { margin-bottom: 0; }
.pp-group-title { font-size: 11px; font-weight: 700; color: var(--muted); padding: 2px 4px 6px; letter-spacing: .02em; }
.pp-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 6px; }
.pp-item { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); cursor: pointer; transition: all .15s ease; min-width: 0; }
.pp-item:hover { border-color: var(--border-strong); background: var(--surface-3); }
.pp-item.checked, .pp-item:has(input:checked) { border-color: rgba(79,70,229,.35); background: var(--accent-soft); }
.pp-item input[type="checkbox"] { width: 15px; height: 15px; margin: 0; accent-color: var(--accent); flex: none; }
.pp-item .avatar { width: 22px; height: 22px; font-size: 10px; flex: none; }
.pp-name { font-size: 12.5px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pp-role { font-size: 11px; color: var(--muted); margin-left: auto; white-space: nowrap; }
.participants-empty { padding: 12px; font-size: 12.5px; }

.participants-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.participant-chip { display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px 2px 2px; border-radius: 999px; background: var(--surface-3); border: 1px solid var(--border); font-size: 12px; color: var(--text-2); max-width: 120px; }
.participant-chip .avatar, .participant-chip .avatar-xs { width: 18px; height: 18px; font-size: 9px; flex: none; }
.participant-chip span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.participant-more { display: inline-flex; align-items: center; justify-content: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-size: 11px; font-weight: 700; }
.tc-participants { margin-top: 6px; }
.tc-participants .participants-chips { gap: 4px; }
.tc-participants .participant-chip { padding: 1px 6px 1px 1px; font-size: 11px; max-width: 100px; }
.tc-participants .participant-chip .avatar, .tc-participants .participant-chip .avatar-xs { width: 16px; height: 16px; font-size: 8px; }

html[data-theme="dark"] .pp-item.checked, html[data-theme="dark"] .pp-item:has(input:checked) { border-color: rgba(129,140,248,.45); }