:root {
  --background: #f6f8fa;
  --surface: #ffffff;
  --surface-muted: #f1f4f6;
  --surface-strong: #e9eef2;
  --text-primary: #111827;
  --text-secondary: #607080;
  --text-muted: #8793a0;
  --border: #dfe6ec;
  --border-strong: #ccd6df;
  --primary: #0f766e;
  --primary-hover: #0b5f59;
  --primary-soft: #e6f5f1;
  --success: #16794f;
  --success-soft: #e5f6ef;
  --warning: #a76506;
  --warning-soft: #fff5da;
  --danger: #b7352c;
  --danger-soft: #fff0ee;
  --sidebar: #17212b;
  --sidebar-active: #263645;
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 10px;
  --shadow-sm: 0 1px 2px rgb(15 23 42 / 5%);
  color: var(--text-primary);
  background: var(--background);
  font-family:
    Inter, "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background: var(--background);
}

body:not(.authenticated) .app-shell {
  display: none;
}

body.authenticated .login-screen {
  display: none;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

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

.login-screen {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
  background: #eef1f4;
}

.login-card {
  display: grid;
  gap: 14px;
  width: min(420px, 100%);
  padding: 28px;
  border: 1px solid #d9e0e6;
  border-radius: 10px;
  background: #ffffff;
  box-shadow: 0 18px 48px rgb(23 33 43 / 10%);
}

.login-card strong,
.login-card span,
.login-card label,
.login-card input {
  display: block;
}

.login-card > div:nth-child(2) strong {
  color: #15202b;
  font-size: 24px;
}

.login-card > div:nth-child(2) span,
.login-card label span,
.login-card p {
  color: #667380;
  font-size: 12px;
  font-weight: 800;
}

.login-card input {
  width: 100%;
  min-height: 42px;
  margin-top: 6px;
  padding: 0 12px;
  border: 1px solid #d8dee4;
  border-radius: 8px;
  color: #15202b;
}

.login-card p {
  min-height: 18px;
  margin: 0;
  color: #9a3b3b;
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 28px;
  padding: 24px 18px;
  color: #f8fbff;
  background: #17212b;
}

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

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 8px;
  color: #17212b;
  background: #8fe3c6;
  font-weight: 800;
}

.brand strong,
.brand span {
  display: block;
}

.brand span {
  margin-top: 3px;
  color: #aebdca;
  font-size: 12px;
}

.sidebar nav {
  display: grid;
  gap: 6px;
}

.sidebar button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 42px;
  padding: 0 12px;
  border: 0;
  border-radius: 8px;
  color: #c4d0dc;
  background: transparent;
  text-align: left;
}

.sidebar button:hover,
.sidebar .nav-active {
  color: #ffffff;
  background: #263645;
}

.workspace {
  min-width: 0;
  padding: 26px;
}

.report-page,
.ads-page,
.crm-page,
.followup-page,
.performance-page,
.ai-page,
.system-page {
  display: none;
}

.workspace.report-mode .stats-grid,
.workspace.report-mode .content-grid,
.workspace.report-mode .chat-panel,
.workspace.report-mode .ads-page,
.workspace.report-mode .crm-page,
.workspace.report-mode .followup-page,
.workspace.report-mode .performance-page,
.workspace.report-mode .ai-page,
.workspace.report-mode .system-page,
.workspace.chat-mode .stats-grid,
.workspace.chat-mode .content-grid,
.workspace.chat-mode .ads-page,
.workspace.chat-mode .report-page,
.workspace.chat-mode .crm-page,
.workspace.chat-mode .followup-page,
.workspace.chat-mode .performance-page,
.workspace.chat-mode .ai-page,
.workspace.chat-mode .system-page,
.workspace.crm-mode .stats-grid,
.workspace.crm-mode .content-grid,
.workspace.crm-mode .chat-panel,
.workspace.crm-mode .ads-page,
.workspace.crm-mode .report-page,
.workspace.crm-mode .performance-page,
.workspace.crm-mode .ai-page,
.workspace.crm-mode .system-page,
.workspace.followups-mode .stats-grid,
.workspace.followups-mode .content-grid,
.workspace.followups-mode .chat-panel,
.workspace.followups-mode .ads-page,
.workspace.followups-mode .report-page,
.workspace.followups-mode .crm-page,
.workspace.followups-mode .performance-page,
.workspace.followups-mode .ai-page,
.workspace.followups-mode .system-page,
.workspace.performance-mode .stats-grid,
.workspace.performance-mode .content-grid,
.workspace.performance-mode .chat-panel,
.workspace.performance-mode .ads-page,
.workspace.performance-mode .report-page,
.workspace.performance-mode .crm-page,
.workspace.performance-mode .followup-page,
.workspace.performance-mode .ai-page,
.workspace.performance-mode .system-page,
.workspace.ai-mode .stats-grid,
.workspace.ai-mode .content-grid,
.workspace.ai-mode .chat-panel,
.workspace.ai-mode .ads-page,
.workspace.ai-mode .crm-page,
.workspace.ai-mode .followup-page,
.workspace.ai-mode .performance-page,
.workspace.ai-mode .report-page,
.workspace.ai-mode .system-page,
.workspace.system-mode .stats-grid,
.workspace.system-mode .content-grid,
.workspace.system-mode .chat-panel,
.workspace.system-mode .ads-page,
.workspace.system-mode .report-page,
.workspace.system-mode .crm-page,
.workspace.system-mode .followup-page,
.workspace.system-mode .performance-page,
.workspace.system-mode .ai-page {
  display: none;
}

.workspace.ads-mode .stats-grid,
.workspace.ads-mode .content-grid,
.workspace.ads-mode .chat-panel,
.workspace.ads-mode .report-page,
.workspace.ads-mode .crm-page,
.workspace.ads-mode .followup-page,
.workspace.ads-mode .performance-page,
.workspace.ads-mode .ai-page,
.workspace.ads-mode .system-page {
  display: none;
}

.workspace.ads-mode .ads-page {
  display: grid;
}

.workspace.chat-mode .chat-panel {
  display: grid;
}

.workspace.report-mode .report-page {
  display: grid;
}

.ads-subpage {
  display: none;
}

.workspace.ads-mode[data-ads-subpage="accounts"] .ads-subpage[data-ads-subpage="accounts"],
.workspace.ads-mode[data-ads-subpage="stats"] .ads-subpage[data-ads-subpage="stats"] {
  display: grid;
  gap: 14px;
}

.workspace.crm-mode .crm-page {
  display: grid;
}

.workspace.followups-mode .followup-page {
  display: grid;
}

.workspace.crm-mode[data-crm-subpage="followups"] .followup-page,
.workspace.crm-mode[data-crm-subpage="performance"] .performance-page {
  display: grid;
  margin-top: 18px;
}

.workspace.performance-mode .performance-page {
  display: grid;
}

.performance-subpage {
  display: none;
}

.workspace.performance-mode[data-performance-subpage="overview"] .performance-subpage[data-performance-subpage="overview"],
.workspace.performance-mode[data-performance-subpage="roi"] .performance-subpage[data-performance-subpage="roi"],
.workspace.performance-mode[data-performance-subpage="people"] .performance-subpage[data-performance-subpage="people"],
.workspace.performance-mode[data-performance-subpage="periods"] .performance-subpage[data-performance-subpage="periods"],
.workspace.performance-mode[data-performance-subpage="sync"] .performance-subpage[data-performance-subpage="sync"],
.workspace.crm-mode[data-crm-subpage="performance"][data-performance-subpage="overview"] .performance-subpage[data-performance-subpage="overview"],
.workspace.crm-mode[data-crm-subpage="performance"][data-performance-subpage="roi"] .performance-subpage[data-performance-subpage="roi"],
.workspace.crm-mode[data-crm-subpage="performance"][data-performance-subpage="people"] .performance-subpage[data-performance-subpage="people"],
.workspace.crm-mode[data-crm-subpage="performance"][data-performance-subpage="periods"] .performance-subpage[data-performance-subpage="periods"],
.workspace.crm-mode[data-crm-subpage="performance"][data-performance-subpage="sync"] .performance-subpage[data-performance-subpage="sync"] {
  display: grid;
  gap: 14px;
}

.workspace.ai-mode .ai-page {
  display: grid;
}

.ai-subpage {
  display: none;
}

.workspace.ai-mode[data-ai-subpage="analysis"] .ai-subpage[data-ai-subpage="analysis"],
.workspace.ai-mode[data-ai-subpage="owners"] .ai-subpage[data-ai-subpage="owners"],
.workspace.ai-mode[data-ai-subpage="playbook"] .ai-subpage[data-ai-subpage="playbook"],
.workspace.ai-mode[data-ai-subpage="history"] .ai-subpage[data-ai-subpage="history"] {
  display: grid;
}

