/* --- WPCIM Core Styles (Migrated) --- */
:root {
    --wpcst-primary: #10b981;
    --wpcst-primary-dark: #059669;
    --wpcst-primary-light: #ecfdf5;
    --wpcst-border: #e2e8f0;
    --wpcst-bg: #f8fafc;
    --wpcst-text: #1e293b;
    --wpcst-muted: #64748b;
    --wpcst-radius: 10px;
    --wpcst-shadow: 0 1px 3px 0 rgba(0, 0, 0, .1), 0 1px 2px -1px rgba(0, 0, 0, .1);
    --wpcst-shadow-md: 0 4px 6px -1px rgba(0, 0, 0, .1), 0 2px 4px -2px rgba(0, 0, 0, .1);
}

.wpcst-wrap {
    max-width: 960px;
    margin: 20px auto;
    color: var(--wpcst-text);
    box-sizing: border-box;
    overflow-x: hidden;
    /* Prevent global scroll */
}

.wpcst-wrap *,
.wpcst-wrap *::before,
.wpcst-wrap *::after {
    box-sizing: border-box !important;
}

.wpcst-wrap.wpcst-full-width {
    max-width: none !important;
    width: auto !important;
    margin: 20px 20px 20px 2px !important;
    overflow-x: hidden !important;
}

/* ──── Header banner ────────────────────────────────────────── */
.wpcst-settings-header {
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
    border-radius: var(--wpcst-radius);
    padding: 28px 32px;
    margin-bottom: 28px;
    box-shadow: var(--wpcst-shadow-md);
    color: #fff;
}

.wpcst-settings-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

.wpcst-settings-header-inner .notice,
.wpcst-settings-header-inner .updated {
    display: none !important;
}

.wpcst-header-left {
    display: flex;
    align-items: center;
    gap: 18px;
}

.wpcst-header-right-title {
    color: #fff;
    font-size: 18px;
    font-weight: 700;
    padding: 8px 18px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    text-transform: none;
}

.wpcst-settings-header .premium {
    background: #e11d48;
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: .5px;
}

.wpcst-settings-header .wpcst-logo {
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, .15);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.wpcst-settings-header h1 {
    color: #fff;
    font-size: 22px;
    font-weight: 800;
    margin: 0 0 4px !important;
    padding: 0;
    line-height: 1.2;
    display: flex;
    align-items: center;
    gap: 10px;
}

.wpcst-settings-header .wpcst-tagline {
    color: rgba(255, 255, 255, .65);
    font-size: 13px;
    margin: 0;
}

/* ──── Table and Actions ────────────────────────────────────── */
.wpcst-actions-bar {
    margin-bottom: 25px;
    background: #fff;
    padding: 20px;
    border-radius: var(--wpcst-radius);
    border: 1px solid var(--wpcst-border);
    box-shadow: var(--wpcst-shadow);
}

.wpcst-filter-form {
    display: flex;
    gap: 12px;
    align-items: center;
    width: 100%;
}

.wpcst-filter-form select,
.wpcst-filter-form input[type="search"] {
    border-radius: 8px !important;
    border: 1px solid var(--wpcst-border) !important;
    padding: 8px 15px !important;
    height: 42px !important;
    background: #fff !important;
    font-size: 14px !important;
}

.wpcst-filter-form .button-primary {
    height: 42px !important;
    border-radius: 8px !important;
    padding: 0 25px !important;
    background: var(--wpcst-primary) !important;
    border: none !important;
    font-weight: 600 !important;
    box-shadow: 0 4px 10px rgba(37, 99, 235, 0.2) !important;
    transition: all 0.2s !important;
}

.wpcst-filter-form .button-primary:hover {
    background: var(--wpcst-primary-dark) !important;
    transform: translateY(-1px);
}

.wpcst-table-wrapper {
    background: #fff;
    border-radius: var(--wpcst-radius);
    border: 1px solid var(--wpcst-border);
    box-shadow: var(--wpcst-shadow);
    margin-top: 20px;
    clear: both;
}

.wpcst-table-scroller {
    overflow-x: auto !important;
    width: 100%;
    max-width: 100%;
    display: block;
    box-sizing: border-box;
}

.wpcst-table-wrapper table.wp-list-table {
    border: none !important;
    box-shadow: none !important;
    min-width: max-content !important;
    width: 100% !important;
}

.wpcst-table-wrapper .tablenav {
    padding: 0 20px;
    box-sizing: border-box !important;
}

.wpcst-table-wrapper .wp-list-table .check-column {
    text-align: center !important;
    width: 40px !important;
}

.wpcst-table-wrapper .wp-list-table .check-column input[type="checkbox"],
.wpcst-table-wrapper .wp-list-table td input[type="checkbox"] {
    margin: 0 !important;
    vertical-align: middle !important;
}

