/* Сетка KPI: max 6 в ряд на lg+; базовый shell — custom.css #js-trigger-home-admin-wrapper */

/* KPI: shell Home + одна тонкая полоса снизу (без верхнего inset и без glow) */
.nx-home-top-stats-row {
    --nx-apple-stat-radius: 16px;
    --nx-apple-accent-rgb: 90, 166, 255;
}

.nx-home-top-stats-row > [class*="col-"] {
    display: flex;
}

.nx-home-top-stats-row .nx-home-apple-stat-card {
    width: 100%;
    position: relative;
    isolation: isolate;
    overflow: hidden;
    transition:
        transform 0.45s cubic-bezier(0.25, 0.1, 0.25, 1),
        box-shadow 0.45s cubic-bezier(0.25, 0.1, 0.25, 1);
}

/* Убрать верхнюю «белую» линию из HOME shell (inset 0 1px 0 …) */
:is(html.midnight, html[data-bs-theme="midnight"])
    #js-trigger-home-admin-wrapper
    .nx-home-top-stats-row
    > [class*="col-"]
    > .nx-home-apple-stat-card {
    box-shadow:
        0 4px 24px -1px rgba(0, 0, 0, 0.16),
        0 12px 40px -8px rgba(0, 0, 0, 0.1) !important;
}

.nx-home-top-stats-row .nx-home-apple-stat-card > .card-body {
    position: relative;
    z-index: 1;
    background: transparent !important;
}

.nx-home-top-stats-row .nx-home-apple-stat-card:hover {
    transform: translateY(-2px);
}

/* Единственный accent — hairline снизу (не progress, без свечения) */
.nx-home-top-stats-row .nx-home-apple-stat-card::after {
    content: "";
    position: absolute;
    left: 14%;
    right: 14%;
    bottom: 0;
    height: 2px;
    z-index: 2;
    pointer-events: none;
    border-radius: 2px 2px 0 0;
    background: linear-gradient(
        90deg,
        rgba(var(--nx-apple-accent-rgb), 0) 0%,
        rgba(var(--nx-apple-accent-rgb), 0.5) 28%,
        rgba(var(--nx-apple-accent-rgb), 0.5) 72%,
        rgba(var(--nx-apple-accent-rgb), 0) 100%
    );
    opacity: 0.85;
    transition:
        opacity 0.45s ease,
        left 0.45s cubic-bezier(0.25, 0.1, 0.25, 1),
        right 0.45s cubic-bezier(0.25, 0.1, 0.25, 1);
}

.nx-home-top-stats-row .nx-home-apple-stat-card:hover::after {
    left: 10%;
    right: 10%;
    opacity: 1;
}

.nx-home-top-stats-row .nx-home-apple-stat-card .card-body .d-flex.p-10 {
    padding: 0.65rem 0.25rem 0.7rem !important;
    align-items: center !important;
}

.nx-home-top-stats-row .nx-home-apple-stat-card h2 {
    margin-bottom: 0.15rem !important;
    font-size: 1.45rem !important;
    font-weight: 600 !important;
    letter-spacing: -0.03em;
    line-height: 1.2;
    font-variant-numeric: tabular-nums;
    color: rgba(255, 255, 255, 0.96) !important;
}

.nx-home-top-stats-row .nx-home-apple-stat-card h6.text-muted {
    margin-bottom: 0 !important;
    font-size: 0.75rem !important;
    font-weight: 500 !important;
    letter-spacing: -0.01em;
    text-transform: none;
    line-height: 1.35;
    color: rgba(255, 255, 255, 0.52) !important;
}

.nx-home-top-stats-row .nx-home-apple-stat-card .display-6 {
    font-size: 1.65rem !important;
    line-height: 1 !important;
    opacity: 0.88;
    filter: none;
    transition: opacity 0.48s ease, transform 0.48s cubic-bezier(0.25, 0.1, 0.25, 1);
}

