/* Admin Styles for Tinx B2B Pricing - WooCommerce Style */

/* Original bulk discount table styles */
.bulk-discount-table table, .bulk-discount-table td, .bulk-discount-table th  {
border: 1px solid;
text-align: center;
}

.bulk-discount-table table {
border-collapse: collapse;
}

.bulk-discount-table th, .bulk-discount-table td {
    padding-left: 1rem;
    padding-right: 1rem;
}

/* Main Admin Container */
.tinx-b2b-admin-wrap {
    margin: 0;
    max-width: none;
}

/* Fixed Header */
.tinx-b2b-header {
    position: fixed;
    top: 32px;
    background: #fff;
    z-index: 100;
    padding: 0;
    width: 100%;
    margin-left: -20px;
    margin-right: 0;
    padding-left: 20px;
    padding-right: 20px;
    border-bottom: 1px solid #ddd;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.tinx-b2b-header-inner {
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.tinx-b2b-header h1 {
    font-size: 23px;
    font-weight: 400;
    margin: 0;
    padding: 0;
    line-height: 1.3;
    color: #1d2327;
}

.tinx-b2b-navigation {
    margin-top: 20px;
    position: relative;
    z-index: 10;
}

/* WooCommerce-style Tabs */
.tinx-b2b-nav-tab-wrapper {
    margin: 0 0 0 -20px;
    padding: 0 20px;
    width: 100%;
    box-sizing: border-box;
    border-bottom: 1px solid #C3C4C7;
    display: flex;
}

.tinx-b2b-nav-tab {
    float: left;
    border: 1px solid #C3C4C7;
    margin-left: 0.5em;
    margin-bottom: -1px;
    padding: 10px 15px;
    font-size: 14px;
    font-weight: 500;
    background: #DCDCDE;
    color: #2c3338;
    text-decoration: none;
    white-space: nowrap;
    border-top-left-radius: 4px;
    border-top-right-radius: 4px;
}

.tinx-b2b-nav-tab:first-child {
    margin-left: 3px;
}

.tinx-b2b-nav-tab:hover {
    background-color: transparent;
    color: #2271b1;
    border-bottom: 2px solid #F0F0F1;
}

.tinx-b2b-nav-tab-active {
    background: transparent;
    color: #2271b1;
    border-bottom: 2px solid #F0F0F1;
}

/* Sub Navigation Tabs */
.tinx-b2b-sub-nav {
    background: #f0f0f1;
    margin-left: -20px;
    margin-right: -20px;
    padding: 0 20px;
    display: flex;
    margin-bottom: 20px;
}

.tinx-b2b-sub-nav a {
    padding-left: 10px;
    padding-right: 10px;
    color: #2271b1;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    border-right: 1px solid #646970;
}

.tinx-b2b-sub-nav a:first-child {
    padding-left: 0;
}

.tinx-b2b-sub-nav a:last-child {
    border-right: 1px solid transparent;
}

.tinx-b2b-sub-nav a:hover {
    color: #2c3338;
}

.tinx-b2b-sub-nav a.active {
    color: #2c3338;
}

/* Tab Panels */
.tinx-b2b-tab-panel {
    display: none;
    padding: 20px 0;
    padding-bottom: 0;
}

.tinx-b2b-tab-panel.active {
    display: flex;
    flex-direction: column;
}

.tinx-b2b-sub-panel {
    display: none;
}

.tinx-b2b-sub-panel.active {
    display: block;
}

/* Settings Sections */
.tinx-b2b-settings-wrapper {
    margin-top: 0;
    max-width: none;
    padding-right: 20px;
    padding-left: 5px;
}

.tinx-b2b-settings-form {
    margin-top: 0;
    max-width: none;
}

.tinx-b2b-settings-section {
    width: 100%;
}

.tinx-b2b-settings-section h2 {
    border-bottom: 1px solid #eee;
    margin-top: 0;
    margin-bottom: 0;
    padding-bottom: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1.3em;
    line-height: 1.4;
    font-weight: 600;
    color: #1d2327;
}

.tinx-b2b-settings-section .form-table th {
    padding: 15px 10px 15px 0;
    width: 250px;
    font-weight: 600;
    position: relative;
}

.tinx-b2b-settings-section .form-table td {
    padding: 15px 10px;
    display: block;
}

.tinx-b2b-settings-section .form-table td p:first-child {
    margin-top: 0;
}

.tinx-b2b-settings-section .form-table {
    background: transparent;
    padding: 0;
    border: none;
    box-shadow: none;
    margin-top: 0;
}

.tinx-b2b-prerequisites-box {
    background: #f0f6fc;
    border-left: 4px solid #2271b1;
    margin-bottom: 20px;
    padding: 12px;
}

/* WooCommerce-style Tooltips */
.woocommerce-help-tip {
    color: #666;
    display: inline-block;
    font-size: 1.1em;
    font-style: normal;
    height: 16px;
    line-height: 16px;
    position: relative;
    vertical-align: middle;
    width: 16px;
    cursor: help;
    right: -1%;
    top: 32%;
    position: absolute;
}

.woocommerce-help-tip::after {
    font-family: Dashicons;
    speak: never;
    font-weight: 400;
    font-variant: normal;
    text-transform: none;
    line-height: 1;
    -webkit-font-smoothing: antialiased;
    content: "\f223";
}

/* Custom tooltip implementation */
.tinx-tooltip {
    position: absolute;
    z-index: 9999;
    padding: 8px 12px;
    max-width: unset;
    background-color: #333;
    color: #fff;
    border-radius: 3px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
    font-size: 12px;
    line-height: 1.4;
    text-align: center;
    display: none;
    overflow-wrap: break-word;
    width: 250px;
}

/* Toggle functionality */
.section-toggle {
    float: right;
    cursor: pointer;
    color: #2271b1;
    margin-top: 5px;
    display: inline-block;
    padding: 5px;
    z-index: 10;
    position: relative;
}

.section-toggle::before {
    content: "\f142";
    font-family: dashicons;
    vertical-align: middle;
}

.section-toggle.collapsed::before {
    content: "\f140";
}

.section-content {
    display: block;
    transition: height 0.3s ease;
}

.section-content.collapsed {
    display: none;
}

/* Clickable heading styles */
.clickable-heading {
    cursor: pointer;
    position: relative;
    user-select: none;
}

.clickable-heading:hover {
    color: #2271b1;
}

/* List tables */
.tinx-b2b-list-table {
    margin-top: 15px;
    border-collapse: collapse;
    width: 100%;
}

.tinx-b2b-list-table th {
    text-align: left;
    padding: 10px;
    background: #f0f0f1;
    font-weight: 500;
}

.tinx-b2b-list-table td {
    padding: 8px 10px;
    vertical-align: middle;
    border-bottom: 1px solid #f0f0f1;
}

.tinx-b2b-list-table tr:hover {
    background-color: #f7fcfe;
}

/* List table wrapper styles */
.tinx-b2b-list-table-wrapper {
    margin-top: 0px;
}
/* List table wrapper styles */
.tinx-b2b-list-table-wrapper .tablenav.top .tablenav-pages {
    float: right;
    display: none;
}

.tablenav.bottom {
    margin: 15px 0;
}

.tablenav br {display: none;}

.tinx-b2b-list-table-wrapper .wp-list-table {
    background: #fff;
    border: 1px solid #c3c4c7;
    box-shadow: 0 1px 1px rgba(0,0,0,.04);
    width: 100%;
    min-width: max-content;
    table-layout: fixed;
}

.tinx-b2b-list-table-wrapper .wp-list-table th {
    border-bottom: 0px solid #c3c4c7;
    padding: 10px;
    font-weight: 600;
}

.tinx-b2b-list-table-wrapper .wp-list-table tbody th {
    vertical-align: middle;
    padding-top: 0 !important;
}

.tinx-b2b-list-table-wrapper .wp-list-table td {
    padding: 10px;
    border-bottom: 0px solid #f0f0f1;
}

.tinx-b2b-list-table-wrapper .wp-list-table tr:hover {
    background-color: #f7fcfe;
}

/* Search Functionality */
.tinx-b2b-admin-search-container {
    position: relative;
    margin: 15px 0;
    max-width: 300px;
}

.tinx-b2b-admin-search-input {
    width: 100%;
    padding: 6px 30px 6px 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.tinx-b2b-admin-search-clear {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #777;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
}

.tinx-b2b-admin-search-clear:hover {
    color: #d63638;
}

/* Search box improvements */
.tinx-b2b-admin-search-container .search-box {
    margin: 0;
    padding: 0;
    float: none;
    display: inline-block;
}

.tinx-b2b-admin-search-container .search-box input[type="search"] {
    width: 250px;
    padding: 6px 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-right: 8px;
}

.tinx-b2b-admin-search-container .search-box input[type="submit"] {
    padding: 6px 12px;
    background: #2271b1;
    color: #fff;
    border: 1px solid #2271b1;
    border-radius: 4px;
    cursor: pointer;
}

.tinx-b2b-admin-search-container .search-box input[type="submit"]:hover {
    background: #135e96;
    border-color: #135e96;
}

/* No Results Message */
.tinx-b2b-admin-no-results {
    padding: 10px;
    background-color: #f8f8f8;
    border: 1px solid #ddd;
    margin-top: 10px;
    font-style: italic;
    display: none;
}

/* Required field indicator */
.required {
    color: #d63638;
    font-weight: bold;
}

/* Success/Error Messages */
.tinx-b2b-success {
    color: #2e7d32;
    font-weight: bold;
    padding: 5px 0;
}

.tinx-b2b-error {
    color: #d32f2f;
    font-weight: bold;
    padding: 5px 0;
}

.tinx-b2b-neutral {
    color: #666;
    font-weight: bold;
    padding: 5px 0;
}

/* List table wrapper styles */
.tinx-b2b-list-table-wrapper {
    margin-top: 0px;
}

.tinx-b2b-list-table-wrapper .wp-list-table {
    background: #fff;
    border: 1px solid #c3c4c7;
    box-shadow: 0 1px 1px rgba(0,0,0,.04);
}

.tinx-b2b-list-table-wrapper .wp-list-table th {
    border-bottom: 0px solid #c3c4c7;
    padding: 10px;
    font-weight: 600;
    min-width: 200px;
}

.tinx-b2b-list-table-wrapper .wp-list-table td {
    padding: 10px;
    border-bottom: 2px solid #f0f0f1;
}

.tinx-b2b-list-table-wrapper .wp-list-table tr:hover {
    background-color: #f7fcfe;
}

/* Search box improvements */
.tinx-b2b-admin-search-container .search-box {
    margin: 0;
    padding: 0;
    float: none;
    display: inline-block;
}

.tinx-b2b-admin-search-container .search-box input[type="search"] {
    width: 250px;
    padding: 6px 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-right: 8px;
}

.tinx-b2b-admin-search-container .search-box input[type="submit"] {
    padding: 6px 12px;
    background: #2271b1;
    color: #fff;
    border: 1px solid #2271b1;
    border-radius: 4px;
    cursor: pointer;
}

.tinx-b2b-admin-search-container .search-box input[type="submit"]:hover {
    background: #135e96;
    border-color: #135e96;
}

/* Add New button in header */
.tinx-b2b-header-inner .button-primary {
    background: #2271b1;
    border-color: #2271b1;
    color: #fff;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 4px;
    font-weight: 500;
}

.tinx-b2b-header-inner .button-primary:hover {
    background: #135e96;
    border-color: #135e96;
}

/* Form styling improvements */
.tinx-b2b-settings-form .regular-text {
    border: 1px solid #ddd;
    border-radius: 4px;
}

.tinx-b2b-settings-form .small-text {
    width: 80px;
    padding: 6px 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.tinx-b2b-list-table-wrapper .perpage{
    display: flex;
    align-items: center;
    gap: 10px;
    float: right;
}

.tinx-b2b-list-table-wrapper .perpage select {
    padding: 0px 8px;
    margin-right: 0;
}

/* Ensure proper alignment for tablenav items */
.tablenav .alignright.actions.perpage {
    float: right;
    margin-left: auto;
    padding-right: 0;
}

.tablenav .alignleft.actions {
    float: left;
}

.tinx-b2b-settings-form select {
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #fff;
    max-width: unset;

}

.tinx-b2b-settings-form input[type="checkbox"] {
    margin-right: 8px;
}

.tinx-b2b-settings-form .description {
    color: #666;
    font-style: italic;
    margin-top: 5px;
}

/* Form Actions */
.tinx-b2b-form-actions {
    margin-top: 20px;
    border-radius: 4px;
    display: flex;
    gap: 10px;
    align-items: center;
}

.tinx-b2b-form-actions .button {
    margin: 0;
}

.tinx-b2b-form-actions .button-primary {
    min-width: 150px;
}

/* List Page Enhancements */
.tinx-b2b-header-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    justify-content: end;
}

.tinx-b2b-header-actions a.button {
    border-top-left-radius: 0;
    border-top-right-radius: 0;
    margin-right: 12px;
} 

.tinx-b2b-list-actions {
    display: flex;
    gap: 15px;
    align-items: center;
    margin-bottom: 8px;
    padding: 0;
    border-radius: 4px;
    justify-content: space-between;
}

.tinx-b2b-search-and-filter {
width: 100%;
}

.tinx-b2b-search-wrapper {
    flex: 1;
    display: flex;
    justify-content: start;
    gap: 15px;
}

.tinx-b2b-search-wrapper .search-box {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
}

.tinx-b2b-search-wrapper input[type="search"] {
    padding: 6px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    min-width: 350px;
}

.tinx-b2b-filter-wrapper {
    flex: 0 0 auto;
}

.tinx-b2b-filter-wrapper select {
    padding: 6px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    min-width: 180px;
}

.tinx-b2b-bulk-actions {
    flex: 0 0 auto;
    display: flex;
    gap: 8px;
}

.tinx-b2b-list-table-wrapper {
    border-radius: 4px;
    /* overflow-y: hidden;
    overflow-x: auto; */
    width: 100%;
}
.tinx-b2b-list-table-wrapper .tablenav{
    margin-bottom: 0px;
}

.tinx-b2b-list-table-wrapper .wp-list-table {
    border: none;
    box-shadow: none;
    margin-top: 15px;
    table-layout: fixed;
}

.tinx-b2b-list-table-wrapper .wp-list-table thead th {
    background: #FFFFFF;
    border-bottom: 2px solid #e1e1e1;
    padding: 12px;
    font-weight: 600;
    min-width: 200px;
}

.check-column label {
    background: white;
}

/* Sticky header classes for JavaScript control */
.tinx-b2b-list-table-wrapper .wp-list-table thead.tinx-sticky {
    position: fixed !important;
    top: 103px; /* Admin bar + header height */
    z-index: 1000;
    left: 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    /* Width will be set dynamically by JavaScript to match table width */
}

.tinx-b2b-list-table-wrapper .wp-list-table thead.tinx-sticky th {
    background: #FFFFFF;
    border-bottom: 2px solid #e1e1e1;
    /* Maintain original column widths */
    box-sizing: border-box;
}

/* Placeholder to maintain table layout when header becomes fixed */
.tinx-b2b-list-table-wrapper .tinx-header-placeholder {
    display: none;
    height: 0;
}

.tinx-b2b-list-table-wrapper .tinx-header-placeholder.active {
    display: table-header-group;
}

.tinx-b2b-list-table-wrapper .wp-list-table tbody td {
    padding: 12px;
    vertical-align: middle;
    border-bottom: 1px solid #f0f0f0;
}

.tinx-b2b-list-table-wrapper .wp-list-table tbody tr:hover {
    background: #f9f9f9;
}

.tinx-b2b-list-table-wrapper .wp-list-table .column-actions {
    text-align: right;
}

.tinx-b2b-list-table-wrapper .wp-list-table .column-actions .row-actions {
    position: relative;
    left: 0;
    visibility: visible;
}

.tinx-b2b-list-table-wrapper .wp-list-table tbody tr .row-actions {
    display: none;
}

.tinx-b2b-list-table-wrapper .wp-list-table tbody tr:hover .row-actions {
    display: none;
    position: relative;
    left: 0;
    visibility: visible;
    /* display: flow; */
}

/* Column-specific styles */
.tinx-b2b-list-table-wrapper .wp-list-table th.column-id,
.tinx-b2b-list-table-wrapper .wp-list-table td.column-id {
    width: 120px;
}
/* Column-specific styles
.tinx-b2b-list-table-wrapper .wp-list-table th.column-min_qty,
.tinx-b2b-list-table-wrapper .wp-list-table td.column-min_qty {
    width: 100px;
}
/* Column-specific styles */
/* .tinx-b2b-list-table-wrapper .wp-list-table th.column-sku,
.tinx-b2b-list-table-wrapper .wp-list-table td.column-sku { */
    /* width: 100px; */
/* } */
/* Column-specific styles */
/* .tinx-b2b-list-table-wrapper .wp-list-table th.column-unit_price, */
/* .tinx-b2b-list-table-wrapper .wp-list-table td.column-unit_price { */
    /* width: 100px; */
/* } */
/* Column-specific styles */
/* .tinx-b2b-list-table-wrapper .wp-list-table th.column-start_date, */
/* .tinx-b2b-list-table-wrapper .wp-list-table td.column-start_date { */
    /* width: 100px; */
/* } */
/* Column-specific styles */
/* .tinx-b2b-list-table-wrapper .wp-list-table th.column-end_date, */
/* .tinx-b2b-list-table-wrapper .wp-list-table td.column-end_date { */
    /* width: 100px; */
/* } */
/* Column-specific styles */
/* .tinx-b2b-list-table-wrapper .wp-list-table th.column-allow_discount, */
/* .tinx-b2b-list-table-wrapper .wp-list-table td.column-allow_discount { */
    /* width: 100px; */
/* } */
/* Column-specific styles */
/* .tinx-b2b-list-table-wrapper .wp-list-table th.column-price_reference, */
/* .tinx-b2b-list-table-wrapper .wp-list-table td.column-price_reference { */
    /* width: 150px; */
/* } */
/* Column-specific styles */
/* .tinx-b2b-list-table-wrapper .wp-list-table th.column-apply_price_to, */
/* .tinx-b2b-list-table-wrapper .wp-list-table td.column-apply_price_to { */
    /* width: 200px; */
/* } */
/* Column-specific styles */
/* .tinx-b2b-list-table-wrapper .wp-list-table th.column-last_updated_at, */
/* .tinx-b2b-list-table-wrapper .wp-list-table td.column-last_updated_at { */
    /* width: 150px; */
/* } */

.tinx-b2b-list-table-wrapper th.sortable a, .tinx-b2b-list-table-wrapper th.sorted a {
    padding: 0;
}

/* Debug Log Styling */
.tinx-debug-logs {
    max-height: 400px;
    overflow-y: auto;
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 10px;
    font-family: monospace;
    font-size: 12px;
}

.log-entry {
    padding: 5px 0;
    border-bottom: 1px solid #eee;
    display: flex;
    gap: 10px;
}

.log-entry:last-child {
    border-bottom: none;
}

.log-timestamp {
    color: #666;
    white-space: nowrap;
}

.log-level {
    font-weight: bold;
    min-width: 50px;
}

.log-info .log-level {
    color: #0073aa;
}

.log-warning .log-level {
    color: #dba617;
}

.log-error .log-level {
    color: #d63638;
}

.log-message {
    flex: 1;
    word-break: break-word;
}

.tinx-b2b-debug-box {
    margin-top: 30px;
    margin-bottom: 30px;
    padding: 20px;
    background: #fff;
    border: 1px solid #e1e1e1;
    border-radius: 4px;
}

.tinx-b2b-debug-box h2 {
    margin-top: 0;
    padding-bottom: 10px;
    border-bottom: 1px solid #e1e1e1;
}

.tinx-b2b-log-container {
    margin: 15px 0;
    min-height: 100px;
}

/* Form Actions */
.tinx-b2b-form-actions {
    margin-top: 20px;
    border-radius: 4px;
    display: flex;
    gap: 10px;
    align-items: center;
}

.tinx-b2b-form-actions .button {
    margin: 0;
}

.tinx-b2b-form-actions .button-primary {
    min-width: 150px;
}

/* Responsive adjustments for list pages */
@media (max-width: 768px) {
    .tinx-b2b-list-actions {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    
    .tinx-b2b-search-wrapper,
    .tinx-b2b-filter-wrapper {
        max-width: none;
        flex: 1;
    }
    
    .tinx-b2b-search-wrapper input[type="search"],
    .tinx-b2b-filter-wrapper select {
        width: 100%;
        min-width: 0;
    }
    
    .tinx-b2b-bulk-actions {
        justify-content: center;
    }
    
    .tinx-b2b-form-actions {
        flex-direction: column;
        align-items: stretch;
    }
    
    .tinx-b2b-form-actions .button {
        width: 100%;
    }
}

.toplevel_page_tinx-b2b-pricing #screen-meta-links, 
.tinx-b2b-pricing_page_tinx-b2b-sales-discount #screen-meta-links,
.tinx-b2b-pricing_page_tinx-b2b-sales-price #screen-meta-links {
/* margin-top: 70px; */
position: relative;
z-index: 1;
}
.toplevel_page_tinx-b2b-pricing #screen-meta,
.tinx-b2b-pricing_page_tinx-b2b-sales-discount #screen-meta,
.tinx-b2b-pricing_page_tinx-b2b-sales-price #screen-meta {
/* margin-top: 70px; */
width: calc(100%);
/* margin-left: -20px; */
z-index: 100;
}

.toplevel_page_tinx-b2b-pricing #screen-meta-links:has(button.screen-meta-active), 
.tinx-b2b-pricing_page_tinx-b2b-sales-discount #screen-meta-links:has(button.screen-meta-active), 
.tinx-b2b-pricing_page_tinx-b2b-sales-price #screen-meta-links:has(button.screen-meta-active) 
{
margin-top: 0px;
}

.toplevel_page_tinx-b2b-pricing #contextual-help-back, 
.tinx-b2b-pricing_page_tinx-b2b-sales-discount #contextual-help-back, 
.tinx-b2b-pricing_page_tinx-b2b-sales-price #contextual-help-back {
right: 350px;
}

