:root {
  color-scheme: light;
  --bg: #f4f5f2;
  --surface: #fcfcfa;
  --surface-soft: #f0f3f0;
  --surface-strong: #e7ece8;
  --line: #d6ddd8;
  --line-strong: #bdc9c2;
  --text: #18201f;
  --muted: #69736f;
  --ink: #171d21;
  --accent: #0d7377;
  --accent-dark: #095558;
  --accent-soft: #d8f0ef;
  --green: #3f7356;
  --gold: #8a6a24;
  --red: #9b3a35;
  --shadow: 0 18px 44px rgba(29, 42, 39, 0.08);
  --shadow-soft: 0 1px 2px rgba(29, 42, 39, 0.06);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(244, 245, 242, 0.96) 240px),
    var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
}

body.modal-open {
  overflow: hidden;
}

button,
select,
textarea {
  font: inherit;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  transition: grid-template-columns 180ms ease;
}

body.sidebar-collapsed .app-shell {
  grid-template-columns: 76px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  align-self: start; /* 关键：不被网格行拉伸，才能真正吸附 */
  height: 100vh;     /* 固定为视口高，右侧滚动时左侧聊天窗保持可见 */
  background: linear-gradient(180deg, #1e3538, #162a2d);
  color: #fff;
  padding: 22px 18px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(221, 235, 230, 0.28);
  border-radius: 8px;
  background: linear-gradient(135deg, #0d7377, #1e3538);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18);
  font-weight: 750;
  font-size: 22px;
}

.brand-name {
  font-size: 18px;
  font-weight: 750;
}

.brand-subtitle {
  color: rgba(255, 255, 255, 0.64);
  font-size: 12px;
  margin-top: 3px;
}

.rail-assistant {
  flex: 1;
  min-height: 0;
  max-height: calc(100vh - 112px);
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  padding: 14px;
}

.rail-assistant.chat-panel {
  min-height: 0;
}

.rail-assistant .panel-head {
  display: flex;
  align-items: center;
  gap: 10px;
  border-color: rgba(255, 255, 255, 0.12);
  margin-bottom: 12px;
}

.rail-assistant h2 {
  color: #fff;
  margin-bottom: 2px;
}

.rail-assistant .panel-head p {
  margin-bottom: 0;
  color: rgba(255, 255, 255, 0.58);
  font-size: 12px;
}

.gudong-avatar {
  width: 52px;
  height: 52px;
  flex: 0 0 52px;
  object-fit: cover;
  object-position: center 22%;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.24);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.22);
}

.rail-assistant .panel-note {
  display: none;
}

.rail-assistant .chat-log {
  flex: 1 1 0;
  min-height: 80px; /* 可收缩：训练模式插入场景选择条时，让聊天记录区让位，保证输入框始终可见 */
  overflow-y: auto;
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.12);
}

/* 头部/模式条/场景选择/提示/输入框 都不被压缩，只有聊天记录区伸缩 */
.rail-assistant > .panel-head,
.rail-assistant > .assistant-mode,
.rail-assistant > .training-setup,
.rail-assistant > .panel-note,
.rail-assistant > .chat-form {
  flex-shrink: 0;
}

.rail-assistant .message.agent {
  background: rgba(255, 255, 255, 0.96);
  color: var(--text);
  border-color: rgba(220, 229, 224, 0.86);
}

.rail-assistant .message.user {
  color: #fff;
}

.rail-assistant .confirmation-box {
  display: none;
}

.rail-assistant .chat-form {
  grid-template-columns: 1fr 70px;
}

.assistant-mode {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.assistant-mode button {
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.68);
  padding: 8px 10px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 760;
  white-space: normal;
}

.assistant-mode button.is-active {
  background: rgba(123, 196, 189, 0.18);
  color: #fff;
  border-color: rgba(123, 196, 189, 0.38);
}

.training-setup {
  display: grid;
  gap: 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  padding: 10px;
}

.training-setup[hidden] {
  display: none;
}

.training-setup .field-label {
  color: rgba(255, 255, 255, 0.68);
  margin: 0;
}

.training-setup select,
.training-setup textarea {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  color: var(--text);
  padding: 9px;
}

.sidebar-toggle {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
}

.nav {
  display: flex;
  gap: 6px;
}

.nav-item {
  border: 0;
  border-radius: 8px;
  color: var(--muted);
  background: transparent;
  text-align: left;
  padding: 9px 12px;
  cursor: pointer;
  transition: background 140ms ease, color 140ms ease, transform 140ms ease;
}

.nav-item:hover,
.nav-item.is-active {
  color: var(--accent-dark);
  background: var(--accent-soft);
}

.nav-item.is-active {
  box-shadow: inset 0 -2px 0 #7bc4bd;
}

.role-switcher {
  display: flex;
  align-items: center;
  gap: 8px;
}

.role-switcher label {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.role-switcher select {
  width: 150px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  padding: 9px 10px;
}

body.sidebar-collapsed .sidebar {
  align-items: center;
  padding: 22px 12px;
}

body.sidebar-collapsed .brand {
  justify-content: center;
}

body.sidebar-collapsed .brand > div:not(.brand-mark),
body.sidebar-collapsed .role-switcher label {
  display: none;
}

body.sidebar-collapsed .brand-mark {
  width: 42px;
  height: 42px;
}

body.sidebar-collapsed .nav {
  width: 100%;
}

body.sidebar-collapsed .nav-item {
  width: 52px;
  min-height: 44px;
  padding: 10px 0;
  text-align: center;
  font-size: 0;
}

body.sidebar-collapsed .nav-item::before {
  font-size: 15px;
  font-weight: 760;
}

body.sidebar-collapsed .nav-item[data-view="dashboard"]::before {
  content: "总";
}

body.sidebar-collapsed .nav-item[data-view="customers"]::before {
  content: "客";
}

body.sidebar-collapsed .nav-item[data-view="public"]::before {
  content: "公";
}

body.sidebar-collapsed .nav-item.is-active {
  box-shadow: inset 0 -2px 0 #7bc4bd;
}

body.sidebar-collapsed .role-switcher {
  display: none;
}

.main {
  padding: 30px 32px;
  min-width: 0;
  max-width: 1200px;
  margin: 0 auto;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 26px;
  gap: 18px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0;
  font-weight: 720;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  color: var(--ink);
  font-size: 30px;
  line-height: 1.18;
  font-weight: 760;
}

h2 {
  margin-bottom: 0;
  color: var(--ink);
  font-size: 17px;
  font-weight: 720;
}

h3 {
  color: var(--ink);
  font-size: 14px;
  margin-bottom: 8px;
}

.icon-button,
.chat-form button {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--accent-dark);
  min-width: 42px;
  min-height: 38px;
  cursor: pointer;
  box-shadow: var(--shadow-soft);
}

