/* Admin App Styles */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
    'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
    sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background: #f7f7f7;
  color: #333;
}

.app {
  min-height: 100vh;
}

.header {
  background: linear-gradient(135deg, #ffc64d 0%, #ffb84d 100%);
  color: white;
  padding: 1.5rem 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.header .container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-size: 1.5rem;
  font-weight: 600;
}

.nav {
  display: flex;
  gap: 2rem;
}

.nav a {
  color: white;
  text-decoration: none;
  font-weight: 500;
  transition: opacity 0.2s;
}

.nav a:hover {
  opacity: 0.8;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.main-content {
  padding: 2rem 0;
}

.dashboard {
  background: white;
  padding: 2rem;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.dashboard h1 {
  margin-bottom: 1rem;
  font-size: 2rem;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

.stat-card {
  background: white;
  padding: 1.5rem;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.stat-label {
  font-size: 0.875rem;
  color: #666;
  margin-bottom: 0.5rem;
}

.stat-value {
  font-size: 1.75rem;
  font-weight: 600;
  color: #ffc64d;
}

.page-header {
  margin-bottom: 2rem;
}

.page-header h1 {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.push-subscription-card {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 1.75rem;
  max-width: 560px;
}

.push-subscription-card h2 {
  margin-bottom: 0.75rem;
  font-size: 1.25rem;
}

.push-subscription-card p {
  margin-bottom: 1rem;
  color: #555;
  line-height: 1.6;
}

.status-message {
  margin-top: 1rem;
  font-weight: 600;
}

.status-message.success {
  color: #0f766e;
}

.status-message.error {
  color: #b91c1c;
}

.dashboard-grid {
  display: grid;
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.dashboard-card {
  display: flex;
  justify-content: center;
}

.page-header p {
  color: #666;
}

/* ── Dashboard sections ─────────────────────────────────────── */

.stats-section {
  margin-bottom: 2rem;
}

.stats-section-title {
  font-size: 1rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #999;
  margin-bottom: 0.75rem;
}

.stats-grid-3 {
  grid-template-columns: repeat(3, 1fr);
}

.stats-grid-4 {
  grid-template-columns: repeat(4, 1fr);
}

.stats-grid-5 {
  grid-template-columns: repeat(5, 1fr);
}

.stat-sub {
  font-size: 0.75rem;
  color: #aaa;
  margin-top: 0.25rem;
}

/* ── Error banner ───────────────────────────────────────────── */

.error-banner {
  background: #fef2f2;
  border: 1px solid #fca5a5;
  color: #b91c1c;
  border-radius: 6px;
  padding: 0.75rem 1rem;
  margin-bottom: 1.5rem;
  font-size: 0.875rem;
}

/* ── Skeleton loading ───────────────────────────────────────── */

@keyframes shimmer {
  0%   { background-position: -400px 0; }
  100% { background-position: 400px 0; }
}

.stat-card.skeleton {
  pointer-events: none;
}

.skeleton-line {
  border-radius: 4px;
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 800px 100%;
  animation: shimmer 1.4s infinite linear;
}

.skeleton-label-line {
  height: 0.75rem;
  width: 60%;
  margin-bottom: 0.75rem;
}

.skeleton-value-line {
  height: 1.75rem;
  width: 40%;
}

/* ── Responsive overrides ───────────────────────────────────── */

@media (max-width: 1024px) {
  .stats-grid-5 {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 768px) {
  .stats-grid-3,
  .stats-grid-4,
  .stats-grid-5 {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 768px) {
  .header .container {
    flex-direction: column;
    gap: 1rem;
  }

  .nav {
    flex-direction: column;
    gap: 0.5rem;
    width: 100%;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }
}
