/* ============================================================
   KR Dev X — Ultra-Premium Dark Luxury Admin Panel Styles
   ============================================================ */

/* ── Admin Root Shell ── */
.admin-shell {
  display: flex;
  min-height: 100vh;
  width: 100%;
  background: #09090b;
  color: #f4f4f5;
  font-family: 'Poppins', var(--font-family, -apple-system, BlinkMacSystemFont, sans-serif);
  position: relative;
  overflow-x: hidden;
}

/* ── Left Sticky Sidebar ── */
.admin-sidebar {
  width: 270px;
  min-width: 270px;
  background: rgba(12, 12, 16, 0.96);
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 1.5rem 1.1rem;
  position: sticky;
  top: 0;
  height: 100vh;
  box-sizing: border-box;
  z-index: 100;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.admin-sidebar-top {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* Brand Header */
.admin-sidebar-brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.5rem 0.6rem;
  text-decoration: none;
}

.admin-sidebar-logo {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.3), rgba(109, 40, 217, 0.15));
  border: 1px solid rgba(139, 92, 246, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #c084fc;
  font-size: 1.35rem;
  box-shadow: 0 0 20px rgba(139, 92, 246, 0.3);
  flex-shrink: 0;
}

.admin-sidebar-title-box {
  display: flex;
  flex-direction: column;
}

.admin-sidebar-brand-name {
  font-size: 1.1rem;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.3px;
  line-height: 1.2;
}

.admin-sidebar-live-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.68rem;
  font-weight: 700;
  color: #4ade80;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 2px;
}

.admin-sidebar-live-tag .pulse-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #4ade80;
  box-shadow: 0 0 8px #4ade80;
  animation: adminPulseDot 2s infinite ease-in-out;
}

@keyframes adminPulseDot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.8); }
}

/* Upload CTA inside Sidebar */
.admin-sidebar-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  width: 100%;
  padding: 0.75rem 1rem;
  background: linear-gradient(135deg, #8B5CF6 0%, #6D28D9 100%);
  border: 1px solid rgba(139, 92, 246, 0.6);
  border-radius: 12px;
  color: #ffffff;
  font-size: 0.86rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 18px rgba(139, 92, 246, 0.4);
  transition: all 0.25s ease;
  text-decoration: none;
  box-sizing: border-box;
}

.admin-sidebar-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(139, 92, 246, 0.55);
  background: linear-gradient(135deg, #a78bfa 0%, #7c3aed 100%);
}

.admin-sidebar-cta i {
  font-size: 0.95rem;
}

/* Navigation List */
.admin-sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.admin-nav-section-title {
  font-size: 0.68rem;
  font-weight: 800;
  color: #71717a;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  padding: 0.5rem 0.75rem 0.25rem;
}

.admin-nav-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.7rem 0.85rem;
  border-radius: 10px;
  color: #a1a1aa;
  font-size: 0.88rem;
  font-weight: 600;
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  width: 100%;
  box-sizing: border-box;
  text-align: left;
}

.admin-nav-item-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.admin-nav-item-left i {
  font-size: 1rem;
  width: 20px;
  text-align: center;
  color: #71717a;
  transition: color 0.2s ease;
}

.admin-nav-item:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #ffffff;
}

.admin-nav-item:hover .admin-nav-item-left i {
  color: #c084fc;
}

.admin-nav-item.active {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.2), rgba(109, 40, 217, 0.12));
  border-color: rgba(139, 92, 246, 0.45);
  color: #ffffff;
  box-shadow: 0 4px 16px rgba(139, 92, 246, 0.18);
}

.admin-nav-item.active .admin-nav-item-left i {
  color: #c084fc;
}

.admin-nav-badge {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.1);
  color: #e4e4e7;
}

.admin-nav-item.active .admin-nav-badge {
  background: rgba(139, 92, 246, 0.35);
  color: #c084fc;
}

