// stylelint-disable comment-whitespace-inside, no-duplicate-selectors
@import "../common";

/*
* jQuery UI CSS Framework
* Copyright (c) 2010 AUTHORS.txt (http://jqueryui.com/about)
* Dual licensed under the MIT (MIT-LICENSE.txt) and GPL (GPL-LICENSE.txt) licenses.
*/

/* Layout helpers
----------------------------------*/

.ui-helper-hidden {
  display: none;
}

.ui-helper-hidden-accessible {
  position: absolute;
  left: -99999999px;
}

.ui-helper-reset {
  margin: 0;
  padding: 0;
  list-style: none;
  border: 0;
  outline: 0;
  font-size: 100%;
  text-decoration: none;
}

.ui-helper-clearfix {
  display: inline-block;

  &::after {
    content: ".";
    display: block;
    visibility: hidden;
    height: 0;
    clear: both;
  }
}

/* required comment for clearfix to work in Opera \*/

* html .ui-helper-clearfix {
  height: 1%;
}

.ui-helper-clearfix {
  display: block;
}

/* end clearfix */

.ui-helper-zfix {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
}

/* Interaction Cues
----------------------------------*/

.ui-state-disabled {
  cursor: default !important; // stylelint-disable-line declaration-no-important
}

/* Icons
----------------------------------*/

/* states and images */

.ui-icon {
  display: block;
  overflow: hidden;
  background-repeat: no-repeat;
  text-indent: -9999px;
}

/* Misc visuals
----------------------------------*/

/* Overlays */

.ui-widget-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

/* Component containers
----------------------------------*/

.ui-widget {
  &,
  input,
  select,
  textarea,
  button {
    font-family: inherit;
    font-size: inherit;
  }
}

.ui-widget-content {
  border: 1px solid $panel-border;
  background: $body-bg;
  color: $text-color;

  a {
    color: $text-color;
  }
}

.ui-widget-header {
  border: 0 none;
  background: $header-bg;
  color: $header-text;
  font-weight: $font-weight-bold;

  a {
    color: $header-text;
  }

  a,
  button {
    &.ui-state-default {
      border-color: $header-bg;
      background: $header-bg;
      color: $header-text;
    }

    &.ui-state-hover,
    &.ui-state-focus {
      border-color: darken($header-bg, 12%);
      background: darken($header-bg, 10%);
    }

    .ui-icon {
      background-image: url("../images/ui-icons_ffffff_256x240.png");
    }
  }
}

/* Interaction states
----------------------------------*/

.ui-state-default,
.ui-widget-content .ui-state-default,
.ui-widget-header .ui-state-default {
  border: 1px solid $component-border;
  background: $component-bg;
  box-shadow: none;
  color: $component-color;
  font-weight: $font-weight-normal;
}

.ui-state-default a,
.ui-state-default a:link,
.ui-state-default a:visited {
  color: $component-color;
  text-decoration: none;
}

.ui-state-hover,
.ui-widget-content .ui-state-hover,
.ui-widget-header .ui-state-hover,
.ui-state-focus,
.ui-widget-content .ui-state-focus,
.ui-widget-header .ui-state-focus {
  border: 1px solid $component-active-border;
  background: $component-active-bg;
  color: $component-active-color;
  font-weight: $font-weight-normal;

  .ui-icon {
    background-image: url("../images/ui-icons_ffffff_256x240.png");
  }
}

.ui-state-hover a,
.ui-state-hover a:hover,
.ui-state-hover a:link,
.ui-state-hover a:visited,
.ui-state-focus a,
.ui-state-focus a:hover,
.ui-state-focus a:link,
.ui-state-focus a:visited {
  color: $component-active-color;
  text-decoration: none;
}

.ui-state-active,
.ui-widget-content .ui-state-active,
.ui-widget-header .ui-state-active {
  border: 1px solid $component-active-border;
  background: $component-active-bg;
  color: $component-active-color;
  font-weight: $font-weight-normal;
}

.ui-state-active a,
.ui-state-active a:link,
.ui-state-active a:visited {
  color: $component-active-color;
  text-decoration: none;
}

.ui-sortable-helper {
  @include nice-shadow(4);
}


/* Interaction Cues
----------------------------------*/

.ui-state-highlight,
.ui-widget-content .ui-state-highlight {
  border: 1px solid shade($yellow, 600);
  background: shade($yellow, 200);
  color: shade($yellow, 800);

  a {
    color: shade($yellow, 800);
  }
}


