/* ============================================================
   MXPracto Premium Component System v3
   Production-grade cards, buttons, inputs, badges.
   Used across all website + admin pages.
   Tokens sourced from tokens.css — the single source of truth.
   ============================================================ */
html, body {
  font-family: var(--mx-font-sans);
  color: var(--mx-ink);
  background: var(--mx-surface-alt, #FAFBFC);
  margin: 0;
  overflow-x: hidden;
  padding: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
*, *::before, *::after { box-sizing: border-box; }
img { max-width: 100%; }
a { color: inherit; }
/* ===== CARD SYSTEM ===== */
.mx-card-hover:hover {
  box-shadow: var(--mx-shadow-md);
  border-color: var(--mx-border);
}
/* ===== BUTTONS ===== */
.mx-btn-primary { background: var(--mx-primary); color: var(--mx-white); box-shadow: var(--mx-shadow-cta); }
.mx-btn-primary:hover { background: var(--mx-primary-dark); color: var(--mx-white); box-shadow: var(--mx-shadow-cta-hover); }
.mx-btn-primary:active { transform: translateY(0); }
.mx-btn-success { background: var(--mx-success-dark); color: var(--mx-white); }
.mx-btn-success:hover { background: color-mix(in srgb, var(--mx-success-dark) 85%, black); color: var(--mx-white); }
.mx-btn-ghost { background: var(--mx-surface); color: var(--mx-primary-dark); border-color: var(--mx-border); }
.mx-btn-ghost:hover { background: var(--mx-primary-surface); border-color: var(--mx-primary); color: var(--mx-primary-darker); }
.mx-btn:disabled, .mx-btn[disabled] { opacity: 0.5; cursor: not-allowed; transform: none !important; box-shadow: none !important; }
/* ===== INPUTS ===== */
.mx-input, select.mx-input {
  font-family: var(--mx-font-sans); font-size: 14px;
  background: var(--mx-surface); border: 1px solid var(--mx-border);
  border-radius: var(--mx-radius-sm); padding: 11px 14px;
  color: var(--mx-ink); width: 100%;
  transition: border-color 200ms ease, box-shadow 200ms ease;
  appearance: none;
}
.mx-input::placeholder { color: var(--mx-ink-muted); }
.mx-input:hover { border-color: var(--mx-border); }
.mx-label {
  font-family: var(--mx-font-sans); font-size: 13px; font-weight: 600;
  color: var(--mx-ink); margin-bottom: 8px; display: block;
}
/* ===== BADGES ===== */
.mx-badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-family: var(--mx-font-sans); font-size: var(--mx-text-xs); font-weight: 600;
  padding: 4px 10px; border-radius: var(--mx-radius-pill);
}
.mx-badge-success { background: var(--mx-success-surface); color: var(--mx-success-dark); }
.mx-badge-warning { background: var(--mx-warning-surface); color: var(--mx-warning-dark); }
.mx-badge-danger { background: var(--mx-danger-surface); color: var(--mx-danger-dark); }
.mx-badge-info { background: var(--mx-primary-surface); color: var(--mx-primary-dark); }
/* ===== TABLES ===== */
.mx-table { width: 100%; border-collapse: collapse; font-family: var(--mx-font-sans); }
.mx-table th {
  text-align: left; font-weight: 600; font-size: var(--mx-text-xs);
  text-transform: uppercase; letter-spacing: 0.04em;
  color: var(--mx-ink-muted); padding: 14px 16px;
  border-bottom: 2px solid var(--mx-border); background: var(--mx-surface-alt);
}
.mx-table td { padding: 16px; border-bottom: 1px solid var(--mx-border-light); color: var(--mx-ink); font-size: 14px; }
.mx-table tbody tr:last-child td { border-bottom: none; }
/* ===== STAT CARD (Admin dashboards) ===== */
.mx-stat-card {
  background: var(--mx-surface); border: 1px solid var(--mx-border-light);
  border-radius: 10px; box-shadow: var(--mx-shadow-widget);
  padding: 24px; display: flex; flex-direction: column; gap: 8px;
  transition: box-shadow 250ms ease, transform 250ms ease;
}
.mx-stat-card:hover { box-shadow: var(--mx-shadow-md); }
.mx-stat-label { font-family: var(--mx-font-sans); font-size: 13px; font-weight: 500; color: var(--mx-ink-muted); }
.mx-stat-value { font-family: var(--mx-font-sans); font-size: 32px; font-weight: 700; color: var(--mx-ink); line-height: 1.1; letter-spacing: -0.02em; }
/* ===== DOCTOR CARD (Premium — the signature component) ===== */
/* ===== TIME SLOT PILLS (Booking pages) ===== */
.mx-slot {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 8px 14px; min-width: 80px;
  background: var(--mx-surface); border: 1px solid var(--mx-border);
  border-radius: var(--mx-radius-sm); color: var(--mx-primary);
  font-size: 13px; font-weight: 600; text-decoration: none;
  transition: all 180ms cubic-bezier(0.4, 0, 0.2, 1);
}
.mx-slot:hover { background: var(--mx-primary); color: var(--mx-surface); border-color: var(--mx-primary); box-shadow: var(--mx-shadow-primary); }
.mx-slot.disabled, .mx-slot.booked { opacity: 0.4; pointer-events: none; text-decoration: line-through; }
/* ===== SECTION HEADERS ===== */
.mx-section-head {
  display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px;
}
main .mx-section-title {
  font-family: var(--mx-font-sans); font-size: var(--mx-title-xl); font-weight: 700;
  color: var(--mx-ink); margin: 0; line-height: 1.25; letter-spacing: -0.01em;
}
@media (max-width: 767px) {
  main .mx-section-title { font-size: 28px; }
}
.mx-link-arrow {
  display: inline-flex; align-items: center; gap: 4px;
  color: var(--mx-primary); font-size: 14px; font-weight: 600; text-decoration: none;
  transition: gap 200ms ease;
}
.mx-link-arrow:hover { gap: 8px; text-decoration: underline; }
/* ===== HERO SEARCH BAR ===== */
/* ===== FILTER SIDEBAR ===== */
/* ===== EMPTY STATE ===== */
.mx-empty-state { text-align: center; padding: 80px 20px; }
.mx-empty-state i { font-size: 48px; color: var(--mx-border); margin-bottom: 16px; display: block; }
.mx-empty-state p { color: var(--mx-ink-muted); font-size: 16px; margin: 0; }
/* ===== ACCESSIBILITY ===== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}
.mx-card a:focus-visible, .mx-btn:focus-visible, .mx-input:focus-visible,
.mx-table a:focus-visible, .mx-slot:focus-visible {
  outline: 2px solid var(--mx-primary); outline-offset: 2px; border-radius: 4px;
}
/* ===== UTILITY ===== */
.mx-container { max-width: 1140px; margin: 0 auto; padding: 0 20px; }
/* ===== USER DASHBOARD NAV (Sidebar) ===== */
.mx-nav-link {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 14px; border-radius: var(--mx-radius-sm);
  font-family: var(--mx-font-sans); font-size: 14px; font-weight: 500;
  color: var(--mx-ink-muted); text-decoration: none;
  transition: background 180ms ease, color 180ms ease;
}
.mx-nav-link i { width: 18px; text-align: center; font-size: 15px; }
.mx-nav-link:hover { background: var(--mx-surface-alt); color: var(--mx-ink); }
.mx-nav-active {
  background: var(--mx-primary-surface);
  color: var(--mx-primary-dark);
  font-weight: 600;
}
.mx-nav-active i { color: var(--mx-primary); }
/* ===== TABS (User dashboard) ===== */
.mx-tab {
  display: inline-block; padding: 14px 18px;
  font-family: var(--mx-font-sans); font-size: 14px; font-weight: 600;
  color: var(--mx-ink-muted); border: none; border-bottom: 2px solid transparent;
  background: transparent; cursor: pointer;
  transition: color 180ms ease, border-color 180ms ease;
}
.mx-tab:hover { color: var(--mx-ink); }
.mx-tab.active { color: var(--mx-primary); border-bottom-color: var(--mx-primary); }
/* ===== TABLE HELPERS ===== */
.mx-th { text-align: left; font-weight: 600; font-size: var(--mx-text-xs); text-transform: uppercase; letter-spacing: 0.04em; color: var(--mx-ink-muted); padding: 14px 16px; border-bottom: 2px solid var(--mx-border); background: var(--mx-surface-alt); }
.mx-td { padding: 14px 16px; border-bottom: 1px solid var(--mx-border-light); color: var(--mx-ink); font-size: 14px; }
/* ===== MODAL (User dashboard) ===== */
.mx-modal-card { background: var(--mx-surface); border-radius: var(--mx-radius-lg); box-shadow: var(--mx-shadow-lg); overflow: hidden; }
.mx-modal-header { display: flex; justify-content: space-between; align-items: center; padding: 20px 24px; border-bottom: 1px solid var(--mx-border-light); }
.mx-modal-title { font-family: var(--mx-font-sans); font-size: 18px; font-weight: 700; color: var(--mx-ink); margin: 0; }
.mx-modal-close { background: none; border: none; cursor: pointer; color: var(--mx-ink-muted); font-size: 20px; padding: 4px; transition: color 180ms ease; }
.mx-modal-close:hover { color: var(--mx-ink); }
.mx-modal-body { padding: 24px; }
.mx-modal-footer { display: flex; justify-content: flex-end; gap: 12px; padding: 16px 24px; border-top: 1px solid var(--mx-border-light); }
/* ============================================================
   MXPracto - Premium Micro-Interactions Layer (v3 polish)
   Add-on: hover lifts, press states, focus glows, badge pulse,
   shimmer skeleton, fade-in-up scroll reveal, table-row tint.
   Safe to append - additive only, no existing rules removed.
   ============================================================ */
/* ===== 1. CARD: HOVER LIFT + ACTIVE PRESS ===== */
.mx-card { transition: box-shadow 250ms cubic-bezier(0.4,0,0.2,1), transform 250ms cubic-bezier(0.4,0,0.2,1), border-color 250ms ease; }
.mx-card.mx-card-hover:hover {
  box-shadow: var(--mx-shadow-md);
  border-color: var(--mx-border);
}
.mx-card:active { transform: translateY(0) scale(0.99); transition-duration: 90ms; }
/* ===== 2. BUTTON: PRESS + FOCUS RING ===== */
.mx-btn { transition: background 200ms cubic-bezier(0.4,0,0.2,1), box-shadow 200ms cubic-bezier(0.4,0,0.2,1), transform 120ms cubic-bezier(0.4,0,0.2,1), filter 200ms ease; }
.mx-btn:active { transform: translateY(0) scale(0.97); transition-duration: 80ms; }
.mx-btn:focus-visible { outline: none; box-shadow: 0 0 0 2px var(--mx-surface), 0 0 0 4px var(--mx-primary); }
.mx-btn-success:active { transform: translateY(0) scale(0.97); }
.mx-btn-ghost:active { transform: translateY(0) scale(0.97); }
/* ===== 3. INPUT: SOFT FOCUS GLOW ===== */
.mx-input { transition: border-color 200ms ease, box-shadow 200ms ease, background 200ms ease; }
.mx-input:hover:not(:focus) { border-color: var(--mx-border); }
.mx-input:focus {
  border-color: var(--mx-primary);
  box-shadow: 0 0 0 4px var(--mx-primary-glow), inset 0 1px 2px var(--mx-primary-glow);
  outline: none;
}
.mx-input:focus-visible { outline: none; }
/* ===== 4. TABLE ROW: HOVER TINT ===== */
.mx-table tbody tr { transition: background 150ms ease, box-shadow 180ms ease; position: relative; }
.mx-table tbody tr:hover { background: var(--mx-primary-surface); }
.mx-table tbody tr:active { background: var(--mx-surface-alt); }
/* ===== 5. REDUCED MOTION ===== */
@media (prefers-reduced-motion: reduce) {
  .mx-card, .mx-btn, .mx-input, .mx-table tbody tr { transition-duration: 0.01ms !important; }
  .mx-card:hover, .mx-card:active,
  .mx-btn:hover, .mx-btn:active { transform: none !important; }
}
/* ===== ORDER TRACKING TIMELINE (patient web) ===== */
.mx-timeline { position: relative; list-style: none; margin: 0; padding: 4px 0 4px 8px; }
.mx-timeline::before {
  content: "";
  position: absolute;
  left: 23px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: var(--mx-border-light);
  border-radius: 2px;
}
.mx-timeline-item { position: relative; display: flex; gap: 16px; padding: 10px 0; align-items: flex-start; }
.mx-timeline-dot {
  flex: 0 0 40px;
  width: 40px; height: 40px;
  border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--mx-surface-alt);
  border: 2px solid var(--mx-border-light);
  color: var(--mx-ink-muted);
  font-size: 16px;
  z-index: 1;
  transition: all 200ms ease;
}
.mx-timeline-item.is-done .mx-timeline-dot {
  background: var(--mx-success-surface);
  border-color: var(--mx-success-dark);
  color: var(--mx-success-dark);
}
.mx-timeline-item.is-active .mx-timeline-dot {
  background: var(--mx-primary-surface);
  border-color: var(--mx-primary);
  color: var(--mx-primary-dark);
  box-shadow: 0 0 0 5px var(--mx-primary-surface);
}
.mx-timeline-body { flex: 1 1 auto; padding-top: 6px; min-width: 0; }
.mx-timeline-title { font-family: var(--mx-font-sans); font-weight: 700; font-size: 15px; color: var(--mx-ink); margin: 0 0 2px; }
.mx-timeline-item.is-active .mx-timeline-title { color: var(--mx-primary-dark); }
.mx-timeline-time { font-size: var(--mx-text-xs); color: var(--mx-ink-muted); margin: 0; }
.mx-timeline-note { font-size: 13px; color: var(--mx-ink-muted); margin: 4px 0 0; }
.mx-timeline-cancelled {
  margin-top: 18px;
  padding: 14px 16px;
  border-radius: var(--mx-radius-sm);
  background: var(--mx-danger-surface);
  border: 1px solid var(--mx-danger);
  color: var(--mx-danger-dark);
  font-size: 13px;
}
.mx-timeline-cancelled strong { display: block; margin-bottom: 4px; font-size: 14px; }
.mx-timeline-delivery {
  margin-top: 16px;
  padding: 14px 16px;
  border-radius: var(--mx-radius-sm);
  background: var(--mx-primary-surface);
  border: 1px solid var(--mx-border);
  font-size: 13px;
  color: var(--mx-ink);
}
.mx-timeline-delivery strong { color: var(--mx-primary-dark); }
.mx-status-pending { background: var(--mx-warning-surface); color: var(--mx-warning-dark); }
.mx-status-confirmed { background: var(--mx-primary-surface); color: var(--mx-primary-dark); }
.mx-status-processing { background: var(--mx-primary-surface); color: var(--mx-primary-dark); }
.mx-status-packed { background: var(--mx-primary-surface); color: var(--mx-primary-dark); }
.mx-status-shipped { background: var(--mx-primary-surface); color: var(--mx-primary-dark); }
.mx-status-delivered { background: var(--mx-success-surface); color: var(--mx-success-dark); }
.mx-status-cancelled { background: var(--mx-danger-surface); color: var(--mx-danger-dark); }
.mx-status-returned { background: var(--mx-danger-surface); color: var(--mx-danger-dark); }
/* ===== PHR HEALTH RECORDS (patient web) ===== */
.mx-phr-upload { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 640px) { .mx-phr-upload { grid-template-columns: 1fr; } }
.mx-phr-field { display: flex; flex-direction: column; gap: 6px; }
.mx-phr-field label { font-size: 13px; font-weight: 600; color: var(--mx-ink-muted); }
.mx-phr-filter { display: flex; flex-wrap: wrap; gap: 8px; }
.mx-phr-filter-btn {
  font-family: var(--mx-font-sans); font-size: 13px; font-weight: 600;
  padding: 8px 14px; border-radius: var(--mx-radius-pill);
  background: var(--mx-surface); color: var(--mx-ink-muted);
  border: 1px solid var(--mx-border-light); cursor: pointer;
  transition: all 180ms ease;
}
.mx-phr-filter-btn:hover { border-color: var(--mx-primary); color: var(--mx-primary-dark); }
.mx-phr-filter-btn.is-active {
  background: var(--mx-primary); color: var(--mx-surface); border-color: var(--mx-primary);
}
.mx-phr-day-header {
  font-family: var(--mx-font-sans); font-size: 13px; font-weight: 700;
  color: var(--mx-ink-muted); text-transform: uppercase; letter-spacing: 0.04em;
  margin: 22px 0 10px; padding-bottom: 8px; border-bottom: 1px solid var(--mx-border-light);
}
.mx-phr-row {
  display: flex; align-items: center; gap: 14px;
  padding: 14px; border-radius: var(--mx-radius-sm);
  border: 1px solid var(--mx-border-light); background: var(--mx-surface);
  margin-bottom: 10px; transition: box-shadow 200ms ease, border-color 200ms ease;
}
.mx-phr-row:hover { box-shadow: var(--mx-shadow-sm); border-color: var(--mx-border); }
.mx-phr-icon {
  flex: 0 0 44px; width: 44px; height: 44px; border-radius: 10px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 18px;
}
.mx-phr-icon-prescription { background: var(--mx-primary-surface); color: var(--mx-primary-dark); }
.mx-phr-icon-lab_report { background: var(--mx-warning-surface); color: var(--mx-warning-dark); }
.mx-phr-icon-imaging { background: var(--mx-border-light); color: var(--mx-primary-dark); }
.mx-phr-icon-bill { background: var(--mx-success-surface); color: var(--mx-success-dark); }
.mx-phr-icon-other { background: var(--mx-surface-alt); color: var(--mx-ink-muted); }
.mx-phr-meta { flex: 1 1 auto; min-width: 0; }
.mx-phr-title { font-family: var(--mx-font-sans); font-weight: 600; font-size: 15px; color: var(--mx-ink); margin: 0; }
.mx-phr-sub { font-size: var(--mx-text-xs); color: var(--mx-ink-muted); margin: 2px 0 0; }
.mx-phr-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.mx-phr-empty { text-align: center; padding: 40px 20px; color: var(--mx-ink-muted); font-size: 14px; }
/* ============================================================
   MXPracto Utility Shorthand Classes
   Restored after accidental CSS consolidation purge.
   Tokens sourced from tokens.css — single source of truth.
   ============================================================ */