.workspace.system-mode .system-page {
  display: grid;
}

body.role-student .workspace:not(.performance-mode):not(.ai-mode) .stats-grid,
body.role-student .workspace:not(.performance-mode):not(.ai-mode) .content-grid {
  display: none;
}

body.role-student .performance-subnav,
body.role-student .performance-mode-tabs,
body.role-student #syncFeishuButton,
body.role-student #refreshPerformanceButton,
body.role-student #performanceProjectFilter,
body.role-student #performanceOrderTypeFilter,
body.role-student #performanceDatePresetFilter,
body.role-student #performanceDateFromFilter,
body.role-student #performanceDateToFilter,
body.role-student .performance-subpage[data-performance-subpage="roi"],
body.role-student .performance-subpage[data-performance-subpage="people"],
body.role-student .performance-subpage[data-performance-subpage="periods"],
body.role-student .performance-subpage[data-performance-subpage="sync"] {
  display: none;
}

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

.topbar p,
.panel p,
.stat-card p,
.stat-card span {
  margin: 0;
  color: #667380;
}

.topbar p {
  font-size: 13px;
}

.topbar h1 {
  margin: 5px 0 0;
  font-size: 28px;
  letter-spacing: 0;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.search {
  display: flex;
  align-items: center;
  gap: 8px;
  width: min(340px, 34vw);
  height: 42px;
  padding: 0 12px;
  border: 1px solid #d8dee4;
  border-radius: 8px;
  background: #ffffff;
}

.search input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  color: #15202b;
}

.primary-button,
.soft-button,
.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 42px;
  border-radius: 8px;
  border: 1px solid transparent;
}

.primary-button {
  padding: 0 15px;
  color: #ffffff;
  background: #1c6b61;
}

.soft-button,
.icon-button {
  color: #2b3b49;
  border-color: #d8dee4;
  background: #ffffff;
}

.soft-button {
  padding: 0 12px;
}

.icon-button {
  width: 42px;
}

.compact {
  width: 34px;
  height: 34px;
}

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

.stat-card,
.panel,
.chat-card {
  border: 1px solid #d9e0e6;
  border-radius: 8px;
  background: #ffffff;
}

.stat-card {
  display: flex;
  gap: 13px;
  min-height: 122px;
  padding: 18px;
}

.stat-icon {
  display: grid;
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 8px;
  color: #1c6b61;
  background: #dff5ef;
}

.stat-card strong {
  display: block;
  margin: 7px 0 5px;
  font-size: 24px;
}

.money-breakdown {
  display: inline-grid;
  gap: 2px;
  max-width: 100%;
  vertical-align: top;
}

.money-breakdown span {
  display: block;
  color: inherit;
  line-height: 1.18;
  white-space: nowrap;
}

.money-breakdown.multi {
  font-size: 0.9em;
}

.stat-card span {
  font-size: 12px;
}

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

.overview-split-summary div {
  min-height: 72px;
  padding: 12px;
  border: 1px solid #d9e0e6;
  border-radius: 8px;
  background: #f7f9fb;
}

.overview-split-summary span,
.overview-split-summary strong,
.overview-split-summary small {
  display: block;
}

.overview-split-summary span {
  color: #667380;
  font-size: 12px;
  font-weight: 800;
}

.overview-split-summary strong {
  margin-top: 6px;
  color: #15202b;
  font-size: 19px;
}

.overview-split-summary small {
  margin-top: 4px;
  color: #7a8793;
  font-size: 11px;
}

.overview-action-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px solid #d9e0e6;
  border-radius: 8px;
  background: #fbfcfd;
}

.overview-action-row span {
  color: #667380;
  font-size: 12px;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 18px;
  margin-bottom: 18px;
  min-width: 0;
}

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

.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

.panel-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.user-chip {
  display: grid;
  gap: 2px;
  min-width: 110px;
  padding: 7px 10px;
  border: 1px solid #d9e0e6;
  border-radius: 8px;
  background: #ffffff;
}

.user-chip strong,
.user-chip span {
  display: block;
}

.user-chip strong {
  color: #15202b;
  font-size: 13px;
}

.user-chip span {
  color: #667380;
  font-size: 11px;
}

.performance-mode-tabs {
  display: inline-flex;
  gap: 0;
  padding: 3px;
  border: 1px solid #1c6b61;
  border-radius: 8px;
  background: #ffffff;
}

.performance-mode-tabs button {
  height: 36px;
  padding: 0 18px;
  border: 0;
  border-radius: 6px;
  color: #1c6b61;
  background: transparent;
  font-weight: 900;
  cursor: pointer;
}

.performance-mode-tabs button.selected {
  color: #ffffff;
  background: #1c6b61;
}

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

.inline-filter select,
.inline-filter input {
  min-height: 36px;
  padding: 0 10px;
  border: 1px solid #d8dee4;
  border-radius: 8px;
  color: #15202b;
  background: #ffffff;
  font: inherit;
}

.inline-filter .owner-search-input {
  width: 112px;
  min-width: 112px;
}

.crm-search input {
  width: 210px;
  min-height: 36px;
  padding: 0 10px;
  border: 1px solid #d8dee4;
  border-radius: 8px;
  outline: 0;
  color: #15202b;
  background: #ffffff;
  font: inherit;
}

.crm-create-form {
  display: none;
  gap: 14px;
  margin-bottom: 14px;
  padding: 14px;
  border: 1px solid #b9e7d9;
  border-radius: 8px;
  background: #f4fbf8;
}

.crm-create-form.visible {
  display: grid;
}

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

.form-head strong {
  font-size: 16px;
}

.form-head span {
  color: #667380;
  font-size: 12px;
}

.crm-identify-box {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border: 1px solid #d8dee4;
  border-radius: 8px;
  color: #667380;
  background: #ffffff;
  font-size: 12px;
  font-weight: 800;
}

.crm-identify-box strong,
.crm-identify-box span {
  display: block;
}

.crm-identify-box.matched {
  border-color: #8fd7bc;
  color: #17664f;
  background: #eaf8f2;
}

.crm-identify-box.warning {
  border-color: #f0c36a;
  color: #75540b;
  background: #fff8e6;
}

.crm-smart-fill {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 120px;
  align-items: end;
  gap: 10px;
  padding: 12px;
  border: 1px solid #d8dee4;
  border-radius: 8px;
  background: #ffffff;
}

.crm-smart-fill label {
  display: grid;
  gap: 6px;
  min-width: 0;
  color: #667380;
  font-size: 12px;
  font-weight: 800;
}

.crm-smart-fill textarea {
  width: 100%;
  min-width: 0;
  min-height: 76px;
  padding: 10px;
  border: 1px solid #d8dee4;
  border-radius: 8px;
  outline: 0;
  color: #15202b;
  background: #f9fbfc;
  font: inherit;
  font-weight: 600;
  resize: vertical;
}

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

.crm-form-grid label {
  display: grid;
  gap: 6px;
  min-width: 0;
  color: #667380;
  font-size: 12px;
  font-weight: 800;
}

.crm-form-grid input,
.crm-form-grid select,
.crm-form-grid textarea {
  width: 100%;
  min-width: 0;
  min-height: 38px;
  padding: 0 10px;
  border: 1px solid #d8dee4;
  border-radius: 8px;
  outline: 0;
  color: #15202b;
  background: #ffffff;
  font: inherit;
  font-weight: 600;
}

.crm-form-grid textarea {
  min-height: 68px;
  padding: 9px 10px;
  resize: vertical;
}

.form-wide {
  grid-column: span 4;
}

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

.form-actions span {
  margin-right: auto;
  color: #1c6b61;
  font-size: 12px;
  font-weight: 800;
}

.panel h2 {
  margin: 0 0 5px;
  font-size: 18px;
}

.panel p {
  font-size: 13px;
}

.account-table {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.campaign-section {
  display: grid;
  gap: 10px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid #e1e6eb;
}

.campaign-head strong,
.campaign-head span {
  display: block;
}

.campaign-head span {
  margin-top: 4px;
  color: #667380;
  font-size: 12px;
}

.campaign-table {
  display: grid;
  gap: 2px;
  overflow-x: auto;
}

.connection-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 46px;
  margin-bottom: 12px;
  padding: 10px 12px;
  border: 1px solid #d8dee4;
  border-radius: 8px;
  background: #f7f9fb;
}

.connection-banner strong,
.connection-banner span {
  display: block;
}

.connection-banner span {
  color: #667380;
  font-size: 12px;
  text-align: right;
}

