/* Celular e telas pequenas */
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .topbar { display: flex; }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: min(300px, 86vw); height: auto; max-height: 100dvh; transform: translateX(-100%); transition: transform .2s; z-index: 50; }
  body.nav-open .sidebar { transform: none; }
  body.nav-open .backdrop { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 40; }
  .content { padding: 1.25rem 1rem 2.5rem; padding-bottom: calc(2.5rem + env(safe-area-inset-bottom, 0px)); }
  h1 { font-size: 1.6rem; }
  .field.s6, .field.s4, .field.s3 { grid-column: span 12; }
  .btn.mobile-block { width: 100%; }
  .form-actions .btn { flex: 1 1 100%; }
  /* tabelas viram blocos */
  table.data.stack thead { display: none; }
  table.data.stack, table.data.stack tbody, table.data.stack tr, table.data.stack td { display: block; width: 100%; }
  table.data.stack tr { border: 1px solid var(--gray-200); border-radius: var(--radius-sm); margin-bottom: .75rem; padding: .35rem 0; }
  table.data.stack td { border: 0; padding: .35rem .9rem; }
  table.data.stack td::before { content: attr(data-label); display: block; font-size: .75rem; color: var(--gray-700); font-weight: 700; }
}
@media print { .sidebar, .topbar, .toasts { display: none !important; } .app { display: block; } }
@media (max-width: 900px) { table.data.stack td { text-align: left !important; } .qty-in { max-width: 140px; } }
