.dashboard-badges-header {
  margin-bottom: 24px;
}

.health-status {
  background: #f8fafc;
  border-radius: 12px;
  padding: 16px 20px;
  border: 1px solid #e2e8f0;
  margin-bottom: 16px;

  .health-indicator {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;

    i {
      font-size: 20px;
    }

    .health-text {
      font-weight: 600;
      font-size: 1rem;
    }

    &.health-healthy {
      color: #10b981;
      i { color: #10b981; }
    }

    &.health-degraded {
      color: #f59e0b;
      i { color: #f59e0b; }
    }

    &.health-error {
      color: #ef4444;
      i { color: #ef4444; }
    }
  }

  .health-details {
    display: flex;
    gap: 24px;
    align-items: center;
    font-size: 0.875rem;
    color: #64748b;

    .health-metric {
      display: flex;
      align-items: center;
      gap: 6px;

      .metric-label {
        font-weight: 500;
      }

      i.icon-check {
        color: #10b981;
      }

      i.icon-warning {
        color: #ef4444;
      }

      .latency {
        font-size: 0.75rem;
        color: #94a3b8;
      }

      .badge-count {
        background: #e2e8f0;
        padding: 2px 8px;
        border-radius: 12px;
        font-size: 0.75rem;
        font-weight: 600;
        color: #475569;
      }
    }
  }
}

.error-message {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 8px;
  color: #dc2626;

  i {
    font-size: 18px;
  }

  .btn-retry {
    margin-left: auto;
    background: #dc2626;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.875rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;

    &:hover {
      background: #b91c1c;
    }
  }
}

.dashboard-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid #e2e8f0;

  .dashboard-info {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 0.875rem;
    color: #64748b;

    .badges-count {
      font-weight: 600;
      color: #334155;
    }

    .availability {
      padding: 2px 8px;
      background: #dcfce7;
      color: #166534;
      border-radius: 12px;
      font-size: 0.75rem;
      font-weight: 600;
    }

    .last-update {
      font-family: 'Courier New', monospace;
      font-size: 0.75rem;
    }
  }

  .action-buttons {
    display: flex;
    gap: 12px;

    .btn-refresh {
      display: flex;
      align-items: center;
      gap: 8px;
      padding: 8px 16px;
      background: #3b82f6;
      color: white;
      border: none;
      border-radius: 8px;
      cursor: pointer;
      font-size: 0.875rem;
      font-weight: 500;
      transition: all 0.2s;

      &:hover:not(:disabled) {
        background: #2563eb;
        transform: translateY(-1px);
      }

      &:disabled {
        opacity: 0.6;
        cursor: not-allowed;
      }

      &.loading i {
        animation: spin 1s linear infinite;
      }

      i {
        font-size: 16px;
      }
    }
  }
}

.badges-grid {
  display: flex;
  flex-direction: column;
  gap: 32px;

  .badges-section {
    .section-title {
      display: flex;
      align-items: center;
      gap: 12px;
      margin: 0 0 16px 0;
      font-size: 1.125rem;
      font-weight: 600;
      color: #334155;

      i {
        font-size: 20px;
        color: #64748b;
      }
    }

    .badges-row {
      display: grid;
      gap: 20px;

      &.badges-row--all {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
      }
    }
  }

  // Grilles par taille
  &.badges-grid--small .badges-row:not(.badges-row--all) {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  }

  &.badges-grid--medium .badges-row:not(.badges-row--all) {
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  }

  &.badges-grid--large .badges-row:not(.badges-row--all) {
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  }

  // Skeleton
  &.badges-grid--skeleton {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 20px;

    .skeleton-badge {
      width: 280px;
      height: 140px;
      background: #f1f5f9;
      border-radius: 12px;
      padding: 20px;
      animation: pulse 2s ease-in-out infinite;

      .skeleton-icon {
        width: 48px;
        height: 48px;
        background: #cbd5e1;
        border-radius: 12px;
        margin-bottom: 16px;
      }

      .skeleton-title {
        height: 16px;
        background: #cbd5e1;
        border-radius: 4px;
        margin-bottom: 12px;
        width: 60%;
      }

      .skeleton-value {
        height: 32px;
        background: #cbd5e1;
        border-radius: 4px;
        width: 80%;
      }
    }
  }
}

.loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  text-align: center;

  .loading-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid #e2e8f0;
    border-left-color: #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 24px;
  }

  h3 {
    margin: 0 0 8px 0;
    color: #334155;
    font-size: 1.25rem;
  }

  p {
    margin: 0 0 24px 0;
    color: #64748b;
    font-size: 0.875rem;
  }
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  text-align: center;

  i {
    font-size: 48px;
    color: #cbd5e1;
    margin-bottom: 24px;
  }

  h3 {
    margin: 0 0 8px 0;
    color: #334155;
    font-size: 1.25rem;
  }

  p {
    margin: 0 0 24px 0;
    color: #64748b;
    font-size: 0.875rem;
  }

  .btn-refresh {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: #3b82f6;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;

    &:hover {
      background: #2563eb;
    }
  }
}

// Animations
@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes pulse {
  0% { opacity: 1; }
  50% { opacity: 0.5; }
  100% { opacity: 1; }
}

// Responsive
@media (max-width: 768px) {
  .dashboard-actions {
    flex-direction: column;
    align-items: stretch;
    gap: 16px;

    .dashboard-info {
      flex-wrap: wrap;
      gap: 12px;
    }
  }

  .badges-grid {
    .badges-section .badges-row {
      grid-template-columns: 1fr;
    }

    &.badges-grid--skeleton .skeleton-badge {
      width: 100%;
    }
  }

  .health-status .health-details {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
}