:root {
  --bg: #ffffff;
  --bg-soft: #f7f7f7;
  --panel: #ffffff;
  --border: #e5e5e5;
  --text: #2a1720;
  --muted: #737373;
  --brand-burgundy: #72213f;
  --success: #dfeee7;
  --success-text: #1d5f3a;
  --warning: #f6ebd3;
  --warning-text: #7a5b1d;
  --danger: #f8dede;
  --danger-text: #8a2e2e;
  --shadow: 0 8px 24px rgba(54, 13, 31, 0.08);
  --radius: 18px;
  --bs-primary: #72213f;
  --bs-primary-rgb: 114, 33, 63;
  --bs-body-font-family: "Readex Pro", "Segoe UI", Tahoma, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Readex Pro", "Segoe UI", Tahoma, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select {
  font: inherit;
}

img {
  max-width: 100%;
}

.container {
  width: min(1100px, calc(100% - 2rem));
  margin: 0 auto;
}

.topbar .nav-wrap {
  width: 100%;
  max-width: none;
  padding-inline: 1rem;
}

.page-shell {
  min-height: 100vh;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.nav-wrap {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  gap: 0.5rem;
  padding: 0.75rem 0;
}

.brand {
  display: inline-flex;
  align-self: center;
  align-items: center;
  margin: 0;
  color: var(--brand-burgundy);
  gap: 0.45rem;
  font-family: "Rakkas", serif;
  font-weight: 400;
  font-size: 2rem;
  line-height: 1;
  text-transform: none;
}

.brand-arabic {
  direction: rtl;
}

.main-nav {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  width: calc(100% + 2rem);
  max-width: none;
  margin-inline: -1rem;
  gap: 0.4rem;
  padding: 0.45rem;
  border-radius: 0.55rem;
  background: var(--brand-burgundy);
  color: #ffffff;
}

.main-nav a {
  transition: color 0.2s ease;
}

.main-nav a:hover,
.main-nav a:focus-visible {
  color: #ffffff;
}

.main-nav .nav-link {
  border-radius: 0.5rem;
  padding: 0.45rem 0.65rem;
  color: #ffffff;
}

.main-nav .nav-link:hover,
.main-nav .nav-link:focus-visible {
  background: #5e1934;
}

.nav-toggle {
  display: none;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.btn-primary {
  --bs-btn-bg: var(--brand-burgundy);
  --bs-btn-border-color: var(--brand-burgundy);
  --bs-btn-hover-bg: #84294b;
  --bs-btn-hover-border-color: #84294b;
  --bs-btn-active-bg: #5e1934;
  --bs-btn-active-border-color: #5e1934;
}

.btn-outline-secondary {
  --bs-btn-color: var(--text);
  --bs-btn-border-color: var(--border);
  --bs-btn-hover-color: var(--text);
  --bs-btn-hover-bg: var(--bg-soft);
  --bs-btn-hover-border-color: #b8b8b8;
}

.full-width {
  width: 100%;
}

.hero {
  padding: 5rem 0 2rem;
}

.hero-inner {
  text-align: center;
}

.eyebrow {
  margin: 0 0 0.5rem;
  color: var(--muted);
  letter-spacing: 0.04em;
  font-size: 0.85rem;
}

.hero-copy h1,
.page-head h1,
.result-card h3,
.auth-card h1 {
  margin: 0;
}

.hero-copy h1 {
  font-size: clamp(2.5rem, 5vw, 4rem);
  line-height: 1.2;
}

.lead {
  margin: 1rem auto 0;
  font-size: 1.2rem;
  color: var(--muted);
  max-width: 700px;
}

.home-search {
  margin-top: 2rem;
}

.search-form {
  display: grid;
  grid-template-columns: 1.8fr 1fr auto;
  gap: 1rem;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
}

.large-form {
  grid-template-columns: 1.4fr 1fr 1fr auto;
}

.inline-form {
  display: flex;
  gap: 1rem;
  align-items: end;
}

.field-group {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  text-align: right;
}

[dir="ltr"] .field-group {
  text-align: left;
}

.field-group label {
  color: var(--muted);
  font-weight: 600;
}

.form-control,
.form-select {
  min-height: 48px;
  border-color: var(--border);
  border-radius: 0.75rem;
  color: var(--text);
}

textarea.form-control {
  resize: vertical;
}

.section-block {
  padding: 1rem 0 4rem;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.steps-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.5rem;
}

.process-step {
  border-top: 2px solid var(--border);
  padding-top: 1rem;
}

.step-number {
  display: block;
  margin-bottom: 0.75rem;
  color: var(--muted);
  font-size: 1.8rem;
  font-weight: 700;
  line-height: 1;
}

.process-step h3,
.pharmacy-join h2 {
  margin: 0;
  font-size: 1.25rem;
}

.process-step p,
.pharmacy-join p:last-child {
  margin: 0.5rem 0 0;
  color: var(--muted);
}

.pharmacy-join {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.pharmacy-join-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.info-card {
  padding: 1.4rem;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.info-card h2 {
  margin-top: 0;
  margin-bottom: 0.75rem;
  font-size: 1.35rem;
}

.info-card p {
  margin: 0;
  color: var(--muted);
}

.stat-mini {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  margin-top: 1rem;
}

.stat-mini strong {
  font-size: 1.8rem;
}

.emergency-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
}

.emergency-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.request-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 1rem;
}

.request-form-wrap {
  width: min(100%, 680px);
  margin-inline: auto;
}

.request-page {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.request-page-head {
  width: min(100%, 680px);
  text-align: center;
}

.request-form {
  width: 100%;
}

.emergency-filters {
  grid-template-columns: 1.2fr 1fr 1fr auto;
  margin-bottom: 1.5rem;
}

.request-list-panel {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.2rem;
}

.request-list-panel h2 {
  margin-top: 0;
}

.order-list {
  display: grid;
  gap: 0.75rem;
  width: 100%;
}

.order-listing,
.order-tracking-summary,
.order-tracking-pharmacy,
.order-tracking-link-block {
  min-width: 0;
  padding: 1rem 1.1rem;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.order-status-filters {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding: 0 0 0.4rem;
  scrollbar-width: thin;
}

.order-status-filter {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 0.55rem;
  min-height: 42px;
  padding: 0.45rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  background: var(--panel);
}

.order-status-filter strong {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.order-status-filter.is-active {
  border-color: var(--brand-burgundy);
  box-shadow: inset 0 -2px 0 var(--brand-burgundy);
}

.order-card-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.order-card-heading > div {
  display: grid;
  gap: 0.15rem;
}

.order-status-badge {
  min-width: 110px;
  min-height: 38px;
  text-align: center;
}

.pharmacy-order-card {
  border-inline-start: 4px solid var(--brand-burgundy);
  box-shadow: 0 3px 12px rgba(54, 13, 31, 0.045);
}

.order-progress {
  margin: 0.9rem 0;
  padding: 0.85rem 1rem;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--bg-soft);
}

.order-progress-heading {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.3rem 1rem;
  margin-bottom: 0.8rem;
  font-size: 0.9rem;
}

.order-progress-heading > span {
  color: var(--muted);
}

.order-progress-track {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.45rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.order-progress-step {
  display: grid;
  justify-items: center;
  align-content: start;
  gap: 0.4rem;
  min-width: 0;
  color: var(--muted);
  text-align: center;
}

.order-progress-marker {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 2px solid var(--border);
  border-radius: 50%;
  color: var(--muted);
  background: var(--panel);
  font-size: 0.8rem;
  font-weight: 700;
}

.order-progress-step.is-complete .order-progress-marker {
  border-color: var(--success-text);
  color: #ffffff;
  background: var(--success-text);
}

.order-progress-step.is-current {
  color: var(--text);
  font-weight: 700;
}

.order-progress-step.is-current .order-progress-marker {
  border-color: var(--brand-burgundy);
  color: #ffffff;
  background: var(--brand-burgundy);
  box-shadow: 0 0 0 3px rgba(114, 33, 63, 0.14);
}

.order-progress-label {
  overflow-wrap: anywhere;
  font-size: 0.82rem;
}

.order-progress-terminal {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0.9rem 0;
  padding: 0.7rem 0.9rem;
  border-radius: 6px;
}

.status-order-new {
  color: #174f68;
  background: #dceef5;
}

.status-order-accepted,
.status-order-completed {
  color: var(--success-text);
  background: var(--success);
}

.status-order-ready {
  color: var(--warning-text);
  background: var(--warning);
}

.status-order-rejected {
  color: var(--danger-text);
  background: var(--danger);
}

.status-order-cancelled {
  color: #4f565b;
  background: #e6e8e9;
}

.order-customer-details {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.8rem 1.4rem;
  margin: 0.85rem 0;
  padding: 0.8rem;
  border-inline-start: 3px solid var(--brand-burgundy);
  background: var(--bg-soft);
}

.order-customer-details > div {
  display: grid;
  gap: 0.1rem;
}

.order-customer-details > div > span {
  color: var(--muted);
  font-size: 0.82rem;
}

.btn-whatsapp {
  --bs-btn-color: #155b3e;
  --bs-btn-bg: #dcefe4;
  --bs-btn-border-color: #bfdcc9;
  --bs-btn-hover-color: #10472f;
  --bs-btn-hover-bg: #cce5d6;
  --bs-btn-hover-border-color: #a8cfb7;
}

.order-status-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-top: 1rem;
}

.order-status-actions form {
  margin: 0;
}

.order-status-actions .btn {
  min-height: 42px;
}

.order-listing h2,
.order-listing h3,
.order-tracking-summary h2,
.order-tracking-pharmacy h2 {
  margin: 0.4rem 0;
}

.order-listing p,
.order-tracking-summary p,
.order-tracking-pharmacy p {
  margin: 0.35rem 0;
  overflow-wrap: anywhere;
}

.order-listing-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  color: var(--muted);
}

.order-listing-heading > div {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.tracking-shell {
  display: grid;
  gap: 1rem;
  max-width: 940px;
}

.tracking-page-heading,
.tracking-overview-heading,
.tracking-order-meta,
.tracking-cancel-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.tracking-page-heading h1 {
  margin: 0;
}

.tracking-reference {
  display: grid;
  gap: 0.15rem;
  padding: 0.55rem 0.85rem;
  border-inline-start: 3px solid var(--brand-burgundy);
  background: var(--bg-soft);
}

.tracking-reference span,
.tracking-order-meta {
  color: var(--muted);
  font-size: 0.9rem;
}

.tracking-reference strong {
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.tracking-overview {
  padding: 1.2rem 1.3rem;
  border: 1px solid var(--border);
  border-inline-start: 4px solid var(--brand-burgundy);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 4px 16px rgba(54, 13, 31, 0.05);
}

.tracking-overview-heading > div {
  min-width: 0;
}

.tracking-overview-heading .eyebrow,
.tracking-detail-panel .eyebrow {
  margin: 0 0 0.25rem;
}

.tracking-overview-heading h2 {
  margin: 0;
  overflow-wrap: anywhere;
}

.tracking-order-meta {
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: 0.35rem 1.25rem;
  margin-top: 0.55rem;
}

.tracking-order-meta strong {
  color: var(--text);
}

.tracking-progress {
  margin: 1rem 0 0;
  padding: 1rem 0 0;
  border: 0;
  border-top: 1px solid var(--border);
  border-radius: 0;
  background: transparent;
}

.tracking-progress .order-progress-heading {
  margin-bottom: 0.85rem;
}

.tracking-details-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: 1rem;
}

.tracking-detail-panel {
  min-width: 0;
  padding: 1.1rem 1.2rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel);
}

.tracking-detail-panel h2 {
  margin: 0.15rem 0 0.4rem;
  font-size: 1.15rem;
  overflow-wrap: anywhere;
}

.tracking-pharmacy-address {
  margin: 0;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.order-tracking-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 0.8rem;
}

.order-tracking-link-block label {
  display: block;
  margin-bottom: 0.5rem;
}

.order-tracking-link-block > div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.5rem;
}

.tracking-link-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.5rem;
  margin-top: 0.8rem;
}

.tracking-link-controls .btn,
.order-tracking-actions .btn {
  min-height: 44px;
}

.tracking-copy-feedback {
  min-height: 1.4em;
  margin: 0.35rem 0 0;
  color: var(--success-text);
  font-size: 0.9rem;
}

.tracking-cancel-row {
  flex-wrap: wrap;
  padding-top: 0.9rem;
  border-top: 1px solid var(--border);
}

.tracking-cancel-row p {
  margin: 0;
  color: var(--muted);
}

.mini-request {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 0.9rem 1rem;
  margin-top: 0.85rem;
}

.mini-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.mini-request p,
.mini-request small {
  margin: 0.4rem 0 0;
  color: var(--muted);
}

.compact {
  max-width: 640px;
}

.section-header {
  margin-bottom: 1rem;
}

.section-header h2 {
  margin: 0;
  font-size: 1.6rem;
}

.pill-list,
.chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.pill-link,
.chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.7rem 1rem;
  background: var(--bg-soft);
  color: var(--text);
}

