/* =========================================================
   Elimora Health — Design System
   Headings, page headers, stat cards, color utilities,
   badges, table states, plan cards, status pills, helpers
   ========================================================= */

/* ── Heading Scale ─────────────────────── */
h1, .h1 { font-size: 1.75rem; font-weight: 800; letter-spacing: -0.03em; line-height: 1.2; }
h2, .h2 { font-size: 1.5rem;  font-weight: 800; letter-spacing: -0.02em; line-height: 1.25; }
h3, .h3 { font-size: 1.25rem; font-weight: 700; letter-spacing: -0.01em; line-height: 1.3; }
h4, .h4 { font-size: 1.1rem;  font-weight: 700; letter-spacing: -0.01em; line-height: 1.35; }
h5, .h5 { font-size: 0.95rem; font-weight: 700; letter-spacing: 0;      line-height: 1.4; }
h6, .h6 { font-size: 0.85rem; font-weight: 700; letter-spacing: 0.02em; line-height: 1.4; text-transform: uppercase; }

/* ── Page Header ───────────────────────── */
.page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.page-header > div:first-child { flex: 1 1 auto; min-width: 0; }

.page-kicker {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--eh-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.35rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.page-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

@media (max-width: 767.98px) {
  .page-header { flex-direction: column; align-items: flex-start; }
  .page-actions { width: 100%; }
}

/* ── Stat Card ─────────────────────────── */
.stat-value {
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.2;
  color: var(--eh-text);
}

.stat-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--eh-muted);
  letter-spacing: 0.02em;
  margin-top: 0.2rem;
}

.stat-subtext {
  font-size: 0.75rem;
  color: var(--eh-soft-text);
  margin-top: 0.15rem;
}

.trend-up   { color: var(--eh-green); font-weight: 700; }
.trend-down { color: var(--eh-red);   font-weight: 700; }

/* ── Color Text Utilities ──────────────── */
.text-teal   { color: #0f9f8f !important; }
.text-slate  { color: #475569 !important; }
.text-blue   { color: var(--eh-blue) !important; }
.text-amber  { color: #d97706 !important; }
.text-green  { color: #16a34a !important; }
.text-purple { color: #7c3aed !important; }
.text-orange { color: #ea580c !important; }
.text-red    { color: #dc2626 !important; }
.text-pink   { color: #db2777 !important; }
.text-cyan   { color: #0891b2 !important; }

/* ── Color Background Utilities ────────── */
.bg-soft-primary { background: var(--eh-soft-blue) !important; color: var(--eh-blue) !important; }
.bg-soft-teal    { background: var(--eh-soft-teal) !important; color: #0f9f8f !important; }
.bg-soft-cyan    { background: var(--eh-soft-cyan) !important; color: #0891b2 !important; }
.bg-soft-green   { background: var(--eh-soft-green) !important; color: #16a34a !important; }
.bg-soft-purple  { background: var(--eh-soft-purple) !important; color: #7c3aed !important; }
.bg-soft-amber   { background: var(--eh-soft-amber) !important; color: #d97706 !important; }
.bg-soft-orange  { background: var(--eh-soft-orange) !important; color: #ea580c !important; }
.bg-soft-red     { background: var(--eh-soft-red) !important; color: #dc2626 !important; }
.bg-soft-pink    { background: var(--eh-soft-pink) !important; color: #db2777 !important; }
.bg-soft-slate   { background: var(--eh-soft-slate) !important; color: #475569 !important; }

/* ── App Divider ───────────────────────── */
.app-divider {
  border: 0;
  height: 1px;
  background: var(--eh-border);
  margin: 1.25rem 0;
}

/* ── Search Box ────────────────────────── */
.search-box {
  border-radius: var(--eh-radius-pill);
  border: 1px solid var(--eh-border);
  background: #fbfdff;
  padding: 0.6rem 1rem;
  font-size: 0.9rem;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.search-box:focus {
  border-color: #9bd8ff;
  box-shadow: 0 0 0 0.2rem rgba(6, 182, 212, 0.15);
  outline: none;
}

/* ── Soft Slate Button ─────────────────── */
.btn-soft-slate {
  background: var(--eh-soft-slate);
  color: #475569;
  border: 1px solid #dde4ed;
  font-weight: 700;
}

/* ── Medical Alert Badges ──────────────── */
.medical-alert {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border-radius: var(--eh-radius-pill);
  padding: 0.3rem 0.7rem;
  font-size: 0.75rem;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
}

.alert-blue { background: var(--eh-soft-blue); color: var(--eh-blue); }
.alert-red  { background: var(--eh-soft-red);  color: #dc2626; }

/* ── Table Row States ──────────────────── */
.table-row-danger  { background: #fef2f2 !important; }
.table-row-warning { background: #fffbeb !important; }

/* ── Queue Position Badge ──────────────── */
.queue-position {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 800;
  background: var(--eh-soft-blue);
  color: var(--eh-blue);
}

/* ── Plan Cards ────────────────────────── */
.plan-card {
  background: var(--eh-card);
  border: 1px solid var(--eh-border);
  border-radius: var(--eh-radius-2xl);
  box-shadow: var(--eh-shadow-soft);
  padding: 2rem;
  position: relative;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.plan-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--eh-shadow-card);
}

.plan-card-basic { border-top: 4px solid var(--eh-blue); }
.plan-card-pro   { border-top: 4px solid var(--eh-purple); }

.recommended-badge {
  position: absolute;
  top: -12px;
  right: 1.5rem;
  background: var(--eh-purple);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.3rem 0.8rem;
  border-radius: var(--eh-radius-pill);
}

/* ── Status Pills (missing variants) ───── */
.status-active,
.status-draft,
.status-open,
.status-closed,
.status-in_person,
.status-telehealth {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border-radius: var(--eh-radius-pill);
  padding: 0.3rem 0.7rem;
  font-size: 0.75rem;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
}

.status-active     { background: var(--eh-soft-green); color: #16a34a; }
.status-draft      { background: var(--eh-soft-slate); color: #475569; }
.status-open       { background: var(--eh-soft-blue);  color: var(--eh-blue); }
.status-closed     { background: var(--eh-soft-slate); color: #475569; }
.status-in_person  { background: var(--eh-soft-teal);  color: #0f9f8f; }
.status-telehealth { background: var(--eh-soft-purple); color: #7c3aed; }

/* ── Focus-Visible Accessibility ───────── */
:focus-visible {
  outline: 2px solid var(--eh-cyan);
  outline-offset: 2px;
}

button:focus-visible,
a:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--eh-cyan);
  outline-offset: 2px;
  border-radius: var(--eh-radius-sm);
}

/* ── Table Responsive Helpers ──────────── */
.table-responsive-card {
  border: 1px solid var(--eh-border);
  border-radius: var(--eh-radius-xl);
  background: var(--eh-card);
  overflow: hidden;
}

.table-responsive-card .table {
  margin-bottom: 0;
}

@media (max-width: 767.98px) {
  .table-responsive-card .table thead { display: none; }
  .table-responsive-card .table tbody tr {
    display: block;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--eh-border);
  }
  .table-responsive-card .table tbody tr:last-child { border-bottom: none; }
  .table-responsive-card .table tbody td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.35rem 0;
    border: none;
  }
  .table-responsive-card .table tbody td::before {
    content: attr(data-label);
    font-weight: 700;
    color: var(--eh-muted);
    font-size: 0.8rem;
  }
}
