/* =========================================================
   REGION: FATURAMENTO
   ========================================================= */
.faturamento-page {
  display: grid;
  gap: 1rem;
}

.faturamento-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 1rem;
}

.faturamento-header h1 {
  margin: 0;
  text-align: left;
}

.faturamento-header p {
  margin: .25rem 0 0;
  color: #64748b;
  font-weight: 700;
}

.faturamento-filter {
  display: grid;
  grid-template-columns: repeat(3, minmax(140px, 180px)) auto auto;
  gap: .65rem;
  align-items: end;
}

.faturamento-filter .btn {
  min-height: 42px;
}

.faturamento-stepper {
  display: flex;
}

.faturamento-overview {
  display: grid;
  grid-template-columns: minmax(240px, .65fr) minmax(540px, 1.65fr);
  gap: 1rem;
  align-items: start;
}

.faturamento-overview .logistica-list {
  max-width: none;
  margin: 0;
}

.faturamento-product-card {
  padding: 10px 0;
  border-top: 1px solid #eef1f3;
}

.faturamento-product-card:first-child {
  border-top: 0;
}

.faturamento-product-title {
  display: flex;
  gap: 8px;
  align-items: baseline;
  margin-bottom: 8px;
  color: #212529;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.faturamento-product-code {
  flex: 0 0 auto;
  font-weight: 700;
}

.faturamento-product-name {
  min-width: 0;
  font-weight: 500;
}

.faturamento-product-grid,
.faturamento-mobile-footer {
  display: grid;
  gap: 8px;
}

.faturamento-product-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.faturamento-mobile-footer {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  padding-top: 10px;
  margin-top: 4px;
  border-top: 1px solid #dee2e6;
}

.faturamento-product-grid:has(> :only-child),
.faturamento-mobile-footer:has(> :only-child) {
  grid-template-columns: 1fr;
}

.faturamento-product-grid:has(> :nth-child(2):last-child),
.faturamento-mobile-footer:has(> :nth-child(2):last-child) {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.faturamento-product-grid div,
.faturamento-mobile-footer div {
  min-width: 0;
}

.faturamento-product-grid span,
.faturamento-mobile-footer span {
  display: block;
  color: #6c757d;
  font-size: .72rem;
  font-weight: 700;
  line-height: 1.2;
}

.faturamento-product-grid strong,
.faturamento-mobile-footer strong {
  display: block;
  color: #212529;
  font-size: .84rem;
  line-height: 1.2;
  overflow-wrap: anywhere;
}
@media (max-width: 768px) {
  .faturamento-product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .faturamento-mobile-footer {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
@media (max-width: 1200px) {
  .faturamento-overview {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 992px) {
  .faturamento-header {
    display: grid;
    width: 100%;
    justify-content: stretch;
  }

  .faturamento-filter {
    width: 100%;
    max-width: 100%;
    justify-self: stretch;
    grid-template-columns: repeat(2, minmax(0, 1fr)) auto auto;
  }

  .faturamento-filter > div:nth-child(3) {
    grid-column: 1 / span 2;
  }
}

@media (max-width: 640px) {
  .faturamento-filter {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-areas:
      "inicio fim"
      "mes ."
      "consultar stepper";
    gap: .65rem;
  }

  .faturamento-filter > div {
    min-width: 0;
  }

  .faturamento-filter > div:nth-child(1) {
    grid-area: inicio;
  }

  .faturamento-filter > div:nth-child(2) {
    grid-area: fim;
  }

  .faturamento-filter > div:nth-child(3) {
    grid-area: mes;
    grid-column: auto;
  }

  .faturamento-filter > .btn {
    grid-area: consultar;
    grid-column: auto;
  }

  .faturamento-stepper {
    grid-area: stepper;
    grid-column: auto;
  }

  .faturamento-filter .form-label {
    margin-bottom: .32rem;
    font-size: .86rem;
    line-height: 1.15;
  }

  .faturamento-filter .form-control,
  .faturamento-filter .form-select {
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
    font-size: 16px !important;
  }

  .faturamento-filter input[type="date"].form-control {
    min-width: 0;
  }

  .faturamento-filter > .btn,
  .faturamento-stepper .btn {
    box-sizing: border-box;
    width: 100%;
    padding-left: .45rem;
    padding-right: .45rem;
    font-size: .92rem;
    line-height: 1;
  }
}