.toplevel_page_tinx-b2b-pricing #contextual-help-wrap,
.tinx-b2b-pricing_page_tinx-b2b-sales-discount #contextual-help-wrap,
.tinx-b2b-pricing_page_tinx-b2b-sales-price #contextual-help-wrap {
padding: 20px 0;
}

.contextual-help-sidebar {
margin-top: 1rem;
width: 310px;
padding: 0 15px;
}

.contextual-help-sidebar button {
margin-top: 5% !important;
}

.contextual-help-sidebar a {
text-decoration: none;
}

.logo__tagline {
font-family: "Outfit", sans-serif;
color: #16004D;
font-weight: 600;
font-size: 16px;
line-height: 1;
margin-bottom: 3px;
text-decoration: none;
}

@media (min-width: 641px) { 
.logo__tagline {
    font-size: 18px;
    margin-bottom: -2px;
    margin-left: 2rem;
}
}

#wpadminbar {
position: fixed;
}

/* Field management tables */
.tinx-b2b-settings-section .tinx-b2b-field-table {
    margin-top: 15px;
    border-collapse: collapse;
    width: 25%;
    min-width: 450px;
}

.tinx-b2b-settings-section .tinx-b2b-field-table th {
    text-align: left;
    padding: 10px;
    background: #f0f0f1;
    font-weight: 500;
}

