/* Staff shell controls keep the desktop layout and share the existing profile image. */
.staffAccountToggle {
  display: none;
  border: 0;
  padding: 0;
  background: transparent;
  border-radius: 50%;
}

.staffAccountToggle:disabled {
  opacity: 1;
}

.staffMobileNavBar {
  display: none;
}

@media (max-width: 991.98px) {
  .app-shell,
  .app-shell-header,
  .app-shell-body,
  .app-main.mca,
  .staffMobileNavBar,
  .app-sidebar.sidenav,
  .notificationBellPanel,
  .app-shell-header .nameLogout.is-mobile-open {
    box-sizing: border-box;
  }

  /* Shared dimensions keep floating panels clear of the header on short screens. */
  .app-shell {
    --staff-header-height: 64px;
    --staff-page-gap: 12px;
    min-width: 0;
  }

  body {
    background: #f3f6fa;
    color: #172b4d;
    line-height: 1.5;
  }

  .app-shell {
    width: 100%;
    max-width: 100%;
    overflow: visible;
  }

  .app-shell-header {
    position: sticky;
    top: 0;
    z-index: 1040;
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    width: 100%;
    max-width: 100%;
    min-height: var(--staff-header-height);
    height: var(--staff-header-height);
    padding: 10px 16px;
    gap: 12px;
    overflow: visible;
    background: #202e4d;
    box-shadow: 0 2px 12px rgb(15 23 42 / 8%);
  }

  .app-shell-header .logo {
    flex: 1 1 auto;
    width: auto;
    gap: 0;
  }

  .app-shell-header .logo img {
    height: 42px;
    width: auto;
  }

  .app-shell-header .textlogo {
    display: none;
  }

  .app-shell-header .profile {
    flex: 0 0 auto;
    width: auto;
    min-width: 0;
    gap: 10px;
    margin: 0;
    padding: 0;
  }

  .headerNotificationCenter {
    margin: 0;
  }

  .notificationBellButton i {
    font-size: 0.9rem;
}

  .notificationBellButton {
    width: 30px;
    height: 30px;
    border-radius: 12px;
    box-shadow: none;
  }

  .app-shell-header .profPic img {
    width: 42px;
    height: 42px;
    border: 2px solid #d8e5f5;
  }

  .staffAccountToggle {
    display: inline-grid;
    place-items: center;
    min-width: 44px;
    min-height: 44px;
    color: #fff;
  }

  :is(.staffAccountToggle, #staffNavToggle):focus-visible {
    outline: 3px solid #91b5e6;
    outline-offset: 3px;
  }

  .staffMobileReady .app-shell-header .nameLogout {
    display: none;
  }

  .staffMobileReady .app-shell-header .nameLogout.is-mobile-open {
    display: flex;
    position: absolute;
    top: calc(100% + 8px);
    right: 12px;
    width: min(280px, calc(100vw - 24px));
    max-width: none;
    padding: 18px;
    align-items: stretch;
    gap: 10px;
    text-align: left;
    max-height: calc(100dvh - var(--staff-header-height) - 24px);
    overflow-y: auto;
    border: 1px solid #dce4ef;
    border-radius: 16px;
    background: white;
    box-shadow: 0 14px 36px rgb(15 23 42 / 18%);
  }

  .app-shell-header .nameLogout .textUsername {
    justify-content: flex-start;
  }

  .app-shell-header .nameLogout :is(h4, #user-position) {
    color: #172b4d;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .app-shell-header .nameLogout .btn {
    width: 100%;
    min-height: 44px;
    margin: 0;
  }

  .notificationBellPanel {
    position: fixed;
    top: calc(var(--staff-header-height) + 8px);
    left: auto;
    right: var(--staff-page-gap);
    width: min(360px, calc(100% - 24px));
    max-height: min(480px, 68dvh, calc(100dvh - var(--staff-header-height) - 24px));
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
    border-radius: 14px;
  }

  .notificationBellPanel[hidden] {
    display: none;
  }

  .notificationBellHeader {
    padding: 12px;
    gap: 8px;
    flex-wrap: wrap;
    flex-shrink: 0;
  }

  .notificationBellEyebrow {
    letter-spacing: .04em;
  }

  .notificationBellHeaderCount {
    padding: 5px 8px;
  }

  .notificationBellFilters {
    padding: 6px 12px;
    gap: 6px;
    flex-shrink: 0;
  }

  .notificationFilterButton {
    min-height: 36px;
    padding: 4px 12px;
  }

  .notificationBellList {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  .notificationBellHeader > div,
  .notificationBellItem :is(div, span) {
    min-width: 0;
    max-width: 100%;
    overflow-wrap: anywhere;
  }

  .notificationBellItem {
    padding: 10px 12px;
    line-height: 1.4;
    overflow-wrap: anywhere;
  }

  :is(.notificationBellItemTop, .notificationBellItemMeta, .notificationBellItemFoot) {
    gap: 6px;
    flex-wrap: wrap;
  }

  .notificationBellItemType {
    letter-spacing: .02em;
    gap: 5px;
  }

  .notificationBellItemSubject {
    margin-top: 5px;
    font-weight: 700;
    line-height: 1.35;
  }

  .notificationBellItemPreview {
    margin-top: 4px;
    line-height: 1.45;
  }

  .notificationBellItemMeta {
    margin-top: 6px;
  }

  .notificationBellItemFoot {
    margin-top: 6px;
  }

  .notificationBellItemBadge {
    padding: 4px 6px;
    line-height: 1.2;
  }

  .notificationBellEmptyState {
    min-height: 110px;
    padding: 16px;
    gap: 8px;
  }


  .staffMobileNavBar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 16px;
    gap: 12px;
    background: white;
    border-bottom: 1px solid #e0e7f0;
  }

  #staffMobilePageName {
    min-width: 0;
    font-weight: 700;
    overflow-wrap: anywhere;
  }

  #staffNavToggle {
    display: flex;
    flex-shrink: 0;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    padding: 8px 14px;
    border: 1px solid #dce4ef;
    background: #f3f6fa;
    border-radius: 10px;
    color: #243b60;
  }

  #staffNavToggle:hover {
    background: #d9e8fc;
  }

  .app-shell-body {
    position: relative;
    display: block;
    width: 100%;
    max-width: 100%;
    overflow: visible;
  }

  .announcementFeedEyebrow, .announcementFeedCardEyebrow {
    font-size: var(--ui-text-meta);
    line-height: 1.5;
  }

  .staffMobileReady .app-sidebar.sidenav {
    display: none !important;
  }

  .staffMobileReady .app-sidebar.sidenav.is-mobile-open {
    display: grid !important;
    position: absolute;
    top: 0;
    right: 12px;
    left: auto;
    z-index: 1030;
    grid-template-columns: minmax(0, 1fr);
    width: min(280px, calc(100% - 24px));
    max-width: calc(100% - 24px);
    max-height: calc(100dvh - 144px);
    overflow-y: auto;
    padding: 8px;
    gap: 4px;
    border: 1px solid #dce4ef;
    border-radius: 14px;
    box-shadow: 0 14px 36px rgb(15 23 42 / 18%);
  }

  .app-sidebar.sidenav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 10px 12px;
    gap: 8px;
    background: white;
    width: 100%;
    height: auto;
  }

  .app-sidebar.sidenav a {
    width: 100%;
    min-width: 0;
    min-height: 48px;
    margin: 0;
    padding: 10px;
    gap: 8px;
    white-space: normal;
    color: #334155;
    border-radius: 10px;
  }

  .app-sidebar.sidenav a:hover {
    background: #d9e8fc;
    color: #2456a6;
    transform: none;
  }

  .app-sidebar.sidenav .sidenav-link.active {
    background: #2e6de6 !important;
    color: white;
    box-shadow: none;
  }

  .app-sidebar.sidenav img {
    width: 24px;
    margin: 0;
  }

  .sidenavClock {
    display: none;
  }

  .app-main.mca {
    width: 100%;
    max-width: 100%;
    max-height: none;
    min-height: calc(100dvh - 125px);
    height: auto;
    display: block;
    z-index: auto;
    overflow: visible;
    border-radius: 0;
    background: #f3f6fa;
  }

  :is(.staffDashboardArea, .myShiftArea, .myAvailabilityShell, .staffProfileArea, .announcementFeedArea) {
    width: 100%;
    max-height: none;
    height: auto;
    padding: 12px;
    overflow: visible;
    background: transparent;
  }

  :is(.staffDashboardHero, .myShiftHero, .availabilityHero) {
    padding: 16px;
    border-radius: 16px;
    background: #263e65;
    box-shadow: none;
    gap: 10px;
    margin-bottom: 12px;
  }

  :is(.staffDashboardHeroCopy, .myShiftHeroCopy, .availabilityHeroCopy, .staffProfileHeader > div) {
    max-width: 100%;
    min-width: 0;
  }

  :is(.staffDashboardTitle, .myShiftTitle, .availabilityTitle, .staffProfileTitle, .announcementFeedTitle) {
    line-height: 1.3;
    margin-bottom: 8px;
  }

  :is(.staffDashboardSummaryGrid, .myShiftSummaryGrid, .staffDashboardMetricGrid, .availabilityHeroMetrics) {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  :is(.staffDashboardSummaryCard, .myShiftSummaryCard, .staffDashboardMetricCard, .myShiftHighlightCard) {
    min-width: 0;
    padding: 14px;
    border-radius: 14px;
    box-shadow: 0 2px 8px rgb(15 23 42 / 4%);
    overflow-wrap: anywhere;
  }

  :is(.staffDashboardSummaryLabel, .myShiftSummaryLabel, .staffDashboardMetricLabel) {
    line-height: 1.4;
  }

  :is(.staffDashboardSummaryValue, .myShiftSummaryValue, .staffDashboardMetricValue, .announcementFeedStat strong) {
    line-height: 1.2;
  }

  :is(.staffDashboardSummaryValue.is-text, .myShiftSummaryValue.is-text, .staffDashboardMetricValue.is-text) {
    line-height: 1.35;
  }

  :is(.staffDashboardBoard, .myShiftBoard, .availabilityBoard, .staffProfileBody) {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
    min-height: 0;
  }

  :is(.staffDashboardBoard, .myShiftBoard, .availabilityBoard, .staffProfileBody) > * {
    min-width: 0;
    max-width: 100%;
  }

  :is(.staffDashboardPanel, .myShiftListPane, .myShiftDetailPane, .availabilityCalendarPane, .availabilityControlPane, .staffProfileCard, .announcementFeedCard) {
    min-width: 0;
    border-radius: 16px;
    border: 1px solid #e0e7f0;
    background: white;
    box-shadow: 0 2px 8px rgb(15 23 42 / 3%);
  }

  :is(.staffDashboardShiftCard, .myShiftListCard, .announcementFeedCard) {
    overflow-wrap: anywhere;
  }

  :is(.myShiftList, .myShiftDetailPane) {
    height: auto;
    max-height: none;
    overflow: visible;
  }

  :is(.myShiftToolbar, .myShiftFilters, .announcementFeedFilters) {
    flex-wrap: wrap;
  }

  .myShiftModeBar {
    align-items: stretch;
    flex-direction: column;
    gap: 10px;
  }

  .myShiftModeSwitch {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
    padding: 4px;
    gap: 4px;
    border-radius: 14px;
    box-shadow: none;
  }

  .myShiftModeButton {
    min-width: 0;
    padding: 8px;
    border-radius: 10px;
    white-space: normal;
  }

  :is(.myShiftFilter, .myShiftModeButton, .announcementFeedFilter) {
    min-height: 42px;
  }

  :is(.staffDashboardHeroAction, .myShiftHeroAction) {
    min-width: 0;
  }

  .staffDashboardPanelBtn {
    min-height: 42px;
  }

  .staffProfileCard {
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
  }

  /* Compact staff profile, including the 393px iPhone viewport. Scoped tokens
     preserve the current typography on the other pages. */
  .staffProfileArea {
    --ui-text-page: 1rem;
    --ui-text-section: .875rem;
    --ui-text-body: .75rem;
    --ui-text-label: .8125rem;
    --ui-text-meta: .625rem;
    --ui-text-input: .875rem;
    --ui-text-stat: 1rem;
    font-size: var(--ui-text-body);
  }

  .panel-body {
    padding: 0 20px;
  }

  .announcementFeedHeader, .announcementFeedStats, .announcementFeedToolbar {
    margin-bottom: 10px;
  }

  .announcementFeedList, .announcementFeedCardTop, .announcementFeedHeader, .announcementFeedToolbar{
    gap: 8px;
  }

  .announcementFeedStatusBadge, .announcementFeedResponseBadge, .announcementFeedReadBadge, .announcementFeedPinnedBadge, .announcementFeedAckStatusBadge {
    font-size: var(--ui-text-meta);
  }

  .staffProfileArea .staffProfileHeader {
    padding: 0;
    margin-bottom: 8px;
    display: flex;
    align-items: end;
  }

  .staffProfileArea .staffProfileHeader .staffProfileActions {
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
    width: 50%;
    min-width: min(100%, 224px);
    max-width: 100%;
    gap: 6px;
    align-items: stretch;
  }

  .staffProfileArea .staffProfileActions .btn {
    min-height: 34px;
    padding: 4px 8px;
    border-radius: 7px;
    font-size: .75rem;
    line-height: 1.25;
    white-space: nowrap;
  }

  .staffProfileArea .staffProfileActions .btn i {
    display: none;
  }

  .staffProfileArea .staffProfileBody,
  .staffProfileArea .staffProfileSections {
    gap: 8px;
  }

  .staffProfileArea .staffProfileSection,
  .staffProfileArea .staffProfileSection:first-child {
    padding: 10px;
    border-radius: 10px;
  }

  .staffProfileArea .staffProfileSectionTitle {
    margin-bottom: 8px;
  }

  .staffProfileArea .staffProfileGrid {
    gap: 8px 6px;
  }

  .staffProfileArea .staffProfileField {
    gap: 3px;
  }

  .staffProfileArea .staffProfileField :is(.form-control, .form-select) {
    height: auto;
    min-height: 32px;
    padding: 4px 5px;
    border-radius: 7px;
    line-height: 1.4;
  }

  .staffProfileArea .staffProfileGrid.staffProfilePersonalGrid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }

  .staffProfilePersonalGrid > .staffProfileField {
    grid-column: span 2;
  }

  /* Give the date picker room while keeping DOB, age and sex on one row. */
  .staffProfilePersonalGrid > .staffProfileField:nth-child(4) { grid-column: span 3; }
  .staffProfilePersonalGrid > .staffProfileField:nth-child(5) { grid-column: span 1; }
  .staffProfilePersonalGrid > .staffProfileField:nth-child(n + 7) { grid-column: span 3; }

  .staffProfileArea .staffProfileGrid.staffProfileCredentialGrid,
  .staffProfileArea .staffProfileGrid.staffProfileAddressGrid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .staffProfileAddressGrid > .staffProfileField:first-child,
  .staffProfileAddressGrid > .staffProfileField:last-child {
    grid-column: 1 / -1;
  }

  .staffProfileHeader {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    padding: 4px 2px;
    margin-bottom: 12px;
  }

  .staffProfileHeader > div {
    width: 100%;
  }

  .staffProfileSidebar {
    padding: 14px;
    border-radius: 14px;
    background: #263e65;
    box-shadow: none;
  }

  .staffProfileCardGroup {
    display: grid;
    grid-template-columns: 64px minmax(0, 1fr);
    width: 100%;
    gap: 4px 12px;
  }

  .staffProfileCardGroup .staffProfileImageWrap {
    grid-row: span 2;
    width: 64px;
    height: 64px;
    margin: 0;
  }

  .staffProfileName {
    text-align: left;
    overflow-wrap: anywhere;
  }

  .staffProfileRoleBadge {
    justify-self: start;
    margin: 0;
    padding: 4px 10px;
  }

  .staffProfileCardGroup :is(input, button, small) {
    grid-column: 1 / -1;
  }

  .staffProfileLogo {
    display: none;
  }

  :is(.staffProfileGrid, .staffProfileGrid.staffProfileThreeColumn) {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
  }

  .staffProfileSections {
    gap: 12px;
  }

  .staffProfileSection,
  .staffProfileSection:first-child {
    padding: 14px;
    border: 1px solid #e0e7f0;
    border-radius: 14px;
    background: white;
  }

  .staffProfileSectionTitle {
    margin-bottom: 12px;
  }

  .staffProfileField {
    min-width: 0;
    gap: 5px;
  }

  .staffProfileFieldWide {
    grid-column: 1 / -1;
  }

  .staffProfileField :is(.form-control, .form-select) {
    width: 100%;
    min-width: 0;
    min-height: 42px;
    padding: 8px 10px;
    border-radius: 9px;
  }

  .staffProfileField :is(.form-control, .form-select):disabled {
    color: #334155;
    background: #f5f7fa;
    opacity: 1;
    -webkit-text-fill-color: #334155;
  }

  .staffProfileActions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
    gap: 8px;
  }

  .staffProfileActions .btn {
    width: 100%;
    min-width: 0;
    min-height: 44px;
    padding: 8px 10px;
    border-radius: 10px;
    white-space: normal;
  }

  .staffProfileForm .staffCredentialHcaActions {
    flex-wrap: wrap;
    min-width: 0;
  }


  .availabilityCalendarFrame {
    padding: 4px;
    border: 0;
  }

  .myAvailabilityShell #calendar {
    width: 100%;
    max-height: none;
    margin: 0;
    padding: 0;
  }

  .myAvailabilityShell .fc .fc-button {
    min-height: 40px;
    padding: 6px 10px;
  }

  .myAvailabilityShell .fc-day:hover {
    transform: none;
  }

  .announcementFeedStats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }

  .announcementFeedStat {
    padding: 12px;
    min-width: 0;
  }

  .announcementFeedFilters {
    overflow: visible;
    width: 100%;
  }

  .announcementFeedFilter {
    flex: 1 1 auto;
  }

  .announcementFeedSearch {
    width: 100%;
    min-width: 0;
  }

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

  .announcementFeedCardTop > *, .announcementFeedToolbar > * {
    min-width: 0;
    max-width: 100%;
  }

  .modal-dialog {
    margin: 10px auto;
    width: calc(100% - 20px);
    max-width: 560px;
  }

  /* A compact, consistent type scale across every staff view. Keep input text
  at 16px above so focusing a field does not zoom the page on iOS. */
  :is(.staffDashboardPanelHeader h3, .availabilityPaneHeader h3,
  .availabilitySectionHeader h4, .availabilitySelectedCard h3,
  .myShiftSectionTitle, .myShiftDetailSection h4, .myShiftDetailPlaceholder h4,
  .staffProfileSectionTitle, .announcementFeedCardTitle) {
    line-height: 1.4;
  }

  :is(.staffDashboardSubtitle, .myShiftSubtitle, .availabilitySubtitle,
  .announcementFeedSubtitle, .announcementFeedBody,
  .staffDashboardPanelHeader p, .availabilityPaneHeader p) {
    line-height: 1.55;
  }

  :is(.staffDashboardSummaryMeta, .myShiftSummaryMeta, .staffDashboardMetricMeta,
  .availabilityHeroMetric small, .myShiftModeMeta, .myShiftSectionMeta,
  .announcementFeedCardPostTime) {
    line-height: 1.5;
  }

  :is(.staffDashboardShiftHospital, .myShiftListHospital, .myShiftHighlightValue,
  .availabilityHeroMetric strong) {
    line-height: 1.35;
  }

  :is(.staffProfileField label, .staffCredentialTitle, .staffCredentialSectionTitle) {
    line-height: 1.4;
  }



  .notificationBellTitle {
    line-height: 1.35;
    margin-top: 3px;
  }


}

@media (min-width: 600px) and (max-width: 991.98px) {
  .staffProfileArea {
    max-width: 820px;
    margin-inline: auto;
  }

  :is(.staffProfileGrid, .staffProfileGrid.staffProfileThreeColumn) {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
  }

  .staffProfileActions {
    max-width: 400px;
  }
}

@media (max-width: 359.98px) {
  .app-shell-header {
    padding-inline: 12px;
  }

  :is(.staffDashboardArea, .myShiftArea, .myAvailabilityShell, .staffProfileArea, .announcementFeedArea) {
    padding: 10px;
  }

  :is(.staffDashboardSummaryCard, .myShiftSummaryCard, .staffDashboardMetricCard) {
    padding: 10px;
  }

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

}
