/* ═══════════════════════════════════════════════════════════════
   main.css — Design System for Tallabak (طلبك)
   WhatsApp-based SaaS E-commerce Platform
   ═══════════════════════════════════════════════════════════════ */


/* ── Web Fonts ─────────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans+Arabic:wght@300;400;500;600;700&family=Inter:wght@400;500;600;700;800&display=swap');


/* ══════════════════════════════════════════════════════════════
   DESIGN TOKENS — Light Theme (Default)
══════════════════════════════════════════════════════════════ */
:root {
  /* ── Brand ── */
  --primary:            #25D366;
  --primary-dark:       #1eba58;
  --primary-darker:     #179e49;
  --primary-glow:       rgba(37, 211, 102, 0.18);
  --primary-subtle:     rgba(37, 211, 102, 0.06);
  --accent:             #00b4d8;
  --gradient:           linear-gradient(135deg, var(--primary), var(--accent));

  /* ── Semantic Colors ── */
  --success:            #10b981;
  --warning:            #f59e0b;
  --danger:             #ef4444;
  --info:               #0ea5e9;

  /* ── Surfaces ── */
  --bg-main:            #f4f6f9;
  --bg-card:            #ffffff;
  --bg-card-hover:      #f8f9fb;
  --bg-surface:         #eef1f6;
  --bg-surface-1:       #f0f3f8;
  --bg-surface-2:       #e8ecf3;
  --bg-surface-3:       #dfe4ed;

  /* ── Text ── */
  --text-primary:       #0f172a;
  --text-secondary:     #475569;
  --text-muted:         #94a3b8;

  /* ── Borders ── */
  --border-color:       #e2e8f0;
  --border-hover:       #cbd5e1;

  /* ── Radii ── */
  --radius-sm:          8px;
  --radius:             12px;
  --radius-lg:          16px;
  --radius-xl:          20px;
  --radius-full:        9999px;

  /* ── Shadows ── */
  --shadow-sm:          0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow:             0 4px 24px rgba(0,0,0,0.08);
  --shadow-md:          0 4px 16px rgba(0,0,0,0.07), 0 2px 6px rgba(0,0,0,0.04);
  --shadow-lg:          0 12px 40px rgba(0,0,0,0.1), 0 4px 12px rgba(0,0,0,0.06);
  --shadow-xl:          0 24px 64px rgba(0,0,0,0.12), 0 8px 20px rgba(0,0,0,0.06);
  --shadow-glow:        0 0 20px var(--primary-glow);

  /* ── Transitions ── */
  --transition:         0.25s ease;
  --transition-fast:    0.15s ease;
  --transition-slow:    0.4s ease;

  /* ── Layout ── */
  --navbar-height:      64px;
  --sidebar-width:      260px;
}


/* ══════════════════════════════════════════════════════════════
   DARK THEME
══════════════════════════════════════════════════════════════ */
[data-theme="dark"] {
  --primary-glow:       rgba(37, 211, 102, 0.25);
  --primary-subtle:     rgba(37, 211, 102, 0.08);
  --bg-main:            #0a0f1a;
  --bg-card:            #111827;
  --bg-card-hover:      #1a2332;
  --bg-surface:         #0f1520;
  --bg-surface-1:       #131b2e;
  --bg-surface-2:       #1a2340;
  --bg-surface-3:       #212d4a;
  --text-primary:       #f0f4f8;
  --text-secondary:     #94a3b8;
  --text-muted:         #64748b;
  --border-color:       #1e293b;
  --border-hover:       #334155;
  --shadow-sm:          0 1px 3px rgba(0,0,0,0.2), 0 1px 2px rgba(0,0,0,0.15);
  --shadow:             0 4px 24px rgba(0,0,0,0.35);
  --shadow-md:          0 4px 16px rgba(0,0,0,0.3), 0 2px 6px rgba(0,0,0,0.2);
  --shadow-lg:          0 12px 40px rgba(0,0,0,0.4), 0 4px 12px rgba(0,0,0,0.25);
  --shadow-xl:          0 24px 64px rgba(0,0,0,0.5), 0 8px 20px rgba(0,0,0,0.3);
  --shadow-glow:        0 0 20px var(--primary-glow);
}


/* ══════════════════════════════════════════════════════════════
   RESET & BASE
══════════════════════════════════════════════════════════════ */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: 'IBM Plex Sans Arabic', 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg-main);
  color: var(--text-primary);
  min-height: 100vh;
  padding-top: var(--navbar-height);
  direction: rtl;
  text-align: right;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  text-decoration: none;
  color: inherit;
}

img {
  max-width: 100%;
  display: block;
}

button {
  cursor: pointer;
  font-family: inherit;
}

::selection {
  background: var(--primary);
  color: #fff;
}


