.dashboard-workspace,
.dashboard-machine-column {
  min-width: 0;
  width: 100%;
}

.dashboard-group-tree[hidden] {
  display: none;
}

.dashboard-view-menu-item[data-mode="tree"] {
  display: none;
}

@media (min-width: 1280px) {
  .dashboard-view-menu-item[data-mode="tree"] {
    display: grid;
  }

  #dashboard-mount.has-group-tree .dashboard-group-tree,
  #qr-print-mount.has-group-tree .dashboard-group-tree {
    position: fixed;
    top: 75px;
    bottom: 0;
    left: 0;
    z-index: 50;
    width: clamp(228px, calc((100vw - 800px) / 2 - 12px), 320px);
    max-height: none;
    box-sizing: border-box;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior-y: contain;
    padding: 1.5rem 0.75rem 1.5rem 0.3rem;
    border-right: 1px solid transparent;
    scrollbar-width: thin;
    scrollbar-color: color-mix(in srgb, var(--fg) 28%, transparent) transparent;
    transition:
      top 260ms cubic-bezier(0.22, 1, 0.36, 1),
      border-color 180ms ease;
  }

  #dashboard-mount.has-group-tree .dashboard-group-tree.is-content-scrolled,
  #qr-print-mount.has-group-tree .dashboard-group-tree.is-content-scrolled {
    border-right-color: color-mix(in srgb, var(--fg) 10%, transparent);
  }

  #dashboard-mount.has-group-tree .dashboard-group-tree.is-scroll-position,
  #qr-print-mount.has-group-tree .dashboard-group-tree.is-scroll-position {
    top: var(--dashboard-group-tree-scroll-top, 75px);
  }
}

@media (min-width: 1280px) and (prefers-reduced-motion: reduce) {
  #dashboard-mount.has-group-tree .dashboard-group-tree {
    transition: none;
  }
}

.dashboard-group-tree::-webkit-scrollbar {
  width: 9px;
}

.dashboard-group-tree::-webkit-scrollbar-track {
  background: transparent;
}

.dashboard-group-tree::-webkit-scrollbar-thumb {
  border: 2px solid transparent;
  border-radius: 999px;
  background: color-mix(in srgb, var(--fg) 26%, transparent);
  background-clip: padding-box;
}

:root[data-theme="light"] .dashboard-group-tree {
  scrollbar-color: #b8bec7 transparent;
}

:root[data-theme="light"] .dashboard-group-tree::-webkit-scrollbar-thumb {
  background: #b8bec7;
  background-clip: padding-box;
}

.dashboard-group-tree-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin: 0 0 0.65rem 0.2rem;
  padding-right: 0;
}

.dashboard-group-tree-title {
  color: color-mix(in srgb, var(--fg) 58%, transparent);
  font-size: 0.72rem;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.dashboard-group-tree-header-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.1rem;
}

