.form-container .clearfix::after {
  content: "";
  display: table;
  clear: both;
}

.form-basic {
  input {
    min-width: 0;
  }

  label {
    min-width: 0;
  }

  select {
    background-image: url(../images/select.png);
    background-position: calc(100% + 5px) -2px;
    background-size: 1190px;
    @media screen and (min-width: $screen-sm-min) {
      // background-size: 450%;
    }
  }
}

#main-content {
  #main article {
    padding: 0 2em 2em;
  }

  .container {
    @media screen and (min-width: $screen-sm-min) {
      width: 1140px;
      max-width: 1140px !important;      
    }
  }
}

.table-controls-wrapper {
    display: flex;
    @media screen and (max-width: $screen-sm-min){
      flex-direction: column;
    }

    label {
        display: block;
        width: 100%;

        &::after {
            content: none;
        }
    }

    .table-control {
      + .table-control {
        margin-left: 1em;
      }

      &.table-search, &.table-filter {
        flex: 1.5;

        @media screen and (max-width: $screen-sm-min){
          margin-left: 0;
        }        
      }

      &.table-datepicker {
        flex: 1;

        @media screen and (max-width: $screen-sm-min){
          margin-left: 0;
        }               
      }
    }

    .table-buttons-wrapper {
      margin: calc(17px * 1.7 + 14px) 0 0.5em 1em;

      .button {
        margin: 0;
      }
    }
}