/* ══════════════════════════════════════════════════════════════
   TYPOGRAPHY UTILITIES
══════════════════════════════════════════════════════════════ */
.text-xs   { font-size: 0.75rem;  line-height: 1.5; }
.text-sm   { font-size: 0.875rem; line-height: 1.5; }
.text-base { font-size: 1rem;     line-height: 1.6; }
.text-lg   { font-size: 1.125rem; line-height: 1.5; }
.text-xl   { font-size: 1.25rem;  line-height: 1.4; }
.text-2xl  { font-size: 1.5rem;   line-height: 1.3; }

.text-primary   { color: var(--text-primary) !important; }
.text-secondary { color: var(--text-secondary) !important; }
.text-muted     { color: var(--text-muted) !important; }
.text-green     { color: var(--primary) !important; }
.text-center    { text-align: center; }


/* ══════════════════════════════════════════════════════════════
   DARK MODE TOGGLE
══════════════════════════════════════════════════════════════ */
.dark-toggle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  transition: all var(--transition);
  flex-shrink: 0;
  color: var(--text-secondary);
}
.dark-toggle:hover {
  background: var(--bg-card-hover);
  border-color: var(--primary);
  color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-subtle);
  transform: rotate(15deg);
}


/* ══════════════════════════════════════════════════════════════
   NAVBAR
══════════════════════════════════════════════════════════════ */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--navbar-height);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(20px) saturate(1.2);
  -webkit-backdrop-filter: blur(20px) saturate(1.2);
  border-bottom: 1px solid var(--border-color);
  z-index: 1000;
  transition: box-shadow var(--transition);
}

[data-theme="dark"] .navbar {
  background: rgba(10, 15, 26, 0.92);
  border-bottom-color: rgba(255,255,255,0.06);
}

.navbar.scrolled {
  box-shadow: var(--shadow-lg);
}

.navbar-container {
  max-width: 1200px;
  margin: 0 auto;
  height: 100%;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  gap: 2rem;
}

/* Logo */
.navbar-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--primary);
  flex-shrink: 0;
  transition: opacity var(--transition-fast);
}
.navbar-logo .logo-icon { font-size: 1.4rem; }
.navbar-logo:hover { opacity: 0.85; }

/* Desktop Nav Links */
.navbar-links {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  flex: 1;
}

.nav-link {
  display: block;
  padding: 0.45rem 0.9rem;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  transition: color var(--transition-fast), background var(--transition-fast);
  white-space: nowrap;
  position: relative;
}

.nav-link:hover,
.nav-link.active {
  color: var(--text-primary);
  background: var(--bg-surface);
}

[data-theme="dark"] .nav-link:hover,
[data-theme="dark"] .nav-link.active {
  background: rgba(255,255,255,0.07);
}

.nav-link.active {
  color: var(--primary);
  font-weight: 600;
}

/* Auth Buttons */
.navbar-auth {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-shrink: 0;
}

.nav-user-badge {
  font-size: 0.82rem;
  color: var(--text-muted);
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  padding: 0.3rem 0.75rem;
  border-radius: var(--radius-full);
  white-space: nowrap;
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.btn-nav {
  display: inline-flex;
  align-items: center;
  padding: 0.45rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 600;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.btn-nav-outline {
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
  background: transparent;
}
.btn-nav-outline:hover {
  color: var(--text-primary);
  border-color: var(--border-hover);
  background: var(--bg-surface);
}

.btn-nav-primary {
  background: var(--primary);
  color: #fff;
  border: 1px solid var(--primary);
  box-shadow: 0 0 12px rgba(37,211,102,0.25);
}
.btn-nav-primary:hover {
  background: var(--primary-dark);
  box-shadow: 0 4px 20px rgba(37,211,102,0.35);
}

/* Mobile Hamburger */
.navbar-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  padding: 0.5rem;
  margin-right: auto;
  margin-left: 0;
  flex-shrink: 0;
}
.navbar-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text-secondary);
  border-radius: 2px;
  transition: all 0.3s ease;
}
.navbar-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.navbar-toggle.open span:nth-child(2) { opacity: 0; }
.navbar-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Responsive Navbar */
@media (max-width: 768px) {
  .navbar-toggle { display: flex; }
  .navbar-links,
  .navbar-auth {
    display: none;
    position: fixed;
    top: var(--navbar-height);
    left: 0; right: 0;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 1.5rem;
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
    z-index: 999;
    animation: slideDown 0.25s ease;
  }
  .navbar-links.mobile-open,
  .navbar-auth.mobile-open { display: flex; }
  .nav-link { padding: 0.75rem 1rem; }
  .btn-nav { justify-content: center; padding: 0.75rem 1rem; }
  .nav-user-badge { max-width: 100%; }
}


