:root {
  /* Color Palette */
  --c-bg: #f8fafc;
  --c-bg-glass: rgba(255, 255, 255, 0.7);
  --c-surface: #ffffff;
  --c-text: #1e293b;
  --c-text-muted: #64748b;
  --c-border: #e2e8f0;
  
  --c-primary: #3b82f6;
  --c-primary-hover: #2563eb;
  --c-primary-light: #eff6ff;
  
  --c-danger: #ef4444;
  --c-danger-hover: #dc2626;
  
  --c-success: #10b981;
  --c-success-glass: rgba(16, 185, 129, 0.1);

  /* Typography */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-display: 'Outfit', var(--font-sans);

  /* Utilities */
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-full: 9999px;

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-glass: 0 8px 32px 0 rgba(31, 38, 135, 0.07);

  --transition-fast: 0.15s ease;
  --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-bounce: 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

[data-theme='dark'] {
  --c-bg: #0f172a;
  --c-bg-glass: rgba(15, 23, 42, 0.7);
  --c-surface: #1e293b;
  --c-text: #f8fafc;
  --c-text-muted: #94a3b8;
  --c-border: #334155;
  --c-primary: #3b82f6;
  --c-primary-light: rgba(59, 130, 246, 0.1);
}

/* Reset */
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: var(--font-sans);
  background-color: var(--c-bg);
  color: var(--c-text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 600; }
a { text-decoration: none; color: inherit; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
img { max-width: 100%; height: auto; display: block; }
input, textarea, select { font-family: inherit; }

/* Utilities */
.text-muted { color: var(--c-text-muted); }
.text-success { color: var(--c-success); font-weight: 500; }
.text-primary { color: var(--c-primary); }
.mb-4 { margin-bottom: 1rem; }
.mt-4 { margin-top: 1rem; }
.ml-2 { margin-left: 0.5rem; }
.text-center { text-align: center; }
.cursor-pointer { cursor: pointer; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.gap-4 { gap: 1rem; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.25rem;
  font-weight: 500;
  border-radius: var(--radius-md);
  transition: var(--transition-bounce);
  font-size: 0.95rem;
  letter-spacing: 0.01em;
}
.btn:active { transform: scale(0.97); }
.btn-primary {
  background: var(--c-primary);
  color: #fff;
  box-shadow: 0 4px 14px 0 rgba(59, 130, 246, 0.39);
}
.btn-primary:hover {
  background: var(--c-primary-hover);
  box-shadow: 0 6px 20px rgba(59, 130, 246, 0.23);
  transform: translateY(-1px);
}
.btn-outline {
  border: 1px solid var(--c-border);
  color: var(--c-text);
  background: transparent;
}
.btn-outline:hover { background: var(--c-primary-light); border-color: var(--c-primary); color: var(--c-primary); }
.btn-danger {
  background: var(--c-danger);
  color: #fff;
}
.btn-danger:hover { background: var(--c-danger-hover); }
.btn-block { width: 100%; }
.btn-sm { padding: 0.5rem 0.875rem; font-size: 0.875rem; border-radius: var(--radius-sm); }
.icon-btn {
  padding: 0.5rem;
  border-radius: var(--radius-md);
  color: var(--c-text-muted);
  transition: var(--transition-fast);
}
.icon-btn:hover { background: var(--c-border); color: var(--c-text); }

/* Forms */
.input-group { margin-bottom: 1.25rem; }
.input-group label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
  color: var(--c-text);
}
.input-group input:not([type="checkbox"]):not([type="color"]), 
.input-group textarea, 
.select-input {
  width: 100%;
  padding: 0.75rem 1rem;
  background: var(--c-bg);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-md);
  color: var(--c-text);
  transition: var(--transition-fast);
  outline: none;
}
.input-group input:focus, .input-group textarea:focus, .select-input:focus {
  border-color: var(--c-primary);
  box-shadow: 0 0 0 3px var(--c-primary-light);
}
.input-group input[type="color"] {
  width: 100%;
  height: 48px;
  border: 1px solid var(--c-border);
  border-radius: var(--radius-md);
  padding: 0.25rem;
  background: var(--c-bg);
  cursor: pointer;
}
.password-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}
.password-wrapper input {
  padding-right: 2.5rem !important;
}
.password-toggle {
  position: absolute;
  right: 0.75rem;
  background: transparent;
  border: none;
  color: var(--c-text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.25rem;
}
.password-toggle:hover {
  color: var(--c-text);
}
.password-toggle svg {
  width: 20px;
  height: 20px;
}
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }

