:root {
  --ink: #212529;
  --muted: #6a6a7a;
  --bg: #070707;
  --card: #ffffff;
  --border: #e3d1d1;
  --accent: #c39090;
  --accent-dark: #ad7777;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Roboto Mono", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background:
    radial-gradient(circle at 12% 8%, rgba(195, 144, 144, 0.18), rgba(195, 144, 144, 0) 28%),
    radial-gradient(circle at 88% -4%, rgba(173, 119, 119, 0.14), rgba(173, 119, 119, 0) 30%),
    linear-gradient(180deg, #0a0a0a 0%, #050505 45%, #050505 100%);
  color: #f5ecec;
}

.container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 1.6rem 1.2rem 3.2rem;
}

.container.wide { max-width: 1420px; }

h1, h2, h3 { margin-top: 0; }
h1 { font-size: 2.2rem; }
h2 { font-size: 1.45rem; margin-bottom: 0.8rem; }
h3 { font-size: 1.02rem; margin-bottom: 0.6rem; color: #5f3f3f; }

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 2px;
  padding: 1.1rem 1.15rem;
  margin-bottom: 1.1rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
}

.notice {
  border: 1px solid #cfe3cf;
  background: #eff9ef;
  color: #145214;
  border-radius: 8px;
  padding: 0.8rem 1rem;
  margin-bottom: 1rem;
}

.muted { color: var(--muted); }
.small { font-size: 0.86rem; }

.crm-shell-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.crm-shell-menu {
  display: flex;
  gap: 0.55rem;
  align-items: center;
  flex-wrap: wrap;
}

.crm-shell-menu form {
  margin: 0;
}

.shell-link,
.shell-link-btn {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #f4e8e8;
  background: transparent;
  text-decoration: none;
  padding: 0.35rem 0.68rem;
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.shell-link-btn {
  font-family: inherit;
  cursor: pointer;
}

.shell-link:hover,
.shell-link-btn:hover {
  border-color: var(--accent);
  background: rgba(195, 144, 144, 0.12);
  color: #fff;
  text-decoration: none;
}

.shell-link-active {
  border-color: var(--accent);
  background: rgba(195, 144, 144, 0.2);
}

.crm-shell-brand {
  color: #f5e3e3;
  text-transform: lowercase;
  letter-spacing: 0.11em;
  font-size: 0.88rem;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1rem;
}

.topbar h1 {
  color: #fff4f4;
}

.topbar a {
  color: #e7bdbd;
}

.meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 0.7rem;
}

.meta > div {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14);
  padding: 0.55rem 0.62rem;
  color: #f0e2e2;
}

code {
  background: #f1f2f7;
  border: 1px solid #e1e2eb;
  border-radius: 4px;
  padding: 0.1rem 0.3rem;
  font-size: 0.85rem;
  word-break: break-all;
}

input[type="text"],
input[type="email"],
input[type="password"],
select,
textarea {
  width: 100%;
  border: 1px solid #d4d4e0;
  border-radius: 0;
  padding: 0.5rem 0.55rem;
  font-size: 0.95rem;
  margin-top: 0.3rem;
  background: #fff;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(195, 144, 144, 0.2);
}

label { font-size: 0.9rem; display: block; }
label.check {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1.85rem;
}

button {
  border: 1px solid var(--accent);
  background: #fff;
  color: var(--accent-dark);
  border-radius: 0;
  padding: 0.55rem 0.9rem;
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.82rem;
  letter-spacing: 0.02em;
  cursor: pointer;
}

button:hover { background: #fff6f6; }
button.primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
button.primary:hover { background: var(--accent-dark); }
button.ghost {
  background: #fff;
  border-style: dashed;
}

.inline-form {
  display: flex;
  gap: 0.6rem;
  align-items: center;
  flex-wrap: wrap;
}

.grid { display: grid; gap: 0.7rem; }
.grid-1 { grid-template-columns: 1fr; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }

.piece, .comp {
  border: 1px solid #ececf4;
  border-radius: 8px;
  padding: 0.8rem;
  margin-bottom: 0.8rem;
  background: #fff;
}

.piece-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 0.8rem;
}

