:root {
  --bg: #f5efe6;
  --surface: rgba(255, 250, 243, 0.88);
  --surface-strong: rgba(255, 251, 245, 0.94);
  --surface-soft: rgba(252, 246, 238, 0.82);
  --ink: #241b18;
  --muted: #6b5d58;
  --line: rgba(64, 38, 26, 0.14);
  --accent: #8a4b3a;
  --accent-dark: #5d2d25;
  --accent-soft: rgba(138, 75, 58, 0.12);
  --shadow: 0 24px 70px rgba(71, 42, 27, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  position: relative;
  margin: 0;
  min-height: 100vh;
  font-family: "Manrope", sans-serif;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(248, 242, 234, 0.9), rgba(241, 233, 223, 0.9)),
    linear-gradient(135deg, rgba(255, 252, 247, 0.58), rgba(223, 204, 185, 0.42)),
    radial-gradient(circle at top right, rgba(181, 138, 82, 0.18), transparent 28%),
    radial-gradient(circle at bottom left, rgba(138, 75, 58, 0.16), transparent 24%),
    url("living-room-background.png") center center / cover fixed no-repeat;
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
}

body::before {
  background:
    radial-gradient(circle at 14% 14%, rgba(255, 255, 255, 0.48), transparent 20%),
    radial-gradient(circle at 84% 10%, rgba(233, 215, 196, 0.42), transparent 24%);
  opacity: 0.92;
}

body::after {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0));
}

.page-shell {
  position: relative;
  z-index: 1;
  width: min(1480px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 64px;
}

.topbar,
.crm-hero,
.crm-summary,
.crm-workspace {
  display: grid;
  gap: 20px;
}

.topbar {
  grid-template-columns: 1fr auto;
  align-items: center;
  margin-bottom: 28px;
}

.brand-block,
.crm-copy,
.crm-status-card,
.crm-card,
.crm-lead-row,
.crm-metric {
  border: 1px solid var(--line);
  border-radius: 26px;
  background: var(--surface);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}

.brand-block,
.crm-copy,
.crm-status-card,
.crm-card {
  padding: 26px;
}

.eyebrow,
.hero-kicker,
.crm-status-label,
.crm-pill,
.crm-detail-grid span {
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 0.74rem;
  color: var(--muted);
  font-weight: 800;
}

.eyebrow,
.hero-kicker {
  margin: 0 0 8px;
}

.brand-block::after,
.crm-copy::after,
.crm-status-card::after,
.crm-card::after,
.crm-metric::after {
  content: "";
  position: absolute;
  inset: 1px 1px auto;
  height: 38%;
  border-radius: 25px 25px 18px 18px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0));
  pointer-events: none;
}

.brand-text,
.crm-copy h1,
.crm-status-card strong,
.crm-metric strong,
.crm-lead-title,
.crm-card-heading h2,
.crm-form-heading h3 {
  font-family: "Cormorant Garamond", serif;
}

.brand-text {
  font-size: 2.2rem;
  font-weight: 700;
}

.topbar-note {
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 600;
}

.crm-shell {
  display: grid;
  gap: 28px;
}

.crm-hero {
  grid-template-columns: 1.2fr 0.8fr;
}

.crm-copy h1 {
  margin: 0 0 14px;
  font-size: clamp(2.7rem, 6vw, 4.7rem);
  line-height: 0.94;
  max-width: 10.5ch;
  text-wrap: balance;
}

.hero-text,
.crm-status-card p,
.crm-lead-subtitle,
.crm-detail-note,
.crm-empty-state {
  color: var(--muted);
  line-height: 1.6;
}

.crm-status-card {
  background: linear-gradient(180deg, rgba(255, 251, 245, 0.98), rgba(231, 220, 206, 0.92));
}

.crm-status-card strong {
  display: block;
  margin: 10px 0 8px;
  font-size: 2rem;
}

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

.crm-metric {
  padding: 20px 22px;
  background: linear-gradient(180deg, rgba(255, 251, 246, 0.96), rgba(241, 230, 218, 0.88));
}

