/* ==============================================================================
   Admin Dashboard Styles — เจ๊น้ำพารวย
   Modern Obsidian Dark Luxury Theme with Violet & Neon Accents
   ============================================================================== */

:root {
  --bg-main: #090714;
  --bg-surface: #120e24;
  --bg-surface-elevated: #1a1435;
  --bg-card: rgba(22, 17, 44, 0.75);
  --bg-card-hover: rgba(30, 23, 60, 0.85);

  --border-subtle: rgba(168, 85, 247, 0.15);
  --border-highlight: rgba(168, 85, 247, 0.4);
  --border-focus: #a855f7;

  --color-primary: #a855f7;
  --color-primary-light: #c084fc;
  --color-primary-dark: #7e22ce;
  --color-primary-glow: rgba(168, 85, 247, 0.35);

  --color-gold: #f59e0b;
  --color-gold-light: #fbbf24;
  --color-gold-glow: rgba(245, 158, 11, 0.35);

  --color-success: #10b981;
  --color-success-light: #34d399;
  --color-success-glow: rgba(16, 185, 129, 0.3);

  --color-danger: #ef4444;
  --color-danger-light: #f87171;
  --color-danger-glow: rgba(239, 68, 68, 0.3);

  --color-warning: #f97316;
  --color-warning-light: #fb923c;

  --text-main: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;

  --font-thai: 'Noto Sans Thai', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'Outfit', 'Noto Sans Thai', monospace;

  --sidebar-width: 260px;
  --topbar-height: 64px;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 9999px;

  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body.admin-body {
  font-family: var(--font-thai);
  background-color: var(--bg-main);
  color: var(--text-main);
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  background-image: 
    radial-gradient(circle at 15% 15%, rgba(112, 64, 196, 0.12) 0%, transparent 45%),
    radial-gradient(circle at 85% 75%, rgba(168, 85, 247, 0.08) 0%, transparent 45%);
  background-attachment: fixed;
  overflow-x: hidden;
}

/* Scrollbars */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: rgba(15, 11, 30, 0.6);
}
::-webkit-scrollbar-thumb {
  background: rgba(168, 85, 247, 0.3);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(168, 85, 247, 0.6);
}

/* Glassmorphism Card Utility */
.card-glass {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.6);
  transition: border-color var(--transition-normal), box-shadow var(--transition-normal);
}
.card-glass:hover {
  border-color: rgba(168, 85, 247, 0.3);
}

/* ==============================================================================
   Admin Auth Gate Overlay (Login)
   ============================================================================== */
