:root {
  --theme-accent: #3a84f7;
  --theme-accent-2: #67a9ff;
  --theme-accent-strong: #2f6fd4;
  --theme-accent-soft: #ebf4ff;

  --theme-text: #1f3046;
  --theme-muted: #6d8098;

  --theme-bg-1: #f7fbff;
  --theme-bg-2: #eef6ff;
  --theme-surface-1: #ffffff;
  --theme-surface-2: #fafdff;

  --theme-line: #d8e6f3;
  --theme-line-strong: #bfd5ea;
  --theme-focus: #8cb8ff;

  --theme-row-hover: #edf5ff;
  --theme-row-active: #e3efff;
  --theme-row-stripe: #f8fbff;

  --ok: #1e8a60;
  --warn: #a0641f;
  --danger: #b74545;

  --radius-lg: 14px;
  --radius-md: 10px;
  --radius-sm: 8px;

  --shadow-lg: 0 18px 42px rgba(58, 111, 172, 0.14);
  --shadow-md: 0 12px 26px rgba(58, 111, 172, 0.11);
  --shadow-sm: 0 6px 14px rgba(58, 111, 172, 0.08);

  --theme-font-body: "Geist", "Manrope", "Sora", "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  --theme-font-display: "Geist", "Space Grotesk", "Sora", "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  --theme-font-mono: "JetBrains Mono", "SFMono-Regular", "Consolas", "Menlo", monospace;
}

* {
  box-sizing: border-box;
}

*::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

*::-webkit-scrollbar-track {
  background: rgba(160, 170, 183, 0.2);
  border-radius: 999px;
}

*::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #b7c1ce 0%, #9da9ba 100%);
  border-radius: 999px;
  opacity: 0.85;
}

*::-webkit-scrollbar-thumb:hover {
  filter: brightness(0.95);
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--theme-text);
  font-family: var(--theme-font-body);
  background:
    radial-gradient(circle at 90% -10%, rgba(133, 194, 255, 0.2) 0%, transparent 38%),
    linear-gradient(156deg, var(--theme-bg-1) 0%, var(--theme-bg-2) 100%);
}

body::before {
  content: none;
}

body::after {
  content: none;
}

body.modal-open {
  overflow: hidden;
}

.hidden {
  display: none !important;
}

.bg-glow {
  display: none;
}

.bg-glow-1 {
  display: none;
}

.bg-glow-2 {
  display: none;
}

.topbar {
  max-width: 1520px;
  margin: 0 auto;
  padding: 20px 24px 14px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
}

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

.brand-lockup {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  align-items: center;
  gap: 13px;
}

.brand-mark {
  width: 52px;
  height: 52px;
  display: block;
  border-radius: 14px;
  box-shadow: 0 14px 30px rgba(15, 47, 74, 0.18);
}

.workspace-picker {
  display: grid;
  gap: 4px;
  min-width: 190px;
}

.workspace-picker span {
  color: var(--theme-muted);
  font-size: 11px;
  font-weight: 800;
}

.compact-input {
  height: 36px;
  border-radius: 10px;
  padding: 7px 10px;
}

.eyebrow {
  margin: 0;
  color: var(--theme-accent-strong);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-weight: 700;
}

h1 {
  margin: 6px 0 8px;
  font-family: var(--theme-font-display);
  font-size: 38px;
  line-height: 1.08;
  letter-spacing: 0;
  font-weight: 700;
  max-width: 860px;
  color: var(--theme-text);
}

.subtitle {
  margin: 0;
  color: var(--theme-muted);
  font-size: 14px;
  line-height: 1.62;
}

.layout {
  max-width: 1520px;
  margin: 0 auto;
  padding: 0 24px 32px;
}

.compact-layout {
  padding-bottom: 38px;
}

.panel {
  position: relative;
  overflow: hidden;
  border-radius: calc(var(--radius-lg) + 4px);
  border: 1px solid var(--theme-line);
  background: #fafdff;
  box-shadow: var(--shadow-lg);
}

.panel::before {
  content: none;
}

.workspace {
  position: relative;
  z-index: 1;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.card {
  --tone-a: var(--theme-surface-1);
  --tone-b: var(--theme-surface-2);
  --tone-accent: var(--theme-accent);
  position: relative;
  overflow: hidden;
  border: 1px solid #d6e4f2;
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, #ffffff 0%, #fafdff 100%);
  padding: 12px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.16s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  animation: none;
}

.card::before {
  content: none;
}

.card::after {
  content: "";
  position: absolute;
  right: 0;
  top: 0;
  width: 90px;
  height: 4px;
  border-radius: 0 0 0 10px;
  background: linear-gradient(90deg, rgba(58, 132, 247, 0.18) 0%, var(--tone-accent) 100%);
}

.card > * {
  position: relative;
  z-index: 1;
}

.card:hover {
  border-color: #a9c9ea;
  transform: none;
  box-shadow: 0 14px 30px rgba(73, 128, 187, 0.17);
}

.card:focus-within {
  border-color: #9ac0ea;
  box-shadow: 0 0 0 3px rgba(58, 132, 247, 0.14), 0 14px 30px rgba(73, 128, 187, 0.15);
}

.focus-card {
  --tone-a: #ffffff;
  --tone-b: #fafbfc;
  --tone-accent: var(--theme-accent);
}

.tone-overview {
  --tone-a: #ffffff;
  --tone-b: #fafbfc;
  --tone-accent: #4f8ef7;
}

.tone-risk {
  --tone-a: #ffffff;
  --tone-b: #fafbfc;
  --tone-accent: #f0a44c;
}

.tone-stage {
  --tone-a: #ffffff;
  --tone-b: #fafbfc;
  --tone-accent: #5a9ff8;
}

.tone-deal {
  --tone-a: #ffffff;
  --tone-b: #fafbfc;
  --tone-accent: #2da88f;
}

.tone-payment {
  --tone-a: #ffffff;
  --tone-b: #fafbfc;
  --tone-accent: #6a95ff;
}

.tone-level {
  --tone-a: #ffffff;
  --tone-b: #fafbfc;
  --tone-accent: #5db6d9;
}

.tone-segment {
  --tone-a: #ffffff;
  --tone-b: #fafbfc;
  --tone-accent: #3db2a4;
}

.tone-customer-board {
  --tone-a: #ffffff;
  --tone-b: #fafbfc;
  --tone-accent: #4e90f2;
}

.tone-boss-review {
  --tone-a: #ffffff;
  --tone-b: #fafbfc;
  --tone-accent: #6d7f62;
}

.tone-owner {
  --tone-a: #ffffff;
  --tone-b: #fafbfc;
  --tone-accent: #5c8ee2;
}

.tone-detail {
  --tone-a: #ffffff;
  --tone-b: #fafbfc;
  --tone-accent: #529ddd;
}

.tone-excel {
  --tone-a: #ffffff;
  --tone-b: #fafbfc;
  --tone-accent: #49a39e;
}

.tone-security {
  --tone-a: #ffffff;
  --tone-b: #fafbfc;
  --tone-accent: #8b8f63;
}

.tone-pipeline-log {
  --tone-a: #ffffff;
  --tone-b: #fafbfc;
  --tone-accent: #6c96de;
}

.tone-system-log {
  --tone-a: #ffffff;
  --tone-b: #fafbfc;
  --tone-accent: #77a2ec;
}

.login-page {
  min-height: 100vh;
}

.login-topbar {
  padding-top: 34px;
  padding-bottom: 0;
}

.login-brand h1 {
  max-width: none;
  font-size: 44px;
}

.login-layout {
  padding-top: 8px;
}

.login-shell {
  min-height: calc(100vh - 220px);
  display: grid;
  place-items: center;
  padding: 8px 0 18px;
}

.login-card {
  width: min(680px, 100%);
  border-radius: 14px;
  border: 1px solid #cedbce;
  padding: 22px 22px 18px;
  background: linear-gradient(180deg, #ffffff 0%, #f7fbf8 100%);
  box-shadow: 0 20px 42px rgba(58, 80, 66, 0.16);
}

.login-card::after {
  width: 160px;
  height: 5px;
  border-radius: 0 0 0 12px;
}

.login-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.login-subtitle {
  margin-top: 8px;
}

.login-form {
  margin-top: 14px;
}

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

.login-submit-row {
  margin-top: 12px;
}

.login-submit-row .btn {
  min-width: 128px;
}

.login-message {
  margin-top: 14px;
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 13px;
  line-height: 1.55;
  font-family: var(--theme-font-body);
}

.login-message.status-info {
  background: #f5f8fc;
  border-color: #d5e0ea;
  color: #3f596f;
}

.login-message.status-success {
  background: #f2fbf5;
  border-color: #cbe7d2;
  color: #226845;
}

.login-message.status-warn {
  background: #fff8ee;
  border-color: #ead7b2;
  color: #8c5a20;
}

.login-message.status-error {
  background: #fff3f2;
  border-color: #edc7c3;
  color: #8e3941;
}

.login-footnote {
  margin: 10px 2px 0;
  color: #708072;
  font-size: 12px;
  line-height: 1.5;
}

.login-legal-note {
  margin: 12px 2px 0;
  color: #64748b;
  font-size: 12px;
  line-height: 1.65;
}

.legal-consent-control {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
}

.legal-consent-control input {
  width: 16px;
  height: 16px;
  margin: 3px 0 0;
  accent-color: #0369a1;
}

.login-legal-note a {
  color: #0369a1;
  font-weight: 800;
  text-decoration: none;
}

.login-legal-note a:hover {
  text-decoration: underline;
}

.onboarding-public-page {
  background:
    radial-gradient(circle at 12% -16%, rgba(109, 146, 125, 0.2) 0%, transparent 38%),
    linear-gradient(156deg, var(--theme-bg-1) 0%, var(--theme-bg-2) 100%);
}

.onboarding-card {
  width: min(860px, 100%);
  animation: card-enter 0.24s ease;
}

.login-grid.single {
  grid-template-columns: 1fr;
}

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

.onboarding-step {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--theme-line);
  border-radius: 10px;
  padding: 9px 10px;
  background: #f8fbf9;
  color: var(--theme-muted);
  font-size: 13px;
  transition: border-color 0.2s ease, background-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.onboarding-step .dot {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #dbe9df;
  color: #4f6b5a;
  font-weight: 700;
  font-size: 12px;
}

.onboarding-step.active {
  border-color: #a8c1b0;
  background: #eff6f1;
  color: #2f4a3c;
  transform: translateY(-1px);
}

.onboarding-step.active .dot {
  background: var(--theme-accent);
  color: #fff;
}

.onboarding-step.done {
  border-color: #9fc5ac;
  background: #ecf7ef;
  color: #2e6649;
}

.onboarding-step.done .dot {
  background: #3c9c69;
  color: #fff;
}

.onboarding-panel {
  display: none;
  border: 1px solid #d8e3da;
  border-radius: 11px;
  padding: 12px;
  background: linear-gradient(180deg, #ffffff 0%, #f9fcfa 100%);
  animation: card-enter 0.22s ease;
}

.onboarding-panel.active {
  display: block;
}

.onboarding-panel + .onboarding-panel {
  margin-top: 10px;
}

.onboarding-code-input {
  text-transform: uppercase;
}

.onboarding-panel .login-grid {
  align-items: start;
}

.onboarding-panel .field-control {
  display: grid;
  grid-template-rows: auto minmax(40px, auto) minmax(18px, auto);
  gap: 5px;
}

.onboarding-panel .field-control small {
  min-height: 18px;
  line-height: 1.4;
}

.onboarding-panel .muted-placeholder {
  opacity: 0.45;
}

.onboarding-job-log {
  margin-top: 8px;
  border: 1px solid #d9e5dc;
  border-radius: 8px;
  padding: 8px;
  background: #fbfdfb;
  display: grid;
  gap: 4px;
  max-height: 118px;
  overflow: auto;
  font-size: 12px;
  color: #4a5f53;
}

.onboarding-auth-summary {
  margin-top: 10px;
  display: grid;
  gap: 8px;
}

.auth-screenshot-panel {
  margin-top: 14px;
  border: 1px solid #d7e3ee;
  border-radius: 8px;
  background:
    radial-gradient(circle at 20% 0%, rgba(212, 156, 83, 0.14), transparent 34%),
    linear-gradient(135deg, #f8fbff 0%, #ffffff 58%, #f9fbf7 100%);
  overflow: hidden;
  box-shadow: 0 18px 42px rgba(31, 45, 61, 0.08);
}

.auth-screenshot-head {
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid #e2e8f0;
  background: rgba(255, 255, 255, 0.82);
}

.auth-screenshot-head strong {
  color: #0f172a;
  font-size: 13px;
  font-weight: 900;
}

.auth-screenshot-head span {
  color: #64748b;
  font-size: 12px;
  line-height: 1.4;
  text-align: right;
}

.auth-screenshot-panel img {
  display: block;
  width: min(100%, 560px);
  max-height: 560px;
  margin: 0 auto;
  padding: 24px;
  object-fit: contain;
  background: transparent;
}

.auth-screenshot-panel.pending::after {
  content: "正在准备页面，请稍候...";
  display: grid;
  min-height: 220px;
  place-items: center;
  color: #64748b;
  font-size: 13px;
  background: #ffffff;
}

.onboarding-auth-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.onboarding-auth-meta .pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}

.onboarding-auth-time {
  font-size: 12px;
  color: #4e6357;
}

.onboarding-job-log-compact {
  margin-top: 0;
  max-height: none;
  min-height: 44px;
  align-content: center;
}

.tone-chat-list {
  --tone-a: #ffffff;
  --tone-b: #fafbfc;
  --tone-accent: #667a92;
}

.tone-message-preview {
  --tone-a: #ffffff;
  --tone-b: #fafbfc;
  --tone-accent: #687b92;
}

.tone-customer-info {
  --tone-a: #ffffff;
  --tone-b: #fafbfc;
  --tone-accent: #667991;
}

.tone-bg-result {
  --tone-a: #ffffff;
  --tone-b: #fafbfc;
  --tone-accent: #697c93;
}

.tone-single-analysis {
  --tone-a: #ffffff;
  --tone-b: #fafbfc;
  --tone-accent: #667a91;
}

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

.headline h3 {
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--theme-font-display);
  font-size: 16px;
  letter-spacing: 0;
  color: var(--theme-text);
  font-weight: 700;
}

.headline h3::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--theme-accent);
  box-shadow: 0 0 0 4px rgba(58, 132, 247, 0.16);
}

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

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

.main-grid {
  align-items: stretch;
}

.dist-grid .card {
  min-height: 236px;
}

.pipeline-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.5fr 1fr 1fr;
  gap: 10px;
  align-items: center;
}

.task-pipeline-grid {
  margin-top: 14px;
  grid-template-columns: minmax(260px, 1.05fr) minmax(250px, 0.8fr) minmax(300px, 1fr);
  gap: 12px;
  align-items: start;
}

.field-control {
  min-width: 0;
  display: grid;
  grid-template-rows: auto 40px auto;
  gap: 6px;
}

.field-control span {
  color: var(--theme-muted);
  font-size: 12px;
  font-weight: 800;
}

.field-control small {
  color: #73808e;
  font-size: 12px;
  line-height: 1.45;
  min-height: 18px;
}

.field-control .input {
  width: 100%;
}

.model-key-source-card {
  min-height: 40px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid rgba(148, 163, 184, 0.34);
  border-radius: 8px;
  background: rgba(248, 250, 252, 0.92);
}

.model-key-source-card strong {
  min-width: 0;
  color: #334155;
  font-size: 13px;
  font-weight: 800;
}

.model-key-source-card a {
  flex: 0 0 auto;
  color: #0f766e;
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
}

.model-key-source-card a:hover {
  color: #0b5f59;
  text-decoration: underline;
}

.workspace-auth-note {
  margin: 10px 0 0;
  padding: 9px 12px;
  border: 1px solid rgba(203, 213, 225, 0.92);
  border-left: 3px solid #0f766e;
  border-radius: 8px;
  background: #f8fafc;
  color: #475569;
  font-size: 12px;
  line-height: 1.5;
}

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

.security-list div {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border: 1px solid rgba(203, 213, 225, 0.72);
  border-radius: 8px;
  background: #ffffff;
}

.security-list strong {
  color: var(--theme-text);
  font-size: 13px;
}

.security-list span,
.security-copy {
  color: #475569;
  font-size: 13px;
  line-height: 1.55;
}

.security-list.compact div {
  padding: 8px 10px;
}

.db-query-grid {
  margin-top: 12px;
  grid-template-columns: minmax(360px, 1.35fr) minmax(190px, 0.45fr) auto;
  gap: 12px;
  align-items: start;
}

.db-query-grid .btn {
  align-self: start;
  margin-top: 24px;
}

.compact-controls {
  margin-top: 12px;
}

.controls {
  display: grid;
  grid-template-columns: repeat(4, minmax(145px, 1fr));
  gap: 10px;
  align-items: center;
}

.controls.compact-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.check-item {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  font-size: 13px;
  color: var(--theme-text);
  border: 1px solid var(--theme-line);
  border-radius: 10px;
  padding: 9px 10px;
  background: #fcfeff;
}

.compact-controls .check-item {
  min-width: 170px;
  flex: 0 0 auto;
}

.check-item input {
  accent-color: var(--theme-accent);
}

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

.compact-row {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(160, 184, 203, 0.35);
}

.input {
  width: 100%;
  height: 40px;
  border: 1px solid var(--theme-line);
  border-radius: 12px;
  padding: 9px 12px;
  font-size: 14px;
  color: var(--theme-text);
  background: #fcfeff;
  outline: none;
  transition: border-color 0.22s ease, box-shadow 0.22s ease, transform 0.2s ease;
}

.input:focus {
  border-color: var(--theme-accent);
  box-shadow: 0 0 0 3px rgba(58, 132, 247, 0.2);
}