/* Login Modal */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000;
  opacity: 0; pointer-events: none;
  transition: var(--transition-normal);
}
.modal-overlay.active { opacity: 1; pointer-events: auto; }
.login-box {
  background: var(--c-surface);
  padding: 2.5rem;
  border-radius: var(--radius-lg);
  width: 100%; max-width: 420px;
  box-shadow: var(--shadow-glass);
  transform: translateY(20px);
  transition: var(--transition-bounce);
  border: 1px solid rgba(255, 255, 255, 0.1);
}
.modal-overlay.active .login-box { transform: translateY(0); }
.login-header { text-align: center; margin-bottom: 2rem; }
.brand-logo { width: 48px; height: 48px; border-radius: var(--radius-md); margin-bottom: 1rem; margin: 0 auto 1rem; }
.error-msg { color: var(--c-danger); font-size: 0.875rem; margin-top: 1rem; text-align: center; min-height: 20px; }

/* App Layout */
.app-layout {
  display: flex;
  height: 100dvh;
  overflow: hidden;
}

/* Sidebar */
.sidebar-overlay {
  position: fixed; inset: 0;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
  z-index: 90;
  opacity: 0; pointer-events: none;
  transition: var(--transition-normal);
}
.sidebar-overlay.active { opacity: 1; pointer-events: auto; }

.sidebar {
  width: 260px;
  background: var(--c-surface);
  border-right: 1px solid var(--c-border);
  display: flex;
  flex-direction: column;
  transition: var(--transition-normal);
  z-index: 100;
}
.sidebar-header {
  padding: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  border-bottom: 1px solid var(--c-border);
}
.sidebar-header .brand-logo { margin: 0; width: 32px; height: 32px; }
.brand-name { font-family: var(--font-display); font-weight: 700; font-size: 1.25rem; }

.sidebar-nav { flex: 1; padding: 1.5rem 1rem; overflow-y: auto; display: flex; flex-direction: column; gap: 0.25rem; }
.nav-item {
  display: flex; align-items: center; gap: 0.75rem;
  width: 100%; padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  color: var(--c-text-muted);
  font-weight: 500; font-size: 0.95rem;
  transition: var(--transition-fast);
}
.nav-item svg { width: 20px; height: 20px; }
.nav-item:hover { background: var(--c-bg); color: var(--c-text); }
.nav-item.active { background: var(--c-primary-light); color: var(--c-primary); }
.nav-item.danger:hover { background: rgba(239, 68, 68, 0.1); color: var(--c-danger); }
.sidebar-footer { padding: 1rem; border-top: 1px solid var(--c-border); }

/* Main Content */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.topbar {
  height: 70px;
  background: var(--c-bg-glass);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--c-border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 2rem;
  z-index: 10;
}
.topbar-actions { display: flex; gap: 1rem; align-items: center; }

.view-container {
  flex: 1;
  overflow-y: auto;
  padding: 2rem;
  position: relative;
}
.view { display: none; animation: fadeIn var(--transition-normal); }
.view.active { display: block; }

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

