/* Sortable/filterable admin table (assets/sortable-table.js) — same look
   as avpvh-bookkeeping's avbk-balance-table. */

.avpvh-table-tools {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .5rem 1rem;
    margin: .5rem 0;
}

.avpvh-table-count {
    color: #646970;
}

.avpvh-col-toggle-panel[hidden] {
    display: none;
}

.avpvh-col-toggle-panel {
    position: absolute;
    z-index: 10;
    top: 100%;
    left: 0;
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .15);
    padding: .5rem .75rem;
    display: flex;
    flex-direction: column;
    gap: .25rem;
    white-space: nowrap;
}

.avpvh-table-wrap {
    overflow-x: auto;
}

.avpvh-sortable-table thead th {
    white-space: nowrap;
}

.avpvh-sortable-table th.avpvh-sortable {
    cursor: pointer;
    user-select: none;
}

.avpvh-sortable-table th.avpvh-sortable:hover {
    color: #2271b1;
}

.avpvh-sort-indicator {
    font-size: .8em;
    color: #555;
}

.avpvh-sortable-table .avpvh-filter-row td {
    padding: .25rem .3rem;
    border-bottom: 2px solid #ccc;
}

.avpvh-sortable-table tr[hidden] {
    display: none;
}

/* Scoped under the table (three classes + an element) so this outweighs
   wp-admin's input[type="text"] rules, padding and min-height: 40px among
   them, which made the text filters taller than the checklist buttons
   next to them. */
.avpvh-sortable-table .avpvh-filter-row input.avpvh-filter-control,
.avpvh-sortable-table .avpvh-filter-row .avpvh-checklist-toggle {
    box-sizing: border-box;
    width: 100%;
    min-width: 6em;
    height: 1.7rem;
    min-height: 0;
    line-height: 1.7rem;
    margin: 0;
    padding: 0 .3rem;
    border: 1px solid #8c8f94;
    border-radius: 4px;
    background: #fff;
    font-family: inherit;
    font-size: .85em;
    font-weight: normal;
    color: #2c3338;
}

.avpvh-checklist-toggle {
    overflow: hidden;
    text-align: left;
    text-overflow: ellipsis;
    white-space: nowrap;
    cursor: pointer;
}

.avpvh-checklist-filter {
    position: relative;
}

.avpvh-checklist-menu {
    z-index: 100000;
    min-width: 12em;
    max-height: 16em;
    overflow: auto;
    padding: .4rem .55rem;
    background: #fff;
    border: 1px solid #999;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .18);
}

.avpvh-checklist-menu[hidden] {
    display: none;
}

.avpvh-tristate-option {
    display: block;
    width: 100%;
    box-sizing: border-box;
    padding: .15rem 0;
    background: none;
    border: none;
    font-size: .85em;
    font-weight: normal;
    text-align: left;
    white-space: nowrap;
    cursor: pointer;
}

.avpvh-tristate-icon {
    display: inline-block;
    width: 1.1em;
    height: 1.1em;
    line-height: 1.1em;
    margin-right: .3em;
    text-align: center;
    vertical-align: middle;
    border: 1px solid #888;
    border-radius: 2px;
    font-size: .95em;
    font-weight: 700;
}

.avpvh-tristate-option[data-state="include"] .avpvh-tristate-icon {
    background: #2271b1;
    border-color: #2271b1;
    color: #fff;
}

.avpvh-tristate-option[data-state="exclude"] .avpvh-tristate-icon {
    background: #b32d2e;
    border-color: #b32d2e;
    color: #fff;
}

@media (max-width: 782px) {
    .avpvh-sortable-table .avpvh-col-optional {
        display: none;
    }
}
