/* ============================================================
   Customer Portal & Dashboard — LabFinder 360
   ============================================================ */

:root {
  --cd-bg: #f3f7f6;
  --cd-surface: #ffffff;
  --cd-border: #e2e8f0;
  --cd-border-subtle: #f1f5f9;
  --cd-text-primary: #0f172a;
  --cd-text-secondary: #475569;
  --cd-text-muted: #64748b;
  --cd-teal-text: #0d9488;
  --cd-blue: #0284c7;
  --cd-blue-hover: #0369a1;
  --cd-amber-btn: #eab308;
  --cd-amber-hover: #ca8a04;
  --cd-radius-lg: 16px;
  --cd-radius-md: 10px;
  --cd-radius-sm: 8px;
  --cd-shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.04), 0 1px 2px -1px rgba(15, 23, 42, 0.03);
}

/* Page Wrapper & Layout (Strict Figma Widths) */
.cd-page-wrapper {
  width: 100%;
  box-sizing: border-box;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: var(--cd-text-primary);
  background-color: var(--cd-bg);
}

/* Shell Layout (Backward Compatibility & fallback) */
.cd-shell {
  max-width: 1060px;
  margin: 0 auto;
  padding: 24px 20px 60px;
  width: 100%;
  box-sizing: border-box;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: var(--cd-text-primary);
}

/* Hero Section (White top block matching Figma) */
.cd-hero-section {
  background: #ffffff;
  border-bottom: 1px solid var(--cd-border);
  padding-top: 24px;
  width: 100%;
  box-sizing: border-box;
}

.cd-hero-inner {
  max-width: 1060px;
  margin: 0 auto;
  padding: 0 20px;
  box-sizing: border-box;
}

/* Content Area (Soft grey background #f3f7f6) */
.cd-content-area {
  background-color: var(--cd-bg);
  min-height: calc(100vh - 280px);
  padding: 24px 0 60px;
  width: 100%;
  box-sizing: border-box;
}

.cd-container {
  max-width: 1060px;
  margin: 0 auto;
  padding: 0 20px;
  box-sizing: border-box;
}

/* Welcome Greeting */
.cd-welcome {
  margin-bottom: 4px;
}

.cd-welcome__title {
  margin: 0 0 6px 0;
  font-size: 26px;
  font-weight: 700;
  color: #0f172a;
  letter-spacing: -0.02em;
  line-height: 1.25;
}

.cd-welcome__subtitle {
  margin: 0;
  font-size: 14px;
  color: var(--cd-teal-text);
  font-weight: 450;
  line-height: 1.4;
}

/* Navigation Tabs (Centered, max-width 960px matching Figma) */
.cd-tabs {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 36px;
  margin-top: 18px;
  max-width: 960px;
  margin-left: auto;
  margin-right: auto;
  border-bottom: none;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  flex-wrap: nowrap;
  padding: 0 16px;
}

@media (max-width: 900px) {
  .cd-tabs {
    justify-content: flex-start;
    gap: 22px;
    padding: 0 16px;
  }
}

@media (max-width: 640px) {
  .cd-tabs {
    gap: 16px;
    padding: 0 12px;
    margin-top: 12px;
  }
}

@media (max-width: 480px) {
  .cd-tabs {
    gap: 14px;
    padding: 0 10px;
  }
}

.cd-tabs::-webkit-scrollbar {
  display: none;
}

.cd-tab {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 12px 2px 14px;
  font-size: 14.5px;
  font-weight: 500;
  color: var(--cd-text-muted);
  text-decoration: none;
  white-space: nowrap;
  border-bottom: 3px solid transparent;
  margin-bottom: -1px;
  transition: color 0.15s ease, border-color 0.15s ease;
  flex-shrink: 0;
}

@media (max-width: 640px) {
  .cd-tab {
    font-size: 13.5px;
    padding: 10px 2px 12px;
    gap: 7px;
  }
}

@media (max-width: 480px) {
  .cd-tab {
    font-size: 13px;
    gap: 6px;
    padding: 9px 2px 11px;
  }
}

.cd-tab svg {
  width: 19px;
  height: 19px;
  flex-shrink: 0;
}

@media (max-width: 640px) {
  .cd-tab svg {
    width: 17px;
    height: 17px;
  }
}

.cd-tab:hover {
  color: var(--cd-blue);
}

.cd-tab.is-active {
  color: var(--cd-blue);
  font-weight: 600;
  border-bottom-color: var(--cd-blue);
}

/* Main Container */
.cd-main {
  margin-top: 24px;
  width: 100%;
  box-sizing: border-box;
}

/* 4-Stat Cards Grid (Figma Dashboard) */
.cd-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  margin-bottom: 24px;
}

.cd-stat-card {
  background: var(--cd-surface);
  border: 1px solid var(--cd-border);
  border-radius: var(--cd-radius-lg);
  padding: 22px 24px 20px;
  box-shadow: var(--cd-shadow-sm);
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.cd-stat-card:hover {
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.05);
}

.cd-stat-card__top {
  margin-bottom: 14px;
}

.cd-stat-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--cd-radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.cd-stat-icon--green {
  background: #ecfdf5;
  color: #059669;
}

.cd-stat-icon--amber {
  background: #fef3c7;
  color: #d97706;
}

.cd-stat-icon--blue {
  background: #eff6ff;
  color: #0284c7;
}

.cd-stat-icon--pink {
  background: #fdf2f8;
  color: #e11d48;
}

.cd-rupee-symbol {
  font-size: 18px;
  font-weight: 700;
  color: #e11d48;
  line-height: 1;
}

.cd-stat-value {
  font-size: 32px;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin-bottom: 6px;
}

.cd-stat-value--sm {
  font-size: 24px;
  margin-bottom: 2px;
}

.cd-stat-label {
  font-size: 13.5px;
  color: var(--cd-text-muted);
  font-weight: 450;
  line-height: 1.3;
}

/* Two-Column Split Layout */
.cd-split-grid {
  display: grid;
  grid-template-columns: 1.18fr 0.82fr;
  gap: 20px;
  align-items: start;
}

/* Panel Containers */
.cd-panel {
  background: var(--cd-surface);
  border: 1px solid var(--cd-border);
  border-radius: var(--cd-radius-lg);
  box-shadow: var(--cd-shadow-sm);
  overflow: hidden;
  box-sizing: border-box;
}

.cd-panel__header {
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--cd-border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.cd-panel__title {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  color: #0f172a;
  letter-spacing: -0.01em;
}

.cd-panel__subtitle {
  margin: 3px 0 0;
  font-size: 13px;
  color: var(--cd-text-muted);
  font-weight: 450;
}

/* Recent Activity List (Left Column) */
.cd-activity-list {
  display: flex;
  flex-direction: column;
}

.cd-activity-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  border-bottom: 1px solid var(--cd-border-subtle);
  text-decoration: none;
  color: inherit;
  transition: background 0.15s ease;
}

