/* =========================================================
   SB-Admin legacy custom CSS – Bootstrap 5 compatible pass
   Notes:
   - Removes BS4-only hooks like .form-inline + .card-columns (deprecated)
   - Keeps your existing class names so you don’t have to rewrite markup
   - Adds BS5-friendly replacements + a few safe modernizations
   ========================================================= */
/* =========================================================
   App gradient (matches your login background vibe)
   ========================================================= */


html {
  position: relative;
  min-height: 100%;
}

body {
  min-height: 100%;
}

/* Keep your sizing choice */
html, body { font-size: 85%; }

/* Layout */
#wrapper {
  display: flex;
}

#wrapper #content-wrapper {
  overflow-x: hidden;
  width: 100%;
  padding-top: 1rem;
  padding-bottom: 80px;
}

/* Fixed-nav spacing – same behavior */
body.fixed-nav #content-wrapper {
  margin-top: 56px;
  padding-left: 90px;
}

body.fixed-nav.sidebar-toggled #content-wrapper {
  padding-left: 0;
}

@media (min-width: 768px) {
  body.fixed-nav #content-wrapper {
    padding-left: 225px;
  }
  body.fixed-nav.sidebar-toggled #content-wrapper {
    padding-left: 90px;
  }
}

/* Print helpers */
#print_header { display: none; }

@media print {
  .noprint { display: none !important; }
  #print_header { display: block !important; }

  /* BS5 doesn’t add link URLs by default like old browsers did,
     but keep your override for safety */
  a[href]::after { content: none !important; }
}

.report_blue { background-color: blue !important; }

/* Scroll to top button */
.scroll-to-top {
  position: fixed;
  right: 15px;
  bottom: 15px;
  display: none;
  width: 50px;
  height: 50px;
  text-align: center;
  color: #fff;
  background: rgba(52, 58, 64, 0.5);
  line-height: 46px;
}

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

.scroll-to-top:hover {
  background: #343a40;
}

.scroll-to-top i { font-weight: 800; }

.smaller { font-size: 0.7rem; }
.o-hidden { overflow: hidden !important; }

.z-0 { z-index: 0; }
.z-1 { z-index: 1; }

:root{
  --app-bg: #0b0f14;
  --app-grad: radial-gradient(1200px circle at 20% 10%, rgba(13,110,253,.25), transparent 55%),
              radial-gradient(900px circle at 80% 30%, rgba(32,201,151,.18), transparent 50%),
              radial-gradient(900px circle at 50% 90%, rgba(255,193,7,.12), transparent 55%),
              #0b0f14;
  --app-grad-soft: radial-gradient(900px circle at 20% 10%, rgba(13,110,253,.18), transparent 55%),
                   radial-gradient(700px circle at 80% 30%, rgba(32,201,151,.12), transparent 50%),
                   #0b0f14;
}


/* ---------------------------------------------------------
   Navbar tweaks
   --------------------------------------------------------- */

/* BS4 had .form-inline – BS5 removed it.
   Support both: if markup still uses .form-inline keep it working,
   but also add a BS5-friendly selector. */
.navbar-nav .form-inline .input-group,
.navbar-nav .d-flex .input-group,
.navbar-nav form .input-group {
  width: 100%;
}

@media (min-width: 768px) {
  .navbar-nav .form-inline .input-group,
  .navbar-nav .d-flex .input-group,
  .navbar-nav form .input-group {
    width: auto;
  }
}

.navbar-nav .nav-item.active .nav-link {
  color: #fff;
}

/* Top navbar gradient */
.navbar.navbar-dark.bg-dark {
  background: var(--app-grad) !important;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  box-shadow: 0 10px 30px rgba(0,0,0,0.25);
}

/* Dropdown caret replacement (FontAwesome) */
.navbar-nav .nav-item.dropdown .dropdown-toggle::after {
  width: 1rem;
  text-align: center;
  float: right;
  vertical-align: 0;
  border: 0;
  font-weight: 900;
  content: '\f105';
  font-family: 'Font Awesome 5 Free';
}

