:root {
  --bg: #f6f7f4;
  --panel: #ffffff;
  --ink: #18201e;
  --muted: #68706c;
  --line: #dfe4df;
  --accent: #126b5a;
  --accent-strong: #0a4c40;
  --warn: #9f5b1d;
  --bad: #9d302b;
  --good: #1f7a4d;
  --shadow: 0 18px 40px rgba(24, 32, 30, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

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

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

.sidebar {
  background: #17231f;
  color: white;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 28px;
  min-width: 0;
}

.brand {
  display: flex;
  gap: 14px;
  align-items: center;
}

.brand-mark {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  background: #d6f2df;
  color: #17352e;
  font-weight: 800;
  border-radius: 8px;
}

.brand h1 {
  margin: 0;
  font-size: 18px;
  line-height: 1.2;
}

.brand p {
  margin: 3px 0 0;
  color: #b8c4be;
  font-size: 13px;
}

.nav {
  display: grid;
  gap: 8px;
}

.nav-item,
.ghost-button,
.primary-button,
.secondary-button {
  border: 0;
  border-radius: 8px;
  cursor: pointer;
}

.nav-item {
  display: block;
  color: #e9f1ed;
  background: transparent;
  text-align: left;
  padding: 12px;
  text-decoration: none;
  font-size: 16px;
}

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

.sidebar-footer {
  margin-top: auto;
  display: grid;
  gap: 12px;
  color: #b8c4be;
  font-size: 13px;
}

.backup-status {
  color: #dce8e1;
  line-height: 1.35;
}

.ghost-button {
  color: white;
  background: rgba(255, 255, 255, 0.1);
  padding: 10px 12px;
}

.main {
  padding: 28px;
  min-width: 0;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}

.topbar h2 {
  margin: 0;
  font-size: 28px;
}

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

.primary-button {
  color: white;
  background: var(--accent);
  padding: 11px 14px;
  font-weight: 700;
}

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

.link-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 9px 12px;
  color: var(--accent-strong);
  background: #dff0e9;
  border-radius: 8px;
  font-weight: 700;
  text-decoration: none;
}

.secondary-button {
  color: var(--accent-strong);
  background: #dff0e9;
  padding: 11px 14px;
  font-weight: 700;
}

.view {
  display: none;
}

.active-view {
  display: block;
}

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

.metric-card,
.panel,
.table-wrap {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.metric-card {
  padding: 18px;
}

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

.metric-card strong {
  display: block;
  margin-top: 8px;
  font-size: 30px;
}

.content-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 18px;
  margin-top: 18px;
}

.command-center-panel {
  margin-top: 18px;
}

.command-layout {
  display: grid;
  grid-template-columns: minmax(360px, 1.15fr) minmax(260px, 0.75fr) minmax(280px, 0.9fr);
  gap: 14px;
}

.command-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
  padding: 14px;
  min-width: 0;
}

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

.command-card-head h4 {
  margin: 0;
  font-size: 15px;
}

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

.queue-item {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 2px 10px;
  min-height: 78px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: white;
  text-decoration: none;
}

.queue-item strong {
  grid-row: span 2;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #edf1ee;
  font-size: 20px;
}

.queue-item span {
  font-weight: 800;
}

.queue-item small {
  color: var(--muted);
  line-height: 1.35;
}

.queue-item.has-work {
  border-color: rgba(18, 107, 90, 0.36);
  background: #f4fbf7;
}

.queue-item.has-work strong {
  color: white;
  background: var(--accent);
}

.report-list,
.ops-link-grid,
.client-page-links,
.risk-list {
  display: grid;
  gap: 8px;
}

.report-row,
.ops-link,
.page-action,
.risk-row {
  display: grid;
  gap: 4px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  min-width: 0;
}

.report-row span,
.page-action span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.report-row strong {
  font-size: 22px;
}

.report-row small,
.risk-row span {
  color: var(--muted);
  line-height: 1.35;
}

