/* Tables - Bootstrap Compatible */

.table {
  width: 100%;
  max-width: 100%;
  margin-bottom: @default-gutter-size;
  background-color: transparent;
  border-spacing: 0;
  border-collapse: collapse;

  td, th {
    padding: @default-gutter-size/2 @default-gutter-size;
  }

  > * > tr > th,
  > * > tr > td {
    padding: 6px 12px;
    line-height: @default-line-height;
    vertical-align: top;

    &.border-top {
      border-top: 1px solid @default-border-color;
    }
    &.border-left {
      border-left: 1px solid @default-border-color;
    }
    &.border-right {
      border-right: 1px solid @default-border-color;
    }
    &.border-bottom {
      border-bottom: 1px solid @default-border-color;
    }
    @media print {
      &.border-top, &.border-left, &.border-right, &.border-bottom {
        border-color: #000 !important;
      }
    }
  }

  > thead > tr > th {
    padding: 6px 12px;
    text-align: left;
    vertical-align: bottom;
    border-bottom: 2px solid @default-border-color;
    @media print {
      border-color: #000 !important;
    }
    &.main {
      width: 100%;
    }
  }

  > tfoot {
    padding: 6px 12px;
    text-align: left;
    border-top: 1px solid @default-border-color;
    @media print {
      border-color: #000 !important;
    }
  }

  &.table-bordered {
    border: 1px solid @default-border-color;
    > * > tr > td {
      border-top: 1px solid @default-border-color;
      @media print {
        border-color: #000 !important;
      }
    }
  }

  &.table-striped {
    > tbody > tr:nth-of-type(odd) {
      background: @table-striped-row-background-odd;
    }
    > tbody > tr:nth-of-type(even) {
      background: @table-striped-row-background-even;
    }
    @media print {
      > tbody > tr {
        border-bottom: 1px solid #000;
      }
    }
  }

  &.table-hover {
    > tbody > tr {
      transition: background 125ms linear;
      &:hover {
        background: @table-row-hover-background;
      }
    }
  }

  &.table-sortable th[data-sort] {
    cursor: pointer;
    &:hover {
      text-decoration: underline;
    }
  }

  &.table-dragable {
    > tbody .grabable {
      cursor: n-resize;
    }
    > tbody > tr.grabbed {
      user-input: unset;
      box-shadow: 0 0 10px 0 rgba(0, 0, 0, 0.5);
    }
  }

  &.table-input {
    > tbody > tr > td {
      vertical-align: middle;
    }
  }

  &.data-table {
    white-space: nowrap;
  }
}

.table-responsive {
  overflow-x: auto;
  > .table {
    margin-bottom: 0;
  }
}

.table > caption + thead > tr:first-child > th,
.table > colgroup + thead > tr:first-child > th,
.table > thead:first-child > tr:first-child > th,
.table > caption + thead > tr:first-child > td,
.table > colgroup + thead > tr:first-child > td,
.table > thead:first-child > tr:first-child > td {
  border-top: 0;
}
