/* CRM layout skeleton — shown until DOMContentLoaded */

#crm-layout-skeleton {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  background: #f8f9fa;
  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: #fff;
  border-radius: 1rem;
  box-shadow: 0 20px 27px 0 rgba(0, 0, 0, 0.05);
  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: #fff;
  box-shadow: 0 20px 27px 0 rgba(0, 0, 0, 0.05);
}

.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: #fff;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.08);
}

.crm-skel-panel {
  height: 14rem;
  border-radius: 1rem;
  background: #fff;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.08);
  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, #e9ecef 0%, #f5f6f8 50%, #e9ecef 100%);
  background-size: 200% 100%;
  animation: crm-skel-shimmer 1.2s ease-in-out infinite;
}

.crm-skel-line--logo {
  height: 2.5rem;
  width: 70%;
  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: #8392ab;
  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;
  }
}