/* Sidebar Bottom Box */
.admin-sidebar-bottom {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.admin-sidebar-user-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.75rem;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.admin-sidebar-user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(139, 92, 246, 0.25);
  border: 1px solid rgba(139, 92, 246, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #c084fc;
  font-size: 0.95rem;
}

.admin-sidebar-user-info {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.admin-sidebar-user-name {
  font-size: 0.82rem;
  font-weight: 700;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin-sidebar-user-role {
  font-size: 0.68rem;
  color: #a1a1aa;
}

.admin-sidebar-btn-row {
  display: flex;
  gap: 0.5rem;
}

.admin-sidebar-btn-sub {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.5rem 0.6rem;
  font-size: 0.78rem;
  font-weight: 600;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #d4d4d8;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
}

.admin-sidebar-btn-sub:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

.admin-sidebar-btn-sub.danger {
  color: #f87171;
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.25);
}

.admin-sidebar-btn-sub.danger:hover {
  background: #ef4444;
  color: #ffffff;
}

/* ── Main Content Area ── */
.admin-main {
  flex: 1;
  min-width: 0;
  padding: 2rem 2.5rem 5rem;
  box-sizing: border-box;
  overflow-y: auto;
  animation: adminFadeIn 0.35s ease;
}

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

/* Main Top Header */
.admin-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  flex-wrap: wrap;
  gap: 1.25rem;
}

.admin-top-title-group h1 {
  font-size: 1.75rem;
  font-weight: 800;
  color: #ffffff;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  letter-spacing: -0.4px;
}

.admin-top-title-group p {
  font-size: 0.85rem;
  color: #a1a1aa;
  margin: 4px 0 0;
}

.admin-top-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* Mobile Toggle */
.admin-mobile-header {
  display: none;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  background: rgba(12, 12, 16, 0.98);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  position: sticky;
  top: 0;
  z-index: 99;
}

.admin-mobile-toggle {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  cursor: pointer;
}

.admin-mobile-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(6px);
  z-index: 99;
}

/* ── KPI & Stats Cards Grid ── */
.admin-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
  margin-bottom: 2rem;
}
/* Masked (limited) admins see 3 KPI cards instead of 4 */
.admin-kpi-grid-3 {
  grid-template-columns: repeat(3, 1fr);
}

.admin-kpi-card {
  background: rgba(14, 14, 20, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  padding: 1.35rem 1.4rem;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.admin-kpi-card:hover {
  transform: translateY(-3px);
  border-color: rgba(139, 92, 246, 0.4);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.6), 0 0 24px rgba(139, 92, 246, 0.12);
}

.admin-kpi-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.admin-kpi-icon-box {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
}

.admin-kpi-icon-box.purple {
  background: rgba(139, 92, 246, 0.15);
  color: #c084fc;
  border: 1px solid rgba(139, 92, 246, 0.35);
}

.admin-kpi-icon-box.green {
  background: rgba(34, 197, 94, 0.15);
  color: #4ade80;
  border: 1px solid rgba(34, 197, 94, 0.35);
}

.admin-kpi-icon-box.amber {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.35);
}

.admin-kpi-icon-box.blue {
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.35);
}

.admin-kpi-icon-box.red {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.35);
}

.admin-kpi-trend {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: 20px;
}

.admin-kpi-trend.negative,
.admin-kpi-trend.danger {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.admin-kpi-trend.positive {
  background: rgba(34, 197, 94, 0.15);
  color: #4ade80;
  border: 1px solid rgba(34, 197, 94, 0.3);
}

.admin-kpi-trend.neutral {
  background: rgba(139, 92, 246, 0.15);
  color: #c084fc;
  border: 1px solid rgba(139, 92, 246, 0.3);
}

.admin-kpi-info {
  display: flex;
  flex-direction: column;
}

.admin-kpi-value {
  font-size: 1.75rem;
  font-weight: 800;
  color: #ffffff;
  line-height: 1.1;
  letter-spacing: -0.6px;
}

.admin-kpi-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  color: #a1a1aa;
  margin-top: 4px;
}

.admin-kpi-sparkline {
  height: 24px;
  width: 100%;
}

.admin-kpi-sparkline svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

/* ── Two Column Overview Grid ── */
.admin-analytics-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

/* Ranked Items List */
.admin-ranked-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.admin-ranked-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 0.9rem;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  gap: 0.85rem;
  transition: all 0.2s ease;
}

