﻿:root {
  --bg: #f5fbf8;
  --panel: #ffffff;
  --ink: #182230;
  --muted: #667085;
  --line: #dce7e2;
  --green: #12a67a;
  --green-dark: #08785a;
  --green-soft: #e8f8f2;
  --purple: #7657f2;
  --purple-dark: #5740c4;
  --purple-soft: #f0edff;
  --amber: #b86b00;
  --amber-soft: #fff5dd;
  --red: #c0392b;
  --red-soft: #fff0ef;
  --shadow: 0 16px 40px rgba(30, 61, 49, 0.08);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at 30% -10%, rgba(18, 166, 122, 0.12), transparent 34%),
    radial-gradient(circle at 95% 0%, rgba(118, 87, 242, 0.12), transparent 32%),
    var(--bg);
  color: var(--ink);
  font-family: Arial, "Microsoft YaHei", sans-serif;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.hidden {
  display: none !important;
}

.login-screen {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: none;
  place-items: center;
  padding: 20px;
  background:
    linear-gradient(135deg, rgba(18, 166, 122, 0.92), rgba(118, 87, 242, 0.92)),
    #152033;
}

.login-screen.active {
  display: grid;
}

.login-card {
  width: min(460px, 100%);
  padding: 24px;
  background: #fff;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.login-form,
.two-factor {
  display: grid;
  gap: 16px;
}

.setup-box {
  display: grid;
  gap: 12px;
  padding: 14px;
  background: var(--purple-soft);
  border: 1px solid #d9d2ff;
  border-radius: var(--radius);
}

.setup-box p {
  margin: 0;
  color: var(--purple-dark);
  line-height: 1.6;
}

.two-factor-steps {
  display: grid;
  gap: 6px;
  color: var(--purple-dark);
  line-height: 1.55;
}

.two-factor-steps span {
  color: #5d528f;
  font-size: 13px;
}

.copy-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.login-brand {
  color: var(--ink);
  margin-bottom: 4px;
}

.login-brand > span {
  background: linear-gradient(135deg, var(--green), var(--purple));
  color: #fff;
}

.error {
  margin: 0;
  color: var(--red);
  min-height: 20px;
}

.shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 280px 1fr;
}

.sidebar {
  background: linear-gradient(180deg, #0a2f27, #1b1857);
  color: #fff;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
}

.brand > span {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: #fff;
  color: var(--green-dark);
  font-weight: 800;
}

.brand strong,
.brand small {
  display: block;
}

.brand small {
  color: #c6d8d3;
  margin-top: 4px;
}

.nav {
  display: grid;
  gap: 8px;
}

.nav button {
  border: 0;
  border-radius: var(--radius);
  padding: 12px 14px;
  text-align: left;
  color: #d9eee7;
  background: transparent;
}

.nav button.active,
.nav button:hover {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
}

.sidebar-messages {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.08);
}

.sidebar-section-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #fff;
}

.message-title-actions {
  display: flex;
  align-items: center;
}

.message-title-actions button {
  min-height: 34px;
  padding: 4px 5px 4px 6px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  box-shadow: 0 8px 18px rgba(5, 35, 29, 0.18);
  transition: transform 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.message-title-actions button:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.22);
  box-shadow: 0 10px 22px rgba(5, 35, 29, 0.24);
}

.message-title-actions #messageCount {
  min-width: 25px;
  height: 25px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: var(--purple-dark);
  background: #fff;
  font-weight: 700;
  font-size: 12px;
}

.read-all-label {
  padding-right: 5px;
  white-space: nowrap;
}

.sidebar-message-list {
  display: grid;
  gap: 8px;
  max-height: 360px;
  overflow: auto;
}

.sidebar-message {
  display: grid;
  gap: 7px;
  padding: 10px;
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  border-left: 4px solid var(--purple);
}

.sidebar-message.green {
  border-left-color: var(--green);
}

.sidebar-message.amber {
  border-left-color: var(--amber);
}

.sidebar-message.red {
  border-left-color: var(--red);
}

.message-title {
  font-weight: 700;
  font-size: 13px;
}

.sidebar-message p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.message-actions {
  display: flex;
  gap: 6px;
}

.message-actions button {
  padding: 6px 8px;
  font-size: 12px;
}

.sidebar-empty {
  margin: 0;
  color: #e4fbf3;
  font-size: 13px;
}

.config {
  margin-top: auto;
  color: #e4fbf3;
  font-size: 13px;
  line-height: 1.7;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.08);
}

.main {
  min-width: 0;
  padding: 26px 28px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.user-box {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
}

#currentUser {
  color: var(--muted);
  font-size: 14px;
}

.topbar h1 {
  margin: 0 0 6px;
  font-size: 30px;
  letter-spacing: 0;
}

.topbar p {
  margin: 0;
  color: var(--muted);
}

.topbar p:empty {
  display: none;
}

.primary,
.secondary,
.ghost,
.icon-button {
  border-radius: var(--radius);
  border: 1px solid transparent;
  padding: 10px 14px;
  text-decoration: none;
}

.primary {
  background: linear-gradient(135deg, var(--green), var(--purple));
  color: white;
}

.primary:hover {
  filter: brightness(0.95);
}

.primary:disabled {
  opacity: 0.6;
  cursor: wait;
}

.secondary,
.ghost,
.icon-button {
  background: #fff;
  color: var(--ink);
  border-color: var(--line);
}

.secondary:hover {
  border-color: var(--purple);
  color: var(--purple-dark);
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.view.active.dashboard-workflow {
  display: grid;
  gap: 16px;
}

.workspace-intro {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
  padding: 20px;
  border: 1px solid rgba(18, 166, 122, 0.15);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 14px 36px rgba(30, 61, 49, 0.06);
}

.workspace-intro h2 {
  margin: 5px 0 6px;
  font-size: 24px;
  line-height: 1.25;
}

.workspace-intro p {
  margin: 0;
  color: var(--muted);
}

.workspace-eyebrow,
.section-kicker {
  color: var(--green-dark);
  font-size: 12px;
  font-weight: 800;
}

.stats-grid,
.score-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(130px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.score-grid {
  grid-template-columns: repeat(5, minmax(90px, 1fr));
}

.stat,
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.stat {
  padding: 15px 16px;
  box-shadow: 0 8px 24px rgba(18, 166, 122, 0.06);
}

.dashboard-stats {
  grid-template-columns: repeat(4, minmax(150px, 1fr));
}

.dashboard-stats .stat {
  min-height: 92px;
  border-color: rgba(18, 166, 122, 0.16);
}

.dashboard-stats .stat:first-child {
  border-color: rgba(118, 87, 242, 0.42);
  background: linear-gradient(135deg, rgba(240, 237, 255, 0.96), #fff);
}

.stat span,
.stat small {
  color: var(--muted);
  font-size: 13px;
}

.stat strong {
  display: block;
  font-size: 25px;
  margin-top: 8px;
}

.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.dashboard-focus-grid {
  display: grid;
  grid-template-columns: minmax(360px, 1.2fr) minmax(320px, 0.8fr);
  gap: 16px;
  margin-bottom: 16px;
}

.dashboard-lower-grid {
  display: grid;
  grid-template-columns: minmax(320px, 1fr) minmax(280px, 0.75fr);
  gap: 16px;
}

.panel {
  padding: 18px;
  box-shadow: 0 8px 22px rgba(30, 61, 49, 0.04);
}

.panel-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.panel-title.compact {
  margin-bottom: 0;
}

.panel-title h2 {
  margin: 0;
  font-size: 18px;
}

.panel-title p {
  margin: 4px 0 0;
  color: #456052;
  font-size: 14px;
}

.panel-title > div {
  display: grid;
  gap: 3px;
}

.panel-title span {
  color: var(--muted);
  font-size: 13px;
}

.list,
.follow-list,
.timeline {
  display: grid;
  gap: 10px;
}

.reminder-panel {
  margin-bottom: 0;
}

.reminder-panel .assignment-alert {
  margin: 14px 0 0;
}

.assignment-alert {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  padding: 14px 16px;
  color: var(--purple-dark);
  background: var(--purple-soft);
  border: 1px solid #d9d2ff;
  border-radius: var(--radius);
}

.assignment-alert strong {
  font-size: 18px;
}

.assignment-alert span {
  flex: 1;
  line-height: 1.5;
}

.assignment-alert-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.reminder-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.reminder-card {
  display: grid;
  gap: 6px;
  min-height: 98px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  text-align: left;
}

.reminder-card strong {
  font-size: 28px;
}

.reminder-card small {
  color: var(--muted);
  line-height: 1.4;
}

.reminder-card.green {
  background: var(--green-soft);
  border-color: #bcebdc;
}

.reminder-card.purple {
  background: var(--purple-soft);
  border-color: #d9d2ff;
}

.reminder-card.amber {
  background: var(--amber-soft);
  border-color: #ffe0a8;
}

.reminder-card.red {
  background: var(--red-soft);
  border-color: #ffd0cb;
}

.customer-card,
.table-row,
.summary-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  padding: 12px;
}

.customer-card,
.summary-card {
  display: grid;
  gap: 8px;
}

.weekly-panel .list {
  max-height: 510px;
  overflow: auto;
  padding-right: 2px;
}

.task-list-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.task-list-grid .panel {
  margin: 0;
}

.overdue-panel {
  border-color: #f1c7c2;
}

.pipeline-panel {
  margin-bottom: 0;
}

.pipeline-board {
  display: grid;
  gap: 14px;
  padding: 2px 2px 8px;
}

.pipeline-flow {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.pipeline-outcomes {
  padding: 10px;
  border: 1px solid #d8dee9;
  border-radius: var(--radius);
  background: #fbfcff;
  scroll-snap-align: start;
}

.pipeline-outcome-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
  padding: 0 2px;
}

.pipeline-outcome-head strong {
  font-size: 15px;
}

.pipeline-outcome-head span {
  color: var(--muted);
  font-size: 12px;
}

.pipeline-outcome-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(235px, 1fr));
  gap: 12px;
}

.pipeline-column {
  height: 470px;
  min-height: 300px;
  max-height: 760px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f8fcfa;
  display: flex;
  flex-direction: column;
  min-width: 0;
  resize: vertical;
  overflow: hidden;
}

.outcome-column {
  background: #fff;
}

.outcome-column[data-pipeline-status="won"] {
  border-color: #9ddfc8;
}

.outcome-column[data-pipeline-status="lost"] {
  border-color: #f4b7b1;
}

.outcome-column .pipeline-stage-title {
  grid-template-columns: minmax(0, 1fr);
}

.outcome-column .pipeline-stage-title small {
  grid-column: 1;
}

.pipeline-column.drag-over {
  border-color: var(--purple);
  background: var(--purple-soft);
}

.pipeline-column-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.pipeline-stage-title {
  min-width: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  column-gap: 8px;
  row-gap: 2px;
  align-items: center;
}

.pipeline-stage-title b {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--green-dark);
  color: #fff;
  font-size: 16px;
  box-shadow: 0 3px 8px rgba(28, 111, 83, 0.18);
}

.pipeline-stage-title strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 15px;
}

.pipeline-stage-title small {
  grid-column: 2;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.pipeline-column-head span {
  min-width: 26px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.pipeline-dropzone {
  flex: 1;
  display: grid;
  align-content: start;
  gap: 6px;
  min-height: 0;
  overflow-y: auto;
  padding-right: 2px;
}

.pipeline-card {
  display: grid;
  gap: 4px;
  padding: 7px 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: 0 4px 12px rgba(30, 61, 49, 0.04);
}

.pipeline-card.dragging {
  opacity: 0.55;
}

.pipeline-card-top {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.pipeline-card-top strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
}

.pipeline-card > .meta {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
}

.pipeline-task {
  padding: 6px 7px;
  border-radius: var(--radius);
  background: #f7faf9;
  color: #344054;
  font-size: 12px;
  line-height: 1.35;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}

.pipeline-task.overdue {
  color: var(--red);
  background: var(--red-soft);
}

.pipeline-empty {
  margin: 0;
  padding: 18px 10px;
  color: var(--muted);
  text-align: center;
  font-size: 13px;
}

.pipeline-pager {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
}

.pipeline-pager button {
  min-height: 30px;
  padding: 6px 8px;
  font-size: 12px;
}

.pipeline-pager button:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

.pipeline-pager small {
  min-width: 40px;
  color: var(--muted);
  text-align: center;
  font-size: 12px;
  font-weight: 800;
}

.mobile-sidebar-tools {
  display: none;
}

.mobile-tools-toggle,
.mobile-tools-content {
  display: none;
}

.customer-pager {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  min-height: 42px;
  margin-top: 14px;
  color: var(--muted);
  font-size: 13px;
}

.customer-pager button {
  min-width: 76px;
}

@media (max-width: 680px) {
  .customer-pager {
    justify-content: space-between;
    gap: 8px;
  }

  .customer-pager span {
    text-align: center;
    font-size: 12px;
  }
}

.task-action-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(15, 23, 42, 0.48);
}

.task-action-modal {
  position: relative;
  width: min(760px, 100%);
  max-height: min(760px, calc(100vh - 40px));
  overflow: auto;
  display: grid;
  gap: 14px;
  padding: 22px;
  border-radius: var(--radius);
  background: #fff;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.22);
}

.task-action-close {
  position: absolute;
  top: 14px;
  right: 14px;
}

.task-action-head {
  display: grid;
  gap: 6px;
  padding-right: 42px;
}

.task-action-head span {
  color: var(--green-dark);
  font-size: 12px;
  font-weight: 800;
}

.task-action-head h2 {
  margin: 0;
  font-size: 24px;
}

.task-action-head p {
  margin: 0;
  color: var(--muted);
}

.task-action-section {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfdfc;
}

.task-action-section.red {
  border-color: #ffd0cb;
  background: var(--red-soft);
}

.task-action-section.amber {
  border-color: #ffe0a8;
  background: var(--amber-soft);
}

.task-action-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.task-action-list {
  display: grid;
  gap: 8px;
}

.task-action-item {
  display: grid;
  gap: 4px;
  width: 100%;
  padding: 10px;
  border: 1px solid rgba(30, 61, 49, 0.1);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.78);
  text-align: left;
}

.task-action-item span {
  font-weight: 800;
}

.task-action-item small {
  color: var(--muted);
  line-height: 1.45;
}

.daily-rhythm {
  display: grid;
  gap: 10px;
}

.daily-rhythm span {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfdfc;
  color: #344054;
}

.daily-rhythm b {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--green-soft);
  color: var(--green-dark);
}

.table-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: start;
}

.pending-row {
  border-color: #d9d2ff;
  background: #fbfaff;
}

.card-head,
.row-main,
.detail-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.customer-name {
  font-weight: 700;
}

.customer-list-lines,
.customer-card-lines {
  display: grid;
  gap: 4px;
}

.customer-primary {
  font-size: 17px;
  line-height: 1.3;
  color: var(--ink);
}

.meta {
  color: var(--muted);
  font-size: 13px;
}

.follow-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0;
}

.follow-summary span {
  color: #354052;
  font-size: 13px;
  background: #f8fbfa;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 9px;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag {
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 12px;
  background: #eef5f2;
  color: #375d51;
}

.tag.green {
  background: var(--green-soft);
  color: var(--green-dark);
}

.tag.purple {
  background: var(--purple-soft);
  color: var(--purple-dark);
}

.tag.amber {
  background: var(--amber-soft);
  color: var(--amber);
}

.tag.red {
  background: var(--red-soft);
  color: var(--red);
}

.toolbar,
.inline-form {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
}

.toolbar {
  grid-template-columns: minmax(180px, 1.4fr) 120px 120px 120px 120px 120px 120px 150px auto;
}

.import-form {
  grid-template-columns: 1fr 180px 180px auto;
}

.assign-form {
  grid-template-columns: 190px 160px 170px 1fr auto;
}

.toolbar input,
.toolbar select,
.inline-form input,
.inline-form select,
.form-grid input,
.form-grid select,
.form-grid textarea,
.follow-form input,
.follow-form select,
.follow-form textarea,
.two-factor input,
.login-form input,
.setup-box input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px 11px;
  background: #fff;
}

.import-panel,
.assign-panel,
.admin-panel,
.public-pool-panel {
  margin-bottom: 14px;
}

.inline-form {
  align-items: center;
}

.sales-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.sales-checks label {
  display: flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 10px;
  background: #fff;
}

.sales-checks span {
  color: var(--muted);
  font-size: 12px;
}

.sales-checks input {
  width: auto;
}

.admin-actions,
.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 12px;
}

.admin-output {
  max-height: 260px;
  overflow: auto;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f8fafc;
  white-space: pre-wrap;
  font-family: Consolas, monospace;
  font-size: 13px;
}

.customer-table {
  display: grid;
  gap: 10px;
}

.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
}

.lead-form {
  max-width: 1180px;
}

#newLeadView {
  padding-bottom: 32px;
}

.lead-form-header {
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}