.tinx-b2b-settings-section .tinx-b2b-field-table td {
    padding: 8px 10px;
    vertical-align: middle;
    border-bottom: 1px solid #f0f0f1;
}

.tinx-b2b-settings-section .tinx-b2b-field-table tr:hover {
    background-color: #f7fcfe;
}

.tinx-b2b-settings-section .tinx-b2b-field-table .field-name {
    width: 30%;
    padding-right: 65px;
    position: relative;
}

.tinx-b2b-settings-section .tinx-b2b-field-table .field-label {
    width: 45%;
}

.tinx-b2b-settings-section .tinx-b2b-field-table .field-overview,
.tinx-b2b-settings-section .tinx-b2b-field-table .field-detail {
    width: 15%;
    text-align: center;
}

#wpbody-content {
    padding-top: 70.5px;
}

/* Advanced Filter Dropdown - WooCommerce Style */

/* Advanced Filter Toggle Button */
.tinx-b2b-filter-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 6px 12px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    position: relative;
}

.tinx-b2b-filter-toggle:hover {
    background: #f6f7f7;
    border-color: #999;
}

.tinx-b2b-filter-toggle:focus {
    outline: none;
    border-color: #2271b1;
    box-shadow: 0 0 0 1px #2271b1;
}

.tinx-b2b-filter-toggle.active {
    background: #f0f6fc;
    color: #2271b1;
    border-color: #2271b1;
}