.page-section {
  padding: 2rem 0 4rem;
}

.page-head {
  margin-bottom: 2rem;
}

.page-head h1 {
  font-size: clamp(2rem, 6vw, 3rem);
}

.results-summary {
  margin-bottom: 2rem;
}

.results-summary h2 {
  margin: 0 0 0.25rem;
}

.result-list,
.inventory-list,
.approval-list,
.medicine-grid {
  display: grid;
  gap: 1rem;
}

.result-card,
.approval-card,
.list-card,
.inventory-item,
.card-panel,
.auth-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1.2rem;
  box-shadow: var(--shadow);
}

.result-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.result-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  width: 100%;
}

.result-main h3,
.inventory-info span,
.approval-card h3,
.list-card h3 {
  margin: 0;
}

.result-main p,
.approval-card p,
.list-card p {
  margin: 0.2rem 0 0;
  color: var(--muted);
}

.status-group {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.2rem;
}

[dir="ltr"] .status-group,
[dir="ltr"] .pharmacy-header-meta {
  align-items: flex-start;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 0.4rem 0.75rem;
  font-size: 0.82rem;
  font-weight: 700;
}

.status-available {
  background: var(--success);
  color: var(--success-text);
}

.status-limited {
  background: var(--warning);
  color: var(--warning-text);
}

