/* TableCraft – frontend base styles (table look itself is generated per style) */
.tc-wrap { margin: 1em 0; max-width: 100%; }
.tc-wrap.tc-pending { visibility: hidden; }
.tc-scroller { max-width: 100%; }
.tc-scroller:focus-visible { outline: 2px solid #2f5f8a; outline-offset: 2px; }

.tc-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: .5em; margin: .5em 0; font-size: .9em; }
.tc-toolbar-top { justify-content: space-between; }
.tc-search-wrap.tc-pos-left { order: 0; margin-right: auto; }
.tc-search-wrap.tc-pos-right { order: 2; margin-left: auto; }
.tc-export { order: 1; display: flex; gap: .35em; }
.tc-search, .tc-colfilter, .tc-pagesize {
  font: inherit; padding: .35em .6em; border: 1px solid #b8c2cc; border-radius: 4px; background: #fff; color: #222;
  max-width: 100%; box-sizing: border-box;
}
.tc-colfilter { width: 100%; font-size: .85em; font-weight: 400; }
.tc-filter-row th { padding: 4px !important; background: #f3f5f7 !important; color: #222 !important; }
.tc-btn, .tc-page {
  font: inherit; cursor: pointer; padding: .35em .7em; border: 1px solid #b8c2cc; border-radius: 4px; background: #f6f8fa; color: #222; line-height: 1.2;
}
.tc-btn:hover, .tc-page:hover:not(:disabled) { background: #e7edf3; }
.tc-btn:focus-visible, .tc-page:focus-visible, .tc-search:focus-visible, .tc-colfilter:focus-visible { outline: 2px solid #2f5f8a; outline-offset: 1px; }
.tc-page:disabled { opacity: .45; cursor: default; }
.tc-page.tc-current { background: #2f5f8a; border-color: #2f5f8a; color: #fff; }
.tc-pager { display: flex; flex-wrap: wrap; gap: .25em; margin-left: auto; align-items: center; }
.tc-gap { padding: 0 .3em; }
.tc-info { color: #555; }

th.tc-sortable { cursor: pointer; user-select: none; position: relative; padding-right: 1.6em !important; }
th.tc-sortable::after { content: "\2195"; position: absolute; right: .45em; opacity: .45; font-weight: 400; }
th.tc-sortable.tc-sort-asc::after { content: "\25B2"; opacity: .9; font-size: .75em; }
th.tc-sortable.tc-sort-desc::after { content: "\25BC"; opacity: .9; font-size: .75em; }
th.tc-sortable:focus-visible { outline: 2px solid currentColor; outline-offset: -4px; }

.tc-wrap td.tc-match { box-shadow: inset 0 0 0 2px #f0b400; }
.tc-wrap tr.tc-empty td { text-align: center; padding: 1em; color: #666; font-style: italic; }
.tc-wrap tr[hidden] { display: none !important; }


/* filter bar (dropdowns, ranges, buttons) */
.tc-filters { display: flex; flex-direction: column; gap: .5em; margin: .5em 0; font-size: .9em; }
.tc-filterbar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: .6em 1em; }
.tc-filter { display: flex; flex-direction: column; gap: .2em; min-width: 8em; }
.tc-filter > label, .tc-filter-label { font-weight: 600; font-size: .9em; }
.tc-filter-range { flex-direction: row; flex-wrap: wrap; align-items: center; gap: .3em; }
.tc-filter-range .tc-filter-label { flex-basis: 100%; }
.tc-range-input { width: 7em; }
.tc-range-input[type=date] { width: 10em; }
.tc-filter-tail { display: flex; align-items: center; gap: .6em; margin-left: auto; }
.tc-filter-count { color: #555; white-space: nowrap; }
.tc-filter-reset:disabled { opacity: .5; cursor: default; }
.tc-chips { display: flex; flex-wrap: wrap; gap: .35em; }
.tc-chip { font: inherit; cursor: pointer; padding: .35em .9em; border: 1px solid #b8c2cc; border-radius: 999px; background: #fff; color: #222; line-height: 1.2; }
.tc-chip:hover { background: #eef3f8; }
.tc-chip[aria-pressed="true"] { background: #2f5f8a; border-color: #2f5f8a; color: #fff; }
.tc-chip:focus-visible { outline: 2px solid #2f5f8a; outline-offset: 1px; }
@media (max-width: 640px) { .tc-filter { flex: 1 1 100%; } .tc-filter-tail { margin-left: 0; } }
/* inside the filter bar, lists/fields use the same text size as the buttons */
.tc-filters .tc-colfilter { font-size: 1em; width: auto; }

/* filter sizes (buttons, lists, fields); an explicit font size is set inline */
.tc-fsize-small { font-size: .8em; }
.tc-fsize-small .tc-chip { padding: .2em .65em; }
.tc-fsize-small .tc-colfilter, .tc-fsize-small .tc-btn { padding: .2em .45em; }
.tc-fsize-large { font-size: 1.1em; }
.tc-fsize-large .tc-chip { padding: .5em 1.15em; }
.tc-fsize-large .tc-colfilter, .tc-fsize-large .tc-btn { padding: .5em .8em; }
.tc-fsize-xlarge { font-size: 1.3em; }
.tc-fsize-xlarge .tc-chip { padding: .65em 1.4em; }
.tc-fsize-xlarge .tc-colfilter, .tc-fsize-xlarge .tc-btn { padding: .6em 1em; }
.tc-theme-dark .tc-chip { background: #2b3138; color: #eee; border-color: #4a535d; }
.tc-theme-dark .tc-chip[aria-pressed="true"] { background: #5b8fc0; border-color: #5b8fc0; color: #fff; }
.tc-theme-dark .tc-filter-count { color: #bbb; }

/* dark theme for the controls */
.tc-theme-dark .tc-search, .tc-theme-dark .tc-colfilter, .tc-theme-dark .tc-pagesize,
.tc-theme-dark .tc-btn, .tc-theme-dark .tc-page { background: #2b3138; color: #eee; border-color: #4a535d; }
.tc-theme-dark .tc-btn:hover, .tc-theme-dark .tc-page:hover:not(:disabled) { background: #3a424b; }
.tc-theme-dark .tc-info { color: #bbb; }
.tc-theme-dark .tc-filter-row th { background: #2b3138 !important; }

@media print {
  .tc-toolbar, .tc-filter-row, .tc-filters { display: none !important; }
  .tc-wrap tr[hidden] { display: table-row !important; }
}
