/* V128.4 - Tudo visível com a tela em 100%: tabelas se ajustam à largura disponível
   em vez de esconder colunas e botões à direita. Carregado por último. */
@media (min-width: 851px) and (pointer:fine), (min-width: 851px) and (min-height:501px){
  html body main#oc-main#oc-main table.table,
  html body main#oc-main#oc-main table.vt,
  html body main#oc-main#oc-main .table-wrap > table,
  html body main#oc-main#oc-main .lr-table-wrap table,
  html body main#oc-main#oc-main .ocpm-wrap table,
  html body main#oc-main#oc-main .oca-tw table,
  html body main#oc-main#oc-main .vw > table,
  html body main#oc-main#oc-main .card > table,
  html body main#oc-main#oc-main .section > table {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    table-layout: auto !important;
  }
  html body main#oc-main#oc-main table.table th, html body main#oc-main#oc-main table.table td,
  html body main#oc-main#oc-main table.vt th, html body main#oc-main#oc-main table.vt td,
  html body main#oc-main#oc-main .table-wrap > table th, html body main#oc-main#oc-main .table-wrap > table td,
  html body main#oc-main#oc-main .lr-table-wrap table th, html body main#oc-main#oc-main .lr-table-wrap table td,
  html body main#oc-main#oc-main .ocpm-wrap table th, html body main#oc-main#oc-main .ocpm-wrap table td,
  html body main#oc-main#oc-main .oca-tw table th, html body main#oc-main#oc-main .oca-tw table td,
  html body main#oc-main#oc-main .card > table th, html body main#oc-main#oc-main .card > table td,
  html body main#oc-main#oc-main .section > table th, html body main#oc-main#oc-main .section > table td {
    white-space: normal !important;
    overflow: visible !important;
    text-overflow: clip !important;
    max-width: none !important;
    word-break: normal !important;
    padding-left: 7px !important;
    padding-right: 7px !important;
  }
  html body main#oc-main#oc-main table th { overflow-wrap: break-word !important; hyphens: auto; }
  html body main#oc-main#oc-main table td { overflow-wrap: break-word !important; }
  html body main#oc-main#oc-main table td.oc-quebra { overflow-wrap: anywhere !important; }
  html body main#oc-main#oc-main table td.oc-num, html body main#oc-main#oc-main table th.oc-num { white-space: nowrap !important; overflow-wrap: normal !important; }
  html body main#oc-main#oc-main table td .pill,
  html body main#oc-main#oc-main table td .prd-st { white-space: nowrap !important; }
  /* colunas de ação: os botões quebram linha em vez de sair da tela */
  html body main#oc-main#oc-main table td:last-child > div,
  html body main#oc-main#oc-main table td.oc-act,
  html body main#oc-main#oc-main table td .supplier-actions,
  html body main#oc-main#oc-main table td .va {
    display: flex !important; flex-wrap: wrap !important; gap: 5px !important; justify-content: flex-start;
    min-width: 0 !important; white-space: normal !important;
  }
  html body main#oc-main#oc-main table td .btn, html body main#oc-main#oc-main table td .supplier-action,
  html body main#oc-main#oc-main table td .vb { white-space: nowrap !important; }
  /* se ainda assim não couber, aparece a barra de rolagem (nunca corta escondido) */
  html body main#oc-main#oc-main .table-wrap, html body main#oc-main#oc-main .lr-table-wrap, html body main#oc-main#oc-main .ocpm-wrap,
  html body main#oc-main#oc-main .oca-tw, html body main#oc-main#oc-main .vw { overflow-x: auto !important; max-width: 100% !important; }
  html body main#oc-main#oc-main .section.card, html body main#oc-main#oc-main .card { min-width: 0 !important; }
  html body main#oc-main#oc-main .section.card:has(> table), html body main#oc-main#oc-main .card:has(> table) { overflow-x: auto !important; }
}
/* abas do prontuário: quebram linha */
html body main#oc-main#oc-main nav.pr-tabs { flex-wrap: wrap !important; overflow: visible !important; row-gap: 6px !important; }
/* telas menores (notebook com Windows em 125%): letras e espaços um pouco menores */
@media (min-width: 851px) and (max-width: 1280px) and (pointer:fine), (min-width: 851px) and (max-width: 1280px) and (min-height:501px){
  html body main#oc-main#oc-main table th { font-size: 10px !important; letter-spacing: .02em !important; padding: 7px 5px !important; }
  html body main#oc-main#oc-main table td { font-size: 12px !important; padding: 7px 5px !important; }
  html body main#oc-main#oc-main table td .btn, html body main#oc-main#oc-main table td .vb,
  html body main#oc-main#oc-main table td .supplier-action { font-size: 11.5px !important; padding: 6px 9px !important; min-width: 0 !important; }
}
/* agenda do dia: colunas flexíveis; dentista de folga ocupa só uma faixa estreita */
@media (min-width: 851px) and (pointer:fine), (min-width: 851px) and (min-height:501px){
  html body main#oc-main#oc-main .ocd2-grid { grid-template-columns: 56px var(--cols, repeat(var(--n), minmax(140px, 1fr))) !important; min-width: 0 !important; }
  html body main#oc-main#oc-main .ocd2-col { min-width: 0 !important; }
  html body main#oc-main#oc-main .ocd2-col.off .ocd2-nm, html body main#oc-main#oc-main .ocd2-col.off .ocd2-head em { display: none !important; }
  html body main#oc-main#oc-main .ocd2-col.off .ocd2-head a { justify-content: center !important; }
  html body main#oc-main#oc-main .ocd2-col.off .ocd2-head a::after { content: "folga"; font-size: 10px; color: #7A8C8E; }
  html body main#oc-main#oc-main .ocd2-col.off .ocd2-head a { flex-direction: column !important; gap: 2px !important; }
}
@media (min-width: 851px) and (max-width: 1400px) and (pointer:fine), (min-width: 851px) and (max-width: 1400px) and (min-height:501px){
  html body main#oc-main#oc-main .v124-agenda { grid-template-columns: minmax(0, 1fr) !important; }
}
/* acompanhamento de próteses: no computador as colunas quebram linha em vez de rolar para o lado */
@media (min-width: 851px) and (pointer:fine), (min-width: 851px) and (min-height:501px){
  html body main#oc-main#oc-main .psx .ocq { grid-auto-flow: row !important; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)) !important; overflow-x: visible !important; }
  html body main#oc-main#oc-main form, html body main#oc-main#oc-main .filters, html body main#oc-main#oc-main .ps-filters { flex-wrap: wrap; }
}
@media (min-width: 851px) and (pointer:fine), (min-width: 851px) and (min-height:501px){
  html body main#oc-main#oc-main .ps-filters { display: flex !important; flex-wrap: wrap !important; gap: 8px !important; }
  html body main#oc-main#oc-main .ps-filters > * { flex: 1 1 150px !important; min-width: 0 !important; }
  html body main#oc-main#oc-main .ps-filters > .wide { flex: 2 1 260px !important; }
  html body main#oc-main#oc-main .ps-filters > button, html body main#oc-main#oc-main .ps-filters > a { flex: 0 0 auto !important; }
}
/* financeiro: botões de ação com nome e ícone */
html body .oc-fa{display:inline-flex!important;align-items:center;gap:5px;height:30px;padding:0 10px!important;border-radius:9px!important;border:1px solid #CFE3E1!important;background:#fff!important;color:#0B6E73!important;font:700 12px/1 Inter,system-ui,sans-serif!important;cursor:pointer;white-space:nowrap!important;box-shadow:none!important;width:auto!important;min-width:0!important;max-width:none!important}
html body .oc-fa svg{width:15px;height:15px;fill:none;stroke:currentColor;stroke-width:2.2;stroke-linecap:round;stroke-linejoin:round;flex:none}
html body .oc-fa:hover{background:#F0F8F7!important;transform:none!important}
html body .oc-fa.ok{color:#0B6E73!important;border-color:#BFE3DF!important}
html body .oc-fa.pay{background:#0B7F86!important;color:#fff!important;border-color:#0B7F86!important}
html body .oc-fa.pay:hover{background:#086A70!important}
html body .oc-fa.del{color:#B4232F!important;border-color:#F0CACE!important}
html body .oc-fa.del:hover{background:#FDF0F1!important}
html body .v124-expense-table td:nth-child(7) .va,html body .v124-expense-cards .va{display:flex!important;flex-wrap:wrap!important;gap:5px!important;justify-content:flex-start!important}
html body .v124-expense-table td:nth-child(7) form{display:inline-flex!important;margin:0!important}
/* detalhe das comissões: tabela compacta, sem rolagem lateral */
html body .v124-commission-detail-modal section{width:min(560px,94vw)!important;padding:14px 16px!important}
html body .v124-commission-detail-modal table{width:100%!important;min-width:0!important;table-layout:fixed!important}
html body .v124-commission-detail-modal th,html body .v124-commission-detail-modal td{padding:7px 6px!important;font-size:12.5px!important;white-space:normal!important;overflow:visible!important}
html body .v124-commission-detail-modal th:nth-child(1),html body .v124-commission-detail-modal td:nth-child(1){width:auto!important}
html body .v124-commission-detail-modal th:nth-child(2),html body .v124-commission-detail-modal td:nth-child(2){width:96px!important;white-space:nowrap!important}
html body .v124-commission-detail-modal th:nth-child(3),html body .v124-commission-detail-modal td:nth-child(3){width:104px!important;white-space:nowrap!important;text-align:right!important}
html body .v124-commission-detail-modal th:nth-child(4),html body .v124-commission-detail-modal td:nth-child(4){width:46px!important;text-align:center!important}
html body .v124-commission-eye{width:30px!important;height:30px!important}
html body .v124-commission-eye svg{width:17px;height:17px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
html body main#oc-main#oc-main table td .v124-status-pill{white-space:normal!important;text-align:center;line-height:1.2}
html body main#oc-main#oc-main .v124-expense-table td:first-child .vb{white-space:normal!important;text-align:left;height:auto!important;line-height:1.25!important;padding:5px 8px!important}
html body main#oc-main#oc-main .oc-fa.pay{background:#0B7F86!important;color:#fff!important;border-color:#0B7F86!important}
html body main#oc-main#oc-main .oc-fa.pay:hover{background:#086A70!important}
/* notebooks: menu lateral e margens um pouco menores para sobrar espaço para as tabelas */
@media (min-width: 851px) and (max-width: 1280px) and (pointer:fine), (min-width: 851px) and (max-width: 1280px) and (min-height:501px){
  html body main#oc-main#oc-main { padding-left: 18px !important; padding-right: 18px !important; }
  html body main#oc-main#oc-main table td.oc-num { font-size: 11.5px !important; }
}
/* quando a tabela ainda não cabe, o sistema compacta sozinho (oc-largura.js) */
html body main#oc-main#oc-main table.oc-compacto th{font-size:9.5px!important;letter-spacing:0!important;padding:6px 4px!important}
html body main#oc-main#oc-main table.oc-compacto td{font-size:11.5px!important;padding:6px 4px!important}
html body main#oc-main#oc-main table.oc-compacto td .btn,html body main#oc-main#oc-main table.oc-compacto td .vb{padding:5px 7px!important;font-size:11px!important}
html body main#oc-main#oc-main table.oc-compacto2 th{font-size:9px!important;padding:5px 3px!important}
html body main#oc-main#oc-main table.oc-compacto2 td{font-size:10.5px!important;padding:5px 3px!important}
html body main#oc-main#oc-main table.oc-compacto2 td.oc-num{font-size:10.5px!important}
html body main#oc-main#oc-main table td.oc-nowrap{white-space:nowrap!important}
html body main#oc-main#oc-main table td.oc-quebra{min-width:150px!important}
