/* ============================================================================
   BUTTONS & UTILITIES
   ============================================================================ */

.btn, .btn-primary {
    background: #2e2e2e;
    border: none;
    color: #ffffff;
    font-weight: 600;
    padding: 9px 16px;
    border-radius: 10px;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.15s ease;
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

.btn:hover, .btn-primary:hover {
    background: #1f1f1f;
}

/* Icon box inside dark buttons */
.btn > i:first-child,
.btn-primary > i:first-child {
    background: rgba(255, 255, 255, 0.12);
    border-radius: 6px;
    padding: 3px 4px;
    line-height: 1;
}

.btn-sm {
    padding: 5px 11px !important;
    font-size: 12px !important;
    border-radius: 8px !important;
}

/* Icon box in small buttons */
.btn-sm > i:first-child {
    padding: 2px 3px !important;
}

.spinner-border { color: var(--primary); }

/* Responsive */
@media (max-width: 1024px) {
    .content-grid {
        grid-template-columns: 1fr;
    }
    
    .chart-row-top,
    .chart-row-bottom {
        grid-template-columns: 1fr;
    }
}

/* Info Panel */
.info-panel {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 24px;
}

.info-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.info-header h4 {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-close-info {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s;
}

.btn-close-info:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

/* Input Panel */
.input-panel {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 24px;
}

.input-group {
    display: flex;
    gap: 12px;
    margin-top: 16px;
}

.input-group .form-control {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    background: var(--bg-card);
    color: var(--text-primary);
}

.input-group .form-control:focus {
    outline: none;
    border-color: var(--primary);
}

.input-group .btn {
    padding: 12px 24px;
    white-space: nowrap;
}

/* Result Panel */
.result-panel {
    background: var(--bg-sidebar);
    border-radius: 12px;
    padding: 20px;
}

.result-card {
    background: var(--bg-card);
    border-radius: 10px;
    padding: 20px;
    display: flex;
    gap: 20px;
}

.result-image {
    flex: 0 0 150px;
    text-align: center;
}

.result-image img {
    width: 150px;
    height: 150px;
    object-fit: contain;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 10px;
    background: white;
    margin-bottom: 12px;
}

.result-details {
    flex: 1;
}

.result-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.result-meta {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.result-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 16px;
}

.result-stat {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.result-stat-label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    font-weight: 600;
}

.result-stat-value {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}

.result-actions {
    display: flex;
    gap: 12px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border-light);
}

.tab-header {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.tab-btn {
    flex: 1;
    padding: 10px 16px;
    background: var(--bg-hover);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.tab-btn:hover {
    background: var(--bg-card);
    border-color: var(--primary);
}

.tab-btn.active {
    background: var(--bg-card);
    border-color: var(--primary);
    color: var(--primary);
    font-weight: 600;
}

.tab-content-bulk {
    display: block;
}

.form-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
    display: block;
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 13px;
    background: var(--bg-card);
    color: var(--text-primary);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
}

textarea.form-control {
    font-family: 'Courier New', monospace;
}

.table-container {
    overflow-x: auto;
    width: 100%;
    max-width: 100%;
    border-radius: 8px;
}

#inventoryTableMain {
    table-layout: auto;
    width: 100%;
}




/* Title column - truncate long text */
#inventoryTableMain td:nth-child(4) {
    max-width: 250px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ASIN column - prevent overflow */
#inventoryTableMain td:nth-child(3) {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Actions column - ensure buttons fit */
#inventoryTableMain td:nth-child(11) {
    white-space: nowrap;
    padding: 8px 12px;
}

#inventoryTableMain td:nth-child(11) button {
    margin: 0 2px;
    padding: 4px 8px;
    font-size: 11px;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.data-table thead th {
    background: var(--bg-card);
    padding: 9px 12px;
    text-align: left;
    font-weight: 600;
    font-size: 11px;
    color: var(--text-muted);
    letter-spacing: 0.04em;
    text-transform: uppercase;
    border-bottom: 1.5px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 10;
    white-space: nowrap;
}

.data-table tbody td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border-light);
    vertical-align: middle;
}

.data-table tbody tr {
    background: var(--bg-card);
    transition: background 0.12s;
}

.table-row-clickable {
    cursor: pointer;
}

.table-row-clickable:hover td {
    background: var(--bg-secondary);
}
.lead-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
    margin-top: 16px;
}

.lead-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s;
}

.lead-card:hover {
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}

.lead-card-image {
    width: 100%;
    height: 200px;
    object-fit: contain;
    background: white;
    padding: 16px;
}

.lead-card-body {
    padding: 16px;
}

.lead-card-asin {
    font-size: 12px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 8px;
}

.lead-card-title {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 12px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    min-height: 38px;
}

.lead-card-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-light);
}

.lead-stat {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.lead-stat-label {
    font-size: 11px;
    color: var(--text-muted);
}

.lead-stat-value {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
}

.lead-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.lead-rating {
    font-size: 12px;
    color: var(--text-muted);
}

.stars {
    color: var(--warning);
}

/* Status Tier Badges (for inventory & lists) */
.status-tier {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.status-tier.status-elite {
    color: #059669;
    background: #ecfdf5;
    border: 1px solid #d1fae5;
}

.status-tier.status-good {
    color: #2563eb;
    background: #eff6ff;
    border: 1px solid #dbeafe;
}

.status-tier.status-fair {
    color: #d97706;
    background: #fffbeb;
    border: 1px solid #fef3c7;
}

.status-tier.status-weak {
    color: #dc2626;
    background: #fef2f2;
    border: 1px solid #fecaca;
}

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

.status-badge.status-done {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

.status-badge.status-queued {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning);
}

.status-badge.status-running {
    background: rgba(59, 130, 246, 0.1);
    color: var(--info);
}

.status-badge.status-failed {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

/* ============================================================================
   ROUNDED INTERACTIVE TABLE ROWS
   ============================================================================ */


.table-row-clickable {
    cursor: pointer;
    border: 1px solid transparent;
}

.table-row-clickable:hover {
    background: var(--bg-hover) !important;
    border-color: var(--primary);
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    /* NOTE: transform removed intentionally — it creates a new containing block
       for position:fixed children (the actions dropdowns), causing them to be
       positioned relative to the row instead of the viewport when scrolled. */
}


/* Rounded outer containers */
.result-panel,
.input-panel,
.activity-panel,
.quick-actions-panel,
.chart-panel,
.chart-panel-white,
.mini-chart-card {
    border-radius: 12px;
}

/* Product image rounding */
.product-img,
.data-table img {
    border-radius: 8px;
}

.score-donut-card .card-body {
    padding: 20px;
}

.score-donut-card canvas {
    position: relative;
    z-index: 1;
}

/* ==================== 2-COLUMN GRID LAYOUT ==================== */
.filters-lists-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 2px solid var(--border-color);
}

/* ==================== COMPACT FILTER PANEL ==================== */
.unified-filter-panel {
    background: var(--bg-card);
    border: 1.5px solid var(--border-color);
    border-radius: 14px;
    padding: 0;
    overflow: hidden;
}

.filter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
}

.filter-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 7px;
}
.filter-title i { font-size: 15px; color: var(--text-muted); }

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

.active-filters-badge {
    background: #1a1a1a;
    color: white;
    padding: 3px 9px;
    border-radius: 20px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.btn-reset-filters {
    background: transparent;
    border: 1.5px solid var(--border-color);
    color: var(--text-secondary);
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    display: flex;
    align-items: center;
    gap: 4px;
    font-family: inherit;
}

.btn-reset-filters:hover {
    border-color: var(--text-secondary);
    color: var(--text-primary);
    background: var(--bg-hover);
}

/* COMPACT SECTIONS */
.filter-section {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-light);
}

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

.filter-label {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 8px;
}
.filter-label i { font-size: 13px; }

/* Inputs — unified clean style */
.filter-input,
.form-control,
input[type="text"].filter-input,
input[type="number"].filter-input,
input[type="search"].filter-input,
select.form-control {
    background: var(--bg-secondary) !important;
    color: var(--text-primary) !important;
}

.filter-input {
    width: 100%;
    padding: 8px 12px;
    border: 1.5px solid var(--border-color);
    border-radius: 9px;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-primary);
    background: var(--bg-secondary) !important;
    transition: border-color 0.15s, box-shadow 0.15s;
    font-family: inherit;
}

.filter-input:focus {
    outline: none;
    border-color: #1a1a1a;
    box-shadow: 0 0 0 3px rgba(26,26,26,0.06);
}

.form-control {
    padding: 9px 12px;
    border: 1.5px solid var(--border-color);
    border-radius: 9px;
    font-size: 13px;
    font-weight: 500;
    font-family: inherit;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.form-control:focus {
    outline: none;
    border-color: #1a1a1a;
    box-shadow: 0 0 0 3px rgba(26,26,26,0.06);
}

select.form-control { cursor: pointer; }

/* SORT BUTTONS — pill toggles */
.sort-buttons-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 5px;
}

.sort-btn {
    background: var(--bg-secondary);
    border: 1.5px solid var(--border-color);
    color: var(--text-secondary);
    padding: 7px 8px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.14s;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 3px;
    font-family: inherit;
}

.sort-btn:hover {
    border-color: var(--text-secondary);
    color: var(--text-primary);
    background: var(--bg-hover);
}

.sort-btn.active-asc,
.sort-btn.active-desc {
    background: #1a1a1a;
    border-color: #1a1a1a;
    color: #ffffff;
}

[data-theme="dark"] .sort-btn.active-asc,
[data-theme="dark"] .sort-btn.active-desc {
    background: #3a3a3a;
    border-color: #3a3a3a;
    color: #ffffff;
}

.sort-arrow {
    opacity: 0.4;
    font-size: 11px;
}

.sort-btn.active-asc .sort-arrow::after { content: '↑'; opacity: 1; }
.sort-btn.active-desc .sort-arrow::after { content: '↓'; opacity: 1; }

/* COMPACT RANGE SLIDERS - 2 COLUMNS WITH SPACING */
.ranges-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px 24px;
}

.range-item {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.range-slider-container {
    margin-top: 2px;
    /* Half the handle width (11px) as padding: the slider element fills the content
       box, and handles at the extremes extend into the padding, making them appear
       centered at the visible track endpoints. overflow:visible lets them show. */
    padding: 0 11px;
    overflow: visible;
}

.range-slider {
    height: 5px;
    margin: 8px 0 5px;
}

.range-values {
    display: flex;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    color: var(--primary);
    margin-top: 3px;
}

/* Distribution bars hidden — they create variable-height gaps above sliders */
.dist-bars {
    display: none;
}

/* ── Modern noUiSlider: thin track, solid handle ─────────────────────────── */
.noUi-target,
.noUi-target * {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}
.noUi-origin {
    position: absolute !important;
    z-index: 1 !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
}

/* Track background — thin 4px line */
.noUi-target {
    background: var(--border-color) !important;
    border: none !important;
    box-shadow: none !important;
    border-radius: 2px !important;
}

.noUi-base {
    height: 4px !important;
}

/* Active fill */
.noUi-connect {
    background: #1a1a1a !important;
    border-radius: 2px !important;
}

[data-theme="dark"] .noUi-connect {
    background: #f97316 !important;
}

/* Drag handle — small solid circle */
.noUi-handle {
    background: #1a1a1a !important;
    border: 2px solid #ffffff !important;
    box-shadow: 0 1px 6px rgba(0,0,0,0.22) !important;
    border-radius: 50% !important;
    cursor: grab !important;
    transition: transform 0.1s !important;
}

.noUi-handle:active {
    cursor: grabbing !important;
    transform: scale(1.15) !important;
}

[data-theme="dark"] .noUi-handle {
    background: #f0f0f0 !important;
    border: 2px solid #242424 !important;
}

.noUi-handle:before,
.noUi-handle:after {
    display: none !important;
}

.noUi-horizontal .noUi-handle {
    width: 16px !important;
    height: 16px !important;
    right: -8px !important;
    top: -7px !important;
}

/* Value display below slider */
.range-values {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-secondary);
    margin-top: 5px;
    padding: 0 2px;
}

/* COMPACT PRESET SECTION */
.preset-section {
    padding: 12px 16px;
}

.preset-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.btn-save-preset {
    background: #1a1a1a;
    border: none;
    color: white;
    padding: 7px 12px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    white-space: nowrap;
    font-family: inherit;
}