.connection-banner.connected {
  border-color: #b9e7d9;
  background: #eef9f5;
}

.connection-banner.connected strong {
  color: #17664f;
}

.connection-banner.loading {
  border-color: #d8c88f;
  background: #fff8df;
}

.connection-banner.loading strong {
  color: #8a5708;
}

.connection-banner.disconnected {
  border-color: #f0c5bf;
  background: #fff0ee;
}

.connection-banner.disconnected strong {
  color: #9f2f29;
}

.table-row {
  display: grid;
  grid-template-columns: minmax(220px, 1.4fr) 118px 92px 92px 82px 70px 72px 82px 82px 70px;
  align-items: center;
  gap: 12px;
  min-height: 64px;
  padding: 0 10px;
  border-radius: 8px;
}

.table-row:not(.table-head):hover {
  background: #f5f8fa;
}

.table-head {
  min-height: 34px;
  color: #72808c;
  font-size: 12px;
}

.campaign-row {
  display: grid;
  grid-template-columns: minmax(260px, 1.5fr) 100px 92px 82px 70px 72px 82px 82px 70px 92px;
  align-items: center;
  gap: 12px;
  min-height: 58px;
  padding: 0 10px;
  border-radius: 8px;
  font-size: 13px;
}

.campaign-row:not(.campaign-row-head):hover {
  background: #f5f8fa;
}

.campaign-row-head {
  min-height: 32px;
  color: #72808c;
  font-size: 12px;
}

.account-name strong,
.account-name small {
  display: block;
}

.account-name small,
.alert-text {
  margin-top: 4px;
  color: #71808d;
  font-size: 12px;
}

.effect-breakdown {
  max-width: 620px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.alert-text {
  display: block;
  color: #b24d17;
}

.status,
.stage,
.today-tag,
.unread {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.status-正常 {
  color: #14624d;
  background: #dff5ef;
}

.status-观察 {
  color: #8a5708;
  background: #fff1cf;
}

.status-受限 {
  color: #9f2f29;
  background: #ffe1de;
}

.roi,
.effect {
  color: #1c6b61;
  font-weight: 800;
}

.effect small {
  display: block;
  margin-top: 3px;
  color: #71808d;
  font-size: 11px;
  font-weight: 700;
}

.report-panel {
  display: grid;
  gap: 12px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid #e1e6eb;
}

.report-head,
.report-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.report-head strong,
.report-head span {
  display: block;
}

.report-head span {
  margin-top: 4px;
  color: #667380;
  font-size: 12px;
}

.report-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.manual-spend-panel {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 12px;
  padding: 12px;
  border: 1px solid #d9e0e6;
  border-radius: 8px;
  background: #f7f9fb;
}

.manual-spend-drawer {
  margin-top: 12px;
  border: 1px solid #d9e0e6;
  border-radius: 8px;
  background: #ffffff;
}

.manual-spend-drawer summary {
  min-height: 40px;
  padding: 0 12px;
  color: #17664f;
  font-size: 13px;
  font-weight: 800;
  line-height: 40px;
  cursor: pointer;
}

.manual-spend-drawer .manual-spend-panel {
  margin: 0 12px 12px;
}

.manual-spend-panel .inline-filter {
  align-items: flex-start;
  flex-direction: column;
  gap: 6px;
}

.manual-spend-panel select {
  min-width: 250px;
}

.manual-spend-panel input[type="number"] {
  width: 132px;
}

.form-status {
  min-height: 18px;
  color: #667380;
  font-size: 12px;
  font-weight: 800;
}

.account-admin-card {
  grid-column: 1 / -1;
}

.auth-user-form {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 12px;
  padding: 12px;
  border: 1px solid #d9e0e6;
  border-radius: 8px;
  background: #f7f9fb;
}

.auth-user-form label,
.auth-user-form span,
.auth-user-form input,
.auth-user-form select {
  display: block;
}

.auth-user-form label span {
  margin-bottom: 6px;
  color: #667380;
  font-size: 12px;
  font-weight: 800;
}

.auth-user-form input,
.auth-user-form select {
  min-height: 36px;
  padding: 0 10px;
  border: 1px solid #d8dee4;
  border-radius: 8px;
  background: #ffffff;
}

.auth-user-table {
  display: grid;
  gap: 4px;
  margin-top: 12px;
  overflow-x: auto;
}

.auth-user-row {
  display: grid;
  grid-template-columns: 100px 100px 100px 120px 76px 76px 76px minmax(180px, 1fr) 100px;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  padding: 0 10px;
  border-radius: 8px;
  font-size: 13px;
}

.auth-user-row:not(.auth-user-row-head):hover {
  background: #f5f8fa;
}

.auth-user-row-head {
  color: #72808c;
  font-size: 12px;
}

.auth-user-row button {
  width: fit-content;
}

.report-summary div {
  min-height: 68px;
  padding: 12px;
  border: 1px solid #d9e0e6;
  border-radius: 8px;
  background: #f7f9fb;
}

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

.report-summary span {
  color: #667380;
  font-size: 12px;
}

.report-summary strong {
  margin-top: 6px;
  color: #15202b;
  font-size: 20px;
}

.report-summary small {
  margin-top: 4px;
  color: #7a8793;
  font-size: 11px;
}

.report-table {
  display: grid;
  gap: 4px;
  overflow-x: auto;
}

.report-note {
  padding: 10px;
  border-radius: 8px;
  color: #495866;
  background: #f7f9fb;
  font-size: 12px;
  line-height: 1.45;
}

.roi-policy-note {
  border: 1px solid #d9e0e6;
}

.report-row {
  display: grid;
  grid-template-columns: 72px 92px 70px 102px 82px 70px 70px 82px 70px 70px;
  align-items: center;
  gap: 12px;
  min-height: 46px;
  padding: 0 10px;
  border-radius: 8px;
  font-size: 13px;
}

.report-row-toggle {
  width: 100%;
  border: 0;
  color: inherit;
  background: transparent;
  cursor: pointer;
  font: inherit;
  text-align: left;
}

.report-row-toggle.selected {
  border: 1px solid #b9e7d9;
  background: #eef9f5;
}

.report-row:not(.report-row-head):hover {
  background: #f5f8fa;
}

.acquisition-day-detail {
  display: grid;
  gap: 8px;
  margin: 0 0 10px;
  padding: 12px;
  border: 1px solid #d9e0e6;
  border-radius: 8px;
  background: #fbfcfd;
}

.detail-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 2px 4px;
}

.detail-head strong,
.detail-head span {
  display: block;
}

.detail-head span {
  color: #667380;
  font-size: 12px;
}

.detail-metrics {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  padding: 8px 0;
}

.detail-metrics div {
  min-height: 58px;
  padding: 10px;
  border: 1px solid #e3e8ed;
  border-radius: 8px;
  background: #ffffff;
}

.detail-metrics span,
.detail-metrics strong {
  display: block;
}

.detail-metrics span {
  color: #667380;
  font-size: 12px;
  font-weight: 700;
}

.detail-metrics strong {
  margin-top: 6px;
  color: #15202b;
  font-size: 18px;
}

.weekly-row {
  border: 1px solid #b9e7d9;
  background: #eef9f5;
}

.report-row-head {
  min-height: 32px;
  color: #72808c;
  font-size: 12px;
}

.segment-title {
  margin-top: 12px;
  padding: 8px 10px 2px;
  color: #263544;
  font-weight: 800;
}

.segment-row {
  display: grid;
  grid-template-columns: 100px 158px 92px 70px 102px 82px 70px 70px 82px;
  align-items: center;
  gap: 12px;
  min-height: 46px;
  padding: 0 10px;
  border-radius: 8px;
  font-size: 13px;
}

.segment-row:not(.segment-row-head):hover {
  background: #f5f8fa;
}

.segment-row-head {
  min-height: 32px;
  color: #72808c;
  font-size: 12px;
}

.segment-row strong small {
  display: block;
  margin-top: 3px;
  color: #8a94a3;
  font-size: 11px;
  font-weight: 600;
}

.business-row {
  grid-template-columns: 100px 92px 70px 102px 82px 70px 70px 70px 82px;
}

.channel-group {
  display: grid;
  gap: 2px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid #e3e8ed;
}

.channel-group-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 34px;
  padding: 0 10px;
}

.channel-group-title strong,
.channel-group-title span {
  display: block;
}

.channel-group-title strong {
  color: #263544;
  font-size: 13px;
}

.channel-group-title span {
  color: #667380;
  font-size: 12px;
}

.channel-row {
  grid-template-columns: 100px minmax(178px, 1.4fr) 92px 92px 70px 102px 82px 70px 70px 82px;
}

