/* Base Styles & Reset */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-page);
  color: var(--text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  text-decoration: none;
  color: inherit;
}

button {
  cursor: pointer;
  border: none;
  background: none;
  font-family: inherit;
  outline: none;
}

input, select, textarea {
  font-family: inherit;
}

/* Card Component */
.card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-default);
  box-shadow: var(--shadow-card);
  padding: 22px 24px;
  position: relative;
  transition: var(--transition-normal);
}

.card:hover {
  box-shadow: var(--shadow-md);
  border-color: #cbd5e1;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.card-title {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 10px;
  letter-spacing: -0.015em;
}

.card-action-link {
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--primary);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: var(--transition-fast);
}

.card-action-link:hover {
  color: var(--primary-dark);
  transform: translateX(3px);
}

/* eCommerce Seller Trust & Protection Ribbon */
.seller-trust-bar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  background: linear-gradient(135deg, #063c22 0%, #0a4e2c 100%);
  border: 1px solid rgba(74, 222, 128, 0.25);
  border-radius: var(--radius-lg);
  padding: 14px 20px;
  color: #ffffff;
  box-shadow: 0 4px 16px rgba(6, 60, 34, 0.16);
}

.seller-trust-item {
  display: flex;
  align-items: center;
  gap: 12px;
}

.seller-trust-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  flex-shrink: 0;
}

.seller-trust-text h4 {
  font-size: 0.82rem;
  font-weight: 800;
  color: #ffffff;
  line-height: 1.2;
}

.seller-trust-text p {
  font-size: 0.72rem;
  color: #bbf7d0;
  margin-top: 2px;
  font-weight: 500;
}

/* Quick Seller Commerce Action Toolbar */
.seller-actions-strip {
  display: flex;
  align-items: center;
  gap: 10px;
  overflow-x: auto;
  padding: 4px 2px;
}

.seller-action-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: #ffffff;
  border: 1.5px solid var(--border-default);
  border-radius: var(--radius-md);
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-main);
  box-shadow: var(--shadow-xs);
  transition: var(--transition-fast);
  white-space: nowrap;
}

.seller-action-pill:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-tint);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.seller-action-pill.primary {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
}

.seller-action-pill.primary:hover {
  background: var(--primary-hover);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(12, 90, 54, 0.25);
}

.seller-action-pill.danger {
  background: #fef2f2;
  color: #b91c1c;
  border-color: #fecaca;
}

.seller-action-pill.danger:hover {
  background: #fee2e2;
  border-color: #f87171;
  color: #991b1b;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.badge-grade-a {
  background: #dcfce7;
  color: #15803d;
  border: 1px solid #bbf7d0;
}

.badge-grade-b {
  background: #dbeafe;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
}

.badge-grade-c {
  background: #fef3c7;
  color: #b45309;
  border: 1px solid #fde68a;
}

.badge-status-open {
  background: #ecfdf5;
  color: #065f46;
  border: 1px solid #a7f3d0;
  font-weight: 700;
}

.badge-status-negotiation {
  background: #fffbeb;
  color: #b45309;
  border: 1px solid #fde68a;
  font-weight: 700;
}

.badge-status-dispatched {
  background: #eff6ff;
  color: #1e40af;
  border: 1px solid #bfdbfe;
  font-weight: 700;
}

.badge-status-transit {
  background: #f0f9ff;
  color: #0369a1;
  border: 1px solid #bae6fd;
  font-weight: 700;
}

.badge-status-emergency {
  background: #fef2f2;
  color: #dc2626;
  border: 1px solid #fca5a5;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  animation: pulseEmergency 1.8s infinite;
}

.badge-status-sold {
  background: #f0fdf4;
  color: #166534;
  border: 1px solid #bbf7d0;
  font-weight: 700;
}

.badge-verified-seller {
  background: rgba(74, 222, 128, 0.18);
  color: #166534;
  border: 1px solid #86efac;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.badge-escrow-guarantee {
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

@keyframes pulseEmergency {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.4);
  }
  50% {
    box-shadow: 0 0 0 6px rgba(220, 38, 38, 0);
  }
}

.btn-emergency-action {
  background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
  color: #ffffff;
  font-size: 0.76rem;
  font-weight: 800;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: none;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(220, 38, 38, 0.25);
  transition: var(--transition-fast);
}

