.bpm-table-card {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    overflow: hidden;
    margin: 8px 12px;
    padding: 0px 8px;
}

.bpm-table-card .bpm-table-wrapper {
    padding: 0;
}
/**
 * BOM Parts Manager Panel Styles
 * Tool for managing BOM parts and subtracting from Binner inventory
 * 
 * @package Alledio Production Dashboard
 * @version 1.0
 */

/* ==================== PANEL OVERLAY ==================== */
#bomPartsManagerPanel {
    display: none;
    position: fixed;
    z-index: 5000;
    top: var(--top-bar-height, 70px);
    left: 0;
    right: 0;
    bottom: 0;
    height: calc(100vh - var(--top-bar-height, 70px));
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    align-items: stretch;
    justify-content: flex-end;
    overflow: hidden;
    padding: 0;
    pointer-events: auto;
    opacity: 1;
    transition: opacity 0.3s ease, left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* When menu panel is open, shift entire panel to start after menu */
body.menu-open #bomPartsManagerPanel {
    left: 200px;
}

/* Panel container - slides in from right, full width */
#bomPartsManagerPanel .bpm-container {
    background-image: url("../../images/bg_noise.webp"), linear-gradient(180deg, #f8f8f7, #f1f0ee);
    background-position: 0 0, 0 0;
    background-size: auto, auto;
    border-radius: 0;
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.3);
    width: 100%;
    height: 100%;
    margin: 0;
    border: none;
    border-left: 1px solid #dddfe0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: absolute;
    right: -100%;
    transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==================== HEADER ==================== */
#bomPartsManagerPanel .bpm-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #dddfe0;
    flex-shrink: 0;
    background: white;
    gap: 16px;
}

#bomPartsManagerPanel .bpm-header-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

#bomPartsManagerPanel .bpm-header h2 {
    color: #2c3e50;
    margin: 0;
    font-size: 20px;
    font-weight: 600;
}

#bomPartsManagerPanel .bpm-header-icon {
    width: 24px;
    height: 24px;
    color: #2d8998;
}

#bomPartsManagerPanel .bpm-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ==================== TOOLBAR ==================== */
.bpm-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    background: #ffffff;
    border-bottom: 1px solid #e8ecef;
    flex-wrap: wrap;
    gap: 12px;
}

/* Filters row */
.bpm-filters-row {
    padding: 8px 10px 6px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.bpm-filter-controls {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: flex-start;
}

.bpm-filter-controls label {
    font-size: 12px;
    color: #334155;
    display: flex;
    align-items: center;
    gap: 6px;
}

.bpm-filter-controls select {
    padding: 4px 8px;
    border: 1px solid #e2e8f0;
    border-radius: 5px;
    font-size: 12px;
    background: #fff;
    color: #334155;
}

/* Compact FilterDropdown in BOM panel */
.bpm-filter-controls .filter-dropdown-trigger,
.bpm-filter-controls .filter-dropdown-input {
    padding: 4px 8px;
    min-height: 26px;
    font-size: 12px;
}

.bpm-filter-controls .filter-dropdown-label {
    font-size: 12px;
}

.bpm-filter-controls .filter-dropdown-wrapper {
    gap: 4px;
}

/* Compact FilterItemSelector styling for BOM filters */
#bpmFilterStatusContainer,
#bpmFilterStockContainer {
    width: auto;
}

#bpmFilterStatusContainer .filter-group,
#bpmFilterStockContainer .filter-group {
    padding: 4px 6px;
}

#bpmFilterStatusContainer .filter-group label,
#bpmFilterStockContainer .filter-group label {
    font-size: 12px;
    padding: 2px 4px;
}

/* Hide search box for these small filters */
#bpmFilterStatusContainer .filter-search-box,
#bpmFilterStockContainer .filter-search-box {
    display: none;
}

/* Compact item list styling */
#bpmFilterStatusContainer .filter-item,
#bpmFilterStockContainer .filter-item {
    padding: 3px 8px;
    font-size: 12px;
}

/* Compact clear button */
#bpmFilterStatusContainer .filter-clear-x,
#bpmFilterStockContainer .filter-clear-x {
    font-size: 10px;
}

.bpm-filter-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.bpm-filter-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 999px;
    font-size: 12px;
    color: #334155;
}

.bpm-filter-tag-remove {
    border: none;
    background: transparent;
    color: #94a3b8;
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    padding: 0;
}

.bpm-filter-tag-remove:hover {
    color: #ef4444;
}

.bpm-toolbar-left {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.bpm-toolbar-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Assemblies Input */
.bpm-assemblies-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.bpm-assemblies-label {
    font-size: 13px;
    font-weight: 500;
    color: #555;
    white-space: nowrap;
}

.bpm-assemblies-input {
    width: 70px;
    padding: 8px 12px;
    border: 1px solid #dddfe0;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    background: #fff;
    color: #2c3e50;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.bpm-assemblies-input:focus {
    outline: none;
    border-color: #2d8998;
    box-shadow: 0 0 0 3px rgba(45, 137, 152, 0.15);
}

/* Search Input */
.bpm-search-group {
    display: flex;
    align-items: center;
    position: relative;
}

.bpm-search-input {
    width: 220px;
    padding: 8px 12px 8px 36px;
    border: 1px solid #dddfe0;
    border-radius: 6px;
    font-size: 13px;
    background: #fff;
    color: #2c3e50;
    transition: border-color 0.2s, box-shadow 0.2s, width 0.2s;
}

.bpm-search-input:focus {
    outline: none;
    border-color: #2d8998;
    box-shadow: 0 0 0 3px rgba(45, 137, 152, 0.15);
    width: 280px;
}

.bpm-search-icon {
    position: absolute;
    left: 10px;
    width: 18px;
    height: 18px;
    color: #9ca3af;
    pointer-events: none;
}

.bpm-search-clear {
    position: absolute;
    right: 8px;
    width: 20px;
    height: 20px;
    padding: 0;
    border: none;
    background: transparent;
    color: #9ca3af;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s, color 0.2s;
}

.bpm-search-clear:hover {
    background: #f1f5f9;
    color: #64748b;
}

.bpm-search-clear.visible {
    display: flex;
}

/* ==================== BUTTONS ==================== */
.bpm-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
    white-space: nowrap;
}

.bpm-btn svg {
    width: 16px;
    height: 16px;
}

.bpm-btn-primary {
    background: #2d8998;
    color: white;
    border-color: #2d8998;
}

.bpm-btn-primary:hover {
    background: #247a87;
    border-color: #247a87;
}

.bpm-btn-primary:disabled {
    background: #94a3b8;
    border-color: #94a3b8;
    cursor: not-allowed;
    opacity: 0.7;
}

.bpm-btn-secondary {
    background: white;
    color: #2c3e50;
    border-color: #dddfe0;
}

.bpm-btn-secondary:hover {
    background: #f8f9fa;
    border-color: #b0bec5;
}

.bpm-btn-secondary:disabled {
    background: #f1f5f9;
    color: #94a3b8;
    cursor: not-allowed;
}

.bpm-btn-danger {
    background: #ef4444;
    color: white;
    border-color: #ef4444;
}

.bpm-btn-danger:hover {
    background: #dc2626;
    border-color: #dc2626;
}

.bpm-btn-warning {
    background: #f59e0b;
    color: white;
    border-color: #f59e0b;
}

.bpm-btn-warning:hover {
    background: #d97706;
    border-color: #d97706;
}

