/**
 * Trade-In Products and ITB Management Styles
 * Additional styles for ITB management page
 * BaseCamp Design System - Modern Apple-Easy Style
 */

/* Import Figtree font */
@import url('https://fonts.googleapis.com/css2?family=Figtree:wght@300;400;500;600;700;800;900&display=swap');

/* Page Header */
.itb-page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.itb-page-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 0.25rem;
    letter-spacing: -0.02em;
}

.itb-page-subtitle {
    font-size: 0.875rem;
    color: #94a3b8;
    margin: 0;
}

/* Tab Navigation - Pricing Sheet Admin style */
.itb-tabs-container {
    background: #fff;
    border-radius: 10px;
    padding: 4px;
    border: 1px solid #e2e8f0;
    display: inline-flex;
}

.itb-tabs-container .nav-tabs {
    border: none;
}

.itb-tabs-container .nav-item {
    margin: 0;
}

.itb-tabs-container .nav-tabs .nav-link {
    border: none;
    background: transparent;
    color: #64748b;
    font-weight: 500;
    font-size: 0.875rem;
    padding: 0.5rem 1.25rem;
    border-radius: 8px;
    transition: all 0.15s ease;
    margin: 0 2px;
}

.itb-tabs-container .nav-tabs .nav-link:hover {
    background: #f8fafc;
    color: #1e293b;
    border: none;
}

.itb-tabs-container .nav-tabs .nav-link.active {
    background: #3b82f6 !important;
    color: #fff !important;
    border: none;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
    font-weight: 600;
}

/* ITB Modal Styles */
.itb-config-modal .modal-dialog,
.itb-form-modal .modal-dialog {
    max-width: 720px;
}

.itb-form-modal .modal-dialog {
    max-width: 600px;
}

.itb-modal-content {
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
    overflow: hidden;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--color-white);
}

.itb-modal-header {
    border-bottom: 1px solid #e5e7eb;
    padding: 1rem 1.25rem;
    background: var(--color-white);
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.itb-modal-header-content {
    flex: 1;
}

.itb-modal-title {
    font-weight: 600;
    font-size: 1.05rem;
    color: #1e293b;
    margin: 0 0 0.15rem 0;
    line-height: 1.3;
}

.itb-modal-subtitle {
    font-weight: 400;
    font-size: 0.78rem;
    color: #94a3b8;
    margin: 0;
    line-height: 1.4;
}

.itb-modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    opacity: 0.5;
    transition: opacity 0.2s ease;
    padding: 0.5rem;
    margin: -0.5rem -0.5rem -0.5rem 1rem;
}

.itb-modal-close:hover {
    opacity: 1;
}

.itb-modal-body {
    padding: 1rem 1.25rem;
    max-height: 70vh;
    overflow-y: auto;
}

/* ITB Config modal */
.itb-config-modal .itb-modal-body {
    max-height: 60vh;
    display: flex;
    flex-direction: column;
}

.itb-config-modal .nav-tabs {
    border-bottom: 1px solid #e5e7eb;
    margin-bottom: 0.6rem !important;
}

.itb-config-modal .nav-tabs .nav-link {
    font-size: 0.8rem;
    font-weight: 500;
    color: #64748b;
    padding: 0.4rem 0.75rem;
    border: none;
    border-bottom: 2px solid transparent;
    border-radius: 0;
    background: none;
}

.itb-config-modal .nav-tabs .nav-link.active {
    color: #1e293b;
    border-bottom-color: #3b82f6;
    background: none;
}

.itb-config-modal .nav-tabs .nav-link:hover:not(.active) {
    color: #1e293b;
    border-bottom-color: #e5e7eb;
}

.itb-config-modal .tab-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.itb-config-modal .tab-pane.active {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.itb-modal-footer {
    border-top: 1px solid #e5e7eb;
    padding: 0.75rem 1.25rem;
    background: var(--color-white);
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
}

/* Toolbar */
.itb-config-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.6rem;
    padding-bottom: 0;
    border-bottom: none;
}

.itb-section-title {
    font-weight: 600;
    font-size: 1rem;
    color: #1e293b;
    margin: 0;
}

/* Buttons */
.itb-btn-primary {
    background: #3b82f6;
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 0.35rem 0.75rem;
    font-weight: 500;
    font-size: 0.8rem;
    transition: background 0.15s ease;
}

.itb-btn-primary:hover {
    background: #2563eb;
}

