/* ═══════════════════════════════════════════
   JOBS TOOLBAR
═══════════════════════════════════════════ */
.view-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
}
.view-title {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
  color: var(--text-1);
}
.view-count {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-2);
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 3px 10px;
  border-radius: 20px;
}
.toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.select-filter {
  background: var(--surface)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='11' height='11' viewBox='0 0 24 24' fill='none' stroke='%239aabb8' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E")
    no-repeat right 9px center;
  border: 1px solid var(--border);
  color: var(--text-1);
  border-radius: var(--r-sm);
  padding: 7px 28px 7px 12px;
  font-size: 12.5px;
  outline: none;
  cursor: pointer;
  appearance: none;
}

/* ═══════════════════════════════════════════
   JOB LIST CARDS (with colored left stripe)
═══════════════════════════════════════════ */
.job-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.job-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 13px 16px;
  display: grid;
  grid-template-columns: 4px 1fr auto;
  gap: 13px;
  align-items: center;
  cursor: pointer;
  transition:
    border-color 0.12s,
    box-shadow 0.12s;
  text-decoration: none;
  color: inherit;
  animation: risein 0.3s ease both;
}
.job-card:hover {
  border-color: var(--brass);
  box-shadow: 0 1px 8px rgba(0, 0, 0, 0.06);
}
.job-card.selected {
  border-color: var(--brass);
  box-shadow: 0 0 0 3px var(--brass-soft);
}
.job-stripe {
  width: 4px;
  height: 42px;
  border-radius: 3px;
  flex-shrink: 0;
}
.job-body {
  min-width: 0;
}
.job-top {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 3px;
}
.job-num {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--brass);
  letter-spacing: 0.04em;
}
.job-client {
  font-weight: 600;
  font-size: 14px;
  color: var(--text-1);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.job-addr {
  font-size: 11.5px;
  color: var(--text-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 1px;
}
.job-tags {
  display: flex;
  gap: 4px;
  margin-top: 5px;
}
.job-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 5px;
  flex-shrink: 0;
}
.job-amount {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  color: var(--text-1);
}
.job-crew {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: var(--text-2);
}
.crew-pip {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* Full list job cards (6-col) — jobs index */
.list-header {
  display: grid;
  grid-template-columns: 4px 2fr 1fr 1fr 1fr auto;
  gap: 14px;
  padding: 0 18px 8px;
  margin-bottom: 2px;
}
.list-header span {
  font-family: var(--font-mono);
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-3);
}
.jobs-full-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.job-card-lg {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 13px 18px;
  display: grid;
  grid-template-columns: 4px 2fr 1fr 1fr 1fr auto;
  gap: 14px;
  align-items: center;
  cursor: pointer;
  transition:
    border-color 0.12s,
    box-shadow 0.12s;
  animation: risein 0.3s ease both;
}
.list-header.jobs-list-no-virtual,
.job-card-lg.jobs-list-no-virtual {
  grid-template-columns: 4px 2fr 1fr 1fr 1fr auto;
}
.job-card-lg:nth-child(1) {
  animation-delay: 0.03s;
}
.job-card-lg:nth-child(2) {
  animation-delay: 0.06s;
}
.job-card-lg:nth-child(3) {
  animation-delay: 0.09s;
}
.job-card-lg:nth-child(4) {
  animation-delay: 0.12s;
}
.job-card-lg:nth-child(5) {
  animation-delay: 0.15s;
}
.job-card-lg:nth-child(6) {
  animation-delay: 0.18s;
}
.job-card-lg:nth-child(7) {
  animation-delay: 0.21s;
}
.job-card-lg:nth-child(8) {
  animation-delay: 0.24s;
}
.job-card-lg:nth-child(9) {
  animation-delay: 0.27s;
}
.job-card-lg:nth-child(10) {
  animation-delay: 0.3s;
}
.job-card-lg:hover {
  border-color: var(--brass);
  box-shadow: 0 1px 8px rgba(0, 0, 0, 0.06);
}
.jlg-stripe {
  width: 4px;
  height: 38px;
  border-radius: 3px;
}
.jlg-main {
  min-width: 0;
}
.jlg-num {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--brass);
}
.jlg-client {
  font-weight: 600;
  font-size: 13.5px;
  color: var(--text-1);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.jlg-addr {
  font-size: 11.5px;
  color: var(--text-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.jlg-stage {
  display: flex;
  align-items: center;
}
.jlg-services {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}
.jlg-crew {
  font-size: 12px;
  color: var(--text-2);
  display: flex;
  align-items: center;
  gap: 5px;
}
.jlg-amount {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  color: var(--text-1);
  white-space: nowrap;
}
.job-unassigned {
  font-size: 11px;
  color: var(--text-3);
  font-style: italic;
}

.jobs-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.jobs-count {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-2);
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 3px 10px;
  border-radius: 20px;
}

/* ═══════════════════════════════════════════
   STAGE TRACKER (::before/::after lines)
═══════════════════════════════════════════ */
.stage-track-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 18px 24px;
  margin-bottom: 22px;
  overflow-x: auto;
}
.stage-track {
  display: flex;
  align-items: flex-start;
  min-width: 600px;
}
.stage-track-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  position: relative;
}
.stage-track-step::before {
  content: "";
  position: absolute;
  top: 10px;
  left: 0;
  width: 50%;
  height: 2px;
  background: var(--border);
  z-index: 0;
}
.stage-track-step::after {
  content: "";
  position: absolute;
  top: 10px;
  left: 50%;
  width: 50%;
  height: 2px;
  background: var(--border);
  z-index: 0;
}
.stage-track-step:first-child::before {
  display: none;
}
.stage-track-step:last-child::after {
  display: none;
}
.stage-track-step.done::before,
.stage-track-step.done::after {
  background: var(--brass);
}
.stage-track-step.current::before {
  background: var(--brass);
}