.channel-row-business {
  grid-template-columns: 72px 92px minmax(178px, 1.4fr) 92px 92px 70px 102px 82px 70px 70px 82px;
}

.attribution-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  max-width: 100%;
  min-height: 24px;
  padding: 3px 8px;
  border: 1px solid #d9e0e6;
  border-radius: 999px;
  color: #263544;
  background: #f8fafb;
  font-size: 12px;
  line-height: 1.2;
  white-space: nowrap;
}

.performance-row {
  display: grid;
  grid-template-columns: 120px 72px 82px 82px 64px 76px 72px 88px 72px 58px 58px 58px 82px 92px;
  align-items: center;
  gap: 12px;
  min-height: 46px;
  min-width: 1248px;
  padding: 0 10px;
  border-radius: 8px;
  font-size: 13px;
}

.performance-person-toggle {
  width: 100%;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font: inherit;
  text-align: left;
}

.performance-row:not(.performance-row-head):hover {
  background: #f5f8fa;
}

.performance-row-head {
  min-height: 32px;
  color: #72808c;
  font-size: 12px;
  pointer-events: none;
}

.performance-social-detail {
  min-width: 1060px;
  margin: 4px 10px 12px;
  padding: 8px;
  border: 1px solid #d8e1e8;
  border-radius: 8px;
  background: #f8fafb;
}

.performance-social-row {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) 76px 76px 76px 64px 88px 96px 80px 112px;
  align-items: center;
  gap: 12px;
  min-height: 36px;
  padding: 0 8px;
  border-radius: 6px;
  font-size: 13px;
}

.performance-social-row:not(.performance-social-head):hover {
  background: #eef4f7;
}

.performance-social-head {
  color: #72808c;
  font-size: 12px;
}

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

.performance-project-summary div {
  min-height: 74px;
  padding: 12px;
  border: 1px solid #d9e0e6;
  border-radius: 8px;
  background: #f7f9fb;
}

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

.performance-project-summary span {
  color: #667380;
  font-size: 12px;
}

.performance-project-summary strong {
  margin-top: 6px;
  color: #15202b;
  font-size: 20px;
}

.performance-project-summary small {
  margin-top: 4px;
  color: #7a8793;
  font-size: 11px;
  line-height: 1.35;
}

.performance-roi-summary div {
  min-height: 92px;
}

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

.performance-period-row {
  display: grid;
  grid-template-columns: 96px 64px 92px 82px 112px 112px 112px 112px 112px;
  align-items: center;
  gap: 12px;
  min-height: 46px;
  min-width: 950px;
  padding: 0 10px;
  border-radius: 8px;
  font-size: 13px;
}

.performance-period-row:not(.performance-period-row-head):hover {
  background: #f5f8fa;
}

.performance-period-row-head {
  min-height: 32px;
  color: #72808c;
  font-size: 12px;
}

.performance-roi-row {
  display: grid;
  grid-template-columns: 96px 112px 112px 76px 70px 82px 92px;
  align-items: center;
  gap: 12px;
  min-height: 46px;
  min-width: 720px;
  padding: 0 10px;
  border-radius: 8px;
  font-size: 13px;
}

.performance-roi-row:not(.performance-roi-row-head):hover {
  background: #f5f8fa;
}

.performance-roi-toggle {
  width: 100%;
  border: 0;
  color: inherit;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.performance-roi-row-head {
  min-height: 32px;
  color: #72808c;
  font-size: 12px;
}

.performance-daily-project-breakdown {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 0 10px 10px;
}

.performance-daily-project-card {
  display: grid;
  gap: 3px;
  min-height: 70px;
  padding: 10px 12px;
  border: 1px solid #d8dee4;
  border-radius: 8px;
  background: #f8fafb;
}

.performance-daily-project-card.peptide {
  border-color: #cdded8;
  background: #f5faf8;
}

.performance-daily-project-card strong,
.performance-daily-project-card span,
.performance-daily-project-card small {
  display: block;
}

.performance-daily-project-card strong {
  color: #53616e;
  font-size: 12px;
}

.performance-daily-project-card span {
  color: #15202b;
  font-size: 18px;
  font-weight: 800;
}

.performance-daily-project-card small {
  color: #72808c;
  font-size: 11px;
  line-height: 1.35;
}

.performance-roi-detail {
  display: grid;
  gap: 8px;
  margin: 0 10px 10px;
  padding: 12px;
  border: 1px solid #d8dee4;
  border-radius: 8px;
  background: #f8fafb;
}

.performance-roi-detail-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  color: #5d6a75;
  font-size: 12px;
}

.performance-roi-detail-head strong {
  color: #263544;
  font-size: 14px;
}

.performance-roi-person-row {
  display: grid;
  grid-template-columns: 120px 112px 70px 72px 92px 76px 64px 112px 112px 112px;
  align-items: center;
  gap: 12px;
  min-height: 38px;
  padding: 0 8px;
  border-radius: 8px;
  font-size: 13px;
}

.performance-roi-person-row:not(.performance-roi-person-head):hover {
  background: #ffffff;
}

.performance-roi-person-head {
  min-height: 28px;
  color: #72808c;
  font-size: 12px;
}

.performance-excel-wrap {
  display: grid;
  grid-template-columns: minmax(520px, 1.35fr) minmax(520px, 1.35fr) minmax(230px, 0.75fr) minmax(520px, 1.35fr);
  gap: 10px;
  align-items: start;
  overflow-x: auto;
  padding: 2px 0 12px;
}

.performance-excel {
  width: 100%;
  min-width: 520px;
  border-collapse: collapse;
  table-layout: fixed;
  color: #000000;
  background: #ffffff;
  font-size: 13px;
}

.performance-excel-compact {
  min-width: 230px;
}

.performance-excel th,
.performance-excel td {
  height: 27px;
  padding: 0 6px;
  border: 1px solid #000000;
  text-align: center;
  white-space: nowrap;
}

.performance-excel .excel-title {
  height: 24px;
  color: #000000;
  background: #ffffff;
  font-size: 16px;
  font-weight: 900;
}

.performance-excel thead tr:not(:first-child) th {
  color: #ffffff;
  background: #1f4e78;
  font-weight: 800;
}

.performance-excel tbody td:nth-child(1),
.performance-excel tbody td:nth-child(2) {
  background: #1f4e78;
  color: #ffffff;
}

.performance-excel tbody tr.excel-total td {
  color: #ffffff;
  background: #1f4e78;
  font-weight: 900;
}

.performance-excel tbody tr.excel-rmb td {
  height: 34px;
  color: #000000;
  background: #ffffff;
  font-size: 14px;
}

.performance-excel tbody tr.excel-rmb td:last-child {
  color: #ff0000;
  font-size: 20px;
}

.crm-layout {
  display: grid;
  grid-template-columns: minmax(280px, 34%) minmax(0, 1fr);
  gap: 14px;
  min-height: 520px;
}

.crm-subnav,
.performance-subnav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px;
  border: 1px solid #d8dee4;
  border-radius: 8px;
  background: #ffffff;
}

.crm-subnav button,
.performance-subnav button {
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: #4b5b68;
  background: transparent;
  font-weight: 800;
  cursor: pointer;
}

.crm-subnav button:hover,
.crm-subnav button.selected,
.performance-subnav button:hover,
.performance-subnav button.selected {
  color: #17664f;
  border-color: #b9e7d9;
  background: #eef9f5;
}

.crm-subpage {
  display: none;
}

.crm-member-panel.crm-subpage {
  display: none;
}

.workspace.crm-mode[data-crm-subpage="customers"] .crm-subpage[data-crm-subpage="customers"],
.workspace.crm-mode[data-crm-subpage="journey"] .crm-subpage[data-crm-subpage="journey"],
.workspace.crm-mode[data-crm-subpage="create"] .crm-subpage[data-crm-subpage="create"],
.workspace.crm-mode[data-crm-subpage="members"] .crm-subpage[data-crm-subpage="members"],
.workspace.crm-mode[data-crm-subpage="sync"] .crm-subpage[data-crm-subpage="sync"] {
  display: grid;
}

.workspace.crm-mode[data-crm-subpage="create"] .crm-create-form {
  display: grid;
}

.crm-customers-subpage,
.crm-journey-subpage,
.crm-sync-page {
  gap: 14px;
}

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

.sync-setting-grid div {
  display: grid;
  gap: 6px;
  min-height: 112px;
  padding: 14px;
  border: 1px solid #d8dee4;
  border-radius: 8px;
  background: #ffffff;
}

.sync-setting-grid span,
.sync-setting-grid small {
  color: #667380;
}

.crm-member-panel {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid #d8dee4;
  border-radius: 8px;
  background: #ffffff;
}

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

