.backgrid th, .backgrid td {
  font-weight: normal!important;
  text-align: left;
  line-height: $line-height-base;
}

.backgrid.table th.sortable > button {
  width: 100%;
  text-align: left;
  cursor: pointer;
}

.backgrid.backgrid-striped tbody {
  & tr:nth-child(even) {
    background: $table-bg;

    & td.editor {
      background: $table-bg;
      outline: none;
    }
  }
  & tr:nth-child(odd) {
    background: $table-bg;
    & td.editor {
      background: $table-bg;
      outline: none;
    }
  }
}
.backgrid tbody tr.empty td {
  display: table-cell;
  font-style: normal;
  color: $text-muted;
}

.backgrid .textarea-cell {
    text-align: left;
}

.backgrid .textarea-cell.editor textarea {
    width: 100%;
    height: auto;
}

/* Override Backgrid's default z-index */
.dashboard-tab-container .backgrid-filter .search {
  z-index: 10 !important;
}

.dashboard-tab-container .backgrid-filter .clear {
  z-index: 10 !important;
}

.backgrid .string-cell.editor input[type=password] {
  text-align: left;
}

.backgrid > tbody > td.editor input[type=password] {
  display: block;
  width: 100%;
  height: 100%;
  padding: 0 5px;
  margin: 0;
  background-color: transparent;
  border: 0;
  outline: 0;
  -webkit-box-shadow: none;
     -moz-box-shadow: none;
          box-shadow: none;
  -webkit-box-sizing: border-box;
     -moz-box-sizing: border-box;
          box-sizing: border-box;
  -webkit-appearance: none;
     -moz-appearance: none;
}

.backgrid {
  border-radius: inherit;
}

.backgrid thead td,
.backgrid thead th{
  background: $color-bg-theme;
  background-color: $color-bg-theme !important;
  text-align: left;
}

.backgrid:not(.presentation) td.renderable:not(.editable):not(.delete-cell) {
    background-color: $color-gray-lighter;
    // if transparent border then setting color will help
    border-bottom-color: $color-gray-lighter;
}

.backgrid tr.header td.renderable:not(.editable):not(.delete-cell) {
    background-color: $color-gray-light;
}

.sql-editor-grid-container .backgrid > thead > th.renderable,
.sql-editor-grid-container .backgrid > tbody > td.renderable {
    white-space: pre-wrap;
}

table.backgrid {
  position: initial;
}

.backgrid td.editor input[type=password] {
  display: block;
  width: 100%;
  height: 100%;
  padding: 0 5px;
  margin: 0;
  background-color: transparent;
  border: 0;
  outline: 0;
  -webkit-box-shadow: none;
     -moz-box-shadow: none;
          box-shadow: none;
  -webkit-box-sizing: border-box;
     -moz-box-sizing: border-box;
          box-sizing: border-box;
  -webkit-appearance: none;
     -moz-appearance: none;
}

.backgrid td.editor input[type=password]::-ms-clear {
  display: none;
}

.enable-selection, .form-control, .backgrid td, .ajs-content {
  -webkit-user-select: text;
  -moz-user-select: text;
  -ms-user-select: text;
  user-select: text;
}

/* Latest backgrid adds column name like `label` to td element, override color*/
.backgrid td.label {
  color:  $color-gray-dark;
  font-size: 14px;
  font-weight: normal;
}

span.form-control:disabled {
  @extend .form-control:disabled
}

.subnode {
  border: $panel-border;
  background: $color-bg-theme;
}

.subnode-noouter-border {
  border: none !important;
}

.subnode > table.backgrid > thead > tr > th:last-child {
  border-right-color: $color-primary;
}

.subnode > table.backgrid {
    width: 100%;
    margin: 0px;
    padding: 0;
}

.subnode-header button {
  border-left: 1px solid $border-color;
  border-bottom-width: 0px !important;
  border-top-width: 0px !important;
  border-right-width: 0px !important;
  border-radius: 0px !important;
  text-align: center !important;
  padding: 8px 8px !important;
  min-height: 31px !important;
  margin: 0px !important;
}

.subnode-header .control-label {
  min-height: 31px;
  font-weight: bold;
}

.subnode-footer {
  text-align: right;
  border-color: $color-gray-light;
  border-style: inset inset inset solid;
  border-width: 2px 1px 0;
  margin-top: -10px;
}

.subnode-footer .ajs-button {
  margin: 2px 2px 0;
}


/* Sub-Node */

.edit-cell, .delete-cell {
    text-align:center !important;
    width:25px;
    height:29px !important;
}

.subnode-header {
    background-color: $color-bg-theme;
    color: $color-fg-theme;
    border-bottom: $panel-border;
}

.subnode-header > button.add {
    float: right;
    margin-right: 3px;
    margin-bottom: 3px;
    margin-top: 5px;
}

.subnode-dialog {
    bottom: 0;
    left: 0;
    overflow-x: auto;
    overflow-y: auto;
    right: 0;
    height: auto;
    margin-top: 0px;
}
.subnode-body {
    height: auto;
    overflow: inherit;
    background-color: $color-bg;
    border: 1px solid $border-color;
    border-radius: $panel-border-radius;

    & .tab-pane {
      padding: 0.5rem;
    }

    & .tab-content {
      padding: 0px;
    }

    fieldset.inline-fieldset {
      background: $color-bg-theme;
    }
}
.subnode-footer {
    height: 38px;
    margin: 0px, 15px;
    min-height: 40px;
    vertical-align: bottom;
}

.sub-node-form {
    height: auto;
    padding-left: 0rem !important;
    padding-right: 0rem !important;
}

.sub-node-form > ul.tab-content{
    background-color: $color-bg;
    padding-left: 15px;
    left: 1px;
}

.subnode-header-form {
    background-color: $color-gray-lighter;
    padding: 7px;
    border-bottom: $panel-border;
}

.subnode-header-form button.add {
    float: right;
    margin-right: 0px;
}

.subnode-error .help-block {
    color: $color-danger;
}

table.backgrid {
  overflow: auto;
}

.backgrid tbody {
  & td.edit-cell.editor {
    background-color: $color-gray-light !important;
    border-bottom-color: $color-gray-light !important;
    outline: none !important;
  }

  & td.editor {
    background-color: $color-bg-theme !important;
  }

  & td.edit-cell.editor:focus {
    outline: $input-focus-border-color auto 5px !important;
  }

  tr.editor-row  {
    background-color: $color-gray-light !important;
    & > td {
      padding: 15px !important;
      background-color: $color-gray-light !important;
      border-top: none !important;
      border-bottom-color: $color-gray-light !important;
    }
  }
}

table tr th button {
  font-weight: bold;
}