.step-dot {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: var(--surface-hi);
  position: relative;
  z-index: 1;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  margin-bottom: 5px;
}
.stage-track-step.done .step-dot {
  border-color: var(--brass);
  background: var(--brass);
}
.stage-track-step.done .step-dot::after {
  content: "";
  position: absolute;
  top: 4px;
  left: 7px;
  width: 5px;
  height: 8px;
  border-right: 2px solid #fff;
  border-bottom: 2px solid #fff;
  transform: rotate(45deg);
}
.stage-track-step.current .step-dot {
  border-color: var(--brass);
  background: var(--brass);
  box-shadow: 0 0 0 3px var(--brass-soft);
}

.step-label {
  font-family: var(--font-mono);
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-3);
  text-align: center;
  white-space: nowrap;
  line-height: 1;
}
.stage-track-step.done .step-label {
  color: var(--brass-lo);
}
.stage-track-step.current .step-label {
  color: var(--brass);
  font-weight: 600;
}

/* ═══════════════════════════════════════════
   PRE-PRODUCTION CHECKLIST ITEMS
═══════════════════════════════════════════ */
.preprod-group {
  margin-bottom: 20px;
}
.preprod-group-title {
  font-family: var(--font-mono);
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--text-3);
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border-lo);
}
.preprod-item {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 10px 12px;
  background: var(--surface-hi);
  border-radius: var(--r-sm);
  border: 1px solid var(--border-lo);
  margin-bottom: 8px;
}
.preprod-check {
  width: 18px;
  height: 18px;
  border-radius: 4px;
  border: 2px solid var(--border);
  flex-shrink: 0;
  margin-top: 1px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.preprod-check.done {
  background: var(--s-complete);
  border-color: var(--s-complete);
}
.preprod-check.warn {
  background: #f59e0b;
  border-color: #f59e0b;
}
.preprod-check svg {
  width: 10px;
  height: 10px;
}
.preprod-body {
  flex: 1;
}
.preprod-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-1);
}
.preprod-detail {
  font-size: 11px;
  color: var(--text-2);
  margin-top: 2px;
}
.preprod-meta {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--brass);
  margin-top: 3px;
}

