/* ============================================================
   Intelligence Panel Styles
   ============================================================ */

.intel-panel {
    width: 100%;
}

.intel-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 60px 20px;
    color: var(--text-dim);
}

/* ─── Emulated Data Banner ───────────────────────────────── */

.intel-emulated-banner {
    padding: 10px 16px;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 8px;
    color: #1e40af;
    font-size: 13px;
    margin-bottom: 16px;
}
.intel-emulated-banner code {
    background: rgba(0,0,0,0.06);
    padding: 1px 5px;
    border-radius: 3px;
    font-size: 12px;
}


/* ─── KPI Grid ───────────────────────────────────────────── */

.intel-kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
    margin: 16px 0 24px;
}

.intel-kpi-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 18px 16px;
    text-align: center;
}

.intel-kpi-value {
    font-size: 26px;
    font-weight: 700;
    color: var(--accent);
    letter-spacing: -0.5px;
    margin-bottom: 4px;
}

.intel-kpi-label {
    font-size: 11px;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 550;
}


/* ─── Channel Breakdown ──────────────────────────────────── */

.intel-channel-breakdown {
    margin-bottom: 24px;
}
.intel-channel-breakdown h3 {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text);
}

.intel-channel-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 12px;
}

.intel-channel-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-top: 3px solid;
    border-radius: 8px;
    padding: 16px;
}

.intel-channel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.intel-channel-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.intel-channel-count {
    font-size: 12px;
    color: var(--text-dim);
}

.intel-channel-metrics {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.intel-channel-metrics > div {
    display: flex;
    flex-direction: column;
}

.metric-val {
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
}

.metric-lbl {
    font-size: 10px;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-top: 1px;
}


/* ─── Campaigns Performance Table ────────────────────────── */

.intel-campaigns-table {
    margin-top: 4px;
}
.intel-campaigns-table h3 {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text);
}


/* ─── Pacing Bar ─────────────────────────────────────────── */

.intel-pacing {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 100px;
}

.intel-pacing-label {
    font-size: 11px;
    color: var(--text-dim);
    white-space: nowrap;
}

.intel-pacing-track {
    flex: 1;
    height: 6px;
    background: #e5e7eb;
    border-radius: 3px;
    overflow: hidden;
    min-width: 50px;
}

.intel-pacing-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.3s ease;
}

.intel-pacing-pct {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
    min-width: 32px;
    text-align: right;
}


/* ─── Insights View ──────────────────────────────────────── */

.intel-insights-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.intel-insights-summary {
    display: flex;
    align-items: baseline;
    gap: 8px;
    font-size: 14px;
    color: var(--text-secondary);
}

.intel-insights-count {
    font-size: 28px;
    font-weight: 700;
    color: var(--accent);
    letter-spacing: -0.5px;
}

.intel-insights-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.intel-insight-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-left: 4px solid;
    border-radius: 8px;
    overflow: hidden;
}

.intel-insight-top {
    padding: 14px 16px;
}
.intel-insight-top:hover {
    background: rgba(0,0,0,0.01);
}

.intel-insight-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
}

.intel-insight-severity {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 10px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
}

.intel-insight-type {
    font-size: 11px;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.intel-insight-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    margin: 0 0 4px;
}

.intel-insight-context {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-dim);
}

.intel-insight-expand {
    margin-left: auto;
    font-size: 12px;
    color: var(--text-dim);
}

.intel-insight-body {
    padding: 0 16px 14px;
    border-top: 1px solid var(--border-light);
    padding-top: 12px;
    margin-top: 4px;
}

.intel-insight-desc {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 0 0 10px;
}

.intel-insight-rec {
    font-size: 13px;
    color: var(--text);
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 6px;
    padding: 10px 12px;
    line-height: 1.5;
}
.intel-insight-rec strong {
    color: #16a34a;
}


/* ─── Analysis View ──────────────────────────────────────── */

.intel-analysis-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.intel-analysis-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
}

.intel-analysis-top {
    padding: 16px;
}
.intel-analysis-top:hover {
    background: rgba(0,0,0,0.01);
}

.intel-analysis-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 14px;
}
.intel-analysis-header h4 {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    margin: 0 0 2px;
}

.intel-analysis-expand {
    font-size: 14px;
    color: var(--text-dim);
    padding: 4px;
}

.intel-analysis-kpis {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
    gap: 12px;
    margin-bottom: 12px;
}

.intel-analysis-kpi {
    display: flex;
    flex-direction: column;
}

.intel-analysis-budget {
    margin-top: 4px;
}

.intel-analysis-channels {
    padding: 0 16px 16px;
    border-top: 1px solid var(--border-light);
    padding-top: 14px;
}
.intel-analysis-channels h5 {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    margin: 0 0 10px;
}


/* ─── Responsive ─────────────────────────────────────────── */

@media (max-width: 768px) {
    .intel-kpi-grid { grid-template-columns: repeat(2, 1fr); }
    .intel-channel-cards { grid-template-columns: 1fr; }
    .intel-analysis-kpis { grid-template-columns: repeat(3, 1fr); }
}