.btn {
  position: relative;
  overflow: hidden;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
  border-radius: 12px;
  padding: 0 14px;
  border: 1px solid transparent;
  cursor: pointer;
  font-family: var(--theme-font-body);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  transition: transform 0.18s ease, box-shadow 0.24s ease, filter 0.2s ease, border-color 0.2s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

.btn:disabled {
  opacity: 0.48;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn.primary {
  color: #ffffff;
  background: linear-gradient(135deg, #5aa1ff 0%, var(--theme-accent) 100%);
  box-shadow: 0 8px 16px rgba(58, 132, 247, 0.24);
}

.btn.primary:hover {
  filter: brightness(0.96);
}

.btn.ghost {
  color: var(--theme-text);
  border-color: var(--theme-line);
  background: #ffffff;
}

.btn.ghost:hover {
  border-color: var(--theme-line-strong);
  box-shadow: none;
}

.btn.danger {
  color: #ffffff;
  border-color: #b95b5b;
  background: linear-gradient(135deg, #cc6a6a 0%, var(--danger) 100%);
  box-shadow: 0 8px 16px rgba(183, 69, 69, 0.18);
}

.btn.danger:hover {
  filter: brightness(0.96);
}

.btn.danger-ghost {
  color: var(--danger);
  border-color: rgba(183, 69, 69, 0.28);
  background: #fff8f7;
}

.btn.danger-ghost:hover {
  border-color: rgba(183, 69, 69, 0.45);
  background: #fff1ef;
}

.summary {
  margin: 10px 0 6px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.owner-setup-checklist {
  margin-top: 10px;
  display: grid;
  gap: 8px;
}

.owner-setup-item {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid var(--theme-line);
  border-radius: 8px;
  background: #ffffff;
  padding: 8px 10px;
}

.owner-setup-item strong {
  min-width: 0;
  color: var(--theme-text);
  font-size: 12px;
  line-height: 1.45;
  word-break: break-word;
}

.owner-setup-status {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 700;
  border: 1px solid transparent;
  white-space: nowrap;
}

.owner-setup-status.done {
  color: #1d6b4a;
  background: rgba(30, 138, 96, 0.12);
  border-color: rgba(30, 138, 96, 0.26);
}

.owner-setup-status.wait {
  color: #89541b;
  background: rgba(160, 100, 31, 0.14);
  border-color: rgba(160, 100, 31, 0.3);
}

.pill {
  padding: 6px 11px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  border: 1px solid transparent;
  letter-spacing: 0.01em;
}

.pill.engine {
  background: var(--theme-accent-soft);
  color: var(--theme-accent-strong);
  border-color: rgba(81, 124, 199, 0.3);
}

.pill.ok {
  background: rgba(30, 138, 96, 0.12);
  color: #186f4c;
  border-color: rgba(30, 138, 96, 0.28);
}

.pill.warn {
  background: rgba(160, 100, 31, 0.14);
  color: #89541b;
  border-color: rgba(160, 100, 31, 0.3);
}

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

.kpi-grid-7 {
  grid-template-columns: repeat(auto-fit, minmax(165px, 1fr));
}

.kpi-card {
  position: relative;
  border: 1px solid var(--theme-line);
  border-radius: 14px;
  padding: 11px;
  background: linear-gradient(180deg, #ffffff 0%, #f7fbff 100%);
  transition: transform 0.2s ease, box-shadow 0.24s ease;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.kpi-card::after {
  content: "";
  position: absolute;
  inset: 0 auto auto 0;
  width: 70px;
  height: 3px;
  border-radius: 0 0 8px 0;
  background: linear-gradient(90deg, #9ec5ff 0%, var(--theme-accent) 100%);
}

.kpi-card:hover {
  transform: translateY(-3px);
  border-color: #aaccf0;
  box-shadow: 0 14px 26px rgba(73, 128, 187, 0.16);
}

.kpi-clickable-card {
  cursor: pointer;
}

.kpi-clickable-card .kpi-sub {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.kpi-clickable-card .kpi-sub::after {
  content: ">";
  font-size: 11px;
  opacity: 0.7;
}

.kpi-label {
  font-size: 12px;
  color: var(--theme-muted);
}

.kpi-value {
  margin-top: 5px;
  font-family: var(--theme-font-display);
  font-size: 29px;
  font-weight: 700;
  letter-spacing: 0;
  color: var(--theme-text);
}

.kpi-value.warn {
  color: #9d6220;
}

.kpi-value.danger {
  color: #b33f46;
}

.kpi-value.ok {
  color: #1f815a;
}

.kpi-sub {
  margin-top: 4px;
  font-size: 11px;
  color: var(--theme-muted);
}

.sales-workspace {
  background: linear-gradient(180deg, #ffffff 0%, #f8fbf9 100%);
}

.sales-workspace-summary {
  margin-top: 10px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.sales-kpi-grid {
  margin-top: 10px;
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 8px;
}

.sales-metric-card,
.sales-kpi-card {
  min-width: 0;
  border: 1px solid var(--theme-line);
  border-radius: var(--radius-sm);
  background: #ffffff;
  text-align: left;
  cursor: pointer;
  color: var(--theme-text);
  transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}

.sales-metric-card {
  padding: 10px 11px;
}

.sales-kpi-card {
  padding: 9px 10px;
}

.sales-metric-card:hover,
.sales-kpi-card:hover {
  transform: translateY(-2px);
  border-color: var(--theme-line-strong);
  background: #f8fbf9;
}

.sales-metric-card span,
.sales-metric-card small,
.sales-kpi-card span {
  display: block;
  color: var(--theme-muted);
}

.sales-metric-card span,
.sales-kpi-card span {
  font-size: 12px;
  font-weight: 800;
}

.sales-metric-card strong,
.sales-kpi-card strong {
  display: block;
  margin-top: 4px;
  line-height: 1;
  letter-spacing: 0;
}

.sales-metric-card strong {
  font-size: 28px;
}

.sales-kpi-card strong {
  font-size: 22px;
}

.sales-metric-card small {
  margin-top: 6px;
  font-size: 11px;
}

.sales-metric-card.danger strong,
.sales-kpi-card.danger strong {
  color: var(--danger);
}

.sales-metric-card.warn strong,
.sales-kpi-card.warn strong {
  color: var(--warn);
}

.sales-metric-card.ok strong,
.sales-kpi-card.ok strong {
  color: var(--ok);
}

.sales-workspace-grid {
  margin-top: 10px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.sales-panel {
  min-width: 0;
  border: 1px solid var(--theme-line);
  border-radius: var(--radius-sm);
  background: #fcfefd;
  padding: 10px;
}

.sales-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.sales-panel-head h4 {
  margin: 0;
  font-size: 13px;
  color: var(--theme-text);
}

.sales-panel-head span {
  color: var(--theme-muted);
  font-size: 11px;
}

.sales-task-list {
  margin-top: 8px;
  display: grid;
  gap: 7px;
  max-height: 520px;
  overflow: auto;
  padding-right: 2px;
}

.sales-task-item {
  width: 100%;
  min-width: 0;
  border: 1px solid rgba(102, 126, 159, 0.18);
  border-radius: 7px;
  background: #ffffff;
  padding: 8px;
  text-align: left;
  cursor: pointer;
  color: var(--theme-text);
  transition: border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.sales-task-item:hover,
.sales-task-item:focus,
.sales-task-item.active {
  border-color: var(--theme-line-strong);
  background: #eef5f0;
  box-shadow: inset 3px 0 0 var(--theme-accent);
  outline: none;
}

.sales-task-item.overdue {
  background: #fff6f2;
  border-color: rgba(183, 69, 69, 0.24);
}

.sales-task-title {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: flex-start;
}

.sales-task-title strong {
  min-width: 0;
  color: var(--theme-text);
  font-size: 12px;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sales-task-title span {
  flex: 0 0 auto;
  color: var(--theme-muted);
  font-size: 10px;
  line-height: 1.4;
}

.sales-task-tags {
  margin-top: 6px;
  display: flex;
  gap: 5px;
  align-items: center;
  flex-wrap: wrap;
}

.sales-score {
  padding: 3px 7px;
  border-radius: 999px;
  background: rgba(81, 109, 144, 0.1);
  color: #3f5878;
  border: 1px solid rgba(81, 109, 144, 0.22);
  font-size: 11px;
  font-weight: 800;
}

.sales-task-meta,
.sales-task-action,
.sales-task-script {
  margin-top: 6px;
  font-size: 11px;
  line-height: 1.45;
  color: var(--theme-muted);
}

.sales-task-action {
  color: #314d3d;
  font-weight: 800;
}

.sales-task-script {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  color: #516272;
}

.sales-empty {
  border: 1px dashed var(--theme-line);
  border-radius: 7px;
  padding: 10px;
  color: var(--theme-muted);
  font-size: 12px;
  background: #ffffff;
}

.sales-detail-grid {
  grid-template-columns: 1fr !important;
}

.sales-detail-focus {
  margin: 0 0 10px;
  border: 1px solid rgba(90, 143, 118, 0.24);
  border-radius: var(--radius-sm);
  padding: 10px;
  background: #f6fbf8;
}

.sales-focus-main {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(160px, 0.6fr);
  gap: 10px;
}

.sales-focus-main div,
.sales-focus-script {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.sales-focus-script {
  margin-top: 10px;
  border-top: 1px solid rgba(90, 143, 118, 0.16);
  padding-top: 9px;
}

.sales-focus-main span,
.sales-focus-script span {
  color: var(--theme-muted);
  font-size: 11px;
  font-weight: 800;
}

.sales-focus-main strong,
.sales-focus-script strong {
  color: var(--theme-text);
  font-size: 13px;
  line-height: 1.5;
  font-weight: 800;
  word-break: break-word;
}

.boss-money-grid {
  margin-top: 10px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.boss-money-card {
  border: 1px solid var(--theme-line);
  border-radius: var(--radius-sm);
  padding: 11px;
  background: #fcfefd;
}

.boss-money-label {
  font-size: 12px;
  color: var(--theme-muted);
  font-weight: 700;
}

.boss-money-value {
  margin-top: 5px;
  font-size: 24px;
  line-height: 1.15;
  font-weight: 800;
  color: var(--theme-text);
}

.boss-money-sub,
.boss-money-note {
  margin-top: 5px;
  font-size: 11px;
  color: var(--theme-muted);
}

.boss-review-grid {
  margin-top: 10px;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: 10px;
}

.boss-review-grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.boss-panel {
  min-width: 0;
  border: 1px solid var(--theme-line);
  border-radius: var(--radius-sm);
  padding: 10px;
  background: #fcfefd;
}

.boss-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.boss-panel-head h4 {
  margin: 0;
  font-size: 13px;
  color: var(--theme-text);
}

.boss-panel-head span {
  color: var(--theme-muted);
  font-size: 11px;
}

.boss-watch-list {
  margin-top: 8px;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.boss-watch-block {
  min-width: 0;
  border: 1px solid rgba(102, 126, 159, 0.16);
  border-radius: var(--radius-sm);
  padding: 8px;
  background: #ffffff;
}

.boss-watch-head,
.boss-dist-head,
.boss-stat-line {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
}

.boss-watch-head strong {
  font-size: 12px;
  color: var(--theme-text);
}

.boss-watch-head span {
  min-width: 24px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: #eef5f0;
  color: #456a57;
  font-size: 12px;
  font-weight: 800;
}

.boss-drill-btn {
  min-height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border: 1px solid rgba(3, 105, 161, 0.22);
  border-radius: 999px;
  background: #f0f9ff;
  color: #075985;
  padding: 4px 9px;
  font-family: inherit;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.boss-drill-btn:hover,
.boss-dist-button:hover {
  border-color: rgba(3, 105, 161, 0.42);
  background: #e0f2fe;
  box-shadow: 0 6px 14px rgba(3, 105, 161, 0.10);
}

.boss-drill-btn:active,
.boss-dist-button:active {
  transform: translateY(0) scale(0.99);
}

.boss-count-btn {
  min-width: 28px;
  height: 24px;
  padding: 4px 9px;
}

.boss-drill-subtle {
  margin-top: 8px;
}

.boss-drill-btn.danger {
  border-color: rgba(220, 38, 38, 0.24);
  background: #fff7ed;
  color: #dc2626;
}

.boss-watch-block p {
  margin: 6px 0 8px;
  color: var(--theme-muted);
  font-size: 11px;
  line-height: 1.45;
}

.boss-watch-customers,
.boss-mini-list {
  display: grid;
  gap: 6px;
}

.boss-customer-link {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--theme-line);
  border-radius: 7px;
  background: #f8fbf9;
  padding: 6px 7px;
  text-align: left;
  cursor: pointer;
}

.boss-customer-link:hover {
  border-color: var(--theme-line-strong);
  background: var(--theme-row-hover);
}

.boss-customer-link span,
.boss-customer-link small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.boss-customer-link span {
  color: var(--theme-text);
  font-size: 12px;
  font-weight: 800;
}

.boss-customer-link small {
  margin-top: 2px;
  color: var(--theme-muted);
  font-size: 10px;
}

.boss-table-scroll {
  max-height: 248px;
}

.danger-text {
  color: var(--danger) !important;
  font-weight: 800;
}

.boss-dist-list,
.boss-review-stack {
  margin-top: 8px;
  display: grid;
  gap: 8px;
}

.boss-dist-row {
  display: grid;
  gap: 5px;
}

.boss-dist-button {
  width: 100%;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  padding: 4px;
  text-align: left;
  cursor: pointer;
}

.boss-dist-head span,
.boss-stat-line span {
  color: var(--theme-muted);
  font-size: 12px;
}

.boss-dist-head strong,
.boss-stat-line strong {
  color: var(--theme-text);
  font-size: 13px;
}

.boss-dist-track {
  height: 7px;
  border-radius: 999px;
  background: #e8eee9;
  overflow: hidden;
}

.boss-dist-track div {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #9fbaa9 0%, var(--theme-accent) 100%);
}

.boss-stat-line {
  border: 1px solid rgba(102, 126, 159, 0.14);
  border-radius: 7px;
  padding: 7px 8px;
  background: #ffffff;
}

.boss-stat-line .boss-drill-btn {
  margin-left: auto;
}

.boss-inline-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  margin-left: auto;
  flex-wrap: wrap;
}

.boss-table-scroll .boss-drill-btn {
  min-height: 24px;
  min-width: 32px;
  padding: 4px 8px;
  font-size: 11px;
}

.boss-empty-mini {
  color: var(--theme-muted);
  font-size: 12px;
}

.hint-text {
  color: var(--theme-muted);
  font-size: 12px;
}

.filters-grid {
  margin-top: 10px;
  display: grid;
  grid-template-columns: 1fr 0.8fr 0.9fr 0.95fr 0.95fr auto 1.2fr 1fr auto;
  gap: 10px;
  align-items: center;
}

.filter-check {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  white-space: nowrap;
  border: 1px solid var(--theme-line);
  border-radius: var(--radius-sm);
  padding: 0 11px;
  background: #fcfeff;
  color: #3c5948;
  font-size: 13px;
  font-weight: 700;
}

.filter-check input {
  width: 15px;
  height: 15px;
  accent-color: var(--theme-accent);
}

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

.dist-row {
  border: 1px solid var(--theme-line);
  border-radius: 11px;
  padding: 9px;
  background: #fcfeff;
}

.dist-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--theme-text);
}

.dist-track {
  margin-top: 6px;
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: #e6edf8;
  overflow: hidden;
}

.dist-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #74b3ff 0%, var(--theme-accent) 100%);
}

.table-scroll {
  margin-top: 10px;
  max-height: 310px;
  overflow: auto;
  border: 1px solid var(--theme-line);
  border-radius: var(--radius-sm);
  background: linear-gradient(180deg, #ffffff 0%, #fafdff 100%);
}

.table-tall {
  max-height: 500px;
}

.result-table {
  width: 100%;
  border-collapse: collapse;
}

.result-table th,
.result-table td {
  border-bottom: 1px solid rgba(102, 126, 159, 0.16);
  vertical-align: top;
  text-align: left;
  padding: 9px 8px;
  font-size: 13px;
  line-height: 1.56;
  color: var(--theme-text);
}

.result-table th {
  width: 180px;
  white-space: nowrap;
  color: #32557f;
  font-weight: 700;
  background: #edf5ff;
}

.result-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
}

.result-table tbody tr:nth-child(even):not(.active-row) {
  background: var(--theme-row-stripe);
}

.result-table.compact th,
.result-table.compact td {
  font-size: 12px;
  padding: 7px 6px;
  white-space: nowrap;
}

.platform-table-scroll {
  max-height: 560px;
}

.platform-table {
  table-layout: fixed;
  min-width: 1060px;
}

.platform-table th,
.platform-table td {
  vertical-align: middle;
}

.platform-table th:nth-child(1) { width: 150px; }
.platform-table th:nth-child(2) { width: 145px; }
.platform-table th:nth-child(3) { width: 86px; }
.platform-table th:nth-child(4) { width: 98px; }
.platform-table th:nth-child(5) { width: 140px; }
.platform-table th:nth-child(6) { width: 152px; }
.platform-table th:nth-child(7) { width: 130px; }
.platform-table th:nth-child(8) { width: 340px; }

.user-manage-card {
  background: linear-gradient(180deg, #ffffff 0%, #f8fbf9 100%);
}

.user-table-scroll {
  max-height: 360px;
}

.user-table {
  min-width: 1160px;
  table-layout: fixed;
}

.user-table th,
.user-table td {
  vertical-align: middle;
}

.user-table th:nth-child(1),
.user-table td:nth-child(1) {
  width: 14%;
}

.user-table th:nth-child(2),
.user-table td:nth-child(2) {
  width: 16%;
}

.user-table th:nth-child(3),
.user-table td:nth-child(3) {
  width: 11%;
}

.user-table th:nth-child(4),
.user-table td:nth-child(4) {
  width: 23%;
}

.user-table th:nth-child(5),
.user-table td:nth-child(5) {
  width: 10%;
}

.user-table th:nth-child(6),
.user-table td:nth-child(6) {
  width: 26%;
}

.user-col-account,
.user-col-display {
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-col-role,
.user-col-status {
  text-align: center;
}

.user-col-binding {
  color: #3f5c4d;
  font-size: 12px;
  line-height: 1.45;
  word-break: break-word;
}

.user-col-status .pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.user-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.user-action-btn {
  height: 36px;
  border-radius: 9px;
  padding: 0 10px;
  font-size: 12px;
}

.user-create-panel {
  margin-top: 12px;
  border: 1px solid rgba(151, 171, 155, 0.24);
  border-radius: 9px;
  padding: 10px;
  background: #f7fbf8;
}

.user-create-form {
  margin-top: 0;
}

.user-create-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.user-create-actions {
  margin-top: 10px;
  justify-content: flex-end;
}

.platform-cell-main strong,
.platform-cell-admin strong,
.platform-cell-data span,
.platform-cell-time span {
  display: block;
}

.platform-cell-main strong,
.platform-cell-admin strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.platform-cell-center {
  text-align: center !important;
}

.platform-cell-center .pill {
  justify-content: center;
}

.platform-actions {
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: 6px;
}

.platform-actions .btn {
  height: 36px;
  min-width: 82px;
  border-radius: 8px;
  padding: 0 9px;
  font-size: 12px;
}

.platform-security-span-2 {
  grid-column: span 2;
}

.platform-security-textarea {
  min-height: 120px;
  height: 120px;
  resize: vertical;
}

.level-badge-wrap {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 7px;
  border-radius: 999px;
  border: 1px solid #c9dcf1;
  background: #eef6ff;
  max-width: 100%;
}

.level-badge-wrap.compact {
  padding: 1px 6px;
  gap: 5px;
}

.level-badge-img {
  display: block;
  width: 36px;
  height: auto;
  border-radius: 4px;
  background: #ffffff;
}

.level-badge-wrap.compact .level-badge-img {
  width: 32px;
}

.level-badge-text {
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
  color: #2f5b90;
  white-space: nowrap;
}

.level-badge-wrap.compact .level-badge-text {
  font-size: 11px;
}

.level-text-fallback {
  font-weight: 700;
  color: #436180;
}

.click-row:hover {
  background: #edf6ff;
}

.click-row.active-row {
  background: #e5f1ff;
  box-shadow: inset 4px 0 0 var(--theme-accent), inset 0 0 0 1px rgba(58, 132, 247, 0.15);
}

.prio-pill {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  border: 1px solid transparent;
}

.priority-high {
  background: rgba(183, 69, 69, 0.13);
  color: #97353a;
  border-color: rgba(183, 69, 69, 0.28);
}

.priority-mid {
  background: rgba(168, 113, 33, 0.14);
  color: #85551a;
  border-color: rgba(168, 113, 33, 0.3);
}

.priority-steady {
  background: rgba(30, 138, 96, 0.12);
  color: #1d6b4a;
  border-color: rgba(30, 138, 96, 0.26);
}

.priority-watch {
  background: rgba(70, 117, 167, 0.14);
  color: #335a84;
  border-color: rgba(70, 117, 167, 0.3);
}

.priority-win {
  background: rgba(23, 164, 107, 0.14);
  color: #1a7b54;
  border-color: rgba(23, 164, 107, 0.28);
}

.segment-pill {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  border: 1px solid transparent;
}

.segment-sample {
  background: rgba(240, 164, 76, 0.14);
  color: #8c581f;
  border-color: rgba(240, 164, 76, 0.32);
}

.segment-big {
  background: rgba(30, 138, 96, 0.14);
  color: #1f7c55;
  border-color: rgba(30, 138, 96, 0.3);
}

.segment-repeat {
  background: rgba(43, 145, 114, 0.15);
  color: #1f735b;
  border-color: rgba(43, 145, 114, 0.32);
}

.segment-dormant {
  background: rgba(173, 91, 65, 0.14);
  color: #8a4633;
  border-color: rgba(173, 91, 65, 0.3);
}

.segment-normal {
  background: rgba(81, 109, 144, 0.12);
  color: #3f5878;
  border-color: rgba(81, 109, 144, 0.26);
}

.repurchase-cell {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 320px;
}

.repurchase-pill {
  flex: 0 0 auto;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  border: 1px solid transparent;
}

.repurchase-high {
  background: rgba(183, 69, 69, 0.13);
  color: #97353a;
  border-color: rgba(183, 69, 69, 0.28);
}

.repurchase-mid {
  background: rgba(168, 113, 33, 0.14);
  color: #85551a;
  border-color: rgba(168, 113, 33, 0.3);
}

.repurchase-low {
  background: rgba(81, 109, 144, 0.12);
  color: #3f5878;
  border-color: rgba(81, 109, 144, 0.26);
}

.repurchase-text {
  display: inline-block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #41566f;
}

.wrap-cell {
  min-width: 220px;
  max-width: 420px;
  white-space: normal !important;
  word-break: break-word;
}

.script-cell {
  min-width: 300px;
}

.top-opportunity-scroll {
  max-height: 430px;
}

.opportunity-badge-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  vertical-align: middle;
}

.opportunity-pill,
.followup-pill {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  border: 1px solid transparent;
}

.opportunity-help {
  position: relative;
  z-index: 3;
  width: 16px;
  height: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid rgba(81, 109, 144, 0.28);
  background: #ffffff;
  color: #3f5878;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  cursor: help;
}

.opportunity-tooltip {
  position: absolute;
  z-index: 30;
  left: 50%;
  bottom: calc(100% + 8px);
  transform: translateX(-50%) translateY(4px);
  display: none;
  width: min(320px, 78vw);
  border: 1px solid var(--theme-line-strong);
  border-radius: var(--radius-sm);
  padding: 9px 10px;
  background: #ffffff;
  color: var(--theme-text);
  box-shadow: var(--shadow-md);
  text-align: left;
  white-space: normal;
  font-size: 12px;
  line-height: 1.5;
}

.opportunity-tooltip::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 100%;
  width: 9px;
  height: 9px;
  border-right: 1px solid var(--theme-line-strong);
  border-bottom: 1px solid var(--theme-line-strong);
  background: #ffffff;
  transform: translate(-50%, -5px) rotate(45deg);
}

.opportunity-tooltip strong,
.opportunity-tooltip span {
  display: block;
}

.opportunity-tooltip strong {
  margin-bottom: 4px;
  color: var(--theme-text);
}

.opportunity-help:hover .opportunity-tooltip,
.opportunity-help:focus .opportunity-tooltip,
.opportunity-help:focus-within .opportunity-tooltip {
  display: block;
  transform: translateX(-50%) translateY(0);
}

.opportunity-a,
.opportunity-risk {
  background: rgba(183, 69, 69, 0.13);
  color: #97353a;
  border-color: rgba(183, 69, 69, 0.28);
}

.opportunity-b,
.opportunity-repeat {
  background: rgba(30, 138, 96, 0.12);
  color: #1d6b4a;
  border-color: rgba(30, 138, 96, 0.26);
}

.opportunity-c {
  background: rgba(81, 109, 144, 0.12);
  color: #3f5878;
  border-color: rgba(81, 109, 144, 0.26);
}

.followup-overdue {
  background: rgba(183, 69, 69, 0.13);
  color: #97353a;
  border-color: rgba(183, 69, 69, 0.28);
}

.followup-won,
.followup-progress {
  background: rgba(30, 138, 96, 0.12);
  color: #1d6b4a;
  border-color: rgba(30, 138, 96, 0.26);
}

.followup-lost {
  background: rgba(81, 109, 144, 0.16);
  color: #3f5878;
  border-color: rgba(81, 109, 144, 0.3);
}

.followup-pending,
.followup-muted {
  background: rgba(168, 113, 33, 0.14);
  color: #85551a;
  border-color: rgba(168, 113, 33, 0.3);
}

.overdue-row {
  box-shadow: inset 3px 0 0 rgba(183, 69, 69, 0.72);
}

.overdue-row:hover {
  background: #f7fbff;
}

.followup-status-wrap {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.overdue-mini-tag {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 2px 7px;
  border: 1px solid rgba(183, 69, 69, 0.26);
  border-radius: 999px;
  background: #fff7f5;
  color: #9a3d3d;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.opportunity-box {
  margin-top: 10px;
  border: 1px solid var(--theme-line);
  border-radius: var(--radius-sm);
  padding: 11px;
  background: #fcfefd;
}

.opportunity-headline,
.opportunity-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.mini-score {
  font-size: 12px;
  color: var(--theme-muted);
  font-weight: 700;
}

.opportunity-reason,
.script-copy {
  margin-top: 8px;
  font-size: 13px;
  line-height: 1.58;
}

.script-copy {
  border-left: 3px solid var(--theme-accent);
  padding-left: 9px;
  color: #34483b;
}

.opportunity-meta {
  margin-top: 8px;
  font-size: 12px;
  color: var(--theme-muted);
}

.followup-form {
  margin-top: 10px;
}

.followup-form-modal {
  position: relative;
  border: 1px solid var(--review-border, var(--theme-line));
  border-radius: var(--radius-md);
  padding: 12px 12px 12px 14px;
  background: linear-gradient(180deg, #ffffff 0%, var(--review-bg, #f8fbf9) 100%);
  overflow: visible;
}

.followup-form-headline {
  margin-top: 0;
  margin-bottom: 10px;
}

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

.followup-grid label,
.followup-note-label {
  display: grid;
  gap: 5px;
  font-size: 12px;
  font-weight: 700;
  color: #395573;
}

.followup-note-label {
  margin-top: 8px;
}

.followup-note {
  min-height: 96px;
  resize: vertical;
}

#ownerSetupForm .field-control {
  grid-template-rows: auto minmax(220px, auto) auto;
}

#ownerProductTaxonomyInput {
  height: clamp(220px, 34vh, 420px);
  min-height: 220px;
  line-height: 1.5;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

.followup-actions {
  margin-top: 8px;
}

.followup-history-scroll {
  max-height: 300px;
}

.customer-review-section {
  --review-accent: var(--theme-accent);
  --review-bg: #fcfefd;
  --review-border: var(--theme-line);
  position: relative;
  margin-top: 12px;
  border: 1px solid var(--review-border);
  border-radius: var(--radius-sm);
  background: linear-gradient(180deg, #ffffff 0%, var(--review-bg) 100%);
  padding: 12px 12px 12px 14px;
  overflow: visible;
  box-shadow: 0 8px 18px rgba(48, 74, 105, 0.05);
}

.customer-review-section::before,
.followup-form-modal::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
  background: var(--review-accent);
}

.customer-review-section .headline h3::before,
.followup-form-modal .headline h3::before {
  background: var(--review-accent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--review-accent) 18%, transparent);
}

.review-tone-battle {
  --review-accent: #5a8f76;
  --review-bg: #f5faf7;
  --review-border: #cbdcd0;
}

.review-tone-analysis {
  --review-accent: #596f8d;
  --review-bg: #f6f9fc;
  --review-border: #cbd8e5;
}

.review-tone-value {
  --review-accent: #4d88a8;
  --review-bg: #f4f9fb;
  --review-border: #c9dce6;
}

.review-tone-blockage {
  --review-accent: #b9834f;
  --review-bg: #fff8f1;
  --review-border: #ead7c1;
}

.review-tone-evidence {
  --review-accent: #4e9b8b;
  --review-bg: #f4fbf9;
  --review-border: #c9e0db;
}

.review-tone-calibration {
  --review-accent: #5d7895;
  --review-bg: #f5f8fb;
  --review-border: #cbd9e6;
}

.review-tone-next {
  --review-accent: #7b83a8;
  --review-bg: #f6f7fb;
  --review-border: #d4d8e7;
}

.review-tone-script {
  --review-accent: #a28a45;
  --review-bg: #fffaf0;
  --review-border: #e6dcc0;
}

.review-tone-sales-assistant {
  --review-accent: #317f74;
  --review-bg: #f2fbf8;
  --review-border: #c7e3dc;
}

.review-tone-followup {
  --review-accent: #6e907a;
  --review-bg: #f7faf8;
  --review-border: #d6e2da;
}

.review-tone-review {
  --review-accent: #a26f56;
  --review-bg: #fff8f5;
  --review-border: #e5d4ca;
}

.review-hero-section {
  margin-top: 0;
}

.customer-review-section .compact-headline {
  margin-top: 0;
}

.customer-review-section .headline h3,
.followup-form-modal .headline h3 {
  font-size: 14px;
  font-weight: 650;
}

.customer-battle-card {
  margin-top: 8px;
  display: grid;
  gap: 9px;
}

.battle-main {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.battle-customer {
  color: var(--theme-text);
  font-size: 18px;
  line-height: 1.18;
  font-weight: 650;
}

.battle-tags,
.battle-meta {
  margin-top: 7px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.battle-tag,
.battle-meta span {
  border: 1px solid var(--theme-line);
  border-radius: 999px;
  padding: 3px 8px;
  background: #ffffff;
  color: var(--theme-muted);
  font-size: 12px;
  font-weight: 650;
}

.battle-owner {
  flex: 0 0 auto;
  min-width: 132px;
  border: 1px solid var(--theme-line);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  background: #ffffff;
  text-align: right;
}

.battle-owner span,
.battle-summary-block span {
  display: block;
  color: var(--theme-muted);
  font-size: 12px;
  font-weight: 650;
}

.battle-owner strong,
.battle-summary-block strong {
  display: block;
  margin-top: 3px;
  color: var(--theme-text);
  font-size: 13px;
  line-height: 1.45;
  font-weight: 650;
}

.battle-summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.battle-summary-block {
  border-left: 3px solid var(--review-accent);
  background: #ffffff;
  border-radius: var(--radius-sm);
  padding: 9px 10px;
}

.modal-meta-compact {
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.modal-meta-compact .meta-item {
  padding: 7px;
}

.modal-meta-compact .meta-value {
  font-size: 12px;
}

.customer-review-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px;
}

.customer-review-cards {
  margin-top: 8px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.customer-review-cards.compact {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.customer-analysis-cards {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.customer-review-card {
  min-width: 0;
  border: 1px solid color-mix(in srgb, var(--review-accent) 25%, #ffffff);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.82);
  padding: 9px;
  display: grid;
  align-content: start;
}

.customer-review-card.compact {
  padding: 8px;
}

.customer-review-card h4,
.script-card h4 {
  margin: 0;
  color: color-mix(in srgb, var(--review-accent) 72%, #243328);
  font-size: 11.5px;
  font-weight: 650;
}

.customer-review-value {
  margin-top: 7px;
  font-size: 12.5px;
  line-height: 1.55;
}

.modal-next-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 10px;
  align-items: start;
}

.modal-next-grid .opportunity-box {
  margin-top: 0;
}

.script-board {
  margin-top: 8px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.script-card {
  min-width: 0;
  border: 1px solid color-mix(in srgb, var(--review-accent) 25%, #ffffff);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.84);
  padding: 9px;
}

.script-card.primary-script {
  border-color: color-mix(in srgb, var(--review-accent) 48%, #ffffff);
  background: color-mix(in srgb, var(--review-bg) 72%, #ffffff);
}

.script-card div {
  margin-top: 6px;
  color: var(--theme-text);
  font-size: 12.5px;
  line-height: 1.55;
  white-space: pre-wrap;
}

.modal-full-details {
  margin-top: 10px;
}

.risk-tag {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  border: 1px solid transparent;
}

.risk-high {
  background: rgba(183, 69, 69, 0.13);
  color: #97353a;
  border-color: rgba(183, 69, 69, 0.28);
}

.risk-mid {
  background: rgba(168, 113, 33, 0.14);
  color: #85551a;
  border-color: rgba(168, 113, 33, 0.3);
}

.risk-low {
  background: rgba(30, 138, 96, 0.12);
  color: #1d6b4a;
  border-color: rgba(30, 138, 96, 0.26);
}

.risk-unknown {
  background: rgba(81, 109, 144, 0.12);
  color: #3f5878;
  border-color: rgba(81, 109, 144, 0.26);
}

.meta-grid {
  margin-top: 8px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.meta-item {
  border: 1px solid var(--theme-line);
  border-radius: 11px;
  padding: 8px;
  background: #fcfeff;
}

.meta-key {
  font-size: 12px;
  color: var(--theme-muted);
}

.meta-value {
  margin-top: 4px;
  font-size: 13px;
  font-weight: 650;
  color: var(--theme-text);
}

.meta-value .level-badge-wrap {
  margin-top: 0;
}

.detail-block {
  margin-top: 10px;
  border: 1px solid var(--theme-line);
  border-radius: 12px;
  padding: 11px;
  background: #fafdff;
  font-size: 13px;
  line-height: 1.68;
}

.summary-title {
  margin: 4px 0;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  border: 1px solid #cfe0f4;
  background: #eef6ff;
  padding: 2px 9px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #3d6495;
}

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

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

.insight-card {
  --insight-accent: var(--theme-accent);
  --insight-border: #d8dee7;
  --insight-title: #304357;
  --insight-bg-top: #ffffff;
  --insight-bg-bottom: #f9fafc;
  border: 1px solid var(--insight-border);
  border-radius: 14px;
  padding: 12px;
  background: linear-gradient(180deg, var(--insight-bg-top) 0%, var(--insight-bg-bottom) 100%);
  box-shadow: 0 6px 16px rgba(73, 128, 187, 0.08);
  position: relative;
  overflow: visible;
  transition: transform 0.2s ease, box-shadow 0.22s ease;
}

.insight-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 5px;
  background: var(--insight-accent);
}

.insight-card::after {
  content: none;
}

.insight-card:hover {
  transform: translateY(-2px);
  border-color: #adcbed;
  box-shadow: 0 14px 26px rgba(73, 128, 187, 0.16);
}

.insight-card.tone-1 {
  --insight-accent: #3f8ef7;
  --insight-border: #d5e5fb;
  --insight-title: #2f5b90;
  --insight-bg-top: #ffffff;
  --insight-bg-bottom: #f5f9ff;
}

.insight-card.tone-2 {
  --insight-accent: #2faea0;
  --insight-border: #d4eee9;
  --insight-title: #2a6c65;
  --insight-bg-top: #ffffff;
  --insight-bg-bottom: #f3fcfa;
}

.insight-card.tone-3 {
  --insight-accent: #6c9dff;
  --insight-border: #d9e5ff;
  --insight-title: #3a5fa3;
  --insight-bg-top: #ffffff;
  --insight-bg-bottom: #f5f9ff;
}

.insight-card.tone-4 {
  --insight-accent: #f0a44c;
  --insight-border: #f4e3cd;
  --insight-title: #88581f;
  --insight-bg-top: #ffffff;
  --insight-bg-bottom: #fff9f2;
}

.insight-card.tone-5 {
  --insight-accent: #7f8df6;
  --insight-border: #dde1ff;
  --insight-title: #4e59a8;
  --insight-bg-top: #ffffff;
  --insight-bg-bottom: #f7f8ff;
}

.insight-card.tone-6 {
  --insight-accent: #52b2d4;
  --insight-border: #d8edf5;
  --insight-title: #2f6a80;
  --insight-bg-top: #ffffff;
  --insight-bg-bottom: #f3fbff;
}

.insight-card h4 {
  margin: 0 0 0 2px;
  font-size: 11.5px;
  color: var(--insight-title);
  letter-spacing: 0.03em;
  font-weight: 650;
}

.insight-value {
  margin-top: 7px;
  margin-left: 2px;
  font-size: 12.5px;
  line-height: 1.56;
  color: var(--theme-text);
}

.insight-badge-line {
  margin-bottom: 7px;
}

.insight-line {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 8px;
  padding: 4px 0;
  border-top: 1px solid rgba(102, 126, 159, 0.12);
}

.insight-line:first-child {
  border-top: none;
  padding-top: 0;
}

.insight-line span {
  color: var(--theme-muted);
  font-size: 11.5px;
  font-weight: 650;
}

.insight-line strong {
  min-width: 0;
  color: var(--theme-text);
  font-size: 12.5px;
  font-weight: 550;
  word-break: break-word;
}

.detail-actions {
  margin-top: 10px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.execution-actions .action-item {
  border-style: dashed;
}

.mistake-board {
  margin-top: 8px;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
}

.sales-assistant-board {
  margin-top: 8px;
}

.sales-assistant-board.customer-review-cards {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.review-card {
  border: 1px solid #e2d8c9;
  border-radius: var(--radius-sm);
  background: linear-gradient(180deg, #fffdfa 0%, #fffbf5 100%);
  padding: 10px;
}

.review-card h4 {
  margin: 0;
  color: #7b5231;
  font-size: 11.5px;
  font-weight: 650;
}

.review-value {
  margin-top: 7px;
  font-size: 12.5px;
  line-height: 1.55;
  color: #4f4033;
}

.review-list {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 6px;
}

.review-list li {
  color: #5e4838;
  font-size: 13px;
  line-height: 1.55;
}

.review-empty {
  color: #85786d;
  font-size: 13px;
  line-height: 1.5;
}

.compact-headline {
  margin-top: 12px;
}

.action-item {
  border: 1px solid var(--theme-line);
  border-radius: 11px;
  padding: 9px;
  background: #fafdff;
}

.action-key {
  font-size: 12px;
  color: #395573;
  font-weight: 700;
}

.action-val {
  margin-top: 4px;
  font-size: 13px;
  line-height: 1.5;
}

.analysis-full-scroll {
  max-height: 520px;
}

.raw-details {
  margin-top: 10px;
  border: 1px solid var(--theme-line);
  border-radius: 11px;
  background: #fafdff;
  overflow: hidden;
}

.raw-details > summary {
  cursor: pointer;
  padding: 8px 10px;
  font-size: 12px;
  color: #4d627b;
  font-weight: 700;
  background: #eef5ff;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(12, 21, 33, 0.36);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  z-index: 40;
}

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

.modal-panel {
  position: relative;
  overflow: auto;
  width: min(1480px, 100%);
  max-height: calc(100vh - 36px);
  border-radius: 14px;
  border: 1px solid var(--theme-line-strong);
  background: #ffffff;
  box-shadow: 0 22px 46px rgba(8, 20, 37, 0.22);
  padding: 14px;
  animation: modal-in 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
}

#customerModal .modal-panel {
  background: #f6f8fb;
}

.modal-panel::before {
  content: none;
}

.modal-head {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--theme-line);
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

#customerModal .modal-head {
  border: 1px solid rgba(102, 126, 159, 0.14);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  box-shadow: 0 8px 18px rgba(48, 74, 105, 0.06);
}

.modal-head-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.modal-head h3 {
  margin: 0;
  font-family: var(--theme-font-display);
  font-size: 20px;
  letter-spacing: 0;
  color: var(--theme-text);
}

.modal-table-scroll {
  max-height: 46vh;
}

.kpi-drill-panel {
  width: min(1180px, 100%);
}

.kpi-drill-scroll {
  max-height: 62vh;
}

#kpiDrillBody tr {
  cursor: pointer;
}

#kpiDrillBody tr:hover {
  background: var(--theme-row-hover);
}

.key-highlight-row th,
.key-highlight-row td {
  background: #f7f3ea;
}

.key-highlight-row th {
  color: #8f4f06;
}

.pre {
  margin: 8px 0 0;
  max-height: 260px;
  overflow: auto;
  border: 1px solid var(--theme-line);
  border-radius: 11px;
  padding: 10px;
  white-space: pre-wrap;
  word-break: break-word;
  background: #f8fafc;
  color: var(--theme-text);
  font-family: var(--theme-font-mono);
  font-size: 12px;
  line-height: 1.56;
}

.detail-pre {
  max-height: 180px;
}

.pre.small {
  max-height: 220px;
}

.badge {
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 700;
  border: 1px solid transparent;
  backdrop-filter: blur(8px);
}

.badge.neutral {
  background: rgba(255, 255, 255, 0.78);
  border-color: var(--theme-line);
  color: #3e5b7f;
}

.badge.ok {
  background: rgba(30, 138, 96, 0.14);
  border-color: rgba(30, 138, 96, 0.29);
  color: #1d6b4a;
}

.badge.fail {
  background: rgba(183, 69, 69, 0.16);
  border-color: rgba(183, 69, 69, 0.31);
  color: #94353c;
}

.manual-details {
  border: 1px solid var(--theme-line);
  border-radius: 15px;
  background: #fafdff;
  overflow: hidden;
}

.manual-details > summary {
  cursor: pointer;
  font-weight: 700;
  padding: 12px 14px;
  list-style: none;
  color: #4d627b;
  background: #eef5ff;
  border-bottom: 1px solid var(--theme-line);
}

.manual-details > summary::-webkit-details-marker {
  display: none;
}

.manual-body {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.manual-actions {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: center;
}

.inner-card {
  background: #fcfeff;
}

.log-list {
  margin-top: 8px;
  overflow: auto;
  border-radius: 12px;
  border: 1px solid var(--theme-line);
  background: #fcfeff;
}

.log-list.bounded {
  max-height: 300px;
}

.empty {
  padding: 18px 12px;
  color: var(--theme-muted);
  font-size: 13px;
}

.log-item {
  width: 100%;
  border: none;
  text-align: left;
  padding: 12px;
  cursor: pointer;
  border-bottom: 1px solid rgba(102, 126, 159, 0.15);
  background: transparent;
  transition: background-color 0.2s ease, transform 0.2s ease;
}

.log-item:hover {
  background: var(--theme-row-hover);
  transform: translateX(3px);
}

.log-item.active {
  background: var(--theme-row-active);
  border-left: 4px solid var(--theme-accent);
  padding-left: 8px;
}

.log-main {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 14px;
  font-weight: 700;
}

.log-meta {
  margin-top: 6px;
  color: var(--theme-muted);
  font-size: 12px;
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  min-width: 240px;
  max-width: 360px;
  border-radius: 12px;
  border: 1px solid var(--theme-line-strong);
  padding: 11px 13px;
  background: linear-gradient(180deg, #ffffff 0%, #f7fbff 100%);
  color: var(--theme-text);
  box-shadow: var(--shadow-md);
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: none;
  z-index: 80;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.tasks-page iframe:not([data-app-frame]),
.tasks-page object:not([data-app-frame]),
.tasks-page embed:not([data-app-frame]) {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
  min-width: 0 !important;
  min-height: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

@keyframes modal-in {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.986);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes card-enter {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 1380px) {
  .topbar {
    flex-direction: column;
  }
}

@media (max-width: 1280px) {
  .kpi-grid,
  .kpi-grid-7 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

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

  .sales-workspace-summary,
  .sales-kpi-grid,
  .sales-workspace-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .task-pipeline-grid {
    grid-template-columns: 1fr;
  }

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

  .detail-actions {
    grid-template-columns: 1fr;
  }

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

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

  .boss-review-grid,
  .boss-review-grid.three {
    grid-template-columns: 1fr;
  }

  .boss-watch-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .customer-review-grid,
  .modal-next-grid,
  .battle-summary-grid {
    grid-template-columns: 1fr;
  }

  .modal-meta-compact,
  .customer-review-cards.compact,
  .customer-analysis-cards,
  .sales-assistant-board.customer-review-cards,
  .mistake-board,
  .script-board {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

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

@media (max-width: 1040px) {
  .grid.two,
  .main-grid,
  .grid.four {
    grid-template-columns: 1fr;
  }

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

  .manual-actions {
    grid-template-columns: 1fr;
  }

  .db-query-grid {
    grid-template-columns: 1fr;
  }

  .db-query-grid .btn {
    margin-top: 0;
    width: fit-content;
  }

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

@media (max-width: 760px) {
  .layout,
  .topbar {
    padding-left: 14px;
    padding-right: 14px;
  }

  .topbar {
    padding-top: 20px;
  }

  h1 {
    font-size: 25px;
  }

  .pipeline-grid,
  .controls,
  .kpi-grid,
  .kpi-grid-7,
  .boss-money-grid,
  .sales-workspace-summary,
  .sales-kpi-grid,
  .sales-workspace-grid,
  .boss-watch-list,
  .modal-meta-compact,
  .customer-review-cards,
  .customer-review-cards.compact,
  .script-board,
  .filters-grid,
  .insight-grid,
  .mistake-board,
  .meta-grid {
    grid-template-columns: 1fr;
  }

  .sales-focus-main {
    grid-template-columns: 1fr;
  }

  .inline-actions {
    flex-wrap: wrap;
  }

  .owner-setup-item {
    flex-direction: column;
    align-items: flex-start;
  }

  #ownerSetupForm .field-control {
    grid-template-rows: auto minmax(180px, auto) auto;
  }

  #ownerProductTaxonomyInput {
    height: 220px;
    min-height: 180px;
  }

  .result-table th {
    width: 128px;
  }

  .badge {
    width: fit-content;
  }

  .modal-head-left {
    flex-wrap: wrap;
  }

  .user-create-grid {
    grid-template-columns: 1fr;
  }

  .user-action-btn {
    height: 36px;
    padding: 0 8px;
    font-size: 11px;
  }

  .login-topbar {
    padding-top: 22px;
  }

  .login-brand h1 {
    font-size: 30px;
  }

  .login-shell {
    min-height: auto;
    padding: 0 0 10px;
  }

  .login-card {
    padding: 16px 14px 14px;
  }

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

  .onboarding-stepper {
    grid-template-columns: 1fr;
  }

  .onboarding-card {
    padding: 14px 12px 12px;
  }
}

/* Comfort neutral overrides: reduce blue bias, keep clarity */
:root {
  --theme-accent: #5a8f76;
  --theme-accent-2: #7aac93;
  --theme-accent-strong: #4c7a65;
  --theme-accent-soft: #edf5ef;
  --theme-text: #243328;
  --theme-muted: #6e7d74;
  --theme-bg-1: #f6f8f6;
  --theme-bg-2: #eef3ef;
  --theme-surface-2: #fbfdfb;
  --theme-line: #dbe5dd;
  --theme-line-strong: #c6d5c9;
  --theme-focus: #a8c1b0;
  --theme-row-hover: #eef4f0;
  --theme-row-active: #e5eee8;
  --theme-row-stripe: #f7faf8;
  --shadow-lg: 0 16px 36px rgba(45, 62, 52, 0.12);
  --shadow-md: 0 10px 22px rgba(45, 62, 52, 0.1);
  --shadow-sm: 0 5px 12px rgba(45, 62, 52, 0.08);
}

body {
  background:
    radial-gradient(circle at 90% -10%, rgba(166, 206, 180, 0.18) 0%, transparent 38%),
    linear-gradient(156deg, var(--theme-bg-1) 0%, var(--theme-bg-2) 100%);
}

.panel {
  background: #fafcfb;
}

.card {
  border-color: #d8e2da;
  background: linear-gradient(180deg, #ffffff 0%, #fbfdfb 100%);
}

.card::after {
  background: linear-gradient(90deg, rgba(90, 143, 118, 0.16) 0%, var(--tone-accent) 100%);
}

.card:hover {
  border-color: #b5c9ba;
  box-shadow: 0 12px 24px rgba(68, 92, 78, 0.14);
}

.card:focus-within {
  border-color: #a9c2b0;
  box-shadow: 0 0 0 3px rgba(90, 143, 118, 0.12), 0 12px 24px rgba(68, 92, 78, 0.12);
}

.tone-overview { --tone-accent: #5f947a; }
.tone-sales-workspace { --tone-accent: #4f8f78; }
.tone-risk { --tone-accent: #b68a55; }
.tone-stage { --tone-accent: #6d9a7f; }
.tone-deal { --tone-accent: #4f9a83; }
.tone-payment { --tone-accent: #7b9985; }
.tone-level { --tone-accent: #6fa18f; }
.tone-segment { --tone-accent: #5ca08c; }
.tone-customer-board { --tone-accent: #5f9278; }
.tone-boss-review { --tone-accent: #6d7f62; }
.tone-owner { --tone-accent: #6a8e76; }
.tone-detail { --tone-accent: #67937f; }
.tone-excel { --tone-accent: #5f9a84; }
.tone-security { --tone-accent: #8b8f63; }
.tone-pipeline-log { --tone-accent: #6e907a; }
.tone-system-log { --tone-accent: #7a9a84; }

.headline h3::before {
  box-shadow: 0 0 0 4px rgba(122, 172, 147, 0.18);
}

.input:focus {
  box-shadow: 0 0 0 3px rgba(90, 143, 118, 0.2);
}

.btn.primary {
  background: linear-gradient(135deg, #73a88e 0%, var(--theme-accent) 100%);
  box-shadow: 0 8px 16px rgba(90, 143, 118, 0.2);
}

.kpi-card {
  background: linear-gradient(180deg, #ffffff 0%, #f8fbf9 100%);
}

.kpi-card::after {
  background: linear-gradient(90deg, #9ec3ae 0%, var(--theme-accent) 100%);
}

.kpi-card:hover {
  border-color: #b7ccbe;
  box-shadow: 0 12px 24px rgba(68, 92, 78, 0.14);
}

.dist-fill {
  background: linear-gradient(90deg, #8ebaa3 0%, var(--theme-accent) 100%);
}

.result-table th {
  color: #3a5847;
  background: #eef5f0;
}

.click-row:hover {
  background: #eef5f0;
}

.click-row.active-row {
  background: #e4eee7;
  box-shadow: inset 4px 0 0 var(--theme-accent), inset 0 0 0 1px rgba(90, 143, 118, 0.14);
}

.summary-title {
  border-color: #cadccf;
  background: #edf5ef;
  color: #456a57;
}

.insight-card {
  box-shadow: 0 5px 12px rgba(68, 92, 78, 0.08);
}

.insight-card:hover {
  border-color: #b7ccbe;
  box-shadow: 0 12px 24px rgba(68, 92, 78, 0.14);
}

.level-badge-wrap {
  border-color: #c9dacd;
  background: #edf5ef;
}

.level-badge-text {
  color: #436956;
}

/* Commercial visual refresh: premium, business-first, no behavior changes */
:root {
  --theme-accent: #2f6da1;
  --theme-accent-2: #5a93c6;
  --theme-accent-strong: #245a88;
  --theme-accent-soft: #edf4fb;
  --theme-text: #1f2e40;
  --theme-muted: #65788d;
  --theme-bg-1: #f4f7fb;
  --theme-bg-2: #ecf1f7;
  --theme-surface-1: #ffffff;
  --theme-surface-2: #f8fbff;
  --theme-line: #d6e0ea;
  --theme-line-strong: #bccbdc;
  --theme-focus: #8eb0d0;
  --theme-row-hover: #edf3fa;
  --theme-row-active: #e5eef8;
  --theme-row-stripe: #f7fafe;
  --ok: #1f8a63;
  --warn: #9a6a2a;
  --danger: #b14e4e;
  --radius-lg: 14px;
  --radius-md: 10px;
  --radius-sm: 8px;
  --shadow-lg: 0 20px 46px rgba(20, 34, 51, 0.11);
  --shadow-md: 0 12px 26px rgba(20, 34, 51, 0.09);
  --shadow-sm: 0 6px 14px rgba(20, 34, 51, 0.07);
}

body {
  position: relative;
  background: linear-gradient(160deg, var(--theme-bg-1) 0%, var(--theme-bg-2) 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -2;
  background-image:
    linear-gradient(112deg, rgba(255, 255, 255, 0.78) 0%, rgba(246, 250, 255, 0.72) 42%, rgba(239, 246, 255, 0.7) 100%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='1600' height='900' viewBox='0 0 1600 900'%3E%3Cdefs%3E%3ClinearGradient id='g' x1='0' y1='0' x2='1' y2='1'%3E%3Cstop offset='0%25' stop-color='%23111e31'/%3E%3Cstop offset='100%25' stop-color='%231f3550'/%3E%3C/linearGradient%3E%3C/defs%3E%3Crect width='1600' height='900' fill='url(%23g)'/%3E%3Cg stroke='%23a8c2dd22' stroke-width='1'%3E%3Cpath d='M0 160h1600M0 320h1600M0 480h1600M0 640h1600M0 800h1600'/%3E%3Cpath d='M200 0v900M520 0v900M840 0v900M1160 0v900M1480 0v900'/%3E%3C/g%3E%3Ccircle cx='1310' cy='120' r='220' fill='%233f86c433'/%3E%3Ccircle cx='260' cy='760' r='260' fill='%232f7a6c2b'/%3E%3C/svg%3E");
  background-size: cover, cover;
  background-position: center, center;
  background-attachment: fixed, fixed;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  background:
    radial-gradient(circle at 11% 13%, rgba(122, 166, 210, 0.13) 0%, transparent 44%),
    radial-gradient(circle at 88% 82%, rgba(71, 128, 185, 0.08) 0%, transparent 45%);
}

.topbar {
  padding-top: 24px;
  padding-bottom: 16px;
}

h1 {
  font-size: 40px;
  line-height: 1.06;
}

.subtitle {
  color: #607487;
}

.panel {
  border-color: rgba(188, 203, 220, 0.82);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.9) 0%, rgba(247, 250, 255, 0.86) 100%);
  backdrop-filter: blur(8px);
  box-shadow: 0 22px 50px rgba(20, 34, 51, 0.13);
}

.workspace {
  gap: 14px;
}

.card {
  border-color: rgba(188, 203, 220, 0.84);
  background: linear-gradient(180deg, #ffffff 0%, #f9fcff 100%);
  box-shadow: 0 8px 18px rgba(20, 34, 51, 0.08);
}

.card::after {
  width: 108px;
  height: 5px;
  border-radius: 0 0 0 12px;
  background: linear-gradient(90deg, rgba(47, 109, 161, 0.2) 0%, var(--tone-accent) 100%);
}

.card:hover {
  transform: translateY(-1px);
  border-color: rgba(150, 173, 198, 0.95);
  box-shadow: 0 18px 32px rgba(20, 34, 51, 0.12);
}

.card:focus-within {
  border-color: rgba(134, 166, 200, 0.96);
  box-shadow: 0 0 0 3px rgba(46, 108, 160, 0.12), 0 16px 30px rgba(20, 34, 51, 0.11);
}

.headline h3 {
  font-size: 17px;
  color: #203245;
}

.headline h3::before {
  width: 8px;
  height: 8px;
  box-shadow: 0 0 0 4px rgba(90, 147, 198, 0.16);
}

.input {
  border-color: rgba(189, 204, 220, 0.96);
  background: #ffffff;
  border-radius: 11px;
}

.input:focus {
  border-color: #7fa4c7;
  box-shadow: 0 0 0 3px rgba(76, 133, 186, 0.18);
}

.btn {
  border-radius: 11px;
}

.btn.primary {
  background: linear-gradient(135deg, #4d86ba 0%, var(--theme-accent) 100%);
  box-shadow: 0 9px 18px rgba(47, 109, 161, 0.25);
}

.btn.ghost {
  background: rgba(255, 255, 255, 0.92);
  border-color: rgba(190, 205, 221, 0.96);
}

.btn.ghost:hover {
  background: #ffffff;
  border-color: rgba(166, 186, 209, 1);
}

.summary {
  margin-top: 12px;
  margin-bottom: 8px;
  gap: 9px;
}

.pill {
  font-weight: 800;
  border-radius: 999px;
}

.pill.engine {
  background: #eef4fb;
  color: #2e5f8e;
  border-color: rgba(88, 132, 178, 0.3);
}

.kpi-card {
  border-color: rgba(190, 205, 220, 0.95);
  background: linear-gradient(180deg, #ffffff 0%, #f7fbff 100%);
}

.kpi-card::after {
  width: 86px;
  height: 4px;
  background: linear-gradient(90deg, rgba(90, 147, 198, 0.4) 0%, var(--theme-accent) 100%);
}

.kpi-card:hover {
  border-color: rgba(159, 180, 203, 0.95);
  box-shadow: 0 14px 26px rgba(20, 34, 51, 0.11);
}

.kpi-label,
.kpi-sub {
  color: #667b90;
}

.kpi-value {
  color: #203245;
}

.sales-metric-card,
.sales-kpi-card,
.sales-panel,
.boss-panel,
.boss-money-card,
.opportunity-box,
.action-item,
.meta-item,
.detail-block,
.raw-details,
.manual-details,
.log-list,
.table-scroll,
.pre {
  border-color: rgba(190, 205, 220, 0.92);
}

.table-scroll,
.pre,
.raw-details,
.manual-details,
.log-list,
.meta-item,
.detail-block,
.boss-panel,
.sales-panel {
  background: linear-gradient(180deg, #ffffff 0%, #f9fcff 100%);
}

.result-table th {
  background: #edf3fb;
  color: #2c4c69;
}

.result-table tbody tr:nth-child(even):not(.active-row) {
  background: #f7fafe;
}

.click-row:hover {
  background: #eef4fb;
}

.click-row.active-row {
  background: #e6eef9;
  box-shadow: inset 4px 0 0 var(--theme-accent), inset 0 0 0 1px rgba(74, 130, 183, 0.14);
}

.badge.neutral {
  background: rgba(255, 255, 255, 0.92);
  border-color: rgba(189, 204, 220, 0.95);
  color: #365373;
}

.modal-overlay {
  background: rgba(12, 22, 36, 0.42);
}

.modal-panel {
  border-color: rgba(183, 200, 218, 0.95);
  background: #f4f8fd;
  box-shadow: 0 24px 50px rgba(9, 20, 34, 0.24);
}

.login-page .topbar,
.onboarding-public-page .topbar {
  padding-top: 30px;
}

.login-brand h1 {
  color: #1f3146;
}

.login-card {
  border-color: rgba(177, 196, 215, 0.9);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96) 0%, rgba(245, 251, 255, 0.94) 100%);
  box-shadow: 0 26px 52px rgba(20, 34, 51, 0.15);
}

.onboarding-step {
  background: #f7fbff;
  border-color: rgba(188, 203, 220, 0.95);
}

.onboarding-panel {
  border-color: rgba(188, 203, 220, 0.9);
  background: linear-gradient(180deg, #ffffff 0%, #f8fcff 100%);
}

.summary-title {
  border-color: rgba(182, 200, 220, 0.92);
  background: #edf3fb;
  color: #355b83;
}

@media (max-width: 760px) {
  h1 {
    font-size: 28px;
  }
}

/* UI/UX Pro Max refactor: Trust & Authority + Data-Dense SaaS Dashboard */
:root {
  --color-primary: #0f172a;
  --color-on-primary: #ffffff;
  --color-secondary: #334155;
  --color-accent: #0369a1;
  --color-background: #f8fafc;
  --color-foreground: #020617;
  --color-muted: #e8ecf1;
  --color-muted-foreground: #64748b;
  --color-border: #e2e8f0;
  --color-surface: #ffffff;
  --color-surface-raised: #fbfdff;
  --color-destructive: #dc2626;
  --color-success: #059669;
  --color-warning: #b7791f;
  --color-ring: #0f172a;

  --theme-accent: var(--color-accent);
  --theme-accent-2: #0ea5e9;
  --theme-accent-strong: #075985;
  --theme-accent-soft: #e0f2fe;
  --theme-text: #0f172a;
  --theme-muted: var(--color-muted-foreground);
  --theme-bg-1: #f8fafc;
  --theme-bg-2: #eef4f9;
  --theme-surface-1: var(--color-surface);
  --theme-surface-2: var(--color-surface-raised);
  --theme-line: var(--color-border);
  --theme-line-strong: #cbd5e1;
  --theme-focus: #0369a1;
  --theme-row-hover: #f1f5f9;
  --theme-row-active: #e0f2fe;
  --theme-row-stripe: #f8fafc;
  --ok: var(--color-success);
  --warn: var(--color-warning);
  --danger: var(--color-destructive);

  --radius-lg: 10px;
  --radius-md: 8px;
  --radius-sm: 8px;
  --shadow-lg: 0 18px 38px rgba(15, 23, 42, 0.10);
  --shadow-md: 0 10px 24px rgba(15, 23, 42, 0.09);
  --shadow-sm: 0 4px 12px rgba(15, 23, 42, 0.07);
  --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.06);
  --motion-fast: 160ms ease;
  --motion-normal: 220ms ease;

  --theme-font-body: "Plus Jakarta Sans", Inter, "Noto Sans SC", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  --theme-font-display: "Plus Jakarta Sans", Inter, "Noto Sans SC", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  --theme-font-mono: "JetBrains Mono", "SFMono-Regular", "Consolas", "Menlo", monospace;
}

html {
  background: var(--color-background);
}

body {
  position: relative;
  color: var(--theme-text);
  background: #f8fafc;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background-image:
    linear-gradient(115deg, rgba(248, 250, 252, 0.96), rgba(241, 245, 249, 0.92)),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='1600' height='900' viewBox='0 0 1600 900'%3E%3Crect width='1600' height='900' fill='%23f8fafc'/%3E%3Cg fill='none' stroke='%230f172a' stroke-opacity='.055'%3E%3Cpath d='M0 104h1600M0 208h1600M0 312h1600M0 416h1600M0 520h1600M0 624h1600M0 728h1600M0 832h1600'/%3E%3Cpath d='M104 0v900M208 0v900M312 0v900M416 0v900M520 0v900M624 0v900M728 0v900M832 0v900M936 0v900M1040 0v900M1144 0v900M1248 0v900M1352 0v900M1456 0v900'/%3E%3C/g%3E%3Cg fill='none' stroke='%230369a1' stroke-opacity='.08' stroke-width='2'%3E%3Cpath d='M100 690h250v-90h180v-130h220v65h175v-155h250v95h185'/%3E%3Cpath d='M132 742h186v-54h260v-84h208v112h220v-162h310'/%3E%3C/g%3E%3Cg fill='%230f172a' fill-opacity='.045'%3E%3Crect x='1020' y='135' width='190' height='96' rx='8'/%3E%3Crect x='1230' y='184' width='252' height='132' rx='8'/%3E%3Crect x='165' y='160' width='230' height='116' rx='8'/%3E%3C/g%3E%3C/svg%3E");
  background-size: cover, cover;
  background-position: center, center;
  background-attachment: fixed, fixed;
}

body::after {
  content: none;
}

body.modal-open {
  overflow: hidden;
}

* {
  scrollbar-color: #94a3b8 rgba(226, 232, 240, 0.9);
}

*::-webkit-scrollbar-track {
  background: rgba(226, 232, 240, 0.84);
}

*::-webkit-scrollbar-thumb {
  background: #94a3b8;
  border: 2px solid rgba(226, 232, 240, 0.84);
}

.bg-glow,
.bg-glow-1,
.bg-glow-2 {
  display: none !important;
}

.topbar {
  max-width: 1560px;
  padding: 24px 24px 14px;
  align-items: center;
}

.topbar > div:first-child {
  min-width: 0;
}

.top-actions {
  gap: 8px;
}

.eyebrow {
  color: var(--theme-accent-strong);
  font-size: 11px;
  letter-spacing: 0.12em;
  font-weight: 800;
}

h1 {
  max-width: 920px;
  color: #0f172a;
  font-size: 36px;
  line-height: 1.12;
  font-weight: 800;
}

.subtitle {
  max-width: 780px;
  color: #475569;
  font-size: 14px;
  line-height: 1.65;
}

.layout {
  max-width: 1560px;
}

.panel {
  border: 1px solid rgba(203, 213, 225, 0.95);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(10px);
}

.workspace {
  padding: 12px;
  gap: 12px;
}

.card {
  border: 1px solid rgba(203, 213, 225, 0.95);
  border-radius: 8px;
  background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
  box-shadow: var(--shadow-xs);
  transition: border-color var(--motion-normal), box-shadow var(--motion-normal), transform var(--motion-fast), background var(--motion-normal);
}

.card::after {
  width: 76px;
  height: 3px;
  border-radius: 0 0 0 8px;
  background: linear-gradient(90deg, rgba(3, 105, 161, 0.12), var(--tone-accent));
}

.card:hover {
  transform: translateY(-1px);
  border-color: #b6c6d8;
  box-shadow: var(--shadow-sm);
}

.card:focus-within {
  border-color: #7aa9cc;
  box-shadow: 0 0 0 3px rgba(3, 105, 161, 0.14), var(--shadow-sm);
}

.headline {
  min-height: 32px;
}

.headline h3 {
  color: #0f172a;
  font-size: 16px;
  font-weight: 800;
}

.headline h3::before {
  width: 6px;
  height: 18px;
  border-radius: 999px;
  background: var(--tone-accent);
  box-shadow: none;
}

.tone-overview,
.tone-customer-board,
.tone-sales-workspace {
  --tone-accent: #0369a1;
}

.tone-boss-review,
.tone-detail,
.tone-owner {
  --tone-accent: #0f766e;
}

.tone-risk,
.tone-security {
  --tone-accent: #b7791f;
}

.tone-pipeline-log,
.tone-system-log,
.tone-excel {
  --tone-accent: #475569;
}

.btn,
.input,
.compact-input,
.check-item {
  min-height: 44px;
  border-radius: 8px;
}

.btn {
  height: 44px;
  padding: 0 14px;
  font-size: 13px;
  font-weight: 800;
  touch-action: manipulation;
  transition: background var(--motion-fast), border-color var(--motion-fast), box-shadow var(--motion-fast), transform var(--motion-fast), opacity var(--motion-fast);
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0) scale(0.99);
}

.btn:focus-visible,
.input:focus-visible,
.check-item:focus-within,
.sales-metric-card:focus-visible,
.sales-kpi-card:focus-visible,
.sales-task-item:focus-visible,
.kpi-clickable-card:focus-visible {
  outline: 3px solid rgba(3, 105, 161, 0.24);
  outline-offset: 2px;
}

.btn.primary {
  color: #ffffff;
  background: #0369a1;
  border-color: #0369a1;
  box-shadow: 0 8px 18px rgba(3, 105, 161, 0.22);
}

.btn.primary:hover {
  background: #075985;
  border-color: #075985;
}

.btn.ghost {
  color: #0f172a;
  background: #ffffff;
  border-color: #cbd5e1;
}

.btn.ghost:hover {
  background: #f8fafc;
  border-color: #94a3b8;
  box-shadow: var(--shadow-xs);
}

.btn.danger {
  background: #b91c1c;
  border-color: #b91c1c;
  box-shadow: 0 8px 18px rgba(185, 28, 28, 0.18);
}

.input {
  height: 44px;
  border-color: #cbd5e1;
  background: #ffffff;
  color: #0f172a;
  font-size: 14px;
}

.input:focus {
  border-color: #0369a1;
  box-shadow: 0 0 0 3px rgba(3, 105, 161, 0.16);
}

.field-control {
  grid-template-rows: auto minmax(44px, auto) auto;
}

.field-control span,
.followup-grid label,
.followup-note-label {
  color: #334155;
}

.field-control small {
  color: #64748b;
}

.badge,
.pill,
.prio-pill,
.segment-pill,
.opportunity-pill,
.followup-pill,
.risk-tag {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  line-height: 1.1;
  border-radius: 999px;
  font-weight: 800;
}

.badge.neutral,
.pill.engine {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #334155;
}

.badge.ok,
.pill.ok {
  background: rgba(5, 150, 105, 0.10);
  border-color: rgba(5, 150, 105, 0.28);
  color: #047857;
}

.badge.fail,
.pill.warn {
  background: rgba(183, 121, 31, 0.12);
  border-color: rgba(183, 121, 31, 0.28);
  color: #8a4f12;
}

.summary {
  gap: 8px;
}

.kpi-grid {
  gap: 8px;
}

.kpi-card {
  min-height: 112px;
  border: 1px solid #d8e1ec;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow-xs);
}

.kpi-card::after {
  width: 64px;
  height: 3px;
  background: #0369a1;
}

.kpi-card:hover {
  border-color: #b6c6d8;
  box-shadow: var(--shadow-sm);
}

.kpi-label,
.kpi-sub,
.boss-money-label,
.boss-money-sub,
.boss-money-note {
  color: #64748b;
}

.kpi-value,
.boss-money-value {
  color: #0f172a;
  font-variant-numeric: tabular-nums;
}

.sales-workspace,
.user-manage-card {
  background: #ffffff;
}

.sales-metric-card,
.sales-kpi-card,
.sales-panel,
.boss-panel,
.boss-money-card,
.boss-watch-block,
.boss-customer-link,
.boss-stat-line,
.meta-item,
.action-item,
.opportunity-box,
.customer-review-section,
.customer-review-card,
.script-card,
.battle-owner,
.battle-summary-block,
.detail-block,
.raw-details,
.manual-details,
.log-list,
.pre,
.table-scroll {
  border-color: #d8e1ec;
  border-radius: 8px;
  background: #ffffff;
}

.sales-metric-card,
.sales-kpi-card {
  min-height: 92px;
}

.sales-metric-card:hover,
.sales-kpi-card:hover,
.sales-task-item:hover,
.sales-task-item:focus,
.sales-task-item.active,
.boss-customer-link:hover {
  background: #f8fafc;
  border-color: #b6c6d8;
  box-shadow: inset 3px 0 0 var(--theme-accent);
}

.sales-task-item,
.log-item {
  border-radius: 8px;
}

.sales-task-item {
  border-color: #d8e1ec;
}

.sales-task-title strong,
.boss-panel-head h4,
.sales-panel-head h4 {
  color: #0f172a;
}

.table-scroll {
  background: #ffffff;
  box-shadow: var(--shadow-xs);
}

.result-table th,
.result-table td {
  border-bottom-color: #e2e8f0;
}

.result-table th {
  color: #334155;
  background: #f1f5f9;
  font-weight: 800;
}

.result-table thead th {
  box-shadow: inset 0 -1px 0 #cbd5e1;
}

.result-table tbody tr:nth-child(even):not(.active-row) {
  background: #fbfdff;
}

.click-row:hover,
.log-item:hover {
  background: #f1f5f9;
}

.click-row.active-row,
.log-item.active {
  background: #e0f2fe;
  box-shadow: inset 4px 0 0 #0369a1;
}

.modal-overlay {
  background: rgba(15, 23, 42, 0.50);
  backdrop-filter: blur(5px);
}

.modal-panel {
  border-radius: 10px;
  border-color: #cbd5e1;
  background: #f8fafc;
  box-shadow: 0 28px 70px rgba(15, 23, 42, 0.28);
}

.modal-head,
#customerModal .modal-head {
  border-color: #d8e1ec;
  background: #ffffff;
  border-radius: 8px;
}

.login-page,
.onboarding-public-page {
  min-height: 100dvh;
}

.login-shell {
  min-height: calc(100dvh - 220px);
}

.login-card {
  width: min(720px, 100%);
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.16);
}

.onboarding-card {
  width: min(920px, 100%);
}

.onboarding-step,
.onboarding-panel {
  border-color: #d8e1ec;
  border-radius: 8px;
  background: #ffffff;
}

.onboarding-step.active {
  border-color: #7aa9cc;
  background: #eff6ff;
  color: #0f172a;
}

.onboarding-step .dot,
.onboarding-step.active .dot {
  background: #0369a1;
  color: #ffffff;
}

.workspace-auth-note {
  border-color: #cbd5e1;
  border-left-color: #0369a1;
  background: #f8fafc;
  color: #334155;
}

.pre {
  background: #0f172a;
  color: #dbeafe;
  border-color: #1e293b;
}

.detail-pre,
.manual-details .pre,
#messagePreview,
#backgroundResult,
#analysisTableBody + .pre {
  background: #f8fafc;
  color: #0f172a;
  border-color: #d8e1ec;
}

.toast {
  border-color: #cbd5e1;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow-md);
}

.global-loading {
  position: fixed;
  top: 16px;
  left: 50%;
  z-index: 120;
  width: min(460px, calc(100vw - 32px));
  transform: translateX(-50%);
  overflow: hidden;
  border: 1px solid rgba(203, 213, 225, 0.86);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 18px 44px rgba(15, 23, 42, 0.14);
  backdrop-filter: blur(14px);
}

.global-loading.hidden {
  display: none;
}

.global-loading-bar {
  position: absolute;
  top: 0;
  left: 0;
  height: 3px;
  width: 42%;
  border-radius: 999px;
  background: linear-gradient(90deg, #0ea5e9, #059669);
  animation: loading-track 1.1s ease-in-out infinite;
}

.global-loading-content {
  min-height: 48px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 16px 12px;
  color: #0f172a;
  font-size: 13px;
  font-weight: 800;
}

.loading-spinner {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  border: 2px solid rgba(14, 165, 233, 0.18);
  border-top-color: #0284c7;
  border-radius: 999px;
  animation: spin 0.82s linear infinite;
}

.loading-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 120px;
  color: #475569;
  font-size: 13px;
  font-weight: 800;
}

.loading-inline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #475569;
  font-size: 12px;
  font-weight: 800;
}

.loading-inline .loading-spinner,
.loading-row .loading-spinner {
  width: 16px;
  height: 16px;
}

.table-loading-row td {
  padding: 26px !important;
}

@keyframes loading-track {
  0% {
    transform: translateX(-120%);
  }
  50% {
    transform: translateX(90%);
  }
  100% {
    transform: translateX(260%);
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}

@media (max-width: 760px) {
  .topbar {
    gap: 12px;
  }

  .top-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .top-actions .btn,
  .top-actions .badge {
    min-height: 40px;
  }

  h1 {
    font-size: 28px;
    line-height: 1.16;
  }

  .card,
  .panel {
    border-radius: 8px;
  }

  .workspace {
    padding: 10px;
  }
}

/* UI/UX Pro Max: Enterprise visual polish */
:root {
  --enterprise-ink: #020617;
  --enterprise-navy: #0f172a;
  --enterprise-blue: #0369a1;
  --enterprise-blue-strong: #075985;
  --enterprise-teal: #0f766e;
  --enterprise-gold: #b7791f;
  --enterprise-bg: #f8fafc;
  --enterprise-surface: #ffffff;
  --enterprise-muted: #64748b;
  --enterprise-border: #e2e8f0;
  --enterprise-border-strong: #cbd5e1;
  --enterprise-shadow: 0 20px 50px rgba(15, 23, 42, 0.10);
  --enterprise-shadow-soft: 0 8px 24px rgba(15, 23, 42, 0.08);
}

body {
  background:
    linear-gradient(115deg, rgba(248, 250, 252, 0.96), rgba(241, 245, 249, 0.94)),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='1600' height='900' viewBox='0 0 1600 900'%3E%3Crect width='1600' height='900' fill='%23f8fafc'/%3E%3Cg fill='none' stroke='%230f172a' stroke-opacity='.05'%3E%3Cpath d='M0 96h1600M0 192h1600M0 288h1600M0 384h1600M0 480h1600M0 576h1600M0 672h1600M0 768h1600M0 864h1600'/%3E%3Cpath d='M96 0v900M192 0v900M288 0v900M384 0v900M480 0v900M576 0v900M672 0v900M768 0v900M864 0v900M960 0v900M1056 0v900M1152 0v900M1248 0v900M1344 0v900M1440 0v900M1536 0v900'/%3E%3C/g%3E%3Cg fill='none' stroke='%230369a1' stroke-opacity='.10' stroke-width='2'%3E%3Cpath d='M96 696h248v-84h188v-128h224v66h172v-154h254v96h326'/%3E%3Cpath d='M128 752h184v-52h260v-84h210v112h222v-160h338'/%3E%3C/g%3E%3Cg fill='%230f172a' fill-opacity='.04'%3E%3Crect x='990' y='128' width='210' height='104' rx='8'/%3E%3Crect x='1224' y='178' width='256' height='132' rx='8'/%3E%3Crect x='150' y='150' width='236' height='118' rx='8'/%3E%3C/g%3E%3C/svg%3E");
  background-size: cover, cover;
  background-attachment: fixed, fixed;
}

body.login-page {
  background:
    linear-gradient(120deg, rgba(15, 23, 42, 0.96) 0%, rgba(15, 23, 42, 0.90) 38%, rgba(248, 250, 252, 0.96) 38%, rgba(241, 245, 249, 0.98) 100%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='1400' height='900' viewBox='0 0 1400 900'%3E%3Crect width='1400' height='900' fill='%230f172a'/%3E%3Cg fill='none' stroke='%23ffffff' stroke-opacity='.08'%3E%3Cpath d='M110 120h310v150H110zM160 340h420v210H160zM720 150h360v150H720zM760 420h470v230H760z'/%3E%3Cpath d='M110 680h1120M110 720h1120M110 760h1120'/%3E%3C/g%3E%3Cg fill='none' stroke='%230ea5e9' stroke-opacity='.26' stroke-width='3'%3E%3Cpath d='M130 620h210v-90h180v-160h240v92h220v-190h260'/%3E%3C/g%3E%3C/svg%3E");
  background-size: cover, cover;
  background-position: center, center;
}

body.login-page::before {
  content: none;
}

.topbar {
  padding-top: 28px;
  padding-bottom: 16px;
}

.topbar h1 {
  letter-spacing: 0;
}

.top-actions {
  align-items: center;
  padding: 6px;
  border: 1px solid rgba(226, 232, 240, 0.78);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.74);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  backdrop-filter: blur(12px);
}

.top-actions .btn,
.top-actions .badge {
  height: 38px;
  min-height: 38px;
}

.panel {
  background: rgba(255, 255, 255, 0.82);
  box-shadow: var(--enterprise-shadow);
}

.workspace {
  gap: 14px;
}

.card {
  padding: 14px;
  background: linear-gradient(180deg, #ffffff 0%, #fcfdff 100%);
}

.card::after {
  opacity: 0.92;
}

.headline h3 {
  letter-spacing: 0;
}

.focus-card,
.task-command-card,
.tone-overview:first-child {
  box-shadow: var(--enterprise-shadow-soft);
}

.task-command-card {
  padding: 18px;
  border-color: #b7d7ea;
  background:
    linear-gradient(135deg, rgba(224, 242, 254, 0.72), rgba(255, 255, 255, 0.96) 42%),
    #ffffff;
}

.task-command-card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(3, 105, 161, 0.08), transparent 38%),
    radial-gradient(circle at 92% 12%, rgba(14, 165, 233, 0.18), transparent 26%);
}

.task-command-card .headline {
  align-items: flex-start;
}

.task-command-card .headline h3 {
  font-size: 18px;
}

.task-command-card .pipeline-grid {
  position: relative;
  z-index: 1;
}

.analysis-disabled-grid {
  opacity: 0.92;
}

.analysis-disabled-grid .input:disabled,
.model-field .input:disabled {
  cursor: not-allowed;
  color: #64748b;
  background: #f1f5f9;
  border-color: rgba(203, 213, 225, 0.9);
}

.field-control.model-field {
  grid-template-rows: auto 40px auto auto;
}

.model-field .input[hidden] {
  display: none;
}

.workspace-auth-note {
  max-width: 960px;
  border-left-color: var(--enterprise-blue);
  background: rgba(248, 250, 252, 0.92);
}

.tone-pipeline-log .pre,
.tone-system-log .pre {
  min-height: 220px;
  max-height: 420px;
  white-space: pre-wrap;
  color: #dbeafe;
  background:
    linear-gradient(180deg, rgba(15, 23, 42, 0.96), rgba(30, 41, 59, 0.98));
}

.tone-system-log .pre {
  color: #e2e8f0;
}

.login-topbar {
  display: none;
}

.login-layout {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding-top: 28px;
  padding-bottom: 28px;
}

.login-shell {
  width: min(1180px, 100%);
  min-height: auto;
  display: grid;
  grid-template-columns: minmax(320px, 0.92fr) minmax(420px, 1fr);
  gap: 0;
  place-items: stretch;
  padding: 0;
  border: 1px solid rgba(203, 213, 225, 0.78);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 34px 90px rgba(15, 23, 42, 0.26);
  overflow: hidden;
}

.auth-brand-panel {
  position: relative;
  min-height: 620px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 24px;
  padding: 34px;
  color: #e2e8f0;
  background:
    linear-gradient(160deg, rgba(15, 23, 42, 0.98), rgba(30, 41, 59, 0.95)),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='760' height='760' viewBox='0 0 760 760'%3E%3Cg fill='none' stroke='%23e0f2fe' stroke-opacity='.09'%3E%3Cpath d='M40 160h270v130H40zM84 380h360v190H84zM420 110h250v120H420zM500 430h180v155H500z'/%3E%3Cpath d='M78 642h590M78 684h590M78 726h590'/%3E%3C/g%3E%3Cg fill='none' stroke='%230ea5e9' stroke-opacity='.34' stroke-width='3'%3E%3Cpath d='M62 610h152v-78h128v-112h172v68h118v-146h82'/%3E%3C/g%3E%3C/svg%3E");
  background-size: cover, cover;
  background-position: center, center;
  overflow: hidden;
}

.auth-brand-panel::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 22% 20%, rgba(14, 165, 233, 0.26), transparent 24%),
    linear-gradient(180deg, transparent 0%, rgba(2, 6, 23, 0.30) 100%);
}

.auth-brand-panel > * {
  position: relative;
  z-index: 1;
}

.auth-brand-mark {
  width: 54px;
  height: 54px;
  display: block;
  border: 1px solid rgba(226, 232, 240, 0.24);
  border-radius: 10px;
  color: #ffffff;
  background: rgba(14, 165, 233, 0.18);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
  object-fit: cover;
}

.auth-brand-panel .eyebrow {
  margin-top: auto;
  color: #7dd3fc;
}

.auth-brand-panel h2 {
  margin: 8px 0 0;
  max-width: 440px;
  color: #ffffff;
  font-size: 34px;
  line-height: 1.14;
  letter-spacing: 0;
}

.auth-brand-panel p:not(.eyebrow) {
  margin: 14px 0 0;
  max-width: 460px;
  color: #cbd5e1;
  font-size: 14px;
  line-height: 1.78;
}

.auth-brand-stats {
  display: grid;
  gap: 10px;
  margin-top: 28px;
}

.auth-brand-stats div {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid rgba(226, 232, 240, 0.14);
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.34);
}

.auth-brand-stats strong {
  color: #ffffff;
  font-size: 13px;
}

.auth-brand-stats span {
  color: #cbd5e1;
  font-size: 12px;
  line-height: 1.5;
}

.login-card,
.onboarding-card {
  width: 100%;
  min-height: 620px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  border: 0;
  border-radius: 0;
  padding: 38px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: none;
}

.login-card::after {
  width: 96px;
  height: 3px;
  background: var(--enterprise-blue);
}

.login-card-head {
  align-items: flex-start;
}

.login-card-head .headline h3,
.onboarding-panel .headline h3 {
  font-size: 20px;
}

.login-subtitle {
  margin-top: 10px;
  color: #64748b;
}

.login-form {
  margin-top: 22px;
}

.login-grid {
  gap: 14px;
}

.login-submit-row {
  margin-top: 18px;
}

.login-message {
  margin-top: 18px;
  border-radius: 8px;
}

.login-footnote {
  margin-top: 14px;
  color: #64748b;
}

.onboarding-stepper {
  gap: 10px;
  margin-bottom: 18px;
}

.onboarding-step {
  min-height: 58px;
  padding: 10px 12px;
  border-radius: 8px;
  background: #f8fafc;
}

.onboarding-step.active {
  border-color: rgba(3, 105, 161, 0.38);
  background: #e0f2fe;
}

.onboarding-step.done {
  border-color: rgba(5, 150, 105, 0.34);
  background: #ecfdf5;
}

.onboarding-panel {
  padding: 16px;
  border-radius: 8px;
}

.kpi-grid-7 {
  grid-template-columns: repeat(auto-fit, minmax(172px, 1fr));
}

.kpi-card {
  padding: 14px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.94));
}

#kpiCardDueToday,
#kpiCardOverdue,
#kpiCardAOpportunity,
#kpiCardUrgent {
  min-height: 122px;
  border-color: rgba(3, 105, 161, 0.34);
  background:
    linear-gradient(180deg, #ffffff, #f0f9ff);
  box-shadow: 0 8px 24px rgba(3, 105, 161, 0.10);
}

#kpiCardOverdue,
#kpiCardAOpportunity {
  border-color: rgba(220, 38, 38, 0.30);
  background:
    linear-gradient(180deg, #ffffff, #fff7ed);
  box-shadow: 0 8px 24px rgba(185, 28, 28, 0.08);
}

.kpi-label {
  font-weight: 800;
}

.kpi-value {
  font-size: 31px;
  line-height: 1.05;
}

.sales-workspace {
  border-color: rgba(3, 105, 161, 0.24);
  background:
    linear-gradient(135deg, rgba(224, 242, 254, 0.64), rgba(255, 255, 255, 0.94) 40%),
    #ffffff;
}

.sales-workspace .headline h3 {
  font-size: 18px;
}

.sales-metric-card {
  min-height: 112px;
  padding: 14px;
  border-color: #cbd5e1;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
}

.sales-metric-card strong {
  margin-top: 8px;
  font-size: 34px;
}

.sales-kpi-card {
  min-height: 86px;
  padding: 11px;
}

.sales-panel,
.boss-panel {
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
}

.tone-boss-review {
  background:
    linear-gradient(135deg, rgba(240, 253, 250, 0.62), rgba(255, 255, 255, 0.96) 42%),
    #ffffff;
}

.boss-money-card {
  min-height: 116px;
  border-color: #cbd5e1;
  background: linear-gradient(180deg, #ffffff, #f8fafc);
}

.tone-customer-board .filters-grid {
  padding: 10px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #f8fafc;
}

.table-scroll {
  overflow: auto;
  border-color: #d8e1ec;
}

.result-table th {
  position: sticky;
  top: 0;
  z-index: 2;
}

.result-table td {
  color: #334155;
}

.result-table.compact th,
.result-table.compact td {
  padding-top: 9px;
  padding-bottom: 9px;
}

.customer-review-section {
  padding: 14px;
  background: #ffffff;
}

.review-hero-section {
  border-color: rgba(3, 105, 161, 0.24);
  background:
    linear-gradient(135deg, rgba(224, 242, 254, 0.7), rgba(255, 255, 255, 0.96) 40%),
    #ffffff;
}

.modal-panel {
  border-radius: 12px;
}

#customerModal .modal-head {
  position: sticky;
  top: 0;
  z-index: 10;
  box-shadow: 0 1px 0 #e2e8f0;
}

.security-page .workspace > .card,
.platform-table-scroll,
.user-table-scroll {
  box-shadow: var(--shadow-xs);
}

.user-create-panel,
.followup-form {
  border-color: #e2e8f0;
}

.user-create-panel {
  margin-top: 12px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #f8fafc;
  padding: 12px;
}

.platform-security-textarea,
.multiline-input,
textarea.input {
  min-height: 140px;
  line-height: 1.55;
}

@media (max-width: 1180px) {
  .login-shell {
    grid-template-columns: 0.9fr 1fr;
  }

  .auth-brand-panel,
  .login-card,
  .onboarding-card {
    min-height: 580px;
  }

  .sales-workspace-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .sales-kpi-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 920px) {
  body.login-page {
    background: #f8fafc;
  }

  .login-shell {
    grid-template-columns: 1fr;
    max-width: 720px;
  }

  .auth-brand-panel {
    min-height: auto;
    padding: 26px;
  }

  .auth-brand-panel h2 {
    font-size: 28px;
  }

  .auth-brand-stats {
    grid-template-columns: 1fr;
  }

  .login-card,
  .onboarding-card {
    min-height: auto;
    padding: 28px;
  }

  .onboarding-stepper {
    grid-template-columns: 1fr;
  }

  .task-command-card .headline {
    display: grid;
    align-items: start;
  }
}

@media (max-width: 760px) {
  .topbar {
    padding: 18px 14px 12px;
  }

  .top-actions {
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
    backdrop-filter: none;
  }

  .layout {
    padding-left: 14px;
    padding-right: 14px;
  }

  .login-layout {
    padding: 16px 12px;
  }

  .login-shell {
    border-radius: 10px;
  }

  .auth-brand-panel {
    padding: 22px;
  }

  .auth-brand-panel h2 {
    font-size: 24px;
  }

  .login-card,
  .onboarding-card {
    padding: 22px;
  }

  .login-grid,
  .followup-grid,
  .task-pipeline-grid {
    grid-template-columns: 1fr !important;
  }

  .inline-actions,
  .login-submit-row {
    flex-wrap: wrap;
  }

  .inline-actions .btn,
  .login-submit-row .btn {
    flex: 1 1 160px;
  }

  .sales-workspace-summary,
  .sales-kpi-grid,
  .sales-workspace-grid {
    grid-template-columns: 1fr;
  }

  .kpi-value {
    font-size: 28px;
  }

  .tone-pipeline-log .pre,
  .tone-system-log .pre {
    min-height: 180px;
  }
}

/* Customer review hierarchy polish */
#customerModal .modal-panel {
  background:
    linear-gradient(180deg, rgba(248, 250, 252, 0.96), rgba(241, 245, 249, 0.98));
}

#customerModal .customer-review-section {
  padding: 18px;
  border-radius: 10px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--review-bg) 76%, #ffffff), #ffffff 46%),
    #ffffff;
  box-shadow: 0 14px 32px rgba(15, 23, 42, 0.08);
}

#customerModal .customer-review-section::before {
  width: 5px;
}

#customerModal .customer-review-section .headline h3 {
  font-size: 15px;
  line-height: 1.35;
  font-weight: 650;
}

#customerModal .customer-review-section .headline h3::before {
  width: 6px;
  height: 18px;
  border-radius: 999px;
}

#customerModal .review-tone-analysis {
  --review-accent: #0369a1;
  --review-bg: #eff6ff;
  --review-border: #bfdbfe;
}

#customerModal .review-tone-value {
  --review-accent: #0f766e;
  --review-bg: #ecfdf5;
  --review-border: #bbf7d0;
}

#customerModal .review-tone-blockage {
  --review-accent: #b7791f;
  --review-bg: #fff7ed;
  --review-border: #fed7aa;
}

#customerModal .review-tone-next {
  --review-accent: #4f46e5;
  --review-bg: #eef2ff;
  --review-border: #c7d2fe;
}

#customerModal .review-tone-sales-assistant {
  --review-accent: #0f766e;
  --review-bg: #ecfdf5;
  --review-border: #a7f3d0;
}

#customerModal .customer-review-cards {
  gap: 12px;
}

#customerModal .customer-analysis-cards {
  grid-template-columns: 1.15fr repeat(4, minmax(0, 1fr));
}

#customerModal .review-tone-value .customer-review-cards,
#customerModal .review-tone-blockage .customer-review-cards {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

#customerModal .review-tone-value .customer-review-card.featured,
#customerModal .review-tone-blockage .customer-review-card.featured {
  grid-column: span 3;
}

#customerModal .review-tone-value .customer-review-card:not(.featured),
#customerModal .review-tone-blockage .customer-review-card:not(.featured) {
  grid-column: span 3;
}

#customerModal .review-tone-value .upsell-card {
  grid-column: span 6;
}

#customerModal .customer-review-card {
  position: relative;
  min-height: 150px;
  padding: 14px;
  border-color: color-mix(in srgb, var(--review-accent) 22%, #d8e1ec);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.92));
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
  transition: border-color var(--motion-fast), box-shadow var(--motion-fast), transform var(--motion-fast);
}

#customerModal .customer-review-card::after {
  content: "";
  position: absolute;
  inset: 0 auto auto 0;
  width: 64px;
  height: 3px;
  border-radius: 0 0 8px 0;
  background: color-mix(in srgb, var(--review-accent) 72%, #ffffff);
}

#customerModal .customer-review-card:hover {
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--review-accent) 42%, #cbd5e1);
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.08);
}

#customerModal .customer-review-card.featured,
#customerModal .customer-review-card.signal-card,
#customerModal .customer-review-card.critical-card,
#customerModal .customer-review-card.action-card {
  border-color: color-mix(in srgb, var(--review-accent) 38%, #d8e1ec);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--review-bg) 82%, #ffffff), #ffffff 58%);
}

#customerModal .customer-review-card.featured {
  box-shadow: 0 10px 28px color-mix(in srgb, var(--review-accent) 12%, transparent);
}

#customerModal .customer-review-card.critical-card {
  border-color: rgba(183, 121, 31, 0.36);
  background:
    linear-gradient(135deg, rgba(255, 247, 237, 0.92), #ffffff 62%);
}

#customerModal .customer-review-card.signal-card {
  border-color: rgba(3, 105, 161, 0.30);
}

#customerModal .customer-review-card.action-card {
  border-color: rgba(15, 118, 110, 0.34);
}

#customerModal .customer-review-card h4 {
  min-height: 21px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: color-mix(in srgb, var(--review-accent) 84%, #0f172a);
  font-size: 12px;
  line-height: 1.35;
  font-weight: 650;
}

#customerModal .sales-assistant-board.customer-review-cards {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

#customerModal .sales-assistant-board .customer-review-card {
  min-height: 138px;
}

#customerModal .mistake-board {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

#customerModal .mistake-board .review-card {
  min-height: 136px;
  border-color: rgba(162, 111, 86, 0.24);
  background:
    linear-gradient(180deg, rgba(255, 253, 250, 0.98), rgba(255, 248, 245, 0.92));
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
}

#customerModal .customer-review-card h4::before {
  content: "";
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: color-mix(in srgb, var(--review-accent) 78%, #ffffff);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--review-accent) 12%, transparent);
}

#customerModal .customer-review-value {
  margin-top: 10px;
  font-size: 12.5px;
  line-height: 1.62;
}

#customerModal .insight-line {
  grid-template-columns: minmax(50px, 0.26fr) minmax(0, 1fr);
  gap: 12px;
  padding: 8px 0;
  border-top-color: rgba(148, 163, 184, 0.24);
}

#customerModal .insight-line span {
  color: #64748b;
  font-size: 11.5px;
  font-weight: 650;
}

#customerModal .insight-line strong {
  color: #0f172a;
  font-size: 12.5px;
  line-height: 1.55;
  font-weight: 600;
}

#customerModal .featured .insight-line strong,
#customerModal .signal-card .insight-line strong,
#customerModal .critical-card .insight-line strong {
  font-size: 13px;
  font-weight: 650;
}

#customerModal .review-tone-next {
  min-height: 320px;
}

#customerModal .modal-next-grid {
  grid-template-columns: minmax(420px, 0.82fr) minmax(0, 1.18fr);
  gap: 14px;
}

#customerModal .modal-next-grid .opportunity-box {
  min-height: 224px;
  padding: 16px;
  border-color: rgba(79, 70, 229, 0.24);
  background:
    linear-gradient(135deg, rgba(238, 242, 255, 0.88), #ffffff 60%);
  box-shadow: 0 10px 28px rgba(79, 70, 229, 0.08);
}

#customerModal .opportunity-headline {
  gap: 10px;
}

#customerModal .mini-score {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  padding: 4px 9px;
  border: 1px solid rgba(79, 70, 229, 0.22);
  border-radius: 999px;
  background: #ffffff;
  color: #4338ca;
  font-size: 12px;
  font-weight: 700;
}

#customerModal .opportunity-reason {
  margin-top: 14px;
  color: #0f172a;
  font-size: 13px;
  line-height: 1.68;
  font-weight: 600;
}

#customerModal .script-copy {
  margin-top: 14px;
  padding: 12px 14px;
  border-left: 4px solid #4f46e5;
  border-radius: 0 8px 8px 0;
  background: #ffffff;
  color: #334155;
  font-size: 13px;
  line-height: 1.68;
}

#customerModal .opportunity-meta {
  margin-top: 14px;
  gap: 8px;
}

#customerModal .opportunity-meta span {
  padding: 4px 9px;
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  background: #ffffff;
  color: #64748b;
}

#customerModal .detail-actions {
  margin-top: 0;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

#customerModal .action-item {
  min-height: 92px;
  padding: 13px;
  border-radius: 9px;
  border-color: rgba(79, 70, 229, 0.18);
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
}

#customerModal .action-item.primary-action,
#customerModal .action-item.urgent-action {
  grid-column: span 2;
  min-height: 104px;
}

#customerModal .action-item.primary-action {
  border-color: rgba(79, 70, 229, 0.34);
  background:
    linear-gradient(135deg, rgba(238, 242, 255, 0.92), #ffffff 64%);
}

#customerModal .action-item.urgent-action {
  border-color: rgba(220, 38, 38, 0.24);
  background:
    linear-gradient(135deg, rgba(254, 242, 242, 0.86), #ffffff 64%);
}

#customerModal .action-item.important-action {
  border-color: rgba(183, 121, 31, 0.26);
  background:
    linear-gradient(135deg, rgba(255, 247, 237, 0.82), #ffffff 66%);
}

#customerModal .action-item.longterm-action {
  border-color: rgba(15, 118, 110, 0.24);
  background:
    linear-gradient(135deg, rgba(236, 253, 245, 0.84), #ffffff 66%);
}

#customerModal .action-item.meta-action {
  min-height: 74px;
  background: #f8fafc;
}

