/* ═══════════════════════════════════════════════════
   SPX Orders — Premium Admin & User Panel CSS
   Dark mode + Glassmorphism + Micro-animations
   ═══════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Tajawal:wght@300;400;500;700;800&display=swap');

/* ─── Design Tokens ─── */
:root {
  --bg-deep:     #06080f;
  --bg-primary:  #0a0e1a;
  --bg-card:     rgba(15, 20, 35, 0.65);
  --bg-card-solid: #0f1423;
  --bg-sidebar:  rgba(10, 14, 26, 0.92);
  --bg-input:    rgba(12, 16, 30, 0.8);
  --bg-hover:    rgba(99, 102, 241, 0.06);

  --border:      rgba(99, 102, 241, 0.12);
  --border-light:rgba(148, 163, 184, 0.1);
  --border-focus:rgba(99, 102, 241, 0.5);

  --primary:     #6366f1;
  --primary-light:#818cf8;
  --primary-glow: rgba(99, 102, 241, 0.15);
  --accent:      #06b6d4;
  --accent-glow: rgba(6, 182, 212, 0.12);
  --success:     #10b981;
  --success-glow:rgba(16, 185, 129, 0.12);
  --danger:      #f43f5e;
  --danger-glow: rgba(244, 63, 94, 0.12);
  --warning:     #f59e0b;
  --warning-glow:rgba(245, 158, 11, 0.12);

  --text:        #f1f5f9;
  --text-secondary:#94a3b8;
  --text-muted:  #64748b;

  --gradient-primary: linear-gradient(135deg, #6366f1, #8b5cf6);
  --gradient-accent:  linear-gradient(135deg, #06b6d4, #3b82f6);
  --gradient-bg:      linear-gradient(180deg, #06080f 0%, #0a0e1a 40%, #0f1225 100%);

  --radius-sm:   8px;
  --radius-md:   12px;
  --radius-lg:   16px;
  --radius-xl:   20px;
  --radius-full: 9999px;

  --shadow-sm:   0 2px 8px rgba(0,0,0,.25);
  --shadow-md:   0 4px 20px rgba(0,0,0,.35);
  --shadow-lg:   0 8px 40px rgba(0,0,0,.45);
  --shadow-glow: 0 0 20px var(--primary-glow);

  --sidebar-width: 260px;
  --topbar-height: 64px;
  --transition:  all .25s cubic-bezier(.4,0,.2,1);
  --transition-fast: all .15s ease;
}

/* ─── Reset & Base ─── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Tajawal', 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--gradient-bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--primary); }

a { color: var(--primary-light); text-decoration: none; transition: var(--transition-fast); }
a:hover { color: var(--accent); }

.hidden { display: none !important; }

/* ─── Particles canvas (Login page) ─── */
#particles-canvas {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: 0;
  pointer-events: none;
}

/* ═══════════════════════════════════════════════════
   LOGIN PAGE
   ═══════════════════════════════════════════════════ */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  position: relative;
}

.login-container {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 440px;
}

.login-card {
  background: var(--bg-card);
  backdrop-filter: blur(20px) saturate(1.5);
  -webkit-backdrop-filter: blur(20px) saturate(1.5);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 40px 32px;
  box-shadow: var(--shadow-lg), var(--shadow-glow);
  animation: slideUp .6s cubic-bezier(.4,0,.2,1);
}

.login-logo {
  width: 64px; height: 64px;
  border-radius: var(--radius-lg);
  display: flex; align-items: center; justify-content: center;
  background: var(--gradient-primary);
  color: white;
  font-weight: 800;
  font-size: 22px;
  margin: 0 auto 20px;
  box-shadow: 0 4px 20px rgba(99,102,241,.3);
}

.login-title {
  text-align: center;
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 4px;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.login-sub {
  text-align: center;
  color: var(--text-secondary);
  font-size: 14px;
  margin-bottom: 28px;
}

.login-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
  background: rgba(15,20,35,.6);
  border-radius: var(--radius-md);
  padding: 4px;
}

.login-tab {
  flex: 1;
  padding: 10px;
  text-align: center;
  border-radius: var(--radius-sm);
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.login-tab.active {
  background: var(--gradient-primary);
  color: white;
  box-shadow: 0 2px 12px rgba(99,102,241,.3);
}

.login-tab:not(.active):hover {
  color: var(--text);
  background: rgba(99,102,241,.08);
}

/* ═══════════════════════════════════════════════════
   DASHBOARD LAYOUT
   ═══════════════════════════════════════════════════ */
.app-layout {
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr;
  grid-template-rows: var(--topbar-height) 1fr;
  min-height: 100vh;
}

/* ─── Topbar ─── */
.topbar {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  height: var(--topbar-height);
  background: rgba(10, 14, 26, 0.88);
  backdrop-filter: blur(16px) saturate(1.3);
  -webkit-backdrop-filter: blur(16px) saturate(1.3);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.topbar-logo {
  width: 38px; height: 38px;
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  background: var(--gradient-primary);
  color: white;
  font-weight: 800;
  font-size: 14px;
  flex-shrink: 0;
  box-shadow: 0 2px 10px rgba(99,102,241,.25);
}

.topbar-title {
  font-weight: 700;
  font-size: 16px;
}

.topbar-sub {
  color: var(--text-secondary);
  font-size: 11px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.topbar-user {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  background: rgba(99,102,241,.08);
  border: 1px solid rgba(99,102,241,.15);
  font-size: 13px;
  color: var(--text);
}

.topbar-user .avatar {
  width: 28px; height: 28px;
  border-radius: var(--radius-full);
  background: var(--gradient-primary);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px;
  color: white;
  font-weight: 700;
}

/* ─── Sidebar ─── */
.sidebar {
  grid-row: 2;
  position: sticky;
  top: var(--topbar-height);
  height: calc(100vh - var(--topbar-height));
  overflow-y: auto;
  background: var(--bg-sidebar);
  backdrop-filter: blur(12px);
  border-left: 1px solid var(--border);
  padding: 16px 12px;
  z-index: 50;
  transition: var(--transition);
}

.sidebar-section {
  margin-bottom: 20px;
}

.sidebar-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 0 12px;
  margin-bottom: 8px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  width: 100%;
  text-align: right;
  transition: var(--transition);
  margin-bottom: 2px;
}

.nav-item:hover {
  background: var(--bg-hover);
  color: var(--text);
  border-color: var(--border);
}

.nav-item.active {
  background: linear-gradient(135deg, rgba(99,102,241,.12), rgba(139,92,246,.06));
  border-color: rgba(99,102,241,.25);
  color: var(--primary-light);
  box-shadow: 0 0 12px rgba(99,102,241,.08);
}

.nav-item .nav-icon {
  font-size: 16px;
  width: 22px;
  text-align: center;
  flex-shrink: 0;
}

.nav-item .nav-badge {
  margin-right: auto;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  background: rgba(99,102,241,.15);
  color: var(--primary-light);
}

/* Sidebar customer section */
.sidebar-customer {
  background: rgba(15,23,42,.5);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px;
  margin-top: 12px;
}

.sidebar-customer label {
  font-size: 11px;
  color: var(--text-muted);
  display: block;
  margin-bottom: 4px;
}

.sidebar-customer input {
  width: 100%;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-input);
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
  outline: none;
  margin-bottom: 8px;
  transition: var(--transition-fast);
}

.sidebar-customer input:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

/* ─── Main Content ─── */
.main-content {
  grid-row: 2;
  padding: 20px;
  overflow-y: auto;
  max-width: 100%;
}

/* ─── Page Sections ─── */
.page-section {
  animation: fadeIn .3s ease;
}

/* ═══════════════════════════════════════════════════
   CARDS
   ═══════════════════════════════════════════════════ */
.card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 16px;
  transition: var(--transition);
}

.card:hover {
  border-color: rgba(99,102,241,.18);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.card-title {
  font-size: 18px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-title .icon {
  font-size: 20px;
}

.card-subtitle {
  color: var(--text-secondary);
  font-size: 13px;
}

/* ─── Stat Cards (Dashboard) ─── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.stat-card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  position: relative;
  overflow: hidden;
  transition: var(--transition);
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 80px; height: 80px;
  border-radius: 50%;
  filter: blur(30px);
  opacity: .3;
  pointer-events: none;
}

.stat-card.primary::before { background: var(--primary); }
.stat-card.accent::before { background: var(--accent); }
.stat-card.success::before { background: var(--success); }
.stat-card.warning::before { background: var(--warning); }

.stat-card:hover {
  transform: translateY(-2px);
  border-color: rgba(99,102,241,.25);
  box-shadow: var(--shadow-md);
}

.stat-icon {
  font-size: 28px;
  margin-bottom: 10px;
}

.stat-value {
  font-size: 28px;
  font-weight: 800;
  margin-bottom: 4px;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.stat-card.accent .stat-value {
  background: var(--gradient-accent);
  -webkit-background-clip: text;
  background-clip: text;
}

.stat-label {
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
}

/* ═══════════════════════════════════════════════════
   FORM ELEMENTS
   ═══════════════════════════════════════════════════ */
.form-group {
  display: grid;
  gap: 6px;
  margin-bottom: 14px;
}

.form-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
}

.form-input, .form-select {
  padding: 10px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--bg-input);
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  outline: none;
  width: 100%;
  transition: var(--transition);
}

.form-input:focus, .form-select:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.form-input:disabled {
  opacity: .6;
  cursor: not-allowed;
}

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

/* Legacy support */
input, select {
  padding: 10px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--bg-input);
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  outline: none;
  width: 100%;
  max-width: 100%;
  transition: var(--transition);
}