.itb-btn-secondary {
    background: #fff;
    color: #374151;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    padding: 0.35rem 0.75rem;
    font-weight: 500;
    font-size: 0.8rem;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.itb-btn-secondary:hover {
    background: #f9fafb;
    border-color: #9ca3af;
}

/* Card Type Cards Grid */
.itb-config-content {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.25rem;
    margin-bottom: 1.5rem;
}

.itb-card-type-card {
    background: var(--color-white);
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 1.25rem;
    transition: border-color 0.15s ease;
    position: relative;
}

.itb-card-type-card:hover {
    border-color: #3b82f6;
}

.itb-card-type-card.disabled {
    opacity: 0.6;
    background: var(--color-gray-50);
}

/* Card Types Table Layout */
.itb-config-table-wrap {
    overflow-x: auto;
    overflow-y: auto;
    margin-bottom: 0;
    flex: 0 1 auto;
    max-height: 100%;
}

.itb-config-table {
    font-size: 0.8125rem;
    margin: 0;
    border-collapse: collapse;
}

.itb-config-table th {
    font-weight: 600;
    color: #64748b;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 0.4rem 0.6rem;
    border-bottom: 2px solid #e5e7eb;
    height: auto !important;
    min-height: 0 !important;
    min-width: 0 !important;
}

.itb-config-table td {
    padding: 0.35rem 0.6rem;
    vertical-align: middle;
    border-bottom: 1px solid #f1f5f9;
    height: auto !important;
    min-height: 0 !important;
    min-width: 0 !important;
}

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

.itb-row-disabled {
    opacity: 0.6;
}

.itb-table-name {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.itb-table-icon {
    color: #64748b;
    font-size: 0.8rem;
    width: 1.2rem;
    text-align: center;
}

.itb-table-btn {
    width: 26px;
    height: 26px;
    padding: 0;
    border: none;
    border-radius: 4px;
    background: transparent;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    font-size: 0.75rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.itb-table-btn:hover {
    background: #f1f5f9;
}

.itb-table-btn-edit {
    color: #94a3b8;
}

.itb-table-btn-edit:hover {
    color: #3b82f6;
}

.itb-table-btn-delete {
    color: #94a3b8;
}

.itb-table-btn-delete:hover {
    color: #dc2626;
}

.itb-empty-state {
    text-align: center;
    padding: 2rem;
    color: #64748b;
    font-size: 0.875rem;
}

.itb-search-input {
    position: relative;
    display: inline-flex;
    align-items: center;
    width: 180px;
}

.itb-search-input .itb-filter-input {
    width: 100%;
    height: 30px;
    padding: 0 0.5rem 0 1.75rem;
    font-size: 0.78rem;
    border: 1px solid #e5e7eb;
    border-radius: 4px;
    background: #fff;
    color: #1e293b;
    transition: border-color 0.15s;
}

.itb-search-input .itb-filter-input::placeholder {
    color: #94a3b8;
}

.itb-search-input .itb-filter-input:focus {
    outline: none;
    border-color: #3b82f6;
}

.itb-search-icon {
    position: absolute;
    left: 0.625rem;
    color: #94a3b8;
    font-size: 0.75rem;
    pointer-events: none;
}

.itb-templates-toolbar .itb-search-input {
    width: 160px;
}

/* Switch toggles - clean minimal style */
.itb-toggle-sm {
    width: 36px;
    height: 20px;
}

.itb-toggle-sm .itb-toggle-slider {
    background-color: #e2e8f0;
    border-radius: 10px;
}

.itb-toggle-sm .itb-toggle-slider:before {
    height: 16px;
    width: 16px;
    left: 2px;
    bottom: 2px;
    background-color: #fff;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

.itb-toggle-sm input:checked + .itb-toggle-slider {
    background-color: #3b82f6;
}

.itb-toggle-sm input:checked + .itb-toggle-slider:before {
    transform: translateX(16px);
}

.itb-config-table .itb-card-type-radio-group {
    margin-top: 0;
    gap: 0.25rem;
}

.itb-config-table .itb-radio-btn {
    padding: 0.2rem 0.5rem;
    font-size: 0.7rem;
    border-width: 1px;
    border-radius: 4px;
    flex: none;
}

/* Templates List */
.itb-templates-list {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.itb-template-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0.75rem;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
}

.itb-template-row:hover {
    background: #f8fafc;
}

.itb-template-name {
    font-weight: 500;
    color: #1e293b;
}

.itb-template-meta {
    font-size: 0.8125rem;
    color: #64748b;
}

.itb-template-actions {
    margin-left: auto;
}

.itb-card-type-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.itb-card-type-info {
    flex: 1;
}

.itb-card-type-icon-name {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.itb-card-type-icon {
    font-size: 2rem;
    color: var(--primary-color);
    width: 2.5rem;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(13, 110, 253, 0.1);
    border-radius: 12px;
}

.itb-card-type-name {
    font-family: 'Figtree', sans-serif;
    font-weight: 600;
    font-size: 1.125rem;
    color: var(--color-black);
    margin: 0;
}

.itb-card-type-actions {
    display: flex;
    gap: 0.5rem;
}

.itb-card-type-btn {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    border: 1px solid var(--color-gray-300);
    background: var(--color-white);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    cursor: pointer;
    padding: 0;
}

.itb-card-type-btn:hover {
    transform: scale(1.05);
}

.itb-card-type-btn-edit {
    color: var(--primary-color);
}

.itb-card-type-btn-edit:hover {
    background: rgba(13, 110, 253, 0.1);
    border-color: var(--primary-color);
}

.itb-card-type-btn-delete {
    color: var(--color-red);
}

.itb-card-type-btn-delete:hover {
    background: var(--color-red-lighter);
    border-color: var(--color-red);
}

.itb-card-type-toggle-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
    padding: 0.75rem;
    background: var(--color-gray-50);
    border-radius: 10px;
}

.itb-card-type-toggle-label {
    font-family: 'Figtree', sans-serif;
    font-weight: 500;
    font-size: 0.875rem;
    color: var(--color-gray-700);
    margin: 0;
}

/* Toggle Switch - clean pill style */
.itb-toggle-switch {
    position: relative;
    display: inline-block;
    width: 36px;
    height: 20px;
}

.itb-toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.itb-toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #e2e8f0;
    border-radius: 10px;
    transition: background-color 0.2s ease;
}

.itb-toggle-slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 2px;
    bottom: 2px;
    background-color: #fff;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
    transition: transform 0.2s ease;
}

.itb-toggle-switch input:checked + .itb-toggle-slider {
    background-color: #3b82f6;
}

.itb-toggle-switch input:checked + .itb-toggle-slider:before {
    transform: translateX(16px);
}

.itb-toggle-switch input:disabled + .itb-toggle-slider {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Radio Button Groups */
.itb-card-type-radio-group {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.itb-radio-btn {
    flex: 1;
    padding: 0.625rem 1rem;
    border: 2px solid var(--color-gray-300);
    border-radius: 10px;
    background: var(--color-white);
    font-family: 'Figtree', sans-serif;
    font-weight: 500;
    font-size: 0.875rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--color-gray-700);
}

.itb-radio-btn input[type="radio"] {
    display: none;
}

.itb-radio-btn.compulsory {
    border-color: var(--color-green);
    color: var(--color-green);
}

.itb-radio-btn.compulsory.active {
    background: var(--color-green);
    color: var(--color-white);
}

.itb-radio-btn.optional {
    border-color: var(--color-orange);
    color: var(--color-orange);
}

.itb-radio-btn.optional.active {
    background: var(--color-orange);
    color: var(--color-white);
}

.itb-radio-btn:not(.active):hover {
    background: var(--color-gray-50);
}

/* Form Styles */
.itb-form-group {
    margin-bottom: 1.5rem;
}

.itb-form-label {
    font-family: 'Figtree', sans-serif;
    font-weight: 600;
    font-size: 0.9375rem;
    color: var(--color-black);
    margin-bottom: 0.5rem;
    display: block;
}

.itb-required {
    color: var(--color-red);
}

.itb-form-control {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 2px solid var(--color-gray-300);
    border-radius: 12px;
    font-family: 'Figtree', sans-serif;
    font-size: 0.9375rem;
    transition: all 0.2s ease;
    background: var(--color-white);
    color: var(--color-black);
}

.itb-form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.1);
}

.itb-form-control-readonly {
    background: var(--color-gray-50);
    color: var(--color-gray-600);
    cursor: not-allowed;
}

.itb-form-help {
    display: block;
    margin-top: 0.375rem;
    font-family: 'Figtree', sans-serif;
    font-size: 0.8125rem;
    color: var(--color-gray-500);
}

.itb-input-group {
    display: flex;
    align-items: stretch;
}

.itb-input-group-text {
    display: flex;
    align-items: center;
    padding: 0.875rem 1rem;
    background: var(--color-gray-50);
    border: 2px solid var(--color-gray-300);
    border-right: none;
    border-radius: 12px 0 0 12px;
    color: var(--color-gray-600);
}

.itb-input-group .itb-form-control {
    border-left: none;
    border-radius: 0 12px 12px 0;
}

.itb-input-group .itb-form-control:focus {
    border-left: 2px solid var(--primary-color);
}

/* Pagination */
.itb-pagination-wrapper {
    margin-top: 0.4rem;
    padding-top: 0.4rem;
    border-top: none;
    flex-shrink: 0;
    display: flex;
    justify-content: center;
}

.itb-pagination {
    display: flex;
    gap: 0.5rem;
    list-style: none;
    padding: 0;
    margin: 0;
}

.itb-pagination .page-item {
    margin: 0;
}

.itb-pagination .page-link {
    padding: 0.35rem 0.65rem;
    border: 1px solid #e5e7eb;
    border-radius: 4px;
    background: #fff;
    color: #475569;
    font-weight: 500;
    font-size: 0.75rem;
    transition: all 0.15s ease;
    text-decoration: none;
    min-width: 44px;
    text-align: center;
}

.itb-pagination .page-link:hover {
    background: var(--color-gray-50);
    border-color: var(--color-gray-400);
    transform: translateY(-1px);
}

.itb-pagination .page-item.active .page-link {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: var(--color-white);
}

.itb-pagination .page-item.disabled .page-link {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}

/* Modal Animation */
.modal.fade .itb-modal-content {
    opacity: 0;
    transition: opacity 0.2s ease;
}

.modal.show .itb-modal-content {
    opacity: 1;
}

/* Confirm Modal Styles */
.itb-confirm-modal .modal-dialog {
    max-width: 500px;
}

.itb-confirm-content {
    text-align: center;
    padding: 2rem 1rem;
}

.itb-confirm-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255, 149, 0, 0.1);
    color: var(--color-orange);
    font-size: 2.5rem;
}