.status-out {
  background: var(--danger);
  color: var(--danger-text);
}

.status-group small,
.inventory-item small,
.approval-card small,
.pharmacy-meta p {
  color: var(--muted);
}

.result-actions {
  display: flex;
  align-items: center;
}

.empty-state {
  margin-top: 1.5rem;
  padding: 3rem 1.5rem;
  text-align: center;
  background: var(--bg-soft);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.empty-state h3 {
  margin-top: 0;
}

.meta-block,
.pharmacy-meta,
.detail-head {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  align-items: baseline;
}

.meta-block {
  margin: 1.5rem 0;
  color: var(--muted);
}

.selection-panel {
  margin: 1rem 0 2rem;
}

.small-note {
  margin-top: 2rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.auth-shell {
  display: grid;
  place-items: center;
  min-height: calc(100vh - 120px);
  padding: 3rem 0;
}

.auth-card {
  width: min(100%, 440px);
}

.registration-card {
  width: min(100%, 620px);
}

.registration-card .stack-form {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.registration-card .stack-form > button {
  grid-column: 1 / -1;
}

.registration-note,
.auth-switch {
  color: var(--muted);
}

.auth-switch {
  margin: 1.25rem 0 0;
  text-align: center;
}

.auth-switch a {
  color: var(--text);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.auth-form,
.stack-form {
  display: grid;
  gap: 1rem;
}

.dashboard-shell {
  display: grid;
  gap: 1.25rem;
}

.dashboard-topbar,
.sync-panel,
.inventory-row,
.approval-card,
.split-head,
.submit-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.pharmacy-header-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.3rem;
}

.pharmacy-name {
  font-weight: 700;
}

.connection-status {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 600;
}

.connection-status.connected {
  color: var(--success-text);
}

.connection-status.disconnected {
  color: var(--danger-text);
}

.sync-panel {
  background: #f7f7f7;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem 1.2rem;
}

.sync-panel p {
  margin: 0.1rem 0;
  color: var(--muted);
}

.inventory-form {
  display: grid;
  gap: 0.85rem;
}

.pharmacy-dashboard-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.pharmacy-dashboard-actions-heading {
  padding-top: 0.25rem;
}

.pharmacy-dashboard-actions-heading h2 {
  margin: 0;
  font-size: 1.3rem;
}

.pharmacy-dashboard-actions-heading p {
  margin: 0.2rem 0 0;
  color: var(--muted);
}

.pharmacy-primary-actions,
.pharmacy-secondary-actions,
.pharmacy-page-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
}

.pharmacy-dashboard-actions .btn,
.pharmacy-page-nav .btn {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.pharmacy-page-nav {
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.inventory-section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 0.5rem;
}

.inventory-section-head h2 {
  margin: 0;
  font-size: 1.45rem;
}

.inventory-section-head p {
  margin: 0.25rem 0 0;
  color: var(--muted);
}

.inventory-filter {
  width: min(100%, 320px);
}

.inventory-row {
  min-width: 0;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.9rem 1rem;
}

.inventory-info {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}

.inventory-row .stock-quantity {
  width: 112px;
  min-height: 44px;
}

.inventory-quantity-control {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 600;
}

.inventory-quantity-control span {
  white-space: nowrap;
}

.inventory-filter-empty {
  margin-top: 0;
}

.inventory-filter-empty[hidden] {
  display: none;
}

.inventory-save-button {
  min-width: 180px;
  min-height: 48px;
}

.submit-row {
  justify-content: flex-end;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.stat-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.2rem;
  background: var(--bg-soft);
}

.stat-card span {
  display: block;
  color: var(--muted);
}

.stat-card strong {
  display: block;
  margin-top: 0.5rem;
  font-size: 2rem;
}

.approval-actions {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.card-panel {
  margin-top: 2rem;
}

.medicine-grid {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.product-image {
  display: block;
  width: min(100%, 240px);
  max-height: 240px;
  object-fit: contain;
  border-radius: 0.5rem;
  margin-block: 0.75rem;
}

.product-thumb {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 0.5rem;
  margin-bottom: 0.75rem;
}

.product-kind {
  display: inline-block;
  color: var(--muted);
  font-weight: 400;
}

.product-price {
  font-weight: 700;
}

.product-filters {
  grid-template-columns: 1.4fr 1fr 1fr auto;
}

.product-browser-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

.product-listing {
  min-width: 0;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: 0.6rem;
  background: var(--panel);
}

.product-listing h2 {
  margin: 0.65rem 0 0.25rem;
  font-size: 1.2rem;
}

.product-listing p {
  margin: 0.4rem 0;
  color: var(--muted);
}

.product-listing .product-price {
  color: var(--text);
}

.product-listing-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 0.75rem;
}

.product-contact {
  width: 100%;
  margin-top: 0.85rem;
}

.product-contact-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem;
  margin-top: 0.85rem;
}

.product-contact-actions .btn {
  width: 100%;
  min-height: 44px;
}

.product-order-button {
  --bs-btn-bg: var(--brand-burgundy);
  --bs-btn-border-color: var(--brand-burgundy);
  --bs-btn-color: #ffffff;
  --bs-btn-hover-bg: #84294b;
  --bs-btn-hover-border-color: #84294b;
  --bs-btn-hover-color: #ffffff;
}

.product-profile-button {
  --bs-btn-bg: #ffffff;
  --bs-btn-border-color: var(--border);
  --bs-btn-color: var(--text);
  --bs-btn-hover-bg: var(--bg-soft);
  --bs-btn-hover-border-color: #c9cdd1;
  --bs-btn-hover-color: var(--text);
}

.product-entry-form {
  width: min(100%, 760px);
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 2rem;
}

.product-entry-form > button {
  grid-column: 1 / -1;
}

.pharmacy-product-action {
  display: flex;
  justify-content: flex-end;
}

.product-card-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.product-card-actions form,
.product-card-actions .btn {
  width: 100%;
}

.product-card-actions .btn {
  min-height: 44px;
  --bs-btn-bg: var(--brand-burgundy);
  --bs-btn-border-color: var(--brand-burgundy);
  --bs-btn-color: #ffffff;
  --bs-btn-hover-bg: #84294b;
  --bs-btn-hover-border-color: #84294b;
  --bs-btn-hover-color: #ffffff;
}

.product-inventory-heading {
  margin-top: 2.5rem;
}

@media (max-width: 760px) {
  .topbar {
    backdrop-filter: none;
  }

  .dashboard-topbar,
  .sync-panel,
  .inventory-row,
  .result-card,
  .result-main {
    display: block;
  }

  .nav-wrap {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 0;
    min-height: 88px;
  }

  .nav-toggle {
    position: absolute;
    top: 1rem;
    right: 0;
    display: inline-flex;
    z-index: 11;
    align-items: center;
    justify-content: center;
  }

  .brand {
    position: static;
    align-self: center;
    margin: 0;
  }

  .main-nav {
    display: flex;
    min-height: 0;
    width: calc(100% + 2rem);
    min-width: 0;
    max-width: none;
    margin-inline: -1rem;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    padding: 0;
    flex: 0 0 auto;
    flex-direction: column;
    align-items: stretch;
    gap: 0.25rem;
    transition: max-height 0.25s ease, opacity 0.2s ease, padding 0.25s ease, visibility 0.25s;
  }

  .main-nav.is-open {
    max-height: calc(100vh - 7rem);
    max-height: calc(100dvh - 7rem);
    box-sizing: border-box;
    margin-top: 0.5rem;
    padding: 0.75rem;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }

  .main-nav.is-open .nav-link {
    color: #ffffff;
  }

  .main-nav.is-open .nav-link:hover,
  .main-nav.is-open .nav-link:focus-visible {
    background: #5e1934;
    color: #ffffff;
  }

  .nav-actions {
    width: 100%;
    margin-top: 0.5rem;
  }

  .search-form,
  .large-form,
  .inline-form,
  .registration-card .stack-form,
  .product-filters,
  .product-entry-form,
  .emergency-filters,
  .stats-grid,
  .info-grid,
  .request-grid {
    grid-template-columns: 1fr;
    display: grid;
  }

  .order-tracking-link-block > div,
  .tracking-link-controls,
  .tracking-details-grid {
    grid-template-columns: 1fr;
  }

  .tracking-page-heading,
  .tracking-overview-heading,
  .tracking-cancel-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .tracking-reference {
    width: 100%;
  }

  .order-listing-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .order-card-heading {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .order-customer-details > div {
    min-width: min(100%, 145px);
  }

  .steps-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .result-card {
    padding: 1rem;
  }

  .emergency-box {
    display: grid;
  }

  .pharmacy-join {
    display: grid;
  }

  .status-group {
    align-items: flex-start;
    margin-top: 0.5rem;
  }

  .inventory-row .stock-quantity {
    width: min(100%, 180px);
  }

  .pharmacy-header-meta {
    align-items: flex-start;
    margin-top: 0.75rem;
  }

  .pharmacy-dashboard-actions,
  .pharmacy-primary-actions,
  .pharmacy-secondary-actions,
  .inventory-section-head,
  .pharmacy-page-nav {
    display: grid;
    grid-template-columns: 1fr;
  }

  .pharmacy-dashboard-actions .btn,
  .pharmacy-page-nav .btn,
  .inventory-filter,
  .inventory-save-button {
    width: 100%;
  }

  .inventory-section-head {
    align-items: stretch;
  }

  .inventory-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
  }

  .inventory-quantity-control {
    justify-content: space-between;
    margin-top: 0.75rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}

.home-hero {
  padding: 3.5rem 0 3rem;
  background-color: #f5eff1;
  border-bottom: 1px solid #e8dce1;
}

.home-hero-inner {
  max-width: 850px;
  text-align: center;
}

.home-country {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0 1rem;
  padding: 0.35rem 0.8rem;
  border: 1px solid #d8c3cb;
  border-radius: 999px;
  background: #ffffff;
  color: var(--brand-burgundy);
  font-size: 0.9rem;
  font-weight: 700;
}

.home-brand-title {
  margin: 0;
  color: var(--brand-burgundy);
  font-size: 3.75rem;
  font-weight: 800;
  line-height: 1.05;
}

.home-tagline {
  margin: 0.5rem 0 0;
  font-size: 1.8rem;
  font-weight: 650;
}

.home-hero-description {
  max-width: 680px;
  margin: 1rem auto 0;
  font-size: 1.2rem;
}

.home-hero-note {
  margin: 0.25rem auto 0;
  color: var(--muted);
}

.home-search {
  max-width: 760px;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) auto;
  align-items: end;
  margin: 1.75rem auto 0;
  background: #ffffff;
  border-color: #e2d5da;
  border-radius: 0.6rem;
  box-shadow: 0 10px 26px rgba(54, 13, 31, 0.08);
  text-align: start;
}

.home-search-query {
  grid-column: 1 / -1;
}

.home-search-button {
  min-height: 48px;
  min-width: 145px;
  font-weight: 700;
}

.home-section {
  padding-top: 3.5rem;
  padding-bottom: 3.5rem;
}

.home-section-heading {
  margin-bottom: 2rem;
  text-align: center;
}

.home-section-heading h2 {
  margin: 0;
  font-size: 2rem;
}

.home-find-description {
  max-width: 620px;
  margin: 0.7rem auto 0;
  color: var(--muted);
}

.home-section-heading .eyebrow {
  margin-bottom: 0.4rem;
  color: var(--brand-burgundy);
  font-weight: 700;
}

.home-step-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.5rem;
}

.home-step {
  min-width: 0;
  padding-top: 1rem;
  border-top: 3px solid var(--brand-burgundy);
}

.home-step-number {
  color: var(--brand-burgundy);
  font-size: 0.9rem;
  font-weight: 800;
}

.home-step h3 {
  margin: 0.35rem 0 0;
  font-size: 1.3rem;
}

.home-step p {
  margin: 0.15rem 0 0;
  color: var(--muted);
}

.home-category-band,
.home-how-band {
  background: #f7f7f7;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.home-category-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
}

.home-category {
  min-width: 0;
  min-height: 150px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #ffffff;
  text-align: center;
}

.home-category-number {
  color: var(--brand-burgundy);
  font-size: 0.9rem;
  font-weight: 800;
}

.home-category h3 {
  margin: 0;
  font-size: 1rem;
}

.home-category-note {
  margin: 1.25rem 0 0;
  color: var(--muted);
  text-align: center;
}

.home-pharmacy-band {
  background: var(--brand-burgundy);
  color: #ffffff;
}

.home-pharmacy-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: center;
  padding-top: 3.5rem;
  padding-bottom: 3.5rem;
}

.home-band-eyebrow {
  margin: 0 0 0.5rem;
  color: #f0dce4;
  font-weight: 700;
}

.home-pharmacy-copy h2 {
  margin: 0;
  font-size: 2rem;
}

.home-pharmacy-copy h3 {
  margin: 0.25rem 0 0;
  color: #f4dfe7;
  font-size: 1.5rem;
}

.home-pharmacy-copy > p:not(.home-band-eyebrow) {
  max-width: 480px;
  margin: 0.85rem 0 0;
  color: #f5e9ed;
}

.home-free-label {
  display: inline-block;
  margin-top: 1rem;
  padding: 0.25rem 0.65rem;
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 4px;
  font-weight: 700;
}

.home-benefits {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.6rem 1rem;
  margin: 0 0 1.2rem;
  padding: 0;
  list-style: none;
}

.home-benefits li::before {
  content: "✓";
  margin-inline-end: 0.55rem;
  color: #b9e2ca;
  font-weight: 800;
}

.home-register-button {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.65rem 1.2rem;
  border-radius: 4px;
  background: #ffffff;
  color: var(--brand-burgundy);
  font-weight: 800;
}

.home-register-button:hover,
.home-register-button:focus-visible {
  background: #f5eff1;
  color: #5e1934;
}

.home-login-link {
  display: block;
  width: fit-content;
  margin-top: 0.75rem;
  color: #ffffff;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.home-how-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 3rem;
}

.home-how-column h3 {
  margin: 0 0 0.75rem;
  color: var(--brand-burgundy);
  font-size: 1.2rem;
}

.home-how-column ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

.home-how-column li {
  display: flex;
  align-items: baseline;
  gap: 0.8rem;
  padding: 0.65rem 0;
  border-top: 1px solid var(--border);
}

.home-how-column li span {
  color: var(--brand-burgundy);
  font-weight: 800;
}

.home-footer {
  background: #2a1720;
  color: #ffffff;
}

.home-footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 1.5rem;
  padding-bottom: 1.5rem;
}

