/* =====================================================================
   ARQUIVO static/portal-layout.css
   Página: várias · Menu: todos
   Conteúdo: superfícies e hierarquia do visual Minimalista para representantes e Administração.
   Depende de: style.css e portal-themes.css (tokens de cor); portal-sidebar.css e representative-profile.css carregados antes
   Carregado em: templates/index.html, nº 21
   Notas: a preferência data-layout é independente de data-theme (Colorido/Claro/Escuro).
     Mantido à mão: não entra no recolorimento de build_themes.py.
     Todas as regras são de tela: impressão, PDF, cálculos e permissões não mudam.
   ===================================================================== */

/* ===== INÍCIO · COMPONENTE superfícies e hierarquia · Página: várias · Menu: todos · Aba: várias · Tema: todos (só no visual Minimalista) =====
 * Descrição: Superfícies e hierarquia do layout minimalista. · Remove decoração de fundo, preservando logos, fotos, avisos e ações.
 * Usado por: static/portal-layout.js e static/portal-item-grid.js
 * As cores vêm dos tokens do tema escolhido, sem uma quarta paleta.
 */
@media screen {
  :root[data-layout="minimal"] .app-shell .main::before {
    content: none;
    background: none;
  }

  :root[data-layout="minimal"] .bpm-sidebar::before,
  :root[data-layout="minimal"] .bpm-sidebar::after {
    content: none;
  }

  :root[data-layout="minimal"] .app-shell > .sidebar.bpm-sidebar {
    padding-bottom: 20px;
  }

  :root[data-layout="minimal"] .main .stat-icon {
    display: none;
  }

  :root[data-layout="minimal"] .main .workspace {
    padding: 24px;
  }

  :root[data-layout="minimal"] .main :is(.page-heading, .bi-heading) {
    margin-bottom: 20px;
  }

  :root[data-layout="minimal"] .main :is(.page-heading h1, .bi-heading h1, .welcome h1) {
    font-size: clamp(1.5rem, 2.2vw, 1.85rem);
    line-height: 1.3;
    letter-spacing: -.02em;
  }

  :root[data-layout="minimal"] .main :is(.panel, .stat, .metric-card, .bi-card, .catalog-card, .catalog-product-detail, .production-metrics article) {
    border-radius: 8px;
    box-shadow: none;
  }

  :root[data-layout="minimal"] .main :is(.stat, .metric-card, .bi-card, .production-metrics article) {
    padding: 18px;
  }

  :root[data-layout="minimal"] .main :is(.stat.featured, .bi-card, .production-metrics article) {
    background: var(--white);
    color: var(--ink);
    border-color: var(--border);
  }

  :root[data-layout="minimal"] .main .stat.featured :is(.stat-label, .stat-note) {
    color: var(--muted);
  }

  :root[data-layout="minimal"] .main .bi-card small {
    opacity: 1;
  }

  :root[data-layout="minimal"] .main .bi-report-kpis .bi-card strong {
    font-size: clamp(1.375rem, 1.8vw, 1.75rem);
    white-space: normal;
    overflow-wrap: anywhere;
  }

  :root[data-layout="minimal"] .main .bi-overview {
    margin: 18px 0 22px;
  }

  :root[data-layout="minimal"] .main .bi-ranking {
    padding: 18px;
  }

  :root[data-layout="minimal"] .main .welcome {
    background: var(--white);
    color: var(--ink);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 24px;
    gap: 24px;
    box-shadow: none;
  }

  :root[data-layout="minimal"] .main .welcome :is(p, .eyebrow, .welcome-flow span) {
    color: var(--muted);
  }

  :root[data-layout="minimal"] .main .welcome-flow {
    border-color: var(--border);
    gap: 14px;
  }

  :root[data-layout="minimal"] .main .welcome-flow b {
    color: var(--ink);
  }

  :root[data-layout="minimal"] .main .catalog-card:hover {
    transform: none;
    box-shadow: none;
    border-color: var(--muted);
  }

  :root[data-layout="minimal"] .main .visual-catalog-toolbar {
    background: var(--paper);
    backdrop-filter: none;
  }

  /* A área de boas-vindas continua completa; apenas as formas e gradientes saem. */
  :root[data-layout="minimal"] #portal-welcome {
    background: var(--white);
    color: var(--ink);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: none;
  }

  :root[data-layout="minimal"] #portal-welcome::backdrop {
    backdrop-filter: none;
  }

  :root[data-layout="minimal"] #portal-welcome .welcome-profile {
    display: none;
  }

  :root[data-layout="minimal"] #portal-welcome :is(.welcome-banner-copy, .welcome-banner-art) {
    background: var(--white);
    color: var(--ink);
  }

  :root[data-layout="minimal"] #portal-welcome :is(#portal-welcome-description, .welcome-banner-note, .welcome-feature p, .welcome-dismiss-hint, .welcome-art-heading > span, .welcome-feature-number) {
    color: var(--muted);
  }

  :root[data-layout="minimal"] #portal-welcome #portal-welcome-description strong {
    color: var(--ink);
  }

  :root[data-layout="minimal"] #portal-welcome .welcome-feature {
    border-color: var(--border);
  }
}
/* ===== FIM · COMPONENTE superfícies e hierarquia ===== */

