/* =====================================================================
   ARQUIVO static/portal-layout-lists.css
   Página: várias · Menu: todos
   Conteúdo: tabelas, listas e consultas do visual Minimalista.
   Depende de: portal-layout.css e dos estilos de cada tela; tokens de cor dos três temas
   Carregado em: templates/index.html, nº 22
   Notas: a grade de edição #items-table fica em portal-layout.css; não afeta impressão/PDF
     nem altera dados, conteúdo, ações, permissões ou a estrutura criada pelo JavaScript.
   ===================================================================== */

/* ===== INÍCIO · COMPONENTE contornos retos nos painéis e consultas · Página: várias · Menu: todos · Aba: várias · Tema: todos (só no visual Minimalista) =====
 * Descrição: Contornos retos nos painéis e controles de consulta. · Base com alvos de toque; a faixa para mouse no fim do arquivo é mais densa.
 * Usado por: static/portal-layout.js e static/portal-item-grid.js
 * O foco existente permanece visível em ambas as apresentações.
 * Classes de situação conservam suas cores e textos.
 */
@media screen {
  html[data-layout="minimal"] .app-shell .main :is(.panel, .stat, .metric-card, .bi-card, .catalog-card, .catalog-product-detail, .production-metrics article, .abc-distribution article) {
    border-radius: 2px;
    box-shadow: none;
  }

  html[data-layout="minimal"] .app-shell :is(button, .btn, select, textarea),
  html[data-layout="minimal"] dialog[open] :is(button, .btn, select, textarea) {
    border-radius: 2px;
    min-height: 44px;
  }

  html[data-layout="minimal"] .app-shell input:not([type="radio"]):not([type="checkbox"]):not([type="hidden"]),
  html[data-layout="minimal"] dialog[open] input:not([type="radio"]):not([type="checkbox"]):not([type="hidden"]) {
    border-radius: 2px;
    min-height: 44px;
  }

  html[data-layout="minimal"] dialog[open] {
    border-radius: 2px;
    box-shadow: none;
  }

  html[data-layout="minimal"] .app-shell .main :is(.tag, .bi-choices, .bi-choice-body, .monitor-detail, .portal-chart-disclosure) {
    border-radius: 2px;
  }

  html[data-layout="minimal"] dialog[open] :is(.tag, .monitor-detail) {
    border-radius: 2px;
  }

  html[data-layout="minimal"] dialog[open] .detail-top {
    padding: 20px;
    background: var(--paper);
    border-bottom: 1px solid var(--border);
  }

  html[data-layout="minimal"] dialog[open] .detail-body {
    padding: 20px;
  }

  html[data-layout="minimal"] dialog[open] .detail-grid {
    gap: 0;
    border: 1px solid var(--border);
  }

  html[data-layout="minimal"] dialog[open] .detail-grid > div {
    padding: 12px;
    border-bottom: 1px solid var(--border);
    min-width: 0;
    overflow-wrap: anywhere;
  }
}
/* ===== FIM · COMPONENTE contornos retos nos painéis e consultas ===== */

/* ===== INÍCIO · COMPONENTE tabelas de produtos, documentos e Administração · Página: várias · Menu: todos · Aba: várias · Tema: todos (só no visual Minimalista) =====
 * Descrição: Tabelas de produtos, documentos e Administração. · A mesma grade atende listas, relatórios, detalhes e históricos já tabulados.
 * Usado por: static/portal-layout.js e static/portal-item-grid.js
 * A classe .item-table fica fora das regras gerais, exceto no diálogo de leitura.
 * A grade de edição #items-table continua sob os estilos próprios do editor.
 * Não usar display:none em dados/ações: a rolagem fica no contêiner existente.
 */