.piece-image img {
  width: 100%;
  height: auto;
  border: 1px solid #ddd;
  border-radius: 6px;
}

.placeholder {
  border: 1px dashed #ccc;
  border-radius: 6px;
  min-height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  margin-bottom: 0.5rem;
}

.actions {
  display: flex;
  gap: 0.6rem;
}

.actions.sticky {
  position: sticky;
  bottom: 0;
  background: rgba(246, 246, 248, 0.95);
  padding: 0.7rem 0;
  margin-top: 0.5rem;
}

.list {
  margin: 0;
  padding-left: 1.1rem;
}

@media (max-width: 980px) {
  .piece-layout { grid-template-columns: 1fr; }
}

.hero {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  padding: 2rem 2rem;
  border-radius: 2px;
  margin-bottom: 1.25rem;
  border: 1px solid rgba(195, 144, 144, 0.45);
  background:
    linear-gradient(120deg, rgba(19, 19, 19, 0.96), rgba(11, 11, 11, 0.96)),
    linear-gradient(45deg, rgba(195, 144, 144, 0.16), rgba(195, 144, 144, 0));
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.55);
}

.hero-compact {
  align-items: center;
}

.hero-crm h1 {
  margin-bottom: 0.45rem;
  color: #fff8f8;
  font-size: 3rem;
  line-height: 1.05;
}

.hero-sub {
  margin: 0;
  color: #e9d6d6;
  font-size: 1rem;
  line-height: 1.5;
  max-width: 74ch;
}

.eyebrow {
  margin: 0 0 0.35rem 0;
  color: #e1aaaa;
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 600;
}

.hero-actions {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.hero-actions form {
  margin: 0;
}

.hero-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  border: 1px solid var(--accent);
  color: var(--accent-dark);
  border-radius: 0;
  padding: 0.55rem 0.9rem;
  font-weight: 600;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  font-family: inherit;
  line-height: 1.2;
  text-decoration: none;
  background: #fff;
  white-space: nowrap;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}

.hero-action-btn:hover {
  background: #fff2f2;
  text-decoration: none;
  color: var(--accent-dark);
}

.hero-action-btn-primary {
  background: var(--accent);
  color: #fff;
}

.hero-action-btn-primary:hover {
  background: var(--accent-dark);
}

.kpis {
  display: flex;
  gap: 0.8rem;
  flex-wrap: wrap;
}

.kpi {
  border: 1px solid #ececf4;
  border-radius: 2px;
  padding: 0.7rem 0.8rem;
  min-width: 170px;
  background: #fff;
}

.kpi-label {
  color: var(--muted);
  font-size: 0.82rem;
}

.kpi-value {
  font-size: 1.5rem;
  color: var(--accent-dark);
  font-weight: 700;
}

.crm-board {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(310px, 1fr));
  gap: 0.9rem;
}

.crm-lane {
  border: 1px solid var(--border);
  border-radius: 2px;
  background: #fff;
  padding: 0.8rem;
  min-height: 260px;
}

.lane-subhead {
  font-size: 0.86rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent-dark);
  margin-top: 0.9rem;
  margin-bottom: 0.4rem;
}

.crm-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.crm-card {
  border: 1px solid #ede5e5;
  border-radius: 2px;
  padding: 0.52rem 0.58rem;
  background: #fffdfd;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.5rem;
}

.crm-card:hover {
  border-color: #d8b0b0;
  background: #fff8f8;
}

.crm-main {
  flex: 1 1 auto;
  min-width: 0;
  color: inherit;
  text-decoration: none;
  position: relative;
  padding-right: 1.25rem;
}

.crm-main:hover {
  text-decoration: none;
}

.crm-quick-actions {
  flex: 0 0 auto;
  display: flex;
  gap: 0.26rem;
  align-items: center;
}

.crm-quick-actions form {
  margin: 0;
}

