/* AFS POS grids (js/grid.js): KPI strip, search, filters, count and paging above every list, sortable headings and
   the row details panel. The prototype carries a copy of this file. */
.gx{display:flex;flex-wrap:wrap;align-items:center;gap:8px;margin:0 0 8px}
.tbl+.gx,.panel-h+.gx{padding:10px 14px 0}
/* KPIs: small tiles the height of a control, label and note beside the number */
.gx-kpis{display:flex;flex-wrap:wrap;gap:6px}
.gx-k{display:grid;grid-template-columns:auto auto;align-items:baseline;column-gap:6px;min-height:38px;padding:3px 10px;border:1px solid var(--line);border-radius:8px;background:var(--surface);align-content:center}
.gx-k>span{grid-column:1/-1;font-size:10.5px;line-height:1.2;text-transform:uppercase;letter-spacing:.04em;color:var(--muted)}
.gx-k>b{font-size:15px;line-height:1.2;font-weight:650;font-variant-numeric:tabular-nums}
.gx-k>small{font-size:11px;color:var(--muted);font-variant-numeric:tabular-nums;white-space:nowrap}
.gx-kc{display:flex;flex-wrap:wrap;gap:4px;align-items:center;padding:3px 6px}
.gx-kc button{display:inline-flex;align-items:center;gap:5px;min-height:28px;padding:2px 9px;border:1px solid var(--line);border-radius:99px;background:none;color:var(--fg);font:500 12.5px inherit;cursor:pointer}
.gx-kc button b{font-variant-numeric:tabular-nums}
.gx-kc button span{max-width:160px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.gx-kc button:hover{border-color:var(--accent)}
/* beats the office's own button hover so a picked chip stays filled under the pointer */
.gx .gx-kc button.on,.gx .gx-kc button.on:hover:not(:disabled){background:var(--accent);border-color:var(--accent);color:var(--surface)}
.gx-q{flex:1 1 180px;max-width:300px;display:block}
.gx-q input{width:100%;min-height:38px;padding:6px 12px;border:1px solid var(--line);border-radius:8px;background:var(--surface);color:var(--fg);font:inherit;font-size:14px}
.gx-fs{display:contents}
.gx-fl,.gx-size{display:block}
.gx-fl select,.gx-size select{min-height:38px;padding:4px 8px;border:1px solid var(--line);border-radius:8px;background:var(--surface);color:var(--fg);font:inherit;font-size:13.5px;max-width:220px}
.gx-fl select.on{border-color:var(--accent);box-shadow:inset 0 0 0 1px var(--accent);font-weight:600}
.gx-grow{flex:1}
/* Clear filters: shows only while the search or a filter is on (grid.js), and the same button on a page's own filter row */
.gx-clr,.clrf{min-height:38px;padding:4px 12px;border:1px solid var(--accent);border-radius:8px;background:var(--accent-soft);color:var(--accent);font:inherit;font-size:13.5px;font-weight:600;white-space:nowrap;cursor:pointer}
.gx-clr:hover,.clrf:hover:not(:disabled){background:var(--accent);color:var(--surface)}
.clrf:disabled{border-color:var(--line);background:none;color:var(--muted);opacity:.6;cursor:default}
.gx [hidden]{display:none!important}
.gx-count{font-size:13px;color:var(--muted);font-variant-numeric:tabular-nums}
.gx-pager{display:inline-flex;gap:4px}
.gx-pager button{width:36px;min-height:38px;padding:0;border:1px solid var(--line);border-radius:8px;background:var(--surface);color:var(--fg);font-size:18px;line-height:1;cursor:pointer}
.gx-pager button:disabled{opacity:.4;cursor:default}
.gx-sr{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
th.gx-sort{cursor:pointer;user-select:none}
th.gx-sort:hover{color:var(--fg)}
th.gx-sort::after{content:attr(data-gx-dir);margin-left:5px;font-size:9px;color:var(--accent)}
table[data-grid-on].gx-rows>tbody>tr{cursor:pointer}
table[data-grid-on].gx-rows>tbody>tr:hover{background:var(--accent-soft)}
/* row details */
.gx-dr-back{position:fixed;inset:0;z-index:70;background:rgba(6,12,9,.35);display:flex;justify-content:flex-end}
.gx-dr{width:min(440px,100%);height:100%;background:var(--surface);color:var(--fg);display:flex;flex-direction:column;box-shadow:-8px 0 30px rgba(0,0,0,.25)}
.gx-dr header{display:flex;align-items:flex-start;gap:10px;padding:16px 18px;border-bottom:1px solid var(--line)}
.gx-dr header>div{flex:1;min-width:0}
.gx-dr header small{font-size:12px;color:var(--muted)}
.gx-dr header h2{margin:2px 0 0;font-size:20px;line-height:1.2}
.gx-dr .gx-x{width:40px;height:40px;border:0;border-radius:8px;background:none;color:var(--muted);font-size:24px;cursor:pointer;padding:0}
.gx-dr .gx-x:hover{background:var(--accent-soft)}
.gx-dr dl{margin:0;padding:8px 18px;overflow:auto;flex:1}
.gx-dr dl>div{display:grid;grid-template-columns:130px minmax(0,1fr);gap:10px;padding:9px 0;border-bottom:1px solid var(--line)}
.gx-dr dt{font-size:12px;text-transform:uppercase;letter-spacing:.04em;color:var(--muted);padding-top:2px}
.gx-dr dd{margin:0;font-size:14px;overflow-wrap:anywhere}
.gx-dr footer{display:flex;flex-wrap:wrap;gap:8px;align-items:center;padding:12px 18px;border-top:1px solid var(--line)}
.gx-dr footer button{min-height:40px;padding:0 14px;border:1px solid var(--line);border-radius:8px;background:var(--surface);color:var(--fg);font:inherit;font-weight:600;cursor:pointer}
.gx-dr footer .gx-edit{background:var(--accent);border-color:var(--accent);color:var(--surface)}
.gx-dr footer :is(.gx-prv,.gx-nxt){width:40px;padding:0;font-size:18px}
.gx-dr footer button:disabled{opacity:.4;cursor:default}
.gx-dr .gx-dr-ed dt{padding-top:10px}
.gx-dr .gx-dr-ed :is(input,select){width:100%;min-height:40px;padding:0 10px;border:1px solid var(--line);border-radius:8px;background:var(--surface);color:var(--fg);font:inherit;font-size:14px}
.gx-dr .gx-dr-ed :is(input,select):focus{outline:2px solid var(--accent);outline-offset:1px}
.gx-dr-msg{margin:0;padding:8px 18px;font-size:13.5px;color:var(--accent);background:var(--accent-soft)}
.gx-dr-msg.bad{color:var(--danger,#b3261e);background:var(--danger-soft,#fbe3df)}
.gx-muted{font-size:13px;color:var(--muted)}
/* quick edit: the switch on the bar, dashed cells that can change, the box over a cell, and how a save went */
.gx-qe{min-height:38px;padding:4px 12px;border:1px solid var(--line);border-radius:8px;background:var(--surface);color:var(--fg);font:inherit;font-size:13.5px;font-weight:600;cursor:pointer}
.gx-qe::before{content:"✎ "}
.gx .gx-qe[aria-pressed="true"],.gx .gx-qe[aria-pressed="true"]:hover:not(:disabled){background:var(--accent);border-color:var(--accent);color:var(--surface)}
/* what the last save did: a small note at the bottom of the screen, so the bar never moves */
.gx-msg{position:fixed;left:50%;bottom:20px;transform:translateX(-50%);z-index:65;max-width:min(560px,calc(100% - 32px));padding:9px 16px;border-radius:99px;background:var(--fg);color:var(--surface);font-size:13.5px;font-weight:600;box-shadow:0 6px 20px rgba(0,0,0,.25);pointer-events:none}
.gx-msg:empty{display:none}
.gx-msg.bad{background:#b42318;color:#fff}
table.gx-editing>thead>tr>th[data-edit]{color:var(--accent)}
table.gx-editing>tbody>tr[data-id]>td[data-gx-ec]{outline:1px dashed color-mix(in srgb,var(--accent) 40%,transparent);outline-offset:-4px;cursor:text}
table.gx-editing>tbody>tr[data-id]>td[data-gx-ec]:hover{background:var(--surface);outline-style:solid}
td[data-gx-state="saving"]{opacity:.55}
td[data-gx-state="saved"]{background:color-mix(in srgb,var(--accent) 16%,transparent)!important;transition:background .6s}
td[data-gx-state="error"]{box-shadow:inset 0 0 0 2px #b42318}
.gx-ed{position:absolute;z-index:60;display:flex;box-sizing:border-box}
.gx-ed :is(input,select){flex:1;min-width:0;width:100%;height:100%;min-height:34px;box-sizing:border-box;padding:4px 8px;border:2px solid var(--accent);border-radius:6px;background:var(--surface);color:var(--fg);font:inherit;font-size:14px;box-shadow:0 4px 14px rgba(0,0,0,.18)}
.gx-ed input[inputmode]{text-align:right;font-variant-numeric:tabular-nums}
@media (max-width:620px){.gx-q{max-width:none;flex-basis:100%}.gx-dr dl>div{grid-template-columns:1fr;gap:2px}}
/* Y/N flag cells (Product list "Price change"): the date stays out of the grid and shows in the row's details. */
.yn{display:inline-block;min-width:24px;padding:1px 6px;border-radius:6px;font-size:12px;font-weight:700;text-align:center;color:var(--muted);background:var(--accent-soft)}
.yn.y{color:#fff;background:var(--warn,#b5651d)}
td .pcd{display:none}
.gx-dr .pcd{display:block;margin-top:4px;font-size:13px;color:var(--muted)}
/* .ftools: one compact toolbar for a list with its own filters (Product list). Each filter is a small box with its name
   inside it, and the grid bar (data-grid-bar names an empty .gx-host in the toolbar) joins the same row: filters,
   Clear filters, then the counts and paging on the right. Two short rows at most, so the list gets the room. */
.ftools{display:flex;flex-wrap:wrap;align-items:center;gap:6px;margin:0 0 8px}
.panel>.ftools{margin:0;padding:12px 14px 10px}
.ftools>*,.ftools .gx-fs>*{order:1}
.ftools .gx-host,.ftools .gx{display:contents}
.ftools label,.ftools>label{flex:0 0 auto;display:inline-flex;flex-direction:row;align-items:center;gap:6px;min-height:34px;margin:0;padding:0 0 0 10px;border:1px solid var(--line);border-radius:8px;background:var(--surface);font-size:12px;color:var(--muted);white-space:nowrap;max-width:none}
.ftools label>:is(select,input){min-height:32px;border:0;border-radius:8px;background:none;padding:2px 8px 2px 0;font-size:13.5px;color:var(--fg);box-shadow:none;max-width:175px;text-overflow:ellipsis}
.ftools label>input[type=search],.ftools label>input:not([type]){max-width:none;width:100%}
.ftools label.fq{flex:1 1 280px}
.ftools label:has(>input[type=checkbox]){flex-direction:row-reverse;padding:0 10px}
.ftools label:has(>input[type=checkbox])>input{min-height:0;padding:0}
.ftools label:has(>select.on),.ftools label:has(>select.pcon){border-color:var(--accent);box-shadow:inset 0 0 0 1px var(--accent)}
.ftools .gx-fl{padding:0}.ftools .gx-fl select{padding:2px 8px;min-height:32px}
.ftools .gx-clr{order:2;min-height:34px}
.ftools .gx-grow{order:3}
.ftools .gx-kpis{order:4;gap:2px}
.ftools .gx-k{white-space:nowrap;min-height:34px;display:flex;align-items:baseline;gap:4px;padding:0 6px;border:0;background:none}
.ftools .gx-k>span{font-size:12px;text-transform:none;letter-spacing:0}
.ftools .gx-k>b{font-size:13.5px}
.ftools .gx-k+.gx-k{border-left:1px solid var(--line)}
.ftools .gx-kc{border:0}
.ftools .gx-pager,.ftools .gx-size,.ftools .gx-msg{order:5}
.ftools .gx-pager button{min-height:34px;width:32px}
.ftools .gx-size{padding:0}.ftools .gx-size select{min-height:34px;padding:2px 8px}
.ftools .ftitle{order:0;margin:0 6px 0 0;font-size:16px;white-space:nowrap}