.home-footer-brand {
  color: #ffffff;
  font-family: "Rakkas", serif;
  font-size: 1.8rem;
  line-height: 1;
}

.home-footer p {
  margin: 0.2rem 0 0;
  color: #e4d9de;
}

.pharmacy-profile-page,
.pharmacy-directory-page {
  display: grid;
  gap: 1.5rem;
}

.pharmacy-profile-page .pharmacy-page-nav {
  justify-content: flex-start;
  margin-bottom: 0;
}

.pharmacy-profile-hero {
  padding: 1.5rem;
  border-inline-start: 4px solid var(--brand-burgundy);
  border-radius: 4px;
  background: #f5eff1;
}

.pharmacy-profile-hero .eyebrow {
  color: var(--brand-burgundy);
  font-weight: 700;
}

.pharmacy-profile-hero h1 {
  margin: 0;
  font-size: clamp(1.8rem, 5vw, 2.5rem);
}

.pharmacy-location-label {
  display: inline-flex;
  margin-top: 0.65rem;
  color: var(--brand-burgundy);
  font-size: 0.92rem;
  font-weight: 700;
}

.pharmacy-profile-contact,
.pharmacy-profile-inventory {
  display: grid;
  gap: 1rem;
}

.pharmacy-profile-section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
}

.pharmacy-profile-section-head .eyebrow {
  margin-bottom: 0.25rem;
  color: var(--brand-burgundy);
  font-weight: 700;
}