.bpm-btn-success {
    background: #10b981;
    color: white;
    border-color: #10b981;
}

.bpm-btn-success:hover {
    background: #059669;
    border-color: #059669;
}

.bpm-btn-close {
    width: auto;
    padding: 8px 16px;
    background: white;
    color: #2c3e50;
    border: 1px solid #dddfe0;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.bpm-btn-close:hover {
    background: #f8f9fa;
    border-color: #b0bec5;
}

/* Placeholder buttons (disabled look) */
.bpm-btn-placeholder {
    background: #f1f5f9;
    color: #94a3b8;
    border-color: #e2e8f0;
    cursor: not-allowed;
}

.bpm-btn-placeholder:hover {
    background: #f1f5f9;
    color: #94a3b8;
    border-color: #e2e8f0;
}

/* ==================== BODY/CONTENT ==================== */
.bpm-body {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    padding: 0;
}

/* ==================== TABLE WRAPPER ==================== */
.bpm-table-wrapper {
    flex: 1;
    overflow: auto;
    padding: 0;
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;
}

.bpm-table-wrapper::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.bpm-table-wrapper::-webkit-scrollbar-track {
    background: transparent;
}

.bpm-table-wrapper::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

.bpm-table-wrapper::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* ==================== TABLE ==================== */
.bpm-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: transparent;
    border-radius: 6px;
    overflow: visible;
    box-shadow: none;
    border: 1px solid var(--color-border);
    margin: 10px 0px;
}

.bpm-table thead {
    position: sticky;
    top: 0;
    z-index: 10;
}

.bpm-table th {
    background: #f8fafc;
    padding: 8px 10px;
    text-align: left;
    font-size: 11px;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 2px solid #e2e8f0;
    white-space: nowrap;
}

.bpm-table th.bpm-sortable {
    cursor: pointer;
    user-select: none;
    position: relative;
}

.bpm-table th.bpm-sortable::after {
    content: '⇅';
    font-size: 11px;
    color: #cbd5e1;
    margin-left: 6px;
}

.bpm-table th.bpm-sortable.active.asc::after {
    content: '↑';
    color: #2d8998;
}

.bpm-table th.bpm-sortable.active.desc::after {
    content: '↓';
    color: #2d8998;
}

.bpm-table th:first-child {
    border-top-left-radius: 8px;
}

.bpm-table th:last-child {
    border-top-right-radius: 8px;
}

.bpm-table td {
    padding: 6px 10px;
    font-size: 12px;
    color: #334155;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
}

.bpm-table tbody tr:hover {
    background: #f8fafc;
}

.bpm-table tbody tr:last-child td {
    border-bottom: none;
}

.bpm-table tbody tr:last-child td:first-child {
    border-bottom-left-radius: 8px;
}

.bpm-table tbody tr:last-child td:last-child {
    border-bottom-right-radius: 8px;
}

/* Row states */
.bpm-table tbody tr.bpm-row-not-found {
    background: #fef2f2;
}

.bpm-table tbody tr.bpm-row-not-found:hover {
    background: #fee2e2;
}

.bpm-table tbody tr.bpm-row-insufficient {
    background: #fffbeb;
}

.bpm-table tbody tr.bpm-row-insufficient:hover {
    background: #fef3c7;
}

.bpm-table tbody tr.bpm-row-editing {
    background: #f0f9ff;
}

.bpm-table tbody tr.bpm-row-editing:hover {
    background: #e0f2fe;
}

.bpm-table tbody tr.bpm-row-subtracted {
    background: #f0fdf4;
}

.bpm-table tbody tr.bpm-row-subtracted:hover {
    background: #dcfce7;
}

/* ==================== TABLE INPUTS ==================== */
.bpm-table-input {
    width: 100%;
    padding: 4px 8px;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    font-size: 12px;
    background: #fff;
    color: #334155;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.bpm-table-input:focus {
    outline: none;
    border-color: #2d8998;
    box-shadow: 0 0 0 2px rgba(45, 137, 152, 0.15);
}

.bpm-table-input:disabled {
    background: #f8fafc;
    color: #64748b;
    cursor: not-allowed;
}

.bpm-table-input.bpm-input-qty {
    width: 60px;
    text-align: center;
}

.bpm-table-input.bpm-input-designators {
    width: 100px;
}

.bpm-table-input.bpm-input-mpn {
    min-width: 180px;
}

.bpm-table-input.bpm-input-mfr {
    min-width: 120px;
}

/* Quantity display */
.bpm-qty-display {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 6px;
    background: #f1f5f9;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    color: #334155;
}

.bpm-qty-display .bpm-qty-calc {
    color: #64748b;
    font-weight: 400;
}

.bpm-qty-display .bpm-qty-result {
    color: #2d8998;
    font-weight: 600;
}

/* ==================== TO ORDER COLUMN ==================== */
.bpm-to-order {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
}

.bpm-to-order-ok {
    background: #dcfce7;
    color: #166534;
}

.bpm-to-order-needed {
    background: #fef3c7;
    color: #92400e;
}

.bpm-to-order-missing {
    background: #fee2e2;
    color: #991b1b;
}

/* ==================== STATUS BADGES ==================== */
.bpm-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 500;
    white-space: nowrap;
}

.bpm-status-badge svg {
    width: 10px;
    height: 10px;
}

.bpm-status-badge.bpm-status-sufficient {
    background: #dcfce7;
    color: #166534;
}

.bpm-status-badge.bpm-status-insufficient {
    background: #fef3c7;
    color: #92400e;
}

.bpm-status-badge.bpm-status-no-stock {
    background: #fee2e2;
    color: #991b1b;
}

.bpm-status-badge.bpm-status-not-found {
    background: #f1f5f9;
    color: #64748b;
}

.bpm-status-badge.bpm-status-pending {
    background: #e0f2fe;
    color: #0369a1;
}

.bpm-status-badge.bpm-status-loading {
    background: #f3f4f6;
    color: #6b7280;
}

/* In Storage Badge */
.bpm-in-storage {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
}

.bpm-in-storage.bpm-yes {
    background: #dcfce7;
    color: #166534;
}

.bpm-in-storage.bpm-no {
    background: #fee2e2;
    color: #991b1b;
}

.bpm-in-storage svg {
    width: 12px;
    height: 12px;
}

/* ==================== MPN WITH TOOLTIP ==================== */
.bpm-mpn-cell {
    display: flex;
    align-items: center;
    gap: 6px;
}

.bpm-mpn-text {
    font-weight: 500;
    color: #1e293b;
}

.bpm-mpn-tooltip {
    position: relative;
    display: inline-flex;
    cursor: help;
}

.bpm-mpn-tooltip-icon {
    width: 16px;
    height: 16px;
    color: #94a3b8;
    transition: color 0.2s;
}

.bpm-mpn-tooltip:hover .bpm-mpn-tooltip-icon {
    color: #2d8998;
}

.bpm-mpn-tooltip-content {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    padding: 10px 14px;
    background: #1e293b;
    color: #f8fafc;
    font-size: 12px;
    line-height: 1.5;
    border-radius: 6px;
    white-space: normal;
    word-wrap: break-word;
    max-width: 400px;
    min-width: 200px;
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.bpm-mpn-tooltip-content::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: #1e293b;
}

.bpm-mpn-tooltip:hover .bpm-mpn-tooltip-content {
    opacity: 1;
    visibility: visible;
}

