/* ============================================================
   Verum Health RX — Portal Design System
   Brand: Navy #051a43 | Gold #D4AF37 | White #fff
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --navy:   #051a43;
  --navy-light: #0a2a6a;
  --gold:   #D4AF37;
  --gold-light: #e8c94a;
  --white:  #fff;
  --border: #e8ecf0;
  --text:   #1e293b;
  --muted:  #64748b;
  --bg:     #f8fafc;
  --danger: #ef4444;
  --success:#10b981;
  --sidebar-w: 240px;
  --radius: 8px;
  --shadow: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
  --shadow-md: 0 4px 6px rgba(0,0,0,.07), 0 2px 4px rgba(0,0,0,.06);
}

html, body { height: 100%; font-family: 'Inter', sans-serif; color: var(--text); background: var(--bg); display: flex; flex-direction: column; overflow-x: hidden; }
* { box-sizing: border-box; min-width: 0; } /* Prevents flex children from overflowing on narrow viewports */

/* ── LAYOUT ── */
.app-shell { display: flex; flex: 1; overflow: hidden; }

/* ── SIDEBAR ── */
.sidebar {
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  background: var(--navy);
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow-y: auto;
  z-index: 100;
  transition: transform 0.25s ease;
}

/* sidebar-logo removed — topbar handles branding */
.sidebar-logo { display: none; }

.sidebar-nav { flex: 1; padding: 16px 0; }

.nav-section-label {
  color: rgba(255,255,255,0.35);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  padding: 12px 20px 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  color: rgba(255,255,255,0.72);
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  border-left: 3px solid transparent;
  transition: all 0.15s ease;
  text-decoration: none;
  user-select: none;
}
.nav-item:hover { background: rgba(255,255,255,0.06); color: var(--white); }
.nav-item.active {
  background: rgba(212,175,55,0.12);
  color: var(--gold);
  border-left-color: var(--gold);
}
.nav-item svg { flex-shrink: 0; opacity: 0.8; }
.nav-item.active svg { opacity: 1; }

.sidebar-footer {
  border-top: 1px solid rgba(255,255,255,0.08);
  padding: 16px 20px;
}
.sidebar-user { margin-bottom: 12px; }
.sidebar-user-name { color: var(--white); font-size: 13px; font-weight: 600; }
.sidebar-user-email { color: rgba(255,255,255,0.45); font-size: 11.5px; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-user-role {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: var(--radius);
  color: rgba(255,255,255,0.7);
  font-size: 12.5px;
  font-weight: 500;
  padding: 8px 14px;
  margin-top: 8px;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s;
  box-sizing: border-box;
}
.sidebar-user-role:hover {
  background: rgba(212,175,55,0.15);
  border-color: rgba(212,175,55,0.3);
  color: var(--gold);
}

.btn-logout {
  width: 100%;
  padding: 8px 14px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: var(--radius);
  color: rgba(255,255,255,0.7);
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.15s;
  font-family: inherit;
}
.btn-logout:hover { background: rgba(239,68,68,0.15); border-color: rgba(239,68,68,0.4); color: #fca5a5; }

/* ── MAIN CONTENT ── */
.main-content { flex: 1; display: flex; flex-direction: column; overflow: hidden; min-width: 0; }

.topbar {
  background: #051a43;
  border-bottom: 1px solid rgba(212,175,55,.2);
  padding: 0 40px;
  height: 112px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 200;
  /* Span full width — sidebar does NOT overlap topbar */
  width: 100%;
  box-sizing: border-box;
}
.topbar-title { font-size: 16px; font-weight: 600; color: #fff; }
.topbar-right { display: flex; align-items: center; gap: 14px; flex-shrink: 0; }
.topbar-nav-links {
  display: flex;
  align-items: center;
  gap: 24px;
}
.topbar-nav-links a {
  color: rgba(255,255,255,.7);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  transition: color .2s;
  white-space: nowrap;
}
.topbar-nav-links a:hover { color: #D4AF37; }
.topbar-username {
  color: rgba(255,255,255,.65);
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}
.topbar-signout {
  background: none;
  border: 1px solid rgba(212,175,55,.4);
  color: #D4AF37;
  border-radius: 50px;
  padding: 5px 14px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: all .2s;
  white-space: nowrap;
}
.topbar-signout:hover { background: rgba(212,175,55,.1); }
.topbar-hamburger { display: none; }

.hamburger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  color: #fff;
}

.page-body { flex: 1; overflow-y: auto; padding: 32px; }

/* ── SECTIONS ── */
.section { display: none; }
.section.active { display: block; }

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 12px;
}
.section-title { font-size: 20px; font-weight: 700; color: var(--text); }
.section-header-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ── BUTTONS ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  font-size: 13.5px;
  font-weight: 600;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s ease;
  text-decoration: none;
  white-space: nowrap;
}
.btn-primary { background: var(--navy); color: var(--gold); }
.btn-primary:hover { background: var(--navy-light); }
.btn-secondary { background: var(--white); color: var(--navy); border: 1.5px solid var(--navy); }
.btn-secondary:hover { background: var(--bg); }
.btn-gold { background: var(--gold); color: var(--navy); }
.btn-gold:hover { background: var(--gold-light); }
.btn-danger { background: var(--danger); color: var(--white); }
.btn-danger:hover { background: #dc2626; }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-icon { padding: 6px; background: none; border: none; cursor: pointer; color: var(--muted); border-radius: 6px; font-family: inherit; transition: all 0.15s; font-size: 1.5em; line-height: 1; }
.btn-icon:hover { background: var(--bg); color: var(--text); }
.btn-icon.danger:hover { background: #fee2e2; color: var(--danger); }

/* ── TABS ── */
.tabs { display: flex; border-bottom: 2px solid var(--border); margin-bottom: 28px; gap: 0; }
.tab {
  padding: 10px 20px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all 0.15s;
  user-select: none;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--navy); border-bottom-color: var(--gold); }

/* ── CARDS ── */
.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow);
}
.card-body { padding: 28px; }

