/* ============ SLIDE-OVER PANEL (Patient Detail) ============ */
.slideover-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.35);
  z-index: 90;
  backdrop-filter: blur(2px);
  animation: fadeIn 0.18s ease-out;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.slideover {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 480px;
  max-width: 100vw;
  background: var(--surface);
  z-index: 100;
  box-shadow: -8px 0 24px rgba(15,23,42,0.10);
  display: flex;
  flex-direction: column;
  animation: slideInRight 0.22s ease-out;
}
@keyframes slideInRight {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}
.slideover-header {
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}
.slideover-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
  letter-spacing: -0.01em;
}
.slideover-contact {
  font-size: 13px;
  color: var(--text-muted);
}
.slideover-contact a {
  color: var(--text-muted);
  text-decoration: none;
}
.slideover-contact a:hover { color: var(--primary); text-decoration: underline; }
.slideover-close {
  background: none;
  border: none;
  font-size: 26px;
  color: var(--text-muted);
  cursor: pointer;
  line-height: 1;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}
.slideover-close:hover { background: var(--surface-alt); color: var(--text); }

.slideover-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px 40px;
}

.detail-pill-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.detail-section {
  margin-top: 16px;
}
.detail-section-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.detail-section-title .count {
  background: var(--surface-alt);
  color: var(--text-muted);
  padding: 2px 7px;
  border-radius: 8px;
  font-size: 10px;
  margin-left: 6px;
}
.detail-section-title .edit-link {
  text-transform: none;
  letter-spacing: 0;
  font-size: 12px;
  color: var(--primary);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-weight: 600;
}
.detail-section-title .edit-link:hover { text-decoration: underline; }

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 22px;
  row-gap: 0;
  border-top: 1px solid var(--border);
}
.detail-field {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 2px;
  padding: 7px 0 8px;
  border-bottom: 1px solid var(--border);
  min-width: 0;
}
.detail-field-label {
  font-size: 10px;
  color: var(--text-light);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.detail-field-value {
  font-size: 13.5px;
  color: var(--text);
  font-weight: 600;
  line-height: 1.35;
  word-break: break-word;
}
.detail-field-value.muted { color: var(--text-muted); font-weight: 400; }

/* Tags row */
.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 14px;
}
.tag-chip {
  background: var(--primary-light);
  color: var(--primary);
  padding: 3px 9px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
}

/* Order history list */
.order-list {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.order-row {
  display: grid;
  grid-template-columns: 1fr 1.4fr auto auto;
  gap: 10px;
  padding: 10px 12px;
  font-size: 12px;
  align-items: center;
  border-bottom: 1px solid var(--border);
}
.order-row:last-child { border-bottom: none; }
.order-row:hover { background: var(--surface-hover); }
.order-row .order-date { color: var(--text-muted); white-space: nowrap; }
.order-row .order-program { color: var(--text); font-weight: 500; }
.order-row .order-amount { font-weight: 600; color: var(--text); }

/* Tracking link */
.tracking-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--primary);
  text-decoration: none;
}
.tracking-link:hover { text-decoration: underline; }

/* GHL Note Add Form */
.ghl-note-form {
  background: var(--surface-alt);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  padding: 12px;
  margin-top: 8px;
  margin-bottom: 12px;
}
.ghl-note-warn {
  font-size: 11px;
  color: var(--warning);
  background: var(--warning-bg);
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  border-left: 3px solid var(--warning);
}
.ghl-note-form textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  font-size: 13px;
  font-family: inherit;
  background: var(--surface);
  color: var(--text);
  resize: vertical;
  min-height: 60px;
}
.ghl-note-form textarea:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 2px rgba(59,130,246,0.12);
}
.ghl-note-form-actions {
  display: flex;
  gap: 6px;
  justify-content: flex-end;
  margin-top: 8px;
}
.ghl-note-form-actions button {
  padding: 6px 14px;
  font-size: 12px;
}

/* GHL notes list */
.ghl-notes {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 320px;
  overflow-y: auto;
  padding-right: 4px;
}
.ghl-note {
  background: var(--surface-alt);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  border-left: 3px solid var(--primary);
}
.ghl-note-date {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 4px;
  font-weight: 600;
}
.ghl-note-body {
  font-size: 13px;
  color: var(--text);
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}
.ghl-notes-empty {
  font-size: 12px;
  color: var(--text-muted);
  padding: 16px;
  text-align: center;
  background: var(--surface-alt);
  border-radius: var(--radius-md);
}
.detail-loading {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-muted);
  padding: 8px 0;
}
.detail-loading .mini-spinner {
  width: 12px;
  height: 12px;
  border: 2px solid var(--border);
  border-top-color: var(--info);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.detail-notes-box {
  position: relative;
}
.detail-notes-box textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  font-size: 13px;
  font-family: inherit;
  min-height: 90px;
  resize: vertical;
  background: var(--surface);
  color: var(--text);
  line-height: 1.5;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}
.detail-notes-box textarea:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(59,130,246,0.12);
}
.detail-notes-box textarea.dirty {
  border-color: #f59e0b;
  background: #fffbeb;
}
.detail-notes-box textarea.saved {
  border-color: #10b981;
}
.detail-notes-status {
  position: absolute;
  bottom: 10px;
  right: 12px;
  font-size: 11px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
  background: rgba(255,255,255,0.85);
  padding: 2px 6px;
  border-radius: 4px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s;
}
.detail-notes-status.visible { opacity: 1; }
.detail-notes-status.unsaved { color: #d97706; }
.detail-notes-status.saving { color: var(--info); }
.detail-notes-status.saved { color: #10b981; }
.detail-notes-status.error { color: var(--danger); }