/* ==================== ACTIONS COLUMN ==================== */
.bpm-row-actions {
    display: flex;
    align-items: center;
    gap: 4px;
}

.bpm-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    padding: 0;
    border: none;
    background: transparent;
    border-radius: 4px;
    cursor: pointer;
    color: #64748b;
    transition: background 0.2s, color 0.2s;
}

.bpm-action-btn:hover {
    background: #f1f5f9;
    color: #334155;
}

.bpm-action-btn svg {
    width: 14px;
    height: 14px;
}

.bpm-action-btn.bpm-action-subtract {
    color: #2d8998;
}

.bpm-action-btn.bpm-action-subtract:hover {
    background: #e0f7fa;
    color: #1a6570;
}

.bpm-action-btn.bpm-action-add {
    color: #10b981;
}

.bpm-action-btn.bpm-action-add:hover {
    background: #d1fae5;
    color: #059669;
}

.bpm-action-btn.bpm-action-edit {
    color: #6366f1;
}

.bpm-action-btn.bpm-action-edit:hover {
    background: #eef2ff;
    color: #4f46e5;
}

.bpm-action-btn.bpm-action-refresh {
    color: #0ea5e9;
}

.bpm-action-btn.bpm-action-refresh:hover {
    background: #e0f2fe;
    color: #0284c7;
}

.bpm-action-btn.bpm-action-alt {
    color: #8b5cf6;
}

.bpm-action-btn.bpm-action-alt:hover {
    background: #ede9fe;
    color: #7c3aed;
}

.bpm-action-btn.bpm-action-remove {
    color: #ef4444;
}

.bpm-action-btn.bpm-action-remove:hover {
    background: #fef2f2;
    color: #dc2626;
}

.bpm-action-btn.bpm-action-add-new {
    color: #f59e0b;
}

.bpm-action-btn.bpm-action-add-new:hover {
    background: #fef3c7;
    color: #d97706;
}

.bpm-action-btn.bpm-action-print {
    color: #6366f1;
}

.bpm-action-btn.bpm-action-print:hover {
    background: #eef2ff;
    color: #4f46e5;
}

.bpm-action-btn.bpm-action-link {
    color: #0ea5e9;
    text-decoration: none;
}

.bpm-action-btn.bpm-action-link:hover {
    background: #e0f2fe;
    color: #0284c7;
}

.bpm-action-btn:disabled {
    color: #cbd5e1;
    cursor: not-allowed;
}

.bpm-action-btn:disabled:hover {
    background: transparent;
    color: #cbd5e1;
}

/* ==================== EMPTY STATE ==================== */
.bpm-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 24px;
    text-align: center;
    color: #64748b;
}

.bpm-empty-state > svg {
    width: 64px;
    height: 64px;
    color: #cbd5e1;
    margin-bottom: 20px;
}

.bpm-empty-state .bpm-btn svg {
    width: 16px;
    height: 16px;
    color: currentColor;
    margin-bottom: 0;
}

.bpm-empty-state h3 {
    font-size: 18px;
    font-weight: 600;
    color: #475569;
    margin: 0 0 8px 0;
}

.bpm-empty-state p {
    font-size: 14px;
    color: #64748b;
    margin: 0 0 24px 0;
    max-width: 400px;
}

/* ==================== FOOTER ==================== */
.bpm-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    background: #ffffff;
    border-top: 1px solid #e8ecef;
    flex-wrap: wrap;
    gap: 12px;
    max-height: 80px;
    opacity: 1;
    overflow: hidden;
    transition: max-height 0.3s ease, opacity 0.3s ease, padding 0.3s ease;
}

.bpm-footer.bpm-footer-hidden {
    max-height: 0;
    opacity: 0;
    padding: 0 20px;
    border-top: none;
}

.bpm-footer-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.bpm-footer-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.bpm-stats {
    display: flex;
    align-items: center;
    gap: 20px;
    font-size: 12px;
    color: #64748b;
}

.bpm-stat {
    display: flex;
    align-items: center;
    gap: 6px;
}

.bpm-clickable-stat {
    cursor: pointer;
}

.bpm-clickable-stat:hover .bpm-stat-label,
.bpm-clickable-stat:hover .bpm-stat-value {
    text-decoration: underline;
}

.bpm-stat-label {
    color: #94a3b8;
}

.bpm-stat-value {
    font-weight: 600;
    color: #334155;
}

.bpm-stat-value.bpm-stat-warning {
    color: #f59e0b;
}

.bpm-stat-value.bpm-stat-error {
    color: #ef4444;
}

.bpm-stat-value.bpm-stat-success {
    color: #10b981;
}

/* ==================== PAGINATION ==================== */
.bpm-pagination {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.bpm-pagination-info {
    font-size: 12px;
    color: #64748b;
    margin-right: 8px;
}

.bpm-pagination-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 26px;
    height: 26px;
    padding: 0 6px;
    border: 1px solid #e2e8f0;
    background: white;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 500;
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s;
}

.bpm-pagination-btn:hover:not(:disabled) {
    border-color: #2d8998;
    color: #2d8998;
}

.bpm-pagination-btn:disabled {
    background: #f8fafc;
    color: #cbd5e1;
    cursor: not-allowed;
}

.bpm-pagination-btn.active {
    background: #2d8998;
    border-color: #2d8998;
    color: white;
}

.bpm-pagination-btn svg {
    width: 12px;
    height: 12px;
}

.bpm-pagination-row {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 10px;
    margin: 10px 0px;
}

/* ==================== UNDO TOAST ==================== */
.bpm-undo-toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    background: #1e293b;
    color: #f8fafc;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: transform 0.3s ease, opacity 0.3s ease, visibility 0.3s;
}

.bpm-undo-toast.visible {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
    visibility: visible;
}

.bpm-undo-toast-message {
    font-size: 13px;
}

.bpm-undo-toast-btn {
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.15);
    border: none;
    border-radius: 4px;
    color: #fbbf24;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.bpm-undo-toast-btn:hover {
    background: rgba(255, 255, 255, 0.25);
}

.bpm-undo-toast-countdown {
    font-size: 11px;
    color: #94a3b8;
    min-width: 24px;
    text-align: center;
}

/* ==================== MATCH SELECTOR MODAL ==================== */
.bpm-match-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    z-index: 7000;
    display: none;
    align-items: center;
    justify-content: center;
    animation: bpmFadeIn 0.2s ease;
}

.bpm-match-modal-overlay.active {
    display: flex;
}

.bpm-match-modal {
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    max-width: 700px;
    width: 95%;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    animation: bpmSlideUp 0.3s ease;
}

.bpm-match-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #e8ecef;
}

.bpm-match-modal-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
    margin: 0;
}

.bpm-match-modal-close {
    width: 32px;
    height: 32px;
    padding: 0;
    border: none;
    background: transparent;
    border-radius: 6px;
    cursor: pointer;
    color: #64748b;
    transition: background 0.2s, color 0.2s;
}

.bpm-match-modal-close:hover {
    background: #f1f5f9;
    color: #1e293b;
}

.bpm-match-modal-close svg {
    width: 20px;
    height: 20px;
}

.bpm-match-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px 20px;
}

.bpm-match-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.bpm-match-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: #f8fafc;
    border: 2px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
}

.bpm-match-item:hover {
    background: #f1f5f9;
    border-color: #2d8998;
}

.bpm-match-item.bpm-match-exact {
    background: #f0fdf4;
    border-color: #86efac;
}