input:focus, select:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

input:disabled { opacity: .6; }

label {
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
}

.row {
  display: grid;
  gap: 8px;
  margin: 10px 0;
}

.inline {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.grid2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.grid2 > * { min-width: 0; }

/* ═══════════════════════════════════════════════════
   BUTTONS
   ═══════════════════════════════════════════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 18px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--bg-card-solid);
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: var(--transition);
  text-decoration: none;
}

.btn:hover {
  border-color: rgba(99,102,241,.3);
  background: var(--bg-hover);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

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

.btn:disabled {
  opacity: .5;
  cursor: not-allowed;
  transform: none !important;
}

.btn.primary {
  background: var(--gradient-primary);
  border: none;
  color: white;
  box-shadow: 0 2px 12px rgba(99,102,241,.25);
}

.btn.primary:hover {
  box-shadow: 0 4px 20px rgba(99,102,241,.35);
  filter: brightness(1.1);
}

.btn.ghost {
  background: transparent;
  border-color: transparent;
}

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

.btn.danger {
  border-color: rgba(244,63,94,.3);
  color: #fda4af;
}

.btn.danger:hover {
  background: var(--danger-glow);
  border-color: rgba(244,63,94,.5);
}

.btn.success {
  background: linear-gradient(135deg, #10b981, #059669);
  border: none;
  color: white;
}

.btn.small {
  padding: 6px 12px;
  font-size: 12px;
  border-radius: var(--radius-sm);
}

.btn-icon {
  width: 36px; height: 36px;
  padding: 0;
  border-radius: var(--radius-md);
}

/* ═══════════════════════════════════════════════════
   BADGES
   ═══════════════════════════════════════════════════ */
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 28px;
  padding: 0 12px;
  border-radius: var(--radius-full);
  background: rgba(99,102,241,.1);
  border: 1px solid rgba(99,102,241,.2);
  color: var(--primary-light);
  font-size: 13px;
  font-weight: 600;
}

