:root {
  --bg: #f6f7f4;
  --surface: #ffffff;
  --ink: #20251f;
  --muted: #647064;
  --line: #dfe5dc;
  --line-strong: #c7d3c3;
  --green: #2f6f52;
  --green-2: #e6f2ec;
  --blue: #315d8f;
  --blue-2: #e8eef7;
  --amber: #a86816;
  --amber-2: #fff3dd;
  --red: #a84236;
  --red-2: #fae9e7;
  --shadow: 0 14px 34px rgba(39, 48, 37, 0.08);
  --control-bg: #fbfcfa;
  --control-h: 38px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background:
    linear-gradient(135deg, rgba(47, 111, 82, 0.09), transparent 28rem),
    linear-gradient(315deg, rgba(168, 104, 22, 0.08), transparent 26rem),
    var(--bg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

body,
button,
input,
select,
textarea {
  letter-spacing: 0;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sprite {
  display: none;
}

.app-shell {
  display: grid;
  grid-template-columns: 264px 1fr;
  height: 100vh;
  min-height: 100vh;
}

.side {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  height: 100vh;
  padding: 24px 18px;
  overflow-y: auto;
  color: #eef7f1;
  background: #213b30;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
}

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

.mark {
  display: grid;
  align-items: center;
  justify-items: center;
  width: 42px;
  height: 42px;
  color: #fff;
  background: #397a5d;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
}

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

.brand strong {
  font-size: 18px;
}

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

.nav {
  display: grid;
  gap: 8px;
  margin-top: 34px;
  margin-bottom: 24px;
}

.nav-item,
.ghost,
.primary,
.file-button,
.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  border-radius: 8px;
  border: 1px solid transparent;
  transition: background 0.16s ease, border-color 0.16s ease, transform 0.16s ease;
}

.nav-item {
  width: 100%;
  justify-content: flex-start;
  padding: 10px 12px;
  color: #d9e7de;
  background: transparent;
}

.nav-item:hover,
.nav-item.active {
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
}

.compliance {
  margin-top: auto;
  padding: 14px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
}

.compliance-head {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
  color: #fff;
  font-weight: 700;
}

.compliance p {
  margin: 0;
  color: #c7d8cf;
  font-size: 13px;
  line-height: 1.6;
}

.main {
  display: flex;
  flex-direction: column;
  height: 100vh;
  min-width: 0;
  overflow: hidden;
  padding: 22px;
}

.topbar {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  min-height: 62px;
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(199, 211, 195, 0.7);
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--green);
  font-weight: 800;
  font-size: 12px;
}

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

h1 {
  margin-bottom: 0;
  font-size: 24px;
  line-height: 1.25;
}

h2 {
  margin-bottom: 0;
  font-size: 17px;
}

.top-actions,
.button-row,
.filter-row,
.ai-control-row {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.primary {
  padding: 0 16px;
  color: #fff;
  background: var(--green);
  border-color: var(--green);
  font-weight: 700;
}

.primary:hover {
  background: #255c43;
}

.ghost,
.file-button,
.icon-button {
  padding: 0 14px;
  color: var(--ink);
  background: var(--control-bg);
  border-color: var(--line);
}

.ghost:hover,
.file-button:hover,
.icon-button:hover {
  border-color: #bcc9b8;
  background: #fbfcfa;
}

.icon-button {
  width: 40px;
  padding: 0;
}

.file-button input {
  display: none;
}

.file-drop {
  display: flex;
  min-height: 58px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--green);
  background: var(--green-2);
  border: 1px dashed #a8c7b6;
  border-radius: 8px;
  cursor: pointer;
}

.file-drop input {
  display: none;
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding-right: 4px;
}

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

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

.metric {
  padding: 14px;
}

.metric span,
.metric small {
  display: block;
}

.metric span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.metric strong {
  display: block;
  margin: 6px 0 2px;
  font-size: 26px;
  line-height: 1.1;
}

.metric small {
  color: var(--muted);
  font-size: 12px;
}

.dashboard-grid,
.ai-grid,
.close-grid,
.wechat-grid,
.outreach-grid,
.roi-grid,
.automation-grid,
.import-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 0.9fr);
  gap: 14px;
  margin-bottom: 14px;
}

.lead-layout {
  display: grid;
  grid-template-columns: minmax(330px, 0.82fr) minmax(0, 1.18fr);
  gap: 14px;
}

.panel {
  min-height: 0;
  padding: 14px;
  overflow: hidden;
}