/* ═══════════════════════════════════════════
   VIEW TOOLBAR (filter row above lists)
═══════════════════════════════════════════ */
.view-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.search-input-inline {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 7px 12px;
  font-size: 12.5px;
  color: var(--text-1);
  outline: none;
  transition: border-color 0.15s;
  min-width: 220px;
}
.search-input-inline::placeholder {
  color: var(--text-3);
}
.search-input-inline:focus {
  border-color: var(--brass);
}
.select-inline {
  background: var(--surface)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='11' height='11' viewBox='0 0 24 24' fill='none' stroke='%239aabb8' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E")
    no-repeat right 9px center;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 7px 28px 7px 10px;
  font-size: 12.5px;
  color: var(--text-1);
  outline: none;
  cursor: pointer;
  appearance: none;
}

/* Stage advance controls */
.stage-advance-group {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.stage-jump-label {
  font-size: 11px;
  color: var(--text-3);
  white-space: nowrap;
}

/* ═══════════════════════════════════════════
   JOB SHOW HEADER
═══════════════════════════════════════════ */
.job-show-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.job-show-meta {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ═══════════════════════════════════════════
   JOB CARD COLUMN HELPERS
═══════════════════════════════════════════ */
.job-date {
  text-align: right;
}

/* ═══════════════════════════════════════════
   PROPOSAL OPTIONS
═══════════════════════════════════════════ */
.prop-option-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 22px;
}
.prop-option-card {
  border: 2px solid var(--border);
  border-radius: var(--r-lg);
  padding: 18px;
  cursor: pointer;
  transition:
    border-color 0.15s,
    box-shadow 0.15s;
  position: relative;
}
.prop-option-card:hover {
  border-color: var(--text-3);
}
.prop-option-card.selected {
  border-color: var(--brass);
  box-shadow: 0 0 0 3px var(--brass-soft);
}
.poc-tier {
  font-family: var(--font-mono);
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-3);
  margin-bottom: 5px;
}
.poc-label {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  color: var(--text-1);
  margin-bottom: 10px;
}
.poc-price {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 700;
  color: var(--text-1);
}
.poc-sel-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  background: var(--brass);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 8px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 2px 8px;
  border-radius: 20px;
}

/* Material order cards */
.mat-card {
  padding: 10px 14px;
  background: var(--surface);
  border: 1px solid var(--border-lo);
  border-radius: var(--r-sm);
  border-left: 3px solid var(--border);
  transition: box-shadow 0.15s ease;
}
.mat-card:hover {
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}
.mat-card-pending {
  border-left-color: var(--text-3);
}
.mat-card-ordered {
  border-left-color: #2563eb;
}
.mat-card-confirmed {
  border-left-color: #b45309;
}
.mat-card-delivered {
  border-left-color: #16a34a;
}
.mat-card-cancelled {
  border-left-color: #94a3b8;
}

/* Material order status pills */
.mat-status {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 2px 7px;
  border-radius: var(--r-pill);
  flex-shrink: 0;
}
.mat-pending {
  background: rgba(0, 0, 0, 0.04);
  color: var(--text-3);
}
.mat-ordered {
  background: #eff6ff;
  color: #2563eb;
}
.mat-confirmed {
  background: #fffbeb;
  color: #b45309;
}
.mat-delivered {
  background: #f0fdf4;
  color: #16a34a;
}
.mat-cancelled {
  background: rgba(0, 0, 0, 0.03);
  color: #94a3b8;
  text-decoration: line-through;
}

/* Collapsible line items toggle */
.mat-items-toggle {
  cursor: pointer;
  font-size: 11px;
  color: var(--brass);
  font-weight: 600;
  user-select: none;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 4px;
}
.mat-items-toggle::-webkit-details-marker {
  display: none;
}
.mat-chevron {
  font-size: 8px;
  transition: transform 0.2s ease;
}
details[open] > .mat-items-toggle .mat-chevron {
  transform: rotate(90deg);
}

