/* ============================================================
   INNOVATIVE NECTAR — Analytics Dashboard Styles
   ============================================================
   Dark-themed analytics page for lead funnel, revenue, KPIs.
   ============================================================ */

/* ── Layout ───────────────────────────────────────────── */
.analytics-page {
    background: #051a10;
    min-height: 100vh;
    color: #e2e8f0;
}

.analytics-header {
    background: #0d2618;
    border-bottom: 1px solid rgba(255, 191, 0, 0.15);
    padding: var(--space-6) 0;
}

.analytics-header__inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.analytics-header__title {
    font-family: var(--font-head);
    font-size: var(--text-2xl);
    font-weight: 700;
    color: white;
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.analytics-header__title .live-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #16A34A;
    animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.4;
    }
}

.analytics-header__nav {
    display: flex;
    gap: var(--space-4);
    align-items: center;
}

.analytics-header__nav a {
    font-family: var(--font-head);
    font-size: var(--text-sm);
    color: rgba(255, 255, 255, 0.6);
    text-decoration: none;
    transition: color 0.2s;
}

.analytics-header__nav a:hover {
    color: var(--color-amber);
}

.analytics-header__badge {
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    color: rgba(255, 255, 255, 0.4);
}

/* ── KPI Cards ────────────────────────────────────────── */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-6);
    padding: var(--space-8) 0;
}

.kpi-card {
    background: #0d2618;
    border: 1px solid rgba(255, 191, 0, 0.1);
    border-radius: var(--radius-md);
    padding: var(--space-6);
    transition: border-color 0.3s, transform 0.3s;
}

.kpi-card:hover {
    border-color: rgba(255, 191, 0, 0.3);
    transform: translateY(-2px);
}

.kpi-card__label {
    font-family: var(--font-head);
    font-size: var(--text-xs);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: var(--space-2);
}

.kpi-card__value {
    font-family: var(--font-head);
    font-size: var(--text-4xl);
    font-weight: 800;
    color: white;
    margin-bottom: var(--space-2);
}

.kpi-card__value--amber {
    color: var(--color-amber);
}

.kpi-card__change {
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    display: flex;
    align-items: center;
    gap: var(--space-1);
}

.kpi-card__change--up {
    color: #16A34A;
}

.kpi-card__change--down {
    color: #DC2626;
}

/* ── Funnel ───────────────────────────────────────────── */
.analytics-section {
    padding: var(--space-8) 0;
}

.analytics-section__title {
    font-family: var(--font-head);
    font-size: var(--text-xl);
    font-weight: 700;
    color: white;
    margin-bottom: var(--space-6);
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.funnel-container {
    background: #0d2618;
    border: 1px solid rgba(255, 191, 0, 0.1);
    border-radius: var(--radius-md);
    padding: var(--space-8);
}

.funnel-stages {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: var(--space-4) 0;
}

.funnel-stage {
    text-align: center;
    flex: 1;
    position: relative;
}

.funnel-bar {
    height: 60px;
    margin: 0 auto var(--space-3);
    border-radius: var(--radius-sm);
    position: relative;
    overflow: hidden;
    transition: opacity 0.3s;
}

.funnel-bar::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.1) 0%, transparent 100%);
}

.funnel-stage:nth-child(1) .funnel-bar {
    width: 100%;
    background: var(--color-forest-light);
}

.funnel-stage:nth-child(2) .funnel-bar {
    width: 75%;
    background: #02703a;
}

.funnel-stage:nth-child(3) .funnel-bar {
    width: 50%;
    background: #FFBF00;
}

.funnel-stage:nth-child(4) .funnel-bar {
    width: 35%;
    background: #16A34A;
}

.funnel-stage__count {
    font-family: var(--font-head);
    font-size: var(--text-2xl);
    font-weight: 800;
    color: white;
    margin-bottom: var(--space-1);
}

.funnel-stage__label {
    font-family: var(--font-head);
    font-size: var(--text-xs);
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.funnel-stage__pct {
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    color: var(--color-amber);
    margin-top: var(--space-1);
}

.funnel-arrow {
    font-size: var(--text-xl);
    color: rgba(255, 255, 255, 0.2);
    padding: 0 var(--space-2);
    align-self: center;
}

/* ── Revenue Chart ────────────────────────────────────── */
.chart-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: var(--space-6);
}

.chart-panel {
    background: #0d2618;
    border: 1px solid rgba(255, 191, 0, 0.1);
    border-radius: var(--radius-md);
    padding: var(--space-6);
}

.chart-panel__title {
    font-family: var(--font-head);
    font-size: var(--text-lg);
    font-weight: 700;
    color: white;
    margin-bottom: var(--space-6);
}

.bar-chart {
    display: flex;
    align-items: flex-end;
    gap: var(--space-3);
    height: 200px;
    padding-top: var(--space-4);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.bar-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-2);
}

.bar {
    width: 100%;
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
    background: linear-gradient(180deg, var(--color-amber) 0%, #b88600 100%);
    transition: height 1s ease-out;
    position: relative;
    min-height: 4px;
}

.bar:hover {
    opacity: 0.85;
}

.bar-label {
    font-family: var(--font-mono);
    font-size: 10px;
    color: rgba(255, 255, 255, 0.5);
    padding-top: var(--space-2);
}

.bar-value {
    font-family: var(--font-head);
    font-size: 10px;
    font-weight: 700;
    color: var(--color-amber);
    position: absolute;
    top: -18px;
    left: 50%;
    transform: translateX(-50%);
    white-space: nowrap;
}

/* ── Sources Table ────────────────────────────────────── */
.sources-table {
    width: 100%;
    border-collapse: collapse;
}

.sources-table th {
    font-family: var(--font-head);
    font-size: var(--text-xs);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: rgba(255, 255, 255, 0.4);
    text-align: left;
    padding: var(--space-3) var(--space-4);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sources-table td {
    font-family: var(--font-body);
    font-size: var(--text-sm);
    color: var(--color-slate-light);
    padding: var(--space-3) var(--space-4);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.sources-table tr:hover td {
    background: rgba(255, 191, 0, 0.03);
}

.source-badge {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: var(--space-2);
}

/* ── Metric List ──────────────────────────────────────── */
.metric-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.metric-list li {
    display: flex;
    justify-content: space-between;
    padding: var(--space-3) 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    font-family: var(--font-head);
    font-size: var(--text-sm);
}

.metric-list li:last-child {
    border-bottom: none;
}

.metric-label {
    color: rgba(255, 255, 255, 0.6);
}

.metric-value {
    font-weight: 700;
    color: white;
}

.metric-value--amber {
    color: var(--color-amber);
}

/* ── Responsive ───────────────────────────────────────── */
@media (max-width: 900px) {
    .kpi-grid {
        grid-template-columns: repeat(2, 1fr);
    }

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

    .funnel-stages {
        flex-direction: column;
        gap: var(--space-4);
    }

    .funnel-stage:nth-child(1) .funnel-bar,
    .funnel-stage:nth-child(2) .funnel-bar,
    .funnel-stage:nth-child(3) .funnel-bar,
    .funnel-stage:nth-child(4) .funnel-bar {
        width: 100%;
    }

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

@media (max-width: 480px) {
    .kpi-grid {
        grid-template-columns: 1fr;
    }

    .analytics-header__inner {
        flex-direction: column;
        gap: var(--space-3);
    }

    .bar-chart {
        height: 150px;
    }
}