/* Shared page shell: consistent desktop identity header and content width. */
:root {
  --portal-content-max: 1480px;
}

@media (min-width: 769px) {
  body:not(.auth-view) #page-heading-row,
  body:not(.auth-view) #tab-content {
    width: 100%;
    max-width: var(--portal-content-max);
    margin-left: auto;
    margin-right: auto;
  }

  body:not(.auth-view) #page-heading-row {
    min-height: 76px;
    margin-bottom: 24px !important;
    align-items: center !important;
  }

  body:not(.auth-view) #page-heading-copy-wrap {
    min-height: 72px;
    align-items: center !important;
    gap: 16px !important;
  }

  body:not(.auth-view) #page-user-photo {
    display: flex !important;
    width: 64px !important;
    height: 64px !important;
    flex: 0 0 64px !important;
    border: 3px solid #fff !important;
    outline: 1px solid #dbe5f0 !important;
    font-size: 17px !important;
  }

  body:not(.auth-view) #page-title > span:first-child {
    margin-bottom: 3px !important;
    color: #526078 !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    line-height: 1.2 !important;
  }

  body:not(.auth-view) #page-title > span:last-child {
    color: #10213d !important;
    font-size: 21px !important;
    font-weight: 700 !important;
    line-height: 1.15 !important;
    letter-spacing: 0 !important;
  }

  body:not(.auth-view) #page-designation {
    margin-top: 5px !important;
    color: #17243a !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    line-height: 1.25 !important;
  }

  body:not(.auth-view) #page-date {
    margin-top: 3px !important;
    color: #667085 !important;
    font-size: 12px !important;
    font-weight: 400 !important;
    line-height: 1.25 !important;
  }

  /* The primary photo now belongs beside the greeting; remove the duplicate block. */
  body:not(.auth-view) #page-heading-meta {
    display: none !important;
  }

  /* Attendance and Leave now share the same outer content boundaries. */
  body.operations-employee-attendance-view .ops-attendance-screen,
  body.operations-employee-leave-view .ops-leave-page {
    width: 100%;
    max-width: none;
    margin-left: 0;
    margin-right: 0;
  }

  body.operations-employee-leave-view .ops-leave-page {
    padding: 0 0 42px;
  }

  body.employee-profile-progressive-view .pp-overview {
    max-width: none;
  }

  /* Desktop already has the shared employee greeting above the page. */
  body.employee-profile-progressive-view .pp-overview > .pp-person {
    display: none !important;
  }
}

@media (max-width: 768px) {
  /*
   * The Back/Home pill is fixed to the viewport. Reserve its complete footprint
   * in the actual tab content (not only .main-content) so every screen can
   * scroll its final card or action fully above the navigation control.
   */
  body.mobile-navigation-floater-visible:not(.auth-view) #tab-content {
    box-sizing: border-box;
    padding-bottom: calc(142px + env(safe-area-inset-bottom, 0px)) !important;
    scroll-padding-bottom: calc(142px + env(safe-area-inset-bottom, 0px));
  }

  body.mobile-navigation-floater-visible:not(.auth-view) .mobile-navigation-floater {
    z-index: 390;
  }

  /* Full-screen workbenches and dialogs own the viewport while open. */
  body:has(.modal-overlay.open) .mobile-navigation-floater,
  body:has(.gps-overlay.open) .mobile-navigation-floater,
  body:has(.ac-detail.open) .mobile-navigation-floater,
  body:has(.omt-detail.open) .mobile-navigation-floater {
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
  }

  /* Mobile navigation already supplies Back and Home at the bottom. */
  body:not(.auth-view) .hrms-group-back-row {
    display: none !important;
  }

  body:not(.auth-view) #page-heading-meta {
    display: none !important;
  }
}