/* ═══════════════════════════════════════════
   PROCESS CHECKLIST
═══════════════════════════════════════════ */
.detail-card details > summary::-webkit-details-marker {
  display: none;
}
.detail-card details > summary::marker {
  display: none;
  content: "";
}
.detail-card details[open] > summary .fa-chevron-down {
  transform: rotate(180deg);
}
.detail-card details:not([open]) > summary .fa-chevron-down {
  transform: rotate(0deg);
}

/* Phase details within the checklist */
details > summary::-webkit-details-marker {
  display: none;
}
details > summary::marker {
  display: none;
  content: "";
}
details[open] > summary .fa-chevron-down {
  transform: rotate(180deg);
}

@media (max-width: 768px) {
  .list-header {
    display: none;
  }
  /* Compact card: vertical stack with stripe accent */
  .job-card-lg {
    display: grid;
    grid-template-columns: 4px 1fr;
    grid-template-rows: auto;
    gap: 0 10px;
    padding: 10px 14px;
    position: relative;
  }
  .jlg-stripe {
    grid-row: 1 / -1;
    width: 4px;
    height: auto;
    border-radius: 3px;
    align-self: stretch;
  }
  .jlg-main {
    grid-column: 2;
  }
  .jlg-num {
    font-size: 9.5px;
  }
  .jlg-client {
    font-size: 13px;
    padding-right: 60px;
  }
  .jlg-addr {
    font-size: 11px;
  }
  /* Stage + services as separate rows under main */
  .jlg-stage {
    grid-column: 2;
    margin-top: 5px;
  }
  .jlg-services {
    grid-column: 2;
    margin-top: 3px;
  }
  .jlg-crew {
    display: none;
  }
  /* Date top-right */
  .job-date {
    position: absolute;
    top: 10px;
    right: 14px;
    text-align: right;
  }
  /* Filters: tighter */
  .jobs-toolbar {
    gap: 6px;
  }
  .search-input-inline {
    min-width: 0;
    width: 100%;
  }
  .select-filter {
    font-size: 11.5px;
    padding: 6px 26px 6px 8px;
  }
  /* Stage tracker: compact on mobile — hide labels, shrink dots */
  .stage-track {
    min-width: 0;
    gap: 0;
  }
  .step-label {
    display: none;
  }
  .step-dot {
    width: 16px;
    height: 16px;
  }
  .stage-track-step.done .step-dot::after {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -60%) rotate(45deg);
    width: 3px;
    height: 6px;
    border-width: 1.5px;
  }
  .stage-track-step::before,
  .stage-track-step::after {
    top: 7px;
  }
  .detail-card {
    overflow: hidden;
  }
  /* Job show header */
  .job-show-header {
    gap: 8px;
  }
  .stage-advance-group {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }
  .prop-option-grid {
    grid-template-columns: 1fr;
  }
}

/* ═══════════════════════════════════════════
   VIRTUAL VISIT — staff summary card on job show
═══════════════════════════════════════════ */

.vv-card__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
}

.vv-card__title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--text-3);
}

.vv-card__title i {
  color: var(--brass);
  font-size: 13px;
}

.vv-card__empty {
  font-size: 12px;
  color: var(--text-3);
  margin: 0 0 12px 0;
  max-width: 560px;
}

.vv-status-pill {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 999px;
  letter-spacing: 0.03em;
  background: #f1f5f9;
  color: #475569;
}

.vv-status-pill--draft {
  background: #eff6ff;
  color: #1d4ed8;
}

.vv-status-pill--ready_for_booking {
  background: #fef3c7;
  color: #a16207;
}

.vv-status-pill--booked {
  background: #dcfce7;
  color: #15803d;
}

.vv-status-pill--expired {
  background: #fee2e2;
  color: #b91c1c;
}

.vv-status-pill--cancelled {
  background: #f1f5f9;
  color: #64748b;
}

.vv-best-next-move {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 13.5px;
  line-height: 1.4;
  margin-bottom: 14px;
  border-left: 3px solid;
}

