/* ===== Base ===== */
html, body { height: 100%; margin: 0; }
body {
  margin: 0;
  padding-top: 56px;                 /* ruang utk navbar fixed-top */
  background-color: #f8f9fa;
}

/* Pastikan navbar berada di atas sidebar */
.navbar-maroon {
  background-color: #800000;
  z-index: 1060;                     /* > sidebar z-index */
}
.navbar-maroon .navbar-brand,
.navbar-maroon .nav-link,
.navbar-maroon .navbar-text { color: #fff; }
.navbar-maroon .nav-link:hover { color: #f8f9fa; text-decoration: underline; }

/* Kontainer utama agar tidak overflow */
.page-container { display: flex; min-width: 0; }

/* ===== Sidebar (tampilan seperti lama) ===== */
.sidebar {
  width: 250px;
  background-color: #343a40;
  color: #fff;
  padding: 20px;
  min-height: calc(100vh - 56px);
  position: fixed;
  top: 56px;
  left: 0;
  transition: transform 0.3s ease;
  z-index: 1040;                     /* di bawah navbar */
  overflow-y: auto;                  /* biar konten panjang bisa discroll */
  -webkit-overflow-scrolling: touch;
}

/* Tautan di sidebar tetap putih & block */
.sidebar a,
.sidebar a:visited,
.sidebar a:focus {
  display: block;
  padding: 8px 12px;
  color: #ffffff !important;
  text-decoration: none !important;
}
.sidebar a:hover,
.sidebar a:focus:hover {
  color: #ffc107 !important;
  background: #495057;
  text-decoration: none !important;
}
/* Aktif (isActive()) */
.sidebar a.active,
.sidebar a.active:focus,
.sidebar a.active:hover {
  color: #ffc107 !important;
  font-weight: bold;
  background: #495057;
  border-left: 3px solid #ffc107;
  padding-left: 9px; /* kompensasi border */
}

/* Toggle (logic lama) */
.sidebar.hidden { transform: translateX(-100%); }

/* ===== Main Content ===== */
.main-content {
  margin-left: 250px;                /* beri ruang untuk sidebar fixed */
  padding: 30px;
  transition: margin-left 0.3s ease;
  min-width: 0;                      /* cegah overflow horizontal */
}
.main-content.full-width { margin-left: 0; }

/* ===== Footer ===== */
.footer {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100vw;
  height: 40px;
  background-color: #f8f9fa;
  color: #6c757d;
  text-align: center;
  line-height: 30px;
  border-top: 1px solid #dee2e6;
  z-index: 1050;                    /* di atas sidebar */
}

/* ===== Utilitas tombol (tetap) ===== */
.btn-maroon { background-color: maroon; color: #fff; }
.btn-maroon:hover { background-color: #800000; color: #fff; }

/* ===== Media / Responsif ===== */
img, canvas, svg, video { max-width: 100%; height: auto; display: block; }
.table-responsive { -webkit-overflow-scrolling: touch; }
.table td, .table th { word-break: break-word; }

/* Tablet & Mobile */
@media (max-width: 991.98px) {
  /* Off-canvas feel: sidebar default tampil, hidden → geser keluar */
  .sidebar { width: 80%; max-width: 320px; }
  .main-content { margin-left: 0; padding: 1rem; }
}

/* HP kecil */
@media (max-width: 575.98px) {
  .main-content h4 { font-size: 1.1rem; }
}
