/* ═══════════════════════════════════════════════
   INSPECTOR DE FLUJO — Fase 2
═══════════════════════════════════════════════ */
.inspector-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.88);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.25s ease;
}

.inspector-container {
    width: 96%;
    max-width: 1480px;
    height: 92vh;
    background: #0e1117;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 18px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 32px 80px rgba(0,0,0,0.7), 0 0 0 1px rgba(255,255,255,0.04);
}

/* ── Header ── */
.inspector-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    background: rgba(255,255,255,0.025);
    border-bottom: 1px solid rgba(255,255,255,0.07);
    flex-shrink: 0;
}
.inspector-header-left {
    display: flex;
    align-items: center;
    gap: 14px;
}
.inspector-header-icon {
    width: 22px;
    height: 22px;
    color: var(--accent-color);
    flex-shrink: 0;
}
.inspector-title {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}
.inspector-subtitle {
    margin: 2px 0 0;
    font-size: 11px;
    color: var(--text-faint);
    letter-spacing: 0.02em;
}
.inspector-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}
.inspector-refine-btn { white-space: nowrap; }
.inspector-close {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(239,68,68,0.08);
    color: #f87171;
    border: 1px solid rgba(239,68,68,0.18);
    padding: 7px 14px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.18s;
}
.inspector-close svg { width: 14px; height: 14px; }
.inspector-close:hover {
    background: #ef4444;
    color: #fff;
    border-color: #ef4444;
}

/* ── Body: 2 columns ── */
.inspector-body {
    display: flex;
    flex: 1;
    overflow: hidden;
    gap: 0;
}
.inspector-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-width: 0;
}
.inspector-col-separator {
    width: 1px;
    background: rgba(255,255,255,0.07);
    flex-shrink: 0;
}

/* ── Column header (accent bar) ── */
.inspector-col-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    flex-shrink: 0;
}
.inspector-col-header svg { width: 14px; height: 14px; flex-shrink: 0; }
.inspector-col-desc {
    font-weight: 400;
    font-size: 11px;
    letter-spacing: 0.02em;
    margin-left: 4px;
    opacity: 0.55;
    text-transform: none;
}
.cheerio-accent {
    background: rgba(6,182,212,0.06);
    color: #22d3ee;
    border-bottom-color: rgba(6,182,212,0.15);
}
.ia-accent {
    background: rgba(139,92,246,0.06);
    color: #a78bfa;
    border-bottom-color: rgba(139,92,246,0.15);
}

/* ── Quadrant (half-column panel) ── */
.inspector-quadrant {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 0;
}

/* ── Panel label (sub-section divider) ── */
.inspector-panel-label {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 8px 18px;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.35);
    background: rgba(255,255,255,0.02);
    border-bottom: 1px solid rgba(255,255,255,0.05);
    flex-shrink: 0;
}
.inspector-panel-label svg { width: 12px; height: 12px; opacity: 0.6; }
.inspector-copy-btn {
    margin-left: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 4px;
    padding: 3px 5px;
    cursor: pointer;
    color: rgba(255,255,255,0.35);
    transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.inspector-copy-btn:hover { color: rgba(255,255,255,0.8); border-color: rgba(255,255,255,0.3); background: rgba(255,255,255,0.06); }
.inspector-copy-btn svg { width: 11px; height: 11px; opacity: 1; }

/* ── Size badge ── */
.inspector-size-badge {
    margin-left: auto;
    font-size: 10px;
    font-weight: 500;
    color: var(--text-faint);
    font-family: 'JetBrains Mono', monospace;
    background: rgba(255,255,255,0.06);
    padding: 1px 7px;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.07);
}
.badge-warn {
    color: #fbbf24;
    background: rgba(251,191,36,0.08);
    border-color: rgba(251,191,36,0.18);
}

/* ── Code area ── */
.inspector-code {
    flex: 1;
    overflow-y: auto;
    margin: 0;
    padding: 16px 20px;
    font-family: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;
    font-size: 11.5px;
    line-height: 1.65;
    color: #cdd9e5;
    background: transparent;
    white-space: pre-wrap;
    word-break: break-word;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.1) transparent;
}
.inspector-code::-webkit-scrollbar { width: 5px; }
.inspector-code::-webkit-scrollbar-track { background: transparent; }
.inspector-code::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 4px; }
.inspector-code::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.2); }
.inspector-empty { color: var(--text-faint); font-style: italic; }

/* ── Divider between quadrants ── */
.inspector-divider {
    height: 1px;
    background: rgba(255,255,255,0.06);
    flex-shrink: 0;
    position: relative;
}
.inspector-divider::after {
    content: '';
    position: absolute;
    left: 20px; right: 20px; top: 0;
    height: 1px;
    background: rgba(255,255,255,0.04);
}

.debug-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(14, 165, 233, 0.1);
    color: #7dd3fc;
    border: 1px solid rgba(14, 165, 233, 0.2);
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    margin-top: 10px;
    transition: all 0.2s;
}

.debug-btn:hover {
    background: rgba(14, 165, 233, 0.2);
    border-color: #0ea5e9;
}

/* Delete Button in Header */
.btn-icon-danger {
    background: transparent;
    color: var(--text-dim);
    border: none;
    padding: 6px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-icon-danger:hover {
    background: rgba(239, 68, 68, 0.1);
    color: var(--error);
    transform: scale(1.1);
}

.job-actions-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-right: 12px;
}

.badge-readonly {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px;
    color: var(--text-faint);
    opacity: 0.45;
    cursor: default;
}
.badge-readonly svg { width: 14px; height: 14px; }

.btn-run-instant {
    background: linear-gradient(135deg, #16a34a 0%, #15803d 100%);
    color: #fff;
    border: 1px solid rgba(34, 197, 94, 0.4);
    padding: 6px 14px 6px 11px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    opacity: 0;
    transform: translateX(4px);
    pointer-events: none;
    box-shadow: 0 2px 8px rgba(22, 163, 74, 0.3);
    white-space: nowrap;
}
.job-card-header:hover .btn-run-instant {
    opacity: 1;
    transform: translateX(0);
    pointer-events: auto;
}
.btn-run-instant:hover:not(:disabled) {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    border-color: rgba(34, 197, 94, 0.7);
    box-shadow: 0 0 16px rgba(34, 197, 94, 0.4);
    transform: translateX(0) translateY(-1px);
}
.btn-run-instant:disabled {
    opacity: 0.3 !important;
    cursor: not-allowed;
    filter: grayscale(0.4);
}
.job-card-header:hover .btn-run-instant:disabled {
    opacity: 0.3 !important;
}

.job-action-divider {
    width: 1px;
    height: 18px;
    background: rgba(255,255,255,0.08);
    margin: 0 4px;
}

.dirty-badge {
    display: none;
    align-items: center;
    gap: 4px;
    font-size: 10px;
    font-weight: 700;
    color: #f59e0b;
    background: rgba(245, 158, 11, 0.12);
    border: 1px solid rgba(245, 158, 11, 0.35);
    padding: 2px 8px;
    border-radius: 20px;
    white-space: nowrap;
}

.switch-toggle.dirty-locked { opacity: 0.4; cursor: not-allowed; }