/* ===== FONT-SIZE UTILITIES ===== */
.mx-text-xs { font-size: var(--mx-text-xs); }
.mx-text-sm { font-size: var(--mx-text-sm); }
.mx-text-base { font-size: var(--mx-text-base); }
.mx-text-lg { font-size: var(--mx-text-lg); }
.mx-text-xl { font-size: var(--mx-text-xl); }
.mx-text-2xl { font-size: var(--mx-text-2xl); }
/* ===== COLOR UTILITIES (PRIMARY) ===== */
.mx-primary { color: var(--mx-primary); }
.mx-primary-dark { color: var(--mx-primary-dark); }
.mx-primary-surface { background: var(--mx-primary-surface); }
/* ===== COLOR UTILITIES (SUCCESS) ===== */
.mx-success { color: var(--mx-success-dark); }
.mx-success-dark { color: var(--mx-success-dark); }
/* ===== TEXT-COLOR UTILITIES (INK) ===== */
.mx-ink { color: var(--mx-ink); }
.mx-ink-muted { color: var(--mx-ink-muted); }
.mx-ink-soft { color: var(--mx-ink-soft); }
/* ===== BACKGROUND UTILITIES ===== */
.mx-surface { background: var(--mx-surface); }
.mx-surface-alt { background: var(--mx-surface-alt); }
/* ===== BORDER UTILITIES ===== */
.mx-border { border: 1px solid var(--mx-border); }
.mx-border-light { border: 1px solid var(--mx-border-light); }
/* ===== BORDER-RADIUS UTILITIES ===== */
.mx-radius-sm { border-radius: var(--mx-radius-sm); }
.mx-radius { border-radius: var(--mx-radius); }
.mx-radius-pill { border-radius: var(--mx-radius-pill); }
/* ===== MISC UTILITIES ===== */
.mx-font-sans { font-family: var(--mx-font-sans); }
.mx-gray-100 { background: var(--mx-gray-100); }
.mx-gray-300 { color: var(--mx-gray-300); }
.mx-nav-hamburger-line { display:block; width:22px; height:2px; background:var(--mx-ink); border-radius:2px; margin:4px 0; transition:transform 200ms ease, opacity 200ms ease; }
/* ============================================================
   MXPracto Component Polish v2
   Appended - shared component refinements.
   ============================================================ */