.member-table {
  display: grid;
  gap: 6px;
  max-height: 360px;
  overflow: auto;
}

.member-row {
  display: grid;
  grid-template-columns: minmax(160px, 1.2fr) 90px 90px 90px 70px 110px 70px 100px;
  align-items: center;
  gap: 8px;
  min-width: 900px;
  padding: 8px 10px;
  border: 1px solid #e3e8ec;
  border-radius: 8px;
  background: #fbfcfd;
  font-size: 12px;
}

.member-row-head {
  color: #667380;
  background: #f2f5f7;
  font-weight: 800;
}

.member-row strong,
.member-row small {
  display: block;
}

.member-row small {
  color: #748290;
  overflow-wrap: anywhere;
}

.member-row select {
  width: 100%;
  height: 32px;
  border: 1px solid #d4dce2;
  border-radius: 8px;
  background: #ffffff;
  font: inherit;
}

.member-row.saving {
  opacity: 0.62;
}

.member-row.error {
  border-color: #f0b8a8;
  background: #fff7f3;
}

.crm-customer-list,
.crm-detail {
  min-width: 0;
  border: 1px solid #d8dee4;
  border-radius: 8px;
  background: #ffffff;
}

.crm-customer-list {
  display: grid;
  align-content: start;
  gap: 6px;
  max-height: 640px;
  padding: 8px;
  overflow: auto;
}

.crm-customer-item {
  display: grid;
  gap: 5px;
  width: 100%;
  padding: 12px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: #15202b;
  background: #ffffff;
  text-align: left;
  cursor: pointer;
}

.crm-customer-item:hover,
.crm-customer-item.selected {
  border-color: #b9e7d9;
  background: #eef9f5;
}

.crm-customer-item strong {
  font-size: 14px;
}

.crm-customer-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.crm-customer-item span,
.crm-customer-item small {
  color: #667380;
  font-size: 12px;
}

.crm-stage-pill {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 8px;
  border: 1px solid #d8dee4;
  border-radius: 999px;
  color: #36515d;
  background: #f4f7f8;
  font-size: 11px;
  font-weight: 900;
  white-space: nowrap;
}

.crm-stage-pill.stage-3,
.crm-stage-pill.stage-5 {
  color: #8a4c00;
  border-color: #f0d2a8;
  background: #fff7e8;
}

.crm-stage-pill.stage-4 {
  color: #17664f;
  border-color: #b9e7d9;
  background: #eef9f5;
}

.crm-detail {
  display: grid;
  align-content: start;
  gap: 12px;
  padding: 16px;
  overflow: auto;
}

.crm-detail-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid #e7ecef;
}

.crm-detail-head strong {
  display: block;
  font-size: 20px;
}

.crm-detail-head span {
  display: block;
  margin-top: 5px;
  color: #667380;
}

.crm-value {
  color: #1c6b61;
  font-size: 22px;
  font-weight: 900;
  white-space: nowrap;
}

.crm-lifecycle-strip {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 6px;
}

.crm-lifecycle-step {
  display: grid;
  gap: 4px;
  min-height: 54px;
  padding: 8px;
  border: 1px solid #e0e6eb;
  border-radius: 8px;
  color: #73818d;
  background: #f9fbfc;
  font-size: 11px;
}

.crm-lifecycle-step span {
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  background: #e7edf0;
  font-weight: 900;
}

.crm-lifecycle-step strong {
  overflow-wrap: anywhere;
}

.crm-lifecycle-step.done {
  color: #35665c;
  border-color: #cbe7df;
  background: #f2fbf7;
}

.crm-lifecycle-step.active {
  color: #0f5f50;
  border-color: #7ed8c1;
  background: #e8f8f3;
}

.crm-tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.crm-tag {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border: 1px solid #dce4e8;
  border-radius: 999px;
  color: #465866;
  background: #ffffff;
  font-size: 12px;
  font-weight: 800;
}

.crm-tag.muted {
  color: #7a8792;
  background: #f7f9fa;
}

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

.crm-profile-grid div {
  display: grid;
  gap: 5px;
  min-height: 72px;
  padding: 12px;
  border: 1px solid #e0e6eb;
  border-radius: 8px;
  background: #f9fbfc;
}

.crm-profile-grid span {
  color: #667380;
  font-size: 12px;
  font-weight: 800;
}

.crm-profile-grid strong {
  min-width: 0;
  overflow-wrap: anywhere;
}

.crm-followup-panel {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid #b9e7d9;
  border-radius: 8px;
  background: #f4fbf8;
}

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

.crm-followup-grid label,
.crm-followup-note {
  display: grid;
  gap: 6px;
  color: #667380;
  font-size: 12px;
  font-weight: 800;
}

.crm-followup-grid select,
.crm-followup-grid input,
.crm-followup-note input,
.crm-followup-note textarea {
  width: 100%;
  min-width: 0;
  min-height: 38px;
  padding: 0 10px;
  border: 1px solid #d8dee4;
  border-radius: 8px;
  outline: 0;
  color: #15202b;
  background: #ffffff;
  font: inherit;
  font-weight: 600;
}

.crm-followup-note textarea {
  min-height: 78px;
  padding: 9px 10px;
  resize: vertical;
}

.crm-followup-note input {
  padding: 0 10px;
}

.crm-journey-board {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.crm-stage-column {
  display: grid;
  align-content: start;
  gap: 8px;
  min-width: 0;
  padding: 10px;
  border: 1px solid #d8dee4;
  border-radius: 8px;
  background: #ffffff;
}

.crm-stage-column-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 32px;
  color: #20303a;
}

.crm-stage-column-head span {
  color: #6a7783;
  font-weight: 900;
}

.crm-journey-card {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid #e0e6eb;
  border-radius: 8px;
  background: #fbfcfd;
  cursor: pointer;
}

.crm-journey-card.lead-card {
  cursor: default;
  background: #f8fbff;
}

.crm-journey-card strong,
.crm-journey-card span,
.crm-journey-card p,
.crm-journey-card small {
  min-width: 0;
  overflow-wrap: anywhere;
}

.crm-journey-card div > span,
.crm-journey-card small {
  color: #667380;
  font-size: 12px;
}

.crm-journey-card p {
  margin: 0;
  color: #273843;
  font-size: 13px;
  line-height: 1.45;
}

.empty-report.compact {
  min-height: 48px;
  padding: 12px;
  font-size: 12px;
}

.crm-order-row {
  display: grid;
  grid-template-columns: 86px 86px 92px 82px minmax(180px, 1fr) 112px 128px;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  min-width: 880px;
  padding: 0 10px;
  border-radius: 8px;
  font-size: 13px;
}

.crm-order-row:not(.crm-order-row-head):hover {
  background: #f5f8fa;
}

.crm-order-row span,
.crm-order-row strong {
  min-width: 0;
  overflow-wrap: anywhere;
}

.crm-order-extra {
  display: flex;
  grid-column: 1 / -1;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 0 10px;
}

.crm-order-extra span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  max-width: 100%;
  padding: 5px 8px;
  border: 1px solid #e0e6eb;
  border-radius: 8px;
  color: #495866;
  background: #f7f9fb;
  font-size: 12px;
}

.crm-order-extra b {
  color: #72808c;
  font-weight: 800;
}

.crm-order-row-head {
  min-height: 32px;
  color: #72808c;
  font-size: 12px;
}

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

.followup-card {
  display: grid;
  gap: 12px;
  min-width: 0;
  padding: 14px;
  border: 1px solid #d8dee4;
  border-radius: 8px;
  background: #ffffff;
}

.followup-card-head,
.followup-foot {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.followup-card-head strong,
.followup-card-head span {
  display: block;
}

.followup-card-head span,
.followup-meta span,
.followup-foot span {
  color: #667380;
  font-size: 12px;
}

.followup-priority {
  padding: 5px 8px;
  border-radius: 8px;
  color: #17664f;
  background: #dff5ef;
  font-size: 12px;
  white-space: nowrap;
}

.priority-高 {
  color: #8a351d;
  background: #ffe4d9;
}

.priority-低 {
  color: #506070;
  background: #eef2f5;
}

.followup-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.followup-meta span {
  padding: 5px 8px;
  border-radius: 8px;
  background: #f5f8fa;
}

.followup-card p {
  min-height: 42px;
  margin: 0;
  color: #263544;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.followup-foot {
  align-items: center;
  padding-top: 8px;
  border-top: 1px solid #e7ecef;
}

.followup-foot .soft-button {
  width: auto;
  height: 36px;
}

.empty-report {
  padding: 12px;
  border-radius: 8px;
  color: #667380;
  background: #f7f9fb;
}

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

.alert-item {
  display: flex;
  gap: 10px;
  padding: 12px;
  border-radius: 8px;
  background: #f7f9fb;
}

.alert-item strong,
.alert-item span {
  display: block;
}

.alert-item span {
  margin-top: 4px;
  color: #6e7b86;
  font-size: 12px;
}

.danger {
  color: #a8322a;
}

.warning {
  color: #946007;
}

.success {
  color: #17664f;
}

.segmented {
  display: inline-flex;
  height: 38px;
  padding: 3px;
  border-radius: 8px;
  border: 1px solid #d8dee4;
  background: #f4f6f8;
}

.segmented button {
  min-width: 72px;
  border: 0;
  border-radius: 6px;
  color: #61707d;
  background: transparent;
}

.segmented .selected {
  color: #15202b;
  background: #ffffff;
  box-shadow: 0 1px 3px rgb(23 33 43 / 12%);
}

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

.chat-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.sync-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 42px;
  margin: -2px 0 14px;
  padding: 8px 10px;
  border: 1px solid #d9e0e6;
  border-radius: 8px;
  background: #ffffff;
}