/* BS5 uses .show still, keep it */
.navbar-nav .nav-item.dropdown.show .dropdown-toggle::after {
  content: '\f107';
}

.navbar-nav .nav-item.dropdown.no-arrow .dropdown-toggle::after {
  display: none;
}

.navbar-nav .nav-item .nav-link:focus { outline: none; }

.navbar-nav .nav-item .nav-link .badge {
  position: absolute;
  margin-left: 0.75rem;
  top: 0.3rem;
  font-weight: 400;
  font-size: 0.5rem;
}

/* =========================================================
   Glass dropdowns (top nav + sidebar) — BS5 friendly
   ========================================================= */

/* Shared dropdown look */
.navbar .dropdown-menu,
.sidebar .dropdown-menu {
  background: rgba(15, 20, 28, 0.72) !important;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255,255,255,0.10) !important;
  box-shadow: 0 18px 45px rgba(0,0,0,0.45);
  border-radius: 14px;
  padding: .5rem;
  overflow: hidden;
}

/* Items */
.navbar .dropdown-item,
.sidebar .dropdown-item {
  color: rgba(255,255,255,0.85) !important;
  border-radius: 10px;
  padding: .55rem .75rem;
  transition: background-color .15s ease, color .15s ease, transform .12s ease;
}

/* Hover / focus */
.navbar .dropdown-item:hover,
.navbar .dropdown-item:focus,
.sidebar .dropdown-item:hover,
.sidebar .dropdown-item:focus {
  color: #fff !important;
  background: rgba(255,255,255,0.08) !important;
}

/* Active item */
.navbar .dropdown-item.active,
.sidebar .dropdown-item.active {
  background: rgba(13,110,253,0.20) !important;
  color: #fff !important;
}

/* Dividers + headers */
.navbar .dropdown-divider,
.sidebar .dropdown-divider {
  border-top: 1px solid rgba(255,255,255,0.10) !important;
  opacity: 1;
  margin: .4rem .25rem;
}

.navbar .dropdown-header,
.sidebar .dropdown-header {
  color: rgba(255,255,255,0.55) !important;
  font-weight: 600;
  padding: .35rem .75rem;
}

/* Dropdown "info rows" you output as <p class="dropdown-item ..."> */
.navbar .dropdown-menu p.dropdown-item,
.sidebar .dropdown-menu p.dropdown-item {
  color: rgba(255,255,255,0.70) !important;
  cursor: default;
  margin: 0;
}

/* Make dropdowns feel smoother */
.dropdown-menu.show {
  animation: ddFadeIn .14s ease-out both;
  transform-origin: top right;
}

.navbar .dropdown-menu,
.sidebar .dropdown-menu {
  background-image:
    radial-gradient(700px circle at 20% 0%, rgba(13,110,253,.18), transparent 55%),
    radial-gradient(600px circle at 90% 30%, rgba(32,201,151,.12), transparent 50%);
}

