.dashboard-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin: 34px 0 22px;
}

.dashboard-controls .mode-tabs {
  margin: 0;
}

.cashflow-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(390px, .85fr);
  gap: 14px;
  margin-top: 14px;
}

.cashflow-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-bottom: 1px solid var(--line);
}

.cashflow-metrics > div {
  padding: 18px 22px;
  border-right: 1px solid var(--line);
}

.cashflow-metrics > div:last-child {
  border-right: 0;
}

.cashflow-metrics span {
  display: block;
  color: var(--muted);
  font-size: 10px;
  margin-bottom: 6px;
}

.cashflow-metrics strong {
  font: 600 20px Onest;
  white-space: nowrap;
}

.income-text {
  color: var(--green) !important;
}

.expense-text {
  color: var(--red) !important;
}

.flow-bars {
  padding: 17px 22px;
  border-bottom: 1px solid var(--line);
  display: grid;
  gap: 10px;
}

.flow-bars > div {
  display: grid;
  grid-template-columns: 50px 1fr;
  gap: 10px;
  align-items: center;
}

.flow-bars span {
  color: var(--muted);
  font-size: 10px;
}

.flow-bars i {
  display: block;
  height: 8px;
  border-radius: 8px;
  background: #edf0eb;
  overflow: hidden;
}

.flow-bars b {
  display: block;
  height: 100%;
  border-radius: 8px;
}

.income-bar {
  background: var(--green2);
}

.expense-bar {
  background: #d68a52;
}

.dashboard-categories {
  padding: 17px 22px;
}

.dashboard-categories > a {
  display: grid;
  grid-template-columns: 9px 1fr 42px auto;
  align-items: center;
  gap: 9px;
  padding: 7px 0;
  color: var(--ink);
  text-decoration: none;
}

.dashboard-categories > a small {
  color: var(--muted);
  text-align: right;
}

.dashboard-categories > a b {
  font-size: 11px;
  white-space: nowrap;
}

.cashflow-empty {
  padding: 15px 0;
}

.recent-operations article {
  display: grid;
  grid-template-columns: 35px minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  padding: 13px 18px;
  border-bottom: 1px solid var(--line);
}

.recent-operations article:last-child {
  border-bottom: 0;
}

.operation-sign {
  width: 35px;
  height: 35px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  font-weight: 700;
}

.operation-sign.income {
  background: var(--mint);
  color: var(--green);
}

.operation-sign.expense {
  background: var(--warm);
  color: #9b6230;
}

.recent-operations article > div:nth-child(2) {
  min-width: 0;
}

.recent-operations article > div:nth-child(2) > strong {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.recent-operations p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 10px;
}

.recent-operations article > b {
  white-space: nowrap;
  font-size: 12px;
}

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

@media (max-width: 800px) {
  .dashboard-controls {
    align-items: stretch;
    flex-direction: column;
  }

  .dashboard-controls .mode-tabs,
  .dashboard-controls .period-tabs {
    width: 100%;
  }

  .dashboard-controls .mode-tabs a,
  .dashboard-controls .period-tabs a {
    flex: 1;
    text-align: center;
  }
}

@media (max-width: 560px) {
  .cashflow-metrics {
    grid-template-columns: 1fr;
  }

  .cashflow-metrics > div {
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding: 14px 18px;
  }

  .cashflow-metrics > div:last-child {
    border-bottom: 0;
  }

  .dashboard-categories {
    padding-left: 18px;
    padding-right: 18px;
  }
}
