/* مكوّن موحّد: حالة فارغة / خطأ — رسالة مختصرة + إعادة محاولة + بدائل */
.empty-state-panel {
  --esp-primary: var(--primary-color, #27b3f6);
  --esp-border: rgba(39, 179, 246, 0.2);
  --esp-bg: #fff;
  max-width: 28rem;
  margin: 0.85rem auto 0;
  padding: 0;
  background: var(--esp-bg);
  border: 1px solid var(--esp-border);
  border-radius: 14px;
  box-shadow: 0 6px 20px rgba(39, 179, 246, 0.08);
  overflow: hidden;
}

.empty-state-panel__inner {
  padding: 0.9rem 1rem 1rem;
}

.empty-state-panel__row {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin-bottom: 0.75rem;
}

.empty-state-panel__icon {
  flex-shrink: 0;
  width: 2.25rem;
  height: 2.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: linear-gradient(145deg, rgba(39, 179, 246, 0.14), rgba(39, 179, 246, 0.05));
  color: var(--esp-primary);
  font-size: 1rem;
}

.empty-state-panel__text {
  margin: 0;
  flex: 1;
  min-width: 0;
  font-size: 0.875rem;
  line-height: 1.5;
  color: #4a5568;
  text-align: right;
  font-weight: 500;
}

.empty-state-panel__footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.45rem 0.5rem;
  padding-top: 0.65rem;
  border-top: 1px solid rgba(39, 179, 246, 0.1);
}

.empty-state-panel__sep {
  width: 1px;
  height: 1.25rem;
  background: rgba(39, 179, 246, 0.22);
  flex-shrink: 0;
}

.empty-state-panel__nav {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
}

.empty-state-panel__nav-label {
  font-size: 0.75rem;
  color: #94a3b8;
  font-weight: 500;
  margin-left: 0.15rem;
}

.empty-state-panel__links {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
}

.empty-state-panel__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.4rem 0.85rem;
  font-size: 0.8rem;
  font-weight: 600;
  border-radius: 9px;
  text-decoration: none;
  border: 1px solid rgba(39, 179, 246, 0.3);
  background: #fff;
  color: var(--esp-primary);
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.12s ease;
  font-family: inherit;
  line-height: 1.2;
  white-space: nowrap;
}

.empty-state-panel__btn:hover {
  background: rgba(39, 179, 246, 0.07);
  color: var(--esp-primary);
}

.empty-state-panel__btn:active {
  transform: scale(0.98);
}

.empty-state-panel__btn--primary {
  background: var(--esp-primary);
  border-color: var(--esp-primary);
  color: #fff;
  min-width: 7.5rem;
}

.empty-state-panel__btn--primary:hover {
  background: #1fa3e4;
  border-color: #1fa3e4;
  color: #fff;
}

.empty-state-panel__btn--primary:disabled,
.empty-state-panel__btn--primary.is-loading {
  opacity: 0.75;
  cursor: wait;
  pointer-events: none;
}

.empty-state-panel__btn--primary.is-loading [data-empty-retry-icon] {
  animation: empty-state-spin 0.7s linear infinite;
}

@keyframes empty-state-spin {
  to {
    transform: rotate(360deg);
  }
}

/* حالة خطأ */
.empty-state-panel--error {
  --esp-border: rgba(244, 67, 54, 0.22);
  box-shadow: 0 6px 20px rgba(244, 67, 54, 0.06);
}

.empty-state-panel--error .empty-state-panel__icon {
  background: linear-gradient(145deg, rgba(244, 67, 54, 0.12), rgba(244, 67, 54, 0.04));
  color: #e53935;
}

.empty-state-panel--error .empty-state-panel__footer {
  border-top-color: rgba(244, 67, 54, 0.1);
}

/* روابط فقط (بدون رسالة) */
.empty-state-panel--links-only .empty-state-panel__row {
  display: none;
}

.empty-state-panel--links-only .empty-state-panel__inner {
  padding: 0.55rem 0.75rem;
}

.empty-state-panel--links-only .empty-state-panel__footer {
  border-top: none;
  padding-top: 0;
}

.empty-state-panel--links-only .empty-state-panel__nav-label {
  display: none;
}

[hidden].empty-state-panel,
.empty-state-panel[hidden] {
  display: none !important;
}

@media (max-width: 480px) {
  .empty-state-panel {
    max-width: 100%;
    margin-left: 0.35rem;
    margin-right: 0.35rem;
  }

  .empty-state-panel__footer {
    flex-direction: column;
    align-items: stretch;
  }

  .empty-state-panel__sep {
    display: none;
  }

  .empty-state-panel__nav {
    flex-direction: column;
    width: 100%;
  }

  .empty-state-panel__links {
    flex-direction: column;
    width: 100%;
  }

  .empty-state-panel__btn {
    width: 100%;
  }

  .empty-state-panel__btn--primary {
    min-width: 0;
  }
}
