/*
 * PCO Client Admin — overrides for 3-column create form and 3-field filter bar.
 * Memória: usuário solicitou "3 campos na mesma linha" tanto no cadastro quanto no filtro.
 */

/* === Create form: 3 columns on the same line (>=1024px) === */
@media (min-width: 1024px) {
  .auth-form-grid.pco-form-grid-3col {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }

  .auth-form-grid.pco-form-grid-3col > .form-group,
  .auth-form-grid.pco-form-grid-3col > fieldset > .form-group {
    grid-column: span 1 / span 1 !important;
  }
}

/* On smaller screens, fall back to 2 columns then 1 */
@media (max-width: 1023px) and (min-width: 768px) {
  .auth-form-grid.pco-form-grid-3col {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 767px) {
  .auth-form-grid.pco-form-grid-3col {
    grid-template-columns: 1fr !important;
  }
}

/* === Filter bar: 3 fields on the same line (>=1024px), actions below right-aligned === */
@media (min-width: 1024px) {
  .pco-grid-filters-3col .client-grid-filter-field-search,
  .pco-grid-filters-3col .client-grid-filter-field-status,
  .pco-grid-filters-3col .client-grid-filter-field-date {
    grid-column: span 4 / span 4 !important;
  }

  .pco-grid-filters-3col .pco-filter-actions-right {
    grid-column: 9 / span 4 !important;
    justify-self: end !important;
    width: auto !important;
    max-width: none !important;
  }

  .pco-grid-filters-3col .pco-filter-actions-right .btn-canonical,
  .pco-grid-filters-3col .pco-filter-actions-right a.btn-canonical {
    width: auto;
    min-width: 7rem;
  }
}

/* On smaller screens, stack fields and full-width actions */
@media (max-width: 1023px) {
  .pco-grid-filters-3col .client-grid-filter-field-search,
  .pco-grid-filters-3col .client-grid-filter-field-status,
  .pco-grid-filters-3col .client-grid-filter-field-date,
  .pco-grid-filters-3col .pco-filter-actions-right {
    grid-column: 1 / -1 !important;
  }
}