/* ── STEP INDICATOR ── */
.step-indicator {
  display: flex;
  align-items: center;
  margin-bottom: 32px;
}
.step {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  position: relative;
}
.step:not(:last-child)::after {
  content: '';
  position: absolute;
  top: 18px;
  left: 60%;
  right: 0;
  width: 80%;
  height: 2px;
  background: var(--border);
  z-index: 0;
}
.step.done:not(:last-child)::after,
.step.active:not(:last-child)::after { background: var(--gold); }
.step-circle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--border);
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  z-index: 1;
  transition: all 0.2s;
}
.step.active .step-circle { background: var(--gold); color: var(--navy); }
.step.done .step-circle { background: var(--navy); color: var(--white); }
.step-label { font-size: 11px; font-weight: 600; color: var(--muted); margin-top: 6px; text-align: center; }
.step.active .step-label { color: var(--navy); }
.step.done .step-label { color: var(--navy); }

/* ── FORM ── */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 20px; }
.form-grid .full { grid-column: 1 / -1; }
.form-group { display: flex; flex-direction: column; gap: 5px; }
label { font-size: 13px; font-weight: 600; color: var(--text); }
label .req { color: var(--danger); margin-left: 2px; }

input[type="text"], input[type="email"], input[type="tel"],
input[type="date"], input[type="number"], input[type="password"],
select, textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: 13.5px;
  font-family: inherit;
  color: var(--text);
  background: var(--white);
  transition: border-color 0.15s;
  outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--gold); }
textarea { resize: vertical; min-height: 80px; }
select { cursor: pointer; }
input::placeholder, textarea::placeholder { color: #767676; } /* WCAG AA minimum contrast 4.54:1 on white */

/* search input with icon */
.search-wrap { position: relative; }
.search-wrap input { padding-left: 36px; }
.search-wrap .search-icon { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }

/* ── TAG INPUT ── */
.tag-input-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 7px 10px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  background: var(--white);
  min-height: 42px;
  align-items: center;
  cursor: text;
  transition: border-color 0.15s;
}
.tag-input-wrap:focus-within { border-color: var(--gold); }
.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(5,26,67,0.08);
  color: var(--navy);
  font-size: 12px;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: 20px;
}
.tag-remove { background: none; border: none; cursor: pointer; color: var(--muted); font-size: 14px; line-height: 1; padding: 0; font-family: inherit; display: flex; align-items: center; }
.tag-remove:hover { color: var(--danger); }
.tag-input {
  border: none !important;
  outline: none !important;
  flex: 1;
  min-width: 120px;
  padding: 0 !important;
  font-size: 13.5px;
  font-family: inherit;
  background: transparent;
}