.nx-home-top-stats-row .nx-home-apple-stat-card:hover .display-6 {
    opacity: 1;
    transform: scale(1.03);
}

.nx-home-top-stats-row .nx-home-apple-stat-card .nx-home-shop-presence-icon,
.nx-home-top-stats-row .nx-home-apple-stat-card .nx-home-sms-balance-icon,
.nx-home-top-stats-row .nx-home-apple-stat-card .nx-home-telephony-balance-icon,
.nx-home-top-stats-row .nx-home-apple-stat-card .nx-home-xai-balance-icon {
    font-size: 1.65rem !important;
}

.nx-home-top-stats-row .nx-home-apple-stat-card .nx-home-np-waiting-icon {
    color: rgba(210, 216, 224, 0.5) !important;
    opacity: 1 !important;
    transition:
        color 0.2s ease,
        opacity 0.48s ease,
        transform 0.48s cubic-bezier(0.25, 0.1, 0.25, 1);
}

.nx-home-top-stats-row .nx-home-apple-stat-card .nx-home-np-waiting-icon svg {
    width: 1.65rem !important;
    height: 1.65rem !important;
    display: block;
    color: rgba(210, 216, 224, 0.5) !important;
    fill: rgba(210, 216, 224, 0.5) !important;
    opacity: 1 !important;
    transition: color 0.2s ease, fill 0.2s ease;
}

.nx-home-top-stats-row .nx-home-apple-stat-card .nx-home-np-waiting-icon svg path {
    fill: rgba(210, 216, 224, 0.5) !important;
    transition: fill 0.2s ease;
}

.nx-home-top-stats-row .nx-home-apple-stat-card:hover .nx-home-np-waiting-icon,
.nx-home-top-stats-row .nx-home-apple-stat-card:hover .nx-home-np-waiting-icon svg {
    color: rgba(232, 236, 242, 0.78) !important;
    fill: rgba(232, 236, 242, 0.78) !important;
}

.nx-home-top-stats-row .nx-home-apple-stat-card:hover .nx-home-np-waiting-icon svg path {
    fill: rgba(232, 236, 242, 0.78) !important;
}

/* Низ — единственная цветовая полоса (градиент + glow) */
.nx-home-top-stats-row .nx-home-apple-stat-card > .progress {
    height: 3px !important;
    min-height: 3px !important;
    margin: 0 !important;
    padding: 0 10% !important;
    background: transparent !important;
    border-radius: 0 0 var(--nx-apple-stat-radius) var(--nx-apple-stat-radius) !important;
    overflow: visible !important;
}

.nx-home-top-stats-row .nx-home-apple-stat-card > .progress .progress-bar {
    height: 100% !important;
    width: 100% !important;
    opacity: 1 !important;
    border-radius: 0 0 4px 4px !important;
    background: linear-gradient(
        90deg,
        rgba(var(--nx-apple-accent-rgb), 0) 0%,
        rgba(var(--nx-apple-accent-rgb), 0.65) 22%,
        rgba(var(--nx-apple-accent-rgb), 1) 50%,
        rgba(var(--nx-apple-accent-rgb), 0.65) 78%,
        rgba(var(--nx-apple-accent-rgb), 0) 100%
    ) !important;
    box-shadow:
        0 0 14px rgba(var(--nx-apple-accent-rgb), 0.5),
        0 -6px 22px rgba(var(--nx-apple-accent-rgb), 0.22);
    animation: nx-home-apple-strip-breathe 6s ease-in-out infinite;
}

.nx-home-top-stats-row .nx-home-apple-stat-card:has(.progress-bar.bg-success) {
    --nx-apple-accent-rgb: 52, 199, 89;
}

.nx-home-top-stats-row .nx-home-apple-stat-card:has(.progress-bar.bg-info) {
    --nx-apple-accent-rgb: 10, 132, 255;
}

.nx-home-top-stats-row .nx-home-apple-stat-card:has(.progress-bar.bg-warning) {
    --nx-apple-accent-rgb: 255, 159, 10;
}