#customerModal .action-key {
  color: #475569;
  font-size: 12px;
  font-weight: 700;
}

#customerModal .action-val {
  margin-top: 8px;
  color: #0f172a;
  font-size: 13px;
  line-height: 1.62;
  font-weight: 550;
}

#customerModal .action-item.primary-action .action-val,
#customerModal .action-item.urgent-action .action-val {
  font-size: 13.5px;
  font-weight: 650;
}

@media (max-width: 1280px) {
  #customerModal .customer-analysis-cards,
  #customerModal .sales-assistant-board.customer-review-cards,
  #customerModal .mistake-board,
  #customerModal .review-tone-value .customer-review-cards,
  #customerModal .review-tone-blockage .customer-review-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #customerModal .review-tone-value .customer-review-card,
  #customerModal .review-tone-blockage .customer-review-card,
  #customerModal .review-tone-value .customer-review-card.featured,
  #customerModal .review-tone-blockage .customer-review-card.featured,
  #customerModal .review-tone-value .upsell-card {
    grid-column: auto;
  }

  #customerModal .modal-next-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  #customerModal .customer-review-section {
    padding: 14px;
  }

  #customerModal .customer-analysis-cards,
  #customerModal .sales-assistant-board.customer-review-cards,
  #customerModal .mistake-board,
  #customerModal .review-tone-value .customer-review-cards,
  #customerModal .review-tone-blockage .customer-review-cards,
  #customerModal .detail-actions {
    grid-template-columns: 1fr;
  }

  #customerModal .action-item.primary-action,
  #customerModal .action-item.urgent-action {
    grid-column: auto;
  }

  #customerModal .customer-review-section .headline h3 {
    font-size: 15px;
  }

  #customerModal .insight-line {
    grid-template-columns: 1fr;
    gap: 4px;
  }
}