/* Dashboard Stats */
.stats-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1.5rem; margin-bottom: 2rem;
}
.stat-card {
  background: var(--c-surface);
  padding: 1.5rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--c-border);
  box-shadow: var(--shadow-sm);
  transition: var(--transition-bounce);
}
.stat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--c-primary-light); }
.stat-card h3 { font-size: 0.95rem; color: var(--c-text-muted); font-family: var(--font-sans); font-weight: 500; margin-bottom: 0.5rem; }
.stat-value { font-size: 2rem; font-weight: 700; font-family: var(--font-display); }
.dashboard-activity { background: var(--c-surface); border-radius: var(--radius-lg); padding: 1.5rem; border: 1px solid var(--c-border); }
.activity-list p { padding: 0.75rem 0; border-bottom: 1px solid var(--c-border); }
.activity-list p:last-child { border-bottom: none; padding-bottom: 0; }

/* Products View */
.toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.5rem; gap: 1rem; flex-wrap: wrap; }
.search-box {
  position: relative; flex: 1; max-width: 400px;
}
.search-box svg { position: absolute; left: 1rem; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--c-text-muted); }
.search-box input {
  width: 100%; padding: 0.6rem 1rem 0.6rem 2.5rem;
  border: 1px solid var(--c-border); border-radius: var(--radius-full);
  background: var(--c-surface); transition: var(--transition-fast);
}
.search-box input:focus { border-color: var(--c-primary); outline: none; box-shadow: 0 0 0 3px var(--c-primary-light); }
.toolbar-actions { display: flex; gap: 1rem; }

