.btn i {
  margin-top: -3px;
}

/* Global Loader Overlay */
#global-loader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(
    ellipse at center,
    rgba(255, 255, 255, 0.95) 0%,
    rgba(245, 245, 245, 0.95) 100%
  );
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

/* Activate overlay when requested */
#global-loader.active,
html.show-loader #global-loader {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

/* Hide legacy loader markup if present */
#global-loader .inventory-loader {
  display: none !important;
}

/* Minimal, fast barcode-style loader */
.inv-loader-barcode {
  text-align: center;
}
.inv-loader-barcode .barcode {
  display: inline-flex;
  align-items: flex-end;
  gap: 6px;
  height: 32px;
}
.inv-loader-barcode .bar {
  width: 6px;
  background: #007bff;
  border-radius: 3px;
  transform-origin: bottom center;
  animation: invBar 1s ease-in-out infinite;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.06);
}
.inv-loader-barcode .bar.b1 {
  height: 14px;
  animation-delay: 0s;
}
.inv-loader-barcode .bar.b2 {
  height: 18px;
  animation-delay: 0.1s;
}
.inv-loader-barcode .bar.b3 {
  height: 24px;
  animation-delay: 0.2s;
}
.inv-loader-barcode .bar.b4 {
  height: 18px;
  animation-delay: 0.3s;
}
.inv-loader-barcode .bar.b5 {
  height: 14px;
  animation-delay: 0.4s;
}

@keyframes invBar {
  0%,
  40%,
  100% {
    transform: scaleY(0.4);
    opacity: 0.5;
  }
  20% {
    transform: scaleY(1);
    opacity: 1;
  }
}

.inv-loader-barcode .loader-text {
  margin-top: 12px;
  font-weight: 600;
  color: #343a40;
  opacity: 0.85;
  letter-spacing: 0.2px;
}

@media (max-width: 768px) {
  .btn span {
    display: none;
    /* Hide button text for mobile view */
  }
  .btn i,
  .btn img {
    margin-right: 0;
    width: 20px;
    height: 20px;
  }
}

/* TLS modal theme */
.tls-modal .modal-content {
  position: relative;
  overflow: visible;
  border-radius: 24px;
  border: 1px solid rgba(15, 31, 45, 0.12);
  background: linear-gradient(140deg, #f7f6ff 0%, #f6fbff 45%, #fff7ef 100%);
  box-shadow: 0 32px 60px rgba(9, 21, 38, 0.26);
}

.tls-modal .modal-content::before,
.tls-modal .modal-content::after {
  content: "";
  position: absolute;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  filter: blur(2px);
  opacity: 0.4;
  pointer-events: none;
}

.tls-modal .modal-content::before {
  top: -120px;
  right: -70px;
  background: radial-gradient(circle, rgba(255, 122, 89, 0.45), rgba(255, 122, 89, 0));
}

.tls-modal .modal-content::after {
  bottom: -130px;
  left: -90px;
  background: radial-gradient(circle, rgba(73, 190, 255, 0.4), rgba(73, 190, 255, 0));
}

.tls-modal .modal-header {
  border-bottom: none;
  padding: 1.4rem 1.6rem 0.6rem;
  position: relative;
  z-index: 1;
}

.tls-modal .modal-title {
  font-weight: 700;
  font-size: 1.05rem;
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  color: #0f1f2d;
}

.tls-modal .modal-title i {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #ff7a59 0%, #ffd166 100%);
  color: #0f1f2d;
  box-shadow: 0 12px 24px rgba(255, 122, 89, 0.3);
}

.tls-modal .close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: 12px;
  background: rgba(15, 31, 45, 0.08);
  color: #0f1f2d;
  opacity: 1;
  transition: background 0.2s ease, transform 0.2s ease;
  line-height: 1;
  font-size: 1.2rem;
}

.tls-modal .close span {
  display: block;
  line-height: 1;
}

.tls-modal .close:hover {
  background: rgba(15, 31, 45, 0.16);
  transform: translateY(-1px);
}

.tls-modal .modal-body {
  padding: 0.4rem 1.6rem 1.4rem;
  position: relative;
  z-index: 1;
}

.tls-modal .select2-container--open .select2-dropdown {
  top: 100% !important;
  bottom: auto !important;
}

.tls-modal .select2-container--open .select2-dropdown.select2-dropdown--above {
  top: 100% !important;
  bottom: auto !important;
}

.tls-modal .select2-dropdown {
  z-index: 1065;
}

.tls-modal .modal-footer {
  border-top: none;
  padding: 0 1.6rem 1.6rem;
  gap: 0.6rem;
}

.tls-modal .modal-footer .btn-secondary {
  border-radius: 14px;
  background: rgba(15, 31, 45, 0.12);
  border: none;
  color: #0f1f2d;
  font-weight: 600;
}

.tls-modal .modal-footer .btn-primary {
  border-radius: 14px;
  border: none;
  background: linear-gradient(135deg, #0f1f2d 0%, #244e6d 100%);
  box-shadow: 0 16px 30px rgba(15, 31, 45, 0.25);
  font-weight: 600;
}

.tls-modal .modal-footer .btn-danger {
  border-radius: 14px;
  border: none;
  background: linear-gradient(135deg, #ff5d5d 0%, #ff8f70 100%);
  box-shadow: 0 16px 30px rgba(255, 93, 93, 0.25);
  font-weight: 600;
}

.tls-modal .form-control,
.tls-modal .form-control-file {
  border-radius: 12px;
  border: 1px solid rgba(15, 31, 45, 0.12);
  background: #fff;
  padding: 0.6rem 0.75rem;
  box-shadow: inset 0 1px 2px rgba(15, 31, 45, 0.06);
}

.tls-modal select.form-control option:disabled {
  color: #98a2ad;
  background-color: #f4f6f8;
}

.tls-modal select.form-control {
  height: calc(1.5em + 1.2rem + 2px);
  line-height: 1.5;
}

.tls-modal .form-control:focus {
  border-color: rgba(255, 122, 89, 0.7);
  box-shadow: 0 0 0 0.2rem rgba(255, 122, 89, 0.2);
}

.tls-modal .tls-modal-section {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(15, 31, 45, 0.08);
  border-radius: 18px;
  padding: 1rem 1.1rem;
  box-shadow: 0 12px 24px rgba(15, 31, 45, 0.08);
  margin-bottom: 1rem;
}

.tls-modal .tls-modal-section-title {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #3a4a5d;
  margin-bottom: 0.75rem;
}

.tls-modal .tls-modal-section-title i {
  color: #ff7a59;
}

@media (max-width: 575px) {
  .tls-modal .modal-header,
  .tls-modal .modal-body,
  .tls-modal .modal-footer {
    padding-left: 1.2rem;
    padding-right: 1.2rem;
  }
}
