@import url("https://fonts.googleapis.com/css2?family=IBM+Plex+Sans+Arabic:wght@600;700&family=Tajawal:wght@500;700;800;900&display=swap");

/*
 * RIFD shell redesign
 * Scope: manager top navigation + portal landing hero + department sub-tabs
 * Icon source: Lucide Static 1.27.0, 2px outlined set (ISC)
 * Revision: 20260727-4
 */

:root {
  --rifd-navy: #1b3a6b;
  --rifd-navy-deep: #11294f;
  --rifd-mint: #33d6a6;
  --rifd-gold: #e8b84b;
  --rifd-icon-neutral: #5a6472;
  --rifd-nav-hover: #33d6a610;
}

/* ─────────────────────────────────────────────────────────────
   Manager top navigation
   ───────────────────────────────────────────────────────────── */

.portal-shell .topbar {
  gap: clamp(12px, 1.6vw, 24px);
  padding-inline: clamp(16px, 2.4vw, 38px);
}

.portal-shell
  .topbar
  nav[aria-label="التنقل الرئيسي"][data-rifd-redesigned="true"] {
  direction: rtl;
  display: flex;
  flex: 0 1 auto;
  align-items: stretch;
  justify-content: flex-start;
  min-width: 0;
  max-width: min(78vw, 1060px);
  gap: 24px;
  padding: 7px 10px;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scroll-padding-inline: 10px;
  scroll-snap-type: inline proximity;
  scrollbar-width: none;
  border: 1px solid rgba(27, 58, 107, 0.1);
  border-radius: 18px;
  background: rgba(250, 252, 255, 0.86);
  box-shadow:
    0 7px 22px rgba(27, 58, 107, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.92);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}

.portal-shell
  .topbar
  nav[aria-label="التنقل الرئيسي"][data-rifd-redesigned="true"]::-webkit-scrollbar {
  display: none;
}

.portal-shell
  .topbar
  nav[aria-label="التنقل الرئيسي"][data-rifd-redesigned="true"]
  > button {
  --rifd-tab-icon: url("/assets/icons/manager/layout-grid.svg");

  position: relative;
  display: inline-flex;
  flex: 0 0 68px;
  width: 68px;
  min-width: 68px;
  height: 68px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 7px 5px;
  overflow: visible;
  border: 1px solid transparent;
  border-radius: 14px;
  background: transparent;
  color: var(--rifd-icon-neutral);
  box-shadow: none;
  font-family: "Tajawal", "IBM Plex Sans Arabic", Arial, sans-serif;
  font-size: 10.5px;
  font-weight: 700;
  line-height: 1.15;
  text-align: center;
  text-wrap: balance;
  white-space: normal;
  scroll-snap-align: start;
  cursor: pointer;
  transition:
    color 150ms ease,
    background-color 150ms ease,
    border-color 150ms ease,
    box-shadow 150ms ease,
    transform 150ms ease;
}

.portal-shell
  .topbar
  nav[aria-label="التنقل الرئيسي"][data-rifd-redesigned="true"]
  > button::before {
  content: "";
  display: block;
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  background-color: currentColor;
  opacity: 1;
  -webkit-mask: var(--rifd-tab-icon) center / contain no-repeat;
  mask: var(--rifd-tab-icon) center / contain no-repeat;
}

.portal-shell
  .topbar
  nav[aria-label="التنقل الرئيسي"][data-rifd-redesigned="true"]
  > button::after,
.portal-shell
  .topbar
  nav[aria-label="التنقل الرئيسي"][data-rifd-redesigned="true"]
  > button
  > svg {
  display: none;
}

.portal-shell
  .topbar
  nav[aria-label="التنقل الرئيسي"][data-rifd-redesigned="true"]
  > button:hover:not(.active):not([aria-current="page"]):not(
    [data-rifd-selected="true"]
  ) {
  border-color: rgba(51, 214, 166, 0.14);
  background: var(--rifd-nav-hover);
  color: var(--rifd-navy);
  box-shadow: none;
  transform: translateY(-1px);
}

.portal-shell
  .topbar
  nav[aria-label="التنقل الرئيسي"][data-rifd-redesigned="true"]
  > button.active,
.portal-shell
  .topbar
  nav[aria-label="التنقل الرئيسي"][data-rifd-redesigned="true"]
  > button[aria-current="page"],
