/* forsab2b — Pagination component */

.pg {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  width: 100%;
  box-sizing: border-box;
  padding: 1rem 1.25rem 1.15rem;
  border-top: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(124, 58, 237, 0.04) 0%, transparent 55%);
}

.pg-toolbar {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  width: 100%;
}

.pg-meta {
  display: inline-flex;
  flex: 0 1 auto;
  align-items: center;
  gap: 0.5rem;
  min-height: 2.5rem;
  padding: 0.4rem 0.9rem 0.4rem 0.55rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  box-shadow: var(--shadow-xs);
  white-space: nowrap;
}

.pg-meta-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 50%;
  background: rgba(124, 58, 237, 0.12);
  color: var(--primary);
  flex-shrink: 0;
}

.pg-meta-text {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
}

.pg-meta-text strong {
  color: var(--text);
  font-weight: 800;
}

.pg-controls {
  display: inline-flex;
  flex: 0 0 auto;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.35rem;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.pg-btn {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  min-width: 2.5rem;
  height: 2.5rem;
  padding: 0 0.7rem;
  border-radius: 10px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.18s var(--ease), color 0.18s var(--ease), border-color 0.18s var(--ease), transform 0.18s var(--ease), box-shadow 0.18s var(--ease);
}

.pg-btn:hover:not(.is-disabled) {
  background: rgba(124, 58, 237, 0.1);
  border-color: rgba(124, 58, 237, 0.25);
  color: var(--primary);
  transform: translateY(-1px);
}

.pg-btn.is-disabled {
  opacity: 0.35;
  cursor: not-allowed;
  pointer-events: none;
}

.pg-btn--icon {
  min-width: 2.5rem;
  padding: 0;
}

.pg-pages {
  display: inline-flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.25rem;
  padding: 0 0.2rem;
}

.pg-page {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  min-width: 2.35rem;
  height: 2.35rem;
  padding: 0 0.45rem;
  border-radius: 9px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  transition: background 0.18s var(--ease), color 0.18s var(--ease), box-shadow 0.18s var(--ease);
}

.pg-page:hover:not(.is-active) {
  background: var(--surface-2);
  color: var(--text);
}

.pg-page.is-active {
  background: linear-gradient(135deg, var(--primary) 0%, #6366f1 100%);
  color: #fff;
  box-shadow: 0 4px 16px rgba(124, 58, 237, 0.38);
}

.pg-ellipsis {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.5rem;
  height: 2.35rem;
  color: var(--text-tertiary);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.08em;
  user-select: none;
}

.pg-size {
  display: inline-flex;
  flex: 0 0 auto;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.55rem;
  white-space: nowrap;
}

.pg-size-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-tertiary);
}

.pg-size-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.pg-size-select {
  appearance: none;
  -webkit-appearance: none;
  min-width: 4.75rem;
  height: 2.5rem;
  padding: 0 2.1rem 0 0.85rem;
  border-radius: 10px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  box-shadow: var(--shadow-xs);
  transition: border-color 0.18s var(--ease), box-shadow 0.18s var(--ease);
}

.pg-size-select:hover,
.pg-size-select:focus {
  outline: none;
  border-color: rgba(124, 58, 237, 0.45);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.14);
}

.pg-size-chevron {
  position: absolute;
  inset-inline-end: 0.7rem;
  pointer-events: none;
  color: var(--text-tertiary);
}

html[data-color-mode="dark"] .pg-size-select {
  color-scheme: dark;
  background: rgba(20, 20, 34, 0.95);
  border-color: rgba(255, 255, 255, 0.14);
  color: #f4f4f5;
}

html[data-color-mode="dark"]:not([data-theme="admin"]) .pg {
  background: linear-gradient(180deg, rgba(124, 58, 237, 0.07) 0%, transparent 55%);
}

html[data-color-mode="dark"][data-theme="admin"] .pg {
  background: linear-gradient(180deg, rgba(251, 191, 36, 0.07) 0%, transparent 55%);
}

html[data-color-mode="dark"] .pg-controls {
  background: rgba(16, 16, 28, 0.92);
}

[data-theme="admin"] .pg-meta-icon {
  background: rgba(217, 119, 6, 0.14);
  color: var(--primary);
}

[data-theme="admin"] .pg-page.is-active {
  background: linear-gradient(135deg, #d97706 0%, #f59e0b 100%);
  box-shadow: 0 4px 16px rgba(217, 119, 6, 0.28);
  color: #fff;
}

html[data-color-mode="dark"][data-theme="admin"] .pg-page.is-active {
  background: linear-gradient(135deg, #f59e0b 0%, #fbbf24 100%);
  box-shadow: 0 4px 16px rgba(245, 158, 11, 0.32);
  color: #0f0f14;
}

[data-theme="admin"] .pg-btn:hover:not(.is-disabled) {
  background: rgba(217, 119, 6, 0.12);
  border-color: rgba(217, 119, 6, 0.28);
  color: var(--primary);
}

[data-theme="admin"] .pg-size-select {
  color-scheme: light;
  background: var(--surface);
  border-color: rgba(217, 119, 6, 0.28);
  color: var(--text);
}

html[data-color-mode="dark"][data-theme="admin"] .pg-size-select {
  color-scheme: dark;
  background: rgba(12, 12, 20, 0.95);
  border-color: rgba(251, 191, 36, 0.2);
  color: #f4f4f5;
}

[data-theme="admin"] .pg-size-select:hover,
[data-theme="admin"] .pg-size-select:focus {
  border-color: rgba(217, 119, 6, 0.45);
  box-shadow: 0 0 0 3px rgba(217, 119, 6, 0.12);
}

@media (max-width: 960px) {
  .pg-toolbar {
    flex-wrap: wrap;
    justify-content: center;
  }

  .pg-meta,
  .pg-size {
    flex: 1 1 100%;
    justify-content: center;
  }

  .pg-controls {
    flex: 1 1 100%;
    justify-content: center;
    flex-wrap: wrap;
  }
}

@media (max-width: 560px) {
  .pg-btn-label {
    display: none;
  }

  .pg {
    padding-inline: 0.85rem;
  }
}
