/* ═══════════════════════════════════════════════════════════
   SALES PORTAL — shared styling for every /sales-portal page.
   Ported from the standalone Sales Performance Hub so the
   feature keeps its visual identity inside CloudBlue.
   All rules are namespaced under .sph- to stay isolated.
═══════════════════════════════════════════════════════════ */

.sph {
    --sph-primary: #3d5aff;
    --sph-primary-light: rgba(61, 90, 255, .1);
    --sph-success: #10b981;
    --sph-danger: #ef4444;
    --sph-warning: #f59e0b;
    --sph-navy: #1F4E8C;
    --sph-cyan: #00D4F5;
    --sph-billion: #f59e0b;
    --sph-golden: #3d5aff;
    --sph-emmering: #8b5cf6;
    --sph-bg: #f0f4f8;
    --sph-surface: #ffffff;
    --sph-border: rgba(0, 0, 0, .07);
    --sph-text: #1e293b;
    --sph-text-2: #475569;
    --sph-muted: #94a3b8;
    --sph-gold: #d97706;
    --sph-silver: #94a3b8;
    --sph-bronze: #c2794a;
    --sph-shadow-sm: 0 1px 3px rgba(0, 0, 0, .06), 0 1px 2px rgba(0, 0, 0, .04);
    --sph-shadow-md: 0 4px 16px rgba(0, 0, 0, .06), 0 2px 6px rgba(0, 0, 0, .04);
    color: var(--sph-text);
    font-size: 14px;
}

/* ── Sub navigation ───────────────────────────────────── */
.sph-nav {
    display: flex;
    align-items: center;
    gap: .35rem;
    flex-wrap: wrap;
    background: var(--sph-surface);
    border: 1px solid var(--sph-border);
    border-radius: 12px;
    padding: .4rem;
    margin-bottom: 1rem;
    box-shadow: var(--sph-shadow-sm);
}

.sph-nav-item {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .45rem .95rem;
    border-radius: 8px;
    font-size: .82rem;
    font-weight: 700;
    color: var(--sph-text-2);
    text-decoration: none;
    white-space: nowrap;
    transition: background .18s ease, color .18s ease;
}

.sph-nav-item:hover {
    background: var(--sph-primary-light);
    color: var(--sph-primary);
    text-decoration: none;
}

.sph-nav-item.active {
    background: var(--sph-navy);
    color: #fff;
}

.sph-nav-spacer {
    margin-left: auto;
}

/* ── Page heading ─────────────────────────────────────── */
.sph-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: .75rem;
    margin-bottom: .85rem;
}

.sph-head h2 {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--sph-text);
}

.sph-head p {
    margin: .25rem 0 0;
    font-size: .78rem;
    color: var(--sph-muted);
}

.sph-stamp {
    font-size: .72rem;
    color: var(--sph-muted);
    background: var(--sph-surface);
    border: 1px solid var(--sph-border);
    padding: .4rem .85rem;
    border-radius: 8px;
}

/* ── Filter bar ───────────────────────────────────────── */
.sph-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .6rem;
    margin-bottom: 1.1rem;
}

.sph-filters label {
    font-size: .72rem;
    font-weight: 700;
    color: var(--sph-text-2);
    text-transform: uppercase;
    letter-spacing: .04em;
}

/* ── Grand banner ─────────────────────────────────────── */
.sph-banner {
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1.5rem;
    padding: 1.75rem 2rem;
    margin-bottom: 1.5rem;
    border-radius: 18px;
    background: linear-gradient(130deg, #0D2458 0%, #1F4E8C 55%, #3d5aff 100%);
    box-shadow: 0 6px 24px rgba(31, 78, 140, .28);
}

.sph-banner::before,
.sph-banner::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
}

.sph-banner::before {
    top: -50px;
    right: 90px;
    width: 220px;
    height: 220px;
    background: rgba(255, 255, 255, .06);
}

