.king-addons-kpi-tiles {
    --kng-kpi-up-color: #16a34a;
    --kng-kpi-down-color: #dc2626;
    --kng-kpi-flat-color: #6b7280;
    --kng-kpi-trend-color: var(--kng-kpi-flat-color);
    color: #111827;
}

.king-addons-kpi-tiles__grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 20px;
}

.king-addons-kpi-tiles__card {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 20px;
    background-color: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    box-shadow: 0 18px 38px rgba(15, 23, 42, 0.08);
    transition: transform 0.25s ease, box-shadow 0.25s ease, background-color 0.2s ease;
}

.king-addons-kpi-tiles__card:hover {
    box-shadow: 0 24px 48px rgba(15, 23, 42, 0.14);
}

.king-addons-kpi-tiles__card--link {
    cursor: pointer;
}

.king-addons-kpi-tiles__card--link:focus-visible {
    outline: 2px solid var(--kng-kpi-trend-color);
    outline-offset: 2px;
}

.elementor-editor-active .king-addons-kpi-tiles__card--link {
    cursor: default;
}

.king-addons-kpi-tiles--equal-height .king-addons-kpi-tiles__card {
    height: 100%;
}

.king-addons-kpi-tiles__card--up {
    --kng-kpi-trend-color: var(--kng-kpi-up-color);
}

.king-addons-kpi-tiles__card--down {
    --kng-kpi-trend-color: var(--kng-kpi-down-color);
}

.king-addons-kpi-tiles__card--flat {
    --kng-kpi-trend-color: var(--kng-kpi-flat-color);
}

.king-addons-kpi-tiles__title {
    font-size: 14px;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.king-addons-kpi-tiles__value {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 4px;
    font-size: 28px;
    font-weight: 700;
    color: #111827;
}

.king-addons-kpi-tiles__value-prefix,
.king-addons-kpi-tiles__value-suffix {
    font-size: 16px;
    font-weight: 600;
    color: #6b7280;
}

.king-addons-kpi-tiles__delta {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
    color: var(--kng-kpi-trend-color);
}

.king-addons-kpi-tiles__delta-prefix,
.king-addons-kpi-tiles__delta-suffix {
    opacity: 0.7;
}

.king-addons-kpi-tiles__delta-icon {
    display: inline-flex;
    width: 16px;
    height: 16px;
    align-items: center;
    justify-content: center;
}

.king-addons-kpi-tiles__delta-icon svg {
    width: 100%;
    height: 100%;
}

.king-addons-kpi-tiles__delta-period {
    color: #6b7280;
    font-weight: 500;
}

.king-addons-kpi-tiles__sparkline {
    display: flex;
    align-items: center;
}

.king-addons-kpi-tiles__sparkline-svg {
    width: 100%;
    height: 42px;
}

.king-addons-kpi-tiles__sparkline--invalid {
    padding: 6px 10px;
    border: 1px dashed #d1d5db;
    border-radius: 8px;
    color: #9ca3af;
    font-size: 12px;
}

.king-addons-kpi-tiles__sparkline-line {
    fill: none;
    stroke: var(--kng-kpi-sparkline-color, var(--kng-kpi-trend-color));
    stroke-width: 2px;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.king-addons-kpi-tiles__sparkline-dot {
    fill: var(--kng-kpi-sparkline-color, var(--kng-kpi-trend-color));
}

.king-addons-kpi-tiles__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: auto;
    font-size: 13px;
}

.king-addons-kpi-tiles__secondary {
    color: #6b7280;
    font-weight: 500;
}

.king-addons-kpi-tiles__badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 999px;
    background-color: #eef2ff;
    color: #4338ca;
    font-size: 12px;
    font-weight: 600;
}

.king-addons-kpi-tiles--align-left .king-addons-kpi-tiles__card {
    align-items: flex-start;
    text-align: left;
}

.king-addons-kpi-tiles--align-center .king-addons-kpi-tiles__card {
    align-items: center;
    text-align: center;
}

.king-addons-kpi-tiles--align-center .king-addons-kpi-tiles__footer {
    justify-content: center;
}

.king-addons-kpi-tiles--align-right .king-addons-kpi-tiles__card {
    align-items: flex-end;
    text-align: right;
}

.king-addons-kpi-tiles--align-right .king-addons-kpi-tiles__footer {
    justify-content: flex-end;
}

.king-addons-kpi-tiles__empty {
    padding: 16px;
    border: 1px dashed #d1d5db;
    border-radius: 12px;
    color: #6b7280;
    text-align: center;
}