/* ══════════════════════════════════════════════════════════════
   TOASTS
══════════════════════════════════════════════════════════════ */
.toast-container {
  position: fixed;
  top: calc(var(--navbar-height) + 12px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  padding: 12px 24px;
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 600;
  color: #fff;
  box-shadow: var(--shadow-lg);
  animation: toastIn 0.4s ease, toastOut 0.4s ease 3.6s forwards;
  backdrop-filter: blur(10px);
  pointer-events: auto;
}
.toast.success { background: rgba(16,185,129,0.92); }
.toast.error   { background: rgba(239,68,68,0.92); }
.toast.info,
.toast.warning { background: rgba(14,165,233,0.92); }

@keyframes toastIn  { from { opacity:0; transform: translateY(-16px); } to { opacity:1; transform: translateY(0); } }
@keyframes toastOut { from { opacity:1; } to { opacity:0; transform: translateY(-16px); } }


/* ══════════════════════════════════════════════════════════════
   CONTAINER & LAYOUT UTILITIES
══════════════════════════════════════════════════════════════ */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.d-flex       { display: flex; }
.align-center { align-items: center; }
.gap-1        { gap: 0.5rem; }
.gap-2        { gap: 1rem; }

.flex           { display: flex; }
.flex-col       { flex-direction: column; }
.items-center   { align-items: center; }
.justify-between { justify-content: space-between; }
.flex-wrap      { flex-wrap: wrap; }
.w-full         { width: 100%; }
.h-full         { height: 100%; }

/* Spacing */
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }

/* Border Radius */
.rounded      { border-radius: var(--radius); }
.rounded-lg   { border-radius: var(--radius-lg); }
.rounded-full { border-radius: var(--radius-full); }

/* Text Utilities */
.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Screen Reader Only */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* Divider */
.divider {
  height: 1px;
  background: var(--border-color);
  border: none;
  margin: 1rem 0;
}


/* ══════════════════════════════════════════════════════════════
   BUTTONS
══════════════════════════════════════════════════════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 1.25rem;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.9rem;
  border: none;
  transition: all var(--transition-fast);
  position: relative;
  white-space: nowrap;
  line-height: 1.4;
}

.btn-primary {
  background: var(--gradient);
  color: #fff;
}
.btn-primary:hover {
  box-shadow: var(--shadow-glow), var(--shadow-sm);
  filter: brightness(1.05);
}

.btn-secondary {
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}
.btn-secondary:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-hover);
}

.btn-danger {
  background: rgba(239,68,68,0.15);
  color: #f87171;
  border: 1px solid rgba(239,68,68,0.3);
}
.btn-danger:hover {
  background: rgba(239,68,68,0.25);
  border-color: rgba(239,68,68,0.45);
}

.btn-outline {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
}
.btn-outline:hover {
  background: var(--bg-surface-1);
  border-color: var(--border-hover);
  color: var(--text-primary);
}

.btn-success {
  background: rgba(16,185,129,0.15);
  color: #10b981;
  border: 1px solid rgba(16,185,129,0.3);
}
.btn-success:hover { background: rgba(16,185,129,0.25); }

.btn-warning {
  background: rgba(245,158,11,0.15);
  color: #f59e0b;
  border: 1px solid rgba(245,158,11,0.3);
}
.btn-warning:hover { background: rgba(245,158,11,0.25); }

.btn-info {
  background: rgba(14,165,233,0.15);
  color: #0ea5e9;
  border: 1px solid rgba(14,165,233,0.3);
}
.btn-info:hover { background: rgba(14,165,233,0.25); }

/* Button Sizes */
.btn-xs {
  padding: 0.25rem 0.6rem;
  font-size: 0.75rem;
  border-radius: 6px;
}
.btn-sm {
  padding: 0.4rem 0.85rem;
  font-size: 0.82rem;
  border-radius: var(--radius-sm);
}
.btn-lg {
  padding: 0.85rem 1.75rem;
  font-size: 1rem;
  border-radius: var(--radius-lg);
  gap: 0.65rem;
}

/* Icon-only Button */
.btn-icon {
  padding: 0;
  width: 40px;
  height: 40px;
  border-radius: var(--radius);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}
.btn-icon.btn-sm {
  width: 32px;
  height: 32px;
  font-size: 0.95rem;
}
.btn-icon.btn-lg {
  width: 48px;
  height: 48px;
  font-size: 1.3rem;
}

/* Loading State */
.btn.loading {
  pointer-events: none;
  opacity: 0.75;
  position: relative;
  color: transparent !important;
}
.btn.loading::after {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}
.btn-secondary.loading::after,
.btn-outline.loading::after {
  border-color: rgba(100,116,139,0.3);
  border-top-color: var(--text-secondary);
}