.dashboard-group-tree-create,
.dashboard-group-tree-preferences {
  flex: 0 0 1.75rem;
  width: 1.75rem;
  height: 1.75rem;
  border: 1px solid transparent;
  border-radius: 0.45rem;
  background: transparent;
  color: color-mix(in srgb, var(--fg) 62%, transparent);
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.dashboard-group-tree-create svg,
.dashboard-group-tree-preferences svg {
  width: 1rem;
  height: 1rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
}

.dashboard-group-tree-preferences svg {
  fill: currentColor;
  stroke: none;
}

.dashboard-group-tree-create:hover,
.dashboard-group-tree-create:focus-visible,
.dashboard-group-tree-preferences:hover,
.dashboard-group-tree-preferences:focus-visible,
.dashboard-group-tree-preferences[aria-expanded="true"] {
  border-color: var(--border-subtle);
  background: color-mix(in srgb, var(--fg) 7%, transparent);
  color: var(--fg);
  outline: none;
}

.dashboard-group-tree-visibility-summary {
  min-height: 1.8rem;
  margin: -0.2rem 0 0.55rem 0.2rem;
  border-radius: 0.4rem;
  background: color-mix(in srgb, var(--fg) 5%, transparent);
  color: color-mix(in srgb, var(--fg) 64%, transparent);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.55rem;
  padding: 0.25rem 0.35rem 0.25rem 0.55rem;
  font-size: 0.7rem;
}

.dashboard-group-tree-show-all {
  flex: 0 0 auto;
  border: 0;
  border-radius: 0.32rem;
  background: transparent;
  color: var(--fg);
  padding: 0.25rem 0.35rem;
  font: inherit;
  cursor: pointer;
}

.dashboard-group-tree-show-all:hover,
.dashboard-group-tree-show-all:focus-visible {
  background: color-mix(in srgb, var(--fg) 8%, transparent);
  outline: none;
}

.dashboard-group-tree-list {
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
}

.dashboard-group-tree-empty {
  margin: 0.45rem 0.35rem 0;
  color: color-mix(in srgb, var(--fg) 58%, transparent);
  font-size: 0.75rem;
  line-height: 1.45;
}

.dashboard-group-tree-row {
  position: relative;
  width: 100%;
  min-height: 2rem;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  padding-left: var(--tree-indent, 0.35rem);
}

.dashboard-group-tree-toggle,
.dashboard-group-tree-toggle-spacer {
  flex: 0 0 1.45rem;
  width: 1.45rem;
  height: 1.45rem;
}

.dashboard-group-tree-toggle {
  border: 0;
  border-radius: 0;
  background: transparent;
  color: color-mix(in srgb, var(--fg) 68%, transparent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 0 0.1rem;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
}

.dashboard-group-tree-toggle:hover,
.dashboard-group-tree-toggle:focus-visible {
  background: transparent;
  color: var(--fg);
  outline: none;
}

.dashboard-group-tree-node {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
  min-height: 2rem;
  border: 0;
  border-radius: 0.45rem;
  background: transparent;
  color: color-mix(in srgb, var(--fg) 76%, transparent);
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.5rem 0.3rem 0.48rem;
  font: inherit;
  font-size: 0.84rem;
  text-align: left;
  cursor: pointer;
}

.dashboard-group-tree-node:hover,
.dashboard-group-tree-node:focus-visible {
  background: color-mix(in srgb, var(--fg) 7%, transparent);
  color: var(--fg);
  outline: none;
}

.dashboard-group-tree-node[aria-selected="true"] {
  background: color-mix(in srgb, var(--fg) 11%, transparent);
  color: var(--fg);
  font-weight: 620;
}

.dashboard-group-tree-row.is-visibility-hidden .dashboard-group-tree-node {
  color: color-mix(in srgb, var(--fg) 48%, transparent);
}

.dashboard-group-tree-row.is-visibility-hidden .dashboard-group-tree-icon {
  color: color-mix(in srgb, var(--fg) 38%, transparent);
}

.dashboard-group-tree-row.is-drop-target .dashboard-group-tree-node {
  background: color-mix(in srgb, #2563eb 13%, var(--bg));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, #2563eb 48%, transparent);
  color: var(--fg);
}

.dashboard-group-tree-row.is-dragging .dashboard-group-tree-node {
  opacity: 0.62;
}

.is-dashboard-tree-dragging .dashboard-group-tree-row[data-tree-drop-type] {
  cursor: move;
}

.dashboard-group-tree-action-slot {
  flex: 0 0 3.25rem;
  width: 3.25rem;
  height: 1.65rem;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.1rem;
  margin-left: 0.2rem;
}

.dashboard-group-tree-visibility-toggle,
.dashboard-group-tree-menu-toggle {
  width: 1.55rem;
  height: 1.55rem;
  border: 0;
  border-radius: 0.35rem;
  background: transparent;
  color: color-mix(in srgb, var(--fg) 62%, transparent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  font: inherit;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  transition: opacity 120ms ease, background 120ms ease, color 120ms ease;
}

.dashboard-group-tree-visibility-toggle svg {
  display: block;
  width: 1.05rem;
  height: 1.05rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.dashboard-group-tree-visibility-toggle.is-hidden,
.dashboard-group-tree-visibility-toggle.is-mixed,
.dashboard-group-tree-row:hover .dashboard-group-tree-visibility-toggle,
.dashboard-group-tree-row:focus-within .dashboard-group-tree-visibility-toggle,
.dashboard-group-tree-row.is-selected .dashboard-group-tree-visibility-toggle {
  opacity: 1;
}

.dashboard-group-tree-visibility-toggle.is-hidden {
  color: color-mix(in srgb, var(--fg) 52%, transparent);
}

.dashboard-group-tree-visibility-toggle.is-mixed {
  color: color-mix(in srgb, var(--fg) 72%, transparent);
}

.dashboard-group-tree-visibility-toggle:hover,
.dashboard-group-tree-visibility-toggle:focus-visible {
  background: color-mix(in srgb, var(--fg) 8%, transparent);
  color: var(--fg);
  outline: none;
}

.dashboard-group-tree-row.has-status .dashboard-group-tree-action-slot {
  border-left: 1px solid color-mix(in srgb, var(--fg) 12%, transparent);
  padding-left: 0.25rem;
}

.dashboard-group-tree-menu-toggle {
  flex: 0 0 1.55rem;
}

.dashboard-group-tree-menu-toggle svg {
  display: block;
  width: 1.05rem;
  height: 1.05rem;
  fill: currentColor;
}

.dashboard-group-tree-row:hover .dashboard-group-tree-menu-toggle,
.dashboard-group-tree-row:focus-within .dashboard-group-tree-menu-toggle,
.dashboard-group-tree-menu-toggle[aria-expanded="true"] {
  opacity: 1;
}

.dashboard-group-tree-menu-toggle:hover,
.dashboard-group-tree-menu-toggle:focus-visible,
.dashboard-group-tree-menu-toggle[aria-expanded="true"] {
  background: color-mix(in srgb, var(--fg) 8%, transparent);
  color: var(--fg);
  outline: none;
}

.dashboard-group-tree-menu-panel {
  position: fixed;
  z-index: 2100;
  min-width: 10.5rem;
  width: max-content;
  max-width: min(17rem, calc(100vw - 1rem));
  border: 1px solid var(--border-subtle);
  border-radius: 0.5rem;
  background: var(--bg);
  box-shadow: 0 12px 28px color-mix(in srgb, #000 16%, transparent);
  padding: 0.25rem;
}

.dashboard-group-tree-menu-action {
  width: 100%;
  border: 0;
  border-radius: 0.35rem;
  background: transparent;
  color: var(--fg);
  display: block;
  padding: 0.44rem 0.6rem;
  font: inherit;
  font-size: 0.86rem;
  text-align: left;
  white-space: nowrap;
  cursor: pointer;
}

.dashboard-group-tree-menu-action:hover,
.dashboard-group-tree-menu-action:focus-visible {
  background: color-mix(in srgb, var(--fg) 9%, transparent);
  outline: none;
}

.dashboard-group-tree-menu-action.is-checkable {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.dashboard-group-tree-menu-action.is-checkable::before {
  content: "";
  flex: 0 0 0.85rem;
  width: 0.85rem;
  height: 0.85rem;
}

.dashboard-group-tree-menu-action.is-checkable.is-checked::before {
  content: "\2713";
  color: var(--fg);
  font-size: 0.8rem;
  line-height: 0.85rem;
  text-align: center;
}

.dashboard-group-tree-label {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-group-tree-row:not(.is-machine) .dashboard-group-tree-label {
  min-height: 1.2rem;
  line-height: 1.2rem;
  padding-bottom: 0.05rem;
}

.dashboard-group-tree-icon {
  flex: 0 0 1.05rem;
  width: 1.05rem;
  height: 1.05rem;
  color: color-mix(in srgb, var(--fg) 58%, transparent);
}

.dashboard-group-tree-icon svg {
  display: block;
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.65;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.dashboard-group-tree-icon.is-ungrouped {
  color: color-mix(in srgb, var(--fg) 48%, transparent);
}

.dashboard-group-tree-row.is-machine {
  min-height: 1.72rem;
}

.dashboard-group-tree-machine {
  min-height: 1.72rem;
  padding-top: 0.18rem;
  padding-bottom: 0.18rem;
  color: color-mix(in srgb, var(--fg) 68%, transparent);
  font-size: 0.78rem;
}

.dashboard-group-tree-icon.is-machine {
  flex-basis: 0.95rem;
  width: 0.95rem;
  height: 0.95rem;
  color: color-mix(in srgb, var(--fg) 46%, transparent);
}

.dashboard-group-tree-machine-status {
  flex: 0 0 0.46rem;
  width: 0.46rem;
  height: 0.46rem;
  border-radius: 999px;
}

.dashboard-group-tree-machine-status.is-down {
  background: #dc2626;
}

.dashboard-group-tree-machine-indicator {
  flex: 0 0 auto;
  min-width: 2rem;
  height: 1.15rem;
  box-sizing: border-box;
  border: 1px solid color-mix(in srgb, var(--fg) 18%, transparent);
  border-radius: 999px;
  display: inline-grid;
  place-items: center;
  padding: 0 0.32rem;
  color: color-mix(in srgb, var(--fg) 52%, transparent);
  font-size: 0.61rem;
  font-weight: 600;
  line-height: 1;
  text-align: center;
  transform: translateY(-1px);
  white-space: nowrap;
}

.dashboard-group-tree-machine-indicator.is-has-qr {
  border-color: color-mix(in srgb, #15803d 35%, transparent);
  background: color-mix(in srgb, #16a34a 10%, transparent);
  color: color-mix(in srgb, #15803d 82%, var(--fg));
}

.dashboard-group-tree-machine-indicator.is-qr-disabled {
  border-color: rgb(107 114 128 / 35%);
  background: rgb(107 114 128 / 12%);
  color: #6b7280;
}

:root[data-theme="dark"] .dashboard-group-tree-machine-indicator.is-qr-disabled {
  border-color: rgb(156 163 175 / 38%);
  background: rgb(156 163 175 / 14%);
  color: #9ca3af;
}

.dashboard-group-tree-count,
.dashboard-group-tree-badge {
  flex: 0 0 auto;
  min-width: 1.35rem;
  height: 1.35rem;
  box-sizing: border-box;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 0.3rem;
  font-size: 0.7rem;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.dashboard-group-tree-count {
  background: color-mix(in srgb, var(--fg) 9%, transparent);
  color: color-mix(in srgb, var(--fg) 64%, transparent);
}

.dashboard-group-tree-badge.is-pending {
  background: var(--ut-status-warning);
  color: #fff;
}

.dashboard-group-tree-badge.is-down {
  background: #dc2626;
  color: #fff;
}

@media (hover: none) {
  .dashboard-group-tree-visibility-toggle {
    opacity: 1;
  }
}