.table-wrapper {
  @media screen and (max-width: $screen-sm-min) {
    input, select {
      font-size: 16px;
    }
  }

  select {
    background-size: cover;
  }

  .dtr-details li span {
    overflow-wrap: break-word;
    word-wrap: break-word;
  }

  .band {
    margin-top: 0;
    margin-bottom: 0;
    padding-top: 0;
  }

  .dataTables_wrapper.no-footer .dataTables_scrollBody {
    border: none;
  }

  .button {
    display: inline-block;
    padding: 0.3em 0.75em 0.4em;
    font-size: 90%;
  }

  table {
    border-collapse: separate;

    td, th {
      border-width: 0 0 1px 1px;
      border-color: rgba(0, 0, 0, 0.1);
      line-height: 1.4;
    }
  }

  table.dataTable {
    td, th {
      border-width: 0 0 1px 1px;
      border-color: rgba(0, 0, 0, 0.1);
      line-height: 1.4;
    }

    tbody th {
      font-weight: normal;
    }

    &.no-footer {
      border: none;
    }

    &.DTFC_Cloned {
      td, th {
        // border-right-width: 1px;
        vertical-align: middle;
        text-align: left;

        &.select-column {
          text-align: center;
        }
      }
    }

    .name-wrapper {
      width: 100%;
    }

    .name {
      float: left;
      max-width: 70%;
    }

    .button {
      float: right;
      margin: 0 0 0 0.5em;
      font-weight: normal;
    }

    thead {
      .sorting, .sorting_asc, .sorting_desc {
        background-size: 1em 1em;
        background-position: calc(100% - 0.5em) 50%;
        padding-right: 1.75em;
      }

      .sorting {
        background-image: url('../images/sort-both.svg');
      }

      .sorting_asc {
        background-image: url('../images/sort-asc.svg');
      }

      .sorting_desc {
        background-image: url('../images/sort-desc.svg');
      }

      th {
        vertical-align: middle;
        border-color: #d0d0d0;
        background-color: #ededed;
      }

      tr.groupings th {
        background-color: #DDDDDD;
        border-color: #aaaaaa;
        border-width: 1px 0 1px 1px;

        &:last-child {
          border-right-width: 1px;
        }
      }
    }

    tbody tr {
      &.odd {
        background-color: #f9f9f9;

        .sorting_1 {
          background-color: rgba(0, 0, 0, 0.06);
        }
      }

      &.even .sorting_1 {
        background-color: rgba(0, 0, 0, 0.02);
      }

      &:hover, &.hover, &:hover th, &.hover th {
        background-color: #daeac5;
      }

      &:hover td, &.hover td {
        border-color: #abd079;
      }
    }

    tr.selected {
      td, th {
        background-color: saturate(lighten($cwd_blue, 50), 50);
      }

      &.odd {
        td, th {
          background-color: saturate(lighten($cwd_blue, 45), 50);
        }
        
        .sorting_1 {
          td, th {
            background-color: saturate(lighten($cwd_blue, 40), 50);  
          }
        }
      }   

      &.even {
        td, th {
          background-color: saturate(lighten($cwd_blue, 50), 50);
        }
        
        .sorting_1 {
          td, th {
            background-color: saturate(lighten($cwd_blue, 45), 50);  
          }
        }
      }            
    }

    tr.selected.hover, tr.odd.selected.hover, tr.even.selected.hover {
      td, th {
        background-color: saturate(lighten($cwd_blue, 35), 50);
        border-color: saturate(lighten($cwd_blue, 25), 50)
      }
    }    
  }

  .table-buttons-wrapper {
    
    .button {
        border-radius: 0;
        margin-top: 0;
        margin-bottom: 0;
        padding: 0.65em 1em 0.7em;
      }
  }

  #table-search {
    min-width: 0;
  }

  
  .table-meta {
    display: flex;
    flex-wrap: wrap;
    margin: 1em 0;
    justify-content: space-between;
    align-items: center;

    .dataTables_length, .dataTables_paginate {
      flex: 1 0 50%;
    }

    .dataTables_length {
      display: flex;
      align-items: center;
    }

    .dataTables_info {
      padding-top: 0;
    }

    .dataTables_paginate .paginate_button {
      &.current:hover {
        color: white;
      }

      &:hover {
        border-color: #333333;
        color: #333333 !important;
        text-decoration: none;
        background: linear-gradient(to top, #dedede 0%, #f9f9f9 100%);
      }
    }

    select {
      background-image: url(../images/select.png);
      background-position: calc(100% + 5px) -2px;
      background-size: 375%;
      font-size: 11px;
      margin: 3px 0;
      -moz-appearance: none;
      -webkit-appearance: none;
      appearance: none;
      -moz-border-radius: 3px;
      -webkit-border-radius: 3px;
      border-radius: 3px;
      padding: 0.3em 25px 0.3em 0.75em;
      border: 1px solid #aaa;
      border-bottom-color: rgb(170, 170, 170);
      border-bottom-color: #666;
      background-position-x: 100%;
      background-position-y: 50%;
      background-size: auto auto;
      -webkit-background-size: 960px;
      -moz-background-size: 960px;
      -o-background-size: 960px;
      background-size: 960px;
    }
  }

  .dt-buttons {
    display: flex;
    justify-content: space-between;
    flex: 1;

    @media screen and (max-width: $screen-sm-min) {
      flex-direction: column;
    }

    .delete-button {
      margin-left: 1em;

      @media screen and (max-width: $screen-sm-min) {
        margin-left: 0;
      }

    }

    .select-deselect-button {
      margin-right: auto;

      @media screen and (max-width: $screen-sm-min) {
        margin-right: 4px;
      }
    }
  }
}

.table-wrapper {
  table {
    @media screen and (min-width: $screen-sm-min) {
      word-wrap: break-word;

      td, th {
        min-width: 200px;
        max-width: 300px;

        &.select-column {
          min-width: 20px;
          max-width: 25px;
          padding: 8px 10px;
          line-height: 0;
        }

        &.first-name, &.last-name {
          min-width: 125px;
          max-width: 175px;
        }
      }
    }
  }

  table.dataTable.display {
    @media screen and (min-width: $screen-sm-min) {
      word-wrap: break-word;

      td, th {
        min-width: 200px;
        max-width: 300px;
      }

      .dataTables_length, .dataTables_paginate {
        flex: 1;
      }
    }

    @media screen and (max-width: $screen-xs-max) {
      thead tr.groupings {
        display: none;
      }
    }

    @media screen and (max-width: $screen-sm-min - 128) {
      .dt-buttons {
        text-align: left;
      }
    }

    .table-meta {
      @media screen and (max-width: $screen-xs-min) {
        flex-direction: column;
      }

      .dataTables_length, .dataTables_paginate {
        @media screen and (max-width: $screen-sm-min) {
          flex: 1;
        }

        @media screen and (max-width: $screen-xs-min) {
          text-align: center;
        }
      }

      .dataTables_info {
        @media screen and (max-width: $screen-sm-min) {
          flex: 1;
          margin-bottom: 1em;
        }
      }
    }
  }
}