.btn-emergency-action:hover {
  background: linear-gradient(135deg, #b91c1c 0%, #991b1b 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(220, 38, 38, 0.35);
}

.btn-filter-tab {
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  color: #475569;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition-fast);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-filter-tab:hover {
  background: #f1f5f9;
  color: #0f172a;
  border-color: #94a3b8;
}

.btn-filter-tab.active {
  background: #0c5a36;
  border-color: #0c5a36;
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(12, 90, 54, 0.2);
}

.btn-filter-tab.emergency-tab {
  border-color: #fca5a5;
  color: #991b1b;
  background: #fef2f2;
}

.btn-filter-tab.emergency-tab.active {
  background: #dc2626;
  border-color: #dc2626;
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(220, 38, 38, 0.25);
}

.badge-notification {
  background: #ef4444;
  color: #ffffff;
  font-size: 0.65rem;
  font-weight: 800;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 700;
  font-size: 0.88rem;
  border-radius: var(--radius-sm);
  padding: 10px 18px;
  transition: var(--transition-fast);
  cursor: pointer;
}

.btn-primary {
  background-color: var(--primary);
  color: var(--text-white);
  border: 1px solid transparent;
  box-shadow: 0 2px 6px rgba(12, 90, 54, 0.16);
}

.btn-primary:hover {
  background-color: var(--primary-hover);
  box-shadow: 0 4px 14px rgba(12, 90, 54, 0.24);
  transform: translateY(-1px);
}

.btn-outline {
  background: #ffffff;
  border: 1.5px solid var(--border-default);
  color: var(--text-secondary);
  font-size: 0.82rem;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  transition: var(--transition-fast);
}

.btn-outline:hover {
  background: #f8fafc;
  border-color: var(--border-strong);
  color: var(--text-main);
  transform: translateY(-1px);
}

/* Form inputs */
.form-group {
  margin-bottom: 14px;
}

.form-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.form-input, .form-select {
  width: 100%;
  padding: 10px 14px;
  background-color: #ffffff;
  border: 1.5px solid var(--border-default);
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  color: var(--text-main);
  transition: border-color 0.15s, box-shadow 0.15s;
  outline: none;
}

.form-input:focus, .form-select:focus {
  border-color: var(--primary);
  box-shadow: var(--shadow-glow-green);
}

/* Modal styles */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(6px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.modal-overlay.active {
  display: flex;
  opacity: 1;
}

.modal-content {
  background: #ffffff;
  border-radius: var(--radius-xl);
  max-width: 540px;
  width: 92%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  padding: 28px;
  animation: modalPop 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  border: 1px solid var(--border-default);
}

@keyframes modalPop {
  from {
    transform: scale(0.96) translateY(8px);
    opacity: 0;
  }
  to {
    transform: scale(1) translateY(0);
    opacity: 1;
  }
}

/* FPO Hub Cooperative Styles */
.fpo-progress-bar-wrap {
  width: 100%;
  height: 9px;
  background: #e2e8f0;
  border-radius: 999px;
  overflow: hidden;
  margin: 8px 0;
}

.fpo-progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #15803d 0%, #10b981 100%);
  border-radius: 999px;
  transition: width 0.4s ease;
}

.fpo-pool-card {
  border: 1.5px solid var(--border-default);
  background: #ffffff;
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: var(--transition-normal);
  box-shadow: var(--shadow-card);
}

.fpo-pool-card:hover {
  border-color: #86efac;
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.badge-fpo {
  background: #e0e7ff;
  color: #3730a3;
  border: 1px solid #c7d2fe;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: var(--radius-full);
}

/* =============================================================
   LIVE REAL-TIME AUTO-SYNC INDICATOR BADGE
   ============================================================= */
.live-sync-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #f0fdf4;
  border: 1.5px solid #86efac;
  color: #166534;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 700;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  white-space: nowrap;
  user-select: none;
  transition: all 0.25s ease;
}

.live-sync-badge .live-pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: #16a34a;
  box-shadow: 0 0 0 0 rgba(22, 163, 74, 0.7);
  animation: pulse-sync-dot 2s infinite ease-in-out;
  flex-shrink: 0;
}

@keyframes pulse-sync-dot {
  0% {
    box-shadow: 0 0 0 0 rgba(22, 163, 74, 0.7);
    transform: scale(0.95);
  }
  70% {
    box-shadow: 0 0 0 6px rgba(22, 163, 74, 0);
    transform: scale(1.1);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(22, 163, 74, 0);
    transform: scale(0.95);
  }
}

.live-sync-badge .live-sync-title {
  color: #15803d;
  font-weight: 800;
  letter-spacing: 0.2px;
}

.live-sync-badge .live-sync-time {
  color: #0f172a;
  background: #ffffff;
  padding: 2px 7px;
  border-radius: 6px;
  border: 1px solid #bbf7d0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.72rem;
  font-weight: 700;
}

.live-sync-badge.synced-pulse {
  background: #dcfce7;
  border-color: #22c55e;
  transform: scale(1.03);
}



