/* Как Mantine Table fz="xs" (12px) — alpine по умолчанию 13px */
.ag-theme-alpine,
.ag-theme-alpine-dark {
  --ag-font-size: 12px;
  --ag-font-family: inherit;
  --ag-row-height: 24px;
  --ag-header-height: 28px;
  --ag-cell-horizontal-padding: 12px;
  --ag-selected-row-background-color: rgba(34, 139, 230, 0.12);
  --ag-row-hover-color: #f1f3f5;
  --ag-column-hover-color: #f1f3f5;
  font-size: 12px;
}

/*
 * AG Grid рисует нативный скролл в .ag-body-*-scroll-viewport
 * (у body/center viewport скролл скрыт). На Windows Chrome/Edge
 * ::-webkit-scrollbar игнорируется, если не задан scrollbar-width
 * на самом скроллящемся элементе — поэтому thin именно здесь.
 */
.ag-theme-alpine .ag-body-vertical-scroll-viewport,
.ag-theme-alpine .ag-body-horizontal-scroll-viewport,
.ag-theme-alpine .ag-horizontal-left-spacer,
.ag-theme-alpine .ag-horizontal-right-spacer,
.ag-theme-alpine-dark .ag-body-vertical-scroll-viewport,
.ag-theme-alpine-dark .ag-body-horizontal-scroll-viewport,
.ag-theme-alpine-dark .ag-horizontal-left-spacer,
.ag-theme-alpine-dark .ag-horizontal-right-spacer {
  scrollbar-width: thin !important;
  scrollbar-color: rgba(0, 0, 0, 0.4) transparent !important;
}

.ag-theme-alpine .ag-body-vertical-scroll-viewport::-webkit-scrollbar,
.ag-theme-alpine .ag-body-horizontal-scroll-viewport::-webkit-scrollbar,
.ag-theme-alpine .ag-horizontal-left-spacer::-webkit-scrollbar,
.ag-theme-alpine .ag-horizontal-right-spacer::-webkit-scrollbar,
.ag-theme-alpine-dark .ag-body-vertical-scroll-viewport::-webkit-scrollbar,
.ag-theme-alpine-dark .ag-body-horizontal-scroll-viewport::-webkit-scrollbar,
.ag-theme-alpine-dark .ag-horizontal-left-spacer::-webkit-scrollbar,
.ag-theme-alpine-dark .ag-horizontal-right-spacer::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.ag-theme-alpine .ag-body-vertical-scroll-viewport::-webkit-scrollbar-button,
.ag-theme-alpine .ag-body-horizontal-scroll-viewport::-webkit-scrollbar-button,
.ag-theme-alpine .ag-horizontal-left-spacer::-webkit-scrollbar-button,
.ag-theme-alpine .ag-horizontal-right-spacer::-webkit-scrollbar-button,
.ag-theme-alpine-dark .ag-body-vertical-scroll-viewport::-webkit-scrollbar-button,
.ag-theme-alpine-dark .ag-body-horizontal-scroll-viewport::-webkit-scrollbar-button,
.ag-theme-alpine-dark .ag-horizontal-left-spacer::-webkit-scrollbar-button,
.ag-theme-alpine-dark .ag-horizontal-right-spacer::-webkit-scrollbar-button {
  width: 8px;
  height: 8px;
}

.ag-theme-alpine .ag-body-vertical-scroll-viewport::-webkit-scrollbar-thumb,
.ag-theme-alpine .ag-body-horizontal-scroll-viewport::-webkit-scrollbar-thumb,
.ag-theme-alpine .ag-horizontal-left-spacer::-webkit-scrollbar-thumb,
.ag-theme-alpine .ag-horizontal-right-spacer::-webkit-scrollbar-thumb,
.ag-theme-alpine-dark .ag-body-vertical-scroll-viewport::-webkit-scrollbar-thumb,
.ag-theme-alpine-dark .ag-body-horizontal-scroll-viewport::-webkit-scrollbar-thumb,
.ag-theme-alpine-dark .ag-horizontal-left-spacer::-webkit-scrollbar-thumb,
.ag-theme-alpine-dark .ag-horizontal-right-spacer::-webkit-scrollbar-thumb {
  background-color: rgba(0, 0, 0, 0.4);
  border-radius: 4px;
}

