:root {
  --bg: #f6f5f2;
  --paper: rgba(255, 255, 252, 0.9);
  --paper-solid: #fffefa;
  --paper-2: #f3f0ea;
  --ink: #1f211e;
  --muted: #77766d;
  --line: rgba(38, 36, 30, 0.11);
  --line-strong: rgba(38, 36, 30, 0.22);
  --accent: #0d6a5d;
  --accent-2: #ba6a3b;
  --accent-3: #2f5f8f;
  --accent-soft: #e4f1ed;
  --danger: #a84747;
  --shadow: 0 18px 54px rgba(42, 34, 24, 0.12);
  --shadow-soft: 0 8px 26px rgba(42, 34, 24, 0.08);
  --blur: blur(18px);
}

.soft-design-view {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
}

.soft-design-head,
.soft-design-toolbar,
.soft-design-list-panel,
.soft-design-editor-panel {
  border: 1px solid rgba(25, 23, 20, 0.1);
  background: rgba(255, 254, 250, 0.92);
  box-shadow: 0 14px 36px rgba(24, 22, 18, 0.06);
}

.soft-design-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 20px;
  border-radius: 14px;
}

.soft-design-head h1 {
  margin: 4px 0 5px;
  font-size: 24px;
  letter-spacing: 0;
}

.soft-design-head p {
  margin: 0;
  color: #767066;
  font-size: 13px;
}

.soft-design-head-actions,
.soft-design-editor-actions,
.soft-design-upload-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.soft-design-toolbar {
  display: grid;
  grid-template-columns: minmax(260px, 420px) minmax(0, 1fr);
  gap: 14px;
  align-items: end;
  padding: 12px;
  border-radius: 14px;
}

.soft-design-search-field input {
  height: 36px;
}

.soft-design-status-tabs,
.soft-design-status-pills,
.soft-design-asset-tabs {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.soft-design-status-tabs button,
.soft-design-status-pills button,
.soft-design-asset-tabs button {
  border: 1px solid rgba(25, 23, 20, 0.1);
  background: #fffdf8;
  color: #6b665e;
  min-height: 32px;
  padding: 0 13px;
  border-radius: 999px;
  font-size: 12px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.soft-design-status-tabs button:hover,
.soft-design-status-pills button:hover,
.soft-design-asset-tabs button:hover {
  transform: translateY(-1px);
  border-color: rgba(19, 112, 105, 0.28);
  color: #137069;
}

.soft-design-status-tabs button.active,
.soft-design-status-pills button.active,
.soft-design-asset-tabs button.active {
  background: #12110f;
  color: #fff;
  border-color: #12110f;
}

.soft-design-layout {
  display: grid;
  grid-template-columns: minmax(260px, 320px) minmax(0, 1fr);
  gap: 12px;
  min-height: 0;
}

.soft-design-list-panel,
.soft-design-editor-panel {
  min-height: clamp(520px, 68vh, 760px);
  border-radius: 14px;
  overflow: hidden;
}

.soft-design-list-panel {
  padding: 14px;
}

.soft-design-list-panel .section-title,
.soft-design-assets-panel .section-title,
.soft-design-editor-title {
  margin-bottom: 12px;
}

.soft-design-project-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: calc(100vh - 294px);
  overflow: auto;
  padding-right: 3px;
}

.soft-design-project-card,
.soft-design-empty-card {
  width: 100%;
  border: 1px solid rgba(25, 23, 20, 0.1);
  background: #fffdf9;
  color: #191714;
  text-align: left;
  border-radius: 12px;
  padding: 12px;
}

.soft-design-project-card {
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.soft-design-project-card:hover,
.soft-design-project-card.active {
  transform: translateY(-1px);
  border-color: rgba(19, 112, 105, 0.28);
  background: #f6fbf8;
  box-shadow: 0 10px 24px rgba(20, 48, 42, 0.08);
}

.soft-design-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.soft-design-card-top strong {
  font-size: 13px;
  line-height: 1.35;
  min-width: 0;
}

.soft-design-project-card p {
  margin: 8px 0 6px;
  color: #756f65;
  font-size: 12px;
  line-height: 1.45;
}

.soft-design-project-card small {
  color: #aaa49b;
  font-size: 11px;
}

.soft-design-status {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 700;
  background: #eee8dc;
  color: #725f43;
}

.soft-design-status-collecting {
  background: #e8f1ff;
  color: #2f6395;
}

.soft-design-status-designing {
  background: #e5f3ef;
  color: #137069;
}

.soft-design-status-ready {
  background: #fff1cb;
  color: #9a6a09;
}

.soft-design-status-delivered {
  background: #e5f4dd;
  color: #3c7f2d;
}

.soft-design-status-archived {
  background: #eeeeee;
  color: #6d6a65;
}

.soft-design-editor-panel {
  padding: 16px;
  overflow: auto;
}

.soft-design-empty {
  min-height: 420px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  color: #777166;
}

.soft-design-empty strong {
  color: #191714;
  font-size: 18px;
}

.soft-design-form,
.soft-design-assets-panel {
  border: 1px solid rgba(25, 23, 20, 0.08);
  border-radius: 14px;
  background: rgba(255, 253, 248, 0.76);
  padding: 14px;
}

.soft-design-assets-panel {
  margin-top: 12px;
}

.soft-design-product-panel,
.soft-design-generator-panel {
  margin-top: 12px;
  border: 1px solid rgba(25, 23, 20, 0.08);
  border-radius: 18px;
  background: rgba(255, 253, 247, 0.82);
  padding: 18px;
}

.soft-design-product-controls {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(150px, 210px);
  gap: 9px;
  margin-bottom: 10px;
}

.soft-design-product-controls input,
.soft-design-prompt-text {
  width: 100%;
  border: 1px solid rgba(43, 39, 31, 0.13);
  background: #fffefa;
  border-radius: 10px;
  color: #191714;
  font-size: 12px;
  outline: none;
}

.soft-design-product-controls input {
  height: 34px;
  padding: 0 11px;
}

.soft-design-selected-products {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  min-height: 34px;
  margin-bottom: 11px;
}

.soft-design-selected-empty {
  color: #8c867c;
  font-size: 12px;
  line-height: 1.6;
}

.soft-design-selected-chip {
  border: 1px solid rgba(13, 106, 93, 0.18);
  background: #e7f4ef;
  color: #0d6a5d;
  border-radius: 999px;
  min-height: 30px;
  padding: 0 12px;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.soft-design-product-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  max-height: 360px;
  overflow: auto;
  padding-right: 3px;
}

.soft-design-product-card {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  grid-template-rows: auto auto;
  gap: 9px 10px;
  border: 1px solid rgba(25, 23, 20, 0.09);
  background: rgba(255, 254, 250, 0.88);
  border-radius: 14px;
  padding: 9px;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.soft-design-product-card:hover {
  transform: translateY(-1px);
  border-color: rgba(13, 106, 93, 0.26);
  box-shadow: 0 12px 24px rgba(45, 37, 27, 0.08);
}

.soft-design-product-thumb {
  grid-row: 1 / 3;
  width: 76px;
  aspect-ratio: 1;
  border: 0;
  border-radius: 12px;
  background: #eee8dc;
  color: #9a9388;
  overflow: hidden;
  cursor: pointer;
}

.soft-design-product-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.soft-design-product-body {
  min-width: 0;
}

.soft-design-product-body strong,
.soft-design-product-body span,
.soft-design-product-body p {
  display: block;
}

.soft-design-product-body strong {
  color: #191714;
  font-size: 12px;
  line-height: 1.35;
}

.soft-design-product-body span {
  margin-top: 3px;
  color: #0d6a5d;
  font-size: 11px;
  font-weight: 800;
}

.soft-design-product-body p {
  margin: 6px 0 0;
  color: #756f65;
  font-size: 11px;
  line-height: 1.55;
}

.soft-design-product-action {
  justify-self: end;
  align-self: end;
  border: 1px solid rgba(25, 23, 20, 0.1);
  background: #12110f;
  color: #fff;
  border-radius: 999px;
  min-height: 28px;
  padding: 0 12px;
  font-size: 12px;
  cursor: pointer;
}

.soft-design-product-action:disabled {
  background: #e7f4ef;
  color: #0d6a5d;
  cursor: default;
}

.soft-design-product-empty,
.soft-design-plan-empty {
  grid-column: 1 / -1;
  border: 1px dashed rgba(31, 33, 30, 0.16);
  border-radius: 14px;
  padding: 18px;
  color: #8c867c;
  background: rgba(255, 254, 250, 0.62);
  font-size: 12px;
}

.soft-design-prompt-preset {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 10px;
}

.soft-design-preset-button {
  border: 1px solid rgba(25, 23, 20, 0.1);
  background: #fffefa;
  color: #6b665e;
  min-height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 12px;
  cursor: pointer;
}

.soft-design-preset-button.active {
  background: #12110f;
  color: #fff;
  border-color: #12110f;
}

.soft-design-prompt-text {
  min-height: 158px;
  padding: 11px 12px;
  resize: vertical;
  line-height: 1.65;
}

.soft-design-prompt-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 9px;
  color: #8c867c;
  font-size: 12px;
}

.soft-design-generator-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}

.soft-design-plan-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.soft-design-plan-card {
  display: block;
  border: 1px solid rgba(25, 23, 20, 0.09);
  border-radius: 14px;
  overflow: hidden;
  background: #fffefa;
  color: inherit;
  text-decoration: none;
}

.soft-design-plan-card img {
  width: 100%;
  aspect-ratio: 9 / 12;
  object-fit: cover;
  display: block;
  background: #eee8dc;
}

.soft-design-plan-card span {
  display: block;
  padding: 8px 9px;
  color: #756f65;
  font-size: 11px;
  line-height: 1.4;
}

.soft-design-form-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.soft-design-text-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.soft-design-form textarea,
.soft-design-form input,
.soft-design-asset-note {
  border-radius: 9px;
}

.soft-design-asset-note {
  width: 100%;
  height: 36px;
  border: 1px solid rgba(25, 23, 20, 0.12);
  background: #fff;
  padding: 0 11px;
  margin-bottom: 12px;
}

.soft-design-asset-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(160px, 1fr));
  gap: 10px;
}

.soft-design-asset-card,
.soft-design-asset-empty {
  border: 1px solid rgba(25, 23, 20, 0.1);
  background: #fffdf9;
  border-radius: 12px;
  overflow: hidden;
}

.soft-design-asset-empty {
  grid-column: 1 / -1;
  padding: 24px;
  text-align: center;
  color: #817a70;
}

.soft-design-asset-preview {
  display: grid;
  place-items: center;
  aspect-ratio: 4 / 3;
  background: #eeeae1;
  color: #5e584f;
  font-size: 12px;
  text-decoration: none;
}

.soft-design-asset-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.soft-design-asset-body {
  padding: 10px 10px 6px;
}

.soft-design-asset-body strong {
  display: block;
  font-size: 12px;
  color: #191714;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.soft-design-asset-body span {
  display: block;
  margin-top: 4px;
  color: #8d857b;
  font-size: 11px;
}

.soft-design-asset-body p {
  margin: 7px 0 0;
  min-height: 18px;
  color: #6d675f;
  font-size: 12px;
  line-height: 1.45;
}

.soft-design-asset-remove {
  width: calc(100% - 20px);
  margin: 0 10px 10px;
  min-height: 30px;
  border: 1px solid rgba(183, 61, 36, 0.24);
  border-radius: 9px;
  background: #fff8f4;
  color: #b73d24;
  cursor: pointer;
}

.soft-design-asset-remove:hover {
  background: #b73d24;
  color: #fff;
}

@media (max-width: 1280px) {
  .soft-design-layout {
    grid-template-columns: 280px minmax(0, 1fr);
  }

  .soft-design-form-grid {
    grid-template-columns: repeat(2, minmax(160px, 1fr));
  }

  .soft-design-asset-list {
    grid-template-columns: repeat(2, minmax(160px, 1fr));
  }
}

@media (max-width: 980px) {
  .soft-design-head,
  .soft-design-toolbar {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .soft-design-head {
    flex-direction: column;
    align-items: stretch;
  }

  .soft-design-layout {
    grid-template-columns: 1fr;
  }

  .soft-design-list-panel,
  .soft-design-editor-panel {
    min-height: auto;
  }

  .soft-design-project-list {
    max-height: 260px;
  }

  .soft-design-text-grid {
    grid-template-columns: 1fr;
  }
}

/* Soft design workspace v2 */
.soft-design-view {
  gap: 14px;
  padding-bottom: 18px;
  background:
    radial-gradient(circle at 14% -12%, rgba(119, 143, 111, 0.12), transparent 34%),
    radial-gradient(circle at 91% 7%, rgba(150, 103, 69, 0.11), transparent 30%);
}

.soft-design-head,
.soft-design-toolbar,
.soft-design-list-panel,
.soft-design-editor-panel,
.soft-design-preview-panel,
.soft-design-process-strip {
  border: 1px solid rgba(43, 39, 31, 0.1);
  background: rgba(255, 254, 249, 0.9);
  box-shadow: 0 18px 48px rgba(42, 34, 24, 0.08);
}

.soft-design-head {
  min-height: 132px;
  align-items: stretch;
  padding: 22px 24px;
  border-radius: 18px;
  overflow: hidden;
  position: relative;
}

.soft-design-head::after {
  content: "SOFT DECOR";
  position: absolute;
  right: 28px;
  bottom: -12px;
  color: rgba(31, 33, 30, 0.035);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 72px;
  letter-spacing: 0.04em;
  pointer-events: none;
}

.soft-design-head-copy {
  max-width: 760px;
  position: relative;
  z-index: 1;
}

.soft-design-head h1 {
  margin: 6px 0 8px;
  font-size: 32px;
  font-weight: 800;
  letter-spacing: 0;
}

.soft-design-head p {
  max-width: 680px;
  color: #70695f;
  font-size: 14px;
  line-height: 1.8;
}

.soft-design-head-right {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
}

.soft-design-signal-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(78px, 1fr));
  gap: 8px;
  min-width: 300px;
}

.soft-design-signal-grid span {
  display: grid;
  gap: 2px;
  padding: 11px 12px;
  border: 1px solid rgba(31, 33, 30, 0.1);
  border-radius: 14px;
  background: rgba(246, 242, 232, 0.78);
  color: #786f64;
  font-size: 12px;
}

.soft-design-signal-grid strong {
  color: #151412;
  font-size: 22px;
  line-height: 1;
}

.soft-design-process-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  border-radius: 16px;
  overflow: hidden;
}

.soft-design-process-strip span {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  padding: 0 18px;
  color: #5f5a52;
  border-right: 1px solid rgba(43, 39, 31, 0.09);
}

.soft-design-process-strip span:last-child {
  border-right: 0;
}

.soft-design-process-strip b {
  color: #0d6a5d;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 13px;
  letter-spacing: 0.08em;
}

.soft-design-toolbar {
  grid-template-columns: minmax(290px, 420px) 1fr;
  align-items: end;
  padding: 13px 14px;
  border-radius: 16px;
}

.soft-design-layout {
  grid-template-columns: minmax(270px, 310px) minmax(560px, 1fr) minmax(330px, 390px);
  align-items: start;
}

.soft-design-list-panel,
.soft-design-editor-panel,
.soft-design-preview-panel {
  min-height: clamp(640px, 72vh, 850px);
  border-radius: 18px;
}

.soft-design-list-panel {
  background: linear-gradient(180deg, rgba(255, 254, 250, 0.96), rgba(248, 244, 236, 0.88));
}

.soft-design-editor-panel {
  padding: 18px;
  background: rgba(255, 254, 250, 0.84);
}

.soft-design-preview-panel {
  padding: 18px;
  position: sticky;
  top: 8px;
  background: linear-gradient(180deg, #fffcf5 0%, #f5f1e7 100%);
}

.soft-design-empty {
  min-height: 600px;
  border: 1px dashed rgba(31, 33, 30, 0.16);
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(13, 106, 93, 0.06), transparent 42%),
    rgba(255, 254, 250, 0.62);
}

.soft-design-empty-mark {
  color: rgba(31, 33, 30, 0.16);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 54px;
  letter-spacing: 0.08em;
}

.soft-design-form,
.soft-design-assets-panel {
  border-radius: 18px;
  padding: 18px;
  background: rgba(255, 253, 247, 0.82);
}

.soft-design-form-section {
  margin-top: 14px;
}

.soft-design-section-label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.soft-design-section-label span {
  color: #0d6a5d;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.soft-design-section-label strong {
  font-size: 15px;
}

.soft-design-form-grid {
  grid-template-columns: repeat(4, minmax(130px, 1fr));
}

.soft-design-text-grid {
  grid-template-columns: repeat(2, minmax(240px, 1fr));
}

.soft-design-form .field span,
.soft-design-search-field span {
  color: #615b52;
  font-weight: 700;
}

.soft-design-form input,
.soft-design-form textarea,
.soft-design-search-field input,
.soft-design-asset-note {
  border-color: rgba(43, 39, 31, 0.13);
  background: #fffefa;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.soft-design-form textarea {
  min-height: 96px;
  resize: vertical;
}

.soft-design-project-card,
.soft-design-empty-card,
.soft-design-asset-card,
.soft-design-asset-empty {
  border-radius: 14px;
}

.soft-design-project-card {
  background: rgba(255, 254, 250, 0.86);
}

.soft-design-project-card.active {
  background:
    linear-gradient(135deg, rgba(13, 106, 93, 0.11), rgba(255, 253, 247, 0.92));
}

.soft-design-asset-list {
  grid-template-columns: repeat(4, minmax(140px, 1fr));
}

.soft-design-asset-preview {
  aspect-ratio: 5 / 4;
}

.soft-design-preview-panel .section-title {
  margin-bottom: 14px;
}

.soft-design-phone {
  width: min(100%, 338px);
  margin: 0 auto;
  border: 1px solid rgba(31, 33, 30, 0.14);
  border-radius: 30px;
  background: #fffefa;
  box-shadow: 0 28px 70px rgba(45, 37, 27, 0.14);
  overflow: hidden;
}

.soft-design-phone-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 48px;
  padding: 0 18px;
  color: #6f675e;
  font-size: 11px;
  letter-spacing: 0.05em;
  border-bottom: 1px solid rgba(31, 33, 30, 0.08);
}

.soft-design-phone-top b {
  color: #1f211e;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 11px;
  letter-spacing: 0.12em;
}

.soft-design-phone-hero {
  min-height: 210px;
  background:
    linear-gradient(135deg, rgba(93, 111, 83, 0.18), transparent 42%),
    #eee9de;
}

.soft-design-phone-hero img {
  width: 100%;
  height: 240px;
  object-fit: cover;
  display: block;
}

.soft-design-preview-placeholder {
  display: grid;
  place-items: center;
  align-content: center;
  min-height: 240px;
  gap: 8px;
  color: rgba(31, 33, 30, 0.38);
}

.soft-design-preview-placeholder span {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 34px;
  letter-spacing: 0.09em;
}

.soft-design-preview-placeholder small {
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.soft-design-phone-body {
  padding: 20px 20px 24px;
}

.soft-design-phone-kicker {
  color: #0d6a5d;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.soft-design-phone-body h3 {
  margin: 10px 0 12px;
  color: #141311;
  font-size: 24px;
  line-height: 1.18;
  letter-spacing: 0;
}

.soft-design-phone-body p {
  margin: 0;
  color: #5f5a52;
  font-size: 12px;
  line-height: 1.8;
}

.soft-design-phone-facts {
  display: grid;
  gap: 8px;
  margin: 16px 0;
}

.soft-design-phone-facts span {
  padding: 9px 10px;
  border-radius: 12px;
  background: rgba(245, 241, 232, 0.86);
  color: #5c554b;
  font-size: 12px;
}

.soft-design-preview-palette {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 16px 0;
}

.soft-design-preview-palette span {
  width: 34px;
  height: 34px;
  border: 1px solid rgba(31, 33, 30, 0.1);
  border-radius: 50%;
  box-shadow: inset 0 0 0 4px rgba(255, 255, 255, 0.45);
}

.soft-design-preview-note {
  padding-top: 15px;
  margin-top: 15px;
  border-top: 1px solid rgba(31, 33, 30, 0.09);
}

.soft-design-preview-note strong {
  display: block;
  margin-bottom: 7px;
  font-size: 12px;
}

.soft-design-readiness {
  margin-top: 14px;
  padding: 14px;
  border: 1px solid rgba(31, 33, 30, 0.1);
  border-radius: 16px;
  background: rgba(255, 254, 250, 0.72);
}

.soft-design-readiness span {
  display: block;
  margin-bottom: 5px;
  color: #0d6a5d;
  font-weight: 800;
}

.soft-design-readiness p {
  margin: 0;
  color: #6a6258;
  font-size: 12px;
  line-height: 1.7;
}

.soft-design-brief-copy {
  width: 100%;
  min-height: 42px;
  margin-top: 10px;
  border-color: #12110f;
  border-radius: 14px;
  background: #12110f;
  color: #fffefa;
  font-weight: 800;
}

.soft-design-brief-copy:hover {
  background: #0d6a5d;
  border-color: #0d6a5d;
}

@media (max-width: 1560px) {
  .soft-design-layout {
    grid-template-columns: minmax(250px, 290px) minmax(520px, 1fr) minmax(310px, 350px);
  }

  .soft-design-asset-list {
    grid-template-columns: repeat(3, minmax(140px, 1fr));
  }
}

@media (max-width: 1280px) {
  .soft-design-layout {
    grid-template-columns: 280px minmax(0, 1fr);
  }

  .soft-design-preview-panel {
    grid-column: 1 / -1;
    position: static;
  }

  .soft-design-phone {
    width: min(100%, 420px);
  }
}

@media (max-width: 980px) {
  .soft-design-process-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .soft-design-signal-grid {
    min-width: 0;
    width: 100%;
  }

  .soft-design-head-right {
    align-items: stretch;
  }

  .soft-design-layout,
  .soft-design-toolbar,
  .soft-design-form-grid,
  .soft-design-text-grid,
  .soft-design-asset-list {
    grid-template-columns: 1fr;
  }
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: "Microsoft YaHei UI", "Microsoft YaHei", "PingFang SC", "Segoe UI", Arial, sans-serif;
  font-size: 13px;
  color: var(--ink);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.84), transparent 38%),
    linear-gradient(135deg, #f8f7f4 0%, #efebe3 100%);
  letter-spacing: 0;
  overflow: hidden;
}

button,
input,
select {
  font: inherit;
}

button {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--ink);
  padding: 0 12px;
  cursor: pointer;
  transition: border-color 0.16s ease, background 0.16s ease, transform 0.16s ease, box-shadow 0.16s ease;
}

button:hover {
  border-color: var(--line-strong);
  background: #fff;
  transform: translateY(-1px);
  box-shadow: var(--shadow-soft);
}

button:active {
  transform: translateY(0);
  box-shadow: none;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
  transform: none;
  box-shadow: none;
}

[hidden] {
  display: none !important;
}

.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 25% 18%, rgba(122, 98, 64, 0.10), transparent 28%),
    linear-gradient(135deg, #f8f5ef, #ede7dc);
}

.login-card {
  width: min(420px, 92vw);
  display: grid;
  gap: 14px;
  padding: 28px;
  border: 1px solid rgba(42, 34, 24, 0.10);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 30px 90px rgba(42, 34, 24, 0.14);
  backdrop-filter: blur(18px);
}

.login-brand {
  display: grid;
  gap: 6px;
  margin-bottom: 8px;
}

.login-brand strong {
  font-size: 22px;
  letter-spacing: 0.16em;
}

.login-brand span {
  color: var(--muted);
}

#loginErrorText {
  min-height: 18px;
  margin: 0;
  color: var(--danger);
  font-size: 12px;
}

.dark-action,
.nav-list button.active {
  border-color: #161614;
  background: #161614;
  color: #fff;
  box-shadow: 0 10px 22px rgba(22, 22, 20, 0.12);
}

.dark-action:hover,
.nav-list button.active:hover {
  border-color: #161614;
  background: #161614;
  color: #fff;
}

input,
select {
  width: 100%;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--ink);
  padding: 0 10px;
  outline: none;
}

input:focus,
select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(13, 106, 93, 0.12);
}

.app {
  height: 100vh;
  height: 100dvh;
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-columns: 270px minmax(650px, 1fr) 340px;
  grid-template-rows: 56px minmax(0, 1fr);
  grid-template-areas:
    "header header header"
    "left stage right";
}

.app.table-mode {
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas:
    "header"
    "stage";
}

.app.dashboard-mode {
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas:
    "header"
    "stage";
}

.app.table-mode .left-rail,
.app.table-mode .right-rail,
.app.table-mode .metric-grid {
  display: none;
}

.app.dashboard-mode .left-rail,
.app.dashboard-mode .right-rail,
.app.dashboard-mode .legacy-metric-grid {
  display: none;
}

.app.table-mode .stage {
  padding: 14px 18px 18px;
}

.app.table-mode .table-view,
.app.dashboard-mode .table-view {
  height: 100%;
}

.app.dashboard-mode .stage {
  padding: 16px 18px 22px;
}

.app-header {
  grid-area: header;
  position: relative;
  z-index: 20;
  display: grid;
  grid-template-columns: 210px auto minmax(240px, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 0 14px 0 20px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 252, 0.9);
  backdrop-filter: var(--blur);
}

.brand {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.brand strong {
  font-size: 16px;
  letter-spacing: 0.08em;
}

.brand span {
  color: var(--muted);
}

.global-search input {
  max-width: 460px;
}

.view-tabs {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.56);
  overflow-x: auto;
  scrollbar-width: none;
  max-width: 100%;
}
.view-tabs::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.view-tabs button {
  min-height: 28px;
  border-color: transparent;
  border-radius: 8px;
  padding: 0 11px;
  background: transparent;
  color: var(--muted);
  box-shadow: none;
  flex-shrink: 0;
  min-width: max-content;
}

.view-tabs button:hover {
  transform: none;
  box-shadow: none;
}

.view-tabs button.active {
  border-color: rgba(22, 22, 20, 0.14);
  background: #161614;
  color: #fff;
}

.header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-width: 0;
}

.preview-copy-pill {
  max-width: 360px;
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  border: 1px solid rgba(13, 106, 93, 0.18);
  border-radius: 999px;
  background: rgba(238, 248, 245, 0.86);
  color: #0d6a5d;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-badge {
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
}

.left-rail,
.right-rail {
  min-width: 0;
  overflow: auto;
  padding: 16px;
  background: rgba(255, 253, 248, 0.46);
  backdrop-filter: var(--blur);
  scrollbar-width: none;
}

.left-rail {
  grid-area: left;
  border-right: 1px solid var(--line);
}

.right-rail {
  grid-area: right;
  border-left: 1px solid var(--line);
}

