/* ─────────────────────────────────────────────
   request-detail.css
   Shared styles for fab_request_detail (users)
   and request_detail (fabricala_quote_crm).

   Colour tokens expected from base theme:
     --p-color        primary blue
     --bg-color       light background
     --border-radius  card radius
   If those vars aren't defined they fall back to
   the hardcoded values used in the staff view.
   ───────────────────────────────────────────── */

/* ── Section cards ── */
.section-card {
  border: 1px solid #dde3ed;
  border-radius: var(--border-radius, 8px);
  margin-bottom: 1.25rem;
  overflow: hidden;
  background: #fff;
}
.section-card .card-header {
  background: var(--bg-color, #f4f7fc);
  border-bottom: 1px solid #dde3ed;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--p-color, #0f4c81);
  padding: 0.55rem 1rem;
}
.section-card .card-body {
  padding: 1rem;
}

/* ── Field grid ── */
.field-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.5rem 1.5rem;
}
.field-label {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: #6b7280;
  margin-bottom: 0.15rem;
}
.field-value {
  font-size: 0.9rem;
  color: var(--p-color, #111827);
  font-weight: 500;
}
.field-value.empty {
  color: #9ca3af;
  font-weight: 400;
  font-style: italic;
}

/* ── File cards ── */
.file-card {
  border: 1px solid #dde3ed;
  border-radius: 6px;
  padding: 0.75rem 1rem;
  background: #fafbfd;
  margin-bottom: 0.75rem;
}
.file-card:last-child {
  margin-bottom: 0;
}
.file-name {
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--p-color, #0f4c81);
  margin-bottom: 0.4rem;
  word-break: break-all;
}
.file-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.9rem;
}
.file-meta-item {
  font-size: 0.78rem;
  color: #374151;
}
.file-meta-item .lbl {
  color: #9ca3af;
  margin-right: 0.2rem;
}
.file-text-field {
  margin-top: 0.5rem;
  background: #f3f4f6;
  border-radius: 4px;
  padding: 0.4rem 0.6rem;
  font-size: 0.8rem;
  color: #374151;
}
.file-text-field .lbl {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  color: #6b7280;
  display: block;
  margin-bottom: 0.15rem;
}

/* ── Assembly links ── */
.assembly-link {
  display: inline-block;
  background: #f3f4f6;
  color: #374151;
  font-size: 0.78rem;
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  text-decoration: none;
  margin: 0.1rem;
}
.assembly-link:hover {
  background: #e5e7eb;
  color: #111;
}

/* ── Preview toggle ── */
.btn-preview {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.15rem 0.55rem;
  border-radius: 4px;
  border: 1px solid var(--p-color, #0f4c81);
  color: var(--p-color, #0f4c81);
  background: transparent;
  cursor: pointer;
  transition:
    background 0.15s,
    color 0.15s;
}
.btn-preview:hover {
  background: var(--p-color, #0f4c81);
  color: #fff;
}
.btn-preview.active {
  background: var(--p-color, #0f4c81);
  color: #fff;
}
.preview-container {
  margin-top: 0.75rem;
  border: 1px solid #dde3ed;
  border-radius: 6px;
  overflow: hidden;
  min-height: 200px;
  max-height: 500px;
  overflow-y: auto;
  background: #f8f9fa;
}

/* ── Quote panel ── */
.quote-panel {
  border: 2px solid var(--p-color, #0f4c81);
  border-radius: var(--border-radius, 8px);
  overflow: hidden;
  margin-bottom: 1.25rem;
}
.quote-panel-header {
  background: var(--p-color, #0f4c81);
  color: #fff;
  padding: 0.65rem 1rem;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.quote-panel-body {
  padding: 1rem;
}

/* ── Badge status ── */
.badge-status {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.25em 0.75em;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.bs-draft {
  background: #fef9c3;
  color: #854d0e;
}
.bs-sent {
  background: #dbeafe;
  color: #1e40af;
}
.bs-accepted {
  background: #dcfce7;
  color: #166534;
}
.bs-rejected {
  background: #fee2e2;
  color: #991b1b;
}
.bs-none {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
}

/* ── Quote stats ── */
.quote-stat {
  text-align: center;
  padding: 0.5rem;
}
.quote-stat .qs-label {
  font-size: 0.68rem;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.7px;
}
.quote-stat .qs-value {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--p-color, #0f4c81);
  font-variant-numeric: tabular-nums;
}

/* ── Finishing chips ── */
.finishing-chip {
  display: inline-block;
  background: #e8f1fb;
  color: var(--p-color, #0f4c81);
  font-size: 0.75rem;
  font-weight: 500;
  padding: 0.2rem 0.65rem;
  border-radius: 20px;
  margin: 0.15rem 0.1rem;
}
