/* =========================================================
   ElimoraHealth Shared Components
   ========================================================= */

.eh-card {
  background: var(--eh-card);
  border: 1px solid var(--eh-border);
  border-radius: var(--eh-radius-xl);
  box-shadow: var(--eh-shadow-soft);
}

.eh-card-lg {
  border-radius: var(--eh-radius-2xl);
  box-shadow: var(--eh-shadow-card);
}

.eh-card-pad {
  padding: 1.25rem;
}

.eh-hover {
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}

.eh-hover:hover {
  transform: translateY(-2px);
  box-shadow: var(--eh-shadow-card);
}

/* Icon Badges */

.eh-icon {
  width: 44px;
  height: 44px;
  border-radius: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 1.15rem;
}

.eh-icon-sm {
  width: 32px;
  height: 32px;
  border-radius: 11px;
  font-size: 0.95rem;
}

.eh-icon-lg {
  width: 56px;
  height: 56px;
  border-radius: 22px;
  font-size: 1.45rem;
}

.eh-icon-blue { background: var(--eh-soft-blue); color: var(--eh-blue); }
.eh-icon-cyan { background: var(--eh-soft-cyan); color: #0891b2; }
.eh-icon-teal { background: var(--eh-soft-teal); color: #0f9f8f; }
.eh-icon-green { background: var(--eh-soft-green); color: #16a34a; }
.eh-icon-amber { background: var(--eh-soft-amber); color: #d97706; }
.eh-icon-orange { background: var(--eh-soft-orange); color: #ea580c; }
.eh-icon-red { background: var(--eh-soft-red); color: #dc2626; }
.eh-icon-purple { background: var(--eh-soft-purple); color: #7c3aed; }
.eh-icon-pink { background: var(--eh-soft-pink); color: #db2777; }
.eh-icon-slate { background: var(--eh-soft-slate); color: #475569; }

/* Status Pills */

.eh-status {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border-radius: var(--eh-radius-pill);
  padding: 0.35rem 0.7rem;
  font-size: 0.72rem;
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
  text-transform: uppercase;
}

.eh-status-blue,
.eh-status-scheduled,
.eh-status-result-available { background: var(--eh-soft-blue); color: var(--eh-blue); }

.eh-status-green,
.eh-status-confirmed,
.eh-status-approved,
.eh-status-paid,
.eh-status-reviewed,
.eh-status-completed { background: var(--eh-soft-green); color: #16a34a; }

.eh-status-amber,
.eh-status-pending,
.eh-status-partial,
.eh-status-ordered,
.eh-status-waiting { background: var(--eh-soft-amber); color: #d97706; }

.eh-status-purple,
.eh-status-triage,
.eh-status-in-progress { background: var(--eh-soft-purple); color: #7c3aed; }

.eh-status-red,
.eh-status-cancelled,
.eh-status-rejected,
.eh-status-void,
.eh-status-abnormal,
.eh-status-no-show { background: var(--eh-soft-red); color: #dc2626; }

.eh-status-slate,
.eh-status-draft { background: var(--eh-soft-slate); color: #475569; }

/* Buttons */

.btn-eh-primary {
  background: linear-gradient(135deg, var(--eh-cyan), var(--eh-blue));
  color: #ffffff;
  border: none;
  font-weight: 900;
  border-radius: var(--eh-radius-pill);
  box-shadow: 0 12px 28px rgba(15, 111, 255, 0.18);
}

.btn-eh-primary:hover {
  color: #ffffff;
  filter: brightness(0.96);
}

.btn-eh-dark {
  background: linear-gradient(135deg, var(--eh-navy-900), var(--eh-navy-700));
  color: #ffffff;
  border: none;
  font-weight: 900;
  border-radius: var(--eh-radius-pill);
}

.btn-eh-dark:hover {
  color: #ffffff;
  filter: brightness(1.08);
}

.btn-eh-soft {
  border-radius: var(--eh-radius-pill);
  font-weight: 900;
  border: 1px solid var(--eh-border);
  background: #ffffff;
  color: var(--eh-text);
}

.btn-eh-soft:hover {
  background: #f8fbff;
}

/* Tables */

.eh-table-wrap {
  overflow: hidden;
  border-radius: var(--eh-radius-xl);
  border: 1px solid var(--eh-border);
  background: #ffffff;
}

.eh-table {
  margin-bottom: 0;
}

.eh-table thead th {
  background: #f8fbff;
  color: var(--eh-muted);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--eh-border);
  padding: 0.85rem 1rem;
}

.eh-table tbody td {
  padding: 0.95rem 1rem;
  vertical-align: middle;
  border-color: var(--eh-border);
}

.eh-table tbody tr:hover {
  background: #f8fbff;
}

/* Forms */

.eh-form-control,
.form-control,
.form-select {
  border-color: var(--eh-border);
  border-radius: var(--eh-radius-md);
}

.eh-form-control:focus,
.form-control:focus,
.form-select:focus {
  border-color: #67e8f9;
  box-shadow: 0 0 0 0.2rem rgba(6, 182, 212, 0.15);
}

.eh-input-icon {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  border: 1px solid var(--eh-border);
  border-radius: var(--eh-radius-lg);
  background: #fbfdff;
  padding: 0.75rem 0.9rem;
}

.eh-input-icon input {
  border: none;
  background: transparent;
  outline: none;
  width: 100%;
}

/* Empty State */

.eh-empty {
  min-height: 320px;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 2rem;
}

.eh-empty-icon {
  width: 76px;
  height: 76px;
  border-radius: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--eh-soft-cyan);
  color: #0891b2;
  font-size: 2rem;
  margin-bottom: 1rem;
}

.eh-empty h3 {
  font-weight: 950;
  letter-spacing: -0.04em;
}

.eh-empty p {
  color: var(--eh-muted);
  max-width: 420px;
  margin-inline: auto;
}

/* ── Contextual help ──────────────────────────────────────── */
.help-tip {
  color: var(--eh-muted);
  font-size: 0.85em;
  margin-left: 0.25rem;
  cursor: help;
  transition: color 0.15s ease;
}
.help-tip:hover,
.help-tip:focus {
  color: var(--eh-primary);
  outline: none;
}
.help-hint {
  color: var(--eh-muted);
  font-size: 0.78rem;
}
.eh-help-btn {
  white-space: nowrap;
}
.eh-help-drawer {
  width: 420px;
  max-width: 90vw;
}
.eh-help-drawer .accordion-button {
  font-size: 0.92rem;
  padding: 0.6rem 0.75rem;
}
.eh-help-drawer .accordion-button:not(.collapsed) {
  color: var(--eh-primary);
  background: color-mix(in srgb, var(--eh-primary) 10%, #ffffff);
}
.eh-help-drawer .accordion-button:focus {
  box-shadow: none;
}
/* The popover content is plain text from the help registry */
.popover-body {
  font-size: 0.84rem;
}

/* ── Responsive tables → stacked cards on phones ──────────────
   Add class "eh-stack" to a .table-responsive wrapper and give each <td> a
   data-label="Column" so it reads as a labelled card row on small screens. */
@media (max-width: 767.98px) {
  .eh-stack > table { border: 0; }
  .eh-stack thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .eh-stack tbody, .eh-stack tr, .eh-stack td { display: block; width: 100%; }
  .eh-stack tr {
    margin-bottom: 0.85rem;
    padding: 0.4rem 0.9rem;
    border: 1px solid var(--eh-border);
    border-radius: 16px;
    background: #fff;
    box-shadow: var(--eh-shadow-soft);
  }
  .eh-stack td {
    display: flex; align-items: center; justify-content: space-between; gap: 1rem;
    padding: 0.4rem 0;
    border: 0;
    border-bottom: 1px solid #f1f5f9;
    text-align: right;
    white-space: normal;
  }
  .eh-stack td:last-child { border-bottom: 0; }
  .eh-stack td[data-label]::before {
    content: attr(data-label);
    flex: 0 0 auto;
    font-weight: 800; color: var(--eh-muted);
    text-transform: uppercase; letter-spacing: 0.03em; font-size: 0.68rem;
    text-align: left;
  }
  /* action cells: no label, let buttons wrap and fill the row */
  .eh-stack td.text-end, .eh-stack td.eh-actions { flex-wrap: wrap; justify-content: flex-end; }
  .eh-stack td.eh-actions::before { display: none; }
  /* empty-state rows shouldn't get the card treatment */
  .eh-stack td[colspan] { text-align: center; }
  .eh-stack td[colspan]::before { display: none; }
}

/* ── Help Center / manual ─────────────────────────────────── */
.eh-help-article ol li,
.eh-help-article ul li {
  margin-bottom: 0.4rem;
}
.eh-help-shot {
  width: 100%;
  border: 1px solid var(--eh-border);
  border-radius: var(--eh-radius-lg);
  box-shadow: var(--eh-shadow-soft);
}
