/*
 * Assets tree screen.
 * Everything is scoped under .atree. Colours that belong to the client theme come from the theme's own
 * classes (text-primary, progress-bar, btn-primary, label-*); this file only sets neutral greys and layout.
 */

.atree .atree-box {
  background: #fff;
  border: 1px solid #e6e9ed;
  border-radius: 3px;
  margin-bottom: 15px;
}

/* ---------- split: tree, grip, panel ---------- */

.atree .atree-split {
  display: flex;
  align-items: flex-start;
}

.atree .atree-side {
  flex: 0 0 32%;
  min-width: 260px;
  max-width: 65%;
}

.atree .atree-main {
  flex: 1 1 0;
  min-width: 0;
}

.atree .atree-grip {
  flex: 0 0 14px;
  align-self: stretch;
  margin: 0 3px 15px;
  border-radius: 3px;
  cursor: col-resize;
  touch-action: none;
  user-select: none;
  outline: none;
}

.atree .atree-grip:hover,
.atree .atree-grip:focus-visible,
.atree .atree-resizing .atree-grip {
  background: #eef1f4;
}

/* the button and the handle stay in view while the page scrolls */
.atree .atree-grip-inner {
  position: sticky;
  top: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding-top: 6px;
}

.atree .atree-grip-btn {
  width: 22px;
  padding: 1px 0;
  cursor: pointer;
  position: relative;
  z-index: 1;
}