.quick-btn {
  width: 1.6rem;
  height: 1.6rem;
  min-height: 1.6rem;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1;
  position: relative;
}

.quick-btn.quick-go {
  border-color: #7e9a86;
  color: #2f6846;
  background: #f5fff8;
}

.quick-btn.quick-go:hover {
  background: #e9f8ef;
}

.quick-btn.quick-wait {
  border-color: #c39090;
  color: #9a6666;
  background: #fff8f8;
}

.quick-btn.quick-wait:hover {
  background: #fef0f0;
}

.quick-btn.quick-close {
  border-color: #cf9a9a;
  color: #a04b4b;
  background: #fff5f5;
}

.quick-btn.quick-close:hover {
  background: #fde8e8;
}

.quick-btn.quick-delete {
  border-color: #d36f6f;
  color: #8f2f2f;
  background: #ffeaea;
  font-size: 0.68rem;
  letter-spacing: 0.02em;
}

.quick-btn.quick-delete:hover {
  background: #ffdada;
}

.quick-btn::after {
  content: attr(data-tooltip);
  position: absolute;
  right: calc(100% + 8px);
  top: 50%;
  transform: translateY(-50%);
  background: #111;
  color: #fff;
  border: 1px solid #3a2a2a;
  padding: 0.24rem 0.4rem;
  font-size: 0.68rem;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.08s ease;
  z-index: 40;
}

.quick-btn:hover::after,
.quick-btn:focus::after {
  opacity: 1;
}

.crm-title {
  font-weight: 600;
}

.crm-alert-dot {
  position: absolute;
  top: 0.05rem;
  right: 0;
  font-size: 1rem;
  line-height: 1;
  color: #ffe6a5;
  text-shadow: 0 0 1px rgba(0, 0, 0, 0.45);
}

.crm-meta, .crm-time {
  color: var(--muted);
  font-size: 0.82rem;
}

.crm-quote {
  margin-top: 0.32rem;
  font-size: 0.78rem;
  line-height: 1.35;
  opacity: 0.96;
}

.crm-quote-hours {
  font-weight: 700;
}

.crm-quote-sep {
  opacity: 0.85;
  padding: 0 0.22rem;
}

.year-groups {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.year-group {
  border: 0;
  border-radius: 0;
  padding: 0.15rem 0;
  background: transparent;
}

.year-group > summary {
  cursor: pointer;
  font-weight: 600;
  margin-bottom: 0.35rem;
  color: #6d4747;
}

.close-subhead {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #8d6565;
  margin-top: 0.7rem;
  margin-bottom: 0.35rem;
}

.lead-workspace > form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.appraisal-workspace > form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.sales-workspace > form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.crm-snapshot {
  margin: 0 0 0.75rem;
}

.crm-snapshot-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.9rem;
}

.crm-snapshot-grid .crm-stat-card {
  padding: 0.2rem 0.35rem 0.55rem;
  border: 0;
  background: transparent;
  text-align: center;
}

.crm-snapshot-grid .crm-stat-value {
  font-size: 1.42rem;
  line-height: 1.22;
  word-break: break-word;
  margin-bottom: 0.22rem;
}

.crm-stat-label {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #8d6b6b;
}

.crm-status-strip {
  margin: 0.1rem 0 1.25rem;
}

.crm-status-form {
  justify-content: center;
  gap: 0.5rem 0.85rem;
  align-items: flex-end;
}

.crm-status-form label {
  min-width: 200px;
  max-width: 280px;
  margin: 0;
  color: #6b5f6e;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.crm-status-form select {
  border-color: #d7caca;
  background: #fff;
  margin-top: 0.2rem;
  padding: 0.42rem 0.5rem;
  font-size: 0.9rem;
}

.crm-status-form button {
  align-self: flex-end;
  padding: 0.46rem 0.82rem;
  font-size: 0.74rem;
}

.lead-client-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(250px, 1fr));
  gap: 0.65rem 0.95rem;
  max-width: 1040px;
  margin: 0 auto;
}

