
/* =====================================================================
   Bootstrap 3 Compatibility Shim for Bootstrap 5
   Includes support for:
   - .label (mapped to badge styles)
   - .badge (bare usage fallback)
   - .alert and .alert-dismissable
   ===================================================================== */

/* === LABEL SUPPORT (Bootstrap 3) === */
/* Maps BS3 .label-* to BS5-style .badge with equivalent background colors */

.label {
  display: inline-block;
  padding: 0.35em 0.65em;
  font-size: 0.75em;
  font-weight: 600;
  line-height: 1;
  text-align: center;
  white-space: nowrap;
  vertical-align: baseline;
  border-radius: 0.25rem;
  color: #fff;
  background-color: #6c757d; /* fallback gray if no specific class */
}

.label-default  { background-color: #777; }
.label-primary  { background-color: #0d6efd; }
.label-success  { background-color: #198754; }
.label-info     { background-color: #0dcaf0; }
.label-warning  { background-color: #ffc107; color: #212529; }
.label-danger   { background-color: #dc3545; }

/* === BADGE SUPPORT (bare .badge element without bg-* class) === */
.badge {
  display: inline-block;
  padding: 0.35em 0.65em;
  font-size: 0.75em;
  font-weight: 600;
  line-height: 1;
  text-align: center;
  white-space: nowrap;
  vertical-align: baseline;
  border-radius: 0.375rem;
  background-color: #6c757d; /* fallback if no color specified */
  color: #fff;
}

/* Optional: if old .badge-* classes are used */
.badge-default  { background-color: #777; color: #fff; }
.badge-primary  { background-color: #0d6efd; color: #fff; }
.badge-success  { background-color: #198754; color: #fff; }
.badge-info     { background-color: #0dcaf0; color: #000; }
.badge-warning  { background-color: #ffc107; color: #212529; }
.badge-danger   { background-color: #dc3545; color: #fff; }

/* === ALERTS (Bootstrap 3 compatibility) === */

/* Restore Bootstrap 3 alert colors */
.alert-success {
  color: #3c763d;
  background-color: #dff0d8;
  border-color: #d6e9c6;
}

.alert-info {
  color: #31708f;
  background-color: #d9edf7;
  border-color: #bce8f1;
}

.alert-warning {
  color: #8a6d3b;
  background-color: #fcf8e3;
  border-color: #faebcc;
}

.alert-danger {
  color: #a94442;
  background-color: #f2dede;
  border-color: #ebccd1;
}

/* General alert structure (as per BS3) */
.alert {
  padding: 15px;
  margin-bottom: 20px;
  border: 1px solid transparent;
  border-radius: 4px;
}

/* .alert-dismissable support (Bootstrap 3) */
.alert-dismissable,
.alert-dismissible {
  padding-right: 35px;
  position: relative;
}

.alert-dismissable .close,
.alert-dismissible .btn-close {
  position: absolute;
  top: 0;
  right: 10px;
  padding: 1rem;
  background: none;
  border: none;
  font-size: 1.2rem;
  line-height: 1;
  color: inherit;
  opacity: 0.5;
}

/* Ensure 3rd-levels fly out to the right */
.dropdown-menu .dropdown-submenu {
  position: relative;
}
.dropdown-menu .dropdown-submenu > .dropdown-menu {
  top: 0;
  left: 100%;
  margin-left: 0.1rem;
  margin-right: 0.1rem;
}

.sidebar {
  background-color: #f2f2f2;  /* light grey behind the list */
  padding: 1rem;
}
.sidebar .nav-link {
  color: var(--bs-primary);
  padding: 0.5rem 1rem;
  display: flex;
  align-items: center;
}
.sidebar .nav-link i {
  margin-right: 0.75rem;
  width: 1.25rem;
  text-align: center;
}
.sidebar .nav-link:hover {
  background-color: #e5e5e5;
  text-decoration: none;
}