.admin-auth-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(9, 7, 20, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.auth-box {
  width: 100%;
  max-width: 440px;
  padding: 2.25rem 2rem;
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(168, 85, 247, 0.35);
  box-shadow: 0 20px 50px -10px rgba(112, 64, 196, 0.3), 0 0 0 1px rgba(168, 85, 247, 0.2);
}

.auth-box-glow {
  position: absolute;
  top: -80px;
  left: 50%;
  transform: translateX(-50%);
  width: 260px;
  height: 160px;
  background: radial-gradient(circle, rgba(168, 85, 247, 0.4) 0%, transparent 70%);
  filter: blur(30px);
  pointer-events: none;
}

.auth-header {
  text-align: center;
  margin-bottom: 1.5rem;
}

.auth-logo-badge {
  width: 56px;
  height: 56px;
  margin: 0 auto 0.75rem;
  background: linear-gradient(135deg, #7040c4, #a855f7);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  font-weight: 800;
  color: #fff;
  box-shadow: 0 8px 24px var(--color-primary-glow);
}

.auth-header h2 {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-main);
}

.auth-subtitle {
  font-size: 0.875rem;
  color: var(--text-muted);
}

.auth-shield-notice {
  background: rgba(168, 85, 247, 0.1);
  border: 1px solid rgba(168, 85, 247, 0.25);
  border-radius: var(--radius-md);
  padding: 0.875rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.shield-icon {
  font-size: 1.5rem;
}

.auth-shield-notice strong {
  display: block;
  font-size: 0.875rem;
  color: var(--color-primary-light);
}

.auth-shield-notice p {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

.input-password-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.input-password-wrapper input {
  padding-right: 44px;
}

.btn-toggle-eye {
  position: absolute;
  right: 10px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.1rem;
  padding: 4px;
  opacity: 0.7;
  transition: opacity var(--transition-fast);
}
.btn-toggle-eye:hover {
  opacity: 1;
}

.auth-back-link {
  text-align: center;
  margin-top: 1.25rem;
}

.auth-back-link a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.85rem;
  transition: color var(--transition-fast);
}
.auth-back-link a:hover {
  color: var(--color-primary-light);
}

.auth-error-banner {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: var(--color-danger-light);
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Telegram 2FA OTP Gate Styles */
.telegram-2fa-notice {
  background: rgba(0, 136, 204, 0.12) !important;
  border-color: rgba(0, 136, 204, 0.35) !important;
}

.telegram-2fa-notice strong {
  color: #38bdf8 !important;
}

.tg-icon {
  font-size: 1.6rem;
  filter: drop-shadow(0 0 6px rgba(56, 189, 248, 0.5));
}

.otp-input-wrapper {
  margin: 1.25rem 0 0.75rem;
}

.otp-input-large {
  font-size: 2rem !important;
  font-weight: 700 !important;
  letter-spacing: 0.5rem !important;
  text-align: center !important;
  font-family: var(--font-mono, monospace) !important;
  padding: 0.85rem 1rem !important;
  background: rgba(15, 11, 30, 0.75) !important;
  border: 2px solid rgba(168, 85, 247, 0.4) !important;
  border-radius: var(--radius-lg) !important;
  color: #f8fafc !important;
  transition: all var(--transition-fast);
  max-width: 320px;
  margin: 0 auto;
  display: block;
}

.otp-input-large:focus {
  border-color: #38bdf8 !important;
  box-shadow: 0 0 20px rgba(56, 189, 248, 0.35) !important;
  outline: none;
}

.otp-timer-box {
  margin-top: 0.65rem;
  display: flex;
  justify-content: center;
}

.otp-timer-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.3rem 0.75rem;
  border-radius: 9999px;
  background: rgba(251, 191, 36, 0.12);
  color: #fbbf24;
  border: 1px solid rgba(251, 191, 36, 0.3);
  transition: all var(--transition-fast);
}

.otp-timer-badge.expired {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border-color: rgba(239, 68, 68, 0.35);
}

.otp-actions-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  gap: 0.5rem;
  flex-wrap: wrap;
}

.btn-text-action {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.825rem;
  cursor: pointer;
  padding: 0.35rem 0.5rem;
  border-radius: var(--radius-sm);
  transition: color var(--transition-fast), background var(--transition-fast);
}

.btn-text-action:hover:not(:disabled) {
  color: var(--color-primary-light);
  background: rgba(255, 255, 255, 0.05);
}

.btn-text-action:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.form-actions-split {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  flex-wrap: wrap;
}

.form-actions-split .btn-primary,
.form-actions-split .btn-secondary {
  flex: 1;
  min-width: 140px;
}

.telegram-server-badge-box {
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
  margin-bottom: 1.25rem;
}

.badge-status-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
  color: #34d399;
  font-size: 0.9rem;
}

.status-indicator-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #34d399;
  box-shadow: 0 0 8px #34d399;
  display: inline-block;
}

/* ==============================================================================
   Admin Layout Framework (TopBar + Sidebar + Main)
   ============================================================================== */
