.grid {
  border: var(--GRID-BORDER-WIDTH, 1px) solid var(--GRID-BORDER-COLOR, #DADDE3);
  table th {
    font-family: var(--GRID-TH-FONT-FAMILY, var(--font-bold));
    font-weight: normal;
    text-transform: none;
    font-size: var(--GRID-TH-FONT-SIZE, 12px);
  }

  table td {
    font-family: var(--GRID-TD-FONT-FAMILY, var(--font-medium));
    font-weight: normal;

    span {
      font-family: var(--GRID-TD-FONT-FAMILY, var(--font-medium));
      font-weight: normal;
    }
  }

  .mat-mdc-header-row {
    height: auto;
    min-height: var(--GRID-HEADER-ROW-HEIGHT, 30px);
  }

  .mat-sort-header-content {
    text-align: var(--GRID-TH-TEXT-ALIGN, start) !important;
  }

  .mat-mdc-header-cell {
    padding-top: var(--GRID-HEADER-CELL-PADDING-TOP, 10px);
    padding-bottom: var(--GRID-HEADER-CELL-PADDING-BOTTOM, 20px);
    border-bottom-color: var(--GRID-CELL-BORDER-BOTTOM-COLOR, #e8effe);
  }

  .mat-mdc-cell {
    border-bottom-color: var(--GRID-CELL-BORDER-BOTTOM-COLOR, #e8effe);
  }

  .sln-btn-grid-menu,
  .sln-bg-none {
    border-radius: var(--GRID-MULTI-CMD-RADIUS, 6px);
    transition: background 0.15s ease;

    &:hover:not(:disabled) {
      background: var(--GRID-MENU-HOVER-BG, rgba(68, 83, 113, 0.06));
    }
  }

  &.mini-grid {
    max-width: calc(100vw - 390px);
  }
}

// рамка только у server-grid (core-grid), не у прочих .grid в приложении
core-grid > .grid {
  border: var(--GRID-BORDER-WIDTH, 1px) solid var(--GRID-BORDER-COLOR, #DADDE3);
  border-radius: var(--GRID-BORDER-RADIUS, var(--GRID-RADIUS, 12px));
}

core-card-panel .grid {
  padding: var(--GRID-IN-CARD-PANEL-PADDING, 0) !important;
  border: none;
}

.sln-grid-multi-commands {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--GRID-MULTI-CMD-GAP, 6px);
  box-sizing: border-box;
  height: var(--GRID-MULTI-CMD-MIN-HEIGHT, 28px);
  min-height: 0;
  padding: 0 var(--GRID-MULTI-CMD-PADDING-X, 10px);
  border: none;
  border-radius: var(--GRID-MULTI-CMD-RADIUS, 6px);
  background: var(--GRID-MULTI-CMD-BG, #e8effe);
  color: var(--GRID-MULTI-CMD-COLOR, var(--PRIMARY));
  font-family: var(--font-medium);
  font-size: var(--GRID-MULTI-CMD-FONT-SIZE, 12px);
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  appearance: none;
  transition: background 0.15s ease;

  &:has(> .sln-filter-delete) {
    width: var(--GRID-MULTI-CMD-MIN-HEIGHT, 28px);
    min-width: var(--GRID-MULTI-CMD-MIN-HEIGHT, 28px);
    padding: 0;
  }

  &:hover:not(:disabled) {
    background: var(--GRID-MULTI-CMD-BG-HOVER, #dce8fd);
  }

  &:disabled {
    opacity: 0.5;
    cursor: auto;
  }

  > div {
    flex: 0 0 auto;
    display: block;
    margin: 0;
    padding: 0;
    background-position: center;
    background-repeat: no-repeat;
  }

  .sln-filter-empty,
  .sln-filter-delete,
  .sln-filter-full,
  .sln-grid-update-cw,
  .sln-grid-grid-management,
  .sln-grid-vertical-dots {
    width: var(--GRID-MULTI-CMD-ICON-SIZE, 16px);
    height: var(--GRID-MULTI-CMD-ICON-SIZE, 16px);
    background-size: var(--GRID-MULTI-CMD-ICON-SIZE, 16px);
  }

  .sln-filter-empty,
  .sln-filter-delete,
  .sln-filter-full,
  .sln-grid-vertical-dots {
    background-image: none;
    background-color: var(--GRID-MULTI-CMD-COLOR, var(--PRIMARY));
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-position: center;
    mask-position: center;
    -webkit-mask-size: contain;
    mask-size: contain;
  }

  .sln-filter-empty {
    -webkit-mask-image: url("../../../../../assets/themes/docplat_new/images/grid/filter-empty.svg");
    mask-image: url("../../../../../assets/themes/docplat_new/images/grid/filter-empty.svg");
  }

  .sln-filter-delete {
    -webkit-mask-image: url("../../../../../assets/themes/docplat_new/images/grid/filter-delete.svg");
    mask-image: url("../../../../../assets/themes/docplat_new/images/grid/filter-delete.svg");
  }

  .sln-filter-full {
    -webkit-mask-image: url("../../../../../assets/themes/docplat_new/images/grid/filter-full.svg");
    mask-image: url("../../../../../assets/themes/docplat_new/images/grid/filter-full.svg");
  }

  .sln-grid-vertical-dots {
    -webkit-mask-image: url("../../../../../assets/themes/docplat_new/images/grid/vertical-dots.svg");
    mask-image: url("../../../../../assets/themes/docplat_new/images/grid/vertical-dots.svg");
  }
}

.sln-grid-menu {
  .mat-mdc-menu-item:not([disabled]):hover {
    background: var(--GRID-MENU-HOVER-BG, rgba(68, 83, 113, 0.06)) !important;
  }
}

core-grid .sln-sort-indicator__arrow {
  width: var(--GRID-SORT-ARROW-SIZE, 16px);
  height: var(--GRID-SORT-ARROW-SIZE, 16px);
  border: none;
  background-image: var(--GRID-SORT-ARROW-UP);
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
}

core-grid .sln-sort-indicator_desc .sln-sort-indicator__arrow {
  background-image: var(--GRID-SORT-ARROW-DOWN);
}

.sln-variative-view-mode-button_active {
  border-color: var(--PRIMARY) !important;
  background: var(--PRIMARY) !important;
  color: var(--WHITE);
}