/* the grip handle: a column of dots under the button */
.atree .atree-grip-dots {
  width: 4px;
  height: 36px;
  background-image: radial-gradient(circle, #aab4be 1.2px, transparent 1.6px);
  background-size: 4px 6px;
}

.atree .atree-grip-icon {
  color: #73879c;
}

/* collapsed: the grip becomes a slim rail on the start side and the panel takes the full width */
.atree .atree-collapsed .atree-grip {
  flex-basis: 30px;
  margin-inline-start: 0;
  cursor: pointer;
  background: #f6f8fa;
  border: 1px solid #e6e9ed;
}

.atree .atree-resizing,
.atree .atree-resizing * {
  cursor: col-resize !important;
  user-select: none;
}

/* ---------- tree column ---------- */

.atree .atree-toolbar {
  padding: 10px 10px 2px;
  border-bottom: 1px solid #e6e9ed;
  background: #fafbfc;
}

.atree .atree-views {
  display: flex;
  gap: 4px;
  margin-bottom: 10px;
}

.atree .atree-views .btn {
  flex: 1 1 0;
  white-space: nowrap;
  padding-left: 4px;
  padding-right: 4px;
}

.atree .atree-views .btn-default {
  background: #fff;
  border-color: #d5dbe1;
  color: #5a6b7c;
}

.atree .atree-views .btn-default:hover {
  background: #f1f4f7;
}

.atree .atree-views .btn-primary,
.atree .atree-views .btn-primary.active {
  opacity: 1;
  box-shadow: none;
}

.atree .atree-toolbar .ui-tree-search {
  margin: 0 0 8px;
}

.atree .atree-filters {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.atree .atree-filter-status {
  flex: 1 1 auto;
  min-width: 0;
}

.atree .atree-filter-status .form-group {
  margin: 0;
}

.atree .atree-filter-status .form-group > div {
  padding: 0;
  width: 100%;
}

.atree .atree-filter-mine {
  flex: 0 0 auto;
}

.atree .atree-filter-mine .checkbox,
.atree .atree-filter-mine .control-group {
  margin: 0;
}

.atree .atree-scroll {
  max-height: calc(100vh - 360px);
  min-height: 260px;
  overflow: auto;
  padding: 8px 6px;
}

.atree .atree-node {
  display: flex;
  align-items: center;
  gap: 6px;
  position: relative;
  margin: 2px 0;
  padding-top: 4px;
  padding-bottom: 4px;
}

/* the ERP tree style draws a box around every node; this tree uses plain rows */
.atree .atree-node.angular-ui-tree-handle,
.atree .atree-node.angular-ui-tree-handle:hover {
  border: 0;
  background: transparent;
  border-radius: 3px;
}

.atree .atree-node .tree-collapse-btn {
  padding: 0 !important;
}

.atree .atree-toggle {
  width: 16px;
  flex: 0 0 16px;
  text-align: center;
}

.atree .atree-icon {
  width: 16px;
  flex: 0 0 16px;
  text-align: center;
  color: #73879c;
}

.atree .atree-icon.atree-warn {
  color: #f0ad4e;
}

.atree .atree-name {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
  color: inherit;
}

.atree .atree-count {
  flex: 0 0 auto;
  background: #e9edf1;
  color: #5a6b7c;
  font-weight: normal;
}

/*
 * The selected node: a tinted fill and a solid bar on the start side, both in the theme colour
 * (they take it from btn-primary), so the selection stands out at a glance.
 */
.atree .atree-node > .atree-mark,
.atree .atree-node > .atree-bar {
  display: none;
  position: absolute;
  top: 0;
  bottom: 0;
  height: auto;
  max-width: none;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  min-height: 0;
  pointer-events: none;
  z-index: 0;
}

.atree .atree-node > .atree-mark {
  inset-inline-start: 0;
  inset-inline-end: 0;
  width: auto;
  opacity: 0.16;
}

.atree .atree-node > .atree-bar {
  inset-inline-start: 0;
  width: 4px;
  border-start-start-radius: 3px;
  border-end-start-radius: 3px;
}

.atree .atree-node > *:not(.atree-mark):not(.atree-bar) {
  position: relative;
  z-index: 1;
}

.atree .atree-node:hover:not(.atree-selected) {
  background: #f6f8fa;
}

.atree .atree-selected {
  font-weight: 700;
  color: #2a3f54;
  border-radius: 3px;
}

.atree .atree-node.atree-selected > .atree-mark,
.atree .atree-node.atree-selected > .atree-bar {
  display: block;
}

.atree .atree-selected .atree-icon {
  color: #2a3f54;
}

.atree .atree-selected .atree-count {
  background: #fff;
  color: #2a3f54;
}

.atree .atree-node-error {
  font-size: 12px;
  color: #a94442;
  padding: 0 28px 4px;
}

.atree .atree-results-head {
  display: flex;
  justify-content: space-between;
  padding: 2px 6px 8px;
  color: #73879c;
}

.atree .atree-results li {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 8px;
  border-bottom: 1px solid #f0f2f4;
  cursor: pointer;
}

.atree .atree-results li:hover {
  background: #f6f8fa;
}

.atree .atree-result-name {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---------- states ---------- */

.atree .atree-state,
.atree .atree-empty {
  padding: 24px 12px;
  text-align: center;
  color: #73879c;
}

.atree .atree-error {
  color: #a94442;
}

.atree .atree-error .btn {
  margin-top: 8px;
}

.atree .atree-hint {
  padding: 60px 12px;
}

.atree .atree-hint .fa {
  display: block;
  font-size: 28px;
  margin-bottom: 8px;
}

.atree .atree-help {
  font-size: 14px;
  color: #9aa7b4;
  cursor: help;
  margin-inline-start: 4px;
}

.atree .atree-note .fa {
  margin-inline-end: 4px;
}

.atree .atree-muted {
  color: #73879c;
  padding: 6px 0;
}

.atree .atree-alert {
  margin: 10px 15px 0;
}

/* ---------- node panel ---------- */

.atree .atree-head {
  padding: 12px 15px 8px;
  border-bottom: 1px solid #e6e9ed;
}

.atree .atree-crumb {
  color: #73879c;
  font-size: 12px;
  min-height: 18px;
}

.atree .atree-back {
  cursor: pointer;
  margin-inline-end: 10px;
}

.atree .atree-flip {
  transform: scaleX(1);
}

[dir="ltr"] .atree .atree-flip,
body.en .atree .atree-flip {
  transform: scaleX(-1);
}

.atree .atree-title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.atree .atree-title {
  margin: 4px 0;
  font-size: 18px;
}

/* small tags next to the title: the code and the status */
.atree .atree-title .label.atree-tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  line-height: 16px;
  padding: 0 6px;
  border-radius: 3px;
  vertical-align: middle;
  position: relative;
  top: -1px;
  margin-inline-start: 4px;
}

/* the clickable path above the title */
.atree .atree-crumbs {
  display: inline;
  list-style: none;
  margin: 0;
  padding: 0;
}

.atree .atree-crumbs > li {
  display: inline;
}

.atree .atree-crumbs > li + li:before {
  content: "/";
  padding: 0 6px;
  color: #b0bac4;
}

.atree .atree-crumbs a {
  cursor: pointer;
  color: #5a738e;
}

.atree .atree-crumbs a:hover,
.atree .atree-crumbs a:focus {
  color: #2a3f54;
  text-decoration: underline;
}

.atree .atree-crumbs > li:last-child a {
  color: #2a3f54;
  font-weight: 600;
}

/* place and custodian links inside the batch facts: plain text with a dotted underline until hovered */
.atree .atree-crumbs.atree-crumbs-inline a,
.atree .atree-crumbs.atree-crumbs-inline > li:last-child a,
.atree a.atree-link {
  cursor: pointer;
  color: inherit;
  font-weight: inherit;
  text-decoration: underline dotted #9aa7b4;
  text-underline-offset: 3px;
}

.atree .atree-crumbs.atree-crumbs-inline a:hover,
.atree .atree-crumbs.atree-crumbs-inline a:focus,
.atree a.atree-link:hover,
.atree a.atree-link:focus {
  color: #2a3f54;
  text-decoration: underline solid;
}

.atree .atree-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.atree .atree-actions .btn {
  margin: 0;
}

.atree .atree-bar {
  box-shadow: none;
}

.atree .atree-section {
  margin: 16px 15px 8px;
  font-size: 14px;
  font-weight: 600;
}

.atree .atree-facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 0 24px;
  padding: 0 15px;
}

.atree .atree-fact {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 0;
  border-bottom: 1px dashed #e6e9ed;
}

.atree .atree-fact-key {
  color: #73879c;
}

.atree .atree-fact-val {
  text-align: end;
}

.atree .atree-notes {
  padding: 10px 15px 0;
}

.atree .atree-tabs {
  padding: 0 15px;
}

.atree .atree-tab-body {
  padding: 12px 0 15px;
}

.atree .atree-table {
  padding: 0 15px 10px;
}

/* the purchases heading with the page size and export tools on its end */
.atree .atree-section-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px 12px;
  margin: 16px 15px 8px;
}