/* Dashboard premium shell */
body.dashboard-page {
  background:
    linear-gradient(115deg, rgba(248, 250, 252, 0.98), rgba(241, 245, 249, 0.94)),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='1600' height='900' viewBox='0 0 1600 900'%3E%3Crect width='1600' height='900' fill='%23f8fafc'/%3E%3Cg fill='none' stroke='%230f172a' stroke-opacity='.045'%3E%3Cpath d='M0 104h1600M0 208h1600M0 312h1600M0 416h1600M0 520h1600M0 624h1600M0 728h1600M0 832h1600'/%3E%3Cpath d='M104 0v900M208 0v900M312 0v900M416 0v900M520 0v900M624 0v900M728 0v900M832 0v900M936 0v900M1040 0v900M1144 0v900M1248 0v900M1352 0v900M1456 0v900'/%3E%3C/g%3E%3Cg fill='none' stroke='%230369a1' stroke-opacity='.08' stroke-width='2'%3E%3Cpath d='M100 690h250v-90h180v-130h220v65h175v-155h250v95h185'/%3E%3Cpath d='M132 742h186v-54h260v-84h208v112h220v-162h310'/%3E%3C/g%3E%3C/svg%3E");
  background-size: cover, cover;
  background-attachment: fixed, fixed;
}