.portal-shell
  .topbar
  nav[aria-label="التنقل الرئيسي"][data-rifd-redesigned="true"]
  > button[data-rifd-selected="true"] {
  border-color: transparent;
  background: linear-gradient(145deg, var(--rifd-navy), var(--rifd-navy-deep));
  color: #fff;
  box-shadow: 0 2px 8px rgba(27, 58, 107, 0.25);
  transform: none;
}

/* Add-on panels leave the React "Departments" tab active underneath.
   When an add-on is selected, visually demote that stale core state so
   exactly one navigation item is highlighted. */
.portal-shell
  .topbar
  nav[aria-label="التنقل الرئيسي"][data-rifd-redesigned="true"]:has(
    > button[data-rifd-selected="true"]
  )
  > button.active:not([data-rifd-selected="true"]),
.portal-shell
  .topbar
  nav[aria-label="التنقل الرئيسي"][data-rifd-redesigned="true"]:has(
    > button[data-rifd-selected="true"]
  )
  > button[aria-current="page"]:not([data-rifd-selected="true"]) {
  border-color: transparent;
  background: transparent;
  color: var(--rifd-icon-neutral);
  box-shadow: none;
  transform: none;
}

.portal-shell
  .topbar
  nav[aria-label="التنقل الرئيسي"][data-rifd-redesigned="true"]
  > button:focus-visible {
  outline: 3px solid rgba(51, 214, 166, 0.42);
  outline-offset: 3px;
}

/* RTL visual order: first item is the right-most item. */
.portal-shell .topbar [data-rifd-nav-key="calendar"] {
  order: 1;
}

.portal-shell .topbar [data-rifd-nav-key="announcements"] {
  order: 2;
}

.portal-shell .topbar [data-rifd-nav-key="risk"] {
  order: 3;
}

.portal-shell .topbar [data-rifd-nav-key="settings"] {
  order: 4;
}

.portal-shell .topbar [data-rifd-nav-key="reports"] {
  order: 5;
}

.portal-shell .topbar [data-rifd-nav-key="command-center"] {
  order: 6;
}

.portal-shell .topbar [data-rifd-nav-key="audit"] {
  order: 7;
}

.portal-shell .topbar [data-rifd-nav-key="employees"] {
  order: 8;
}

.portal-shell .topbar [data-rifd-nav-key="departments"] {
  order: 9;
}

.portal-shell .topbar [data-rifd-nav-key="departments"] {
  --rifd-tab-icon: url("/assets/icons/manager/layout-grid.svg") !important;
}

.portal-shell .topbar [data-rifd-nav-key="employees"] {
  --rifd-tab-icon: url("/assets/icons/manager/users-round.svg") !important;
}

.portal-shell .topbar [data-rifd-nav-key="audit"] {
  --rifd-tab-icon: url("/assets/icons/manager/scroll-text.svg") !important;
}

.portal-shell .topbar [data-rifd-nav-key="command-center"] {
  --rifd-tab-icon: url("/assets/icons/manager/layout-dashboard.svg") !important;
}

.portal-shell .topbar [data-rifd-nav-key="reports"] {
  --rifd-tab-icon: url("/assets/icons/manager/chart-no-axes-combined.svg") !important;
}

.portal-shell .topbar [data-rifd-nav-key="settings"] {
  --rifd-tab-icon: url("/assets/icons/manager/settings-2.svg") !important;
}

.portal-shell .topbar [data-rifd-nav-key="risk"] {
  --rifd-tab-icon: url("/assets/icons/manager/triangle-alert.svg") !important;
}

.portal-shell .topbar [data-rifd-nav-key="announcements"] {
  --rifd-tab-icon: url("/assets/icons/manager/megaphone.svg") !important;
}

.portal-shell .topbar [data-rifd-nav-key="calendar"] {
  --rifd-tab-icon: url("/assets/icons/manager/calendar-days.svg") !important;
}

.portal-shell
  .topbar
  nav[aria-label="التنقل الرئيسي"][data-rifd-redesigned="true"]
  .ann-unread-dot {
  inset-block-start: 7px;
  inset-inline-end: 7px;
  width: 8px;
  height: 8px;
  border: 2px solid #fff;
  background: var(--rifd-gold);
  box-shadow: 0 0 0 2px rgba(232, 184, 75, 0.18);
}

/* ─────────────────────────────────────────────────────────────
   Landing hero
   ───────────────────────────────────────────────────────────── */

