/* Fase 3: operação BPO, seguindo as superfícies e cores do sistema. */
.bpo-kpis {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.bpo-kpis .kpi-card { min-height: 102px; }
.bpo-kpis .kpi-value { white-space: normal; }
.bpo-section { margin-bottom: 18px; }
.bpo-section .card-title { margin-bottom: 16px; }
.bpo-cash-summary { display: flex; flex-wrap: wrap; gap: 14px 28px; margin-bottom: 18px; }
.bpo-cash-summary .text-blue { color: var(--color-blue); }
.bpo-cash-summary .text-red { color: var(--color-red); }
.bpo-bars { display: grid; gap: 10px; }
.bpo-bars-row { display: grid; grid-template-columns: minmax(130px, 220px) minmax(120px, 1fr) 120px; align-items: center; gap: 12px; }
.bpo-bars-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bpo-bars-track { display: grid; gap: 4px; }
.bpo-bar { display: block; height: 7px; border-radius: 4px; min-width: 0; }
.bpo-bar--income { background: var(--color-blue); }
.bpo-bar--expense { background: var(--color-red); }
.bpo-bars-result { text-align: right; font-family: var(--font-mono); font-size: 12px; }
.bpo-secondary { display: block; margin-top: 2px; font-size: 12px; color: var(--text-muted); }
.bpo-error { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.bpo-tabs { display: flex; overflow-x: auto; gap: 5px; border-bottom: 1px solid var(--border); margin-bottom: 18px; }
.bpo-tab { border: 0; border-bottom: 2px solid transparent; background: none; color: var(--text-muted); padding: 10px 15px; cursor: pointer; white-space: nowrap; }
.bpo-tab.active { border-bottom-color: var(--color-blue); color: var(--color-blue); font-weight: 700; }
.bpo-detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-bottom: 18px; }
.bpo-detail { display: flex; justify-content: space-between; gap: 16px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.bpo-detail span { color: var(--text-muted); }
.bpo-detail strong { text-align: right; overflow-wrap: anywhere; }
.bpo-helper { color: var(--text-muted); font-size: 12px; margin-top: 12px; }
#clients-search { min-width: min(100%, 300px); }

@media (max-width: 1100px) {
  .bpo-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 750px) {
  .bpo-detail-grid { grid-template-columns: 1fr; }
  .bpo-bars-row { grid-template-columns: minmax(90px, 140px) minmax(60px, 1fr); }
  .bpo-bars-result { grid-column: 2; text-align: left; }
}
@media (max-width: 520px) {
  .bpo-kpis { grid-template-columns: 1fr; }
  .bpo-error { flex-direction: column; align-items: flex-start; }
  .bpo-detail { flex-direction: column; gap: 2px; }
  .bpo-detail strong { text-align: left; }
}