.admin-ranked-item:hover {
  background: rgba(139, 92, 246, 0.06);
  border-color: rgba(139, 92, 246, 0.3);
  transform: translateX(4px);
}

.admin-rank-badge {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
  font-size: 0.75rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #a1a1aa;
  flex-shrink: 0;
}

.admin-rank-badge.top-1 {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #ffffff;
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.4);
}

.admin-rank-badge.top-2 {
  background: rgba(200, 200, 210, 0.25);
  color: #e4e4e7;
}

.admin-rank-badge.top-3 {
  background: rgba(180, 115, 60, 0.25);
  color: #d97706;
}

.admin-ranked-thumb {
  width: 48px;
  height: 30px;
  border-radius: 6px;
  object-fit: cover;
  background: #000;
  border: 1px solid rgba(255, 255, 255, 0.1);
  flex-shrink: 0;
}

.admin-ranked-details {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.admin-ranked-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin-ranked-sub {
  font-size: 0.72rem;
  color: #a1a1aa;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
}

.admin-ranked-metric {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.admin-ranked-downloads {
  font-size: 0.82rem;
  font-weight: 700;
  color: #4ade80;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Category Progress Bars */
.admin-category-progress-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.admin-cat-progress-item {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.admin-cat-progress-label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  font-weight: 600;
  color: #e4e4e7;
}

.admin-cat-progress-count {
  font-size: 0.75rem;
  color: #a1a1aa;
}

.admin-cat-progress-track {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  overflow: hidden;
}

.admin-cat-progress-fill {
  height: 100%;
  border-radius: 10px;
  background: linear-gradient(90deg, #8B5CF6, #c084fc);
  transition: width 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Quick Action Shortcuts Card */
.admin-shortcuts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-top: 1rem;
}

.admin-shortcut-btn {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.8rem 1rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 12px;
  color: #ffffff;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  font-family: inherit;
}

.admin-shortcut-btn i {
  font-size: 1rem;
  color: #8B5CF6;
}

.admin-shortcut-btn:hover {
  background: rgba(139, 92, 246, 0.12);
  border-color: rgba(139, 92, 246, 0.4);
  transform: translateY(-2px);
}

/* ── Content Sections (Glass Container) ── */
.admin-card-section {
  background: rgba(14, 14, 20, 0.88);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  padding: 1.75rem;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.4);
  margin-bottom: 2rem;
}

.admin-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  flex-wrap: wrap;
  gap: 1rem;
}

.admin-section-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.admin-section-title i {
  color: #8B5CF6;
}

/* ── Bulk Actions Floating Toolbar ── */
.admin-bulk-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(135deg, rgba(24, 18, 40, 0.95), rgba(16, 12, 28, 0.95));
  border: 1px solid rgba(139, 92, 246, 0.45);
  border-radius: 14px;
  padding: 0.8rem 1.25rem;
  margin-bottom: 1.25rem;
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.6), 0 0 25px rgba(139, 92, 246, 0.2);
  animation: adminSlideDown 0.25s ease;
  flex-wrap: wrap;
  gap: 0.75rem;
}

@keyframes adminSlideDown {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.admin-bulk-info {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.88rem;
  font-weight: 700;
  color: #ffffff;
}

.admin-bulk-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 24px;
  padding: 0 0.5rem;
  border-radius: 20px;
  background: #8B5CF6;
  color: #ffffff;
  font-size: 0.78rem;
  font-weight: 800;
  box-shadow: 0 0 10px rgba(139, 92, 246, 0.5);
}

.admin-bulk-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.admin-bulk-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0.5rem 0.95rem;
  font-size: 0.82rem;
  font-weight: 700;
  border-radius: 9px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.2s ease;
  font-family: inherit;
}

.admin-bulk-btn.success {
  background: rgba(34, 197, 94, 0.18);
  border-color: rgba(34, 197, 94, 0.45);
  color: #4ade80;
}

.admin-bulk-btn.success:hover {
  background: #22c55e;
  border-color: #22c55e;
  color: #ffffff;
  box-shadow: 0 0 15px rgba(34, 197, 94, 0.4);
  transform: translateY(-1px);
}

