/* acc-grid.css — the sheet behaviour acc-grid.js adds to every ledger table:
   tick boxes, picked rows, sortable titles with a filter button, the filter
   panel and the totals bar. Its own sheet because acc-app.css is exported to
   web/. It reads the --acc-* palette and adds no token of its own to :root. */

/* ── tick column ─────────────────────────────────────────────────────────── */
.acctable th.g-tick,.acctable td.g-tick{
  width:34px;min-width:34px;padding-inline:0 !important;text-align:center;cursor:pointer;
}
.acctable tbody tr:not(.g-row) td.g-tick,.acctable tfoot td.g-tick{cursor:default}
.g-tickbox{
  display:inline-flex;align-items:center;justify-content:center;vertical-align:middle;
  width:15px;height:15px;box-sizing:border-box;border:1.5px solid #c3ccd9;border-radius:4px;background:#fff;
  transition:background .12s,border-color .12s;
}
.g-tickbox.is-on,.g-tickbox.is-some{background:var(--acc-blue);border-color:var(--acc-blue)}
.g-tickbox.is-on::after{
  content:"";width:7px;height:4px;border:2px solid #fff;border-top:0;border-right:0;
  transform:translateY(-1px) rotate(-45deg);
}
.g-tickbox.is-some::after{content:"";width:7px;height:2px;background:#fff;border-radius:1px}
.acctable tbody tr.g-row:hover .g-tickbox:not(.is-on){border-color:var(--acc-blue)}

/* ── rows ───────────────────────────────────────────────────────────────── */
.acctable tbody tr.g-row{user-select:none;-webkit-user-select:none}
.acctable tbody tr.g-hide{display:none}
/* With rows hidden, :nth-child banding counts the hidden ones; the script bands
   what is shown instead. */
.acctable.g-filtered tbody tr.g-row td{background:var(--acc-surface)}
.acctable.g-filtered tbody tr.g-row.g-band td{background:var(--acc-band)}
.acctable tbody tr.g-row.g-sel td,
.acctable tbody tr.g-row.g-sel:hover td,
.acctable.g-filtered tbody tr.g-row.g-sel td{background:#dbe7fd}
.acctable tbody tr.g-row.g-sel td.t-rn{background:#cddcfb}
.acctable tbody tr.g-row.g-cur td:first-child{box-shadow:inset 3px 0 0 var(--acc-blue)}
[dir="rtl"] .acctable tbody tr.g-row.g-cur td:first-child{box-shadow:inset -3px 0 0 var(--acc-blue)}
.acctable td.g-recalc{color:var(--acc-blue)}
.acctable .g-note{font-weight:500;color:var(--acc-ink-mute);font-size:.92em}

/* ── titles: click to sort, ▾ to filter ─────────────────────────────────── */
.acctable th.g-th{cursor:pointer;user-select:none;-webkit-user-select:none}
.acctable th.g-th:hover{color:var(--acc-ink)}
.g-sort{font-size:9px;color:var(--acc-blue);margin-inline-start:4px;vertical-align:1px}
.g-sort:empty{display:none}
.g-fbtn{
  display:inline-flex;align-items:center;justify-content:center;vertical-align:middle;
  width:18px;height:18px;margin-inline-start:6px;padding:0;
  border:1px solid var(--acc-line);border-radius:4px;background:var(--acc-surface);
  color:var(--acc-ink-mute);cursor:pointer;opacity:.55;transition:opacity .12s;
}
.acctable th.g-th:hover .g-fbtn,.g-fbtn:focus-visible{opacity:1}
.g-fbtn:hover{border-color:var(--acc-blue);color:var(--acc-blue)}
.acctable th.g-on{color:var(--acc-blue)}
.acctable th.g-on .g-fbtn{opacity:1;background:var(--acc-blue);border-color:var(--acc-blue);color:#fff}

/* ── the bar under a table (Excel's status bar) ─────────────────────────── */
.g-bar{
  position:sticky;bottom:0;z-index:4;
  display:flex;align-items:center;gap:14px;flex-wrap:wrap;
  margin:8px 0 0;padding:8px 14px;min-height:38px;box-sizing:border-box;
  background:var(--acc-surface);border:1px solid var(--acc-line);border-radius:var(--acc-r);
  box-shadow:0 -2px 10px rgba(23,38,66,.06);
  font-size:calc(12.5px * var(--acc-fs,1));color:var(--acc-ink-2);
}
.g-bar[hidden]{display:none}
/* Inside a card it is the card's foot, and stays on screen while the rows scroll. */
.acccard.g-card{overflow:clip}
.acccard .g-bar{margin:0;border:0;border-top:1px solid var(--acc-line);border-radius:0 0 15px 15px}
.acccard .g-bar--sel{border-top-color:#b9cdf6;background:#f5f8ff}
.g-bar--sel{border-color:#b9cdf6}
.g-bar__n{display:inline-flex;align-items:center;gap:7px;font-weight:600;color:var(--acc-blue)}
.g-bar__n i{width:8px;height:8px;border-radius:50%;background:var(--acc-blue)}
.g-bar__hint{color:var(--acc-ink-mute)}
.g-sp{flex:1}
.g-chips{display:inline-flex;gap:6px;flex-wrap:wrap}
.g-chip{
  border:1px solid var(--acc-line);background:var(--acc-surface);border-radius:999px;
  padding:2px 10px;font:inherit;font-size:.95em;color:var(--acc-ink-soft);cursor:pointer;
}
.g-chip b{color:var(--acc-ink);font-weight:600;direction:ltr;unicode-bidi:isolate}
.g-chip:hover{border-color:var(--acc-blue);color:var(--acc-blue)}
.g-col{font-weight:600;color:var(--acc-ink-soft);padding-inline-end:10px;border-inline-end:1px solid var(--acc-line)}
.g-fig{display:inline-flex;gap:6px;align-items:baseline}
.g-fig i{font-style:normal;color:var(--acc-ink-mute)}
.g-fig b{font-weight:500;color:var(--acc-ink);font-variant-numeric:tabular-nums;direction:ltr;unicode-bidi:isolate}
.g-fig--sum b{font-weight:800}
.g-x,.g-clear{
  border:0;background:none;font:inherit;cursor:pointer;color:var(--acc-blue);padding:2px 6px;border-radius:6px;
}
.g-x{color:var(--acc-ink-mute)}
.g-x:hover,.g-clear:hover{background:var(--acc-hover)}

/* ── the filter panel: one at a time, fixed under its ▾ ─────────────────── */
.g-menu{
  position:fixed;z-index:2100;display:flex;flex-direction:column;gap:2px;box-sizing:border-box;
  max-height:min(560px, calc(100vh - 16px));padding:6px;
  background:#fff;border:1px solid var(--acc-line-firm,#b9c4d4);border-radius:10px;
  box-shadow:0 16px 36px rgba(23,38,66,.22);
  font:13px "IBM Plex Sans","IBM Plex Sans Arabic",system-ui,sans-serif;color:var(--acc-ink,#101828);
}
.g-menu--rtl{font-family:"IBM Plex Sans Arabic","Noto Kufi Arabic",system-ui,sans-serif}
.g-mi{
  display:flex;align-items:center;gap:6px;width:100%;padding:6px 8px;border:0;border-radius:6px;
  background:none;font:inherit;color:inherit;text-align:start;cursor:pointer;
}
.g-mi span{width:14px;flex:none;color:var(--acc-blue,#2563eb);font-weight:700}
.g-mi:hover:not(:disabled){background:var(--acc-hover,#e6ecf5)}
.g-mi:disabled{color:#98a2b3;cursor:default}
.g-sep{height:1px;background:var(--acc-line,#d9e0ea);margin:3px 2px}
.g-range{display:grid;grid-template-columns:auto 1fr 1fr;gap:6px;align-items:center;padding:4px 8px}
.g-range b{font-weight:600;font-size:12px;color:var(--acc-ink-soft,#4c5a70)}
.g-in{
  width:100%;box-sizing:border-box;height:30px;padding:0 8px;
  border:1px solid var(--acc-line,#d9e0ea);border-radius:6px;font:inherit;background:#fff;color:inherit;
}
.g-in:focus{outline:0;border-color:var(--acc-blue,#2563eb);box-shadow:0 0 0 3px rgba(37,99,235,.15)}
.g-search{margin:4px 0}
.g-list{
  overflow:auto;min-height:60px;max-height:260px;padding:4px;
  border:1px solid var(--acc-line-soft,#e7ecf3);border-radius:6px;
}
.g-li{display:flex;align-items:center;gap:8px;padding:4px 6px;border-radius:4px;cursor:pointer;white-space:nowrap}
.g-li:hover{background:var(--acc-band,#eff4fa)}
.g-li input{margin:0;accent-color:var(--acc-blue,#2563eb)}
.g-li span{overflow:hidden;text-overflow:ellipsis}
.g-li--all{font-weight:600}
.g-foot{display:flex;align-items:center;gap:6px;padding:6px 2px 0}
.g-count{flex:1;color:var(--acc-ink-mute,#5d6879);font-size:12px}
.g-btn{
  height:30px;padding:0 14px;border:1px solid var(--acc-line,#d9e0ea);border-radius:6px;
  background:#fff;font:inherit;cursor:pointer;color:inherit;
}
.g-btn--ok{background:var(--acc-blue,#2563eb);border-color:var(--acc-blue,#2563eb);color:#fff;font-weight:600}

/* Paper never shows any of it. */
@media print{
  .g-tick,.g-fbtn,.g-sort,.g-bar,.g-menu,.g-note{display:none !important}
}
/* On a phone the filter buttons stay visible: there is no hover to find them. */
@media (max-width:760px){
  .g-fbtn{opacity:1}
  .g-bar{gap:8px 12px}
}