.itb-confirm-icon-danger {
    background: rgba(255, 59, 48, 0.1);
    color: var(--color-red);
}

.itb-confirm-icon i {
    display: block;
}

.itb-confirm-message {
    font-family: 'Figtree', sans-serif;
    font-size: 1.125rem;
    font-weight: 500;
    color: var(--color-black);
    line-height: 1.6;
    margin: 0;
    padding: 0 1rem;
}

.itb-btn-danger {
    background: #dc2626;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 0.5rem 1rem;
    font-weight: 500;
    font-size: 0.875rem;
    transition: background 0.15s ease;
}

.itb-btn-danger:hover {
    background: #b91c1c;
}

/* Tablet Responsive */
@media (max-width: 1024px) {
    .itb-config-content {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
        gap: 1rem;
    }
    
    .itb-modal-header,
    .itb-modal-body,
    .itb-modal-footer {
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }
}

@media (max-width: 768px) {
    .itb-config-modal .modal-dialog {
        max-width: 95%;
        margin: 1rem;
    }
    
    .itb-config-content {
        grid-template-columns: 1fr;
    }
    
    .itb-modal-title {
        font-size: 1.125rem;
    }
    
    .itb-config-toolbar {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .itb-config-toolbar-right {
        width: 100%;
    }
    
    .itb-config-toolbar-right .itb-btn-primary {
        width: 100%;
    }
    
    .itb-modal-footer {
        flex-direction: column-reverse;
    }
    
    .itb-modal-footer .btn {
        width: 100%;
    }
}

/* ===== Trade-In Prices Tab ===== */

/* Events card - compact banner (neutral default) */
.ti-events-card {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 0.6rem 1rem;
    margin-bottom: 0.5rem;
    transition: all 0.25s ease;
}

/* Alert state — when there are pending markdowns */
.ti-events-card.ti-events-alert {
    background: #fef2f2;
    border: 1px solid #fca5a5;
    border-left: 4px solid #ef4444;
}

.ti-events-header {
    display: flex;
    align-items: center;
    font-size: 0.875rem;
}

/* Table card container */
.ti-table-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
}

/* Toolbar: search + actions */
.ti-table-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #f1f5f9;
}

.ti-table-filter {
    display: flex;
    align-items: center;
    flex: 1;
    max-width: 480px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 0 0.6rem;
    transition: border-color 0.15s;
}

.ti-table-filter:focus-within {
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
}

.ti-filter-icon {
    color: #94a3b8;
    font-size: 0.8rem;
    margin-right: 0.4rem;
}

.ti-filter-input {
    flex: 1;
    border: none;
    background: transparent;
    padding: 0.4rem 0;
    font-size: 0.8125rem;
    color: #334155;
    outline: none;
}

.ti-filter-input::placeholder { color: #94a3b8; }

.ti-filter-clear {
    border: none;
    background: none;
    color: #94a3b8;
    padding: 0.2rem;
    cursor: pointer;
    font-size: 0.75rem;
    line-height: 1;
}

.ti-filter-clear:hover { color: #64748b; }

.ti-table-actions-bar {
    display: flex;
    gap: 0.4rem;
    flex-shrink: 0;
}

/* Global settings bar: Margin, Trade-In, Round */
.ti-global-settings {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 1.5rem;
    padding: 1rem 1.25rem;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}

.ti-global-setting {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    min-width: 180px;
}

.ti-global-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: #475569;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.ti-global-info {
    font-size: 0.7rem;
    color: #94a3b8;
    cursor: help;
}

.ti-global-control {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.ti-global-range {
    flex: 1;
    min-width: 80px;
    height: 6px;
    -webkit-appearance: none;
    appearance: none;
    background: #e2e8f0;
    border-radius: 3px;
}

.ti-global-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #3b82f6;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}

.ti-global-range::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #3b82f6;
    cursor: pointer;
    border: none;
    box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}

.ti-global-input {
    width: 64px;
    padding: 0.25rem 0.5rem;
    font-size: 0.8125rem;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
}

.ti-global-select {
    padding: 0.35rem 2rem 0.35rem 0.5rem;
    font-size: 0.8125rem;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    background: #fff;
    min-width: 80px;
}

.ti-toolbar-btn {
    padding: 0.35rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
}

.ti-toolbar-btn-outline {
    background: #fff;
    border: 1px solid #d1d5db;
    color: #374151;
}

.ti-toolbar-btn-outline:hover {
    background: #f9fafb;
    border-color: #9ca3af;
}

.ti-toolbar-btn-primary {
    background: #3b82f6;
    color: #fff;
}

.ti-toolbar-btn-primary:hover {
    background: #2563eb;
}

.ti-save-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.25);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 600;
    margin-left: 4px;
}