body.dashboard-page::before {
  content: none;
}

body.dashboard-page .topbar {
  position: relative;
  z-index: 1;
  min-height: auto;
  align-items: flex-start;
  margin-top: 18px;
  padding: 22px 24px;
  border: 1px solid rgba(203, 213, 225, 0.76);
  border-radius: 14px;
  color: #0f172a;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(240, 249, 255, 0.88) 54%, rgba(255, 255, 255, 0.96)),
    #ffffff;
  box-shadow: 0 18px 44px rgba(15, 23, 42, 0.08);
}

body.dashboard-page .eyebrow {
  color: #0369a1;
}

body.dashboard-page h1 {
  max-width: 760px;
  color: #0f172a;
  font-size: 38px;
  line-height: 1.08;
}

body.dashboard-page .subtitle {
  color: #475569;
  max-width: 660px;
}

body.dashboard-page .top-actions {
  border-color: rgba(203, 213, 225, 0.78);
  background: rgba(248, 250, 252, 0.88);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.84), 0 8px 22px rgba(15, 23, 42, 0.06);
}

body.dashboard-page .top-actions .btn.ghost {
  border-color: rgba(203, 213, 225, 0.96);
  background: #ffffff;
  color: #0f172a;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

body.dashboard-page .top-actions .btn.ghost:hover {
  border-color: rgba(14, 165, 233, 0.38);
  background: #f0f9ff;
  box-shadow: 0 8px 18px rgba(3, 105, 161, 0.10);
}

body.dashboard-page .top-actions #tasksLink {
  border-color: rgba(14, 165, 233, 0.28);
  background: #e0f2fe;
  color: #075985;
}

body.dashboard-page .top-actions #securityLink {
  border-color: rgba(5, 150, 105, 0.24);
  background: #ecfdf5;
  color: #047857;
}

body.dashboard-page .top-actions #platformLink {
  border-color: rgba(79, 70, 229, 0.22);
  background: #eef2ff;
  color: #3730a3;
}

body.dashboard-page .top-actions #logoutBtn {
  color: #475569;
}

body.dashboard-page .top-actions .badge.neutral {
  border-color: rgba(3, 105, 161, 0.22);
  background: #f0f9ff;
  color: #075985;
}

body.dashboard-page .top-actions .badge.ok {
  border-color: rgba(5, 150, 105, 0.26);
  background: #ecfdf5;
  color: #047857;
}

body.dashboard-page .top-actions .badge.warn,
body.dashboard-page .top-actions .badge.fail {
  border-color: rgba(183, 121, 31, 0.28);
  background: #fff7ed;
  color: #92400e;
}

body.dashboard-page .layout {
  margin-top: 16px;
}

body.dashboard-page .panel.workspace {
  padding: 18px;
  border-color: rgba(203, 213, 225, 0.72);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.84);
  box-shadow: 0 20px 54px rgba(15, 23, 42, 0.09);
  backdrop-filter: blur(14px);
}

body.dashboard-page .card {
  border-radius: 10px;
  border-color: rgba(203, 213, 225, 0.82);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.96));
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 14px 34px rgba(15, 23, 42, 0.06);
}

body.dashboard-page .card:hover {
  transform: none;
  border-color: rgba(14, 165, 233, 0.32);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05), 0 18px 42px rgba(15, 23, 42, 0.08);
}

body.dashboard-page .headline {
  min-height: 32px;
}

body.dashboard-page .headline h3 {
  color: #0f172a;
  font-size: 15px;
  font-weight: 750;
}

body.dashboard-page .headline h3::before {
  width: 6px;
  height: 18px;
  border-radius: 999px;
  background: #0284c7;
  box-shadow: 0 0 0 4px rgba(14, 165, 233, 0.12);
}

body.dashboard-page .tone-overview {
  border-color: rgba(14, 165, 233, 0.24);
  background:
    linear-gradient(135deg, rgba(224, 242, 254, 0.72), rgba(255, 255, 255, 0.98) 42%),
    #ffffff;
}

body.dashboard-page .kpi-grid-7 {
  gap: 10px;
}

body.dashboard-page .kpi-card {
  min-height: 118px;
  padding: 14px;
  border-color: rgba(203, 213, 225, 0.82);
  background: #ffffff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 1px 2px rgba(15, 23, 42, 0.04);
}

