/* ===== BARU: Memastikan semua elemen menghitung lebar dengan benar ===== */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  padding: 0;
  font-family: "Poppins", sans-serif;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background-color: #f8f9fa;
}

/* ===== DIUBAH: Padding disamakan dengan navbar untuk alignment sempurna ===== */
.content-body {
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  flex-grow: 1;
  padding: 0 30px;
  /* Padding horizontal disamakan dengan navbar (30px) */
}

.main-container {
  width: 100%;
  padding: 0;
}

.navbar-custom {
  background: linear-gradient(135deg, #1e5bb8 0%, #4a90e2 100%);
  border-radius: 25px;
  margin: 20px auto;
  max-width: 1200px;
  padding: 15px 30px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.navbar-brand {
  color: white !important;
  font-weight: bold;
  font-size: 1.8rem;
}

.navbar-brand img {
  width: 30%;
  min-width: 100px;
}

.navbar-brand img,
.navbar-brand i {
  margin-right: 10px;
  font-size: 2rem;
}

.navbar-nav .nav-link {
  color: white !important;
  margin: 0 15px;
  font-weight: 500;
  transition: all 0.3s ease;
}

.navbar-nav .nav-link:hover {
  color: #ffd700 !important;
  transform: translateY(-2px);
}

.navbar-nav .nav-link.active {
  color: #ffd700 !important;
  font-weight: 600;
}

.btn-login {
  background: white;
  color: #1e5bb8;
  border: none;
  padding: 10px 25px;
  border-radius: 25px;
  font-weight: bold;
  transition: all 0.3s ease;
}

.btn-login:hover {
  background: #f8f9fa;
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.page-header {
  color: #212529;
  text-align: center;
  margin: 30px 0;
}

.page-title {
  font-size: 2.5rem;
  font-weight: bold;
  margin-bottom: 10px;
}

.page-subtitle {
  font-size: 1.1rem;
  opacity: 0.9;
}

.filter-panel {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 20px;
  background: #ffffff;
  border: 1px solid #dee2e6;
  border-radius: 25px;
  padding: 20px 30px;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.05);
  margin-top: 30px;
}

.filter-title {
  display: none;
}

.filter-group {
  flex: 1;
  min-width: 180px;
  margin-bottom: 0;
}

.filter-label {
  color: #333;
  font-weight: 600;
  margin-bottom: 8px;
  font-size: 0.9rem;
  display: block;
}

.form-select,
.form-control {
  background-color: #f8f9fa;
  border: 1px solid #ced4da;
  border-radius: 12px;
  padding: 12px 15px;
  font-size: 0.9rem;
  transition: all 0.3s ease;
  width: 100%;
}

.form-select:focus,
.form-control:focus {
  border-color: #4a90e2;
  box-shadow: 0 0 0 0.2rem rgba(74, 144, 226, 0.25);
  background-color: white;
}

.btn-apply-filter {
  background: linear-gradient(135deg, #1e5bb8 0%, #4a90e2 100%);
  border: none;
  border-radius: 50%;
  width: 50px;
  height: 50px;
  color: white;
  transition: all 0.3s ease;
  animation: pulse-animation 2.5s infinite;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  margin-top: 0;
}

.btn-apply-filter:hover {
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 8px 25px rgba(30, 91, 184, 0.3);
}

.main-content {
  width: 100%;
}

.stats-container {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin: 2rem 0;
}

.stat-widget {
  flex: 1;
  min-width: 250px;
  padding: 2rem 1.5rem;
  border-radius: 12px;
  color: white;
  margin-bottom: 1.5rem;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  position: relative;
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.stat-widget:nth-child(1) {
  background: linear-gradient(135deg, #667eea, #764ba2);
}

.stat-widget:nth-child(2) {
  background: linear-gradient(135deg, #f093fb, #f5576c);
}

.stat-widget:nth-child(3) {
  background: linear-gradient(135deg, #4facfe, #00f2fe);
}

.stat-widget::before {
  content: "";
  position: absolute;
  top: 0;
  left: -85%;
  width: 70%;
  height: 100%;
  background: linear-gradient(
    to right,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.3) 50%,
    rgba(255, 255, 255, 0) 100%
  );
  transform: skewX(-25deg);
  transition: left 0.8s ease;
}

.stat-widget:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 25px rgba(0, 0, 0, 0.15);
}

.stat-widget:hover::before {
  left: 110%;
}

.stat-value {
  font-size: 1.8rem;
  font-weight: bold;
  margin-bottom: 0.5rem;
}

.stat-label {
  font-size: 1rem;
  opacity: 0.9;
}

.chart-container {
  background: #ffffff;
  border: 1px solid #dee2e6;
  border-radius: 20px;
  padding: 30px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
  height: 100%;
}

.chart-title {
  color: #1e5bb8;
  font-weight: bold;
  font-size: 1.3rem;
  margin-bottom: 20px;
  text-align: center;
}

.chart-wrapper {
  position: relative;
  height: 400px;
}

.tabs-container {
  background: #ffffff;
  border: 1px solid #dee2e6;
  border-radius: 20px;
  padding: 30px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
  margin-top: 2rem;
}

.nav-tabs {
  border-bottom: 2px solid rgba(30, 91, 184, 0.1);
  margin-bottom: 25px;
}

.nav-tabs .nav-link {
  background: transparent;
  border: none;
  color: #666;
  font-weight: 600;
  padding: 15px 30px;
  border-radius: 15px 15px 0 0;
  transition: all 0.3s ease;
  margin-right: 10px;
}

.nav-tabs .nav-link:hover {
  background: rgba(30, 91, 184, 0.05);
  color: #1e5bb8;
}

.nav-tabs .nav-link.active {
  background: linear-gradient(135deg, #1e5bb8 0%, #4a90e2 100%);
  color: white;
  border-bottom: 2px solid transparent;
}

.table {
  font-size: 0.9rem;
  vertical-align: middle;
}

.table thead th {
  background-color: #e9ecef;
  color: #343a40;
  border-bottom-width: 1px;
  font-weight: 600;
}

.table tfoot td {
  font-weight: bold;
}

.footer {
  width: 100%;
  background: linear-gradient(135deg, #1e5bb8 0%, #4a90e2 100%);
  border-top: 2px solid rgba(255, 255, 255, 0.2);
  padding: 15px 0;
  flex-shrink: 0;
  margin-top: 40px;
}

.footer-content {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.footer-text {
  color: white;
  font-size: 0.9rem;
  font-weight: 500;
  margin: 0;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
  letter-spacing: 0.5px;
}

.footer-divider {
  color: rgba(255, 255, 255, 0.6);
  margin: 0 15px;
  font-size: 1rem;
}

.footer-brand {
  color: #ffd700;
  font-weight: 600;
}

@keyframes pulse-animation {
  0% {
    box-shadow: 0 0 0 0 rgba(30, 91, 184, 0.7);
  }

  70% {
    box-shadow: 0 0 0 12px rgba(30, 91, 184, 0);
  }

  100% {
    box-shadow: 0 0 0 0 rgba(30, 91, 184, 0);
  }
}

/* ===== SKELETON LOADING STYLES ===== */
@keyframes skeleton-shimmer {
  0% {
    background-position: -200% 0;
  }

  100% {
    background-position: 200% 0;
  }
}

.skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s infinite;
  border-radius: 8px;
}

.skeleton-header {
  text-align: center;
  margin: 30px 0;
}

.skeleton-title {
  height: 2.5rem;
  width: 60%;
  margin: 0 auto 10px;
}

.skeleton-subtitle {
  height: 1.1rem;
  width: 40%;
  margin: 0 auto;
}

.skeleton-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin: 2rem 0;
}

.skeleton-stat-widget {
  flex: 1;
  min-width: 250px;
  height: 120px;
  border-radius: 12px;
  margin-bottom: 1.5rem;
}

.skeleton-charts {
  margin-top: 2rem;
}

.skeleton-chart-row {
  display: flex;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.skeleton-chart-container {
  flex: 1;
  background: #ffffff;
  border: 1px solid #dee2e6;
  border-radius: 20px;
  padding: 30px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
}

.skeleton-chart-title {
  height: 1.3rem;
  width: 70%;
  margin: 0 auto 20px;
}

.skeleton-chart-content {
  height: 400px;
  width: 100%;
}

.skeleton-table-area {
  height: 300px;
  width: 100%;
}

.skeleton-tabs {
  background: #ffffff;
  border: 1px solid #dee2e6;
  border-radius: 20px;
  padding: 30px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
  margin-top: 2rem;
}

.skeleton-tab-nav {
  display: flex;
  gap: 10px;
  margin-bottom: 25px;
}

.skeleton-tab-item {
  height: 45px;
  width: 120px;
  border-radius: 15px 15px 0 0;
}

.skeleton-tab-content {
  height: 400px;
  width: 100%;
}

/* ===== ERROR MESSAGE STYLES ===== */
.alert-custom-error {
  background: linear-gradient(135deg, #ff6b6b, #ee5a52);
  border: none;
  border-radius: 20px;
  color: white;
  padding: 20px;
  margin: 40px 0;
  box-shadow: 0 15px 35px rgba(255, 107, 107, 0.3);
  position: relative;
  overflow: hidden;
}

.alert-custom-error::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.2),
    transparent
  );
  transition: left 0.6s;
}

.alert-custom-error:hover::before {
  left: 100%;
}

.alert-custom-error .error-icon {
  font-size: 3rem;
  margin-bottom: 15px;
  display: block;
  animation: shake 0.5s ease-in-out;
}

.alert-custom-error .error-title {
  font-size: 1.5rem;
  font-weight: bold;
  margin-bottom: 10px;
}

.alert-custom-error .error-message {
  font-size: 1rem;
  opacity: 0.9;
  line-height: 1.5;
}

.alert-custom-error .btn-retry {
  background: rgba(255, 255, 255, 0.2);
  border: 2px solid rgba(255, 255, 255, 0.3);
  color: white;
  padding: 10px 25px;
  border-radius: 25px;
  font-weight: 600;
  margin-top: 20px;
  transition: all 0.3s ease;
}

.alert-custom-error .btn-retry:hover {
  background: rgba(255, 255, 255, 0.3);
  border-color: rgba(255, 255, 255, 0.5);
  transform: translateY(-2px);
}

@keyframes shake {
  0%,
  100% {
    transform: translateX(0);
  }

  25% {
    transform: translateX(-5px);
  }

  75% {
    transform: translateX(5px);
  }
}

/* ===== NO DATA MESSAGE STYLES ===== */
.no-data-container {
  text-align: center;
  padding: 10px 10px;
  margin: 30px 0;
  background: #ffffff;
  border: 1px solid #dee2e6;
  border-radius: 20px;
  color: #6c757d;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
}

.no-data-icon {
  font-size: 3rem;
  margin-bottom: 15px;
  color: #adb5bd;
}

.no-data-title {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 10px;
  color: #495057;
}

.no-data-message {
  font-size: 1rem;
  line-height: 1.5;
  /* max-width: 400px; */
  margin: 0 auto 20px;
  color: #6c757d;
}

.no-data-suggestions {
  background: #f8f9fa;
  border: 1px solid #e9ecef;
  border-radius: 12px;
  padding: 20px;
  margin-top: 20px;
}

.no-data-suggestions h6 {
  margin-bottom: 12px;
  font-weight: 600;
  color: #495057;
  font-size: 0.95rem;
}

.no-data-suggestions p {
  margin: 0;
  font-size: 0.9rem;
  color: #6c757d;
  line-height: 1.4;
}

@keyframes rotate {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0px);
  }

  50% {
    transform: translateY(-20px);
  }
}

/* ===== LOADING SPINNER FOR BUTTON ===== */
.loading-spinner {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top: 2px solid white;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-right: 8px;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

.btn-apply-filter.loading {
  animation: none;
  pointer-events: none;
}

@media (max-width: 767.98px) {
  .content-body {
    padding: 0 20px;
  }

  .filter-panel {
    flex-direction: column;
    align-items: stretch;
    padding: 20px;
    gap: 15px;
    margin-top: 20px;
  }

  .btn-apply-filter {
    width: 50px;
    height: 50px;
    align-self: center;
    margin-top: 10px;
  }

  .navbar-custom {
    margin: 10px 15px;
    padding: 10px 20px;
    border-radius: 20px;
  }

  .navbar-brand {
    font-size: 1.5rem;
  }

  .navbar-brand img {
    width: 40px;
    height: auto;
  }

  .navbar-nav .nav-link {
    margin: 5px 0;
    padding: 8px 15px;
    text-align: center;
  }

  .btn-login {
    padding: 8px 20px;
    font-size: 0.9rem;
    margin-top: 10px;
    margin-left: auto;
    margin-right: auto;
    display: block;
    width: fit-content;
  }

  .page-header {
    margin: 20px 0;
  }

  .page-title {
    font-size: 2rem;
  }

  .alert-custom-error {
    padding: 25px 20px;
    margin: 30px 0;
  }

  .alert-custom-error .error-title {
    font-size: 1.3rem;
  }

  .no-data-container {
    padding: 30px 20px;
    margin: 20px 0;
  }

  .no-data-icon {
    font-size: 2.5rem;
  }

  .no-data-title {
    font-size: 1.3rem;
  }

  .chart-container,
  .tabs-container {
    padding: 20px;
    border-radius: 15px;
  }

  .nav-tabs .nav-link {
    padding: 12px 20px;
    font-size: 0.9rem;
  }

  .footer {
    padding: 15px 0;
  }

  .footer-content {
    flex-direction: column;
    gap: 5px;
  }

  .footer-text {
    font-size: 0.8rem;
  }

  .footer-divider {
    display: none;
  }

  .skeleton-chart-row {
    flex-direction: column;
    gap: 1rem;
  }
}