.ops-link {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.ops-link strong {
  overflow-wrap: anywhere;
}

.command-subsection {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

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

.client-page-card {
  display: grid;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
  min-width: 0;
}

.client-page-card-head {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 12px;
}

.client-page-card-head > div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.client-page-meta {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.client-page-meta span {
  overflow-wrap: anywhere;
}

.page-action {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.panel {
  padding: 18px;
}

.panel h3 {
  margin: 0 0 14px;
  font-size: 18px;
}

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

.form-grid label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}

.form-grid input,
.form-grid select,
.form-grid textarea,
.copy-box {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 12px;
  color: var(--ink);
  background: white;
}

.span-2 {
  grid-column: span 2;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  text-align: left;
  padding: 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
  font-size: 14px;
}

th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.table-wrap {
  overflow: auto;
}

.status-pill {
  display: inline-flex;
  padding: 4px 8px;
  border-radius: 999px;
  background: #edf1ee;
  color: #42504a;
  font-size: 12px;
  white-space: nowrap;
}

.status-pill.good {
  background: #ddf2e6;
  color: var(--good);
}

.status-pill.warn {
  background: #f7ead8;
  color: var(--warn);
}

.status-pill.bad {
  background: #f7dddd;
  color: var(--bad);
}

.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.mini-button {
  border: 1px solid var(--line);
  background: white;
  border-radius: 8px;
  padding: 7px 9px;
  cursor: pointer;
}

.copy-box {
  white-space: pre-wrap;
  min-height: 280px;
  line-height: 1.45;
}

.lead-page {
  display: grid;
  gap: 14px;
  max-width: 620px;
}

.lead-page h3 {
  margin-bottom: 0;
}

.note-list {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.6;
}

.muted {
  color: var(--muted);
}

.manager-toolbar {
  margin-top: 18px;
  display: grid;
  grid-template-columns: minmax(280px, 1fr) 220px 220px;
  gap: 12px;
  align-items: end;
}

.cloud-lead-panel {
  margin-top: 18px;
}

.cloud-lead-controls {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto auto auto;
  gap: 12px;
  align-items: end;
}

.cloud-lead-controls label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.cloud-lead-controls input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 12px;
  color: var(--ink);
  background: white;
}

.lead-log-head {
  margin-top: 18px;
}

.lead-list {
  display: grid;
  gap: 10px;
}

.lead-row {
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fbfcfb;
}

.lead-row-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
}

.lead-row-main,
.lead-row-side {
  display: grid;
  gap: 5px;
}

.lead-row-main span {
  line-height: 1.35;
}

.lead-row-side {
  justify-items: end;
  min-width: 190px;
}

.lead-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.lead-fulfillment-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  border-top: 1px solid var(--line);
  padding-top: 10px;
  color: var(--muted);
  font-size: 13px;
}

.lead-fulfillment-grid strong {
  display: block;
  color: var(--ink);
  font-size: 12px;
  margin-bottom: 2px;
}

.lead-message {
  margin: 0;
  border-left: 3px solid rgba(18, 107, 90, 0.24);
  padding: 4px 0 4px 10px;
  color: var(--muted);
  line-height: 1.45;
}

.lead-notes-label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.lead-notes {
  width: 100%;
  resize: vertical;
  min-height: 58px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--ink);
  background: white;
  font: inherit;
}

.lead-template-actions {
  justify-content: flex-start;
}

.estimate-builder-panel {
  margin-top: 18px;
}

.estimate-layout {
  display: grid;
  grid-template-columns: minmax(320px, 0.9fr) minmax(420px, 1fr);
  gap: 18px;
  align-items: start;
}

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

.estimate-inputs label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.estimate-inputs input,
.estimate-inputs select,
.estimate-inputs textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 12px;
  color: var(--ink);
  background: white;
}

.estimate-preview-panel {
  min-width: 0;
}

.estimate-preview {
  min-height: 360px;
  resize: vertical;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.prospect-panel {
  margin-top: 18px;
}

.prospect-controls {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) 190px 190px auto;
  gap: 12px;
  align-items: end;
}

