.ag-details-row {
  padding: 2px !important;
}

.link {
  cursor: pointer;
  color: var(--mantine-primary-color);
  text-decoration: none;
  &:hover {
    text-decoration: underline;
  }
}

.link-dark {
  cursor: pointer;
  text-decoration: none;
  display: inline;
  &:hover {
    text-decoration: underline;
    color: black;
  }
}

.link-light {
  cursor: pointer;
  color: var(--mantine-primary-color-3);
  text-decoration: none;
  &:hover {
    text-decoration: underline;
  }
}

.hidden {
  display: none !important;
}

.ag-cell .show-on-row-hover {
  visibility: hidden;
}
.ag-row-hover > .ag-cell .show-on-row-hover {
  visibility: visible;
}

.disabled-row {
  opacity: 0.4;
}

.small-table {
  --ag-cell-horizontal-padding: 0;
}

.ag-details-row-auto-height .ag-center-cols-viewport,
.small-table .ag-center-cols-viewport {
  min-height: 32px !important;
}

.ag-details-row-auto-height .ag-overlay-no-rows-wrapper,
.small-table .ag-overlay-no-rows-wrapper {
  align-items: flex-start;
  color: #666;
}

.small-table .ag-overlay-no-rows-wrapper {
  justify-content: flex-start;
  align-items: center;
}

.ag-overlay-no-rows-wrapper .ag-react-container {
  width: 100%;
}

.ag-tool-panel-wrapper .ag-react-container {
  position: relative;
  width: 100%;
}

.ag-side-buttons {
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

/** Sticky the export button to the bottom of the side panel. */
.ag-side-button:last-of-type {
  position: sticky;
  bottom: 0;
  margin-top: auto;
  border-top: 1px solid var(--mantine-color-gray-3);

  &:not(.ag-selected) {
    background-color: var(--mantine-color-gray-0);
  }
}

/* Re-size our custom icons. */
.ag-side-button-icon-wrapper {
  height: 16px;
  width: 16px;

  & > img {
    height: 16px;
    width: 16px;
  }
}

.ag-icon-asc,
.ag-icon-desc,
.ag-sort-indicator-icon.ag-sort-order {
  color: var(--mantine-primary-color-5);
}

/* Hide the scrollbar for the pinned columns */
.ag-horizontal-left-spacer,
.ag-horizontal-right-spacer {
  visibility: hidden;
}

.ag-details-row .ag-header {
  border-bottom: none !important;
}

.ag-no-header .ag-header {
  display: none !important;
}

.ag-no-header .ag-overlay-no-rows-wrapper {
  padding-top: 0 !important;
}

.late {
  color: var(--mantine-color-red-8);
}

.ag-grid-custom-container-shadow {
  opacity: 0;
  transition: opacity 0.15s ease;
}

.ag-grid-custom-container:hover .ag-grid-custom-container-shadow.active {
  opacity: 1;
}

.ag-popup-child {
  z-index: var(--mantine-z-index-popover, var(--mantine-z-index-modal, 300));
}
.modal-tabs {
  ::before {
    border-top-width: 0;
  }
}
.grid-layout-box {
  & .react-grid-item {
    transition: none;

    &.cssTransforms {
      transition-property: transform;
    }
    & > .react-resizable-handle {
      position: absolute;
      right: 3px;
      bottom: 3px;
      width: 5px;
      height: 5px;
      border-right: 2px solid rgba(0, 0, 0, 0.4);
      border-bottom: 2px solid rgba(0, 0, 0, 0.4);
      z-index: 999;
    }
    &.react-draggable-dragging {
      transition: none;
    }
    &.react-grid-placeholder {
      background: #575757;
      border-radius: 4px;
    }
  }

  & .draggable-area {
    cursor: move;
  }
}
.react-grid-layout {
  position: relative;
  transition: height 200ms ease;
}
.react-grid-item {
  transition: all 200ms ease;
  transition-property: left, top, width, height;
}
.react-grid-item img {
  pointer-events: none;
  user-select: none;
}
.react-grid-item.cssTransforms {
  transition-property: transform, width, height;
}
.react-grid-item.resizing {
  transition: none;
  z-index: 1;
  will-change: width, height;
}

.react-grid-item.react-draggable-dragging {
  transition: none;
  z-index: 3;
  will-change: transform;
}

.react-grid-item.dropping {
  visibility: hidden;
}

.react-grid-item.react-grid-placeholder {
  background: red;
  opacity: 0.2;
  transition-duration: 100ms;
  z-index: 2;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  -o-user-select: none;
  user-select: none;
}

.react-grid-item.react-grid-placeholder.placeholder-resizing {
  transition: none;
}

.react-grid-item > .react-resizable-handle {
  position: absolute;
  width: 20px;
  height: 20px;
}

.react-grid-item > .react-resizable-handle::after {
  content: "";
  position: absolute;
  right: 3px;
  bottom: 3px;
  width: 5px;
  height: 5px;
  border-right: 2px solid rgba(0, 0, 0, 0.4);
  border-bottom: 2px solid rgba(0, 0, 0, 0.4);
}

.react-resizable-hide > .react-resizable-handle {
  display: none;
}

.react-grid-item > .react-resizable-handle.react-resizable-handle-sw {
  bottom: 0;
  left: 0;
  cursor: sw-resize;
  transform: rotate(90deg);
}
.react-grid-item > .react-resizable-handle.react-resizable-handle-se {
  bottom: 0;
  right: 0;
  cursor: se-resize;
}
.react-grid-item > .react-resizable-handle.react-resizable-handle-nw {
  top: 0;
  left: 0;
  cursor: nw-resize;
  transform: rotate(180deg);
}
.react-grid-item > .react-resizable-handle.react-resizable-handle-ne {
  top: 0;
  right: 0;
  cursor: ne-resize;
  transform: rotate(270deg);
}
.react-grid-item > .react-resizable-handle.react-resizable-handle-w,
.react-grid-item > .react-resizable-handle.react-resizable-handle-e {
  top: 50%;
  margin-top: -10px;
  cursor: ew-resize;
}
.react-grid-item > .react-resizable-handle.react-resizable-handle-w {
  left: 0;
  transform: rotate(135deg);
}
.react-grid-item > .react-resizable-handle.react-resizable-handle-e {
  right: 0;
  transform: rotate(315deg);
}
.react-grid-item > .react-resizable-handle.react-resizable-handle-n,
.react-grid-item > .react-resizable-handle.react-resizable-handle-s {
  left: 50%;
  margin-left: -10px;
  cursor: ns-resize;
}
.react-grid-item > .react-resizable-handle.react-resizable-handle-n {
  top: 0;
  transform: rotate(225deg);
}
.react-grid-item > .react-resizable-handle.react-resizable-handle-s {
  bottom: 0;
  transform: rotate(45deg);
}
.creatable-option {
  color: var(--mantine-primary-color);
}

.creatable-option-text {
  color: var(--mantine-color-black);
}

div[data-combobox-selected='true'] {
  .creatable-option,
  .creatable-option-text {
    color: var(--mantine-color-white);
  }
}
.jiggle {
  animation: jiggle 0.25s 2;
}

@keyframes jiggle {
  0% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(5px);
  }
  50% {
    transform: translateX(-5px);
  }
  75% {
    transform: translateX(3px);
  }
  100% {
    transform: translateX(0);
  }
}