.wpcst-table-wrapper .wp-list-table .column-individually,
.wpcst-table-wrapper .wp-list-table .column-manage_stock,
.wpcst-table-wrapper .wp-list-table .column-potential {
    width: 90px !important;
    text-align: center !important;
}

.wpcst-table-wrapper .wp-list-table .column-id {
    width: 80px !important;
    text-align: left !important;
}

.wpcst-table-wrapper .wp-list-table .column-history {
    width: 60px !important;
    text-align: center !important;
}

.wpcst-table-wrapper .wp-list-table .column-status {
    width: 120px !important;
    text-align: center !important;
}

.wpcst-table-wrapper .wp-list-table .column-stocks,
.wpcst-table-wrapper .wp-list-table .column-cost,
.wpcst-table-wrapper .wp-list-table .column-regular_price,
.wpcst-table-wrapper .wp-list-table .column-sale_price,
.wpcst-table-wrapper .wp-list-table .column-backorders {
    width: 140px !important;
}

.wpcst-table-wrapper .wp-list-table .column-profit {
    width: 110px !important;
}

.wpcst-bundle-cost-wrapper {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.wpcst-calc-badge {
    display: inline-block;
    margin-top: 4px;
    font-size: 11px;
    color: #10b981;
    background: #ecfdf5;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 600;
    cursor: help;
}

.wpcst-cost-input {
    width: 100% !important;
    text-align: right;
    padding-left: 55px !important;
}

.wpcst-cost-column-wrapper {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.wpcst-price-hint {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    left: 8px;
    font-size: 9px;
    color: #94a3b8;
    white-space: nowrap;
    pointer-events: none;
    z-index: 10;
}

.wpcst-table-wrapper .wp-list-table .column-sku,
.wpcst-table-wrapper .wp-list-table .column-barcode {
    width: 120px !important;
}

.wpcst-table-scroller .wp-list-table .column-product {
    min-width: 300px !important;
    width: 300px !important;
}

/* Sticky columns */
.wpcst-table-scroller .wp-list-table .check-column,
.wpcst-table-scroller .wp-list-table .column-id,
.wpcst-table-scroller .wp-list-table .column-product {
    position: sticky !important;
    left: 0;
    z-index: 20 !important;
    background: #fff !important;
}

.wpcst-table-scroller .wp-list-table .column-id {
    left: 40px !important;
}

.wpcst-table-scroller .wp-list-table .column-product {
    left: 120px !important;
    box-shadow: none !important;
    /* Hide shadow by default */
    transition: box-shadow 0.3s ease, background-color 0.2s ease;
    /* Sync with row hover */
}

.wpcst-table-scroller.is-scrolled .wp-list-table .column-product {
    box-shadow: 6px 0 6px -4px rgba(0, 0, 0, 0.2) !important;
}

/* Backgrounds for sticky header/footer */
.wpcst-table-scroller .wp-list-table thead th.check-column,
.wpcst-table-scroller .wp-list-table thead th.column-id,
.wpcst-table-scroller .wp-list-table thead th.column-product,
.wpcst-table-scroller .wp-list-table tfoot th.check-column,
.wpcst-table-scroller .wp-list-table tfoot th.column-id,
.wpcst-table-scroller .wp-list-table tfoot th.column-product {
    background: #f8fafc !important;
    z-index: 30 !important;
}

/* Consistent backgrounds for rows */
.wpcst-table-scroller .wp-list-table tbody tr:nth-child(even) .check-column,
.wpcst-table-scroller .wp-list-table tbody tr:nth-child(even) .column-id,
.wpcst-table-scroller .wp-list-table tbody tr:nth-child(even) .column-product {
    background: #f9fafb !important;
}

.wpcst-table-scroller .wp-list-table tbody tr:hover .check-column,
.wpcst-table-scroller .wp-list-table tbody tr:hover .column-id,
.wpcst-table-scroller .wp-list-table tbody tr:hover .column-product {
    background: #f1f5f9 !important;
}

.wpcst-table-wrapper .wp-list-table thead th,
.wpcst-table-wrapper .wp-list-table thead .check-column,
.wpcst-table-wrapper .wp-list-table tfoot th,
.wpcst-table-wrapper .wp-list-table tfoot .check-column {
    background: #f8fafc !important;
    padding: 15px 12px !important;
    font-weight: 700 !important;
    color: #475569 !important;
}

.wpcst-table-wrapper .wp-list-table thead th,
.wpcst-table-wrapper .wp-list-table thead .check-column {
    border-bottom: 2px solid #f1f5f9 !important;
}

.wpcst-table-wrapper .wp-list-table tfoot th,
.wpcst-table-wrapper .wp-list-table tfoot .check-column {
    border-top: 2px solid #f1f5f9 !important;
}

.wpcst-table-wrapper .wp-list-table tbody td,
.wpcst-table-wrapper .wp-list-table tbody th,
.wpcst-table-wrapper .wp-list-table tbody .check-column {
    padding: 15px 12px !important;
    vertical-align: middle !important;
    border-bottom: 1px solid #f1f5f9 !important;
    transition: all 0.2s ease;
    background: #fff !important;
}

.wpcst-table-wrapper .wp-list-table tbody tr:nth-child(even) td,
.wpcst-table-wrapper .wp-list-table tbody tr:nth-child(even) th,
.wpcst-table-wrapper .wp-list-table tbody tr:nth-child(even) .check-column {
    background: #f9fafb !important;
}

.wpcst-product-column {
    display: flex;
    align-items: center;
    gap: 8px;
}

.wpcst-expand-variation {
    cursor: pointer;
    color: var(--wpcst-muted);
    transition: all 0.2s ease;
    font-size: 20px;
    width: 20px;
    height: 20px;
}

.wpcst-expand-variation:hover {
    color: var(--wpcst-primary);
}

.wpcst-expand-variation.active {
    transform: rotate(90deg);
    color: var(--wpcst-primary);
}

.wpcst-expand-variation.loading {
    animation: wpcstSpin 1s linear infinite;
}

@keyframes wpcstSpin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.wpcst-row-variation {
    background: #fdfdfd !important;
}

.wpcst-row-variation td.check-column,
.wpcst-row-variation th.check-column {
    padding-left: 30px !important;
}

.wpcst-row-variation .wpcst-product-column {
    padding-left: 35px;
    position: relative;
}

/* Vertical connector line */
.wpcst-row-variation .wpcst-product-column::before {
    content: '';
    position: absolute;
    left: 10px;
    top: -10px;
    bottom: -10px;
    width: 2px;
    background: #e2e8f0;
    transform: translateX(-50%);
}

/* The dot at the middle */
.wpcst-row-variation .wpcst-product-column::after {
    content: '';
    position: absolute;
    left: 10px;
    top: 50%;
    width: 8px;
    height: 8px;
    background: #94a3b8;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    border: 2px solid #fff;
    z-index: 2;
}

.wpcst-table-wrapper .wp-list-table tbody tr:hover td,
.wpcst-table-wrapper .wp-list-table tbody tr:hover th,
.wpcst-table-wrapper .wp-list-table tbody tr:hover .check-column {
    background: #f1f5f9 !important;
}

.wpcst-manage-variations {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: #f1f5f9;
    color: #64748b;
    border-radius: 4px;
    text-decoration: none;
    transition: all 0.2s ease;
    margin-left: 5px;
    vertical-align: middle;
    outline: none !important;
    box-shadow: none !important;
}

.wpcst-manage-variations:hover {
    background: var(--wpcst-primary);
    color: #fff;
    transform: translateY(-1px);
}

.wpcst-manage-variations .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

.wpcst-back-link {
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.wpcst-back-link .button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px !important;
    height: auto !important;
    font-weight: 600 !important;
    border-radius: 8px !important;
    border: 1px solid var(--wpcst-border) !important;
    color: var(--wpcst-text) !important;
    background: #fff !important;
    box-shadow: var(--wpcst-shadow) !important;
}

.wpcst-back-link .button:hover {
    border-color: var(--wpcst-primary) !important;
    color: var(--wpcst-primary) !important;
}

.wpcst-parent-title {
    font-size: 16px;
    color: var(--wpcst-text);
}

.wpcst-parent-title strong {
    color: var(--wpcst-primary);
}

.wpcst-back-link .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
}

.wpcst-table-wrapper .wp-list-table tbody tr:hover> :first-child {
    box-shadow: inset 1px 0 0 #2563eb !important;
}

.wpcst-table-wrapper .wp-list-table tbody tr:hover> :last-child {
    box-shadow: inset -1px 0 0 #2563eb !important;
}

.wpcst-status {
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}

.status-instock {
    background: #dcfce7;
    color: #15803d;
}

.status-outofstock {
    background: #fee2e2;
    color: #b91c1c;
}

.status-onbackorder {
    background: #fef3c7;
    color: #92400e;
}

.wpcst-badge {
    display: inline-flex;
    align-items: center;
    height: 24px;
    padding: 0 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    margin-left: 8px;
    vertical-align: middle;
}

.wpcst-badge-simple {
    background: #dbeafe;
    color: #1e40af;
}

.wpcst-badge-variable {
    background: #f3e8ff;
    color: #7e22ce;
}

.wpcst-badge-variation {
    background: #f1f5f9;
    color: #475569;
}

.wpcst-badge-woosb {
    background: #dcfce7;
    color: #15803d;
}

.wpcst-quick-edit {
    width: 100%;
    border: 1px solid var(--wpcst-border) !important;
    padding: 8px 12px !important;
    border-radius: 6px !important;
    font-size: 13px !important;
}

.wpcst-quick-edit:focus {
    border-color: var(--wpcst-primary) !important;
    box-shadow: 0 0 0 2px var(--wpcst-primary-light) !important;
    outline: none;
}

/* Save Changes Button */
.wpcst-wrap .wpcst-submit-row {
    margin-top: 24px;
    padding: 0;
}

.wpcst-wrap .wpcst-submit-row .button-primary {
    background: var(--wpcst-primary) !important;
    border: none !important;
    padding: 12px 36px !important;
    height: auto !important;
    font-weight: 700 !important;
    border-radius: 8px !important;
    font-size: 14px !important;
    box-shadow: 0 4px 6px -1px rgba(16, 185, 129, 0.2) !important;
    transition: all 0.2s !important;
    color: #fff !important;
    cursor: pointer !important;
}

.wpcst-wrap .wpcst-submit-row .button-primary:hover {
    background: var(--wpcst-primary-dark) !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 6px 12px -1px rgba(16, 185, 129, 0.3) !important;
}

/* Modals */
.wpcst-modal {
    display: none;
    position: fixed;
    z-index: 100000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
}

.wpcst-modal-overlay {
    position: absolute;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

.wpcst-modal-content {
    position: relative;
    background: #fff;
    margin: 5% auto;
    width: 80%;
    max-width: 900px;
    border-radius: 16px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    max-height: 80vh;
    animation: wpcstModalFadeIn 0.3s ease;
    overflow: hidden;
}

@keyframes wpcstModalFadeIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.wpcst-modal-header {
    padding: 20px 25px;
    border-bottom: 1px solid var(--wpcst-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8fafc;
}

.wpcst-modal-header h2 {
    margin: 0 !important;
    font-size: 18px;
    font-weight: 700;
}

.wpcst-modal-close {
    cursor: pointer;
    color: #94a3b8;
    transition: color 0.2s;
}

.wpcst-modal-close:hover {
    color: #1e293b;
}

.wpcst-modal-body {
    padding: 25px;
    overflow-y: auto;
}

.wpcst-history-table {
    width: 100%;
    border-collapse: collapse;
}

.wpcst-history-table th {
    text-align: left;
    background: #f8fafc;
    padding: 12px 15px;
    font-weight: 700;
    color: #475569;
    border-bottom: 2px solid #f1f5f9;
}

.wpcst-history-table td {
    padding: 12px 15px;
    border-bottom: 1px solid #f1f5f9;
}

.wpcst-change-up {
    color: #166534;
    font-weight: 700;
}

.wpcst-change-down {
    color: #991b1b;
    font-weight: 700;
}

.wpcst-loading {
    text-align: center;
    padding: 40px;
    color: var(--wpcst-muted);
}

/* Settings Form */
.wpcst-wrap .form-table {
    background: #fff;
    padding: 20px;
    border-radius: var(--wpcst-radius);
    border: 1px solid var(--wpcst-border);
    box-shadow: var(--wpcst-shadow);
    margin-top: 0;
}

.wpcst-wrap .form-table th {
    padding: 25px 20px;
    font-weight: 600;
    color: var(--wpcst-text);
}

.wpcst-wrap .form-table td {
    padding: 25px 20px;
}

.wpcst-wrap h2 {
    font-size: 18px;
    font-weight: 700;
    margin: 30px 0 15px;
}

.wpc-product-types-list label {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    font-size: 14px;
}

.wpc-product-types-list input[type="checkbox"] {
    width: 18px;
    height: 18px;
    border-radius: 4px;
}

.wpcst-view-history {
    cursor: pointer;
    color: #94a3b8;
    transition: all 0.2s ease;
    font-size: 18px;
    width: 18px;
    height: 18px;
}

.wpcst-view-history:hover {
    color: var(--wpcst-primary);
    transform: scale(1.1);
}

/* ──── Admin Navigation ────────────────────────────────────── */
.no-bottom-radius {
    border-radius: var(--wpcst-radius) var(--wpcst-radius) 0 0 !important;
    margin-bottom: 0 !important;
}

.wpcst-admin-nav {
    background: #fff;
    border-bottom: 2px solid var(--wpcst-border);
    margin: 0 0 30px 0;
    border-radius: 0 0 var(--wpcst-radius) var(--wpcst-radius);
    padding: 0 10px;
    box-shadow: var(--wpcst-shadow);
}

.wpcst-nav-container {
    display: flex;
}

.wpcst-nav-item {
    position: relative;
    padding: 18px 30px;
    text-decoration: none;
    color: var(--wpcst-muted);
    font-weight: 700;
    transition: all 0.3s ease;
    font-size: 14px;
    outline: none !important;
    box-shadow: none !important;
}

.wpcst-nav-item::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 50%;
    width: 0;
    height: 3px;
    background: var(--wpcst-primary);
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.wpcst-nav-item:hover,
.wpcst-nav-item.active {
    color: var(--wpcst-primary) !important;
}

.wpcst-nav-item:hover::after,
.wpcst-nav-item.active::after {
    width: 100%;
}

/* Toast Notification */
.wpcst-toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: #1e293b;
    color: #fff;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    z-index: 1000000;
    display: none;
}

/* Admin Alert Links */
.wpcst-alert-link {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 6px;
    text-decoration: none !important;
    margin: 0 4px;
    transition: all 0.2s ease;
}

.wpcst-alert-lowstock {
    background: #fef3c7;
    color: #92400e !important;
}

.wpcst-alert-lowstock:hover {
    background: #fde68a;
}

.wpcst-alert-outofstock {
    background: #fee2e2;
    color: #b91c1c !important;
}

.wpcst-alert-outofstock:hover {
    background: #fecaca;
}

/* History Popup Chart Styles */
.wpcst-history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding: 15px;
    background: #f8fafc;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
}

.wpcst-product-info .label {
    font-weight: 600;
    color: #64748b;
    font-size: 13px;
}

.wpcst-product-info .value {
    font-weight: 700;
    color: #0f172a;
    font-size: 14px;
    margin-left: 8px;
}

.wpcst-chart-filters {
    background: #f1f5f9;
    padding: 4px;
    border-radius: 8px;
    display: flex;
    gap: 4px;
}

.wpcst-chart-filter {
    border: none;
    background: transparent;
    padding: 6px 14px;
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.wpcst-chart-filter:hover {
    color: #0f172a;
    background: #fff;
}

.wpcst-chart-filter.active {
    background: #fff;
    color: #2563eb;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.wpcst-history-table-container {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
}

.wpcst-history-table thead {
    position: sticky;
    top: 0;
    background: #fff;
    z-index: 10;
}

/* Potential Column */
.wpcst-potential-container {
    position: relative;
    display: inline-block;
}

.wpcst-potential-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 28px;
    padding: 0 8px;
    background: #f1f5f9;
    color: #475569;
    border-radius: 14px;
    font-weight: 700;
    font-size: 13px;
    cursor: help;
    transition: all 0.2s;
}

.wpcst-potential-badge:hover {
    background: #e2e8f0;
}

.wpcst-potential-out {
    background: #fee2e2;
    color: #ef4444;
}

.wpcst-potential-low {
    background: #ffedd5;
    color: #f59e0b;
}

/* Tooltip */
.wpcst-potential-tooltip {
    visibility: hidden;
    position: absolute;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    width: 300px;
    background-color: #0f172a;
    color: #fff;
    text-align: left;
    border-radius: 12px;
    padding: 15px;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s, visibility 0.3s;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.4);
    font-size: 12px;
    line-height: 1.5;
    pointer-events: none;
}

