:root { --ui-secondary-bg: #7759ed0f; }

table thead > tr > :is(th, td),
table:is(.ad-table, .table, .t) thead > tr > :is(th, td) { background-color: var(--ui-table-head-bg, var(--ui-secondary-bg)); }

table.e7-table tbody > tr[hidden] { display: none !important; }
.e7-table-footer { border-top: 1px solid var(--ui-line, #e5e7eb); }
.e7-table-footer > tr > td {
  padding: 8px 10px;
  border: 0;
  border-radius: 0 0 var(--ui-radius-lg, 12px) var(--ui-radius-lg, 12px);
  background: var(--ui-canvas, #fafaf9);
  color: var(--e7-text);
  text-align: start;
  font-size: 14px;
}
.e7-table-footer-controls, .e7-table-size label, .e7-table-pages {
  display: flex;
  align-items: center;
  gap: 8px;
}
.e7-table-footer-controls { flex-wrap: wrap; }
.e7-table-pages { margin-inline-start: auto; justify-content: flex-end; gap: 4px; }
.e7-table-footer .e7-table-page, .e7-table-size select {
  min-width: 32px;
  min-height: 32px;
  box-sizing: border-box;
  border: 1px solid var(--ui-line, #e5e7eb);
  background: var(--ui-surface, #fff);
  color: var(--e7-text);
  font: inherit;
}
.e7-table-footer .e7-table-page {
  display: grid;
  place-items: center;
  padding: 3px 6px;
  border-radius: 8px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  text-decoration: none;
}
.e7-table-footer .e7-table-page[aria-current=page] { background: var(--ui-muted, #606a78); border-color: transparent; color: #fff; }
.e7-table-footer .e7-table-page[aria-disabled=true], .e7-table-footer .e7-table-page:disabled { color: var(--e7-text); }
.e7-table-footer a.e7-table-page:hover, .e7-table-footer button.e7-table-page:enabled:hover { background: var(--ui-hover, #f1f3f5); }
.e7-table-footer :is(a, button, select):focus-visible { outline: 2px solid var(--ui-muted, #606a78); outline-offset: 1px; }
.e7-table-arrow::before {
  content: '';
  width: 7px;
  height: 7px;
  box-sizing: border-box;
  border-right: 1.5px solid currentColor;
  border-top: 1.5px solid currentColor;
  transform: rotate(45deg);
}
.e7-table-arrow.e7-table-prev::before { transform: rotate(225deg); }
.e7-table-size { margin: 0; }
.e7-table-size-short { display: none; }
.e7-table-size select { padding: 4px 6px; border-radius: 6px; min-width: 56px; font-weight: 500; }
@supports (appearance: base-select) {
  .e7-table-size select, .e7-table-size select::picker(select) { appearance: base-select; }
  .e7-table-size select { display: inline-flex; align-items: center; justify-content: space-between; gap: 6px; padding-inline: 8px; }
  .e7-table-size select::picker-icon {
    content: '';
    width: 7px;
    height: 7px;
    margin: -3px 2px 0 0;
    border-right: 1.5px solid var(--ui-muted, #606a78);
    border-bottom: 1.5px solid var(--ui-muted, #606a78);
    transform: rotate(45deg);
  }
  .e7-table-size select:open::picker-icon { margin-top: 3px; transform: rotate(225deg); }
  .e7-table-size select::picker(select) {
    margin-block: 4px;
    padding: 4px;
    border: 1px solid var(--ui-line, #e5e7eb);
    border-radius: 10px;
    background: var(--ui-surface, #fff);
    box-shadow: 0 6px 18px rgb(32 40 52 / 14%);
  }
  .e7-table-size option { padding: 5px 8px; border-radius: 6px; }
  .e7-table-size option:is(:hover, :focus-visible) { background: var(--ui-hover, #f1f3f5); }
  .e7-table-size option:checked { background: var(--ui-active, #e8ecf0); font-weight: 600; }
}
@media (max-width: 767.98px) {
  .ad-table .e7-table-footer { display: block; }
  .ad-table .e7-table-footer > tr { padding: 0; }
  .ad-table .e7-table-footer > tr > td { display: block; }
  .ad-table .e7-table-footer > tr > td::before { content: none; }
}
@supports (container-type: inline-size) {
  .e7-table-footer-controls { container: table-footer / inline-size; flex-wrap: nowrap; gap: clamp(4px, 1vw, 8px); }
}
@container table-footer (max-width: 340px) {
  .e7-table-size label { gap: 4px; font-size: 12px; white-space: nowrap; }
  .e7-table-size select { min-width: 46px; min-height: 30px; padding-inline: 5px; }
  .e7-table-pages { gap: 3px; }
  .e7-table-footer .e7-table-page { min-width: clamp(25px, 8.2cqi, 30px); min-height: 30px; padding-inline: 4px; font-size: 12px; }
}
@container table-footer (max-width: 272px) {
  .e7-table-size-label { display: none; }
  .e7-table-size-short { display: inline; }
}
@container table-footer (max-width: 228px) {
  .e7-table-pages .e7-table-page:not(.e7-table-arrow):not([aria-current=page]) { display: none; }
}

.e7-search-bar {
  --fx-h: 34px;
  display: flex;
  align-items: center;
  gap: 0;
  min-width: 0;
  margin: 0;
  padding: 4px;
  border: 1px solid #e4e7ef;
  border-radius: 12px;
  background: #fff;
}
.e7-search-bar:focus-within { border-color: #6a4de0; box-shadow: 0 0 0 2px rgb(106 77 224 / 12%); }
.e7-search-fill { flex: 1 1 auto; }
.e7-search-spaced { margin-bottom: 18px; max-width: 500px; }
.e7-search-icon { display: flex; margin-inline-start: 9px; color: #777e90; }
.e7-search-bar > input[type=search], .e7-search-bar > :is(.form-select, .fx-pick) {
  min-height: 34px;
  min-width: 0;
  border: 0;
  border-radius: 8px;
  box-shadow: none;
  background-color: transparent;
  font: inherit;
  font-size: 14px;
}
.e7-search-bar > input[type=search] { flex: 1 1 180px; width: 0; padding: 0 8px; outline: 0; text-overflow: ellipsis; }
.e7-search-bar > :is(.form-select, .fx-pick) { flex: 0 1 136px; width: 136px; padding: 4px 30px 4px 8px; }
.e7-search-bar > :is(.form-select, .fx-pick):focus-visible { outline: 2px solid #6a4de0; outline-offset: -2px; }
.e7-search-bar > .form-select:not(.form-select-sm):not([multiple]) { background-position: right 13px center, right 8px center; }
.e7-search-bar > .fx-pick::after { right: 8px; }
@supports (appearance: base-select) {
  .e7-search-bar > select.form-select:not([multiple]),
  .e7-search-bar > select.form-select:not([multiple])::picker(select) { appearance: base-select; }
  .e7-search-bar > select.form-select:not([multiple]) {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0 8px;
    background-image: none;
    white-space: nowrap;
  }
  .e7-search-bar > select.form-select::picker-icon {
    content: '';
    flex: none;
    width: 22px;
    height: 22px;
    margin-inline-start: auto;
    border-radius: 50%;
    background: #f3effe url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none'%3E%3Cpath d='M4 6l4 4 4-4' stroke='%237a5cf0' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 12px no-repeat;
  }
  .e7-search-bar > select.form-select:open::picker-icon { transform: rotate(180deg); }
  .e7-search-bar > select.form-select::picker(select) {
    min-width: 9.5rem;
    min-width: max(9.5rem, anchor-size(width));
    margin-block: 4px;
    padding: 4px;
    border: 1px solid #e4e7ef;
    border-radius: 10px;
    background: #fff;
    color: var(--e7-text);
    box-shadow: var(--ui-shadow-pop, 0 8px 24px rgb(32 40 52 / 16%));
  }
  .e7-search-bar > select.form-select option { gap: 10px; padding: 6px 9px; border-radius: 6px; font-size: 14px; }
  .e7-search-bar > select.form-select option::checkmark { order: 1; margin-inline-start: auto; color: #6545cf; }
  .e7-search-bar > select.form-select option:is(:hover, :focus-visible) { background: #f6f3fc; }
  .e7-search-bar > select.form-select option:checked { background: var(--ui-secondary-bg); color: #5036a1; font-weight: 600; }
}
.e7-search-divider { width: 1px; height: 20px; background: #e4e7ef; flex: none; }
.e7-search-bar .e7-search-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  height: 34px;
  padding: 0 14px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  flex: none;
}
.e7-search-submit svg { display: none; }
@media (max-width: 639.98px) {
  .e7-search-bar > input[type=search], .e7-search-bar > :is(.form-select, .fx-pick) { font-size: 16px; }
  .e7-search-bar .e7-search-submit { width: 36px; padding: 0; }
  .e7-search-icon, .e7-search-submit span { display: none; }
  .e7-search-submit svg { display: block; }
}

.e7-card-header { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; min-width: 0; }
.e7-card-header, caption:has(> .e7-card-header) {
  background: var(--ui-surface, var(--ui-secondary-bg));
  border-radius: var(--ui-radius-lg, 12px) var(--ui-radius-lg, 12px) 0 0;
}
caption > .e7-card-header { background: transparent; }
.e7-card-header-name { display: flex; flex: 1 1 0; align-items: center; gap: 8px; min-width: 0; }
.e7-card-header-thumb { width: 36px; height: 36px; flex: none; border-radius: 8px; object-fit: cover; }
.e7-card-header-copy { min-width: 0; }
.e7-card-header-copy > :is(h2, p) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.e7-card-header-copy > h2 { margin: 0; color: var(--e7-text); font-size: 16px; font-weight: 600; line-height: 1.25; }
.e7-card-header-copy > p { margin: 3px 0 0; color: var(--e7-text); font-size: 13px; }
.e7-card-header-search { width: 100%; min-width: 0; flex: 0 0 100%; container: card-search / inline-size; }
.e7-card-header:is([data-search-mode=expanded], [data-search-mode=compact]) > .e7-card-header-search {
  width: var(--e7-card-search-width);
  flex-basis: var(--e7-card-search-width);
}
.e7-card-header-toggle.btn { display: none; }
.e7-card-header[data-search-mode=icon] > .e7-card-header-toggle {
  position: relative;
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 34px;
  height: 34px;
  padding: 0;
}
.e7-card-header[data-search-mode=icon] > .e7-card-header-toggle[aria-expanded=false] + .e7-card-header-search { display: none; }
.e7-card-header-active { position: absolute; inset: 3px 3px auto auto; width: 6px; height: 6px; border-radius: 50%; background: #fff; }
@container card-search (width < 260px) {
  .e7-card-header-search .e7-search-icon, .e7-card-header-search .e7-search-submit span { display: none; }
  .e7-card-header-search .e7-search-submit { width: 36px; padding: 0; }
  .e7-card-header-search .e7-search-submit svg { display: block; }
}
@container card-search (width >= 260px) {
  .e7-card-header-search .e7-search-icon { display: flex; }
  .e7-card-header-search .e7-search-submit { width: auto; padding: 0 14px; }
  .e7-card-header-search .e7-search-submit span { display: inline; }
  .e7-card-header-search .e7-search-submit svg { display: none; }
}

.e7-search-bar > .e7-search-filter { flex-basis: 40%; width: 40%; }
@supports (appearance: base-select) {
  .e7-search-bar > select.e7-search-filter:not([multiple]) {
    flex: 0 0 30px;
    width: 30px;
    min-width: 30px;
    margin-inline-end: 3px;
    padding: 0;
    gap: 0;
    justify-content: center;
    color: transparent;
    font-size: 0;
  }
  .e7-search-bar > select.e7-search-filter::picker-icon {
    width: 16px;
    height: 16px;
    margin: 0;
    border-radius: 0;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236545cf' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 6h16l-6 7v4l-4 2v-6z'/%3E%3C/svg%3E") center / 16px no-repeat;
  }
  .e7-search-bar > select.e7-search-filter:open::picker-icon { transform: none; }
  .e7-search-bar > .e7-search-filter:is(:hover, :open) { background-color: #f3effe; }
  .e7-search-bar > .e7-search-filter:has(option:not([value=""]):checked) { background-color: var(--ui-secondary-bg); }
}

/* Search + filter on detail and report tables (core/local-table.js). */
.e7-local-tools { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 10px; padding: 8px 12px; }
.e7-local-tools > h2 { margin: 0 auto 0 0; font-size: 16px; font-weight: 600; }
.e7-local-tools > .e7-search-bar { width: 340px; max-width: 100%; }
.card > .e7-local-tools, .card [data-local-table] > .e7-local-tools { padding-inline: 0; }
.e7-local-none { margin: 0; padding: 12px 16px; font-size: 13px; color: var(--ui-muted, #5E6475); }
@media (max-width: 575.98px) { .e7-local-tools > .e7-search-bar { width: 100%; } }