.cd-activity-row:last-child {
  border-bottom: none;
}

.cd-activity-row:hover {
  background: #f8fafc;
}

.cd-activity-main {
  flex: 1;
  min-width: 0;
  padding-right: 14px;
}

.cd-activity-title {
  margin: 0 0 3px;
  font-size: 14.5px;
  font-weight: 600;
  color: #0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cd-activity-sub {
  font-size: 13px;
  color: var(--cd-text-muted);
  font-weight: 400;
}

.cd-activity-badge-wrap {
  padding: 0 16px;
  flex-shrink: 0;
}

.cd-activity-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  color: var(--cd-text-muted);
  font-size: 13px;
}

.cd-activity-time {
  white-space: nowrap;
}

.cd-activity-chevron {
  color: #94a3b8;
  display: flex;
  align-items: center;
}

/* Action Required List (Right Column) */
.cd-actions-list {
  display: flex;
  flex-direction: column;
}

.cd-action-row {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 18px 24px;
  border-bottom: 1px solid var(--cd-border-subtle);
}

.cd-action-row:last-child {
  border-bottom: none;
}

.cd-action-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--cd-radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;
}

.cd-action-icon--quote {
  background: #fef3c7;
  color: #d97706;
}

.cd-action-icon--download {
  background: #dcfce7;
  color: #16a34a;
}

.cd-action-icon--payment {
  background: #eff6ff;
  color: #0284c7;
}

.cd-action-content {
  flex: 1;
  min-width: 0;
}

.cd-action-title {
  margin: 0 0 3px;
  font-size: 14.5px;
  font-weight: 600;
  color: #0f172a;
  line-height: 1.3;
}

.cd-action-desc {
  margin: 0 0 8px;
  font-size: 13px;
  color: var(--cd-text-secondary);
  line-height: 1.45;
}

.cd-action-btn {
  display: inline-block;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--cd-blue);
  text-decoration: none;
  transition: color 0.15s ease;
}

.cd-action-btn:hover {
  color: var(--cd-blue-hover);
  text-decoration: underline;
}

/* Status Pills */
.cd-pill {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.3;
  white-space: nowrap;
}

.cd-pill--new {
  background: #e0e7ff;
  color: #4338ca;
}

.cd-pill--pending {
  background: #fef3c7;
  color: #b45309;
}

.cd-pill--delivered {
  background: #dcfce7;
  color: #15803d;
}

.cd-pill--quotes {
  background: #e0f2fe;
  color: #0284c7;
}

.cd-pill--in_progress {
  background: #e0f2fe;
  color: #0369a1;
}

.cd-pill--won {
  background: #dcfce7;
  color: #15803d;
}

.cd-pill--lost {
  background: #f1f5f9;
  color: #64748b;
}

.cd-pill--default {
  background: #f1f5f9;
  color: #475569;
}

/* Empty States */
.cd-empty-state {
  padding: 36px 24px;
  text-align: center;
  color: var(--cd-text-muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.cd-empty-check {
  margin-bottom: 8px;
}

.cd-empty-text {
  margin: 0 0 4px;
  font-size: 14.5px;
  font-weight: 600;
  color: #0f172a;
}

.cd-empty-sub {
  font-size: 13px;
  color: var(--cd-text-muted);
}

.cd-empty-link {
  display: inline-block;
  margin-top: 8px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--cd-blue);
  text-decoration: none;
}

.cd-empty-link:hover {
  text-decoration: underline;
}

/* Section Header for Tabs (Inquiries, Orders, Profile, etc.) */
.cd-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 14px;
}

.cd-section-title {
  margin: 0 0 4px;
  font-size: 20px;
  font-weight: 700;
  color: #0f172a;
}

.cd-section-subtitle {
  margin: 0;
  font-size: 13.5px;
  color: var(--cd-text-muted);
}

.cd-btn-primary {
  background: var(--cd-amber-btn);
  color: #0f172a;
  border: none;
  border-radius: var(--cd-radius-sm);
  padding: 10px 18px;
  font-size: 13.5px;
  font-weight: 700;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  transition: background 0.15s ease, transform 0.1s ease;
}

.cd-btn-primary:hover {
  background: var(--cd-amber-hover);
  color: #0f172a;
}

.cd-btn-secondary {
  background: #ffffff;
  color: #0f172a;
  border: 1px solid var(--cd-border);
  border-radius: var(--cd-radius-sm);
  padding: 9px 16px;
  font-size: 13.5px;
  font-weight: 600;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.cd-btn-secondary:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
}

/* Table Cards (Inquiries & Orders) */
.cd-table-card {
  background: var(--cd-surface);
  border: 1px solid var(--cd-border);
  border-radius: var(--cd-radius-lg);
  box-shadow: var(--cd-shadow-sm);
  overflow: hidden;
}

.cd-table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.cd-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.cd-table th {
  padding: 14px 20px;
  font-size: 12px;
  font-weight: 600;
  color: var(--cd-text-muted);
  border-bottom: 1px solid var(--cd-border);
  background: #fafbfc;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.cd-table td {
  padding: 16px 20px;
  font-size: 13.5px;
  border-bottom: 1px solid var(--cd-border-subtle);
  vertical-align: middle;
}

.cd-table tbody tr:last-child td {
  border-bottom: none;
}

.cd-table tbody tr:hover {
  background: #f8fafc;
}

.cd-cell-main {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.cd-cell-bold {
  font-weight: 600;
  color: #0f172a;
}

.cd-cell-muted {
  font-size: 12.5px;
  color: var(--cd-text-muted);
}

.cd-cell-text {
  font-size: 13.5px;
  color: #334155;
}

.cd-table-action {
  font-size: 13px;
  font-weight: 600;
  color: var(--cd-text-secondary);
  text-decoration: none;
  white-space: nowrap;
}

.cd-table-action--blue {
  color: var(--cd-blue);
}

.cd-table-action:hover {
  text-decoration: underline;
}

.cd-table-empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--cd-text-muted);
}

/* Orders Horizontal Cards */
.cd-orders-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}

.cd-stat-card--horizontal {
  flex-direction: row;
  align-items: center;
  gap: 16px;
  padding: 18px 20px;
}

/* Chips Row */
.cd-chips-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.cd-chip {
  padding: 7px 16px;
  border-radius: 999px;
  background: #ffffff;
  border: 1px solid var(--cd-border);
  color: #334155;
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.15s ease;
}

.cd-chip:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
}

.cd-chip--active {
  background: #0f172a;
  color: #ffffff;
  border-color: #0f172a;
}

.cd-chip--active:hover {
  background: #1e293b;
  color: #ffffff;
}

/* Payment Status Badges */
.cd-payment-badge {
  font-size: 12.5px;
  font-weight: 600;
}