.badge.success { background: var(--success-glow); border-color: rgba(16,185,129,.25); color: var(--success); }
.badge.danger { background: var(--danger-glow); border-color: rgba(244,63,94,.25); color: var(--danger); }
.badge.warning { background: var(--warning-glow); border-color: rgba(245,158,11,.25); color: var(--warning); }

/* ═══════════════════════════════════════════════════
   TABLES
   ═══════════════════════════════════════════════════ */
.tableWrap {
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  max-width: 100%;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 600px;
  background: rgba(10,14,26,.5);
}

th, td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-light);
  font-size: 13px;
  text-align: right;
}

th {
  position: sticky;
  top: 0;
  background: rgba(15,20,35,.95);
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .5px;
  z-index: 2;
}

tbody tr {
  transition: var(--transition-fast);
}

tbody tr:hover {
  background: var(--bg-hover);
}

td input.qty, td input.qtyInput {
  width: 80px;
}

.tableTop {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

body.notVip .priceCol { display: none; }

.priceCol { font-variant-numeric: tabular-nums; }

/* ═══════════════════════════════════════════════════
   MESSAGES & NOTIFICATIONS
   ═══════════════════════════════════════════════════ */
.msg {
  margin-top: 8px;
  color: var(--text-secondary);
  font-size: 13px;
  min-height: 18px;
  word-break: break-word;
}

.msg.err { color: var(--danger); }

.hint {
  color: var(--text-muted);
  font-size: 12px;
  margin-top: 10px;
  line-height: 1.6;
}

.small {
  color: var(--text-secondary);
  font-size: 12px;
}

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

code {
  background: var(--bg-input);
  border: 1px solid var(--border);
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  font-size: 12px;
}

/* ─── Toast Notification ─── */
.toast-container {
  position: fixed;
  top: 80px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  padding: 14px 24px;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 14px;
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: center;
  gap: 10px;
  opacity: 0;
  transform: translateY(-10px);
  transition: all .35s cubic-bezier(.4,0,.2,1);
  max-width: 420px;
  border: 1px solid transparent;
}

.toast.show { opacity: 1; transform: translateY(0); }

.toast.success {
  background: rgba(16,185,129,.12);
  border-color: rgba(16,185,129,.3);
  color: #6ee7b7;
}

.toast.error {
  background: rgba(244,63,94,.12);
  border-color: rgba(244,63,94,.3);
  color: #fda4af;
}

.toast.info {
  background: rgba(99,102,241,.12);
  border-color: rgba(99,102,241,.3);
  color: #a5b4fc;
}

.toast.warning {
  background: rgba(245,158,11,.12);
  border-color: rgba(245,158,11,.3);
  color: #fcd34d;
}

/* ─── skeleton ─── */
.skeleton {
  background: linear-gradient(90deg, var(--bg-card-solid) 25%, rgba(30,40,60,.6) 50%, var(--bg-card-solid) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
  height: 16px;
}

/* ═══════════════════════════════════════════════════
   GROUPS / CHIPS
   ═══════════════════════════════════════════════════ */
.groupBar {
  display: flex;
  align-items: center;
  gap: 8px;
}

.groupScroller {
  --chips-per-view: 6;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: calc((100% - (var(--chips-per-view) - 1) * 8px) / var(--chips-per-view));
  gap: 8px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-input);
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}

.groupScroller::-webkit-scrollbar { height: 4px; }
.groupScroller::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-secondary);
  cursor: pointer;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 500;
  transition: var(--transition);
  user-select: none;
}

