/* ===== Send To GetHeally ===== */
.getheally-view {
  max-width: 800px;
  margin: 0 auto;
  padding: 20px 24px 80px;
}
.getheally-view .page-header { margin-bottom: 16px; }
.gh-card {
  background: var(--surface, #fff);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 22px;
  box-shadow: 0 1px 2px rgba(0,0,0,.04);
}
.gh-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--text-light);
  margin-bottom: 8px;
}
.gh-search .so-search-icon { opacity: .6; }
.gh-search input { height: 46px; font-size: 15px; }

/* Selected patient card */
.gh-patient-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg-subtle, #f9fafb);
}
.gh-avatar {
  flex: 0 0 auto;
  width: 44px; height: 44px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; font-weight: 700; color: #fff;
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  letter-spacing: .5px;
}
.gh-patient-info { flex: 1 1 auto; min-width: 0; }
.gh-patient-name { font-size: 16px; font-weight: 600; color: var(--text); }
.gh-patient-sub { font-size: 13px; color: var(--text-light); margin-top: 2px; }
.gh-change-btn {
  flex: 0 0 auto;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-light);
  border-radius: 8px;
  padding: 7px 14px;
  font-size: 13px; font-weight: 500;
  cursor: pointer;
}
.gh-change-btn:hover { background: var(--surface, #fff); color: var(--text); }

/* Confirm step */
.gh-confirm {
  margin-top: 16px;
  padding: 16px;
  border: 1px dashed var(--border);
  border-radius: 12px;
  background: var(--surface, #fff);
}
.gh-confirm-text { font-size: 14px; color: var(--text); line-height: 1.5; margin-bottom: 14px; }
.gh-actions { display: flex; gap: 12px; }
.gh-run-btn { display: inline-flex; align-items: center; gap: 8px; }
.gh-run-btn svg { flex: 0 0 auto; }
.gh-run-btn:disabled { opacity: .6; cursor: default; }

.gh-status {
  margin-top: 16px;
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  border: 1px solid var(--border);
  display: flex; align-items: center; gap: 10px;
}
.gh-status-loading { background: #eff6ff; color: #1e40af; border-color: #bfdbfe; }
.gh-status-loading::before {
  content: ''; width: 15px; height: 15px; border-radius: 50%;
  border: 2px solid #bfdbfe; border-top-color: #1e40af;
  animation: gh-spin .7s linear infinite; flex: 0 0 auto;
}
@keyframes gh-spin { to { transform: rotate(360deg); } }
.gh-status-success { background: #ecfdf5; color: #065f46; border-color: #a7f3d0; }
.gh-status-error { background: #fef2f2; color: #991b1b; border-color: #fecaca; }

.gh-result {
  margin-top: 14px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-subtle, #f9fafb);
}
.gh-result-label { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .03em; color: var(--text-light); margin-bottom: 6px; }
.gh-result-link { font-size: 14px; color: var(--primary, #2563eb); word-break: break-all; text-decoration: underline; }
.gh-result-hint { margin-top: 8px; font-size: 13px; color: #991b1b; }

/* History */
.gh-history-card {
  margin-top: 22px;
  background: var(--surface, #fff);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px 22px;
}
.gh-history-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.gh-history-title { font-size: 14px; font-weight: 700; color: var(--text); }
.gh-history-refresh {
  background: transparent; border: none; color: var(--text-light);
  cursor: pointer; padding: 6px; border-radius: 6px; display: inline-flex;
}
.gh-history-refresh:hover { background: var(--bg-subtle, #f3f4f6); color: var(--text); }
.gh-history-list { display: flex; flex-direction: column; }
.gh-history-empty { font-size: 13px; color: var(--text-light); padding: 14px 0; }
.gh-history-item {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 0; border-bottom: 1px solid var(--border);
}
.gh-history-item:last-child { border-bottom: none; }
.gh-history-avatar {
  flex: 0 0 auto; width: 34px; height: 34px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; color: var(--text-light);
  background: var(--bg-subtle, #eef2f7);
}
.gh-history-main { flex: 1 1 auto; min-width: 0; }
.gh-history-name { font-size: 14px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gh-history-meta { font-size: 12px; color: var(--text-light); margin-top: 1px; }
.gh-history-right { flex: 0 0 auto; display: flex; align-items: center; gap: 10px; }
.gh-history-badge { font-size: 11px; font-weight: 600; padding: 3px 9px; border-radius: 999px; }
.gh-history-badge.done { background: #ecfdf5; color: #065f46; }
.gh-history-badge.running { background: #eff6ff; color: #1e40af; }
.gh-history-link { font-size: 13px; color: var(--primary, #2563eb); text-decoration: underline; white-space: nowrap; }
.gh-history-pending { font-size: 12px; color: var(--text-light); }
/* History */
.so-history-list { display: flex; flex-direction: column; }
.so-history-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.so-history-item:last-child { border-bottom: none; }
.so-history-name { font-weight: 600; font-size: 14px; color: var(--text); }
.so-history-sub { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.so-history-empty { padding: 10px 0; font-size: 13px; color: var(--text-muted); }
/* Status badges */
.so-status-badge {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.03em;
  padding: 3px 10px;
  border-radius: 10px;
  white-space: nowrap;
}
.so-status-success { background: var(--success-bg); color: var(--success); }
.so-status-failed { background: var(--danger-bg); color: var(--danger); }
.so-status-pending { background: #fef3c7; color: #92400e; }
.so-status-scheduled { background: #dbeafe; color: #1e40af; }
/* Progress modal */
.so-progress-content { text-align: left; }
.so-progress-header { margin-bottom: 18px; }
.so-progress-title { font-size: 17px; font-weight: 700; color: var(--text); }
.so-progress-subtitle { font-size: 13px; color: var(--text-muted); margin-top: 4px; }
.so-progress-steps { display: flex; flex-direction: column; gap: 12px; }
.so-progress-step { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--text); }
.so-step-icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  border-radius: 50%;
}
.so-step-success { background: var(--success-bg); color: var(--success); }
.so-step-failed { background: var(--danger-bg); color: var(--danger); }
.so-step-text { flex: 1; }
.so-mini-spinner {
  border: 2px solid var(--border-strong);
  border-top-color: var(--primary);
  border-radius: 50%;
  width: 16px;
  height: 16px;
  animation: so-spin 0.7s linear infinite;
}
@keyframes so-spin { to { transform: rotate(360deg); } }
.so-progress-error {
  margin-top: 16px;
  background: var(--danger-bg);
  border: 1px solid var(--danger);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 13px;
  color: var(--danger);
  line-height: 1.5;
}
.so-progress-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
}
/* Responsive */
@media (max-width: 700px) {
  .so-form-grid { grid-template-columns: 1fr; }
  .sendorder-view { padding: 14px 16px 60px; }
  .getheally-view { padding: 14px 16px 60px; }
  .so-selected-patient { flex-direction: column; align-items: flex-start; }
}