.view {
  display: none;
}

.view.is-visible {
  display: block;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.metric,
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.metric {
  padding: 18px 18px 17px;
  position: relative;
  overflow: hidden;
}

.metric::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--accent);
  opacity: 0.82;
}

.metric span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 12px;
  font-weight: 680;
}

.metric strong {
  color: var(--ink);
  font-size: 31px;
  line-height: 1;
}

.content-grid,
.assistant-layout,
.director-grid,
.trust-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
  gap: 20px;
}

.personal-hub {
  display: grid;
  grid-template-columns: minmax(300px, 0.9fr) minmax(360px, 1.1fr);
  gap: 20px;
  align-items: stretch;
}

.hub-left,
.hub-right {
  display: grid;
  gap: 20px;
  align-content: start;
}

.split-layout {
  display: grid;
  grid-template-columns: 380px minmax(0, 1fr);
  gap: 20px;
}

.panel {
  padding: 18px;
  min-width: 0;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.panel-note {
  margin-top: -4px;
  margin-bottom: 14px;
  color: var(--muted);
  line-height: 1.7;
}

.assistant-guide {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.assistant-guide article {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, #fff, var(--surface-soft));
  box-shadow: var(--shadow-soft);
  padding: 14px;
}

.assistant-guide span {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-weight: 800;
  margin-bottom: 10px;
}

.assistant-guide strong {
  display: block;
  color: var(--ink);
  margin-bottom: 6px;
}

.assistant-guide p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.6;
}

.stack-list,
.customer-list,
.task-list {
  display: grid;
  gap: 10px;
}

.list-item,
.customer-card,
.task-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, #ffffff, var(--surface-soft));
  padding: 14px;
  box-shadow: var(--shadow-soft);
}

.task-card.is-done {
  opacity: 0.68;
}

.task-card.is-done .title-line {
  text-decoration: line-through;
  color: var(--muted);
}

.task-section {
  display: grid;
  gap: 10px;
}