.admin-bulk-btn.warning {
  background: rgba(245, 158, 11, 0.18);
  border-color: rgba(245, 158, 11, 0.45);
  color: #fbbf24;
}

.admin-bulk-btn.warning:hover {
  background: #f59e0b;
  border-color: #f59e0b;
  color: #ffffff;
  box-shadow: 0 0 15px rgba(245, 158, 11, 0.4);
  transform: translateY(-1px);
}

.admin-bulk-btn.danger {
  background: rgba(239, 68, 68, 0.18);
  border-color: rgba(239, 68, 68, 0.45);
  color: #f87171;
}

.admin-bulk-btn.danger:hover {
  background: #ef4444;
  border-color: #ef4444;
  color: #ffffff;
  box-shadow: 0 0 15px rgba(239, 68, 68, 0.4);
  transform: translateY(-1px);
}

.admin-bulk-btn.secondary {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.12);
  color: #d4d4d8;
}

.admin-bulk-btn.secondary:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.25);
  color: #ffffff;
}

/* ── Filter Bar & Search ── */
.admin-filters-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}

.admin-search-box {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1;
  min-width: 260px;
  height: 42px;
}

.admin-search-icon {
  position: absolute;
  left: 0.95rem;
  color: #71717a;
  font-size: 0.9rem;
  pointer-events: none;
}

.admin-search-input {
  width: 100%;
  height: 42px;
  padding: 0 2.5rem 0 2.4rem;
  background: rgba(14, 14, 20, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  color: #ffffff;
  font-size: 0.86rem;
  font-family: inherit;
  outline: none;
  transition: all 0.2s ease;
  box-sizing: border-box;
}

.admin-search-input:focus {
  border-color: #8B5CF6;
  background: rgba(139, 92, 246, 0.08);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.2);
}

.admin-search-clear {
  position: absolute;
  right: 0.75rem;
  background: transparent;
  border: none;
  color: #71717a;
  cursor: pointer;
  font-size: 0.9rem;
  padding: 4px;
}

.admin-search-clear:hover {
  color: #ffffff;
}

.admin-filter-selects {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
}

/* Custom Styled Luxury Select Dropdowns */
.admin-filter-select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  height: 42px;
  padding: 0 2.2rem 0 1rem;
  background: rgba(14, 14, 20, 0.9) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23a1a1aa' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E") no-repeat right 0.85rem center;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  color: #e4e4e7;
  font-size: 0.84rem;
  font-weight: 600;
  font-family: inherit;
  outline: none;
  cursor: pointer;
  transition: all 0.2s ease;
  box-sizing: border-box;
  white-space: nowrap;
}

.admin-filter-select:hover {
  border-color: rgba(139, 92, 246, 0.4);
  background-color: rgba(20, 20, 28, 0.95);
  color: #ffffff;
}

.admin-filter-select:focus {
  border-color: #8B5CF6;
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.18);
  color: #ffffff;
}

.admin-filter-select option {
  background: #0d0d12;
  color: #ffffff;
  padding: 8px 12px;
}

/* ── Products Table Styling ── */
.admin-table-container {
  overflow-x: auto;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.25);
}

.kr-admin-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.kr-admin-table th {
  background: rgba(255, 255, 255, 0.03);
  padding: 0.9rem 1rem;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #a1a1aa;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  white-space: nowrap;
}

.kr-admin-table td {
  padding: 0.9rem 1rem;
  font-size: 0.85rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  vertical-align: middle;
}

.kr-admin-table tr:last-child td {
  border-bottom: none;
}

.kr-admin-table tr:hover td {
  background: rgba(139, 92, 246, 0.04);
}

.kr-admin-table tr.selected td {
  background: rgba(139, 92, 246, 0.12);
}

/* Checkboxes */
.admin-checkbox {
  width: 17px;
  height: 17px;
  border-radius: 4px;
  accent-color: #8B5CF6;
  cursor: pointer;
}

.table-thumb {
  width: 58px;
  height: 34px;
  aspect-ratio: 16 / 9;
  border-radius: 6px;
  object-fit: cover;
  display: block;
  background: #000;
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: transform 0.2s ease;
}

.table-thumb:hover {
  transform: scale(1.15);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6);
}