.sph-banner::after {
    bottom: -60px;
    right: -30px;
    width: 190px;
    height: 190px;
    background: rgba(255, 255, 255, .04);
}

.sph-banner-left {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    gap: .2rem;
}

.sph-banner-subtitle {
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, .7);
}

.sph-banner-title {
    margin: .2rem 0 0;
    font-size: 2.3rem;
    font-weight: 900;
    letter-spacing: -.02em;
    color: #fff;
    line-height: 1.1;
}

.sph-banner-desc {
    margin: .2rem 0 0;
    font-size: .8rem;
    color: rgba(255, 255, 255, .72);
}

.sph-banner-stats {
    position: relative;
    z-index: 1;
    display: flex;
    gap: 2.5rem;
    flex-wrap: wrap;
    align-items: flex-start;
}

.sph-banner-stat {
    text-align: right;
    cursor: pointer;
    transition: transform .2s ease, opacity .2s ease;
    text-decoration: none;
}

.sph-banner-stat:hover {
    opacity: .82;
    transform: translateY(-2px);
    text-decoration: none;
}

.sph-banner-stat + .sph-banner-stat {
    border-left: 1px solid rgba(255, 255, 255, .18);
    padding-left: 2.5rem;
}

.sph-banner-stat-label {
    display: block;
    font-size: .66rem;
    font-weight: 700;
    letter-spacing: .09em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, .6);
}

.sph-banner-stat-value {
    display: block;
    font-size: 1.8rem;
    font-weight: 900;
    line-height: 1.2;
    color: #fff;
}

.sph-banner-stat-sub {
    display: block;
    margin-top: 2px;
    font-size: .68rem;
    font-weight: 600;
    color: rgba(255, 255, 255, .6);
}

/* ── Cards ────────────────────────────────────────────── */
.sph-card {
    background: var(--sph-surface);
    border: 1px solid var(--sph-border);
    border-radius: 14px;
    padding: 1.1rem 1.25rem;
    box-shadow: var(--sph-shadow-sm);
}

.sph-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    margin-bottom: .9rem;
}

.sph-card-head h3,
.sph-card-head h4 {
    margin: 0;
    font-size: .95rem;
    font-weight: 800;
    color: var(--sph-text);
    display: flex;
    align-items: center;
    gap: .45rem;
}

.sph-card-note {
    font-size: .7rem;
    color: var(--sph-muted);
}

/* ── KPI cards ────────────────────────────────────────── */
.sph-kpi-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.sph-kpi {
    display: flex;
    align-items: center;
    gap: .9rem;
    background: var(--sph-surface);
    border: 1px solid var(--sph-border);
    border-radius: 14px;
    padding: 1.1rem 1.25rem;
    cursor: pointer;
    box-shadow: var(--sph-shadow-sm);
    transition: transform .2s ease, box-shadow .2s ease;
    text-decoration: none;
    color: inherit;
}

.sph-kpi:hover {
    transform: translateY(-3px);
    box-shadow: var(--sph-shadow-md);
    text-decoration: none;
    color: inherit;
}

.sph-kpi-icon {
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    border-radius: 12px;
    display: grid;
    place-items: center;
    font-size: 1.25rem;
}

.sph-kpi-icon.blue { background: rgba(61, 90, 255, .12); color: var(--sph-primary); }
.sph-kpi-icon.green { background: rgba(16, 185, 129, .12); color: var(--sph-success); }
.sph-kpi-icon.yellow { background: rgba(245, 158, 11, .12); color: var(--sph-warning); }
.sph-kpi-icon.red { background: rgba(239, 68, 68, .12); color: var(--sph-danger); }

.sph-kpi-label {
    font-size: .74rem;
    font-weight: 600;
    color: var(--sph-muted);
    text-transform: uppercase;
    letter-spacing: .04em;
}

.sph-kpi-value {
    font-size: 1.65rem;
    font-weight: 900;
    line-height: 1.2;
    color: var(--sph-text);
}

