html[lang="ar"],
html[dir="rtl"] {
  direction: rtl;
}

html[lang="ar"] body,
html[dir="rtl"] body {
  font-family: "Tajawal", "Noto Sans Arabic", system-ui, sans-serif;
}

.drmagdy-brand {
  font-weight: 700;
  letter-spacing: 0;
}

[data-page-route="pharmacy-management"] .layout-main-section,
[data-page-route="Workspaces/Pharmacy Management"] .layout-main-section {
  max-width: 1440px;
}

[data-page-route="pharmacy-management"] .widget.shortcut-widget-box {
  min-height: 112px;
  border-radius: 14px;
}

.web-footer,
.navbar-brand {
  direction: rtl;
}

.drmagdy-cod-notice {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--green-100, #d1fae5);
  color: var(--green-700, #047857);
  font-weight: 700;
}

.drmagdy-home {
  --dm-primary: #0f766e;
  --dm-primary-dark: #115e59;
  --dm-primary-soft: #ccfbf1;
  --dm-ink: #16302d;
  --dm-muted: #60706e;
  --dm-border: #dce7e5;
  --dm-surface: #ffffff;
  --dm-soft: #f2fbf9;
  color: var(--dm-ink);
  overflow: hidden;
}

.drmagdy-home .container {
  width: min(1180px, calc(100% - 32px));
}

.drmagdy-hero {
  position: relative;
  min-height: 520px;
  display: flex;
  align-items: center;
  background:
    radial-gradient(circle at 15% 20%, rgba(255, 255, 255, 0.18), transparent 34%),
    linear-gradient(135deg, var(--dm-primary-dark), var(--dm-primary));
  color: #fff;
}

.drmagdy-hero.has-image {
  background:
    linear-gradient(90deg, rgba(7, 61, 57, 0.94), rgba(15, 118, 110, 0.58)),
    var(--hero-image) center / cover no-repeat;
}

.drmagdy-hero-inner {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(220px, 0.75fr);
  gap: 56px;
  align-items: center;
  padding-block: 72px;
}

.drmagdy-hero-copy {
  max-width: 720px;
}

.drmagdy-eyebrow {
  display: inline-block;
  margin-bottom: 10px;
  color: inherit;
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.drmagdy-hero h1 {
  max-width: 680px;
  margin: 0;
  color: #fff;
  font-size: clamp(2.25rem, 5vw, 4.5rem);
  font-weight: 800;
  line-height: 1.15;
}

.drmagdy-hero p {
  max-width: 640px;
  margin: 22px 0 0;
  color: rgba(255, 255, 255, 0.88);
  font-size: clamp(1rem, 2vw, 1.25rem);
  line-height: 1.9;
}

.drmagdy-hero-actions,
.drmagdy-contact-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
}

.drmagdy-hero .btn-primary {
  border-color: #fff;
  background: #fff;
  color: var(--dm-primary-dark);
}

.drmagdy-hero .btn-primary:hover,
.drmagdy-hero .btn-primary:focus {
  border-color: #ecfdf5;
  background: #ecfdf5;
  color: var(--dm-primary-dark);
}

.drmagdy-hero .btn-light {
  border-color: rgba(255, 255, 255, 0.38);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  backdrop-filter: blur(8px);
}

.drmagdy-hero-mark {
  display: flex;
  align-items: center;
  justify-content: center;
}

.drmagdy-hero-mark img {
  width: min(280px, 72vw);
  filter: drop-shadow(0 24px 44px rgba(0, 0, 0, 0.18));
}

.drmagdy-section {
  padding-block: 72px;
}

.drmagdy-section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
}

.drmagdy-section-head h2,
.drmagdy-contact-strip h2 {
  margin: 0;
  color: var(--dm-ink);
  font-size: clamp(1.65rem, 3vw, 2.35rem);
  font-weight: 800;
}

.drmagdy-section-head .drmagdy-eyebrow {
  color: var(--dm-primary);
}

.drmagdy-section-head > a {
  color: var(--dm-primary-dark);
  font-weight: 700;
}

.drmagdy-product-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
}

.drmagdy-product-card,
.drmagdy-promotion-card,
.drmagdy-branch-card {
  overflow: hidden;
  border: 1px solid var(--dm-border);
  border-radius: 18px;
  background: var(--dm-surface);
  box-shadow: 0 10px 30px rgba(16, 54, 49, 0.06);
}

.drmagdy-product-card {
  display: flex;
  min-width: 0;
  flex-direction: column;
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.drmagdy-product-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 18px 38px rgba(16, 54, 49, 0.11);
}

.drmagdy-product-image {
  position: relative;
  display: block;
  aspect-ratio: 1 / 0.82;
  overflow: hidden;
  background: var(--dm-soft);
}

.drmagdy-product-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 240ms ease;
}

.drmagdy-product-card:hover .drmagdy-product-image img {
  transform: scale(1.035);
}

.drmagdy-featured {
  position: absolute;
  top: 12px;
  inset-inline-start: 12px;
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--dm-primary);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 800;
}