.lead-client-item {
  border: 1px solid #efe4e4;
  background: #fff;
  padding: 0.7rem 0.75rem;
  display: block;
}

.lead-client-label {
  display: block;
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #8b6b6b;
  margin-bottom: 0.2rem;
}

.lead-client-value a {
  color: #8a4f4f;
  text-decoration: none;
}

.lead-client-value a:hover {
  text-decoration: underline;
}

.lead-client-item input,
.lead-client-item select {
  margin-top: 0.15rem;
}

.lead-client-link {
  display: block;
  margin-top: 0.28rem;
  font-size: 0.74rem;
}

.lead-client-link a {
  color: #8a4f4f;
}

.lead-client-card h3,
.lead-pieces-card h3,
.appraisal-client-card h3,
.appraisal-pieces-card h3,
.appraisal-comps-card h3,
.appraisal-docs-card h3,
.sales-client-card h3,
.sales-pieces-card h3,
.sales-settings-card h3,
.lead-email-card h3,
.lead-email-card > summary,
.appraisal-email-card h3,
.appraisal-email-card > summary {
  color: #c39090;
  font-family: "Abril Fatface", serif;
  font-weight: 400;
  font-size: 1.7rem;
  line-height: 1.15;
}

.appraisal-client-card .lead-client-item.check {
  margin-top: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 52px;
}

.appraisal-client-card .lead-client-item.check input {
  margin-top: 0;
}

.lead-pieces-card .lead-piece {
  margin-top: 0.8rem;
}

.sales-pieces-card .sales-piece {
  margin-top: 0.8rem;
}

.lead-piece {
  border: 1px solid #c39090;
  background: #c39090;
  padding: 0.82rem 0.85rem;
}

.lead-piece > summary {
  list-style: none;
}

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

.lead-piece-summary {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.8rem;
}

.lead-piece-summary-main strong {
  display: block;
  font-size: 1.03rem;
  color: #fff;
  margin-bottom: 0.14rem;
}

.lead-piece-summary-sub {
  font-size: 0.89rem;
  color: #fff;
  opacity: 0.96;
}

.lead-piece-summary-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.32rem;
  justify-content: flex-end;
}

.lead-piece-summary-meta span {
  font-size: 0.74rem;
  border: 1px solid rgba(255, 255, 255, 0.55);
  padding: 0.16rem 0.35rem;
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
}

.lead-piece-layout {
  margin-top: 0.88rem;
}

.lead-field-grid {
  gap: 0.56rem;
  font-size: 1.02rem;
  color: #fff;
}

.lead-decision label {
  color: #fff;
}

.lead-decision label.check {
  margin-top: 0.6rem;
}

.lead-decision textarea {
  background: #fff;
}

.sales-contacts-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(200px, 1fr));
  gap: 0.65rem 0.9rem;
  margin: 0.4rem 0 0.6rem;
}

.sales-contact-check {
  margin: 0;
  margin-top: 0;
  border: 1px solid #e6c9cf;
  background: #fff;
  border-radius: 12px;
  padding: 0.62rem 0.7rem;
  min-height: 50px;
  transition: border-color 0.18s ease, background-color 0.18s ease, box-shadow 0.18s ease;
}

.sales-contact-check input[type="checkbox"] {
  width: 1.15rem;
  height: 1.15rem;
  accent-color: var(--accent);
}

.sales-contact-text {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: #3f2a2a;
  font-size: 0.96rem;
}

.sales-contact-check:hover {
  border-color: #d3a0aa;
  background: #fff7f8;
}

.sales-contact-check:has(input:checked) {
  border-color: #bf7f8d;
  background: #fcecef;
  box-shadow: inset 0 0 0 1px rgba(191, 127, 141, 0.22);
}

.sales-fee-summary {
  border: 1px solid #ecdede;
  background: #fff9f9;
  padding: 0.6rem 0.7rem;
  margin-top: 0.45rem;
}