.left-rail::-webkit-scrollbar,
.right-rail::-webkit-scrollbar,
.stage::-webkit-scrollbar,
.customer-list::-webkit-scrollbar,
.message-list::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.stage {
  grid-area: stage;
  min-width: 0;
  min-height: 0;
  overflow: auto;
  padding: 16px;
}

.rail-section,
.assistant-panel {
  margin-bottom: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--paper);
  box-shadow: var(--shadow-soft);
  backdrop-filter: var(--blur);
}

.section-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.section-title h2 {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
}

.table-title-main {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.table-total-pill {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 9px;
  border: 1px solid rgba(16, 16, 16, 0.08);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.section-title span {
  color: var(--muted);
  font-size: 12px;
}

.table-title-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.operation-copy-hint,
.preview-boundary-note {
  margin: 0;
  color: #625d53;
  font-size: 12px;
  line-height: 1.6;
}

.operation-copy-hint {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid rgba(13, 106, 93, 0.14);
  border-radius: 8px;
  background: rgba(238, 248, 245, 0.58);
}

.preview-boundary-note {
  max-width: 760px;
  padding: 8px 10px;
  border-left: 3px solid rgba(13, 106, 93, 0.42);
  background: rgba(238, 248, 245, 0.62);
}

.deal-create-form .operation-copy-hint {
  grid-column: 1 / -1;
  padding: 6px 8px;
}

.compact-action {
  min-height: 30px;
  padding: 0 12px;
  border-radius: 8px;
  font-size: 12px;
}

.copy-filtered-ids-action {
  min-width: 78px;
  border-color: rgba(13, 106, 93, 0.16);
  background: rgba(255, 255, 255, 0.72);
  color: #0d6a5d;
  font-weight: 700;
}

.copy-filtered-ids-action:hover,
.copy-filtered-ids-action:focus-visible {
  border-color: #161614;
  background: #161614;
  color: #fff;
}

.subtle-action {
  border-color: rgba(13, 106, 93, 0.18);
  background: rgba(224, 246, 241, 0.64);
  color: var(--accent);
  box-shadow: none;
}

.subtle-action:hover,
.subtle-action:focus-visible {
  border-color: #161614;
  background: #161614;
  color: #fff;
  transform: translateY(-1px);
}

.nav-list {
  display: grid;
  gap: 8px;
}

.nav-list button {
  justify-content: flex-start;
  text-align: left;
}

.field {
  display: grid;
  gap: 6px;
  margin-bottom: 10px;
}

.field span {
  color: var(--muted);
  font-size: 12px;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(130px, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.metric {
  min-height: 84px;
  display: grid;
  align-content: center;
  gap: 8px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--paper);
  box-shadow: var(--shadow-soft);
}

.metric span {
  color: var(--muted);
}

.metric strong {
  font-size: 26px;
  line-height: 1;
}

.workspace {
  min-height: calc(100vh - 170px);
  display: grid;
  grid-template-columns: minmax(330px, 420px) minmax(400px, 1fr);
  gap: 14px;
}

.dashboard-workspace {
  min-height: calc(100vh - 94px);
  display: grid;
  grid-template-columns: 1fr;
  align-content: start;
  gap: 14px;
}

.today-command {
  min-width: 0;
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid rgba(38, 36, 30, 0.10);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(13, 106, 93, 0.10) 0 6px, transparent 6px),
    linear-gradient(135deg, rgba(255, 254, 250, 0.94), rgba(247, 242, 233, 0.82));
  box-shadow: 0 12px 34px rgba(42, 34, 24, 0.07);
}

.today-command-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  padding-left: 6px;
}

.today-command-head h2 {
  margin: 4px 0 0;
  font-size: 20px;
  line-height: 1.15;
}

.today-command-signal {
  min-width: 220px;
  display: grid;
  justify-items: end;
  gap: 4px;
  color: var(--muted);
  text-align: right;
}

.today-command-signal strong {
  color: var(--ink);
  font-size: 18px;
  line-height: 1;
}

.today-command-body {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 300px);
  gap: 14px;
  align-items: start;
}

.today-priority-area,
.today-risk-area {
  min-width: 0;
  display: grid;
  gap: 10px;
}

.today-subhead {
  min-height: 24px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
}

.today-subhead span {
  color: var(--ink);
  font-weight: 700;
}

.today-subhead small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.today-priority-list {
  display: grid;
  gap: 8px;
}

.today-customer-row {
  min-width: 0;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 96px;
  padding: 12px 12px 12px 10px;
  border: 1px solid rgba(38, 36, 30, 0.10);
  border-radius: 8px;
  background: rgba(255, 255, 252, 0.74);
}

.today-rank {
  width: 34px;
  height: 56px;
  display: grid;
  place-items: center;
  border-right: 1px solid rgba(38, 36, 30, 0.12);
  color: #7b6a52;
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: 18px;
  font-weight: 700;
}

.today-customer-main {
  min-width: 0;
  display: grid;
  gap: 7px;
}