.drmagdy-product-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 18px;
}

.drmagdy-product-group {
  color: var(--dm-primary);
  font-size: 0.78rem;
  font-weight: 700;
}

.drmagdy-product-body h3 {
  margin: 7px 0 9px;
  font-size: 1.05rem;
  font-weight: 800;
  line-height: 1.5;
}

.drmagdy-product-body h3 a {
  color: var(--dm-ink);
}

.drmagdy-product-body p {
  display: -webkit-box;
  overflow: hidden;
  margin: 0 0 18px;
  color: var(--dm-muted);
  font-size: 0.88rem;
  line-height: 1.65;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.drmagdy-product-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: auto;
}

.drmagdy-product-footer strong {
  color: var(--dm-primary-dark);
  font-size: 1rem;
}

.drmagdy-product-footer .btn-outline-primary {
  border-color: var(--dm-primary);
  color: var(--dm-primary);
}

.drmagdy-promotion-grid,
.drmagdy-branch-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.drmagdy-promotion-card img {
  width: 100%;
  aspect-ratio: 2 / 1;
  object-fit: cover;
}

.drmagdy-promotion-card > div,
.drmagdy-branch-card {
  padding: 22px;
}

.drmagdy-promotion-card h3,
.drmagdy-branch-card h3 {
  margin: 0 0 12px;
  font-weight: 800;
}

.drmagdy-code {
  display: inline-flex;
  margin-top: 12px;
  padding: 6px 10px;
  border: 1px dashed var(--dm-primary);
  border-radius: 9px;
  background: var(--dm-primary-soft);
  color: var(--dm-primary-dark);
  font-weight: 800;
}

.drmagdy-soft-section {
  background: var(--dm-soft);
}

.drmagdy-branch-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.drmagdy-branch-card p {
  margin: 0;
  color: var(--dm-muted);
  line-height: 1.7;
}

.drmagdy-branch-card a {
  color: var(--dm-primary-dark);
  font-weight: 700;
}

.drmagdy-faq-list {
  display: grid;
  gap: 12px;
  max-width: 880px;
}

.drmagdy-faq-list details {
  border: 1px solid var(--dm-border);
  border-radius: 14px;
  background: #fff;
  padding: 18px 20px;
}

.drmagdy-faq-list summary {
  cursor: pointer;
  color: var(--dm-ink);
  font-weight: 800;
}

.drmagdy-faq-list details > div {
  padding-top: 14px;
  color: var(--dm-muted);
  line-height: 1.8;
}

.drmagdy-contact-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  margin-block: 18px 72px;
  padding: 34px;
  border-radius: 22px;
  background: var(--dm-primary-dark);
  color: #fff;
}

.drmagdy-contact-strip h2,
.drmagdy-contact-strip .drmagdy-eyebrow {
  color: #fff;
}

.drmagdy-contact-strip .drmagdy-contact-actions {
  justify-content: flex-end;
  margin: 0;
}

.drmagdy-empty {
  padding: 36px;
  border: 1px dashed var(--dm-border);
  border-radius: 16px;
  color: var(--dm-muted);
  text-align: center;
}

