/* Pipeline Page — v5.2 (REVIEW moved to Approvals) */
/* 3 Modes: IDLE | LIVE | REVIEW */

/* ===== Mode Containers ===== */
.pipeline-mode {
    animation: fadeIn 0.3s ease;
}

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

/* ================================================ */
/* IDLE MODE — Two Column Layout                     */
/* ================================================ */
.idle-two-col {
    display: grid;
    grid-template-columns: 3fr 7fr;
    gap: 32px;
    align-items: start;
}

.idle-col-left {
    position: sticky;
    top: 20px;
}

.idle-col-right {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

/* Shared column title */
.idle-col-title {
    margin: 0 0 20px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 8px;
}

.idle-col-badge {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-muted);
    background: var(--bg-dark);
    padding: 2px 8px;
    border-radius: 10px;
    text-transform: none;
    letter-spacing: 0;
}

/* Config groups */
.icfg-group {
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}

.icfg-group-last {
    border-bottom: none;
    margin-bottom: 16px;
    padding-bottom: 0;
}

.icfg-label-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.icfg-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.icfg-count {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-family: monospace;
}

/* Unified pills — used for both apps and media */
.icfg-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    max-height: 280px;
    overflow-y: auto;
}

.icfg-pill-wrap {
    cursor: pointer;
}

.icfg-pill-wrap input { display: none; }

.icfg-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 11px;
    background: var(--bg-dark);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.78rem;
    color: var(--text-muted);
    transition: all 0.15s ease;
    white-space: nowrap;
}

/* App pill checked state (purple) */
.icfg-pill-wrap input:checked + .icfg-pill {
    background: rgba(139, 92, 246, 0.1);
    border-color: rgba(139, 92, 246, 0.35);
    color: var(--text-primary);
}

.icfg-pill-wrap:hover .icfg-pill {
    border-color: rgba(139, 92, 246, 0.3);
}

/* Media pill checked state (source color) */
.icfg-pill-wrap input:checked + .icfg-pill-ms {
    background: color-mix(in srgb, var(--ms-color) 10%, transparent);
    border-color: color-mix(in srgb, var(--ms-color) 35%, transparent);
    color: var(--ms-color);
}

.icfg-pill-wrap:hover .icfg-pill-ms {
    border-color: color-mix(in srgb, var(--ms-color) 25%, transparent);
}

.icfg-pill-icon {
    width: 18px;
    height: 18px;
    border-radius: 4px;
}

.icfg-toggle-row-links {
    display: flex;
    gap: 12px;
    margin-top: 8px;
}

.icfg-link-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 0.7rem;
    cursor: pointer;
    padding: 0;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.icfg-link-btn:hover {
    color: #8b5cf6;
}

/* Toggle Switch */
.icfg-toggle-row {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 0.8rem;
    color: var(--text-secondary);
    padding: 4px 0;
}

.icfg-toggle-row input { display: none; }

.icfg-toggle-switch {
    width: 36px;
    height: 20px;
    background: var(--border-color);
    border-radius: 10px;
    position: relative;
    transition: background 0.2s;
    flex-shrink: 0;
}

.icfg-toggle-switch::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 16px;
    height: 16px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.2s;
}

.icfg-toggle-row input:checked + .icfg-toggle-switch {
    background: #22c55e;
}

.icfg-toggle-row input:checked + .icfg-toggle-switch::after {
    transform: translateX(16px);
}

/* Start Button */
.icfg-start-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 13px;
    background: linear-gradient(135deg, #8b5cf6 0%, #6d28d9 100%);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.icfg-start-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(139, 92, 246, 0.4);
}

.icfg-start-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
    transform: none;
}

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

/* Recent Runs */
.idle-runs-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    overflow-y: auto;
    max-height: calc(100vh - 180px);
}

.idle-no-runs {
    color: var(--text-muted);
    font-size: 0.85rem;
    text-align: center;
    padding: 60px 20px;
    line-height: 1.6;
}

/* Run Cards */
.idle-run-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.idle-run-card:hover {
    border-color: #8b5cf6;
    background: rgba(139, 92, 246, 0.04);
}


.run-card-meta {
    min-width: 90px;
    flex-shrink: 0;
}

.run-card-date {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
}

.run-card-time {
    display: block;
    font-size: 0.72rem;
    color: var(--text-muted);
    font-family: monospace;
}

.run-card-stats {
    flex: 1;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.rcs {
    font-size: 0.7rem;
    font-weight: 500;
    padding: 3px 8px;
    border-radius: 4px;
    white-space: nowrap;
}

.rcs-default {
    background: var(--bg-dark);
    color: var(--text-secondary);
}

.rcs-blue {
    background: rgba(59, 130, 246, 0.10);
    color: #60a5fa;
}

.rcs-purple {
    background: rgba(139, 92, 246, 0.12);
    color: #a78bfa;
}

.rcs-red {
    background: rgba(239, 68, 68, 0.12);
    color: #f87171;
}

.rcs-teal {
    background: rgba(20, 184, 166, 0.12);
    color: #2dd4bf;
}

.rcs-orange {
    background: rgba(249, 115, 22, 0.12);
    color: #fb923c;
}

.run-card-arrow {
    width: 18px;
    height: 18px;
    color: var(--text-muted);
    opacity: 0.4;
    transition: all 0.2s;
    flex-shrink: 0;
}

.idle-run-card:hover .run-card-arrow {
    opacity: 1;
    color: #8b5cf6;
}

.run-card-arrow svg {
    width: 18px;
    height: 18px;
}

/* Review Back Bar */
.review-back-bar {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
}

.review-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 8px 16px;
    color: var(--text-secondary);
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
}