.ui-state-error,
.ui-widget-content .ui-state-error {
  border: 1px solid $red;
  background: shade($red, 50);
  color: $red;

  a {
    color: $red;
  }
}

.ui-priority-primary,
.ui-widget-content .ui-priority-primary {
  font-weight: $font-weight-bold;
}

.ui-priority-secondary,
.ui-widget-content .ui-priority-secondary {
  opacity: .7;
  font-weight: $font-weight-normal;
}

.ui-state-disabled,
.ui-widget-content .ui-state-disabled {
  opacity: .35;
  background-image: none;
}

/* Icons
----------------------------------*/

/* states and images */

.ui-icon {
  width: 16px;
  height: 16px;
  background-image: url("../images/ui-icons_222222_256x240.png");
}

.ui-widget-content .ui-icon,
.ui-widget-header .ui-icon {
  background-image: url("../images/ui-icons_222222_256x240.png");
}

.ui-state-default .ui-icon {
  background-image: url("../images/ui-icons_888888_256x240.png");
}

.ui-state-hover .ui-icon,
.ui-state-focus .ui-icon,
.ui-state-active .ui-icon {
  background-image: url("../images/ui-icons_454545_256x240.png");
}

.ui-state-highlight .ui-icon {
  background-image: url("../images/ui-icons_2e83ff_256x240.png");
}

.ui-state-error .ui-icon,
.ui-state-error-text .ui-icon {
  background-image: url("../images/ui-icons_cd0a0a_256x240.png");
}

/* positioning */

