/* Refined SB Admin style, tuned for a stronger sidebar visual hierarchy */
@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@500;600;700;800&display=swap');

:root {
  --primary: #4e73df;
  --primary-dark: #2e59d9;
  --sidebar-start: #2d4ec2;
  --sidebar-mid: #3e6ae0;
  --sidebar-end: #2b4ec6;
  --sidebar-width: 15.25rem;
  --sidebar-width-collapsed: 6rem;
  --sidebar-link: rgba(233, 241, 255, 0.9);
  --sidebar-link-strong: #ffffff;
  --sidebar-section: #c6d6ff;
  --sidebar-hover-bg: rgba(255, 255, 255, 0.15);
  --sidebar-active-bg: linear-gradient(135deg, rgba(255, 255, 255, 0.28), rgba(255, 255, 255, 0.14));
}

html,
body,
.sidebar .sidebar-brand {
  font-family: 'Manrope', 'Inter', 'Nunito', sans-serif;
}

html,
body {
  max-width: 100%;
  overflow-x: hidden;
}

.bg-gradient-primary {
  background:
    radial-gradient(circle at 14% -5%, rgba(255, 255, 255, 0.26), transparent 42%),
    radial-gradient(circle at 100% 92%, rgba(129, 140, 248, 0.26), transparent 50%),
    linear-gradient(165deg, var(--sidebar-start) 0%, var(--sidebar-mid) 55%, var(--sidebar-end) 100%) !important;
}

.sidebar {
  width: var(--sidebar-width);
  height: 100vh;
  min-height: 100vh;
  flex-shrink: 0;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 1030;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.3) transparent;
  box-shadow: 18px 0 42px rgba(15, 23, 42, 0.24);
}

.sidebar::-webkit-scrollbar {
  width: 8px;
}

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

.sidebar::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.24);
  border-radius: 999px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.36);
}

.sidebar::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0) 26%, rgba(255, 255, 255, 0.04));
  pointer-events: none;
}

.sidebar .sidebar-brand {
  height: 4.375rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  position: relative;
  z-index: 1;
}

.sidebar .nav-item {
  position: relative;
  z-index: 1;
  padding: 0 0.64rem;
  margin: 0.04rem 0;
}

.sidebar .nav-item .nav-link {
  display: flex;
  align-items: center;
  min-height: 2.8rem;
  gap: 0.68rem;
  padding: 0.58rem 0.82rem;
  border: 1px solid transparent;
  border-radius: 0.95rem;
  color: var(--sidebar-link) !important;
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1.18;
  position: relative;
  overflow: hidden;
  transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.sidebar .nav-item .nav-link::before {
  content: '';
  position: absolute;
  left: 0.38rem;
  top: 18%;
  bottom: 18%;
  width: 3px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.96);
  opacity: 0;
  transform: scaleY(0.2);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.sidebar .nav-item .nav-link span {
  min-width: 0;
}

.sidebar .nav-item .nav-link i {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 1.82rem;
  height: 1.82rem;
  border-radius: 0.64rem;
  text-align: center;
  font-size: 0.82rem;
  background: rgba(255, 255, 255, 0.13);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14);
  color: rgba(233, 241, 255, 0.92) !important;
  transition: transform 0.2s ease, color 0.2s ease, background-color 0.2s ease;
}

.sidebar .sidebar-divider {
  border-top: 1px solid rgba(255, 255, 255, 0.18);
  margin: 0.45rem 0.95rem 0.72rem;
}

.sidebar .sidebar-divider.my-0 {
  margin-top: 0.35rem;
}

.sidebar.sidebar-dark,
.sidebar.sidebar-dark .sidebar-brand,
.sidebar.sidebar-dark .sidebar-brand .sidebar-brand-text {
  color: #ffffff;
}

.sidebar.sidebar-dark .nav-link,
.sidebar.sidebar-dark .nav-link span,
.sidebar.sidebar-dark .nav-link i {
  color: var(--sidebar-link) !important;
}

.sidebar.sidebar-dark .nav-link:hover,
.sidebar.sidebar-dark .nav-link:focus {
  color: var(--sidebar-link-strong) !important;
  background: var(--sidebar-hover-bg);
  border-color: rgba(255, 255, 255, 0.14);
  transform: translateX(2px);
  box-shadow: 0 12px 24px rgba(11, 24, 70, 0.24);
}

.sidebar.sidebar-dark .nav-link:hover::before,
.sidebar.sidebar-dark .nav-link:focus::before {
  opacity: 0.76;
  transform: scaleY(1);
}

.sidebar.sidebar-dark .nav-link:hover i,
.sidebar.sidebar-dark .nav-link:focus i {
  color: var(--sidebar-link-strong) !important;
  background: rgba(255, 255, 255, 0.18);
  transform: scale(1.06);
}

