#dashboard {
  margin: 0 -8px;

  #dashboardWidgetsArea {
    margin-left: auto;
    margin-right: auto;
  }

  #dashboardWidgetsArea > .col {
    min-height: 100px;
    // Customize Bootstrap gutter between columns
    padding-right: 8px;
    padding-left: 8px;

    >.sortable {
      padding: 5px 0 13px 0;
    }
  }
}

body#standalone {
  background-color: @theme-color-widget-exported-background-base;

  .top_controls {
    z-index: 999;
    background-color: @theme-color-widget-exported-background-base;
  }
  #dashboard {
    margin: -10px -6px 0;
  }
}

.hover {
  border: 2px dashed #E3E3E3;
}

.widgetHover {
  border: 1px solid #aba494;
}

.widget .entityContainer {
  width: 100%;
}

.widget .sparkline {
  margin-left: 5px;
}

// Overriding some dataTable css for better dashboard display
.widget .dataTableWrapper {
  width: 100% !important;
  table * {
    // Because of Bootstrap
    box-sizing: content-box;
  }
}

.ui-confirm {
  display: none;
  color: @theme-color-text-light;
  cursor: default;
  font-size: 12px !important;
  border-radius: 4px;
  padding: 20px 10px;
  min-height: 0 !important;

  textarea {
    background-color: @theme-color-background-contrast;
  }
}

.ui-confirm p {
  margin-top: 16px;
  font-size: 14px;

}
.ui-confirm h2 {
  text-align: center;
  font-weight: bold;
  padding: 0;
}

.ui-dialog .ui-dialog-buttonpane {
  text-align: center;
  border: none;
}

.ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset {
  float: none;
}

.ui-dialog-buttonset input[type=button], .ui-dialog-buttonset button {
  color: #fff !important;
  border: 0 !important;
  font-size: 12px !important;
  padding: 5px 20px !important;
  border-radius: 3px;
  cursor: pointer;
  display: inline-block;
  margin: 0 8px 3px 8px !important;
}

.ui-dialog .ui-button-text {
  padding: 0 !important;
}

#Piwik_Popover_Wrapper {
  position: absolute;
  z-index: 1001;
  inset: 0;
  padding: 15px;
  display: flex;
  flex-direction: column;
  pointer-events: none;
}

.ui-widget-overlay {
  opacity: 0.6;
  background: none #000;
  position: fixed;
  z-index: 1000;

  pointer-events: auto;
}

.ui-dialog {
  z-index: 1001;
}

.ui-dialog--responsive {
  display: flex;
  flex-direction: column;

  position: relative;
  top: 0 !important;
  left: 0 !important;
  margin: auto;
  width: 100%;
  max-width: 100%;
  height: min-content !important;

  pointer-events: auto;

  @media (min-width: 570px) {
    width: min-content;
    min-width: 540px;
  }
}

.menu {
  display: none;
}

.widgetLoading, .widgetLoadingError, .dimensionLoadingError {
  padding: 10px;
  font-size: 10pt;
}

.widgetLoadingError {
  .alert.alert-danger {
    border: 0;
  }
}

.widgetLoadingError, .dimensionLoadingError {
  color: @theme-color-brand;
  text-align: left;
  a {
    color: @theme-color-brand;
    text-decoration: underline;
  }
}

#closeMenuIcon {
  float: right;
  margin: 3px;
  cursor: pointer;
}

.menuClear {
  clear: both;
  height: 30px;
}

.dashboardSettings > span {
  background: url(plugins/Morpheus/images/sort_subtable_desc.png) right center no-repeat;
  padding-right: 20px;
  display: block;
}

.dashboardSettings ul.submenu {
  display: none;
  float: left;
  margin: 0;
  padding: 0;
  list-style: none;
}

.dashboardSettings.expanded ul.submenu {
  display: block;
  list-style: none;
  z-index: 1020; /* More than .jqplot-seriespicker-popover (1010) */
}

.dashboardSettings.expanded .dropdown {
  min-width: 240px;
  padding: 8px;
}

.dashboardSettings ul.submenu > li {
  clear: both;
  list-style: none;
}

#changeDashboardLayout h2 {
  margin-bottom: 20px;
}

#columnPreview {
  clear: both;
  width: 400px;
  margin: auto;
}

#columnPreview > div {
  margin: 5px;
  float: left;
  opacity: 0.4;
  cursor: pointer;
  filter: Alpha(opacity=40);
}

#columnPreview > div:hover, #columnPreview > div.choosen {
  opacity: 1;
  filter: Alpha(opacity=100);
}