.cd-payment-badge--paid {
  color: #15803d;
}

.cd-payment-badge--partial {
  color: #0369a1;
}

.cd-payment-badge--unpaid {
  color: var(--cd-text-muted);
}

/* Profile Tab Layout */
.cd-profile-layout {
  max-width: 680px;
}

.cd-profile-card {
  padding: 28px;
}

.cd-profile-avatar-wrap {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 24px;
}

.cd-profile-avatar-large {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: #f59e0b;
  color: #ffffff;
  font-size: 26px;
  font-weight: 700;
  display: grid;
  place-items: center;
}

.cd-profile-name {
  margin: 0 0 2px;
  font-size: 18px;
  font-weight: 700;
  color: #0f172a;
}

.cd-profile-email {
  margin: 0 0 8px;
  font-size: 13.5px;
  color: var(--cd-text-muted);
}

/* Forms */
.cd-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.cd-form-row--2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.cd-form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.cd-label {
  font-size: 13px;
  font-weight: 600;
  color: #334155;
}

.cd-input {
  padding: 10px 14px;
  border: 1px solid var(--cd-border);
  border-radius: var(--cd-radius-sm);
  font-size: 14px;
  color: #0f172a;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.cd-input:focus {
  border-color: var(--cd-blue);
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15);
}

.cd-form-actions {
  margin-top: 8px;
}

.cd-divider {
  height: 1px;
  background: var(--cd-border-subtle);
  width: 100%;
}

.cd-checkbox-label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13.5px;
  color: #334155;
  cursor: pointer;
}

/* Reviews List */
.cd-reviews-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 800px;
}

.cd-review-card {
  background: var(--cd-surface);
  border: 1px solid var(--cd-border);
  border-radius: var(--cd-radius-lg);
  padding: 22px 24px;
  box-shadow: var(--cd-shadow-sm);
}

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

.cd-review-card__lab-name {
  margin: 0 0 4px;
  font-size: 16px;
  font-weight: 700;
  color: #0f172a;
}

.cd-review-card__rating {
  font-size: 13px;
  color: var(--cd-text-muted);
}

.cd-stars {
  color: #f59e0b;
  font-weight: 700;
}

.cd-review-card__title {
  margin: 0 0 6px;
  font-size: 15px;
  font-weight: 600;
  color: #0f172a;
}

.cd-review-card__summary {
  margin: 0;
  font-size: 13.5px;
  color: #334155;
  line-height: 1.5;
}

.cd-review-card__reply {
  margin-top: 14px;
  padding: 12px 16px;
  background: #f8fafc;
  border-radius: var(--cd-radius-sm);
  border-left: 3px solid var(--cd-blue);
  font-size: 13px;
}

.cd-review-card__reply strong {
  color: #0f172a;
  display: block;
  margin-bottom: 2px;
}

.cd-review-card__reply p {
  margin: 0;
  color: var(--cd-text-secondary);
}

/* Responsive Media Queries */
@media (max-width: 960px) {
  .cd-stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .cd-split-grid {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 640px) {
  .cd-shell {
    padding: 20px 16px 40px;
  }

  .cd-welcome__title {
    font-size: 24px;
  }

  .cd-table {
    min-width: 640px;
  }

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

  .cd-activity-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .cd-activity-badge-wrap {
    padding: 0;
  }

  .cd-activity-meta {
    width: 100%;
    justify-content: space-between;
  }

  .cd-form-row--2col {
    grid-template-columns: 1fr;
  }
}

/* ============================================================
   Backward compatibility for existing detail views
   ============================================================ */


/* ---------- Lead detail page ---------- */
.detail-container {
  max-width: 960px;
  margin: 30px auto;
  padding: 0 15px;
  font-family: var(--font-rubik, sans-serif);
  width: 100%;
  box-sizing: border-box;
}

.detail-back-link {
  color: #0c769e;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  display: inline-block;
}

.detail-page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 16px 0 24px 0;
  flex-wrap: wrap;
  gap: 12px;
}

.detail-page-header h1 {
  font-size: 22px;
  margin: 0;
  word-break: break-word;
}

.card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 24px;
}

.card-title {
  font-size: 18px;
  font-weight: 700;
  color: #111827;
  margin: 0 0 16px 0;
  border-bottom: 1px solid #f3f4f6;
  padding-bottom: 12px;
}

.detail-description {
  font-size: 14px;
  color: #374151;
  line-height: 1.6;
  white-space: pre-line;
}

.detail-meta {
  font-size: 13px;
  color: #6b7280;
  display: flex;
  gap: 20px;
  margin-top: 16px;
  flex-wrap: wrap;
}

.quote-box {
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 20px;
}

.quote-price {
  font-size: 24px;
  font-weight: 800;
  color: #0284c7;
}

.action-btn-group {
  display: flex;
  gap: 12px;
  margin-top: 16px;
  flex-wrap: wrap;
}

.btn-accept {
  background: #10b981;
  color: #fff;
  border: none;
  padding: 10px 20px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
}

.btn-reject {
  background: #ef4444;
  color: #fff;
  border: none;
  padding: 10px 20px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
}

.chat-box {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 400px;
  overflow-y: auto;
  margin-bottom: 16px;
}

.chat-bubble {
  padding: 12px 16px;
  border-radius: 8px;
  max-width: 75%;
  font-size: 14px;
  word-break: break-word;
}

.chat-bubble--lab {
  background: #f3f4f6;
  align-self: flex-start;
  color: #111827;
}

.chat-bubble--customer {
  background: #0c769e;
  color: #ffffff;
  align-self: flex-end;
}

.chat-author {
  font-size: 11px;
  font-weight: 700;
  margin-bottom: 4px;
  display: block;
  opacity: 0.8;
}

.lab-pick {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.lab-pick a {
  display: block;
  padding: 14px 16px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  text-decoration: none;
  color: #111827;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.lab-pick a:hover,
.lab-pick a.active {
  border-color: #0c769e;
  background: #f0f9ff;
}

.lab-pick-hint {
  margin: 12px 0 0 0;
  font-size: 13px;
  color: #6b7280;
}

.pill-inline {
  margin-left: 10px;
}

.quote-inline {
  margin-left: 10px;
  font-size: 13px;
  color: #0284c7;
}

/* ---------- Customer reviews tab ---------- */
.cust-reviews-card {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 24px;
  margin-top: 20px;
}

.cust-reviews-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 8px;
}

.cust-reviews-header h2 {
  font-size: 18px;
  font-weight: 700;
  color: #111827;
  margin: 0;
}

.cust-reviews-header p {
  font-size: 13px;
  color: #6b7280;
  margin: 4px 0 0 0;
}

.cust-review-item {
  border-bottom: 1px solid #f3f4f6;
  padding-bottom: 20px;
  margin-bottom: 20px;
}

.cust-review-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
  margin-bottom: 0;
}