.ui-icon-carat-1-n              { background-position: 0 0; }
.ui-icon-carat-1-ne             { background-position: -16px 0; }
.ui-icon-carat-1-e              { background-position: -32px 0; }
.ui-icon-carat-1-se             { background-position: -48px 0; }
.ui-icon-carat-1-s              { background-position: -64px 0; }
.ui-icon-carat-1-sw             { background-position: -80px 0; }
.ui-icon-carat-1-w              { background-position: -96px 0; }
.ui-icon-carat-1-nw             { background-position: -112px 0; }
.ui-icon-carat-2-n-s            { background-position: -128px 0; }
.ui-icon-carat-2-e-w            { background-position: -144px 0; }
.ui-icon-triangle-1-n           { background-position: 0 -16px; }
.ui-icon-triangle-1-ne          { background-position: -16px -16px; }
.ui-icon-triangle-1-e           { background-position: -32px -16px; }
.ui-icon-triangle-1-se          { background-position: -48px -16px; }
.ui-icon-triangle-1-s           { background-position: -64px -16px; }
.ui-icon-triangle-1-sw          { background-position: -80px -16px; }
.ui-icon-triangle-1-w           { background-position: -96px -16px; }
.ui-icon-triangle-1-nw          { background-position: -112px -16px; }
.ui-icon-triangle-2-n-s         { background-position: -128px -16px; }
.ui-icon-triangle-2-e-w         { background-position: -144px -16px; }
.ui-icon-arrow-1-n              { background-position: 0 -32px; }
.ui-icon-arrow-1-ne             { background-position: -16px -32px; }
.ui-icon-arrow-1-e              { background-position: -32px -32px; }
.ui-icon-arrow-1-se             { background-position: -48px -32px; }
.ui-icon-arrow-1-s              { background-position: -64px -32px; }
.ui-icon-arrow-1-sw             { background-position: -80px -32px; }
.ui-icon-arrow-1-w              { background-position: -96px -32px; }
.ui-icon-arrow-1-nw             { background-position: -112px -32px; }
.ui-icon-arrow-2-n-s            { background-position: -128px -32px; }
.ui-icon-arrow-2-ne-sw          { background-position: -144px -32px; }
.ui-icon-arrow-2-e-w            { background-position: -160px -32px; }
.ui-icon-arrow-2-se-nw          { background-position: -176px -32px; }
.ui-icon-arrowstop-1-n          { background-position: -192px -32px; }
.ui-icon-arrowstop-1-e          { background-position: -208px -32px; }
.ui-icon-arrowstop-1-s          { background-position: -224px -32px; }
.ui-icon-arrowstop-1-w          { background-position: -240px -32px; }
.ui-icon-arrowthick-1-n         { background-position: 0 -48px; }
.ui-icon-arrowthick-1-ne        { background-position: -16px -48px; }
.ui-icon-arrowthick-1-e         { background-position: -32px -48px; }
.ui-icon-arrowthick-1-se        { background-position: -48px -48px; }
.ui-icon-arrowthick-1-s         { background-position: -64px -48px; }
.ui-icon-arrowthick-1-sw        { background-position: -80px -48px; }
.ui-icon-arrowthick-1-w         { background-position: -96px -48px; }
.ui-icon-arrowthick-1-nw        { background-position: -112px -48px; }
.ui-icon-arrowthick-2-n-s       { background-position: -128px -48px; }
.ui-icon-arrowthick-2-ne-sw     { background-position: -144px -48px; }
.ui-icon-arrowthick-2-e-w       { background-position: -160px -48px; }
.ui-icon-arrowthick-2-se-nw     { background-position: -176px -48px; }
.ui-icon-arrowthickstop-1-n     { background-position: -192px -48px; }
.ui-icon-arrowthickstop-1-e     { background-position: -208px -48px; }
.ui-icon-arrowthickstop-1-s     { background-position: -224px -48px; }
.ui-icon-arrowthickstop-1-w     { background-position: -240px -48px; }
.ui-icon-arrowreturnthick-1-w   { background-position: 0 -64px; }
.ui-icon-arrowreturnthick-1-n   { background-position: -16px -64px; }
.ui-icon-arrowreturnthick-1-e   { background-position: -32px -64px; }
.ui-icon-arrowreturnthick-1-s   { background-position: -48px -64px; }
.ui-icon-arrowreturn-1-w        { background-position: -64px -64px; }
.ui-icon-arrowreturn-1-n        { background-position: -80px -64px; }
.ui-icon-arrowreturn-1-e        { background-position: -96px -64px; }
.ui-icon-arrowreturn-1-s        { background-position: -112px -64px; }
.ui-icon-arrowrefresh-1-w       { background-position: -128px -64px; }
.ui-icon-arrowrefresh-1-n       { background-position: -144px -64px; }
.ui-icon-arrowrefresh-1-e       { background-position: -160px -64px; }
.ui-icon-arrowrefresh-1-s       { background-position: -176px -64px; }
.ui-icon-arrow-4                { background-position: 0 -80px; }
.ui-icon-arrow-4-diag           { background-position: -16px -80px; }
.ui-icon-extlink                { background-position: -32px -80px; }
.ui-icon-newwin                 { background-position: -48px -80px; }
.ui-icon-refresh                { background-position: -64px -80px; }
.ui-icon-shuffle                { background-position: -80px -80px; }
.ui-icon-transfer-e-w           { background-position: -96px -80px; }
.ui-icon-transferthick-e-w      { background-position: -112px -80px; }
.ui-icon-folder-collapsed       { background-position: 0 -96px; }
.ui-icon-folder-open            { background-position: -16px -96px; }
.ui-icon-document               { background-position: -32px -96px; }
.ui-icon-document-b             { background-position: -48px -96px; }
.ui-icon-note                   { background-position: -64px -96px; }
.ui-icon-mail-closed            { background-position: -80px -96px; }
.ui-icon-mail-open              { background-position: -96px -96px; }
.ui-icon-suitcase               { background-position: -112px -96px; }
.ui-icon-comment                { background-position: -128px -96px; }
.ui-icon-person                 { background-position: -144px -96px; }
.ui-icon-print                  { background-position: -160px -96px; }
.ui-icon-trash                  { background-position: -176px -96px; }
.ui-icon-locked                 { background-position: -192px -96px; }
.ui-icon-unlocked               { background-position: -208px -96px; }
.ui-icon-bookmark               { background-position: -224px -96px; }
.ui-icon-tag                    { background-position: -240px -96px; }
.ui-icon-home                   { background-position: 0 -112px; }
.ui-icon-flag                   { background-position: -16px -112px; }
.ui-icon-calendar               { background-position: -32px -112px; }
.ui-icon-cart                   { background-position: -48px -112px; }
.ui-icon-pencil                 { background-position: -64px -112px; }
.ui-icon-clock                  { background-position: -80px -112px; }
.ui-icon-disk                   { background-position: -96px -112px; }
.ui-icon-calculator             { background-position: -112px -112px; }
.ui-icon-zoomin                 { background-position: -128px -112px; }
.ui-icon-zoomout                { background-position: -144px -112px; }
.ui-icon-search                 { background-position: -160px -112px; }
.ui-icon-wrench                 { background-position: -176px -112px; }
.ui-icon-gear                   { background-position: -192px -112px; }
.ui-icon-heart                  { background-position: -208px -112px; }
.ui-icon-star                   { background-position: -224px -112px; }
.ui-icon-link                   { background-position: -240px -112px; }
.ui-icon-cancel                 { background-position: 0 -128px; }
.ui-icon-plus                   { background-position: -16px -128px; }
.ui-icon-plusthick              { background-position: -32px -128px; }
.ui-icon-minus                  { background-position: -48px -128px; }
.ui-icon-minusthick             { background-position: -64px -128px; }
.ui-icon-close                  { background-position: -80px -128px; }
.ui-icon-closethick             { background-position: -96px -128px; }
.ui-icon-key                    { background-position: -112px -128px; }
.ui-icon-lightbulb              { background-position: -128px -128px; }
.ui-icon-scissors               { background-position: -144px -128px; }
.ui-icon-clipboard              { background-position: -160px -128px; }
.ui-icon-copy                   { background-position: -176px -128px; }
.ui-icon-contact                { background-position: -192px -128px; }
.ui-icon-image                  { background-position: -208px -128px; }
.ui-icon-video                  { background-position: -224px -128px; }
.ui-icon-script                 { background-position: -240px -128px; }
.ui-icon-alert                  { background-position: 0 -144px; }
.ui-icon-info                   { background-position: -16px -144px; }
.ui-icon-notice                 { background-position: -32px -144px; }
.ui-icon-help                   { background-position: -48px -144px; }
.ui-icon-check                  { background-position: -64px -144px; }
.ui-icon-bullet                 { background-position: -80px -144px; }
.ui-icon-radio-off              { background-position: -96px -144px; }
.ui-icon-radio-on               { background-position: -112px -144px; }
.ui-icon-pin-w                  { background-position: -128px -144px; }
.ui-icon-pin-s                  { background-position: -144px -144px; }
.ui-icon-play                   { background-position: 0 -160px; }
.ui-icon-pause                  { background-position: -16px -160px; }
.ui-icon-seek-next              { background-position: -32px -160px; }
.ui-icon-seek-prev              { background-position: -48px -160px; }
.ui-icon-seek-end               { background-position: -64px -160px; }
.ui-icon-seek-start             { background-position: -80px -160px; }
.ui-icon-seek-first             { background-position: -80px -160px; }
.ui-icon-stop                   { background-position: -96px -160px; }
.ui-icon-eject                  { background-position: -112px -160px; }
.ui-icon-volume-off             { background-position: -128px -160px; }
.ui-icon-volume-on              { background-position: -144px -160px; }
.ui-icon-power                  { background-position: 0 -176px; }
.ui-icon-signal-diag            { background-position: -16px -176px; }
.ui-icon-signal                 { background-position: -32px -176px; }
.ui-icon-battery-0              { background-position: -48px -176px; }
.ui-icon-battery-1              { background-position: -64px -176px; }
.ui-icon-battery-2              { background-position: -80px -176px; }
.ui-icon-battery-3              { background-position: -96px -176px; }
.ui-icon-circle-plus            { background-position: 0 -192px; }
.ui-icon-circle-minus           { background-position: -16px -192px; }
.ui-icon-circle-close           { background-position: -32px -192px; }
.ui-icon-circle-triangle-e      { background-position: -48px -192px; }
.ui-icon-circle-triangle-s      { background-position: -64px -192px; }
.ui-icon-circle-triangle-w      { background-position: -80px -192px; }
.ui-icon-circle-triangle-n      { background-position: -96px -192px; }
.ui-icon-circle-arrow-e         { background-position: -112px -192px; }
.ui-icon-circle-arrow-s         { background-position: -128px -192px; }
.ui-icon-circle-arrow-w         { background-position: -144px -192px; }
.ui-icon-circle-arrow-n         { background-position: -160px -192px; }
.ui-icon-circle-zoomin          { background-position: -176px -192px; }
.ui-icon-circle-zoomout         { background-position: -192px -192px; }
.ui-icon-circle-check           { background-position: -208px -192px; }
.ui-icon-circlesmall-plus       { background-position: 0 -208px; }
.ui-icon-circlesmall-minus      { background-position: -16px -208px; }
.ui-icon-circlesmall-close      { background-position: -32px -208px; }
.ui-icon-squaresmall-plus       { background-position: -48px -208px; }
.ui-icon-squaresmall-minus      { background-position: -64px -208px; }
.ui-icon-squaresmall-close      { background-position: -80px -208px; }
.ui-icon-grip-dotted-vertical   { background-position: 0 -224px; }
.ui-icon-grip-dotted-horizontal { background-position: -16px -224px; }
.ui-icon-grip-solid-vertical    { background-position: -32px -224px; }
.ui-icon-grip-solid-horizontal  { background-position: -48px -224px; }
.ui-icon-gripsmall-diagonal-se  { background-position: -64px -224px; }
.ui-icon-grip-diagonal-se       { background-position: -80px -224px; }