.tinx-b2b-filter-toggle.has-filters {
    background: #f0f6fc;
    color: #2271b1;
    border-color: #2271b1;
}

.tinx-b2b-filter-toggle.has-filters:hover {
    background: #e7f3ff;
    border-color: #135e96;
    color: #135e96;
}

/* Advanced Filter Section - Full Width Below Bulk Actions */
.tinx-b2b-advanced-filters-section {
    width: 100%;
    margin: 15px 0;
    clear: both;
    display: none;
    box-sizing: border-box;
    position: relative;
    z-index: 10;
}

/* When positioned after tablenav, add top margin for spacing */
.tablenav.top + .tinx-b2b-advanced-filters-section {
    margin-top: 15px;
}

.tinx-b2b-advanced-filters-section.show {
    display: block;
}

.components-card.woocommerce-filters-advanced {
    background: #F0F0F0;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-shadow: 0 2px 6px #0000001a;
    width: 100%;
}

.components-card__header {
    padding: 16px 20px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    border-top-color: rgba(0, 0, 0, 0.1);
    border-right-color: rgba(0, 0, 0, 0.1);
    border-left-color: rgba(0, 0, 0, 0.1);
    background: #FFFFFF;
}

.woocommerce-filters-advanced__title {
    font-size: 14px;
    font-weight: 600;
    color: #2c3338;
    display: flex;
    align-items: center;
    gap: 8px;
}