.cust-review-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 8px;
  flex-wrap: wrap;
  gap: 8px;
}

.lab-name-tag {
  font-family: var(--font-manrope, sans-serif);
  font-size: 16px;
  font-weight: 700;
  color: #111827;
  margin: 0;
}

.btn-edit-review {
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  color: #0284c7;
  font-size: 12.5px;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-edit-review:hover {
  background: #e0f2fe;
}

.cust-review-comment {
  font-size: 14px;
  color: #374151;
  line-height: 1.5;
  margin: 8px 0;
}

.lab-response-box {
  background: #f8fafc;
  border-left: 3px solid #0c769e;
  border-radius: 0 8px 8px 0;
  padding: 12px 16px;
  margin-top: 12px;
}

.lab-response-title {
  font-size: 12px;
  font-weight: 700;
  color: #0c769e;
  text-transform: uppercase;
  margin-bottom: 4px;
}

/* Edit review modal */
.edit-modal-backdrop {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 16px;
  box-sizing: border-box;
}

.edit-modal-content {
  background: #fff;
  border-radius: 12px;
  width: 100%;
  max-width: 500px;
  padding: 24px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
  max-height: 90vh;
  overflow-y: auto;
}

/* ---------- Star rating (submit review) ---------- */
.star-rating-group input:checked ~ label,
.star-rating-group label:hover,
.star-rating-group label:hover ~ label {
  color: #f59e0b !important;
}

/* ---------- Enquiry search extras ---------- */
.message--error,
.message--danger {
  background-color: #fef2f2 !important;
  border: 1px solid #fca5a5 !important;
  color: #991b1b !important;
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 14px;
}

.enq-media-name {
  margin-left: 10px;
  font-size: 13px;
  color: #0284c7;
  font-weight: 500;
}

.enq-search-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
  z-index: 100;
  max-height: 250px;
  overflow-y: auto;
  margin-top: 4px;
}

.enq-search-item {
  padding: 10px 14px;
  cursor: pointer;
  border-bottom: 1px solid #f1f5f9;
  font-size: 13.5px;
  transition: background-color 0.15s ease;
}

.enq-search-item:last-child {
  border-bottom: none;
}

.enq-search-item:hover {
  background: #f0f9ff;
}

.enq-search-item strong {
  display: block;
  color: #0f172a;
  font-weight: 600;
}

.enq-search-item span {
  color: #64748b;
  font-size: 12px;
}

/* ============================================================
   Order detail layout
   ============================================================ */
.order-detail {
  max-width: 960px;
  margin: 30px auto;
  padding: 0 16px;
  width: 100%;
  box-sizing: border-box;
  font-family: var(--font-rubik, sans-serif);
}

.order-detail__back {
  color: #2563eb;
  font-size: 14px;
  text-decoration: none;
}

.order-detail__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin: 12px 0 20px;
}

.order-detail__header h1 {
  font-size: 22px;
  margin: 0;
  word-break: break-word;
}

.order-status-pill {
  padding: 4px 12px;
  border-radius: 999px;
  background: #eef2ff;
  color: #3730a3;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.order-detail__grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 20px;
  align-items: start;
}

.order-detail__main,
.order-detail__side {
  min-width: 0; /* prevent grid blowout */
}

.order-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 16px;
  box-sizing: border-box;
}

.order-card--side {
  padding: 16px;
}

.order-card--dispute {
  border-color: #fee2e2;
}

.order-card h3,
.order-card h4 {
  margin: 0 0 12px 0;
  font-size: 16px;
  word-break: break-word;
}

.order-card h4 {
  font-size: 14px;
  margin-bottom: 8px;
}

.order-card--dispute h4 {
  color: #b91c1c;
}

.order-msg-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 360px;
  overflow-y: auto;
  margin-bottom: 14px;
  -webkit-overflow-scrolling: touch;
}

.order-msg {
  padding: 12px;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
  word-break: break-word;
}

.order-msg--lab {
  background: #eff6ff;
}

.order-msg--customer {
  background: #f9fafb;
}

.order-msg__meta {
  font-size: 12px;
  color: #6b7280;
  margin-bottom: 4px;
}

.order-msg__body {
  font-size: 14px;
  white-space: pre-line;
}

.order-form-row {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: 8px;
  flex-wrap: wrap;
}

.order-form-row .btn,
.order-form-row button {
  margin-left: auto;
}

.order-docs-list {
  padding-left: 18px;
  margin: 0 0 12px 0;
}

.order-upload-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: end;
}

.order-upload-row input,
.order-upload-row .form-control {
  max-width: 100%;
  min-width: 0;
}

.order-side-text {
  margin: 0 0 4px 0;
  font-size: 13px;
}

.order-side-muted {
  font-size: 12px;
  color: #6b7280;
}

.order-side-empty {
  font-size: 13px;
  color: #9ca3af;
  margin: 0;
}

.order-full-btn {
  width: 100%;
  margin-top: 8px;
}

/* ============================================================
   Mobile-first overflow / scroll helpers
   ============================================================ */
