/* Reset & Basic Setup */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background-color: #f4f6f9;
}

/* ------------------------------------
   BOX A: Header (100% Lebar, 20% Tinggi)
------------------------------------ */
.box-a {
  width: 100%;
  height: 10vh;
  background-color: #ffffff;
  background-color: #2c3e50;
  background-color: #c00000;
  border-bottom: 2px solid #2c3e50;
  border-bottom: 2px solid #c00000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 20px;
}

.header-content h1 {
  color: #2c3e50;color: #ffffff;
  font-size: 1.7rem;
  text-align: center;
}
.header-content h5 {
  color: #2c3e50;color: #ffffff;
  font-size: 1rem;
  text-align: center;
  font-weight: normal;
}

/* ------------------------------------
   Main Body Wrapper (B & C Sharing Space)
   Height: 80vh (Sisa 80% dari Layar)
------------------------------------ */
.main-body {
  display: flex;
  height: 90vh;
  width: 100%;
  position: relative;
}

/* ------------------------------------
   BOX B: Sidebar Menu (Desktop Default)
   Awal: Ringkas (~60px)
   Aktif (Expanded): 20% Lebar Layar (20vw)
------------------------------------ */
.box-b {
  width: 60px; /* Lebar ringkas awal di Desktop */
  height: 100%;
  background-color: #2c3e50;
  background-color: #c00000;
  color: #ecf0f1;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  overflow: hidden;
  border-right: 1px solid #1a252f;
  border-right: 1px solid #c00000;
  z-index: 1000;
}

/* Status Sidebar saat terbuka di Desktop */
.box-b.expanded {
  width: 20vw;
}

/* Tombol Toggle Donut Icon (Internal Sidebar) */
.toggle-btn {
  width: 60px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.4rem;
  color: #e74c3c;
  transition: color 0.3s ease;
  flex-shrink: 0;
}

.toggle-btn:hover {
  color: #f39c12;
}

/* Menu Navigasi Sidebar */
.sidebar-menu {
  width: 100%;
  margin-top: 10px;
}

.sidebar-menu ul {
  list-style: none;
}

.sidebar-menu li {
  display: flex;
  align-items: center;
  padding: 7px 11px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s ease;
}

.sidebar-menu li:hover {
  background-color: #34495e;
  background-color: #8b5757;
}

.sidebar-menu li i {
  font-size: 1.2rem;
  min-width: 20px;
  margin-right: 15px;
  text-align: center;
}

.sidebar-menu li span {
  opacity: 0;
  transition: opacity 0.2s ease;
}

.sidebar-menu li a {
  text-decoration: none;
  color: #ffffff;
}

/* Tampilkan teks menu saat sidebar melebarkan diri */
.box-b.expanded .sidebar-menu li span {
  opacity: 1;
}

/* Overlay Gelap di Belakang Sidebar (untuk Mobile/Tablet) */
.sidebar-overlay {
  display: none;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 999;
}

.sidebar-overlay.active {
  display: block;
}

/* ------------------------------------
   BOX C: Penampung D dan E
------------------------------------ */
.box-c {
  flex: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
  background-color: #f8f9fa;
  width: 100%;
}

/* ------------------------------------
   BOX D: Sub-header / Bar Informasi
------------------------------------ */
.box-d {
  height: 60px;
  background-color: #ffffff;
  border-bottom: 1px solid #dcdde1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  font-weight: 600;
  color: #333333;
}

.box-d-left {
  display: flex;
  align-items: center;
}

/* Tombol Toggle khusus Mobile di Box D */
.mobile-toggle-btn {
  display: none;
  font-size: 1.4rem;
  color: #e74c3c;
  cursor: pointer;
  margin-right: 15px;
}

/* ------------------------------------
   BOX E: Penampung Induk Laman Anak
------------------------------------ */
.box-e {
  flex: 1;
  padding: 25px;
  overflow-y: auto;
  background-color: #ffffff;
  margin: 15px;
  border: 1px dashed #b2bec3;
  border-radius: 6px;
}
/* class box-e = id kontener-utama */
#kontener-utama {
  position: relative; /* Ini acuan batas untuk modal overlay */
  /*min-height: 100vh; /* Atau sesuaikan dengan tinggi area konten Anda */
  overflow: hidden;   /* Agar overlay melengkung di sudut jika kontener punya border-radius */
}

.box-e h3 {
  margin-bottom: 10px;
  color: #2c3e50;
}

/* ===================================================
   RESPONSIVE LAYOUT FOR MOBILE & TABLET (Max-width: 768px)
   =================================================== */
@media screen and (max-width: 768px) {
  
  /* Tampilkan tombol Donut di Box D khusus Mobile */
  .mobile-toggle-btn {
    display: inline-block;
  }

  /* Sembunyikan tombol Donut internal milik Sidebar di Mobile */
  .box-b .toggle-btn {
    display: none;
  }

  /* B (Sidebar) di Mobile: Tertutup total secara default & Melayang (Overlay) */
  .box-b {
    position: absolute;
    top: 0;
    left: 0;
    width: 75vw; /* Lebar 75% dari layar saat terbuka */
    height: 100%;
    transform: translateX(-100%); /* Sembunyi total di luar layar kiri */
    box-shadow: 4px 0 10px rgba(0,0,0,0.3);
    box-shadow: 4px 0 10px rgba(172, 127, 127, 0.3);
  }

  /* Saat di-toggle di Mobile (Expanded) */
  .box-b.expanded {
    width: 75vw;
    transform: translateX(0); /* Muncul meluncur dari kiri */
  }

  /* Tampilkan selalu teks menu di Mobile saat sidebar terbuka */
  .box-b .sidebar-menu li span {
    opacity: 1;
  }

  /* Penyesuaian ukuran teks untuk layar kecil */
  .header-content h1 {
    font-size: 1.3rem;
  }
  .header-content h5 {
    color: #2c3e50;color: #ffffff;
    font-size: 0.7rem;
    text-align: center;
    font-weight: normal;
  }

  .box-d {
    padding: 0 15px;
    font-size: 0.85rem;
  }

  .box-e {
    margin: 10px;
    padding: 15px;
    padding-bottom: 33px;
  }
  /* class box-e = id kontener-utama */
  #kontener-utama {
    position: relative; /* Ini acuan batas untuk modal overlay */
    /*min-height: 100vh; /* Atau sesuaikan dengan tinggi area konten Anda */
    overflow: hidden;   /* Agar overlay melengkung di sudut jika kontener punya border-radius */
  }
}