@media screen {
  html[data-layout="minimal"] :is(.app-shell, dialog) .table-scroll > table:not(.item-table),
  html[data-layout="minimal"] dialog .table-scroll > table.item-table {
    width: 100%;
    border-collapse: collapse;
    border-spacing: 0;
    border: 1px solid var(--border);
    background: var(--white);
    color: var(--ink);
    font-size: .875rem;
    line-height: 1.5;
  }

  html[data-layout="minimal"] :is(.app-shell, dialog) .table-scroll > table:not(.item-table) > :is(thead, tbody, tfoot) > tr > :is(th, td),
  html[data-layout="minimal"] dialog .table-scroll > table.item-table > :is(thead, tbody, tfoot) > tr > :is(th, td) {
    padding: 12px;
    border: 1px solid var(--border);
    vertical-align: top;
    border-radius: 0;
    box-shadow: none;
  }

  html[data-layout="minimal"] :is(.app-shell, dialog) .table-scroll > table:not(.item-table) > thead > tr > th,
  html[data-layout="minimal"] dialog .table-scroll > table.item-table > thead > tr > th {
    background: var(--paper);
    color: var(--ink);
    font-size: .8125rem;
    font-weight: 650;
    letter-spacing: 0;
    text-transform: none;
    line-height: 1.5;
    white-space: normal;
  }

  html[data-layout="minimal"] :is(.app-shell, dialog) .table-scroll > table:not(.item-table) > thead > tr > th:not(.numeric),
  html[data-layout="minimal"] dialog .table-scroll > table.item-table > thead > tr > th:not(.numeric) {
    text-align: left;
  }

  /* Só linhas sem classe recebem o fundo alternado. Sinalizações próprias
   * de uma tela (erro, seleção, total, pendência) não são neutralizadas.
   */
  html[data-layout="minimal"] :is(.app-shell, dialog) .table-scroll > table:not(.item-table) > tbody > tr:not([class]):nth-child(even),
  html[data-layout="minimal"] dialog .table-scroll > table.item-table > tbody > tr:not([class]):nth-child(even) {
    background: var(--paper);
  }

  html[data-layout="minimal"] :is(.app-shell, dialog) .table-scroll > table:not(.item-table) > tfoot > tr > :is(th, td),
  html[data-layout="minimal"] dialog .table-scroll > table.item-table > tfoot > tr > :is(th, td) {
    background: var(--paper);
    color: var(--ink);
    font-weight: 650;
  }

  html[data-layout="minimal"] :is(.app-shell, dialog) .table-scroll > table:not(.item-table) .numeric,
  html[data-layout="minimal"] dialog .table-scroll > table.item-table .numeric {
    text-align: right;
    font-variant-numeric: tabular-nums;
  }

  html[data-layout="minimal"] :is(.app-shell, dialog) .table-scroll > table:not(.item-table) td > .sub,
  html[data-layout="minimal"] dialog .table-scroll > table.item-table td > .sub {
    line-height: 1.5;
    white-space: normal;
  }

  html[data-layout="minimal"] :is(.app-shell, dialog) .table-scroll > table:not(.item-table) .quote-actions,
  html[data-layout="minimal"] dialog .table-scroll > table.item-table .quote-actions {
    align-items: flex-start;
    gap: 6px;
  }

  /* Produtos e valores sem .numeric no HTML recebem alinhamento explícito,
   * sem aplicar índices de coluna a tabelas com significados diferentes.
   */
  html[data-layout="minimal"] :is(.app-shell, dialog) .table-scroll > table.product-results > :is(thead, tbody) > tr > :is(th, td):nth-child(3),
  html[data-layout="minimal"] :is(.app-shell, dialog) .table-scroll > table.product-results > :is(thead, tbody) > tr > :is(th, td):nth-child(4),
  html[data-layout="minimal"] :is(.app-shell, dialog) .table-scroll > table.material-catalog > :is(thead, tbody) > tr > :is(th, td):nth-child(5),
  html[data-layout="minimal"] :is(.app-shell, dialog) .table-scroll > table.representative-indicators > :is(thead, tbody) > tr > :is(th, td):nth-child(n+2) {
    text-align: right;
    font-variant-numeric: tabular-nums;
  }

  html[data-layout="minimal"] :is(.app-shell, dialog) .product-results input[type="number"] {
    min-height: 44px;
    text-align: right;
    font-variant-numeric: tabular-nums;
  }
}
/* ===== FIM · COMPONENTE tabelas de produtos, documentos e Administração ===== */