.main-tabs,
.status-chips {
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

/* .cust-dash, */
.detail-container,
.order-detail {
  overflow-x: hidden;
}

/* ============================================================
   Responsive breakpoints
   ============================================================ */

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

@media (max-width: 768px) {
  /* .cust-dash, */
  .detail-container,
  .order-detail {
    margin: 16px auto;
    padding: 0 12px;
  }

  .cust-header h1 {
    font-size: 20px;
  }

  .cust-header p {
    font-size: 13px;
  }

  .detail-page-header h1,
  .order-detail__header h1 {
    font-size: 18px;
  }

  /* Horizontal scroll tabs / chips — avoid cramped wrap */
  .main-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 6px;
    padding-bottom: 10px;
    margin-left: -4px;
    margin-right: -4px;
    padding-left: 4px;
    padding-right: 4px;
    border-bottom: 1px solid #e5e7eb;
  }

  .main-tab {
    padding: 8px 14px;
    font-size: 13px;
    flex-shrink: 0;
  }

  .status-chips {
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 6px;
    padding-bottom: 4px;
    margin-left: -4px;
    margin-right: -4px;
    padding-left: 4px;
    padding-right: 4px;
  }

  .status-chip {
    flex-shrink: 0;
    padding: 6px 12px;
    font-size: 12px;
  }

  .lead-item-card {
    padding: 14px;
    flex-direction: column;
    align-items: flex-start;
  }

  .lead-item-card__actions {
    width: 100%;
    justify-content: space-between;
  }

  .card,
  .order-card {
    padding: 14px;
  }

  .card-title {
    font-size: 16px;
  }

  .chat-bubble {
    max-width: 88%;
  }

  .quote-price {
    font-size: 20px;
  }

  .cust-reviews-card {
    padding: 14px;
  }

  .action-btn-group {
    flex-direction: column;
  }

  .btn-accept,
  .btn-reject {
    width: 100%;
    text-align: center;
  }

  .quote-box__row {
    flex-direction: column;
    align-items: flex-start;
  }

  .detail-meta {
    gap: 10px;
  }

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

  .order-form-row .btn,
  .order-form-row button {
    margin-left: 0;
    width: 100%;
  }

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

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

  /* Touch-friendly targets */
  .btn-view,
  .main-tab,
  .status-chip,
  .btn-accept,
  .btn-reject,
  .btn-send-msg {
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
}

@media (max-width: 480px) {
  /* .cust-dash, */
  .detail-container,
  .order-detail {
    margin: 10px auto;
    padding: 0 10px;
  }

  .cust-header h1 {
    font-size: 18px;
  }

  .status-chip {
    padding: 5px 10px;
    font-size: 12px;
  }

  .btn-view {
    padding: 8px 12px;
    font-size: 12px;
  }

  .lead-title {
    font-size: 15px;
  }

  .edit-modal-content {
    padding: 16px;
    max-height: 85vh;
  }

  .chat-bubble {
    max-width: 94%;
    font-size: 13px;
    padding: 10px 12px;
  }

  .pill {
    font-size: 11px;
    padding: 3px 10px;
  }

  .order-detail__header h1 {
    font-size: 17px;
  }

  .order-card {
    padding: 12px;
    border-radius: 10px;
  }

  .cust-reviews-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .cust-review-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .btn-edit-review {
    align-self: flex-start;
  }

  .lab-pick a {
    padding: 12px;
  }
}

/* Prevent iOS input zoom + full-width form controls on mobile */
@media (max-width: 768px) {
  .chat-form-textarea,
  .form-textarea-sm,
  .form-select-sm,
  .review-input,
  .review-textarea,
  .order-detail textarea,
  .order-detail input[type="text"],
  .order-detail input[type="file"],
  .order-detail select {
    font-size: 16px !important;
    max-width: 100%;
    width: 100%;
    box-sizing: border-box;
  }
}

/* ---------- Extra utility classes for lead detail ---------- */
.quote-box__row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.quote-label {
  font-size: 13px;
  color: #0284c7;
  font-weight: 600;
}

.quote-meta-label {
  font-size: 13px;
  color: #6b7280;
}

.quote-meta-value {
  font-size: 18px;
  font-weight: 700;
  color: #111827;
}

.quote-notes {
  font-size: 13px;
  color: #374151;
  margin-top: 12px;
}

.quote-notes--sm {
  margin-top: 8px;
}

.status-banner {
  padding: 12px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
}

.status-banner--success {
  background: #d1fae5;
  color: #065f46;
}

.status-banner--danger {
  background: #fee2e2;
  color: #991b1b;
}

.status-banner--purple {
  background: #f3e8ff;
  color: #6b21a8;
}

.decision-label {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 8px;
}

.chat-empty {
  color: #9ca3af;
  font-size: 13px;
  font-style: italic;
}

.chat-attachment {
  margin-top: 6px;
}

.chat-attachment a {
  color: inherit;
  font-size: 12px;
}

.chat-form-textarea {
  width: 100%;
  padding: 12px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  font-size: 14px;
  box-sizing: border-box;
  resize: vertical;
  min-height: 80px;
}

.chat-form-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-top: 10px;
}

.chat-form-attach {
  font-size: 13px;
  color: #374151;
  display: flex;
  align-items: center;
  gap: 8px;
}

.chat-form-attach input[type="file"] {
  font-size: 13px;
  max-width: 100%;
}

.btn-send-msg {
  margin-left: auto;
  background: #0c769e;
  color: #fff;
  border: none;
  padding: 10px 20px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
}

.muted-text {
  margin: 0;
  color: #6b7280;
  font-size: 14px;
}

@media (max-width: 480px) {
  .btn-send-msg {
    margin-left: 0;
    width: 100%;
  }

  .chat-form-footer {
    flex-direction: column;
    align-items: stretch;
  }
}

/* ---------- Reviews tab extras ---------- */
.reviews-count-badge {
  font-size: 13px;
  font-weight: 600;
  background: #f3f4f6;
  padding: 4px 12px;
  border-radius: 12px;
  color: #374151;
  white-space: nowrap;
}

.review-date {
  font-size: 12px;
  color: #9ca3af;
}

.star-row {
  display: flex;
  gap: 3px;
  margin: 6px 0;
  align-items: center;
  flex-wrap: wrap;
}

.anon-badge {
  font-size: 11px;
  background: #fef3c7;
  color: #92400e;
  padding: 1px 8px;
  border-radius: 10px;
  margin-left: 8px;
}

.lab-reply-body {
  font-size: 13.5px;
  color: #334155;
}

.lab-reply-time {
  font-size: 11px;
  color: #94a3b8;
  display: block;
  margin-top: 4px;
}

.awaiting-reply {
  font-size: 12px;
  color: #9ca3af;
  margin-top: 8px;
  font-style: italic;
}

.reviews-empty {
  text-align: center;
  padding: 32px;
  color: #9ca3af;
  font-size: 14px;
}

.edit-modal-title {
  margin-top: 0;
  font-size: 18px;
  color: #111827;
}

.form-group-sm {
  margin-bottom: 16px;
}

.form-label-sm {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #374151;
  margin-bottom: 6px;
}

.form-select-sm {
  width: 100%;
  height: 38px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  padding: 0 10px;
  font-size: 14px;
  box-sizing: border-box;
}

.form-textarea-sm {
  width: 100%;
  padding: 10px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 13.5px;
  box-sizing: border-box;
  resize: vertical;
}

