/* ==========================================================================
   BrikPanel – Modern Taxonomy Pages (Categories, Tags, Attributes)
   CSS-only overrides for WP admin taxonomy pages
   ========================================================================== */

/* ---------- Variables ---------- */
:root {
    --bpl-bg: #f1f1f1;
    --bpl-card: #ffffff;
    --bpl-text: #303030;
    --bpl-text-secondary: #616161;
    --bpl-text-muted: #8a8a8a;
    --bpl-border: #e3e3e3;
    --bpl-input-border: #8a8a8a;
    --bpl-input-focus: #303030;
    --bpl-primary: #303030;
    --bpl-primary-hover: #1a1a1a;
    --bpl-hover-bg: #f7f7f7;
    --bpl-success: #1a8917;
    --bpl-error: #d72c0d;
}

/* ---------- Page Layout ---------- */
body.brikpanel-tax #wpbody-content,
body.brikpanel-tax #wpbody-content,
body.brikpanel-tax #wpbody-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem 2rem;
}

/* ---------- Hide defaults ---------- */
body.brikpanel-tax #screen-meta-links,
body.brikpanel-tax #screen-meta,
body.brikpanel-tax .screen-meta-links,
body.brikpanel-tax #screen-meta-links,
body.brikpanel-tax #screen-meta,
body.brikpanel-tax .screen-meta-links,
body.brikpanel-tax #screen-meta-links,
body.brikpanel-tax #screen-meta,
body.brikpanel-tax .screen-meta-links,
body.brikpanel-tax #wpfooter,
body.brikpanel-tax #wpfooter,
body.brikpanel-tax #wpfooter {
    display: none !important;
}

/* Hide WP inline notice */
body.brikpanel-tax .notice:not(.brikpanel-notice),
body.brikpanel-tax .notice:not(.brikpanel-notice) {
    display: none;
}

/* ---------- Page Title ---------- */
body.brikpanel-tax .wrap > h1,
body.brikpanel-tax .wrap > h1,
body.brikpanel-tax .wrap > h1 {
    font-size: 1.25rem !important;
    font-weight: 600 !important;
    color: var(--bpl-text);
    padding: 1.25rem 0 0.75rem !important;
    margin: 0 !important;
    line-height: 1.3;
}

/* ---------- Two-Column Layout ---------- */
body.brikpanel-tax #col-container,
body.brikpanel-tax #col-container {
    display: grid !important;
    grid-template-columns: 340px 1fr;
    gap: 1.5rem;
    align-items: start;
}

body.brikpanel-tax #col-left,
body.brikpanel-tax #col-left {
    width: 100% !important;
    float: none !important;
    grid-column: 1;
    grid-row: 1;
}

body.brikpanel-tax #col-right,
body.brikpanel-tax #col-right {
    width: 100% !important;
    float: none !important;
    grid-column: 2;
    grid-row: 1;
}

/* ---------- Add Form Card ---------- */
body.brikpanel-tax #col-left .col-wrap,
body.brikpanel-tax #col-left .col-wrap {
    background: var(--bpl-card);
    border: 1px solid var(--bpl-border);
    border-radius: 0.75rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    padding: 1.25rem 1.5rem;
}

body.brikpanel-tax #col-left .col-wrap > p:first-of-type,
body.brikpanel-tax #col-left .col-wrap > p:first-of-type {
    display: none;
}

body.brikpanel-tax .form-field label,
body.brikpanel-tax .form-field label {
    font-size: 0.8125rem !important;
    font-weight: 600 !important;
    color: var(--bpl-text) !important;
    margin-bottom: 0.25rem;
}

body.brikpanel-tax .form-field p,
body.brikpanel-tax .form-field p {
    font-size: 0.75rem;
    color: var(--bpl-text-muted);
    margin-top: 0.25rem;
}