.vv-best-next-move i {
  flex-shrink: 0;
  margin-top: 2px;
  font-size: 14px;
}

.vv-best-next-move--info {
  background: #eff6ff;
  border-color: #3b82f6;
  color: #1e3a8a;
}

.vv-best-next-move--warning {
  background: #fffbeb;
  border-color: #f59e0b;
  color: #92400e;
}

.vv-best-next-move--alert {
  background: #fef2f2;
  border-color: #ef4444;
  color: #991b1b;
}

.vv-kpi-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 14px;
}

.vv-kpi-stat {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
}

.vv-kpi-stat__label {
  font-size: 10px;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 4px;
}

.vv-kpi-stat__value {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-1);
}

.vv-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.vv-actions form {
  margin: 0;
}

.vv-actions__secondary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  flex-wrap: wrap;
}

.vv-secure-link {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-3);
  background: #f8fafc;
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid var(--border);
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: inline-block;
}

.vv-card__manage {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #f1f5f9;
}

.vv-manage-link {
  font-size: 12px;
  color: var(--brass);
  font-weight: 600;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.vv-manage-link:hover {
  text-decoration: underline;
}

@media (max-width: 640px) {
  .vv-card__header {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }

  .vv-kpi-grid {
    grid-template-columns: 1fr;
    gap: 6px;
  }

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

  .vv-actions__secondary {
    margin-left: 0;
    justify-content: flex-start;
    width: 100%;
  }

  .vv-secure-link {
    max-width: 100%;
  }

  .vv-actions .btn-primary,
  .vv-actions form .btn-primary {
    width: 100%;
    min-height: 44px;
  }
}

/* ═══════════════════════════════════════════
   VIRTUAL VISIT — staff detail page
═══════════════════════════════════════════ */

.vv-detail-page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 32px 60px;
}

.vv-detail-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  margin-bottom: 24px;
}

.vv-detail-header__left .back-link {
  font-size: 12px;
  color: var(--text-3);
  text-decoration: none;
  margin-bottom: 8px;
  display: inline-block;
}

.vv-detail-header__left .back-link:hover {
  color: var(--text-1);
}

.vv-detail-header__title {
  font-size: 22px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 4px 0;
}

.vv-detail-header__title i {
  color: var(--brass);
  font-size: 18px;
}

.vv-detail-header__meta {
  font-size: 13px;
  color: var(--text-3);
}

.vv-detail-header__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: flex-start;
}

.vv-destructive {
  color: #b91c1c;
  border-color: #fecaca;
}

.vv-destructive:hover {
  background: #fef2f2;
}

.vv-destructive-btn {
  background: #dc2626;
  border-color: #dc2626;
}

.vv-destructive-btn:hover {
  background: #b91c1c;
  border-color: #b91c1c;
}

/* ─── Layout grid ─── */

.vv-detail-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
}

.vv-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg, 12px);
  padding: 20px 22px;
}

.vv-section__title {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--text-3);
  margin: 0 0 14px 0;
  font-weight: 600;
}

.vv-section__subtitle {
  font-size: 11px;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 4px;
}

.vv-section__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.vv-section__header .vv-section__title {
  margin-bottom: 0;
}

.vv-section__actions {
  display: flex;
  gap: 6px;
}

.vv-section--collapsible details {
  margin: 0;
}

.vv-section--collapsible summary {
  cursor: pointer;
  padding: 4px 0;
  list-style: none;
}

.vv-section--collapsible summary::-webkit-details-marker {
  display: none;
}

.vv-section--collapsible summary::after {
  content: " ▾";
  color: var(--text-3);
  font-size: 11px;
  margin-left: 4px;
}

.vv-section--collapsible details[open] summary::after {
  content: " ▴";
}

/* ─── Overview ─── */

.vv-overview-meta {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.vv-overview-meta__row {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 12px;
  align-items: center;
  padding: 10px 0;
  border-top: 1px solid #f1f5f9;
}

.vv-overview-meta__row:first-of-type {
  border-top: none;
}

.vv-overview-meta__label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-3);
}