.mobile .table-wrapper {
  td {
    &::before {
      content: none;
    }

    display: table-cell;
    border-style: solid;
  }

  tr {
    display: table-row;
    border-bottom: initial;
  }

  th {
    display: table-cell;
  }

  td.mobile-right {
    text-align: right;
  }
}

.table-wrapper {
  ul li {
    background: none;
    margin-bottom: 0;
  }

  table.dataTable.dtr-inline.collapsed tbody > tr {
    > th:first-child {
      padding-left: 35px;
      display: block;
      min-height: 20px;
      text-align: left;

      .name-wrapper {
        display: flex;
        align-items: center;
      }

      .name {
        float: none;
        max-width: initial;
        flex: 1;
        text-align: left;
      }

      .button {
        float: none;
        margin: 0;
      }

      &::before {
        height: 25px;
        width: 25px;
        display: flex;
        justify-content: center;
        align-items: center;
        box-shadow: none;
        border: none;
        line-height: initial;
        border-radius: 50%;
        background-color: #286f94;
        font-family: "FontAwesome";
        content: "\f107";
        top: 6px;
      }
    }

    &.child ul {
      max-width: calc(80vw - 35px);
    }

    &.parent > th:first-child::before {
      background-color: #52a5d0;
      content: "\f106";
    }
  }
}

.table-controls-title {
  display: flex;
  align-items: center;

  @media screen and (max-width: $screen-sm-min) {
    flex-direction: column;
    align-items: flex-start;
  }
}

.table-controls-title h1 {
  margin-bottom: 0;
}

.table-controls {
  display: flex;

  @media screen and (max-width: $screen-sm-min) {
    flex-direction: column;

    label {
      width: 100%;
    }
  }

  .table-controls-actions {
    padding-top: 1em;
  }

  .table-controls-filter {
    label {
      float: none;
    }

    > div {
      display: flex;
      align-items: flex-end;
      padding-left: 0;
    }

    .table-buttons-wrapper {
      margin: 0 0.5em;

      .table-clear {
        display: block;
      }
    }
  }

  .table-controls-search {
    padding-left: 0;
    width: auto;

    label {
      margin-bottom: 11px;
    }
  }

  .table-controls-actions p.as-label {
    margin: 8px 0 !important;

    @media only screen and (max-width: $screen-xs-min) {
      font-weight: 600;
    }
  }
}

.form-container {
  max-width: 1000px;
  margin: 0 auto;

  .clearfix {
    width: 100%;
    float: left;
  }

  form {
    fieldset {
      + fieldset {
        margin-top: 1em;
      }

      legend {
        background-color: #f7f7f7;
      }

      &:nth-of-type(odd) legend {
        background-color: #f2f8fa;
      }
    }

    .form-message {
      color: rgba(0, 0, 0, 0.6);
      font-style: italic;
    }

    .input {
      margin: 0.75em 0;
    }

    .as-label {
      width: 28%;
      float: left;

      &::after {
        content: ":";
      }
    }

    section {
      width: 72%;
      margin-top: 8px;
      float: left;
      clear: none;

      .checkbox {
        float: left;
        width: 100%;
        display: block;

        .input {
          margin: 0.35em 0;
        }
      }

      label {
        clear: none;
        width: calc(100% - 24px);
        padding-left: 0.8em;

        &::after {
          content: none;
        }
      }
      .radios {
        width: auto;
        margin-top: -5px;

        .radio {
          width: auto;
          float: left;

          + .radio {
            margin-left: 1.5em;
          }

          input {
            flex: 1 0 24px;
            margin-right: 0.5em;
          }
        }

        label {
          min-width: 0;
          display: flex;
          align-items: center;
          padding-left: 0;
        }
      }

      .input {
        width: 24px;
      }
    }
  }

  #audience {
    max-height: initial;
  }

  .button {
    display: inline-block;
    position: relative;
    top: 1px;
  }

  .align-right {
    max-width: 100%;
    text-align: right;

    button.success {
      margin-right: 0;
    }
  }
}

