* { box-sizing: border-box; }
body { font-family: 'Manrope', sans-serif; }
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: #0B1120; }
::-webkit-scrollbar-thumb { background: #1E293B; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #334155; }
::selection { background: rgba(59, 130, 246, 0.3); color: #F8FAFC; }
input, select, button, a { transition: color 200ms, background-color 200ms, border-color 200ms, box-shadow 200ms; }
table tbody tr { transition: background-color 150ms ease; }

/* ------------------------------
   Global loading indicators
   ------------------------------ */
.global-topbar{
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0;
  z-index: 9999;
  background: var(--brand-primary, #2563eb);
  box-shadow: 0 0 12px rgba(37, 99, 235, .45);
  transition: width 300ms ease;
}
.global-topbar.active{ width: 70%; animation: topbarPulse 1.2s ease-in-out infinite; }
.global-topbar.done{ width: 100%; animation: none; }
@keyframes topbarPulse{ 0%{ filter: brightness(1); } 50%{ filter: brightness(1.35); } 100%{ filter: brightness(1); } }

.global-overlay{
  position: fixed;
  inset: 0;
  z-index: 9998;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(2, 6, 23, 0.55);
  backdrop-filter: blur(6px);
}
.global-overlay.hidden{ display: none; }
.global-overlay-card{
  width: min(520px, calc(100% - 32px));
  border-radius: 20px;
  background: rgba(15, 23, 42, 0.94);
  border: 1px solid rgba(148, 163, 184, 0.18);
  box-shadow: 0 18px 50px rgba(0,0,0,.45);
  padding: 18px 20px;
  display: flex;
  gap: 14px;
  align-items: center;
}
.global-loader-visual{
  position: relative;
  width: 64px;
  height: 64px;
  flex: 0 0 64px;
}
.global-loader-ring{
  position: absolute;
  inset: 0;
  border-radius: 999px;
  border: 3px solid rgba(148, 163, 184, 0.16);
  border-top-color: var(--brand-primary, #2563eb);
  border-right-color: var(--brand-secondary, #22c55e);
  animation: spin 1s linear infinite;
  box-shadow: 0 0 16px rgba(37, 99, 235, 0.18);
}
.global-loader-visual::after{
  content: "";
  position: absolute;
  inset: -6px;
  border-radius: 999px;
  border: 1px dashed rgba(148, 163, 184, 0.18);
  animation: spinReverse 6s linear infinite;
}
.global-loader-core{
  position: absolute;
  inset: 9px;
  border-radius: 999px;
  background: linear-gradient(145deg, rgba(30,41,59,.95), rgba(15,23,42,.96));
  border: 1px solid rgba(148,163,184,.18);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  animation: pulseSoft 1.5s ease-in-out infinite;
}
.global-loader-logo{
  width: 78%;
  height: 78%;
  object-fit: contain;
}
.global-loader-fallback{
  font-size: 18px;
  font-weight: 800;
  letter-spacing: .08em;
  color: #e2e8f0;
}
.global-overlay-title{ font-weight: 700; font-size: 14px; color: #e2e8f0; }
.global-overlay-subtitle{ margin-top: 2px; font-size: 12px; color: rgba(226, 232, 240, 0.7); }
.global-spinner{
  width: 20px;
  height: 20px;
  border-radius: 999px;
  border: 2px solid rgba(148, 163, 184, 0.25);
  border-top-color: var(--brand-primary, #2563eb);
  animation: spin 0.85s linear infinite;
  flex: 0 0 auto;
}
@keyframes spin{ to{ transform: rotate(360deg); } }
@keyframes spinReverse{ to{ transform: rotate(-360deg); } }
@keyframes pulseSoft{ 0%,100%{ transform: scale(1); } 50%{ transform: scale(1.04); } }

body.ui-busy{ cursor: progress; }

.btn-loading{
  pointer-events: none;
  opacity: .85;
}
.btn-loading .btn-spinner{
  display: inline-block;
  width: 14px;
  height: 14px;
  border-radius: 999px;
  border: 2px solid rgba(255,255,255,0.35);
  border-top-color: rgba(255,255,255,0.95);
  animation: spin 0.85s linear infinite;
  margin-right: 8px;
  vertical-align: -2px;
}
input.btn-loading{
  background-image: linear-gradient(90deg, rgba(255,255,255,.12), rgba(255,255,255,.03));
}

@media print {
    body { background: white !important; color: black !important; }
    aside, header, nav, .print\\:hidden { display: none !important; }
    main { padding: 0 !important; margin: 0 !important; }
    .lg\\:ml-64 { margin-left: 0 !important; }
}


.table-mobile-scroll{
  width: 100%;
}
.table-mobile-scroll > table{
  width: 100%;
}
@media (max-width: 768px){
  .table-mobile-scroll{
    overflow-x: auto;
    overflow-y: visible;
    -webkit-overflow-scrolling: touch;
    border-radius: 12px;
  }
  .table-mobile-scroll > table{
    width: max-content;
    min-width: var(--table-min-width, 720px);
  }
}



.table-mobile-scroll.force-mobile-scroll{
  overflow-x:auto;
  overflow-y:visible;
  -webkit-overflow-scrolling:touch;
}
.table-mobile-scroll.force-mobile-scroll > table{
  width:max-content;
  min-width:var(--table-min-width, 860px);
}
@media (min-width: 769px){
  .table-mobile-scroll.force-mobile-scroll > table{
    width:100%;
    min-width:100%;
  }
}
