/* One shared logo loader; preserve existing visibility and request lifecycles. */
body .complaint-spinner,
body .certificate-spinner,
body .trend-loading-spinner,
body .preview-loader .spinner,
body .swal2-loader,
body .dataTables_processing::before,
body .dt-processing::before,
body .select2-results__option.loading-results::before {
  width:64px !important;
  height:64px !important;
  flex-shrink:0;
  padding:0 !important;
  border:0 !important;
  border-radius:10px !important;
  background-image:url('../media/unilab/loading-ball.svg'),url('../media/unilab/myup.png') !important;
  background-position:center !important;
  background-size:100% 100% !important;
  background-repeat:no-repeat !important;
  background-color:transparent !important;
  animation:none !important;
  transform:none !important;
  box-sizing:border-box;
}
/* Button feedback stays compact; logo loaders are reserved for page overlays. */
body .button-spinner {
  display:inline-block; width:18px; height:18px; flex:0 0 18px;
  padding:0; border:2px solid currentColor; border-right-color:transparent;
  border-radius:50%; background:none; vertical-align:middle;
  animation:portal-button-spin .7s linear infinite;
}
@keyframes portal-button-spin { to { transform:rotate(360deg); } }
body .swal2-loader { width:80px !important; height:80px !important; border-radius:16px !important; }
body .dataTables_processing::before,
body .dt-processing::before { content:''; display:block; margin:0 auto 10px; }
body .dataTables_processing > div,
body .dt-processing > div { display:none; }
body .select2-results__option.loading-results::before { content:''; display:block; width:36px !important; height:36px !important; margin:0 auto 8px; border-radius:8px !important; }

body .trend-loading-box,
body .preview-loader,
body .certificate-loader,
body .complaint-busy { flex-direction:column; align-items:center; justify-content:center; gap:16px; text-align:center; color:#fff; }
body .trend-loading-box { background:transparent; border:0; box-shadow:none; }
body .trend-loading,
body .preview-loader,
body .certificate-loader { background:rgba(5,30,45,.68); backdrop-filter:blur(4px); }
body .complaint-busy { inset:0; width:auto; height:auto; transform:none; border-radius:0; padding:24px; background:rgba(5,30,45,.68); backdrop-filter:blur(4px); box-shadow:none; }
body .trend-loading-box > span:last-child,
body .preview-loader > span:last-child,
body .certificate-loader > span:last-child,
body .complaint-busy > span:last-child {
  color:#fff; font-size:14px; font-weight:600; letter-spacing:.4px;
  text-shadow:0 2px 8px rgba(0,0,0,.35); animation:portal-loading-text 1.8s ease-in-out infinite;
}
/* Only loading alerts lose their panel; confirmations retain the normal theme. */
body .swal2-popup[data-loading="true"] { display:flex !important; flex-direction:column; align-items:center; background:transparent; border:0; box-shadow:none; padding:24px; }
body .swal2-popup[data-loading="true"] .swal2-actions { order:-1; margin:0 0 18px; }
body .swal2-popup[data-loading="true"] .swal2-title,
body .swal2-popup[data-loading="true"] .swal2-html-container { color:white; font-size:17px; letter-spacing:.3px; padding:0; margin:0 0 10px; text-shadow:0 2px 8px #0006; animation:portal-loading-text 1.8s ease-in-out infinite; }
body .button:has(.button-spinner) { flex-direction:row; align-items:center; justify-content:center; gap:8px; }
body .select2-results__option.loading-results { text-align:center; color:var(--ink); }
body .dataTables_processing,
body .dt-processing { height:auto; padding:20px; background:transparent; border:0; box-shadow:none; color:var(--ink); text-align:center; }
@keyframes portal-loading-text { 0%,100% { opacity:1; transform:translateY(0); } 50% { opacity:.72; transform:translateY(2px); } }
@media (prefers-reduced-motion:reduce) {
  body .trend-loading-box > span:last-child,body .preview-loader > span:last-child,
  body .certificate-loader > span:last-child,body .complaint-busy > span:last-child,
  body .swal2-popup[data-loading="true"] .swal2-title,
  body .swal2-popup[data-loading="true"] .swal2-html-container,
  body .button-spinner { animation:none; }
}
