/* ====================================================================
   INTELLIGENCE PAGE — Layout, Nav, Tabs, Cards, Metrics, Health
   Extracted from intelligence.html inline styles (Part 1)
   ==================================================================== */

/* --- Noise texture overlay + radial gradient background --- */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background:
        radial-gradient(ellipse 80% 50% at 50% -10%, rgba(59,130,246,0.08) 0%, transparent 60%),
        radial-gradient(ellipse 60% 40% at 30% 10%, rgba(168,85,247,0.04) 0%, transparent 50%);
}
body::after {
    content: '';
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    opacity: 0.035;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    background-repeat: repeat;
    background-size: 200px 200px;
}

.intel-page, .tooltip { position: relative; z-index: 1; }

/* Nav overrides */
.brand-icon {
    font-size: 22px;
    background: linear-gradient(135deg, var(--blue) 0%, #a855f7 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 0 6px rgba(59,130,246,0.3));
}
.brand-name {
    font-family: 'Instrument Serif', Georgia, serif !important;
    font-size: 20px !important;
    font-weight: 400 !important;
    font-style: normal;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, #fafafa 0%, #a1a1aa 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.nav-link {
    font-size: 13px;
    font-weight: 500;
    border-radius: 6px;
    padding: 6px 14px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.nav-link:hover { background: rgba(255,255,255,0.06); }
.nav-link.active {
    background: rgba(59,130,246,0.1);
    color: var(--blue);
    box-shadow: inset 0 0 0 1px rgba(59,130,246,0.15);
}

/* --- Layout --- */
body {
    display: block;
    padding-top: 52px;
}

.intel-page {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px 28px 60px;
    padding-top: calc(var(--nav-h, 56px) + 24px);
}

/* --- Tab Navigation --- */
.tab-bar {
    display: flex;
    gap: 2px;
    background: #1a1a24;
    border-radius: 10px;
    padding: 4px;
    margin-bottom: 28px;
    border: 1px solid #2a2a35;
    overflow-x: auto;
}

.tab-btn {
    flex: 1;
    min-width: 100px;
    padding: 10px 16px;
    background: transparent;
    border: none;
    color: #71717a;
    font-family: 'DM Sans', -apple-system, sans-serif;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border-radius: 7px;
    transition: all 0.2s ease;
    white-space: nowrap;
    text-align: center;
    letter-spacing: 0.2px;
}

.tab-btn:hover {
    color: #d4d4d8;
    background: rgba(100, 108, 255, 0.06);
}

.tab-btn.active {
    color: #fafafa;
    background: #646cff;
    box-shadow: 0 2px 8px rgba(100, 108, 255, 0.3);
}

/* --- Tab Content --- */
.tab-panel {
    display: none;
    animation: fadeIn 0.3s ease;
}

.tab-panel.active {
    display: block;
}

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

/* --- Cards --- */
.card {
    background: #1a1a24;
    border: 1px solid #2a2a35;
    border-radius: 12px;
    padding: 20px 24px;
    margin-bottom: 20px;
}

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

.card-title {
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: #a1a1aa;
}

.card-subtitle {
    font-size: 11px;
    color: #71717a;
    font-family: 'JetBrains Mono', monospace;
}

/* --- Metric Cards --- */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 20px;
}

.metric-card {
    background: #1a1a24;
    border: 1px solid #2a2a35;
    border-radius: 12px;
    padding: 20px;
    position: relative;
    overflow: hidden;
}

.metric-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, #646cff, #818cf8);
    opacity: 0.6;
}

.metric-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: #71717a;
    margin-bottom: 8px;
}

.metric-value {
    font-size: 28px;
    font-weight: 700;
    color: #fafafa;
    font-family: 'JetBrains Mono', monospace;
    letter-spacing: -0.5px;
    line-height: 1.2;
}

.metric-delta {
    font-size: 12px;
    font-family: 'JetBrains Mono', monospace;
    font-weight: 600;
    margin-top: 6px;
}

.metric-delta.positive { color: #4ade80; }
.metric-delta.negative { color: #f87171; }
.metric-delta.neutral  { color: #71717a; }

/* --- Health Banner --- */
.health-banner {
    border-radius: 12px;
    padding: 16px 24px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 14px;
    font-weight: 600;
}

.health-banner .health-icon {
    font-size: 20px;
    line-height: 1;
}

.health-banner .health-text {
    flex: 1;
}

.health-banner .health-sub {
    font-size: 12px;
    font-weight: 400;
    color: inherit;
    opacity: 0.7;
    margin-left: auto;
    font-family: 'JetBrains Mono', monospace;
}

.health-green {
    background: linear-gradient(135deg, rgba(74, 222, 128, 0.1), rgba(74, 222, 128, 0.05));
    border: 1px solid rgba(74, 222, 128, 0.25);
    color: #4ade80;
}

.health-yellow {
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.1), rgba(251, 191, 36, 0.05));
    border: 1px solid rgba(251, 191, 36, 0.25);
    color: #fbbf24;
}

.health-red {
    background: linear-gradient(135deg, rgba(248, 113, 113, 0.1), rgba(248, 113, 113, 0.05));
    border: 1px solid rgba(248, 113, 113, 0.25);
    color: #f87171;
}

/* --- Status Badges --- */
.badge {
    display: inline-block;
    font-size: 10px;
    font-weight: 700;
    font-family: 'JetBrains Mono', monospace;
    padding: 3px 10px;
    border-radius: 100px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.badge-active, .badge-running, .badge-promoted {
    background: rgba(74, 222, 128, 0.12);
    color: #4ade80;
    border: 1px solid rgba(74, 222, 128, 0.25);
}

.badge-soft, .badge-scheduled, .badge-pending {
    background: rgba(251, 191, 36, 0.12);
    color: #fbbf24;
    border: 1px solid rgba(251, 191, 36, 0.25);
}

.badge-shadow, .badge-burnin {
    background: rgba(107, 114, 128, 0.15);
    color: #9ca3af;
    border: 1px solid rgba(107, 114, 128, 0.25);
}

.badge-fixed, .badge-disabled {
    background: rgba(55, 65, 81, 0.3);
    color: #6b7280;
    border: 1px solid rgba(55, 65, 81, 0.4);
}

.badge-rejected {
    background: rgba(248, 113, 113, 0.12);
    color: #f87171;
    border: 1px solid rgba(248, 113, 113, 0.25);
}

.badge-dryrun {
    background: rgba(59, 130, 246, 0.12);
    color: #60a5fa;
    border: 1px solid rgba(59, 130, 246, 0.25);
}

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

.data-table th {
    text-align: left;
    padding: 10px 14px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: #71717a;
    border-bottom: 1px solid #2a2a35;
    white-space: nowrap;
}

.data-table td {
    padding: 10px 14px;
    border-bottom: 1px solid rgba(42, 42, 53, 0.5);
    color: #d4d4d8;
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
}

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

.data-table tr:hover td {
    background: rgba(100, 108, 255, 0.04);
}