.admin-layout {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* TopBar */
.admin-topbar {
  height: var(--topbar-height);
  background: rgba(15, 11, 30, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-subtle);
  position: sticky;
  top: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.admin-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
}

.brand-badge {
  width: 38px;
  height: 38px;
  background: linear-gradient(135deg, #7040c4, #a855f7);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.25rem;
  color: #fff;
  box-shadow: 0 4px 14px var(--color-primary-glow);
}

.brand-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.tag-admin {
  background: rgba(168, 85, 247, 0.2);
  color: var(--color-primary-light);
  font-size: 0.65rem;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid rgba(168, 85, 247, 0.35);
  letter-spacing: 0.05em;
}

.brand-status {
  font-size: 0.725rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 5px;
}

.pulse-dot {
  width: 7px;
  height: 7px;
  background: var(--color-success);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--color-success);
  animation: pulseDot 2s infinite;
}

@keyframes pulseDot {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

/* Center Ticker */
.topbar-center {
  display: flex;
  align-items: center;
}

.ticker-pill {
  background: rgba(22, 17, 44, 0.7);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  padding: 0.35rem 1rem;
  font-size: 0.8rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.ticker-icon {
  color: var(--color-gold);
}

/* TopBar Right */
.topbar-right {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.realtime-clock {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.btn-topbar-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.825rem;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: all var(--transition-fast);
}
.btn-topbar-link:hover {
  background: rgba(168, 85, 247, 0.15);
  border-color: rgba(168, 85, 247, 0.3);
  color: var(--text-main);
}

.admin-user-menu {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding-left: 0.75rem;
  border-left: 1px solid var(--border-subtle);
}

.user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, #f59e0b, #ef4444);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
}

.user-meta strong {
  display: block;
  font-size: 0.825rem;
  color: var(--text-main);
  line-height: 1.2;
}

.user-meta small {
  font-size: 0.7rem;
  color: var(--color-primary-light);
}

.btn-logout {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: var(--color-danger-light);
  padding: 0.35rem 0.65rem;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  cursor: pointer;
  transition: all var(--transition-fast);
}
.btn-logout:hover {
  background: var(--color-danger);
  color: #fff;
}

/* ==============================================================================
   Admin Container: Sidebar & Main Area
   ============================================================================== */
.admin-container {
  display: flex;
  flex: 1;
}

/* Sidebar */
.admin-sidebar {
  width: var(--sidebar-width);
  background: rgba(15, 11, 30, 0.9);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-right: 1px solid var(--border-subtle);
  padding: 1.5rem 1rem;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  min-height: calc(100vh - var(--topbar-height));
}

.sidebar-section-title {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
  padding-left: 0.5rem;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.nav-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 0.85rem;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-align: left;
}
.nav-item:hover {
  background: rgba(168, 85, 247, 0.1);
  color: var(--text-main);
  border-color: rgba(168, 85, 247, 0.2);
}
.nav-item.active {
  background: linear-gradient(90deg, rgba(168, 85, 247, 0.25), rgba(112, 64, 196, 0.15));
  border-color: rgba(168, 85, 247, 0.4);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 4px 16px rgba(112, 64, 196, 0.2);
}

.nav-icon {
  font-size: 1.15rem;
}
.nav-text {
  flex: 1;
}

.nav-badge {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
}
.badge-active-count {
  background: rgba(16, 185, 129, 0.2);
  color: var(--color-success-light);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.nav-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-gold);
  box-shadow: 0 0 6px var(--color-gold);
}

.sidebar-quick-tools {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.btn-quick-action {
  width: 100%;
  background: linear-gradient(135deg, #7040c4, #a855f7);
  color: #fff;
  border: none;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 0.825rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
  box-shadow: 0 4px 12px var(--color-primary-glow);
}
.btn-quick-action:hover {
  transform: translateY(-1px);
  filter: brightness(1.1);
}
.btn-quick-action.secondary {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  box-shadow: none;
}
.btn-quick-action.secondary:hover {
  background: rgba(168, 85, 247, 0.15);
  color: var(--text-main);
  border-color: rgba(168, 85, 247, 0.3);
}

.sidebar-footer-info {
  margin-top: auto;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-subtle);
}

.sys-version {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.sys-version strong {
  color: var(--color-primary-light);
}

.sidebar-footer-info small {
  font-size: 0.7rem;
  color: var(--text-muted);
  opacity: 0.7;
}

/* ==============================================================================
   Main Content Panels
   ============================================================================== */
.admin-main {
  flex: 1;
  padding: 2rem 2.5rem;
  max-width: 1600px;
  overflow-y: auto;
}

.admin-tab-pane {
  display: none;
}
.admin-tab-pane.active {
  display: block;
  animation: fadeIn 0.25s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.tab-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.75rem;
  gap: 1rem;
  flex-wrap: wrap;
}

.breadcrumb {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}
.breadcrumb strong {
  color: var(--color-primary-light);
}

.page-title {
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-main);
}

.tab-header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* ==============================================================================
   KPI Cards Grid (Overview)
   ============================================================================== */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
  margin-bottom: 1.75rem;
}

.kpi-card {
  background: var(--bg-card);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.35rem;
  position: relative;
  overflow: hidden;
  transition: all var(--transition-normal);
}
.kpi-card:hover {
  transform: translateY(-3px);
  border-color: rgba(168, 85, 247, 0.4);
  box-shadow: 0 12px 28px -8px rgba(0, 0, 0, 0.5);
}

.kpi-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.kpi-icon {
  font-size: 1.4rem;
}

.kpi-tag {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.kpi-tag.success {
  background: rgba(16, 185, 129, 0.15);
  color: var(--color-success-light);
  border: 1px solid rgba(16, 185, 129, 0.3);
}
.kpi-tag.warning {
  background: rgba(245, 158, 11, 0.15);
  color: var(--color-gold-light);
  border: 1px solid rgba(245, 158, 11, 0.3);
}
.kpi-tag.primary {
  background: rgba(168, 85, 247, 0.15);
  color: var(--color-primary-light);
  border: 1px solid rgba(168, 85, 247, 0.3);
}
.kpi-tag.gold {
  background: rgba(245, 158, 11, 0.2);
  color: var(--color-gold-light);
  border: 1px solid rgba(245, 158, 11, 0.4);
}
.kpi-tag.danger {
  background: rgba(239, 68, 68, 0.15);
  color: var(--color-danger-light);
  border: 1px solid rgba(239, 68, 68, 0.3);
}
.kpi-tag.dark {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
}

.kpi-value {
  font-family: var(--font-mono);
  font-size: 2rem;
  font-weight: 800;
  line-height: 1.1;
  color: var(--text-main);
  margin-bottom: 0.35rem;
}

.kpi-card.glow-green .kpi-value { color: var(--color-success-light); }
.kpi-card.glow-amber .kpi-value { color: var(--color-gold-light); }
.kpi-card.glow-purple .kpi-value { color: var(--color-primary-light); }
.kpi-card.glow-gold .kpi-value { color: var(--color-gold-light); }

.kpi-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.kpi-footer {
  font-size: 0.725rem;
  color: var(--text-secondary);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding-top: 0.6rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

/* Overview Widgets Row */
.overview-analytics-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  margin-bottom: 1.75rem;
}

.panel-widget {
  padding: 1.5rem;
}

.widget-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
}
.widget-head h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
}
.widget-subtitle {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.ratio-bar-wrapper {
  margin-bottom: 1.25rem;
}
.ratio-bar {
  height: 14px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-full);
  overflow: hidden;
  display: flex;
}
.bar-seg {
  height: 100%;
  transition: width 0.5s ease;
}
.seg-active { background: var(--color-success); }
.seg-expiring { background: var(--color-gold); }
.seg-expired { background: var(--color-danger); }
.seg-banned { background: #64748b; }

.ratio-legends {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  font-size: 0.8rem;
  color: var(--text-secondary);
}
.legend-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.legend-item .dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
}
.dot.active { background: var(--color-success); }
.dot.expiring { background: var(--color-gold); }
.dot.expired { background: var(--color-danger); }
.dot.banned { background: #64748b; }

.system-feature-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.feature-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 0.85rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-md);
}
.feature-info strong {
  display: block;
  font-size: 0.85rem;
  color: var(--text-main);
}
.feature-info small {
  font-size: 0.725rem;
  color: var(--text-muted);
}