.ag-theme-alpine .ag-body-vertical-scroll-viewport::-webkit-scrollbar-track,
.ag-theme-alpine .ag-body-horizontal-scroll-viewport::-webkit-scrollbar-track,
.ag-theme-alpine .ag-horizontal-left-spacer::-webkit-scrollbar-track,
.ag-theme-alpine .ag-horizontal-right-spacer::-webkit-scrollbar-track,
.ag-theme-alpine-dark .ag-body-vertical-scroll-viewport::-webkit-scrollbar-track,
.ag-theme-alpine-dark .ag-body-horizontal-scroll-viewport::-webkit-scrollbar-track,
.ag-theme-alpine-dark .ag-horizontal-left-spacer::-webkit-scrollbar-track,
.ag-theme-alpine-dark .ag-horizontal-right-spacer::-webkit-scrollbar-track {
  background: transparent;
}

.ag-theme-alpine .ag-row-hover,
.ag-theme-alpine-dark .ag-row-hover {
  background-color: #f1f3f5;
}

.ag-theme-alpine .ag-row-hover.ag-row-selected,
.ag-theme-alpine-dark .ag-row-hover.ag-row-selected {
  background-color: rgba(34, 139, 230, 0.12);
}

.ag-theme-alpine .ag-header-cell,
.ag-theme-alpine-dark .ag-header-cell {
  display: flex;
  align-items: center;
}

.ag-theme-alpine .ag-header-cell-text,
.ag-theme-alpine-dark .ag-header-cell-text {
  font-size: 12px;
  font-weight: 600;
}

.ag-theme-alpine .ag-cell,
.ag-theme-alpine-dark .ag-cell {
  font-size: 12px;
  display: flex;
  align-items: center;
  line-height: normal;
  padding-top: 2px;
  padding-bottom: 2px;
}

.ag-theme-alpine .ag-cell-wrapper,
.ag-theme-alpine-dark .ag-cell-wrapper {
  display: flex;
  align-items: center;
  height: 100%;
  width: 100%;
}

/* AG Grid: флаги доступа (зелёный ● / серый ✕) */
.ag-flag-on {
  color: #40c057 !important;
  font-size: 12px !important;
  font-weight: 700 !important;
  text-align: center;
}

.ag-flag-off {
  color: #868e96 !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  text-align: center;
}

/* AG Grid на всю высоту слота list-страницы (без Paper / ScrollArea) */
.cx-fill-page-table > .ag-theme-alpine,
.cx-table-paper-fill .ag-theme-alpine,
.cx-ag-fill,
.cx-ag-fill .ag-theme-alpine {
  height: 100% !important;
  min-height: 0;
  flex: 1 1 auto;
}

/* Рестораны: точка у кода бренда (открыт / закрыт) */
.ag-theme-alpine .ag-cell.rest-brand-open::before,
.ag-theme-alpine .ag-cell.rest-brand-closed::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  margin-right: 6px;
  flex-shrink: 0;
}
.ag-theme-alpine .ag-cell.rest-brand-open::before {
  background: #40c057;
}
.ag-theme-alpine .ag-cell.rest-brand-closed::before {
  background: #fa5252;
}

/* Заказы: суммы и статус (DEL / ● / ✕) */
.ag-theme-alpine .ag-cell.order-status-del {
  color: #868e96 !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  justify-content: center;
}

.ag-theme-alpine .ag-cell.cx-ag-int {
  font-variant-numeric: tabular-nums;
  justify-content: flex-end;
  text-align: right;
}
.ag-theme-alpine .ag-cell.cx-ag-int .ag-cell-wrapper,
.ag-theme-alpine .ag-cell.cx-ag-int .ag-cell-value {
  justify-content: flex-end;
  text-align: right;
  width: 100%;
}
.ag-theme-alpine .ag-header-cell.ag-right-aligned-header .ag-header-cell-comp-wrapper,
.ag-theme-alpine .ag-header-cell.ag-right-aligned-header .ag-cell-label-container,
.ag-theme-alpine .ag-header-cell.ag-right-aligned-header .ag-header-cell-label,
.ag-theme-alpine .ag-header-cell.cx-ag-num-header .ag-header-cell-comp-wrapper,
.ag-theme-alpine .ag-header-cell.cx-ag-num-header .ag-cell-label-container,
.ag-theme-alpine .ag-header-cell.cx-ag-num-header .ag-header-cell-label {
  display: flex;
  width: 100%;
  justify-content: flex-end;
  flex-direction: row;
}
.ag-theme-alpine .ag-header-cell.ag-right-aligned-header .ag-header-cell-text,
.ag-theme-alpine .ag-header-cell.cx-ag-num-header .ag-header-cell-text {
  text-align: right;
  margin-left: auto;
}
.ag-theme-alpine .ag-header-group-cell.cx-ag-group-header .ag-header-group-cell-label {
  width: 100%;
  display: flex;
  justify-content: center;
}
.ag-theme-alpine .ag-header-group-cell.cx-ag-group-header .ag-header-group-text {
  text-align: center;
}