.sph-badge {
    display: inline-block;
    padding: .16rem .55rem;
    border-radius: 6px;
    font-size: .68rem;
    font-weight: 700;
}

.sph-badge.default { background: rgba(61, 90, 255, .1); color: var(--sph-primary); }
.sph-badge.active { background: rgba(16, 185, 129, .12); color: var(--sph-success); }
.sph-badge.watch { background: rgba(245, 158, 11, .12); color: var(--sph-warning); }
.sph-badge.inactive { background: rgba(239, 68, 68, .12); color: var(--sph-danger); }
.sph-badge.transferred { background: rgba(139, 92, 246, .12); color: var(--sph-emmering); }
.sph-badge.billion { background: rgba(245, 158, 11, .1); color: var(--sph-billion); border: 1px solid rgba(245, 158, 11, .2); }
.sph-badge.golden { background: rgba(61, 90, 255, .1); color: var(--sph-golden); border: 1px solid rgba(61, 90, 255, .2); }
.sph-badge.emmering { background: rgba(139, 92, 246, .1); color: var(--sph-emmering); border: 1px solid rgba(139, 92, 246, .2); }

.sph-trend {
    display: inline-block;
    margin-top: 4px;
    font-size: .68rem;
    font-weight: 700;
}

.sph-trend.up { color: var(--sph-success); }
.sph-trend.down { color: var(--sph-danger); }

/* ── Grids ────────────────────────────────────────────── */
.sph-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
    margin-bottom: 1.5rem;
}

.sph-grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
    margin-bottom: 1.5rem;
}

@media (max-width: 1200px) {
    .sph-kpi-row { grid-template-columns: repeat(2, 1fr); }
    .sph-grid-3 { grid-template-columns: 1fr; }
    .sph-grid-2 { grid-template-columns: 1fr; }
}

/* ── Office rankings ──────────────────────────────────── */
.sph-rank-row {
    display: flex;
    align-items: center;
    gap: .85rem;
    padding: .6rem .2rem;
    border-bottom: 1px solid var(--sph-border);
}

.sph-rank-row:last-child { border-bottom: none; }

.sph-rank-num {
    width: 26px;
    height: 26px;
    flex-shrink: 0;
    border-radius: 8px;
    display: grid;
    place-items: center;
    font-size: .76rem;
    font-weight: 800;
    background: rgba(61, 90, 255, .1);
    color: var(--sph-primary);
}

.sph-rank-num.gold { background: rgba(217, 119, 6, .14); color: var(--sph-gold); }
.sph-rank-num.silver { background: rgba(148, 163, 184, .18); color: #64748b; }
.sph-rank-num.bronze { background: rgba(194, 121, 74, .16); color: var(--sph-bronze); }

.sph-rank-info { flex: 1; min-width: 0; }

.sph-rank-name {
    display: block;
    font-size: .85rem;
    font-weight: 700;
    color: var(--sph-text);
}

.sph-rank-sub {
    display: block;
    font-size: .71rem;
    color: var(--sph-muted);
}

.sph-progress {
    margin-top: .35rem;
    height: 5px;
    border-radius: 999px;
    background: rgba(0, 0, 0, .06);
    overflow: hidden;
}

.sph-progress-fill {
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--sph-navy), var(--sph-primary));
}

.sph-rank-value {
    font-size: .8rem;
    font-weight: 800;
    color: var(--sph-success);
    white-space: nowrap;
}

/* ── Tables ───────────────────────────────────────────── */
.sph-table-wrap {
    overflow-x: auto;
    border-radius: 14px;
    border: 1px solid var(--sph-border);
    background: var(--sph-surface);
    box-shadow: var(--sph-shadow-sm);
}

.sph-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .82rem;
}

.sph-table thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: #f6f8fc;
    color: var(--sph-text-2);
    font-size: .71rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .04em;
    text-align: left;
    white-space: nowrap;
    padding: .7rem .85rem;
    border-bottom: 1px solid var(--sph-border);
}