/* ===== INÍCIO · COMPONENTE gráficos sob demanda · Página: várias · Menu: todos · Aba: várias · Tema: todos (só no visual Minimalista) =====
 * Descrição: Gráficos sob demanda. · portal-layout.js envolve somente os gráficos explicitamente permitidos em
 * Usado por: static/portal-layout.js e static/portal-item-grid.js
 * details nativo. O resumo fica acessível por teclado e os nós não são clonados.
 * Nenhuma regra abaixo esconde tabelas, formulários ou avisos por classe genérica.
 */
@media screen {
  :root[data-layout="minimal"] .portal-chart-disclosure {
    margin: 14px 0;
    min-width: 0;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--white);
    color: var(--ink);
  }

  :root[data-layout="minimal"] .portal-chart-disclosure > summary {
    min-height: 44px;
    padding: 12px 14px;
    cursor: pointer;
    font-size: .875rem;
    line-height: 1.5;
    font-weight: 600;
    overflow-wrap: anywhere;
  }

  :root[data-layout="minimal"] .portal-chart-disclosure > summary:hover {
    background: var(--paper);
  }

  :root[data-layout="minimal"] .portal-chart-disclosure[open] > summary {
    border-bottom: 1px solid var(--border);
  }

  :root[data-layout="minimal"] .portal-chart-content {
    min-width: 0;
    max-width: 100%;
    padding: 12px;
    overflow-x: auto;
  }

  :root[data-layout="minimal"] .portal-chart-disclosure > summary:focus-visible {
    outline: 2px solid var(--ink);
    outline-offset: 2px;
  }

  /* Nestes três quadros o meter apenas repete o número escrito ao lado.
   * Mantemos classes ABC, nomes, montantes, percentuais e contagens visíveis.
   */
  :root[data-layout="minimal"] :is(.bi-bars, .bi-ranking-list, .abc-distribution) meter {
    display: none;
  }

  :root[data-layout="minimal"] .bi-bars > div {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  :root[data-layout="minimal"] .bi-bars > div > span {
    overflow-wrap: anywhere;
  }

  :root[data-layout="minimal"] .bi-bars > div > strong {
    grid-column: 2;
    text-align: right;
  }

  :root[data-layout="minimal"] .bi-ranking-row {
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
  }

  :root[data-layout="minimal"] .bi-ranking-row span {
    white-space: normal;
    overflow-wrap: anywhere;
  }

  :root[data-layout="minimal"] .abc-distribution article {
    padding: 18px;
    border-radius: 8px;
    background: var(--white);
    border-color: var(--border);
  }
}
/* ===== FIM · COMPONENTE gráficos sob demanda ===== */

/* ===== INÍCIO · COMPONENTE controles legíveis e alvos de toque · Página: várias · Menu: todos · Aba: várias · Tema: todos (só no visual Minimalista) =====
 * Descrição: Controles legíveis e alvos de toque. · Compactar cartões não significa reduzir o tamanho dos controles. Checkbox e
 * Usado por: static/portal-layout.js e static/portal-item-grid.js
 * radio preservam o desenho nativo; rótulos e botões continuam identificáveis.
 */