.woocommerce-filters-advanced__title-select {
    padding: 4px 8px;
    border: 1px solid #ddd;
    border-radius: 3px;
    font-size: 13px;
    background: #fff;
    min-width: 60px;
}

.components-card__body {
    /* padding: 16px 20px; */
}

.woocommerce-filters-advanced__filters {
    /* margin-bottom: 16px;
    min-height: 20px; */
}

.woocommerce-filters-advanced__add-filter {
    position: relative;
    padding: 16px 16px 16px 20px;
}

.woocommerce-filters-advanced__add-button {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: transparent !important;
    border: none !important;
    border-radius: 3px;
    color: #757575 !important;
    cursor: pointer;
    font-size: 13px;
    text-decoration: none;
    padding-left: unset !important;
}

#apply-filters-btn:disabled {
        background: #2271b1 !important;
    border-color: #2271b1 !important;
    color: #7BB1D6 !important;
    cursor: not-allowed !important;
}

#clear-filters-btn {
    background: unset;
    color: #2371B1 !important;
    text-decoration: underline;
    border: unset;
}

.woocommerce-filters-advanced__add-button:hover {
    color: #2371B1 !important;
}

.woocommerce-filters-advanced__add-button svg {
    width: 24px;
    height: 24px;
    fill: #757575;
}

.woocommerce-filters-advanced__add-button:hover svg { 
    fill: #2371B1;
}


.add-filter-options {
    position: absolute;
    top: 100%;
    left: 0;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 3px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    z-index: 1001;
    min-width: 200px;
    max-height: 300px;
    overflow-y: auto;
}

.add-filter-option {
    padding: 8px 12px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f1;
    font-size: 13px;
}

.add-filter-option:hover {
    background: #f6f7f7;
}

.add-filter-option:last-child {
    border-bottom: none;
}

.components-card__footer {
    padding: 12px 20px;
    border-top: 1px solid #e5e5e5;
    background: #f9f9f9;
    display: flex;
    justify-content: flex-start;
    gap: 8px;
}