/* 2-й уровень группы: Σ (сумма) и чек (заказы) */
.ag-theme-alpine .ag-header-cell.cx-ag-hdr-sigma .ag-header-cell-label,
.ag-theme-alpine .ag-header-cell.cx-ag-hdr-receipt .ag-header-cell-label {
  width: 100%;
  justify-content: center;
}
.ag-theme-alpine .ag-header-cell.cx-ag-hdr-sigma .ag-header-cell-text {
  margin-left: 0;
  text-align: center;
  font-size: 14px;
  font-weight: 400;
  color: #868e96;
}
.ag-theme-alpine .ag-header-cell.cx-ag-hdr-receipt {
  background-repeat: no-repeat;
  background-position: center;
  background-size: 14px 14px;
  background-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A//www.w3.org/2000/svg%27%20width%3D%2724%27%20height%3D%2724%27%20viewBox%3D%270%200%2024%2024%27%20fill%3D%27none%27%3E%3Cpath%20fill%3D%22none%22%20stroke%3D%22%23868e96%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%20stroke-width%3D%222%22%20d%3D%22M5%2021V5a2%202%200%200%201%202-2h10a2%202%200%200%201%202%202v16l-3-2-2%202-2-2-2%202-2-2-3%202M9%207h6M9%2011h6M9%2015h4%22/%3E%3C/svg%3E");
}
.ag-theme-alpine .ag-header-cell.cx-ag-hdr-receipt .ag-header-cell-text {
  opacity: 0;
  width: 14px;
  overflow: hidden;
  margin-left: 0;
}
.ag-theme-alpine .ag-cell.cx-ag-int-bold {
  font-weight: 700;
}
.ag-theme-alpine .ag-cell.cx-ag-int-dim {
  color: #868e96;
}
.ag-theme-alpine .ag-cell.cx-ag-int-qty {
  font-size: 11px;
}
/* Колонка «Неделя»: узкий padding, без места под меню/ресайз */
.ag-theme-alpine .ag-cell.cx-ag-week,
.ag-theme-alpine .ag-header-cell.cx-ag-week-hdr {
  padding-left: 4px !important;
  padding-right: 2px !important;
}
.ag-theme-alpine .ag-header-cell.cx-ag-week-hdr .ag-header-cell-menu-button,
.ag-theme-alpine .ag-header-cell.cx-ag-week-hdr .ag-header-cell-filter-button {
  display: none !important;
  width: 0 !important;
  min-width: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
}
.ag-theme-alpine .ag-header-cell.cx-ag-week-hdr .ag-cell-label-container {
  padding: 0 !important;
}
.ag-theme-alpine .ag-header-cell.cx-ag-week-hdr .ag-header-cell-resize {
  display: none !important;
}
.ag-theme-alpine .ag-cell.cx-ag-week {
  text-overflow: clip;
  white-space: nowrap;
}
/* Узкие колонки режима заказов: 12px padding обрезает цифры многоточием */
.ag-theme-alpine .ag-cell.cx-ag-int-tight {
  padding-left: 2px;
  padding-right: 2px;
  text-overflow: clip;
}
.ag-theme-alpine .ag-cell.cx-ag-int-tight .ag-cell-value {
  text-overflow: clip;
}
.ag-theme-alpine .ag-header-cell.cx-ag-hdr-sigma,
.ag-theme-alpine .ag-header-cell.cx-ag-hdr-receipt {
  padding-left: 2px;
  padding-right: 2px;
}
.ag-theme-alpine .ag-row.cx-ag-footer {
  font-weight: 700;
  background-color: var(--ag-header-background-color, #f8f9fa);
}

/* Рейтинги Яндекс: оценка / badge сервиса / точки категорий */
.ya-score-ok {
  color: #40c057;
  font-weight: 700;
}
.ya-score-mid {
  color: #fab005;
  font-weight: 700;
}
.ya-score-bad {
  color: #fa5252;
  font-weight: 700;
}

.ag-theme-alpine .ag-cell.ya-score-n1::after,
.ag-theme-alpine .ag-cell.ya-score-n2::after,
.ag-theme-alpine .ag-cell.ya-score-n3::after,
.ag-theme-alpine .ag-cell.ya-score-n4::after,
.ag-theme-alpine .ag-cell.ya-score-n5::after {
  letter-spacing: 1px;
  margin-left: 4px;
  font-weight: 700;
  white-space: nowrap;
}
.ag-theme-alpine .ag-cell.ya-score-n1::after { content: "\2605"; }
.ag-theme-alpine .ag-cell.ya-score-n2::after { content: "\2605\2605"; }
.ag-theme-alpine .ag-cell.ya-score-n3::after { content: "\2605\2605\2605"; }
.ag-theme-alpine .ag-cell.ya-score-n4::after { content: "\2605\2605\2605\2605"; }
.ag-theme-alpine .ag-cell.ya-score-n5::after { content: "\2605\2605\2605\2605\2605"; }

.ag-theme-alpine .ag-header-cell.ya-categ-hdr,
.ag-theme-alpine .ya-categ-hdr .ag-header-cell-label {
  justify-content: center;
}

/* Пиктограммы категорий YaRatings (tabler) — CSS, без headerComponent */
.ag-theme-alpine .ag-header-cell.ya-categ-hdr {
  background-repeat: no-repeat;
  background-position: center;
  background-size: 14px 14px;
}
.ag-theme-alpine .ag-header-cell.ya-categ-hdr .ag-header-cell-text {
  opacity: 0;
  width: 14px;
  overflow: hidden;
}
.ag-theme-alpine .ag-cell.ya-categ-pos,
.ag-theme-alpine .ag-cell.ya-categ-neg {
  justify-content: center;
}
.ag-theme-alpine .ag-cell.ya-categ-pos::after,
.ag-theme-alpine .ag-cell.ya-categ-neg::after {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex: 0 0 auto;
}
.ag-theme-alpine .ag-cell.ya-categ-pos::after { background: #40c057; }
.ag-theme-alpine .ag-cell.ya-categ-neg::after { background: #fa5252; }

/* Яндекс / Деливери — pill как Mantine Badge light (без React cellRenderer) */
.ag-theme-alpine .ag-cell.ya-svc-cell-eats > *,
.ag-theme-alpine .ag-cell.ya-svc-cell-dc > * {
  display: none;
}
.ag-theme-alpine .ag-cell.ya-svc-cell-eats::after,
.ag-theme-alpine .ag-cell.ya-svc-cell-dc::after {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.2;
  padding: 3px 8px;
  border-radius: 4px;
  white-space: nowrap;
}
.ag-theme-alpine .ag-cell.ya-svc-cell-eats::after {
  content: "Яндекс";
  color: #b45309;
  background-color: #fef3c7;
}
.ag-theme-alpine .ag-cell.ya-svc-cell-dc::after {
  content: "Деливери";
  color: #2b8a3e;
  background-color: rgba(64, 192, 87, 0.15);
}

.ag-theme-alpine .ag-header-cell.ya-hdr-categTaste {
  background-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A//www.w3.org/2000/svg%27%20width%3D%2724%27%20height%3D%2724%27%20viewBox%3D%270%200%2024%2024%27%20fill%3D%27none%27%3E%3Cpath%20fill%3D%22none%22%20stroke%3D%22%23868e96%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%20stroke-width%3D%222%22%20d%3D%22M4%2011h16a1%201%200%200%201%201%201v.5c0%201.5-2.517%205.573-4%206.5v1a1%201%200%200%201-1%201H8a1%201%200%200%201-1-1v-1c-1.687-1.054-4-5-4-6.5V12a1%201%200%200%201%201-1m8-7a2.4%202.4%200%200%200-1%202a2.4%202.4%200%200%200%201%202m4-4a2.4%202.4%200%200%200-1%202a2.4%202.4%200%200%200%201%202M8%204a2.4%202.4%200%200%200-1%202a2.4%202.4%200%200%200%201%202%22/%3E%3C/svg%3E");
}

.ag-theme-alpine .ag-header-cell.ya-hdr-categLook {
  background-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A//www.w3.org/2000/svg%27%20width%3D%2724%27%20height%3D%2724%27%20viewBox%3D%270%200%2024%2024%27%20fill%3D%27none%27%3E%3Cg%20fill%3D%22none%22%20stroke%3D%22%23868e96%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%20stroke-width%3D%222%22%3E%3Cpath%20d%3D%22M10%2012a2%202%200%201%200%204%200a2%202%200%200%200-4%200%22/%3E%3Cpath%20d%3D%22M21%2012q-3.6%206-9%206t-9-6q3.6-6%209-6t9%206%22/%3E%3C/g%3E%3C/svg%3E");
}

.ag-theme-alpine .ag-header-cell.ya-hdr-categTemp {
  background-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A//www.w3.org/2000/svg%27%20width%3D%2724%27%20height%3D%2724%27%20viewBox%3D%270%200%2024%2024%27%20fill%3D%27none%27%3E%3Cpath%20fill%3D%22none%22%20stroke%3D%22%23868e96%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%20stroke-width%3D%222%22%20d%3D%22M10%2013.5a4%204%200%201%200%204%200V5a2%202%200%200%200-4%200zM10%209h4%22/%3E%3C/svg%3E");
}

.ag-theme-alpine .ag-header-cell.ya-hdr-categSpeed {
  background-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A//www.w3.org/2000/svg%27%20width%3D%2724%27%20height%3D%2724%27%20viewBox%3D%270%200%2024%2024%27%20fill%3D%27none%27%3E%3Cpath%20fill%3D%22none%22%20stroke%3D%22%23868e96%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%20stroke-width%3D%222%22%20d%3D%22M3%2012a9%209%200%201%200%2018%200a9%209%200%201%200-18%200m9%200l3%202m-3-7v5%22/%3E%3C/svg%3E");
}

.ag-theme-alpine .ag-header-cell.ya-hdr-categPackage {
  background-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A//www.w3.org/2000/svg%27%20width%3D%2724%27%20height%3D%2724%27%20viewBox%3D%270%200%2024%2024%27%20fill%3D%27none%27%3E%3Cpath%20fill%3D%22none%22%20stroke%3D%22%23868e96%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%20stroke-width%3D%222%22%20d%3D%22m12%203l8%204.5v9L12%2021l-8-4.5v-9zm0%209l8-4.5M12%2012v9m0-9L4%207.5m12-2.25l-8%204.5%22/%3E%3C/svg%3E");
}

.ag-theme-alpine .ag-header-cell.ya-hdr-categFork {
  background-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A//www.w3.org/2000/svg%27%20width%3D%2724%27%20height%3D%2724%27%20viewBox%3D%270%200%2024%2024%27%20fill%3D%27none%27%3E%3Cpath%20fill%3D%22none%22%20stroke%3D%22%23868e96%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%20stroke-width%3D%222%22%20d%3D%22M19%203v12h-5c-.023-3.681.184-7.406%205-12m0%2012v6h-1v-3M8%204v17M5%204v3a3%203%200%201%200%206%200V4%22/%3E%3C/svg%3E");
}

.ag-theme-alpine .ag-header-cell.ya-hdr-categWrong {
  background-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A//www.w3.org/2000/svg%27%20width%3D%2724%27%20height%3D%2724%27%20viewBox%3D%270%200%2024%2024%27%20fill%3D%27none%27%3E%3Cpath%20fill%3D%22none%22%20stroke%3D%22%23868e96%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%20stroke-width%3D%222%22%20d%3D%22M12%209v4m-1.637-9.409L2.257%2017.125a1.914%201.914%200%200%200%201.636%202.871h16.214a1.914%201.914%200%200%200%201.636-2.87L13.637%203.59a1.914%201.914%200%200%200-3.274%200M12%2016h.01%22/%3E%3C/svg%3E");
}

.ag-theme-alpine .ag-header-cell.ya-hdr-categCommunication {
  background-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A//www.w3.org/2000/svg%27%20width%3D%2724%27%20height%3D%2724%27%20viewBox%3D%270%200%2024%2024%27%20fill%3D%27none%27%3E%3Cpath%20fill%3D%22none%22%20stroke%3D%22%23868e96%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%20stroke-width%3D%222%22%20d%3D%22M8%209h8m-8%204h6m4-9a3%203%200%200%201%203%203v8a3%203%200%200%201-3%203h-5l-5%203v-3H6a3%203%200%200%201-3-3V7a3%203%200%200%201%203-3z%22/%3E%3C/svg%3E");
}