.wpcst-potential-tooltip::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: #0f172a transparent transparent transparent;
}

.wpcst-potential-container:hover .wpcst-potential-tooltip {
    visibility: visible;
    opacity: 1;
}

.wpcst-potential-tooltip .tooltip-title {
    font-weight: 700;
    font-size: 13px;
    margin-bottom: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 8px;
    color: #38bdf8;
}

.wpcst-potential-tooltip ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.wpcst-potential-tooltip li {
    margin-bottom: 8px;
    padding-bottom: 8px;
    border-bottom: 1px dashed rgba(255, 255, 255, 0.1);
}

.wpcst-potential-tooltip li:last-child {
    margin-bottom: 0;
    border-bottom: none;
    padding-bottom: 0;
}

.wpcst-potential-tooltip .comp-name {
    display: block;
    font-weight: 600;
    color: #f8fafc;
    margin-bottom: 2px;
}

.wpcst-potential-tooltip .comp-info {
    color: #94a3b8;
}

.wpcst-potential-tooltip .comp-calc {
    color: #e2e8f0;
    float: right;
}

.wpcst-potential-tooltip .wpcst-bottleneck {
    margin-top: 12px;
    background: rgba(239, 68, 68, 0.2);
    padding: 8px;
    border-radius: 6px;
    border-left: 3px solid #ef4444;
}