body.brikpanel-tax .form-field input[type="text"],
body.brikpanel-tax .form-field textarea,
body.brikpanel-tax .form-field select,
body.brikpanel-tax .form-field input[type="text"],
body.brikpanel-tax .form-field textarea,
body.brikpanel-tax .form-field select {
    width: 100% !important;
    padding: 8px 12px !important;
    border: 1px solid var(--bpl-input-border) !important;
    border-radius: 0.5rem !important;
    font-size: 0.875rem !important;
    color: var(--bpl-text) !important;
    background: var(--bpl-card) !important;
    outline: none !important;
    box-shadow: none !important;
    transition: border-color 0.15s, box-shadow 0.15s !important;
    height: auto !important;
    line-height: 1.5 !important;
}

body.brikpanel-tax .form-field input[type="text"]:focus,
body.brikpanel-tax .form-field textarea:focus,
body.brikpanel-tax .form-field select:focus,
body.brikpanel-tax .form-field input[type="text"]:focus,
body.brikpanel-tax .form-field textarea:focus,
body.brikpanel-tax .form-field select:focus {
    border-color: var(--bpl-input-focus) !important;
    box-shadow: 0 0 0 1px var(--bpl-input-focus) !important;
}

body.brikpanel-tax .form-field textarea,
body.brikpanel-tax .form-field textarea {
    min-height: 80px;
    resize: vertical;
}

/* Add form title */
body.brikpanel-tax #col-left h2,
body.brikpanel-tax #col-left h2 {
    font-size: 1rem !important;
    font-weight: 600 !important;
    color: var(--bpl-text);
    margin: 0 0 1rem !important;
    padding: 0 !important;
}

/* Submit button */
body.brikpanel-tax #submit,
body.brikpanel-tax .button-primary,
body.brikpanel-tax #submit,
body.brikpanel-tax .button-primary,
body.brikpanel-tax .button-primary {
    background: var(--bpl-primary) !important;
    color: #fff !important;
    border: none !important;
    border-radius: 0.5rem !important;
    padding: 8px 20px !important;
    font-size: 0.8125rem !important;
    font-weight: 550 !important;
    cursor: pointer !important;
    box-shadow: inset 0 -1px 0 rgba(0,0,0,0.2), inset 0 1px 0 rgba(255,255,255,0.1) !important;
    transition: background 0.15s !important;
    height: auto !important;
    line-height: 1.4 !important;
}

body.brikpanel-tax #submit:hover,
body.brikpanel-tax .button-primary:hover,
body.brikpanel-tax #submit:hover,
body.brikpanel-tax .button-primary:hover,
body.brikpanel-tax .button-primary:hover {
    background: var(--bpl-primary-hover) !important;
}

/* ---------- Right Column: Table Card ---------- */
body.brikpanel-tax #col-right .col-wrap,
body.brikpanel-tax #col-right .col-wrap {
    background: var(--bpl-card);
    border: 1px solid var(--bpl-border);
    border-radius: 0.75rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    overflow: hidden;
}

/* Search box */
body.brikpanel-tax .search-form,
body.brikpanel-tax .search-form {
    padding: 1rem 1.25rem 0;
}

body.brikpanel-tax .search-form .search-box,
body.brikpanel-tax .search-form .search-box {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    float: none !important;
    margin: 0 !important;
}

body.brikpanel-tax #tag-search-input,
body.brikpanel-tax #tag-search-input {
    padding: 6px 12px !important;
    border: 1px solid var(--bpl-border) !important;
    border-radius: 0.5rem !important;
    font-size: 0.8125rem !important;
    height: auto !important;
    line-height: 1.4 !important;
    width: 200px !important;
}

body.brikpanel-tax #tag-search-input:focus,
body.brikpanel-tax #tag-search-input:focus {
    border-color: var(--bpl-input-focus) !important;
    box-shadow: 0 0 0 1px var(--bpl-input-focus) !important;
    outline: none !important;
}

body.brikpanel-tax #search-submit,
body.brikpanel-tax #search-submit {
    background: var(--bpl-card) !important;
    color: var(--bpl-text) !important;
    border: 1px solid var(--bpl-border) !important;
    border-radius: 0.5rem !important;
    padding: 6px 14px !important;
    font-size: 0.8125rem !important;
    font-weight: 550 !important;
    cursor: pointer !important;
    height: auto !important;
    line-height: 1.4 !important;
    box-shadow: none !important;
}