#columnPreview div div {
  height: 120px;
  float: left;
}

#columnPreview div div span {
  background-color: #ddd;
  width: 100%;
  height: 100%;
  display: block;
  border: 2px dotted #555;
  margin: 0 1px;
}

#columnPreview div.choosen div span, #columnPreview div:hover div span {
  border-style: solid;
}

#columnPreview .width-100 {
  width: 120px;
}
#columnPreview .width-75 {
  width: 90px;
}
#columnPreview .width-67 {
  width: 80.4px;
}
#columnPreview .width-50 {
  width: 60px;
}
#columnPreview .width-40 {
  width: 48px;
}
#columnPreview .width-33 {
  width: 40px;
}
#columnPreview .width-30 {
  width: 36px;
}
#columnPreview .width-25 {
  width: 30px;
}

/**
 * Layout for widget previews
 */

.widgetpreview-base {
  clear: both;
}

ul.widgetpreview-widgetlist,
ul.widgetpreview-categorylist {
  color: @theme-color-text-light;
  list-style: none;
  font-size: 11px;
  line-height: 20px;
  float: left;
  margin-right: 20px;
}

ul.widgetpreview-categorylist {
  cursor: pointer;
}

ul.widgetpreview-categorylist li,
ul.widgetpreview-widgetlist li {
  line-height: 20px;
  padding: 0 25px 0 5px;
  border-radius: 2px;
}

.widgetpreview-categorylist li.widgetpreview-choosen {
  color: @theme-color-text-contrast;
}

.widgetpreview-base li.widgetpreview-unavailable {
  color: @theme-color-text-disabled;
  cursor: default;
}

ul.widgetpreview-widgetlist {
  cursor: pointer;
  position: relative;
  top: 0;
}

div.widgetpreview-preview {
  width: 500px;
  float: left;
}

.dashboardSettings .submenu button {
  display: block;
  width: 100%;
  box-sizing: border-box;
  padding: 8px;
  margin: 0;
  background: transparent;
  border: 0;
  border-radius: 8px;
  font-family: inherit;
  font-size: 14px;
  line-height: 20px;
  font-weight: normal;
  color: @theme-color-text-lighter;
  text-align: left;
  cursor: pointer;
  text-decoration: none;
  appearance: none;
  white-space: nowrap;
}

.dashboardSettings .submenu button:focus {
  outline: none;
}

.dashboardSettings .submenu button:focus-visible {
  outline: 2px solid @theme-color-focus-ring;
  outline-offset: -2px;
}

.dashboardSettings .submenu button:not([disabled]):hover,
.dashboardSettings .submenu button:not([disabled]):focus-visible {
  background: @theme-color-background-base;
  color: @theme-color-text;
}

.dashboardSettings .submenu button[disabled],
.dashboardSettings .submenu button[disabled]:hover {
  color: @theme-color-text-disabled;
  cursor: default;
}

.dashboardSettings .submenu .addWidget-button .icon {
  margin-right: 8px;
  font-size: inherit;
  line-height: inherit;
}

.widgetPlaceholder {
  border: 1px dashed #bbb6ad;
}

#newDashboardName, #createDashboardName {
  width: 200px;
}

#newDashboardNameInput, #createDashboardNameInput {
  margin: 20px 0 0 100px;
  text-align: left;
}

#createDashboardNameInput input {
  margin-bottom: 10px;
}

.popoverSubMessage {
  text-align: center;
  padding: 10px 0 5px 0;
}

#copyDashboardToUserConfirm .inputs {
  width: 400px;
  margin: 32px auto 0;

  label {
    margin-top: 18px;
    display: inline-block;
  }
}


#dashboardWidgetsArea {
  margin-top: -5px;
}

@media all and (max-width: 749px) {
  #dashboardWidgetsArea {
    padding-right: 7px;
  }

  .col.width-75,
  .col.width-67,
  .col.width-50,
  .col.width-40,
  .col.width-33,
  .col.width-30,
  .col.width-25 {
    width: 100%;
    .widget {
      margin-right: 0;
    }
  }

}

.ui-dialog .widget {
  .button#close,.button#maximise {
    display:none;
  }
}

.ui-button, .ui-dialog-titlebar-close {
  .btn;
  color: @theme-color-brand-contrast !important;
  background-color: @color-red-matomo !important;
  &:hover {
    background: none;
    background-color: transparent;
  }
}

[vue-entry="Dashboard.DashboardSettings"] {
  // Display its children (.piwikSelector) as direct children of .top_controls
  display: contents;
}