/* ===== CARD BASE ===== */
.mx-card {
    background: var(--mx-surface);
    border: 1px solid var(--mx-gray-200);
    border-radius: 10px;
    box-shadow: var(--mx-shadow-soft);
    overflow: hidden;
    transition: box-shadow 250ms ease, border-color 250ms ease, transform 250ms ease;
}
.mx-card.mx-card-hover:hover {
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.07);
}

/* ===== BUTTONS ===== */
.mx-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-family: var(--mx-font-sans);
    font-size: 14px;
    font-weight: 600;
    padding: 10px 20px;
    border-radius: var(--mx-radius-btn);
    border: 1px solid transparent;
    cursor: pointer;
    text-decoration: none;
    line-height: 1.4;
    min-height: 44px;
    transition: background 150ms ease, box-shadow 150ms ease, transform 100ms ease, border-color 150ms ease;
}
.mx-btn:active { transform: translateY(0) scale(0.98); }

/* ===== TABLES ===== */
.mx-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}
.mx-table thead th {
    background: var(--mx-gray-50);
    color: var(--mx-gray-500);
    font-weight: 600;
    font-size: var(--mx-text-xs);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 12px 16px;
    border: none;
    border-bottom: 1px solid var(--mx-gray-200);
    white-space: nowrap;
}
.mx-table tbody td {
    padding: 13px 16px;
    border: none;
    border-bottom: 1px solid var(--mx-gray-100);
    color: var(--mx-ink-soft);
    font-size: 14px;
    vertical-align: middle;
}
.mx-table tbody tr { transition: background 120ms ease; }
.mx-table tbody tr:hover { background: var(--mx-gray-50); }
.mx-table tbody tr:last-child td { border-bottom: none; }