/* Table wrap */
.ti-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Table core styles */
.trade-in-prices-table {
    table-layout: fixed;
    width: 100%;
    font-size: 0.8125rem;
    border-collapse: collapse;
}

/* Override global td { height: 120px } from styles.css */
.trade-in-prices-table td,
.trade-in-prices-table th {
    height: auto !important;
    min-width: 0 !important;
    vertical-align: middle !important;
}

.trade-in-prices-table thead th {
    background: #f8fafc;
    color: #64748b;
    font-weight: 600;
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 0.5rem 0.5rem;
    border-bottom: 1px solid #e2e8f0;
    border-top: none;
}

.trade-in-prices-table tbody td {
    padding: 0.4rem 0.5rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    border-bottom: 1px solid #f1f5f9;
    font-size: 0.8125rem;
    line-height: 1.3;
    color: #334155;
}

.trade-in-prices-table tbody tr.ti-product-row td {
    background: #fff;
}

.trade-in-prices-table tbody tr.ti-product-row:hover td {
    background: #f8fafc;
}

/* Column widths — 8 columns (Round removed) */
.trade-in-prices-table th:nth-child(1) { width: 26%; }  /* Product / SKU */
.trade-in-prices-table th:nth-child(2) { width: 8%; }   /* RRP */
.trade-in-prices-table th:nth-child(3) { width: 8%; }   /* Margin */
.trade-in-prices-table th:nth-child(4) { width: 8%; }   /* Cost */
.trade-in-prices-table th:nth-child(5) { width: 8%; }   /* TI Rate */
.trade-in-prices-table th:nth-child(6) { width: 10%; }  /* Trade-In */
.trade-in-prices-table th:nth-child(7) { width: 10%; }   /* VIP Price */
.trade-in-prices-table th:nth-child(8) { width: 7%; }    /* Actions */

/* Table header tooltips — styled Bootstrap tooltips */
.ti-th-with-tip {
    cursor: help;
}
.ti-header-tooltip {
    --bs-tooltip-bg: #1e293b;
}
.ti-header-tooltip .tooltip-inner {
    max-width: 260px;
    padding: 10px 14px;
    font-size: 0.8125rem;
    line-height: 1.4;
    text-align: left;
    background: #1e293b;
    color: #fff;
    border-radius: 10px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
}

/* Product cell — SAP code + name stacked */
.ti-product-cell {
    white-space: normal !important;
    line-height: 1.3;
}

.ti-sap-code {
    font-weight: 600;
    color: #1e293b;
    font-size: 0.8125rem;
    display: block;
}

.ti-product-name {
    color: #94a3b8;
    font-size: 0.6875rem;
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Inline editable inputs */
.ti-inline-input {
    width: 100%;
    max-width: 72px;
    padding: 0.25rem 0.35rem;
    font-size: 0.75rem;
    border: 1px solid transparent;
    border-radius: 5px;
    text-align: right;
    background: #fff;
    color: #334155;
    transition: all 0.15s ease;
    -moz-appearance: textfield;
}

.ti-inline-input::-webkit-outer-spin-button,
.ti-inline-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.ti-inline-input:hover {
    border-color: #cbd5e1;
    background: #fff;
}

.ti-inline-input:focus {
    outline: none;
    border-color: #3b82f6;
    background: #fff;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.12);
}

.ti-inline-wide {
    max-width: 82px;
}

/* Trade-In / VIP cell with optional manual-edit badge */
.ti-input-with-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.ti-manual-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #f59e0b;
    font-size: 0.65rem;
    opacity: 0.9;
    flex-shrink: 0;
}

.ti-manual-badge:hover {
    color: #d97706;
}

.ti-inline-select {
    width: 100%;
    max-width: 68px;
    padding: 0.25rem 0.2rem;
    font-size: 0.75rem;
    border: 1px solid transparent;
    border-radius: 5px;
    background: #fff;
    color: #334155;
    cursor: pointer;
    transition: all 0.15s ease;
    -webkit-appearance: none;
}

.ti-inline-select:hover {
    border-color: #cbd5e1;
    background: #fff;
}

.ti-inline-select:focus {
    outline: none;
    border-color: #3b82f6;
    background: #fff;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.12);
}

/* Row action buttons — subtle icon buttons */
.ti-actions-cell {
    white-space: nowrap;
    text-align: center;
}

.ti-row-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 6px;
    border: 1px solid transparent;
    background: transparent;
    cursor: pointer;
    font-size: 0.65rem;
    transition: all 0.15s ease;
    padding: 0;
    color: #94a3b8;
}

.ti-row-btn + .ti-row-btn {
    margin-left: 2px;
}

.ti-row-btn-delete:hover {
    background: #fee2e2;
    border-color: #fca5a5;
    color: #dc2626;
}

/* Category header row */
.trade-in-prices-table .ti-category-header {
    cursor: pointer;
    user-select: none;
}

.trade-in-prices-table .ti-category-header td {
    padding: 0.45rem 0.5rem;
    font-size: 0.8125rem;
    color: #334155;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    border-top: 1px solid #e2e8f0;
}

.trade-in-prices-table .ti-category-header:first-child td {
    border-top: none;
}

.trade-in-prices-table .ti-category-header:hover td {
    background: #f1f5f9;
}

.trade-in-prices-table .ti-category-header .ti-chevron {
    font-size: 0.55rem;
    color: #94a3b8;
    transition: transform 0.15s ease;
    width: 12px;
    display: inline-block;
    text-align: center;
}