.today-customer-top {
  min-width: 0;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.today-customer-title {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.today-customer-title strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 15px;
}

.today-level,
.today-reason,
.today-blocker-text {
  min-width: max-content;
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 8px;
  border: 1px solid rgba(38, 36, 30, 0.10);
  border-radius: 999px;
  font-size: 11px;
  line-height: 1;
}

.today-level {
  color: #0d6a5d;
  background: rgba(228, 241, 237, 0.72);
}

.today-level.level-b {
  color: #8c4b24;
  background: rgba(245, 232, 214, 0.88);
}

.today-level.level-c {
  color: #2f5f8f;
  background: rgba(224, 234, 243, 0.86);
}

.today-customer-meta {
  min-width: 170px;
  overflow: hidden;
  color: var(--muted);
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.today-reasons {
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.today-reason.green,
.today-risk-chip.green {
  color: #0d6a5d;
  background: rgba(228, 241, 237, 0.84);
}

.today-reason.amber,
.today-risk-chip.amber {
  color: #8c5b28;
  background: rgba(247, 232, 207, 0.88);
}

.today-reason.blue,
.today-risk-chip.blue {
  color: #2f5f8f;
  background: rgba(224, 234, 243, 0.88);
}

.today-reason.red,
.today-risk-chip.red {
  color: #a84747;
  background: rgba(247, 227, 222, 0.86);
}

.today-reason.neutral {
  color: var(--muted);
  background: rgba(255, 255, 255, 0.74);
}

.today-blocker-text {
  max-width: min(320px, 100%);
  overflow: hidden;
  color: #8c5b28;
  text-overflow: ellipsis;
  white-space: nowrap;
  background: rgba(255, 255, 255, 0.72);
}

.today-next-action {
  margin: 0;
  overflow: hidden;
  color: #424039;
  line-height: 1.5;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.today-primary-action {
  min-width: 0;
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  align-items: baseline;
  gap: 8px;
}

.today-primary-action strong {
  color: var(--ink);
  font-size: 16px;
}

.today-primary-action span {
  min-width: 0;
  overflow: hidden;
  color: #5f5b52;
  line-height: 1.45;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.today-support-details {
  min-width: 0;
  color: var(--muted);
}

.today-support-details > summary,
.today-more-customers > summary {
  width: max-content;
  max-width: 100%;
  cursor: pointer;
  color: #5f6d67;
  font-size: 12px;
  font-weight: 700;
}

.today-support-details[open] > summary,
.today-more-customers[open] > summary {
  margin-bottom: 8px;
}

.today-action-basis {
  margin: 0 0 8px;
  overflow-wrap: anywhere;
  color: #5f5b52;
  line-height: 1.55;
}

.today-more-reasons {
  margin-bottom: 8px;
}

.today-more-customers {
  min-width: 0;
  padding: 10px 12px;
  border: 1px dashed rgba(38, 36, 30, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 252, 0.54);
}

.today-more-customer-list {
  min-width: 0;
  display: grid;
  gap: 8px;
}

.today-data-groups {
  min-width: 0;
  display: grid;
  gap: 10px;
}

.today-data-group {
  min-width: 0;
  padding: 10px;
  border: 1px solid rgba(38, 36, 30, 0.10);
  border-radius: 8px;
  background: rgba(255, 255, 252, 0.70);
}

.today-data-group > header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.today-data-group > header strong {
  color: var(--ink);
  font-size: 13px;
}

.today-data-group > header small {
  color: var(--muted);
  font-size: 10px;
  white-space: nowrap;
}

.today-metric-grid {
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.today-metric {
  min-width: 0;
  display: grid;
  gap: 2px;
  padding: 7px;
  border-radius: 6px;
  background: rgba(245, 242, 235, 0.72);
}

.today-metric strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 15px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.today-metric span {
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.close-loop-advice {
  min-width: 0;
  display: grid;
  gap: 6px;
}

.close-loop-heading {
  color: #6f614d;
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0;
}

.close-loop-items {
  min-width: 0;
  display: grid;
  gap: 6px;
}

.today-close-loop .close-loop-items {
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
}

.close-loop-item {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 7px 8px;
  border: 1px solid rgba(38, 36, 30, 0.09);
  border-left-width: 3px;
  border-radius: 7px;
  background: rgba(255, 255, 252, 0.70);
}

.close-loop-main {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.close-loop-main strong {
  color: #2f2d28;
  font-size: 12px;
  line-height: 1.25;
}

.close-loop-main span {
  overflow: hidden;
  color: #655d52;
  font-size: 11.5px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.close-loop-action {
  min-width: 68px;
  min-height: 26px;
  padding: 0 8px;
  border-radius: 7px;
  border-color: rgba(38, 36, 30, 0.12);
  color: #2f2d28;
  background: rgba(255, 255, 255, 0.74);
  font-size: 11.5px;
  font-weight: 800;
  box-shadow: none;
  transform: none;
  white-space: nowrap;
}

.close-loop-action:hover,
.close-loop-action:focus-visible {
  border-color: rgba(13, 106, 93, 0.28);
  color: var(--accent);
  background: #fff;
  box-shadow: none;
  transform: none;
}

.close-loop-item.amber {
  border-left-color: #b47a2a;
  background: rgba(255, 248, 234, 0.78);
}

.close-loop-item.blue {
  border-left-color: #4d7fa7;
  background: rgba(239, 247, 252, 0.78);
}

.close-loop-item.green {
  border-left-color: #0d6a5d;
  background: rgba(238, 248, 245, 0.78);
}

.close-loop-item.red {
  border-left-color: #b75a4c;
  background: rgba(255, 241, 238, 0.78);
}

.close-loop-item.neutral {
  border-left-color: rgba(112, 104, 92, 0.42);
}

.close-loop-focus {
  outline: 2px solid rgba(13, 106, 93, 0.42) !important;
  outline-offset: -4px;
  background: #fff7d9 !important;
}

.today-row-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 7px;
}

.today-dark-action,
.today-link-action {
  min-width: 108px;
  min-height: 32px;
  border-radius: 8px;
  box-shadow: none;
  transform: none;
}

.today-dark-action {
  border-color: #161614;
  color: #fff;
  background: #161614;
}

.today-link-action {
  color: var(--accent);
  background: rgba(255, 255, 252, 0.74);
}

.today-dark-action:hover,
.today-dark-action:focus-visible,
.today-link-action:hover,
.today-link-action:focus-visible {
  transform: none;
  box-shadow: none;
}

.today-risk-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.today-risk-chip {
  min-height: 68px;
  display: grid;
  align-content: center;
  gap: 5px;
  padding: 10px;
  border: 1px solid rgba(38, 36, 30, 0.08);
  border-radius: 8px;
  width: 100%;
  appearance: none;
  cursor: pointer;
  font: inherit;
  text-align: left;
  box-shadow: none;
  transform: none;
}

.today-risk-chip strong {
  color: var(--ink);
  font-size: 22px;
  line-height: 1;
}

.today-risk-chip span {
  color: inherit;
  font-size: 12px;
}

.today-risk-chip:hover,
.today-risk-chip:focus-visible {
  border-color: rgba(13, 106, 93, 0.24);
  box-shadow: none;
  transform: none;
}

.today-empty-state {
  min-height: 112px;
  display: grid;
  align-content: center;
  justify-items: start;
  gap: 8px;
  padding: 18px;
  border: 1px dashed rgba(38, 36, 30, 0.18);
  border-radius: 8px;
  color: var(--muted);
  background: rgba(255, 255, 252, 0.58);
}

.today-empty-state strong {
  color: var(--ink);
  font-size: 15px;
}

.dashboard-overview-title {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  padding: 2px 2px 0;
}

.dashboard-overview-title span {
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
}

.dashboard-overview-title h2 {
  margin: 3px 0 0;
  font-size: 17px;
}

.dashboard-overview-title p {
  max-width: 560px;
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
  text-align: right;
}

@media (max-width: 1180px) {
  .today-command-body {
    grid-template-columns: 1fr;
  }

  .today-data-groups {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .today-risk-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .today-customer-row {
    grid-template-columns: 38px minmax(0, 1fr);
  }

  .today-row-actions {
    grid-column: 2;
    grid-template-columns: repeat(2, minmax(108px, max-content));
  }
}

@media (max-width: 760px) {
  .today-command-head,
  .dashboard-overview-title {
    align-items: start;
    flex-direction: column;
  }

  .today-command-signal,
  .dashboard-overview-title p {
    min-width: 0;
    justify-items: start;
    text-align: left;
  }

  .today-data-groups {
    grid-template-columns: 1fr;
  }

  .today-primary-action {
    grid-template-columns: 1fr;
    gap: 3px;
  }

  .today-primary-action span {
    white-space: normal;
  }

  .today-risk-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .today-customer-top {
    display: grid;
  }

  .today-customer-meta,
  .today-next-action {
    min-width: 0;
    text-align: left;
    white-space: normal;
  }

  .today-close-loop .close-loop-items {
    grid-template-columns: 1fr;
  }

  .today-close-loop .close-loop-item {
    grid-template-columns: 1fr;
    justify-items: start;
  }

  .today-close-loop .close-loop-main span {
    white-space: normal;
  }

  .today-row-actions {
    grid-template-columns: 1fr;
  }
}

.workbench-hero,
.dashboard-panel,
.kpi-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
  box-shadow: var(--shadow-soft);
  backdrop-filter: var(--blur);
}

.workbench-hero {
  min-height: 132px;
  display: grid;
  grid-template-columns: minmax(360px, 1fr) auto;
  align-items: center;
  gap: 18px;
  padding: 22px;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(13, 106, 93, 0.10), transparent 34%),
    linear-gradient(135deg, rgba(47, 95, 143, 0.08), transparent 52%),
    rgba(255, 255, 252, 0.86);
}

.workbench-heading h1 {
  margin: 4px 0 8px;
  font-size: 28px;
  line-height: 1.1;
  letter-spacing: 0;
}

.workbench-heading p,
.panel-head p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.workbench-controls {
  min-width: 760px;
  display: grid;
  grid-template-columns: minmax(220px, auto) minmax(190px, 240px) 132px 132px 84px;
  align-items: end;
  gap: 10px;
}

.workbench-controls label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 11px;
}

.workbench-period-tabs {
  min-height: 36px;
}

.workbench-period-tabs button {
  min-width: 48px;
}

.workbench-product-groups {
  grid-column: 1 / -1;
  min-height: 30px;
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  padding-top: 2px;
  scrollbar-width: none;
}

.workbench-product-groups::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.workbench-product-groups button {
  min-height: 28px;
  min-width: max-content;
  padding: 0 11px;
  border-radius: 999px;
  border-color: rgba(38, 36, 30, 0.10);
  color: var(--muted);
  background: rgba(255, 255, 255, 0.62);
  box-shadow: none;
}

.workbench-product-groups button:hover,
.workbench-product-groups button.active {
  border-color: rgba(13, 106, 93, 0.18);
  color: #fff;
  background: #161614;
  transform: none;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(130px, 1fr));
  gap: 12px;
}

.kpi-card {
  min-height: 106px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(98px, 104px);
  align-items: center;
  gap: 8px;
  padding: 15px 14px;
  overflow: hidden;
}

.kpi-main {
  min-width: 0;
  display: grid;
  gap: 8px;
}

.kpi-card span,
.kpi-staff-mini span {
  color: var(--muted);
}

.kpi-main strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 28px;
  line-height: 1;
}

.kpi-main small {
  min-height: 17px;
  color: var(--muted);
}

.kpi-staff-mini {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.kpi-staff-mini div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  font-size: 10px;
  min-width: 0;
}

.kpi-staff-mini span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.kpi-staff-mini strong {
  color: var(--ink);
  font-size: 11px;
  white-space: nowrap;
}

.kpi-primary {
  color: #fff;
  border-color: rgba(13, 106, 93, 0.28);
  background:
    linear-gradient(135deg, #0d6a5d 0%, #134f76 100%);
}

.kpi-primary .kpi-main span,
.kpi-primary .kpi-main small,
.kpi-primary .kpi-staff-mini span {
  color: rgba(255, 255, 255, 0.78);
}

.kpi-primary .kpi-staff-mini strong {
  color: #fff;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(340px, 0.65fr);
  gap: 14px;
}

.dashboard-panel {
  min-width: 0;
  padding: 16px;
}

.trend-panel,
.radar-panel {
  min-height: 330px;
}

.staff-panel,
.blocker-panel,
.funnel-panel {
  min-height: 260px;
}

.level-panel {
  min-height: 330px;
}

.panel-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.panel-head h2 {
  margin: 0 0 5px;
  font-size: 15px;
}

.trend-chart {
  height: 232px;
  display: flex;
  align-items: end;
  gap: 12px;
  overflow-x: auto;
  padding: 14px 4px 0;
  scrollbar-width: none;
}

.trend-chart::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.trend-column {
  min-width: 48px;
  flex: 1;
  display: grid;
  align-items: end;
  gap: 8px;
  text-align: center;
}

.trend-bars {
  height: 152px;
  display: flex;
  align-items: end;
  justify-content: center;
  gap: 4px;
  padding: 0 5px;
  border-bottom: 1px solid rgba(38, 36, 30, 0.12);
}

.trend-bar {
  width: 8px;
  border-radius: 999px 999px 2px 2px;
  background: var(--line-strong);
}

.trend-bar.new {
  background: #0d6a5d;
}

.trend-bar.wechat {
  background: #2f5f8f;
}

.trend-bar.deal {
  background: #ba6a3b;
}

.trend-column small {
  color: var(--muted);
  font-size: 11px;
}

.funnel-list {
  display: grid;
  gap: 14px;
}

.funnel-item {
  display: grid;
  gap: 7px;
}

.funnel-item > div:first-child {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.funnel-item span,
.blocker-bar span {
  color: var(--muted);
}

.funnel-track,
.blocker-track {
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(38, 36, 30, 0.08);
}

.funnel-track i,
.blocker-track i {
  height: 100%;
  display: block;
  border-radius: inherit;
  background: linear-gradient(90deg, #0d6a5d, #2f5f8f);
}

.level-chart-layout {
  min-height: 240px;
  display: grid;
  grid-template-columns: 178px minmax(0, 1fr);
  align-items: center;
  gap: 20px;
}

.level-pie {
  width: 170px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #e8e3d8;
  box-shadow: inset 0 0 0 1px rgba(38, 36, 30, 0.08), 0 18px 42px rgba(44, 38, 28, 0.10);
}

.level-pie-core {
  width: 92px;
  height: 92px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 4px;
  border-radius: 50%;
  background: var(--paper);
  box-shadow: inset 0 0 0 1px rgba(38, 36, 30, 0.08);
}

.level-pie-core strong {
  font-size: 24px;
  line-height: 1;
}

.level-pie-core span {
  color: var(--muted);
  font-size: 11px;
}

.level-legend {
  display: grid;
  gap: 9px;
}

.level-legend-row {
  min-height: 42px;
  display: grid;
  grid-template-columns: 10px minmax(72px, 1fr) auto auto;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.62);
}

.level-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.level-legend-row span {
  color: var(--muted);
}

.level-legend-row strong {
  font-size: 14px;
}

.radar-layout {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) 190px;
  align-items: center;
  gap: 10px;
}

.dashboard-staff-tabs {
  width: max-content;
  max-width: 100%;
  margin-bottom: 10px;
  overflow-x: auto;
}

.radar-chart {
  min-height: 274px;
  display: grid;
  place-items: center;
}

.radar-chart svg {
  width: min(100%, 300px);
  height: auto;
  overflow: visible;
}

.radar-grid-line {
  fill: none;
  stroke: rgba(38, 36, 30, 0.14);
  stroke-width: 1;
}

.radar-axis {
  stroke: rgba(38, 36, 30, 0.10);
  stroke-width: 1;
}

.radar-label {
  fill: var(--muted);
  font-size: 11px;
}

.radar-area {
  fill: rgba(13, 106, 93, 0.22);
  stroke: #0d6a5d;
  stroke-width: 2;
}

.radar-legend {
  display: grid;
  gap: 8px;
}

.radar-score {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.64);
}

.radar-score span {
  color: var(--muted);
}

.staff-performance {
  display: grid;
  gap: 8px;
}

.staff-performance-row {
  width: 100%;
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  text-align: left;
  box-shadow: none;
}

.staff-performance-row:hover,
.staff-performance-row.active {
  border-color: rgba(13, 106, 93, 0.18);
  background: rgba(228, 241, 237, 0.58);
  transform: translateY(-1px);
}

.staff-performance-row div {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.staff-performance-row strong,
.staff-performance-row span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.staff-performance-row span {
  color: var(--muted);
  font-size: 12px;
}

.staff-performance-row b {
  color: var(--accent);
  font-size: 18px;
}

.blocker-bars {
  display: grid;
  gap: 12px;
}

.blocker-bar {
  display: grid;
  grid-template-columns: minmax(90px, 1fr) auto;
  gap: 7px 12px;
  align-items: center;
}

.blocker-bar .blocker-track {
  grid-column: 1 / -1;
}

.blocker-track i {
  background: linear-gradient(90deg, #ba6a3b, #c99759);
}

.dashboard-empty {
  min-height: 120px;
  display: grid;
  place-items: center;
  color: var(--muted);
  text-align: center;
}

.muted-text {
  color: var(--muted);
  font-size: 12px;
}

.table-view {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 14px;
}

.table-filter-panel,
.customer-table-shell {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--paper);
  box-shadow: var(--shadow-soft);
  backdrop-filter: var(--blur);
}

.table-filter-panel {
  min-width: 0;
  padding: 10px 12px 12px;
}

.filter-grid {
  display: flex;
  align-items: end;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: none;
}

.filter-grid::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.filter-grid .field {
  min-width: 118px;
  margin: 0;
  gap: 4px;
}

.filter-grid .staff-field {
  min-width: 230px;
}

.filter-grid .product-id-field {
  min-width: 188px;
}

.filter-grid .field span {
  font-size: 11px;
}

.filter-choice {
  position: relative;
  z-index: 8;
}

.filter-choice.open {
  z-index: 40;
}

.filter-choice-trigger {
  width: 100%;
  min-height: 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border-radius: 8px;
  padding: 0 10px;
  background: rgba(255, 255, 255, 0.74);
}

.filter-choice-trigger i {
  font-style: normal;
  color: var(--muted);
}

.filter-choice-trigger span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.filter-choice-menu {
  position: fixed;
  min-width: 138px;
  display: none;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 252, 0.98);
  box-shadow: var(--shadow);
  z-index: 9999;
}

.filter-choice.open .filter-choice-menu,
.filter-choice-menu.open {
  display: grid;
  gap: 4px;
}

.filter-choice-menu button {
  min-height: 28px;
  justify-content: flex-start;
  border-color: transparent;
  border-radius: 7px;
  background: transparent;
  text-align: left;
  box-shadow: none;
}

.filter-choice-menu button:hover,
.filter-choice-menu button.active {
  border-color: rgba(13, 106, 93, 0.12);
  background: var(--accent-soft);
  color: var(--accent);
  transform: none;
}

.staff-tabs {
  min-height: 32px;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.62);
}

.staff-tabs button {
  min-height: 24px;
  min-width: 44px;
  padding: 0 9px;
  border-color: transparent;
  border-radius: 7px;
  background: transparent;
  box-shadow: none;
  color: var(--muted);
  white-space: nowrap;
}

.staff-tabs button:hover,
.staff-tabs button.active {
  border-color: rgba(13, 106, 93, 0.14);
  background: #161614;
  color: #fff;
  transform: none;
}

.period-field {
  min-width: 190px;
}

.period-tabs {
  min-height: 32px;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.62);
}

.period-tabs button {
  flex: 1;
  min-height: 24px;
  min-width: 0;
  padding: 0 8px;
  border-color: transparent;
  border-radius: 7px;
  background: transparent;
  box-shadow: none;
  color: var(--muted);
  white-space: nowrap;
}

.period-tabs button:hover,
.period-tabs button.active {
  border-color: rgba(13, 106, 93, 0.14);
  background: #161614;
  color: #fff;
  transform: none;
}

.wechat-quick-field {
  min-width: 78px;
}

.single-filter-button {
  width: 100%;
  min-height: 32px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.62);
  color: var(--muted);
  box-shadow: none;
}

.single-filter-button:hover,
.single-filter-button.active {
  border-color: rgba(13, 106, 93, 0.14);
  background: #161614;
  color: #fff;
  transform: none;
}

.customer-table-shell {
  min-width: 0;
  min-height: 0;
  height: calc(100vh - 304px);
  height: calc(100dvh - 304px);
  overflow: auto;
}

.app.table-mode .customer-table-shell {
  height: auto;
}

.deal-order-filter-panel {
  display: grid;
  gap: 8px;
}

/* ===== deal-order-view 覆盖 table-view 的 grid 布局，改用 flex ===== */
.table-view.deal-order-view {
  display: flex;
  flex-direction: column;
  gap: 0;
  grid-template-rows: none;
  overflow: hidden;
  height: 100%;
}
/* hidden 状态必须隐藏（不能用!important覆盖） */
.deal-order-view[hidden] { display: none !important; }
.deal-order-view > .deal-order-topbar,
.deal-order-view > .deal-order-filter-compact {
  flex-shrink: 0;
}

/* ===== 紧凑顶栏 ===== */
.deal-order-topbar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 18px 10px;
  background: #fff;
  border-bottom: 1px solid #e2e8f0;
  flex-shrink: 0;
  position: relative;
  z-index: 4;
}
.deal-order-topbar h2 { font-size: 15px; font-weight: 700; white-space: nowrap; }
.deal-order-kpi-bar {
  display: flex;
  gap: 18px;
  flex: 1;
  align-items: center;
  flex-wrap: wrap;
}
.deal-order-kpi-bar span {
  font-size: 12px;
  color: var(--text-2, #64748b);
  white-space: nowrap;
}
.deal-order-kpi-bar strong {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-1, #1a1a2e);
  margin-left: 2px;
}
.deal-order-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.deal-order-actions #dealOrderSummary { font-size: 11px; color: var(--text-3, #94a3b8); }

/* ===== 紧凑筛选栏 ===== */
.deal-order-filter-compact {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px;
  background: #fff;
  border-bottom: 1px solid #e2e8f0;
  flex-shrink: 0;
  flex-wrap: wrap;
  position: relative;
  z-index: 3;
  min-height: 38px;
}
.deal-order-search-input {
  flex: 1;
  min-width: 200px;
  padding: 5px 10px;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 6px;
  font-size: 12px;
}
.deal-order-mini-input {
  width: 120px;
  padding: 5px 8px;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 6px;
  font-size: 11px;
}
.deal-order-date {
  padding: 4px 6px;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 6px;
  font-size: 11px;
}
.deal-order-filter-compact label {
  font-size: 11px;
  color: var(--text-3, #94a3b8);
  display: flex;
  align-items: center;
  gap: 3px;
  white-space: nowrap;
}
.deal-order-date-label { white-space: nowrap; }
.date-sep { margin: 0 2px; color: var(--text-3, #94a3b8); }
.staff-tabs-compact {
  display: flex;
  gap: 4px;
}
.staff-tabs-compact button {
  padding: 3px 8px;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 5px;
  background: transparent;
  cursor: pointer;
  font-size: 11px;
  color: var(--text-2, #64748b);
}
.staff-tabs-compact button.active {
  background: var(--accent, #4361ee);
  color: #fff;
  border-color: var(--accent, #4361ee);
}
.deal-order-month-tabs {
  display: flex;
  align-items: center;
  gap: 2px;
}
.deal-order-month-tabs button {
  padding: 3px 9px;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 5px;
  background: transparent;
  cursor: pointer;
  font-size: 11px;
  color: var(--text-2, #64748b);
  white-space: nowrap;
  line-height: 1.4;
}
.deal-order-month-tabs button:hover {
  border-color: var(--accent, #4361ee);
  color: var(--accent, #4361ee);
}
.deal-order-month-tabs button.active {
  background: var(--accent, #4361ee);
  color: #fff;
  border-color: var(--accent, #4361ee);
}
.deal-order-month-tabs .month-nav-arrow {
  padding: 3px 6px;
  border: none;
  background: transparent;
  color: var(--text-2, #64748b);
  font-size: 13px;
  cursor: pointer;
}
.deal-order-month-tabs .month-nav-arrow:hover {
  color: var(--accent, #4361ee);
}
.deal-order-month-tabs .month-nav-arrow:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}
.filter-choice-compact {
  display: flex;
  gap: 4px;
}
.filter-choice-compact button {
  padding: 3px 8px;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 5px;
  background: transparent;
  cursor: pointer;
  font-size: 11px;
  color: var(--text-2, #64748b);
}
.filter-choice-compact button.active {
  background: var(--accent-bg, #eef2ff);
  color: var(--accent, #4361ee);
  border-color: var(--accent, #4361ee);
}

/* ===== 口径说明折叠（独立一行，不挤筛选栏）===== */
.deal-order-policy-collapse {
  display: block;
  padding: 0 18px;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  flex-shrink: 0;
  position: relative;
  z-index: 2;
}
.deal-order-policy-collapse > summary {
  display: block;
  cursor: pointer;
  font-size: 11px;
  color: #94a3b8;
  padding: 6px 0;
  user-select: none;
  list-style: none;
}
.deal-order-policy-collapse > summary::-webkit-details-marker { display: none; }
.deal-order-policy-collapse > summary::before { content: "▸ "; font-size: 9px; }
.deal-order-policy-collapse[open] > summary::before { content: "▾ "; }
.deal-order-policy-collapse > summary:hover { color: #64748b; }
.deal-order-policy-collapse[open] { padding-bottom: 6px; }

/* ===== 表格区域撑满 ===== */
.deal-order-view .deal-order-table-shell {
  flex: 1;
  height: auto !important;
  overflow: auto;
  padding: 0 18px;
}

/* ===== ERP风格订单表格（完全覆盖旧customer-table样式）===== */
.deal-order-table {
  width: 100% !important;
  min-width: 0 !important;
  border-collapse: collapse !important;
  border-spacing: 0 !important;
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  font-size: 12px;
  table-layout: fixed;
}
.deal-order-table thead { position: sticky; top: 0; z-index: 2; }
.deal-order-table thead th {
  background: #f8fafc;
  padding: 7px 4px;
  text-align: center;
  font-weight: 600;
  color: #64748b;
  white-space: nowrap;
  border-bottom: 1px solid #e2e8f0;
  font-size: 11px;
}
.deal-order-table tbody td {
  padding: 4px 4px !important;
  border-bottom: 1px solid #f1f5f9 !important;
  vertical-align: middle;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 12px;
  line-height: 1.5;
  text-align: center;
}
.deal-order-table tbody tr {
  background: transparent !important;
  border: none !important;
}
.deal-order-table tbody tr:hover { background: #f8fafc !important; }
.deal-order-table .number-cell { font-weight: 600; text-align: center; white-space: nowrap; }
.deal-order-table .refund-amount-cell { color: #ef4444; white-space: nowrap; text-align: center; }
.deal-order-table .refund-no-cell { font-family: "Consolas", monospace; font-size: 11px; color: #64748b; white-space: nowrap; text-align: center; cursor: help; }
.deal-order-table .order-no-cell { font-family: "Consolas", monospace; font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: center; }
.deal-order-table .status-cell { white-space: nowrap; text-align: center; }
.deal-order-table .deal-product-cell { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: center; }
.deal-order-table .customer-name-cell { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: center; }
.deal-order-table .muted-order-cell { color: #94a3b8; }
.deal-order-table .date-cell { font-size: 11px; color: #64748b; white-space: nowrap; text-align: center; }
.deal-order-table .staff-cell { font-size: 11px; white-space: nowrap; text-align: center; }
/* 紧凑状态标签（覆盖全局status-pill的大圆角样式） */
.deal-order-table .status-pill {
  display: inline-block !important;
  min-width: 0 !important;
  max-width: none !important;
  min-height: 0 !important;
  padding: 1px 6px !important;
  border-radius: 4px !important;
  font-size: 10px !important;
  font-weight: 600 !important;
  line-height: 1.4 !important;
}
/* 关联行展开（覆盖customer-card样式） */
.deal-order-row {
  background: transparent !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  padding: 0 !important;
}
/* 表格容器 */
.deal-order-view .deal-order-table-shell {
  flex: 1;
  height: auto !important;
  min-height: 0;
  overflow: auto;
  padding: 0 18px 20px;
  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
}

.deal-order-summary-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(160px, 1fr));
  gap: 10px;
}

.deal-order-kpi {
  min-height: 82px;
  display: grid;
  align-content: center;
  gap: 5px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 252, 0.86);
}

.deal-order-kpi-primary {
  background: linear-gradient(135deg, #0d6a5d, #145760);
  color: #fff;
}

.deal-order-kpi span,
.deal-order-kpi small {
  color: inherit;
  opacity: 0.72;
}

.deal-order-kpi strong {
  font-size: 24px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.deal-order-policy {
  display: grid;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid rgba(13, 106, 93, 0.18);
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(238, 248, 245, 0.88), rgba(255, 255, 252, 0.72));
}

.deal-order-policy-head {
  display: grid;
  grid-template-columns: minmax(120px, auto) minmax(0, 1fr);
  align-items: start;
  gap: 8px 12px;
}

.deal-order-policy-head strong {
  color: #0d6a5d;
  font-size: 13px;
  line-height: 1.35;
}

.deal-order-policy-head p,
.deal-order-policy-legend {
  margin: 0;
  color: #46423b;
  font-size: 12px;
  line-height: 1.55;
}

.deal-order-policy-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
}

.deal-order-policy-grid article {
  min-width: 0;
  display: grid;
  gap: 3px;
  padding: 7px 8px;
  border: 1px solid rgba(31, 33, 30, 0.08);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.66);
}

.deal-order-policy-grid span {
  color: #1f1d19;
  font-size: 12px;
  font-weight: 800;
}

.deal-order-policy-grid p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.deal-order-filter-grid .deal-search-field {
  min-width: 238px;
}

.deal-order-table-shell {
  height: calc(100vh - 314px);
  height: calc(100dvh - 314px);
}

.app.table-mode .deal-order-table-shell {
  height: auto;
}

.customer-table {
  width: 100%;
  min-width: 1880px;
  table-layout: fixed;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 12px;
}

.customer-table th:nth-child(1),
.customer-table td:nth-child(1) {
  width: 112px;
}

.customer-table th:nth-child(2),
.customer-table td:nth-child(2) {
  width: 112px;
}

.customer-table th:nth-child(3),
.customer-table td:nth-child(3) {
  width: 136px;
}

.customer-table th:nth-child(4),
.customer-table td:nth-child(4) {
  width: 120px;
}

.customer-table th:nth-child(5),
.customer-table td:nth-child(5) {
  width: 112px;
}

.customer-table th:nth-child(6),
.customer-table td:nth-child(6) {
  width: 104px;
}

.customer-table th:nth-child(7),
.customer-table td:nth-child(7) {
  width: 78px;
}

.customer-table th:nth-child(8),
.customer-table td:nth-child(8) {
  width: 124px;
}

.customer-table th:nth-child(9),
.customer-table td:nth-child(9) {
  width: 112px;
}

.customer-table th:nth-child(10),
.customer-table td:nth-child(10) {
  width: 114px;
}

.customer-table th:nth-child(11),
.customer-table td:nth-child(11) {
  width: 220px;
}

.customer-table th:nth-child(12),
.customer-table td:nth-child(12) {
  width: 88px;
}

.customer-table th:nth-child(13),
.customer-table td:nth-child(13) {
  width: 82px;
}

.customer-table th:nth-child(14),
.customer-table td:nth-child(14) {
  width: 110px;
}

.customer-table th:nth-child(15),
.customer-table td:nth-child(15) {
  width: 112px;
}

.customer-table th:nth-child(16),
.customer-table td:nth-child(16) {
  width: 118px;
}

.deal-order-table {
  min-width: 1820px;
}

.deal-order-table th:nth-child(1),
.deal-order-table td:nth-child(1) {
  width: 138px;
}

.deal-order-table th:nth-child(2),
.deal-order-table td:nth-child(2) {
  width: 124px;
}

.deal-order-table th:nth-child(3),
.deal-order-table td:nth-child(3) {
  width: 150px;
}

.deal-order-table th:nth-child(4),
.deal-order-table td:nth-child(4),
.deal-order-table th:nth-child(7),
.deal-order-table td:nth-child(7),
.deal-order-table th:nth-child(8),
.deal-order-table td:nth-child(8) {
  width: 120px;
}

.deal-order-table th:nth-child(5),
.deal-order-table td:nth-child(5) {
  width: 174px;
}

.deal-order-table th:nth-child(6),
.deal-order-table td:nth-child(6) {
  width: 150px;
}

.deal-order-table th:nth-child(9),
.deal-order-table td:nth-child(9),
.deal-order-table th:nth-child(10),
.deal-order-table td:nth-child(10),
.deal-order-table th:nth-child(13),
.deal-order-table td:nth-child(13) {
  width: 112px;
}

.deal-order-table th:nth-child(11),
.deal-order-table td:nth-child(11) {
  width: 252px;
}

.deal-order-table th:nth-child(12),
.deal-order-table td:nth-child(12) {
  width: 220px;
}

.order-risk-cell {
  white-space: normal !important;
  text-align: left !important;
}

.order-risk-remark {
  display: block;
  margin-bottom: 4px;
  color: #4b463d;
  line-height: 1.35;
}

.order-risk-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
}

.order-risk-badge {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  padding: 1px 6px;
  border: 1px solid rgba(31, 33, 30, 0.1);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  color: #2f2d28;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.2;
  white-space: nowrap;
}

.order-risk-ok {
  border-color: rgba(23, 140, 76, 0.24);
  background: rgba(231, 248, 236, 0.86);
  color: #13703d;
}

.order-risk-warn {
  border-color: rgba(169, 108, 24, 0.25);
  background: rgba(255, 247, 220, 0.9);
  color: #875719;
}

.order-risk-info {
  border-color: rgba(52, 103, 161, 0.24);
  background: rgba(232, 241, 252, 0.88);
  color: #2f5f98;
}

.order-risk-danger {
  border-color: rgba(184, 62, 45, 0.26);
  background: rgba(255, 235, 231, 0.86);
  color: #a33a2b;
}

.order-risk-advice {
  display: block;
  margin-top: 4px;
  color: #6b6459;
  font-size: 11px;
  line-height: 1.38;
}

.order-match-cell {
  overflow: visible !important;
}

.order-link-button {
  min-height: 26px;
  padding: 0 10px;
  border: 1px solid rgba(13, 106, 93, 0.2);
  border-radius: 999px;
  background: rgba(224, 246, 241, 0.72);
  color: #0d6a5d;
  box-shadow: none;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  transform: none;
}

.order-link-button:hover {
  border-color: #101010;
  background: #101010;
  color: #fff;
  transform: none;
}

.deal-order-link-row td {
  max-width: none;
  padding: 0 12px 12px;
  border: 1px solid rgba(13, 106, 93, 0.14);
  border-top: 0;
  border-radius: 0 0 10px 10px;
  background: #fff9df;
  overflow: visible;
  text-align: left;
  white-space: normal;
}

.outreach-view {
  display: grid;
  grid-template-rows: repeat(5, auto);
  align-content: start;
  gap: 14px;
  height: auto !important;
  min-height: 100%;
  overflow: visible;
}

.outreach-disclosure {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 252, 0.82);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}

.outreach-disclosure-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 52px;
  padding: 12px 14px;
  color: var(--ink);
  cursor: pointer;
  list-style: none;
}

.outreach-disclosure-summary::-webkit-details-marker {
  display: none;
}

.outreach-disclosure-summary::before {
  content: "+";
  flex: 0 0 24px;
  order: 2;
  color: var(--accent);
  font-size: 20px;
  font-weight: 800;
  text-align: center;
}

.outreach-disclosure[open] .outreach-disclosure-summary::before {
  content: "−";
}

.outreach-disclosure-summary > span:first-child {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.outreach-disclosure-summary strong,
.outreach-disclosure-summary small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.outreach-disclosure-summary strong {
  font-size: 14px;
}

.outreach-disclosure-summary small,
.outreach-disclosure-hint {
  color: var(--muted);
  font-size: 12px;
}

.outreach-disclosure > .outreach-composer,
.outreach-disclosure > .outreach-side,
.outreach-disclosure > .outreach-tasks-shell {
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0;
  box-shadow: none;
  padding: 14px;
}

.outreach-disclosure > .outreach-composer {
  position: static;
}

.outreach-head,
.outreach-composer,
.outreach-side,
.outreach-preview-shell,
.outreach-tasks-shell {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 252, 0.82);
  box-shadow: var(--shadow-soft);
}

.outreach-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 20px;
}

.outreach-head h1 {
  margin: 4px 0 6px;
  font-size: 24px;
  letter-spacing: 0;
}

.outreach-head p {
  margin: 0;
  color: var(--muted);
}

.outreach-layout {
  display: grid;
  grid-template-columns: minmax(720px, 1fr) 300px;
  align-items: start;
  gap: 14px;
}

.outreach-composer,
.outreach-side,
.outreach-preview-shell,
.outreach-tasks-shell {
  position: relative;
  z-index: 0;
  padding: 14px;
}

.outreach-filter-grid {
  display: grid;
  grid-template-columns:
    minmax(170px, 1.2fr)
    minmax(104px, 0.72fr)
    minmax(112px, 0.78fr)
    minmax(112px, 0.78fr)
    minmax(112px, 0.78fr)
    minmax(218px, 1.38fr)
    minmax(180px, 1.25fr)
    minmax(116px, 0.76fr)
    minmax(116px, 0.76fr)
    minmax(86px, 0.55fr)
    minmax(86px, 0.55fr);
  gap: 6px;
  align-items: end;
}

.outreach-filter-grid .field {
  min-height: 50px;
}

.outreach-filter-grid .field span {
  margin-bottom: 4px;
  font-size: 11px;
}

.outreach-filter-grid input,
.outreach-filter-grid .filter-choice-trigger,
.outreach-filter-grid .staff-tabs {
  min-height: 30px;
  height: 30px;
  border-radius: 7px;
}

.outreach-filter-grid input {
  padding: 6px 9px;
}

.outreach-filter-grid .product-id-field {
  grid-column: auto;
}

.outreach-template-box {
  display: grid;
  gap: 8px;
  margin-top: 8px;
  padding: 10px;
  border: 1px solid rgba(13, 106, 93, 0.12);
  border-radius: 8px;
  background: rgba(235, 244, 239, 0.54);
}

.compact-template-box {
  grid-template-columns: minmax(180px, 0.7fr) minmax(360px, 1.8fr);
  align-items: center;
  padding: 9px 10px;
}

.outreach-template-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  grid-column: 1 / -1;
}

.outreach-template-head span {
  display: block;
  margin-bottom: 2px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
}

.outreach-template-head p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.outreach-new-template-btn {
  min-height: 34px;
  padding: 0 12px;
}

.outreach-template-choice-row {
  display: grid;
  grid-template-columns: 118px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.template-picker-trigger {
  min-height: 36px;
  border-radius: 8px;
  white-space: nowrap;
}

.outreach-template-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 8px;
  grid-column: 1 / -1;
}

.outreach-template-card,
.outreach-template-empty,
.outreach-template-preview {
  border: 1px solid rgba(47, 55, 46, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
}

.outreach-template-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 9px 10px;
  cursor: pointer;
  transition: transform 140ms ease, border-color 140ms ease, background 140ms ease;
}

.outreach-template-card:hover,
.outreach-template-card:focus-visible {
  border-color: rgba(13, 106, 93, 0.28);
  background: rgba(255, 255, 255, 0.94);
  transform: translateY(-1px);
  outline: none;
}

.outreach-template-card.active {
  border-color: rgba(13, 106, 93, 0.42);
  background: #eef8f4;
  box-shadow: inset 3px 0 0 var(--accent);
}

.outreach-template-card-main {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.outreach-template-card-main strong,
.outreach-template-card-main span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.outreach-template-card-main strong {
  color: var(--ink);
  font-size: 13px;
}

.outreach-template-card-main span,
.outreach-template-empty,
.outreach-template-preview {
  color: var(--muted);
  font-size: 12px;
}

.outreach-template-card-actions,
.outreach-template-modal-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.outreach-template-modal-actions {
  justify-content: flex-end;
  padding: 14px 18px 18px;
  border-top: 1px solid rgba(47, 55, 46, 0.1);
}

.outreach-template-modal-actions span {
  flex: 1;
}

.outreach-template-card-actions button {
  min-height: 26px;
  padding: 0 7px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  cursor: pointer;
}

.outreach-template-card-actions button:hover {
  color: var(--ink);
}

.outreach-template-empty,
.outreach-template-preview {
  padding: 8px 10px;
  grid-column: 1 / -1;
}

.compact-template-box .outreach-template-preview {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  grid-column: auto;
}

.outreach-template-preview.active {
  color: var(--accent);
  background: rgba(255, 255, 255, 0.9);
}

.danger-subtle {
  color: var(--danger);
}

.outreach-template-picker-modal {
  width: min(880px, calc(100vw - 36px));
  max-height: calc(100dvh - 44px);
  overflow: hidden;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  border-radius: 12px;
  background: #fffefa;
  box-shadow: var(--shadow-strong);
}

.outreach-template-picker-body {
  display: grid;
  gap: 12px;
  min-height: 0;
  padding: 0 18px 16px;
}

.outreach-template-picker-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 0 2px;
}

.outreach-template-picker-top div {
  display: grid;
  gap: 3px;
}

.outreach-template-picker-top strong {
  font-size: 14px;
}

.outreach-template-picker-top span {
  color: var(--muted);
  font-size: 12px;
}

.picker-template-list {
  max-height: min(58vh, 520px);
  overflow: auto;
  padding: 2px 2px 8px;
}

.outreach-template-modal {
  width: min(760px, calc(100vw - 36px));
  max-height: calc(100dvh - 44px);
  overflow: auto;
  border-radius: 12px;
  background: #fffefa;
  box-shadow: var(--shadow-strong);
}

.outreach-template-form {
  display: grid;
  gap: 12px;
  padding: 0 18px 16px;
}

.outreach-message-field textarea {
  width: 100%;
  min-height: 168px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--ink);
  padding: 12px;
  line-height: 1.7;
  white-space: pre-wrap;
  outline: none;
}

.outreach-message-field textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(13, 106, 93, 0.12);
}

.outreach-media-box,
.outreach-template-media {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.58);
  padding: 10px;
}

.outreach-template-media {
  grid-column: 1 / -1;
  padding: 8px;
}

.outreach-media-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--ink);
  font-size: 13px;
}

.outreach-media-top > div {
  display: grid;
  gap: 2px;
}

.outreach-media-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.outreach-media-top small,
.outreach-image-empty,
.outreach-task-media {
  color: var(--muted);
  font-size: 12px;
}

.outreach-image-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
  min-height: 30px;
}

.outreach-image-card {
  display: grid;
  grid-template-columns: 44px minmax(80px, 1fr) auto;
  align-items: center;
  gap: 8px;
  max-width: 260px;
  padding: 6px;
  border: 1px solid rgba(47, 55, 46, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
}

.outreach-image-card img {
  width: 44px;
  height: 44px;
  object-fit: cover;
  border-radius: 6px;
  background: #f4f1eb;
}

.outreach-image-card span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--ink);
  font-size: 12px;
}

.outreach-image-card button {
  border: 0;
  background: transparent;
  color: var(--danger);
  font-size: 12px;
  cursor: pointer;
}

.outreach-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 10px;
}

.outreach-preview-tools {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.outreach-batch-list {
  display: grid;
  gap: 8px;
  max-height: 286px;
  overflow: auto;
}

.outreach-batch-card {
  display: grid;
  gap: 6px;
  width: 100%;
  min-height: 0;
  padding: 12px;
  text-align: left;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.7);
  cursor: pointer;
}

.outreach-batch-card.active {
  border-color: rgba(13, 106, 93, 0.32);
  background: rgba(228, 241, 237, 0.82);
}

.outreach-batch-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.outreach-batch-top strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.outreach-batch-progress,
.outreach-batch-card small,
.outreach-task-main span,
.outreach-task-error {
  color: var(--muted);
  font-size: 12px;
}

.outreach-batch-cancel {
  justify-self: start;
  min-height: 28px;
  border: 1px solid rgba(198, 54, 35, 0.22);
  border-radius: 8px;
  background: rgba(255, 251, 247, 0.9);
  color: var(--danger);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.outreach-batch-cancel:hover {
  background: rgba(198, 54, 35, 0.08);
}

.outreach-preview-shell {
  clear: both;
  overflow: visible;
}

.outreach-preview-shell .section-title {
  position: relative;
  z-index: 2;
}

.outreach-table-wrap {
  height: clamp(420px, 52vh, 650px);
  min-height: 420px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.55);
}

.outreach-table {
  min-width: 980px;
}

.outreach-table th:nth-child(1),
.outreach-table td:nth-child(1) {
  width: 70px;
  text-align: center;
}

.outreach-table th:nth-child(2),
.outreach-table td:nth-child(2) {
  width: 180px;
}

.outreach-table th:nth-child(7),
.outreach-table td:nth-child(7) {
  width: 360px;
}

.outreach-candidate-row:hover td {
  background: rgba(251, 239, 183, 0.48);
}

.outreach-reason-cell {
  color: #4b473f;
}

.outreach-task-list {
  display: grid;
  gap: 8px;
  max-height: 300px;
  overflow: auto;
}

.outreach-task-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px 12px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.62);
}

.outreach-task-main {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.outreach-task-main strong,
.outreach-task-main span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.outreach-task-error {
  grid-column: 1 / -1;
  color: var(--danger);
}

.empty-mini {
  padding: 16px;
  color: var(--muted);
  text-align: center;
  border: 1px dashed var(--line);
  border-radius: 8px;
}

.staff-diagnosis-view {
  min-height: calc(100vh - 94px);
  display: grid;
  gap: 12px;
  background:
    linear-gradient(180deg, rgba(13, 106, 93, 0.035), rgba(186, 106, 59, 0.04) 38%, transparent 70%);
}

.diagnosis-hero,
.diagnosis-filter-strip,
.diagnosis-panel,
.diagnosis-metric,
.diagnosis-priority-card,
.diagnosis-advisor-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 252, 0.86);
  box-shadow: var(--shadow-soft);
}

.diagnosis-hero {
  min-height: 150px;
  display: grid;
  grid-template-columns: minmax(320px, 0.72fr) minmax(620px, 1.28fr);
  gap: 16px;
  align-items: stretch;
  padding: 18px 20px;
  overflow: hidden;
  background:
    linear-gradient(110deg, rgba(255, 255, 252, 0.96) 0%, rgba(255, 255, 252, 0.90) 52%, rgba(228, 241, 237, 0.78) 100%);
}

.diagnosis-hero h1 {
  max-width: 720px;
  margin: 5px 0 8px;
  font-size: 34px;
  line-height: 1.08;
  letter-spacing: 0;
}

.diagnosis-hero p {
  max-width: 760px;
  margin: 0;
  color: var(--muted);
  line-height: 1.8;
}

.diagnosis-focus-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  min-width: 0;
}

.diagnosis-focus-card {
  position: relative;
  min-width: 0;
  display: grid;
  align-content: space-between;
  gap: 10px;
  padding: 14px 15px;
  border: 1px solid rgba(38, 36, 30, 0.10);
  border-radius: 8px;
  background: rgba(246, 244, 239, 0.78);
}

.diagnosis-focus-card.primary {
  color: #fffefa;
  border-color: rgba(13, 106, 93, 0.38);
  background: linear-gradient(135deg, #0d6a5d 0%, #174d46 100%);
}

.diagnosis-focus-card span {
  color: var(--muted);
  font-size: 12px;
}

.diagnosis-focus-card.primary span,
.diagnosis-focus-card.primary p {
  color: rgba(255, 255, 255, 0.78);
}

.diagnosis-focus-card strong {
  font-size: 17px;
  line-height: 1.3;
}

.diagnosis-focus-card p {
  margin: 0;
  color: #5f5c54;
  line-height: 1.6;
}

.diagnosis-filter-strip {
  min-height: 50px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  position: sticky;
  top: 0;
  z-index: 35;
  padding: 10px 12px;
  backdrop-filter: blur(18px);
  background: rgba(255, 255, 252, 0.92);
}

.diagnosis-filter-strip span {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.6);
  color: #4d4941;
}

.diagnosis-filter-strip > button:first-of-type {
  margin-left: auto;
}

.diagnosis-global-range {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 3px;
  border: 1px solid rgba(38, 36, 30, 0.10);
  border-radius: 999px;
  background: rgba(246, 244, 239, 0.72);
}

.diagnosis-global-range + span {
  margin-left: 2px;
}

.diagnosis-section-title {
  min-height: 54px;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  padding: 2px 2px 0;
}

.diagnosis-section-title.compact {
  margin-top: 2px;
}

.diagnosis-section-title div {
  display: grid;
  gap: 3px;
}

.diagnosis-section-title span {
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.diagnosis-section-title h2 {
  margin: 0;
  font-size: 18px;
  letter-spacing: 0;
}

.diagnosis-section-title p {
  max-width: 640px;
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
  text-align: right;
}

.diagnosis-metric-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(168px, 1fr));
  gap: 12px;
}

.diagnosis-metric {
  position: relative;
  min-width: 0;
  display: grid;
  grid-template-rows: auto auto auto 1fr;
  gap: 7px;
  min-height: 118px;
  padding: 15px 16px 14px;
  overflow: hidden;
  border-top: 4px solid rgba(13, 106, 93, 0.32);
  background:
    linear-gradient(180deg, rgba(255, 255, 252, 0.96), rgba(250, 248, 241, 0.84));
}

.diagnosis-metric::after {
  content: "";
  position: absolute;
  top: 14px;
  right: 14px;
  width: 9px;
  height: 32px;
  border-radius: 999px;
  background: rgba(13, 106, 93, 0.18);
}

.diagnosis-metric.warn::after,
.diagnosis-metric.warm::after {
  background: rgba(186, 106, 59, 0.28);
}

.diagnosis-metric.green::after {
  background: rgba(13, 106, 93, 0.28);
}

.diagnosis-metric.blue::after {
  background: rgba(47, 95, 143, 0.28);
}

.diagnosis-metric.purple::after {
  background: rgba(141, 90, 158, 0.28);
}

.diagnosis-metric.red::after {
  background: rgba(168, 71, 71, 0.28);
}

.diagnosis-metric.warn,
.diagnosis-metric.warm {
  border-top-color: rgba(186, 106, 59, 0.48);
}

.diagnosis-metric.green {
  border-top-color: rgba(13, 106, 93, 0.48);
}

.diagnosis-metric.blue {
  border-top-color: rgba(47, 95, 143, 0.48);
}

.diagnosis-metric.purple {
  border-top-color: rgba(141, 90, 158, 0.48);
}

.diagnosis-metric.red {
  border-top-color: rgba(168, 71, 71, 0.48);
}

.diagnosis-metric span {
  color: var(--muted);
}

.diagnosis-metric strong {
  font-size: 30px;
  line-height: 1.05;
}

.diagnosis-metric strong::after {
  content: "分";
  margin-left: 2px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.diagnosis-metric small {
  color: #6a675f;
  line-height: 1.45;
}

.diagnosis-metric em {
  align-self: end;
  width: fit-content;
  max-width: 100%;
  padding: 3px 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(22, 22, 20, 0.06);
  color: #4e4a42;
  font-size: 11px;
  font-style: normal;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.diagnosis-priority-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.diagnosis-priority-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 5px 13px;
  align-items: center;
  min-width: 0;
  min-height: 92px;
  padding: 14px 15px;
  border-left: 4px solid var(--accent);
  text-align: left;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.diagnosis-priority-card:hover,
.diagnosis-priority-card.active {
  background: rgba(255, 255, 255, 0.92);
  box-shadow: inset 0 0 0 1px rgba(13, 106, 93, 0.2), 0 14px 28px rgba(36, 33, 26, 0.08);
  transform: translateY(-1px);
}

.diagnosis-priority-card.warn {
  border-left-color: var(--accent-2);
}

.diagnosis-priority-card.blue {
  border-left-color: var(--accent-3);
}

.diagnosis-priority-card.red {
  border-left-color: var(--danger);
}

.diagnosis-priority-card span {
  grid-row: span 3;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 48px;
  min-height: 48px;
  border-radius: 8px;
  color: #fff;
  background: var(--accent);
  font-weight: 700;
}

.diagnosis-priority-card.warn span {
  background: var(--accent-2);
}

.diagnosis-priority-card.blue span {
  background: var(--accent-3);
}

.diagnosis-priority-card.red span {
  background: var(--danger);
}

.diagnosis-priority-card strong {
  font-size: 17px;
}

.diagnosis-priority-card small,
.diagnosis-priority-card p {
  color: var(--muted);
}

.diagnosis-priority-card p {
  margin: 0;
  line-height: 1.55;
}

.diagnosis-priority-detail {
  display: grid;
  gap: 10px;
  padding: 16px;
  border: 1px solid rgba(13, 106, 93, 0.16);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(228, 241, 237, 0.72), rgba(252, 250, 244, 0.86));
}

.diagnosis-detail-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
}

.diagnosis-detail-head strong {
  font-size: 16px;
}

.diagnosis-detail-head span {
  color: var(--muted);
}

.diagnosis-detail-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.diagnosis-detail-block {
  display: grid;
  gap: 8px;
  min-width: 0;
  padding: 12px;
  border: 1px solid rgba(102, 102, 102, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.66);
}

.diagnosis-detail-block > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.diagnosis-detail-block strong {
  min-width: 0;
}

.diagnosis-detail-block span {
  flex: 0 0 auto;
  color: var(--accent);
  font-weight: 700;
}

.diagnosis-detail-block p {
  margin: 0;
  color: #4e4a42;
  line-height: 1.65;
}

.diagnosis-main-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.62fr) minmax(330px, 0.38fr);
  gap: 14px;
}