.sales-fee-summary > div {
  margin-bottom: 0.18rem;
}

.sales-settings-card select,
.sales-settings-card input[type="text"],
.sales-settings-card input[type="date"] {
  min-height: 46px;
  border-width: 1.5px;
  border-color: #d9aab3;
  border-radius: 12px;
  padding: 0.58rem 0.75rem;
}

.sales-date-field input[type="date"] {
  font-size: 1rem;
  letter-spacing: 0.01em;
}

.sales-piece-auction-grid {
  margin-top: 0.45rem;
}

.sales-piece-result-field select {
  text-align: center;
}

.sales-auction-result-field select {
  min-height: 40px;
  text-align: center;
  font-size: 0.92rem;
}

.sales-hammer-summary-box {
  border: 1px solid #e4c0c7;
  border-radius: 12px;
  padding: 0.5rem 0.7rem;
  background: #fff8f9;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.sales-hammer-summary-value {
  font-size: 1rem;
  font-weight: 700;
  color: #4a2f2f;
  margin-top: 0.1rem;
}

.sales-invoice-card {
  margin-top: 0.85rem;
  border-color: #e2c3c9;
  background: #fff;
}

.sales-invoice-card .actions {
  margin-bottom: 0.45rem;
}

.lead-email-card {
  margin-top: 0.3rem;
}

.lead-email-card > summary {
  cursor: pointer;
  margin-bottom: 0.7rem;
}

.crm-inline label {
  min-width: 180px;
}

.table-wrap {
  overflow-x: auto;
}

.crm-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.crm-table th,
.crm-table td {
  border-bottom: 1px solid #ececf4;
  padding: 0.5rem 0.4rem;
  text-align: left;
  vertical-align: top;
}

.crm-table th {
  color: #2f2f5f;
}

.notes {
  margin-top: 0.8rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.note {
  border: 1px solid #ececf4;
  border-radius: 8px;
  padding: 0.6rem 0.7rem;
  background: #fff;
}

.note-time {
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 0.3rem;
}

@media (max-width: 1080px) {
  .crm-board {
    grid-template-columns: 1fr;
  }
  .crm-snapshot-grid {
    grid-template-columns: 1fr;
  }
  .lead-client-grid {
    grid-template-columns: 1fr;
  }
  .hero-crm h1 {
    font-size: 2.35rem;
  }
}

.case-block {
  border: 1px solid #ececf4;
  border-radius: 8px;
  padding: 0.8rem;
  margin-bottom: 0.8rem;
  background: #fff;
}

.case-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.8rem;
  margin-bottom: 0.5rem;
}

.case-header h3 {
  margin: 0;
}

.case-meta {
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 0.84rem;
}

.file-links {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  margin-top: 0.4rem;
}

.file-links a {
  color: #2f2f5f;
  text-decoration: none;
}

.file-links a:hover {
  text-decoration: underline;
}

.manifest-card {
  margin-top: 0.6rem;
  padding: 0.55rem 0.65rem;
  border: 1px solid #ecdede;
  border-radius: 8px;
  background: #fff9f9;
  font-size: 0.88rem;
}

.required {
  color: #b24d4d;
  font-weight: 700;
}

.appraisal-piece {
  border: 1px solid #c39090;
  border-radius: 2px;
  margin: 0.7rem 0;
  background: #c39090;
  padding: 0.82rem 0.85rem;
}

