@import 'src/styles/variables';

.card {
  position: relative;
  display: inline-block;
  width: 100%;
  padding: var(--space-xxl) var(--space-s) var(--space-s);
  margin: 0 var(--space-xxl) var(--space-xxl) 0;

  page-break-inside: avoid;
  box-sizing: border-box;
  vertical-align: top;

  border-radius: var(--border-radius-m);
  border: 1px solid var(--color-border);
  background-color: var(--color-white);

  &_wrapper {
    width: calc(100% + 24px);
    margin: 0;
  }

  &_title {
    position: absolute;
    top: -13px;
    left: 20%;
    right: 20%;

    font-size: var(--font-m);
    font-weight: bold;
    display: inline-block;
    padding: var(--space-xxs) var(--space-s);
    margin: 0 0 var(--space-l);

    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: center;

    border-radius: var(--border-radius-s);
    border: 1px solid var(--color-border);
    background-color: var(--color-white);
  }

  &_line {
    display: flex;
    justify-content: space-between;
    align-items: center;

    padding: var(--space-xxs) var(--space-xxs) var(--space-xxxs);

    white-space: nowrap;
    box-sizing: border-box;
    border: none;

    &_title,
    &_value {
      font-size: var(--font-s);
      position: relative;

      display: inline-block;
      width: max-content;

      line-height: 1.3;
      white-space: normal;
      text-overflow: ellipsis;
      vertical-align: top;
      box-sizing: border-box;
      text-align: left;

      color: var(--color-42);
    }

    &_value {
      text-align: right;
    }
  }

  &_line_with_template {
    display: block;
    text-align: center;
    margin-top: var(--space-xxs);
    border-top: 2px dotted var(--color-border);

    &_title {
      font-size: var(--font-s);

      display: block;
      padding: var(--space-xxs) var(--space-xxs) var(--space-xxs);

      line-height: 1.3;
      white-space: normal;
      text-overflow: ellipsis;
      vertical-align: top;
      box-sizing: border-box;

      color: var(--color-42);
    }
  }
}

.card_line + .card_line {
  border-top: 1px solid var(--color-border);
}

.card_line_with_template > .line_chart  {
  margin-top: 0;
}