/* ══════════════════════════════════════════════════════════════
   BADGES
══════════════════════════════════════════════════════════════ */
.badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}
.badge-success { background: rgba(16,185,129,0.15); color: #10b981; }
.badge-warning { background: rgba(245,158,11,0.15); color: #f59e0b; }
.badge-danger  { background: rgba(239,68,68,0.15);  color: #ef4444; }
.badge-info    { background: rgba(14,165,233,0.15);  color: #0ea5e9; }
.badge-muted   { background: rgba(100,116,139,0.15); color: #64748b; }


/* ══════════════════════════════════════════════════════════════
   CARDS
══════════════════════════════════════════════════════════════ */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.card:hover {
  /* Only apply hover effect when card is interactive — safe default */
}

.card-header {
  padding-bottom: 1rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.card-body {
  flex: 1;
}

.card-footer {
  padding-top: 1rem;
  margin-top: 1rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
}


/* ══════════════════════════════════════════════════════════════
   DASHBOARD LAYOUT
══════════════════════════════════════════════════════════════ */
.dashboard-page { padding-top: 0; }

.dashboard-layout {
  display: flex;
  min-height: 100vh;
}

/* ── Sidebar ── */
.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-card);
  border-left: 1px solid var(--border-color);
  padding-top: 2.5rem;
  position: fixed;
  top: 0; right: 0;
  height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
  z-index: 100;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);

  /* Thin scrollbar */
  scrollbar-width: thin;
  scrollbar-color: var(--border-color) transparent;
}
.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 4px;
}

.sidebar-logo {
  padding: 1.25rem 1.5rem 1rem;
}
.sidebar-logo h2 {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--primary);
}
.sidebar-logo small {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Sidebar Navigation */
.sidebar-nav {
  list-style: none;
  padding: 0 0.75rem;
}
.sidebar-nav li a {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.6rem 1rem;
  border-radius: var(--radius);
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  transition: all var(--transition-fast);
  margin-bottom: 2px;
  position: relative;
}
.sidebar-nav li a:hover {
  background: var(--bg-surface-1);
  color: var(--text-primary);
}
.sidebar-nav li a.active {
  background: var(--primary-subtle);
  color: var(--primary);
  font-weight: 600;
}
.sidebar-nav li a.active::before {
  content: '';
  position: absolute;
  right: -0.75rem;
  top: 0.35rem;
  bottom: 0.35rem;
  width: 3px;
  background: var(--primary);
  border-radius: 3px 0 0 3px;
}

/* Sidebar Groups — Collapsible */
.sidebar-group {
  margin-top: 0.25rem;
}
.sidebar-group-title {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  padding: 0.6rem 1rem 0.35rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  border-radius: var(--radius);
  transition: all var(--transition-fast);
  user-select: none;
}
.sidebar-group-title:hover {
  color: var(--text-primary);
  background: var(--bg-surface-1);
}
.sidebar-group-title .group-chevron {
  width: 14px;
  height: 14px;
  transition: transform 0.25s ease;
  opacity: 0.5;
  flex-shrink: 0;
}
.sidebar-group.collapsed .group-chevron {
  transform: rotate(-90deg);
}
.sidebar-group .sidebar-nav {
  max-height: 1000px;
  overflow: hidden;
  transition: max-height 0.3s ease, opacity 0.2s ease;
  opacity: 1;
}
.sidebar-group.collapsed .sidebar-nav {
  max-height: 0;
  opacity: 0;
}
/* Badge for item count in collapsed groups */
.sidebar-group-title .group-count {
  font-size: 0.6rem;
  background: var(--primary-subtle);
  color: var(--primary);
  padding: 1px 6px;
  border-radius: 10px;
  font-weight: 700;
  margin-left: 4px;
  margin-right: auto;
}
/* Always-open groups (no collapse) */
.sidebar-group.no-collapse .sidebar-group-title {
  cursor: default;
}
.sidebar-group.no-collapse .sidebar-group-title:hover {
  background: transparent;
  color: var(--text-muted);
}

/* Hide public footer on dashboard pages */
.dashboard-page .site-footer {
  display: none !important;
}

.nav-icon {
  font-size: 1.1rem;
  min-width: 1.3rem;
  text-align: center;
  flex-shrink: 0;
}

.sidebar-divider {
  height: 1px;
  background: var(--border-color);
  margin: 0.75rem 1.5rem;
}

.sidebar-toggle {
  display: none;
  position: fixed;
  top: 40px; right: 12px;
  z-index: 1002;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  width: 40px; height: 40px;
  border-radius: var(--radius);
  font-size: 1.2rem;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-fast);
}
.sidebar-toggle:hover {
  background: var(--bg-card-hover);
}

/* ── Main Content ── */
.main-content {
  flex: 1;
  margin-right: var(--sidebar-width);
  padding: 2.5rem 2rem 2rem;
  min-height: 100vh;
}

@media (max-width: 900px) {
  .sidebar {
    transform: translateX(100%);
  }
  .sidebar.open {
    transform: translateX(0);
    box-shadow: -4px 0 24px rgba(0,0,0,0.4);
  }
  .sidebar-toggle { display: flex; }
  .main-content {
    margin-right: 0;
    padding: 3.5rem 1rem 2rem;
  }
}

/* ── Page Header ── */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.page-header h1 {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}


/* ══════════════════════════════════════════════════════════════
   STATS GRID
══════════════════════════════════════════════════════════════ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}
.stat-card::before {
  content: '';
  position: absolute;
  right: 0;
  top: 20%;
  bottom: 20%;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--gradient);
  opacity: 0;
  transition: opacity var(--transition);
}
.stat-card:hover {
  border-color: rgba(37,211,102,0.2);
  box-shadow: var(--shadow-md);
}
.stat-card:hover::before {
  opacity: 1;
}

.stat-icon {
  width: 48px; height: 48px;
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--primary-subtle), var(--primary-glow));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  flex-shrink: 0;
}

.stat-value {
  font-size: 1.5rem;
  font-weight: 800;
  line-height: 1.2;
  font-feature-settings: 'tnum';
  letter-spacing: -0.02em;
}

.stat-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

/* Trend indicator (optional area inside stat cards) */
.stat-trend {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.15rem 0.4rem;
  border-radius: var(--radius-sm);
}
.stat-trend.up {
  color: var(--success);
  background: rgba(16,185,129,0.12);
}
.stat-trend.down {
  color: var(--danger);
  background: rgba(239,68,68,0.12);
}


/* ══════════════════════════════════════════════════════════════
   DATA TABLES
══════════════════════════════════════════════════════════════ */
.table-container {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  background: var(--bg-card);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.data-table th {
  padding: 0.75rem 1rem;
  text-align: right;
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 2;
}

.data-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-secondary);
  vertical-align: middle;
}