@media screen {
  :root[data-layout="minimal"] .app-shell :is(button, .btn, select, textarea) {
    min-height: 44px;
  }

  :root[data-layout="minimal"] .app-shell button {
    min-width: 44px;
  }

  :root[data-layout="minimal"] .app-shell input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]) {
    min-height: 44px;
  }

  /* A caixa de busca deve crescer junto com o input, sem cortar o foco/texto. */
  :root[data-layout="minimal"] .bpm-sidebar .sidebar-search {
    height: auto;
    min-height: 46px;
  }

  :root[data-layout="minimal"] .bpm-sidebar .portal-theme-label select {
    height: auto;
    min-height: 44px;
  }

  :root[data-layout="minimal"] .bpm-sidebar :is(.sidebar-toggle, .nav-btn, .exit, #portal-tour-replay) {
    min-height: 44px;
  }

  :root[data-layout="minimal"] .sidebar-mobile-toggle {
    width: 44px;
    height: 44px;
    flex: none;
  }

  :root[data-layout="minimal"] :is(.welcome-close, .welcome-enter, .catalog-photo-close, .tour-actions .btn) {
    min-height: 44px;
    min-width: 44px;
  }

  /* Em janelas baixas ou com teclado móvel aberto, todo o menu pode rolar.
   * Assim cabeçalhos, preferências e saída não disputam uma altura fixa com a
   * lista de navegação. O controle de foco do drawer continua no JavaScript.
   */
  @media (max-height: 760px) {
    :root[data-layout="minimal"] .app-shell > .sidebar.bpm-sidebar {
      overflow-x: hidden;
      overflow-y: auto;
    }

    :root[data-layout="minimal"] .bpm-sidebar .sidebar-navigation {
      overflow: visible;
      flex: none;
      min-height: 0;
    }
  }
}
/* ===== FIM · COMPONENTE controles legíveis e alvos de toque ===== */

/* ===== INÍCIO · COMPONENTE navegação principal no catálogo · Página: várias · Menu: todos · Aba: várias · Tema: todos (só no visual Minimalista) =====
 * Descrição: Navegação principal preservada durante a seleção de produtos. · O catálogo completo esconde o menu principal. No minimalista permanecem o
 * Usado por: static/portal-layout.js e static/portal-item-grid.js
 * menu BPM e a barra superior, além da busca/famílias e do carrinho do catálogo.
 * Os !important abaixo apenas desfazem ocultações explícitas do modo catálogo.
 */
@media screen {
  :root[data-layout="minimal"] .catalog-mode .app-shell {
    display: grid;
    grid-template-columns: var(--portal-sidebar-width) minmax(0, 1fr);
  }

  :root[data-layout="minimal"] .catalog-mode .app-shell > .sidebar.bpm-sidebar {
    display: flex !important;
  }

  :root[data-layout="minimal"] .catalog-mode .main > .topbar {
    display: flex !important;
  }

  :root[data-layout="minimal"] .catalog-mode .bpm-sidebar .portal-tools {
    display: flex;
  }

  :root[data-layout="minimal"] .catalog-mode .visual-catalog {
    grid-template-columns: 260px minmax(0, 1fr);
    min-height: calc(100dvh - 77px);
  }

  :root[data-layout="minimal"] .catalog-mode .catalog-main {
    padding: 20px;
  }

  :root[data-layout="minimal"] .catalog-mode .catalog-sidebar {
    min-width: 0;
  }

  /* Duas navegações consomem largura: a ficha não deve conservar os mínimos
   * de coluna usados quando o catálogo ocupava sozinho toda a janela.
   */
  @media (max-width: 1350px) {
    :root[data-layout="minimal"] .catalog-mode .catalog-product-detail {
      grid-template-columns: minmax(0, 1fr);
    }
  }

  /* A barra de famílias passa acima dos produtos quando não cabem três colunas.
   * O menu principal continua lateral; busca, famílias e ações não desaparecem.
   */
  @media (max-width: 1100px) {
    :root[data-layout="minimal"] .catalog-mode .visual-catalog {
      display: block;
    }

    :root[data-layout="minimal"] .catalog-mode .catalog-sidebar {
      position: static;
      height: auto;
      padding: 16px;
      border-right: 0;
      border-bottom: 1px solid var(--border);
    }

    :root[data-layout="minimal"] .catalog-mode .catalog-home {
      padding: 0 0 10px;
    }

    :root[data-layout="minimal"] .catalog-mode .catalog-home img {
      width: 135px;
    }

    :root[data-layout="minimal"] .catalog-mode .catalog-families nav {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      max-height: 220px;
      overflow-y: auto;
    }

  }

  @media (max-width: 720px) {
    :root[data-layout="minimal"] .main .workspace {
      padding: 20px 16px;
    }

    :root[data-layout="minimal"] .main .welcome {
      padding: 20px;
    }

    :root[data-layout="minimal"] .catalog-mode .app-shell {
      display: block;
    }

    /* O sidebar mantém transform/visibility e a gestão de foco do código atual. */
    :root[data-layout="minimal"] .catalog-mode .sidebar-mobile-toggle {
      display: grid !important;
    }

    :root[data-layout="minimal"] .catalog-mode .app-shell.sidebar-open .sidebar-backdrop {
      display: block !important;
    }

    :root[data-layout="minimal"] .catalog-mode .catalog-main {
      padding: 14px;
    }

    :root[data-layout="minimal"] .catalog-card-photo {
      height: 100px;
    }

    :root[data-layout="minimal"] .catalog-card-photo img {
      max-height: 96px;
    }
  }
}
/* ===== FIM · COMPONENTE navegação principal no catálogo ===== */

