/* CRM layout skeleton — dark theme, shown until app shell is ready */

#crm-layout-skeleton {
    position: fixed;
    inset: 0;
    z-index: 10000;
    opacity: 0.4;
    display: flex;
    background: #0a0a0a;
    transition: opacity 0.35s ease, visibility 0.35s ease;
}

#crm-layout-skeleton.crm-layout-skeleton--hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.crm-app-shell--loading {
    visibility: hidden;
}

.crm-app-shell:not(.crm-app-shell--loading) {
    visibility: visible;
}

.crm-skel-sidebar {
    width: 15.625rem;
    min-width: 15.625rem;
    margin: 1rem 0 1rem 0.75rem;
    padding: 1rem;
    background: #141414;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 1rem;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.45);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.crm-skel-main {
    flex: 1;
    min-width: 0;
    margin: 1rem 1rem 1rem 0;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.crm-skel-bar {
    height: 3.5rem;
    border-radius: 1rem;
    background: #141414;
    border: 1px solid rgba(255, 255, 255, 0.06);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.crm-skel-content {
    flex: 1;
    padding: 0 0.25rem;
}

.crm-skel-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 1rem;
}

.crm-skel-card {
    height: 5.5rem;
    border-radius: 1rem;
    background: #141414;
    border: 1px solid rgba(255, 255, 255, 0.06);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.crm-skel-card:first-child {
    background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 100%);
    opacity: 0.55;
}

.crm-skel-panel {
    height: 14rem;
    border-radius: 1rem;
    background: #141414;
    border: 1px solid rgba(255, 255, 255, 0.06);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.crm-skel-line {
    height: 0.65rem;
    border-radius: 0.25rem;
    background: linear-gradient(90deg, #1f1f1f 0%, #2a2a2a 50%, #1f1f1f 100%);
    background-size: 200% 100%;
    animation: crm-skel-shimmer 1.2s ease-in-out infinite;
}

.crm-skel-line--logo {
    height: 2.25rem;
    width: 72%;
    border-radius: 0.5rem;
}

.crm-skel-line--sm { width: 55%; }
.crm-skel-line--md { width: 75%; }
.crm-skel-line--lg { width: 90%; }
.crm-skel-line--full { width: 100%; }

.crm-skel-brand-text {
    font-size: 0.65rem;
    color: #64748b;
    text-align: center;
    margin-top: auto;
    padding-top: 0.5rem;
}

@keyframes crm-skel-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

@media (max-width: 1199.98px) {
    .crm-skel-sidebar { display: none; }
    .crm-skel-cards { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 575.98px) {
    .crm-skel-cards { grid-template-columns: 1fr; }
    .crm-skel-main { margin-left: 0.5rem; margin-right: 0.5rem; }
}