/* Misc visuals
----------------------------------*/

/* Corner radius */

.ui-corner-tl {
  border-top-left-radius: $border-radius-base;
}

.ui-corner-tr {
  border-top-right-radius: $border-radius-base;
}

.ui-corner-bl {
  border-bottom-left-radius: $border-radius-base;
}

.ui-corner-br {
  border-bottom-right-radius: $border-radius-base;
}

.ui-corner-top {
  border-top-left-radius: $border-radius-base;
  border-top-right-radius: $border-radius-base;
}

.ui-corner-bottom {
  border-bottom-left-radius: $border-radius-base;
  border-bottom-right-radius: $border-radius-base;
}

.ui-corner-right {
  border-top-right-radius: $border-radius-base;
  border-bottom-right-radius: $border-radius-base;
}

.ui-corner-left {
  border-top-left-radius: $border-radius-base;
  border-bottom-left-radius: $border-radius-base;
}

.ui-corner-all {
  border-radius: $border-radius-base;
}

/* Overlays */

.ui-widget-overlay {
  opacity: .3;
  background: $black;
}

.ui-widget-shadow {
  margin: -8px 0 0 -8px;
  padding: 8px;
  border-radius: 8px;
  opacity: .3;
  background: $gray-600;
}

/* Resizable
----------------------------------*/