.diagnosis-full-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
  min-width: 0;
}

.diagnosis-panel {
  min-width: 0;
  padding: 16px;
}

.diagnosis-panel .panel-head {
  margin-bottom: 12px;
}

.diagnosis-compare-table {
  display: grid;
  gap: 12px;
  min-width: 0;
  overflow-x: auto;
  padding-bottom: 2px;
}

.diagnosis-ability-board {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.diagnosis-ability-section {
  --ability-accent: var(--accent);
  min-width: 1180px;
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(102, 102, 102, 0.14);
  border-left: 4px solid var(--ability-accent);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 252, 0.96), rgba(251, 248, 238, 0.86));
  box-shadow: 0 10px 28px rgba(30, 24, 16, 0.04);
}

.diagnosis-ability-section.warm {
  --ability-accent: var(--accent-2);
}

.diagnosis-ability-section.blue {
  --ability-accent: var(--accent-3);
}

.diagnosis-ability-section.purple {
  --ability-accent: #8d5a9e;
}

.diagnosis-ability-section.red {
  --ability-accent: var(--danger);
}

.diagnosis-ability-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
}

.diagnosis-ability-head h3 {
  margin: 0;
  font-size: 18px;
  letter-spacing: 0;
}

.diagnosis-ability-head p {
  margin: 4px 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.diagnosis-ability-head > span {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--ability-accent) 12%, #fff 88%);
  color: var(--ability-accent);
  font-weight: 800;
}

.diagnosis-ability-grid {
  display: grid;
  gap: 8px;
}

.diagnosis-ability-grid-row {
  display: grid;
  grid-template-columns: minmax(170px, 0.95fr) repeat(var(--metric-count), minmax(132px, 1fr)) minmax(110px, 0.62fr);
  gap: 8px;
  align-items: stretch;
}

.diagnosis-ability-grid-row.head {
  min-height: 32px;
  padding: 0 10px;
  align-items: center;
  border-bottom: 1px solid rgba(102, 102, 102, 0.17);
  color: var(--muted);
  font-size: 12px;
}

.diagnosis-ability-grid-row:not(.head) {
  min-height: 74px;
  padding: 9px 10px;
  border: 1px solid rgba(102, 102, 102, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.64);
}

.diagnosis-ability-grid-row.leader {
  border-color: color-mix(in srgb, var(--ability-accent) 24%, #fff 76%);
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--ability-accent) 10%, #fff 90%), rgba(255, 255, 255, 0.70));
}

.diagnosis-ability-staff {
  min-width: 0;
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}

.diagnosis-ability-staff i {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--staff-color, #161614);
  color: #fff;
  font-style: normal;
  font-weight: 900;
}

.diagnosis-ability-staff div {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.diagnosis-ability-staff em {
  width: fit-content;
  padding: 1px 7px;
  border-radius: 999px;
  color: var(--ability-accent);
  background: color-mix(in srgb, var(--ability-accent) 12%, #fff 88%);
  font-size: 11px;
  font-style: normal;
  font-weight: 900;
}

.diagnosis-ability-staff strong,
.diagnosis-ability-staff span,
.diagnosis-ability-cell strong,
.diagnosis-ability-score strong,
.diagnosis-ability-score span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.diagnosis-ability-staff span {
  color: var(--muted);
  font-size: 11px;
}

.diagnosis-ability-cell,
.diagnosis-ability-score {
  min-width: 0;
  display: grid;
  align-content: center;
  gap: 7px;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(246, 244, 239, 0.72);
}

.diagnosis-ability-cell.best {
  background: color-mix(in srgb, var(--ability-accent) 12%, #fff 88%);
}

.diagnosis-ability-cell strong {
  color: #171612;
  font-size: 15px;
}

.diagnosis-ability-cell.best strong {
  color: var(--ability-accent);
}

.diagnosis-ability-cell i {
  position: relative;
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(102, 102, 102, 0.13);
}

.diagnosis-ability-cell i::after {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--bar, 0%);
  border-radius: inherit;
  background: var(--ability-accent);
}

.diagnosis-ability-score {
  justify-items: end;
  text-align: right;
  background: transparent;
}

.diagnosis-ability-score strong {
  color: var(--ability-accent);
  font-size: 20px;
}

.diagnosis-ability-score span {
  color: var(--muted);
  font-size: 11px;
}

.diagnosis-matrix {
  min-width: 1240px;
  display: grid;
  gap: 9px;
}

.diagnosis-matrix-row {
  display: grid;
  grid-template-columns: minmax(156px, 0.9fr) repeat(6, minmax(144px, 1fr)) minmax(106px, 0.62fr);
  gap: 8px;
  align-items: stretch;
}

.diagnosis-matrix-head {
  min-height: 32px;
  padding: 0 10px;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
  font-size: 12px;
}

.diagnosis-matrix-head span {
  display: flex;
  align-items: center;
  min-width: 0;
  white-space: nowrap;
}

.diagnosis-matrix-data-row {
  width: 100%;
  min-height: 96px;
  padding: 10px;
  text-align: left;
  border: 1px solid rgba(102, 102, 102, 0.13);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.64);
  box-shadow: 0 8px 20px rgba(30, 24, 16, 0.035);
}

.diagnosis-matrix-data-row:hover,
.diagnosis-matrix-data-row.spotlight {
  border-color: rgba(13, 106, 93, 0.22);
  background: rgba(228, 241, 237, 0.78);
}

.diagnosis-matrix-staff {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 9px;
  align-items: center;
  min-width: 0;
}

.diagnosis-matrix-staff i {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--staff-color, #161614);
  color: #fff;
  font-style: normal;
  font-weight: 800;
}

.diagnosis-matrix-staff div,
.diagnosis-matrix-cell,
.diagnosis-matrix-score {
  min-width: 0;
  display: grid;
  align-content: center;
  gap: 5px;
}

.diagnosis-matrix-staff em {
  width: fit-content;
  padding: 1px 7px;
  border-radius: 999px;
  color: var(--accent);
  background: rgba(13, 106, 93, 0.1);
  font-size: 11px;
  font-style: normal;
  font-weight: 800;
}

.diagnosis-matrix-staff strong,
.diagnosis-matrix-cell strong,
.diagnosis-matrix-score strong {
  overflow: hidden;
  color: #161614;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.diagnosis-matrix-staff span,
.diagnosis-matrix-cell span,
.diagnosis-matrix-score span {
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  font-size: 11px;
}

.diagnosis-matrix-cell span {
  display: -webkit-box;
  white-space: normal;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  line-height: 1.35;
}

.diagnosis-matrix-cell {
  position: relative;
  padding: 9px 10px;
  border-radius: 8px;
  background: rgba(246, 244, 239, 0.68);
}

.diagnosis-matrix-cell em {
  width: fit-content;
  padding: 1px 7px;
  border-radius: 999px;
  background: rgba(22, 22, 20, 0.08);
  color: #4f4a40;
  font-size: 11px;
  font-style: normal;
  font-weight: 800;
}

.diagnosis-matrix-cell.best {
  background: rgba(13, 106, 93, 0.1);
}

.diagnosis-matrix-cell.best em {
  color: var(--accent);
  background: rgba(13, 106, 93, 0.12);
}

.diagnosis-matrix-cell.warn {
  background: rgba(168, 71, 71, 0.08);
}

.diagnosis-matrix-cell.warn em {
  color: var(--danger);
  background: rgba(168, 71, 71, 0.10);
}

.diagnosis-matrix-cell.best strong {
  color: var(--accent);
}

.diagnosis-matrix-cell.warn strong {
  color: var(--danger);
}

.diagnosis-matrix-cell i {
  position: relative;
  height: 5px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(102, 102, 102, 0.12);
}

.diagnosis-matrix-cell i::after {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--fill, 0%);
  border-radius: inherit;
  background: var(--accent);
}

.diagnosis-matrix-cell.warn i::after {
  background: var(--danger);
}

.diagnosis-matrix-score {
  justify-items: end;
  text-align: right;
}

.diagnosis-matrix-score strong {
  color: var(--accent);
  font-size: 18px;
}

.diagnosis-compare-head,
.diagnosis-compare-row {
  display: grid;
  grid-template-columns: 1.15fr repeat(7, minmax(86px, 1fr));
  gap: 8px;
  align-items: center;
}

.diagnosis-compare-head {
  min-height: 34px;
  padding: 0 10px;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
  font-size: 12px;
}

.diagnosis-compare-row {
  width: 100%;
  min-height: 62px;
  padding: 9px 10px;
  text-align: left;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.58);
}

.diagnosis-compare-row:hover,
.diagnosis-compare-row.spotlight {
  border-color: rgba(13, 106, 93, 0.22);
  background: rgba(228, 241, 237, 0.74);
}

.diagnosis-compare-row > div {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.diagnosis-compare-row strong,
.diagnosis-compare-row span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.diagnosis-compare-row span {
  color: var(--muted);
  font-size: 11px;
}

.diagnosis-compare-row .score strong {
  color: var(--accent);
  font-size: 16px;
}

.diagnosis-bar-head,
.diagnosis-bar-row {
  grid-template-columns: minmax(190px, 0.24fr) minmax(0, 1fr) minmax(86px, 0.12fr);
}

.diagnosis-bar-row {
  min-height: 106px;
  padding: 14px 16px;
  border: 1px solid rgba(102, 102, 102, 0.12);
  box-shadow: 0 10px 26px rgba(30, 24, 16, 0.045);
}

.diagnosis-bar-row .diagnosis-staff-name {
  display: grid !important;
  grid-template-columns: 36px minmax(0, 1fr);
  gap: 4px 10px;
  align-content: center;
}

.diagnosis-bar-row .diagnosis-staff-name i {
  grid-row: span 3;
}

.diagnosis-bar-row .diagnosis-staff-name span {
  grid-column: 2;
}

.diagnosis-bar-row .diagnosis-staff-name em {
  grid-column: 2;
  width: fit-content;
  padding: 2px 7px;
  border-radius: 999px;
  color: var(--accent);
  background: rgba(13, 106, 93, 0.1);
  font-size: 11px;
  font-style: normal;
  font-weight: 700;
}

.diagnosis-staff-body {
  display: grid !important;
  gap: 9px;
  min-width: 0;
}

.diagnosis-staff-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.diagnosis-staff-summary div {
  min-width: 0;
  padding: 9px 10px;
  border-radius: 8px;
  background: rgba(246, 244, 239, 0.72);
}

.diagnosis-staff-summary span,
.diagnosis-staff-summary small {
  display: block;
  color: var(--muted);
  font-size: 11px;
}

.diagnosis-staff-summary strong {
  display: block;
  margin: 3px 0 1px;
  font-size: 16px;
  color: #181816;
}

.diagnosis-bar-metrics {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 12px;
}

.diagnosis-staff-insight {
  color: #4f4a40;
  font-size: 12px;
  line-height: 1.45;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.diagnosis-bar-metric {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.diagnosis-bar-metric > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.diagnosis-bar-metric span,
.diagnosis-bar-metric small {
  color: var(--muted);
}

.diagnosis-bar-metric strong {
  font-size: 13px;
}

.diagnosis-bar-metric i {
  position: relative;
  display: block;
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(102, 102, 102, 0.12);
}

.diagnosis-bar-metric i::after {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--bar);
  border-radius: inherit;
  background: var(--accent);
}

.diagnosis-bar-metric.warm i::after {
  background: var(--accent-2);
}

.diagnosis-bar-metric.blue i::after {
  background: var(--accent-3);
}

.diagnosis-bar-metric.red i::after {
  background: var(--danger);
}

.diagnosis-bar-score {
  justify-items: end;
  text-align: right;
  align-self: center;
}

.diagnosis-bar-score strong {
  color: var(--accent);
  font-size: 20px;
}

.diagnosis-staff-name {
  display: flex !important;
  grid-template-columns: none !important;
  align-items: center;
  gap: 8px;
}

.diagnosis-staff-name i {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #161614;
  color: #fff;
  font-style: normal;
  font-weight: 700;
}

.diagnosis-radar-panel {
  display: grid;
  grid-template-rows: auto minmax(430px, auto);
}

.diagnosis-radar-wide {
  min-height: 560px;
  align-items: stretch;
  gap: 24px;
}

.diagnosis-radar-head {
  margin-bottom: 0;
  align-items: flex-start;
  gap: 18px;
}

.diagnosis-radar-controls {
  display: grid;
  gap: 10px;
  justify-items: end;
  min-width: 520px;
}

.diagnosis-radar-presets,
.diagnosis-radar-date-fields {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.diagnosis-radar-presets button,
.diagnosis-radar-date-fields button {
  height: 34px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid rgba(22, 22, 20, 0.12);
  background: rgba(255, 255, 255, 0.7);
  color: var(--muted);
  font-weight: 700;
}

.diagnosis-radar-presets button.active,
.diagnosis-radar-presets button:hover,
.diagnosis-radar-date-fields button:hover {
  border-color: #161614;
  background: #161614;
  color: #fff;
}

.diagnosis-radar-date-fields label {
  display: flex;
  align-items: center;
  gap: 7px;
  height: 34px;
  padding: 0 10px;
  border: 1px solid rgba(22, 22, 20, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--muted);
  font-size: 12px;
}

.diagnosis-radar-date-fields input {
  width: 126px;
  border: 0;
  background: transparent;
  outline: 0;
  color: var(--text);
  font: inherit;
}

.diagnosis-radar-status {
  color: var(--muted);
  font-size: 12px;
}

.diagnosis-radar-body {
  display: grid;
  grid-template-columns: minmax(420px, 0.9fr) minmax(620px, 1.25fr);
  gap: 26px;
  align-items: stretch;
}

.diagnosis-radar-left {
  display: grid;
  grid-template-rows: minmax(390px, 1fr) auto;
  gap: 12px;
  align-content: stretch;
}

.diagnosis-radar-chart {
  min-height: 390px;
  display: grid;
  place-items: center start;
}

.diagnosis-radar-chart svg {
  width: min(100%, 470px);
  height: auto;
}

.diagnosis-radar-wide .diagnosis-radar-chart svg {
  width: min(100%, 520px);
  max-height: 450px;
}

.diagnosis-radar-legend {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.diagnosis-radar-wide .diagnosis-radar-legend {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-content: center;
}

.diagnosis-radar-score {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid rgba(22, 22, 20, 0.08);
  background: rgba(246, 244, 239, 0.72);
  transition: background 0.16s ease, border-color 0.16s ease, transform 0.16s ease, opacity 0.16s ease;
}

.diagnosis-radar-score span {
  color: var(--muted);
}

.radar-area.diagnosis-radar-overlay {
  fill: var(--radar-fill);
  stroke: var(--radar-color);
  stroke-width: 2;
  cursor: pointer;
  transition: opacity 0.16s ease, stroke-width 0.16s ease, filter 0.16s ease;
}

.radar-area.diagnosis-radar-overlay.is-highlight {
  opacity: 1;
  stroke-width: 4;
  filter: drop-shadow(0 10px 16px rgba(22, 22, 20, 0.16));
}

.radar-area.diagnosis-radar-overlay.is-muted,
.diagnosis-radar-score.is-muted,
.diagnosis-radar-bar-row.is-muted {
  opacity: 0.24;
}

.diagnosis-radar-score {
  position: relative;
  align-items: center;
  text-align: left;
}

.diagnosis-radar-score::before {
  content: "";
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--staff-color, var(--accent));
}

.diagnosis-radar-score strong {
  margin-left: auto;
}

.diagnosis-radar-score.is-highlight {
  border-color: var(--staff-color, var(--accent));
  background: rgba(255, 255, 255, 0.9);
  transform: translateY(-1px);
}

.diagnosis-radar-bars {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  align-content: start;
}

.diagnosis-radar-bar-card {
  min-height: 154px;
  padding: 14px;
  border: 1px solid rgba(22, 22, 20, 0.1);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.58);
}

.diagnosis-radar-bar-card h3 {
  margin: 0 0 12px;
  color: var(--text);
  font-size: 14px;
}

.diagnosis-radar-bar-row {
  display: grid;
  gap: 5px;
  padding: 7px 0;
  transition: opacity 0.16s ease, transform 0.16s ease;
}

.diagnosis-radar-bar-row.is-highlight {
  transform: translateX(2px);
}

.diagnosis-radar-bar-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
}

.diagnosis-radar-bar-meta span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.diagnosis-radar-bar-meta span::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--staff-color, var(--accent));
}

.diagnosis-radar-bar-meta strong {
  color: var(--text);
}

.diagnosis-radar-bar-track {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(22, 22, 20, 0.08);
}

.diagnosis-radar-bar-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--staff-color, var(--accent));
}

#diagnosisAiStatus[data-mode="loading"] {
  color: #2f5f8f;
  border-color: rgba(47, 95, 143, 0.28);
  background: rgba(47, 95, 143, 0.08);
}

#diagnosisAiStatus[data-mode="success"] {
  color: var(--accent);
  border-color: rgba(13, 106, 93, 0.26);
  background: rgba(13, 106, 93, 0.08);
}

#diagnosisAiStatus[data-mode="error"] {
  color: var(--danger);
  border-color: rgba(168, 71, 71, 0.28);
  background: rgba(168, 71, 71, 0.08);
}

.diagnosis-advisor-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.diagnosis-advisor-card {
  display: grid;
  gap: 13px;
  min-width: 0;
  padding: 16px;
  border: 1px solid rgba(102, 102, 102, 0.14);
  border-top: 4px solid rgba(102, 102, 102, 0.15);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.76), rgba(255, 255, 255, 0.38)),
    var(--panel);
}

.diagnosis-advisor-card.strong {
  border-top-color: var(--accent);
}

.diagnosis-advisor-card.risk {
  border-top-color: var(--danger);
}

.diagnosis-advisor-card.ai {
  background:
    linear-gradient(135deg, rgba(13, 106, 93, 0.11), rgba(47, 95, 143, 0.045) 44%, rgba(255, 255, 255, 0) 72%),
    var(--panel);
}

.diagnosis-advisor-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(102, 102, 102, 0.12);
}

.diagnosis-advisor-head strong {
  font-size: 17px;
}

.diagnosis-advisor-head span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  color: #fff;
  background: #161614;
}

.diagnosis-advisor-mini {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.diagnosis-advisor-mini div {
  display: grid;
  gap: 2px;
  padding: 8px;
  border-radius: 8px;
  border: 1px solid rgba(102, 102, 102, 0.08);
  background: rgba(246, 244, 239, 0.76);
}

.diagnosis-advisor-mini span {
  color: var(--muted);
  font-size: 11px;
}

.diagnosis-advisor-card p {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  gap: 10px;
  margin: 0;
  color: #4c4941;
  line-height: 1.65;
}

.diagnosis-advisor-card p b {
  display: inline-flex;
  align-self: start;
  justify-content: center;
  min-width: 0;
  padding: 2px 8px;
  border-radius: 999px;
  color: var(--ink);
  background: rgba(13, 106, 93, 0.08);
}

.diagnosis-advisor-card p span {
  color: #4c4941;
}

.diagnosis-advisor-steps {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 10px;
  padding: 11px 12px;
  border: 1px solid rgba(13, 106, 93, 0.12);
  border-radius: 8px;
  background: rgba(246, 244, 239, 0.62);
  color: #4c4941;
  line-height: 1.65;
}

.diagnosis-advisor-steps b {
  color: var(--ink);
}

.diagnosis-advisor-steps ol {
  margin: 0;
  padding-left: 18px;
}

.diagnosis-evidence-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.diagnosis-sample-list {
  display: grid;
  gap: 8px;
}

.diagnosis-sample-item {
  display: grid;
  gap: 5px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.58);
}

