/*
 * Model Garden Playground - Styles
 *
 * Structure:
 * - Base styles and reset
 * - Layout components
 * - Form elements
 * - Mode tabs
 * - Batch history panel
 * - Accordion components
 * - Score badges and status icons
 * - Histograms and highlights (with legend)
 * - Recommendation tables
 * - User features and history
 * - Loading states
 * - Explanation panel
 * - Placeholder/empty states
 * - Responsive adjustments
 */

/* ==================== App Header ==================== */
.app-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    height: 48px;
    background: #fff;
    border-bottom: 1px solid #e0e0e0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    margin: 0 -20px 16px -20px;
}

.app-header-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: #1a73e8;
    font-weight: 600;
    font-size: 15px;
}

.app-header-logo svg {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
}

.app-header-logo:hover {
    color: #174ea6;
}

.app-header-nav {
    display: flex;
    align-items: center;
    gap: 16px;
}

.app-header-link {
    text-decoration: none;
    color: #555;
    font-size: 13px;
    font-weight: 500;
    padding: 6px 12px;
    border-radius: 4px;
    transition: background 0.15s, color 0.15s;
}

.app-header-link:hover {
    background: #f0f4ff;
    color: #1a73e8;
}

.app-header-link.active {
    color: #1a73e8;
    background: #e8f0fe;
}

.app-header-user {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: 8px;
    padding-left: 16px;
    border-left: 1px solid #e0e0e0;
}

.app-header-avatar {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    flex-shrink: 0;
}

.app-header-user-name {
    font-size: 12px;
    color: #666;
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.app-header-logout {
    font-size: 12px !important;
    color: #999 !important;
    padding: 4px 8px !important;
}

.app-header-logout:hover {
    color: #dc3545 !important;
    background: #fef2f2 !important;
}

/* ==================== Base Styles ==================== */
* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 20px;
    padding-top: 0;
    font-family: Arial, sans-serif;
    background-color: #f5f5f5;
}

/* ==================== Layout ==================== */
.container {
    width: 100%;
    max-width: 100%;
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.two-column {
    display: flex;
    gap: 20px;
}

.column {
    flex: 1;
}

.column.events-column {
    max-height: 900px;
    overflow-y: auto;
}

.column h4 {
    margin-top: 0;
    color: #333;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}

/* ==================== Form Section ==================== */
.form-section {
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid #eee;
}

.form-row {
    display: flex;
    gap: 12px;
    align-items: end;
    flex-wrap: wrap;
}

.form-group {
    flex: 1;
    min-width: 160px;
}

.label-hint {
    font-weight: normal;
    color: #999;
    font-size: 12px;
}

label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    font-size: 13px;
}

input[type="text"],
select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

input[type="text"]:disabled,
select:disabled {
    background-color: #f0f0f0;
    cursor: not-allowed;
}

.btn {
    padding: 8px 20px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    white-space: nowrap;
}

.btn:hover:not(:disabled) {
    background-color: #0056b3;
}

.btn:disabled {
    background-color: #6c757d;
    cursor: not-allowed;
}

/* ==================== Error Display ==================== */
.error {
    background-color: #f8d7da;
    color: #721c24;
    padding: 12px;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
    margin: 20px 0;
    word-break: break-word;
}

/* ==================== Header Section ==================== */
.header-section {
    margin: 16px 0;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 4px;
}

.header-section h2 {
    margin: 0 0 10px 0;
    color: #333;
}

.header-meta {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    font-size: 14px;
    color: #555;
    margin-top: 6px;
}

.header-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* ==================== Mode Tabs ==================== */
.mode-toolbar {
    margin: 16px 0 0 0;
    border-bottom: 2px solid #dee2e6;
}

.mode-tabs {
    display: flex;
    gap: 0;
}

.mode-tab {
    padding: 10px 24px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: #6c757d;
    border-bottom: 3px solid transparent;
    transition: color 0.2s, border-color 0.2s;
    margin-bottom: -2px;
}

.mode-tab:hover {
    color: #333;
}

.mode-tab.active {
    color: #007bff;
    border-bottom-color: #007bff;
}

.mode-content {
    display: none;
}

.mode-content.active {
    display: block;
}

/* ==================== Batch History Panel ==================== */
.batch-panel {
    margin: 16px 0;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    overflow: hidden;
}

.batch-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 16px;
    background: #f8f9fa;
    cursor: pointer;
    user-select: none;
    border-bottom: 1px solid #dee2e6;
}

.batch-panel-title {
    font-weight: 600;
    font-size: 14px;
    color: #333;
}

.batch-panel-body {
    max-height: 350px;
    overflow-y: auto;
}

/* ==================== Accordion ==================== */
.accordion {
    margin-top: 16px;
}

.accordion-item {
    border: 1px solid #ddd;
    margin-bottom: 5px;
    border-radius: 4px;
}

.accordion-header {
    background-color: #f1f1f1;
    padding: 12px 15px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    user-select: none;
}

.accordion-header:hover {
    background-color: #e9ecef;
}

.accordion-header.active {
    background-color: #007bff;
    color: white;
}

.accordion-content {
    display: none;
    padding: 16px;
    background-color: white;
}

.accordion-content.active {
    display: block;
}

.accordion-header-left {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    min-width: 0;
}

.accordion-header-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.header-timestamp {
    font-size: 12px;
    color: #666;
    font-weight: normal;
}