.bpm-match-item.bpm-match-exact:hover {
    background: #dcfce7;
}

.bpm-match-item-info {
    flex: 1;
}

.bpm-match-item-mpn {
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
}

.bpm-match-item-details {
    font-size: 12px;
    color: #64748b;
    margin-top: 2px;
}

.bpm-match-item.bpm-match-disabled {
    opacity: 0.5;
    cursor: not-allowed;
    border-color: #e2e8f0;
    background: #f8fafc;
}

.bpm-match-pill {
    display: inline-block;
    margin-left: 8px;
    padding: 2px 6px;
    background: #f8fafc;
    border-radius: 999px;
    font-size: 11px;
    color: #475569;
    border: 1px solid #e2e8f0;
}

.bpm-match-item-stock {
    text-align: right;
}

.bpm-match-item-qty {
    font-size: 16px;
    font-weight: 600;
    color: #2d8998;
}

.bpm-match-item-location {
    font-size: 11px;
    color: #94a3b8;
    margin-top: 2px;
}

.bpm-match-modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    padding: 16px 20px;
    border-top: 1px solid #e8ecef;
}

/* ==================== CONFIRM MODAL ==================== */
.bpm-confirm-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 10000; /* Must be highest - above everything including import modal */
    display: none;
    align-items: center;
    justify-content: center;
}

.bpm-confirm-modal-overlay.active {
    display: flex;
}

.bpm-confirm-modal {
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    max-width: 500px;
    width: 95%;
    animation: bpmSlideUp 0.3s ease;
}

.bpm-confirm-modal-header {
    padding: 20px 24px 0;
}

.bpm-confirm-modal-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: #1e293b;
    margin: 0;
}

.bpm-confirm-modal-body {
    padding: 16px 24px;
}

.bpm-confirm-modal-body p {
    font-size: 14px;
    color: #475569;
    margin: 0 0 12px 0;
    line-height: 1.6;
}

/* Export options */
.bpm-export-options {
    display: flex;
    gap: 12px;
    margin-top: 16px;
}

.bpm-export-option {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 20px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    transition: all 0.2s;
}

.bpm-export-option:hover {
    border-color: #2d8998;
    background: rgba(45, 137, 152, 0.05);
}

.bpm-export-option svg {
    color: #64748b;
}

.bpm-export-option:hover svg {
    color: #2d8998;
}

.bpm-confirm-preview {
    background: #f8fafc;
    border-radius: 8px;
    padding: 12px 16px;
    margin: 16px 0;
}

.bpm-confirm-preview-title {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    color: #64748b;
    margin-bottom: 8px;
}

.bpm-confirm-preview-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}

.bpm-confirm-preview-stat {
    font-size: 13px;
}

.bpm-confirm-preview-stat span:first-child {
    color: #64748b;
}

.bpm-confirm-preview-stat span:last-child {
    font-weight: 600;
    color: #1e293b;
}

.bpm-confirm-modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    padding: 16px 24px 20px;
}

/* ==================== ALTERNATIVE PART DISPLAY ==================== */
.bpm-mpn-primary {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-weight: 600;
    color: #1e293b;
}

.bpm-mpn-original {
    display: inline-block;
    font-size: 10px;
    color: #94a3b8;
    margin-left: 8px;
    text-decoration: line-through;
}

.bpm-mpn-alternative-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 1px 5px;
    background: #dbeafe;
    color: #1d4ed8;
    border-radius: 4px;
    font-size: 9px;
    font-weight: 500;
    margin-left: 6px;
    vertical-align: middle;
}

/* ==================== ALTERNATIVE PART MODAL ==================== */
.bpm-alt-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 9000;
    display: none;
    align-items: center;
    justify-content: center;
    animation: bpmFadeIn 0.2s ease;
}

.bpm-alt-modal-overlay.active {
    display: flex;
}

.bpm-alt-modal {
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    max-width: 700px;
    width: 95%;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    animation: bpmSlideUp 0.3s ease;
}

.bpm-alt-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #e8ecef;
}

.bpm-alt-modal-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
    margin: 0;
}

.bpm-alt-modal-close {
    width: 32px;
    height: 32px;
    padding: 0;
    border: none;
    background: transparent;
    border-radius: 6px;
    cursor: pointer;
    color: #64748b;
    transition: background 0.2s, color 0.2s;
}

.bpm-alt-modal-close:hover {
    background: #f1f5f9;
    color: #1e293b;
}

.bpm-alt-modal-close svg {
    width: 20px;
    height: 20px;
}

.bpm-alt-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px 20px;
}

.bpm-alt-modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    padding: 16px 20px;
    border-top: 1px solid #e8ecef;
}

/* Search Info */
.bpm-alt-search-info {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 16px;
    background: #f8fafc;
    border-radius: 8px;
    margin-bottom: 16px;
}

.bpm-alt-search-info svg {
    width: 20px;
    height: 20px;
    color: #64748b;
    flex-shrink: 0;
    margin-top: 2px;
}

.bpm-alt-search-info-content {
    flex: 1;
}

.bpm-alt-search-label {
    font-size: 11px;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.bpm-alt-search-value {
    font-size: 13px;
    font-weight: 500;
    color: #1e293b;
    margin-top: 2px;
}

.bpm-alt-search-keywords {
    font-size: 12px;
    color: #64748b;
    margin-top: 4px;
}

/* Results Section */
.bpm-alt-results-section {
    margin-bottom: 20px;
}

.bpm-alt-results-title {
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 10px;
}

.bpm-alt-results-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 250px;
    overflow-y: auto;
}

.bpm-alt-result-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    background: #f8fafc;
    border: 2px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
}

.bpm-alt-result-item:hover {
    background: #f1f5f9;
    border-color: #2d8998;
}

.bpm-alt-result-item.selected {
    background: #e0f7fa;
    border-color: #2d8998;
}

.bpm-alt-result-info {
    flex: 1;
    min-width: 0;
}

.bpm-alt-result-mpn {
    font-size: 13px;
    font-weight: 600;
    color: #1e293b;
}

.bpm-alt-result-details {
    font-size: 11px;
    color: #64748b;
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.bpm-alt-result-stock {
    text-align: right;
    flex-shrink: 0;
}

.bpm-alt-result-qty {
    font-size: 14px;
    font-weight: 600;
    color: #2d8998;
}

.bpm-alt-result-location {
    font-size: 10px;
    color: #94a3b8;
}

.bpm-alt-no-results {
    text-align: center;
    padding: 24px;
    color: #64748b;
    font-size: 13px;
}

.bpm-alt-no-results svg {
    width: 40px;
    height: 40px;
    color: #cbd5e1;
    margin-bottom: 12px;
}

/* Manual Entry Section */
.bpm-alt-manual-section {
    border-top: 1px solid #e8ecef;
    padding-top: 16px;
}

.bpm-alt-manual-title {
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 10px;
}

.bpm-alt-manual-input-group {
    display: flex;
    gap: 8px;
}

.bpm-alt-manual-input {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 13px;
    background: #fff;
    color: #334155;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.bpm-alt-manual-input:focus {
    outline: none;
    border-color: #2d8998;
    box-shadow: 0 0 0 2px rgba(45, 137, 152, 0.15);
}

.bpm-alt-manual-input::placeholder {
    color: #94a3b8;
}

.bpm-alt-manual-search-btn {
    padding: 10px 16px;
    background: #2d8998;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
    white-space: nowrap;
}

.bpm-alt-manual-search-btn:hover {
    background: #247a87;
}

.bpm-alt-manual-search-btn:disabled {
    background: #94a3b8;
    cursor: not-allowed;
}

.bpm-alt-manual-result {
    margin-top: 12px;
    padding: 12px 14px;
    background: #f0fdf4;
    border: 1px solid #86efac;
    border-radius: 6px;
}

.bpm-alt-manual-result.error {
    background: #fef2f2;
    border-color: #fca5a5;
}

.bpm-alt-manual-result-text {
    font-size: 13px;
    color: #166534;
}

.bpm-alt-manual-result.error .bpm-alt-manual-result-text {
    color: #991b1b;
}

/* Loading state */
.bpm-alt-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 24px;
    gap: 12px;
}

