@card-transition: ~"all .15s ease-in-out";

// wrapper

.cards {
  .clearfix();
  margin-left: -2%;
  font-size: 0;
  min-height: 300px;

  .card {
    display: inline-block;
    vertical-align: top;
    margin: 0 0 2% 2%;
    width: 31.33333333333333%;

    @media (max-width: 1300px) {
      width: 48%;
    }

    @media (max-width: 991px) {
      width: auto;
      display: block;
      margin-bottom: 4%;
    }
  }
}

// card

.card {
  position: relative;
  margin-bottom: 30px;
  background-color: @widget-bg;
  padding: 20px;
  .box-shadow(0 1px 5px rgba(0,0,0,.1));
  border-radius: 3px;
  .transition(@card-transition);

  &__image {
    border-radius: 3px 3px 0 0;
    overflow: hidden;
    margin: -20px -20px 20px;
    border-bottom: 1px solid @widget-header-border;

    img {
      .img-responsive();
    }
  }

  &__item {
    .clearfix();

    &__actions {
      position: absolute;
      right: 20px;
      top: 20px;

      > .dropdown-toggle {
        font-size: 16px;
        line-height: 20px;
        width: 20px;
        text-align: center;
        display: block;

        .fa {
          vertical-align: middle;
        }

        &,
        &:focus {
          color: fade(@text-color, 30%);
          text-decoration: none;
        }
      }

      &.open > .dropdown-toggle {
        background: #f5f5f5;
        border-radius: 50%;
      }

      .dropdown-menu {
        margin-top: 10px;
        right: -6px;
        border-radius: 3px;

        &::before {
          display: block;
          content: '';
          position: absolute;
          right: 10px;
          bottom: 100%;
          width: 0;
          height: 0;
          border-style: solid;
          border-width: 0 6px 7px 6px;
          border-color: transparent transparent #fff transparent;
        }
      }
    }

    &__image {
      width: 60px;
      height: 60px;
      border-radius: 50%;
      overflow: hidden;
      float: left;
      margin-right: 15px;

      img {
        .img-responsive();
      }

      > .fa {
        width: 60px;
        height: 60px;
        line-height: 60px;
        font-size: 24px;
        text-align: center;
        color: fade(@text-color, 50%);
        background: #f5f5f5;
        border-radius: 50%;
        border: 1px solid #f0f0f0;
      }
    }

    &__body {
      overflow: hidden;

      > *:last-child {
        margin-bottom: 0;
      }

      h4 {
        margin: 4px 0 4px;
        font-size: 16px;
        font-weight: bold;
        color: fade(@text-color, 80%)
      }

      p {
        color: fade(@text-color, 50%);
        font-size: 12px;
        line-height: 16px;
        height: 32px;
        overflow: hidden;
      }
    }
  }

  &__actions {
    .clearfix();
    padding: 20px 20px 0;
    margin: 20px -20px 0;
    border-top: 1px solid @widget-header-border;

    &__info {
      float: left;
      font-size: 12px;
      line-height: 22px;
      color: fade(@text-color, 50%);

      @media (min-width: 992px) and (max-width: 1280px) {
        display: none;
      }
    }

    &__status {
      color: fade(@brand-success, 50%);
      float: right;
      font-size: 12px;
      line-height: 22px;
      margin-left: 5px;

      &--inactive {
        color: fade(@brand-danger, 50%);
      }
    }

    .btn {

      &.pull-right {
        margin-left: 5px;
      }
    }
  }

  // modifiers
  &.is-hidden {
    display: none;
  }

  &--remote {
    
  }

  &--active {
    .box-shadow(0 0 0 4px fade(@brand-success, 20%));
  }

  &--inactive {
    .box-shadow(0 0 0 4px fade(@brand-danger, 20%));
  }

  &--widget {

    .card__item__body {
      text-align: right;

      h4 {
        font-size: 26px;
        font-weight: bold;
      }

      p {
        font-size: 16px;
        line-height: 16px;
        height: auto;
      }
    }
  }
}



//
// Card item modifiers
// --------------------------------------------------

.card-item-variant(@color) {

  .card__item__image {

    > .fa {
      color: @color;
      background: fade(@color, 10%);
      border-color: fade(@color, 15%);
    }
  }

  .card__item__body {
    h4 {
      color: @color;
    }
  }
}

.card__item--primary { .card-item-variant(@brand-primary); }
.card__item--success { .card-item-variant(@brand-success); }
.card__item--info { .card-item-variant(@brand-info); }
.card__item--warning { .card-item-variant(@brand-warning); }
.card__item--danger { .card-item-variant(@brand-danger); }



//
// Cards icons aliases
// --------------------------------------------------

.fa-member::before { content: @fa-var-users; }
.fa-transaction::before { content: @fa-var-money; }