.ui-resizable {
  position: relative;
}

.ui-resizable-handle {
  display: block;
  position: absolute;
  z-index: 9999;
  font-size: .1px;
}

.ui-resizable-disabled .ui-resizable-handle,
.ui-resizable-autohide .ui-resizable-handle {
  display: none;
}

.ui-resizable-n {
  top: -5px;
  left: 0;
  width: 100%;
  height: 7px;
  cursor: n-resize;
}

.ui-resizable-s {
  bottom: -5px;
  left: 0;
  width: 100%;
  height: 7px;
  cursor: s-resize;
}

.ui-resizable-e {
  top: 0;
  right: -5px;
  width: 7px;
  height: 100%;
  cursor: e-resize;
}

.ui-resizable-w {
  top: 0;
  left: -5px;
  width: 7px;
  height: 100%;
  cursor: w-resize;
}

.ui-resizable-se {
  right: 1px;
  bottom: 1px;
  width: 12px;
  height: 12px;
  cursor: se-resize;
}

.ui-resizable-sw {
  bottom: -5px;
  left: -5px;
  width: 9px;
  height: 9px;
  cursor: sw-resize;
}

.ui-resizable-nw {
  top: -5px;
  left: -5px;
  width: 9px;
  height: 9px;
  cursor: nw-resize;
}

.ui-resizable-ne {
  top: -5px;
  right: -5px;
  width: 9px;
  height: 9px;
  cursor: ne-resize;
}

/* Accordion
----------------------------------*/

.ui-accordion {
  .ui-accordion-header {
    position: relative;
    margin-top: 1px;
    zoom: 1;
    cursor: pointer;
  }

  .ui-accordion-li-fix {
    display: inline;
  }

  .ui-accordion-header-active {
    border-bottom: 0 !important; // stylelint-disable-line declaration-no-important
  }

  .ui-accordion-header a {
    display: block;
    padding: .5em .5em .5em .7em;
    font-size: 1em;
  }
}

.ui-accordion-icons .ui-accordion-header a {
  padding-left: 2.2em;
}

.ui-accordion {
  .ui-accordion-header .ui-icon {
    position: absolute;
    top: 50%;
    left: .5em;
    margin-top: -8px;
  }

  .ui-accordion-content {
    display: none;
    position: relative;
    top: 1px;
    margin-top: -2px;
    margin-bottom: 2px;
    padding: 1em 2.2em;
    overflow: auto;
    zoom: 1;
    border-top: 0;
  }

  .ui-accordion-content-active {
    display: block;
  }
}

/* Autocomplete
----------------------------------*/

.ui-autocomplete {
  position: absolute;
  cursor: default;
}

