@media (max-width: 768px) {
  .value {
    font-size: 3rem !important;
  }

  .card-header {
    font-size: 0.9rem;
    padding: 0.5rem;
  }

  .accordion-button {
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
  }

  .chart-container {
    height: 250px !important;
  }

  .table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .modal-dialog {
    margin: 0.5rem auto;
  }

  .rt-card .card-body h1 {
    font-size: 1.5rem;
  }

  #usiaTable {
    min-width: 600px;
  }

  .fs-0-8 {
    font-size: 0.8rem !important;
  }
  
  .ntop {
        margin-top: 15% !important;
    }
    
  #fab-container {
      position: fixed !important;
      bottom: 200px !important;
      right: 10px !important;
      z-index: 999999 !important;
      pointer-events: none !important;
    }
}

@media (max-width: 767.98px) {
  .modal-btn-fix {
    z-index: 10 !important;
    position: relative !important;
  }

  .carousel-control-prev,
  .carousel-control-next {
    z-index: 9 !important;
  }

  .modal-btn-fix::after {
    content: '';
    position: absolute;
    top: -5px;
    left: -5px;
    right: -5px;
    bottom: -5px;
    z-index: -1;
  }
}

.modal-backdrop {
  z-index: 1040 !important;
}

.modal {
  z-index: 1050 !important;
}

.modal-backdrop.show {
  opacity: 0.5;
  cursor: pointer;
}

.btn-close {
  filter: invert(1) grayscale(100%) brightness(200%);
}

.dem-top {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  background-color: rgba(215, 219, 221, 0.4);
}

.dem-pcon {
  padding-top: 1%;
}

.dem-fs-up {
  font-size: 2.3rem;
}

.dem-fs-up-dua {
  font-size: 1.1rem;
}

.dem-fs {
  font-size: 3rem;
}

.dem-tab-up {
  overflow-x: auto;
  width: 100%;
}

.dem-btn-z {
  z-index: 10;
}

.dem-cc-h {
  height: 250px;
}

.dem-cc-hL {
  height: 200px;
}

.card .inner-card {
  transition: all 0.2s ease-in-out;
}

.card .inner-card:hover {
  transform: scale(1.03);
}

.clr-cyan {
  background-color: #00ffff !important;
}

.remajacard-body {
  padding: 1rem !important;
}

.remajacard-body .row {
  margin: 0;
}

.remajacard-body .col-6 {
  padding: 0.5rem;
}

.card-header .btn {
  margin-left: auto;
}

.card-header i.fas.fa-table {
  color: #0d6efd;
}

.wd-100 {
  width: 100% !important;
}

.wd-10 {
  width: 10% !important;
}

.wd-20 {
  width: 20% !important;
}

.hg-250p {
  height: 250px !important;
}

.hg-350p {
  height: 350px !important;
}

.chart-scroll-container {
  overflow-x: auto;
  overflow-y: hidden;
  width: 100%;
}

.chart-scroll-container::-webkit-scrollbar {
  height: 6px;
}

.chart-scroll-container::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 4px;
}

.chart-size-provinsi {
  height: 300px;
  min-width: 700px;
}

.dual-chart-wrapper {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
}

.chart-box {
  flex: 1;
  min-width: 250px;
  max-width: 350px;
  height: 300px;
  position: relative;
}

.chart-legend {
  margin-top: 1rem;
  font-size: 0.9rem;
}

.chart-legend-item {
  display: flex;
  align-items: center;
  margin-bottom: 0.25rem;
}

.chart-legend-color {
  display: inline-block;
  width: 14px;
  height: 14px;
  border-radius: 3px;
  margin-right: 6px;
}

.stat-card .stat-loading {
  display: inline-block;
  width: 40px;
  height: 40px;
  border: 4px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: stat-spin 1s linear infinite;
}

.stat-card.bg-white .stat-loading,
.stat-card.bg-light .stat-loading,
.card-body.bg-white .stat-loading {
  border: 4px solid rgba(13, 110, 253, 0.2);
  border-top-color: #0d6efd;
}

.stat-loading-blue {
  display: inline-block;
  width: 40px;
  height: 40px;
  border: 4px solid rgba(13, 110, 253, 0.2);
  border-top-color: #0d6efd;
  border-radius: 50%;
  animation: stat-spin 1s linear infinite;
}

.stat-card.bg-white .stat-loading,
.stat-card.bg-light .stat-loading,
.card-body.bg-white .stat-loading {
  border: 4px solid rgba(13, 110, 253, 0.2);
  border-top-color: #c92f2f;
}