.products-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1.5rem;
}
.product-card {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: var(--transition-bounce);
  cursor: pointer;
  position: relative;
}
.product-card:hover {
  transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: var(--c-primary-light);
}
.product-img {
  width: 100%; height: 180px; object-fit: contain;
  background: #fff; padding: 1rem; border-bottom: 1px solid var(--c-border);
}
.product-info { padding: 1.25rem; }
.product-category { font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--c-primary); margin-bottom: 0.25rem; }
.product-title { font-weight: 600; font-size: 1rem; margin-bottom: 0.5rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.product-meta { display: flex; justify-content: space-between; align-items: center; color: var(--c-text-muted); font-size: 0.875rem; }
.badge { position: absolute; top: 1rem; right: 1rem; background: var(--c-primary); color: #fff; font-size: 0.7rem; padding: 0.25rem 0.5rem; border-radius: var(--radius-full); font-weight: 600; }

/* Forms & Panels */
.form-panel { background: var(--c-surface); border-radius: var(--radius-lg); padding: 2rem; border: 1px solid var(--c-border); max-width: 800px; margin: 0 auto; box-shadow: var(--shadow-sm); }
.form-panel h2 { margin-bottom: 1.5rem; border-bottom: 1px solid var(--c-border); padding-bottom: 1rem; }

/* Toggle Switch */
.toggle-switch { position: relative; display: inline-flex; align-items: center; cursor: pointer; }
.toggle-switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.toggle-slider {
  width: 44px; height: 24px; background-color: #94a3b8; border-radius: 24px; transition: var(--transition-normal); position: relative; flex-shrink: 0;
}
.toggle-slider:before {
  content: ""; position: absolute; height: 18px; width: 18px; left: 3px; bottom: 3px; background-color: white; border-radius: 50%; transition: var(--transition-bounce);
}
input:checked + .toggle-slider { background-color: var(--c-primary); }
input:checked + .toggle-slider:before { transform: translateX(20px); }

/* Slide Overlay */
.slide-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.3); backdrop-filter: blur(4px);
  z-index: 1000; opacity: 0; pointer-events: none; transition: var(--transition-normal);
  display: flex; justify-content: flex-end;
}
.slide-overlay.active { opacity: 1; pointer-events: auto; }
.slide-panel {
  width: 100%; max-width: 600px; background: var(--c-surface); height: 100%;
  transform: translateX(100%); transition: var(--transition-bounce);
  display: flex; flex-direction: column; box-shadow: -10px 0 30px rgba(0,0,0,0.1);
}
.slide-overlay.active .slide-panel { transform: translateX(0); }
.slide-header { padding: 1.25rem 2rem; border-bottom: 1px solid var(--c-border); display: flex; justify-content: space-between; align-items: center; background: var(--c-surface); z-index: 10; position: sticky; top: 0; }
.slide-body { padding: 2rem; overflow-y: auto; flex: 1; }
.slide-footer { padding: 1rem 2rem; background: var(--c-surface); border-top: 1px solid var(--c-border); z-index: 10; display: flex; gap: 1rem; position: sticky; bottom: 0; }
.image-preview { margin-top: 1rem; border-radius: var(--radius-md); border: 1px solid var(--c-border); height: 200px; background-size: contain; background-position: center; background-repeat: no-repeat; background-color: #fff;}

/* Toast */
.toast {
  position: fixed; bottom: 2rem; right: 2rem; padding: 1rem 1.5rem; border-radius: var(--radius-md);
  background: var(--c-surface); border-left: 4px solid var(--c-primary);
  box-shadow: var(--shadow-lg); font-weight: 500;
  transform: translateY(100px); opacity: 0; transition: var(--transition-bounce); z-index: 2000;
}
.toast.show { transform: translateY(0); opacity: 1; }
.toast.success { border-color: var(--c-success); }
.toast.error { border-color: var(--c-danger); }

/* Category List */
.category-item { display: flex; align-items: center; justify-content: space-between; padding: 1rem; border: 1px solid var(--c-border); border-radius: var(--radius-md); margin-bottom: 0.5rem; background: var(--c-bg); transition: var(--transition-fast); }
.category-item:hover { border-color: var(--c-primary-light); }

/* Mobile Only */
.mobile-only { display: none; }
.desktop-only { display: block; }
@media (max-width: 768px) {
  html { font-size: 14px; }
  .mobile-only { display: block; }
  .desktop-only { display: none; }
  .sidebar { position: fixed; top: 0; left: 0; bottom: 0; height: 100dvh; transform: translateX(-100%); width: 85vw; max-width: 320px; z-index: 100; }
  .sidebar.open { transform: translateX(0); box-shadow: 10px 0 30px rgba(0,0,0,0.15); }
  .sidebar-nav { padding: 1rem 0.75rem; }
  .nav-item { padding: 0.6rem 0.8rem; font-size: 0.9rem; }
  .topbar { padding: 0 1rem; height: 60px; }
  .view-container { padding: 1rem; }
  .grid-2 { grid-template-columns: 1fr; gap: 0; }
  .form-panel { padding: 1rem; }
  h1 { font-size: 1.5rem; }
  h2 { font-size: 1.25rem; }
  
  /* Mobile Full-Screen Editor */
  .slide-panel { max-width: 100%; }
  .slide-header { padding: 1rem 1.25rem; }
  .slide-body { padding: 1.25rem; }
  .slide-footer { padding: 1rem 1.25rem; }
  
  /* Mobile Product Card */
  .products-grid { grid-template-columns: 1fr; }
  .product-card { display: flex; align-items: stretch; padding: 0.5rem; gap: 1rem; }
  .product-img { width: 100px; height: 100px; border-bottom: none; border-radius: var(--radius-sm); border: 1px solid var(--c-border); padding: 0.5rem; flex-shrink: 0; }
  .product-info { padding: 0.5rem 0; flex: 1; display: flex; flex-direction: column; justify-content: space-between; }
  .product-title { font-size: 0.9rem; -webkit-line-clamp: 2; margin-bottom: 0.25rem; }
  .badge { position: relative; top: 0; right: 0; display: inline-block; width: fit-content; margin-bottom: 0.5rem; }
  
  /* Inputs height */
  .input-group input:not([type="checkbox"]):not([type="color"]), 
  .input-group textarea, 
  .select-input { padding: 0.875rem 1rem; }
}
 
 . d r a g - o v e r - t o p   {   b o r d e r - t o p - c o l o r :   v a r ( - - p r i m a r y )   ! i m p o r t a n t ;   }  
 . d r a g - o v e r - b o t t o m   {   b o r d e r - b o t t o m - c o l o r :   v a r ( - - p r i m a r y )   ! i m p o r t a n t ;   }  
 