/* =========================================================
   03 — Dashboard Metrics
   ========================================================= */

.dashboard-metrics {
    display: grid;
    grid-template-columns:
        minmax(150px, 0.95fr)
        minmax(170px, 1.05fr)
        minmax(150px, 0.95fr)
        minmax(165px, 1fr)
        minmax(210px, 1.35fr);

    gap: 0.65rem;

    width: 100%;

    margin-top: 0.75rem;
    margin-bottom: 0.75rem;
}

/* =========================================================
   Metric Card
   ========================================================= */

.metric-card {
    display: flex;
    align-items: center;
    gap: 0.7rem;

    min-width: 0;
    min-height: 78px;

    padding: 0.7rem 0.8rem;

    background: var(--dashboard-surface, #ffffff);

    border: 1px solid
        var(--dashboard-border, #dfe5ec);

    border-radius: 0.6rem;

    box-shadow:
        0 1px 2px rgba(15, 23, 42, 0.03);

    overflow: hidden;
}


/* =========================================================
   Icon
   ========================================================= */

.metric-card__icon {
    display: flex;
    align-items: center;
    justify-content: center;

    flex: 0 0 38px;

    width: 38px;
    height: 38px;

    border-radius: 0.55rem;
}

.metric-card__icon svg {
    width: 20px;
    height: 20px;

    fill: none;
    stroke: currentColor;

    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.metric-card__icon--purple {
    color: #7c3aed;
    background: #f1eafe;
}

.metric-card__icon--green {
    color: #16875d;
    background: #e0f4eb;
}

.metric-card__icon--blue {
    color: #345bc6;
    background: #e7ecfb;
}

.metric-card__icon--teal {
    color: #157a78;
    background: #e0f2f1;
}


/* =========================================================
   Content
   ========================================================= */

.metric-card__body {
    min-width: 0;
    width: 100%;
}

.metric-card__heading {
    display: flex;
    align-items: center;

    margin-bottom: 0.15rem;

    color: var(
        --dashboard-text-muted,
        #667085
    );

    font-size: 0.63rem;
    font-weight: 700;
    line-height: 1.2;

    white-space: nowrap;
}

.metric-card__primary {
    color: var(
        --dashboard-text,
        #172033
    );

    font-size: 1.05rem;
    font-weight: 800;
    line-height: 1.15;

    letter-spacing: -0.025em;
}

.metric-card__meta {
    margin-top: 0.1rem;

    color: var(
        --dashboard-text-muted,
        #697386
    );

    font-size: 0.57rem;
    font-weight: 500;
    line-height: 1.2;
}

.metric-card__submeta {
    margin-top: 0.1rem;

    color: var(
        --dashboard-text-soft,
        #98a2b3
    );

    font-size: 0.52rem;
    line-height: 1.2;
}


/* =========================================================
   Seats
   ========================================================= */

.metric-card__body--seats {
    display: flex;
    flex-direction: column;
}

.metric-seats {
    display: flex;
    align-items: center;

    margin-top: 0.05rem;
}

.metric-seats__party {
    display: flex;
    align-items: baseline;
    gap: 0.3rem;
}

.metric-seats__label {
    font-size: 0.56rem;
    font-weight: 800;
}

.metric-seats__label--jlp {
    color: #15875c;
}

.metric-seats__label--pnp {
    color: #e56b22;
}

.metric-seats__value {
    color: var(
        --dashboard-text,
        #172033
    );

    font-size: 1.05rem;
    line-height: 1;
}

.metric-seats__divider {
    width: 1px;
    height: 19px;

    margin: 0 0.6rem;

    background: var(
        --dashboard-border,
        #dde3ea
    );
}


/* =========================================================
   Vote Share
   ========================================================= */

.metric-card--vote-share {
    padding-right: 0.85rem;
}

.vote-share {
    display: grid;
    gap: 0.3rem;

    margin-top: 0.35rem;
}

.vote-share__row {
    display: grid;
    grid-template-columns:
        34px
        minmax(55px, 1fr)
        37px;

    align-items: center;

    gap: 0.35rem;
}

.vote-share__party {
    color: var(
        --dashboard-text-muted,
        #667085
    );

    font-size: 0.52rem;
    font-weight: 700;
}

.vote-share__track {
    position: relative;

    height: 4px;

    background: #e7eaf0;

    border-radius: 999px;

    overflow: hidden;
}

.vote-share__bar {
    position: absolute;
    inset: 0 auto 0 0;

    display: block;

    border-radius: 999px;
}

.vote-share__bar--jlp {
    background: #16875d;
}

.vote-share__bar--pnp {
    background: #f07b2b;
}

.vote-share__bar--other {
    background: #8d99a8;
}

.vote-share__value {
    color: var(
        --dashboard-text,
        #344054
    );

    font-size: 0.5rem;
    font-weight: 700;

    text-align: right;
}


/* =========================================================
   Dark Mode
   ========================================================= */

[data-theme="dark"] .metric-card {
    background: var(
        --dashboard-surface,
        #172033
    );

    border-color: var(
        --dashboard-border,
        #2d394c
    );

    box-shadow: none;
}

[data-theme="dark"] .metric-card__primary,
[data-theme="dark"] .metric-seats__value,
[data-theme="dark"] .vote-share__value {
    color: #f8fafc;
}

[data-theme="dark"] .metric-card__heading,
[data-theme="dark"] .metric-card__meta,
[data-theme="dark"] .vote-share__party {
    color: #aab4c3;
}

[data-theme="dark"] .metric-card__submeta {
    color: #778397;
}

[data-theme="dark"] .vote-share__track {
    background: #344054;
}


/* =========================================================
   Responsive
   ========================================================= */

@media (max-width: 1180px) {

    .dashboard-metrics {
        grid-template-columns:
            repeat(3, minmax(0, 1fr));
    }

    .metric-card--vote-share {
        grid-column: span 2;
    }

}


@media (max-width: 760px) {

    .dashboard-metrics {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

    .metric-card--vote-share {
        grid-column: span 2;
    }

}


@media (max-width: 520px) {

    .dashboard-metrics {
        grid-template-columns: 1fr;
    }

    .metric-card--vote-share {
        grid-column: auto;
    }

}
/* =========================================================
   A — Dynamic Metric States
   ========================================================= */

.metric-card--vote-share
.metric-card__heading {
    white-space: normal;

    line-height: 1.25;
}


.metric-card__primary--compact {
    font-size: 0.82rem;

    letter-spacing: -0.02em;
}


.metric-card__submeta:empty {
    display: none;
}