.trade-in-prices-table .ti-category-count {
    font-weight: 400;
    color: #94a3b8;
    font-size: 0.6875rem;
    margin-left: 0.5rem;
}

/* Pagination bar */
.ti-pagination-bar {
    padding: 0.5rem 1rem;
    border-top: 1px solid #f1f5f9;
}

.ti-page-size-select {
    width: auto;
    display: inline-block;
    padding: 0.15rem 1.8rem 0.15rem 0.5rem;
    font-size: 0.8rem;
    border-radius: 6px;
}

/* Footer */
.ti-table-footer {
    padding: 0.5rem 1rem;
    border-top: 1px solid #f1f5f9;
}

/* Cost cell (read-only computed) */
.ti-cost-cell {
    color: #64748b;
}

/* Ex-Demo column: compact input + small toggle */
.ti-exdemo-cell {
    white-space: nowrap;
}

.ti-inline-exdemo {
    width: 4.5rem;
    padding: 0.2rem 0.35rem;
    font-size: 0.8rem;
}

.ti-exdemo-toggle .form-check-input {
    width: 2rem;
    height: 1rem;
    cursor: pointer;
}

.ti-exdemo-toggle {
    padding-left: 2rem;
    min-width: 2.5rem;
}

/* (legacy form-control overrides removed — now using ti-inline-input) */

/* (legacy action button overrides removed — now using ti-row-btn) */

/* Compact Trade-In Prices layout */
.trade-in-settings-compact .form-label { margin-bottom: 0.25rem; font-size: 0.8125rem; }
.trade-in-settings-compact .form-control,
.trade-in-settings-compact .form-select {
    padding: 0.45rem 0.6rem;
    font-size: 0.875rem;
    border-radius: 8px;
    border-color: #e2e8f0;
}

/* (legacy pagination/button overrides removed) */

/* Trade-In tab nav - friendlier */
#tradeInItbTabs .nav-link {
    border-radius: 8px 8px 0 0;
    font-weight: 500;
}

#tradeInItbTabs .nav-link.active {
    background: linear-gradient(180deg, #f8fafc 0%, #fff 100%);
    border-color: #e2e8f0 #e2e8f0 transparent;
}

/* Pending add section - BaseCamp style */
.pending-add-box {
    border: 1px solid var(--bs-border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--bs-card-bg);
    box-shadow: var(--shadow-sm);
}

.pending-add-header,
.pending-add-row {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm) var(--spacing-md);
}

.pending-add-header {
    background: var(--color-gray-100);
    color: var(--color-gray-600);
    font-weight: 600;
    font-size: 0.75rem;
}

.pending-add-row {
    font-size: 0.875rem;
    border-top: 1px solid var(--color-gray-200);
}

.pending-add-row:hover {
    background: var(--color-gray-50);
}

.pending-add-cell {
    flex-shrink: 0;
}

.pending-add-code { width: 70px; font-weight: 600; color: var(--bs-body-color); }
.pending-add-name { flex: 1; min-width: 0; color: var(--color-gray-500); overflow: hidden; text-overflow: ellipsis; }
.pending-add-rrp,
.pending-add-cost { width: 92px; color: var(--color-gray-600); }
.pending-add-input { width: 92px; min-width: 92px; }
.pending-add-input .form-control {
    font-size: 0.8125rem;
    padding: 0.35rem 0.5rem;
    border: 1px solid var(--color-gray-300);
    border-radius: var(--radius-sm);
}

.pending-add-input .form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(0, 122, 255, 0.2);
}

.pending-add-actions { width: 70px; }

.pending-add-actions .btn {
    border-radius: var(--radius-sm);
}

.pending-add-actions .btn-outline-primary:hover {
    background: var(--color-gray-100);
}

.pending-add-list {
    max-height: 160px;
}

/* Pending add section - Save All button (BaseCamp) */
.pending-save-all-btn {
    background: var(--primary-color);
    color: var(--color-white);
    border: none;
    border-radius: var(--radius-md);
    font-weight: 500;
    padding: 0.6rem 1rem;
}

.pending-save-all-btn:hover {
    background: #0056b3;
    color: var(--color-white);
}

.pending-save-all-btn:disabled {
    opacity: 0.7;
}

.pending-save-footer {
    border-color: var(--color-gray-200) !important;
}

/* Trade-In Prices - Pricing Events / Attention panel */
.trade-in-attention-list {
    max-height: 400px;
}

.trade-in-attention-item {
    background: var(--color-gray-50);
    border-color: var(--bs-border-color) !important;
    transition: all 0.2s ease;
}

.trade-in-attention-item:hover {
    background: var(--color-gray-100);
    border-color: var(--color-gray-300) !important;
}

@media (max-width: 991px) {
    .trade-in-attention-list {
        max-height: 300px;
    }
}

/* ITB Item Card - compact, aligned height within row */
.itb-item-card {
    background: var(--color-gray-50);
    border: 1px solid var(--bs-border-color);
    border-radius: var(--radius-sm);
    padding: 0.4rem 0.5rem;
    margin-bottom: 0.25rem;
    transition: all 0.2s ease;
}

.itb-item-card:hover {
    background: var(--color-gray-100);
    border-color: var(--color-gray-300);
}

.itb-selected-card {
    background: var(--color-white);
    border: 2px solid var(--primary-color);
    box-shadow: var(--shadow-sm);
}

/* Cards without Qty: tighter padding for shorter appearance */
.itb-card-no-qty {
    padding: 0.3rem 0.5rem;
}

/* ITB Card Selector - compact */
.itb-card-selector {
    background: var(--color-gray-50);
    border: 2px dashed var(--bs-border-color);
    border-radius: var(--radius-sm);
    padding: 0.5rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    min-height: 64px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.itb-card-selector:hover {
    background: var(--color-gray-100);
    border-color: var(--primary-color);
    border-style: solid;
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.itb-card-icon {
    font-size: 1.25rem;
    color: var(--primary-color);
    margin-bottom: 0.2rem;
}

.itb-card-name {
    font-weight: 500;
    font-size: 0.75rem;
    color: var(--bs-body-color);
}

/* Warning Section */
#warningSection {
    background: var(--color-orange-lighter);
    border-left: 4px solid var(--color-orange);
}

#warningSection .card-body {
    padding: var(--spacing-md);
}

