/* ============================================================
   PANTIGAME — User Dashboard & Auth Pages
   ============================================================ */

/* ── Dashboard Layout ── */
.pg-dashboard {
  padding-block: var(--space-10);
  min-height: 100vh;
}
.pg-dashboard-layout {
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr;
  gap: var(--space-8);
  align-items: start;
}

/* ── Dashboard Sidebar ── */
.pg-dash-sidebar {
  position: sticky;
  top: calc(var(--header-height) + var(--space-6));
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}

.pg-dash-profile-card {
  background: var(--color-bg-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  text-align: center;
  position: relative;
  overflow: hidden;
}
.pg-dash-profile-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 80px;
  background: var(--gradient-primary);
  opacity: 0.15;
}
.pg-dash-avatar-wrap {
  position: relative;
  width: 80px;
  height: 80px;
  margin: 0 auto var(--space-4);
}
.pg-dash-avatar {
  width: 80px; height: 80px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--color-primary);
  box-shadow: var(--shadow-primary);
}
.pg-dash-avatar-online {
  position: absolute;
  bottom: 2px;
  left: 2px;
  width: 16px; height: 16px;
  background: var(--color-success);
  border: 2.5px solid var(--color-bg-2);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--color-success-glow);
}

.pg-dash-username {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-bold);
  margin-bottom: var(--space-1);
}
.pg-dash-email {
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
  margin-bottom: var(--space-4);
}
.pg-dash-member-since {
  font-size: var(--font-size-xs);
  color: var(--color-text-subtle);
}
.pg-dash-vip-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 5px 16px;
  border-radius: var(--radius-full);
  background: var(--gradient-vip);
  color: #0f172a;
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-black);
  margin-bottom: var(--space-5);
  letter-spacing: var(--letter-spacing-wide);
}

/* Sidebar Nav */
.pg-dash-nav {
  background: var(--color-bg-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  overflow: hidden;
}
.pg-dash-nav-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: 13px var(--space-5);
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
  text-decoration: none;
  border-bottom: 1px solid var(--color-border);
  transition: all var(--transition-fast);
  position: relative;
}
.pg-dash-nav-item:last-child { border-bottom: none; }
.pg-dash-nav-item .nav-icon {
  width: 34px; height: 34px;
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
  background: var(--color-bg-3);
  transition: all var(--transition-fast);
  flex-shrink: 0;
}
.pg-dash-nav-item .nav-label { flex: 1; font-weight: var(--font-weight-medium); }
.pg-dash-nav-item .nav-count {
  min-width: 20px; height: 20px;
  background: var(--color-secondary);
  color: #fff;
  font-size: 10px;
  font-weight: var(--font-weight-bold);
  border-radius: var(--radius-full);
  display: flex; align-items: center; justify-content: center;
  padding: 0 5px;
}

.pg-dash-nav-item:hover,
.pg-dash-nav-item.active {
  background: rgba(56,189,248,0.06);
  color: var(--color-primary);
}
.pg-dash-nav-item:hover .nav-icon,
.pg-dash-nav-item.active .nav-icon {
  background: rgba(56,189,248,0.12);
  color: var(--color-primary);
}
.pg-dash-nav-item.active::before {
  content: '';
  position: absolute;
  right: 0;
  top: 0; bottom: 0;
  width: 3px;
  background: var(--gradient-primary);
  border-radius: 3px 0 0 3px;
}
.pg-dash-nav-item.danger { color: var(--color-secondary); }
.pg-dash-nav-item.danger:hover { background: rgba(244,63,94,0.06); }

/* ── Dashboard Main Content ── */
.pg-dash-main { min-width: 0; }