.nx-home-top-stats-row .nx-home-apple-stat-card:has(.progress-bar.bg-danger) {
    --nx-apple-accent-rgb: 255, 69, 58;
}

.nx-home-top-stats-row .nx-home-apple-stat-card:has(.progress-bar.bg-primary) {
    --nx-apple-accent-rgb: 32, 174, 227;
}

.nx-home-top-stats-row .nx-home-apple-stat-card .nx-home-shop-presence-bar,
.nx-home-top-stats-row .nx-home-apple-stat-card .nx-home-sms-balance-bar,
.nx-home-top-stats-row .nx-home-apple-stat-card .nx-home-telephony-balance-bar,
.nx-home-top-stats-row .nx-home-apple-stat-card .nx-home-xai-balance-bar {
    animation: none;
}

@keyframes nx-home-apple-strip-breathe {
    0%,
    100% {
        opacity: 0.82;
        filter: brightness(1);
    }
    50% {
        opacity: 1;
        filter: brightness(1.08);
    }
}

@media (prefers-reduced-motion: reduce) {
    .nx-home-top-stats-row .nx-home-apple-stat-card,
    .nx-home-top-stats-row .nx-home-apple-stat-card .display-6,
    .nx-home-top-stats-row .nx-home-apple-stat-card::before {
        transition: none;
    }

    .nx-home-top-stats-row .nx-home-apple-stat-card > .progress .progress-bar {
        animation: none;
    }

    .nx-home-top-stats-row .nx-home-apple-stat-card:hover {
        transform: none;
    }

    .nx-home-top-stats-row .nx-home-apple-stat-card:hover .display-6 {
        transform: none;
    }
}

@media (min-width: 992px) {
    /* Max 6 KPI cards per row — no squeeze-to-fit */
    .nx-home-top-stats-row {
        display: flex;
        flex-wrap: wrap;
    }

    .nx-home-top-stats-row > [class*="col-"],
    .nx-home-top-stats-row > .col-lg-3 {
        flex: 0 0 16.666667%;
        max-width: 16.666667%;
    }
}

.nx-home-shop-presence-card .nx-home-shop-presence-icon {
    font-size: 2.25rem;
    line-height: 1;
}

.nx-home-shop-presence-card .nx-home-shop-presence-bar {
    animation: nx-home-shop-presence-pulse 2.4s ease-in-out infinite;
}

@keyframes nx-home-shop-presence-pulse {
    0%,
    100% {
        opacity: 1;
    }
    50% {
        opacity: 0.55;
    }
}

.nx-home-sms-balance-card .nx-home-sms-balance-icon {
    font-size: 2.25rem;
    line-height: 1;
}

.nx-home-sms-balance-card .nx-home-sms-balance-bar {
    animation: nx-home-sms-balance-pulse 2.4s ease-in-out infinite;
}

@keyframes nx-home-sms-balance-pulse {
    0%,
    100% {
        opacity: 1;
    }
    50% {
        opacity: 0.55;
    }
}

.nx-home-xai-balance-card .nx-home-xai-balance-icon {
    font-size: 2.25rem;
    line-height: 1;
}

.nx-home-xai-balance-card .nx-home-xai-balance-bar {
    animation: nx-home-xai-balance-pulse 2.4s ease-in-out infinite;
}

@keyframes nx-home-xai-balance-pulse {
    0%,
    100% {
        opacity: 1;
    }
    50% {
        opacity: 0.55;
    }
}

.nx-home-telephony-balance-card .nx-home-telephony-balance-icon {
    font-size: 2.25rem;
    line-height: 1;
}

.nx-home-telephony-balance-card .nx-home-telephony-balance-bar {
    animation: nx-home-telephony-balance-pulse 2.4s ease-in-out infinite;
}

@keyframes nx-home-telephony-balance-pulse {
    0%,
    100% {
        opacity: 1;
    }
    50% {
        opacity: 0.55;
    }
}