/* ===== STAT CARD ===== */
.mx-stat-card {
    background: var(--mx-surface);
    border: 1px solid var(--mx-gray-200);
    border-radius: var(--mx-radius-lg);
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    transition: box-shadow 250ms ease, transform 250ms ease;
}
.mx-stat-card:hover {
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.06);
}
.mx-stat-value {
    font-family: var(--mx-font-sans);
    font-size: 28px;
    font-weight: 700;
    color: var(--mx-ink);
    line-height: 1.15;
    letter-spacing: -0.02em;
}
.mx-stat-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--mx-gray-500);
}

/* ===== INPUTS ===== */
.mx-input {
    font-family: var(--mx-font-sans);
    font-size: 14px;
    background: var(--mx-surface);
    border: 1px solid var(--mx-gray-300);
    border-radius: var(--mx-radius);
    padding: 10px 14px;
    color: var(--mx-ink);
    width: 100%;
    transition: border-color 200ms ease, box-shadow 200ms ease;
    appearance: none;
    min-height: 40px;
}
.mx-input:focus {
    border-color: var(--mx-primary);
    box-shadow: 0 0 0 3px var(--mx-primary-glow);
    outline: none;
}

/* ===== BADGES ===== */
.mx-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-family: var(--mx-font-sans);
    font-size: var(--mx-text-xs);
    font-weight: 600;
    padding: 3px 10px;
    border-radius: var(--mx-radius-pill);
    letter-spacing: 0.01em;
}