.woocommerce-filters-advanced__controls {
    display: flex;
    gap: 8px;
}

.components-button {
    padding: 6px 12px;
    border: 1px solid #ddd;
    border-radius: 3px;
    background: #f6f7f7;
    color: #2c3338;
    cursor: pointer;
    font-size: 13px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    line-height: 1.4;
}

.components-button:hover {
    background: #f0f0f1;
    border-color: #999;
}

.components-button.is-primary {
    background: #2271b1;
    border-color: #2271b1;
    color: #fff;
}

.components-button.is-primary:hover {
    background: #135e96;
    border-color: #135e96;
}

.components-button:disabled {
    background: #f6f7f7;
    border-color: #ddd;
    color: #a7aaad;
    cursor: not-allowed;
}

/* Individual filter row styles */
.woocommerce-filter-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 8px 8px 16px;
    border-bottom: 1px solid #cccccc;
}


.woocommerce-filter-column {
    /* min-width: 120px; */
    font-size: 13px;
    font-weight: 500;
    color: #2c3338;
}

.tinx-b2b-settings-form .woocommerce-filter-operator,
.tinx-b2b-settings-form .woocommerce-filter-value {
    min-height: 36px;
    padding: 5px 24px 5px 8px;
    max-width: fit-content;
}

.woocommerce-filter-operator {
    padding: 4px 8px;
    border: 1px solid #ddd;
    border-radius: 3px;
    font-size: 12px;
    background: #fff;
    min-width: 80px;
}

.woocommerce-filter-value {
    flex: 1;
    padding: 6px 8px;
    border: 1px solid #ddd;
    border-radius: 3px;
    font-size: 13px;
}

.woocommerce-filter-remove {
    margin-left: auto;
    color: #757575;
    cursor: pointer;
    border: unset;
    background: transparent;
}

.woocommerce-filter-remove svg{
    fill: #757575;
}   

.woocommerce-filter-remove:hover {
    background: #f0f0f1;
    border-color: #d63638;
}

/* Between filter styling */
.woocommerce-filter-between {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
}

.woocommerce-filter-between .woocommerce-filter-value {
    flex: 1;
    min-width: 80px;
}

.woocommerce-filter-between .between-separator {
    font-size: 12px;
    color: #646970;
    font-weight: 500;
    white-space: nowrap;
}

/* Price input styling with currency symbol */
.price-input-wrapper {
    position: relative;
    display: inline-block;
}

.price-input-wrapper .currency-symbol {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: #646970;
    font-weight: 500;
    z-index: 2;
    pointer-events: none;
    font-size: 13px;
}

/* Left positioned currency symbol (default) */
.price-input-wrapper .currency-symbol {
    left: 8px;
}

.price-input-wrapper .woocommerce-filter-value {
    padding-left: 24px;
}

/* Right positioned currency symbol */
.price-input-wrapper.currency-right .currency-symbol {
    left: auto;
    right: 8px;
}

.price-input-wrapper.currency-right .woocommerce-filter-value {
    padding-left: 8px;
    padding-right: 24px;
}

/* For between filters with price inputs */
.woocommerce-filter-between .price-input-wrapper {
    /* flex: 1; */
    min-width: 80px;
}

/* Search and Filter Container */
.tinx-b2b-search-and-filter {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
}

.tinx-b2b-search-wrapper {
    display: flex;
    align-items: center;
    gap: 0px;
}

/* Filter Active Indicator */
.tinx-b2b-filter-toggle.has-filters {
    background: #f0f6fc;
    color: #2271b1;
    border-color: #2271b1;
}

.tinx-b2b-filter-toggle.has-filters:hover {
    background: #e7f3ff;
    border-color: #135e96;
    color: #135e96;
}

.tinx-b2b-filter-toggle.has-filters .dashicons {
    color: #2271b1;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .tinx-b2b-advanced-filters-section {
        margin: 10px 0;
    }
    
    .tinx-b2b-search-and-filter {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }
    
    .tinx-b2b-search-wrapper {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }
}

.tinx-b2b-search-and-filter .tinx-b2b-filter-toggle {
    padding: 6px 12px;
    border-radius: 4px;
    border: none;
    background-color: #fff;
    color: #2c3338;
    min-width: unset;
}
.tinx-b2b-search-and-filter .tinx-b2b-filter-toggle .dashicons{
    margin-top: 0.35rem;
}

.tinx-b2b-search-and-filter .tinx-b2b-filter-toggle:hover {
    background-color: #F6F7F7;
}

#wpbody {
    overflow: hidden;
}

/* Column Toggle Styles */
.tinx-b2b-table-container {
    position: relative;
    overflow: auto;
} 

.tinx-b2b-table-container .tinx-b2b-advanced-filters-section{
    position: sticky;
    left: 0;
} 

.tinx-b2b-table-container .tablenav.top{
    position: sticky;
    left: 0;
}

.tinx-b2b-table-container .tablenav.bottom{
    position: sticky;
    left: 0;
}

/* Table header controls container */
.tinx-b2b-table-header-controls {
    position: absolute;
    top: 6.5px;
    right: 10px;
    z-index: 100;
}

.tinx-b2b-column-toggle {
padding: 4px 8px;
    border-radius: 3px;
    border: none;
    background-color: transparent;
    color: #555;
    cursor: pointer;
    min-width: unset;
    font-size: 16px;
    line-height: 1;
    display: flex
;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
}

.tinx-b2b-column-toggle:hover {
    background-color: #fafafa;
    border-color: #999;
}

.tinx-b2b-three-dots {
    font-size: 32px;
    font-weight: bold;
    line-height: 1;
    color: #000;
}