.form-check-row {
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.form-check-row label {
  font-size: 13px;
  color: #374151;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.btn-modal-cancel {
  background: #f3f4f6;
  color: #374151;
  border: 1px solid #d1d5db;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
}

.btn-modal-save {
  background: #0c769e;
  color: #fff;
  border: none;
  padding: 8px 18px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

@media (max-width: 480px) {
  .modal-actions {
    flex-direction: column;
  }

  .btn-modal-cancel,
  .btn-modal-save {
    width: 100%;
    text-align: center;
  }
}

/* ---------- Submit Review page ---------- */
.review-main {
  padding: 40px 0;
}

.review-form-wrap {
  max-width: 720px;
  margin: 0 auto;
}

.review-summary-card {
  background: #fff;
  padding: 32px;
  border-radius: 16px;
  border: 1px solid var(--color-border, #e2e8f0);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

.review-summary-card h1 {
  font-size: 22px;
  font-weight: 700;
  color: var(--color-text-primary, #0f172a);
  margin-bottom: 6px;
}

.review-summary-card > p {
  font-size: 13.5px;
  color: var(--color-text-sub, #64748b);
  margin-bottom: 24px;
}

.review-field {
  margin-bottom: 20px;
}

.review-field--cats {
  margin-bottom: 24px;
}

.review-label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--color-text-sub, #64748b);
  display: block;
  margin-bottom: 6px;
}

.review-label--spaced {
  margin-bottom: 12px;
}

.review-input {
  width: 100%;
  height: 42px;
  padding: 0 14px;
  border: 1px solid var(--color-border, #cbd5e1);
  border-radius: 8px;
  font-size: 14px;
  box-sizing: border-box;
}

.review-textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--color-border, #cbd5e1);
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  box-sizing: border-box;
  resize: vertical;
}

.cat-rating-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.cat-rating-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 18px;
  background: var(--color-bg-alt, #f8fafc);
  border: 1px solid var(--color-border, #e2e8f0);
  border-radius: 10px;
  gap: 12px;
  flex-wrap: wrap;
}

.cat-rating-row strong {
  font-size: 14px;
  color: var(--color-text-primary, #0f172a);
  display: block;
}

.cat-rating-row .cat-desc {
  font-size: 12px;
  color: var(--color-text-sub, #64748b);
}

.star-rating-group {
  display: flex;
  flex-direction: row-reverse;
  gap: 4px;
  position: relative;
}

.star-rating-group input[type="radio"] {
  opacity: 0;
  width: 1px;
  height: 1px;
  position: absolute;
  pointer-events: none;
}

.star-rating-group label {
  font-size: 24px;
  color: #cbd5e1;
  cursor: pointer;
  transition: color 0.15s;
  line-height: 1;
}

.star-rating-group input:checked ~ label,
.star-rating-group label:hover,
.star-rating-group label:hover ~ label {
  color: #f59e0b !important;
}

.review-anon-row {
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.review-anon-row input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
}

.review-anon-row label {
  font-size: 13.5px;
  color: var(--color-text-slate, #334155);
  cursor: pointer;
}

.btn-review-submit {
  width: 100%;
  height: 48px;
  background: #0c769e;
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease;
}

.btn-review-submit:hover {
  background: #0a6182;
}

@media (max-width: 640px) {
  .review-main {
    padding: 24px 0;
  }

  .review-summary-card {
    padding: 20px 16px;
    border-radius: 12px;
  }

  .review-summary-card h1 {
    font-size: 18px;
  }

  .cat-rating-row {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ---------- Lab detail hero (shared utilities) ---------- */
.lab-hero-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  flex-wrap: wrap;
}

.lab-hero-identity {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  flex-wrap: wrap;
}

.lab-logo-img {
  height: 80px;
  width: 80px;
  object-fit: contain;
  border-radius: 12px;
  border: 1px solid var(--color-border, #e2e8f0);
  background: #fff;
  padding: 6px;
  flex-shrink: 0;
}

.lab-logo-fallback {
  height: 80px;
  width: 80px;
  border-radius: 12px;
  background: var(--color-bg-light, #f1f5f9);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: var(--color-theme-primary, #0c769e);
  font-size: 24px;
  flex-shrink: 0;
}

.lab-rating-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.lab-rating-score {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-weight: 600;
  font-size: 14px;
  color: var(--color-rating-gold, #f59e0b);
}

.lab-rating-count {
  color: var(--color-text-sub, #64748b);
  font-weight: 400;
}

@media (max-width: 640px) {
  .lab-hero-identity {
    gap: 14px;
  }

  .lab-logo-img,
  .lab-logo-fallback {
    height: 64px;
    width: 64px;
    font-size: 18px;
  }

  .review-hero__title {
    font-size: 22px !important;
  }
}

/* Safe defaults for customer surfaces on all viewports */
/* .cust-dash *, */
.detail-container *,
.order-detail * {
  box-sizing: border-box;
}

/* .cust-dash img, */
.detail-container img,
.order-detail img {
  max-width: 100%;
  height: auto;
}

/* Stack order sidebar above/below naturally already via grid */
@media (max-width: 900px) {
  .order-detail__side {
    display: flex;
    flex-direction: column;
  }
}

/* ============================================================
   Customer Detail Pages (Enquiry / Compare Quotes & Orders)
   Faithful to Figma Customer Screens
   ============================================================ */

/* Breadcrumbs Back Link */
.cd-back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--cd-blue);
  text-decoration: none;
  margin-bottom: 16px;
  transition: color 0.15s ease;
}

.cd-back-link:hover {
  color: var(--cd-blue-hover);
  text-decoration: underline;
}

/* Detail Header */
.cd-detail-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;
}

@media (max-width: 768px) {
  .cd-detail-header {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    margin-bottom: 16px;
  }

  .cd-detail-title {
    font-size: 20px;
  }

  .cd-detail-header__actions {
    width: 100%;
  }

  .cd-detail-header__actions .cd-btn {
    width: 100%;
    justify-content: center;
  }

  .cd-card-body {
    padding: 18px 14px;
  }
}

.cd-detail-header__main {
  flex: 1;
  min-width: 0;
}

.cd-detail-header__title-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}

.cd-detail-title {
  margin: 0;
  font-size: 24px;
  font-weight: 700;
  color: #0f172a;
  letter-spacing: -0.01em;
  line-height: 1.2;
}

.cd-detail-subtitle {
  margin: 0;
  font-size: 13.5px;
  color: var(--cd-text-muted);
  font-weight: 450;
  line-height: 1.4;
}

.cd-detail-header__actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

/* Action Buttons */
.cd-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 16px;
  font-size: 13.5px;
  font-weight: 600;
  border-radius: var(--cd-radius-sm);
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.15s ease;
  font-family: inherit;
  line-height: 1.3;
}

.cd-btn--secondary {
  background: #ffffff;
  border-color: #cbd5e1;
  color: #1e293b;
}

.cd-btn--secondary:hover {
  background: #f8fafc;
  border-color: #94a3b8;
}

.cd-btn--primary {
  background: var(--cd-blue);
  color: #ffffff;
}

.cd-btn--primary:hover {
  background: var(--cd-blue-hover);
}

.cd-btn--amber {
  background: var(--cd-amber-btn);
  color: #0f172a;
}

.cd-btn--amber:hover {
  background: var(--cd-amber-hover);
}

.cd-btn--green {
  background: #059669;
  color: #ffffff;
}

.cd-btn--green:hover {
  background: #047857;
}

/* Cards & Sub-tabs */
.cd-card {
  background: #ffffff;
  border: 1px solid var(--cd-border);
  border-radius: var(--cd-radius-lg);
  box-shadow: var(--cd-shadow-sm);
  overflow: hidden;
  box-sizing: border-box;
  margin-bottom: 24px;
}

.cd-card-body {
  padding: 24px;
}

.cd-subtabs {
  display: flex;
  align-items: center;
  gap: 28px;
  padding: 0 24px;
  border-bottom: 1px solid var(--cd-border-subtle);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  flex-wrap: nowrap;
}

.cd-subtabs::-webkit-scrollbar {
  display: none;
}

@media (max-width: 768px) {
  .cd-subtabs {
    gap: 18px;
    padding: 0 16px;
  }
}

@media (max-width: 480px) {
  .cd-subtabs {
    gap: 14px;
    padding: 0 12px;
  }
}

.cd-subtab {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 16px 2px 14px;
  font-size: 14px;
  font-weight: 500;
  color: var(--cd-text-muted);
  text-decoration: none;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  background: transparent;
  border-left: none;
  border-right: none;
  border-top: none;
  cursor: pointer;
  font-family: inherit;
  transition: color 0.15s ease, border-color 0.15s ease;
  flex-shrink: 0;
}

@media (max-width: 768px) {
  .cd-subtab {
    font-size: 13.5px;
    padding: 12px 2px 10px;
  }
}

@media (max-width: 480px) {
  .cd-subtab {
    font-size: 13px;
    padding: 10px 2px 8px;
  }
}

.cd-subtab:hover {
  color: var(--cd-blue);
}

.cd-subtab.is-active {
  color: #0f172a;
  font-weight: 600;
  border-bottom-color: var(--cd-blue);
}

.cd-subtab-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #fef3c7;
  color: #b45309;
  font-size: 11px;
  font-weight: 700;
  width: 18px;
  height: 18px;
  border-radius: 50%;
}

/* Sections inside card */
.cd-sub-section {
  padding: 20px 24px;
  border-bottom: 1px solid var(--cd-border-subtle);
}

.cd-sub-section:last-child {
  border-bottom: none;
}

.cd-section-title {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--cd-text-muted);
  margin: 0 0 12px;
}

/* Requirement quote box */
.cd-req-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: var(--cd-radius-md);
  padding: 16px 20px;
  font-size: 14.5px;
  color: #334155;
  font-style: italic;
  line-height: 1.5;
}

/* Test rows list */
.cd-test-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.cd-test-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 8px 0;
}

.cd-test-item + .cd-test-item {
  border-top: 1px solid #f1f5f9;
  padding-top: 14px;
}

.cd-test-check-icon {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #ecfdf5;
  color: #059669;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  margin-top: 2px;
}

.cd-test-info {
  flex: 1;
}

.cd-test-name {
  margin: 0 0 2px;
  font-size: 14.5px;
  font-weight: 600;
  color: #0f172a;
}

.cd-test-samples {
  font-size: 13px;
  color: var(--cd-text-muted);
}

/* Attachment row */
.cd-attach-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: var(--cd-radius-md);
}

.cd-attach-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.cd-attach-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #f1f5f9;
  color: #64748b;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.cd-attach-name {
  font-size: 14px;
  font-weight: 600;
  color: #0f172a;
}

.cd-link-download {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--cd-blue);
  text-decoration: none;
  cursor: pointer;
}

.cd-link-download:hover {
  text-decoration: underline;
}

/* Timeline Activity */
.cd-timeline {
  display: flex;
  flex-direction: column;
  padding: 8px 0;
  position: relative;
}

.cd-timeline-item {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  position: relative;
  padding-bottom: 24px;
}

.cd-timeline-item:last-child {
  padding-bottom: 0;
}

.cd-timeline-item::before {
  content: "";
  position: absolute;
  left: 5px;
  top: 14px;
  bottom: 0;
  width: 2px;
  background: #e2e8f0;
}

.cd-timeline-item:last-child::before {
  display: none;
}

.cd-timeline-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #64748b;
  flex-shrink: 0;
  margin-top: 4px;
  z-index: 1;
}

.cd-timeline-content {
  flex: 1;
}

.cd-timeline-title {
  margin: 0 0 2px;
  font-size: 14px;
  font-weight: 600;
  color: #0f172a;
}

.cd-timeline-time {
  font-size: 12.5px;
  color: var(--cd-text-muted);
}

/* Quotes Comparison List */
.cd-quotes-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 20px 24px;
}

