.bom-tool-page,
#bomMappingModal {
    --bom-blue: #1a6fb5;
    --bom-blue-dark: #0f5a96;
    --bom-border: #b7d4ea;
    --bom-muted: #6c757d;
}

.bom-page-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: #222;
}

.bom-upload-card {
    border: 2px dashed var(--bom-border);
    border-radius: 6px;
    background: #f8fbfe;
    padding: 1.75rem 1.5rem;
}

.bom-upload-card.is-dragover {
    border-color: var(--bom-blue);
    background: #eef6fc;
}

.bom-upload-lead {
    font-size: 1.05rem;
    color: #333;
}

.bom-drop-inner {
    text-align: center;
    padding: 1rem 0.5rem;
}

.bom-select-btn {
    background: var(--bom-blue);
    color: #fff !important;
    border-radius: 4px;
    padding: 0.4rem 0.9rem;
    font-weight: 600;
}

.bom-select-btn:hover,
.bom-select-btn:focus {
    background: var(--bom-blue-dark);
    color: #fff !important;
}

.bom-file-rules {
    color: var(--bom-muted);
    font-size: 0.92rem;
    max-width: 420px;
    margin-left: auto;
    margin-right: auto;
    text-align: left;
}

.bom-template-link {
    color: var(--bom-blue);
    font-weight: 600;
}

.bom-save-hint {
    background: #f3f6f9;
    border-radius: 4px;
    padding: 0.85rem 1rem;
    color: #444;
    font-size: 0.95rem;
}

.bom-lists-title {
    font-size: 1.25rem;
    font-weight: 700;
    border-bottom: 3px solid #28a745;
    display: inline-block;
    padding-bottom: 0.25rem;
    margin-bottom: 1rem;
}

.bom-lists-table td {
    vertical-align: middle;
    border-top: 1px solid #e9ecef;
}

.bom-list-name {
    font-weight: 600;
    color: #222;
}

.bom-verify-btn {
    border: 1px solid var(--bom-blue);
    color: var(--bom-blue);
    background: #fff;
    font-weight: 600;
    min-width: 72px;
}

.bom-verify-btn:hover {
    background: var(--bom-blue);
    color: #fff;
}

.bom-side-card {
    background: #fff;
    border: 1px solid #e5e9ef;
    border-radius: 6px;
    padding: 1.25rem;
}

.bom-side-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
}

.bom-steps li {
    margin-bottom: 0.5rem;
}

.bom-step-num {
    font-weight: 700;
    font-size: 0.92rem;
    margin-bottom: 0.35rem;
}

.bom-preview-wrap {
    border: 1px solid #dee2e6;
    border-radius: 4px;
}

.bom-preview-table th {
    background: #f7f9fb;
    white-space: nowrap;
    min-width: 140px;
}

.bom-preview-table .bom-assign-select {
    min-width: 130px;
    font-size: 0.85rem;
}

.bom-done-btn {
    background: #1a6fb5;
    background: var(--bom-blue, #1a6fb5);
    color: #fff !important;
    border-color: #1a6fb5;
    border-color: var(--bom-blue, #1a6fb5);
    font-weight: 600;
    padding: 0.45rem 1.1rem;
}

.bom-done-btn:hover,
.bom-done-btn:focus {
    background: #0f5a96;
    background: var(--bom-blue-dark, #0f5a96);
    color: #fff !important;
    border-color: #0f5a96;
    border-color: var(--bom-blue-dark, #0f5a96);
}

.bom-header-nav-link {
    white-space: nowrap;
}

.bom-match-stats {
    gap: 1.25rem;
}

.bom-stat {
    font-size: 0.95rem;
}

.bom-stat-matched {
    color: #1e7e34;
}

.bom-stat-multiple {
    color: #222;
}

.bom-stat-unmatched {
    color: #c82333;
}

/* Results header: title + total + actions */
.bom-results-header {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    justify-content: space-between;
    gap: 1rem 1.5rem;
}

.bom-results-title-block {
    flex: 1 1 220px;
    min-width: 0;
    display: flex;
    align-items: center;
}

.bom-results-title-block .bom-page-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    word-break: break-word;
}

.bom-rename-btn {
    color: var(--bom-blue);
    padding: 0.2rem 0.35rem;
    line-height: 1;
    flex-shrink: 0;
}

.bom-rename-btn:hover {
    color: var(--bom-blue-dark);
}

.bom-results-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    gap: 0.75rem;
}

.bom-total-panel {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 160px;
    padding: 0.65rem 1.1rem;
    background: #f0f6fb;
    border: 1px solid #c5d9ea;
    border-radius: 6px;
    text-align: right;
}

.bom-total-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: #5a6a7a;
    margin-bottom: 0.15rem;
}

.bom-total-value {
    display: block;
    font-size: 1.45rem;
    font-weight: 700;
    line-height: 1.2;
    color: #0f3d66;
}

.bom-action-btns {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    gap: 0.6rem;
}

.bom-download-btn,
.bom-add-basket-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    min-height: 48px;
    padding: 0.65rem 1.15rem;
    border-radius: 6px;
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1.2;
    border: 2px solid transparent;
    text-decoration: none !important;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.bom-download-btn {
    background: #fff;
    color: var(--bom-blue) !important;
    border-color: var(--bom-blue);
}

.bom-download-btn:hover,
.bom-download-btn:focus {
    background: #e8f2fa;
    color: var(--bom-blue-dark) !important;
    border-color: var(--bom-blue-dark);
    box-shadow: 0 1px 3px rgba(15, 90, 150, 0.15);
}

.bom-add-basket-btn {
    background: #f28e00;
    color: #fff !important;
    border-color: #f28e00;
    min-width: 160px;
    box-shadow: 0 1px 2px rgba(242, 142, 0, 0.25);
}

.bom-add-basket-btn:hover,
.bom-add-basket-btn:focus {
    background: #e07800;
    border-color: #e07800;
    color: #fff !important;
    box-shadow: 0 2px 6px rgba(224, 120, 0, 0.35);
}

.bom-add-basket-btn:disabled {
    opacity: 0.7;
    cursor: wait;
}

.bom-toolbar .bom-tool-link {
    color: #1a6fb5;
    font-weight: 600;
    padding-left: 0;
    padding-right: 1rem;
}

.bom-filter-select {
    width: auto;
    min-width: 180px;
}

.bom-results-table-wrap {
    border: 1px solid #dee2e6;
    background: #fff;
}

.bom-results-table th {
    background: #f5f7fa;
    white-space: nowrap;
    font-size: 0.85rem;
}

.bom-results-table td {
    vertical-align: middle;
    font-size: 0.9rem;
}

.bom-row-unmatched {
    background: #fde8ea !important;
}

.bom-thumb {
    width: 48px;
    height: 48px;
    object-fit: contain;
}

@media (max-width: 767.98px) {
    .bom-page-title {
        font-size: 1.4rem;
    }

    .bom-upload-card {
        padding: 1.25rem 1rem;
    }

    .bom-results-actions {
        width: 100%;
    }

    .bom-total-panel {
        flex: 1 1 100%;
        text-align: left;
    }

    .bom-action-btns {
        width: 100%;
    }

    .bom-download-btn,
    .bom-add-basket-btn {
        flex: 1 1 auto;
    }
}