.performance-sync-strip.active {
  border-color: #b8d8ca;
  background: #f4fbf7;
}

.performance-sync-strip.loading {
  border-color: #c7d7f2;
  background: #f5f8ff;
}

.chat-filter-bar {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.chat-filter-bar label {
  display: grid;
  gap: 6px;
}

.chat-filter-bar span {
  color: #667380;
  font-size: 12px;
  font-weight: 700;
}

.chat-filter-bar select {
  width: 100%;
  min-height: 40px;
  padding: 0 10px;
  border: 1px solid #d8dee4;
  border-radius: 8px;
  color: #15202b;
  background: #ffffff;
  font: inherit;
}

.chat-filter-summary {
  margin: -4px 0 12px;
  color: #667380;
  font-size: 12px;
  font-weight: 700;
}

.webhook-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 42px;
  margin: -2px 0 12px;
  padding: 8px 10px;
  border: 1px solid #d9e0e6;
  border-radius: 8px;
  color: #526170;
  background: #ffffff;
}

.webhook-strip strong {
  color: #263544;
}

.webhook-strip span {
  font-size: 12px;
}

.webhook-strip.active {
  border-color: #bce5d9;
  color: #276858;
  background: #eefaf6;
}

.toggle-control {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #263544;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.toggle-control input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.toggle-control span {
  position: relative;
  width: 38px;
  height: 22px;
  border-radius: 999px;
  background: #c9d2db;
  transition: background 0.2s ease;
}

.toggle-control span::after {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 1px 2px rgb(23 33 43 / 24%);
  content: "";
  transition: transform 0.2s ease;
}

.toggle-control input:checked + span {
  background: #1c6b61;
}

.toggle-control input:checked + span::after {
  transform: translateX(16px);
}

.sync-meta {
  display: flex;
  align-items: center;
  gap: 14px;
  color: #667380;
  font-size: 12px;
}

.sync-meta strong {
  color: #253545;
}

.chat-metrics div {
  min-height: 72px;
  padding: 12px;
  border: 1px solid #d9e0e6;
  border-radius: 8px;
  background: #f7f9fb;
}

.chat-metrics span,
.chat-metrics strong,
.chat-metrics small {
  display: block;
}

.chat-metrics span {
  color: #667380;
  font-size: 12px;
}

.chat-metrics strong {
  margin-top: 7px;
  color: #15202b;
  font-size: 22px;
}

.chat-metrics .metric-note {
  margin-top: 7px;
  color: #7b8794;
  font-size: 11px;
  line-height: 1.35;
}

.ai-panel {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
  padding: 14px;
  border: 1px solid #d9e0e6;
  border-radius: 8px;
  background: #ffffff;
}

.ai-subnav {
  display: inline-flex;
  width: fit-content;
  gap: 0;
  margin-bottom: 14px;
  padding: 3px;
  border: 1px solid #1c6b61;
  border-radius: 8px;
  background: #ffffff;
}

.ai-subnav button {
  min-height: 36px;
  padding: 0 16px;
  border: 0;
  border-radius: 6px;
  color: #1c6b61;
  background: transparent;
  font-weight: 900;
}

.ai-subnav button.selected {
  color: #ffffff;
  background: #1c6b61;
}

.ai-filter-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.ai-filter-grid label {
  display: grid;
  gap: 6px;
}

.ai-filter-grid span {
  color: #667380;
  font-size: 12px;
  font-weight: 700;
}

.ai-filter-grid select {
  width: 100%;
  min-height: 42px;
  padding: 0 10px;
  border: 1px solid #d8dee4;
  border-radius: 8px;
  color: #15202b;
  background: #ffffff;
  font: inherit;
}

.ai-panel > div:first-child {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.ai-panel strong,
.ai-panel span {
  display: block;
}

.ai-panel span,
.ai-panel p,
.ai-score small {
  color: #667380;
  font-size: 12px;
}

.ai-panel p {
  margin: 0;
}

.ai-result {
  display: grid;
  gap: 12px;
}

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

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

.ai-history-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid #e0e6eb;
  border-radius: 8px;
  background: #f8fafb;
}

.ai-history-item strong,
.ai-history-item span {
  display: block;
}

.ai-history-item span {
  margin-top: 4px;
  color: #667380;
  font-size: 12px;
}

.ai-history-item p {
  display: -webkit-box;
  margin-top: 7px;
  overflow: hidden;
  color: #344250;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.ai-playbook-item {
  display: grid;
  gap: 6px;
  padding: 12px;
  border: 1px solid #d9e0e6;
  border-radius: 8px;
  background: #f8fafb;
}

.ai-playbook-item p {
  color: #263544;
  line-height: 1.5;
}

.ai-owner-board {
  display: grid;
  gap: 12px;
}

.ai-owner-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid #d9e0e6;
  border-radius: 8px;
  background: #f8fafb;
}

.ai-owner-head,
.ai-owner-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.ai-owner-head strong,
.ai-owner-head span,
.ai-owner-score strong,
.ai-owner-score span {
  display: block;
}

.ai-owner-head span,
.ai-owner-score span {
  margin-top: 4px;
  color: #667380;
  font-size: 12px;
}

.ai-owner-score {
  min-width: 92px;
  padding: 9px 12px;
  border: 1px solid #b9e7d9;
  border-radius: 8px;
  background: #eef9f5;
  text-align: center;
}

.ai-owner-score strong {
  color: #17664f;
  font-size: 24px;
}

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

.ai-owner-grid section,
.ai-owner-findings {
  min-width: 0;
  padding: 12px;
  border: 1px solid #e0e6eb;
  border-radius: 8px;
  background: #ffffff;
}

.ai-owner-grid h4,
.ai-owner-findings h4 {
  margin: 0 0 8px;
  color: #263544;
  font-size: 13px;
}

.ai-owner-grid ul,
.ai-owner-findings ul {
  margin: 0;
  padding-left: 18px;
  color: #3d4b58;
  font-size: 12px;
  line-height: 1.5;
}

.ai-owner-actions {
  justify-content: flex-end;
}

.system-page {
  gap: 14px;
}

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

.system-card {
  display: grid;
  align-content: start;
  gap: 12px;
  min-width: 0;
  padding: 14px;
  border: 1px solid #d9e0e6;
  border-radius: 8px;
  background: #ffffff;
}

.system-list,
.definition-list {
  display: grid;
  gap: 8px;
}

.system-item,
.definition-item {
  display: grid;
  gap: 5px;
  padding: 11px 12px;
  border: 1px solid #e0e6eb;
  border-radius: 8px;
  background: #f8fafb;
}

.system-item strong,
.system-item span,
.definition-item strong,
.definition-item span {
  display: block;
}

.system-item span,
.definition-item span {
  color: #667380;
  font-size: 12px;
  line-height: 1.45;
}

.system-item small {
  display: block;
  color: #7a8793;
  font-size: 11px;
  line-height: 1.5;
}

.system-item.success {
  border-color: #b9e7d9;
  background: #eef9f5;
}

.system-item.warning {
  border-color: #f0d49b;
  background: #fff8e6;
}

.system-item.danger {
  border-color: #f0c5bf;
  background: #fff0ee;
}

.alias-form {
  display: grid;
  grid-template-columns: minmax(120px, 0.8fr) minmax(220px, 1.6fr) auto auto;
  align-items: end;
  gap: 10px;
}

.alias-list {
  display: grid;
  gap: 8px;
}

.alias-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid #e0e6eb;
  border-radius: 8px;
  background: #f8fafb;
}

.alias-item strong,
.alias-item span {
  display: block;
}