.chip:hover {
  border-color: rgba(99,102,241,.3);
  color: var(--text);
  background: var(--bg-hover);
  transform: translateY(-1px);
}

.chip.active {
  border-color: rgba(99,102,241,.5);
  background: linear-gradient(135deg, rgba(99,102,241,.15), rgba(139,92,246,.08));
  color: var(--primary-light);
  box-shadow: 0 0 12px var(--primary-glow);
}

/* ─── Column Picker ─── */
.colPicker {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.pill {
  padding: 6px 12px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
  background: var(--bg-input);
  cursor: pointer;
  font-size: 12px;
  color: var(--text-muted);
  transition: var(--transition-fast);
}

.pill.on {
  border-color: rgba(99,102,241,.4);
  color: var(--primary-light);
  background: rgba(99,102,241,.08);
}

.chk {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
  background: var(--bg-input);
  cursor: pointer;
  font-size: 12px;
  color: var(--text);
  user-select: none;
  transition: var(--transition-fast);
}

.chk:hover {
  border-color: rgba(99,102,241,.3);
}

.chk input {
  accent-color: var(--primary);
}

/* ─── Qty Controls ─── */
.qtyWrap {
  display: flex;
  align-items: center;
  gap: 6px;
}

.qtyBtn {
  width: 34px; height: 34px;
  border-radius: var(--radius-sm);
  display: grid;
  place-items: center;
  font-size: 16px;
}

.qtyInput {
  width: 72px;
  text-align: center;
}

/* ─── infoTip ─── */
.infoTip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px; height: 20px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
  font-size: 11px;
  opacity: .7;
  cursor: help;
  vertical-align: middle;
  margin-inline-start: 4px;
}

