/* ============================================================
   MODALS.CSS — All Modal Dialogs
   ============================================================ */

/* ── Modal Backdrop ──────────────────────────────────────── */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(15, 23, 20, 0.5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
  animation: backdropFadeIn 0.2s ease;
}
.modal.active { display: flex; }

@keyframes backdropFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ── Modal Content ───────────────────────────────────────── */
.modal-content {
  background: var(--n-0);
  border-radius: var(--r-lg);
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-xl);
  animation: modalSlideIn 0.25s cubic-bezier(0.34, 1.2, 0.64, 1);
  position: relative;
}

@keyframes modalSlideIn {
  from { opacity: 0; transform: translateY(12px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ── Modal Header ────────────────────────────────────────── */
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--n-150);
  position: sticky;
  top: 0;
  background: var(--n-0);
  z-index: 1;
  border-radius: var(--r-lg) var(--r-lg) 0 0;
}

/* ── Modal Body ──────────────────────────────────────────── */
.modal-body {
  padding: var(--space-6);
}

/* ── Modal Footer ────────────────────────────────────────── */
.modal-actions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: 16px 24px;
  border-top: 1px solid var(--n-150);
  position: sticky;
  bottom: 0;
  background: var(--n-0);
  border-radius: 0 0 var(--r-lg) var(--r-lg);
}
.modal-footer-split  { justify-content: space-between; }
.modal-footer-end    { justify-content: flex-end; }

/* ── Close Button ────────────────────────────────────────── */
.close-modal {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: var(--n-100);
  border-radius: 50%;
  font-size: 14px;
  color: var(--n-500);
  cursor: pointer;
  transition: all var(--t-fast);
  flex-shrink: 0;
  line-height: 1;
}
.close-modal:hover { background: var(--n-200); color: var(--n-700); }

/* ── Client Modal ────────────────────────────────────────── */
.client-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(15, 23, 20, 0.5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
}
.client-modal.active { display: flex; }

.client-modal-content {
  background: var(--n-0);
  border-radius: var(--r-lg);
  width: 100%;
  max-width: 640px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-xl);
  animation: modalSlideIn 0.25s cubic-bezier(0.34, 1.2, 0.64, 1);
}

.client-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--n-150);
  flex-shrink: 0;
}

.client-modal-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--n-800);
  font-family: var(--font-display);
}

.client-modal-body {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-5) var(--space-6);
}

.client-modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--n-150);
  display: flex;
  justify-content: flex-end;
  flex-shrink: 0;
  background: var(--n-0);
  border-radius: 0 0 var(--r-lg) var(--r-lg);
}

/* ── Standard Modal (edit dialogs, shared pattern) ──────── */
/* Backdrop */
.std-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 3000;
  background: rgba(15, 23, 20, 0.45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
}
.std-modal.active { display: flex; }

/* Container */
.std-modal-content {
  background: var(--n-0);
  border-radius: var(--r-lg);
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 32px 80px rgba(0,0,0,0.25);
  animation: modalSlideIn 0.2s cubic-bezier(0.34,1.2,0.64,1);
}

/* Header — white, pinned */
.std-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px 16px;
  border-bottom: 1px solid var(--n-150);
  flex-shrink: 0;
  border-radius: var(--r-lg) var(--r-lg) 0 0;
}
.std-modal-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--n-800);
  margin: 0;
}

/* Body — grey background, scrollable */
.std-modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px;
  background: #f8fafc;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* White card inside body — groups related fields */
.std-modal-card {
  background: var(--n-0);
  border: 1px solid var(--n-150);
  border-radius: 10px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.std-modal-card-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--n-400);
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-bottom: 2px;
}

/* Footer — white, pinned */
.std-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 24px;
  border-top: 1px solid var(--n-150);
  flex-shrink: 0;
  background: var(--n-0);
  border-radius: 0 0 var(--r-lg) var(--r-lg);
}

/* ── Invoice section inside appointment details ──────────── */
#invoiceSection {
  background: var(--n-50);
  border: 1px solid var(--n-150);
  border-radius: var(--r-sm);
  padding: 10px 14px;
  margin-bottom: var(--space-3);
  font-size: 13px;
}

/* ── Progress steps in intake modals ────────────────────── */
.intake-steps {
  display: flex;
  gap: 32px;
  padding: 0 24px 20px;
  border-bottom: 1px solid var(--n-150);
  margin-bottom: 24px;
}
.step-item {
  display: flex;
  align-items: center;
  gap: 8px;
}
.step-circle {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
}
.step-circle.active  { background: var(--brand-500); color: white; }
.step-circle.done    { background: var(--accent-green); color: white; }
.step-circle.pending { background: var(--n-150); color: var(--n-400); }
.step-label.active   { font-size: 13px; font-weight: 600; color: var(--brand-500); }
.step-label.done     { font-size: 13px; color: var(--accent-green); }
.step-label.pending  { font-size: 13px; color: var(--n-400); }

/* ── Selected items pills ────────────────────────────────── */
.selected-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: var(--brand-50);
  border: 1px solid var(--brand-200);
  border-radius: var(--r-full);
  font-size: 12px;
  font-weight: 500;
  color: var(--brand-700);
}

/* ── Confirm Delete Dialog ───────────────────────────────── */
.confirm-overlay {
  position: fixed;
  inset: 0;
  z-index: 3000;
  background: rgba(15, 23, 20, 0.5);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: fadeIn 0.15s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.confirm-dialog {
  background: var(--n-0);
  border-radius: var(--r-lg);
  padding: 36px 32px;
  max-width: 380px;
  width: 100%;
  text-align: center;
  box-shadow: var(--shadow-xl);
  animation: modalSlideIn 0.25s cubic-bezier(0.34, 1.2, 0.64, 1);
}

.confirm-icon {
  font-size: 40px;
  margin-bottom: 12px;
}

.confirm-dialog h3 {
  font-size: 18px;
  font-weight: 700;
  color: var(--n-800);
  margin-bottom: 10px;
  font-family: var(--font-display);
}

.confirm-dialog p {
  font-size: 14px;
  color: var(--n-500);
  line-height: 1.6;
  margin-bottom: 24px;
}

.confirm-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
}

.confirm-btn-cancel {
  padding: 10px 24px;
  border: 1.5px solid var(--n-200);
  border-radius: var(--r-md);
  background: var(--n-0);
  color: var(--n-600);
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.12s ease;
}
.confirm-btn-cancel:hover {
  background: var(--n-100);
  border-color: var(--n-300);
}

.confirm-btn-delete {
  padding: 10px 24px;
  border: none;
  border-radius: var(--r-md);
  background: #dc2626;
  color: white;
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.12s ease;
}
.confirm-btn-delete:hover {
  background: #b91c1c;
  transform: translateY(-1px);
}
