/* Booking page and email branding editor. Paired with views/clinic-branding.html. */

.cb-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 20px 28px 12px;
  border-bottom: 1px solid var(--gray-200, #e5e7eb);
  background: #fff;
}

.cb-title {
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--gray-900, #111827);
  margin: 0;
}

.cb-subtitle {
  margin: 4px 0 0;
  font-size: 0.85rem;
  color: var(--gray-500, #6b7280);
}

.cb-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.cb-dirty {
  font-size: 0.78rem;
  color: #92400e;
  background: #fef3c7;
  border-radius: 999px;
  padding: 3px 10px;
}

.cb-btn {
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 9px 16px;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
}

.cb-btn[disabled] { opacity: 0.5; cursor: default; }

.cb-btn-primary { background: var(--teal-600, #1e4d3f); color: #fff; }
.cb-btn-ghost { background: #fff; color: var(--gray-700, #374151); border-color: var(--gray-300, #d1d5db); }

.cb-banner {
  margin: 14px 28px 0;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 0.85rem;
}

.cb-banner-ok { background: #ecfdf5; color: #065f46; }
.cb-banner-error { background: #fef2f2; color: #991b1b; }
.cb-banner-info { background: #eff6ff; color: #1e40af; }

.cb-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 20px;
  padding: 20px 28px 48px;
  align-items: start;
}

.cb-pane {
  background: #fff;
  border: 1px solid var(--gray-200, #e5e7eb);
  border-radius: 12px;
  padding: 20px;
}

.cb-pane-title {
  font-size: 0.95rem;
  font-weight: 600;
  margin: 0 0 14px;
  color: var(--gray-900, #111827);
}

.cb-fields { display: flex; flex-direction: column; gap: 22px; }

.cb-field { display: flex; flex-direction: column; gap: 6px; }

.cb-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--gray-800, #1f2937);
}

.cb-help, .cb-rec {
  margin: 0;
  font-size: 0.78rem;
  color: var(--gray-500, #6b7280);
}

.cb-rec { font-style: italic; }

.cb-color-row, .cb-url-row { display: flex; align-items: center; gap: 8px; }

.cb-input {
  flex: 1 1 auto;
  min-width: 0;
  padding: 8px 12px;
  border: 1px solid var(--gray-300, #d1d5db);
  border-radius: 6px;
  font-size: 0.85rem;
}

.cb-input-hex {
  flex: 0 0 120px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  text-transform: uppercase;
}

.cb-swatch {
  flex: 0 0 42px;
  height: 36px;
  padding: 2px;
  border: 1px solid var(--gray-300, #d1d5db);
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
}

.cb-clear {
  flex: 0 0 auto;
  background: none;
  border: none;
  color: var(--gray-500, #6b7280);
  font-size: 0.78rem;
  cursor: pointer;
  text-decoration: underline;
}

.cb-contrast { margin: 0; font-size: 0.78rem; }
.cb-contrast-ok { color: #047857; }
.cb-contrast-warn { color: #92400e; }
.cb-contrast-error { color: #b91c1c; }

.cb-error { margin: 0; font-size: 0.78rem; color: #b91c1c; }

.cb-empty { color: var(--gray-500, #6b7280); font-size: 0.85rem; margin: 0; }

/* ── preview ────────────────────────────────────────────────────────────── */

.cb-preview-pane { position: sticky; top: 16px; }

.cb-preview-label {
  margin: 14px 0 6px;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--gray-500, #6b7280);
}

.cb-preview-label:first-of-type { margin-top: 0; }

.cb-preview-booking {
  display: grid;
  grid-template-columns: 44% 1fr;
  border: 1px solid var(--gray-200, #e5e7eb);
  border-radius: 10px;
  overflow: hidden;
  background-size: cover;
  background-position: center;
  min-height: 150px;
}

.cb-preview-panel {
  padding: 14px 12px;
  color: #fff;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.cb-preview-logo { max-width: 100%; max-height: 28px; width: auto; object-fit: contain; }

.cb-preview-clinic { margin: 0; font-size: 0.85rem; font-weight: 600; }
.cb-preview-copy { margin: 0; font-size: 0.75rem; opacity: 0.85; }

.cb-preview-form {
  background: rgba(255, 255, 255, 0.94);
  padding: 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-start;
}

.cb-preview-slot {
  font-size: 0.72rem;
  padding: 4px 10px;
  border: 1px solid var(--gray-300, #d1d5db);
  border-radius: 6px;
  color: var(--gray-600, #4b5563);
}

.cb-preview-slot-on { font-weight: 600; }

.cb-preview-cta {
  margin-top: 4px;
  border: none;
  border-radius: 6px;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 7px 14px;
  opacity: 1;
}

.cb-preview-email {
  border: 1px solid var(--gray-200, #e5e7eb);
  border-radius: 10px;
  overflow: hidden;
}

.cb-preview-email-head {
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px;
}

.cb-preview-email-img { max-width: 100%; max-height: 40px; width: auto; object-fit: contain; }

.cb-preview-email-body { background: #fff; padding: 12px; }

.cb-preview-email-line {
  height: 7px;
  border-radius: 4px;
  background: var(--gray-200, #e5e7eb);
  margin: 0 0 7px;
}

.cb-preview-email-line-short { width: 60%; margin-bottom: 0; }

.cb-preview-note {
  margin: 14px 0 0;
  font-size: 0.75rem;
  color: var(--gray-500, #6b7280);
  line-height: 1.5;
}

@media (max-width: 1100px) {
  .cb-grid { grid-template-columns: minmax(0, 1fr); }
  .cb-preview-pane { position: static; }
}