.sph-table tbody td {
    padding: .6rem .85rem;
    border-bottom: 1px solid var(--sph-border);
    vertical-align: middle;
}

.sph-table tbody tr:last-child td { border-bottom: none; }

.sph-table tbody tr.clickable { cursor: pointer; }

.sph-table tbody tr:hover { background: rgba(61, 90, 255, .04); }

.sph-cell-index {
    font-weight: 700;
    color: var(--sph-muted);
    font-size: .75rem;
}

.sph-cell-name {
    font-weight: 700;
    font-size: .85rem;
    color: var(--sph-primary);
}

.sph-cell-sub {
    font-size: .7rem;
    color: var(--sph-muted);
}

.sph-cell-money {
    font-weight: 800;
    color: var(--sph-success);
    white-space: nowrap;
}

.sph-chip {
    display: inline-block;
    padding: .18rem .55rem;
    border-radius: 6px;
    font-size: .75rem;
    font-weight: 700;
    background: #eff2ff;
    color: var(--sph-primary);
    white-space: nowrap;
}

.sph-sortable {
    cursor: pointer;
    user-select: none;
}

.sph-empty {
    padding: 2rem;
    text-align: center;
    color: var(--sph-muted);
    font-size: .85rem;
}

/* ── Club cards ───────────────────────────────────────── */
.sph-clubs {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
    margin-bottom: 1.5rem;
}

@media (max-width: 900px) {
    .sph-clubs { grid-template-columns: 1fr; }
}

.sph-club {
    position: relative;
    overflow: hidden;
    padding: 1.4rem 1.5rem;
    border-radius: 18px;
    cursor: pointer;
    background: var(--sph-surface);
    border: 1px solid var(--sph-border);
    box-shadow: var(--sph-shadow-sm);
    transition: transform .2s ease, box-shadow .2s ease;
}

.sph-club:hover {
    transform: translateY(-3px);
    box-shadow: var(--sph-shadow-md);
}

.sph-club::before {
    content: '';
    position: absolute;
    top: -60px;
    right: -40px;
    width: 160px;
    height: 160px;
    border-radius: 50%;
    opacity: .12;
}

.sph-club.billion::before { background: var(--sph-billion); }
.sph-club.golden::before { background: var(--sph-golden); }
.sph-club.emmering::before { background: var(--sph-emmering); }

.sph-club.selected { border-width: 2px; }
.sph-club.billion.selected { border-color: var(--sph-billion); }
.sph-club.golden.selected { border-color: var(--sph-golden); }
.sph-club.emmering.selected { border-color: var(--sph-emmering); }

.sph-club-icon { font-size: 1.7rem; }

.sph-club-title {
    margin-top: .35rem;
    font-size: 1.05rem;
    font-weight: 900;
}

.sph-club.billion .sph-club-title { color: var(--sph-billion); }
.sph-club.golden .sph-club-title { color: var(--sph-golden); }
.sph-club.emmering .sph-club-title { color: var(--sph-emmering); }

.sph-club-criteria {
    font-size: .74rem;
    color: var(--sph-muted);
}

.sph-club-count {
    margin-top: .6rem;
    font-size: 1.4rem;
    font-weight: 900;
    color: var(--sph-text);
}

.sph-club-share {
    margin-top: .35rem;
    font-size: .8rem;
    font-weight: 600;
    color: var(--sph-text-2);
}

/* ── Summary widget (reservation / contract) ──────────── */
.sph-summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.25rem;
    border-radius: 14px;
    border: 1px solid var(--sph-border);
    background: linear-gradient(135deg, rgba(61, 90, 255, .05) 0%, rgba(31, 78, 140, .1) 100%);
}

.sph-summary-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    font-size: 1.4rem;
    background: rgba(61, 90, 255, .1);
    color: var(--sph-primary);
}

.sph-summary-label {
    font-size: .72rem;
    font-weight: 700;
    color: var(--sph-text-2);
    text-transform: uppercase;
    letter-spacing: .05em;
    margin-bottom: .25rem;
}