/* ===== INÍCIO · COMPONENTE materiais em linhas e colunas · Página: várias · Menu: todos · Aba: várias · Tema: todos (só no visual Minimalista) =====
 * Descrição: Materiais em linhas e colunas, exclusivos do visual Minimalista. · portal-item-grid.js move os nós existentes para dez colunas. A regra abaixo
 * Usado por: static/portal-layout.js e static/portal-item-grid.js
 * desfaz somente a conversão em cartões do editor em telas estreitas: o scroll
 * fica dentro da tabela, sem apertar ou sobrepor campos e seus rótulos.
 */
@media screen {
  :root[data-layout="minimal"] .editor-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  :root[data-layout="minimal"] .editor-summary {
    position: static;
  }

  :root[data-layout="minimal"] #items-table .table-scroll {
    overflow-x: auto;
    max-width: 100%;
    border: 1px solid var(--border);
    border-radius: 0;
    scrollbar-gutter: stable;
  }

  :root[data-layout="minimal"] #items-table .portal-item-grid {
    display: table;
    table-layout: fixed;
    width: 100%;
    min-width: 1120px;
    border-collapse: collapse;
    font-size: .875rem;
    line-height: 1.4;
    color: var(--ink);
    background: var(--white);
  }

  :root[data-layout="minimal"] #items-table .portal-item-grid thead {
    display: table-header-group;
  }

  :root[data-layout="minimal"] #items-table .portal-item-grid tbody {
    display: table-row-group;
  }

  :root[data-layout="minimal"] #items-table .portal-item-grid tr {
    display: table-row;
    padding: 0;
    border: 0;
  }

  :root[data-layout="minimal"] #items-table .portal-item-grid :is(th, td) {
    display: table-cell;
    padding: 10px;
    border-right: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    vertical-align: top;
    white-space: normal;
    overflow-wrap: anywhere;
    min-width: 0;
    max-width: none;
  }

  :root[data-layout="minimal"] #items-table .portal-item-grid th {
    background: var(--paper);
    color: var(--ink);
    font-size: .75rem;
    font-weight: 650;
    text-transform: none;
    letter-spacing: 0;
    vertical-align: middle;
  }

  :root[data-layout="minimal"] #items-table .portal-item-grid :is(th, td):last-child {
    border-right: 0;
  }

  :root[data-layout="minimal"] #items-table .portal-item-grid tbody tr:last-child td {
    border-bottom: 0;
  }

  :root[data-layout="minimal"] #items-table .portal-item-grid tbody tr:nth-child(even) {
    background: var(--paper);
  }

  :root[data-layout="minimal"] #items-table .portal-item-grid tbody tr:hover {
    background: var(--paper);
  }

  :root[data-layout="minimal"] #items-table .portal-item-grid td[data-label]::before {
    content: none;
  }

  :root[data-layout="minimal"] #items-table .portal-item-grid th.item-grid-material {
    width: 250px;
  }

  :root[data-layout="minimal"] #items-table .portal-item-grid th.item-grid-sap {
    width: 110px;
  }

  :root[data-layout="minimal"] #items-table .portal-item-grid th.item-grid-net {
    width: 125px;
  }

  :root[data-layout="minimal"] #items-table .portal-item-grid th.item-grid-quantity {
    width: 95px;
  }

  :root[data-layout="minimal"] #items-table .portal-item-grid th.item-grid-manual {
    width: 120px;
  }

  :root[data-layout="minimal"] #items-table .portal-item-grid :is(th.item-grid-extra, th.item-grid-campaign) {
    width: 100px;
  }

  :root[data-layout="minimal"] #items-table .portal-item-grid th.item-grid-subtotal {
    width: 130px;
  }

  :root[data-layout="minimal"] #items-table .portal-item-grid th.item-grid-actions {
    width: 70px;
  }

  :root[data-layout="minimal"] #items-table .portal-item-grid :is(input, input.manual-price, input.item-discount) {
    width: 100%;
    min-width: 0;
    min-height: 44px;
    padding: 8px;
    border-radius: 2px;
    font-size: .875rem;
    text-align: right;
    font-variant-numeric: tabular-nums;
  }

  :root[data-layout="minimal"] #items-table .portal-item-grid :is(.item-grid-sap, .item-grid-net, .numeric) {
    text-align: right;
    font-variant-numeric: tabular-nums;
  }

  :root[data-layout="minimal"] #items-table .portal-item-grid .unit-price-value {
    margin: 0;
    font-size: .875rem;
    line-height: 1.5;
    white-space: nowrap;
  }

  /* O cabeçalho já identifica a coluna; os rótulos acessíveis dos inputs ficam. */
  :root[data-layout="minimal"] #items-table .portal-item-grid .unit-price-label {
    display: none;
  }

  :root[data-layout="minimal"] #items-table .portal-item-grid :is(.item-grid-extra, .item-grid-campaign) > label {
    display: block;
    font-size: 0;
  }

  :root[data-layout="minimal"] #items-table .portal-item-grid :is(label > small, .unit-price-source, .item-code, .item-conditions) {
    display: block;
    margin-top: 5px;
    font-size: .75rem;
    line-height: 1.4;
    color: var(--muted);
    white-space: normal;
    overflow-wrap: anywhere;
  }

  :root[data-layout="minimal"] #items-table .portal-item-grid .item-unit-prices {
    display: none;
  }

  :root[data-layout="minimal"] #items-table .portal-item-grid .text-button {
    margin-top: 4px;
    padding: 4px 0;
    min-height: 44px;
    font-size: .75rem;
    white-space: normal;
    text-align: left;
  }

  :root[data-layout="minimal"] #items-table .portal-item-grid .remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 8px;
  }

  :root[data-layout="minimal"] #items-table .portal-item-grid .remove svg {
    width: 18px;
    height: 18px;
  }
}
/* ===== FIM · COMPONENTE materiais em linhas e colunas ===== */