.stat-loading-red {
  display: inline-block;
  width: 40px;
  height: 40px;
  border: 4px solid rgba(13, 110, 253, 0.2);
  border-top-color: #c92f2f;
  border-radius: 50%;
  animation: stat-spin 1s linear infinite;
}

.stat-card.bg-white .stat-loading,
.stat-card.bg-light .stat-loading,
.card-body.bg-white .stat-loading {
  border: 4px solid rgba(13, 110, 253, 0.2);
  border-top-color: #228b22;
}

.stat-loading-green {
  display: inline-block;
  width: 40px;
  height: 40px;
  border: 4px solid rgba(13, 110, 253, 0.2);
  border-top-color: #228b22;
  border-radius: 50%;
  animation: stat-spin 1s linear infinite;
}

@keyframes stat-spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes statFadeIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.stat-card .stat-loaded {
  animation: statFadeIn 0.5s ease-out;
}

.stat-card .stat-hidden {
  display: none;
}

.stat-card {
  position: relative;
  min-height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.table-loading {
  position: relative;
  height: 10px;
  background: linear-gradient(90deg, #e0f7fa 0%, #b2ebf2 50%, #e0f7fa 100%);
  background-size: 200% 100%;
  animation: table-wave 1.5s ease-in-out infinite;
  border-radius: 4px;
  overflow: hidden;
}

.table-loading-alt {
  background: linear-gradient(90deg, #e0f7fa 0%, #b2ebf2 50%, #e0f7fa 100%);
  background-size: 200% 100%;
  animation: table-wave 1.5s ease-in-out infinite;
}

@keyframes table-wave {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

.td-loading {
  color: transparent !important;
  user-select: none;
}

.td-loaded {
  animation: tdFadeIn 0.4s ease-out;
}

@keyframes tdFadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

td .table-loading {
  width: 60%;
  margin: 0 auto;
  min-width: 30px;
}

.chart-loading-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: rgba(255, 255, 255, 0.9);
  z-index: 10;
}

.chart-loading-container.hidden {
  display: none;
}

.chart-loading {
  display: inline-block;
  width: 50px;
  height: 50px;
  border: 5px solid rgba(13, 110, 253, 0.2);
  border-top-color: #0d6efd;
  border-radius: 50%;
  animation: chart-spin 1s linear infinite;
}

@keyframes chart-spin {
  to {
    transform: rotate(360deg);
  }
}

.chart-loading-text {
  position: absolute;
  top: 60%;
  left: 50%;
  transform: translateX(-50%);
  color: #6c757d;
  font-size: 0.9rem;
  margin-top: 10px;
  white-space: nowrap;
}

.chart-container {
  position: relative;
}

#fab-container {
  position: fixed !important;
  bottom: 130px !important;
  right: 10px !important;
  z-index: 999999 !important;
  pointer-events: none !important;
}

#backToTop {
  pointer-events: auto !important;
  width: 56px !important;
  height: 56px !important;
  border-radius: 50% !important;
  border: none !important;
  cursor: pointer !important;
  font-size: 24px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;

  background: rgba(0, 123, 255, 0.3) !important;
  color: rgba(255, 255, 255, 0.8) !important; 

  backdrop-filter: blur(10px) !important;
  -webkit-backdrop-filter: blur(10px) !important;

  border: 1px solid rgba(255, 255, 255, 0.2) !important;

  box-shadow:
    0 4px 12px rgba(0, 123, 255, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.2) !important;

  opacity: 0 !important;
  visibility: hidden !important;
  transform: translateY(20px) scale(0.8) !important;
  transition:
    opacity 0.3s ease,
    transform 0.3s ease,
    visibility 0.3s ease,
    background-color 0.3s ease !important;
}

#backToTop.show {
  opacity: 1 !important;
  visibility: visible !important;
  transform: translateY(0) scale(1) !important;
}

#backToTop:hover {
  background: rgba(0, 123, 255, 0.5) !important;
  color: rgba(255, 255, 255, 1) !important;
  transform: translateY(-4px) scale(1.05) !important;
  box-shadow:
    0 8px 24px rgba(0, 123, 255, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.3) !important;
}

@keyframes pulse-debug {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.15);
  }
}

#backToTop-debug.first-show {
  animation: pulse-debug 0.5s ease-in-out !important;
}

html,
body {
  height: auto !important;
  overflow: auto !important;
}
