/* LIVIZ GESTÃO V1.43 · Ajuste de celular compartilhado por todos os painéis e páginas.
   Nada pode passar da largura da tela: tabelas viram cartões, quadros empilham, abas quebram linha. */
@media screen and (max-width: 760px) {
  html, body { max-width: 100%; overflow-x: hidden; }
  body * { min-width: 0; }
  img, svg, video, canvas, iframe { max-width: 100%; }
  input, select, textarea, button { max-width: 100%; }
  pre, code { white-space: pre-wrap; word-break: break-word; }
  h1, h2, h3, .big, b, strong, a, span, p, td, th, label, small { overflow-wrap: anywhere; }

  /* contêineres que antes rolavam para o lado */
  .scroll-x, .table-wrap, .table-scroll { overflow: visible !important; }

  /* tabelas → cartões (o script mobile.js coloca o nome de cada coluna em data-l) */
  table.lv-cards, table.lv-cards > tbody, table.lv-cards > tbody > tr, table.lv-cards > tr,
  table.lv-cards > thead, table.lv-cards td { display: block; width: auto !important; }
  table.lv-cards { border: 0 !important; background: none !important; }
  table.lv-cards tr.lv-head, table.lv-cards > thead { display: none !important; }
  table.lv-cards tr:not(.lv-head) { border: 1px solid rgba(0,0,0,.09); border-radius: 12px; padding: 10px 12px;
    margin: 0 0 10px; background: var(--p-card, #fff); box-shadow: 0 2px 8px rgba(0,0,0,.04); }
  table.lv-cards td { display: flex; justify-content: space-between; align-items: center; gap: 12px;
    padding: 5px 0 !important; border: 0 !important; text-align: right !important; min-height: 28px; }
  table.lv-cards td::before { content: attr(data-l); font-weight: 700; font-size: 12px; color: #6b7280;
    text-align: left; flex: 0 0 auto; max-width: 48%; text-transform: none; letter-spacing: 0; }
  table.lv-cards td:not([data-l])::before, table.lv-cards td[data-l=""]::before { display: none; }
  table.lv-cards td:not([data-l]), table.lv-cards td[data-l=""] { justify-content: flex-start; text-align: left !important; }
  table.lv-cards td:first-child { display: block; text-align: left !important; font-size: 1.02em; padding-bottom: 8px !important;
    border-bottom: 1px dashed rgba(0,0,0,.08) !important; margin-bottom: 4px; }
  table.lv-cards td:first-child::before { display: block; margin-bottom: 2px; max-width: none; }
  table.lv-cards td input:not([type=checkbox]):not([type=radio]), table.lv-cards td select { width: 58% !important; flex: 0 0 58%; }
  table.lv-cards td form { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
  table.lv-cards tr.total td, table.lv-cards tr.lv-total td { font-weight: 800; }

  /* quadros de etapas (pátio, produção, oficina...) → uma coluna */
  .board, .kanban, .lv-board { display: grid !important; grid-template-columns: 1fr !important; overflow: visible !important; }
  /* grades de formulário e blocos lado a lado → uma coluna */
  .grid2, .grid3, .grid4, .grid2.wide, .two, .three { grid-template-columns: 1fr !important; }
  .kpis { grid-template-columns: 1fr 1fr !important; }
  .kpis .kpi b { font-size: 20px !important; overflow-wrap: anywhere; }

  /* abas e barras de ações quebram linha em vez de rolar */
  .tabs { display: flex !important; flex-wrap: wrap !important; overflow: visible !important; gap: 6px !important; }
  .tabs a { flex: 0 0 auto; }
  .row-actions, .actions, .toolbar, .filters { flex-wrap: wrap !important; }
  .list-row { grid-template-columns: 1fr !important; }

  /* faixas que rolavam para o lado: categorias do cardápio, dias da agenda, barbeiros */
  .categories { display: flex !important; flex-wrap: wrap !important; overflow: visible !important; gap: 8px !important; scroll-snap-type: none !important; }
  .categories .category, .categories a, .categories button { flex: 0 0 auto !important; }
  .days { display: grid !important; grid-template-columns: repeat(5, minmax(0, 1fr)) !important; overflow: visible !important; }
  .days .day { width: auto !important; }
  .pick { flex-wrap: wrap !important; overflow: visible !important; }
}