/* ===== INÍCIO · COMPONENTE grade compacta como planilha · Página: várias · Menu: todos · Aba: várias · Tema: todos (só no visual Minimalista) =====
 * Descrição: Grade compacta como planilha, sem refazer campos do orçamento. · Detalhes usa o elemento nativo: abre com teclado e expande a própria linha.
 * Usado por: static/portal-layout.js e static/portal-item-grid.js
 * Apenas computador com ponteiro fino recebe os campos de 28 px; no toque,
 * manter 44 px e fonte 16 px para legibilidade e evitar zoom automático iOS.
 */
@media screen {
  :root[data-layout="minimal"] #items-table .portal-item-grid th.item-grid-code {
    width: 100px;
  }

  :root[data-layout="minimal"] #items-table .portal-item-grid .item-grid-code {
    font-weight: 600;
    overflow-wrap: anywhere;
  }

  :root[data-layout="minimal"] :is(#items-table, #review-content) .item-grid-material-line {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 4px 8px;
  }

  :root[data-layout="minimal"] :is(#items-table, #review-content) .item-grid-material-line > :is(.item-description, .review-product-name) {
    margin: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    font-size: inherit;
    line-height: 1.3;
  }

  :root[data-layout="minimal"] :is(#items-table, #review-content) .item-grid-details > summary {
    min-height: 44px;
    display: flex;
    align-items: center;
    cursor: pointer;
    color: var(--ink);
    text-decoration: underline;
    text-underline-offset: 3px;
    font-size: .75rem;
    font-weight: 500;
  }

  :root[data-layout="minimal"] :is(#items-table, #review-content) .item-grid-details > summary::before {
    content: '+';
    margin-right: 4px;
    font-weight: 700;
  }

  :root[data-layout="minimal"] :is(#items-table, #review-content) .item-grid-details[open] > summary::before {
    content: '−';
  }

  :root[data-layout="minimal"] :is(#items-table, #review-content) .item-grid-details[open] {
    grid-column: 1 / -1;
  }

  :root[data-layout="minimal"] :is(#items-table, #review-content) .item-grid-material-line:has(.item-grid-details[open]) > :is(.item-description, .review-product-name) {
    white-space: normal;
    overflow-wrap: anywhere;
  }

  :root[data-layout="minimal"] :is(#items-table, #review-content) .item-grid-detail-body {
    display: grid;
    gap: 5px;
    padding-bottom: 5px;
    font-size: .75rem;
    line-height: 1.4;
  }

  :root[data-layout="minimal"] :is(#items-table, #review-content) .item-grid-help > :is(small, .unit-price-source) {
    display: inline;
    margin: 0;
    font-size: inherit;
  }

  :root[data-layout="minimal"] #items-table .portal-item-grid :is(.item-grid-code, .item-grid-material) {
    text-align: left;
  }

  :root[data-layout="minimal"] #items-table .portal-item-grid tbody tr:focus-within {
    outline: 2px solid var(--ink);
    outline-offset: -2px;
  }
}