.form-container {
  @media screen and (max-width: $screen-sm-min) {
    padding: 1em;
  }

  form .as-label {
    @media screen and (max-width: $screen-sm-min) {
      font-weight: 600;
    }

    @media screen and (max-width: $screen-sm-min - 200) {
      font-weight: 600;
      float: none;
      width: 100%;
    }

    &::after {
      @media screen and (max-width: $screen-sm-min - 200) {
        content: none;
      }
    }
  }
}

button, .button {
  color: black;
  text-decoration: none;
  appearance: none;
  line-height: 1.4;
  margin: 0.5em 1em 0.5em 0;
  padding: 0.5em 1.25em;
  border: 1px solid #999;
  background: #ebebeb;
  box-shadow: inset 0 2px 2px rgba(255, 255, 255, 0.75);
  background: linear-gradient(to bottom, #dedede 0%, #f9f9f9 100%);

  &:hover, &:focus, &:active {
    border-color: #333;
    color: #333333;
    text-decoration: none;
    background: linear-gradient(to top, #dedede 0%, #f9f9f9 100%);
  }

  &:active {
    background: #ddd;
    box-shadow: inset 0 2px 2px rgba(0, 0, 0, 0.25);
  }

  &.warning {
    background: linear-gradient(to top, #fff0ed 0%, #ff9a87 100%);
    color: #ba1d00;
    border-color: currentColor;

    &:hover, &:focus {
      background: linear-gradient(to bottom, #fff0ed 0%, #ff9a87 100%);
      color: #a11900;
    }

    &:active {
      background: linear-gradient(to bottom, #fff0ed 0%, #ff9a87 100%);
      color: #a11900;
      box-shadow: inset 0 2px 2px #ff6f54;
    }
  }

  &.success {
    background: linear-gradient(to top, #dcf1bf 0%, #aede6c 100%);
    color: #456717;
    border-color: currentColor;

    &:hover, &:focus {
      background: linear-gradient(to bottom, #dcf1bf 0%, #aede6c 100%);
      color: #375212;
    }

    &:active {
      background: linear-gradient(to bottom, #dcf1bf 0%, #aede6c 100%);
      color: #375212;
      box-shadow: inset 0 2px 2px #97d542;
    }
  }
}

.as-label {
  color: #286f94;
  font-size: 17px;
  margin-top: 14px;
  font-family: Avenir Next, Proxima Nova, 'proxima-nova', Segoe UI, Helvetica Neue, sans-serif;
}

#main-content {
  padding-top: 0;

  .container {
    // max-width: 960px;
    margin: 0 auto;
    padding: 0 1em;
  }
}

#site-header .container {
  display: block;
}

nav#main-navigation {
  display: table;
  .list-menu {
    padding-left: 0;
    a {
      padding: 0.75em 1.5em 0.65em;
    }
  }
}

#quick-links-list {
  li:first-child {
    margin-left: 0;
  }

  a em {
    font-style: normal;

    @media screen and (max-width: $screen-sm-min) {
      display: none;
    }
  }
}

.decoy {
  display: none !important;
  border: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  width: 0 !important;
  height: 0 !important;
}

.DTFC_LeftBodyLiner {
  overflow-x: hidden;
}

.selected-rows-info {
  margin-left: 1em;
}

.DTFC_ScrollWrapper {
  border-top: 1px solid #d0d0d0;
}

.table-actions {
  margin: 0;
  padding: 0;
  
  @media screen and (max-width: $screen-sm-min) {
    margin-top: 0.5em;
  }

  li {  
    margin: 0;
    padding: 0;
    display: inline-block;
  }
}