body.brikpanel-tax #search-submit:hover,
body.brikpanel-tax #search-submit:hover {
    background: var(--bpl-hover-bg) !important;
}

/* ---------- Table ---------- */
body.brikpanel-tax .wp-list-table,
body.brikpanel-tax .wp-list-table,
body.brikpanel-tax .widefat {
    border: none !important;
    margin-top: 0 !important;
}

body.brikpanel-tax .wp-list-table thead,
body.brikpanel-tax .wp-list-table tfoot,
body.brikpanel-tax .wp-list-table thead,
body.brikpanel-tax .wp-list-table tfoot,
body.brikpanel-tax .widefat thead,
body.brikpanel-tax .widefat tfoot {
    background: var(--bpl-hover-bg) !important;
}

body.brikpanel-tax .wp-list-table thead th,
body.brikpanel-tax .wp-list-table tfoot th,
body.brikpanel-tax .wp-list-table thead th,
body.brikpanel-tax .wp-list-table tfoot th,
body.brikpanel-tax .widefat thead th,
body.brikpanel-tax .widefat thead td,
body.brikpanel-tax .widefat tfoot th {
    padding: 0.75rem 1rem !important;
    font-size: 0.75rem !important;
    font-weight: 600 !important;
    color: var(--bpl-text-secondary) !important;
    text-transform: uppercase !important;
    letter-spacing: 0.02em !important;
    border-bottom: 1px solid var(--bpl-border) !important;
    border-top: none !important;
}

body.brikpanel-tax .wp-list-table thead th a,
body.brikpanel-tax .wp-list-table thead th a,
body.brikpanel-tax .widefat thead th a {
    color: var(--bpl-text-secondary) !important;
    font-weight: 600 !important;
    font-size: 0.75rem !important;
}

body.brikpanel-tax .wp-list-table tbody td,
body.brikpanel-tax .wp-list-table tbody td,
body.brikpanel-tax .widefat tbody td,
body.brikpanel-tax .widefat tbody th {
    padding: 0.375rem 1rem !important;
    font-size: 0.8125rem !important;
    color: var(--bpl-text) !important;
    border-top: 1px solid var(--bpl-border) !important;
    border-bottom: none !important;
    vertical-align: middle !important;
    line-height: 1.4 !important;
}

body.brikpanel-tax .wp-list-table tbody tr:hover,
body.brikpanel-tax .wp-list-table tbody tr:hover,
body.brikpanel-tax .widefat tbody tr:hover {
    background: var(--bpl-hover-bg) !important;
}

body.brikpanel-tax .wp-list-table .column-name a,
body.brikpanel-tax .wp-list-table .column-name a {
    font-weight: 550;
    color: var(--bpl-text);
    text-decoration: none;
}

body.brikpanel-tax .wp-list-table .column-name a:hover,
body.brikpanel-tax .wp-list-table .column-name a:hover {
    color: var(--bpl-primary);
}

/* Row actions - collapsed by default, expand to natural content height on hover.
   Uses grid-template-rows 0fr -> 1fr so any number of wrapped action lines fit. */
body.brikpanel-tax .row-actions,
body.brikpanel-tax .row-actions,
body.brikpanel-tax .row-actions {
    display: grid;
    grid-template-rows: 0fr;
    opacity: 0;
    margin: 0 !important;
    padding: 0 !important;
    transition: grid-template-rows 0.25s cubic-bezier(.4,0,.2,1),
                opacity 0.15s,
                padding 0.2s;
}

body.brikpanel-tax .row-actions > .brikpanel-row-actions-inner,
body.brikpanel-tax .row-actions > .brikpanel-row-actions-inner,
body.brikpanel-tax .row-actions > .brikpanel-row-actions-inner {
    overflow: hidden;
    min-height: 0;
}