.task-section + .task-section {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.section-title {
  color: var(--ink);
  font-size: 13px;
  font-weight: 760;
}

.task-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.task-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.mini-button {
  border: 1px solid rgba(47, 111, 115, 0.48);
  border-radius: 8px;
  background: linear-gradient(135deg, var(--accent), #1f5558);
  color: #fff;
  min-height: 32px;
  padding: 0 12px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 720;
}

.mini-button.secondary {
  background: #fff;
  color: var(--accent-dark);
  border-color: var(--line-strong);
}

.check-button {
  width: 32px;
  height: 32px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: #fff;
  color: #fff;
  cursor: pointer;
  font-weight: 800;
  line-height: 1;
}

.check-button.is-checked {
  background: var(--accent);
  border-color: var(--accent);
}

.customer-search-box {
  width: 100%;
  box-sizing: border-box;
  padding: 9px 12px;
  margin-bottom: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 13px;
  background: #fff;
}

.customer-search-box:focus {
  outline: none;
  border-color: var(--accent);
}

.customer-card {
  cursor: pointer;
  transition: border-color 140ms ease, background 140ms ease, transform 140ms ease;
}

.customer-card:hover {
  border-color: var(--line-strong);
  transform: translateY(-1px);
}

.customer-card.is-selected {
  border-color: rgba(47, 111, 115, 0.64);
  background: linear-gradient(180deg, #ffffff, var(--accent-soft));
}

.row-between {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 10px;
}

.title-line {
  color: var(--text);
  font-weight: 720;
  line-height: 1.35;
}

.muted {
  color: var(--muted);
  font-size: 13px;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 680;
  white-space: nowrap;
}

.badge.high {
  color: var(--red);
  border-color: #d9b2ae;
  background: #fbefed;
}

.badge.medium {
  color: var(--gold);
  border-color: #d8c796;
  background: #f8f0d8;
}

.badge.low {
  color: var(--green);
  border-color: #b3cdbd;
  background: #edf7ef;
}

.detail-empty,
.growth-box,
.training-box,
.performance-box {
  color: var(--muted);
  line-height: 1.7;
}

.performance-summary {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.performance-summary > div {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, #fff, var(--surface-soft));
  padding: 12px;
}

.growth-panel {
  background:
    linear-gradient(135deg, rgba(47, 111, 115, 0.08), rgba(255, 255, 255, 0) 48%),
    var(--surface);
}

.growth-highlight {
  border: 1px solid rgba(47, 111, 115, 0.2);
  border-radius: 8px;
  background: #f4faf8;
  padding: 14px;
  margin-bottom: 12px;
}

.growth-highlight span,
.growth-grid span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 740;
  margin-bottom: 6px;
}

.growth-highlight p {
  margin-bottom: 0;
  color: var(--text);
  line-height: 1.75;
  font-weight: 640;
}

.growth-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.growth-grid div {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 12px;
}

.growth-grid strong {
  color: var(--ink);
  line-height: 1.5;
}

.growth-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.growth-tags span {
  border: 1px solid #d8c796;
  border-radius: 999px;
  background: #f8f0d8;
  color: var(--gold);
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 760;
}

.growth-reminders {
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
}

.growth-reminders article {
  border: 1px solid rgba(47, 111, 115, 0.16);
  border-radius: 8px;
  background: #fff;
  padding: 12px;
}

.growth-reminders strong {
  color: var(--ink);
  line-height: 1.4;
}

.growth-reminders .row-between {
  align-items: flex-start;
  gap: 10px;
}

.growth-reminders .row-between span {
  flex: 0 0 auto;
  border: 1px solid #d8c796;
  border-radius: 999px;
  background: #f8f0d8;
  color: var(--gold);
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 780;
}

.growth-reminders p {
  margin: 6px 0 8px;
  color: var(--text);
  line-height: 1.65;
}

.growth-reminders small {
  color: var(--muted);
  font-weight: 700;
}

.training-map-panel {
  background:
    linear-gradient(135deg, rgba(47, 111, 115, 0.08), rgba(255, 255, 255, 0) 48%),
    var(--surface);
}

.training-box {
  color: var(--muted);
  line-height: 1.7;
}

.training-head h3 {
  margin-bottom: 4px;
  font-size: 16px;
}

.training-head p {
  margin-bottom: 12px;
  color: var(--muted);
  line-height: 1.6;
}

.training-abilities {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.training-abilities article {
  flex: 0 0 168px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  border: 1px solid rgba(47, 111, 115, 0.16);
  border-radius: 8px;
  background: linear-gradient(180deg, #fff, #f6fbfa);
  padding: 10px 12px;
}

.ability-stage {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: var(--accent-dark);
  color: #fff;
  font-size: 13px;
  font-weight: 820;
}

.training-abilities strong {
  display: block;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.35;
}

.training-abilities p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.training-abilities span,
.training-route strong {
  display: block;
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 780;
}

.training-route {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.training-route button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  padding: 10px 12px;
  cursor: pointer;
  text-align: left;
}

.training-route button:hover {
  border-color: #a9c8c4;
  background: var(--accent-soft);
}

.training-route span {
  font-weight: 760;
  line-height: 1.35;
}

.training-scenarios {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.training-scenarios button {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  padding: 6px 10px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 740;
}

.training-scenarios button.is-active {
  color: var(--accent-dark);
  border-color: #a9c8c4;
  background: var(--accent-soft);
}

.training-prompt,
.training-result {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 12px;
  color: var(--text);
  line-height: 1.65;
}

.training-answer {
  width: 100%;
  margin: 10px 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px;
  resize: vertical;
  color: var(--text);
}

.training-actions {
  margin-bottom: 10px;
}

.training-score {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 48px;
  height: 32px;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  font-weight: 820;
  margin-bottom: 10px;
}

.training-better {
  margin-top: 12px;
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.training-better strong {
  color: var(--accent-dark);
}

.training-better p {
  margin: 6px 0 0;
}

.performance-summary span,
.performance-summary strong {
  display: block;
}

.performance-summary strong {
  margin-top: 6px;
  color: var(--ink);
  font-size: 22px;
}

.progress-track {
  height: 9px;
  margin: 14px 0;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-strong);
}

.progress-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), #7ab8ad);
}

.performance-list {
  display: grid;
  gap: 10px;
}

.performance-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}

.detail-section {
  border-top: 1px solid var(--line);
  padding-top: 16px;
  margin-top: 16px;
}

.detail-kv {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 8px;
  margin-bottom: 8px;
}

.crm-form {
  display: grid;
  gap: 10px;
  margin: 12px 0;
}

.form-grid {
  display: grid;
  gap: 10px;
}

.form-grid.compact {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.crm-form label,
.owner-form label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
}

.crm-form input,
.crm-form select,
.crm-form textarea,
.owner-form select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  padding: 9px 10px;
  font: inherit;
}

.form-actions,
.owner-form {
  display: flex;
  gap: 10px;
  align-items: end;
  flex-wrap: wrap;
}

.customer-create-box {
  border: 1px solid rgba(47, 111, 115, 0.18);
  border-radius: 8px;
  background: var(--accent-soft);
  padding: 12px;
  margin-bottom: 12px;
}

.customer-create-box[hidden] {
  display: none;
}

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

.rep-open-task {
  border-left: 3px solid var(--line, #ddd);
  padding-left: 8px;
}
.rep-open-task.is-high {
  border-left-color: #d9534f;
}

.briefing-customer-link {
  color: var(--accent, #2f6f73);
  cursor: pointer;
  font-weight: 700;
  text-decoration: none;
  border-bottom: 1px dashed currentColor;
}
.briefing-customer-link:hover { opacity: 0.8; }

.customer-reassign-box {
  border: 1px solid rgba(47, 111, 115, 0.18);
  border-radius: 8px;
  background: var(--accent-soft);
  padding: 12px;
  margin-bottom: 12px;
}

.customer-reassign-box[hidden] {
  display: none;
}

.reassign-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.reassign-field {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
}

.reassign-field select {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  padding: 8px 10px;
  font: inherit;
}

.reassign-list {
  max-height: 240px;
  overflow-y: auto;
  margin: 10px 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 6px 4px;
}

.reassign-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 8px;
  font-size: 13px;
  color: var(--text);
  font-weight: 500;
  border-radius: 6px;
  cursor: pointer;
}

.reassign-row:hover {
  background: var(--accent-soft);
}

.reassign-row.reassign-all {
  font-weight: 760;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  margin-bottom: 4px;
}

.reassign-row .muted {
  margin-left: auto;
  font-size: 12px;
}

.reassign-actions {
  display: flex;
  gap: 10px;
  align-items: end;
  flex-wrap: wrap;
}

.reassign-feedback {
  font-size: 12px;
  color: var(--accent, #2f6f73);
  font-weight: 700;
  align-self: center;
}

.ghost-button.mini {
  font-size: 12px;
  padding: 4px 10px;
}

.contact-grid {
  display: grid;
  gap: 10px;
}

.contact-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 12px;
}

.contact-card p {
  margin: 6px 0;
  line-height: 1.6;
}

.contact-create-form {
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.trust-card {
  background: linear-gradient(180deg, #ffffff, var(--accent-soft));
  border: 1px solid rgba(47, 111, 115, 0.24);
  border-radius: 8px;
  padding: 14px;
}

.trust-score {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 12px;
}

.trust-score span {
  width: 28px;
  height: 7px;
  border-radius: 999px;
  background: var(--line-strong);
}

.trust-score span.is-active {
  background: var(--accent);
}

.trust-score strong {
  margin-left: 4px;
  color: var(--accent-dark);
}

.trust-ring-list,
.criteria-list {
  display: grid;
  gap: 10px;
}

.method-card,
.criteria-item {
  display: flex;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, #fff, var(--surface-soft));
  padding: 13px;
}

.method-index {
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-weight: 800;
}

.criteria-item {
  align-items: flex-start;
}

.criteria-item span {
  color: var(--accent);
  font-weight: 800;
}

.criteria-item p {
  margin-bottom: 0;
}

.chat-panel {
  min-height: 640px;
  display: flex;
  flex-direction: column;
}

.dashboard-chat-panel {
  min-height: calc(100vh - 188px);
  position: sticky;
  top: 24px;
}

.dashboard-chat-panel .chat-log {
  min-height: 260px;
  max-height: none;
}

.dashboard-chat-panel .chat-form {
  grid-template-columns: 1fr 78px;
}

.chat-log {
  flex: 1;
  display: grid;
  align-content: start;
  gap: 10px;
  overflow: auto;
  padding: 14px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.74), rgba(240, 243, 240, 0.96)),
    var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.message {
  max-width: 88%;
  padding: 12px 13px;
  line-height: 1.6;
  white-space: pre-wrap;
  border-radius: 8px;
}

.message.user {
  justify-self: end;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), #1e5458);
  box-shadow: 0 8px 20px rgba(47, 111, 115, 0.18);
}

.message.agent {
  justify-self: start;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-soft);
}

.chat-form {
  display: grid;
  grid-template-columns: 1fr 90px;
  gap: 10px;
  margin-top: 12px;
}

.chat-form textarea {
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  min-height: 74px;
  background: #fff;
  color: var(--text);
}

.chat-form button {
  background: linear-gradient(135deg, var(--accent), #1f5558);
  color: #fff;
  border-color: rgba(47, 111, 115, 0.72);
  font-weight: 720;
}

.extract-box {
  min-height: 520px;
  white-space: pre-wrap;
  background: #151b1f;
  color: #e8f2ef;
  padding: 14px;
  overflow: auto;
  line-height: 1.6;
  border-radius: 8px;
  border: 1px solid #2a3438;
}

.confirmation-box {
  min-height: 520px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, #fff, var(--surface-soft));
  padding: 14px;
  color: var(--muted);
  line-height: 1.7;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 28px;
  background: rgba(13, 19, 22, 0.58);
  backdrop-filter: blur(10px);
}

.modal-overlay[hidden] {
  display: none;
}

.draft-modal {
  width: min(820px, 100%);
  max-height: min(760px, calc(100vh - 56px));
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 12px;
  background: linear-gradient(180deg, #fff, #f5f7f5);
  box-shadow: 0 28px 80px rgba(9, 16, 18, 0.34);
  overflow: hidden;
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.82);
}

.modal-head h2 {
  font-size: 21px;
}

.modal-body {
  padding: 18px 20px;
  overflow: auto;
}

.icon-button {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  cursor: pointer;
  font-size: 26px;
  line-height: 1;
}

.modal-body .draft-form {
  gap: 2px;
}

.modal-body .confirm-section {
  padding-bottom: 12px;
  margin-bottom: 12px;
}

.modal-body .draft-form select,
.modal-body .draft-form textarea,
.modal-body .draft-form input {
  min-height: 44px;
  font-size: 15px;
}

.modal-body .confirm-actions {
  position: sticky;
  bottom: -18px;
  margin: 14px -20px -18px;
  padding: 12px 20px;
  background: rgba(245, 247, 245, 0.94);
  border-top: 1px solid var(--line);
  backdrop-filter: blur(8px);
}

.draft-summary-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.draft-summary-strip span {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 760;
}

.compact-section {
  background: rgba(255, 255, 255, 0.64);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px;
}

.gudong-note {
  margin: 10px 0 0;
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent-dark);
  padding: 9px 10px;
  font-size: 13px;
}

.destination-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.destination-card {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.68);
  padding: 12px;
}

.destination-head {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  min-width: 0;
  color: var(--text);
  font-weight: 780;
}

.destination-head > input {
  flex: 0 0 17px;
  width: 17px;
  height: 17px;
  min-height: 0;
  margin-top: 3px;
  accent-color: var(--accent);
}

.destination-head span {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.destination-head strong,
.destination-head small {
  writing-mode: horizontal-tb;
  white-space: normal;
}

.destination-head small,
.visibility-checks > span,
.date-range-grid span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.date-range-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 4px;
}

.date-range-grid label {
  display: grid;
  gap: 6px;
}

.visibility-checks {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.mini-confirmation {
  min-height: 136px;
  max-height: 280px;
  overflow: auto;
  margin-top: 12px;
}

.confirm-section {
  padding-bottom: 12px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.confirm-section p {
  margin-bottom: 6px;
  color: var(--text);
}

.confirm-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0;
}

.draft-form {
  display: grid;
  gap: 0;
}

.draft-form select,
.draft-form textarea,
.draft-form input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  padding: 10px 11px;
  resize: vertical;
}

.lookup-hint {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.lookup-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
}

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

.judgement-grid span {
  display: grid;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  padding: 10px 12px;
}

.judgement-grid strong {
  color: var(--muted);
  font-size: 12px;
}

.field-label {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 720;
  margin: 10px 0 6px;
}

.draft-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0;
}

