/* MashPOS offline POS — network indicator with optional queue badge */

#mashposNetStatus {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-left: 0.75rem;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.2;
  max-width: min(420px, 55vw);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  position: relative;
}

#mashposNetStatus .mashpos-net-icon {
  font-size: 1rem;
  flex-shrink: 0;
}

#mashposNetStatus .mashpos-net-queue-badge {
  display: none;
  align-items: center;
  justify-content: center;
  min-width: 1.15rem;
  height: 1.15rem;
  padding: 0 0.3rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1;
  flex-shrink: 0;
}

#mashposNetStatus.is-online {
  background: #d1fae5;
  color: #065f46;
}

#mashposNetStatus.is-online.has-queue .mashpos-net-queue-badge {
  display: inline-flex;
  background: #f59e0b;
  color: #fff;
}

#mashposNetStatus.is-offline {
  background: #fee2e2;
  color: #991b1b;
  animation: mashpos-net-pulse 1.2s ease-in-out infinite;
}

#mashposNetStatus.is-offline.has-queue .mashpos-net-queue-badge {
  display: inline-flex;
  background: #dc2626;
  color: #fff;
}

#mashposNetStatus.has-queue-click {
  cursor: pointer;
}

@keyframes mashpos-net-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.55; }
}

.mashpos-login-net {
  margin: 0.75rem auto 0;
  max-width: 420px;
  justify-content: center;
}

.mashpos-offline-queue-row {
  text-align: left;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 0.65rem 0.75rem;
  margin-bottom: 0.5rem;
  font-size: 0.85rem;
}

.mashpos-offline-queue-row.status-failed {
  border-color: #fca5a5;
  background: #fef2f2;
}

.mashpos-offline-queue-row.status-synced {
  border-color: #86efac;
  background: #f0fdf4;
}

.mashpos-offline-queue-row.status-pending,
.mashpos-offline-queue-row.status-syncing {
  border-color: #fcd34d;
  background: #fffbeb;
}

/* Non-Swal toasts — must not dismiss SweetAlert2 modals (low stock, etc.) */
.mashpos-toast-host {
  position: fixed;
  top: 0.85rem;
  right: 0.85rem;
  z-index: 20000;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.45rem;
  pointer-events: none;
  max-width: min(360px, calc(100vw - 1.5rem));
}

.mashpos-toast {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 0.65rem 0.85rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.35;
  color: #0f172a;
  background: #fff;
  border: 1px solid #e2e8f0;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity 0.22s ease, transform 0.22s ease;
  pointer-events: none;
}

.mashpos-toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.mashpos-toast-icon {
  flex-shrink: 0;
  margin-top: 0.1rem;
  font-size: 1rem;
}

.mashpos-toast-text {
  flex: 1;
  min-width: 0;
}

.mashpos-toast--success {
  border-color: #86efac;
  background: #f0fdf4;
  color: #14532d;
}

.mashpos-toast--success .mashpos-toast-icon {
  color: #16a34a;
}

.mashpos-toast--error {
  border-color: #fca5a5;
  background: #fef2f2;
  color: #7f1d1d;
}

.mashpos-toast--error .mashpos-toast-icon {
  color: #dc2626;
}

.mashpos-toast--warning {
  border-color: #fcd34d;
  background: #fffbeb;
  color: #78350f;
}

.mashpos-toast--warning .mashpos-toast-icon {
  color: #d97706;
}

.mashpos-toast--info {
  border-color: #93c5fd;
  background: #eff6ff;
  color: #1e3a8a;
}

.mashpos-toast--info .mashpos-toast-icon {
  color: #2563eb;
}