.table-product-title {
  font-weight: 600;
  color: #ffffff;
  display: block;
  max-width: 260px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.table-category-badge {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #e4e4e7;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.table-price-pill {
  font-size: 0.72rem;
  font-weight: 800;
  padding: 0.25rem 0.7rem;
  border-radius: 20px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
}

.table-price-pill:hover {
  transform: scale(1.08);
}

.table-price-pill.free {
  background: rgba(34, 197, 94, 0.16);
  color: #4ade80;
  border: 1px solid rgba(34, 197, 94, 0.4);
}

.table-price-pill.free:hover {
  background: rgba(34, 197, 94, 0.25);
  box-shadow: 0 0 12px rgba(34, 197, 94, 0.35);
}

.table-price-pill.vip {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.22), rgba(217, 119, 6, 0.15));
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.55);
  box-shadow: 0 0 14px rgba(245, 158, 11, 0.25);
  letter-spacing: 0.5px;
}

.table-price-pill.vip:hover {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.35), rgba(217, 119, 6, 0.25));
  box-shadow: 0 0 18px rgba(245, 158, 11, 0.45);
}

.table-status-indicator {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  transition: all 0.15s ease;
}

.table-status-indicator:hover {
  background: rgba(255, 255, 255, 0.06);
}

.table-status-indicator.active {
  color: #4ade80;
}

.table-status-indicator.inactive {
  color: #71717a;
}

.status-live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 8px currentColor;
}

.table-actions-group {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.table-action-btn {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #a1a1aa;
  cursor: pointer;
  transition: all 0.15s ease;
  font-size: 0.85rem;
}

.table-action-btn:hover {
  background: rgba(139, 92, 246, 0.15);
  border-color: rgba(139, 92, 246, 0.4);
  color: #c084fc;
}

.table-action-btn.delete:hover {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.4);
  color: #f87171;
}

/* ── Generic Admin Buttons ── */
.admin-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 1.15rem;
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: 10px;
  cursor: pointer;
  transition: all var(--transition-fast, 0.2s);
  text-decoration: none;
  font-family: inherit;
  border: 1px solid transparent;
}

.admin-btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #e4e4e7;
}

.admin-btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
  color: #ffffff;
}

.admin-btn-danger {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #f87171;
}

.admin-btn-danger:hover {
  background: #ef4444;
  color: #ffffff;
  box-shadow: 0 4px 18px rgba(239, 68, 68, 0.35);
}

.admin-btn-primary {
  background: linear-gradient(135deg, #8B5CF6 0%, #6D28D9 100%);
  border: 1px solid rgba(139, 92, 246, 0.5);
  color: #ffffff;
  box-shadow: 0 4px 16px rgba(139, 92, 246, 0.35);
}

.admin-btn-primary:hover {
  background: linear-gradient(135deg, #a78bfa 0%, #7c3aed 100%);
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(139, 92, 246, 0.5);
}

/* ── Modern Form Styles ── */
.admin-form-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

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

.admin-form-group.full {
  grid-column: 1 / -1;
}

.admin-field-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: #d4d4d8;
  display: flex;
  align-items: center;
  gap: 6px;
}

.admin-input,
.admin-textarea,
.admin-select {
  width: 100%;
  padding: 0.75rem 1rem;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  color: #ffffff;
  font-size: 0.88rem;
  font-family: inherit;
  outline: none;
  transition: all 0.2s ease;
  box-sizing: border-box;
}

.admin-input:focus,
.admin-textarea:focus,
.admin-select:focus {
  border-color: #8B5CF6;
  background: rgba(139, 92, 246, 0.05);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.15);
}

.admin-input::placeholder,
.admin-textarea::placeholder {
  color: #52525b;
}

.admin-textarea {
  min-height: 110px;
  resize: vertical;
  line-height: 1.5;
}

.admin-select option {
  background: #09090b;
  color: #ffffff;
}

/* ── Badge picker (combinable promo badges) ── */
.admin-badge-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.admin-badge-option {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0.6rem 0.9rem;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.4px;
  color: #71717a;
  cursor: pointer;
  user-select: none;
  transition: all 0.18s ease;
}