/* ── MEDICATION SEARCH ── */
.med-search-wrap { position: relative; }
.med-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  max-height: 220px;
  overflow-y: auto;
  z-index: 200;
  display: none;
}
.med-dropdown.open { display: block; }
.med-option {
  padding: 9px 14px;
  font-size: 13.5px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.med-option:hover { background: var(--bg); }
.med-option .price { color: var(--muted); font-size: 12px; }
.med-selected {
  display: none;
  align-items: center;
  justify-content: space-between;
  padding: 9px 12px;
  border: 1.5px solid var(--gold);
  border-radius: var(--radius);
  background: rgba(212,175,55,0.06);
}
.med-selected.show { display: flex; }
.med-selected-name { font-weight: 600; color: var(--navy); font-size: 13.5px; }
.med-selected-price { color: var(--muted); font-size: 12px; }

/* ── PAYMENT ── */
.payment-options { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.payment-card {
  flex: 1;
  min-width: 120px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  cursor: pointer;
  text-align: center;
  transition: all 0.15s;
  user-select: none;
}
.payment-card:hover { border-color: var(--navy); }
.payment-card.selected { border-color: var(--gold); background: rgba(212,175,55,0.06); }
.payment-card input[type="radio"] { display: none; }
.payment-card-label { font-size: 13px; font-weight: 600; color: var(--text); margin-top: 6px; }
.payment-card-icon { font-size: 22px; }

/* .cc-fields removed — unused */

/* ── TABLES ── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
thead th {
  background: var(--bg);
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
tbody td { padding: 13px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: var(--bg); }

.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11.5px;
  font-weight: 600;
}
.badge-success { background: #d1fae5; color: #065f46; }
.badge-pending { background: #fef3c7; color: #92400e; }
.badge-danger  { background: #fee2e2; color: #991b1b; }
/* .badge-blue removed — unused */

/* Status dot */
.status-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  display: inline-block;
  cursor: pointer;
}
.status-dot.on  { background: var(--success); }
.status-dot.off { background: #cbd5e1; }

/* Checkbox */
input[type="checkbox"] { width: 15px; height: 15px; cursor: pointer; accent-color: var(--navy); }

/* action row */
.action-row { display: flex; gap: 4px; align-items: center; }

/* ── FILTERS ROW ── */
.filters-row {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.filters-row select, .filters-row input { flex: 1; min-width: 140px; max-width: 200px; }
.filters-row .search-wrap { flex: 2; min-width: 200px; }
/* Search inputs live inside .search-wrap and should fill it, not be capped at 200px like dropdowns/other inputs */
.filters-row .search-wrap input { max-width: none; width: 100%; }
.count-badge {
  margin-left: auto;
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}

/* ── MODALS ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--white);
  border-radius: 14px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 28px 18px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--white);
  z-index: 2;
}
.modal-title { font-size: 16px; font-weight: 700; color: var(--text); }
.modal-close { background: none; border: none; cursor: pointer; color: var(--muted); font-size: 22px; line-height: 1; font-family: inherit; padding: 2px 6px; border-radius: 6px; }
.modal-close:hover { background: var(--bg); }
.modal-body { padding: 24px 28px; }
.modal-footer { padding: 16px 28px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 10px; }

/* ── STEP NAV BUTTONS ── */
.step-nav { display: flex; justify-content: space-between; margin-top: 28px; }

/* ── SUCCESS CARD ── */
.success-card {
  text-align: center;
  padding: 48px 32px;
}
.success-icon { font-size: 56px; margin-bottom: 16px; }
.success-title { font-size: 22px; font-weight: 700; color: var(--text); margin-bottom: 8px; }
.success-msg { color: var(--muted); font-size: 14px; max-width: 400px; margin: 0 auto 24px; line-height: 1.6; }

/* ── EMPTY STATE ── */
.empty-state { text-align: center; padding: 60px 20px; color: var(--muted); }
/* .empty-state-icon removed — unused */
.empty-state-text { font-size: 14px; }

/* ── SIDEBAR OVERLAY (mobile) ── */
.sidebar-overlay { display: none; }

/* ── TOAST ── */
#toast {
  position: fixed;
  bottom: 120px;
  right: 24px;
  background: var(--navy);
  color: var(--white);
  padding: 12px 20px;
  border-radius: var(--radius);
  font-size: 13.5px;
  font-weight: 500;
  z-index: 9999;
  box-shadow: var(--shadow-md);
  transform: translateY(80px);
  opacity: 0;
  transition: all 0.3s ease;
}
#toast.show { transform: translateY(0); opacity: 1; }
#toast.success { background: #065f46; }
#toast.error   { background: #991b1b; }

/* ── LOGIN PAGE ── */
.login-page {
  min-height: 100vh;
  background: #eae6de;
  background-image:
    radial-gradient(ellipse at 15% 50%, rgba(212,175,55,0.12) 0%, transparent 55%),
    radial-gradient(ellipse at 85% 20%, rgba(5,26,67,0.08) 0%, transparent 55%),
    url("data:image/svg+xml,%3Csvg width='80' height='80' viewBox='0 0 80 80' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%23c8b98a' fill-opacity='0.15' fill-rule='evenodd'%3E%3Ccircle cx='40' cy='40' r='1.5'/%3E%3C/g%3E%3C/svg%3E");
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.login-card {
  background: var(--navy);
  border-radius: 20px;
  padding: 48px 44px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 32px 80px rgba(5,26,67,0.25), 0 0 0 1px rgba(212,175,55,0.15);
  position: relative;
  overflow: hidden;
}
.login-card::before {
  content: '';
  position: absolute;
  top: -60px; right: -60px;
  width: 200px; height: 200px;
  background: radial-gradient(circle, rgba(212,175,55,0.08) 0%, transparent 70%);
  pointer-events: none;
}
.login-logo { text-align: center; margin-bottom: 32px; }
.login-logo img { height: 78px; filter: none; }
.login-logo .rx-badge {
  display: inline-block;
  background: rgba(212,175,55,0.15);
  color: var(--gold);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 20px;
  margin-top: 8px;
  border: 1px solid rgba(212,175,55,0.3);
}
.login-title { font-size: clamp(1.6rem, 4vw, 36px); font-weight: 400; color: #ffffff; margin-bottom: 10px; font-family: 'Georgia', 'Times New Roman', serif; line-height: 1.15; letter-spacing: -.2px; }
.login-title em { color: #D4AF37; font-style: italic; }
.login-sub { font-size: 15px; color: #D4AF37; margin-bottom: 28px; font-family: Georgia, 'Times New Roman', serif; font-style: italic; line-height: 1.65; }
.login-error { background: rgba(239,68,68,0.15); color: #fca5a5; border: 1px solid rgba(239,68,68,0.3); font-size: 13px; padding: 10px 14px; border-radius: var(--radius); margin-bottom: 14px; display: none; }
.login-error.show { display: block; }
/* Input labels on dark card */
.login-card label { color: rgba(255,255,255,0.65); font-size: 11px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; font-family: 'Inter', sans-serif; }
.login-card input[type="email"],
.login-card input[type="password"] {
  background: #ffffff !important;
  border: 1.5px solid rgba(255,255,255,0.4) !important;
  color: #1a1a2e !important;
  border-radius: 50px !important;
  padding: 12px 18px !important;
  font-size: 14px;
  width: 100%;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
  font-family: inherit;
  -webkit-appearance: none;
}
.login-card input[type="email"]::placeholder,
.login-card input[type="password"]::placeholder { color: #767676; } /* WCAG AA 4.54:1 */
.login-card input[type="email"]:focus,
.login-card input[type="password"]:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(212,175,55,0.2);
}
.btn-login {
  width: 100%;
  padding: 13px;
  background: var(--gold);
  color: var(--navy);
  border: none;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  font-family: inherit;
  letter-spacing: 0.3px;
  transition: background 0.15s, transform .1s;
  margin-top: 4px;
}
.btn-login:hover { background: #e8c94a; transform: translateY(-1px); }
.btn-login:active { transform: translateY(0); }
.btn-login:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }
.login-footer { text-align: center; margin-top: 20px; color: rgba(255,255,255,0.3); font-size: 12px; }

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
  .topbar-nav-links { display: none; }
  .topbar-username { display: none; }
  .sidebar {
    position: fixed;
    left: 0; top: 112px; bottom: 0;
    height: calc(100vh - 112px);
    height: calc(100dvh - 112px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: env(safe-area-inset-bottom, 0px);
    transform: translateX(-100%);
    z-index: 150;
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar-overlay {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 99;
    display: none;
  }
  .sidebar-overlay.open { display: block; }
  .hamburger { display: flex; }
  .topbar-signout { display: none; }
  .page-body { padding: 20px; }
  .topbar { padding: 0 20px; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .full { grid-column: 1; }
  /* .cc-fields media query removed — class unused */
  .login-card { padding: 36px 28px; }
  .step-indicator { gap: 4px; }
  .step-label { display: none; }
  .section-header { flex-direction: column; align-items: flex-start; }
}

/* ── STAT CARDS ─────────────────────────────────────── */
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 18px 20px;
}
.stat-label { font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; margin-bottom: 6px; }
.stat-value { font-size: 28px; font-weight: 800; color: var(--gold); line-height: 1.1; overflow-wrap: anywhere; }
.stat-sub   { font-size: 11px; color: var(--muted); margin-top: 4px; }

/* Bug fix (2026-07-21, Shannel): Reports page stat-card row (Total Prescriptions /
   Total Order History / Total Open Orders / Most Prescribed) was hardcoded to a
   4-column grid at every viewport width. On mobile this crushed each card so
   narrow that large dollar-figure text (.stat-value, 28px) visually overlapped
   into the neighboring card. Reduce to 2 columns below 700px and 1 column below
   420px, plus shrink number size so it always fits its own card. */
@media (max-width: 700px) {
  .stat-value { font-size: 22px; }
}
@media (max-width: 420px) {
  .stat-value { font-size: 19px; }
}

/* ── DATA TABLE ─────────────────────────────────────── */
.data-table { border-collapse: collapse; font-size: 13px; }
.data-table th { text-align: left; padding: 10px 14px; color: var(--muted); font-weight: 600; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; border-bottom: 1px solid var(--border); }
.data-table td { padding: 12px 14px; border-bottom: 1px solid var(--border); color: var(--text); vertical-align: middle; }
.data-table tr:hover td { background: rgba(255,255,255,.02); }

/* ── RESOURCE CARDS ──────────────────────────────────────── */
.resource-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: border-color .2s;
}
.resource-card:hover { border-color: var(--gold); }
.resource-icon { font-size: 28px; }
.resource-title { font-size: 14px; font-weight: 700; color: var(--text); margin-bottom: 4px; }
.resource-desc  { font-size: 12px; color: var(--muted); line-height: 1.5; }
.resource-meta  { font-size: 11px; color: var(--gold); font-weight: 600; margin-top: 4px; }
.resource-actions { display: flex; gap: 8px; margin-top: 4px; flex-wrap: wrap; }
.resource-actions .btn { flex: 1; font-size: 12px; padding: 7px 10px; text-align: center; justify-content: center; white-space: nowrap; }

/* Bug fix (2026-07-21, Shannel): on mobile the 3 action buttons per intake-form resource
   card (Preview / Download / Fillable PDF) were forced into one flex row inside a
   narrow card, causing button labels to visually collide/overlap. Stack them into a
   single column below 480px so each button gets full width and legible text. */
@media (max-width: 480px) {
  .resource-actions { flex-direction: column; }
  .resource-actions .btn { width: 100%; }
}

/* ── PRODUCT INFO FILTER BUTTONS ─────────────────────────── */
.pi-filter-btn,
.cat-filter-btn {
  background: #fff;
  color: var(--navy);
  border: 1.5px solid var(--border);
  border-radius: 8px;
  padding: 9px 10px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s;
  white-space: nowrap;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  box-shadow: 0 1px 2px rgba(0,0,0,.05);
  letter-spacing: .01em;
  width: 100%;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pi-filter-btn:hover,
.cat-filter-btn:hover {
  border-color: var(--gold);
  background: #fffbf0;
  color: var(--navy);
}
.pi-filter-btn.active,
.cat-filter-btn.active {
  background: var(--navy);
  color: var(--gold);
  border-color: var(--navy);
  box-shadow: 0 2px 8px rgba(5,26,67,.18);
}

/* ── PRODUCT INFO CARD ───────────────────────────────────── */
.pi-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: border-color .2s;
}
.pi-card:hover { border-color: var(--gold); }
.pi-card-header { display: flex; align-items: flex-start; gap: 12px; }
.pi-card-icon { font-size: 22px; flex-shrink: 0; }
.pi-card-name { font-size: 13px; font-weight: 700; color: var(--text); }
.pi-card-cat  { font-size: 11px; color: var(--gold); font-weight: 600; margin-top: 2px; }
.pi-card-body { font-size: 12px; color: var(--muted); line-height: 1.6; }
.pi-card-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.pi-tag { background: rgba(212,175,55,.12); color: var(--gold); border-radius: 4px; padding: 2px 8px; font-size: 11px; font-weight: 600; }
.pi-card-actions { display: flex; gap: 8px; margin-top: 4px; }
.pi-card-actions .btn { flex: 1; font-size: 12px; padding: 7px 10px; }

/* ─── DASHBOARD ─────────────────────────────────────────────── */
.dash-stat-tile {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: border-color .2s, box-shadow .2s;
}
.dash-stat-tile:hover { border-color: var(--gold); box-shadow: 0 4px 16px rgba(212,175,55,.08); }
.dst-icon { font-size: 22px; }
.dst-val  { font-size: 28px; font-weight: 800; color: var(--navy); line-height: 1; }
.dst-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); }
.dash-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}
.dash-card-hdr {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 18px 10px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  font-weight: 700;
  color: var(--navy);
}
.dash-card-link {
  background: none;
  border: none;
  font-size: 12px;
  color: var(--gold);
  cursor: pointer;
  font-family: inherit;
  font-weight: 600;
  padding: 0;
}
.dash-card-link:hover { text-decoration: underline; }
.dash-scroll-list {
  max-height: 220px;
  overflow-y: auto;
  padding: 8px 0;
}
.dash-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 18px;
  border-bottom: 1px solid rgba(0,0,0,.04);
  font-size: 13px;
  transition: background .15s;
  cursor: default;
}
.dash-row:last-child { border-bottom: none; }
.dash-row:hover { background: rgba(212,175,55,.05); }
.dash-row-avatar {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--navy);
  color: var(--gold);
  font-size: 11px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.dash-row-main { flex: 1; min-width: 0; }
.dash-row-name  { font-weight: 600; color: var(--navy); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dash-row-sub   { font-size: 11px; color: var(--muted); }
.dash-row-badge {
  font-size: 10px; font-weight: 700; letter-spacing: .4px;
  padding: 2px 8px; border-radius: 20px; flex-shrink: 0;
  text-transform: uppercase;
}
.badge-submitted  { background: rgba(212,175,55,.15); color: #92730a; }
/* .badge-processing, .badge-shipped removed — unused */
.badge-pending    { background: rgba(239,68,68,.1);   color: #dc2626; }
.badge-active     { background: rgba(22,163,74,.12);  color: #15803d; }
.dash-loading { padding: 16px 18px; font-size: 13px; color: var(--muted); }
.dash-empty   { padding: 16px 18px; font-size: 13px; color: var(--muted); font-style: italic; }
.dash-qa-btn {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 8px;
  padding: 11px 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--navy);
  cursor: pointer;
  font-family: inherit;
  text-align: left;
  transition: border-color .2s, background .2s;
}
.dash-qa-btn:hover { border-color: var(--gold); background: rgba(212,175,55,.06); }
@media(max-width:900px) {
  #dash-stats { grid-template-columns: repeat(3,1fr) !important; }
}
@media(max-width:600px) {
  #dash-stats { grid-template-columns: repeat(2,1fr) !important; }
  #section-dashboard .three-col { grid-template-columns: 1fr !important; }
}

/* ─── SNAPSHOT CARDS ─────────────────────────────────────────── */
.snap-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  cursor: pointer;
  transition: border-color .2s, box-shadow .2s;
  display: flex;
  flex-direction: column;
}
.snap-card:hover {
  border-color: var(--gold);
  box-shadow: 0 4px 20px rgba(212,175,55,.1);
}
.snap-card-top {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px 12px;
  border-bottom: 1px solid var(--border);
}
.snap-icon-wrap {
  width: 38px; height: 38px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.snap-title-block { flex: 1; min-width: 0; }
.snap-title { font-size: 14px; font-weight: 700; color: var(--navy); }
.snap-sub   { font-size: 11px; color: var(--muted); margin-top: 1px; }
.snap-badge {
  font-size: 12px; font-weight: 700;
  background: rgba(99,102,241,.1); color: #4f46e5;
  border-radius: 20px; padding: 3px 10px;
  flex-shrink: 0;
}
.snap-list {
  flex: 1;
  max-height: 200px;
  overflow-y: auto;
  padding: 6px 0;
}
.snap-footer {
  padding: 10px 18px;
  font-size: 12px;
  font-weight: 600;
  color: var(--gold);
  border-top: 1px solid var(--border);
  background: rgba(212,175,55,.03);
  letter-spacing: .2px;
}
.snap-mini-stats {
  display: flex;
  gap: 0;
  padding: 16px 18px;
  flex: 1;
}
.snap-mini-stat {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  border-right: 1px solid var(--border);
  padding-right: 16px;
  margin-right: 16px;
}
.snap-mini-stat:last-child { border-right: none; padding-right: 0; margin-right: 0; }
.sms-val { font-size: 22px; font-weight: 800; color: var(--navy); }
.sms-lbl { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); }
@media(max-width:900px) {
  #section-dashboard > div[style*="grid-template-columns:1fr 1fr 1fr"] { grid-template-columns: 1fr 1fr !important; }
}
@media(max-width:600px) {
  #section-dashboard > div[style*="grid-template-columns"] { grid-template-columns: 1fr !important; }
}

/* ─── PRODUCT INFO MODAL — CLINICAL CONTENT ─────────────────── */
.pi-clinical-body { display: flex; flex-direction: column; gap: 0; }
.pi-clinical-section {
  padding: 14px 0;
  border-top: 1px solid var(--border);
}
.pi-clinical-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: var(--gold);
  margin-bottom: 8px;
}
.pi-clinical-text {
  font-size: 13px;
  color: var(--text);
  line-height: 1.65;
}
.pi-clinical-text strong { color: var(--navy); }
.pi-clinical-list {
  margin: 0;
  padding-left: 18px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.pi-clinical-list li {
  font-size: 13px;
  color: var(--text);
  line-height: 1.5;
}
/* Make product info modal taller to fit clinical content */
#productInfoModal .modal-box {
  max-height: 85vh;
  overflow-y: auto;
}

/* ─── RX CART + PATIENT SELECTOR ─────────────────────────────── */
@keyframes rxSelectorPulse {
  0%,100% { box-shadow: 0 0 0 0 rgba(212,175,55,.5); }
  50% { box-shadow: 0 0 0 6px rgba(212,175,55,0); }
}
.rx-selector-pulse { animation: rxSelectorPulse .5s ease 3; }
#section-catalogue:not(.rx-ready) .order-now-btn { opacity: 0.55; cursor: not-allowed; }
#section-catalogue.rx-ready .order-now-btn { opacity: 1; cursor: pointer; }