.accordion-header.active .header-timestamp {
    color: rgba(255, 255, 255, 0.8);
}

.meta-tag {
    font-size: 11px;
    background: #e9ecef;
    color: #495057;
    padding: 2px 6px;
    border-radius: 10px;
    font-weight: normal;
    white-space: nowrap;
}

.accordion-header.active .meta-tag {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

/* ==================== Score Badges ==================== */
.score-badge {
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: bold;
    margin-left: 10px;
    white-space: nowrap;
}

.score-badge.high {
    background-color: #28a745;
}

.score-badge.medium {
    background-color: #ffc107;
    color: #212529;
}

.score-badge.low {
    background-color: #dc3545;
}

.score-badge-sm {
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 8px;
    margin: 0;
    display: inline-block;
}

.accordion-header.active .score-badge {
    opacity: 0.85;
}

/* ==================== Status Icons ==================== */
.status-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    font-weight: bold;
    font-size: 14px;
    margin-right: 8px;
    flex-shrink: 0;
}

.status-icon.success {
    background-color: #28a745;
    color: white;
}

.status-icon.failure {
    background-color: #dc3545;
    color: white;
}

.status-icon.pending {
    background-color: #ffc107;
    color: white;
}

.status-icon.untracked {
    background-color: #dee2e6;
    color: #6c757d;
    font-size: 10px;
}

/* ==================== Reason Tags ==================== */
.reason-tag {
    display: inline-block;
    font-size: 11px;
    padding: 2px 7px;
    border-radius: 10px;
    font-weight: 500;
    white-space: nowrap;
    border: 1px solid transparent;
}

.reason-tag.reason-exploit-svd-ctr,
.reason-tag.reason-exploit {
    background: #d4edda;
    color: #155724;
    border-color: #c3e6cb;
}

.reason-tag.reason-explore-candidates,
.reason-tag.reason-explore {
    background: #cce5ff;
    color: #004085;
    border-color: #b8daff;
}

.reason-tag-sm {
    font-size: 10px;
    padding: 1px 5px;
}

.accordion-header.active .reason-tag {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border-color: rgba(255, 255, 255, 0.3);
}

/* ==================== Row Type Badges ==================== */
.row-type-badge {
    font-size: 11px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 10px;
    letter-spacing: 0.3px;
    background: #007bff;
    color: white;
}

.row-type-badge-sm {
    font-size: 9px;
    padding: 2px 6px;
    font-weight: 600;
}

.accordion-header.active .row-type-badge-sm {
    opacity: 0.85;
}

.row-type-best-sellers,
.row-type-trending,
.row-type-sale-velocity,
.row-type-new-arrivals {
    background: #6c757d;
}

.row-type-because-you-viewed,
.row-type-because-you-bought,
.row-type-top-category,
.row-type-purchased-items,
.row-type-cross-sell,
.row-type-upsell,
.row-type-compare {
    background: #28a745;
}

.row-type-abandoned-browse,
.row-type-abandoned-cart,
.row-type-back-in-stock,
.row-type-low-stock,
.row-type-price-drop {
    background: #fd7e14;
}

.row-utility-badge {
    font-size: 11px;
    color: #6c757d;
    background: white;
    border: 1px solid #dee2e6;
    padding: 2px 6px;
    border-radius: 8px;
}

.row-item-count {
    font-size: 11px;
    color: #999;
    margin-left: auto;
}

/* ==================== Results Header ==================== */
.results-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* ==================== Highlights Section ==================== */
.highlights-section {
    margin: 16px 0;
    padding: 20px;
    background-color: #f8f9fa;
    border-radius: 4px;
    border: 1px solid #dee2e6;
}

.highlights-section h3 {
    margin: 0 0 16px 0;
    color: #333;
    font-size: 16px;
}

.highlights-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
}

.histogram-container {
    background: white;
    padding: 15px;
    border-radius: 4px;
    border: 1px solid #dee2e6;
    overflow: hidden;
}

.histogram-title {
    font-weight: bold;
    margin-bottom: 10px;
    color: #333;
    text-align: center;
    font-size: 13px;
}

.histogram {
    height: 120px;
    display: flex;
    align-items: flex-end;
    gap: 3px;
    padding: 10px 5px 0 5px;
    margin-bottom: 8px;
    overflow: visible;
    position: relative;
}

.histogram-bar {
    flex: 1;
    background-color: #007bff;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
    cursor: pointer;
    transition: filter 0.2s;
    border-radius: 2px 2px 0 0;
    margin: 0 1px;
    min-width: 20px;
    min-height: 4px;
}

.histogram-bar:hover {
    filter: brightness(0.85);
}

.histogram-bar-count {
    position: absolute;
    top: -16px;
    font-size: 9px;
    color: #333;
    font-weight: bold;
    white-space: nowrap;
}

.histogram-bar-label {
    display: none; /* Hidden; replaced by inline legends below each chart */
}

.histogram-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100px;
    color: #666;
    font-style: italic;
}

/* ==================== Chart Inline Legend ==================== */
.chart-legend {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px 8px 8px 8px;
    border-top: 1px solid #eee;
    margin-top: 8px;
}

.chart-legend-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    line-height: 1;
}