.admin-badge-option:hover {
  border-color: rgba(255, 255, 255, 0.22);
  color: #d4d4d8;
}

.admin-badge-option input {
  width: 15px;
  height: 15px;
  margin: 0;
  border-radius: 4px;
  cursor: pointer;
}

.admin-badge-option i {
  font-size: 0.8rem;
}

/* Each badge lights up in its own storefront colour once ticked, so the form
   previews what the card will look like. */
.admin-badge-option.new  input { accent-color: #22c55e; }
.admin-badge-option.hot  input { accent-color: #f97316; }
.admin-badge-option.vip  input { accent-color: #8B5CF6; }

.admin-badge-option.new:has(input:checked) {
  background: rgba(16, 185, 129, 0.14);
  border-color: rgba(16, 185, 129, 0.5);
  color: #6ee7b7;
}

.admin-badge-option.hot:has(input:checked) {
  background: rgba(244, 63, 94, 0.14);
  border-color: rgba(244, 63, 94, 0.5);
  color: #fda4af;
}

.admin-badge-option.vip:has(input:checked) {
  background: rgba(139, 92, 246, 0.16);
  border-color: rgba(139, 92, 246, 0.5);
  color: #c4b5fd;
}

.admin-field-hint {
  font-size: 0.72rem;
  line-height: 1.5;
  color: #71717a;
}

.admin-form-footer {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 1rem;
  padding-top: 1.5rem;
  margin-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

/* ── Dedicated Banner Cards (Visual Studio Controls) ── */
.banner-config-card {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 1.5rem;
  margin-bottom: 2rem;
  transition: all 0.25s ease;
}

.banner-config-card:hover {
  border-color: rgba(139, 92, 246, 0.35);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.banner-config-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.banner-config-title {
  font-size: 1rem;
  font-weight: 700;
  color: #c084fc;
  display: flex;
  align-items: center;
  gap: 8px;
}

.banner-size-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.25rem 0.65rem;
  border-radius: 6px;
  background: rgba(139, 92, 246, 0.15);
  border: 1px solid rgba(139, 92, 246, 0.3);
  color: #c084fc;
}

.banner-controls-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
  background: rgba(255, 255, 255, 0.02);
  padding: 1.15rem;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  margin-bottom: 1.25rem;
}

.admin-slider-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.admin-slider-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  font-weight: 600;
  color: #d4d4d8;
}

.admin-slider-value {
  font-size: 0.75rem;
  font-weight: 800;
  padding: 0.15rem 0.55rem;
  border-radius: 6px;
  background: rgba(139, 92, 246, 0.2);
  color: #c084fc;
  border: 1px solid rgba(139, 92, 246, 0.4);
  font-family: monospace;
}

.admin-range-input {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  outline: none;
  cursor: pointer;
  transition: background 0.2s;
}

.admin-range-input:hover {
  background: rgba(139, 92, 246, 0.25);
}

.admin-range-input::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #8B5CF6;
  border: 2px solid #ffffff;
  box-shadow: 0 0 10px rgba(139, 92, 246, 0.8);
  cursor: pointer;
  transition: transform 0.15s ease;
}

.admin-range-input::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

.fit-mode-selector {
  display: flex;
  gap: 0.4rem;
}

.fit-mode-btn {
  flex: 1;
  padding: 0.45rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 700;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #a1a1aa;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
  font-family: inherit;
}

.fit-mode-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

.fit-mode-btn.active {
  background: rgba(139, 92, 246, 0.25);
  border-color: #8B5CF6;
  color: #ffffff;
  box-shadow: 0 0 12px rgba(139, 92, 246, 0.35);
}

.upload-btn-styled {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0.55rem 0.9rem;
  background: rgba(139, 92, 246, 0.15);
  border: 1px solid rgba(139, 92, 246, 0.35);
  border-radius: 8px;
  color: #c084fc;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.upload-btn-styled:hover {
  background: rgba(139, 92, 246, 0.25);
  color: #ffffff;
  box-shadow: 0 0 12px rgba(139, 92, 246, 0.3);
}

.banner-live-wrap {
  margin-top: 1.25rem;
}

.banner-live-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: #a1a1aa;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 6px;
}

