/* ERP startup skeleton — shown before Blazor/XAF is interactive */
.erp-loading-screen {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at top, #f7f9fc 0, #eef2f7 45%, #e8edf5 100%);
    z-index: 99999;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    opacity: 1;
    transition: opacity 0.32s ease;
}

.erp-loading-screen.erp-loading-screen--hidden {
    opacity: 0;
    pointer-events: none;
}

.erp-loading-card {
    width: min(520px, calc(100vw - 40px));
    padding: 28px;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 24px 80px rgba(15, 23, 42, 0.14);
    border: 1px solid rgba(148, 163, 184, 0.22);
}

.erp-loading-logo {
    width: 54px;
    height: 54px;
    border-radius: 16px;
    margin-bottom: 18px;
    background-color: #1f2937;
    -webkit-mask: url("../images/Logo.svg") center / contain no-repeat;
    mask: url("../images/Logo.svg") center / contain no-repeat;
    box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.35);
}

.erp-loading-title {
    font-size: 20px;
    font-weight: 700;
    color: #111827;
    margin-bottom: 6px;
}

.erp-loading-subtitle {
    font-size: 14px;
    color: #64748b;
    margin-bottom: 22px;
    line-height: 1.45;
}

.erp-kpi-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 18px;
}

.erp-skeleton {
    position: relative;
    overflow: hidden;
    background: #e5e7eb;
}

.erp-skeleton::after {
    content: "";
    position: absolute;
    inset: 0;
    transform: translateX(-100%);
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.7), transparent);
    animation: erp-shimmer 1.35s infinite;
}

/* KPI „отчети“ – леко оцветени като dashboard карти */
.erp-kpi-row .erp-kpi:nth-child(1) {
    background: linear-gradient(145deg, #dbeafe 0%, #bfdbfe 100%);
    border: 1px solid rgba(59, 130, 246, 0.2);
}

.erp-kpi-row .erp-kpi:nth-child(2) {
    background: linear-gradient(145deg, #d1fae5 0%, #a7f3d0 100%);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.erp-kpi-row .erp-kpi:nth-child(3) {
    background: linear-gradient(145deg, #e0e7ff 0%, #c7d2fe 100%);
    border: 1px solid rgba(99, 102, 241, 0.22);
}

.erp-kpi {
    height: 72px;
    border-radius: 16px;
}

/* „Таблица / репорт“ – полета с лек нюанс */
.erp-table-skeleton {
    padding: 16px;
    border-radius: 18px;
    background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
    border: 1px solid rgba(148, 163, 184, 0.35);
}

.erp-table-skeleton .erp-line.wide {
    background: linear-gradient(90deg, #93c5fd, #60a5fa);
    opacity: 0.55;
    height: 16px;
}

.erp-table-skeleton .erp-line:not(.wide):not(.short):nth-of-type(2) {
    background: linear-gradient(90deg, #cbd5e1, #e2e8f0);
}

.erp-table-skeleton .erp-line:not(.wide):not(.short):nth-of-type(3) {
    background: linear-gradient(90deg, #bae6fd, #e0f2fe);
}

.erp-table-skeleton .erp-line.short {
    background: linear-gradient(90deg, #a5b4fc, #c7d2fe);
    opacity: 0.5;
}

.erp-line {
    height: 14px;
    border-radius: 999px;
    margin-bottom: 12px;
}

.erp-line.wide {
    width: 92%;
}

.erp-line:not(.wide):not(.short) {
    width: 76%;
}

.erp-line.short {
    width: 48%;
    margin-bottom: 0;
}

@keyframes erp-shimmer {
    100% {
        transform: translateX(100%);
    }
}

@media (max-width: 480px) {
    .erp-kpi-row {
        grid-template-columns: 1fr;
    }

    .erp-kpi {
        height: 56px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .erp-skeleton::after {
        animation: none;
    }

    .erp-loading-screen {
        transition: none;
    }
}