.wpcst-potential-tooltip .wpcst-bottleneck strong {
    color: #fca5a5;
}

/* Profit Widget */
.wpcst-profit-widget {
    padding: 10px 0;
}

.wpcst-profit-period {
    margin-bottom: 15px;
    text-align: right;
}

.wpcst-profit-period select {
    border-radius: 6px;
    border: 1px solid #e2e8f0;
    font-size: 12px;
}

.wpcst-profit-stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.profit-stat-card {
    background: #f8fafc;
    padding: 12px;
    border-radius: 10px;
    border: 1px solid #f1f5f9;
    display: flex;
    flex-direction: column;
}

.stat-label {
    font-size: 11px;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 4px;
}

.stat-value {
    font-size: 16px;
    font-weight: 700;
    color: #0f172a;
}

.profit-stat-card.revenue .stat-value {
    color: #059669;
}

.profit-stat-card.profit .stat-value {
    color: #2563eb;
}

.profit-stat-card.margin .stat-value {
    color: #7c3aed;
}

.wpcst-profit-chart-container canvas {
    max-width: 100%;
}

.wpcst-export-actions {
    float: right;
    margin: 11px 10px 11px 0;
}

.wpcst-export-actions .button {
    height: 36px !important;
    border-radius: 8px !important;
    border: 1px solid var(--wpcst-border) !important;
    padding: 0 16px !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    background: #fff !important;
    color: var(--wpcst-text) !important;
    transition: all 0.2s ease !important;
    box-shadow: var(--wpcst-shadow) !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    margin: 0 !important;
}