.diagnosis-sample-item p {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

@media (max-width: 1500px) {
  .diagnosis-hero {
    grid-template-columns: 1fr;
  }

  .diagnosis-metric-grid {
    grid-template-columns: repeat(4, minmax(150px, 1fr));
  }

  .diagnosis-advisor-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .diagnosis-radar-wide {
    grid-template-columns: minmax(0, 1fr);
  }

  .diagnosis-radar-head {
    align-items: stretch;
  }

  .diagnosis-radar-controls {
    min-width: 0;
    justify-items: start;
  }

  .diagnosis-radar-presets,
  .diagnosis-radar-date-fields {
    justify-content: flex-start;
  }

  .diagnosis-radar-body {
    grid-template-columns: 1fr;
  }

  .diagnosis-radar-bars {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .diagnosis-radar-wide .diagnosis-radar-legend {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .outreach-filter-grid {
    grid-template-columns: repeat(4, minmax(118px, 1fr));
  }

  .outreach-filter-grid .product-id-field {
    grid-column: span 2;
  }
}

@media (max-width: 1280px) {
  .diagnosis-metric-grid,
  .diagnosis-priority-grid,
  .diagnosis-detail-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .diagnosis-main-grid,
  .diagnosis-full-grid,
  .diagnosis-evidence-grid {
    grid-template-columns: 1fr;
  }

  .diagnosis-radar-wide .diagnosis-radar-legend {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .diagnosis-radar-bars {
    grid-template-columns: 1fr;
  }

  .diagnosis-compare-panel {
    overflow-x: auto;
  }

  .diagnosis-compare-head,
  .diagnosis-compare-row {
    min-width: 780px;
  }

  .diagnosis-matrix {
    min-width: 1040px;
  }

  .diagnosis-bar-head,
  .diagnosis-bar-row {
    min-width: 780px;
  }

  .outreach-layout {
    grid-template-columns: 1fr;
  }

  .outreach-filter-grid {
    grid-template-columns: repeat(3, minmax(130px, 1fr));
  }

  .outreach-template-box {
    grid-template-columns: 1fr;
  }
}

.order-link-form {
  min-height: 54px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-top: 1px solid rgba(102, 102, 102, 0.2);
}

.order-link-form strong {
  flex: 0 0 auto;
  color: var(--ink);
  font-size: 13px;
}

.order-link-form input {
  width: 280px;
  height: 34px;
  border: 1px solid rgba(13, 106, 93, 0.16);
  border-radius: 9px;
  background: rgba(255, 255, 252, 0.92);
  color: var(--ink);
}

.order-link-form button {
  height: 34px;
  min-height: 34px;
  padding: 0 14px;
  border-radius: 9px;
  font-size: 12px;
  font-weight: 800;
  transform: none;
}

.customer-table th,
.customer-table td {
  padding: 8px 10px;
  text-align: center;
  vertical-align: middle;
}

.customer-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: rgba(246, 245, 242, 0.96);
  color: var(--muted);
  font-weight: 700;
  white-space: nowrap;
}

.customer-table th.filterable-th {
  padding: 0;
}

.customer-header-filter-trigger {
  width: 100%;
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: inherit;
  font: inherit;
}

.customer-header-filter-trigger:hover,
.customer-header-filter-trigger:focus-visible,
.customer-header-filter-trigger.open {
  color: var(--accent);
  transform: none;
}

.header-filter-mark {
  width: 19px;
  height: 19px;
  display: inline-grid;
  place-items: center;
  border: 1px solid rgba(13, 106, 93, 0.18);
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.76);
  color: #7b776d;
  font-size: 10px;
  font-style: normal;
  line-height: 1;
  opacity: 0.58;
}

.customer-header-filter-trigger.active .header-filter-mark {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
  opacity: 1;
}

.customer-header-filter-trigger[data-sort-direction="desc"] > span::after {
  content: " ↓";
  color: var(--accent);
}

.customer-header-filter-trigger[data-sort-direction="asc"] > span::after {
  content: " ↑";
  color: var(--accent);
}

.customer-table tbody tr.customer-card-row {
  height: 56px;
  transition: transform 0.16s ease, filter 0.16s ease;
}

.customer-table tbody tr.customer-card-row:hover {
  filter: drop-shadow(0 10px 18px rgba(42, 34, 24, 0.08));
  transform: translateY(-1px);
}

.customer-table tbody tr.customer-card-row td {
  position: relative;
  height: 56px;
  border-top: 1px solid var(--line);
  border-bottom: 8px solid transparent;
  background: rgba(255, 255, 252, 0.82);
  background-clip: padding-box;
  transition: background 0.16s ease, border-color 0.16s ease;
}

.customer-table tbody tr.customer-card-row:hover td,
.customer-table tbody tr.customer-card-row.expanded td {
  border-top-color: rgba(13, 106, 93, 0.16);
  background: #fff9df;
}

.customer-table tbody tr.customer-card-row.expanded td {
  border-bottom: 0;
  border-radius: 0;
}

.customer-table tbody tr.customer-card-row.expanded td:first-child {
  border-radius: 10px 0 0 0;
}

.customer-table tbody tr.customer-card-row.expanded td:last-child {
  border-radius: 0 10px 0 0;
}

.customer-table tbody tr.customer-card-row td:first-child {
  border-left: 1px solid var(--line);
  border-radius: 10px 0 0 10px;
}

.customer-table tbody tr.customer-card-row td:last-child {
  border-right: 1px solid var(--line);
  border-radius: 0 10px 10px 0;
}

.customer-table th:not(:last-child)::after,
.customer-table tbody tr.customer-card-row td:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 0;
  width: 1px;
  height: 33%;
  min-height: 18px;
  background: rgba(102, 102, 102, 0.46);
  transform: translateY(-50%);
  pointer-events: none;
}

.customer-table th:not(:last-child)::after {
  background: rgba(102, 102, 102, 0.34);
}

.customer-table td {
  max-width: 210px;
  line-height: 1.55;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.customer-name-cell {
  min-width: 130px;
  font-weight: 700;
  color: var(--ink);
}

.customer-name-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  min-width: 0;
}

.customer-name-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.copy-id-button {
  width: 18px;
  height: 18px;
  min-height: 18px;
  padding: 0;
  border: none;
  border-radius: 5px;
  color: rgba(31, 33, 30, 0.38);
  background: transparent;
  font-size: 12px;
  line-height: 18px;
  opacity: 0.62;
  transform: none;
  box-shadow: none;
}

.customer-card-row:hover .copy-id-button,
.copy-id-button:focus-visible {
  opacity: 1;
}

.copy-id-button:hover {
  color: var(--accent);
  background: rgba(13, 106, 93, 0.08);
  transform: none;
  box-shadow: none;
}

.review-screenshot-cell {
  cursor: default;
}

.review-screenshot-cell.dragging,
.review-screenshot-cell:focus {
  outline: 1px solid rgba(13, 106, 93, 0.34);
  outline-offset: -5px;
  background: #fff9df !important;
}

.review-screenshot-cell.uploading {
  opacity: 0.62;
}

.review-shot-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

.review-shot-empty {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 68px;
  height: 26px;
  border: 1px dashed rgba(102, 102, 102, 0.38);
  border-radius: 7px;
  color: var(--muted);
  font-size: 11px;
}

.review-shot-thumb {
  width: 44px;
  height: 30px;
  min-height: 30px;
  padding: 0;
  overflow: hidden;
  border-radius: 7px;
  border-color: rgba(13, 106, 93, 0.18);
  background: rgba(255, 255, 255, 0.78);
  box-shadow: none;
}

.review-shot-thumb:hover,
.review-shot-thumb:focus-visible {
  transform: none;
  border-color: rgba(13, 106, 93, 0.36);
}

.review-shot-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.review-shot-remove {
  width: 20px;
  height: 20px;
  min-height: 20px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  border-radius: 50%;
  border-color: rgba(38, 36, 30, 0.12);
  color: var(--muted);
  background: rgba(255, 255, 255, 0.74);
  box-shadow: none;
  font-size: 14px;
  line-height: 1;
}

.review-shot-remove:hover,
.review-shot-remove:focus-visible {
  border-color: rgba(186, 67, 50, 0.22);
  color: #a43628;
  background: #fff;
  transform: none;
  box-shadow: none;
}

.level-cell {
  min-width: 90px;
  font-weight: 700;
}

.level-chip {
  display: inline-grid;
  place-items: center;
  min-width: 78px;
  min-height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.level-chip.level-a {
  background: #dff1ec;
  color: #007664;
}

.level-chip.level-b {
  background: #f2dfcd;
  color: #9a5b25;
}

.level-chip.level-c {
  background: #dfeafa;
  color: #2f5f8f;
}

.level-chip:not(.level-a):not(.level-b):not(.level-c) {
  background: #eee9dd;
  color: #77766d;
}

.number-cell {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.wechat-cell,
.product-category-cell,
.product-id-cell,
.staff-cell {
  min-width: 112px;
}

.summary-cell {
  min-width: 300px;
  text-align: left !important;
}

.deal-cell,
.status-cell {
  min-width: 110px;
}

.deal-detail-link {
  margin-left: 6px;
  padding: 2px 6px;
  border: 1px solid rgba(16, 16, 16, 0.1);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: #0d6a5d;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.deal-detail-link:hover {
  background: #101010;
  color: #fff;
}

.detail-pulse {
  animation: detailPulse 1.2s ease;
}

@keyframes detailPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(13, 106, 93, 0.24);
  }
  100% {
    box-shadow: 0 0 0 12px rgba(13, 106, 93, 0);
  }
}

.customer-note-cell {
  min-width: 200px;
  color: #4d4b45;
}

.status-pill {
  display: inline-grid;
  place-items: center;
  min-width: 62px;
  max-width: 96px;
  min-height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}

.source-pill {
  display: inline-grid;
  place-items: center;
  min-width: 78px;
  min-height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}

.source-chat {
  background: rgba(82, 118, 154, 0.13);
  color: #315a7a;
}

.source-wangwang {
  background: rgba(186, 106, 59, 0.14);
  color: #9b552b;
}

.source-matched {
  background: rgba(13, 106, 93, 0.14);
  color: var(--accent);
}

.status-yellow {
  background: #eee4a9;
  color: #6a5b19;
}

.status-purple {
  background: #d6c0ff;
  color: #6742a8;
}

.status-red {
  background: #e95757;
  color: #fff;
}

.status-orange {
  background: #f1c28a;
  color: #7a3d12;
}

.status-cyan {
  background: #bbeae4;
  color: #0d6a5d;
}

.status-green {
  background: #5bbb65;
  color: #fff;
}

.status-blue {
  background: #4f8df7;
  color: #fff;
}

.last-message-cell {
  min-width: 220px;
  color: #4d4b45;
}

.date-cell {
  min-width: 150px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.order-no-cell {
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 11px;
  color: #4d4b45;
}

.deal-product-cell {
  text-align: left !important;
  color: #4d4b45;
}

.muted-order-cell {
  color: var(--muted);
}

.refund-amount-cell {
  color: #9b4d2f;
}

.editable-cell {
  position: relative;
  cursor: default;
}

.editable-cell:hover {
  color: var(--accent);
}

.empty-inline-value {
  color: #aaa59a;
}

.locked-cell {
  color: rgba(119, 118, 109, 0.48);
  cursor: not-allowed;
}

.locked-cell:hover {
  color: rgba(119, 118, 109, 0.48);
}

.editing-cell {
  z-index: 25;
  overflow: visible !important;
}

.table-edit-input.inline-editor {
  position: absolute;
  top: 50%;
  left: 9px;
  width: calc(100% - 18px);
  min-width: 0;
  min-height: 30px;
  border-radius: 8px;
  text-align: center;
  font-size: 12px;
  transform: translateY(-50%);
  z-index: 30;
  cursor: text;
}

.custom-dropdown-editor {
  position: absolute;
  inset: 50% 9px auto 9px;
  min-width: 0;
  transform: translateY(-50%);
  z-index: 30;
}

.custom-dropdown-current {
  min-height: 30px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(13, 106, 93, 0.22);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--accent);
  font-weight: 700;
  cursor: pointer;
}

.custom-dropdown-menu {
  position: fixed;
  min-width: 0;
  display: grid;
  gap: 4px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 252, 0.98);
  box-shadow: var(--shadow);
  z-index: 9999;
}

.floating-dropdown-menu {
  backdrop-filter: var(--blur);
}

.custom-dropdown-menu button {
  min-height: 28px;
  width: 100%;
  display: flex;
  align-items: center;
  border-color: transparent;
  border-radius: 7px;
  background: transparent;
  box-shadow: none;
  justify-content: center;
}

.custom-dropdown-menu button:hover,
.custom-dropdown-menu button.active {
  border-color: rgba(13, 106, 93, 0.12);
  background: var(--accent-soft);
  color: var(--accent);
  transform: none;
}

.customer-detail-row td {
  padding: 0;
  border: none;
  text-align: left;
  overflow: visible;
  white-space: normal;
}

.customer-card-detail {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 126px;
  grid-template-rows: auto auto;
  align-items: stretch;
  gap: 12px 14px;
  margin: -1px 0 8px;
  padding: 12px 12px 14px;
  border: 1px solid rgba(13, 106, 93, 0.16);
  border-top: 1px solid rgba(38, 36, 30, 0.10);
  border-radius: 0 0 10px 10px;
  background: #fff9df;
  box-shadow: none;
}

.expanded-insight-panel,
.expanded-order-ledger {
  border: 1px solid rgba(22, 22, 20, 0.82);
  border-radius: 9px;
  background: rgba(255, 249, 223, 0.72);
}

.expanded-insight-panel {
  display: grid;
  grid-template-rows: repeat(3, 1fr);
  grid-column: 1;
  grid-row: 2;
  min-height: 132px;
  padding: 10px 12px;
  gap: 8px;
}

.expanded-insight-item {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  align-content: start;
  align-items: start;
  gap: 4px 10px;
  min-width: 0;
}

.expanded-insight-item span,
.expanded-order-table th {
  color: #5f5b51;
  font-size: 12px;
  font-weight: 500;
}

.expanded-insight-item span {
  line-height: 1.6;
  white-space: nowrap;
}

.expanded-insight-item p {
  margin: 0;
  min-width: 0;
  color: #2f2d28;
  font-size: 12px;
  line-height: 1.6;
  white-space: normal;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.expanded-order-ledger {
  grid-column: 1;
  grid-row: 1;
  min-height: 128px;
  overflow: auto;
  padding: 8px 12px 10px;
}

.order-policy-mini {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 6px 10px;
  margin: 2px 0 8px;
  padding: 7px 8px;
  border: 1px solid rgba(13, 106, 93, 0.14);
  border-radius: 8px;
  background: rgba(238, 248, 245, 0.72);
}

.order-policy-mini strong {
  color: #0d6a5d;
  font-size: 12px;
  line-height: 1.45;
  white-space: nowrap;
}

.order-policy-mini p {
  margin: 0;
  color: #46423b;
  font-size: 12px;
  line-height: 1.45;
}

.expanded-order-table {
  width: max-content;
  min-width: 100%;
  border-collapse: collapse;
  table-layout: auto;
  font-size: 12.5px;
  color: #2f2d28;
}

.expanded-order-table th,
.expanded-order-table td {
  height: 28px;
  padding: 3px 6px;
  border: none;
  border-bottom: 1px solid rgba(22, 22, 20, 0.16);
  overflow: visible;
  text-overflow: clip;
  white-space: nowrap;
  text-align: center;
}

.expanded-order-table th {
  height: 24px;
  border-bottom-color: rgba(22, 22, 20, 0.72);
}

.expanded-order-table tbody tr:last-child td {
  border-bottom: none;
}

.expanded-order-table tbody tr.ledger-chain-row td {
  color: var(--ledger-chain-color);
  font-weight: 650;
}

.expanded-order-table tbody tr.ledger-chain-0 {
  --ledger-chain-color: #0b766c;
}

.expanded-order-table tbody tr.ledger-chain-1 {
  --ledger-chain-color: #9a5a16;
}

.expanded-order-table tbody tr.ledger-chain-2 {
  --ledger-chain-color: #3467a1;
}

.expanded-order-table tbody tr.ledger-chain-3 {
  --ledger-chain-color: #8a4c86;
}

.expanded-order-table tbody tr.ledger-chain-4 {
  --ledger-chain-color: #5e6f20;
}

.expanded-order-table tbody tr.ledger-chain-5 {
  --ledger-chain-color: #a44535;
}

.ledger-order-no,
.ledger-refund-no {
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 12px;
  min-width: 220px;
  text-align: left;
}

.ledger-refund-no {
  min-width: 172px;
}

.ledger-money {
  font-variant-numeric: tabular-nums;
}

.ledger-refund {
  color: #9b4d2f;
}

.ledger-final {
  color: #1f1d19;
  font-weight: 700;
}

.ledger-yes {
  color: #178c4c;
  font-weight: 800;
}

.ledger-no,
.ledger-zero {
  color: #d83a2d;
  font-weight: 800;
}

.ledger-staff {
  color: #4a463f;
}

.ledger-risk-cell {
  min-width: 228px;
  max-width: 280px;
  text-align: left !important;
  white-space: normal !important;
}

.ledger-risk-cell .order-risk-tags {
  justify-content: flex-start;
}

.ledger-risk-cell .order-risk-advice {
  max-width: 260px;
}

.expanded-order-empty {
  min-height: 130px;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 12px;
}

.identity-section p {
  white-space: pre-line;
}

.inline-order-section {
  grid-column: span 2;
}

.inline-order-text {
  white-space: pre-line;
}

.customer-detail-actions {
  grid-column: 2;
  grid-row: 1 / span 2;
  align-self: center;
  display: grid;
  gap: 10px;
  min-width: 126px;
}

.customer-detail-action,
.customer-delete-action {
  align-self: center;
  min-width: 126px;
  min-height: 44px;
  border-radius: 8px;
  font-weight: 800;
}

.customer-detail-action {
  border-color: #161614;
  background: #161614;
  color: #fff;
}

.customer-detail-action:hover,
.customer-detail-action:focus-visible {
  border-color: #161614;
  background: #161614;
  color: #fff;
  transform: translateY(-1px);
  box-shadow: var(--shadow-soft);
}

.customer-deal-action {
  border-color: rgba(47, 132, 61, 0.32);
  background: #3b943b;
  color: #fff;
}

.customer-deal-action:hover,
.customer-deal-action:focus-visible {
  border-color: rgba(13, 106, 93, 0.28);
  background: var(--accent);
  color: #fff;
}

.customer-soft-project-action {
  border-color: rgba(49, 90, 122, 0.32);
  background: #315a7a;
  color: #fff;
}

.customer-soft-project-action:hover,
.customer-soft-project-action:focus-visible {
  border-color: #264862;
  background: #264862;
  color: #fff;
}

.customer-soft-project-action:disabled,
.customer-soft-project-action:disabled:hover {
  border-color: rgba(49, 90, 122, 0.14);
  background: #edf1f3;
  color: #77828a;
  cursor: not-allowed;
}

.customer-link-action {
  border-color: rgba(45, 91, 130, 0.24);
  background: rgba(45, 91, 130, 0.10);
  color: #315a7a;
}

.customer-link-action:hover,
.customer-link-action:focus-visible {
  border-color: rgba(45, 91, 130, 0.28);
  background: #315a7a;
  color: #fff;
}

.customer-delete-action {
  border-color: rgba(177, 60, 48, 0.34);
  background: #c93d1d;
  color: #fff;
}

.customer-delete-action:hover,
.customer-delete-action:focus-visible,
.danger-action:hover,
.danger-action:focus-visible {
  border-color: #9e3329;
  background: #9e3329;
  color: #fff;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20000;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(31, 33, 30, 0.32);
  backdrop-filter: blur(10px);
}

.compact-modal-backdrop {
  z-index: 21000;
}

.customer-modal {
  width: min(1380px, 96vw);
  height: min(900px, calc(100vh - 44px));
  display: grid;
  grid-template-rows: auto 1fr;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 14px;
  background: #f7f6f2;
  box-shadow: 0 34px 96px rgba(31, 28, 22, 0.26);
  overflow: hidden;
}

.customer-manage-modal,
.account-manage-modal,
.ai-config-modal,
.soft-design-config-modal,
.confirm-modal {
  width: min(620px, 94vw);
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 14px;
  background: #f7f6f2;
  box-shadow: 0 28px 72px rgba(31, 28, 22, 0.24);
  overflow: hidden;
}

.account-manage-modal {
  width: min(980px, 96vw);
}

.ai-config-modal {
  width: min(680px, 94vw);
}

.soft-design-config-modal {
  width: min(760px, 94vw);
}

.ai-config-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 16px 18px 18px;
}

.ai-config-form .field,
.soft-design-config-form .field {
  margin: 0;
}

.soft-design-config-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 16px 18px 18px;
}

.ai-config-form .wide,
.ai-config-form .modal-actions,
.ai-config-hint,
.soft-design-config-form .wide,
.soft-design-config-form .modal-actions,
.soft-design-config-hint {
  grid-column: 1 / -1;
}