[data-theme="dark"] .data-table td {
  border-bottom: 1px solid rgba(255,255,255,0.04);
}

.data-table tr:hover td {
  background: var(--bg-surface-1);
}

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


/* ══════════════════════════════════════════════════════════════
   STATUS BADGES
══════════════════════════════════════════════════════════════ */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}
.status-badge.pending    { background: rgba(245,158,11,0.15); color: #f59e0b; }
.status-badge.confirmed  { background: rgba(14,165,233,0.15); color: #0ea5e9; }
.status-badge.preparing  { background: rgba(168,85,247,0.15); color: #a855f7; }
.status-badge.shipped,
.status-badge.delivering { background: rgba(59,130,246,0.15); color: #3b82f6; }
.status-badge.delivered  { background: rgba(16,185,129,0.15); color: #10b981; }
.status-badge.cancelled  { background: rgba(239,68,68,0.15);  color: #ef4444; }


/* ══════════════════════════════════════════════════════════════
   FORMS
══════════════════════════════════════════════════════════════ */
.form-group {
  margin-bottom: 1rem;
}
.form-group label {
  display: block;
  margin-bottom: 0.4rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.form-input,
.filter-select,
.search-input {
  width: 100%;
  padding: 0.65rem 1rem;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius);
  background: var(--bg-surface);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.9rem;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-fast);
}
.form-input:focus,
.filter-select:focus,
.search-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow), 0 0 0 1px var(--primary);
  background: var(--bg-card);
}

.form-input::placeholder,
.search-input::placeholder {
  color: var(--text-muted);
}

.form-error {
  color: var(--danger);
  font-size: 0.8rem;
  margin-top: 0.3rem;
}

.form-hint {
  color: var(--text-muted);
  font-size: 0.78rem;
  margin-top: 0.3rem;
  line-height: 1.4;
}

select.form-input,
.filter-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%2364748b' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
  background-position: left 0.75rem center;
  background-repeat: no-repeat;
  background-size: 1.2em;
  padding-left: 2.5rem;
  cursor: pointer;
}

textarea.form-input {
  resize: vertical;
  min-height: 80px;
}

/* Checkbox / Toggle */
.form-checkbox {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--text-secondary);
}
.form-checkbox input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border: 1.5px solid var(--border-color);
  border-radius: 5px;
  background: var(--bg-surface);
  cursor: pointer;
  transition: all var(--transition-fast);
  flex-shrink: 0;
  position: relative;
}
.form-checkbox input[type="checkbox"]:checked {
  background: var(--primary);
  border-color: var(--primary);
}
.form-checkbox input[type="checkbox"]:checked::after {
  content: '';
  position: absolute;
  top: 2px;
  right: 5px;
  width: 5px;
  height: 9px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.form-checkbox input[type="checkbox"]:focus {
  box-shadow: 0 0 0 3px var(--primary-glow);
}

/* Toggle Switch */
.form-toggle {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--text-secondary);
}
.form-toggle input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 40px;
  height: 22px;
  border-radius: 11px;
  background: var(--border-color);
  cursor: pointer;
  transition: all var(--transition-fast);
  position: relative;
  flex-shrink: 0;
}
.form-toggle input[type="checkbox"]::after {
  content: '';
  position: absolute;
  top: 2px;
  right: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  transition: transform var(--transition-fast);
  box-shadow: var(--shadow-sm);
}
.form-toggle input[type="checkbox"]:checked {
  background: var(--primary);
}
.form-toggle input[type="checkbox"]:checked::after {
  transform: translateX(-18px);
}
.form-toggle input[type="checkbox"]:focus {
  box-shadow: 0 0 0 3px var(--primary-glow);
}