.inline-check {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  padding: 8px 10px;
  font-size: 13px;
  font-weight: 700;
}

.inline-check input {
  width: 16px;
  height: 16px;
  min-height: 0;
  margin: 0;
  accent-color: var(--accent);
}

.draft-form input[type="checkbox"],
.draft-form .destination-head > input,
.draft-form .inline-check input {
  width: 16px;
  height: 16px;
  min-height: 0;
  flex: 0 0 16px;
  padding: 0;
  resize: none;
}

.new-customer-option {
  padding: 5px 8px;
  font-size: 12px;
}

.quality-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.quality-list span {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 9px;
  color: var(--muted);
  background: #fff;
  font-size: 12px;
  font-weight: 680;
}

.quality-list span.is-pass {
  color: var(--green);
  border-color: #b3cdbd;
  background: #edf7ef;
}

.director-command {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 18px;
  border-radius: 12px;
  background:
    radial-gradient(circle at 70% 0%, rgba(113, 157, 237, 0.24), transparent 30%),
    linear-gradient(180deg, #eef1fb, #f7f8fb 44%, rgba(247, 248, 251, 0));
}

/* 分组带：每一行内的面板等高对齐，间距统一，信息聚焦 */
.director-band {
  display: grid;
  gap: 18px;
  align-items: stretch;
}
.director-band > .panel {
  height: 100%;
  margin: 0;
}
.band-growth { grid-template-columns: 1fr; }        /* 管理者自己的成长 */
.band-top { grid-template-columns: 1fr 1.6fr; }     /* 行动计划 + 洞察 */
.band-alerts { grid-template-columns: 1fr; }        /* 人员状态与攻关重点（每个人单独一张卡） */
.band-analytics { grid-template-columns: 1fr; }
.band-detail { grid-template-columns: 1.4fr 1fr; }

.director-annual-panel {
  width: 100%;
}

.command-center {
  background:
    linear-gradient(135deg, rgba(47, 111, 115, 0.08), rgba(252, 252, 250, 0) 48%),
    var(--surface);
}

.command-hero {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 14px;
}

.command-hero strong {
  display: block;
  color: var(--ink);
  font-size: 32px;
  line-height: 1.1;
  margin-top: 6px;
}

.command-rate {
  border: 1px solid #b7d0cf;
  border-radius: 8px;
  background: #e8f4f2;
  color: var(--accent-dark);
  padding: 9px 11px;
  font-size: 20px;
  font-weight: 800;
}

.command-focus {
  margin: 14px 0;
  color: var(--ink);
  font-size: 16px;
  line-height: 1.65;
  font-weight: 700;
}

.command-metrics,
.visual-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 16px 0;
}

