/* ====================================================
   RAPPSTORES PREMIUM ADMIN PANEL - ENTERPRISE DESIGN SYSTEM
   Linear, Vercel, and Stripe Aesthetic with Glassmorphism
   Full Dark / Light Mode Support & Self-Contained Zero-CDN Resilience
   ==================================================== */

:root {
  /* Dark Mode Defaults (Obsidian Glassmorphism) */
  --bg-main: #0B0F19;
  --bg-secondary: #111827;
  --bg-card: rgba(17, 24, 39, 0.75);
  --bg-card-hover: rgba(30, 41, 59, 0.85);
  --bg-card-subtle: rgba(255, 255, 255, 0.04);
  --border-glass: rgba(255, 255, 255, 0.09);
  --border-glass-hover: rgba(255, 255, 255, 0.18);
  --border-glass-focus: rgba(139, 124, 255, 0.5);
  
  --text-primary: #F8FAFC;
  --text-secondary: #94A3B8;
  --text-muted: #64748B;

  --accent-primary: #8B7CFF;
  --accent-primary-hover: #7563FF;
  --accent-secondary: #A78BFA;
  --accent-cyan: #06B6D4;
  --accent-emerald: #10B981;
  --accent-amber: #F59E0B;
  --accent-rose: #EF4444;

  --input-bg: rgba(11, 15, 25, 0.75);
  --dropdown-bg: #111827;
  --shadow-card: 0 10px 30px -5px rgba(0, 0, 0, 0.45);
}

html.light {
  /* Light Mode Palette */
  --bg-main: #F5F7FB;
  --bg-secondary: #FFFFFF;
  --bg-card: rgba(255, 255, 255, 0.90);
  --bg-card-hover: rgba(248, 250, 252, 0.98);
  --bg-card-subtle: rgba(241, 245, 249, 0.85);
  --border-glass: #E2E8F0;
  --border-glass-hover: #CBD5E1;
  --border-glass-focus: rgba(109, 93, 251, 0.5);

  --text-primary: #0F172A;
  --text-secondary: #64748B;
  --text-muted: #94A3B8;

  --accent-primary: #6D5DFB;
  --accent-primary-hover: #5B4AF0;
  --accent-secondary: #8B7CFF;
  --accent-cyan: #0891B2;
  --accent-emerald: #059669;
  --accent-amber: #D97706;
  --accent-rose: #DC2626;

  --input-bg: #FFFFFF;
  --dropdown-bg: #FFFFFF;
  --shadow-card: 0 10px 25px -5px rgba(15, 23, 42, 0.08);
}

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

body {
  margin: 0;
  padding: 0;
  background-color: var(--bg-main);
  color: var(--text-primary);
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  overflow-x: hidden;
  transition: background-color 0.25s ease, color 0.25s ease;
  min-height: 100vh;
}

html.dark body {
  background-image: 
    radial-gradient(circle at 10% 10%, rgba(139, 124, 255, 0.08) 0%, transparent 45%),
    radial-gradient(circle at 90% 90%, rgba(6, 182, 212, 0.06) 0%, transparent 45%),
    radial-gradient(circle at 50% 50%, rgba(16, 185, 129, 0.02) 0%, transparent 60%);
  background-attachment: fixed;
}

html.light body {
  background-image: 
    radial-gradient(circle at 10% 10%, rgba(109, 93, 251, 0.05) 0%, transparent 40%),
    radial-gradient(circle at 90% 90%, rgba(14, 165, 233, 0.04) 0%, transparent 45%);
  background-attachment: fixed;
}

/* Glassmorphism Panel */
.glass-panel {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-glass);
  box-shadow: var(--shadow-card);
  border-radius: 0.875rem;
  transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.glass-panel-subtle {
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-glass);
  border-radius: 0.75rem;
}

.glass-panel-hover {
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

.glass-panel-hover:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-glass-hover);
  transform: translateY(-2px);
  box-shadow: 0 16px 36px 0 rgba(0, 0, 0, 0.25);
}

/* Form Controls & Inputs */
.glass-input {
  background: var(--input-bg);
  border: 1px solid var(--border-glass);
  color: var(--text-primary);
  border-radius: 0.625rem;
  padding: 0.6rem 0.9rem;
  font-size: 0.8125rem;
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.glass-input:focus {
  border-color: var(--border-glass-focus);
  box-shadow: 0 0 0 3px rgba(139, 124, 255, 0.2);
}

.glass-input::placeholder {
  color: var(--text-muted);
}

/* Premium Primary Button */
.btn-primary {
  background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-primary-hover) 100%);
  color: #FFFFFF;
  border: 1px solid rgba(255, 255, 255, 0.18);
  font-weight: 600;
  border-radius: 0.625rem;
  padding: 0.55rem 1.15rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-size: 0.8125rem;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 4px 14px 0 rgba(109, 93, 251, 0.32);
  cursor: pointer;
}

.btn-primary:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px 0 rgba(109, 93, 251, 0.45);
}

.btn-primary:active {
  transform: translateY(0);
}

