/* ==========================================================================
   Portal de Passivos Funcionais — TCE/TO
   Estilos complementares ao Bootstrap 4.2
   ========================================================================== */

:root {
  --pf-background: #f4f5f7;
  --pf-foreground: #262b3d;
  --pf-surface: #ffffff;
  --pf-institucional: #262c47;
  --pf-institucional-foreground: #fbfbfd;
  --pf-primary: #313a5c;
  --pf-secondary: #eaebf0;
  --pf-secondary-foreground: #383f5c;
  --pf-muted: #eff0f3;
  --pf-muted-foreground: #6b7189;
  --pf-accent: #c97a3d;
  --pf-accent-foreground: #fffdfa;
  --pf-success: #3f8b62;
  --pf-warning: #c98a3d;
  --pf-warning-bg: rgba(201, 138, 61, 0.15);
  --pf-border: #dcdfe6;
  --pf-radius: 0.375rem;

  --pf-chart-1: #313a5c;
  --pf-chart-2: #c97a3d;
  --pf-chart-3: #a1432c;
}

body {
  background-color: var(--pf-background);
  color: var(--pf-foreground);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

main.pf-main {
  font-size: 1.75rem !important;
}

.pf-header {
  background-color: var(--pf-institucional);
  color: var(--pf-institucional-foreground);
}

.pf-header .pf-eyebrow {
  font-size: 0.7em;
  text-transform: uppercase;
  letter-spacing: 0.25em;
  opacity: 0.7;
  margin-bottom: 0;
}

.pf-header h1 {
  font-size: 1.75em;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin-top: 0.25rem;
  margin-bottom: 0;
}

.pf-header .pf-subtitle {
  font-size: 0.75em;
  opacity: 0.75;
  margin-top: 0.25rem;
  margin-bottom: 0;
}

@media (min-width: 768px) {
  .pf-header h1 {
    font-size: 2em;
  }
}

/* Cards ------------------------------------------------------------------ */

.pf-card {
  background-color: var(--pf-surface);
  border: 1px solid var(--pf-border);
  border-radius: var(--pf-radius);
  box-shadow: 0 1px 2px rgba(16, 20, 35, 0.04);
  padding: 1.25rem;
}

.pf-kpi-label {
  font-size: 0.75em;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--pf-muted-foreground);
  margin-bottom: 0.5rem;
}

.pf-kpi-value {
  font-size: 1.5em;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--pf-foreground);
  margin-bottom: 0;
}

.pf-kpi-value.pf-destaque {
  color: var(--pf-accent);
}

.pf-kpi-servidores-total {
  font-size: 2.25em;
  font-weight: 600;
  color: var(--pf-foreground);
  margin-bottom: 0;
  line-height: 1.1;
}

.pf-kpi-servidores-sub {
  font-size: 0.875em;
  color: var(--pf-muted-foreground);
  margin-top: 0.5rem;
  margin-bottom: 0;
}

/* Filtros ------------------------------------------------------------------ */

.pf-filtros .form-label {
  font-size: 0.75em;
  font-weight: 500;
  color: var(--pf-muted-foreground);
  margin-bottom: 0.375rem;
}

.pf-filtros .form-select {
  border-color: var(--pf-border);
  font-size: 0.875em;
}

.pf-filtros .form-select:focus {
  border-color: var(--pf-primary);
  box-shadow: 0 0 0 0.2rem rgba(49, 58, 92, 0.15);
}

/* Gráfico de barras (CSS puro) ------------------------------------------- */

.pf-chart-title {
  font-size: 0.875em;
  font-weight: 600;
  color: var(--pf-foreground);
  margin-bottom: 1.25rem;
}

.pf-chart {
  display: flex;
  align-items: flex-end;
  justify-content: space-around;
  gap: 1.5rem;
  height: 20rem;
  padding: 0 1rem;
}

.pf-chart-bar-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  height: 100%;
  flex: 1 1 0;
  max-width: 220px;
}

.pf-chart-value {
  font-size: 0.75em;
  color: var(--pf-muted-foreground);
  margin-bottom: 0.5rem;
  white-space: nowrap;
}

.pf-chart-bar {
  width: 100%;
  max-width: 140px;
  border-radius: 2px 2px 0 0;
  transition: height 0.3s ease;
}