@media (max-width: 991px) {
  .drmagdy-hero-inner {
    grid-template-columns: 1fr;
  }

  .drmagdy-hero-mark {
    display: none;
  }

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

  .drmagdy-promotion-grid,
  .drmagdy-branch-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .drmagdy-contact-strip {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 575px) {
  .drmagdy-home .container {
    width: min(100% - 22px, 1180px);
  }

  .drmagdy-hero {
    min-height: 460px;
  }

  .drmagdy-hero-inner,
  .drmagdy-section {
    padding-block: 48px;
  }

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

  .drmagdy-product-grid,
  .drmagdy-promotion-grid,
  .drmagdy-branch-grid {
    grid-template-columns: 1fr;
  }

  .drmagdy-contact-strip {
    margin-bottom: 48px;
    padding: 24px;
  }
}

/* Simplified pharmacy administration */
.dm-admin-page .layout-main-section {
  max-width: 1500px;
}

.dm-admin-page .page-head {
  border-bottom: 1px solid var(--border-color);
}

.dm-admin-tabs {
  position: sticky;
  top: 0;
  z-index: 5;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 0 0 22px;
  padding: 10px;
  border: 1px solid var(--border-color);
  border-radius: 16px;
  background: var(--card-bg, #fff);
  box-shadow: 0 10px 28px rgba(15, 118, 110, 0.08);
}

.dm-admin-tab {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--text-muted);
  font-weight: 700;
  transition: background 150ms ease, color 150ms ease;
}

.dm-admin-tab:hover,
.dm-admin-tab.is-active {
  background: #e8f8f5;
  color: #0f766e;
}

.dm-admin-tab-icon {
  display: inline-flex;
}

.dm-admin-body {
  min-height: 360px;
}

.dm-admin-state,
.dm-admin-empty,
.dm-admin-error {
  display: flex;
  min-height: 240px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 1px dashed var(--border-color);
  border-radius: 16px;
  background: var(--card-bg, #fff);
  text-align: center;
}

.dm-admin-empty {
  flex-direction: column;
}

.dm-admin-error {
  padding: 24px;
  color: var(--red-600, #dc2626);
}

.dm-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.dm-summary-grid article {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 18px;
  border: 1px solid var(--border-color);
  border-radius: 14px;
  background: var(--card-bg, #fff);
}

.dm-summary-grid strong {
  color: #0f766e;
  font-size: 1.6rem;
}

.dm-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border-color);
  border-radius: 16px;
  background: var(--card-bg, #fff);
}

.dm-admin-table {
  width: 100%;
  min-width: 980px;
  border-collapse: collapse;
}

.dm-admin-table th,
.dm-admin-table td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--border-color);
  text-align: start;
  vertical-align: middle;
}

.dm-admin-table th {
  background: var(--subtle-fg, #f7faf9);
  color: var(--text-muted);
  font-size: 0.78rem;
  white-space: nowrap;
}

.dm-product-cell {
  display: flex;
  min-width: 250px;
  align-items: center;
  gap: 12px;
}

.dm-product-cell img,
.dm-product-placeholder {
  width: 54px;
  height: 54px;
  flex: 0 0 54px;
  border-radius: 12px;
  background: #eff8f6;
  object-fit: cover;
}

.dm-product-placeholder {
  display: grid;
  place-items: center;
}

.dm-product-cell div {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.dm-product-cell small,
.dm-admin-table td small {
  display: block;
  color: var(--text-muted);
}

.dm-pill,
.dm-publish,
.dm-stock-badge,
.dm-order-status {
  display: inline-flex;
  width: max-content;
  align-items: center;
  justify-content: center;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 800;
}

.dm-pill {
  background: #e0f2fe;
  color: #0369a1;
}

.dm-pill-muted,
.dm-publish {
  background: #f1f5f9;
  color: #64748b;
}

.dm-publish.is-on {
  background: #dcfce7;
  color: #15803d;
}

.dm-stock-available {
  background: #dcfce7;
  color: #15803d;
}

.dm-stock-low {
  background: #fef3c7;
  color: #b45309;
}

.dm-stock-out {
  background: #fee2e2;
  color: #b91c1c;
}

.dm-row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.dm-admin-note {
  margin-bottom: 14px;
  padding: 12px 14px;
  border-radius: 12px;
  background: #e8f8f5;
  color: #115e59;
}

.dm-orders-list {
  display: grid;
  gap: 16px;
}

.dm-order-card {
  overflow: hidden;
  border: 1px solid var(--border-color);
  border-radius: 16px;
  background: var(--card-bg, #fff);
}

.dm-order-card > header,
.dm-order-card > footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
}

.dm-order-card > header {
  border-bottom: 1px solid var(--border-color);
}

.dm-order-card > header h3 {
  margin: 2px 0;
  font-size: 1rem;
}

.dm-order-card > footer {
  justify-content: flex-end;
  flex-wrap: wrap;
  border-top: 1px solid var(--border-color);
}

.dm-order-grid {
  display: grid;
  grid-template-columns: 1fr 0.8fr 1.4fr;
  gap: 18px;
  padding: 18px;
}

.dm-order-grid h4 {
  margin: 0 0 8px;
  font-size: 0.85rem;
}

.dm-order-grid p {
  margin: 3px 0;
}

.dm-order-items ul {
  display: grid;
  gap: 7px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.dm-order-items li {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.dm-order-total {
  color: #0f766e;
  font-size: 1.15rem;
  font-weight: 800;
}

.dm-order-new {
  background: #e0f2fe;
  color: #0369a1;
}

.dm-order-accepted,
.dm-order-preparing,
.dm-order-ready {
  background: #fef3c7;
  color: #a16207;
}

.dm-order-out_for_delivery {
  background: #ede9fe;
  color: #6d28d9;
}

.dm-order-delivered {
  background: #dcfce7;
  color: #15803d;
}

.dm-order-rejected {
  background: #fee2e2;
  color: #b91c1c;
}

.dm-settings-form {
  padding: 20px;
  border: 1px solid var(--border-color);
  border-radius: 16px;
  background: var(--card-bg, #fff);
}

.dm-settings-form.is-loading {
  opacity: 0.55;
  pointer-events: none;
}

.dm-pharmacy-return {
  position: fixed;
  inset-inline-end: 22px;
  bottom: 22px;
  z-index: 1040;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 42px;
  padding: 0 15px;
  border: 0;
  border-radius: 999px;
  background: #0f766e;
  color: #fff;
  font-weight: 800;
  box-shadow: 0 12px 28px rgba(15, 118, 110, 0.28);
}

@media (max-width: 767px) {
  .dm-admin-tabs,
  .dm-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dm-order-grid {
    grid-template-columns: 1fr;
  }

  .dm-admin-tab {
    font-size: 0.78rem;
  }
}