.btn-save-preset:hover { background: #333; }

[data-theme="dark"] .btn-save-preset { background: #2e2e2e; color: #d0d0d0; border-color: #3a3a3a; }
[data-theme="dark"] .btn-save-preset:hover { background: #3a3a3a; color: #ffffff; }

.btn-load-preset {
    background: transparent;
    border: 1.5px solid var(--border-color);
    color: var(--text-secondary);
    padding: 7px 12px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    display: flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
    font-family: inherit;
}
.btn-load-preset:hover { background: var(--bg-hover); color: var(--text-primary); }
[data-theme="dark"] .btn-load-preset { border-color: rgba(255,255,255,0.12); color: #b0b0b0; }
[data-theme="dark"] .btn-load-preset:hover { background: #3a3a3a; color: #fff; border-color: rgba(255,255,255,0.2); }

/* Preset item rows in Load modal */
.preset-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    border: 1px solid var(--border-color);
    border-radius: 9px;
    margin-bottom: 8px;
    background: var(--bg-secondary);
    transition: border-color 0.15s;
}
.preset-item:hover { border-color: var(--primary); }
[data-theme="dark"] .preset-item { border-color: rgba(255,255,255,0.09); background: var(--bg-secondary); }
[data-theme="dark"] .preset-item:hover { border-color: var(--primary); }
.preset-item-name { font-size: 13px; font-weight: 600; color: var(--text-primary); }
.preset-item-actions { display: flex; gap: 6px; flex-shrink: 0; }
.preset-item-load {
    display: flex; align-items: center; gap: 4px;
    padding: 5px 10px; border-radius: 7px; font-size: 11px; font-weight: 600;
    background: #1a1a1a; color: white; border: none; cursor: pointer; transition: background 0.15s;
    font-family: inherit;
}
.preset-item-load:hover { background: #333; }
[data-theme="dark"] .preset-item-load { background: #3a3a3a; color: #e0e0e0; }
[data-theme="dark"] .preset-item-load:hover { background: #484848; }
.preset-item-delete {
    display: flex; align-items: center; justify-content: center;
    width: 28px; height: 28px; border-radius: 7px; font-size: 13px;
    background: transparent; border: 1px solid var(--border-color);
    color: var(--text-muted); cursor: pointer; transition: all 0.15s;
}
.preset-item-delete:hover { background: rgba(239,68,68,0.08); border-color: #ef4444; color: #ef4444; }
[data-theme="dark"] .preset-item-delete { border-color: rgba(255,255,255,0.1); }

.preset-dropdown {
    font-size: 12px;
    font-weight: 500;
    padding: 7px 10px;
    border-radius: 8px;
    border: 1.5px solid var(--border-color);
    background: var(--bg-secondary) !important;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.15s;
    font-family: inherit;
}

.preset-dropdown:hover,
.preset-dropdown:focus {
    outline: none;
    border-color: #1a1a1a;
}

/* ==================== MY LISTS PANEL ==================== */
.lists-panel {
    background: var(--bg-card);
    border: 1.5px solid var(--border-color);
    border-radius: 14px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.lists-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}

.lists-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 7px;
}
.lists-title i { font-size: 15px; color: var(--text-muted); }

.btn-create-list {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    background: #1a1a1a;
    border: none;
    color: white;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.14s;
    font-family: inherit;
}

.btn-create-list:hover { background: #333; }
[data-theme="dark"] .btn-create-list { background: #2e2e2e; color: #d0d0d0; border-color: #3a3a3a; }
[data-theme="dark"] .btn-create-list:hover { background: #3a3a3a; color: #ffffff; }

.lists-container {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
    max-height: 360px;
}

.list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.14s;
    margin-bottom: 3px;
    border: 1.5px solid transparent;
}

.list-item:hover {
    background: var(--bg-secondary);
    border-color: var(--border-color);
}

.list-item.active {
    background: #1a1a1a;
    color: white;
    border-color: #1a1a1a;
}

[data-theme="dark"] .list-item.active {
    background: var(--bg-secondary) !important;
    border-color: var(--primary) !important;
}

/* Children: restore neutral colors for orange-border-only style in dark */
[data-theme="dark"] .list-item.active .list-item-name { color: var(--text-primary); }
[data-theme="dark"] .list-item.active .list-item-count { color: var(--text-muted); }
[data-theme="dark"] .list-item.active .list-item-icon {
    background: rgba(249,115,22,0.12);
    color: var(--primary);
}
[data-theme="dark"] .list-item.active .btn-list-action { color: var(--text-muted); }

.list-item-info {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 0;
}

.list-item-icon {
    width: 28px;
    height: 28px;
    border-radius: 7px;
    background: var(--bg-hover);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    color: var(--text-muted);
    flex-shrink: 0;
}

.list-item.active .list-item-icon {
    background: rgba(255,255,255,0.15);
    color: white;
}

.list-item-text { min-width: 0; }

.list-item-name {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.list-item.active .list-item-name { color: white; }

.list-item-count {
    font-size: 10px;
    color: var(--text-muted);
    font-weight: 500;
    margin-top: 1px;
}

.list-item.active .list-item-count { color: rgba(255,255,255,0.6); }

.list-item-actions {
    display: flex;
    gap: 2px;
    opacity: 0;
    transition: opacity 0.15s;
}

.list-item:hover .list-item-actions { opacity: 1; }

.btn-list-action {
    background: transparent;
    border: none;
    color: var(--text-muted);
    width: 24px;
    height: 24px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.14s;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
}

.list-item.active .btn-list-action { color: rgba(255,255,255,0.6); }
.btn-list-action:hover { color: var(--danger); background: rgba(239,68,68,0.08); }

.lists-loading,
.lists-empty {
    text-align: center;
    padding: 32px 16px;
    font-size: 12px;
    color: var(--text-muted);
}

.lists-pro-badge {
    display: inline-block;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 9px;
    font-weight: 600;
    margin-left: 4px;
}

/* ==================== LIST VIEW MODE ==================== */
.list-view-header {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 16px 20px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.list-view-info h2 {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 4px 0;
}

.list-view-info p {
    font-size: 12px;
    color: var(--text-secondary);
    margin: 0;
}

.list-view-actions {
    display: flex;
    gap: 10px;
}

.btn-list-view {
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-exit {
    background: var(--bg-main);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-exit:hover {
    background: var(--bg-hover);
}

.btn-add-products {
    background: var(--primary);
    color: white;
}

.btn-add-products:hover {
    background: var(--primary-hover);
}

.btn-export {
    background: var(--success);
    color: white;
}

.btn-export:hover {
    opacity: 0.9;
}


.list-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
}

.list-table thead {
    background: #f5f7fa;
}

.list-table th {
    padding: 12px;
    text-align: left;
    font-weight: 600;
    font-size: 13px;
    color: #666;
    border-bottom: 2px solid #e0e0e0;
}

.list-table tbody tr {
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.2s;
}

.list-table tbody tr:hover {
    background: #f9fafb;
}

.list-table td {
    padding: 12px;
    font-size: 13px;
}

/* ==================== POPULATION MODE ==================== */
.population-mode-banner {
    background: var(--primary);
    color: white;
    padding: 12px 20px;
    margin-bottom: 20px;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.population-mode-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.population-mode-info h3 {
    font-size: 14px;
    font-weight: 600;
    margin: 0;
}

.population-mode-info p {
    font-size: 12px;
    margin: 0;
    opacity: 0.9;
}

.btn-save-exit {
    background: white;
    color: var(--primary);
    padding: 8px 20px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-save-exit:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* ── ASIN copy button in table rows ─────────────────────────── */
.asin-tbl-copy {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 5px;
    border: 1px solid var(--border-color);
    background: transparent;
    color: var(--text-muted);
    font-size: 11px;
    cursor: pointer;
    transition: all 0.12s;
    flex-shrink: 0;
    opacity: 0;
    pointer-events: none;
}

tr:hover .asin-tbl-copy,
.asin-tbl-copy:focus {
    opacity: 1;
    pointer-events: auto;
}

.asin-tbl-copy:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
    border-color: var(--text-muted);
}

/* ── Toast notification — modern pill design ────────────────── */
.toast-notification {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 10001;
    animation: toastSlideIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    pointer-events: auto;
}

@keyframes toastSlideIn {
    from { transform: translateY(60px) scale(0.96); opacity: 0; }
    to   { transform: translateY(0) scale(1);       opacity: 1; }
}

@keyframes toastSlideOut {
    from { transform: translateY(0) scale(1);      opacity: 1; }
    to   { transform: translateY(60px) scale(0.96); opacity: 0; }
}

.toast-notification.hiding {
    animation: toastSlideOut 0.25s ease-in forwards;
}

.toast-content {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #1a1a1a;
    color: #ffffff;
    padding: 12px 16px;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.22);
    min-width: 200px;
    max-width: 340px;
    font-size: 13px;
    font-weight: 600;
}

.toast-icon {
    width: 22px;
    height: 22px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    flex-shrink: 0;
    background: rgba(255,255,255,0.15);
}

.toast-message { flex: 1; line-height: 1.3; }

/* Type variants */
.toast-notification.success .toast-content { background: #059669; }
.toast-notification.error   .toast-content { background: #dc2626; }
.toast-notification.warning .toast-content { background: #d97706; }
.toast-notification.info    .toast-content { background: #2563eb; }


/* ==================== CREATE LIST MODAL ==================== */
.create-list-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    backdrop-filter: blur(2px);
}

.create-list-modal.active {
    display: flex;
}

.create-list-content {
    background: var(--bg-card);
    border-radius: 8px;
    width: 90%;
    max-width: 450px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    animation: modalZoomIn 0.3s ease-out;
}

@keyframes modalZoomIn {
    from {
        transform: scale(0.9);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.create-list-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
}

.create-list-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.create-list-body {
    padding: 24px;
}

.create-list-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.input-group {
    margin-bottom: 16px;
}

.input-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.input-group input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 14px;
    color: var(--text-primary);
    background: var(--bg-secondary) !important;
    transition: all 0.2s;
}

.input-group input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(107, 119, 140, 0.1);
}

.btn-modal {
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
}

.btn-modal-cancel {
    background: var(--bg-main);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-modal-cancel:hover {
    background: var(--bg-hover);
}

.btn-modal-confirm {
    background: var(--primary);
    color: white;
}

.btn-modal-confirm:hover {
    background: var(--primary-hover);
}


/* ==================== SIMPLE WHITE CURVY MODALS ==================== */

/* Overlay */
.universal-modal-overlay,
.create-list-modal,
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.65);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10001;
    backdrop-filter: blur(4px);
}

.universal-modal-overlay[style*="flex"],
.create-list-modal[style*="flex"],
.modal-overlay[style*="flex"] {
    display: flex;
}

/* Modal Container - Simple White & Curvy */
.universal-modal-content,
.create-list-content,
.modal-overlay .modal-content {
    background: #ffffff;
    border-radius: 16px;
    padding: 32px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

/* Hide old headers */
.universal-modal-header,
.create-list-header,
.modal-header,
.universal-modal-icon {
    display: none !important;
}

.universal-modal-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.universal-modal-icon.success-icon {
    color: #10b981;
}

.universal-modal-icon.error-icon {
    color: #ef4444;
}

.universal-modal-icon.warning-icon {
    color: #f59e0b;
}

.universal-modal-icon.info-icon {
    color: #3b82f6;
}


/* Titles - Clean & Bold */
h3[id$="ModalTitle"],
.universal-modal-content h3,
.create-list-content h3,
.modal-content h3,
.modal-title {
    font-size: 20px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 20px 0;
    padding: 0;
}

/* Body Text */
.universal-modal-content p,
.create-list-content p,
.modal-content p {
    font-size: 15px;
    color: #4a4a4a;
    margin: 0 0 24px 0;
    padding: 0;
    line-height: 1.6;
}

/* Input Sections */
.input-group,
.form-group {
    margin: 20px 0;
}

.input-group label,
.form-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 8px;
}

.input-group input,
.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    font-size: 15px;
    background: #fafafa;
    color: #1a1a1a;
    transition: all 0.2s;
}

.input-group input:focus,
.form-control:focus {
    outline: none;
    border-color: #6b778c;
    background: #ffffff;
    box-shadow: 0 0 0 4px rgba(107, 119, 140, 0.1);
}

.form-text {
    font-size: 13px;
    color: #888;
    margin-top: 6px;
}

/* Footer */
.universal-modal-footer,
.create-list-footer,
.modal-footer {
    padding: 24px 0 0;
    margin-top: 8px;
    border: none;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* Buttons - Curvy & Clean */
.btn-modal-primary,
.btn-modal-secondary,
.btn-modal-danger,
.btn-modal-confirm,
.btn-modal-cancel,
.btn-primary,
.btn-secondary {
    padding: 12px 24px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
}

.btn-modal-primary,
.btn-modal-confirm,
.btn-primary {
    background: #6b778c;
    color: #ffffff;
}

.btn-modal-primary:hover,
.btn-modal-confirm:hover,
.btn-primary:hover {
    background: #5e6c84;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(107, 119, 140, 0.3);
}

.btn-modal-secondary,
.btn-modal-cancel,
.btn-secondary {
    background: #f5f5f5;
    color: #1a1a1a;
}

.btn-modal-secondary:hover,
.btn-modal-cancel:hover,
.btn-secondary:hover {
    background: #e8e8e8;
}

.btn-modal-danger {
    background: #de350b;
    color: #ffffff;
}

.btn-modal-danger:hover {
    background: #bf2600;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(222, 53, 11, 0.3);
}

/* Center Confirm Modal */
#confirmModal .universal-modal-content {
    text-align: center;
}

#confirmModal h3,
#confirmModal p {
    text-align: center;
}

#confirmModal .universal-modal-footer {
    justify-content: center;
}
/* ==================== FIX SAVE PRESET MODAL ==================== */
#savePresetModal {
    backdrop-filter: blur(4px);
}
#savePresetModal .modal-overlay {
    background: rgba(0, 0, 0, 0.65);
}

#savePresetModal .universal-modal-content,
#savePresetModal .modal-content {
    background: var(--bg-card) !important;
    border-radius: 16px !important;
    padding: 32px !important;
}

#savePresetModal h3 {
    font-size: 20px !important;
    font-weight: 700 !important;
    color: var(--text-primary) !important;
    margin-bottom: 20px !important;
}

#savePresetModal .input-group,
#savePresetModal .form-group {
    margin: 20px 0 !important;
}

#savePresetModal input {
    width: 100% !important;
    padding: 12px 16px !important;
    border: 1.5px solid var(--border-color) !important;
    border-radius: 12px !important;
    font-size: 15px !important;
    background: var(--bg-secondary) !important;
    color: var(--text-primary) !important;
}

#savePresetModal input:focus {
    border-color: var(--primary) !important;
    background: var(--bg-hover) !important;
}


#savePresetModal .modal-header {
    background: #d0d0d0;
    padding: 20px 24px;
    border-bottom: 2px solid #b0b0b0;
    border-radius: 12px 12px 0 0;
}

#savePresetModal .modal-title {
    font-size: 17px;
    font-weight: 700;
    color: var(--text-primary);
}

#savePresetModal .modal-close {
    width: 30px;
    height: 30px;
    border-radius: 6px;
    background: #e0e0e0;
    border: 2px solid #b0b0b0;
    transition: all 0.2s;
}