.wpcst-export-actions .button:hover {
    background: #f8fafc !important;
    border-color: #cbd5e1 !important;
    transform: translateY(-1px) !important;
    box-shadow: var(--wpcst-shadow-md) !important;
}

/* Unified Table Navigation Styling */
.wpcst-wrap .tablenav {
    width: 100% !important;
    height: auto !important;
    margin: 15px 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    flex-wrap: wrap !important;
    gap: 10px !important;
}

.wpcst-wrap .tablenav .alignleft.actions {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    margin: 0 !important;
}

.wpcst-wrap .tablenav select {
    height: 36px !important;
    line-height: normal !important;
    border-radius: 8px !important;
    border: 1px solid var(--wpcst-border) !important;
    padding: 0 35px 0 12px !important;
    background-color: #fff !important;
    font-size: 13px !important;
    transition: border-color 0.2s, box-shadow 0.2s;
    margin: 0 !important;
}

.wpcst-wrap .tablenav select:focus {
    border-color: var(--wpcst-primary) !important;
    box-shadow: 0 0 0 2px var(--wpcst-primary-light) !important;
    outline: none !important;
}

.wpcst-wrap .tablenav .button {
    height: 36px !important;
    border-radius: 8px !important;
    border: 1px solid var(--wpcst-border) !important;
    padding: 0 16px !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    background: #fff !important;
    color: var(--wpcst-text) !important;
    transition: all 0.2s ease !important;
    box-shadow: var(--wpcst-shadow) !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    margin: 0 !important;
}