/* ===== INÍCIO · COMPONENTE clientes como linhas simples · Página: várias · Menu: todos · Aba: várias · Tema: todos (só no visual Minimalista) =====
 * Descrição: Clientes como linhas simples. · Os resultados usam articles, não uma tabela. Mantém nome, documento, cidade,
 * Usado por: static/portal-layout.js e static/portal-item-grid.js
 * bloqueio e ações existentes; não inventa cabeçalhos ou conteúdo por CSS.
 */
@media screen {
  html[data-layout="minimal"] :is(.app-shell, dialog) .customer-results {
    border: 1px solid var(--border);
    background: var(--white);
  }

  html[data-layout="minimal"] :is(.app-shell, dialog) .customer-results > .customer-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    gap: 12px;
    padding: 12px;
    margin: 0;
    border: 0;
    border-bottom: 1px solid var(--border);
    border-radius: 0;
    box-shadow: none;
  }

  html[data-layout="minimal"] :is(.app-shell, dialog) .customer-results > .customer-card:last-child {
    border-bottom: 0;
  }

  html[data-layout="minimal"] :is(.app-shell, dialog) .customer-results > .customer-card:nth-child(even) {
    background: var(--paper);
  }

  html[data-layout="minimal"] :is(.app-shell, dialog) .customer-card > div:first-child {
    min-width: 0;
    overflow-wrap: anywhere;
  }

  html[data-layout="minimal"] :is(.app-shell, dialog) .customer-card .quote-actions {
    justify-content: flex-end;
  }

  @media (max-width: 520px) {
    html[data-layout="minimal"] :is(.app-shell, dialog) .customer-results > .customer-card {
      grid-template-columns: minmax(0, 1fr);
    }

    html[data-layout="minimal"] :is(.app-shell, dialog) .customer-card .quote-actions {
      justify-content: flex-start;
    }
  }
}
/* ===== FIM · COMPONENTE clientes como linhas simples ===== */

/* ===== INÍCIO · COMPONENTE tabelas legíveis em telas estreitas · Página: várias · Menu: todos · Aba: várias · Tema: todos (só no visual Minimalista) =====
 * Descrição: Tabelas legíveis também nas telas estreitas. · O visual Completo transforma estas tabelas em cartões no celular. No
 * Usado por: static/portal-layout.js e static/portal-item-grid.js
 * Minimalista usamos cabeçalho/colunas nativos e a rolagem horizontal existente.
 * Preserva colspan, totais do tfoot e todos os botões da última coluna.
 */