.vv-overview-meta__value {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 13.5px;
  color: var(--text-1);
}

.vv-overview-meta__hint {
  font-size: 12px;
  color: var(--text-3);
}

.vv-sync-badge {
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 999px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.vv-sync-badge--not_linked {
  background: #f1f5f9;
  color: #475569;
}
.vv-sync-badge--linked {
  background: #eff6ff;
  color: #1d4ed8;
}
.vv-sync-badge--synced {
  background: #dcfce7;
  color: #15803d;
}
.vv-sync-badge--failed {
  background: #fee2e2;
  color: #b91c1c;
}

/* ─── Funnel ─── */

.vv-funnel {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.vv-funnel-step,
.vv-funnel__step {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  background: #f1f5f9;
  color: #94a3b8;
  font-size: 12px;
  font-weight: 500;
}

.vv-funnel-step--reached,
.vv-funnel__step--reached {
  background: #dcfce7;
  color: #15803d;
}

.vv-funnel__step i {
  font-size: 11px;
}

/* ─── Customer activity grid ─── */

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

.vv-activity-grid__item {
  background: #f8fafc;
  border-radius: 10px;
  padding: 12px 14px;
}

.vv-activity-grid__label {
  font-size: 10px;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 4px;
}

.vv-activity-grid__value {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-1);
}

.vv-activity-grid__value--small {
  font-size: 12.5px;
  font-weight: 400;
  color: var(--text-2);
}

.vv-activity-grid__hint {
  display: block;
  font-size: 11px;
  color: var(--text-3);
  margin-top: 3px;
  font-weight: 400;
}

/* ─── Invites table ─── */

.vv-invites-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.vv-invites-table thead th {
  text-align: left;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-3);
  padding: 8px 8px;
  border-bottom: 1px solid var(--border);
  font-weight: 600;
}

.vv-invites-table tbody td {
  padding: 10px 8px;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: top;
}

.vv-invites-table__action form {
  margin: 0;
}

.vv-tag {
  display: inline-block;
  background: #f1f5f9;
  color: #475569;
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 4px;
  font-weight: 500;
  margin-left: 4px;
  letter-spacing: 0.02em;
}

.vv-tag--gold {
  background: #fef3c7;
  color: #a16207;
}

.vv-empty {
  font-size: 13px;
  color: var(--text-3);
  font-style: italic;
  padding: 12px 0;
}

/* ─── Scenario cards ─── */

.vv-scenario-cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

.vv-scenario-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
  background: #fafbfc;
}

.vv-scenario-card--selected {
  border-color: var(--brass);
  background: #fefcf6;
}

.vv-scenario-card__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
}

.vv-scenario-card__name {
  font-size: 14px;
  font-weight: 600;
  margin: 0 0 4px 0;
}

.vv-scenario-card__meta {
  font-size: 12px;
  color: var(--text-3);
}

.vv-scenario-card__summary {
  font-size: 12px;
  color: var(--text-2);
  margin-top: 4px;
}

.vv-scenario-card__notes {
  border-top: 1px solid #f1f5f9;
  padding-top: 10px;
}

.vv-scenario-card__notes-label {
  display: block;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-3);
  margin-bottom: 4px;
}

.vv-scenario-card__notes-input {
  width: 100%;
  font-family: inherit;
  font-size: 13px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  resize: vertical;
}

.vv-scenario-card__notes-status {
  font-size: 11px;
  color: var(--text-3);
  margin-top: 4px;
  min-height: 14px;
}

/* ─── Timeline + ops queues lazy frames ─── */

.vv-timeline {
  list-style: none;
  margin: 0;
  padding: 0;
}

.vv-timeline__item {
  padding: 10px 0;
  border-bottom: 1px solid #f1f5f9;
}

.vv-timeline__when {
  font-size: 11px;
  color: var(--text-3);
}

.vv-timeline__label {
  font-size: 13.5px;
  font-weight: 500;
}