/* Product Configuration Modal - friendly, no gray background */
.itb-product-config-modal .modal-dialog {
    max-width: 800px;
}

.itb-product-config-modal .modal-content {
    border: none;
    border-radius: 12px;
    box-shadow: 0 20px 48px rgba(15, 23, 42, 0.12), 0 4px 12px rgba(15, 23, 42, 0.04);
}

.itb-product-config-modal .modal-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid #f1f5f9;
}

.itb-product-config-modal .itb-modal-title {
    font-size: 1.15rem;
    font-weight: 600;
    color: #0f172a;
}

.itb-product-config-modal .modal-body {
    padding: 1.25rem 1.5rem;
    background: #fff;
}

.itb-product-config-modal .product-info-display {
    margin-bottom: 1.25rem;
}

.itb-product-config-modal .itb-config-info {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 2rem;
    padding: 1rem 1.25rem;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    margin-bottom: 1.25rem;
}

.itb-product-config-modal .itb-config-info-item {
    font-size: 0.9rem;
    color: #1e293b;
}

.itb-product-config-modal .itb-config-section {
    margin-top: 1.25rem;
}

.itb-product-config-modal .itb-config-field-label,
.itb-product-config-modal .itb-config-section .itb-config-field-label {
    font-size: 0.8125rem;
    font-weight: 600;
    color: #334155;
    margin-bottom: 0.5rem;
    letter-spacing: 0.02em;
}

.itb-product-config-modal .itb-selected-label,
.itb-product-config-modal .itb-available-label {
    font-size: 0.8125rem;
    font-weight: 600;
    color: #475569;
    margin-bottom: 0.6rem;
}

/* Lighter backdrop when product config modal is open - no gray */
body:has(.itb-product-config-modal.show) .modal-backdrop {
    background-color: rgba(15, 23, 42, 0.2);
}

/* ITB Items Container - white, expand with content */
#productConfigModal #itbItemsContainer {
    padding: 1rem;
    background: #fff;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
}

.itb-product-config-modal .modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid #f1f5f9;
}

.itb-product-config-modal .itb-type-selector {
    border-color: #e2e8f0;
    border-radius: 8px;
}

.itb-product-config-modal .itb-type-option:hover {
    background: #f8fafc;
}

.itb-product-config-modal .btn-check:checked + .itb-type-option {
    background: #3b82f6;
}

.itb-product-config-modal .itb-available-empty,
.itb-available-empty {
    font-size: 0.875rem;
    color: #64748b;
    margin: 0.75rem 0 0;
}

.itb-template-items-wrap {
    padding: 1rem;
    background: #fff;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
}

/* ITB Item Form Elements - compact */
.itb-item-card .form-label {
    font-weight: 500;
    font-size: 0.7rem;
    color: var(--color-gray-600);
    margin-bottom: 0.15rem;
}

.itb-item-card .form-control-sm {
    font-size: 0.75rem;
    padding: 0.2rem 0.35rem;
    min-height: 1.6rem;
}

.itb-item-card .btn-sm {
    font-size: 0.65rem;
    padding: 0.15rem 0.35rem;
}

.itb-item-card .btn-group .btn {
    font-size: 0.65rem;
    padding: 0.15rem 0.3rem;
}

.itb-item-card .d-flex.align-items-center.mb-2 {
    margin-bottom: 0.3rem !important;
}

.itb-item-card .mb-2 {
    margin-bottom: 0.35rem !important;
}

.itb-item-card .btn-danger {
    padding: 0.15rem 0.35rem;
    font-size: 0.7rem;
}

.itb-item-card .fas.text-primary {
    font-size: 0.8rem;
}

.itb-item-card strong.small {
    font-size: 0.75rem;
}

/* Radio Button Groups */
.itb-item-card .btn-group .btn-check:checked + .btn-outline-success {
    background-color: var(--color-green);
    border-color: var(--color-green);
    color: white;
}

.itb-item-card .btn-group .btn-check:checked + .btn-outline-warning {
    background-color: var(--color-orange);
    border-color: var(--color-orange);
    color: white;
}

/* Missing ITB Products List */
#missingItbProductsList .badge {
    font-size: 0.875rem;
    padding: 0.5rem 0.75rem;
    transition: all 0.2s ease;
}

#missingItbProductsList .badge:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

/* Modal Styles */
#missingItbModal .list-group-item {
    border: 1px solid var(--bs-border-color);
    border-radius: var(--radius-sm);
    margin-bottom: var(--spacing-xs);
    transition: all 0.2s ease;
}

#missingItbModal .list-group-item:hover {
    background: var(--color-gray-100);
    border-color: var(--color-gray-300);
    transform: translateX(4px);
}

#itbItemSearchModal #itbItemSearchResults {
    border: 1px solid var(--bs-border-color);
    border-radius: var(--radius-md);
    padding: var(--spacing-sm);
    background: var(--color-gray-50);
}

#itbItemSearchModal .card {
    border: none;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
    margin-bottom: 0.5rem;
}

#itbItemSearchModal .card:hover {
    background: var(--color-gray-100);
    transform: translateX(4px);
}

/* Product Type Selection */
.btn-group input[type="radio"]:checked + label {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

/* ============================================
   ITB Management Tab — Clean Redesign
   ============================================ */

/* --- Warning Banner --- */
.itb-warning-banner {
    border: 1px solid #fde68a;
    border-radius: 6px;
    background: #fffbeb;
    padding: 0.75rem 1rem;
}

.itb-warning-head {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8rem;
    color: #92400e;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
}

.itb-warning-icon {
    color: #f59e0b;
    font-size: 0.85rem;
}

.itb-warning-desc {
    font-weight: 400;
    color: #b45309;
}

.itb-warning-codes {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    margin-bottom: 0.5rem;
}

/* --- Search Bar --- */
.itb-search-section {
    margin-bottom: 1.5rem;
}

.itb-search-bar {
    display: flex;
    align-items: center;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    background: #fff;
    overflow: hidden;
}

.itb-search-bar-icon {
    padding: 0 0 0 0.75rem;
    color: #94a3b8;
    font-size: 0.8rem;
}

.itb-search-bar-input {
    flex: 1;
    border: none;
    outline: none;
    padding: 0.5rem 0.6rem;
    font-size: 0.8125rem;
    background: transparent;
    color: #1e293b;
}

.itb-search-bar-input::placeholder {
    color: #94a3b8;
}

.itb-search-bar-btn {
    padding: 0.5rem 1rem;
    background: #3b82f6;
    color: #fff;
    border: none;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s;
}

.itb-search-bar-btn:hover {
    background: #2563eb;
}

/* --- Product Grid --- */
.itb-products-section {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #fff;
    overflow: hidden;
}

.itb-products-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #f1f5f9;
}