/* ===== SECTION HEAD ===== */
.mx-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

/* ===== REDUCED MOTION ===== */
@media (prefers-reduced-motion: reduce) {
    .mx-card, .mx-btn, .mx-stat-card, .mx-input, .mx-table tbody tr {
        transition: none !important;
        animation: none !important;
        transform: none !important;
    }
}

/* ===== END Component Polish v2 ===== */

/* ============================================================
   14px BODY FLOOR ENFORCEMENT (DESIGN.md compliance)
   No text smaller than 13px anywhere in the UI.
   ============================================================ */
.mx-footer-appbadge-sm,
.mx-footer-appbadge,
.mx-feed-badge,
.mx-dcard-verified,
.mx-dcard-sponsored-badge,
.mx-auth-soon-badge,
.mxMedGrid-badge,
.mxPhd-open-badge,
.mx-ph-top-eyebrow,
.mx-filter-label,
.mx-dcard-exp-no,
.mx-demo-creds code {
  font-size: 13px !important;
}

/* Body text base — DESIGN.md mandates 14px */
body {
  font-size: 14px;
}

/* ============================================================
   SOLID BUTTON OVERRIDE (DESIGN.md compliance)
   "Solid primary blue bg... NO border, NO gradient."
   ============================================================ */
.mx-auth-btn,
.mx-primary,
.mx-btn-book,
.mx-hero-cta,
.mx-ic-cta,
.mx-sa-cta {
  background: var(--mx-primary) !important;
  background-image: none !important;
}
.mx-auth-btn:hover,
.mx-primary:hover,
.mx-btn-book:hover,
.mx-hero-cta:hover,
.mx-ic-cta:hover,
.mx-sa-cta:hover {
  background: var(--mx-primary-dark) !important;
  background-image: none !important;
  box-shadow: 0 2px 8px var(--mx-primary-glow) !important;
}