.portal-shell .hero[data-rifd-redesigned="true"] {
  z-index: 3;
  min-height: calc(100svh - 159px);
  padding: 28px 5vw 18px;
  font-family: "Tajawal", "IBM Plex Sans Arabic", Arial, sans-serif;
}

.portal-shell .hero[data-rifd-redesigned="true"] .hero-heading {
  width: min(1120px, 94vw);
  padding: 17px clamp(18px, 3vw, 34px) 19px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 18px;
  background: var(--rifd-navy);
  box-shadow: 0 14px 32px rgba(7, 23, 80, 0.24);
  color: #fff;
  text-align: center;
  text-shadow: 0 3px 14px rgba(7, 23, 80, 0.28);
}

.portal-shell .hero[data-rifd-redesigned="true"] .eyebrow {
  padding: 7px 14px;
  border: 1px solid rgba(51, 214, 166, 0.28);
  border-radius: 999px;
  background: rgba(51, 214, 166, 0.12);
  color: #b9ffea;
  box-shadow: none;
  font-size: 11px;
  font-weight: 700;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

.portal-shell .hero[data-rifd-redesigned="true"] h1 {
  margin: 9px 0 0;
  color: #fff;
  font-family: "Tajawal", "IBM Plex Sans Arabic", Arial, sans-serif;
  font-size: clamp(36px, 4.3vw, 64px);
  font-weight: 900;
  letter-spacing: 0.012em;
  line-height: 1.16;
  text-wrap: balance;
  text-shadow: 0 4px 18px rgba(5, 18, 53, 0.3);
}

.portal-shell .hero[data-rifd-redesigned="true"] h1 em {
  color: #fff;
  background: none;
  -webkit-background-clip: initial;
  background-clip: initial;
  -webkit-text-fill-color: #fff;
  font-style: normal;
  font-weight: 900;
}

.portal-shell .hero[data-rifd-redesigned="true"] .hero-heading p {
  margin: 8px 0 0;
  color: rgba(255, 255, 255, 0.84);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.7;
}

.portal-shell .hero[data-rifd-redesigned="true"] .departments-stage {
  direction: rtl;
  perspective: none;
  flex: 0 0 auto;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-template-rows: repeat(2, minmax(178px, auto));
  align-content: stretch;
  gap: 24px;
  width: min(1120px, 94vw);
  min-height: 0;
  margin: 18px auto 0;
}

.portal-shell .hero[data-rifd-redesigned="true"] .stage-light {
  display: none;
}

.portal-shell .hero[data-rifd-redesigned="true"] .department {
  --rifd-card-accent: var(--rifd-mint);
  --rifd-card-position: 50% 44%;
  --rifd-service-icon: url("/assets/icons/manager/layout-grid.svg");

  isolation: isolate;
  grid-template-columns: 44px minmax(0, 1fr) 36px;
  align-items: center;
  column-gap: 8px;
  row-gap: 0;
  min-height: 178px;
  padding: 54px 20px 20px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 24px;
  background:
    linear-gradient(
      132deg,
      rgba(27, 58, 107, 0.96) 0%,
      rgba(27, 58, 107, 0.86) 55%,
      rgba(51, 214, 166, 0.68) 145%
    ),
    url("/hospital.jpeg") var(--rifd-card-position) / cover no-repeat !important;
  filter: none !important;
  opacity: 1 !important;
  box-shadow:
    0 14px 28px rgba(7, 23, 80, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.16);
  transform: none !important;
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    box-shadow 180ms ease;
}

.portal-shell .hero[data-rifd-redesigned="true"] .department::before,
.portal-shell .hero[data-rifd-redesigned="true"] .department::after,
.portal-shell .hero[data-rifd-redesigned="true"] .card-sheen {
  display: none;
}

.portal-shell .hero[data-rifd-redesigned="true"] .department:hover,
.portal-shell .hero[data-rifd-redesigned="true"] .department:focus-visible,
.portal-shell
  .hero[data-rifd-redesigned="true"]
  .department[data-rifd-subtab-selected="true"] {
  z-index: 2;
  border-color: rgba(51, 214, 166, 0.72);
  outline: none;
  box-shadow:
    0 18px 36px rgba(7, 23, 80, 0.26),
    0 0 0 3px rgba(51, 214, 166, 0.13);
  transform: translateY(-4px) !important;
}

.portal-shell
  .hero[data-rifd-redesigned="true"]
  .department[data-rifd-coming-soon="true"]:hover {
  transform: none !important;
}

.portal-shell .hero[data-rifd-redesigned="true"] .dept-number {
  position: absolute;
  top: 16px;
  right: 16px;
  left: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 39px;
  min-height: 25px;
  padding: 4px 9px;
  border-radius: 999px;
  background: var(--rifd-navy);
  color: var(--rifd-mint);
  font-family: "IBM Plex Sans Arabic", "Tajawal", Arial, sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 1;
  box-shadow: 0 4px 12px rgba(5, 18, 53, 0.22);
}

.portal-shell .hero[data-rifd-redesigned="true"] .dept-icon {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 0;
  border-radius: 12px;
  background: var(--rifd-card-accent);
  color: #fff;
  box-shadow: 0 6px 16px rgba(5, 18, 53, 0.24);
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

.portal-shell .hero[data-rifd-redesigned="true"] .dept-icon::before {
  content: "";
  display: block;
  width: 25px;
  height: 25px;
  background-color: #fff;
  -webkit-mask: var(--rifd-service-icon) center / contain no-repeat;
  mask: var(--rifd-service-icon) center / contain no-repeat;
}

.portal-shell .hero[data-rifd-redesigned="true"] .dept-icon svg {
  display: none;
}

.portal-shell .hero[data-rifd-redesigned="true"] .dept-copy {
  min-width: 0;
  align-self: center;
}

.portal-shell .hero[data-rifd-redesigned="true"] .dept-copy small,
.portal-shell .hero[data-rifd-redesigned="true"] .dept-copy strong {
  display: block;
}

.portal-shell .hero[data-rifd-redesigned="true"] .dept-copy small {
  color: rgba(255, 255, 255, 0.74);
  font-size: 10px;
  font-weight: 500;
  line-height: 1.45;
}

.portal-shell .hero[data-rifd-redesigned="true"] .dept-copy strong {
  margin-top: 6px;
  color: #fff;
  font-size: 20px;
  font-weight: 800;
  line-height: 1.35;
  text-shadow: 0 2px 10px rgba(5, 18, 53, 0.24);
}

.portal-shell .hero[data-rifd-redesigned="true"] .dept-arrow {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 18px;
}

.portal-shell .hero[data-rifd-redesigned="true"] .rifd-module-status {
  position: absolute;
  top: 16px;
  right: auto;
  bottom: auto;
  left: 16px;
  z-index: 3;
  padding: 6px 11px;
  border: 0 !important;
  border-radius: 999px;
  background: var(--rifd-navy) !important;
  color: #fff !important;
  font-family: "Tajawal", "IBM Plex Sans Arabic", Arial, sans-serif !important;
  font-size: 10px !important;
  font-weight: 800 !important;
  line-height: 1 !important;
  box-shadow: 0 4px 12px rgba(5, 18, 53, 0.25);
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
}

/* Small, intentional category accents. The card treatment stays identical. */
.portal-shell
  .hero[data-rifd-redesigned="true"]
  .department[data-rifd-service="physio"] {
  --rifd-card-accent: #33d6a6;
  --rifd-card-position: 18% 44%;
  --rifd-service-icon: url("/assets/icons/departments/dumbbell.svg");
}

.portal-shell
  .hero[data-rifd-redesigned="true"]
  .department[data-rifd-service="nutrition"] {
  --rifd-card-accent: #e8b84b;
  --rifd-card-position: 34% 44%;
  --rifd-service-icon: url("/assets/icons/departments/apple.svg");
}

.portal-shell
  .hero[data-rifd-redesigned="true"]
  .department[data-rifd-service="ambulance"] {
  --rifd-card-accent: #e86f6f;
  --rifd-card-position: 48% 44%;
  --rifd-service-icon: url("/assets/icons/departments/ambulance.svg");
}

.portal-shell
  .hero[data-rifd-redesigned="true"]
  .department[data-rifd-service="pharmacy"] {
  --rifd-card-accent: #4aa6d9;
  --rifd-card-position: 62% 44%;
  --rifd-service-icon: url("/assets/icons/departments/pill.svg");
}

.portal-shell
  .hero[data-rifd-redesigned="true"]
  .department[data-rifd-service="sterile"] {
  --rifd-card-accent: #7587d9;
  --rifd-card-position: 76% 44%;
  --rifd-service-icon: url("/assets/icons/departments/shield-check.svg");
}

.portal-shell
  .hero[data-rifd-redesigned="true"]
  .department[data-rifd-service="social"] {
  --rifd-card-accent: #4db9aa;
  --rifd-card-position: 90% 44%;
  --rifd-service-icon: url("/assets/icons/departments/heart-handshake.svg");
}

.portal-shell .hero[data-rifd-redesigned="true"] .impact-strip {
  display: grid;
  grid-template-columns: repeat(5, auto);
  align-items: center;
  justify-content: center;
  gap: clamp(13px, 2vw, 26px);
  width: min(1120px, 94vw);
  margin: 14px auto 0;
  padding: 12px clamp(16px, 3vw, 30px);
  border: 1px solid rgba(51, 214, 166, 0.22);
  border-radius: 16px;
  background: var(--rifd-navy);
  box-shadow: 0 10px 24px rgba(7, 23, 80, 0.2);
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

.portal-shell .hero[data-rifd-redesigned="true"] .impact-strip div {
  display: flex;
  align-items: center;
  gap: 9px;
}

.portal-shell .hero[data-rifd-redesigned="true"] .impact-strip strong {
  color: var(--rifd-mint);
  font-family: "IBM Plex Sans Arabic", "Tajawal", Arial, sans-serif;
  font-size: 11px;
  font-weight: 700;
}

.portal-shell .hero[data-rifd-redesigned="true"] .impact-strip span {
  color: #fff;
  font-size: 11px;
  font-weight: 700;
}

.portal-shell .hero[data-rifd-redesigned="true"] .impact-strip > i {
  width: 1px;
  height: 22px;
  background: rgba(255, 255, 255, 0.2);
}

@media (max-width: 1180px) and (min-width: 901px) {
  .portal-shell
    .topbar
    nav[aria-label="التنقل الرئيسي"][data-rifd-redesigned="true"] {
    max-width: min(70vw, 850px);
  }
}

@media (max-width: 1020px) {
  .portal-shell .hero[data-rifd-redesigned="true"] .departments-stage {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: none;
    gap: 18px;
  }
}

@media (max-width: 900px) {
  .portal-shell
    .topbar
    nav[aria-label="التنقل الرئيسي"][data-rifd-redesigned="true"] {
    display: none;
  }

  .portal-shell .hero[data-rifd-redesigned="true"] {
    padding-inline: 16px;
  }

  .portal-shell .hero[data-rifd-redesigned="true"] .hero-heading,
  .portal-shell .hero[data-rifd-redesigned="true"] .departments-stage,
  .portal-shell .hero[data-rifd-redesigned="true"] .impact-strip {
    width: 100%;
  }
}

@media (max-width: 650px) {
  .portal-shell .hero[data-rifd-redesigned="true"] {
    padding: 18px 12px 14px;
  }

  .portal-shell .hero[data-rifd-redesigned="true"] .hero-heading {
    padding: 15px 14px 17px;
    border-radius: 16px;
  }

  .portal-shell .hero[data-rifd-redesigned="true"] h1 {
    font-size: clamp(31px, 10vw, 42px);
    letter-spacing: 0;
  }

  .portal-shell .hero[data-rifd-redesigned="true"] .hero-heading p {
    font-size: 11px;
  }

  .portal-shell .hero[data-rifd-redesigned="true"] .departments-stage {
    grid-template-columns: 1fr;
    gap: 13px;
    margin-top: 13px;
  }

  .portal-shell .hero[data-rifd-redesigned="true"] .department {
    min-height: 156px;
    padding: 50px 17px 17px;
    border-radius: 20px;
  }

  .portal-shell .hero[data-rifd-redesigned="true"] .impact-strip {
    gap: 8px;
    padding: 10px 8px;
    border-radius: 14px;
  }

  .portal-shell .hero[data-rifd-redesigned="true"] .impact-strip div {
    gap: 5px;
  }

  .portal-shell .hero[data-rifd-redesigned="true"] .impact-strip strong,
  .portal-shell .hero[data-rifd-redesigned="true"] .impact-strip span {
    font-size: 9px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .portal-shell
    .topbar
    nav[aria-label="التنقل الرئيسي"][data-rifd-redesigned="true"]
    > button,
  .portal-shell .hero[data-rifd-redesigned="true"] .department {
    transition: none;
  }
}