.itb-products-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: #1e293b;
    margin: 0;
}

.itb-type-filter {
    display: flex;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    overflow: hidden;
}

.itb-type-filter-btn {
    padding: 0.35rem 0.6rem;
    font-size: 0.72rem;
    font-weight: 500;
    color: #64748b;
    background: #fff;
    border: none;
    border-right: 1px solid #e5e7eb;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.itb-type-filter-btn:last-of-type {
    border-right: none;
}

.itb-type-filter input:checked + .itb-type-filter-btn {
    background: #3b82f6;
    color: #fff;
}

.itb-type-filter-btn:hover {
    background: #f8fafc;
}

.itb-type-filter input:checked + .itb-type-filter-btn:hover {
    background: #2563eb;
}

.itb-products-list {
    padding: 1rem;
    min-height: 120px;
}

.itb-product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 0.75rem;
}

.itb-product-card {
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 0.75rem;
    cursor: pointer;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.itb-product-card:hover {
    border-color: #3b82f6;
    box-shadow: 0 1px 4px rgba(59, 130, 246, 0.08);
}

.itb-product-card-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.35rem;
}

.itb-product-type-tag {
    font-size: 0.65rem;
    font-weight: 500;
    color: #64748b;
    background: #f1f5f9;
    padding: 0.15rem 0.4rem;
    border-radius: 3px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.itb-product-itb-count {
    font-size: 0.7rem;
    color: #94a3b8;
    font-weight: 500;
}

.itb-product-card-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 0.2rem;
    line-height: 1.3;
}

.itb-product-card-meta {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 0.4rem;
}

.itb-product-card-sap {
    font-size: 0.72rem;
    font-family: 'SF Mono', Monaco, Consolas, monospace;
    color: #3b82f6;
    font-weight: 500;
}

.itb-product-card-ean {
    font-size: 0.7rem;
    color: #94a3b8;
}

.itb-product-card-label {
    font-size: 0.68rem;
    color: #94a3b8;
    margin-bottom: 0.25rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    font-weight: 500;
}

.itb-product-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
}

.itb-tag {
    display: inline-block;
    font-size: 0.68rem;
    color: #475569;
    background: #f1f5f9;
    padding: 0.12rem 0.35rem;
    border-radius: 3px;
    font-weight: 400;
    line-height: 1.4;
}

/* --- Products Pagination --- */
.itb-products-pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 1rem;
    border-top: 1px solid #f1f5f9;
}

.itb-pag-info {
    font-size: 0.72rem;
    color: #94a3b8;
}

.itb-pag-buttons {
    display: flex;
    align-items: center;
    gap: 0.2rem;
}

.itb-pag-btn {
    min-width: 28px;
    height: 28px;
    padding: 0 0.35rem;
    border: 1px solid #e5e7eb;
    border-radius: 4px;
    background: #fff;
    color: #475569;
    font-size: 0.72rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.itb-pag-btn:hover:not(:disabled):not(.active) {
    background: #f8fafc;
    border-color: #94a3b8;
}

.itb-pag-btn.active {
    background: #3b82f6;
    border-color: #3b82f6;
    color: #fff;
}

.itb-pag-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.itb-pag-dots {
    font-size: 0.72rem;
    color: #94a3b8;
    padding: 0 0.15rem;
}

.itb-empty-state {
    text-align: center;
    padding: 2rem;
    color: #94a3b8;
}

.itb-empty-state p {
    font-size: 0.875rem;
    font-weight: 500;
    color: #64748b;
    margin-bottom: 0.25rem;
}

.itb-empty-state small {
    font-size: 0.78rem;
    color: #94a3b8;
}

/* --- Product Configuration Panel --- */
.itb-config-panel {
    border: 1px solid #3b82f6;
    border-radius: 8px;
    background: #fff;
    overflow: hidden;
}

.itb-config-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.8rem 1.25rem;
    background: #f8fafc;
    border-bottom: 1px solid #e5e7eb;
}

.itb-config-panel-title {
    font-size: 1rem;
    font-weight: 600;
    color: #1e293b;
    margin: 0;
}

.itb-config-panel-actions {
    display: flex;
    gap: 0.6rem;
}

.itb-config-panel-body {
    padding: 1.25rem;
}

.itb-config-info {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem 1.75rem;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #f1f5f9;
}

.itb-config-info-item {
    font-size: 0.875rem;
    color: #1e293b;
}

.itb-config-info-label {
    color: #94a3b8;
    font-weight: 500;
}

.itb-config-row {
    display: flex;
    gap: 1.75rem;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
}

.itb-config-field {
    flex: 1;
    min-width: 200px;
}

.itb-config-field-label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 0.35rem;
}

.itb-config-section {
    margin-bottom: 0.5rem;
}

/* Product Type Selector */
.itb-type-selector {
    display: flex;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    overflow: hidden;
}

.itb-type-option {
    flex: 1;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    font-weight: 500;
    text-align: center;
    color: #475569;
    background: #fff;
    border: none;
    border-right: 1px solid #e5e7eb;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    margin: 0;
}

.itb-type-option:last-of-type {
    border-right: none;
}

.btn-check:checked + .itb-type-option {
    background: #3b82f6;
    color: #fff;
}

.itb-type-option:hover {
    background: #f8fafc;
}

.btn-check:checked + .itb-type-option:hover {
    background: #2563eb;
}

/* Template Select */
.itb-template-select {
    flex: 1;
    max-width: 260px;
    padding: 0.45rem 0.6rem;
    font-size: 0.875rem;
    border: 1px solid #e5e7eb;
    border-radius: 4px;
    background: #fff;
    color: #1e293b;
}

/* --- Selected Items --- */
.itb-selected-label,
.itb-available-label {
    font-size: 0.8125rem;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 0.5rem;
}

.itb-selected-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-bottom: 1.25rem;
}

.itb-sel-card {
    position: relative;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 0.75rem 0.85rem;
    background: #fff;
    min-width: 160px;
    max-width: 220px;
    flex: 0 1 auto;
}