/* Stats Cards */
.pg-dash-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-5);
  margin-bottom: var(--space-8);
}
.pg-stat-card {
  background: var(--color-bg-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  transition: all var(--transition-normal);
  overflow: hidden;
  position: relative;
}
.pg-stat-card::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
}
.pg-stat-card.cyan::after  { background: var(--gradient-primary); }
.pg-stat-card.rose::after  { background: var(--gradient-secondary); }
.pg-stat-card.amber::after { background: var(--gradient-vip); }
.pg-stat-card.green::after { background: linear-gradient(90deg, #22c55e, #4ade80); }

.pg-stat-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.pg-stat-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}
.pg-stat-card-icon {
  width: 48px; height: 48px;
  border-radius: var(--radius-lg);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
}
.pg-stat-card.cyan  .pg-stat-card-icon { background: rgba(56,189,248,0.12);  color: var(--color-primary); }
.pg-stat-card.rose  .pg-stat-card-icon { background: rgba(244,63,94,0.12);   color: var(--color-secondary); }
.pg-stat-card.amber .pg-stat-card-icon { background: rgba(251,191,36,0.12);  color: var(--color-vip); }
.pg-stat-card.green .pg-stat-card-icon { background: rgba(34,197,94,0.12);   color: var(--color-success); }

.pg-stat-card-trend {
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  padding: 3px 8px;
  border-radius: var(--radius-full);
}
.pg-stat-card-trend.up   { background: rgba(34,197,94,0.12);  color: var(--color-success); }
.pg-stat-card-trend.down { background: rgba(244,63,94,0.12);  color: var(--color-secondary); }

.pg-stat-card-value {
  font-size: var(--font-size-3xl);
  font-weight: var(--font-weight-black);
  line-height: 1;
}
.pg-stat-card-label {
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
  font-weight: var(--font-weight-medium);
}

/* Dashboard Widgets */
.pg-dash-widgets {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: var(--space-6);
  margin-bottom: var(--space-6);
}

.pg-widget {
  background: var(--color-bg-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  overflow: hidden;
}
.pg-widget-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-5) var(--space-6);
  border-bottom: 1px solid var(--color-border);
}
.pg-widget-title {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-bold);
  letter-spacing: var(--letter-spacing-wide);
}
.pg-widget-body { padding: var(--space-5) var(--space-6); }

/* Notification Pills */
.pg-notification-item {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-4) 0;
  border-bottom: 1px solid var(--color-border);
}
.pg-notification-item:last-child { border-bottom: none; }
.pg-notif-icon {
  width: 38px; height: 38px;
  border-radius: var(--radius-lg);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}
.pg-notif-icon.success { background: rgba(34,197,94,0.12);  color: var(--color-success); }
.pg-notif-icon.error   { background: rgba(244,63,94,0.12);  color: var(--color-secondary); }
.pg-notif-icon.warning { background: rgba(251,191,36,0.12); color: var(--color-vip); }
.pg-notif-icon.info    { background: rgba(129,140,248,0.12);color: var(--color-info); }

.pg-notif-content { flex: 1; min-width: 0; }
.pg-notif-title {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text);
  margin-bottom: 3px;
}
.pg-notif-desc {
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pg-notif-time {
  font-size: 10px;
  color: var(--color-text-subtle);
  white-space: nowrap;
}

/* Messages Widget */
.pg-message-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4) 0;
  border-bottom: 1px solid var(--color-border);
}
.pg-message-item:last-child { border-bottom: none; }
.pg-msg-avatar {
  width: 38px; height: 38px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--color-border);
  flex-shrink: 0;
}
.pg-msg-content { flex: 1; min-width: 0; }
.pg-msg-name {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  margin-bottom: 2px;
}
.pg-msg-preview {
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pg-msg-unread {
  width: 8px; height: 8px;
  background: var(--color-primary);
  border-radius: 50%;
  box-shadow: var(--shadow-primary);
  flex-shrink: 0;
}

/* Recent Lists */
.pg-dash-bottom {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-6);
}

/* Order Item */
.pg-order-item {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-4) 0;
  border-bottom: 1px solid var(--color-border);
}
.pg-order-item:last-child { border-bottom: none; }
.pg-order-img {
  width: 48px; height: 48px;
  border-radius: var(--radius-lg);
  object-fit: cover;
  border: 1px solid var(--color-border);
  flex-shrink: 0;
}
.pg-order-info { flex: 1; min-width: 0; }
.pg-order-name {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  margin-bottom: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pg-order-date { font-size: var(--font-size-xs); color: var(--color-text-subtle); }
.pg-order-price { font-size: var(--font-size-sm); font-weight: var(--font-weight-bold); color: var(--color-success); white-space: nowrap; }

@media (max-width: 1200px) { .pg-dash-stats { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 1024px) {
  .pg-dashboard-layout { grid-template-columns: 1fr; }
  .pg-dash-sidebar { position: static; }
  .pg-dash-widgets { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .pg-dash-stats { grid-template-columns: 1fr 1fr; }
  .pg-dash-bottom { grid-template-columns: 1fr; }
}

/* ── Auth Pages (Login / Register) ── */
.pg-auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  padding: var(--space-6);
  background: var(--gradient-hero);
  overflow: hidden;
}
.pg-auth-bg-particles {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}
.pg-auth-particle {
  position: absolute;
  width: 300px; height: 300px;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.12;
  animation: auth-float 8s ease-in-out infinite;
}
.pg-auth-particle:nth-child(1) { background: var(--color-primary); top: -100px; right: -100px; animation-delay: 0s; }
.pg-auth-particle:nth-child(2) { background: var(--color-secondary); bottom: -100px; left: -100px; animation-delay: 3s; }
.pg-auth-particle:nth-child(3) { background: var(--color-vip); top: 50%; left: 50%; animation-delay: 6s; }
@keyframes auth-float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50%       { transform: translate(20px, -20px) scale(1.1); }
}

.pg-auth-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 440px;
  background: var(--color-bg-glass);
  backdrop-filter: var(--blur-lg);
  -webkit-backdrop-filter: var(--blur-lg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-2xl);
  padding: var(--space-10);
  box-shadow: var(--shadow-xl);
  animation: fadeInUp 0.5s ease;
}