.ui-autocomplete-loading {
  background: $body-bg url("../images/indicator.gif") right center no-repeat;
}

/* workarounds */

* html .ui-autocomplete {
  width: 1px;
}

/* without this, the menu expands to 100% in IE6 */

/* Menu
----------------------------------*/

.ui-menu {
  @include nice-shadow(2);
  display: block;
  margin: 0;
  padding: 2px;
  list-style: none;

  .ui-menu {
    margin-top: -3px;
  }

  .ui-menu-item {
    width: 100%;
    margin: 0;
    padding: 0;

    a {
      display: block;
      padding: .2em .4em;
      line-height: 1.5;
      text-decoration: none;

      &.ui-state-hover,
      &.ui-state-active {
        margin: -1px;
      }
    }
  }
}

/* Button
----------------------------------*/

.ui-button {
  display: inline-block;
  position: relative;
  margin-right: .1em;
  padding: 0;
  overflow: visible;
  zoom: 1;
  text-align: center;
  text-decoration: none !important; // stylelint-disable-line declaration-no-important
  cursor: pointer;
}

/* the overflow property removes extra width in IE */

.ui-button-icon-only {
  width: 2.2em;
}

/* to make room for the icon, a width needs to be set here */

button.ui-button-icon-only {
  width: 2.4em;
}

/* button elements seem to need a little more width */

.ui-button-icons-only {
  width: 3em;
}

button.ui-button-icons-only {
  width: 3.2em;
}

/*button text element */

.ui-button .ui-button-text {
  display: block;
  line-height: 1.4;
}

.ui-button-text-only .ui-button-text {
  padding: .4em 1em;
}

.ui-button-icon-only .ui-button-text,
.ui-button-icons-only .ui-button-text {
  padding: .4em;
  text-indent: -99999px;
}

.ui-button-text-icon .ui-button-text {
  padding: .4em 1em .4em 1.8em;
}

.ui-button-text-icons .ui-button-text {
  padding: .4em 1em .4em 1.8em;
  padding-right: 1.8em;
}

/* no icon support for input elements, provide padding by default */

input.ui-button {
  padding: .4em 1em;
}

/*button icon element(s) */

.ui-button-icon-only .ui-icon,
.ui-button-text-icon .ui-icon,
.ui-button-text-icons .ui-icon,
.ui-button-icons-only .ui-icon {
  position: absolute;
  top: 50%;
  margin-top: -8px;
}

.ui-button-icon-only .ui-icon {
  left: 50%;
  margin-left: -8px;
}

.ui-button-text-icon .ui-icon-primary,
.ui-button-text-icons .ui-icon-primary,
.ui-button-icons-only .ui-icon-primary {
  left: .5em;
}

.ui-button-text-icons .ui-button-icon-secondary,
.ui-button-icons-only .ui-button-icon-secondary {
  right: .5em;
}

/*button sets*/

.ui-button-set {
  margin-right: 7px;

  .ui-button {
    margin-right: -.3em;
    margin-left: 0;
  }
}

/* workarounds */

button.ui-button::-moz-focus-inner {
  padding: 0;
  border: 0 none;
}

/* reset extra padding in Firefox */

/* Dialog
----------------------------------*/

.ui-dialog {
  position: absolute;
  width: 300px;
  padding: .2em;
  overflow: hidden;

  .ui-dialog-titlebar {
    position: relative;
    padding: .5em 1em .3em;
  }

  .ui-dialog-title {
    margin: .1em 16px .2em 0;
    float: left;
  }

  .ui-dialog-titlebar-close {
    position: absolute;
    top: 50%;
    right: .3em;
    width: 19px;
    height: 18px;
    margin: -10px 0 0;
    padding: 1px;

    span {
      display: block;
      margin: 1px;
    }

    &:hover,
    &:focus {
      padding: 0;
    }
  }

  .ui-dialog-content {
    position: relative;
    padding: .5em 1em;
    overflow: auto;
    zoom: 1;
    border: 0 none;
    background: none;
  }

  .ui-dialog-buttonpane {
    margin: .5em 0 0;
    padding: .3em 1em .5em .4em;
    border-width: 1px 0 0;
    background-image: none;
    text-align: left;

    button {
      width: auto;
      margin: .5em .4em .5em 0;
      padding: .2em .6em .3em;
      float: right;
      overflow: visible;
      line-height: 1.4em;
      cursor: pointer;
    }
  }

  .ui-resizable-se {
    right: 3px;
    bottom: 3px;
    width: 14px;
    height: 14px;
  }
}