#savePresetModal .modal-close:hover {
    background: var(--danger);
    color: white;
    border-color: var(--danger);
}

#savePresetModal .modal-body {
    padding: 28px 24px;
    background: var(--bg-sidebar);
}


#savePresetModal .universal-modal-footer,
#savePresetModal .modal-footer {
    padding-top: 24px !important;
    gap: 12px !important;
}

#savePresetModal .form-control {
    border: 2px solid #999;
}

#savePresetModal .form-group {
    background: #f0f0f0;
    border: 2px solid #b0b0b0;
    border-radius: 8px;
    padding: 16px;
    margin: 12px 0;
}

#savePresetModal .form-label {
    margin-bottom: 10px;
}


#savePresetModal .btn {
    padding: 10px 22px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
}

#savePresetModal button {
    padding: 12px 24px !important;
    border-radius: 12px !important;
    font-size: 15px !important;
}

#savePresetModal .btn-secondary {
    border: 2px solid #b0b0b0;
    background: #e8e8e8;
}

#savePresetModal .btn-primary {
    box-shadow: 0 3px 10px rgba(107, 119, 140, 0.25);
}

/* ==================== NOTIFICATION MODAL (TOP-RIGHT) ==================== */
.notification-modal {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 10003;
    display: none;
}

.notification-modal.show {
    display: block;
    animation: slideInFromRight 0.4s ease-out;
}