.command-metrics div {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 11px;
}

.command-metrics span,
.rep-focus-meta span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 680;
}

.command-metrics strong {
  display: block;
  color: var(--ink);
  font-size: 18px;
  margin-top: 5px;
}

.visual-kpi-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin: 18px 0;
}

.visual-kpi {
  position: relative;
  min-height: 178px;
  overflow: hidden;
  border: 1px solid rgba(214, 221, 216, 0.72);
  border-left: 4px solid rgba(214, 221, 216, 0.72);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.96);
  padding: 22px;
  box-shadow: 0 14px 30px rgba(37, 51, 60, 0.07);
}
.visual-kpi.kpi-good { border-left-color: #2db8a4; background: rgba(45, 184, 164, 0.04); }
.visual-kpi.kpi-warn { border-left-color: var(--gold); background: rgba(138, 106, 36, 0.04); }
.visual-kpi.kpi-bad  { border-left-color: #f05a22; background: rgba(240, 90, 34, 0.04); }

.visual-kpi span {
  display: block;
  color: #596371;
  font-size: 14px;
  font-weight: 720;
  letter-spacing: 0;
  margin-bottom: 12px;
}

.visual-kpi strong {
  display: block;
  color: #20272f;
  font-size: 38px;
  line-height: 1;
  font-weight: 820;
}

.kpi-delta {
  margin-top: 18px;
  font-size: 15px;
  font-weight: 780;
}

.kpi-delta.is-up {
  color: #2db8a4;
}

.kpi-delta.is-down {
  color: #f05a22;
}

.kpi-delta.is-watch {
  color: var(--gold);
}

.visual-kpi svg {
  position: absolute;
  right: 18px;
  bottom: 18px;
  width: 118px;
  height: 46px;
}

.visual-kpi polyline {
  fill: none;
  stroke: #95a0ad;
  stroke-width: 3.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.business-chain {
  border: 1px solid rgba(214, 221, 216, 0.8);
  border-radius: 14px;
  background: #fff;
  padding: 16px;
  margin: 14px 0 16px;
}

.chain-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
  margin-bottom: 14px;
}

.chain-head strong {
  color: var(--ink);
  font-size: 16px;
}

.chain-head span,
.business-chain p {
  color: var(--muted);
  font-size: 12px;
}

.business-chain p {
  margin: 14px 0 0;
}

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

.chain-flow div {
  display: grid;
  gap: 7px;
}

.chain-flow span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.chain-flow strong {
  color: var(--ink);
  font-size: 18px;
}

.chain-flow i {
  display: block;
  height: 8px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), #8bc2ad);
  max-width: 100%;
}

.chain-flow .is-risk i {
  background: linear-gradient(90deg, #c59a38, #e0c36f);
}

.director-chart-panel,
.director-share-panel {
  min-height: 320px;
}

.director-chart-panel,
.director-share-panel,
.director-order-panel,
.key-project-panel,
.risk-command-panel,
.rep-ring-panel,
.director-annual-panel {
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.94);
}

.chart-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.import-sales-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface);
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: background 120ms;
}
.import-sales-btn:hover {
  background: var(--accent-soft);
}

.chart-legend {
  display: flex;
  gap: 14px;
  align-items: center;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.chart-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.chart-legend i {
  width: 12px;
  height: 8px;
  border-radius: 999px;
  display: inline-block;
}

.legend-signed {
  background: var(--accent);
}

.legend-paid {
  background: #8a6a24;
}

.legend-target {
  background: var(--red);
}

.trend-bars {
  height: 230px;
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  align-items: end;
  gap: 8px;
  padding-top: 12px;
}

.actual-trend-line {
  width: 100%;
  height: 54px;
  margin-top: 12px;
  border-top: 1px solid var(--line);
  padding-top: 8px;
}

.actual-trend-line polyline {
  fill: none;
  stroke-width: 3.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.actual-trend-line .signed-line {
  stroke: var(--accent);
}

.actual-trend-line .paid-line {
  stroke: var(--gold);
}

.chart-note {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.trend-month {
  height: 100%;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 4px;
  min-width: 0;
}

.bar-label {
  color: var(--text);
  font-size: 11px;
  font-weight: 720;
  text-align: center;
  white-space: nowrap;
}

.trend-month strong {
  color: var(--muted);
  font-size: 11px;
  text-align: center;
}

.bar-stack {
  position: relative;
  display: flex;
  align-items: end;
  justify-content: center;
  gap: 3px;
  min-height: 0;
  border-bottom: 1px solid var(--line-strong);
}

.bar {
  width: 9px;
  min-height: 0;
  border-radius: 999px 999px 0 0;
}

.bar.signed {
  background: linear-gradient(180deg, #4f9295, var(--accent));
}

.bar.paid {
  background: linear-gradient(180deg, #b99a50, var(--gold));
}

.target-line {
  position: absolute;
  left: 8%;
  right: 8%;
  height: 2px;
  background: var(--red);
  opacity: 0.72;
}

.ranking-list {
  display: grid;
  gap: 12px;
}

.ranking-card {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, #fff, var(--surface-soft));
  padding: 13px;
}

.ranking-index {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
  font-weight: 800;
}

.ranking-track {
  height: 8px;
  margin-top: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-strong);
}

.ranking-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), #8bc2ad);
}

.usage-strip {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--accent-soft);
  border: 1px solid rgba(47, 111, 115, 0.18);
}

.usage-label {
  display: block;
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 6px;
}

.usage-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  font-size: 12px;
  color: var(--ink);
}

.usage-stats strong {
  color: var(--accent);
  font-size: 14px;
}

.share-strip {
  display: flex;
  min-height: 34px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.share-segment {
  display: grid;
  place-items: center;
  min-width: 0;
  padding: 0 8px;
  color: #fff;
  font-size: 12px;
  font-weight: 760;
  white-space: nowrap;
}

.segment-0 {
  background: var(--accent);
}

.segment-1 {
  background: var(--gold);
}

.segment-2 {
  background: var(--green);
}

.rep-focus-ring {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  align-items: start;
}

.key-project-list,
.risk-signal-list {
  display: grid;
  gap: 12px;
}

.rep-focus-card,
.key-project-card,
.risk-signal-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, #fff, var(--surface-soft));
  padding: 14px;
  box-shadow: var(--shadow-soft);
}