body.brikpanel-tax tr:hover .row-actions,
body.brikpanel-tax tr:hover .row-actions,
body.brikpanel-tax tr:hover .row-actions {
    grid-template-rows: 1fr;
    opacity: 1;
    padding-top: 0.25rem !important;
}

body.brikpanel-tax .row-actions a,
body.brikpanel-tax .row-actions a,
body.brikpanel-tax .row-actions a {
    font-size: 0.8125rem;
    color: var(--bpl-text-secondary);
}

body.brikpanel-tax .row-actions .delete a,
body.brikpanel-tax .row-actions .delete a,
body.brikpanel-tax .row-actions .delete a {
    color: var(--bpl-error);
}

/* Count badge */
body.brikpanel-tax .wp-list-table .column-posts,
body.brikpanel-tax .wp-list-table .column-posts {
    text-align: center;
}

/* Count column */
body.brikpanel-tax .wp-list-table td.column-posts,
body.brikpanel-tax .wp-list-table td.column-posts {
    text-align: center;
}

body.brikpanel-tax .wp-list-table .column-posts a,
body.brikpanel-tax .wp-list-table .column-posts a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2rem;
    padding: 0.125rem 0.5rem;
    border-radius: 1rem;
    font-size: 0.8125rem;
    font-weight: 550;
    text-decoration: none;
    background: #f0f0f0;
    color: var(--bpl-text-secondary);
    transition: all 0.15s;
}

body.brikpanel-tax .wp-list-table .column-posts a:hover,
body.brikpanel-tax .wp-list-table .column-posts a:hover {
    background: var(--bpl-primary);
    color: #fff;
}

/* Checkbox */
body.brikpanel-tax .wp-list-table .check-column input,
body.brikpanel-tax .wp-list-table .check-column input,
body.brikpanel-tax .widefat .check-column input {
    border-radius: 4px;
    accent-color: var(--bpl-primary);
}

/* Category image column */
body.brikpanel-tax .wp-list-table .column-thumb,
body.brikpanel-tax .wp-list-table .column-thumb {
    width: 40px;
}

body.brikpanel-tax .wp-list-table .column-thumb img,
body.brikpanel-tax .wp-list-table .column-thumb img {
    width: 28px;
    height: 28px;
    border-radius: 0.25rem;
    object-fit: cover;
    border: 1px solid var(--bpl-border);
    display: block;
}

/* Table sizing. Every product taxonomy term screen (Categories, Tags,
   Brands, attribute terms) uses natural auto layout so the table stays
   readable no matter which columns are present. This is deliberately
   resilient to third-party plugins (e.g. Yoast SEO) that inject extra
   columns — a fixed layout tuned for one column set collapses the name
   column the moment another plugin adds its own. */
body.brikpanel-tax .wp-list-table {
    width: 100% !important;
    table-layout: auto !important;
}

/* Keep the description from dominating the row while staying fully
   readable: cap its width and let the text wrap. The category/tag
   enhancement script also sets a native title attribute for the full
   text on hover. */
body.brikpanel-tax .wp-list-table td.column-description {
    max-width: 360px;
    color: var(--bpl-text-secondary);
}

.brikpanel-desc-text {
    display: block;
    white-space: normal;
    overflow-wrap: anywhere;
}

.brikpanel-desc-empty {
    color: var(--bpl-text-muted);
}

/* ---------- Tablenav (Bulk + Pagination) ---------- */
body.brikpanel-tax .tablenav,
body.brikpanel-tax .tablenav,
body.brikpanel-tax .tablenav {
    padding: 0.75rem 1rem !important;
    margin: 0 !important;
    height: auto !important;
}

body.brikpanel-tax .tablenav .bulkactions select,
body.brikpanel-tax .tablenav .bulkactions select {
    padding: 4px 28px 4px 8px !important;
    border: 1px solid var(--bpl-border) !important;
    border-radius: 0.5rem !important;
    font-size: 0.8125rem !important;
    height: auto !important;
    line-height: 1.4 !important;
    background-color: var(--bpl-card) !important;
    color: var(--bpl-text) !important;
}