.tinx-b2b-column-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: #f9f9f9;
    border: 1px solid #dfdfdf;
    border-radius: 4px;
    box-shadow: 0 3px 5px rgba(0, 0, 0, 0.2);
    min-width: 180px;
    z-index: 1000;
    max-height: 300px;
    overflow-y: auto;
    margin-top: 2px;
}

.tinx-b2b-column-header {
    padding: 8px 12px;
    border-bottom: 1px solid #e5e5e5;
    background: #f1f1f1;
    font-size: 12px;
}

.tinx-b2b-column-header strong {
    color: #333;
    font-weight: 600;
}

.tinx-b2b-column-fields {
    padding: 4px 0;
}

.tinx-b2b-column-field {
    padding: 0;
}

.tinx-b2b-column-field label {
    display: flex;
    align-items: center;
    font-size: 12px;
    cursor: pointer;
    margin: 0;
    padding: 6px 12px;
    color: #333;
}

.tinx-b2b-column-field input[type="checkbox"] {
    margin-right: 8px;
    margin-top: 0;
    /* Hide the default checkbox */
    opacity: 0;
    position: absolute;
    pointer-events: none;
}

/* Create custom toggle switch */
.tinx-b2b-column-field input[type="checkbox"] + span {
    position: relative;
    width: 32px;
    height: 16px;
    background-color: #ccc;
    border-radius: 16px;
    margin-right: 8px;
    transition: background-color 0.3s ease;
    flex-shrink: 0;
}

/* Toggle switch handle */
.tinx-b2b-column-field input[type="checkbox"] + span::before {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 12px;
    height: 12px;
    background-color: white;
    border-radius: 50%;
    transition: transform 0.3s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

/* Checked state */
.tinx-b2b-column-field input[type="checkbox"]:checked + span {
    background-color: #2271b1;
}

.tinx-b2b-column-field input[type="checkbox"]:checked + span::before {
    transform: translateX(16px);
}

/* Hover effects */
.tinx-b2b-column-field:hover {
    background-color: #e9e9e9;
}

.tinx-b2b-column-field:hover input[type="checkbox"] + span {
    background-color: #bbb;
}

.tinx-b2b-column-field:hover input[type="checkbox"]:checked + span {
    background-color: #135e96;
}

/* Hidden column styles */
.tinx-b2b-column-hidden {
    display: none !important;
}

/* WooCommerce-style page title action */
.page-title-action-wrap {
    margin: 20px 0 0 0;
}

.page-title-action {
    display: inline-block;
    padding: 3px 10px;
    margin: 0 0 0 6px;
    font-size: 12px;
    line-height: 18px;
    color: #0073aa;
    border: 1px solid #0073aa;
    border-radius: 3px;
    text-decoration: none;
    background: #f3f5f6;
}

.page-title-action:hover {
    background: #0073aa;
    color: #fff;
    border-color: #006799;
}

/* Status filter tabs (subsubsub) */
.subsubsub {
    list-style: none;
    margin: 8px 0 0;
    padding: 0;
    font-size: 12px;
    text-align: left;
    float: left;
    color: #646970;
}

.subsubsub li {
    display: inline;
    margin: 0;
    padding: 0;
    white-space: nowrap;
}

.subsubsub a {
    line-height: 2;
    padding: 0.2em;
    text-decoration: none;
    color: #2271B1;
}

.subsubsub a .count, .subsubsub a.current .count {
    color: #50575e;
    font-weight: 400;
}

.subsubsub a.current {
    font-weight: 600;
    color: #1d2327;
    border: none;
}

.subsubsub a:hover {
    color: #2271b1;
}

/* Table navigation styling */
.tablenav {
    clear: both;
    margin: 6px 0 4px;
    padding: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: unset;
}

.tablenav .actions {
    padding: 2px 8px 0 0;
    overflow: hidden;
}

.tablenav .alignleft {
    float: left;
}

.tablenav .alignright {
    float: right;
}

.tablenav.top {
    margin: 20px 0;
    margin-top: 0;
}

/* Wrapper for status filters and search to align them */
.tinx-b2b-status-search-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin: 12px 0;
}

.tinx-b2b-status-search-wrapper .subsubsub {
    margin: 0;
    float: none;
}

.tinx-b2b-status-search-wrapper .search-box {
    float: none;
    margin: 0;
}

.tablenav .bulkactions select {
    border-style: solid;
    border-width: 1px;
    border-radius: 3px;
    display: inline-block;
    min-height: 30px;
    line-height: 2.15384615;
    padding: 0 24px 0 8px;
    vertical-align: top;
    border-color: #7e8993;
    background-color: #fff;
    color: #32373c;
}

.tablenav .bulkactions .button {
    margin-left: 10px;
    vertical-align: top;
}

/* Search box styling */
.search-box {
    float: right;
    margin: 0;
}

.search-box input[type="search"] {
    width: 280px;
    margin: 0 4px 0 0;
    padding: 3px 5px;
    border: 1px solid #7e8993;
    border-radius: 3px;
    color: #32373c;
    background-color: #fff;
    line-height: 1.5;
}

.search-box input[type="submit"]:hover {
    background: #f0f0f1;
    border-color: #0a4b78;
    color: #0a4b78;
}

/* Clear both after tablenav */
.tablenav br.clear {
    clear: both;
    margin: 0;
    height: 0;
    line-height: 0;
}