.ai-config-hint,
.soft-design-config-hint {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

/* AI话术配置弹窗（全屏） */
.ai-assistant-backdrop {
  z-index: 21000;
}
.ai-assistant-fullscreen {
  width: calc(100vw - 80px);
  max-width: 1200px;
  height: calc(100vh - 60px);
  max-height: 820px;
  border: 1px solid rgba(255,255,255,0.72);
  border-radius: 14px;
  background: #f7f6f2;
  box-shadow: 0 28px 72px rgba(31,28,22,0.24);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.ai-assistant-header {
  padding: 16px 24px 14px;
  border-bottom: 1px solid var(--line, #f1f5f9);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  background: #fff;
}
.ai-assistant-header h2 { margin: 4px 0 2px; font-size: 20px; }
.ai-assistant-header p { margin: 0; font-size: 12px; color: var(--muted, #94a3b8); }
.ai-assistant-layout {
  flex: 1;
  display: flex;
  overflow: hidden;
}
.ai-assistant-nav {
  width: 160px;
  flex-shrink: 0;
  padding: 12px 8px;
  border-right: 1px solid var(--line, #f1f5f9);
  background: #fff;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.ai-nav-item {
  text-align: left;
  border: none;
  background: none;
  padding: 10px 14px;
  font-size: 13px;
  color: var(--muted, #64748b);
  cursor: pointer;
  border-radius: 8px;
  font-weight: 500;
  transition: all .15s;
}
.ai-nav-item:hover { background: #f8fafc; color: var(--text-1, #0f172a); }
.ai-nav-item.on { background: var(--accent-bg, #eef2ff); color: var(--accent, #6366f1); font-weight: 600; }
.ai-assistant-content {
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px;
}
.ai-panel { display: none; }
.ai-panel.on { display: block; }
.ai-assistant-content .field { margin: 0 0 16px; }
.ai-assistant-content .field.wide { display: block; }
.ai-assistant-content .field span {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-1, #0f172a);
  margin-bottom: 6px;
}
.ai-assistant-content textarea {
  width: 100%;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 13px;
  font-family: inherit;
  resize: vertical;
  background: #fff;
  line-height: 1.6;
}
.ai-assistant-content textarea:focus {
  outline: none;
  border-color: var(--accent, #6366f1);
  box-shadow: 0 0 0 2px rgba(99,102,241,0.1);
}
.ai-assistant-content input {
  width: 100%;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 13px;
  font-family: inherit;
  background: #fff;
}
.ai-assistant-content input:focus {
  outline: none;
  border-color: var(--accent, #6366f1);
}
.ai-assistant-content .config-section {
  border: 1px solid var(--line, #f1f5f9);
  border-radius: 10px;
  padding: 14px 16px;
  background: rgba(255,255,255,0.5);
}
.ai-assistant-content .config-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-1, #0f172a);
}
.ai-assistant-content .config-items-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.ai-assistant-content .config-item-row {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  flex-wrap: wrap;
}
.ai-assistant-content .config-item-row input,
.ai-assistant-content .config-item-row textarea {
  flex: 1;
  min-width: 120px;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 6px;
  padding: 7px 10px;
  font-size: 12px;
  font-family: inherit;
  background: #fff;
}
.ai-assistant-content .config-item-row textarea { resize: vertical; }
.ai-assistant-content .config-item-row input:focus,
.ai-assistant-content .config-item-row textarea:focus {
  outline: none;
  border-color: var(--accent, #6366f1);
}
.ai-assistant-content .config-item-row .item-remove {
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  border: none;
  border-radius: 6px;
  background: #fef2f2;
  color: #ef4444;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ai-assistant-content .config-item-row .item-remove:hover { background: #fee2e2; }
.ai-assistant-content .config-empty {
  font-size: 12px;
  color: var(--muted, #94a3b8);
  padding: 8px 0;
}
.ai-assistant-footer {
  padding: 12px 24px;
  border-top: 1px solid var(--line, #f1f5f9);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #fff;
}
.ai-assistant-footer .modal-actions {
  display: flex;
  gap: 8px;
}

.confirm-modal {
  padding: 20px;
}

.confirm-modal h2 {
  margin: 4px 0 8px;
  font-size: 20px;
}

.confirm-modal p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
  white-space: pre-line;
}

.identity-link-modal {
  width: min(440px, calc(100vw - 40px));
  display: grid;
  gap: 12px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 252, 0.98);
  box-shadow: var(--shadow-strong);
}

.identity-link-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.identity-link-head h2 {
  margin: 0;
  font-size: 17px;
}

.identity-link-head p {
  margin: 6px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.modal-head {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 252, 0.86);
}

.modal-head h2 {
  margin: 2px 0 0;
  font-size: 22px;
  line-height: 1.2;
}

.modal-head p {
  margin: 4px 0 0;
  color: var(--muted);
}

.modal-close {
  width: 34px;
  height: 34px;
  min-height: 34px;
  padding: 0;
  border-radius: 50%;
  font-size: 22px;
  line-height: 1;
  color: var(--muted);
  box-shadow: none;
}

.customer-create-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 16px 18px 18px;
}

.customer-create-form .field {
  margin: 0;
}

.customer-create-form .wide,
.modal-actions {
  grid-column: 1 / -1;
}

.customer-create-form textarea {
  width: 100%;
  resize: vertical;
  min-height: 76px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 9px 10px;
  background: rgba(255, 255, 255, 0.78);
  font: inherit;
  color: var(--ink);
  outline: none;
}

.account-manage-body {
  display: grid;
  grid-template-columns: minmax(270px, 0.34fr) minmax(520px, 0.66fr);
  min-height: 420px;
}

.account-form {
  display: grid;
  align-content: start;
  gap: 12px;
  padding: 16px 18px 18px;
  border-right: 1px solid var(--line);
  background: rgba(255, 255, 252, 0.72);
}

.account-form .field {
  margin: 0;
}

.account-form .wide,
.account-form .modal-actions {
  grid-column: 1 / -1;
}

.account-form select {
  height: 38px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0 10px;
  background: rgba(255, 255, 255, 0.8);
  color: var(--ink);
  font: inherit;
  outline: none;
}

.account-form select:disabled,
.account-form input:disabled {
  color: var(--muted);
  background: rgba(238, 235, 226, 0.74);
}

.account-list-shell {
  min-height: 0;
  max-height: min(62vh, 560px);
  overflow: auto;
  padding: 14px;
}

.account-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 8px;
  font-size: 12px;
}

.account-table th {
  padding: 0 10px 4px;
  color: var(--muted);
  font-weight: 700;
  text-align: left;
  white-space: nowrap;
}

.account-table td {
  padding: 11px 10px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 252, 0.82);
  white-space: nowrap;
}

.account-table td:first-child {
  border-left: 1px solid var(--line);
  border-radius: 10px 0 0 10px;
  font-weight: 800;
}

.account-table td:last-child {
  border-right: 1px solid var(--line);
  border-radius: 0 10px 10px 0;
}

.account-table tr:hover td {
  background: #fff9df;
}

.account-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.account-actions button {
  min-height: 26px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 12px;
  box-shadow: none;
  transform: none;
}

.role-chip,
.account-status-chip {
  display: inline-grid;
  place-items: center;
  min-width: 52px;
  height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  font-weight: 800;
}

.role-admin {
  background: #151512;
  color: #fff;
}

.role-supervisor {
  background: rgba(13, 106, 93, 0.12);
  color: #0d6a5d;
}

.role-staff {
  background: #eee9dd;
  color: #5d584f;
}

.account-status-active {
  background: #dff3e6;
  color: #19713f;
}

.account-status-disabled {
  background: #f1dfda;
  color: #9e3329;
}

.modal-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.danger-action {
  border-color: #9e3329;
  background: #9e3329;
  color: #fff;
}

.primary-action {
  border-color: var(--ink);
  background: var(--ink);
  color: #fff;
}

.primary-action:hover,
.primary-action:focus-visible {
  background: #2b2925;
  border-color: #2b2925;
}

.modal-body {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(340px, 0.39fr) minmax(520px, 0.61fr);
  gap: 0;
}

.modal-info,
.modal-chat {
  min-height: 0;
  overflow: hidden;
}

.modal-info {
  display: grid;
  grid-template-rows: 1fr auto;
  border-right: 1px solid var(--line);
  background: rgba(255, 255, 252, 0.72);
}

.modal-info-list {
  min-height: 0;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 4px 14px 18px;
}

.modal-info-group {
  flex: 0 0 auto;
  min-width: 0;
  border: 0;
  border-bottom: 1px solid rgba(31, 33, 30, 0.1);
  border-radius: 0;
  background: transparent;
}

.modal-info-group.priority {
  border-color: rgba(13, 106, 93, 0.18);
}

.modal-info-group-head {
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 2px 8px;
}

.modal-info-group-head h3 {
  margin: 0;
  font-size: 13px;
  font-weight: 650;
  line-height: 1.2;
}

.modal-info-group-head span {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.modal-info-group-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 0 0 14px;
}

.modal-info-item {
  min-width: 0;
  display: grid;
  gap: 5px;
  padding: 8px 9px;
  border: 0;
  border-radius: 6px;
  background: rgba(245, 244, 240, 0.78);
}

.modal-info-item.wide {
  grid-column: 1 / -1;
}

.modal-info-item span {
  color: var(--muted);
  font-size: 11px;
}

.modal-info-item strong {
  min-width: 0;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.55;
  word-break: break-word;
}

.modal-info-item.preline strong {
  white-space: pre-line;
}

.modal-overview-group .modal-info-item,
.modal-transaction-group .modal-info-item:not(.wide) {
  min-height: 32px;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  column-gap: 8px;
  row-gap: 2px;
  padding: 6px 8px;
}

.modal-overview-group .modal-info-item span,
.modal-transaction-group .modal-info-item:not(.wide) span {
  white-space: nowrap;
}

.modal-overview-group .modal-info-item strong,
.modal-transaction-group .modal-info-item:not(.wide) strong {
  line-height: 1.34;
}

.modal-overview-group .modal-info-item.overview-key {
  background: rgba(226, 241, 236, 0.72);
}

.modal-overview-group .modal-info-item.overview-key strong {
  color: #0d6a5d;
  font-weight: 650;
}

.modal-info-item.action-focus {
  background: rgba(226, 241, 236, 0.72);
}

.modal-info-item.action-focus strong {
  color: #174f47;
  font-weight: 550;
}

.modal-info-disclosure > summary,
.modal-order-policy > summary {
  cursor: pointer;
  list-style: none;
}

.modal-info-disclosure > summary::-webkit-details-marker,
.modal-order-policy > summary::-webkit-details-marker {
  display: none;
}

.modal-info-disclosure-meta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.modal-info-disclosure-icon {
  font-size: 15px;
  transition: transform 160ms ease;
}

.modal-info-disclosure[open] .modal-info-disclosure-icon {
  transform: rotate(180deg);
}

.modal-order-list,
.modal-deal-list,
.modal-order-policy {
  grid-column: 1 / -1;
  min-width: 0;
}

.modal-order-list {
  display: grid;
  gap: 8px;
}

.modal-order-card {
  display: grid;
  gap: 9px;
  padding: 11px 12px;
  border: 1px solid rgba(13, 106, 93, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 252, 0.84);
}

.modal-order-card-head,
.modal-order-status,
.modal-deal-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.modal-order-card-head > div {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.modal-order-card-head span,
.modal-order-card-head time,
.modal-order-status > span,
.modal-order-note {
  color: var(--muted);
  font-size: 11px;
  font-weight: 400;
}

.modal-order-card-head strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 12px;
  font-weight: 550;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.modal-order-card-head time {
  flex: 0 0 auto;
}

.modal-order-money-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  border-radius: 6px;
  background: rgba(31, 33, 30, 0.08);
}

.modal-order-money-grid > div {
  min-width: 0;
  display: grid;
  gap: 3px;
  padding: 7px 8px;
  background: #f7f6f2;
}

.modal-order-money-grid span {
  color: var(--muted);
  font-size: 10px;
}

.modal-order-money-grid strong {
  overflow: hidden;
  font-size: 12px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.modal-order-status {
  align-items: flex-start;
}

.modal-order-risk-tags {
  justify-content: flex-start;
}

.modal-order-advice {
  margin: 0;
  color: #4e4b45;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.55;
}

.modal-order-note {
  line-height: 1.5;
}

.modal-record-subhead {
  margin: 4px 0 5px;
  color: var(--muted);
  font-size: 11px;
}

.modal-deal-list {
  display: grid;
  gap: 1px;
  overflow: hidden;
  border-radius: 6px;
  background: rgba(31, 33, 30, 0.08);
}

.modal-deal-list .modal-record-subhead {
  margin: 0;
  padding: 7px 9px;
  background: #f7f6f2;
}

.modal-deal-row {
  padding: 8px 9px;
  background: rgba(255, 255, 252, 0.9);
  font-size: 12px;
}

.modal-deal-row strong {
  font-weight: 600;
}

.modal-deal-row span:last-child {
  color: var(--muted);
}

.modal-record-empty {
  margin: 0;
  padding: 9px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
  text-align: center;
}

.modal-order-policy {
  border-top: 1px dashed rgba(31, 33, 30, 0.13);
}

.modal-order-policy > summary {
  min-height: 34px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 2px 2px;
  color: #46655f;
  font-size: 12px;
}

.modal-order-policy > summary small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 400;
}

.modal-order-policy-body {
  display: grid;
  gap: 7px;
  padding: 8px 0 2px;
}

.modal-order-policy-body > div {
  display: grid;
  grid-template-columns: 62px minmax(0, 1fr);
  gap: 8px;
}

.modal-order-policy-body strong {
  color: #315e56;
  font-size: 11px;
  font-weight: 600;
}

.modal-order-policy-body p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 400;
  line-height: 1.55;
}

.modal-soft-opportunity {
  border-color: rgba(148, 104, 43, 0.26);
  background: linear-gradient(180deg, rgba(255, 253, 245, 0.94), rgba(247, 240, 223, 0.66));
}

.modal-soft-body {
  display: grid;
  gap: 9px;
  padding: 10px;
}

.modal-soft-body p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.modal-soft-fields {
  display: grid;
  gap: 6px;
}

.modal-soft-fields div {
  min-width: 0;
  display: grid;
  gap: 4px;
  padding: 7px 8px;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.62);
}

.modal-soft-fields span {
  color: var(--muted);
  font-size: 12px;
}

.modal-soft-fields strong {
  line-height: 1.45;
  word-break: break-word;
}

.modal-soft-body button {
  justify-self: start;
  min-height: 30px;
  padding: 0 10px;
  border-color: rgba(148, 104, 43, 0.2);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.58);
  color: #766a55;
  box-shadow: none;
  cursor: not-allowed;
  transform: none;
}

.modal-soft-body .modal-soft-project-action:not(:disabled) {
  border-color: #315a7a;
  background: #315a7a;
  color: #fff;
  cursor: pointer;
}

.modal-soft-body .modal-soft-project-action:not(:disabled):hover,
.modal-soft-body .modal-soft-project-action:not(:disabled):focus-visible {
  border-color: #264862;
  background: #264862;
}

.deal-create-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: end;
  gap: 6px 8px;
  padding: 8px 10px 10px;
  border-top: 1px solid var(--line);
  background: rgba(246, 245, 240, 0.78);
}

.deal-create-title {
  grid-column: 1 / -1;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.2;
}

.deal-create-form label {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.deal-create-form label:nth-of-type(3) {
  grid-column: auto;
}

.deal-create-form span {
  color: var(--muted);
  font-size: 12px;
}

.deal-create-form input {
  width: 100%;
  min-width: 0;
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.86);
  padding: 0 8px;
  color: var(--ink);
  font: inherit;
}

.deal-create-form button {
  min-height: 30px;
  border-radius: 8px;
  background: #161614;
  color: #fff;
}

.deal-create-form button:hover {
  background: var(--accent);
  color: #fff;
}

.modal-chat {
  display: grid;
  grid-template-rows: auto 1fr;
  background: #f3f0ea;
}

.modal-chat-head {
  min-height: 50px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 18px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 252, 0.72);
}

.modal-chat-head h3 {
  margin: 0;
  font-size: 15px;
}

.modal-chat-head span {
  color: var(--muted);
}

.modal-chat-list {
  min-height: 0;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px 22px 22px;
}

.modal-chat-list .message {
  width: min(72%, 760px);
}

.modal-chat-empty {
  height: 100%;
  display: grid;
  place-content: center;
  gap: 7px;
  color: var(--muted);
  text-align: center;
}

.modal-chat-empty strong {
  color: var(--ink);
  font-size: 15px;
}

.modal-chat-empty span {
  max-width: 320px;
  line-height: 1.6;
}

/* Customer detail hierarchy: readable summaries first, supporting detail on demand. */
.modal-overview-group .modal-info-group-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  padding: 0 0 14px;
}

.modal-overview-group .modal-info-item {
  min-height: 42px;
  padding: 8px 9px;
  column-gap: 7px;
}

.modal-overview-group .modal-info-item span {
  font-size: 11px;
}

.modal-overview-group .modal-info-item strong {
  font-size: 13px;
  line-height: 1.4;
}

.modal-transaction-group .modal-info-group-grid {
  gap: 8px;
  padding: 0 0 14px;
}

@media (max-width: 1100px) {
  #customerModal {
    padding: 14px;
  }

  .customer-modal {
    width: min(980px, calc(100vw - 28px));
    height: min(900px, calc(100vh - 28px));
  }

  .customer-modal .modal-head {
    min-height: 66px;
    padding: 12px 14px;
  }

  .customer-modal .modal-body {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr) clamp(240px, 34vh, 310px);
  }

  .customer-modal .modal-info {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .customer-modal .modal-info-list {
    padding: 4px 14px 16px;
  }

  .customer-modal .modal-overview-group .modal-info-group-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .customer-modal .deal-create-form {
    grid-template-columns:
      minmax(120px, 0.8fr)
      minmax(170px, 1fr)
      minmax(220px, 1.15fr)
      minmax(92px, auto);
  }

  .customer-modal .deal-create-form button {
    align-self: end;
    padding-inline: 12px;
    white-space: nowrap;
  }

  .customer-modal .modal-chat-list {
    padding: 12px 16px 16px;
  }

  .customer-modal .modal-chat-list .message {
    width: min(86%, 720px);
  }
}

@media (max-width: 720px) {
  #customerModal {
    padding: 10px;
  }

  .customer-modal {
    width: calc(100vw - 20px);
    height: calc(100vh - 20px);
    border-radius: 10px;
  }

  .customer-modal .modal-head {
    gap: 10px;
    padding: 10px 12px;
  }

  .customer-modal .modal-head h2 {
    font-size: 18px;
  }

  .customer-modal .modal-close {
    flex: 0 0 34px;
  }

  .customer-modal .modal-body {
    grid-template-rows: minmax(0, 1fr) clamp(220px, 38vh, 280px);
  }

  .customer-modal .modal-overview-group .modal-info-group-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .customer-modal .deal-create-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .customer-modal .deal-create-form label:nth-of-type(3),
  .customer-modal .deal-create-form button {
    grid-column: 1 / -1;
  }
}

@media (max-width: 520px) {
  .customer-modal .modal-overview-group .modal-info-group-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .customer-modal .modal-order-card-head,
  .customer-modal .modal-order-status {
    align-items: flex-start;
    flex-direction: column;
  }
}

.empty-cell {
  height: 180px;
  color: var(--muted);
  text-align: center !important;
  vertical-align: middle !important;
}

.customer-list-shell,
.detail-shell {
  min-width: 0;
  min-height: 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--paper);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}

.sticky-title {
  height: 50px;
  align-items: center;
  margin: 0;
  padding: 0 14px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 252, 0.82);
}

.customer-list {
  height: calc(100vh - 220px);
  overflow: auto;
  padding: 8px;
}

.customer-row {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px 10px;
  padding: 12px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  text-align: left;
}

.customer-row:hover,
.customer-row.active {
  border-color: rgba(116, 99, 75, 0.20);
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 14px 34px rgba(42, 34, 24, 0.10), inset 0 1px 0 rgba(255, 255, 255, 0.78);
}

.customer-row strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
}

.customer-row small,
.customer-row p {
  margin: 0;
  color: var(--muted);
}

.customer-row p {
  grid-column: 1 / -1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.level-pill {
  align-self: start;
  border-radius: 999px;
  padding: 4px 8px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
}

.level-a {
  background: #e4f1ed;
  color: #0d6a5d;
}

.level-b {
  background: #f3e8dc;
  color: #8a5a2f;
}

.level-c {
  background: #e8edf3;
  color: #2f5f8f;
}

.detail-shell {
  position: relative;
}

.empty-state {
  height: 100%;
  display: grid;
  place-content: center;
  gap: 8px;
  color: var(--muted);
  text-align: center;
}

.empty-state strong {
  color: var(--ink);
  font-size: 18px;
}

.customer-detail {
  height: calc(100vh - 170px);
  display: grid;
  grid-template-rows: auto auto auto auto 1fr;
  overflow: hidden;
}

.detail-head {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 12px;
  padding: 18px 18px 12px;
}

.eyebrow {
  color: var(--muted);
  font-size: 12px;
}

.detail-head h1 {
  margin: 4px 0 0;
  font-size: 24px;
  line-height: 1.15;
}

.level-badge {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 10px;
  background: #fff;
  color: var(--accent);
  font-weight: 700;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  padding: 0 18px 14px;
}

.detail-grid div,
.insight-box,
.assistant-focus {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.62);
}

.detail-grid div {
  min-width: 0;
  display: grid;
  gap: 6px;
  padding: 10px;
}

.detail-grid span,
.insight-box span,
.assistant-focus span {
  color: var(--muted);
  font-size: 12px;
}

.detail-grid strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.insight-box {
  margin: 0 18px 14px;
  padding: 12px;
}

.insight-box p,
.assistant-focus p {
  margin: 6px 0 0;
  line-height: 1.6;
}

.messages-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 0 18px 10px;
}

.messages-head h2 {
  margin: 0;
  font-size: 14px;
}

.messages-head span {
  color: var(--muted);
}

.message-list {
  overflow: auto;
  padding: 0 18px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.message {
  width: min(78%, 680px);
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin-bottom: 0;
}

.message.buyer {
  align-self: flex-start;
}

.message.seller {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.message-gap-divider {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 8px 0;
  color: rgba(119, 118, 109, 0.78);
  font-size: 12px;
  line-height: 1;
}

.message-gap-divider::before,
.message-gap-divider::after {
  content: "";
  height: 1px;
  flex: 1;
  background: rgba(119, 118, 109, 0.28);
}

.message-gap-divider span {
  flex: 0 0 auto;
  padding: 0 2px;
  white-space: nowrap;
}

.message-gap-divider.long-gap {
  color: #b9473a;
  font-weight: 800;
}

.message-gap-divider.long-gap::before,
.message-gap-divider.long-gap::after {
  height: 2px;
  background: rgba(185, 71, 58, 0.72);
}

.message-avatar {
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #6d634f;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
  box-shadow: 0 6px 14px rgba(34, 32, 27, 0.10);
}

.message-avatar.buyer-avatar {
  background: #6d634f;
}

.message.seller .message-avatar.staff-keke {
  background: #0d6a5d;
}

.message.seller .message-avatar.staff-yangyang {
  background: #9a6a46;
}

.message.seller .message-avatar.staff-nini {
  background: #7161a3;
}

.message.seller .message-avatar.staff-other {
  background: #4a4a46;
}

.message-content {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.message.seller .message-content {
  justify-items: end;
}

.message-sender {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.2;
}

.message-bubble {
  max-width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.82);
  line-height: 1.7;
  word-break: break-word;
}

.message-bubble a {
  color: #0d6a5d;
  text-decoration: underline;
  text-underline-offset: 3px;
  word-break: break-all;
}

.message-bubble a:hover {
  color: #084d44;
}

.message.buyer .message-bubble {
  border-color: rgba(13, 106, 93, 0.20);
  border-top-left-radius: 4px;
  background: rgba(228, 241, 237, 0.78);
}

.message.seller .message-bubble {
  border-top-right-radius: 4px;
}

.message-time {
  color: rgba(119, 118, 109, 0.78);
  font-size: 11px;
  line-height: 1.2;
}

.message-media {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.message-media img {
  max-width: 160px;
  max-height: 160px;
  border-radius: 8px;
  border: 1px solid var(--line);
  object-fit: cover;
  cursor: zoom-in;
}

.image-preview-backdrop {
  position: fixed;
  inset: 0;
  z-index: 30000;
  display: grid;
  place-items: center;
  padding: 28px;
  background: rgba(24, 23, 20, 0.72);
  backdrop-filter: blur(14px);
}

.image-preview-viewer {
  position: relative;
  max-width: min(92vw, 1180px);
  max-height: 90vh;
  display: grid;
  place-items: center;
}

.image-preview-viewer img {
  max-width: min(92vw, 1180px);
  max-height: 90vh;
  display: block;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.16);
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.36);
  object-fit: contain;
}

.image-preview-close {
  position: absolute;
  top: -16px;
  right: -16px;
  width: 36px;
  height: 36px;
  min-height: 36px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.52);
  border-radius: 50%;
  background: rgba(22, 22, 20, 0.86);
  color: #fff;
  font-size: 24px;
  line-height: 1;
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.30);
}

.image-preview-close:hover,
.image-preview-close:focus-visible {
  border-color: rgba(255, 255, 255, 0.72);
  background: #161614;
  color: #fff;
  transform: none;
}

.product-preview-box {
  display: flex;
  gap: 12px;
  align-items: center;
  margin: 0 18px 14px;
  padding: 10px;
  border: 1px solid rgba(13, 106, 93, 0.16);
  border-radius: 10px;
  background: rgba(255, 255, 252, 0.84);
}

.product-preview-image {
  width: 72px;
  height: 72px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--muted);
  overflow: hidden;
}

.product-preview-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-preview-info {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.product-preview-info span,
.product-preview-info a {
  color: var(--muted);
}

.assistant-panel {
  display: grid;
  gap: 10px;
}

.assistant-focus {
  padding: 12px;
}

.assistant-focus:first-of-type {
  border-color: rgba(13, 106, 93, 0.20);
  background: rgba(228, 241, 237, 0.64);
}

.assistant-focus.subtle {
  background: rgba(255, 255, 255, 0.58);
}

.blocker-list {
  display: grid;
  gap: 8px;
}

.blocker-item {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.62);
}

.blocker-item span:last-child {
  color: var(--accent-2);
  font-weight: 700;
}

.sync-list {
  display: grid;
  gap: 8px;
}

.sync-item {
  display: grid;
  gap: 4px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.58);
}

.sync-item strong {
  font-size: 12px;
}

.sync-item span {
  color: var(--muted);
  font-size: 12px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 22px;
  z-index: 50;
  transform: translateX(-50%);
  max-width: min(560px, calc(100vw - 32px));
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(34, 30, 24, 0.88);
  color: #fff;
  box-shadow: 0 18px 46px rgba(48, 38, 24, 0.18);
}

@media (max-width: 1500px) {
  .app-header {
    grid-template-columns: 150px auto minmax(180px, 0.8fr) minmax(260px, auto);
    gap: 8px;
    padding: 0 10px;
  }

  .brand {
    gap: 6px;
  }

  .brand span {
    display: none;
  }

  .view-tabs {
    max-width: 100%;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .view-tabs::-webkit-scrollbar,
  .header-actions::-webkit-scrollbar {
    width: 0;
    height: 0;
  }

  .view-tabs button {
    min-width: max-content;
    padding: 0 8px;
  }

  .global-search input {
    max-width: 280px;
  }

  .header-actions {
    overflow-x: auto;
    justify-content: flex-start;
    scrollbar-width: none;
  }

  .preview-copy-pill {
    max-width: 280px;
    min-width: max-content;
  }

  .header-actions button {
    min-width: max-content;
    min-height: 30px;
    padding: 0 8px;
    border-radius: 7px;
    font-size: 12px;
  }

  .user-badge {
    max-width: 118px;
  }

  .app.table-mode .stage,
  .app.dashboard-mode .stage {
    padding: 10px;
  }

  .table-view {
    gap: 10px;
  }

  .table-filter-panel {
    padding: 8px 10px 10px;
  }

  .section-title {
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 10px;
    margin-bottom: 8px;
  }

  .table-title-actions {
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 6px;
  }

  .filter-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(92px, 1fr));
    gap: 6px;
    overflow: visible;
    padding-bottom: 0;
  }

  .filter-grid .field,
  .filter-grid .staff-field,
  .filter-grid .product-id-field,
  .period-field,
  .deal-order-filter-grid .deal-search-field {
    min-width: 0;
  }

  .filter-grid .staff-field,
  .filter-grid .product-id-field,
  .period-field,
  .deal-order-filter-grid .deal-search-field {
    grid-column: span 2;
  }

  .filter-choice-trigger,
  .filter-grid input,
  .single-filter-button,
  .period-tabs,
  .staff-tabs {
    min-height: 30px;
  }

  .filter-grid .field span {
    font-size: 10.5px;
  }

  .period-tabs button,
  .staff-tabs button {
    padding: 0 6px;
  }

  .deal-order-summary-grid {
    grid-template-columns: repeat(5, minmax(112px, 1fr));
    gap: 6px;
  }

  .deal-order-policy-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .deal-order-kpi {
    min-height: 66px;
    padding: 8px 10px;
  }

  .deal-order-kpi strong {
    font-size: 20px;
  }

  .customer-table {
    min-width: 1560px;
    font-size: 11.5px;
  }

  .customer-table th,
  .customer-table td {
    padding: 7px 6px;
  }

  .customer-table th:nth-child(1),
  .customer-table td:nth-child(1),
  .customer-table th:nth-child(2),
  .customer-table td:nth-child(2) {
    width: 92px;
  }

  .customer-table th:nth-child(3),
  .customer-table td:nth-child(3) {
    width: 118px;
  }

  .customer-table th:nth-child(4),
  .customer-table td:nth-child(4),
  .customer-table th:nth-child(5),
  .customer-table td:nth-child(5),
  .customer-table th:nth-child(8),
  .customer-table td:nth-child(8),
  .customer-table th:nth-child(9),
  .customer-table td:nth-child(9),
  .customer-table th:nth-child(10),
  .customer-table td:nth-child(10),
  .customer-table th:nth-child(14),
  .customer-table td:nth-child(14),
  .customer-table th:nth-child(15),
  .customer-table td:nth-child(15),
  .customer-table th:nth-child(16),
  .customer-table td:nth-child(16) {
    width: 96px;
  }

  .customer-table th:nth-child(6),
  .customer-table td:nth-child(6) {
    width: 88px;
  }

  .customer-table th:nth-child(7),
  .customer-table td:nth-child(7),
  .customer-table th:nth-child(12),
  .customer-table td:nth-child(12),
  .customer-table th:nth-child(13),
  .customer-table td:nth-child(13) {
    width: 66px;
  }

  .customer-table th:nth-child(11),
  .customer-table td:nth-child(11) {
    width: 170px;
  }

  .deal-order-table {
    min-width: 1660px;
  }

  .deal-order-table th:nth-child(1),
  .deal-order-table td:nth-child(1),
  .deal-order-table th:nth-child(2),
  .deal-order-table td:nth-child(2),
  .deal-order-table th:nth-child(4),
  .deal-order-table td:nth-child(4),
  .deal-order-table th:nth-child(7),
  .deal-order-table td:nth-child(7),
  .deal-order-table th:nth-child(8),
  .deal-order-table td:nth-child(8),
  .deal-order-table th:nth-child(9),
  .deal-order-table td:nth-child(9),
  .deal-order-table th:nth-child(10),
  .deal-order-table td:nth-child(10),
  .deal-order-table th:nth-child(12),
  .deal-order-table td:nth-child(12) {
    width: 104px;
  }

  .deal-order-table th:nth-child(3),
  .deal-order-table td:nth-child(3),
  .deal-order-table th:nth-child(6),
  .deal-order-table td:nth-child(6) {
    width: 126px;
  }

  .deal-order-table th:nth-child(5),
  .deal-order-table td:nth-child(5) {
    width: 148px;
  }

  .deal-order-table th:nth-child(13),
  .deal-order-table td:nth-child(13) {
    width: 118px;
  }

  .deal-order-table th:nth-child(11),
  .deal-order-table td:nth-child(11) {
    width: 220px;
  }

  .customer-card-detail {
    grid-template-columns: minmax(0, 1fr) 112px;
    gap: 9px 10px;
    padding: 10px;
  }

  .customer-detail-actions,
  .customer-detail-action,
  .customer-delete-action {
    min-width: 112px;
  }

  .expanded-order-table {
    font-size: 11.5px;
  }

  .ledger-order-no {
    min-width: 168px;
  }

  .ledger-refund-no {
    min-width: 142px;
  }

  .workbench-hero {
    padding: 16px;
  }

  .workbench-controls {
    min-width: 0;
    grid-template-columns: minmax(180px, 1fr) minmax(150px, 190px) 112px 112px 74px;
  }

  .kpi-grid {
    grid-template-columns: repeat(3, minmax(150px, 1fr));
  }

  .dashboard-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .outreach-layout {
    grid-template-columns: minmax(0, 1fr) 260px;
  }

  .outreach-filter-grid {
    grid-template-columns: repeat(6, minmax(94px, 1fr));
  }

  .outreach-filter-grid .product-id-field {
    grid-column: span 2;
  }

  .outreach-table-wrap {
    height: clamp(340px, 46vh, 560px);
    min-height: 340px;
  }
}