.pharmacy-profile-section-head h2 {
  margin: 0;
  font-size: 1.5rem;
}

.pharmacy-profile-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  margin-top: 0.8rem;
}

.pharmacy-profile-facts p {
  margin: 0;
  color: var(--muted);
}

.pharmacy-profile-facts a {
  color: var(--text);
  font-weight: 600;
}

.pharmacy-profile-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border);
}

.pharmacy-profile-actions .btn {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.pharmacy-profile-products {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

.pharmacy-profile-product {
  min-width: 0;
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  align-items: center;
  gap: 0.9rem;
  padding: 0.9rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #ffffff;
}

.pharmacy-profile-product:not(.has-image) {
  grid-template-columns: minmax(0, 1fr);
}

.pharmacy-profile-product-image {
  width: 72px;
  height: 72px;
  border-radius: 4px;
  object-fit: cover;
}

.pharmacy-profile-product-info {
  min-width: 0;
}

.pharmacy-profile-product-info h3 {
  margin: 0.2rem 0;
  font-size: 1.05rem;
}

.pharmacy-profile-product-info h3 span {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 500;
}

.pharmacy-profile-product-info .product-kind {
  color: var(--muted);
}

.pharmacy-profile-product-info .product-price {
  margin: 0.2rem 0;
}

.pharmacy-profile-stock {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.35rem 0.75rem;
}

.pharmacy-profile-stock strong {
  color: var(--success-text);
  font-size: 0.9rem;
}

.pharmacy-profile-stock small {
  color: var(--muted);
}

.pharmacy-directory-heading {
  text-align: center;
}

.pharmacy-directory-heading h1 {
  margin: 0;
  font-size: clamp(1.8rem, 5vw, 2.5rem);
}

.pharmacy-directory-heading .eyebrow {
  margin-bottom: 0.35rem;
  color: var(--brand-burgundy);
  font-weight: 700;
}

.pharmacy-directory-heading .lead {
  margin: 0.4rem auto 0;
}

.pharmacy-directory-filters {
  grid-template-columns: minmax(0, 1.5fr) minmax(190px, 1fr) auto;
  align-items: end;
  background: #f7f7f7;
  border-radius: 6px;
}

.pharmacy-directory-filters button {
  min-height: 48px;
}

.pharmacy-directory-summary {
  display: flex;
  align-items: baseline;
  gap: 0.55rem;
}

.pharmacy-directory-summary h2 {
  margin: 0;
  font-size: 1.3rem;
}

.pharmacy-directory-summary span {
  color: var(--muted);
  font-size: 0.9rem;
}

.pharmacy-directory-list {
  display: grid;
}

.pharmacy-directory-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  padding: 1.1rem 0;
  border-top: 1px solid var(--border);
}

.pharmacy-directory-main {
  min-width: 0;
}

.pharmacy-directory-main .pharmacy-location-label {
  margin-top: 0;
  font-size: 0.82rem;
}

.pharmacy-directory-main h3 {
  margin: 0.2rem 0;
  font-size: 1.15rem;
}

.pharmacy-directory-main h3 a:hover,
.pharmacy-directory-main h3 a:focus-visible {
  color: var(--brand-burgundy);
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.pharmacy-directory-main p,
.pharmacy-directory-phone {
  margin: 0.1rem 0;
  color: var(--muted);
}

.pharmacy-directory-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.45rem;
}

.pharmacy-directory-actions .btn {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

@media (max-width: 760px) {
  .home-hero {
    padding: 2.5rem 0 2rem;
  }

  .home-brand-title {
    font-size: 2.8rem;
  }

  .home-tagline {
    font-size: 1.45rem;
  }

  .home-hero-description {
    font-size: 1.05rem;
  }

  .home-search,
  .home-step-grid,
  .home-category-grid,
  .home-pharmacy-layout,
  .home-how-grid {
    grid-template-columns: 1fr;
  }

  .home-search-query {
    grid-column: auto;
  }

  .home-search-button {
    width: 100%;
  }

  .home-section {
    padding-top: 2.5rem;
    padding-bottom: 2.5rem;
  }

  .home-category-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .home-category {
    min-height: 130px;
  }

  .home-pharmacy-layout {
    gap: 1.5rem;
    padding-top: 2.5rem;
    padding-bottom: 2.5rem;
  }

  .home-benefits {
    grid-template-columns: 1fr;
  }

  .home-how-grid {
    gap: 1.75rem;
  }

  .home-footer-inner {
    align-items: flex-start;
    flex-direction: column;
  }

  .pharmacy-directory-filters,
  .pharmacy-directory-item,
  .pharmacy-directory-actions,
  .pharmacy-profile-actions,
  .pharmacy-profile-products {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
  }

  .pharmacy-directory-item {
    align-items: start;
  }

  .pharmacy-directory-actions .btn,
  .pharmacy-profile-actions .btn {
    width: 100%;
    min-width: 0;
    white-space: normal;
  }

  .pharmacy-profile-section-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .pharmacy-profile-product.has-image {
    grid-template-columns: 72px minmax(0, 1fr);
  }

  .pharmacy-profile-product:not(.has-image) {
    grid-template-columns: minmax(0, 1fr);
  }
}