body.brikpanel-tax .tablenav .button,
body.brikpanel-tax .tablenav .button,
body.brikpanel-tax .tablenav .button {
    background: var(--bpl-card) !important;
    color: var(--bpl-text) !important;
    border: 1px solid var(--bpl-border) !important;
    border-radius: 0.5rem !important;
    padding: 4px 12px !important;
    font-size: 0.8125rem !important;
    font-weight: 550 !important;
    height: auto !important;
    line-height: 1.4 !important;
    box-shadow: none !important;
}

body.brikpanel-tax .tablenav .button:hover,
body.brikpanel-tax .tablenav .button:hover,
body.brikpanel-tax .tablenav .button:hover {
    background: var(--bpl-hover-bg) !important;
}

/* Pagination */
body.brikpanel-tax .tablenav-pages,
body.brikpanel-tax .tablenav-pages {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

body.brikpanel-tax .tablenav-pages .page-numbers,
body.brikpanel-tax .tablenav-pages .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2rem;
    height: 2rem;
    padding: 0 0.375rem;
    border: 1px solid var(--bpl-border);
    border-radius: 0.375rem;
    background: var(--bpl-card);
    color: var(--bpl-text);
    font-size: 0.8125rem;
    text-decoration: none;
}

body.brikpanel-tax .tablenav-pages .current,
body.brikpanel-tax .tablenav-pages .current {
    background: var(--bpl-primary) !important;
    color: #fff !important;
    border-color: var(--bpl-primary) !important;
}

body.brikpanel-tax .tablenav-pages .displaying-num,
body.brikpanel-tax .tablenav-pages .displaying-num {
    font-size: 0.8125rem;
    color: var(--bpl-text-secondary);
    margin-right: 0.5rem;
}

/* ---------- Attributes Page Specific ---------- */
body.brikpanel-tax .wrap {
    max-width: 1200px;
}

body.brikpanel-tax #col-container {
    display: grid !important;
    grid-template-columns: 340px 1fr;
    gap: 1.5rem;
    align-items: start;
}

body.brikpanel-tax #col-left {
    width: 100% !important;
    float: none !important;
    grid-column: 1;
    grid-row: 1;
}

body.brikpanel-tax #col-right {
    width: 100% !important;
    float: none !important;
    grid-column: 2;
    grid-row: 1;
}

body.brikpanel-tax #col-left .col-wrap {
    background: var(--bpl-card);
    border: 1px solid var(--bpl-border);
    border-radius: 0.75rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    padding: 1.25rem 1.5rem;
}

body.brikpanel-tax #col-left .col-wrap > p:first-of-type {
    display: none;
}

body.brikpanel-tax #col-left h2 {
    font-size: 1rem !important;
    font-weight: 600 !important;
    color: var(--bpl-text);
    margin: 0 0 1rem !important;
    padding: 0 !important;
}

body.brikpanel-tax .form-field label {
    font-size: 0.8125rem !important;
    font-weight: 600 !important;
    color: var(--bpl-text) !important;
}

body.brikpanel-tax .form-field p {
    font-size: 0.75rem;
    color: var(--bpl-text-muted);
    margin-top: 0.25rem;
}

body.brikpanel-tax .form-field input[type="text"],
body.brikpanel-tax .form-field select,
body.brikpanel-tax .form-field textarea {
    width: 100% !important;
    padding: 8px 12px !important;
    border: 1px solid var(--bpl-input-border) !important;
    border-radius: 0.5rem !important;
    font-size: 0.875rem !important;
    color: var(--bpl-text) !important;
    background: var(--bpl-card) !important;
    outline: none !important;
    box-shadow: none !important;
    height: auto !important;
    line-height: 1.5 !important;
}

body.brikpanel-tax .form-field input[type="text"]:focus,
body.brikpanel-tax .form-field select:focus {
    border-color: var(--bpl-input-focus) !important;
    box-shadow: 0 0 0 1px var(--bpl-input-focus) !important;
}