.sph-summary-count {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--sph-text);
}

.sph-summary-volume {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--sph-success);
}

.sph-summary-sep {
    width: 1px;
    height: 28px;
    background: var(--sph-border);
}

/* ── Status donut cards ───────────────────────────────── */
.sph-status-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: .75rem;
    margin-bottom: 1.25rem;
}

.sph-status-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .6rem;
    padding: 1rem;
    text-align: center;
    border-radius: 12px;
    background: var(--sph-surface);
    border: 1px solid var(--sph-border);
    cursor: pointer;
    transition: transform .2s ease, box-shadow .2s ease;
}

.sph-status-card:hover { transform: translateY(-3px); }

.sph-status-card.selected {
    border-width: 2.5px;
    transform: translateY(-2px);
}

.sph-status-ring {
    position: relative;
    width: 80px;
    height: 80px;
}

.sph-status-ring-pct {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    font-size: .85rem;
    font-weight: 800;
    color: var(--sph-text);
}

.sph-status-name {
    font-size: .76rem;
    font-weight: 700;
    line-height: 1.25;
    min-height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    word-break: break-word;
}

.sph-status-count {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--sph-text);
}

/* ── Manager / team summary banner ────────────────────── */
.sph-team-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    padding: 1.25rem 2rem;
    margin-bottom: 1.25rem;
    border-radius: 18px;
    background: var(--sph-surface);
    border: 1px solid var(--sph-border);
    box-shadow: var(--sph-shadow-sm);
}

.sph-team-revenue {
    font-size: 2.1rem;
    font-weight: 900;
    letter-spacing: -.02em;
    color: var(--sph-text);
    line-height: 1;
}

.sph-team-metric {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--sph-text);
    text-align: right;
}

.sph-team-sep {
    width: 1px;
    height: 36px;
    background: var(--sph-border);
}

/* ── Time to first deal ───────────────────────────────── */
.sph-ttfd-value {
    font-size: 1.8rem;
    font-weight: 900;
    color: var(--sph-success);
    line-height: 1.2;
}

.sph-ttfd-label {
    font-size: .74rem;
    color: var(--sph-text-2);
}

.sph-ttfd-list {
    display: flex;
    flex-direction: column;
    gap: .35rem;
    margin-top: .8rem;
    max-height: 110px;
    overflow-y: auto;
}

.sph-ttfd-item {
    display: flex;
    justify-content: space-between;
    gap: .5rem;
    font-size: .75rem;
    padding: 2px 0;
    border-bottom: 1px solid var(--sph-border);
    color: var(--sph-danger);
    font-weight: 600;
}

/* ── Import page ──────────────────────────────────────── */
.sph-upload {
    border: 2px dashed rgba(61, 90, 255, .35);
    border-radius: 14px;
    padding: 1.5rem;
    background: rgba(61, 90, 255, .03);
    text-align: center;
}

.sph-note {
    font-size: .78rem;
    color: var(--sph-text-2);
    line-height: 1.6;
}

.sph-warning {
    background: linear-gradient(90deg, #fff7ed, #fef3c7);
    border: 1.5px solid var(--sph-warning);
    border-radius: 10px;
    padding: .7rem 1rem;
    font-size: .8rem;
    font-weight: 600;
    color: #92400e;
    margin-bottom: .6rem;
}

.sph-error {
    background: rgba(239, 68, 68, .08);
    border: 1.5px solid var(--sph-danger);
    border-radius: 10px;
    padding: .7rem 1rem;
    font-size: .8rem;
    font-weight: 600;
    color: #991b1b;
    margin-bottom: .6rem;
}

/* ── Sync countdown chip ──────────────────────────────── */
.sph-countdown {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    padding: .35rem .8rem;
    border-radius: 999px;
    font-size: .78rem;
    font-weight: 600;
    white-space: nowrap;
    border: 1px solid var(--sph-border);
    background: var(--sph-surface);
    color: var(--sph-text-2);
}

.sph-countdown b {
    font-variant-numeric: tabular-nums;
    font-weight: 800;
    color: var(--sph-text);
}

.sph-countdown-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    flex-shrink: 0;
    background: var(--sph-muted);
}

