
:root {
  --navy: #183247;
  --copper: #b87333;
  --background: #f5f6f7;
  --border: #dce1e5;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Arial, sans-serif;
  background: var(--background);
  color: #24313b;
}

header {
  background: var(--navy);
  color: white;
  padding: 20px 30px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

header h1 {
  margin: 0;
  font-size: 23px;
}

header span {
  font-size: 13px;
  opacity: 0.8;
}

main {
  padding: 30px;
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
}

button {
  background: var(--copper);
  border: none;
  border-radius: 5px;
  padding: 11px 16px;
  cursor: pointer;
  color: white;
  font-weight: bold;
}

button:hover {
  opacity: 0.9;
}

.filters {
  margin: 22px 0;
}

select, input {
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: white;
}

.pipeline {
  display: flex;
  gap: 15px;
  overflow-x: auto;
  padding-bottom: 20px;
  align-items: flex-start;
}

.stage {
  background: #e9edf0;
  min-width: 235px;
  width: 235px;
  border-radius: 8px;
  padding: 12px;
  min-height: 250px;
}

.stage h3 {
  font-size: 14px;
  margin: 3px 0 15px;
}

.customer-card {
  background: white;
  padding: 15px;
  margin-bottom: 10px;
  border-radius: 6px;
  border: 1px solid var(--border);
  cursor: pointer;
}

.customer-card:hover {
  border-color: var(--copper);
}

.customer-card strong {
  display: block;
  margin-bottom: 7px;
}

.customer-card small {
  color: #6b7780;
}

dialog {
  border: none;
  border-radius: 10px;
  padding: 25px;
  width: min(420px, 95vw);
}

dialog::backdrop {
  background: rgba(0, 0, 0, 0.5);
}

#customer-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 15px;
}

#cancel-customer {
  background: #747d85;
}

@media (max-width: 600px) {
  header, main {
    padding: 16px;
  }

  .toolbar h2 {
    font-size: 20px;
  }

/* Customer detail page */

.customer-page {
  max-width: 1400px;
  margin: auto;
}

.back-link {
  display: inline-block;
  margin-bottom: 20px;
  color: var(--navy);
  text-decoration: none;
}

.customer-layout {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 20px;
  margin-top: 20px;
}

.customer-main,
.customer-sidebar {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.detail-panel {
  background: white;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 22px;
}

.detail-panel h3 {
  margin-top: 0;
  color: var(--navy);
}

}
/* Checklist sections */

.checklist-section {
  margin-bottom: 28px;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}

.checklist-section h4 {
  margin: 0;
  padding: 14px 16px;
  background: #f0f2f4;
  color: var(--navy);
  font-size: 15px;
  font-weight: 600;
}

/* Individual checklist rows */

.checklist-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 13px 16px;
  margin: 0;
  border-top: 1px solid var(--border);
  background: white;
  cursor: pointer;
  font-size: 14px;
  line-height: 1.4;
}

.checklist-item:hover {
  background: #f8f9fa;
}

.checklist-item input[type="checkbox"] {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--copper);
}

.checklist-item span {
  flex: 1;
}

/* Completed checklist items */

.checklist-item:has(input:checked) {
  background: #f5f8f5;
}

.checklist-item input:checked + span {
  color: #7a8580;
  text-decoration: line-through;
}


#customer-notes {
  width: 100%;
  min-height: 150px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 5px;
  font-family: inherit;
}

.customer-sidebar label {
  display: block;
  margin: 15px 0 6px;
}

.customer-sidebar input {
  width: 100%;
}

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

/* ---------- Follow-up dashboard ---------- */

.followups-section {
  margin-bottom: 32px;
}

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

.followup-card {
  padding: 12px;
  margin-top: 10px;
  border: 1px solid #ddd;
  border-radius: 8px;
  cursor: pointer;
  background: #fff;
}

.followup-card:hover {
  background: #f4f6f8;
}

.followup-card strong {
  display: block;
}

.followup-card p {
  margin: 6px 0;
  font-size: 14px;
}

.followup-card small {
  color: #666;
}

@media (max-width: 800px) {
  .followups-grid {
    grid-template-columns: 1fr;
  }
}

/* ---------- Follow-up completion ---------- */

.complete-followup-button {
  margin-top: 12px;
  padding: 7px 12px;
  font-size: 13px;
}

#complete-followup-dialog {
  width: min(450px, calc(100% - 32px));
  max-height: 90vh;
  overflow-y: auto;
  border: none;
  border-radius: 10px;
  padding: 24px;
}

#complete-followup-dialog::backdrop {
  background: rgba(0, 0, 0, 0.45);
}

#complete-followup-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

#complete-followup-form input,
#complete-followup-form textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 10px;
}

#complete-followup-status {
  margin: 0;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 12px;
}

/* ---------- Follow-up history ---------- */

.followup-history-entry {
  padding: 12px 0;
  border-bottom: 1px solid #ddd;
}

.followup-history-entry:last-child {
  border-bottom: none;
}

.followup-history-entry strong {
  display: block;
  margin-bottom: 5px;
}