svg.chart-legend-swatch {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.chart-legend-label {
    color: #333;
    white-space: nowrap;
}

/* ==================== Recommendation Tables ==================== */
.rec-table-wrap {
    overflow-x: auto;
    margin: 8px 0;
    border: 1px solid #dee2e6;
    border-radius: 4px;
}

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

.rec-table thead th {
    background: #f8f9fa;
    padding: 8px 10px;
    text-align: left;
    font-weight: 600;
    font-size: 12px;
    color: #555;
    border-bottom: 2px solid #dee2e6;
    white-space: nowrap;
    position: sticky;
    top: 0;
    z-index: 1;
}

.rec-table tbody td {
    padding: 6px 10px;
    border-bottom: 1px solid #f0f0f0;
    vertical-align: middle;
}

.rec-table tbody tr:hover td {
    background: #f8f9ff;
}

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

/* Column widths */
.rec-table .col-pos {
    width: 40px;
    text-align: center;
    font-weight: 600;
    color: #555;
    font-size: 12px;
}

.rec-table .col-img {
    width: 60px;
    text-align: center;
    padding: 4px 6px;
}

.rec-table .col-title {
    min-width: 140px;
}

.rec-table .col-cat {
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #6c757d;
    font-size: 12px;
}

.rec-table .col-price {
    white-space: nowrap;
    font-weight: 500;
    color: #28a745;
    font-size: 12px;
}

.rec-table .col-score {
    white-space: nowrap;
    text-align: center;
}

.rec-table .col-reason {
    white-space: nowrap;
}

/* Thumbnail images in tables */
.rec-thumb {
    width: 50px;
    height: 50px;
    object-fit: contain;
    border-radius: 4px;
    border: 1px solid #eee;
    background: #f8f9fa;
    display: block;
    opacity: 0;
    transition: opacity 0.3s;
}

.rec-thumb.loaded {
    opacity: 1;
}

.rec-thumb-placeholder {
    width: 50px;
    height: 50px;
    background: #f0f0f0;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: #ccc;
}

.rec-title-link {
    color: #333;
    text-decoration: none;
    font-weight: 500;
    font-size: 12px;
    line-height: 1.3;
}

.rec-title-link:hover {
    color: #007bff;
    text-decoration: underline;
}

.rec-variant-id {
    font-size: 10px;
    color: #aaa;
    margin-top: 2px;
    font-family: monospace;
}

/* ==================== Discover Rows ==================== */
.discover-row {
    margin-bottom: 16px;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    overflow: hidden;
}

.discover-row .rec-table-wrap {
    border: none;
    border-radius: 0;
    margin: 0;
}

.discover-row-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
    flex-wrap: wrap;
}

/* ==================== Exposure View ==================== */
.exposure-section {
    padding: 0;
}