body.dashboard-page .kpi-card::after {
  width: 72px;
  height: 3px;
  opacity: 0.72;
}

body.dashboard-page .kpi-clickable-card:hover {
  border-color: rgba(14, 165, 233, 0.42);
  background: linear-gradient(180deg, #ffffff, #f8fbff);
}

body.dashboard-page .kpi-label {
  color: #475569;
  font-size: 11px;
  font-weight: 800;
}

body.dashboard-page .kpi-value {
  margin-top: 8px;
  font-size: 30px;
  font-weight: 760;
  line-height: 1.05;
}

body.dashboard-page .kpi-card .kpi-value:not(.ok):not(.warn):not(.danger) {
  color: #0f172a;
}

body.dashboard-page .kpi-card .kpi-value.ok {
  color: #047857;
}

body.dashboard-page .kpi-card .kpi-value.warn {
  color: #b7791f;
}

body.dashboard-page .kpi-card .kpi-value.danger {
  color: #dc2626;
}

body.dashboard-page .kpi-sub {
  margin-top: 6px;
  color: #64748b;
  line-height: 1.45;
}

body.dashboard-page #kpiCardDueToday,
body.dashboard-page #kpiCardUrgent {
  min-height: 128px;
  border-color: rgba(183, 121, 31, 0.26);
  background: linear-gradient(180deg, #ffffff, #fffbeb);
  box-shadow: 0 8px 22px rgba(183, 121, 31, 0.08);
}

body.dashboard-page #kpiCardOverdue,
body.dashboard-page #kpiCardAOpportunity {
  min-height: 128px;
  border-color: rgba(220, 38, 38, 0.28);
  background: linear-gradient(180deg, #ffffff, #fff7ed);
  box-shadow: 0 8px 22px rgba(185, 28, 28, 0.08);
}

body.dashboard-page #kpiCardHighRisk,
body.dashboard-page #kpiCardSample,
body.dashboard-page #kpiCardDormant {
  border-color: rgba(183, 121, 31, 0.24);
  background: linear-gradient(180deg, #ffffff, #fffbeb);
}

body.dashboard-page #kpiCardWon,
body.dashboard-page #kpiCardBigWon,
body.dashboard-page #kpiCardRepurchase {
  border-color: rgba(5, 150, 105, 0.24);
  background: linear-gradient(180deg, #ffffff, #ecfdf5);
}

body.dashboard-page #kpiCardHighProb {
  border-color: rgba(14, 165, 233, 0.26);
  background: linear-gradient(180deg, #ffffff, #f0f9ff);
}

body.dashboard-page .sales-workspace,
body.dashboard-page .tone-boss-review,
body.dashboard-page .tone-customer-board {
  border-color: rgba(14, 165, 233, 0.20);
}

body.dashboard-page .sales-workspace {
  background:
    linear-gradient(135deg, rgba(224, 242, 254, 0.72), rgba(255, 255, 255, 0.96) 40%),
    #ffffff;
}

body.dashboard-page .sales-metric-card,
body.dashboard-page .sales-kpi-card,
body.dashboard-page .boss-panel,
body.dashboard-page .boss-money-card,
body.dashboard-page .sales-panel {
  border-radius: 8px;
  border-color: rgba(203, 213, 225, 0.84);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

body.dashboard-page .sales-metric-card.danger strong,
body.dashboard-page .sales-kpi-card.danger strong {
  color: #dc2626;
}

body.dashboard-page .sales-metric-card.warn strong,
body.dashboard-page .sales-kpi-card.warn strong {
  color: #b7791f;
}

body.dashboard-page .sales-metric-card.ok strong,
body.dashboard-page .sales-kpi-card.ok strong {
  color: #047857;
}

body.dashboard-page .sales-metric-card strong {
  font-weight: 760;
}

body.dashboard-page .sales-kpi-card strong {
  font-size: 22px;
}

body.dashboard-page .boss-review-grid,
body.dashboard-page .sales-workspace-grid {
  gap: 10px;
}

body.dashboard-page .boss-panel-head h4,
body.dashboard-page .sales-panel-head h4 {
  color: #0f172a;
  font-size: 13px;
  font-weight: 750;
}

body.dashboard-page .boss-panel-head span,
body.dashboard-page .sales-panel-head span {
  color: #64748b;
}

body.dashboard-page .tone-customer-board .filters-grid {
  border-radius: 8px;
  border-color: rgba(203, 213, 225, 0.82);
  background: rgba(248, 250, 252, 0.86);
}

body.dashboard-page .input,
body.dashboard-page .filter-check {
  border-color: rgba(203, 213, 225, 0.92);
  background-color: #ffffff;
}

body.dashboard-page .result-table th {
  background: #f8fafc;
  color: #334155;
  font-size: 11px;
}

body.dashboard-page .result-table td {
  color: #334155;
}

body.dashboard-page .result-table .danger,
body.dashboard-page .result-table .danger-text,
body.dashboard-page .result-table td.danger-text {
  color: #dc2626;
}

body.dashboard-page .result-table .warn,
body.dashboard-page .result-table .warn-text,
body.dashboard-page .result-table td.warn-text {
  color: #b7791f;
}

body.dashboard-page .result-table .ok,
body.dashboard-page .result-table .ok-text,
body.dashboard-page .result-table td.ok-text {
  color: #047857;
}

body.dashboard-page .kpi-card .kpi-value.ok,
body.dashboard-page .sales-metric-card.ok strong,
body.dashboard-page .sales-kpi-card.ok strong {
  color: #047857;
}

body.dashboard-page .kpi-card .kpi-value.warn,
body.dashboard-page .sales-metric-card.warn strong,
body.dashboard-page .sales-kpi-card.warn strong {
  color: #b7791f;
}

body.dashboard-page .kpi-card .kpi-value.danger,
body.dashboard-page .sales-metric-card.danger strong,
body.dashboard-page .sales-kpi-card.danger strong {
  color: #dc2626;
}

body.dashboard-page .table-scroll,
body.dashboard-page .analysis-full-scroll {
  border-color: rgba(203, 213, 225, 0.88);
  border-radius: 8px;
}

body.dashboard-page .distribution-list,
body.dashboard-page .boss-dist-list,
body.dashboard-page .owner-summary-list,
body.dashboard-page .sales-task-list {
  scrollbar-color: #94a3b8 rgba(226, 232, 240, 0.64);
}

@media (max-width: 920px) {
  body.dashboard-page .topbar {
    min-height: auto;
  }

  body.dashboard-page h1 {
    font-size: 32px;
  }

  body.dashboard-page .layout {
    margin-top: 0;
  }

  body.dashboard-page .panel.workspace {
    padding: 12px;
  }
}

@media (max-width: 760px) {
  body.dashboard-page {
    background:
      linear-gradient(115deg, rgba(248, 250, 252, 0.98), rgba(241, 245, 249, 0.94));
  }

  body.dashboard-page::before {
    content: none;
  }

  body.dashboard-page .topbar {
    margin-top: 10px;
    padding-top: 20px;
  }

  body.dashboard-page h1 {
    font-size: 28px;
  }

  body.dashboard-page .top-actions {
    width: 100%;
    justify-content: flex-start;
  }

  body.dashboard-page .kpi-card {
    min-height: 104px;
  }
}

/* Shared enterprise shell for internal pages */
body.tasks-page,
body.security-page:not(.login-page) {
  background:
    linear-gradient(115deg, rgba(248, 250, 252, 0.98), rgba(241, 245, 249, 0.94)),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='1600' height='900' viewBox='0 0 1600 900'%3E%3Crect width='1600' height='900' fill='%23f8fafc'/%3E%3Cg fill='none' stroke='%230f172a' stroke-opacity='.045'%3E%3Cpath d='M0 104h1600M0 208h1600M0 312h1600M0 416h1600M0 520h1600M0 624h1600M0 728h1600M0 832h1600'/%3E%3Cpath d='M104 0v900M208 0v900M312 0v900M416 0v900M520 0v900M624 0v900M728 0v900M832 0v900M936 0v900M1040 0v900M1144 0v900M1248 0v900M1352 0v900M1456 0v900'/%3E%3C/g%3E%3Cg fill='none' stroke='%230369a1' stroke-opacity='.08' stroke-width='2'%3E%3Cpath d='M100 690h250v-90h180v-130h220v65h175v-155h250v95h185'/%3E%3Cpath d='M132 742h186v-54h260v-84h208v112h220v-162h310'/%3E%3C/g%3E%3C/svg%3E");
  background-size: cover, cover;
  background-attachment: fixed, fixed;
}

body.tasks-page::before,
body.security-page:not(.login-page)::before {
  content: none;
}

body.tasks-page .topbar,
body.security-page:not(.login-page) .topbar {
  position: relative;
  z-index: 1;
  max-width: 1560px;
  margin-top: 18px;
  padding: 22px 24px;
  align-items: flex-start;
  border: 1px solid rgba(203, 213, 225, 0.76);
  border-radius: 14px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(240, 249, 255, 0.88) 54%, rgba(255, 255, 255, 0.96)),
    #ffffff;
  box-shadow: 0 18px 44px rgba(15, 23, 42, 0.08);
}

body.tasks-page .eyebrow,
body.security-page:not(.login-page) .eyebrow {
  color: #0369a1;
}

body.tasks-page h1,
body.security-page:not(.login-page) h1 {
  color: #0f172a;
  font-size: 38px;
  line-height: 1.08;
}

body.tasks-page .subtitle,
body.security-page:not(.login-page) .subtitle {
  color: #475569;
}

body.tasks-page .top-actions,
body.security-page:not(.login-page) .top-actions {
  border-color: rgba(203, 213, 225, 0.78);
  background: rgba(248, 250, 252, 0.88);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.84), 0 8px 22px rgba(15, 23, 42, 0.06);
}

body.tasks-page .top-actions .btn.ghost,
body.security-page:not(.login-page) .top-actions .btn.ghost {
  border-color: rgba(203, 213, 225, 0.96);
  background: #ffffff;
  color: #0f172a;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

body.tasks-page .top-actions .btn.ghost:hover,
body.security-page:not(.login-page) .top-actions .btn.ghost:hover {
  border-color: rgba(14, 165, 233, 0.38);
  background: #f0f9ff;
  box-shadow: 0 8px 18px rgba(3, 105, 161, 0.10);
}

body.tasks-page .top-actions a[href="/tasks.html"],
body.security-page:not(.login-page) .top-actions a[href="/tasks.html"] {
  border-color: rgba(14, 165, 233, 0.28);
  background: #e0f2fe;
  color: #075985;
}

body.tasks-page .top-actions a[href="/security.html"],
body.security-page:not(.login-page) .top-actions a[href="/security.html"] {
  border-color: rgba(5, 150, 105, 0.24);
  background: #ecfdf5;
  color: #047857;
}

body.tasks-page .top-actions a[href="/dashboard.html"],
body.security-page:not(.login-page) .top-actions a[href="/dashboard.html"] {
  border-color: rgba(79, 70, 229, 0.22);
  background: #eef2ff;
  color: #3730a3;
}

body.tasks-page .top-actions #logoutBtn,
body.security-page:not(.login-page) .top-actions #logoutBtn {
  color: #475569;
}

body.tasks-page .top-actions .badge.neutral,
body.security-page:not(.login-page) .top-actions .badge.neutral {
  border-color: rgba(3, 105, 161, 0.22);
  background: #f0f9ff;
  color: #075985;
}

body.tasks-page .top-actions .badge.ok,
body.security-page:not(.login-page) .top-actions .badge.ok {
  border-color: rgba(5, 150, 105, 0.26);
  background: #ecfdf5;
  color: #047857;
}

body.tasks-page .top-actions .badge.warn,
body.tasks-page .top-actions .badge.fail,
body.security-page:not(.login-page) .top-actions .badge.warn,
body.security-page:not(.login-page) .top-actions .badge.fail {
  border-color: rgba(183, 121, 31, 0.28);
  background: #fff7ed;
  color: #92400e;
}

body.tasks-page .layout,
body.security-page:not(.login-page) .layout {
  margin-top: 16px;
}

body.tasks-page .panel.workspace,
body.security-page:not(.login-page) .panel.workspace {
  border-color: rgba(203, 213, 225, 0.72);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.84);
  box-shadow: 0 20px 54px rgba(15, 23, 42, 0.09);
  backdrop-filter: blur(14px);
}

body.tasks-page .card,
body.security-page:not(.login-page) .card {
  border-color: rgba(203, 213, 225, 0.82);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.96));
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 14px 34px rgba(15, 23, 42, 0.06);
}

body.tasks-page .card:hover,
body.security-page:not(.login-page) .card:hover {
  transform: none;
  border-color: rgba(14, 165, 233, 0.32);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05), 0 18px 42px rgba(15, 23, 42, 0.08);
}

body.tasks-page .headline h3,
body.security-page:not(.login-page) .headline h3 {
  color: #0f172a;
  font-size: 15px;
  font-weight: 750;
}

body.tasks-page .headline h3::before,
body.security-page:not(.login-page) .headline h3::before {
  width: 6px;
  height: 18px;
  border-radius: 999px;
  background: #0284c7;
  box-shadow: 0 0 0 4px rgba(14, 165, 233, 0.12);
}

body.tasks-page .input,
body.tasks-page .filter-check,
body.security-page:not(.login-page) .input,
body.security-page:not(.login-page) .filter-check {
  border-color: rgba(203, 213, 225, 0.92);
  background-color: #ffffff;
}

body.tasks-page .table-scroll,
body.security-page:not(.login-page) .table-scroll {
  border-color: rgba(203, 213, 225, 0.88);
  border-radius: 8px;
}

body.tasks-page .result-table th,
body.security-page:not(.login-page) .result-table th {
  background: #f8fafc;
  color: #334155;
  font-size: 11px;
}

body.tasks-page .result-table td,
body.security-page:not(.login-page) .result-table td {
  color: #334155;
}

@media (max-width: 920px) {
  body.tasks-page .topbar,
  body.security-page:not(.login-page) .topbar {
    margin-top: 10px;
  }

  body.tasks-page h1,
  body.security-page:not(.login-page) h1 {
    font-size: 32px;
  }

  body.tasks-page .panel.workspace,
  body.security-page:not(.login-page) .panel.workspace {
    padding: 12px;
  }
}

@media (max-width: 760px) {
  body.tasks-page,
  body.security-page:not(.login-page) {
    background:
      linear-gradient(115deg, rgba(248, 250, 252, 0.98), rgba(241, 245, 249, 0.94));
  }

  body.tasks-page .topbar,
  body.security-page:not(.login-page) .topbar {
    padding-top: 20px;
  }

  body.tasks-page h1,
  body.security-page:not(.login-page) h1 {
    font-size: 28px;
  }

  body.tasks-page .top-actions,
  body.security-page:not(.login-page) .top-actions {
    width: 100%;
    justify-content: flex-start;
  }
}

/* Shared top navigation semantic colors */
body.dashboard-page .top-actions #tasksLink,
body.dashboard-page .top-actions a[href="/tasks.html"],
body.tasks-page .top-actions #tasksLink,
body.tasks-page .top-actions a[href="/tasks.html"],
body.security-page:not(.login-page) .top-actions #tasksLink,
body.security-page:not(.login-page) .top-actions a[href="/tasks.html"] {
  border-color: rgba(14, 165, 233, 0.28);
  background: #e0f2fe;
  color: #075985;
}

body.dashboard-page .top-actions #securityLink,
body.dashboard-page .top-actions a[href="/security.html"],
body.tasks-page .top-actions #securityLink,
body.tasks-page .top-actions a[href="/security.html"],
body.security-page:not(.login-page) .top-actions #securityLink,
body.security-page:not(.login-page) .top-actions a[href="/security.html"] {
  border-color: rgba(5, 150, 105, 0.24);
  background: #ecfdf5;
  color: #047857;
}

body.dashboard-page .top-actions #platformLink,
body.dashboard-page .top-actions a[href="/platform.html"],
body.tasks-page .top-actions #platformLink,
body.tasks-page .top-actions a[href="/platform.html"],
body.security-page:not(.login-page) .top-actions #platformLink,
body.security-page:not(.login-page) .top-actions a[href="/platform.html"],
body.tasks-page .top-actions a[href="/dashboard.html"],
body.security-page:not(.login-page) .top-actions a[href="/dashboard.html"] {
  border-color: rgba(79, 70, 229, 0.22);
  background: #eef2ff;
  color: #3730a3;
}

body.dashboard-page .top-actions #logoutBtn,
body.tasks-page .top-actions #logoutBtn,
body.security-page:not(.login-page) .top-actions #logoutBtn {
  color: #475569;
}

.theme-toggle-btn {
  gap: 7px;
}

.theme-toggle-btn .theme-dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: currentColor;
  box-shadow: 0 0 0 4px color-mix(in srgb, currentColor 14%, transparent);
}

.theme-only-actions {
  align-self: flex-start;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --color-background: #07111f;
  --color-foreground: #e5eef9;
  --color-muted: #162235;
  --color-muted-foreground: #9fb0c4;
  --color-border: #243247;
  --color-surface: #0d1828;
  --color-surface-raised: #111f33;
  --color-ring: #93c5fd;

  --theme-text: #e5eef9;
  --theme-muted: #9fb0c4;
  --theme-bg-1: #07111f;
  --theme-bg-2: #0b1728;
  --theme-surface-1: #0d1828;
  --theme-surface-2: #111f33;
  --theme-line: #243247;
  --theme-line-strong: #33445d;
  --theme-accent: #38bdf8;
  --theme-accent-2: #7dd3fc;
  --theme-accent-strong: #7dd3fc;
  --theme-accent-soft: rgba(56, 189, 248, 0.16);
  --theme-focus: #7dd3fc;
  --theme-row-hover: rgba(56, 189, 248, 0.10);
  --theme-row-active: rgba(56, 189, 248, 0.16);
  --theme-row-stripe: rgba(148, 163, 184, 0.06);
  --ok: #34d399;
  --warn: #fbbf24;
  --danger: #f87171;
  --shadow-lg: 0 24px 56px rgba(0, 0, 0, 0.38);
  --shadow-md: 0 16px 34px rgba(0, 0, 0, 0.30);
  --shadow-sm: 0 8px 18px rgba(0, 0, 0, 0.24);
}

html[data-theme="dark"],
html[data-theme="dark"] body {
  background: #07111f;
}

html[data-theme="dark"] body {
  color: var(--theme-text);
}

html[data-theme="dark"] body::before {
  background-image:
    linear-gradient(115deg, rgba(7, 17, 31, 0.94), rgba(11, 23, 40, 0.92)),
    radial-gradient(circle at 12% 8%, rgba(14, 165, 233, 0.18), transparent 34%),
    radial-gradient(circle at 88% 0%, rgba(99, 102, 241, 0.15), transparent 34%);
}

html[data-theme="dark"] body.dashboard-page,
html[data-theme="dark"] body.tasks-page,
html[data-theme="dark"] body.security-page:not(.login-page),
html[data-theme="dark"] .onboarding-public-page {
  background:
    radial-gradient(circle at 12% -12%, rgba(14, 165, 233, 0.14), transparent 38%),
    linear-gradient(156deg, #07111f 0%, #0b1728 100%);
}

html[data-theme="dark"] body.dashboard-page .topbar,
html[data-theme="dark"] body.tasks-page .topbar,
html[data-theme="dark"] body.security-page:not(.login-page) .topbar,
html[data-theme="dark"] .login-card,
html[data-theme="dark"] .auth-brand-panel,
html[data-theme="dark"] .panel.workspace,
html[data-theme="dark"] .card,
html[data-theme="dark"] .inner-card,
html[data-theme="dark"] .user-create-panel,
html[data-theme="dark"] .onboarding-panel,
html[data-theme="dark"] .manual-details,
html[data-theme="dark"] .modal-panel,
html[data-theme="dark"] #customerModal .modal-panel,
html[data-theme="dark"] .kpi-drill-panel,
html[data-theme="dark"] .customer-review-section,
html[data-theme="dark"] .followup-form-modal {
  border-color: rgba(71, 85, 105, 0.72);
  background:
    linear-gradient(180deg, rgba(15, 23, 42, 0.96), rgba(17, 31, 51, 0.94)),
    #0f172a;
  color: var(--theme-text);
  box-shadow: var(--shadow-md);
}

html[data-theme="dark"] body.dashboard-page .topbar,
html[data-theme="dark"] body.tasks-page .topbar,
html[data-theme="dark"] body.security-page:not(.login-page) .topbar {
  background:
    linear-gradient(135deg, rgba(15, 23, 42, 0.98), rgba(12, 31, 52, 0.92) 58%, rgba(15, 23, 42, 0.96)),
    #0f172a;
}

html[data-theme="dark"] .login-topbar h1,
html[data-theme="dark"] .login-brand h1,
html[data-theme="dark"] body.dashboard-page h1,
html[data-theme="dark"] body.tasks-page h1,
html[data-theme="dark"] body.security-page:not(.login-page) h1,
html[data-theme="dark"] body.dashboard-page .headline h3,
html[data-theme="dark"] body.tasks-page .headline h3,
html[data-theme="dark"] body.security-page:not(.login-page) .headline h3,
html[data-theme="dark"] h2,
html[data-theme="dark"] h3,
html[data-theme="dark"] h4,
html[data-theme="dark"] .kpi-value,
html[data-theme="dark"] .meta-value,
html[data-theme="dark"] .battle-customer,
html[data-theme="dark"] .customer-review-value,
html[data-theme="dark"] .script-card div {
  color: var(--theme-text);
}

html[data-theme="dark"] body.dashboard-page .subtitle,
html[data-theme="dark"] body.tasks-page .subtitle,
html[data-theme="dark"] body.security-page:not(.login-page) .subtitle,
html[data-theme="dark"] .subtitle,
html[data-theme="dark"] .hint-text,
html[data-theme="dark"] .meta-key,
html[data-theme="dark"] .kpi-label,
html[data-theme="dark"] .kpi-sub,
html[data-theme="dark"] .security-list span,
html[data-theme="dark"] .security-copy,
html[data-theme="dark"] .login-footnote,
html[data-theme="dark"] .boss-panel-head span,
html[data-theme="dark"] .sales-panel-head span,
html[data-theme="dark"] .sales-task-meta,
html[data-theme="dark"] .sales-task-script,
html[data-theme="dark"] .empty {
  color: var(--theme-muted);
}

html[data-theme="dark"] .top-actions,
html[data-theme="dark"] body.dashboard-page .top-actions,
html[data-theme="dark"] body.tasks-page .top-actions,
html[data-theme="dark"] body.security-page:not(.login-page) .top-actions {
  border-color: rgba(71, 85, 105, 0.74);
  background: rgba(15, 23, 42, 0.72);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 12px 28px rgba(0, 0, 0, 0.24);
}

html[data-theme="dark"] .top-actions .btn,
html[data-theme="dark"] .btn.ghost,
html[data-theme="dark"] body.dashboard-page .top-actions .btn.ghost,
html[data-theme="dark"] body.tasks-page .top-actions .btn.ghost,
html[data-theme="dark"] body.security-page:not(.login-page) .top-actions .btn.ghost {
  border-color: rgba(71, 85, 105, 0.84);
  background: rgba(15, 23, 42, 0.86);
  color: #dbeafe;
  box-shadow: none;
}

html[data-theme="dark"] .top-actions .btn:hover,
html[data-theme="dark"] .btn.ghost:hover,
html[data-theme="dark"] body.dashboard-page .top-actions .btn.ghost:hover,
html[data-theme="dark"] body.tasks-page .top-actions .btn.ghost:hover,
html[data-theme="dark"] body.security-page:not(.login-page) .top-actions .btn.ghost:hover {
  border-color: rgba(125, 211, 252, 0.44);
  background: rgba(14, 165, 233, 0.14);
  box-shadow: 0 10px 24px rgba(8, 47, 73, 0.24);
}

html[data-theme="dark"] body.dashboard-page .top-actions #tasksLink,
html[data-theme="dark"] body.dashboard-page .top-actions a[href="/tasks.html"],
html[data-theme="dark"] body.tasks-page .top-actions #tasksLink,
html[data-theme="dark"] body.tasks-page .top-actions a[href="/tasks.html"],
html[data-theme="dark"] body.security-page:not(.login-page) .top-actions #tasksLink,
html[data-theme="dark"] body.security-page:not(.login-page) .top-actions a[href="/tasks.html"] {
  border-color: rgba(56, 189, 248, 0.32);
  background: rgba(14, 165, 233, 0.18);
  color: #bae6fd;
}

html[data-theme="dark"] body.dashboard-page .top-actions #securityLink,
html[data-theme="dark"] body.dashboard-page .top-actions a[href="/security.html"],
html[data-theme="dark"] body.tasks-page .top-actions #securityLink,
html[data-theme="dark"] body.tasks-page .top-actions a[href="/security.html"],
html[data-theme="dark"] body.security-page:not(.login-page) .top-actions #securityLink,
html[data-theme="dark"] body.security-page:not(.login-page) .top-actions a[href="/security.html"] {
  border-color: rgba(52, 211, 153, 0.30);
  background: rgba(16, 185, 129, 0.14);
  color: #bbf7d0;
}

html[data-theme="dark"] body.dashboard-page .top-actions #platformLink,
html[data-theme="dark"] body.dashboard-page .top-actions a[href="/platform.html"],
html[data-theme="dark"] body.tasks-page .top-actions #platformLink,
html[data-theme="dark"] body.tasks-page .top-actions a[href="/platform.html"],
html[data-theme="dark"] body.security-page:not(.login-page) .top-actions #platformLink,
html[data-theme="dark"] body.security-page:not(.login-page) .top-actions a[href="/platform.html"],
html[data-theme="dark"] body.tasks-page .top-actions a[href="/dashboard.html"],
html[data-theme="dark"] body.security-page:not(.login-page) .top-actions a[href="/dashboard.html"] {
  border-color: rgba(129, 140, 248, 0.32);
  background: rgba(99, 102, 241, 0.16);
  color: #c7d2fe;
}

html[data-theme="dark"] .theme-toggle-btn {
  border-color: rgba(251, 191, 36, 0.28) !important;
  background: rgba(251, 191, 36, 0.10) !important;
  color: #fde68a !important;
}

html[data-theme="dark"] .input,
html[data-theme="dark"] .check-item,
html[data-theme="dark"] .filter-check,
html[data-theme="dark"] .compact-input,
html[data-theme="dark"] select,
html[data-theme="dark"] textarea {
  border-color: rgba(71, 85, 105, 0.78);
  background-color: rgba(15, 23, 42, 0.90);
  color: var(--theme-text);
}

html[data-theme="dark"] .input::placeholder,
html[data-theme="dark"] textarea::placeholder {
  color: #64748b;
}

html[data-theme="dark"] .table-scroll,
html[data-theme="dark"] .log-list,
html[data-theme="dark"] .pre,
html[data-theme="dark"] .detail-block,
html[data-theme="dark"] .meta-item,
html[data-theme="dark"] .opportunity-box,
html[data-theme="dark"] .security-list div,
html[data-theme="dark"] .owner-setup-item,
html[data-theme="dark"] .sales-panel,
html[data-theme="dark"] .sales-metric-card,
html[data-theme="dark"] .sales-kpi-card,
html[data-theme="dark"] .sales-task-item,
html[data-theme="dark"] .sales-empty,
html[data-theme="dark"] .boss-panel,
html[data-theme="dark"] .boss-money-card,
html[data-theme="dark"] .boss-watch-block,
html[data-theme="dark"] .boss-stat-line,
html[data-theme="dark"] .boss-customer-link,
html[data-theme="dark"] .dist-row,
html[data-theme="dark"] .kpi-card,
html[data-theme="dark"] .customer-review-card,
html[data-theme="dark"] .script-card,
html[data-theme="dark"] .battle-owner,
html[data-theme="dark"] .battle-tag,
html[data-theme="dark"] .battle-meta span,
html[data-theme="dark"] .battle-summary-block,
html[data-theme="dark"] .toast,
html[data-theme="dark"] .login-message {
  border-color: rgba(71, 85, 105, 0.68);
  background:
    linear-gradient(180deg, rgba(15, 23, 42, 0.96), rgba(17, 31, 51, 0.90)),
    #0f172a;
  color: var(--theme-text);
}

html[data-theme="dark"] .result-table th,
html[data-theme="dark"] body.dashboard-page .result-table th,
html[data-theme="dark"] body.tasks-page .result-table th,
html[data-theme="dark"] body.security-page:not(.login-page) .result-table th {
  background: rgba(30, 41, 59, 0.96);
  color: #cbd5e1;
}

html[data-theme="dark"] .result-table td,
html[data-theme="dark"] body.dashboard-page .result-table td,
html[data-theme="dark"] body.tasks-page .result-table td,
html[data-theme="dark"] body.security-page:not(.login-page) .result-table td {
  border-bottom-color: rgba(71, 85, 105, 0.46);
  color: #dbeafe;
}

html[data-theme="dark"] .result-table tbody tr:nth-child(even):not(.active-row) {
  background: rgba(148, 163, 184, 0.05);
}

html[data-theme="dark"] .click-row:hover,
html[data-theme="dark"] .log-item:hover,
html[data-theme="dark"] .boss-customer-link:hover,
html[data-theme="dark"] #kpiDrillBody tr:hover {
  background: rgba(14, 165, 233, 0.10);
}