.pf-chart-bar.pf-c1 { background-color: var(--pf-chart-1); }
.pf-chart-bar.pf-c2 { background-color: var(--pf-chart-2); }
.pf-chart-bar.pf-c3 { background-color: var(--pf-chart-3); }

.pf-chart-label {
  font-size: 0.75em;
  color: var(--pf-muted-foreground);
  margin-top: 0.75rem;
  text-align: center;
}

/* Extrato / abas ----------------------------------------------------------- */

.pf-extrato-header {
  border-bottom: 1px solid var(--pf-border);
  padding: 1rem 1.25rem;
}

.pf-extrato-header h2 {
  font-size: 0.875em;
  font-weight: 600;
  color: var(--pf-foreground);
  margin-bottom: 0.75rem;
}

.pf-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  background-color: var(--pf-secondary);
  border-radius: var(--pf-radius);
  padding: 0.25rem;
}

.pf-tab-btn {
  border: none;
  background: transparent;
  color: var(--pf-secondary-foreground);
  font-size: 0.75em;
  padding: 0.375rem 0.75rem;
  border-radius: calc(var(--pf-radius) - 2px);
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.pf-tab-btn:hover {
  background-color: rgba(255, 255, 255, 0.5);
}

.pf-tab-btn.active {
  background-color: var(--pf-surface);
  color: var(--pf-foreground);
  box-shadow: 0 1px 2px rgba(16, 20, 35, 0.08);
}

/* Tabela ------------------------------------------------------------------ */

.pf-table-wrap {
  overflow-x: auto;
}

.pf-table {
  margin-bottom: 0;
  font-size: 0.8125em;
}

.pf-table thead th {
  background-color: rgba(234, 235, 240, 0.6);
  color: var(--pf-muted-foreground);
  font-weight: 600;
  font-size: 0.75em;
  text-transform: none;
  border-bottom: 1px solid var(--pf-border);
  border-top: none;
  white-space: nowrap;
}

.pf-table td,
.pf-table th {
  vertical-align: middle;
  border-color: var(--pf-border);
}

.pf-table td.text-right,
.pf-table th.text-right {
  text-align: right;
}

.pf-table td.tabular {
  font-variant-numeric: tabular-nums;
}

.pf-table td.pf-descricao {
  font-size: 0.75em;
  color: var(--pf-muted-foreground);
  min-width: 280px;
}

.pf-table td.pf-competencia {
  font-weight: 500;
  white-space: nowrap;
}

.pf-table td.pf-data-pagamento {
  color: var(--pf-muted-foreground);
  white-space: nowrap;
}

.pf-badge-situacao {
  display: inline-flex;
  border-radius: 2px;
  background-color: var(--pf-warning-bg);
  color: var(--pf-warning);
  font-size: 0.75em;
  font-weight: 500;
  padding: 0.125rem 0.5rem;
}

.pf-empty-row td {
  text-align: center;
  color: var(--pf-muted-foreground);
  padding: 2.5rem 0;
}

/* Rodapé de totais da tabela --------------------------------------------- */

.pf-table tfoot tr {
  background: linear-gradient(90deg, var(--pf-institucional) 0%, var(--pf-primary) 100%);
}

.pf-table tfoot td {
  border-top: 2px solid var(--pf-accent);
  border-bottom: none;
  color: var(--pf-institucional-foreground);
  font-weight: 700;
  padding-top: 0.75em;
  padding-bottom: 0.75em;
}

.pf-table tfoot td.pf-total-label {
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  font-size: 0.75em;
  white-space: nowrap;
}

.pf-total-sigma {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.6em;
  height: 1.6em;
  border-radius: 50%;
  background-color: var(--pf-accent);
  color: var(--pf-accent-foreground);
  font-size: 0.9em;
  font-style: normal;
  line-height: 1;
  vertical-align: middle;
  margin-right: 0.5em;
}

.pf-table tfoot td.tabular {
  font-variant-numeric: tabular-nums;
  font-size: 0.9375em;
}

.pf-table tfoot .pf-total-saldo {
  color: var(--pf-accent);
  position: relative;
}

.pf-table tfoot .pf-total-saldo::after {
  content: "";
  position: absolute;
  left: 0.5em;
  right: 0.5em;
  bottom: 0.2em;
  height: 2px;
  background-color: var(--pf-accent);
  opacity: 0.5;
  border-radius: 1px;
}

.pf-footer {
  font-size: 0.75em;
  color: var(--pf-muted-foreground);
  padding-top: 0.5rem;
}