/* ══════════════════════════════════════════════════════════════
   SETTINGS
══════════════════════════════════════════════════════════════ */
.settings-section {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}
.settings-section h2 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-color);
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
}


/* ══════════════════════════════════════════════════════════════
   PRODUCTS GRID (Dashboard)
══════════════════════════════════════════════════════════════ */
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
}

.product-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.product-card:hover {
  border-color: rgba(37,211,102,0.25);
  box-shadow: var(--shadow-md), 0 0 0 1px rgba(37,211,102,0.08);
}

.product-image {
  width: 100%;
  height: 160px;
  object-fit: cover;
}

.product-image-placeholder {
  width: 100%;
  height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  background: var(--bg-surface);
  opacity: 0.4;
}

.product-badge {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  background: var(--danger);
  color: #fff;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-sm);
  font-size: 0.7rem;
  font-weight: 700;
}

.product-info {
  padding: 1rem;
}
.product-info .product-name {
  font-weight: 700;
  font-size: 0.95rem;
  margin-bottom: 0.3rem;
}

.product-price {
  color: var(--primary);
  font-weight: 700;
  font-feature-settings: 'tnum';
}
.product-old-price {
  text-decoration: line-through;
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-right: 0.3rem;
}

.product-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.75rem;
  flex-wrap: wrap;
}


/* ══════════════════════════════════════════════════════════════
   ORDER DETAIL
══════════════════════════════════════════════════════════════ */
.order-detail-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 1.25rem;
}
.order-detail-card h2 {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-color);
}

.detail-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border-color);
}
.detail-row:last-child { border-bottom: none; }

.detail-label {
  color: var(--text-muted);
  font-size: 0.85rem;
}
.detail-value {
  font-weight: 600;
  font-size: 0.9rem;
}

[data-theme="dark"] .detail-row {
  border-bottom-color: rgba(255,255,255,0.03);
}


/* ══════════════════════════════════════════════════════════════
   TIMELINE
══════════════════════════════════════════════════════════════ */
.timeline {
  display: flex;
  justify-content: space-between;
  margin-top: 1rem;
  position: relative;
  padding-bottom: 0.5rem;
}
.timeline::before {
  content: '';
  position: absolute;
  top: 14px;
  right: 14px;
  left: 14px;
  height: 3px;
  background: var(--border-color);
  z-index: 0;
}

.timeline-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  z-index: 1;
  flex: 1;
}

.timeline-dot {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--bg-surface);
  border: 3px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  margin-bottom: 0.5rem;
  transition: all 0.3s ease;
}

.timeline-step.done .timeline-dot {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.timeline-step.active .timeline-dot {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--primary-glow);
  background: var(--primary);
  color: #fff;
  transform: scale(1.15);
}

.timeline-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-align: center;
  max-width: 70px;
}
.timeline-step.done .timeline-label,
.timeline-step.active .timeline-label {
  color: var(--primary);
  font-weight: 600;
}


/* ══════════════════════════════════════════════════════════════
   WHATSAPP ACTIONS
══════════════════════════════════════════════════════════════ */
.wa-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.wa-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.4rem 0.8rem;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all var(--transition-fast);
}
.wa-btn:hover {
  filter: brightness(1.15);
}