/* Clickable row hover effect */
.tinx-b2b-row-hover {
    background-color: #f0f6fc !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Ensure row title links are properly styled */
.wp-list-table tbody tr[data-clickable="true"] .column-id a {
    font-weight: 600;
    color: #2271b1;
    text-decoration: none;
}

.wp-list-table tbody tr[data-clickable="true"]:hover .column-id a {
    color: #135e96;
}

/* Add visual indicator that rows are clickable */
.wp-list-table tbody tr[data-clickable="true"]:hover {
    background-color: #f0f6fc !important;
}

/* Clickable table rows */
.tinx-b2b-list-table-wrapper .wp-list-table tbody tr.hover-row {
    background-color: #f0f6fc !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.tinx-b2b-list-table-wrapper .wp-list-table tbody tr[style*="cursor: pointer"] {
    transition: all 0.2s ease;
}

.tinx-b2b-list-table-wrapper .wp-list-table tbody tr[style*="cursor: pointer"]:hover {
    transform: translateY(-1px);
}

#tinx_b2b_log_cleanup_interval:disabled {
    background-image: unset;
}

#clear-price-cache {
    margin-top: 0.5rem;
}
@media screen and (max-width: 782px) {
    .wp-list-table th.column-primary~th, .wp-list-table tr:not(.inline-edit-row):not(.no-items) td.column-primary~td:not(.check-column) {
        display: table-cell;
    }

    .wp-list-table tr:not(.inline-edit-row):not(.no-items) td.column-primary~td:not(.check-column) {
        padding: 12px;
    }

    .wp-list-table tr:not(.inline-edit-row):not(.no-items) td:not(.column-primary)::before {
        display: none;
    }
}

.wp-core-ui.wp-admin .notice {
    position: absolute;
    right: 0;
    top: 10px;
    z-index: 1000;
}

.tinx-b2b-admin-wrap p.submit {
    margin-top: 20px;
    padding-top: 10px;
    padding-bottom: 0;
    margin-bottom: 0;
}

/* Loading overlay for AJAX filtering */
.tinx-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.tinx-loading-spinner {
    padding: 12px 24px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    font-size: 14px;
    color: #555;
}

.tinx-loading-spinner::before {
    content: "";
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #ddd;
    border-top: 2px solid #0073aa;
    border-radius: 50%;
    animation: tinx-spin 1s linear infinite;
    margin-right: 8px;
    vertical-align: middle;
}

@keyframes tinx-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.tinx-b2b-list-table-wrapper .wp-list-table {
    display: table;
    width: 100%;
    min-width: max-content;
    table-layout: auto;
}

    /* Force minimum width for all columns in B2B tables */
    .tinx-b2b-list-table-wrapper .wp-list-table th,
    .tinx-b2b-list-table-wrapper .wp-list-table td {
        min-width: 120px !important;
    }

/* Force minimum width for all columns in B2B tables */
.wp-list-table th,
.wp-list-table td{
    min-width: 120px;
}

/* .wp-list-table th.check-column {
    max-width: 60px !important;
    min-width: 60px !important;
} */

.tinx-header-placeholder.active .tinx-b2b-table-header-controls{
    display: none;
}

.wp-core-ui select.disabled, .wp-core-ui select:disabled {
    background: #fff;
}

.woocommerce-filter-value::placeholder {
    opacity: 0 !important;
    transition: opacity 0.2s;
}

.woocommerce-filter-value:focus::placeholder {
    opacity: 1 !important;
}

/* Mobile Responsiveness */
@media screen and (max-width: 782px) {
    .tinx-b2b-header {
        top: 46px;
    }
    
    .tinx-b2b-nav-tab {
        padding: 8px 10px;
        font-size: 13px;
    }
    
    .tinx-b2b-sub-nav a {
        padding: 8px 12px;
        font-size: 12px;
    }
    
    .tinx-b2b-list-table th,
    .tinx-b2b-list-table td {
        padding: 8px 10px;
        font-size: 13px;
    }
    
    .styling-reset-container {
        float: none;
        margin-bottom: 20px;
    }
    
    .tinx-b2b-manual-refresh-button-wrapper {
        float: none;
        margin-bottom: 15px;
    }
    
    /* Adjust sticky header position for mobile */
    .tinx-b2b-list-table-wrapper .wp-list-table thead.tinx-sticky {
        top: 117px; /* Mobile admin bar + header height */
    }

    .tinx-b2b-status-search-wrapper {
        flex-direction: column;
        align-items: start;
        gap: 0.85rem;
    }
    .tinx-b2b-status-search-wrapper .search-box { 
        column-gap: 0;
        justify-content: space-between;
    }
    .tinx-b2b-status-search-wrapper .search-box #search_id-search-input{ 
        width: 49%;
        margin-bottom: 0;
    }
    .tinx-b2b-status-search-wrapper .search-box #search-submit{ 
        width: 49%;
        margin-bottom: 0;
    }

    .tablenav .view-switch, .tablenav.top .actions {
        display: block;
        width: 49%;
        padding-right: unset;
    }

    .tinx-b2b-table-container .tablenav.top {
        flex-wrap: wrap;
    }

    .tablenav .alignright.actions.perpage {
        margin-left: unset;
        width: 100%;
        margin-top: 12px;
    }

    .tablenav .bulkactions select {
        width: 99.5%;
    }
    .tablenav .tinx-b2b-filter-toggle {
        width: 100%;
        margin-bottom: 0;
    }

    .tinx-b2b-list-table-wrapper .perpage select {
        font-size: 12px;
        min-height: 28px;
        margin-right: 0.5rem;
    }

    #your-profile label+a, label {
        vertical-align: sub;
    }
    
    .woocommerce-filter-row {
        flex-direction: column;
        align-items: start;
    }

    .tinx-b2b-settings-form .woocommerce-filter-operator, .tinx-b2b-settings-form .woocommerce-filter-value {
        margin-left: 0;
    }

    .woocommerce-filter-remove {
        position: absolute;
        right: 0;
        top: 35%;
    }

   .updates-table tbody td.check-column, .widefat tbody th.check-column, .widefat tfoot td.check-column, .widefat thead td.check-column {
    min-width: 50px !important;
   }
}