.sph-countdown.waiting .sph-countdown-dot { background: var(--sph-primary); }

.sph-countdown.soon {
    border-color: rgba(245, 158, 11, .4);
    background: rgba(245, 158, 11, .08);
}

.sph-countdown.soon .sph-countdown-dot { background: var(--sph-warning); }

.sph-countdown.running {
    border-color: rgba(16, 185, 129, .4);
    background: rgba(16, 185, 129, .08);
}

.sph-countdown.running .sph-countdown-dot {
    background: var(--sph-success);
    animation: sph-pulse 1.2s ease-in-out infinite;
}

.sph-countdown.off { opacity: .7; }

@keyframes sph-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: .35; transform: scale(1.35); }
}

/* ── Pager ────────────────────────────────────────────── */
.sph-pager {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: .75rem;
    margin-top: .75rem;
    padding: .6rem .9rem;
    border: 1px solid var(--sph-border);
    border-radius: 12px;
    background: var(--sph-surface);
    box-shadow: var(--sph-shadow-sm);
    font-size: .78rem;
    color: var(--sph-text-2);
}

.sph-pager-info b { color: var(--sph-text); }

.sph-pager-controls {
    display: flex;
    align-items: center;
    gap: .25rem;
    flex-wrap: wrap;
}

.sph-pager-btn {
    min-width: 32px;
    height: 32px;
    padding: 0 .5rem;
    border-radius: 8px;
    border: 1px solid var(--sph-border);
    background: var(--sph-surface);
    color: var(--sph-text-2);
    font-size: .78rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    cursor: pointer;
    transition: background .15s ease, color .15s ease, border-color .15s ease;
}

.sph-pager-btn:hover:not(:disabled):not(.active) {
    background: var(--sph-primary-light);
    border-color: var(--sph-border-hover, rgba(61, 90, 255, .3));
    color: var(--sph-primary);
}

.sph-pager-btn.active {
    background: var(--sph-navy);
    border-color: var(--sph-navy);
    color: #fff;
    cursor: default;
}

.sph-pager-btn:disabled {
    opacity: .4;
    cursor: not-allowed;
}

.sph-pager-gap {
    padding: 0 .2rem;
    color: var(--sph-muted);
}

.sph-pager-size {
    display: flex;
    align-items: center;
    gap: .5rem;
    white-space: nowrap;
}

/* ── Monthly sparkline card ───────────────────────────── */
.sph-spark-card {
    display: flex;
    flex-direction: column;
}

.sph-spark-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.sph-spark-value {
    font-size: 1.9rem;
    font-weight: 900;
    letter-spacing: -.02em;
    line-height: 1.1;
    color: var(--sph-text);
}

.sph-spark-label {
    margin-top: .15rem;
    font-size: .74rem;
    font-weight: 600;
    color: var(--sph-muted);
    text-transform: uppercase;
    letter-spacing: .05em;
}

.sph-spark-delta {
    display: inline-flex;
    align-items: baseline;
    gap: .3rem;
    padding: .3rem .7rem;
    border-radius: 999px;
    font-size: .78rem;
    font-weight: 800;
    white-space: nowrap;
}

.sph-spark-delta em {
    font-style: normal;
    font-weight: 600;
    opacity: .75;
}

.sph-spark-delta.up {
    background: rgba(16, 185, 129, .12);
    color: var(--sph-success);
}

.sph-spark-delta.down {
    background: rgba(239, 68, 68, .12);
    color: var(--sph-danger);
}

/* The chart fills whatever height the card has left, so the sparkline lines up
   with the office rankings card sitting next to it. */
.sph-spark-chart {
    flex: 1;
    min-height: 210px;
    margin-top: .5rem;
}
