/* Task 260: column chooser and column filtering of the simple grids (grid-tools.js) */
.bi-gt-toolbar{display:inline-flex;flex-wrap:wrap;align-items:center;gap:8px}
.bi-gt-button{height:32px;padding:0 12px;border:1px solid var(--line);border-radius:8px;background:transparent;color:var(--text);font-size:13px;cursor:pointer;white-space:nowrap}
.bi-gt-button:hover,.bi-gt-button:focus-visible{background:color-mix(in srgb,var(--actual) 10%,transparent);outline:none}
.bi-gt-button.is-active{border-color:var(--actual);color:var(--actual)}
.bi-gt-filter th{position:sticky;top:var(--gt-head-height,27px);z-index:2;padding:2px 4px;background:var(--surface);border-bottom:1px solid var(--line);font-weight:400}
.bi-gt-cell{display:flex;align-items:center;gap:2px;min-width:90px}
.bi-gt-input{flex:1;min-width:0;height:24px;padding:0 6px;border:1px solid var(--line);border-radius:6px;background:var(--bg,var(--surface));color:var(--text);font-size:11px}
.bi-gt-input:focus{outline:2px solid color-mix(in srgb,var(--actual) 60%,transparent);outline-offset:0}
.bi-gt-funnel{flex:none;width:22px;height:24px;padding:0;border:0;border-radius:6px;background:transparent;color:var(--secondary);font-size:12px;cursor:pointer}
.bi-gt-funnel:hover,.bi-gt-funnel:focus-visible{background:color-mix(in srgb,var(--actual) 14%,transparent);outline:none}
.bi-gt-funnel.is-active{color:var(--actual);background:color-mix(in srgb,var(--actual) 18%,transparent);font-weight:600}
.bi-gt-pop{position:fixed;top:var(--gt-top,0);left:var(--gt-left,0);z-index:1000;width:min(280px,calc(100vw - 16px));max-height:min(420px,70vh);display:flex;flex-direction:column;gap:6px;padding:10px;border:1px solid var(--line);border-radius:10px;background:var(--surface);color:var(--text);box-shadow:0 8px 28px rgba(0,0,0,.35);font-size:13px}
.bi-gt-pop-head{display:flex;align-items:center;justify-content:space-between;gap:8px}
.bi-gt-pop-head span{display:inline-flex;gap:4px}
.bi-gt-pop-head button{border:0;background:transparent;color:var(--actual);font-size:12px;cursor:pointer;text-decoration:underline;text-underline-offset:3px}
.bi-gt-pop input[type=search]{height:30px;padding:0 8px;border:1px solid var(--line);border-radius:6px;background:var(--bg,var(--surface));color:var(--text);font-size:12px}
.bi-gt-pop ul{margin:0;padding:0;list-style:none;overflow:auto}
.bi-gt-pop li label{display:flex;align-items:center;gap:8px;padding:4px 2px;cursor:pointer}
.bi-gt-pop li label span{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.bi-gt-pop li small{color:var(--secondary);font-variant-numeric:tabular-nums}
.bi-gt-pop input[type=checkbox]{accent-color:var(--actual);width:15px;height:15px;margin:0}
.bi-gt-none,.bi-gt-more{color:var(--secondary);font-size:12px;margin:0;padding:4px 2px}
@media (max-width:700px){.bi-gt-filter{display:none}}
/* Task 264: the «i» button and its pop-up (administrators) */
.bi-info{display:inline-grid;place-items:center;width:18px;height:18px;padding:0;margin-left:4px;border:1px solid var(--line);border-radius:50%;background:transparent;color:var(--secondary);font:italic 600 11px/1 Georgia,serif;cursor:pointer;vertical-align:middle}
.bi-info:hover,.bi-info:focus-visible,.bi-info[aria-expanded=true]{color:var(--actual);border-color:var(--actual);background:color-mix(in srgb,var(--actual) 12%,transparent);outline:none}
.bi-tip-pop{position:fixed;top:var(--tip-top,0);left:var(--tip-left,0);width:var(--tip-width,320px);z-index:1100;max-height:min(70vh,520px);overflow:auto;padding:12px 14px;border:1px solid var(--line);border-radius:10px;background:var(--surface);color:var(--text);box-shadow:0 8px 28px rgba(0,0,0,.35);font-size:13px;line-height:1.45;font-weight:400;text-transform:none;letter-spacing:0;text-align:left}
.bi-tip-pop:focus{outline:none}
.bi-tip-pop p{margin:0 0 8px}.bi-tip-pop p:last-child{margin-bottom:0}
.bi-tip-head{display:flex;align-items:flex-start;justify-content:space-between;gap:10px;margin-bottom:8px}
.bi-tip-head strong{font-size:13px}
.bi-tip-close{flex:none;width:22px;height:22px;padding:0;border:0;border-radius:6px;background:transparent;color:var(--secondary);font-size:16px;line-height:1;cursor:pointer}
.bi-tip-close:hover,.bi-tip-close:focus-visible{color:var(--text);background:color-mix(in srgb,var(--line) 50%,transparent);outline:none}

/* Task 267 (owner 20.10.2026): the frozen rows of a flat grid. The header row and the filter row stick to the top of the scroll
   box and sit ABOVE every body cell (group rows, the sticky first column, the totals); the first column of both rows is the
   corner that sticks left as well. One stacking scale for every grid: body 1–2, totals 3, frozen rows 5, the corner 7.
   (The doubled class raises the specificity above the per-grid rules written before.) */
#bgp-sales .bi-gt-grid.bi-gt-grid{border-collapse:separate;border-spacing:0}
#bgp-sales .bi-gt-grid.bi-gt-grid thead th{position:sticky;z-index:5}
#bgp-sales .bi-gt-grid.bi-gt-grid thead tr:first-child th{top:0}
#bgp-sales .bi-gt-grid.bi-gt-grid thead tr.bi-gt-filter th{top:var(--gt-head-height,27px)}
#bgp-sales .bi-gt-grid.bi-gt-grid thead th:first-child{left:0;z-index:7}
#bgp-sales .bi-gt-grid.bi-gt-grid tbody td:first-child{z-index:2}
#bgp-sales .bi-gt-grid.bi-gt-grid tfoot td{z-index:3}

/* Task 267: column widths dragged with the mouse (a fixed layout once a column was dragged) */
#bgp-sales .bi-gt-grid thead th{overflow:visible}
.bi-gt-resize{position:absolute;top:0;right:-3px;bottom:0;width:7px;cursor:col-resize;touch-action:none;z-index:2}
.bi-gt-resize::after{content:'';position:absolute;top:22%;bottom:22%;left:3px;width:1px;background:var(--line);transition:background .12s}
.bi-gt-resize:hover::after,.bi-gt-resize:focus-visible::after,.bi-gt-resize.is-dragging::after{width:2px;left:2px;background:var(--actual)}
.bi-gt-resize:focus-visible{outline:none}
body.bi-gt-resizing{cursor:col-resize;user-select:none}
#bgp-sales .bi-gt-fixed td,#bgp-sales .bi-gt-fixed th button{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:none}
#bgp-sales .bi-gt-fixed .bi-gt-cell{min-width:0}
.bi-gt-pop-foot{padding-top:6px;border-top:1px solid var(--line)}
.bi-gt-pop-foot button{border:0;background:transparent;color:var(--actual);font-size:12px;cursor:pointer;text-decoration:underline;text-underline-offset:3px;padding:2px}
.bi-gt-pop-foot button:disabled{color:var(--secondary);cursor:default;text-decoration:none}
@media (max-width:700px){.bi-gt-resize{display:none}#bgp-sales .bi-gt-fixed{table-layout:auto!important;width:auto!important;min-width:0!important}#bgp-sales .bi-gt-fixed col{width:auto!important}}

/* Task 267: a check box stands in one line with its value, like the list of a filter in Excel — [x] value ........ count */
.bi-gt-pop li{display:block;margin:0;padding:0;list-style:none}
.bi-gt-pop li label{display:flex!important;flex-direction:row!important;flex-wrap:nowrap;align-items:center;gap:8px;width:auto!important;margin:0!important;padding:3px 4px;cursor:pointer;line-height:1.3}
.bi-gt-pop li label:hover{background:color-mix(in srgb,var(--actual) 8%,transparent);border-radius:6px}
.bi-gt-pop li label input[type=checkbox]{flex:none;width:15px!important;height:15px!important;margin:0!important}
.bi-gt-pop li label span{flex:1 1 auto;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.bi-gt-pop li label small{flex:none;margin-left:auto;padding-left:10px}
.bi-gt-pop ul{overflow-x:hidden;overflow-y:auto}

/* Task 267: the flat grid on the whole screen — the header (and the filter row) at the top, the totals at the bottom, always in view */
body.bi-gt-lock{overflow:hidden}
/* the reveal animation of the page leaves an identity transform on #workspace, and a transformed ancestor traps position:fixed: while a grid is full screen the transform is overridden (an !important declaration beats the animation, which therefore does not restart) */
body.bi-gt-lock #workspace,body.bi-gt-lock #sales-view,body.bi-gt-lock #bgp-sales{transform:none!important;filter:none!important}
body.bi-gt-lock:has(.bi-test-banner){--bi-banner-height:26px}
#bgp-sales .bi-gt-fullscreen.bi-gt-fullscreen{position:fixed;top:0;left:0;right:0;bottom:0;width:auto;height:auto;max-width:none;z-index:900;box-sizing:border-box;margin:0;padding:calc(10px + var(--bi-banner-height,0px)) 14px 12px;display:flex;flex-direction:column;gap:8px;overflow:hidden;background:var(--bg,var(--surface))}
#bgp-sales .bi-gt-fullscreen.bi-gt-fullscreen .bi-adv-head p,#bgp-sales .bi-gt-fullscreen.bi-gt-fullscreen .bi-adv-kpis,#bgp-sales .bi-gt-fullscreen.bi-gt-fullscreen .bi-adv-note,#bgp-sales .bi-gt-fullscreen.bi-gt-fullscreen .source-freshness,
#bgp-sales .bi-gt-fullscreen.bi-gt-fullscreen .bi-ec-kpis,#bgp-sales .bi-gt-fullscreen.bi-gt-fullscreen .bi-ec-charts,#bgp-sales .bi-gt-fullscreen.bi-gt-fullscreen .bi-ec-related,#bgp-sales .bi-gt-fullscreen.bi-gt-fullscreen .bi-ec-head small,#bgp-sales .bi-gt-fullscreen.bi-gt-fullscreen > .bi-ec-note{display:none}
#bgp-sales .bi-gt-fullscreen.bi-gt-fullscreen .bi-adv-head h1,#bgp-sales .bi-gt-fullscreen.bi-gt-fullscreen .bi-ec-head h1{margin:0;font-size:16px}
#bgp-sales .bi-gt-fullscreen.bi-gt-fullscreen .bi-adv-scroll,#bgp-sales .bi-gt-fullscreen.bi-gt-fullscreen .bi-ec-scroll{flex:1 1 auto;min-height:0;max-height:none!important;height:auto}
#bgp-sales .bi-gt-fullscreen.bi-gt-fullscreen .bi-ec-more{flex:none}
.bi-gt-button[aria-pressed=true]{border-color:var(--actual);color:var(--actual)}
@media (max-width:700px){.bi-gt-full-button{display:none}}
/* task 308: «(Выделить все)» on top of the values — pinned while the list scrolls */
.bi-gt-pop li.bi-gt-all{position:sticky;top:0;z-index:1;background:var(--surface);border-bottom:1px solid var(--line);margin-bottom:2px}
.bi-gt-pop li.bi-gt-all label span{font-weight:600}
/* task 349: a column dragged by its header; the mark where it goes */
.bi-gt-grid thead tr:first-child th{touch-action:pan-y}
body.bi-gt-moving,body.bi-gt-moving *{cursor:grabbing!important;user-select:none}
.bi-gt-grid thead th.is-moving{opacity:.55}
.bi-gt-grid thead th.is-drop-before{box-shadow:inset 3px 0 0 var(--actual)}
.bi-gt-grid thead th.is-drop-after{box-shadow:inset -3px 0 0 var(--actual)}
/* task 406: the context menu of a grid cell — «Фильтровать», «Исключить», «Сбросить фильтр» and the grid's own items */
.bi-gt-menu{position:fixed;top:var(--gt-top,0);left:var(--gt-left,0);z-index:1100;min-width:220px;max-width:min(360px,calc(100vw - 16px));display:flex;flex-direction:column;padding:6px;border:1px solid var(--line);border-radius:10px;background:var(--surface);color:var(--text);box-shadow:0 8px 28px rgba(0,0,0,.35);font-size:13px}
.bi-gt-menu>button{display:block;width:100%;min-height:32px;padding:6px 10px;border:0;border-radius:6px;background:transparent;color:inherit;font:inherit;text-align:left;cursor:pointer;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.bi-gt-menu>button:hover:not(:disabled),.bi-gt-menu>button:focus-visible{background:color-mix(in srgb,var(--actual,#2dd4bf) 16%,transparent);outline:none}
.bi-gt-menu>button:disabled{opacity:.45;cursor:default}
.bi-gt-menu-line{height:1px;margin:4px 2px;background:var(--line)}