.sidebar .nav-item.active .nav-link,
.sidebar .nav-link.active {
  color: var(--sidebar-link-strong) !important;
  font-weight: 700;
  background: var(--sidebar-active-bg);
  border-color: rgba(255, 255, 255, 0.16);
  box-shadow: 0 14px 26px rgba(9, 21, 66, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

.sidebar .nav-item.active .nav-link::before,
.sidebar .nav-link.active::before {
  opacity: 1;
  transform: scaleY(1);
}

.sidebar .nav-item.active .nav-link i,
.sidebar .nav-link.active i {
  color: var(--sidebar-link-strong) !important;
  background: rgba(255, 255, 255, 0.22);
  transform: scale(1.08);
}

.sidebar-section {
  margin-top: 0.82rem !important;
  margin-bottom: 0.2rem !important;
  padding: 0 0.95rem !important;
}

.sidebar-section .sidebar-section-label {
  display: block;
  font-size: 0.64rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--sidebar-section);
  font-weight: 800;
  opacity: 0.95;
}

.sidebar.toggled {
  width: var(--sidebar-width-collapsed);
}

.sidebar.toggled .sidebar-brand-text,
.sidebar.toggled .nav-item .nav-link span,
.sidebar.toggled .sidebar-section .sidebar-section-label {
  display: none;
}

.sidebar.toggled .nav-item {
  padding: 0 0.35rem;
}

.sidebar.toggled .nav-item .nav-link {
  justify-content: center;
  padding: 0.58rem 0.18rem;
}

.sidebar.toggled .nav-item .nav-link i {
  margin: 0;
  width: 1.92rem;
  height: 1.92rem;
  font-size: 0.88rem;
}

.sidebar.toggled .nav-item .nav-link::after {
  display: none;
}

#wrapper {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: hidden;
}

#content-wrapper {
  min-height: 100vh;
  width: auto;
  max-width: 100%;
  min-width: 0;
  flex: 0 0 calc(100% - var(--sidebar-width));
  max-width: calc(100% - var(--sidebar-width));
  margin-left: var(--sidebar-width);
  overflow-x: hidden;
  transition: margin-left 0.2s ease, flex-basis 0.2s ease, max-width 0.2s ease;
}

.sidebar.toggled ~ #content-wrapper {
  flex-basis: calc(100% - var(--sidebar-width-collapsed));
  max-width: calc(100% - var(--sidebar-width-collapsed));
  margin-left: var(--sidebar-width-collapsed);
}

#content {
  flex: 1 0 auto;
  min-width: 0;
  width: 100%;
}

.topbar {
  height: 4.375rem;
  min-width: 0;
}

.topbar .navbar-nav,
.topbar .nav-item,
.topbar .nav-link {
  min-width: 0;
}

.sticky-footer {
  padding: 1rem 0;
  flex-shrink: 0;
  margin-top: auto;
}

.sidebar .text-center.d-none.d-md-inline {
  position: relative;
  z-index: 1;
  margin-top: auto;
  padding: 0.72rem 0 0.6rem;
}

.scroll-to-top {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  width: 2.75rem;
  height: 2.75rem;
  text-align: center;
  color: #fff;
  background: rgba(90, 92, 105, 0.5);
  line-height: 46px;
  display: none;
}

.scroll-to-top:hover {
  color: #fff;
}

.text-gray-600 {
  color: #858796 !important;
}

.text-gray-400 {
  color: #d1d3e2 !important;
}

.text-gray-300 {
  color: #dddfeb !important;
}

.text-gray-800 {
  color: #5a5c69 !important;
}

.card {
  border: 0;
  box-shadow: 0 0.15rem 1.75rem 0 rgba(58, 59, 69, 0.15);
}

.table thead th {
  border-bottom-width: 1px;
  font-weight: 700;
}

#sidebarToggle {
  width: 2.15rem;
  height: 2.15rem;
  border: 1px solid rgba(255, 255, 255, 0.24);
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(2px);
  box-shadow: 0 12px 26px rgba(9, 21, 66, 0.22);
  transition: transform 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}

#sidebarToggle:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.32);
  box-shadow: 0 16px 30px rgba(9, 21, 66, 0.28);
}

#sidebarToggle:focus {
  outline: none;
}

.border-left-primary {
  border-left: 0.25rem solid #4e73df !important;
}

.border-left-success {
  border-left: 0.25rem solid #1cc88a !important;
}

.border-left-info {
  border-left: 0.25rem solid #36b9cc !important;
}

.border-left-warning {
  border-left: 0.25rem solid #f6c23e !important;
}

.text-primary {
  color: #4e73df !important;
}

.text-success {
  color: #1cc88a !important;
}

.text-info {
  color: #36b9cc !important;
}

.text-warning {
  color: #f6c23e !important;
}

.font-weight-bold {
  font-weight: 700 !important;
}

.text-xs {
  font-size: 0.7rem;
}

@media (min-width: 768px) {
  .sidebar.toggled .nav-link--submenu-toggle .nav-link__label {
    display: inline-flex;
    flex: 0 0 auto;
  }

  .sidebar.toggled .nav-link--submenu-toggle .nav-link__label > span:last-child,
  .sidebar.toggled .nav-link--submenu-toggle .nav-link__caret,
  .sidebar.toggled .collapse {
    display: none !important;
  }
}

@media (max-width: 1399.98px) {
  :root {
    --sidebar-width: 14.5rem;
    --sidebar-width-collapsed: 5.75rem;
  }
}

@media (max-width: 1199.98px) {
  :root {
    --sidebar-width: 13.5rem;
    --sidebar-width-collapsed: 5.35rem;
  }

  .sidebar .nav-item {
    padding: 0 0.54rem;
  }

  .sidebar .nav-item .nav-link {
    min-height: 2.68rem;
    gap: 0.62rem;
    padding-inline: 0.74rem;
    font-size: 0.86rem;
  }

  .sidebar .nav-item .nav-link i {
    width: 1.72rem;
    height: 1.72rem;
    font-size: 0.78rem;
  }
}
