/*
 * Custom Metabase KPI Card Styling
 *
 * Usage: In your SQL queries, use the pipe character to separate title and subtitle:
 *   SELECT count(*) AS "Churned Patients | Inactive for 90+ days"
 *
 * The JavaScript will split this into:
 *   Title: "Churned Patients"
 *   Subtitle: "Inactive for 90+ days"
 */

/* Container for the split title */
.custom-kpi-title {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    line-height: 1.2;
}

/* Main title styling */
.custom-kpi-title .main-title {
    font-size: 1em;
    font-weight: 600;
    color: inherit;
}

/* Subtitle styling - smaller and muted */
.custom-kpi-title .subtitle {
    font-size: 0.7em;
    font-weight: 400;
    color: #6c757d;
    margin-top: 2px;
}

/* Ensure the scalar title container allows wrapping */
[data-testid="scalar-title"],
.ScalarTitle,
.Scalar-title {
    white-space: normal !important;
    overflow: visible !important;
    text-overflow: unset !important;
}

/* Dashboard card title adjustments */
.DashCard .CardVisualization .ScalarTitle {
    min-height: 2.5em;
}

/* KPI Card Value Colors - matching Patient Churn Weekly Trend chart */
.kpi-color-active [data-testid="scalar-value"],
.kpi-color-active .ScalarValue,
.kpi-color-active [class*="ScalarValue"] {
    color: #88BF4D !important;
}

.kpi-color-at-risk [data-testid="scalar-value"],
.kpi-color-at-risk .ScalarValue,
.kpi-color-at-risk [class*="ScalarValue"] {
    color: #F9D45C !important;
}

.kpi-color-high-risk [data-testid="scalar-value"],
.kpi-color-high-risk .ScalarValue,
.kpi-color-high-risk [class*="ScalarValue"] {
    color: #F2A86F !important;
}

.kpi-color-probably-churning [data-testid="scalar-value"],
.kpi-color-probably-churning .ScalarValue,
.kpi-color-probably-churning [class*="ScalarValue"] {
    color: #509EE3 !important;
}

.kpi-color-churning [data-testid="scalar-value"],
.kpi-color-churning .ScalarValue,
.kpi-color-churning [class*="ScalarValue"] {
    color: #E75A5A !important;
}
