/* css/page-stats.css */
@layer pages {

    /* ── Hero ── */
    .st-hero {
        text-align: center;
        padding: 3rem 0 2.5rem;
    }

    .st-hero .page-sub {
        margin: 0 auto;
    }

    /* ── KPI Strip ── */
    .st-kpi-strip {
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        gap: 1rem;
        margin-bottom: 1.5rem;
    }

    .st-kpi-tile {
        background: linear-gradient(145deg, #fff 0%, #f4f7ff 100%);
        border: 1.5px solid rgba(255, 255, 255, 0.85);
        border-radius: 22px 18px 22px 16px / 18px 22px 16px 22px;
        box-shadow: 0 6px 0 rgba(180, 200, 230, 0.45), 0 2px 16px rgba(100, 120, 200, 0.08);
        padding: 1.4rem 1.3rem 1.2rem;
        position: relative;
        overflow: hidden;
    }

    .st-kpi-tile::before {
        content: '';
        position: absolute;
        top: -18px; right: -18px;
        width: 72px; height: 72px;
        border-radius: 50%;
        background: radial-gradient(circle, rgba(255, 255, 255, 0.9) 0%, transparent 70%);
    }

    .st-kpi-num {
        font-size: 2.6rem;
        font-weight: 800;
        letter-spacing: -0.055em;
        line-height: 1;
        color: var(--color-text);
        margin-bottom: 4px;
    }

    .st-kpi-lbl {
        font-size: 0.58rem;
        font-weight: 700;
        letter-spacing: 0.12em;
        color: var(--color-lbl);
        margin-bottom: 8px;
    }

    .st-kpi-delta {
        display: inline-flex;
        align-items: center;
        gap: 4px;
        font-size: 0.65rem;
        font-weight: 600;
        color: var(--color-green-d);
        background: var(--color-green-bg);
        border-radius: var(--radius-pill);
        padding: 2px 9px;
    }

    .st-kpi-delta--up    { color: var(--color-green-d); background: var(--color-green-bg); }
    .st-kpi-delta--neutral { color: var(--color-sub); background: var(--color-surface2); }

    /* ── Body grid ── */
    .st-body {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 1.2rem;
        margin-bottom: 1.5rem;
    }

    .st-col {
        display: flex;
        flex-direction: column;
        gap: 1.2rem;
    }

    /* ── Matching quality tiles ── */
    .st-mq-grid {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 0.8rem;
    }

    .st-mq-tile {
        background: var(--color-surface2);
        border: 1px solid var(--color-border);
        border-radius: 14px;
        padding: 1rem 0.8rem;
        text-align: center;
    }

    .st-mq-num {
        font-size: 2rem;
        font-weight: 800;
        letter-spacing: -0.04em;
        line-height: 1;
        margin-bottom: 4px;
    }

    .st-mq-tile--green .st-mq-num { color: var(--color-green-d); }
    .st-mq-tile--blue  .st-mq-num { color: var(--color-blue-d); }
    .st-mq-tile--purple .st-mq-num { color: var(--color-purple-d); }

    .st-mq-lbl {
        font-size: 0.58rem;
        font-weight: 700;
        letter-spacing: 0.1em;
        color: var(--color-lbl);
        margin-bottom: 3px;
    }

    .st-mq-note {
        font-size: 0.65rem;
        color: var(--color-sub);
    }

    /* ── Pipeline funnel ── */
    .st-funnel {
        display: flex;
        flex-direction: column;
        gap: 0;
    }

    .st-funnel-stage {
        display: flex;
        align-items: center;
        gap: 10px;
    }

    .st-funnel-bar-wrap {
        flex: 1;
    }

    .st-funnel-track {
        height: 32px;
        width: 100%;
        border-radius: 10px;
        background: var(--color-surface2);
        border: 1px solid var(--color-border);
        position: relative;
        overflow: hidden;
    }

    .st-funnel-fill {
        position: absolute;
        left: 0; top: 0; bottom: 0;
        border-radius: 10px;
        box-shadow: inset 0 2px 4px rgba(255, 255, 255, 0.7);
        display: flex;
        align-items: center;
        padding-left: 10px;
        min-width: 60px;
    }

    .st-funnel-fill-lbl {
        font-size: 0.62rem;
        font-weight: 700;
        color: #fff;
        letter-spacing: 0.04em;
        white-space: nowrap;
    }

    .st-funnel-fill--applied   { background: linear-gradient(90deg, var(--color-blue), #88b8fc); }
    .st-funnel-fill--requested { background: linear-gradient(90deg, var(--color-purple), #b898f0); }
    .st-funnel-fill--connected { background: linear-gradient(90deg, var(--color-green), #70e0a0); }
    .st-funnel-fill--closed    { background: linear-gradient(90deg, #bbb, #ddd); }
    .st-funnel-fill--closed .st-funnel-fill-lbl { color: #666; }

    .st-funnel-meta {
        width: 52px;
        text-align: right;
        flex-shrink: 0;
    }

    .st-funnel-count {
        font-size: 1rem;
        font-weight: 800;
        color: var(--color-text);
        line-height: 1;
    }

    .st-funnel-pct {
        font-size: 0.6rem;
        color: var(--color-lbl);
    }

    .st-funnel-connector {
        width: 2px;
        height: 6px;
        background: var(--color-border);
        margin: 0 auto 0 calc(50% - 30px);
        border-radius: 2px;
    }

    /* ── Tech bars ── */
    .st-tech-legend {
        font-size: 0.65rem;
        color: var(--color-sub);
        margin-bottom: 1rem;
    }

    .st-tech-row {
        display: flex;
        align-items: center;
        gap: 1ch;
        margin-bottom: 0.55em;
    }

    .st-tech-row:last-child { margin-bottom: 0; }

    .st-tech-name {
        font-size: 0.78rem;
        font-weight: 600;
        color: var(--color-text);
        width: 10ch;
        flex-shrink: 0;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .st-tech-track {
        flex: 1;
        height: 6px;
        background: var(--color-surface2);
        border: 1px solid var(--color-border);
        position: relative;
        overflow: hidden;
        border-radius: 4px;
    }

    .st-tech-fill {
        position: absolute;
        left: 0; top: 0; bottom: 0;
        border-radius: 4px;
    }

    .st-tech-fill--demand { background: linear-gradient(90deg, var(--color-purple), var(--color-purple-l)); }
    .st-tech-fill--supply { background: linear-gradient(90deg, var(--color-green-d), var(--color-green)); }

    .st-tech-num {
        font-size: 0.72rem;
        font-weight: 600;
        color: var(--color-sub);
        width: 10ch;
        text-align: right;
        flex-shrink: 0;
        white-space: nowrap;
    }

    .st-tech-unit {
        color: var(--color-lbl);
        font-weight: 400;
    }

    /* ── Empty state ── */
    .st-empty {
        font-size: 0.82rem;
        color: var(--color-sub);
        padding: 0.5em 0;
    }

    /* ── Bottom CTA pair ── */
    .st-cta-pair {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 1.2rem;
        margin-top: 0.5rem;
    }

    .st-cta-card {
        background: linear-gradient(145deg, var(--color-green-bg) 0%, #d4f5e2 100%);
        border: 1.5px solid var(--color-green-l);
        border-radius: 22px 18px 22px 18px / 18px 22px 18px 22px;
        box-shadow: 0 6px 0 rgba(62, 203, 116, 0.3), 0 2px 16px rgba(40, 160, 80, 0.08);
        padding: 2rem 1.8rem;
        display: flex;
        flex-direction: column;
        gap: 0.75rem;
    }

    .st-cta-card--purple {
        background: linear-gradient(145deg, var(--color-purple-bg) 0%, #ede8ff 100%);
        border-color: var(--color-purple-l);
        box-shadow: 0 6px 0 rgba(152, 120, 232, 0.3), 0 2px 16px rgba(80, 48, 168, 0.08);
    }

    .st-cta-tag {
        font-size: 0.58rem;
        font-weight: 700;
        letter-spacing: 0.12em;
        color: var(--color-green-d);
        text-transform: uppercase;
    }

    .st-cta-card--purple .st-cta-tag { color: var(--color-purple-d); }

    .st-cta-title {
        font-size: 1.3rem;
        font-weight: 800;
        letter-spacing: -0.03em;
        line-height: 1.2;
        color: var(--color-text);
    }

    .st-cta-body {
        font-size: 0.8rem;
        color: var(--color-sub);
        line-height: 1.6;
    }

    .st-cta-btn {
        display: inline-block;
        padding: 0.6em 1.4em;
        font-size: 0.7rem;
        font-weight: 700;
        letter-spacing: 0.06em;
        color: #fff;
        text-decoration: none;
        border-radius: var(--radius-pill);
        background: linear-gradient(160deg, #50d890, var(--color-green));
        box-shadow: 0 4px 0 var(--color-green-d), 0 6px 16px rgba(40, 160, 80, 0.3);
        align-self: flex-start;
        transition: transform 0.1s, box-shadow 0.1s;
    }

    .st-cta-btn:hover { transform: translateY(-2px); box-shadow: 0 6px 0 var(--color-green-d), 0 8px 20px rgba(40, 160, 80, 0.35); }
    .st-cta-btn:active { transform: translateY(2px); box-shadow: 0 2px 0 var(--color-green-d); }

    .st-cta-btn--purple {
        background: linear-gradient(160deg, #b898f0, var(--color-purple));
        box-shadow: 0 4px 0 var(--color-purple-d), 0 6px 16px rgba(80, 48, 168, 0.3);
    }

    .st-cta-btn--purple:hover { box-shadow: 0 6px 0 var(--color-purple-d), 0 8px 20px rgba(80, 48, 168, 0.35); }
    .st-cta-btn--purple:active { box-shadow: 0 2px 0 var(--color-purple-d); }

    .st-cta-note {
        font-size: 0.62rem;
        color: var(--color-lbl);
    }

    /* ── Responsive ── */
    @media (max-width: 768px) {
        .st-kpi-strip { grid-template-columns: 1fr 1fr; }
        .st-body { grid-template-columns: 1fr; }
        .st-cta-pair { grid-template-columns: 1fr; }
        .st-mq-grid { grid-template-columns: repeat(3, 1fr); }
    }

}