.rep-focus-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 12px 0;
}

.rep-focus-meta span {
  border-radius: 8px;
  background: #fff;
  border: 1px solid var(--line);
  padding: 8px;
  color: var(--ink);
}

.rep-focus-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 6px;
}

.rep-focus-block {
  margin-bottom: 6px;
}

.rep-task-list {
  display: grid;
  gap: 7px;
  margin-bottom: 10px;
}

.rep-task-list div {
  border-left: 3px solid var(--accent);
  padding-left: 9px;
}

.rep-task-list strong,
.rep-task-list span {
  display: block;
}

.rep-task-list strong {
  font-size: 13px;
  line-height: 1.45;
  color: var(--ink);
}

.rep-task-list span {
  color: var(--muted);
  font-size: 12px;
  margin-top: 2px;
}

.ai-summary {
  margin-top: 12px;
  border: 1px solid rgba(47, 111, 115, 0.2);
  border-radius: 8px;
  background: #f5faf8;
  padding: 11px;
}

.ai-summary span {
  display: block;
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 800;
  margin-bottom: 6px;
}

.ai-summary p {
  margin-bottom: 0;
  color: var(--text);
  line-height: 1.65;
  font-size: 13px;
}

.order-flow-board {
  display: grid;
  gap: 14px;
}

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

.order-flow-metrics div {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 12px;
}

.order-flow-metrics span,
.order-progress span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 680;
}

.order-flow-metrics strong,
.order-progress strong {
  display: block;
  color: var(--ink);
  margin-top: 5px;
}

.order-flow-alerts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.order-flow-alerts span {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--muted);
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 700;
}

.order-flow-list {
  display: grid;
  gap: 10px;
}

.order-row {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto minmax(240px, 0.9fr);
  gap: 14px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, #fff, var(--surface-soft));
  padding: 13px;
}

