@media (max-width: 768px) {
  /* Layout dashboard di mobile */

  #content-wrapper {
    margin-top: 70px;
  }
  
  #dashboard {
    flex-direction: column;
    margin-top: 70px; /* Agar konten tidak tertutup panel-bar */
  }

  /* Tombol Logout di pojok kanan */
  #logout-btn {
    position: absolute;
    top: 50%;
    right: 12px;
    transform: translateY(-50%);
    padding: 0.25rem 0.5rem;
    font-size: 11px;
    background-color: #dc3545;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s;
    display: flex;
    align-items: center;
  }

  #logout-btn:hover {
    background-color: #c82333;
  }

  /* Panel Bar tetap di atas */
  #panel-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 50px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #356f6b;
    padding: 10px 12px;
    color: white;
    font-size: 12px;
    z-index: 1001;
  }

  /* Sidebar di mobile */
  #sidebar {
    position: fixed;
    width: 250px;
    top: 50px;
    bottom: 0;
    left: 0;
    background-color: white;
    border-right: 1px solid #ccc;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    z-index: 1000;
    overflow-y: auto;
    padding-bottom: 20px;
  }

  #sidebar.show {
    transform: translateX(0);
  }

  /* Toggle Sidebar di mobile */
  #sidebar-toggle {
    position: fixed;
    top: 40%;
    left: 0;
    transform: translateY(-50%);
    background-color: #fff;
    border: 1px solid #ccc;
    border-radius: 0 5px 5px 0;
    width: 30px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 999;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.2);
    transition: left 0.3s ease;
  }

  /* Saat sidebar tampil, toggle ikut geser ke kanan */
  #sidebar.show ~ #sidebar-toggle {
    left: 250px;
  }

  #toggle-icon {
    font-size: 20px;
  }

  /* Main content (map & info panel) */
  #main-content {
    flex-grow: 1;
    height: auto;
  }

  #map {
    height: 35vh;
    width: 100%;
  }

  #info-cabang {
    position: relative;
    width: auto;
    margin-left: 25px;
    margin-right: -20px;
    margin-bottom: 30px;
    max-height: 55vh;
    overflow-y: auto;
    border: none;
    box-shadow: none;
    margin-top: 5px;
    z-index: auto;
  }

  #info-cabang .close-info {
    position: absolute;
    top: 10px;
    right: 10px;
  }

  /* Modal tetap fullscreen di mobile */
  .modal-content {
    width: 95%;
    max-width: 95%;
    margin: 10% auto;
  }

  /* Dropdown responsif */
  .dropdown-content {
    max-height: 300px;
    overflow-y: auto;
  }

  /* Tombol “☰ Menu” tampil */
  #toggle-menu-btn {
    display: flex;
    align-items: center;
    background: none;
    border: none;
    color: #fff;
    font-size: 14px;
    padding: 6px;
    cursor: pointer;
  }

  /* Navigasi desktop disembunyikan */
  #menu {
    display: none;
  }

  #menu.show {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 50px;
    left: 0;
    width: 100vw;
    box-sizing: border-box;
    background-color: #356f6b;
    overflow: visible;
    transition: max-height 0.3s ease;
    max-height: none;
    z-index: 1002;
  }

  #menu.show a {
    padding: 10px 16px;
    color: #fff;
    text-decoration: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  }

  #menu.show a:last-child {
    border-bottom: none;
  }

  #menu.show a:hover {
    background-color: rgba(255, 255, 255, 0.1);
  }

  #logo {
    position: absolute;
    left: 50%;
    bottom: 23%;
    transform: translateX(-50%);
  }

  #logo img {
    height: 32px;
  }

}

/* Tambahan untuk <600px screen (PDF Modal khusus mobile) */
@media screen and (max-width: 600px) {
  #pdf-modal .modal-content {
    width: 95vw;
    height: 90vh;
    border-radius: 4px;
    padding: 0;
    box-shadow: none;
  }

  #pdf-frame {
    width: 100%;
    height: 100%;
    border: none;
  }

  #close-pdf {
    top: 5px;
    right: 10px;
    font-size: 12px;
    padding: 4px 8px;
  }
}