.ai-grid > .panel,
.close-grid > .panel,
.lead-layout > .panel,
.import-grid > .panel,
.outreach-grid > .panel,
.automation-grid > .panel,
.wechat-grid > .panel,
.roi-grid > .panel {
  max-height: calc(100vh - 116px);
  overflow: auto;
}

.panel > .panel-head {
  position: sticky;
  top: -14px;
  z-index: 2;
  margin: -14px -14px 12px;
  padding: 14px 14px 10px;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid rgba(223, 229, 220, 0.8);
}

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

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

.priority-list,
.cadence-list,
.ai-decision-list {
  display: grid;
  gap: 8px;
}

.priority-item,
.cadence-item,
.lead-row {
  display: grid;
  gap: 6px;
  padding: 10px;
  background: #fbfcfa;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.priority-main,
.lead-main {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
}

.priority-main b,
.lead-main b {
  word-break: break-word;
  overflow-wrap: anywhere;
}

.priority-meta,
.lead-meta,
.cadence-item small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.score {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 46px;
  height: 28px;
  padding: 0 8px;
  color: #fff;
  background: var(--green);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 800;
}

.score.b {
  background: var(--blue);
}

.score.c {
  background: var(--amber);
}

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

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 2px 8px;
  color: var(--muted);
  background: #f1f5ef;
  border: 1px solid #e2e8df;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.tag.green {
  color: var(--green);
  background: var(--green-2);
  border-color: #cfe3d7;
}

.tag.blue {
  color: var(--blue);
  background: var(--blue-2);
  border-color: #cedced;
}

.tag.amber {
  color: var(--amber);
  background: var(--amber-2);
  border-color: #efdcb8;
}

.tag.red {
  color: var(--red);
  background: var(--red-2);
  border-color: #e9c8c3;
}

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

.playbook div {
  padding: 10px;
  background: #fbfcfa;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.playbook b {
  display: block;
  margin-bottom: 6px;
}

.playbook p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.pipeline-board {
  display: grid;
  grid-template-columns: repeat(7, minmax(130px, 1fr));
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.stage-column {
  min-height: 154px;
  padding: 9px;
  background: #f8faf7;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.stage-column h3 {
  display: flex;
  justify-content: space-between;
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 13px;
}

.stage-card {
  margin-bottom: 7px;
  padding: 9px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 4px solid var(--green);
  border-radius: 8px;
  font-size: 13px;
}

.stage-card span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.lead-form,
.roi-form,
.template-controls,
.automation-form,
.import-controls,
.wechat-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.automation-form,
.import-controls,
.roi-form {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
}

input,
select,
textarea {
  width: 100%;
  min-height: var(--control-h);
  padding: 8px 10px;
  color: var(--ink);
  background: var(--control-bg);
  border: 1px solid #cfd8cc;
  border-radius: 8px;
  outline: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65);
}