/* ==============================================================================
   Data Tables & Controls
   ============================================================================== */
.table-widget, .table-container {
  padding: 1.5rem;
}

.table-controls {
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.search-box {
  position: relative;
  flex: 1;
  min-width: 260px;
}
.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.9rem;
  opacity: 0.6;
}
.search-box input {
  width: 100%;
  padding-left: 36px;
  padding-right: 32px;
}

.btn-clear-search {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.85rem;
}

.filter-pills {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.pill-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-secondary);
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius-full);
  font-family: inherit;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all var(--transition-fast);
}
.pill-btn:hover {
  background: rgba(168, 85, 247, 0.15);
  color: var(--text-main);
  border-color: rgba(168, 85, 247, 0.3);
}
.pill-btn.active {
  background: linear-gradient(135deg, #7040c4, #a855f7);
  border-color: transparent;
  color: #fff;
  font-weight: 600;
  box-shadow: 0 4px 12px var(--color-primary-glow);
}

.sort-select-wrapper {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}
.sort-select-wrapper select {
  padding: 0.35rem 0.75rem;
  font-size: 0.8rem;
}

.table-responsive {
  overflow-x: auto;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  text-align: left;
}

.admin-table th {
  padding: 0.85rem 1rem;
  background: rgba(255, 255, 255, 0.02);
  color: var(--text-muted);
  font-weight: 600;
  border-bottom: 1px solid var(--border-subtle);
  white-space: nowrap;
}

.admin-table td {
  padding: 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  color: var(--text-secondary);
  vertical-align: middle;
}

.admin-table tbody tr {
  transition: background var(--transition-fast);
}
.admin-table tbody tr:hover {
  background: rgba(168, 85, 247, 0.06);
}

.member-cell {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.member-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #7040c4, #3b82f6);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}
.member-avatar.vip {
  background: linear-gradient(135deg, #f59e0b, #ef4444);
}
.member-avatar.manual {
  background: linear-gradient(135deg, #10b981, #06b6d4);
}

.member-info strong {
  display: block;
  font-size: 0.9rem;
  color: var(--text-main);
  line-height: 1.2;
}
.member-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
  display: flex;
  gap: 0.4rem;
  margin-top: 2px;
}

.tag-badge {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 4px;
}
.tag-badge.vip {
  background: rgba(245, 158, 11, 0.2);
  color: var(--color-gold-light);
  border: 1px solid rgba(245, 158, 11, 0.35);
}
.tag-badge.slip {
  background: rgba(16, 185, 129, 0.15);
  color: var(--color-success-light);
}
.tag-badge.manual {
  background: rgba(59, 130, 246, 0.2);
  color: #93c5fd;
}

.ref-code {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  background: rgba(0, 0, 0, 0.3);
  padding: 3px 6px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-secondary);
}

.amount-val {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--color-gold-light);
}

.countdown-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: var(--radius-full);
}
.countdown-pill.active {
  background: rgba(16, 185, 129, 0.15);
  color: var(--color-success-light);
  border: 1px solid rgba(16, 185, 129, 0.3);
}
.countdown-pill.expiring {
  background: rgba(245, 158, 11, 0.15);
  color: var(--color-gold-light);
  border: 1px solid rgba(245, 158, 11, 0.3);
  animation: pulseAmber 2s infinite;
}
.countdown-pill.expired {
  background: rgba(239, 68, 68, 0.15);
  color: var(--color-danger-light);
  border: 1px solid rgba(239, 68, 68, 0.3);
}
.countdown-pill.lifetime {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.25), rgba(168, 85, 247, 0.25));
  color: var(--color-gold-light);
  border: 1px solid rgba(245, 158, 11, 0.4);
}