.cd-quote-card {
  border: 1px solid var(--cd-border);
  border-radius: var(--cd-radius-md);
  padding: 18px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  background: #ffffff;
  transition: box-shadow 0.15s ease;
}

.cd-quote-card:hover {
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.05);
}

.cd-quote-main {
  flex: 1;
}

.cd-quote-lab-title {
  margin: 0 0 4px;
  font-size: 16px;
  font-weight: 600;
  color: #0f172a;
}

.cd-quote-lab-sub {
  font-size: 13px;
  color: var(--cd-text-muted);
  margin-bottom: 8px;
}

.cd-quote-notes {
  margin: 0;
  font-size: 13px;
  color: var(--cd-text-secondary);
}

.cd-quote-price-col {
  text-align: right;
  flex-shrink: 0;
}

.cd-quote-amount {
  font-size: 20px;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.2;
}

.cd-quote-turnaround {
  font-size: 12.5px;
  color: var(--cd-text-muted);
  margin-top: 2px;
}

.cd-quote-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
}

@media (max-width: 640px) {
  .cd-quote-card {
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
    padding: 14px 16px;
  }
  .cd-quote-price-col {
    text-align: left;
    border-top: 1px dashed var(--cd-border-subtle);
    padding-top: 10px;
  }
  .cd-quote-actions {
    width: 100%;
    flex-wrap: wrap;
    margin-top: 10px;
  }
  .cd-quote-actions .cd-btn {
    flex: 1;
    min-width: 120px;
    justify-content: center;
  }
}

/* Stepper Card */
.cd-stepper-card {
  background: #ffffff;
  border: 1px solid var(--cd-border);
  border-radius: var(--cd-radius-lg);
  padding: 22px 28px;
  margin-bottom: 24px;
  box-shadow: var(--cd-shadow-sm);
}

@media (max-width: 768px) {
  .cd-stepper-card {
    padding: 16px 14px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    margin-bottom: 18px;
  }
  .cd-stepper-card::-webkit-scrollbar {
    display: none;
  }
}

.cd-stepper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  position: relative;
}

@media (max-width: 768px) {
  .cd-stepper {
    min-width: 520px;
  }
}

.cd-stepper-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  z-index: 1;
  flex: 1;
  text-align: center;
}

.cd-stepper-circle {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #f1f5f9;
  color: #64748b;
  font-size: 13px;
  font-weight: 700;
  display: grid;
  place-items: center;
  margin-bottom: 8px;
  transition: all 0.2s ease;
}

.cd-stepper-step.is-active .cd-stepper-circle {
  background: #eab308;
  color: #ffffff;
  box-shadow: 0 0 0 4px #fef9c3;
}