/* ─── Pagination ─── */
.pagination-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.pageBtn {
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  min-width: 36px;
  text-align: center;
}

.pageBtn.active {
  background: var(--gradient-primary);
  border: none;
  color: white;
  box-shadow: 0 2px 10px rgba(99,102,241,.25);
}

/* ─── Link button ─── */
.linkBtn {
  background: transparent;
  border: none;
  color: var(--primary-light);
  cursor: pointer;
  padding: 0;
  font: inherit;
  text-decoration: underline;
  transition: var(--transition-fast);
}

.linkBtn:hover { opacity: .8; }

/* ─── Mini Card ─── */
.miniCard {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: rgba(15,23,42,.3);
}

/* ─── Container for non-layout pages (login, profile) ─── */
.container {
  max-width: 1200px;
  margin: 20px auto;
  padding: 0 16px;
}

/* ─── Dialog ─── */
dialog {
  background: var(--bg-card-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  color: var(--text);
  box-shadow: var(--shadow-lg);
  max-width: 95vw;
  padding: 24px;
}

dialog::backdrop {
  background: rgba(0,0,0,.6);
  backdrop-filter: blur(4px);
}

/* ─── Hamburger ─── */
.nav-toggle {
  display: none;
  width: 40px; height: 40px;
  border-radius: var(--radius-md);
  background: rgba(99,102,241,.08);
  border: 1px solid rgba(99,102,241,.2);
  color: var(--primary-light);
  font-size: 20px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: var(--transition-fast);
}

.nav-toggle:hover {
  background: rgba(99,102,241,.15);
}

.navBackdrop {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,.5);
  backdrop-filter: blur(4px);
  z-index: 49;
}

body.navOpen .navBackdrop { display: block; }

/* ─── Quick Actions ─── */
.quick-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
}

.quick-action {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 18px 12px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--bg-card);
  cursor: pointer;
  transition: var(--transition);
  text-align: center;
  font-family: inherit;
  color: var(--text);
}

.quick-action:hover {
  border-color: rgba(99,102,241,.3);
  background: var(--bg-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.quick-action .qa-icon {
  font-size: 24px;
}

.quick-action .qa-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
}

/* ─── Activity item ─── */
.activity-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-light);
}

.activity-item:last-child { border-bottom: none; }

.activity-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--primary);
  flex-shrink: 0;
}

.activity-text {
  font-size: 13px;
  color: var(--text-secondary);
  flex: 1;
}

.activity-time {
  font-size: 11px;
  color: var(--text-muted);
  flex-shrink: 0;
}

/* ═══════════════════════════════════════════════════
   ANIMATIONS
   ═══════════════════════════════════════════════════ */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

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

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

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

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

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-6px); }
}

.animate-fade { animation: fadeIn .4s ease; }
.animate-slide { animation: slideUp .5s cubic-bezier(.4,0,.2,1); }
.animate-slide-right { animation: slideInRight .4s ease; }

/* ─── Stagger children ─── */
.stagger > * { animation: fadeIn .3s ease both; }
.stagger > *:nth-child(1) { animation-delay: .05s; }
.stagger > *:nth-child(2) { animation-delay: .1s; }
.stagger > *:nth-child(3) { animation-delay: .15s; }
.stagger > *:nth-child(4) { animation-delay: .2s; }
.stagger > *:nth-child(5) { animation-delay: .25s; }

/* ═══════════════════════════════════════════════════
   USER-SPECIFIC (non-admin) LAYOUT
   ═══════════════════════════════════════════════════ */
.user-layout {
  max-width: 1100px;
  margin: 0 auto;
  padding: 20px 16px;
}