@media (max-width: 1180px) {
  .app {
    grid-template-columns: 235px minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr);
    grid-template-areas:
      "header header"
      "left stage";
  }

  .app-header {
    grid-template-columns: 120px minmax(0, 1fr);
    grid-auto-rows: auto;
    gap: 7px 10px;
    min-height: 56px;
    padding: 8px 10px;
  }

  .view-tabs {
    justify-self: start;
  }

  .global-search {
    grid-column: 1 / -1;
    width: 100%;
  }

  .global-search input {
    max-width: none;
  }

  .header-actions {
    grid-column: 1 / -1;
  }

  .preview-copy-pill {
    max-width: none;
  }

  .right-rail {
    display: none;
  }

  .app.table-mode .stage,
  .app.dashboard-mode .stage,
  .stage {
    padding: 8px;
  }

  .workspace {
    grid-template-columns: 360px minmax(360px, 1fr);
  }

  .dashboard-workspace {
    grid-template-columns: 1fr;
  }

  .workbench-hero {
    grid-template-columns: 1fr;
  }

  .workbench-controls {
    min-width: 0;
    grid-template-columns: minmax(220px, 1fr) minmax(190px, 1fr) 132px 132px 84px;
  }

  .kpi-grid {
    grid-template-columns: repeat(3, minmax(150px, 1fr));
  }

  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .level-chart-layout {
    grid-template-columns: 180px minmax(0, 1fr);
  }

  .filter-grid {
    grid-template-columns: repeat(4, minmax(86px, 1fr));
  }

  .deal-order-summary-grid {
    grid-template-columns: repeat(3, minmax(120px, 1fr));
  }

  .deal-order-policy-head,
  .order-policy-mini {
    grid-template-columns: 1fr;
  }

  .deal-order-policy-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .customer-table {
    min-width: 1420px;
    font-size: 11px;
  }

  .customer-table th,
  .customer-table td {
    padding: 6px 5px;
  }

  .customer-table-shell {
    border-radius: 10px;
  }

  .customer-card-detail {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
  }

  .expanded-order-ledger,
  .expanded-insight-panel,
  .customer-detail-actions {
    grid-column: 1;
    grid-row: auto;
  }

  .customer-detail-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    align-self: stretch;
  }

  .customer-detail-action,
  .customer-delete-action {
    min-width: 108px;
    min-height: 38px;
  }

  .outreach-layout {
    grid-template-columns: 1fr;
  }

  .outreach-filter-grid {
    grid-template-columns: repeat(4, minmax(94px, 1fr));
  }

  .outreach-template-box {
    grid-template-columns: 1fr;
  }

  .outreach-template-choice-row {
    grid-template-columns: 1fr;
  }

  .compact-template-box .outreach-template-preview {
    white-space: normal;
  }

  .outreach-actions,
  .outreach-preview-tools {
    flex-wrap: wrap;
  }
}

/* P1-01 customer table experience polish */
.customer-table-view {
  gap: 8px;
}

.customer-table-filter-panel {
  padding: 7px 9px 8px;
  border-color: rgba(65, 49, 32, 0.12);
  border-radius: 10px;
  background: rgba(255, 253, 248, 0.9);
  box-shadow: none;
}

.customer-table-title {
  align-items: center;
  margin-bottom: 5px;
}

.customer-table-title h2 {
  color: #241d16;
  font-size: 15px;
  font-weight: 800;
}

.customer-table-title #tableSummary {
  color: #7f7568;
  font-size: 11.5px;
}

.customer-table-pager,
.deal-order-pager {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 28px;
  margin-left: auto;
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}

.customer-table-pager-button {
  width: 28px;
  height: 28px;
  min-height: 28px;
  padding: 0;
  display: inline-grid;
  place-items: center;
  border: 1px solid rgba(111, 79, 48, 0.16);
  border-radius: 7px;
  background: #fffdf8;
  color: #5c4028;
  font-size: 15px;
  line-height: 1;
}

.customer-table-pager-button:hover:not(:disabled),
.customer-table-pager-button:focus-visible {
  border-color: #3a2a1f;
  background: #3a2a1f;
  color: #fff;
  transform: none;
}

.customer-table-pager-button:disabled {
  cursor: not-allowed;
  opacity: 0.38;
}

.customer-table-pager-status {
  min-width: 190px;
  color: #7f7568;
}

.deal-order-pager {
  width: 100%;
  justify-content: flex-end;
  padding: 8px 12px 10px;
}

@media (max-width: 720px) {
  .customer-table-pager,
  .deal-order-pager {
    flex-basis: 100%;
    margin-left: 0;
    overflow-x: auto;
  }

  .customer-table-pager-status {
    min-width: 176px;
  }
}

.customer-table-title .table-title-actions {
  gap: 6px;
}

.customer-table-title .compact-action {
  min-height: 28px;
  padding: 0 10px;
  border-radius: 7px;
}

.customer-table-title .table-total-pill {
  min-height: 21px;
  border-color: rgba(111, 79, 48, 0.16);
  background: #f7efe3;
  color: #5c4028;
}

.customer-table-title .copy-filtered-ids-action {
  border-color: rgba(111, 79, 48, 0.18);
  background: #fffdf8;
  color: #6e4b2f;
}

.customer-table-title .copy-filtered-ids-action:hover,
.customer-table-title .copy-filtered-ids-action:focus-visible {
  border-color: #3a2a1f;
  background: #3a2a1f;
  color: #fff;
  transform: none;
  box-shadow: none;
}

.customer-table-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.customer-quick-time {
  display: flex;
  align-items: center;
  gap: 7px;
  flex: 0 0 auto;
}

.customer-quick-time > span {
  color: #8a8174;
  font-size: 10.5px;
  font-weight: 700;
  white-space: nowrap;
}

.customer-quick-time .period-tabs {
  min-height: 28px;
  border-color: rgba(65, 49, 32, 0.12);
  border-radius: 7px;
  background: #fffefa;
  box-shadow: none;
  gap: 2px;
  padding: 2px;
}

.customer-quick-time .period-tabs button {
  min-height: 22px;
  padding: 0 10px;
  border-radius: 6px;
  color: #766d60;
}

.customer-quick-time .period-tabs button:hover,
.customer-quick-time .period-tabs button.active {
  border-color: #3a2a1f;
  background: #3a2a1f;
  color: #fff;
  transform: none;
  box-shadow: none;
}

.customer-table-search {
  min-width: 240px;
  max-width: 560px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px;
  flex: 1 1 360px;
}

.customer-table-search input,
.customer-table-search button,
.customer-clear-filters {
  min-height: 30px;
  height: 30px;
  border-radius: 7px;
  box-shadow: none;
}

.customer-table-search input {
  min-width: 0;
  padding: 0 10px;
  border-color: rgba(65, 49, 32, 0.14);
  background: #fffefa;
}

.customer-table-search button {
  padding: 0 16px;
}

.customer-clear-filters {
  flex: 0 0 auto;
  padding: 0 11px;
}

.customer-clear-filters:disabled {
  cursor: default;
  opacity: 0.42;
}

.app[data-view="table"] .app-header .global-search {
  display: none;
}

.customer-header-filter-popover {
  position: fixed;
  z-index: 10020;
  display: grid;
  gap: 10px;
  max-height: calc(100vh - 24px);
  max-height: calc(100dvh - 24px);
  overflow: auto;
  padding: 12px;
  border: 1px solid rgba(65, 49, 32, 0.18);
  border-radius: 8px;
  background: #fffefa;
  box-shadow: 0 18px 48px rgba(42, 34, 24, 0.2);
}

.customer-header-filter-popover[hidden] {
  display: none;
}

.customer-header-filter-head,
.customer-header-filter-actions,
.customer-header-filter-tools {
  display: flex;
  align-items: center;
  gap: 8px;
}

.customer-header-filter-head {
  justify-content: space-between;
}

.customer-header-filter-head strong {
  color: #241d16;
  font-size: 13px;
}

.customer-header-filter-close {
  width: 28px;
  height: 28px;
  min-height: 28px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #756b5e;
  font-size: 20px;
  line-height: 1;
  box-shadow: none;
}

.customer-header-filter-close:hover,
.customer-header-filter-close:focus-visible {
  background: #f2ece2;
  color: #241d16;
  transform: none;
}

.customer-header-filter-body {
  display: grid;
  gap: 10px;
}

.customer-header-filter-tools {
  justify-content: flex-end;
}

.customer-header-filter-tools button {
  min-height: 24px;
  padding: 0 7px;
  border: 0;
  background: transparent;
  color: var(--accent);
  font-size: 11px;
  box-shadow: none;
}

.customer-header-filter-options {
  display: grid;
  gap: 4px;
  max-height: 250px;
  overflow: auto;
}

.customer-header-filter-options label,
.customer-header-sort-choice label {
  min-height: 32px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 8px;
  border: 1px solid transparent;
  border-radius: 6px;
  color: #3b342c;
  font-size: 12px;
  cursor: pointer;
}

.customer-header-filter-options label:hover,
.customer-header-sort-choice label:hover {
  border-color: rgba(13, 106, 93, 0.14);
  background: #eef8f5;
}

.customer-header-filter-options input,
.customer-header-sort-choice input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--accent);
}

.customer-header-date-range {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.customer-header-date-range label {
  display: grid;
  gap: 5px;
  color: #7f7568;
  font-size: 11px;
}

.customer-header-date-range input {
  width: 100%;
  min-height: 34px;
  padding: 0 7px;
  border-color: rgba(65, 49, 32, 0.16);
  border-radius: 6px;
  background: #fff;
}

.customer-header-sort-choice {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
  margin: 0;
  padding: 8px;
  border: 1px solid rgba(65, 49, 32, 0.12);
  border-radius: 7px;
}

.customer-header-sort-choice legend {
  padding: 0 4px;
  color: #7f7568;
  font-size: 11px;
}

.customer-header-sort-choice label {
  min-height: 28px;
  padding: 4px;
}

.customer-header-filter-actions {
  justify-content: space-between;
  padding-top: 9px;
  border-top: 1px solid rgba(65, 49, 32, 0.1);
}

.customer-header-filter-actions button {
  min-height: 30px;
  padding: 0 12px;
  border-radius: 7px;
}

.customer-table-view .customer-table-shell {
  border-color: rgba(65, 49, 32, 0.12);
  border-radius: 12px;
  background: rgba(255, 254, 250, 0.94);
  box-shadow: none;
}

.customer-overview-table {
  color: #2a251f;
  font-size: 12px;
}

.customer-overview-table th,
.customer-overview-table td {
  padding: 7px 9px;
}

.customer-overview-table th {
  height: 38px;
  border-bottom: 1px solid rgba(65, 49, 32, 0.14);
  background: #f4eee4;
  color: #716758;
  font-size: 11.5px;
  font-weight: 800;
}

.customer-overview-table .customer-header-filter-trigger {
  min-height: 38px;
}

.customer-overview-table .header-filter-mark {
  width: 17px;
  height: 17px;
  border-color: rgba(111, 79, 48, 0.2);
  background: rgba(255, 254, 250, 0.86);
}

.customer-overview-table .customer-header-filter-trigger.active .header-filter-mark {
  border-color: #0d6a5d;
  background: #0d6a5d;
}

.customer-overview-table tbody tr.customer-card-row {
  height: 54px;
  transition: none;
}

.customer-overview-table tbody tr.customer-card-row:hover {
  filter: none;
  transform: none;
}

.customer-overview-table tbody tr.customer-card-row td {
  height: 54px;
  border-top-color: rgba(65, 49, 32, 0.1);
  border-bottom-width: 5px;
  background: #fffefa;
  transition: background 0.14s ease, border-color 0.14s ease;
}

.customer-overview-table tbody tr.customer-card-row:hover td {
  border-top-color: rgba(111, 79, 48, 0.2);
  background: #fff8ec;
}

.customer-overview-table tbody tr.customer-card-row.expanded td {
  border-top-color: rgba(111, 79, 48, 0.24);
  background: #fff3dd;
}

.customer-overview-table th:not(:last-child)::after,
.customer-overview-table tbody tr.customer-card-row td:not(:last-child)::after {
  height: 40%;
  min-height: 16px;
  background: rgba(65, 49, 32, 0.14);
}

.customer-overview-table th:not(:last-child)::after {
  background: rgba(65, 49, 32, 0.12);
}

.customer-overview-table td {
  line-height: 1.45;
}

.customer-overview-table .customer-name-cell,
.customer-overview-table .customer-note-cell,
.customer-overview-table .product-category-cell,
.customer-overview-table .contact-cell,
.customer-overview-table .staff-cell {
  text-align: left !important;
}

.customer-overview-table .customer-name-wrap {
  justify-content: flex-start;
}

.customer-overview-table .customer-name-text {
  color: #241d16;
  font-weight: 800;
}

.customer-overview-table .date-cell,
.customer-overview-table .table-date-cell {
  min-width: 0;
  color: #83786a;
  font-size: 11.5px;
}

.customer-overview-table .number-cell,
.customer-overview-table .money-cell,
.customer-overview-table .count-cell {
  font-variant-numeric: tabular-nums;
}

.customer-overview-table .money-cell {
  padding-right: 12px;
  text-align: right !important;
}

.customer-overview-table .money-value {
  color: #6e431d;
  font-weight: 850;
}

.customer-overview-table .locked-cell,
.customer-overview-table .locked-cell:hover,
.customer-overview-table .locked-cell .money-value {
  color: rgba(119, 118, 109, 0.5);
}

.customer-overview-table .locked-cell .money-value {
  font-weight: 650;
}

.customer-overview-table .intent-score-value {
  display: inline-grid;
  place-items: center;
  min-width: 34px;
  min-height: 22px;
  border: 1px solid rgba(111, 79, 48, 0.14);
  border-radius: 999px;
  background: #f8f0e4;
  color: #4b3928;
  font-weight: 800;
}

.customer-overview-table .source-pill,
.customer-overview-table .level-chip,
.customer-overview-table .status-pill,
.customer-overview-table .review-pill {
  min-height: 22px;
  border: 1px solid transparent;
  font-size: 11.5px;
  font-weight: 800;
}

.customer-overview-table .source-pill,
.customer-overview-table .level-chip,
.customer-overview-table .status-pill {
  min-width: 70px;
  padding: 0 8px;
}

.customer-overview-table .review-pill {
  display: inline-grid;
  place-items: center;
  min-width: 42px;
  padding: 0 8px;
  border-radius: 999px;
}

.customer-overview-table .review-yes {
  border-color: rgba(13, 106, 93, 0.18);
  background: #e4f1ed;
  color: #0d6a5d;
}

.customer-overview-table .review-no {
  border-color: rgba(117, 109, 96, 0.16);
  background: #f1ede5;
  color: #7a7063;
}

.customer-overview-table .level-chip.level-a {
  border-color: rgba(13, 106, 93, 0.18);
  background: #e4f1ed;
  color: #0d6a5d;
}

.customer-overview-table .level-chip.level-b {
  border-color: rgba(154, 91, 37, 0.2);
  background: #f6eadc;
  color: #8a552b;
}

.customer-overview-table .level-chip.level-c {
  border-color: rgba(47, 95, 143, 0.16);
  background: #e8eef5;
  color: #2f5f8f;
}

.customer-overview-table .level-chip:not(.level-a):not(.level-b):not(.level-c) {
  border-color: rgba(117, 109, 96, 0.16);
  background: #eee9dd;
  color: #77766d;
}

.customer-overview-table .source-chat {
  border-color: rgba(47, 95, 143, 0.14);
  background: #edf1f5;
  color: #315a7a;
}

.customer-overview-table .source-wangwang {
  border-color: rgba(154, 91, 37, 0.18);
  background: #f6eadc;
  color: #8a552b;
}

.customer-overview-table .source-matched {
  border-color: rgba(13, 106, 93, 0.16);
  background: #e4f1ed;
  color: #0d6a5d;
}

.customer-overview-table .status-pill.status-yellow,
.customer-overview-table .status-pill.status-orange {
  border-color: rgba(154, 91, 37, 0.16);
  background: #f8eed8;
  color: #7b5523;
}

.customer-overview-table .status-pill.status-purple {
  border-color: rgba(103, 66, 168, 0.14);
  background: #eee7fb;
  color: #6742a8;
}

.customer-overview-table .status-pill.status-cyan,
.customer-overview-table .status-pill.status-green {
  border-color: rgba(13, 106, 93, 0.16);
  background: #e4f1ed;
  color: #0d6a5d;
}

.customer-overview-table .status-pill.status-blue {
  border-color: rgba(47, 95, 143, 0.16);
  background: #e8eef5;
  color: #2f5f8f;
}

.customer-overview-table .status-pill.status-red {
  border-color: rgba(164, 69, 53, 0.18);
  background: #f8e7df;
  color: #a44535;
}

.customer-table-view .review-shot-wrap {
  gap: 3px;
  max-width: 100%;
}

.customer-overview-table .review-shot-empty {
  min-width: 56px;
  height: 23px;
  border-style: solid;
  font-weight: 800;
}

.customer-table-view .review-shot-pending {
  border-color: rgba(154, 91, 37, 0.24);
  background: #f8eed8;
  color: #7b5523;
}

.customer-table-view .review-shot-uninvited {
  border-color: rgba(117, 109, 96, 0.16);
  background: #f1ede5;
  color: #8a8174;
  font-weight: 700;
}

.customer-table-view .review-shot-badge {
  display: inline-grid;
  place-items: center;
  min-width: 31px;
  height: 21px;
  border: 1px solid rgba(13, 106, 93, 0.18);
  border-radius: 999px;
  background: #e4f1ed;
  color: #0d6a5d;
  font-size: 10.5px;
  font-weight: 850;
  line-height: 1;
  white-space: nowrap;
}

.customer-overview-table .review-shot-thumb {
  width: 34px;
  height: 24px;
  border-color: rgba(13, 106, 93, 0.22);
  border-radius: 6px;
}

.customer-table-view .review-shot-remove {
  width: 18px;
  height: 18px;
  min-height: 18px;
  font-size: 13px;
}

.customer-overview-table .editable-cell:hover {
  color: #6e4b2f;
}

.customer-overview-table .editable-cell.locked-cell,
.customer-overview-table .editable-cell.locked-cell:hover,
.customer-overview-table .editable-cell.locked-cell .money-value {
  color: rgba(119, 118, 109, 0.5);
}

.customer-overview-table .copy-id-button:hover {
  color: #6e4b2f;
  background: rgba(111, 79, 48, 0.08);
}

.customer-card-detail {
  position: sticky;
  left: 0;
  box-sizing: border-box;
  width: calc(100vw - 42px);
  max-width: calc(100vw - 42px);
  grid-template-columns: minmax(0, 1fr) 128px;
  grid-template-rows: auto;
  gap: 10px;
  margin: -1px 0 8px;
  padding: 11px 12px 12px;
  border-color: rgba(111, 79, 48, 0.18);
  border-top-color: rgba(65, 49, 32, 0.1);
  border-radius: 0 0 10px 10px;
  background: #fff3dd;
}

.customer-detail-content {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
  grid-column: 1;
  grid-row: 1;
}

.expanded-order-ledger,
.expanded-insight-panel {
  border: 1px solid rgba(65, 49, 32, 0.13);
  border-radius: 8px;
  background: #fffefa;
}

.expanded-order-ledger {
  min-height: 154px;
  padding: 9px 10px 10px;
}

.expanded-insight-panel {
  grid-template-rows: auto repeat(3, minmax(0, 1fr));
  min-height: 154px;
  padding: 9px 10px 10px;
  gap: 7px;
}

.expanded-panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 7px;
  border-bottom: 1px solid rgba(65, 49, 32, 0.1);
}

.expanded-panel-heading strong {
  color: #2d2118;
  font-size: 12.5px;
  font-weight: 850;
}

.expanded-panel-heading span {
  color: #8a8174;
  font-size: 11px;
  white-space: nowrap;
}

.expanded-insight-item {
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 5px 10px;
  padding: 1px 0;
}

.expanded-insight-item + .expanded-insight-item {
  border-top: 1px solid rgba(65, 49, 32, 0.08);
  padding-top: 7px;
}

.expanded-insight-item span,
.expanded-order-table th {
  color: #746959;
  font-size: 11.5px;
  font-weight: 750;
}

.expanded-insight-item p {
  color: #312820;
  font-size: 12px;
  line-height: 1.65;
}

.expanded-order-table {
  font-size: 11.5px;
}

.expanded-order-table th,
.expanded-order-table td {
  height: 27px;
  padding: 3px 5px;
  border-bottom-color: rgba(65, 49, 32, 0.1);
}

.expanded-order-table th {
  height: 25px;
  background: #f7f0e6;
  border-bottom-color: rgba(65, 49, 32, 0.18);
}

.expanded-order-table .ledger-order-no,
.expanded-order-table .ledger-refund-no {
  font-family: "SFMono-Regular", Consolas, monospace;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0;
  text-align: left;
}

.expanded-order-table .ledger-order-no {
  min-width: 142px;
  max-width: 168px;
}

.expanded-order-table .ledger-refund-no {
  min-width: 118px;
  max-width: 154px;
}

.expanded-order-table th:nth-child(4),
.expanded-order-table th:nth-child(5),
.expanded-order-table th:nth-child(7),
.expanded-order-table .ledger-money,
.expanded-order-table .ledger-final {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.expanded-order-table .ledger-final {
  color: #4a2f18;
  font-weight: 850;
}

.expanded-order-table .ledger-refund {
  color: #9b4d2f;
}

.expanded-order-table .ledger-yes {
  color: #0d6a5d;
}

.expanded-order-table .ledger-no,
.expanded-order-table .ledger-zero {
  color: #a44535;
}

.expanded-order-table th:nth-child(8),
.expanded-order-table th:nth-child(9),
.expanded-order-table .ledger-outcome,
.expanded-order-table .ledger-conversion {
  color: #8a8174;
  font-weight: 650;
}

.expanded-order-table .ledger-outcome.ledger-yes,
.expanded-order-table .ledger-conversion.ledger-yes {
  color: #54746d;
}

.expanded-order-table .ledger-outcome.ledger-no,
.expanded-order-table .ledger-conversion.ledger-zero {
  color: #9b7a6d;
}

.expanded-order-empty {
  min-height: 104px;
  border: 1px dashed rgba(111, 79, 48, 0.16);
  border-radius: 7px;
  background: #fffaf1;
}

.customer-table-actions {
  grid-column: 2;
  grid-row: 1;
  align-content: center;
  align-self: stretch;
  gap: 8px;
  min-width: 128px;
}

.customer-card-detail .customer-detail-action,
.customer-card-detail .customer-delete-action {
  min-width: 118px;
  min-height: 36px;
  border-radius: 7px;
  box-shadow: none;
}

.customer-card-detail .customer-detail-action:hover,
.customer-card-detail .customer-detail-action:focus-visible,
.customer-card-detail .customer-delete-action:hover,
.customer-card-detail .customer-delete-action:focus-visible {
  transform: none;
  box-shadow: none;
}

.customer-card-detail .customer-view-action {
  border-color: #2d2118;
  background: #2d2118;
  color: #fff;
}

.customer-card-detail .customer-deal-action {
  border-color: rgba(13, 106, 93, 0.2);
  background: #0d6a5d;
  color: #fff;
}

.customer-card-detail .customer-soft-project-action:not(:disabled) {
  border-color: rgba(49, 90, 122, 0.22);
  background: #315a7a;
  color: #fff;
}

.customer-card-detail .protected-delete-action {
  border-color: rgba(164, 69, 53, 0.2);
  background: #fff7f2;
  color: #a44535;
}

.customer-card-detail .protected-delete-action:hover,
.customer-card-detail .protected-delete-action:focus-visible {
  border-color: #a44535;
  background: #a44535;
  color: #fff;
}

.expanded-insight-panel {
  grid-template-rows: auto repeat(3, minmax(0, 1fr)) auto;
}

.expanded-close-loop {
  padding-top: 7px;
  border-top: 1px solid rgba(65, 49, 32, 0.08);
}

.expanded-close-loop .close-loop-items,
.modal-close-loop-list .close-loop-items {
  grid-template-columns: minmax(0, 1fr);
}

.expanded-close-loop .close-loop-item,
.modal-close-loop-list .close-loop-item {
  min-height: 34px;
  padding: 6px 7px;
}

.expanded-close-loop .close-loop-main span,
.modal-close-loop-list .close-loop-main span {
  white-space: normal;
}

.modal-close-loop-group {
  border-color: rgba(13, 106, 93, 0.22);
  background: linear-gradient(180deg, rgba(255, 255, 252, 0.90), rgba(238, 248, 245, 0.66));
}

.modal-close-loop-list {
  padding: 8px;
}

@media (max-width: 1440px) {
  .customer-overview-table th,
  .customer-overview-table td {
    padding: 7px 6px;
  }

  .expanded-order-table {
    width: 100%;
    table-layout: fixed;
  }

  .expanded-order-table th,
  .expanded-order-table td {
    white-space: normal;
  }

  .expanded-order-table .ledger-order-no,
  .expanded-order-table .ledger-refund-no {
    min-width: 0;
    max-width: none;
    overflow-wrap: anywhere;
  }

  .expanded-order-table .ledger-risk-cell {
    min-width: 0;
    max-width: none;
  }

  .customer-card-detail {
    grid-template-columns: minmax(0, 1fr) 118px;
    grid-template-rows: auto;
    gap: 9px 10px;
    padding: 10px;
  }

  .customer-table-actions {
    min-width: 118px;
    grid-column: 2;
    grid-row: 1;
  }

  .customer-card-detail .customer-detail-action,
  .customer-card-detail .customer-delete-action {
    min-width: 108px;
  }
}

@media (max-width: 1180px) {
  .customer-table-toolbar {
    flex-wrap: wrap;
  }

  .customer-table-search {
    max-width: none;
  }

  .customer-overview-table th,
  .customer-overview-table td {
    padding: 6px 5px;
  }

  .customer-card-detail {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
  }

  .customer-detail-content {
    grid-column: 1;
    grid-row: auto;
  }

  .customer-table-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    align-self: stretch;
    grid-column: 1;
    grid-row: auto;
  }
}

@media (max-width: 720px) {
  .customer-quick-time,
  .customer-table-search,
  .customer-clear-filters {
    width: 100%;
  }

  .customer-quick-time {
    align-items: flex-start;
    flex-direction: column;
  }

  .customer-quick-time .period-tabs {
    width: 100%;
  }

  .customer-quick-time .period-tabs button {
    padding: 0 6px;
  }

  .customer-table-search {
    min-width: 0;
    flex-basis: 100%;
  }

  .customer-header-date-range,
  .customer-header-sort-choice {
    grid-template-columns: 1fr;
  }
}
/* CRM responsive closure: dense tables may scroll inside their shell, while
   page chrome and expanded customer content adapt without horizontal scrolling. */