html[data-theme="dark"] .click-row.active-row,
html[data-theme="dark"] .log-item.active {
  background: rgba(14, 165, 233, 0.16);
  box-shadow: inset 4px 0 0 var(--theme-accent), inset 0 0 0 1px rgba(56, 189, 248, 0.18);
}

html[data-theme="dark"] body.dashboard-page .tone-overview,
html[data-theme="dark"] body.dashboard-page .sales-workspace,
html[data-theme="dark"] body.dashboard-page .tone-boss-review,
html[data-theme="dark"] body.dashboard-page .tone-customer-board,
html[data-theme="dark"] .user-manage-card {
  background:
    linear-gradient(135deg, rgba(14, 165, 233, 0.10), rgba(15, 23, 42, 0.96) 44%),
    #0f172a;
}

html[data-theme="dark"] body.dashboard-page #kpiCardDueToday,
html[data-theme="dark"] body.dashboard-page #kpiCardUrgent,
html[data-theme="dark"] body.dashboard-page #kpiCardOverdue,
html[data-theme="dark"] body.dashboard-page #kpiCardAOpportunity,
html[data-theme="dark"] body.dashboard-page #kpiCardHighRisk,
html[data-theme="dark"] body.dashboard-page #kpiCardSample,
html[data-theme="dark"] body.dashboard-page #kpiCardDormant,
html[data-theme="dark"] body.dashboard-page #kpiCardWon,
html[data-theme="dark"] body.dashboard-page #kpiCardBigWon,
html[data-theme="dark"] body.dashboard-page #kpiCardRepurchase,
html[data-theme="dark"] body.dashboard-page #kpiCardHighProb {
  background:
    linear-gradient(180deg, rgba(15, 23, 42, 0.98), rgba(17, 31, 51, 0.92)),
    #0f172a;
  box-shadow: none;
}

html[data-theme="dark"] .badge.neutral,
html[data-theme="dark"] body.dashboard-page .top-actions .badge.neutral,
html[data-theme="dark"] body.tasks-page .top-actions .badge.neutral,
html[data-theme="dark"] body.security-page:not(.login-page) .top-actions .badge.neutral,
html[data-theme="dark"] .pill.engine {
  border-color: rgba(56, 189, 248, 0.26);
  background: rgba(14, 165, 233, 0.14);
  color: #bae6fd;
}

html[data-theme="dark"] .badge.ok,
html[data-theme="dark"] .pill.ok,
html[data-theme="dark"] body.dashboard-page .top-actions .badge.ok,
html[data-theme="dark"] body.tasks-page .top-actions .badge.ok,
html[data-theme="dark"] body.security-page:not(.login-page) .top-actions .badge.ok {
  border-color: rgba(52, 211, 153, 0.30);
  background: rgba(16, 185, 129, 0.14);
  color: #bbf7d0;
}

html[data-theme="dark"] .badge.warn,
html[data-theme="dark"] .badge.fail,
html[data-theme="dark"] .pill.warn,
html[data-theme="dark"] body.dashboard-page .top-actions .badge.warn,
html[data-theme="dark"] body.dashboard-page .top-actions .badge.fail,
html[data-theme="dark"] body.tasks-page .top-actions .badge.warn,
html[data-theme="dark"] body.tasks-page .top-actions .badge.fail,
html[data-theme="dark"] body.security-page:not(.login-page) .top-actions .badge.warn,
html[data-theme="dark"] body.security-page:not(.login-page) .top-actions .badge.fail {
  border-color: rgba(251, 191, 36, 0.28);
  background: rgba(251, 191, 36, 0.12);
  color: #fde68a;
}

html[data-theme="dark"] .btn.primary {
  background: linear-gradient(135deg, #0ea5e9 0%, #2563eb 100%);
  box-shadow: 0 10px 24px rgba(14, 165, 233, 0.22);
}

html[data-theme="dark"] .btn.danger {
  border-color: rgba(248, 113, 113, 0.36);
  background: linear-gradient(135deg, #ef4444 0%, #b91c1c 100%);
}

html[data-theme="dark"] .btn.danger-ghost {
  border-color: rgba(248, 113, 113, 0.32);
  background: rgba(239, 68, 68, 0.12);
  color: #fecaca;
}

html[data-theme="dark"] .login-message.status-info {
  background: rgba(14, 165, 233, 0.12);
  border-color: rgba(56, 189, 248, 0.24);
  color: #bae6fd;
}

html[data-theme="dark"] .login-message.status-success {
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(52, 211, 153, 0.25);
  color: #bbf7d0;
}

html[data-theme="dark"] .login-message.status-warn {
  background: rgba(251, 191, 36, 0.12);
  border-color: rgba(251, 191, 36, 0.25);
  color: #fde68a;
}

html[data-theme="dark"] .login-message.status-error {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(248, 113, 113, 0.25);
  color: #fecaca;
}

html[data-theme="dark"] .customer-review-section,
html[data-theme="dark"] .followup-form-modal {
  --review-bg: #101c2d;
  --review-border: rgba(71, 85, 105, 0.72);
}

html[data-theme="dark"] .customer-review-card h4,
html[data-theme="dark"] .script-card h4 {
  color: #bae6fd;
}

html[data-theme="dark"] .review-tone-blockage,
html[data-theme="dark"] .review-tone-script,
html[data-theme="dark"] .review-tone-review {
  background:
    linear-gradient(180deg, rgba(24, 18, 12, 0.32), rgba(15, 23, 42, 0.96)),
    #0f172a;
}

html[data-theme="dark"] .review-tone-sales-assistant {
  background:
    linear-gradient(180deg, rgba(12, 24, 22, 0.34), rgba(15, 23, 42, 0.96)),
    #0f172a;
}

html[data-theme="dark"] #customerModal .mistake-board .review-card {
  border-color: rgba(148, 163, 184, 0.34);
  background:
    linear-gradient(180deg, rgba(15, 23, 42, 0.92), rgba(2, 6, 23, 0.86));
}

html[data-theme="dark"] .opportunity-tooltip,
html[data-theme="dark"] .opportunity-tooltip::after {
  background: #0f172a;
  border-color: rgba(71, 85, 105, 0.86);
}

html[data-theme="dark"] .level-badge-wrap,
html[data-theme="dark"] .opportunity-help,
html[data-theme="dark"] .summary-title {
  border-color: rgba(56, 189, 248, 0.24);
  background: rgba(14, 165, 233, 0.12);
  color: #bae6fd;
}

html[data-theme="dark"] .stage-badge,
html[data-theme="dark"] .prio-pill,
html[data-theme="dark"] .segment-pill,
html[data-theme="dark"] .repurchase-pill,
html[data-theme="dark"] .opportunity-pill,
html[data-theme="dark"] .followup-pill,
html[data-theme="dark"] .risk-tag,
html[data-theme="dark"] .overdue-mini-tag,
html[data-theme="dark"] .sales-score {
  filter: saturate(1.15) brightness(1.12);
}

/* Deep dark mode hardening: keep every enterprise surface readable. */
html[data-theme="dark"] * {
  scrollbar-color: rgba(125, 211, 252, 0.48) rgba(15, 23, 42, 0.72);
}

html[data-theme="dark"] *::-webkit-scrollbar-track {
  background: rgba(15, 23, 42, 0.72);
}

html[data-theme="dark"] *::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(125, 211, 252, 0.56), rgba(99, 102, 241, 0.44));
}

html[data-theme="dark"] body.dashboard-page,
html[data-theme="dark"] body.tasks-page,
html[data-theme="dark"] body.security-page:not(.login-page) {
  background:
    linear-gradient(115deg, rgba(7, 17, 31, 0.98), rgba(11, 23, 40, 0.96)),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='1600' height='900' viewBox='0 0 1600 900'%3E%3Crect width='1600' height='900' fill='%2307111f'/%3E%3Cg fill='none' stroke='%237dd3fc' stroke-opacity='.075'%3E%3Cpath d='M0 104h1600M0 208h1600M0 312h1600M0 416h1600M0 520h1600M0 624h1600M0 728h1600M0 832h1600'/%3E%3Cpath d='M104 0v900M208 0v900M312 0v900M416 0v900M520 0v900M624 0v900M728 0v900M832 0v900M936 0v900M1040 0v900M1144 0v900M1248 0v900M1352 0v900M1456 0v900'/%3E%3C/g%3E%3Cg fill='none' stroke='%2338bdf8' stroke-opacity='.10' stroke-width='2'%3E%3Cpath d='M100 690h250v-90h180v-130h220v65h175v-155h250v95h185'/%3E%3Cpath d='M132 742h186v-54h260v-84h208v112h220v-162h310'/%3E%3C/g%3E%3C/svg%3E");
  background-size: cover, cover;
  background-attachment: fixed, fixed;
}

html[data-theme="dark"] body.dashboard-page .topbar,
html[data-theme="dark"] body.tasks-page .topbar,
html[data-theme="dark"] body.security-page:not(.login-page) .topbar,
html[data-theme="dark"] .login-topbar {
  border-color: rgba(71, 85, 105, 0.78);
  background:
    linear-gradient(135deg, rgba(15, 23, 42, 0.98), rgba(12, 31, 52, 0.94) 56%, rgba(15, 23, 42, 0.97)),
    #0f172a;
  color: #e5eef9;
  box-shadow: 0 22px 54px rgba(0, 0, 0, 0.34), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

html[data-theme="dark"] body.dashboard-page h1,
html[data-theme="dark"] body.tasks-page h1,
html[data-theme="dark"] body.security-page:not(.login-page) h1,
html[data-theme="dark"] .login-topbar h1,
html[data-theme="dark"] .auth-brand-panel h2,
html[data-theme="dark"] .headline h3,
html[data-theme="dark"] .modal-head h3 {
  color: #f8fafc;
}

html[data-theme="dark"] body.dashboard-page .eyebrow,
html[data-theme="dark"] body.tasks-page .eyebrow,
html[data-theme="dark"] body.security-page:not(.login-page) .eyebrow,
html[data-theme="dark"] .auth-brand-panel .eyebrow {
  color: #7dd3fc;
}

html[data-theme="dark"] body.dashboard-page .subtitle,
html[data-theme="dark"] body.tasks-page .subtitle,
html[data-theme="dark"] body.security-page:not(.login-page) .subtitle,
html[data-theme="dark"] .auth-brand-panel p:not(.eyebrow),
html[data-theme="dark"] .login-footnote,
html[data-theme="dark"] .login-legal-note {
  color: #a7b7cc;
}

html[data-theme="dark"] .login-legal-note a {
  color: #7dd3fc;
}

html[data-theme="dark"] body.dashboard-page .top-actions,
html[data-theme="dark"] body.tasks-page .top-actions,
html[data-theme="dark"] body.security-page:not(.login-page) .top-actions,
html[data-theme="dark"] .login-topbar .top-actions {
  border-color: rgba(71, 85, 105, 0.74);
  background: rgba(15, 23, 42, 0.72);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 12px 28px rgba(0, 0, 0, 0.24);
}

html[data-theme="dark"] body.dashboard-page .top-actions .btn.ghost,
html[data-theme="dark"] body.tasks-page .top-actions .btn.ghost,
html[data-theme="dark"] body.security-page:not(.login-page) .top-actions .btn.ghost,
html[data-theme="dark"] .login-topbar .top-actions .btn.ghost,
html[data-theme="dark"] .btn.ghost {
  border-color: rgba(71, 85, 105, 0.84);
  background: rgba(15, 23, 42, 0.86);
  color: #dbeafe;
  box-shadow: none;
}

html[data-theme="dark"] body.dashboard-page .top-actions .btn.ghost:hover,
html[data-theme="dark"] body.tasks-page .top-actions .btn.ghost:hover,
html[data-theme="dark"] body.security-page:not(.login-page) .top-actions .btn.ghost:hover,
html[data-theme="dark"] .login-topbar .top-actions .btn.ghost:hover,
html[data-theme="dark"] .btn.ghost:hover {
  border-color: rgba(125, 211, 252, 0.46);
  background: rgba(14, 165, 233, 0.14);
  color: #f8fafc;
  box-shadow: 0 10px 24px rgba(8, 47, 73, 0.24);
}

html[data-theme="dark"] body.dashboard-page .top-actions #tasksLink,
html[data-theme="dark"] body.dashboard-page .top-actions a[href="/tasks.html"],
html[data-theme="dark"] body.tasks-page .top-actions #tasksLink,
html[data-theme="dark"] body.tasks-page .top-actions a[href="/tasks.html"],
html[data-theme="dark"] body.security-page:not(.login-page) .top-actions #tasksLink,
html[data-theme="dark"] body.security-page:not(.login-page) .top-actions a[href="/tasks.html"] {
  border-color: rgba(56, 189, 248, 0.36);
  background: rgba(14, 165, 233, 0.18);
  color: #bae6fd;
}

html[data-theme="dark"] body.dashboard-page .top-actions #securityLink,
html[data-theme="dark"] body.dashboard-page .top-actions a[href="/security.html"],
html[data-theme="dark"] body.tasks-page .top-actions #securityLink,
html[data-theme="dark"] body.tasks-page .top-actions a[href="/security.html"],
html[data-theme="dark"] body.security-page:not(.login-page) .top-actions #securityLink,
html[data-theme="dark"] body.security-page:not(.login-page) .top-actions a[href="/security.html"] {
  border-color: rgba(52, 211, 153, 0.34);
  background: rgba(16, 185, 129, 0.15);
  color: #bbf7d0;
}

html[data-theme="dark"] body.dashboard-page .top-actions #platformLink,
html[data-theme="dark"] body.dashboard-page .top-actions a[href="/platform.html"],
html[data-theme="dark"] body.tasks-page .top-actions #platformLink,
html[data-theme="dark"] body.tasks-page .top-actions a[href="/platform.html"],
html[data-theme="dark"] body.security-page:not(.login-page) .top-actions #platformLink,
html[data-theme="dark"] body.security-page:not(.login-page) .top-actions a[href="/platform.html"],
html[data-theme="dark"] body.tasks-page .top-actions a[href="/dashboard.html"],
html[data-theme="dark"] body.security-page:not(.login-page) .top-actions a[href="/dashboard.html"] {
  border-color: rgba(129, 140, 248, 0.38);
  background: rgba(99, 102, 241, 0.17);
  color: #c7d2fe;
}

html[data-theme="dark"] body.dashboard-page .panel.workspace,
html[data-theme="dark"] body.tasks-page .panel.workspace,
html[data-theme="dark"] body.security-page:not(.login-page) .panel.workspace,
html[data-theme="dark"] .panel.workspace {
  border-color: rgba(71, 85, 105, 0.76);
  background: rgba(8, 15, 28, 0.82);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.36);
  backdrop-filter: blur(16px);
}

html[data-theme="dark"] body.dashboard-page .card,
html[data-theme="dark"] body.tasks-page .card,
html[data-theme="dark"] body.security-page:not(.login-page) .card,
html[data-theme="dark"] .card,
html[data-theme="dark"] .inner-card,
html[data-theme="dark"] .task-command-card,
html[data-theme="dark"] .login-card,
html[data-theme="dark"] .onboarding-card,
html[data-theme="dark"] .auth-brand-panel,
html[data-theme="dark"] .onboarding-panel,
html[data-theme="dark"] .manual-details,
html[data-theme="dark"] .modal-panel,
html[data-theme="dark"] .kpi-drill-panel {
  border-color: rgba(71, 85, 105, 0.72);
  background:
    linear-gradient(180deg, rgba(15, 23, 42, 0.97), rgba(17, 31, 51, 0.91)),
    #0f172a;
  color: #e5eef9;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.30);
}

html[data-theme="dark"] body.dashboard-page .card:hover,
html[data-theme="dark"] body.tasks-page .card:hover,
html[data-theme="dark"] body.security-page:not(.login-page) .card:hover {
  border-color: rgba(56, 189, 248, 0.38);
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.34);
}

html[data-theme="dark"] .card::after {
  opacity: 0.78;
  background: linear-gradient(90deg, rgba(56, 189, 248, 0.16), rgba(125, 211, 252, 0.76));
}

html[data-theme="dark"] body.dashboard-page .tone-overview,
html[data-theme="dark"] body.dashboard-page .sales-workspace,
html[data-theme="dark"] body.dashboard-page .tone-boss-review,
html[data-theme="dark"] body.dashboard-page .tone-customer-board,
html[data-theme="dark"] body.dashboard-page .tone-sales-workspace,
html[data-theme="dark"] body.tasks-page .focus-card,
html[data-theme="dark"] body.tasks-page .task-command-card,
html[data-theme="dark"] body.security-page:not(.login-page) .tone-overview,
html[data-theme="dark"] body.security-page:not(.login-page) .tone-security,
html[data-theme="dark"] .user-manage-card {
  background:
    linear-gradient(135deg, rgba(14, 165, 233, 0.10), rgba(15, 23, 42, 0.98) 44%, rgba(17, 31, 51, 0.94)),
    #0f172a;
}

html[data-theme="dark"] .headline h3::before {
  background: #38bdf8;
  box-shadow: 0 0 0 4px rgba(56, 189, 248, 0.14);
}

html[data-theme="dark"] .summary,
html[data-theme="dark"] .workspace-auth-note,
html[data-theme="dark"] .field-control small,
html[data-theme="dark"] .security-list span,
html[data-theme="dark"] .security-copy,
html[data-theme="dark"] .owner-setup-status,
html[data-theme="dark"] .platform-cell-data span,
html[data-theme="dark"] .platform-cell-time span,
html[data-theme="dark"] .user-col-binding,
html[data-theme="dark"] .empty,
html[data-theme="dark"] .hint-text {
  color: #a7b7cc;
}

html[data-theme="dark"] .summary,
html[data-theme="dark"] .workspace-auth-note,
html[data-theme="dark"] .security-list div,
html[data-theme="dark"] .owner-setup-item,
html[data-theme="dark"] .user-create-panel,
html[data-theme="dark"] .onboarding-job-log,
html[data-theme="dark"] .onboarding-auth-summary,
html[data-theme="dark"] .auth-brand-stats div,
html[data-theme="dark"] .auth-screenshot-panel {
  border-color: rgba(71, 85, 105, 0.72);
  background: rgba(15, 23, 42, 0.72);
  color: #dbeafe;
}

html[data-theme="dark"] .auth-screenshot-head,
html[data-theme="dark"] .auth-screenshot-panel.pending::after {
  border-color: rgba(71, 85, 105, 0.72);
  background: rgba(15, 23, 42, 0.88);
  color: #a7b7cc;
}

html[data-theme="dark"] .auth-screenshot-head strong,
html[data-theme="dark"] .owner-setup-item strong,
html[data-theme="dark"] .security-list strong,
html[data-theme="dark"] .platform-cell-main strong,
html[data-theme="dark"] .platform-cell-admin strong,
html[data-theme="dark"] .auth-brand-stats strong {
  color: #f8fafc;
}

html[data-theme="dark"] .auth-screenshot-head span,
html[data-theme="dark"] .auth-brand-stats span,
html[data-theme="dark"] .onboarding-auth-time {
  color: #a7b7cc;
}

html[data-theme="dark"] .onboarding-step {
  border-color: rgba(71, 85, 105, 0.72);
  background: rgba(15, 23, 42, 0.72);
  color: #a7b7cc;
}

html[data-theme="dark"] .onboarding-step .dot {
  background: rgba(71, 85, 105, 0.88);
  color: #dbeafe;
}

html[data-theme="dark"] .onboarding-step.active {
  border-color: rgba(56, 189, 248, 0.42);
  background: rgba(14, 165, 233, 0.14);
  color: #bae6fd;
}

html[data-theme="dark"] .onboarding-step.done {
  border-color: rgba(52, 211, 153, 0.34);
  background: rgba(16, 185, 129, 0.13);
  color: #bbf7d0;
}

html[data-theme="dark"] .field-control span,
html[data-theme="dark"] .followup-grid label,
html[data-theme="dark"] .followup-note-label {
  color: #cbd5e1;
}

html[data-theme="dark"] .model-key-source-card {
  background: rgba(15, 23, 42, 0.84);
  border-color: rgba(148, 163, 184, 0.28);
}

html[data-theme="dark"] .model-key-source-card strong {
  color: #e2e8f0;
}

html[data-theme="dark"] .model-key-source-card a {
  color: #5eead4;
}