.pg-auth-logo {
  text-align: center;
  margin-bottom: var(--space-8);
}
.pg-auth-logo img { height: 52px; margin: 0 auto var(--space-3); }
.pg-auth-logo h2 {
  font-size: var(--font-size-2xl);
  font-weight: var(--font-weight-black);
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.pg-auth-logo p { font-size: var(--font-size-sm); color: var(--color-text-muted); margin-top: var(--space-2); }

/* Tab Switcher */
.pg-auth-tabs {
  display: flex;
  background: var(--color-bg-3);
  border-radius: var(--radius-lg);
  padding: 4px;
  margin-bottom: var(--space-8);
}
.pg-auth-tab {
  flex: 1;
  padding: 9px;
  border-radius: var(--radius-md);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  text-align: center;
  cursor: pointer;
  transition: all var(--transition-normal);
  color: var(--color-text-muted);
  border: none;
  background: transparent;
}
.pg-auth-tab.active {
  background: var(--color-bg-2);
  color: var(--color-text);
  box-shadow: var(--shadow-sm);
}

/* Form */
.pg-auth-form { display: none; }
.pg-auth-form.active { display: block; animation: fadeInUp 0.3s ease; }

.pg-auth-form .pg-input:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-glow), 0 0 16px var(--color-primary-glow);
}
.pg-auth-input-icon { position: relative; }
.pg-auth-input-icon .pg-input { padding-right: 44px; }
.pg-auth-input-icon .input-icon {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-text-subtle);
  font-size: 16px;
  pointer-events: none;
}
.pg-auth-input-icon .input-toggle {
  pointer-events: all;
  cursor: pointer;
  transition: color var(--transition-fast);
}
.pg-auth-input-icon .input-toggle:hover { color: var(--color-primary); }

.pg-auth-form-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-6);
  font-size: var(--font-size-sm);
}
.pg-remember-me {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  cursor: pointer;
  color: var(--color-text-muted);
}
.pg-remember-me input[type="checkbox"] { accent-color: var(--color-primary); width: 15px; height: 15px; }

.pg-auth-submit {
  width: 100%;
  padding: 14px;
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-bold);
  border-radius: var(--radius-lg);
  background: var(--gradient-primary);
  color: #0f172a;
  border: none;
  cursor: pointer;
  transition: all var(--transition-normal);
  letter-spacing: var(--letter-spacing-wide);
  position: relative;
  overflow: hidden;
}
.pg-auth-submit::before {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 100%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transition: left 0.5s ease;
}
.pg-auth-submit:hover::before { left: 100%; }
.pg-auth-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px var(--color-primary-glow);
}

.pg-auth-divider {
  text-align: center;
  position: relative;
  margin-block: var(--space-6);
  color: var(--color-text-subtle);
  font-size: var(--font-size-sm);
}
.pg-auth-divider::before,
.pg-auth-divider::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 42%;
  height: 1px;
  background: var(--color-border);
}
.pg-auth-divider::before { right: 0; }
.pg-auth-divider::after  { left: 0; }

.pg-auth-social { display: flex; gap: var(--space-3); margin-bottom: var(--space-6); }
.pg-auth-social-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 11px;
  border-radius: var(--radius-lg);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  background: var(--color-bg-3);
  border: 1px solid var(--color-border);
  color: var(--color-text);
  cursor: pointer;
  transition: all var(--transition-fast);
}
.pg-auth-social-btn:hover {
  border-color: var(--color-primary);
  background: rgba(56,189,248,0.08);
}

/* Captcha */
.pg-captcha-wrap {
  background: var(--color-bg-3);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-5);
}