.banner-live-preview-box {
  width: 100%;
  overflow: hidden;
  background: #000000;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  position: relative;
  transition: height 0.15s ease, border-radius 0.15s ease;
}

.banner-live-preview-box img {
  width: 100%;
  height: 100%;
  display: block;
  transition: object-position 0.1s ease;
}

/* ── Edit Product Modal ── */
.admin-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1.5rem;
  box-sizing: border-box;
  animation: adminFadeIn 0.2s ease;
}

.admin-modal-box {
  width: 100%;
  max-width: 780px;
  max-height: 90vh;
  background: rgba(14, 14, 20, 0.98);
  border: 1px solid rgba(139, 92, 246, 0.35);
  border-radius: 20px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.8), 0 0 35px rgba(139, 92, 246, 0.2);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: adminScaleIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.admin-confirm-modal-box {
  width: 100%;
  max-width: 440px;
  background: rgba(14, 14, 22, 0.98);
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
  border: 1px solid rgba(239, 68, 68, 0.35);
  border-radius: 22px;
  padding: 2.25rem 2rem;
  text-align: center;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.85), 0 0 35px rgba(239, 68, 68, 0.2);
  animation: adminScaleIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  box-sizing: border-box;
}

@keyframes adminScaleIn {
  from { opacity: 0; transform: scale(0.94); }
  to   { opacity: 1; transform: scale(1); }
}

.admin-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.02);
}

.admin-modal-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.admin-modal-title i {
  color: #8B5CF6;
}

.admin-modal-close {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #a1a1aa;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
}

.admin-modal-close:hover {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.35);
  color: #f87171;
}

.admin-modal-body {
  padding: 1.75rem;
  overflow-y: auto;
}

/* ── Login Screen ── */
.admin-login-wrapper {
  min-height: 100vh;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
  background: radial-gradient(circle at 50% 30%, rgba(139, 92, 246, 0.15), transparent 70%), #09090b;
}

.admin-login-modal-box {
  width: 100%;
  max-width: 440px;
  background: rgba(14, 14, 20, 0.95);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  border: 1px solid rgba(139, 92, 246, 0.3);
  border-radius: 22px;
  padding: 2.5rem 2rem;
  text-align: center;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.75), 0 0 35px rgba(139, 92, 246, 0.2);
  animation: adminScaleIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.admin-login-shield {
  width: 72px;
  height: 72px;
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.3), rgba(109, 40, 217, 0.15));
  border: 1px solid rgba(139, 92, 246, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #c084fc;
  font-size: 2rem;
  margin: 0 auto 1.5rem;
  box-shadow: 0 0 30px rgba(139, 92, 246, 0.35);
}

.admin-login-modal-box h2 {
  font-size: 1.5rem;
  font-weight: 800;
  color: #ffffff;
  margin: 0 0 0.5rem;
}

.admin-login-modal-box p {
  color: #a1a1aa;
  font-size: 0.85rem;
  line-height: 1.5;
  margin: 0 0 1.75rem;
}

.admin-pass-wrap {
  position: relative;
  margin-bottom: 1.25rem;
}

.admin-pass-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: #71717a;
}

.admin-pass-wrap .admin-input {
  padding-left: 2.5rem;
}

.admin-auth-error {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: #f87171;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.25);
  padding: 0.6rem 0.8rem;
  border-radius: 8px;
  font-size: 0.82rem;
  margin-top: 1rem;
}

.admin-auth-error.show {
  display: flex;
}

/* ── Responsive Queries ── */
@media (max-width: 1080px) {
  .admin-kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .admin-analytics-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 860px) {
  .admin-sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    transform: translateX(-100%);
    box-shadow: 20px 0 50px rgba(0, 0, 0, 0.8);
  }
  .admin-sidebar.open {
    transform: translateX(0);
  }
  .admin-mobile-header {
    display: flex;
  }
  .admin-mobile-overlay.active {
    display: block;
  }
  .admin-main {
    padding: 1.5rem 1rem 4rem;
  }
  .admin-form-layout {
    grid-template-columns: 1fr;
  }
  .admin-kpi-grid {
    grid-template-columns: 1fr;
  }
}
