@use '@carbon/layout';
@use '@carbon/colors';
@use '@carbon/type';

.card {
  background-color: colors.$white;
  border: 1px solid colors.$gray-20;
  width: 100%;
  justify-content: space-between;
  display: flex;
  flex-direction: column;
}

.header {
  padding: layout.$spacing-05;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: layout.$spacing-03;
}

.title {
  @include type.type-style('heading-compact-01');
  font-weight: 600;
  color: colors.$gray-100;
  flex: 1;
}

.refreshButton {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  height: 2rem;
  min-width: 2rem;

  :global(.cds--btn--ghost) {
    padding: layout.$spacing-02;
    min-height: 2rem;
    height: 2rem;
    width: 2rem;
    color: colors.$blue-60;

    &:hover {
      background-color: colors.$gray-10;
    }

    &:disabled {
      opacity: 0.5;
      cursor: not-allowed;
    }
  }

  :global(.cds--inline-loading) {
    min-height: 2rem;
    justify-content: center;
  }

  :global(.cds--inline-loading__text) {
    display: none;
  }
}

.content {
  display: flex;
  align-items: center;
  padding: layout.$spacing-05;
  gap: layout.$spacing-07;
  justify-content: space-between;
}

.totalSection {
  flex: 1;
}

.total {
  @include type.type-style('heading-06');
  font-size: 2rem;
  font-weight: 400;
  color: colors.$gray-70;
  line-height: 1;
}

.categoriesSection {
  display: flex;
  gap: layout.$spacing-06;
  justify-content: flex-end;
}

.category {
  text-align: center;
  min-width: 60px;
}

.categoryLabel {
  @include type.type-style('label-01');
  font-size: 0.75rem;
  color: colors.$gray-70;
  margin-bottom: layout.$spacing-02;
  white-space: nowrap;
}

.categoryValue {
  @include type.type-style('heading-04');
  font-size: 1.5rem;
  font-weight: 400;
  color: colors.$gray-100;
}

.link {
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: layout.$spacing-01;
  color: colors.$blue-60;
  cursor: pointer;
  font-size: small;
}
