/* ==========================================================
   F15.20.48 — Users UI Polish + Sidebar Navigation Scroll
   Presentation only.
   ========================================================== */

/* ==========================================================
   A. SIDEBAR
   Keep brand + footer visible.
   Only module/navigation list scrolls.
   ========================================================== */

.sidebar {
  height: 100dvh !important;
  max-height: 100dvh !important;

  display: flex !important;
  flex-direction: column !important;

  overflow: hidden !important;
}

.sidebar > .brand {
  flex: 0 0 auto !important;
}

.sidebar > .nav-menu {
  flex: 1 1 auto !important;

  min-height: 0 !important;
  max-height: none !important;

  overflow-y: auto !important;
  overflow-x: hidden !important;

  overscroll-behavior: contain;
  scrollbar-gutter: stable;

  padding-bottom: 14px !important;
}

.sidebar > .sidebar-footer {
  flex: 0 0 auto !important;

  margin-top: 0 !important;

  border-top: 1px solid var(--border);
  background: inherit;
}

/* subtle top/bottom separation when nav is scrolling */
.sidebar > .brand {
  position: relative;
  z-index: 3;

  box-shadow: 0 8px 18px rgba(15,23,42,.035);
}

.sidebar > .sidebar-footer {
  position: relative;
  z-index: 3;

  box-shadow: 0 -8px 18px rgba(15,23,42,.035);
}

/* slim enterprise scrollbar */
.sidebar > .nav-menu {
  scrollbar-width: thin;
  scrollbar-color:
    rgba(100,116,139,.28)
    transparent;
}

.sidebar > .nav-menu::-webkit-scrollbar {
  width: 6px;
}

.sidebar > .nav-menu::-webkit-scrollbar-track {
  background: transparent;
}

.sidebar > .nav-menu::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(100,116,139,.24);
}

.sidebar > .nav-menu::-webkit-scrollbar-thumb:hover {
  background: rgba(18,191,166,.44);
}


/* ==========================================================
   B. ROLES & ACCESS
   More balanced + adaptive card layout.
   ========================================================== */

#customRolesList .role-list-section {
  grid-template-columns:
    repeat(auto-fit, minmax(205px, 1fr)) !important;

  gap: 13px !important;

  padding: 14px !important;

  border-radius: 16px !important;

  background:
    linear-gradient(
      135deg,
      rgba(248,250,252,.72),
      rgba(235,247,247,.48)
    ) !important;
}

/* Custom roles should use the available width instead of
   leaving most of the row visually empty. */
#customRolesList .role-list-section:last-child {
  grid-template-columns:
    repeat(auto-fit, minmax(300px, 1fr)) !important;
}

/* cap two custom-role cards at 50/50 on wide screens */
@media (min-width: 1100px) {
  #customRolesList .role-list-section:last-child .role-card {
    max-width: none;
  }
}

#customRolesList .role-list-heading {
  min-height: 36px !important;

  margin: -2px -2px 2px !important;

  padding: 0 4px 8px !important;

  border-bottom: 1px solid rgba(148,163,184,.18);
}

#customRolesList .role-list-heading > span {
  color: #38536a !important;

  font-size: 10px !important;
  font-weight: 900 !important;

  letter-spacing: .075em !important;
}

#customRolesList .role-list-heading > small {
  font-size: 8px !important;
}

#customRolesList .role-card {
  min-height: 172px !important;

  padding: 16px !important;

  border-radius: 16px !important;

  box-shadow:
    0 8px 20px rgba(15,23,42,.04) !important;
}

#customRolesList .role-card:hover {
  transform: translateY(-2px) !important;

  box-shadow:
    0 14px 30px rgba(15,23,42,.075) !important;
}

#customRolesList .role-card-title-row > strong {
  font-size: 11px;
  letter-spacing: -.01em;
}

#customRolesList .role-card-copy > span {
  color: #526b7d;
  font-size: 8px;
  line-height: 1.5;
}

#customRolesList .role-card-copy > small {
  color: var(--muted);
  font-size: 7px;
  line-height: 1.55;
}

/* Slightly more deliberate actions */
#customRolesList .role-card-actions {
  gap: 8px !important;
}

#customRolesList .role-card-button {
  border-radius: 9px !important;

  font-weight: 800;
}


/* ==========================================================
   C. POSITIONS & RATES
   Continue the same visual language.
   ========================================================== */

#attendancePayPanel {
  overflow: hidden;
}

#attendancePayPanel .panel-header {
  margin-bottom: 4px;
}

#attendancePayRateList .attendance-pay-item {
  min-height: 168px !important;

  padding: 17px !important;

  border-radius: 16px !important;

  box-shadow:
    0 8px 20px rgba(15,23,42,.04) !important;
}

#attendancePayRateList .attendance-pay-item:hover {
  transform: translateY(-2px) !important;

  box-shadow:
    0 14px 30px rgba(15,23,42,.075) !important;
}

#attendancePayRateList
.attendance-pay-item
> div:first-child
> strong {
  font-size: 12px !important;
}

#attendancePayRateList
.attendance-pay-item
> div:first-child
> span {
  margin-top: 8px !important;

  font-size: 9px !important;
  font-weight: 700 !important;

  color: #597083 !important;
}

/* make salary read as meaningful information */
#attendancePayRateList
.attendance-pay-item
> div:first-child
> span::before {
  content: "Monthly rate · ";

  color: var(--muted);
  font-weight: 600;
}

#attendancePayRateList
.attendance-pay-item
> .settings-item-actions {
  padding-top: 12px !important;
}

#attendancePayRateList .settings-icon-button {
  transition:
    background .15s ease,
    border-color .15s ease,
    transform .15s ease;
}

#attendancePayRateList .settings-icon-button:hover {
  transform: translateY(-1px);
}


/* ==========================================================
   D. PRIMARY SECTION CTA BUTTONS
   More consistent with mock direction.
   ========================================================== */

#createRoleButton,
#attendancePayPanel #newPayRateButton {
  min-height: 36px;

  border-radius: 10px !important;

  font-weight: 900 !important;

  box-shadow:
    0 8px 18px rgba(18,191,166,.16);
}


/* ==========================================================
   E. LARGE SCREEN USE
   Prevent content from appearing like a tiny island on wide monitors.
   ========================================================== */

@media (min-width: 1700px) {
  #customRolesList .role-list-section {
    grid-template-columns:
      repeat(auto-fit, minmax(235px, 1fr)) !important;
  }

  #attendancePayRateList.attendance-pay-list,
  #attendancePayRateList {
    grid-template-columns:
      repeat(4, minmax(230px, 1fr)) !important;
  }
}


/* ==========================================================
   F. RESPONSIVE
   ========================================================== */

@media (max-width: 1250px) {
  #customRolesList .role-list-section,
  #customRolesList .role-list-section:last-child {
    grid-template-columns:
      repeat(2, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 760px) {
  /* Mobile keeps existing drawer/sidebar mechanics. */
  .sidebar {
    height: 100dvh !important;
  }

  #customRolesList .role-list-section,
  #customRolesList .role-list-section:last-child {
    grid-template-columns: 1fr !important;
  }

  #customRolesList .role-card,
  #attendancePayRateList .attendance-pay-item {
    min-height: 150px !important;
  }
}