.wa-confirm  { background: rgba(16,185,129,0.15); color: #10b981; }
.wa-payment  { background: rgba(14,165,233,0.15); color: #0ea5e9; }
.wa-shipping { background: rgba(168,85,247,0.15); color: #a855f7; }
.wa-cancel   { background: rgba(239,68,68,0.15);  color: #ef4444; }


/* ══════════════════════════════════════════════════════════════
   MODALS
══════════════════════════════════════════════════════════════ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.modal-overlay.active {
  display: flex;
  animation: fadeIn 0.2s ease;
}

.modal {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 2rem;
  min-width: 360px;
  max-width: 500px;
  width: 100%;
  animation: modalIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: var(--shadow-xl);
}
.modal h2 {
  margin-bottom: 1.25rem;
  font-size: 1.1rem;
}

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


/* ══════════════════════════════════════════════════════════════
   AUTH PAGES
══════════════════════════════════════════════════════════════ */
.auth-page {
  padding-top: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: var(--bg-main);
}

.auth-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 2.5rem;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow-lg);
}

.auth-card h1 {
  font-size: 1.6rem;
  font-weight: 800;
  text-align: center;
  margin-bottom: 0.25rem;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.auth-card .subtitle {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
}

.auth-footer {
  text-align: center;
  margin-top: 1.25rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}
.auth-footer a {
  color: var(--primary);
  font-weight: 600;
}
.auth-footer a:hover { text-decoration: underline; }

.auth-card .form-group input,
.auth-card .form-group select {
  width: 100%;
  padding: 0.65rem 1rem;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius);
  background: var(--bg-surface);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.9rem;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}
.auth-card .form-group input:focus {
  border-color: var(--primary);
  outline: none;
  box-shadow: 0 0 0 3px var(--primary-glow), 0 0 0 1px var(--primary);
}


/* ══════════════════════════════════════════════════════════════
   EMPTY STATE
══════════════════════════════════════════════════════════════ */
.empty-state {
  text-align: center;
  padding: 3rem 1.5rem;
  color: var(--text-muted);
}
.empty-state .icon {
  font-size: 3.5rem;
  margin-bottom: 1rem;
  display: block;
  opacity: 0.6;
}
.empty-state h3 {
  font-size: 1.15rem;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}
.empty-state p {
  font-size: 0.9rem;
  margin-bottom: 1rem;
  max-width: 360px;
  margin-left: auto;
  margin-right: auto;
}


/* ══════════════════════════════════════════════════════════════
   MESSAGES
══════════════════════════════════════════════════════════════ */
.messages {
  list-style: none;
  margin-bottom: 1rem;
}
.messages li {
  padding: 0.7rem 1rem;
  border-radius: var(--radius);
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
  font-weight: 500;
}
.messages .success { background: rgba(16,185,129,0.12); color: #10b981; border: 1px solid rgba(16,185,129,0.25); }
.messages .error   { background: rgba(239,68,68,0.12); color: #ef4444; border: 1px solid rgba(239,68,68,0.25); }
.messages .warning { background: rgba(245,158,11,0.12); color: #f59e0b; border: 1px solid rgba(245,158,11,0.25); }
.messages .info    { background: rgba(14,165,233,0.12); color: #0ea5e9; border: 1px solid rgba(14,165,233,0.25); }


/* ══════════════════════════════════════════════════════════════
   CODE BLOCK
══════════════════════════════════════════════════════════════ */
.code-block {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 1rem;
  font-family: 'Courier New', monospace;
  font-size: 0.82rem;
  color: var(--primary);
  direction: ltr;
  text-align: left;
  word-break: break-all;
  position: relative;
}

.copy-btn {
  position: absolute;
  top: 0.5rem;
  left: 0.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  padding: 0.3rem 0.6rem;
  border-radius: 6px;
  font-size: 0.75rem;
  cursor: pointer;
  transition: all var(--transition-fast);
}
.copy-btn:hover { color: var(--primary); border-color: var(--primary); }


/* ══════════════════════════════════════════════════════════════
   PAGINATION
══════════════════════════════════════════════════════════════ */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.3rem;
  margin-top: 2rem;
  list-style: none;
}

.pagination a,
.pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 0.5rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  transition: all var(--transition-fast);
}
.pagination a:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
  border-color: var(--border-hover);
}
.pagination .current {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}


/* ══════════════════════════════════════════════════════════════
   SEARCH & FILTERS
══════════════════════════════════════════════════════════════ */
.search-input {
  max-width: 320px;
}

.filter-select {
  max-width: 200px;
}


/* ══════════════════════════════════════════════════════════════
   KEYFRAME ANIMATIONS
══════════════════════════════════════════════════════════════ */
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

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

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: translateX(0); }
}

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

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.5; }
}

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

@keyframes shimmer {
  0%   { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

/* Animation Utility Classes */
.animate-fade-in {
  animation: fadeIn 0.3s ease both;
}

.animate-slide-up {
  animation: fadeInUp 0.4s ease both;
}

.animate-slide-right {
  animation: slideInRight 0.4s ease both;
}


/* ══════════════════════════════════════════════════════════════
   SKELETON LOADING
══════════════════════════════════════════════════════════════ */
.skeleton {
  background: linear-gradient(
    90deg,
    var(--bg-surface-1) 25%,
    var(--bg-surface-2) 50%,
    var(--bg-surface-1) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.8s ease-in-out infinite;
  border-radius: var(--radius-sm);
  color: transparent !important;
  pointer-events: none;
  user-select: none;
}
.skeleton * {
  visibility: hidden;
}


/* ══════════════════════════════════════════════════════════════
   RESPONSIVE — Tablet (1024px)
══════════════════════════════════════════════════════════════ */
@media (max-width: 1024px) {
  .stats-grid {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  }

  .products-grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  }

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

  .page-header h1 {
    font-size: 1.3rem;
  }
}


/* ══════════════════════════════════════════════════════════════
   RESPONSIVE — Mobile (640px)
══════════════════════════════════════════════════════════════ */
@media (max-width: 640px) {
  .search-input,
  .filter-select { max-width: 100%; }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
  }

  .stat-card {
    padding: 1rem;
  }

  .stat-icon {
    width: 40px;
    height: 40px;
    font-size: 1.1rem;
  }

  .stat-value {
    font-size: 1.25rem;
  }

  .products-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
  }

  .timeline { flex-direction: column; gap: 0.5rem; }
  .timeline::before {
    top: 14px; bottom: 14px;
    right: 14px; left: auto;
    width: 3px; height: auto;
  }
  .timeline-step { flex-direction: row; gap: 0.75rem; }

  .modal {
    min-width: auto;
    padding: 1.5rem;
    margin: 0.5rem;
    border-radius: var(--radius-lg);
  }

  .auth-card {
    padding: 1.75rem;
    margin: 1rem;
  }

  .container {
    padding: 0 1rem;
  }

  .main-content {
    padding: 2.5rem 0.75rem 1.5rem;
  }
}