.lead-form-header h2 {
  margin: 4px 0 6px;
  color: #1f2329;
  font-size: 24px;
  line-height: 1.3;
}

.lead-form-header p {
  margin: 0;
  color: #646a73;
  line-height: 1.6;
}

.lead-form-sections {
  display: grid;
  gap: 0;
}

.lead-form-section {
  min-width: 0;
  margin: 0;
  padding: 24px 0;
  border: 0;
  border-bottom: 1px solid var(--line);
}

.lead-form-section legend {
  display: flex;
  align-items: baseline;
  gap: 12px;
  width: 100%;
  margin: 0 0 16px;
  padding: 0;
}

.lead-form-section legend span {
  color: #1f2329;
  font-size: 17px;
  font-weight: 700;
}

.lead-form-section legend small,
.lead-form-section label > small {
  color: #646a73;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.45;
}

.lead-section-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px 14px;
}

.lead-section-grid-five {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.lead-field-wide {
  grid-column: 1 / -1;
}

.lead-project-background textarea,
.lead-field-wide textarea {
  min-height: 132px;
  line-height: 1.65;
}

.lead-notes-section {
  border-bottom: 0;
}

.lead-notes-section textarea {
  min-height: 88px;
}

.lead-form input[readonly] {
  color: #646a73;
  background: #f5f6f7;
  cursor: default;
}

.lead-form input:focus-visible,
.lead-form select:focus-visible,
.lead-form textarea:focus-visible {
  border-color: #3370ff;
  outline: 3px solid rgba(51, 112, 255, 0.16);
  outline-offset: 1px;
}

.lead-form-actions {
  justify-content: flex-end;
  margin-top: 24px;
}

@media (max-width: 1050px) {
  .lead-section-grid-five {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .lead-form-section legend {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  .lead-section-grid,
  .lead-section-grid-five {
    grid-template-columns: 1fr;
  }

  .lead-field-wide {
    grid-column: auto;
  }

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

  .lead-form-actions button {
    min-height: 44px;
    width: 100%;
  }
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

label {
  display: grid;
  gap: 6px;
  color: #344054;
  font-size: 14px;
}

.wide {
  grid-column: 1 / -1;
}

textarea {
  min-height: 92px;
  resize: vertical;
}

.form-actions {
  margin-top: 16px;
  display: flex;
  gap: 10px;
}

.drawer {
  position: fixed;
  inset: 0;
  background: rgba(24, 34, 48, 0.5);
  display: none;
  justify-content: flex-end;
  z-index: 20;
}

.drawer.open {
  display: flex;
}

.drawer-panel {
  width: min(1120px, 100%);
  height: 100%;
  background: var(--bg);
  padding: 22px;
  overflow: auto;
  position: relative;
}

.customer-detail-loading {
  min-height: 58vh;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  color: var(--ink);
}

.customer-detail-loading strong {
  display: block;
  font-size: 20px;
}

.customer-detail-loading p {
  margin: 6px 0 0;
  color: var(--muted);
}

.customer-detail-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid rgba(19, 124, 101, 0.18);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: customer-detail-spin 0.75s linear infinite;
}

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

.customer-detail-load-error {
  margin: 80px auto;
  max-width: 620px;
}

.icon-button {
  position: sticky;
  top: 0;
  float: right;
  font-size: 22px;
  width: 40px;
  height: 40px;
  padding: 0;
  z-index: 2;
}

.detail-title {
  margin: 8px 52px 4px 0;
  font-size: 26px;
}

.detail-layout {
  display: grid;
  grid-template-columns: minmax(320px, 0.95fr) minmax(360px, 1.25fr);
  gap: 16px;
  align-items: start;
}

.detail-left,
.detail-right {
  display: grid;
  gap: 14px;
}

.follow-entry-panel {
  border-color: #c9eee1;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.detail-item {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px;
  background: #fff;
  line-height: 1.45;
}

.detail-item span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 4px;
}

.detail-item strong {
  color: var(--ink);
  font-size: 14px;
}

.detail-inline-link {
  color: var(--purple-dark);
  font-weight: 700;
  text-decoration: none;
  word-break: break-word;
}

.detail-inline-link:hover {
  text-decoration: underline;
}

.detail-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.detail-link-chip {
  min-width: 180px;
  flex: 1 1 220px;
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfdfc;
  color: inherit;
  text-decoration: none;
}

.detail-link-chip span {
  color: var(--muted);
  font-size: 12px;
}

.detail-link-chip strong {
  color: var(--purple-dark);
  word-break: break-word;
}

.detail-link-chip:hover {
  border-color: rgba(111, 72, 255, 0.35);
  box-shadow: 0 8px 20px rgba(29, 57, 53, 0.06);
}

.detail-text-block {
  margin: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfdfc;
  line-height: 1.7;
  white-space: pre-wrap;
}

.report {
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  line-height: 1.65;
  white-space: pre-wrap;
  max-height: 460px;
  overflow: auto;
}

.stat-button {
  width: 100%;
  text-align: left;
  border: 1px solid var(--line);
  cursor: pointer;
  font-family: inherit;
}

.stat-button:hover,
.clickable-row:hover,
.clickable-card:hover {
  border-color: rgba(111, 72, 255, 0.45);
  box-shadow: 0 10px 26px rgba(29, 57, 53, 0.08);
  transform: translateY(-1px);
}

.clickable-row,
.clickable-card {
  cursor: pointer;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.dashboard-detail-list {
  margin-top: 14px;
}

.compact-form {
  gap: 10px;
}

.customer-edit-form textarea,
.follow-form textarea {
  min-height: 86px;
}

.danger {
  display: inline-flex;
  min-height: 41px;
  align-items: center;
  justify-content: center;
  border: 1px solid #f4b4bc;
  background: #fff7f8;
  color: #b4233a;
  border-radius: var(--radius);
  padding: 10px 14px;
  cursor: pointer;
  font-weight: 700;
  text-decoration: none;
}

.danger:hover {
  background: #ffecef;
  border-color: #ea8b99;
}

.follow-form {
  display: grid;
  gap: 10px;
  margin: 0;
}

.timeline-item {
  display: grid;
  gap: 4px;
  padding: 10px;
  border-left: 3px solid var(--purple);
  background: #fff;
  border-radius: var(--radius);
}

.timeline-item span {
  color: var(--muted);
  font-size: 12px;
}

.timeline-item p {
  margin: 0;
  color: var(--muted);
}

.management-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.management-intro {
  margin-top: 0;
}

.management-sales-panel,
.management-tools {
  margin-top: 16px;
}

/* Historical data governance panel */
.summary-compaction-panel {
  margin-top: 16px;
  overflow: hidden;
}

.summary-compaction-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 18px;
}

.summary-compaction-head > div:first-child {
  min-width: 0;
  max-width: 74ch;
}

.summary-compaction-head h2 {
  margin: 4px 0 7px;
  color: var(--ink);
  font-size: clamp(20px, 2vw, 25px);
  line-height: 1.25;
}

.summary-compaction-head p {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.summary-compaction-head-actions {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  gap: 10px;
}

.summary-compaction-stats {
  display: grid;
  grid-template-columns: repeat(7, minmax(112px, 1fr));
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  background: #f7fbf9;
}

.summary-stat {
  display: grid;
  align-content: start;
  gap: 5px;
  min-width: 0;
  min-height: 104px;
  padding: 14px;
  border: 0;
  border-inline-end: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  text-align: start;
  cursor: pointer;
}

.summary-stat:last-child {
  border-inline-end: 0;
}

.summary-stat:hover {
  background: #eef8f4;
}

.summary-stat:focus-visible,
.summary-compaction-table:focus-visible {
  outline: 3px solid rgba(18, 166, 122, .28);
  outline-offset: 2px;
}

.summary-stat span,
.summary-stat small {
  color: var(--muted);
}

.summary-stat strong {
  color: var(--ink);
  font-size: 25px;
  line-height: 1;
}

.summary-stat.running strong {
  color: #5740c4;
}

.summary-stat.failed strong {
  color: var(--red, #c0392b);
}

.summary-stat.completed strong {
  color: var(--green-deep, #08785a);
}

.summary-compaction-toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 2fr) repeat(3, minmax(150px, 1fr));
  gap: 12px;
  margin: 18px 0 12px;
}

.summary-compaction-toolbar label {
  display: grid;
  gap: 6px;
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.summary-compaction-toolbar input,
.summary-compaction-toolbar select {
  min-width: 0;
  width: 100%;
  min-height: 42px;
}

.summary-compaction-feedback {
  min-height: 24px;
  margin-bottom: 9px;
  color: var(--muted);
  font-size: 13px;
}

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

.summary-compaction-feedback strong {
  color: var(--red, #c0392b);
}

.summary-compaction-table {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}

.summary-compaction-table-head,
.summary-compaction-row {
  display: grid;
  grid-template-columns: minmax(230px, 1.55fr) minmax(130px, .7fr) minmax(250px, 1.3fr) minmax(180px, .8fr);
  gap: 16px;
  align-items: center;
  min-width: 860px;
}

.summary-compaction-table-head {
  padding: 11px 16px;
  background: #f4f8f6;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.summary-compaction-row {
  padding: 14px 16px;
  border-top: 1px solid var(--line);
}

.summary-compaction-row:hover {
  background: #fbfefc;
}

.summary-customer,
.summary-task-count,
.summary-compaction-row > div {
  min-width: 0;
}

.summary-customer,
.summary-task-count {
  display: grid;
  gap: 5px;
}

.summary-customer strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.summary-customer > span,
.summary-task-count > span {
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.summary-task-count strong {
  color: var(--ink);
  font-size: 13px;
  line-height: 1.5;
}

.summary-scope-tags,
.summary-row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.summary-scope-tags small {
  padding: 3px 7px;
  border-radius: 999px;
  background: #edf5f1;
  color: #426458;
  font-size: 11px;
}

.summary-state {
  display: inline-flex;
  align-items: center;
  min-height: 27px;
  padding: 4px 9px;
  border-radius: 999px;
  background: #edf2f0;
  color: #42534d;
  font-size: 12px;
  font-weight: 700;
}

.summary-state.pending {
  background: #fff5dd;
  color: #8b5500;
}

.summary-state.running {
  background: #f0edff;
  color: #5740c4;
}

.summary-state.failed {
  background: #fff0ef;
  color: #a62f27;
}

.summary-state.completed {
  background: #e8f8f2;
  color: #08785a;
}

.summary-error {
  display: -webkit-box;
  margin-top: 7px;
  overflow: hidden;
  color: #a62f27;
  font-size: 11px;
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.summary-row-actions {
  align-items: center;
}

.summary-compaction-pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 14px;
}

.summary-compaction-pager span,
.summary-compaction-note {
  color: var(--muted);
  font-size: 12px;
}

.summary-compaction-note {
  margin: 14px 0 0;
  line-height: 1.6;
}

.summary-compaction-loading,
.summary-compaction-empty {
  grid-column: 1 / -1;
  margin: 0;
  padding: 24px;
  color: var(--muted);
  text-align: center;
}

.summary-compaction-empty {
  display: grid;
  gap: 5px;
}

.summary-compaction-empty strong {
  color: var(--ink);
}

.summary-compaction-empty.error strong {
  color: var(--red, #c0392b);
}

@media (max-width: 1180px) {
  .summary-compaction-stats {
    grid-template-columns: repeat(4, minmax(120px, 1fr));
  }

  .summary-stat {
    border-bottom: 1px solid var(--line);
  }

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

@media (max-width: 700px) {
  .summary-compaction-head {
    display: grid;
    gap: 14px;
  }

  .summary-compaction-head-actions,
  .summary-compaction-head-actions button {
    width: 100%;
  }

  .summary-compaction-stats,
  .summary-compaction-toolbar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .summary-stat {
    min-height: 96px;
    padding: 12px;
  }

  .summary-stat strong {
    font-size: 22px;
  }

  .summary-compaction-table {
    overflow: visible;
    border: 0;
    background: transparent;
  }

  .summary-compaction-table-head {
    display: none;
  }

  .summary-compaction-row {
    min-width: 0;
    grid-template-columns: 1fr;
    gap: 12px;
    margin-bottom: 10px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #fff;
  }

  .summary-row-actions button {
    flex: 1 1 140px;
  }

  .summary-compaction-pager {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 6px;
  }

  .summary-compaction-pager span {
    text-align: center;
  }
}

.user-management-panel {
  margin-top: 16px;
}

.user-management-panel button {
  white-space: nowrap;
}

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

.user-management-card {
  display: grid;
  gap: 12px;
  min-width: 0;
  padding: 15px;
  border: 1px solid #d7e5df;
  border-radius: 14px;
  background: #fbfefc;
}

.user-management-card.disabled {
  border-color: #e6d9d9;
  background: #fcf9f9;
}

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

.user-management-main > div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.user-management-main strong {
  color: var(--ink);
  font-size: 16px;
}

.user-management-main span,
.user-management-facts span {
  color: var(--muted);
  font-size: 12px;
}

.user-management-facts {
  flex-wrap: wrap;
  justify-content: flex-start;
}

.user-management-card .action-row {
  margin-top: 0;
}

.user-admin-auth {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 4px 0 0;
  padding: 14px;
  border: 1px solid #d9e1f4;
  border-radius: 12px;
  background: #f7f9ff;
}

.user-admin-auth legend {
  padding: 0 6px;
  color: #40548b;
  font-weight: 800;
}

.user-admin-auth p {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.user-admin-warning {
  margin: 0;
  padding: 11px 12px;
  border: 1px solid #efd7a0;
  border-radius: 10px;
  background: #fff9ec;
  color: #76520d;
  line-height: 1.55;
}

.task-action-modal fieldset {
  min-width: 0;
  margin: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.task-action-modal fieldset legend {
  padding: 0 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.task-action-modal .check-row {
  display: flex;
  grid-template-columns: none;
  align-items: center;
  gap: 8px;
  margin-top: 7px;
}

.task-action-modal .check-row input {
  width: auto;
  margin: 0;
}

.sales-summary-card {
  width: 100%;
  text-align: left;
  font-family: inherit;
  border: 1px solid var(--line);
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.summary-grid span {
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfdfc;
  color: var(--muted);
}

.summary-grid b {
  color: var(--ink);
}

.empty {
  color: var(--muted);
  padding: 18px;
  text-align: center;
}

@media (max-width: 1180px) {
  .toolbar,
  .assign-form,
  .import-form,
  .reminder-grid,
  .management-grid,
  .dashboard-focus-grid,
  .dashboard-lower-grid,
  .task-list-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 960px) {
  .shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
  }

  .split,
  .workspace-intro,
  .dashboard-focus-grid,
  .dashboard-lower-grid,
  .form-grid,
  .toolbar,
  .inline-form,
  .detail-layout,
  .detail-grid,
  .score-grid {
    grid-template-columns: 1fr;
  }

  .task-list-grid {
    grid-template-columns: 1fr;
  }

  .topbar,
  .table-row,
  .row-main,
  .detail-header,
  .assignment-alert,
  .copy-row {
    flex-direction: column;
    display: flex;
  }

  .row-actions {
    justify-content: flex-start;
  }

  .drawer-panel {
    padding: 16px;
  }

  .pipeline-flow {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .workspace-intro {
    align-items: flex-start;
  }
}

@media (max-width: 760px) {
  .pipeline-flow,
  .pipeline-outcome-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 520px) {
  .pipeline-flow,
  .pipeline-outcome-grid {
    grid-template-columns: 1fr;
  }

  .pipeline-column {
    height: auto !important;
    max-height: none;
    resize: none;
  }

  .pipeline-dropzone {
    max-height: 460px;
  }
}
.ai-learning-panel { border-color: #cfe7df; background: linear-gradient(145deg, #ffffff, #f5fcfa); }
.ai-learning-panel .panel-title p { margin: 5px 0 0; color: #64748b; font-size: 13px; font-weight: 400; }
.ai-learning-panel .stats-grid { margin-top: 14px; }

.crm-toast {
  position: fixed;
  right: 22px;
  top: 22px;
  z-index: 1200;
  max-width: min(420px, calc(100vw - 44px));
  padding: 12px 16px;
  border-radius: 10px;
  color: #fff;
  background: #157f68;
  box-shadow: 0 10px 30px rgba(25, 45, 60, .2);
  opacity: 0;
  transform: translateY(-12px);
  pointer-events: none;
  transition: .2s ease;
}

.crm-toast.show {
  opacity: 1;
  transform: translateY(0);
}

.crm-toast.error {
  background: #b42318;
}

.small-button {
  min-height: 30px;
  padding: 5px 10px;
  font-size: 12px;
}

.followup-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.followup-record {
  border-left: 3px solid #8bc7ba;
}

.deleted-followup {
  opacity: .72;
  border-left-color: #b42318;
  background: #fff7f6;
}

.followup-old {
  margin-top: 8px;
  padding: 8px 10px;
  border-radius: 8px;
  background: #f5f7f8;
  color: #78828a;
  text-decoration: line-through;
}

.followup-content,
.static-note {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.static-note {
  padding: 12px;
  border: 1px solid #dce8e4;
  border-radius: 10px;
  background: #f8fbfa;
}

.history-list,
.management-review-grid {
  display: grid;
  gap: 12px;
}

.history-card {
  padding: 12px;
  border: 1px solid #dce8e4;
  border-radius: 10px;
  background: #fff;
}

.sidebar-performance {
  margin-top: 14px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 12px;
  background: rgba(255, 255, 255, .06);
}

.sidebar-performance select {
  min-width: 0;
  padding: 5px 7px;
  font-size: 12px;
}

#performanceOwner {
  width: 100%;
  margin-bottom: 8px;
}

.performance-range {
  margin: 4px 0 8px;
  color: #b8cbc5;
  font-size: 11px;
}

.performance-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2px 8px;
  padding: 7px 0;
  border-bottom: 1px solid rgba(255, 255, 255, .1);
}

.performance-row:last-child {
  border-bottom: 0;
}

.performance-row span,
.performance-row small {
  color: #c8d8d3;
}

.performance-row strong {
  color: #fff;
}

.performance-row small {
  grid-column: 1 / -1;
  font-size: 11px;
}

.performance-row small.up {
  color: #81dfbd;
}

.performance-row small.down {
  color: #ffaba3;
}

.performance-section-title {
  margin: 10px 0 4px;
  color: #eef7f4;
  font-size: 12px;
  font-weight: 700;
}

.performance-row.realtime strong {
  color: #ffd68a;
}

.performance-advice {
  margin-top: 10px;
  padding: 9px;
  border-radius: 10px;
  background: rgba(255, 255, 255, .08);
}

.performance-advice p {
  margin: 0 0 6px;
  color: #d8e8e3;
  font-size: 12px;
  line-height: 1.45;
}

.performance-advice p:last-child {
  margin-bottom: 0;
}

.assignment-popup {
  max-width: 520px;
}

.assignment-popup-list {
  display: grid;
  gap: 8px;
  margin: 12px 0;
}

.assignment-popup-item {
  display: grid;
  gap: 4px;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #dce8e4;
  border-radius: 12px;
  background: #f8fbfa;
  text-align: left;
  cursor: pointer;
}

.assignment-popup-item:hover {
  border-color: #58a891;
  background: #eef8f4;
}

.assignment-popup-item strong {
  color: #173b32;
}

.assignment-popup-item span,
.assignment-popup-note,
.sales-summary-note {
  color: #60756e;
  font-size: 12px;
  line-height: 1.45;
}

.assignment-popup-note {
  margin: 8px 0 12px;
}

.sales-summary-note {
  margin: 8px 0 0;
  text-align: left;
}

.learning-guide-card {
  display: grid;
  gap: 8px;
  margin: 12px 0;
  padding: 13px 14px;
  border: 1px solid rgba(24, 117, 97, .2);
  border-left: 4px solid #2f9d7e;
  border-radius: 12px;
  background: linear-gradient(135deg, #f2fbf7, #ffffff);
}

.learning-guide-card > div:first-child {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.learning-guide-card strong {
  color: #173b32;
}

.learning-guide-card span,
.learning-guide-card p,
.learning-guide-card li {
  color: #48645c;
  font-size: 13px;
  line-height: 1.55;
}

.learning-guide-card p {
  margin: 0;
}

.learning-guide-card ul {
  margin: 0;
  padding-left: 18px;
}

.learning-guide-refs {
  display: grid;
  gap: 6px;
}

.learning-guide-refs b {
  color: #24483f;
  font-size: 13px;
}

.learning-guide-refs span,
.learning-mini-ref {
  display: inline-block;
  padding: 6px 8px;
  border-radius: 8px;
  background: rgba(47, 157, 126, .09);
  color: #28584c;
  font-size: 12px;
}

.customer-learning-card {
  margin: 12px 0 16px;
  border-left-color: #d8952f;
  background: linear-gradient(135deg, #fff8ec, #ffffff);
}

.conversion-panel {
  overflow: visible;
  padding: 18px 20px;
  border: 1px solid rgba(24, 117, 97, 0.13);
  box-shadow: 0 10px 30px rgba(35, 91, 79, 0.07);
}

.conversion-heading,
.conversion-tools {
  display: flex;
  align-items: center;
}

.conversion-heading {
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 14px;
}

.conversion-title h2 {
  margin: 0 0 3px;
  font-size: 18px;
}

.conversion-title p {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
}

.conversion-tools {
  gap: 8px;
}

.conversion-help {
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: 50%;
  font-weight: 800;
  color: #166b59;
  background: #e5f6f0;
}

.conversion-filter-menu {
  position: relative;
}

.conversion-filter-menu summary {
  display: flex;
  min-width: 118px;
  height: 36px;
  padding: 0 12px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid #d6e5e1;
  border-radius: 10px;
  color: #24463e;
  background: #fff;
  cursor: pointer;
  list-style: none;
  font-size: 13px;
  font-weight: 700;
}

.conversion-filter-menu summary::-webkit-details-marker {
  display: none;
}

.conversion-filter-menu summary::after {
  content: "⌄";
  color: #608078;
}

.conversion-filter-menu summary b {
  display: none;
  min-width: 20px;
  height: 20px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  color: #fff;
  background: #16836d;
  font-size: 11px;
}

.conversion-filter-menu summary b.active {
  display: inline-flex;
}

.conversion-filter-popover {
  position: absolute;
  z-index: 20;
  top: calc(100% + 8px);
  right: 0;
  width: 290px;
  padding: 14px;
  border: 1px solid #dbe8e5;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 18px 50px rgba(23, 66, 57, 0.18);
}

.conversion-filter-popover label {
  display: grid;
  gap: 5px;
  margin-bottom: 10px;
  color: #56736c;
  font-size: 12px;
  font-weight: 700;
}

.conversion-filter-popover select {
  width: 100%;
}

.conversion-filter-reset {
  width: 100%;
}

.conversion-summary {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  min-height: 104px;
  align-items: stretch;
  overflow: hidden;
  border: 1px solid #e0ece8;
  border-radius: 16px;
  background: linear-gradient(110deg, #f4fbf8, #fff 55%, #f8f7ff);
}

.conversion-funnel {
  display: grid;
  padding: 12px 22px;
  place-content: center;
  gap: 3px;
  background: linear-gradient(145deg, #ecf8f4, #f7fbfa);
}

.conversion-funnel i {
  display: block;
  min-width: 42px;
  height: 17px;
  margin-inline: auto;
  border-radius: 3px;
  transform: skewX(-8deg);
  background: #39a98c;
}

.conversion-funnel i:nth-child(2) {
  background: #55b6a0;
}

.conversion-funnel i:nth-child(3) {
  background: #6c8ee7;
}

.conversion-funnel i:nth-child(4) {
  background: #8c72dc;
}

.conversion-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.conversion-metric,
.conversion-metrics article {
  display: grid;
  min-width: 0;
  padding: 17px 16px;
  align-content: center;
  border-left: 1px solid #e5eeeb;
}

.conversion-metrics span,
.conversion-metrics small {
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.conversion-metrics span {
  font-size: 12px;
  font-weight: 700;
}

.conversion-metrics strong {
  margin: 3px 0 1px;
  color: #126b58;
  font-size: 25px;
  line-height: 1;
}

.conversion-error {
  display: grid;
  grid-column: 1 / -1;
  min-height: 102px;
  place-content: center;
  text-align: center;
  color: #9a4c42;
}

.conversion-error span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.weekly-panel .panel-title h2 span {
  display: inline-flex;
  min-width: 26px;
  height: 26px;
  margin-left: 5px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  color: #fff;
  background: #187763;
  font-size: 13px;
}

.overdue-panel .panel-title h2 span {
  background: #c43227;
}

.field-with-link {
  display: flex;
  gap: 7px;
  align-items: stretch;
}

.field-with-link input {
  min-width: 0;
  flex: 1;
}

.field-link-button {
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  border: 1px solid #a8d6c8;
  border-radius: 8px;
  color: #126b58;
  background: #edf8f4;
  text-decoration: none;
  white-space: nowrap;
}

.duplicate-dialog {
  border-top: 5px solid #d13b31;
}

.duplicate-details {
  display: grid;
  gap: 8px;
  margin: 14px 0;
}

.duplicate-details > div {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 10px;
  border-radius: 8px;
  background: #f7f9f8;
}

body[data-role="purchaser"] .pipeline-card {
  cursor: pointer;
}

@media (max-width: 1050px) {
  .conversion-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  .conversion-heading {
    align-items: flex-start;
  }

  .conversion-summary {
    grid-template-columns: 1fr;
  }

  .conversion-funnel {
    display: none;
  }

  .conversion-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .conversion-filter-popover {
    right: -42px;
    width: min(290px, calc(100vw - 40px));
  }
}

/* Customer detail v2: responsive columns, editable notes, and multi-project navigation. */
.drawer-panel {
  width: min(1440px, 96vw);
  max-width: 96vw;
}

#customerDetail,
.detail-left,
.detail-right,
.detail-layout > * {
  min-width: 0;
}

.detail-layout {
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1.25fr);
}

.detail-layout input,
.detail-layout select,
.detail-layout textarea,
.field-with-link {
  min-width: 0;
  max-width: 100%;
}

.project-switcher {
  margin: 12px 0 16px;
  padding: 14px;
  border: 1px solid #d8e8e3;
  border-radius: 15px;
  background: linear-gradient(135deg, #f1faf7, #f7f5ff);
}

.project-switcher-head,
.project-switcher-head > div,
.project-tabs {
  display: flex;
}

.project-switcher-head {
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.project-switcher-head > div {
  flex-direction: column;
  gap: 2px;
}

.project-switcher-head span {
  color: var(--muted);
  font-size: 12px;
}

.project-tabs {
  gap: 8px;
  margin-top: 12px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.project-tabs button {
  display: grid;
  min-width: 150px;
  padding: 10px 13px;
  gap: 3px;
  border: 1px solid #d9e6e2;
  border-radius: 11px;
  color: #2a4942;
  background: rgba(255,255,255,.88);
  text-align: left;
}

.project-tabs button.active {
  border-color: #1b9a7e;
  color: #126b58;
  background: #fff;
  box-shadow: 0 7px 20px rgba(26, 126, 105, .13);
}

.project-tabs small {
  color: var(--muted);
}

.editable-text-view p {
  min-height: 68px;
  margin: 0;
  padding: 13px;
  border: 1px solid #e1eae7;
  border-radius: 10px;
  background: #fbfdfc;
  line-height: 1.65;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.editable-text-form textarea,
.project-card textarea {
  min-height: 120px;
  resize: vertical;
}

.followup-structured {
  display: grid;
  gap: 8px;
  margin-top: 10px;
  padding: 10px;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.04);
}

.followup-structured-item span,
.approval-inline span {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 12px;
}

.followup-structured-item p {
  margin: 0;
  white-space: pre-wrap;
}

.approval-inline {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

.product-rules-card {
  display: grid;
  gap: 10px;
  margin: 12px 0;
  padding: 12px;
  border: 1px solid #dbe7f3;
  border-radius: 14px;
  background: #f7fbff;
}

.product-rules-card strong {
  display: block;
  margin-bottom: 3px;
}

.product-rules-card span {
  color: var(--muted);
  font-size: 12px;
}

.product-rules-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.product-rules-card ul {
  margin: 6px 0 0;
  padding-left: 18px;
}

.product-rules-card li {
  margin: 4px 0;
}

.product-rules-card p {
  margin: 0;
  color: #24506f;
}

@media (max-width: 1180px) {
  .detail-layout {
    grid-template-columns: 1fr;
  }

  .drawer-panel {
    width: min(920px, 100vw);
    max-width: 100vw;
  }
}

@media (max-width: 620px) {
  .drawer-panel {
    padding: 12px;
  }

  .project-switcher-head {
    align-items: stretch;
    flex-direction: column;
  }
}

/* AI assisted progress workflow */
.final-crm-layout { grid-template-columns: minmax(220px, 0.65fr) minmax(360px, 1.05fr) minmax(380px, 1.15fr); }
.detail-stage-rail, .detail-main, .detail-right { display: grid; gap: 14px; align-content: start; }
.stage-progress-panel { position: sticky; top: 12px; }
.stage-progress-list { display: grid; gap: 10px; }
.stage-progress-item { display: grid; grid-template-columns: 30px 1fr; gap: 10px; padding: 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.stage-marker { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 999px; background: #eef2ff; color: #34408a; font-weight: 800; font-size: 12px; }
.stage-progress-item strong, .progress-draft-head strong, .sop-ref-list strong, .followup-sop-refs strong { display: block; color: var(--ink); }
.stage-progress-item span, .stage-progress-item small, .stage-progress-item p, .stage-progress-item em { display: block; margin-top: 3px; color: var(--muted); font-size: 12px; line-height: 1.45; font-style: normal; }
.stage-progress-item.current { border-color: #53b983; background: #f2fbf6; }
.stage-progress-item.current .stage-marker, .stage-progress-item.done .stage-marker { background: #dff7e9; color: #18784a; }
.stage-progress-item.skipped { background: #f8fafc; }
.stage-progress-item.future { opacity: .82; }
.progress-assistant-panel { border-color: #bde8d2; }
.progress-file-field small { display: block; margin-top: 6px; color: var(--muted); line-height: 1.45; }
.progress-draft-result { margin-top: 12px; }
.progress-draft-card { border: 1px solid #bde8d2; border-radius: 8px; background: #fbfffd; padding: 12px; display: grid; gap: 12px; }
.progress-draft-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.progress-draft-head span { color: var(--muted); font-size: 12px; }
.progress-ai-status { border-radius: 8px; padding: 9px 10px; font-size: 13px; line-height: 1.45; border: 1px solid #d8e5ef; background: #f7fbff; color: #31536b; }
.progress-ai-status.ok { border-color: #a9dfbf; background: #f1fbf5; color: #176b3a; }
.progress-ai-status.warn { border-color: #f0c36d; background: #fff8e6; color: #7a4e08; }
.progress-ai-status.off, .progress-ai-status.basic { border-color: #d8dce5; background: #f7f8fb; color: #5a6475; }
.sales-strategy-draft { display: grid; gap: 10px; border: 1px solid #b8d7ff; border-radius: 8px; background: #f7fbff; padding: 11px; }
.strategy-card-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.strategy-card-grid article, .strategy-evidence-grid article, .strategy-hypotheses article { border: 1px solid var(--line); border-radius: 8px; background: #fff; padding: 9px; }
.strategy-card-grid span { display: block; color: var(--muted); font-size: 12px; margin-bottom: 4px; }
.strategy-card-grid p, .strategy-evidence-grid li, .strategy-hypotheses p, .strategy-hypotheses small { margin: 0; color: var(--muted); line-height: 1.45; }
.sales-strategy-draft details { border: 1px dashed #b9c9dd; border-radius: 8px; background: #fff; padding: 9px; }
.sales-strategy-draft summary { cursor: pointer; font-weight: 700; }
.strategy-evidence-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 10px; }
.strategy-evidence-grid ul { margin: 6px 0 0; padding-left: 18px; }
.strategy-hypotheses { display: grid; gap: 8px; margin-top: 8px; }
.sales-strategy-draft pre { white-space: pre-wrap; max-height: 260px; overflow: auto; border: 1px solid var(--line); border-radius: 8px; background: #f8fafc; padding: 9px; color: var(--muted); line-height: 1.45; }
.progress-risk-box { border: 1px solid #f2cf8a; background: #fff8e8; border-radius: 8px; padding: 10px; display: grid; gap: 6px; }
.progress-risk-box p, .progress-risk-box label { margin: 0; color: #7a4e08; line-height: 1.45; }
.sop-ref-list, .followup-sop-refs { display: grid; gap: 8px; }
.sop-ref-list article { border: 1px solid var(--line); border-radius: 8px; padding: 9px; background: #fff; }
.sop-ref-list p, .sop-ref-list small { margin: 4px 0 0; color: var(--muted); line-height: 1.45; }
.followup-sop-refs { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
.followup-sop-refs span { display: inline-block; margin: 4px 6px 0 0; padding: 4px 8px; border: 1px solid var(--line); border-radius: 999px; background: #fff; color: var(--muted); font-size: 12px; }
.manual-followup-panel summary { cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 10px; color: var(--ink); }
.manual-followup-panel summary span { color: var(--muted); font-size: 12px; font-weight: 500; }
.manual-followup-body { margin-top: 12px; display: grid; gap: 14px; }
.tag.green { background: #e4f8ed; color: #177244; }
.customer-learning-card { display: none; }
.customer-profile-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 18px 0 0; padding-top: 14px; border-top: 1px solid var(--line); }
.customer-profile-actions button { min-width: 150px; }
.customer-edit-form { display: grid; gap: 0; }
.final-crm-layout { grid-template-columns: minmax(240px, 0.82fr) minmax(0, 1.9fr) minmax(300px, 1fr); width: min(100%, 1420px); margin: 0 auto; column-gap: 15px; }
.detail-stage-rail, .detail-main, .detail-right, .final-crm-layout > * { min-width: 0; max-width: 100%; box-sizing: border-box; }
.detail-main, .detail-right { overflow-wrap: anywhere; }
.detail-main textarea, .detail-right textarea { box-sizing: border-box; }
.progress-ai-actions { display: grid; grid-template-columns: 1fr; gap: 10px; align-items: center; }
.progress-ai-actions button { width: 100%; }
.investigation-sources { display: grid; gap: 8px; margin-top: 12px; }
.investigation-sources a { display: grid; gap: 3px; padding: 9px 10px; border: 1px solid var(--line); border-radius: 8px; background: #fbfdfc; text-decoration: none; }
.investigation-sources span { color: var(--muted); font-size: 12px; line-height: 1.45; }
.investigation-structured { display: grid; gap: 10px; margin: 12px 0; }
.investigation-structured-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.investigation-structured-grid article { border: 1px solid var(--line); border-radius: 8px; background: #fbfefd; padding: 10px; }
.investigation-structured-grid p { margin: 6px 0 0; color: var(--muted); line-height: 1.55; }
.investigation-warnings { margin-top: 10px; padding: 9px 10px; border: 1px solid #f0c36d; border-radius: 10px; background: #fff8e6; color: #7a4e08; line-height: 1.45; }
.investigation-dialog { width: min(820px, calc(100vw - 36px)); max-height: min(760px, calc(100vh - 36px)); overflow: auto; }
.investigation-dialog-report { max-height: 240px; overflow: auto; }
.investigation-field-suggestions { display: grid; gap: 8px; padding: 11px 12px; border: 1px solid #b9dfd1; border-radius: 12px; background: #f4fbf8; }
.investigation-field-suggestions p { margin: 0; color: var(--muted); line-height: 1.5; }
.investigation-field-suggestions textarea { min-height: 84px; }
@media (max-width: 1180px) {
  .final-crm-layout { grid-template-columns: 1fr; }
  .stage-progress-panel { position: static; }
  .stage-progress-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .stage-progress-list { grid-template-columns: 1fr; }
  .progress-draft-head, .manual-followup-panel summary { align-items: flex-start; flex-direction: column; }
  .investigation-structured-grid { grid-template-columns: 1fr; }
}

/* Mobile uses a compact command bar so the work area is reachable immediately. */
@media (max-width: 700px) {
  .shell {
    display: block;
  }

  .sidebar {
    position: static;
    gap: 12px;
    padding: 14px 16px;
    background: #0a2f27;
  }

  .brand > span {
    width: 38px;
    height: 38px;
    font-size: 13px;
  }

  .brand {
    gap: 10px;
  }

  .brand strong {
    font-size: 16px;
  }

  .brand small {
    margin-top: 2px;
    font-size: 12px;
  }

  .nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .nav button {
    min-height: 42px;
    padding: 9px 10px;
    text-align: center;
    font-size: 14px;
  }

  .mobile-sidebar-tools {
    display: block;
    padding: 10px 12px;
    background: #eef7f4;
    border-bottom: 1px solid var(--line);
  }

  .mobile-tools-toggle {
    display: flex;
    width: 100%;
    min-height: 42px;
    align-items: center;
    justify-content: space-between;
    padding: 9px 12px;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: #fff;
    color: var(--ink);
    font-weight: 800;
  }

  .mobile-tools-content {
    display: none;
    grid-template-columns: 1fr;
    gap: 12px;
    padding-top: 12px;
  }

  .mobile-sidebar-tools.open .mobile-tools-content {
    display: grid;
  }

  .mobile-sidebar-tools .sidebar-messages,
  .mobile-sidebar-tools .sidebar-performance,
  .mobile-sidebar-tools .config {
    display: grid;
    margin: 0;
    border: 1px solid var(--line);
    background: #fff;
    color: var(--ink);
    box-shadow: 0 6px 18px rgba(12, 52, 44, .06);
  }

  .mobile-sidebar-tools .sidebar-section-title,
  .mobile-sidebar-tools .performance-row strong {
    color: var(--ink);
  }

  .mobile-sidebar-tools .performance-range,
  .mobile-sidebar-tools .performance-row span,
  .mobile-sidebar-tools .performance-row small {
    color: var(--muted);
  }

  .mobile-sidebar-tools .performance-row {
    border-bottom-color: var(--line);
  }

  .mobile-sidebar-tools .message-title-actions button {
    border-color: var(--line);
    background: #eef7f4;
    color: var(--ink);
    box-shadow: none;
  }
}

.collaboration-summary-card { border-color: #b9dfd1; }
.collaboration-summary-list { display: grid; gap: 10px; }
.collaboration-summary-list article { padding: 11px 12px; border-left: 3px solid var(--green); background: #f7fbf9; }
.collaboration-summary-list p { margin: 6px 0 0; white-space: pre-wrap; line-height: 1.55; }
.collaboration-history { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.collaboration-history summary { cursor: pointer; color: var(--accent); font-weight: 700; }
.collaboration-history article { margin-top: 10px; padding: 10px; border: 1px solid var(--line); border-radius: 8px; background: #fbfdfc; }
.collaboration-history p { margin: 5px 0 0; color: var(--muted); white-space: pre-wrap; line-height: 1.5; }

.risk-lock-banner { display:flex; gap:10px; align-items:center; margin:0 24px 14px; padding:11px 14px; border:1px solid #f1c36d; border-radius:8px; background:#fff5dd; color:#7a4700; }
.risk-strategy-card { margin:14px 0; padding:12px; border:1px solid #f1c36d; border-radius:8px; background:#fffaf0; }
.risk-strategy-card p { margin:6px 0; line-height:1.5; }
.risk-strategy-card small { display:block; margin-bottom:10px; color:var(--muted); }
@media (max-width:700px){ .risk-lock-banner { margin:0 12px 12px; align-items:flex-start; flex-direction:column; } }

.strategy-rule-candidates { display:grid; gap:10px; margin-top:14px; padding:12px; border:1px solid #d8e5e1; border-radius:12px; background:#fbfefd; }
.strategy-rule-candidates summary { color:#294d45; font-weight:800; cursor:pointer; }
.strategy-rule-candidates .meta { margin:0; }
#strategyRuleCandidateList { display:grid; gap:8px; }
.rule-candidate-row { display:grid; gap:6px; padding:11px; border:1px solid #e0ebe7; border-radius:10px; background:#fff; }
.rule-candidate-row > div:first-child { display:flex; justify-content:space-between; gap:8px; }
.rule-candidate-row span,.rule-candidate-row p,.rule-candidate-row small { color:#65758a; line-height:1.45; }
.rule-candidate-row p { margin:0; }
.conversation-import-panel{border:1px solid #b9e2d8;border-radius:18px;background:#fbfffd;padding:20px;box-shadow:0 12px 30px rgba(19,115,94,.08)}
.conversation-import-head{margin-bottom:18px}.conversation-import-head span,.conversation-preview-head span{color:#087f6a;font-size:12px;font-weight:800;letter-spacing:.04em}.conversation-import-head h2,.conversation-preview-head h3{margin:4px 0 6px}.conversation-import-head p{margin:0;color:#5b6b78}
.conversation-workflow-guide{margin:0 0 16px;padding:13px 15px;border:1px solid #c8eadf;border-radius:14px;background:linear-gradient(135deg,#f2fbf7 0%,#eef6ff 100%);color:#263846}.conversation-workflow-guide strong{display:block;margin-bottom:8px;color:#087f6a;font-size:15px}.conversation-workflow-guide ol{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;margin:0;padding:0;list-style:none}.conversation-workflow-guide li{border:1px solid rgba(8,127,106,.12);border-radius:999px;background:rgba(255,255,255,.72);padding:7px 10px;font-size:13px;font-weight:800;color:#31564d}.conversation-workflow-guide details{margin-top:9px;color:#5b6b78}.conversation-workflow-guide summary{cursor:pointer;font-weight:800;color:#50665f}.conversation-workflow-guide ul{margin:8px 0 0;padding-left:18px;line-height:1.6}
.conversation-import-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}.conversation-import-grid label,.conversation-time-box label,.conversation-preview-row label{display:flex;flex-direction:column;gap:6px;font-weight:700;color:#263846}.conversation-import-grid .wide{grid-column:1/-1}.conversation-import-grid textarea{min-height:120px}
.conversation-time-box{display:grid;grid-template-columns:minmax(220px,1fr) auto auto;align-items:end;gap:12px;border:1px dashed #a8bdb8;border-radius:12px;padding:12px}.conversation-time-box legend{padding:0 6px;color:#46625b;font-weight:800}.conversation-time-box .conversation-time-choice{display:flex;flex-direction:row;align-items:center;white-space:nowrap;padding-bottom:10px}.conversation-time-box>small{grid-column:1/-1;color:#64756f}
.conversation-file-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}.conversation-file-grid label{border:1px solid #dce8e4;border-radius:12px;padding:12px;background:#fff}.conversation-file-grid input{padding:8px 0;border:0;background:transparent}.conversation-limit{margin:0;color:#7a4f0b;font-weight:700}.conversation-import-panel>form>.primary{width:100%;margin-top:16px}
.conversation-preview{margin-top:18px;border-top:1px solid #dceae6;padding-top:18px}.conversation-preview-head{display:flex;justify-content:space-between;gap:16px;align-items:start}.conversation-preview-head h3{font-size:20px}.conversation-material-list{display:flex;flex-wrap:wrap;gap:8px;margin:12px 0}.conversation-material-list span{border-radius:999px;background:#eef7f4;padding:6px 10px;color:#47645c;font-size:12px}
.conversation-review-summary{display:grid;grid-template-columns:1.25fr repeat(4,minmax(110px,1fr));gap:8px;margin:14px 0}.conversation-review-summary>*{display:flex;align-items:center;justify-content:center;min-height:44px;padding:8px 10px;border-radius:11px;background:#f1f6f4;color:#52635f;font-size:13px}.conversation-review-summary strong{background:#183b34;color:#fff}.conversation-review-summary .auto-ready{background:#e8f7f1;color:#087f6a}.conversation-review-summary .batch-review{background:#fff4dc;color:#8a5a00}.conversation-review-summary .blocked{background:#fff0ee;color:#b23a2b}
.conversation-thread-meta{margin:12px 0;padding:12px 14px;border:1px solid #c7dfd8;border-left:4px solid #159a83;border-radius:12px;background:#f4fbf8}.conversation-thread-meta strong{display:block;margin-bottom:5px;color:#075f52}.conversation-thread-meta p{margin:0;color:#52655f;line-height:1.55}
.conversation-section-head{display:flex;align-items:start;justify-content:space-between;gap:12px;margin-bottom:10px}.conversation-section-head span{display:block;color:#087f6a;font-size:12px;font-weight:800;letter-spacing:.04em}.conversation-section-head h4{margin:3px 0 0;font-size:17px}.conversation-speaker-section,.conversation-exception-section{margin:14px 0;padding:14px;border:1px solid #dce9e5;border-radius:14px;background:#fff}.conversation-speaker-groups{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.conversation-speaker-card{display:grid;grid-template-columns:minmax(0,1fr) minmax(150px,.65fr);align-items:end;gap:12px;padding:12px;border:1px solid #dce8e4;border-left:4px solid #17a486;border-radius:11px;background:#fbfefd}.conversation-speaker-card.batch_review{border-left-color:#e5a32b;background:#fffdf7}.conversation-speaker-card.blocked{border-left-color:#d85142;background:#fff9f8}.conversation-speaker-card strong,.conversation-speaker-card small{display:block}.conversation-speaker-card small{margin-top:4px;color:#64756f}.conversation-speaker-card label{display:flex;flex-direction:column;gap:5px;font-weight:700;color:#344b45}
.conversation-exception-section{background:#fbfefd}.conversation-exception-card{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:12px;margin-top:8px;padding:11px;border:1px solid #eed9a9;border-left:4px solid #e5a32b;border-radius:10px;background:#fffdf7}.conversation-exception-card.blocked{border-color:#efc5bf;border-left-color:#d85142;background:#fff9f8}.conversation-exception-card span{display:block;margin:3px 0;color:#8a5a00;font-size:12px;font-weight:800}.conversation-exception-card.blocked span{color:#b23a2b}.conversation-exception-card p{margin:4px 0 0;color:#5c6c68;line-height:1.45}.conversation-all-ready{margin:0;color:#58716a}.conversation-issue{color:#b23a2b!important;font-weight:700!important}
.conversation-preview-ledger{display:flex;flex-direction:column;gap:10px;margin:14px 0;padding:16px;border:1px solid #d9ebe5;border-radius:16px;background:linear-gradient(180deg,#f3fbf8 0%,#eef8f4 100%)}.conversation-preview-ledger>.conversation-section-head{margin-bottom:4px}.conversation-preview-ledger>.conversation-section-head small{color:#62766f;line-height:1.5}.conversation-preview-bubble{width:min(76%,680px);padding:11px 13px;border:1px solid #dce8e4;border-radius:16px;background:#fff;box-shadow:0 5px 14px rgba(16,64,54,.06)}.conversation-preview-bubble.customer{align-self:flex-start;border-top-left-radius:4px;background:#fff}.conversation-preview-bubble.salesperson{align-self:flex-end;border-top-right-radius:4px;background:#dcf8c6;border-color:#bde8a4}.conversation-preview-bubble.other,.conversation-preview-bubble.unknown{align-self:center;background:#f8fbff;border-color:#d8e4ff}.conversation-preview-bubble.batch_review{border-color:#e8b451}.conversation-preview-bubble.blocked{border-color:#d85142}.conversation-preview-bubble-meta{display:flex;justify-content:space-between;gap:10px;margin-bottom:6px;color:#52655f;font-size:12px}.conversation-preview-bubble-meta span{font-weight:800}.conversation-preview-bubble-meta small{color:#788982}.conversation-preview-bubble p{margin:0;color:#1e2b37;white-space:pre-wrap;line-height:1.55}.conversation-preview-bubble em{display:block;margin-top:8px;color:#b23a2b;font-style:normal;font-size:12px;font-weight:800}.conversation-event-card{align-self:center;max-width:min(78%,620px);padding:8px 12px;border:1px dashed #b7cbc5;border-radius:999px;background:#f9fdfb;color:#4d635d;text-align:center}.conversation-event-card span{display:inline-block;margin-right:6px;color:#087f6a;font-weight:900}.conversation-event-card p{display:inline;margin:0;white-space:pre-wrap}.conversation-event-card small{display:block;margin-top:3px;color:#788982;font-size:11px}.conversation-event-card.system_event{opacity:.72}.conversation-event-card.blocked{border-color:#d85142;color:#913126;background:#fff8f7}
.conversation-time-required{border:1px solid #f0bd69;background:#fff8ea;border-radius:12px;padding:14px;margin:12px 0}.conversation-time-required p{margin:6px 0 10px}.conversation-time-required>div{display:flex;flex-wrap:wrap;gap:10px;align-items:center}.conversation-time-required input[type="text"],.conversation-time-required input:not([type]){min-width:220px}
.conversation-preview-list{display:flex;flex-direction:column;gap:10px;margin:14px 0}.conversation-preview-row{display:grid;grid-template-columns:54px 130px 140px minmax(220px,1fr) 190px;gap:10px;align-items:start;border:1px solid #dce7e4;border-left:4px solid #17a486;border-radius:12px;padding:12px;background:#fff}.conversation-row-order{display:flex;align-items:center;justify-content:center;gap:4px}.conversation-row-order button{width:24px;height:28px;padding:0;border:1px solid #cbdad6;background:#f7fbfa;border-radius:7px}.conversation-message-text textarea{min-height:72px}.conversation-preview-row small{font-weight:500;color:#6b7d78}.conversation-exclude{display:flex!important;grid-column:2/-1;flex-direction:row!important;align-items:center!important;font-weight:600!important}.conversation-confirm-note{margin:10px 0;color:#5d706a}.conversation-preview>[data-confirm-conversation]{width:100%}
.conversation-preview-row.batch_review{border-left-color:#e5a32b}.conversation-preview-row.blocked{border-left-color:#d85142}.conversation-full-history{margin:14px 0;border:1px dashed #b7cbc5;border-radius:12px;background:#fff}.conversation-full-history>summary{cursor:pointer;padding:13px 15px;color:#31564d;font-weight:800}.conversation-full-history[open]>summary{border-bottom:1px solid #e1ebe8}.conversation-full-history .conversation-preview-list{padding:0 12px 12px}.conversation-focus{outline:3px solid rgba(22,164,134,.26);box-shadow:0 0 0 6px rgba(22,164,134,.08)}
.conversation-internal-note{margin-top:16px}.conversation-internal-note>summary{cursor:pointer;color:#536862;font-weight:800;padding:12px}.conversation-internal-note-warning{margin:0 12px 10px;padding:10px 12px;border:1px solid #f0d493;border-radius:12px;background:#fffaf0;color:#7a4f0b;font-size:13px;line-height:1.5}.conversation-internal-note .progress-assistant-panel{margin-top:10px}
.conversation-auto-state-note{border:1px solid #cfe9e1;border-radius:14px;background:#f4fbf8;padding:12px 14px;color:#263846}.conversation-auto-state-note strong{display:block;color:#087f6a;margin-bottom:4px}.conversation-auto-state-note small{display:block;color:#5b6b78;line-height:1.55}
@media(max-width:900px){.conversation-workflow-guide ol{grid-template-columns:1fr}.conversation-review-summary{grid-template-columns:repeat(2,minmax(0,1fr))}.conversation-review-summary strong{grid-column:1/-1}.conversation-file-grid{grid-template-columns:1fr}.conversation-preview-row{grid-template-columns:48px 1fr 1fr}.conversation-message-text{grid-column:2/-1}.conversation-exclude{grid-column:2/-1}}
@media(max-width:620px){.conversation-import-panel{padding:14px}.conversation-import-grid{grid-template-columns:1fr}.conversation-import-grid .wide{grid-column:auto}.conversation-time-box{grid-template-columns:1fr}.conversation-time-box>small{grid-column:auto}.conversation-review-summary,.conversation-speaker-groups{grid-template-columns:1fr}.conversation-review-summary strong{grid-column:auto}.conversation-speaker-card,.conversation-exception-card{grid-template-columns:1fr}.conversation-section-head{align-items:stretch;flex-direction:column}.conversation-preview-bubble,.conversation-event-card{max-width:100%;width:100%}.conversation-preview-bubble.customer,.conversation-preview-bubble.salesperson,.conversation-preview-bubble.other,.conversation-preview-bubble.unknown{align-self:stretch}.conversation-preview-bubble-meta{flex-direction:column;gap:2px}.conversation-preview-row{grid-template-columns:42px minmax(0,1fr)}.conversation-preview-row label{grid-column:2}.conversation-preview-row input,.conversation-preview-row select,.conversation-preview-row textarea{min-width:0;width:100%}.conversation-file-grid{grid-template-columns:1fr}}

/* Homepage phase 1: action-first workbench. All rules are scoped to the dashboard. */
body[data-view="dashboard"] {
  background: #f4f7f5;
}

body[data-view="dashboard"] .sidebar {
  background: #0e3029;
}

body[data-view="dashboard"] .main {
  min-width: 0;
  background: #f4f7f5;
}

body[data-view="dashboard"] .topbar {
  border-bottom: 1px solid #d8e1dd;
  background: #fff;
  box-shadow: none;
}

body[data-view="dashboard"] .dashboard-workflow {
  --dashboard-ink: #18231f;
  --dashboard-muted: #5d6b66;
  --dashboard-line: #d6e0dc;
  --dashboard-green: #087358;
  --dashboard-green-dark: #055943;
  --dashboard-warning-bg: #fff2cc;
  --dashboard-warning-ink: #6b4300;
  --dashboard-danger-bg: #fde8e6;
  --dashboard-danger-ink: #9b2c25;
  --dashboard-info-bg: #e9f0f5;
  --dashboard-info-ink: #334e68;
  gap: 18px;
  padding-bottom: 32px;
  color: var(--dashboard-ink);
}

body[data-view="dashboard"] .dashboard-workflow > .panel,
body[data-view="dashboard"] .dashboard-sales-section {
  margin: 0;
  padding: 22px;
  border: 1px solid var(--dashboard-line);
  border-radius: 12px;
  background: #fff;
  box-shadow: none;
}

body[data-view="dashboard"] .dashboard-action-panel {
  border-top: 4px solid var(--dashboard-green);
}

body[data-view="dashboard"] .dashboard-section-heading,
body[data-view="dashboard"] .dashboard-section-heading > div:first-child,
body[data-view="dashboard"] .dashboard-section-heading-light {
  min-width: 0;
}

body[data-view="dashboard"] .dashboard-section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--dashboard-line);
}

body[data-view="dashboard"] .dashboard-section-heading h2,
body[data-view="dashboard"] .panel-title h2 {
  margin: 3px 0 5px;
  color: var(--dashboard-ink);
  font-size: 21px;
  line-height: 1.3;
}

body[data-view="dashboard"] .dashboard-section-heading p,
body[data-view="dashboard"] .panel-title p {
  margin: 0;
  color: var(--dashboard-muted);
  line-height: 1.55;
}

body[data-view="dashboard"] .dashboard-kicker {
  color: var(--dashboard-green-dark);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .08em;
}

body[data-view="dashboard"] .dashboard-action-summary {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

body[data-view="dashboard"] .dashboard-action-summary > span,
body[data-view="dashboard"] .dashboard-action-reasons > span,
body[data-view="dashboard"] .dashboard-section-status {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  gap: 4px;
  padding: 5px 9px;
  border-radius: 6px;
  background: #eef4f1;
  color: #3e514a;
  font-size: 12px;
  font-weight: 750;
}

body[data-view="dashboard"] .dashboard-action-summary .danger,
body[data-view="dashboard"] .dashboard-action-reasons .danger {
  background: var(--dashboard-danger-bg);
  color: var(--dashboard-danger-ink);
}

body[data-view="dashboard"] .dashboard-action-summary .warning,
body[data-view="dashboard"] .dashboard-action-reasons .warning {
  background: var(--dashboard-warning-bg);
  color: var(--dashboard-warning-ink);
}

body[data-view="dashboard"] .dashboard-action-summary .info,
body[data-view="dashboard"] .dashboard-action-reasons .info {
  background: var(--dashboard-info-bg);
  color: var(--dashboard-info-ink);
}

body[data-view="dashboard"] .dashboard-action-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 18px;
}

body[data-view="dashboard"] .dashboard-partial-note {
  grid-column: 1 / -1;
  margin: 12px 0 0;
  padding: 10px 12px;
  border-left: 3px solid #9a6700;
  background: #fff8e6;
  color: #6b4300;
  font-size: 13px;
  line-height: 1.5;
}

body[data-view="dashboard"] .dashboard-action-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  min-width: 0;
  padding: 15px 0;
  border-bottom: 1px solid #e2e9e6;
}

body[data-view="dashboard"] .dashboard-action-copy {
  display: grid;
  min-width: 0;
  gap: 6px;
}

body[data-view="dashboard"] .dashboard-action-copy > strong,
body[data-view="dashboard"] .dashboard-action-copy > span {
  overflow-wrap: anywhere;
}

body[data-view="dashboard"] .dashboard-action-copy > span {
  color: var(--dashboard-muted);
  font-size: 13px;
  line-height: 1.45;
}

body[data-view="dashboard"] .dashboard-action-reasons {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

body[data-view="dashboard"] .dashboard-empty-state,
body[data-view="dashboard"] .dashboard-error-state,
body[data-view="dashboard"] .dashboard-loading-state {
  grid-column: 1 / -1;
  min-height: 78px;
}

body[data-view="dashboard"] .dashboard-empty-state,
body[data-view="dashboard"] .dashboard-error-state {
  display: grid;
  align-content: center;
  gap: 5px;
  padding: 16px 0;
  color: var(--dashboard-muted);
}

body[data-view="dashboard"] .dashboard-empty-state strong {
  color: var(--dashboard-ink);
}

body[data-view="dashboard"] .dashboard-error-state {
  color: var(--dashboard-danger-ink);
}

body[data-view="dashboard"] .dashboard-loading-state {
  color: var(--dashboard-muted);
}

body[data-view="dashboard"] .dashboard-weekly-panel .panel-title,
body[data-view="dashboard"] .dashboard-reminder-panel .panel-title,
body[data-view="dashboard"] .dashboard-pipeline-panel .panel-title {
  margin-bottom: 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--dashboard-line);
}

body[data-view="dashboard"] .dashboard-weekly-panel .list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  max-height: none;
  overflow: visible;
}

body[data-view="dashboard"] .dashboard-weekly-panel .customer-card {
  margin: 0;
  border-radius: 8px;
  box-shadow: none;
}

body[data-view="dashboard"] .dashboard-reminder-panel .reminder-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 0;
}

body[data-view="dashboard"] .dashboard-reminder-panel .reminder-card {
  min-height: 116px;
  border-radius: 8px;
  box-shadow: none;
}

body[data-view="dashboard"] .dashboard-sales-section {
  display: grid;
  gap: 14px;
}

body[data-view="dashboard"] .dashboard-section-heading-light {
  padding-bottom: 14px;
}

body[data-view="dashboard"] .dashboard-stats {
  grid-template-columns: repeat(4, minmax(130px, 1fr));
  gap: 10px;
  margin: 0;
}

body[data-view="dashboard"] .dashboard-stats .stat,
body[data-view="dashboard"] .dashboard-stats .stat:first-child {
  min-height: 108px;
  border: 1px solid var(--dashboard-line);
  border-radius: 8px;
  background: #f8faf9;
  box-shadow: none;
  text-align: left;
}

body[data-view="dashboard"] .dashboard-stats .stat small {
  display: block;
  margin-top: 7px;
}

body[data-view="dashboard"] .dashboard-sales-grid {
  display: grid;
  grid-template-columns: minmax(280px, .8fr) minmax(0, 1.2fr);
  gap: 14px;
  align-items: start;
}

body[data-view="dashboard"] .dashboard-performance,
body[data-view="dashboard"] .conversion-panel {
  margin: 0;
  border: 1px solid var(--dashboard-line);
  border-radius: 8px;
  background: #fff;
  box-shadow: none;
}

body[data-view="dashboard"] .dashboard-performance {
  position: static;
  color: var(--dashboard-ink);
}

body[data-view="dashboard"] .dashboard-performance .sidebar-section-title,
body[data-view="dashboard"] .dashboard-performance .performance-row strong {
  color: var(--dashboard-ink);
}

body[data-view="dashboard"] .dashboard-performance .performance-range,
body[data-view="dashboard"] .dashboard-performance .performance-row span,
body[data-view="dashboard"] .dashboard-performance .performance-row small {
  color: var(--dashboard-muted);
}

body[data-view="dashboard"] .dashboard-pipeline-panel {
  min-width: 0;
}

body[data-view="dashboard"] .primary {
  border-color: #087358;
  background: #087358;
  color: #fff;
  box-shadow: none;
}

body[data-view="dashboard"] .primary:hover {
  border-color: #055943;
  background: #055943;
}

body[data-view="dashboard"] button,
body[data-view="dashboard"] select,
body[data-view="dashboard"] .nav button,
body[data-view="dashboard"] .mobile-tools-toggle,
body[data-view="dashboard"] .task-action-close,
body[data-view="dashboard"] .pipeline-pager button {
  min-height: 44px;
}

body[data-view="dashboard"] button:focus-visible,
body[data-view="dashboard"] select:focus-visible,
body[data-view="dashboard"] a:focus-visible {
  outline: 3px solid #1d4ed8;
  outline-offset: 2px;
}

body[data-view="dashboard"] button:disabled {
  border-color: #cbd5d1;
  background: #e8eeeb;
  color: #687771;
  cursor: not-allowed;
  opacity: 1;
}

@media (max-width: 1199px) {
  body[data-view="dashboard"] .dashboard-action-list,
  body[data-view="dashboard"] .dashboard-weekly-panel .list {
    grid-template-columns: 1fr;
  }

  body[data-view="dashboard"] .dashboard-reminder-panel .reminder-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body[data-view="dashboard"] .dashboard-sales-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 960px) {
  body[data-view="dashboard"] .shell {
    display: block;
  }

  body[data-view="dashboard"] .sidebar {
    position: static;
    display: grid;
    gap: 12px;
    padding: 14px 18px;
  }

  body[data-view="dashboard"] .brand {
    max-width: 440px;
  }

  body[data-view="dashboard"] .nav {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
  }

  body[data-view="dashboard"] .nav button {
    padding: 9px 10px;
    text-align: center;
  }

  body[data-view="dashboard"] .mobile-sidebar-tools {
    display: block;
    padding: 10px 18px;
    border-bottom: 1px solid var(--dashboard-line);
    background: #eef4f1;
  }

  body[data-view="dashboard"] .mobile-tools-toggle {
    display: flex;
    width: 100%;
    align-items: center;
    justify-content: space-between;
    border: 1px solid var(--dashboard-line);
    border-radius: 8px;
    background: #fff;
    color: var(--dashboard-ink);
  }

  body[data-view="dashboard"] .mobile-tools-content {
    display: none;
    gap: 12px;
    padding-top: 12px;
  }

  body[data-view="dashboard"] .mobile-sidebar-tools.open .mobile-tools-content {
    display: grid;
  }

  body[data-view="dashboard"] .topbar {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 12px;
  }

  body[data-view="dashboard"] .dashboard-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 767px) {
  body[data-view="dashboard"] .sidebar {
    padding: 12px;
  }

  body[data-view="dashboard"] .brand > span {
    width: 38px;
    height: 38px;
  }

  body[data-view="dashboard"] .nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body[data-view="dashboard"] .mobile-sidebar-tools {
    padding: 9px 12px;
  }

  body[data-view="dashboard"] .topbar {
    align-items: stretch;
    flex-direction: column;
    padding: 14px 12px;
  }

  body[data-view="dashboard"] .topbar .user-box {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  body[data-view="dashboard"] .topbar .user-box > span {
    grid-column: 1 / -1;
  }

  body[data-view="dashboard"] .dashboard-workflow {
    gap: 12px;
    padding: 12px;
  }

  body[data-view="dashboard"] .dashboard-workflow > .panel,
  body[data-view="dashboard"] .dashboard-sales-section {
    padding: 16px;
    border-radius: 10px;
  }

  body[data-view="dashboard"] .dashboard-section-heading,
  body[data-view="dashboard"] .panel-title {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  body[data-view="dashboard"] .dashboard-action-summary {
    width: 100%;
    justify-content: flex-start;
  }

  body[data-view="dashboard"] .dashboard-action-item {
    grid-template-columns: 1fr;
  }

  body[data-view="dashboard"] .dashboard-action-item .primary {
    width: 100%;
  }

  body[data-view="dashboard"] .dashboard-reminder-panel .reminder-grid,
  body[data-view="dashboard"] .dashboard-stats {
    grid-template-columns: 1fr;
  }

  body[data-view="dashboard"] .dashboard-stats .stat {
    min-height: 92px;
  }

  body[data-view="dashboard"] .pipeline-flow,
  body[data-view="dashboard"] .pipeline-outcome-grid {
    grid-template-columns: 1fr;
  }

  body[data-view="dashboard"] .pipeline-column {
    height: auto !important;
    max-height: none;
    resize: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  body[data-view="dashboard"] *,
  body[data-view="dashboard"] *::before,
  body[data-view="dashboard"] *::after {
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
  }
}

/* HubSpot-inspired B2B Sales Workbench — approved visual layer, 2026-07-29. */
.editing-draft-status { margin: 10px 0 0; font-size: 13px; line-height: 1.5; color: var(--v2-muted, #646a73); }
.editing-draft-status.error { color: var(--v2-danger, #ba1a1a); }
.editing-conflict { margin-top: 12px; padding: 12px; border: 1px solid var(--v2-border, #dee0e3); }
.editing-conflict p { display: grid; gap: 4px; white-space: pre-wrap; overflow-wrap: anywhere; }
.task-project-name { margin: 6px 0; font-size: 13px; font-weight: 600; }
.customer-saved-views { display: flex; align-items: end; flex-wrap: wrap; gap: 10px; margin-bottom: 12px; }
.customer-saved-views label { display: grid; gap: 4px; font-size: 13px; }
.customer-saved-views button, .customer-saved-views select { min-height: 44px; }
.vue-commercial-section { padding: 16px; border-top: 1px solid var(--v2-border, #dee0e3); min-width: 0; }
.vue-commercial-section summary { min-height: 44px; padding: 10px 0; cursor: pointer; font-size: 14px; font-weight: 600; }
.vue-commercial-block { margin-top: 16px; }
.vue-commercial-record { padding: 14px 0; border-bottom: 1px solid var(--v2-border, #dee0e3); overflow-wrap: anywhere; }
.vue-commercial-record p { margin: 6px 0; white-space: pre-wrap; }
.vue-commercial-section button { min-height: 44px; }
.conversation-edit-pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; }
.conversation-edit-pager button { min-height: 44px; }
[data-open-card]:focus-visible { outline: 2px solid var(--v2-primary, #3370ff); outline-offset: 3px; }
:root {
  --hub-nav: #183c35;
  --hub-nav-hover: #245447;
  --hub-canvas: #f5f7f9;
  --hub-surface: #ffffff;
  --hub-border: #dfe5e8;
  --hub-border-strong: #b8c4ca;
  --hub-text: #253342;
  --hub-muted: #647586;
  --hub-primary: #087358;
  --hub-primary-hover: #055943;
  --hub-primary-soft: #e7f3ed;
  --hub-info: #0b6b5b;
  --hub-info-soft: #e6f3ef;
  --hub-ai: #245446;
  --hub-ai-soft: #e8f2ee;
  --hub-warning: #7a4b00;
  --hub-warning-soft: #fff2ce;
  --hub-danger: #a82f2f;
  --hub-danger-soft: #fdeceb;
  --green: #087358;
  --green-dark: #055943;
  --green-soft: #e7f3ed;
  --purple: #0b6b5b;
  --purple-dark: #055943;
  --purple-soft: #e8f2ee;
}

html { background: var(--hub-canvas); }

body {
  color: var(--hub-text);
  background: var(--hub-canvas);
  font-family: "Segoe UI", "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
}

.login-screen {
  background: var(--hub-nav);
}

.login-brand > span {
  background: #e7f3ed;
  color: #055943;
}

.setup-box {
  color: var(--hub-text);
  border-color: #cfe2da;
  background: #eef6f2;
}

.shell { grid-template-columns: 236px minmax(0, 1fr); background: var(--hub-canvas); }

.sidebar,
body[data-view="dashboard"] .sidebar {
  background: var(--hub-nav);
  box-shadow: none;
}

.brand > span {
  color: var(--hub-nav);
  background: #fff;
  border-radius: 7px;
}

.brand strong { color: #fff; }
.brand small { color: #bdcbd3; }

.nav { gap: 4px; }
.nav button {
  min-height: 44px;
  padding: 10px 12px;
  color: #dce5ea;
  border: 0;
  border-radius: 6px;
  background: transparent;
  font-weight: 600;
  text-align: left;
}
.nav button:hover { color: #fff; background: var(--hub-nav-hover); }
.nav button.active {
  color: #fff;
  background: #2a5b4d;
  box-shadow: inset 3px 0 0 #65b89f;
}

.sidebar-messages,
.config {
  border-color: #3b6758;
  background: #21483e;
  box-shadow: none;
}

.sidebar-message {
  border-color: #467061;
  background: #295548;
  box-shadow: none;
}

.sidebar-message p,
.sidebar-message small,
.config { color: #d3dee4; }

.main,
body[data-view="dashboard"] .main { background: var(--hub-canvas); }

.topbar,
body[data-view="dashboard"] .topbar {
  min-height: 76px;
  padding: 16px 24px;
  border-bottom: 1px solid var(--hub-border);
  background: #fff;
  box-shadow: none;
}

.topbar h1 { color: var(--hub-text); font-size: 25px; font-weight: 700; }
.topbar p { color: var(--hub-muted); }
.user-box > span { color: var(--hub-muted); }

.main > .view,
.main > .mobile-sidebar-tools { max-width: 1520px; margin-inline: auto; }

.primary,
body[data-view="dashboard"] .primary {
  color: #fff;
  border-color: var(--hub-primary);
  border-radius: 6px;
  background: var(--hub-primary);
  box-shadow: none;
}

.primary:hover,
body[data-view="dashboard"] .primary:hover {
  color: #fff;
  border-color: var(--hub-primary-hover);
  background: var(--hub-primary-hover);
}

.secondary,
.ghost,
.icon-button {
  color: var(--hub-text);
  border-color: var(--hub-border-strong);
  border-radius: 6px;
  background: #fff;
  box-shadow: none;
}

.secondary:hover,
.ghost:hover,
.icon-button:hover {
  color: var(--hub-info);
  border-color: var(--hub-info);
  background: #f8fbfc;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible,
body[data-view="dashboard"] button:focus-visible,
body[data-view="dashboard"] select:focus-visible,
body[data-view="dashboard"] a:focus-visible {
  outline: 3px solid rgba(0, 110, 120, .3);
  outline-offset: 2px;
}

.panel,
.stat {
  border-color: var(--hub-border);
  border-radius: 8px;
  background: #fff;
  box-shadow: none;
}

.panel-title h2,
.dashboard-section-heading h2 { color: var(--hub-text); }
.panel-title span,
.panel-title p,
.meta { color: var(--hub-muted); }

.tag { color: #39505e; background: #edf2f4; }
.tag.green { color: #006b55; background: #dff3ed; }
.tag.purple { color: #245446; background: var(--hub-ai-soft); }
.tag.amber { color: var(--hub-warning); background: var(--hub-warning-soft); }
.tag.red { color: var(--hub-danger); background: var(--hub-danger-soft); }

input,
select,
textarea,
.toolbar input,
.toolbar select,
.inline-form input,
.inline-form select,
.form-grid input,
.form-grid select,
.form-grid textarea {
  color: var(--hub-text);
  border-color: var(--hub-border-strong);
  border-radius: 6px;
  background: #fff;
}

/* Homepage */
body[data-view="dashboard"] .dashboard-workflow {
  --dashboard-ink: var(--hub-text);
  --dashboard-muted: var(--hub-muted);
  --dashboard-line: var(--hub-border);
  --dashboard-green: var(--hub-primary);
  --dashboard-green-dark: var(--hub-info);
  --dashboard-warning-bg: var(--hub-warning-soft);
  --dashboard-warning-ink: var(--hub-warning);
  --dashboard-danger-bg: var(--hub-danger-soft);
  --dashboard-danger-ink: var(--hub-danger);
  --dashboard-info-bg: var(--hub-info-soft);
  --dashboard-info-ink: var(--hub-info);
  gap: 16px;
  padding: 20px 24px 36px;
}

body[data-view="dashboard"] .dashboard-workflow > .panel,
body[data-view="dashboard"] .dashboard-sales-section {
  padding: 20px;
  border-color: var(--hub-border);
  border-radius: 8px;
}

body[data-view="dashboard"] .dashboard-action-panel {
  border-top: 1px solid var(--hub-border);
  box-shadow: inset 4px 0 0 var(--hub-primary);
}

body[data-view="dashboard"] .dashboard-kicker { color: var(--hub-info); letter-spacing: .04em; }

body[data-view="dashboard"] .dashboard-action-summary > span,
body[data-view="dashboard"] .dashboard-action-reasons > span,
body[data-view="dashboard"] .dashboard-section-status {
  border: 1px solid var(--hub-border);
  border-radius: 999px;
  background: #f5f8fa;
}

body[data-view="dashboard"] .dashboard-action-item { border-color: var(--hub-border); }
body[data-view="dashboard"] .dashboard-action-item .primary { min-height: 44px; }

body[data-view="dashboard"] .dashboard-weekly-panel .customer-card,
body[data-view="dashboard"] .dashboard-reminder-panel .reminder-card,
body[data-view="dashboard"] .dashboard-stats .stat,
body[data-view="dashboard"] .dashboard-stats .stat:first-child,
body[data-view="dashboard"] .dashboard-performance,
body[data-view="dashboard"] .conversion-panel {
  border-color: var(--hub-border);
  border-radius: 6px;
  background: #fff;
}

body[data-view="dashboard"] .dashboard-stats .stat { border-top: 3px solid #9badb7; }
body[data-view="dashboard"] .dashboard-stats .stat:first-child { border-top-color: var(--hub-info); }

/* Customer library */
body[data-view="customers"] .main { background: var(--hub-canvas); }
body[data-view="customers"] #quickAddButton { display: none; }

#customersView { padding: 20px 24px 40px; }

.customer-page-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 16px;
}

.customer-page-heading h2 {
  margin: 2px 0 4px;
  color: var(--hub-text);
  font-size: 24px;
}

.customer-page-heading p { margin: 0; color: var(--hub-muted); }
.customer-page-heading .workspace-eyebrow { color: var(--hub-info); letter-spacing: .04em; }

#customersView .import-panel,
#customersView .assign-panel,
#customersView .public-pool-panel {
  padding: 14px 16px;
  border-radius: 6px;
  background: #fff;
}

#customersView .toolbar {
  grid-template-columns: minmax(220px, 1.6fr) repeat(6, minmax(108px, .7fr)) auto;
  gap: 8px;
  margin: 0;
  padding: 14px;
  border: 1px solid var(--hub-border);
  border-bottom: 0;
  border-radius: 8px 8px 0 0;
  background: #fff;
}

#customersView .customer-table {
  gap: 0;
  overflow: hidden;
  border: 1px solid var(--hub-border);
  border-radius: 0 0 8px 8px;
  background: #fff;
}

#customersView .table-row {
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  padding: 14px 16px;
  border: 0;
  border-bottom: 1px solid var(--hub-border);
  border-radius: 0;
  background: #fff;
  box-shadow: none;
}

#customersView .table-row:last-child { border-bottom: 0; }
#customersView .table-row:hover { background: #f7fafb; }
#customersView .table-row.pending-row { box-shadow: inset 3px 0 0 var(--hub-warning); }
#customersView .customer-primary { color: #1f5164; font-size: 15px; }
#customersView .follow-summary span { border: 0; border-radius: 0; background: transparent; padding: 0; }
#customersView .row-actions .primary { min-width: 72px; }

.customer-pager {
  margin-top: 14px;
  color: var(--hub-muted);
}

/* Existing overlays: visual unification only; opening rules and business flow stay unchanged. */
.task-action-overlay,
.modal,
.ai-execution-overlay {
  background: rgba(24, 60, 53, .56);
  backdrop-filter: none;
}

.task-action-modal,
.modal-card {
  position: relative;
  color: var(--hub-text);
  border: 1px solid var(--hub-border);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 18px 48px rgba(24, 60, 53, .18);
}

.task-action-head > span { color: var(--hub-info); }
.task-action-close {
  position: absolute;
  top: 16px;
  right: 16px;
  left: auto;
  z-index: 2;
  width: 40px;
  min-width: 40px;
  height: 40px;
  border-color: var(--hub-border);
  background: #fff;
}
.task-action-head { padding-right: 48px; }

@media (max-width: 960px) {
  .shell { display: block; }
  .sidebar,
  body[data-view="dashboard"] .sidebar {
    position: static;
    display: grid;
    gap: 10px;
    padding: 12px 16px;
  }
  .nav { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .nav button { text-align: center; }
  #customersView .toolbar { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  #customersView .toolbar > :first-child { grid-column: 1 / -1; }
}

@media (max-width: 767px) {
  .topbar,
  body[data-view="dashboard"] .topbar { min-height: 0; padding: 12px; }
  .topbar h1 { font-size: 22px; }
  .nav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  body[data-view="dashboard"] .dashboard-workflow,
  #customersView { padding: 12px; }
  .customer-page-heading { align-items: stretch; flex-direction: column; }
  .customer-page-heading .primary { width: 100%; min-height: 44px; }
  #customersView .toolbar { grid-template-columns: 1fr 1fr; padding: 10px; }
  #customersView .toolbar > :first-child { grid-column: 1 / -1; }
  #customersView .table-row { grid-template-columns: minmax(0, 1fr); gap: 10px; padding: 14px; }
  #customersView .row-check { position: absolute; }
  #customersView .row-actions { justify-content: stretch; }
  #customersView .row-actions button { min-height: 44px; flex: 1 1 auto; }
  .task-action-modal,
  .modal-card { width: calc(100vw - 20px); max-height: calc(100dvh - 20px); border-radius: 10px; }
}

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

/* Pipeline CRM-inspired sales workspace — latest approved visual world. */
:root {
  --pipe-blue: #147cb8;
  --pipe-blue-hover: #0f679b;
  --pipe-blue-soft: #eaf4fa;
  --pipe-green: #22a06b;
  --pipe-green-soft: #e8f6ef;
  --pipe-canvas: #f6f8fb;
  --pipe-surface: #ffffff;
  --pipe-border: #e2e8ee;
  --pipe-border-strong: #c9d3db;
  --pipe-text: #243746;
  --pipe-muted: #6b7d8a;
  --pipe-nav-active: #eef1f4;
  --green: var(--pipe-green);
  --green-dark: #167a50;
  --green-soft: var(--pipe-green-soft);
  --purple: var(--pipe-blue);
  --purple-dark: var(--pipe-blue-hover);
  --purple-soft: var(--pipe-blue-soft);
}

html,
body,
.main,
body[data-view="dashboard"] .main { background: var(--pipe-canvas); }

body { color: var(--pipe-text); }

.shell { grid-template-columns: 220px minmax(0, 1fr); }

.sidebar,
body[data-view="dashboard"] .sidebar {
  color: var(--pipe-text);
  background: #fff;
  border-right: 1px solid var(--pipe-border);
}

.brand > span {
  color: #fff;
  background: var(--pipe-blue);
}

.brand strong { color: var(--pipe-text); }
.brand small { color: var(--pipe-muted); }

.nav button {
  color: #526574;
  background: transparent;
}
.nav button:hover { color: var(--pipe-text); background: #f6f8fa; }
.nav button.active {
  color: var(--pipe-text);
  background: var(--pipe-nav-active);
  box-shadow: inset 3px 0 0 var(--pipe-blue);
}

.sidebar-messages,
.config {
  color: var(--pipe-text);
  border-color: var(--pipe-border);
  background: #f8fafc;
}

.sidebar-section-title,
.sidebar-section-title strong { color: var(--pipe-text); }
.sidebar-message {
  color: var(--pipe-text);
  border-color: var(--pipe-border);
  background: #fff;
}
.sidebar-message p,
.sidebar-message small,
.config { color: var(--pipe-muted); }
.sidebar-message.green { border-left-color: var(--pipe-green); }
.sidebar-message.amber { border-left-color: #c98a18; }
.sidebar-message.red { border-left-color: #c43d3d; }

.topbar,
body[data-view="dashboard"] .topbar {
  min-height: 68px;
  border-color: var(--pipe-border);
  background: #fff;
}

.primary,
body[data-view="dashboard"] .primary {
  color: #fff;
  border-color: var(--pipe-blue);
  border-radius: 5px;
  background: var(--pipe-blue);
}
.primary:hover,
body[data-view="dashboard"] .primary:hover {
  color: #fff;
  border-color: var(--pipe-blue-hover);
  background: var(--pipe-blue-hover);
}

.secondary,
.ghost,
.icon-button {
  color: var(--pipe-text);
  border-color: var(--pipe-border-strong);
  border-radius: 5px;
  background: #fff;
}
.secondary:hover,
.ghost:hover,
.icon-button:hover {
  color: var(--pipe-blue-hover);
  border-color: var(--pipe-blue);
  background: #fff;
}

.panel,
.stat {
  border-color: var(--pipe-border);
  border-radius: 6px;
  background: #fff;
}

.tag.green { color: #167a50; background: var(--pipe-green-soft); }
.tag.purple { color: #126b9d; background: var(--pipe-blue-soft); }

body[data-view="dashboard"] .dashboard-workflow {
  --dashboard-green: var(--pipe-blue);
  --dashboard-green-dark: var(--pipe-blue-hover);
  --dashboard-info-bg: var(--pipe-blue-soft);
  --dashboard-info-ink: #126b9d;
}

body[data-view="dashboard"] .dashboard-action-panel {
  border-top: 1px solid var(--pipe-border);
  box-shadow: none;
}

body[data-view="dashboard"] .dashboard-action-panel::before {
  content: "";
  display: block;
  height: 3px;
  margin: -20px -20px 16px;
  background: var(--pipe-blue);
  border-radius: 6px 6px 0 0;
}

body[data-view="dashboard"] .dashboard-kicker,
.workspace-eyebrow { color: var(--pipe-blue-hover); }

body[data-view="dashboard"] .dashboard-weekly-panel .customer-card,
body[data-view="dashboard"] .dashboard-reminder-panel .reminder-card,
body[data-view="dashboard"] .dashboard-stats .stat,
body[data-view="dashboard"] .dashboard-stats .stat:first-child,
body[data-view="dashboard"] .dashboard-performance,
body[data-view="dashboard"] .conversion-panel {
  border-color: var(--pipe-border);
  background: #fff;
}

body[data-view="dashboard"] .dashboard-stats .stat { border-top-color: var(--pipe-border-strong); }
body[data-view="dashboard"] .dashboard-stats .stat:first-child { border-top-color: var(--pipe-green); }

#customersView .toolbar,
#customersView .customer-table,
#customersView .table-row,
#customersView .import-panel,
#customersView .assign-panel,
#customersView .public-pool-panel { border-color: var(--pipe-border); }

#customersView .customer-primary { color: var(--pipe-blue-hover); }
#customersView .table-row:hover { background: #f8fafc; }

.task-action-overlay,
.modal,
.ai-execution-overlay {
  background: rgba(36, 55, 70, .46);
}

.task-action-modal,
.modal-card {
  border-color: var(--pipe-border);
  border-radius: 8px;
  box-shadow: 0 16px 42px rgba(36, 55, 70, .16);
}

.task-action-head > span { color: var(--pipe-blue-hover); }

.login-screen { background: #eef4f8; }
.login-card { border-color: var(--pipe-border); box-shadow: 0 18px 48px rgba(36, 55, 70, .16); }
.login-brand > span { color: #fff; background: var(--pipe-blue); }
.setup-box { border-color: #cfe2ee; background: var(--pipe-blue-soft); }

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible {
  outline-color: rgba(20, 124, 184, .32);
}

@media (max-width: 960px) {
  .sidebar,
  body[data-view="dashboard"] .sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--pipe-border);
  }
}

/* Final approved HubSpot-inspired B2B CRM workbench, 2026-07-29.
   THESIS: action-first operating surface; refuse the report-first card wall.
   OWN-WORLD: graphite command chrome, light gray canvas, white records, one green action color.
   STORY: act today, check exceptions, review results, then advance the pipeline.
   FIRST VIEWPORT: command bar and rail frame a two-column action and notification workspace.
   FORM: dense desktop operations console derived from the approved static prototype. */
:root {
  --crm-chrome: #303030;
  --crm-chrome-raised: #454545;
  --crm-canvas: #f2f3f3;
  --crm-surface: #ffffff;
  --crm-surface-soft: #f7f8f8;
  --crm-line: #d9dddb;
  --crm-line-strong: #b9c0bd;
  --crm-ink: #252525;
  --crm-muted: #626262;
  --crm-primary: #176b57;
  --crm-primary-hover: #105746;
  --crm-primary-soft: #e5f2ed;
  --crm-warning: #85510a;
  --crm-warning-soft: #fff0ce;
  --crm-danger: #a43832;
  --crm-danger-soft: #fde8e5;
  --crm-info: #37616e;
  --crm-info-soft: #e7f0f3;
  --green: var(--crm-primary);
  --green-dark: var(--crm-primary-hover);
  --green-soft: var(--crm-primary-soft);
  --purple: var(--crm-primary);
  --purple-dark: var(--crm-primary-hover);
  --purple-soft: var(--crm-primary-soft);
}

html,
body,
.main,
body[data-view="dashboard"] .main {
  color: var(--crm-ink);
  background: var(--crm-canvas);
}

.global-commandbar {
  display: none;
}

.primary,
body[data-view="dashboard"] .primary {
  color: #fff;
  border-color: var(--crm-primary);
  border-radius: 7px;
  background: var(--crm-primary);
}

.primary:hover,
body[data-view="dashboard"] .primary:hover {
  color: #fff;
  border-color: var(--crm-primary-hover);
  background: var(--crm-primary-hover);
}

.secondary,
.ghost,
.icon-button {
  color: var(--crm-ink);
  border-color: var(--crm-line-strong);
  border-radius: 7px;
  background: #fff;
}

.secondary:hover,
.ghost:hover,
.icon-button:hover {
  color: var(--crm-primary-hover);
  border-color: var(--crm-primary);
  background: #fff;
}

.panel,
.stat {
  border-color: var(--crm-line);
  border-radius: 10px;
  background: #fff;
  box-shadow: none;
}

.tag.green,
.tag.purple { color: #205b49; background: var(--crm-primary-soft); }
.tag.amber { color: var(--crm-warning); background: var(--crm-warning-soft); }
.tag.red { color: var(--crm-danger); background: var(--crm-danger-soft); }

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible,
body[data-view="dashboard"] button:focus-visible,
body[data-view="dashboard"] select:focus-visible,
body[data-view="dashboard"] a:focus-visible {
  outline: 3px solid rgba(47, 143, 106, .3);
  outline-offset: 2px;
}

body[data-view="dashboard"] .dashboard-workflow {
  --dashboard-ink: var(--crm-ink);
  --dashboard-muted: var(--crm-muted);
  --dashboard-line: var(--crm-line);
  --dashboard-green: var(--crm-primary);
  --dashboard-green-dark: var(--crm-primary-hover);
  --dashboard-warning-bg: var(--crm-warning-soft);
  --dashboard-warning-ink: var(--crm-warning);
  --dashboard-danger-bg: var(--crm-danger-soft);
  --dashboard-danger-ink: var(--crm-danger);
  --dashboard-info-bg: var(--crm-info-soft);
  --dashboard-info-ink: var(--crm-info);
}

.dashboard-start-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 16px;
  align-items: start;
}

.dashboard-start-main,
.dashboard-start-aside {
  min-width: 0;
  display: grid;
  gap: 16px;
}

body[data-view="dashboard"] .dashboard-workflow > .dashboard-start-layout .panel,
body[data-view="dashboard"] .dashboard-workflow > .panel,
body[data-view="dashboard"] .dashboard-sales-section {
  margin: 0;
  padding: 18px;
  border: 1px solid var(--crm-line);
  border-radius: 10px;
  background: #fff;
  box-shadow: none;
}

body[data-view="dashboard"] .dashboard-action-panel {
  border-top: 1px solid var(--crm-line);
  box-shadow: inset 4px 0 0 var(--crm-primary);
}

body[data-view="dashboard"] .dashboard-action-panel::before { display: none; }
body[data-view="dashboard"] .dashboard-kicker,
.workspace-eyebrow { color: var(--crm-primary-hover); }

body[data-view="dashboard"] .dashboard-action-summary > span,
body[data-view="dashboard"] .dashboard-action-reasons > span,
body[data-view="dashboard"] .dashboard-section-status {
  border: 1px solid var(--crm-line);
  border-radius: 999px;
  background: var(--crm-surface-soft);
}

body[data-view="dashboard"] .dashboard-action-list {
  grid-template-columns: 1fr;
}

body[data-view="dashboard"] .dashboard-action-item {
  padding: 13px 0;
  border-color: #e7e9e8;
}

body[data-view="dashboard"] .dashboard-action-item:last-child { border-bottom: 0; }
body[data-view="dashboard"] .dashboard-action-item .primary { min-height: 44px; }

body[data-view="dashboard"] .dashboard-weekly-panel .list {
  grid-template-columns: 1fr;
  gap: 0;
}

body[data-view="dashboard"] .dashboard-weekly-panel .customer-card {
  border: 0;
  border-bottom: 1px solid #e7e9e8;
  border-radius: 0;
  background: #fff;
}

body[data-view="dashboard"] .dashboard-weekly-panel .customer-card:last-child { border-bottom: 0; }

.dashboard-notification-panel {
  gap: 0;
  padding: 0;
  overflow: hidden;
  color: var(--crm-ink);
  border: 1px solid var(--crm-line);
  border-radius: 10px;
  background: #fff;
}

.dashboard-notification-panel .sidebar-section-title {
  min-height: 61px;
  padding: 12px 14px;
  color: var(--crm-ink);
  border-bottom: 1px solid var(--crm-line);
}

.dashboard-notification-panel .sidebar-section-title::before {
  content: "●";
  margin-right: 8px;
  color: #6f4e8e;
}

.dashboard-notification-panel .sidebar-section-title strong { margin-right: auto; color: var(--crm-ink); }

.dashboard-notification-panel .message-title-actions button {
  min-height: 44px;
  color: var(--crm-primary-hover);
  border: 0;
  border-radius: 6px;
  background: transparent;
  box-shadow: none;
}

.dashboard-notification-panel .message-title-actions button:hover {
  transform: none;
  color: var(--crm-primary);
  background: var(--crm-primary-soft);
  box-shadow: none;
}

.dashboard-notification-panel .message-title-actions #messageCount {
  min-width: 22px;
  height: 22px;
  color: #fff;
  background: var(--crm-primary);
}

.dashboard-notification-panel .sidebar-message-list {
  gap: 0;
  max-height: 470px;
  padding: 0 13px;
}

.dashboard-notification-panel .sidebar-message {
  gap: 5px;
  padding: 12px 0 11px;
  color: var(--crm-ink);
  border: 0;
  border-bottom: 1px solid #e7e9e8;
  border-radius: 0;
  background: #fff;
}

.dashboard-notification-panel .sidebar-message:last-child { border-bottom: 0; }
.dashboard-notification-panel .sidebar-message::before {
  content: "●";
  float: left;
  color: #7d909a;
  font-size: 10px;
}
.dashboard-notification-panel .sidebar-message.red::before { color: #d45b50; }
.dashboard-notification-panel .sidebar-message.amber::before { color: #d28a31; }
.dashboard-notification-panel .sidebar-message.green::before { color: var(--crm-primary); }
.dashboard-notification-panel .sidebar-message p,
.dashboard-notification-panel .sidebar-message small { color: var(--crm-muted); }
.dashboard-notification-panel .sidebar-empty { padding: 18px 0; color: var(--crm-muted); }

body[data-view="dashboard"] .dashboard-reminder-panel .reminder-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
}

body[data-view="dashboard"] .dashboard-reminder-panel .reminder-card {
  min-height: 104px;
  border: 0;
  border-right: 1px solid var(--crm-line);
  border-bottom: 1px solid var(--crm-line);
  border-radius: 0;
  background: #fff;
}

body[data-view="dashboard"] .dashboard-reminder-panel .reminder-card:nth-child(3n) { border-right: 0; }
body[data-view="dashboard"] .dashboard-reminder-panel .reminder-card:nth-last-child(-n + 3) { border-bottom: 0; }

body[data-view="dashboard"] .dashboard-stats {
  grid-template-columns: repeat(7, minmax(110px, 1fr));
  gap: 0;
  overflow-x: auto;
  border: 1px solid var(--crm-line);
  border-radius: 9px;
  background: #fff;
}

body[data-view="dashboard"] .dashboard-stats .stat,
body[data-view="dashboard"] .dashboard-stats .stat:first-child {
  min-height: 92px;
  border: 0;
  border-right: 1px solid var(--crm-line);
  border-radius: 0;
  background: #fff;
}

body[data-view="dashboard"] .dashboard-stats .stat:last-child { border-right: 0; }

body[data-view="dashboard"] .dashboard-sales-grid {
  grid-template-columns: minmax(280px, .72fr) minmax(0, 1.28fr);
  gap: 14px;
}

body[data-view="dashboard"] .dashboard-performance,
body[data-view="dashboard"] .conversion-panel {
  border-color: var(--crm-line);
  border-radius: 9px;
  background: #fff;
}

body[data-view="dashboard"] .dashboard-pipeline-panel {
  padding-inline: 18px;
  overflow: hidden;
}

body[data-view="dashboard"] .pipeline-board {
  gap: 0;
  overflow-x: auto;
  border: 1px solid var(--crm-line);
  border-radius: 9px;
  background: #fafbfa;
}

body[data-view="dashboard"] .pipeline-column {
  min-width: 210px;
  border-right: 1px solid var(--crm-line);
  border-radius: 0;
  background: #fafbfa;
}

body[data-view="dashboard"] .pipeline-column:last-child { border-right: 0; }

/* Unified interruption layer: ordinary form, danger confirmation and AI job state. */
.task-action-overlay,
.modal,
.ai-execution-overlay {
  background: rgba(32, 35, 34, .72);
  backdrop-filter: none;
}

.task-action-modal,
.modal-card {
  color: var(--crm-ink);
  border: 1px solid var(--crm-line);
  border-radius: 13px;
  background: #fff;
  box-shadow: 0 18px 52px rgba(0, 0, 0, .18);
}

.task-action-head > span { color: var(--crm-primary-hover); }
.task-action-close {
  top: 16px;
  right: 16px;
  width: 40px;
  min-width: 40px;
  height: 40px;
  color: var(--crm-ink);
  border-color: var(--crm-line);
  border-radius: 8px;
  background: #fff;
}

.login-screen { background: var(--crm-chrome); }
.login-card { border-color: var(--crm-line); box-shadow: 0 18px 52px rgba(0, 0, 0, .18); }
.login-brand > span { color: #fff; background: var(--crm-primary); }
.setup-box { border-color: #cfe2da; background: #eef6f2; }

@media (min-width: 961px) {
  .shell {
    min-height: 100vh;
    grid-template-columns: 56px minmax(0, 1fr);
    grid-template-rows: 52px minmax(0, 1fr);
    background: var(--crm-canvas);
  }

  .global-commandbar {
    grid-column: 1 / -1;
    grid-row: 1;
    z-index: 60;
    min-width: 0;
    padding: 0 16px 0 14px;
    display: flex;
    align-items: center;
    gap: 20px;
    color: #f6f6f6;
    background: var(--crm-chrome);
  }

  .global-product {
    min-width: 140px;
    display: flex;
    align-items: center;
    gap: 10px;
  }

  .global-product > span {
    width: 25px;
    height: 25px;
    display: grid;
    place-items: center;
    color: #fff;
    border: 2px solid #ff6b3d;
    border-radius: 7px 3px 7px 3px;
    font-size: 11px;
    font-weight: 800;
  }

  .global-product strong { font-size: 13px; }
  .global-context {
    min-width: 0;
    flex: 1 1 auto;
    display: flex;
    align-items: baseline;
    gap: 10px;
  }
  .global-context span { font-weight: 700; }
  .global-context small { color: #bfc3c1; }
  .global-utilities { display: flex; align-items: center; gap: 8px; color: #d6d9d7; font-size: 12px; }
  .global-utilities b { color: #65b89f; font-size: 9px; }

  .sidebar,
  body[data-view="dashboard"] .sidebar {
    grid-column: 1;
    grid-row: 2;
    position: sticky;
    top: 0;
    min-width: 56px;
    width: 56px;
    height: calc(100vh - 52px);
    padding: 11px 7px;
    gap: 10px;
    overflow: visible;
    color: #e9ecea;
    border: 0;
    border-right: 1px solid #3d3d3d;
    background: var(--crm-chrome);
  }

  .sidebar .brand { display: none; }
  .sidebar .nav { gap: 7px; }
  .sidebar .nav button {
    position: relative;
    width: 42px;
    min-width: 42px;
    height: 42px;
    min-height: 42px;
    padding: 0;
    overflow: hidden;
    color: transparent;
    border: 0;
    border-radius: 9px;
    background: transparent;
    font-size: 0;
    text-align: center;
  }

  .sidebar .nav button::before {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    color: #bdc2bf;
    font-size: 16px;
    font-weight: 700;
  }

  .sidebar .nav button:nth-child(1)::before { content: "⌂"; }
  .sidebar .nav button:nth-child(2)::before { content: "▤"; }
  .sidebar .nav button:nth-child(3)::before { content: "+"; }
  .sidebar .nav button:nth-child(4)::before { content: "◇"; }
  .sidebar .nav button:hover { background: #3d3d3d; }
  .sidebar .nav button.active {
    color: transparent;
    background: #454545;
    box-shadow: none;
  }
  .sidebar .nav button.active::before { color: #fff; }

  .sidebar .config {
    width: 42px;
    min-height: 42px;
    margin-top: auto;
    padding: 0;
    overflow: hidden;
    color: transparent;
    border: 0;
    border-radius: 9px;
    background: #3d3d3d;
    font-size: 0;
  }
  .sidebar .config::before {
    content: "···";
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    color: #bdc2bf;
    font-size: 15px;
    letter-spacing: 2px;
  }

  .main,
  body[data-view="dashboard"] .main {
    grid-column: 2;
    grid-row: 2;
    min-width: 0;
    padding: 0 16px 28px;
    background: var(--crm-canvas);
  }

  .topbar,
  body[data-view="dashboard"] .topbar {
    min-height: 112px;
    margin: 16px auto 0;
    padding: 20px 24px 17px;
    border: 0;
    border-bottom: 1px solid var(--crm-line);
    border-radius: 14px 14px 0 0;
    background: #fff;
    box-shadow: none;
  }

  .topbar h1 { color: var(--crm-ink); font-size: 25px; letter-spacing: -.02em; }
  .topbar p,
  .user-box > span { color: var(--crm-muted); }

  .main > .topbar,
  .main > .view,
  .main > .mobile-sidebar-tools {
    width: min(100%, 1510px);
    max-width: 1510px;
    margin-inline: auto;
  }

  .main > .view {
    border-radius: 0 0 14px 14px;
    background: #fff;
  }

  body[data-view="dashboard"] .dashboard-workflow {
    gap: 16px;
    padding: 18px 22px 28px;
  }

  body:not([data-view="dashboard"]) .main > .view { padding: 20px 24px 40px; }
  #customersView { padding: 20px 24px 40px; }
}

@media (max-width: 1199px) and (min-width: 961px) {
  .dashboard-start-layout { grid-template-columns: minmax(0, 1fr) 280px; }
  body[data-view="dashboard"] .dashboard-stats { grid-template-columns: repeat(4, minmax(125px, 1fr)); }
  body[data-view="dashboard"] .dashboard-reminder-panel .reminder-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  body[data-view="dashboard"] .dashboard-reminder-panel .reminder-card:nth-child(3n) { border-right: 1px solid var(--crm-line); }
  body[data-view="dashboard"] .dashboard-reminder-panel .reminder-card:nth-child(2n) { border-right: 0; }
}

@media (max-width: 960px) {
  .dashboard-start-layout { grid-template-columns: 1fr; }
  .dashboard-start-aside { grid-template-columns: 1fr; }
  body[data-view="dashboard"] .dashboard-workflow > .dashboard-start-layout .panel { padding: 18px; }
  body[data-view="dashboard"] .dashboard-sales-grid { grid-template-columns: 1fr; }
  body[data-view="dashboard"] .dashboard-stats,
  body[data-view="dashboard"] .pipeline-board { min-width: 0; max-width: 100%; }
  body[data-view="dashboard"] .conversion-panel { min-width: 0; }
  body[data-view="dashboard"] .conversion-filter-popover {
    right: 0;
    left: auto;
    width: min(290px, calc(100vw - 40px));
  }
}

/* Homepage density pass: results first, named navigation, and concise paged action queues. */
body[data-view="dashboard"] .dashboard-sales-section { order: -2; }
body[data-view="dashboard"] .dashboard-start-layout { order: -1; }

.dashboard-list-pager {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding-top: 10px;
  border-top: 1px solid var(--crm-line);
  color: var(--crm-muted);
  font-size: 12px;
}

.dashboard-list-pager button { min-height: 44px !important; padding: 6px 10px; }

@media (min-width: 961px) {
  .shell { grid-template-columns: 236px minmax(0, 1fr); }

  .sidebar,
  body[data-view="dashboard"] .sidebar {
    min-width: 236px;
    width: 236px;
    padding: 15px 12px 14px;
    gap: 12px;
    overflow-y: auto;
  }

  .sidebar .brand { display: none; }
  .sidebar .nav { display: grid; gap: 4px; }
  .sidebar .nav button,
  .sidebar .nav button.active {
    width: 100%;
    min-width: 0;
    height: 44px;
    min-height: 44px;
    padding: 0 12px 0 42px;
    overflow: visible;
    color: #e9ecea;
    border-radius: 7px;
    background: transparent;
    font-size: 14px;
    font-weight: 650;
    text-align: left;
  }

  .sidebar .nav button::before {
    inset: 0 auto 0 12px;
    width: 18px;
    color: #bdc2bf;
    font-size: 15px;
  }

  .sidebar .nav button:hover { background: #3d3d3d; }
  .sidebar .nav button.active { color: #fff; background: #454545; }
  .sidebar .nav button.active::before { color: #fff; }

  .sidebar > .dashboard-notification-panel {
    display: grid;
    min-height: 0;
    margin-top: 8px;
    color: var(--crm-ink);
    border-color: #4b4b4b;
    background: #fff;
  }

  .sidebar > .dashboard-notification-panel .sidebar-message-list { max-height: calc(100vh - 330px); }
  .sidebar .config { display: none !important; }

  body[data-view="dashboard"] .dashboard-start-layout {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  .dashboard-start-main { display: contents; }
  .dashboard-start-aside { display: none; }

  body[data-view="dashboard"] .dashboard-workflow > .dashboard-start-layout .panel { padding: 15px; }
  body[data-view="dashboard"] .dashboard-section-heading { padding-bottom: 10px; }
  body[data-view="dashboard"] .dashboard-section-heading h2,
  body[data-view="dashboard"] .panel-title h2 { font-size: 18px; }
  body[data-view="dashboard"] .dashboard-section-heading p,
  body[data-view="dashboard"] .panel-title p { font-size: 12px; line-height: 1.4; }
  body[data-view="dashboard"] .dashboard-action-item { gap: 10px; padding: 9px 0; }
  body[data-view="dashboard"] .dashboard-action-copy { gap: 4px; }
  body[data-view="dashboard"] .dashboard-action-copy > strong { font-size: 13px; }
  body[data-view="dashboard"] .dashboard-action-copy > span { font-size: 12px; }
  body[data-view="dashboard"] .dashboard-action-item .primary { min-height: 44px; padding: 6px 10px; font-size: 12px; }
  body[data-view="dashboard"] .dashboard-weekly-panel .customer-card { padding: 9px 0; }
  body[data-view="dashboard"] .dashboard-weekly-panel .customer-card .follow-summary { display: grid; gap: 4px; }
  body[data-view="dashboard"] .dashboard-weekly-panel .customer-card .meta { font-size: 11px; }
  body[data-view="dashboard"] .dashboard-weekly-panel .customer-primary { font-size: 13px; }

  body[data-view="dashboard"] .dashboard-sales-section { padding: 16px; gap: 10px; }
  body[data-view="dashboard"] .dashboard-sales-section .dashboard-section-heading { align-items: center; }
  body[data-view="dashboard"] .dashboard-stats {
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 8px;
    overflow: visible;
    border: 0;
    background: transparent;
  }

  body[data-view="dashboard"] .dashboard-stats .stat,
  body[data-view="dashboard"] .dashboard-stats .stat:first-child {
    min-height: 104px;
    padding: 14px;
    border: 1px solid var(--crm-line);
    border-radius: 8px;
    background: var(--crm-surface-soft);
  }

  body[data-view="dashboard"] .dashboard-sales-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 10px; align-items: start; }
  body[data-view="dashboard"] .dashboard-performance,
  body[data-view="dashboard"] .conversion-panel { padding: 13px; }
  body[data-view="dashboard"] .dashboard-performance #performanceStats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0 12px;
  }

  body[data-view="dashboard"] .dashboard-performance .performance-range,
  body[data-view="dashboard"] .dashboard-performance .performance-section-title,
  body[data-view="dashboard"] .dashboard-performance .performance-advice { grid-column: 1 / -1; }
  body[data-view="dashboard"] .dashboard-performance .performance-row { padding: 6px 0; }
  body[data-view="dashboard"] .conversion-metrics { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
  body[data-view="dashboard"] .conversion-metrics article { min-height: 76px; padding: 8px; }
}

@media (max-width: 960px) {
  body[data-view="dashboard"] .dashboard-sales-section,
  body[data-view="dashboard"] .dashboard-start-layout { order: initial; }
}

/* Results review has two deliberate rows: conversion diagnosis, then the complete result ledger. */
body[data-view="dashboard"] .dashboard-sales-section {
  display: grid;
  gap: 12px;
  padding: 0;
  border: 0;
  background: transparent;
}

body[data-view="dashboard"] .dashboard-sales-section > .dashboard-section-heading {
  padding: 0 2px 2px;
  border-bottom: 0;
}

.dashboard-sales-conversion-row,
.dashboard-sales-result-row {
  padding: 16px;
  border: 1px solid var(--crm-line);
  border-radius: 10px;
  background: #fff;
}

.dashboard-sales-conversion-row .conversion-panel {
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
}

.dashboard-sales-row-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 12px;
  padding-bottom: 11px;
  border-bottom: 1px solid var(--crm-line);
}

.dashboard-sales-row-heading h3 {
  margin: 3px 0 4px;
  color: var(--crm-ink);
  font-size: 18px;
  line-height: 1.25;
}

.dashboard-sales-row-heading p {
  margin: 0;
  color: var(--crm-muted);
  font-size: 12px;
}

.dashboard-sales-result-body {
  display: grid;
  grid-template-columns: minmax(360px, .78fr) minmax(0, 1.22fr);
  gap: 16px;
  align-items: start;
}

.dashboard-sales-result-body .dashboard-stats {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  overflow: hidden;
  border: 1px solid var(--crm-line);
  border-radius: 8px;
  background: #fff;
}

.dashboard-sales-result-body .dashboard-stats .stat,
.dashboard-sales-result-body .dashboard-stats .stat:first-child {
  min-height: 116px;
  padding: 14px;
  border: 0;
  border-right: 1px solid var(--crm-line);
  border-radius: 0;
  background: var(--crm-surface-soft);
}

.dashboard-sales-result-body .dashboard-stats .stat:last-child { border-right: 0; }

.dashboard-sales-result-body .dashboard-performance {
  min-height: 0;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.dashboard-sales-result-body .dashboard-performance .sidebar-section-title {
  min-height: 36px;
  padding: 0 0 9px;
  border-bottom: 1px solid var(--crm-line);
}

.dashboard-sales-result-body .dashboard-performance #performanceStats {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0 12px;
}

@media (max-width: 960px) {
  .dashboard-sales-result-body { grid-template-columns: 1fr; }
  .dashboard-sales-result-body .dashboard-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* Approved consolidation: one result-review card with two vertically ordered analytic bands. */
body[data-view="dashboard"] .dashboard-sales-section {
  padding: 16px;
  border: 1px solid var(--crm-line);
  border-radius: 10px;
  background: #fff;
}

body[data-view="dashboard"] .dashboard-sales-section > .dashboard-section-heading {
  padding: 0 0 12px;
  border-bottom: 1px solid var(--crm-line);
}

.dashboard-sales-conversion-row,
.dashboard-sales-result-row {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.dashboard-sales-conversion-row {
  padding-bottom: 12px;
  border-bottom: 1px solid var(--crm-line);
}

.dashboard-sales-result-row { padding-top: 2px; }

/* Sales-summary metrics are part of the retained result card, not a second card. */
.dashboard-sales-result-body { grid-template-columns: 1fr; }

.dashboard-sales-result-body .dashboard-performance .dashboard-stats {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  margin: 0 0 12px;
  overflow: visible;
  border: 0;
  border-bottom: 1px solid var(--crm-line);
  border-radius: 0;
  background: transparent;
}

.dashboard-sales-result-body .dashboard-performance .dashboard-stats .stat,
.dashboard-sales-result-body .dashboard-performance .dashboard-stats .stat:first-child {
  min-height: 78px;
  padding: 8px 14px 12px;
  border: 0;
  border-right: 1px solid var(--crm-line);
  border-radius: 0;
  background: transparent;
}

.dashboard-sales-result-body .dashboard-performance .dashboard-stats .stat:first-child { padding-left: 0; }
.dashboard-sales-result-body .dashboard-performance .dashboard-stats .stat:last-child { border-right: 0; }
.dashboard-sales-result-body .dashboard-performance .dashboard-stats .stat small { margin-top: 4px; }

/* The result ledger is intentionally last: review the pipeline before the detailed scorecard. */
body[data-view="dashboard"] .dashboard-sales-result-bottom {
  padding: 18px;
  border: 1px solid var(--crm-line);
  border-radius: 10px;
  background: #fff;
}

/* Content-led twin queues: different list counts, one naturally aligned operating row. */
@media (min-width: 961px) {
  body[data-view="dashboard"] .dashboard-start-layout { align-items: stretch; }
  body[data-view="dashboard"] .dashboard-start-layout .dashboard-action-panel,
  body[data-view="dashboard"] .dashboard-start-layout .dashboard-weekly-panel { height: 100%; }
}

/* Remove stacked separators below the standalone conversion card. */
body[data-view="dashboard"] .dashboard-sales-section { gap: 12px; }
body[data-view="dashboard"] .dashboard-sales-section > .dashboard-section-heading { border-bottom: 0; }
.dashboard-sales-conversion-row { padding-bottom: 0; border-bottom: 0; }

/* The top conversion module stands alone; its former report wrapper is intentionally removed. */
body[data-view="dashboard"] .dashboard-sales-section {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.dashboard-sales-conversion-row {
  padding: 16px;
  border: 1px solid var(--crm-line);
  border-radius: 10px;
  background: #fff;
}

body[data-view="dashboard"] .dashboard-sales-legacy-heading { display: none; }

@media (max-width: 720px) {
  .user-management-list,
  .user-admin-auth {
    grid-template-columns: 1fr;
  }

  .user-admin-auth p {
    grid-column: auto;
  }

  .user-management-main {
    align-items: flex-start;
  }

  .user-management-panel button {
    min-height: 44px;
  }
}
/* Recognition: restrained positive feedback inside the existing Operate surface. */
.recognition-team-panel,.recognition-admin-panel{border:1px solid #d6e0dc;border-radius:14px;background:#fff}
.recognition-team-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:12px}
.recognition-team-grid article{padding:16px;border:1px solid #d6e0dc;border-radius:12px;background:#f8fbfa;display:grid;gap:6px}
.recognition-team-grid strong,.recognition-award h3{color:#173f35;font-size:1rem}
.recognition-team-grid span{color:#087358;font-weight:700}
.recognition-team-grid small,.recognition-award p{color:#53655f;line-height:1.5}
.recognition-popup{width:min(620px,calc(100vw - 32px));max-height:min(760px,calc(100vh - 32px));overflow:auto}
.recognition-awards{display:grid;gap:10px;margin:18px 0}
.recognition-award{display:grid;grid-template-columns:76px 1fr;gap:14px;align-items:start;padding:14px 0;border-bottom:1px solid #d6e0dc}
.recognition-award>span{color:#087358;font-size:.82rem;font-weight:700;padding-top:3px}
.recognition-award h3{margin:0 0 5px}.recognition-award p{margin:0}
.recognition-actions{display:flex;gap:10px;justify-content:flex-end;flex-wrap:wrap}
.recognition-settings-summary{display:flex;gap:10px;flex-wrap:wrap;margin:12px 0 18px}
.recognition-settings-summary span{padding:8px 10px;border-radius:8px;background:#eef5f2;color:#3f544c}
.recognition-admin-list{display:grid;gap:8px}
.recognition-admin-list details{border:1px solid #d6e0dc;border-radius:10px;padding:12px 14px}
.recognition-admin-list summary{display:flex;justify-content:space-between;cursor:pointer;color:#173f35}
.recognition-admin-list details p{display:grid;grid-template-columns:minmax(150px,.8fr) 1.6fr minmax(120px,.7fr);gap:12px;margin:0;padding:10px 0;border-top:1px solid #e4ebe8;color:#42544e}
.recognition-admin-list details div{margin-top:10px}.recognition-admin-list small{color:#64756f}
@media(max-width:640px){.recognition-award{grid-template-columns:1fr;gap:5px}.recognition-admin-list details p{grid-template-columns:1fr;gap:4px}.recognition-actions>*{flex:1}}

/* R8 continuous conversation document */
.conversation-preview-ledger{gap:0;padding:22px 24px;background:#fff;border-color:#d9e3df;border-radius:10px;box-shadow:0 8px 24px rgba(28,63,53,.06)}
.conversation-document-entry{position:relative;padding:14px 6px 15px 18px;border:0;border-left:3px solid #c8d8d2;border-bottom:1px solid #e7eeeb;background:#fff}
.conversation-document-entry:last-child{border-bottom:0}.conversation-document-entry.customer{border-left-color:#6489a2}.conversation-document-entry.salesperson{border-left-color:#17846e}.conversation-document-entry.other,.conversation-document-entry.unknown{border-left-color:#8b7aaa}.conversation-document-entry.batch_review{background:#fffaf0}.conversation-document-entry.blocked{background:#fff6f4;border-left-color:#c84b3d}
.conversation-document-entry header{display:flex;align-items:baseline;justify-content:space-between;gap:16px;margin-bottom:7px}.conversation-document-entry header strong{color:#24352f;font-size:14px}.conversation-document-entry header span{color:#73837d;font-size:12px}.conversation-document-entry p{margin:0;color:#1e2b37;white-space:pre-wrap;overflow-wrap:anywhere;line-height:1.72}.conversation-document-entry footer{margin-top:7px;color:#788982;font-size:11px}.conversation-document-entry.event p{font-style:italic;color:#52655f}
@media(max-width:620px){.conversation-preview-ledger{padding:14px}.conversation-document-entry header{align-items:flex-start;flex-direction:column;gap:2px}}
.editing-draft-recovery{border:1px solid #f0b44d;background:#fffaf0;margin-bottom:16px}.editing-draft-recovery-head h2{margin:4px 0}.editing-draft-recovery-head p{margin:0;color:#6b7280}.editing-draft-recovery-list{display:grid;gap:8px;margin-top:14px}.editing-draft-recovery-list article{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:12px 14px;border:1px solid #eadfc8;border-radius:12px;background:#fff}.editing-draft-recovery-list article div{display:grid;gap:3px}.editing-draft-recovery-list span,.editing-draft-recovery-list small{color:#6b7280}.editing-draft-recovery-list small{font-size:12px}@media(max-width:720px){.editing-draft-recovery-list article{align-items:stretch;flex-direction:column}.editing-draft-recovery-list button{width:100%}}
.conversation-material-list .conversation-image-note{flex-basis:100%;min-width:0;margin:0;padding:8px 0}
.conversation-image-note summary{cursor:pointer;font-weight:600;overflow-wrap:anywhere}
.conversation-image-note p{white-space:pre-wrap;overflow-wrap:anywhere;max-width:72ch;margin:8px 0}
.conversation-image-note small{display:block;color:var(--muted);font-size:12px;line-height:1.6;max-width:78ch}

/* The source-repair form must reflow inside a narrow or zoomed viewport. */
.task-action-modal:has(.conversation-source-repair-notice) { min-width: 0; max-width: 100%; }
.task-action-modal:has(.conversation-source-repair-notice) > * { min-width: 0; overflow-wrap: anywhere; }
.task-action-modal:has(.conversation-source-repair-notice) :is(input, select, textarea) { min-width: 0; max-width: 100%; }