.crm-metric::before {
  content: "";
  position: absolute;
  inset: auto 18px 0 18px;
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(138, 75, 58, 0.95), rgba(201, 164, 118, 0.35));
}

.crm-metric span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.9rem;
}

.crm-metric strong {
  font-size: 2rem;
}

.crm-workspace {
  grid-template-columns: minmax(360px, 0.9fr) minmax(0, 1.4fr);
  align-items: start;
  gap: 24px;
}

.crm-pipeline-card {
  display: grid;
  gap: 20px;
  background: linear-gradient(180deg, rgba(255, 252, 248, 0.97), rgba(238, 228, 216, 0.9));
}

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

.crm-pipeline-column {
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid rgba(64, 38, 26, 0.1);
  border-radius: 24px;
  background: rgba(255, 249, 243, 0.78);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.46);
}

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

.crm-pipeline-head strong {
  display: block;
  font-family: "Cormorant Garamond", serif;
  font-size: 2rem;
}

.crm-pipeline-label {
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 0.72rem;
  color: var(--muted);
  font-weight: 800;
}

.crm-pipeline-filter {
  border: 0;
  border-radius: 999px;
  padding: 9px 14px;
  font: inherit;
  font-weight: 700;
  color: var(--accent-dark);
  background: rgba(138, 75, 58, 0.1);
  cursor: pointer;
  transition: transform 180ms ease, background 180ms ease;
}

.crm-pipeline-filter:hover {
  transform: translateY(-1px);
  background: rgba(138, 75, 58, 0.16);
}

.crm-pipeline-stack {
  display: grid;
  gap: 10px;
}

.crm-pipeline-lead {
  display: grid;
  gap: 6px;
  width: 100%;
  border: 1px solid rgba(64, 38, 26, 0.08);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.82);
  padding: 14px;
  text-align: left;
  cursor: pointer;
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.crm-pipeline-lead:hover,
.crm-pipeline-lead.is-selected {
  transform: translateY(-1px);
  border-color: rgba(138, 75, 58, 0.28);
  box-shadow: 0 16px 30px rgba(93, 45, 37, 0.08);
}

.crm-pipeline-lead strong {
  font-size: 1rem;
}

.crm-pipeline-lead span {
  color: var(--muted);
  font-size: 0.9rem;
}

.crm-pipeline-empty {
  padding: 20px 14px;
  border: 1px dashed rgba(64, 38, 26, 0.14);
  border-radius: 18px;
  color: var(--muted);
  text-align: center;
  background: rgba(255, 252, 248, 0.56);
}

.crm-sidebar,
.crm-detail-panel,
.crm-filter-card,
.crm-lead-list {
  display: grid;
  gap: 16px;
}

.crm-filter-card {
  background: linear-gradient(180deg, rgba(255, 252, 248, 0.97), rgba(239, 228, 216, 0.9));
}

.crm-card-heading,
.crm-form-heading,
.crm-form-actions,
.crm-lead-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.crm-card-heading h2,
.crm-form-heading h3 {
  margin: 0;
  font-size: 2rem;
}

.crm-field,
.crm-form-grid label {
  display: grid;
  gap: 8px;
  color: var(--muted);
}

