/* Release 5 — Client Preview styles. */

.client-tab {
  gap: 1.25rem;
}

.client-preview-wrapper {
  display: flex;
  justify-content: center;
}

.client-preview {
  background: #fff;
  border: 1px solid var(--color-border, #e5e7eb);
  border-radius: 0.5rem;
  padding: 2rem;
  max-width: 54rem;
  width: 100%;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, sans-serif;
  color: var(--color-text, #2d2d2d);
}

.client-preview__letterhead {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  border-bottom: 2px solid var(--color-primary, #19195F);
  padding-bottom: 1rem;
  margin-bottom: 1.25rem;
}

.client-preview__brand h1 {
  font-family: "Playfair Display", Georgia, serif;
  color: var(--color-primary, #19195F);
  font-size: 1.6rem;
  margin: 0;
}

.client-preview__tagline {
  color: var(--color-accent, #c9a84c);
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin: 0.25rem 0 0;
}

.client-preview__contact {
  text-align: right;
  font-size: 0.85rem;
  color: var(--color-text-muted, #6b7280);
}

.client-preview__summary-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.client-preview__summary-block {
  border: 1px solid var(--color-border, #e5e7eb);
  border-radius: 0.375rem;
  padding: 0.6rem 0.75rem;
}

.client-preview__summary-label {
  font-size: 0.7rem;
  color: var(--color-text-muted, #6b7280);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.client-preview__summary-value {
  font-weight: 600;
  margin-top: 0.2rem;
}

.client-preview__sections h2,
.client-preview__payment h2,
.client-preview__signature h2 {
  font-family: "Playfair Display", Georgia, serif;
  color: var(--color-primary, #19195F);
  border-bottom: 1px solid var(--color-border, #e5e7eb);
  padding-bottom: 0.25rem;
  margin: 1.25rem 0 0.75rem;
}

.client-preview__section {
  padding: 0.5rem 0;
  border-bottom: 1px dashed var(--color-border, #e5e7eb);
}

.client-preview__section h3 {
  margin: 0;
  font-size: 1rem;
}

.client-preview__totals {
  margin: 1rem 0;
  padding: 0.75rem 1rem;
  background: #f8fafc;
  border-radius: 0.5rem;
}

.client-preview__totals-row {
  display: flex;
  justify-content: space-between;
  padding: 0.35rem 0;
  border-bottom: 1px solid var(--color-border, #e5e7eb);
  font-size: 0.95rem;
}

.client-preview__totals-row.is-grand {
  font-weight: 700;
  color: var(--color-primary, #19195F);
  border-top: 2px solid var(--color-accent, #c9a84c);
  border-bottom: none;
  font-size: 1.1rem;
  margin-top: 0.4rem;
  padding-top: 0.5rem;
}

.client-preview__signature-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.client-preview__signature-cell {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.client-preview__signature-line {
  border-bottom: 1px solid #333;
  height: 2rem;
}

.client-preview__signature-label {
  font-size: 0.75rem;
  color: var(--color-text-muted, #6b7280);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

@media print {
  .page-header,
  .tab-nav,
  .sidebar,
  .inline-actions,
  .client-preview-wrapper {
    display: none !important;
  }
  .client-preview {
    border: none;
    padding: 0;
    max-width: none;
  }
  .app-shell {
    background: #fff !important;
  }
}

.client-approval-page {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

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

.client-approval-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.approval-panel {
  background: #ffffff;
  border: 1px solid #d1d5db;
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.04);
}

.approval-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: #4b5563;
  margin: 12px 0 6px;
}

.approval-panel input,
.approval-panel select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font: inherit;
}

.approval-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.btn-primary,
.btn-secondary,
.btn-danger {
  border: none;
  border-radius: 8px;
  padding: 10px 14px;
  font-weight: 600;
  cursor: pointer;
}

.btn-primary {
  background: #1d4ed8;
  color: #ffffff;
}

.btn-secondary {
  background: #e5e7eb;
  color: #111827;
}

.btn-danger {
  background: #b91c1c;
  color: #ffffff;
}

.approval-badge,
.approval-signer-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.status-not_sent,
.status-pending {
  background: #e5e7eb;
  color: #374151;
}

.status-sent,
.status-viewed {
  background: #dbeafe;
  color: #1d4ed8;
}

.status-approved {
  background: #dcfce7;
  color: #166534;
}

.status-declined,
.status-expired {
  background: #fee2e2;
  color: #991b1b;
}

.approval-signer-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 10px;
}

.approval-signer-name {
  font-weight: 700;
  color: #111827;
}

.approval-signer-meta,
.approval-audit-meta,
.approval-empty {
  color: #6b7280;
  font-size: 13px;
}

.approval-audit-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.approval-audit-row {
  border-bottom: 1px solid #f1f5f9;
  padding-bottom: 10px;
}

.approval-audit-kind {
  font-weight: 700;
  color: #111827;
}

#client-approval-signature-pad {
  width: 100%;
  max-width: 480px;
  border: 1px dashed #94a3b8;
  border-radius: 10px;
  background: #ffffff;
  touch-action: none;
}

@media (max-width: 960px) {
  .client-approval-grid {
    grid-template-columns: 1fr;
  }
}

@media print {
  .approval-actions,
  #client-approval-signature-pad,
  .btn-primary,
  .btn-secondary,
  .btn-danger {
    display: none !important;
  }
}