.desvio-consumo-page {
  min-height: 100vh;
  padding: 34px clamp(22px, 3vw, 54px) 42px;
  background:
    linear-gradient(180deg, rgba(255, 253, 248, 0.72), rgba(232, 223, 209, 0.82)),
    var(--color-bg);
}

.desvio-consumo-header,
.desvio-consumo-workspace {
  max-width: var(--content-max);
  margin: 0 auto;
}

.desvio-consumo-header {
  margin-bottom: 24px;
}

.desvio-consumo-header h1 {
  margin: 0;
  color: var(--sa-marrom-escuro);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2rem, 3vw, 3.2rem);
  line-height: 1;
}

.desvio-consumo-workspace {
  display: grid;
  gap: 18px;
}

.desvio-consumo-records-header {
  gap: 16px;
}

.desvio-consumo-filters {
  display: grid;
  grid-template-columns: minmax(160px, 240px) auto;
  gap: 10px;
  align-items: end;
  padding: 16px;
  border-top: 1px solid rgba(62, 45, 31, 0.12);
}

.desvio-consumo-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 0 16px 16px;
}

.desvio-consumo-legend span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 6px 10px;
  border: 1px solid rgba(62, 45, 31, 0.12);
  border-radius: var(--radius-sm);
  background: rgba(255, 253, 248, 0.76);
  color: var(--sa-marrom-escuro);
  font-size: 0.84rem;
  font-weight: 800;
}

.desvio-consumo-legend i {
  width: 18px;
  height: 18px;
  border-radius: 50%;
}

.desvio-consumo-table-wrap {
  overflow-x: auto;
  padding-bottom: 10px;
}

.desvio-consumo-table {
  width: max-content;
  min-width: 100%;
  table-layout: auto;
  border-collapse: separate;
  border-spacing: 0;
}

.desvio-consumo-table th,
.desvio-consumo-table td {
  min-width: 104px;
  padding: 12px 14px;
  border-right: 1px solid rgba(62, 45, 31, 0.12);
  border-bottom: 1px solid rgba(62, 45, 31, 0.10);
  vertical-align: middle;
  white-space: nowrap;
}

.desvio-consumo-table th:last-child,
.desvio-consumo-table td:last-child {
  border-right: 0;
}

.desvio-consumo-table th {
  background: rgba(107, 123, 75, 0.12);
  color: var(--sa-marrom-escuro);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.desvio-consumo-table .numeric-cell {
  text-align: right;
  font-weight: 900;
}

.desvio-consumo-table .date-cell {
  min-width: 118px;
  color: var(--sa-marrom-escuro);
  font-weight: 800;
}

.desvio-consumo-table .average-cell {
  position: sticky;
  left: 0;
  z-index: 1;
  color: var(--sa-marrom-escuro);
  background: #fffdf8;
  box-shadow: 1px 0 0 rgba(62, 45, 31, 0.12);
}

.desvio-consumo--normal {
  color: #243c28;
  background: #b8d7a8;
}

.desvio-consumo--atencao {
  color: #4a3a0a;
  background: #f1d86a;
}

.desvio-consumo--alto {
  color: #fffdf8;
  background: #b84d44;
}

.desvio-consumo--critico {
  color: #fffdf8;
  background: #1f1b18;
}

@media (max-width: 760px) {
  .desvio-consumo-page {
    padding: 84px 16px 30px;
  }

  .desvio-consumo-filters {
    grid-template-columns: 1fr;
  }
}