.atree .atree-section-row .atree-section {
  margin: 0;
}

.atree .atree-table-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.atree .atree-tools-label {
  color: #73879c;
  font-size: 12px;
}

.atree .atree-page-sizes {
  margin-inline-end: 6px;
}

.atree .atree-page-sizes .btn {
  min-width: 34px;
  float: none;
}

.atree .atree-page-sizes .btn.active {
  background: #2a3f54;
  border-color: #2a3f54;
  color: #fff;
  box-shadow: none;
}

.atree .atree-table-tools .btn.disabled {
  pointer-events: none;
}

.atree .atree-table .grid-title {
  display: none;
}

.atree .atree-table .fake-link {
  cursor: pointer;
}

.atree-form {
  padding: 5px 0;
}

.atree-form .atree-state {
  padding: 24px 12px;
  text-align: center;
  color: #73879c;
}

.atree-form .atree-alert {
  margin: 10px 0 0;
}

.atree-form .atree-help {
  padding: 0 5px;
}

@media (max-width: 991px) {
  .atree .atree-scroll {
    max-height: 420px;
  }

  /* narrow screens: tree above the panel, no dragging; the button still hides and shows the tree */
  .atree .atree-split {
    flex-direction: column;
    align-items: stretch;
  }

  .atree .atree-side {
    flex: 0 0 auto;
    min-width: 0;
    max-width: none;
  }

  .atree .atree-grip {
    flex: 0 0 auto;
    margin: 0 0 10px;
    cursor: default;
  }

  .atree .atree-grip-inner {
    position: static;
    flex-direction: row;
    justify-content: center;
    padding: 0;
  }

  .atree .atree-grip-dots {
    display: none;
  }

  .atree .atree-grip-btn .fa {
    transform: rotate(90deg);
  }

  .atree .atree-collapsed .atree-grip-btn .fa {
    transform: rotate(-90deg);
  }
}

/* the node path on top of the asset dialogs opened from the tree */
.atree.atree-dlg-path {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 12px;
  padding: 8px 12px;
  background: #f7f8fa;
  border: 1px solid #e6e9ed;
  border-radius: 3px;
  color: #5a738e;
  font-size: 13px;
}

.atree.atree-dlg-path > .fa {
  color: #da9e52;
}

.atree.atree-dlg-path .atree-crumbs > li:last-child {
  color: #2a3f54;
  font-weight: 600;
}