.crm-quick-views {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.crm-chip {
  border: 1px solid rgba(138, 75, 58, 0.16);
  background: rgba(255, 250, 244, 0.95);
  color: var(--ink);
  border-radius: 999px;
  padding: 10px 14px;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 180ms ease, border-color 180ms ease, transform 180ms ease, color 180ms ease;
}

.crm-chip:hover {
  transform: translateY(-1px);
  border-color: rgba(138, 75, 58, 0.3);
  background: linear-gradient(180deg, rgba(255, 249, 242, 0.98), rgba(234, 218, 205, 0.88));
  box-shadow: 0 12px 22px rgba(93, 45, 37, 0.08);
}

.crm-chip.is-active {
  background: linear-gradient(180deg, rgba(138, 75, 58, 0.96), rgba(106, 54, 42, 0.98));
  color: #fffaf7;
  border-color: rgba(106, 54, 42, 0.96);
  box-shadow: 0 12px 28px rgba(93, 45, 37, 0.18);
}

.crm-field input,
.crm-field select,
.crm-form-grid input,
.crm-form-grid select,
.crm-form-grid textarea {
  width: 100%;
  border: 1px solid rgba(77, 50, 32, 0.12);
  border-radius: 18px;
  padding: 13px 15px;
  font: inherit;
  background: rgba(255, 255, 255, 0.86);
  color: var(--ink);
}

.crm-field input:focus,
.crm-field select:focus,
.crm-form-grid input:focus,
.crm-form-grid select:focus,
.crm-form-grid textarea:focus {
  outline: none;
  border-color: rgba(138, 75, 58, 0.42);
  box-shadow: 0 0 0 4px rgba(138, 75, 58, 0.08);
  background: rgba(255, 255, 255, 0.98);
}

.crm-lead-row {
  position: relative;
  padding: 18px 20px;
  cursor: pointer;
  background: linear-gradient(180deg, rgba(255, 252, 248, 0.86), rgba(247, 240, 232, 0.94));
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
  text-align: left;
}

.crm-lead-row::before {
  content: "";
  position: absolute;
  left: 0;
  top: 18px;
  bottom: 18px;
  width: 4px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(138, 75, 58, 0.9), rgba(201, 164, 118, 0.34));
  opacity: 0;
  transform: scaleY(0.45);
  transition: opacity 180ms ease, transform 180ms ease;
}

.crm-lead-row:hover,
.crm-lead-row.is-active {
  transform: translateY(-1px);
  border-color: rgba(138, 75, 58, 0.34);
  background: rgba(255, 249, 241, 0.94);
}

.crm-lead-row:hover::before,
.crm-lead-row.is-active::before {
  opacity: 1;
  transform: scaleY(1);
}

.crm-lead-title {
  margin: 0 0 6px;
  font-size: 1.55rem;
}

.crm-pill {
  padding: 8px 11px;
  border-radius: 999px;
  background: rgba(36, 27, 24, 0.06);
}

.crm-pill.is-new {
  background: #d9eaf7;
  color: #355166;
}

.crm-pill.is-active {
  background: #93ff93;
  color: #184a18;
}

.crm-pill.is-warm {
  background: #fce5cd;
  color: #6e4a23;
}

.crm-pill.is-closed {
  background: #e6e6e6;
  color: #555;
}

.crm-pill.is-overdue {
  background: #e06666;
  color: #fff;
}

.crm-pill.is-today {
  background: #f4cccc;
  color: #7a2d2d;
}

.crm-pill.is-upcoming {
  background: #fff2cc;
  color: #6b5a1f;
}

.crm-detail-card {
  min-height: 780px;
  padding: 30px;
  background: linear-gradient(180deg, rgba(255, 251, 247, 0.98), rgba(241, 232, 222, 0.94));
}

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

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

.crm-summary-panel {
  margin-bottom: 22px;
  padding: 22px 24px;
  border: 1px solid rgba(64, 38, 26, 0.08);
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(255, 252, 248, 0.92), rgba(241, 232, 222, 0.78));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.52);
}

.crm-smart-summary {
  margin: 0;
  color: var(--ink);
  font-size: 1.04rem;
  line-height: 1.75;
  max-width: 70ch;
}

.crm-snapshot-card {
  padding: 16px 18px;
  border: 1px solid rgba(64, 38, 26, 0.08);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.76);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.44);
}

.crm-snapshot-card span {
  display: block;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 0.68rem;
  color: var(--muted);
  font-weight: 800;
  margin-bottom: 8px;
}

.crm-snapshot-card strong {
  font-size: 1rem;
}

.crm-timeline-panel {
  margin-bottom: 24px;
  padding: 20px 22px;
  border: 1px solid rgba(64, 38, 26, 0.08);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.68);
}