@keyframes ddFadeIn {
  from { opacity: 0; transform: translateY(6px) scale(.985); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* Optional: slightly nicer dropdown caret contrast in dark */
.navbar-nav .nav-item.dropdown .dropdown-toggle::after {
  color: rgba(255,255,255,0.60);
}
.navbar-nav .nav-item.dropdown.show .dropdown-toggle::after {
  color: rgba(255,255,255,0.85);
}

/* ---------------------------------------------------------
   Sidebar
   --------------------------------------------------------- */
/* Sidebar gradient */
.sidebar {
  width: 90px !important;
  background: var(--app-grad-soft) !important;
  min-height: calc(100vh - 56px);
  border-right: 1px solid rgba(255,255,255,0.08);
}

.sidebar .nav-item:last-child { margin-bottom: 1rem; }

.sidebar .nav-item .nav-link {
  text-align: center;
  padding: 0.75rem 1rem;
  width: 90px;
}

.sidebar .nav-item .nav-link span {
  font-size: 0.65rem;
  display: block;
}

/* BS5 dropdown menus use Popper, but your layout forces them.
   Keep behavior intact. */
.sidebar .nav-item .dropdown-menu {
  position: absolute !important;
  transform: none !important;
  left: calc(90px + 0.5rem) !important;
  margin: 0;
}

/* In BS5 dropup is still a thing; keep */
.sidebar .nav-item .dropdown-menu.dropup {
  bottom: 0;
  top: auto !important;
}

.sidebar .nav-item.dropdown .dropdown-toggle::after {
  display: none;
}

.sidebar .nav-item .nav-link {
  color: rgba(255, 255, 255, 0.5);
}

.sidebar .nav-item .nav-link:active,
.sidebar .nav-item .nav-link:focus,
.sidebar .nav-item .nav-link:hover {
  color: rgba(255, 255, 255, 0.75);
}

.sidebar.toggled {
  width: 0 !important;
  overflow: hidden;
}

@media (min-width: 768px) {
  .sidebar { width: 225px !important; }

  .sidebar .nav-item .nav-link {
    display: block;
    width: 225px;
    text-align: left;
    padding: 1rem;
  }

  .sidebar .nav-item .nav-link span {
    font-size: 1rem;
    display: inline;
  }

  /* Make dropdown menus flow in normal doc at desktop */
  .sidebar .nav-item .dropdown-menu {
    position: static !important;
    margin: 0 1rem;
    top: 0;
  }

  .sidebar .nav-item.dropdown .dropdown-toggle::after {
    display: block;
  }

  .sidebar.toggled {
    overflow: visible;
    width: 90px !important;
  }

  .sidebar.toggled .nav-item:last-child { margin-bottom: 1rem; }

  .sidebar.toggled .nav-item .nav-link {
    text-align: center;
    padding: 0.75rem 1rem;
    width: 90px;
  }

  .sidebar.toggled .nav-item .nav-link span {
    font-size: 0.65rem;
    display: block;
  }

  .sidebar.toggled .nav-item .dropdown-menu {
    position: absolute !important;
    transform: none !important;
    left: calc(90px + 0.5rem) !important;
    margin: 0;
  }

  .sidebar.toggled .nav-item .dropdown-menu.dropup {
    bottom: 0;
    top: auto !important;
  }

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

.sidebar.fixed-top {
  top: 56px;
  height: calc(100vh - 56px);
  overflow-y: auto;
}

/* Sidebar link polish on gradient */
.sidebar .nav-item .nav-link {
  color: rgba(255,255,255,0.70);
}

.sidebar .nav-item .nav-link:hover,
.sidebar .nav-item .nav-link:focus {
  color: rgba(255,255,255,0.95);
  background: rgba(255,255,255,0.06);
  border-radius: 10px;
}

.sidebar .nav-item.active .nav-link {
  color: #fff;
  background: rgba(13,110,253,0.16);
  border-radius: 10px;
}

/* Card icon overlay */
.card-body-icon {
  position: absolute;
  z-index: 0;
  top: -1.25rem;
  right: -1rem;
  opacity: 0.4;
  font-size: 5rem;
  transform: rotate(15deg);
}

/* ---------------------------------------------------------
   Cards layout (BS4 .card-columns was removed in BS5)
   Keep the class name but implement it via CSS columns.
   --------------------------------------------------------- */
.card-columns {
  column-gap: 1rem;
}

@media (min-width: 576px) {
  .card-columns { column-count: 1; }
}
@media (min-width: 768px) {
  .card-columns { column-count: 2; }
}
@media (min-width: 1200px) {
  .card-columns { column-count: 2; }
}

/* Ensure cards behave in column layout */
.card-columns > .card {
  display: inline-block;
  width: 100%;
  margin: 0 0 1rem;
}

/* ---------------------------------------------------------
   Login/Register card sizing
   --------------------------------------------------------- */
.card-login { max-width: 35rem; }
.card-register { max-width: 40rem; }

/* ---------------------------------------------------------
   Floating label legacy support
   BS5 has .form-floating; your old markup used .form-label-group.
   Keep it working and make it visually consistent with BS5.
   --------------------------------------------------------- */

:root {
  --input-padding-x: 0.75rem;
  --input-padding-y: 0.75rem;
}

.form-label-group { position: relative; }

.form-label-group > input,
.form-label-group > label {
  padding: var(--input-padding-y) var(--input-padding-x);
  height: auto;
}

.form-label-group > label {
  position: absolute;
  top: 0;
  left: 0;
  display: block;
  width: 100%;
  margin-bottom: 0;
  line-height: 1.5;

  /* BS5-ish colors (using the same you had) */
  color: #495057;

  border: 1px solid transparent;
  border-radius: 0.375rem; /* BS5 default radius */
  transition: all 0.1s ease-in-out;
  pointer-events: none; /* prevents click trapping */
}

.form-label-group input::placeholder { color: transparent; }

/* Works with BS5 inputs too */
.form-label-group input:not(:placeholder-shown) {
  padding-top: calc(var(--input-padding-y) + var(--input-padding-y) * (2 / 3));
  padding-bottom: calc(var(--input-padding-y) / 3);
}

.form-label-group input:not(:placeholder-shown) ~ label {
  padding-top: calc(var(--input-padding-y) / 3);
  padding-bottom: calc(var(--input-padding-y) / 3);
  font-size: 12px;
  color: #777;
}

/* ---------------------------------------------------------
   Sticky footer
   --------------------------------------------------------- */
footer.sticky-footer {
  display: flex;
  position: absolute;
  right: 0;
  bottom: 0;
  width: calc(100% - 90px);
  height: 120px;
  background-color: #fff;
}

footer.sticky-footer .copyright {
  line-height: 1;
  font-size: 0.8rem;
}

@media (min-width: 768px) {
  footer.sticky-footer { width: calc(100% - 225px); }
}

body.sidebar-toggled footer.sticky-footer { width: 100%; }

@media (min-width: 768px) {
  body.sidebar-toggled footer.sticky-footer { width: calc(100% - 90px); }
}

/* ---------------------------------------------------------
   Custom switch (independent of Bootstrap version)
   Keep as-is (works fine in BS5)
   --------------------------------------------------------- */
.switch {
  font-size: 1rem;
  position: relative;
}

.switch input {
  position: absolute;
  height: 1px;
  width: 1px;
  background: none;
  border: 0;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  overflow: hidden;
  padding: 0;
}

.switch input + label {
  position: relative;
  min-width: calc(calc(2.375rem * .8) * 2);
  border-radius: calc(2.375rem * .8);
  height: calc(2.375rem * .8);
  line-height: calc(2.375rem * .8);
  display: inline-block;
  cursor: pointer;
  outline: none;
  user-select: none;
  vertical-align: middle;
  text-indent: calc(calc(calc(2.375rem * .8) * 2) + .5rem);
}

.switch input + label::before,
.switch input + label::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: calc(calc(2.375rem * .8) * 2);
  bottom: 0;
  display: block;
}

.switch input + label::before {
  right: 0;
  background-color: #CC0000;
  border-radius: calc(2.375rem * .8);
  transition: 0.2s all;
}

.switch input + label::after {
  top: 2px;
  left: 2px;
  width: calc(calc(2.375rem * .8) - calc(2px * 2));
  height: calc(calc(2.375rem * .8) - calc(2px * 2));
  border-radius: 50%;
  background-color: white;
  transition: 0.2s all;
}

.switch input:checked + label::before { background-color: #23CC20; }
.switch input:checked + label::after { margin-left: calc(2.375rem * .8); }

.switch input:focus + label::before {
  outline: none;
  /* close to BS5 focus ring */
  box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

.switch input:disabled + label {
  color: #CC0000;
  cursor: not-allowed;
}

.switch input:disabled + label::before { background-color: #CC0000; }

.switch.switch-sm { font-size: 0.875rem; }
.switch.switch-sm input + label {
  min-width: calc(calc(1.9375rem * .8) * 2);
  height: calc(1.9375rem * .8);
  line-height: calc(1.9375rem * .8);
  text-indent: calc(calc(calc(1.9375rem * .8) * 2) + .5rem);
}
.switch.switch-sm input + label::before {
  width: calc(calc(1.9375rem * .8) * 2);
}
.switch.switch-sm input + label::after {
  width: calc(calc(1.9375rem * .8) - calc(2px * 2));
  height: calc(calc(1.9375rem * .8) - calc(2px * 2));
}
.switch.switch-sm input:checked + label::after {
  margin-left: calc(1.9375rem * .8);
}

.switch.switch-lg { font-size: 1.25rem; }
.switch.switch-lg input + label {
  min-width: calc(calc(3rem * .8) * 2);
  height: calc(3rem * .8);
  line-height: calc(3rem * .8);
  text-indent: calc(calc(calc(3rem * .8) * 2) + .5rem);
}
.switch.switch-lg input + label::before {
  width: calc(calc(3rem * .8) * 2);
}
.switch.switch-lg input + label::after {
  width: calc(calc(3rem * .8) - calc(2px * 2));
  height: calc(calc(3rem * .8) - calc(2px * 2));
}
.switch.switch-lg input:checked + label::after {
  margin-left: calc(3rem * .8);
}

.switch + .switch { margin-left: 1rem; }

/* Status dots */
.dot_green, .dot_red, .dot_yellow, .dot_orange, .dot_grey {
  height: 15px;
  width: 15px;
  border-radius: 50%;
  display: inline-block;
}
.dot_green { background-color: #1BCC2D; }
.dot_red { background-color: #CC0000; }
.dot_yellow { background-color: #C7CC23; }
.dot_orange { background-color: #D9651D; }
.dot_grey { background-color: #bbb; }

/* Overlay */
.overlay {
  height: 100%;
  width: 100%;
  position: absolute;
  top: 0;
  left: 0;
  z-index: 99999;
  background-color: gray;
  opacity: 0.75;
  display: none;
}

/* Old IE filters removed (not needed for BS5-era browsers) */
.overlay h2 {
  position: fixed;
  margin-left: 40%;
  top: 40%;
}

/* Tom Select – Bootstrap 5 friendly */
.ts-control{
  border-radius: .375rem;
  border-color: var(--bs-border-color);
  min-height: calc(2.25rem + 2px);
}
.ts-control:focus{
  border-color: #86b7fe;
  box-shadow: 0 0 0 .25rem rgba(13,110,253,.25);
}
.ts-dropdown{
  border-radius: .5rem;
}
/* Float the label properly when TomSelect is used inside .form-floating */
.form-floating .ts-wrapper ~ label{
  transform: scale(.85) translateY(-0.5rem) translateX(0.15rem);
  opacity: .65;
  padding: 0 .35rem;                 /* creates space around text */
  background: var(--bs-body-bg);     /* prevents label sitting on border line */
  height: auto;
  line-height: 1.2;
  z-index: 6;
}

/* Keep TomSelect sized like a BS floating control */
.form-floating .ts-control{
  height: calc(3.5rem + 2px);
  padding-top: 1.25rem !important;
  padding-bottom: .25rem !important;
}

.form-floating > label {
  z-index: 5;
}


/* Nice compact list items */
.colvis-item {
  padding: .35rem .5rem;
  border-radius: .5rem;
}
.colvis-item:hover {
  background: rgba(0,0,0,.04);
}
#globalLoadingOverlay { pointer-events: all; }

