/* table-tools.css - styles of table-tools.js and of the extra features of the table kits (prefix tt-). ONE SOURCE: _local-only/console-kit/src/table-tools.css, copied byte for byte.
   Colours come from the host page tokens (admin: --surface --line --text --primary; consoles: --gb-*), so light and dark follow the page. */
.tt-wrap, .tt-modal-back {
  --tt-bg: var(--surface, var(--gb-surface, #ffffff));
  --tt-bg2: var(--surface-2, var(--gb-surface-2, #f1f5f9));
  --tt-line: var(--line, var(--gb-line, #94a3b8));
  --tt-ink: var(--text, var(--gb-ink, #0f172a));
  --tt-mute: var(--muted, var(--gb-ink-2, #475569));
  --tt-pri: var(--primary, var(--gb-primary, #1d4ed8));
  --tt-pri-ink: var(--primary-ink, var(--gb-primary-ink, #ffffff));
  --tt-danger: var(--danger, var(--gb-danger, #b42318));
  --tt-focus: var(--focus, var(--gb-focus, #2563eb));
}
.tt-wrap { position: relative; margin: 0 0 .5rem; color: var(--tt-ink); }
.tt-bar { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.tt-btn.tt-filtbtn { display: none; }
.tt-wrap [hidden], .tt-chips[hidden], .tt-colfilter[hidden], .tt-tabs[hidden], .tt-toast[hidden] { display: none !important; }
.tt-btn { display: inline-flex; align-items: center; gap: .4rem; min-height: 2.75rem; padding: .3rem .7rem; border: 1px solid var(--tt-line); border-radius: 8px; background: var(--tt-bg); color: var(--tt-ink); font: inherit; font-size: .9rem; cursor: pointer; }
.tt-btn:hover:not(:disabled) { background: var(--tt-bg2); }
.tt-btn:disabled { opacity: .55; cursor: default; }
.tt-tabnote { flex: 1 0 100%; margin: .35rem 0 0; font-size: .85rem; color: var(--tt-mute); }
.tt-tabnote[hidden] { display: none !important; }
.tt-btn:focus-visible, .tt-tab:focus-visible, .tt-rs:focus-visible, .tt-input:focus-visible, .tt-wrap tr:focus-visible { outline: 3px solid var(--tt-focus); outline-offset: 2px; }
.tt-primary { background: var(--tt-pri); color: var(--tt-pri-ink); border-color: var(--tt-pri); }
.tt-primary:hover:not(:disabled) { background: var(--tt-pri); filter: brightness(1.08); }
.tt-danger { background: var(--tt-danger); color: #ffffff; border-color: var(--tt-danger); }
.tt-danger-t { color: var(--tt-danger); }
.tt-ghost { border-color: transparent; background: transparent; }
.tt-link { border: 0; background: none; color: var(--tt-pri); text-decoration: underline; min-height: 0; padding: 0 .2rem; }
.tt-block { display: flex; width: 100%; justify-content: flex-start; margin: .15rem 0; }
.tt-ico { width: 1.1em; height: 1.1em; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.tt-grow { flex: 1 1 auto; text-align: left; }
.tt-muted { color: var(--tt-mute); font-size: .85rem; margin: .25rem 0; }
.tt-sr, .tt-live { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.tt-hidden { position: fixed; left: -9999px; width: 1px; height: 1px; border: 0; }
.tt-jump { margin-left: auto; display: inline-flex; gap: .2rem; }
.tt-sep { border-top: 1px solid var(--tt-line); margin: .5rem 0; }
.tt-row { display: flex; align-items: center; gap: .4rem; padding: .2rem 0; }
.tt-end { justify-content: flex-end; }
.tt-lab { display: block; font-weight: 600; font-size: .85rem; margin: .4rem 0 .2rem; }
.tt-input { min-height: 2.75rem; padding: .3rem .5rem; border: 1px solid var(--tt-line); border-radius: 8px; background: var(--tt-bg); color: var(--tt-ink); font: inherit; width: 100%; box-sizing: border-box; }

/* menus */
.tt-menu { position: absolute; z-index: 40; left: var(--tt-x, 0); margin-top: .25rem; min-width: 16rem; max-width: min(24rem, 92vw); max-height: 70vh; overflow: auto; padding: .5rem .75rem; background: var(--tt-bg); color: var(--tt-ink); border: 1px solid var(--tt-line); border-radius: 10px; box-shadow: 0 8px 24px rgba(0, 0, 0, .25); }
.tt-menu-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: .25rem; }

/* status tabs */
.tt-tabs { display: flex; flex-wrap: wrap; gap: .3rem; margin-top: .5rem; }
.tt-tab { display: inline-flex; gap: .4rem; align-items: center; min-height: 2.75rem; padding: .25rem .8rem; border: 1px solid var(--tt-line); border-radius: 999px; background: var(--tt-bg); color: var(--tt-ink); font: inherit; font-size: .9rem; cursor: pointer; }
.tt-tab[aria-pressed="true"] { background: var(--tt-pri); color: var(--tt-pri-ink); border-color: var(--tt-pri); }
.tt-count { font-variant-numeric: tabular-nums; opacity: .9; }
.tt-count:empty { display: none; }

/* toast */
.tt-toast { margin-top: .5rem; padding: .5rem .75rem; border: 1px solid var(--tt-line); border-left: 4px solid var(--tt-pri); border-radius: 8px; background: var(--tt-bg2); color: var(--tt-ink); }

/* dialog */
.tt-modal-back { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; padding: 1rem; background: rgba(0, 0, 0, .55); }
.tt-modal { width: min(30rem, 100%); padding: 1rem 1.25rem; border-radius: 12px; background: var(--tt-bg); color: var(--tt-ink); border: 1px solid var(--tt-line); }
.tt-modal-t { margin: 0 0 .5rem; font-size: 1.1rem; }

/* table effects */
.tt-hide { display: none !important; }
.tt-compact th, .tt-compact td { padding-top: .2rem !important; padding-bottom: .2rem !important; font-size: .85rem; }
.tt-trunc td:not(.tt-act):not(.mc-tb-sel) { max-width: 22rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tt-wrapped td { white-space: normal; overflow-wrap: anywhere; }
.tt-sticky { max-height: 75vh; overflow: auto; }
.tt-sticky thead th { position: sticky; top: 0; z-index: 3; background: var(--tt-bg); }
.tt-pinned th.tt-pin, .tt-pinned td.tt-pin { position: sticky; left: var(--tt-pin-left, 0); z-index: 2; background: var(--tt-bg); }
.tt-pinned thead th.tt-pin { z-index: 4; }
th { position: relative; }
.tt-rs { position: absolute; top: 0; right: 0; width: 8px; height: 100%; cursor: col-resize; touch-action: none; }
.tt-rs:hover { background: var(--tt-line); }
td.tt-act, th.tt-act { white-space: nowrap; width: 1%; text-align: right; }
.tt-cluster { display: inline-flex; gap: .2rem; justify-content: flex-end; }
.tt-act-btn .tt-bl { }
tbody tr[tabindex]:focus-visible { outline: 3px solid var(--tt-focus); outline-offset: -3px; }

/* shared extras that the kits draw (filters row, chips, highlight, skeleton, empty state) */
.tt-chips { display: flex; flex-wrap: wrap; gap: .3rem; align-items: center; margin: .4rem 0; }
.tt-chip { display: inline-flex; align-items: center; gap: .3rem; padding: .15rem .3rem .15rem .6rem; border: 1px solid var(--tt-line); border-radius: 999px; background: var(--tt-bg2); color: var(--tt-ink); font-size: .85rem; }
.tt-chip button { border: 0; background: transparent; color: inherit; cursor: pointer; display: inline-flex; align-items: center; min-width: 1.5rem; min-height: 1.5rem; border-radius: 999px; }
.tt-chip button:hover { background: var(--tt-line); }
mark.tt-hit { background: #fde68a; color: #1c1917; border-radius: 2px; padding: 0 1px; }
.tt-skel td { padding: .6rem; }
.tt-skel td::before { content: ""; display: block; height: .8rem; border-radius: 4px; background: linear-gradient(90deg, var(--tt-bg2, #e2e8f0), var(--tt-line, #cbd5e1), var(--tt-bg2, #e2e8f0)); background-size: 200% 100%; animation: tt-shimmer 1.4s linear infinite; }
@keyframes tt-shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.tt-empty { padding: 1.5rem 1rem; text-align: center; color: var(--tt-mute, inherit); }
.tt-empty .tt-btn { margin-top: .5rem; }
.tt-sortn { font-size: .7em; vertical-align: super; margin-left: 1px; }
.tt-colfilter { display: flex; flex-wrap: wrap; gap: .4rem; align-items: end; padding: .5rem; border: 1px solid var(--tt-line, #cbd5e1); border-radius: 8px; margin: .4rem 0; }
.tt-colfilter label { display: flex; flex-direction: column; font-size: .8rem; gap: .15rem; }
.tt-colfilter input, .tt-colfilter select { min-height: 2.75rem; padding: .25rem .4rem; border: 1px solid var(--tt-line, #cbd5e1); border-radius: 6px; background: var(--tt-bg, #fff); color: var(--tt-ink, inherit); font: inherit; }

/* phones: toolbar behind a Filters button, menus as bottom sheets, 44px targets */
@media (max-width: 640px) {
  .tt-btn.tt-filtbtn { display: inline-flex; min-height: 2.75rem; }
  .tt-wrap:not(.tt-open) .tt-bar { display: none; }
  .tt-bar { margin-top: .4rem; }
  .tt-btn, .tt-tab, .tt-input { min-height: 2.75rem; }
  .tt-act-btn .tt-bl { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .tt-chip button { min-width: 2.75rem; min-height: 2.75rem; }
  .tt-menu { position: fixed; left: 0; right: 0; bottom: 0; top: auto; max-width: none; max-height: 80vh; border-radius: 14px 14px 0 0; margin: 0; padding-bottom: calc(.75rem + env(safe-area-inset-bottom, 0px)); z-index: 1001; }
  .tt-jump { margin-left: 0; }
  .tt-wrapped td, .tt-trunc td:not(.tt-act) { max-width: none; }
}
@media (prefers-reduced-motion: reduce) { .tt-skel td::before { animation: none; } .tt-wrap *, .tt-menu { transition: none !important; scroll-behavior: auto !important; } }
@media print { .tt-wrap, .tt-chips, .tt-colfilter { display: none; } td.tt-act, th.tt-act { display: none; } }