@media (max-width: 1180px) {
  .workbench-controls {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .workbench-controls > * {
    min-width: 0;
    width: 100%;
  }

  .filter-grid,
  .outreach-filter-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .outreach-filter-grid .product-id-field {
    grid-column: auto;
  }

  .level-chart-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .expanded-order-ledger {
    min-height: 0;
    overflow: visible;
  }

  .expanded-order-table {
    display: block;
    width: 100%;
  }

  .expanded-order-table thead {
    display: none;
  }

  .expanded-order-table tbody {
    display: grid;
    gap: 8px;
  }

  .expanded-order-table tbody tr {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0 12px;
    padding: 7px 9px;
    border: 1px solid rgba(65, 49, 32, 0.12);
    border-radius: 7px;
    background: rgba(255, 255, 252, 0.82);
  }

  .customer-overview-table .expanded-order-table tbody td {
    width: auto;
    min-width: 0;
    max-width: none;
    display: grid;
    grid-template-columns: 68px minmax(0, 1fr);
    gap: 7px;
    align-items: start;
    padding: 5px 0;
    border: 0;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .expanded-order-table tbody td::before {
    color: var(--muted);
    font-size: 11px;
    font-weight: 500;
  }

  .expanded-order-table tbody td:nth-child(1)::before { content: "付款日期"; }
  .expanded-order-table tbody td:nth-child(2)::before { content: "订单编号"; }
  .expanded-order-table tbody td:nth-child(3)::before { content: "重拍原单"; }
  .expanded-order-table tbody td:nth-child(4)::before { content: "实付金额"; }
  .expanded-order-table tbody td:nth-child(5)::before { content: "退款金额"; }
  .expanded-order-table tbody td:nth-child(6)::before { content: "退款编号"; }
  .expanded-order-table tbody td:nth-child(7)::before { content: "净成交"; }
  .expanded-order-table tbody td:nth-child(8)::before { content: "有效成交"; }
  .expanded-order-table tbody td:nth-child(9)::before { content: "转化"; }
  .expanded-order-table tbody td:nth-child(10)::before { content: "归属客服"; }
  .expanded-order-table tbody td:nth-child(11)::before { content: "口径/风险"; }
}

@media (max-width: 860px) {
  .app:not(.table-mode):not(.dashboard-mode) {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "header"
      "stage";
  }

  .app:not(.table-mode):not(.dashboard-mode) .left-rail,
  .app:not(.table-mode):not(.dashboard-mode) .right-rail {
    display: none;
  }

  .workspace {
    grid-template-columns: minmax(0, 1fr);
  }

  .kpi-grid,
  .deal-order-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .workbench-controls > :last-child {
    grid-column: 1 / -1;
  }

  .expanded-order-table tbody tr {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .app-header {
    grid-template-columns: minmax(0, 1fr);
    gap: 7px;
    padding: 8px;
  }

  .brand,
  .view-tabs,
  .global-search,
  .header-actions {
    grid-column: 1;
    width: 100%;
  }

  .view-tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    overflow: visible;
  }

  .view-tabs button {
    width: 100%;
    min-width: 0;
  }

  .header-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    overflow: visible;
  }

  .header-actions .preview-copy-pill,
  .header-actions .user-badge {
    grid-column: 1 / -1;
    width: 100%;
    max-width: none;
    min-width: 0;
  }

  .header-actions button {
    width: 100%;
    min-width: 0;
  }

  .deal-order-topbar {
    align-items: stretch;
    flex-wrap: wrap;
    gap: 10px;
    padding: 10px 12px;
  }

  .deal-order-topbar h2 {
    width: 100%;
  }

  .deal-order-kpi-bar {
    flex: 1 1 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px 12px;
  }

  .deal-order-actions {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .deal-order-actions > span {
    grid-column: 1 / -1;
  }

  .deal-order-actions button {
    width: 100%;
    min-width: 0;
  }

  .deal-order-filter-compact {
    padding: 8px 12px;
  }

  .deal-order-search-input {
    flex: 1 1 100%;
    width: 100%;
  }

  .app.table-mode .stage,
  .app.dashboard-mode .stage,
  .stage {
    padding: 6px;
  }

  .workbench-hero,
  .today-command,
  .dashboard-panel {
    padding: 12px;
  }

  .workbench-controls,
  .filter-grid,
  .outreach-filter-grid,
  .deal-order-policy-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .kpi-grid,
  .deal-order-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .customer-table-toolbar {
    align-items: stretch;
  }

  .customer-table-toolbar > *,
  .customer-table-search,
  .customer-quick-time,
  .customer-clear-filters {
    max-width: none;
  }

  .customer-table-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }

  .customer-card-detail .customer-detail-action,
  .customer-card-detail .customer-delete-action {
    width: 100%;
    min-width: 0;
  }

  .expanded-order-table tbody tr {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 420px) {
  .deal-order-summary-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .customer-table-actions {
    grid-template-columns: minmax(0, 1fr);
  }

  .expanded-order-table tbody td {
    grid-template-columns: 72px minmax(0, 1fr);
  }
}

/* ===== 客服在线状态条（采集器心跳）===== */
.online-staff-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.online-staff-label {
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.online-staff-list {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.online-staff-hint {
  font-size: 12px;
  color: var(--muted);
}

.staff-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px 3px 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--paper-solid);
  font-size: 12px;
  line-height: 1.4;
  color: var(--ink);
  cursor: default;
}

.staff-chip-name {
  white-space: nowrap;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.status-dot.online {
  background: #0d6a5d;
  box-shadow: 0 0 0 0 rgba(13, 106, 93, 0.4);
  animation: statusPulse 1.8s ease-out infinite;
}

.status-dot.warning {
  background: #d97706;
  box-shadow: 0 0 0 0 rgba(217, 119, 6, 0.4);
  animation: statusPulse 1.8s ease-out infinite;
}

.status-dot.offline {
  background: #b8b6ad;
}

.status-dot.danger {
  background: #dc2626;
  box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.5);
  animation: statusPulseDanger 1.2s ease-out infinite;
}

.staff-chip.danger {
  border-color: rgba(220, 38, 38, 0.35);
  background: rgba(220, 38, 38, 0.06);
}

@keyframes statusPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(13, 106, 93, 0.4);
  }
  70% {
    box-shadow: 0 0 0 6px rgba(13, 106, 93, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(13, 106, 93, 0);
  }
}

@keyframes statusPulseDanger {
  0% {
    box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.5);
  }
  70% {
    box-shadow: 0 0 0 6px rgba(220, 38, 38, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(220, 38, 38, 0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .status-dot.online,
  .status-dot.warning,
  .status-dot.danger {
    animation: none;
  }
}

/* ===== AI 客服训练中心 ===== */
/* 强制 hidden 属性生效（防止其他 display 规则覆盖） */
[hidden] { display: none !important; }

/* ═══════════════════════════════════════════════════════════════
   AI 训练中心 — 黑色科技极简风格
   与订单数据中控面板 (localhost:3103) 风格统一
   ═══════════════════════════════════════════════════════════════ */

/* ── 设计变量 ── */
:root {
  --ai-bg: #05070b;
  --ai-surface: rgba(10,14,22,0.85);
  --ai-surface-hover: rgba(14,18,28,0.95);
  --ai-border: rgba(255,255,255,0.05);
  --ai-border-hover: rgba(56,189,248,0.25);
  --ai-text: #e8eaed;
  --ai-text-secondary: #8893a4;
  --ai-text-muted: #4a5568;
  --ai-accent: #38bdf8;
  --ai-accent-glow: rgba(56,189,248,0.4);
  --ai-accent2: #818cf8;
  --ai-accent2-glow: rgba(129,140,248,0.4);
  --ai-green: #22c55e;
  --ai-green-glow: rgba(34,197,94,0.4);
  --ai-red: #f87171;
  --ai-red-glow: rgba(248,113,113,0.4);
  --ai-amber: #f59e0b;
  --ai-amber-glow: rgba(245,158,11,0.4);
  --ai-radius: 10px;
  --ai-transition: 0.3s cubic-bezier(0.4,0,0.2,1);
}

/* ── 主容器 ── */
.ai-training-view {
  position: fixed;
  top: 56px;
  left: 0;
  right: 0;
  bottom: 0;
  overflow: hidden;
  z-index: 100;
  background: var(--ai-bg);
  padding: 0;
  color: var(--ai-text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  font-size: 13px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* 背景微光 */
.ai-training-view::before {
  content: '';
  position: fixed;
  top: 56px; left: 0; width: 100%; height: calc(100% - 56px);
  background:
    radial-gradient(ellipse 80% 60% at 10% 20%, rgba(56,189,248,0.02) 0%, transparent 50%),
    radial-gradient(ellipse 60% 80% at 85% 75%, rgba(129,140,248,0.02) 0%, transparent 50%),
    radial-gradient(ellipse 50% 50% at 50% 50%, rgba(167,139,250,0.015) 0%, transparent 60%);
  animation: aiAmbientFlow 12s ease-in-out infinite;
  pointer-events: none;
  z-index: 0;
}
@keyframes aiAmbientFlow {
  0%,100% { opacity: .6 }
  25% { opacity: 1 }
  50% { opacity: .7 }
  75% { opacity: .9 }
}

.ai-training-layout {
  display: flex;
  gap: 0;
  height: 100%;
  position: relative;
  z-index: 1;
}

/* ── 左侧导航 ── */
.ai-training-nav {
  width: 200px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 20px 12px;
  border-right: 1px solid var(--ai-border);
  background: rgba(8,10,16,0.6);
  backdrop-filter: blur(20px);
  overflow-y: auto;
}

.ai-nav-header {
  padding: 0 12px 20px;
  border-bottom: 1px solid var(--ai-border);
  margin-bottom: 16px;
}
.ai-nav-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--ai-text);
  letter-spacing: 0.5px;
}

.ai-nav-section {
  margin-bottom: 16px;
}
.ai-nav-label {
  padding: 0 12px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--ai-text-muted);
  margin-bottom: 6px;
}

.ai-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 12px;
  border: none;
  background: none;
  cursor: pointer;
  font-size: 13px;
  color: var(--ai-text-secondary);
  border-radius: 8px;
  text-align: left;
  transition: all var(--ai-transition);
  position: relative;
}
.ai-nav-item:hover {
  background: rgba(255,255,255,0.03);
  color: var(--ai-text);
}
.ai-nav-item.active {
  background: rgba(56,189,248,0.08);
  color: var(--ai-accent);
}
.ai-nav-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 16px;
  background: var(--ai-accent);
  border-radius: 0 2px 2px 0;
  box-shadow: 0 0 8px var(--ai-accent-glow);
}

.ai-nav-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  opacity: 0.7;
}
.ai-nav-item.active .ai-nav-icon {
  opacity: 1;
}

.ai-category-nav {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding-left: 38px;
  margin-top: 2px;
}
.ai-cat-item {
  padding: 5px 10px;
  border: none;
  background: none;
  cursor: pointer;
  font-size: 12px;
  color: var(--ai-text-muted);
  border-radius: 6px;
  text-align: left;
  transition: all var(--ai-transition);
}
.ai-cat-item:hover {
  background: rgba(255,255,255,0.03);
  color: var(--ai-text-secondary);
}
.ai-cat-item.active {
  color: var(--ai-accent);
  font-weight: 500;
}

/* ── 右侧内容 ── */
.ai-training-content {
  flex: 1;
  min-width: 0;
  padding: 24px 28px;
  overflow-y: auto;
}

.ai-panel { display: none; }
.ai-panel.active { display: block; animation: aiPanelFadeIn 0.3s ease-out; }
@keyframes aiPanelFadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* 面板头部 */
.ai-panel-header {
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--ai-border);
}
.ai-panel-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--ai-text);
  margin-bottom: 4px;
  letter-spacing: 0.3px;
}
.ai-panel-desc {
  font-size: 13px;
  color: var(--ai-text-muted);
}

/* 工具栏 */
.ai-panel-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.ai-toolbar-actions {
  margin-left: auto;
  display: flex;
  gap: 8px;
}

/* 搜索框 */
.ai-search-wrap {
  flex: 1;
  min-width: 200px;
  position: relative;
  display: flex;
  align-items: center;
}
.ai-search-icon {
  position: absolute;
  left: 12px;
  width: 16px;
  height: 16px;
  color: var(--ai-text-muted);
  pointer-events: none;
}
.ai-search-input {
  width: 100%;
  padding: 9px 12px 9px 36px;
  border: 1px solid var(--ai-border);
  border-radius: var(--ai-radius);
  font-size: 13px;
  background: var(--ai-surface);
  color: var(--ai-text);
  outline: none;
  transition: all var(--ai-transition);
}
.ai-search-input::placeholder { color: var(--ai-text-muted); }
.ai-search-input:focus {
  border-color: var(--ai-border-hover);
  box-shadow: 0 0 0 3px rgba(56,189,248,0.08);
}

/* 下拉选择 */
.ai-filter-select {
  padding: 9px 12px;
  border: 1px solid var(--ai-border);
  border-radius: var(--ai-radius);
  font-size: 12px;
  background: var(--ai-surface);
  color: var(--ai-text);
  outline: none;
  cursor: pointer;
  transition: all var(--ai-transition);
  appearance: none;
  -webkit-appearance: none;
  padding-right: 28px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238893a4' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
}
.ai-filter-select:focus {
  border-color: var(--ai-border-hover);
  box-shadow: 0 0 0 3px rgba(56,189,248,0.08);
}
.ai-filter-select option {
  background: #0d1117;
  color: var(--ai-text);
}

/* ── 按钮 ── */
.ai-btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  border: 1px solid rgba(56,189,248,0.3);
  border-radius: var(--ai-radius);
  font-size: 13px;
  font-weight: 500;
  background: rgba(56,189,248,0.1);
  color: var(--ai-accent);
  cursor: pointer;
  transition: all var(--ai-transition);
  white-space: nowrap;
}
.ai-btn-primary:hover {
  background: rgba(56,189,248,0.2);
  border-color: rgba(56,189,248,0.5);
  box-shadow: 0 0 20px rgba(56,189,248,0.15);
  transform: translateY(-1px);
}
.ai-btn-primary:active {
  transform: translateY(0);
}

.ai-btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  border: 1px solid var(--ai-border);
  border-radius: var(--ai-radius);
  font-size: 13px;
  font-weight: 500;
  background: transparent;
  color: var(--ai-text-secondary);
  cursor: pointer;
  transition: all var(--ai-transition);
  white-space: nowrap;
}
.ai-btn-secondary:hover {
  background: rgba(255,255,255,0.03);
  border-color: rgba(255,255,255,0.1);
  color: var(--ai-text);
}

/* ── 知识卡列表 ── */
.ai-card-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ai-card {
  border: 1px solid var(--ai-border);
  border-radius: var(--ai-radius);
  padding: 16px 18px;
  background: var(--ai-surface);
  transition: all var(--ai-transition);
  animation: aiCardFadeIn 0.3s ease-out;
}
@keyframes aiCardFadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}
.ai-card:hover {
  border-color: var(--ai-border-hover);
  background: var(--ai-surface-hover);
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}
.ai-card.enabled {
  border-left: 3px solid var(--ai-green);
}
.ai-card.selected {
  background: rgba(56,189,248,0.06);
  border-color: rgba(56,189,248,0.3);
}

.ai-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}
.ai-card-header strong {
  font-size: 14px;
  color: var(--ai-text);
  font-weight: 600;
}

.ai-card-tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  background: rgba(129,140,248,0.1);
  color: var(--ai-accent2);
  border: 1px solid rgba(129,140,248,0.15);
}

.ai-card-actions {
  margin-left: auto;
  display: flex;
  gap: 6px;
  align-items: center;
}

.ai-card-body {
  font-size: 13px;
  color: var(--ai-text-secondary);
  line-height: 1.7;
}
.ai-card-line { margin-bottom: 4px; }
.ai-line-label { color: var(--ai-text-muted); }

.ai-card-meta {
  margin-top: 10px;
  font-size: 11px;
  color: var(--ai-text-muted);
  padding-top: 8px;
  border-top: 1px solid rgba(255,255,255,0.03);
}

/* ── 徽章 ── */
.ai-badge {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  background: var(--ai-red);
  color: #fff;
  margin-left: auto;
  box-shadow: 0 0 8px var(--ai-red-glow);
}

.ai-badge-sm {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 500;
}
.badge-yellow { background: rgba(245,158,11,0.12); color: var(--ai-amber); border: 1px solid rgba(245,158,11,0.2); }
.badge-green { background: rgba(34,197,94,0.12); color: var(--ai-green); border: 1px solid rgba(34,197,94,0.2); }
.badge-red { background: rgba(248,113,113,0.12); color: var(--ai-red); border: 1px solid rgba(248,113,113,0.2); }
.badge-blue { background: rgba(56,189,248,0.12); color: var(--ai-accent); border: 1px solid rgba(56,189,248,0.2); }

/* ── 小按钮 ── */
.ai-btn-sm {
  padding: 4px 12px;
  border: 1px solid var(--ai-border);
  border-radius: 6px;
  font-size: 12px;
  background: transparent;
  color: var(--ai-text-secondary);
  cursor: pointer;
  transition: all var(--ai-transition);
}
.ai-btn-sm:hover {
  background: rgba(255,255,255,0.03);
  border-color: rgba(255,255,255,0.1);
  color: var(--ai-text);
}
.ai-btn-green { border-color: rgba(34,197,94,0.3); color: var(--ai-green); }
.ai-btn-green:hover { background: rgba(34,197,94,0.08); border-color: rgba(34,197,94,0.5); }
.ai-btn-red { border-color: rgba(248,113,113,0.3); color: var(--ai-red); }
.ai-btn-red:hover { background: rgba(248,113,113,0.08); border-color: rgba(248,113,113,0.5); }

/* ── 空状态/加载/错误 ── */
.ai-empty, .ai-loading, .ai-error {
  padding: 48px 32px;
  text-align: center;
  color: var(--ai-text-muted);
  font-size: 14px;
}
.ai-error { color: var(--ai-red); }

/* ── 弹窗 ── */
.ai-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ai-modal[hidden] { display: none; }

.ai-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  animation: aiModalFadeIn 0.2s ease-out;
}
@keyframes aiModalFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.ai-modal-body {
  position: relative;
  background: #0d1117;
  border: 1px solid var(--ai-border);
  border-radius: 14px;
  width: 620px;
  max-width: 90vw;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 24px 80px rgba(0,0,0,0.5), 0 0 0 1px rgba(255,255,255,0.03);
  animation: aiModalSlideUp 0.3s ease-out;
}
@keyframes aiModalSlideUp {
  from { opacity: 0; transform: translateY(20px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.ai-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  border-bottom: 1px solid var(--ai-border);
}
.ai-modal-header h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--ai-text);
}

.ai-modal-close {
  border: none;
  background: none;
  font-size: 22px;
  cursor: pointer;
  color: var(--ai-text-muted);
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: all var(--ai-transition);
}
.ai-modal-close:hover {
  background: rgba(255,255,255,0.05);
  color: var(--ai-text);
}

.ai-modal-form {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.ai-modal-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: var(--ai-text-secondary);
}
.ai-modal-form label span {
  font-weight: 500;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--ai-text-muted);
}
.ai-modal-form input,
.ai-modal-form textarea,
.ai-modal-form select {
  padding: 9px 12px;
  border: 1px solid var(--ai-border);
  border-radius: 8px;
  font-size: 13px;
  font-family: inherit;
  background: rgba(255,255,255,0.03);
  color: var(--ai-text);
  outline: none;
  transition: all var(--ai-transition);
}
.ai-modal-form input:focus,
.ai-modal-form textarea:focus,
.ai-modal-form select:focus {
  border-color: var(--ai-border-hover);
  box-shadow: 0 0 0 3px rgba(56,189,248,0.08);
}
.ai-modal-form textarea { resize: vertical; }
.ai-modal-form select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 28px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238893a4' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
}
.ai-modal-form select option {
  background: #0d1117;
  color: var(--ai-text);
}

.ai-checkbox-label {
  flex-direction: row;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}
.ai-checkbox-label input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--ai-accent);
}

.ai-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 24px;
  border-top: 1px solid var(--ai-border);
}

/* ── 标签多选 ── */
.ai-tags-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.ai-tag-option {
  display: inline-flex;
  align-items: center;
  padding: 6px 16px;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.2px;
  cursor: pointer;
  color: var(--ai-text-muted);
  background: transparent;
  transition: all 0.25s cubic-bezier(0.4,0,0.2,1);
  position: relative;
  user-select: none;
}
.ai-tag-option:hover {
  border-color: rgba(56,189,248,0.35);
  color: var(--ai-text);
  transform: translateY(-1px);
}
.ai-tag-option input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}
.ai-tag-option:has(input:checked) {
  background: var(--ai-accent);
  border-color: var(--ai-accent);
  color: #05070b;
  font-weight: 600;
  box-shadow: 0 2px 16px rgba(56,189,248,0.35);
}
.ai-tag-option:has(input:checked):hover {
  box-shadow: 0 4px 20px rgba(56,189,248,0.45);
}

/* ── 学习中心 ── */
.ai-learn-section {
  margin-bottom: 20px;
}
.ai-learn-section h3 {
  font-size: 15px;
  font-weight: 600;
  color: var(--ai-text);
  margin-bottom: 12px;
}

.ai-learn-card {
  display: flex;
  gap: 16px;
  padding: 20px;
  border: 1px solid var(--ai-border);
  border-radius: var(--ai-radius);
  background: var(--ai-surface);
  transition: all var(--ai-transition);
}
.ai-learn-card:hover {
  border-color: var(--ai-border-hover);
  box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}

.ai-learn-card-icon {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: rgba(56,189,248,0.08);
  border: 1px solid rgba(56,189,248,0.15);
}
.ai-learn-card-icon svg {
  width: 22px;
  height: 22px;
  color: var(--ai-accent);
}

.ai-learn-card-content {
  flex: 1;
}
.ai-learn-card-content h3 {
  font-size: 14px;
  font-weight: 600;
  color: var(--ai-text);
  margin-bottom: 4px;
}

.ai-muted { color: var(--ai-text-muted); font-size: 13px; }

.ai-learn-form {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: 12px;
  flex-wrap: wrap;
}

.ai-date-input {
  padding: 9px 12px;
  border: 1px solid var(--ai-border);
  border-radius: 8px;
  font-size: 13px;
  background: var(--ai-surface);
  color: var(--ai-text);
  outline: none;
  transition: all var(--ai-transition);
  color-scheme: dark;
}
.ai-date-input:focus {
  border-color: var(--ai-border-hover);
  box-shadow: 0 0 0 3px rgba(56,189,248,0.08);
}

.ai-file-input {
  flex: 1;
  font-size: 12px;
  color: var(--ai-text-secondary);
}
.ai-file-input::file-selector-button {
  padding: 8px 14px;
  border: 1px solid var(--ai-border);
  border-radius: 6px;
  font-size: 12px;
  background: transparent;
  color: var(--ai-text-secondary);
  cursor: pointer;
  margin-right: 10px;
  transition: all var(--ai-transition);
}
.ai-file-input::file-selector-button:hover {
  background: rgba(255,255,255,0.03);
  border-color: rgba(255,255,255,0.1);
}

.ai-jobs-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ai-job-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border: 1px solid var(--ai-border);
  border-radius: 8px;
  font-size: 13px;
  flex-wrap: wrap;
  background: var(--ai-surface);
  transition: all var(--ai-transition);
  animation: aiCardFadeIn 0.3s ease-out;
}
.ai-job-item:hover {
  border-color: var(--ai-border-hover);
}

/* ── 全局设置 ── */
.ai-settings-form {
  max-width: 560px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.ai-settings-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: var(--ai-text-secondary);
}
.ai-settings-form label span {
  font-weight: 500;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--ai-text-muted);
}
.ai-settings-form input,
.ai-settings-form textarea {
  padding: 9px 12px;
  border: 1px solid var(--ai-border);
  border-radius: 8px;
  font-size: 13px;
  font-family: inherit;
  background: var(--ai-surface);
  color: var(--ai-text);
  outline: none;
  transition: all var(--ai-transition);
}
.ai-settings-form input:focus,
.ai-settings-form textarea:focus {
  border-color: var(--ai-border-hover);
  box-shadow: 0 0 0 3px rgba(56,189,248,0.08);
}
.ai-settings-form textarea { resize: vertical; }
.ai-settings-actions { margin-top: 8px; }

/* ── 统计 ── */
.ai-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 24px;
}
.ai-stat-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 24px 16px;
  border: 1px solid var(--ai-border);
  border-radius: var(--ai-radius);
  background: var(--ai-surface);
  transition: all var(--ai-transition);
}
.ai-stat-card:hover {
  border-color: var(--ai-border-hover);
  box-shadow: 0 4px 20px rgba(0,0,0,0.2);
  transform: translateY(-2px);
}
.ai-stat-card strong {
  font-size: 32px;
  font-weight: 700;
  color: var(--ai-accent);
  line-height: 1.2;
  text-shadow: 0 0 20px var(--ai-accent-glow);
}
.ai-stat-card span {
  font-size: 12px;
  color: var(--ai-text-muted);
  margin-top: 6px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.ai-stat-row {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--ai-border);
  font-size: 14px;
  color: var(--ai-text-secondary);
}
.ai-stat-row strong { color: var(--ai-text); }

/* ── 分类管理 ── */
.ai-category-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ai-cat-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border: 1px solid var(--ai-border);
  border-radius: 8px;
  font-size: 13px;
  background: var(--ai-surface);
  transition: all var(--ai-transition);
  animation: aiCardFadeIn 0.3s ease-out;
}
.ai-cat-row:hover {
  border-color: var(--ai-border-hover);
}
.ai-cat-key {
  font-family: "SF Mono", "Fira Code", monospace;
  color: var(--ai-text-muted);
  font-size: 12px;
}
.ai-cat-label { font-weight: 600; color: var(--ai-text); }

/* ── Toast ── */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  padding: 12px 20px;
  border-radius: 10px;
  background: #0d1117;
  border: 1px solid var(--ai-border);
  color: var(--ai-text);
  font-size: 13px;
  z-index: 9999;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
  animation: aiToastIn 0.3s ease-out;
}
@keyframes aiToastIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ── 滚动条 ── */
.ai-training-view::-webkit-scrollbar,
.ai-training-content::-webkit-scrollbar,
.ai-training-nav::-webkit-scrollbar,
.ai-modal-body::-webkit-scrollbar {
  width: 6px;
}
.ai-training-view::-webkit-scrollbar-track,
.ai-training-content::-webkit-scrollbar-track,
.ai-training-nav::-webkit-scrollbar-track,
.ai-modal-body::-webkit-scrollbar-track {
  background: transparent;
}
.ai-training-view::-webkit-scrollbar-thumb,
.ai-training-content::-webkit-scrollbar-thumb,
.ai-training-nav::-webkit-scrollbar-thumb,
.ai-modal-body::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.08);
  border-radius: 3px;
}
.ai-training-view::-webkit-scrollbar-thumb:hover,
.ai-training-content::-webkit-scrollbar-thumb:hover,
.ai-training-nav::-webkit-scrollbar-thumb:hover,
.ai-modal-body::-webkit-scrollbar-thumb:hover {
  background: rgba(255,255,255,0.15);
}