/* Attributes table card */
body.brikpanel-tax #col-right .col-wrap {
    background: var(--bpl-card);
    border: 1px solid var(--bpl-border);
    border-radius: 0.75rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    overflow: hidden;
}

body.brikpanel-tax .widefat {
    border-collapse: collapse;
}

body.brikpanel-tax .widefat .column-name a {
    font-weight: 550;
    color: var(--bpl-text);
}

body.brikpanel-tax .widefat .column-name a:hover {
    color: var(--bpl-primary);
}

/* Terms cell - truncate long lists */
body.brikpanel-tax .widefat td.column-terms {
    max-width: 350px;
    max-height: 5.5em;
    overflow: hidden;
    font-size: 0.8125rem;
    color: var(--bpl-text-secondary);
    line-height: 1.5;
    position: relative;
}

body.brikpanel-tax .widefat td.column-terms::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2em;
    background: linear-gradient(transparent, var(--bpl-card));
    pointer-events: none;
}

/* Configure terms link */
body.brikpanel-tax .widefat .column-terms a[href*="edit-tags"] {
    display: inline-flex;
    margin-top: 0.25rem;
    font-size: 0.75rem;
    font-weight: 550;
    color: var(--bpl-primary);
    text-decoration: none;
}

body.brikpanel-tax .widefat .column-terms a[href*="edit-tags"]:hover {
    text-decoration: underline;
}

/* ---------- Alternate row colors ---------- */
body.brikpanel-tax .wp-list-table .alternate,
body.brikpanel-tax .wp-list-table .alternate,
body.brikpanel-tax .widefat .alternate {
    background: transparent !important;
}

/* ---------- Note at bottom ---------- */
body.brikpanel-tax .form-wrap > p,
body.brikpanel-tax .form-wrap > p {
    font-size: 0.75rem;
    color: var(--bpl-text-muted);
    padding: 0.75rem 1rem;
}

/* ---------- Inline Quick Edit ---------- */
body.brikpanel-tax .inline-edit-row,
body.brikpanel-tax .inline-edit-row {
    background: var(--bpl-card) !important;
}

body.brikpanel-tax .inline-edit-row input[type="text"],
body.brikpanel-tax .inline-edit-row input[type="text"] {
    padding: 6px 10px !important;
    border: 1px solid var(--bpl-input-border) !important;
    border-radius: 0.5rem !important;
    font-size: 0.875rem !important;
    height: auto !important;
    line-height: 1.4 !important;
}

body.brikpanel-tax .inline-edit-row .button,
body.brikpanel-tax .inline-edit-row .button {
    border-radius: 0.5rem !important;
}

/* ---------- Responsive ---------- */
@media screen and (max-width: 960px) {
    body.brikpanel-tax #col-container,
    body.brikpanel-tax #col-container,
    body.brikpanel-tax #col-container {
        grid-template-columns: 1fr !important;
    }
}

/* ---------- Sorting indicators ---------- */
body.brikpanel-tax .wp-list-table .sortable .sorting-indicators,
body.brikpanel-tax .wp-list-table .sortable .sorting-indicators {
    opacity: 0;
    transition: opacity 0.15s;
}

body.brikpanel-tax .wp-list-table .sortable:hover .sorting-indicators,
body.brikpanel-tax .wp-list-table .sortable:hover .sorting-indicators {
    opacity: 1;
}

/* ---------- WooCommerce category image upload ---------- */
body.brikpanel-tax .form-field img {
    border-radius: 0.5rem;
    border: 1px solid var(--bpl-border);
}

body.brikpanel-tax .form-field .button:not(.button-primary) {
    background: var(--bpl-card) !important;
    color: var(--bpl-text) !important;
    border: 1px solid var(--bpl-border) !important;
    border-radius: 0.5rem !important;
    padding: 6px 14px !important;
    font-size: 0.8125rem !important;
    font-weight: 550 !important;
    height: auto !important;
    line-height: 1.4 !important;
    box-shadow: none !important;
}

body.brikpanel-tax .form-field .button:not(.button-primary):hover {
    background: var(--bpl-hover-bg) !important;
}