/* ===== W2B PATIENT SURFACE (dashboard shell polish — appended, non-destructive) ===== */
/* Modal chrome: bring TE/flowbite dialogs onto the W1 L3 ladder without touching ids/data-* */
[id="exampleModalCenter"] > div,
[id="purchased_medicine"] > div,
[id="cancel_reason"] > div,
[id="addReview"] > div,
[id="editReviewModal"] > div,
[id="editAddress"] > div,
[id="exampleModalScrollableLabel"] > div,
[id="orderTrackingModal"] > div,
[id="phrShareModal"] > div {
  border-radius: var(--mx-radius-xl);
  box-shadow: var(--mx-elevation-3);
}
[id="exampleModalCenter"] h5,
[id="purchased_medicine"] h5,
[id="cancel_reason"] h5,
[id="addReview"] h5,
[id="editReviewModal"] h5,
[id="editAddress"] h5,
[id="exampleModalScrollableLabel"] h5,
[id="orderTrackingModal"] h5,
[id="phrShareModal"] h5 {
  font-family: var(--mx-font-sans);
  font-weight: 700;
  color: var(--mx-ink);
  font-size: 18px;
}
/* Modal close buttons: quiet ghost squares with focus ring */
[id="exampleModalCenter"] button[data-modal-hide],
[id="purchased_medicine"] button[data-modal-hide],
[id="cancel_reason"] button[data-modal-hide],
[id="addReview"] button[data-modal-hide],
[id="editReviewModal"] button[data-modal-hide],
[id="editAddress"] button[data-modal-hide],
[id="exampleModalScrollableLabel"] button[data-modal-hide],
[id="orderTrackingModal"] button[data-modal-hide] {
  width: 36px; height: 36px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: var(--mx-radius);
  color: var(--mx-ink-muted);
  transition: background var(--mx-duration-fast) var(--mx-ease-standard), color var(--mx-duration-fast) var(--mx-ease-standard);
}
[id="exampleModalCenter"] button[data-modal-hide]:hover,
[id="purchased_medicine"] button[data-modal-hide]:hover,
[id="cancel_reason"] button[data-modal-hide]:hover,
[id="addReview"] button[data-modal-hide]:hover,
[id="editReviewModal"] button[data-modal-hide]:hover,
[id="editAddress"] button[data-modal-hide]:hover,
[id="exampleModalScrollableLabel"] button[data-modal-hide]:hover,
[id="orderTrackingModal"] button[data-modal-hide]:hover {
  background: var(--mx-surface-alt);
  color: var(--mx-ink);
}
/* Wallet: submit button full-width already via mx-btn-block; chip focus states */
.mx-wallet-chip:focus-visible { outline: 2px solid var(--mx-primary); outline-offset: 2px; }
/* Health vault share rows */
.mx-phr-share-row { display: flex; justify-content: space-between; align-items: center; padding: 10px 12px; background: var(--mx-surface-alt); border-radius: var(--mx-radius); }
/* Subscription add-form label rhythm */
.mx-sub-add-form .mx-field { display: flex; flex-direction: column; gap: 6px; }
@media (max-width: 640px) {
  .mx-sub-add-form { grid-template-columns: 1fr !important; }
}
/* Address modal map blocks */
[id="map"], [id="map2"] { border: 1px solid var(--mx-border); }