.wpcst-wrap .tablenav .button:hover {
    background: #f8fafc !important;
    border-color: #cbd5e1 !important;
    transform: translateY(-1px) !important;
    box-shadow: var(--wpcst-shadow-md) !important;
}

.wpcst-wrap .tablenav .button-primary {
    background: var(--wpcst-primary) !important;
    border: none !important;
    color: #fff !important;
}

.wpcst-wrap .tablenav .button-primary:hover {
    background: var(--wpcst-primary-dark) !important;
    color: #fff !important;
}

.wpcst-wrap .search-box {
    margin: 10px 0 !important;
}

.wpcst-wrap .search-box input[type="search"] {
    height: 36px !important;
    border-radius: 8px !important;
    border: 1px solid var(--wpcst-border) !important;
    padding: 0 12px !important;
    font-size: 13px !important;
    margin: 0 !important;
}

.wpcst-wrap .search-box input[type="search"]:focus {
    border-color: var(--wpcst-primary) !important;
    box-shadow: 0 0 0 2px var(--wpcst-primary-light) !important;
    outline: none !important;
}

.wpcst-wrap .search-box #search-submit {
    height: 36px !important;
    width: 42px !important;
    border-radius: 8px !important;
    border: 1px solid var(--wpcst-border) !important;
    padding: 0 !important;
    background: #fff !important;
    color: var(--wpcst-text) !important;
    transition: all 0.2s ease !important;
    box-shadow: var(--wpcst-shadow) !important;
    margin-left: 5px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.wpcst-wrap .search-box #search-submit svg {
    display: block;
    color: var(--wpcst-muted);
}

.wpcst-wrap .search-box #search-submit:hover svg {
    color: var(--wpcst-primary);
}

/* Bulk quantity input styling */
.wpcst-bulk-qty-wrap {
    display: flex;
    align-items: center;
    background: #f1f5f9;
    padding: 2px;
    border-radius: 8px;
    border: 1px solid var(--wpcst-border);
}

.wpcst-bulk-qty-input {
    width: 60px !important;
    height: 30px !important;
    border: none !important;
    background: transparent !important;
    text-align: center !important;
    font-weight: 700 !important;
    font-size: 13px !important;
    box-shadow: none !important;
}

.wpcst-wrap .tablenav br.clear {
    display: none !important;
}

.wpcst-wrap .tablenav .current-page {
    height: 30px !important;
    border-radius: 6px !important;
    border: 1px solid var(--wpcst-border) !important;
    padding: 0 5px !important;
    text-align: center !important;
    font-weight: 600 !important;
    color: var(--wpcst-text) !important;
    background: #fff !important;
    box-shadow: none !important;
    margin: 0 4px !important;
    width: 40px !important;
}

.wpcst-wrap .tablenav .current-page:focus {
    border-color: var(--wpcst-primary) !important;
    box-shadow: 0 0 0 2px var(--wpcst-primary-light) !important;
    outline: none !important;
}