.order-status-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.order-progress {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.order-progress div {
  border-left: 3px solid var(--accent);
  padding-left: 9px;
}

.key-project-panel,
.risk-command-panel {
  min-height: 0;
}

.project-focus {
  display: inline-flex;
  margin: 12px 0 8px;
  padding: 5px 9px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 760;
}

.key-project-card p,
.risk-signal-card p {
  margin-bottom: 8px;
  line-height: 1.6;
}

.risk-signal-card {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
  gap: 14px;
  align-items: start;
}

.wide-panel {
  grid-column: 1 / -1;
}

.public-board-section + .public-board-section {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.project-board-grid,
.person-board-grid {
  display: grid;
  gap: 14px;
  margin-top: 12px;
}

.project-board-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.person-board-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.public-project-card,
.person-board-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, #fff, var(--surface-soft));
  padding: 14px;
  box-shadow: var(--shadow-soft);
}
.person-board-card.is-exec {
  border-left: 4px solid var(--accent);
  background: linear-gradient(180deg, #fff, var(--accent-soft));
}
.exec-tag {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 4px;
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  vertical-align: middle;
  margin-left: 4px;
}

.public-task-list,
.person-task-groups {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.person-task-groups > div {
  display: grid;
  gap: 8px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.person-done-group {
  display: grid;
  gap: 8px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.person-done-group summary {
  cursor: pointer;
  list-style: none;
  color: var(--ink);
}

.person-done-group summary::-webkit-details-marker { display: none; }
.person-done-group summary::before { content: "▶ "; font-size: 10px; }
.person-done-group[open] summary::before { content: "▼ "; }

.person-task-groups strong {
  color: var(--ink);
  font-size: 13px;
}

.public-task-row {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 10px;
}

.public-task-row.is-done {
  opacity: 0.68;
}

.public-task-row.is-done .title-line {
  text-decoration: line-through;
  color: var(--muted);
}

.check-button.is-readonly {
  cursor: default;
}

@media (max-width: 980px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    min-height: auto;
    padding: 16px;
    gap: 14px;
  }

  .rail-assistant {
    max-height: none;
  }

  .rail-assistant .chat-log {
    flex: 0 0 auto;
    min-height: 260px;
    max-height: 420px;
  }

  .rail-assistant .confirmation-box {
    display: none;
  }

  .modal-overlay {
    padding: 14px;
    align-items: end;
  }

  .draft-modal {
    max-height: calc(100vh - 28px);
    border-radius: 12px 12px 0 0;
  }

  .modal-head,
  .modal-body {
    padding: 16px;
  }

  .modal-body .confirm-actions {
    bottom: -16px;
    margin: 16px -16px -16px;
    padding: 12px 16px;
  }

  .judgement-grid {
    grid-template-columns: 1fr;
  }

  .destination-grid,
  .date-range-grid {
    grid-template-columns: 1fr;
  }

  .brand {
    align-items: center;
  }

  .brand-mark {
    width: 38px;
    height: 38px;
    font-size: 19px;
  }

  .brand-name {
    font-size: 16px;
  }

  .nav {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .nav-item {
    flex: 0 0 auto;
    padding: 9px 11px;
    white-space: nowrap;
  }

  .nav-item.is-active {
    box-shadow: inset 0 -2px 0 #7bc4bd;
  }

  .role-switcher {
    margin-top: 0;
    max-width: 320px;
  }

  .main {
    padding: 22px 18px;
  }

  .topbar {
    align-items: start;
    margin-bottom: 20px;
  }

  h1 {
    font-size: 27px;
  }

  .metric-grid,
  .content-grid,
  .assistant-layout,
  .personal-hub,
  .split-layout,
  .director-grid,
  .director-command,
  .assistant-guide,
  .trust-layout {
    grid-template-columns: 1fr;
  }

  .command-metrics,
  .visual-kpi-grid,
  .chain-flow,
  .risk-signal-card,
  .order-flow-metrics,
  .order-row,
  .order-progress,
  .growth-grid,
  .project-board-grid,
  .person-board-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-chat-panel {
    position: static;
    min-height: 0;
  }

  .director-annual-panel,
  .director-order-panel {
    grid-column: auto;
  }

  .band-action,
  .band-analytics,
  .band-detail {
    grid-template-columns: 1fr;
  }

  .trend-bars {
    overflow-x: auto;
    grid-template-columns: repeat(12, 34px);
  }

  .visual-kpi {
    min-height: 150px;
    border-radius: 16px;
  }
}

/* —— 登录页 & 用户菜单（M1 鉴权）—— */
.login-overlay {
  z-index: 100;
  background: linear-gradient(135deg, #1e3538 0%, #1a3a3d 50%, #162a2d 100%);
  backdrop-filter: none;
}
.login-card {
  width: 100%;
  max-width: 360px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 36px 32px 32px;
  text-align: center;
}
.login-mark {
  width: 52px; height: 52px;
  margin: 0 auto 14px;
  display: grid; place-items: center;
  border-radius: 14px;
  background: var(--accent);
  color: #fff; font-size: 24px; font-weight: 700;
}
.login-card h2 { margin: 0 0 4px; color: var(--text); font-size: 20px; }
.login-subtitle { margin: 0 0 24px; color: var(--muted); font-size: 13px; }
.login-form { display: flex; flex-direction: column; gap: 12px; }
.login-form input {
  padding: 12px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--surface-soft);
  color: var(--text);
  font-size: 14px;
}
.login-form input:focus { outline: none; border-color: var(--accent); background: #fff; }
.login-form button {
  margin-top: 6px;
  padding: 12px;
  border: none;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}
.login-form button:hover { background: var(--accent-dark); }
.login-error { margin: 0; color: var(--red); font-size: 13px; }
.user-menu { display: flex; align-items: center; gap: 10px; }
.current-user { color: var(--text); font-size: 13px; font-weight: 600; }
#logoutButton { font-size: 13px; width: auto; padding: 0 12px; }

/* —— 经营洞察 & 跟单预警面板（M2/M3）—— */
.exec-insight-box { display: flex; flex-direction: column; gap: 12px; }
.exec-headline { font-size: 16px; font-weight: 700; color: var(--text); }
.exec-target { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.6; }
.exec-block h4 { margin: 0 0 6px; font-size: 13px; color: var(--accent-dark); }
.exec-block ul { margin: 0; padding-left: 18px; }
.exec-block li { color: var(--text); font-size: 13px; line-height: 1.7; }
.exec-block p { margin: 0; color: var(--text); font-size: 13px; line-height: 1.6; }
.exec-engine { font-size: 11px; }
.knowledge-evolution-box { display: flex; flex-direction: column; gap: 14px; }
.knowledge-learned-list { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 12px; }
.knowledge-learned-list li { border: 1px solid var(--border); border-radius: 10px; padding: 12px; font-size: 13px; line-height: 1.6; color: var(--text); }
.knowledge-learned-list li p { margin: 4px 0; }
/* —— 每日晨报面板 —— */
.daily-briefing-panel {
  background: linear-gradient(135deg, var(--accent-dark) 0%, #1a5a60 100%);
  color: #fff;
  border-radius: 16px;
  padding: 20px 24px;
  margin-bottom: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.briefing-head {
  display: flex;
  align-items: center;
  gap: 12px;
}
.briefing-icon {
  font-size: 22px;
  line-height: 1;
}
.briefing-title {
  font-weight: 700;
  font-size: 15px;
  color: #fff;
}
.briefing-sub {
  font-size: 11px;
  color: rgba(255,255,255,0.6);
  margin-top: 2px;
}
.briefing-refresh {
  margin-left: auto;
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.2);
  color: #fff;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 16px;
  display: grid;
  place-items: center;
  transition: background 0.15s;
}
.briefing-refresh:hover { background: rgba(255,255,255,0.25); }
.briefing-content {
  font-size: 13px;
  line-height: 1.8;
  color: rgba(255,255,255,0.92);
  white-space: pre-wrap;
}
.briefing-content strong { color: #fff; }
.briefing-loading {
  color: rgba(255,255,255,0.6);
  font-style: italic;
}

/* —— 目标进度条 & 成长数据 —— */
.goal-progress-bar-wrap {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 16px;
}
.goal-progress-track {
  flex: 1; height: 8px; border-radius: 8px;
  background: var(--surface-strong);
  overflow: hidden;
}
.goal-progress-fill {
  height: 100%; border-radius: 8px;
  background: linear-gradient(90deg, var(--accent), #5bb8a8);
  transition: width 0.6s ease;
}
.goal-progress-label {
  font-size: 12px; color: var(--muted); white-space: nowrap;
}
.growth-dimension-label {
  font-size: 11px; color: var(--muted); margin-bottom: 8px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.5px;
}
.growth-stats-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: 10px; margin-bottom: 12px;
}
.growth-stat-item {
  background: var(--surface-soft); border-radius: 10px;
  padding: 10px 8px; text-align: center;
}
.growth-stat-item strong { display: block; font-size: 18px; color: var(--accent-dark); }
.growth-stat-item span { font-size: 11px; color: var(--muted); }
.growth-team-mini { margin-bottom: 10px; }
.growth-label { font-size: 11px; color: var(--muted); display: block; margin-bottom: 6px; }
.growth-member {
  display: flex; justify-content: space-between;
  padding: 6px 0; border-bottom: 1px solid var(--line);
  font-size: 13px;
}

/* —— 精简确认框（工作整理快速存入）—— */
.quick-confirm-form { display: flex; flex-direction: column; gap: 14px; }
.qc-row { display: flex; align-items: flex-start; gap: 10px; }
.qc-label { flex: 0 0 52px; font-size: 13px; color: var(--muted); padding-top: 8px; font-weight: 600; }
.qc-select { flex: 1; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-soft); font-size: 14px; }
.qc-textarea { flex: 1; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-soft); font-size: 13px; resize: vertical; }
.qc-summary { color: var(--muted); }
.qc-date-row { align-items: center; }
.qc-date { padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-soft); font-size: 13px; }
.qc-public-label { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); margin-left: 10px; cursor: pointer; white-space: nowrap; }
.qc-info { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 8px 0; border-top: 1px solid var(--line); }
.qc-info span { font-size: 12px; color: var(--muted); }
.qc-actions { display: flex; gap: 10px; padding-top: 4px; }
.btn-primary { padding: 10px 20px; background: var(--accent); color: #fff; border: none; border-radius: 10px; font-size: 14px; font-weight: 600; cursor: pointer; }
.btn-primary:hover { background: var(--accent-dark); }
.btn-ghost { padding: 10px 16px; background: transparent; color: var(--muted); border: 1px solid var(--line); border-radius: 10px; font-size: 13px; cursor: pointer; }

/* —— 存储目的地选择 & 公开行 —— */
.qc-dest-row { display: flex; flex-direction: column; gap: 8px; padding: 12px 0; border-top: 1px solid var(--line); }
.qc-dest-label { font-size: 12px; color: var(--muted); font-weight: 600; }
.qc-dest-opt { display: flex; align-items: center; gap: 8px; font-size: 13px; cursor: pointer; }
.qc-dest-opt input[type="radio"] { accent-color: var(--accent); }
.qc-public-row { padding-top: 4px; }

/* —— 总监团队行动计划 —— */
.director-task-list { display: flex; flex-direction: column; gap: 8px; }
.director-task-item { display: flex; align-items: flex-start; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.director-task-item:last-child { border-bottom: none; }
.dt-priority { width: 4px; min-height: 36px; border-radius: 2px; background: var(--line-strong); flex-shrink: 0; margin-top: 2px; }
.dt-high { background: var(--red); }
.dt-body { flex: 1; }
.dt-title { font-size: 13px; color: var(--text); line-height: 1.4; }
.dt-meta { font-size: 11px; color: var(--muted); margin-top: 3px; }
.dt-public { font-size: 10px; background: var(--accent-soft); color: var(--accent-dark); padding: 2px 6px; border-radius: 4px; white-space: nowrap; }

/* —— 目标设置页 —— */
.targets-panel { max-width: 760px; }
.targets-section { margin-bottom: 28px; }
.targets-section h3 { font-size: 14px; color: var(--muted); margin: 0 0 14px; font-weight: 600; }
.targets-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.target-field { display: flex; flex-direction: column; gap: 6px; }
.target-field.full-width { grid-column: 1/-1; }
.target-field span { font-size: 13px; color: var(--muted); font-weight: 600; }
.target-field input { padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-soft); font-size: 14px; }
.target-field input:focus { outline: none; border-color: var(--accent); background: #fff; }
.target-field input[readonly] { color: var(--muted); cursor: default; }
.targets-actions { display: flex; align-items: center; gap: 14px; padding-top: 8px; }
.targets-msg { font-size: 13px; color: var(--green); }

/* —— 行动计划新版 —— */
.action-group { margin-bottom: 16px; }
.action-group-title {
  font-size: 11px; font-weight: 700; letter-spacing: 0.5px;
  color: var(--muted); text-transform: uppercase;
  padding: 4px 0 8px; border-bottom: 1px solid var(--line);
  margin-bottom: 8px;
}
.action-group-title.urgent { color: var(--red); }
.action-group-title.today { color: var(--accent-dark); }
.action-group-title.done { color: var(--muted); opacity: 0.7; }
summary.action-group-title { cursor: pointer; list-style: revert; }
summary.action-group-title::-webkit-details-marker { color: var(--muted); }
.action-item {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 10px 0; border-bottom: 1px solid var(--surface-strong);
  transition: opacity 0.2s;
}
.action-item:last-child { border-bottom: none; }
.action-item.action-done { opacity: 0.5; }
.action-item.action-urgent .action-title { color: var(--red); }
.action-check {
  width: 22px; height: 22px; flex-shrink: 0;
  border-radius: 50%; border: 2px solid var(--line-strong);
  background: transparent; cursor: pointer;
  font-size: 12px; display: grid; place-items: center;
  color: var(--muted); transition: all 0.15s; margin-top: 2px;
}
.action-check:hover { border-color: var(--accent); color: var(--accent); }
.action-check.is-checked { background: var(--accent); border-color: var(--accent); color: #fff; }
.action-body { flex: 1; min-width: 0; }
.action-title { font-size: 13px; color: var(--text); line-height: 1.4; }
.action-meta { display: flex; gap: 8px; margin-top: 3px; flex-wrap: wrap; }
.action-meta span { font-size: 11px; color: var(--muted); }
.action-customer { font-weight: 600; color: var(--accent-dark); }
.action-overdue { color: var(--red) !important; font-weight: 600; }
.action-group-done .action-title { text-decoration: line-through; }

/* —— 客户搜索下拉 —— */
.qc-customer-wrap { flex: 1; position: relative; }
.qc-search {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line);
  border-radius: 10px; background: var(--surface-soft); font-size: 14px;
}
.qc-search:focus { outline: none; border-color: var(--accent); background: #fff; }
.qc-dropdown {
  position: absolute; top: calc(100% + 4px); left: 0; right: 0;
  background: #fff; border: 1px solid var(--line); border-radius: 10px;
  box-shadow: var(--shadow); z-index: 200; max-height: 200px; overflow-y: auto;
}
.qc-option {
  padding: 9px 14px; font-size: 13px; cursor: pointer; color: var(--text);
}
.qc-option:hover { background: var(--accent-soft); color: var(--accent-dark); }

/* —— 重要程度 & 风险标签选择 —— */
.qc-tags-row { align-items: center; }
.qc-tag-group { display: flex; gap: 8px; flex: 1; }
.qc-tag {
  padding: 7px 14px; border: 1px solid var(--line); border-radius: 20px;
  font-size: 13px; cursor: pointer; color: var(--muted);
  transition: all 0.15s; user-select: none;
}
.qc-tag input[type="radio"] { display: none; }
.qc-tag.is-active,
.qc-tag:has(input:checked) {
  background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600;
}
.qc-tag-high:has(input:checked) { background: var(--red); border-color: var(--red); }
.qc-tag-low:has(input:checked) { background: var(--green); border-color: var(--green); }

.director-briefing-collapsed .briefing-content[hidden] { display: none; }
.briefing-toggle {
  margin-left: auto;
  background: rgba(255,255,255,0.15);
  border: none;
  color: rgba(255,255,255,0.8);
  width: 28px; height: 28px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
}

/* —— 客户详情：折叠更多信息 —— */
.detail-more { margin-top: 8px; }
.detail-more summary {
  font-size: 12px; color: var(--muted); cursor: pointer;
  list-style: none; padding: 4px 0;
}
.detail-more summary::-webkit-details-marker { display: none; }
.detail-more summary::before { content: "▶ "; font-size: 10px; }
details[open] summary::before { content: "▼ "; }

/* —— 业务员攻关重点：辅导焦点 —— */
.rep-coaching-focus {
  margin-top: 8px;
  font-size: 12px;
  color: var(--accent-dark);
  background: var(--accent-soft);
  border-radius: 6px;
  padding: 6px 10px;
  line-height: 1.5;
}