.vv-timeline__detail {
  font-size: 12px;
  color: var(--text-3);
}

.vv-ops-queues {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.vv-ops-queue {
  background: #f8fafc;
  padding: 12px 14px;
  border-radius: 10px;
}

.vv-ops-queue__role {
  font-size: 10px;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.vv-ops-queue__label {
  font-size: 13.5px;
  font-weight: 500;
  margin: 4px 0;
}

.vv-ops-queue__detail {
  font-size: 12px;
  color: var(--text-3);
}

/* ─── Modals ─── */

.vv-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(2px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.vv-modal-dialog {
  background: #fff;
  border-radius: 12px;
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  overflow: hidden;
}

.vv-modal-dialog--wide {
  max-width: 640px;
}

.vv-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 18px;
  border-bottom: 1px solid #e2e8f0;
}

.vv-modal-title {
  font-size: 15px;
  font-weight: 600;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.vv-modal-title i {
  color: var(--brass);
  font-size: 14px;
}

.vv-modal-close {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 8px;
  color: var(--text-3);
  font-size: 16px;
}

.vv-modal-body {
  padding: 18px 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.vv-modal-text {
  font-size: 13px;
  color: var(--text-2);
  margin: 0;
  line-height: 1.5;
}

.vv-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding-top: 8px;
  border-top: 1px solid #f1f5f9;
  margin-top: 4px;
}

/* ─── Form bits ─── */

.vv-form-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.vv-form-row--inline {
  flex-direction: row;
  gap: 10px;
  align-items: flex-end;
}

.vv-form-row--inline > div {
  flex: 1;
}

.vv-form-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-3);
  font-weight: 600;
  margin: 0;
}

.vv-form-input {
  width: 100%;
  font-family: inherit;
  font-size: 13.5px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
}

.vv-form-input--narrow {
  width: 100%;
}

.vv-form-readonly {
  font-size: 13px;
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 10px;
  color: var(--text-2);
}

.vv-form-readonly--mono {
  font-family: var(--font-mono);
  font-size: 11px;
  word-break: break-all;
}

.vv-form-hint {
  font-size: 11px;
  color: var(--text-3);
}

.vv-form-preview {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px;
  font-size: 12px;
  font-family: var(--font-mono);
  white-space: pre-wrap;
  margin: 4px 0 0;
}

/* ─── Chips ─── */

.vv-chip-group {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.vv-chip {
  position: relative;
  cursor: pointer;
}

.vv-chip input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.vv-chip span {
  display: inline-block;
  padding: 6px 14px;
  border-radius: 999px;
  background: #f1f5f9;
  color: #334155;
  font-size: 12px;
  font-weight: 500;
  border: 1px solid transparent;
  transition:
    background 0.1s ease,
    border-color 0.1s ease;
}

.vv-chip input[type="radio"]:checked + span {
  background: #eff6ff;
  border-color: #3b82f6;
  color: #1e3a8a;
}

.btn-primary-sm {
  background: var(--accent, #1e293b);
  color: white;
  border: 1px solid var(--accent, #1e293b);
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 12px;
  cursor: pointer;
}

@media (max-width: 768px) {
  .vv-detail-page {
    padding: 16px 16px 40px;
  }

  .vv-detail-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .vv-overview-meta__row {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .vv-activity-grid,
  .vv-scenario-cards,
  .vv-ops-queues {
    grid-template-columns: 1fr;
  }

  .vv-form-row--inline {
    flex-direction: column;
    align-items: stretch;
  }

  .vv-invites-table {
    font-size: 12px;
  }

  .vv-invites-table thead {
    display: none;
  }

  .vv-invites-table tbody tr {
    display: block;
    border-bottom: 1px solid var(--border);
    padding: 8px 0;
  }

  .vv-invites-table tbody td {
    display: flex;
    justify-content: space-between;
    border: none;
    padding: 4px 0;
  }

  .vv-modal-dialog {
    max-width: 100%;
  }
}