/* ===== PASS B PATIENT SURFACE — clinical data register + state completeness ===== */
/* S3: machine data (IDs, codes, timestamps on clinical records) set in mono/tabular face */
.mx-data {
  font-family: var(--mx-font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 13px;
  letter-spacing: 0;
}
/* S4: solid, low-saturation clinical status chips — medical-record register, not pastel marketing */
.mx-chip-clinical {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 5px;
  font-family: var(--mx-font-sans); font-size: var(--mx-text-xs); font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.05em; line-height: 1.2;
  border: 1px solid transparent;
}
.mx-chip-clinical::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.mx-chip-clinical-pending   { background: var(--mx-warning-dark); color: var(--mx-warning-surface); }
.mx-chip-clinical-completed { background: var(--mx-success-dark); color: var(--mx-success-surface); }
.mx-chip-clinical-cancelled { background: var(--mx-danger-dark);  color: var(--mx-danger-surface); }
.mx-chip-clinical-processing{ background: var(--mx-primary-darker); color: var(--mx-primary-surface); }
.mx-chip-clinical-neutral   { background: var(--mx-gray-600); color: var(--mx-gray-50); }
.mx-chip-clinical.no-dot::before { display: none; }
/* Record-type tag for health vault: quiet outline, mono, sentence case (a type is not a status) */
.mx-type-tag {
  display: inline-flex; align-items: center;
  font-family: var(--mx-font-mono); font-size: var(--mx-text-xs); font-weight: 600;
  color: var(--mx-gray-600); background: var(--mx-surface);
  border: 1px solid var(--mx-gray-300); border-radius: 4px;
  padding: 2px 7px; text-transform: none; letter-spacing: 0;
}
/* Clinical day header: mono tabular date, stronger rule */
.mx-dash-page .mx-phr-day-header {
  font-family: var(--mx-font-mono); font-size: var(--mx-text-xs); font-weight: 700;
  color: var(--mx-gray-600); letter-spacing: 0.02em;
  border-bottom: 2px solid var(--mx-gray-200);
}
.mx-dash-page .mx-phr-title { font-size: 15px; }
.mx-dash-page .mx-phr-sub { font-size: var(--mx-text-xs); }
/* Report table: mono for report ids/dates, tighter clinical rows */
.mx-dash-page .mx-table .mx-data { white-space: nowrap; }
/* Timestamps floor (chat, notifications, tx dates): 13px floor (v21_fixC,
   raised from 12px so AA contrast & legibility hold; 13px matches the
   brand-wide --mx-text-xs token used elsewhere). */
.mx-chat-time { font-size: var(--mx-text-xs) !important; }
.mx-nt-meta time { font-size: 13px; }
.mx-tx-date { font-size: 13px !important; }
/* Loading skeletons that resemble eventual content (list-row shaped) */
.mx-skel { position: relative; overflow: hidden; background: var(--mx-gray-100); border-radius: var(--mx-radius); }
.mx-skel::after {
  content: ''; position: absolute; inset: 0;
  background: var(--mx-surface);
  opacity: 0.5;
  transform: translateX(-100%);
  animation: mx-skel-sweep 1.4s ease infinite;
}
@keyframes mx-skel-sweep { 100% { transform: translateX(100%); } }
@media (prefers-reduced-motion: reduce) { .mx-skel::after { animation: none; } }
.mx-skel-row { display: flex; align-items: center; gap: 14px; padding: 16px; border: 1px solid var(--mx-border-light); border-radius: var(--mx-radius); margin-bottom: 10px; background: var(--mx-surface); }
.mx-skel-icon { width: 44px; height: 44px; border-radius: 10px; flex: 0 0 44px; }
.mx-skel-lines { flex: 1; display: flex; flex-direction: column; gap: 8px; }
.mx-skel-line { height: 12px; border-radius: 6px; }
.mx-skel-line.w60 { width: 60%; } .mx-skel-line.w40 { width: 40%; } .mx-skel-line.w80 { width: 80%; }
/* Empty states: shared architecture, tighter padding inside cards */
.mx-dash-page .mx-empty-state { padding: 56px 20px; }
.mx-empty-state .mx-empty-title { font-size: 16px; font-weight: 700; color: var(--mx-ink); margin: 0; }
.mx-empty-state .mx-empty-text { font-size: 14px; color: var(--mx-ink-muted); margin: 6px 0 0; }
/* Vault/document action labels: text beside icon on desktop, icon-only >=40px target on mobile */
.mx-phr-action-label { font-size: 13px; }
@media (max-width: 640px) {
  .mx-phr-actions .mx-btn { min-height: 40px; min-width: 40px; }
  .mx-phr-action-label { display: none; }
}
/* Favorite bookmark: >=40px hit area + visible focus (screen-reader name comes from aria-label) */
.mx-dcard-fav { width: 40px; height: 40px; }
.mx-dcard-fav:focus-visible { outline: 2px solid var(--mx-primary); outline-offset: 2px; border-radius: 8px; }

/* ============================================================
   V2.1 CORE HARMONY LAYER (2026-09-06, Doccure V2.1 pivot)
   Additive-only overrides that restate the shared component anatomy
   AFTER the older duplicated blocks above in this file, so the final
   cascade on every shell (public / auth / admin — this file loads on
   all three) matches the reference-measured button/input/badge/table
   contract in ui_mx.css. Zero new raw hex — all values via tokens.
   ESCALATION NOTE: user_dashboard_mx.css (dashboard shell, loads after
   this sheet on mainlayout pages) re-asserts an older .mx-btn anatomy
   (14px/600, 8px radius, 135deg blue gradient). Composite-class
   selectors out-specify those single-class rules without touching the
   dashboard sheet — the same sanctioned approach listing_mx.css uses
   for .mx-btn-book (see its L9620 comment).
   ============================================================ */
/* Buttons: reference anatomy wins over the v1 flat rules at L27-31. */
.mx-btn { font-size: var(--mx-btn-font-size); font-weight: var(--mx-btn-font-weight); }
.mx-btn.mx-btn { border-radius: var(--mx-radius-btn); font-size: var(--mx-btn-font-size); font-weight: var(--mx-btn-font-weight); }
button.mx-btn-primary, a.mx-btn-primary, .mx-btn-primary.mx-btn { background: var(--mx-primary); color: var(--mx-white); box-shadow: var(--mx-shadow-cta); }
button.mx-btn-primary:hover, a.mx-btn-primary:hover, .mx-btn-primary.mx-btn:hover { background: var(--mx-primary-dark); color: var(--mx-white); box-shadow: var(--mx-shadow-cta-hover); }
.mx-btn-primary:active { transform: translateY(0); }
/* v1 defined .mx-btn-ghost as a bordered light button; v2.1 aligns it to
   the DESIGN.md ghost contract (transparent, primary-darker text). */
button.mx-btn-ghost, a.mx-btn-ghost, .mx-btn-ghost.mx-btn { background: transparent; color: var(--mx-primary-darker); border-color: transparent; }
button.mx-btn-ghost:hover, a.mx-btn-ghost:hover, .mx-btn-ghost.mx-btn:hover { background: var(--mx-primary-surface); border-color: transparent; color: var(--mx-primary-darker); }
/* Secondary: composite specificity beats user_dashboard's older single-class. */
button.mx-btn-secondary, a.mx-btn-secondary, .mx-btn-secondary.mx-btn { background: var(--mx-surface); color: var(--mx-ink); border: 1px solid var(--mx-border); border-radius: var(--mx-radius-btn); }
button.mx-btn-secondary:hover, a.mx-btn-secondary:hover, .mx-btn-secondary.mx-btn:hover { background: var(--mx-surface-hover); border-color: var(--mx-gray-300); color: var(--mx-ink-deep); }
/* Size steps: composite beats user_dashboard .mx-btn-sm !important-free rules. */
button.mx-btn.mx-btn-sm, .mx-btn.mx-btn-sm { min-height: 32px; padding: 6px 14px; font-size: var(--mx-text-sm); border-radius: var(--mx-radius-btn); }
button.mx-btn.mx-btn-lg, .mx-btn.mx-btn-lg { min-height: 48px; padding: 12px 26px; font-size: var(--mx-text-lg); }
/* user_dashboard_mx.css pins .mx-btn-sm radius to 6px with !important and
   flattens sm+primary to solid brand. Matching escalation, narrowest form
   (same sanctioned pattern as listing_mx.css .mx-btn-book overrides). */
button.mx-btn.mx-btn-sm, .mx-btn.mx-btn-sm { border-radius: var(--mx-radius-btn) !important; }
button.mx-btn-primary.mx-btn-sm, .mx-btn-primary.mx-btn-sm { background: var(--mx-primary); color: var(--mx-white); border-color: transparent; box-shadow: var(--mx-shadow-cta); }
/* Inputs: 40px floor + reference padding/radius/border via tokens.
   (border reasserted — the v2 block mid-file sets gray-300 which is
   one step darker than the reference #E2E8F0 = --mx-border). */
.mx-input, select.mx-input {
  border-radius: var(--mx-radius-input);
  padding: var(--mx-input-pad-y) var(--mx-input-pad-x);
  min-height: var(--mx-input-height);
  border: 1px solid var(--mx-border);
}
.mx-input:hover { border-color: var(--mx-gray-300); }
/* Badges: pill + 13px/600 floor (v21_fixC raised from 12px to 13px for
   brand-wide font floor parity; dot architecture stays — ui_mx owns
   the semantic map; this only re-asserts geometry after v1 re-sets it). */
.mx-badge {
  font-size: var(--mx-text-xs);
  font-weight: var(--mx-font-weight-semibold);
  padding: 3px 10px;
  border-radius: var(--mx-radius-badge);
}
/* Tabs: v1 .mx-tab at L146-153 loses to this underline anatomy. */
.mx-tab {
  display: inline-flex; align-items: center;
  padding: 12px 16px;
  font-size: var(--mx-text-base);
  font-weight: var(--mx-font-weight-medium);
  color: var(--mx-ink-muted);
  border: none;
  border-bottom: var(--mx-tab-underline) solid transparent;
  background: transparent;
  cursor: pointer;
}
.mx-tab:hover { color: var(--mx-ink); }
.mx-tab.active { color: var(--mx-primary-darker); border-bottom-color: var(--mx-primary); font-weight: var(--mx-font-weight-semibold); }
/* Size steps re-asserted (the v1 blocks above set 6px 12px / radius-sm). */
.mx-btn-sm { min-height: 32px; padding: 6px 14px; font-size: var(--mx-text-sm); border-radius: var(--mx-radius-btn); }
.mx-btn-lg { min-height: 48px; padding: 12px 26px; font-size: var(--mx-text-lg); }
/* Secondary re-asserted after this file's v1 ghost-as-bordered block. */
.mx-btn-secondary { background: var(--mx-surface); color: var(--mx-ink); border: 1px solid var(--mx-border); }
.mx-btn-secondary:hover { background: var(--mx-surface-hover); border-color: var(--mx-gray-300); color: var(--mx-ink-deep); }
/* Inputs: composite specificity vs user_dashboard's v2 block. */
input.mx-input, select.mx-input, .mx-input.mx-input {
  border-radius: var(--mx-radius-input);
  padding: var(--mx-input-pad-y) var(--mx-input-pad-x);
  min-height: var(--mx-input-height);
  border: 1px solid var(--mx-border);
}
input.mx-input:hover, select.mx-input:hover { border-color: var(--mx-gray-300); }
input.mx-input:focus, select.mx-input:focus, .mx-input.mx-input:focus {
  border-color: var(--mx-primary);
  box-shadow: var(--mx-shadow-focus);
  outline: none;
}
/* Tabs: composite vs any later single-class re-assertion. */
a.mx-tab, button.mx-tab, .mx-tab.mx-tab { font-size: var(--mx-text-base); font-weight: var(--mx-font-weight-medium); color: var(--mx-ink-muted); border-bottom: var(--mx-tab-underline) solid transparent; }
a.mx-tab.active, button.mx-tab.active, .mx-tab.mx-tab.active { color: var(--mx-primary-darker); border-bottom-color: var(--mx-primary); font-weight: var(--mx-font-weight-semibold); }
/* Table header: quiet uppercase band, no 2px rule (ref uses 1px). */
.mx-table th { border-bottom: 1px solid var(--mx-border); background: var(--mx-surface-alt); }
/* Empty state: icon tile + calm copy consistent with ui_mx 6b. */
.mx-empty-state { text-align: center; padding: var(--mx-space-16) var(--mx-space-6); }
.mx-empty-state i { font-size: 42px; color: var(--mx-empty-icon); margin-bottom: var(--mx-space-4); display: block; }
.mx-empty-state .mx-empty-title { font-size: var(--mx-text-lg); font-weight: var(--mx-font-weight-semibold); color: var(--mx-ink); }
.mx-empty-state p, .mx-empty-state .mx-empty-text { color: var(--mx-ink-muted); font-size: var(--mx-text-base); }
/* Reduced motion: guard every V2.1 addition in this file. */
@media (prefers-reduced-motion: reduce) {
  .mx-chip, .mx-tab, .mx-pagination .page-link, .mx-btn { transition-duration: 0.01ms !important; }
}