.cd-stepper-step.is-done .cd-stepper-circle {
  background: #10b981;
  color: #ffffff;
}

.cd-stepper-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--cd-text-muted);
}

.cd-stepper-step.is-active .cd-stepper-label {
  color: #0f172a;
  font-weight: 600;
}

.cd-stepper-bar {
  position: absolute;
  top: 16px;
  left: 10%;
  right: 10%;
  height: 2px;
  background: #e2e8f0;
  z-index: 0;
}

/* Order Grid (Two columns) */
.cd-order-grid {
  display: grid;
  grid-template-columns: 1.35fr 0.85fr;
  gap: 24px;
  align-items: start;
}

@media (max-width: 992px) {
  .cd-order-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
}

.cd-order-main {
  min-width: 0;
}

.cd-order-side {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* Invoices List */
.cd-invoices-header {
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--cd-text-muted);
  text-transform: uppercase;
  margin-bottom: 12px;
}

.cd-invoice-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
  border-bottom: 1px solid var(--cd-border-subtle);
}

@media (max-width: 640px) {
  .cd-invoice-item {
    flex-wrap: wrap;
    gap: 12px;
    padding: 14px 0;
  }
}

.cd-invoice-item:last-child {
  border-bottom: none;
}

.cd-invoice-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

@media (max-width: 640px) {
  .cd-invoice-left {
    min-width: 0;
    width: 100%;
  }
}

.cd-invoice-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--cd-radius-md);
  background: #f1f5f9;
  color: #64748b;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.cd-invoice-title {
  margin: 0 0 2px;
  font-size: 14px;
  font-weight: 600;
  color: #0f172a;
}

.cd-invoice-sub {
  margin: 0;
  font-size: 12.5px;
  color: var(--cd-text-muted);
}

.cd-invoice-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.cd-invoice-amount {
  font-size: 15px;
  font-weight: 700;
  color: #0f172a;
}

.cd-badge-due {
  background: #fef3c7;
  color: #b45309;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
}

.cd-text-upcoming {
  font-size: 12.5px;
  color: var(--cd-text-muted);
  font-weight: 500;
}

/* Escrow Notice Box */
.cd-escrow-box {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 16px;
  padding: 14px 16px;
  background: #f8fafc;
  border-radius: var(--cd-radius-md);
  font-size: 12.5px;
  color: #475569;
  line-height: 1.45;
}

.cd-escrow-icon {
  flex-shrink: 0;
  margin-top: 2px;
}

/* Right Sidebar Cards */
.cd-card-nextstep {
  background: #0f3e36;
  color: #ffffff;
  border-radius: var(--cd-radius-lg);
  padding: 20px 22px;
  box-shadow: var(--cd-shadow-sm);
}

.cd-card-nextstep__label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: #5eead4;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.cd-card-nextstep__title {
  margin: 0 0 6px;
  font-size: 16px;
  font-weight: 700;
  color: #ffffff;
}

.cd-card-nextstep__desc {
  margin: 0 0 16px;
  font-size: 13px;
  color: #ccfbf1;
  line-height: 1.4;
}

.cd-btn-full {
  width: 100%;
}

.cd-card-lab {
  background: #ffffff;
  border: 1px solid var(--cd-border);
  border-radius: var(--cd-radius-lg);
  padding: 18px 20px;
  box-shadow: var(--cd-shadow-sm);
}

.cd-card-lab__header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.cd-card-lab__avatar {
  width: 36px;
  height: 36px;
  border-radius: var(--cd-radius-sm);
  background: #0f3e36;
  color: #ffffff;
  font-size: 13px;
  font-weight: 700;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.cd-card-lab__name {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: #0f172a;
}

.cd-card-lab__rating {
  margin: 2px 0 0;
  font-size: 12.5px;
  color: var(--cd-text-muted);
}

.cd-lab-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  border-top: 1px solid var(--cd-border-subtle);
  font-size: 13px;
}

.cd-lab-meta-label {
  color: var(--cd-text-muted);
}

.cd-lab-meta-value {
  font-weight: 600;
  color: #0f172a;
}

.cd-card-summary {
  background: #ffffff;
  border: 1px solid var(--cd-border);
  border-radius: var(--cd-radius-lg);
  padding: 18px 20px;
  box-shadow: var(--cd-shadow-sm);
}

.cd-card-summary__header {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--cd-text-muted);
  text-transform: uppercase;
  margin-bottom: 12px;
}

.cd-summary-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13.5px;
  margin-bottom: 8px;
  color: #475569;
}

.cd-summary-row--bold {
  font-weight: 600;
  color: #0f172a;
}

.cd-summary-divider {
  height: 1px;
  background: var(--cd-border-subtle);
  margin: 10px 0;
}

.cd-summary-balance {
  font-size: 16px;
  font-weight: 700;
  color: #0f172a;
}

/* Modal for Edit Enquiry */
.cd-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  box-sizing: border-box;
}

.cd-modal[hidden] {
  display: none !important;
}

.cd-modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(2px);
}

.cd-modal-dialog {
  position: relative;
  background: #ffffff;
  border-radius: var(--cd-radius-lg);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  max-width: 540px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  z-index: 10000;
  box-sizing: border-box;
}

.cd-modal-header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--cd-border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.cd-modal-title {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  color: #0f172a;
}

.cd-modal-close {
  background: transparent;
  border: none;
  font-size: 20px;
  color: var(--cd-text-muted);
  cursor: pointer;
  padding: 4px;
  line-height: 1;
}

.cd-modal-body {
  padding: 20px 24px;
}

.cd-form-group {
  margin-bottom: 16px;
}

.cd-form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #334155;
  margin-bottom: 6px;
}

.cd-form-control {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid #cbd5e1;
  border-radius: var(--cd-radius-sm);
  font-size: 14px;
  color: #0f172a;
  font-family: inherit;
  box-sizing: border-box;
  outline: none;
  transition: border-color 0.15s ease;
}

.cd-form-control:focus {
  border-color: var(--cd-blue);
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.1);
}

.cd-modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--cd-border-subtle);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

@media (max-width: 640px) {
  .cd-modal {
    padding: 12px;
  }
  .cd-modal-dialog {
    max-width: 96vw;
    border-radius: var(--cd-radius-md);
  }
  .cd-modal-header,
  .cd-modal-body,
  .cd-modal-footer {
    padding: 14px 16px;
  }
  .cd-attach-box {
    flex-wrap: wrap;
    gap: 10px;
  }
  .cd-attach-left {
    min-width: 0;
    max-width: 100%;
  }
  .cd-attach-name {
    word-break: break-all;
  }
  .cd-escrow-box {
    flex-direction: column;
    gap: 8px;
  }
  .cd-card-nextstep {
    padding: 18px 16px;
  }
  .cd-card-lab,
  .cd-card-summary {
    padding: 16px;
  }
}