.wpcst-wrap .tablenav .paging-input {
    font-size: 13px !important;
    color: var(--wpcst-muted) !important;
}

.wpcst-wrap .tablenav .tablenav-pages-navspan,
.wpcst-wrap .tablenav .next-page,
.wpcst-wrap .tablenav .prev-page,
.wpcst-wrap .tablenav .first-page,
.wpcst-wrap .tablenav .last-page {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: #fff !important;
    border: 1px solid var(--wpcst-border) !important;
    border-radius: 6px !important;
    width: 30px !important;
    height: 30px !important;
    padding: 0 !important;
    margin: 0 2px !important;
    color: var(--wpcst-text) !important;
    text-decoration: none !important;
    transition: all 0.2s !important;
}

.wpcst-wrap .tablenav .next-page:hover,
.wpcst-wrap .tablenav .prev-page:hover,
.wpcst-wrap .tablenav .first-page:hover,
.wpcst-wrap .tablenav .last-page:hover {
    background: #f1f5f9 !important;
    border-color: #cbd5e1 !important;
    color: var(--wpcst-primary) !important;
}

.wpcst-wrap .tablenav .tablenav-pages-navspan {
    background: #f8fafc !important;
    color: #cbd5e1 !important;
    cursor: default !important;
}

/* --- WPCST Specific Styles --- */

/* WPC Shared Stock Settings Form */
.wpcst-edit-form .form-table th,
.wpcst-edit-form .form-table td {
    padding: 12px 20px !important;
}

/* Product Level Inventory Lock */
body.wpcst-product-locked ._manage_stock_field,
body.wpcst-product-locked ._stock_field,
body.wpcst-product-locked ._stock_status_field,
body.wpcst-product-locked ._backorders_field,
body.wpcst-product-locked ._low_stock_amount_field {
    pointer-events: none;
    opacity: 0.5;
}

/* Variation Level Inventory Lock */
.woocommerce_variation.wpcst-variation-locked input[name^="variable_manage_stock"] {
    pointer-events: none !important;
}

.woocommerce_variation.wpcst-variation-locked input[name^="variable_manage_stock"]+label {
    pointer-events: none !important;
    opacity: 0.5;
}

.woocommerce_variation.wpcst-variation-locked .variable_stock_status,
.woocommerce_variation.wpcst-variation-locked input[name^="variable_stock"],
.woocommerce_variation.wpcst-variation-locked select[name^="variable_backorders"],
.woocommerce_variation.wpcst-variation-locked input[name^="variable_low_stock_amount"] {
    pointer-events: none;
    opacity: 0.5;
}

.woocommerce_variation.wpcst-variation-locked .show_if_variation_manage_stock {
    pointer-events: none;
}

/* WPC SS Form Inputs */
.wpcst-edit-form input[type="text"],
.wpcst-edit-form input[type="number"],
.wpcst-edit-form select {
    border-radius: 8px !important;
    border: 1px solid #e2e8f0 !important;
    padding: 8px 15px !important;
    height: 40px !important;
    background-color: #fff !important;
    font-size: 14px !important;
    box-shadow: none !important;
    transition: all 0.2s ease;
    width: 100%;
    max-width: 100%;
}

.wpcst-edit-form input[type="text"]:focus,
.wpcst-edit-form input[type="number"]:focus,
.wpcst-edit-form select:focus {
    border-color: #10b981 !important;
    box-shadow: 0 0 0 3px #ecfdf5 !important;
    outline: none;
}

/* Checkbox */
.wpcst-wrap input[type="checkbox"] {
    width: 22px;
    height: 22px;
    border-radius: 6px !important;
    border: 1px solid #e2e8f0 !important;
    box-shadow: none !important;
    transition: all 0.2s ease;
    cursor: pointer;
}

.wpcst-wrap input[type="checkbox"]:checked {
    background-color: #10b981 !important;
    border-color: #10b981 !important;
}

.wpcst-wrap input[type="checkbox"]:checked::before {
    content: url("data:image/svg+xml;utf8,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%2020%2020%27%3E%3Cpath%20d%3D%27M14.83%204.89l1.34.94-5.81%208.38H9.02L5.78%209.67l1.34-1.25%202.57%202.4z%27%20fill%3D%27%23ffffff%27%2F%3E%3C%2Fsvg%3E") !important;
    display: inline-block !important;
    margin: 0 !important;
    width: 20px !important;
    height: 20px !important;
}

/* Table specific */
.wpcst-wrap .wp-list-table input[type="number"],
.wpcst-wrap .wp-list-table select {
    width: auto;
    max-width: 100%;
    height: 36px !important;
    padding: 4px 10px !important;
}

/* Select2 Overrides to match height and border */
.wpcst-edit-form .select2-container .select2-selection--single {
    border-radius: 8px !important;
    border: 1px solid #e2e8f0 !important;
    height: 40px !important;
    display: flex;
    align-items: center;
}