.crm-section-heading {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.crm-section-heading h4 {
  margin: 0;
  font-family: "Cormorant Garamond", serif;
  font-size: 1.7rem;
}

.crm-timeline-list {
  display: grid;
  gap: 14px;
}

.crm-timeline-item {
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.crm-timeline-marker {
  width: 16px;
  height: 16px;
  border-radius: 999px;
  margin-top: 6px;
  background: rgba(36, 27, 24, 0.18);
  box-shadow: 0 0 0 6px rgba(138, 75, 58, 0.08);
}

.crm-timeline-marker.is-complete {
  background: #3d9160;
}

.crm-timeline-marker.is-alert {
  background: #c85151;
}

.crm-timeline-marker.is-today {
  background: #d38849;
}

.crm-timeline-marker.is-upcoming {
  background: #7b91d8;
}

.crm-timeline-marker.is-note {
  background: #8a4b3a;
}

.crm-timeline-content {
  padding: 14px 16px;
  border: 1px solid rgba(64, 38, 26, 0.08);
  border-radius: 18px;
  background: rgba(255, 252, 248, 0.86);
}

.crm-timeline-content span {
  display: block;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 0.68rem;
  color: var(--muted);
  font-weight: 800;
  margin-bottom: 7px;
}

.crm-timeline-content strong {
  display: block;
  margin-bottom: 6px;
  font-size: 1rem;
}

.crm-timeline-content p,
.crm-timeline-empty {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.crm-action-panel {
  margin-bottom: 24px;
  padding: 20px 22px;
  border: 1px solid rgba(64, 38, 26, 0.08);
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(255, 252, 248, 0.9), rgba(243, 233, 223, 0.84));
}

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

.crm-action-button {
  border: 1px solid rgba(138, 75, 58, 0.12);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.84);
  color: var(--ink);
  padding: 16px 14px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.crm-action-button:hover {
  transform: translateY(-1px);
  border-color: rgba(138, 75, 58, 0.3);
  box-shadow: 0 14px 24px rgba(93, 45, 37, 0.08);
  background: rgba(255, 252, 248, 0.96);
}

.crm-detail-grid {
  margin-bottom: 24px;
}

.crm-detail-grid strong {
  display: block;
  margin-top: 6px;
  font-size: 1rem;
}

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

.crm-form-grid textarea {
  min-height: 120px;
  resize: vertical;
}

.crm-empty-state {
  padding: 34px 20px;
  border: 1px dashed rgba(77, 50, 32, 0.16);
  border-radius: 22px;
  text-align: center;
  background: rgba(255, 252, 248, 0.7);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55);
}

.crm-detail-empty {
  min-height: 320px;
  display: grid;
  place-items: center;
}

.crm-inline-note {
  margin-top: 16px;
  color: var(--muted);
  font-size: 0.92rem;
}

.button {
  border: 0;
  border-radius: 999px;
  padding: 14px 22px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: transform 180ms ease, background 180ms ease;
}

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

.button-primary {
  background: var(--accent);
  color: #fffaf7;
  box-shadow: 0 16px 28px rgba(93, 45, 37, 0.18);
}

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

.button-secondary {
  background: rgba(255, 250, 242, 0.7);
  color: var(--ink);
  border: 1px solid var(--line);
}

.crm-card,
.crm-metric,
.crm-lead-row,
.crm-pipeline-column,
.crm-action-panel,
.crm-snapshot-card,
.crm-timeline-content {
  animation: crmFadeUp 420ms ease both;
}

@keyframes crmFadeUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

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

@media (max-width: 1080px) {
  .crm-hero,
  .crm-pipeline-board,
  .crm-workspace,
  .crm-summary {
    grid-template-columns: 1fr;
  }

  .crm-detail-card {
    min-height: auto;
  }

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

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

@media (max-width: 700px) {
  .page-shell {
    width: min(100% - 20px, 1240px);
  }

  .topbar,
  .crm-card-heading,
  .crm-form-heading,
  .crm-form-actions,
  .crm-detail-grid,
  .crm-form-grid {
    grid-template-columns: 1fr;
    display: grid;
  }
}
