.cost-panel {
  padding: 24px;
  border-top: 1px solid #ddd5cc;
  font-size: 14px;
  line-height: 1.6;
  color: #343a32;
}

.cost-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin: 16px 0;
}

.cost-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin: 20px 0;
}

.cost-card {
  padding: 18px;
  background: #f6f3ee;
  border: 1px solid #d8d5c9;
  border-top: 3px solid #8a5863;
  border-radius: 8px;
}

.cost-card p {
  margin: 0 0 10px;
}

.cost-card strong {
  font-size: 24px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.cost-card p:last-child {
  font-size: 12px;
  margin: 10px 0 0;
  color: #61695b;
}

.cost-panel table,
.cost-print table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
}

.cost-panel th,
.cost-panel td,
.cost-print th,
.cost-print td {
  padding: 10px;
  text-align: left;
  border-bottom: 1px solid #ddd8cf;
  overflow-wrap: anywhere;
}

.cost-panel th,
.cost-print th {
  background: #edf0e5;
}

.cost-coverage {
  background: #edf0e5;
  padding: 14px;
  border-radius: 6px;
}

.cost-warning {
  color: #855522;
}

.cost-meta {
  font-size: 12px;
  color: #646c5c;
}

/* Relatório aberto sobre a plataforma. */
.cost-print {
  position: fixed;
  inset: 0;
  z-index: 5000;
  overflow: auto;
  background: #e8e9e1;
  padding: 24px;
  color: #343a32;
  font: 14px/1.6 Arial, sans-serif;
}

.cost-sheet {
  max-width: 1000px;
  margin: auto;
  background: #fff;
  padding: 40px;
}

.cost-sheet h1 {
  font-size: 26px;
  color: #8a5863;
  border-bottom: 3px solid #acb79d;
  padding-bottom: 18px;
}

.cost-print button {
  font: inherit;
  padding: 12px;
  border: 1px solid #d8d5c9;
  border-radius: 6px;
  background: #f6f3ee;
  cursor: pointer;
}

.cost-print a {
  color: #7a4b55;
}

body.cost-printing {
  overflow: hidden;
}

@media (max-width: 700px) {
  .cost-grid {
    grid-template-columns: 1fr;
  }

  .cost-panel {
    padding: 16px;
  }

  .cost-print {
    padding: 8px;
  }

  .cost-sheet {
    padding: 18px;
  }
}

/* Template de impressão A4. */
@media print {
  @page {
    size: A4;
    margin: 15mm;
  }

  body.cost-printing {
    overflow: visible !important;
  }

  body.cost-printing > :not(#cost-print) {
    display: none !important;
  }

  #cost-print {
    position: static;
    padding: 0;
    background: #fff;
    overflow: visible;
    font-size: 10pt;
  }

  #cost-print .cost-sheet {
    padding: 0;
    max-width: none;
  }

  #cost-print .cost-actions {
    display: none;
  }

  #cost-print .cost-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  #cost-print .cost-card {
    break-inside: avoid;
    padding: 10px;
  }

  #cost-print .cost-card strong {
    font-size: 17pt;
  }

  #cost-print h3,
  #cost-print h4 {
    break-after: avoid;
  }

  #cost-print tr {
    break-inside: avoid;
  }

  #cost-print thead {
    display: table-header-group;
  }

  #cost-print p,
  #cost-print li {
    orphans: 3;
    widows: 3;
  }

  #cost-print table {
    table-layout: fixed;
  }
}