.alias-item span {
  margin-top: 3px;
  color: #667380;
  font-size: 12px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.ai-score {
  display: grid;
  grid-template-columns: 90px 110px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: 8px;
  background: #eef9f5;
}

.ai-score strong {
  color: #17664f;
  font-size: 24px;
}

.ai-summary,
.ai-warning {
  padding: 10px;
  border-radius: 8px;
  color: #263544;
  background: #f7f9fb;
  line-height: 1.5;
}

.ai-warning {
  color: #9f2f29;
  background: #fff0ee;
}

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

.ai-columns section {
  min-width: 0;
  padding: 12px;
  border: 1px solid #d9e0e6;
  border-radius: 8px;
  background: #f7f9fb;
}

.ai-columns h3 {
  margin: 0 0 8px;
  font-size: 14px;
}

.ai-columns ul {
  display: grid;
  gap: 7px;
  margin: 0;
  padding-left: 18px;
  color: #344554;
  font-size: 13px;
  line-height: 1.45;
}

.ai-action-grid {
  display: grid;
  gap: 10px;
}

.ai-action-grid section {
  padding: 12px;
  border: 1px solid #d9e0e6;
  border-radius: 8px;
  background: #f7f9fb;
}

.ai-action-grid h3 {
  margin: 0 0 10px;
  font-size: 15px;
}

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

.ai-template-item {
  display: grid;
  gap: 7px;
  min-width: 0;
  padding: 10px;
  border: 1px solid #e0e6eb;
  border-radius: 8px;
  background: #ffffff;
}

.ai-template-item strong,
.ai-template-item span,
.ai-template-item p {
  display: block;
}

.ai-template-item strong {
  color: #15202b;
  font-size: 13px;
}

.ai-template-item p {
  margin: 0;
  color: #263544;
  font-size: 13px;
  line-height: 1.45;
}

.ai-template-item span {
  color: #667380;
  font-size: 12px;
  line-height: 1.4;
}

.ai-customer-findings {
  display: grid;
  gap: 10px;
}

.ai-customer-findings h3 {
  margin: 0;
  font-size: 15px;
}

.ai-customer-findings > div {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.ai-customer-findings article {
  display: grid;
  gap: 8px;
  min-width: 0;
  padding: 12px;
  border: 1px solid #d9e0e6;
  border-radius: 8px;
  background: #f7f9fb;
}

.ai-customer-findings article > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.ai-customer-findings article strong,
.ai-customer-findings article span {
  display: block;
}

.ai-customer-findings article span {
  color: #667380;
  font-size: 12px;
  text-align: right;
}

.ai-customer-findings p {
  margin: 0;
  color: #263544;
  line-height: 1.45;
}

.ai-customer-findings ul {
  display: grid;
  gap: 6px;
  margin: 0;
  padding-left: 18px;
  color: #344554;
  font-size: 13px;
  line-height: 1.45;
}

.chat-card {
  display: grid;
  gap: 12px;
  min-height: 245px;
  padding: 15px;
}

.chat-card-head,
.chat-footer,
.chat-meta,
.next-action {
  display: flex;
  align-items: center;
  gap: 8px;
}

.chat-card-head,
.chat-footer {
  justify-content: space-between;
}

.chat-card-head strong,
.chat-card-head span {
  display: block;
}

.chat-card-head span,
.chat-meta span,
.chat-footer span {
  color: #687682;
  font-size: 12px;
}

.chat-meta {
  flex-wrap: wrap;
}

.stage-0 {
  color: #1f5d8d;
  background: #e1f0ff;
}

.stage-1 {
  color: #4f5f0f;
  background: #f0f4c9;
}

.stage-2 {
  color: #715611;
  background: #fff1cf;
}

.stage-3 {
  color: #8f3b6b;
  background: #ffe1ef;
}

.stage-4 {
  color: #17664f;
  background: #dff5ef;
}

.today-tag {
  color: #1f5d8d;
  background: #e1f0ff;
}

.realtime-tag {
  color: #14624d;
  background: #dff5ef;
}

.message {
  min-height: 44px;
  margin: 0;
  color: #243441;
  line-height: 1.5;
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  word-break: break-word;
}

.next-action {
  min-height: 42px;
  padding: 10px;
  border-radius: 8px;
  color: #1c6b61;
  background: #eef9f5;
  font-size: 13px;
}

.chat-footer strong {
  color: #15202b;
}

.unread {
  color: #ffffff !important;
  background: #d85d3f;
}

/* Layout polish: keep the console dense, aligned, and consistent across modules. */
.app-shell {
  grid-template-columns: 236px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  gap: 22px;
  padding: 22px 14px;
  background: var(--sidebar);
}

.brand {
  padding: 0 6px;
}

.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  color: #0d302c;
  background: #8bdcc4;
}

.sidebar button {
  min-height: 40px;
  padding: 0 10px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 700;
}

.sidebar button:hover,
.sidebar .nav-active {
  background: var(--sidebar-active);
}

.nav-icon,
.tool-icon {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
}

.nav-icon {
  width: 26px;
  height: 26px;
  color: #b7c7d5;
  background: rgb(255 255 255 / 8%);
}

.sidebar .nav-active .nav-icon,
.sidebar button:hover .nav-icon {
  color: #0d302c;
  background: #8bdcc4;
}

.tool-icon {
  width: 24px;
  height: 24px;
  color: var(--primary);
  background: var(--primary-soft);
}

.workspace {
  display: grid;
  align-content: start;
  gap: 18px;
  padding: 22px 26px 30px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 4;
  margin: -22px -26px 2px;
  padding: 18px 26px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--background);
}

.topbar h1 {
  margin-top: 4px;
  color: var(--text-primary);
  font-size: 24px;
  font-weight: 700;
  line-height: 1.2;
}

.topbar p {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
}

.top-actions {
  justify-content: flex-end;
  flex-wrap: wrap;
}

.search,
.user-chip,
.stat-card,
.panel,
.chat-card,
.system-card,
.crm-customer-list,
.crm-detail {
  box-shadow: var(--shadow-sm);
}