@keyframes pulseAmber {
  0% { opacity: 0.8; }
  50% { opacity: 1; }
  100% { opacity: 0.8; }
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: var(--radius-full);
}
.status-badge.active {
  background: rgba(16, 185, 129, 0.15);
  color: var(--color-success-light);
}
.status-badge.expiring {
  background: rgba(245, 158, 11, 0.15);
  color: var(--color-gold-light);
}
.status-badge.expired {
  background: rgba(239, 68, 68, 0.15);
  color: var(--color-danger-light);
}
.status-badge.banned {
  background: rgba(255, 255, 255, 0.08);
  color: #94a3b8;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

/* Action Dropdown / Action Buttons */
.action-buttons-group {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.35rem;
}

.btn-table-action {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-secondary);
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.75rem;
  cursor: pointer;
  transition: all var(--transition-fast);
}
.btn-table-action:hover {
  background: rgba(168, 85, 247, 0.2);
  border-color: rgba(168, 85, 247, 0.4);
  color: #fff;
}
.btn-table-action.danger:hover {
  background: rgba(239, 68, 68, 0.25);
  border-color: rgba(239, 68, 68, 0.4);
  color: var(--color-danger-light);
}
.btn-table-action.success:hover {
  background: rgba(16, 185, 129, 0.25);
  border-color: rgba(16, 185, 129, 0.4);
  color: var(--color-success-light);
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 3rem 1.5rem;
}
.empty-icon {
  font-size: 3rem;
  opacity: 0.6;
  margin-bottom: 0.75rem;
  display: block;
}
.empty-state h3 {
  font-size: 1.2rem;
  color: var(--text-main);
  margin-bottom: 0.35rem;
}
.empty-state p {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
}