.appraisal-piece > summary {
  cursor: pointer;
  color: #fff;
  font-weight: 600;
  font-size: 1.04rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.appraisal-piece-complete-icon {
  display: none;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #c39090;
  background: #fff;
  border: 1px solid #c39090;
  border-radius: 999px;
  padding: 0.18rem 0.5rem;
}

.appraisal-piece-layout {
  margin-top: 0.88rem;
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 0.8rem;
}

.appraisal-piece-fields .grid {
  margin-bottom: 0.3rem;
}

.appraisal-piece label,
.appraisal-piece .required {
  color: #fff;
}

.appraisal-piece .muted {
  color: rgba(255, 255, 255, 0.92);
}

.appraisal-piece input[type="text"],
.appraisal-piece input[type="email"],
.appraisal-piece select,
.appraisal-piece textarea {
  background: #fff;
  color: #212529;
}

.appraisal-piece-images {
  min-width: 0;
}

.piece-complete-actions {
  margin-top: 0.45rem;
}

.appraisal-piece.is-completed {
  background: #fff;
  border-color: #c39090;
}

.appraisal-piece.is-completed > summary {
  color: #c39090;
}

.appraisal-piece.is-completed .appraisal-piece-complete-icon {
  display: inline-flex;
  align-items: center;
}

.appraisal-piece.is-completed label,
.appraisal-piece.is-completed .required {
  color: #2f2f5f;
}

.appraisal-piece.is-completed .muted {
  color: #6e6f8a;
}

.lead-piece-layout {
  margin-top: 0.6rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.8rem;
}

.lead-field-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.3rem;
  font-size: 0.9rem;
}

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

.lead-decision {
  margin-top: 0.7rem;
}

.lead-piece-images {
  min-width: 0;
}

.lead-images-scroll {
  display: flex;
  gap: 0.7rem;
  overflow-x: auto;
  padding-bottom: 0.3rem;
}

.lead-image-card {
  min-width: 180px;
  max-width: 180px;
  border: 1px solid #ececf4;
  border-radius: 8px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  background: #fff;
}

.lead-image-card img {
  width: 100%;
  height: 130px;
  object-fit: cover;
  display: block;
}

.lead-image-label {
  font-size: 0.78rem;
  color: #2f2f5f;
  font-weight: 600;
  padding: 0.35rem 0.45rem 0.1rem;
}

.lead-image-name {
  font-size: 0.74rem;
  color: var(--muted);
  padding: 0 0.45rem 0.45rem;
  word-break: break-word;
}

@media (max-width: 900px) {
  .appraisal-piece-layout {
    grid-template-columns: 1fr;
  }

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

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

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

.quote-section {
  border: 1px solid #ececf4;
  border-radius: 2px;
  padding: 0.7rem;
  margin: 0.8rem 0;
  background: #fffdfd;
}

.comps-toggle-btn {
  width: 100%;
  min-height: 52px;
  font-size: 0.9rem;
}

.comps-toggle-btn.is-active {
  background: #ad7777;
  border-color: #ad7777;
  color: #fff;
}

.comps-toggle-status {
  margin-top: 0.45rem;
  margin-bottom: 0.2rem;
}

.docs-action-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.6rem;
  margin-top: 0.35rem;
}

.docs-action-row .hero-action-btn,
.docs-action-row button {
  width: 100%;
  min-height: 44px;
  display: inline-flex;
  justify-content: center;
  align-items: center;
}

.docs-generate-row {
  margin-top: 0.8rem;
}

.docs-generate-row .primary {
  width: 100%;
  min-height: 48px;
}

.appraisal-email-card {
  margin-top: 0.3rem;
}

.appraisal-email-card > summary {
  cursor: pointer;
  margin-bottom: 0.7rem;
}

.appraisal-email-card .check {
  margin-top: 0.2rem;
}

@media (max-width: 900px) {
  .docs-action-row {
    grid-template-columns: 1fr;
  }
}