/* ==========================================================================
   Category Header (JS-repositioned search)
   ========================================================================== */

.brikpanel-cat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    padding: 1.25rem 0 0.75rem;
}

.brikpanel-cat-header h1 {
    padding: 0 !important;
    margin: 0 !important;
}

.brikpanel-cat-header form.search-form {
    padding: 0 !important;
    margin: 0 !important;
}

.brikpanel-cat-header .search-box {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0 !important;
    padding: 0 !important;
    float: none !important;
    position: static !important;
}

.brikpanel-cat-header #tag-search-input {
    padding: 8px 12px !important;
    border: 1px solid var(--bpl-border) !important;
    border-radius: 0.5rem !important;
    font-size: 0.8125rem !important;
    height: auto !important;
    line-height: 1.4 !important;
    width: 200px !important;
    outline: none !important;
    box-shadow: none !important;
}

.brikpanel-cat-header #tag-search-input:focus {
    border-color: var(--bpl-input-focus) !important;
    box-shadow: 0 0 0 1px var(--bpl-input-focus) !important;
}

.brikpanel-cat-header #search-submit {
    background: var(--bpl-card) !important;
    color: var(--bpl-text) !important;
    border: 1px solid var(--bpl-border) !important;
    border-radius: 0.5rem !important;
    padding: 8px 16px !important;
    font-size: 0.8125rem !important;
    font-weight: 550 !important;
    cursor: pointer !important;
    height: auto !important;
    line-height: 1.4 !important;
    box-shadow: none !important;
}

.brikpanel-cat-header #search-submit:hover {
    background: var(--bpl-hover-bg) !important;
}

/* Hide original search form (JS moves content out) */
body.brikpanel-tax form.search-form:empty,
body.brikpanel-tax form.search-form:empty {
    display: none;
}

/* ==========================================================================
   Drag & Drop Category Nesting
   ========================================================================== */

/* Drag handle */
.brikpanel-cat-drag-handle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.5rem;
    height: 1.5rem;
    margin-right: 0.375rem;
    cursor: grab;
    color: var(--bpl-text-muted);
    font-size: 0.875rem;
    border-radius: 0.25rem;
    transition: all 0.15s;
    vertical-align: middle;
    user-select: none;
    opacity: 0;
}

tr:hover .brikpanel-cat-drag-handle {
    opacity: 1;
}

.brikpanel-cat-drag-handle:hover {
    background: var(--bpl-border);
    color: var(--bpl-text);
}

.brikpanel-cat-drag-handle:active {
    cursor: grabbing;
}

/* Row being dragged */
.brikpanel-cat-dragging {
    opacity: 0.4;
}

/* Drop target highlight */
.brikpanel-cat-drop-target {
    background: #e8f0fe !important;
    box-shadow: inset 0 0 0 2px #4a6cf7 !important;
}

.brikpanel-cat-drop-target td {
    background: transparent !important;
}

/* Row saving state */
.brikpanel-cat-saving {
    opacity: 0.5;
    pointer-events: none;
}

/* "Make top level" action link */
.brikpanel-toplevel a {
    color: var(--bpl-text-secondary) !important;
}

.brikpanel-toplevel a:hover {
    color: var(--bpl-primary) !important;
}

/* ==========================================================================
   Toast for category operations
   ========================================================================== */

.brikpanel-cat-toast-container {
    position: fixed;
    top: 44px;
    right: 20px;
    z-index: 999999;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    pointer-events: none;
}

.brikpanel-cat-toast {
    padding: 0.625rem 1rem;
    border-radius: 0.5rem;
    font-size: 0.8125rem;
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
    transform: translateX(110%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: auto;
    max-width: 360px;
}

.brikpanel-cat-toast.show {
    transform: translateX(0);
}

.brikpanel-cat-toast.success {
    background: #e4f5e1;
    color: #1a6b15;
    border: 1px solid #b7e1b0;
}

.brikpanel-cat-toast.error {
    background: #fce4e4;
    color: #c62828;
    border: 1px solid #f1b0b0;
}
