/* Tata letak HP (Android). Semua halaman & fungsi sama dengan versi desktop; hanya susunannya. */
@media (max-width: 820px) {
  body { flex-direction: column; }
  button, input, select { font-size: 15px; }
  .field input, .field select, .filters input, .search-big { font-size: 16px; }

  /* Bilah atas: logo + tombol muat ulang / buka spreadsheet */
  .sidebar { width: 100%; flex-direction: row; align-items: center; gap: 8px; padding: 8px 12px; flex-shrink: 0; }
  .brand { padding: 0; gap: 8px; min-width: 0; }
  .brand-mark { width: 30px; height: 30px; }
  .brand-name { font-size: 14px; white-space: nowrap; }
  .brand-sub { display: none; }
  .sidebar-foot { margin: 0 0 0 auto; flex-direction: row; align-items: center; gap: 6px; }
  .clock { display: none; }
  .btn-ghost { padding: 7px 9px; font-size: 12px; white-space: nowrap; }
  .sync { display: none; }

  /* Menu di bawah layar */
  .nav {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 15; flex-direction: row; gap: 2px;
    background: var(--side); padding: 6px 4px 8px; border-top: 1px solid #343a41;
  }
  .nav-item { flex: 1; flex-direction: column; justify-content: center; gap: 4px; padding: 6px 2px; font-size: 11px; text-align: center; position: relative; line-height: 1.15; }
  .nav-badge { position: absolute; top: 0; left: calc(50% + 8px); margin: 0; }

  .main { padding: 14px 12px 92px; }
  .page-head { flex-direction: column; align-items: stretch; margin-bottom: 14px; gap: 12px; }
  .page-head h1 { font-size: 20px; }
  .page-head p { font-size: 13px; }
  .stats { width: 100%; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .stat { min-width: 0; padding: 8px 12px; }
  .stat span { font-size: 18px; overflow-wrap: anywhere; }

  /* Form & laporan */
  .split { grid-template-columns: minmax(0, 1fr); }
  .split > * { min-width: 0; }
  .form { position: static; padding: 14px; }
  .report { padding: 14px; min-height: 0; }
  .filters { width: 100%; flex-wrap: wrap; }
  .filters > * { flex: 1 1 140px; }
  .filters input[type=search] { width: 100%; }
  .entry { grid-template-columns: 48px minmax(0, 1fr) auto; gap: 8px; }

  /* Stok: tabel bisa digeser ke samping */
  .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .stock-table { font-size: 13px; }
  .stock-table th, .stock-table td { padding: 8px 10px; white-space: nowrap; }
  .stock-table td.name, .stock-table .name { white-space: normal; min-width: 160px; }

  /* Detail barang muncul dari bawah */
  .modal { padding: 0; place-items: end stretch; }
  .modal-box { width: 100%; max-height: 92vh; border-radius: 14px 14px 0 0; grid-template-columns: 1fr; }
  .modal-img { border-radius: 14px 14px 0 0; min-height: 200px; }
  .modal-img img { max-height: 300px; }
  .modal-info { padding: 18px 16px 24px; }
  .modal-info h2 { font-size: 18px; }
  .d-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .d-moves li { flex-wrap: wrap; }

  .toast { bottom: 88px; max-width: calc(100% - 24px); text-align: center; }
}

/* Layar sempit: cukup logo, supaya tombol muat ulang / buka spreadsheet tidak tertimpa */
@media (max-width: 430px) {
  .brand-name { display: none; }
}