.source-badge {
    display: inline-block;
    font-size: 10px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.source-badge.source-realtime {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.source-badge.source-batch {
    background: #e2e3e5;
    color: #383d41;
    border: 1px solid #d6d8db;
}

.message-id-badge {
    font-family: monospace;
    font-size: 11px;
    color: #666;
    cursor: default;
}

.accordion-header.active .message-id-badge {
    color: rgba(255, 255, 255, 0.85);
}

.accordion-header.active .source-badge {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border-color: rgba(255, 255, 255, 0.3);
}



/* ==================== User List (User View default) ==================== */

.user-list-table td {
    cursor: default;
}

.user-list-table .user-id-cell {
    font-weight: 600;
    font-family: monospace;
    font-size: 12px;
}

.btn-sm {
    font-size: 11px;
    padding: 4px 10px;
    border-radius: 4px;
    background: #007bff;
    color: white;
    border: none;
    cursor: pointer;
    white-space: nowrap;
}

.btn-sm:hover {
    background: #0069d9;
}

.btn-outline-sm {
    font-size: 11px;
    padding: 4px 10px;
    border-radius: 4px;
    background: white;
    color: #007bff;
    border: 1px solid #007bff;
    cursor: pointer;
    white-space: nowrap;
}

.btn-outline-sm:hover {
    background: #e8f0fe;
}

.back-to-list-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    padding: 8px 0;
    border-bottom: 1px solid #eee;
}

.back-to-list-bar .back-link {
    font-size: 13px;
    color: #007bff;
    cursor: pointer;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 4px;
}

.back-to-list-bar .back-link:hover {
    text-decoration: underline;
}

/* ==================== Recs Column ==================== */
.column.recs-column {
    flex: 2;
    min-width: 0;
    overflow: hidden;
}

/* ==================== Exposure Info ==================== */
.exposure-info {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    background: #d4edda;
    border: 1px solid #c3e6cb;
    border-radius: 4px;
    margin-bottom: 12px;
    font-size: 12px;
    flex-wrap: wrap;
}

.exposure-label {
    font-weight: 700;
    color: #155724;
}

.exposure-detail {
    color: #155724;
    font-family: monospace;
    font-size: 11px;
}

/* ==================== Send Event Info ==================== */
.send-info {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    background: #cce5ff;
    border: 1px solid #b8daff;
    border-radius: 4px;
    margin-bottom: 12px;
    font-size: 12px;
    flex-wrap: wrap;
}

.send-info.send-info-none {
    background: #f8f9fa;
    border-color: #dee2e6;
}

.send-label {
    font-weight: 700;
    color: #004085;
}

.send-info-none .send-label,
.send-info-none .send-detail {
    color: #6c757d;
}

.send-detail {
    color: #004085;
    font-family: monospace;
    font-size: 11px;
}

/* ==================== Order Event Info ==================== */

.order-info {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    border-radius: 4px;
    margin-bottom: 12px;
    font-size: 12px;
    flex-wrap: wrap;
}

.order-info-converted {
    background: #d4edda;
    border: 1px solid #c3e6cb;
}

.order-info-none {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
}

.order-label {
    font-weight: 700;
}

.order-info-converted .order-label,
.order-info-converted .order-detail {
    color: #155724;
}

.order-info-none .order-label,
.order-info-none .order-detail {
    color: #6c757d;
}

.order-detail {
    font-family: monospace;
    font-size: 11px;
}

.order-amount {
    font-weight: 700;
}

.order-subheader {
    font-size: 12px;
    font-weight: 600;
    color: #155724;
    padding: 6px 0 4px;
    border-bottom: 1px solid #c3e6cb;
    margin-bottom: 8px;
}

.send-detail.send-warning {
    color: #721c24;
}

/* ==================== Pipeline Diff ==================== */
.pipeline-diff-details {
    margin-bottom: 8px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    background: #fafafa;
}

.pipeline-diff-summary {
    list-style: none;
    cursor: pointer;
    padding: 6px 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    user-select: none;
}

.pipeline-diff-summary::-webkit-details-marker {
    display: none;
}

.pipeline-diff-title {
    font-weight: 600;
    color: #333;
    margin-right: 4px;
}

.diff-stat {
    padding: 1px 7px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 600;
    font-family: monospace;
}

.diff-kept { background: #d4edda; color: #155724; }
.diff-dropped { background: #f8d7da; color: #721c24; }
.diff-added { background: #cce5ff; color: #004085; }

.diff-pct {
    margin-left: auto;
    font-size: 11px;
    color: #666;
    font-family: monospace;
}

.pipeline-diff-body {
    padding: 8px 12px;
    border-top: 1px solid #e0e0e0;
}

.diff-section {
    margin-bottom: 8px;
}

.diff-section-label {
    font-size: 11px;
    font-weight: 600;
    padding: 2px 0;
    margin-bottom: 4px;
}

.diff-dropped-label { color: #721c24; }
.diff-added-label { color: #004085; }
.diff-kept-label { color: #155724; }

.diff-section-inner {
    margin-bottom: 8px;
}

.diff-item-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.diff-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    border: 1px solid;
    max-width: 280px;
}

.diff-item-dropped { background: #fff5f5; border-color: #f5c6cb; }
.diff-item-added { background: #f0f7ff; border-color: #b8daff; }
.diff-item-kept { background: #f0fff4; border-color: #c3e6cb; }

.diff-thumb {
    width: 28px;
    height: 28px;
    object-fit: contain;
    border-radius: 3px;
    flex-shrink: 0;
}

.diff-item-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.diff-item-title {
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.diff-item-id {
    color: #888;
    font-family: monospace;
    font-size: 10px;
}

.diff-item-score {
    color: #666;
    font-family: monospace;
    font-size: 10px;
}

.diff-source-tag {
    font-size: 9px;
    padding: 0 4px;
    border-radius: 2px;
    font-weight: 600;
    text-transform: uppercase;
}

.diff-source-cart { background: #fff3cd; color: #856404; }
.diff-source-ml { background: #d4edda; color: #155724; }
.diff-source-other { background: #e2e3e5; color: #383d41; }

.diff-hint {
    font-size: 9px;
    padding: 1px 5px;
    border-radius: 2px;
    font-weight: 600;
    white-space: nowrap;
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: inline-block;
    vertical-align: middle;
}

.diff-hint-unavailable { background: #f8d7da; color: #721c24; }
.diff-hint-not_in_catalog { background: #f8d7da; color: #721c24; }
.diff-hint-recently_sent { background: #fff3cd; color: #856404; font-weight: 500; }
.diff-hint-site_excluded_product { background: #d6d8db; color: #383d41; }
.diff-hint-site_excluded_brand { background: #d6d8db; color: #383d41; }
.diff-hint-site_excluded_category { background: #d6d8db; color: #383d41; }
.diff-hint-unknown { background: #e2e3e5; color: #383d41; }

.recently-sent-label { color: #856404; }
.recently-sent-item {
    background: #fffdf5;
    border: 1px solid #f0e6c8;
    border-radius: 4px;
    padding: 4px 8px;
}

.diff-hint-note {
    display: block;
    font-size: 10px;
    font-weight: 400;
    color: #856404;
    margin-top: 2px;
}

/* ==================== Candidate Pool Stats ==================== */
.candidate-stats {
    margin-top: 12px;
    padding: 8px 12px;
    background: #f8f9fa;
    border-radius: 4px;
    border: 1px solid #e9ecef;
    font-size: 11px;
}

.candidate-stats-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 16px;
    align-items: center;
}

.candidate-stat {
    font-family: monospace;
    color: #555;
}

.candidate-stat strong {
    color: #333;
}

.candidate-score-dist {
    display: flex;
    gap: 3px;
    align-items: flex-end;
    height: 90px;
    width: 100%;
    max-width: 420px;
    border-bottom: 1px solid #dee2e6;
    padding-top: 18px;
}

.candidate-score-bar {
    flex: 1;
    background: #007bff;
    border-radius: 2px 2px 0 0;
    min-width: 12px;
    opacity: 0.8;
    transition: opacity 0.15s;
}

.candidate-score-bar:hover {
    opacity: 1;
}

/* ==================== Config Badges ==================== */
.config-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 8px;
}

.config-badge {
    font-size: 10px;
    font-family: monospace;
    padding: 2px 6px;
    border-radius: 3px;
    background: #e9ecef;
    color: #495057;
}

.config-badge strong {
    color: #212529;
}

/* ==================== Send Source Labels ==================== */
.send-source-badge {
    font-size: 9px;
    padding: 1px 5px;
    border-radius: 2px;
    font-weight: 600;
    text-transform: uppercase;
    margin-left: 6px;
    vertical-align: middle;
}

.send-source-cart { background: #fff3cd; color: #856404; }
.send-source-ml { background: #d4edda; color: #155724; }
.send-source-programmatic { background: #e2e3e5; color: #383d41; }

/* ==================== Collapsible Event Sections ==================== */
.event-section-details {
    margin-bottom: 8px;
    border-radius: 4px;
    overflow: hidden;
}

.event-section-details > summary {
    list-style: none;
    cursor: pointer;
    user-select: none;
}

.event-section-details > summary::-webkit-details-marker {
    display: none;
}

.event-section-details > summary > .exposure-info,
.event-section-details > summary > .send-info {
    position: relative;
    padding-right: 28px;
}

.event-section-details > summary > .exposure-info::after,
.event-section-details > summary > .send-info::after {
    content: '\25B6';
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 9px;
    color: #888;
    transition: transform 0.15s ease;
}

.event-section-details[open] > summary > .exposure-info::after,
.event-section-details[open] > summary > .send-info::after {
    transform: translateY(-50%) rotate(90deg);
}

.event-section-details > summary > .exposure-info:hover,
.event-section-details > summary > .send-info:hover {
    filter: brightness(0.97);
}

.event-section-body {
    padding: 12px 0;
}

/* ==================== Send Content (inside collapsible) ==================== */
.send-meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 16px;
    margin-bottom: 12px;
    font-size: 11px;
    color: #555;
}

.send-meta-tag {
    background: #e2efff;
    padding: 2px 8px;
    border-radius: 3px;
    font-family: monospace;
}

.send-section-header {
    font-size: 13px;
    font-weight: 600;
    color: #333;
    margin: 12px 0 6px 0;
    padding-bottom: 4px;
    border-bottom: 1px solid #dee2e6;
}

.send-section-header:first-child {
    margin-top: 0;
}

/* ==================== Outcome Badges (accordion header) ==================== */
.outcome-badge {
    display: inline-block;
    font-size: 10px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 3px;
    letter-spacing: 0.3px;
}

.outcome-clicked {
    background: #e8d5f5;
    color: #6f42c1;
    border: 1px solid #d4b5e9;
}

.outcome-opened {
    background: #cce5ff;
    color: #004085;
    border: 1px solid #b8daff;
}

.outcome-delivered {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.outcome-sent {
    background: #e2e3e5;
    color: #383d41;
    border: 1px solid #d6d8db;
}

.outcome-bounced {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.accordion-header.active .outcome-badge {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border-color: rgba(255, 255, 255, 0.3);
}

/* ==================== Event Permalink (accordion rows) ==================== */
.event-permalink {
    display: inline-flex;
    align-items: center;
    font-size: 14px;
    color: #999;
    text-decoration: none;
    padding: 2px 4px;
    border-radius: 3px;
    opacity: 0.5;
    transition: opacity 0.15s, color 0.15s;
}

.event-permalink:hover {
    opacity: 1;
    color: #007bff;
}

.accordion-header.active .event-permalink {
    color: rgba(255, 255, 255, 0.6);
}

.accordion-header.active .event-permalink:hover {
    color: white;
}

/* ==================== Standalone Event Detail Page ==================== */
.standalone-event-page {
    max-width: 1400px;
    margin: 0 auto;
}

.standalone-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 0;
    margin-bottom: 16px;
    border-bottom: 1px solid #dee2e6;
    flex-wrap: wrap;
}

.standalone-header h2 {
    margin: 0;
    font-size: 20px;
    color: #333;
}

.standalone-back-link {
    font-size: 13px;
    color: #007bff;
    text-decoration: none;
    padding: 4px 10px;
    border-radius: 4px;
    border: 1px solid #dee2e6;
    background: #f8f9fa;
    white-space: nowrap;
}

.standalone-back-link:hover {
    background: #e2e6ea;
    text-decoration: none;
}

.message-id-full {
    font-family: monospace;
    font-size: 13px;
    color: #495057;
    background: #f8f9fa;
    padding: 4px 10px;
    border-radius: 4px;
    border: 1px solid #dee2e6;
}

.standalone-site-badge {
    font-size: 12px;
    font-weight: 600;
    color: #666;
    background: #e9ecef;
    padding: 4px 10px;
    border-radius: 4px;
}

/* ==================== User Features Panel ==================== */
.user-features-list {
    border: 1px solid #dee2e6;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 12px;
    font-size: 13px;
}

.user-feature-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 10px;
    border-bottom: 1px solid #f0f0f0;
}

.user-feature-row:last-child {
    border-bottom: none;
}

.user-feature-row:nth-child(odd) {
    background: #fafafa;
}

.user-feature-label {
    color: #555;
    font-weight: 500;
    flex: 1;
}

.user-feature-value {
    color: #333;
    font-weight: bold;
    text-align: right;
    min-width: 60px;
}

/* ==================== History List ==================== */
.history-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 12px;
}

.history-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    background: #f8f9fa;
    border-radius: 4px;
    border: 1px solid #eee;
}

.history-img {
    width: 36px;
    height: 36px;
    object-fit: cover;
    border-radius: 3px;
    flex-shrink: 0;
    border: 1px solid #ddd;
}

.history-img-placeholder {
    width: 36px;
    height: 36px;
    background: #e9ecef;
    border-radius: 3px;
    flex-shrink: 0;
}

.history-item-info {
    flex: 1;
    min-width: 0;
}

.history-item-title {
    font-size: 12px;
    font-weight: 500;
    color: #333;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.history-item-meta {
    font-size: 11px;
    color: #888;
    margin-top: 2px;
}

.no-data-note {
    font-size: 12px;
    color: #999;
    font-style: italic;
    margin: 4px 0 12px;
}

.pit-note {
    font-size: 10px;
    color: #856404;
    background: #fff8e1;
    padding: 2px 6px;
    border-radius: 3px;
    margin: -2px 0 6px;
    display: inline-block;
}

/* ==================== Tooltips ==================== */
.tooltip {
    position: relative;
    display: inline-block;
    cursor: help;
    color: #007bff;
}

.tooltip .tooltiptext {
    visibility: hidden;
    width: 300px;
    background-color: #333;
    color: #fff;
    text-align: left;
    border-radius: 6px;
    padding: 10px;
    position: absolute;
    z-index: 1;
    bottom: 125%;
    left: 50%;
    margin-left: -150px;
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 12px;
    white-space: pre-wrap;
}

.tooltip:hover .tooltiptext {
    visibility: visible;
    opacity: 1;
}

.events-column .tooltip .tooltiptext {
    left: 0;
    margin-left: 0;
    right: auto;
}

/* ==================== Loading States ==================== */
.loading {
    text-align: center;
    padding: 20px;
    color: #666;
}

.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #007bff;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.modal-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 200px;
    color: #666;
}

.modal-loading .spinner {
    margin-bottom: 20px;
}

/* ==================== Explanation Panel ==================== */
.explain-btn {
    background-color: #007bff;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    margin-left: 10px;
}

.explain-btn:hover {
    background-color: #0056b3;
}

.explanation-container {
    margin-bottom: 20px;
    padding: 20px;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    background-color: #f8f9fa;
}

.explanation-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    border-bottom: 1px solid #ddd;
    padding-bottom: 10px;
}

.explanation-header h5 {
    margin: 0;
    color: #333;
}

.explanation-content {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.explanation-section {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.explanation-section label {
    font-weight: bold;
    margin-bottom: 10px;
    color: #333;
}

.explanation-section textarea {
    flex: 1;
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: monospace;
    font-size: 12px;
    resize: vertical;
    background-color: #f9f9f9;
    line-height: 1.4;
    min-height: 150px;
}

/* ==================== Pagination ==================== */
.pagination {
    padding: 16px;
    text-align: center;
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    margin-top: 10px;
}

/* ==================== Batch History Table ==================== */
.batch-history-section {
    padding: 20px 0;
}

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

.batch-table th,
.batch-table td {
    padding: 8px 14px;
    text-align: left;
    border-bottom: 1px solid #dee2e6;
}

.batch-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #333;
    position: sticky;
    top: 0;
    font-size: 12px;
}

.batch-table tr:hover td {
    background: #f0f7ff;
}

.batch-table .batch-view-btn {
    padding: 4px 14px;
    font-size: 12px;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.batch-table .batch-view-btn:hover {
    background: #0056b3;
}

.batch-table .batch-current {
    background: #d4edda;
}

/* ==================== User Lookup ==================== */
.user-lookup-section {
    padding: 20px 0;
}

.user-lookup-form {
    display: flex;
    gap: 12px;
    align-items: end;
    flex-wrap: wrap;
    padding: 16px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    margin-bottom: 20px;
}

.user-lookup-form .form-group {
    flex: unset;
    min-width: 160px;
}

.user-lookup-form .form-group:first-child {
    flex: 1;
    min-width: 220px;
}

.user-lookup-info {
    padding: 12px 16px;
    background: #e9ecef;
    border-radius: 6px;
    margin-bottom: 16px;
    font-size: 13px;
    color: #495057;
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.user-lookup-info strong {
    color: #333;
}

/* ==================== User Lookup Results ==================== */
.user-results-container {
    border: 1px solid #dee2e6;
    border-radius: 6px;
    overflow: hidden;
}

.user-results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
}

.user-results-header h3 {
    margin: 0;
    font-size: 16px;
    color: #333;
}

.user-results-body {
    display: flex;
    gap: 0;
}

.user-results-left {
    width: 340px;
    min-width: 300px;
    max-height: 800px;
    overflow-y: auto;
    padding: 16px;
    border-right: 1px solid #dee2e6;
    background: #fafafa;
}

.user-results-right {
    flex: 1;
    min-width: 0;
    max-height: 800px;
    overflow-y: auto;
    padding: 16px;
}

.user-results-left h4,
.user-results-right h4 {
    margin: 0 0 10px 0;
    color: #333;
    font-size: 14px;
    border-bottom: 1px solid #eee;
    padding-bottom: 8px;
}

.user-results-left h4:not(:first-child),
.user-results-right h4:not(:first-child) {
    margin-top: 18px;
}

/* ==================== Placeholder/Empty State ==================== */
.no-data-placeholder {
    text-align: center;
    padding: 60px 40px;
    color: #666;
}

.no-data-placeholder .placeholder-icon {
    font-size: 64px;
    margin-bottom: 20px;
}

.no-data-placeholder h2 {
    color: #333;
    margin-bottom: 10px;
}

.no-data-placeholder p {
    max-width: 600px;
    margin: 0 auto 20px;
    line-height: 1.6;
}

.no-data-placeholder .placeholder-hint {
    color: #888;
    font-size: 14px;
}

.placeholder-features {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin: 40px 0;
    flex-wrap: wrap;
}

.feature-card {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 20px;
    width: 220px;
    text-align: left;
}

.feature-card h4 {
    color: #007bff;
    margin: 0 0 10px 0;
}

.feature-card p {
    margin: 0;
    font-size: 13px;
    color: #666;
}

/* ==================== Item Detail Page ==================== */
.item-error-box {
    background: #fff3cd;
    border: 1px solid #ffc107;
    color: #856404;
    padding: 14px 18px;
    border-radius: 6px;
    font-size: 14px;
}

.item-product-header {
    display: flex;
    gap: 24px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.item-product-image {
    flex: 0 0 180px;
    height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    overflow: hidden;
    background: white;
    border: 1px solid #dee2e6;
}

.item-product-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.item-img-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #aaa;
    font-size: 14px;
    background: #f0f0f0;
}

.item-product-info {
    flex: 1;
    min-width: 0;
}

.item-title {
    margin: 0 0 14px;
    font-size: 20px;
    color: #333;
}

.item-title a {
    color: #007bff;
    text-decoration: none;
}

.item-title a:hover {
    text-decoration: underline;
}

.item-meta-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 6px 24px;
}

.item-meta-row {
    display: flex;
    gap: 8px;
    font-size: 13px;
    padding: 3px 0;
}

.item-meta-label {
    color: #888;
    flex: 0 0 auto;
    white-space: nowrap;
}

.item-meta-label::after {
    content: ':';
}

.item-meta-value {
    color: #333;
    font-weight: 500;
}

.item-features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
}

.item-feature-card {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    overflow: hidden;
}

.item-fc-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
    font-weight: 600;
    font-size: 14px;
    color: #333;
}

.item-fc-icon {
    font-size: 18px;
}

.item-fc-title {
    flex: 1;
}

.item-fc-body {
    padding: 12px 16px;
}

.item-fc-row {
    display: flex;
    justify-content: space-between;
    padding: 5px 0;
    font-size: 13px;
    border-bottom: 1px solid #f5f5f5;
}

.item-fc-row:last-child {
    border-bottom: none;
}

.item-fc-label {
    color: #666;
}

.item-fc-value {
    font-weight: 600;
    color: #333;
}

.item-velocity-badge {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 600;
}

.item-velocity-badge.trending {
    background: #d4edda;
    color: #155724;
}

.item-velocity-badge.steady {
    background: #d1ecf1;
    color: #0c5460;
}

.item-velocity-badge.declining {
    background: #f8d7da;
    color: #721c24;
}

/* Variant ID link in recommendation tables */
.rec-variant-id a {
    color: #007bff;
    text-decoration: none;
    font-size: 11px;
}

.rec-variant-id a:hover {
    text-decoration: underline;
}

/* ==================== Inline Item Feature Expansion ==================== */
.item-expandable-row {
    cursor: pointer;
    transition: background-color 0.15s;
}

.item-expandable-row:hover {
    background-color: #f0f7ff !important;
}

.item-expandable-row.item-row-expanded {
    background-color: #e8f0fe !important;
}

.item-detail-row {
    background: #fafbfc;
}

.item-detail-row > td {
    padding: 0 !important;
    border-top: none !important;
}

.item-inline-body {
    padding: 16px 20px;
    border-top: 2px solid #007bff;
    border-bottom: 1px solid #dee2e6;
}

.item-inline-loading {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #888;
    font-size: 13px;
    padding: 12px 0;
}

.item-inline-loading .spinner {
    width: 18px;
    height: 18px;
    border-width: 2px;
}

.item-inline-error {
    color: #856404;
    background: #fff3cd;
    padding: 10px 14px;
    border-radius: 5px;
    font-size: 13px;
}

.item-inline-grid {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

.item-inline-col {
    flex: 1;
    min-width: 0;
}

.item-inline-col-product {
    flex: 0 0 200px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.item-inline-col-features {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.item-inline-img {
    width: 100%;
    max-height: 140px;
    object-fit: contain;
    border-radius: 5px;
    border: 1px solid #e9ecef;
    background: white;
}

.item-inline-meta {
    font-size: 12px;
}

.il-row {
    padding: 2px 0;
    line-height: 1.5;
}

.il-label {
    color: #888;
}

.il-value {
    color: #333;
    font-weight: 500;
}

.item-inline-fullpage {
    display: inline-block;
    font-size: 11px;
    color: #007bff;
    text-decoration: none;
    margin-top: 4px;
}

.item-inline-fullpage:hover {
    text-decoration: underline;
}

.il-card {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    overflow: hidden;
}

.il-card-title {
    font-size: 12px;
    font-weight: 600;
    color: #555;
    padding: 6px 12px;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.il-card-row {
    display: flex;
    justify-content: space-between;
    padding: 4px 12px;
    font-size: 12px;
    border-bottom: 1px solid #f5f5f5;
}

.il-card-row:last-child {
    border-bottom: none;
}

.il-card-label {
    color: #666;
}

.il-card-val {
    font-weight: 600;
    color: #333;
}

.item-inline-asof {
    font-size: 11px;
    color: #aaa;
    text-align: right;
    margin-top: 2px;
}

/* ==================== Responsive Adjustments ==================== */
/* ==================== Conversions View ==================== */

.conversion-detail {
    padding: 16px;
}

.conversion-timeline {
    margin-bottom: 20px;
}

.conversion-timeline h4 {
    margin: 0 0 12px 0;
    font-size: 14px;
    color: #333;
}

.timeline-steps {
    display: flex;
    align-items: flex-start;
    gap: 0;
    overflow-x: auto;
    padding: 8px 0;
}

.timeline-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 90px;
    text-align: center;
}

a.timeline-step-link {
    text-decoration: none;
    cursor: pointer;
    border-radius: 8px;
    padding: 4px;
    margin: -4px;
    transition: background 0.15s;
}
a.timeline-step-link:hover {
    background: rgba(40, 167, 69, 0.08);
}
a.timeline-step-link:hover .timeline-icon {
    box-shadow: 0 0 0 3px rgba(40, 167, 69, 0.25);
}
a.timeline-step-link:hover .timeline-label {
    text-decoration: underline;
}

.timeline-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #e9ecef;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    margin-bottom: 6px;
    border: 2px solid #dee2e6;
    color: #adb5bd;
}

.timeline-step.active .timeline-icon {
    background: #d4edda;
    border-color: #28a745;
    color: #155724;
}

.timeline-label {
    font-size: 11px;
    font-weight: 600;
    color: #adb5bd;
    margin-bottom: 2px;
}

.timeline-step.active .timeline-label {
    color: #333;
}

.timeline-time {
    font-size: 10px;
    color: #666;
    max-width: 100px;
    word-break: break-word;
}

.timeline-connector {
    flex: 1;
    height: 2px;
    background: #dee2e6;
    margin-top: 18px;
    min-width: 20px;
}

.timeline-connector.active {
    background: #28a745;
}

.conversion-summary {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: 6px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.conversion-summary-converted {
    background: #d4edda;
    border: 1px solid #c3e6cb;
}

.conversion-summary-none {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
}

.conversion-summary-label {
    font-weight: 700;
    font-size: 13px;
}

.conversion-summary-converted .conversion-summary-label,
.conversion-summary-converted .conversion-summary-stat {
    color: #155724;
}

.conversion-summary-none .conversion-summary-label,
.conversion-summary-none .conversion-summary-stat {
    color: #6c757d;
}

.conversion-summary-stat {
    font-size: 12px;
}

.conversion-revenue {
    font-weight: 700;
    font-size: 14px;
}

.conversion-meta {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.conversion-converted {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.conversion-none {
    background: #f8f9fa;
    color: #6c757d;
    border: 1px solid #dee2e6;
}

.conversion-item {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeeba;
}

.conversion-row-converted {
    background: #f0faf2;
}

.conversion-row-converted td {
    border-bottom-color: #c3e6cb;
}

/* ==================== Funnel Stages ==================== */
.funnel-stages {
    display: flex;
    align-items: center;
    gap: 0;
    margin-bottom: 0;
}

.funnel-stages > div:not(.funnel-arrow) {
    flex: 1;
    min-width: 0;
}

.funnel-arrow {
    flex: 0 0 auto;
    font-size: 20px;
    color: #ccc;
    padding: 0 6px;
    font-weight: 300;
}

/* ==================== Model Cards ==================== */
.model-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 20px;
    margin-bottom: 0;
}

.model-card {
    background: white;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.model-card-header {
    font-size: 20px;
    font-weight: 700;
    text-transform: capitalize;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #f0f0f0;
}

.model-card-section {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #888;
    margin-top: 14px;
    margin-bottom: 6px;
    padding-top: 10px;
    border-top: 1px solid #f0f0f0;
}

.model-card-metrics {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.model-metric-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 0;
    font-size: 13px;
    border-bottom: 1px solid #f8f8f8;
}

.model-metric-row:last-child {
    border-bottom: none;
}

.model-metric-label {
    color: #666;
}

.model-metric-value {
    font-weight: 600;
    color: #333;
    font-variant-numeric: tabular-nums;
}

@media (max-width: 900px) {
    .user-results-body {
        flex-direction: column;
    }

    .user-results-left {
        width: 100%;
        min-width: unset;
        max-height: 400px;
        border-right: none;
        border-bottom: 1px solid #dee2e6;
    }

    .two-column {
        flex-direction: column;
    }

    .column.events-column {
        max-height: 400px;
    }

    .highlights-grid {
        grid-template-columns: 1fr;
    }

    .form-row {
        flex-direction: column;
    }

    .funnel-stages {
        flex-direction: column;
        gap: 4px;
    }

    .funnel-arrow {
        transform: rotate(90deg);
        padding: 0;
    }

    .model-cards {
        grid-template-columns: 1fr;
    }
}
