/* Espaço consistente entre ações, sem alterar os controles nem a impressão. */
@media screen {
  :root {
    --action-gap-x: clamp(16px, 1.5vw, 24px);
    --action-gap-y: 12px;
  }

  .ops-shell :is(.row-actions, .fixed-row-actions, .employee-notice-row-actions) {
    gap: var(--action-gap-y) var(--action-gap-x);
  }

  .ops-shell :is(.row-actions, .fixed-row-actions, .employee-notice-row-actions):has(> :is(button, a):not([hidden]) ~ :is(button, a):not([hidden])) {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    width: 100%;
    min-width: 0;
  }

  .ops-shell :is(.row-actions, .fixed-row-actions, .employee-notice-row-actions) > :is(button, a) {
    min-height: 44px;
    max-width: 100%;
    text-align: center;
  }

  /* Cobranças mantêm seus botões empilhados nas colunas estreitas. */
  .ops-shell .billing-list .billing-row-actions,
  .ops-shell .fixed-billing-overview .fixed-billing-row-actions {
    gap: var(--action-gap-y) var(--action-gap-x);
  }

  .ops-shell :is(.page-actions, .fixed-head-actions, .billing-list-toolbar-actions,
    .employee-notice-head-actions, .fixed-card-actions, .fixed-inline-actions,
    .fixed-report-actions, .fixed-invoice-actions, .billing-invoice-actions,
    .visitor-filter-actions, .history-filter-actions, .fixed-service-filter-actions,
    .lookup-actions, .operator-card-actions, .operator-suggestion-actions,
    .extra-add-actions, .contract-document-links, .contract-upload-actions,
    .contract-upload-footer) {
    gap: var(--action-gap-y) var(--action-gap-x);
  }

  .ops-shell :is(.fixed-card-actions, .fixed-inline-actions, .fixed-report-actions,
    .operator-card-actions, .operator-suggestion-actions, .extra-add-actions,
    .contract-document-links, .contract-upload-actions):has(> :is(button, a):not([hidden]) ~ :is(button, a):not([hidden])) {
    justify-content: space-between;
  }

  /* Os formulários dos módulos também podem abrir fora de .ops-shell. */
  .ops-shell .dialog-actions,
  .fixed-dialog .fixed-dialog-actions,
  .billing-dialog .billing-editor-actions,
  .employee-notice-dialog .employee-notice-dialog-actions {
    gap: 14px var(--action-gap-x);
    flex-wrap: wrap;
  }

  .fixed-dialog :is(.fixed-inline-actions, .fixed-report-actions, .fixed-invoice-actions),
  .billing-dialog .billing-invoice-actions {
    gap: var(--action-gap-y) var(--action-gap-x);
  }

  .h24-receipt-share-grid { gap: 16px; }

  /* Ícones continuam compactos; a saída recebe o espaço restante da linha. */
  .ops-shell .yard-table .visitor-yard-actions {
    justify-content: flex-end;
    gap: 12px;
    flex-wrap: nowrap;
  }
}

@media screen and (min-width: 1200px) {
  .fixed-history-list .fixed-list-head,
  .fixed-history-list .fixed-list-row {
    grid-template-columns: minmax(0, 1.1fr) repeat(3, minmax(0, 1fr)) minmax(80px, .7fr) minmax(180px, 1.2fr);
  }
}

@media screen and (max-width: 1199px) {
  .ops-shell :is(.fixed-row-actions, .employee-notice-row-actions):has(> :is(button, a):not([hidden]) ~ :is(button, a):not([hidden])) > :is(button, a) {
    flex: 1 1 auto;
    width: auto;
    min-width: 0;
  }
}

@media screen and (max-width: 760px) {
  .ops-shell :is(.row-actions, .fixed-row-actions, .employee-notice-row-actions,
    .billing-row-actions, .fixed-billing-row-actions) {
    gap: 12px;
  }
  .ops-shell .billing-list .billing-row-actions,
  .ops-shell .fixed-billing-overview .fixed-billing-row-actions {
    gap: 12px;
  }
  .ops-shell .cell-actions .row-actions:not(.visitor-yard-actions) > :is(button, a) {
    flex: 1 1 calc(50% - 6px);
    width: auto;
    min-width: 0;
  }
  .ops-shell .yard-table .visitor-yard-actions .yard-departure-button {
    white-space: normal;
    line-height: 1.5;
  }
  .fixed-dialog .fixed-dialog-actions,
  .billing-dialog .billing-editor-actions,
  .employee-notice-dialog .employee-notice-dialog-actions,
  .ops-shell .dialog-actions {
    gap: 12px;
  }
}