.wpcst-edit-form .select2-container .select2-selection--single .select2-selection__arrow {
    height: 38px !important;
}

.wpcst-edit-form .select2-container--focus .select2-selection--single {
    border-color: #10b981 !important;
    box-shadow: 0 0 0 3px #ecfdf5 !important;
}

/* Add Buttons */
.wpcst-edit-form .button#wpcst-add-new-attr-mapping,
.wpcst-edit-form .button#wpcst-add-new-mapping {
    height: 40px !important;
    border-radius: 8px !important;
    padding: 0 20px !important;
    background: #fff !important;
    border: 1px solid #e2e8f0 !important;
    color: #475569 !important;
    font-weight: 600 !important;
    transition: all 0.2s ease;
    line-height: normal !important;
    display: inline-flex;
    align-items: center;
}

.wpcst-edit-form .button#wpcst-add-new-attr-mapping:hover,
.wpcst-edit-form .button#wpcst-add-new-mapping:hover {
    border-color: #10b981 !important;
    color: #10b981 !important;
    background: #f8fafc !important;
}

/* Remove Mapping Buttons */
.wpcst-wrap .wp-list-table .button.remove-mapping {
    width: 36px !important;
    height: 36px !important;
    padding: 0 !important;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    border-radius: 6px !important;
    background: #fee2e2 !important;
    color: #ef4444 !important;
    border: 1px solid #fecaca !important;
    font-weight: bold;
    transition: all 0.2s ease;
    line-height: normal !important;
}

.wpcst-wrap .wp-list-table .button.remove-mapping:hover {
    background: #ef4444 !important;
    color: #fff !important;
    border-color: #ef4444 !important;
}

/* WPC SS Form Data Tables */
.wpcst-wrap .wp-list-table {
    border: 1px solid #e2e8f0 !important;
    border-radius: 8px !important;
    box-shadow: none !important;
    border-spacing: 0 !important;
    overflow: hidden !important;
    width: 100% !important;
    margin-top: 15px !important;
}

.wpcst-wrap .wp-list-table thead th,
.wpcst-wrap .wp-list-table thead td {
    background: #f8fafc !important;
    padding: 12px 15px !important;
    font-weight: 700 !important;
    color: #475569 !important;
    border-bottom: 2px solid #f1f5f9 !important;
    font-size: 14px !important;
}

.wpcst-wrap .wp-list-table tbody td,
.wpcst-wrap .wp-list-table tbody th {
    padding: 12px 15px !important;
    vertical-align: middle !important;
    border-bottom: 1px solid #f1f5f9 !important;
    background: #fff !important;
    transition: all 0.2s ease;
    font-size: 14px !important;
}

.wpcst-wrap .wp-list-table tbody tr:last-child td,
.wpcst-wrap .wp-list-table tbody tr:last-child th {
    border-bottom: none !important;
}

.wpcst-wrap .wp-list-table tbody tr:nth-child(even) td,
.wpcst-wrap .wp-list-table tbody tr:nth-child(even) th {
    background: #f9fafb !important;
}

.wpcst-wrap .wp-list-table tbody tr:hover td,
.wpcst-wrap .wp-list-table tbody tr:hover th {
    background: #f1f5f9 !important;
}

/* WPC SS Primary Buttons */
.wpcst-wrap .wp-list-table .check-column {
    text-align: center !important;
    width: 50px !important;
    padding: 12px 10px !important;
}

.wpcst-wrap .wp-list-table .check-column input[type="checkbox"] {
    margin: 0 !important;
    vertical-align: middle !important;
    display: inline-block;
}

.wpcst-wrap .button-primary {
    height: 42px !important;
    border-radius: 8px !important;
    padding: 0 25px !important;
    background: #10b981 !important;
    border: none !important;
    font-weight: 600 !important;
    color: #fff !important;
    box-shadow: 0 4px 10px rgba(16, 185, 129, 0.2) !important;
    transition: all 0.2s ease !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: normal !important;
}

.wpcst-wrap .button-primary:hover {
    background: #059669 !important;
    transform: translateY(-1px);
    color: #fff !important;
    box-shadow: 0 6px 15px rgba(16, 185, 129, 0.3) !important;
}

.wpcst-wrap .wp-list-table tfoot th,
.wpcst-wrap .wp-list-table tfoot td {
    background: #f8fafc !important;
    padding: 12px 15px !important;
    font-weight: 700 !important;
    color: #475569 !important;
    border-top: 2px solid #f1f5f9 !important;
    border-bottom: none !important;
    font-size: 14px !important;
}

/* Right-align action buttons in mapping tables */
#wpcst-mapping-table th:last-child,
#wpcst-mapping-table td:last-child,
#wpcst-attr-mapping-table th:last-child,
#wpcst-attr-mapping-table td:last-child {
    text-align: right;
}