@media (min-width: 991.98px) {
  main {
    padding-left: 240px;
  }
}

/* Sidebar */
.sidebar {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  padding: 58px 0 0;
  width: 240px;
  box-shadow: 0 2px 5px rgb(0 0 0 / 5%), 0 2px 10px rgb(0 0 0 / 5%);
  z-index: 600;
}

@media (max-width: 991.98px) {
  .sidebar {
    width: 100%;
  }
}

.sidebar .active {
  border-radius: 5px;
  box-shadow: 0 2px 5px rgb(0 0 0 / 16%), 0 2px 10px rgb(0 0 0 / 12%);
}

.sidebar-sticky {
  position: relative;
  top: 0;
  height: calc(100vh - 48px);
  padding-top: .5rem;
  overflow-x: hidden;
  overflow-y: auto;
}

#global-loader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  visibility: hidden;
  opacity: 0;
  transition: visibility 0s linear .2s, opacity .2s;
}

#global-loader.active {
  visibility: visible;
  opacity: 1;
  transition-delay: 0s;
}

#global-loader .loader-box {
  margin: auto;                  /* center both axes */
  background: rgba(0,0,0,0.85);  /* dark translucent panel */
  padding: 1.5rem 2rem;
  border-radius: 0.5rem;
  box-shadow: 0 0 10px rgba(66,133,244,0.5);
  display: flex;
  flex-direction: column;
  align-items: center;
  animation: glow 1.8s ease-in-out infinite;
  max-width: 240px;
}

/* subtle “neon” glow animation */
@keyframes glow {
  0%, 100% { box-shadow: 0 0 8px 2px rgba(66,133,244,0.5); }
  50%      { box-shadow: 0 0 16px 4px rgba(66,133,244,0.9); }
}

/* make the “page” background a true dark base */
body.bg-dark { background-color: #121212 !important; }

/* top navbar: a little lighter than the page, shadow along bottom */
#main-navbar {
  background-color: #1f1f1f !important;
  box-shadow: 0 4px 6px rgba(0,0,0,0.7);
  z-index: 1030; /* above sidebar/content */
}

/* sidebar: another slightly lighter shade, shadow on the right */
#sidebarMenu {
  background-color: #282828 !important;
  box-shadow: 4px 0 6px rgba(0,0,0,0.7);
  z-index: 1020;
}

/* 10px from the left edge, keep it vertically centered */
#main-navbar .navbar-brand {
  padding-left: 50px;
  display: flex;
  align-items: center;
}
  
/* Dark-mode overrides */
:root[data-bs-theme="dark"] {
  --bs-body-bg: #121217;
  --bs-body-color: #e0e0e0;
  --bs-border-color: #2f2f33;
  --bs-card-bg: #1e1e23;
  --bs-table-bg: #1e1e23;
  --bs-table-striped-bg: #29292d;
  --bs-table-striped-color: #e0e0e0;
  --bs-modal-content-bg: #343a40;
  /* content area */
  --bs-modal-bg: #343a40;
  /* fallback for older BS */
  --bs-modal-content-border-color: #3b3b44;
  /* a few shades lighter */
  --bs-modal-border-color: #3b3b44;
  /* fallback */
  --bs-modal-content-border-width: 1px;
  --bs-modal-border-width: 1px;
  /* fallback */
  --bs-backdrop-bg: rgba(0, 0, 0, 0.75);
}
/* boost specificity to override the runtime .modal variables */
:root[data-bs-theme="dark"] .modal {
  --bs-modal-bg:                  #343a40;
  --bs-modal-border-color:        #3b3b44;
  --bs-modal-border-width:        1px;
}
/* ensure .modal-content picks up our new vars */
:root[data-bs-theme="dark"] .modal-content {
  background-color: var(--bs-modal-content-bg);
  border: var(--bs-modal-border-width) solid var(--bs-modal-border-color);
}

:root[data-bs-theme="dark"] .text-muted {
  color: #adb5bd !important;
}

:root[data-bs-theme="dark"] .sidebar .list-group-item-action:hover,
:root[data-bs-theme="dark"] .sidebar .list-group-item-action:focus {
  background-color: var(--bs-border-color);
}

:root[data-bs-theme="dark"] .alert-success {
  background-color: #0f5132;
  color: #d1e7dd;
}