.itb-sel-remove {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 20px;
    height: 20px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: #fee2e2;
    color: #dc2626;
    font-size: 0.6rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
}

.itb-sel-remove:hover {
    background: #dc2626;
    color: #fff;
}

.itb-sel-name {
    font-size: 0.875rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 0.4rem;
    padding-right: 1.4rem;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.itb-sel-icon {
    color: #64748b;
    font-size: 0.7rem;
}

.itb-sel-row {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 0.2rem;
}

.itb-sel-field-label {
    font-size: 0.72rem;
    color: #94a3b8;
    width: 32px;
    flex-shrink: 0;
}

.itb-sel-qty {
    width: 52px;
    padding: 0.2rem 0.35rem;
    font-size: 0.8125rem;
    border: 1px solid #e5e7eb;
    border-radius: 3px;
    text-align: center;
    outline: none;
}

.itb-sel-qty:focus {
    border-color: #3b82f6;
}

.itb-sel-type-group {
    display: flex;
    gap: 0.2rem;
}

.itb-sel-type-btn {
    font-size: 0.7rem;
    font-weight: 500;
    padding: 0.18rem 0.45rem;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    border: 1px solid transparent;
}

.itb-sel-type-btn input[type="radio"] {
    display: none;
}

.itb-sel-type-btn.compulsory,
.itb-sel-type-btn.optional {
    color: #64748b;
    background: #fff;
    border: 1px solid #e2e8f0;
}

.itb-sel-type-btn:has(input:checked) {
    background: #3b82f6;
    color: #fff;
    border-color: #3b82f6;
}

/* --- Available Cards --- */
.itb-available-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.itb-avail-card {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 0.75rem;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
    background: #fff;
}

.itb-avail-card:hover {
    border-color: #3b82f6;
    background: #f8fafc;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.08);
}

.itb-avail-icon {
    font-size: 0.75rem;
    color: #94a3b8;
}

.itb-avail-card:hover .itb-avail-icon {
    color: #3b82f6;
}

.itb-avail-name {
    font-size: 0.8125rem;
    font-weight: 500;
    color: #475569;
}

/* Responsive */
@media (max-width: 768px) {
    .itb-product-grid {
        grid-template-columns: 1fr;
    }

    .itb-config-row {
        flex-direction: column;
    }

    .itb-selected-grid {
        flex-direction: column;
    }

    .itb-sel-card {
        max-width: 100%;
    }

    .itb-search-bar {
        flex-direction: column;
    }

    .itb-search-bar-btn {
        width: 100%;
    }
}

/* Example Images */
.itb-example-filter label {
    font-size: 0.875rem;
}

.itb-example-section {
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 1rem;
    background: #f8fafc;
}

.itb-example-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.itb-example-label {
    font-weight: 600;
    font-size: 0.875rem;
}

.itb-example-label.itb-example-good {
    color: #16a34a;
}

.itb-example-label.itb-example-bad {
    color: #dc2626;
}

.example-images-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.75rem;
    min-height: 120px;
}

.example-image-card {
    position: relative;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
    transition: border-color 0.15s;
    cursor: pointer;
}

.example-image-card:hover {
    border-color: #3b82f6;
}

.example-image-card img {
    width: 100%;
    height: 160px;
    object-fit: cover;
    display: block;
}

.example-image-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: flex-start;
    justify-content: flex-end;
    padding: 0.5rem;
    opacity: 0;
    transition: opacity 0.15s;
}

.example-image-card:hover .example-image-overlay {
    opacity: 1;
}

.example-image-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 1.25rem;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.example-image-badge.good {
    background: var(--color-green);
    color: var(--color-white);
}

.example-image-badge.bad {
    background: var(--color-red);
    color: var(--color-white);
}

.example-image-actions {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.7);
    padding: 0.75rem;
    display: flex;
    gap: 0.5rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.example-image-card:hover .example-image-actions {
    opacity: 1;
}

.example-image-actions .btn {
    flex: 1;
    padding: 0.5rem;
    font-size: 0.875rem;
}

.example-image-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 2rem 1rem;
    color: #64748b;
    font-size: 0.8125rem;
}

/* Example Upload Loading Overlay */
.example-upload-loading {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(4px);
    z-index: 1050;
    border-radius: 20px;
    display: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

.example-upload-loading .spinner-border {
    width: 3rem;
    height: 3rem;
    border-width: 0.3rem;
}

.example-upload-loading p {
    margin-top: 1rem;
    font-size: 1rem;
    font-weight: 500;
    color: var(--color-gray-700);
    font-family: 'Figtree', sans-serif;
}

/* Example Image Preview Modal - Modern Apple-Easy Style */
.example-image-preview-modal .modal-dialog {
    max-width: 95vw;
    margin: 1rem auto;
}

.example-image-preview-modal .modal-content {
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(20px);
    border: none;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.example-image-preview-header {
    border: none;
    padding: 1rem 1.5rem;
    background: transparent;
    justify-content: flex-end;
    align-items: flex-start;
}

.example-image-preview-close {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    opacity: 0.9;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    color: white;
    font-size: 1.125rem;
}

.example-image-preview-close:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.3);
    opacity: 1;
    transform: scale(1.05);
}

.example-image-preview-close:active {
    transform: scale(0.95);
}

.example-image-preview-close i {
    margin: 0;
}

.example-image-preview-body {
    padding: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
    max-height: 85vh;
}

.example-image-preview-container {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.example-image-preview-img {
    max-width: 100%;
    max-height: 85vh;
    width: auto;
    height: auto;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
    object-fit: contain;
    animation: imagePreviewFadeIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes imagePreviewFadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Dark backdrop */
.example-image-preview-modal .modal-backdrop {
    background-color: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
}

@media (max-width: 768px) {
    .example-images-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 1rem;
    }
    
    .example-image-card img {
        height: 150px;
    }
    
    .example-image-preview-modal .modal-dialog {
        max-width: 100vw;
        margin: 0;
    }
    
    .example-image-preview-body {
        padding: 1rem;
        min-height: 50vh;
        max-height: 80vh;
    }
    
    .example-image-preview-img {
        max-height: 80vh;
        border-radius: 12px;
    }
    
    .example-image-preview-close {
        width: 36px;
        height: 36px;
        font-size: 1rem;
    }
}