.user-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  height: var(--topbar-height);
  background: rgba(10, 14, 26, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

/* Cart page top */
.cartTop {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

/* Line total column */
.lineTotalCol { font-variant-numeric: tabular-nums; }

/* ═══════════════════════════════════════════════════
   RESPONSIVE — TABLET  (≤ 1024px)
   ═══════════════════════════════════════════════════ */
@media (max-width: 1024px) {
  .grid2 { grid-template-columns: 1fr; }

  .nav-toggle { display: inline-flex; }

  .app-layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: fixed;
    top: 0; bottom: 0;
    right: 0;
    width: 280px;
    max-width: 85vw;
    transform: translateX(100%);
    visibility: hidden;
    transition: transform .3s cubic-bezier(.4,0,.2,1), visibility 0s .3s;
    z-index: 90;
    border-radius: var(--radius-xl) 0 0 var(--radius-xl);
    border-left: none;
    padding-top: 20px;
    background: rgba(10,14,26,.97);
    backdrop-filter: blur(20px);
  }

  body.navOpen .sidebar {
    transform: translateX(0);
    visibility: visible;
    transition: transform .3s cubic-bezier(.4,0,.2,1), visibility 0s 0s;
  }

  .main-content {
    grid-column: 1;
  }

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

/* ═══════════════════════════════════════════════════
   RESPONSIVE — PHONE (≤ 768px)
   ═══════════════════════════════════════════════════ */
@media (max-width: 768px) {
  .main-content { padding: 12px; }
  .container { padding: 0 10px; margin: 12px auto; }

  .topbar { padding: 0 12px; }
  .topbar-title { font-size: 14px; }
  .topbar-sub { display: none; }
  .topbar-logo { width: 32px; height: 32px; font-size: 12px; }

  .topbar-user { font-size: 11px; padding: 4px 10px; }
  .topbar-user .user-name { display: none; }

  .card { padding: 14px; border-radius: var(--radius-lg); margin-bottom: 12px; }

  .stat-card { padding: 14px; }
  .stat-value { font-size: 22px; }
  .stat-label { font-size: 12px; }

  .btn { padding: 8px 14px; font-size: 13px; }
  input, select { padding: 8px 12px; font-size: 13px; border-radius: var(--radius-sm); }

  table { min-width: 400px; }
  th, td { padding: 8px 8px; font-size: 12px; }
  td input.qty, td input.qtyInput { width: 64px; }

  .qtyBtn { width: 30px; height: 30px; font-size: 14px; }
  .qtyInput { width: 56px; font-size: 13px; }
  .qtyWrap { gap: 4px; }

  .groupScroller { --chips-per-view: 3; padding: 4px; }
  .chip { padding: 6px 10px; font-size: 12px; }

  .chk { padding: 4px 8px; font-size: 11px; }

  .inline { gap: 6px; }
  .row { gap: 6px; margin: 8px 0; }
  .tableTop { flex-direction: column; align-items: stretch; }

  .msg { font-size: 12px; }
  .hint { font-size: 11px; }
  .small { font-size: 11px; }
  .badge { font-size: 11px; height: 24px; padding: 0 8px; }

  .stats-grid { grid-template-columns: 1fr 1fr; gap: 10px; }

  .login-card { padding: 28px 20px; }
  .login-logo { width: 52px; height: 52px; font-size: 18px; }
  .login-title { font-size: 20px; }

  .quick-actions { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .quick-action { padding: 14px 8px; }
}

/* ═══════════════════════════════════════════════════
   RESPONSIVE — VERY SMALL (≤ 420px)
   ═══════════════════════════════════════════════════ */
@media (max-width: 420px) {
  table { min-width: 320px; }
  .container { padding: 0 6px; }
  .card { padding: 10px; border-radius: var(--radius-md); }
  .topbar { padding: 0 8px; }
  .topbar-logo { width: 28px; height: 28px; font-size: 11px; }
  .topbar-title { font-size: 13px; }

  .groupScroller { --chips-per-view: 2; }
  .qtyBtn { width: 28px; height: 28px; }
  .qtyInput { width: 48px; font-size: 12px; }

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

/* ═══════════════════════════════════════════════════
   PRINT
   ═══════════════════════════════════════════════════ */
@media print {
  .sidebar, .topbar, .nav-toggle, .navBackdrop, .btn, .toast-container { display: none !important; }
  .app-layout { grid-template-columns: 1fr; grid-template-rows: 1fr; }
  .main-content { padding: 0; }
  body { background: white; color: black; }
  .card { box-shadow: none; border: 1px solid #ddd; background: white; }
}
