/* Custom Sidebar Layout CSS - Hanya untuk Admin Pages */

/* Main wrapper dengan flexbox - hanya untuk admin */
.main-wrapper {
  display: flex;
  height: 100vh;
  width: 100%;
  overflow: hidden;
}

/* Smooth icon toggle button */
.main-wrapper .aside-menu-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  transition: all 0.2s ease;
}

.main-wrapper .aside-menu-link:hover {
  background: rgba(255, 255, 255, 0.1);
}

.main-wrapper .aside-menu-link svg {
  width: 20px;
  height: 20px;
  stroke-width: 2;
}

/* Fix icon alignment & spacing */
.main-wrapper .nav-aside .nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  position: relative;
}

.main-wrapper .nav-aside .nav-link i:first-child {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  text-align: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.main-wrapper .nav-aside .nav-link span {
  flex: 1;
  line-height: 1.5;
}

/* Submenu arrow indicator - menggunakan CSS ::after pseudo-element seperti template DashForge */
.main-wrapper .nav-aside .nav-item.with-sub .nav-link::after {
  content: '\ea6e';
  font-family: 'remixicon';
  font-size: 16px;
  display: inline-block;
  position: relative;
  margin-left: auto;
  opacity: 0.5;
  transition: transform 0.3s ease, opacity 0.3s ease;
  line-height: 1;
}

/* Rotasi panah saat submenu dibuka */
.main-wrapper .nav-aside .nav-item.with-sub.show .nav-link::after {
  transform: rotate(90deg);
  opacity: 0.7;
}

/* Hide submenu arrow saat minimize */
.main-wrapper .aside.minimize .nav-item.with-sub .nav-link::after {
  display: none;
}

/* Submenu styling - sejajar dengan template */
.main-wrapper .nav-aside .nav-item.with-sub ul {
  opacity: 0;
  visibility: hidden;
  height: 0;
  padding-left: 30px;
  transition: all 0.3s ease;
  overflow: hidden;
}

.main-wrapper .nav-aside .nav-item.with-sub.show ul {
  opacity: 1;
  visibility: visible;
  height: auto;
  padding-bottom: 10px;
}

/* Sidebar styles - mengikuti template aside-fixed */
.main-wrapper .aside {
  flex-shrink: 0;
  width: 250px;
  transition: width 0.3s ease, margin-left 0.3s ease;
  z-index: 1000;
  height: 100vh;
  display: flex;
  flex-direction: column;
}

.main-wrapper .aside.minimize {
  width: 60px;
}

/* Content area - AUTO ADJUST width based on sidebar */
.main-wrapper .content {
  flex: 1;
  min-width: 0;
  transition: all 0.3s ease;
  overflow-y: auto;
  height: 100vh;
}

/* Mobile Header Bar - sesuai screenshot konsep */
.main-wrapper .mobile-header-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 60px;
  background-color: #0d6efd; /* Warna bg-primary Bootstrap sama dengan filter button */
  z-index: 1025;
  display: none; /* Hidden di desktop */
  align-items: center;
  padding: 0 20px;
  color: white;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.main-wrapper .mobile-header-bar .mobile-toggle {
  background: none;
  border: none;
  color: white;
  font-size: 20px;
  padding: 10px;
  margin-right: 20px;
  cursor: pointer;
  line-height: 1;
  border-radius: 4px;
  transition: background-color 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
}

.main-wrapper .mobile-header-bar .mobile-toggle i {
  width: 20px;
  height: 20px;
  stroke-width: 2;
}

.main-wrapper .mobile-header-bar .mobile-toggle:hover {
  background: rgba(255, 255, 255, 0.1);
}

.main-wrapper .mobile-header-bar .mobile-info {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  font-size: 14px;
}

.main-wrapper .mobile-header-bar .mobile-brand {
  font-weight: 500;
  color: #ffffff; /* Putih untuk kontras dengan background biru tua */
}

.main-wrapper .mobile-header-bar .mobile-period-select {
  background-color: transparent; /* Transparan agar nyatu dengan header */
  color: #ffffff; /* Text putih */
  border: 1px solid #ffffff; /* Border putih */
  padding: 6px 12px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  outline: none;
  cursor: pointer;
}

.main-wrapper .mobile-header-bar .mobile-period-select:focus {
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.3);
  border-color: #ffffff;
}

.main-wrapper .mobile-header-bar .mobile-period-select option {
  background-color: #0d6efd; /* Background biru untuk options */
  color: #ffffff;
}

/* Aside body container - Perfect Scrollbar akan di-apply di sini */
.main-wrapper .aside-body {
  flex: 1;
  position: relative;
  overflow: hidden;
  min-height: 0;
}

/* Mobile responsive - sesuai konsep HTML */
@media (max-width: 991px) {
  .main-wrapper {
    position: relative;
  }
  
  /* PAKSA Show mobile header bar di mobile */
  .main-wrapper .mobile-header-bar {
    display: flex !important;
  }
  
  .main-wrapper .aside {
    position: fixed;
    left: -250px;
    top: 0;
    bottom: 0;
    z-index: 1050;
    width: 250px !important;
    transition: left 0.3s ease;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
  }
  
  /* Show sidebar saat mobile open */
  body.show-aside .main-wrapper .aside {
    left: 0;
  }
  
  .main-wrapper .content {
    width: 100% !important;
    margin-left: 0 !important;
    max-width: 100vw !important;
    padding: 15px;
    padding-top: 80px !important; /* PAKSA Space for mobile header bar */
  }
  
  /* Backdrop untuk mobile */
  body.show-aside .aside-backdrop {
    display: block;
  }
}

/* Minimize behavior untuk desktop - hanya untuk admin */
@media (min-width: 992px) {
  /* Text dan elemen yang disembunyikan saat minimize */
  .main-wrapper .aside.minimize .aside-brand span:not(:first-child),
  .main-wrapper .aside.minimize .nav-link span,
  .main-wrapper .aside.minimize .aside-loggedin-user,
  .main-wrapper .aside.minimize .nav-label {
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
  }
  
  .main-wrapper .aside.minimize .aside-brand {
    font-size: 14px;
    text-align: center;
  }
  
  /* Dropdown menu tetap tersembunyi saat minimize */
  .main-wrapper .aside.minimize .collapse {
    display: none !important;
  }
  
  .main-wrapper .aside:not(.minimize) .aside-brand span,
  .main-wrapper .aside:not(.minimize) .nav-link span,
  .main-wrapper .aside:not(.minimize) .aside-loggedin-user,
  .main-wrapper .aside:not(.minimize) .nav-label {
    opacity: 1;
    visibility: visible;
    transition: opacity 0.2s ease, visibility 0.2s ease;
  }
}

/* Backdrop untuk mobile - global tapi hanya untuk admin pages */
.aside-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1040;
  display: none;
}

/* Smooth animations - hanya untuk admin */
.main-wrapper * {
  box-sizing: border-box;
}

.main-wrapper .aside,
.main-wrapper .content {
  transition: all 0.3s ease-in-out;
}