:root {
  --blue: #1d63ed;
  --blue-dark: #0b214a;
  --blue-soft: #eaf2ff;
  --border: #d8e4f7;
  --text: #162033;
  --muted: #5d6b82;
  --surface: #ffffff;
  --page: #f6f9ff;
  --shadow: 0 14px 45px rgba(16, 43, 84, 0.1);
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  overflow: hidden;
}

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

button,
input {
  font: inherit;
}

.topbar {
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 0 rgba(29, 99, 237, 0.08);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.status-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.status-strip span {
  padding: 5px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
}

.status-strip .ready {
  color: #0f5132;
  background: #d1f7df;
  border: 1px solid #9ce7bb;
}

.status-strip .pending {
  color: #7a4c00;
  background: #fff4d6;
  border: 1px solid #f1d181;
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  min-width: 0;
}

.brand strong,
.brand span {
  display: block;
}

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

.brand div {
  min-width: 0;
}

.brand strong,
.brand span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.logo-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--blue);
  border-radius: 8px;
  font-weight: 800;
  box-shadow: inset 0 -8px 0 rgba(0, 0, 0, 0.12);
}

.call-link {
  color: var(--blue);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
  text-decoration: none;
  font-weight: 700;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(300px, 0.95fr) minmax(250px, 0.68fr) minmax(420px, 1.35fr);
  gap: 1px;
  height: calc(100vh - 72px);
  background: var(--border);
  overflow: hidden;
}

.panel {
  min-width: 0;
  background: var(--surface);
  padding: 18px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.quote-panel {
  overflow-y: auto;
}

.jobs-panel {
  overflow-y: auto;
}

.panel-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding-bottom: 14px;
  border-bottom: 2px solid var(--blue-soft);
}