.ui-draggable .ui-dialog-titlebar {
  cursor: move;
}

/* Slider
----------------------------------*/

.ui-slider {
  position: relative;
  text-align: left;

  .ui-slider-handle {
    position: absolute;
    z-index: 2;
    width: 1.2em;
    height: 1.2em;
    cursor: default;
  }

  .ui-slider-range {
    display: block;
    position: absolute;
    z-index: 1;
    border: 0 none;
    background-position: 0 0;
    font-size: .7em;
  }
}

.ui-slider-horizontal {
  height: .8em;

  .ui-slider-handle {
    top: -.3em;
    margin-left: -.6em;
  }

  .ui-slider-range {
    top: 0;
    height: 100%;
  }

  .ui-slider-range-min {
    left: 0;
  }

  .ui-slider-range-max {
    right: 0;
  }
}

.ui-slider-vertical {
  width: .8em;
  height: 100px;

  .ui-slider-handle {
    left: -.3em;
    margin-bottom: -.6em;
    margin-left: 0;
  }

  .ui-slider-range {
    left: 0;
    width: 100%;
  }

  .ui-slider-range-min {
    bottom: 0;
  }

  .ui-slider-range-max {
    top: 0;
  }
}

/* Tabs
----------------------------------*/

.ui-tabs {
  position: relative;
  padding: .2em;
  zoom: 1;

  .ui-tabs-nav {
    margin: 0;
    padding: .2em .2em 0;

    li {
      position: relative;
      top: 1px;
      margin: 0 .2em 1px 0;
      padding: 0;
      float: left;
      list-style: none;
      border-bottom: 0 !important; // stylelint-disable-line declaration-no-important
      white-space: nowrap;

      a {
        padding: .5em 1em;
        float: left;
        text-decoration: none;
      }

      &.ui-tabs-selected {
        margin-bottom: 0;
        padding-bottom: 1px;

        a {
          cursor: text;
        }
      }

      &.ui-state-disabled a,
      &.ui-state-processing a {
        cursor: text;
      }

      a {
        cursor: pointer;
      }
    }
  }

  &.ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-selected a {
    cursor: pointer;
  }

  .ui-tabs-panel {
    display: block;
    padding: 1em 1.4em;
    border: 0 none;
    background: none;
  }

  .ui-tabs-hide {
    display: none !important; // stylelint-disable-line declaration-no-important
  }
}

/* position: relative prevents IE scroll bug (element with position: relative inside container with overflow: auto appear as "fixed") */

/* first selector in group seems obsolete, but required to overcome bug in Opera applying cursor: text overall if defined elsewhere... */

/* Datepicker
----------------------------------*/