@media screen and (min-width: 901px) and (pointer: fine) {
  :root[data-layout="minimal"] #items-table .discount-toolbar {
    padding: 8px;
    gap: 6px 10px;
    margin-block: 8px;
    border-radius: 0;
    font-size: 13px;
  }

  :root[data-layout="minimal"] #items-table .discount-toolbar :is(input, button) {
    min-height: 30px;
    padding: 4px 8px;
    font-size: 13px;
  }

  :root[data-layout="minimal"] #items-table .discount-toolbar small {
    font-size: 12px;
  }

  :root[data-layout="minimal"] #items-table .table-scroll {
    max-height: 65vh;
    overflow: auto;
  }

  :root[data-layout="minimal"] #items-table .portal-item-grid {
    min-width: 1040px;
    font-size: 13px;
    line-height: 1.3;
  }

  :root[data-layout="minimal"] #items-table .portal-item-grid :is(th, td) {
    padding: 3px 6px;
    vertical-align: middle;
  }

  :root[data-layout="minimal"] #items-table .portal-item-grid th {
    position: sticky;
    top: 0;
    z-index: 1;
    padding-block: 6px;
    font-size: 12px;
  }

  :root[data-layout="minimal"] #items-table .portal-item-grid th.item-grid-code { width: 90px; }
  :root[data-layout="minimal"] #items-table .portal-item-grid th.item-grid-material { width: auto; }
  :root[data-layout="minimal"] #items-table .portal-item-grid th.item-grid-sap { width: 88px; }
  :root[data-layout="minimal"] #items-table .portal-item-grid th.item-grid-net { width: 100px; }
  :root[data-layout="minimal"] #items-table .portal-item-grid th.item-grid-quantity { width: 76px; }
  :root[data-layout="minimal"] #items-table .portal-item-grid th.item-grid-manual { width: 92px; }
  :root[data-layout="minimal"] #items-table .portal-item-grid th.item-grid-extra { width: 66px; }
  :root[data-layout="minimal"] #items-table .portal-item-grid th.item-grid-campaign { width: 76px; }
  :root[data-layout="minimal"] #items-table .portal-item-grid th.item-grid-subtotal { width: 112px; }
  :root[data-layout="minimal"] #items-table .portal-item-grid th.item-grid-actions { width: 48px; }

  :root[data-layout="minimal"] #items-table .portal-item-grid :is(input, input.manual-price, input.item-discount) {
    min-height: 28px;
    height: 28px;
    padding: 3px 5px;
    font-size: 13px;
    line-height: 1.2;
  }

  :root[data-layout="minimal"] #items-table .portal-item-grid .unit-price-value {
    font-size: 13px;
    line-height: 1.3;
  }

  :root[data-layout="minimal"] #items-table .portal-item-grid .remove {
    min-height: 28px;
    min-width: 28px;
    width: 28px;
    height: 28px;
    padding: 4px;
  }

  :root[data-layout="minimal"] #items-table .portal-item-grid .text-button {
    min-height: 28px;
    margin: 0;
    padding: 3px 0;
  }

  :root[data-layout="minimal"] :is(#items-table, #review-content) .item-grid-details > summary {
    min-height: 28px;
    font-size: 11px;
  }

  :root[data-layout="minimal"] :is(#items-table, #review-content) .item-grid-scroll-hint {
    margin-block: 4px;
    font-size: 12px;
  }
}

@media screen and (max-width: 900px), screen and (pointer: coarse) {
  :root[data-layout="minimal"] #items-table .portal-item-grid :is(input, input.manual-price, input.item-discount) {
    min-height: 44px;
    font-size: 16px;
  }
}
/* ===== FIM · COMPONENTE grade compacta como planilha ===== */