@keyframes slideInFromRight {
    from { transform: translateX(400px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

.notification-content {
    background: var(--bg-card);
    border: 3px solid #a0a0a0;
    border-radius: 8px;
    padding: 18px 20px;
    min-width: 320px;
    max-width: 400px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    gap: 14px;
}

.notification-content.success { border-color: var(--success); }
.notification-content.error { border-color: var(--danger); }
.notification-content.warning { border-color: var(--warning); }

.notification-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.notification-content.success .notification-icon { background: var(--success); }
.notification-content.error .notification-icon { background: var(--danger); }
.notification-content.warning .notification-icon { background: var(--warning); }

.notification-icon i {
    font-size: 22px;
    color: white;
}

.notification-body {
    flex: 1;
}

.notification-body h4 {
    font-size: 14px;
    font-weight: 700;
    color: #000;
    margin: 0 0 4px 0;
}

.notification-body p {
    font-size: 13px;
    color: var(--text-secondary);
    margin: 0;
}

.notification-close {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
}

.notification-close:hover {
    color: var(--text-primary);
}


@keyframes bounceDown {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(3px); }
}

.table-row-clickable {
    position: relative;
}



/* ==================== TOAST ANIMATIONS ==================== */
@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* List & Inventory Checkbox Sizes */
.bulk-select-checkbox,
input[type="checkbox"].bulk-select-checkbox,
.list-edit-checkbox {
    width: 18px !important;
    height: 18px !important;
    cursor: pointer;
    margin: 0;
}

/* =============================================================================
   GLOBAL DARK-GREY OVERRIDES
   Replaces hardcoded whites / lights with CSS variable equivalents
   ============================================================================= */

/* Page header bar */
.page-header,
.page-header-bar {
    background: var(--bg-card) !important;
    border-bottom-color: var(--border-color) !important;
}

/* Inputs & selects globally */
input:not([type="checkbox"]):not([type="radio"]):not([type="range"]),
select,
textarea {
    background: var(--bg-secondary) !important;
    color: var(--text-primary) !important;
    border-color: var(--border-color) !important;
}
input::placeholder,
textarea::placeholder { color: var(--text-muted) !important; }
select option { background: var(--bg-secondary); color: var(--text-primary); }

/* ── Inventory / List table: clean modern rows ──────────────────────────── */
.data-table tbody tr { background: var(--bg-card); }
.data-table tbody tr:hover td { background: var(--bg-secondary) !important; }
.data-table tbody td { border-bottom-color: var(--border-light); color: var(--text-primary); }
.data-table thead th { background: var(--bg-card); color: var(--text-muted); border-bottom-color: var(--border-color); }

/* Score badges in table */
.score-badge-inline {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 24px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 700;
    padding: 0 6px;
}
.score-badge-inline.elite { background: #ecfdf5; color: #059669; }
.score-badge-inline.good  { background: #eff6ff; color: #2563eb; }
.score-badge-inline.fair  { background: #fffbeb; color: #d97706; }
.score-badge-inline.weak  { background: #fef2f2; color: #dc2626; }

/* Product name cell — two-line: asin + title */
.tbl-product-asin { font-size: 11px; font-weight: 700; font-family: monospace; color: var(--text-primary); margin-bottom: 1px; }
.tbl-product-title { font-size: 12px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 280px; }

/* Run type badge */
.run-type-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
}

/* Score distribution chips */
.score-dist {
    display: flex;
    gap: 4px;
    flex-wrap: nowrap;
}
.score-chip {
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
}
.score-chip.elite { background: #ecfdf5; color: #059669; }
.score-chip.good  { background: #eff6ff; color: #2563eb; }
.score-chip.fair  { background: #fffbeb; color: #d97706; }
.score-chip.weak  { background: #fef2f2; color: #dc2626; }

/* List table rows (same style) */
.list-table tbody tr { background: var(--bg-card) !important; }
.list-table tbody tr:hover td { background: var(--bg-secondary) !important; }
.list-table td { color: var(--text-primary) !important; border-bottom-color: var(--border-light) !important; }
.list-table th { background: var(--bg-card) !important; color: var(--text-muted) !important; border-bottom-color: var(--border-color) !important; }

/* List-item sidebar entries */
.list-item {
    background: var(--bg-secondary) !important;
    border-radius: 8px !important;
}
.list-item:hover { background: var(--bg-hover) !important; }
/* Light mode: dark bg active; dark mode override below overrides this with border-only */
.list-item.active { background: #1a1a1a !important; }
[data-theme="light"] .list-item.active { background: #1a1a1a !important; }

/* =============================================================================
   BUTTONS — Solid dark style
   ============================================================================= */

/* ── Primary Solid (warm dark bg + white text + icon box) ───────────────── */
.run-btn, .analyze-btn, .rp-run-btn,
.ret-analyze-btn, .ci-analyze-btn, .cf-analyze-btn, .sea-analyze-btn,
.btn-add-products, .btn-modal-primary, .btn-modal-confirm {
    background: #2e2e2e !important;
    border: none !important;
    color: #ffffff !important;
    box-shadow: none !important;
    transform: none !important;
    border-radius: 10px !important;
    padding: 9px 16px !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    transition: background 0.15s ease !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 7px !important;
}
.run-btn:hover, .analyze-btn:hover, .rp-run-btn:hover,
.ret-analyze-btn:hover, .ci-analyze-btn:hover, .cf-analyze-btn:hover, .sea-analyze-btn:hover,
.btn-add-products:hover, .btn-modal-primary:hover, .btn-modal-confirm:hover {
    background: #1f1f1f !important;
    box-shadow: none !important;
    transform: none !important;
}
/* Icon box inside dark named buttons */
.run-btn > i, .analyze-btn > i, .rp-run-btn > i,
.ret-analyze-btn > i, .ci-analyze-btn > i, .cf-analyze-btn > i, .sea-analyze-btn > i,
.btn-add-products > i, .btn-modal-primary > i, .btn-modal-confirm > i {
    background: rgba(255,255,255,0.12) !important;
    border-radius: 6px !important;
    padding: 3px 4px !important;
    line-height: 1 !important;
}

/* ── Secondary (light bg + soft border + dark text) ─────────────────────── */
.btn-exit, .btn-secondary, .btn-modal-secondary, .btn-modal-cancel {
    background: #f0f0f0 !important;
    border: 1.5px solid rgba(0,0,0,0.1) !important;
    color: #2e2e2e !important;
    border-radius: 10px !important;
    padding: 9px 16px !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    box-shadow: none !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 7px !important;
}
.btn-exit:hover, .btn-secondary:hover, .btn-modal-secondary:hover, .btn-modal-cancel:hover {
    background: #e4e4e4 !important;
    color: #1f1f1f !important;
}
/* Icon box inside secondary buttons */
.btn-exit > i, .btn-secondary > i, .btn-modal-secondary > i, .btn-modal-cancel > i {
    background: rgba(0,0,0,0.07) !important;
    border-radius: 6px !important;
    padding: 3px 4px !important;
    line-height: 1 !important;
}

/* ── Export / Success (green) ────────────────────────────────────────────── */
.btn-export {
    background: #10b981 !important;
    border: none !important;
    color: #ffffff !important;
    border-radius: 10px !important;
    box-shadow: none !important;
}
.btn-export:hover {
    background: #059669 !important;
    opacity: 1 !important;
}

/* ── Danger (red) ────────────────────────────────────────────────────────── */
.btn-modal-danger, .btn-danger {
    background: #ef4444 !important;
    border: none !important;
    color: #ffffff !important;
    border-radius: 10px !important;
    box-shadow: none !important;
}
.btn-modal-danger:hover, .btn-danger:hover {
    background: #dc2626 !important;
}

/* ── Sort button active ──────────────────────────────────────────────────── */
.sort-btn.active-asc, .sort-btn.active-desc {
    background: #1a1a1a !important;
    border-color: #1a1a1a !important;
    color: #ffffff !important;
}
[data-theme="dark"] .sort-btn.active-asc,
[data-theme="dark"] .sort-btn.active-desc {
    background: #3a3a3a !important;
    border-color: rgba(255,255,255,0.15) !important;
    color: #ffffff !important;
}

/* ── List active item ────────────────────────────────────────────────────── */
.list-item.active {
    background: #1a1a1a !important;
    border-color: #1a1a1a !important;
    color: #ffffff !important;
}
[data-theme="dark"] .list-item.active {
    background: #2e2e2e !important;
    border-color: rgba(255,255,255,0.12) !important;
    color: #ffffff !important;
}

/* =============================================================================
   TABLES — Clean divider rows, no zebra
   ============================================================================= */

.perf-table, .sinv-table, .sea-table {
    width: 100%;
    border-collapse: collapse;
}
.perf-table thead tr,
.sinv-table thead tr,
.sea-table thead tr {
    border-bottom: 1.5px solid var(--border-color);
}
.perf-table thead th,
.sinv-table thead th,
.sea-table thead th {
    padding: 10px 16px;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    background: transparent !important;
}
.perf-table tbody td,
.sinv-table tbody td,
.sea-table tbody td {
    padding: 12px 16px;
    font-size: 13px;
    border-bottom: 1px solid var(--border-light);
    background: transparent !important;
}
.perf-table tbody tr:hover td,
.sinv-table tbody tr:hover td,
.sea-table tbody tr:hover td {
    background: var(--bg-hover) !important;
}
.perf-table tbody tr:last-child td,
.sinv-table tbody tr:last-child td,
.sea-table tbody tr:last-child td {
    border-bottom: none;
}

/* =============================================================================
   MODAL REDESIGN — dark card, sharp content
   ============================================================================= */

/* Overlay backdrop */
.universal-modal-overlay,
.create-list-modal,
.modal-overlay {
    background: rgba(0, 0, 0, 0.75) !important;
    backdrop-filter: blur(6px) !important;
}

/* Modal card */
.universal-modal-content,
.create-list-content,
.modal-overlay .modal-content {
    background: var(--bg-card) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 18px !important;
    padding: 28px 32px !important;
    box-shadow: 0 32px 80px rgba(0,0,0,0.6) !important;
    max-width: 440px !important;
}

/* Modal icon strip at top */
.universal-modal-content::before,
.create-list-content::before {
    content: '';
    display: block;
    width: 40px;
    height: 4px;
    background: var(--primary);
    border-radius: 2px;
    margin-bottom: 20px;
}

/* Modal title */
h3[id$="ModalTitle"],
.universal-modal-content h3,
.create-list-content h3,
.modal-content h3,
.modal-title {
    color: var(--text-primary) !important;
    font-size: 18px !important;
    font-weight: 700 !important;
    margin: 0 0 12px !important;
}

/* Modal body text */
.universal-modal-content p,
.create-list-content p,
.modal-content p {
    color: var(--text-secondary) !important;
    font-size: 14px !important;
    margin: 0 0 20px !important;
    line-height: 1.6 !important;
}

/* Modal inputs */
.input-group input,
.create-list-content input {
    background: var(--bg-secondary) !important;
    border: 1.5px solid var(--border-color) !important;
    color: var(--text-primary) !important;
    border-radius: 10px !important;
    padding: 11px 14px !important;
    font-size: 14px !important;
}
.input-group input:focus,
.create-list-content input:focus {
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 3px rgba(138,150,168,0.15) !important;
    background: var(--bg-hover) !important;
}

/* Modal labels */
.input-group label { color: var(--text-primary) !important; font-size: 13px !important; }

/* Modal footer buttons — outline style */
.universal-modal-footer,
.create-list-footer,
.modal-footer {
    border-top: 1px solid var(--border-color) !important;
    padding: 20px 0 0 !important;
    gap: 10px !important;
}

.btn-modal-primary,
.btn-modal-confirm,
.btn-modal-cancel,
.btn-modal-secondary,
.btn-modal-danger {
    padding: 10px 22px !important;
    border-radius: 10px !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    transition: all 0.18s !important;
}

/* Cancel / secondary — muted outline */
.btn-modal-cancel,
.btn-modal-secondary {
    background: transparent !important;
    border: 1.5px solid var(--border-color) !important;
    color: var(--text-secondary) !important;
}
.btn-modal-cancel:hover,
.btn-modal-secondary:hover {
    background: var(--bg-hover) !important;
    border-color: var(--text-muted) !important;
    color: var(--text-primary) !important;
    transform: none !important;
}

/* Confirm / primary — filled orange */
.btn-modal-primary,
.btn-modal-confirm {
    background: var(--primary) !important;
    border: 1.5px solid var(--primary) !important;
    color: #fff !important;
    box-shadow: none !important;
}
.btn-modal-primary:hover,
.btn-modal-confirm:hover {
    background: var(--primary-hover) !important;
    border-color: var(--primary-hover) !important;
    color: #fff !important;
    transform: none !important;
    box-shadow: none !important;
}

/* Danger — red outline → fills on hover */
.btn-modal-danger {
    background: transparent !important;
    border: 1.5px solid #de350b !important;
    color: #de350b !important;
    box-shadow: none !important;
}
.btn-modal-danger:hover {
    background: #de350b !important;
    color: #fff !important;
    transform: none !important;
    box-shadow: none !important;
}

/* =============================================================================
   VARIOUS HARDCODED WHITE FIXES
   ============================================================================= */

/* Card and panel backgrounds */
.card, .card-body,
.profile-card, .perf-card, .ih-card, .fin-card,
.rp-card, .ret-card, .ci-card, .cf-card, .sea-card,
.rp-table-card, .ret-table-card, .ci-table-card, .cf-table-card, .sea-table-card,
.cf-scenario-card-wrap, .cf-rec-card, .sea-calendar-card, .sea-table-card,
.sinv-stat-card, .fin-chart-card, .fin-monthly-card, .fin-cost-card,
.ih-velocity-card, .ih-summary-card, .ih-storage-card,
.perf-chart-card, .perf-top-card, .an-chart-card {
    background: var(--bg-card) !important;
    border-color: var(--border-color) !important;
    color: var(--text-primary) !important;
}

/* Table headers */
.rp-table th, .ret-table th, .ci-table th, .cf-table th, .sea-table th,
.sinv-table th, .ih-table th, .perf-table th {
    background: var(--bg-secondary) !important;
    color: var(--text-muted) !important;
    border-bottom-color: var(--border-color) !important;
}

/* Table rows */
.rp-table td, .ret-table td, .ci-table td, .cf-table td, .sea-table td,
.sinv-table td, .ih-table td, .perf-table td {
    border-bottom-color: var(--border-color) !important;
    color: var(--text-primary) !important;
}
.rp-table tr:hover td, .ret-table tr:hover td, .ci-table tr:hover td,
.cf-table tr:hover td, .sea-table tr:hover td,
.sinv-table tr:hover td, .ih-table tr:hover td, .perf-table tr:hover td {
    background: var(--bg-hover) !important;
}

/* Header bar */
.page-header-bar,
div[class*="header-bar"] {
    background: var(--bg-card) !important;
}

/* Dropdown menus */
.dropdown-menu,
#profileDropdown {
    background: var(--bg-card) !important;
    border-color: var(--border-color) !important;
    color: var(--text-primary) !important;
}
.dropdown-item { color: var(--text-primary) !important; }
.dropdown-item:hover { background: var(--bg-hover) !important; }

/* Tabs (Tabler nav-tabs) */
.nav-tabs { border-bottom-color: var(--border-color) !important; background: var(--bg-card) !important; }
.nav-tabs .nav-link { color: var(--text-muted) !important; }
.nav-tabs .nav-link.active { color: var(--text-primary) !important; background: var(--bg-hover) !important; }

/* Profile inputs */
.profile-field input,
.profile-field select,
.profile-field textarea {
    background: var(--bg-secondary) !important;
    border-color: var(--border-color) !important;
    color: var(--text-primary) !important;
    border-radius: 8px !important;
}

/* Notification / toast */
.notification-modal .notification-content {
    background: var(--bg-card) !important;
    border-color: var(--border-color) !important;
    color: var(--text-primary) !important;
}
.notification-body h4 { color: var(--text-primary) !important; }

/* Scenario cards (cashflow) */
.cf-scenario-card {
    background: var(--bg-secondary) !important;
    border-color: var(--border-color) !important;
}

/* Inv page bg-secondary */
.bg-secondary { background: var(--bg-secondary) !important; }

/* Hardcoded #f9fafb, #f5f5f5 overrides */
[style*="background: #f9fafb"],
[style*="background:#f9fafb"],
[style*="background: #f5f5f5"],
[style*="background:#f5f5f5"],
[style*="background-color: #ffffff"],
[style*="background-color:#ffffff"] {
    background: var(--bg-secondary) !important;
}

/* Header page title area */
.page-header { background: var(--bg-card) !important; border-bottom: 1px solid var(--border-color) !important; }
h1.page-title-header, .page-title-header { color: var(--text-primary) !important; }
p.page-subtitle-header, .page-subtitle-header { color: var(--text-muted) !important; }

/* Filter bar */
.filter-bar, .filter-section { background: var(--bg-secondary) !important; border-color: var(--border-color) !important; }

/* Scrollbars — subtle */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* =============================================================================
   ORVIMO DOT-GRID CANVAS — FLOATING CARD STANDARDS
   All card-like elements get a subtle shadow to lift off the dot-grid
   ============================================================================= */

/* Light mode card shadow */
.card, .card-body,
.dashboard-grid, .chart-panel, .chart-panel-white, .mini-chart-card,
.activity-panel, .quick-actions-panel,
.info-panel, .input-panel, .result-card,
.ih-card, .fin-card, .rp-card, .ret-card, .ci-card, .cf-card, .sea-card,
.perf-card, .sinv-stat-card, .fin-chart-card, .fin-monthly-card, .fin-cost-card,
.ih-velocity-card, .ih-summary-card, .ih-storage-card,
.perf-chart-card, .perf-top-card, .an-chart-card,
.rp-table-card, .ret-table-card, .ci-table-card, .cf-table-card, .sea-table-card,
.cf-scenario-card-wrap, .cf-rec-card, .sea-calendar-card,
.profile-card, .unified-filter-panel, .lists-panel {
    box-shadow: 0 1px 3px rgba(0,0,0,0.05), 0 4px 12px rgba(0,0,0,0.04) !important;
}

/* Dark mode — border-defined, subtle shadow */
[data-theme="dark"] .card,
[data-theme="dark"] .card-body,
[data-theme="dark"] .dashboard-grid,
[data-theme="dark"] .chart-panel,
[data-theme="dark"] .chart-panel-white,
[data-theme="dark"] .mini-chart-card,
[data-theme="dark"] .activity-panel,
[data-theme="dark"] .quick-actions-panel,
[data-theme="dark"] .info-panel,
[data-theme="dark"] .input-panel,
[data-theme="dark"] .result-card,
[data-theme="dark"] .ih-card,
[data-theme="dark"] .fin-card,
[data-theme="dark"] .rp-card,
[data-theme="dark"] .ret-card,
[data-theme="dark"] .ci-card,
[data-theme="dark"] .cf-card,
[data-theme="dark"] .sea-card,
[data-theme="dark"] .perf-card,
[data-theme="dark"] .sinv-stat-card,
[data-theme="dark"] .profile-card,
[data-theme="dark"] .unified-filter-panel,
[data-theme="dark"] .lists-panel {
    box-shadow: 0 1px 4px rgba(0,0,0,0.4), 0 4px 12px rgba(0,0,0,0.25) !important;
}

/* Panels using var(--bg-sidebar) → convert to floating cards on dot-grid */
.unified-filter-panel,
.lists-panel,
.preset-section {
    background: var(--bg-card) !important;
    border: 1px solid var(--border-color) !important;
}

/* result-panel is an inner section, use bg-secondary for tonal depth */
.result-panel {
    background: var(--bg-secondary) !important;
    border: 1px solid var(--border-color) !important;
}

/* Dark mode stat rows — align card values to theme */
[data-theme="dark"] .stat-value { color: var(--text-primary) !important; }

/* Modal body using bg-sidebar → card bg */
#savePresetModal .modal-body { background: var(--bg-card) !important; }

/* Page title sizing — slightly tighter for Orvimo proportions */
.page-title-header { font-size: 18px !important; font-weight: 700 !important; }
.page-subtitle-header { font-size: 12px !important; }

/* ============================================================================
   RUN HISTORY PAGE — redesigned filter + table
   ============================================================================ */

.runs-filter-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    background: var(--bg-card);
    border: 1.5px solid var(--border-color);
    border-radius: 14px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}

.runs-filter-search {
    position: relative;
    flex: 1;
    min-width: 180px;
}

.runs-search-icon {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 14px;
    pointer-events: none;
}

.runs-search-input {
    width: 100%;
    padding: 8px 12px 8px 34px;
    border: 1.5px solid var(--border-color);
    border-radius: 9px;
    font-size: 13px;
    font-weight: 500;
    background: var(--bg-secondary) !important;
    color: var(--text-primary) !important;
    transition: border-color 0.15s;
    font-family: inherit;
}

.runs-search-input:focus {
    outline: none;
    border-color: #1a1a1a;
    box-shadow: 0 0 0 3px rgba(26,26,26,0.05);
}

.runs-filter-pills {
    display: flex;
    align-items: center;
    gap: 5px;
    background: rgba(0,0,0,0.05);
    border-radius: 10px;
    padding: 3px;
}

[data-theme="dark"] .runs-filter-pills { background: rgba(255,255,255,0.06); }

.run-filter-pill {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    border-radius: 7px;
    border: none;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    background: transparent;
    cursor: pointer;
    transition: all 0.13s;
    font-family: inherit;
    white-space: nowrap;
}

.run-filter-pill:hover { color: var(--text-secondary); }
.run-filter-pill.active { background: #1a1a1a; color: #ffffff; box-shadow: 0 1px 4px rgba(0,0,0,0.15); }
[data-theme="dark"] .run-filter-pill.active { background: #3a3a3a; color: #ffffff; box-shadow: none; }

.runs-table-wrap {
    background: var(--bg-card);
    border: 1.5px solid var(--border-color);
    border-radius: 14px;
    overflow: hidden;
}

.runs-table-wrap .data-table { border-radius: 0; }

/* ── Show More / Load More button ───────────────────────────── */
.show-more-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    padding: 11px 16px;
    background: transparent;
    border: 1.5px solid var(--border-color);
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.14s;
    font-family: inherit;
    margin-top: 10px;
}

.show-more-btn:hover {
    background: var(--bg-hover);
    border-color: var(--text-secondary);
    color: var(--text-primary);
}

/* ── Inventory action buttons (show more row) ───────────────── */
.show-more-row td {
    padding: 10px 0 4px !important;
    border-bottom: none !important;
}

/* ── Input redesign: all remaining form-control and select ─── */
input[type="text"],
input[type="number"],
input[type="search"],
input[type="email"],
input[type="password"],
textarea,
select {
    font-family: inherit;
}

textarea.form-control {
    border-radius: 9px;
    border: 1.5px solid var(--border-color);
    background: var(--bg-secondary) !important;
    color: var(--text-primary) !important;
    resize: vertical;
}

textarea.form-control:focus {
    outline: none;
    border-color: #1a1a1a;
    box-shadow: 0 0 0 3px rgba(26,26,26,0.05);
}

/* ── Inventory/Lists action area buttons ─────────────────────── */
.btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: var(--bg-secondary);
    border: 1.5px solid var(--border-color);
    border-radius: 9px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.14s;
    font-family: inherit;
}

.btn-secondary:hover {
    background: var(--bg-hover);
    border-color: var(--text-secondary);
    color: var(--text-primary);
}

.btn-danger {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: rgba(220,38,38,0.08);
    border: 1.5px solid rgba(220,38,38,0.25);
    border-radius: 9px;
    font-size: 12px;
    font-weight: 600;
    color: #dc2626;
    cursor: pointer;
    transition: all 0.14s;
    font-family: inherit;
}

.btn-danger:hover {
    background: rgba(220,38,38,0.15);
    border-color: rgba(220,38,38,0.5);
}

/* ── Create List Modal modernized ────────────────────────────── */
.create-list-content {
    border-radius: 16px;
    padding: 24px;
    border: 1.5px solid var(--border-color);
}

.create-list-content h3 {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 16px;
}

.create-list-footer {
    justify-content: flex-end;
    gap: 8px;
    padding: 16px 0 0;
    border-top: 1px solid var(--border-light);
}

.btn-modal-cancel {
    background: var(--bg-secondary);
    color: var(--text-secondary);
    border: 1.5px solid var(--border-color);
    border-radius: 9px;
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.14s;
}

.btn-modal-cancel:hover { background: var(--bg-hover); color: var(--text-primary); }

.btn-modal-confirm {
    background: #1a1a1a;
    color: white;
    border: none;
    border-radius: 9px;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.14s;
}

.btn-modal-confirm:hover { background: #333; }
[data-theme="dark"] .btn-modal-confirm { background: #383838; color: #ffffff; }
[data-theme="dark"] .btn-modal-confirm:hover { background: #444444; }

.btn-modal-danger {
    background: #dc2626;
    color: white;
    border: none;
    border-radius: 9px;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.14s;
}

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

/* ── input-panel and result-panel modernized ────────────────── */
.input-panel, .result-panel {
    border-radius: 14px !important;
    border: 1.5px solid var(--border-color) !important;
}

/* ── Panel title ─────────────────────────────────────────────── */
.panel-title {
    font-size: 13px !important;
    font-weight: 700 !important;
    color: var(--text-primary) !important;
}

/* ── Section separator ───────────────────────────────────────── */
.section-separator {
    height: 1px;
    background: var(--border-light);
    margin: 10px 0 14px;
}

/* ============================================================================
   ANALYZER PAGES — Product Analyzer & Bulk Analyzer
   ============================================================================ */

.analyzer-hero-card {
    background: var(--bg-card);
    border: 1.5px solid var(--border-color);
    border-radius: 16px;
    padding: 20px 24px;
    margin-bottom: 14px;
}

.analyzer-hero-left {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 16px;
}

.analyzer-hero-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: #1a1a1a;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

/* bulk icon uses same dark style as base .analyzer-hero-icon — no override needed */

.analyzer-hero-title {
    font-size: 16px;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.analyzer-hero-sub {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.4;
}

.analyzer-feature-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 12px;
}

.analyzer-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 11px;
    background: var(--bg-secondary);
    border: 1.5px solid var(--border-color);
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
}

.analyzer-pill i { font-size: 12px; }

/* Input row for product analyzer */
.analyzer-input-row {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 12px;
}

.analyzer-input-wrap {
    position: relative;
    flex: 1;
}

.analyzer-input-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 15px;
    pointer-events: none;
}

.analyzer-asin-input {
    width: 100%;
    padding: 11px 14px 11px 38px;
    border: 1.5px solid var(--border-color);
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    font-family: 'Courier New', monospace;
    letter-spacing: 0.08em;
    background: var(--bg-secondary) !important;
    color: var(--text-primary) !important;
    transition: border-color 0.15s;
}

.analyzer-asin-input:focus {
    outline: none;
    border-color: #1a1a1a;
    box-shadow: 0 0 0 3px rgba(26,26,26,0.06);
}

/* Loading card */
.analyzer-loading-card {
    display: flex;
    align-items: center;
    gap: 16px;
    background: var(--bg-card);
    border: 1.5px solid var(--border-color);
    border-radius: 14px;
    padding: 24px;
    margin-bottom: 14px;
}

.analyzer-loading-text { }
.analyzer-loading-title { font-size: 14px; font-weight: 700; color: var(--text-primary); margin-bottom: 3px; }
.analyzer-loading-sub { font-size: 12px; color: var(--text-muted); }

/* Bulk analyzer card */
.bulk-input-card {
    background: var(--bg-card);
    border: 1.5px solid var(--border-color);
    border-radius: 14px;
    overflow: hidden;
    margin-bottom: 14px;
}

.bulk-tab-bar {
    display: flex;
    gap: 0;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    padding: 8px 12px 0;
}

.bulk-tab-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: none;
    border-bottom: 2.5px solid transparent;
    background: transparent;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.14s;
    margin-bottom: -1px;
    font-family: inherit;
}

.bulk-tab-btn:hover { color: var(--text-primary); }
.bulk-tab-btn.active { color: var(--text-primary); border-bottom-color: #1a1a1a; }
[data-theme="dark"] .bulk-tab-btn.active { border-bottom-color: var(--primary); }

.bulk-tab-content { padding: 20px; }

.bulk-input-label {
    display: block;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 8px;
}

.bulk-textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1.5px solid var(--border-color);
    border-radius: 10px;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    line-height: 1.6;
    background: var(--bg-secondary) !important;
    color: var(--text-primary) !important;
    resize: vertical;
    transition: border-color 0.15s;
}

.bulk-textarea:focus {
    outline: none;
    border-color: #1a1a1a;
    box-shadow: 0 0 0 3px rgba(26,26,26,0.05);
}

.bulk-input-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 12px;
}

.bulk-asin-hint {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
}

/* File drop zone */
.bulk-file-drop {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 32px;
    border: 2px dashed var(--border-color);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.15s;
    text-align: center;
    background: var(--bg-secondary);
}

.bulk-file-drop:hover {
    border-color: #1a1a1a;
    background: var(--bg-hover);
}

.bulk-file-preview {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: rgba(16,185,129,0.08);
    border: 1.5px solid rgba(16,185,129,0.25);
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

/* ── Inventory controls bar ──────────────────────────────────── */
.inv-controls-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    margin-bottom: 14px;
    background: var(--bg-card);
    border: 1.5px solid var(--border-color);
    border-radius: 10px;
    flex-wrap: wrap;
}

.inv-ctrl-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    white-space: nowrap;
}

.inv-count-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
}

.inv-per-page-input {
    width: 70px;
    padding: 6px 8px;
    border: 1.5px solid var(--border-color);
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    background: var(--bg-secondary) !important;
    color: var(--text-primary) !important;
    text-align: center;
    font-family: inherit;
}

.inv-per-page-input:focus { outline: none; border-color: #1a1a1a; }

.inv-bulk-sep {
    width: 1px;
    height: 20px;
    background: var(--border-color);
}

.btn-sm {
    padding: 6px 11px !important;
    font-size: 12px !important;
    border-radius: 8px !important;
    gap: 5px !important;
}

/* ============================================================================
   LEAD GENERATOR PAGE
   ============================================================================ */

.lead-hero-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 22px 24px;
    background: var(--bg-card);
    border: 1.5px solid var(--border-color);
    border-radius: 14px;
    margin-bottom: 16px;
}

.lead-hero-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: #1a1a1a;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.lead-hero-icon i {
    font-size: 22px;
    color: #ffffff;
}

.lead-hero-text { flex: 1; min-width: 0; }
.lead-hero-title {
    font-size: 17px;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 4px;
}
.lead-hero-sub {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.4;
}

.lead-gen-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: #1a1a1a;
    border: none;
    border-radius: 10px;
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    white-space: nowrap;
    transition: all 0.15s;
}
.lead-gen-btn:hover { background: #333; transform: translateY(-1px); }
.lead-gen-btn i { font-size: 16px; }

.lead-feature-pills {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}
.lead-feature-pill {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 5px 12px;
    background: var(--bg-card);
    border: 1.5px solid var(--border-color);
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
}
.lead-feature-pill i { font-size: 12px; color: var(--text-muted); }

.lead-loading-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 48px 24px;
    background: var(--bg-card);
    border: 1.5px solid var(--border-color);
    border-radius: 14px;
    gap: 12px;
}
.lead-loading-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid var(--border-color);
    border-top-color: #1a1a1a;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.lead-loading-text { font-size: 14px; font-weight: 600; color: var(--text-primary); }
.lead-loading-sub { font-size: 12px; color: var(--text-muted); }

.lead-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 24px;
    gap: 10px;
    text-align: center;
}
.lead-empty-state i { font-size: 48px; color: var(--text-muted); opacity: 0.3; }
.lead-empty-title { font-size: 16px; font-weight: 700; color: var(--text-primary); }
.lead-empty-sub { font-size: 13px; color: var(--text-muted); max-width: 320px; }

/* ============================================================================
   MY LISTS SPLIT PANEL
   ============================================================================ */

.lists-split-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    height: 100%;
}

.lists-split-left {
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.lists-split-right {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.lists-split-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-secondary);
    flex-shrink: 0;
}

.lists-split-title {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 6px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.lists-split-body {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
}

/* Quick Notes panel */
.qnote-add-row {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}
.qnote-input {
    flex: 1;
    padding: 8px 12px;
    border: 1.5px solid var(--border-color);
    border-radius: 9px;
    font-size: 12px;
    font-family: inherit;
    background: var(--bg-card);
    color: var(--text-primary);
    outline: none;
    transition: border-color 0.15s;
}
.qnote-input:focus { border-color: #1a1a1a; }
.qnote-add-btn {
    padding: 8px 14px;
    background: #1a1a1a;
    border: none;
    border-radius: 9px;
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.14s;
}
.qnote-add-btn:hover { background: #333; }
.qnote-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 8px 10px;
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: 9px;
    margin-bottom: 6px;
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.4;
}
.qnote-item-text { flex: 1; word-break: break-word; }
.qnote-item-ts { font-size: 10px; color: var(--text-muted); white-space: nowrap; flex-shrink: 0; }
.qnote-delete-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    padding: 0 2px;
    font-size: 13px;
    flex-shrink: 0;
    transition: color 0.12s;
}
.qnote-delete-btn:hover { color: #ef4444; }
.qnote-empty {
    text-align: center;
    padding: 24px;
    color: var(--text-muted);
    font-size: 12px;
}

/* ── QuickNotes Advanced Cards ─────────────────────────────────────────────── */
.qnote-card {
    border: 1.5px solid var(--border-color);
    border-radius: 10px;
    padding: 10px 12px;
    margin-bottom: 8px;
    transition: box-shadow 0.12s;
}
.qnote-card:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.08); }
.qnote-card-top {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 6px;
}
.qnote-card-actions {
    display: flex;
    gap: 2px;
    flex-shrink: 0;
    opacity: 0;
    transition: opacity 0.12s;
}
.qnote-card:hover .qnote-card-actions { opacity: 1; }
.qnote-icon-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 3px 5px;
    border-radius: 5px;
    color: var(--text-muted);
    font-size: 13px;
    transition: all 0.12s;
}
.qnote-icon-btn:hover { background: var(--bg-hover); color: var(--text-primary); }
.qnote-icon-btn.danger:hover { color: #ef4444; }
.qnote-card-footer {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.qnote-asin-pill {
    font-size: 10px;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 20px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    cursor: pointer;
    font-family: monospace;
    letter-spacing: 0.5px;
}
.qnote-asin-pill:hover { color: var(--primary); border-color: var(--primary); }
.qnote-color-picker {
    display: flex;
    gap: 4px;
    margin-left: auto;
}
.qnote-color-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 1.5px solid;
    cursor: pointer;
    transition: transform 0.1s;
}
.qnote-color-dot:hover, .qnote-color-dot.active { transform: scale(1.3); }

/* ── Floating / Draggable Notes ──────────────────────────────────────────── */
.floating-note {
    position: fixed;
    width: 260px;
    border-radius: 12px;
    border: 1.5px solid var(--border-color);
    box-shadow: 0 8px 24px rgba(0,0,0,0.18);
    z-index: 9999;
    font-size: 13px;
    overflow: hidden;
}
.fn-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 8px;
    background: rgba(0,0,0,0.06);
    cursor: default;
}
.fn-drag-handle {
    cursor: grab;
    color: var(--text-muted);
    padding: 2px 4px;
}
.fn-drag-handle:active { cursor: grabbing; }
.fn-close {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    font-size: 13px;
    padding: 2px 4px;
    border-radius: 4px;
}
.fn-close:hover { background: rgba(239,68,68,0.15); color: #ef4444; }
.fn-text {
    padding: 10px 12px;
    min-height: 60px;
    outline: none;
    color: var(--text-primary);
    line-height: 1.5;
    word-break: break-word;
}
.fn-asin {
    padding: 4px 12px 8px;
    font-size: 10px;
    font-family: monospace;
    color: var(--text-muted);
    letter-spacing: 0.5px;
}

/* ── ASIN Page Notes Strip ──────────────────────────────────────────────── */
.asin-notes-strip {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    padding: 8px 0 4px;
    margin-bottom: 4px;
}
.asin-notes-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}
.asin-note-pill {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    color: var(--text-secondary);
    border: 1px solid rgba(0,0,0,0.1);
    max-width: 300px;
}
.asin-note-pill button {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    padding: 0;
    font-size: 11px;
    flex-shrink: 0;
}
.asin-note-pill button:hover { color: #ef4444; }

/* ── Dark mode overrides ──────────────────────────────────────────────────── */
[data-theme="dark"] .qnote-card {
    background: var(--bg-secondary) !important;
    border-color: rgba(0,0,0,0.70) !important;
}
[data-theme="dark"] .floating-note {
    border-color: rgba(0,0,0,0.70);
}
[data-theme="dark"] .fn-header { background: rgba(255,255,255,0.04); }

/* ============================================================================
   MODAL — UNIFIED NEW DESIGN
   ============================================================================ */

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    z-index: 9000;
    display: none;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(3px);
}
.modal-overlay[style*="display: flex"],
.modal-overlay[style*="display:flex"] {
    display: flex !important;
}

.modal-content {
    background: var(--bg-card);
    border: 1.5px solid var(--border-color);
    border-radius: 16px;
    padding: 28px;
    min-width: 340px;
    max-width: 440px;
    width: 90%;
    box-shadow: 0 24px 60px rgba(0,0,0,0.22);
    position: relative;
}

.modal-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 18px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-title-icon {
    width: 32px;
    height: 32px;
    border-radius: 9px;
    background: var(--bg-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}

.form-group { margin-bottom: 16px; }
.form-label {
    display: block;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 6px;
}
.form-control,
.form-group input[type="text"],
.form-group input[type="email"],
.form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1.5px solid var(--border-color);
    border-radius: 9px;
    font-size: 13px;
    font-family: inherit;
    background: var(--bg-card);
    color: var(--text-primary);
    outline: none;
    transition: border-color 0.15s;
    box-sizing: border-box;
}
.form-control:focus,
.form-group input[type="text"]:focus,
.form-group input[type="email"]:focus {
    border-color: #1a1a1a;
}
.form-text {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 4px;
    display: block;
}

.modal-footer {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--border-light);
}
.btn-modal-primary {
    padding: 9px 20px;
    background: #1a1a1a;
    border: 1.5px solid #1a1a1a;
    border-radius: 9px;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.14s;
}
.btn-modal-primary:hover { background: #333; }
.btn-modal-secondary,
.btn-secondary {
    padding: 9px 16px;
    background: var(--bg-secondary);
    border: 1.5px solid var(--border-color);
    border-radius: 9px;
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.14s;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}
.btn-modal-secondary:hover,
.btn-secondary:hover { background: var(--bg-hover); color: var(--text-primary); }
.btn-modal-danger,
.btn-danger {
    padding: 9px 16px;
    background: transparent;
    border: 1.5px solid #ef4444;
    border-radius: 9px;
    color: #ef4444;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.14s;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}
.btn-modal-danger:hover,
.btn-danger:hover { background: #ef4444; color: #fff; }

/* Create List Modal - new style */
.create-list-modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    z-index: 9000;
    display: none;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(3px);
}
.create-list-modal.show,
.create-list-modal[style*="flex"],
.create-list-modal[style*="block"] {
    display: flex !important;
}
.create-list-content {
    background: var(--bg-card);
    border: 1.5px solid var(--border-color);
    border-radius: 16px;
    padding: 28px;
    min-width: 340px;
    max-width: 420px;
    width: 90%;
    box-shadow: 0 24px 60px rgba(0,0,0,0.22);
}
.create-list-content h3 {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 18px;
}
.create-list-content .input-group {
    margin-bottom: 20px;
}
.create-list-content .input-group label {
    display: block;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 6px;
}
.create-list-content .input-group input[type="text"] {
    width: 100%;
    padding: 10px 12px;
    border: 1.5px solid var(--border-color);
    border-radius: 9px;
    font-size: 13px;
    font-family: inherit;
    background: var(--bg-card);
    color: var(--text-primary);
    outline: none;
    box-sizing: border-box;
    transition: border-color 0.15s;
}
.create-list-content .input-group input[type="text"]:focus {
    border-color: #1a1a1a;
}
.create-list-footer {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}
.btn-modal-cancel {
    padding: 9px 16px;
    background: var(--bg-secondary);
    border: 1.5px solid var(--border-color);
    border-radius: 9px;
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.14s;
}
.btn-modal-cancel:hover { background: var(--bg-hover); color: var(--text-primary); }
.btn-modal-confirm {
    padding: 9px 20px;
    background: #1a1a1a;
    border: 1.5px solid #1a1a1a;
    border-radius: 9px;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.14s;
}
.btn-modal-confirm:hover { background: #333; }

/* ============================================================================
   ANALYZER INVENTORY-STYLE RESULTS
   ============================================================================ */

.analyzer-results-wrap {
    background: var(--bg-card);
    border: 1.5px solid var(--border-color);
    border-radius: 14px;
    overflow: hidden;
    margin-top: 16px;
}
.analyzer-results-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-secondary);
}
.analyzer-results-title {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.analyzer-results-count {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 600;
}
.analyzer-results-actions {
    display: flex;
    gap: 6px;
}
.analyzer-res-btn {
    padding: 5px 10px;
    background: var(--bg-card);
    border: 1.5px solid var(--border-color);
    border-radius: 7px;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    font-family: inherit;
    transition: all 0.14s;
    display: flex;
    align-items: center;
    gap: 4px;
}
.analyzer-res-btn:hover { background: var(--bg-hover); color: var(--text-primary); }
.analyzer-res-btn.primary { background: #1a1a1a; color: #fff; border-color: #1a1a1a; }
.analyzer-res-btn.primary:hover { background: #333; }

/* ASIN result row — identical to inventory */
.analyzer-inv-row {
    display: grid;
    grid-template-columns: 44px 48px 1fr 80px 70px 70px 70px 60px 80px 120px;
    align-items: center;
    gap: 0;
    padding: 8px 14px;
    border-bottom: 1px solid var(--border-light);
    cursor: pointer;
    transition: background 0.1s;
}
.analyzer-inv-row:last-child { border-bottom: none; }
.analyzer-inv-row:hover { background: var(--bg-secondary); }
.analyzer-inv-row.approved { border-left: 3px solid #10b981; }
.analyzer-inv-row.rejected { border-left: 3px solid #ef4444; }

.arow-img img {
    width: 40px;
    height: 40px;
    object-fit: contain;
    border-radius: 8px;
    background: var(--bg-secondary);
}
.arow-asin { font-size: 11px; font-weight: 700; font-family: monospace; color: var(--text-muted); }
.arow-title { font-size: 12px; color: var(--text-secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.arow-price { font-size: 13px; font-weight: 700; color: var(--text-primary); }
.arow-score .score-badge-inline { font-size: 12px; padding: 3px 8px; }
.arow-actions { display: flex; gap: 4px; justify-content: flex-end; }
.arow-action-btn {
    width: 28px;
    height: 28px;
    border-radius: 7px;
    border: 1.5px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    transition: all 0.13s;
}
.arow-action-btn:hover { background: var(--bg-hover); color: var(--text-primary); }
.arow-action-btn.amazon:hover { background: #f59e0b20; color: #f59e0b; border-color: #f59e0b; }
.arow-action-btn.calc:hover { background: #10b98120; color: #10b981; border-color: #10b981; }
.arow-action-btn.add:hover { background: #3b82f620; color: #3b82f6; border-color: #3b82f6; }
.arow-action-btn.save:hover { background: #8b5cf620; color: #8b5cf6; border-color: #8b5cf6; }

/* ==============================================================================
   DARK MODE — Make.com / Orvimo aesthetic
   Rule: orange (#f97316) = accent only (charts, rings, progress bars)
         buttons, panels, interactive controls = dark neutral
   ============================================================================== */

/* ── Buttons — Make.com dark style: grey bg, light outline, no orange ─────── */
[data-theme="dark"] .btn,
[data-theme="dark"] .btn-primary {
    background: #2e2e2e;
    color: #c8c8c8;
    border-color: rgba(255,255,255,0.1);
    box-shadow: none !important;
}
[data-theme="dark"] .btn:hover,
[data-theme="dark"] .btn-primary:hover {
    background: #383838;
    color: #f0f0f0;
    border-color: rgba(255,255,255,0.16);
}

[data-theme="dark"] .btn-secondary {
    background: #242424;
    color: #888888;
    border-color: rgba(255,255,255,0.08);
    box-shadow: none !important;
}
[data-theme="dark"] .btn-secondary:hover {
    background: #2e2e2e;
    color: #c8c8c8;
    border-color: rgba(255,255,255,0.12);
}

[data-theme="dark"] .btn-sm {
    background: #2e2e2e;
    color: #888888;
    border-color: rgba(255,255,255,0.08);
    box-shadow: none !important;
}
[data-theme="dark"] .btn-sm:hover {
    background: #383838;
    color: #c8c8c8;
}

[data-theme="dark"] .btn-danger,
[data-theme="dark"] .btn-modal-danger {
    background: rgba(239,68,68,0.12);
    color: #f87171;
    border-color: rgba(239,68,68,0.22);
    box-shadow: none !important;
}
[data-theme="dark"] .btn-danger:hover,
[data-theme="dark"] .btn-modal-danger:hover {
    background: rgba(239,68,68,0.22);
    color: #fca5a5;
}

/* Intel hero button — dark neutral with visible outline */
[data-theme="dark"] .intel-hero-btn {
    background: #2e2e2e;
    color: #c8c8c8;
    border-color: rgba(255,255,255,0.1);
    box-shadow: none !important;
}
[data-theme="dark"] .intel-hero-btn:hover {
    background: #383838;
    color: #f0f0f0;
    border-color: rgba(255,255,255,0.16);
}

/* ASIN calc reopen — dark neutral */
[data-theme="dark"] .asin-calc-reopen-btn {
    background: #2e2e2e;
    color: #c8c8c8;
    border-color: rgba(255,255,255,0.1);
    box-shadow: none !important;
}
[data-theme="dark"] .asin-calc-reopen-btn:hover {
    background: #383838;
    color: #f0f0f0;
}

/* Keepa range button active — dark neutral */
[data-theme="dark"] .keepa-range-btn.active {
    background: #3a3a3a !important;
    border-color: #444444 !important;
    color: #ffffff !important;
}

/* ── Section / engine tabs hover ──────────────────────────────────────────── */
[data-theme="dark"] .section-tab-pill:hover,
[data-theme="dark"] .engine-tab:hover {
    color: var(--text-secondary);
    background: rgba(255,255,255,0.06);
}

/* ── Show more button ─────────────────────────────────────────────────────── */
[data-theme="dark"] .show-more-btn {
    background: #1e1e1e;
    border-color: rgba(0,0,0,0.5);
    color: #909090;
}
[data-theme="dark"] .show-more-btn:hover {
    background: #272727;
    color: #cccccc;
}

/* ── Score badges — readable on dark cards ────────────────────────────────── */
[data-theme="dark"] .score-badge-inline.elite {
    background: rgba(16,185,129,0.12);
    color: #34d399;
    border-color: rgba(16,185,129,0.3);
}
[data-theme="dark"] .score-badge-inline.good {
    background: rgba(52,211,153,0.12);
    color: #34d399;
    border-color: rgba(52,211,153,0.3);
}
[data-theme="dark"] .score-badge-inline.fair {
    background: rgba(245,158,11,0.12);
    color: #fbbf24;
    border-color: rgba(245,158,11,0.3);
}
[data-theme="dark"] .score-badge-inline.weak {
    background: rgba(239,68,68,0.12);
    color: #f87171;
    border-color: rgba(239,68,68,0.3);
}

/* ── Status run-type badges ───────────────────────────────────────────────── */
[data-theme="dark"] .run-type-badge {
    background: #272727;
    color: #909090;
    border-color: rgba(0,0,0,0.5);
}

/* ── Intel KPI accent strips — more vivid in dark ────────────────────────── */
[data-theme="dark"] .intel-kpi-card.accent-green  { --kpi-accent: #34d399; }
[data-theme="dark"] .intel-kpi-card.accent-blue   { --kpi-accent: #60a5fa; }
[data-theme="dark"] .intel-kpi-card.accent-amber  { --kpi-accent: #fbbf24; }
[data-theme="dark"] .intel-kpi-card.accent-red    { --kpi-accent: #f87171; }
[data-theme="dark"] .intel-kpi-card.accent-violet { --kpi-accent: #a78bfa; }
[data-theme="dark"] .intel-kpi-card.accent-rose   { --kpi-accent: #fb7185; }
[data-theme="dark"] .intel-kpi-card.accent-sky    { --kpi-accent: #38bdf8; }
[data-theme="dark"] .intel-kpi-card.accent-dark   { --kpi-accent: #f97316; } /* orange accent stripe = correct */

/* ── Modal ────────────────────────────────────────────────────────────────── */
[data-theme="dark"] .modal-overlay {
    background: rgba(0, 0, 0, 0.8);
}
[data-theme="dark"] .modal-content {
    background: #1e1e1e;
    border: 1px solid rgba(0,0,0,0.6);
    box-shadow: 0 24px 64px rgba(0,0,0,0.7);
}
[data-theme="dark"] .modal-title { color: #ebebeb; }
[data-theme="dark"] .modal-body  { color: #909090; }

/* ── Filter panel ─────────────────────────────────────────────────────────── */
[data-theme="dark"] .unified-filter-panel {
    background: #1e1e1e;
    border-color: rgba(0,0,0,0.55);
}

/* ── Data table ───────────────────────────────────────────────────────────── */
[data-theme="dark"] .data-table th {
    background: #272727;
    color: #4a4a4a;
    border-color: rgba(0,0,0,0.4);
}
[data-theme="dark"] .data-table td {
    border-color: rgba(0,0,0,0.3);
}
[data-theme="dark"] .data-table tr:hover td {
    background: rgba(255,255,255,0.025);
}

/* ── ASIN copy buttons ────────────────────────────────────────────────────── */
[data-theme="dark"] .asin-tbl-copy,
[data-theme="dark"] .asin-hdr-copy {
    background: #272727;
    border-color: rgba(0,0,0,0.5);
    color: #666666;
}
[data-theme="dark"] .asin-tbl-copy:hover,
[data-theme="dark"] .asin-hdr-copy:hover {
    color: #cccccc;
}

/* ── Alert tier banners ───────────────────────────────────────────────────── */
[data-theme="dark"] .asin-alert-tier.tier-elite  { background: rgba(52,211,153,0.08);  border-color: rgba(52,211,153,0.2);  }
[data-theme="dark"] .asin-alert-tier.tier-good   { background: rgba(96,165,250,0.08);  border-color: rgba(96,165,250,0.2);  }
[data-theme="dark"] .asin-alert-tier.tier-fair   { background: rgba(251,191,36,0.08);  border-color: rgba(251,191,36,0.2);  }
[data-theme="dark"] .asin-alert-tier.tier-weak   { background: rgba(248,113,113,0.08); border-color: rgba(248,113,113,0.2); }

/* ── Notification dot — always orange (accent indicator) ─────────────────── */
.rail-badge-dot { background: #f97316; }

/* ── Profile / notification dropdown ─────────────────────────────────────── */
[data-theme="dark"] .profile-dropdown {
    background: #1e1e1e;
    border-color: rgba(0,0,0,0.6);
    box-shadow: 0 8px 32px rgba(0,0,0,0.6);
}
[data-theme="dark"] .profile-dropdown-item { color: #909090; }
[data-theme="dark"] .profile-dropdown-item:hover {
    background: #272727;
    color: #ebebeb;
}

/* ── Lists panel ──────────────────────────────────────────────────────────── */
[data-theme="dark"] .list-item { border-color: rgba(0,0,0,0.35); }
[data-theme="dark"] .list-item:hover { background: rgba(255,255,255,0.03); }
[data-theme="dark"] .list-item.active { background: #313131; }
[data-theme="dark"] .list-item-name   { color: #cccccc; }
[data-theme="dark"] .list-item-count  { color: #4a4a4a; }

/* ── Input fields ─────────────────────────────────────────────────────────── */
[data-theme="dark"] input[type="text"],
[data-theme="dark"] input[type="number"],
[data-theme="dark"] input[type="email"],
[data-theme="dark"] input[type="password"],
[data-theme="dark"] select,
[data-theme="dark"] textarea {
    background: #1a1a1a;
    border-color: rgba(0,0,0,0.6);
    color: #e0e0e0;
}
[data-theme="dark"] input::placeholder,
[data-theme="dark"] textarea::placeholder { color: #4a4a4a; }
[data-theme="dark"] input:focus,
[data-theme="dark"] select:focus,
[data-theme="dark"] textarea:focus {
    border-color: rgba(255,255,255,0.18);
    outline: none;
}

/* ── Tags / status pills ──────────────────────────────────────────────────── */
[data-theme="dark"] .intel-badge.green  { background: rgba(52,211,153,0.12);  color: #34d399; }
[data-theme="dark"] .intel-badge.amber  { background: rgba(251,191,36,0.12);  color: #fbbf24; }
[data-theme="dark"] .intel-badge.red    { background: rgba(248,113,113,0.12); color: #f87171; }
[data-theme="dark"] .intel-badge.blue   { background: rgba(96,165,250,0.12);  color: #60a5fa; }
[data-theme="dark"] .intel-badge.violet { background: rgba(167,139,250,0.12); color: #a78bfa; }
[data-theme="dark"] .intel-badge.grey   { background: rgba(255,255,255,0.06); color: #999999; }

/* ── Scrollbar ────────────────────────────────────────────────────────────── */
[data-theme="dark"] ::-webkit-scrollbar { width: 6px; height: 6px; }
[data-theme="dark"] ::-webkit-scrollbar-track { background: transparent; }
[data-theme="dark"] ::-webkit-scrollbar-thumb { background: #333333; border-radius: 3px; }

/* ── List view action buttons (shown in #listViewBar) ─────────────────────── */
.lv-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    font-family: inherit;
    white-space: nowrap;
    border: 1.5px solid transparent;
    line-height: 1;
}

.lv-btn i { font-size: 13px; flex-shrink: 0; }

/* Primary / action — green tint (Add to List) */
.lv-btn-primary {
    background: rgba(16,185,129,0.12);
    color: #059669;
    border-color: rgba(16,185,129,0.25);
}
.lv-btn-primary:hover {
    background: rgba(16,185,129,0.2);
    border-color: rgba(16,185,129,0.4);
    color: #047857;
}

/* Secondary — dark neutral (Edit List) */
.lv-btn-secondary {
    background: var(--bg-secondary);
    color: var(--text-secondary);
    border-color: var(--border-color);
}
.lv-btn-secondary:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

/* Ghost — outline only (Back) */
.lv-btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border-color: var(--border-color);
}
.lv-btn-ghost:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

/* Danger — red tint (Remove from List) */
.lv-btn-danger {
    background: rgba(239,68,68,0.08);
    color: #dc2626;
    border-color: rgba(239,68,68,0.2);
}
.lv-btn-danger:hover {
    background: rgba(239,68,68,0.16);
    border-color: rgba(239,68,68,0.35);
}

/* Count label inside listViewBar */
.lv-count {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    padding: 0 4px;
}

[data-theme="dark"] .lv-btn-primary {
    background: rgba(52,211,153,0.1);
    color: #34d399;
    border-color: rgba(52,211,153,0.2);
}
[data-theme="dark"] .lv-btn-primary:hover {
    background: rgba(52,211,153,0.18);
    border-color: rgba(52,211,153,0.35);
    color: #6ee7b7;
}
[data-theme="dark"] .lv-btn-danger {
    background: rgba(248,113,113,0.08);
    color: #f87171;
    border-color: rgba(248,113,113,0.2);
}
[data-theme="dark"] .lv-btn-danger:hover {
    background: rgba(248,113,113,0.16);
    border-color: rgba(248,113,113,0.35);
}
[data-theme="dark"] ::-webkit-scrollbar-thumb:hover { background: #444444; }

/* ── Checkboxes & radio — neutral in dark mode (orange is data-viz only) ─── */
[data-theme="dark"] input[type="checkbox"],
[data-theme="dark"] input[type="radio"] {
    color-scheme: dark;
    accent-color: #666666;
}

/* ── .form-control dark mode ──────────────────────────────────────────────── */
[data-theme="dark"] .form-control {
    background: #1a1a1a;
    border-color: rgba(0,0,0,0.6);
    color: #e0e0e0;
}
[data-theme="dark"] .form-control:focus {
    border-color: rgba(255,255,255,0.18);
    box-shadow: 0 0 0 3px rgba(255,255,255,0.04);
}
[data-theme="dark"] .form-control::placeholder { color: #4a4a4a; }

/* ── result-panel, table-container, info-panel ────────────────────────────── */
[data-theme="dark"] .result-panel {
    background: var(--bg-card);
    border-color: rgba(255,255,255,0.06);
}
[data-theme="dark"] .table-container {
    background: var(--bg-card);
}
[data-theme="dark"] .info-panel {
    background: var(--bg-card);
    border-color: rgba(255,255,255,0.06);
}

/* ── Inventory controls bar ───────────────────────────────────────────────── */
[data-theme="dark"] .inv-controls-bar {
    background: var(--bg-secondary);
    border-color: rgba(0,0,0,0.45);
}
[data-theme="dark"] .inv-ctrl-label { color: #5c5c5c; }
[data-theme="dark"] .inv-count-label { color: #5c5c5c; }
[data-theme="dark"] .inv-per-page-input {
    background: #1a1a1a;
    border-color: rgba(0,0,0,0.6);
    color: #cccccc;
}

/* ── Inventory action buttons ─────────────────────────────────────────────── */
[data-theme="dark"] .inventory-actions-btn {
    background: #272727;
    border-color: rgba(0,0,0,0.5);
    color: #909090;
}
[data-theme="dark"] .inventory-actions-btn:hover {
    background: #313131;
    color: #cccccc;
}
[data-theme="dark"] .inventory-actions-dropdown {
    background: #1e1e1e;
    border-color: rgba(0,0,0,0.6);
    box-shadow: 0 8px 32px rgba(0,0,0,0.7);
}
[data-theme="dark"] .inventory-action-item:hover {
    background: rgba(255,255,255,0.03);
}
[data-theme="dark"] .inventory-action-label { color: #cccccc; }
[data-theme="dark"] .inventory-action-desc  { color: #5c5c5c; }

/* ── Panel title ──────────────────────────────────────────────────────────── */
[data-theme="dark"] .panel-title { color: #d0d0d0; }

/* ── Bulk checkbox in dark table rows ─────────────────────────────────────── */
[data-theme="dark"] .bulk-select-checkbox {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: #666666;
}

/* ── Favorite star ────────────────────────────────────────────────────────── */
[data-theme="dark"] .favorite-star { color: #444444 !important; }
[data-theme="dark"] .favorite-star.active { color: var(--warning) !important; }

/* ── Score badge — readable in dark table ─────────────────────────────────── */
[data-theme="dark"] .score-badge { color: #d0d0d0; }

/* ── Show more container ──────────────────────────────────────────────────── */
[data-theme="dark"] #showMoreContainer { background: transparent; }

/* ── Inv controls bar input icon ──────────────────────────────────────────── */
[data-theme="dark"] .inv-search-wrap i { color: #555555; }

/* ── Section separator ────────────────────────────────────────────────────── */
[data-theme="dark"] .section-separator {
    background-image: repeating-linear-gradient(
        to right,
        rgba(255,255,255,0.06) 0px,
        rgba(255,255,255,0.06) 4px,
        transparent 4px,
        transparent 12px
    );
}

/* ── lv-btn secondary/ghost explicit dark ─────────────────────────────────── */
[data-theme="dark"] .lv-btn-secondary {
    background: #2e2e2e;
    color: #888888;
    border-color: rgba(255,255,255,0.1);
    box-shadow: none !important;
}
[data-theme="dark"] .lv-btn-secondary:hover {
    background: #383838;
    color: #c8c8c8;
    border-color: rgba(255,255,255,0.14);
}
[data-theme="dark"] .lv-btn-ghost {
    background: transparent;
    color: #5c5c5c;
    border-color: rgba(255,255,255,0.07);
}
[data-theme="dark"] .lv-btn-ghost:hover {
    background: rgba(255,255,255,0.04);
    color: #999999;
    border-color: rgba(255,255,255,0.1);
}
[data-theme="dark"] .lv-count { color: #4a4a4a; }

/* ── Table row hover in dark ──────────────────────────────────────────────── */
[data-theme="dark"] .table-row-clickable:hover td {
    background: rgba(255,255,255,0.025);
}

/* ── Empty state ──────────────────────────────────────────────────────────── */
[data-theme="dark"] .empty-state-title { color: #999999; }
[data-theme="dark"] .empty-state-text  { color: #555555; }
/* ============================================================================
   DARK MODE — Shadow removal + solid visible borders on all cards/panels
   Make.com style: no glow/lift shadows, clean solid dark outlines
   ============================================================================ */

/* Kill ALL box-shadows on cards/panels in dark mode */
[data-theme="dark"] [class*="-card"],
[data-theme="dark"] [class*="-panel"]:not(.sidebar-panel):not(.engine-config-panel),
[data-theme="dark"] .modal-content,
[data-theme="dark"] .unified-filter-panel,
[data-theme="dark"] .data-table-card,
[data-theme="dark"] .runs-table-wrap,
[data-theme="dark"] .lists-panel,
[data-theme="dark"] .asin-metrics-strip,
[data-theme="dark"] .intel-table-card,
[data-theme="dark"] .intel-content-card,
[data-theme="dark"] .intel-kpi-card {
    box-shadow: none !important;
}

/* Dark visible card borders — black outline on lighter card bg */
[data-theme="dark"] [class*="-card"]:not(.period-card),
[data-theme="dark"] [class*="-panel"]:not(.sidebar-panel):not(.engine-config-panel):not(.engine-tab-pane),
[data-theme="dark"] .unified-filter-panel,
[data-theme="dark"] .runs-table-wrap,
[data-theme="dark"] .runs-filter-bar,
[data-theme="dark"] .data-table-card,
[data-theme="dark"] .lists-panel,
[data-theme="dark"] .asin-metrics-strip,
[data-theme="dark"] .intel-table-card,
[data-theme="dark"] .intel-content-card,
[data-theme="dark"] .intel-kpi-card,
[data-theme="dark"] .home-boxem-period-card {
    border-color: rgba(0, 0, 0, 0.70) !important;
    box-shadow: none !important;
}

/* Thicker borders in dark mode — 2px for all cards/panels */
[data-theme="dark"] [class*="-card"]:not(.score-badge-inline),
[data-theme="dark"] [class*="-panel"]:not(.sidebar-panel):not(.engine-config-panel):not(.engine-tab-pane),
[data-theme="dark"] .activity-panel,
[data-theme="dark"] .chart-panel,
[data-theme="dark"] .chart-panel-white,
[data-theme="dark"] .quick-actions-panel,
[data-theme="dark"] .runs-filter-bar,
[data-theme="dark"] .runs-table-wrap {
    border-width: 2px !important;
}

/* Hover states — no shadow lift in dark */
[data-theme="dark"] [class*="-card"]:hover,
[data-theme="dark"] [class*="-panel"]:hover {
    box-shadow: none !important;
}

/* "New" badge — lime green accent (Make.com --colors--03-accent: #aeff6b) */
.badge-new {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    background: rgba(174, 255, 107, 0.15);
    color: #aeff6b;
    border: 1px solid rgba(174, 255, 107, 0.3);
    letter-spacing: 0.02em;
}

/* Run history type icon box — dark mode override */
[data-theme="dark"] .run-type-icon-box {
    background: #2e2e2e !important;
    border-color: #444444 !important;
}
[data-theme="dark"] .run-type-icon-box i {
    color: #a0a0a0 !important;
}

/* ── Run results — new summary bar (replaces score chips) ─────────────────── */
.run-summary-bar {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 16px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.run-summary-donut-wrap {
    flex-shrink: 0;
    width: 100px;
    height: 100px;
    position: relative;
}

.run-summary-stats {
    display: flex;
    flex-direction: column;
    gap: 7px;
    min-width: 160px;
}

.run-stat-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--text-secondary);
}

.run-stat-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.run-summary-kpis {
    display: flex;
    gap: 24px;
    padding-left: 20px;
    border-left: 1px solid var(--border-light);
}

.run-kpi {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.run-kpi-val {
    font-size: 22px;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1;
}

.run-kpi-lbl {
    font-size: 10px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    white-space: nowrap;
}

/* ── Add-to-list modal option rows ──────────────────────────────────────── */
.list-select-option {
    padding: 12px;
    border: 1.5px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.15s;
    background: transparent;
}

.list-select-option:hover {
    border-color: var(--primary);
    background: var(--bg-hover);
}

.list-select-name {
    font-weight: 600;
    font-size: 13px;
    color: var(--text-primary);
}

.list-select-count {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
}

/* Dark mode: make option borders visible (default --border-color is near-black) */
[data-theme="dark"] .list-select-option {
    border-color: rgba(255, 255, 255, 0.12);
    background: var(--bg-secondary);
}
[data-theme="dark"] .list-select-option:hover {
    border-color: var(--primary);
    background: var(--bg-hover);
}

/* ── Blue color neutralization in dark mode ─────────────────────────────── */

/* Status-good badge — remove blue, use teal/neutral in dark mode */
[data-theme="dark"] .status-tier.status-good {
    color: #34d399;
    background: rgba(52, 211, 153, 0.10);
    border-color: rgba(52, 211, 153, 0.20);
}

/* Form focus rings — use dark neutral outline instead of browser blue */
[data-theme="dark"] input:focus,
[data-theme="dark"] textarea:focus,
[data-theme="dark"] select:focus,
[data-theme="dark"] .form-control:focus,
[data-theme="dark"] .filter-input:focus {
    outline: none !important;
    border-color: rgba(255,255,255,0.25) !important;
    box-shadow: none !important;
}

/* Info-type alert/badge icon — neutral in dark mode */
[data-theme="dark"] .type-info .asin-alert-icon {
    color: #a0a0a0;
}

/* Run filter pills — no blue highlight in dark mode */
[data-theme="dark"] .run-filter-pill.active {
    background: #2e2e2e;
    color: #ffffff;
    border-color: rgba(0,0,0,0.70);
}

/* Checkbox / radio accent — orange not blue */
[data-theme="dark"] input[type="checkbox"],
[data-theme="dark"] input[type="radio"] {
    color-scheme: dark;
    accent-color: #f97316;
}

/* ── Preset item edit button + active indicator ────────────────────────── */
.preset-item-edit {
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 4px 8px;
    font-size: 12px;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.14s;
    display: flex;
    align-items: center;
    gap: 4px;
}
.preset-item-edit:hover { background: var(--bg-hover); color: var(--text-primary); }

.preset-item-active { border-color: var(--primary) !important; }
[data-theme="dark"] .preset-item-active { border-color: rgba(249,115,22,0.6) !important; background: rgba(249,115,22,0.05) !important; }

.preset-edit-input {
    width: 100%;
    padding: 5px 8px;
    border: 1.5px solid var(--primary);
    border-radius: 7px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 13px;
    font-family: 'Inter', sans-serif;
    outline: none;
}

/* ============================================================================
   SETTINGS MODAL (smod-*)
   ============================================================================ */

#settingsModal .modal-content { display: none; } /* prevent generic sizing */

.smod-box {
    display: flex;
    width: 1120px;
    max-width: 96vw;
    height: min(900px, 94vh);
    max-height: 94vh;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 32px 80px rgba(0,0,0,0.4);
    position: relative;
}

/* ── Sidebar ── */
.smod-sidebar {
    width: 220px;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
}

.smod-logo {
    height: 60px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 20px;
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-color);
    font-family: 'Inter', sans-serif;
    flex-shrink: 0;
}
.smod-logo i { font-size: 18px; color: var(--text-muted); }

.smod-nav {
    padding: 12px 8px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
}

.smod-nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 9px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 500;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    transition: all 0.14s;
    text-align: left;
    width: 100%;
}
.smod-nav-item:hover:not(.smod-nav-disabled) { background: var(--bg-hover); color: var(--text-secondary); }
.smod-nav-item.active { background: var(--bg-hover); color: var(--text-primary); font-weight: 600; }
.smod-nav-item.smod-nav-disabled { opacity: 0.38; cursor: not-allowed; }
.smod-nav-item i { font-size: 16px; flex-shrink: 0; }

.smod-coming-soon {
    margin-left: auto;
    font-size: 9px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    background: var(--bg-card);
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.smod-nav-sep {
    height: 1px;
    background: var(--border-color);
    margin: 6px 8px;
}

/* ── Content area ── */
.smod-content {
    flex: 1;
    overflow-y: auto;
    padding: 24px 28px 24px;
    position: relative;
    scrollbar-width: thin;
    scrollbar-color: var(--bg-hover) transparent;
}

.smod-close-btn {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 30px;
    height: 30px;
    border-radius: 8px;
    border: none;
    background: var(--bg-secondary);
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    transition: all 0.14s;
}
.smod-close-btn:hover { background: var(--bg-hover); color: var(--text-primary); }

.smod-pane-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 22px;
    font-family: 'DM Sans', sans-serif;
    padding-right: 40px;
}

.smod-section { margin-bottom: 18px; }

.smod-section-label {
    font-size: 10px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin: 0 0 12px;
    font-family: 'Inter', sans-serif;
}

.smod-field-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.smod-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.smod-field label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    font-family: 'Inter', sans-serif;
}

.smod-field input,
.smod-field select {
    padding: 9px 12px;
    border: 1.5px solid var(--border-color);
    border-radius: 9px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 13px;
    font-family: 'Inter', sans-serif;
    outline: none;
    transition: border-color 0.15s;
}
.smod-field input:focus,
.smod-field select:focus { border-color: var(--primary); }

[data-theme="dark"] .smod-field input,
[data-theme="dark"] .smod-field select {
    border-color: rgba(255,255,255,0.1);
}

.smod-footer {
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
    margin-top: 8px;
}

.smod-save-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 20px;
    background: #1c1c1e;
    color: #ffffff;
    border: none;
    border-radius: 9px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    transition: opacity 0.15s;
}
[data-theme="dark"] .smod-save-btn { background: var(--btn-bg); color: var(--btn-color); }
.smod-save-btn:hover { opacity: 0.85; }

/* ── SP-API connection badge ── */
.smod-api-badge {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 4px 12px; border-radius: 20px;
    font-size: 11px; font-weight: 700; margin-bottom: 12px;
}
.smod-api-badge.connected    { background: rgba(16,185,129,0.1); color: #059669; border: 1px solid rgba(16,185,129,0.3); }
.smod-api-badge.disconnected { background: rgba(239,68,68,0.08); color: #dc2626; border: 1px solid rgba(239,68,68,0.2); }
[data-theme="dark"] .smod-api-badge.connected    { background: rgba(16,185,129,0.15); color: #34d399; border-color: rgba(16,185,129,0.25); }
[data-theme="dark"] .smod-api-badge.disconnected { background: rgba(239,68,68,0.12);  color: #f87171; border-color: rgba(239,68,68,0.25); }

/* ── Encrypted credentials notice ── */
.smod-api-notice {
    display: flex; align-items: center; gap: 8px;
    padding: 8px 12px; background: rgba(59,130,246,0.06);
    border: 1px solid rgba(59,130,246,0.15);
    border-radius: 8px; font-size: 11px; color: var(--text-secondary);
    margin-bottom: 14px; line-height: 1.5;
}
.smod-api-notice i { color: #3b82f6; font-size: 14px; flex-shrink: 0; }
[data-theme="dark"] .smod-api-notice { background: rgba(59,130,246,0.08); border-color: rgba(59,130,246,0.15); }

/* ── Status / sync info rows ── */
.smod-info-rows { display: flex; flex-direction: column; gap: 0; margin-bottom: 14px; }
.smod-info-row {
    display: flex; justify-content: space-between; align-items: center;
    padding: 9px 0; border-bottom: 1px solid var(--border-color); font-size: 12px;
}
.smod-info-row:last-child { border-bottom: none; }
.smod-info-label { color: var(--text-muted); font-weight: 500; }
.smod-info-value { color: var(--text-primary); font-weight: 600; }
[data-theme="dark"] .smod-info-row { border-bottom-color: rgba(255,255,255,0.06); }

/* ── OAuth connect description text ── */
.smod-api-desc {
    font-size: 12.5px; color: var(--text-secondary); line-height: 1.55; margin: 10px 0 4px;
}

/* ── Full-width action buttons (credentials save, sync now) ── */
.smod-section-action { margin-top: 14px; display: flex; flex-direction: column; gap: 8px; }
.smod-full-btn {
    display: flex; align-items: center; justify-content: center; gap: 7px;
    width: 100%; padding: 10px 16px;
    background: #1c1c1e; color: #ffffff;
    border: none; border-radius: 9px;
    font-size: 12px; font-weight: 600;
    cursor: pointer; font-family: 'Inter', sans-serif;
    transition: opacity 0.15s;
}
.smod-full-btn:hover { opacity: 0.85; }
.smod-full-btn.secondary {
    background: var(--bg-secondary); color: var(--text-secondary);
    border: 1px solid var(--border-color);
}
.smod-full-btn.secondary:hover { background: var(--bg-hover); color: var(--text-primary); opacity: 1; }
[data-theme="dark"] .smod-full-btn { background: #2e2e2e; border: 1px solid rgba(0,0,0,0.5); color: #cccccc; }
[data-theme="dark"] .smod-full-btn:hover { background: #3a3a3a; opacity: 1; }
[data-theme="dark"] .smod-full-btn.secondary { background: var(--bg-secondary); border-color: rgba(255,255,255,0.08); color: var(--text-secondary); }
[data-theme="dark"] .smod-full-btn.secondary:hover { background: var(--bg-hover); color: var(--text-primary); opacity: 1; }

/* ── Manual token (localhost dev) collapsible section ── */
.smod-manual-token-wrap {
    margin-top: 14px;
    border-top: 1px solid var(--border-color);
    padding-top: 12px;
}
.smod-manual-token-toggle {
    font-size: 11.5px; font-weight: 600; color: var(--text-muted);
    cursor: pointer; list-style: none; display: flex; align-items: center; gap: 5px;
    user-select: none;
}
.smod-manual-token-toggle::-webkit-details-marker { display: none; }
.smod-manual-token-toggle:hover { color: var(--text-secondary); }
.smod-field-hint {
    font-size: 11px; color: var(--text-muted); margin-top: 5px; line-height: 1.45;
}
.smod-input {
    width: 100%; padding: 9px 12px;
    border: 1.5px solid var(--border-color);
    border-radius: 8px; font-size: 12.5px;
    background: var(--bg-secondary); color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    transition: border-color 0.15s;
}
.smod-input:focus { outline: none; border-color: var(--primary); }
.smod-field-label { font-size: 12px; font-weight: 600; color: var(--text-secondary); margin-bottom: 5px; display: block; }

/* ── Notification toggles inside settings modal ── */
.smod-toggle-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.smod-toggle-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 10px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
}

.smod-toggle-icon {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    color: var(--text-secondary);
    flex-shrink: 0;
}

.smod-toggle-info { flex: 1; min-width: 0; }
.smod-toggle-label { font-size: 13px; font-weight: 600; color: var(--text-primary); }
.smod-toggle-desc  { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

/* ── Settings modal dark mode comprehensive overrides ── */
[data-theme="dark"] .smod-box {
    background: var(--bg-card);
    border-color: rgba(255,255,255,0.07);
    box-shadow: 0 32px 80px rgba(0,0,0,0.7);
}
[data-theme="dark"] .smod-sidebar {
    background: var(--bg-secondary);
    border-right-color: rgba(255,255,255,0.06);
}
[data-theme="dark"] .smod-logo {
    border-bottom-color: rgba(255,255,255,0.06);
}
[data-theme="dark"] .smod-nav-sep {
    background: rgba(255,255,255,0.06);
}
[data-theme="dark"] .smod-coming-soon {
    background: var(--bg-hover);
    color: var(--text-muted);
}
[data-theme="dark"] .smod-content {
    background: var(--bg-card);
}
[data-theme="dark"] .smod-footer {
    border-top-color: rgba(255,255,255,0.07);
}
[data-theme="dark"] .smod-section-label {
    border-bottom-color: rgba(255,255,255,0.06);
}
[data-theme="dark"] .smod-toggle-item {
    background: var(--bg-secondary);
    border-color: rgba(255,255,255,0.06);
}
[data-theme="dark"] .smod-toggle-icon {
    background: var(--bg-hover);
    border-color: rgba(255,255,255,0.06);
    color: var(--text-secondary);
}
[data-theme="dark"] .smod-close-btn {
    background: var(--bg-secondary);
    border: 1px solid rgba(255,255,255,0.07);
}

/* ── Settings Modal — Usage Tab (Claude-style) ─────────────────────────── */
.smod-usage-loading {
    padding: 40px 0;
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
}
.smod-usage-error {
    padding: 24px 0;
    text-align: center;
    color: var(--danger);
    font-size: 13px;
}

/* Hero row: plan badge + intro text */
.smod-usage-hero {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 28px;
}
.smod-usage-plan-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 12px;
    border-radius: 20px;
    background: #f97316;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.3px;
    white-space: nowrap;
    flex-shrink: 0;
}
.smod-usage-plan-badge i { font-size: 13px; }
.smod-usage-intro {
    font-size: 13px;
    color: var(--text-secondary);
    margin: 0;
}
.smod-usage-intro strong { color: var(--text-primary); }

/* Each token type block */
.smod-usage-block {
    background: var(--bg-secondary);
    border: 1.5px solid var(--border-color);
    border-radius: 12px;
    padding: 18px 20px;
    margin-bottom: 14px;
}
.smod-usage-row-hdr {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 12px;
}
.smod-usage-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
}
.smod-usage-sublabel {
    font-size: 11px;
    color: var(--text-muted);
}
.smod-usage-nums {
    text-align: right;
    flex-shrink: 0;
}
.smod-usage-used {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
}
.smod-usage-of {
    font-size: 13px;
    color: var(--text-muted);
    margin-left: 3px;
}

/* Progress bar */
.smod-usage-track {
    height: 8px;
    background: var(--bg-hover);
    border-radius: 99px;
    overflow: hidden;
    margin-bottom: 8px;
}
.smod-usage-fill {
    height: 100%;
    background: #f97316;
    border-radius: 99px;
    transition: width 0.5s ease;
    min-width: 0;
}

/* Footer line */
.smod-usage-foot {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: var(--text-muted);
}

/* Add-on tokens section */
.smod-usage-extras {
    margin-top: 6px;
    padding: 14px 16px;
    background: var(--bg-secondary);
    border: 1.5px solid var(--border-color);
    border-radius: 10px;
}
.smod-usage-extra-row {
    font-size: 12px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 0;
}
.smod-usage-extra-row i { color: #10b981; font-size: 14px; }

/* Dark mode overrides */
[data-theme="dark"] .smod-usage-block {
    background: var(--bg-secondary);
    border-color: rgba(255,255,255,0.07);
}
[data-theme="dark"] .smod-usage-track {
    background: rgba(255,255,255,0.08);
}
[data-theme="dark"] .smod-usage-extras {
    background: var(--bg-secondary);
    border-color: rgba(255,255,255,0.07);
}