@media screen {
  html[data-layout="minimal"] :is(.app-shell, dialog) .table-scroll > :is(.monitor-table, .monitor-items, .monitor-invoices, .review-products) {
    display: table;
    table-layout: auto;
    min-width: 720px;
  }

  html[data-layout="minimal"] dialog .table-scroll > table.item-table {
    min-width: 720px;
  }

  html[data-layout="minimal"] :is(.app-shell, dialog) .table-scroll > .monitor-items {
    min-width: 1050px;
  }

  html[data-layout="minimal"] :is(.app-shell, dialog) .table-scroll > :is(.monitor-table, .monitor-items, .monitor-invoices, .review-products) > thead {
    display: table-header-group;
  }

  html[data-layout="minimal"] :is(.app-shell, dialog) .table-scroll > :is(.monitor-table, .monitor-items, .monitor-invoices, .review-products) > tbody {
    display: table-row-group;
  }

  html[data-layout="minimal"] :is(.app-shell, dialog) .table-scroll > .review-products > tfoot {
    display: table-footer-group;
  }

  html[data-layout="minimal"] :is(.app-shell, dialog) .table-scroll > :is(.monitor-table, .monitor-items, .monitor-invoices, .review-products) > :is(thead, tbody, tfoot) > tr {
    display: table-row;
    padding: 0;
  }

  html[data-layout="minimal"] :is(.app-shell, dialog) .table-scroll > :is(.monitor-table, .monitor-items, .monitor-invoices, .review-products) > :is(thead, tbody, tfoot) > tr > :is(th, td) {
    display: table-cell;
    grid-column: auto;
    white-space: normal;
  }

  /* Labels repetidos por ::before eram necessários só nos antigos cartões. */
  html[data-layout="minimal"] :is(.app-shell, dialog) :is(.monitor-table, .monitor-items, .monitor-invoices, .review-products) td::before {
    content: none;
    display: none;
  }

  html[data-layout="minimal"] :is(.app-shell, dialog) .table-scroll > table.monitor-items > :is(thead, tbody) > tr > :is(th, td):nth-child(n+2):nth-child(-n+8) {
    text-align: right;
    font-variant-numeric: tabular-nums;
  }

  html[data-layout="minimal"] :is(.app-shell, dialog) .monitor-invoices td:last-child .btn,
  html[data-layout="minimal"] :is(.app-shell, dialog) .billed-table td:last-child .btn {
    min-height: 44px;
  }

  html[data-layout="minimal"] :is(.app-shell, dialog) .review-scroll {
    min-width: 0;
    max-width: 100%;
    overflow-x: auto;
  }
}
/* ===== FIM · COMPONENTE tabelas legíveis em telas estreitas ===== */

/* ===== INÍCIO · COMPONENTE densidade de planilha no computador · Página: várias · Menu: todos · Aba: várias · Tema: todos (só no visual Minimalista) =====
 * Descrição: Densidade de planilha no computador. · Aplica-se somente com apontador preciso e largura suficiente. Usa as cores
 * Usado por: static/portal-layout.js e static/portal-item-grid.js
 * existentes, linhas de 1px e espaços curtos; não oculta campos, textos ou ações.
 * O editor #items-table tem regras próprias em portal-layout.css. As exclusões
 * abaixo usam :where para não elevar a especificidade com um ID.
 */