.bpm-alt-loading-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid #e2e8f0;
    border-top-color: #2d8998;
    border-radius: 50%;
    animation: bpmSpin 0.8s linear infinite;
}

.bpm-alt-loading-text {
    font-size: 13px;
    color: #64748b;
}

/* ==================== DUPLICATE ROW ==================== */
.bpm-table tbody tr.bpm-row-duplicate {
    background: #fef2f2;
    border-left: 3px solid #ef4444;
}

.bpm-table tbody tr.bpm-row-duplicate:hover {
    background: #fee2e2;
}

/* ==================== IMPORT MODAL ==================== */
.bpm-import-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 7000;
    display: none;
    align-items: center;
    justify-content: center;
    animation: bpmFadeIn 0.2s ease;
}

.bpm-import-modal-overlay.active {
    display: flex;
}

.bpm-import-modal {
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    max-width: 600px;
    width: 95%;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    animation: bpmSlideUp 0.3s ease;
}

.bpm-import-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid #e8ecef;
}

.bpm-import-modal-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: #1e293b;
    margin: 0;
}

.bpm-import-modal-close {
    width: 32px;
    height: 32px;
    padding: 0;
    border: none;
    background: transparent;
    border-radius: 6px;
    cursor: pointer;
    color: #64748b;
    transition: background 0.2s, color 0.2s;
}

.bpm-import-modal-close:hover {
    background: #f1f5f9;
    color: #1e293b;
}

.bpm-import-modal-close svg {
    width: 20px;
    height: 20px;
}

.bpm-import-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
}

.bpm-import-modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 24px;
    border-top: 1px solid #e8ecef;
}

/* Dropzone */
.bpm-import-dropzone {
    border: 2px dashed #cbd5e1;
    border-radius: 12px;
    padding: 48px 24px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
}

.bpm-import-dropzone:hover {
    border-color: #2d8998;
    background: rgba(45, 137, 152, 0.03);
}

.bpm-import-dropzone.dragover {
    border-color: #2d8998;
    background: rgba(45, 137, 152, 0.08);
    border-style: solid;
}

.bpm-import-dropzone-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.bpm-import-dropzone-icon {
    width: 48px;
    height: 48px;
    color: #94a3b8;
    margin-bottom: 8px;
}

.bpm-import-dropzone-text {
    font-size: 16px;
    font-weight: 500;
    color: #334155;
    margin: 0;
}

.bpm-import-dropzone-subtext {
    font-size: 13px;
    color: #64748b;
}

.bpm-import-dropzone-formats {
    font-size: 11px;
    color: #94a3b8;
    margin-top: 8px;
}

/* Processing State */
.bpm-import-processing {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 24px;
    gap: 16px;
}

.bpm-import-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #e2e8f0;
    border-top-color: #2d8998;
    border-radius: 50%;
    animation: bpmSpin 0.8s linear infinite;
}

.bpm-import-processing-text {
    font-size: 14px;
    color: #64748b;
    margin: 0;
}

/* Preview */
.bpm-import-preview {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.bpm-import-preview-hidden {
    display: none !important;
}

.bpm-import-file-info {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.bpm-import-file-info > svg {
    width: 32px;
    height: 32px;
    color: #10b981;
    flex-shrink: 0;
}

.bpm-import-file-details {
    flex: 1;
    min-width: 0;
}

.bpm-import-file-name {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.bpm-import-file-meta {
    display: block;
    font-size: 12px;
    color: #64748b;
    margin-top: 2px;
}

.bpm-import-file-clear {
    width: 28px;
    height: 28px;
    padding: 0;
    border: none;
    background: transparent;
    border-radius: 4px;
    cursor: pointer;
    color: #94a3b8;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, color 0.2s;
}

.bpm-import-file-clear:hover {
    background: #fee2e2;
    color: #ef4444;
}

.bpm-import-file-clear svg {
    width: 16px;
    height: 16px;
}

/* Re-import Warning */
.bpm-import-warning {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: #fef3c7;
    border: 1px solid #fbbf24;
    border-radius: 6px;
    font-size: 13px;
    color: #92400e;
}

.bpm-import-warning svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    color: #f59e0b;
}

/* Stats */
.bpm-import-stats {
    display: flex;
    gap: 16px;
}

.bpm-import-stat {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 16px;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.bpm-import-stat-value {
    font-size: 28px;
    font-weight: 700;
    color: #1e293b;
}

.bpm-import-stat-label {
    font-size: 12px;
    color: #64748b;
    margin-top: 4px;
}

.bpm-import-stat.bpm-import-stat-success .bpm-import-stat-value {
    color: #10b981;
}

.bpm-import-stat.bpm-import-stat-info .bpm-import-stat-value {
    color: #2d8998;
}

/* Column Mapping */
.bpm-import-mapping {
    background: #fffbeb;
    border: 1px solid #fbbf24;
    border-radius: 8px;
    padding: 16px;
}

.bpm-import-mapping-header {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 16px;
    font-size: 13px;
    color: #92400e;
}

.bpm-import-mapping-header svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    color: #f59e0b;
    margin-top: 1px;
}

.bpm-import-mapping-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.bpm-import-mapping-item {
    display: flex;
    align-items: center;
    gap: 12px;
}

.bpm-import-mapping-label {
    flex: 0 0 180px;
    font-size: 13px;
    font-weight: 500;
    color: #334155;
}

.bpm-import-mapping-select {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 13px;
    background: white;
    color: #334155;
    cursor: pointer;
}

.bpm-import-mapping-select:focus {
    outline: none;
    border-color: #2d8998;
    box-shadow: 0 0 0 2px rgba(45, 137, 152, 0.15);
}

/* Errors */
.bpm-import-errors {
    background: #fef2f2;
    border: 1px solid #fca5a5;
    border-radius: 8px;
    padding: 16px;
}

.bpm-import-errors-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    font-size: 13px;
    font-weight: 600;
    color: #991b1b;
}

.bpm-import-errors-header svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    color: #ef4444;
}

.bpm-import-errors-list {
    max-height: 150px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.bpm-import-error-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: white;
    border-radius: 4px;
    font-size: 12px;
}

.bpm-import-error-mpn {
    font-weight: 600;
    color: #1e293b;
}

.bpm-import-error-reason {
    color: #64748b;
}