.review-back-btn:hover {
    border-color: #8b5cf6;
    color: #8b5cf6;
    background: rgba(139, 92, 246, 0.05);
}

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

.review-back-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.review-back-meta strong {
    color: var(--text-primary);
    font-weight: 600;
}

.review-back-time {
    font-family: monospace;
    font-size: 0.72rem;
    background: var(--bg-dark);
    padding: 3px 8px;
    border-radius: 4px;
    color: var(--text-muted);
}

/* ================================================ */
/* LIVE MODE                                         */
/* ================================================ */

/* Back bar at top of live mode */
.live-back-bar {
    margin-bottom: 16px;
}

.live-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 8px 16px;
    color: var(--text-secondary);
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
}

.live-back-btn:hover {
    border-color: #8b5cf6;
    color: #8b5cf6;
    background: rgba(139, 92, 246, 0.05);
}

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

/* Command Center */
.live-command-center {
    margin-bottom: 20px;
}

.cc-bar {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 16px 24px;
    background: linear-gradient(135deg, var(--bg-card) 0%, var(--bg-dark) 100%);
    border: 1px solid rgba(34, 197, 94, 0.3);
    border-radius: 12px;
    box-shadow: 0 0 20px rgba(34, 197, 94, 0.08);
}

.cc-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.cc-live-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: rgba(34, 197, 94, 0.15);
    border: 1px solid rgba(34, 197, 94, 0.3);
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 700;
    color: #22c55e;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.cc-live-dot {
    width: 8px;
    height: 8px;
    background: #22c55e;
    border-radius: 50%;
    animation: livePulse 1.5s ease-in-out infinite;
}

@keyframes livePulse {
    0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7); }
    50% { opacity: 0.7; box-shadow: 0 0 0 8px rgba(34, 197, 94, 0); }
}

.cc-title {
    font-weight: 600;
    font-size: 1.05rem;
    color: var(--text-primary);
}