.search,
.user-chip,
.stat-card,
.panel,
.chat-card,
.connection-banner,
.sync-strip,
.webhook-strip,
.ai-panel,
.system-card,
.crm-customer-list,
.crm-detail {
  border-color: var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.search {
  height: 38px;
  width: min(300px, 30vw);
}

.primary-button,
.soft-button,
.icon-button {
  height: 38px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 700;
  transition:
    background 0.16s ease,
    border-color 0.16s ease,
    color 0.16s ease;
}

.primary-button {
  background: var(--primary);
}

.primary-button:hover {
  background: var(--primary-hover);
}

.soft-button,
.icon-button {
  color: #2d3d4a;
  border-color: var(--border-strong);
}

.soft-button:hover,
.icon-button:hover {
  border-color: #b7c5cf;
  background: var(--surface-muted);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

input:focus,
select:focus,
textarea:focus {
  border-color: #91cfc0 !important;
  outline: 2px solid rgb(15 118 110 / 13%);
  outline-offset: 0;
}

.stats-grid {
  gap: 12px;
  margin-bottom: 0;
}

.stat-card {
  min-height: 104px;
  padding: 15px;
}

.stat-icon {
  width: 36px;
  height: 36px;
  color: var(--primary);
  background: var(--primary-soft);
}

.stat-card strong {
  margin: 5px 0 4px;
  font-size: 22px;
  line-height: 1.15;
}

.stat-card p {
  font-size: 12px;
  font-weight: 800;
}

.stat-card span {
  color: var(--text-muted);
  line-height: 1.35;
}

.content-grid {
  grid-template-columns: minmax(0, 1fr) minmax(280px, 320px);
  gap: 16px;
  margin-bottom: 0;
}

.panel,
.report-page,
.ads-page,
.crm-page,
.followup-page,
.performance-page,
.ai-page,
.system-page {
  align-content: start;
  gap: 14px;
}

.panel {
  padding: 16px;
}

.panel-head,
.report-head,
.section-head,
.form-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.panel-head,
.report-head,
.section-head {
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0;
}

.panel h2,
.report-head strong,
.section-head strong {
  color: var(--text-primary);
  font-size: 16px;
  font-weight: 700;
}

.panel p,
.report-head span,
.section-head span,
.campaign-head span,
.detail-head span {
  color: var(--text-secondary);
  line-height: 1.45;
}

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

.performance-mode-tabs,
.crm-subnav,
.performance-subnav,
.ai-subnav,
.segmented {
  border-color: var(--border);
  background: var(--surface-muted);
}

.performance-mode-tabs,
.ai-subnav {
  width: fit-content;
  gap: 3px;
  padding: 4px;
  border-radius: var(--radius-md);
}

.performance-mode-tabs button,
.crm-subnav button,
.performance-subnav button,
.ai-subnav button,
.segmented button {
  min-height: 32px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 700;
}

.performance-mode-tabs button,
.ai-subnav button {
  color: #455664;
}

.performance-mode-tabs button.selected,
.crm-subnav button.selected,
.performance-subnav button.selected,
.ai-subnav button.selected,
.segmented .selected {
  color: var(--primary);
  border-color: #b9ded4;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.crm-subnav,
.performance-subnav {
  gap: 6px;
  padding: 6px;
}

.manual-spend-panel,
.auth-user-form,
.crm-smart-fill,
.sync-strip,
.webhook-strip,
.chat-filter-bar,
.ai-filter-grid {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-muted);
}

.chat-filter-bar,
.ai-filter-grid {
  gap: 10px;
  margin-bottom: 0;
  padding: 12px;
}

.chat-filter-summary {
  margin: -4px 0 0;
  color: var(--text-secondary);
}

.inline-filter,
.chat-filter-bar span,
.ai-filter-grid span,
.crm-form-grid label,
.crm-smart-fill label,
.manual-spend-panel .inline-filter,
.auth-user-form label span {
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 700;
}

.inline-filter select,
.inline-filter input,
.chat-filter-bar select,
.ai-filter-grid select,
.crm-form-grid input,
.crm-form-grid select,
.crm-form-grid textarea,
.crm-smart-fill textarea,
.crm-followup-grid select,
.crm-followup-grid input,
.crm-followup-note textarea,
.auth-user-form input,
.auth-user-form select,
.alias-form input {
  border-color: var(--border-strong);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.report-summary {
  gap: 10px;
}

.report-summary div,
.chat-metrics div,
.detail-metrics div,
.performance-project-summary div,
.system-item,
.definition-item,
.ai-columns section,
.ai-action-grid section,
.ai-customer-findings article,
.ai-owner-card,
.ai-owner-grid section,
.ai-owner-findings,
.ai-history-item,
.ai-playbook-item,
.alias-item {
  border-color: var(--border);
  border-radius: var(--radius-md);
  background: #fbfcfd;
}

.report-summary div,
.chat-metrics div,
.performance-project-summary div {
  min-height: 64px;
  padding: 11px 12px;
}

.report-summary strong,
.chat-metrics strong,
.performance-project-summary strong {
  font-size: 19px;
  line-height: 1.15;
}

.report-table,
.account-table,
.campaign-table,
.auth-user-table,
.member-table {
  gap: 3px;
}

.table-head,
.campaign-row-head,
.report-row-head,
.segment-row-head,
.performance-row-head,
.performance-period-row-head,
.performance-roi-row-head,
.performance-roi-person-head,
.auth-user-row-head,
.member-row-head,
.crm-order-row-head {
  color: #667482;
  background: var(--surface-muted);
  font-weight: 800;
}

.table-row,
.campaign-row,
.report-row,
.segment-row,
.performance-row,
.performance-period-row,
.performance-roi-row,
.performance-roi-person-row,
.auth-user-row,
.member-row,
.crm-order-row {
  border-radius: var(--radius-sm);
}

.table-row:not(.table-head):hover,
.campaign-row:not(.campaign-row-head):hover,
.report-row:not(.report-row-head):hover,
.segment-row:not(.segment-row-head):hover,
.performance-row:not(.performance-row-head):hover,
.performance-period-row:not(.performance-period-row-head):hover,
.performance-roi-row:not(.performance-roi-row-head):hover,
.performance-roi-person-row:not(.performance-roi-person-head):hover,
.auth-user-row:not(.auth-user-row-head):hover,
.member-row:not(.member-row-head):hover,
.crm-order-row:not(.crm-order-row-head):hover {
  background: var(--surface-muted);
}

.connection-banner,
.sync-strip,
.webhook-strip {
  margin-bottom: 0;
}

.connection-banner span {
  color: var(--text-secondary);
}

.connection-banner.connected,
.webhook-strip.active,
.performance-sync-strip.active,
.system-item.success {
  border-color: #bddfd2;
  background: var(--success-soft);
}

.connection-banner.connected strong,
.webhook-strip.active,
.system-item.success strong {
  color: var(--success);
}

.connection-banner.loading,
.performance-sync-strip.loading,
.system-item.warning {
  border-color: #ead49c;
  background: var(--warning-soft);
}

.connection-banner.disconnected,
.ai-warning,
.system-item.danger {
  border-color: #efc4bf;
  background: var(--danger-soft);
}

.ai-score,
.next-action {
  background: var(--primary-soft);
}

.ai-score strong,
.roi,
.effect,
.crm-value,
.next-action {
  color: var(--primary);
}

.status,
.stage,
.today-tag,
.unread,
.followup-priority,
.attribution-badge {
  border-radius: 999px;
  font-weight: 700;
}

.side-panel {
  align-self: start;
}

.alert-item {
  border: 1px solid transparent;
}

.alert-item.danger {
  border-color: #efc4bf;
  background: var(--danger-soft);
}

.alert-item.warning {
  border-color: #ead49c;
  background: var(--warning-soft);
}

.alert-item.success {
  border-color: #bddfd2;
  background: var(--success-soft);
}

.money-breakdown span {
  color: inherit !important;
  font-size: inherit;
  font-weight: inherit;
}

@media (max-width: 1180px) {
  .stats-grid,
  .overview-split-summary,
  .chat-board,
  .chat-metrics,
  .report-summary,
  .ai-filter-grid,
  .ai-columns,
  .ai-template-list,
  .ai-customer-findings > div,
  .ai-playbook-list,
  .ai-owner-grid,
  .performance-project-summary,
  .performance-health-grid,
  .system-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .crm-layout {
    grid-template-columns: 1fr;
  }

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

  .form-wide {
    grid-column: span 2;
  }

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

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

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 2;
    height: auto;
    gap: 14px;
    padding: 14px;
  }

  .sidebar nav {
    grid-template-columns: repeat(5, minmax(42px, 1fr));
    overflow-x: auto;
  }

  .sidebar button {
    justify-content: center;
    min-width: 42px;
    padding: 0;
    font-size: 0;
  }

  .workspace {
    padding: 18px;
  }

  .topbar {
    margin: -18px -18px 0;
    padding: 16px 18px 12px;
  }

  .topbar,
  .top-actions,
  .panel-head,
  .panel-actions,
  .report-head,
  .ai-owner-head,
  .ai-owner-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .search {
    width: 100%;
  }

  .primary-button,
  .soft-button {
    width: 100%;
  }

  .segmented {
    width: 100%;
  }

  .segmented button {
    flex: 1;
  }

  .ai-subnav {
    width: 100%;
    overflow-x: auto;
  }

  .ai-subnav button {
    flex: 1 0 auto;
  }

  .connection-banner {
    align-items: flex-start;
    flex-direction: column;
  }

  .connection-banner span {
    text-align: left;
  }

  .sync-strip,
  .webhook-strip,
  .sync-meta {
    align-items: flex-start;
    flex-direction: column;
  }

  .sync-meta {
    gap: 4px;
  }

  .stats-grid,
  .overview-split-summary,
  .chat-board,
  .chat-metrics,
  .chat-filter-bar,
  .report-summary,
  .followup-board,
  .crm-profile-grid,
  .crm-followup-grid,
  .ai-filter-grid,
  .ai-columns,
  .ai-template-list,
  .ai-customer-findings > div,
  .ai-playbook-list,
  .ai-owner-grid,
  .performance-project-summary,
  .performance-health-grid,
  .alias-form,
  .system-grid {
    grid-template-columns: 1fr;
  }

  .crm-search input {
    width: 100%;
  }

  .crm-form-grid {
    grid-template-columns: 1fr;
  }

  .crm-smart-fill {
    grid-template-columns: 1fr;
  }

  .form-head,
  .form-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .form-wide {
    grid-column: span 1;
  }

  .form-actions span {
    margin-right: 0;
  }

  .crm-customer-list {
    max-height: 420px;
  }

  .ai-panel > div:first-child,
  .ai-score {
    align-items: flex-start;
    grid-template-columns: 1fr;
    flex-direction: column;
  }

  .account-table,
  .campaign-table {
    overflow-x: auto;
  }

  .table-row {
    min-width: 1040px;
  }

  .campaign-row {
    min-width: 1060px;
  }

  .report-row {
    min-width: 860px;
  }

  .segment-row,
  .channel-row,
  .channel-row-business {
    min-width: 1020px;
  }

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

  .performance-period-row {
    min-width: 950px;
  }

  .crm-order-row {
    min-width: 880px;
  }
}