.panel-heading p {
  margin: 0;
  color: var(--blue-dark);
  font-size: 15px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.panel-heading span {
  color: var(--blue);
  background: var(--blue-soft);
  border-radius: 999px;
  padding: 5px 9px;
  font-size: 12px;
  font-weight: 700;
}

.messages {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow: auto;
  padding: 18px 2px;
}

.quick-start {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 14px 0 0;
}

.quick-start button {
  padding: 8px 10px;
  border-color: var(--border);
  color: var(--blue-dark);
  background: var(--blue-soft);
  font-size: 12px;
}

.message {
  max-width: 86%;
  border-radius: 8px;
  padding: 11px 13px;
  line-height: 1.45;
  border: 1px solid var(--border);
}

.message.assistant {
  align-self: flex-start;
  background: var(--blue-soft);
}

.message.user {
  align-self: flex-end;
  color: #fff;
  background: var(--blue);
  border-color: var(--blue);
}

.composer,
.upload-row {
  display: flex;
  gap: 10px;
  align-items: center;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.composer input,
.upload-row input {
  min-width: 0;
  flex: 1;
}

input {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 11px 12px;
  color: var(--text);
  background: #fff;
}

button {
  border: 1px solid var(--blue);
  border-radius: 8px;
  padding: 11px 14px;
  color: var(--blue);
  background: #fff;
  cursor: pointer;
  font-weight: 800;
}

button:hover {
  background: var(--blue-soft);
}

.composer button,
.primary-action {
  color: #fff;
  background: var(--blue);
}

.range-box {
  margin-top: 18px;
  border: 2px solid var(--blue);
  border-radius: 8px;
  padding: 18px;
  background: linear-gradient(180deg, #fff, var(--blue-soft));
}

.range-box span {
  display: block;
  color: var(--muted);
  font-weight: 700;
  margin-bottom: 8px;
}

.range-box strong {
  color: var(--blue-dark);
  font-size: clamp(28px, 4vw, 42px);
  line-height: 1;
}

.quote-list {
  margin: 18px 0;
  display: grid;
  gap: 10px;
}

.quote-list div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 11px 0;
  border-bottom: 1px solid var(--border);
}

dt {
  color: var(--muted);
  font-weight: 700;
}

dd {
  margin: 0;
  color: var(--blue-dark);
  font-weight: 800;
  text-align: right;
}

.reasoning {
  flex: 1;
}

.reasoning h2 {
  color: var(--blue-dark);
  font-size: 16px;
  margin: 0 0 8px;
}

.reasoning ul {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
}

.photo-insights {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.photo-insights h2,
.next-question h2 {
  margin: 0 0 8px;
  color: var(--blue-dark);
  font-size: 16px;
}

.photo-insights p,
.next-question p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.next-question {
  margin-top: 14px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fbfdff;
}

.missing-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.missing-row span {
  padding: 4px 7px;
  color: var(--blue-dark);
  background: var(--blue-soft);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
}

.missing-row.ready span {
  color: #fff;
  background: #0f8a4b;
  border-color: #0f8a4b;
}

.photo-note {
  display: grid;
  grid-template-columns: 62px 1fr;
  gap: 10px;
  align-items: center;
  margin-top: 10px;
}

.photo-note img {
  width: 62px;
  height: 62px;
  object-fit: cover;
  border: 1px solid var(--border);
  border-radius: 8px;
}

.photo-note strong {
  color: var(--blue-dark);
  font-size: 13px;
}

.photo-note small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
}

.lead-form {
  display: grid;
  gap: 9px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.lead-form h2 {
  margin: 0;
  color: var(--blue-dark);
  font-size: 16px;
}

.lead-form input {
  width: 100%;
  padding: 10px 11px;
}

.primary-action {
  width: 100%;
}

.booking-confirmation {
  display: grid;
  gap: 10px;
  margin-top: 14px;
  padding: 14px;
  border: 1px solid #9cc3ff;
  border-radius: 8px;
  background: linear-gradient(180deg, #fff, var(--blue-soft));
}

.booking-confirmation.is-hidden {
  display: none;
}

.booking-confirmation > span {
  width: fit-content;
  padding: 5px 8px;
  color: #fff;
  background: var(--blue);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.booking-confirmation h2 {
  margin: 0;
  color: var(--blue-dark);
  font-size: 17px;
}

.booking-confirmation p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.booking-confirmation dl {
  display: grid;
  gap: 8px;
  margin: 0;
}

.booking-confirmation dl div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

.sales-brief {
  display: grid;
  gap: 10px;
  margin-top: 14px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
}

.sales-brief.is-hidden {
  display: none;
}

.sales-brief span {
  display: inline-block;
  padding: 5px 8px;
  border-radius: 999px;
  color: var(--blue-dark);
  background: var(--blue-soft);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.sales-brief .priority-hot {
  color: #fff;
  background: var(--blue);
}

.sales-brief .priority-warm {
  color: #0f5132;
  background: #d1f7df;
  border: 1px solid #9ce7bb;
}

.sales-brief .priority-needs_info {
  color: #7a4c00;
  background: #fff4d6;
  border: 1px solid #f1d181;
}

.sales-brief h2 {
  margin: 8px 0 0;
  color: var(--blue-dark);
  font-size: 16px;
}

.sales-brief p {
  margin: 0;
  color: var(--blue-dark);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.45;
}

.sales-brief ul {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 13px;
}

.sales-brief blockquote {
  margin: 0;
  padding: 10px 12px;
  border-left: 3px solid var(--blue);
  border-radius: 8px;
  color: var(--muted);
  background: var(--blue-soft);
  font-size: 13px;
  line-height: 1.45;
}

.payload-preview {
  display: grid;
  gap: 12px;
  margin-top: 14px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fbfdff;
}

.payload-preview.is-hidden {
  display: none;
}

.payload-preview-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.payload-preview h2 {
  margin: 0;
  color: var(--blue-dark);
  font-size: 16px;
}

.payload-preview p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.payload-preview-header button {
  flex: 0 0 auto;
  padding: 8px 10px;
  font-size: 12px;
}

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

.payload-summary div {
  min-width: 0;
  padding: 9px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
}

.payload-summary span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.payload-summary strong {
  display: block;
  margin-top: 4px;
  overflow: hidden;
  color: var(--blue-dark);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.payload-preview pre {
  max-height: 240px;
  margin: 0;
  overflow: auto;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--blue-dark);
  background: #fff;
  font-size: 12px;
  line-height: 1.5;
  white-space: pre-wrap;
}

.fine-print {
  color: var(--muted);
  font-size: 13px;
}

.match-summary {
  margin-top: 12px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.jobs-grid-wrap {
  margin-top: 16px;
  overflow-y: auto;
  max-height: calc(100vh - 240px);
  min-height: 200px;
}

.job-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.job-grid-card {
  position: relative;
  border-radius: 10px;
  border: 2px solid var(--border);
  overflow: hidden;
  cursor: pointer;
  background: #fff;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.job-grid-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(11, 33, 74, 0.12);
}

.job-grid-card.highlighted {
  border-color: #1d63ed;
  box-shadow: 0 0 0 2px rgba(29, 99, 237, 0.12);
  order: -1;
}

.job-grid-card.highlighted:hover {
  transform: translateY(-3px) scale(1.01);
  box-shadow: 0 6px 20px rgba(29, 99, 237, 0.22);
}

.card-photo-wrap {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--blue-soft);
}

.card-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.22s ease;
}

.job-grid-card:hover .card-photo {
  transform: scale(1.05);
}

.card-photo-placeholder {
  background: linear-gradient(135deg, #e8eef8 0%, #d0dcf0 100%);
}

.card-scrim {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 28px 10px 8px;
  background: linear-gradient(to top, rgba(11, 33, 74, 0.84), transparent);
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 6px;
}

.card-label {
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.card-match-badge {
  flex-shrink: 0;
  padding: 3px 7px;
  border-radius: 999px;
  background: #1d63ed;
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.card-body {
  padding: 10px 12px 12px;
}

.card-primary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 5px;
}

.card-name {
  font-size: 12px;
  font-weight: 700;
  color: var(--blue-dark);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-score {
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 800;
  color: #1d63ed;
  background: #e8f0ff;
  padding: 2px 7px;
  border-radius: 999px;
}

.card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0 6px;
  font-size: 11px;
  color: var(--muted);
  font-weight: 600;
}

.card-meta span + span::before {
  content: "·";
  margin-right: 6px;
  opacity: 0.4;
}

.card-hover-detail {
  display: none;
  margin-top: 9px;
  padding-top: 9px;
  border-top: 1px solid var(--border);
}

.job-grid-card:hover .card-hover-detail {
  display: block;
}

.card-price {
  font-size: 13px;
  font-weight: 800;
  color: var(--blue-dark);
  margin-bottom: 7px;
}

.card-reasons {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 7px;
}

.card-reasons span {
  padding: 3px 7px;
  background: #1d63ed;
  color: #fff;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
}

.card-testimonial {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.45;
  margin: 0;
  font-style: italic;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.grid-empty {
  color: var(--muted);
  font-size: 13px;
  padding: 24px 0;
  text-align: center;
}

.job-card {
  margin-top: 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px;
  box-shadow: var(--shadow);
}

.job-card strong {
  color: var(--blue-dark);
}

.job-card p {
  color: var(--muted);
  margin: 8px 0 0;
}

.before-after {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 12px;
}

.before-after figure {
  position: relative;
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 8px;
  aspect-ratio: 4 / 3;
  background: var(--blue-soft);
}

.before-after img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.before-after figcaption {
  position: absolute;
  left: 8px;
  bottom: 8px;
  padding: 4px 7px;
  color: #fff;
  background: rgba(11, 33, 74, 0.82);
  border-radius: 6px;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.photo-status {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: -2px 0 12px;
}

.photo-status span {
  padding: 4px 7px;
  border: 1px solid #f1d181;
  border-radius: 999px;
  color: #7a4c00;
  background: #fff4d6;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.photo-status small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.match-reasons {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.match-reasons span {
  padding: 5px 8px;
  color: #fff;
  background: var(--blue);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
}

.tag-row span {
  padding: 4px 7px;
  color: var(--blue-dark);
  background: var(--blue-soft);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
}

.mobile-tabs {
  display: none;
}

.admin-page {
  background: var(--page);
}

.admin-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 40px;
}

.admin-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 0;
}

.admin-hero p {
  margin: 0 0 6px;
  color: var(--blue);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

.admin-hero h1 {
  max-width: 720px;
  margin: 0;
  color: var(--blue-dark);
  font-size: 30px;
  line-height: 1.1;
}

.admin-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.admin-hero span,
.admin-hero a {
  padding: 8px 12px;
  color: var(--blue-dark);
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-weight: 800;
  text-decoration: none;
}

.admin-hero a {
  color: var(--blue);
}

.admin-preflight {
  display: grid;
  gap: 14px;
  margin-bottom: 18px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 10px 30px rgba(16, 43, 84, 0.06);
}

.preflight-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.preflight-heading p {
  margin: 0 0 4px;
  color: var(--blue);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.preflight-heading h2 {
  margin: 0;
  color: var(--blue-dark);
  font-size: 20px;
  line-height: 1.25;
}

.preflight-heading button {
  flex: 0 0 auto;
  padding: 8px 10px;
  font-size: 12px;
}

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

.preflight-card {
  min-width: 0;
  padding: 11px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fbfdff;
}

.preflight-card span {
  display: inline-block;
  padding: 4px 7px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.preflight-card.is-ready span {
  color: #0f5132;
  background: #d1f7df;
  border: 1px solid #9ce7bb;
}

.preflight-card.is-pending span {
  color: #7a4c00;
  background: #fff4d6;
  border: 1px solid #f1d181;
}

.preflight-card h3 {
  margin: 10px 0 6px;
  color: var(--blue-dark);
  font-size: 13px;
}

.preflight-card strong,
.preflight-card p {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.preflight-card strong {
  color: var(--blue);
  font-size: 13px;
}

.preflight-card p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.next-required {
  padding: 12px;
  border: 1px solid #f1d181;
  border-radius: 8px;
  color: #7a4c00;
  background: #fffaf0;
}

.next-required.is-ready {
  color: #0f5132;
  background: #f0fff5;
  border-color: #9ce7bb;
}

.next-required strong {
  display: block;
  color: inherit;
  margin-bottom: 6px;
}

.next-required p,
.next-required ul {
  margin: 0;
}

.next-required ul {
  padding-left: 18px;
}

.next-required li {
  margin-top: 4px;
}

.lead-workbench {
  display: grid;
  gap: 14px;
  margin-bottom: 18px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 10px 30px rgba(16, 43, 84, 0.06);
}

.lead-workbench-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
}

.lead-workbench-heading p {
  margin: 0 0 4px;
  color: var(--blue);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.lead-workbench-heading h2 {
  margin: 0;
  color: var(--blue-dark);
  font-size: 20px;
  line-height: 1.25;
}

.lead-workbench-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-start;
}

.lead-workbench-stats span,
.ready-call-card span,
.ready-call-badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 5px 8px;
  border-radius: 999px;
  color: var(--blue-dark);
  background: var(--blue-soft);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.ready-call-view {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.ready-call-card,
.ready-call-empty {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fbfdff;
}

.ready-call-card {
  border-color: rgba(29, 99, 237, 0.28);
}

.ready-call-card h3 {
  margin: 10px 0 5px;
  color: var(--blue-dark);
  font-size: 16px;
}

.ready-call-card p,
.ready-call-empty p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.ready-call-card button {
  width: 100%;
  margin-top: 12px;
  padding: 8px 10px;
  font-size: 12px;
}

.ready-call-empty {
  grid-column: 1 / -1;
}

.ready-call-empty strong {
  display: block;
  margin-bottom: 4px;
  color: var(--blue-dark);
}

.lead-controls {
  display: grid;
  grid-template-columns: minmax(220px, 1.5fr) repeat(4, minmax(120px, 1fr));
  gap: 10px;
}

.lead-controls label {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.lead-controls span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.lead-controls input,
.lead-controls select {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px;
  color: var(--blue-dark);
  background: #fff;
  font: inherit;
  font-weight: 700;
}

.admin-empty,
.admin-error,
.lead-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
}

.admin-empty,
.admin-error {
  padding: 24px;
}

.admin-empty.is-hidden {
  display: none;
}

.admin-empty h2,
.admin-error h2 {
  margin: 0 0 8px;
  color: var(--blue-dark);
}

.admin-empty p,
.admin-error p {
  margin: 0;
  color: var(--muted);
}

.lead-inbox {
  display: grid;
  gap: 14px;
}

.lead-card {
  padding: 16px;
  box-shadow: 0 10px 30px rgba(16, 43, 84, 0.06);
}

.lead-card.is-ready-call {
  border-color: rgba(29, 99, 237, 0.32);
  box-shadow: 0 12px 34px rgba(29, 99, 237, 0.1);
}

.lead-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.lead-card h2 {
  margin: 8px 0 4px;
  color: var(--blue-dark);
  font-size: 20px;
}

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

.lead-priority {
  display: inline-block;
  padding: 5px 8px;
  border-radius: 999px;
  color: var(--blue-dark);
  background: var(--blue-soft);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.ready-call-badge {
  margin-left: 6px;
  color: #0f5132;
  background: #d1f7df;
  border: 1px solid #9ce7bb;
}

.lead-status {
  display: grid;
  gap: 5px;
  min-width: 190px;
}

.lead-status span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.lead-status select {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 9px 10px;
  color: var(--blue-dark);
  background: #fff;
  font: inherit;
  font-weight: 800;
}

.lead-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.lead-actions button {
  padding: 8px 10px;
  font-size: 12px;
}

.lead-metrics {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  margin: 16px 0;
}

.lead-metrics div {
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fbfdff;
}

.lead-metrics dt {
  font-size: 11px;
  text-transform: uppercase;
}

.lead-metrics dd {
  margin-top: 4px;
  overflow: hidden;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lead-next-step {
  padding: 12px;
  border-radius: 8px;
  background: var(--blue-soft);
}

.lead-next-step strong {
  color: var(--blue-dark);
}

.lead-next-step p {
  margin-top: 4px;
}

.lead-card details {
  margin-top: 14px;
}

.lead-card summary {
  color: var(--blue);
  cursor: pointer;
  font-weight: 800;
}

.lead-detail-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.lead-detail-grid section {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fbfdff;
}

.lead-detail-grid h3,
.lead-card details h3 {
  margin: 0 0 8px;
  color: var(--blue-dark);
  font-size: 13px;
}

.lead-detail-grid p,
.lead-detail-grid li {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.lead-detail-grid ul {
  margin: 8px 0 0;
  padding-left: 18px;
}

.lead-card blockquote {
  margin: 12px 0;
  padding: 10px 12px;
  border-left: 3px solid var(--blue);
  border-radius: 8px;
  color: var(--muted);
  background: var(--blue-soft);
}

.lead-card pre {
  max-height: 320px;
  overflow: auto;
  margin: 0;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--blue-dark);
  background: #fbfdff;
  font-size: 12px;
  line-height: 1.5;
  white-space: pre-wrap;
}

@media (max-width: 920px) {
  .topbar {
    padding: 0 14px;
  }

  .call-link {
    padding: 8px 10px;
    font-size: 13px;
  }

  .topbar-actions {
    gap: 8px;
  }

  .status-strip {
    display: none;
  }

  .mobile-tabs {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1px;
    background: var(--border);
  }

  .tab-button {
    border: 0;
    border-radius: 0;
    padding: 12px 6px;
    background: #fff;
  }

  .tab-button.active {
    color: #fff;
    background: var(--blue);
  }

  .workspace {
    display: block;
    height: calc(100vh - 120px);
    overflow: hidden;
  }

  .panel {
    display: none;
    height: calc(100vh - 120px);
    overflow: hidden;
  }

  .panel.active-mobile {
    display: flex;
  }

  .quote-panel.active-mobile {
    overflow-y: auto;
  }

  .jobs-panel.active-mobile {
    overflow-y: auto;
  }
}

@media (max-width: 900px) and (min-width: 641px) {
  .job-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .topbar {
    height: auto;
    min-height: 72px;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 12px;
  }

  .brand {
    flex: 1;
    gap: 10px;
  }

  .brand strong {
    max-width: 190px;
  }

  .brand span {
    max-width: 210px;
  }

  .logo-mark {
    width: 38px;
    height: 38px;
    flex: 0 0 auto;
  }

  .topbar-actions {
    flex: 0 0 auto;
  }

  .call-link {
    padding: 8px 9px;
    white-space: nowrap;
  }

  .mobile-tabs {
    position: sticky;
    top: 0;
    z-index: 5;
  }

  .tab-button {
    min-height: 44px;
  }

  .workspace {
    height: calc(100vh - 123px);
  }

  .panel {
    height: calc(100vh - 123px);
    padding: 14px;
  }

  .panel-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .messages {
    min-height: 280px;
    padding: 14px 0;
  }

  .message {
    max-width: 94%;
  }

  .quick-start {
    gap: 7px;
  }

  .quick-start button {
    flex: 1 1 calc(50% - 7px);
    min-height: 40px;
  }

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

  .composer {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: stretch;
  }

  input {
    font-size: 16px;
  }

  .range-box {
    margin-top: 14px;
    padding: 14px;
  }

  .range-box strong {
    font-size: 32px;
  }

  .quote-list div {
    align-items: flex-start;
  }

  .jobs-grid-wrap {
    max-height: none;
  }

  .job-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .card-hover-detail {
    display: block;
  }

  .job-card {
    box-shadow: none;
  }

  .before-after {
    grid-template-columns: 1fr;
  }

  .admin-hero {
    align-items: flex-start;
    flex-direction: column;
  }

  .admin-hero-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .lead-workbench-heading {
    flex-direction: column;
  }

  .lead-workbench-stats {
    justify-content: flex-start;
  }

  .ready-call-view {
    grid-template-columns: 1fr;
  }

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

  .lead-controls label:first-child {
    grid-column: 1 / -1;
  }

  .lead-card-header {
    flex-direction: column;
  }

  .lead-card-header button {
    width: 100%;
  }

  .lead-status {
    width: 100%;
  }

  .lead-actions button {
    flex: 1 1 calc(50% - 8px);
  }

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

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

  .payload-preview-header {
    flex-direction: column;
  }

  .payload-preview-header button {
    width: 100%;
  }

  .payload-summary {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 420px) {
  .brand strong {
    max-width: 145px;
  }

  .brand span {
    max-width: 165px;
  }

  .call-link {
    font-size: 12px;
  }

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

  .composer button,
  .upload-row button {
    width: 100%;
  }

  .quote-list div {
    flex-direction: column;
    gap: 4px;
  }

  .booking-confirmation dl div {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  dd {
    text-align: left;
  }

  .photo-note {
    grid-template-columns: 54px 1fr;
  }

  .photo-note img {
    width: 54px;
    height: 54px;
  }

  .admin-shell {
    width: min(100% - 24px, 1180px);
    padding-top: 18px;
  }

  .admin-hero h1 {
    font-size: 24px;
  }

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

  .lead-controls label:first-child {
    grid-column: auto;
  }

  .ready-call-badge {
    margin: 6px 0 0;
  }

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

  .lead-actions button {
    flex: 1 1 100%;
  }

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

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

  .preflight-heading {
    display: grid;
  }
}

/* Conversational lead confirmation card in chat */
.confirmation-card {
  background: #f0f7ff;
  border: 1.5px solid #1d63ed;
  border-radius: 10px;
  padding: 14px 16px;
  max-width: 88%;
  align-self: flex-start;
}
.confirmation-card .conf-header {
  font-weight: 700;
  color: #1d63ed;
  font-size: 13px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.confirmation-card .conf-header::before {
  content: "✓";
  background: #1d63ed;
  color: #fff;
  border-radius: 50%;
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  flex-shrink: 0;
}
.confirmation-card dl {
  margin: 8px 0;
}
.confirmation-card dl div {
  display: flex;
  gap: 8px;
  margin-bottom: 3px;
}
.confirmation-card dt {
  color: #65758b;
  font-size: 12px;
  min-width: 100px;
  flex-shrink: 0;
}
.confirmation-card dd {
  font-weight: 600;
  font-size: 12px;
}
.confirmation-card .conf-footer {
  font-size: 12px;
  color: #65758b;
  margin-top: 8px;
  border-top: 1px solid #e2e8f0;
  padding-top: 8px;
}
.confirmation-card .conf-email-note {
  font-size: 12px;
  color: #65758b;
  margin-top: 6px;
}
.confirmation-card .conf-thankyou {
  font-size: 22px;
  font-weight: 700;
  color: #1d63ed;
  margin-top: 14px;
  text-align: center;
  letter-spacing: 0.01em;
}
/* Lead capture field highlight when auto-populated by agent */
.lead-form input.agent-filled {
  border-color: #1d63ed;
  background: #f0f7ff;
}
.booking-contact {
  font-size: 13px;
  color: #0b214a;
  font-weight: 600;
  margin-bottom: 8px;
}