/* ══════════════════════════════════════════════════════════════
   PRINT STYLES
══════════════════════════════════════════════════════════════ */
@media print {
  body {
    background: #fff;
    color: #000;
    padding-top: 0;
  }

  .navbar,
  .sidebar,
  .sidebar-toggle,
  .dark-toggle,
  .btn,
  .wa-actions,
  .toast-container {
    display: none !important;
  }

  .main-content {
    margin-right: 0;
    padding: 0;
  }

  .card,
  .stat-card,
  .order-detail-card,
  .settings-section,
  .table-container {
    border: 1px solid #ddd;
    box-shadow: none;
    break-inside: avoid;
  }

  .data-table th {
    background: #f5f5f5;
  }

  a { color: #000; }
}


/* ══════════════════════════════════════════════════════════════
   TOAST NOTIFICATIONS
══════════════════════════════════════════════════════════════ */
.toast-container {
  position: fixed;
  top: 50px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  padding: 12px 24px;
  border-radius: 12px;
  font-size: 0.9rem;
  font-weight: 600;
  color: #fff;
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
  animation: toastIn 0.4s ease, toastOut 0.4s ease 3.6s forwards;
  backdrop-filter: blur(8px);
}

.toast.success { background: rgba(16,185,129,0.9); }
.toast.error   { background: rgba(239,68,68,0.9); }
.toast.info,
.toast.warning { background: rgba(14,165,233,0.9); }

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

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


/* ══════════════════════════════════════════════════════════════
   PAGINATION
══════════════════════════════════════════════════════════════ */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1.5rem;
  flex-wrap: wrap;
}

.pagination-btn {
  padding: 0.4rem 0.8rem;
  border-radius: 8px;
  color: var(--text-secondary);
  font-size: 0.85rem;
  border: 1px solid var(--border-color);
  text-decoration: none;
  transition: all 0.2s;
}

.pagination-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.pagination-current {
  background: var(--primary);
  color: #fff;
  padding: 0.4rem 0.8rem;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.85rem;
}

.pagination-info {
  color: var(--text-muted);
  font-size: 0.8rem;
  margin-right: 1rem;
}


/* ══════════════════════════════════════════════════════════════
   SITE FOOTER
══════════════════════════════════════════════════════════════ */
.site-footer {
  border-top: 1px solid var(--border-color);
  padding: 3.5rem 2rem 2rem;
  background: var(--bg-surface);
  margin-top: 4rem;
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
}

.site-footer .footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 3rem;
  margin-bottom: 2.5rem;
}

.site-footer .footer-brand {
  font-size: 1.4rem;
  font-weight: 900;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.site-footer .footer-brand .logo-icon {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: var(--gradient);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.site-footer .footer-logo-text {
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.site-footer .footer-brand-col p {
  color: var(--text-muted);
  font-size: 0.88rem;
  line-height: 1.7;
  margin-bottom: 1.25rem;
  max-width: 300px;
}

.site-footer .footer-social {
  display: flex;
  gap: 0.6rem;
}

.site-footer .footer-social a {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s;
}

.site-footer .footer-social a:hover {
  border-color: var(--primary);
  background: rgba(37,211,102,0.06);
}

.site-footer .footer-social a svg {
  width: 16px;
  height: 16px;
  color: var(--text-muted);
}

.site-footer .footer-social a:hover svg {
  color: var(--primary);
}

.site-footer .footer-col h4 {
  font-size: 0.9rem;
  font-weight: 700;
  margin-bottom: 0.9rem;
  color: var(--text-primary);
}

.site-footer .footer-col a {
  display: block;
  color: var(--text-muted);
  font-size: 0.85rem;
  padding: 0.3rem 0;
  text-decoration: none;
  transition: color 0.3s;
}

.site-footer .footer-col a:hover {
  color: var(--primary);
}

.site-footer .footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 1.75rem;
  border-top: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 0.8rem;
}

@media (max-width: 768px) {
  .site-footer .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
  }
}

@media (max-width: 480px) {
  .site-footer .footer-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  .site-footer .footer-bottom {
    flex-direction: column;
    text-align: center;
    gap: 0.5rem;
  }
}