.table-pagination-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ==============================================================================
   Slips Stats Row
   ============================================================================== */
.slip-stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 1.25rem;
}
.mini-stat-card {
  padding: 1.15rem 1.25rem;
}
.mini-stat-title {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}
.mini-stat-val {
  font-family: var(--font-mono);
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--text-main);
}
.text-success { color: var(--color-success-light) !important; }
.text-warning { color: var(--color-gold-light) !important; }
.text-gold { color: var(--color-gold-light) !important; }
.text-danger { color: var(--color-danger-light) !important; }

/* ==============================================================================
   Forms & Inputs
   ============================================================================== */
.two-column-grid, .settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(420px, 1fr));
  gap: 1.5rem;
}

.form-card {
  padding: 1.75rem 2rem;
}
.card-head {
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.card-head h3 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.25rem;
}
.card-head p {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.admin-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.form-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
}

input[type="text"],
input[type="password"],
input[type="number"],
select,
textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  background: rgba(15, 11, 30, 0.8);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-family: inherit;
  font-size: 0.9rem;
  transition: all var(--transition-fast);
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.25);
  background: rgba(20, 15, 40, 0.95);
}

.form-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Toggle Switches */
.toggle-row {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-md);
}
.toggle-label {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-main);
}
.toggle-row small {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.switch {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 26px;
  flex-shrink: 0;
}
.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: rgba(255, 255, 255, 0.15);
  transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
input:checked + .slider {
  background-color: var(--color-primary);
}
input:checked + .slider.slider-danger {
  background-color: var(--color-danger);
}
input:checked + .slider:before {
  transform: translateX(22px);
}
.slider.round {
  border-radius: 34px;
}
.slider.round:before {
  border-radius: 50%;
}

/* Buttons */
.btn-primary {
  background: linear-gradient(135deg, #7040c4, #a855f7);
  color: #fff;
  border: none;
  padding: 0.75rem 1.4rem;
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: all var(--transition-fast);
  box-shadow: 0 4px 16px var(--color-primary-glow);
}
.btn-primary:hover {
  transform: translateY(-1px);
  filter: brightness(1.1);
  box-shadow: 0 6px 20px var(--color-primary-glow);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  transition: all var(--transition-fast);
}
.btn-secondary:hover {
  background: rgba(168, 85, 247, 0.15);
  border-color: rgba(168, 85, 247, 0.35);
}

.btn-danger {
  background: rgba(239, 68, 68, 0.2);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: var(--color-danger-light);
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}
.btn-danger:hover {
  background: var(--color-danger);
  color: #fff;
}

.btn-block {
  width: 100%;
}

.btn-refresh {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  padding: 0.65rem 1rem;
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 0.85rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: all var(--transition-fast);
}
.btn-refresh:hover {
  background: rgba(168, 85, 247, 0.15);
  color: var(--text-main);
}

/* Announcement Preview Box */
.announcement-preview-box {
  background: rgba(0, 0, 0, 0.3);
  padding: 1.25rem;
  border-radius: var(--radius-md);
  border: 1px dashed var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.announcement-banner-preview {
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.85rem;
  box-shadow: 0 4px 14px rgba(0,0,0,0.3);
}
.announcement-banner-preview.type-gold {
  background: linear-gradient(90deg, #78350f, #92400e, #b45309);
  border: 1px solid rgba(251, 191, 36, 0.4);
  color: #fef3c7;
}
.announcement-banner-preview.type-info {
  background: linear-gradient(90deg, #311042, #4c1d95);
  border: 1px solid rgba(168, 85, 247, 0.4);
  color: #f3e8ff;
}
.announcement-banner-preview.type-success {
  background: linear-gradient(90deg, #064e3b, #047857);
  border: 1px solid rgba(52, 211, 153, 0.4);
  color: #d1fae5;
}
.announcement-banner-preview.type-warning {
  background: linear-gradient(90deg, #7c2d12, #c2410c);
  border: 1px solid rgba(251, 146, 60, 0.4);
  color: #ffedd5;
}

.ann-preview-icon {
  font-size: 1.25rem;
}
.ann-preview-text {
  flex: 1;
}
.ann-preview-btn {
  background: rgba(255, 255, 255, 0.2);
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 700;
}

/* Backup Actions Grid */
.backup-actions-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
.backup-box {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 0.75rem;
}
.backup-box strong {
  font-size: 0.95rem;
  color: var(--text-main);
}
.backup-box p {
  font-size: 0.775rem;
  color: var(--text-muted);
}
.backup-box.danger-box {
  border-color: rgba(239, 68, 68, 0.25);
  background: rgba(239, 68, 68, 0.04);
}

.file-upload-btn {
  cursor: pointer;
  text-align: center;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* ==============================================================================
   Modals
   ============================================================================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(9, 7, 20, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.modal-window {
  width: 100%;
  max-width: 540px;
  padding: 2rem;
  max-height: 90vh;
  overflow-y: auto;
  border: 1px solid rgba(168, 85, 247, 0.35);
  box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(168, 85, 247, 0.2);
  animation: modalPop 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.modal-header h3 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-main);
}
.modal-header p {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.btn-modal-close {
  background: rgba(255, 255, 255, 0.08);
  border: none;
  color: var(--text-secondary);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 1rem;
  cursor: pointer;
  transition: all var(--transition-fast);
}
.btn-modal-close:hover {
  background: rgba(239, 68, 68, 0.2);
  color: var(--color-danger-light);
}

.modal-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.input-with-action {
  display: flex;
  gap: 0.5rem;
}
.input-with-action input {
  flex: 1;
}

.duration-preset-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
}

.preset-btn, .preset-extend-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-secondary);
  padding: 0.6rem 0.5rem;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.775rem;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-align: center;
}
.preset-btn:hover, .preset-extend-btn:hover {
  background: rgba(168, 85, 247, 0.15);
  border-color: rgba(168, 85, 247, 0.3);
  color: var(--text-main);
}
.preset-btn.active, .preset-extend-btn.active {
  background: linear-gradient(135deg, #7040c4, #a855f7);
  border-color: transparent;
  color: #fff;
  font-weight: 700;
  box-shadow: 0 4px 12px var(--color-primary-glow);
}
.preset-btn.special, .preset-extend-btn.special {
  border-color: rgba(245, 158, 11, 0.3);
}
.preset-btn.special.active, .preset-extend-btn.special.active {
  background: linear-gradient(135deg, #d97706, #b45309);
  box-shadow: 0 4px 12px var(--color-gold-glow);
}

.extend-current-status {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.85rem;
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  margin-top: 0.5rem;
}

/* ==============================================================================
   Toast Notification
   ============================================================================== */
.admin-toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 100000;
  background: rgba(18, 14, 36, 0.95);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(168, 85, 247, 0.4);
  color: #fff;
  padding: 0.85rem 1.4rem;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 500;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6), 0 0 16px var(--color-primary-glow);
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.admin-toast.show {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

/* ==============================================================================
   Mobile & Responsive Adjustments
   ============================================================================== */
.mobile-only {
  display: none;
}

@media (max-width: 1024px) {
  .overview-analytics-row {
    grid-template-columns: 1fr;
  }
  .backup-actions-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .mobile-only {
    display: inline-flex;
  }

  .topbar-center, .realtime-clock, .user-meta {
    display: none;
  }

  .admin-sidebar {
    position: fixed;
    top: var(--topbar-height);
    left: -100%;
    bottom: 0;
    z-index: 999;
    width: 280px;
    transition: left 0.3s ease;
  }
  .admin-sidebar.open {
    left: 0;
    box-shadow: 10px 0 30px rgba(0, 0, 0, 0.7);
  }

  .admin-main {
    padding: 1.25rem 1rem;
  }

  .kpi-grid {
    grid-template-columns: 1fr 1fr;
  }

  .two-column-grid, .settings-grid {
    grid-template-columns: 1fr;
  }

  .duration-preset-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .kpi-grid {
    grid-template-columns: 1fr;
  }
  .table-controls {
    flex-direction: column;
    align-items: stretch;
  }
}

@keyframes spin {
  100% { transform: rotate(360deg); }
}

.spinning {
  display: inline-block;
  animation: spin 1s linear infinite;
}

/* ==============================================================================
   PR Marketing User Management Styles (ยูส PR การตลาด)
   ============================================================================== */
.badge-pr-count {
  background: rgba(168, 85, 247, 0.25) !important;
  color: #d8b4fe !important;
  border: 1px solid rgba(168, 85, 247, 0.5) !important;
  box-shadow: 0 0 10px rgba(168, 85, 247, 0.2);
}

.kpi-card.glow-pr {
  border-color: rgba(168, 85, 247, 0.35);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4), 0 0 20px rgba(168, 85, 247, 0.15);
}

.kpi-tag.pr {
  background: rgba(168, 85, 247, 0.2);
  color: #e9d5ff;
  border: 1px solid rgba(168, 85, 247, 0.4);
}

.pr-user-cell {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.pr-username-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  color: #f1f5f9;
  font-size: 0.95rem;
}

.pr-display-sub {
  font-size: 0.8rem;
  color: #94a3b8;
}

.pr-role-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 6px;
  background: rgba(168, 85, 247, 0.2);
  color: #d8b4fe;
  border: 1px solid rgba(168, 85, 247, 0.4);
  width: fit-content;
  margin-top: 3px;
}

.pr-pw-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 4px 8px;
  border-radius: 8px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.85rem;
  color: #cbd5e1;
}

.btn-mini-action {
  background: transparent;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 4px;
  font-size: 0.8rem;
  transition: color 0.18s, background 0.18s;
}

.btn-mini-action:hover {
  color: #f8fafc;
  background: rgba(255, 255, 255, 0.1);
}

.pr-preview-box {
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(168, 85, 247, 0.35);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  margin-bottom: 1rem;
}

.pr-preview-title {
  font-size: 0.8rem;
  font-weight: 700;
  color: #c084fc;
  margin-bottom: 6px;
}

.pr-preview-url {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.82rem;
  color: #38bdf8;
  word-break: break-all;
  background: rgba(0, 0, 0, 0.4);
  padding: 6px 10px;
  border-radius: 6px;
  border: 1px dashed rgba(56, 189, 248, 0.3);
}

.pr-preview-tip {
  display: block;
  font-size: 0.72rem;
  color: #94a3b8;
  margin-top: 6px;
}

.pr-share-textarea {
  width: 100%;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-md);
  padding: 12px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.85rem;
  color: #f1f5f9;
  line-height: 1.5;
  resize: none;
}

.pr-share-textarea:focus {
  outline: none;
  border-color: #a855f7;
  box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.2);
}

.action-btn-group {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  flex-wrap: nowrap;
}

.btn-table-action {
  padding: 5px 10px;
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 600;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.05);
  color: #cbd5e1;
  cursor: pointer;
  transition: all 0.18s;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.btn-table-action:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.25);
  transform: translateY(-1px);
}

.btn-table-action.primary-pr {
  background: rgba(168, 85, 247, 0.2);
  border-color: rgba(168, 85, 247, 0.4);
  color: #e9d5ff;
}

.btn-table-action.primary-pr:hover {
  background: rgba(168, 85, 247, 0.35);
  border-color: rgba(168, 85, 247, 0.6);
  color: #ffffff;
}

.btn-table-action.danger-action {
  color: #f87171;
  border-color: rgba(239, 68, 68, 0.3);
  background: rgba(239, 68, 68, 0.1);
}

.btn-table-action.danger-action:hover {
  background: rgba(239, 68, 68, 0.25);
  color: #ffffff;
}