/* Glass Outline Secondary Button */
.btn-glass {
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-glass);
  color: var(--text-primary);
  border-radius: 0.625rem;
  padding: 0.5rem 0.95rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  font-size: 0.8125rem;
  font-weight: 500;
  transition: all 0.18s ease;
  cursor: pointer;
}

.btn-glass:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-glass-hover);
}

/* Status Badges */
.badge-success {
  background: rgba(16, 185, 129, 0.12);
  color: #10B981;
  border: 1px solid rgba(16, 185, 129, 0.3);
  padding: 0.2rem 0.6rem;
  border-radius: 9999px;
  font-size: 0.71875rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.badge-pending {
  background: rgba(245, 158, 11, 0.12);
  color: #F59E0B;
  border: 1px solid rgba(245, 158, 11, 0.3);
  padding: 0.2rem 0.6rem;
  border-radius: 9999px;
  font-size: 0.71875rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.badge-danger {
  background: rgba(239, 68, 68, 0.12);
  color: #EF4444;
  border: 1px solid rgba(239, 68, 68, 0.3);
  padding: 0.2rem 0.6rem;
  border-radius: 9999px;
  font-size: 0.71875rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.badge-neutral {
  background: var(--bg-card-subtle);
  color: var(--text-secondary);
  border: 1px solid var(--border-glass);
  padding: 0.2rem 0.6rem;
  border-radius: 9999px;
  font-size: 0.71875rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

/* Linear Segmented Control */
.segmented-control {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border-glass);
  border-radius: 0.625rem;
  padding: 3px;
  display: inline-flex;
  gap: 3px;
}

.segmented-btn {
  background: transparent;
  color: var(--text-secondary);
  border: none;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.35rem 0.75rem;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

.segmented-btn:hover {
  color: var(--text-primary);
}

.segmented-btn.active {
  background: var(--accent-primary);
  color: #FFFFFF;
  box-shadow: 0 2px 8px rgba(109, 93, 251, 0.35);
}

/* Progress Bar */
.progress-bar-bg {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 9999px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-cyan) 0%, var(--accent-primary) 100%);
  border-radius: 9999px;
  transition: width 0.4s ease;
}

/* Pulsing Status Dot */
.status-dot-active {
  width: 7px;
  height: 7px;
  background-color: #10B981;
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 0 8px #10B981;
  animation: pulseGlow 2s infinite;
}

@keyframes pulseGlow {
  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 5px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.animate-fade-in {
  animation: fadeIn 0.22s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.animate-spin {
  animation: spin 0.8s linear infinite;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.2);
  border-radius: 9999px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(148, 163, 184, 0.4);
}

/* ====================================================
   STANDALONE CSS UTILITY CLASSES (Zero Tailwind Dependency)
   Guarantees 100% visual integrity in any browser/network
   ==================================================== */

.flex { display: flex; }
.inline-flex { display: inline-flex; }
.grid { display: grid; }
.hidden { display: none !important; }
.block { display: block; }
.inline { display: inline; }
.inline-block { display: inline-block; }

.flex-col { flex-direction: column; }
.flex-row { flex-direction: row; }
.flex-wrap { flex-wrap: wrap; }
.flex-1 { flex: 1 1 0%; }
.flex-shrink-0 { flex-shrink: 0; }

.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.items-stretch { align-items: stretch; }

.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; }

.gap-1 { gap: 0.25rem; }
.gap-1\.5 { gap: 0.375rem; }
.gap-2 { gap: 0.5rem; }
.gap-2\.5 { gap: 0.625rem; }
.gap-3 { gap: 0.75rem; }
.gap-3\.5 { gap: 0.875rem; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }

.w-full { width: 100%; }
.h-full { height: 100%; }
.h-screen { height: 100vh; }
.min-h-screen { min-height: 100vh; }

.w-2 { width: 0.5rem; }
.h-2 { height: 0.5rem; }
.w-3 { width: 0.75rem; }
.h-3 { height: 0.75rem; }
.w-3\.5 { width: 0.875rem; }
.h-3\.5 { height: 0.875rem; }
.w-4 { width: 1rem; }
.h-4 { height: 1rem; }
.w-5 { width: 1.25rem; }
.h-5 { height: 1.25rem; }
.w-7 { width: 1.75rem; }
.h-7 { height: 1.75rem; }
.w-8 { width: 2rem; }
.h-8 { height: 2rem; }
.w-10 { width: 2.5rem; }
.h-10 { height: 2.5rem; }
.w-14 { width: 3.5rem; }
.h-14 { height: 3.5rem; }
.w-20 { width: 5rem; }
.w-48 { width: 12rem; }
.h-48 { height: 12rem; }
.w-64 { width: 16rem; }
.h-64 { height: 16rem; }

.max-w-md { max-width: 28rem; }
.max-w-lg { max-width: 32rem; }
.max-w-xl { max-width: 36rem; }
.max-w-2xl { max-width: 42rem; }
.max-w-4xl { max-width: 56rem; }

.relative { position: relative; }
.absolute { position: absolute; }
.fixed { position: fixed; }
.inset-0 { top: 0; right: 0; bottom: 0; left: 0; }
.z-10 { z-index: 10; }
.z-20 { z-index: 20; }
.z-30 { z-index: 30; }
.z-50 { z-index: 50; }

.p-1 { padding: 0.25rem; }
.p-1\.5 { padding: 0.375rem; }
.p-2 { padding: 0.5rem; }
.p-2\.5 { padding: 0.625rem; }
.p-3 { padding: 0.75rem; }
.p-3\.5 { padding: 0.875rem; }
.p-4 { padding: 1rem; }
.p-5 { padding: 1.25rem; }
.p-6 { padding: 1.5rem; }
.p-8 { padding: 2rem; }
.p-12 { padding: 3rem; }

.px-2 { padding-left: 0.5rem; padding-right: 0.5rem; }
.px-2\.5 { padding-left: 0.625rem; padding-right: 0.625rem; }
.px-3 { padding-left: 0.75rem; padding-right: 0.75rem; }
.px-3\.5 { padding-left: 0.875rem; padding-right: 0.875rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.px-5 { padding-left: 1.25rem; padding-right: 1.25rem; }
.px-6 { padding-left: 1.5rem; padding-right: 1.5rem; }

.py-1 { padding-top: 0.25rem; padding-bottom: 0.25rem; }
.py-1\.5 { padding-top: 0.375rem; padding-bottom: 0.375rem; }
.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.py-2\.5 { padding-top: 0.625rem; padding-bottom: 0.625rem; }
.py-3 { padding-top: 0.75rem; padding-bottom: 0.75rem; }
.py-3\.5 { padding-top: 0.875rem; padding-bottom: 0.875rem; }
.py-8 { padding-top: 2rem; padding-bottom: 2rem; }
.py-12 { padding-top: 3rem; padding-bottom: 3rem; }

.pt-2 { padding-top: 0.5rem; }
.pt-3 { padding-top: 0.75rem; }
.pt-4 { padding-top: 1rem; }
.pt-20 { padding-top: 5rem; }
.pb-1 { padding-bottom: 0.25rem; }
.pb-3 { padding-bottom: 0.75rem; }
.pl-2 { padding-left: 0.5rem; }
.pl-9 { padding-left: 2.25rem; }
.pl-10 { padding-left: 2.5rem; }
.pr-1 { padding-right: 0.25rem; }
.pr-2 { padding-right: 0.5rem; }
.pr-4 { padding-right: 1rem; }
.pr-10 { padding-right: 2.5rem; }

.space-y-1 > :not([hidden]) ~ :not([hidden]) { margin-top: 0.25rem; }
.space-y-1\.5 > :not([hidden]) ~ :not([hidden]) { margin-top: 0.375rem; }
.space-y-2 > :not([hidden]) ~ :not([hidden]) { margin-top: 0.5rem; }
.space-y-2\.5 > :not([hidden]) ~ :not([hidden]) { margin-top: 0.625rem; }
.space-y-3 > :not([hidden]) ~ :not([hidden]) { margin-top: 0.75rem; }
.space-y-3\.5 > :not([hidden]) ~ :not([hidden]) { margin-top: 0.875rem; }
.space-y-4 > :not([hidden]) ~ :not([hidden]) { margin-top: 1rem; }
.space-y-6 > :not([hidden]) ~ :not([hidden]) { margin-top: 1.5rem; }
.space-x-1 > :not([hidden]) ~ :not([hidden]) { margin-left: 0.25rem; }

.mx-auto { margin-left: auto; margin-right: auto; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-1\.5 { margin-bottom: 0.375rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-8 { margin-bottom: 2rem; }
.mt-0\.5 { margin-top: 0.125rem; }
.mt-1 { margin-top: 0.25rem; }
.mt-6 { margin-top: 1.5rem; }
.ml-2 { margin-left: 0.5rem; }
.ml-8 { margin-left: 2rem; }
.mr-8 { margin-right: 2rem; }

.rounded { border-radius: 0.25rem; }
.rounded-md { border-radius: 0.375rem; }
.rounded-lg { border-radius: 0.5rem; }
.rounded-xl { border-radius: 0.75rem; }
.rounded-2xl { border-radius: 1rem; }
.rounded-full { border-radius: 9999px; }

.border { border-width: 1px; border-style: solid; }
.border-t { border-top-width: 1px; border-top-style: solid; }
.border-b { border-bottom-width: 1px; border-bottom-style: solid; }
.border-l { border-left-width: 1px; border-left-style: solid; }
.border-r { border-right-width: 1px; border-right-style: solid; }

.border-white\/5 { border-color: rgba(255, 255, 255, 0.05); }
.border-white\/10 { border-color: rgba(255, 255, 255, 0.10); }
.border-white\/20 { border-color: rgba(255, 255, 255, 0.20); }
.border-indigo-500\/20 { border-color: rgba(99, 102, 241, 0.2); }
.border-indigo-500\/30 { border-color: rgba(99, 102, 241, 0.3); }
.border-indigo-500\/40 { border-color: rgba(99, 102, 241, 0.4); }
.border-indigo-500\/50 { border-color: rgba(99, 102, 241, 0.5); }
.border-cyan-500\/30 { border-color: rgba(6, 182, 212, 0.3); }
.border-emerald-500\/20 { border-color: rgba(16, 185, 129, 0.2); }
.border-emerald-500\/30 { border-color: rgba(16, 185, 129, 0.3); }
.border-amber-500\/20 { border-color: rgba(245, 158, 11, 0.2); }
.border-amber-500\/30 { border-color: rgba(245, 158, 11, 0.3); }
.border-red-500\/20 { border-color: rgba(239, 68, 68, 0.2); }
.border-red-500\/30 { border-color: rgba(239, 68, 68, 0.3); }

.bg-white\/\[0\.02\] { background-color: rgba(255, 255, 255, 0.02); }
.bg-white\/\[0\.03\] { background-color: rgba(255, 255, 255, 0.03); }
.bg-white\/5 { background-color: rgba(255, 255, 255, 0.05); }
.bg-white\/10 { background-color: rgba(255, 255, 255, 0.10); }
.bg-black\/40 { background-color: rgba(0, 0, 0, 0.4); }
.bg-black\/80 { background-color: rgba(0, 0, 0, 0.8); }

.bg-indigo-500\/10 { background-color: rgba(99, 102, 241, 0.10); }
.bg-indigo-500\/20 { background-color: rgba(99, 102, 241, 0.20); }
.bg-indigo-600\/20 { background-color: rgba(79, 70, 229, 0.20); }
.bg-indigo-950\/20 { background-color: rgba(30, 27, 75, 0.3); }
.bg-cyan-500\/10 { background-color: rgba(6, 182, 212, 0.10); }
.bg-cyan-500\/20 { background-color: rgba(6, 182, 212, 0.20); }
.bg-cyan-950\/20 { background-color: rgba(8, 51, 68, 0.3); }
.bg-emerald-500\/10 { background-color: rgba(16, 185, 129, 0.10); }
.bg-emerald-500\/20 { background-color: rgba(16, 185, 129, 0.20); }
.bg-emerald-950\/20 { background-color: rgba(6, 78, 59, 0.3); }
.bg-amber-500\/10 { background-color: rgba(245, 158, 11, 0.10); }
.bg-amber-500\/20 { background-color: rgba(245, 158, 11, 0.20); }
.bg-amber-950\/20 { background-color: rgba(69, 26, 3, 0.3); }
.bg-purple-500\/10 { background-color: rgba(168, 85, 247, 0.10); }
.bg-purple-500\/20 { background-color: rgba(168, 85, 247, 0.20); }
.bg-red-500\/10 { background-color: rgba(239, 68, 68, 0.10); }
.bg-red-500\/20 { background-color: rgba(239, 68, 68, 0.20); }

.text-white { color: #FFFFFF; }
.text-gray-200 { color: #E2E8F0; }
.text-gray-300 { color: #CBD5E1; }
.text-gray-400 { color: #94A3B8; }
.text-gray-500 { color: #64748B; }
.text-gray-600 { color: #475569; }

.text-indigo-200 { color: #C7D2FE; }
.text-indigo-300 { color: #A5B4FC; }
.text-indigo-400 { color: #818CF8; }
.text-cyan-300 { color: #67E8F9; }
.text-cyan-400 { color: #22D3EE; }
.text-emerald-200 { color: #A7F3D0; }
.text-emerald-300 { color: #6EE7B7; }
.text-emerald-400 { color: #34D399; }
.text-amber-200 { color: #FDE68A; }
.text-amber-300 { color: #FCD34D; }
.text-amber-400 { color: #FBBF24; }
.text-purple-400 { color: #C084FC; }
.text-red-200 { color: #FECACA; }
.text-red-300 { color: #FCA5A5; }
.text-red-400 { color: #F87171; }

.text-\[9px\] { font-size: 9px; }
.text-\[10px\] { font-size: 10px; }
.text-\[11px\] { font-size: 11px; }
.text-xs { font-size: 0.75rem; }
.text-sm { font-size: 0.875rem; }
.text-base { font-size: 1rem; }
.text-lg { font-size: 1.125rem; }
.text-xl { font-size: 1.25rem; }
.text-2xl { font-size: 1.5rem; }

.font-normal { font-weight: 400; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }
.font-mono { font-family: 'JetBrains Mono', monospace, monospace; }

.uppercase { text-transform: uppercase; }
.capitalize { text-transform: capitalize; }
.tracking-tight { letter-spacing: -0.025em; }
.tracking-wider { letter-spacing: 0.05em; }
.tracking-widest { letter-spacing: 0.1em; }

.text-left { text-align: left; }
.text-center { text-align: center; }
.text-right { text-align: right; }

.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.select-all { user-select: all; }
.cursor-pointer { cursor: pointer; }
.whitespace-nowrap { white-space: nowrap; }
.whitespace-pre-wrap { white-space: pre-wrap; }
.overflow-hidden { overflow: hidden; }
.overflow-x-hidden { overflow-x: hidden; }
.overflow-x-auto { overflow-x: auto; }
.overflow-y-auto { overflow-y: auto; }

.grid-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
.grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

@media (min-width: 640px) {
  .sm\:flex { display: flex; }
  .sm\:flex-row { flex-direction: row; }
  .sm\:items-center { align-items: center; }
  .sm\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sm\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (min-width: 768px) {
  .md\:flex-row { flex-direction: row; }
  .md\:items-center { align-items: center; }
  .md\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .md\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .md\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (min-width: 1024px) {
  .lg\:p-8 { padding: 2rem; }
  .lg\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .lg\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .lg\:grid-cols-12 { grid-template-columns: repeat(12, minmax(0, 1fr)); }
  .lg\:col-span-2 { grid-column: span 2 / span 2; }
  .lg\:col-span-5 { grid-column: span 5 / span 5; }
  .lg\:col-span-7 { grid-column: span 7 / span 7; }
}

table {
  border-collapse: collapse;
  width: 100%;
}

.backdrop-blur-md { backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.backdrop-blur-xl { backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px); }
.shadow-2xl { box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.6); }

/* ====================================================
   LIGHT THEME CONTRAST & VISIBILITY OVERRIDES
   Ensures 100% typography contrast, sharp panels, and pristine readability
   ==================================================== */

html.light {
  color-scheme: light;
}

html.light body {
  background-color: #F8FAFC !important;
  color: #0F172A !important;
}

/* Base Headings & High-Contrast Typography */
html.light .text-white {
  color: #0F172A !important;
}

html.light .text-gray-100 {
  color: #1E293B !important;
}

html.light .text-gray-200 {
  color: #334155 !important;
}

html.light .text-gray-300 {
  color: #475569 !important;
}

html.light .text-gray-400 {
  color: #64748B !important;
}

html.light .text-gray-500 {
  color: #64748B !important;
}

/* Maintain light text on primary gradient buttons, active pills, and colored badges */
html.light .btn-primary,
html.light .btn-primary *,
html.light .segmented-btn.active,
html.light .segmented-btn.active *,
html.light .bg-indigo-600 .text-white,
html.light [class*="bg-gradient"] .text-white,
html.light .status-pill-badge,
html.light kbd {
  color: #FFFFFF !important;
}

html.light kbd {
  background-color: #E2E8F0 !important;
  color: #475569 !important;
  border-color: #CBD5E1 !important;
}

/* Panels & Surfaces */
html.light .glass-panel {
  background: #FFFFFF !important;
  border-color: #E2E8F0 !important;
  box-shadow: 0 4px 20px -2px rgba(15, 23, 42, 0.06), 0 2px 6px -1px rgba(15, 23, 42, 0.04) !important;
}

html.light .glass-panel-subtle {
  background: #F8FAFC !important;
  border-color: #E2E8F0 !important;
}

html.light aside#sidebar {
  background: #FFFFFF !important;
  border-color: #E2E8F0 !important;
}

html.light header {
  background: rgba(255, 255, 255, 0.95) !important;
  border-color: #E2E8F0 !important;
}

/* Form Controls & Inputs */
html.light .glass-input {
  background: #FFFFFF !important;
  border-color: #CBD5E1 !important;
  color: #0F172A !important;
}

html.light .glass-input:focus {
  border-color: #6366F1 !important;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15) !important;
}

html.light .glass-input::placeholder {
  color: #94A3B8 !important;
}

html.light select.glass-input option {
  background: #FFFFFF;
  color: #0F172A;
}

/* Buttons */
html.light .btn-glass {
  background: #F8FAFC !important;
  color: #1E293B !important;
  border-color: #E2E8F0 !important;
}

html.light .btn-glass:hover {
  background: #F1F5F9 !important;
  border-color: #CBD5E1 !important;
  color: #0F172A !important;
}

html.light .nav-btn:not(.bg-indigo-600\/20) {
  color: #64748B !important;
}

html.light .nav-btn:not(.bg-indigo-600\/20):hover {
  color: #0F172A !important;
  background-color: #F1F5F9 !important;
}

/* Cards & Lists Sub-Elements */
html.light .bg-white\/\[0\.02\],
html.light .bg-white\/\[0\.03\],
html.light .bg-white\/5 {
  background-color: #F8FAFC !important;
}

html.light .bg-white\/10 {
  background-color: #F1F5F9 !important;
}

html.light .border-white\/5,
html.light .border-white\/10,
html.light .border-white\/20 {
  border-color: #E2E8F0 !important;
}

html.light .divide-white\/5 > :not([hidden]) ~ :not([hidden]) {
  border-color: #E2E8F0 !important;
}

html.light .hover\:bg-white\/5:hover,
html.light .hover\:bg-white\/10:hover,
html.light .hover\:bg-white\/\[0\.02\]:hover,
html.light .hover\:bg-white\/\[0\.05\]:hover {
  background-color: #F1F5F9 !important;
}

html.light .hover\:text-white:hover {
  color: #0F172A !important;
}

html.light .bg-black\/40 {
  background-color: #F1F5F9 !important;
}

html.light .bg-black\/80 {
  background-color: rgba(15, 23, 42, 0.55) !important;
}

/* Table Rows & Headers */
html.light table thead tr {
  border-color: #E2E8F0 !important;
}

html.light table thead th {
  color: #64748B !important;
}

html.light table tbody tr:hover {
  background-color: #F8FAFC !important;
}

/* Accent Badges & States */
html.light .badge-neutral {
  background: #F1F5F9 !important;
  color: #475569 !important;
  border-color: #CBD5E1 !important;
}

html.light .text-indigo-300 {
  color: #4F46E5 !important;
}

html.light .text-indigo-400 {
  color: #4338CA !important;
}

html.light .text-cyan-300,
html.light .text-cyan-400 {
  color: #0891B2 !important;
}

html.light .text-emerald-400 {
  color: #059669 !important;
}

html.light .text-amber-400 {
  color: #D97706 !important;
}

html.light .text-red-400 {
  color: #DC2626 !important;
}

html.light .segmented-control {
  background: #F1F5F9 !important;
  border-color: #E2E8F0 !important;
}

html.light .segmented-btn {
  color: #64748B !important;
}

html.light .segmented-btn:hover {
  color: #0F172A !important;
}

/* Modals */
html.light #modal-container .glass-panel {
  background: #FFFFFF !important;
  border-color: #CBD5E1 !important;
  box-shadow: 0 20px 40px -10px rgba(15, 23, 42, 0.25) !important;
}


/* ==========================================================================
   MULTI-THEME ENGINE (4 CLEAN PRESETS: AURORA, OBSIDIAN, EMERALD, LIGHT)
   Preserves 100% of original RappStores Admin layout & components
   ========================================================================== */

/* Compact Top Theme Switcher Bar */
.top-theme-bar {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px;
  border-radius: 10px;
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-glass);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.top-theme-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  border-radius: 7px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.16s ease;
  white-space: nowrap;
}

.top-theme-pill:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}

html.light .top-theme-pill:hover {
  background: rgba(15, 23, 42, 0.05);
}

.top-theme-pill.active {
  background: var(--bg-card-hover);
  color: var(--text-primary);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

html[data-theme="aurora"] .top-theme-pill.active {
  background: #e6e6e6;
  color: #2f3031 !important;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
}

html.light .top-theme-pill.active {
  background: #0f172a;
  color: #ffffff !important;
}

.top-theme-dot {
  width: 7px;
  height: 7px;
  border-radius: 9999px;
  flex-shrink: 0;
}

/* Ambient Backdrop Stage */
.theme-ambient-stage {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.aurora-blade {
  position: absolute;
  border-radius: 9999px;
  mix-blend-mode: screen;
  filter: blur(76px);
  opacity: 0;
  transition: opacity 0.35s ease;
}

.aurora-blade-1 {
  width: 74vw;
  height: 28vh;
  min-width: 680px;
  top: 6%;
  left: -8%;
  background: linear-gradient(90deg, rgba(7,8,10,0) 0%, rgba(255,47,58,0.62) 28%, rgba(255,107,74,0.55) 62%, rgba(255,179,71,0.38) 86%, rgba(7,8,10,0) 100%);
  animation: warmDriftOne 17s ease-in-out infinite;
}

.aurora-blade-2 {
  width: 68vw;
  height: 25vh;
  min-width: 620px;
  top: 24%;
  right: -12%;
  background: linear-gradient(270deg, rgba(7,8,10,0) 0%, rgba(255,47,58,0.52) 26%, rgba(255,107,74,0.48) 58%, rgba(255,179,71,0.36) 84%, rgba(7,8,10,0) 100%);
  animation: warmDriftTwo 21s ease-in-out infinite;
}

.aurora-blade-3 {
  width: 58vw;
  height: 28vh;
  min-width: 540px;
  bottom: 4%;
  left: 18%;
  background: radial-gradient(ellipse at center, rgba(255,47,58,0.42) 0%, rgba(255,107,74,0.28) 46%, transparent 78%);
  animation: warmDriftThree 16s ease-in-out infinite;
}

@keyframes warmDriftOne {
  0%, 100% { transform: translate3d(0, 0, 0) rotate(-24deg) scale(1.03); }
  50% { transform: translate3d(42px, 22px, 0) rotate(-20deg) scale(0.96); }
}
@keyframes warmDriftTwo {
  0%, 100% { transform: translate3d(0, 0, 0) rotate(22deg) scale(1.02); }
  50% { transform: translate3d(-44px, -20px, 0) rotate(26deg) scale(1.08); }
}
@keyframes warmDriftThree {
  0%, 100% { transform: translate3d(0, 0, 0) rotate(-12deg) scale(1); }
  50% { transform: translate3d(28px, -22px, 0) rotate(-8deg) scale(1.06); }
}

.emerald-grid-layer {
  position: absolute;
  inset: 0;
  opacity: 0;
  background-image:
    linear-gradient(to right, rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 48px 48px;
  transition: opacity 0.3s ease;
}

.aurora-grain-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  mix-blend-mode: overlay;
}

/* --------------------------------------------------------------------------
   THEME 1: WARM AURORA (html[data-theme="aurora"])
   -------------------------------------------------------------------------- */
html[data-theme="aurora"] {
  --bg-main: #07080a;
  --bg-secondary: #0c0d11;
  --bg-card: rgba(12, 13, 17, 0.76);
  --bg-card-hover: rgba(20, 22, 27, 0.88);
  --bg-card-subtle: rgba(255, 255, 255, 0.038);
  --border-glass: rgba(255, 255, 255, 0.085);
  --border-glass-hover: rgba(255, 107, 74, 0.32);
  --border-glass-focus: rgba(255, 107, 74, 0.55);
  --text-primary: #ffffff;
  --text-secondary: #9c9c9d;
  --text-muted: #68696c;
  --accent-primary: #ff6b4a;
  --accent-primary-hover: #ff8266;
  --accent-secondary: #ffb347;
  --input-bg: rgba(7, 8, 10, 0.82);
  --dropdown-bg: #0f1014;
  --shadow-card: 0 20px 50px -12px rgba(0, 0, 0, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

html[data-theme="aurora"] body {
  background-image: none;
}

html[data-theme="aurora"] .aurora-blade {
  opacity: 0.85;
}

html[data-theme="aurora"] .aurora-grain-svg {
  opacity: 0.055;
}

/* Tactile Keycap Primary Button on Warm Aurora */
html[data-theme="aurora"] .btn-primary {
  background: #e6e6e6 !important;
  color: #2f3031 !important;
  border-radius: 8px;
  box-shadow:
    0 0 0 2px #000000,
    0 0 14px rgba(255, 255, 255, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.96),
    inset 0 -1.5px 0 rgba(0, 0, 0, 0.26) !important;
}

html[data-theme="aurora"] .btn-primary:hover:not(:disabled) {
  background: #f4f4f4 !important;
  box-shadow:
    0 0 0 2px #000000,
    0 0 20px rgba(255, 255, 255, 0.26),
    inset 0 1px 0 #ffffff,
    inset 0 -1.5px 0 rgba(0, 0, 0, 0.22) !important;
}

html[data-theme="aurora"] .btn-primary svg {
  color: #2f3031 !important;
}

/* Map cool utility accents cleanly to Warm Aurora coral/amber without touching JS markup */
html[data-theme="aurora"] .text-indigo-400,
html[data-theme="aurora"] .text-indigo-300 {
  color: #ff6b4a !important;
}
html[data-theme="aurora"] .text-cyan-400,
html[data-theme="aurora"] .text-cyan-300,
html[data-theme="aurora"] .text-purple-400 {
  color: #ffb347 !important;
}
html[data-theme="aurora"] .bg-indigo-600\/20,
html[data-theme="aurora"] .bg-indigo-500\/20,
html[data-theme="aurora"] .bg-indigo-500\/10,
html[data-theme="aurora"] .bg-indigo-950\/20 {
  background-color: rgba(255, 107, 74, 0.14) !important;
}
html[data-theme="aurora"] .border-indigo-500\/30,
html[data-theme="aurora"] .border-indigo-500\/25,
html[data-theme="aurora"] .border-indigo-500\/20,
html[data-theme="aurora"] .border-indigo-500\/40 {
  border-color: rgba(255, 107, 74, 0.32) !important;
}
html[data-theme="aurora"] .bg-indigo-500,
html[data-theme="aurora"] .bg-indigo-600 {
  background-color: #ff6b4a !important;
}
html[data-theme="aurora"] .from-indigo-500 {
  --tw-gradient-from: #ffb347 var(--tw-gradient-from-position) !important;
  --tw-gradient-to: rgba(255, 179, 71, 0) var(--tw-gradient-to-position) !important;
  --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to) !important;
}
html[data-theme="aurora"] .to-cyan-400,
html[data-theme="aurora"] .to-purple-500 {
  --tw-gradient-to: #ff2f3a var(--tw-gradient-to-position) !important;
}
html[data-theme="aurora"] .progress-bar-fill {
  background: linear-gradient(90deg, #ff2f3a 0%, #ff6b4a 52%, #ffb347 100%);
}

/* --------------------------------------------------------------------------
   THEME 2: MONOCHROME EMERALD (html[data-theme="emerald"])
   -------------------------------------------------------------------------- */
html[data-theme="emerald"] {
  --bg-main: #050607;
  --bg-secondary: #0b0d0f;
  --bg-card: rgba(20, 22, 25, 0.78);
  --bg-card-hover: rgba(30, 33, 38, 0.88);
  --bg-card-subtle: rgba(255, 255, 255, 0.04);
  --border-glass: rgba(255, 255, 255, 0.09);
  --border-glass-hover: rgba(52, 211, 153, 0.35);
  --border-glass-focus: rgba(52, 211, 153, 0.55);
  --text-primary: #ffffff;
  --text-secondary: #a1a1aa;
  --text-muted: #71717a;
  --accent-primary: #34D399;
  --accent-primary-hover: #6EE7B7;
  --accent-secondary: #10B981;
  --input-bg: rgba(9, 10, 12, 0.85);
  --dropdown-bg: #141619;
  --shadow-card: 0 22px 54px -14px rgba(0, 0, 0, 0.8), inset 0 1px 0 rgba(255, 255, 255, 0.07);
}

html[data-theme="emerald"] body {
  background-image: radial-gradient(circle at 50% 0%, rgba(52, 211, 153, 0.12), transparent 50%);
}
html[data-theme="emerald"] .emerald-grid-layer {
  opacity: 1;
}
html[data-theme="emerald"] .aurora-grain-svg {
  opacity: 0.05;
}
html[data-theme="emerald"] .btn-primary {
  background: #34D399 !important;
  color: #09090b !important;
  font-weight: 700;
  box-shadow: 0 6px 20px -4px rgba(52, 211, 153, 0.38) !important;
}
html[data-theme="emerald"] .btn-primary:hover:not(:disabled) {
  background: #6EE7B7 !important;
}
html[data-theme="emerald"] .btn-primary svg {
  color: #09090b !important;
}
html[data-theme="emerald"] .text-indigo-400,
html[data-theme="emerald"] .text-indigo-300,
html[data-theme="emerald"] .text-cyan-400,
html[data-theme="emerald"] .text-purple-400 {
  color: #34D399 !important;
}
html[data-theme="emerald"] .bg-indigo-600\/20,
html[data-theme="emerald"] .bg-indigo-500\/20,
html[data-theme="emerald"] .bg-indigo-500\/10,
html[data-theme="emerald"] .bg-indigo-950\/20 {
  background-color: rgba(52, 211, 153, 0.13) !important;
}
html[data-theme="emerald"] .border-indigo-500\/30,
html[data-theme="emerald"] .border-indigo-500\/25,
html[data-theme="emerald"] .border-indigo-500\/20 {
  border-color: rgba(52, 211, 153, 0.3) !important;
}
html[data-theme="emerald"] .bg-indigo-500,
html[data-theme="emerald"] .bg-indigo-600 {
  background-color: #34D399 !important;
}
html[data-theme="emerald"] .from-indigo-500 {
  --tw-gradient-from: #34D399 var(--tw-gradient-from-position) !important;
  --tw-gradient-to: rgba(52, 211, 153, 0) var(--tw-gradient-to-position) !important;
  --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to) !important;
}
html[data-theme="emerald"] .to-cyan-400,
html[data-theme="emerald"] .to-purple-500 {
  --tw-gradient-to: #059669 var(--tw-gradient-to-position) !important;
}
html[data-theme="emerald"] .progress-bar-fill {
  background: linear-gradient(90deg, #059669 0%, #34D399 100%);
}


/* --------------------------------------------------------------------------
   THEME 5: EDITORIAL SKETCH (html[data-theme="sketch"])
   Warm Paper #FBF9F5 + Crisp Ink Borders + Burnt Orange #EA580C Accent
   -------------------------------------------------------------------------- */
html[data-theme="sketch"] {
  --bg-main: #FBF9F5;
  --bg-secondary: #F3EFE6;
  --bg-card: rgba(255, 255, 255, 0.94);
  --bg-card-hover: #FFFFFF;
  --bg-card-subtle: rgba(17, 24, 39, 0.04);
  --border-glass: rgba(17, 24, 39, 0.15);
  --border-glass-hover: rgba(234, 88, 12, 0.45);
  --border-glass-focus: rgba(234, 88, 12, 0.65);
  --text-primary: #111827;
  --text-secondary: #4B5563;
  --text-muted: #6B7280;
  --accent-primary: #EA580C;
  --accent-primary-hover: #C2410C;
  --accent-secondary: #D97706;
  --input-bg: #FFFFFF;
  --dropdown-bg: #FFFFFF;
  --shadow-card: 3px 3px 0px rgba(17, 24, 39, 0.08);
}

html[data-theme="sketch"] body {
  background-color: #FBF9F5;
  background-image: radial-gradient(rgba(17, 24, 39, 0.1) 1px, transparent 1px);
  background-size: 22px 22px;
  color: #111827;
}

html[data-theme="sketch"] .top-theme-pill.active {
  background: #EA580C;
  color: #ffffff !important;
}

html[data-theme="sketch"] .btn-primary {
  background: #111827 !important;
  color: #FFFFFF !important;
  border: 1.5px solid #111827;
  box-shadow: 2px 2px 0px #EA580C !important;
}

html[data-theme="sketch"] .btn-primary:hover:not(:disabled) {
  background: #EA580C !important;
  border-color: #111827;
  box-shadow: 2px 2px 0px #111827 !important;
}

html[data-theme="sketch"] .text-white,
html[data-theme="sketch"] .text-gray-100,
html[data-theme="sketch"] .text-gray-200 {
  color: #111827 !important;
}
html[data-theme="sketch"] .text-gray-300,
html[data-theme="sketch"] .text-gray-400 {
  color: #4B5563 !important;
}
html[data-theme="sketch"] .text-indigo-400,
html[data-theme="sketch"] .text-indigo-300,
html[data-theme="sketch"] .text-cyan-400 {
  color: #EA580C !important;
}
html[data-theme="sketch"] .bg-indigo-600\/20,
html[data-theme="sketch"] .bg-indigo-500\/20,
html[data-theme="sketch"] .bg-indigo-500\/10 {
  background-color: rgba(234, 88, 12, 0.12) !important;
}
html[data-theme="sketch"] .border-white\/5,
html[data-theme="sketch"] .border-white\/10 {
  border-color: rgba(17, 24, 39, 0.12) !important;
}