.followup-history-entry small {
  display: block;
  color: #666;
  font-size: 12px;
}

.followup-history-entry p {
  margin: 8px 0 0;
  font-size: 14px;
  white-space: pre-wrap;
}



/* Version 2 dashboard, search and detail forms */
.summary-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 14px; margin: 20px 0; }
.summary-tile { background: white; border: 1px solid var(--border); border-radius: 9px; padding: 16px; display: flex; flex-direction: column; gap: 7px; }
.summary-tile small { color: #576775; }
.summary-tile strong { font-size: 27px; color: var(--navy); }
.filters { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.filters input[type=search] { min-width: 220px; flex: 1; max-width: 350px; }
#match-count { color: #53636e; font-size: 13px; }
.customer-sidebar .detail-panel input, .customer-sidebar .detail-panel select,
.customer-sidebar .detail-panel textarea { width: 100%; max-width: 100%; }
.customer-sidebar .detail-panel label { display: block; margin-top: 12px; margin-bottom: 5px; }
#activity-list { max-height: 480px; overflow-y: auto; }
@media (max-width: 800px) { .summary-grid { grid-template-columns: repeat(2,minmax(0,1fr)); } .filters { align-items: stretch; } .filters input[type=search] { max-width: none; } }

/* Version 3 navigation and record management */
.crm-nav{display:flex;flex-wrap:wrap;gap:18px;background:#e9edf0;padding:12px 30px}
.crm-nav a{color:#183247;font-weight:600;text-decoration:none}
.crm-nav a:hover{text-decoration:underline}
.v3-page{max-width:1200px;margin:auto}
.v3-table{width:100%;border-collapse:collapse;background:#fff;margin-top:20px}
.v3-table th,.v3-table td{border:1px solid #dce1e5;padding:12px;text-align:left;vertical-align:middle}
.v3-table th{background:#e9edf0}
.v3-table button{margin:3px;padding:7px 10px}
#v3-dialog{width:min(550px,96vw);max-height:90vh;overflow:auto}
.v3-field{display:flex;flex-direction:column;gap:5px;margin:10px 0}
.v3-field input,.v3-field select,.v3-field textarea{width:100%;padding:9px}
.v3-field textarea{min-height:90px}
.v3-document-row{display:flex;flex-wrap:wrap;justify-content:space-between;gap:8px;padding:9px 0;border-bottom:1px solid #ddd}
.document-upload{display:flex;flex-wrap:wrap;gap:8px;margin-top:12px}
@media(max-width:700px){.v3-table{display:block;overflow-x:auto}.crm-nav{padding:12px}.v3-page{padding:15px}}

/* Admin-only destructive actions */
.danger-button { background: #a52727; color: #fff; border: 1px solid #8b1e1e; border-radius: 6px; padding: 8px 12px; cursor: pointer; }
.danger-button:hover { background: #841b1b; }
.danger-button:disabled { opacity: .55; cursor: wait; }
#customer-admin-actions[hidden] { display: none; }
.v3-document-row .danger-button { margin-left: 10px; font-size: 12px; }

/* V10 customer page accordion panels */
.customer-fold > .customer-fold-title {
  cursor: pointer;
  color: var(--navy);
  font-size: 1.12rem;
  font-weight: 700;
  padding: 2px 0 12px;
  list-style-position: inside;
}
.customer-fold:not([open]) > .customer-fold-title { padding-bottom: 0; }
.customer-fold > .customer-fold-title:focus-visible,
.checklist-heading:focus-visible { outline: 2px solid var(--navy); outline-offset: 4px; }
#sales-customer-workspace > .customer-fold + .customer-fold { border-top: 1px solid var(--border); padding-top: 18px; margin-top: 18px; }
.checklist-section { margin-bottom: 10px; }
.checklist-section > .checklist-heading {
  display: list-item;
  cursor: pointer;
  padding: 14px 16px;
  background: #f0f2f4;
  color: var(--navy);
  font-size: 15px;
  font-weight: 600;
  list-style-position: inside;
}
.checklist-section:not([open]) { margin-bottom: 10px; }

/* V13 model suggestions */
.recommended-home-models{margin:16px 0;padding:14px;border:1px solid #d5dbe2;border-radius:8px}.recommended-model-list{display:grid;gap:9px}.recommended-model-card{padding:10px;border:1px solid #e1e5e9;border-radius:6px}.recommended-model-card p{margin:5px 0}.recommended-model-card small{color:#536171}

/* V15: compact, collapsed workspace and model-cost breakdowns */
.workspace-fold,.model-price-breakdown{margin:10px 0;padding:10px;border:1px solid #d7dfe5;border-radius:7px}
.workspace-fold>summary,.model-price-breakdown>summary,.fee-type-panel>summary,.catalog-markup-editor>summary{cursor:pointer;font-weight:650}
.price-breakdown-table{width:100%;border-collapse:collapse;margin-top:8px}
.price-breakdown-table td{padding:6px 4px;border-bottom:1px solid #e6e9ed}