.prospect-controls label,
.field-label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.prospect-controls input,
.prospect-controls select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 12px;
  color: var(--ink);
  background: white;
}

.prospect-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.mini-metric {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fbfcfb;
}

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

.mini-metric strong {
  display: block;
  margin-top: 4px;
  font-size: 22px;
}

.prospect-layout {
  display: grid;
  grid-template-columns: minmax(320px, 0.9fr) minmax(520px, 1fr);
  gap: 18px;
  margin-top: 18px;
  align-items: start;
}

.prospect-list,
.prospect-list-panel {
  display: grid;
  gap: 10px;
}

.prospect-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
  padding: 12px;
}

.prospect-row.selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(18, 107, 90, 0.12);
}

.prospect-row-main {
  border: 0;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  display: grid;
  gap: 4px;
  padding: 0;
  text-align: left;
}

.prospect-row-side {
  display: grid;
  gap: 5px;
  justify-items: end;
  min-width: 112px;
}

.prospect-row-actions {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.prospect-editor-panel {
  min-width: 0;
}

.weakness-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 6px;
}

.checkbox-row {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 10px;
  background: #fbfcfb;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.35;
}

.checkbox-row input {
  width: 16px;
  height: 16px;
  margin-top: 2px;
  padding: 0;
}

.checkbox-row small {
  color: var(--muted);
  font-weight: 800;
}

.prospect-actions {
  align-items: center;
}

.prospect-score-label {
  margin-left: 8px;
  font-weight: 800;
}

.manager-toolbar label,
.manager-links label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.manager-toolbar input,
.manager-toolbar select,
#registrySnippet {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 12px;
  color: var(--ink);
  background: white;
}

.manager-layout {
  display: grid;
  grid-template-columns: minmax(320px, 0.72fr) minmax(520px, 1fr);
  gap: 18px;
  margin-top: 18px;
  align-items: start;
}

.manager-list-panel {
  position: sticky;
  top: 18px;
}

.manager-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.manager-section-head h3 {
  margin: 0;
}

.client-list {
  display: grid;
  gap: 10px;
}

.client-row {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
  overflow: hidden;
}

.client-row.selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(18, 107, 90, 0.12);
}

.client-row-main {
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  display: grid;
  gap: 4px;
  padding: 12px;
  text-align: left;
}

.client-row-title {
  font-weight: 800;
}

.client-row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  padding: 0 12px 12px;
}

.danger-button {
  border-color: #f0c5c5;
  color: var(--bad);
}

.jobs-workspace-panel,
.jobs-admin-panel {
  margin-top: 18px;
}

.jobs-layout {
  display: grid;
  grid-template-columns: minmax(300px, 0.58fr) minmax(620px, 1fr);
  gap: 18px;
  align-items: start;
}

.jobs-list-panel {
  position: sticky;
  top: 18px;
  display: grid;
  gap: 12px;
}

.jobs-filters,
.jobs-list,
.document-list,
.timeline-list,
.line-item-list,
.review-flag-list {
  display: grid;
  gap: 10px;
}

.jobs-filters label,
.document-builder-grid label,
.line-item-toolbar label,
.draft-line-grid label,
.price-book-card-grid label,
.customer-card label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.jobs-filters input,
.jobs-filters select,
.document-builder-grid input,
.document-builder-grid select,
.document-builder-grid textarea,
.line-item-toolbar select,
.draft-line-grid input,
.draft-line-grid textarea,
.price-book-card-grid input,
.price-book-card-grid select,
.price-book-card-grid textarea,
.customer-card input,
.customer-card textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 12px;
  color: var(--ink);
  background: white;
}

.job-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
  padding: 12px;
}

.job-row.selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(18, 107, 90, 0.12);
}

.job-row-main {
  display: grid;
  gap: 4px;
  padding: 0;
  text-align: left;
  color: var(--ink);
  background: transparent;
  border: 0;
  cursor: pointer;
}

