@media (max-width: 768px) {
  .dashboard-grid {
    grid-template-columns: 1fr !important;
  }

  .dashboard-grid-child {
    grid-column-start: 1 !important;
    grid-column-end: 1 !important;
    grid-row-start: auto !important;
  }
  .card-header-grid.cdk-drag-handle {
    cursor: auto;
  }
}

body.c8y-grid-dashboard > .card.card-dashboard.cdk-drag-preview {
  opacity: 0.8;
}

.dashboard-grid {
  display: -ms-grid;
  display: grid;

  .dashboard-grid-child {
    min-width: 0;
  }

  .cdk-drop-list {
    position: relative;
  }

  .card-dashboard {
    overflow: hidden;
  }

  .card-dashboard.on-resize {
    position: absolute;
    top: 0;
    left: 0;
    opacity: 0.8;
  }

  .card-dashboard.panel-content-transparent.on-resize {
    outline: 1px solid @component-brand-primary;
  }

  .card-header-grid {
    min-height: 6px;
    height: auto !important;
  }

  .card-header-actions:after,
  .card-header-actions + .card-inner-scroll:before {
    display: none;
  }

  .header-actions {
    top: 0;
    right: 0;
    z-index: 10;
  }

  .resize-handle {
    position: absolute;
    right: 0;
    bottom: 0;
    z-index: 12;
    width: 30px;
    height: 30px;
    cursor: se-resize;
  }

  .resize-icon {
    position: absolute;
    .dlt-c8y-icon();
    right: 4px;
    bottom: 4px;
    z-index: 11;
    width: 20px;
    height: 20px;
    opacity: 0;
    cursor: se-resize;
    transition: opacity 0.3s ease-in-out;
    transform: rotate(-90deg);

    &:before {
      content: @dlt-c8y-icon-enlarge;
    }
  }

  .card-dashboard:hover .resize-icon {
    opacity: 0.25;
  }

  .resize-handle:hover + .resize-icon {
    opacity: 1;
  }

  .on-resize .resize-icon {
    opacity: 1 !important;
  }

  .card-placeholder {
    height: 100%;
    opacity: 1 !important;
    outline: 2px dotted @component-border-color !important;
    outline-offset: 0;
  }

  .cdk-drop-list,
  .card-dashboard {
    height: 100%;
  }
}

.fullscreen-dashboard {
  overflow: hidden;
  .navigator,
  .app-main-header {
    display: none;
  }

  .mcontainer {
    margin-top: 0;
    margin-left: 0 !important;
    padding: 0 !important;
    background-color: @body-background-color;

    > .container-fluid {
      padding-bottom: 0;
    }
  }

  .c8y-ui-action-bar {
    top: 0 !important;
    left: 0 !important;
  }



  .dashboard {
    top: 0;
    left: 0;
    z-index: 1085 !important;
    overflow-y: auto;
    margin: 0 !important;
    padding-top: calc(@margin-base * 10);
    padding-bottom: 24px !important;
    width: 100vw;
    height: 99vh;
    .c8y-scrollbar();

    .dashboard {
      padding-bottom: 0 !important;

      all: unset;
    }

    .dashboard-container {
      margin-top: 0 !important;
      margin-bottom: 0 !important;
    }
  }

  .page-tabs:not(.c8y-top-drawer--tabs) {
    display: none;
  }
}

// hide action bar when a single widget is in fullscreen
.singleWidget {
  .c8y-ui-action-bar{
    display: none!important;
  }
  .dashboard-grid-child:not(.fullscreen){
    display: none!important;
  }
  .dashboard-grid-child.fullscreen {
    position: fixed;
    inset: 24px;
    z-index: 100;
    margin: 0!important;
  }
  .dashboard{
    overflow: hidden!important;
  }
}

:-webkit-full-screen:not(:root) {
  .fullscreen-dashboard();
}

:-moz-full-screen:not(:root) {
  .fullscreen-dashboard();
}

:-ms-fullscreen:not(:root) {
  .fullscreen-dashboard();
}

:fullscreen:not(:root) {
  .fullscreen-dashboard();
}

body .dashboard-preview-slot {
  margin: 0 !important;
  padding: 30px;
  border: 1px solid @component-border-color;
  .page-tabs-horizontal {
    margin-top: 2px !important;
  }

  .card.card-dashboard {
    position: relative;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    margin: 0!important;
  }
}
body fieldset > .dashboard-preview-slot {
  border: 0;
  padding: 0;
  margin: 0!important;
}

// title hidden
.card.card-dashboard {
  .panel-title-hidden &,
  .dashboard-preview-slot.panel-title-hidden,
  &.panel-title-hidden.cdk-drag-disabled {
    .card-header-actions {
      position: absolute;
      z-index: 10;
      min-height: 6px;
      width: 100%;
      height: 0;
      border: 0;
      pointer-events: none;
      &:after {
        display: none;
      }

      > * {
        display: none;
      }

      > .header-actions {
        position: absolute;
        top: 0;
        right: 0;
        z-index: 10;
        display: flex;
        border-left: 0;
        opacity: 0;
      }

      + .card-inner-scroll {
        top: 0;
        z-index: 9;
        height: 100%;

        // Removed unused state modifier class - verified 0 usages: .has-footer

        &:before {
          display: none;
        }

        .leaflet-top .leaflet-control {
          margin-top: 16px;
        }
        .c8y-map-status {
          margin-top: 0;
        }
        .sticky-top {
          padding-top: @margin-base;
        }
      }
    }
  }
}

// title overlay
.card.card-dashboard {
  .panel-title-overlay &,
  .dashboard-preview-slot.panel-title-overlay &,
  &.panel-title-overlay.cdk-drag-disabled {
    .card-header-actions {
      position: absolute;
      z-index: 10;
      width: 100%;
      border: 0;
      pointer-events: none;

      &:after {
        display: none;
      }

      .card-header-title {
        min-height: 40px;
      }

      > .header-actions {
        position: absolute;
        top: 0;
        right: 0;
        z-index: 10;
        display: flex;
        border-left: 0;
        opacity: 0;
      }

      + .card-inner-scroll {
        top: 0;
        z-index: 9;
        height: 100%;
        &:before {
          display: none;
        }
        .leaflet-top .leaflet-control {
          margin-top: 40px;
        }
        .c8y-map-status {
          margin-top: 24px;
        }
        .sticky-top {
          padding-top: @margin-base;
        }
      }
    }
  }
}

//title border
.card.card-dashboard {
  .panel-title-border &,
  .dashboard-preview-slot.panel-title-border &,
  &.panel-title-border {
    .card-header-actions {
      z-index: 10;
      border-color: @component-border-color;
      border-top: 1px solid transparent;
      border-bottom-width: 1px;
      border-bottom-style: solid;

      &:after {
        display: none;
      }

      + .card-inner-scroll {
        &:before {
          display: none;
        }
      }
    }
  }
}

.dashboard-template-marker{
  color: var(--palette-status-info, var(--c8y-palette-status-info));
  line-height: .5;
  font-size: 10px;
  font-weight: bold;
  padding: 4px 3px;
  border: 1px solid;
  height: 14px;
  display: inline-block;
  &::before{
    content: 'T';
  }
  .label &,
  .tag &{
    position: static;
      margin: 0 4px 0 -4px;
  }
  .tag--info &{
    color: inherit;
  }
}