html[data-theme="dark"] body.dashboard-page .input,
html[data-theme="dark"] body.dashboard-page .filter-check,
html[data-theme="dark"] body.tasks-page .input,
html[data-theme="dark"] body.tasks-page .filter-check,
html[data-theme="dark"] body.security-page:not(.login-page) .input,
html[data-theme="dark"] body.security-page:not(.login-page) .filter-check,
html[data-theme="dark"] .input,
html[data-theme="dark"] .compact-input,
html[data-theme="dark"] .check-item,
html[data-theme="dark"] select,
html[data-theme="dark"] textarea,
html[data-theme="dark"] textarea.input,
html[data-theme="dark"] .multiline-input,
html[data-theme="dark"] .platform-security-textarea {
  border-color: rgba(71, 85, 105, 0.84);
  background-color: rgba(15, 23, 42, 0.94);
  color: #e5eef9;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

html[data-theme="dark"] .input:focus,
html[data-theme="dark"] .input:focus-visible,
html[data-theme="dark"] textarea:focus,
html[data-theme="dark"] select:focus {
  border-color: rgba(125, 211, 252, 0.72);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.18);
}

html[data-theme="dark"] .input::placeholder,
html[data-theme="dark"] textarea::placeholder {
  color: #73849a;
}

html[data-theme="dark"] select.input option,
html[data-theme="dark"] select option {
  background: #0f172a;
  color: #e5eef9;
}

html[data-theme="dark"] .pre,
html[data-theme="dark"] .log-list,
html[data-theme="dark"] .manual-details > summary,
html[data-theme="dark"] .raw-details,
html[data-theme="dark"] .raw-details > summary {
  border-color: rgba(71, 85, 105, 0.74);
  background: rgba(15, 23, 42, 0.86);
  color: #dbeafe;
}

html[data-theme="dark"] .log-main,
html[data-theme="dark"] .log-item,
html[data-theme="dark"] .log-meta {
  color: #dbeafe;
}

html[data-theme="dark"] .table-scroll,
html[data-theme="dark"] body.dashboard-page .table-scroll,
html[data-theme="dark"] body.tasks-page .table-scroll,
html[data-theme="dark"] body.security-page:not(.login-page) .table-scroll,
html[data-theme="dark"] .platform-table-scroll,
html[data-theme="dark"] .user-table-scroll,
html[data-theme="dark"] .analysis-full-scroll {
  border-color: rgba(71, 85, 105, 0.76);
  background: rgba(15, 23, 42, 0.78);
}

html[data-theme="dark"] .result-table,
html[data-theme="dark"] .platform-table,
html[data-theme="dark"] .user-table {
  background: transparent;
  color: #dbeafe;
}

html[data-theme="dark"] .result-table th,
html[data-theme="dark"] body.dashboard-page .result-table th,
html[data-theme="dark"] body.tasks-page .result-table th,
html[data-theme="dark"] body.security-page:not(.login-page) .result-table th {
  border-bottom-color: rgba(71, 85, 105, 0.62);
  background: rgba(30, 41, 59, 0.98);
  color: #cbd5e1;
}

html[data-theme="dark"] .result-table td,
html[data-theme="dark"] body.dashboard-page .result-table td,
html[data-theme="dark"] body.tasks-page .result-table td,
html[data-theme="dark"] body.security-page:not(.login-page) .result-table td {
  border-bottom-color: rgba(71, 85, 105, 0.46);
  color: #dbeafe;
}

html[data-theme="dark"] .result-table tbody tr:nth-child(even):not(.active-row) {
  background: rgba(148, 163, 184, 0.055);
}

html[data-theme="dark"] .result-table .danger,
html[data-theme="dark"] .result-table .danger-text,
html[data-theme="dark"] .result-table td.danger-text {
  color: #fca5a5;
}

html[data-theme="dark"] .result-table .warn,
html[data-theme="dark"] .result-table .warn-text,
html[data-theme="dark"] .result-table td.warn-text {
  color: #fde68a;
}

html[data-theme="dark"] .result-table .ok,
html[data-theme="dark"] .result-table .ok-text,
html[data-theme="dark"] .result-table td.ok-text {
  color: #bbf7d0;
}

html[data-theme="dark"] body.dashboard-page .kpi-card,
html[data-theme="dark"] .kpi-card,
html[data-theme="dark"] body.dashboard-page #kpiCardDueToday,
html[data-theme="dark"] body.dashboard-page #kpiCardUrgent,
html[data-theme="dark"] body.dashboard-page #kpiCardOverdue,
html[data-theme="dark"] body.dashboard-page #kpiCardAOpportunity,
html[data-theme="dark"] body.dashboard-page #kpiCardHighRisk,
html[data-theme="dark"] body.dashboard-page #kpiCardSample,
html[data-theme="dark"] body.dashboard-page #kpiCardDormant,
html[data-theme="dark"] body.dashboard-page #kpiCardWon,
html[data-theme="dark"] body.dashboard-page #kpiCardBigWon,
html[data-theme="dark"] body.dashboard-page #kpiCardRepurchase,
html[data-theme="dark"] body.dashboard-page #kpiCardHighProb,
html[data-theme="dark"] body.dashboard-page #kpiCardDoneToday {
  border-color: rgba(71, 85, 105, 0.74);
  background:
    linear-gradient(180deg, rgba(15, 23, 42, 0.98), rgba(17, 31, 51, 0.92)),
    #0f172a;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.045);
}

html[data-theme="dark"] body.dashboard-page .kpi-clickable-card:hover,
html[data-theme="dark"] .kpi-clickable-card:hover {
  border-color: rgba(56, 189, 248, 0.48);
  background:
    linear-gradient(180deg, rgba(14, 165, 233, 0.16), rgba(15, 23, 42, 0.98)),
    #0f172a;
}

html[data-theme="dark"] body.dashboard-page .kpi-label,
html[data-theme="dark"] .kpi-label,
html[data-theme="dark"] body.dashboard-page .kpi-sub,
html[data-theme="dark"] .kpi-sub {
  color: #a7b7cc;
}

html[data-theme="dark"] body.dashboard-page .kpi-card .kpi-value:not(.ok):not(.warn):not(.danger),
html[data-theme="dark"] body.dashboard-page .kpi-value,
html[data-theme="dark"] .kpi-value,
html[data-theme="dark"] .boss-money-value {
  color: #f8fafc;
}

html[data-theme="dark"] body.dashboard-page .kpi-card .kpi-value.ok,
html[data-theme="dark"] body.dashboard-page .sales-metric-card.ok strong,
html[data-theme="dark"] body.dashboard-page .sales-kpi-card.ok strong,
html[data-theme="dark"] .kpi-value.ok {
  color: #34d399;
}

html[data-theme="dark"] body.dashboard-page .kpi-card .kpi-value.warn,
html[data-theme="dark"] body.dashboard-page .sales-metric-card.warn strong,
html[data-theme="dark"] body.dashboard-page .sales-kpi-card.warn strong,
html[data-theme="dark"] .kpi-value.warn {
  color: #fbbf24;
}

html[data-theme="dark"] body.dashboard-page .kpi-card .kpi-value.danger,
html[data-theme="dark"] body.dashboard-page .sales-metric-card.danger strong,
html[data-theme="dark"] body.dashboard-page .sales-kpi-card.danger strong,
html[data-theme="dark"] .kpi-value.danger {
  color: #f87171;
}

html[data-theme="dark"] body.dashboard-page .sales-metric-card,
html[data-theme="dark"] body.dashboard-page .sales-kpi-card,
html[data-theme="dark"] body.dashboard-page .sales-panel,
html[data-theme="dark"] body.dashboard-page .sales-task-item,
html[data-theme="dark"] body.dashboard-page .sales-empty,
html[data-theme="dark"] body.dashboard-page .boss-panel,
html[data-theme="dark"] body.dashboard-page .boss-money-card,
html[data-theme="dark"] body.dashboard-page .boss-watch-block,
html[data-theme="dark"] body.dashboard-page .boss-stat-line,
html[data-theme="dark"] body.dashboard-page .boss-customer-link,
html[data-theme="dark"] body.dashboard-page .boss-dist-row,
html[data-theme="dark"] body.dashboard-page .dist-row,
html[data-theme="dark"] .sales-detail-focus {
  border-color: rgba(71, 85, 105, 0.72);
  background:
    linear-gradient(180deg, rgba(15, 23, 42, 0.94), rgba(17, 31, 51, 0.88)),
    #0f172a;
  color: #e5eef9;
  box-shadow: none;
}

html[data-theme="dark"] body.dashboard-page .sales-metric-card:hover,
html[data-theme="dark"] body.dashboard-page .sales-kpi-card:hover,
html[data-theme="dark"] body.dashboard-page .sales-task-item:hover,
html[data-theme="dark"] body.dashboard-page .sales-task-item:focus,
html[data-theme="dark"] body.dashboard-page .sales-task-item.active,
html[data-theme="dark"] body.dashboard-page .boss-customer-link:hover {
  border-color: rgba(56, 189, 248, 0.46);
  background: rgba(14, 165, 233, 0.12);
  box-shadow: inset 3px 0 0 #38bdf8;
}

html[data-theme="dark"] body.dashboard-page .sales-task-item.overdue {
  border-color: rgba(248, 113, 113, 0.34);
  background: rgba(127, 29, 29, 0.20);
}

html[data-theme="dark"] body.dashboard-page .sales-metric-card span,
html[data-theme="dark"] body.dashboard-page .sales-metric-card small,
html[data-theme="dark"] body.dashboard-page .sales-kpi-card span,
html[data-theme="dark"] body.dashboard-page .sales-panel-head span,
html[data-theme="dark"] body.dashboard-page .boss-panel-head span,
html[data-theme="dark"] body.dashboard-page .boss-money-label,
html[data-theme="dark"] body.dashboard-page .boss-money-sub,
html[data-theme="dark"] body.dashboard-page .boss-money-note,
html[data-theme="dark"] body.dashboard-page .sales-task-meta,
html[data-theme="dark"] body.dashboard-page .sales-task-script,
html[data-theme="dark"] .sales-focus-main span,
html[data-theme="dark"] .sales-focus-script span {
  color: #a7b7cc;
}

html[data-theme="dark"] body.dashboard-page .sales-metric-card strong,
html[data-theme="dark"] body.dashboard-page .sales-kpi-card strong,
html[data-theme="dark"] body.dashboard-page .sales-task-title strong,
html[data-theme="dark"] body.dashboard-page .sales-panel-head h4,
html[data-theme="dark"] body.dashboard-page .boss-panel-head h4,
html[data-theme="dark"] .sales-focus-main strong,
html[data-theme="dark"] .sales-focus-script strong {
  color: #f8fafc;
}

html[data-theme="dark"] .sales-detail-focus {
  border-color: rgba(52, 211, 153, 0.30);
  background:
    linear-gradient(135deg, rgba(16, 185, 129, 0.12), rgba(15, 23, 42, 0.96) 52%),
    #0f172a;
}

html[data-theme="dark"] .sales-focus-script {
  border-top-color: rgba(52, 211, 153, 0.22);
}

html[data-theme="dark"] .sales-task-action {
  color: #bbf7d0;
}

html[data-theme="dark"] .sales-score {
  border-color: rgba(56, 189, 248, 0.28);
  background: rgba(14, 165, 233, 0.14);
  color: #bae6fd;
}

html[data-theme="dark"] .boss-drill-btn,
html[data-theme="dark"] .boss-dist-button,
html[data-theme="dark"] .boss-count-btn,
html[data-theme="dark"] .boss-drill-subtle {
  border-color: rgba(56, 189, 248, 0.28);
  background: rgba(14, 165, 233, 0.12);
  color: #bae6fd;
}

html[data-theme="dark"] .dist-track,
html[data-theme="dark"] .boss-dist-track {
  background: rgba(30, 41, 59, 0.96);
}

html[data-theme="dark"] .dist-fill,
html[data-theme="dark"] .boss-dist-track div {
  filter: saturate(1.16) brightness(1.12);
}

html[data-theme="dark"] #customerModal .modal-overlay,
html[data-theme="dark"] .modal-overlay {
  background: rgba(2, 6, 23, 0.68);
  backdrop-filter: blur(6px);
}

html[data-theme="dark"] #customerModal .modal-panel {
  border-color: rgba(71, 85, 105, 0.82);
  background:
    linear-gradient(180deg, rgba(8, 15, 28, 0.98), rgba(15, 23, 42, 0.98)),
    #08111f;
  color: #e5eef9;
}

html[data-theme="dark"] #customerModal .modal-head,
html[data-theme="dark"] .modal-head {
  border-color: rgba(71, 85, 105, 0.74);
  background:
    linear-gradient(180deg, rgba(15, 23, 42, 0.98), rgba(17, 31, 51, 0.94)),
    #0f172a;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.26);
}

html[data-theme="dark"] #customerModal .review-tone-analysis {
  --review-accent: #38bdf8;
  --review-bg: #0e2033;
  --review-border: rgba(56, 189, 248, 0.28);
}

html[data-theme="dark"] #customerModal .review-tone-value {
  --review-accent: #34d399;
  --review-bg: #0e241f;
  --review-border: rgba(52, 211, 153, 0.26);
}

html[data-theme="dark"] #customerModal .review-tone-blockage,
html[data-theme="dark"] #customerModal .review-tone-script,
html[data-theme="dark"] #customerModal .review-tone-review {
  --review-accent: #fbbf24;
  --review-bg: #251d0f;
  --review-border: rgba(251, 191, 36, 0.26);
}

html[data-theme="dark"] #customerModal .review-tone-next,
html[data-theme="dark"] #customerModal .review-tone-calibration {
  --review-accent: #a5b4fc;
  --review-bg: #151a33;
  --review-border: rgba(165, 180, 252, 0.28);
}

html[data-theme="dark"] #customerModal .review-tone-battle,
html[data-theme="dark"] #customerModal .review-tone-evidence,
html[data-theme="dark"] #customerModal .review-tone-followup {
  --review-accent: #2dd4bf;
  --review-bg: #0d2428;
  --review-border: rgba(45, 212, 191, 0.25);
}

html[data-theme="dark"] #customerModal .review-tone-sales-assistant {
  --review-accent: #34d399;
  --review-bg: #0d241f;
  --review-border: rgba(52, 211, 153, 0.26);
}

html[data-theme="dark"] #customerModal .customer-review-section,
html[data-theme="dark"] #customerModal .followup-form-modal,
html[data-theme="dark"] .customer-review-section,
html[data-theme="dark"] .followup-form-modal {
  border-color: var(--review-border, rgba(71, 85, 105, 0.72));
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--review-bg, #111f33) 72%, #0f172a), rgba(15, 23, 42, 0.98) 54%),
    #0f172a;
  color: #e5eef9;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.26);
}

html[data-theme="dark"] #customerModal .customer-review-card,
html[data-theme="dark"] #customerModal .customer-review-card.featured,
html[data-theme="dark"] #customerModal .customer-review-card.signal-card,
html[data-theme="dark"] #customerModal .customer-review-card.critical-card,
html[data-theme="dark"] #customerModal .customer-review-card.action-card,
html[data-theme="dark"] #customerModal .script-card,
html[data-theme="dark"] #customerModal .script-card.primary-script,
html[data-theme="dark"] #customerModal .opportunity-box,
html[data-theme="dark"] #customerModal .detail-block,
html[data-theme="dark"] #customerModal .meta-item,
html[data-theme="dark"] #customerModal .battle-owner,
html[data-theme="dark"] #customerModal .battle-tag,
html[data-theme="dark"] #customerModal .battle-meta span,
html[data-theme="dark"] #customerModal .battle-summary-block,
html[data-theme="dark"] #customerModal .action-item,
html[data-theme="dark"] #customerModal .action-item.primary-action,
html[data-theme="dark"] #customerModal .action-item.urgent-action,
html[data-theme="dark"] #customerModal .action-item.important-action,
html[data-theme="dark"] #customerModal .action-item.longterm-action,
html[data-theme="dark"] #customerModal .action-item.meta-action,
html[data-theme="dark"] #customerModal .script-copy,
html[data-theme="dark"] #customerModal .mini-score,
html[data-theme="dark"] #customerModal .opportunity-meta span {
  border-color: color-mix(in srgb, var(--review-accent, #38bdf8) 24%, rgba(71, 85, 105, 0.74));
  background:
    linear-gradient(180deg, rgba(15, 23, 42, 0.94), rgba(17, 31, 51, 0.88)),
    #0f172a;
  color: #e5eef9;
  box-shadow: none;
}

html[data-theme="dark"] #customerModal .customer-review-card::after {
  background: color-mix(in srgb, var(--review-accent, #38bdf8) 76%, transparent);
}

html[data-theme="dark"] #customerModal .customer-review-card:hover {
  border-color: color-mix(in srgb, var(--review-accent, #38bdf8) 44%, rgba(125, 211, 252, 0.42));
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.24);
}

html[data-theme="dark"] #customerModal .customer-review-section .headline h3,
html[data-theme="dark"] #customerModal .customer-review-card h4,
html[data-theme="dark"] #customerModal .script-card h4,
html[data-theme="dark"] #customerModal .battle-customer,
html[data-theme="dark"] #customerModal .customer-review-value,
html[data-theme="dark"] #customerModal .script-card div,
html[data-theme="dark"] #customerModal .insight-line strong,
html[data-theme="dark"] #customerModal .opportunity-reason,
html[data-theme="dark"] #customerModal .action-val,
html[data-theme="dark"] #customerModal .meta-value,
html[data-theme="dark"] #customerModal .battle-owner strong,
html[data-theme="dark"] #customerModal .battle-summary-block strong {
  color: #f8fafc;
}

html[data-theme="dark"] #customerModal .customer-review-card h4,
html[data-theme="dark"] #customerModal .script-card h4,
html[data-theme="dark"] #customerModal .action-key,
html[data-theme="dark"] #customerModal .mini-score {
  color: color-mix(in srgb, var(--review-accent, #38bdf8) 82%, #ffffff);
}

html[data-theme="dark"] #customerModal .insight-line span,
html[data-theme="dark"] #customerModal .battle-owner span,
html[data-theme="dark"] #customerModal .battle-summary-block span,
html[data-theme="dark"] #customerModal .meta-key,
html[data-theme="dark"] #customerModal .opportunity-meta span {
  color: #a7b7cc;
}

html[data-theme="dark"] #customerModal .insight-line,
html[data-theme="dark"] #customerModal .sales-focus-script {
  border-top-color: rgba(71, 85, 105, 0.54);
}

html[data-theme="dark"] .insight-card,
html[data-theme="dark"] .insight-card.tone-1,
html[data-theme="dark"] .insight-card.tone-2,
html[data-theme="dark"] .insight-card.tone-3,
html[data-theme="dark"] .insight-card.tone-4,
html[data-theme="dark"] .insight-card.tone-5,
html[data-theme="dark"] .insight-card.tone-6 {
  --insight-border: rgba(71, 85, 105, 0.76);
  --insight-title: #bae6fd;
  --insight-bg-top: rgba(15, 23, 42, 0.96);
  --insight-bg-bottom: rgba(17, 31, 51, 0.90);
  border-color: var(--insight-border);
  background: linear-gradient(180deg, var(--insight-bg-top) 0%, var(--insight-bg-bottom) 100%);
  color: #e5eef9;
  box-shadow: none;
}

html[data-theme="dark"] .insight-card.tone-2 {
  --insight-title: #99f6e4;
}

html[data-theme="dark"] .insight-card.tone-4 {
  --insight-title: #fde68a;
}

html[data-theme="dark"] .insight-card.tone-5 {
  --insight-title: #c7d2fe;
}

html[data-theme="dark"] .insight-card h4 {
  color: var(--insight-title);
}

html[data-theme="dark"] .insight-value,
html[data-theme="dark"] .action-val,
html[data-theme="dark"] .review-value,
html[data-theme="dark"] .review-list li {
  color: #e5eef9;
}

html[data-theme="dark"] .detail-block,
html[data-theme="dark"] .action-item,
html[data-theme="dark"] .review-card,
html[data-theme="dark"] .raw-details {
  border-color: rgba(71, 85, 105, 0.74);
  background:
    linear-gradient(180deg, rgba(15, 23, 42, 0.94), rgba(17, 31, 51, 0.88)),
    #0f172a;
  color: #e5eef9;
}

html[data-theme="dark"] .summary-title,
html[data-theme="dark"] .level-badge-wrap,
html[data-theme="dark"] .opportunity-help {
  border-color: rgba(56, 189, 248, 0.28);
  background: rgba(14, 165, 233, 0.14);
  color: #bae6fd;
}

html[data-theme="dark"] .review-card h4,
html[data-theme="dark"] .action-key {
  color: #fde68a;
}

html[data-theme="dark"] .risk-high,
html[data-theme="dark"] .badge.fail {
  border-color: rgba(248, 113, 113, 0.34);
  background: rgba(239, 68, 68, 0.13);
  color: #fecaca;
}

html[data-theme="dark"] .risk-mid,
html[data-theme="dark"] .risk-unknown,
html[data-theme="dark"] .badge.warn {
  border-color: rgba(251, 191, 36, 0.30);
  background: rgba(251, 191, 36, 0.12);
  color: #fde68a;
}

html[data-theme="dark"] .risk-low,
html[data-theme="dark"] .badge.ok {
  border-color: rgba(52, 211, 153, 0.30);
  background: rgba(16, 185, 129, 0.13);
  color: #bbf7d0;
}

html[data-theme="dark"] .badge.neutral,
html[data-theme="dark"] body.dashboard-page .top-actions .badge.neutral,
html[data-theme="dark"] body.tasks-page .top-actions .badge.neutral,
html[data-theme="dark"] body.security-page:not(.login-page) .top-actions .badge.neutral {
  border-color: rgba(56, 189, 248, 0.28);
  background: rgba(14, 165, 233, 0.14);
  color: #bae6fd;
}

html[data-theme="dark"] .pill.ok,
html[data-theme="dark"] .owner-setup-status.done {
  border-color: rgba(52, 211, 153, 0.30);
  background: rgba(16, 185, 129, 0.13);
  color: #bbf7d0;
}

html[data-theme="dark"] .pill.warn,
html[data-theme="dark"] .owner-setup-status.wait {
  border-color: rgba(251, 191, 36, 0.30);
  background: rgba(251, 191, 36, 0.12);
  color: #fde68a;
}

html[data-theme="dark"] .pill.engine,
html[data-theme="dark"] .stage-badge,
html[data-theme="dark"] .prio-pill,
html[data-theme="dark"] .segment-pill,
html[data-theme="dark"] .repurchase-pill,
html[data-theme="dark"] .opportunity-pill,
html[data-theme="dark"] .followup-pill {
  border-color: rgba(56, 189, 248, 0.28);
  background: rgba(14, 165, 233, 0.14);
  color: #bae6fd;
}

html[data-theme="dark"] .toast,
html[data-theme="dark"] .login-message {
  border-color: rgba(71, 85, 105, 0.78);
  background:
    linear-gradient(180deg, rgba(15, 23, 42, 0.98), rgba(17, 31, 51, 0.94)),
    #0f172a;
  color: #e5eef9;
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.34);
}

html[data-theme="dark"] body.dashboard-page .tone-customer-board .filters-grid,
html[data-theme="dark"] .tone-customer-board .filters-grid,
html[data-theme="dark"] .filters-grid {
  border-color: rgba(71, 85, 105, 0.76);
  background:
    linear-gradient(180deg, rgba(15, 23, 42, 0.94), rgba(17, 31, 51, 0.88)),
    #0f172a;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.045);
}

html[data-theme="dark"] body.dashboard-page .tone-customer-board .filters-grid .input,
html[data-theme="dark"] body.dashboard-page .tone-customer-board .filters-grid .filter-check,
html[data-theme="dark"] body.dashboard-page .tone-customer-board .filters-grid .btn.ghost {
  border-color: rgba(71, 85, 105, 0.84);
  background-color: rgba(15, 23, 42, 0.92);
  color: #dbeafe;
}

html[data-theme="dark"] body.dashboard-page .tone-customer-board .filters-grid .filter-check span {
  color: #dbeafe;
}

html[data-theme="dark"] .result-table thead th,
html[data-theme="dark"] body.dashboard-page .result-table thead th,
html[data-theme="dark"] body.tasks-page .result-table thead th,
html[data-theme="dark"] body.security-page:not(.login-page) .result-table thead th {
  border-bottom-color: rgba(71, 85, 105, 0.36) !important;
  box-shadow: inset 0 -1px 0 rgba(71, 85, 105, 0.32) !important;
}

html[data-theme="dark"] .result-table th,
html[data-theme="dark"] .result-table td {
  border-bottom-color: rgba(71, 85, 105, 0.32) !important;
}

html[data-theme="dark"] .result-table tbody tr:first-child td {
  border-top: 0 !important;
}
