/* ================================================================
   Brokerr — Shared UI Components
   Reusable patterns used across multiple features.
   Imports: tokens.css (via app.css)
   ================================================================ */

/* ---------- Page Empty State ---------- */
.page-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 40vh;
  padding: 48px 24px;
}
.page-empty-state__icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--color-gray-100);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  color: var(--color-gray-400);
}
.page-empty-state__title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: 8px;
}
.page-empty-state__desc {
  color: var(--color-gray-500);
  font-size: 0.9rem;
  max-width: 420px;
  line-height: 1.6;
  margin-bottom: 20px;
}
.page-empty-state__desc ul {
  list-style: none;
  padding: 0;
  margin: 8px 0 0;
  text-align: left;
}
.page-empty-state__desc ul li {
  padding: 2px 0;
}
.page-empty-state__desc ul li::before {
  content: "\2022";
  margin-right: 8px;
  color: var(--color-gray-400);
}
.page-empty-state__actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
}
.page-empty-state__steps {
  text-align: left;
  color: var(--color-gray-500);
  font-size: 0.9rem;
  max-width: 420px;
  line-height: 1.8;
  margin-bottom: 20px;
}

/* ---------- Page Error State ---------- */
.page-error-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 30vh;
  padding: 48px 24px;
}
.page-error-state__icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #FEF2F2;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  color: var(--color-error, #EF4444);
}
.page-error-state__title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: 6px;
}
.page-error-state__desc {
  color: var(--color-gray-500);
  font-size: 0.85rem;
  max-width: 400px;
  margin-bottom: 16px;
}

/* ---------- Pagination ---------- */
.pagination .btn,
.pagination button {
  border-radius: 8px;
}
.pagination .btn.active,
.pagination button.active,
.pagination .btn--active {
  background: #0F172A;
  color: white;
  border-color: #0F172A;
}

/* ---------- Sync Banner ---------- */
.sync-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  background: linear-gradient(135deg, #0F172A, #1E293B);
  color: white;
  padding: 12px 20px;
  border-radius: var(--radius-lg);
  margin-bottom: var(--sp-4);
  font-size: 13px;
  flex-wrap: wrap;
}
.sync-banner-left {
  display: flex;
  align-items: center;
  gap: 8px;
}
.sync-banner-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22C55E;
  animation: sync-pulse 2s ease-in-out infinite;
}
@keyframes sync-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}
.sync-banner-title {
  font-weight: 700;
  color: #0D9488;
}
.sync-banner-time {
  color: rgba(255,255,255,0.6);
  font-size: 12px;
}
.sync-banner-stats {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.sync-stat {
  padding: 2px 10px;
  border-radius: 100px;
  font-size: 11px;
  font-weight: 600;
}
.sync-stat--new { background: rgba(34,197,94,0.2); color: #22C55E; }
.sync-stat--updated { background: rgba(59,130,246,0.2); color: #60A5FA; }
.sync-stat--changes { background: rgba(13,148,136,0.2); color: #2DD4BF; }
.sync-stat--deactivated { background: rgba(239,68,68,0.2); color: #FCA5A5; }
a.sync-stat--link { text-decoration: none; cursor: pointer; transition: transform 0.15s, box-shadow 0.15s; }
a.sync-stat--link:hover { transform: scale(1.05); box-shadow: 0 0 8px rgba(255,255,255,0.2); }
.sync-banner-total {
  font-weight: 700;
  color: rgba(255,255,255,0.9);
  font-size: 12px;
}
@media (max-width: 768px) {
  .sync-banner { flex-direction: column; align-items: flex-start; gap: 6px; }
  .sync-banner-stats { flex-wrap: wrap; }
}

/* ---------- Setup Checklist ---------- */
.setup-checklist {
  background: var(--color-white, #fff);
  border: 1px solid var(--color-gray-200, #E2E8F0);
  border-radius: var(--radius-xl, 12px);
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  padding: 28px 32px;
  margin-bottom: var(--sp-5, 20px);
}
.setup-checklist__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 16px;
}
.setup-checklist__title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-primary, #1B2A4A);
  margin: 0 0 4px;
}
.setup-checklist__subtitle {
  font-size: 0.875rem;
  color: var(--color-gray-500, #6B7280);
  margin: 0;
}
.setup-checklist__pct {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--color-secondary, #0D9488);
  line-height: 1;
}
.setup-checklist__progress {
  width: 100%;
  height: 8px;
  background: var(--color-gray-100, #F1F5F9);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 20px;
}
.setup-checklist__progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--color-secondary, #0D9488), #22C55E);
  border-radius: 4px;
  transition: width 0.6s ease;
  min-width: 2%;
}
.setup-checklist__items {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.setup-checklist__item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--color-gray-100, #F1F5F9);
}
.setup-checklist__item:last-child {
  border-bottom: none;
}
.setup-checklist__check {
  flex-shrink: 0;
  display: flex;
  align-items: center;
}
.setup-checklist__label {
  flex: 1;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--color-gray-700, #374151);
}
.setup-checklist__label--done {
  color: var(--color-gray-400, #9CA3AF);
  text-decoration: line-through;
}
.setup-checklist__action {
  flex-shrink: 0;
  white-space: nowrap;
}
.setup-checklist__item--done .setup-checklist__action {
  display: none;
}
.setup-checklist__header {
  cursor: pointer;
}
.setup-checklist__chevron {
  flex-shrink: 0;
  color: var(--color-gray-400, #9CA3AF);
  transition: transform 0.2s ease;
}
.setup-checklist--collapsed .setup-checklist__chevron {
  transform: rotate(-90deg);
}
.setup-checklist--collapsed .setup-checklist__progress {
  margin-bottom: 0;
}
.setup-checklist--collapsed .setup-checklist__items {
  display: none;
}

@media (max-width: 640px) {
  .setup-checklist {
    padding: 20px 16px;
  }
  .setup-checklist__header {
    flex-direction: column;
    gap: 8px;
  }
  .setup-checklist__item {
    flex-wrap: wrap;
    gap: 8px;
  }
  .setup-checklist__action {
    margin-left: 32px;
  }
}

/* ---------- Campaigns Grid ---------- */
.campaigns-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: var(--sp-4);
}
@media (max-width: 768px) {
  .campaigns-grid { grid-template-columns: 1fr; }
}