select {
  padding-right: 30px;
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, #657365 50%),
    linear-gradient(135deg, #657365 50%, transparent 50%);
  background-position:
    calc(100% - 17px) 16px,
    calc(100% - 12px) 16px;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}

textarea {
  min-height: 76px;
  resize: vertical;
  line-height: 1.55;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(47, 111, 82, 0.14);
}

input::placeholder,
textarea::placeholder {
  color: #9aa69a;
}

.full {
  grid-column: 1 / -1;
}

.lead-table {
  display: grid;
  gap: 8px;
  max-height: 32vh;
  overflow: auto;
  padding-right: 4px;
}

.lead-row {
  cursor: pointer;
}

.lead-row:hover,
.lead-row.selected {
  border-color: #acc7b7;
  background: #f6fbf8;
}

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

.row-actions button {
  min-height: 30px;
  padding: 0 9px;
  color: var(--green);
  background: var(--green-2);
  border: 1px solid #cfe3d7;
  border-radius: 8px;
  font-weight: 700;
}

.row-actions button:last-child {
  color: var(--red);
  background: var(--red-2);
  border-color: #e9c8c3;
}

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

.panel-head.compact {
  margin-bottom: 10px;
}

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

.detail-tile {
  min-height: 56px;
  padding: 9px;
  background: #fbfcfa;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.detail-tile span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.detail-tile b {
  display: block;
  margin-top: 4px;
  word-break: break-word;
  overflow-wrap: anywhere;
  font-size: 14px;
}

.contact-list {
  display: grid;
  gap: 8px;
  max-height: 23vh;
  overflow: auto;
  margin-bottom: 10px;
  padding-right: 4px;
}

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

.contact-card.primary {
  border-color: #cfe3d7;
  box-shadow: inset 4px 0 0 var(--green);
}

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

.contact-card p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.contact-actions {
  justify-content: flex-start;
  margin-top: 8px;
}

.contact-actions button {
  min-height: 30px;
  padding: 0 10px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-weight: 800;
}

.contact-actions button:last-child {
  color: var(--red);
  background: var(--red-2);
  border-color: #e9c8c3;
}

.contact-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

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

.timeline {
  display: grid;
  gap: 8px;
  max-height: 28vh;
  overflow: auto;
  padding-right: 4px;
}

.timeline-item {
  padding: 10px;
  background: #fbfcfa;
  border: 1px solid var(--line);
  border-left: 4px solid var(--blue);
  border-radius: 8px;
}

.timeline-item.good {
  border-left-color: var(--green);
}

.timeline-item.bad {
  border-left-color: var(--red);
}

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

.timeline-head b {
  word-break: break-word;
  overflow-wrap: anywhere;
}

.timeline-item p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.ai-decision {
  display: grid;
  gap: 7px;
  padding: 10px;
  background: #fbfcfa;
  border: 1px solid var(--line);
  border-left: 4px solid var(--green);
  border-radius: 8px;
  cursor: pointer;
}

.ai-decision.medium {
  border-left-color: var(--amber);
}

.ai-decision.low {
  border-left-color: var(--blue);
}

.ai-decision.selected {
  background: #f6fbf8;
  border-color: #acc7b7;
}

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

.ai-decision-head b {
  word-break: break-word;
  overflow-wrap: anywhere;
}

.ai-decision p,
.ai-detail p,
.close-plan-card p,
.close-detail p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.ai-detail,
.close-detail,
.close-plan-list {
  display: grid;
  gap: 10px;
}

.ai-detail-block,
.close-block {
  padding: 10px;
  background: #fbfcfa;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.ai-detail-block h3,
.close-block h3 {
  margin: 0 0 8px;
  font-size: 15px;
}

.ai-message {
  white-space: pre-wrap;
  color: var(--ink);
}

.close-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: flex-end;
  margin-bottom: 12px;
}

.close-controls label {
  flex: 1 1 260px;
  min-width: 220px;
}

.close-controls button {
  flex: 0 0 auto;
}

.close-plan-card {
  display: grid;
  gap: 7px;
  padding: 10px;
  background: #fbfcfa;
  border: 1px solid var(--line);
  border-left: 4px solid var(--green);
  border-radius: 8px;
  cursor: pointer;
}

.close-plan-card.hot {
  border-left-color: var(--red);
}

.close-plan-card.warm {
  border-left-color: var(--amber);
}

.close-plan-card.selected {
  background: #f6fbf8;
  border-color: #acc7b7;
}

.close-plan-head,
.close-metric-row {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}

.close-plan-head b {
  word-break: break-word;
  overflow-wrap: anywhere;
}

.close-metric-row {
  flex-wrap: wrap;
  justify-content: flex-start;
}

.close-metric {
  min-width: 120px;
  padding: 9px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

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

.close-metric b {
  display: block;
  margin-top: 4px;
  font-size: 17px;
}

.close-list {
  display: grid;
  gap: 7px;
  margin: 7px 0 0;
  padding: 0;
  list-style: none;
}

.close-list li {
  padding: 8px 10px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.wechat-layout {
  display: grid;
  grid-template-columns: minmax(220px, 0.78fr) minmax(0, 1.22fr);
  gap: 10px;
}

.wechat-inbox,
.wechat-detail {
  display: grid;
  gap: 8px;
  max-height: 62vh;
  overflow: auto;
  padding-right: 4px;
}

.wechat-message {
  padding: 10px;
  background: #fbfcfa;
  border: 1px solid var(--line);
  border-left: 4px solid var(--blue);
  border-radius: 8px;
  cursor: pointer;
}

.wechat-message.outbound {
  border-left-color: var(--green);
}

.wechat-message.selected {
  background: #f6fbf8;
  border-color: #acc7b7;
}

.wechat-message-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 6px;
}

.wechat-message-head b {
  word-break: break-word;
  overflow-wrap: anywhere;
}

.wechat-message p,
.wechat-detail p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.wechat-reply-box {
  min-height: 140px;
}

.notice {
  min-height: 38px;
  margin: 10px 0;
  padding: 10px;
  color: var(--amber);
  background: var(--amber-2);
  border: 1px solid #efdcb8;
  border-radius: 8px;
  line-height: 1.6;
}

.notice.ok {
  color: var(--green);
  background: var(--green-2);
  border-color: #cfe3d7;
}

.template-output {
  min-height: 180px;
  color: #243028;
  background: #fbfcfa;
}

.button-row {
  margin-top: 10px;
}

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

.provider-box {
  display: grid;
  gap: 8px;
  padding: 10px;
  background: #fbfcfa;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.provider-box h3 {
  margin: 0;
  font-size: 15px;
}

.check-line {
  display: flex;
  min-height: var(--control-h);
  align-items: center;
  gap: 8px;
  color: var(--ink);
}

.check-line input {
  width: 18px;
  min-height: 18px;
}

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

.summary-tile {
  padding: 10px;
  background: #fbfcfa;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.summary-tile span,
.log-item small {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.summary-tile b {
  display: block;
  margin-top: 6px;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.send-log {
  display: grid;
  gap: 8px;
  max-height: 62vh;
  overflow: auto;
  padding-right: 4px;
}

.log-item {
  padding: 10px;
  background: #fbfcfa;
  border: 1px solid var(--line);
  border-left: 4px solid var(--green);
  border-radius: 8px;
}

.log-item.failed {
  border-left-color: var(--red);
}

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

.log-head b {
  word-break: break-word;
  overflow-wrap: anywhere;
}

.log-item p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.enterprise-preview,
.import-history {
  display: grid;
  gap: 8px;
  max-height: 42vh;
  overflow: auto;
  padding-right: 4px;
}

.import-history {
  max-height: 19vh;
}

.import-history-head {
  margin-top: 12px;
}

.enterprise-row,
.import-row {
  padding: 10px;
  background: #fbfcfa;
  border: 1px solid var(--line);
  border-left: 4px solid var(--green);
  border-radius: 8px;
}

.import-row {
  border-left-color: var(--blue);
}

.enterprise-row.duplicate {
  border-left-color: var(--amber);
}

.enterprise-row.missing-contact {
  border-left-color: var(--blue);
}

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

.enterprise-head b {
  word-break: break-word;
  overflow-wrap: anywhere;
}

.enterprise-row dl {
  display: grid;
  grid-template-columns: 86px 1fr;
  gap: 5px 9px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.enterprise-row dt {
  color: #465247;
  font-weight: 800;
}

.enterprise-row dd {
  min-width: 0;
  margin: 0;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.cadence-item {
  grid-template-columns: 74px minmax(0, 1fr);
  align-items: start;
}

.cadence-date {
  color: var(--green);
  font-weight: 800;
}

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

.roi-tile {
  padding: 12px;
  background: #fbfcfa;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.roi-tile span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.roi-tile b {
  display: block;
  margin-top: 6px;
  font-size: 22px;
}

.empty {
  padding: 16px;
  color: var(--muted);
  text-align: center;
  background: #fbfcfa;
  border: 1px dashed #cfd8cc;
  border-radius: 8px;
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 10;
  width: calc(100vw - 48px);
  max-width: 360px;
  padding: 12px 14px;
  color: #fff;
  background: #22332b;
  border-radius: 8px;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

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

@media (max-width: 980px) {
  .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-grid,
  .ai-grid,
  .close-grid,
  .wechat-grid,
  .outreach-grid,
  .roi-grid,
  .automation-grid,
  .import-grid,
  .lead-layout {
    grid-template-columns: 1fr;
  }

  .close-controls > * {
    flex: 1 1 100%;
  }
}

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

  .side {
    position: static;
    height: auto;
    max-height: 210px;
    padding: 12px;
    overflow-y: auto;
  }

  .nav {
    display: flex;
    gap: 8px;
    margin: 12px 0 0;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .nav-item {
    flex: 0 0 auto;
    width: auto;
    min-height: 36px;
    padding: 8px 10px;
    white-space: nowrap;
  }

  .compliance {
    display: none;
  }

  .main {
    height: calc(100vh - 142px);
    overflow: hidden;
    padding: 16px;
  }

  .topbar {
    display: grid;
  }

  h1 {
    font-size: 21px;
  }

  .metric-grid,
  .playbook,
  .lead-form,
  .roi-form,
  .template-controls,
  .close-controls,
  .automation-form,
  .import-controls,
  .wechat-form,
  .wechat-layout,
  .contact-form,
  .activity-form,
  .detail-grid,
  .provider-grid,
  .automation-summary,
  .roi-result {
    grid-template-columns: 1fr;
  }

  .top-actions,
  .button-row,
  .filter-row,
  .ai-control-row {
    width: 100%;
  }

  .top-actions > *,
  .filter-row > * {
    flex: 1 1 160px;
  }
}