.ui-datepicker {
  @include nice-shadow(3);
  width: 16em;
  padding: .3em .6em .6em;
  border: 0 none;
  background: $body-bg;
  color: $text-color;
  font-size: $font-size-base;

  .ui-datepicker-header {
    position: relative;
    margin: 0 -.3em;
    padding: .3em;
    border: 0 none;
    background: $header-bg;
    color: $header-text;
    font-weight: $font-weight-bold;
  }

  .ui-state-default {
    border: 1px solid $body-bg;
    background: $body-bg;
    box-shadow: none;
    color: $component-color;
    font-weight: $font-weight-normal;

    a,
    a:link,
    a:visited {
      color: $component-color;
      text-decoration: none;
    }
  }

  .ui-state-hover,
  .ui-state-focus {
    border: 1px solid $component-active-border;
    background: $component-active-bg;
    color: $component-active-color;
    font-weight: $font-weight-normal;
  }

  .ui-datepicker-prev,
  .ui-datepicker-next {
    position: absolute;
    top: .3em;
    width: 1.8em;
    height: 1.8em;
    border: 0 none;
    background: transparent;

    .ui-icon {
      background-image: url("/stylesheets/jquery/images/ui-icons_ffffff_256x240.png");
    }

    &.ui-state-hover {
      border-color: darken($header-bg, 12%);
      background: darken($header-bg, 10%);
    }
  }

  .ui-datepicker-prev {
    left: .3em;
  }

  .ui-datepicker-next {
    right: .3em;
  }

  .ui-datepicker-prev span,
  .ui-datepicker-next span {
    display: block;
    position: absolute;
    top: 50%;
    left: 50%;
    margin-top: -8px;
    margin-left: -8px;
  }

  .ui-datepicker-title {
    margin: 0 (1.8em + .3em);
    line-height: 1.8em;
    text-align: center;

    select {
      width: 49%;
      height: 1.8em;
      margin: 0;
      font-size: 1em;
    }
  }

  select {
    &.ui-datepicker-month-year {
      width: 100%;
    }

    &.ui-datepicker-month,
    &.ui-datepicker-year {
      width: 49%;
    }

    &.ui-datepicker-year {
      margin-left: 1%;
    }
  }

  table {
    width: 100%;
    margin: 0 0 .4em;
    border-collapse: collapse;
    font-size: .9em;
  }

  th {
    padding: .7em .3em;
    border: 0 none;
    font-weight: $font-weight-bold;
    text-align: center;
  }

  td {
    padding: 1px;
    border: 0 none;

    span,
    a {
      display: block;
      padding: .2em .4em .2em 0;
      border-radius: $border-radius-base;
      text-align: right;
      text-decoration: none;
    }
  }

  .ui-datepicker-calendar {
    margin: 0;
    table-layout: fixed;

    td {
      text-align: right;

      &.ui-datepicker-week-col {
        padding-right: $table-condensed-cell-padding;
      }
    }
  }

  .ui-datepicker-buttonpane {
    margin: .7em 0 0;
    padding: 0 .2em;
    border-right: 0;
    border-bottom: 0;
    border-left: 0;
    background-image: none;

    button {
      width: auto;
      margin: .5em .2em .4em;
      padding: .2em .6em .3em;
      float: right;
      overflow: visible;
      cursor: pointer;

      &.ui-datepicker-current {
        float: left;
      }
    }
  }

  .ui-datepicker-today {
    .ui-state-highlight {
      border-color: $component-active-border;
      background: $component-bg;
      color: $component-color;
    }

    .ui-state-hover {
      background: $component-active-bg;
      color: $component-active-color;
    }
  }

  .ui-datepicker-current-day {
    .ui-state-active {
      border-color: $highlight-border;
      background: $highlight-bg;
      color: $highlight-text;
    }
  }

  .ui-datepicker-buttonpane {
    @include clearfix;
    margin: .6em 0 0;
    padding: .6em 0 0;

    button {
      margin: 0;
      padding: $btn-padding-vertical $btn-padding-horizontal;
    }

    .ui-state-default {
      border-color: $component-border;
      background: $component-bg;
    }

    .ui-state-focus,
    .ui-state-hover {
      border-color: $component-active-bg;
      background: $component-active-bg;
      color: $component-active-color;
    }

    .ui-state-active {
      border-color: $highlight-border;
      background: $highlight-bg;
      color: $highlight-text;
    }
  }

  &.ui-datepicker-multi {
    width: auto;
  }
}

/* with multiple calendars */

.ui-datepicker-multi .ui-datepicker-group {
  float: left;

  table {
    width: 95%;
    margin: 0 auto .4em;
  }
}

.ui-datepicker-multi-2 .ui-datepicker-group {
  width: 50%;
}

.ui-datepicker-multi-3 .ui-datepicker-group {
  width: 33.3%;
}

.ui-datepicker-multi-4 .ui-datepicker-group {
  width: 25%;
}

.ui-datepicker-multi {
  .ui-datepicker-group-last .ui-datepicker-header,
  .ui-datepicker-group-middle .ui-datepicker-header {
    border-left-width: 0;
  }

  .ui-datepicker-buttonpane {
    clear: left;
  }
}

.ui-datepicker-row-break {
  width: 100%;
  clear: both;
}

/* RTL support */

.ui-datepicker-rtl {
  direction: rtl;

  .ui-datepicker-prev {
    right: .3em;
    left: auto;
  }

  .ui-datepicker-next {
    right: auto;
    left: .3em;
  }

  .ui-datepicker-buttonpane {
    clear: right;

    button {
      float: left;

      &.ui-datepicker-current {
        float: right;
      }
    }
  }

  .ui-datepicker-group {
    float: right;
  }

  .ui-datepicker-group-last .ui-datepicker-header,
  .ui-datepicker-group-middle .ui-datepicker-header {
    border-right-width: 0;
    border-left-width: 1px;
  }
}

/* Progressbar
----------------------------------*/

.ui-progressbar {
  height: 2em;
  text-align: left;

  .ui-progressbar-value {
    height: 100%;
    margin: -1px;
  }
}
