.packaging-hierarchy-editor {
  .hierarchy-tree {
    min-height: 400px;
    max-height: 600px;
    overflow-y: auto;
  }

  .unit-node {
    position: relative;
  }

  .hierarchy-connector {
    position: absolute;
    left: -14px;
    top: -3px;
    bottom: 50%;
    width: 18px;
    height: 50px;

    &::before {
      content: '';
      position: absolute;
      left: 0;
      top: 50%;
      width: 18px;
      height: 1px;
      background-color: #6c757d;
      opacity: 0.4;
    }

    &::after {
      content: '';
      position: absolute;
      left: 0;
      top: 0;
      width: 1px;
      height: calc(50% + 1px);
      background-color: #6c757d;
      opacity: 0.4;
    }
  }

  .unit-card {
    border: 1px solid #dee2e6 !important;
    border-left-width: 4px !important;
    border-left-color: #0d6efd !important;
    border-radius: 0.375rem;
    transition: all 0.15s ease-in-out;
    background-color: white;

    &.clickable-unit {
      cursor: pointer;
      user-select: none;

      &:hover {
        border-color: #0d6efd !important;
        box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
        background-color: rgba(13, 110, 253, 0.02);
      }

      &:active {
        background-color: rgba(13, 110, 253, 0.05);
      }
    }

    &.border-success {
      border-left-color: #198754 !important;

      &:hover {
        border-color: #198754 !important;
        background-color: rgba(25, 135, 84, 0.02);
      }
    }
  }

  .unit-editor {
    min-height: 400px;

    .card {
      border: none;
      box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    }
  }

  // Hierarchy depth indicators with proper colors
  .unit-node[data-level="1"] .unit-card {
    border-left-color: #0d6efd !important;
  }

  .unit-node[data-level="2"] .unit-card {
    border-left-color: #6f42c1 !important;
  }

  .unit-node[data-level="3"] .unit-card {
    border-left-color: #fd7e14 !important;
  }

  .unit-node[data-level="4"] .unit-card {
    border-left-color: #dc3545 !important;
  }

  .unit-node[data-level="5"] .unit-card {
    border-left-color: #198754 !important;
  }
}

// Dark mode support
@media (prefers-color-scheme: dark) {
  .packaging-hierarchy-editor {
    .hierarchy-tree {
      background-color: #343a40 !important;
      color: #fff;
    }

    .hierarchy-connector {
      &::before, &::after {
        background-color: #adb5bd;
      }
    }
  }
}
