/* ═══════════════════════════════════════════════════════════════════
   PI EXTENSION DASHBOARD — Using Design System
   ═══════════════════════════════════════════════════════════════════ */

@import './design-system/css/base.css?v=ddd79f9306';
@import './design-system/css/tokens.css?v=ddd79f9306';
@import './design-system/css/components.css?v=ddd79f9306';

/* ──────────────────────────────────────────────────────────────────
   APP-SPECIFIC LAYOUT
   ────────────────────────────────────────────────────────────────── */

.app {
  max-width: var(--max-width-md);
  margin: 0 auto;
  padding: 0 var(--space-md);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ──────────────────────────────────────────────────────────────────
   TOPBAR
   ────────────────────────────────────────────────────────────────── */

.topbar {
  height: var(--topbar-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  border-bottom: 1px solid var(--border-subtle);
  position: sticky;
  top: 0;
  background: var(--bg-deep);
  z-index: var(--z-sticky);
  margin: 0 calc(var(--space-md) * -1);
  padding: 0 var(--space-md);
  backdrop-filter: blur(8px);
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.logo {
  font-family: var(--font-mono);
  font-size: var(--text-xl);
  font-weight: var(--font-semibold);
  color: var(--accent);
  line-height: 1;
}

.title {
  font-size: var(--text-lg);
  font-weight: var(--font-semibold);
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.badge-count {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--text-tertiary);
  background: var(--bg-surface);
  padding: 2px 8px;
  border-radius: var(--radius-sm);
}

.topbar-right {
  flex: 1;
  max-width: 320px;
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.sync-status {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--text-tertiary);
  white-space: nowrap;
  flex-shrink: 0;
}

.sync-status[data-state="synced"]::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  margin-right: 6px;
  vertical-align: middle;
}

.sync-status[data-state="syncing"]::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--warning, #f0a000);
  margin-right: 6px;
  vertical-align: middle;
  animation: pulse-dot 1.5s ease-in-out infinite;
}

.sync-status[data-state="never"]::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-tertiary);
  margin-right: 6px;
  vertical-align: middle;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

/* ──────────────────────────────────────────────────────────────────
   CONTENT AREA
   ────────────────────────────────────────────────────────────────── */

.content {
  flex: 1;
  padding: var(--space-md) 0;
}

.packages {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

/* ──────────────────────────────────────────────────────────────────
   RESPONSIVE
   ────────────────────────────────────────────────────────────────── */

@media (max-width: 640px) {
  .topbar {
    flex-wrap: wrap;
    height: auto;
    padding: var(--space-sm) var(--space-md);
    gap: var(--space-sm);
  }
  
  .topbar-right {
    max-width: 100%;
    order: 3;
    width: 100%;
  }
  
  .filters {
    padding: var(--space-sm) 0;
  }
  
  .package-head {
    flex-direction: column;
    gap: var(--space-sm);
  }
  
  .package-stats {
    width: 100%;
    justify-content: flex-start;
  }
  
  .package-foot {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-sm);
  }
  
  .package-meta {
    width: 100%;
    justify-content: space-between;
  }
}

/* App-specific overrides if needed */