.cc-apps {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.cc-app-icon {
    width: 20px;
    height: 20px;
    border-radius: 4px;
}

.cc-media {
    display: flex;
    gap: 6px;
}

.cc-media-badge {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 4px;
    background: color-mix(in srgb, var(--ms-color) 15%, transparent);
    color: var(--ms-color);
    border: 1px solid color-mix(in srgb, var(--ms-color) 30%, transparent);
}

.cc-right-inline {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-left: auto;
}

.cc-started {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.cc-elapsed {
    font-family: monospace;
    font-size: 1.5rem;
    font-weight: 700;
    color: #22c55e;
}

.cc-info-rows {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding-left: 4px;
}

.cc-info-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.cc-info-label {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    min-width: 52px;
}

/* Step Cards */
.live-step-cards {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    overflow-x: auto;
    padding: 4px 0;
}

.live-step-card {
    flex: 1 1 0;
    min-width: 180px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.live-step-card.completed {
    border-color: #22c55e;
    box-shadow: 0 0 16px rgba(34, 197, 94, 0.15);
}

.live-step-card.running {
    border-color: #3b82f6;
    box-shadow: 0 0 16px rgba(59, 130, 246, 0.2);
    animation: cardPulse 2s ease-in-out infinite;
}

@keyframes cardPulse {
    0%, 100% { box-shadow: 0 0 16px rgba(59, 130, 246, 0.2); }
    50% { box-shadow: 0 0 24px rgba(59, 130, 246, 0.35); }
}

.live-step-card.failed {
    border-color: #ef4444;
    box-shadow: 0 0 16px rgba(239, 68, 68, 0.15);
}

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

.lsc-num {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-muted);
}

.live-step-card.completed .lsc-num {
    background: rgba(34, 197, 94, 0.15);
    border-color: #22c55e;
    color: #22c55e;
}

.live-step-card.running .lsc-num {
    background: rgba(59, 130, 246, 0.15);
    border-color: #3b82f6;
    color: #3b82f6;
}

.lsc-icon {
    width: 32px;
    height: 32px;
    color: var(--text-muted);
}

.live-step-card.completed .lsc-icon { color: #22c55e; }
.live-step-card.running .lsc-icon { color: #3b82f6; }
.live-step-card.failed .lsc-icon { color: #ef4444; }

.lsc-icon svg {
    width: 28px;
    height: 28px;
}

.lsc-body {
    padding: 14px;
}

.lsc-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.lsc-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-bottom: 6px;
}

.lsc-check {
    color: #22c55e;
    font-weight: 700;
    font-size: 0.85rem;
}

.lsc-fail {
    color: #ef4444;
    font-weight: 700;
    font-size: 0.85rem;
}

.lsc-skip {
    color: var(--text-muted);
    font-weight: 700;
}

.lsc-pending {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.lsc-spinner {
    width: 14px;
    height: 14px;
    border: 2px solid rgba(59, 130, 246, 0.3);
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.lsc-message {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-family: monospace;
    word-break: break-all;
}

.lsc-duration {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-family: monospace;
    margin-top: 4px;
}

.lsc-source {
    padding: 8px 14px;
    background: var(--bg-dark);
    border-top: 1px solid var(--border-color);
    font-size: 0.65rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Activity Log */
.live-activity-log {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 20px;
}

.activity-log-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: var(--bg-dark);
    border-bottom: 1px solid var(--border-color);
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.activity-log-header svg {
    width: 16px;
    height: 16px;
    color: var(--text-muted);
}

.activity-log-entries {
    max-height: 350px;
    overflow-y: auto;
    padding: 8px 0;
    font-family: monospace;
    font-size: 0.75rem;
}

.log-entry {
    display: flex;
    align-items: baseline;
    gap: 10px;
    padding: 4px 16px;
    transition: background 0.15s ease;
}

.log-entry:hover {
    background: rgba(255, 255, 255, 0.02);
}

.log-time {
    color: var(--text-muted);
    min-width: 65px;
}

.log-tag {
    color: #8b5cf6;
    min-width: 110px;
    font-weight: 600;
}

.log-msg {
    color: var(--text-secondary);
}

.log-success .log-tag { color: #22c55e; }
.log-success .log-msg { color: #22c55e; }
.log-error .log-tag { color: #ef4444; }
.log-error .log-msg { color: #ef4444; }
.log-warn .log-tag { color: #f59e0b; }
.log-warn .log-msg { color: #f59e0b; }

/* Completion — inline bar below activity log */
.live-completion {
    margin-top: 12px;
}

.lcc-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 20px;
    background: var(--bg-card);
    border: 1px solid #22c55e;
    border-radius: 12px;
    animation: lccAppear 0.3s ease;
    flex-wrap: wrap;
}

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

.lcc-bar-left {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.lcc-check-icon {
    width: 22px;
    height: 22px;
    color: #22c55e;
    flex-shrink: 0;
}

.lcc-check-icon svg {
    width: 22px;
    height: 22px;
}

.lcc-bar-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: #22c55e;
}

.lcc-bar-stat {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.lcc-bar-sep {
    color: var(--text-muted);
    font-size: 0.8rem;
}

.lcc-bar-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.lcc-btn-back {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 8px 12px;
    background: none;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-muted);
    font-size: 0.78rem;
    cursor: pointer;
    transition: all 0.15s ease;
}

.lcc-btn-back:hover {
    border-color: var(--text-secondary);
    color: var(--text-secondary);
}

.lcc-btn-secondary {
    padding: 8px 16px;
    background: var(--bg-dark);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
}

.lcc-btn-secondary:hover {
    border-color: #8b5cf6;
    color: #8b5cf6;
}

.lcc-btn-primary {
    padding: 8px 16px;
    background: linear-gradient(135deg, #8b5cf6, #6d28d9);
    border: none;
    border-radius: 8px;
    color: #fff;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
}

.lcc-btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
}

/* Failed completion bar */
.lcc-bar-failed {
    border-color: #ef4444;
}

.lcc-bar-failed .lcc-check-icon { color: #ef4444; }
.lcc-bar-failed .lcc-bar-title { color: #ef4444; }

/* ================================================ */
/* REVIEW MODE                                       */
/* ================================================ */

/* Loading / Error */
.review-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 40px;
    color: var(--text-muted);
}

.review-spinner {
    width: 24px;
    height: 24px;
    border: 3px solid var(--border-color);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.review-error {
    text-align: center;
    padding: 40px;
    color: #ef4444;
    font-size: 0.9rem;
}

.review-empty {
    text-align: center;
    padding: 40px;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.review-section-title {
    margin: 0 0 16px;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

/* R1: Overview Stats Strip */
.rov-strip {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    padding: 14px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    margin-bottom: 24px;
}

.rov-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    background: var(--bg-dark);
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
}

.rov-chip span {
    font-size: 0.68rem;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.rov-sep {
    width: 1px;
    height: 20px;
    background: var(--border-color);
    margin: 0 4px;
}

.rov-c-green { color: #22c55e; }
.rov-c-red { color: #ef4444; }
.rov-c-purple { color: #8b5cf6; }
.rov-c-blue { color: #3b82f6; }
.rov-c-amber { color: #f59e0b; }
.rov-c-teal { color: #14b8a6; }
.rov-c-orange { color: #f97316; }

/* R2: Distribution Charts */
.review-distributions {
    margin-bottom: 24px;
}

.dist-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.dist-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
}

.dist-card h4 {
    margin: 0 0 16px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-align: center;
}

.dist-chart-wrap {
    height: 200px;
    position: relative;
}

/* R3: App Breakdown — uses .app-card classes from marketing.css */
.review-app-breakdown {
    margin-bottom: 24px;
}

.review-app-breakdown .app-card {
    cursor: pointer;
    transition: all 0.2s ease;
}

.review-app-breakdown .app-card:hover {
    border-color: rgba(139, 92, 246, 0.4);
}

.review-app-breakdown .app-card-selected {
    border-color: #8b5cf6 !important;
    box-shadow: 0 0 0 1px #8b5cf6, 0 4px 12px rgba(139, 92, 246, 0.15);
}

.review-app-breakdown .app-card-dimmed {
    opacity: 0.4;
}

/* R4: Campaign Summary Table */
.review-campaign-summary {
    margin-bottom: 32px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
}

.camp-table-wrap {
    overflow-x: auto;
}

.camp-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.78rem;
}

.camp-table thead th {
    padding: 9px 10px;
    text-align: left;
    font-weight: 600;
    color: var(--text-secondary);
    background: var(--bg-dark);
    border-bottom: 2px solid var(--border-color);
    white-space: nowrap;
    position: sticky;
    top: 0;
    z-index: 1;
}

.camp-row {
    cursor: pointer;
    transition: background 0.15s ease;
}

.camp-row td {
    padding: 8px 10px;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
    white-space: nowrap;
}

.camp-row:hover {
    background: rgba(139, 92, 246, 0.05);
}

.camp-row-selected {
    background: rgba(139, 92, 246, 0.10) !important;
    border-left: 3px solid #8b5cf6;
}

.camp-row-dimmed {
    opacity: 0.4;
}

.camp-name {
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text-primary);
    font-weight: 500;
}

.camp-num {
    text-align: center;
    font-family: monospace;
    font-size: 0.76rem;
    color: var(--text-muted);
}

.camp-ok { color: #22c55e; font-weight: 600; }
.camp-fail { color: #ef4444; font-weight: 600; }
.camp-sug { color: #8b5cf6; font-weight: 600; }

.camp-bidtype {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-family: monospace;
}

.camp-commenter {
    font-size: 0.7rem;
    color: var(--text-secondary);
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.camp-src-badge {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.68rem;
    font-weight: 600;
    white-space: nowrap;
}

.camp-src-country {
    background: rgba(59, 130, 246, 0.12);
    color: #60a5fa;
}

.camp-src-campaign {
    background: rgba(249, 115, 22, 0.12);
    color: #fb923c;
}

.camp-src-auto_bidding {
    background: rgba(139, 92, 246, 0.12);
    color: #a78bfa;
}

.camp-media {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.68rem;
    font-weight: 600;
    white-space: nowrap;
}

.camp-media-al {
    background: rgba(255, 107, 53, 0.12);
    color: #ff8c5a;
}

.camp-media-g {
    background: rgba(66, 133, 244, 0.12);
    color: #6ea8f7;
}

.camp-bidstrat {
    font-size: 0.65rem;
    color: var(--text-muted);
    font-family: monospace;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.camp-commenter, .camp-analyzer {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.65rem;
    font-weight: 600;
    white-space: nowrap;
}

.camp-cm-CountryCountry {
    background: rgba(59, 130, 246, 0.10);
    color: #60a5fa;
}

.camp-cm-CountryCampaign {
    background: rgba(16, 185, 129, 0.10);
    color: #34d399;
}

.camp-cm-CampaignCampaign {
    background: rgba(249, 115, 22, 0.10);
    color: #fb923c;
}

.camp-cm-AutoBidding {
    background: rgba(139, 92, 246, 0.10);
    color: #a78bfa;
}

.camp-cm-CampaignCountry {
    background: rgba(236, 72, 153, 0.10);
    color: #f472b6;
}

.camp-cm-Unknown {
    background: rgba(107, 114, 128, 0.10);
    color: #9ca3af;
}

.camp-cm-CountryCountryAnalyzer {
    background: rgba(59, 130, 246, 0.10);
    color: #60a5fa;
}

.camp-cm-CountryCampaignAnalyzer {
    background: rgba(16, 185, 129, 0.10);
    color: #34d399;
}

.camp-cm-CampaignCampaignAnalyzer {
    background: rgba(249, 115, 22, 0.10);
    color: #fb923c;
}

.camp-cm-AutoBiddingCampaignAnalyzer {
    background: rgba(139, 92, 246, 0.10);
    color: #a78bfa;
}

.camp-cm-AutoBiddingCountryAnalyzer {
    background: rgba(236, 72, 153, 0.10);
    color: #f472b6;
}

/* Toggle tech columns */
.camp-hide-tech .camp-tech {
    display: none;
}

.camp-tech-toggle {
    background: none;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 3px 6px;
    cursor: pointer;
    color: var(--text-muted);
    margin-left: 8px;
    vertical-align: middle;
    transition: color 0.15s, border-color 0.15s;
}

.camp-tech-toggle:hover {
    color: var(--text-primary);
    border-color: var(--text-secondary);
}

/* R5: Suggestions Table */
.review-suggestions {
    margin-bottom: 32px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
}

.sug-count {
    font-size: 0.8rem;
    font-weight: 600;
    color: #8b5cf6;
    background: rgba(139, 92, 246, 0.15);
    padding: 2px 8px;
    border-radius: 10px;
}

.sug-filters {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.sug-filters select,
.sug-search {
    padding: 8px 12px;
    background: var(--bg-dark);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 0.8rem;
    cursor: pointer;
}

.sug-search {
    flex: 1;
    min-width: 150px;
}

.sug-filters select:focus,
.sug-search:focus {
    outline: none;
    border-color: #8b5cf6;
}

.sug-table-wrap {
    overflow-x: auto;
}

.sug-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
    table-layout: fixed;
}

/* Column widths — Pipeline page (13 columns) */
#page-pipeline .sug-table thead th:nth-child(1)  { width: 7%; }   /* App */
#page-pipeline .sug-table thead th:nth-child(2)  { width: 10%; }  /* Campaign */
#page-pipeline .sug-table thead th:nth-child(3)  { width: 6%; }   /* Country */
#page-pipeline .sug-table thead th:nth-child(4)  { width: 4%; }   /* Platform */
#page-pipeline .sug-table thead th:nth-child(5)  { width: 8%; }   /* Off-Target */
#page-pipeline .sug-table thead th:nth-child(6)  { width: 7%; }   /* Cap */
#page-pipeline .sug-table thead th:nth-child(7)  { width: 5%; }   /* Avg Spend */
#page-pipeline .sug-table thead th:nth-child(8)  { width: 5%; }   /* Old Bid */
#page-pipeline .sug-table thead th:nth-child(9)  { width: 8%; }   /* New Bid (+%) */
#page-pipeline .sug-table thead th:nth-child(10) { width: 6%; }   /* Old Budget */
#page-pipeline .sug-table thead th:nth-child(11) { width: 9%; }   /* New Budget (+%) */
#page-pipeline .sug-table thead th:nth-child(12) { width: 20%; }  /* Comment */
#page-pipeline .sug-table thead th:nth-child(13) { width: 5%; }   /* Flags */

/* Column widths — Approvals page (14 columns: Action + 13) */
#page-approvals .sug-table thead th:nth-child(1)  { width: 4%; }   /* Act */
#page-approvals .sug-table thead th:nth-child(2)  { width: 6%; }   /* App */
#page-approvals .sug-table thead th:nth-child(3)  { width: 11%; }  /* Campaign */
#page-approvals .sug-table thead th:nth-child(4)  { width: 5%; }   /* Country */
#page-approvals .sug-table thead th:nth-child(5)  { width: 4%; }   /* Platform */
#page-approvals .sug-table thead th:nth-child(6)  { width: 7%; }   /* Off-Target */
#page-approvals .sug-table thead th:nth-child(7)  { width: 6%; }   /* Cap */
#page-approvals .sug-table thead th:nth-child(8)  { width: 5%; }   /* Avg Spend */
#page-approvals .sug-table thead th:nth-child(9)  { width: 5%; }   /* Old Bid */
#page-approvals .sug-table thead th:nth-child(10) { width: 7%; }   /* New Bid (+%) */
#page-approvals .sug-table thead th:nth-child(11) { width: 5%; }   /* Old Budget */
#page-approvals .sug-table thead th:nth-child(12) { width: 7%; }   /* New Budget (+%) */
#page-approvals .sug-table thead th:nth-child(13) { width: 19%; }  /* Comment */
#page-approvals .sug-table thead th:nth-child(14) { width: 4%; }   /* Flags */

.sug-table td {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sug-campaign {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.sug-mono {
    font-family: monospace;
    font-size: 0.75rem;
    white-space: nowrap;
}


.sug-table thead th {
    padding: 10px 12px;
    text-align: left;
    font-weight: 600;
    color: var(--text-secondary);
    background: var(--bg-dark);
    border-bottom: 2px solid var(--border-color);
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
    position: sticky;
    top: 0;
    z-index: 1;
}

.sug-table thead th:hover {
    color: #8b5cf6;
}

.sug-row {
    cursor: pointer;
    transition: background 0.15s ease;
}

.sug-row td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}

.sug-row:hover {
    background: rgba(139, 92, 246, 0.05);
}

.sug-row-expanded {
    background: rgba(139, 92, 246, 0.08) !important;
}

.sug-app-icon {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    vertical-align: middle;
    margin-right: 6px;
}

.sug-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    white-space: nowrap;
}

.badge-green { background: rgba(34, 197, 94, 0.15); color: #22c55e; }
.badge-red { background: rgba(239, 68, 68, 0.15); color: #ef4444; }
.badge-darkred { background: rgba(153, 27, 27, 0.2); color: #fca5a5; }
.badge-blue { background: rgba(59, 130, 246, 0.15); color: #3b82f6; }
.badge-darkblue { background: rgba(30, 64, 175, 0.2); color: #93c5fd; }
.badge-amber { background: rgba(245, 158, 11, 0.15); color: #f59e0b; }
.badge-purple { background: rgba(139, 92, 246, 0.15); color: #8b5cf6; }
.badge-gray { background: rgba(107, 114, 128, 0.15); color: #9ca3af; }

.sug-pos { color: #22c55e; font-weight: 600; }
.sug-neg { color: #ef4444; font-weight: 600; }

.sug-comment {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--text-secondary);
    font-size: 0.75rem;
}

.sug-pct {
    font-size: 0.65rem;
    opacity: 0.7;
    margin-left: 2px;
}

.sug-flag {
    display: inline-block;
    padding: 1px 5px;
    border-radius: 3px;
    font-size: 0.65rem;
    font-weight: 700;
}

.sug-flag-red { background: rgba(239, 68, 68, 0.15); color: #ef4444; }
.sug-flag-teal { background: rgba(20, 184, 166, 0.15); color: #14b8a6; }
.sug-flag-amber { background: rgba(245, 158, 11, 0.15); color: #f59e0b; }

/* Row highlighting */
.sug-row-warning { background: rgba(239, 68, 68, 0.06); }
.sug-row-warning:hover { background: rgba(239, 68, 68, 0.10) !important; }
.sug-row-info { background: rgba(59, 130, 246, 0.06); }
.sug-row-info:hover { background: rgba(59, 130, 246, 0.10) !important; }
.sug-row-failed { background: rgba(239, 68, 68, 0.10); border-left: 3px solid #ef4444; }
.sug-row-failed:hover { background: rgba(239, 68, 68, 0.16) !important; }
.sug-comment-error { color: #ef4444; font-style: italic; }
.sug-count-failed {
    font-size: 0.7rem;
    font-weight: 600;
    color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
    padding: 2px 8px;
    border-radius: 10px;
    margin-left: 6px;
}
.sug-row-failed { background: rgba(239, 68, 68, 0.10); border-left: 3px solid #ef4444; }
.sug-row-failed:hover { background: rgba(239, 68, 68, 0.16) !important; }
.sug-row-failed td { color: #fca5a5; }

.sug-flag-fail {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
}

/* Bid/Budget value columns */
.sug-bid-val {
    font-family: monospace;
    font-size: 0.78rem;
    white-space: nowrap;
}

/* Expanded row */
.sug-expanded-row td {
    padding: 0 !important;
    border-bottom: 2px solid #8b5cf6;
    overflow: visible;
    white-space: normal;
}

.exp-content {
    padding: 20px 24px;
    background: rgba(139, 92, 246, 0.03);
    animation: expandRow 0.25s ease;
}

@keyframes expandRow {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ── Two-column layout ── */
.exp-two-col {
    display: flex;
    gap: 20px;
}

.exp-col-left {
    flex: 1;
    min-width: 0;
}

.exp-col-right {
    width: 380px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* ── Factor grid (right panel: 2 columns) ── */
.exp-factors-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.exp-factor {
    background: var(--bg-dark);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 12px 10px;
    text-align: center;
}

.exp-factor-label {
    font-size: 0.6rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.exp-factor-val {
    font-size: 1rem;
    font-weight: 700;
    font-family: monospace;
    color: var(--text-primary);
}

.exp-factor-small {
    font-size: 0.78rem;
    font-weight: 600;
}

.exp-val-pos { color: #10b981; }
.exp-val-neg { color: #ef4444; }

.exp-flags {
    display: flex;
    gap: 6px;
    margin-top: 10px;
}

.exp-tag {
    font-size: 0.68rem;
    padding: 3px 10px;
    border-radius: 6px;
    font-weight: 600;
}
.exp-tag-amber { background: rgba(245, 158, 11, 0.15); color: #f59e0b; }
.exp-tag-teal  { background: rgba(20, 184, 166, 0.15); color: #14b8a6; }
.exp-tag-red   { background: rgba(239, 68, 68, 0.15); color: #ef4444; }

/* ── Middle: daily breakdown (async loaded) ── */
.exp-daily {
    margin-bottom: 18px;
}

.exp-daily-header {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.exp-daily-loading {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px;
    color: var(--text-muted);
    font-size: 0.78rem;
}

.exp-daily-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid var(--border-color);
    border-top-color: #8b5cf6;
    border-radius: 50%;
    animation: exp-spin 0.7s linear infinite;
}

@keyframes exp-spin {
    to { transform: rotate(360deg); }
}

.exp-daily-empty {
    color: var(--text-muted);
    font-size: 0.75rem;
    font-style: italic;
}

.sug-expanded-row .exp-daily-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
}

.sug-expanded-row .exp-daily-table th {
    padding: 10px 4px !important;
    text-align: center !important;
    color: var(--text-muted) !important;
    font-weight: 600 !important;
    font-size: 0.65rem !important;
    border-bottom: 1px solid var(--border-color) !important;
    white-space: nowrap;
    overflow: visible !important;
}

.sug-expanded-row .exp-daily-table th:first-child,
.sug-expanded-row .exp-daily-table td:first-child { text-align: left !important; }

.sug-expanded-row .exp-daily-table td {
    padding: 14px 4px !important;
    border-bottom: 1px solid rgba(255,255,255,0.04) !important;
    color: var(--text-secondary);
    text-align: center !important;
    overflow: visible !important;
    white-space: nowrap;
}

.exp-mono { font-family: monospace; }

.exp-roas-cell {
    text-align: center;
    padding: 4px 6px !important;
    border-radius: 3px;
}

.exp-roas-na {
    color: var(--text-muted) !important;
    opacity: 0.3;
}

.exp-bar-col { width: 20%; }

.exp-bar-cell { padding-left: 4px; padding-right: 4px; }

.exp-bar-track {
    position: relative;
    height: 12px;
    background: rgba(255,255,255,0.04);
    border-radius: 4px;
    overflow: visible;
}

.exp-bar-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.3s ease;
    min-width: 2px;
}

.exp-bar-target {
    position: absolute;
    top: -3px;
    bottom: -3px;
    width: 2px;
    background: rgba(255,255,255,0.4);
    border-radius: 1px;
}

/* ── Change cards ── */
.exp-change-cards {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.exp-change-card {
    background: var(--bg-dark);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 12px 16px;
}

.exp-change-title {
    font-size: 0.65rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.exp-change-row {
    display: flex;
    align-items: center;
    gap: 6px;
}

.exp-change-old {
    font-size: 0.95rem;
    font-family: monospace;
    color: var(--text-muted);
}

.exp-change-arrow {
    font-size: 1.1rem;
    font-weight: 700;
}

.exp-change-new {
    font-size: 1.05rem;
    font-family: monospace;
    font-weight: 700;
    color: var(--text-primary);
}

.exp-change-pct {
    font-size: 0.78rem;
    font-family: monospace;
    opacity: 0.8;
}

.exp-comment-box {
    flex: 1;
    background: var(--bg-dark);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 0.78rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

/* Show more */
.sug-show-more {
    text-align: center;
    padding: 16px;
}

.sug-end-marker {
    text-align: center;
    padding: 14px 0 4px;
    font-size: 0.75rem;
    color: var(--text-muted);
    opacity: 0.5;
}

/* R5: Failed Analyses */
.review-failed {
    margin-bottom: 24px;
}

.failed-section {
    background: var(--bg-card);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 12px;
    overflow: hidden;
}

.failed-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    background: rgba(239, 68, 68, 0.05);
    cursor: pointer;
    transition: background 0.2s;
}

.failed-header:hover {
    background: rgba(239, 68, 68, 0.1);
}

.failed-header h3 {
    margin: 0;
    font-size: 0.9rem;
    color: #ef4444;
    display: flex;
    align-items: center;
    gap: 8px;
}

.failed-count {
    font-size: 0.7rem;
    background: rgba(239, 68, 68, 0.2);
    padding: 2px 8px;
    border-radius: 10px;
}

.failed-chevron {
    width: 18px;
    height: 18px;
    color: #ef4444;
    transition: transform 0.2s;
}

.failed-collapsed .failed-body {
    display: none;
}

.failed-collapsed .failed-chevron {
    transform: rotate(-90deg);
}

.failed-body {
    padding: 0;
}

.failed-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
}

.failed-table th {
    padding: 10px 16px;
    text-align: left;
    font-weight: 600;
    color: var(--text-muted);
    background: var(--bg-dark);
    border-bottom: 1px solid var(--border-color);
}

.failed-table td {
    padding: 10px 16px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-secondary);
}

.failed-campaign {
    font-family: monospace;
    font-size: 0.75rem;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.failed-error {
    color: #ef4444;
    font-size: 0.75rem;
}

/* ===== Config Modal (unchanged, kept from original) ===== */
#analysis-config-modal .modal-content,
.analysis-config-modal-content {
    max-width: 480px;
    width: 90%;
}

#analysis-config-modal .modal-header,
.analysis-modal-header {
    background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
    padding: 20px 24px;
    border-radius: 12px 12px 0 0;
    border-bottom: none;
}

#analysis-config-modal .modal-header h3,
.analysis-modal-header h3 {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0;
    color: #fff;
    font-size: 1.25rem;
}

#analysis-config-modal .modal-header h3 svg,
.analysis-modal-header h3 svg {
    width: 20px;
    height: 20px;
}

#analysis-config-modal .modal-header .modal-close,
.analysis-modal-header .modal-close {
    color: #fff;
    opacity: 0.8;
}

#analysis-config-modal .modal-header .modal-close:hover,
.analysis-modal-header .modal-close:hover {
    opacity: 1;
}

#analysis-config-modal .modal-body {
    padding: 24px;
    max-height: none;
}

.config-section {
    margin-bottom: 24px;
}

.config-section:last-child {
    margin-bottom: 0;
}

.config-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.config-checkboxes {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.config-checkbox {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    background: var(--bg-dark);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.config-checkbox:hover {
    border-color: #8b5cf6;
    background: rgba(139, 92, 246, 0.1);
}

.config-checkbox input {
    display: none;
}

.checkbox-mark {
    width: 18px;
    height: 18px;
    border: 2px solid var(--border-color);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.config-checkbox input:checked + .checkbox-mark {
    background: #8b5cf6;
    border-color: #8b5cf6;
}

.config-checkbox input:checked + .checkbox-mark::after {
    content: '✓';
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
}

.config-checkbox input:checked ~ span:last-child {
    color: var(--text-primary);
}

.config-toggle {
    width: 100%;
    padding: 14px 16px;
    border-radius: 10px;
}

#analysis-config-modal .modal-footer {
    padding: 16px 24px;
    background: var(--bg-dark);
    border-radius: 0 0 12px 12px;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.btn-start-analysis {
    display: flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
    color: #fff;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-start-analysis:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.4);
}

.btn-start-analysis:disabled {
    opacity: 0.35;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

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

/* ===== Old Run Banner (Approvals) ===== */
.appr-old-run-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: 8px;
    margin: 0 0 16px;
    font-size: 0.88rem;
    font-weight: 500;
    color: #f87171;
}

.appr-old-run-banner button {
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #f87171;
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.appr-old-run-banner button:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.5);
}

/* ===== Responsive ===== */
@media (max-width: 1200px) {
    .dist-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 900px) {
    .idle-two-col {
        grid-template-columns: 1fr;
    }

    .idle-col-left {
        position: static;
    }
}

@media (max-width: 768px) {
    .live-step-cards {
        flex-direction: column;
    }

    .live-step-card {
        flex: 0 0 auto;
    }

    .cc-bar {
        flex-direction: column;
        align-items: flex-start;
    }

    .review-app-breakdown .app-grid {
        grid-template-columns: 1fr;
    }

    .sug-filters {
        flex-direction: column;
    }

    .sug-table {
        font-size: 0.7rem;
    }

    .exp-two-col {
        flex-direction: column;
    }
    .exp-col-right {
        width: 100%;
    }
    .exp-factors-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .icfg-media {
        flex-direction: column;
    }

    .lcc-bar {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }
}

/* ===== Pipeline Skeleton Loading ===== */

/* Glow sweep for pipeline skeletons */
.pipeline-idle-content .skeleton {
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0.03) 0%,
        rgba(255, 255, 255, 0.03) 25%,
        rgba(255, 255, 255, 0.08) 45%,
        rgba(255, 255, 255, 0.14) 50%,
        rgba(255, 255, 255, 0.08) 55%,
        rgba(255, 255, 255, 0.03) 75%,
        rgba(255, 255, 255, 0.03) 100%
    );
    background-size: 200% 100%;
    animation: skel-glow-pipe 1.8s ease-in-out infinite;
    border-radius: 4px;
}

@keyframes skel-glow-pipe {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.skel-col-title {
    width: 120px;
    height: 18px;
    margin-bottom: 20px;
    border-radius: 4px;
}

.skel-group {
    margin-bottom: 20px;
}

.skel-label {
    width: 90px;
    height: 12px;
    margin-bottom: 10px;
}

.skel-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.skel-pill {
    width: 90px;
    height: 32px;
    border-radius: 8px;
}

.skel-start-btn {
    width: 100%;
    height: 42px;
    border-radius: 10px;
    margin-top: 16px;
}

/* Skeleton run card */
.skel-run-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 14px 16px;
    margin-bottom: 8px;
    animation: skel-card-pulse-pipe 2s ease-in-out infinite;
}

@keyframes skel-card-pulse-pipe {
    0%, 100% { border-color: var(--border-color); }
    50%      { border-color: rgba(255, 255, 255, 0.08); }
}

.skel-run-meta {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

.skel-run-date {
    width: 80px;
    height: 14px;
}

.skel-run-time {
    width: 50px;
    height: 14px;
}

.skel-run-stats {
    display: flex;
    gap: 8px;
}

.skel-run-tag {
    width: 70px;
    height: 22px;
    border-radius: 6px;
}

/* ==========================================
   APPROVE / REJECT — Action Column & Staging
   (Shared by Pipeline + Approvals pages)
   ========================================== */

/* Action cell */
.sug-action-cell {
    text-align: center;
    white-space: nowrap;
}

/* Approve / Reject buttons in table */
.sug-act-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: transparent;
    cursor: pointer;
    font-size: 11px;
    font-weight: 600;
    transition: all 0.15s ease;
    margin: 0 1px;
    color: var(--text-muted);
}
.sug-act-btn:hover {
    transform: scale(1.1);
}
.sug-act-approve:hover {
    background: rgba(34, 197, 94, 0.2);
    border-color: #22c55e;
    color: #22c55e;
}
.sug-act-reject:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: #ef4444;
    color: #ef4444;
}

/* Staged label — text badge, clickable to unstage */
.sug-staged-label {
    font-size: 0.68rem;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 4px;
    cursor: pointer;
    letter-spacing: 0.01em;
    transition: opacity 0.15s;
}
.sug-staged-label:hover {
    opacity: 0.65;
}
.sug-staged-approve {
    background: rgba(34, 197, 94, 0.15);
    color: #22c55e;
}
.sug-staged-reject {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

/* Done labels — already executed / dismissed */
.sug-done-label {
    font-size: 0.6rem;
    font-weight: 600;
    padding: 2px 5px;
    border-radius: 4px;
    letter-spacing: 0.01em;
    opacity: 0.55;
}
.sug-done-executed {
    background: rgba(250, 204, 21, 0.1);
    color: #fbbf24;
}
.sug-done-dismissed {
    background: rgba(156, 163, 175, 0.1);
    color: #9ca3af;
}

/* Staged row highlights */
.sug-row-staged-approve {
    border-left: 3px solid #22c55e !important;
    background: rgba(34, 197, 94, 0.04) !important;
}
.sug-row-staged-reject {
    border-left: 3px solid #ef4444 !important;
    background: rgba(239, 68, 68, 0.04) !important;
    opacity: 0.7;
}

/* ==========================================
   STAGING PANEL — Fixed bottom bar
   ========================================== */
.pip-staging-panel {
    position: fixed;
    bottom: 0;
    left: var(--sidebar-width, 240px);
    right: 0;
    z-index: 1000;
    background: rgba(17, 24, 39, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid rgba(139, 92, 246, 0.3);
    transform: translateY(100%);
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.4);
}
.pip-staging-panel.pip-staging-visible {
    transform: translateY(0);
}

.pip-stg-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 24px 8px;
    gap: 16px;
}

/* Items row */
.pip-stg-items {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 0 24px 12px;
    max-height: 120px;
    overflow-y: auto;
}

.pip-stg-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.72rem;
    padding: 4px 8px 4px 6px;
    border-radius: 6px;
    border: 1px solid;
}
.pip-stg-item-approve {
    background: rgba(34, 197, 94, 0.08);
    border-color: rgba(34, 197, 94, 0.25);
    color: #bbf7d0;
}
.pip-stg-item-reject {
    background: rgba(239, 68, 68, 0.08);
    border-color: rgba(239, 68, 68, 0.25);
    color: #fecaca;
}
.pip-stg-item-icon {
    width: 14px;
    height: 14px;
    border-radius: 3px;
}
.pip-stg-item-app {
    font-weight: 600;
}
.pip-stg-item-camp {
    font-size: 0.65rem;
    color: var(--text-secondary, #d1d5db);
    white-space: normal;
    word-break: break-word;
}
.pip-stg-item-country {
    color: var(--text-muted, #9ca3af);
}
.pip-stg-item-change {
    font-size: 0.65rem;
    opacity: 0.8;
}
.pip-stg-item-x {
    background: none;
    border: none;
    color: var(--text-muted, #6b7280);
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    padding: 0 2px;
    margin-left: 2px;
    opacity: 0.6;
    transition: opacity 0.15s;
}
.pip-stg-item-x:hover {
    opacity: 1;
    color: #ef4444;
}

/* Type indicator in grouped items */
.pip-stg-item-type {
    font-weight: 700;
    font-size: 0.7rem;
    width: 14px;
    text-align: center;
    flex-shrink: 0;
}
.pip-stg-item-approve .pip-stg-item-type { color: #22c55e; }
.pip-stg-item-reject .pip-stg-item-type { color: #ef4444; }

/* Campaign group in staging panel */
.pip-stg-group {
    margin-bottom: 8px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 8px;
    padding: 8px 10px;
}
.pip-stg-group-header {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.72rem;
    font-weight: 600;
    color: rgba(139, 92, 246, 0.9);
    padding-bottom: 6px;
    margin-bottom: 6px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.pip-stg-group-name {
    white-space: normal;
    word-break: break-word;
}
.pip-stg-group-items {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.pip-stg-left {
    display: flex;
    align-items: center;
    gap: 12px;
}
.pip-stg-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary, #f3f4f6);
    letter-spacing: 0.02em;
}

.pip-stg-chip {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 20px;
}
.pip-stg-chip-approve {
    background: rgba(34, 197, 94, 0.15);
    color: #22c55e;
    border: 1px solid rgba(34, 197, 94, 0.3);
}
.pip-stg-chip-reject {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.pip-stg-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.pip-stg-btn-clear {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary, #9ca3af);
    padding: 6px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.15s ease;
}
.pip-stg-btn-clear:hover {
    border-color: var(--text-muted);
    color: var(--text-primary);
}

.pip-stg-btn-execute {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #22c55e, #16a34a);
    color: #fff;
    border: none;
    padding: 8px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.15s ease;
    box-shadow: 0 2px 8px rgba(34, 197, 94, 0.3);
}
.pip-stg-btn-execute:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.4);
}
.pip-stg-btn-execute:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Responsive: staging panel on small screens */
@media (max-width: 768px) {
    .pip-staging-panel {
        left: 0;
    }
    .pip-stg-inner {
        padding: 10px 16px;
        flex-wrap: wrap;
    }
}