@media screen and (pointer: fine) and (min-width: 901px) {
  html[data-layout="minimal"] .app-shell .main,
  html[data-layout="minimal"] dialog[open] {
    font-size: 13px;
    line-height: 1.4;
  }

  html[data-layout="minimal"] .app-shell .main .workspace {
    padding: 14px;
  }

  html[data-layout="minimal"] .app-shell .main > .topbar {
    min-height: 48px;
    height: auto;
    padding: 8px 14px;
    gap: 10px;
    font-size: 13px;
  }

  html[data-layout="minimal"] .app-shell .main :is(.page-heading, .bi-heading) {
    gap: 10px;
    margin-bottom: 12px;
  }

  html[data-layout="minimal"] .app-shell .main :is(.page-heading h1, .bi-heading h1, .welcome h1) {
    margin: 0 0 6px;
    font-size: 20px;
    line-height: 1.25;
    letter-spacing: 0;
  }

  html[data-layout="minimal"] .app-shell .main :is(.page-heading p, .bi-heading p, .welcome p) {
    margin-top: 4px;
    font-size: 13px;
  }

  html[data-layout="minimal"] .app-shell .main :is(h2, .section-heading h2, .bi-section-heading h2, .bi-grid h2),
  html[data-layout="minimal"] dialog[open] .detail-top h2 {
    font-size: 16px;
    line-height: 1.35;
    letter-spacing: 0;
  }

  html[data-layout="minimal"] .app-shell .main h3 {
    font-size: 14px;
    line-height: 1.4;
    letter-spacing: 0;
  }

  html[data-layout="minimal"] .app-shell .main :is(.sub, .field small, .stat-note, .catalog-source, .catalog-hints),
  html[data-layout="minimal"] dialog[open] .sub {
    font-size: 12px;
    line-height: 1.4;
  }

  /* Campos de uma linha ficam compactos; textarea continua com espaço para
   * múltiplas linhas. Altura dos botões pode crescer se o texto precisar quebrar.
   */
  html[data-layout="minimal"] .app-shell .main :is(button, .btn):not(:where(#items-table, #items-table *)),
  html[data-layout="minimal"] dialog[open] :is(button, .btn) {
    min-height: 30px;
    min-width: 30px;
    padding: 5px 8px;
    gap: 6px;
    border-radius: 0;
    font-size: 13px;
    line-height: 1.35;
  }

  html[data-layout="minimal"] .app-shell .main input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not(:where(#items-table, #items-table *)),
  html[data-layout="minimal"] .app-shell .main select:not(:where(#items-table, #items-table *)),
  html[data-layout="minimal"] dialog[open] input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
  html[data-layout="minimal"] dialog[open] select {
    min-height: 32px;
    height: 32px;
    padding: 4px 8px;
    border-radius: 0;
    font-size: 13px;
    line-height: 1.35;
  }

  html[data-layout="minimal"] .app-shell .main textarea:not(:where(#items-table, #items-table *)),
  html[data-layout="minimal"] dialog[open] textarea {
    min-height: 72px;
    padding: 6px 8px;
    border-radius: 0;
    font-size: 13px;
    line-height: 1.4;
  }

  html[data-layout="minimal"] .app-shell .main .search input {
    padding-left: 32px;
  }

  html[data-layout="minimal"] .app-shell .main .search svg {
    top: 8px;
    left: 9px;
    width: 16px;
    height: 16px;
  }

  html[data-layout="minimal"] .app-shell .main :is(.field, .bi-filters label, .abc-period label, .purchase-filters > label, .purchase-detail-filters > label) {
    gap: 4px;
  }

  html[data-layout="minimal"] .app-shell .main :is(.field label, .catalog-lookup > label, .catalog-toolbar label, .bi-filters label) {
    font-size: 13px;
  }

  html[data-layout="minimal"] .app-shell .main :is(.form-grid, .editor-grid, .editor-main, .discount-grid, .family-discount-grid, .bi-filters, .bi-choice-grid, .bi-grid, .abc-period, .purchase-filters, .purchase-detail-filters, .catalog-products) {
    gap: 10px;
  }

  html[data-layout="minimal"] .app-shell .main :is(.section-title, .editor-progress, .export-actions, .abc-filters, .catalog-review-toolbar) {
    gap: 8px;
    margin: 10px 0;
  }

  html[data-layout="minimal"] .app-shell .main :is(.panel, .stat, .metric-card, .bi-card, .welcome, .catalog-card, .catalog-product-detail, .abc-overview article, .production-metrics article, .abc-distribution article, .purchase-company, .bi-quick-stats) {
    border-radius: 0;
    box-shadow: none;
    border-width: 1px;
  }

  html[data-layout="minimal"] .app-shell .main :is(.form-section, .panel-head, .summary-body, .stat, .metric-card, .bi-card, .bi-ranking, .welcome, .abc-overview article, .abc-distribution article, .production-metrics article, .purchase-company, .admin-refresh) {
    padding: 12px;
    gap: 8px;
  }

  html[data-layout="minimal"] .app-shell .main :is(.stat-label, .summary-label) {
    margin-top: 8px;
    margin-bottom: 4px;
    font-size: 13px;
  }

  html[data-layout="minimal"] .app-shell .main :is(.stat-value, .summary-total, .abc-overview strong, .production-metrics article strong, .bi-billing-total strong),
  html[data-layout="minimal"] .app-shell .main .bi-report-kpis .bi-card strong {
    margin: 4px 0;
    font-size: 22px;
    line-height: 1.3;
    letter-spacing: 0;
  }

  html[data-layout="minimal"] .app-shell .main :is(.stats, .bi-kpis, .bi-overview, .bi-rankings, .bi-choice-grid, .abc-overview, .abc-distribution, .production-metrics, .purchase-company-grid) {
    margin: 12px 0;
    gap: 10px;
  }

  html[data-layout="minimal"] .app-shell .main :is(.bi-technical, .bi-reconciliation, .bi-company-panel, .bi-section-heading, .abc-shortcuts, .abc-dimensions, .abc-reading-note, .conditions-review, .quote-attachments) {
    margin-top: 12px;
    margin-bottom: 12px;
  }

  html[data-layout="minimal"] .app-shell .main :is(.summary-row, .conditions-review p, .purchase-values > div, .bi-ranking-row) {
    padding-top: 6px;
    padding-bottom: 6px;
    font-size: 13px;
  }

  html[data-layout="minimal"] .app-shell .main :is(.summary-body .btn, .welcome .btn, .bi-ranking details) {
    margin-top: 10px;
  }

  html[data-layout="minimal"] .app-shell .main :is(.bi-choice-body, .bi-order-filter, .bi-order-breakdown, .bi-currency-control, .bi-usd-documents, .discount-family, .selection-bar, .abc-summary, .catalog-product-detail, .catalog-card) {
    padding: 10px;
    border-radius: 0;
    box-shadow: none;
  }

  html[data-layout="minimal"] .app-shell .main :is(.bi-choices > summary, .bi-advanced > summary, .portal-chart-disclosure > summary) {
    min-height: 30px;
    padding: 6px 8px;
    font-size: 13px;
    line-height: 1.4;
  }

  html[data-layout="minimal"] .app-shell .main .bi-choice-list label {
    padding: 6px 4px;
    gap: 8px;
  }

  html[data-layout="minimal"] .app-shell .main :is(.bi-filter-actions, .bi-choice-actions, .catalog-pagination, .catalog-lookup) {
    margin-top: 8px;
    margin-bottom: 8px;
    gap: 8px;
  }

  html[data-layout="minimal"] .app-shell .main :is(.catalog-lookup, .conditions-review, .quote-attachments) {
    padding-top: 10px;
    padding-bottom: 10px;
  }

  html[data-layout="minimal"] .app-shell .main .catalog-main {
    padding: 14px;
  }

  html[data-layout="minimal"] .app-shell .main .visual-catalog-toolbar {
    padding: 8px 0 12px;
    gap: 10px;
  }

  html[data-layout="minimal"] .app-shell .main .visual-catalog-toolbar h2 {
    font-size: 18px;
    margin-top: 4px;
  }

  html[data-layout="minimal"] .app-shell .main .catalog-card {
    gap: 6px;
  }

  html[data-layout="minimal"] .app-shell .main .catalog-card-photo {
    height: 100px;
    margin-bottom: 4px;
  }

  html[data-layout="minimal"] .app-shell .main .catalog-card-photo img {
    max-height: 96px;
  }

  /* Repete os seletores estruturais para vencer as regras gerais anteriores
   * sem !important. Colspan, alinhamento numérico e rolagem ficam intactos.
   */
  html[data-layout="minimal"] :is(.app-shell, dialog) .table-scroll > table:not(.item-table),
  html[data-layout="minimal"] dialog .table-scroll > table.item-table {
    font-size: 13px;
    line-height: 1.35;
  }

  html[data-layout="minimal"] :is(.app-shell, dialog) .table-scroll > table:not(.item-table) > :is(thead, tbody, tfoot) > tr > :is(th, td),
  html[data-layout="minimal"] dialog .table-scroll > table.item-table > :is(thead, tbody, tfoot) > tr > :is(th, td) {
    padding: 6px;
    font-size: 13px;
    line-height: 1.35;
    vertical-align: middle;
  }

  html[data-layout="minimal"] :is(.app-shell, dialog) .customer-results > .customer-card {
    padding: 8px;
    gap: 8px;
    font-size: 13px;
  }

  html[data-layout="minimal"] :is(.app-shell, dialog) .monitor-invoices td:last-child .btn,
  html[data-layout="minimal"] :is(.app-shell, dialog) .billed-table td:last-child .btn {
    min-height: 30px;
  }

  html[data-layout="minimal"] dialog[open] :is(.detail-top, .detail-body) {
    padding: 12px;
  }

  html[data-layout="minimal"] dialog[open] .detail-grid > div {
    padding: 8px;
  }

  /* A navegação continua mais espaçosa que a planilha. Não altera largura,
   * classe compacta, rolagem do menu nem a gestão de foco feita pelo JavaScript.
   */
  html[data-layout="minimal"] .app-shell > .sidebar.bpm-sidebar :is(.sidebar-toggle, .nav-btn, .exit, #portal-tour-replay) {
    min-height: 36px;
    padding-top: 6px;
    padding-bottom: 6px;
  }

  html[data-layout="minimal"] .app-shell > .sidebar.bpm-sidebar .sidebar-toggle {
    min-width: 36px;
    width: 36px;
    height: 36px;
  }

  html[data-layout="minimal"] .app-shell > .sidebar.bpm-sidebar :is(.sidebar-search, .portal-theme-label select) {
    min-height: 36px;
    height: auto;
  }

  html[data-layout="minimal"] .app-shell > .sidebar.bpm-sidebar .sidebar-search input {
    min-height: 34px;
    height: 34px;
    font-size: 13px;
  }

  html[data-layout="minimal"] .app-shell > .sidebar.bpm-sidebar .portal-theme-label select {
    padding: 4px 8px;
    font-size: 13px;
  }
}
/* ===== FIM · COMPONENTE densidade de planilha no computador ===== */

/* ===== INÍCIO · COMPONENTE toque e digitação sem zoom · Página: várias · Menu: todos · Aba: várias · Tema: todos (só no visual Minimalista) =====
 * Descrição: Toque e digitação sem zoom nas telas menores. · Esta faixa não recebe a densidade de mouse. Inputs de texto a 16px evitam
 * Usado por: static/portal-layout.js e static/portal-item-grid.js
 * o zoom automático em navegadores móveis; alvos de toque permanecem com 44px.
 * A grade de itens é tratada no seu próprio arquivo, sem sobreposição aqui.
 */
@media screen and (pointer: coarse), screen and (max-width: 900px) {
  html[data-layout="minimal"] .app-shell :is(button, .btn, select):not(:where(#items-table, #items-table *)),
  html[data-layout="minimal"] dialog[open] :is(button, .btn, select) {
    min-height: 44px;
  }

  html[data-layout="minimal"] .app-shell input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not(:where(#items-table, #items-table *)),
  html[data-layout="minimal"] .app-shell :is(select, textarea):not(:where(#items-table, #items-table *)),
  html[data-layout="minimal"] dialog[open] input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
  html[data-layout="minimal"] dialog[open] :is(select, textarea) {
    min-height: 44px;
    font-size: 16px;
    line-height: 1.4;
  }

  html[data-layout="minimal"] .app-shell > .sidebar.bpm-sidebar :is(.sidebar-toggle, .nav-btn, .exit, #portal-tour-replay, .portal-theme-label select) {
    min-height: 44px;
  }

  html[data-layout="minimal"] .app-shell > .sidebar.bpm-sidebar :is(.sidebar-search input, .portal-theme-label select) {
    min-height: 44px;
    height: auto;
    font-size: 16px;
  }

  /* O desenho de checkbox/radio permanece nativo; o rótulo clicável dá o
   * espaço de toque sem transformar esses controles em caixas de texto.
   */
  html[data-layout="minimal"] .app-shell .main :is(.bi-choice-list label, .checkline, .purchase-filters fieldset label, .bi-choices > summary, .bi-advanced > summary) {
    min-height: 44px;
  }
}
/* ===== FIM · COMPONENTE toque e digitação sem zoom ===== */

/* ===== INÍCIO · COMPONENTE revisão do orçamento como planilha · Página: várias · Menu: todos · Aba: várias · Tema: todos (só no visual Minimalista) =====
 * Descrição: Revisão do orçamento como planilha no visual Minimalista. · A projeção do JS conserva preço, origem, comissão e subtotal já calculados.
 * Usado por: static/portal-layout.js e static/portal-item-grid.js
 * O subtotal fica na última coluna, alinhado ao total original do rodapé.
 * Telas estreitas mantêm a tabela e usam rolagem interna, sem cartões.
 */
@media screen {
  html[data-layout="minimal"] #review-content .review-products.portal-review-grid {
    table-layout: fixed;
    min-width: 1080px;
    width: 100%;
    font-size: 14px;
    line-height: 1.35;
    font-variant-numeric: tabular-nums;
  }

  html[data-layout="minimal"] #review-content .portal-review-grid :is(th, td) {
    padding: 6px 8px;
    vertical-align: middle;
    text-align: right;
    white-space: nowrap;
  }

  html[data-layout="minimal"] #review-content .portal-review-grid th {
    font-size: 12px;
    font-weight: 600;
    text-transform: none;
    letter-spacing: 0;
    white-space: normal;
  }

  html[data-layout="minimal"] #review-content .portal-review-grid th.item-grid-code { width: 100px; }
  html[data-layout="minimal"] #review-content .portal-review-grid th.item-grid-material { width: auto; }
  html[data-layout="minimal"] #review-content .portal-review-grid th.item-grid-quantity { width: 90px; }
  html[data-layout="minimal"] #review-content .portal-review-grid th.item-grid-extra { width: 85px; }
  html[data-layout="minimal"] #review-content .portal-review-grid th.item-grid-campaign { width: 110px; }
  html[data-layout="minimal"] #review-content .portal-review-grid th.item-grid-net { width: 125px; }
  html[data-layout="minimal"] #review-content .portal-review-grid th.item-grid-source { width: 100px; }
  html[data-layout="minimal"] #review-content .portal-review-grid th.item-grid-subtotal { width: 130px; }

  html[data-layout="minimal"] #review-content .portal-review-grid :is(td:first-child, td:nth-child(2), th.item-grid-code, th.item-grid-material, tfoot th) {
    text-align: left;
    white-space: normal;
  }

  html[data-layout="minimal"] #review-content .portal-review-grid td:first-child {
    font-weight: 600;
    overflow-wrap: anywhere;
  }

  html[data-layout="minimal"] #review-content .portal-review-grid :is(.item-grid-source, .item-grid-campaign) > .sub {
    margin: 0;
    font-size: inherit;
    color: var(--ink);
    white-space: nowrap;
  }

  html[data-layout="minimal"] #review-content .portal-review-grid .item-grid-source > .sub {
    white-space: normal;
  }

  html[data-layout="minimal"] #review-content .portal-review-grid .item-grid-detail-body {
    text-align: left;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  html[data-layout="minimal"] #review-content .portal-review-grid .review-item-discounts {
    margin-top: 0;
  }

  html[data-layout="minimal"] #review-content .portal-review-grid tfoot :is(th, td) {
    background: var(--paper);
    color: var(--ink);
    font-size: inherit;
    font-weight: 650;
    border-top: 2px solid var(--border);
    padding-block: 10px;
  }

  html[data-layout="minimal"] #review-content .portal-review-grid summary:focus-visible {
    outline: 2px solid var(--ink);
    outline-offset: 1px;
  }
}

@media screen and (min-width: 901px) and (pointer: fine) {
  html[data-layout="minimal"] #review-content .review-scroll {
    max-height: 65vh;
    overflow: auto;
  }

  html[data-layout="minimal"] #review-content .review-products.portal-review-grid {
    min-width: 960px;
    font-size: 13px;
  }

  html[data-layout="minimal"] #review-content .portal-review-grid :is(th, td) {
    padding: 3px 6px;
  }

  html[data-layout="minimal"] #review-content .portal-review-grid thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: var(--paper);
    color: var(--ink);
    padding-block: 6px;
  }
}
/* ===== FIM · COMPONENTE revisão do orçamento como planilha ===== */