.dropzone {
  border: 2px dashed #d8b0b0;
  border-radius: 10px;
  background: #fff7f7;
  padding: 1rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.dropzone:focus,
.dropzone.is-dragover {
  outline: none;
  border-color: #ad7777;
  background: #ffecec;
}

.dropzone-title {
  margin: 0;
  font-weight: 600;
  color: #2f2f5f;
}

.image-panel {
  margin-top: 0.7rem;
}

.image-panel > summary {
  cursor: pointer;
  color: #2f2f5f;
  font-weight: 600;
}

.image-grid {
  margin-top: 0.6rem;
  display: grid;
  gap: 0.6rem;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
}

.thumb {
  display: block;
  text-decoration: none;
  color: inherit;
  border: 1px solid #ececf4;
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}

.thumb img {
  display: block;
  width: 100%;
  height: 120px;
  object-fit: cover;
}

.thumb span {
  display: block;
  font-size: 0.76rem;
  color: var(--muted);
  padding: 0.4rem;
  word-break: break-word;
}

/* --- CRM visual overrides (homepage-aligned) --- */
body {
  background: #fff;
  color: #212529;
}

.container {
  margin: 0 auto;
  padding: 0 1rem;
}

.container.wide {
  max-width: 1380px;
}

main.container {
  padding: 0 1rem 2.5rem;
}

h1,
h2,
h3 {
  color: #212529;
}

.topbar h1,
.topbar a {
  color: #212529;
}

.meta > div {
  background: #fff;
  border: 1px solid #eadede;
  color: #212529;
}

.card {
  box-shadow: none;
}

.crm-topnav {
  background: #1b1b1b;
  border-bottom: 1px solid #2a2a2a;
  margin-bottom: 0;
}

.crm-topnav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 62px;
}

.crm-topnav-menu {
  display: flex;
  gap: 0.55rem;
  align-items: center;
  flex-wrap: wrap;
}

.crm-topnav-menu form {
  margin: 0;
}

.crm-nav-link,
.crm-nav-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  color: #fff;
  background: transparent;
  text-decoration: none;
  padding: 0.34rem 0.62rem;
  font-size: 0.72rem;
  font-family: inherit;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.crm-nav-link:hover,
.crm-nav-btn:hover {
  text-decoration: none;
  background: rgba(195, 144, 144, 0.22);
  border-color: #c39090;
  color: #fff;
}

.crm-nav-link-active {
  background: rgba(195, 144, 144, 0.26);
  border-color: #c39090;
}

.crm-topnav-brand {
  color: #fff;
  font-size: 0.87rem;
  letter-spacing: 0.1em;
  text-transform: lowercase;
}

.crm-hero {
  min-height: 430px;
  background-image: linear-gradient(rgba(0, 0, 0, 0.38), rgba(0, 0, 0, 0.38)), url("hero_2.jpg");
  background-size: cover;
  background-position: center center;
  border-bottom: 1px solid #e7d8d8;
  margin-bottom: 2.2rem;
}

.crm-hero.crm-hero-mini {
  min-height: 300px;
}

.crm-hero-content {
  padding: 7.8rem 0 5.2rem;
  text-align: center;
}

.crm-hero-mini .crm-hero-content {
  padding: 5.2rem 0 3.5rem;
}

.crm-hero h1 {
  color: #fff;
  font-size: 3.45rem;
  line-height: 1.05;
  margin-bottom: 0.7rem;
  font-family: "Abril Fatface", serif;
  font-weight: 400;
}

.crm-hero h2 {
  margin: 0 auto 1.25rem;
  color: #fff;
  font-size: 1.24rem;
  line-height: 1.45;
  font-weight: 400;
  max-width: 940px;
}

.crm-hero-actions {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.56rem;
  flex-wrap: wrap;
}

.crm-hero-actions form {
  margin: 0;
}

.btn-like {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 45px;
  padding: 0.58rem 1.1rem;
  border: 1px solid #fff;
  background: transparent;
  color: #fff;
  font-size: 0.9rem;
  font-family: inherit;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  text-decoration: none;
  cursor: pointer;
}

.btn-like:hover {
  background: #c39090;
  border-color: #c39090;
  color: #fff;
  text-decoration: none;
}

.btn-like-sync {
  min-height: 54px;
  min-width: 280px;
  padding: 0.72rem 1.5rem;
  font-size: 1rem;
  border-width: 2px;
  background: rgba(195, 144, 144, 0.26);
  border-color: #f4dede;
  font-weight: 700;
}

.btn-like-sync:hover {
  background: #c39090;
  border-color: #c39090;
}