/* Import Mode */
.bpm-import-mode {
    padding: 16px;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.bpm-import-mode-label {
    font-size: 13px;
    font-weight: 600;
    color: #334155;
    margin-bottom: 12px;
    display: block;
}

.bpm-import-mode-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.bpm-import-mode-option {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #475569;
    cursor: pointer;
}

.bpm-import-mode-option input[type="radio"] {
    width: 16px;
    height: 16px;
    accent-color: #2d8998;
}

/* ==================== ANIMATIONS ==================== */
@keyframes bpmFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes bpmSlideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes bpmSpin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.bpm-spinning {
    animation: bpmSpin 1s linear infinite;
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 1024px) {
    .bpm-toolbar {
        padding: 12px 16px;
    }
    
    .bpm-search-input {
        width: 180px;
    }
    
    .bpm-search-input:focus {
        width: 200px;
    }
    
    .bpm-table-wrapper {
        padding: 12px 16px;
    }
}

@media (max-width: 768px) {
    .bpm-toolbar-left,
    .bpm-toolbar-right {
        width: 100%;
        justify-content: space-between;
    }
    
    .bpm-footer-left,
    .bpm-footer-right {
        width: 100%;
        justify-content: center;
    }
    
    .bpm-pagination {
        width: 100%;
        justify-content: center;
    }
    
    .bpm-table {
        font-size: 12px;
    }
    
    .bpm-table th,
    .bpm-table td {
        padding: 8px 10px;
    }
}

/* ==================== DARK MODE ==================== */
@media (prefers-color-scheme: dark) {
    #bomPartsManagerPanel .bpm-container {
        background-image: none;
        background: var(--color-bg-input-disabled, #0a0b0c);
        border-left-color: rgba(255, 255, 255, 0.12);
    }
    
    #bomPartsManagerPanel .bpm-header {
        background: var(--color-bg, #0f1113);
        border-bottom-color: rgba(255, 255, 255, 0.12);
    }
    
    #bomPartsManagerPanel .bpm-header h2 {
        color: var(--color-text-primary, #e5e7eb);
    }
    
    .bpm-toolbar {
        background: var(--color-bg, #0f1113);
        border-bottom-color: rgba(255, 255, 255, 0.12);
    }
    
    .bpm-assemblies-label {
        color: var(--color-text-secondary, #cbd5e1);
    }
    
    .bpm-assemblies-input,
    .bpm-search-input {
        background: var(--color-bg-input, #111315);
        border-color: rgba(255, 255, 255, 0.12);
        color: var(--color-text-primary, #e5e7eb);
    }
    
    .bpm-assemblies-input:focus,
    .bpm-search-input:focus {
        border-color: var(--color-primary, #2d8998);
        box-shadow: 0 0 0 3px rgba(45, 137, 152, 0.2);
    }
    
    .bpm-search-icon {
        color: var(--color-text-tertiary, #6b7280);
    }
    
    .bpm-btn-secondary {
        background: var(--color-bg-input, #111315);
        color: var(--color-text-primary, #e5e7eb);
        border-color: rgba(255, 255, 255, 0.12);
    }
    
    .bpm-btn-secondary:hover {
        background: var(--color-bg-hover, rgba(255, 255, 255, 0.1));
        border-color: rgba(255, 255, 255, 0.2);
    }
    
    .bpm-btn-close {
        background: var(--color-bg-input, #111315);
        color: var(--color-text-primary, #e5e7eb);
        border-color: rgba(255, 255, 255, 0.12);
    }
    
    .bpm-btn-close:hover {
        background: var(--color-bg-hover, rgba(255, 255, 255, 0.1));
    }
    
    .bpm-btn-placeholder {
        background: rgba(255, 255, 255, 0.05);
        color: var(--color-text-tertiary, #6b7280);
        border-color: rgba(255, 255, 255, 0.08);
    }
    
    .bpm-table-wrapper {
        scrollbar-color: #475569 transparent;
    }
    
    .bpm-table-wrapper::-webkit-scrollbar-thumb {
        background: #475569;
    }
    
    .bpm-table {
        background: var(--color-bg, #0f1113);
        border-color: rgba(255, 255, 255, 0.12);
    }
    
    .bpm-table th {
        background: var(--color-bg-input, #111315);
        color: var(--color-text-secondary, #cbd5e1);
        border-bottom-color: rgba(255, 255, 255, 0.12);
    }
    
    .bpm-table td {
        color: var(--color-text-primary, #e5e7eb);
        border-bottom-color: rgba(255, 255, 255, 0.06);
    }
    
    .bpm-table tbody tr:hover {
        background: rgba(255, 255, 255, 0.03);
    }
    
    .bpm-table tbody tr.bpm-row-not-found {
        background: rgba(239, 68, 68, 0.1);
    }
    
    .bpm-table tbody tr.bpm-row-not-found:hover {
        background: rgba(239, 68, 68, 0.15);
    }
    
    .bpm-table tbody tr.bpm-row-insufficient {
        background: rgba(245, 158, 11, 0.1);
    }
    
    .bpm-table tbody tr.bpm-row-insufficient:hover {
        background: rgba(245, 158, 11, 0.15);
    }
    
    .bpm-table tbody tr.bpm-row-editing {
        background: rgba(45, 137, 152, 0.1);
    }
    
    .bpm-table tbody tr.bpm-row-editing:hover {
        background: rgba(45, 137, 152, 0.15);
    }
    
    .bpm-table tbody tr.bpm-row-subtracted {
        background: rgba(16, 185, 129, 0.1);
    }
    
    .bpm-table-input {
        background: var(--color-bg-input, #111315);
        border-color: rgba(255, 255, 255, 0.12);
        color: var(--color-text-primary, #e5e7eb);
    }
    
    .bpm-table-input:focus {
        border-color: var(--color-primary, #2d8998);
    }
    
    .bpm-table-input:disabled {
        background: rgba(255, 255, 255, 0.03);
        color: var(--color-text-tertiary, #6b7280);
    }
    
    .bpm-qty-display {
        background: rgba(255, 255, 255, 0.08);
        color: var(--color-text-primary, #e5e7eb);
    }
    
    .bpm-qty-display .bpm-qty-calc {
        color: var(--color-text-tertiary, #6b7280);
    }

    /* To Order column dark mode */
    .bpm-to-order-ok {
        background: rgba(16, 185, 129, 0.2);
        color: #34d399;
    }

    .bpm-to-order-needed {
        background: rgba(245, 158, 11, 0.2);
        color: #fbbf24;
    }

    .bpm-to-order-missing {
        background: rgba(239, 68, 68, 0.2);
        color: #f87171;
    }
    
    .bpm-status-badge.bpm-status-sufficient {
        background: rgba(16, 185, 129, 0.2);
        color: #34d399;
    }
    
    .bpm-status-badge.bpm-status-insufficient {
        background: rgba(245, 158, 11, 0.2);
        color: #fbbf24;
    }
    
    .bpm-status-badge.bpm-status-no-stock {
        background: rgba(239, 68, 68, 0.2);
        color: #f87171;
    }
    
    .bpm-status-badge.bpm-status-not-found {
        background: rgba(255, 255, 255, 0.08);
        color: var(--color-text-tertiary, #6b7280);
    }
    
    .bpm-in-storage.bpm-yes {
        background: rgba(16, 185, 129, 0.2);
        color: #34d399;
    }
    
    .bpm-in-storage.bpm-no {
        background: rgba(239, 68, 68, 0.2);
        color: #f87171;
    }
    
    .bpm-mpn-text {
        color: var(--color-text-primary, #e5e7eb);
    }
    
    .bpm-mpn-tooltip-icon {
        color: var(--color-text-tertiary, #6b7280);
    }
    
    .bpm-mpn-tooltip:hover .bpm-mpn-tooltip-icon {
        color: var(--color-primary, #2d8998);
    }
    
    .bpm-action-btn {
        color: var(--color-text-tertiary, #6b7280);
    }
    
    .bpm-action-btn:hover {
        background: rgba(255, 255, 255, 0.08);
        color: var(--color-text-primary, #e5e7eb);
    }
    
    .bpm-action-btn.bpm-action-subtract:hover {
        background: rgba(45, 137, 152, 0.15);
    }
    
    .bpm-action-btn.bpm-action-add:hover {
        background: rgba(16, 185, 129, 0.15);
    }
    
    .bpm-action-btn.bpm-action-edit:hover {
        background: rgba(99, 102, 241, 0.15);
    }
    
    .bpm-action-btn.bpm-action-refresh:hover {
        background: rgba(14, 165, 233, 0.15);
    }

    .bpm-action-btn.bpm-action-alt {
        color: #a78bfa;
    }

    .bpm-action-btn.bpm-action-alt:hover {
        background: rgba(139, 92, 246, 0.15);
    }

    .bpm-action-btn.bpm-action-remove:hover {
        background: rgba(239, 68, 68, 0.15);
    }

    .bpm-action-btn.bpm-action-add-new {
        color: #fbbf24;
    }

    .bpm-action-btn.bpm-action-add-new:hover {
        background: rgba(245, 158, 11, 0.15);
    }

    .bpm-action-btn.bpm-action-print {
        color: #818cf8;
    }

    .bpm-action-btn.bpm-action-print:hover {
        background: rgba(99, 102, 241, 0.15);
    }

    .bpm-action-btn.bpm-action-link {
        color: #38bdf8;
    }

    .bpm-action-btn.bpm-action-link:hover {
        background: rgba(14, 165, 233, 0.15);
    }
    
    .bpm-action-btn:disabled {
        color: rgba(255, 255, 255, 0.2);
    }
    
    .bpm-empty-state svg {
        color: var(--color-text-tertiary, #6b7280);
    }
    
    .bpm-empty-state h3 {
        color: var(--color-text-secondary, #cbd5e1);
    }
    
    .bpm-empty-state p {
        color: var(--color-text-tertiary, #6b7280);
    }
    
    .bpm-footer {
        background: var(--color-bg, #0f1113);
        border-top-color: rgba(255, 255, 255, 0.12);
    }
    
    .bpm-footer.bpm-footer-hidden {
        border-top: none;
    }
    
    .bpm-stats {
        color: var(--color-text-tertiary, #6b7280);
    }
    
    .bpm-stat-label {
        color: var(--color-text-tertiary, #6b7280);
    }
    
    .bpm-stat-value {
        color: var(--color-text-primary, #e5e7eb);
    }
    
    .bpm-pagination-info {
        color: var(--color-text-tertiary, #6b7280);
    }
    
    .bpm-pagination-btn {
        background: var(--color-bg-input, #111315);
        border-color: rgba(255, 255, 255, 0.12);
        color: var(--color-text-secondary, #cbd5e1);
    }
    
    .bpm-pagination-btn:hover:not(:disabled) {
        border-color: var(--color-primary, #2d8998);
        color: var(--color-primary, #2d8998);
    }
    
    .bpm-pagination-btn:disabled {
        background: rgba(255, 255, 255, 0.03);
        color: rgba(255, 255, 255, 0.2);
    }
    
    .bpm-match-modal,
    .bpm-confirm-modal {
        background: var(--color-bg, #0f1113);
    }
    
    .bpm-match-modal-header,
    .bpm-confirm-modal-header {
        border-bottom-color: rgba(255, 255, 255, 0.12);
    }
    
    .bpm-match-modal-header h3,
    .bpm-confirm-modal-header h3 {
        color: var(--color-text-primary, #e5e7eb);
    }
    
    .bpm-match-modal-close {
        color: var(--color-text-tertiary, #6b7280);
    }
    
    .bpm-match-modal-close:hover {
        background: rgba(255, 255, 255, 0.08);
        color: var(--color-text-primary, #e5e7eb);
    }
    
    .bpm-match-item {
        background: rgba(255, 255, 255, 0.03);
    }
    
    .bpm-match-item:hover {
        background: rgba(255, 255, 255, 0.06);
        border-color: var(--color-primary, #2d8998);
    }
    
    .bpm-match-item.bpm-match-exact {
        background: rgba(16, 185, 129, 0.1);
        border-color: rgba(16, 185, 129, 0.3);
    }
    
    .bpm-match-item-mpn {
        color: var(--color-text-primary, #e5e7eb);
    }
    
    .bpm-match-item-details {
        color: var(--color-text-tertiary, #6b7280);
    }
    
    .bpm-match-item-location {
        color: var(--color-text-tertiary, #6b7280);
    }
    
    .bpm-match-modal-footer,
    .bpm-confirm-modal-footer {
        border-top-color: rgba(255, 255, 255, 0.12);
    }
    
    .bpm-confirm-modal-body p {
        color: var(--color-text-secondary, #cbd5e1);
    }

    /* Export options dark mode */
    .bpm-export-option {
        border-color: rgba(255, 255, 255, 0.12);
    }

    .bpm-export-option:hover {
        border-color: var(--color-primary, #2d8998);
        background: rgba(45, 137, 152, 0.1);
    }

    .bpm-export-option svg {
        color: var(--color-text-tertiary, #6b7280);
    }

    .bpm-export-option:hover svg {
        color: var(--color-primary, #2d8998);
    }
    
    .bpm-confirm-preview {
        background: rgba(255, 255, 255, 0.03);
    }
    
    .bpm-confirm-preview-title {
        color: var(--color-text-tertiary, #6b7280);
    }
    
    .bpm-confirm-preview-stat span:first-child {
        color: var(--color-text-tertiary, #6b7280);
    }
    
    .bpm-confirm-preview-stat span:last-child {
        color: var(--color-text-primary, #e5e7eb);
    }
    
    .bpm-search-clear {
        color: var(--color-text-tertiary, #6b7280);
    }
    
    .bpm-search-clear:hover {
        background: rgba(255, 255, 255, 0.08);
        color: var(--color-text-secondary, #cbd5e1);
    }

    /* Duplicate row dark mode */
    .bpm-table tbody tr.bpm-row-duplicate {
        background: rgba(239, 68, 68, 0.15);
        border-left-color: #f87171;
    }

    .bpm-table tbody tr.bpm-row-duplicate:hover {
        background: rgba(239, 68, 68, 0.2);
    }

    /* Import modal dark mode */
    .bpm-import-modal {
        background: var(--color-bg, #0f1113);
    }

    .bpm-import-modal-header {
        border-bottom-color: rgba(255, 255, 255, 0.12);
    }

    .bpm-import-modal-header h3 {
        color: var(--color-text-primary, #e5e7eb);
    }

    .bpm-import-modal-close {
        color: var(--color-text-tertiary, #6b7280);
    }

    .bpm-import-modal-close:hover {
        background: rgba(255, 255, 255, 0.08);
        color: var(--color-text-primary, #e5e7eb);
    }

    .bpm-import-modal-footer {
        border-top-color: rgba(255, 255, 255, 0.12);
    }

    .bpm-import-dropzone {
        border-color: rgba(255, 255, 255, 0.2);
        background: transparent;
    }

    .bpm-import-dropzone:hover {
        border-color: var(--color-primary, #2d8998);
        background: rgba(45, 137, 152, 0.05);
    }

    .bpm-import-dropzone.dragover {
        border-color: var(--color-primary, #2d8998);
        background: rgba(45, 137, 152, 0.1);
    }

    .bpm-import-dropzone-icon {
        color: var(--color-text-tertiary, #6b7280);
    }

    .bpm-import-dropzone-text {
        color: var(--color-text-primary, #e5e7eb);
    }

    .bpm-import-dropzone-subtext {
        color: var(--color-text-tertiary, #6b7280);
    }

    .bpm-import-dropzone-formats {
        color: var(--color-text-tertiary, #6b7280);
    }

    .bpm-import-spinner {
        border-color: rgba(255, 255, 255, 0.1);
        border-top-color: var(--color-primary, #2d8998);
    }

    .bpm-import-processing-text {
        color: var(--color-text-tertiary, #6b7280);
    }

    .bpm-import-file-info {
        background: rgba(255, 255, 255, 0.03);
        border-color: rgba(255, 255, 255, 0.12);
    }

    .bpm-import-file-info > svg {
        color: #34d399;
    }

    .bpm-import-file-name {
        color: var(--color-text-primary, #e5e7eb);
    }

    .bpm-import-file-meta {
        color: var(--color-text-tertiary, #6b7280);
    }

    .bpm-import-file-clear {
        color: var(--color-text-tertiary, #6b7280);
    }

    .bpm-import-file-clear:hover {
        background: rgba(239, 68, 68, 0.15);
        color: #f87171;
    }

    .bpm-import-warning {
        background: rgba(245, 158, 11, 0.1);
        border-color: rgba(245, 158, 11, 0.3);
        color: #fbbf24;
    }

    .bpm-import-warning svg {
        color: #f59e0b;
    }

    .bpm-import-stat {
        background: rgba(255, 255, 255, 0.03);
        border-color: rgba(255, 255, 255, 0.12);
    }

    .bpm-import-stat-value {
        color: var(--color-text-primary, #e5e7eb);
    }

    .bpm-import-stat-label {
        color: var(--color-text-tertiary, #6b7280);
    }

    .bpm-import-stat.bpm-import-stat-success .bpm-import-stat-value {
        color: #34d399;
    }

    .bpm-import-mapping {
        background: rgba(245, 158, 11, 0.08);
        border-color: rgba(245, 158, 11, 0.3);
    }

    .bpm-import-mapping-header {
        color: #fbbf24;
    }

    .bpm-import-mapping-label {
        color: var(--color-text-secondary, #cbd5e1);
    }

    .bpm-import-mapping-select {
        background: var(--color-bg-input, #111315);
        border-color: rgba(255, 255, 255, 0.12);
        color: var(--color-text-primary, #e5e7eb);
    }

    .bpm-import-mapping-select:focus {
        border-color: var(--color-primary, #2d8998);
    }

    .bpm-import-errors {
        background: rgba(239, 68, 68, 0.1);
        border-color: rgba(239, 68, 68, 0.3);
    }

    .bpm-import-errors-header {
        color: #f87171;
    }

    .bpm-import-errors-header svg {
        color: #ef4444;
    }

    .bpm-import-error-item {
        background: rgba(255, 255, 255, 0.03);
    }

    .bpm-import-error-mpn {
        color: var(--color-text-primary, #e5e7eb);
    }

    .bpm-import-error-reason {
        color: var(--color-text-tertiary, #6b7280);
    }

    .bpm-import-mode {
        background: rgba(255, 255, 255, 0.03);
        border-color: rgba(255, 255, 255, 0.12);
    }

    .bpm-import-mode-label {
        color: var(--color-text-secondary, #cbd5e1);
    }

    .bpm-import-mode-option {
        color: var(--color-text-secondary, #cbd5e1);
    }

    /* Alternative Part Modal Dark Mode */
    .bpm-alt-modal {
        background: var(--color-bg, #0f1113);
    }

    .bpm-alt-modal-header {
        border-bottom-color: rgba(255, 255, 255, 0.12);
    }

    .bpm-alt-modal-header h3 {
        color: var(--color-text-primary, #e5e7eb);
    }

    .bpm-alt-modal-close {
        color: var(--color-text-tertiary, #6b7280);
    }

    .bpm-alt-modal-close:hover {
        background: rgba(255, 255, 255, 0.08);
        color: var(--color-text-primary, #e5e7eb);
    }

    .bpm-alt-modal-footer {
        border-top-color: rgba(255, 255, 255, 0.12);
    }

    .bpm-alt-search-info {
        background: rgba(255, 255, 255, 0.03);
    }

    .bpm-alt-search-info svg {
        color: var(--color-text-tertiary, #6b7280);
    }

    .bpm-alt-search-value {
        color: var(--color-text-primary, #e5e7eb);
    }

    .bpm-alt-search-keywords {
        color: var(--color-text-tertiary, #6b7280);
    }

    .bpm-alt-results-title {
        color: var(--color-text-tertiary, #6b7280);
    }

    .bpm-alt-result-item {
        background: rgba(255, 255, 255, 0.03);
    }

    .bpm-alt-result-item:hover {
        background: rgba(255, 255, 255, 0.06);
        border-color: var(--color-primary, #2d8998);
    }

    .bpm-alt-result-item.selected {
        background: rgba(45, 137, 152, 0.15);
    }

    .bpm-alt-result-mpn {
        color: var(--color-text-primary, #e5e7eb);
    }

    .bpm-alt-result-details {
        color: var(--color-text-tertiary, #6b7280);
    }

    .bpm-alt-no-results {
        color: var(--color-text-tertiary, #6b7280);
    }

    .bpm-alt-manual-section {
        border-top-color: rgba(255, 255, 255, 0.12);
    }

    .bpm-alt-manual-title {
        color: var(--color-text-tertiary, #6b7280);
    }

    .bpm-alt-manual-input {
        background: var(--color-bg-input, #111315);
        border-color: rgba(255, 255, 255, 0.12);
        color: var(--color-text-primary, #e5e7eb);
    }

    .bpm-alt-manual-input:focus {
        border-color: var(--color-primary, #2d8998);
    }

    .bpm-alt-manual-input::placeholder {
        color: var(--color-text-tertiary, #6b7280);
    }

    .bpm-alt-manual-result {
        background: rgba(16, 185, 129, 0.1);
        border-color: rgba(16, 185, 129, 0.3);
    }

    .bpm-alt-manual-result-text {
        color: #34d399;
    }

    .bpm-alt-manual-result.error {
        background: rgba(239, 68, 68, 0.1);
        border-color: rgba(239, 68, 68, 0.3);
    }

    .bpm-alt-manual-result.error .bpm-alt-manual-result-text {
        color: #f87171;
    }

    .bpm-alt-loading-spinner {
        border-color: rgba(255, 255, 255, 0.1);
        border-top-color: var(--color-primary, #2d8998);
    }

    .bpm-alt-loading-text {
        color: var(--color-text-tertiary, #6b7280);
    }

    /* Alternative Part Display Dark Mode */
    .bpm-mpn-primary {
        color: var(--color-text-primary, #e5e7eb);
    }

    .bpm-mpn-original {
        color: var(--color-text-tertiary, #6b7280);
    }

    .bpm-mpn-alternative-badge {
        background: rgba(59, 130, 246, 0.2);
        color: #60a5fa;
    }
}