.job-row-side {
  display: grid;
  gap: 5px;
  justify-items: end;
  min-width: 120px;
}

.job-detail-panel {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.job-detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.7fr);
  gap: 14px;
}

.job-subpanel,
.document-card,
.review-flag-card,
.price-book-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
  padding: 14px;
  min-width: 0;
}

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

.intake-grid span,
.customer-fact-list span {
  display: grid;
  gap: 2px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.intake-grid strong {
  color: var(--ink);
  font-size: 12px;
}

.customer-fact-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.job-link-box {
  display: grid;
  gap: 8px;
  margin-top: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

.job-link-box code {
  color: var(--muted);
  overflow-wrap: anywhere;
  font-size: 12px;
}

.document-builder-grid,
.draft-line-grid,
.price-book-card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.line-item-toolbar {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto auto;
  gap: 10px;
  align-items: end;
  margin: 14px 0;
}

.draft-line-item {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

.line-item-result {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.line-item-result span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.line-item-result strong {
  font-size: 20px;
}

.document-totals,
.customer-totals {
  display: grid;
  gap: 8px;
  margin-top: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

.totals-row,
.customer-totals div,
.customer-line-items div,
.document-card-meta {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: start;
}

.totals-row.total,
.customer-totals .total {
  padding-top: 8px;
  border-top: 1px solid var(--line);
  font-size: 20px;
}

.document-card {
  display: grid;
  gap: 8px;
}

.document-card p {
  margin: 0;
  color: var(--muted);
}

.document-card-meta {
  color: var(--muted);
  font-size: 13px;
}

.document-preview {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  max-height: 280px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  padding: 10px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  line-height: 1.45;
}

.timeline-event {
  display: grid;
  gap: 4px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

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

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

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

.staff-card {
  display: grid;
  gap: 4px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
}

.staff-card span,
.staff-card small,
.review-flag-card p {
  color: var(--muted);
  line-height: 1.35;
}

.customer-job-body {
  min-height: 100vh;
  background: #eef3ef;
}

.customer-job-shell {
  width: min(980px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0;
  display: grid;
  gap: 18px;
}

.customer-job-hero,
.customer-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 24px;
}

.customer-job-hero {
  display: grid;
  gap: 18px;
}

.customer-job-hero .brand {
  color: var(--ink);
}

.customer-job-hero .brand p {
  color: var(--muted);
}

.customer-job-hero h2,
.customer-card h3,
.customer-card h4 {
  margin: 0;
}

.customer-job-hero > p,
.customer-card p {
  color: var(--muted);
  line-height: 1.55;
}

.customer-section-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.customer-section-head p {
  margin: 4px 0 0;
}

.customer-job-block {
  display: grid;
  gap: 12px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
}

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

.customer-info-grid span,
.customer-message-box,
.customer-document {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
  padding: 12px;
}

.customer-info-grid span {
  display: grid;
  gap: 3px;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.customer-info-grid strong {
  color: var(--ink);
  font-size: 12px;
}

.customer-message-box,
.customer-document,
.operator-actions {
  margin-top: 14px;
}

.customer-line-items {
  display: grid;
  gap: 8px;
}

.customer-line-items div {
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.customer-line-items span {
  display: grid;
  gap: 3px;
}

.customer-line-items small {
  color: var(--muted);
}

.customer-approval-box {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(18, 107, 90, 0.28);
  border-radius: 8px;
  background: #f4fbf7;
}

.customer-notice {
  padding: 10px 12px;
  border-radius: 8px;
  background: #f7ead8;
  color: var(--warn);
  font-weight: 700;
}

.customer-total-box {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px 16px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  margin: 12px 0;
}

.operator-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.document-history {
  display: grid;
  gap: 6px;
  color: var(--muted);
}

.manager-links,
.registry-panel {
  margin-top: 18px;
  border-top: 1px solid var(--line);
  padding-top: 18px;
}

.link-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.link-row > div {
  min-width: 0;
}

.link-row code {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#registrySnippet {
  min-height: 240px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  line-height: 1.45;
  resize: vertical;
}

.checkout-body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px;
  background: linear-gradient(135deg, #f6f7f4 0%, #e7f0ec 100%);
}

.checkout-shell {
  width: min(960px, 100%);
  display: grid;
  grid-template-columns: 1fr 420px;
  gap: 22px;
  align-items: stretch;
}

.checkout-copy,
.checkout-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 28px;
}

.checkout-copy .brand {
  color: var(--ink);
  margin-bottom: 42px;
}

.checkout-copy .brand p {
  color: var(--muted);
}

.checkout-copy h2 {
  margin: 0 0 12px;
  font-size: 34px;
  line-height: 1.05;
}

.checkout-copy > p {
  color: var(--muted);
  line-height: 1.55;
  max-width: 520px;
}

.checkout-panel h3 {
  margin: 0 0 8px;
  font-size: 22px;
}

.subscription-result {
  margin-top: 16px;
  padding: 12px;
  border-radius: 8px;
  background: #ddf2e6;
  color: var(--good);
  font-weight: 700;
  overflow-wrap: anywhere;
}

.quote-body {
  min-height: 100vh;
  background: #eef3ef;
}

.quote-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(420px, 0.65fr);
}

.quote-hero {
  padding: clamp(28px, 6vw, 76px);
  background:
    linear-gradient(rgba(16, 30, 26, 0.68), rgba(16, 30, 26, 0.78)),
    url("https://images.unsplash.com/photo-1621905251189-08b45d6a269e?auto=format&fit=crop&w=1600&q=80");
  background-size: cover;
  background-position: center;
  color: white;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.quote-brand-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 72px;
}

.quote-logo {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #d6f2df;
  color: #17352e;
  font-weight: 800;
}

.quote-business,
.quote-area {
  margin: 0;
}

.quote-business {
  font-weight: 800;
}

.quote-area {
  margin-top: 3px;
  color: rgba(255, 255, 255, 0.78);
}

.quote-hero h1 {
  margin: 0;
  max-width: 720px;
  font-size: clamp(42px, 6vw, 74px);
  line-height: 0.98;
}

.quote-hero > p {
  max-width: 600px;
  margin: 22px 0 0;
  color: rgba(255, 255, 255, 0.84);
  font-size: 19px;
  line-height: 1.45;
}

.quote-proof {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 30px;
}

.quote-proof span {
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.9);
  font-weight: 700;
}

.quote-card {
  padding: clamp(24px, 5vw, 58px);
  background: white;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.quote-card h2 {
  margin: 0 0 20px;
  font-size: 30px;
}

.quote-notice,
.reply-notice {
  margin: 0 0 18px;
  padding: 12px;
  border: 1px solid #f0d5b4;
  border-radius: 8px;
  background: #fff6e8;
  color: #76430f;
  font-weight: 800;
  line-height: 1.45;
}

.quote-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 13px;
}

.quote-card label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.quote-card input,
.quote-card select,
.quote-card textarea {
  width: 100%;
  border: 1px solid #cfd8d2;
  border-radius: 8px;
  padding: 12px;
  color: var(--ink);
  background: white;
}

.quote-message {
  margin-top: 13px;
}

.consent-row {
  grid-template-columns: 18px 1fr;
  align-items: start;
  margin-top: 14px;
  line-height: 1.4;
}

.consent-row input {
  width: 16px;
  margin-top: 2px;
}

.quote-submit {
  width: 100%;
  min-height: 48px;
  margin-top: 18px;
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: white;
  font-weight: 800;
  cursor: pointer;
}

.quote-submit:hover {
  background: var(--accent-strong);
}

.quote-fallback {
  margin: 14px 0 0;
  text-align: center;
  color: var(--muted);
}

.quote-fallback a {
  color: var(--accent-strong);
  font-weight: 800;
}

.hidden-field {
  display: none;
}

.reply-body {
  min-height: 100vh;
  background:
    radial-gradient(circle at 20% 0%, rgba(18, 107, 90, 0.16), transparent 32%),
    linear-gradient(135deg, #f6f7f4 0%, #e6f0eb 100%);
  display: grid;
  place-items: center;
  padding: 18px;
}

.reply-shell {
  width: min(520px, 100%);
}

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

.reply-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 22px;
}

.reply-brand h1,
.reply-brand p {
  margin: 0;
}

.reply-brand h1 {
  font-size: 24px;
  line-height: 1.1;
}

.reply-brand p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 14px;
}

.reply-form {
  display: grid;
  gap: 16px;
}

.reply-form label,
.reply-form fieldset {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.reply-form fieldset {
  border: 0;
  margin: 0;
  padding: 0;
}

.reply-form legend {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  margin-bottom: 8px;
}

.reply-form input[type="tel"],
.reply-form textarea {
  width: 100%;
  border: 1px solid #cfd8d2;
  border-radius: 8px;
  color: var(--ink);
  background: white;
  padding: 14px;
}

.reply-form textarea {
  resize: vertical;
  line-height: 1.45;
}

.reply-option {
  grid-template-columns: 22px 1fr;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  color: var(--ink);
}

.reply-option input {
  width: 18px;
  height: 18px;
}

.reply-option strong,
.reply-option small {
  display: block;
}

.reply-option small {
  margin-top: 3px;
  color: var(--muted);
  font-weight: 600;
}

.reply-note {
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
  text-align: center;
}

.reply-error {
  margin: 0;
  padding: 10px 12px;
  border-radius: 8px;
  background: #f7dddd;
  color: var(--bad);
  font-weight: 800;
}

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

  .main {
    padding: 18px;
  }

  .sidebar {
    position: static;
  }

  .topbar {
    flex-direction: column;
    align-items: stretch;
  }

  .topbar .action-row {
    width: 100%;
  }

  .topbar .action-row button {
    flex: 1 1 180px;
  }

  .metric-grid,
  .content-grid,
  .command-layout,
  .work-queue,
  .client-page-grid,
  .cloud-lead-controls,
  .prospect-controls,
  .prospect-summary,
  .prospect-layout,
  .prospect-row,
  .weakness-grid,
  .estimate-layout,
  .estimate-inputs,
  .jobs-layout,
  .job-detail-grid,
  .document-builder-grid,
  .draft-line-grid,
  .price-book-card-grid,
  .price-book-grid,
  .staff-grid,
  .line-item-toolbar,
  .manager-toolbar,
  .manager-layout,
  .lead-row-head,
  .lead-fulfillment-grid,
  .form-grid,
  .checkout-shell,
  .quote-shell,
  .quote-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .panel,
  .manager-layout > *,
  .prospect-layout > *,
  .estimate-layout > *,
  .estimate-inputs > *,
  .jobs-layout > *,
  .job-detail-grid > *,
  .document-builder-grid > *,
  .price-book-grid > *,
  .form-grid > *,
  .client-row-main,
  .client-row-actions {
    min-width: 0;
  }

  .quote-shell {
    min-height: auto;
  }

  .quote-brand-row {
    margin-bottom: 44px;
  }

  .span-2 {
    grid-column: span 1;
  }

  .manager-list-panel {
    position: static;
  }

  .lead-row-side {
    justify-items: start;
    min-width: 0;
  }

  .lead-actions {
    justify-content: flex-start;
  }

  .prospect-row-side {
    justify-items: start;
  }

  .jobs-list-panel {
    position: static;
  }

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

  .job-row-side,
  .line-item-result {
    justify-items: start;
    justify-content: flex-start;
  }

  .customer-section-head,
  .totals-row,
  .customer-totals div,
  .customer-line-items div,
  .document-card-meta {
    flex-direction: column;
  }

  .link-row {
    grid-template-columns: 1fr;
  }

  .ops-link,
  .page-action {
    grid-template-columns: minmax(0, 1fr);
  }

  .link-row code {
    white-space: normal;
    overflow-wrap: anywhere;
  }
}