.crm-client-hero {
  border: 1px solid #e7d8d8;
  background-image: url("hero_3.jpg");
  background-size: cover;
  background-position: center center;
  min-height: 285px;
}

.crm-client-hero h1,
.crm-client-hero h2,
.crm-client-hero .hero-sub,
.crm-client-hero .eyebrow {
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.crm-client-hero .meta > div {
  background: rgba(255, 255, 255, 0.85);
  border-color: rgba(255, 255, 255, 0.9);
  color: #212529;
}

.crm-client-hero.stage-awaiting-confirmation,
.crm-client-hero.stage-quote-sent,
.crm-client-hero.stage-waiting-client,
.crm-client-hero.stage-awaiting-response {
  background-image: url("hero_4.jpg");
}

.crm-client-hero.stage-appraisal-in-progress,
.crm-client-hero.stage-confirmed,
.crm-client-hero.stage-referral-outreach,
.crm-client-hero.stage-awaiting-payment {
  background-image: url("hero_5.jpg");
}

.crm-client-hero.stage-completed,
.crm-client-hero.stage-closed-won,
.crm-client-hero.stage-disqualified,
.crm-client-hero.stage-closed-lost {
  background-image: url("hero_2.jpg");
}

.crm-stats {
  margin-bottom: 2rem;
}

.crm-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.9rem;
}

.crm-stat-card {
  border: 0;
  background: #fff;
  padding: 1.1rem 0.9rem;
  text-align: center;
}

.crm-stat-value {
  color: #c39090;
  font-size: 2rem;
  line-height: 1.15;
  margin-bottom: 0.45rem;
  font-family: "Abril Fatface", serif;
  font-weight: 400;
}

.crm-stat-card h3 {
  margin: 0 0 0.45rem;
  font-size: 1.03rem;
  color: #2c2c2c;
  font-family: "Roboto Mono", sans-serif;
  text-transform: none;
}

.crm-stat-card p {
  margin: 0;
  font-size: 0.84rem;
  color: #666;
  line-height: 1.4;
}

.crm-board-wrap {
  margin-bottom: 2rem;
}

.crm-board {
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1rem;
}

.crm-lane {
  padding: 1rem 0.95rem;
}

.lane-title {
  color: #c39090;
  font-size: 2.05rem;
  line-height: 1.2;
  font-family: "Abril Fatface", serif;
  font-weight: 400;
  margin-bottom: 0.7rem;
  min-height: 2.5em;
  display: flex;
  align-items: flex-end;
}

.lane-subhead {
  color: #6b4a4a;
  font-size: 1rem;
  text-transform: none;
  letter-spacing: 0;
  margin-top: 0.9rem;
  margin-bottom: 0.45rem;
}

.crm-card {
  background: #c39090;
  border-color: #c39090;
}

.crm-card:hover {
  background: #ad7777;
  border-color: #ad7777;
}

.crm-main,
.crm-main:hover {
  color: #fff;
}

.crm-title,
.crm-meta,
.crm-time {
  color: #fff;
}

.crm-meta,
.crm-time {
  opacity: 0.95;
}

.quick-btn {
  border: 1px solid #fff;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
}

.quick-btn.quick-go,
.quick-btn.quick-wait,
.quick-btn.quick-close,
.quick-btn.quick-delete {
  border-color: #fff;
  color: #fff;
  background: rgba(255, 255, 255, 0.16);
}

.quick-btn.quick-go:hover,
.quick-btn.quick-wait:hover,
.quick-btn.quick-close:hover,
.quick-btn.quick-delete:hover {
  background: rgba(255, 255, 255, 0.28);
}

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

@media (max-width: 760px) {
  .crm-topnav-inner {
    min-height: 56px;
  }

  .crm-topnav-brand {
    display: none;
  }

  .crm-hero {
    min-height: 360px;
  }

  .crm-hero-content {
    padding: 6rem 0 4rem;
  }

  .crm-hero h1 {
    font-size: 2.55rem;
  }

  .crm-hero h2 {
    font-size: 1rem;
  }

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