/* ==============================
   DESKTOP DEFAULT
============================== */
.sidebar {
  width: 250px;
  transition: transform 0.3s ease;
}

/* ==============================
   MOBILE RESPONSIVE (max 768px)
============================== */
@media (max-width: 768px) {

  /* Safe-area untuk iPhone notch */
  body {
    background-color: #0b0b0c;
    padding-top: env(safe-area-inset-top);
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
    padding-bottom: env(safe-area-inset-bottom);
  }

  /* === Sidebar === */
  .sidebar { 
    position: fixed;
    top: 60px;
    left: -70px;
    transform: translateX(-100%);
    width: 250px;
    height: calc(100vh - 60px);
    background: var(--bg-1);
    z-index: 302;
    box-shadow: 2px 0 5px rgba(0,0,0,0.3);
    transition: transform 0.3s ease;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .sidebar.show {
    transform: translateX(90px);
  }

  /* overlay klik luar untuk nutup sidebar */
  .sidebar-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0,0,0,0.4);
    z-index: 9999998;
    display: none;
  }

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

  .sidebar-sub {
    display: none;
  }
  
  .container {
    height: 100dvh;
    overflow-y: auto;
  }

  #content {
    height: calc(100vh - 60px - env(safe-area-inset-top));
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 0 0 0 85px;
  }

  #content-area {
    margin-left: 0;
    border-radius: 0;
  }

  .container {
    padding: 0;
    margin: 0;
  }

  .grid-container {
    padding: 15px 0 0 0;
  }

  #apiwa-label {
    top: 400px;
  }

  /* Tooltip di HP dimatikan */
  .left-btn[data-tooltip]:hover::after {
    display: none !important;
  }

  /* Hilangkan efek fokus/outline */
  .left-btn,
  .left-btn:focus,
  .left-btn:active {
    outline: none !important;
    box-shadow: none !important;
  }

  .left-btn {
    -webkit-tap-highlight-color: transparent;
  }

  /* === Tombol kiri === */
#left-buttons {
    position: absolute;
    top: 225px;
    left: 15px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 301;
}
  
  #content-header {
    position: sticky; /* atau relative */
    top: 0;           /* jika sticky, supaya nempel di atas saat scroll */
    z-index: 303;     /* lebih tinggi dari #left-buttons (301) */
    background: var(--bg-1); /* pastikan background supaya tidak tembus */
}

  .product-info {
    display: flex;
    justify-content: space-between;
    text-align: left;
  }

  .stock-price .normal-price {
    display: inline;
  }

  /* === Modal === */
/* Modal full layar HP */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh; /* pakai 100vh, bukan 100dvh */
  display: none;
  align-items: flex-start;
  justify-content: center;
  z-index: 302;
  background: rgba(0,0,0,0.6);
}

.modal .modal-content {
  width: 100%;
  max-width: 600px;
  min-height: 100vh; /* pastikan minimal setinggi viewport */
  height: auto; /* biar bisa scroll kalau isinya lebih tinggi */
  border-radius: 0;
  margin: 0;
  background: var(--bg-1);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  padding-bottom: env(safe-area-inset-bottom);
  border: 1px solid #333;                 /* garis luar agar jelas */
  box-shadow: 0 12px 28px rgba(0,0,0,0.45); /* bayangan lembut */
}

#modalProduk, #modalCustomer {
  z-index: 305;
}

#modalKategori {
  z-index: 306;
}


  /* === Header Modal === */
  .form-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px;
    z-index: 2;
    position: sticky;
    top: 0;
    box-shadow: 0 4px 8px rgba(0,0,0,0.4);
    background: #222;                     /* konsisten dengan desktop */
    border-bottom: 1px solid #333;        /* garis bawah untuk header */
  }

  .form-header .btn {
    padding: 16px 12px;
    border-radius: 6px;
    font-size: 16px;
  }

  /* === Area isi tab === */
  .tab-content-wrapper {
    flex: 1;
    overflow-y: auto;
    padding: 10px 15px;
    background: #1f1f1f;                  /* panel form */
  }

  /* Body pada modal sederhana */
  .modal-body {
    background: #1f1f1f;
  }

  /* Hilangkan tap highlight di HP */
  * {
    -webkit-tap-highlight-color: transparent;
    outline: none !important;
  }

  button, input, textarea {
    outline: none !important;
    box-shadow: none !important;
  }

  button:active {
    transform: scale(0.97);
    opacity: 0.8;
  }

  /* === Dropdown HP === */
  .mobile-action-btn {
    position: fixed;
    top: 10px;
    right: 15px;
    z-index: 300;
    background: rgba(0,0,0,0.5);
    color: #fff;
    border-radius: 8px;
    width: 50px;
    height: 50px;
    font-size: 22px;
    display: flex;
    justify-content: center;
    align-items: center;
  }

  .mobile-action-dropdown {
    position: fixed;
    top: 70px;
    right: 10px;
    background: black;
    border-radius: 12px;
    padding: 8px 0;
    display: flex;
    flex-direction: column;
    gap: 5px;
    box-shadow: 0 4px 15px gray;
    z-index: 2000;
  }

  .mobile-action-dropdown.hide {
    display: none;
  }

  .dropdown-item {
    background: transparent;
    border: none;
    color: #fff;
    text-align: left;
    padding: 10px 20px;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 200px;
    height: 50px;
  }

  .dropdown-item:hover {
    background: rgba(255,255,255,0.1);
    color: #5aa7ff;
  }

  /* === Filter === */
  .content-filter {
    z-index: 301;
    width: 100%;
    max-height: none;
    flex-direction: column;
    padding: 10px;
  }

  .filter-group {
    width: 100%;
    flex-direction: row;
    justify-content: space-between;
  }

  .filter-group select, .filter-group button {
    flex: 1;
  }

  .content-filter.show {
    position: fixed;
    top: 60px;
    left: 0;
    right: 0;
    width: 100%;
    background-color: #1a1a1a;
    padding: 15px;
    max-height: calc(100vh - 60px);
    overflow-y: auto;
    box-shadow: 0 2px 10px rgba(0,0,0,0.5);
  }

  .content-filter .filter-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
  }

  .content-filter label,
  .content-filter select,
  .content-filter button {
    width: 100%;
  }

  .content-filter button#applyFilter {
    width: 100%;
    padding: 12px 0;
    font-size: 16px;
    border-radius: 8px;
    margin-top: 10px;
  }

  #modalProduk .form-footer {
    display: none;
  }
  #modalCustomer .form-footer {
    display: none;
  }
  
  

}
